dynamicformdjx-react 0.0.1 → 0.0.2

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/README.md CHANGED
@@ -2,6 +2,51 @@
2
2
 
3
3
  基于 **React** 的动态表单输入组件。
4
4
 
5
- Vue 版本 [Document](https://xczcdjx.github.io/dynamicFormDoc/)
5
+ React 版本 (正在适配)
6
6
 
7
- React 版本 (正在适配)
7
+ Vue3 版本 [Document](https://xczcdjx.github.io/dynamicFormDoc/)
8
+
9
+ Vue2 版本 (正在适配)
10
+
11
+
12
+ ## 安装
13
+
14
+ ```bash
15
+ # 任意一种
16
+ npm install dynamicformdjx-react
17
+ # or
18
+ yarn add dynamicformdjx-react
19
+ # or
20
+ pnpm add dynamicformdjx-react
21
+ ```
22
+
23
+ ### 基本使用
24
+ ```tsx
25
+ import {useState} from "react";
26
+ import {DynamicInput,dynamicFormRef} from "dynamicformdjx-react";
27
+
28
+ function App() {
29
+ const [obj,setObj]=useState<Record<string, any>>({
30
+ a: 'Hello world',
31
+ b: 1314,
32
+ c: [5, 2, 0]
33
+ });
34
+ const dynamicInputRef=useRef<dynamicFormRef>(null)
35
+ return (<div>
36
+ <DynamicInput ref={dynamicInputRef} isController value={obj} onChange={(e) => setObj(e)}/>
37
+ <pre>
38
+ {JSON.stringify(obj,null, 2)}
39
+ </pre>
40
+ <div>
41
+ <button onClick={() => {
42
+ dynamicInputRef.current.onSet({
43
+ test: 'hello World'
44
+ })
45
+ }}>setData
46
+ </button>
47
+ </div>
48
+ </div>)
49
+ }
50
+
51
+ export default App
52
+ ```
package/dist/index.cjs CHANGED
@@ -1,14 +1,14 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const N=require("react");var U={exports:{}},D={};var Oe;function cr(){if(Oe)return D;Oe=1;var A=N,R=Symbol.for("react.element"),C=Symbol.for("react.fragment"),T=Object.prototype.hasOwnProperty,I=A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$={key:!0,ref:!0,__self:!0,__source:!0};function j(h,f,O){var p,y={},E=null,W=null;O!==void 0&&(E=""+O),f.key!==void 0&&(E=""+f.key),f.ref!==void 0&&(W=f.ref);for(p in f)T.call(f,p)&&!$.hasOwnProperty(p)&&(y[p]=f[p]);if(h&&h.defaultProps)for(p in f=h.defaultProps,f)y[p]===void 0&&(y[p]=f[p]);return{$$typeof:R,type:h,key:E,ref:W,props:y,_owner:I.current}}return D.Fragment=C,D.jsx=j,D.jsxs=j,D}var F={};var Se;function dr(){return Se||(Se=1,process.env.NODE_ENV!=="production"&&(function(){var A=N,R=Symbol.for("react.element"),C=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),h=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),Z=Symbol.iterator,Ce="@@iterator";function je(e){if(e===null||typeof e!="object")return null;var r=Z&&e[Z]||e[Ce];return typeof r=="function"?r:null}var S=A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];xe("error",e,t)}}function xe(e,r,t){{var n=S.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var ke=!1,De=!1,Fe=!1,Ae=!1,Ie=!1,Q;Q=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===T||e===$||Ie||e===I||e===O||e===p||Ae||e===W||ke||De||Fe||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===y||e.$$typeof===j||e.$$typeof===h||e.$$typeof===f||e.$$typeof===Q||e.getModuleId!==void 0))}function We(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function ee(e){return e.displayName||"Context"}function b(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case C:return"Portal";case $:return"Profiler";case I:return"StrictMode";case O:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case h:var r=e;return ee(r)+".Consumer";case j:var t=e;return ee(t._context)+".Provider";case f:return We(e,e.render,"ForwardRef");case y:var n=e.displayName||null;return n!==null?n:b(e.type)||"Memo";case E:{var o=e,u=o._payload,i=o._init;try{return b(i(u))}catch{return null}}}return null}var _=Object.assign,x=0,re,te,ne,ae,ie,oe,ue;function se(){}se.__reactDisabledLog=!0;function Ye(){{if(x===0){re=console.log,te=console.info,ne=console.warn,ae=console.error,ie=console.group,oe=console.groupCollapsed,ue=console.groupEnd;var e={configurable:!0,enumerable:!0,value:se,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}x++}}function Le(){{if(x--,x===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:_({},e,{value:re}),info:_({},e,{value:te}),warn:_({},e,{value:ne}),error:_({},e,{value:ae}),group:_({},e,{value:ie}),groupCollapsed:_({},e,{value:oe}),groupEnd:_({},e,{value:ue})})}x<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=S.ReactCurrentDispatcher,J;function Y(e,r,t){{if(J===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);J=n&&n[1]||""}return`
2
- `+J+e}}var B=!1,L;{var Me=typeof WeakMap=="function"?WeakMap:Map;L=new Me}function le(e,r){if(!e||B)return"";{var t=L.get(e);if(t!==void 0)return t}var n;B=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=q.current,q.current=null,Ye();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(v){n=v}Reflect.construct(e,[],i)}else{try{i.call()}catch(v){n=v}e.call(i.prototype)}}else{try{throw Error()}catch(v){n=v}e()}}catch(v){if(v&&n&&typeof v.stack=="string"){for(var a=v.stack.split(`
3
- `),d=n.stack.split(`
4
- `),s=a.length-1,l=d.length-1;s>=1&&l>=0&&a[s]!==d[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==d[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==d[l]){var g=`
5
- `+a[s].replace(" at new "," at ");return e.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,g),g}while(s>=1&&l>=0);break}}}finally{B=!1,q.current=u,Le(),Error.prepareStackTrace=o}var w=e?e.displayName||e.name:"",m=w?Y(w):"";return typeof e=="function"&&L.set(e,m),m}function Ve(e,r,t){return le(e,!1)}function Ue(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function M(e,r,t){if(e==null)return"";if(typeof e=="function")return le(e,Ue(e));if(typeof e=="string")return Y(e);switch(e){case O:return Y("Suspense");case p:return Y("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Ve(e.render);case y:return M(e.type,r,t);case E:{var n=e,o=n._payload,u=n._init;try{return M(u(o),r,t)}catch{}}}return""}var k=Object.prototype.hasOwnProperty,fe={},ce=S.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);ce.setExtraStackFrame(t)}else ce.setExtraStackFrame(null)}function Ne(e,r,t,n,o){{var u=Function.call.bind(k);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var d=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(V(o),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),V(null)),a instanceof Error&&!(a.message in fe)&&(fe[a.message]=!0,V(o),c("Failed %s type: %s",t,a.message),V(null))}}}var qe=Array.isArray;function K(e){return qe(e)}function Je(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Be(e){try{return de(e),!1}catch{return!0}}function de(e){return""+e}function ve(e){if(Be(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(e)),de(e)}var pe=S.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0},ge,ye;function Ge(e){if(k.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ze(e){if(k.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Xe(e,r){typeof e.ref=="string"&&pe.current}function He(e,r){{var t=function(){ge||(ge=!0,c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Ze(e,r){{var t=function(){ye||(ye=!0,c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Qe=function(e,r,t,n,o,u,i){var a={$$typeof:R,type:e,key:r,ref:t,props:i,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function er(e,r,t,n,o){{var u,i={},a=null,d=null;t!==void 0&&(ve(t),a=""+t),ze(r)&&(ve(r.key),a=""+r.key),Ge(r)&&(d=r.ref,Xe(r,o));for(u in r)k.call(r,u)&&!Ke.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)i[u]===void 0&&(i[u]=s[u])}if(a||d){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&He(i,l),d&&Ze(i,l)}return Qe(e,a,d,o,n,pe.current,i)}}var G=S.ReactCurrentOwner,be=S.ReactDebugCurrentFrame;function P(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);be.setExtraStackFrame(t)}else be.setExtraStackFrame(null)}var z;z=!1;function X(e){return typeof e=="object"&&e!==null&&e.$$typeof===R}function Re(){{if(G.current){var e=b(G.current.type);if(e)return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const U=require("react");var re={exports:{}},z={};var $e;function mr(){if($e)return z;$e=1;var s=U,v=Symbol.for("react.element"),f=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function E(k,p,D){var _,j={},P=null,F=null;D!==void 0&&(P=""+D),p.key!==void 0&&(P=""+p.key),p.ref!==void 0&&(F=p.ref);for(_ in p)a.call(p,_)&&!h.hasOwnProperty(_)&&(j[_]=p[_]);if(k&&k.defaultProps)for(_ in p=k.defaultProps,p)j[_]===void 0&&(j[_]=p[_]);return{$$typeof:v,type:k,key:P,ref:F,props:j,_owner:l.current}}return z.Fragment=f,z.jsx=E,z.jsxs=E,z}var G={};var We;function yr(){return We||(We=1,process.env.NODE_ENV!=="production"&&(function(){var s=U,v=Symbol.for("react.element"),f=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),k=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),F=Symbol.for("react.offscreen"),A=Symbol.iterator,I="@@iterator";function C(e){if(e===null||typeof e!="object")return null;var r=A&&e[A]||e[I];return typeof r=="function"?r:null}var N=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function u(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];S("error",e,t)}}function S(e,r,t){{var n=N.ReactDebugCurrentFrame,c=n.getStackAddendum();c!==""&&(r+="%s",t=t.concat([c]));var d=t.map(function(o){return String(o)});d.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,d)}}var B=!1,g=!1,R=!1,O=!1,Y=!1,$;$=Symbol.for("react.module.reference");function ne(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===h||Y||e===l||e===D||e===_||O||e===F||B||g||R||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===j||e.$$typeof===E||e.$$typeof===k||e.$$typeof===p||e.$$typeof===$||e.getModuleId!==void 0))}function Me(e,r,t){var n=e.displayName;if(n)return n;var c=r.displayName||r.name||"";return c!==""?t+"("+c+")":t}function ve(e){return e.displayName||"Context"}function W(e){if(e==null)return null;if(typeof e.tag=="number"&&u("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case f:return"Portal";case h:return"Profiler";case l:return"StrictMode";case D:return"Suspense";case _:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case k:var r=e;return ve(r)+".Consumer";case E:var t=e;return ve(t._context)+".Provider";case p:return Me(e,e.render,"ForwardRef");case j:var n=e.displayName||null;return n!==null?n:W(e.type)||"Memo";case P:{var c=e,d=c._payload,o=c._init;try{return W(o(d))}catch{return null}}}return null}var L=Object.assign,H=0,pe,me,ye,be,ge,he,Re;function Ee(){}Ee.__reactDisabledLog=!0;function Ve(){{if(H===0){pe=console.log,me=console.info,ye=console.warn,be=console.error,ge=console.group,he=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ee,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}H++}}function Ue(){{if(H--,H===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:L({},e,{value:pe}),info:L({},e,{value:me}),warn:L({},e,{value:ye}),error:L({},e,{value:be}),group:L({},e,{value:ge}),groupCollapsed:L({},e,{value:he}),groupEnd:L({},e,{value:Re})})}H<0&&u("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=N.ReactCurrentDispatcher,ie;function X(e,r,t){{if(ie===void 0)try{throw Error()}catch(c){var n=c.stack.trim().match(/\n( *(at )?)/);ie=n&&n[1]||""}return`
2
+ `+ie+e}}var oe=!1,Z;{var qe=typeof WeakMap=="function"?WeakMap:Map;Z=new qe}function _e(e,r){if(!e||oe)return"";{var t=Z.get(e);if(t!==void 0)return t}var n;oe=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var d;d=ae.current,ae.current=null,Ve();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(T){n=T}Reflect.construct(e,[],o)}else{try{o.call()}catch(T){n=T}e.call(o.prototype)}}else{try{throw Error()}catch(T){n=T}e()}}catch(T){if(T&&n&&typeof T.stack=="string"){for(var i=T.stack.split(`
3
+ `),x=n.stack.split(`
4
+ `),m=i.length-1,y=x.length-1;m>=1&&y>=0&&i[m]!==x[y];)y--;for(;m>=1&&y>=0;m--,y--)if(i[m]!==x[y]){if(m!==1||y!==1)do if(m--,y--,y<0||i[m]!==x[y]){var w=`
5
+ `+i[m].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,w),w}while(m>=1&&y>=0);break}}}finally{oe=!1,ae.current=d,Ue(),Error.prepareStackTrace=c}var J=e?e.displayName||e.name:"",M=J?X(J):"";return typeof e=="function"&&Z.set(e,M),M}function Je(e,r,t){return _e(e,!1)}function Be(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Q(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,Be(e));if(typeof e=="string")return X(e);switch(e){case D:return X("Suspense");case _:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return Je(e.render);case j:return Q(e.type,r,t);case P:{var n=e,c=n._payload,d=n._init;try{return Q(d(c),r,t)}catch{}}}return""}var K=Object.prototype.hasOwnProperty,Se={},xe=N.ReactDebugCurrentFrame;function ee(e){if(e){var r=e._owner,t=Q(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}function He(e,r,t,n,c){{var d=Function.call.bind(K);for(var o in e)if(d(e,o)){var i=void 0;try{if(typeof e[o]!="function"){var x=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}i=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){i=m}i&&!(i instanceof Error)&&(ee(c),u("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof i),ee(null)),i instanceof Error&&!(i.message in Se)&&(Se[i.message]=!0,ee(c),u("Failed %s type: %s",t,i.message),ee(null))}}}var Ke=Array.isArray;function se(e){return Ke(e)}function ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ge(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function je(e){if(Ge(e))return u("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ze(e)),Te(e)}var Ce=N.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},Oe,we;function Ze(e){if(K.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Qe(e){if(K.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function er(e,r){typeof e.ref=="string"&&Ce.current}function rr(e,r){{var t=function(){Oe||(Oe=!0,u("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function tr(e,r){{var t=function(){we||(we=!0,u("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var nr=function(e,r,t,n,c,d,o){var i={$$typeof:v,type:e,key:r,ref:t,props:o,_owner:d};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:c}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function ar(e,r,t,n,c){{var d,o={},i=null,x=null;t!==void 0&&(je(t),i=""+t),Qe(r)&&(je(r.key),i=""+r.key),Ze(r)&&(x=r.ref,er(r,c));for(d in r)K.call(r,d)&&!Xe.hasOwnProperty(d)&&(o[d]=r[d]);if(e&&e.defaultProps){var m=e.defaultProps;for(d in m)o[d]===void 0&&(o[d]=m[d])}if(i||x){var y=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&rr(o,y),x&&tr(o,y)}return nr(e,i,x,c,n,Ce.current,o)}}var ue=N.ReactCurrentOwner,ke=N.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,t=Q(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(t)}else ke.setExtraStackFrame(null)}var le;le=!1;function ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===v}function Pe(){{if(ue.current){var e=W(ue.current.type);if(e)return`
6
6
 
7
- Check the render method of \``+e+"`."}return""}}function rr(e){return""}var he={};function tr(e){{var r=Re();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
7
+ Check the render method of \``+e+"`."}return""}}function ir(e){return""}var Ae={};function or(e){{var r=Pe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
8
8
 
9
- Check the top-level render call using <`+t+">.")}return r}}function Ee(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=tr(r);if(he[t])return;he[t]=!0;var n="";e&&e._owner&&e._owner!==G.current&&(n=" It was passed a child from "+b(e._owner.type)+"."),P(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),P(null)}}function _e(e,r){{if(typeof e!="object")return;if(K(e))for(var t=0;t<e.length;t++){var n=e[t];X(n)&&Ee(n,r)}else if(X(e))e._store&&(e._store.validated=!0);else if(e){var o=je(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)X(i.value)&&Ee(i.value,r)}}}function nr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===y))t=r.propTypes;else return;if(t){var n=b(r);Ne(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!z){z=!0;var o=b(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ar(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){P(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),P(null);break}}e.ref!==null&&(P(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),P(null))}}var me={};function Te(e,r,t,n,o,u){{var i=$e(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var d=rr();d?a+=d:a+=Re();var s;e===null?s="null":K(e)?s="array":e!==void 0&&e.$$typeof===R?(s="<"+(b(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var l=er(e,r,t,o,u);if(l==null)return l;if(i){var g=r.children;if(g!==void 0)if(n)if(K(g)){for(var w=0;w<g.length;w++)_e(g[w],e);Object.freeze&&Object.freeze(g)}else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _e(g,e)}if(k.call(r,"key")){var m=b(e),v=Object.keys(r).filter(function(fr){return fr!=="key"}),H=v.length>0?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}";if(!me[m+H]){var lr=v.length>0?"{"+v.join(": ..., ")+": ...}":"{}";c(`A props object containing a "key" prop is being spread into JSX:
9
+ Check the top-level render call using <`+t+">.")}return r}}function Ie(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=or(r);if(Ae[t])return;Ae[t]=!0;var n="";e&&e._owner&&e._owner!==ue.current&&(n=" It was passed a child from "+W(e._owner.type)+"."),q(e),u('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),q(null)}}function Fe(e,r){{if(typeof e!="object")return;if(se(e))for(var t=0;t<e.length;t++){var n=e[t];ce(n)&&Ie(n,r)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var c=C(e);if(typeof c=="function"&&c!==e.entries)for(var d=c.call(e),o;!(o=d.next()).done;)ce(o.value)&&Ie(o.value,r)}}}function sr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===p||r.$$typeof===j))t=r.propTypes;else return;if(t){var n=W(r);He(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!le){le=!0;var c=W(r);u("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",c||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&u("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){q(e),u("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),q(null);break}}e.ref!==null&&(q(e),u("Invalid attribute `ref` supplied to `React.Fragment`."),q(null))}}var Ne={};function De(e,r,t,n,c,d){{var o=ne(e);if(!o){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var x=ir();x?i+=x:i+=Pe();var m;e===null?m="null":se(e)?m="array":e!==void 0&&e.$$typeof===v?(m="<"+(W(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,u("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,i)}var y=ar(e,r,t,c,d);if(y==null)return y;if(o){var w=r.children;if(w!==void 0)if(n)if(se(w)){for(var J=0;J<w.length;J++)Fe(w[J],e);Object.freeze&&Object.freeze(w)}else u("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(w,e)}if(K.call(r,"key")){var M=W(e),T=Object.keys(r).filter(function(pr){return pr!=="key"}),fe=T.length>0?"{key: someKey, "+T.join(": ..., ")+": ...}":"{key: someKey}";if(!Ne[M+fe]){var vr=T.length>0?"{"+T.join(": ..., ")+": ...}":"{}";u(`A props object containing a "key" prop is being spread into JSX:
10
10
  let props = %s;
11
11
  <%s {...props} />
12
12
  React keys must be passed directly to JSX without using spread:
13
13
  let props = %s;
14
- <%s key={someKey} {...props} />`,H,m,lr,m),me[m+H]=!0}}return e===T?ar(l):nr(l),l}}function ir(e,r,t){return Te(e,r,t,!0)}function or(e,r,t){return Te(e,r,t,!1)}var ur=or,sr=ir;F.Fragment=T,F.jsx=ur,F.jsxs=sr})()),F}var Pe;function vr(){return Pe||(Pe=1,process.env.NODE_ENV==="production"?U.exports=cr():U.exports=dr()),U.exports}var we=vr();const pr=N.forwardRef((A,R)=>(N.useImperativeHandle(R,()=>({getResult(C){return{}},onSet(C){}})),we.jsx("div",{className:"dynamicInput",children:we.jsx("div",{className:"aaa",children:"aaaaaa"})})));exports.DynamicInput=pr;
14
+ <%s key={someKey} {...props} />`,fe,M,vr,M),Ne[M+fe]=!0}}return e===a?ur(y):sr(y),y}}function lr(e,r,t){return De(e,r,t,!0)}function cr(e,r,t){return De(e,r,t,!1)}var fr=cr,dr=lr;G.Fragment=a,G.jsx=fr,G.jsxs=dr})()),G}var Ye;function br(){return Ye||(Ye=1,process.env.NODE_ENV==="production"?re.exports=mr():re.exports=yr()),re.exports}var b=br();const te=(s,v,f)=>Object.keys(s).map((a,l)=>{const h=s[a],E=Array.isArray(h),k=E?h.every(p=>typeof p=="number"):typeof h=="number";return{rId:v(l),key:a,value:E?h.join(f):h,isArray:E||void 0,isNumber:k||void 0}}),de=(s,v)=>s.reduce((f,a)=>(a.key.trim()&&(f[a.key]=gr(a.value,a.isArray,a.isNumber,v)),f),{}),gr=(s,v,f,a=",")=>{let l;return v?f?l=String(s).split(a).map(Number).filter(h=>!Number.isNaN(h)):l=String(s).split(a):f?l=parseFloat(s):l=s.toString(),l},hr=(s,v,f=",")=>{const a=l=>{l=l.replace(/[^\d.-]/g,"");let h=!1;l.startsWith("-")&&(h=!0),l=l.replace(/-/g,"");const E=l.indexOf(".");return E!==-1&&(l=l.slice(0,E+1)+l.slice(E+1).replace(/\./g,"")),(h?"-":"")+l};return v?s.split(f).map(l=>a(l)).join(f):a(s)};function Le(s){var v,f,a="";if(typeof s=="string"||typeof s=="number")a+=s;else if(typeof s=="object")if(Array.isArray(s)){var l=s.length;for(v=0;v<l;v++)s[v]&&(f=Le(s[v]))&&(a&&(a+=" "),a+=f)}else for(f in s)s[f]&&(a&&(a+=" "),a+=f);return a}function V(){for(var s,v,f=0,a="",l=arguments.length;f<l;f++)(s=arguments[f])&&(v=Le(s))&&(a&&(a+=" "),a+=v);return a}const Rr=U.forwardRef((s,v)=>{const{value:f,size:a,isController:l,config:h,btnConfigs:E,dyListConfigs:k,randomFun:p=u=>`${Date.now()}_${u??0}`,onReset:D,onMerge:_,onChange:j}=s,P={resetTxt:"重置",newTxt:"添加项",mergeTxt:"合并",...E},F={hideReset:!1,maxHeight:"300px",autoScroll:!0,allowFilter:!0,...h},A={arraySplitSymbol:",",...k},[I,C]=U.useState(()=>te(f,p,A.arraySplitSymbol)),N=U.useRef(null);return U.useImperativeHandle(v,()=>({getResult(u){return u==="ori"?I:de(I,A.arraySplitSymbol)},onSet(u){C(te(u??f,p,A.arraySplitSymbol))}})),U.useEffect(()=>{l&&j(de(I,A.arraySplitSymbol))},[I]),b.jsxs("div",{className:s.dyCls??`dynamicInput ${a}`,children:[b.jsx("div",{className:"dyFormList",ref:N,style:{maxHeight:F.maxHeight},children:I.map((u,S,B)=>b.jsxs("div",{className:"dItem",children:[b.jsxs("div",{className:"input",children:[b.jsx("input",{value:u.key,className:"key nativeInput",onInput:g=>{const R=g.target.value;C(O=>{const Y=[...O],$=Y[S];return Y[S]={...$,key:R},Y})}}),":",b.jsxs("div",{className:"vInput",children:[b.jsxs("div",{className:"slot",children:[b.jsx("button",{className:V([u.isArray?"success":"default","small","bt"]),onClick:()=>{C(g=>{const R=[...g],O=R[S];return R[S]={...O,isArray:!O.isArray},R})},children:"Array"})," ",b.jsx("button",{className:V([u.isNumber?"success":"default","small","bt"]),onClick:()=>{C(g=>{const R=[...g],O=R[S];return R[S]={...O,isNumber:!O.isNumber},R})},children:"Number"})]}),b.jsx("input",{value:u.value,className:"value nativeV",onInput:g=>{const R=g.target.value;let O=R;u.isNumber&&F.allowFilter&&(O=hr(R,u.isArray,A.arraySplitSymbol)),C(Y=>{const $=[...Y],ne=$[S];return $[S]={...ne,value:O},$})}})]})]}),b.jsxs("div",{className:"btn",children:[b.jsx("button",{className:V([a,"success","bt"]),disabled:S!==B.length-1,onClick:()=>{C(g=>[...g,{rId:p(),key:"",value:""}]),F.autoScroll&&setTimeout(()=>{const g=N.current;g?.scrollTo({top:g?.scrollHeight+20,behavior:"smooth"})})},children:"+"}),b.jsx("button",{className:V(["danger",a,"bt"]),onClick:()=>{C(g=>g.filter(R=>R.rId!==u.rId))},children:"-"})]})]},u.rId))}),b.jsxs("div",{className:"control",children:[!I.length&&b.jsx("button",{className:V(["success",a,"bt"]),onClick:()=>{C(u=>[...u,{rId:p(),key:"",value:""}])},children:P.newTxt}),!l&&b.jsxs(b.Fragment,{children:[!F.hideReset&&b.jsx("button",{className:V(["default",a,"bt"]),onClick:()=>{C(te(f,p,A.arraySplitSymbol)),D?.()},children:P.resetTxt}),b.jsx("button",{className:V(["info",a,"bt"]),onClick:()=>{[...I].sort((B,g)=>+B.rId-+g.rId);const S=de(I,A.arraySplitSymbol);j(S),_?.(S,I),C(te(S,p,A.arraySplitSymbol))},children:P.mergeTxt})]})]})]})});exports.DynamicInput=Rr;