master-components-react 1.9.0 → 1.9.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 t}}function Ze(e,t){{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} />`,Ke,pe,jt,pe),et[pe+Ke]=!0}}return e===C?xt(O):mt(O),O}}function yt(e,t,o){return tt(e,t,o,!0)}function bt(e,t,o){return tt(e,t,o,!1)}var gt=bt,Ct=yt;De.Fragment=C,De.jsx=gt,De.jsxs=Ct}()),De}process.env.NODE_ENV==="production"?Je.exports=Tt():Je.exports=Rt();var r=Je.exports;const Et="MainButton-module__mainButton",kt="MainButton-module__sm",$t="MainButton-module__onlyIcon",St="MainButton-module__buttonSlot",Pt="MainButton-module__buttonLabel",Ot="MainButton-module__md",Lt="MainButton-module__lg",Ft="MainButton-module__xl",Dt="MainButton-module__xl2",Nt="MainButton-module__disabled",je={mainButton:Et,sm:kt,onlyIcon:$t,buttonSlot:St,buttonLabel:Pt,md:Ot,lg:Lt,xl:Ft,xl2:Dt,disabled:Nt},At=({label:l,buttonType:u="button",onClick:s,size:C="md",disabled:j,withIcons:f,iconOne:w,iconTwo:m,onlyIcon:c,buttonStyle:_,labelStyle:a,buttonSlotStyle:x})=>r.jsx("button",{type:u,style:_&&typeof _=="object"?_:{},className:`${je.mainButton} ${c?je.onlyIcon:""} ${C?je[C]:""} ${j?je.disabled:""}`,onClick:()=>{s&&typeof s=="function"&&s()},children:r.jsxs("div",{className:je.buttonSlot,style:x??{},children:[c||f&&w?w:"",!c&&r.jsx("span",{style:a??{},className:je.buttonLabel,children:l??"Button"}),f&&m?m:""]})}),Wt="FormInput-module__inputWrapper",Mt="FormInput-module__inputLabel",It="FormInput-module__required",Bt="FormInput-module__inputContainer",Ht="FormInput-module__inputContent",qt="FormInput-module__inputTags",Vt="FormInput-module__focused",Yt="FormInput-module__error",Ut="FormInput-module__rightIcon",Kt="FormInput-module__leftIcon",Jt="FormInput-module__inputDropDown",Gt="FormInput-module__http",Xt="FormInput-module__disabled",zt="FormInput-module__sm",Zt="FormInput-module__md",Qt="FormInput-module__withCopy",er="FormInput-module__inputHelperText",F={inputWrapper:Wt,inputLabel:Mt,required:It,inputContainer:Bt,inputContent:Ht,inputTags:qt,focused:Vt,error:Yt,rightIcon:Ut,leftIcon:Kt,inputDropDown:Jt,http:Gt,disabled:Xt,sm:zt,md:Zt,withCopy:Qt,inputHelperText:er},ot=({width:l,height:u,color:s})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:l??"12",height:u??"8",viewBox:"0 0 12 8",fill:"none",children:r.jsx("path",{d:"M1 1.5L6 6.5L11 1.5",stroke:s??"#A4A7AE",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),tr=({width:l,height:u,color:s})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:l??"20",height:u??"20",viewBox:"0 0 20 20",fill:"none",children:[r.jsx("g",{clipPath:"url(#clip0_444_26)",children:r.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:s??"#414651",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),r.jsx("defs",{children:r.jsx("clipPath",{id:"clip0_444_26",children:r.jsx("rect",{width:"20",height:"20",fill:"white"})})})]}),st=({width:l,height:u,color:s})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:l??"14",height:u??"14",viewBox:"0 0 14 14",fill:"none",children:r.jsx("path",{d:"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5",stroke:s??"#A4A7AE",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),rr="Checkbox-module__checkboxWrapper",nr="Checkbox-module__sm",or="Checkbox-module__md",sr="Checkbox-module__checkMark",ar="Checkbox-module__checked",lr="Checkbox-module__disabled",we={checkboxWrapper:rr,sm:nr,md:or,checkMark:sr,checked:ar,disabled:lr},at=({color:l,width:u,height:s})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:u??"12",height:s??"12",viewBox:"0 0 12 12",fill:"none",children:r.jsx("path",{d:"M10 3L4.5 8.5L2 6",stroke:l??"white",strokeWidth:"1.6666",strokeLinecap:"round",strokeLinejoin:"round"})}),ir=l=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...l,width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:r.jsx("path",{d:"M1.5 1H8.5",stroke:"white",strokeWidth:"1.66666",strokeLinecap:"round",strokeLinejoin:"round"})}),lt=({checked:l,change:u,disabled:s,required:C,multipleChecked:j,size:f,activeStyle:w,checkBoxStyle:m})=>{const c=h.useRef(null),[_,a]=h.useState(!1),x=()=>{u&&typeof u=="function"&&u(!l)},E=()=>_?w??{}:m??{};return r.jsxs("div",{style:E(),className:`${we.checkboxWrapper} ${we[f]??we.md} ${l?we.checked:we.unChecked} ${s?we.disabled:""}`,onMouseDown:()=>a(!0),onMouseUp:()=>a(!1),onMouseLeave:()=>a(!1),onClick:x,children:[r.jsx("input",{ref:c,type:"checkbox",disabled:s,checked:l,hidden:!0,readOnly:!0,required:C??!1}),l?j?r.jsx(ir,{}):r.jsx(at,{}):""]})},ur="Tag-module__tagContainer",cr="Tag-module__onlyLabel",dr="Tag-module__sm",fr="Tag-module__md",pr="Tag-module__lg",hr="Tag-module__tagLabel",_r="Tag-module__tagNumber",vr="Tag-module__tagClose",Te={tagContainer:ur,onlyLabel:cr,sm:dr,md:fr,lg:pr,tagLabel:hr,tagNumber:_r,tagClose:vr},it=({id:l,label:u,icon:s,withClose:C,withCheckbox:j,withNumber:f,number:w,checkboxProps:m,disable:c,size:_,onClose:a,tagContainerStyle:x,tagLabelStyle:E,tagNumberStyle:k,tagCloseStlye:T})=>{const D=()=>!j&&!s&&!C&&!f,H=()=>s,L=()=>{a&&typeof a=="function"&&a(l??null)};return r.jsxs("div",{style:x??{},className:`${Te.tagContainer} ${D()?Te.onlyLabel:""} ${Te[_??"md"]}`,children:[j&&r.jsx(lt,{...m}),s&&H(),u&&r.jsx("p",{style:E??{},className:Te.tagLabel,children:u??""}),f&&r.jsx("div",{style:k??{},className:Te.tagNumber,children:w??""}),C&&r.jsx("div",{style:T??{},className:Te.tagClose,onClick:L,children:r.jsx(st,{width:(T==null?void 0:T.width)??"14",height:(T==null?void 0:T.height)??"14",color:(T==null?void 0:T.color)??"#A4A7AE"})})]})},mr=({value:l,label:u,placeholder:s,required:C,disabled:j,type:f,size:w,onChange:m,onFouce:c,onBlur:_,msg:a,readOnly:x,maxLength:E,onlyText:k,tagValues:T,onRightIconIconClick:D,onRightIconIconMouseEnter:H,onRightIconIconMouseLeave:L,onLeftIconIconClick:g,onLeftIconIconMouseEnter:q,onLeftIconIconMouseLeave:S,onPressEnter:Q,rightIcon:ne,leftIcon:oe,withDropDown:ce,dropdownData:ee,onSelectData:de,withTags:Ee,tagProps:_e,withLink:M,withCopy:Y,onCopy:G,inputWrapperStyle:ke,inputLabelStyle:ve,requiredStyle:X,inputContainerStyle:se,leftIconStyle:I,inputDropDownStyle:te,ulStyle:z,liStyle:N,httpStyle:me,inputStyle:$e,rightIconStyle:U,withCopyStyle:fe,inputHelperTextStyle:re})=>{const[xe,ae]=h.useState(!1),Se=h.useRef(null),[ye,le]=h.useState(!1);h.useState(!1);const ie=h.useRef(null),n=h.useRef(null),[y,P]=h.useState(!1),[Z,be]=h.useState(1),We=d=>{let A=d.target.value;A.length===1&&(A=A.trim()),m&&typeof m=="function"&&m(k?A.replace(/\d/g,""):A)},Me=()=>{le(!0),c&&typeof c=="function"&&c()},Pe=()=>{le(!1),_&&typeof _=="function"&&_()},Ie=d=>{const A=d.target.value,qe=A.length===0;f==="number"&&(d.keyCode===69||!qe&&(d.keyCode===187||d.keyCode===107||d.keyCode===189||d.keyCode===109))&&d.preventDefault(),d.key==="Enter"&&A&&A.length>0&&Q&&typeof Q=="function"&&Q(A)},Be=()=>{G&&typeof G=="function"&&G(l)},Oe=d=>d,Ne=()=>{let d={};return Y&&(d.borderTopRightRadius=0,d.borderBottomRightRadius=0,d.borderRight=0),ce&&(d.paddingLeft=0),{...d,...se??{}}},ue=d=>{!d.composedPath().includes(n.current)&&d.composedPath().includes(ie.current)||P(!1)},He=d=>{be(d.id),P(!1),de&&typeof de=="function"&&de(d)};h.useEffect(()=>{l&&l.length===0&&calculateWidth()},[l]),h.useEffect(()=>(document.addEventListener("click",ue),()=>{document.removeEventListener("click",ue)}),[]);const Le=h.useRef(!1);return h.useEffect(()=>{Le.current?setTimeout(()=>{ae(d=>!d)},0):Le.current=!0},[]),r.jsxs("div",{className:F.inputWrapper,style:ke??{},children:[u&&r.jsxs("label",{className:F.inputLabel,style:ve??{},children:[u," ",r.jsx("span",{className:F.required,style:X??{},children:C&&"*"})]}),r.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[r.jsxs("div",{style:Ne(),className:`${F.inputContainer} ${ye&&!x?F.focused:""} ${j?F.disabled:""} ${a!=null&&a.error?F.error:""} ${F[w??"sm"]}`,children:[!ce&&!M&&oe&&r.jsx("div",{className:F.leftIcon,style:I??{},onClick:()=>{g&&typeof g=="function"&&g()},onMouseEnter:()=>{q&&typeof q=="function"&&q()},onMouseLeave:()=>{S&&typeof S=="function"&&S()},children:Oe(oe)}),!M&&ce&&r.jsxs("div",{className:F.inputDropDown,style:te??{},onClick:()=>P(!0),ref:ie,children:[ee.find(d=>d.id===Z).label,y&&r.jsx("ul",{ref:n,style:z??{},children:ee&&ee.length&&ee.map((d,A)=>r.jsx("li",{style:N??{},onClick:()=>He(d),children:(d==null?void 0:d.label)??"-"},d.id))}),r.jsx(ot,{})]}),M&&r.jsx("div",{className:`${F.inputDropDown} ${F.http}`,style:me??{},onClick:()=>P(!0),ref:ie,children:"http://"}),r.jsxs("div",{className:F.inputContent,children:[Ee&&T&&T.length>0&&r.jsx("div",{className:F.inputTags,children:T.map((d,A)=>r.jsx("div",{className:F.inputSingleTags,children:r.jsx(it,{..._e,id:d,label:d,withClose:!0})},A))}),r.jsx("input",{ref:Se,style:$e??{},type:f??"text",value:l,onChange:d=>We(d),onFocus:Me,onBlur:Pe,disabled:j,required:C,onKeyDown:Ie,readOnly:x,spellCheck:!1,placeholder:s??"",autoComplete:"off",maxLength:E})]}),ne&&r.jsx("div",{className:F.rightIcon,style:U??{},onClick:()=>{D&&typeof D=="function"&&D()},onMouseEnter:()=>{H&&typeof H=="function"&&H()},onMouseLeave:()=>{L&&typeof L=="function"&&L()},children:Oe(ne)})]}),Y&&r.jsxs("div",{style:fe??{},onClick:Be,className:F.withCopy,children:[r.jsx(tr,{}),"Copy"]})]}),a&&(a==null?void 0:a.visible)&&r.jsx("div",{style:re??{},className:`${F.inputHelperText} ${a!=null&&a.error?F.error:""}`,children:r.jsx("p",{style:(a==null?void 0:a.style)??{},children:a.text})})]})},xr="Textarea-module__textareaContainer",yr="Textarea-module__textAreaLabel",br="Textarea-module__required",gr="Textarea-module__wrap",Cr="Textarea-module__textarea",jr="Textarea-module__focused",wr="Textarea-module__disabled",Tr="Textarea-module__error",Rr="Textarea-module__helperTextStyle",J={textareaContainer:xr,textAreaLabel:yr,required:br,wrap:gr,textarea:Cr,focused:jr,disabled:wr,error:Tr,helperTextStyle:Rr},Er=({width:l,height:u,color:s})=>r.jsxs("svg",{width:l??"16",height:u??"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("g",{id:"help-circle",clipPath:"url(#clip0_433_6293)",children:r.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:s??"#A4A7AE",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),r.jsx("defs",{children:r.jsx("clipPath",{id:"clip0_433_6293",children:r.jsx("rect",{width:l??"16",height:u??"16",fill:"white"})})})]}),kr=({placeholder:l,label:u,msg:s,cols:C,rows:j,value:f,maxLength:w,onChange:m,onFocus:c,onBlur:_,disabled:a,required:x,textareaContainerStyle:E,textareaLabelStyle:k,requiredStyle:T,textareaStyle:D,textareaHelperTextStyle:H})=>{const[L,g]=h.useState(!1),q=ne=>{let oe=ne.target.value;m&&typeof m=="function"&&m(oe)},S=()=>{g(!0),c&&typeof c=="function"&&c()},Q=()=>{g(!1),_&&typeof _=="function"&&_()};return r.jsxs("div",{style:E??{},className:`${J.textareaContainer} ${s!=null&&s.type&&(s!=null&&s.visible)?J[s==null?void 0:s.type]:""} ${a?J.disabled:null}`,children:[u&&r.jsxs("div",{style:k,className:J.textAreaLabel,children:[r.jsx("p",{children:u}),r.jsx("span",{style:T??{},className:J.required,children:x&&"*"}),r.jsx(Er,{})]}),r.jsx("div",{className:J.wrap,children:r.jsx("textarea",{style:D??{},className:`${J.textarea} ${L?J.focused:""} ${a?J.disabled:""} ${s!=null&&s.error?J.error:""}`,value:f,placeholder:l??"",cols:C??"30",rows:j??"5",maxLength:w??null,onFocus:S,disabled:a,onBlur:Q,onChange:q})}),r.jsx("div",{style:H??{},className:`${J.helperTextStyle} ${s!=null&&s.error?J.error:""}`,children:r.jsx("p",{style:(s==null?void 0:s.style)??{},children:s.text})})]})},$r="Toggle-module__toggleWrapper",Sr="Toggle-module__toggleState",Pr="Toggle-module__checked",Or="Toggle-module__disabled",Ae={toggleWrapper:$r,toggleState:Sr,checked:Pr,disabled:Or},Lr=({checked:l,change:u,disabled:s,required:C,activeStyle:j,bgStyle:f,checkedBgStyle:w,disabledBgStyle:m,circleStyle:c,checkedCircleStyle:_,disabledCircleStyle:a})=>{const[x,E]=h.useState(!1),k=()=>{u&&typeof u=="function"&&u(!l)},T=()=>{if(x)return j??{};if(l){if(w)return w}else if(l){if(s&&m)return m}else if(f)return f;return{}},D=()=>{if(l){if(_)return _}else if(l){if(s&&a)return a}else if(c)return c;return{}};return r.jsx("div",{style:T(),onMouseDown:()=>E(!0),onMouseUp:()=>E(!1),onMouseLeave:()=>E(!1),onClick:k,className:`${Ae.toggleWrapper} ${l?Ae.checked:""} ${s?Ae.disabled:""}`,children:r.jsx("div",{style:D(),className:Ae.toggleState,children:r.jsx("input",{type:"checkbox",checked:l,readOnly:!0,disabled:s??!1,hidden:!0,required:C??!1})})})},Fr="Radio-module__radioWrapper",Dr="Radio-module__sm",Nr="Radio-module__md",Ar="Radio-module__checked",Wr="Radio-module__innerCircle",Mr="Radio-module__radioState",Ir="Radio-module__disabled",he={radioWrapper:Fr,sm:Dr,md:Nr,checked:Ar,innerCircle:Wr,radioState:Mr,disabled:Ir},Br=({checked:l,change:u,disabled:s,isRequired:C,withUncheckState:j,size:f})=>{h.useState(!1);const w=()=>{u&&typeof u=="function"&&(j||!j&&!l)&&u(!0)};return r.jsxs("div",{className:`${he.radioWrapper} ${he[f]??he.md} ${l?he.checked:""} ${s?he.disabled:""}`,onClick:w,children:[r.jsx("input",{type:"radio",checked:!0,readOnly:!0,hidden:!0,disabled:s??!1,required:C??!1}),r.jsx("div",{className:he.radioState,children:r.jsx("div",{className:he.innerCircle})})]})},Hr="Dropdown-module__dropdownWrapper",qr="Dropdown-module__placeHolder",Vr="Dropdown-module__dropdownLabel",Yr="Dropdown-module__required",Ur="Dropdown-module__dropdownContainer",Kr="Dropdown-module__sm",Jr="Dropdown-module__md",Gr="Dropdown-module__selectedTags",Xr="Dropdown-module__selectedList",zr="Dropdown-module__additional",Zr="Dropdown-module__dropdownList",Qr="Dropdown-module__disabled",en="Dropdown-module__selected",tn="Dropdown-module__focused",rn="Dropdown-module__error",nn="Dropdown-module__dropdownHelperText",W={dropdownWrapper:Hr,placeHolder:qr,dropdownLabel:Vr,required:Yr,dropdownContainer:Ur,sm:Kr,md:Jr,selectedTags:Gr,selectedList:Xr,additional:zr,dropdownList:Zr,disabled:Qr,selected:en,focused:tn,error:rn,dropdownHelperText:nn},on=({label:l,disabled:u,required:s,size:C="md",placeholder:j="placeholder",msg:f,readOnly:w,data:m,onSelect:c,selectedOptionID:_,withFilter:a,onSearch:x,pagination:E,withMultiSelect:k=!1,skipSelected:T,labelIcon:D,closeIcon:H,iconDown:L,onLabelIconClick:g,onLabelIconMouseEnter:q,onLabelIconMouseLeave:S,dropdownWrapperStyle:Q,dropdownLabelStyle:ne,requiredStyle:oe,labelIconStyle:ce,dropdownContainerStyle:ee,placeHolderStyle:de,selectedTagsStyle:Ee,selectedListStyle:_e,additionalStyle:M,dropdownListStyle:Y,listStyle:G})=>{const[ke,ve]=h.useState(!1),[X,se]=h.useState(!1),I=h.useRef(m),[te,z]=h.useState("");h.useState(null);const N=h.useRef([]),me=h.useRef(null),$e=h.useRef(null),U=h.useRef({}),fe=(n,y)=>{const P=new Set;return n.filter(Z=>P.has(Z[y])?!1:(P.add(Z[y]),!0))},re=n=>{var y;I.current.forEach(P=>{n.id===P.id?P.selected=!0:P.selected=!1}),U.current=n,z((y=U.current)==null?void 0:y.label),c&&typeof c=="function"&&c(U.current),se(!1)},xe=n=>{N.current=[...N.current,...I.current.filter(y=>y.id===n.id)],n.selected=!n.selected,N.current=fe(N.current,"id").filter(y=>y.selected),c&&typeof c=="function"&&c(N.current),z(N.current.map(y=>y.label).join(", ")),ve(y=>!y)},ae=n=>{n.stopPropagation(),N.current=[],_=null,I.current&&I.current.length>0&&m.forEach(y=>y.selected=!1),c(k?[]:{}),z("")},Se=n=>{if(a&&!E)if(n&&n.length>0){let y=I.current.filter(P=>{var Z;return(Z=P==null?void 0:P.label)==null?void 0:Z.toLowerCase().includes(n.toLowerCase())});I.current=y}else I.current=m;x&&typeof x=="function"&&x(n),z(n)},ye=()=>{if(_||_===0){let n=m.filter(y=>Number(y.id)===Number(_));n&&n[0]&&(U.current=n[0],T?(x&&typeof x=="function"&&x(U.current.label),z(U.current.label),closeOnSelect&&setCollapsed(y=>!1),withDropdownSearch&&DropdownSearchValue&&SetDropdownSearchValue("")):re(n[0]))}},le=n=>n,ie=n=>{n.composedPath().includes(me.current)||se(!1)};return h.useEffect(()=>{k||ye()},[_]),h.useEffect(()=>(document.addEventListener("click",ie),()=>{document.removeEventListener("click",ie)}),[]),r.jsxs("div",{className:W.dropdownWrapper,style:Q??{},children:[l&&r.jsxs("label",{className:W.dropdownLabel,style:ne??{},children:[l," ",r.jsx("span",{className:W.required,style:oe??{},children:s&&"*"}),r.jsxs("span",{style:{...ce??{},display:"grid",placeItems:"center"},onClick:()=>{g&&typeof g=="function"&&g()},onMouseEnter:()=>{q&&typeof q=="function"&&q()},onMouseLeave:()=>{S&&typeof S=="function"&&S()},children:[" ",le(D)]})]}),r.jsxs("div",{ref:me,onClick:()=>se(n=>!n),className:`${W.dropdownContainer} ${X&&!w?W.focused:""} ${u?W.disabled:""} ${f!=null&&f.error?W.error:""} ${W[C]}`,style:ee??{},children:[r.jsx("span",{className:W.placeHolder,style:de??{},children:te&&te.length>0?"":j}),k&&r.jsxs("div",{className:W.selectedTags,style:Ee??{},children:[N.current.slice(0,3).map((n,y)=>{let P=N.current[N.current.length-1];return r.jsxs("span",{className:W.selectedList,style:_e??{},children:[n.label,n.id!==P.id&&y!==2?", ":""]},n==null?void 0:n.id)}),N.current.length>3&&r.jsxs("span",{className:W.additional,style:M??{},children:[" ","+(",N.current.length-3,")"]})]}),r.jsx("input",{autoCorrect:"off",hidden:k,readOnly:!a||!X||k,type:"text",value:te,onChange:n=>Se(n.target.value)},_),X&&I.current&&I.current.length>0&&r.jsx("ul",{onClick:n=>n.stopPropagation(),ref:$e,className:W.dropdownList,style:Y??{},children:I.current.map(n=>r.jsxs("li",{style:G??{},className:`${!(n!=null&&n.label)||n.label===void 0||n!=null&&n.disabled?W.disabled:""} ${n!=null&&n.selected?W.selected:""}`,onClick:()=>{k?xe(n):re(n)},children:[r.jsxs("p",{children:[" ",n!=null&&n.label?typeof n.label=="function"?n.label():n.label:"-"]}),(n==null?void 0:n.selected)&&r.jsx("span",{children:r.jsx(at,{color:"#7F56D9",width:20,height:20})})]},n==null?void 0:n.id))}),(N.current.length>0||te.length)>0&&r.jsx("div",{onClick:n=>ae(n),style:{display:"grid",placeItems:"center",cursor:"pointer"},children:H?le(H):r.jsx(st,{width:16,height:16})}),r.jsx("div",{style:{display:"grid",placeItems:"center",transform:X?"rotate(180deg)":"",transition:"transform 0.2s ease-in-out",cursor:"pointer",marginLeft:"10px"},children:L?le(L):r.jsx(ot,{})})]}),f&&(f==null?void 0:f.visible)&&r.jsx("div",{className:`${W.dropdownHelperText} ${f!=null&&f.error?W.error:""}`,children:!X&&r.jsx("p",{style:(f==null?void 0:f.style)??{},children:f.text})})]})},sn="Tooltip-module__tooltipContainer",an="Tooltip-module__tooltipContent",ln="Tooltip-module__top",un="Tooltip-module__right",cn="Tooltip-module__bottom",dn="Tooltip-module__left",fn="Tooltip-module__tooltipTitle",pn="Tooltip-module__tooltipText",Re={tooltipContainer:sn,tooltipContent:an,top:ln,right:un,bottom:cn,left:dn,tooltipTitle:fn,tooltipText:pn},hn=({children:l,tooltipSlot:u,delay:s,placement:C="top",trigger:j="click",title:f,text:w,tooltipContentStyle:m,tooltipTitlestyle:c,tooltipTextStyle:_,pointerPosition:a="10%"})=>{const x=h.useRef(null),E=h.useRef(null);let k;const[T,D]=h.useState(!1),H=()=>{j==="hover"&&(k=setTimeout(()=>{D(!0)},s||400))},L=()=>{j==="hover"&&(clearInterval(k),D(!1))},g=()=>{j==="click"&&D(S=>!S)},q=S=>{S.composedPath().includes(x.current)||D(!1)};return h.useEffect(()=>(document.addEventListener("click",q),()=>{document.removeEventListener("click",q)}),[]),h.useEffect(()=>{const S=E.current;S&&S.style.setProperty("--pointer-position",`${a}`)},[T]),r.jsxs("div",{ref:x,className:Re.tooltipContainer,onClick:g,onMouseEnter:H,onMouseLeave:L,children:[l,T&&u?u():T&&r.jsxs("div",{onClick:S=>S.stopPropagation(),ref:E,style:m??{},className:`${Re.tooltipContent} ${C?Re[C]:Re.bottom}`,children:[f&&f.length>0&&r.jsx("h2",{className:Re.tooltipTitle,style:c??{},children:f}),w&&w.length>0&&r.jsx("p",{className:Re.tooltipText,style:_??{},children:w})]})]})};exports.Checkbox=lt;exports.Dropdown=on;exports.FormInput=mr;exports.MainButton=At;exports.Radio=Br;exports.Tag=it;exports.Textarea=kr;exports.Toggle=Lr;exports.Tooltip=hn;
|
|
31
|
+
<%s key={someKey} {...props} />`,Ke,pe,jt,pe),et[pe+Ke]=!0}}return e===C?xt(O):mt(O),O}}function yt(e,t,o){return tt(e,t,o,!0)}function bt(e,t,o){return tt(e,t,o,!1)}var gt=bt,Ct=yt;De.Fragment=C,De.jsx=gt,De.jsxs=Ct}()),De}process.env.NODE_ENV==="production"?Je.exports=Tt():Je.exports=Rt();var r=Je.exports;const Et="MainButton-module__mainButton",kt="MainButton-module__sm",$t="MainButton-module__onlyIcon",St="MainButton-module__buttonSlot",Pt="MainButton-module__buttonLabel",Ot="MainButton-module__md",Lt="MainButton-module__lg",Ft="MainButton-module__xl",Dt="MainButton-module__xl2",Nt="MainButton-module__disabled",je={mainButton:Et,sm:kt,onlyIcon:$t,buttonSlot:St,buttonLabel:Pt,md:Ot,lg:Lt,xl:Ft,xl2:Dt,disabled:Nt},At=({label:l,buttonType:u="button",onClick:s,size:C="md",disabled:j,withIcons:f,iconOne:w,iconTwo:m,onlyIcon:c,buttonStyle:_,labelStyle:a,buttonSlotStyle:x})=>r.jsx("button",{type:u,style:_&&typeof _=="object"?_:{},className:`${je.mainButton} ${c?je.onlyIcon:""} ${C?je[C]:""} ${j?je.disabled:""}`,onClick:()=>{s&&typeof s=="function"&&s()},children:r.jsxs("div",{className:je.buttonSlot,style:x??{},children:[c||f&&w?w:"",!c&&r.jsx("span",{style:a??{},className:je.buttonLabel,children:l??"Button"}),f&&m?m:""]})}),Wt="FormInput-module__inputWrapper",Mt="FormInput-module__inputLabel",It="FormInput-module__required",Bt="FormInput-module__inputContainer",Ht="FormInput-module__inputContent",qt="FormInput-module__inputTags",Vt="FormInput-module__focused",Yt="FormInput-module__error",Ut="FormInput-module__rightIcon",Kt="FormInput-module__leftIcon",Jt="FormInput-module__inputDropDown",Gt="FormInput-module__http",Xt="FormInput-module__disabled",zt="FormInput-module__sm",Zt="FormInput-module__md",Qt="FormInput-module__withCopy",er="FormInput-module__inputHelperText",F={inputWrapper:Wt,inputLabel:Mt,required:It,inputContainer:Bt,inputContent:Ht,inputTags:qt,focused:Vt,error:Yt,rightIcon:Ut,leftIcon:Kt,inputDropDown:Jt,http:Gt,disabled:Xt,sm:zt,md:Zt,withCopy:Qt,inputHelperText:er},ot=({width:l,height:u,color:s})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:l??"12",height:u??"8",viewBox:"0 0 12 8",fill:"none",children:r.jsx("path",{d:"M1 1.5L6 6.5L11 1.5",stroke:s??"#A4A7AE",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),tr=({width:l,height:u,color:s})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:l??"20",height:u??"20",viewBox:"0 0 20 20",fill:"none",children:[r.jsx("g",{clipPath:"url(#clip0_444_26)",children:r.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:s??"#414651",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),r.jsx("defs",{children:r.jsx("clipPath",{id:"clip0_444_26",children:r.jsx("rect",{width:"20",height:"20",fill:"white"})})})]}),st=({width:l,height:u,color:s})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:l??"14",height:u??"14",viewBox:"0 0 14 14",fill:"none",children:r.jsx("path",{d:"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5",stroke:s??"#A4A7AE",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),rr="Checkbox-module__checkboxWrapper",nr="Checkbox-module__sm",or="Checkbox-module__md",sr="Checkbox-module__checkMark",ar="Checkbox-module__checked",lr="Checkbox-module__disabled",we={checkboxWrapper:rr,sm:nr,md:or,checkMark:sr,checked:ar,disabled:lr},at=({color:l,width:u,height:s})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:u??"12",height:s??"12",viewBox:"0 0 12 12",fill:"none",children:r.jsx("path",{d:"M10 3L4.5 8.5L2 6",stroke:l??"white",strokeWidth:"1.6666",strokeLinecap:"round",strokeLinejoin:"round"})}),ir=l=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...l,width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:r.jsx("path",{d:"M1.5 1H8.5",stroke:"white",strokeWidth:"1.66666",strokeLinecap:"round",strokeLinejoin:"round"})}),lt=({checked:l,change:u,disabled:s,required:C,multipleChecked:j,size:f,activeStyle:w,checkBoxStyle:m})=>{const c=h.useRef(null),[_,a]=h.useState(!1),x=()=>{u&&typeof u=="function"&&u(!l)},E=()=>_?w??{}:m??{};return r.jsxs("div",{style:E(),className:`${we.checkboxWrapper} ${we[f]??we.md} ${l?we.checked:we.unChecked} ${s?we.disabled:""}`,onMouseDown:()=>a(!0),onMouseUp:()=>a(!1),onMouseLeave:()=>a(!1),onClick:x,children:[r.jsx("input",{ref:c,type:"checkbox",disabled:s,checked:l,hidden:!0,readOnly:!0,required:C??!1}),l?j?r.jsx(ir,{}):r.jsx(at,{}):""]})},ur="Tag-module__tagContainer",cr="Tag-module__onlyLabel",dr="Tag-module__sm",fr="Tag-module__md",pr="Tag-module__lg",hr="Tag-module__tagLabel",_r="Tag-module__tagNumber",vr="Tag-module__tagClose",Te={tagContainer:ur,onlyLabel:cr,sm:dr,md:fr,lg:pr,tagLabel:hr,tagNumber:_r,tagClose:vr},it=({id:l,label:u,icon:s,withClose:C,withCheckbox:j,withNumber:f,number:w,checkboxProps:m,disable:c,size:_,onClose:a,tagContainerStyle:x,tagLabelStyle:E,tagNumberStyle:k,tagCloseStlye:T})=>{const D=()=>!j&&!s&&!C&&!f,H=()=>s,L=()=>{a&&typeof a=="function"&&a(l??null)};return r.jsxs("div",{style:x??{},className:`${Te.tagContainer} ${D()?Te.onlyLabel:""} ${Te[_??"md"]}`,children:[j&&r.jsx(lt,{...m}),s&&H(),u&&r.jsx("p",{style:E??{},className:Te.tagLabel,children:u??""}),f&&r.jsx("div",{style:k??{},className:Te.tagNumber,children:w??""}),C&&r.jsx("div",{style:T??{},className:Te.tagClose,onClick:L,children:r.jsx(st,{width:(T==null?void 0:T.width)??"14",height:(T==null?void 0:T.height)??"14",color:(T==null?void 0:T.color)??"#A4A7AE"})})]})},mr=({value:l,label:u,placeholder:s,required:C,disabled:j,type:f,size:w,onChange:m,onFouce:c,onBlur:_,msg:a,readOnly:x,maxLength:E,onlyText:k,tagValues:T,onRightIconIconClick:D,onRightIconIconMouseEnter:H,onRightIconIconMouseLeave:L,onLeftIconIconClick:g,onLeftIconIconMouseEnter:q,onLeftIconIconMouseLeave:S,onPressEnter:Q,rightIcon:ne,leftIcon:oe,withDropDown:ce,dropdownData:ee,onSelectData:de,withTags:Ee,tagProps:_e,withLink:M,withCopy:Y,onCopy:G,inputWrapperStyle:ke,inputLabelStyle:ve,requiredStyle:X,inputContainerStyle:se,leftIconStyle:I,inputDropDownStyle:te,ulStyle:z,liStyle:N,httpStyle:me,inputStyle:$e,rightIconStyle:U,withCopyStyle:fe,inputHelperTextStyle:re})=>{const[xe,ae]=h.useState(!1),Se=h.useRef(null),[ye,le]=h.useState(!1);h.useState(!1);const ie=h.useRef(null),n=h.useRef(null),[y,P]=h.useState(!1),[Z,be]=h.useState(1),We=d=>{let A=d.target.value;A.length===1&&(A=A.trim()),m&&typeof m=="function"&&m(k?A.replace(/\d/g,""):A)},Me=()=>{le(!0),c&&typeof c=="function"&&c()},Pe=()=>{le(!1),_&&typeof _=="function"&&_()},Ie=d=>{const A=d.target.value,qe=A.length===0;f==="number"&&(d.keyCode===69||!qe&&(d.keyCode===187||d.keyCode===107||d.keyCode===189||d.keyCode===109))&&d.preventDefault(),d.key==="Enter"&&A&&A.length>0&&Q&&typeof Q=="function"&&Q(A)},Be=()=>{G&&typeof G=="function"&&G(l)},Oe=d=>d,Ne=()=>{let d={};return Y&&(d.borderTopRightRadius=0,d.borderBottomRightRadius=0,d.borderRight=0),ce&&(d.paddingLeft=0),{...d,...se??{}}},ue=d=>{!d.composedPath().includes(n.current)&&d.composedPath().includes(ie.current)||P(!1)},He=d=>{be(d.id),P(!1),de&&typeof de=="function"&&de(d)};h.useEffect(()=>{l&&l.length===0&&calculateWidth()},[l]),h.useEffect(()=>(document.addEventListener("click",ue),()=>{document.removeEventListener("click",ue)}),[]);const Le=h.useRef(!1);return h.useEffect(()=>{Le.current?setTimeout(()=>{ae(d=>!d)},0):Le.current=!0},[]),r.jsxs("div",{className:F.inputWrapper,style:ke??{},children:[u&&r.jsxs("label",{className:F.inputLabel,style:ve??{},children:[u," ",r.jsx("span",{className:F.required,style:X??{},children:C&&"*"})]}),r.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[r.jsxs("div",{style:Ne(),className:`${F.inputContainer} ${ye&&!x?F.focused:""} ${j?F.disabled:""} ${a!=null&&a.error?F.error:""} ${F[w??"sm"]}`,children:[!ce&&!M&&oe&&r.jsx("div",{className:F.leftIcon,style:I??{},onClick:()=>{g&&typeof g=="function"&&g()},onMouseEnter:()=>{q&&typeof q=="function"&&q()},onMouseLeave:()=>{S&&typeof S=="function"&&S()},children:Oe(oe)}),!M&&ce&&r.jsxs("div",{className:F.inputDropDown,style:te??{},onClick:()=>P(!0),ref:ie,children:[ee.find(d=>d.id===Z).label,y&&r.jsx("ul",{ref:n,style:z??{},children:ee&&ee.length&&ee.map((d,A)=>r.jsx("li",{style:N??{},onClick:()=>He(d),children:(d==null?void 0:d.label)??"-"},d.id))}),r.jsx(ot,{})]}),M&&r.jsx("div",{className:`${F.inputDropDown} ${F.http}`,style:me??{},onClick:()=>P(!0),ref:ie,children:"http://"}),r.jsxs("div",{className:F.inputContent,children:[Ee&&T&&T.length>0&&r.jsx("div",{className:F.inputTags,children:T.map((d,A)=>r.jsx("div",{className:F.inputSingleTags,children:r.jsx(it,{..._e,id:d,label:d,withClose:!0})},A))}),r.jsx("input",{ref:Se,style:$e??{},type:f??"text",value:l,onChange:d=>We(d),onFocus:Me,onBlur:Pe,disabled:j,required:C,onKeyDown:Ie,readOnly:x,spellCheck:!1,placeholder:s??"",autoComplete:"off",maxLength:E})]}),ne&&r.jsx("div",{className:F.rightIcon,style:U??{},onClick:()=>{D&&typeof D=="function"&&D()},onMouseEnter:()=>{H&&typeof H=="function"&&H()},onMouseLeave:()=>{L&&typeof L=="function"&&L()},children:Oe(ne)})]}),Y&&r.jsxs("div",{style:fe??{},onClick:Be,className:F.withCopy,children:[r.jsx(tr,{}),"Copy"]})]}),a&&(a==null?void 0:a.visible)&&r.jsx("div",{style:re??{},className:`${F.inputHelperText} ${a!=null&&a.error?F.error:""}`,children:r.jsx("p",{style:(a==null?void 0:a.style)??{},children:a.text})})]})},xr="Textarea-module__textareaContainer",yr="Textarea-module__textAreaLabel",br="Textarea-module__required",gr="Textarea-module__wrap",Cr="Textarea-module__textarea",jr="Textarea-module__focused",wr="Textarea-module__disabled",Tr="Textarea-module__error",Rr="Textarea-module__helperTextStyle",J={textareaContainer:xr,textAreaLabel:yr,required:br,wrap:gr,textarea:Cr,focused:jr,disabled:wr,error:Tr,helperTextStyle:Rr},Er=({width:l,height:u,color:s})=>r.jsxs("svg",{width:l??"16",height:u??"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("g",{id:"help-circle",clipPath:"url(#clip0_433_6293)",children:r.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:s??"#A4A7AE",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),r.jsx("defs",{children:r.jsx("clipPath",{id:"clip0_433_6293",children:r.jsx("rect",{width:l??"16",height:u??"16",fill:"white"})})})]}),kr=({placeholder:l,label:u,msg:s,cols:C,rows:j,value:f,maxLength:w,onChange:m,onFocus:c,onBlur:_,disabled:a,required:x,textareaContainerStyle:E,textareaLabelStyle:k,requiredStyle:T,textareaStyle:D,textareaHelperTextStyle:H})=>{const[L,g]=h.useState(!1),q=ne=>{let oe=ne.target.value;m&&typeof m=="function"&&m(oe)},S=()=>{g(!0),c&&typeof c=="function"&&c()},Q=()=>{g(!1),_&&typeof _=="function"&&_()};return r.jsxs("div",{style:E??{},className:`${J.textareaContainer} ${s!=null&&s.type&&(s!=null&&s.visible)?J[s==null?void 0:s.type]:""} ${a?J.disabled:null}`,children:[u&&r.jsxs("div",{style:k,className:J.textAreaLabel,children:[r.jsx("p",{children:u}),r.jsx("span",{style:T??{},className:J.required,children:x&&"*"}),r.jsx(Er,{})]}),r.jsx("div",{className:J.wrap,children:r.jsx("textarea",{style:D??{},className:`${J.textarea} ${L?J.focused:""} ${a?J.disabled:""} ${s!=null&&s.error?J.error:""}`,value:f,placeholder:l??"",cols:C??"30",rows:j??"5",maxLength:w??null,onFocus:S,disabled:a,onBlur:Q,onChange:q})}),r.jsx("div",{style:H??{},className:`${J.helperTextStyle} ${s!=null&&s.error?J.error:""}`,children:r.jsx("p",{style:(s==null?void 0:s.style)??{},children:s.text})})]})},$r="Toggle-module__toggleWrapper",Sr="Toggle-module__toggleState",Pr="Toggle-module__checked",Or="Toggle-module__disabled",Ae={toggleWrapper:$r,toggleState:Sr,checked:Pr,disabled:Or},Lr=({checked:l,change:u,disabled:s,required:C,activeStyle:j,bgStyle:f,checkedBgStyle:w,disabledBgStyle:m,circleStyle:c,checkedCircleStyle:_,disabledCircleStyle:a})=>{const[x,E]=h.useState(!1),k=()=>{u&&typeof u=="function"&&u(!l)},T=()=>{if(x)return j??{};if(l){if(w)return w}else if(l){if(s&&m)return m}else if(f)return f;return{}},D=()=>{if(l){if(_)return _}else if(l){if(s&&a)return a}else if(c)return c;return{}};return r.jsx("div",{style:T(),onMouseDown:()=>E(!0),onMouseUp:()=>E(!1),onMouseLeave:()=>E(!1),onClick:k,className:`${Ae.toggleWrapper} ${l?Ae.checked:""} ${s?Ae.disabled:""}`,children:r.jsx("div",{style:D(),className:Ae.toggleState,children:r.jsx("input",{type:"checkbox",checked:l,readOnly:!0,disabled:s??!1,hidden:!0,required:C??!1})})})},Fr="Radio-module__radioWrapper",Dr="Radio-module__sm",Nr="Radio-module__md",Ar="Radio-module__checked",Wr="Radio-module__innerCircle",Mr="Radio-module__radioState",Ir="Radio-module__disabled",he={radioWrapper:Fr,sm:Dr,md:Nr,checked:Ar,innerCircle:Wr,radioState:Mr,disabled:Ir},Br=({checked:l,change:u,disabled:s,isRequired:C,withUncheckState:j,size:f})=>{h.useState(!1);const w=()=>{u&&typeof u=="function"&&(j||!j&&!l)&&u(!0)};return r.jsxs("div",{className:`${he.radioWrapper} ${he[f]??he.md} ${l?he.checked:""} ${s?he.disabled:""}`,onClick:w,children:[r.jsx("input",{type:"radio",checked:!0,readOnly:!0,hidden:!0,disabled:s??!1,required:C??!1}),r.jsx("div",{className:he.radioState,children:r.jsx("div",{className:he.innerCircle})})]})},Hr="Dropdown-module__dropdownWrapper",qr="Dropdown-module__placeHolder",Vr="Dropdown-module__dropdownLabel",Yr="Dropdown-module__required",Ur="Dropdown-module__dropdownContainer",Kr="Dropdown-module__sm",Jr="Dropdown-module__md",Gr="Dropdown-module__selectedTags",Xr="Dropdown-module__selectedList",zr="Dropdown-module__additional",Zr="Dropdown-module__dropdownList",Qr="Dropdown-module__disabled",en="Dropdown-module__selected",tn="Dropdown-module__focused",rn="Dropdown-module__error",nn="Dropdown-module__dropdownHelperText",W={dropdownWrapper:Hr,placeHolder:qr,dropdownLabel:Vr,required:Yr,dropdownContainer:Ur,sm:Kr,md:Jr,selectedTags:Gr,selectedList:Xr,additional:zr,dropdownList:Zr,disabled:Qr,selected:en,focused:tn,error:rn,dropdownHelperText:nn},on=({label:l,disabled:u,required:s,size:C="md",placeholder:j="placeholder",msg:f,readOnly:w,data:m,onSelect:c,selectedOptionID:_,withFilter:a,onSearch:x,pagination:E,withMultiSelect:k=!1,skipSelected:T,labelIcon:D,closeIcon:H,iconDown:L,onLabelIconClick:g,onLabelIconMouseEnter:q,onLabelIconMouseLeave:S,dropdownWrapperStyle:Q,dropdownLabelStyle:ne,requiredStyle:oe,labelIconStyle:ce,dropdownContainerStyle:ee,placeHolderStyle:de,selectedTagsStyle:Ee,selectedListStyle:_e,additionalStyle:M,dropdownListStyle:Y,listStyle:G})=>{const[ke,ve]=h.useState(!1),[X,se]=h.useState(!1),I=h.useRef(m),[te,z]=h.useState("");h.useState(null);const N=h.useRef([]),me=h.useRef(null),$e=h.useRef(null),U=h.useRef({}),fe=(n,y)=>{const P=new Set;return n.filter(Z=>P.has(Z[y])?!1:(P.add(Z[y]),!0))},re=n=>{var y;I.current.forEach(P=>{n.id===P.id?P.selected=!0:P.selected=!1}),U.current=n,z((y=U.current)==null?void 0:y.label),c&&typeof c=="function"&&c(U.current),se(!1)},xe=n=>{N.current=[...N.current,...I.current.filter(y=>y.id===n.id)],n.selected=!n.selected,N.current=fe(N.current,"id").filter(y=>y.selected),c&&typeof c=="function"&&c(N.current),z(N.current.map(y=>y.label).join(", ")),ve(y=>!y)},ae=n=>{n.stopPropagation(),N.current=[],_=null,I.current&&I.current.length>0&&m.forEach(y=>y.selected=!1),c(k?[]:{}),z("")},Se=n=>{if(a&&!E)if(n&&n.length>0){let y=I.current.filter(P=>{var Z;return(Z=P==null?void 0:P.label)==null?void 0:Z.toLowerCase().includes(n.toLowerCase())});I.current=y}else I.current=m;x&&typeof x=="function"&&x(n),z(n)},ye=()=>{if(_||_===0){let n=m.filter(y=>Number(y.id)===Number(_));n&&n[0]&&(U.current=n[0],T?(x&&typeof x=="function"&&x(U.current.label),z(U.current.label),closeOnSelect&&setCollapsed(y=>!1),withDropdownSearch&&DropdownSearchValue&&SetDropdownSearchValue("")):re(n[0]))}},le=n=>n,ie=n=>{n.composedPath().includes(me.current)||se(!1)};return h.useEffect(()=>{k||ye()},[_]),h.useEffect(()=>(document.addEventListener("click",ie),()=>{document.removeEventListener("click",ie)}),[]),r.jsxs("div",{className:W.dropdownWrapper,style:Q??{},children:[l&&r.jsxs("label",{className:W.dropdownLabel,style:ne??{},children:[l," ",r.jsx("span",{className:W.required,style:oe??{},children:s&&"*"}),r.jsxs("span",{style:{...ce??{},display:"grid",placeItems:"center"},onClick:()=>{g&&typeof g=="function"&&g()},onMouseEnter:()=>{q&&typeof q=="function"&&q()},onMouseLeave:()=>{S&&typeof S=="function"&&S()},children:[" ",le(D)]})]}),r.jsxs("div",{ref:me,onClick:()=>se(n=>!n),className:`${W.dropdownContainer} ${X&&!w?W.focused:""} ${u?W.disabled:""} ${f!=null&&f.error?W.error:""} ${W[C]}`,style:ee??{},children:[r.jsx("span",{className:W.placeHolder,style:de??{},children:te&&te.length>0?"":j}),k&&r.jsxs("div",{className:W.selectedTags,style:Ee??{},children:[N.current.slice(0,3).map((n,y)=>{let P=N.current[N.current.length-1];return r.jsxs("span",{className:W.selectedList,style:_e??{},children:[n.label,n.id!==P.id&&y!==2?", ":""]},n==null?void 0:n.id)}),N.current.length>3&&r.jsxs("span",{className:W.additional,style:M??{},children:[" ","+(",N.current.length-3,")"]})]}),r.jsx("input",{autoCorrect:"off",hidden:k,readOnly:!a||!X||k,type:"text",value:te,onChange:n=>Se(n.target.value)},_),X&&I.current&&I.current.length>0&&r.jsx("ul",{onClick:n=>n.stopPropagation(),ref:$e,className:W.dropdownList,style:Y??{},children:I.current.map(n=>r.jsxs("li",{style:G??{},className:`${!(n!=null&&n.label)||n.label===void 0||n!=null&&n.disabled?W.disabled:""} ${n!=null&&n.selected?W.selected:""}`,onClick:()=>{k?xe(n):re(n)},children:[r.jsxs("p",{children:[" ",n!=null&&n.label?typeof n.label=="function"?n.label():n.label:"-"]}),(n==null?void 0:n.selected)&&r.jsx("span",{children:r.jsx(at,{color:"#7F56D9",width:20,height:20})})]},n==null?void 0:n.id))}),(N.current.length>0||te.length)>0&&r.jsx("div",{onClick:n=>ae(n),style:{display:"grid",placeItems:"center",cursor:"pointer"},children:H?le(H):r.jsx(st,{width:16,height:16})}),r.jsx("div",{style:{display:"grid",placeItems:"center",transform:X?"rotate(180deg)":"",transition:"transform 0.2s ease-in-out",cursor:"pointer",marginLeft:"10px"},children:L?le(L):r.jsx(ot,{})})]}),f&&(f==null?void 0:f.visible)&&r.jsx("div",{className:`${W.dropdownHelperText} ${f!=null&&f.error?W.error:""}`,children:!X&&r.jsx("p",{style:(f==null?void 0:f.style)??{},children:f.text})})]})},sn="Tooltip-module__tooltipContainer",an="Tooltip-module__tooltipContent",ln="Tooltip-module__top",un="Tooltip-module__right",cn="Tooltip-module__bottom",dn="Tooltip-module__left",fn="Tooltip-module__tooltipTitle",pn="Tooltip-module__tooltipText",Re={tooltipContainer:sn,tooltipContent:an,top:ln,right:un,bottom:cn,left:dn,tooltipTitle:fn,tooltipText:pn},hn=({children:l,tooltipSlot:u,delay:s,placement:C="top",trigger:j="hover",title:f,text:w,tooltipContentStyle:m,tooltipTitlestyle:c,tooltipTextStyle:_,pointerPosition:a="10%"})=>{const x=h.useRef(null),E=h.useRef(null);let k;const[T,D]=h.useState(!1),H=()=>{j==="hover"&&(k=setTimeout(()=>{D(!0)},s||400))},L=()=>{j==="hover"&&(clearInterval(k),D(!1))},g=()=>{j==="click"&&D(S=>!S)},q=S=>{S.composedPath().includes(x.current)||D(!1)};return h.useEffect(()=>(document.addEventListener("click",q),()=>{document.removeEventListener("click",q)}),[]),h.useEffect(()=>{const S=E.current;S&&S.style.setProperty("--pointer-position",`${a}`)},[T]),r.jsxs("div",{ref:x,className:Re.tooltipContainer,onClick:g,onMouseEnter:H,onMouseLeave:L,children:[l,T&&u?u():T&&r.jsxs("div",{onClick:S=>S.stopPropagation(),ref:E,style:m??{},className:`${Re.tooltipContent} ${C?Re[C]:Re.bottom}`,children:[f&&f.length>0&&r.jsx("h2",{className:Re.tooltipTitle,style:c??{},children:f}),w&&w.length>0&&r.jsx("p",{className:Re.tooltipText,style:_??{},children:w})]})]})};exports.Checkbox=lt;exports.Dropdown=on;exports.FormInput=mr;exports.MainButton=At;exports.Radio=Br;exports.Tag=it;exports.Textarea=kr;exports.Toggle=Lr;exports.Tooltip=hn;
|
|
@@ -1277,7 +1277,7 @@ const Er = "MainButton-module__mainButton", $r = "MainButton-module__sm", Pr = "
|
|
|
1277
1277
|
tooltipSlot: u,
|
|
1278
1278
|
delay: s,
|
|
1279
1279
|
placement: C = "top",
|
|
1280
|
-
trigger: g = "
|
|
1280
|
+
trigger: g = "hover",
|
|
1281
1281
|
title: f,
|
|
1282
1282
|
text: j,
|
|
1283
1283
|
tooltipContentStyle: v,
|