@upandgo/ui-components
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -60,3 +60,3 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@emotion/styled"),r=require("@mui/material");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=n(e),o=n(t);const i=o.default.img` | ||
* LICENSE file in the root directory of this source tree. | ||
*/!function(e){"production"===process.env.NODE_ENV?e.exports=function(){if(mr)return br;mr=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case c:case l:case n:case o:case a:case f:return e;default:switch(e=e&&e.$$typeof){case u:case s:case y:case p:case i:return e;default:return d}}case r:return d}}}function E(e){return g(e)===l}return br.AsyncMode=c,br.ConcurrentMode=l,br.ContextConsumer=u,br.ContextProvider=i,br.Element=t,br.ForwardRef=s,br.Fragment=n,br.Lazy=y,br.Memo=p,br.Portal=r,br.Profiler=o,br.StrictMode=a,br.Suspense=f,br.isAsyncMode=function(e){return E(e)||g(e)===c},br.isConcurrentMode=E,br.isContextConsumer=function(e){return g(e)===u},br.isContextProvider=function(e){return g(e)===i},br.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},br.isForwardRef=function(e){return g(e)===s},br.isFragment=function(e){return g(e)===n},br.isLazy=function(e){return g(e)===y},br.isMemo=function(e){return g(e)===p},br.isPortal=function(e){return g(e)===r},br.isProfiler=function(e){return g(e)===o},br.isStrictMode=function(e){return g(e)===a},br.isSuspense=function(e){return g(e)===f},br.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===o||e===a||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===i||e.$$typeof===u||e.$$typeof===s||e.$$typeof===m||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v)},br.typeOf=g,br}():e.exports=(gr||(gr=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:var v=e.type;switch(v){case c:case l:case n:case o:case a:case f:return v;default:var m=v&&v.$$typeof;switch(m){case u:case s:case y:case p:case i:return m;default:return d}}case r:return d}}}var E=c,S=l,_=u,j=i,O=t,w=s,A=n,T=y,x=p,F=r,C=o,k=a,I=f,N=!1;function P(e){return g(e)===l}Er.AsyncMode=E,Er.ConcurrentMode=S,Er.ContextConsumer=_,Er.ContextProvider=j,Er.Element=O,Er.ForwardRef=w,Er.Fragment=A,Er.Lazy=T,Er.Memo=x,Er.Portal=F,Er.Profiler=C,Er.StrictMode=k,Er.Suspense=I,Er.isAsyncMode=function(e){return N||(N=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),P(e)||g(e)===c},Er.isConcurrentMode=P,Er.isContextConsumer=function(e){return g(e)===u},Er.isContextProvider=function(e){return g(e)===i},Er.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Er.isForwardRef=function(e){return g(e)===s},Er.isFragment=function(e){return g(e)===n},Er.isLazy=function(e){return g(e)===y},Er.isMemo=function(e){return g(e)===p},Er.isPortal=function(e){return g(e)===r},Er.isProfiler=function(e){return g(e)===o},Er.isStrictMode=function(e){return g(e)===a},Er.isSuspense=function(e){return g(e)===f},Er.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===o||e===a||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===i||e.$$typeof===u||e.$$typeof===s||e.$$typeof===m||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v)},Er.typeOf=g}()),Er)}(hr);var Sr=hr.exports,_r={};_r[Sr.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_r[Sr.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};function jr(e){return Qt(e,5)}function Or(){return Or=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Or.apply(this,arguments)}function wr(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}function Ar(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Tr=function(e){return Array.isArray(e)&&0===e.length},xr=function(e){return"function"==typeof e},Fr=function(e){return null!==e&&"object"==typeof e},Cr=function(e){return String(Math.floor(Number(e)))===e},kr=function(e){return"[object String]"===Object.prototype.toString.call(e)},Ir=function(t){return 0===e.Children.count(t)},Nr=function(e){return Fr(e)&&xr(e.then)};function Pr(e,t,r,n){void 0===n&&(n=0);for(var a=pr(t);e&&n<a.length;)e=e[a[n++]];return void 0===e?r:e}function Mr(e,t,r){for(var n=Zt(e),a=n,o=0,i=pr(t);o<i.length-1;o++){var u=i[o],c=Pr(e,i.slice(0,o+1));if(c&&(Fr(c)||Array.isArray(c)))a=a[u]=Zt(c);else{var l=i[o+1];a=a[u]=Cr(l)&&Number(l)>=0?[]:{}}}return(0===o?e:a)[i[o]]===r?e:(void 0===r?delete a[i[o]]:a[i[o]]=r,0===o&&void 0===r&&delete n[i[o]],n)}function Rr(e,t,r,n){void 0===r&&(r=new WeakMap),void 0===n&&(n={});for(var a=0,o=Object.keys(e);a<o.length;a++){var i=o[a],u=e[i];Fr(u)?r.get(u)||(r.set(u,!0),n[i]=Array.isArray(u)?[]:{},Rr(u,t,r,n[i])):n[i]=t}return n}var $r=e.createContext(void 0);$r.displayName="FormikContext";var Dr=$r.Provider;function Vr(e,t){switch(t.type){case"SET_VALUES":return Or({},e,{values:t.payload});case"SET_TOUCHED":return Or({},e,{touched:t.payload});case"SET_ERRORS":return C(e.errors,t.payload)?e:Or({},e,{errors:t.payload});case"SET_STATUS":return Or({},e,{status:t.payload});case"SET_ISSUBMITTING":return Or({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Or({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Or({},e,{values:Mr(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Or({},e,{touched:Mr(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Or({},e,{errors:Mr(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Or({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Or({},e,{touched:Rr(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return Or({},e,{isSubmitting:!1});default:return e}}$r.Consumer;var Lr={},Ur={};function zr(t){var r=t.validateOnChange,n=void 0===r||r,a=t.validateOnBlur,o=void 0===a||a,i=t.validateOnMount,u=void 0!==i&&i,c=t.isInitialValid,l=t.enableReinitialize,s=void 0!==l&&l,f=t.onSubmit,d=wr(t,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=Or({validateOnChange:n,validateOnBlur:o,validateOnMount:u,onSubmit:f},d),y=e.useRef(p.initialValues),v=e.useRef(p.initialErrors||Lr),m=e.useRef(p.initialTouched||Ur),h=e.useRef(p.initialStatus),b=e.useRef(!1),g=e.useRef({});"production"!==process.env.NODE_ENV&&e.useEffect((function(){void 0!==c&&("production"!==process.env.NODE_ENV?vr(!1,"isInitialValid has been deprecated and will be removed in future versions of Formik. Please use initialErrors or validateOnMount instead."):vr(!1))}),[]),e.useEffect((function(){return b.current=!0,function(){b.current=!1}}),[]);var E=e.useReducer(Vr,{values:p.initialValues,errors:p.initialErrors||Lr,touched:p.initialTouched||Ur,status:p.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),S=E[0],_=E[1],j=e.useCallback((function(e,t){return new Promise((function(r,n){var a=p.validate(e,t);null==a?r(Lr):Nr(a)?a.then((function(e){r(e||Lr)}),(function(e){"production"!==process.env.NODE_ENV&&console.warn("Warning: An unhandled error was caught during validation in <Formik validate />",e),n(e)})):r(a)}))}),[p.validate]),O=e.useCallback((function(e,t){var r=p.validationSchema,n=xr(r)?r(t):r,a=t&&n.validateAt?n.validateAt(t,e):function(e,t,r,n){void 0===r&&(r=!1);void 0===n&&(n={});var a=Hr(e);return t[r?"validateSync":"validate"](a,{abortEarly:!1,context:n})}(e,n);return new Promise((function(e,t){a.then((function(){e(Lr)}),(function(r){"ValidationError"===r.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return Mr(t,e.path,e.message);var r=e.inner,n=Array.isArray(r),a=0;for(r=n?r:r[Symbol.iterator]();;){var o;if(n){if(a>=r.length)break;o=r[a++]}else{if((a=r.next()).done)break;o=a.value}var i=o;Pr(t,i.path)||(t=Mr(t,i.path,i.message))}}return t}(r)):("production"!==process.env.NODE_ENV&&console.warn("Warning: An unhandled error was caught during validation in <Formik validationSchema />",r),t(r))}))}))}),[p.validationSchema]),w=e.useCallback((function(e,t){return new Promise((function(r){return r(g.current[e].validate(t))}))}),[]),A=e.useCallback((function(e){var t=Object.keys(g.current).filter((function(e){return xr(g.current[e].validate)})),r=t.length>0?t.map((function(t){return w(t,Pr(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(r).then((function(e){return e.reduce((function(e,r,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===r||r&&(e=Mr(e,t[n],r)),e}),{})}))}),[w]),T=e.useCallback((function(e){return Promise.all([A(e),p.validationSchema?O(e):{},p.validate?j(e):{}]).then((function(e){var t=e[0],r=e[1],n=e[2];return R.all([t,r,n],{arrayMerge:Gr})}))}),[p.validate,p.validationSchema,A,j,O]),x=Kr((function(e){return void 0===e&&(e=S.values),_({type:"SET_ISVALIDATING",payload:!0}),T(e).then((function(e){return b.current&&(_({type:"SET_ISVALIDATING",payload:!1}),_({type:"SET_ERRORS",payload:e})),e}))}));e.useEffect((function(){u&&!0===b.current&&C(y.current,p.initialValues)&&x(y.current)}),[u,x]);var F=e.useCallback((function(e){var t=e&&e.values?e.values:y.current,r=e&&e.errors?e.errors:v.current?v.current:p.initialErrors||{},n=e&&e.touched?e.touched:m.current?m.current:p.initialTouched||{},a=e&&e.status?e.status:h.current?h.current:p.initialStatus;y.current=t,v.current=r,m.current=n,h.current=a;var o=function(){_({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:r,touched:n,status:a,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(p.onReset){var i=p.onReset(S.values,X);Nr(i)?i.then(o):o()}else o()}),[p.initialErrors,p.initialStatus,p.initialTouched]);e.useEffect((function(){!0!==b.current||C(y.current,p.initialValues)||(s&&(y.current=p.initialValues,F()),u&&x(y.current))}),[s,p.initialValues,F,u,x]),e.useEffect((function(){s&&!0===b.current&&!C(v.current,p.initialErrors)&&(v.current=p.initialErrors||Lr,_({type:"SET_ERRORS",payload:p.initialErrors||Lr}))}),[s,p.initialErrors]),e.useEffect((function(){s&&!0===b.current&&!C(m.current,p.initialTouched)&&(m.current=p.initialTouched||Ur,_({type:"SET_TOUCHED",payload:p.initialTouched||Ur}))}),[s,p.initialTouched]),e.useEffect((function(){s&&!0===b.current&&!C(h.current,p.initialStatus)&&(h.current=p.initialStatus,_({type:"SET_STATUS",payload:p.initialStatus}))}),[s,p.initialStatus,p.initialTouched]);var k=Kr((function(e){if(g.current[e]&&xr(g.current[e].validate)){var t=Pr(S.values,e),r=g.current[e].validate(t);return Nr(r)?(_({type:"SET_ISVALIDATING",payload:!0}),r.then((function(e){return e})).then((function(t){_({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),_({type:"SET_ISVALIDATING",payload:!1})}))):(_({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),Promise.resolve(r))}return p.validationSchema?(_({type:"SET_ISVALIDATING",payload:!0}),O(S.values,e).then((function(e){return e})).then((function(t){_({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),_({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),I=e.useCallback((function(e,t){var r=t.validate;g.current[e]={validate:r}}),[]),N=e.useCallback((function(e){delete g.current[e]}),[]),P=Kr((function(e,t){return _({type:"SET_TOUCHED",payload:e}),(void 0===t?o:t)?x(S.values):Promise.resolve()})),M=e.useCallback((function(e){_({type:"SET_ERRORS",payload:e})}),[]),$=Kr((function(e,t){var r=xr(e)?e(S.values):e;return _({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?x(r):Promise.resolve()})),D=e.useCallback((function(e,t){_({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),V=Kr((function(e,t,r){return _({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?x(Mr(S.values,e,t)):Promise.resolve()})),L=e.useCallback((function(e,t){var r,n=t,a=e;if(!kr(e)){e.persist&&e.persist();var o=e.target?e.target:e.currentTarget,i=o.type,u=o.name,c=o.id,l=o.value,s=o.checked,f=o.outerHTML,d=o.options,p=o.multiple;(n=t||(u||c))||"production"===process.env.NODE_ENV||Wr({htmlContent:f,documentationAnchorLink:"handlechange-e-reactchangeeventany--void",handlerName:"handleChange"}),a=/number|range/.test(i)?(r=parseFloat(l),isNaN(r)?"":r):/checkbox/.test(i)?function(e,t,r){if("boolean"==typeof e)return Boolean(t);var n=[],a=!1,o=-1;if(Array.isArray(e))n=e,a=(o=e.indexOf(r))>=0;else if(!r||"true"==r||"false"==r)return Boolean(t);if(t&&r&&!a)return n.concat(r);if(!a)return n;return n.slice(0,o).concat(n.slice(o+1))}(Pr(S.values,n),s,l):d&&p?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(d):l}n&&V(n,a)}),[V,S.values]),U=Kr((function(e){if(kr(e))return function(t){return L(t,e)};L(e)})),z=Kr((function(e,t,r){return void 0===t&&(t=!0),_({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===r?o:r)?x(S.values):Promise.resolve()})),B=e.useCallback((function(e,t){e.persist&&e.persist();var r=e.target,n=r.name,a=r.id,o=r.outerHTML,i=t||(n||a);i||"production"===process.env.NODE_ENV||Wr({htmlContent:o,documentationAnchorLink:"handleblur-e-any--void",handlerName:"handleBlur"}),z(i,!0)}),[z]),W=Kr((function(e){if(kr(e))return function(t){return B(t,e)};B(e)})),H=e.useCallback((function(e){xr(e)?_({type:"SET_FORMIK_STATE",payload:e}):_({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),G=e.useCallback((function(e){_({type:"SET_STATUS",payload:e})}),[]),q=e.useCallback((function(e){_({type:"SET_ISSUBMITTING",payload:e})}),[]),K=Kr((function(){return _({type:"SUBMIT_ATTEMPT"}),x().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var r;try{if(void 0===(r=J()))return}catch(e){throw e}return Promise.resolve(r).then((function(e){return b.current&&_({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(b.current)throw _({type:"SUBMIT_FAILURE"}),e}))}if(b.current&&(_({type:"SUBMIT_FAILURE"}),t))throw e}))})),Y=Kr((function(e){if(e&&e.preventDefault&&xr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&xr(e.stopPropagation)&&e.stopPropagation(),"production"!==process.env.NODE_ENV&&"undefined"!=typeof document){var t=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}();null!==t&&t instanceof HTMLButtonElement&&(t.attributes&&t.attributes.getNamedItem("type")||("production"!==process.env.NODE_ENV?vr(!1,'You submitted a Formik form using a button with an unspecified `type` attribute. Most browsers default button elements to `type="submit"`. If this is not a submit button, please add `type="button"`.'):vr(!1)))}K().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),X={resetForm:F,validateForm:x,validateField:k,setErrors:M,setFieldError:D,setFieldTouched:z,setFieldValue:V,setStatus:G,setSubmitting:q,setTouched:P,setValues:$,setFormikState:H,submitForm:K},J=Kr((function(){return f(S.values,X)})),Q=Kr((function(e){e&&e.preventDefault&&xr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&xr(e.stopPropagation)&&e.stopPropagation(),F()})),Z=e.useCallback((function(e){return{value:Pr(S.values,e),error:Pr(S.errors,e),touched:!!Pr(S.touched,e),initialValue:Pr(y.current,e),initialTouched:!!Pr(m.current,e),initialError:Pr(v.current,e)}}),[S.errors,S.touched,S.values]),ee=e.useCallback((function(e){return{setValue:function(t,r){return V(e,t,r)},setTouched:function(t,r){return z(e,t,r)},setError:function(t){return D(e,t)}}}),[V,z,D]),te=e.useCallback((function(e){var t=Fr(e),r=t?e.name:e,n=Pr(S.values,r),a={name:r,value:n,onChange:U,onBlur:W};if(t){var o=e.type,i=e.value,u=e.as,c=e.multiple;"checkbox"===o?void 0===i?a.checked=!!n:(a.checked=!(!Array.isArray(n)||!~n.indexOf(i)),a.value=i):"radio"===o?(a.checked=n===i,a.value=i):"select"===u&&c&&(a.value=a.value||[],a.multiple=!0)}return a}),[W,U,S.values]),re=e.useMemo((function(){return!C(y.current,S.values)}),[y.current,S.values]),ne=e.useMemo((function(){return void 0!==c?re?S.errors&&0===Object.keys(S.errors).length:!1!==c&&xr(c)?c(p):c:S.errors&&0===Object.keys(S.errors).length}),[c,re,S.errors,p]);return Or({},S,{initialValues:y.current,initialErrors:v.current,initialTouched:m.current,initialStatus:h.current,handleBlur:W,handleChange:U,handleReset:Q,handleSubmit:Y,resetForm:F,setErrors:M,setFormikState:H,setFieldTouched:z,setFieldValue:V,setFieldError:D,setStatus:G,setSubmitting:q,setTouched:P,setValues:$,submitForm:K,validateForm:x,validateField:k,isValid:ne,dirty:re,unregisterField:N,registerField:I,getFieldProps:te,getFieldMeta:Z,getFieldHelpers:ee,validateOnBlur:o,validateOnChange:n,validateOnMount:u})}function Br(t){var r=zr(t),n=t.component,a=t.children,o=t.render,i=t.innerRef;return e.useImperativeHandle(i,(function(){return r})),"production"!==process.env.NODE_ENV&&e.useEffect((function(){t.render&&("production"!==process.env.NODE_ENV?vr(!1,"<Formik render> has been deprecated and will be removed in future versions of Formik. Please use a child callback function instead. To get rid of this warning, replace <Formik render={(props) => ...} /> with <Formik>{(props) => ...}</Formik>"):vr(!1))}),[]),e.createElement(Dr,{value:r},n?e.createElement(n,r):o?o(r):a?xr(a)?a(r):Ir(a)?null:e.Children.only(a):null)}function Wr(e){var t=e.htmlContent,r=e.documentationAnchorLink,n=e.handlerName;console.warn("Warning: Formik called `"+n+"`, but you forgot to pass an `id` or `name` attribute to your input:\n "+t+"\n Formik cannot determine which value to update. For more info see https://formik.org/docs/api/formik#"+r+"\n ")}function Hr(e){var t=Array.isArray(e)?[]:{};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=String(r);!0===Array.isArray(e[n])?t[n]=e[n].map((function(e){return!0===Array.isArray(e)||re(e)?Hr(e):""!==e?e:void 0})):re(e[n])?t[n]=Hr(e[n]):t[n]=""!==e[n]?e[n]:void 0}return t}function Gr(e,t,r){var n=e.slice();return t.forEach((function(t,a){if(void 0===n[a]){var o=!1!==r.clone&&r.isMergeableObject(t);n[a]=o?R(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?n[a]=R(e[a],t,r):-1===e.indexOf(t)&&n.push(t)})),n}var qr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function Kr(t){var r=e.useRef(t);return qr((function(){r.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.current.apply(void 0,t)}),[])}e.forwardRef((function(t,r){var n,a=t.action,o=wr(t,["action"]),i=null!=a?a:"#",u=((n=e.useContext($r))||("production"!==process.env.NODE_ENV?vr(!1,"Formik context is undefined, please verify you are calling useFormikContext() as child of a <Formik> component."):vr(!1)),n),c=u.handleReset,l=u.handleSubmit;return e.createElement("form",Object.assign({onSubmit:l,ref:r,onReset:c,action:i},o))})).displayName="Form";var Yr=function(e,t,r){var n=Xr(e);return n.splice(t,0,r),n},Xr=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from(Or({},e,{length:t+1}))}return[]},Jr=function(t){var r,n;function a(e){var r;return(r=t.call(this,e)||this).updateArrayField=function(e,t,n){var a=r.props,o=a.name;(0,a.formik.setFormikState)((function(r){var a="function"==typeof n?n:e,i="function"==typeof t?t:e,u=Mr(r.values,o,e(Pr(r.values,o))),c=n?a(Pr(r.errors,o)):void 0,l=t?i(Pr(r.touched,o)):void 0;return Tr(c)&&(c=void 0),Tr(l)&&(l=void 0),Or({},r,{values:u,errors:n?Mr(r.errors,o,c):r.errors,touched:t?Mr(r.touched,o,l):r.touched})}))},r.push=function(e){return r.updateArrayField((function(t){return[].concat(Xr(t),[jr(e)])}),!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=Xr(e),a=n[t];return n[t]=n[r],n[r]=a,n}(r,e,t)}),!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=Xr(e),a=n[t];return n.splice(t,1),n.splice(r,0,a),n}(r,e,t)}),!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField((function(r){return Yr(r,e,t)}),(function(t){return Yr(t,e,null)}),(function(t){return Yr(t,e,null)}))},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=Xr(e);return n[t]=r,n}(r,e,t)}),!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField((function(r){var n=r?[e].concat(r):[e];return t<0&&(t=n.length),n}),(function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r}),(function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r})),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(Ar(r)),r.pop=r.pop.bind(Ar(r)),r}n=t,(r=a).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n;var o=a.prototype;return o.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!C(Pr(e.formik.values,e.name),Pr(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},o.remove=function(e){var t;return this.updateArrayField((function(r){var n=r?Xr(r):[];return t||(t=n[e]),xr(n.splice)&&n.splice(e,1),n}),!0,!0),t},o.pop=function(){var e;return this.updateArrayField((function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r}),!0,!0),e},o.render=function(){var t={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},r=this.props,n=r.component,a=r.render,o=r.children,i=r.name,u=Or({},t,{form:wr(r.formik,["validate","validationSchema"]),name:i});return n?e.createElement(n,u):a?a(u):o?"function"==typeof o?o(u):Ir(o)?null:e.Children.only(o):null},a}(e.Component);Jr.defaultProps={validateOnChange:!0};const Qr=e=>t=>{var r,n;const a={};for(const[o,i]of Object.entries(e)){if("password"===i.type&&(null===(r=i.confirmPassword)||void 0===r?void 0:r.addField)&&t[o]!==t.confirmPassword&&(a.confirmPassword=i.confirmPassword.errorMessage),!i.validation)continue;if((null===(n=i.validation.required)||void 0===n?void 0:n.value)&&!t[o]){a[o]=i.validation.required.message;continue}if("checkbox"===e[o].type)continue;const u=t[o],{pattern:c,minLength:l}=i.validation;!c||c.value.test(u)?l&&u.length<l.value&&(a[o]=l.message):a[o]=c.message}return a},Zr=({formSchema:e,onSubmit:t,buttonLabel:n})=>{const o=Object.entries(e).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t[0]]:t[1].initialValue})),{});return a.default.createElement(Br,{initialValues:o,onSubmit:e=>{const r=e,n="confirmPassword";r[n];const a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}(r,[n+""]);t(a)},validate:Qr(e)},(({handleSubmit:t,values:o,handleChange:i,touched:u,errors:c})=>a.default.createElement("form",{noValidate:!0,onSubmit:t,className:"uag uag-form"},a.default.createElement(r.Stack,{className:"uag uag-form-stack",spacing:1},Object.entries(e).map((([e,t])=>{var n,l,s,f,d;const p={fullWidth:!0,id:e,name:e,label:`${t.label}${(null===(l=null===(n=t.validation)||void 0===n?void 0:n.required)||void 0===l?void 0:l.value)?"*":""}`,type:t.type,value:o[e],onChange:i,error:u[e]&&Boolean(c[e]),helperText:u[e]&&c[e]};return"password"===t.type?a.default.createElement(r.Stack,{className:"uag uag-pwd-container",key:e,spacing:1},a.default.createElement(r.TextField,Object.assign({},p,{className:"uag uag-form-text uag-form-text-password"})),(null===(s=t.confirmPassword)||void 0===s?void 0:s.addField)?a.default.createElement(r.TextField,{name:"confirmPassword",label:`${t.confirmPassword.label}${(null===(d=null===(f=t.validation)||void 0===f?void 0:f.required)||void 0===d?void 0:d.value)?"*":""}`,onChange:i,value:o.confirmPassword,error:u.confirmPassword&&Boolean(c.confirmPassword),helperText:u.confirmPassword&&c.confirmPassword,fullWidth:!0,type:"password",className:"uag uag-form-text uag-form-text-password uag-form-text-password-confirmation"}):null):"checkbox"===t.type?a.default.createElement(r.FormControl,{key:e,fullWidth:!0,error:p.error,className:"uag uag-form-checkbox uag-form-checkbox-control"},a.default.createElement(r.FormControlLabel,{control:a.default.createElement(r.Checkbox,{name:e,value:o[e],onChange:i,defaultChecked:t.initialValue,className:"uag uag-form-checkbox"}),label:t.label}),p.helperText&&a.default.createElement(r.FormHelperText,{className:"uag uag-form-helper-txt uag-form-checkbox-helper-txt"},p.helperText)):"list"===t.type?a.default.createElement(r.FormControl,{error:p.error,fullWidth:!0,key:e},a.default.createElement(r.InputLabel,{id:"uag-form-list-label"},t.label),a.default.createElement(r.Select,{labelId:"uag-form-list-label",name:e,onChange:i,value:o[e],label:t.label},t.options.map((({value:e,label:t})=>a.default.createElement(r.MenuItem,{key:e,value:e},t)))),p.helperText&&a.default.createElement(r.FormHelperText,{className:"uag uag-form-helper-txt uag-form-list-helper-txt"},p.helperText)):a.default.createElement(r.TextField,Object.assign({key:e},p,{className:"uag uag-form-text"}))})),a.default.createElement("div",{className:"uag uag-form-btn-container"},a.default.createElement("button",{className:"uag uag-form-btn",type:"submit"},n))))))};var en=Object.freeze({__proto__:null,default:Zr});exports.Avatar=e=>"avatarUrl"in e?a.default.createElement(f,Object.assign({},e)):a.default.createElement(s,Object.assign({},e)),exports.Form=Zr,exports.FormTypes=en,exports.ItemSelector=({urlList:t,initialIndex:r,onChange:n})=>{const[o,i]=e.useState(r&&r<t.length?r:0),u=0===o,c=o===t.length-1,l=e=>r=>{r.preventDefault();const a="decrement"===e?Math.max(o-1,0):Math.min(o+1,t.length-1);i(a),n(t[a])};return a.default.createElement(S,{className:"uag-item-selector-container"},a.default.createElement(_,{disabled:u,className:"uag-item-selector-control uag-item-selector-control-left",onClick:l("decrement")},!u&&a.default.createElement(g,{className:"uag-item-selector-arrow uag-item-selector-arrow-left",size:"75%"})),a.default.createElement(j,{className:"uag-item-selector-item-container"},a.default.createElement(O,{className:"uag-item-selector-item-img",src:t[o]})),a.default.createElement(_,{disabled:c,className:"uag-item-selector-control uag-item-selector-control-right",onClick:l("increment")},!c&&a.default.createElement(E,{className:"uag-item-selector-arrow uag-item-selector-arrow-right",size:"75%"})))}; | ||
*/!function(e){"production"===process.env.NODE_ENV?e.exports=function(){if(mr)return br;mr=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case c:case l:case n:case o:case a:case f:return e;default:switch(e=e&&e.$$typeof){case u:case s:case y:case p:case i:return e;default:return d}}case r:return d}}}function E(e){return g(e)===l}return br.AsyncMode=c,br.ConcurrentMode=l,br.ContextConsumer=u,br.ContextProvider=i,br.Element=t,br.ForwardRef=s,br.Fragment=n,br.Lazy=y,br.Memo=p,br.Portal=r,br.Profiler=o,br.StrictMode=a,br.Suspense=f,br.isAsyncMode=function(e){return E(e)||g(e)===c},br.isConcurrentMode=E,br.isContextConsumer=function(e){return g(e)===u},br.isContextProvider=function(e){return g(e)===i},br.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},br.isForwardRef=function(e){return g(e)===s},br.isFragment=function(e){return g(e)===n},br.isLazy=function(e){return g(e)===y},br.isMemo=function(e){return g(e)===p},br.isPortal=function(e){return g(e)===r},br.isProfiler=function(e){return g(e)===o},br.isStrictMode=function(e){return g(e)===a},br.isSuspense=function(e){return g(e)===f},br.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===o||e===a||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===i||e.$$typeof===u||e.$$typeof===s||e.$$typeof===m||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v)},br.typeOf=g,br}():e.exports=(gr||(gr=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:var v=e.type;switch(v){case c:case l:case n:case o:case a:case f:return v;default:var m=v&&v.$$typeof;switch(m){case u:case s:case y:case p:case i:return m;default:return d}}case r:return d}}}var E=c,S=l,_=u,j=i,O=t,w=s,A=n,T=y,x=p,F=r,C=o,k=a,I=f,N=!1;function P(e){return g(e)===l}Er.AsyncMode=E,Er.ConcurrentMode=S,Er.ContextConsumer=_,Er.ContextProvider=j,Er.Element=O,Er.ForwardRef=w,Er.Fragment=A,Er.Lazy=T,Er.Memo=x,Er.Portal=F,Er.Profiler=C,Er.StrictMode=k,Er.Suspense=I,Er.isAsyncMode=function(e){return N||(N=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),P(e)||g(e)===c},Er.isConcurrentMode=P,Er.isContextConsumer=function(e){return g(e)===u},Er.isContextProvider=function(e){return g(e)===i},Er.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Er.isForwardRef=function(e){return g(e)===s},Er.isFragment=function(e){return g(e)===n},Er.isLazy=function(e){return g(e)===y},Er.isMemo=function(e){return g(e)===p},Er.isPortal=function(e){return g(e)===r},Er.isProfiler=function(e){return g(e)===o},Er.isStrictMode=function(e){return g(e)===a},Er.isSuspense=function(e){return g(e)===f},Er.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===o||e===a||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===i||e.$$typeof===u||e.$$typeof===s||e.$$typeof===m||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v)},Er.typeOf=g}()),Er)}(hr);var Sr=hr.exports,_r={};_r[Sr.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_r[Sr.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};function jr(e){return Qt(e,5)}function Or(){return Or=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Or.apply(this,arguments)}function wr(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}function Ar(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Tr=function(e){return Array.isArray(e)&&0===e.length},xr=function(e){return"function"==typeof e},Fr=function(e){return null!==e&&"object"==typeof e},Cr=function(e){return String(Math.floor(Number(e)))===e},kr=function(e){return"[object String]"===Object.prototype.toString.call(e)},Ir=function(t){return 0===e.Children.count(t)},Nr=function(e){return Fr(e)&&xr(e.then)};function Pr(e,t,r,n){void 0===n&&(n=0);for(var a=pr(t);e&&n<a.length;)e=e[a[n++]];return void 0===e?r:e}function Mr(e,t,r){for(var n=Zt(e),a=n,o=0,i=pr(t);o<i.length-1;o++){var u=i[o],c=Pr(e,i.slice(0,o+1));if(c&&(Fr(c)||Array.isArray(c)))a=a[u]=Zt(c);else{var l=i[o+1];a=a[u]=Cr(l)&&Number(l)>=0?[]:{}}}return(0===o?e:a)[i[o]]===r?e:(void 0===r?delete a[i[o]]:a[i[o]]=r,0===o&&void 0===r&&delete n[i[o]],n)}function Rr(e,t,r,n){void 0===r&&(r=new WeakMap),void 0===n&&(n={});for(var a=0,o=Object.keys(e);a<o.length;a++){var i=o[a],u=e[i];Fr(u)?r.get(u)||(r.set(u,!0),n[i]=Array.isArray(u)?[]:{},Rr(u,t,r,n[i])):n[i]=t}return n}var $r=e.createContext(void 0);$r.displayName="FormikContext";var Dr=$r.Provider;function Vr(e,t){switch(t.type){case"SET_VALUES":return Or({},e,{values:t.payload});case"SET_TOUCHED":return Or({},e,{touched:t.payload});case"SET_ERRORS":return C(e.errors,t.payload)?e:Or({},e,{errors:t.payload});case"SET_STATUS":return Or({},e,{status:t.payload});case"SET_ISSUBMITTING":return Or({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Or({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Or({},e,{values:Mr(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Or({},e,{touched:Mr(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Or({},e,{errors:Mr(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Or({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Or({},e,{touched:Rr(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return Or({},e,{isSubmitting:!1});default:return e}}$r.Consumer;var Lr={},Ur={};function zr(t){var r=t.validateOnChange,n=void 0===r||r,a=t.validateOnBlur,o=void 0===a||a,i=t.validateOnMount,u=void 0!==i&&i,c=t.isInitialValid,l=t.enableReinitialize,s=void 0!==l&&l,f=t.onSubmit,d=wr(t,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=Or({validateOnChange:n,validateOnBlur:o,validateOnMount:u,onSubmit:f},d),y=e.useRef(p.initialValues),v=e.useRef(p.initialErrors||Lr),m=e.useRef(p.initialTouched||Ur),h=e.useRef(p.initialStatus),b=e.useRef(!1),g=e.useRef({});"production"!==process.env.NODE_ENV&&e.useEffect((function(){void 0!==c&&("production"!==process.env.NODE_ENV?vr(!1,"isInitialValid has been deprecated and will be removed in future versions of Formik. Please use initialErrors or validateOnMount instead."):vr(!1))}),[]),e.useEffect((function(){return b.current=!0,function(){b.current=!1}}),[]);var E=e.useReducer(Vr,{values:p.initialValues,errors:p.initialErrors||Lr,touched:p.initialTouched||Ur,status:p.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),S=E[0],_=E[1],j=e.useCallback((function(e,t){return new Promise((function(r,n){var a=p.validate(e,t);null==a?r(Lr):Nr(a)?a.then((function(e){r(e||Lr)}),(function(e){"production"!==process.env.NODE_ENV&&console.warn("Warning: An unhandled error was caught during validation in <Formik validate />",e),n(e)})):r(a)}))}),[p.validate]),O=e.useCallback((function(e,t){var r=p.validationSchema,n=xr(r)?r(t):r,a=t&&n.validateAt?n.validateAt(t,e):function(e,t,r,n){void 0===r&&(r=!1);void 0===n&&(n={});var a=Hr(e);return t[r?"validateSync":"validate"](a,{abortEarly:!1,context:n})}(e,n);return new Promise((function(e,t){a.then((function(){e(Lr)}),(function(r){"ValidationError"===r.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return Mr(t,e.path,e.message);var r=e.inner,n=Array.isArray(r),a=0;for(r=n?r:r[Symbol.iterator]();;){var o;if(n){if(a>=r.length)break;o=r[a++]}else{if((a=r.next()).done)break;o=a.value}var i=o;Pr(t,i.path)||(t=Mr(t,i.path,i.message))}}return t}(r)):("production"!==process.env.NODE_ENV&&console.warn("Warning: An unhandled error was caught during validation in <Formik validationSchema />",r),t(r))}))}))}),[p.validationSchema]),w=e.useCallback((function(e,t){return new Promise((function(r){return r(g.current[e].validate(t))}))}),[]),A=e.useCallback((function(e){var t=Object.keys(g.current).filter((function(e){return xr(g.current[e].validate)})),r=t.length>0?t.map((function(t){return w(t,Pr(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(r).then((function(e){return e.reduce((function(e,r,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===r||r&&(e=Mr(e,t[n],r)),e}),{})}))}),[w]),T=e.useCallback((function(e){return Promise.all([A(e),p.validationSchema?O(e):{},p.validate?j(e):{}]).then((function(e){var t=e[0],r=e[1],n=e[2];return R.all([t,r,n],{arrayMerge:Gr})}))}),[p.validate,p.validationSchema,A,j,O]),x=Kr((function(e){return void 0===e&&(e=S.values),_({type:"SET_ISVALIDATING",payload:!0}),T(e).then((function(e){return b.current&&(_({type:"SET_ISVALIDATING",payload:!1}),_({type:"SET_ERRORS",payload:e})),e}))}));e.useEffect((function(){u&&!0===b.current&&C(y.current,p.initialValues)&&x(y.current)}),[u,x]);var F=e.useCallback((function(e){var t=e&&e.values?e.values:y.current,r=e&&e.errors?e.errors:v.current?v.current:p.initialErrors||{},n=e&&e.touched?e.touched:m.current?m.current:p.initialTouched||{},a=e&&e.status?e.status:h.current?h.current:p.initialStatus;y.current=t,v.current=r,m.current=n,h.current=a;var o=function(){_({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:r,touched:n,status:a,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(p.onReset){var i=p.onReset(S.values,X);Nr(i)?i.then(o):o()}else o()}),[p.initialErrors,p.initialStatus,p.initialTouched]);e.useEffect((function(){!0!==b.current||C(y.current,p.initialValues)||(s&&(y.current=p.initialValues,F()),u&&x(y.current))}),[s,p.initialValues,F,u,x]),e.useEffect((function(){s&&!0===b.current&&!C(v.current,p.initialErrors)&&(v.current=p.initialErrors||Lr,_({type:"SET_ERRORS",payload:p.initialErrors||Lr}))}),[s,p.initialErrors]),e.useEffect((function(){s&&!0===b.current&&!C(m.current,p.initialTouched)&&(m.current=p.initialTouched||Ur,_({type:"SET_TOUCHED",payload:p.initialTouched||Ur}))}),[s,p.initialTouched]),e.useEffect((function(){s&&!0===b.current&&!C(h.current,p.initialStatus)&&(h.current=p.initialStatus,_({type:"SET_STATUS",payload:p.initialStatus}))}),[s,p.initialStatus,p.initialTouched]);var k=Kr((function(e){if(g.current[e]&&xr(g.current[e].validate)){var t=Pr(S.values,e),r=g.current[e].validate(t);return Nr(r)?(_({type:"SET_ISVALIDATING",payload:!0}),r.then((function(e){return e})).then((function(t){_({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),_({type:"SET_ISVALIDATING",payload:!1})}))):(_({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),Promise.resolve(r))}return p.validationSchema?(_({type:"SET_ISVALIDATING",payload:!0}),O(S.values,e).then((function(e){return e})).then((function(t){_({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),_({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),I=e.useCallback((function(e,t){var r=t.validate;g.current[e]={validate:r}}),[]),N=e.useCallback((function(e){delete g.current[e]}),[]),P=Kr((function(e,t){return _({type:"SET_TOUCHED",payload:e}),(void 0===t?o:t)?x(S.values):Promise.resolve()})),M=e.useCallback((function(e){_({type:"SET_ERRORS",payload:e})}),[]),$=Kr((function(e,t){var r=xr(e)?e(S.values):e;return _({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?x(r):Promise.resolve()})),D=e.useCallback((function(e,t){_({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),V=Kr((function(e,t,r){return _({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?x(Mr(S.values,e,t)):Promise.resolve()})),L=e.useCallback((function(e,t){var r,n=t,a=e;if(!kr(e)){e.persist&&e.persist();var o=e.target?e.target:e.currentTarget,i=o.type,u=o.name,c=o.id,l=o.value,s=o.checked,f=o.outerHTML,d=o.options,p=o.multiple;(n=t||(u||c))||"production"===process.env.NODE_ENV||Wr({htmlContent:f,documentationAnchorLink:"handlechange-e-reactchangeeventany--void",handlerName:"handleChange"}),a=/number|range/.test(i)?(r=parseFloat(l),isNaN(r)?"":r):/checkbox/.test(i)?function(e,t,r){if("boolean"==typeof e)return Boolean(t);var n=[],a=!1,o=-1;if(Array.isArray(e))n=e,a=(o=e.indexOf(r))>=0;else if(!r||"true"==r||"false"==r)return Boolean(t);if(t&&r&&!a)return n.concat(r);if(!a)return n;return n.slice(0,o).concat(n.slice(o+1))}(Pr(S.values,n),s,l):d&&p?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(d):l}n&&V(n,a)}),[V,S.values]),U=Kr((function(e){if(kr(e))return function(t){return L(t,e)};L(e)})),z=Kr((function(e,t,r){return void 0===t&&(t=!0),_({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===r?o:r)?x(S.values):Promise.resolve()})),B=e.useCallback((function(e,t){e.persist&&e.persist();var r=e.target,n=r.name,a=r.id,o=r.outerHTML,i=t||(n||a);i||"production"===process.env.NODE_ENV||Wr({htmlContent:o,documentationAnchorLink:"handleblur-e-any--void",handlerName:"handleBlur"}),z(i,!0)}),[z]),W=Kr((function(e){if(kr(e))return function(t){return B(t,e)};B(e)})),H=e.useCallback((function(e){xr(e)?_({type:"SET_FORMIK_STATE",payload:e}):_({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),G=e.useCallback((function(e){_({type:"SET_STATUS",payload:e})}),[]),q=e.useCallback((function(e){_({type:"SET_ISSUBMITTING",payload:e})}),[]),K=Kr((function(){return _({type:"SUBMIT_ATTEMPT"}),x().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var r;try{if(void 0===(r=J()))return}catch(e){throw e}return Promise.resolve(r).then((function(e){return b.current&&_({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(b.current)throw _({type:"SUBMIT_FAILURE"}),e}))}if(b.current&&(_({type:"SUBMIT_FAILURE"}),t))throw e}))})),Y=Kr((function(e){if(e&&e.preventDefault&&xr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&xr(e.stopPropagation)&&e.stopPropagation(),"production"!==process.env.NODE_ENV&&"undefined"!=typeof document){var t=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}();null!==t&&t instanceof HTMLButtonElement&&(t.attributes&&t.attributes.getNamedItem("type")||("production"!==process.env.NODE_ENV?vr(!1,'You submitted a Formik form using a button with an unspecified `type` attribute. Most browsers default button elements to `type="submit"`. If this is not a submit button, please add `type="button"`.'):vr(!1)))}K().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),X={resetForm:F,validateForm:x,validateField:k,setErrors:M,setFieldError:D,setFieldTouched:z,setFieldValue:V,setStatus:G,setSubmitting:q,setTouched:P,setValues:$,setFormikState:H,submitForm:K},J=Kr((function(){return f(S.values,X)})),Q=Kr((function(e){e&&e.preventDefault&&xr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&xr(e.stopPropagation)&&e.stopPropagation(),F()})),Z=e.useCallback((function(e){return{value:Pr(S.values,e),error:Pr(S.errors,e),touched:!!Pr(S.touched,e),initialValue:Pr(y.current,e),initialTouched:!!Pr(m.current,e),initialError:Pr(v.current,e)}}),[S.errors,S.touched,S.values]),ee=e.useCallback((function(e){return{setValue:function(t,r){return V(e,t,r)},setTouched:function(t,r){return z(e,t,r)},setError:function(t){return D(e,t)}}}),[V,z,D]),te=e.useCallback((function(e){var t=Fr(e),r=t?e.name:e,n=Pr(S.values,r),a={name:r,value:n,onChange:U,onBlur:W};if(t){var o=e.type,i=e.value,u=e.as,c=e.multiple;"checkbox"===o?void 0===i?a.checked=!!n:(a.checked=!(!Array.isArray(n)||!~n.indexOf(i)),a.value=i):"radio"===o?(a.checked=n===i,a.value=i):"select"===u&&c&&(a.value=a.value||[],a.multiple=!0)}return a}),[W,U,S.values]),re=e.useMemo((function(){return!C(y.current,S.values)}),[y.current,S.values]),ne=e.useMemo((function(){return void 0!==c?re?S.errors&&0===Object.keys(S.errors).length:!1!==c&&xr(c)?c(p):c:S.errors&&0===Object.keys(S.errors).length}),[c,re,S.errors,p]);return Or({},S,{initialValues:y.current,initialErrors:v.current,initialTouched:m.current,initialStatus:h.current,handleBlur:W,handleChange:U,handleReset:Q,handleSubmit:Y,resetForm:F,setErrors:M,setFormikState:H,setFieldTouched:z,setFieldValue:V,setFieldError:D,setStatus:G,setSubmitting:q,setTouched:P,setValues:$,submitForm:K,validateForm:x,validateField:k,isValid:ne,dirty:re,unregisterField:N,registerField:I,getFieldProps:te,getFieldMeta:Z,getFieldHelpers:ee,validateOnBlur:o,validateOnChange:n,validateOnMount:u})}function Br(t){var r=zr(t),n=t.component,a=t.children,o=t.render,i=t.innerRef;return e.useImperativeHandle(i,(function(){return r})),"production"!==process.env.NODE_ENV&&e.useEffect((function(){t.render&&("production"!==process.env.NODE_ENV?vr(!1,"<Formik render> has been deprecated and will be removed in future versions of Formik. Please use a child callback function instead. To get rid of this warning, replace <Formik render={(props) => ...} /> with <Formik>{(props) => ...}</Formik>"):vr(!1))}),[]),e.createElement(Dr,{value:r},n?e.createElement(n,r):o?o(r):a?xr(a)?a(r):Ir(a)?null:e.Children.only(a):null)}function Wr(e){var t=e.htmlContent,r=e.documentationAnchorLink,n=e.handlerName;console.warn("Warning: Formik called `"+n+"`, but you forgot to pass an `id` or `name` attribute to your input:\n "+t+"\n Formik cannot determine which value to update. For more info see https://formik.org/docs/api/formik#"+r+"\n ")}function Hr(e){var t=Array.isArray(e)?[]:{};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=String(r);!0===Array.isArray(e[n])?t[n]=e[n].map((function(e){return!0===Array.isArray(e)||re(e)?Hr(e):""!==e?e:void 0})):re(e[n])?t[n]=Hr(e[n]):t[n]=""!==e[n]?e[n]:void 0}return t}function Gr(e,t,r){var n=e.slice();return t.forEach((function(t,a){if(void 0===n[a]){var o=!1!==r.clone&&r.isMergeableObject(t);n[a]=o?R(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?n[a]=R(e[a],t,r):-1===e.indexOf(t)&&n.push(t)})),n}var qr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function Kr(t){var r=e.useRef(t);return qr((function(){r.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.current.apply(void 0,t)}),[])}e.forwardRef((function(t,r){var n,a=t.action,o=wr(t,["action"]),i=null!=a?a:"#",u=((n=e.useContext($r))||("production"!==process.env.NODE_ENV?vr(!1,"Formik context is undefined, please verify you are calling useFormikContext() as child of a <Formik> component."):vr(!1)),n),c=u.handleReset,l=u.handleSubmit;return e.createElement("form",Object.assign({onSubmit:l,ref:r,onReset:c,action:i},o))})).displayName="Form";var Yr=function(e,t,r){var n=Xr(e);return n.splice(t,0,r),n},Xr=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from(Or({},e,{length:t+1}))}return[]},Jr=function(t){var r,n;function a(e){var r;return(r=t.call(this,e)||this).updateArrayField=function(e,t,n){var a=r.props,o=a.name;(0,a.formik.setFormikState)((function(r){var a="function"==typeof n?n:e,i="function"==typeof t?t:e,u=Mr(r.values,o,e(Pr(r.values,o))),c=n?a(Pr(r.errors,o)):void 0,l=t?i(Pr(r.touched,o)):void 0;return Tr(c)&&(c=void 0),Tr(l)&&(l=void 0),Or({},r,{values:u,errors:n?Mr(r.errors,o,c):r.errors,touched:t?Mr(r.touched,o,l):r.touched})}))},r.push=function(e){return r.updateArrayField((function(t){return[].concat(Xr(t),[jr(e)])}),!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=Xr(e),a=n[t];return n[t]=n[r],n[r]=a,n}(r,e,t)}),!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=Xr(e),a=n[t];return n.splice(t,1),n.splice(r,0,a),n}(r,e,t)}),!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField((function(r){return Yr(r,e,t)}),(function(t){return Yr(t,e,null)}),(function(t){return Yr(t,e,null)}))},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=Xr(e);return n[t]=r,n}(r,e,t)}),!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField((function(r){var n=r?[e].concat(r):[e];return t<0&&(t=n.length),n}),(function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r}),(function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r})),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(Ar(r)),r.pop=r.pop.bind(Ar(r)),r}n=t,(r=a).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n;var o=a.prototype;return o.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!C(Pr(e.formik.values,e.name),Pr(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},o.remove=function(e){var t;return this.updateArrayField((function(r){var n=r?Xr(r):[];return t||(t=n[e]),xr(n.splice)&&n.splice(e,1),n}),!0,!0),t},o.pop=function(){var e;return this.updateArrayField((function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r}),!0,!0),e},o.render=function(){var t={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},r=this.props,n=r.component,a=r.render,o=r.children,i=r.name,u=Or({},t,{form:wr(r.formik,["validate","validationSchema"]),name:i});return n?e.createElement(n,u):a?a(u):o?"function"==typeof o?o(u):Ir(o)?null:e.Children.only(o):null},a}(e.Component);Jr.defaultProps={validateOnChange:!0};const Qr=e=>t=>{var r,n;const a={};for(const[o,i]of Object.entries(e)){if("password"===i.type&&(null===(r=i.confirmPassword)||void 0===r?void 0:r.addField)&&t[o]!==t.confirmPassword&&(a.confirmPassword=i.confirmPassword.errorMessage),!i.validation)continue;if((null===(n=i.validation.required)||void 0===n?void 0:n.value)&&!t[o]){a[o]=i.validation.required.message;continue}if("checkbox"===e[o].type)continue;const u=t[o],{pattern:c,minLength:l}=i.validation;!c||c.value.test(u)?l&&u.length<l.value&&(a[o]=l.message):a[o]=c.message}return a};var Zr=Object.freeze({__proto__:null});exports.Avatar=e=>"avatarUrl"in e?a.default.createElement(f,Object.assign({},e)):a.default.createElement(s,Object.assign({},e)),exports.Form=({formSchema:e,onSubmit:t,buttonLabel:n})=>{const o=Object.entries(e).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t[0]]:t[1].initialValue})),{});return a.default.createElement(Br,{initialValues:o,onSubmit:e=>{const r=e,n="confirmPassword";r[n];const a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}(r,[n+""]);t(a)},validate:Qr(e)},(({handleSubmit:t,values:o,handleChange:i,touched:u,errors:c})=>a.default.createElement("form",{noValidate:!0,onSubmit:t,className:"uag uag-form"},a.default.createElement(r.Stack,{className:"uag uag-form-stack",spacing:1},Object.entries(e).map((([e,t])=>{var n,l,s,f,d;const p={fullWidth:!0,id:e,name:e,label:`${t.label}${(null===(l=null===(n=t.validation)||void 0===n?void 0:n.required)||void 0===l?void 0:l.value)?"*":""}`,type:t.type,value:o[e],onChange:i,error:u[e]&&Boolean(c[e]),helperText:u[e]&&c[e]};return"password"===t.type?a.default.createElement(r.Stack,{className:"uag uag-pwd-container",key:e,spacing:1},a.default.createElement(r.TextField,Object.assign({},p,{className:"uag uag-form-text uag-form-text-password"})),(null===(s=t.confirmPassword)||void 0===s?void 0:s.addField)?a.default.createElement(r.TextField,{name:"confirmPassword",label:`${t.confirmPassword.label}${(null===(d=null===(f=t.validation)||void 0===f?void 0:f.required)||void 0===d?void 0:d.value)?"*":""}`,onChange:i,value:o.confirmPassword,error:u.confirmPassword&&Boolean(c.confirmPassword),helperText:u.confirmPassword&&c.confirmPassword,fullWidth:!0,type:"password",className:"uag uag-form-text uag-form-text-password uag-form-text-password-confirmation"}):null):"checkbox"===t.type?a.default.createElement(r.FormControl,{key:e,fullWidth:!0,error:p.error,className:"uag uag-form-checkbox uag-form-checkbox-control"},a.default.createElement(r.FormControlLabel,{control:a.default.createElement(r.Checkbox,{name:e,value:o[e],onChange:i,defaultChecked:t.initialValue,className:"uag uag-form-checkbox"}),label:t.label}),p.helperText&&a.default.createElement(r.FormHelperText,{className:"uag uag-form-helper-txt uag-form-checkbox-helper-txt"},p.helperText)):"list"===t.type?a.default.createElement(r.FormControl,{error:p.error,fullWidth:!0,key:e},a.default.createElement(r.InputLabel,{id:"uag-form-list-label"},t.label),a.default.createElement(r.Select,{labelId:"uag-form-list-label",name:e,onChange:i,value:o[e],label:t.label},t.options.map((({value:e,label:t})=>a.default.createElement(r.MenuItem,{key:e,value:e},t)))),p.helperText&&a.default.createElement(r.FormHelperText,{className:"uag uag-form-helper-txt uag-form-list-helper-txt"},p.helperText)):a.default.createElement(r.TextField,Object.assign({key:e},p,{className:"uag uag-form-text"}))})),a.default.createElement("div",{className:"uag uag-form-btn-container"},a.default.createElement("button",{className:"uag uag-form-btn",type:"submit"},n))))))},exports.FormTypes=Zr,exports.ItemSelector=({urlList:t,initialIndex:r,onChange:n})=>{const[o,i]=e.useState(r&&r<t.length?r:0),u=0===o,c=o===t.length-1,l=e=>r=>{r.preventDefault();const a="decrement"===e?Math.max(o-1,0):Math.min(o+1,t.length-1);i(a),n(t[a])};return a.default.createElement(S,{className:"uag-item-selector-container"},a.default.createElement(_,{disabled:u,className:"uag-item-selector-control uag-item-selector-control-left",onClick:l("decrement")},!u&&a.default.createElement(g,{className:"uag-item-selector-arrow uag-item-selector-arrow-left",size:"75%"})),a.default.createElement(j,{className:"uag-item-selector-item-container"},a.default.createElement(O,{className:"uag-item-selector-item-img",src:t[o]})),a.default.createElement(_,{disabled:c,className:"uag-item-selector-control uag-item-selector-control-right",onClick:l("increment")},!c&&a.default.createElement(E,{className:"uag-item-selector-arrow uag-item-selector-arrow-right",size:"75%"})))}; | ||
//# sourceMappingURL=index.js.map |
@@ -16,1 +16,2 @@ /// <reference types="react" /> | ||
export default Avatar; | ||
//# sourceMappingURL=Avatar.d.ts.map |
@@ -22,1 +22,2 @@ /// <reference types="react" /> | ||
})) => JSX.Element>; | ||
//# sourceMappingURL=Avatar.stories.d.ts.map |
@@ -17,1 +17,2 @@ /// <reference types="react" /> | ||
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>; | ||
//# sourceMappingURL=Avatar.style.d.ts.map |
export declare const computeAvatarUrlFromIndexes: (endpoint: string, partLetter: string, partIndex: number, colorIndex?: number) => string; | ||
//# sourceMappingURL=helpers.d.ts.map |
export { default } from "./Avatar"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -16,1 +16,2 @@ /// <reference types="react" /> | ||
export default AvatarEditor; | ||
//# sourceMappingURL=AvatarEditor.d.ts.map |
@@ -26,1 +26,2 @@ /// <reference types="react" /> | ||
}) => JSX.Element>; | ||
//# sourceMappingURL=AvatarEditor.stories.d.ts.map |
@@ -28,1 +28,2 @@ /// <reference types="react" /> | ||
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>; | ||
//# sourceMappingURL=AvatarEditor.style.d.ts.map |
@@ -8,1 +8,2 @@ export declare const getIndexesFromUrl: (url: string) => { | ||
export declare const buildColouredPartsUrlList: (endpoint: string, partCode: "h" | "e" | "m", availableShapeIndex: number[], availableColourIndex: number[]) => string[]; | ||
//# sourceMappingURL=helpers.d.ts.map |
export declare const CONFIRM_PWD_KEY = "confirmPassword"; | ||
//# sourceMappingURL=consts.d.ts.map |
@@ -9,3 +9,4 @@ /// <reference types="react" /> | ||
}; | ||
declare const SignupForm: <T extends FormSchema>({ formSchema, onSubmit, buttonLabel }: Props<T>) => JSX.Element; | ||
export default SignupForm; | ||
declare const Form: <T extends FormSchema>({ formSchema, onSubmit, buttonLabel }: Props<T>) => JSX.Element; | ||
export default Form; | ||
//# sourceMappingURL=Form.d.ts.map |
@@ -19,1 +19,2 @@ /// <reference types="react" /> | ||
}) => JSX.Element)>; | ||
//# sourceMappingURL=Form.stories.d.ts.map |
@@ -5,1 +5,2 @@ import { FormOutput, FormSchema } from "./types"; | ||
}; | ||
//# sourceMappingURL=helpers.d.ts.map |
export {}; | ||
//# sourceMappingURL=helpers.test.d.ts.map |
export { default } from "./Form"; | ||
export * as FormTypes from "./Form"; | ||
export * as FormTypes from "./types"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -65,1 +65,2 @@ /// <reference types="react" /> | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -5,1 +5,2 @@ export { default as Avatar } from "./Avatar"; | ||
export { FormTypes } from "./Form"; | ||
//# sourceMappingURL=index.d.ts.map |
export { default } from "./ItemSelector"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -9,1 +9,2 @@ /// <reference types="react" /> | ||
export default ItemSelector; | ||
//# sourceMappingURL=ItemSelector.d.ts.map |
@@ -14,1 +14,2 @@ /// <reference types="react" /> | ||
}) => JSX.Element>; | ||
//# sourceMappingURL=ItemSelector.stories.d.ts.map |
@@ -18,1 +18,2 @@ /// <reference types="react" /> | ||
}, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>; | ||
//# sourceMappingURL=ItemSelector.style.d.ts.map |
export * from "./components"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -11,1 +11,2 @@ export declare type MappedAvatar = { | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
export declare const removeTrailingSlash: (str: string) => string; | ||
//# sourceMappingURL=utils.d.ts.map |
export {}; | ||
//# sourceMappingURL=utils.test.d.ts.map |
@@ -60,3 +60,3 @@ import e,{useState as t,createContext as r,forwardRef as n,createElement as o,useContext as a,useImperativeHandle as i,useEffect as u,Children as c,useRef as l,useReducer as s,useCallback as f,useMemo as p,Component as d,useLayoutEffect as y}from"react";import v from"@emotion/styled";import{Stack as m,TextField as h,FormControl as b,FormControlLabel as g,Checkbox as E,FormHelperText as S,InputLabel as _,Select as j,MenuItem as O}from"@mui/material";const w=v.img` | ||
* LICENSE file in the root directory of this source tree. | ||
*/!function(e){"production"===process.env.NODE_ENV?e.exports=function(){if(Rr)return Vr;Rr=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:switch(e=e.type){case c:case l:case n:case a:case o:case f:return e;default:switch(e=e&&e.$$typeof){case u:case s:case y:case d:case i:return e;default:return p}}case r:return p}}}function E(e){return g(e)===l}return Vr.AsyncMode=c,Vr.ConcurrentMode=l,Vr.ContextConsumer=u,Vr.ContextProvider=i,Vr.Element=t,Vr.ForwardRef=s,Vr.Fragment=n,Vr.Lazy=y,Vr.Memo=d,Vr.Portal=r,Vr.Profiler=a,Vr.StrictMode=o,Vr.Suspense=f,Vr.isAsyncMode=function(e){return E(e)||g(e)===c},Vr.isConcurrentMode=E,Vr.isContextConsumer=function(e){return g(e)===u},Vr.isContextProvider=function(e){return g(e)===i},Vr.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Vr.isForwardRef=function(e){return g(e)===s},Vr.isFragment=function(e){return g(e)===n},Vr.isLazy=function(e){return g(e)===y},Vr.isMemo=function(e){return g(e)===d},Vr.isPortal=function(e){return g(e)===r},Vr.isProfiler=function(e){return g(e)===a},Vr.isStrictMode=function(e){return g(e)===o},Vr.isSuspense=function(e){return g(e)===f},Vr.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===a||e===o||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===d||e.$$typeof===i||e.$$typeof===u||e.$$typeof===s||e.$$typeof===m||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v)},Vr.typeOf=g,Vr}():e.exports=(Ur||(Ur=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:var v=e.type;switch(v){case c:case l:case n:case a:case o:case f:return v;default:var m=v&&v.$$typeof;switch(m){case u:case s:case y:case d:case i:return m;default:return p}}case r:return p}}}var E=c,S=l,_=u,j=i,O=t,w=s,A=n,T=y,x=d,F=r,N=a,I=o,P=f,k=!1;function M(e){return g(e)===l}Lr.AsyncMode=E,Lr.ConcurrentMode=S,Lr.ContextConsumer=_,Lr.ContextProvider=j,Lr.Element=O,Lr.ForwardRef=w,Lr.Fragment=A,Lr.Lazy=T,Lr.Memo=x,Lr.Portal=F,Lr.Profiler=N,Lr.StrictMode=I,Lr.Suspense=P,Lr.isAsyncMode=function(e){return k||(k=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),M(e)||g(e)===c},Lr.isConcurrentMode=M,Lr.isContextConsumer=function(e){return g(e)===u},Lr.isContextProvider=function(e){return g(e)===i},Lr.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Lr.isForwardRef=function(e){return g(e)===s},Lr.isFragment=function(e){return g(e)===n},Lr.isLazy=function(e){return g(e)===y},Lr.isMemo=function(e){return g(e)===d},Lr.isPortal=function(e){return g(e)===r},Lr.isProfiler=function(e){return g(e)===a},Lr.isStrictMode=function(e){return g(e)===o},Lr.isSuspense=function(e){return g(e)===f},Lr.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===a||e===o||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===d||e.$$typeof===i||e.$$typeof===u||e.$$typeof===s||e.$$typeof===m||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v)},Lr.typeOf=g}()),Lr)}(Dr);var zr=Dr.exports,Br={};Br[zr.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Br[zr.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};function Wr(e){return gr(e,5)}function Gr(){return Gr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gr.apply(this,arguments)}function Hr(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function qr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Kr=function(e){return Array.isArray(e)&&0===e.length},Yr=function(e){return"function"==typeof e},Xr=function(e){return null!==e&&"object"==typeof e},Jr=function(e){return String(Math.floor(Number(e)))===e},Qr=function(e){return"[object String]"===Object.prototype.toString.call(e)},Zr=function(e){return 0===c.count(e)},en=function(e){return Xr(e)&&Yr(e.then)};function tn(e,t,r,n){void 0===n&&(n=0);for(var o=Mr(t);e&&n<o.length;)e=e[o[n++]];return void 0===e?r:e}function rn(e,t,r){for(var n=Er(e),o=n,a=0,i=Mr(t);a<i.length-1;a++){var u=i[a],c=tn(e,i.slice(0,a+1));if(c&&(Xr(c)||Array.isArray(c)))o=o[u]=Er(c);else{var l=i[a+1];o=o[u]=Jr(l)&&Number(l)>=0?[]:{}}}return(0===a?e:o)[i[a]]===r?e:(void 0===r?delete o[i[a]]:o[i[a]]=r,0===a&&void 0===r&&delete n[i[a]],n)}function nn(e,t,r,n){void 0===r&&(r=new WeakMap),void 0===n&&(n={});for(var o=0,a=Object.keys(e);o<a.length;o++){var i=a[o],u=e[i];Xr(u)?r.get(u)||(r.set(u,!0),n[i]=Array.isArray(u)?[]:{},nn(u,t,r,n[i])):n[i]=t}return n}var on=r(void 0);on.displayName="FormikContext";var an=on.Provider;function un(e,t){switch(t.type){case"SET_VALUES":return Gr({},e,{values:t.payload});case"SET_TOUCHED":return Gr({},e,{touched:t.payload});case"SET_ERRORS":return J(e.errors,t.payload)?e:Gr({},e,{errors:t.payload});case"SET_STATUS":return Gr({},e,{status:t.payload});case"SET_ISSUBMITTING":return Gr({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Gr({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Gr({},e,{values:rn(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Gr({},e,{touched:rn(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Gr({},e,{errors:rn(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Gr({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Gr({},e,{touched:nn(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return Gr({},e,{isSubmitting:!1});default:return e}}on.Consumer;var cn={},ln={};function sn(e){var t=e.validateOnChange,r=void 0===t||t,n=e.validateOnBlur,o=void 0===n||n,a=e.validateOnMount,i=void 0!==a&&a,c=e.isInitialValid,d=e.enableReinitialize,y=void 0!==d&&d,v=e.onSubmit,m=Hr(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),h=Gr({validateOnChange:r,validateOnBlur:o,validateOnMount:i,onSubmit:v},m),b=l(h.initialValues),g=l(h.initialErrors||cn),E=l(h.initialTouched||ln),S=l(h.initialStatus),_=l(!1),j=l({});"production"!==process.env.NODE_ENV&&u((function(){void 0!==c&&("production"!==process.env.NODE_ENV?Cr(!1,"isInitialValid has been deprecated and will be removed in future versions of Formik. Please use initialErrors or validateOnMount instead."):Cr(!1))}),[]),u((function(){return _.current=!0,function(){_.current=!1}}),[]);var O=s(un,{values:h.initialValues,errors:h.initialErrors||cn,touched:h.initialTouched||ln,status:h.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),w=O[0],A=O[1],T=f((function(e,t){return new Promise((function(r,n){var o=h.validate(e,t);null==o?r(cn):en(o)?o.then((function(e){r(e||cn)}),(function(e){"production"!==process.env.NODE_ENV&&console.warn("Warning: An unhandled error was caught during validation in <Formik validate />",e),n(e)})):r(o)}))}),[h.validate]),x=f((function(e,t){var r=h.validationSchema,n=Yr(r)?r(t):r,o=t&&n.validateAt?n.validateAt(t,e):function(e,t,r,n){void 0===r&&(r=!1);void 0===n&&(n={});var o=dn(e);return t[r?"validateSync":"validate"](o,{abortEarly:!1,context:n})}(e,n);return new Promise((function(e,t){o.then((function(){e(cn)}),(function(r){"ValidationError"===r.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return rn(t,e.path,e.message);var r=e.inner,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}var i=a;tn(t,i.path)||(t=rn(t,i.path,i.message))}}return t}(r)):("production"!==process.env.NODE_ENV&&console.warn("Warning: An unhandled error was caught during validation in <Formik validationSchema />",r),t(r))}))}))}),[h.validationSchema]),F=f((function(e,t){return new Promise((function(r){return r(j.current[e].validate(t))}))}),[]),N=f((function(e){var t=Object.keys(j.current).filter((function(e){return Yr(j.current[e].validate)})),r=t.length>0?t.map((function(t){return F(t,tn(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(r).then((function(e){return e.reduce((function(e,r,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===r||r&&(e=rn(e,t[n],r)),e}),{})}))}),[F]),I=f((function(e){return Promise.all([N(e),h.validationSchema?x(e):{},h.validate?T(e):{}]).then((function(e){var t=e[0],r=e[1],n=e[2];return ne.all([t,r,n],{arrayMerge:yn})}))}),[h.validate,h.validationSchema,N,T,x]),P=mn((function(e){return void 0===e&&(e=w.values),A({type:"SET_ISVALIDATING",payload:!0}),I(e).then((function(e){return _.current&&(A({type:"SET_ISVALIDATING",payload:!1}),A({type:"SET_ERRORS",payload:e})),e}))}));u((function(){i&&!0===_.current&&J(b.current,h.initialValues)&&P(b.current)}),[i,P]);var k=f((function(e){var t=e&&e.values?e.values:b.current,r=e&&e.errors?e.errors:g.current?g.current:h.initialErrors||{},n=e&&e.touched?e.touched:E.current?E.current:h.initialTouched||{},o=e&&e.status?e.status:S.current?S.current:h.initialStatus;b.current=t,g.current=r,E.current=n,S.current=o;var a=function(){A({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:r,touched:n,status:o,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(h.onReset){var i=h.onReset(w.values,Z);en(i)?i.then(a):a()}else a()}),[h.initialErrors,h.initialStatus,h.initialTouched]);u((function(){!0!==_.current||J(b.current,h.initialValues)||(y&&(b.current=h.initialValues,k()),i&&P(b.current))}),[y,h.initialValues,k,i,P]),u((function(){y&&!0===_.current&&!J(g.current,h.initialErrors)&&(g.current=h.initialErrors||cn,A({type:"SET_ERRORS",payload:h.initialErrors||cn}))}),[y,h.initialErrors]),u((function(){y&&!0===_.current&&!J(E.current,h.initialTouched)&&(E.current=h.initialTouched||ln,A({type:"SET_TOUCHED",payload:h.initialTouched||ln}))}),[y,h.initialTouched]),u((function(){y&&!0===_.current&&!J(S.current,h.initialStatus)&&(S.current=h.initialStatus,A({type:"SET_STATUS",payload:h.initialStatus}))}),[y,h.initialStatus,h.initialTouched]);var M=mn((function(e){if(j.current[e]&&Yr(j.current[e].validate)){var t=tn(w.values,e),r=j.current[e].validate(t);return en(r)?(A({type:"SET_ISVALIDATING",payload:!0}),r.then((function(e){return e})).then((function(t){A({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),A({type:"SET_ISVALIDATING",payload:!1})}))):(A({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),Promise.resolve(r))}return h.validationSchema?(A({type:"SET_ISVALIDATING",payload:!0}),x(w.values,e).then((function(e){return e})).then((function(t){A({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),A({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),$=f((function(e,t){var r=t.validate;j.current[e]={validate:r}}),[]),C=f((function(e){delete j.current[e]}),[]),R=mn((function(e,t){return A({type:"SET_TOUCHED",payload:e}),(void 0===t?o:t)?P(w.values):Promise.resolve()})),D=f((function(e){A({type:"SET_ERRORS",payload:e})}),[]),V=mn((function(e,t){var n=Yr(e)?e(w.values):e;return A({type:"SET_VALUES",payload:n}),(void 0===t?r:t)?P(n):Promise.resolve()})),U=f((function(e,t){A({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),L=mn((function(e,t,n){return A({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===n?r:n)?P(rn(w.values,e,t)):Promise.resolve()})),z=f((function(e,t){var r,n=t,o=e;if(!Qr(e)){e.persist&&e.persist();var a=e.target?e.target:e.currentTarget,i=a.type,u=a.name,c=a.id,l=a.value,s=a.checked,f=a.outerHTML,p=a.options,d=a.multiple;(n=t||(u||c))||"production"===process.env.NODE_ENV||pn({htmlContent:f,documentationAnchorLink:"handlechange-e-reactchangeeventany--void",handlerName:"handleChange"}),o=/number|range/.test(i)?(r=parseFloat(l),isNaN(r)?"":r):/checkbox/.test(i)?function(e,t,r){if("boolean"==typeof e)return Boolean(t);var n=[],o=!1,a=-1;if(Array.isArray(e))n=e,o=(a=e.indexOf(r))>=0;else if(!r||"true"==r||"false"==r)return Boolean(t);if(t&&r&&!o)return n.concat(r);if(!o)return n;return n.slice(0,a).concat(n.slice(a+1))}(tn(w.values,n),s,l):p&&d?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(p):l}n&&L(n,o)}),[L,w.values]),B=mn((function(e){if(Qr(e))return function(t){return z(t,e)};z(e)})),W=mn((function(e,t,r){return void 0===t&&(t=!0),A({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===r?o:r)?P(w.values):Promise.resolve()})),G=f((function(e,t){e.persist&&e.persist();var r=e.target,n=r.name,o=r.id,a=r.outerHTML,i=t||(n||o);i||"production"===process.env.NODE_ENV||pn({htmlContent:a,documentationAnchorLink:"handleblur-e-any--void",handlerName:"handleBlur"}),W(i,!0)}),[W]),H=mn((function(e){if(Qr(e))return function(t){return G(t,e)};G(e)})),q=f((function(e){Yr(e)?A({type:"SET_FORMIK_STATE",payload:e}):A({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),K=f((function(e){A({type:"SET_STATUS",payload:e})}),[]),Y=f((function(e){A({type:"SET_ISSUBMITTING",payload:e})}),[]),X=mn((function(){return A({type:"SUBMIT_ATTEMPT"}),P().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var r;try{if(void 0===(r=ee()))return}catch(e){throw e}return Promise.resolve(r).then((function(e){return _.current&&A({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(_.current)throw A({type:"SUBMIT_FAILURE"}),e}))}if(_.current&&(A({type:"SUBMIT_FAILURE"}),t))throw e}))})),Q=mn((function(e){if(e&&e.preventDefault&&Yr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Yr(e.stopPropagation)&&e.stopPropagation(),"production"!==process.env.NODE_ENV&&"undefined"!=typeof document){var t=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}();null!==t&&t instanceof HTMLButtonElement&&(t.attributes&&t.attributes.getNamedItem("type")||("production"!==process.env.NODE_ENV?Cr(!1,'You submitted a Formik form using a button with an unspecified `type` attribute. Most browsers default button elements to `type="submit"`. If this is not a submit button, please add `type="button"`.'):Cr(!1)))}X().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),Z={resetForm:k,validateForm:P,validateField:M,setErrors:D,setFieldError:U,setFieldTouched:W,setFieldValue:L,setStatus:K,setSubmitting:Y,setTouched:R,setValues:V,setFormikState:q,submitForm:X},ee=mn((function(){return v(w.values,Z)})),te=mn((function(e){e&&e.preventDefault&&Yr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Yr(e.stopPropagation)&&e.stopPropagation(),k()})),re=f((function(e){return{value:tn(w.values,e),error:tn(w.errors,e),touched:!!tn(w.touched,e),initialValue:tn(b.current,e),initialTouched:!!tn(E.current,e),initialError:tn(g.current,e)}}),[w.errors,w.touched,w.values]),oe=f((function(e){return{setValue:function(t,r){return L(e,t,r)},setTouched:function(t,r){return W(e,t,r)},setError:function(t){return U(e,t)}}}),[L,W,U]),ae=f((function(e){var t=Xr(e),r=t?e.name:e,n=tn(w.values,r),o={name:r,value:n,onChange:B,onBlur:H};if(t){var a=e.type,i=e.value,u=e.as,c=e.multiple;"checkbox"===a?void 0===i?o.checked=!!n:(o.checked=!(!Array.isArray(n)||!~n.indexOf(i)),o.value=i):"radio"===a?(o.checked=n===i,o.value=i):"select"===u&&c&&(o.value=o.value||[],o.multiple=!0)}return o}),[H,B,w.values]),ie=p((function(){return!J(b.current,w.values)}),[b.current,w.values]),ue=p((function(){return void 0!==c?ie?w.errors&&0===Object.keys(w.errors).length:!1!==c&&Yr(c)?c(h):c:w.errors&&0===Object.keys(w.errors).length}),[c,ie,w.errors,h]);return Gr({},w,{initialValues:b.current,initialErrors:g.current,initialTouched:E.current,initialStatus:S.current,handleBlur:H,handleChange:B,handleReset:te,handleSubmit:Q,resetForm:k,setErrors:D,setFormikState:q,setFieldTouched:W,setFieldValue:L,setFieldError:U,setStatus:K,setSubmitting:Y,setTouched:R,setValues:V,submitForm:X,validateForm:P,validateField:M,isValid:ue,dirty:ie,unregisterField:C,registerField:$,getFieldProps:ae,getFieldMeta:re,getFieldHelpers:oe,validateOnBlur:o,validateOnChange:r,validateOnMount:i})}function fn(e){var t=sn(e),r=e.component,n=e.children,a=e.render,l=e.innerRef;return i(l,(function(){return t})),"production"!==process.env.NODE_ENV&&u((function(){e.render&&("production"!==process.env.NODE_ENV?Cr(!1,"<Formik render> has been deprecated and will be removed in future versions of Formik. Please use a child callback function instead. To get rid of this warning, replace <Formik render={(props) => ...} /> with <Formik>{(props) => ...}</Formik>"):Cr(!1))}),[]),o(an,{value:t},r?o(r,t):a?a(t):n?Yr(n)?n(t):Zr(n)?null:c.only(n):null)}function pn(e){var t=e.htmlContent,r=e.documentationAnchorLink,n=e.handlerName;console.warn("Warning: Formik called `"+n+"`, but you forgot to pass an `id` or `name` attribute to your input:\n "+t+"\n Formik cannot determine which value to update. For more info see https://formik.org/docs/api/formik#"+r+"\n ")}function dn(e){var t=Array.isArray(e)?[]:{};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=String(r);!0===Array.isArray(e[n])?t[n]=e[n].map((function(e){return!0===Array.isArray(e)||je(e)?dn(e):""!==e?e:void 0})):je(e[n])?t[n]=dn(e[n]):t[n]=""!==e[n]?e[n]:void 0}return t}function yn(e,t,r){var n=e.slice();return t.forEach((function(t,o){if(void 0===n[o]){var a=!1!==r.clone&&r.isMergeableObject(t);n[o]=a?ne(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?n[o]=ne(e[o],t,r):-1===e.indexOf(t)&&n.push(t)})),n}var vn="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?y:u;function mn(e){var t=l(e);return vn((function(){t.current=e})),f((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.current.apply(void 0,r)}),[])}n((function(e,t){var r,n=e.action,i=Hr(e,["action"]),u=null!=n?n:"#",c=((r=a(on))||("production"!==process.env.NODE_ENV?Cr(!1,"Formik context is undefined, please verify you are calling useFormikContext() as child of a <Formik> component."):Cr(!1)),r),l=c.handleReset,s=c.handleSubmit;return o("form",Object.assign({onSubmit:s,ref:t,onReset:l,action:u},i))})).displayName="Form";var hn=function(e,t,r){var n=bn(e);return n.splice(t,0,r),n},bn=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from(Gr({},e,{length:t+1}))}return[]},gn=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var o=r.props,a=o.name;(0,o.formik.setFormikState)((function(r){var o="function"==typeof n?n:e,i="function"==typeof t?t:e,u=rn(r.values,a,e(tn(r.values,a))),c=n?o(tn(r.errors,a)):void 0,l=t?i(tn(r.touched,a)):void 0;return Kr(c)&&(c=void 0),Kr(l)&&(l=void 0),Gr({},r,{values:u,errors:n?rn(r.errors,a,c):r.errors,touched:t?rn(r.touched,a,l):r.touched})}))},r.push=function(e){return r.updateArrayField((function(t){return[].concat(bn(t),[Wr(e)])}),!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=bn(e),o=n[t];return n[t]=n[r],n[r]=o,n}(r,e,t)}),!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=bn(e),o=n[t];return n.splice(t,1),n.splice(r,0,o),n}(r,e,t)}),!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField((function(r){return hn(r,e,t)}),(function(t){return hn(t,e,null)}),(function(t){return hn(t,e,null)}))},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=bn(e);return n[t]=r,n}(r,e,t)}),!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField((function(r){var n=r?[e].concat(r):[e];return t<0&&(t=n.length),n}),(function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r}),(function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r})),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(qr(r)),r.pop=r.pop.bind(qr(r)),r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!J(tn(e.formik.values,e.name),tn(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},a.remove=function(e){var t;return this.updateArrayField((function(r){var n=r?bn(r):[];return t||(t=n[e]),Yr(n.splice)&&n.splice(e,1),n}),!0,!0),t},a.pop=function(){var e;return this.updateArrayField((function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r}),!0,!0),e},a.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,r=t.component,n=t.render,a=t.children,i=t.name,u=Gr({},e,{form:Hr(t.formik,["validate","validationSchema"]),name:i});return r?o(r,u):n?n(u):a?"function"==typeof a?a(u):Zr(a)?null:c.only(a):null},n}(d);gn.defaultProps={validateOnChange:!0};const En=e=>t=>{var r,n;const o={};for(const[a,i]of Object.entries(e)){if("password"===i.type&&(null===(r=i.confirmPassword)||void 0===r?void 0:r.addField)&&t[a]!==t.confirmPassword&&(o.confirmPassword=i.confirmPassword.errorMessage),!i.validation)continue;if((null===(n=i.validation.required)||void 0===n?void 0:n.value)&&!t[a]){o[a]=i.validation.required.message;continue}if("checkbox"===e[a].type)continue;const u=t[a],{pattern:c,minLength:l}=i.validation;!c||c.value.test(u)?l&&u.length<l.value&&(o[a]=l.message):o[a]=c.message}return o},Sn=({formSchema:t,onSubmit:r,buttonLabel:n})=>{const o=Object.entries(t).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t[0]]:t[1].initialValue})),{});return e.createElement(fn,{initialValues:o,onSubmit:e=>{const t=e,n="confirmPassword";t[n];const o=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(t,[n+""]);r(o)},validate:En(t)},(({handleSubmit:r,values:o,handleChange:a,touched:i,errors:u})=>e.createElement("form",{noValidate:!0,onSubmit:r,className:"uag uag-form"},e.createElement(m,{className:"uag uag-form-stack",spacing:1},Object.entries(t).map((([t,r])=>{var n,c,l,s,f;const p={fullWidth:!0,id:t,name:t,label:`${r.label}${(null===(c=null===(n=r.validation)||void 0===n?void 0:n.required)||void 0===c?void 0:c.value)?"*":""}`,type:r.type,value:o[t],onChange:a,error:i[t]&&Boolean(u[t]),helperText:i[t]&&u[t]};return"password"===r.type?e.createElement(m,{className:"uag uag-pwd-container",key:t,spacing:1},e.createElement(h,Object.assign({},p,{className:"uag uag-form-text uag-form-text-password"})),(null===(l=r.confirmPassword)||void 0===l?void 0:l.addField)?e.createElement(h,{name:"confirmPassword",label:`${r.confirmPassword.label}${(null===(f=null===(s=r.validation)||void 0===s?void 0:s.required)||void 0===f?void 0:f.value)?"*":""}`,onChange:a,value:o.confirmPassword,error:i.confirmPassword&&Boolean(u.confirmPassword),helperText:i.confirmPassword&&u.confirmPassword,fullWidth:!0,type:"password",className:"uag uag-form-text uag-form-text-password uag-form-text-password-confirmation"}):null):"checkbox"===r.type?e.createElement(b,{key:t,fullWidth:!0,error:p.error,className:"uag uag-form-checkbox uag-form-checkbox-control"},e.createElement(g,{control:e.createElement(E,{name:t,value:o[t],onChange:a,defaultChecked:r.initialValue,className:"uag uag-form-checkbox"}),label:r.label}),p.helperText&&e.createElement(S,{className:"uag uag-form-helper-txt uag-form-checkbox-helper-txt"},p.helperText)):"list"===r.type?e.createElement(b,{error:p.error,fullWidth:!0,key:t},e.createElement(_,{id:"uag-form-list-label"},r.label),e.createElement(j,{labelId:"uag-form-list-label",name:t,onChange:a,value:o[t],label:r.label},r.options.map((({value:t,label:r})=>e.createElement(O,{key:t,value:t},r)))),p.helperText&&e.createElement(S,{className:"uag uag-form-helper-txt uag-form-list-helper-txt"},p.helperText)):e.createElement(h,Object.assign({key:t},p,{className:"uag uag-form-text"}))})),e.createElement("div",{className:"uag uag-form-btn-container"},e.createElement("button",{className:"uag uag-form-btn",type:"submit"},n))))))};var _n=Object.freeze({__proto__:null,default:Sn});export{I as Avatar,Sn as Form,_n as FormTypes,G as ItemSelector}; | ||
*/!function(e){"production"===process.env.NODE_ENV?e.exports=function(){if(Rr)return Vr;Rr=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:switch(e=e.type){case c:case l:case n:case a:case o:case f:return e;default:switch(e=e&&e.$$typeof){case u:case s:case y:case d:case i:return e;default:return p}}case r:return p}}}function E(e){return g(e)===l}return Vr.AsyncMode=c,Vr.ConcurrentMode=l,Vr.ContextConsumer=u,Vr.ContextProvider=i,Vr.Element=t,Vr.ForwardRef=s,Vr.Fragment=n,Vr.Lazy=y,Vr.Memo=d,Vr.Portal=r,Vr.Profiler=a,Vr.StrictMode=o,Vr.Suspense=f,Vr.isAsyncMode=function(e){return E(e)||g(e)===c},Vr.isConcurrentMode=E,Vr.isContextConsumer=function(e){return g(e)===u},Vr.isContextProvider=function(e){return g(e)===i},Vr.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Vr.isForwardRef=function(e){return g(e)===s},Vr.isFragment=function(e){return g(e)===n},Vr.isLazy=function(e){return g(e)===y},Vr.isMemo=function(e){return g(e)===d},Vr.isPortal=function(e){return g(e)===r},Vr.isProfiler=function(e){return g(e)===a},Vr.isStrictMode=function(e){return g(e)===o},Vr.isSuspense=function(e){return g(e)===f},Vr.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===a||e===o||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===d||e.$$typeof===i||e.$$typeof===u||e.$$typeof===s||e.$$typeof===m||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v)},Vr.typeOf=g,Vr}():e.exports=(Ur||(Ur=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:var v=e.type;switch(v){case c:case l:case n:case a:case o:case f:return v;default:var m=v&&v.$$typeof;switch(m){case u:case s:case y:case d:case i:return m;default:return p}}case r:return p}}}var E=c,S=l,_=u,j=i,O=t,w=s,A=n,T=y,x=d,F=r,N=a,I=o,P=f,k=!1;function M(e){return g(e)===l}Lr.AsyncMode=E,Lr.ConcurrentMode=S,Lr.ContextConsumer=_,Lr.ContextProvider=j,Lr.Element=O,Lr.ForwardRef=w,Lr.Fragment=A,Lr.Lazy=T,Lr.Memo=x,Lr.Portal=F,Lr.Profiler=N,Lr.StrictMode=I,Lr.Suspense=P,Lr.isAsyncMode=function(e){return k||(k=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),M(e)||g(e)===c},Lr.isConcurrentMode=M,Lr.isContextConsumer=function(e){return g(e)===u},Lr.isContextProvider=function(e){return g(e)===i},Lr.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Lr.isForwardRef=function(e){return g(e)===s},Lr.isFragment=function(e){return g(e)===n},Lr.isLazy=function(e){return g(e)===y},Lr.isMemo=function(e){return g(e)===d},Lr.isPortal=function(e){return g(e)===r},Lr.isProfiler=function(e){return g(e)===a},Lr.isStrictMode=function(e){return g(e)===o},Lr.isSuspense=function(e){return g(e)===f},Lr.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===a||e===o||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===d||e.$$typeof===i||e.$$typeof===u||e.$$typeof===s||e.$$typeof===m||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v)},Lr.typeOf=g}()),Lr)}(Dr);var zr=Dr.exports,Br={};Br[zr.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Br[zr.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};function Wr(e){return gr(e,5)}function Gr(){return Gr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gr.apply(this,arguments)}function Hr(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function qr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Kr=function(e){return Array.isArray(e)&&0===e.length},Yr=function(e){return"function"==typeof e},Xr=function(e){return null!==e&&"object"==typeof e},Jr=function(e){return String(Math.floor(Number(e)))===e},Qr=function(e){return"[object String]"===Object.prototype.toString.call(e)},Zr=function(e){return 0===c.count(e)},en=function(e){return Xr(e)&&Yr(e.then)};function tn(e,t,r,n){void 0===n&&(n=0);for(var o=Mr(t);e&&n<o.length;)e=e[o[n++]];return void 0===e?r:e}function rn(e,t,r){for(var n=Er(e),o=n,a=0,i=Mr(t);a<i.length-1;a++){var u=i[a],c=tn(e,i.slice(0,a+1));if(c&&(Xr(c)||Array.isArray(c)))o=o[u]=Er(c);else{var l=i[a+1];o=o[u]=Jr(l)&&Number(l)>=0?[]:{}}}return(0===a?e:o)[i[a]]===r?e:(void 0===r?delete o[i[a]]:o[i[a]]=r,0===a&&void 0===r&&delete n[i[a]],n)}function nn(e,t,r,n){void 0===r&&(r=new WeakMap),void 0===n&&(n={});for(var o=0,a=Object.keys(e);o<a.length;o++){var i=a[o],u=e[i];Xr(u)?r.get(u)||(r.set(u,!0),n[i]=Array.isArray(u)?[]:{},nn(u,t,r,n[i])):n[i]=t}return n}var on=r(void 0);on.displayName="FormikContext";var an=on.Provider;function un(e,t){switch(t.type){case"SET_VALUES":return Gr({},e,{values:t.payload});case"SET_TOUCHED":return Gr({},e,{touched:t.payload});case"SET_ERRORS":return J(e.errors,t.payload)?e:Gr({},e,{errors:t.payload});case"SET_STATUS":return Gr({},e,{status:t.payload});case"SET_ISSUBMITTING":return Gr({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Gr({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Gr({},e,{values:rn(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Gr({},e,{touched:rn(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Gr({},e,{errors:rn(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Gr({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Gr({},e,{touched:nn(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return Gr({},e,{isSubmitting:!1});default:return e}}on.Consumer;var cn={},ln={};function sn(e){var t=e.validateOnChange,r=void 0===t||t,n=e.validateOnBlur,o=void 0===n||n,a=e.validateOnMount,i=void 0!==a&&a,c=e.isInitialValid,d=e.enableReinitialize,y=void 0!==d&&d,v=e.onSubmit,m=Hr(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),h=Gr({validateOnChange:r,validateOnBlur:o,validateOnMount:i,onSubmit:v},m),b=l(h.initialValues),g=l(h.initialErrors||cn),E=l(h.initialTouched||ln),S=l(h.initialStatus),_=l(!1),j=l({});"production"!==process.env.NODE_ENV&&u((function(){void 0!==c&&("production"!==process.env.NODE_ENV?Cr(!1,"isInitialValid has been deprecated and will be removed in future versions of Formik. Please use initialErrors or validateOnMount instead."):Cr(!1))}),[]),u((function(){return _.current=!0,function(){_.current=!1}}),[]);var O=s(un,{values:h.initialValues,errors:h.initialErrors||cn,touched:h.initialTouched||ln,status:h.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),w=O[0],A=O[1],T=f((function(e,t){return new Promise((function(r,n){var o=h.validate(e,t);null==o?r(cn):en(o)?o.then((function(e){r(e||cn)}),(function(e){"production"!==process.env.NODE_ENV&&console.warn("Warning: An unhandled error was caught during validation in <Formik validate />",e),n(e)})):r(o)}))}),[h.validate]),x=f((function(e,t){var r=h.validationSchema,n=Yr(r)?r(t):r,o=t&&n.validateAt?n.validateAt(t,e):function(e,t,r,n){void 0===r&&(r=!1);void 0===n&&(n={});var o=dn(e);return t[r?"validateSync":"validate"](o,{abortEarly:!1,context:n})}(e,n);return new Promise((function(e,t){o.then((function(){e(cn)}),(function(r){"ValidationError"===r.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return rn(t,e.path,e.message);var r=e.inner,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(o>=r.length)break;a=r[o++]}else{if((o=r.next()).done)break;a=o.value}var i=a;tn(t,i.path)||(t=rn(t,i.path,i.message))}}return t}(r)):("production"!==process.env.NODE_ENV&&console.warn("Warning: An unhandled error was caught during validation in <Formik validationSchema />",r),t(r))}))}))}),[h.validationSchema]),F=f((function(e,t){return new Promise((function(r){return r(j.current[e].validate(t))}))}),[]),N=f((function(e){var t=Object.keys(j.current).filter((function(e){return Yr(j.current[e].validate)})),r=t.length>0?t.map((function(t){return F(t,tn(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(r).then((function(e){return e.reduce((function(e,r,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===r||r&&(e=rn(e,t[n],r)),e}),{})}))}),[F]),I=f((function(e){return Promise.all([N(e),h.validationSchema?x(e):{},h.validate?T(e):{}]).then((function(e){var t=e[0],r=e[1],n=e[2];return ne.all([t,r,n],{arrayMerge:yn})}))}),[h.validate,h.validationSchema,N,T,x]),P=mn((function(e){return void 0===e&&(e=w.values),A({type:"SET_ISVALIDATING",payload:!0}),I(e).then((function(e){return _.current&&(A({type:"SET_ISVALIDATING",payload:!1}),A({type:"SET_ERRORS",payload:e})),e}))}));u((function(){i&&!0===_.current&&J(b.current,h.initialValues)&&P(b.current)}),[i,P]);var k=f((function(e){var t=e&&e.values?e.values:b.current,r=e&&e.errors?e.errors:g.current?g.current:h.initialErrors||{},n=e&&e.touched?e.touched:E.current?E.current:h.initialTouched||{},o=e&&e.status?e.status:S.current?S.current:h.initialStatus;b.current=t,g.current=r,E.current=n,S.current=o;var a=function(){A({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:r,touched:n,status:o,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(h.onReset){var i=h.onReset(w.values,Z);en(i)?i.then(a):a()}else a()}),[h.initialErrors,h.initialStatus,h.initialTouched]);u((function(){!0!==_.current||J(b.current,h.initialValues)||(y&&(b.current=h.initialValues,k()),i&&P(b.current))}),[y,h.initialValues,k,i,P]),u((function(){y&&!0===_.current&&!J(g.current,h.initialErrors)&&(g.current=h.initialErrors||cn,A({type:"SET_ERRORS",payload:h.initialErrors||cn}))}),[y,h.initialErrors]),u((function(){y&&!0===_.current&&!J(E.current,h.initialTouched)&&(E.current=h.initialTouched||ln,A({type:"SET_TOUCHED",payload:h.initialTouched||ln}))}),[y,h.initialTouched]),u((function(){y&&!0===_.current&&!J(S.current,h.initialStatus)&&(S.current=h.initialStatus,A({type:"SET_STATUS",payload:h.initialStatus}))}),[y,h.initialStatus,h.initialTouched]);var M=mn((function(e){if(j.current[e]&&Yr(j.current[e].validate)){var t=tn(w.values,e),r=j.current[e].validate(t);return en(r)?(A({type:"SET_ISVALIDATING",payload:!0}),r.then((function(e){return e})).then((function(t){A({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),A({type:"SET_ISVALIDATING",payload:!1})}))):(A({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),Promise.resolve(r))}return h.validationSchema?(A({type:"SET_ISVALIDATING",payload:!0}),x(w.values,e).then((function(e){return e})).then((function(t){A({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),A({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),$=f((function(e,t){var r=t.validate;j.current[e]={validate:r}}),[]),C=f((function(e){delete j.current[e]}),[]),R=mn((function(e,t){return A({type:"SET_TOUCHED",payload:e}),(void 0===t?o:t)?P(w.values):Promise.resolve()})),D=f((function(e){A({type:"SET_ERRORS",payload:e})}),[]),V=mn((function(e,t){var n=Yr(e)?e(w.values):e;return A({type:"SET_VALUES",payload:n}),(void 0===t?r:t)?P(n):Promise.resolve()})),U=f((function(e,t){A({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),L=mn((function(e,t,n){return A({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===n?r:n)?P(rn(w.values,e,t)):Promise.resolve()})),z=f((function(e,t){var r,n=t,o=e;if(!Qr(e)){e.persist&&e.persist();var a=e.target?e.target:e.currentTarget,i=a.type,u=a.name,c=a.id,l=a.value,s=a.checked,f=a.outerHTML,p=a.options,d=a.multiple;(n=t||(u||c))||"production"===process.env.NODE_ENV||pn({htmlContent:f,documentationAnchorLink:"handlechange-e-reactchangeeventany--void",handlerName:"handleChange"}),o=/number|range/.test(i)?(r=parseFloat(l),isNaN(r)?"":r):/checkbox/.test(i)?function(e,t,r){if("boolean"==typeof e)return Boolean(t);var n=[],o=!1,a=-1;if(Array.isArray(e))n=e,o=(a=e.indexOf(r))>=0;else if(!r||"true"==r||"false"==r)return Boolean(t);if(t&&r&&!o)return n.concat(r);if(!o)return n;return n.slice(0,a).concat(n.slice(a+1))}(tn(w.values,n),s,l):p&&d?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(p):l}n&&L(n,o)}),[L,w.values]),B=mn((function(e){if(Qr(e))return function(t){return z(t,e)};z(e)})),W=mn((function(e,t,r){return void 0===t&&(t=!0),A({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===r?o:r)?P(w.values):Promise.resolve()})),G=f((function(e,t){e.persist&&e.persist();var r=e.target,n=r.name,o=r.id,a=r.outerHTML,i=t||(n||o);i||"production"===process.env.NODE_ENV||pn({htmlContent:a,documentationAnchorLink:"handleblur-e-any--void",handlerName:"handleBlur"}),W(i,!0)}),[W]),H=mn((function(e){if(Qr(e))return function(t){return G(t,e)};G(e)})),q=f((function(e){Yr(e)?A({type:"SET_FORMIK_STATE",payload:e}):A({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),K=f((function(e){A({type:"SET_STATUS",payload:e})}),[]),Y=f((function(e){A({type:"SET_ISSUBMITTING",payload:e})}),[]),X=mn((function(){return A({type:"SUBMIT_ATTEMPT"}),P().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var r;try{if(void 0===(r=ee()))return}catch(e){throw e}return Promise.resolve(r).then((function(e){return _.current&&A({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(_.current)throw A({type:"SUBMIT_FAILURE"}),e}))}if(_.current&&(A({type:"SUBMIT_FAILURE"}),t))throw e}))})),Q=mn((function(e){if(e&&e.preventDefault&&Yr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Yr(e.stopPropagation)&&e.stopPropagation(),"production"!==process.env.NODE_ENV&&"undefined"!=typeof document){var t=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}();null!==t&&t instanceof HTMLButtonElement&&(t.attributes&&t.attributes.getNamedItem("type")||("production"!==process.env.NODE_ENV?Cr(!1,'You submitted a Formik form using a button with an unspecified `type` attribute. Most browsers default button elements to `type="submit"`. If this is not a submit button, please add `type="button"`.'):Cr(!1)))}X().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),Z={resetForm:k,validateForm:P,validateField:M,setErrors:D,setFieldError:U,setFieldTouched:W,setFieldValue:L,setStatus:K,setSubmitting:Y,setTouched:R,setValues:V,setFormikState:q,submitForm:X},ee=mn((function(){return v(w.values,Z)})),te=mn((function(e){e&&e.preventDefault&&Yr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Yr(e.stopPropagation)&&e.stopPropagation(),k()})),re=f((function(e){return{value:tn(w.values,e),error:tn(w.errors,e),touched:!!tn(w.touched,e),initialValue:tn(b.current,e),initialTouched:!!tn(E.current,e),initialError:tn(g.current,e)}}),[w.errors,w.touched,w.values]),oe=f((function(e){return{setValue:function(t,r){return L(e,t,r)},setTouched:function(t,r){return W(e,t,r)},setError:function(t){return U(e,t)}}}),[L,W,U]),ae=f((function(e){var t=Xr(e),r=t?e.name:e,n=tn(w.values,r),o={name:r,value:n,onChange:B,onBlur:H};if(t){var a=e.type,i=e.value,u=e.as,c=e.multiple;"checkbox"===a?void 0===i?o.checked=!!n:(o.checked=!(!Array.isArray(n)||!~n.indexOf(i)),o.value=i):"radio"===a?(o.checked=n===i,o.value=i):"select"===u&&c&&(o.value=o.value||[],o.multiple=!0)}return o}),[H,B,w.values]),ie=p((function(){return!J(b.current,w.values)}),[b.current,w.values]),ue=p((function(){return void 0!==c?ie?w.errors&&0===Object.keys(w.errors).length:!1!==c&&Yr(c)?c(h):c:w.errors&&0===Object.keys(w.errors).length}),[c,ie,w.errors,h]);return Gr({},w,{initialValues:b.current,initialErrors:g.current,initialTouched:E.current,initialStatus:S.current,handleBlur:H,handleChange:B,handleReset:te,handleSubmit:Q,resetForm:k,setErrors:D,setFormikState:q,setFieldTouched:W,setFieldValue:L,setFieldError:U,setStatus:K,setSubmitting:Y,setTouched:R,setValues:V,submitForm:X,validateForm:P,validateField:M,isValid:ue,dirty:ie,unregisterField:C,registerField:$,getFieldProps:ae,getFieldMeta:re,getFieldHelpers:oe,validateOnBlur:o,validateOnChange:r,validateOnMount:i})}function fn(e){var t=sn(e),r=e.component,n=e.children,a=e.render,l=e.innerRef;return i(l,(function(){return t})),"production"!==process.env.NODE_ENV&&u((function(){e.render&&("production"!==process.env.NODE_ENV?Cr(!1,"<Formik render> has been deprecated and will be removed in future versions of Formik. Please use a child callback function instead. To get rid of this warning, replace <Formik render={(props) => ...} /> with <Formik>{(props) => ...}</Formik>"):Cr(!1))}),[]),o(an,{value:t},r?o(r,t):a?a(t):n?Yr(n)?n(t):Zr(n)?null:c.only(n):null)}function pn(e){var t=e.htmlContent,r=e.documentationAnchorLink,n=e.handlerName;console.warn("Warning: Formik called `"+n+"`, but you forgot to pass an `id` or `name` attribute to your input:\n "+t+"\n Formik cannot determine which value to update. For more info see https://formik.org/docs/api/formik#"+r+"\n ")}function dn(e){var t=Array.isArray(e)?[]:{};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=String(r);!0===Array.isArray(e[n])?t[n]=e[n].map((function(e){return!0===Array.isArray(e)||je(e)?dn(e):""!==e?e:void 0})):je(e[n])?t[n]=dn(e[n]):t[n]=""!==e[n]?e[n]:void 0}return t}function yn(e,t,r){var n=e.slice();return t.forEach((function(t,o){if(void 0===n[o]){var a=!1!==r.clone&&r.isMergeableObject(t);n[o]=a?ne(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?n[o]=ne(e[o],t,r):-1===e.indexOf(t)&&n.push(t)})),n}var vn="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?y:u;function mn(e){var t=l(e);return vn((function(){t.current=e})),f((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.current.apply(void 0,r)}),[])}n((function(e,t){var r,n=e.action,i=Hr(e,["action"]),u=null!=n?n:"#",c=((r=a(on))||("production"!==process.env.NODE_ENV?Cr(!1,"Formik context is undefined, please verify you are calling useFormikContext() as child of a <Formik> component."):Cr(!1)),r),l=c.handleReset,s=c.handleSubmit;return o("form",Object.assign({onSubmit:s,ref:t,onReset:l,action:u},i))})).displayName="Form";var hn=function(e,t,r){var n=bn(e);return n.splice(t,0,r),n},bn=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from(Gr({},e,{length:t+1}))}return[]},gn=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var o=r.props,a=o.name;(0,o.formik.setFormikState)((function(r){var o="function"==typeof n?n:e,i="function"==typeof t?t:e,u=rn(r.values,a,e(tn(r.values,a))),c=n?o(tn(r.errors,a)):void 0,l=t?i(tn(r.touched,a)):void 0;return Kr(c)&&(c=void 0),Kr(l)&&(l=void 0),Gr({},r,{values:u,errors:n?rn(r.errors,a,c):r.errors,touched:t?rn(r.touched,a,l):r.touched})}))},r.push=function(e){return r.updateArrayField((function(t){return[].concat(bn(t),[Wr(e)])}),!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=bn(e),o=n[t];return n[t]=n[r],n[r]=o,n}(r,e,t)}),!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=bn(e),o=n[t];return n.splice(t,1),n.splice(r,0,o),n}(r,e,t)}),!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField((function(r){return hn(r,e,t)}),(function(t){return hn(t,e,null)}),(function(t){return hn(t,e,null)}))},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField((function(r){return function(e,t,r){var n=bn(e);return n[t]=r,n}(r,e,t)}),!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField((function(r){var n=r?[e].concat(r):[e];return t<0&&(t=n.length),n}),(function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r}),(function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r})),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(qr(r)),r.pop=r.pop.bind(qr(r)),r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!J(tn(e.formik.values,e.name),tn(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},a.remove=function(e){var t;return this.updateArrayField((function(r){var n=r?bn(r):[];return t||(t=n[e]),Yr(n.splice)&&n.splice(e,1),n}),!0,!0),t},a.pop=function(){var e;return this.updateArrayField((function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r}),!0,!0),e},a.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,r=t.component,n=t.render,a=t.children,i=t.name,u=Gr({},e,{form:Hr(t.formik,["validate","validationSchema"]),name:i});return r?o(r,u):n?n(u):a?"function"==typeof a?a(u):Zr(a)?null:c.only(a):null},n}(d);gn.defaultProps={validateOnChange:!0};const En=e=>t=>{var r,n;const o={};for(const[a,i]of Object.entries(e)){if("password"===i.type&&(null===(r=i.confirmPassword)||void 0===r?void 0:r.addField)&&t[a]!==t.confirmPassword&&(o.confirmPassword=i.confirmPassword.errorMessage),!i.validation)continue;if((null===(n=i.validation.required)||void 0===n?void 0:n.value)&&!t[a]){o[a]=i.validation.required.message;continue}if("checkbox"===e[a].type)continue;const u=t[a],{pattern:c,minLength:l}=i.validation;!c||c.value.test(u)?l&&u.length<l.value&&(o[a]=l.message):o[a]=c.message}return o},Sn=({formSchema:t,onSubmit:r,buttonLabel:n})=>{const o=Object.entries(t).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t[0]]:t[1].initialValue})),{});return e.createElement(fn,{initialValues:o,onSubmit:e=>{const t=e,n="confirmPassword";t[n];const o=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(t,[n+""]);r(o)},validate:En(t)},(({handleSubmit:r,values:o,handleChange:a,touched:i,errors:u})=>e.createElement("form",{noValidate:!0,onSubmit:r,className:"uag uag-form"},e.createElement(m,{className:"uag uag-form-stack",spacing:1},Object.entries(t).map((([t,r])=>{var n,c,l,s,f;const p={fullWidth:!0,id:t,name:t,label:`${r.label}${(null===(c=null===(n=r.validation)||void 0===n?void 0:n.required)||void 0===c?void 0:c.value)?"*":""}`,type:r.type,value:o[t],onChange:a,error:i[t]&&Boolean(u[t]),helperText:i[t]&&u[t]};return"password"===r.type?e.createElement(m,{className:"uag uag-pwd-container",key:t,spacing:1},e.createElement(h,Object.assign({},p,{className:"uag uag-form-text uag-form-text-password"})),(null===(l=r.confirmPassword)||void 0===l?void 0:l.addField)?e.createElement(h,{name:"confirmPassword",label:`${r.confirmPassword.label}${(null===(f=null===(s=r.validation)||void 0===s?void 0:s.required)||void 0===f?void 0:f.value)?"*":""}`,onChange:a,value:o.confirmPassword,error:i.confirmPassword&&Boolean(u.confirmPassword),helperText:i.confirmPassword&&u.confirmPassword,fullWidth:!0,type:"password",className:"uag uag-form-text uag-form-text-password uag-form-text-password-confirmation"}):null):"checkbox"===r.type?e.createElement(b,{key:t,fullWidth:!0,error:p.error,className:"uag uag-form-checkbox uag-form-checkbox-control"},e.createElement(g,{control:e.createElement(E,{name:t,value:o[t],onChange:a,defaultChecked:r.initialValue,className:"uag uag-form-checkbox"}),label:r.label}),p.helperText&&e.createElement(S,{className:"uag uag-form-helper-txt uag-form-checkbox-helper-txt"},p.helperText)):"list"===r.type?e.createElement(b,{error:p.error,fullWidth:!0,key:t},e.createElement(_,{id:"uag-form-list-label"},r.label),e.createElement(j,{labelId:"uag-form-list-label",name:t,onChange:a,value:o[t],label:r.label},r.options.map((({value:t,label:r})=>e.createElement(O,{key:t,value:t},r)))),p.helperText&&e.createElement(S,{className:"uag uag-form-helper-txt uag-form-list-helper-txt"},p.helperText)):e.createElement(h,Object.assign({key:t},p,{className:"uag uag-form-text"}))})),e.createElement("div",{className:"uag uag-form-btn-container"},e.createElement("button",{className:"uag uag-form-btn",type:"submit"},n))))))};var _n=Object.freeze({__proto__:null});export{I as Avatar,Sn as Form,_n as FormTypes,G as ItemSelector}; | ||
//# sourceMappingURL=index.js.map |
@@ -16,1 +16,2 @@ /// <reference types="react" /> | ||
export default Avatar; | ||
//# sourceMappingURL=Avatar.d.ts.map |
@@ -22,1 +22,2 @@ /// <reference types="react" /> | ||
})) => JSX.Element>; | ||
//# sourceMappingURL=Avatar.stories.d.ts.map |
@@ -17,1 +17,2 @@ /// <reference types="react" /> | ||
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>; | ||
//# sourceMappingURL=Avatar.style.d.ts.map |
export declare const computeAvatarUrlFromIndexes: (endpoint: string, partLetter: string, partIndex: number, colorIndex?: number) => string; | ||
//# sourceMappingURL=helpers.d.ts.map |
export { default } from "./Avatar"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -16,1 +16,2 @@ /// <reference types="react" /> | ||
export default AvatarEditor; | ||
//# sourceMappingURL=AvatarEditor.d.ts.map |
@@ -26,1 +26,2 @@ /// <reference types="react" /> | ||
}) => JSX.Element>; | ||
//# sourceMappingURL=AvatarEditor.stories.d.ts.map |
@@ -28,1 +28,2 @@ /// <reference types="react" /> | ||
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>; | ||
//# sourceMappingURL=AvatarEditor.style.d.ts.map |
@@ -8,1 +8,2 @@ export declare const getIndexesFromUrl: (url: string) => { | ||
export declare const buildColouredPartsUrlList: (endpoint: string, partCode: "h" | "e" | "m", availableShapeIndex: number[], availableColourIndex: number[]) => string[]; | ||
//# sourceMappingURL=helpers.d.ts.map |
export declare const CONFIRM_PWD_KEY = "confirmPassword"; | ||
//# sourceMappingURL=consts.d.ts.map |
@@ -9,3 +9,4 @@ /// <reference types="react" /> | ||
}; | ||
declare const SignupForm: <T extends FormSchema>({ formSchema, onSubmit, buttonLabel }: Props<T>) => JSX.Element; | ||
export default SignupForm; | ||
declare const Form: <T extends FormSchema>({ formSchema, onSubmit, buttonLabel }: Props<T>) => JSX.Element; | ||
export default Form; | ||
//# sourceMappingURL=Form.d.ts.map |
@@ -19,1 +19,2 @@ /// <reference types="react" /> | ||
}) => JSX.Element)>; | ||
//# sourceMappingURL=Form.stories.d.ts.map |
@@ -5,1 +5,2 @@ import { FormOutput, FormSchema } from "./types"; | ||
}; | ||
//# sourceMappingURL=helpers.d.ts.map |
export {}; | ||
//# sourceMappingURL=helpers.test.d.ts.map |
export { default } from "./Form"; | ||
export * as FormTypes from "./Form"; | ||
export * as FormTypes from "./types"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -65,1 +65,2 @@ /// <reference types="react" /> | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -5,1 +5,2 @@ export { default as Avatar } from "./Avatar"; | ||
export { FormTypes } from "./Form"; | ||
//# sourceMappingURL=index.d.ts.map |
export { default } from "./ItemSelector"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -9,1 +9,2 @@ /// <reference types="react" /> | ||
export default ItemSelector; | ||
//# sourceMappingURL=ItemSelector.d.ts.map |
@@ -14,1 +14,2 @@ /// <reference types="react" /> | ||
}) => JSX.Element>; | ||
//# sourceMappingURL=ItemSelector.stories.d.ts.map |
@@ -18,1 +18,2 @@ /// <reference types="react" /> | ||
}, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>; | ||
//# sourceMappingURL=ItemSelector.style.d.ts.map |
export * from "./components"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -11,1 +11,2 @@ export declare type MappedAvatar = { | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
export declare const removeTrailingSlash: (str: string) => string; | ||
//# sourceMappingURL=utils.d.ts.map |
export {}; | ||
//# sourceMappingURL=utils.test.d.ts.map |
/// <reference types="react" /> | ||
declare type MappedAvatar = { | ||
s: number; | ||
h: number; | ||
c: number; | ||
e: number; | ||
n: number; | ||
m: number; | ||
b: number; | ||
o: number; | ||
s: number; | ||
h: number; | ||
c: number; | ||
e: number; | ||
n: number; | ||
m: number; | ||
b: number; | ||
o: number; | ||
}; | ||
declare type BaseProps = { | ||
bgColor?: string; | ||
circled?: boolean; | ||
bgColor?: string; | ||
circled?: boolean; | ||
}; | ||
declare type CustomAvatarProps = { | ||
avatar: MappedAvatar; | ||
endpoint: string; | ||
avatar: MappedAvatar; | ||
endpoint: string; | ||
} & BaseProps; | ||
declare type AvastarProps = { | ||
avatarUrl: string; | ||
avatarUrl: string; | ||
} & BaseProps; | ||
@@ -27,7 +27,8 @@ declare const Avatar: (props: AvastarProps | CustomAvatarProps) => JSX.Element; | ||
declare type Props$1 = { | ||
urlList: string[]; | ||
onChange: (url: string) => void; | ||
initialIndex?: number; | ||
urlList: string[]; | ||
onChange: (url: string) => void; | ||
initialIndex?: number; | ||
}; | ||
declare const ItemSelector: ({ urlList, initialIndex, onChange }: Props$1) => JSX.Element; | ||
//# sourceMappingURL=ItemSelector.d.ts.map | ||
@@ -37,76 +38,90 @@ declare const CONFIRM_PWD_KEY = "confirmPassword"; | ||
declare type ValidationSchema = { | ||
[key: string]: { | ||
value: unknown; | ||
message: string; | ||
}; | ||
[key: string]: { | ||
value: unknown; | ||
message: string; | ||
}; | ||
}; | ||
interface Validation extends ValidationSchema { | ||
required: { | ||
value: boolean; | ||
message: string; | ||
}; | ||
pattern: { | ||
value: RegExp; | ||
message: string; | ||
}; | ||
minLength: { | ||
value: number; | ||
message: string; | ||
}; | ||
required: { | ||
value: boolean; | ||
message: string; | ||
}; | ||
pattern: { | ||
value: RegExp; | ||
message: string; | ||
}; | ||
minLength: { | ||
value: number; | ||
message: string; | ||
}; | ||
} | ||
declare type TextFormField = { | ||
type: "text" | "email"; | ||
label: string; | ||
initialValue: string; | ||
validation?: Partial<Validation>; | ||
type: "text" | "email"; | ||
label: string; | ||
initialValue: string; | ||
validation?: Partial<Validation>; | ||
}; | ||
declare type ListFormField = { | ||
type: "list"; | ||
type: "list"; | ||
label: string; | ||
options: { | ||
value: string; | ||
label: string; | ||
options: { | ||
value: string; | ||
label: string; | ||
}[]; | ||
initialValue: string; | ||
validation?: Partial<Pick<Validation, "required">>; | ||
}[]; | ||
initialValue: string; | ||
validation?: Partial<Pick<Validation, "required">>; | ||
}; | ||
declare type PasswordFormField = { | ||
type: "password"; | ||
type: "password"; | ||
label: string; | ||
confirmPassword?: { | ||
addField: boolean; | ||
label: string; | ||
confirmPassword?: { | ||
addField: boolean; | ||
label: string; | ||
errorMessage: string; | ||
}; | ||
initialValue: string; | ||
validation?: Partial<Validation>; | ||
errorMessage: string; | ||
}; | ||
initialValue: string; | ||
validation?: Partial<Validation>; | ||
}; | ||
declare type CheckboxFormField = { | ||
type: "checkbox"; | ||
label: React.ReactNode; | ||
initialValue: boolean; | ||
validation?: Partial<Pick<Validation, "required">>; | ||
type: "checkbox"; | ||
label: React.ReactNode; | ||
initialValue: boolean; | ||
validation?: Partial<Pick<Validation, "required">>; | ||
}; | ||
declare type FormSchema = { | ||
[fieldName: string]: TextFormField | CheckboxFormField | PasswordFormField | ListFormField; | ||
[fieldName: string]: TextFormField | CheckboxFormField | PasswordFormField | ListFormField; | ||
}; | ||
declare type FormOutput<T extends FormSchema> = { | ||
[key in keyof T]: T[key] extends CheckboxFormField ? boolean : string; | ||
[key in keyof T]: T[key] extends CheckboxFormField ? boolean : string; | ||
} & { | ||
[CONFIRM_PWD_KEY]?: string; | ||
[CONFIRM_PWD_KEY]?: string; | ||
}; | ||
declare type Props<T extends FormSchema> = { | ||
formSchema: T; | ||
onSubmit: (values: Omit<FormOutput<T>, typeof CONFIRM_PWD_KEY>) => unknown; | ||
buttonLabel: string; | ||
}; | ||
declare const SignupForm: <T extends FormSchema>({ formSchema, onSubmit, buttonLabel }: Props<T>) => JSX.Element; | ||
declare namespace Form_d { | ||
type types_d_Validation = Validation; | ||
type types_d_TextFormField = TextFormField; | ||
type types_d_ListFormField = ListFormField; | ||
type types_d_PasswordFormField = PasswordFormField; | ||
type types_d_CheckboxFormField = CheckboxFormField; | ||
type types_d_FormSchema = FormSchema; | ||
type types_d_FormOutput<T extends FormSchema> = FormOutput<T>; | ||
declare namespace types_d { | ||
export { | ||
SignupForm as default, | ||
types_d_Validation as Validation, | ||
types_d_TextFormField as TextFormField, | ||
types_d_ListFormField as ListFormField, | ||
types_d_PasswordFormField as PasswordFormField, | ||
types_d_CheckboxFormField as CheckboxFormField, | ||
types_d_FormSchema as FormSchema, | ||
types_d_FormOutput as FormOutput, | ||
}; | ||
} | ||
export { Avatar, SignupForm as Form, Form_d as FormTypes, ItemSelector }; | ||
declare type Props<T extends FormSchema> = { | ||
formSchema: T; | ||
onSubmit: (values: Omit<FormOutput<T>, typeof CONFIRM_PWD_KEY>) => unknown; | ||
buttonLabel: string; | ||
}; | ||
declare const Form: <T extends FormSchema>({ formSchema, onSubmit, buttonLabel }: Props<T>) => JSX.Element; | ||
//# sourceMappingURL=Form.d.ts.map | ||
export { Avatar, Form, types_d as FormTypes, ItemSelector }; |
{ | ||
"name": "@upandgo/ui-components", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Upandgo reusable UI components", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2900065
107
1177