@jswork/react-ant-form-schema 1.0.24 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +3 -2
package/dist/main.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/feizheng/github/react-ant-form-schema/packages/lib/dist/main.cjs.js","../src/index.tsx","../src/components/default-form.tsx","../src/components/fieldset-groups.tsx","../src/components/tabs-groups.tsx","../src/types.ts","../src/main.tsx"],"names":["DefaultForm","__name","meta","React","NiceForm","default_form_default","FieldsetGroups","groups","defaultMeta","div","className","map","group","index","groupMeta","__spreadValues","fieldset","key","legend","title","fieldset_groups_default","TabsGroups","tabProps","tabItems","label","children","Tabs","items","tabs_groups_default","GroupsMode","CLASS_NAME","DEFAULT_META","vertical","labelWidth","horizontal","defaultProps","header","layout","ReactAntdFormSchema","forwardRef","props","ref","_a","actionsClassName","rest","footerNode","isGroupsMode","length","groupsMode","Fieldset","renderContent","Form","data-component","cx","Item","wrapperCol","offset","style","marginBottom","index_default","main_default"],"mappings":"AAAA,6KAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,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AAAA,CAAMa,CAAAA,CAAAA,CAAAA,CAAA,CAAA,CAAA,CAAKP,CAAAA,CAAAA,CAAgBN,CAAAA,CAAAA,CAAAA,CAAAA,CAT3B,eAAA,CAAA,CAYtB,OACEC,eAAAA,CAAA,aAAA,CAACgD,UAAAA,CAAAA,CAAAA,CAAAA,CACCC,gBAAAA,CAAgBtB,CAAAA,CAChBpB,SAAAA,CAAW2C,kCAAAA,CAAGvB,CAAYpB,CAAAA,CAAAA,CAC1B2B,MAAAA,CAAQA,CAAAA,CACRI,GAAAA,CAAKA,CAAAA,CAAAA,CACDG,CAAAA,CAAAA,CACHR,CAAAA,CACAc,CAAAA,CAAAA,CAAAA,CACD/C,eAAAA,CAAA,aAAA,CAACgD,UAAAA,CAAKG,IAAAA,CAAI,CACRC,UAAAA,CAAY,CAAEC,MAAAA,CAAQnB,CAAAA,GAAW,YAAA,CAAe7B,CAAAA,EAAAA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAayB,UAAAA,CAAa,CAAE,CAAA,CAC5EvB,SAAAA,CAAWiC,CAAAA,CACXc,KAAAA,CAAO,CAAEC,YAAAA,CAAc,CAAE,CAAA,CAAA,CACxBb,CAAAA,CAAAA,CAIT,CAAA,CAAA,CAGFc,CAAAA,CAAerB,CAAAA,CKnEf,IAAAsB,EAAAA,CAAetB,CAAAA,CAAAA,6CAAAA","file":"/Users/feizheng/github/react-ant-form-schema/packages/lib/dist/main.cjs.js","sourcesContent":[null,"import cx from 'classnames';\nimport React, { type ReactNode } from 'react';\nimport { Form, type FormInstance } from 'antd';\nimport DefaultForm from './components/default-form';\nimport FieldsetGroups from './components/fieldset-groups';\nimport TabsGroups from './components/tabs-groups';\nimport { ReactAntdFormSchemaProps, GroupsMode } from './types';\n\nconst CLASS_NAME = 'react-ant-form-schema';\nconst DEFAULT_META = {\n vertical: {\n labelWidth: 24,\n },\n // 这个是 nice-form-react 默认的 meta 数据,其它设置不生效\n // wrapperProps.labelCol.span 这个属性是 deprecated 的,请使用 labelWidth\n horizontal: {\n labelWidth: 4,\n },\n};\n\nconst defaultProps: Partial<ReactAntdFormSchemaProps> = {\n header: null,\n layout: 'horizontal',\n};\n\nconst ReactAntdFormSchema = React.forwardRef<FormInstance, ReactAntdFormSchemaProps>(\n (props, ref) => {\n const { className, meta, header, children, actionsClassName, layout, ...rest } = {\n ...defaultProps,\n ...props,\n };\n const footerNode = children as ReactNode;\n const defaultMeta = DEFAULT_META[layout!];\n\n // Check if groups mode is enabled\n const isGroupsMode = meta.groups && meta.groups.length > 0;\n const groupsMode = meta.groupsMode || GroupsMode.Fieldset;\n\n // Render form content based on mode\n const renderContent = () => {\n if (isGroupsMode) {\n if (groupsMode === GroupsMode.Tabs) {\n return <TabsGroups groups={meta.groups!} defaultMeta={defaultMeta} tabProps={meta.tabProps} />;\n }\n // fieldset mode (default)\n return <FieldsetGroups groups={meta.groups!} defaultMeta={defaultMeta} />;\n }\n // standard mode\n return <DefaultForm meta={{ ...defaultMeta, ...meta }} />;\n };\n\n return (\n <Form\n data-component={CLASS_NAME}\n className={cx(CLASS_NAME, className)}\n layout={layout}\n ref={ref}\n {...rest}>\n {header}\n {renderContent()}\n <Form.Item\n wrapperCol={{ offset: layout === 'horizontal' ? defaultMeta?.labelWidth : 0 }}\n className={actionsClassName}\n style={{ marginBottom: 0 }}>\n {footerNode}\n </Form.Item>\n </Form>\n );\n },\n);\n\nexport default ReactAntdFormSchema;\n","import React from 'react';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\n\nexport type DefaultFormProps = {\n meta: NiceFormMeta;\n};\n\nconst DefaultForm = ({ meta }: DefaultFormProps) => {\n return <NiceForm meta={meta} />;\n};\n\nexport default DefaultForm;\n","import React from 'react';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\nimport { NiceFormGroup } from '../types';\n\nexport type FieldsetGroupsProps = {\n groups: NiceFormGroup[];\n defaultMeta: Record<string, any>;\n};\n\nconst FieldsetGroups = ({ groups, defaultMeta }: FieldsetGroupsProps) => {\n return (\n <div className=\"react-ant-form-schema-groups\">\n {groups.map((group, index) => {\n const groupMeta = { ...defaultMeta, ...group.meta } as NiceFormMeta;\n return (\n <fieldset key={index} className=\"react-ant-form-schema-fieldset\">\n <legend className=\"react-ant-form-schema-legend\">{group.title}</legend>\n <NiceForm meta={groupMeta} />\n </fieldset>\n );\n })}\n </div>\n );\n};\n\nexport default FieldsetGroups;\n","import React from 'react';\nimport { Tabs, TabsProps } from 'antd';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\nimport { NiceFormGroup } from '../types';\n\nexport type TabsGroupsProps = {\n groups: NiceFormGroup[];\n defaultMeta: Record<string, any>;\n tabProps?: TabsProps;\n};\n\nconst TabsGroups = ({ groups, defaultMeta, tabProps }: TabsGroupsProps) => {\n const tabItems = groups.map((group) => {\n const groupMeta = { ...defaultMeta, ...group.meta } as NiceFormMeta;\n return {\n key: group.title,\n label: group.title,\n children: <NiceForm meta={groupMeta} />,\n };\n });\n\n return (\n <Tabs\n items={tabItems}\n className=\"react-ant-form-schema-tabs\"\n {...tabProps}\n />\n );\n};\n\nexport default TabsGroups;\n","import { TabsProps } from 'antd';\nimport { NiceFormMeta, NiceFormField } from '@ebay/nice-form-react';\nimport { ReactNode } from 'react';\nimport { FormProps } from 'antd';\n\nexport enum GroupsMode {\n Fieldset = 'fieldset',\n Tabs = 'tabs',\n}\n\nexport type NiceFormGroup = {\n /**\n * The group title displayed in legend or tab.\n */\n title: string;\n /**\n * The form meta for this group.\n */\n meta: NiceFormMeta;\n};\n\nexport type ReactAntdFormSchemaMeta = Omit<NiceFormMeta, 'fields'> & {\n /**\n * Form fields for standard mode.\n * Either fields or groups must be provided.\n */\n fields?: NiceFormField[];\n /**\n * Form groups for grouped mode.\n * When groups is provided, fields will be rendered in groups.\n */\n groups?: NiceFormGroup[];\n /**\n * Display mode for groups.\n * - 'fieldset': Render groups as fieldset/legend elements\n * - 'tabs': Render groups as tabs\n */\n groupsMode?: GroupsMode;\n /**\n * Props to pass to Tabs component when groupsMode is 'tabs'.\n */\n tabProps?: TabsProps;\n};\n\nexport type ReactAntdFormSchemaProps = {\n /**\n * The form schema meta data.\n */\n meta: ReactAntdFormSchemaMeta;\n /**\n * The header content.\n */\n header?: ReactNode;\n /**\n * The form actions className.\n */\n actionsClassName?: string;\n} & FormProps;\n","import ReactAntdFormSchema from '.';\nexport type { ReactAntdFormSchemaProps, ReactAntdFormSchemaMeta } from './types';\nexport { GroupsMode } from './types';\n\nexport default ReactAntdFormSchema;\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/feizheng/github/react-ant-form-schema/packages/lib/dist/main.cjs.js","../src/index.tsx","../src/components/default-form.tsx","../src/components/fieldset-groups.tsx","../src/components/tabs-groups.tsx","../src/types.ts","../src/main.tsx"],"names":["DefaultForm","__name","meta","React","NiceForm","default_form_default","FieldsetGroups","groups","defaultMeta","div","className","map","group","index","groupMeta","__spreadValues","fieldset","key","legend","title","fieldset_groups_default","TabsGroups","tabProps","tabItems","label","children","Tabs","items","tabs_groups_default","GroupsMode","CLASS_NAME","DEFAULT_META","vertical","labelWidth","horizontal","defaultProps","header","layout","ReactAntdFormSchema","forwardRef","props","ref","_a","actionsClassName","rest","footerNode","isGroupsMode","length","groupsMode","Fieldset","renderContent","Form","data-component","cx","Item","wrapperCol","offset","style","marginBottom","index_default","main_default"],"mappings":"AAAA,6KAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,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AASC,WAAAA,CAAaA,CAAAA,CAAAA,CAAAA,CAGrDL,eAAAA,CAAA,aAAA,CAACH,CAAAA,CAAAA,CAAYE,IAAAA,CAAMa,CAAAA,CAAAA,CAAAA,CAAA,CAAA,CAAA,CAAKP,CAAAA,CAAAA,CAAgBN,CAAAA,CAAAA,CAAAA,CAAAA,CAT3B,eAAA,CAAA,CAYtB,OACEC,eAAAA,CAAA,aAAA,CAACgD,UAAAA,CAAAA,CAAAA,CAAAA,CACCC,gBAAAA,CAAgBtB,CAAAA,CAChBpB,SAAAA,CAAW2C,kCAAAA,CAAGvB,CAAYpB,CAAAA,CAAAA,CAC1B2B,MAAAA,CAAQA,CAAAA,CACRI,GAAAA,CAAKA,CAAAA,CAAAA,CACDG,CAAAA,CAAAA,CACHR,CAAAA,CACAc,CAAAA,CAAAA,CAAAA,CACD/C,eAAAA,CAAA,aAAA,CAACgD,UAAAA,CAAKG,IAAAA,CAAI,CACRC,UAAAA,CAAY,CAAEC,MAAAA,CAAQnB,CAAAA,GAAW,YAAA,CAAe7B,CAAAA,EAAAA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAayB,UAAAA,CAAa,CAAE,CAAA,CAC5EvB,SAAAA,CAAWiC,CAAAA,CACXc,KAAAA,CAAO,CAAEC,YAAAA,CAAc,CAAE,CAAA,CAAA,CACxBb,CAAAA,CAAAA,CAIT,CAAA,CAAA,CAGFc,CAAAA,CAAerB,CAAAA,CKpEf,IAAAsB,EAAAA,CAAetB,CAAAA,CAAAA,6CAAAA","file":"/Users/feizheng/github/react-ant-form-schema/packages/lib/dist/main.cjs.js","sourcesContent":[null,"import cx from 'classnames';\nimport React, { type ReactNode } from 'react';\nimport { Form, type FormInstance } from 'antd';\nimport { NiceFormMeta } from '@ebay/nice-form-react';\nimport DefaultForm from './components/default-form';\nimport FieldsetGroups from './components/fieldset-groups';\nimport TabsGroups from './components/tabs-groups';\nimport { GroupsMode, ReactAntdFormSchemaProps } from './types';\n\nconst CLASS_NAME = 'react-ant-form-schema';\nconst DEFAULT_META = {\n vertical: {\n labelWidth: 24,\n },\n // 这个是 nice-form-react 默认的 meta 数据,其它设置不生效\n // wrapperProps.labelCol.span 这个属性是 deprecated 的,请使用 labelWidth\n horizontal: {\n labelWidth: 4,\n },\n};\n\nconst defaultProps: Partial<ReactAntdFormSchemaProps> = {\n header: null,\n layout: 'horizontal',\n};\n\nconst ReactAntdFormSchema = React.forwardRef<FormInstance, ReactAntdFormSchemaProps>(\n (props, ref) => {\n const { className, meta, header, children, actionsClassName, layout, ...rest } = {\n ...defaultProps,\n ...props,\n };\n const footerNode = children as ReactNode;\n const defaultMeta = DEFAULT_META[layout!];\n\n // Check if groups mode is enabled\n const isGroupsMode = meta.groups && meta.groups.length > 0;\n const groupsMode = meta.groupsMode || GroupsMode.Fieldset;\n\n // Render form content based on mode\n const renderContent = () => {\n if (isGroupsMode) {\n if (groupsMode === GroupsMode.Tabs) {\n return <TabsGroups groups={meta.groups!} defaultMeta={defaultMeta} tabProps={meta.tabProps} />;\n }\n // fieldset mode (default)\n return <FieldsetGroups groups={meta.groups!} defaultMeta={defaultMeta} />;\n }\n // standard mode\n return <DefaultForm meta={{ ...defaultMeta, ...meta } as NiceFormMeta} />;\n };\n\n return (\n <Form\n data-component={CLASS_NAME}\n className={cx(CLASS_NAME, className)}\n layout={layout}\n ref={ref}\n {...rest}>\n {header}\n {renderContent()}\n <Form.Item\n wrapperCol={{ offset: layout === 'horizontal' ? defaultMeta?.labelWidth : 0 }}\n className={actionsClassName}\n style={{ marginBottom: 0 }}>\n {footerNode}\n </Form.Item>\n </Form>\n );\n },\n);\n\nexport default ReactAntdFormSchema;\n","import React from 'react';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\n\nexport type DefaultFormProps = {\n meta: NiceFormMeta;\n};\n\nconst DefaultForm = ({ meta }: DefaultFormProps) => {\n return <NiceForm meta={meta} />;\n};\n\nexport default DefaultForm;\n","import React from 'react';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\nimport { NiceFormGroup } from '../types';\n\nexport type FieldsetGroupsProps = {\n groups: NiceFormGroup[];\n defaultMeta: Record<string, any>;\n};\n\nconst FieldsetGroups = ({ groups, defaultMeta }: FieldsetGroupsProps) => {\n return (\n <div className=\"react-ant-form-schema-groups\">\n {groups.map((group, index) => {\n const groupMeta = { ...defaultMeta, ...group.meta } as NiceFormMeta;\n return (\n <fieldset key={index} className=\"react-ant-form-schema-fieldset\">\n <legend className=\"react-ant-form-schema-legend\">{group.title}</legend>\n <NiceForm meta={groupMeta} />\n </fieldset>\n );\n })}\n </div>\n );\n};\n\nexport default FieldsetGroups;\n","import React from 'react';\nimport { Tabs, TabsProps } from 'antd';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\nimport { NiceFormGroup } from '../types';\n\nexport type TabsGroupsProps = {\n groups: NiceFormGroup[];\n defaultMeta: Record<string, any>;\n tabProps?: TabsProps;\n};\n\nconst TabsGroups = ({ groups, defaultMeta, tabProps }: TabsGroupsProps) => {\n const tabItems = groups.map((group) => {\n const groupMeta = { ...defaultMeta, ...group.meta } as NiceFormMeta;\n return {\n key: group.title,\n label: group.title,\n children: <NiceForm meta={groupMeta} />,\n };\n });\n\n return (\n <Tabs\n items={tabItems}\n className=\"react-ant-form-schema-tabs\"\n {...tabProps}\n />\n );\n};\n\nexport default TabsGroups;\n","import { TabsProps } from 'antd';\nimport { NiceFormMeta, NiceFormField } from '@ebay/nice-form-react';\nimport { ReactNode } from 'react';\nimport { FormProps } from 'antd';\n\nexport enum GroupsMode {\n Fieldset = 'fieldset',\n Tabs = 'tabs',\n}\n\nexport type NiceFormGroup = {\n /**\n * The group title displayed in legend or tab.\n */\n title: string;\n /**\n * The form meta for this group.\n */\n meta: NiceFormMeta;\n};\n\nexport type ReactAntdFormSchemaMeta = Omit<NiceFormMeta, 'fields'> & {\n /**\n * Form fields for standard mode.\n * Either fields or groups must be provided.\n */\n fields?: NiceFormField[];\n /**\n * Form groups for grouped mode.\n * When groups is provided, fields will be rendered in groups.\n */\n groups?: NiceFormGroup[];\n /**\n * Display mode for groups.\n * - 'fieldset': Render groups as fieldset/legend elements\n * - 'tabs': Render groups as tabs\n */\n groupsMode?: GroupsMode;\n /**\n * Props to pass to Tabs component when groupsMode is 'tabs'.\n */\n tabProps?: TabsProps;\n};\n\nexport type ReactAntdFormSchemaProps = {\n /**\n * The form schema meta data.\n */\n meta: ReactAntdFormSchemaMeta;\n /**\n * The header content.\n */\n header?: ReactNode;\n /**\n * The form actions className.\n */\n actionsClassName?: string;\n} & FormProps;\n","import ReactAntdFormSchema from '.';\nexport type { ReactAntdFormSchemaProps, ReactAntdFormSchemaMeta } from './types';\nexport { GroupsMode } from './types';\n\nexport default ReactAntdFormSchema;\n"]}
|
package/dist/main.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.tsx","../src/components/default-form.tsx","../src/components/fieldset-groups.tsx","../src/components/tabs-groups.tsx","../src/types.ts","../src/main.tsx"],"sourcesContent":["import cx from 'classnames';\nimport React, { type ReactNode } from 'react';\nimport { Form, type FormInstance } from 'antd';\nimport DefaultForm from './components/default-form';\nimport FieldsetGroups from './components/fieldset-groups';\nimport TabsGroups from './components/tabs-groups';\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx","../src/components/default-form.tsx","../src/components/fieldset-groups.tsx","../src/components/tabs-groups.tsx","../src/types.ts","../src/main.tsx"],"sourcesContent":["import cx from 'classnames';\nimport React, { type ReactNode } from 'react';\nimport { Form, type FormInstance } from 'antd';\nimport { NiceFormMeta } from '@ebay/nice-form-react';\nimport DefaultForm from './components/default-form';\nimport FieldsetGroups from './components/fieldset-groups';\nimport TabsGroups from './components/tabs-groups';\nimport { GroupsMode, ReactAntdFormSchemaProps } from './types';\n\nconst CLASS_NAME = 'react-ant-form-schema';\nconst DEFAULT_META = {\n vertical: {\n labelWidth: 24,\n },\n // 这个是 nice-form-react 默认的 meta 数据,其它设置不生效\n // wrapperProps.labelCol.span 这个属性是 deprecated 的,请使用 labelWidth\n horizontal: {\n labelWidth: 4,\n },\n};\n\nconst defaultProps: Partial<ReactAntdFormSchemaProps> = {\n header: null,\n layout: 'horizontal',\n};\n\nconst ReactAntdFormSchema = React.forwardRef<FormInstance, ReactAntdFormSchemaProps>(\n (props, ref) => {\n const { className, meta, header, children, actionsClassName, layout, ...rest } = {\n ...defaultProps,\n ...props,\n };\n const footerNode = children as ReactNode;\n const defaultMeta = DEFAULT_META[layout!];\n\n // Check if groups mode is enabled\n const isGroupsMode = meta.groups && meta.groups.length > 0;\n const groupsMode = meta.groupsMode || GroupsMode.Fieldset;\n\n // Render form content based on mode\n const renderContent = () => {\n if (isGroupsMode) {\n if (groupsMode === GroupsMode.Tabs) {\n return <TabsGroups groups={meta.groups!} defaultMeta={defaultMeta} tabProps={meta.tabProps} />;\n }\n // fieldset mode (default)\n return <FieldsetGroups groups={meta.groups!} defaultMeta={defaultMeta} />;\n }\n // standard mode\n return <DefaultForm meta={{ ...defaultMeta, ...meta } as NiceFormMeta} />;\n };\n\n return (\n <Form\n data-component={CLASS_NAME}\n className={cx(CLASS_NAME, className)}\n layout={layout}\n ref={ref}\n {...rest}>\n {header}\n {renderContent()}\n <Form.Item\n wrapperCol={{ offset: layout === 'horizontal' ? defaultMeta?.labelWidth : 0 }}\n className={actionsClassName}\n style={{ marginBottom: 0 }}>\n {footerNode}\n </Form.Item>\n </Form>\n );\n },\n);\n\nexport default ReactAntdFormSchema;\n","import React from 'react';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\n\nexport type DefaultFormProps = {\n meta: NiceFormMeta;\n};\n\nconst DefaultForm = ({ meta }: DefaultFormProps) => {\n return <NiceForm meta={meta} />;\n};\n\nexport default DefaultForm;\n","import React from 'react';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\nimport { NiceFormGroup } from '../types';\n\nexport type FieldsetGroupsProps = {\n groups: NiceFormGroup[];\n defaultMeta: Record<string, any>;\n};\n\nconst FieldsetGroups = ({ groups, defaultMeta }: FieldsetGroupsProps) => {\n return (\n <div className=\"react-ant-form-schema-groups\">\n {groups.map((group, index) => {\n const groupMeta = { ...defaultMeta, ...group.meta } as NiceFormMeta;\n return (\n <fieldset key={index} className=\"react-ant-form-schema-fieldset\">\n <legend className=\"react-ant-form-schema-legend\">{group.title}</legend>\n <NiceForm meta={groupMeta} />\n </fieldset>\n );\n })}\n </div>\n );\n};\n\nexport default FieldsetGroups;\n","import React from 'react';\nimport { Tabs, TabsProps } from 'antd';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\nimport { NiceFormGroup } from '../types';\n\nexport type TabsGroupsProps = {\n groups: NiceFormGroup[];\n defaultMeta: Record<string, any>;\n tabProps?: TabsProps;\n};\n\nconst TabsGroups = ({ groups, defaultMeta, tabProps }: TabsGroupsProps) => {\n const tabItems = groups.map((group) => {\n const groupMeta = { ...defaultMeta, ...group.meta } as NiceFormMeta;\n return {\n key: group.title,\n label: group.title,\n children: <NiceForm meta={groupMeta} />,\n };\n });\n\n return (\n <Tabs\n items={tabItems}\n className=\"react-ant-form-schema-tabs\"\n {...tabProps}\n />\n );\n};\n\nexport default TabsGroups;\n","import { TabsProps } from 'antd';\nimport { NiceFormMeta, NiceFormField } from '@ebay/nice-form-react';\nimport { ReactNode } from 'react';\nimport { FormProps } from 'antd';\n\nexport enum GroupsMode {\n Fieldset = 'fieldset',\n Tabs = 'tabs',\n}\n\nexport type NiceFormGroup = {\n /**\n * The group title displayed in legend or tab.\n */\n title: string;\n /**\n * The form meta for this group.\n */\n meta: NiceFormMeta;\n};\n\nexport type ReactAntdFormSchemaMeta = Omit<NiceFormMeta, 'fields'> & {\n /**\n * Form fields for standard mode.\n * Either fields or groups must be provided.\n */\n fields?: NiceFormField[];\n /**\n * Form groups for grouped mode.\n * When groups is provided, fields will be rendered in groups.\n */\n groups?: NiceFormGroup[];\n /**\n * Display mode for groups.\n * - 'fieldset': Render groups as fieldset/legend elements\n * - 'tabs': Render groups as tabs\n */\n groupsMode?: GroupsMode;\n /**\n * Props to pass to Tabs component when groupsMode is 'tabs'.\n */\n tabProps?: TabsProps;\n};\n\nexport type ReactAntdFormSchemaProps = {\n /**\n * The form schema meta data.\n */\n meta: ReactAntdFormSchemaMeta;\n /**\n * The header content.\n */\n header?: ReactNode;\n /**\n * The form actions className.\n */\n actionsClassName?: string;\n} & FormProps;\n","import ReactAntdFormSchema from '.';\nexport type { ReactAntdFormSchemaProps, ReactAntdFormSchemaMeta } from './types';\nexport { GroupsMode } from './types';\n\nexport default ReactAntdFormSchema;\n"],"mappings":"8iBAAA,OAAOA,MAAQ,aACf,OAAOC,MAA+B,QACtC,OAASC,QAAAA,MAA+B,OCFxC,OAAOC,MAAW,QAClB,OAAOC,MAAgC,wBAMvC,IAAMC,EAAcC,EAAA,CAAC,CAAEC,KAAAA,CAAI,IAClBC,EAAA,cAACC,EAAAA,CAASF,KAAMA,IADL,eAIpBG,EAAeL,ECXf,OAAOM,MAAW,QAClB,OAAOC,MAAgC,wBAQvC,IAAMC,EAAiBC,EAAA,CAAC,CAAEC,OAAAA,EAAQC,YAAAA,CAAW,IAEzCC,EAAA,cAACC,MAAAA,CAAIC,UAAU,gCACZJ,EAAOK,IAAI,CAACC,EAAOC,IAAAA,CAClB,IAAMC,EAAYC,IAAA,GAAKR,GAAgBK,EAAMI,MAC7C,OACER,EAAA,cAACS,WAAAA,CAASC,IAAKL,EAAOH,UAAU,kCAC9BF,EAAA,cAACW,SAAAA,CAAOT,UAAU,gCAAgCE,EAAMQ,KAAK,EAC7DZ,EAAA,cAACa,EAAAA,CAASL,KAAMF,IAGtB,CAAA,CAAA,EAXiB,kBAgBvBQ,EAAelB,ECzBf,OAAOmB,MAAW,QAClB,OAASC,QAAAA,MAAuB,OAChC,OAAOC,MAAgC,wBASvC,IAAMC,EAAaC,EAAA,CAAC,CAAEC,OAAAA,EAAQC,YAAAA,EAAaC,SAAAA,CAAQ,IAA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ACCC,iBAAgBpC,EAChBe,UAAWsB,EAAGrC,EAAYe,CAAAA,EAC1BR,OAAQA,EACRK,IAAKA,GACDO,GACHb,EACAsB,EAAAA,EACDnB,EAAA,cAAC0B,EAAKG,KAAI,CACRC,WAAY,CAAEC,OAAQjC,IAAW,aAAec,GAAAA,YAAAA,EAAalB,WAAa,CAAE,EAC5EY,UAAWG,EACXuB,MAAO,CAAEC,aAAc,CAAE,GACxBtB,CAAAA,CAAAA,CAIT,CAAA,EAGFuB,EAAenC,EKpEf,IAAAoC,GAAeC","names":["cx","React","Form","React","NiceForm","DefaultForm","__name","meta","React","NiceForm","default_form_default","React","NiceForm","FieldsetGroups","__name","groups","defaultMeta","React","div","className","map","group","index","groupMeta","__spreadValues","meta","fieldset","key","legend","title","NiceForm","fieldset_groups_default","React","Tabs","NiceForm","TabsGroups","__name","groups","defaultMeta","tabProps","tabItems","map","group","groupMeta","__spreadValues","meta","key","title","label","children","React","NiceForm","Tabs","items","className","tabs_groups_default","GroupsMode","CLASS_NAME","DEFAULT_META","vertical","labelWidth","horizontal","defaultProps","header","layout","ReactAntdFormSchema","React","forwardRef","props","ref","_a","__spreadValues","className","meta","children","actionsClassName","rest","footerNode","defaultMeta","isGroupsMode","groups","length","groupsMode","GroupsMode","Fieldset","renderContent","__name","Tabs","TabsGroups","tabProps","FieldsetGroups","DefaultForm","Form","data-component","cx","Item","wrapperCol","offset","style","marginBottom","index_default","main_default","ReactAntdFormSchema"]}
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import cx from 'classnames';
|
|
2
2
|
import React, { type ReactNode } from 'react';
|
|
3
3
|
import { Form, type FormInstance } from 'antd';
|
|
4
|
+
import { NiceFormMeta } from '@ebay/nice-form-react';
|
|
4
5
|
import DefaultForm from './components/default-form';
|
|
5
6
|
import FieldsetGroups from './components/fieldset-groups';
|
|
6
7
|
import TabsGroups from './components/tabs-groups';
|
|
7
|
-
import {
|
|
8
|
+
import { GroupsMode, ReactAntdFormSchemaProps } from './types';
|
|
8
9
|
|
|
9
10
|
const CLASS_NAME = 'react-ant-form-schema';
|
|
10
11
|
const DEFAULT_META = {
|
|
@@ -46,7 +47,7 @@ const ReactAntdFormSchema = React.forwardRef<FormInstance, ReactAntdFormSchemaPr
|
|
|
46
47
|
return <FieldsetGroups groups={meta.groups!} defaultMeta={defaultMeta} />;
|
|
47
48
|
}
|
|
48
49
|
// standard mode
|
|
49
|
-
return <DefaultForm meta={{ ...defaultMeta, ...meta }} />;
|
|
50
|
+
return <DefaultForm meta={{ ...defaultMeta, ...meta } as NiceFormMeta} />;
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
return (
|