@duely/react-form
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports["@duely/react-form"]=e(require("react")):t["@duely/react-form"]=e(t.react)}(this,(function(t){return(()=>{"use strict";var e={297:e=>{e.exports=t}},s={};function i(t){var r=s[t];if(void 0!==r)return r.exports;var a=s[t]={exports:{}};return e[t](a,a.exports,i),a.exports}i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{i.r(r),i.d(r,{FormFieldControl:()=>J,useForm:()=>L});var t,e,s,a,h,o,l,n,u,f,c,p,d,m,v,y,w,b,k,g,V,M,W,S,x,F,E,D,T,j,O,C,P,q,_,B=i(297),I=function(t,e,s,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(t,s):r?r.value=s:e.set(t,s),s},R=function(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)};function z(){const[,t]=(0,B.useState)(0);return(0,B.useCallback)((()=>t((t=>t+1))),[])}function A(t){return t.value}function G(t,e){return t.value!==e&&(t.value=e,!0)}const H={checkbox:{props:{type:"checkbox"},getElementValue:t=>t.checked,setElementValue:(t,e)=>t.checked!==e&&(t.checked=e,!0)},color:{props:{type:"color"}},date:{props:{type:"date"}},"datetime-local":{props:{type:"datetime-local"}},email:{props:{type:"email"}},file:{props:{type:"file"},getElementValue:t=>t.files},month:{props:{type:"month"}},number:{props:{type:"number"}},password:{props:{type:"password"}},radio:{props:{type:"radio"}},range:{props:{type:"range"}},search:{props:{type:"search"}},tel:{props:{type:"tel"}},text:{props:{type:"text"}},time:{props:{type:"time"}},url:{props:{type:"url"}},week:{props:{type:"week"}},"select-one":{props:{}},"select-multiple":{props:{}},textarea:{props:{}}};class J{constructor(i,r,b){t.add(this),e.set(this,void 0),s.set(this,void 0),a.set(this,void 0),h.set(this,void 0),o.set(this,void 0),l.set(this,void 0),n.set(this,void 0),u.set(this,void 0),f.set(this,null),c.set(this,!1),p.set(this,!1),d.set(this,!1),m.set(this,[]),v.set(this,!1),y.set(this,[]),w.set(this,0),I(this,e,i,"f"),I(this,s,r,"f"),this.options=null!=b?b:{}}get props(){return R(this,h,"f")||I(this,h,{name:R(this,e,"f"),ref:e=>{e?R(this,t,"m",W).call(this,e):R(this,t,"m",S).call(this)},onChange:e=>{R(this,t,"m",V).call(this,e)},onBlur:e=>{R(this,t,"m",M).call(this,e)}},"f"),R(this,h,"f")}get type(){var t;return null===(t=R(this,a,"f"))||void 0===t?void 0:t.type}get value(){if(void 0!==R(this,a,"f"))return null!==R(this,a,"f")&&I(this,o,R(this,n,"f")(R(this,a,"f")),"f"),R(this,o,"f")}get defaultValue(){return R(this,l,"f")}get isDirty(){return R(this,c,"f")}set isDirty(e){var i;R(this,c,"f")!==e&&(R(this,t,"m",k).call(this),I(this,c,e,"f"),I(this,v,!0,"f"),R(this,t,"m",g).call(this),(i=R(this,s,"f")).isDirty||(i.isDirty=e))}get isTouched(){return R(this,p,"f")}set isTouched(e){R(this,p,"f")!==e&&(R(this,t,"m",k).call(this),I(this,p,e,"f"),I(this,v,!0,"f"),R(this,t,"m",g).call(this))}get error(){return R(this,f,"f")}set error(e){R(this,f,"f")!==e&&(R(this,t,"m",k).call(this),I(this,f,e,"f"),I(this,v,!0,"f"),R(this,t,"m",g).call(this))}setValue(e){R(this,a,"f")&&(R(this,t,"m",k).call(this),I(this,d,R(this,d,"f")||R(this,u,"f")(R(this,a,"f"),e),"f"),R(this,t,"m",g).call(this))}setDefaultValue(e){I(this,l,e,"f"),R(this,a,"f")&&R(this,t,"a",b)&&this.setValue(this.defaultValue)}subscribeToValueChanged(t){return R(this,m,"f").push(t),()=>{const e=R(this,m,"f").indexOf(t);-1!==e&&R(this,m,"f").splice(e,1)}}subscribeToStateChanged(t){return R(this,y,"f").push(t),()=>{const e=R(this,y,"f").indexOf(t);-1!==e&&R(this,y,"f").splice(e,1)}}validate(){return R(this,t,"m",k).call(this),this.options.required&&!R(this,t,"a",b)?(this.error=L.options.errorMessages.required,R(this,t,"m",g).call(this),!1):(this.error=null,R(this,t,"m",g).call(this),!0)}reset(){R(this,t,"m",k).call(this),I(this,f,null,"f"),I(this,c,!1,"f"),I(this,p,!1,"f"),R(this,a,"f")&&void 0!==this.defaultValue&&R(this,u,"f")(R(this,a,"f"),this.defaultValue),I(this,d,!0,"f"),I(this,v,!0,"f"),R(this,t,"m",g).call(this)}focus(){var t;null===(t=R(this,a,"f"))||void 0===t||t.focus()}}e=new WeakMap,s=new WeakMap,a=new WeakMap,h=new WeakMap,o=new WeakMap,l=new WeakMap,n=new WeakMap,u=new WeakMap,f=new WeakMap,c=new WeakMap,p=new WeakMap,d=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,w=new WeakMap,t=new WeakSet,b=function(){var t;return![void 0,""].includes(null===(t=R(this,a,"f"))||void 0===t?void 0:t.value)},k=function(){I(this,w,+R(this,w,"f")+1,"f")},g=function(){0===I(this,w,+R(this,w,"f")-1,"f")&&(R(this,d,"f")&&(I(this,d,!1,"f"),R(this,m,"f").forEach((t=>t()))),R(this,v,"f")&&(I(this,v,!1,"f"),R(this,y,"f").forEach((t=>t()))))},V=function(e){R(this,t,"m",k).call(this),this.isDirty=!0,I(this,d,!0,"f"),this.isTouched&&this.validate(),R(this,t,"m",g).call(this)},M=function(e){R(this,t,"m",k).call(this),this.isTouched=!0,this.isDirty&&this.validate(),R(this,t,"m",g).call(this)},W=function(t){var e,s;R(this,a,"f")||(I(this,a,t,"f"),I(this,n,null!==(e=H[t.type].getElementValue)&&void 0!==e?e:A,"f"),I(this,u,null!==(s=H[t.type].setElementValue)&&void 0!==s?s:G,"f"),void 0!==this.defaultValue&&this.setValue(this.defaultValue))},S=function(){I(this,a,null,"f")};class K{constructor(){x.add(this),F.set(this,!1),E.set(this,!1),D.set(this,!1),T.set(this,[]),j.set(this,0),O.set(this,{})}get isDirty(){return R(this,E,"f")}set isDirty(t){R(this,E,"f")!==t&&(R(this,x,"m",C).call(this),I(this,E,t,"f"),I(this,D,!0,"f"),R(this,x,"m",P).call(this))}get isSubmitting(){return R(this,F,"f")}register(t,e){return R(this,x,"m",q).call(this,t,e).props}useFormState(){const t=z();return(0,B.useEffect)((()=>R(this,x,"m",_).call(this,t)),[]),this}useFormFieldState(t){const e=z(),s=R(this,x,"m",q).call(this,t);return(0,B.useEffect)((()=>s.subscribeToStateChanged(e)),[]),s}useFormFieldValue(t){const e=z(),s=R(this,x,"m",q).call(this,t);return(0,B.useEffect)((()=>s.subscribeToValueChanged(e)),[]),s.value}reset(){R(this,x,"m",C).call(this),Object.values(R(this,O,"f")).forEach((t=>t.reset())),this.isDirty=!1,R(this,x,"m",P).call(this)}handleSubmit(t){const e=this;return s=>{return i=this,r=void 0,h=function*(){null==s||s.preventDefault();const i={};for(const[t,s]of Object.entries(R(e,O,"f"))){if(!s.validate())return void s.focus();i[t]=s.value}R(this,x,"m",C).call(this),I(this,F,!0,"f"),I(this,D,!0,"f"),R(this,x,"m",P).call(this),yield t(i,s),R(this,x,"m",C).call(this),I(this,F,!1,"f"),I(this,D,!0,"f"),R(this,x,"m",P).call(this)},new((a=void 0)||(a=Promise))((function(t,e){function s(t){try{l(h.next(t))}catch(t){e(t)}}function o(t){try{l(h.throw(t))}catch(t){e(t)}}function l(e){var i;e.done?t(e.value):(i=e.value,i instanceof a?i:new a((function(t){t(i)}))).then(s,o)}l((h=h.apply(i,r||[])).next())}));var i,r,a,h}}setValue(t,e){R(this,x,"m",q).call(this,t).setValue(e)}setDefaultValue(t,e){R(this,x,"m",q).call(this,t).setDefaultValue(e)}}function L(){const t=(0,B.useState)((()=>new K))[0];return(0,B.useMemo)((()=>({control:t,register:t.register.bind(t),useFormFieldState:t.useFormFieldState.bind(t),useFormFieldValue:t.useFormFieldValue.bind(t),useFormState:t.useFormState.bind(t),reset:t.reset.bind(t),handleSubmit:t.handleSubmit.bind(t),setValue:t.setValue.bind(t),setDefaultValue:t.setDefaultValue.bind(t)})),[])}F=new WeakMap,E=new WeakMap,D=new WeakMap,T=new WeakMap,j=new WeakMap,O=new WeakMap,x=new WeakSet,C=function(){I(this,j,+R(this,j,"f")+1,"f")},P=function(){0===I(this,j,+R(this,j,"f")-1,"f")&&R(this,D,"f")&&(I(this,D,!1,"f"),R(this,T,"f").forEach((t=>t())))},q=function(t,e){let s=R(this,O,"f")[t];return void 0===s&&(s=new J(t,this,e),R(this,O,"f")[t]=s),e&&(s.options=e),s},_=function(t){return R(this,T,"f").push(t),()=>{const e=R(this,T,"f").indexOf(t);-1!==e&&R(this,T,"f").splice(e,1)}},L.options={errorMessages:{required:"Required",fallback:"Invalid value"}}})(),r})()})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports["@duely/react-form"]=e(require("react")):t["@duely/react-form"]=e(t.react)}(this,(function(t){return(()=>{"use strict";var e={297:e=>{e.exports=t}},s={};function i(t){var a=s[t];if(void 0!==a)return a.exports;var r=s[t]={exports:{}};return e[t](r,r.exports,i),r.exports}i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var a={};return(()=>{i.r(a),i.d(a,{FormControl:()=>Q,FormFieldControl:()=>C,defaultGetElementValue:()=>x,defaultSetElementValue:()=>D,formFieldInfo:()=>j,useForm:()=>X,useRerender:()=>e});var t=i(297);function e(){const[,e]=(0,t.useState)(0);return(0,t.useCallback)((()=>e((t=>t+1))),[])}var s,r,n,o,h,u,l,f,d,p,c,m,v,w,y,b,V,k,g,U,E,M,W,F=function(t,e,s,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(t,s):a?a.value=s:e.set(t,s),s},S=function(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)};const T="Required";function x(t){return t.value}function D(t,e){return e=null!=e?e:"",t.value!==e&&(t.value=e,!0)}const j={checkbox:{props:{type:"checkbox"},getElementValue:t=>t.checked,setElementValue:(t,e)=>(e=null!=e&&e,t.checked!==e&&(t.checked=e,!0))},color:{props:{type:"color"}},date:{props:{type:"date"}},"datetime-local":{props:{type:"datetime-local"}},email:{props:{type:"email"}},file:{props:{type:"file"},getElementValue:t=>t.files},month:{props:{type:"month"}},number:{props:{type:"number"}},password:{props:{type:"password"}},radio:{props:{type:"radio"},getElementValue:t=>{var e;const s=null===(e=t.form)||void 0===e?void 0:e.elements[t.name];if(s)return s.value},setElementValue:(t,e)=>{var s;const i=null===(s=t.form)||void 0===s?void 0:s.elements[t.name];if(!i)return!1;const a=i;return e=null!=e?e:"",a.value!==e&&(""===e?Array.from(a).map((t=>t)).filter((t=>t.checked)).forEach((t=>t.checked=!1)):a.value=e,!0)}},range:{props:{type:"range"}},search:{props:{type:"search"}},tel:{props:{type:"tel"}},text:{props:{type:"text"}},time:{props:{type:"time"}},url:{props:{type:"url"}},week:{props:{type:"week"}},"select-one":{props:{}},"select-multiple":{props:{}},textarea:{props:{}}};class C{constructor(t,e){s.add(this),r.set(this,void 0),n.set(this,void 0),o.set(this,void 0),h.set(this,void 0),u.set(this,void 0),l.set(this,void 0),f.set(this,void 0),d.set(this,void 0),p.set(this,null),c.set(this,!1),m.set(this,!1),v.set(this,!1),w.set(this,[]),y.set(this,!1),b.set(this,[]),V.set(this,0),k.set(this,void 0),F(this,r,t,"f"),F(this,n,e,"f"),F(this,k,{},"f")}get props(){return S(this,h,"f")||F(this,h,{name:S(this,r,"f"),ref:t=>{t?S(this,s,"m",M).call(this,t):S(this,s,"m",W).call(this)},onChange:t=>{S(this,s,"m",U).call(this,t)},onBlur:t=>{S(this,s,"m",E).call(this,t)}},"f"),S(this,h,"f")}get type(){var t;return null===(t=S(this,o,"f"))||void 0===t?void 0:t.type}get value(){if(void 0!==S(this,o,"f"))return null!==S(this,o,"f")&&F(this,u,S(this,f,"f")(S(this,o,"f")),"f"),S(this,u,"f")}get defaultValue(){return S(this,l,"f")}get options(){return S(this,k,"f")}set options(t){S(this,k,"f")!==t&&(this.startUpdate(),void 0!==t.defaultValue&&this.setDefaultValue(t.defaultValue),F(this,k,t,"f"),this.endUpdate())}get isDirty(){return S(this,c,"f")}set isDirty(t){var e;S(this,c,"f")!==t&&(this.startUpdate(),F(this,c,t,"f"),F(this,y,!0,"f"),this.endUpdate(),(e=S(this,n,"f")).isDirty||(e.isDirty=t))}get isTouched(){return S(this,m,"f")}set isTouched(t){S(this,m,"f")!==t&&(this.startUpdate(),F(this,m,t,"f"),F(this,y,!0,"f"),this.endUpdate())}get error(){return S(this,p,"f")}set error(t){S(this,p,"f")!==t&&(this.startUpdate(),F(this,p,t,"f"),F(this,y,!0,"f"),this.endUpdate())}startUpdate(){F(this,V,+S(this,V,"f")+1,"f")}endUpdate(){0===F(this,V,+S(this,V,"f")-1,"f")&&(S(this,v,"f")&&(F(this,v,!1,"f"),S(this,w,"f").forEach((t=>t()))),S(this,y,"f")&&(F(this,y,!1,"f"),S(this,b,"f").forEach((t=>t()))))}setValue(t){S(this,o,"f")&&(this.startUpdate(),F(this,v,S(this,v,"f")||S(this,d,"f")(S(this,o,"f"),t),"f"),this.endUpdate())}setDefaultValue(t){F(this,l,t,"f"),S(this,o,"f")&&!S(this,s,"a",g)&&this.setValue(this.defaultValue)}subscribeToValueChanged(t){return S(this,w,"f").push(t),()=>{const e=S(this,w,"f").indexOf(t);-1!==e&&S(this,w,"f").splice(e,1)}}subscribeToStateChanged(t){return S(this,b,"f").push(t),()=>{const e=S(this,b,"f").indexOf(t);-1!==e&&S(this,b,"f").splice(e,1)}}validate(){return this.startUpdate(),this.options.required&&!S(this,s,"a",g)?(this.error=T,this.endUpdate(),!1):(this.error=null,this.endUpdate(),!0)}reset(t){this.startUpdate(),F(this,p,null,"f"),F(this,c,!1,"f"),F(this,m,!1,"f"),void 0!==t&&this.setDefaultValue(t),S(this,o,"f")&&S(this,d,"f")(S(this,o,"f"),this.defaultValue),F(this,v,!0,"f"),F(this,y,!0,"f"),this.endUpdate()}focus(){var t;null===(t=S(this,o,"f"))||void 0===t||t.focus()}}r=new WeakMap,n=new WeakMap,o=new WeakMap,h=new WeakMap,u=new WeakMap,l=new WeakMap,f=new WeakMap,d=new WeakMap,p=new WeakMap,c=new WeakMap,m=new WeakMap,v=new WeakMap,w=new WeakMap,y=new WeakMap,b=new WeakMap,V=new WeakMap,k=new WeakMap,s=new WeakSet,g=function(){return![void 0,""].includes(this.value)},U=function(t){this.startUpdate(),this.isDirty=!0,F(this,v,!0,"f"),this.isTouched&&this.validate(),this.endUpdate()},E=function(t){this.startUpdate(),this.isTouched=!0,this.isDirty&&this.validate(),this.endUpdate()},M=function(t){var e,s;this.startUpdate(),F(this,o,t,"f"),F(this,f,null!==(e=j[t.type].getElementValue)&&void 0!==e?e:x,"f"),F(this,d,null!==(s=j[t.type].setElementValue)&&void 0!==s?s:D,"f"),void 0!==this.defaultValue&&this.setValue(this.defaultValue),void 0!==this.value&&F(this,v,!0,"f"),this.endUpdate()},W=function(){F(this,o,null,"f")};var O,P,q,R,_,A,B,G,I,z,H,J,K,L=function(t,e,s,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(t,s):a?a.value=s:e.set(t,s),s},N=function(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)};class Q{constructor(t){var e;O.add(this),P.set(this,!1),q.set(this,!1),R.set(this,!1),_.set(this,[]),A.set(this,!1),B.set(this,[]),G.set(this,0),I.set(this,void 0),z.set(this,{}),L(this,I,null!==(e=null==t?void 0:t.defaultValues)&&void 0!==e?e:{},"f")}get value(){return Object.fromEntries(Object.entries(N(this,z,"f")).map((([t,e])=>[t,e.value])))}get isDirty(){return N(this,q,"f")}set isDirty(t){N(this,q,"f")!==t&&(this.startUpdate(),L(this,q,t,"f"),L(this,A,!0,"f"),this.endUpdate())}get isSubmitting(){return N(this,P,"f")}startUpdate(){L(this,G,+N(this,G,"f")+1,"f")}endUpdate(){0===L(this,G,+N(this,G,"f")-1,"f")&&(N(this,R,"f")&&(L(this,R,!1,"f"),N(this,_,"f").forEach((t=>t()))),N(this,A,"f")&&(L(this,A,!1,"f"),N(this,B,"f").forEach((t=>t()))))}register(t,e){return N(this,O,"m",H).call(this,t,e).props}useFormState(){const s=e();return(0,t.useEffect)((()=>N(this,O,"m",K).call(this,s)),[]),this}useFormFieldState(s){const i=e(),a=N(this,O,"m",H).call(this,s);return(0,t.useEffect)((()=>a.subscribeToStateChanged(i)),[]),a}useFormFieldValue(s){const i=e(),a=N(this,O,"m",H).call(this,s);return(0,t.useEffect)((()=>a.subscribeToValueChanged(i)),[]),a.value}useFormValue(){const s=e();return(0,t.useEffect)((()=>N(this,O,"m",J).call(this,s)),[]),this.value}reset(t){this.startUpdate(),t&&L(this,I,t,"f"),Object.entries(N(this,z,"f")).forEach((([e,s])=>s.reset(null==t?void 0:t[e]))),this.isDirty=!1,this.endUpdate()}handleSubmit(t){const e=this;return s=>{return i=this,a=void 0,n=function*(){null==s||s.preventDefault();const i={};for(const[t,s]of Object.entries(N(e,z,"f"))){if(!s.validate())return void s.focus();i[t]=s.value}this.startUpdate(),L(this,P,!0,"f"),L(this,A,!0,"f"),this.endUpdate(),yield t(i,s),this.startUpdate(),L(this,P,!1,"f"),L(this,A,!0,"f"),this.endUpdate()},new((r=void 0)||(r=Promise))((function(t,e){function s(t){try{h(n.next(t))}catch(t){e(t)}}function o(t){try{h(n.throw(t))}catch(t){e(t)}}function h(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(s,o)}h((n=n.apply(i,a||[])).next())}));var i,a,r,n}}setValue(t,e){N(this,O,"m",H).call(this,t).setValue(e)}setDefaultValue(t,e){N(this,O,"m",H).call(this,t).setDefaultValue(e)}}function X(e){const s=(0,t.useState)((()=>new Q(e)))[0];return(0,t.useMemo)((()=>({control:s,register:s.register.bind(s),useFormFieldState:s.useFormFieldState.bind(s),useFormFieldValue:s.useFormFieldValue.bind(s),useFormValue:s.useFormValue.bind(s),useFormState:s.useFormState.bind(s),reset:s.reset.bind(s),handleSubmit:s.handleSubmit.bind(s),setValue:s.setValue.bind(s),setDefaultValue:s.setDefaultValue.bind(s)})),[])}P=new WeakMap,q=new WeakMap,R=new WeakMap,_=new WeakMap,A=new WeakMap,B=new WeakMap,G=new WeakMap,I=new WeakMap,z=new WeakMap,O=new WeakSet,H=function(t,e){let s=N(this,z,"f")[t];const i=N(this,I,"f")[t];return e&&void 0===e.defaultValue&&void 0!==i&&(e.defaultValue=i),void 0===s&&(s=new C(t,this),N(this,z,"f")[t]=s,s.subscribeToValueChanged((()=>{this.startUpdate(),L(this,R,!0,"f"),this.endUpdate()}))),e&&(s.options=e),s},J=function(t){return N(this,_,"f").push(t),()=>{const e=N(this,_,"f").indexOf(t);-1!==e&&N(this,_,"f").splice(e,1)}},K=function(t){return N(this,B,"f").push(t),()=>{const e=N(this,B,"f").indexOf(t);-1!==e&&N(this,B,"f").splice(e,1)}}})(),a})()})); | ||
//# sourceMappingURL=index.js.map |
@@ -1,1 +0,3 @@ | ||
export * from './useForm'; | ||
export * from './hooks'; | ||
export * from './FormFieldControl'; | ||
export * from './FormControl'; |
{ | ||
"name": "@duely/react-form", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "React useFrom hook for duely.app", | ||
@@ -5,0 +5,0 @@ "repository": "github:uoleevi/duely", |
@@ -1,1 +0,3 @@ | ||
export * from './useForm'; | ||
export * from './hooks'; | ||
export * from './FormFieldControl'; | ||
export * from './FormControl'; |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
71478
18
827
1