44254-fede4e337470a020.js 7.6 KB

12
  1. (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44254],{41418:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var r,a=t(45361),i=t(57044),o=t(16946),c=t(57611),s=t(67597),u=t(36430),l=t(37014),d=t.n(l),f=t(192),p=t.n(f);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},h.apply(null,arguments)}var _,m=function(e){return s.createElement("svg",h({viewBox:"0 0 20 20",height:16,width:16,fill:"none"},e),r||(r=s.createElement("path",{stroke:"var(--color-secondary-medium)",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",d:"M5 10h10"})))};function b(){return b=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},b.apply(null,arguments)}var v=function(e){return s.createElement("svg",b({viewBox:"0 0 20 20",height:20,width:20,fill:"none"},e),_||(_=s.createElement("path",{d:"m14 7-5.5 5.5L6 10",stroke:"var(--color-background-default)",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},x=function(e){var n=e.disabled,t=void 0!==n&&n,r=e.required,s=void 0!==r&&r,l=e.defaultChecked,f=e.checked,h=e.id,_=e.label,b=e.name,x=e.onChange;return(0,c.jsxs)("div",{className:d()(p().container,(0,a.Z)({},p().disabled,t)),children:[(0,c.jsx)(u.fC,(0,o.Z)((0,i.Z)({disabled:t,name:b,required:s,onCheckedChange:function(e){x(e)},id:h,className:p().checkbox,defaultChecked:l},void 0!==f&&{checked:f}),{children:(0,c.jsx)(u.z$,{className:d()(p().indicator,(0,a.Z)({},p().disabledIndicator,t)),children:"indeterminate"===f?(0,c.jsx)(m,{}):(0,c.jsx)(v,{})})})),_&&(0,c.jsx)("label",{className:p().label,htmlFor:h,children:_})]})}},56539:function(e,n,t){"use strict";t.d(n,{Jf:function(){return i},fz:function(){return r}});var r,a,i,o=t(45361),c=t(57044),s=t(57611),u=t(67597),l=t(37014),d=t.n(l),f=t(85494),p=t(90724),h=t.n(p),_=t(43172);!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(r||(r={})),function(e){e.Error="error",e.Warning="warning",e.Success="success"}(a||(a={})),function(e){e.Default="default",e.Main="main"}(i||(i={}));n.ZP=function(e){var n=e.id,t=e.name,l=e.label,p=e.placeholder,m=e.size,b=void 0===m?r.Medium:m,v=e.fixedWidth,x=void 0===v||v,k=e.disabled,C=void 0!==k&&k,g=e.clearable,E=void 0!==g&&g,Z=e.type,I=e.variant,j=e.prefix,y=e.suffix,w=e.onClearClicked,N=e.onChange,L=e.onKeyDown,M=e.inputMode,W=e.value,S=void 0===W?"":W,O=e.shouldFlipOnRTL,R=void 0===O||O,q=e.containerClassName,D=e.htmlType,P=e.isRequired,z=e.inputRef,F=(0,u.useState)(S),T=F[0],K=F[1];(0,u.useEffect)((function(){K(S)}),[S]);var B,V;return(0,s.jsxs)(s.Fragment,{children:[l&&(0,s.jsx)("p",{className:h().label,children:l}),(0,s.jsxs)("div",{className:d()(h().container,q,(B={},(0,o.Z)(B,h().smallContainer,b===r.Small),(0,o.Z)(B,h().mediumContainer,b===r.Medium),(0,o.Z)(B,h().largeContainer,b===r.Large),(0,o.Z)(B,h().fixedWidth,x),(0,o.Z)(B,h().disabled,C),(0,o.Z)(B,h().error,Z===a.Error),(0,o.Z)(B,h().success,Z===a.Success),(0,o.Z)(B,h().warning,Z===a.Warning),(0,o.Z)(B,h().main,I===i.Main),B)),children:[j&&(0,s.jsx)("div",{className:d()(h().prefix,h().prefixSuffixContainer),children:j}),(0,s.jsx)("input",(0,c.Z)({className:d()(h().input,(V={},(0,o.Z)(V,h().error,Z===a.Error),(0,o.Z)(V,h().success,Z===a.Success),(0,o.Z)(V,h().warning,Z===a.Warning),(0,o.Z)(V,h().rtlInput,R),V)),type:D,required:P,dir:"auto",id:n,ref:z,disabled:C,onChange:function(e){var n=e.target.value;K(n),N&&N(n)},value:T,onKeyDown:L,inputMode:M},p&&{placeholder:p},t&&{name:t})),E?(0,s.jsx)(s.Fragment,{children:T&&(0,s.jsx)("div",{className:h().clearContainer,children:(0,s.jsx)(f.ZP,{shape:f.jL.Circle,variant:f.Wu.Ghost,size:f.qE.Small,onClick:w,children:(0,s.jsx)(_.Z,{})})})}):(0,s.jsx)(s.Fragment,{children:y&&(0,s.jsx)("div",{className:d()(h().suffix,h().prefixSuffixContainer),children:y})})]})]})}},89595:function(e,n,t){"use strict";var r=t(19418);n.Z=function(e,n){return new r.Z(e,{keys:["name","languageName","authorName","translatedName.name"],threshold:.3}).search(n).map((function(e){return e.item}))}},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"}},36430:function(e,n,t){"use strict";t.d(n,{fC:function(){return Z},z$:function(){return I}});var r=t(57384),a=t(67597),i=t(71641),o=t(61544),c=t(90149),s=t(82305),u=t(10810),l=t(81319),d=t(8591),f=t(4300);const p="Checkbox",[h,_]=(0,o.b)(p),[m,b]=h(p),v=(0,a.forwardRef)(((e,n)=>{const{__scopeCheckbox:t,name:o,checked:u,defaultChecked:l,required:d,disabled:p,value:h="on",onCheckedChange:_,...b}=e,[v,x]=(0,a.useState)(null),k=(0,i.e)(n,(e=>x(e))),Z=(0,a.useRef)(!1),I=!v||Boolean(v.closest("form")),[j=!1,y]=(0,s.T)({prop:u,defaultProp:l,onChange:_}),w=(0,a.useRef)(j);return(0,a.useEffect)((()=>{const e=null===v||void 0===v?void 0:v.form;if(e){const n=()=>y(w.current);return e.addEventListener("reset",n),()=>e.removeEventListener("reset",n)}}),[v,y]),(0,a.createElement)(m,{scope:t,state:j,disabled:p},(0,a.createElement)(f.WV.button,(0,r.Z)({type:"button",role:"checkbox","aria-checked":g(j)?"mixed":j,"aria-required":d,"data-state":E(j),"data-disabled":p?"":void 0,disabled:p,value:h},b,{ref:k,onKeyDown:(0,c.M)(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:(0,c.M)(e.onClick,(e=>{y((e=>!!g(e)||!e)),I&&(Z.current=e.isPropagationStopped(),Z.current||e.stopPropagation())}))})),I&&(0,a.createElement)(C,{control:v,bubbles:!Z.current,name:o,value:h,checked:j,required:d,disabled:p,style:{transform:"translateX(-100%)"}}))})),x="CheckboxIndicator",k=(0,a.forwardRef)(((e,n)=>{const{__scopeCheckbox:t,forceMount:i,...o}=e,c=b(x,t);return(0,a.createElement)(d.z,{present:i||g(c.state)||!0===c.state},(0,a.createElement)(f.WV.span,(0,r.Z)({"data-state":E(c.state),"data-disabled":c.disabled?"":void 0},o,{ref:n,style:{pointerEvents:"none",...e.style}})))})),C=e=>{const{control:n,checked:t,bubbles:i=!0,...o}=e,c=(0,a.useRef)(null),s=(0,u.D)(t),d=(0,l.t)(n);return(0,a.useEffect)((()=>{const e=c.current,n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,"checked").set;if(s!==t&&r){const n=new Event("click",{bubbles:i});e.indeterminate=g(t),r.call(e,!g(t)&&t),e.dispatchEvent(n)}}),[s,t,i]),(0,a.createElement)("input",(0,r.Z)({type:"checkbox","aria-hidden":!0,defaultChecked:!g(t)&&t},o,{tabIndex:-1,ref:c,style:{...e.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function g(e){return"indeterminate"===e}function E(e){return g(e)?"indeterminate":e?"checked":"unchecked"}const Z=v,I=k},10810:function(e,n,t){"use strict";t.d(n,{D:function(){return a}});var r=t(67597);function a(e){const n=(0,r.useRef)({value:e,previous:e});return(0,r.useMemo)((()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous)),[e])}}}]);
  2. //# sourceMappingURL=44254-fede4e337470a020.js.map