@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 897 B
Source Map (JSON)
{"version":3,"file":"FormProvider.mjs","names":[],"sources":["../../../src/Form/components/FormProvider.tsx"],"sourcesContent":["'use client';\n\nimport type { FormProps } from 'antd';\nimport { ReactNode, createContext, memo, use } from 'react';\n\ninterface FormContentConfig {\n form?: FormProps['form'];\n initialValues?: FormProps['initialValues'];\n submitLoading?: boolean;\n}\n\nexport const FormContext = createContext<FormContentConfig>({});\n\nexport const FormProvider = memo<{ children: ReactNode; config: FormContentConfig }>(\n ({ children, config }) => {\n return <FormContext value={config}>{children}</FormContext>;\n },\n);\n\nexport const useFormContext = () => {\n return use(FormContext);\n};\n"],"mappings":";;;;;;AAWA,MAAa,cAAc,cAAiC,EAAE,CAAC;AAE/D,MAAa,eAAe,MACzB,EAAE,UAAU,aAAa;AACxB,QAAO,oBAAC;EAAY,OAAO;EAAS;GAAuB;EAE9D;AAED,MAAa,uBAAuB;AAClC,QAAO,IAAI,YAAY"}