@piying/view-react 1.0.0 → 1.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/index.cjs +4 -4
- package/index.js +170 -170
- package/package.json +1 -1
- package/util/use-control-value-accessor.d.ts +1 -1
package/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),T=require("static-injector"),P=require("@piying/view-core");require("valibot");const be=require("fast-equals");var O={exports:{}},S={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Z;function Ee(){if(Z)return
|
|
9
|
+
*/var Z;function Ee(){if(Z)return S;Z=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(l,o,a){var c=null;if(a!==void 0&&(c=""+a),o.key!==void 0&&(c=""+o.key),"key"in o){a={};for(var g in o)g!=="key"&&(a[g]=o[g])}else a=o;return o=a.ref,{$$typeof:e,type:l,key:c,ref:o!==void 0?o:null,props:a}}return S.Fragment=t,S.jsx=n,S.jsxs=n,S}var k={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Q;function ge(){return Q||(Q=1,process.env.NODE_ENV!=="production"&&function(){function e(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===de?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case
|
|
17
|
+
*/var Q;function ge(){return Q||(Q=1,process.env.NODE_ENV!=="production"&&function(){function e(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===de?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case p:return"Fragment";case d:return"Profiler";case M:return"StrictMode";case le:return"Suspense";case ae:return"SuspenseList";case ce:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case A:return"Portal";case ue:return(r.displayName||"Context")+".Provider";case N:return(r._context.displayName||"Context")+".Consumer";case se:var u=r.render;return r=r.displayName,r||(r=u.displayName||u.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case ie:return u=r.displayName||null,u!==null?u:e(r.type)||"Memo";case q:u=r._payload,r=r._init;try{return e(r(u))}catch{}}return null}function t(r){return""+r}function n(r){try{t(r);var u=!1}catch{u=!0}if(u){u=console;var i=u.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return i.call(u,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),t(r)}}function l(r){if(r===p)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===q)return"<...>";try{var u=e(r);return u?"<"+u+">":"<...>"}catch{return"<...>"}}function o(){var r=F.A;return r===null?null:r.getOwner()}function a(){return Error("react-stack-top-frame")}function c(r){if(U.call(r,"key")){var u=Object.getOwnPropertyDescriptor(r,"key").get;if(u&&u.isReactWarning)return!1}return r.key!==void 0}function g(r,u){function i(){B||(B=!0,console.error("%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://react.dev/link/special-props)",u))}i.isReactWarning=!0,Object.defineProperty(r,"key",{get:i,configurable:!0})}function m(){var r=e(this.type);return J[r]||(J[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function I(r,u,i,b,_,R,D,V){return i=R.ref,r={$$typeof:y,type:r,key:u,props:R,_owner:_},(i!==void 0?i:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:m}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:D}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function C(r,u,i,b,_,R,D,V){var E=u.children;if(E!==void 0)if(b)if(fe(E)){for(b=0;b<E.length;b++)x(E[b]);Object.freeze&&Object.freeze(E)}else console.error("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 x(E);if(U.call(u,"key")){E=e(r);var j=Object.keys(u).filter(function(me){return me!=="key"});b=0<j.length?"{key: someKey, "+j.join(": ..., ")+": ...}":"{key: someKey}",X[E+b]||(j=0<j.length?"{"+j.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,
|
|
22
|
+
<%s key={someKey} {...props} />`,b,E,j,E),X[E+b]=!0)}if(E=null,i!==void 0&&(n(i),E=""+i),c(u)&&(n(u.key),E=""+u.key),"key"in u){i={};for(var G in u)G!=="key"&&(i[G]=u[G])}else i=u;return E&&g(i,typeof r=="function"?r.displayName||r.name||"Unknown":r),I(r,E,R,_,o(),i,D,V)}function x(r){typeof r=="object"&&r!==null&&r.$$typeof===y&&r._store&&(r._store.validated=1)}var h=s,y=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),ue=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),de=Symbol.for("react.client.reference"),F=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,fe=Array.isArray,Y=console.createTask?console.createTask:function(){return null};h={"react-stack-bottom-frame":function(r){return r()}};var B,J={},z=h["react-stack-bottom-frame"].bind(h,a)(),H=Y(l(a)),X={};k.Fragment=p,k.jsx=function(r,u,i,b,_){var R=1e4>F.recentlyCreatedOwnerStacks++;return C(r,u,i,!1,b,_,R?Error("react-stack-top-frame"):z,R?Y(l(r)):H)},k.jsxs=function(r,u,i,b,_){var R=1e4>F.recentlyCreatedOwnerStacks++;return C(r,u,i,!0,b,_,R?Error("react-stack-top-frame"):z,R?Y(l(r)):H)}}()),k}var K;function he(){return K||(K=1,process.env.NODE_ENV==="production"?O.exports=Ee():O.exports=ge()),O.exports}var f=he();const ee=s.createContext(void 0),w=s.createContext(void 0);function v(e,t){const n=s.useContext(w),[l,o]=s.useState(s.useMemo(()=>t(e),[])),a=s.useRef(l);return s.useEffect(()=>{const c=t(e);Object.is(a.current,c)||(o(c),a.current=c);const g=T.effect(()=>{const m=t(e);Object.is(a.current,m)||(o(m),a.current=m)},{injector:n});return()=>{g.destroy()}},[e,s.useMemo(()=>t,[])]),l}function $(e){const t=s.useMemo(()=>e.wrappers.slice(1),[e.wrappers]),n=e.wrappers[0],l=v(n,()=>({...n?.inputs(),...n?.attributes(),...n?.outputs}));return f.jsx(f.Fragment,{children:n?f.jsx(n.type,{...l,children:f.jsx($,{wrappers:t,children:e.children})}):e.children})}const re=Symbol.for("ControlValueAccessor");function W(e){const t=v(e.field,d=>d.inputs()),n=v(e.field,d=>d.outputs()),l=v(e.field,d=>d.renderConfig()),o=v(e.field,d=>d.attributes()),a=s.useMemo(()=>({...t,fields:e.field.fieldGroup?.()}),[t,e.field.fieldGroup]),c=s.useMemo(()=>({...t,fields:e.field.fieldArray?.()}),[t,e.field.fieldArray]),g=v(e.field,d=>d.wrappers()),m=v(e.field,d=>d.fieldGroup?.()),I=v(e.field,d=>d.fieldArray?.()),C=s.useMemo(()=>({...o,...t,...n}),[o,t,n]),x=e.field.form.control,h=e.field.define?.type,y=s.useMemo(()=>!!l.hidden||!h,[l.hidden,h]),A=s.useContext(w),p=s.useRef(void 0),M=s.useMemo(()=>({...C,[re]:p}),[C,p]);return s.useEffect(()=>{let d;return p.current&&(d=P.createViewControlLink(()=>x,p.current,A)),()=>{d?.forEach(N=>N()),d=void 0}},[p.current,x,A]),f.jsx(f.Fragment,{children:f.jsx(ee,{value:e.field,children:y?void 0:f.jsx($,{wrappers:g,children:m?f.jsx(h,{...a}):I?f.jsx(h,{...c}):e.field.form.control?f.jsx(h,{...M}):f.jsx(h,{...C})})})})}function Re(e){return f.jsx(f.Fragment,{children:e.fields.map((t,n)=>f.jsx(W,{field:t},n))})}class te extends P.CoreSchemaHandle{}class ne extends P.FormBuilder{}function oe(e,t,n,l){let o=!0;return T.effect(()=>{const a=t.value$$();o?(be.deepEqual(a,e)||l(a),o=!1):l(a)},{injector:n})}function L(e,t){const n=s.useCallback(e,t),l=s.useRef(void 0);s.useMemo(()=>(l.current=n(),l.current),t),s.useEffect(()=>()=>{l.current?.(),l.current=void 0},[])}function pe(e){const t=s.useMemo(()=>T.createRootInjector({providers:[{provide:T.ChangeDetectionScheduler,useClass:T.ChangeDetectionSchedulerImpl}]}),[]),[n,l]=s.useMemo(()=>{const o=T.createInjector({providers:[],parent:t});return[P.convert(e.schema,{handle:te,builder:ne,injector:o,registerOnDestroy:c=>{o.get(T.DestroyRef).onDestroy(c)},...e.options}),o]},[e.schema,e.options]);return L(()=>{let o;if(n.form.control){const a=e.model;o=oe(typeof a<"u"?a:void 0,n.form.control,l,c=>{T.untracked(()=>{n.form.control?.valueNoError$$()&&e.modelChange?.(c)})})}return()=>{l.destroy(),o?.destroy()}},[n]),L(()=>{n.form.control?.updateValue(e.model)},[n,e.model]),f.jsx(f.Fragment,{children:f.jsx(w,{value:t,children:f.jsx(W,{field:n})})})}const ve=[],_e={directives:"merge",formConfig:"merge",inputs:"merge",outputs:"merge",props:"merge",renderConfig:"merge",wrappers:"replace"};function Te(e,t){const n=s.useRef(!1);return s.useMemo(()=>{const l={value:e.value==null?"":e.value,disabled:e.disabled,onBlur:e.touchedChange};return t?{...l,onCompositionStart:()=>{n.current=!0},onCompositionEnd:o=>{n.current=!1,e.valueChange(o.target.value)}}:{...l,onInput:o=>e.valueChange(o.target.value)}},[e,t])}function Ce(e){return s.useMemo(()=>({checked:e.value??!1,disabled:e.disabled,onBlur:e.touchedChange,onChange:t=>e.valueChange(t.target.checked)}),[e])}function je(e){return s.useMemo(()=>({value:e.value==null?"":e.value,disabled:e.disabled,onBlur:e.touchedChange,onInput:t=>{const n=t.target.value;e.valueChange(n==""?void 0:parseFloat(n))}}),[e])}function xe(e,t){return s.useMemo(()=>({value:t,checked:Object.is(e.value,t),disabled:e.disabled,onBlur:e.touchedChange,onChange:()=>e.valueChange(t)}),[e])}function Se(e){return s.useMemo(()=>{const t=n=>{const l=n.target.value;e.valueChange(l==""?void 0:parseFloat(l))};return{value:e.value==null?"":e.value,disabled:e.disabled,onBlur:e.touchedChange,onInput:t,onChange:t}},[e])}function ke(e,t=!1){return s.useMemo(()=>({value:e.value,disabled:e.disabled,onBlur:e.touchedChange,onChange:n=>{const l=[],o=n.target;if(o.selectedOptions!==void 0)for(let a=0;a<o.selectedOptions.length;a++){const c=o.selectedOptions[a];if(l.push(c.value),!t)break}else for(let a=0;a<o.options.length;a++){const c=o.options[a];if(c.selected&&(l.push(c.value),!t))break}e.valueChange(t?l:l[0])}}),[e])}function ye(){const[e,t]=s.useState(void 0),[n,l]=s.useState(!1),o=s.useRef(void 0),a=s.useRef(void 0),c=s.useMemo(()=>({writeValue(m){t(m)},registerOnChange(m){o.current=m},registerOnTouched(m){a.current=m},setDisabledState(m){l(m)}}),[]),g=s.useMemo(()=>({value:e,disabled:n,valueChange:m=>{o.current?.(m),t(m)},touchedChange:()=>{a.current?.()}}),[e,n]);return s.useMemo(()=>({cva:c,cvaa:g}),[g])}exports.CVA=re;exports.EMPTY_ARRAY=ve;exports.InjectorToken=w;exports.NG_CONFIG_DEFAULT_MERGE_STRAGEGY=_e;exports.PI_VIEW_FIELD_TOKEN=ee;exports.PiyingFieldTemplate=W;exports.PiyingGroup=Re;exports.PiyingView=pe;exports.PiyingWrapper=$;exports.ReactFormBuilder=ne;exports.ReactSchemaHandle=te;exports.initListen=oe;exports.useControlValueAccessor=ye;exports.useEffectSync=L;exports.useInputCheckboxModel=Ce;exports.useInputNumberModel=je;exports.useInputRadioModel=xe;exports.useInputRangeModel=Se;exports.useInputTextModel=Te;exports.useSelectModel=ke;exports.useSignalToRef=v;
|
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import me, { createContext as K, useContext as ee, useState as V, useMemo as c, useRef as
|
|
1
|
+
import me, { createContext as K, useContext as ee, useState as V, useMemo as c, useRef as j, useEffect as $, useCallback as be } from "react";
|
|
2
2
|
import { effect as re, createRootInjector as he, ChangeDetectionSchedulerImpl as ge, ChangeDetectionScheduler as Ee, createInjector as pe, DestroyRef as Re, untracked as ve } from "static-injector";
|
|
3
3
|
import { createViewControlLink as _e, CoreSchemaHandle as Te, FormBuilder as Ce, convert as je } from "@piying/view-core";
|
|
4
4
|
import "valibot";
|
|
5
5
|
import { deepEqual as xe } from "fast-equals";
|
|
6
|
-
var
|
|
6
|
+
var S = { exports: {} }, k = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
9
9
|
* react-jsx-runtime.production.js
|
|
@@ -15,27 +15,27 @@ var w = { exports: {} }, O = {};
|
|
|
15
15
|
*/
|
|
16
16
|
var H;
|
|
17
17
|
function ke() {
|
|
18
|
-
if (H) return
|
|
18
|
+
if (H) return k;
|
|
19
19
|
H = 1;
|
|
20
20
|
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
21
|
-
function n(
|
|
22
|
-
var
|
|
23
|
-
if (
|
|
24
|
-
|
|
21
|
+
function n(s, o, l) {
|
|
22
|
+
var i = null;
|
|
23
|
+
if (l !== void 0 && (i = "" + l), o.key !== void 0 && (i = "" + o.key), "key" in o) {
|
|
24
|
+
l = {};
|
|
25
25
|
for (var g in o)
|
|
26
|
-
g !== "key" && (
|
|
27
|
-
} else
|
|
28
|
-
return o =
|
|
26
|
+
g !== "key" && (l[g] = o[g]);
|
|
27
|
+
} else l = o;
|
|
28
|
+
return o = l.ref, {
|
|
29
29
|
$$typeof: e,
|
|
30
|
-
type:
|
|
31
|
-
key:
|
|
30
|
+
type: s,
|
|
31
|
+
key: i,
|
|
32
32
|
ref: o !== void 0 ? o : null,
|
|
33
|
-
props:
|
|
33
|
+
props: l
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return k.Fragment = t, k.jsx = n, k.jsxs = n, k;
|
|
37
37
|
}
|
|
38
|
-
var
|
|
38
|
+
var O = {};
|
|
39
39
|
/**
|
|
40
40
|
* @license React
|
|
41
41
|
* react-jsx-runtime.development.js
|
|
@@ -54,7 +54,7 @@ function Oe() {
|
|
|
54
54
|
return r.$$typeof === ce ? null : r.displayName || r.name || null;
|
|
55
55
|
if (typeof r == "string") return r;
|
|
56
56
|
switch (r) {
|
|
57
|
-
case
|
|
57
|
+
case R:
|
|
58
58
|
return "Fragment";
|
|
59
59
|
case d:
|
|
60
60
|
return "Profiler";
|
|
@@ -62,7 +62,7 @@ function Oe() {
|
|
|
62
62
|
return "StrictMode";
|
|
63
63
|
case se:
|
|
64
64
|
return "Suspense";
|
|
65
|
-
case
|
|
65
|
+
case le:
|
|
66
66
|
return "SuspenseList";
|
|
67
67
|
case ie:
|
|
68
68
|
return "Activity";
|
|
@@ -71,21 +71,21 @@ function Oe() {
|
|
|
71
71
|
switch (typeof r.tag == "number" && console.error(
|
|
72
72
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
73
73
|
), r.$$typeof) {
|
|
74
|
-
case
|
|
74
|
+
case A:
|
|
75
75
|
return "Portal";
|
|
76
76
|
case oe:
|
|
77
77
|
return (r.displayName || "Context") + ".Provider";
|
|
78
78
|
case I:
|
|
79
79
|
return (r._context.displayName || "Context") + ".Consumer";
|
|
80
80
|
case ue:
|
|
81
|
-
var
|
|
82
|
-
return r = r.displayName, r || (r =
|
|
83
|
-
case
|
|
84
|
-
return
|
|
81
|
+
var u = r.render;
|
|
82
|
+
return r = r.displayName, r || (r = u.displayName || u.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
|
|
83
|
+
case ae:
|
|
84
|
+
return u = r.displayName || null, u !== null ? u : e(r.type) || "Memo";
|
|
85
85
|
case L:
|
|
86
|
-
|
|
86
|
+
u = r._payload, r = r._init;
|
|
87
87
|
try {
|
|
88
|
-
return e(r(
|
|
88
|
+
return e(r(u));
|
|
89
89
|
} catch {
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -97,27 +97,27 @@ function Oe() {
|
|
|
97
97
|
function n(r) {
|
|
98
98
|
try {
|
|
99
99
|
t(r);
|
|
100
|
-
var
|
|
100
|
+
var u = !1;
|
|
101
101
|
} catch {
|
|
102
|
-
|
|
102
|
+
u = !0;
|
|
103
103
|
}
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
var
|
|
107
|
-
return
|
|
108
|
-
|
|
104
|
+
if (u) {
|
|
105
|
+
u = console;
|
|
106
|
+
var a = u.error, b = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
107
|
+
return a.call(
|
|
108
|
+
u,
|
|
109
109
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
|
-
|
|
110
|
+
b
|
|
111
111
|
), t(r);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
if (r ===
|
|
114
|
+
function s(r) {
|
|
115
|
+
if (r === R) return "<>";
|
|
116
116
|
if (typeof r == "object" && r !== null && r.$$typeof === L)
|
|
117
117
|
return "<...>";
|
|
118
118
|
try {
|
|
119
|
-
var
|
|
120
|
-
return
|
|
119
|
+
var u = e(r);
|
|
120
|
+
return u ? "<" + u + ">" : "<...>";
|
|
121
121
|
} catch {
|
|
122
122
|
return "<...>";
|
|
123
123
|
}
|
|
@@ -126,44 +126,44 @@ function Oe() {
|
|
|
126
126
|
var r = N.A;
|
|
127
127
|
return r === null ? null : r.getOwner();
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function l() {
|
|
130
130
|
return Error("react-stack-top-frame");
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function i(r) {
|
|
133
133
|
if (W.call(r, "key")) {
|
|
134
|
-
var
|
|
135
|
-
if (
|
|
134
|
+
var u = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
135
|
+
if (u && u.isReactWarning) return !1;
|
|
136
136
|
}
|
|
137
137
|
return r.key !== void 0;
|
|
138
138
|
}
|
|
139
|
-
function g(r,
|
|
140
|
-
function
|
|
139
|
+
function g(r, u) {
|
|
140
|
+
function a() {
|
|
141
141
|
U || (U = !0, console.error(
|
|
142
142
|
"%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://react.dev/link/special-props)",
|
|
143
|
-
|
|
143
|
+
u
|
|
144
144
|
));
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
get:
|
|
146
|
+
a.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
147
|
+
get: a,
|
|
148
148
|
configurable: !0
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function m() {
|
|
152
152
|
var r = e(this.type);
|
|
153
153
|
return B[r] || (B[r] = !0, console.error(
|
|
154
154
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
155
155
|
)), r = this.props.ref, r !== void 0 ? r : null;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
return
|
|
159
|
-
$$typeof:
|
|
157
|
+
function w(r, u, a, b, v, p, Y, D) {
|
|
158
|
+
return a = p.ref, r = {
|
|
159
|
+
$$typeof: y,
|
|
160
160
|
type: r,
|
|
161
|
-
key:
|
|
162
|
-
props:
|
|
163
|
-
_owner:
|
|
164
|
-
}, (
|
|
161
|
+
key: u,
|
|
162
|
+
props: p,
|
|
163
|
+
_owner: v
|
|
164
|
+
}, (a !== void 0 ? a : null) !== null ? Object.defineProperty(r, "ref", {
|
|
165
165
|
enumerable: !1,
|
|
166
|
-
get:
|
|
166
|
+
get: m
|
|
167
167
|
}) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
|
|
168
168
|
configurable: !1,
|
|
169
169
|
enumerable: !1,
|
|
@@ -186,60 +186,60 @@ function Oe() {
|
|
|
186
186
|
value: D
|
|
187
187
|
}), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
var
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
if (de(
|
|
194
|
-
for (
|
|
195
|
-
|
|
196
|
-
Object.freeze && Object.freeze(
|
|
189
|
+
function T(r, u, a, b, v, p, Y, D) {
|
|
190
|
+
var h = u.children;
|
|
191
|
+
if (h !== void 0)
|
|
192
|
+
if (b)
|
|
193
|
+
if (de(h)) {
|
|
194
|
+
for (b = 0; b < h.length; b++)
|
|
195
|
+
x(h[b]);
|
|
196
|
+
Object.freeze && Object.freeze(h);
|
|
197
197
|
} else
|
|
198
198
|
console.error(
|
|
199
199
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
200
200
|
);
|
|
201
|
-
else
|
|
202
|
-
if (W.call(
|
|
203
|
-
|
|
204
|
-
var
|
|
201
|
+
else x(h);
|
|
202
|
+
if (W.call(u, "key")) {
|
|
203
|
+
h = e(r);
|
|
204
|
+
var C = Object.keys(u).filter(function(fe) {
|
|
205
205
|
return fe !== "key";
|
|
206
206
|
});
|
|
207
|
-
|
|
207
|
+
b = 0 < C.length ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}", z[h + b] || (C = 0 < C.length ? "{" + C.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
208
208
|
`A props object containing a "key" prop is being spread into JSX:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s {...props} />
|
|
211
211
|
React keys must be passed directly to JSX without using spread:
|
|
212
212
|
let props = %s;
|
|
213
213
|
<%s key={someKey} {...props} />`,
|
|
214
|
-
m,
|
|
215
214
|
b,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
215
|
+
h,
|
|
216
|
+
C,
|
|
217
|
+
h
|
|
218
|
+
), z[h + b] = !0);
|
|
219
219
|
}
|
|
220
|
-
if (
|
|
221
|
-
|
|
222
|
-
for (var M in
|
|
223
|
-
M !== "key" && (
|
|
224
|
-
} else
|
|
225
|
-
return
|
|
226
|
-
|
|
220
|
+
if (h = null, a !== void 0 && (n(a), h = "" + a), i(u) && (n(u.key), h = "" + u.key), "key" in u) {
|
|
221
|
+
a = {};
|
|
222
|
+
for (var M in u)
|
|
223
|
+
M !== "key" && (a[M] = u[M]);
|
|
224
|
+
} else a = u;
|
|
225
|
+
return h && g(
|
|
226
|
+
a,
|
|
227
227
|
typeof r == "function" ? r.displayName || r.name || "Unknown" : r
|
|
228
|
-
),
|
|
228
|
+
), w(
|
|
229
229
|
r,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
h,
|
|
231
|
+
p,
|
|
232
|
+
v,
|
|
233
233
|
o(),
|
|
234
|
-
|
|
234
|
+
a,
|
|
235
235
|
Y,
|
|
236
236
|
D
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
typeof r == "object" && r !== null && r.$$typeof ===
|
|
239
|
+
function x(r) {
|
|
240
|
+
typeof r == "object" && r !== null && r.$$typeof === y && r._store && (r._store.validated = 1);
|
|
241
241
|
}
|
|
242
|
-
var E = me,
|
|
242
|
+
var E = me, y = Symbol.for("react.transitional.element"), A = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), I = Symbol.for("react.consumer"), oe = Symbol.for("react.context"), ue = Symbol.for("react.forward_ref"), se = Symbol.for("react.suspense"), le = Symbol.for("react.suspense_list"), ae = Symbol.for("react.memo"), L = Symbol.for("react.lazy"), ie = Symbol.for("react.activity"), ce = Symbol.for("react.client.reference"), N = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, de = Array.isArray, F = console.createTask ? console.createTask : function() {
|
|
243
243
|
return null;
|
|
244
244
|
};
|
|
245
245
|
E = {
|
|
@@ -249,71 +249,71 @@ React keys must be passed directly to JSX without using spread:
|
|
|
249
249
|
};
|
|
250
250
|
var U, B = {}, q = E["react-stack-bottom-frame"].bind(
|
|
251
251
|
E,
|
|
252
|
-
|
|
253
|
-
)(), J = F(
|
|
254
|
-
|
|
255
|
-
var
|
|
256
|
-
return
|
|
252
|
+
l
|
|
253
|
+
)(), J = F(s(l)), z = {};
|
|
254
|
+
O.Fragment = R, O.jsx = function(r, u, a, b, v) {
|
|
255
|
+
var p = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
256
|
+
return T(
|
|
257
257
|
r,
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
u,
|
|
259
|
+
a,
|
|
260
260
|
!1,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
261
|
+
b,
|
|
262
|
+
v,
|
|
263
|
+
p ? Error("react-stack-top-frame") : q,
|
|
264
|
+
p ? F(s(r)) : J
|
|
265
265
|
);
|
|
266
|
-
},
|
|
267
|
-
var
|
|
268
|
-
return
|
|
266
|
+
}, O.jsxs = function(r, u, a, b, v) {
|
|
267
|
+
var p = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
268
|
+
return T(
|
|
269
269
|
r,
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
u,
|
|
271
|
+
a,
|
|
272
272
|
!0,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
b,
|
|
274
|
+
v,
|
|
275
|
+
p ? Error("react-stack-top-frame") : q,
|
|
276
|
+
p ? F(s(r)) : J
|
|
277
277
|
);
|
|
278
278
|
};
|
|
279
|
-
}()),
|
|
279
|
+
}()), O;
|
|
280
280
|
}
|
|
281
281
|
var Z;
|
|
282
282
|
function ye() {
|
|
283
|
-
return Z || (Z = 1, process.env.NODE_ENV === "production" ?
|
|
283
|
+
return Z || (Z = 1, process.env.NODE_ENV === "production" ? S.exports = ke() : S.exports = Oe()), S.exports;
|
|
284
284
|
}
|
|
285
285
|
var f = ye();
|
|
286
286
|
const Ae = K(void 0), G = K(void 0);
|
|
287
|
-
function
|
|
288
|
-
const n = ee(G), [
|
|
287
|
+
function _(e, t) {
|
|
288
|
+
const n = ee(G), [s, o] = V(c(() => t(e), [])), l = j(s);
|
|
289
289
|
return $(() => {
|
|
290
|
-
const
|
|
291
|
-
Object.is(
|
|
290
|
+
const i = t(e);
|
|
291
|
+
Object.is(l.current, i) || (o(i), l.current = i);
|
|
292
292
|
const g = re(
|
|
293
293
|
() => {
|
|
294
|
-
const
|
|
295
|
-
Object.is(
|
|
294
|
+
const m = t(e);
|
|
295
|
+
Object.is(l.current, m) || (o(m), l.current = m);
|
|
296
296
|
},
|
|
297
297
|
{ injector: n }
|
|
298
298
|
);
|
|
299
299
|
return () => {
|
|
300
300
|
g.destroy();
|
|
301
301
|
};
|
|
302
|
-
}, [e, c(() => t, [])]),
|
|
302
|
+
}, [e, c(() => t, [])]), s;
|
|
303
303
|
}
|
|
304
304
|
function te(e) {
|
|
305
|
-
const t = c(() => e.wrappers.slice(1), [e.wrappers]), n = e.wrappers[0],
|
|
306
|
-
return /* @__PURE__ */ f.jsx(f.Fragment, { children: n ? /* @__PURE__ */ f.jsx(n.type, { ...
|
|
305
|
+
const t = c(() => e.wrappers.slice(1), [e.wrappers]), n = e.wrappers[0], s = _(n, () => ({ ...n?.inputs(), ...n?.attributes(), ...n?.outputs }));
|
|
306
|
+
return /* @__PURE__ */ f.jsx(f.Fragment, { children: n ? /* @__PURE__ */ f.jsx(n.type, { ...s, children: /* @__PURE__ */ f.jsx(te, { wrappers: t, children: e.children }) }) : e.children });
|
|
307
307
|
}
|
|
308
308
|
const Se = Symbol.for("ControlValueAccessor");
|
|
309
309
|
function ne(e) {
|
|
310
|
-
const t =
|
|
310
|
+
const t = _(e.field, (d) => d.inputs()), n = _(e.field, (d) => d.outputs()), s = _(e.field, (d) => d.renderConfig()), o = _(e.field, (d) => d.attributes()), l = c(() => ({ ...t, fields: e.field.fieldGroup?.() }), [t, e.field.fieldGroup]), i = c(() => ({ ...t, fields: e.field.fieldArray?.() }), [t, e.field.fieldArray]), g = _(e.field, (d) => d.wrappers()), m = _(e.field, (d) => d.fieldGroup?.()), w = _(e.field, (d) => d.fieldArray?.()), T = c(() => ({ ...o, ...t, ...n }), [o, t, n]), x = e.field.form.control, E = e.field.define?.type, y = c(() => !!s.hidden || !E, [s.hidden, E]), A = ee(G), R = j(void 0), P = c(() => ({ ...T, [Se]: R }), [T, R]);
|
|
311
311
|
return $(() => {
|
|
312
312
|
let d;
|
|
313
|
-
return
|
|
313
|
+
return R.current && (d = _e(() => x, R.current, A)), () => {
|
|
314
314
|
d?.forEach((I) => I()), d = void 0;
|
|
315
315
|
};
|
|
316
|
-
}, [
|
|
316
|
+
}, [R.current, x, A]), /* @__PURE__ */ f.jsx(f.Fragment, { children: /* @__PURE__ */ f.jsx(Ae, { value: e.field, children: y ? void 0 : /* @__PURE__ */ f.jsx(te, { wrappers: g, children: m ? /* @__PURE__ */ f.jsx(E, { ...l }) : w ? /* @__PURE__ */ f.jsx(E, { ...i }) : e.field.form.control ? /* @__PURE__ */ f.jsx(E, { ...P }) : /* @__PURE__ */ f.jsx(E, { ...T }) }) }) });
|
|
317
317
|
}
|
|
318
318
|
function Ve(e) {
|
|
319
319
|
return /* @__PURE__ */ f.jsx(f.Fragment, { children: e.fields.map((t, n) => /* @__PURE__ */ f.jsx(ne, { field: t }, n)) });
|
|
@@ -323,20 +323,20 @@ class we extends Te {
|
|
|
323
323
|
}
|
|
324
324
|
class Pe extends Ce {
|
|
325
325
|
}
|
|
326
|
-
function Ie(e, t, n,
|
|
326
|
+
function Ie(e, t, n, s) {
|
|
327
327
|
let o = !0;
|
|
328
328
|
return re(
|
|
329
329
|
() => {
|
|
330
|
-
const
|
|
331
|
-
o ? (xe(
|
|
330
|
+
const l = t.value$$();
|
|
331
|
+
o ? (xe(l, e) || s(l), o = !1) : s(l);
|
|
332
332
|
},
|
|
333
333
|
{ injector: n }
|
|
334
334
|
);
|
|
335
335
|
}
|
|
336
336
|
function Q(e, t) {
|
|
337
|
-
const n = be(e, t),
|
|
338
|
-
c(() => (
|
|
339
|
-
|
|
337
|
+
const n = be(e, t), s = j(void 0);
|
|
338
|
+
c(() => (s.current = n(), s.current), t), $(() => () => {
|
|
339
|
+
s.current?.(), s.current = void 0;
|
|
340
340
|
}, []);
|
|
341
341
|
}
|
|
342
342
|
function $e(e) {
|
|
@@ -347,14 +347,14 @@ function $e(e) {
|
|
|
347
347
|
useClass: ge
|
|
348
348
|
}
|
|
349
349
|
]
|
|
350
|
-
}), []), [n,
|
|
350
|
+
}), []), [n, s] = c(() => {
|
|
351
351
|
const o = pe({ providers: [], parent: t });
|
|
352
352
|
return [je(e.schema, {
|
|
353
353
|
handle: we,
|
|
354
354
|
builder: Pe,
|
|
355
355
|
injector: o,
|
|
356
|
-
registerOnDestroy: (
|
|
357
|
-
o.get(Re).onDestroy(
|
|
356
|
+
registerOnDestroy: (i) => {
|
|
357
|
+
o.get(Re).onDestroy(i);
|
|
358
358
|
},
|
|
359
359
|
...e.options
|
|
360
360
|
}), o];
|
|
@@ -362,15 +362,15 @@ function $e(e) {
|
|
|
362
362
|
return Q(() => {
|
|
363
363
|
let o;
|
|
364
364
|
if (n.form.control) {
|
|
365
|
-
const
|
|
366
|
-
o = Ie(typeof
|
|
365
|
+
const l = e.model;
|
|
366
|
+
o = Ie(typeof l < "u" ? l : void 0, n.form.control, s, (i) => {
|
|
367
367
|
ve(() => {
|
|
368
|
-
n.form.control?.valueNoError$$() && e.modelChange?.(
|
|
368
|
+
n.form.control?.valueNoError$$() && e.modelChange?.(i);
|
|
369
369
|
});
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
372
|
return () => {
|
|
373
|
-
|
|
373
|
+
s.destroy(), o?.destroy();
|
|
374
374
|
};
|
|
375
375
|
}, [n]), Q(() => {
|
|
376
376
|
n.form.control?.updateValue(e.model);
|
|
@@ -386,11 +386,11 @@ const Ge = [], Le = {
|
|
|
386
386
|
wrappers: "replace"
|
|
387
387
|
};
|
|
388
388
|
function We(e, t) {
|
|
389
|
-
const n =
|
|
389
|
+
const n = j(!1);
|
|
390
390
|
return c(() => {
|
|
391
|
-
const
|
|
391
|
+
const s = { value: e.value == null ? "" : e.value, disabled: e.disabled, onBlur: e.touchedChange };
|
|
392
392
|
return t ? {
|
|
393
|
-
...
|
|
393
|
+
...s,
|
|
394
394
|
onCompositionStart: () => {
|
|
395
395
|
n.current = !0;
|
|
396
396
|
},
|
|
@@ -398,14 +398,14 @@ function We(e, t) {
|
|
|
398
398
|
n.current = !1, e.valueChange(o.target.value);
|
|
399
399
|
}
|
|
400
400
|
} : {
|
|
401
|
-
...
|
|
401
|
+
...s,
|
|
402
402
|
onInput: (o) => e.valueChange(o.target.value)
|
|
403
403
|
};
|
|
404
404
|
}, [e, t]);
|
|
405
405
|
}
|
|
406
406
|
function Ue(e) {
|
|
407
407
|
return c(() => ({
|
|
408
|
-
checked: e.value,
|
|
408
|
+
checked: e.value ?? !1,
|
|
409
409
|
disabled: e.disabled,
|
|
410
410
|
onBlur: e.touchedChange,
|
|
411
411
|
onChange: (t) => e.valueChange(t.target.checked)
|
|
@@ -413,7 +413,7 @@ function Ue(e) {
|
|
|
413
413
|
}
|
|
414
414
|
function Be(e) {
|
|
415
415
|
return c(() => ({
|
|
416
|
-
value: e.value,
|
|
416
|
+
value: e.value == null ? "" : e.value,
|
|
417
417
|
disabled: e.disabled,
|
|
418
418
|
onBlur: e.touchedChange,
|
|
419
419
|
onInput: (t) => {
|
|
@@ -434,11 +434,11 @@ function qe(e, t) {
|
|
|
434
434
|
function Je(e) {
|
|
435
435
|
return c(() => {
|
|
436
436
|
const t = (n) => {
|
|
437
|
-
const
|
|
438
|
-
e.valueChange(
|
|
437
|
+
const s = n.target.value;
|
|
438
|
+
e.valueChange(s == "" ? void 0 : parseFloat(s));
|
|
439
439
|
};
|
|
440
440
|
return {
|
|
441
|
-
value: e.value,
|
|
441
|
+
value: e.value == null ? "" : e.value,
|
|
442
442
|
disabled: e.disabled,
|
|
443
443
|
onBlur: e.touchedChange,
|
|
444
444
|
onInput: t,
|
|
@@ -452,51 +452,51 @@ function ze(e, t = !1) {
|
|
|
452
452
|
disabled: e.disabled,
|
|
453
453
|
onBlur: e.touchedChange,
|
|
454
454
|
onChange: (n) => {
|
|
455
|
-
const
|
|
455
|
+
const s = [], o = n.target;
|
|
456
456
|
if (o.selectedOptions !== void 0)
|
|
457
|
-
for (let
|
|
458
|
-
const
|
|
459
|
-
if (
|
|
457
|
+
for (let l = 0; l < o.selectedOptions.length; l++) {
|
|
458
|
+
const i = o.selectedOptions[l];
|
|
459
|
+
if (s.push(i.value), !t)
|
|
460
460
|
break;
|
|
461
461
|
}
|
|
462
462
|
else
|
|
463
|
-
for (let
|
|
464
|
-
const
|
|
465
|
-
if (
|
|
463
|
+
for (let l = 0; l < o.options.length; l++) {
|
|
464
|
+
const i = o.options[l];
|
|
465
|
+
if (i.selected && (s.push(i.value), !t))
|
|
466
466
|
break;
|
|
467
467
|
}
|
|
468
|
-
e.valueChange(t ?
|
|
468
|
+
e.valueChange(t ? s : s[0]);
|
|
469
469
|
}
|
|
470
470
|
}), [e]);
|
|
471
471
|
}
|
|
472
|
-
function He(
|
|
473
|
-
const [
|
|
474
|
-
writeValue(
|
|
475
|
-
|
|
472
|
+
function He() {
|
|
473
|
+
const [e, t] = V(void 0), [n, s] = V(!1), o = j(void 0), l = j(void 0), i = c(() => ({
|
|
474
|
+
writeValue(m) {
|
|
475
|
+
t(m);
|
|
476
476
|
},
|
|
477
|
-
registerOnChange(
|
|
478
|
-
|
|
477
|
+
registerOnChange(m) {
|
|
478
|
+
o.current = m;
|
|
479
479
|
},
|
|
480
|
-
registerOnTouched(
|
|
481
|
-
l.current =
|
|
480
|
+
registerOnTouched(m) {
|
|
481
|
+
l.current = m;
|
|
482
482
|
},
|
|
483
|
-
setDisabledState(
|
|
484
|
-
|
|
483
|
+
setDisabledState(m) {
|
|
484
|
+
s(m);
|
|
485
485
|
}
|
|
486
|
-
}), []),
|
|
487
|
-
value:
|
|
488
|
-
disabled:
|
|
489
|
-
valueChange: (
|
|
490
|
-
|
|
486
|
+
}), []), g = c(() => ({
|
|
487
|
+
value: e,
|
|
488
|
+
disabled: n,
|
|
489
|
+
valueChange: (m) => {
|
|
490
|
+
o.current?.(m), t(m);
|
|
491
491
|
},
|
|
492
492
|
touchedChange: () => {
|
|
493
493
|
l.current?.();
|
|
494
494
|
}
|
|
495
|
-
}), [
|
|
495
|
+
}), [e, n]);
|
|
496
496
|
return c(() => ({
|
|
497
|
-
cva:
|
|
498
|
-
cvaa:
|
|
499
|
-
}), [
|
|
497
|
+
cva: i,
|
|
498
|
+
cvaa: g
|
|
499
|
+
}), [g]);
|
|
500
500
|
}
|
|
501
501
|
export {
|
|
502
502
|
Se as CVA,
|
|
@@ -519,5 +519,5 @@ export {
|
|
|
519
519
|
Je as useInputRangeModel,
|
|
520
520
|
We as useInputTextModel,
|
|
521
521
|
ze as useSelectModel,
|
|
522
|
-
|
|
522
|
+
_ as useSignalToRef
|
|
523
523
|
};
|
package/package.json
CHANGED