@jswork/react-ant-form-schema 1.0.16 → 1.0.18

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 CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var h=Object.defineProperty;var n=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var y=(e,t,o)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,l=(e,t)=>{for(var o in t||(t={}))u.call(t,o)&&y(e,o,t[o]);if(n)for(var o of n(t))A.call(t,o)&&y(e,o,t[o]);return e};var N=(e,t)=>h(e,"name",{value:t,configurable:!0});var C=(e,t)=>{var o={};for(var r in e)u.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&n)for(var r of n(e))t.indexOf(r)<0&&A.call(e,r)&&(o[r]=e[r]);return o};var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _antd = require('antd');var _niceformreact = require('@ebay/nice-form-react'); var _niceformreact2 = _interopRequireDefault(_niceformreact);function s(e,t){let o=l({},e);for(let r in t)t[r]&&typeof t[r]=="object"&&!Array.isArray(t[r])?o[r]=s(o[r]||{},t[r]):o[r]=t[r];return o}N(s,"deepMerge");var w="react-ant-form-schema",v={vertical:{layout:"vertical",wrapperProps:{labelCol:{span:4}}},horizontal:{layout:"horizontal",wrapperProps:{labelCol:{span:24}}}},L={header:null,layout:"horizontal"},T=_react2.default.forwardRef((e,t)=>{var i,d;let f=l(l({},L),e),{className:o,meta:r,header:b,children:x,actionsClassName:z,layout:c}=f,M=C(f,["className","meta","header","children","actionsClassName","layout"]),P=x,a=s(v[c],r),p=c||(a==null?void 0:a.layout),R=p==="horizontal"?(d=(i=a==null?void 0:a.wrapperProps)==null?void 0:i.labelCol)==null?void 0:d.span:0;return _react2.default.createElement(_antd.Form,l({"data-component":w,className:_classnames2.default.call(void 0, w,o),layout:p,ref:t},M),b,_react2.default.createElement(_niceformreact2.default,{meta:a}),_react2.default.createElement(_antd.Form.Item,{wrapperCol:{offset:R},className:z,style:{marginBottom:0}},P))}),F=T;var K=F;exports.default = K;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var h=Object.defineProperty;var n=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;var d=(t,e,o)=>e in t?h(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,a=(t,e)=>{for(var o in e||(e={}))y.call(e,o)&&d(t,o,e[o]);if(n)for(var o of n(e))u.call(e,o)&&d(t,o,e[o]);return t};var A=(t,e)=>h(t,"name",{value:e,configurable:!0});var N=(t,e)=>{var o={};for(var r in t)y.call(t,r)&&e.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&n)for(var r of n(t))e.indexOf(r)<0&&u.call(t,r)&&(o[r]=t[r]);return o};var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _antd = require('antd');var _niceformreact = require('@ebay/nice-form-react'); var _niceformreact2 = _interopRequireDefault(_niceformreact);function p(t,e){let o=a({},t);for(let r in e)e[r]&&typeof e[r]=="object"&&!Array.isArray(e[r])?o[r]=p(o[r]||{},e[r]):o[r]=e[r];return o}A(p,"deepMerge");var E="react-ant-form-schema",g={vertical:{layout:"vertical",wrapperProps:{labelCol:{span:24}}},horizontal:{layout:"horizontal",wrapperProps:{labelCol:{span:4}}}},v={header:null,layout:"horizontal"},L=_react2.default.forwardRef((t,e)=>{var f,i;let c=a(a({},v),t),{className:o,meta:r,header:F,children:b,actionsClassName:x,layout:s}=c,z=N(c,["className","meta","header","children","actionsClassName","layout"]),M=b,l=p(g[s],r),P=s==="horizontal"?(i=(f=l==null?void 0:l.wrapperProps)==null?void 0:f.labelCol)==null?void 0:i.span:0;return _react2.default.createElement(_antd.Form,a({"data-component":E,className:_classnames2.default.call(void 0, E,o),layout:s,ref:e},z),F,_react2.default.createElement(_niceformreact2.default,{meta:l}),_react2.default.createElement(_antd.Form.Item,{wrapperCol:{offset:P},className:x,style:{marginBottom:0}},M))}),w=L;var J=w;exports.default = J;
2
2
 
3
3
  module.exports = exports.default;
4
4
  //# sourceMappingURL=main.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/ap7/github/react-ant-form-schema/packages/lib/dist/main.cjs.js","../src/index.tsx","../src/utils.ts","../src/main.tsx"],"names":["deepMerge","target","source","result","__spreadValues","key","Array","isArray","CLASS_NAME","DEFAULT_META","vertical","layout","wrapperProps","labelCol","span","horizontal","defaultProps","header","ReactAntdFormSchema","React","forwardRef","props","ref","_b","_c","_a","className","meta","children","actionsClassName","rest","footerNode","_meta","_layout","_offset","Form","data-component","cx","NiceForm","Item","wrapperCol","offset","style","marginBottom","index_default","main_default"],"mappings":"AAAA,6KAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,qBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,oBAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAM,CAAM,CAAC,CAAA,CAAA,YAAc,CAAC,CAAA,CAAA,CAAA,QAAM,CAAM,CAAC,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,CAAC,CAAA,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,CACRX,GAAAA,CAAKA,CAAAA,CAAAA,CACDQ,CAAAA,CAAAA,CACHb,CAAAA,CACDE,eAAAA,CAAA,aAAA,CAACmB,uBAAAA,CAAAA,CAASX,IAAAA,CAAMK,CAAAA,CAAAA,CAAAA,CAChBb,eAAAA,CAAA,aAAA,CAACgB,UAAAA,CAAKI,IAAAA,CAAI,CACRC,UAAAA,CAAY,CAAEC,MAAAA,CAAQP,CAAQ,CAAA,CAC9BR,SAAAA,CAAWG,CAAAA,CACXa,KAAAA,CAAO,CAAEC,YAAAA,CAAc,CAAE,CAAA,CAAA,CACxBZ,CAAAA,CAAAA,CAIT,CAAA,CAAA,CAGFa,CAAAA,CAAe1B,CAAAA,CE5Ef,IAAA2B,CAAAA,CAAe3B,CAAAA,CAAAA,oBAAAA","file":"/Users/ap7/github/react-ant-form-schema/packages/lib/dist/main.cjs.js","sourcesContent":[null,"import cx from 'classnames';\nimport React, { ReactNode } from 'react';\nimport { Form, FormInstance, FormProps } from 'antd';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\nimport { deepMerge } from './utils';\n\nconst CLASS_NAME = 'react-ant-form-schema';\nconst DEFAULT_META = {\n vertical: {\n layout: 'vertical',\n wrapperProps: {\n labelCol: {\n span: 4,\n },\n },\n },\n\n horizontal: {\n layout: 'horizontal',\n wrapperProps: {\n labelCol: {\n span: 24,\n },\n },\n },\n};\n\n\nexport type ReactAntdFormSchemaProps = {\n /**\n * The form schema meta data.\n */\n meta: NiceFormMeta;\n /**\n * The header content.\n */\n header?: ReactNode;\n /**\n * The form actions className.\n */\n actionsClassName?: string;\n} & FormProps;\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 _meta = deepMerge(DEFAULT_META[layout!], meta) as NiceFormMeta;\n const _layout = layout || _meta?.layout;\n const _offset = _layout === 'horizontal' ? _meta?.wrapperProps?.labelCol?.span : 0;\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 <NiceForm meta={_meta} />\n <Form.Item\n wrapperCol={{ offset: _offset }}\n className={actionsClassName}\n style={{ marginBottom: 0 }}>\n {footerNode}\n </Form.Item>\n </Form>\n );\n }\n);\n\nexport default ReactAntdFormSchema;\n","/**\n * @Author: aric 1290657123@qq.com\n * @Date: 2025-10-18 21:20:55\n * @LastEditors: aric 1290657123@qq.com\n * @LastEditTime: 2025-10-22 08:55:52\n */\n\ntype AnyObject = { [key: string]: any };\n\nexport function deepMerge(target: AnyObject, source: AnyObject) {\n const result = { ...target };\n for (const key in source) {\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n result[key] = deepMerge(result[key] || {}, source[key]);\n } else {\n result[key] = source[key];\n }\n }\n return result;\n}\n","import ReactAntdFormSchema from '.';\nimport { ReactAntdFormSchemaProps } from '.';\n\nexport default ReactAntdFormSchema;\nexport type { ReactAntdFormSchemaProps };\n"]}
1
+ {"version":3,"sources":["/Users/ap7/github/react-ant-form-schema/packages/lib/dist/main.cjs.js","../src/index.tsx","../src/utils.ts","../src/main.tsx"],"names":["deepMerge","target","source","result","__spreadValues","key","Array","isArray","CLASS_NAME","DEFAULT_META","vertical","layout","wrapperProps","labelCol","span","horizontal","defaultProps","header","ReactAntdFormSchema","React","forwardRef","props","ref","_b","_c","_a","className","meta","children","actionsClassName","rest","footerNode","_meta","_offset","Form","data-component","cx","NiceForm","Item","wrapperCol","offset","style","marginBottom","index_default","main_default"],"mappings":"AAAA,6KAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,qBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,cA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CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAA+BlB,IAAAA,CAAO,CAAA,CAEhF,OACEK,eAAAA,CAAA,aAAA,CAACe,UAAAA,CAAAA,CAAAA,CAAAA,CACCC,gBAAAA,CAAgB3B,CAAAA,CAChBkB,SAAAA,CAAWU,kCAAAA,CAAG5B,CAAYkB,CAAAA,CAAAA,CAC1Bf,MAAAA,CAAQA,CAAAA,CACRW,GAAAA,CAAKA,CAAAA,CAAAA,CACDQ,CAAAA,CAAAA,CACHb,CAAAA,CACDE,eAAAA,CAAA,aAAA,CAACkB,uBAAAA,CAAAA,CAASV,IAAAA,CAAMK,CAAAA,CAAAA,CAAAA,CAChBb,eAAAA,CAAA,aAAA,CAACe,UAAAA,CAAKI,IAAAA,CAAI,CACRC,UAAAA,CAAY,CAAEC,MAAAA,CAAQP,CAAQ,CAAA,CAC9BP,SAAAA,CAAWG,CAAAA,CACXY,KAAAA,CAAO,CAAEC,YAAAA,CAAc,CAAE,CAAA,CAAA,CACxBX,CAAAA,CAAAA,CAIT,CAAA,CAAA,CAGFY,CAAAA,CAAezB,CAAAA,CE3Ef,IAAA0B,CAAAA,CAAe1B,CAAAA,CAAAA,oBAAAA","file":"/Users/ap7/github/react-ant-form-schema/packages/lib/dist/main.cjs.js","sourcesContent":[null,"import cx from 'classnames';\nimport React, { ReactNode } from 'react';\nimport { Form, FormInstance, FormProps } from 'antd';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\nimport { deepMerge } from './utils';\n\nconst CLASS_NAME = 'react-ant-form-schema';\nconst DEFAULT_META = {\n vertical: {\n layout: 'vertical',\n wrapperProps: {\n labelCol: {\n span: 24,\n },\n },\n },\n\n horizontal: {\n layout: 'horizontal',\n wrapperProps: {\n labelCol: {\n span: 4,\n },\n },\n },\n};\n\n\nexport type ReactAntdFormSchemaProps = {\n /**\n * The form schema meta data.\n */\n meta: NiceFormMeta;\n /**\n * The header content.\n */\n header?: ReactNode;\n /**\n * The form actions className.\n */\n actionsClassName?: string;\n} & FormProps;\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 _meta = deepMerge(DEFAULT_META[layout!], meta) as NiceFormMeta;\n const _offset = layout === 'horizontal' ? _meta?.wrapperProps?.labelCol?.span : 0;\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 <NiceForm meta={_meta} />\n <Form.Item\n wrapperCol={{ offset: _offset }}\n className={actionsClassName}\n style={{ marginBottom: 0 }}>\n {footerNode}\n </Form.Item>\n </Form>\n );\n }\n);\n\nexport default ReactAntdFormSchema;\n","/**\n * @Author: aric 1290657123@qq.com\n * @Date: 2025-10-18 21:20:55\n * @LastEditors: aric 1290657123@qq.com\n * @LastEditTime: 2025-10-22 08:55:52\n */\n\ntype AnyObject = { [key: string]: any };\n\nexport function deepMerge(target: AnyObject, source: AnyObject) {\n const result = { ...target };\n for (const key in source) {\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n result[key] = deepMerge(result[key] || {}, source[key]);\n } else {\n result[key] = source[key];\n }\n }\n return result;\n}\n","import ReactAntdFormSchema from '.';\nimport { ReactAntdFormSchemaProps } from '.';\n\nexport default ReactAntdFormSchema;\nexport type { ReactAntdFormSchemaProps };\n"]}
package/dist/main.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- var h=Object.defineProperty;var n=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var y=(e,t,o)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,l=(e,t)=>{for(var o in t||(t={}))u.call(t,o)&&y(e,o,t[o]);if(n)for(var o of n(t))A.call(t,o)&&y(e,o,t[o]);return e};var N=(e,t)=>h(e,"name",{value:t,configurable:!0});var C=(e,t)=>{var o={};for(var r in e)u.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&n)for(var r of n(e))t.indexOf(r)<0&&A.call(e,r)&&(o[r]=e[r]);return o};import S from"classnames";import m from"react";import{Form as E}from"antd";import g from"@ebay/nice-form-react";function s(e,t){let o=l({},e);for(let r in t)t[r]&&typeof t[r]=="object"&&!Array.isArray(t[r])?o[r]=s(o[r]||{},t[r]):o[r]=t[r];return o}N(s,"deepMerge");var w="react-ant-form-schema",v={vertical:{layout:"vertical",wrapperProps:{labelCol:{span:4}}},horizontal:{layout:"horizontal",wrapperProps:{labelCol:{span:24}}}},L={header:null,layout:"horizontal"},T=m.forwardRef((e,t)=>{var i,d;let f=l(l({},L),e),{className:o,meta:r,header:b,children:x,actionsClassName:z,layout:c}=f,M=C(f,["className","meta","header","children","actionsClassName","layout"]),P=x,a=s(v[c],r),p=c||(a==null?void 0:a.layout),R=p==="horizontal"?(d=(i=a==null?void 0:a.wrapperProps)==null?void 0:i.labelCol)==null?void 0:d.span:0;return m.createElement(E,l({"data-component":w,className:S(w,o),layout:p,ref:t},M),b,m.createElement(g,{meta:a}),m.createElement(E.Item,{wrapperCol:{offset:R},className:z,style:{marginBottom:0}},P))}),F=T;var K=F;export{K as default};
1
+ var h=Object.defineProperty;var n=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;var d=(t,e,o)=>e in t?h(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,a=(t,e)=>{for(var o in e||(e={}))y.call(e,o)&&d(t,o,e[o]);if(n)for(var o of n(e))u.call(e,o)&&d(t,o,e[o]);return t};var A=(t,e)=>h(t,"name",{value:e,configurable:!0});var N=(t,e)=>{var o={};for(var r in t)y.call(t,r)&&e.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&n)for(var r of n(t))e.indexOf(r)<0&&u.call(t,r)&&(o[r]=t[r]);return o};import R from"classnames";import m from"react";import{Form as C}from"antd";import S from"@ebay/nice-form-react";function p(t,e){let o=a({},t);for(let r in e)e[r]&&typeof e[r]=="object"&&!Array.isArray(e[r])?o[r]=p(o[r]||{},e[r]):o[r]=e[r];return o}A(p,"deepMerge");var E="react-ant-form-schema",g={vertical:{layout:"vertical",wrapperProps:{labelCol:{span:24}}},horizontal:{layout:"horizontal",wrapperProps:{labelCol:{span:4}}}},v={header:null,layout:"horizontal"},L=m.forwardRef((t,e)=>{var f,i;let c=a(a({},v),t),{className:o,meta:r,header:F,children:b,actionsClassName:x,layout:s}=c,z=N(c,["className","meta","header","children","actionsClassName","layout"]),M=b,l=p(g[s],r),P=s==="horizontal"?(i=(f=l==null?void 0:l.wrapperProps)==null?void 0:f.labelCol)==null?void 0:i.span:0;return m.createElement(C,a({"data-component":E,className:R(E,o),layout:s,ref:e},z),F,m.createElement(S,{meta:l}),m.createElement(C.Item,{wrapperCol:{offset:P},className:x,style:{marginBottom:0}},M))}),w=L;var J=w;export{J as default};
2
2
  //# sourceMappingURL=main.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.tsx","../src/utils.ts","../src/main.tsx"],"sourcesContent":["import cx from 'classnames';\nimport React, { ReactNode } from 'react';\nimport { Form, FormInstance, FormProps } from 'antd';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\nimport { deepMerge } from './utils';\n\nconst CLASS_NAME = 'react-ant-form-schema';\nconst DEFAULT_META = {\n vertical: {\n layout: 'vertical',\n wrapperProps: {\n labelCol: {\n span: 4,\n },\n },\n },\n\n horizontal: {\n layout: 'horizontal',\n wrapperProps: {\n labelCol: {\n span: 24,\n },\n },\n },\n};\n\n\nexport type ReactAntdFormSchemaProps = {\n /**\n * The form schema meta data.\n */\n meta: NiceFormMeta;\n /**\n * The header content.\n */\n header?: ReactNode;\n /**\n * The form actions className.\n */\n actionsClassName?: string;\n} & FormProps;\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 _meta = deepMerge(DEFAULT_META[layout!], meta) as NiceFormMeta;\n const _layout = layout || _meta?.layout;\n const _offset = _layout === 'horizontal' ? _meta?.wrapperProps?.labelCol?.span : 0;\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 <NiceForm meta={_meta} />\n <Form.Item\n wrapperCol={{ offset: _offset }}\n className={actionsClassName}\n style={{ marginBottom: 0 }}>\n {footerNode}\n </Form.Item>\n </Form>\n );\n }\n);\n\nexport default ReactAntdFormSchema;\n","/**\n * @Author: aric 1290657123@qq.com\n * @Date: 2025-10-18 21:20:55\n * @LastEditors: aric 1290657123@qq.com\n * @LastEditTime: 2025-10-22 08:55:52\n */\n\ntype AnyObject = { [key: string]: any };\n\nexport function deepMerge(target: AnyObject, source: AnyObject) {\n const result = { ...target };\n for (const key in source) {\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n result[key] = deepMerge(result[key] || {}, source[key]);\n } else {\n result[key] = source[key];\n }\n }\n return result;\n}\n","import ReactAntdFormSchema from '.';\nimport { ReactAntdFormSchemaProps } from '.';\n\nexport default ReactAntdFormSchema;\nexport type { ReactAntdFormSchemaProps };\n"],"mappings":"8iBAAA,OAAOA,MAAQ,aACf,OAAOC,MAA0B,QACjC,OAASC,QAAAA,MAAqC,OAC9C,OAAOC,MAAgC,wBCMhC,SAASC,EAAUC,EAAmBC,EAAiB,CAC5D,IAAMC,EAASC,EAAA,GAAKH,GACpB,QAAWI,KAAOH,EACZA,EAAOG,CAAAA,GAAQ,OAAOH,EAAOG,C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CACRC,WAAY,CAAEC,OAAQP,CAAQ,EAC9BT,UAAWG,EACXc,MAAO,CAAEC,aAAc,CAAE,GACxBb,CAAAA,CAAAA,CAIT,CAAA,EAGFc,EAAe5B,EE5Ef,IAAA6B,EAAeC","names":["cx","React","Form","NiceForm","deepMerge","target","source","result","__spreadValues","key","Array","isArray","CLASS_NAME","DEFAULT_META","vertical","layout","wrapperProps","labelCol","span","horizontal","defaultProps","header","ReactAntdFormSchema","React","forwardRef","props","ref","_b","_c","_a","__spreadValues","className","meta","children","actionsClassName","rest","footerNode","_meta","deepMerge","_layout","_offset","Form","data-component","cx","NiceForm","Item","wrapperCol","offset","style","marginBottom","index_default","main_default","ReactAntdFormSchema"]}
1
+ {"version":3,"sources":["../src/index.tsx","../src/utils.ts","../src/main.tsx"],"sourcesContent":["import cx from 'classnames';\nimport React, { ReactNode } from 'react';\nimport { Form, FormInstance, FormProps } from 'antd';\nimport NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';\nimport { deepMerge } from './utils';\n\nconst CLASS_NAME = 'react-ant-form-schema';\nconst DEFAULT_META = {\n vertical: {\n layout: 'vertical',\n wrapperProps: {\n labelCol: {\n span: 24,\n },\n },\n },\n\n horizontal: {\n layout: 'horizontal',\n wrapperProps: {\n labelCol: {\n span: 4,\n },\n },\n },\n};\n\n\nexport type ReactAntdFormSchemaProps = {\n /**\n * The form schema meta data.\n */\n meta: NiceFormMeta;\n /**\n * The header content.\n */\n header?: ReactNode;\n /**\n * The form actions className.\n */\n actionsClassName?: string;\n} & FormProps;\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 _meta = deepMerge(DEFAULT_META[layout!], meta) as NiceFormMeta;\n const _offset = layout === 'horizontal' ? _meta?.wrapperProps?.labelCol?.span : 0;\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 <NiceForm meta={_meta} />\n <Form.Item\n wrapperCol={{ offset: _offset }}\n className={actionsClassName}\n style={{ marginBottom: 0 }}>\n {footerNode}\n </Form.Item>\n </Form>\n );\n }\n);\n\nexport default ReactAntdFormSchema;\n","/**\n * @Author: aric 1290657123@qq.com\n * @Date: 2025-10-18 21:20:55\n * @LastEditors: aric 1290657123@qq.com\n * @LastEditTime: 2025-10-22 08:55:52\n */\n\ntype AnyObject = { [key: string]: any };\n\nexport function deepMerge(target: AnyObject, source: AnyObject) {\n const result = { ...target };\n for (const key in source) {\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n result[key] = deepMerge(result[key] || {}, source[key]);\n } else {\n result[key] = source[key];\n }\n }\n return result;\n}\n","import ReactAntdFormSchema from '.';\nimport { ReactAntdFormSchemaProps } from '.';\n\nexport default ReactAntdFormSchema;\nexport type { ReactAntdFormSchemaProps };\n"],"mappings":"8iBAAA,OAAOA,MAAQ,aACf,OAAOC,MAA0B,QACjC,OAASC,QAAAA,MAAqC,OAC9C,OAAOC,MAAgC,wBCMhC,SAASC,EAAUC,EAAmBC,EAAiB,CAC5D,IAAMC,EAASC,EAAA,GAAKH,GACpB,QAAWI,KAAOH,EACZA,EAAOG,CAAAA,GAAQ,OAAOH,EAAOG,CAAAA,GAAS,UAAY,CAACC,MAAMC,QAAQL,EAAOG,CAAAA,CAAI,EAC9EF,EAAOE,CAAAA,EAAOL,EAAUG,EAAOE,CAAAA,GAAQ,CAAC,EAAGH,EAAOG,CAAAA,CAAI,EAEtDF,EAAOE,CAAAA,EAAOH,EAAOG,CAAAA,EAGzB,OAAOF,CACT,CAVgBH,EAAAA,EAAAA,aDHhB,IAAMQ,EAAa,wBACbC,EAAe,CACnBC,SAAU,CACRC,OAAQ,WACRC,aAAc,CACZC,SAAU,CACRC,KAAM,EACR,CACF,CACF,EAEAC,WAAY,CACVJ,OAAQ,aACRC,aAAc,CACZC,SAAU,CACRC,KAAM,CACR,CACF,CACF,CACF,EAkBME,EAAkD,CACtDC,OAAQ,KACRN,OAAQ,YACV,EAEMO,EAAsBC,EAAMC,WAChC,CAACC,EAAOC,IAAAA,CAjDV,IAAAC,EAAAC,EAkDI,IAAiFC,EAAAC,IAAA,GAC5EV,GACAK,GAFGM,WAAAA,EAAWC,KAAAA,EAAMX,OAAAA,EAAQY,SAAAA,EAAUC,iBAAAA,EAAkBnB,OAAAA,CAlDjE,EAkDqFc,EAATM,EAAAA,EAASN,EAATM,CAAhEJ,YAAWC,OAAMX,SAAQY,WAAUC,mBAAkBnB,WAIvDqB,EAAaH,EACbI,EAAQC,EAAUzB,EAAaE,CAAAA,EAAUiB,CAAAA,EACzCO,EAAUxB,IAAW,cAAesB,GAAAA,EAAAA,GAAAA,YAAAA,EAAOrB,eAAPqB,YAAAA,EAAqBpB,WAArBoB,YAAAA,EAA+BnB,KAAO,EAEhF,OACEK,EAAA,cAACiB,EAAAA,EAAAA,CACCC,iBAAgB7B,EAChBmB,UAAWW,EAAG9B,EAAYmB,CAAAA,EAC1BhB,OAAQA,EACRW,IAAKA,GACDS,GACHd,EACDE,EAAA,cAACoB,EAAAA,CAASX,KAAMK,IAChBd,EAAA,cAACiB,EAAKI,KAAI,CACRC,WAAY,CAAEC,OAAQP,CAAQ,EAC9BR,UAAWG,EACXa,MAAO,CAAEC,aAAc,CAAE,GACxBZ,CAAAA,CAAAA,CAIT,CAAA,EAGFa,EAAe3B,EE3Ef,IAAA4B,EAAeC","names":["cx","React","Form","NiceForm","deepMerge","target","source","result","__spreadValues","key","Array","isArray","CLASS_NAME","DEFAULT_META","vertical","layout","wrapperProps","labelCol","span","horizontal","defaultProps","header","ReactAntdFormSchema","React","forwardRef","props","ref","_b","_c","_a","__spreadValues","className","meta","children","actionsClassName","rest","footerNode","_meta","deepMerge","_offset","Form","data-component","cx","NiceForm","Item","wrapperCol","offset","style","marginBottom","index_default","main_default","ReactAntdFormSchema"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/react-ant-form-schema",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.esm.js",
6
6
  "types": "dist/main.d.ts",
package/src/index.tsx CHANGED
@@ -10,7 +10,7 @@ const DEFAULT_META = {
10
10
  layout: 'vertical',
11
11
  wrapperProps: {
12
12
  labelCol: {
13
- span: 4,
13
+ span: 24,
14
14
  },
15
15
  },
16
16
  },
@@ -19,7 +19,7 @@ const DEFAULT_META = {
19
19
  layout: 'horizontal',
20
20
  wrapperProps: {
21
21
  labelCol: {
22
- span: 24,
22
+ span: 4,
23
23
  },
24
24
  },
25
25
  },
@@ -54,14 +54,13 @@ const ReactAntdFormSchema = React.forwardRef<FormInstance, ReactAntdFormSchemaPr
54
54
  };
55
55
  const footerNode = children as ReactNode;
56
56
  const _meta = deepMerge(DEFAULT_META[layout!], meta) as NiceFormMeta;
57
- const _layout = layout || _meta?.layout;
58
- const _offset = _layout === 'horizontal' ? _meta?.wrapperProps?.labelCol?.span : 0;
57
+ const _offset = layout === 'horizontal' ? _meta?.wrapperProps?.labelCol?.span : 0;
59
58
 
60
59
  return (
61
60
  <Form
62
61
  data-component={CLASS_NAME}
63
62
  className={cx(CLASS_NAME, className)}
64
- layout={_layout}
63
+ layout={layout}
65
64
  ref={ref}
66
65
  {...rest}>
67
66
  {header}