-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
5656-7b5e6f4b35965363.js.download
1 lines (1 loc) · 13.6 KB
/
5656-7b5e6f4b35965363.js.download
1
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5656],{63921:function(e,t,a){"use strict";a.d(t,{wQ:function(){return E}});var l,r,n=a(85893),i=a(94184),o=a.n(i),s=a(67294),d=a(59864),c=a(63470),u=a(7334),h=a(99431),g=a(59112),p=(a(10045),a(59470)),m=a(79154),f=a(74528),w=a(22062);function b(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}let x=(e,t)=>{if(b(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let a=Object.keys(e),l=Object.keys(t);return a.length===l.length&&a.every(a=>Object.prototype.hasOwnProperty.call(t,a)&&b(e[a],t[a]))};var v=a(34123),_=a(74007),y=a(13677),C=a(80867),j=a(52482),S=a.n(j),z=(0,s.memo)((0,s.forwardRef)(function(e,t){let{data:a,rowHeight:l,maxRows:r,renderRow:i,virtualTableHeight:o}=e,[d,c]=(0,s.useState)(!1),[u,g]=(0,s.useState)(0),p=(0,s.useCallback)(e=>{let{scrollOffset:t}=e,a=(0,y.Z)(()=>{c(!1)},400,{trailing:!0});if(0==u){g(t);return}g(t),Math.abs(t-u)>380&&(c(!0),a.cancel(),a())},[u]),m=(0,s.useCallback)(e=>{let{data:t,index:a,style:l}=e;return(0,n.jsx)("div",{style:l,className:S().virtualRow,children:i(t[a],a)})},[i]),f=(0,s.useCallback)(e=>{let{style:t}=e;return(0,n.jsx)("div",{style:t,className:S().virtualRow,children:(0,n.jsx)(h.O,{height:l/3})})},[l]),w=(0,s.useCallback)((t,a)=>e.getRowKey(a[t],0),[e.getRowKey]);if(!l||!r)return console.error("Missing props: rowHeight and maxRows are required when using virtual"),null;let b=a.length*l;return(0,n.jsx)(C.t7,{height:Math.min(o||r*l,b),itemCount:a.length,itemSize:l,itemKey:w,itemData:a,width:"100%",overscanCount:12,useIsScrolling:!0,onScroll:p,outerRef:t,children:d?f:m})}));(l=r||(r={})).asc="ascending",l.desc="descending",l.none="none";let N=[r.asc,r.desc],R=e=>{let{className:t,collapse:a,expanded:l,item:r,onMouseEnter:i,onMouseLeave:d,onScrollComplete:c,renderPendingRows:u,renderRow:p,rowEventHandlers:m,getRowChildren:f,shouldRenderEmptyChildren:w,childRowClassName:b,rowKey:x}=e,v=(0,s.useRef)(null),_=(0,s.useMemo)(()=>f&&f(e.item,e.depth),[f,e.depth,e.item]);(0,s.useEffect)(()=>{v.current&&e.scrollIntoView&&v.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}),c()},[e.scrollIntoView,c]),(0,s.useEffect)(()=>{w||!l||e.childrenPending||e.childrenError||_&&0!==_.length||a(x,r)},[a,l,r,e.childrenError,e.childrenPending,_,x,w]);let y=(0,s.useMemo)(()=>l?e.childrenPending?u(r,e.depth+1):e.childrenError?(0,n.jsx)("div",{className:o()(S().row,S().metaRow),children:(0,n.jsx)(h.O,{status:"error",height:e.rowHeight,children:(0,n.jsx)(g.x,{langKey:"rpcerror:EGeneral:Other"})})}):null==_?void 0:_.map((t,a)=>p(t,a,e.depth+1)):void 0,[l,r,e.childrenError,e.childrenPending,e.depth,e.rowHeight,u,p,f]),C=(0,s.useMemo)(()=>{let e={};return Object.entries(null!=m?m:{}).forEach(t=>{let[a,l]=t;e[a]=e=>{l(r)}}),e},[r,m]);return(0,n.jsxs)(n.Fragment,{children:[e.rowHeader,(0,n.jsxs)("div",{ref:v,className:o()(S().rowContainer,t,{[S().expanded]:l}),children:[(0,n.jsx)("div",{className:o()(S().row,e.depth>0&&b,{[S().childRow]:e.depth>0}),onMouseEnter:()=>null==i?void 0:i(r),onMouseLeave:()=>null==d?void 0:d(void 0),...C,role:"row",style:{height:e.rowHeight||48},children:e.columns.map(t=>e.renderCell(e.item,t,e.depth))}),y]})]})},k=(0,s.memo)(R,(e,t)=>{let a=(0,c.Z)(t.item,e.item),l=x((0,u.Z)(t,"item"),(0,u.Z)(e,"item"));return a&&l}),D=e=>{let{sortDisabled:t}=e,a=(0,s.useRef)(null);if(e.config.hidden)return null;let l=e.config.title||e.config.dataKey,i=(0,n.jsx)("div",{className:S().text,ref:a,children:l});return(0,n.jsxs)("div",{className:o()(S().cell,e.config.headerClassName,!t&&e.config.sort&&S().sortable,e.sortConfig&&e.sortConfig!==r.none&&!t&&S().sorted,e.compact?"label-3":"caption-3"),tabIndex:-1,onClick:!t&&e.config.sort?()=>e.sortColumn(e.config):void 0,onKeyPress:a=>"Enter"===a.key&&!t&&e.config.sort&&e.sortColumn(e.config),style:{flex:e.config.scale||1,maxWidth:e.config.width,minWidth:e.config.width,width:e.config.width},role:"columnheader","aria-sort":e.sortConfig?e.sortConfig:void 0,"data-testid":e.config["data-testid"],children:[i,e.config.sort&&!e.config.hideSortToggle&&(0,n.jsxs)("div",{className:o()(S().sort,"ml1/4"),role:"button",tabIndex:0,children:[(0,n.jsx)(p.U,{size:"x-small",color:t||e.sortConfig!==r.asc?void 0:"#000"}),(0,n.jsx)(m.p,{size:"x-small",color:t||e.sortConfig!==r.desc?void 0:"#000"})]})]})},T=e=>(0,n.jsxs)("div",{className:o()("pv3/2",S().tableHeader,e.className),"aria-label":e.title,children:[(0,n.jsx)("span",{className:"body-3",children:e.title}),e.meta]}),E=e=>{let{header:t=!0,compact:a,rowClassName:l,childRowClassName:i,rowEventHandlers:u,defaultSort:p,emptyTextKey:b,getEmptyContent:x,getRowChildren:y,getRowEmptyContent:C,getRowError:j,getRowHeader:R,getRowKey:T,getRowPending:E,getRowPendingCount:P,isRowSelected:K,multiExpand:H=!0,offset:O=0,onRequestChildData:M,onRequestData:I,onRowSelect:W,onPagination:V,onFirstRowChange:A,pendingCount:L,responsive:B,rowHeight:F=48,sortConfig:U=N,shouldRenderEmptyChildren:Z=!0,overflowVisible:Q,virtual:q,unknownTotal:G,footer:J,bodyCollapsable:X,onBodyCollapsedChange:Y,tableRef:$,onSortData:ee,virtualTableHeight:et,dataTestId:ea}=e,el=(0,s.useRef)(null),er=(0,s.useRef)(null),en=(0,s.useRef)({}),ei=(0,s.useRef)(),eo=(0,s.useRef)(null),[es,ed]=(0,s.useState)({}),[ec,eu]=(0,s.useState)(0),[eh,eg]=(0,s.useState)(0),[ep,em]=(0,s.useState)({}),[ef,ew]=(0,s.useState)(),[eb,ex]=(0,s.useState)(!1),ev=(0,s.useMemo)(()=>{let t=e.children;return e.children&&d.isFragment(e.children)&&(t=e.children.props.children),s.Children.map(s.Children.toArray(t).filter(e=>!!e),e=>(0,s.isValidElement)(e)&&e.props)},[e.children]);(0,s.useEffect)(()=>{void 0!==e.offset&&e.pageSize&&eu(e.offset/e.pageSize)},[e.offset,e.pageSize]),(0,s.useEffect)(()=>{A&&A(ef)},[ef,A]),(0,s.useEffect)(()=>{let e=()=>{var e,t;let a=q?eo:el;eg(Number(null===(e=er.current)||void 0===e?void 0:e.clientWidth)-Number(null===(t=a.current)||void 0===t?void 0:t.clientWidth))};return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[es,ec,e.pageSize,e.maxRows,e.offset,e.rowHeight,e.total,q]);let e_=(0,s.useMemo)(()=>{let t=ep;p&&Object.keys(p).some(e=>p[e]!==en.current[e])&&(en.current=p,em(p),t=p);let a=[...e.data].sort((e,a)=>{for(let l in t){let n,i;let o=t[l];if(o===r.none)continue;let s=ev.find(e=>e.dataKey===l);"function"==typeof(null==s?void 0:s.sort)?(n=s.sort(e),i=s.sort(a)):(n=e[l],i=a[l]),n=n||0,i=i||0;let d=o===r.asc?-1:1;if(n<i)return d;if(n>i)return-d}return 0});if(A&&!(0,c.Z)(a[0],ef)&&ew(a[0]),e.pageSize){let t=a.splice(e.pageSize*ec-O,e.pageSize);return!I&&0===t.length&&ec>0&&eu(0),t}return a},[ev,p,ef,O,A,I,ec,e.data,e.pageSize,ep]),ey=(0,s.useCallback)((e,t)=>{let a=es[e];return(!a&&(ei.current=e,M&&M(t)),H)?ed(t=>({...t,[e]:!a})):ed({[e]:!a})},[es,M,H]),eC=(0,s.useCallback)(t=>{let a=t.sortConfig||U;if(0===a.length)return;let l=ep[t.dataKey],r=a.findIndex(e=>e===l),n=r===a.length-1?0:r+1,i=a[n],o=e.multiSort?{[t.dataKey]:i,...ep}:{[t.dataKey]:i};null==ee||ee(o),em(o)},[e.multiSort,ep,U]),ej=(0,s.useCallback)(()=>{if(!e.pageSize||ec===Math.ceil(e.total||e.data.length/e.pageSize)+1)return;let t=ec+1;e.total&&(t+1)*e.pageSize-O>e.data.length&&I&&I(t*e.pageSize,e.pageSize,e.total),eu(t),V&&V({type:"next"})},[ec,e.data.length,e.pageSize,e.total,I,V,O]),eS=(0,s.useCallback)(()=>{e.pageSize&&(e.total&&I&&I(0,e.pageSize,e.total),eu(0),V&&V({type:"first"}))},[e.pageSize,e.total,I,V]),ez=(0,s.useCallback)(()=>{var t;if(!e.pageSize)return;let a=null!==(t=e.total)&&void 0!==t?t:e.data.length,l=Math.ceil(a/e.pageSize)-1;e.total&&(l+1)*e.pageSize-O>e.data.length&&I&&I(l*e.pageSize,e.pageSize,e.total),eu(l),V&&V({type:"last"})},[e.pageSize,e.data.length,e.total,I,V,O]),eN=(0,s.useCallback)(()=>{if(!e.pageSize||0===ec)return;let t=ec-1;e.total&&t*e.pageSize<e_.length+O&&I&&I(t*e.pageSize,e.pageSize,e.total),eu(t),V&&V({type:"prev"})},[ec,e.pageSize,e_.length,O,e.total,I,V]),eR=(0,s.useCallback)(e=>{let t=e.sort?ep[e.dataKey]:void 0;return(0,n.jsx)(D,{compact:a,config:e,sortColumn:eC,sortConfig:t,sortDisabled:eb||e.hideSortToggle},"header-cell-".concat(e.dataKey))},[eb,a,ep,eC]),ek=(0,s.useCallback)(()=>{Y&&Y(!eb),ex(!eb)},[eb,Y]),eD=(0,s.useCallback)(()=>(0,n.jsxs)("div",{className:o()(S().row,{relative:X}),role:"row","data-testid":"".concat(ea,"-header-row"),style:{height:F},children:[ev.map(eR),(0,n.jsx)("span",{className:S().scrollPad,style:{width:"".concat(eh,"px")}}),X&&e_.length>0&&(0,n.jsx)("button",{className:o()(S().collapseButton,"no-tab-highlight"),onClick:ek,children:(0,n.jsx)(m.p,{size:"small",className:o()(S().arrow,{[S().right]:eb})})})]}),[X,eb,ev,e_.length,eR,F,eh,ek]),eT=(0,s.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=t?1:5;return!t&&L&&(a=L),t>0&&e&&P&&(a=P(e,t)),Array.from(Array(a).keys()).map(e=>(0,n.jsx)("div",{"data-testid":"pending-row",children:(0,n.jsx)("div",{className:o()(S().row,S().metaRow),style:{height:F},children:(0,n.jsx)(_.u,{className:o()("w-100",S().loader)})})},"row-pending-".concat(e)))},[F,P,L]),eE=(0,s.useCallback)((e,t,a)=>{if(t.hidden)return null;let l=y&&y(e,a),r=T(e,a),i=l&&(null==l?void 0:l.length)&&t.expandOnClick?()=>ey(r,e):void 0,s=t.render?t.render(e,a,()=>ey(r,e),es[r]):e[t.dataKey],d=()=>{t.onClick&&t.onClick(e),i&&i()};return(0,n.jsx)("div",{className:o()(S().cell,t.className),onClick:d,onKeyPress:e=>"Enter"===e.key&&d(),role:i?"button":"cell",tabIndex:-1,style:{flex:t.scale,maxWidth:t.width,minWidth:t.width||0,width:t.width},children:(0,n.jsx)("div",{className:o()(S().text,{[S().textOverflow]:l&&(null==l?void 0:l.length)},t.innerClassName),children:s||t.emptyValue})},"cell-".concat(t.dataKey))},[es,y,T,ey]),eP=(0,s.useCallback)(function(e){let t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!a&&x&&(t=x()),e&&a>0&&C&&(t=C(e,a)),t||(0,n.jsxs)("div",{className:o()("flex-column flex items-center",{pv6:0===a,pv1:a>0}),children:[(0,n.jsx)("div",{className:o()(S().emptyIcon,"mb1 flex-column flex items-center"),children:(0,n.jsx)(f.H,{color:"#ffffff",size:"medium",className:o()("bg-N100",S().emptyIcon)})}),(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:"caption-1",children:(0,n.jsx)(g.x,{langKey:b||"general:NoDataFound"})})})]})},[b,x,C]),eK=(0,s.useCallback)(()=>ei.current=void 0,[ei]),eH=(0,s.useCallback)(function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=0===a?T(e,a):"".concat(T(e,a),"-").concat(t),s=es[r],d=R&&R(e,a),c=E&&E(e,a+1),h=j&&j(e,a+1);return(0,n.jsx)(k,{rowKey:r,childrenError:h,childrenPending:c,className:o()(K&&K(e)?S().selectedRow:void 0,l),childRowClassName:i,columns:ev,depth:a,expanded:s,item:e,onScrollComplete:eK,onMouseEnter:W,onMouseLeave:W,rowEventHandlers:u,renderCell:eE,renderEmptyContainer:eP,renderPendingRows:eT,renderRow:eH,getRowChildren:y,rowHeader:d,rowHeight:F,scrollIntoView:ei.current===r,shouldRenderEmptyChildren:Z,collapse:ey},r)},[i,ev,es,y,j,R,T,E,K,W,eK,eE,eP,eT,l,u,F,Z,ey]),eO=(0,s.useCallback)(()=>e.pending?eT():0===e_.length?eP():e.virtual?(0,n.jsx)(z,{ref:eo,data:e_,renderRow:eH,rowHeight:F,maxRows:e.maxRows,virtualTableHeight:et,pending:e.pending,getRowKey:e.getRowKey,renderEmptyContainer:eP,renderPendingRows:eT}):e_.map((e,t)=>eH(e,t)),[e_,e.pending,eT,eH,eP]),eM=e.total;void 0!==eM||e.pending||e.error||(eM=e.data.length);let[eI,eW]=(0,s.useState)(eM);(0,s.useEffect)(()=>{void 0!==eM&&eW(eM)},[eM]);let eV=e.pageSize==e.data.length,eA=G?e.pageSize&&(eV||ec>0):e.pageSize&&eI&&eI>e.pageSize,eL=t=>{q&&(t.preventDefault(),40==t.keyCode?eo.current.scrollTop+=e.rowHeight:38==t.keyCode&&(eo.current.scrollTop-=e.rowHeight))},eB=()=>{q&&er.current.focus()};return(0,n.jsx)("div",{"aria-busy":e.pending,className:o()(S().grid,e.className,eA&&S().paginated,{[S().overflowVisible]:Q}),role:"table","data-testid":ea,ref:$,children:e.error?(0,n.jsxs)(h.O,{status:"error",height:384,children:[(0,n.jsx)(w.v,{size:"small"}),(0,n.jsx)(g.x,{langKey:"rpcerror:EGeneral:Other"})]}):(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)("div",{className:o()(e.headerClassName,S().header,{md:B}),role:"rowgroup",children:eD()}),(0,n.jsx)("div",{className:o()(S().bodyContainer,"no-tab-highlight",{"hidden-position":eb}),ref:er,tabIndex:q?-1:void 0,onKeyDown:eL,onClick:eB,children:(0,n.jsx)("div",{className:o()(S().body,"no-tab-highlight"),ref:el,role:"rowgroup","data-testid":"".concat(ea,"-body"),style:e.maxRows&&!q?{maxHeight:(e.rowHeight||48)*e.maxRows}:void 0,children:eO()})}),e.pageSize&&eI&&eA?(0,n.jsxs)("div",{className:S().footer,children:[J,(0,n.jsx)(v.t,{handleNextPage:ej,handlePreviousPage:eN,handleFirstPage:eS,handleLastPage:ez,nextPageAriaLabel:"Next Page",page:ec,disabled:e.pending,pageSize:e.pageSize,currentPageSize:e.data.length,unknownTotal:G,previousPageAriaLabel:"Previous Page",total:eI})]}):null]})})};E.Header=T,E.Column=e=>null;let P=s.memo;P(E)},60623:function(e,t,a){"use strict";a.d(t,{B:function(){return l.B},R:function(){return l.R}});var l=a(79049)},52482:function(e){e.exports={grid:"DataTable_grid__Wa0lj",bodyContainer:"DataTable_bodyContainer__WEBp1",body:"DataTable_body__Ah0gk",overflowVisible:"DataTable_overflowVisible__N0bM_",row:"DataTable_row__6jUl1",childRow:"DataTable_childRow__UqPmw",selectedRow:"DataTable_selectedRow__fkr_J",metaRow:"DataTable_metaRow__jjP2y",paginated:"DataTable_paginated___A9Ti",rowContainer:"DataTable_rowContainer__Wja3X",expanded:"DataTable_expanded__o9UOC",cell:"DataTable_cell__UesyJ",header:"DataTable_header__zQqQV",sortable:"DataTable_sortable__43uAd",sorted:"DataTable_sorted__ge3SC",text:"DataTable_text__Nh1Ru",headerContentWrap:"DataTable_headerContentWrap__OKPcD",textOverflow:"DataTable_textOverflow__QgPgi",sort:"DataTable_sort__sJDus",footer:"DataTable_footer__HGWOH",scrollPad:"DataTable_scrollPad__HhrgO",emptyIcon:"DataTable_emptyIcon__Ru6aE",virtualRow:"DataTable_virtualRow__XcT9x",collapseButton:"DataTable_collapseButton__1ga1n",arrow:"DataTable_arrow__DF_ue",right:"DataTable_right__8l04h"}}}]);