47995-54f8bce2d93751e5.js 13 KB

12
  1. (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[47995],{47995:function(e,n,r){"use strict";r.d(n,{Z:function(){return Y}});var a,i=r(45361),t=r(57044),l=r(16946),o=r(69976),u=r(57611),s=r(37014),c=r.n(s),d=r(97863),f=r(12253),m=function(e){var n,r,a,i,t={},l=null===(n=e.rules)||void 0===n?void 0:n.find((function(e){return e.type===f.S.Required&&!0===e.value}));l&&(t.required={message:l.errorMessage,value:!0});var o=null===(r=e.rules)||void 0===r?void 0:r.find((function(e){return e.type===f.S.MaximumLength}));o&&(t.maxLength={message:o.errorMessage,value:o.value});var u=null===(a=e.rules)||void 0===a?void 0:a.find((function(e){return e.type===f.S.MinimumLength}));u&&(t.minLength={message:u.errorMessage,value:u.value});var s=null===(i=e.rules)||void 0===i?void 0:i.filter((function(e){return e.type===f.S.Regex}));return s&&s.length>0&&(t.validate={regex:function(e){var n=s.find((function(n){return!new RegExp(n.value).test(e)}));return n?n.errorMessage:null}}),t},h=r(64243),v=r.n(h),x=r(85494),_=r(41418),p=r(56539),g=r(96151),b=r(67597),Z=r(50664),C=r(90458),j=r.n(C),w=r(22209);!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(a||(a={}));var k,E=function(e){var n=e.className,r=e.onChange,a=e.defaultValue,i=e.value,o=e.name,s=e.required,d=e.children,f=(0,w.Z)();return(0,u.jsx)(Z.fC,(0,l.Z)((0,t.Z)({className:c()(j().container,n),dir:f},r&&{onValueChange:r},a&&{defaultValue:a},i&&{value:i},o&&{name:o},s&&{required:s}),{children:d}))},S=r(41601),L=r(86240),N=r.n(L);function y(){return y=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},y.apply(null,arguments)}var T,M=function(e){return b.createElement("svg",y({width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),k||(k=b.createElement("path",{d:"m6.98 1.252-.022.05L5.588 4.6a.3.3 0 0 1-.253.184l-3.561.286-.055.004-.331.027-.3.024a.3.3 0 0 0-.172.527l.23.196.252.216.041.036 2.713 2.324a.3.3 0 0 1 .097.297l-.83 3.475-.012.053-.077.323-.07.294a.3.3 0 0 0 .448.326l.258-.158.284-.173.046-.028 3.049-1.863a.3.3 0 0 1 .312 0l3.049 1.863.046.028.284.173.258.158a.3.3 0 0 0 .448-.326l-.07-.293-.077-.324-.013-.053-.829-3.475a.3.3 0 0 1 .097-.297L13.562 6.1l.041-.036.253-.216.23-.196a.3.3 0 0 0-.172-.527l-.3-.024-.332-.027-.055-.004-3.56-.286a.3.3 0 0 1-.254-.184L8.042 1.302l-.021-.05-.128-.307-.116-.279a.3.3 0 0 0-.554 0l-.116.279-.128.307Zm.52 1.352-.99 2.38a1.3 1.3 0 0 1-1.096.797l-2.57.206 1.958 1.677a1.3 1.3 0 0 1 .418 1.29l-.598 2.507 2.2-1.344a1.3 1.3 0 0 1 1.356 0l2.2 1.344-.598-2.508a1.3 1.3 0 0 1 .418-1.289l1.958-1.677-2.57-.206a1.3 1.3 0 0 1-1.096-.797l-.99-2.38Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})))};function I(){return I=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},I.apply(null,arguments)}var R,B,P=function(e){return b.createElement("svg",I({width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),T||(T=b.createElement("path",{d:"M7.223.666a.3.3 0 0 1 .554 0L9.413 4.6a.3.3 0 0 0 .253.184l4.248.34a.3.3 0 0 1 .171.528L10.85 8.424a.3.3 0 0 0-.097.297l.99 4.145a.3.3 0 0 1-.45.326L7.657 10.97a.3.3 0 0 0-.312 0l-3.637 2.222a.3.3 0 0 1-.448-.326l.989-4.145a.3.3 0 0 0-.097-.297L.915 5.652a.3.3 0 0 1 .171-.527l4.248-.34a.3.3 0 0 0 .253-.185L7.223.666Z",fill:"currentColor"})))},W=function(e){var n=e.className,r=(0,g.Z)(e,["className"]),a=r.value,o=r.currentValue,s=Number(a),d=s<=Number(o);return(0,u.jsxs)(Z.ck,(0,l.Z)((0,t.Z)({className:c()(N().starButton,n,(0,i.Z)({},N().selected,d))},r),{children:[(0,u.jsx)(S.T,{children:"".concat(s," ").concat(1===s?"star":"stars")}),d?(0,u.jsx)(P,{width:"30",height:"30"}):(0,u.jsx)(M,{width:"30",height:"30"})]}))},O=function(e){var n=e.maximumRating,r=void 0===n?5:n,a=e.disabled,i=void 0!==a&&a,o=e.defaultValue,s=void 0===o?"1":o,c=e.value,d=(0,g.Z)(e,["maximumRating","disabled","defaultValue","value"]);return(0,u.jsx)(E,(0,l.Z)((0,t.Z)({defaultValue:s},d),{children:Array.from({length:r},(function(e,n){var r=n+1,a="".concat(r);return(0,u.jsx)(W,{currentValue:c,value:r,id:a,disabled:!0===i},a)}))}))},A=r(31149),q=r.n(A);!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(R||(R={}));var F,V,z=(B={},(0,i.Z)(B,R.Small,5),(0,i.Z)(B,R.Medium,10),(0,i.Z)(B,R.Large,25),B);!function(e){e.Error="error",e.Warning="warning",e.Success="success"}(F||(F={})),function(e){e.Default="default",e.Main="main"}(V||(V={}));var D,K=function(e){var n=e.id,r=e.name,a=e.label,l=e.placeholder,o=e.disabled,s=void 0!==o&&o,d=e.type,f=e.variant,m=e.onChange,h=e.value,v=void 0===h?"":h,x=e.shouldFlipOnRTL,_=void 0===x||x,p=e.containerClassName,g=e.isRequired,Z=e.inputRef,C=e.size,j=void 0===C?R.Medium:C,w=e.fieldSetLegend,k=void 0===w?null:w,E=(0,b.useState)(v),S=E[0],L=E[1];(0,b.useEffect)((function(){L(v)}),[v]);var N,y,T=(0,u.jsxs)(u.Fragment,{children:[a&&(0,u.jsx)("p",{className:q().label,children:a}),(0,u.jsx)("div",{className:c()(q().container,p,(N={},(0,i.Z)(N,q().disabled,s),(0,i.Z)(N,q().error,d===F.Error),(0,i.Z)(N,q().success,d===F.Success),(0,i.Z)(N,q().warning,d===F.Warning),(0,i.Z)(N,q().main,f===V.Main),N)),children:(0,u.jsx)("textarea",(0,t.Z)({className:c()(q().input,(y={},(0,i.Z)(y,q().error,d===F.Error),(0,i.Z)(y,q().success,d===F.Success),(0,i.Z)(y,q().warning,d===F.Warning),(0,i.Z)(y,q().rtlTextArea,_),y)),required:g,dir:"auto",id:n,rows:z[j],ref:Z,disabled:s,onChange:function(e){var n=e.target.value;L(n),m&&m(n)},value:S},l&&{placeholder:l},r&&{name:r}))})]});return k?(0,u.jsxs)("fieldset",{children:[(0,u.jsxs)("legend",{children:[" ",k," "]}),T]}):T},H=r(24277),Q=(D={},(0,i.Z)(D,H.E.TextArea,K),(0,i.Z)(D,H.E.Text,p.ZP),(0,i.Z)(D,H.E.Password,p.ZP),(0,i.Z)(D,H.E.Phone,p.ZP),(0,i.Z)(D,H.E.Number,p.ZP),(0,i.Z)(D,H.E.Checkbox,_.Z),(0,i.Z)(D,H.E.StarRating,O),D),Y=function(e){var n=e.formFields,r=e.onSubmit,a=e.actionText,i=e.actionProps,s=void 0===i?{}:i,f=e.isSubmitting,h=e.renderAction,_=(0,d.cI)({mode:"onBlur"}),p=_.handleSubmit,g=_.control,b=_.setError;return(0,u.jsxs)("form",{className:v().container,onSubmit:p((function(e){var n=r(e);n&&n.then((function(e){e&&(null===e||void 0===e?void 0:e.errors)&&Object.entries(e.errors).forEach((function(e){var n=(0,o.Z)(e,2),r=n[0],a=n[1];b(r,{type:"manual",message:a})}))}))})),children:[null===n||void 0===n?void 0:n.map((function(e){return(0,u.jsx)(d.Qr,{control:g,defaultValue:e.defaultValue,rules:m(e),name:e.field,render:function(n){var r,a=n.field,i=n.fieldState.error,l=(0,t.Z)({key:e.field,value:a.value,id:e.field,name:e.field,containerClassName:e.containerClassName,fieldSetLegend:e.fieldSetLegend,label:e.label,placeholder:e.placeholder,onChange:function(n){a.onChange(n),(null===e||void 0===e?void 0:e.onChange)&&e.onChange(n)}},(r=e.type,[H.E.Text,H.E.Password,H.E.Phone,H.E.Number].includes(r)&&{htmlType:e.type,fixedWidth:!1}),e.type===H.E.Checkbox&&"undefined"!==typeof e.checked&&{checked:e.checked}),o=Q[e.type];return(0,u.jsxs)("div",{className:c()(v().inputContainer,e.containerClassName),children:[(0,u.jsx)(o,(0,t.Z)({},l)),i&&(0,u.jsx)("span",{className:v().errorText,children:i.message}),e.extraSection&&(0,u.jsx)("div",{children:e.extraSection})]})}},e.field)})),h?h({htmlType:"submit",isLoading:f,onClick:function(e){e.stopPropagation()}}):(0,u.jsx)(x.ZP,(0,l.Z)((0,t.Z)({},s),{htmlType:"submit",isLoading:f,onClick:function(e){e.stopPropagation()},className:c()(v().submitButton,s.className),children:a}))]})}},41418:function(e,n,r){"use strict";r.d(n,{Z:function(){return g}});var a,i=r(45361),t=r(57044),l=r(16946),o=r(57611),u=r(67597),s=r(36430),c=r(37014),d=r.n(c),f=r(192),m=r.n(f);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},h.apply(null,arguments)}var v,x=function(e){return u.createElement("svg",h({viewBox:"0 0 20 20",height:16,width:16,fill:"none"},e),a||(a=u.createElement("path",{stroke:"var(--color-secondary-medium)",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",d:"M5 10h10"})))};function _(){return _=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_.apply(null,arguments)}var p=function(e){return u.createElement("svg",_({viewBox:"0 0 20 20",height:20,width:20,fill:"none"},e),v||(v=u.createElement("path",{d:"m14 7-5.5 5.5L6 10",stroke:"var(--color-background-default)",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},g=function(e){var n=e.disabled,r=void 0!==n&&n,a=e.required,u=void 0!==a&&a,c=e.defaultChecked,f=e.checked,h=e.id,v=e.label,_=e.name,g=e.onChange;return(0,o.jsxs)("div",{className:d()(m().container,(0,i.Z)({},m().disabled,r)),children:[(0,o.jsx)(s.fC,(0,l.Z)((0,t.Z)({disabled:r,name:_,required:u,onCheckedChange:function(e){g(e)},id:h,className:m().checkbox,defaultChecked:c},void 0!==f&&{checked:f}),{children:(0,o.jsx)(s.z$,{className:d()(m().indicator,(0,i.Z)({},m().disabledIndicator,r)),children:"indeterminate"===f?(0,o.jsx)(x,{}):(0,o.jsx)(p,{})})})),v&&(0,o.jsx)("label",{className:m().label,htmlFor:h,children:v})]})}},56539:function(e,n,r){"use strict";r.d(n,{Jf:function(){return t},fz:function(){return a}});var a,i,t,l=r(45361),o=r(57044),u=r(57611),s=r(67597),c=r(37014),d=r.n(c),f=r(85494),m=r(90724),h=r.n(m),v=r(43172);!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(a||(a={})),function(e){e.Error="error",e.Warning="warning",e.Success="success"}(i||(i={})),function(e){e.Default="default",e.Main="main"}(t||(t={}));n.ZP=function(e){var n=e.id,r=e.name,c=e.label,m=e.placeholder,x=e.size,_=void 0===x?a.Medium:x,p=e.fixedWidth,g=void 0===p||p,b=e.disabled,Z=void 0!==b&&b,C=e.clearable,j=void 0!==C&&C,w=e.type,k=e.variant,E=e.prefix,S=e.suffix,L=e.onClearClicked,N=e.onChange,y=e.onKeyDown,T=e.inputMode,M=e.value,I=void 0===M?"":M,R=e.shouldFlipOnRTL,B=void 0===R||R,P=e.containerClassName,W=e.htmlType,O=e.isRequired,A=e.inputRef,q=(0,s.useState)(I),F=q[0],V=q[1];(0,s.useEffect)((function(){V(I)}),[I]);var z,D;return(0,u.jsxs)(u.Fragment,{children:[c&&(0,u.jsx)("p",{className:h().label,children:c}),(0,u.jsxs)("div",{className:d()(h().container,P,(z={},(0,l.Z)(z,h().smallContainer,_===a.Small),(0,l.Z)(z,h().mediumContainer,_===a.Medium),(0,l.Z)(z,h().largeContainer,_===a.Large),(0,l.Z)(z,h().fixedWidth,g),(0,l.Z)(z,h().disabled,Z),(0,l.Z)(z,h().error,w===i.Error),(0,l.Z)(z,h().success,w===i.Success),(0,l.Z)(z,h().warning,w===i.Warning),(0,l.Z)(z,h().main,k===t.Main),z)),children:[E&&(0,u.jsx)("div",{className:d()(h().prefix,h().prefixSuffixContainer),children:E}),(0,u.jsx)("input",(0,o.Z)({className:d()(h().input,(D={},(0,l.Z)(D,h().error,w===i.Error),(0,l.Z)(D,h().success,w===i.Success),(0,l.Z)(D,h().warning,w===i.Warning),(0,l.Z)(D,h().rtlInput,B),D)),type:W,required:O,dir:"auto",id:n,ref:A,disabled:Z,onChange:function(e){var n=e.target.value;V(n),N&&N(n)},value:F,onKeyDown:y,inputMode:T},m&&{placeholder:m},r&&{name:r})),j?(0,u.jsx)(u.Fragment,{children:F&&(0,u.jsx)("div",{className:h().clearContainer,children:(0,u.jsx)(f.ZP,{shape:f.jL.Circle,variant:f.Wu.Ghost,size:f.qE.Small,onClick:L,children:(0,u.jsx)(v.Z,{})})})}):(0,u.jsx)(u.Fragment,{children:S&&(0,u.jsx)("div",{className:d()(h().suffix,h().prefixSuffixContainer),children:S})})]})]})}},12253:function(e,n,r){"use strict";var a;r.d(n,{S:function(){return a}}),function(e){e.Required="required",e.Regex="regex",e.MaximumLength="maxLength",e.MinimumLength="minLength"}(a||(a={}))},24277:function(e,n,r){"use strict";var a;r.d(n,{E:function(){return a}}),function(e){e.Text="text",e.Password="password",e.Phone="phone",e.Number="number",e.TextArea="textarea",e.Checkbox="checkbox",e.StarRating="starRating"}(a||(a={}))},64243:function(e){e.exports={container:"FormBuilder_container__7H_38",inputContainer:"FormBuilder_inputContainer__v4ceB",errorText:"FormBuilder_errorText__1uSsu",submitButton:"FormBuilder_submitButton__4Wo4u"}},192:function(e){e.exports={container:"Checkbox_container__LWbsV",checkbox:"Checkbox_checkbox__bbyfA",label:"Checkbox_label__MrEvp",disabled:"Checkbox_disabled__3XIf_",indicator:"Checkbox_indicator__6umIV",disabledIndicator:"Checkbox_disabledIndicator__Dmw2E"}},90724:function(e){e.exports={container:"Input_container__5BNOH",fixedWidth:"Input_fixedWidth__MZoNx",disabled:"Input_disabled__AFA4l",error:"Input_error__cfc8q",success:"Input_success__qb_Ue",warning:"Input_warning__KwRSJ",main:"Input_main__K4bVL",input:"Input_input__za7E9",rtlInput:"Input_rtlInput__8Yg1Q",smallContainer:"Input_smallContainer__bxyYT",mediumContainer:"Input_mediumContainer__jEOpT",largeContainer:"Input_largeContainer__yafZ8",label:"Input_label__loZWW",clearContainer:"Input_clearContainer__3LxT4",prefixSuffixContainer:"Input_prefixSuffixContainer__n84F6",prefix:"Input_prefix__jYhnp",suffix:"Input_suffix__v_BvR"}},90458:function(e){e.exports={container:"Root_container__CQEHR"}},86240:function(e){e.exports={starButton:"Star_starButton__UeMsd",selected:"Star_selected__M87yb"}},31149:function(e){e.exports={container:"TextArea_container__7anjD",disabled:"TextArea_disabled__hBW2r",error:"TextArea_error__JceFQ",success:"TextArea_success__cfxk5",warning:"TextArea_warning__fUWyl",main:"TextArea_main__KBxzB",input:"TextArea_input__SDMp4",label:"TextArea_label__VLY9r"}}}]);
  2. //# sourceMappingURL=47995-54f8bce2d93751e5.js.map