{"version":3,"file":"form.mjs","sources":["../../../../packages/tokens/form.ts"],"sourcesContent":["import type { InjectionKey, UnwrapRef } from 'vue'\n// import type {\n//   RuleItem,\n//   ValidateError,\n//   ValidateFieldsError,\n// } from 'async-validator'\nimport type { ComponentSize } from '@bigin/constants'\nimport type {\n  FormItemProps,\n  FormLabelWidthContext,\n} from '@bigin/components/form'\n// import type { Arrayable } from '@bigin/utils'\n\n// export interface FormItemRule extends RuleItem {\n//   trigger?: Arrayable<string>\n// }\n// export type FormRules = Partial<Record<string, Arrayable<FormItemRule>>>\n\n// export type FormValidationResult = Promise<boolean>\n// export type FormValidateCallback = (\n//   isValid: boolean,\n//   invalidFields?: ValidateFieldsError\n// ) => void\n// export interface FormValidateFailure {\n//   errors: ValidateError[] | null\n//   fields: ValidateFieldsError\n// }\n\nexport type FormContext = UnwrapRef<FormLabelWidthContext>\n\nexport interface FormItemContext extends FormItemProps {\n  $el: HTMLDivElement | undefined\n  size: ComponentSize\n  setFocused: (value: boolean) => void\n}\n\nexport const formContextKey: InjectionKey<FormContext> =\n  Symbol('formContextKey')\nexport const formItemContextKey: InjectionKey<FormItemContext> =\n  Symbol('formItemContextKey')\n"],"names":[],"mappings":"AAoCa,MAAA,cAAA,GACX,OAAO,gBAAgB,EAAA;AACZ,MAAA,kBAAA,GACX,OAAO,oBAAoB;;;;"}