-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path89621-690abed2248e27f.js.download
1 lines (1 loc) · 6.65 KB
/
89621-690abed2248e27f.js.download
1
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[89621],{89621:function(e,r,t){t.d(r,{Z:function(){return h}});var n=t(62230),c=t(98240),o=t(52322),u=t(2784),i=t(92322),l=t(22504),s=t(47752),a=t(64722),d=t(16882),f=function(e){return e?Array.from(e.querySelectorAll("tbody > tr:first-child > td")).reduce((function(e,r,t){return"sticky"===getComputedStyle(r).position?Math.max(e,t):e}),-1):-1},v=function(e,r){return r<0||!e?[]:Array.from(e.querySelectorAll("tr > *:nth-child(".concat(r+1,")")))},m="table-cell-shadow-right",h=function(e){var r=e.tableKey,t=e.tableColumns,h=e.tableData,b=e.showFilters,y=e.filters,p=e.emptyComponent,w=void 0===p?null:p,g=e.insertRows,E=e.tableClassName,L=e.tableStyle,R=e.useInViewPort,x=e.wrapperClassName,C=void 0===x?"":x,k=e.tableWrapperStyle,S=e.fixedHeader,W=void 0===S||S,H=e.customFixHeaderPosition,N=void 0===H?0:H,z=e.scrollRef,P=e.horizontalDraggable,Z=void 0!==P&&P,D=e.stickyHeaderConfig,F=void 0===D?{}:D,M=(0,c.Z)(e,["tableKey","tableColumns","tableData","showFilters","filters","emptyComponent","insertRows","tableClassName","tableStyle","useInViewPort","wrapperClassName","tableWrapperStyle","fixedHeader","customFixHeaderPosition","scrollRef","horizontalDraggable","stickyHeaderConfig"]),j=(0,u.useRef)(),A=(0,u.useRef)(),B=(0,u.useRef)(),I=(0,u.useRef)(),K=(0,u.useRef)([]),V=(0,u.useRef)(),_=(0,u.useRef)(),O=F.useNewStickyHeaderLogic,q=void 0!==O&&O,Y=F.additionalVerticalScrollHandler,T=void 0===Y?function(){}:Y,U=F.additionalHorizontalScrollHandler,X=void 0===U?function(){}:U,G=F.resizeHandler,J=F.resizeDebounceDuration,Q=void 0===J?50:J,$=F.cleanUpFunc,ee=void 0===$?function(){}:$,re=F.getBodyRowIndexAsRef,te=void 0===re?function(){return 0}:re,ne=(0,u.useCallback)((function(){if(j.current){var e=j.current.offsetWidth<j.current.scrollWidth||N;if(q){var r,t,n;if(!A.current||!I.current)return;var c,o,u=j.current.getBoundingClientRect(),i=u.top,l=u.bottom,s=A.current.offsetHeight,a=i-N<=0&&l-N-s>0,d=null!==(c=null===(r=A.current.childNodes)||void 0===r||null===(t=r[0])||void 0===t?void 0:t.childNodes)&&void 0!==c?c:[],f=I.current.childNodes,v=te(f),m=null!==(o=null===f||void 0===f||null===(n=f[v])||void 0===n?void 0:n.childNodes)&&void 0!==o?o:[];if(e&&a){A.current.style.transform="",B.current||(B.current=A.current.cloneNode(!0),B.current.style.visibility="hidden",I.current.parentElement.insertBefore(B.current,I.current)),A.current.style.position="fixed",A.current.style.top="".concat(N,"px"),A.current.scrollLeft=j.current.scrollLeft,A.current.style.overflow="hidden",A.current.style.width="".concat(j.current.offsetWidth,"px"),j.current.onscroll=function(){A.current.scrollLeft=j.current.scrollLeft,null===X||void 0===X||X(j.current,A.current,I.current)};var b=!!h&&h.length>0,y=K.current;d.forEach((function(e,r){var t="";if(b){var n,c=null===(n=m[r])||void 0===n?void 0:n.offsetWidth;t=c?"".concat(c,"px"):""}else t=y[r]?"".concat(y[r],"px"):"";e.style.minWidth=t})),null===T||void 0===T||T(j.current,A.current,I.current)}else{var p;d.forEach((function(e,r){K.current[r]=e.offsetWidth})),null===(p=B.current)||void 0===p||p.remove(),B.current=null,A.current.style.position="",A.current.style.top="",A.current.style.overflowX="",A.current.style.width="",j.current.onscroll=null,d.forEach((function(e){e.style.minWidth=""})),null===ee||void 0===ee||ee(j.current,A.current,I.current)}}else{if(!A.current)return;var w=j.current.getBoundingClientRect(),g=w.top,E=w.bottom;A.current.style.transform=e&&g-N<=0?"translateY(".concat(-1*g+N,"px)"):"",E<=0&&(A.current.style.transform="")}}}),[h,N,q,T,X,ee]),ce=(0,u.useCallback)((function(e,r){e&&(0===e.scrollLeft?r.forEach((function(e){return e.classList.remove(m)})):r.forEach((function(e){return e.classList.add(m)})))}),[]);(0,u.useEffect)((function(){if(j.current&&j.current.offsetWidth<j.current.scrollWidth){ne();var e=f(j.current),r=v(j.current,e);ce(j.current,r)}}),[h]);var oe=function(){j.current&&(j.current.style.overflow="",j.current.removeEventListener("scroll",V.current)),A.current&&(A.current.style.transform=""),(null===z||void 0===z?void 0:z.current)?z.current.removeEventListener("scroll",ne):(l.Pc.removeEventListener(ne,r),l.Pc.removeEventListener(_.current,r?"".concat(r,"-shadow"):void 0))},ue=function(){ne(),oe(),function(){if(j.current)if(j.current.offsetWidth<j.current.scrollWidth||N){var e=f(j.current),t=v(j.current,e);j.current.style.overflow="scroll hidden",(null===z||void 0===z?void 0:z.current)?z.current.addEventListener("scroll",ne):(l.Pc.addEventListener(ne,200,r),_.current=function(){ce(j.current,t)},l.Pc.addEventListener(_.current,0,r?"".concat(r,"-shadow"):void 0)),e>-1&&(V.current=function(e){ce(e.target,t)},j.current.addEventListener("scroll",V.current))}else oe()}(),function(){if(j.current&&le.current){var e=0,r=j.current.scrollLeft,t=function(t){j.current.scrollLeft=r-t.x+e},n=function(r){j.current.style.cursor="grabbing",e=r.x,le.current.addEventListener("mousemove",t),document.addEventListener("mouseup",c)},c=function(e){j.current.style.cursor="grab",r=j.current.scrollLeft,le.current.removeEventListener("mousemove",t),document.removeEventListener("mouseup",c)};j.current.offsetWidth<j.current.scrollWidth&&Z?(j.current.style.cursor="grab",j.current.style.userSelect="none",le.current.addEventListener("mousedown",n)):(j.current.style.cursor="",j.current.style.userSelect="",le.current.removeEventListener("mousedown",n),le.current.removeEventListener("mousemove",t),document.removeEventListener("mouseup",c))}}()},ie=(0,u.useCallback)((0,i.Z)((function(){return G(j.current,A.current,I.current)}),Q),[G,Q,j.current,A.current,I.current]);(0,u.useEffect)((function(){return s.Z.observe({target:j.current,callback:ue}),G&&window.addEventListener("resize",ie),function(){s.Z.unobserve({target:j.current}),G&&window.removeEventListener("resize",ie),oe()}}),[q,t,ie]);var le=(0,u.useRef)();return(0,o.jsxs)(o.Fragment,{children:[b&&y,(0,o.jsx)(a.oY,{}),(0,o.jsx)(a.y6,{className:C,addCSS:k,ref:j,children:(0,o.jsx)(d.Z,(0,n.Z)({columns:t,data:h,rowKey:M.rowKey||"id",fixedHeader:W,emptyText:w,insertRows:g,tableClassName:"".concat(E||""),tableStyle:L,useInViewPort:R,tableHeaderRef:A,tableBodyRef:I,tableRef:le},M))})]})}},47752:function(e,r,t){var n=t(95210),c=t(44711),o=t(15798),u=function(){function e(){var r,t=this;((0,n.Z)(this,e),this.callbackMap=new WeakMap,o.isServer)||(r="ResizeObserver"in window?window.ResizeObserver:c.do,this.observer=new r((function(e){e.forEach((function(e){t.callbackMap.get(e.target)(e)}))})))}var r=e.prototype;return r.observe=function(e){e.target&&(this.callbackMap.set(e.target,e.callback),this.observer.observe(e.target,e.options))},r.unobserve=function(e){e.target&&(this.callbackMap.delete(e.target),this.observer.unobserve(e.target))},e}(),i=Object.freeze(new u);r.Z=i}}]);