simple-table-core 0.5.3 → 0.5.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.js +1 -1
- package/package.json +1 -3
- package/dist/index.css +0 -2
- package/dist/index.css.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import t,{useState as o,useRef as a,useCallback as c,useEffect as i,Children as s,useLayoutEffect as l,forwardRef as u,createRef as d,createContext as f,useContext as h,Fragment as v,useMemo as g,useReducer as m}from"react";var p=function(){return p=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},p.apply(this,arguments)};function w(e,n,r){if(r||2===arguments.length)for(var t,o=0,a=n.length;o<a;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var b=function(e){var n={};return s.forEach(e,(function(e){if(e&&e.ref&&e.ref.current){var r=e.ref.current.getBoundingClientRect();n[e.key]=r}})),n},C=function(e){var n,r,c=e.allowHorizontalAnimate,s=void 0===c||c,u=e.children,d=e.pauseAnimation,f=e.tableRef,h=a(!1),v=o({}),g=v[0],m=v[1],p=o({}),w=p[0],C=p[1],y=(n=u,r=a(),i((function(){r.current=n}),[n]),r.current);return l((function(){var e=b(u);m(e)}),[u]),l((function(){var e=b(y);C(e);var n=f.current,r=function(){h.current=!0;var e=b(y);m(e),C(e)},t=function(){h.current=!1};return null==n||n.addEventListener("scroll",r),null==n||n.addEventListener("scrollend",t),function(){null==n||n.removeEventListener("scroll",r),null==n||n.removeEventListener("scrollend",t)}}),[y,f]),i((function(){d||h.current||Object.keys(w).length&&t.Children.forEach(u,(function(e){if(e){var n=e.ref.current,r=w[e.key],t=g[e.key];if(r&&t){var o=r.left-t.left,a=s?0:r.top-t.top,c=Math.abs(o),i=Math.abs(a);(c>10||i>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(a,"px)"),n.style.transition="transform 0s, opacity 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform 300ms ease-out, opacity 300ms ease-out"}))}))}}}))}),[s,g,u,d,w]),u},y=!1,x=function(e){var n=e.draggedHeaderRef,r=e.headersRef,t=e.hoveredHeaderRef,o=e.onTableHeaderDragEnd;return{handleDragStart:function(e){n.current=e},handleDragOver:function(e){!function(e){var a;if(!y&&(t.current=e,e.accessor!==(null===(a=n.current)||void 0===a?void 0:a.accessor)&&null!==n.current&&!y)){if(y=!0,!r.current)return;var c=w([],r.current,!0),i=c.findIndex((function(e){var r;return e.accessor===(null===(r=n.current)||void 0===r?void 0:r.accessor)})),s=c.findIndex((function(n){return n.accessor===e.accessor}));if(void 0===i||void 0===s)return;var l=c.splice(i,1)[0];c.splice(s,0,l),JSON.stringify(c)!==JSON.stringify(r.current)&&setTimeout((function(){o(c),setTimeout((function(){y=!1}),500)}),50)}}(e)},handleDragEnd:function(){n.current=null,t.current=null}}},D=function(e,n){var r=!0,t=!0;return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];if(r)return r=!1,void setTimeout((function(){return t=!1}),n);t||(e.apply(this,o),t=!0,setTimeout((function(){return t=!1}),n))}},R=u((function(r,t){var c,s=r.draggable,l=r.draggedHeaderRef,u=r.columnResizing,d=r.forceUpdate,f=r.headersRef,h=r.hoveredHeaderRef,v=r.index,g=r.onSort,m=r.onTableHeaderDragEnd,w=r.setIsWidthDragging,b=r.sort,C=r.sortDownIcon,y=r.sortUpIcon,R=a({pageX:0,pageY:0}),I=o(!1),E=I[0],N=I[1],M=null===(c=f.current)||void 0===c?void 0:c[v],k=Boolean(null==M?void 0:M.isSortable),L="st-header-cell ".concat(M===h.current?"st-hovered":""," ").concat(E?"st-dragging":""," ").concat(k?"clickable":""," ").concat(s&&!k?"draggable":""),A=x({draggedHeaderRef:l,headersRef:f,hoveredHeaderRef:h,onTableHeaderDragEnd:m}),T=A.handleDragStart,S=A.handleDragOver,B=A.handleDragEnd,H=a(D((function(e){S(e)}),100)).current,O=function(e){e.isSortable&&g(v,e.accessor)};return i((function(){var e=function(e){var n=new Image;n.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",e.dataTransfer.setDragImage(n,0,0)};return document.addEventListener("dragend",e,!1),function(){document.removeEventListener("dragend",e)}}),[]),M?e("div",p({className:L,ref:t,style:{width:M.width}},{children:[n("div",p({className:"st-header-label",draggable:s,onClick:function(){return O(M)},onDragStart:function(e){s&&M&&(e.dataTransfer.dropEffect="move",function(e){N(!0),T(e)}(M))},onDragOver:function(e){return function(e,n){e.preventDefault(),e.dataTransfer.dropEffect="move";var r=e.pageX,t=e.pageY;r===R.current.pageX&&t===R.current.pageY||(R.current={pageX:r,pageY:t},H(n,e))}(e,M)},onDragEnd:function(e){e.preventDefault(),e.dataTransfer.dropEffect="move",N(!1),B()},onMouseEnter:function(){return document.body.style.overflow="hidden"},onMouseLeave:function(){return document.body.style.overflow="auto"}},{children:null==M?void 0:M.label})),b&&b.key.accessor===M.accessor&&e("div",p({className:"st-sort-icon-container",onClick:function(){return O(M)}},{children:["ascending"===b.direction&&y&&y,"descending"===b.direction&&C&&C]})),u&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){w(!0),e.preventDefault();var n=e.clientX;if(M){var r=M.width,t=D((function(e){var t=Math.max(r+(e.clientX-n),40);M&&(f.current[v].width=t,d())}),10),o=function(){document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",o),w(!1)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",o)}}})]})):null})),I=u((function(e,r){return e.visible?n("div",{className:"st-cell",ref:r}):n("div",{ref:r})})),E=function(t){var o,c=t.draggable,i=t.columnResizing,s=t.forceUpdate,l=t.headersRef,u=t.hiddenColumns,f=t.isWidthDragging,h=t.onSort,v=t.onTableHeaderDragEnd,g=t.setIsWidthDragging,m=t.shouldDisplayLastColumnCell,w=t.sort,b=t.sortDownIcon,y=t.sortUpIcon,x=t.tableRef,D=a(null),E=a(null);return n(r,{children:e(C,p({pauseAnimation:f,tableRef:x},{children:[null===(o=l.current)||void 0===o?void 0:o.map((function(e,r){return u[e.accessor]?null:n(R,{draggable:c,draggedHeaderRef:D,columnResizing:i,forceUpdate:s,headersRef:l,hoveredHeaderRef:E,index:r,onSort:h,onTableHeaderDragEnd:v,ref:d(),setIsWidthDragging:g,sort:w,sortDownIcon:b,sortUpIcon:y},e.accessor)})),n(I,{ref:d(),visible:m})]}))})},N=function(r){var t=r.value,o=r.onBlur,a=r.onChange;return e("select",p({value:t.toString(),onBlur:o,onChange:a},{children:[n("option",p({value:"true"},{children:"True"})),n("option",p({value:"false"},{children:"False"}))]}))},M=function(e){var r=e.defaultValue,t=e.onBlur,o=e.onChange,c=a(null);return n("input",{className:"editable-cell-input",ref:c,autoFocus:!0,type:"text",defaultValue:r,onBlur:t,onChange:o})},k=function(e){var t=e.onChange,o=e.setIsEditing,a=e.value,c=function(e){var n=e.target.value;null==t||t(n)},i=function(){o(!1)};return n(r,{children:"string"==typeof a?n(M,{defaultValue:a,onBlur:i,onChange:c}):"boolean"==typeof a?n(N,{value:a,onBlur:i,onChange:c}):null})},L=f({rows:[],tableRows:[]}),A=u((function(e,r){var t=e.borderClass,a=e.colIndex,c=e.content,s=e.header,l=e.isSelected,u=e.isTopLeftCell,d=e.onCellChange,f=e.onMouseDown,v=e.onMouseOver,g=e.row,m=e.rowIndex,w=h(L),b=w.rows,C=w.tableRows,y=o(c),x=y[0],D=y[1],R=o(!1),I=R[0],E=R[1],N=Boolean(null==s?void 0:s.isEditable),M=m%2==0,A="st-cell ".concat(l?u?"st-cell-selected-first-cell ".concat(t):"st-cell-selected ".concat(t):""," ").concat(M?"st-cell-odd-row":""," ").concat(N?"clickable":"");i((function(){D(c)}),[c]),i((function(){if(void 0!==g.originalRowIndex&&"number"==typeof g.originalRowIndex){var e=b[g.originalRowIndex];e[s.accessor]!==x?D(e[s.accessor]):C[g.originalRowIndex][s.accessor]=x}}),[s.accessor,x,b,g.originalRowIndex,C]);return n("div",I?p({className:"st-cell-editing ".concat(M?"st-cell-odd-row":"")},{children:n(k,{onChange:function(e){D(e),null==d||d({accessor:s.accessor,newValue:e,newRowIndex:m,originalRowIndex:g.originalRowIndex,row:g})},setIsEditing:E,value:x})}):p({className:A,onDoubleClick:function(){return s.isEditable&&E(!0)},onMouseDown:function(){return f(m,a)},onMouseOver:function(){return v(m,a)},ref:r},{children:x}))})),T=function(){return n("div",{className:"st-row-separator"})},S=function(t){var o=t.getBorderClass,a=t.handleMouseDown,c=t.handleMouseOver,i=t.headers,s=t.hiddenColumns,l=t.isSelected,u=t.isTopLeftCell,f=t.isWidthDragging,h=t.onCellChange,g=t.shouldDisplayLastColumnCell,m=t.shouldPaginate,w=t.sortedRows,b=t.tableRef;return n(r,{children:w.map((function(r,t){return e(v,{children:[e(C,p({allowHorizontalAnimate:m,pauseAnimation:f,tableRef:b},{children:[i.map((function(e,i){if(s[e.accessor])return null;var f=r[e.accessor];return e.cellRenderer&&(f=e.cellRenderer(r)),n(A,{borderClass:o(t,i),colIndex:i,content:f,header:e,isSelected:l(t,i),isTopLeftCell:u(t,i),onCellChange:h,onMouseDown:function(){return a(t,i)},onMouseOver:function(){return c(t,i)},ref:d(),row:r,rowIndex:t},e.accessor)})),n(I,{ref:d(),visible:g})]})),t!==w.length-1&&n(T,{})]},r.originalRowIndex)}))})},B=function(r){var t=r.currentPage,o=r.hideFooter,a=r.nextIcon,c=r.onPageChange,i=r.prevIcon,s=r.rowsPerPage,l=r.shouldPaginate,u=r.totalRows,d=Math.ceil(u/s),f=t>1,h=t<d,v=function(e){e>=1&&e<=d&&c(e)};return o||!l?null:e("div",p({className:"st-footer"},{children:[n("button",p({className:"st-next-prev-btn ".concat(f?"":"disabled"),onClick:function(){return v(t-1)},disabled:!f},{children:i})),n("button",p({className:"st-next-prev-btn ".concat(h?"":"disabled"),onClick:function(){return v(t+1)},disabled:!h},{children:a})),Array.from({length:d},(function(e,r){return n("button",p({onClick:function(){return v(r+1)},className:"st-page-btn ".concat(t===r+1?"active":"")},{children:r+1}),r)}))]}))},H=function(e){var r=e.className;return n("svg",p({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},O=function(e){var r=e.className;return n("svg",p({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},P=function(e){var r=e.className;return n("svg",p({className:r,viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},U=function(e){var r=e.className;return n("svg",p({className:r,viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},z=function(r){var t=r.checked,a=void 0!==t&&t,c=r.children,i=r.onChange,s=o(a),l=s[0],u=s[1];return e("label",p({className:"st-checkbox-label"},{children:[n("input",{checked:l,className:"st-checkbox-input",onChange:function(){var e=!l;u(e),i&&i(e)},type:"checkbox"}),n("span",p({className:"st-checkbox-custom ".concat(l?"st-checked":"")},{children:l&&n("span",{className:"st-checkbox-checkmark"})})),c]}))},j=function(e){var r=e.headers,t=e.open,o=e.position;e.setOpen;var a=e.setHiddenColumns,c=e.hiddenColumns,i="left"===o?"left":"";return n("div",p({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(i),onClick:function(e){return e.stopPropagation()}},{children:n("div",p({className:"st-column-editor-popout-content"},{children:r.map((function(e,r){return n(z,p({checked:c[e.accessor],onChange:function(n){var r;return a(p(p({},c),((r={})[e.accessor]=n,r)))}},{children:e.label}),r)}))}))}))},W=function(r){var t=r.columnEditorText,a=r.editColumns,c=r.headers,i=r.position,s=void 0===i?"right":i,l=r.setHiddenColumns,u=r.hiddenColumns,d=o(!1),f=d[0],h=d[1];return a?e("div",p({className:"st-column-editor ".concat(f?"open":""," ").concat(s),onClick:function(){return function(e){h(e)}(!f)}},{children:[n("div",p({className:"st-column-editor-text"},{children:t})),n(j,{headers:c,open:f,position:s,setOpen:h,setHiddenColumns:l,hiddenColumns:u})]})):null},F=function(r){var t=r.columnEditorPosition,s=void 0===t?"right":t,l=r.columnEditorText,u=void 0===l?"Columns":l,d=r.columnResizing,f=void 0!==d&&d,h=r.defaultHeaders,v=r.draggable,b=void 0!==v&&v,C=r.editColumns,y=void 0!==C&&C,x=r.height,D=r.hideFooter,R=void 0!==D&&D;r.importStyles;var I=r.nextIcon,N=void 0===I?n(O,{className:"st-next-prev-icon"}):I,M=r.onCellChange,k=r.prevIcon,A=void 0===k?n(H,{className:"st-next-prev-icon"}):k,T=r.rows,z=r.rowsPerPage,j=void 0===z?10:z,F=r.selectableCells,X=void 0!==F&&F,V=r.shouldPaginate,Y=void 0!==V&&V,Q=r.sortDownIcon,q=void 0===Q?n(U,{className:"st-sort-icon"}):Q,J=r.sortUpIcon,K=void 0===J?n(P,{className:"st-sort-icon"}):J,G=g((function(){return T.map((function(e,n){return p(p({},e),{originalRowIndex:n})}))}),[T]),Z=a(null),$=o(!1),_=$[0],ee=$[1],ne=a(h),re=o(null),te=re[0],oe=re[1],ae=o({}),ce=ae[0],ie=ae[1],se=o(1),le=se[0],ue=se[1],de=g((function(){if(!te)return G;var e=function(e,n,r){var t=r?r.key:e[0],o="ascending";return r&&r.key.accessor===t.accessor&&"ascending"===r.direction&&(o="descending"),{sortedData:w([],n,!0).sort((function(e,n){return e[t.accessor]<n[t.accessor]?"ascending"===o?1:-1:e[t.accessor]>n[t.accessor]?"ascending"===o?-1:1:0})),newSortConfig:{key:t,direction:o}}}(ne.current,G,te).sortedData;return e}),[G,te]),fe=m((function(e){return e+1}),0)[1],he=function(e){var n=e.selectableCells,r=e.headers,t=e.rows,s=o([]),l=s[0],u=s[1],d=a(!1),f=a(null),h=c((function(){var e=l.reduce((function(e,n){var o=n.row,a=n.col;return e[o]||(e[o]=[]),e[o][a]=t[o][r[a].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");navigator.clipboard.writeText(n)}),[l,t,r]);i((function(){var e=function(e){(e.ctrlKey||e.metaKey)&&"c"===e.key&&h()};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[h,l]);var v=function(e,n){return l.some((function(r){return r.row===e&&r.col===n}))};return{selectedCells:l,handleMouseDown:function(e,r){n&&(d.current=!0,f.current={row:e,col:r},u([{row:e,col:r}]))},handleMouseOver:function(e,r){if(n&&d.current&&f.current){for(var t=[],o=Math.min(f.current.row,e),a=Math.max(f.current.row,e),c=Math.min(f.current.col,r),i=Math.max(f.current.col,r),s=o;s<=a;s++)for(var l=c;l<=i;l++)t.push({row:s,col:l});u(t)}},handleMouseUp:function(){d.current=!1,f.current=null},isSelected:v,getBorderClass:function(e,n){var r=[];return v(e-1,n)||r.push("st-selected-top-border"),v(e+1,n)||r.push("st-selected-bottom-border"),v(e,n-1)||r.push("st-selected-left-border"),v(e,n+1)||r.push("st-selected-right-border"),r.join(" ")},isTopLeftCell:function(e,n){return e===Math.min.apply(Math,l.map((function(e){return e.row})))&&n===Math.min.apply(Math,l.map((function(e){return e.col})))},setSelectedCells:u}}({selectableCells:X,headers:ne.current,rows:de}),ve=he.handleMouseDown,ge=he.handleMouseOver,me=he.handleMouseUp,pe=he.isSelected,we=he.getBorderClass,be=he.isTopLeftCell,Ce=he.setSelectedCells,ye=ne.current.filter((function(e){return!e.hide})),xe=g((function(){return!!Z.current&&ye.reduce((function(e,n){return e+n.width}),0)<Z.current.clientWidth}),[ye]),De=Y?de.slice((le-1)*j,le*j):de;i((function(){var e=function(e){e.target.closest(".st-cell")||Ce([])};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[Ce]);var Re=g((function(){return"".concat(ye.filter((function(e){return!0!==ce[e.accessor]})).map((function(e){return"".concat(e.width,"px")})).join(" ")," 1fr")}),[ye,ce]);return n(L.Provider,p({value:{rows:T,tableRows:G}},{children:e("div",p({className:"st-wrapper",style:x?{height:x}:{}},{children:[e("div",p({className:"st-table-wrapper"},{children:[e("div",p({className:"st-table",onMouseUp:me,onMouseLeave:me,ref:Z,style:{gridTemplateColumns:Re}},{children:[n(E,{columnResizing:f,draggable:b,forceUpdate:fe,headersRef:ne,hiddenColumns:ce,isWidthDragging:_,onSort:function(e,n){oe((function(r){return(null==r?void 0:r.key.accessor)!==n?{key:ne.current[e],direction:"ascending"}:"ascending"===(null==r?void 0:r.direction)?{key:ne.current[e],direction:"descending"}:null}))},onTableHeaderDragEnd:function(e){ne.current=e,fe()},setIsWidthDragging:ee,shouldDisplayLastColumnCell:xe,sort:te,sortDownIcon:q,sortUpIcon:K,tableRef:Z}),n(S,{getBorderClass:we,handleMouseDown:ve,handleMouseOver:ge,headers:ne.current,hiddenColumns:ce,isSelected:pe,isTopLeftCell:be,isWidthDragging:_,onCellChange:M,shouldDisplayLastColumnCell:xe,shouldPaginate:Y,sortedRows:De,tableRef:Z})]})),n(W,{headers:ne.current,columnEditorText:u,editColumns:y,position:s,setHiddenColumns:ie,hiddenColumns:ce})]})),n(B,{currentPage:le,hideFooter:R,nextIcon:N,onPageChange:ue,prevIcon:A,rowsPerPage:j,shouldPaginate:Y,totalRows:de.length})]}))}))};export{F as SimpleTable};
|
|
1
|
+
import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import t,{useState as o,useRef as a,useCallback as l,useEffect as s,Children as i,useLayoutEffect as c,forwardRef as d,createRef as u,createContext as f,useContext as h,Fragment as g,useMemo as b,useReducer as v}from"react";var p=function(){return p=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},p.apply(this,arguments)};function m(e,n,r){if(r||2===arguments.length)for(var t,o=0,a=n.length;o<a;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var w=function(e){var n={};return i.forEach(e,(function(e){if(e&&e.ref&&e.ref.current){var r=e.ref.current.getBoundingClientRect();n[e.key]=r}})),n},x=function(e){var n,r,l=e.allowHorizontalAnimate,i=void 0===l||l,d=e.children,u=e.pauseAnimation,f=e.tableRef,h=a(!1),g=o({}),b=g[0],v=g[1],p=o({}),m=p[0],x=p[1],y=(n=d,r=a(),s((function(){r.current=n}),[n]),r.current);return c((function(){var e=w(d);v(e)}),[d]),c((function(){var e=w(y);x(e);var n=f.current,r=function(){h.current=!0;var e=w(y);v(e),x(e)},t=function(){h.current=!1};return null==n||n.addEventListener("scroll",r),null==n||n.addEventListener("scrollend",t),function(){null==n||n.removeEventListener("scroll",r),null==n||n.removeEventListener("scrollend",t)}}),[y,f]),s((function(){u||h.current||Object.keys(m).length&&t.Children.forEach(d,(function(e){if(e){var n=e.ref.current,r=m[e.key],t=b[e.key];if(r&&t){var o=r.left-t.left,a=i?0:r.top-t.top,l=Math.abs(o),s=Math.abs(a);(l>10||s>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(a,"px)"),n.style.transition="transform 0s, opacity 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform 300ms ease-out, opacity 300ms ease-out"}))}))}}}))}),[i,b,d,u,m]),d},y=!1,C=function(e){var n=e.draggedHeaderRef,r=e.headersRef,t=e.hoveredHeaderRef,o=e.onTableHeaderDragEnd;return{handleDragStart:function(e){n.current=e},handleDragOver:function(e){!function(e){var a;if(!y&&(t.current=e,e.accessor!==(null===(a=n.current)||void 0===a?void 0:a.accessor)&&null!==n.current&&!y)){if(y=!0,!r.current)return;var l=m([],r.current,!0),s=l.findIndex((function(e){var r;return e.accessor===(null===(r=n.current)||void 0===r?void 0:r.accessor)})),i=l.findIndex((function(n){return n.accessor===e.accessor}));if(void 0===s||void 0===i)return;var c=l.splice(s,1)[0];l.splice(i,0,c),JSON.stringify(l)!==JSON.stringify(r.current)&&setTimeout((function(){o(l),setTimeout((function(){y=!1}),500)}),50)}}(e)},handleDragEnd:function(){n.current=null,t.current=null}}},k=function(e,n){var r=!0,t=!0;return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];if(r)return r=!1,void setTimeout((function(){return t=!1}),n);t||(e.apply(this,o),t=!0,setTimeout((function(){return t=!1}),n))}},D=d((function(r,t){var l,i=r.draggable,c=r.draggedHeaderRef,d=r.columnResizing,u=r.forceUpdate,f=r.headersRef,h=r.hoveredHeaderRef,g=r.index,b=r.onSort,v=r.onTableHeaderDragEnd,m=r.setIsWidthDragging,w=r.sort,x=r.sortDownIcon,y=r.sortUpIcon,D=a({pageX:0,pageY:0}),R=o(!1),N=R[0],E=R[1],I=null===(l=f.current)||void 0===l?void 0:l[g],M=Boolean(null==I?void 0:I.isSortable),A="st-header-cell ".concat(I===h.current?"st-hovered":""," ").concat(N?"st-dragging":""," ").concat(M?"clickable":""," ").concat(i&&!M?"draggable":""),L=C({draggedHeaderRef:c,headersRef:f,hoveredHeaderRef:h,onTableHeaderDragEnd:v}),S=L.handleDragStart,T=L.handleDragOver,B=L.handleDragEnd,z=a(k((function(e){T(e)}),100)).current,H=function(e){e.isSortable&&b(g,e.accessor)};return s((function(){var e=function(e){var n=new Image;n.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",e.dataTransfer.setDragImage(n,0,0)};return document.addEventListener("dragend",e,!1),function(){document.removeEventListener("dragend",e)}}),[]),I?e("div",p({className:A,ref:t,style:{width:I.width}},{children:[n("div",p({className:"st-header-label",draggable:i,onClick:function(){return H(I)},onDragStart:function(e){i&&I&&(e.dataTransfer.dropEffect="move",function(e){E(!0),S(e)}(I))},onDragOver:function(e){return function(e,n){e.preventDefault(),e.dataTransfer.dropEffect="move";var r=e.pageX,t=e.pageY;r===D.current.pageX&&t===D.current.pageY||(D.current={pageX:r,pageY:t},z(n,e))}(e,I)},onDragEnd:function(e){e.preventDefault(),e.dataTransfer.dropEffect="move",E(!1),B()},onMouseEnter:function(){return document.body.style.overflow="hidden"},onMouseLeave:function(){return document.body.style.overflow="auto"}},{children:null==I?void 0:I.label})),w&&w.key.accessor===I.accessor&&e("div",p({className:"st-sort-icon-container",onClick:function(){return H(I)}},{children:["ascending"===w.direction&&y&&y,"descending"===w.direction&&x&&x]})),d&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){m(!0),e.preventDefault();var n=e.clientX;if(I){var r=I.width,t=k((function(e){var t=Math.max(r+(e.clientX-n),40);I&&(f.current[g].width=t,u())}),10),o=function(){document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",o),m(!1)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",o)}}})]})):null})),R=d((function(e,r){return e.visible?n("div",{className:"st-cell",ref:r}):n("div",{ref:r})})),N=function(t){var o,l=t.draggable,s=t.columnResizing,i=t.forceUpdate,c=t.headersRef,d=t.hiddenColumns,f=t.isWidthDragging,h=t.onSort,g=t.onTableHeaderDragEnd,b=t.setIsWidthDragging,v=t.shouldDisplayLastColumnCell,m=t.sort,w=t.sortDownIcon,y=t.sortUpIcon,C=t.tableRef,k=a(null),N=a(null);return n(r,{children:e(x,p({pauseAnimation:f,tableRef:C},{children:[null===(o=c.current)||void 0===o?void 0:o.map((function(e,r){return d[e.accessor]?null:n(D,{draggable:l,draggedHeaderRef:k,columnResizing:s,forceUpdate:i,headersRef:c,hoveredHeaderRef:N,index:r,onSort:h,onTableHeaderDragEnd:g,ref:u(),setIsWidthDragging:b,sort:m,sortDownIcon:w,sortUpIcon:y},e.accessor)})),n(R,{ref:u(),visible:v})]}))})},E=function(r){var t=r.value,o=r.onBlur,a=r.onChange;return e("select",p({value:t.toString(),onBlur:o,onChange:a},{children:[n("option",p({value:"true"},{children:"True"})),n("option",p({value:"false"},{children:"False"}))]}))},I=function(e){var r=e.defaultValue,t=e.onBlur,o=e.onChange,l=a(null);return n("input",{className:"editable-cell-input",ref:l,autoFocus:!0,type:"text",defaultValue:r,onBlur:t,onChange:o})},M=function(e){var t=e.onChange,o=e.setIsEditing,a=e.value,l=function(e){var n=e.target.value;null==t||t(n)},s=function(){o(!1)};return n(r,{children:"string"==typeof a?n(I,{defaultValue:a,onBlur:s,onChange:l}):"boolean"==typeof a?n(E,{value:a,onBlur:s,onChange:l}):null})},A=f({rows:[],tableRows:[]}),L=d((function(e,r){var t=e.borderClass,a=e.colIndex,l=e.content,i=e.header,c=e.isSelected,d=e.isTopLeftCell,u=e.onCellChange,f=e.onMouseDown,g=e.onMouseOver,b=e.row,v=e.rowIndex,m=h(A),w=m.rows,x=m.tableRows,y=o(l),C=y[0],k=y[1],D=o(!1),R=D[0],N=D[1],E=Boolean(null==i?void 0:i.isEditable),I=v%2==0,L="st-cell ".concat(c?d?"st-cell-selected-first-cell ".concat(t):"st-cell-selected ".concat(t):""," ").concat(I?"st-cell-odd-row":""," ").concat(E?"clickable":"");s((function(){k(l)}),[l]),s((function(){if(void 0!==b.originalRowIndex&&"number"==typeof b.originalRowIndex){var e=w[b.originalRowIndex];e[i.accessor]!==C?k(e[i.accessor]):x[b.originalRowIndex][i.accessor]=C}}),[i.accessor,C,w,b.originalRowIndex,x]);return n("div",R?p({className:"st-cell-editing ".concat(I?"st-cell-odd-row":"")},{children:n(M,{onChange:function(e){k(e),null==u||u({accessor:i.accessor,newValue:e,newRowIndex:v,originalRowIndex:b.originalRowIndex,row:b})},setIsEditing:N,value:C})}):p({className:L,onDoubleClick:function(){return i.isEditable&&N(!0)},onMouseDown:function(){return f(v,a)},onMouseOver:function(){return g(v,a)},ref:r},{children:C}))})),S=function(){return n("div",{className:"st-row-separator"})},T=function(t){var o=t.getBorderClass,a=t.handleMouseDown,l=t.handleMouseOver,s=t.headers,i=t.hiddenColumns,c=t.isSelected,d=t.isTopLeftCell,f=t.isWidthDragging,h=t.onCellChange,b=t.shouldDisplayLastColumnCell,v=t.shouldPaginate,m=t.sortedRows,w=t.tableRef;return n(r,{children:m.map((function(r,t){return e(g,{children:[e(x,p({allowHorizontalAnimate:v,pauseAnimation:f,tableRef:w},{children:[s.map((function(e,s){if(i[e.accessor])return null;var f=r[e.accessor];return e.cellRenderer&&(f=e.cellRenderer(r)),n(L,{borderClass:o(t,s),colIndex:s,content:f,header:e,isSelected:c(t,s),isTopLeftCell:d(t,s),onCellChange:h,onMouseDown:function(){return a(t,s)},onMouseOver:function(){return l(t,s)},ref:u(),row:r,rowIndex:t},e.accessor)})),n(R,{ref:u(),visible:b})]})),t!==m.length-1&&n(S,{})]},r.originalRowIndex)}))})},B=function(r){var t=r.currentPage,o=r.hideFooter,a=r.nextIcon,l=r.onPageChange,s=r.prevIcon,i=r.rowsPerPage,c=r.shouldPaginate,d=r.totalRows,u=Math.ceil(d/i),f=t>1,h=t<u,g=function(e){e>=1&&e<=u&&l(e)};return o||!c?null:e("div",p({className:"st-footer"},{children:[n("button",p({className:"st-next-prev-btn ".concat(f?"":"disabled"),onClick:function(){return g(t-1)},disabled:!f},{children:s})),n("button",p({className:"st-next-prev-btn ".concat(h?"":"disabled"),onClick:function(){return g(t+1)},disabled:!h},{children:a})),Array.from({length:u},(function(e,r){return n("button",p({onClick:function(){return g(r+1)},className:"st-page-btn ".concat(t===r+1?"active":"")},{children:r+1}),r)}))]}))},z=function(e){var r=e.className;return n("svg",p({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},H=function(e){var r=e.className;return n("svg",p({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},O=function(e){var r=e.className;return n("svg",p({className:r,viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},P=function(e){var r=e.className;return n("svg",p({className:r,viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},j=function(r){var t=r.checked,a=void 0!==t&&t,l=r.children,s=r.onChange,i=o(a),c=i[0],d=i[1];return e("label",p({className:"st-checkbox-label"},{children:[n("input",{checked:c,className:"st-checkbox-input",onChange:function(){var e=!c;d(e),s&&s(e)},type:"checkbox"}),n("span",p({className:"st-checkbox-custom ".concat(c?"st-checked":"")},{children:c&&n("span",{className:"st-checkbox-checkmark"})})),l]}))},U=function(e){var r=e.headers,t=e.open,o=e.position;e.setOpen;var a=e.setHiddenColumns,l=e.hiddenColumns,s="left"===o?"left":"";return n("div",p({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(s),onClick:function(e){return e.stopPropagation()}},{children:n("div",p({className:"st-column-editor-popout-content"},{children:r.map((function(e,r){return n(j,p({checked:l[e.accessor],onChange:function(n){var r;return a(p(p({},l),((r={})[e.accessor]=n,r)))}},{children:e.label}),r)}))}))}))},X=function(r){var t=r.columnEditorText,a=r.editColumns,l=r.headers,s=r.position,i=void 0===s?"right":s,c=r.setHiddenColumns,d=r.hiddenColumns,u=o(!1),f=u[0],h=u[1];return a?e("div",p({className:"st-column-editor ".concat(f?"open":""," ").concat(i),onClick:function(){return function(e){h(e)}(!f)}},{children:[n("div",p({className:"st-column-editor-text"},{children:t})),n(U,{headers:l,open:f,position:i,setOpen:h,setHiddenColumns:c,hiddenColumns:d})]})):null};!function(e,n){void 0===n&&(n={});var r=n.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('/* Import Nunito font from Google Fonts */\n@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap");\n\n:root {\n /* Slate Colors */\n --slate-50: #f8fafc;\n --slate-100: #f1f5f9;\n --slate-200: #e2e8f0;\n --slate-300: #cbd5e1;\n --slate-400: #94a3b8;\n --slate-500: #64748b;\n --slate-600: #475569;\n --slate-700: #334155;\n --slate-800: #1e293b;\n --slate-900: #0f172a;\n\n /* Blue Colors */\n --blue-50: #eff6ff;\n --blue-100: #dbeafe;\n --blue-200: #bfdbfe;\n --blue-300: #93c5fd;\n --blue-400: #60a5fa;\n --blue-500: #3b82f6;\n --blue-600: #2563eb;\n --blue-700: #1d4ed8;\n --blue-800: #1e40af;\n --blue-900: #1e3a8a;\n\n /* Orange Colors */\n --orange-50: #fff7ed;\n --orange-100: #ffedd5;\n --orange-200: #fed7aa;\n --orange-300: #fdba74;\n --orange-400: #fb923c;\n --orange-500: #f97316;\n --orange-600: #ea580c;\n --orange-700: #c2410c;\n --orange-800: #9a3412;\n --orange-900: #7c2d12;\n\n /* Amber Colors */\n --amber-50: #fffbeb;\n --amber-100: #fef3c7;\n --amber-200: #fde68a;\n --amber-300: #fcd34d;\n --amber-400: #fbbf24;\n --amber-500: #f59e0b;\n --amber-600: #d97706;\n --amber-700: #b45309;\n --amber-800: #92400e;\n --amber-900: #78350f;\n\n /* Customizable Variables */\n --st-border-radius: 4px;\n --st-border-color: var(--slate-300);\n --st-border-width: 1px;\n --st-resize-handle-color: var(--slate-300);\n --st-separator-border-color: var(--slate-300);\n --st-odd-row-background-color: var(--slate-100);\n --st-dragging-background-color: var(--blue-100);\n --st-selected-cell-background-color: var(--blue-200);\n --st-selected-first-cell-background-color: var(--amber-100);\n --st-border-top-color: var(--blue-500);\n --st-border-bottom-color: var(--blue-500);\n --st-border-left-color: var(--blue-500);\n --st-border-right-color: var(--blue-500);\n --st-border-top-white-color: white;\n --st-footer-background-color: white;\n --st-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --st-cell-padding: 8px;\n}\n\n/* Global styles */\n* {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n/* Apply Nunito as the default font */\nbody {\n font-family: "Nunito";\n}\n\n/* Wrapper for the table */\n.st-wrapper {\n position: relative;\n border: var(--st-border-width) solid var(--st-border-color);\n border-radius: var(--st-border-radius);\n max-height: 100dvh;\n overflow: hidden;\n}\n\n.st-table-wrapper {\n position: relative;\n display: flex;\n width: max-content;\n overflow: visible;\n height: 100%;\n width: 100%;\n}\n\n/* Main table styling */\n.st-table {\n position: relative;\n display: grid;\n border-collapse: collapse;\n table-layout: auto;\n white-space: nowrap;\n width: 100%;\n height: 100%;\n overflow: auto;\n}\n\n/* Styles for table header cells */\n.st-header-cell {\n position: sticky;\n top: 0;\n background-color: white;\n z-index: 1;\n font-weight: 600;\n\n display: flex;\n align-items: center;\n gap: 4px;\n border-top: var(--st-border-width) solid transparent;\n border-bottom: var(--st-border-width) solid var(--st-border-color);\n}\n.st-header-cell.clickable {\n cursor: pointer;\n}\n.st-header-cell.draggable {\n cursor: grab;\n}\n\n/* Common styles for table header and cells */\n.st-header-cell,\n.st-cell {\n color: var(--slate-800);\n overflow: hidden;\n}\n\n.st-cell.clickable {\n cursor: pointer;\n}\n\n.st-header-cell,\n.st-cell,\n.st-cell-editing {\n width: 100%;\n height: 40px;\n font-family: "Nunito";\n}\n\n.st-cell-editing {\n position: relative;\n}\n\n.st-header-label {\n flex: 1;\n}\n\n.st-header-label,\n.st-cell {\n user-select: none;\n padding: var(--st-cell-padding);\n text-align: left;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n width: 100%;\n}\n.st-cell {\n position: relative;\n border: var(--st-border-width) solid transparent;\n}\n.st-sort-icon-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n.st-sort-icon {\n fill: var(--slate-500);\n}\n\n.st-header-resize-handle {\n top: 0;\n right: 0;\n width: 5px;\n height: 20px;\n cursor: col-resize;\n background-color: var(--st-resize-handle-color);\n border-radius: 0.25rem;\n}\n\n.st-row-separator {\n height: 1px;\n background-color: var(--st-separator-border-color);\n grid-column: 1 / -1;\n}\n\n.st-cell-odd-row {\n background-color: var(--st-odd-row-background-color);\n}\n\n/* Style for a cell when it is being dragged */\n.st-dragging {\n background-color: var(--st-dragging-background-color);\n}\n\n/* Style for selected table cells */\n.st-cell-selected {\n background-color: var(--st-selected-cell-background-color);\n}\n\n/* Style for the first selected table cell */\n.st-cell-selected-first {\n background-color: var(--st-selected-first-cell-background-color);\n}\n\n/* Blue top border for cells */\n.st-selected-top-border {\n border-top: var(--st-border-width) solid var(--st-border-top-color);\n}\n\n/* Blue bottom border for cells */\n.st-selected-bottom-border {\n border-bottom: var(--st-border-width) solid var(--st-border-bottom-color);\n}\n\n/* Blue left border for cells */\n.st-selected-left-border {\n border-left: var(--st-border-width) solid var(--st-border-left-color);\n}\n\n/* Blue right border for cells */\n.st-selected-right-border {\n border-right: var(--st-border-width) solid var(--st-border-right-color);\n}\n\n/* White top border for cells */\n.st-selected-top-border-white {\n border-top: var(--st-border-width) solid var(--st-border-top-white-color);\n}\n\n.st-footer {\n display: flex;\n align-items: center;\n background-color: var(--st-footer-background-color);\n\n padding: 8px;\n\n border-top: var(--st-border-width) solid var(--st-border-color);\n}\n\n.st-next-prev-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px;\n cursor: pointer;\n background-color: transparent;\n border: none;\n border-radius: 4px;\n transition: background-color 0.3s ease;\n}\n.st-next-prev-btn {\n fill: var(--slate-600);\n}\n.disabled > .st-next-prev-icon {\n cursor: not-allowed;\n fill: var(--slate-400);\n}\n\n.st-next-prev-btn:not(.disabled):hover {\n background-color: var(--slate-100);\n}\n\n.st-page-btn {\n margin-left: 4px;\n padding: 4px;\n cursor: pointer;\n background-color: transparent;\n color: var(--slate-600);\n border: none;\n border-radius: var(--st-border-radius);\n transition: background-color 0.3s ease;\n}\n\n.st-page-btn:hover {\n background-color: var(--slate-100);\n}\n\n.st-page-btn.active {\n background-color: var(--blue-500);\n color: white;\n}\n\n.editable-cell-input {\n position: absolute;\n top: 0;\n left: 0;\n border-radius: var(--st-border-radius);\n border: var(--st-border-width) solid var(--st-border-color);\n box-shadow: var(--st-shadow);\n z-index: 1;\n outline: none;\n height: 100%;\n width: 100%;\n padding: var(--st-cell-padding);\n font-size: 1rem;\n font-family: "Nunito";\n}\n.editable-cell-input:focus {\n border: var(--st-border-width) solid var(--blue-500);\n}\n.st-column-editor {\n position: relative;\n user-select: none;\n\n background: var(--st-footer-background-color);\n border-left: var(--st-border-width) solid var(--st-border-color);\n cursor: pointer;\n}\n\n.st-column-editor-text {\n padding: 8px 4px;\n\n writing-mode: vertical-rl;\n color: var(--slate-500);\n background-color: white;\n z-index: 2;\n}\n\n.st-column-editor.open,\n.st-column-editor.open .st-column-editor-text {\n background-color: var(--slate-100);\n}\n\n.st-column-editor-popout {\n position: absolute;\n top: 0;\n right: calc(100% + 1px);\n z-index: 1;\n\n height: 100%;\n background-color: var(--slate-100);\n\n transition: width 0.2s ease;\n overflow: hidden;\n width: 0;\n}\n.st-column-editor-popout-content {\n display: flex;\n flex-direction: column;\n overflow: auto;\n gap: 4px;\n padding: 8px 4px;\n border-left: var(--st-border-width) solid var(--st-border-color);\n height: 100%;\n}\n\n.st-column-editor-popout.open {\n width: 200px;\n}\n\n.st-column-editor-popout.left {\n transform: translateX(-100%);\n}\n\n.st-column-editor-popout.open.left {\n transform: translateX(0);\n}\n\n/* Checkbox styles */\n.st-checkbox-label {\n display: flex;\n align-items: center;\n cursor: pointer;\n gap: 8px;\n}\n\n.st-checkbox-input {\n display: none; /* Hide the default checkbox */\n}\n\n.st-checkbox-custom {\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 24px;\n height: 24px;\n\n border: var(--st-border-width) solid var(--slate-300);\n border-radius: var(--st-border-radius);\n\n background-color: white;\n transition: background-color 0.3s ease, border-color 0.3s ease;\n}\n\n.st-checkbox-custom.st-checked {\n background-color: var(--blue-500);\n border-color: var(--blue-500);\n}\n\n.st-checkbox-checkmark {\n width: 6px;\n height: 11px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n}\n\n@keyframes slide-in-left {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-in-right {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n');var W=function(r){var t=r.columnEditorPosition,i=void 0===t?"right":t,c=r.columnEditorText,d=void 0===c?"Columns":c,u=r.columnResizing,f=void 0!==u&&u,h=r.defaultHeaders,g=r.draggable,w=void 0!==g&&g,x=r.editColumns,y=void 0!==x&&x,C=r.height,k=r.hideFooter,D=void 0!==k&&k;r.importStyles;var R=r.nextIcon,E=void 0===R?n(H,{className:"st-next-prev-icon"}):R,I=r.onCellChange,M=r.prevIcon,L=void 0===M?n(z,{className:"st-next-prev-icon"}):M,S=r.rows,j=r.rowsPerPage,U=void 0===j?10:j,W=r.selectableCells,F=void 0!==W&&W,V=r.shouldPaginate,Y=void 0!==V&&V,G=r.sortDownIcon,Q=void 0===G?n(P,{className:"st-sort-icon"}):G,q=r.sortUpIcon,J=void 0===q?n(O,{className:"st-sort-icon"}):q,K=b((function(){return S.map((function(e,n){return p(p({},e),{originalRowIndex:n})}))}),[S]),Z=a(null),$=o(!1),_=$[0],ee=$[1],ne=a(h),re=o(null),te=re[0],oe=re[1],ae=o({}),le=ae[0],se=ae[1],ie=o(1),ce=ie[0],de=ie[1],ue=b((function(){if(!te)return K;var e=function(e,n,r){var t=r?r.key:e[0],o="ascending";return r&&r.key.accessor===t.accessor&&"ascending"===r.direction&&(o="descending"),{sortedData:m([],n,!0).sort((function(e,n){return e[t.accessor]<n[t.accessor]?"ascending"===o?1:-1:e[t.accessor]>n[t.accessor]?"ascending"===o?-1:1:0})),newSortConfig:{key:t,direction:o}}}(ne.current,K,te).sortedData;return e}),[K,te]),fe=v((function(e){return e+1}),0)[1],he=function(e){var n=e.selectableCells,r=e.headers,t=e.rows,i=o([]),c=i[0],d=i[1],u=a(!1),f=a(null),h=l((function(){var e=c.reduce((function(e,n){var o=n.row,a=n.col;return e[o]||(e[o]=[]),e[o][a]=t[o][r[a].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");navigator.clipboard.writeText(n)}),[c,t,r]);s((function(){var e=function(e){(e.ctrlKey||e.metaKey)&&"c"===e.key&&h()};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[h,c]);var g=function(e,n){return c.some((function(r){return r.row===e&&r.col===n}))};return{selectedCells:c,handleMouseDown:function(e,r){n&&(u.current=!0,f.current={row:e,col:r},d([{row:e,col:r}]))},handleMouseOver:function(e,r){if(n&&u.current&&f.current){for(var t=[],o=Math.min(f.current.row,e),a=Math.max(f.current.row,e),l=Math.min(f.current.col,r),s=Math.max(f.current.col,r),i=o;i<=a;i++)for(var c=l;c<=s;c++)t.push({row:i,col:c});d(t)}},handleMouseUp:function(){u.current=!1,f.current=null},isSelected:g,getBorderClass:function(e,n){var r=[];return g(e-1,n)||r.push("st-selected-top-border"),g(e+1,n)||r.push("st-selected-bottom-border"),g(e,n-1)||r.push("st-selected-left-border"),g(e,n+1)||r.push("st-selected-right-border"),r.join(" ")},isTopLeftCell:function(e,n){return e===Math.min.apply(Math,c.map((function(e){return e.row})))&&n===Math.min.apply(Math,c.map((function(e){return e.col})))},setSelectedCells:d}}({selectableCells:F,headers:ne.current,rows:ue}),ge=he.handleMouseDown,be=he.handleMouseOver,ve=he.handleMouseUp,pe=he.isSelected,me=he.getBorderClass,we=he.isTopLeftCell,xe=he.setSelectedCells,ye=ne.current.filter((function(e){return!e.hide})),Ce=b((function(){return!!Z.current&&ye.reduce((function(e,n){return e+n.width}),0)<Z.current.clientWidth}),[ye]),ke=Y?ue.slice((ce-1)*U,ce*U):ue;s((function(){var e=function(e){e.target.closest(".st-cell")||xe([])};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[xe]);var De=b((function(){return"".concat(ye.filter((function(e){return!0!==le[e.accessor]})).map((function(e){return"".concat(e.width,"px")})).join(" ")," 1fr")}),[ye,le]);return n(A.Provider,p({value:{rows:S,tableRows:K}},{children:e("div",p({className:"st-wrapper",style:C?{height:C}:{}},{children:[e("div",p({className:"st-table-wrapper"},{children:[e("div",p({className:"st-table",onMouseUp:ve,onMouseLeave:ve,ref:Z,style:{gridTemplateColumns:De}},{children:[n(N,{columnResizing:f,draggable:w,forceUpdate:fe,headersRef:ne,hiddenColumns:le,isWidthDragging:_,onSort:function(e,n){oe((function(r){return(null==r?void 0:r.key.accessor)!==n?{key:ne.current[e],direction:"ascending"}:"ascending"===(null==r?void 0:r.direction)?{key:ne.current[e],direction:"descending"}:null}))},onTableHeaderDragEnd:function(e){ne.current=e,fe()},setIsWidthDragging:ee,shouldDisplayLastColumnCell:Ce,sort:te,sortDownIcon:Q,sortUpIcon:J,tableRef:Z}),n(T,{getBorderClass:me,handleMouseDown:ge,handleMouseOver:be,headers:ne.current,hiddenColumns:le,isSelected:pe,isTopLeftCell:we,isWidthDragging:_,onCellChange:I,shouldDisplayLastColumnCell:Ce,shouldPaginate:Y,sortedRows:ke,tableRef:Z})]})),n(X,{headers:ne.current,columnEditorText:d,editColumns:y,position:i,setHiddenColumns:se,hiddenColumns:le})]})),n(B,{currentPage:ce,hideFooter:D,nextIcon:E,onPageChange:de,prevIcon:L,rowsPerPage:U,shouldPaginate:Y,totalRows:ue.length})]}))}))};export{W as SimpleTable};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simple-table-core",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,13 +38,11 @@
|
|
|
38
38
|
"@storybook/test": "^8.4.1",
|
|
39
39
|
"@types/node": "^16.18.111",
|
|
40
40
|
"@types/react": "^18.3.9",
|
|
41
|
-
"autoprefixer": "^10.4.20",
|
|
42
41
|
"eslint-plugin-storybook": "^0.9.0",
|
|
43
42
|
"prop-types": "^15.8.1",
|
|
44
43
|
"rollup": "^2.79.2",
|
|
45
44
|
"rollup-plugin-babel": "^4.4.0",
|
|
46
45
|
"rollup-plugin-delete": "^2.1.0",
|
|
47
|
-
"rollup-plugin-import-css": "^3.5.6",
|
|
48
46
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
49
47
|
"rollup-plugin-postcss": "^4.0.2",
|
|
50
48
|
"rollup-plugin-terser": "^7.0.2",
|
package/dist/index.css
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap");:root{--slate-50:#f8fafc;--slate-100:#f1f5f9;--slate-200:#e2e8f0;--slate-300:#cbd5e1;--slate-400:#94a3b8;--slate-500:#64748b;--slate-600:#475569;--slate-700:#334155;--slate-800:#1e293b;--slate-900:#0f172a;--blue-50:#eff6ff;--blue-100:#dbeafe;--blue-200:#bfdbfe;--blue-300:#93c5fd;--blue-400:#60a5fa;--blue-500:#3b82f6;--blue-600:#2563eb;--blue-700:#1d4ed8;--blue-800:#1e40af;--blue-900:#1e3a8a;--orange-50:#fff7ed;--orange-100:#ffedd5;--orange-200:#fed7aa;--orange-300:#fdba74;--orange-400:#fb923c;--orange-500:#f97316;--orange-600:#ea580c;--orange-700:#c2410c;--orange-800:#9a3412;--orange-900:#7c2d12;--amber-50:#fffbeb;--amber-100:#fef3c7;--amber-200:#fde68a;--amber-300:#fcd34d;--amber-400:#fbbf24;--amber-500:#f59e0b;--amber-600:#d97706;--amber-700:#b45309;--amber-800:#92400e;--amber-900:#78350f;--st-border-radius:4px;--st-border-color:var(--slate-300);--st-border-width:1px;--st-resize-handle-color:var(--slate-300);--st-separator-border-color:var(--slate-300);--st-odd-row-background-color:var(--slate-100);--st-dragging-background-color:var(--blue-100);--st-selected-cell-background-color:var(--blue-200);--st-selected-first-cell-background-color:var(--amber-100);--st-border-top-color:var(--blue-500);--st-border-bottom-color:var(--blue-500);--st-border-left-color:var(--blue-500);--st-border-right-color:var(--blue-500);--st-border-top-white-color:#fff;--st-footer-background-color:#fff;--st-shadow:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--st-cell-padding:8px}*{box-sizing:border-box;margin:0;padding:0}body{font-family:Nunito}.st-wrapper{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);max-height:100dvh;overflow:hidden;position:relative}.st-table-wrapper{display:flex;overflow:visible;width:max-content}.st-table,.st-table-wrapper{height:100%;position:relative;width:100%}.st-table{border-collapse:collapse;display:grid;overflow:auto;table-layout:auto;white-space:nowrap}.st-header-cell{align-items:center;background-color:#fff;border-bottom:var(--st-border-width) solid var(--st-border-color);border-top:var(--st-border-width) solid #0000;display:flex;font-weight:600;gap:4px;position:sticky;top:0;z-index:1}.st-header-cell.clickable{cursor:pointer}.st-header-cell.draggable{cursor:grab}.st-cell,.st-header-cell{color:var(--slate-800);overflow:hidden}.st-cell.clickable{cursor:pointer}.st-cell,.st-cell-editing,.st-header-cell{font-family:Nunito;height:40px;width:100%}.st-cell-editing{position:relative}.st-header-label{flex:1}.st-cell,.st-header-label{overflow:hidden;padding:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;-webkit-user-select:none;user-select:none;white-space:nowrap;width:100%}.st-cell{border:var(--st-border-width) solid #0000;position:relative}.st-sort-icon-container{align-items:center;display:flex;flex-direction:column;justify-content:center}.st-sort-icon{fill:var(--slate-500)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);border-radius:.25rem;cursor:col-resize;height:20px;right:0;top:0;width:5px}.st-row-separator{background-color:var(--st-separator-border-color);grid-column:1/-1;height:1px}.st-cell-odd-row{background-color:var(--st-odd-row-background-color)}.st-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color)}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)}.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-border-top-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-border-bottom-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-border-left-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-border-right-color)}.st-selected-top-border-white{border-top:var(--st-border-width) solid var(--st-border-top-white-color)}.st-footer{background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);padding:8px}.st-footer,.st-next-prev-btn{align-items:center;display:flex}.st-next-prev-btn{fill:var(--slate-600);background-color:initial;border:none;border-radius:4px;cursor:pointer;justify-content:center;padding:4px;transition:background-color .3s ease}.disabled>.st-next-prev-icon{fill:var(--slate-400);cursor:not-allowed}.st-next-prev-btn:not(.disabled):hover{background-color:var(--slate-100)}.st-page-btn{background-color:initial;border:none;border-radius:var(--st-border-radius);color:var(--slate-600);cursor:pointer;margin-left:4px;padding:4px;transition:background-color .3s ease}.st-page-btn:hover{background-color:var(--slate-100)}.st-page-btn.active{background-color:var(--blue-500);color:#fff}.editable-cell-input{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);box-shadow:var(--st-shadow);font-family:Nunito;font-size:1rem;height:100%;left:0;outline:none;padding:var(--st-cell-padding);position:absolute;top:0;width:100%;z-index:1}.editable-cell-input:focus{border:var(--st-border-width) solid var(--blue-500)}.st-column-editor{background:var(--st-footer-background-color);border-left:var(--st-border-width) solid var(--st-border-color);cursor:pointer;position:relative;-webkit-user-select:none;user-select:none}.st-column-editor-text{background-color:#fff;color:var(--slate-500);padding:8px 4px;writing-mode:vertical-rl;z-index:2}.st-column-editor-popout,.st-column-editor.open,.st-column-editor.open .st-column-editor-text{background-color:var(--slate-100)}.st-column-editor-popout{height:100%;overflow:hidden;position:absolute;right:calc(100% + 1px);top:0;transition:width .2s ease;width:0;z-index:1}.st-column-editor-popout-content{border-left:var(--st-border-width) solid var(--st-border-color);display:flex;flex-direction:column;gap:4px;height:100%;overflow:auto;padding:8px 4px}.st-column-editor-popout.open{width:200px}.st-column-editor-popout.left{transform:translateX(-100%)}.st-column-editor-popout.open.left{transform:translateX(0)}.st-checkbox-label{align-items:center;cursor:pointer;display:flex;gap:8px}.st-checkbox-input{display:none}.st-checkbox-custom{align-items:center;background-color:#fff;border:var(--st-border-width) solid var(--slate-300);border-radius:var(--st-border-radius);display:flex;height:24px;justify-content:center;transition:background-color .3s ease,border-color .3s ease;width:24px}.st-checkbox-custom.st-checked{background-color:var(--blue-500);border-color:var(--blue-500)}.st-checkbox-checkmark{border:solid #fff;border-width:0 2px 2px 0;height:11px;transform:rotate(45deg);width:6px}@keyframes slide-in-left{0%{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes slide-in-right{0%{transform:translateX(100%)}to{transform:translateX(0)}}
|
|
2
|
-
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["simple-table.css"],"names":[],"mappings":"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","file":"index.css","sourcesContent":["/* Import Nunito font from Google Fonts */\n@import url(\"https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap\");\n\n:root {\n /* Slate Colors */\n --slate-50: #f8fafc;\n --slate-100: #f1f5f9;\n --slate-200: #e2e8f0;\n --slate-300: #cbd5e1;\n --slate-400: #94a3b8;\n --slate-500: #64748b;\n --slate-600: #475569;\n --slate-700: #334155;\n --slate-800: #1e293b;\n --slate-900: #0f172a;\n\n /* Blue Colors */\n --blue-50: #eff6ff;\n --blue-100: #dbeafe;\n --blue-200: #bfdbfe;\n --blue-300: #93c5fd;\n --blue-400: #60a5fa;\n --blue-500: #3b82f6;\n --blue-600: #2563eb;\n --blue-700: #1d4ed8;\n --blue-800: #1e40af;\n --blue-900: #1e3a8a;\n\n /* Orange Colors */\n --orange-50: #fff7ed;\n --orange-100: #ffedd5;\n --orange-200: #fed7aa;\n --orange-300: #fdba74;\n --orange-400: #fb923c;\n --orange-500: #f97316;\n --orange-600: #ea580c;\n --orange-700: #c2410c;\n --orange-800: #9a3412;\n --orange-900: #7c2d12;\n\n /* Amber Colors */\n --amber-50: #fffbeb;\n --amber-100: #fef3c7;\n --amber-200: #fde68a;\n --amber-300: #fcd34d;\n --amber-400: #fbbf24;\n --amber-500: #f59e0b;\n --amber-600: #d97706;\n --amber-700: #b45309;\n --amber-800: #92400e;\n --amber-900: #78350f;\n\n /* Customizable Variables */\n --st-border-radius: 4px;\n --st-border-color: var(--slate-300);\n --st-border-width: 1px;\n --st-resize-handle-color: var(--slate-300);\n --st-separator-border-color: var(--slate-300);\n --st-odd-row-background-color: var(--slate-100);\n --st-dragging-background-color: var(--blue-100);\n --st-selected-cell-background-color: var(--blue-200);\n --st-selected-first-cell-background-color: var(--amber-100);\n --st-border-top-color: var(--blue-500);\n --st-border-bottom-color: var(--blue-500);\n --st-border-left-color: var(--blue-500);\n --st-border-right-color: var(--blue-500);\n --st-border-top-white-color: white;\n --st-footer-background-color: white;\n --st-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --st-cell-padding: 8px;\n}\n\n/* Global styles */\n* {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n/* Apply Nunito as the default font */\nbody {\n font-family: \"Nunito\";\n}\n\n/* Wrapper for the table */\n.st-wrapper {\n position: relative;\n border: var(--st-border-width) solid var(--st-border-color);\n border-radius: var(--st-border-radius);\n max-height: 100dvh;\n overflow: hidden;\n}\n\n.st-table-wrapper {\n position: relative;\n display: flex;\n width: max-content;\n overflow: visible;\n height: 100%;\n width: 100%;\n}\n\n/* Main table styling */\n.st-table {\n position: relative;\n display: grid;\n border-collapse: collapse;\n table-layout: auto;\n white-space: nowrap;\n width: 100%;\n height: 100%;\n overflow: auto;\n}\n\n/* Styles for table header cells */\n.st-header-cell {\n position: sticky;\n top: 0;\n background-color: white;\n z-index: 1;\n font-weight: 600;\n\n display: flex;\n align-items: center;\n gap: 4px;\n border-top: var(--st-border-width) solid transparent;\n border-bottom: var(--st-border-width) solid var(--st-border-color);\n}\n.st-header-cell.clickable {\n cursor: pointer;\n}\n.st-header-cell.draggable {\n cursor: grab;\n}\n\n/* Common styles for table header and cells */\n.st-header-cell,\n.st-cell {\n color: var(--slate-800);\n overflow: hidden;\n}\n\n.st-cell.clickable {\n cursor: pointer;\n}\n\n.st-header-cell,\n.st-cell,\n.st-cell-editing {\n width: 100%;\n height: 40px;\n font-family: \"Nunito\";\n}\n\n.st-cell-editing {\n position: relative;\n}\n\n.st-header-label {\n flex: 1;\n}\n\n.st-header-label,\n.st-cell {\n user-select: none;\n padding: var(--st-cell-padding);\n text-align: left;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n width: 100%;\n}\n.st-cell {\n position: relative;\n border: var(--st-border-width) solid transparent;\n}\n.st-sort-icon-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n.st-sort-icon {\n fill: var(--slate-500);\n}\n\n.st-header-resize-handle {\n top: 0;\n right: 0;\n width: 5px;\n height: 20px;\n cursor: col-resize;\n background-color: var(--st-resize-handle-color);\n border-radius: 0.25rem;\n}\n\n.st-row-separator {\n height: 1px;\n background-color: var(--st-separator-border-color);\n grid-column: 1 / -1;\n}\n\n.st-cell-odd-row {\n background-color: var(--st-odd-row-background-color);\n}\n\n/* Style for a cell when it is being dragged */\n.st-dragging {\n background-color: var(--st-dragging-background-color);\n}\n\n/* Style for selected table cells */\n.st-cell-selected {\n background-color: var(--st-selected-cell-background-color);\n}\n\n/* Style for the first selected table cell */\n.st-cell-selected-first {\n background-color: var(--st-selected-first-cell-background-color);\n}\n\n/* Blue top border for cells */\n.st-selected-top-border {\n border-top: var(--st-border-width) solid var(--st-border-top-color);\n}\n\n/* Blue bottom border for cells */\n.st-selected-bottom-border {\n border-bottom: var(--st-border-width) solid var(--st-border-bottom-color);\n}\n\n/* Blue left border for cells */\n.st-selected-left-border {\n border-left: var(--st-border-width) solid var(--st-border-left-color);\n}\n\n/* Blue right border for cells */\n.st-selected-right-border {\n border-right: var(--st-border-width) solid var(--st-border-right-color);\n}\n\n/* White top border for cells */\n.st-selected-top-border-white {\n border-top: var(--st-border-width) solid var(--st-border-top-white-color);\n}\n\n.st-footer {\n display: flex;\n align-items: center;\n background-color: var(--st-footer-background-color);\n\n padding: 8px;\n\n border-top: var(--st-border-width) solid var(--st-border-color);\n}\n\n.st-next-prev-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px;\n cursor: pointer;\n background-color: transparent;\n border: none;\n border-radius: 4px;\n transition: background-color 0.3s ease;\n}\n.st-next-prev-btn {\n fill: var(--slate-600);\n}\n.disabled > .st-next-prev-icon {\n cursor: not-allowed;\n fill: var(--slate-400);\n}\n\n.st-next-prev-btn:not(.disabled):hover {\n background-color: var(--slate-100);\n}\n\n.st-page-btn {\n margin-left: 4px;\n padding: 4px;\n cursor: pointer;\n background-color: transparent;\n color: var(--slate-600);\n border: none;\n border-radius: var(--st-border-radius);\n transition: background-color 0.3s ease;\n}\n\n.st-page-btn:hover {\n background-color: var(--slate-100);\n}\n\n.st-page-btn.active {\n background-color: var(--blue-500);\n color: white;\n}\n\n.editable-cell-input {\n position: absolute;\n top: 0;\n left: 0;\n border-radius: var(--st-border-radius);\n border: var(--st-border-width) solid var(--st-border-color);\n box-shadow: var(--st-shadow);\n z-index: 1;\n outline: none;\n height: 100%;\n width: 100%;\n padding: var(--st-cell-padding);\n font-size: 1rem;\n font-family: \"Nunito\";\n}\n.editable-cell-input:focus {\n border: var(--st-border-width) solid var(--blue-500);\n}\n.st-column-editor {\n position: relative;\n user-select: none;\n\n background: var(--st-footer-background-color);\n border-left: var(--st-border-width) solid var(--st-border-color);\n cursor: pointer;\n}\n\n.st-column-editor-text {\n padding: 8px 4px;\n\n writing-mode: vertical-rl;\n color: var(--slate-500);\n background-color: white;\n z-index: 2;\n}\n\n.st-column-editor.open,\n.st-column-editor.open .st-column-editor-text {\n background-color: var(--slate-100);\n}\n\n.st-column-editor-popout {\n position: absolute;\n top: 0;\n right: calc(100% + 1px);\n z-index: 1;\n\n height: 100%;\n background-color: var(--slate-100);\n\n transition: width 0.2s ease;\n overflow: hidden;\n width: 0;\n}\n.st-column-editor-popout-content {\n display: flex;\n flex-direction: column;\n overflow: auto;\n gap: 4px;\n padding: 8px 4px;\n border-left: var(--st-border-width) solid var(--st-border-color);\n height: 100%;\n}\n\n.st-column-editor-popout.open {\n width: 200px;\n}\n\n.st-column-editor-popout.left {\n transform: translateX(-100%);\n}\n\n.st-column-editor-popout.open.left {\n transform: translateX(0);\n}\n\n/* Checkbox styles */\n.st-checkbox-label {\n display: flex;\n align-items: center;\n cursor: pointer;\n gap: 8px;\n}\n\n.st-checkbox-input {\n display: none; /* Hide the default checkbox */\n}\n\n.st-checkbox-custom {\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 24px;\n height: 24px;\n\n border: var(--st-border-width) solid var(--slate-300);\n border-radius: var(--st-border-radius);\n\n background-color: white;\n transition: background-color 0.3s ease, border-color 0.3s ease;\n}\n\n.st-checkbox-custom.st-checked {\n background-color: var(--blue-500);\n border-color: var(--blue-500);\n}\n\n.st-checkbox-checkmark {\n width: 6px;\n height: 11px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n}\n\n@keyframes slide-in-left {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n@keyframes slide-in-right {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n"]}
|