dynamicformdjx-react 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ # dynamicformdjx-react
2
+
3
+ 基于 **React** 的动态表单输入组件。
4
+
5
+ Vue 版本 [Document](https://xczcdjx.github.io/dynamicFormDoc/)
6
+
7
+ React 版本 (正在适配)
package/dist/index.cjs ADDED
@@ -0,0 +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`
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=`
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:
10
+ let props = %s;
11
+ <%s {...props} />
12
+ React keys must be passed directly to JSX without using spread:
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;
package/dist/index.css ADDED
@@ -0,0 +1 @@
1
+ .dynamicInput{overflow:hidden;padding:15px}.dynamicInput.small .dyFormList{gap:6px}.dynamicInput.small .dyFormList .typeBtn{padding:.2em .6em;height:18px}.dynamicInput.small .dyFormList>.dItem .input .key{font-size:.7em}.dynamicInput.small .dyFormList>.dItem .input .vInput{padding:.15em .4em}.dynamicInput.small .dyFormList>.dItem .input .vInput .slot{white-space:nowrap}.dynamicInput.small .dyFormList>.dItem .input .vInput .slot>button{padding:.1em .4em;font-size:.8em}.dynamicInput.small .dyFormList>.dItem .btn .bt{padding:.3em .8em}.dynamicInput.large .dyFormList{gap:15px}.dynamicInput.large .dyFormList .dItem{column-gap:20px}.dynamicInput.large .dyFormList .dItem .input .key{font-size:1.2em}.dynamicInput.large .dyFormList .dItem .input .vInput{padding:.5em .4em}.dynamicInput.large .dyFormList .dItem .input .vInput input{font-size:1.2em}.dynamicInput.large .dyFormList .dItem .input .vInput .slot{white-space:nowrap}.dynamicInput.large .dyFormList .dItem .input .vInput .slot>button{padding:.15em .4em;font-size:1em}.dynamicInput.large .dyFormList .dItem .btn .bt{padding:.8em 1.2em}.dynamicInput .dyFormList{overflow:auto;display:grid;gap:10px;padding:10px 5px}.dynamicInput .dyFormList .dItem{width:100%;display:grid;grid-template-columns:1fr 100px;column-gap:0}.dynamicInput .dyFormList .dItem .input{display:flex;justify-content:flex-start;align-items:center;column-gap:15px}.dynamicInput .dyFormList .dItem .input .key{text-align:center;width:150px}.dynamicInput .dyFormList .dItem .input .key.nativeInput{border:1px solid #d2d6dd;padding:.5em .4em;border-radius:3px}.dynamicInput .dyFormList .dItem .input .key.nativeInput:focus{outline:none;box-shadow:0 0 5px #007bff4d}.dynamicInput .dyFormList .dItem .input .vInput{width:100%;border:1px solid #d2d6dd;padding:.2em .4em;border-radius:3px;display:flex;column-gap:5px}.dynamicInput .dyFormList .dItem .input .vInput>.value{border:none;width:100%}.dynamicInput .dyFormList .dItem .input .vInput>.value.nativeV{letter-spacing:3px}.dynamicInput .dyFormList .dItem .input .vInput>.value.nativeV:focus{outline:none}.dynamicInput .dyFormList .dItem .input .vInput .slot{white-space:nowrap}.dynamicInput .dyFormList .dItem .input .vInput .slot>button{font-weight:400;border-radius:3px;font-size:.8em}.dynamicInput .dyFormList .dItem .btn{display:flex;justify-content:flex-end;align-items:center;column-gap:8px}.dynamicInput .dyFormList .dItem .btn .n-button{font-size:25px;padding:10px 12px}.dynamicInput .dyFormList .dItem .btn .el-button+.el-button{margin-left:0}.dynamicInput .dyFormList .dItem .btn .bt{padding:.5em 1em}.dynamicInput .key .el-input__inner,.dynamicInput .isKey .el-input__inner{text-align:center}.dynamicInput .control{display:flex;justify-content:center;align-items:center;margin-top:5px;column-gap:10px}.dynamicInput .bt{color:#fff;border-radius:5px;border:1px solid transparent;padding:.3em .8em;font-size:.9em;font-weight:600;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:.25s;opacity:.9}.dynamicInput .bt:hover{opacity:1}.dynamicInput .bt:disabled{opacity:.35;cursor:not-allowed}.dynamicInput .default{background:#fff;color:#000;border:1px solid #d2d6dd}.dynamicInput .info{background:#8a8e94}.dynamicInput .success{background:#63ba39}.dynamicInput .danger{background:#ea696a}.dynamicInput .aaa{color:red}.dynamicCascadeInput{overflow:hidden;padding:15px}.dynamicCascadeInput.small .dyFormList{gap:6px}.dynamicCascadeInput.small .dyFormList .typeBtn{padding:.2em .6em;height:18px}.dynamicCascadeInput.small .dyFormList>.dItem .input .key{font-size:.7em}.dynamicCascadeInput.small .dyFormList>.dItem .input .vInput{padding:.15em .4em}.dynamicCascadeInput.small .dyFormList>.dItem .input .vInput .slot{white-space:nowrap}.dynamicCascadeInput.small .dyFormList>.dItem .input .vInput .slot>button{padding:.1em .4em;font-size:.8em}.dynamicCascadeInput.small .dyFormList>.dItem .btn .bt{padding:.3em .8em}.dynamicCascadeInput.large .dyFormList{gap:15px}.dynamicCascadeInput.large .dyFormList .dItem{column-gap:20px}.dynamicCascadeInput.large .dyFormList .dItem .input .key{font-size:1.2em}.dynamicCascadeInput.large .dyFormList .dItem .input .vInput{padding:.5em .4em}.dynamicCascadeInput.large .dyFormList .dItem .input .vInput input{font-size:1.2em}.dynamicCascadeInput.large .dyFormList .dItem .input .vInput .slot{white-space:nowrap}.dynamicCascadeInput.large .dyFormList .dItem .input .vInput .slot>button{padding:.15em .4em;font-size:1em}.dynamicCascadeInput.large .dyFormList .dItem .btn .bt{padding:.8em 1.2em}.dynamicCascadeInput .dyFormList{overflow:auto;display:grid;gap:10px;padding:10px 5px}.dynamicCascadeInput .dyFormList .dItem{width:100%;display:grid;grid-template-columns:1fr 100px;column-gap:0}.dynamicCascadeInput .dyFormList .dItem .input{display:flex;justify-content:flex-start;align-items:center;column-gap:15px}.dynamicCascadeInput .dyFormList .dItem .input .key{text-align:center;width:150px}.dynamicCascadeInput .dyFormList .dItem .input .key.nativeInput{border:1px solid #d2d6dd;padding:.5em .4em;border-radius:3px}.dynamicCascadeInput .dyFormList .dItem .input .key.nativeInput:focus{outline:none;box-shadow:0 0 5px #007bff4d}.dynamicCascadeInput .dyFormList .dItem .input .vInput{width:100%;border:1px solid #d2d6dd;padding:.2em .4em;border-radius:3px;display:flex;column-gap:5px}.dynamicCascadeInput .dyFormList .dItem .input .vInput>.value{border:none;width:100%}.dynamicCascadeInput .dyFormList .dItem .input .vInput>.value.nativeV{letter-spacing:3px}.dynamicCascadeInput .dyFormList .dItem .input .vInput>.value.nativeV:focus{outline:none}.dynamicCascadeInput .dyFormList .dItem .input .vInput .slot{white-space:nowrap}.dynamicCascadeInput .dyFormList .dItem .input .vInput .slot>button{font-weight:400;border-radius:3px;font-size:.8em}.dynamicCascadeInput .dyFormList .dItem .btn{display:flex;justify-content:flex-end;align-items:center;column-gap:8px}.dynamicCascadeInput .dyFormList .dItem .btn .n-button{font-size:25px;padding:10px 12px}.dynamicCascadeInput .dyFormList .dItem .btn .el-button+.el-button{margin-left:0}.dynamicCascadeInput .dyFormList .dItem .btn .bt{padding:.5em 1em}.dynamicCascadeInput .key .el-input__inner,.dynamicCascadeInput .isKey .el-input__inner{text-align:center}.dynamicCascadeInput .control{display:flex;justify-content:center;align-items:center;margin-top:5px;column-gap:10px}.dynamicCascadeInput .bt{color:#fff;border-radius:5px;border:1px solid transparent;padding:.3em .8em;font-size:.9em;font-weight:600;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:.25s;opacity:.9}.dynamicCascadeInput .bt:hover{opacity:1}.dynamicCascadeInput .bt:disabled{opacity:.35;cursor:not-allowed}.dynamicCascadeInput .default{background:#fff;color:#000;border:1px solid #d2d6dd}.dynamicCascadeInput .info{background:#8a8e94}.dynamicCascadeInput .success{background:#63ba39}.dynamicCascadeInput .danger{background:#ea696a}.dynamicCascadeInput .aaa{color:red}.dynamicCascadeInput .dyFormList .dItem{width:inherit}.dynamicCascadeInput .dyFormList .dItem .vInput .surSlot{white-space:nowrap}.dynamicCascadeInput .dyFormList .dItem .vInput .surSlot>button{padding:.1em .4em;font-size:.8em}.dynamicCascadeInput .dyFormList .dItem .input .value.isKey{text-align:center}.dynamicCascadeInput .dyFormList .dItem .input .value.isKey input{font-weight:700}.dynamicCascadeInput .dyFormList>.depth-1{display:grid;border:1px solid var(--c1);border-style:dashed;border-radius:5px}.dynamicCascadeInput .dyFormList>.depth-1>.dItem{padding:5px}.dynamicCascadeInput .dyFormList>.depth-1 .dItem+.dItem{margin-top:5px}.dynamicCascadeInput .dyFormList>.depth-1.no-pad>.dItem{padding:0}.dynamicCascadeInput .dyFormList .depth-1 .depth-2{border:1px solid var(--c2);border-style:dashed;padding:8px;border-radius:5px;margin-top:10px;row-gap:-3px}.dynamicCascadeInput .dyFormList .depth-1 .depth-2 .dItem .btn .n-button{transform:scale(.84)}.dynamicCascadeInput .dyFormList .depth-1 .depth-2 .depth-3{border:1px solid var(--c3);border-style:dashed;padding:7px;border-radius:5px;margin-top:9px;row-gap:-5px}.dynamicCascadeInput .dyFormList .depth-1 .depth-2 .depth-3 .dItem .btn .n-button{transform:scale(.76)}.dynamicCascadeInput .dyFormList .depth-1 .depth-2 .depth-3 .depth-4{border:1px solid var(--c4);border-style:dashed;padding:6px;border-radius:5px;margin-top:8px;row-gap:-7px}.dynamicCascadeInput .dyFormList .depth-1 .depth-2 .depth-3 .depth-4 .dItem .btn .n-button{transform:scale(.68)}.dynamicCascadeInput .dyFormList .depth-1 .depth-2 .depth-3 .depth-4 .depth-5{border:1px solid var(--c5);border-style:dashed;padding:5px;border-radius:5px;margin-top:7px;row-gap:-9px}.dynamicCascadeInput .dyFormList .depth-1 .depth-2 .depth-3 .depth-4 .depth-5 .dItem .btn .n-button{transform:scale(.6)}.dynamicCascadeInput .dyFormList .no-border{border:none!important}.dynamicCascadeInput .dyFormList .no-pad{padding:0!important}@media(max-width:756px){.dynamicInput .dyFormList .dItem .input .key{width:50px}.dynamicInput .dyFormList .dItem .input .value{width:calc(100% - 60px)}}
@@ -0,0 +1,4 @@
1
+ import { default as DynamicInput } from './origin/DynamicInput.tsx';
2
+ import { ExposeType } from './types';
3
+ export type dynamicFormRef = ExposeType;
4
+ export { DynamicInput };
package/dist/index.mjs ADDED
@@ -0,0 +1,622 @@
1
+ import we, { forwardRef as cr, useImperativeHandle as vr } from "react";
2
+ import './index.css';var U = { exports: {} }, D = {};
3
+ var Te;
4
+ function dr() {
5
+ if (Te) return D;
6
+ Te = 1;
7
+ var A = we, h = 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 };
8
+ function j(E, f, O) {
9
+ var p, y = {}, b = null, W = null;
10
+ O !== void 0 && (b = "" + O), f.key !== void 0 && (b = "" + f.key), f.ref !== void 0 && (W = f.ref);
11
+ for (p in f) T.call(f, p) && !$.hasOwnProperty(p) && (y[p] = f[p]);
12
+ if (E && E.defaultProps) for (p in f = E.defaultProps, f) y[p] === void 0 && (y[p] = f[p]);
13
+ return { $$typeof: h, type: E, key: b, ref: W, props: y, _owner: I.current };
14
+ }
15
+ return D.Fragment = C, D.jsx = j, D.jsxs = j, D;
16
+ }
17
+ var F = {};
18
+ var Oe;
19
+ function pr() {
20
+ return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && (function() {
21
+ var A = we, h = 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"), E = 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"), b = Symbol.for("react.lazy"), W = Symbol.for("react.offscreen"), H = Symbol.iterator, Ce = "@@iterator";
22
+ function je(e) {
23
+ if (e === null || typeof e != "object")
24
+ return null;
25
+ var r = H && e[H] || e[Ce];
26
+ return typeof r == "function" ? r : null;
27
+ }
28
+ var S = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
29
+ function c(e) {
30
+ {
31
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
32
+ t[n - 1] = arguments[n];
33
+ xe("error", e, t);
34
+ }
35
+ }
36
+ function xe(e, r, t) {
37
+ {
38
+ var n = S.ReactDebugCurrentFrame, o = n.getStackAddendum();
39
+ o !== "" && (r += "%s", t = t.concat([o]));
40
+ var u = t.map(function(i) {
41
+ return String(i);
42
+ });
43
+ u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
44
+ }
45
+ }
46
+ var ke = !1, De = !1, Fe = !1, Ae = !1, Ie = !1, Z;
47
+ Z = Symbol.for("react.module.reference");
48
+ function $e(e) {
49
+ 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 === b || e.$$typeof === y || e.$$typeof === j || e.$$typeof === E || e.$$typeof === f || // This needs to include all possible module reference object
50
+ // types supported by any Flight configuration anywhere since
51
+ // we don't know which Flight build this will end up being used
52
+ // with.
53
+ e.$$typeof === Z || e.getModuleId !== void 0));
54
+ }
55
+ function We(e, r, t) {
56
+ var n = e.displayName;
57
+ if (n)
58
+ return n;
59
+ var o = r.displayName || r.name || "";
60
+ return o !== "" ? t + "(" + o + ")" : t;
61
+ }
62
+ function Q(e) {
63
+ return e.displayName || "Context";
64
+ }
65
+ function R(e) {
66
+ if (e == null)
67
+ return null;
68
+ 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")
69
+ return e.displayName || e.name || null;
70
+ if (typeof e == "string")
71
+ return e;
72
+ switch (e) {
73
+ case T:
74
+ return "Fragment";
75
+ case C:
76
+ return "Portal";
77
+ case $:
78
+ return "Profiler";
79
+ case I:
80
+ return "StrictMode";
81
+ case O:
82
+ return "Suspense";
83
+ case p:
84
+ return "SuspenseList";
85
+ }
86
+ if (typeof e == "object")
87
+ switch (e.$$typeof) {
88
+ case E:
89
+ var r = e;
90
+ return Q(r) + ".Consumer";
91
+ case j:
92
+ var t = e;
93
+ return Q(t._context) + ".Provider";
94
+ case f:
95
+ return We(e, e.render, "ForwardRef");
96
+ case y:
97
+ var n = e.displayName || null;
98
+ return n !== null ? n : R(e.type) || "Memo";
99
+ case b: {
100
+ var o = e, u = o._payload, i = o._init;
101
+ try {
102
+ return R(i(u));
103
+ } catch {
104
+ return null;
105
+ }
106
+ }
107
+ }
108
+ return null;
109
+ }
110
+ var _ = Object.assign, x = 0, ee, re, te, ne, ae, ie, oe;
111
+ function ue() {
112
+ }
113
+ ue.__reactDisabledLog = !0;
114
+ function Ye() {
115
+ {
116
+ if (x === 0) {
117
+ ee = console.log, re = console.info, te = console.warn, ne = console.error, ae = console.group, ie = console.groupCollapsed, oe = console.groupEnd;
118
+ var e = {
119
+ configurable: !0,
120
+ enumerable: !0,
121
+ value: ue,
122
+ writable: !0
123
+ };
124
+ Object.defineProperties(console, {
125
+ info: e,
126
+ log: e,
127
+ warn: e,
128
+ error: e,
129
+ group: e,
130
+ groupCollapsed: e,
131
+ groupEnd: e
132
+ });
133
+ }
134
+ x++;
135
+ }
136
+ }
137
+ function Le() {
138
+ {
139
+ if (x--, x === 0) {
140
+ var e = {
141
+ configurable: !0,
142
+ enumerable: !0,
143
+ writable: !0
144
+ };
145
+ Object.defineProperties(console, {
146
+ log: _({}, e, {
147
+ value: ee
148
+ }),
149
+ info: _({}, e, {
150
+ value: re
151
+ }),
152
+ warn: _({}, e, {
153
+ value: te
154
+ }),
155
+ error: _({}, e, {
156
+ value: ne
157
+ }),
158
+ group: _({}, e, {
159
+ value: ae
160
+ }),
161
+ groupCollapsed: _({}, e, {
162
+ value: ie
163
+ }),
164
+ groupEnd: _({}, e, {
165
+ value: oe
166
+ })
167
+ });
168
+ }
169
+ x < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
170
+ }
171
+ }
172
+ var N = S.ReactCurrentDispatcher, J;
173
+ function Y(e, r, t) {
174
+ {
175
+ if (J === void 0)
176
+ try {
177
+ throw Error();
178
+ } catch (o) {
179
+ var n = o.stack.trim().match(/\n( *(at )?)/);
180
+ J = n && n[1] || "";
181
+ }
182
+ return `
183
+ ` + J + e;
184
+ }
185
+ }
186
+ var q = !1, L;
187
+ {
188
+ var Ve = typeof WeakMap == "function" ? WeakMap : Map;
189
+ L = new Ve();
190
+ }
191
+ function se(e, r) {
192
+ if (!e || q)
193
+ return "";
194
+ {
195
+ var t = L.get(e);
196
+ if (t !== void 0)
197
+ return t;
198
+ }
199
+ var n;
200
+ q = !0;
201
+ var o = Error.prepareStackTrace;
202
+ Error.prepareStackTrace = void 0;
203
+ var u;
204
+ u = N.current, N.current = null, Ye();
205
+ try {
206
+ if (r) {
207
+ var i = function() {
208
+ throw Error();
209
+ };
210
+ if (Object.defineProperty(i.prototype, "props", {
211
+ set: function() {
212
+ throw Error();
213
+ }
214
+ }), typeof Reflect == "object" && Reflect.construct) {
215
+ try {
216
+ Reflect.construct(i, []);
217
+ } catch (d) {
218
+ n = d;
219
+ }
220
+ Reflect.construct(e, [], i);
221
+ } else {
222
+ try {
223
+ i.call();
224
+ } catch (d) {
225
+ n = d;
226
+ }
227
+ e.call(i.prototype);
228
+ }
229
+ } else {
230
+ try {
231
+ throw Error();
232
+ } catch (d) {
233
+ n = d;
234
+ }
235
+ e();
236
+ }
237
+ } catch (d) {
238
+ if (d && n && typeof d.stack == "string") {
239
+ for (var a = d.stack.split(`
240
+ `), v = n.stack.split(`
241
+ `), s = a.length - 1, l = v.length - 1; s >= 1 && l >= 0 && a[s] !== v[l]; )
242
+ l--;
243
+ for (; s >= 1 && l >= 0; s--, l--)
244
+ if (a[s] !== v[l]) {
245
+ if (s !== 1 || l !== 1)
246
+ do
247
+ if (s--, l--, l < 0 || a[s] !== v[l]) {
248
+ var g = `
249
+ ` + a[s].replace(" at new ", " at ");
250
+ return e.displayName && g.includes("<anonymous>") && (g = g.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, g), g;
251
+ }
252
+ while (s >= 1 && l >= 0);
253
+ break;
254
+ }
255
+ }
256
+ } finally {
257
+ q = !1, N.current = u, Le(), Error.prepareStackTrace = o;
258
+ }
259
+ var w = e ? e.displayName || e.name : "", m = w ? Y(w) : "";
260
+ return typeof e == "function" && L.set(e, m), m;
261
+ }
262
+ function Me(e, r, t) {
263
+ return se(e, !1);
264
+ }
265
+ function Ue(e) {
266
+ var r = e.prototype;
267
+ return !!(r && r.isReactComponent);
268
+ }
269
+ function V(e, r, t) {
270
+ if (e == null)
271
+ return "";
272
+ if (typeof e == "function")
273
+ return se(e, Ue(e));
274
+ if (typeof e == "string")
275
+ return Y(e);
276
+ switch (e) {
277
+ case O:
278
+ return Y("Suspense");
279
+ case p:
280
+ return Y("SuspenseList");
281
+ }
282
+ if (typeof e == "object")
283
+ switch (e.$$typeof) {
284
+ case f:
285
+ return Me(e.render);
286
+ case y:
287
+ return V(e.type, r, t);
288
+ case b: {
289
+ var n = e, o = n._payload, u = n._init;
290
+ try {
291
+ return V(u(o), r, t);
292
+ } catch {
293
+ }
294
+ }
295
+ }
296
+ return "";
297
+ }
298
+ var k = Object.prototype.hasOwnProperty, le = {}, fe = S.ReactDebugCurrentFrame;
299
+ function M(e) {
300
+ if (e) {
301
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
302
+ fe.setExtraStackFrame(t);
303
+ } else
304
+ fe.setExtraStackFrame(null);
305
+ }
306
+ function Ne(e, r, t, n, o) {
307
+ {
308
+ var u = Function.call.bind(k);
309
+ for (var i in e)
310
+ if (u(e, i)) {
311
+ var a = void 0;
312
+ try {
313
+ if (typeof e[i] != "function") {
314
+ var v = 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`.");
315
+ throw v.name = "Invariant Violation", v;
316
+ }
317
+ a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
318
+ } catch (s) {
319
+ a = s;
320
+ }
321
+ a && !(a instanceof Error) && (M(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), M(null)), a instanceof Error && !(a.message in le) && (le[a.message] = !0, M(o), c("Failed %s type: %s", t, a.message), M(null));
322
+ }
323
+ }
324
+ }
325
+ var Je = Array.isArray;
326
+ function B(e) {
327
+ return Je(e);
328
+ }
329
+ function qe(e) {
330
+ {
331
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
332
+ return t;
333
+ }
334
+ }
335
+ function Be(e) {
336
+ try {
337
+ return ce(e), !1;
338
+ } catch {
339
+ return !0;
340
+ }
341
+ }
342
+ function ce(e) {
343
+ return "" + e;
344
+ }
345
+ function ve(e) {
346
+ if (Be(e))
347
+ return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), ce(e);
348
+ }
349
+ var de = S.ReactCurrentOwner, Ke = {
350
+ key: !0,
351
+ ref: !0,
352
+ __self: !0,
353
+ __source: !0
354
+ }, pe, ge;
355
+ function Ge(e) {
356
+ if (k.call(e, "ref")) {
357
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
358
+ if (r && r.isReactWarning)
359
+ return !1;
360
+ }
361
+ return e.ref !== void 0;
362
+ }
363
+ function ze(e) {
364
+ if (k.call(e, "key")) {
365
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
366
+ if (r && r.isReactWarning)
367
+ return !1;
368
+ }
369
+ return e.key !== void 0;
370
+ }
371
+ function Xe(e, r) {
372
+ typeof e.ref == "string" && de.current;
373
+ }
374
+ function He(e, r) {
375
+ {
376
+ var t = function() {
377
+ pe || (pe = !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));
378
+ };
379
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
380
+ get: t,
381
+ configurable: !0
382
+ });
383
+ }
384
+ }
385
+ function Ze(e, r) {
386
+ {
387
+ var t = function() {
388
+ ge || (ge = !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));
389
+ };
390
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
391
+ get: t,
392
+ configurable: !0
393
+ });
394
+ }
395
+ }
396
+ var Qe = function(e, r, t, n, o, u, i) {
397
+ var a = {
398
+ // This tag allows us to uniquely identify this as a React Element
399
+ $$typeof: h,
400
+ // Built-in properties that belong on the element
401
+ type: e,
402
+ key: r,
403
+ ref: t,
404
+ props: i,
405
+ // Record the component responsible for creating this element.
406
+ _owner: u
407
+ };
408
+ return a._store = {}, Object.defineProperty(a._store, "validated", {
409
+ configurable: !1,
410
+ enumerable: !1,
411
+ writable: !0,
412
+ value: !1
413
+ }), Object.defineProperty(a, "_self", {
414
+ configurable: !1,
415
+ enumerable: !1,
416
+ writable: !1,
417
+ value: n
418
+ }), Object.defineProperty(a, "_source", {
419
+ configurable: !1,
420
+ enumerable: !1,
421
+ writable: !1,
422
+ value: o
423
+ }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
424
+ };
425
+ function er(e, r, t, n, o) {
426
+ {
427
+ var u, i = {}, a = null, v = null;
428
+ t !== void 0 && (ve(t), a = "" + t), ze(r) && (ve(r.key), a = "" + r.key), Ge(r) && (v = r.ref, Xe(r, o));
429
+ for (u in r)
430
+ k.call(r, u) && !Ke.hasOwnProperty(u) && (i[u] = r[u]);
431
+ if (e && e.defaultProps) {
432
+ var s = e.defaultProps;
433
+ for (u in s)
434
+ i[u] === void 0 && (i[u] = s[u]);
435
+ }
436
+ if (a || v) {
437
+ var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
438
+ a && He(i, l), v && Ze(i, l);
439
+ }
440
+ return Qe(e, a, v, o, n, de.current, i);
441
+ }
442
+ }
443
+ var K = S.ReactCurrentOwner, ye = S.ReactDebugCurrentFrame;
444
+ function P(e) {
445
+ if (e) {
446
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
447
+ ye.setExtraStackFrame(t);
448
+ } else
449
+ ye.setExtraStackFrame(null);
450
+ }
451
+ var G;
452
+ G = !1;
453
+ function z(e) {
454
+ return typeof e == "object" && e !== null && e.$$typeof === h;
455
+ }
456
+ function Re() {
457
+ {
458
+ if (K.current) {
459
+ var e = R(K.current.type);
460
+ if (e)
461
+ return `
462
+
463
+ Check the render method of \`` + e + "`.";
464
+ }
465
+ return "";
466
+ }
467
+ }
468
+ function rr(e) {
469
+ return "";
470
+ }
471
+ var he = {};
472
+ function tr(e) {
473
+ {
474
+ var r = Re();
475
+ if (!r) {
476
+ var t = typeof e == "string" ? e : e.displayName || e.name;
477
+ t && (r = `
478
+
479
+ Check the top-level render call using <` + t + ">.");
480
+ }
481
+ return r;
482
+ }
483
+ }
484
+ function Ee(e, r) {
485
+ {
486
+ if (!e._store || e._store.validated || e.key != null)
487
+ return;
488
+ e._store.validated = !0;
489
+ var t = tr(r);
490
+ if (he[t])
491
+ return;
492
+ he[t] = !0;
493
+ var n = "";
494
+ e && e._owner && e._owner !== K.current && (n = " It was passed a child from " + R(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);
495
+ }
496
+ }
497
+ function be(e, r) {
498
+ {
499
+ if (typeof e != "object")
500
+ return;
501
+ if (B(e))
502
+ for (var t = 0; t < e.length; t++) {
503
+ var n = e[t];
504
+ z(n) && Ee(n, r);
505
+ }
506
+ else if (z(e))
507
+ e._store && (e._store.validated = !0);
508
+ else if (e) {
509
+ var o = je(e);
510
+ if (typeof o == "function" && o !== e.entries)
511
+ for (var u = o.call(e), i; !(i = u.next()).done; )
512
+ z(i.value) && Ee(i.value, r);
513
+ }
514
+ }
515
+ }
516
+ function nr(e) {
517
+ {
518
+ var r = e.type;
519
+ if (r == null || typeof r == "string")
520
+ return;
521
+ var t;
522
+ if (typeof r == "function")
523
+ t = r.propTypes;
524
+ else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
525
+ // Inner props are checked in the reconciler.
526
+ r.$$typeof === y))
527
+ t = r.propTypes;
528
+ else
529
+ return;
530
+ if (t) {
531
+ var n = R(r);
532
+ Ne(t, e.props, "prop", n, e);
533
+ } else if (r.PropTypes !== void 0 && !G) {
534
+ G = !0;
535
+ var o = R(r);
536
+ c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
537
+ }
538
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
539
+ }
540
+ }
541
+ function ar(e) {
542
+ {
543
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
544
+ var n = r[t];
545
+ if (n !== "children" && n !== "key") {
546
+ P(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), P(null);
547
+ break;
548
+ }
549
+ }
550
+ e.ref !== null && (P(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), P(null));
551
+ }
552
+ }
553
+ var _e = {};
554
+ function me(e, r, t, n, o, u) {
555
+ {
556
+ var i = $e(e);
557
+ if (!i) {
558
+ var a = "";
559
+ (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.");
560
+ var v = rr();
561
+ v ? a += v : a += Re();
562
+ var s;
563
+ e === null ? s = "null" : B(e) ? s = "array" : e !== void 0 && e.$$typeof === h ? (s = "<" + (R(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);
564
+ }
565
+ var l = er(e, r, t, o, u);
566
+ if (l == null)
567
+ return l;
568
+ if (i) {
569
+ var g = r.children;
570
+ if (g !== void 0)
571
+ if (n)
572
+ if (B(g)) {
573
+ for (var w = 0; w < g.length; w++)
574
+ be(g[w], e);
575
+ Object.freeze && Object.freeze(g);
576
+ } else
577
+ 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.");
578
+ else
579
+ be(g, e);
580
+ }
581
+ if (k.call(r, "key")) {
582
+ var m = R(e), d = Object.keys(r).filter(function(fr) {
583
+ return fr !== "key";
584
+ }), X = d.length > 0 ? "{key: someKey, " + d.join(": ..., ") + ": ...}" : "{key: someKey}";
585
+ if (!_e[m + X]) {
586
+ var lr = d.length > 0 ? "{" + d.join(": ..., ") + ": ...}" : "{}";
587
+ c(`A props object containing a "key" prop is being spread into JSX:
588
+ let props = %s;
589
+ <%s {...props} />
590
+ React keys must be passed directly to JSX without using spread:
591
+ let props = %s;
592
+ <%s key={someKey} {...props} />`, X, m, lr, m), _e[m + X] = !0;
593
+ }
594
+ }
595
+ return e === T ? ar(l) : nr(l), l;
596
+ }
597
+ }
598
+ function ir(e, r, t) {
599
+ return me(e, r, t, !0);
600
+ }
601
+ function or(e, r, t) {
602
+ return me(e, r, t, !1);
603
+ }
604
+ var ur = or, sr = ir;
605
+ F.Fragment = T, F.jsx = ur, F.jsxs = sr;
606
+ })()), F;
607
+ }
608
+ var Se;
609
+ function gr() {
610
+ return Se || (Se = 1, process.env.NODE_ENV === "production" ? U.exports = dr() : U.exports = pr()), U.exports;
611
+ }
612
+ var Pe = gr();
613
+ const Rr = cr((A, h) => (vr(h, () => ({
614
+ getResult(C) {
615
+ return {};
616
+ },
617
+ onSet(C) {
618
+ }
619
+ })), /* @__PURE__ */ Pe.jsx("div", { className: "dynamicInput", children: /* @__PURE__ */ Pe.jsx("div", { className: "aaa", children: "aaaaaa" }) })));
620
+ export {
621
+ Rr as DynamicInput
622
+ };
@@ -0,0 +1,6 @@
1
+ import { ExposeType } from '../types';
2
+ type DynamicFormProps = {
3
+ size?: string;
4
+ };
5
+ declare const DynamicInput: import('react').ForwardRefExoticComponent<DynamicFormProps & import('react').RefAttributes<ExposeType>>;
6
+ export default DynamicInput;
@@ -0,0 +1,44 @@
1
+ export {}
2
+ declare global {
3
+ type DyCFormItem = {
4
+ rId: string;
5
+ key: string;
6
+ value: string;
7
+ isArray?: boolean;
8
+ isNumber?: boolean;
9
+ };
10
+ type DyCasFormItem = {
11
+ rId: string;
12
+ key: string;
13
+ value: string | DyCasFormItem[];
14
+ isArray?: boolean
15
+ isNumber?: boolean
16
+ };
17
+ type FSize = "small" | "large" | "default"
18
+ type DyBtnConfig = Record<'resetTxt' | 'newTxt' | 'mergeTxt', string>
19
+ type DyConfig = {
20
+ // 隐藏重置按钮 (默认false)
21
+ hideReset?: boolean;
22
+ // 输入栏最大高度 (默认300px)
23
+ maxHeight?: string;
24
+ // 新增项超过高度时是否自动滚动 (默认true)
25
+ autoScroll?: boolean;
26
+ // 允许输入过滤 (默认true)
27
+ allowFilter?: boolean;
28
+ // ...
29
+ }
30
+ type DyCasConfig = {
31
+ showBorder?:boolean
32
+ retractLen?:number
33
+ borderColors?:string[]
34
+ showPad?:boolean
35
+ } & Omit<DyConfig, 'autoScroll'>
36
+ type DyListConfig = {
37
+ // 分隔符
38
+ arraySplitSymbol: string
39
+ // ...
40
+ }
41
+ type ValueType = Record<string, any>
42
+ // 内部新建键值对id
43
+ type DyRandomFun = (id?: number | string) => string
44
+ }
@@ -0,0 +1,4 @@
1
+ export type ExposeType = {
2
+ onSet?: (obj?: object) => void;
3
+ getResult?: (t: 'res' | 'ori') => DyCFormItem[] | object;
4
+ };
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "dynamicformdjx-react",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "author": "xczcdjx",
6
+ "license": "MIT",
7
+ "description": "Dynamic form for React",
8
+ "main": "dist/index.cjs",
9
+ "module": "dist/index.mjs",
10
+ "types": "dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.mjs",
15
+ "require": "./dist/index.cjs"
16
+ }
17
+ },
18
+ "files": ["dist"],
19
+ "sideEffects": ["**/*.css"],
20
+ "keywords": ["react", "typescript", "dynamicForm"],
21
+ "scripts": {
22
+ "dev-r": "vite",
23
+ "build-r": "tsc -b && vite build",
24
+ "lint": "eslint .",
25
+ "preview": "vite preview"
26
+ },
27
+ "peerDependencies": {
28
+ "react": "^18.0.0",
29
+ "react-dom": "^18.0.0"
30
+ },
31
+ "dependencies": {
32
+ },
33
+ "devDependencies": {
34
+ "@eslint/js": "^9.39.1",
35
+ "@types/node": "^24.10.1",
36
+ "@types/react": "^18.3.27",
37
+ "@types/react-dom": "^18.3.7",
38
+ "@vitejs/plugin-react": "^5.1.1",
39
+ "eslint": "^9.39.1",
40
+ "eslint-plugin-react-hooks": "^7.0.1",
41
+ "eslint-plugin-react-refresh": "^0.4.24",
42
+ "globals": "^16.5.0",
43
+ "less": "^4.4.2",
44
+ "typescript": "~5.9.3",
45
+ "typescript-eslint": "^8.46.4",
46
+ "vite": "^7.2.4",
47
+ "vite-plugin-dts": "^4.5.4",
48
+ "vite-plugin-lib-inject-css": "^2.2.2",
49
+ "antd": "^5.29.1",
50
+ "react": "^18.0.0",
51
+ "react-dom": "^18.0.0"
52
+ }
53
+ }