@internxt/ui 0.1.3 → 0.1.4

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/dist/index.cjs.js CHANGED
@@ -61,7 +61,7 @@ __p += '`),ue&&(C+=`' +
61
61
  function print() { __p += __j.call(arguments, '') }
62
62
  `:`;
63
63
  `)+C+`return __p
64
- }`;var Z=uo(function(){return fe(s,j+"return "+C).apply(u,o)});if(Z.source=C,Cu(Z))throw Z;return Z}function Pg(e){return de(e).toLowerCase()}function Dg(e){return de(e).toUpperCase()}function $g(e,n,t){if(e=de(e),e&&(t||n===u))return ga(e);if(!e||!(n=fn(n)))return e;var r=An(e),i=An(n),s=pa(r,i),o=va(r,i)+1;return ot(r,s,o).join("")}function kg(e,n,t){if(e=de(e),e&&(t||n===u))return e.slice(0,ma(e)+1);if(!e||!(n=fn(n)))return e;var r=An(e),i=va(r,An(n))+1;return ot(r,0,i).join("")}function jg(e,n,t){if(e=de(e),e&&(t||n===u))return e.replace(Vt,"");if(!e||!(n=fn(n)))return e;var r=An(e),i=pa(r,An(n));return ot(r,i).join("")}function Mg(e,n){var t=$e,r=nn;if(Ce(n)){var i="separator"in n?n.separator:i;t="length"in n?X(n.length):t,r="omission"in n?fn(n.omission):r}e=de(e);var s=e.length;if(Lt(e)){var o=An(e);s=o.length}if(t>=s)return e;var c=t-Ot(r);if(c<1)return r;var g=o?ot(o,0,c).join(""):e.slice(0,c);if(i===u)return g+r;if(o&&(c+=g.length-c),Su(i)){if(e.slice(c).search(i)){var _,w=g;for(i.global||(i=Fi(i.source,de(ce.exec(i))+"g")),i.lastIndex=0;_=i.exec(w);)var C=_.index;g=g.slice(0,C===u?c:C)}}else if(e.indexOf(fn(i),c)!=c){var A=g.lastIndexOf(i);A>-1&&(g=g.slice(0,A))}return g+r}function Wg(e){return e=de(e),e&&wr.test(e)?e.replace(Et,dl):e}var Fg=Mt(function(e,n,t){return e+(t?" ":"")+n.toUpperCase()}),Tu=as("toUpperCase");function io(e,n,t){return e=de(e),n=t?u:n,n===u?ol(e)?vl(e):Qo(e):e.match(n)||[]}var uo=V(function(e,n){try{return on(e,u,n)}catch(t){return Cu(t)?t:new Y(t)}}),Bg=Kn(function(e,n){return mn(n,function(t){t=kn(t),Hn(e,t,yu(e[t],e))}),e});function Ug(e){var n=e==null?0:e.length,t=B();return e=n?ye(e,function(r){if(typeof r[1]!="function")throw new _n(E);return[t(r[0]),r[1]]}):[],V(function(r){for(var i=-1;++i<n;){var s=e[i];if(on(s[0],this,r))return on(s[1],this,r)}})}function Hg(e){return gf(yn(e,L))}function Iu(e){return function(){return e}}function zg(e,n){return e==null||e!==e?n:e}var Kg=os(),Gg=os(!0);function en(e){return e}function Au(e){return Ma(typeof e=="function"?e:yn(e,L))}function Yg(e){return Fa(yn(e,L))}function qg(e,n){return Ba(e,yn(n,L))}var Xg=V(function(e,n){return function(t){return or(t,e,n)}}),Zg=V(function(e,n){return function(t){return or(e,t,n)}});function Lu(e,n,t){var r=ke(n),i=zr(n,r);t==null&&!(Ce(n)&&(i.length||!r.length))&&(t=n,n=e,e=this,i=zr(n,ke(n)));var s=!(Ce(t)&&"chain"in t)||!!t.chain,o=Yn(e);return mn(i,function(c){var g=n[c];e[c]=g,o&&(e.prototype[c]=function(){var _=this.__chain__;if(s||_){var w=e(this.__wrapped__),C=w.__actions__=Je(this.__actions__);return C.push({func:g,args:arguments,thisArg:e}),w.__chain__=_,w}return g.apply(e,tt([this.value()],arguments))})}),e}function Jg(){return Fe._===this&&(Fe._=bl),this}function Ou(){}function Vg(e){return e=X(e),V(function(n){return Ua(n,e)})}var Qg=ou(ye),e0=ou(la),n0=ou(Pi);function ao(e){return pu(e)?Di(kn(e)):Of(e)}function t0(e){return function(n){return e==null?u:xt(e,n)}}var r0=fs(),i0=fs(!0);function Nu(){return[]}function Pu(){return!1}function u0(){return{}}function a0(){return""}function s0(){return!0}function o0(e,n){if(e=X(e),e<1||e>Se)return[];var t=le,r=He(e,le);n=B(n),e-=le;for(var i=ji(r,n);++t<e;)n(t);return i}function l0(e){return q(e)?ye(e,kn):cn(e)?[e]:Je(Rs(de(e)))}function f0(e){var n=++wl;return de(e)+n}var c0=Zr(function(e,n){return e+n},0),h0=lu("ceil"),d0=Zr(function(e,n){return e/n},1),g0=lu("floor");function p0(e){return e&&e.length?Hr(e,en,qi):u}function v0(e,n){return e&&e.length?Hr(e,B(n,2),qi):u}function x0(e){return ha(e,en)}function m0(e,n){return ha(e,B(n,2))}function _0(e){return e&&e.length?Hr(e,en,Vi):u}function w0(e,n){return e&&e.length?Hr(e,B(n,2),Vi):u}var y0=Zr(function(e,n){return e*n},1),b0=lu("round"),C0=Zr(function(e,n){return e-n},0);function S0(e){return e&&e.length?ki(e,en):0}function E0(e,n){return e&&e.length?ki(e,B(n,2)):0}return a.after=Yh,a.ary=js,a.assign=Dd,a.assignIn=Js,a.assignInWith=li,a.assignWith=$d,a.at=kd,a.before=Ms,a.bind=yu,a.bindAll=Bg,a.bindKey=Ws,a.castArray=ud,a.chain=Ds,a.chunk=gc,a.compact=pc,a.concat=vc,a.cond=Ug,a.conforms=Hg,a.constant=Iu,a.countBy=Sh,a.create=jd,a.curry=Fs,a.curryRight=Bs,a.debounce=Us,a.defaults=Md,a.defaultsDeep=Wd,a.defer=qh,a.delay=Xh,a.difference=xc,a.differenceBy=mc,a.differenceWith=_c,a.drop=wc,a.dropRight=yc,a.dropRightWhile=bc,a.dropWhile=Cc,a.fill=Sc,a.filter=Rh,a.flatMap=Ah,a.flatMapDeep=Lh,a.flatMapDepth=Oh,a.flatten=Ls,a.flattenDeep=Ec,a.flattenDepth=Rc,a.flip=Zh,a.flow=Kg,a.flowRight=Gg,a.fromPairs=Tc,a.functions=Gd,a.functionsIn=Yd,a.groupBy=Nh,a.initial=Ac,a.intersection=Lc,a.intersectionBy=Oc,a.intersectionWith=Nc,a.invert=Xd,a.invertBy=Zd,a.invokeMap=Dh,a.iteratee=Au,a.keyBy=$h,a.keys=ke,a.keysIn=Qe,a.map=ri,a.mapKeys=Vd,a.mapValues=Qd,a.matches=Yg,a.matchesProperty=qg,a.memoize=ui,a.merge=eg,a.mergeWith=Vs,a.method=Xg,a.methodOf=Zg,a.mixin=Lu,a.negate=ai,a.nthArg=Vg,a.omit=ng,a.omitBy=tg,a.once=Jh,a.orderBy=kh,a.over=Qg,a.overArgs=Vh,a.overEvery=e0,a.overSome=n0,a.partial=bu,a.partialRight=Hs,a.partition=jh,a.pick=rg,a.pickBy=Qs,a.property=ao,a.propertyOf=t0,a.pull=kc,a.pullAll=Ns,a.pullAllBy=jc,a.pullAllWith=Mc,a.pullAt=Wc,a.range=r0,a.rangeRight=i0,a.rearg=Qh,a.reject=Fh,a.remove=Fc,a.rest=ed,a.reverse=_u,a.sampleSize=Uh,a.set=ug,a.setWith=ag,a.shuffle=Hh,a.slice=Bc,a.sortBy=Gh,a.sortedUniq=qc,a.sortedUniqBy=Xc,a.split=Ag,a.spread=nd,a.tail=Zc,a.take=Jc,a.takeRight=Vc,a.takeRightWhile=Qc,a.takeWhile=eh,a.tap=ph,a.throttle=td,a.thru=ti,a.toArray=qs,a.toPairs=eo,a.toPairsIn=no,a.toPath=l0,a.toPlainObject=Zs,a.transform=sg,a.unary=rd,a.union=nh,a.unionBy=th,a.unionWith=rh,a.uniq=ih,a.uniqBy=uh,a.uniqWith=ah,a.unset=og,a.unzip=wu,a.unzipWith=Ps,a.update=lg,a.updateWith=fg,a.values=Bt,a.valuesIn=cg,a.without=sh,a.words=io,a.wrap=id,a.xor=oh,a.xorBy=lh,a.xorWith=fh,a.zip=ch,a.zipObject=hh,a.zipObjectDeep=dh,a.zipWith=gh,a.entries=eo,a.entriesIn=no,a.extend=Js,a.extendWith=li,Lu(a,a),a.add=c0,a.attempt=uo,a.camelCase=pg,a.capitalize=to,a.ceil=h0,a.clamp=hg,a.clone=ad,a.cloneDeep=od,a.cloneDeepWith=ld,a.cloneWith=sd,a.conformsTo=fd,a.deburr=ro,a.defaultTo=zg,a.divide=d0,a.endsWith=vg,a.eq=On,a.escape=xg,a.escapeRegExp=mg,a.every=Eh,a.find=Th,a.findIndex=Is,a.findKey=Fd,a.findLast=Ih,a.findLastIndex=As,a.findLastKey=Bd,a.floor=g0,a.forEach=$s,a.forEachRight=ks,a.forIn=Ud,a.forInRight=Hd,a.forOwn=zd,a.forOwnRight=Kd,a.get=Eu,a.gt=cd,a.gte=hd,a.has=qd,a.hasIn=Ru,a.head=Os,a.identity=en,a.includes=Ph,a.indexOf=Ic,a.inRange=dg,a.invoke=Jd,a.isArguments=wt,a.isArray=q,a.isArrayBuffer=dd,a.isArrayLike=Ve,a.isArrayLikeObject=Ie,a.isBoolean=gd,a.isBuffer=lt,a.isDate=pd,a.isElement=vd,a.isEmpty=xd,a.isEqual=md,a.isEqualWith=_d,a.isError=Cu,a.isFinite=wd,a.isFunction=Yn,a.isInteger=zs,a.isLength=si,a.isMap=Ks,a.isMatch=yd,a.isMatchWith=bd,a.isNaN=Cd,a.isNative=Sd,a.isNil=Rd,a.isNull=Ed,a.isNumber=Gs,a.isObject=Ce,a.isObjectLike=Re,a.isPlainObject=gr,a.isRegExp=Su,a.isSafeInteger=Td,a.isSet=Ys,a.isString=oi,a.isSymbol=cn,a.isTypedArray=Ft,a.isUndefined=Id,a.isWeakMap=Ad,a.isWeakSet=Ld,a.join=Pc,a.kebabCase=_g,a.last=Cn,a.lastIndexOf=Dc,a.lowerCase=wg,a.lowerFirst=yg,a.lt=Od,a.lte=Nd,a.max=p0,a.maxBy=v0,a.mean=x0,a.meanBy=m0,a.min=_0,a.minBy=w0,a.stubArray=Nu,a.stubFalse=Pu,a.stubObject=u0,a.stubString=a0,a.stubTrue=s0,a.multiply=y0,a.nth=$c,a.noConflict=Jg,a.noop=Ou,a.now=ii,a.pad=bg,a.padEnd=Cg,a.padStart=Sg,a.parseInt=Eg,a.random=gg,a.reduce=Mh,a.reduceRight=Wh,a.repeat=Rg,a.replace=Tg,a.result=ig,a.round=b0,a.runInContext=d,a.sample=Bh,a.size=zh,a.snakeCase=Ig,a.some=Kh,a.sortedIndex=Uc,a.sortedIndexBy=Hc,a.sortedIndexOf=zc,a.sortedLastIndex=Kc,a.sortedLastIndexBy=Gc,a.sortedLastIndexOf=Yc,a.startCase=Lg,a.startsWith=Og,a.subtract=C0,a.sum=S0,a.sumBy=E0,a.template=Ng,a.times=o0,a.toFinite=qn,a.toInteger=X,a.toLength=Xs,a.toLower=Pg,a.toNumber=Sn,a.toSafeInteger=Pd,a.toString=de,a.toUpper=Dg,a.trim=$g,a.trimEnd=kg,a.trimStart=jg,a.truncate=Mg,a.unescape=Wg,a.uniqueId=f0,a.upperCase=Fg,a.upperFirst=Tu,a.each=$s,a.eachRight=ks,a.first=Os,Lu(a,function(){var e={};return Dn(a,function(n,t){he.call(a.prototype,t)||(e[t]=n)}),e}(),{chain:!1}),a.VERSION=m,mn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){a[e].placeholder=a}),mn(["drop","take"],function(e,n){ie.prototype[e]=function(t){t=t===u?1:De(X(t),0);var r=this.__filtered__&&!n?new ie(this):this.clone();return r.__filtered__?r.__takeCount__=He(t,r.__takeCount__):r.__views__.push({size:He(t,le),type:e+(r.__dir__<0?"Right":"")}),r},ie.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),mn(["filter","map","takeWhile"],function(e,n){var t=n+1,r=t==Le||t==Ke;ie.prototype[e]=function(i){var s=this.clone();return s.__iteratees__.push({iteratee:B(i,3),type:t}),s.__filtered__=s.__filtered__||r,s}}),mn(["head","last"],function(e,n){var t="take"+(n?"Right":"");ie.prototype[e]=function(){return this[t](1).value()[0]}}),mn(["initial","tail"],function(e,n){var t="drop"+(n?"":"Right");ie.prototype[e]=function(){return this.__filtered__?new ie(this):this[t](1)}}),ie.prototype.compact=function(){return this.filter(en)},ie.prototype.find=function(e){return this.filter(e).head()},ie.prototype.findLast=function(e){return this.reverse().find(e)},ie.prototype.invokeMap=V(function(e,n){return typeof e=="function"?new ie(this):this.map(function(t){return or(t,e,n)})}),ie.prototype.reject=function(e){return this.filter(ai(B(e)))},ie.prototype.slice=function(e,n){e=X(e);var t=this;return t.__filtered__&&(e>0||n<0)?new ie(t):(e<0?t=t.takeRight(-e):e&&(t=t.drop(e)),n!==u&&(n=X(n),t=n<0?t.dropRight(-n):t.take(n-e)),t)},ie.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ie.prototype.toArray=function(){return this.take(le)},Dn(ie.prototype,function(e,n){var t=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),i=a[r?"take"+(n=="last"?"Right":""):n],s=r||/^find/.test(n);i&&(a.prototype[n]=function(){var o=this.__wrapped__,c=r?[1]:arguments,g=o instanceof ie,_=c[0],w=g||q(o),C=function(ne){var ue=i.apply(a,tt([ne],c));return r&&A?ue[0]:ue};w&&t&&typeof _=="function"&&_.length!=1&&(g=w=!1);var A=this.__chain__,j=!!this.__actions__.length,U=s&&!A,Z=g&&!j;if(!s&&w){o=Z?o:new ie(this);var H=e.apply(o,c);return H.__actions__.push({func:ti,args:[C],thisArg:u}),new wn(H,A)}return U&&Z?e.apply(this,c):(H=this.thru(C),U?r?H.value()[0]:H.value():H)})}),mn(["pop","push","shift","sort","splice","unshift"],function(e){var n=Ir[e],t=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);a.prototype[e]=function(){var i=arguments;if(r&&!this.__chain__){var s=this.value();return n.apply(q(s)?s:[],i)}return this[t](function(o){return n.apply(q(o)?o:[],i)})}}),Dn(ie.prototype,function(e,n){var t=a[n];if(t){var r=t.name+"";he.call($t,r)||($t[r]=[]),$t[r].push({name:n,func:t})}}),$t[Xr(u,D).name]=[{name:"wrapper",func:u}],ie.prototype.clone=Ml,ie.prototype.reverse=Wl,ie.prototype.value=Fl,a.prototype.at=vh,a.prototype.chain=xh,a.prototype.commit=mh,a.prototype.next=_h,a.prototype.plant=yh,a.prototype.reverse=bh,a.prototype.toJSON=a.prototype.valueOf=a.prototype.value=Ch,a.prototype.first=a.prototype.head,nr&&(a.prototype[nr]=wh),a},Nt=xl();ht?((ht.exports=Nt)._=Nt,Ai._=Nt):Fe._=Nt}).call(X0)}(xr,xr.exports)),xr.exports}var J0=Z0();const V0=T0(J0),Q0=500,ep=({item:l,listIndex:p,itemComposition:u,selected:m,isOpen:y,columnsWidth:b,onClose:E,onSelectedChanged:I,onDoubleClick:T,onClick:$,onClickContextMenu:k,onThreeDotsButtonPressed:L,disableItemCompositionStyles:M,menu:G,onMouseEnter:W,onMouseLeave:ae,genericEnterKey:R})=>{const D=P.useRef(),z=P.useRef(null),te=P.useRef(null),[oe,ge]=P.useState(!1),[pe,we]=P.useState(0),[Te,Xe]=P.useState(0),[$e,nn]=P.useState({width:0,height:0}),[gn,Ue]=P.useState(!1);P.useEffect(()=>{te.current&&(te.current.offsetHeight!==$e.height||te.current?.offsetWidth!==$e.width)&&nn({width:te.current.offsetWidth,height:te.current.offsetHeight})},[$e.height,$e.width]),P.useEffect(()=>{oe||Le(),y||(ge(!1),we(0),Xe(0))},[y]);function Le(){const J=D.current,le=te?.current?.offsetHeight||300;if(!J)return;const{bottom:En}=J.getBoundingClientRect(),un=window.innerHeight,jn=En+le>un;Ue(jn)}const tn=J=>{J.preventDefault(),k?.(J);const le=te?.current?.offsetWidth||240,En=te?.current?.offsetHeight||300,un=z?.current?.getBoundingClientRect(),{innerWidth:jn,innerHeight:pn}=window;let Oe=J.clientX-(un?.left||0),Rn=J.clientY-(un?.top||0);J.clientX+le>jn&&(Oe=Oe-le),J.clientY+En>pn&&J.clientY>Q0&&(Rn=Rn-En),we(Oe),Xe(Rn),ge(!0)},Ke=J=>{J.preventDefault(),L?.(J),ge(!1)},Me=J=>{$?.(J),oe&&Se()},Se=()=>{E()};return $u({r:Se,backspace:Se,enter:()=>{y||R()}},[]),h.jsxs("div",{onDoubleClick:T,onClick:Me,onContextMenu:tn,ref:z,className:`group relative flex h-14 flex-row items-center pl-14 pr-5 ${m?"bg-primary/10 text-gray-100 dark:bg-primary/20":"focus-within:bg-gray-1 hover:bg-gray-1"}`,onMouseEnter:W,onMouseLeave:ae,children:[y&&m&&h.jsx(vo,{item:l,menu:G,menuItemsRef:te,openedFromRightClick:oe,isOpen:y,posX:pe,posY:Te,isContextMenuCutOff:gn,genericEnterKey:R,handleMenuClose:Se}),h.jsx("div",{className:`absolute left-5 top-0 flex h-full w-0 flex-row items-center justify-start p-0 opacity-0 focus-within:opacity-100 group-hover:opacity-100 ${m&&"opacity-100"}`,children:h.jsx(Du,{onClick:J=>{J.stopPropagation(),I(!m)},checked:m,checkboxDataCy:`driveListItemCheckbox${p}`})}),M?h.jsx("div",{className:`grow-1 relative flex h-full w-full flex-row items-center border-b ${m?"border-primary/5":"border-gray-5"}`,children:u[0](l)},0):new Array(u.length).fill(0).map((J,le)=>h.jsx("div",{className:`relative flex h-full shrink-0 flex-row items-center border-b ${m?"border-primary/5":"border-gray-5"} ${b[le]}`,children:u[le](l)},le)),h.jsx("div",{className:`flex h-14 w-12 shrink-0 flex-col items-center justify-center border-b ${m?"border-primary/5":"border-gray-5"}`,children:h.jsx("button",{ref:D,className:`flex h-10 w-10 flex-col items-center justify-center rounded-md opacity-0 outline-none focus-visible:opacity-100 group-hover:opacity-100 ${m?"text-gray-80 hover:bg-primary/10 focus-visible:bg-primary/10":"text-gray-60 hover:bg-gray-10 focus-visible:bg-gray-10"}`,onClick:J=>{Ke(J)},children:h.jsx(je.DotsThree,{size:24,weight:"bold"})})})]})},np=({selectedItems:l,onTopSelectionCheckboxClick:p,items:u,header:m,orderBy:y,onOrderableColumnClicked:b,menu:E,displayMenuDiv:I,isVerticalScrollbarVisible:T,checkboxDataCy:$,onClose:k})=>h.jsx("div",{onClick:k,onContextMenu:k,className:"flex min-w-max h-12 shrink-0 flex-row px-5",children:h.jsxs("div",{className:"flex h-full min-w-full flex-row items-center border-b border-gray-10",children:[h.jsx("div",{className:"flex h-full flex-row items-center justify-between pr-4",children:h.jsx(Du,{checked:l.length>0,indeterminate:u.length>l.length&&l.length>0,onClick:p,checkboxDataCy:$})}),m.map(L=>h.jsxs("button",{onClick:L.orderable?()=>{b(L)}:void 0,"data-cy":"buttonDataCy"in L&&L?.buttonDataCy,className:`flex h-full shrink-0 flex-row items-center space-x-1.5 text-base font-medium text-gray-60 ${L.width} ${L.orderable?"cursor-pointer hover:text-gray-80":""}`,children:[h.jsx("span",{"data-cy":"textDataCy"in L&&L?.textDataCy,children:L.label}),L.name===y?.field&&L.orderable&&(y?.direction==="ASC"?h.jsx(je.ArrowUp,{size:14,weight:"bold"}):h.jsx(je.ArrowDown,{size:14,weight:"bold"}))]},L.name.toString())),T&&h.jsx("div",{className:"mr-15px"}),(E||I)&&h.jsx("div",{className:"flex h-full w-12 shrink-0"})]})}),tp=({skeletonItem:l,columns:p})=>h.jsxs("div",{"data-testid":"skeleton-loader-item",className:"group relative flex h-14 animate-pulse flex-row items-center px-5",children:[h.jsx("div",{className:"w-9 shrink-0"}),new Array(p.length).fill(0).map((u,m)=>h.jsx("div",{className:`relative flex h-full shrink-0 flex-row items-center overflow-hidden whitespace-nowrap border-b border-gray-5 ${p[m]}`,children:l?.[m]},`${u}-${m}`)),h.jsx("div",{className:"flex h-14 w-12 shrink-0 flex-col items-center justify-center border-b border-gray-5"})]}),_o=({skeleton:l})=>h.jsx(h.Fragment,{children:new Array(l.length).fill(0).map((p,u)=>h.jsx(tp,{skeletonItem:l[u].skeletonItem,columns:l[u].columns},`skinSkeletonRow${u}`))}),rp=({header:l,checkboxDataCy:p,items:u,itemComposition:m,selectedItems:y,onClick:b,onDoubleClick:E,onEnterPressed:I,onSelectedItemsChanged:T,isLoading:$,forceLoading:k,skinSkeleton:L,emptyState:M,orderBy:G,onOrderByChanged:W,onNextPage:ae,hasMoreItems:R,menu:D,displayMenuDiv:z,className:te,disableItemCompositionStyles:oe,onMouseEnter:ge,onMouseLeave:pe,headerBackgroundColor:we="bg-surface",keyBoardShortcutActions:Te,disableKeyboardShortcuts:Xe})=>{const $e=P.useRef(null),nn=F=>y.some(Q=>F.id===Q.id),gn=document.getElementById("scrollableList"),Ue=gn&&gn.scrollHeight>gn.clientHeight,Le=!R&&u.length===0&&!$,[tn,Ke]=P.useState(null),Me=new Array(25).fill(0).map(()=>({skeletonItem:L,columns:l.map(F=>F.width)})),Se=h.jsx(_o,{skeleton:Me});P.useEffect(()=>{const F=Q=>{$e.current&&!$e.current.contains(Q.target)&&Ke(null)};return document.addEventListener("mousedown",F),document.addEventListener("contextmenu",F),()=>{document.removeEventListener("mousedown",F),document.removeEventListener("contextmenu",F)}},[]);const rn=()=>{ae?.()},J=()=>{const F=y.map(Q=>({props:Q,value:!1}));T(F)},le=F=>{const Q=[...y.map(xe=>({props:xe,value:!1})),{props:F,value:!0}];T(Q)},En=()=>{if(y.length===1){const Q=y[0];I?.(Q)}},un=()=>{const Q=V0.difference(u,y).map(xe=>({props:xe,value:!0}));T(Q)},jn=()=>{y.length===u.length?J():un()},pn=F=>{if(Pn(),!F.orderable||!W)return;const Q=G?.field===F.name;W(Q?{field:F.name,direction:G.direction==="ASC"?"DESC":"ASC"}:{field:F.name,direction:F.defaultDirection??"ASC"})},Oe=F=>{Xe||F()},Rn=()=>{Te?.onRKeyPressed?.()},an=()=>{Te?.onBackspaceKeyPressed?.()};$u({"ctrl+a":()=>Oe(un),"meta+a":()=>Oe(un),esc:()=>Oe(J),r:()=>Oe(Rn),backspace:()=>Oe(an),delete:()=>Oe(an)},[u,y,Xe]);const Tn=(F,Q)=>{Q.metaKey||Q.ctrlKey?T([{props:F,value:!nn(F)}]):nn(F)||b?.(F),Ke(null)},Zn=(F,Q)=>{Q.preventDefault(),nn(F)||le(F),Ke(F.id)},Pn=()=>{Ke(null)},Mn=(F,Q)=>{F.stopPropagation(),Ke(xe=>xe?null:Q.id),nn(Q)||le(Q)};return h.jsx("div",{id:"generic-list-component",className:`relative flex h-full flex-col overflow-x-auto overflow-y-hidden ${te}`,ref:$e,children:h.jsxs("div",{id:"scrollableList",className:"flex h-full flex-col min-w-max overflow-x-hidden overflow-y-auto",children:[h.jsx("div",{className:`sticky top-0 z-10 ${we}`,children:Le?null:h.jsx(np,{selectedItems:y,onTopSelectionCheckboxClick:jn,items:u,header:l,orderBy:G,onOrderableColumnClicked:pn,menu:D,displayMenuDiv:z,isVerticalScrollbarVisible:Ue,checkboxDataCy:p,onClose:Pn})}),Le?M:u.length>0&&!k?h.jsx(mo,{handleNextPage:rn,hasMoreItems:!!R,loader:Se,scrollableTarget:"scrollableList",children:u.map((F,Q)=>h.jsx(ep,{item:F,listIndex:Q,isOpen:tn===F.id,onClose:Pn,itemComposition:m,selected:nn(F),onDoubleClick:E&&(()=>E(F)),onClick:xe=>Tn(F,xe),onClickContextMenu:xe=>Zn(F,xe),onThreeDotsButtonPressed:xe=>Mn(xe,F),columnsWidth:l.map(xe=>xe.width),menu:D,onSelectedChanged:xe=>T([{props:F,value:xe}]),disableItemCompositionStyles:oe,onMouseEnter:ge,onMouseLeave:pe,genericEnterKey:En},F.id))}):h.jsx("div",{children:Se}),u.length>0&&h.jsx("div",{"data-testid":"outside-click-element",className:"h-full w-full py-6",onClick:J,onContextMenu:F=>{F.preventDefault(),J()}})]})})},ip=({isOpen:l,onClose:p,children:u,maxWidth:m,className:y,width:b,preventClosing:E=!1,stopMouseDownPropagation:I=!1})=>{const T=P.useRef(null),[$,k]=P.useState(l),[L,M]=P.useState("opacity-0"),[G,W]=P.useState("scale-95"),ae=()=>{const D=document.querySelectorAll("[data-modal]"),z=D[D.length-1];T.current===z&&p()},R=D=>{I&&D.stopPropagation()};return P.useEffect(()=>{if(l){const D=setTimeout(()=>{M("opacity-100"),W("scale-100")},10);return k(!0),()=>clearTimeout(D)}else{M("opacity-0"),W("scale-95");const D=setTimeout(()=>{k(!1)},150);return()=>clearTimeout(D)}},[l]),P.useEffect(()=>{const D=z=>{T.current&&!T.current.contains(z.target)&&!E&&(z.preventDefault(),ae())};return l&&document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}},[l,p,E]),P.useEffect(()=>{const D=z=>{z.key==="Escape"&&!E&&(z.preventDefault(),ae())};return l&&window.addEventListener("keydown",D),()=>{window.removeEventListener("keydown",D)}},[l,p,E]),h.jsx(h.Fragment,{children:$&&h.jsxs("div",{className:"m-0",onMouseDown:R,role:"dialog","aria-modal":"true",children:[h.jsx("div",{className:`
64
+ }`;var Z=uo(function(){return fe(s,j+"return "+C).apply(u,o)});if(Z.source=C,Cu(Z))throw Z;return Z}function Pg(e){return de(e).toLowerCase()}function Dg(e){return de(e).toUpperCase()}function $g(e,n,t){if(e=de(e),e&&(t||n===u))return ga(e);if(!e||!(n=fn(n)))return e;var r=An(e),i=An(n),s=pa(r,i),o=va(r,i)+1;return ot(r,s,o).join("")}function kg(e,n,t){if(e=de(e),e&&(t||n===u))return e.slice(0,ma(e)+1);if(!e||!(n=fn(n)))return e;var r=An(e),i=va(r,An(n))+1;return ot(r,0,i).join("")}function jg(e,n,t){if(e=de(e),e&&(t||n===u))return e.replace(Vt,"");if(!e||!(n=fn(n)))return e;var r=An(e),i=pa(r,An(n));return ot(r,i).join("")}function Mg(e,n){var t=$e,r=nn;if(Ce(n)){var i="separator"in n?n.separator:i;t="length"in n?X(n.length):t,r="omission"in n?fn(n.omission):r}e=de(e);var s=e.length;if(Lt(e)){var o=An(e);s=o.length}if(t>=s)return e;var c=t-Ot(r);if(c<1)return r;var g=o?ot(o,0,c).join(""):e.slice(0,c);if(i===u)return g+r;if(o&&(c+=g.length-c),Su(i)){if(e.slice(c).search(i)){var _,w=g;for(i.global||(i=Fi(i.source,de(ce.exec(i))+"g")),i.lastIndex=0;_=i.exec(w);)var C=_.index;g=g.slice(0,C===u?c:C)}}else if(e.indexOf(fn(i),c)!=c){var A=g.lastIndexOf(i);A>-1&&(g=g.slice(0,A))}return g+r}function Wg(e){return e=de(e),e&&wr.test(e)?e.replace(Et,dl):e}var Fg=Mt(function(e,n,t){return e+(t?" ":"")+n.toUpperCase()}),Tu=as("toUpperCase");function io(e,n,t){return e=de(e),n=t?u:n,n===u?ol(e)?vl(e):Qo(e):e.match(n)||[]}var uo=V(function(e,n){try{return on(e,u,n)}catch(t){return Cu(t)?t:new Y(t)}}),Bg=Kn(function(e,n){return mn(n,function(t){t=kn(t),Hn(e,t,yu(e[t],e))}),e});function Ug(e){var n=e==null?0:e.length,t=B();return e=n?ye(e,function(r){if(typeof r[1]!="function")throw new _n(E);return[t(r[0]),r[1]]}):[],V(function(r){for(var i=-1;++i<n;){var s=e[i];if(on(s[0],this,r))return on(s[1],this,r)}})}function Hg(e){return gf(yn(e,L))}function Iu(e){return function(){return e}}function zg(e,n){return e==null||e!==e?n:e}var Kg=os(),Gg=os(!0);function en(e){return e}function Au(e){return Ma(typeof e=="function"?e:yn(e,L))}function Yg(e){return Fa(yn(e,L))}function qg(e,n){return Ba(e,yn(n,L))}var Xg=V(function(e,n){return function(t){return or(t,e,n)}}),Zg=V(function(e,n){return function(t){return or(e,t,n)}});function Lu(e,n,t){var r=ke(n),i=zr(n,r);t==null&&!(Ce(n)&&(i.length||!r.length))&&(t=n,n=e,e=this,i=zr(n,ke(n)));var s=!(Ce(t)&&"chain"in t)||!!t.chain,o=Yn(e);return mn(i,function(c){var g=n[c];e[c]=g,o&&(e.prototype[c]=function(){var _=this.__chain__;if(s||_){var w=e(this.__wrapped__),C=w.__actions__=Je(this.__actions__);return C.push({func:g,args:arguments,thisArg:e}),w.__chain__=_,w}return g.apply(e,tt([this.value()],arguments))})}),e}function Jg(){return Fe._===this&&(Fe._=bl),this}function Ou(){}function Vg(e){return e=X(e),V(function(n){return Ua(n,e)})}var Qg=ou(ye),e0=ou(la),n0=ou(Pi);function ao(e){return pu(e)?Di(kn(e)):Of(e)}function t0(e){return function(n){return e==null?u:xt(e,n)}}var r0=fs(),i0=fs(!0);function Nu(){return[]}function Pu(){return!1}function u0(){return{}}function a0(){return""}function s0(){return!0}function o0(e,n){if(e=X(e),e<1||e>Se)return[];var t=le,r=He(e,le);n=B(n),e-=le;for(var i=ji(r,n);++t<e;)n(t);return i}function l0(e){return q(e)?ye(e,kn):cn(e)?[e]:Je(Rs(de(e)))}function f0(e){var n=++wl;return de(e)+n}var c0=Zr(function(e,n){return e+n},0),h0=lu("ceil"),d0=Zr(function(e,n){return e/n},1),g0=lu("floor");function p0(e){return e&&e.length?Hr(e,en,qi):u}function v0(e,n){return e&&e.length?Hr(e,B(n,2),qi):u}function x0(e){return ha(e,en)}function m0(e,n){return ha(e,B(n,2))}function _0(e){return e&&e.length?Hr(e,en,Vi):u}function w0(e,n){return e&&e.length?Hr(e,B(n,2),Vi):u}var y0=Zr(function(e,n){return e*n},1),b0=lu("round"),C0=Zr(function(e,n){return e-n},0);function S0(e){return e&&e.length?ki(e,en):0}function E0(e,n){return e&&e.length?ki(e,B(n,2)):0}return a.after=Yh,a.ary=js,a.assign=Dd,a.assignIn=Js,a.assignInWith=li,a.assignWith=$d,a.at=kd,a.before=Ms,a.bind=yu,a.bindAll=Bg,a.bindKey=Ws,a.castArray=ud,a.chain=Ds,a.chunk=gc,a.compact=pc,a.concat=vc,a.cond=Ug,a.conforms=Hg,a.constant=Iu,a.countBy=Sh,a.create=jd,a.curry=Fs,a.curryRight=Bs,a.debounce=Us,a.defaults=Md,a.defaultsDeep=Wd,a.defer=qh,a.delay=Xh,a.difference=xc,a.differenceBy=mc,a.differenceWith=_c,a.drop=wc,a.dropRight=yc,a.dropRightWhile=bc,a.dropWhile=Cc,a.fill=Sc,a.filter=Rh,a.flatMap=Ah,a.flatMapDeep=Lh,a.flatMapDepth=Oh,a.flatten=Ls,a.flattenDeep=Ec,a.flattenDepth=Rc,a.flip=Zh,a.flow=Kg,a.flowRight=Gg,a.fromPairs=Tc,a.functions=Gd,a.functionsIn=Yd,a.groupBy=Nh,a.initial=Ac,a.intersection=Lc,a.intersectionBy=Oc,a.intersectionWith=Nc,a.invert=Xd,a.invertBy=Zd,a.invokeMap=Dh,a.iteratee=Au,a.keyBy=$h,a.keys=ke,a.keysIn=Qe,a.map=ri,a.mapKeys=Vd,a.mapValues=Qd,a.matches=Yg,a.matchesProperty=qg,a.memoize=ui,a.merge=eg,a.mergeWith=Vs,a.method=Xg,a.methodOf=Zg,a.mixin=Lu,a.negate=ai,a.nthArg=Vg,a.omit=ng,a.omitBy=tg,a.once=Jh,a.orderBy=kh,a.over=Qg,a.overArgs=Vh,a.overEvery=e0,a.overSome=n0,a.partial=bu,a.partialRight=Hs,a.partition=jh,a.pick=rg,a.pickBy=Qs,a.property=ao,a.propertyOf=t0,a.pull=kc,a.pullAll=Ns,a.pullAllBy=jc,a.pullAllWith=Mc,a.pullAt=Wc,a.range=r0,a.rangeRight=i0,a.rearg=Qh,a.reject=Fh,a.remove=Fc,a.rest=ed,a.reverse=_u,a.sampleSize=Uh,a.set=ug,a.setWith=ag,a.shuffle=Hh,a.slice=Bc,a.sortBy=Gh,a.sortedUniq=qc,a.sortedUniqBy=Xc,a.split=Ag,a.spread=nd,a.tail=Zc,a.take=Jc,a.takeRight=Vc,a.takeRightWhile=Qc,a.takeWhile=eh,a.tap=ph,a.throttle=td,a.thru=ti,a.toArray=qs,a.toPairs=eo,a.toPairsIn=no,a.toPath=l0,a.toPlainObject=Zs,a.transform=sg,a.unary=rd,a.union=nh,a.unionBy=th,a.unionWith=rh,a.uniq=ih,a.uniqBy=uh,a.uniqWith=ah,a.unset=og,a.unzip=wu,a.unzipWith=Ps,a.update=lg,a.updateWith=fg,a.values=Bt,a.valuesIn=cg,a.without=sh,a.words=io,a.wrap=id,a.xor=oh,a.xorBy=lh,a.xorWith=fh,a.zip=ch,a.zipObject=hh,a.zipObjectDeep=dh,a.zipWith=gh,a.entries=eo,a.entriesIn=no,a.extend=Js,a.extendWith=li,Lu(a,a),a.add=c0,a.attempt=uo,a.camelCase=pg,a.capitalize=to,a.ceil=h0,a.clamp=hg,a.clone=ad,a.cloneDeep=od,a.cloneDeepWith=ld,a.cloneWith=sd,a.conformsTo=fd,a.deburr=ro,a.defaultTo=zg,a.divide=d0,a.endsWith=vg,a.eq=On,a.escape=xg,a.escapeRegExp=mg,a.every=Eh,a.find=Th,a.findIndex=Is,a.findKey=Fd,a.findLast=Ih,a.findLastIndex=As,a.findLastKey=Bd,a.floor=g0,a.forEach=$s,a.forEachRight=ks,a.forIn=Ud,a.forInRight=Hd,a.forOwn=zd,a.forOwnRight=Kd,a.get=Eu,a.gt=cd,a.gte=hd,a.has=qd,a.hasIn=Ru,a.head=Os,a.identity=en,a.includes=Ph,a.indexOf=Ic,a.inRange=dg,a.invoke=Jd,a.isArguments=wt,a.isArray=q,a.isArrayBuffer=dd,a.isArrayLike=Ve,a.isArrayLikeObject=Ie,a.isBoolean=gd,a.isBuffer=lt,a.isDate=pd,a.isElement=vd,a.isEmpty=xd,a.isEqual=md,a.isEqualWith=_d,a.isError=Cu,a.isFinite=wd,a.isFunction=Yn,a.isInteger=zs,a.isLength=si,a.isMap=Ks,a.isMatch=yd,a.isMatchWith=bd,a.isNaN=Cd,a.isNative=Sd,a.isNil=Rd,a.isNull=Ed,a.isNumber=Gs,a.isObject=Ce,a.isObjectLike=Re,a.isPlainObject=gr,a.isRegExp=Su,a.isSafeInteger=Td,a.isSet=Ys,a.isString=oi,a.isSymbol=cn,a.isTypedArray=Ft,a.isUndefined=Id,a.isWeakMap=Ad,a.isWeakSet=Ld,a.join=Pc,a.kebabCase=_g,a.last=Cn,a.lastIndexOf=Dc,a.lowerCase=wg,a.lowerFirst=yg,a.lt=Od,a.lte=Nd,a.max=p0,a.maxBy=v0,a.mean=x0,a.meanBy=m0,a.min=_0,a.minBy=w0,a.stubArray=Nu,a.stubFalse=Pu,a.stubObject=u0,a.stubString=a0,a.stubTrue=s0,a.multiply=y0,a.nth=$c,a.noConflict=Jg,a.noop=Ou,a.now=ii,a.pad=bg,a.padEnd=Cg,a.padStart=Sg,a.parseInt=Eg,a.random=gg,a.reduce=Mh,a.reduceRight=Wh,a.repeat=Rg,a.replace=Tg,a.result=ig,a.round=b0,a.runInContext=d,a.sample=Bh,a.size=zh,a.snakeCase=Ig,a.some=Kh,a.sortedIndex=Uc,a.sortedIndexBy=Hc,a.sortedIndexOf=zc,a.sortedLastIndex=Kc,a.sortedLastIndexBy=Gc,a.sortedLastIndexOf=Yc,a.startCase=Lg,a.startsWith=Og,a.subtract=C0,a.sum=S0,a.sumBy=E0,a.template=Ng,a.times=o0,a.toFinite=qn,a.toInteger=X,a.toLength=Xs,a.toLower=Pg,a.toNumber=Sn,a.toSafeInteger=Pd,a.toString=de,a.toUpper=Dg,a.trim=$g,a.trimEnd=kg,a.trimStart=jg,a.truncate=Mg,a.unescape=Wg,a.uniqueId=f0,a.upperCase=Fg,a.upperFirst=Tu,a.each=$s,a.eachRight=ks,a.first=Os,Lu(a,function(){var e={};return Dn(a,function(n,t){he.call(a.prototype,t)||(e[t]=n)}),e}(),{chain:!1}),a.VERSION=m,mn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){a[e].placeholder=a}),mn(["drop","take"],function(e,n){ie.prototype[e]=function(t){t=t===u?1:De(X(t),0);var r=this.__filtered__&&!n?new ie(this):this.clone();return r.__filtered__?r.__takeCount__=He(t,r.__takeCount__):r.__views__.push({size:He(t,le),type:e+(r.__dir__<0?"Right":"")}),r},ie.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),mn(["filter","map","takeWhile"],function(e,n){var t=n+1,r=t==Le||t==Ke;ie.prototype[e]=function(i){var s=this.clone();return s.__iteratees__.push({iteratee:B(i,3),type:t}),s.__filtered__=s.__filtered__||r,s}}),mn(["head","last"],function(e,n){var t="take"+(n?"Right":"");ie.prototype[e]=function(){return this[t](1).value()[0]}}),mn(["initial","tail"],function(e,n){var t="drop"+(n?"":"Right");ie.prototype[e]=function(){return this.__filtered__?new ie(this):this[t](1)}}),ie.prototype.compact=function(){return this.filter(en)},ie.prototype.find=function(e){return this.filter(e).head()},ie.prototype.findLast=function(e){return this.reverse().find(e)},ie.prototype.invokeMap=V(function(e,n){return typeof e=="function"?new ie(this):this.map(function(t){return or(t,e,n)})}),ie.prototype.reject=function(e){return this.filter(ai(B(e)))},ie.prototype.slice=function(e,n){e=X(e);var t=this;return t.__filtered__&&(e>0||n<0)?new ie(t):(e<0?t=t.takeRight(-e):e&&(t=t.drop(e)),n!==u&&(n=X(n),t=n<0?t.dropRight(-n):t.take(n-e)),t)},ie.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ie.prototype.toArray=function(){return this.take(le)},Dn(ie.prototype,function(e,n){var t=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),i=a[r?"take"+(n=="last"?"Right":""):n],s=r||/^find/.test(n);i&&(a.prototype[n]=function(){var o=this.__wrapped__,c=r?[1]:arguments,g=o instanceof ie,_=c[0],w=g||q(o),C=function(ne){var ue=i.apply(a,tt([ne],c));return r&&A?ue[0]:ue};w&&t&&typeof _=="function"&&_.length!=1&&(g=w=!1);var A=this.__chain__,j=!!this.__actions__.length,U=s&&!A,Z=g&&!j;if(!s&&w){o=Z?o:new ie(this);var H=e.apply(o,c);return H.__actions__.push({func:ti,args:[C],thisArg:u}),new wn(H,A)}return U&&Z?e.apply(this,c):(H=this.thru(C),U?r?H.value()[0]:H.value():H)})}),mn(["pop","push","shift","sort","splice","unshift"],function(e){var n=Ir[e],t=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);a.prototype[e]=function(){var i=arguments;if(r&&!this.__chain__){var s=this.value();return n.apply(q(s)?s:[],i)}return this[t](function(o){return n.apply(q(o)?o:[],i)})}}),Dn(ie.prototype,function(e,n){var t=a[n];if(t){var r=t.name+"";he.call($t,r)||($t[r]=[]),$t[r].push({name:n,func:t})}}),$t[Xr(u,D).name]=[{name:"wrapper",func:u}],ie.prototype.clone=Ml,ie.prototype.reverse=Wl,ie.prototype.value=Fl,a.prototype.at=vh,a.prototype.chain=xh,a.prototype.commit=mh,a.prototype.next=_h,a.prototype.plant=yh,a.prototype.reverse=bh,a.prototype.toJSON=a.prototype.valueOf=a.prototype.value=Ch,a.prototype.first=a.prototype.head,nr&&(a.prototype[nr]=wh),a},Nt=xl();ht?((ht.exports=Nt)._=Nt,Ai._=Nt):Fe._=Nt}).call(X0)}(xr,xr.exports)),xr.exports}var J0=Z0();const V0=T0(J0),Q0=500,ep=({item:l,listIndex:p,itemComposition:u,selected:m,isOpen:y,columnsWidth:b,onClose:E,onSelectedChanged:I,onDoubleClick:T,onClick:$,onClickContextMenu:k,onThreeDotsButtonPressed:L,disableItemCompositionStyles:M,menu:G,onMouseEnter:W,onMouseLeave:ae,genericEnterKey:R})=>{const D=P.useRef(),z=P.useRef(null),te=P.useRef(null),[oe,ge]=P.useState(!1),[pe,we]=P.useState(0),[Te,Xe]=P.useState(0),[$e,nn]=P.useState({width:0,height:0}),[gn,Ue]=P.useState(!1);P.useEffect(()=>{te.current&&(te.current.offsetHeight!==$e.height||te.current?.offsetWidth!==$e.width)&&nn({width:te.current.offsetWidth,height:te.current.offsetHeight})},[$e.height,$e.width]),P.useEffect(()=>{oe||Le(),y||(ge(!1),we(0),Xe(0))},[y]);function Le(){const J=D.current,le=te?.current?.offsetHeight||300;if(!J)return;const{bottom:En}=J.getBoundingClientRect(),un=window.innerHeight,jn=En+le>un;Ue(jn)}const tn=J=>{J.preventDefault(),k?.(J);const le=te?.current?.offsetWidth||240,En=te?.current?.offsetHeight||300,un=z?.current?.getBoundingClientRect(),{innerWidth:jn,innerHeight:pn}=window;let Oe=J.clientX-(un?.left||0),Rn=J.clientY-(un?.top||0);J.clientX+le>jn&&(Oe=Oe-le),J.clientY+En>pn&&J.clientY>Q0&&(Rn=Rn-En),we(Oe),Xe(Rn),ge(!0)},Ke=J=>{J.preventDefault(),L?.(J),ge(!1)},Me=J=>{$?.(J),oe&&Se()},Se=()=>{E()};return $u({r:Se,backspace:Se,enter:()=>{y||R()}},[]),h.jsxs("div",{onDoubleClick:T,onClick:Me,onContextMenu:tn,ref:z,className:`group relative flex h-14 flex-row items-center pl-14 pr-5 ${m?"bg-primary/10 text-gray-100 dark:bg-primary/20":"focus-within:bg-gray-1 hover:bg-gray-1"} ${y?"z-40":""}`,onMouseEnter:W,onMouseLeave:ae,children:[y&&m&&h.jsx(vo,{item:l,menu:G,menuItemsRef:te,openedFromRightClick:oe,isOpen:y,posX:pe,posY:Te,isContextMenuCutOff:gn,genericEnterKey:R,handleMenuClose:Se}),h.jsx("div",{className:`absolute left-5 top-0 flex h-full w-0 flex-row items-center justify-start p-0 opacity-0 focus-within:opacity-100 group-hover:opacity-100 ${m&&"opacity-100"}`,children:h.jsx(Du,{onClick:J=>{J.stopPropagation(),I(!m)},checked:m,checkboxDataCy:`driveListItemCheckbox${p}`})}),M?h.jsx("div",{className:`grow-1 relative flex h-full w-full flex-row items-center border-b ${m?"border-primary/5":"border-gray-5"}`,children:u[0](l)},0):new Array(u.length).fill(0).map((J,le)=>h.jsx("div",{className:`relative flex h-full shrink-0 flex-row items-center border-b ${m?"border-primary/5":"border-gray-5"} ${b[le]}`,children:u[le](l)},le)),h.jsx("div",{className:`flex h-14 w-12 shrink-0 flex-col items-center justify-center border-b ${m?"border-primary/5":"border-gray-5"}`,children:h.jsx("button",{ref:D,className:`flex h-10 w-10 flex-col items-center justify-center rounded-md opacity-0 outline-none focus-visible:opacity-100 group-hover:opacity-100 ${m?"text-gray-80 hover:bg-primary/10 focus-visible:bg-primary/10":"text-gray-60 hover:bg-gray-10 focus-visible:bg-gray-10"}`,onClick:J=>{Ke(J)},children:h.jsx(je.DotsThree,{size:24,weight:"bold"})})})]})},np=({selectedItems:l,onTopSelectionCheckboxClick:p,items:u,header:m,orderBy:y,onOrderableColumnClicked:b,menu:E,displayMenuDiv:I,isVerticalScrollbarVisible:T,checkboxDataCy:$,onClose:k})=>h.jsx("div",{onClick:k,onContextMenu:k,className:"flex min-w-max h-12 shrink-0 flex-row px-5",children:h.jsxs("div",{className:"flex h-full min-w-full flex-row items-center border-b border-gray-10",children:[h.jsx("div",{className:"flex h-full flex-row items-center justify-between pr-4",children:h.jsx(Du,{checked:l.length>0,indeterminate:u.length>l.length&&l.length>0,onClick:p,checkboxDataCy:$})}),m.map(L=>h.jsxs("button",{onClick:L.orderable?()=>{b(L)}:void 0,"data-cy":"buttonDataCy"in L&&L?.buttonDataCy,className:`flex h-full shrink-0 flex-row items-center space-x-1.5 text-base font-medium text-gray-60 ${L.width} ${L.orderable?"cursor-pointer hover:text-gray-80":""}`,children:[h.jsx("span",{"data-cy":"textDataCy"in L&&L?.textDataCy,children:L.label}),L.name===y?.field&&L.orderable&&(y?.direction==="ASC"?h.jsx(je.ArrowUp,{size:14,weight:"bold"}):h.jsx(je.ArrowDown,{size:14,weight:"bold"}))]},L.name.toString())),T&&h.jsx("div",{className:"mr-15px"}),(E||I)&&h.jsx("div",{className:"flex h-full w-12 shrink-0"})]})}),tp=({skeletonItem:l,columns:p})=>h.jsxs("div",{"data-testid":"skeleton-loader-item",className:"group relative flex h-14 animate-pulse flex-row items-center px-5",children:[h.jsx("div",{className:"w-9 shrink-0"}),new Array(p.length).fill(0).map((u,m)=>h.jsx("div",{className:`relative flex h-full shrink-0 flex-row items-center overflow-hidden whitespace-nowrap border-b border-gray-5 ${p[m]}`,children:l?.[m]},`${u}-${m}`)),h.jsx("div",{className:"flex h-14 w-12 shrink-0 flex-col items-center justify-center border-b border-gray-5"})]}),_o=({skeleton:l})=>h.jsx(h.Fragment,{children:new Array(l.length).fill(0).map((p,u)=>h.jsx(tp,{skeletonItem:l[u].skeletonItem,columns:l[u].columns},`skinSkeletonRow${u}`))}),rp=({header:l,checkboxDataCy:p,items:u,itemComposition:m,selectedItems:y,onClick:b,onDoubleClick:E,onEnterPressed:I,onSelectedItemsChanged:T,isLoading:$,forceLoading:k,skinSkeleton:L,emptyState:M,orderBy:G,onOrderByChanged:W,onNextPage:ae,hasMoreItems:R,menu:D,displayMenuDiv:z,className:te,disableItemCompositionStyles:oe,onMouseEnter:ge,onMouseLeave:pe,headerBackgroundColor:we="bg-surface",keyBoardShortcutActions:Te,disableKeyboardShortcuts:Xe})=>{const $e=P.useRef(null),nn=F=>y.some(Q=>F.id===Q.id),gn=document.getElementById("scrollableList"),Ue=gn&&gn.scrollHeight>gn.clientHeight,Le=!R&&u.length===0&&!$,[tn,Ke]=P.useState(null),Me=new Array(25).fill(0).map(()=>({skeletonItem:L,columns:l.map(F=>F.width)})),Se=h.jsx(_o,{skeleton:Me});P.useEffect(()=>{const F=Q=>{$e.current&&!$e.current.contains(Q.target)&&Ke(null)};return document.addEventListener("mousedown",F),document.addEventListener("contextmenu",F),()=>{document.removeEventListener("mousedown",F),document.removeEventListener("contextmenu",F)}},[]);const rn=()=>{ae?.()},J=()=>{const F=y.map(Q=>({props:Q,value:!1}));T(F)},le=F=>{const Q=[...y.map(xe=>({props:xe,value:!1})),{props:F,value:!0}];T(Q)},En=()=>{if(y.length===1){const Q=y[0];I?.(Q)}},un=()=>{const Q=V0.difference(u,y).map(xe=>({props:xe,value:!0}));T(Q)},jn=()=>{y.length===u.length?J():un()},pn=F=>{if(Pn(),!F.orderable||!W)return;const Q=G?.field===F.name;W(Q?{field:F.name,direction:G.direction==="ASC"?"DESC":"ASC"}:{field:F.name,direction:F.defaultDirection??"ASC"})},Oe=F=>{Xe||F()},Rn=()=>{Te?.onRKeyPressed?.()},an=()=>{Te?.onBackspaceKeyPressed?.()};$u({"ctrl+a":()=>Oe(un),"meta+a":()=>Oe(un),esc:()=>Oe(J),r:()=>Oe(Rn),backspace:()=>Oe(an),delete:()=>Oe(an)},[u,y,Xe]);const Tn=(F,Q)=>{Q.metaKey||Q.ctrlKey?T([{props:F,value:!nn(F)}]):nn(F)||b?.(F),Ke(null)},Zn=(F,Q)=>{Q.preventDefault(),nn(F)||le(F),Ke(F.id)},Pn=()=>{Ke(null)},Mn=(F,Q)=>{F.stopPropagation(),Ke(xe=>xe?null:Q.id),nn(Q)||le(Q)};return h.jsx("div",{id:"generic-list-component",className:`relative isolate flex h-full flex-col overflow-x-auto overflow-y-hidden ${te}`,ref:$e,children:h.jsxs("div",{id:"scrollableList",className:"flex h-full flex-col min-w-max overflow-x-hidden overflow-y-auto",children:[h.jsx("div",{className:`sticky top-0 z-50 ${we}`,children:Le?null:h.jsx(np,{selectedItems:y,onTopSelectionCheckboxClick:jn,items:u,header:l,orderBy:G,onOrderableColumnClicked:pn,menu:D,displayMenuDiv:z,isVerticalScrollbarVisible:Ue,checkboxDataCy:p,onClose:Pn})}),Le?M:u.length>0&&!k?h.jsx(mo,{handleNextPage:rn,hasMoreItems:!!R,loader:Se,scrollableTarget:"scrollableList",children:u.map((F,Q)=>h.jsx(ep,{item:F,listIndex:Q,isOpen:tn===F.id,onClose:Pn,itemComposition:m,selected:nn(F),onDoubleClick:E&&(()=>E(F)),onClick:xe=>Tn(F,xe),onClickContextMenu:xe=>Zn(F,xe),onThreeDotsButtonPressed:xe=>Mn(xe,F),columnsWidth:l.map(xe=>xe.width),menu:D,onSelectedChanged:xe=>T([{props:F,value:xe}]),disableItemCompositionStyles:oe,onMouseEnter:ge,onMouseLeave:pe,genericEnterKey:En},F.id))}):h.jsx("div",{children:Se}),u.length>0&&h.jsx("div",{"data-testid":"outside-click-element",className:"h-full w-full py-6",onClick:J,onContextMenu:F=>{F.preventDefault(),J()}})]})})},ip=({isOpen:l,onClose:p,children:u,maxWidth:m,className:y,width:b,preventClosing:E=!1,stopMouseDownPropagation:I=!1})=>{const T=P.useRef(null),[$,k]=P.useState(l),[L,M]=P.useState("opacity-0"),[G,W]=P.useState("scale-95"),ae=()=>{const D=document.querySelectorAll("[data-modal]"),z=D[D.length-1];T.current===z&&p()},R=D=>{I&&D.stopPropagation()};return P.useEffect(()=>{if(l){const D=setTimeout(()=>{M("opacity-100"),W("scale-100")},10);return k(!0),()=>clearTimeout(D)}else{M("opacity-0"),W("scale-95");const D=setTimeout(()=>{k(!1)},150);return()=>clearTimeout(D)}},[l]),P.useEffect(()=>{const D=z=>{T.current&&!T.current.contains(z.target)&&!E&&(z.preventDefault(),ae())};return l&&document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}},[l,p,E]),P.useEffect(()=>{const D=z=>{z.key==="Escape"&&!E&&(z.preventDefault(),ae())};return l&&window.addEventListener("keydown",D),()=>{window.removeEventListener("keydown",D)}},[l,p,E]),h.jsx(h.Fragment,{children:$&&h.jsxs("div",{className:"m-0",onMouseDown:R,role:"dialog","aria-modal":"true",children:[h.jsx("div",{className:`
65
65
  fixed
66
66
  min-h-full
67
67
  inset-0