import { FlexDirection } from '@oinone/kunlun-vue-ui-common'; import { computed, type ComputedRef, inject, type InjectionKey, provide } from 'vue'; export interface OioDefaultRowContext { flexDirection: ComputedRef; wrap: ComputedRef; } export const defaultDefaultRowContext: OioDefaultRowContext = { flexDirection: computed(() => FlexDirection.Row), wrap: computed(() => true) }; export const OioDefaultRowContextKey: InjectionKey = Symbol('OioDefaultRowContext'); export const useProviderOioDefaultRowContext = (state: Partial): void => { provide(OioDefaultRowContextKey, { ...defaultDefaultRowContext, ...state }); }; export const useInjectOioDefaultRowContext = (): OioDefaultRowContext => { return inject(OioDefaultRowContextKey, defaultDefaultRowContext); };