@tap-payments/os-micro-frontend-shared 0.3.311 → 0.3.312
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.
- package/build/_chunks/chunk-A3T5KTSC.js +1 -0
- package/build/_chunks/{chunk-Z4TV4GWV.js → chunk-FXXY2XGL.js} +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/Select/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/datetime/components/index.js +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/build/_chunks/chunk-2MGV5XP4.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {n,j,k,l,h,f,b,g,i,m as m$1,c,e,d}from'./chunk-Z7GYOTVN.js';import {Y,W,X,a,Z,k as k$1,O,R,b as b$1,$,P,S,T,U,V,F,m,aa,L,M,ca,ba as ba$1,c as c$1,Q,N,I,G,H,_,J,K}from'./chunk-PI263RZJ.js';import {ba}from'./chunk-Z6D3LMCU.js';import {Ub,Eb,Db}from'./chunk-XBJ4RS2B.js';import {forwardRef,useState,useRef,useCallback,useMemo,memo}from'react';import me from'@mui/material/Box';import Dt from'@mui/material/InputLabel';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function Tt({endAdornmentProp:h,isLoading:a$1,showClear:S,showMenuArrow:u,menuOpen:b,ClearIconComponent:c=aa,ChevronIconComponent:d=ba$1,onClear:m,onClearDefault:D}){if(!h&&!S&&!a$1&&!u)return null;let y=g=>{g.preventDefault(),g.stopPropagation(),m?m():D();};return jsxs(me,{className:Eb("Select-endAdornmentRoot",a$1&&"Select-endAdornmentRoot--loading",a.endAdornment),component:"span",children:[h,a$1?jsx(me,{component:"span",className:Eb("Select-menuTriggerIcon Select-menuTriggerIcon--loading",a.loading),"aria-hidden":true,children:jsx(ca,{})}):null,!a$1&&S?jsx(me,{component:"button",className:"Select-clearIconButton","data-select-clear":"",type:"button",tabIndex:0,"aria-label":"Clear selection",onMouseDown:y,onClick:y,children:jsx(c,{})}):null,!a$1&&u?jsx(me,{component:"span",className:Eb("Select-menuTriggerIcon",b&&"Select-menuTriggerIcon-open",a.chevron),"aria-hidden":true,children:jsx(d,{})}):null]})}var Lt=forwardRef(function({isMultiple:a$1=false,options:S,value:u,onChange:b,label:c="",disabled:d,required:m,hasError:D=false,helperText:y,feedback:g,showClearIcon:q=false,ClearIconComponent:fe,ChevronIconComponent:Q,onClear:j$1,isLoading:F,MenuProps:z,children:he,id:J="Select",className:X$1,open:w,onOpen:Y$1,onClose:T,name:Z$1,inputProps:x,endAdornment:_,renderValue:L,valueAlignment:ee},C){let[be,te]=useState(false),O=w??be,A=!!(d||F),{isProvided:le,isVisible:B,type:ne}=Ub(g),$=`${J}-label`,H=Array.isArray(u)?u:u!=null?[u]:[],G=useRef(null),R=useCallback((t,k)=>{k?Y$1?.(t):T?.(t),w===void 0&&te(k);},[Y$1,T,w]),oe=t=>{t.button===0&&(m$1(t)||t.target.closest('.MuiSelect-select[role="combobox"]')||A||(t.preventDefault(),t.stopPropagation(),G.current?.focus(),R(t,!O)));},ae=t=>{m$1(t)||t.target.closest('.MuiSelect-select[role="combobox"]')||(t.preventDefault(),t.stopPropagation());},re=t=>{let ge=t.target.value.map(V=>S.find(W=>j(W)===V||String(W.value)===String(V))).filter(V=>V!=null);b?.(ge);},U=jsx(Tt,{endAdornmentProp:_,isLoading:!!F,showClear:q&&n(u)&&!A,showMenuArrow:!F,menuOpen:O,ClearIconComponent:fe,ChevronIconComponent:Q,onClear:j$1,onClearDefault:()=>b?.(a$1?[]:null)}),se=a$1?H.map(j):j(H[0]??null);return jsxs(Y,{$hasFeedback:B,onMouseDown:oe,onClick:ae,children:[jsxs(W,{variant:"filled",required:m,className:X$1,children:[jsx(Dt,{id:$,children:c}),jsx(X,{multiple:a$1,ref:C,inputRef:G,value:se,error:D&&!B,feedbackType:ne,hasFeedback:B,valueAlignment:ee,disableUnderline:true,required:m,hasLabel:!!c.trim(),labelId:$,id:J,name:Z$1,open:O,onOpen:t=>R(t,true),onClose:t=>{k(t)||a$1&&l(t)||R(t,false);},onChange:a$1?re:void 0,renderValue:L,className:a.input,SelectDisplayProps:{className:a.display},displayEmpty:!c.trim(),inputProps:x,disabled:A,IconComponent:()=>null,autoWidth:false,endAdornment:U,MenuProps:z,children:he})]}),le?jsx(ba,{...g}):y!=null&&y!==""?jsx(Z,{children:y}):null]})}),ke=Lt;function Bt({options:h,maxVisibleValues:a$1,valueAlignment:S=m}){let b$1=typeof a$1=="number"&&Number.isFinite(a$1)?Math.max(0,Math.floor(a$1)):h.length,c=h.slice(0,b$1),d=h.length-c.length,m=c.map(b).join(", ");return jsxs(L,{className:a.values,$valueAlignment:S,children:[jsx(M,{className:a.value,children:m}),d>0?jsxs(N,{className:a.valueOverflow,children:["+",d," more"]}):null]})}var wt=Bt;var Vt=forwardRef(function({options:a$1,isMultiple:S$1=false,hasCheckbox:u,maxVisibleValues:b$2,value:c$2,onChange:d$1,label:m$1,placeholder:D,disabled:y,required:g$1,error:q=false,helperText:fe,feedback:Q$1,hasClearIcon:j=false,ClearIconComponent:F$1,ChevronIconComponent:z,SearchIconComponent:he,onClear:J$1,isLoading:X,isSearchable:w=false,searchPlaceholder:Y,hasSelectionSummary:T$1=false,hasSelectedCheckmark:Z=false,valueAlignment:x=m,menuDirection:_$1=k$1,MenuProps:L$1,children:ee,id:C="Select",className:be,sx:te,selectClassNames:O$1,inputRef:A,open:le,onOpen:B,onClose:ne,name:$$1,inputProps:H$1,endAdornment:G$1,renderValue:R$1,renderOption:oe},ae){let[re,U$1]=useState(""),[se,t]=useState(_$1),[k,ge]=useState(void 0),V$1=m$1??"",W=D??"",De=fe??void 0,Te=Y??b$1,Nt=he??$,Le=u??S$1,Ce=useMemo(()=>h(a$1),[a$1]),N=useMemo(()=>Ce.flatMap(e=>e.options),[Ce]),Be=Eb(a.root,O$1?.root,be),$e=useMemo(()=>f(L$1,se,k),[L$1,se,k]),He=e$1=>{let s=c(e$1);s?.width&&ge(s.width),t(e({preferred:_$1,anchorRect:s,menuMaxHeight:d(L$1,w,T$1),gapPx:c$1})),B?.(e$1);},E=w?re.toLowerCase().trim():"",Me=e=>!E||b(e).toLowerCase().includes(E),Ge=e=>oe?jsx(J,{className:a.option,$customLayout:true,children:oe(e)}):jsx(J,{className:a.option,children:jsx(K,{title:b(e),children:b(e)})}),Pt=useMemo(()=>E?N.filter(e=>b(e).toLowerCase().includes(E)):N,[N,E]),Ft=!!E&&Pt.length===0,Ue=e=>{let s=false;return Ce.flatMap(i=>{let ve=i.options.some(Me),ie=i.label!=null||s?jsx(Q,{className:a.groupLabel,disableGutters:true,disableSticky:true,$divider:s,$hidden:!ve,onMouseDown:g,onClick:g,children:i.label},`${i.key}-label`):null;return s||(s=ve),ie?[ie,...i.options.map(e)]:i.options.map(e)})},ce=()=>{d$1?.(S$1?[]:null),J$1?.();},We=w?jsx(O,{className:a.search,disableGutters:true,"data-select-menu-search":"",onMouseDown:g,onClick:g,onKeyDown:g,children:jsx(R,{placeholder:Te,value:re,onChange:e=>U$1(e.target.value),onMouseDown:g,onClick:g,onKeyDown:e=>e.stopPropagation(),onKeyUp:e=>e.stopPropagation(),disableUnderline:true,fullWidth:true,inputProps:{"aria-label":Te,onMouseDown:g,onClick:g},endAdornment:jsx(Nt,{})})}):null,Ke=Ft?jsx(P,{disableGutters:true,onMouseDown:g,onClick:g,children:"No results found"}):null;if(S$1){let e=Array.isArray(c$2)?c$2:[],s=N.filter(n=>e.some(f=>f===n.value||String(f)===String(n.value))),i=s.length,ie=T$1&&i>0?jsx(S,{className:a.summary,disableGutters:true,disableSticky:true,"data-select-menu-keep-open":"",onMouseDown:g,onClick:g,onKeyDown:g,children:jsxs(T,{children:[jsxs(U,{children:[i," selected"]}),jsx(V,{type:"button",variant:"text",disableRipple:true,"aria-label":"Clear all selected options",onMouseDown:n=>{n.preventDefault(),n.stopPropagation(),ce();},onClick:n=>{n.preventDefault(),n.stopPropagation(),ce();},children:"Clear"})]})}):null;return jsx(F,{id:C,"data-testid":C??"Select",className:Be,sx:Db(te??{}),children:jsxs(ke,{ref:A??ae,isMultiple:true,id:C,className:Eb(a.field,O$1?.field),options:N,value:s,onChange:n=>{d$1?.(Array.isArray(n)?n.map(f=>f.value):[]);},label:V$1,disabled:y,required:g$1,hasError:q,helperText:De,feedback:Q$1,showClearIcon:j,ClearIconComponent:F$1??aa,ChevronIconComponent:z,onClear:ce,isLoading:X,MenuProps:$e,open:le,onOpen:He,onClose:n=>{U$1(""),ne?.(n);},name:$$1,inputProps:H$1,endAdornment:G$1,valueAlignment:x,renderValue:()=>s.length>0?jsx(wt,{options:s,maxVisibleValues:b$2,valueAlignment:x}):W,children:[ee,We,ie,Ke,Ue(n=>{let f=e.some(Qe=>Qe===n.value||String(Qe)===String(n.value)),qe=Ge(n);return jsx(I,{value:String(n.value),disabled:n.disabled,$selected:f,$hidden:!Me(n),className:a.option,onMouseDown:g,onClick:g,children:Le?jsxs(G,{children:[jsx(H,{checked:f,$mutedRect:f&&n.disabled,tabIndex:-1,disableRipple:true}),qe]}):jsxs(Fragment,{children:[qe,Z&&f?jsx(_,{}):null]})},n.id)})]})})}let xt=Array.isArray(c$2)?c$2[0]??null:c$2??null,P$1=i(N,xt);return jsx(F,{id:C,"data-testid":C??"Select",className:Be,sx:Db(te??{}),children:jsxs(ke,{ref:A??ae,id:C,className:Eb(a.field,O$1?.field),options:N,value:P$1,onChange:e=>{d$1?.(e==null||Array.isArray(e)?null:e.value);},label:V$1,disabled:y,required:g$1,hasError:q,helperText:De,feedback:Q$1,showClearIcon:j,ClearIconComponent:F$1??aa,ChevronIconComponent:z,onClear:ce,isLoading:X,MenuProps:$e,open:le,onOpen:He,onClose:e=>{U$1(""),ne?.(e);},name:$$1,inputProps:H$1,endAdornment:G$1,valueAlignment:x,renderValue:()=>{if(!P$1)return W;if(R$1)return R$1(P$1);let e=b(P$1);return jsx(L,{className:a.values,$valueAlignment:x,children:jsx(M,{className:a.value,title:e,children:e})})},children:[ee,We,Ke,Ue(e=>{let s=P$1!=null&&(P$1.value===e.value||String(P$1.value)===String(e.value)),i=Ge(e);return jsx(I,{value:String(e.value),disabled:e.disabled,$selected:s,$hidden:!Me(e),onMouseDown:g,onClick:()=>d$1?.(e.value),className:a.option,children:Le?jsxs(G,{children:[jsx(H,{checked:s,tabIndex:-1,disableRipple:true}),i]}):jsxs(Fragment,{children:[i,Z&&s?jsx(_,{}):null]})},e.id)})]})})});Vt.displayName="Select";var Ut=memo(Vt);export{Ut as a};
|