tav-ui
Version:
1 lines • 919 B
Source Map (JSON)
{"version":3,"file":"useFormContext2.mjs","sources":["../../../../../../../../packages/components/form/src/hooks/useFormContext.ts"],"sourcesContent":["/* eslint-disable symbol-description */\nimport { createContext, useContext } from '@tav-ui/hooks/core/useContext'\nimport type { InjectionKey } from 'vue'\n\nexport interface FormContextProps {\n resetAction: () => Promise<void>\n submitAction: () => Promise<void>\n}\n\nconst key: InjectionKey<FormContextProps> = Symbol()\n\nexport function createFormContext(context: FormContextProps) {\n return createContext<FormContextProps>(context, key)\n}\n\nexport function useFormContext() {\n return useContext<FormContextProps>(key)\n}\n"],"names":[],"mappings":";;AACA,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;AACd,SAAS,iBAAiB,CAAC,OAAO,EAAE;AAC3C,EAAE,OAAO,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AACrC,CAAC;AACM,SAAS,cAAc,GAAG;AACjC,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;AACzB;;;;"}