master-components-react 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,4 +28,4 @@ Check the top-level render call using <`+o+">.")}return r}}function ze(e,r){{if(
28
28
  <%s {...props} />
29
29
  React keys must be passed directly to JSX without using spread:
30
30
  let props = %s;
31
- <%s key={someKey} {...props} />`,Ue,pe,jr,pe),Qe[pe+Ue]=!0}}return e===w?xr(S):vr(S),S}}function yr(e,r,o){return er(e,r,o,!0)}function mr(e,r,o){return er(e,r,o,!1)}var br=mr,gr=yr;De.Fragment=w,De.jsx=br,De.jsxs=gr}()),De}process.env.NODE_ENV==="production"?Ke.exports=Cr():Ke.exports=Rr();var t=Ke.exports;const Tr="MainButton-module__mainButton",Er="MainButton-module__sm",kr="MainButton-module__onlyIcon",$r="MainButton-module__buttonSlot",Sr="MainButton-module__buttonLabel",Or="MainButton-module__md",Pr="MainButton-module__lg",Fr="MainButton-module__xl",Dr="MainButton-module__xl2",Lr="MainButton-module__disabled",we={mainButton:Tr,sm:Er,onlyIcon:kr,buttonSlot:$r,buttonLabel:Sr,md:Or,lg:Pr,xl:Fr,xl2:Dr,disabled:Lr},Nr=({label:i,buttonType:d="button",onClick:a,size:w="md",disabled:C,withIcons:f,iconOne:R,iconTwo:v,onlyIcon:u,buttonStyle:_,labelStyle:s,buttonSlotStyle:b})=>t.jsx("button",{type:d,style:_&&typeof _=="object"?_:{},className:`${we.mainButton} ${u?we.onlyIcon:""} ${w?we[w]:""} ${C?we.disabled:""}`,onClick:()=>{a&&typeof a=="function"&&a()},children:t.jsxs("div",{className:we.buttonSlot,style:b??{},children:[u||f&&R?R:"",!u&&t.jsx("span",{style:s??{},className:we.buttonLabel,children:i??"Button"}),f&&v?v:""]})}),Ar="FormInput-module__inputWrapper",Wr="FormInput-module__inputLabel",Ir="FormInput-module__required",Mr="FormInput-module__inputContainer",Br="FormInput-module__inputContent",qr="FormInput-module__inputTags",Vr="FormInput-module__focused",Hr="FormInput-module__error",Yr="FormInput-module__rightIcon",Ur="FormInput-module__leftIcon",Kr="FormInput-module__inputDropDown",Jr="FormInput-module__http",Gr="FormInput-module__disabled",Xr="FormInput-module__sm",zr="FormInput-module__md",Zr="FormInput-module__withCopy",Qr="FormInput-module__inputHelperText",P={inputWrapper:Ar,inputLabel:Wr,required:Ir,inputContainer:Mr,inputContent:Br,inputTags:qr,focused:Vr,error:Hr,rightIcon:Yr,leftIcon:Ur,inputDropDown:Kr,http:Jr,disabled:Gr,sm:Xr,md:zr,withCopy:Zr,inputHelperText:Qr},nr=({width:i,height:d,color:a})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:i??"12",height:d??"8",viewBox:"0 0 12 8",fill:"none",children:t.jsx("path",{d:"M1 1.5L6 6.5L11 1.5",stroke:a??"#A4A7AE",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),et=({width:i,height:d,color:a})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:i??"20",height:d??"20",viewBox:"0 0 20 20",fill:"none",children:[t.jsx("g",{clipPath:"url(#clip0_444_26)",children:t.jsx("path",{d:"M4.1665 12.5C3.38993 12.5 3.00165 12.5 2.69536 12.3732C2.28698 12.204 1.96253 11.8795 1.79337 11.4712C1.6665 11.1649 1.6665 10.7766 1.6665 10V4.33335C1.6665 3.39993 1.6665 2.93322 1.84816 2.5767C2.00795 2.2631 2.26292 2.00813 2.57652 1.84834C2.93304 1.66669 3.39975 1.66669 4.33317 1.66669H9.99984C10.7764 1.66669 11.1647 1.66669 11.471 1.79355C11.8794 1.96271 12.2038 2.28717 12.373 2.69555C12.4998 3.00183 12.4998 3.39012 12.4998 4.16669M10.1665 18.3334H15.6665C16.5999 18.3334 17.0666 18.3334 17.4232 18.1517C17.7368 17.9919 17.9917 17.7369 18.1515 17.4233C18.3332 17.0668 18.3332 16.6001 18.3332 15.6667V10.1667C18.3332 9.23327 18.3332 8.76656 18.1515 8.41004C17.9917 8.09643 17.7368 7.84147 17.4232 7.68168C17.0666 7.50002 16.5999 7.50002 15.6665 7.50002H10.1665C9.23308 7.50002 8.76637 7.50002 8.40985 7.68168C8.09625 7.84147 7.84128 8.09643 7.68149 8.41004C7.49984 8.76656 7.49984 9.23327 7.49984 10.1667V15.6667C7.49984 16.6001 7.49984 17.0668 7.68149 17.4233C7.84128 17.7369 8.09625 17.9919 8.40985 18.1517C8.76637 18.3334 9.23308 18.3334 10.1665 18.3334Z",stroke:a??"#414651",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_444_26",children:t.jsx("rect",{width:"20",height:"20",fill:"white"})})})]}),or=({width:i,height:d,color:a})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:i??"14",height:d??"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5",stroke:a??"#A4A7AE",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),rt="Checkbox-module__checkboxWrapper",tt="Checkbox-module__sm",nt="Checkbox-module__md",ot="Checkbox-module__checkMark",at="Checkbox-module__checked",st="Checkbox-module__disabled",Ce={checkboxWrapper:rt,sm:tt,md:nt,checkMark:ot,checked:at,disabled:st},ar=({color:i,width:d,height:a})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:d??"12",height:a??"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:"M10 3L4.5 8.5L2 6",stroke:i??"white",strokeWidth:"1.6666",strokeLinecap:"round",strokeLinejoin:"round"})}),it=i=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...i,width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:t.jsx("path",{d:"M1.5 1H8.5",stroke:"white",strokeWidth:"1.66666",strokeLinecap:"round",strokeLinejoin:"round"})}),sr=({checked:i,change:d,disabled:a,required:w,multipleChecked:C,size:f,activeStyle:R,checkBoxStyle:v})=>{const u=m.useRef(null),[_,s]=m.useState(!1),b=()=>{d&&typeof d=="function"&&d(!i)},E=()=>_?R??{}:v??{};return t.jsxs("div",{style:E(),className:`${Ce.checkboxWrapper} ${Ce[f]??Ce.md} ${i?Ce.checked:Ce.unChecked} ${a?Ce.disabled:""}`,onMouseDown:()=>s(!0),onMouseUp:()=>s(!1),onMouseLeave:()=>s(!1),onClick:b,children:[t.jsx("input",{ref:u,type:"checkbox",disabled:a,checked:i,hidden:!0,readOnly:!0,required:w??!1}),i?C?t.jsx(it,{}):t.jsx(ar,{}):""]})},lt="Tag-module__tagContainer",ut="Tag-module__onlyLabel",ct="Tag-module__sm",dt="Tag-module__md",ft="Tag-module__lg",pt="Tag-module__tagLabel",ht="Tag-module__tagNumber",_t="Tag-module__tagClose",Re={tagContainer:lt,onlyLabel:ut,sm:ct,md:dt,lg:ft,tagLabel:pt,tagNumber:ht,tagClose:_t},ir=({id:i,label:d,icon:a,withClose:w,withCheckbox:C,withNumber:f,number:R,checkboxProps:v,disable:u,size:_,onClose:s,tagContainerStyle:b,tagLabelStyle:E,tagNumberStyle:O,tagCloseStlye:T})=>{const B=()=>!C&&!a&&!w&&!f,q=()=>a,D=()=>{s&&typeof s=="function"&&s(i??null)};return t.jsxs("div",{style:b??{},className:`${Re.tagContainer} ${B()?Re.onlyLabel:""} ${Re[_??"md"]}`,children:[C&&t.jsx(sr,{...v}),a&&q(),d&&t.jsx("p",{style:E??{},className:Re.tagLabel,children:d??""}),f&&t.jsx("div",{style:O??{},className:Re.tagNumber,children:R??""}),w&&t.jsx("div",{style:T??{},className:Re.tagClose,onClick:D,children:t.jsx(or,{width:(T==null?void 0:T.width)??"14",height:(T==null?void 0:T.height)??"14",color:(T==null?void 0:T.color)??"#A4A7AE"})})]})},vt=({value:i,label:d,placeholder:a,required:w,disabled:C,type:f,size:R,onChange:v,onFouce:u,onBlur:_,msg:s,readOnly:b,maxLength:E,onlyText:O,tagValues:T,onRightIconIconClick:B,onRightIconIconMouseEnter:q,onRightIconIconMouseLeave:D,onLeftIconIconClick:g,onLeftIconIconMouseEnter:K,onLeftIconIconMouseLeave:J,onPressEnter:Q,rightIcon:ne,leftIcon:oe,withDropDown:ce,dropdownData:ee,onSelectData:de,withTags:Te,tagProps:_e,withLink:A,withCopy:V,onCopy:G,inputWrapperStyle:Ee,inputLabelStyle:ve,requiredStyle:X,inputContainerStyle:ae,leftIconStyle:W,inputDropDownStyle:re,ulStyle:z,liStyle:F,httpStyle:xe,inputStyle:ke,rightIconStyle:H,withCopyStyle:fe,inputHelperTextStyle:te})=>{const[ye,se]=m.useState(!1),$e=m.useRef(null),[me,ie]=m.useState(!1);m.useState(!1);const le=m.useRef(null),n=m.useRef(null),[x,$]=m.useState(!1),[Z,be]=m.useState(1),Ae=c=>{let L=c.target.value;L.length===1&&(L=L.trim()),v&&typeof v=="function"&&v(O?L.replace(/\d/g,""):L)},We=()=>{ie(!0),u&&typeof u=="function"&&u()},Se=()=>{ie(!1),_&&typeof _=="function"&&_()},Ie=c=>{const L=c.target.value,qe=L.length===0;f==="number"&&(c.keyCode===69||!qe&&(c.keyCode===187||c.keyCode===107||c.keyCode===189||c.keyCode===109))&&c.preventDefault(),c.key==="Enter"&&L&&L.length>0&&Q&&typeof Q=="function"&&Q(L)},Me=()=>{G&&typeof G=="function"&&G(i)},Oe=c=>c,Le=()=>{let c={};return V&&(c.borderTopRightRadius=0,c.borderBottomRightRadius=0,c.borderRight=0),ce&&(c.paddingLeft=0),{...c,...ae??{}}},ue=c=>{!c.composedPath().includes(n.current)&&c.composedPath().includes(le.current)||$(!1)},Be=c=>{be(c.id),$(!1),de&&typeof de=="function"&&de(c)};m.useEffect(()=>{i&&i.length===0&&calculateWidth()},[i]),m.useEffect(()=>(document.addEventListener("click",ue),()=>{document.removeEventListener("click",ue)}),[]);const Pe=m.useRef(!1);return m.useEffect(()=>{Pe.current?setTimeout(()=>{se(c=>!c)},0):Pe.current=!0},[]),t.jsxs("div",{className:P.inputWrapper,style:Ee??{},children:[d&&t.jsxs("label",{className:P.inputLabel,style:ve??{},children:[d," ",t.jsx("span",{className:P.required,style:X??{},children:w&&"*"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[t.jsxs("div",{style:Le(),className:`${P.inputContainer} ${me&&!b?P.focused:""} ${C?P.disabled:""} ${s!=null&&s.error?P.error:""} ${P[R??"sm"]}`,children:[!ce&&!A&&oe&&t.jsx("div",{className:P.leftIcon,style:W??{},onClick:()=>{g&&typeof g=="function"&&g()},onMouseEnter:()=>{K&&typeof K=="function"&&K()},onMouseLeave:()=>{J&&typeof J=="function"&&J()},children:Oe(oe)}),!A&&ce&&t.jsxs("div",{className:P.inputDropDown,style:re??{},onClick:()=>$(!0),ref:le,children:[ee.find(c=>c.id===Z).label,x&&t.jsx("ul",{ref:n,style:z??{},children:ee&&ee.length&&ee.map((c,L)=>t.jsx("li",{style:F??{},onClick:()=>Be(c),children:(c==null?void 0:c.label)??"-"},c.id))}),t.jsx(nr,{})]}),A&&t.jsx("div",{className:`${P.inputDropDown} ${P.http}`,style:xe??{},onClick:()=>$(!0),ref:le,children:"http://"}),t.jsxs("div",{className:P.inputContent,children:[Te&&T&&T.length>0&&t.jsx("div",{className:P.inputTags,children:T.map((c,L)=>t.jsx("div",{className:P.inputSingleTags,children:t.jsx(ir,{..._e,id:c,label:c,withClose:!0})},L))}),t.jsx("input",{ref:$e,style:ke??{},type:f??"text",value:i,onChange:c=>Ae(c),onFocus:We,onBlur:Se,disabled:C,required:w,onKeyDown:Ie,readOnly:b,spellCheck:!1,placeholder:a??"",autoComplete:"off",maxLength:E})]}),ne&&t.jsx("div",{className:P.rightIcon,style:H??{},onClick:()=>{B&&typeof B=="function"&&B()},onMouseEnter:()=>{q&&typeof q=="function"&&q()},onMouseLeave:()=>{D&&typeof D=="function"&&D()},children:Oe(ne)})]}),V&&t.jsxs("div",{style:fe??{},onClick:Me,className:P.withCopy,children:[t.jsx(et,{}),"Copy"]})]}),s&&(s==null?void 0:s.visible)&&t.jsx("div",{style:te??{},className:`${P.inputHelperText} ${s!=null&&s.error?P.error:""}`,children:t.jsx("p",{style:(s==null?void 0:s.style)??{},children:s.text})})]})},xt="Textarea-module__textareaContainer",yt="Textarea-module__textAreaLabel",mt="Textarea-module__required",bt="Textarea-module__wrap",gt="Textarea-module__textarea",jt="Textarea-module__focused",wt="Textarea-module__disabled",Ct="Textarea-module__error",Rt="Textarea-module__helperTextStyle",U={textareaContainer:xt,textAreaLabel:yt,required:mt,wrap:bt,textarea:gt,focused:jt,disabled:wt,error:Ct,helperTextStyle:Rt},Tt=({width:i,height:d,color:a})=>t.jsxs("svg",{width:i??"16",height:d??"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("g",{id:"help-circle",clipPath:"url(#clip0_433_6293)",children:t.jsx("path",{id:"Icon",d:"M6.05992 5.99998C6.21665 5.55442 6.52602 5.17872 6.93322 4.9394C7.34042 4.70009 7.81918 4.61261 8.2847 4.69245C8.75022 4.7723 9.17246 5.01433 9.47664 5.37567C9.78081 5.737 9.94729 6.19433 9.94659 6.66665C9.94659 7.99998 7.94659 8.66665 7.94659 8.66665M7.99992 11.3333H8.00659M14.6666 7.99998C14.6666 11.6819 11.6818 14.6666 7.99992 14.6666C4.31802 14.6666 1.33325 11.6819 1.33325 7.99998C1.33325 4.31808 4.31802 1.33331 7.99992 1.33331C11.6818 1.33331 14.6666 4.31808 14.6666 7.99998Z",stroke:a??"#A4A7AE",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_433_6293",children:t.jsx("rect",{width:i??"16",height:d??"16",fill:"white"})})})]}),Et=({placeholder:i,label:d,msg:a,cols:w,rows:C,value:f,maxLength:R,onChange:v,onFocus:u,onBlur:_,disabled:s,required:b,textareaContainerStyle:E,textareaLabelStyle:O,requiredStyle:T,textareaStyle:B,textareaHelperTextStyle:q})=>{const[D,g]=m.useState(!1),K=ne=>{let oe=ne.target.value;v&&typeof v=="function"&&v(oe)},J=()=>{g(!0),u&&typeof u=="function"&&u()},Q=()=>{g(!1),_&&typeof _=="function"&&_()};return t.jsxs("div",{style:E??{},className:`${U.textareaContainer} ${a!=null&&a.type&&(a!=null&&a.visible)?U[a==null?void 0:a.type]:""} ${s?U.disabled:null}`,children:[d&&t.jsxs("div",{style:O,className:U.textAreaLabel,children:[t.jsx("p",{children:d}),t.jsx("span",{style:T??{},className:U.required,children:b&&"*"}),t.jsx(Tt,{})]}),t.jsx("div",{className:U.wrap,children:t.jsx("textarea",{style:B??{},className:`${U.textarea} ${D?U.focused:""} ${s?U.disabled:""} ${a!=null&&a.error?U.error:""}`,value:f,placeholder:i??"",cols:w??"30",rows:C??"5",maxLength:R??null,onFocus:J,disabled:s,onBlur:Q,onChange:K})}),t.jsx("div",{style:q??{},className:`${U.helperTextStyle} ${a!=null&&a.error?U.error:""}`,children:t.jsx("p",{style:(a==null?void 0:a.style)??{},children:a.text})})]})},kt="Toggle-module__toggleWrapper",$t="Toggle-module__toggleState",St="Toggle-module__checked",Ot="Toggle-module__disabled",Ne={toggleWrapper:kt,toggleState:$t,checked:St,disabled:Ot},Pt=({checked:i,change:d,disabled:a,required:w,activeStyle:C,bgStyle:f,checkedBgStyle:R,disabledBgStyle:v,circleStyle:u,checkedCircleStyle:_,disabledCircleStyle:s})=>{const[b,E]=m.useState(!1),O=()=>{d&&typeof d=="function"&&d(!i)},T=()=>{if(b)return C??{};if(i){if(R)return R}else if(i){if(a&&v)return v}else if(f)return f;return{}},B=()=>{if(i){if(_)return _}else if(i){if(a&&s)return s}else if(u)return u;return{}};return t.jsx("div",{style:T(),onMouseDown:()=>E(!0),onMouseUp:()=>E(!1),onMouseLeave:()=>E(!1),onClick:O,className:`${Ne.toggleWrapper} ${i?Ne.checked:""} ${a?Ne.disabled:""}`,children:t.jsx("div",{style:B(),className:Ne.toggleState,children:t.jsx("input",{type:"checkbox",checked:i,readOnly:!0,disabled:a??!1,hidden:!0,required:w??!1})})})},Ft="Radio-module__radioWrapper",Dt="Radio-module__sm",Lt="Radio-module__md",Nt="Radio-module__checked",At="Radio-module__innerCircle",Wt="Radio-module__radioState",It="Radio-module__disabled",he={radioWrapper:Ft,sm:Dt,md:Lt,checked:Nt,innerCircle:At,radioState:Wt,disabled:It},Mt=({checked:i,change:d,disabled:a,isRequired:w,withUncheckState:C,size:f})=>{m.useState(!1);const R=()=>{d&&typeof d=="function"&&(C||!C&&!i)&&d(!0)};return t.jsxs("div",{className:`${he.radioWrapper} ${he[f]??he.md} ${i?he.checked:""} ${a?he.disabled:""}`,onClick:R,children:[t.jsx("input",{type:"radio",checked:!0,readOnly:!0,hidden:!0,disabled:a??!1,required:w??!1}),t.jsx("div",{className:he.radioState,children:t.jsx("div",{className:he.innerCircle})})]})},Bt="Dropdown-module__dropdownWrapper",qt="Dropdown-module__placeHolder",Vt="Dropdown-module__dropdownLabel",Ht="Dropdown-module__required",Yt="Dropdown-module__dropdownContainer",Ut="Dropdown-module__sm",Kt="Dropdown-module__md",Jt="Dropdown-module__selectedTags",Gt="Dropdown-module__selectedList",Xt="Dropdown-module__additional",zt="Dropdown-module__dropdownList",Zt="Dropdown-module__disabled",Qt="Dropdown-module__selected",en="Dropdown-module__focused",rn="Dropdown-module__error",tn="Dropdown-module__dropdownHelperText",N={dropdownWrapper:Bt,placeHolder:qt,dropdownLabel:Vt,required:Ht,dropdownContainer:Yt,sm:Ut,md:Kt,selectedTags:Jt,selectedList:Gt,additional:Xt,dropdownList:zt,disabled:Zt,selected:Qt,focused:en,error:rn,dropdownHelperText:tn},nn=({label:i,disabled:d,required:a,size:w="md",placeholder:C="placeholder",msg:f,readOnly:R,data:v,onSelect:u,selectedOptionID:_,withFilter:s,onSearch:b,pagination:E,withMultiSelect:O=!0,skipSelected:T,labelIcon:B,closeIcon:q,iconDown:D,onLabelIconClick:g,onLabelIconMouseEnter:K,onLabelIconMouseLeave:J,dropdownWrapperStyle:Q,dropdownLabelStyle:ne,requiredStyle:oe,labelIconStyle:ce,dropdownContainerStyle:ee,placeHolderStyle:de,selectedTagsStyle:Te,selectedListStyle:_e,additionalStyle:A,dropdownListStyle:V,listStyle:G})=>{const[Ee,ve]=m.useState(!1),[X,ae]=m.useState(!1),W=m.useRef(v),[re,z]=m.useState("");m.useState(null);const F=m.useRef([]),xe=m.useRef(null),ke=m.useRef(null),H=m.useRef({}),fe=(n,x)=>{const $=new Set;return n.filter(Z=>$.has(Z[x])?!1:($.add(Z[x]),!0))},te=n=>{var x;W.current.forEach($=>{n.id===$.id?$.selected=!0:$.selected=!1}),H.current=n,z((x=H.current)==null?void 0:x.label),u&&typeof u=="function"&&u(H.current),ae(!1)},ye=n=>{F.current=[...F.current,...W.current.filter(x=>x.id===n.id)],n.selected=!n.selected,F.current=fe(F.current,"id").filter(x=>x.selected),u&&typeof u=="function"&&u(F.current),z(F.current.map(x=>x.label).join(", ")),ve(x=>!x)},se=n=>{n.stopPropagation(),F.current=[],_=null,W.current&&W.current.length>0&&v.forEach(x=>x.selected=!1),u(O?[]:{}),z("")},$e=n=>{if(s&&!E)if(n&&n.length>0){let x=W.current.filter($=>{var Z;return(Z=$==null?void 0:$.label)==null?void 0:Z.toLowerCase().includes(n.toLowerCase())});W.current=x}else W.current=v;b&&typeof b=="function"&&b(n),z(n)},me=()=>{if(_||_===0){let n=v.filter(x=>Number(x.id)===Number(_));n&&n[0]&&(H.current=n[0],T?(b&&typeof b=="function"&&b(H.current.label),z(H.current.label),closeOnSelect&&setCollapsed(x=>!1),withDropdownSearch&&DropdownSearchValue&&SetDropdownSearchValue("")):te(n[0]))}},ie=n=>n,le=n=>{n.composedPath().includes(xe.current)||ae(!1)};return m.useEffect(()=>{O||me()},[_]),m.useEffect(()=>(document.addEventListener("click",le),()=>{document.removeEventListener("click",le)}),[]),t.jsxs("div",{className:N.dropdownWrapper,style:Q??{},children:[i&&t.jsxs("label",{className:N.dropdownLabel,style:ne??{},children:[i," ",t.jsx("span",{className:N.required,style:oe??{},children:a&&"*"}),t.jsxs("span",{style:{...ce??{},display:"grid",placeItems:"center"},onClick:()=>{g&&typeof g=="function"&&g()},onMouseEnter:()=>{K&&typeof K=="function"&&K()},onMouseLeave:()=>{J&&typeof J=="function"&&J()},children:[" ",ie(B)]})]}),t.jsxs("div",{ref:xe,onClick:()=>ae(n=>!n),className:`${N.dropdownContainer} ${X&&!R?N.focused:""} ${d?N.disabled:""} ${f!=null&&f.error?N.error:""} ${N[w]}`,style:ee??{},children:[t.jsx("span",{className:N.placeHolder,style:de??{},children:re&&re.length>0?"":C}),O&&t.jsxs("div",{className:N.selectedTags,style:Te??{},children:[F.current.slice(0,3).map((n,x)=>{let $=F.current[F.current.length-1];return t.jsxs("span",{className:N.selectedList,style:_e??{},children:[n.label,n.id!==$.id&&x!==2?", ":""]},n==null?void 0:n.id)}),F.current.length>3&&t.jsxs("span",{className:N.additional,style:A??{},children:[" ","+(",F.current.length-3,")"]})]}),t.jsx("input",{autoCorrect:"off",hidden:O,readOnly:!s||!X||O,type:"text",value:re,onChange:n=>$e(n.target.value)},_),X&&W.current&&W.current.length>0&&t.jsx("ul",{onClick:n=>n.stopPropagation(),ref:ke,className:N.dropdownList,style:V??{},children:W.current.map(n=>t.jsxs("li",{style:G??{},className:`${!(n!=null&&n.label)||n.label===void 0||n!=null&&n.disabled?N.disabled:""} ${n!=null&&n.selected?N.selected:""}`,onClick:()=>{O?ye(n):te(n)},children:[t.jsxs("p",{children:[" ",n!=null&&n.label?typeof n.label=="function"?n.label():n.label:"-"]}),(n==null?void 0:n.selected)&&t.jsx("span",{children:t.jsx(ar,{color:"#7F56D9",width:20,height:20})})]},n==null?void 0:n.id))}),(F.current.length>0||re.length)>0&&t.jsx("div",{onClick:n=>se(n),style:{display:"grid",placeItems:"center",cursor:"pointer"},children:q?ie(q):t.jsx(or,{width:16,height:16})}),t.jsx("div",{style:{display:"grid",placeItems:"center",transform:X?"rotate(180deg)":"",transition:"transform 0.2s ease-in-out",cursor:"pointer",marginLeft:"10px"},children:D?ie(D):t.jsx(nr,{})})]}),f&&(f==null?void 0:f.visible)&&t.jsx("div",{className:`${N.dropdownHelperText} ${f!=null&&f.error?N.error:""}`,children:!X&&t.jsx("p",{style:(f==null?void 0:f.style)??{},children:f.text})})]})};exports.Checkbox=sr;exports.Dropdown=nn;exports.FormInput=vt;exports.MainButton=Nr;exports.Radio=Mt;exports.Tag=ir;exports.Textarea=Et;exports.Toggle=Pt;
31
+ <%s key={someKey} {...props} />`,Ue,pe,jr,pe),Qe[pe+Ue]=!0}}return e===w?xr(S):vr(S),S}}function yr(e,r,o){return er(e,r,o,!0)}function mr(e,r,o){return er(e,r,o,!1)}var br=mr,gr=yr;De.Fragment=w,De.jsx=br,De.jsxs=gr}()),De}process.env.NODE_ENV==="production"?Ke.exports=Cr():Ke.exports=Rr();var t=Ke.exports;const Tr="MainButton-module__mainButton",Er="MainButton-module__sm",kr="MainButton-module__onlyIcon",$r="MainButton-module__buttonSlot",Sr="MainButton-module__buttonLabel",Or="MainButton-module__md",Pr="MainButton-module__lg",Fr="MainButton-module__xl",Dr="MainButton-module__xl2",Lr="MainButton-module__disabled",we={mainButton:Tr,sm:Er,onlyIcon:kr,buttonSlot:$r,buttonLabel:Sr,md:Or,lg:Pr,xl:Fr,xl2:Dr,disabled:Lr},Nr=({label:i,buttonType:d="button",onClick:a,size:w="md",disabled:C,withIcons:f,iconOne:R,iconTwo:v,onlyIcon:u,buttonStyle:_,labelStyle:s,buttonSlotStyle:b})=>t.jsx("button",{type:d,style:_&&typeof _=="object"?_:{},className:`${we.mainButton} ${u?we.onlyIcon:""} ${w?we[w]:""} ${C?we.disabled:""}`,onClick:()=>{a&&typeof a=="function"&&a()},children:t.jsxs("div",{className:we.buttonSlot,style:b??{},children:[u||f&&R?R:"",!u&&t.jsx("span",{style:s??{},className:we.buttonLabel,children:i??"Button"}),f&&v?v:""]})}),Ar="FormInput-module__inputWrapper",Wr="FormInput-module__inputLabel",Ir="FormInput-module__required",Mr="FormInput-module__inputContainer",Br="FormInput-module__inputContent",qr="FormInput-module__inputTags",Vr="FormInput-module__focused",Hr="FormInput-module__error",Yr="FormInput-module__rightIcon",Ur="FormInput-module__leftIcon",Kr="FormInput-module__inputDropDown",Jr="FormInput-module__http",Gr="FormInput-module__disabled",Xr="FormInput-module__sm",zr="FormInput-module__md",Zr="FormInput-module__withCopy",Qr="FormInput-module__inputHelperText",P={inputWrapper:Ar,inputLabel:Wr,required:Ir,inputContainer:Mr,inputContent:Br,inputTags:qr,focused:Vr,error:Hr,rightIcon:Yr,leftIcon:Ur,inputDropDown:Kr,http:Jr,disabled:Gr,sm:Xr,md:zr,withCopy:Zr,inputHelperText:Qr},nr=({width:i,height:d,color:a})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:i??"12",height:d??"8",viewBox:"0 0 12 8",fill:"none",children:t.jsx("path",{d:"M1 1.5L6 6.5L11 1.5",stroke:a??"#A4A7AE",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),et=({width:i,height:d,color:a})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:i??"20",height:d??"20",viewBox:"0 0 20 20",fill:"none",children:[t.jsx("g",{clipPath:"url(#clip0_444_26)",children:t.jsx("path",{d:"M4.1665 12.5C3.38993 12.5 3.00165 12.5 2.69536 12.3732C2.28698 12.204 1.96253 11.8795 1.79337 11.4712C1.6665 11.1649 1.6665 10.7766 1.6665 10V4.33335C1.6665 3.39993 1.6665 2.93322 1.84816 2.5767C2.00795 2.2631 2.26292 2.00813 2.57652 1.84834C2.93304 1.66669 3.39975 1.66669 4.33317 1.66669H9.99984C10.7764 1.66669 11.1647 1.66669 11.471 1.79355C11.8794 1.96271 12.2038 2.28717 12.373 2.69555C12.4998 3.00183 12.4998 3.39012 12.4998 4.16669M10.1665 18.3334H15.6665C16.5999 18.3334 17.0666 18.3334 17.4232 18.1517C17.7368 17.9919 17.9917 17.7369 18.1515 17.4233C18.3332 17.0668 18.3332 16.6001 18.3332 15.6667V10.1667C18.3332 9.23327 18.3332 8.76656 18.1515 8.41004C17.9917 8.09643 17.7368 7.84147 17.4232 7.68168C17.0666 7.50002 16.5999 7.50002 15.6665 7.50002H10.1665C9.23308 7.50002 8.76637 7.50002 8.40985 7.68168C8.09625 7.84147 7.84128 8.09643 7.68149 8.41004C7.49984 8.76656 7.49984 9.23327 7.49984 10.1667V15.6667C7.49984 16.6001 7.49984 17.0668 7.68149 17.4233C7.84128 17.7369 8.09625 17.9919 8.40985 18.1517C8.76637 18.3334 9.23308 18.3334 10.1665 18.3334Z",stroke:a??"#414651",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_444_26",children:t.jsx("rect",{width:"20",height:"20",fill:"white"})})})]}),or=({width:i,height:d,color:a})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:i??"14",height:d??"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5",stroke:a??"#A4A7AE",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),rt="Checkbox-module__checkboxWrapper",tt="Checkbox-module__sm",nt="Checkbox-module__md",ot="Checkbox-module__checkMark",at="Checkbox-module__checked",st="Checkbox-module__disabled",Ce={checkboxWrapper:rt,sm:tt,md:nt,checkMark:ot,checked:at,disabled:st},ar=({color:i,width:d,height:a})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:d??"12",height:a??"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:"M10 3L4.5 8.5L2 6",stroke:i??"white",strokeWidth:"1.6666",strokeLinecap:"round",strokeLinejoin:"round"})}),it=i=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...i,width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:t.jsx("path",{d:"M1.5 1H8.5",stroke:"white",strokeWidth:"1.66666",strokeLinecap:"round",strokeLinejoin:"round"})}),sr=({checked:i,change:d,disabled:a,required:w,multipleChecked:C,size:f,activeStyle:R,checkBoxStyle:v})=>{const u=m.useRef(null),[_,s]=m.useState(!1),b=()=>{d&&typeof d=="function"&&d(!i)},E=()=>_?R??{}:v??{};return t.jsxs("div",{style:E(),className:`${Ce.checkboxWrapper} ${Ce[f]??Ce.md} ${i?Ce.checked:Ce.unChecked} ${a?Ce.disabled:""}`,onMouseDown:()=>s(!0),onMouseUp:()=>s(!1),onMouseLeave:()=>s(!1),onClick:b,children:[t.jsx("input",{ref:u,type:"checkbox",disabled:a,checked:i,hidden:!0,readOnly:!0,required:w??!1}),i?C?t.jsx(it,{}):t.jsx(ar,{}):""]})},lt="Tag-module__tagContainer",ut="Tag-module__onlyLabel",ct="Tag-module__sm",dt="Tag-module__md",ft="Tag-module__lg",pt="Tag-module__tagLabel",ht="Tag-module__tagNumber",_t="Tag-module__tagClose",Re={tagContainer:lt,onlyLabel:ut,sm:ct,md:dt,lg:ft,tagLabel:pt,tagNumber:ht,tagClose:_t},ir=({id:i,label:d,icon:a,withClose:w,withCheckbox:C,withNumber:f,number:R,checkboxProps:v,disable:u,size:_,onClose:s,tagContainerStyle:b,tagLabelStyle:E,tagNumberStyle:O,tagCloseStlye:T})=>{const B=()=>!C&&!a&&!w&&!f,q=()=>a,D=()=>{s&&typeof s=="function"&&s(i??null)};return t.jsxs("div",{style:b??{},className:`${Re.tagContainer} ${B()?Re.onlyLabel:""} ${Re[_??"md"]}`,children:[C&&t.jsx(sr,{...v}),a&&q(),d&&t.jsx("p",{style:E??{},className:Re.tagLabel,children:d??""}),f&&t.jsx("div",{style:O??{},className:Re.tagNumber,children:R??""}),w&&t.jsx("div",{style:T??{},className:Re.tagClose,onClick:D,children:t.jsx(or,{width:(T==null?void 0:T.width)??"14",height:(T==null?void 0:T.height)??"14",color:(T==null?void 0:T.color)??"#A4A7AE"})})]})},vt=({value:i,label:d,placeholder:a,required:w,disabled:C,type:f,size:R,onChange:v,onFouce:u,onBlur:_,msg:s,readOnly:b,maxLength:E,onlyText:O,tagValues:T,onRightIconIconClick:B,onRightIconIconMouseEnter:q,onRightIconIconMouseLeave:D,onLeftIconIconClick:g,onLeftIconIconMouseEnter:K,onLeftIconIconMouseLeave:J,onPressEnter:Q,rightIcon:ne,leftIcon:oe,withDropDown:ce,dropdownData:ee,onSelectData:de,withTags:Te,tagProps:_e,withLink:A,withCopy:V,onCopy:G,inputWrapperStyle:Ee,inputLabelStyle:ve,requiredStyle:X,inputContainerStyle:ae,leftIconStyle:W,inputDropDownStyle:re,ulStyle:z,liStyle:F,httpStyle:xe,inputStyle:ke,rightIconStyle:H,withCopyStyle:fe,inputHelperTextStyle:te})=>{const[ye,se]=m.useState(!1),$e=m.useRef(null),[me,ie]=m.useState(!1);m.useState(!1);const le=m.useRef(null),n=m.useRef(null),[x,$]=m.useState(!1),[Z,be]=m.useState(1),Ae=c=>{let L=c.target.value;L.length===1&&(L=L.trim()),v&&typeof v=="function"&&v(O?L.replace(/\d/g,""):L)},We=()=>{ie(!0),u&&typeof u=="function"&&u()},Se=()=>{ie(!1),_&&typeof _=="function"&&_()},Ie=c=>{const L=c.target.value,qe=L.length===0;f==="number"&&(c.keyCode===69||!qe&&(c.keyCode===187||c.keyCode===107||c.keyCode===189||c.keyCode===109))&&c.preventDefault(),c.key==="Enter"&&L&&L.length>0&&Q&&typeof Q=="function"&&Q(L)},Me=()=>{G&&typeof G=="function"&&G(i)},Oe=c=>c,Le=()=>{let c={};return V&&(c.borderTopRightRadius=0,c.borderBottomRightRadius=0,c.borderRight=0),ce&&(c.paddingLeft=0),{...c,...ae??{}}},ue=c=>{!c.composedPath().includes(n.current)&&c.composedPath().includes(le.current)||$(!1)},Be=c=>{be(c.id),$(!1),de&&typeof de=="function"&&de(c)};m.useEffect(()=>{i&&i.length===0&&calculateWidth()},[i]),m.useEffect(()=>(document.addEventListener("click",ue),()=>{document.removeEventListener("click",ue)}),[]);const Pe=m.useRef(!1);return m.useEffect(()=>{Pe.current?setTimeout(()=>{se(c=>!c)},0):Pe.current=!0},[]),t.jsxs("div",{className:P.inputWrapper,style:Ee??{},children:[d&&t.jsxs("label",{className:P.inputLabel,style:ve??{},children:[d," ",t.jsx("span",{className:P.required,style:X??{},children:w&&"*"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[t.jsxs("div",{style:Le(),className:`${P.inputContainer} ${me&&!b?P.focused:""} ${C?P.disabled:""} ${s!=null&&s.error?P.error:""} ${P[R??"sm"]}`,children:[!ce&&!A&&oe&&t.jsx("div",{className:P.leftIcon,style:W??{},onClick:()=>{g&&typeof g=="function"&&g()},onMouseEnter:()=>{K&&typeof K=="function"&&K()},onMouseLeave:()=>{J&&typeof J=="function"&&J()},children:Oe(oe)}),!A&&ce&&t.jsxs("div",{className:P.inputDropDown,style:re??{},onClick:()=>$(!0),ref:le,children:[ee.find(c=>c.id===Z).label,x&&t.jsx("ul",{ref:n,style:z??{},children:ee&&ee.length&&ee.map((c,L)=>t.jsx("li",{style:F??{},onClick:()=>Be(c),children:(c==null?void 0:c.label)??"-"},c.id))}),t.jsx(nr,{})]}),A&&t.jsx("div",{className:`${P.inputDropDown} ${P.http}`,style:xe??{},onClick:()=>$(!0),ref:le,children:"http://"}),t.jsxs("div",{className:P.inputContent,children:[Te&&T&&T.length>0&&t.jsx("div",{className:P.inputTags,children:T.map((c,L)=>t.jsx("div",{className:P.inputSingleTags,children:t.jsx(ir,{..._e,id:c,label:c,withClose:!0})},L))}),t.jsx("input",{ref:$e,style:ke??{},type:f??"text",value:i,onChange:c=>Ae(c),onFocus:We,onBlur:Se,disabled:C,required:w,onKeyDown:Ie,readOnly:b,spellCheck:!1,placeholder:a??"",autoComplete:"off",maxLength:E})]}),ne&&t.jsx("div",{className:P.rightIcon,style:H??{},onClick:()=>{B&&typeof B=="function"&&B()},onMouseEnter:()=>{q&&typeof q=="function"&&q()},onMouseLeave:()=>{D&&typeof D=="function"&&D()},children:Oe(ne)})]}),V&&t.jsxs("div",{style:fe??{},onClick:Me,className:P.withCopy,children:[t.jsx(et,{}),"Copy"]})]}),s&&(s==null?void 0:s.visible)&&t.jsx("div",{style:te??{},className:`${P.inputHelperText} ${s!=null&&s.error?P.error:""}`,children:t.jsx("p",{style:(s==null?void 0:s.style)??{},children:s.text})})]})},xt="Textarea-module__textareaContainer",yt="Textarea-module__textAreaLabel",mt="Textarea-module__required",bt="Textarea-module__wrap",gt="Textarea-module__textarea",jt="Textarea-module__focused",wt="Textarea-module__disabled",Ct="Textarea-module__error",Rt="Textarea-module__helperTextStyle",U={textareaContainer:xt,textAreaLabel:yt,required:mt,wrap:bt,textarea:gt,focused:jt,disabled:wt,error:Ct,helperTextStyle:Rt},Tt=({width:i,height:d,color:a})=>t.jsxs("svg",{width:i??"16",height:d??"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("g",{id:"help-circle",clipPath:"url(#clip0_433_6293)",children:t.jsx("path",{id:"Icon",d:"M6.05992 5.99998C6.21665 5.55442 6.52602 5.17872 6.93322 4.9394C7.34042 4.70009 7.81918 4.61261 8.2847 4.69245C8.75022 4.7723 9.17246 5.01433 9.47664 5.37567C9.78081 5.737 9.94729 6.19433 9.94659 6.66665C9.94659 7.99998 7.94659 8.66665 7.94659 8.66665M7.99992 11.3333H8.00659M14.6666 7.99998C14.6666 11.6819 11.6818 14.6666 7.99992 14.6666C4.31802 14.6666 1.33325 11.6819 1.33325 7.99998C1.33325 4.31808 4.31802 1.33331 7.99992 1.33331C11.6818 1.33331 14.6666 4.31808 14.6666 7.99998Z",stroke:a??"#A4A7AE",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_433_6293",children:t.jsx("rect",{width:i??"16",height:d??"16",fill:"white"})})})]}),Et=({placeholder:i,label:d,msg:a,cols:w,rows:C,value:f,maxLength:R,onChange:v,onFocus:u,onBlur:_,disabled:s,required:b,textareaContainerStyle:E,textareaLabelStyle:O,requiredStyle:T,textareaStyle:B,textareaHelperTextStyle:q})=>{const[D,g]=m.useState(!1),K=ne=>{let oe=ne.target.value;v&&typeof v=="function"&&v(oe)},J=()=>{g(!0),u&&typeof u=="function"&&u()},Q=()=>{g(!1),_&&typeof _=="function"&&_()};return t.jsxs("div",{style:E??{},className:`${U.textareaContainer} ${a!=null&&a.type&&(a!=null&&a.visible)?U[a==null?void 0:a.type]:""} ${s?U.disabled:null}`,children:[d&&t.jsxs("div",{style:O,className:U.textAreaLabel,children:[t.jsx("p",{children:d}),t.jsx("span",{style:T??{},className:U.required,children:b&&"*"}),t.jsx(Tt,{})]}),t.jsx("div",{className:U.wrap,children:t.jsx("textarea",{style:B??{},className:`${U.textarea} ${D?U.focused:""} ${s?U.disabled:""} ${a!=null&&a.error?U.error:""}`,value:f,placeholder:i??"",cols:w??"30",rows:C??"5",maxLength:R??null,onFocus:J,disabled:s,onBlur:Q,onChange:K})}),t.jsx("div",{style:q??{},className:`${U.helperTextStyle} ${a!=null&&a.error?U.error:""}`,children:t.jsx("p",{style:(a==null?void 0:a.style)??{},children:a.text})})]})},kt="Toggle-module__toggleWrapper",$t="Toggle-module__toggleState",St="Toggle-module__checked",Ot="Toggle-module__disabled",Ne={toggleWrapper:kt,toggleState:$t,checked:St,disabled:Ot},Pt=({checked:i,change:d,disabled:a,required:w,activeStyle:C,bgStyle:f,checkedBgStyle:R,disabledBgStyle:v,circleStyle:u,checkedCircleStyle:_,disabledCircleStyle:s})=>{const[b,E]=m.useState(!1),O=()=>{d&&typeof d=="function"&&d(!i)},T=()=>{if(b)return C??{};if(i){if(R)return R}else if(i){if(a&&v)return v}else if(f)return f;return{}},B=()=>{if(i){if(_)return _}else if(i){if(a&&s)return s}else if(u)return u;return{}};return t.jsx("div",{style:T(),onMouseDown:()=>E(!0),onMouseUp:()=>E(!1),onMouseLeave:()=>E(!1),onClick:O,className:`${Ne.toggleWrapper} ${i?Ne.checked:""} ${a?Ne.disabled:""}`,children:t.jsx("div",{style:B(),className:Ne.toggleState,children:t.jsx("input",{type:"checkbox",checked:i,readOnly:!0,disabled:a??!1,hidden:!0,required:w??!1})})})},Ft="Radio-module__radioWrapper",Dt="Radio-module__sm",Lt="Radio-module__md",Nt="Radio-module__checked",At="Radio-module__innerCircle",Wt="Radio-module__radioState",It="Radio-module__disabled",he={radioWrapper:Ft,sm:Dt,md:Lt,checked:Nt,innerCircle:At,radioState:Wt,disabled:It},Mt=({checked:i,change:d,disabled:a,isRequired:w,withUncheckState:C,size:f})=>{m.useState(!1);const R=()=>{d&&typeof d=="function"&&(C||!C&&!i)&&d(!0)};return t.jsxs("div",{className:`${he.radioWrapper} ${he[f]??he.md} ${i?he.checked:""} ${a?he.disabled:""}`,onClick:R,children:[t.jsx("input",{type:"radio",checked:!0,readOnly:!0,hidden:!0,disabled:a??!1,required:w??!1}),t.jsx("div",{className:he.radioState,children:t.jsx("div",{className:he.innerCircle})})]})},Bt="Dropdown-module__dropdownWrapper",qt="Dropdown-module__placeHolder",Vt="Dropdown-module__dropdownLabel",Ht="Dropdown-module__required",Yt="Dropdown-module__dropdownContainer",Ut="Dropdown-module__sm",Kt="Dropdown-module__md",Jt="Dropdown-module__selectedTags",Gt="Dropdown-module__selectedList",Xt="Dropdown-module__additional",zt="Dropdown-module__dropdownList",Zt="Dropdown-module__disabled",Qt="Dropdown-module__selected",en="Dropdown-module__focused",rn="Dropdown-module__error",tn="Dropdown-module__dropdownHelperText",N={dropdownWrapper:Bt,placeHolder:qt,dropdownLabel:Vt,required:Ht,dropdownContainer:Yt,sm:Ut,md:Kt,selectedTags:Jt,selectedList:Gt,additional:Xt,dropdownList:zt,disabled:Zt,selected:Qt,focused:en,error:rn,dropdownHelperText:tn},nn=({label:i,disabled:d,required:a,size:w="md",placeholder:C="placeholder",msg:f,readOnly:R,data:v,onSelect:u,selectedOptionID:_,withFilter:s,onSearch:b,pagination:E,withMultiSelect:O=!1,skipSelected:T,labelIcon:B,closeIcon:q,iconDown:D,onLabelIconClick:g,onLabelIconMouseEnter:K,onLabelIconMouseLeave:J,dropdownWrapperStyle:Q,dropdownLabelStyle:ne,requiredStyle:oe,labelIconStyle:ce,dropdownContainerStyle:ee,placeHolderStyle:de,selectedTagsStyle:Te,selectedListStyle:_e,additionalStyle:A,dropdownListStyle:V,listStyle:G})=>{const[Ee,ve]=m.useState(!1),[X,ae]=m.useState(!1),W=m.useRef(v),[re,z]=m.useState("");m.useState(null);const F=m.useRef([]),xe=m.useRef(null),ke=m.useRef(null),H=m.useRef({}),fe=(n,x)=>{const $=new Set;return n.filter(Z=>$.has(Z[x])?!1:($.add(Z[x]),!0))},te=n=>{var x;W.current.forEach($=>{n.id===$.id?$.selected=!0:$.selected=!1}),H.current=n,z((x=H.current)==null?void 0:x.label),u&&typeof u=="function"&&u(H.current),ae(!1)},ye=n=>{F.current=[...F.current,...W.current.filter(x=>x.id===n.id)],n.selected=!n.selected,F.current=fe(F.current,"id").filter(x=>x.selected),u&&typeof u=="function"&&u(F.current),z(F.current.map(x=>x.label).join(", ")),ve(x=>!x)},se=n=>{n.stopPropagation(),F.current=[],_=null,W.current&&W.current.length>0&&v.forEach(x=>x.selected=!1),u(O?[]:{}),z("")},$e=n=>{if(s&&!E)if(n&&n.length>0){let x=W.current.filter($=>{var Z;return(Z=$==null?void 0:$.label)==null?void 0:Z.toLowerCase().includes(n.toLowerCase())});W.current=x}else W.current=v;b&&typeof b=="function"&&b(n),z(n)},me=()=>{if(_||_===0){let n=v.filter(x=>Number(x.id)===Number(_));n&&n[0]&&(H.current=n[0],T?(b&&typeof b=="function"&&b(H.current.label),z(H.current.label),closeOnSelect&&setCollapsed(x=>!1),withDropdownSearch&&DropdownSearchValue&&SetDropdownSearchValue("")):te(n[0]))}},ie=n=>n,le=n=>{n.composedPath().includes(xe.current)||ae(!1)};return m.useEffect(()=>{O||me()},[_]),m.useEffect(()=>(document.addEventListener("click",le),()=>{document.removeEventListener("click",le)}),[]),t.jsxs("div",{className:N.dropdownWrapper,style:Q??{},children:[i&&t.jsxs("label",{className:N.dropdownLabel,style:ne??{},children:[i," ",t.jsx("span",{className:N.required,style:oe??{},children:a&&"*"}),t.jsxs("span",{style:{...ce??{},display:"grid",placeItems:"center"},onClick:()=>{g&&typeof g=="function"&&g()},onMouseEnter:()=>{K&&typeof K=="function"&&K()},onMouseLeave:()=>{J&&typeof J=="function"&&J()},children:[" ",ie(B)]})]}),t.jsxs("div",{ref:xe,onClick:()=>ae(n=>!n),className:`${N.dropdownContainer} ${X&&!R?N.focused:""} ${d?N.disabled:""} ${f!=null&&f.error?N.error:""} ${N[w]}`,style:ee??{},children:[t.jsx("span",{className:N.placeHolder,style:de??{},children:re&&re.length>0?"":C}),O&&t.jsxs("div",{className:N.selectedTags,style:Te??{},children:[F.current.slice(0,3).map((n,x)=>{let $=F.current[F.current.length-1];return t.jsxs("span",{className:N.selectedList,style:_e??{},children:[n.label,n.id!==$.id&&x!==2?", ":""]},n==null?void 0:n.id)}),F.current.length>3&&t.jsxs("span",{className:N.additional,style:A??{},children:[" ","+(",F.current.length-3,")"]})]}),t.jsx("input",{autoCorrect:"off",hidden:O,readOnly:!s||!X||O,type:"text",value:re,onChange:n=>$e(n.target.value)},_),X&&W.current&&W.current.length>0&&t.jsx("ul",{onClick:n=>n.stopPropagation(),ref:ke,className:N.dropdownList,style:V??{},children:W.current.map(n=>t.jsxs("li",{style:G??{},className:`${!(n!=null&&n.label)||n.label===void 0||n!=null&&n.disabled?N.disabled:""} ${n!=null&&n.selected?N.selected:""}`,onClick:()=>{O?ye(n):te(n)},children:[t.jsxs("p",{children:[" ",n!=null&&n.label?typeof n.label=="function"?n.label():n.label:"-"]}),(n==null?void 0:n.selected)&&t.jsx("span",{children:t.jsx(ar,{color:"#7F56D9",width:20,height:20})})]},n==null?void 0:n.id))}),(F.current.length>0||re.length)>0&&t.jsx("div",{onClick:n=>se(n),style:{display:"grid",placeItems:"center",cursor:"pointer"},children:q?ie(q):t.jsx(or,{width:16,height:16})}),t.jsx("div",{style:{display:"grid",placeItems:"center",transform:X?"rotate(180deg)":"",transition:"transform 0.2s ease-in-out",cursor:"pointer",marginLeft:"10px"},children:D?ie(D):t.jsx(nr,{})})]}),f&&(f==null?void 0:f.visible)&&t.jsx("div",{className:`${N.dropdownHelperText} ${f!=null&&f.error?N.error:""}`,children:!X&&t.jsx("p",{style:(f==null?void 0:f.style)??{},children:f.text})})]})};exports.Checkbox=sr;exports.Dropdown=nn;exports.FormInput=vt;exports.MainButton=Nr;exports.Radio=Mt;exports.Tag=ir;exports.Textarea=Et;exports.Toggle=Pt;
@@ -1106,7 +1106,7 @@ const kr = "MainButton-module__mainButton", Er = "MainButton-module__sm", $r = "
1106
1106
  withFilter: s,
1107
1107
  onSearch: m,
1108
1108
  pagination: T,
1109
- withMultiSelect: O = !0,
1109
+ withMultiSelect: O = !1,
1110
1110
  skipSelected: R,
1111
1111
  labelIcon: M,
1112
1112
  closeIcon: q,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "master-components-react",
3
3
  "private": false,
4
- "version": "1.8.0",
4
+ "version": "1.8.1",
5
5
  "type": "module",
6
6
  "main": "dist/master-components-react.cjs.js",
7
7
  "module": "dist/master-components-react.es.js",