simple-table-core 0.7.24 → 0.7.26
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/components/SimpleTable/RenderCells.d.ts +5 -3
- package/dist/components/SimpleTable/TableHeaderCell.d.ts +8 -3
- package/dist/components/SimpleTable/TableHeaderSection.d.ts +3 -0
- package/dist/components/SimpleTable/TableRow.d.ts +2 -1
- package/dist/components/SimpleTable/TableSection.d.ts +2 -1
- package/dist/enums/Pinned.d.ts +4 -0
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/HeaderObject.d.ts +4 -2
- package/dist/types/TableHeaderSectionProps.d.ts +35 -0
- package/dist/utils/cellUtils.d.ts +3 -2
- package/dist/utils/sortUtils.d.ts +2 -2
- package/package.json +1 -1
|
@@ -2,12 +2,14 @@ import HeaderObject from "../../types/HeaderObject";
|
|
|
2
2
|
import TableBodyProps from "../../types/TableBodyProps";
|
|
3
3
|
import { RowId } from "../../types/RowId";
|
|
4
4
|
import VisibleRow from "../../types/VisibleRow";
|
|
5
|
-
|
|
5
|
+
import { Pinned } from "../../enums/Pinned";
|
|
6
|
+
type RenderCellsProps = {
|
|
6
7
|
headers: HeaderObject[];
|
|
7
8
|
hiddenColumns: Record<string, boolean>;
|
|
8
9
|
onExpandRowClick: (rowId: RowId) => void;
|
|
9
|
-
pinned?:
|
|
10
|
+
pinned?: Pinned;
|
|
10
11
|
rowIndex: number;
|
|
11
12
|
visibleRow: VisibleRow;
|
|
12
|
-
} & Omit<TableBodyProps, "currentRows" | "headerContainerRef"
|
|
13
|
+
} & Omit<TableBodyProps, "currentRows" | "headerContainerRef">;
|
|
14
|
+
declare const RenderCells: ({ getBorderClass, handleMouseDown, handleMouseOver, headers, hiddenColumns, isSelected, isInitialFocusedCell, onExpandRowClick, pinned, rowIndex, visibleRow, ...props }: RenderCellsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export default RenderCells;
|
|
@@ -3,15 +3,20 @@ import HeaderObject from "../../types/HeaderObject";
|
|
|
3
3
|
import SortConfig from "../../types/SortConfig";
|
|
4
4
|
import OnSortProps from "../../types/OnSortProps";
|
|
5
5
|
import Row from "../../types/Row";
|
|
6
|
-
interface TableHeaderCellProps {
|
|
6
|
+
export interface TableHeaderCellProps {
|
|
7
|
+
colIndex: number;
|
|
8
|
+
columnReordering: boolean;
|
|
7
9
|
columnResizing: boolean;
|
|
8
10
|
currentRows: Row[];
|
|
9
|
-
columnReordering: boolean;
|
|
10
11
|
draggedHeaderRef: RefObject<HeaderObject | null>;
|
|
11
12
|
forceUpdate: () => void;
|
|
13
|
+
gridColumnEnd: number;
|
|
14
|
+
gridColumnStart: number;
|
|
15
|
+
gridRowEnd: number;
|
|
16
|
+
gridRowStart: number;
|
|
17
|
+
header: HeaderObject;
|
|
12
18
|
headersRef: RefObject<HeaderObject[]>;
|
|
13
19
|
hoveredHeaderRef: RefObject<HeaderObject | null>;
|
|
14
|
-
index: number;
|
|
15
20
|
onColumnOrderChange?: (newHeaders: HeaderObject[]) => void;
|
|
16
21
|
onSort: OnSortProps;
|
|
17
22
|
onTableHeaderDragEnd: (newHeaders: HeaderObject[]) => void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import TableHeaderSectionProps from "../../types/TableHeaderSectionProps";
|
|
2
|
+
declare const TableHeaderSection: ({ allowAnimations, columnReordering, columnResizing, currentRows, draggedHeaderRef, forceUpdate, gridTemplateColumns, handleScroll, headersRef, hiddenColumns, hoveredHeaderRef, isWidthDragging, mainBodyRef, maxDepth, onColumnOrderChange, onSort, onTableHeaderDragEnd, pinned, rowHeight, sectionRef, selectableColumns, setIsWidthDragging, setSelectedCells, sort, sortDownIcon, sortUpIcon, }: TableHeaderSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default TableHeaderSection;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { RowId } from "../../types/RowId";
|
|
2
2
|
import TableBodyProps from "../../types/TableBodyProps";
|
|
3
3
|
import VisibleRow from "../../types/VisibleRow";
|
|
4
|
+
import { Pinned } from "../../enums/Pinned";
|
|
4
5
|
declare const TableRow: ({ getNextRowIndex, gridTemplateColumns, index, pinned, props, rowHeight, visibleRow, }: {
|
|
5
6
|
getNextRowIndex: () => number;
|
|
6
7
|
gridTemplateColumns: string;
|
|
7
8
|
index: number;
|
|
8
|
-
pinned?:
|
|
9
|
+
pinned?: Pinned | undefined;
|
|
9
10
|
props: Omit<TableBodyProps, "currentRows" | "headerContainerRef"> & {
|
|
10
11
|
onExpandRowClick: (rowId: RowId) => void;
|
|
11
12
|
};
|
|
@@ -2,10 +2,11 @@ import { RefObject } from "react";
|
|
|
2
2
|
import TableBodyProps from "../../types/TableBodyProps";
|
|
3
3
|
import VisibleRow from "../../types/VisibleRow";
|
|
4
4
|
import { RowId } from "../../types/RowId";
|
|
5
|
+
import { Pinned } from "../../enums/Pinned";
|
|
5
6
|
declare const TableSection: ({ headerContainerRef, onExpandRowClick, pinned, rowHeight, sectionRef, templateColumns, totalHeight, visibleRows, width, ...props }: {
|
|
6
7
|
headerContainerRef: RefObject<HTMLDivElement | null>;
|
|
7
8
|
onExpandRowClick: (rowId: RowId) => void;
|
|
8
|
-
pinned?:
|
|
9
|
+
pinned?: Pinned | undefined;
|
|
9
10
|
rowHeight: number;
|
|
10
11
|
sectionRef?: RefObject<HTMLDivElement | null> | undefined;
|
|
11
12
|
templateColumns: string;
|
package/dist/index.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import{useState as t,useRef as o,useCallback as i,useEffect as a,useMemo as l,forwardRef as d,useLayoutEffect as c,createElement as s,Fragment as u,createRef as f,memo as h,useReducer as v}from"react";var g=function(){return g=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},g.apply(this,arguments)};function w(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}function m(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;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 p,R=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},I=function(r){var t=r.currentPage,o=r.hideFooter,i=r.nextIcon,a=r.onPageChange,l=r.onNextPage,d=r.onPreviousPage,c=r.prevIcon,s=r.shouldPaginate,u=r.totalPages;if(o||!s)return null;var f=!(t>1)&&!d,h=!(t<u)&&!l;return e("div",g({className:"st-footer"},{children:[n("button",g({className:"st-next-prev-btn ".concat(f?"disabled":""),onClick:function(){var e=t-1;e>=1&&a(e),d&&d(e-1)},disabled:f},{children:c})),n("button",g({className:"st-next-prev-btn ".concat(h?"disabled":""),onClick:function(){var e=t+1;(e<=u||l)&&a(e),l&&l(t)},disabled:h},{children:i})),Array.from({length:u},(function(e,r){return n("button",g({onClick:function(){var e;(e=r+1)>=1&&e<=u&&(a(e),e>t&&l?l(e-1):e<t&&d&&d(e-1))},className:"st-page-btn ".concat(t===r+1?"active":"")},{children:r+1}),r)}))]}))},C=function(e){var r=e.className;return n("svg",g({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"})}))},x=function(e){var r=e.className;return n("svg",g({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"})}))},b=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",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"})}))},y=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",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"})}))},H=function(e){return e.position*(e.rowHeight+1)-1},M=function(e){return e.position*(e.rowHeight+1)},D=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},S=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},E=function(r){var t=r.value,o=r.onBlur,i=r.onChange;return e("select",g({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[n("option",g({value:"true"},{children:"True"})),n("option",g({value:"false"},{children:"False"}))]}))},k=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:t,onChange:function(e){var n=e.target.value;i(n)}})},N=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:t,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},T=function(e){var t=e.onChange,o=e.setIsEditing,i=e.value,a=function(e){null==t||t(e)},l=function(){o(!1)};return n(r,{children:"string"==typeof i||null==i?n(k,{defaultValue:i,onBlur:l,onChange:a}):"boolean"==typeof i?n(E,{onBlur:l,onChange:a,value:i}):"number"==typeof i?n(N,{defaultValue:i,onBlur:l,onChange:a}):null})},L=0,O=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===L||o-L>=t)&&(L=o,n(r))}},B=Date.now(),W={screenX:0,screenY:0},A=function(e){var n,r,t=e.draggedHeaderRef,i=e.headersRef,l=e.hoveredHeaderRef,d=e.onColumnOrderChange,c=e.onTableHeaderDragEnd,s=(n=i.current,r=o(n),a((function(){r.current=n}),[n]),r.current);return{handleDragStart:function(e){t.current=e,B=Date.now()},handleDragOver:function(e){var n,r=e.event,o=e.hoveredHeader;if(r.preventDefault(),i.current){var a=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),d=r.screenX,u=r.screenY,f=Math.sqrt(Math.pow(d-W.screenX,2)+Math.pow(u-W.screenY,2));l.current=o;var h=m([],i.current,!0),v=h.findIndex((function(e){var n;return e.accessor===(null===(n=t.current)||void 0===n?void 0:n.accessor)})),g=h.findIndex((function(e){return e.accessor===o.accessor})),w=h.splice(v,1)[0];if(h.splice(g,0,w),!(a||o.accessor===(null===(n=t.current)||void 0===n?void 0:n.accessor)||null===t.current||f<10||void 0===v||void 0===g||JSON.stringify(h)===JSON.stringify(i.current))){var p=Date.now();JSON.stringify(h)===JSON.stringify(s)&&p-B<800&&f<50||(B=p,W={screenX:d,screenY:u},c(h))}}},handleDragEnd:function(){t.current=null,l.current=null,null==d||d(i.current)}}},P=d((function(r,o){var i,l,d=r.borderClass,c=r.colIndex,s=r.draggedHeaderRef,u=r.header,f=r.headersRef,h=r.hoveredHeaderRef,v=r.isSelected,w=r.isInitialFocusedCell,m=r.onCellEdit,p=r.onExpandRowClick,R=r.onMouseDown,I=r.onMouseOver,C=r.onTableHeaderDragEnd,b=r.rowIndex,H=r.visibleRow,M=H.depth,S=H.row,E=t(S.rowData[u.accessor]),k=E[0],N=E[1],L=t(!1),B=L[0],W=L[1],P=A({draggedHeaderRef:s,headersRef:f,hoveredHeaderRef:h,onTableHeaderDragEnd:C}).handleDragOver,F=O(),z="cell-".concat(b,"-").concat(c),U=Boolean(null===(l=null===(i=S.rowMeta)||void 0===i?void 0:i.children)||void 0===l?void 0:l.length),j=Boolean(null==u?void 0:u.isEditable),K=b%2==0,V="st-cell ".concat(M>0&&u.expandable?"st-cell-depth-".concat(M):""," ").concat(v?w?"st-cell-selected-first ".concat(d):"st-cell-selected ".concat(d):""," ").concat(K?"st-cell-odd-row":"st-cell-even-row"," ").concat(j?"clickable":"");a((function(){N(S.rowData[u.accessor])}),[u.accessor,S]);return B?n("div",g({className:"st-cell-editing ".concat(K?"st-cell-odd-row":"st-cell-even-row"),id:D({accessor:u.accessor,rowIndex:b+1})},{children:n(T,{onChange:function(e){N(e),null==m||m({accessor:u.accessor,newValue:e,row:S})},setIsEditing:W,value:k})})):e("div",g({className:V,id:z,onDoubleClick:function(){return u.isEditable&&W(!0)},onMouseDown:function(){return R({rowIndex:b,colIndex:c,rowId:S.rowMeta.rowId})},onMouseOver:function(){return I({rowIndex:b,colIndex:c,rowId:S.rowMeta.rowId})},onDragOver:function(e){return F({callback:P,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||B||(e.preventDefault(),W(!0))},ref:o,"data-row-index":b,"data-col-index":c,"aria-selected":v},{children:[u.expandable&&U?S.rowMeta.isExpanded?n("div",g({className:"st-sort-icon-container",onClick:function(){return p(S.rowMeta.rowId)}},{children:n(y,{className:"st-sort-icon"})})):n("div",g({className:"st-sort-icon-container",onClick:function(){return p(S.rowMeta.rowId)}},{children:n(x,{className:"st-sort-icon"})})):null,n("span",g({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"")},{children:u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:c,row:S}):k}))]}))})),F=function(e){var t=e.allowAnimations,o=e.children,i=w(e,["allowAnimations","children"]);return t?n(z,g({},i,{children:o})):n(r,{children:o})},z=function(e){var i=e.allowHorizontalAnimate,l=void 0===i||i,d=e.children,s=e.draggedHeaderRef,u=e.headersRef,f=e.isBody,h=e.mainBodyRef,v=e.pauseAnimation,g=e.rowIndex,w=o(!1),m=t({}),p=m[0],R=m[1],I=o({}),C=u.current;return c((function(){if(C){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(D({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:C,draggedHeaderRef:s,rowIndex:g});JSON.stringify(e)!==JSON.stringify(p)&&(I.current=p,R(e))}}),[p,C,s,f,g]),c((function(){var e=h.current,n=function(){w.current=!0},r=function(){w.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[s,h]),a((function(){v||w.current||Object.keys(I.current).length&&C&&C.forEach((function(e){var n=document.getElementById(D({accessor:e.accessor,rowIndex:g}));if(n){var r=I.current[e.accessor],t=p[e.accessor];if(r&&t){var o=r.left-t.left,i=l?0:r.top-t.top,a=Math.abs(o),d=Math.abs(i);(a>10||d>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[l,p,C,f,v,I,g]),n(r,{children:d})},U=function(e){var r=e.getBorderClass,t=e.handleMouseDown,o=e.handleMouseOver,i=e.headers,a=e.hiddenColumns,l=e.isSelected,d=e.isInitialFocusedCell,c=e.onExpandRowClick,u=e.pinned,f=e.rowIndex,h=e.visibleRow,v=w(e,["getBorderClass","handleMouseDown","handleMouseOver","headers","hiddenColumns","isSelected","isInitialFocusedCell","onExpandRowClick","pinned","rowIndex","visibleRow"]);return n(F,g({allowAnimations:v.allowAnimations,allowHorizontalAnimate:v.shouldPaginate,draggedHeaderRef:v.draggedHeaderRef,headersRef:v.headersRef,isBody:!0,mainBodyRef:v.mainBodyRef,pauseAnimation:v.isWidthDragging,rowIndex:f+1},{children:i.map((function(e,n){return S({hiddenColumns:a,header:e,pinned:u})?s(P,g({},v,{borderClass:r({rowIndex:f,colIndex:n,rowId:h.row.rowMeta.rowId}),colIndex:n,header:e,isSelected:l({rowIndex:f,colIndex:n,rowId:h.row.rowMeta.rowId}),isInitialFocusedCell:d({rowIndex:f,colIndex:n,rowId:h.row.rowMeta.rowId}),key:D({accessor:e.accessor,rowIndex:f+1}),onExpandRowClick:c,onMouseDown:function(){return t({rowIndex:f,colIndex:n,rowId:h.row.rowMeta.rowId})},onMouseOver:function(){return o({rowIndex:f,colIndex:n,rowId:h.row.rowMeta.rowId})},rowIndex:f,visibleRow:h})):null}))}))},j=function(e){var r=e.getNextRowIndex,t=e.gridTemplateColumns,o=e.index,i=e.pinned,a=e.props,l=e.rowHeight,d=e.visibleRow,c=d.position,s=r();return n("div",g({className:"st-table-row",style:{gridTemplateColumns:t,top:M({position:c,rowHeight:l}),height:"".concat(l,"px")}},{children:n(U,g({pinned:i,rowIndex:s,visibleRow:d},a),o)}))},K=function(e){var r=e.lastGroupRow,t=e.position,o=e.rowHeight,i=e.templateColumns;return n("div",g({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:H({position:t,rowHeight:o}),minWidth:"100%"}},{children:n("div",{style:{gridColumn:"1 / -1"}})}))},V=function(r){r.headerContainerRef;var t=r.onExpandRowClick,i=r.pinned,l=r.rowHeight,d=r.sectionRef,c=r.templateColumns,s=r.totalHeight,f=r.visibleRows,h=r.width,v=w(r,["headerContainerRef","onExpandRowClick","pinned","rowHeight","sectionRef","templateColumns","totalHeight","visibleRows","width"]),m=i?"st-table-body-pinned-".concat(i):"st-table-body-main",p=o(0);a((function(){p.current=0}));var R=function(){return p.current++};return n("div",g({className:m,ref:d,style:{position:"relative",height:"".concat(s,"px"),width:h}},{children:f.map((function(r,o){var a,d,s=Boolean(null===(d=null===(a=r.row.rowMeta)||void 0===a?void 0:a.children)||void 0===d?void 0:d.length);return e(u,{children:[n(j,{getNextRowIndex:R,gridTemplateColumns:c,index:o,pinned:i,props:g(g({},v),{onExpandRowClick:t,rowHeight:l,visibleRows:f}),rowHeight:l,visibleRow:r}),0!==o&&n(K,{lastGroupRow:s,position:r.position,rowHeight:l,templateColumns:c})]},o)}))}))},J=function(r){var i,l,d,c,s,u=r.centerHeaderRef,f=r.flattenedRows,h=r.headerContainerRef,v=r.mainBodyRef,w=r.mainTemplateColumns,m=r.pinnedLeftColumns,p=r.pinnedLeftHeaderRef,R=r.pinnedLeftRef,I=r.pinnedLeftTemplateColumns,C=r.pinnedRightColumns,x=r.pinnedRightHeaderRef,b=r.pinnedRightRef,y=r.pinnedRightTemplateColumns,H=r.rowHeight,M=r.scrollbarWidth,D=r.setFlattenedRows,S=r.setScrollTop,E=r.tableBodyContainerRef,k=r.visibleRows;!function(e){var n=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=t(!1),l=i[0],d=i[1];a((function(){var e=null==n?void 0:n.current;if(l&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,l,o]),a((function(){var e=null==n?void 0:n.current,t=null==r?void 0:r.current;if(t&&e){var o=function(){if(t){var e=t.scrollHeight>t.clientHeight;d(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(t),function(){t&&i.unobserve(t)}}}),[n,r])}({headerContainerRef:h,mainSectionRef:E,scrollbarWidth:M});var N,T,L=o(null),O=(N=0,(T=function(e){e.forEach((function(e){N+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&T(e.rowMeta.children)}))})(f),N)*(H+1)-1,B=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};D((function(e){return e.map(n)}))},W=(null===(i=p.current)||void 0===i?void 0:i.clientWidth)?(null===(l=p.current)||void 0===l?void 0:l.clientWidth)+1:0,A=null===(d=u.current)||void 0===d?void 0:d.clientWidth,P=(null===(c=x.current)||void 0===c?void 0:c.clientWidth)?(null===(s=x.current)||void 0===s?void 0:s.clientWidth)+1:0;return e("div",g({className:"st-table-body-container",ref:E,onScroll:function(e){var n=e.currentTarget.scrollTop;L.current&&cancelAnimationFrame(L.current),L.current=requestAnimationFrame((function(){S(n)}))}},{children:[m.length>0&&n(V,g({},r,{onExpandRowClick:B,pinned:"left",rowHeight:H,sectionRef:R,templateColumns:I,totalHeight:O,visibleRows:k,width:W})),n(V,g({},r,{onExpandRowClick:B,rowHeight:H,sectionRef:v,templateColumns:w,totalHeight:O,visibleRows:k,width:A})),C.length>0&&n(V,g({},r,{onExpandRowClick:B,pinned:"right",rowHeight:H,sectionRef:b,templateColumns:y,totalHeight:O,visibleRows:k,width:P}))]}))},X={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return X.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?X.string(e,n,r):"number"==typeof e&&"number"==typeof n?X.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?X.boolean(e,n,r):X.string(String(e),String(n),r)}},q=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return X.number(i,a,t)}return"date"===r?X.date(String(e),String(n),t):"boolean"===r?X.boolean(Boolean(e),Boolean(n),t):"enum"===r?X.enum(String(e),String(n),t):X.string(String(e),String(n),t)},Y=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction,a=new Map,l=new Map,d="";e.forEach((function(e){var r;if(e.rowData&&!e.rowData[n.key.accessor]&&void 0!==e.rowMeta.isExpanded){var t=(e.rowData.sector||"group_".concat(a.size)).toString();d=t,l.set(d,e),a.has(d)||a.set(d,[])}else if(d){var o=a.get(d)||[];o.push(e),a.set(d,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(r=a.get(i))||void 0===r||r.push(e)}}));var c=[];return a.forEach((function(e,t){if(l.has(t)){var a=l.get(t);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=G(a.rowMeta.children,n,r)),c.push(a)}var d=m([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return q(a,l,o,i)}));c.push.apply(c,d.map((function(e){var t=g({},e);if(t.rowMeta.children&&t.rowMeta.children.length>0){var o=G(t.rowMeta.children,n,r);t.rowMeta=g(g({},t.rowMeta),{children:o})}return t})))})),c},G=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction;return m([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return q(a,l,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?g(g({},e),{rowMeta:g(g({},e.rowMeta),{children:G(e.rowMeta.children,n,r)})}):e}))},$=function(e){var n=e.event,r=e.forceUpdate,t=e.header,o=e.headersRef,i=e.index;e.reverse;var a=e.setIsWidthDragging,l=e.startWidth;a(!0),n.preventDefault();var d=n.clientX;if(t){var c=function(e){var n=Math.max(l+(e.clientX-d),40);t&&o.current&&(o.current[i].width=n,r())},s=function(){document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s),a(!1)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",s)}},_=d((function(r,o){var i,l=r.columnResizing,d=r.currentRows,c=r.columnReordering,s=r.draggedHeaderRef,u=r.forceUpdate,f=r.headersRef,h=r.hoveredHeaderRef,v=r.index,w=r.onColumnOrderChange,m=r.onSort,p=r.onTableHeaderDragEnd,I=r.reverse,C=r.rowHeight,x=r.selectableColumns,b=r.setIsWidthDragging,y=r.setSelectedCells,H=r.sort,M=r.sortDownIcon,S=r.sortUpIcon,E=t(!1),k=E[0],N=E[1],T=null===(i=f.current)||void 0===i?void 0:i[v],L=Boolean(null==T?void 0:T.isSortable),B="st-header-cell ".concat(T===h.current?"st-hovered":""," ").concat(k?"st-dragging":""," ").concat(L?"clickable":""," ").concat(c&&!L?"columnReordering":""," ").concat("right"===(null==T?void 0:T.align)?"right-aligned":"center"===(null==T?void 0:T.align)?"center-aligned":""),W=A({draggedHeaderRef:s,headersRef:f,hoveredHeaderRef:h,onColumnOrderChange:w,onTableHeaderDragEnd:p}),P=W.handleDragStart,F=W.handleDragEnd,z=W.handleDragOver,U=O(),j=function(e){var n=e.event,r=e.header;if(x){var t=d.length,o=Array.from({length:t},(function(e,n){return R({rowIndex:n,colIndex:v,rowId:d[n].rowMeta.rowId})})),i=function(e,n){var r=new Set,o=Math.min(e,n),i=Math.max(e,n);return Array.from({length:t}).forEach((function(e,n){Array.from({length:i-o+1}).forEach((function(e,t){r.add(R({rowIndex:n,colIndex:o+t,rowId:d[n].rowMeta.rowId}))}))})),r};n.shiftKey?y((function(e){var n,r=Number(null===(n=Array.from(e)[0])||void 0===n?void 0:n.split("-")[1]),t=Number(o[0].split("-")[1]);return r===t?new Set(o):r>t?i(t,r):i(r,t)})):y(new Set(o))}else r.isSortable&&m(v,r.accessor)};if(a((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!T)return null;var K=l&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;U({callback:$,callbackProps:{event:e,forceUpdate:u,header:T,headersRef:f,index:v,setIsWidthDragging:b,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),V=H&&H.key.accessor===T.accessor&&e("div",g({className:"st-sort-icon-container",onClick:function(e){return j({event:e,header:T})}},{children:["ascending"===H.direction&&S&&S,"descending"===H.direction&&M&&M]}));return e("div",g({className:B,id:D({accessor:T.accessor,rowIndex:0}),onDragOver:function(e){U({callback:z,callbackProps:{event:e,hoveredHeader:T},limit:50})},ref:o,style:{width:T.width,height:C}},{children:[I&&K,e("div",g({className:"st-header-label ".concat("right"===T.align?"right-aligned":"center"===T.align?"center-aligned":""),draggable:c,onClick:function(e){return j({event:e,header:T})},onDragEnd:function(e){e.preventDefault(),N(!1),F()},onDragStart:function(e){c&&T&&function(e){N(!0),P(e)}(T)}},{children:["right"===T.align&&V,null==T?void 0:T.label,"right"!==T.align&&V]})),!I&&K]}))})),Q=function(e,n){a((function(){if(e.current){var r=e.current,t=function(){var e,t=null==r?void 0:r.scrollLeft;void 0!==t&&(null===(e=n.current)||void 0===e||e.scrollTo(t,0))};return r.addEventListener("scroll",t),function(){null==r||r.removeEventListener("scroll",t)}}}),[e,n])},Z=function(r){var t,o,i,a=r.allowAnimations,l=r.centerHeaderRef,d=r.columnResizing,c=r.currentRows,s=r.columnReordering,u=r.draggedHeaderRef,h=r.forceUpdate,v=r.headerContainerRef,w=r.headersRef,m=r.hiddenColumns,p=r.hoveredHeaderRef,R=r.isWidthDragging,I=r.mainBodyRef,C=r.mainTemplateColumns,x=r.onColumnOrderChange,b=r.onSort,y=r.onTableHeaderDragEnd,H=r.pinnedLeftColumns,M=r.pinnedLeftHeaderRef,D=r.pinnedLeftTemplateColumns,E=r.pinnedRightColumns,k=r.pinnedRightHeaderRef,N=r.pinnedRightTemplateColumns,T=r.rowHeight,L=r.selectableColumns,O=r.setIsWidthDragging,B=r.setSelectedCells,W=r.sort,A=r.sortDownIcon,P=r.sortUpIcon;Q(I,l);return e("div",g({className:"st-header-container",ref:v},{children:[H.length>0&&n("div",g({className:"st-header-pinned-left",ref:M,style:{gridTemplateColumns:D}},{children:n(F,g({allowAnimations:a,draggedHeaderRef:u,headersRef:w,mainBodyRef:I,pauseAnimation:R,rowIndex:0},{children:null===(t=w.current)||void 0===t?void 0:t.map((function(e,r){return S({hiddenColumns:m,header:e,pinned:"left"})?n(_,{columnResizing:d,currentRows:c,columnReordering:s,draggedHeaderRef:u,forceUpdate:h,headersRef:w,hoveredHeaderRef:p,index:r,onColumnOrderChange:x,onSort:b,onTableHeaderDragEnd:y,ref:f(),rowHeight:T,selectableColumns:L,setIsWidthDragging:O,setSelectedCells:B,sort:W,sortDownIcon:A,sortUpIcon:P},e.accessor):null}))}))})),n("div",g({className:"st-header-main",onScroll:function(e){var n,r,t=null===(n=l.current)||void 0===n?void 0:n.scrollLeft;void 0!==t&&(null===(r=I.current)||void 0===r||r.scrollTo(t,0))},ref:l,style:{gridTemplateColumns:C}},{children:n(F,g({allowAnimations:a,draggedHeaderRef:u,headersRef:w,mainBodyRef:I,pauseAnimation:R,rowIndex:0},{children:null===(o=w.current)||void 0===o?void 0:o.map((function(e,r){return S({hiddenColumns:m,header:e})?n(_,{columnResizing:d,currentRows:c,columnReordering:s,draggedHeaderRef:u,forceUpdate:h,headersRef:w,hoveredHeaderRef:p,index:r,onColumnOrderChange:x,onSort:b,onTableHeaderDragEnd:y,ref:f(),rowHeight:T,selectableColumns:L,setIsWidthDragging:O,setSelectedCells:B,sort:W,sortDownIcon:A,sortUpIcon:P},e.accessor):null}))}))})),E.length>0&&n("div",g({className:"st-header-pinned-right",ref:k,style:{gridTemplateColumns:N}},{children:n(F,g({allowAnimations:a,draggedHeaderRef:u,headersRef:w,mainBodyRef:I,pauseAnimation:R,rowIndex:0},{children:null===(i=w.current)||void 0===i?void 0:i.map((function(e,r){return S({hiddenColumns:m,header:e,pinned:"right"})?n(_,{columnResizing:d,currentRows:c,columnReordering:s,draggedHeaderRef:u,forceUpdate:h,headersRef:w,hoveredHeaderRef:p,index:r,onColumnOrderChange:x,onSort:b,onTableHeaderDragEnd:y,reverse:!0,ref:f(),rowHeight:T,selectableColumns:L,setIsWidthDragging:O,setSelectedCells:B,sort:W,sortDownIcon:A,sortUpIcon:P},e.accessor):null}))}))}))]}))},ee=function(e){var n=e.headers,r=e.hiddenColumns;return"".concat(n.filter((function(e){return!0!==r[e.accessor]})).map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"minmax(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},ne=function(r){var t=r.allowAnimations,i=r.columnReordering,a=r.columnResizing,d=r.currentRows,c=r.draggedHeaderRef,s=r.editColumns,u=r.flattenedRows,f=r.forceUpdate,h=r.getBorderClass,v=r.handleMouseDown,w=r.handleMouseOver,m=r.headersRef,p=r.hiddenColumns,R=r.hoveredHeaderRef,I=r.isSelected,C=r.isInitialFocusedCell,x=r.isWidthDragging,b=r.mainBodyRef,y=r.onCellEdit,H=r.onColumnOrderChange,M=r.onSort,D=r.onTableHeaderDragEnd,S=r.pinnedLeftRef,E=r.pinnedRightRef,k=r.rowHeight,N=r.scrollbarWidth,T=r.selectableColumns,L=r.setIsWidthDragging,O=r.setFlattenedRows,B=r.setScrollTop,W=r.setSelectedCells,A=r.shouldPaginate,P=r.sort,F=r.sortDownIcon,z=r.sortUpIcon,U=r.tableBodyContainerRef,j=r.visibleRows,K=o(null),V=o(null),X=o(null),q=o(null),Y=m.current.filter((function(e){return!e.pinned})),G=m.current.filter((function(e){return"left"===e.pinned})),$=m.current.filter((function(e){return"right"===e.pinned})),_=l((function(){return ee({headers:G,hiddenColumns:p})}),[G,p]),Q=l((function(){return ee({headers:Y,hiddenColumns:p})}),[Y,p]),ne=l((function(){return ee({headers:$,hiddenColumns:p})}),[$,p]),re={allowAnimations:t,centerHeaderRef:X,columnResizing:a,currentRows:d,columnReordering:i,draggedHeaderRef:c,forceUpdate:f,headerContainerRef:K,headersRef:m,hiddenColumns:p,hoveredHeaderRef:R,isWidthDragging:x,mainBodyRef:b,mainTemplateColumns:Q,onColumnOrderChange:H,onSort:M,onTableHeaderDragEnd:D,pinnedLeftColumns:G,pinnedLeftHeaderRef:V,pinnedLeftTemplateColumns:_,pinnedRightColumns:$,pinnedRightHeaderRef:q,pinnedRightTemplateColumns:ne,rowHeight:k,selectableColumns:T,setIsWidthDragging:L,setSelectedCells:W,sort:P,sortDownIcon:F,sortUpIcon:z,tableBodyContainerRef:U},te={allowAnimations:t,centerHeaderRef:X,draggedHeaderRef:c,flattenedRows:u,getBorderClass:h,handleMouseDown:v,handleMouseOver:w,headerContainerRef:K,headers:m.current,headersRef:m,hiddenColumns:p,hoveredHeaderRef:R,isSelected:I,isInitialFocusedCell:C,isWidthDragging:x,mainBodyRef:b,mainTemplateColumns:Q,onCellEdit:y,onTableHeaderDragEnd:D,pinnedLeftColumns:G,pinnedLeftHeaderRef:V,pinnedLeftRef:S,pinnedLeftTemplateColumns:_,pinnedRightColumns:$,pinnedRightHeaderRef:q,pinnedRightRef:E,pinnedRightTemplateColumns:ne,rowHeight:k,scrollbarWidth:N,setFlattenedRows:O,shouldPaginate:A,setScrollTop:B,tableBodyContainerRef:U,visibleRows:j};return e("div",g({className:"st-table-content",style:{width:s?"calc(100% - 27.5px)":"100%"}},{children:[n(Z,g({},re)),n(J,g({},te))]}))},re=function(e){var n=e.callback,r=e.ref,t=e.widthAttribute;a((function(){var e=r.current;if(e){var o=function(){n(e[t]||0)};o();var i=new ResizeObserver((function(){o()}));return i.observe(e),function(){return i.disconnect()}}}),[n,r,t])},te=function(r){var i=r.mainBodyRef,a=r.pinnedLeftRef,l=r.pinnedRightRef,d=r.tableContentWidth,c=t(0),s=c[0],u=c[1],f=t(0),h=f[0],v=f[1],w=t(0),m=w[0],p=w[1],R=o(null);return re({widthAttribute:"offsetWidth",callback:u,ref:a}),re({widthAttribute:"scrollWidth",callback:p,ref:i}),re({widthAttribute:"offsetWidth",callback:v,ref:l}),Q(i,R),!i.current||i.current.scrollWidth<=i.current.clientWidth?null:e("div",g({className:"st-horizontal-scrollbar-container",style:{width:d}},{children:[s>0&&n("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s}}),m>0&&n("div",g({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&i.current&&i.current.scrollTo({left:n,behavior:"auto"})},ref:R},{children:n("div",{style:{width:m}})})),h>0&&n("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:h}})]}))},oe=function(e){var n=e.headers,r=e.tableRows,o=t(null),i=o[0],a=o[1],d=l((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),c=t(d),s=c[0],u=c[1],f=l((function(){if(!i)return r;var e=function(e,n,r){return{sortedData:Y(n,r,e),newSortConfig:r}}(n,r,i).sortedData;return e}),[r,i,n]);return{sort:i,setSort:a,updateSort:function(e,r){var t=n.find((function(e){return e.accessor===r}));t&&a((function(e){return e&&e.key.accessor===r?"ascending"===e.direction?{key:t,direction:"descending"}:null:{key:t,direction:"ascending"}}))},sortedRows:f,hiddenColumns:s,setHiddenColumns:u}},ie=function(r){var o=r.checked,i=void 0!==o&&o,a=r.children,l=r.onChange,d=t(i),c=d[0],s=d[1];return e("label",g({className:"st-checkbox-label"},{children:[n("input",{checked:c,className:"st-checkbox-input",onChange:function(){var e=!c;s(e),l&&l(e)},type:"checkbox"}),n("span",g({className:"st-checkbox-custom ".concat(c?"st-checked":"")},{children:c&&n("span",{className:"st-checkbox-checkmark"})})),a]}))},ae=function(e){var r=e.headers,t=e.open,o=e.position;e.setOpen;var i=e.setHiddenColumns,a=e.hiddenColumns,l="left"===o?"left":"";return n("div",g({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:n("div",g({className:"st-column-editor-popout-content"},{children:r.map((function(e,r){return n(ie,g({checked:a[e.accessor],onChange:function(n){var r;return i(g(g({},a),((r={})[e.accessor]=n,r)))}},{children:e.label}),r)}))}))}))},le=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,l=r.headers,d=r.position,c=void 0===d?"right":d,s=r.setHiddenColumns,u=r.hiddenColumns,f=t(a),h=f[0],v=f[1];return i?e("div",g({className:"st-column-editor ".concat(h?"open":""," ").concat(c),onClick:function(){return function(e){v(e)}(!h)}},{children:[n("div",g({className:"st-column-editor-text"},{children:o})),n(ae,{headers:l,open:h,position:c,setOpen:v,setHiddenColumns:s,hiddenColumns:u})]})):null};!function(e){e.Left="left",e.Right="right"}(p||(p={}));var de=h((function(r){var d=r.allowAnimations,s=void 0!==d&&d,u=r.columnEditorPosition,f=void 0===u?p.Right:u,h=r.columnEditorText,w=void 0===h?"Columns":h,m=r.columnResizing,H=void 0!==m&&m,M=r.defaultHeaders,D=r.editColumns,S=void 0!==D&&D,E=r.editColumnsInitOpen,k=void 0!==E&&E,N=r.columnReordering,T=void 0!==N&&N,L=r.height,O=r.hideFooter,B=void 0!==O&&O,W=r.nextIcon,A=void 0===W?n(x,{className:"st-next-prev-icon"}):W,P=r.onCellEdit,F=r.onColumnOrderChange,z=r.onNextPage,U=r.onPreviousPage,j=r.prevIcon,K=void 0===j?n(C,{className:"st-next-prev-icon"}):j,V=r.rowHeight,J=void 0===V?40:V,X=r.rows,q=r.rowsPerPage,Y=void 0===q?10:q,G=r.selectableCells,$=void 0!==G&&G,_=r.selectableColumns,Q=void 0!==_&&_,Z=r.shouldPaginate,ee=void 0!==Z&&Z,re=r.sortDownIcon,ie=void 0===re?n(y,{className:"st-sort-icon"}):re,ae=r.sortUpIcon,de=void 0===ae?n(b,{className:"st-sort-icon"}):ae,ce=r.theme,se=void 0===ce?"light":ce,ue=r.totalPages,fe=o(null),he=o(M),ve=o(null),ge=o(null),we=o(null),me=o(null),pe=o(null),Re=t(!1),Ie=Re[0],Ce=Re[1],xe=t(1),be=xe[0],ye=xe[1],He=t(0),Me=He[0],De=He[1],Se=t(0),Ee=Se[0],ke=Se[1],Ne=t(0),Te=Ne[0],Le=Ne[1],Oe=oe({headers:he.current,tableRows:X}),Be=Oe.sort,We=Oe.sortedRows,Ae=Oe.hiddenColumns,Pe=Oe.setHiddenColumns,Fe=Oe.updateSort,ze=l((function(){if(!ee)return We;var e=(be-1)*Y,n=e+Y;return We.slice(e,n)}),[be,Y,ee,We]),Ue=t(ze),je=Ue[0],Ke=Ue[1];a((function(){Ke(ze)}),[ze]);var Ve=l((function(){var e;if(!L)return window.innerHeight-J;var n=document.querySelector(".simple-table-root"),r=0;if(L.endsWith("px"))r=parseInt(L,10);else if(L.endsWith("vh")){var t=parseInt(L,10);r=window.innerHeight*t/100}else if(L.endsWith("%")){var o=parseInt(L,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-J)}),[L,J]),Je=l((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=[],l=0,d=Math.max(0,i-o*n),c=i+r+o*n,s=function(e,n){for(var r,t=0,i=e;t<i.length;t++){var u=i[t],f=l*o;if(f>=c)break;f+o>d&&a.push({row:u,depth:n,position:l,isLastGroupRow:Boolean(null===(r=u.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),l+=1,u.rowMeta.isExpanded&&u.rowMeta.children&&s(u.rowMeta.children,n+1)}};return s(t,0),a}({bufferRowCount:5,contentHeight:Ve,flattenedRows:je,rowHeight:J,scrollTop:Te})}),[Ve,J,je,Te]),Xe=v((function(e){return e+1}),0)[1],qe=function(e){var n=e.selectableCells,r=e.headers,d=e.visibleRows,c=t(new Set),s=c[0],u=c[1],f=t(null),h=f[0],v=f[1],g=o(!1),w=o(null),m=i((function(){var e=Array.from(s).reduce((function(e,n){var t=n.split("-").map(Number),o=t[0],i=t[1];return e[o]||(e[o]=[]),e[o][i]=d[o].row.rowData[r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(n)}),[r,s,d]),p=i((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),o=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),a=Math.max(e.colIndex,n.colIndex),l=t;l<=o;l++)for(var c=i;c<=a;c++)if(l>=0&&l<d.length){var s=d[l].row.rowMeta.rowId;r.add(R({colIndex:c,rowIndex:l,rowId:s}))}u(r)}),[d]),I=i((function(e){if(e.rowIndex>=0&&e.rowIndex<d.length&&e.colIndex>=0&&e.colIndex<r.length){var n=R(e);u(new Set([n])),v(e)}}),[r.length,d.length]);a((function(){var e=function(e){if(n&&h){var t=h.rowIndex,o=h.colIndex,i=h.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(d[t].row.rowMeta.rowId!==i){var a=d.findIndex((function(e){return e.row.rowMeta.rowId===i}));if(-1===a)return;t=a}if("ArrowUp"===e.key){if(e.preventDefault(),t>0){var l={rowIndex:t-1,colIndex:o,rowId:d[t-1].row.rowMeta.rowId};I(l)}}else"ArrowDown"===e.key?(e.preventDefault(),t<d.length-1&&(l={rowIndex:t+1,colIndex:o,rowId:d[t+1].row.rowMeta.rowId},I(l))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(l={rowIndex:t,colIndex:o-1,rowId:d[t].row.rowMeta.rowId},I(l))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<r.length-1&&(l={rowIndex:t,colIndex:o+1,rowId:d[t].row.rowMeta.rowId},I(l))):"Escape"===e.key&&(u(new Set),w.current=null,v(null))}else m()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[m,r.length,h,p,I,n,d]);var C=i((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=R({colIndex:n,rowIndex:r,rowId:t});return s.has(o)}),[s]),x=i((function(e){var n,r,t,o,i,a,l=e.colIndex,c=e.rowIndex,s=e.rowId,u=[],f=null===(t=null===(r=null===(n=d[c-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,h={colIndex:l,rowIndex:c+1,rowId:null===(a=null===(i=null===(o=d[c+1])||void 0===o?void 0:o.row)||void 0===i?void 0:i.rowMeta)||void 0===a?void 0:a.rowId},v={colIndex:l-1,rowIndex:c,rowId:s},g={colIndex:l+1,rowIndex:c,rowId:s};return C({colIndex:l,rowIndex:c-1,rowId:f})||u.push("st-selected-top-border"),C(h)||u.push("st-selected-bottom-border"),C(v)||u.push("st-selected-left-border"),C(g)||u.push("st-selected-right-border"),u.join(" ")}),[C,d]),b=l((function(){return h?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===h.rowIndex&&r===h.colIndex&&t===h.rowId}:function(){return!1}}),[h]);return{getBorderClass:x,handleMouseDown:function(e){var r=e.colIndex,t=e.rowIndex,o=e.rowId;if(n){g.current=!0,w.current={rowIndex:t,colIndex:r,rowId:o};var i=R({colIndex:r,rowIndex:t,rowId:o});u(new Set([i])),v({rowIndex:t,colIndex:r,rowId:o})}},handleMouseOver:function(e){var r=e.colIndex,t=e.rowIndex;if(e.rowId,n&&g.current&&w.current){for(var o=new Set,i=Math.min(w.current.rowIndex,t),a=Math.max(w.current.rowIndex,t),l=Math.min(w.current.colIndex,r),c=Math.max(w.current.colIndex,r),s=i;s<=a;s++)for(var f=l;f<=c;f++)if(s>=0&&s<d.length){var h=d[s].row.rowMeta.rowId;o.add(R({colIndex:f,rowIndex:s,rowId:h}))}u(o)}},handleMouseUp:function(){g.current=!1},isInitialFocusedCell:b,isSelected:C,selectedCells:s,setSelectedCells:u}}({selectableCells:$,headers:he.current,visibleRows:Je}),Ye=qe.handleMouseDown,Ge=qe.handleMouseOver,$e=qe.handleMouseUp,_e=qe.isSelected,Qe=qe.getBorderClass,Ze=qe.isInitialFocusedCell,en=qe.setSelectedCells,nn=i((function(e,n){Fe(e,n)}),[Fe]),rn=i((function(e){he.current=e,Xe()}),[]);return a((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||Q&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||en(new Set)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[Q,en]),c((function(){if(pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth,n=pe.current.clientWidth;De(e),ke(n)}}),[]),c((function(){var e=function(){if(Xe(),pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth,n=pe.current.clientWidth;De(e),ke(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),e("div",g({className:"simple-table-root st-wrapper theme-".concat(se),style:L?{height:L}:{}},{children:[e("div",g({className:"st-table-wrapper-container"},{children:[e("div",g({className:"st-table-wrapper",onMouseUp:$e,onMouseLeave:$e},{children:[n(ne,{allowAnimations:s,columnReordering:T,columnResizing:H,currentRows:ze,draggedHeaderRef:fe,editColumns:S,flattenedRows:je,forceUpdate:Xe,getBorderClass:Qe,handleMouseDown:Ye,handleMouseOver:Ge,headersRef:he,hiddenColumns:Ae,hoveredHeaderRef:ve,isInitialFocusedCell:Ze,isSelected:_e,isWidthDragging:Ie,mainBodyRef:ge,onCellEdit:P,onColumnOrderChange:F,onSort:nn,onTableHeaderDragEnd:rn,pinnedLeftRef:we,pinnedRightRef:me,rowHeight:J,scrollbarWidth:Me,selectableColumns:Q,setIsWidthDragging:Ce,setFlattenedRows:Ke,setScrollTop:Le,setSelectedCells:en,shouldPaginate:ee,sort:Be,sortDownIcon:ie,sortUpIcon:de,tableBodyContainerRef:pe,visibleRows:Je}),n(le,{columnEditorText:w,editColumns:S,editColumnsInitOpen:k,headers:he.current,hiddenColumns:Ae,position:f,setHiddenColumns:Pe})]})),n(te,{mainBodyRef:ge,pinnedLeftRef:we,pinnedRightRef:me,tableContentWidth:Ee})]})),n(I,{currentPage:be,hideFooter:B,nextIcon:A,onPageChange:ye,onNextPage:z,onPreviousPage:U,prevIcon:K,shouldPaginate:ee,totalPages:ue||Math.ceil(We.length/Y)})]}))}));export{de as SimpleTable};
|
|
1
|
+
import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import{useState as t,useRef as o,useCallback as i,useEffect as a,useMemo as l,forwardRef as d,useLayoutEffect as c,createElement as s,Fragment as u,createRef as h,memo as f,useReducer as v}from"react";var g=function(){return g=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},g.apply(this,arguments)};function w(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}function m(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;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 p,I=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},R=function(r){var t=r.currentPage,o=r.hideFooter,i=r.nextIcon,a=r.onPageChange,l=r.onNextPage,d=r.onPreviousPage,c=r.prevIcon,s=r.shouldPaginate,u=r.totalPages;if(o||!s)return null;var h=!(t>1)&&!d,f=!(t<u)&&!l;return e("div",g({className:"st-footer"},{children:[n("button",g({className:"st-next-prev-btn ".concat(h?"disabled":""),onClick:function(){var e=t-1;e>=1&&a(e),d&&d(e-1)},disabled:h},{children:c})),n("button",g({className:"st-next-prev-btn ".concat(f?"disabled":""),onClick:function(){var e=t+1;(e<=u||l)&&a(e),l&&l(t)},disabled:f},{children:i})),Array.from({length:u},(function(e,r){return n("button",g({onClick:function(){var e;(e=r+1)>=1&&e<=u&&(a(e),e>t&&l?l(e-1):e<t&&d&&d(e-1))},className:"st-page-btn ".concat(t===r+1?"active":"")},{children:r+1}),r)}))]}))},C=function(e){var r=e.className;return n("svg",g({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"})}))},x=function(e){var r=e.className;return n("svg",g({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"})}))},b=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",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"})}))},y=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",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"})}))},H=function(e){return e.position*(e.rowHeight+1)-1},M=function(e){return e.position*(e.rowHeight+1)},D=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},E=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},S=function(r){var t=r.value,o=r.onBlur,i=r.onChange;return e("select",g({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[n("option",g({value:"true"},{children:"True"})),n("option",g({value:"false"},{children:"False"}))]}))},k=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:t,onChange:function(e){var n=e.target.value;i(n)}})},N=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:t,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},T=function(e){var t=e.onChange,o=e.setIsEditing,i=e.value,a=function(e){null==t||t(e)},l=function(){o(!1)};return n(r,{children:"string"==typeof i||null==i?n(k,{defaultValue:i,onBlur:l,onChange:a}):"boolean"==typeof i?n(S,{onBlur:l,onChange:a,value:i}):"number"==typeof i?n(N,{defaultValue:i,onBlur:l,onChange:a}):null})},L=0,O=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===L||o-L>=t)&&(L=o,n(r))}},B=Date.now(),W={screenX:0,screenY:0},A=function(e){var n,r,t=e.draggedHeaderRef,i=e.headersRef,l=e.hoveredHeaderRef,d=e.onColumnOrderChange,c=e.onTableHeaderDragEnd,s=(n=i.current,r=o(n),a((function(){r.current=n}),[n]),r.current);return{handleDragStart:function(e){t.current=e,B=Date.now()},handleDragOver:function(e){var n,r=e.event,o=e.hoveredHeader;if(r.preventDefault(),i.current){var a=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),d=r.screenX,u=r.screenY,h=Math.sqrt(Math.pow(d-W.screenX,2)+Math.pow(u-W.screenY,2));l.current=o;var f=m([],i.current,!0),v=f.findIndex((function(e){var n;return e.accessor===(null===(n=t.current)||void 0===n?void 0:n.accessor)})),g=f.findIndex((function(e){return e.accessor===o.accessor})),w=f.splice(v,1)[0];if(f.splice(g,0,w),!(a||o.accessor===(null===(n=t.current)||void 0===n?void 0:n.accessor)||null===t.current||h<10||void 0===v||void 0===g||JSON.stringify(f)===JSON.stringify(i.current))){var p=Date.now();JSON.stringify(f)===JSON.stringify(s)&&p-B<800&&h<50||(B=p,W={screenX:d,screenY:u},c(f))}}},handleDragEnd:function(){t.current=null,l.current=null,null==d||d(i.current)}}},P=d((function(r,o){var i,l,d=r.borderClass,c=r.colIndex,s=r.draggedHeaderRef,u=r.header,h=r.headersRef,f=r.hoveredHeaderRef,v=r.isSelected,w=r.isInitialFocusedCell,m=r.onCellEdit,p=r.onExpandRowClick,I=r.onMouseDown,R=r.onMouseOver,C=r.onTableHeaderDragEnd,b=r.rowIndex,H=r.visibleRow,M=H.depth,E=H.row,S=t(E.rowData[u.accessor]),k=S[0],N=S[1],L=t(!1),B=L[0],W=L[1],P=A({draggedHeaderRef:s,headersRef:h,hoveredHeaderRef:f,onTableHeaderDragEnd:C}).handleDragOver,F=O(),z="cell-".concat(b,"-").concat(c),U=Boolean(null===(l=null===(i=E.rowMeta)||void 0===i?void 0:i.children)||void 0===l?void 0:l.length),j=Boolean(null==u?void 0:u.isEditable),G=b%2==0,K="st-cell ".concat(M>0&&u.expandable?"st-cell-depth-".concat(M):""," ").concat(v?w?"st-cell-selected-first ".concat(d):"st-cell-selected ".concat(d):""," ").concat(G?"st-cell-odd-row":"st-cell-even-row"," ").concat(j?"clickable":"");a((function(){N(E.rowData[u.accessor])}),[u.accessor,E]);return B?n("div",g({className:"st-cell-editing ".concat(G?"st-cell-odd-row":"st-cell-even-row"),id:D({accessor:u.accessor,rowIndex:b+1})},{children:n(T,{onChange:function(e){N(e),null==m||m({accessor:u.accessor,newValue:e,row:E})},setIsEditing:W,value:k})})):e("div",g({className:K,id:z,onDoubleClick:function(){return u.isEditable&&W(!0)},onMouseDown:function(){return I({rowIndex:b,colIndex:c,rowId:E.rowMeta.rowId})},onMouseOver:function(){return R({rowIndex:b,colIndex:c,rowId:E.rowMeta.rowId})},onDragOver:function(e){return F({callback:P,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||B||(e.preventDefault(),W(!0))},ref:o,"data-row-index":b,"data-col-index":c,"aria-selected":v},{children:[u.expandable&&U?E.rowMeta.isExpanded?n("div",g({className:"st-sort-icon-container",onClick:function(){return p(E.rowMeta.rowId)}},{children:n(y,{className:"st-sort-icon"})})):n("div",g({className:"st-sort-icon-container",onClick:function(){return p(E.rowMeta.rowId)}},{children:n(x,{className:"st-sort-icon"})})):null,n("span",g({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"")},{children:u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:c,row:E}):k}))]}))})),F=function(e){var t=e.allowAnimations,o=e.children,i=w(e,["allowAnimations","children"]);return t?n(z,g({},i,{children:o})):n(r,{children:o})},z=function(e){var i=e.allowHorizontalAnimate,l=void 0===i||i,d=e.children,s=e.draggedHeaderRef,u=e.headersRef,h=e.isBody,f=e.mainBodyRef,v=e.pauseAnimation,g=e.rowIndex,w=o(!1),m=t({}),p=m[0],I=m[1],R=o({}),C=u.current;return c((function(){if(C){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(D({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:C,draggedHeaderRef:s,rowIndex:g});JSON.stringify(e)!==JSON.stringify(p)&&(R.current=p,I(e))}}),[p,C,s,h,g]),c((function(){var e=f.current,n=function(){w.current=!0},r=function(){w.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[s,f]),a((function(){v||w.current||Object.keys(R.current).length&&C&&C.forEach((function(e){var n=document.getElementById(D({accessor:e.accessor,rowIndex:g}));if(n){var r=R.current[e.accessor],t=p[e.accessor];if(r&&t){var o=r.left-t.left,i=l?0:r.top-t.top,a=Math.abs(o),d=Math.abs(i);(a>10||d>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[l,p,C,h,v,R,g]),n(r,{children:d})},U=function(e){var r=e.getBorderClass,t=e.handleMouseDown,o=e.handleMouseOver,i=e.headers,a=e.hiddenColumns,l=e.isSelected,d=e.isInitialFocusedCell,c=e.onExpandRowClick,s=e.pinned,u=e.rowIndex,h=e.visibleRow,f=w(e,["getBorderClass","handleMouseDown","handleMouseOver","headers","hiddenColumns","isSelected","isInitialFocusedCell","onExpandRowClick","pinned","rowIndex","visibleRow"]);return n(F,g({allowAnimations:f.allowAnimations,allowHorizontalAnimate:f.shouldPaginate,draggedHeaderRef:f.draggedHeaderRef,headersRef:f.headersRef,isBody:!0,mainBodyRef:f.mainBodyRef,pauseAnimation:f.isWidthDragging,rowIndex:u+1},{children:i.map((function(e,v){return E({hiddenColumns:a,header:e,pinned:s})?n(j,g({colIndex:v,getBorderClass:r,handleMouseDown:t,handleMouseOver:o,header:e,headers:i,hiddenColumns:a,isInitialFocusedCell:d,isSelected:l,onExpandRowClick:c,pinned:s,rowIndex:u,visibleRow:h},f),D({accessor:e.accessor,rowIndex:u+1})):null}))}))},j=function(e){var t=e.colIndex,o=e.getBorderClass,i=e.handleMouseDown,a=e.handleMouseOver,l=e.header,d=e.isInitialFocusedCell,c=e.isSelected,u=e.onExpandRowClick,h=e.rowIndex,f=e.visibleRow,v=w(e,["colIndex","getBorderClass","handleMouseDown","handleMouseOver","header","isInitialFocusedCell","isSelected","onExpandRowClick","rowIndex","visibleRow"]);return l.children?n(r,{children:l.children.map((function(e,r){return n(j,g({colIndex:t+r,getBorderClass:o,handleMouseDown:i,handleMouseOver:a,header:e,isSelected:c,isInitialFocusedCell:d,onExpandRowClick:u,rowIndex:h,visibleRow:f},v),D({accessor:e.accessor,rowIndex:h+1}))}))}):s(P,g({},v,{borderClass:o({rowIndex:h,colIndex:t,rowId:f.row.rowMeta.rowId}),colIndex:t,header:l,isSelected:c({rowIndex:h,colIndex:t,rowId:f.row.rowMeta.rowId}),isInitialFocusedCell:d({rowIndex:h,colIndex:t,rowId:f.row.rowMeta.rowId}),key:D({accessor:l.accessor,rowIndex:h+1}),onExpandRowClick:u,onMouseDown:function(){return i({rowIndex:h,colIndex:t,rowId:f.row.rowMeta.rowId})},onMouseOver:function(){return a({rowIndex:h,colIndex:t,rowId:f.row.rowMeta.rowId})},rowIndex:h,visibleRow:f}))},G=function(e){var r=e.getNextRowIndex,t=e.gridTemplateColumns,o=e.index,i=e.pinned,a=e.props,l=e.rowHeight,d=e.visibleRow,c=d.position,s=r();return n("div",g({className:"st-table-row",style:{gridTemplateColumns:t,top:M({position:c,rowHeight:l}),height:"".concat(l,"px")}},{children:n(U,g({pinned:i,rowIndex:s,visibleRow:d},a),o)}))},K=function(e){var r=e.lastGroupRow,t=e.position,o=e.rowHeight,i=e.templateColumns;return n("div",g({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:H({position:t,rowHeight:o}),minWidth:"100%"}},{children:n("div",{style:{gridColumn:"1 / -1"}})}))},V=function(r){r.headerContainerRef;var t=r.onExpandRowClick,i=r.pinned,l=r.rowHeight,d=r.sectionRef,c=r.templateColumns,s=r.totalHeight,h=r.visibleRows,f=r.width,v=w(r,["headerContainerRef","onExpandRowClick","pinned","rowHeight","sectionRef","templateColumns","totalHeight","visibleRows","width"]),m=i?"st-table-body-pinned-".concat(i):"st-table-body-main",p=o(0);a((function(){p.current=0}));var I=function(){return p.current++};return n("div",g({className:m,ref:d,style:{position:"relative",height:"".concat(s,"px"),width:f}},{children:h.map((function(r,o){var a,d,s=Boolean(null===(d=null===(a=r.row.rowMeta)||void 0===a?void 0:a.children)||void 0===d?void 0:d.length);return e(u,{children:[n(G,{getNextRowIndex:I,gridTemplateColumns:c,index:o,pinned:i,props:g(g({},v),{onExpandRowClick:t,rowHeight:l,visibleRows:h}),rowHeight:l,visibleRow:r}),0!==o&&n(K,{lastGroupRow:s,position:r.position,rowHeight:l,templateColumns:c})]},o)}))}))};!function(e){e.LEFT="left",e.RIGHT="right"}(p||(p={}));var J,X=function(r){var i,l,d,c,s,u=r.centerHeaderRef,h=r.flattenedRows,f=r.headerContainerRef,v=r.mainBodyRef,w=r.mainTemplateColumns,m=r.pinnedLeftColumns,I=r.pinnedLeftHeaderRef,R=r.pinnedLeftRef,C=r.pinnedLeftTemplateColumns,x=r.pinnedRightColumns,b=r.pinnedRightHeaderRef,y=r.pinnedRightRef,H=r.pinnedRightTemplateColumns,M=r.rowHeight,D=r.scrollbarWidth,E=r.setFlattenedRows,S=r.setScrollTop,k=r.tableBodyContainerRef,N=r.visibleRows;!function(e){var n=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=t(!1),l=i[0],d=i[1];a((function(){var e=null==n?void 0:n.current;if(l&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,l,o]),a((function(){var e=null==n?void 0:n.current,t=null==r?void 0:r.current;if(t&&e){var o=function(){if(t){var e=t.scrollHeight>t.clientHeight;d(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(t),function(){t&&i.unobserve(t)}}}),[n,r])}({headerContainerRef:f,mainSectionRef:k,scrollbarWidth:D});var T,L,O=o(null),B=(T=0,(L=function(e){e.forEach((function(e){T+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&L(e.rowMeta.children)}))})(h),T)*(M+1)-1,W=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};E((function(e){return e.map(n)}))},A=(null===(i=I.current)||void 0===i?void 0:i.clientWidth)?(null===(l=I.current)||void 0===l?void 0:l.clientWidth)+1:0,P=null===(d=u.current)||void 0===d?void 0:d.clientWidth,F=(null===(c=b.current)||void 0===c?void 0:c.clientWidth)?(null===(s=b.current)||void 0===s?void 0:s.clientWidth)+1:0;return e("div",g({className:"st-table-body-container",ref:k,onScroll:function(e){var n=e.currentTarget.scrollTop;O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame((function(){S(n)}))}},{children:[m.length>0&&n(V,g({},r,{onExpandRowClick:W,pinned:p.LEFT,rowHeight:M,sectionRef:R,templateColumns:C,totalHeight:B,visibleRows:N,width:A})),n(V,g({},r,{onExpandRowClick:W,rowHeight:M,sectionRef:v,templateColumns:w,totalHeight:B,visibleRows:N,width:P})),x.length>0&&n(V,g({},r,{onExpandRowClick:W,pinned:p.RIGHT,rowHeight:M,sectionRef:y,templateColumns:H,totalHeight:B,visibleRows:N,width:F}))]}))},q=function(e,n){a((function(){if(e.current){var r=e.current,t=function(){var e,t=null==r?void 0:r.scrollLeft;void 0!==t&&(null===(e=n.current)||void 0===e||e.scrollTo(t,0))};return r.addEventListener("scroll",t),function(){null==r||r.removeEventListener("scroll",t)}}}),[e,n])},Y={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return Y.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?Y.string(e,n,r):"number"==typeof e&&"number"==typeof n?Y.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?Y.boolean(e,n,r):Y.string(String(e),String(n),r)}},$=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return Y.number(i,a,t)}return"date"===r?Y.date(String(e),String(n),t):"boolean"===r?Y.boolean(Boolean(e),Boolean(n),t):"enum"===r?Y.enum(String(e),String(n),t):Y.string(String(e),String(n),t)},_=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction,a=new Map,l=new Map,d="";e.forEach((function(e){var r;if(e.rowData&&!e.rowData[n.key.accessor]&&void 0!==e.rowMeta.isExpanded){var t=(e.rowData.sector||"group_".concat(a.size)).toString();d=t,l.set(d,e),a.has(d)||a.set(d,[])}else if(d){var o=a.get(d)||[];o.push(e),a.set(d,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(r=a.get(i))||void 0===r||r.push(e)}}));var c=[];return a.forEach((function(e,t){if(l.has(t)){var a=l.get(t);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=Q(a.rowMeta.children,n,r)),c.push(a)}var d=m([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return $(a,l,o,i)}));c.push.apply(c,d.map((function(e){var t=g({},e);if(t.rowMeta.children&&t.rowMeta.children.length>0){var o=Q(t.rowMeta.children,n,r);t.rowMeta=g(g({},t.rowMeta),{children:o})}return t})))})),c},Q=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction;return m([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return $(a,l,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?g(g({},e),{rowMeta:g(g({},e.rowMeta),{children:Q(e.rowMeta.children,n,r)})}):e}))},Z=function(e){var n=e.colIndex,r=e.event,t=e.forceUpdate,o=e.header,i=e.headersRef;e.reverse;var a=e.setIsWidthDragging,l=e.startWidth;a(!0),r.preventDefault();var d=r.clientX;if(o){var c=function(e){var r=Math.max(l+(e.clientX-d),40);o&&i.current&&(i.current[n].width=r,t())},s=function(){document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s),a(!1)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",s)}},ee=d((function(r,o){var i=r.colIndex,l=r.columnReordering,d=r.columnResizing,c=r.currentRows,s=r.draggedHeaderRef,u=r.forceUpdate,h=r.gridColumnEnd,f=r.gridColumnStart,v=r.gridRowEnd,w=r.gridRowStart,m=r.header,p=r.headersRef,R=r.hoveredHeaderRef,C=r.onColumnOrderChange,x=r.onSort,b=r.onTableHeaderDragEnd,y=r.reverse,H=r.rowHeight,M=r.selectableColumns,E=r.setIsWidthDragging,S=r.setSelectedCells,k=r.sort,N=r.sortDownIcon,T=r.sortUpIcon,L=t(!1),B=L[0],W=L[1],P=Boolean(null==m?void 0:m.isSortable),F="st-header-cell ".concat(m===R.current?"st-hovered":""," ").concat(B?"st-dragging":""," ").concat(P?"clickable":""," ").concat(l&&!P?"columnReordering":""," ").concat("right"===(null==m?void 0:m.align)?"right-aligned":"center"===(null==m?void 0:m.align)?"center-aligned":""),z=A({draggedHeaderRef:s,headersRef:p,hoveredHeaderRef:R,onColumnOrderChange:C,onTableHeaderDragEnd:b}),U=z.handleDragStart,j=z.handleDragEnd,G=z.handleDragOver,K=O(),V=function(e){var n=e.event,r=e.header;if(M){var t=c.length,o=Array.from({length:t},(function(e,n){return I({rowIndex:n,colIndex:i,rowId:c[n].rowMeta.rowId})})),a=function(e,n){var r=new Set,o=Math.min(e,n),i=Math.max(e,n);return Array.from({length:t}).forEach((function(e,n){Array.from({length:i-o+1}).forEach((function(e,t){r.add(I({rowIndex:n,colIndex:o+t,rowId:c[n].rowMeta.rowId}))}))})),r};n.shiftKey?S((function(e){var n,r=Number(null===(n=Array.from(e)[0])||void 0===n?void 0:n.split("-")[1]),t=Number(o[0].split("-")[1]);return r===t?new Set(o):r>t?a(t,r):a(r,t)})):S(new Set(o))}else r.isSortable&&x(i,r.accessor)};if(a((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!m)return null;var J=d&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;K({callback:Z,callbackProps:{colIndex:i,event:e,forceUpdate:u,header:m,headersRef:p,setIsWidthDragging:E,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),X=k&&k.key.accessor===m.accessor&&e("div",g({className:"st-sort-icon-container",onClick:function(e){return V({event:e,header:m})}},{children:["ascending"===k.direction&&T&&T,"descending"===k.direction&&N&&N]}));return e("div",g({className:F,id:D({accessor:m.accessor,rowIndex:0}),onDragOver:function(e){K({callback:G,callbackProps:{event:e,hoveredHeader:m},limit:50})},ref:o,style:g(g({gridRowStart:w,gridRowEnd:v,gridColumnStart:f,gridColumnEnd:h},h-f>1?{}:{width:m.width}),v-w>1?{}:{height:H})},{children:[y&&J,e("div",g({className:"st-header-label ".concat("right"===m.align?"right-aligned":"center"===m.align?"center-aligned":""),draggable:l,onClick:function(e){return V({event:e,header:m})},onDragEnd:function(e){e.preventDefault(),W(!1),j()},onDragStart:function(e){l&&m&&function(e){W(!0),U(e)}(m)}},{children:["right"===m.align&&X,null==m?void 0:m.label,"right"!==m.align&&X]})),!y&&J]}))})),ne=function(r){var t,o,i=r.depth,a=r.getNextColIndex,l=r.header,d=r.hiddenColumns,c=r.index,f=r.maxDepth,v=r.pinned,m=w(r,["depth","getNextColIndex","header","hiddenColumns","index","maxDepth","pinned"]),p=null!==(o=null===(t=l.children)||void 0===t?void 0:t.length)&&void 0!==o?o:0,I=a(0===c?0:1),R={gridColumnStart:I,gridColumnEnd:p>0?I+p:I+1,gridRowStart:i,gridRowEnd:p>0?i+1:f+1};if(l.children){var C=l.children.filter((function(e){return E({hiddenColumns:d,header:e,pinned:v})}));return e(u,{children:[n(ee,g({},m,R,{colIndex:I,header:l,ref:h()})),C.map((function(e,n){return s(ne,g({},m,{depth:i+1,getNextColIndex:a,header:e,hiddenColumns:d,index:n,key:e.accessor,maxDepth:f}))}))]})}return n(ee,g({},m,R,{colIndex:I,header:l,ref:h()}))},re=function(e){var r=e.allowAnimations,t=e.columnReordering,i=e.columnResizing,l=e.currentRows,d=e.draggedHeaderRef,c=e.forceUpdate,s=e.gridTemplateColumns,u=e.handleScroll,h=e.headersRef,f=e.hiddenColumns,v=e.hoveredHeaderRef,w=e.isWidthDragging,m=e.mainBodyRef,I=e.maxDepth,R=e.onColumnOrderChange,C=e.onSort,x=e.onTableHeaderDragEnd,b=e.pinned,y=e.rowHeight,H=e.sectionRef,M=e.selectableColumns,D=e.setIsWidthDragging,S=e.setSelectedCells,k=e.sort,N=e.sortDownIcon,T=e.sortUpIcon,L=o(1);a((function(){L.current=1}));var O=function(e){return void 0===e&&(e=1),L.current+=e,L.current},B=h.current.filter((function(e){return E({hiddenColumns:f,header:e,pinned:b})}));return n("div",g({className:"st-header-".concat(b?"pinned-".concat(b):"main")},u&&{onScroll:u},{ref:H,style:{gridTemplateColumns:s}},{children:n(F,g({allowAnimations:r,draggedHeaderRef:d,headersRef:h,mainBodyRef:m,pauseAnimation:w,rowIndex:0},{children:B.map((function(e,r){return n(ne,{getNextColIndex:O,columnReordering:t,columnResizing:i,currentRows:l,depth:1,draggedHeaderRef:d,forceUpdate:c,header:e,headersRef:h,hiddenColumns:f,hoveredHeaderRef:v,index:r,maxDepth:I,onColumnOrderChange:R,onSort:C,onTableHeaderDragEnd:x,pinned:b,reverse:b===p.RIGHT,rowHeight:y,selectableColumns:M,setIsWidthDragging:D,setSelectedCells:S,sort:k,sortDownIcon:N,sortUpIcon:T},e.accessor)}))}))}))},te=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(te)):1},oe=function(r){var t=r.allowAnimations,o=r.centerHeaderRef,i=r.columnResizing,a=r.currentRows,d=r.columnReordering,c=r.draggedHeaderRef,s=r.forceUpdate,u=r.headerContainerRef,h=r.headersRef,f=r.hiddenColumns,v=r.hoveredHeaderRef,w=r.isWidthDragging,m=r.mainBodyRef,I=r.mainTemplateColumns,R=r.onColumnOrderChange,C=r.onSort,x=r.onTableHeaderDragEnd,b=r.pinnedLeftColumns,y=r.pinnedLeftHeaderRef,H=r.pinnedLeftTemplateColumns,M=r.pinnedRightColumns,D=r.pinnedRightHeaderRef,S=r.pinnedRightTemplateColumns,k=r.rowHeight,N=r.selectableColumns,T=r.setIsWidthDragging,L=r.setSelectedCells,O=r.sort,B=r.sortDownIcon,W=r.sortUpIcon;q(m,o);var A=function(e){var n,r,t=null===(n=o.current)||void 0===n?void 0:n.scrollLeft;void 0!==t&&(null===(r=m.current)||void 0===r||r.scrollTo(t,0))},P=l((function(){var e=h.current,n=0;return e.forEach((function(e){if(E({hiddenColumns:f,header:e})){var r=te(e);n=Math.max(n,r)}})),{maxDepth:n}}),[h,f]).maxDepth,F={allowAnimations:t,columnReordering:d,columnResizing:i,currentRows:a,draggedHeaderRef:c,forceUpdate:s,handleScroll:A,headersRef:h,hiddenColumns:f,hoveredHeaderRef:v,isWidthDragging:w,mainBodyRef:m,maxDepth:P,onColumnOrderChange:R,onSort:C,onTableHeaderDragEnd:x,rowHeight:k,selectableColumns:N,setIsWidthDragging:T,setSelectedCells:L,sort:O,sortDownIcon:B,sortUpIcon:W};return e("div",g({className:"st-header-container",ref:u},{children:[b.length>0&&n(re,g({},F,{gridTemplateColumns:H,pinned:p.LEFT,sectionRef:y})),n(re,g({},F,{gridTemplateColumns:I,handleScroll:A,sectionRef:o})),M.length>0&&n(re,g({},F,{gridTemplateColumns:S,pinned:p.RIGHT,sectionRef:D}))]}))},ie=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"minmax(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},ae=function(r){var t=r.allowAnimations,i=r.columnReordering,a=r.columnResizing,d=r.currentRows,c=r.draggedHeaderRef,s=r.editColumns,u=r.flattenedRows,h=r.forceUpdate,f=r.getBorderClass,v=r.handleMouseDown,w=r.handleMouseOver,m=r.headersRef,p=r.hiddenColumns,I=r.hoveredHeaderRef,R=r.isSelected,C=r.isInitialFocusedCell,x=r.isWidthDragging,b=r.mainBodyRef,y=r.onCellEdit,H=r.onColumnOrderChange,M=r.onSort,D=r.onTableHeaderDragEnd,E=r.pinnedLeftRef,S=r.pinnedRightRef,k=r.rowHeight,N=r.scrollbarWidth,T=r.selectableColumns,L=r.setIsWidthDragging,O=r.setFlattenedRows,B=r.setScrollTop,W=r.setSelectedCells,A=r.shouldPaginate,P=r.sort,F=r.sortDownIcon,z=r.sortUpIcon,U=r.tableBodyContainerRef,j=r.visibleRows,G=o(null),K=o(null),V=o(null),J=o(null),q=m.current.filter((function(e){return!e.pinned})),Y=m.current.filter((function(e){return"left"===e.pinned})),$=m.current.filter((function(e){return"right"===e.pinned})),_=l((function(){return ie({headers:Y,hiddenColumns:p})}),[Y,p]),Q=l((function(){return ie({headers:q,hiddenColumns:p})}),[q,p]),Z=l((function(){return ie({headers:$,hiddenColumns:p})}),[$,p]),ee={allowAnimations:t,centerHeaderRef:V,columnResizing:a,currentRows:d,columnReordering:i,draggedHeaderRef:c,forceUpdate:h,headerContainerRef:G,headersRef:m,hiddenColumns:p,hoveredHeaderRef:I,isWidthDragging:x,mainBodyRef:b,mainTemplateColumns:Q,onColumnOrderChange:H,onSort:M,onTableHeaderDragEnd:D,pinnedLeftColumns:Y,pinnedLeftHeaderRef:K,pinnedLeftTemplateColumns:_,pinnedRightColumns:$,pinnedRightHeaderRef:J,pinnedRightTemplateColumns:Z,rowHeight:k,selectableColumns:T,setIsWidthDragging:L,setSelectedCells:W,sort:P,sortDownIcon:F,sortUpIcon:z,tableBodyContainerRef:U},ne={allowAnimations:t,centerHeaderRef:V,draggedHeaderRef:c,flattenedRows:u,getBorderClass:f,handleMouseDown:v,handleMouseOver:w,headerContainerRef:G,headers:m.current,headersRef:m,hiddenColumns:p,hoveredHeaderRef:I,isSelected:R,isInitialFocusedCell:C,isWidthDragging:x,mainBodyRef:b,mainTemplateColumns:Q,onCellEdit:y,onTableHeaderDragEnd:D,pinnedLeftColumns:Y,pinnedLeftHeaderRef:K,pinnedLeftRef:E,pinnedLeftTemplateColumns:_,pinnedRightColumns:$,pinnedRightHeaderRef:J,pinnedRightRef:S,pinnedRightTemplateColumns:Z,rowHeight:k,scrollbarWidth:N,setFlattenedRows:O,shouldPaginate:A,setScrollTop:B,tableBodyContainerRef:U,visibleRows:j};return e("div",g({className:"st-table-content",style:{width:s?"calc(100% - 27.5px)":"100%"}},{children:[n(oe,g({},ee)),n(X,g({},ne))]}))},le=function(e){var n=e.callback,r=e.ref,t=e.widthAttribute;a((function(){var e=r.current;if(e){var o=function(){n(e[t]||0)};o();var i=new ResizeObserver((function(){o()}));return i.observe(e),function(){return i.disconnect()}}}),[n,r,t])},de=function(r){var i=r.mainBodyRef,a=r.pinnedLeftRef,l=r.pinnedRightRef,d=r.tableContentWidth,c=t(0),s=c[0],u=c[1],h=t(0),f=h[0],v=h[1],w=t(0),m=w[0],p=w[1],I=o(null);return le({widthAttribute:"offsetWidth",callback:u,ref:a}),le({widthAttribute:"scrollWidth",callback:p,ref:i}),le({widthAttribute:"offsetWidth",callback:v,ref:l}),q(i,I),!i.current||i.current.scrollWidth<=i.current.clientWidth?null:e("div",g({className:"st-horizontal-scrollbar-container",style:{width:d}},{children:[s>0&&n("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s}}),m>0&&n("div",g({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&i.current&&i.current.scrollTo({left:n,behavior:"auto"})},ref:I},{children:n("div",{style:{width:m}})})),f>0&&n("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:f}})]}))},ce=function(e){var n=e.headers,r=e.tableRows,o=t(null),i=o[0],a=o[1],d=l((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),c=t(d),s=c[0],u=c[1],h=l((function(){if(!i)return r;var e=function(e,n,r){return{sortedData:_(n,r,e),newSortConfig:r}}(n,r,i).sortedData;return e}),[r,i,n]);return{sort:i,setSort:a,updateSort:function(e,r){var t=n.find((function(e){return e.accessor===r}));t&&a((function(e){return e&&e.key.accessor===r?"ascending"===e.direction?{key:t,direction:"descending"}:null:{key:t,direction:"ascending"}}))},sortedRows:h,hiddenColumns:s,setHiddenColumns:u}},se=function(r){var o=r.checked,i=void 0!==o&&o,a=r.children,l=r.onChange,d=t(i),c=d[0],s=d[1];return e("label",g({className:"st-checkbox-label"},{children:[n("input",{checked:c,className:"st-checkbox-input",onChange:function(){var e=!c;s(e),l&&l(e)},type:"checkbox"}),n("span",g({className:"st-checkbox-custom ".concat(c?"st-checked":"")},{children:c&&n("span",{className:"st-checkbox-checkmark"})})),a]}))},ue=function(e){var r=e.headers,t=e.open,o=e.position;e.setOpen;var i=e.setHiddenColumns,a=e.hiddenColumns,l="left"===o?"left":"";return n("div",g({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:n("div",g({className:"st-column-editor-popout-content"},{children:r.map((function(e,r){return n(se,g({checked:a[e.accessor],onChange:function(n){var r;return i(g(g({},a),((r={})[e.accessor]=n,r)))}},{children:e.label}),r)}))}))}))},he=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,l=r.headers,d=r.position,c=void 0===d?"right":d,s=r.setHiddenColumns,u=r.hiddenColumns,h=t(a),f=h[0],v=h[1];return i?e("div",g({className:"st-column-editor ".concat(f?"open":""," ").concat(c),onClick:function(){return function(e){v(e)}(!f)}},{children:[n("div",g({className:"st-column-editor-text"},{children:o})),n(ue,{headers:l,open:f,position:c,setOpen:v,setHiddenColumns:s,hiddenColumns:u})]})):null};!function(e){e.Left="left",e.Right="right"}(J||(J={}));var fe=f((function(r){var d=r.allowAnimations,s=void 0!==d&&d,u=r.columnEditorPosition,h=void 0===u?J.Right:u,f=r.columnEditorText,w=void 0===f?"Columns":f,m=r.columnResizing,p=void 0!==m&&m,H=r.defaultHeaders,M=r.editColumns,D=void 0!==M&&M,E=r.editColumnsInitOpen,S=void 0!==E&&E,k=r.columnReordering,N=void 0!==k&&k,T=r.height,L=r.hideFooter,O=void 0!==L&&L,B=r.nextIcon,W=void 0===B?n(x,{className:"st-next-prev-icon"}):B,A=r.onCellEdit,P=r.onColumnOrderChange,F=r.onNextPage,z=r.onPreviousPage,U=r.prevIcon,j=void 0===U?n(C,{className:"st-next-prev-icon"}):U,G=r.rowHeight,K=void 0===G?40:G,V=r.rows,X=r.rowsPerPage,q=void 0===X?10:X,Y=r.selectableCells,$=void 0!==Y&&Y,_=r.selectableColumns,Q=void 0!==_&&_,Z=r.shouldPaginate,ee=void 0!==Z&&Z,ne=r.sortDownIcon,re=void 0===ne?n(y,{className:"st-sort-icon"}):ne,te=r.sortUpIcon,oe=void 0===te?n(b,{className:"st-sort-icon"}):te,ie=r.theme,le=void 0===ie?"light":ie,se=r.totalPages,ue=o(null),fe=o(H),ve=o(null),ge=o(null),we=o(null),me=o(null),pe=o(null),Ie=t(!1),Re=Ie[0],Ce=Ie[1],xe=t(1),be=xe[0],ye=xe[1],He=t(0),Me=He[0],De=He[1],Ee=t(0),Se=Ee[0],ke=Ee[1],Ne=t(0),Te=Ne[0],Le=Ne[1],Oe=ce({headers:fe.current,tableRows:V}),Be=Oe.sort,We=Oe.sortedRows,Ae=Oe.hiddenColumns,Pe=Oe.setHiddenColumns,Fe=Oe.updateSort,ze=l((function(){if(!ee)return We;var e=(be-1)*q,n=e+q;return We.slice(e,n)}),[be,q,ee,We]),Ue=t(ze),je=Ue[0],Ge=Ue[1];a((function(){Ge(ze)}),[ze]);var Ke=l((function(){var e;if(!T)return window.innerHeight-K;var n=document.querySelector(".simple-table-root"),r=0;if(T.endsWith("px"))r=parseInt(T,10);else if(T.endsWith("vh")){var t=parseInt(T,10);r=window.innerHeight*t/100}else if(T.endsWith("%")){var o=parseInt(T,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-K)}),[T,K]),Ve=l((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=[],l=0,d=Math.max(0,i-o*n),c=i+r+o*n,s=function(e,n){for(var r,t=0,i=e;t<i.length;t++){var u=i[t],h=l*o;if(h>=c)break;h+o>d&&a.push({row:u,depth:n,position:l,isLastGroupRow:Boolean(null===(r=u.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),l+=1,u.rowMeta.isExpanded&&u.rowMeta.children&&s(u.rowMeta.children,n+1)}};return s(t,0),a}({bufferRowCount:5,contentHeight:Ke,flattenedRows:je,rowHeight:K,scrollTop:Te})}),[Ke,K,je,Te]),Je=v((function(e){return e+1}),0)[1],Xe=function(e){var n=e.selectableCells,r=e.headers,d=e.visibleRows,c=t(new Set),s=c[0],u=c[1],h=t(null),f=h[0],v=h[1],g=o(!1),w=o(null),m=i((function(){var e=Array.from(s).reduce((function(e,n){var t=n.split("-").map(Number),o=t[0],i=t[1];return e[o]||(e[o]=[]),e[o][i]=d[o].row.rowData[r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(n)}),[r,s,d]),p=i((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),o=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),a=Math.max(e.colIndex,n.colIndex),l=t;l<=o;l++)for(var c=i;c<=a;c++)if(l>=0&&l<d.length){var s=d[l].row.rowMeta.rowId;r.add(I({colIndex:c,rowIndex:l,rowId:s}))}u(r)}),[d]),R=i((function(e){if(e.rowIndex>=0&&e.rowIndex<d.length&&e.colIndex>=0&&e.colIndex<r.length){var n=I(e);u(new Set([n])),v(e)}}),[r.length,d.length]);a((function(){var e=function(e){if(n&&f){var t=f.rowIndex,o=f.colIndex,i=f.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(d[t].row.rowMeta.rowId!==i){var a=d.findIndex((function(e){return e.row.rowMeta.rowId===i}));if(-1===a)return;t=a}if("ArrowUp"===e.key){if(e.preventDefault(),t>0){var l={rowIndex:t-1,colIndex:o,rowId:d[t-1].row.rowMeta.rowId};R(l)}}else"ArrowDown"===e.key?(e.preventDefault(),t<d.length-1&&(l={rowIndex:t+1,colIndex:o,rowId:d[t+1].row.rowMeta.rowId},R(l))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(l={rowIndex:t,colIndex:o-1,rowId:d[t].row.rowMeta.rowId},R(l))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<r.length-1&&(l={rowIndex:t,colIndex:o+1,rowId:d[t].row.rowMeta.rowId},R(l))):"Escape"===e.key&&(u(new Set),w.current=null,v(null))}else m()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[m,r.length,f,p,R,n,d]);var C=i((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=I({colIndex:n,rowIndex:r,rowId:t});return s.has(o)}),[s]),x=i((function(e){var n,r,t,o,i,a,l=e.colIndex,c=e.rowIndex,s=e.rowId,u=[],h=null===(t=null===(r=null===(n=d[c-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,f={colIndex:l,rowIndex:c+1,rowId:null===(a=null===(i=null===(o=d[c+1])||void 0===o?void 0:o.row)||void 0===i?void 0:i.rowMeta)||void 0===a?void 0:a.rowId},v={colIndex:l-1,rowIndex:c,rowId:s},g={colIndex:l+1,rowIndex:c,rowId:s};return C({colIndex:l,rowIndex:c-1,rowId:h})||u.push("st-selected-top-border"),C(f)||u.push("st-selected-bottom-border"),C(v)||u.push("st-selected-left-border"),C(g)||u.push("st-selected-right-border"),u.join(" ")}),[C,d]),b=l((function(){return f?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===f.rowIndex&&r===f.colIndex&&t===f.rowId}:function(){return!1}}),[f]);return{getBorderClass:x,handleMouseDown:function(e){var r=e.colIndex,t=e.rowIndex,o=e.rowId;if(n){g.current=!0,w.current={rowIndex:t,colIndex:r,rowId:o};var i=I({colIndex:r,rowIndex:t,rowId:o});u(new Set([i])),v({rowIndex:t,colIndex:r,rowId:o})}},handleMouseOver:function(e){var r=e.colIndex,t=e.rowIndex;if(e.rowId,n&&g.current&&w.current){for(var o=new Set,i=Math.min(w.current.rowIndex,t),a=Math.max(w.current.rowIndex,t),l=Math.min(w.current.colIndex,r),c=Math.max(w.current.colIndex,r),s=i;s<=a;s++)for(var h=l;h<=c;h++)if(s>=0&&s<d.length){var f=d[s].row.rowMeta.rowId;o.add(I({colIndex:h,rowIndex:s,rowId:f}))}u(o)}},handleMouseUp:function(){g.current=!1},isInitialFocusedCell:b,isSelected:C,selectedCells:s,setSelectedCells:u}}({selectableCells:$,headers:fe.current,visibleRows:Ve}),qe=Xe.handleMouseDown,Ye=Xe.handleMouseOver,$e=Xe.handleMouseUp,_e=Xe.isSelected,Qe=Xe.getBorderClass,Ze=Xe.isInitialFocusedCell,en=Xe.setSelectedCells,nn=i((function(e,n){Fe(e,n)}),[Fe]),rn=i((function(e){fe.current=e,Je()}),[]);return a((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||Q&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||en(new Set)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[Q,en]),c((function(){if(pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth,n=pe.current.clientWidth;De(e),ke(n)}}),[]),c((function(){var e=function(){if(Je(),pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth,n=pe.current.clientWidth;De(e),ke(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),e("div",g({className:"simple-table-root st-wrapper theme-".concat(le),style:T?{height:T}:{}},{children:[e("div",g({className:"st-table-wrapper-container"},{children:[e("div",g({className:"st-table-wrapper",onMouseUp:$e,onMouseLeave:$e},{children:[n(ae,{allowAnimations:s,columnReordering:N,columnResizing:p,currentRows:ze,draggedHeaderRef:ue,editColumns:D,flattenedRows:je,forceUpdate:Je,getBorderClass:Qe,handleMouseDown:qe,handleMouseOver:Ye,headersRef:fe,hiddenColumns:Ae,hoveredHeaderRef:ve,isInitialFocusedCell:Ze,isSelected:_e,isWidthDragging:Re,mainBodyRef:ge,onCellEdit:A,onColumnOrderChange:P,onSort:nn,onTableHeaderDragEnd:rn,pinnedLeftRef:we,pinnedRightRef:me,rowHeight:K,scrollbarWidth:Me,selectableColumns:Q,setIsWidthDragging:Ce,setFlattenedRows:Ge,setScrollTop:Le,setSelectedCells:en,shouldPaginate:ee,sort:Be,sortDownIcon:re,sortUpIcon:oe,tableBodyContainerRef:pe,visibleRows:Ve}),n(he,{columnEditorText:w,editColumns:D,editColumnsInitOpen:S,headers:fe.current,hiddenColumns:Ae,position:h,setHiddenColumns:Pe})]})),n(de,{mainBodyRef:ge,pinnedLeftRef:we,pinnedRightRef:me,tableContentWidth:Se})]})),n(R,{currentPage:be,hideFooter:O,nextIcon:W,onPageChange:ye,onNextPage:F,onPreviousPage:z,prevIcon:j,shouldPaginate:ee,totalPages:se||Math.ceil(We.length/q)})]}))}));export{fe as SimpleTable};
|
|
2
2
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=function(){return r=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},r.apply(this,arguments)};function t(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}function o(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 a,i=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},l=function(n){var t=n.currentPage,o=n.hideFooter,a=n.nextIcon,i=n.onPageChange,l=n.onNextPage,s=n.onPreviousPage,d=n.prevIcon,c=n.shouldPaginate,u=n.totalPages;if(o||!c)return null;var f=!(t>1)&&!s,h=!(t<u)&&!l;return e.jsxs("div",r({className:"st-footer"},{children:[e.jsx("button",r({className:"st-next-prev-btn ".concat(f?"disabled":""),onClick:function(){var e=t-1;e>=1&&i(e),s&&s(e-1)},disabled:f},{children:d})),e.jsx("button",r({className:"st-next-prev-btn ".concat(h?"disabled":""),onClick:function(){var e=t+1;(e<=u||l)&&i(e),l&&l(t)},disabled:h},{children:a})),Array.from({length:u},(function(n,o){return e.jsx("button",r({onClick:function(){var e;(e=o+1)>=1&&e<=u&&(i(e),e>t&&l?l(e-1):e<t&&s&&s(e-1))},className:"st-page-btn ".concat(t===o+1?"active":"")},{children:o+1}),o)}))]}))},s=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},d=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},c=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},u=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},f=function(e){return e.position*(e.rowHeight+1)-1},h=function(e){return e.position*(e.rowHeight+1)},v=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},g=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},w=function(n){var t=n.value,o=n.onBlur,a=n.onChange;return e.jsxs("select",r({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;a("true"===n)}},{children:[e.jsx("option",r({value:"true"},{children:"True"})),e.jsx("option",r({value:"false"},{children:"False"}))]}))},m=function(r){var t=r.defaultValue,o=r.onBlur,a=r.onChange,i=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:i,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){var n=e.target.value;a(n)}})},p=function(r){var t=r.defaultValue,o=r.onBlur,a=r.onChange,i=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:i,autoFocus:!0,defaultValue:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&a(n)}})},x=function(n){var r=n.onChange,t=n.setIsEditing,o=n.value,a=function(e){null==r||r(e)},i=function(){t(!1)};return e.jsx(e.Fragment,{children:"string"==typeof o||null==o?e.jsx(m,{defaultValue:o,onBlur:i,onChange:a}):"boolean"==typeof o?e.jsx(w,{onBlur:i,onChange:a,value:o}):"number"==typeof o?e.jsx(p,{defaultValue:o,onBlur:i,onChange:a}):null})},R=0,I=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===R||o-R>=t)&&(R=o,n(r))}},C=Date.now(),b={screenX:0,screenY:0},y=function(e){var r,t,a=e.draggedHeaderRef,i=e.headersRef,l=e.hoveredHeaderRef,s=e.onColumnOrderChange,d=e.onTableHeaderDragEnd,c=(r=i.current,t=n.useRef(r),n.useEffect((function(){t.current=r}),[r]),t.current);return{handleDragStart:function(e){a.current=e,C=Date.now()},handleDragOver:function(e){var n,r=e.event,t=e.hoveredHeader;if(r.preventDefault(),i.current){var s=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=r.screenX,f=r.screenY,h=Math.sqrt(Math.pow(u-b.screenX,2)+Math.pow(f-b.screenY,2));l.current=t;var v=o([],i.current,!0),g=v.findIndex((function(e){var n;return e.accessor===(null===(n=a.current)||void 0===n?void 0:n.accessor)})),w=v.findIndex((function(e){return e.accessor===t.accessor})),m=v.splice(g,1)[0];if(v.splice(w,0,m),!(s||t.accessor===(null===(n=a.current)||void 0===n?void 0:n.accessor)||null===a.current||h<10||void 0===g||void 0===w||JSON.stringify(v)===JSON.stringify(i.current))){var p=Date.now();JSON.stringify(v)===JSON.stringify(c)&&p-C<800&&h<50||(C=p,b={screenX:u,screenY:f},d(v))}}},handleDragEnd:function(){a.current=null,l.current=null,null==s||s(i.current)}}},M=n.forwardRef((function(t,o){var a,i,l=t.borderClass,s=t.colIndex,c=t.draggedHeaderRef,f=t.header,h=t.headersRef,g=t.hoveredHeaderRef,w=t.isSelected,m=t.isInitialFocusedCell,p=t.onCellEdit,R=t.onExpandRowClick,C=t.onMouseDown,b=t.onMouseOver,M=t.onTableHeaderDragEnd,H=t.rowIndex,j=t.visibleRow,S=j.depth,E=j.row,D=n.useState(E.rowData[f.accessor]),k=D[0],N=D[1],L=n.useState(!1),T=L[0],O=L[1],B=y({draggedHeaderRef:c,headersRef:h,hoveredHeaderRef:g,onTableHeaderDragEnd:M}).handleDragOver,W=I(),A="cell-".concat(H,"-").concat(s),P=Boolean(null===(i=null===(a=E.rowMeta)||void 0===a?void 0:a.children)||void 0===i?void 0:i.length),F=Boolean(null==f?void 0:f.isEditable),z=H%2==0,U="st-cell ".concat(S>0&&f.expandable?"st-cell-depth-".concat(S):""," ").concat(w?m?"st-cell-selected-first ".concat(l):"st-cell-selected ".concat(l):""," ").concat(z?"st-cell-odd-row":"st-cell-even-row"," ").concat(F?"clickable":"");n.useEffect((function(){N(E.rowData[f.accessor])}),[f.accessor,E]);return T?e.jsx("div",r({className:"st-cell-editing ".concat(z?"st-cell-odd-row":"st-cell-even-row"),id:v({accessor:f.accessor,rowIndex:H+1})},{children:e.jsx(x,{onChange:function(e){N(e),null==p||p({accessor:f.accessor,newValue:e,row:E})},setIsEditing:O,value:k})})):e.jsxs("div",r({className:U,id:A,onDoubleClick:function(){return f.isEditable&&O(!0)},onMouseDown:function(){return C({rowIndex:H,colIndex:s,rowId:E.rowMeta.rowId})},onMouseOver:function(){return b({rowIndex:H,colIndex:s,rowId:E.rowMeta.rowId})},onDragOver:function(e){return W({callback:B,callbackProps:{event:e,hoveredHeader:f},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!f.isEditable||T||(e.preventDefault(),O(!0))},ref:o,"data-row-index":H,"data-col-index":s,"aria-selected":w},{children:[f.expandable&&P?E.rowMeta.isExpanded?e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return R(E.rowMeta.rowId)}},{children:e.jsx(u,{className:"st-sort-icon"})})):e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return R(E.rowMeta.rowId)}},{children:e.jsx(d,{className:"st-sort-icon"})})):null,e.jsx("span",r({className:"st-cell-content ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"")},{children:f.cellRenderer?f.cellRenderer({accessor:f.accessor,colIndex:s,row:E}):k}))]}))})),H=function(n){var o=n.allowAnimations,a=n.children,i=t(n,["allowAnimations","children"]);return o?e.jsx(j,r({},i,{children:a})):e.jsx(e.Fragment,{children:a})},j=function(r){var t=r.allowHorizontalAnimate,o=void 0===t||t,a=r.children,i=r.draggedHeaderRef,l=r.headersRef,s=r.isBody,d=r.mainBodyRef,c=r.pauseAnimation,u=r.rowIndex,f=n.useRef(!1),h=n.useState({}),g=h[0],w=h[1],m=n.useRef({}),p=l.current;return n.useLayoutEffect((function(){if(p){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var a=document.getElementById(v({accessor:e.accessor,rowIndex:t}));if(a){var i=a.getAnimations().some((function(e){return"running"===e.playState})),l=a.getBoundingClientRect();i&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:p,draggedHeaderRef:i,rowIndex:u});JSON.stringify(e)!==JSON.stringify(g)&&(m.current=g,w(e))}}),[g,p,i,s,u]),n.useLayoutEffect((function(){var e=d.current,n=function(){f.current=!0},r=function(){f.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[i,d]),n.useEffect((function(){c||f.current||Object.keys(m.current).length&&p&&p.forEach((function(e){var n=document.getElementById(v({accessor:e.accessor,rowIndex:u}));if(n){var r=m.current[e.accessor],t=g[e.accessor];if(r&&t){var a=r.left-t.left,i=o?0:r.top-t.top,l=Math.abs(a),s=Math.abs(i);(l>10||s>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(a,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[o,g,p,s,c,m,u]),e.jsx(e.Fragment,{children:a})},S=function(o){var a=o.getBorderClass,i=o.handleMouseDown,l=o.handleMouseOver,s=o.headers,d=o.hiddenColumns,c=o.isSelected,u=o.isInitialFocusedCell,f=o.onExpandRowClick,h=o.pinned,w=o.rowIndex,m=o.visibleRow,p=t(o,["getBorderClass","handleMouseDown","handleMouseOver","headers","hiddenColumns","isSelected","isInitialFocusedCell","onExpandRowClick","pinned","rowIndex","visibleRow"]);return e.jsx(H,r({allowAnimations:p.allowAnimations,allowHorizontalAnimate:p.shouldPaginate,draggedHeaderRef:p.draggedHeaderRef,headersRef:p.headersRef,isBody:!0,mainBodyRef:p.mainBodyRef,pauseAnimation:p.isWidthDragging,rowIndex:w+1},{children:s.map((function(e,t){return g({hiddenColumns:d,header:e,pinned:h})?n.createElement(M,r({},p,{borderClass:a({rowIndex:w,colIndex:t,rowId:m.row.rowMeta.rowId}),colIndex:t,header:e,isSelected:c({rowIndex:w,colIndex:t,rowId:m.row.rowMeta.rowId}),isInitialFocusedCell:u({rowIndex:w,colIndex:t,rowId:m.row.rowMeta.rowId}),key:v({accessor:e.accessor,rowIndex:w+1}),onExpandRowClick:f,onMouseDown:function(){return i({rowIndex:w,colIndex:t,rowId:m.row.rowMeta.rowId})},onMouseOver:function(){return l({rowIndex:w,colIndex:t,rowId:m.row.rowMeta.rowId})},rowIndex:w,visibleRow:m})):null}))}))},E=function(n){var t=n.getNextRowIndex,o=n.gridTemplateColumns,a=n.index,i=n.pinned,l=n.props,s=n.rowHeight,d=n.visibleRow,c=d.position,u=t();return e.jsx("div",r({className:"st-table-row",style:{gridTemplateColumns:o,top:h({position:c,rowHeight:s}),height:"".concat(s,"px")}},{children:e.jsx(S,r({pinned:i,rowIndex:u,visibleRow:d},l),a)}))},D=function(n){var t=n.lastGroupRow,o=n.position,a=n.rowHeight,i=n.templateColumns;return e.jsx("div",r({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:f({position:o,rowHeight:a}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},k=function(o){o.headerContainerRef;var a=o.onExpandRowClick,i=o.pinned,l=o.rowHeight,s=o.sectionRef,d=o.templateColumns,c=o.totalHeight,u=o.visibleRows,f=o.width,h=t(o,["headerContainerRef","onExpandRowClick","pinned","rowHeight","sectionRef","templateColumns","totalHeight","visibleRows","width"]),v=i?"st-table-body-pinned-".concat(i):"st-table-body-main",g=n.useRef(0);n.useEffect((function(){g.current=0}));var w=function(){return g.current++};return e.jsx("div",r({className:v,ref:s,style:{position:"relative",height:"".concat(c,"px"),width:f}},{children:u.map((function(t,o){var s,c,f=Boolean(null===(c=null===(s=t.row.rowMeta)||void 0===s?void 0:s.children)||void 0===c?void 0:c.length);return e.jsxs(n.Fragment,{children:[e.jsx(E,{getNextRowIndex:w,gridTemplateColumns:d,index:o,pinned:i,props:r(r({},h),{onExpandRowClick:a,rowHeight:l,visibleRows:u}),rowHeight:l,visibleRow:t}),0!==o&&e.jsx(D,{lastGroupRow:f,position:t.position,rowHeight:l,templateColumns:d})]},o)}))}))},N=function(t){var o,a,i,l,s,d=t.centerHeaderRef,c=t.flattenedRows,u=t.headerContainerRef,f=t.mainBodyRef,h=t.mainTemplateColumns,v=t.pinnedLeftColumns,g=t.pinnedLeftHeaderRef,w=t.pinnedLeftRef,m=t.pinnedLeftTemplateColumns,p=t.pinnedRightColumns,x=t.pinnedRightHeaderRef,R=t.pinnedRightRef,I=t.pinnedRightTemplateColumns,C=t.rowHeight,b=t.scrollbarWidth,y=t.setFlattenedRows,M=t.setScrollTop,H=t.tableBodyContainerRef,j=t.visibleRows;!function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,a=n.useState(!1),i=a[0],l=a[1];n.useEffect((function(){var e=null==r?void 0:r.current;if(i&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[r,i,o]),n.useEffect((function(){var e=null==r?void 0:r.current,n=null==t?void 0:t.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;l(e)}};o();var a=new ResizeObserver((function(){o()}));return a.observe(n),function(){n&&a.unobserve(n)}}}),[r,t])}({headerContainerRef:u,mainSectionRef:H,scrollbarWidth:b});var S,E,D=n.useRef(null),N=(S=0,(E=function(e){e.forEach((function(e){S+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&E(e.rowMeta.children)}))})(c),S)*(C+1)-1,L=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};y((function(e){return e.map(n)}))},T=(null===(o=g.current)||void 0===o?void 0:o.clientWidth)?(null===(a=g.current)||void 0===a?void 0:a.clientWidth)+1:0,O=null===(i=d.current)||void 0===i?void 0:i.clientWidth,B=(null===(l=x.current)||void 0===l?void 0:l.clientWidth)?(null===(s=x.current)||void 0===s?void 0:s.clientWidth)+1:0;return e.jsxs("div",r({className:"st-table-body-container",ref:H,onScroll:function(e){var n=e.currentTarget.scrollTop;D.current&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame((function(){M(n)}))}},{children:[v.length>0&&e.jsx(k,r({},t,{onExpandRowClick:L,pinned:"left",rowHeight:C,sectionRef:w,templateColumns:m,totalHeight:N,visibleRows:j,width:T})),e.jsx(k,r({},t,{onExpandRowClick:L,rowHeight:C,sectionRef:f,templateColumns:h,totalHeight:N,visibleRows:j,width:O})),p.length>0&&e.jsx(k,r({},t,{onExpandRowClick:L,pinned:"right",rowHeight:C,sectionRef:R,templateColumns:I,totalHeight:N,visibleRows:j,width:B}))]}))},L={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var a=t.getTime()-o.getTime();return"ascending"===r?a:-a},enum:function(e,n,r){return L.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?L.string(e,n,r):"number"==typeof e&&"number"==typeof n?L.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?L.boolean(e,n,r):L.string(String(e),String(n),r)}},T=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),a=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===a?o*=1e12:"B"===a?o*=1e9:"M"===a?o*=1e6:"K"===a&&(o*=1e3),o}}return parseFloat(r)||0},a=o(e),i=o(n);return L.number(a,i,t)}return"date"===r?L.date(String(e),String(n),t):"boolean"===r?L.boolean(Boolean(e),Boolean(n),t):"enum"===r?L.enum(String(e),String(n),t):L.string(String(e),String(n),t)},O=function(e,n,t){var a=t.find((function(e){return e.accessor===n.key.accessor})),i=(null==a?void 0:a.type)||"string",l=n.direction,s=new Map,d=new Map,c="";e.forEach((function(e){var r;if(e.rowData&&!e.rowData[n.key.accessor]&&void 0!==e.rowMeta.isExpanded){var t=(e.rowData.sector||"group_".concat(s.size)).toString();c=t,d.set(c,e),s.has(c)||s.set(c,[])}else if(c){var o=s.get(c)||[];o.push(e),s.set(c,o)}else{var a="default";s.has(a)||s.set(a,[]),null===(r=s.get(a))||void 0===r||r.push(e)}}));var u=[];return s.forEach((function(e,a){if(d.has(a)){var s=d.get(a);s.rowMeta.children&&s.rowMeta.children.length>0&&(s.rowMeta.children=B(s.rowMeta.children,n,t)),u.push(s)}var c=o([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],a=r.rowData[t];return T(o,a,i,l)}));u.push.apply(u,c.map((function(e){var o=r({},e);if(o.rowMeta.children&&o.rowMeta.children.length>0){var a=B(o.rowMeta.children,n,t);o.rowMeta=r(r({},o.rowMeta),{children:a})}return o})))})),u},B=function(e,n,t){var a=t.find((function(e){return e.accessor===n.key.accessor})),i=(null==a?void 0:a.type)||"string",l=n.direction;return o([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],a=r.rowData[t];return T(o,a,i,l)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?r(r({},e),{rowMeta:r(r({},e.rowMeta),{children:B(e.rowMeta.children,n,t)})}):e}))},W=function(e){var n=e.event,r=e.forceUpdate,t=e.header,o=e.headersRef,a=e.index;e.reverse;var i=e.setIsWidthDragging,l=e.startWidth;i(!0),n.preventDefault();var s=n.clientX;if(t){var d=function(e){var n=Math.max(l+(e.clientX-s),40);t&&o.current&&(o.current[a].width=n,r())},c=function(){document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),i(!1)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",c)}},A=n.forwardRef((function(t,o){var a,l=t.columnResizing,s=t.currentRows,d=t.columnReordering,c=t.draggedHeaderRef,u=t.forceUpdate,f=t.headersRef,h=t.hoveredHeaderRef,g=t.index,w=t.onColumnOrderChange,m=t.onSort,p=t.onTableHeaderDragEnd,x=t.reverse,R=t.rowHeight,C=t.selectableColumns,b=t.setIsWidthDragging,M=t.setSelectedCells,H=t.sort,j=t.sortDownIcon,S=t.sortUpIcon,E=n.useState(!1),D=E[0],k=E[1],N=null===(a=f.current)||void 0===a?void 0:a[g],L=Boolean(null==N?void 0:N.isSortable),T="st-header-cell ".concat(N===h.current?"st-hovered":""," ").concat(D?"st-dragging":""," ").concat(L?"clickable":""," ").concat(d&&!L?"columnReordering":""," ").concat("right"===(null==N?void 0:N.align)?"right-aligned":"center"===(null==N?void 0:N.align)?"center-aligned":""),O=y({draggedHeaderRef:c,headersRef:f,hoveredHeaderRef:h,onColumnOrderChange:w,onTableHeaderDragEnd:p}),B=O.handleDragStart,A=O.handleDragEnd,P=O.handleDragOver,F=I(),z=function(e){var n=e.event,r=e.header;if(C){var t=s.length,o=Array.from({length:t},(function(e,n){return i({rowIndex:n,colIndex:g,rowId:s[n].rowMeta.rowId})})),a=function(e,n){var r=new Set,o=Math.min(e,n),a=Math.max(e,n);return Array.from({length:t}).forEach((function(e,n){Array.from({length:a-o+1}).forEach((function(e,t){r.add(i({rowIndex:n,colIndex:o+t,rowId:s[n].rowMeta.rowId}))}))})),r};n.shiftKey?M((function(e){var n,r=Number(null===(n=Array.from(e)[0])||void 0===n?void 0:n.split("-")[1]),t=Number(o[0].split("-")[1]);return r===t?new Set(o):r>t?a(t,r):a(r,t)})):M(new Set(o))}else r.isSortable&&m(g,r.accessor)};if(n.useEffect((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!N)return null;var U=l&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;F({callback:W,callbackProps:{event:e,forceUpdate:u,header:N,headersRef:f,index:g,setIsWidthDragging:b,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),q=H&&H.key.accessor===N.accessor&&e.jsxs("div",r({className:"st-sort-icon-container",onClick:function(e){return z({event:e,header:N})}},{children:["ascending"===H.direction&&S&&S,"descending"===H.direction&&j&&j]}));return e.jsxs("div",r({className:T,id:v({accessor:N.accessor,rowIndex:0}),onDragOver:function(e){F({callback:P,callbackProps:{event:e,hoveredHeader:N},limit:50})},ref:o,style:{width:N.width,height:R}},{children:[x&&U,e.jsxs("div",r({className:"st-header-label ".concat("right"===N.align?"right-aligned":"center"===N.align?"center-aligned":""),draggable:d,onClick:function(e){return z({event:e,header:N})},onDragEnd:function(e){e.preventDefault(),k(!1),A()},onDragStart:function(e){d&&N&&function(e){k(!0),B(e)}(N)}},{children:["right"===N.align&&q,null==N?void 0:N.label,"right"!==N.align&&q]})),!x&&U]}))})),P=function(e,r){n.useEffect((function(){if(e.current){var n=e.current,t=function(){var e,t=null==n?void 0:n.scrollLeft;void 0!==t&&(null===(e=r.current)||void 0===e||e.scrollTo(t,0))};return n.addEventListener("scroll",t),function(){null==n||n.removeEventListener("scroll",t)}}}),[e,r])},F=function(t){var o,a,i,l=t.allowAnimations,s=t.centerHeaderRef,d=t.columnResizing,c=t.currentRows,u=t.columnReordering,f=t.draggedHeaderRef,h=t.forceUpdate,v=t.headerContainerRef,w=t.headersRef,m=t.hiddenColumns,p=t.hoveredHeaderRef,x=t.isWidthDragging,R=t.mainBodyRef,I=t.mainTemplateColumns,C=t.onColumnOrderChange,b=t.onSort,y=t.onTableHeaderDragEnd,M=t.pinnedLeftColumns,j=t.pinnedLeftHeaderRef,S=t.pinnedLeftTemplateColumns,E=t.pinnedRightColumns,D=t.pinnedRightHeaderRef,k=t.pinnedRightTemplateColumns,N=t.rowHeight,L=t.selectableColumns,T=t.setIsWidthDragging,O=t.setSelectedCells,B=t.sort,W=t.sortDownIcon,F=t.sortUpIcon;P(R,s);return e.jsxs("div",r({className:"st-header-container",ref:v},{children:[M.length>0&&e.jsx("div",r({className:"st-header-pinned-left",ref:j,style:{gridTemplateColumns:S}},{children:e.jsx(H,r({allowAnimations:l,draggedHeaderRef:f,headersRef:w,mainBodyRef:R,pauseAnimation:x,rowIndex:0},{children:null===(o=w.current)||void 0===o?void 0:o.map((function(r,t){return g({hiddenColumns:m,header:r,pinned:"left"})?e.jsx(A,{columnResizing:d,currentRows:c,columnReordering:u,draggedHeaderRef:f,forceUpdate:h,headersRef:w,hoveredHeaderRef:p,index:t,onColumnOrderChange:C,onSort:b,onTableHeaderDragEnd:y,ref:n.createRef(),rowHeight:N,selectableColumns:L,setIsWidthDragging:T,setSelectedCells:O,sort:B,sortDownIcon:W,sortUpIcon:F},r.accessor):null}))}))})),e.jsx("div",r({className:"st-header-main",onScroll:function(e){var n,r,t=null===(n=s.current)||void 0===n?void 0:n.scrollLeft;void 0!==t&&(null===(r=R.current)||void 0===r||r.scrollTo(t,0))},ref:s,style:{gridTemplateColumns:I}},{children:e.jsx(H,r({allowAnimations:l,draggedHeaderRef:f,headersRef:w,mainBodyRef:R,pauseAnimation:x,rowIndex:0},{children:null===(a=w.current)||void 0===a?void 0:a.map((function(r,t){return g({hiddenColumns:m,header:r})?e.jsx(A,{columnResizing:d,currentRows:c,columnReordering:u,draggedHeaderRef:f,forceUpdate:h,headersRef:w,hoveredHeaderRef:p,index:t,onColumnOrderChange:C,onSort:b,onTableHeaderDragEnd:y,ref:n.createRef(),rowHeight:N,selectableColumns:L,setIsWidthDragging:T,setSelectedCells:O,sort:B,sortDownIcon:W,sortUpIcon:F},r.accessor):null}))}))})),E.length>0&&e.jsx("div",r({className:"st-header-pinned-right",ref:D,style:{gridTemplateColumns:k}},{children:e.jsx(H,r({allowAnimations:l,draggedHeaderRef:f,headersRef:w,mainBodyRef:R,pauseAnimation:x,rowIndex:0},{children:null===(i=w.current)||void 0===i?void 0:i.map((function(r,t){return g({hiddenColumns:m,header:r,pinned:"right"})?e.jsx(A,{columnResizing:d,currentRows:c,columnReordering:u,draggedHeaderRef:f,forceUpdate:h,headersRef:w,hoveredHeaderRef:p,index:t,onColumnOrderChange:C,onSort:b,onTableHeaderDragEnd:y,reverse:!0,ref:n.createRef(),rowHeight:N,selectableColumns:L,setIsWidthDragging:T,setSelectedCells:O,sort:B,sortDownIcon:W,sortUpIcon:F},r.accessor):null}))}))}))]}))},z=function(e){var n=e.headers,r=e.hiddenColumns;return"".concat(n.filter((function(e){return!0!==r[e.accessor]})).map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"minmax(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},U=function(t){var o=t.allowAnimations,a=t.columnReordering,i=t.columnResizing,l=t.currentRows,s=t.draggedHeaderRef,d=t.editColumns,c=t.flattenedRows,u=t.forceUpdate,f=t.getBorderClass,h=t.handleMouseDown,v=t.handleMouseOver,g=t.headersRef,w=t.hiddenColumns,m=t.hoveredHeaderRef,p=t.isSelected,x=t.isInitialFocusedCell,R=t.isWidthDragging,I=t.mainBodyRef,C=t.onCellEdit,b=t.onColumnOrderChange,y=t.onSort,M=t.onTableHeaderDragEnd,H=t.pinnedLeftRef,j=t.pinnedRightRef,S=t.rowHeight,E=t.scrollbarWidth,D=t.selectableColumns,k=t.setIsWidthDragging,L=t.setFlattenedRows,T=t.setScrollTop,O=t.setSelectedCells,B=t.shouldPaginate,W=t.sort,A=t.sortDownIcon,P=t.sortUpIcon,U=t.tableBodyContainerRef,q=t.visibleRows,K=n.useRef(null),V=n.useRef(null),J=n.useRef(null),X=n.useRef(null),Y=g.current.filter((function(e){return!e.pinned})),G=g.current.filter((function(e){return"left"===e.pinned})),_=g.current.filter((function(e){return"right"===e.pinned})),$=n.useMemo((function(){return z({headers:G,hiddenColumns:w})}),[G,w]),Q=n.useMemo((function(){return z({headers:Y,hiddenColumns:w})}),[Y,w]),Z=n.useMemo((function(){return z({headers:_,hiddenColumns:w})}),[_,w]),ee={allowAnimations:o,centerHeaderRef:J,columnResizing:i,currentRows:l,columnReordering:a,draggedHeaderRef:s,forceUpdate:u,headerContainerRef:K,headersRef:g,hiddenColumns:w,hoveredHeaderRef:m,isWidthDragging:R,mainBodyRef:I,mainTemplateColumns:Q,onColumnOrderChange:b,onSort:y,onTableHeaderDragEnd:M,pinnedLeftColumns:G,pinnedLeftHeaderRef:V,pinnedLeftTemplateColumns:$,pinnedRightColumns:_,pinnedRightHeaderRef:X,pinnedRightTemplateColumns:Z,rowHeight:S,selectableColumns:D,setIsWidthDragging:k,setSelectedCells:O,sort:W,sortDownIcon:A,sortUpIcon:P,tableBodyContainerRef:U},ne={allowAnimations:o,centerHeaderRef:J,draggedHeaderRef:s,flattenedRows:c,getBorderClass:f,handleMouseDown:h,handleMouseOver:v,headerContainerRef:K,headers:g.current,headersRef:g,hiddenColumns:w,hoveredHeaderRef:m,isSelected:p,isInitialFocusedCell:x,isWidthDragging:R,mainBodyRef:I,mainTemplateColumns:Q,onCellEdit:C,onTableHeaderDragEnd:M,pinnedLeftColumns:G,pinnedLeftHeaderRef:V,pinnedLeftRef:H,pinnedLeftTemplateColumns:$,pinnedRightColumns:_,pinnedRightHeaderRef:X,pinnedRightRef:j,pinnedRightTemplateColumns:Z,rowHeight:S,scrollbarWidth:E,setFlattenedRows:L,shouldPaginate:B,setScrollTop:T,tableBodyContainerRef:U,visibleRows:q};return e.jsxs("div",r({className:"st-table-content",style:{width:d?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(F,r({},ee)),e.jsx(N,r({},ne))]}))},q=function(e){var r=e.callback,t=e.ref,o=e.widthAttribute;n.useEffect((function(){var e=t.current;if(e){var n=function(){r(e[o]||0)};n();var a=new ResizeObserver((function(){n()}));return a.observe(e),function(){return a.disconnect()}}}),[r,t,o])},K=function(t){var o=t.mainBodyRef,a=t.pinnedLeftRef,i=t.pinnedRightRef,l=t.tableContentWidth,s=n.useState(0),d=s[0],c=s[1],u=n.useState(0),f=u[0],h=u[1],v=n.useState(0),g=v[0],w=v[1],m=n.useRef(null);return q({widthAttribute:"offsetWidth",callback:c,ref:a}),q({widthAttribute:"scrollWidth",callback:w,ref:o}),q({widthAttribute:"offsetWidth",callback:h,ref:i}),P(o,m),!o.current||o.current.scrollWidth<=o.current.clientWidth?null:e.jsxs("div",r({className:"st-horizontal-scrollbar-container",style:{width:l}},{children:[d>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:d}}),g>0&&e.jsx("div",r({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&o.current&&o.current.scrollTo({left:n,behavior:"auto"})},ref:m},{children:e.jsx("div",{style:{width:g}})})),f>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:f}})]}))},V=function(e){var r=e.headers,t=e.tableRows,o=n.useState(null),a=o[0],i=o[1],l=n.useMemo((function(){var e={};return r.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[r]),s=n.useState(l),d=s[0],c=s[1],u=n.useMemo((function(){if(!a)return t;var e=function(e,n,r){return{sortedData:O(n,r,e),newSortConfig:r}}(r,t,a).sortedData;return e}),[t,a,r]);return{sort:a,setSort:i,updateSort:function(e,n){var t=r.find((function(e){return e.accessor===n}));t&&i((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:t,direction:"descending"}:null:{key:t,direction:"ascending"}}))},sortedRows:u,hiddenColumns:d,setHiddenColumns:c}},J=function(t){var o=t.checked,a=void 0!==o&&o,i=t.children,l=t.onChange,s=n.useState(a),d=s[0],c=s[1];return e.jsxs("label",r({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:d,className:"st-checkbox-input",onChange:function(){var e=!d;c(e),l&&l(e)},type:"checkbox"}),e.jsx("span",r({className:"st-checkbox-custom ".concat(d?"st-checked":"")},{children:d&&e.jsx("span",{className:"st-checkbox-checkmark"})})),i]}))},X=function(n){var t=n.headers,o=n.open,a=n.position;n.setOpen;var i=n.setHiddenColumns,l=n.hiddenColumns,s="left"===a?"left":"";return e.jsx("div",r({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(s),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",r({className:"st-column-editor-popout-content"},{children:t.map((function(n,t){return e.jsx(J,r({checked:l[n.accessor],onChange:function(e){var t;return i(r(r({},l),((t={})[n.accessor]=e,t)))}},{children:n.label}),t)}))}))}))},Y=function(t){var o=t.columnEditorText,a=t.editColumns,i=t.editColumnsInitOpen,l=t.headers,s=t.position,d=void 0===s?"right":s,c=t.setHiddenColumns,u=t.hiddenColumns,f=n.useState(i),h=f[0],v=f[1];return a?e.jsxs("div",r({className:"st-column-editor ".concat(h?"open":""," ").concat(d),onClick:function(){return function(e){v(e)}(!h)}},{children:[e.jsx("div",r({className:"st-column-editor-text"},{children:o})),e.jsx(X,{headers:l,open:h,position:d,setOpen:v,setHiddenColumns:c,hiddenColumns:u})]})):null};!function(e){e.Left="left",e.Right="right"}(a||(a={}));var G=n.memo((function(t){var o=t.allowAnimations,f=void 0!==o&&o,h=t.columnEditorPosition,v=void 0===h?a.Right:h,g=t.columnEditorText,w=void 0===g?"Columns":g,m=t.columnResizing,p=void 0!==m&&m,x=t.defaultHeaders,R=t.editColumns,I=void 0!==R&&R,C=t.editColumnsInitOpen,b=void 0!==C&&C,y=t.columnReordering,M=void 0!==y&&y,H=t.height,j=t.hideFooter,S=void 0!==j&&j,E=t.nextIcon,D=void 0===E?e.jsx(d,{className:"st-next-prev-icon"}):E,k=t.onCellEdit,N=t.onColumnOrderChange,L=t.onNextPage,T=t.onPreviousPage,O=t.prevIcon,B=void 0===O?e.jsx(s,{className:"st-next-prev-icon"}):O,W=t.rowHeight,A=void 0===W?40:W,P=t.rows,F=t.rowsPerPage,z=void 0===F?10:F,q=t.selectableCells,J=void 0!==q&&q,X=t.selectableColumns,G=void 0!==X&&X,_=t.shouldPaginate,$=void 0!==_&&_,Q=t.sortDownIcon,Z=void 0===Q?e.jsx(u,{className:"st-sort-icon"}):Q,ee=t.sortUpIcon,ne=void 0===ee?e.jsx(c,{className:"st-sort-icon"}):ee,re=t.theme,te=void 0===re?"light":re,oe=t.totalPages,ae=n.useRef(null),ie=n.useRef(x),le=n.useRef(null),se=n.useRef(null),de=n.useRef(null),ce=n.useRef(null),ue=n.useRef(null),fe=n.useState(!1),he=fe[0],ve=fe[1],ge=n.useState(1),we=ge[0],me=ge[1],pe=n.useState(0),xe=pe[0],Re=pe[1],Ie=n.useState(0),Ce=Ie[0],be=Ie[1],ye=n.useState(0),Me=ye[0],He=ye[1],je=V({headers:ie.current,tableRows:P}),Se=je.sort,Ee=je.sortedRows,De=je.hiddenColumns,ke=je.setHiddenColumns,Ne=je.updateSort,Le=n.useMemo((function(){if(!$)return Ee;var e=(we-1)*z,n=e+z;return Ee.slice(e,n)}),[we,z,$,Ee]),Te=n.useState(Le),Oe=Te[0],Be=Te[1];n.useEffect((function(){Be(Le)}),[Le]);var We=n.useMemo((function(){var e;if(!H)return window.innerHeight-A;var n=document.querySelector(".simple-table-root"),r=0;if(H.endsWith("px"))r=parseInt(H,10);else if(H.endsWith("vh")){var t=parseInt(H,10);r=window.innerHeight*t/100}else if(H.endsWith("%")){var o=parseInt(H,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-A)}),[H,A]),Ae=n.useMemo((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,a=e.scrollTop,i=[],l=0,s=Math.max(0,a-o*n),d=a+r+o*n,c=function(e,n){for(var r,t=0,a=e;t<a.length;t++){var u=a[t],f=l*o;if(f>=d)break;f+o>s&&i.push({row:u,depth:n,position:l,isLastGroupRow:Boolean(null===(r=u.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),l+=1,u.rowMeta.isExpanded&&u.rowMeta.children&&c(u.rowMeta.children,n+1)}};return c(t,0),i}({bufferRowCount:5,contentHeight:We,flattenedRows:Oe,rowHeight:A,scrollTop:Me})}),[We,A,Oe,Me]),Pe=n.useReducer((function(e){return e+1}),0)[1],Fe=function(e){var r=e.selectableCells,t=e.headers,o=e.visibleRows,a=n.useState(new Set),l=a[0],s=a[1],d=n.useState(null),c=d[0],u=d[1],f=n.useRef(!1),h=n.useRef(null),v=n.useCallback((function(){var e=Array.from(l).reduce((function(e,n){var r=n.split("-").map(Number),a=r[0],i=r[1];return e[a]||(e[a]=[]),e[a][i]=o[a].row.rowData[t[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");l.size>0&&navigator.clipboard.writeText(n)}),[t,l,o]),g=n.useCallback((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),a=Math.max(e.rowIndex,n.rowIndex),l=Math.min(e.colIndex,n.colIndex),d=Math.max(e.colIndex,n.colIndex),c=t;c<=a;c++)for(var u=l;u<=d;u++)if(c>=0&&c<o.length){var f=o[c].row.rowMeta.rowId;r.add(i({colIndex:u,rowIndex:c,rowId:f}))}s(r)}),[o]),w=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<t.length){var n=i(e);s(new Set([n])),u(e)}}),[t.length,o.length]);n.useEffect((function(){var e=function(e){if(r&&c){var n=c.rowIndex,a=c.colIndex,i=c.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(o[n].row.rowMeta.rowId!==i){var l=o.findIndex((function(e){return e.row.rowMeta.rowId===i}));if(-1===l)return;n=l}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var d={rowIndex:n-1,colIndex:a,rowId:o[n-1].row.rowMeta.rowId};w(d)}}else"ArrowDown"===e.key?(e.preventDefault(),n<o.length-1&&(d={rowIndex:n+1,colIndex:a,rowId:o[n+1].row.rowMeta.rowId},w(d))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),a>0&&(d={rowIndex:n,colIndex:a-1,rowId:o[n].row.rowMeta.rowId},w(d))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),a<t.length-1&&(d={rowIndex:n,colIndex:a+1,rowId:o[n].row.rowMeta.rowId},w(d))):"Escape"===e.key&&(s(new Set),h.current=null,u(null))}else v()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[v,t.length,c,g,w,r,o]);var m=n.useCallback((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=i({colIndex:n,rowIndex:r,rowId:t});return l.has(o)}),[l]),p=n.useCallback((function(e){var n,r,t,a,i,l,s=e.colIndex,d=e.rowIndex,c=e.rowId,u=[],f=null===(t=null===(r=null===(n=o[d-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,h={colIndex:s,rowIndex:d+1,rowId:null===(l=null===(i=null===(a=o[d+1])||void 0===a?void 0:a.row)||void 0===i?void 0:i.rowMeta)||void 0===l?void 0:l.rowId},v={colIndex:s-1,rowIndex:d,rowId:c},g={colIndex:s+1,rowIndex:d,rowId:c};return m({colIndex:s,rowIndex:d-1,rowId:f})||u.push("st-selected-top-border"),m(h)||u.push("st-selected-bottom-border"),m(v)||u.push("st-selected-left-border"),m(g)||u.push("st-selected-right-border"),u.join(" ")}),[m,o]),x=n.useMemo((function(){return c?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===c.rowIndex&&r===c.colIndex&&t===c.rowId}:function(){return!1}}),[c]);return{getBorderClass:p,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId;if(r){f.current=!0,h.current={rowIndex:t,colIndex:n,rowId:o};var a=i({colIndex:n,rowIndex:t,rowId:o});s(new Set([a])),u({rowIndex:t,colIndex:n,rowId:o})}},handleMouseOver:function(e){var n=e.colIndex,t=e.rowIndex;if(e.rowId,r&&f.current&&h.current){for(var a=new Set,l=Math.min(h.current.rowIndex,t),d=Math.max(h.current.rowIndex,t),c=Math.min(h.current.colIndex,n),u=Math.max(h.current.colIndex,n),v=l;v<=d;v++)for(var g=c;g<=u;g++)if(v>=0&&v<o.length){var w=o[v].row.rowMeta.rowId;a.add(i({colIndex:g,rowIndex:v,rowId:w}))}s(a)}},handleMouseUp:function(){f.current=!1},isInitialFocusedCell:x,isSelected:m,selectedCells:l,setSelectedCells:s}}({selectableCells:J,headers:ie.current,visibleRows:Ae}),ze=Fe.handleMouseDown,Ue=Fe.handleMouseOver,qe=Fe.handleMouseUp,Ke=Fe.isSelected,Ve=Fe.getBorderClass,Je=Fe.isInitialFocusedCell,Xe=Fe.setSelectedCells,Ye=n.useCallback((function(e,n){Ne(e,n)}),[Ne]),Ge=n.useCallback((function(e){ie.current=e,Pe()}),[]);return n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||G&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||Xe(new Set)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[G,Xe]),n.useLayoutEffect((function(){if(ue.current){var e=ue.current.offsetWidth-ue.current.clientWidth,n=ue.current.clientWidth;Re(e),be(n)}}),[]),n.useLayoutEffect((function(){var e=function(){if(Pe(),ue.current){var e=ue.current.offsetWidth-ue.current.clientWidth,n=ue.current.clientWidth;Re(e),be(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),e.jsxs("div",r({className:"simple-table-root st-wrapper theme-".concat(te),style:H?{height:H}:{}},{children:[e.jsxs("div",r({className:"st-table-wrapper-container"},{children:[e.jsxs("div",r({className:"st-table-wrapper",onMouseUp:qe,onMouseLeave:qe},{children:[e.jsx(U,{allowAnimations:f,columnReordering:M,columnResizing:p,currentRows:Le,draggedHeaderRef:ae,editColumns:I,flattenedRows:Oe,forceUpdate:Pe,getBorderClass:Ve,handleMouseDown:ze,handleMouseOver:Ue,headersRef:ie,hiddenColumns:De,hoveredHeaderRef:le,isInitialFocusedCell:Je,isSelected:Ke,isWidthDragging:he,mainBodyRef:se,onCellEdit:k,onColumnOrderChange:N,onSort:Ye,onTableHeaderDragEnd:Ge,pinnedLeftRef:de,pinnedRightRef:ce,rowHeight:A,scrollbarWidth:xe,selectableColumns:G,setIsWidthDragging:ve,setFlattenedRows:Be,setScrollTop:He,setSelectedCells:Xe,shouldPaginate:$,sort:Se,sortDownIcon:Z,sortUpIcon:ne,tableBodyContainerRef:ue,visibleRows:Ae}),e.jsx(Y,{columnEditorText:w,editColumns:I,editColumnsInitOpen:b,headers:ie.current,hiddenColumns:De,position:v,setHiddenColumns:ke})]})),e.jsx(K,{mainBodyRef:se,pinnedLeftRef:de,pinnedRightRef:ce,tableContentWidth:Ce})]})),e.jsx(l,{currentPage:we,hideFooter:S,nextIcon:D,onPageChange:me,onNextPage:L,onPreviousPage:T,prevIcon:B,shouldPaginate:$,totalPages:oe||Math.ceil(Ee.length/z)})]}))}));exports.SimpleTable=G;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=function(){return r=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},r.apply(this,arguments)};function t(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}function o(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;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 i,a=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},l=function(n){var t=n.currentPage,o=n.hideFooter,i=n.nextIcon,a=n.onPageChange,l=n.onNextPage,d=n.onPreviousPage,s=n.prevIcon,c=n.shouldPaginate,u=n.totalPages;if(o||!c)return null;var f=!(t>1)&&!d,h=!(t<u)&&!l;return e.jsxs("div",r({className:"st-footer"},{children:[e.jsx("button",r({className:"st-next-prev-btn ".concat(f?"disabled":""),onClick:function(){var e=t-1;e>=1&&a(e),d&&d(e-1)},disabled:f},{children:s})),e.jsx("button",r({className:"st-next-prev-btn ".concat(h?"disabled":""),onClick:function(){var e=t+1;(e<=u||l)&&a(e),l&&l(t)},disabled:h},{children:i})),Array.from({length:u},(function(n,o){return e.jsx("button",r({onClick:function(){var e;(e=o+1)>=1&&e<=u&&(a(e),e>t&&l?l(e-1):e<t&&d&&d(e-1))},className:"st-page-btn ".concat(t===o+1?"active":"")},{children:o+1}),o)}))]}))},d=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},s=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},c=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},u=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},f=function(e){return e.position*(e.rowHeight+1)-1},h=function(e){return e.position*(e.rowHeight+1)},v=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},g=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},w=function(n){var t=n.value,o=n.onBlur,i=n.onChange;return e.jsxs("select",r({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[e.jsx("option",r({value:"true"},{children:"True"})),e.jsx("option",r({value:"false"},{children:"False"}))]}))},m=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)}})},p=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},x=function(n){var r=n.onChange,t=n.setIsEditing,o=n.value,i=function(e){null==r||r(e)},a=function(){t(!1)};return e.jsx(e.Fragment,{children:"string"==typeof o||null==o?e.jsx(m,{defaultValue:o,onBlur:a,onChange:i}):"boolean"==typeof o?e.jsx(w,{onBlur:a,onChange:i,value:o}):"number"==typeof o?e.jsx(p,{defaultValue:o,onBlur:a,onChange:i}):null})},R=0,I=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===R||o-R>=t)&&(R=o,n(r))}},C=Date.now(),b={screenX:0,screenY:0},y=function(e){var r,t,i=e.draggedHeaderRef,a=e.headersRef,l=e.hoveredHeaderRef,d=e.onColumnOrderChange,s=e.onTableHeaderDragEnd,c=(r=a.current,t=n.useRef(r),n.useEffect((function(){t.current=r}),[r]),t.current);return{handleDragStart:function(e){i.current=e,C=Date.now()},handleDragOver:function(e){var n,r=e.event,t=e.hoveredHeader;if(r.preventDefault(),a.current){var d=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=r.screenX,f=r.screenY,h=Math.sqrt(Math.pow(u-b.screenX,2)+Math.pow(f-b.screenY,2));l.current=t;var v=o([],a.current,!0),g=v.findIndex((function(e){var n;return e.accessor===(null===(n=i.current)||void 0===n?void 0:n.accessor)})),w=v.findIndex((function(e){return e.accessor===t.accessor})),m=v.splice(g,1)[0];if(v.splice(w,0,m),!(d||t.accessor===(null===(n=i.current)||void 0===n?void 0:n.accessor)||null===i.current||h<10||void 0===g||void 0===w||JSON.stringify(v)===JSON.stringify(a.current))){var p=Date.now();JSON.stringify(v)===JSON.stringify(c)&&p-C<800&&h<50||(C=p,b={screenX:u,screenY:f},s(v))}}},handleDragEnd:function(){i.current=null,l.current=null,null==d||d(a.current)}}},M=n.forwardRef((function(t,o){var i,a,l=t.borderClass,d=t.colIndex,c=t.draggedHeaderRef,f=t.header,h=t.headersRef,g=t.hoveredHeaderRef,w=t.isSelected,m=t.isInitialFocusedCell,p=t.onCellEdit,R=t.onExpandRowClick,C=t.onMouseDown,b=t.onMouseOver,M=t.onTableHeaderDragEnd,H=t.rowIndex,S=t.visibleRow,E=S.depth,D=S.row,j=n.useState(D.rowData[f.accessor]),k=j[0],N=j[1],T=n.useState(!1),L=T[0],O=T[1],B=y({draggedHeaderRef:c,headersRef:h,hoveredHeaderRef:g,onTableHeaderDragEnd:M}).handleDragOver,W=I(),A="cell-".concat(H,"-").concat(d),F=Boolean(null===(a=null===(i=D.rowMeta)||void 0===i?void 0:i.children)||void 0===a?void 0:a.length),P=Boolean(null==f?void 0:f.isEditable),z=H%2==0,U="st-cell ".concat(E>0&&f.expandable?"st-cell-depth-".concat(E):""," ").concat(w?m?"st-cell-selected-first ".concat(l):"st-cell-selected ".concat(l):""," ").concat(z?"st-cell-odd-row":"st-cell-even-row"," ").concat(P?"clickable":"");n.useEffect((function(){N(D.rowData[f.accessor])}),[f.accessor,D]);return L?e.jsx("div",r({className:"st-cell-editing ".concat(z?"st-cell-odd-row":"st-cell-even-row"),id:v({accessor:f.accessor,rowIndex:H+1})},{children:e.jsx(x,{onChange:function(e){N(e),null==p||p({accessor:f.accessor,newValue:e,row:D})},setIsEditing:O,value:k})})):e.jsxs("div",r({className:U,id:A,onDoubleClick:function(){return f.isEditable&&O(!0)},onMouseDown:function(){return C({rowIndex:H,colIndex:d,rowId:D.rowMeta.rowId})},onMouseOver:function(){return b({rowIndex:H,colIndex:d,rowId:D.rowMeta.rowId})},onDragOver:function(e){return W({callback:B,callbackProps:{event:e,hoveredHeader:f},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!f.isEditable||L||(e.preventDefault(),O(!0))},ref:o,"data-row-index":H,"data-col-index":d,"aria-selected":w},{children:[f.expandable&&F?D.rowMeta.isExpanded?e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return R(D.rowMeta.rowId)}},{children:e.jsx(u,{className:"st-sort-icon"})})):e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return R(D.rowMeta.rowId)}},{children:e.jsx(s,{className:"st-sort-icon"})})):null,e.jsx("span",r({className:"st-cell-content ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"")},{children:f.cellRenderer?f.cellRenderer({accessor:f.accessor,colIndex:d,row:D}):k}))]}))})),H=function(n){var o=n.allowAnimations,i=n.children,a=t(n,["allowAnimations","children"]);return o?e.jsx(S,r({},a,{children:i})):e.jsx(e.Fragment,{children:i})},S=function(r){var t=r.allowHorizontalAnimate,o=void 0===t||t,i=r.children,a=r.draggedHeaderRef,l=r.headersRef,d=r.isBody,s=r.mainBodyRef,c=r.pauseAnimation,u=r.rowIndex,f=n.useRef(!1),h=n.useState({}),g=h[0],w=h[1],m=n.useRef({}),p=l.current;return n.useLayoutEffect((function(){if(p){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(v({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:p,draggedHeaderRef:a,rowIndex:u});JSON.stringify(e)!==JSON.stringify(g)&&(m.current=g,w(e))}}),[g,p,a,d,u]),n.useLayoutEffect((function(){var e=s.current,n=function(){f.current=!0},r=function(){f.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[a,s]),n.useEffect((function(){c||f.current||Object.keys(m.current).length&&p&&p.forEach((function(e){var n=document.getElementById(v({accessor:e.accessor,rowIndex:u}));if(n){var r=m.current[e.accessor],t=g[e.accessor];if(r&&t){var i=r.left-t.left,a=o?0:r.top-t.top,l=Math.abs(i),d=Math.abs(a);(l>10||d>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(i,"px, ").concat(a,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[o,g,p,d,c,m,u]),e.jsx(e.Fragment,{children:i})},E=function(n){var o=n.getBorderClass,i=n.handleMouseDown,a=n.handleMouseOver,l=n.headers,d=n.hiddenColumns,s=n.isSelected,c=n.isInitialFocusedCell,u=n.onExpandRowClick,f=n.pinned,h=n.rowIndex,w=n.visibleRow,m=t(n,["getBorderClass","handleMouseDown","handleMouseOver","headers","hiddenColumns","isSelected","isInitialFocusedCell","onExpandRowClick","pinned","rowIndex","visibleRow"]);return e.jsx(H,r({allowAnimations:m.allowAnimations,allowHorizontalAnimate:m.shouldPaginate,draggedHeaderRef:m.draggedHeaderRef,headersRef:m.headersRef,isBody:!0,mainBodyRef:m.mainBodyRef,pauseAnimation:m.isWidthDragging,rowIndex:h+1},{children:l.map((function(n,t){return g({hiddenColumns:d,header:n,pinned:f})?e.jsx(D,r({colIndex:t,getBorderClass:o,handleMouseDown:i,handleMouseOver:a,header:n,headers:l,hiddenColumns:d,isInitialFocusedCell:c,isSelected:s,onExpandRowClick:u,pinned:f,rowIndex:h,visibleRow:w},m),v({accessor:n.accessor,rowIndex:h+1})):null}))}))},D=function(o){var i=o.colIndex,a=o.getBorderClass,l=o.handleMouseDown,d=o.handleMouseOver,s=o.header,c=o.isInitialFocusedCell,u=o.isSelected,f=o.onExpandRowClick,h=o.rowIndex,g=o.visibleRow,w=t(o,["colIndex","getBorderClass","handleMouseDown","handleMouseOver","header","isInitialFocusedCell","isSelected","onExpandRowClick","rowIndex","visibleRow"]);return s.children?e.jsx(e.Fragment,{children:s.children.map((function(n,t){return e.jsx(D,r({colIndex:i+t,getBorderClass:a,handleMouseDown:l,handleMouseOver:d,header:n,isSelected:u,isInitialFocusedCell:c,onExpandRowClick:f,rowIndex:h,visibleRow:g},w),v({accessor:n.accessor,rowIndex:h+1}))}))}):n.createElement(M,r({},w,{borderClass:a({rowIndex:h,colIndex:i,rowId:g.row.rowMeta.rowId}),colIndex:i,header:s,isSelected:u({rowIndex:h,colIndex:i,rowId:g.row.rowMeta.rowId}),isInitialFocusedCell:c({rowIndex:h,colIndex:i,rowId:g.row.rowMeta.rowId}),key:v({accessor:s.accessor,rowIndex:h+1}),onExpandRowClick:f,onMouseDown:function(){return l({rowIndex:h,colIndex:i,rowId:g.row.rowMeta.rowId})},onMouseOver:function(){return d({rowIndex:h,colIndex:i,rowId:g.row.rowMeta.rowId})},rowIndex:h,visibleRow:g}))},j=function(n){var t=n.getNextRowIndex,o=n.gridTemplateColumns,i=n.index,a=n.pinned,l=n.props,d=n.rowHeight,s=n.visibleRow,c=s.position,u=t();return e.jsx("div",r({className:"st-table-row",style:{gridTemplateColumns:o,top:h({position:c,rowHeight:d}),height:"".concat(d,"px")}},{children:e.jsx(E,r({pinned:a,rowIndex:u,visibleRow:s},l),i)}))},k=function(n){var t=n.lastGroupRow,o=n.position,i=n.rowHeight,a=n.templateColumns;return e.jsx("div",r({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:a,position:"absolute",top:f({position:o,rowHeight:i}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},N=function(o){o.headerContainerRef;var i=o.onExpandRowClick,a=o.pinned,l=o.rowHeight,d=o.sectionRef,s=o.templateColumns,c=o.totalHeight,u=o.visibleRows,f=o.width,h=t(o,["headerContainerRef","onExpandRowClick","pinned","rowHeight","sectionRef","templateColumns","totalHeight","visibleRows","width"]),v=a?"st-table-body-pinned-".concat(a):"st-table-body-main",g=n.useRef(0);n.useEffect((function(){g.current=0}));var w=function(){return g.current++};return e.jsx("div",r({className:v,ref:d,style:{position:"relative",height:"".concat(c,"px"),width:f}},{children:u.map((function(t,o){var d,c,f=Boolean(null===(c=null===(d=t.row.rowMeta)||void 0===d?void 0:d.children)||void 0===c?void 0:c.length);return e.jsxs(n.Fragment,{children:[e.jsx(j,{getNextRowIndex:w,gridTemplateColumns:s,index:o,pinned:a,props:r(r({},h),{onExpandRowClick:i,rowHeight:l,visibleRows:u}),rowHeight:l,visibleRow:t}),0!==o&&e.jsx(k,{lastGroupRow:f,position:t.position,rowHeight:l,templateColumns:s})]},o)}))}))};!function(e){e.LEFT="left",e.RIGHT="right"}(i||(i={}));var T,L=function(t){var o,a,l,d,s,c=t.centerHeaderRef,u=t.flattenedRows,f=t.headerContainerRef,h=t.mainBodyRef,v=t.mainTemplateColumns,g=t.pinnedLeftColumns,w=t.pinnedLeftHeaderRef,m=t.pinnedLeftRef,p=t.pinnedLeftTemplateColumns,x=t.pinnedRightColumns,R=t.pinnedRightHeaderRef,I=t.pinnedRightRef,C=t.pinnedRightTemplateColumns,b=t.rowHeight,y=t.scrollbarWidth,M=t.setFlattenedRows,H=t.setScrollTop,S=t.tableBodyContainerRef,E=t.visibleRows;!function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],l=i[1];n.useEffect((function(){var e=null==r?void 0:r.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[r,a,o]),n.useEffect((function(){var e=null==r?void 0:r.current,n=null==t?void 0:t.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;l(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(n),function(){n&&i.unobserve(n)}}}),[r,t])}({headerContainerRef:f,mainSectionRef:S,scrollbarWidth:y});var D,j,k=n.useRef(null),T=(D=0,(j=function(e){e.forEach((function(e){D+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&j(e.rowMeta.children)}))})(u),D)*(b+1)-1,L=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};M((function(e){return e.map(n)}))},O=(null===(o=w.current)||void 0===o?void 0:o.clientWidth)?(null===(a=w.current)||void 0===a?void 0:a.clientWidth)+1:0,B=null===(l=c.current)||void 0===l?void 0:l.clientWidth,W=(null===(d=R.current)||void 0===d?void 0:d.clientWidth)?(null===(s=R.current)||void 0===s?void 0:s.clientWidth)+1:0;return e.jsxs("div",r({className:"st-table-body-container",ref:S,onScroll:function(e){var n=e.currentTarget.scrollTop;k.current&&cancelAnimationFrame(k.current),k.current=requestAnimationFrame((function(){H(n)}))}},{children:[g.length>0&&e.jsx(N,r({},t,{onExpandRowClick:L,pinned:i.LEFT,rowHeight:b,sectionRef:m,templateColumns:p,totalHeight:T,visibleRows:E,width:O})),e.jsx(N,r({},t,{onExpandRowClick:L,rowHeight:b,sectionRef:h,templateColumns:v,totalHeight:T,visibleRows:E,width:B})),x.length>0&&e.jsx(N,r({},t,{onExpandRowClick:L,pinned:i.RIGHT,rowHeight:b,sectionRef:I,templateColumns:C,totalHeight:T,visibleRows:E,width:W}))]}))},O=function(e,r){n.useEffect((function(){if(e.current){var n=e.current,t=function(){var e,t=null==n?void 0:n.scrollLeft;void 0!==t&&(null===(e=r.current)||void 0===e||e.scrollTo(t,0))};return n.addEventListener("scroll",t),function(){null==n||n.removeEventListener("scroll",t)}}}),[e,r])},B={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return B.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?B.string(e,n,r):"number"==typeof e&&"number"==typeof n?B.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?B.boolean(e,n,r):B.string(String(e),String(n),r)}},W=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return B.number(i,a,t)}return"date"===r?B.date(String(e),String(n),t):"boolean"===r?B.boolean(Boolean(e),Boolean(n),t):"enum"===r?B.enum(String(e),String(n),t):B.string(String(e),String(n),t)},A=function(e,n,t){var i=t.find((function(e){return e.accessor===n.key.accessor})),a=(null==i?void 0:i.type)||"string",l=n.direction,d=new Map,s=new Map,c="";e.forEach((function(e){var r;if(e.rowData&&!e.rowData[n.key.accessor]&&void 0!==e.rowMeta.isExpanded){var t=(e.rowData.sector||"group_".concat(d.size)).toString();c=t,s.set(c,e),d.has(c)||d.set(c,[])}else if(c){var o=d.get(c)||[];o.push(e),d.set(c,o)}else{var i="default";d.has(i)||d.set(i,[]),null===(r=d.get(i))||void 0===r||r.push(e)}}));var u=[];return d.forEach((function(e,i){if(s.has(i)){var d=s.get(i);d.rowMeta.children&&d.rowMeta.children.length>0&&(d.rowMeta.children=F(d.rowMeta.children,n,t)),u.push(d)}var c=o([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],i=r.rowData[t];return W(o,i,a,l)}));u.push.apply(u,c.map((function(e){var o=r({},e);if(o.rowMeta.children&&o.rowMeta.children.length>0){var i=F(o.rowMeta.children,n,t);o.rowMeta=r(r({},o.rowMeta),{children:i})}return o})))})),u},F=function(e,n,t){var i=t.find((function(e){return e.accessor===n.key.accessor})),a=(null==i?void 0:i.type)||"string",l=n.direction;return o([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],i=r.rowData[t];return W(o,i,a,l)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?r(r({},e),{rowMeta:r(r({},e.rowMeta),{children:F(e.rowMeta.children,n,t)})}):e}))},P=function(e){var n=e.colIndex,r=e.event,t=e.forceUpdate,o=e.header,i=e.headersRef;e.reverse;var a=e.setIsWidthDragging,l=e.startWidth;a(!0),r.preventDefault();var d=r.clientX;if(o){var s=function(e){var r=Math.max(l+(e.clientX-d),40);o&&i.current&&(i.current[n].width=r,t())},c=function(){document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),a(!1)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c)}},z=n.forwardRef((function(t,o){var i=t.colIndex,l=t.columnReordering,d=t.columnResizing,s=t.currentRows,c=t.draggedHeaderRef,u=t.forceUpdate,f=t.gridColumnEnd,h=t.gridColumnStart,g=t.gridRowEnd,w=t.gridRowStart,m=t.header,p=t.headersRef,x=t.hoveredHeaderRef,R=t.onColumnOrderChange,C=t.onSort,b=t.onTableHeaderDragEnd,M=t.reverse,H=t.rowHeight,S=t.selectableColumns,E=t.setIsWidthDragging,D=t.setSelectedCells,j=t.sort,k=t.sortDownIcon,N=t.sortUpIcon,T=n.useState(!1),L=T[0],O=T[1],B=Boolean(null==m?void 0:m.isSortable),W="st-header-cell ".concat(m===x.current?"st-hovered":""," ").concat(L?"st-dragging":""," ").concat(B?"clickable":""," ").concat(l&&!B?"columnReordering":""," ").concat("right"===(null==m?void 0:m.align)?"right-aligned":"center"===(null==m?void 0:m.align)?"center-aligned":""),A=y({draggedHeaderRef:c,headersRef:p,hoveredHeaderRef:x,onColumnOrderChange:R,onTableHeaderDragEnd:b}),F=A.handleDragStart,z=A.handleDragEnd,U=A.handleDragOver,q=I(),G=function(e){var n=e.event,r=e.header;if(S){var t=s.length,o=Array.from({length:t},(function(e,n){return a({rowIndex:n,colIndex:i,rowId:s[n].rowMeta.rowId})})),l=function(e,n){var r=new Set,o=Math.min(e,n),i=Math.max(e,n);return Array.from({length:t}).forEach((function(e,n){Array.from({length:i-o+1}).forEach((function(e,t){r.add(a({rowIndex:n,colIndex:o+t,rowId:s[n].rowMeta.rowId}))}))})),r};n.shiftKey?D((function(e){var n,r=Number(null===(n=Array.from(e)[0])||void 0===n?void 0:n.split("-")[1]),t=Number(o[0].split("-")[1]);return r===t?new Set(o):r>t?l(t,r):l(r,t)})):D(new Set(o))}else r.isSortable&&C(i,r.accessor)};if(n.useEffect((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!m)return null;var K=d&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;q({callback:P,callbackProps:{colIndex:i,event:e,forceUpdate:u,header:m,headersRef:p,setIsWidthDragging:E,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),V=j&&j.key.accessor===m.accessor&&e.jsxs("div",r({className:"st-sort-icon-container",onClick:function(e){return G({event:e,header:m})}},{children:["ascending"===j.direction&&N&&N,"descending"===j.direction&&k&&k]}));return e.jsxs("div",r({className:W,id:v({accessor:m.accessor,rowIndex:0}),onDragOver:function(e){q({callback:U,callbackProps:{event:e,hoveredHeader:m},limit:50})},ref:o,style:r(r({gridRowStart:w,gridRowEnd:g,gridColumnStart:h,gridColumnEnd:f},f-h>1?{}:{width:m.width}),g-w>1?{}:{height:H})},{children:[M&&K,e.jsxs("div",r({className:"st-header-label ".concat("right"===m.align?"right-aligned":"center"===m.align?"center-aligned":""),draggable:l,onClick:function(e){return G({event:e,header:m})},onDragEnd:function(e){e.preventDefault(),O(!1),z()},onDragStart:function(e){l&&m&&function(e){O(!0),F(e)}(m)}},{children:["right"===m.align&&V,null==m?void 0:m.label,"right"!==m.align&&V]})),!M&&K]}))})),U=function(o){var i,a,l=o.depth,d=o.getNextColIndex,s=o.header,c=o.hiddenColumns,u=o.index,f=o.maxDepth,h=o.pinned,v=t(o,["depth","getNextColIndex","header","hiddenColumns","index","maxDepth","pinned"]),w=null!==(a=null===(i=s.children)||void 0===i?void 0:i.length)&&void 0!==a?a:0,m=d(0===u?0:1),p={gridColumnStart:m,gridColumnEnd:w>0?m+w:m+1,gridRowStart:l,gridRowEnd:w>0?l+1:f+1};if(s.children){var x=s.children.filter((function(e){return g({hiddenColumns:c,header:e,pinned:h})}));return e.jsxs(n.Fragment,{children:[e.jsx(z,r({},v,p,{colIndex:m,header:s,ref:n.createRef()})),x.map((function(e,t){return n.createElement(U,r({},v,{depth:l+1,getNextColIndex:d,header:e,hiddenColumns:c,index:t,key:e.accessor,maxDepth:f}))}))]})}return e.jsx(z,r({},v,p,{colIndex:m,header:s,ref:n.createRef()}))},q=function(t){var o=t.allowAnimations,a=t.columnReordering,l=t.columnResizing,d=t.currentRows,s=t.draggedHeaderRef,c=t.forceUpdate,u=t.gridTemplateColumns,f=t.handleScroll,h=t.headersRef,v=t.hiddenColumns,w=t.hoveredHeaderRef,m=t.isWidthDragging,p=t.mainBodyRef,x=t.maxDepth,R=t.onColumnOrderChange,I=t.onSort,C=t.onTableHeaderDragEnd,b=t.pinned,y=t.rowHeight,M=t.sectionRef,S=t.selectableColumns,E=t.setIsWidthDragging,D=t.setSelectedCells,j=t.sort,k=t.sortDownIcon,N=t.sortUpIcon,T=n.useRef(1);n.useEffect((function(){T.current=1}));var L=function(e){return void 0===e&&(e=1),T.current+=e,T.current},O=h.current.filter((function(e){return g({hiddenColumns:v,header:e,pinned:b})}));return e.jsx("div",r({className:"st-header-".concat(b?"pinned-".concat(b):"main")},f&&{onScroll:f},{ref:M,style:{gridTemplateColumns:u}},{children:e.jsx(H,r({allowAnimations:o,draggedHeaderRef:s,headersRef:h,mainBodyRef:p,pauseAnimation:m,rowIndex:0},{children:O.map((function(n,r){return e.jsx(U,{getNextColIndex:L,columnReordering:a,columnResizing:l,currentRows:d,depth:1,draggedHeaderRef:s,forceUpdate:c,header:n,headersRef:h,hiddenColumns:v,hoveredHeaderRef:w,index:r,maxDepth:x,onColumnOrderChange:R,onSort:I,onTableHeaderDragEnd:C,pinned:b,reverse:b===i.RIGHT,rowHeight:y,selectableColumns:S,setIsWidthDragging:E,setSelectedCells:D,sort:j,sortDownIcon:k,sortUpIcon:N},n.accessor)}))}))}))},G=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(G)):1},K=function(t){var o=t.allowAnimations,a=t.centerHeaderRef,l=t.columnResizing,d=t.currentRows,s=t.columnReordering,c=t.draggedHeaderRef,u=t.forceUpdate,f=t.headerContainerRef,h=t.headersRef,v=t.hiddenColumns,w=t.hoveredHeaderRef,m=t.isWidthDragging,p=t.mainBodyRef,x=t.mainTemplateColumns,R=t.onColumnOrderChange,I=t.onSort,C=t.onTableHeaderDragEnd,b=t.pinnedLeftColumns,y=t.pinnedLeftHeaderRef,M=t.pinnedLeftTemplateColumns,H=t.pinnedRightColumns,S=t.pinnedRightHeaderRef,E=t.pinnedRightTemplateColumns,D=t.rowHeight,j=t.selectableColumns,k=t.setIsWidthDragging,N=t.setSelectedCells,T=t.sort,L=t.sortDownIcon,B=t.sortUpIcon;O(p,a);var W=function(e){var n,r,t=null===(n=a.current)||void 0===n?void 0:n.scrollLeft;void 0!==t&&(null===(r=p.current)||void 0===r||r.scrollTo(t,0))},A=n.useMemo((function(){var e=h.current,n=0;return e.forEach((function(e){if(g({hiddenColumns:v,header:e})){var r=G(e);n=Math.max(n,r)}})),{maxDepth:n}}),[h,v]).maxDepth,F={allowAnimations:o,columnReordering:s,columnResizing:l,currentRows:d,draggedHeaderRef:c,forceUpdate:u,handleScroll:W,headersRef:h,hiddenColumns:v,hoveredHeaderRef:w,isWidthDragging:m,mainBodyRef:p,maxDepth:A,onColumnOrderChange:R,onSort:I,onTableHeaderDragEnd:C,rowHeight:D,selectableColumns:j,setIsWidthDragging:k,setSelectedCells:N,sort:T,sortDownIcon:L,sortUpIcon:B};return e.jsxs("div",r({className:"st-header-container",ref:f},{children:[b.length>0&&e.jsx(q,r({},F,{gridTemplateColumns:M,pinned:i.LEFT,sectionRef:y})),e.jsx(q,r({},F,{gridTemplateColumns:x,handleScroll:W,sectionRef:a})),H.length>0&&e.jsx(q,r({},F,{gridTemplateColumns:E,pinned:i.RIGHT,sectionRef:S}))]}))},V=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"minmax(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},J=function(t){var o=t.allowAnimations,i=t.columnReordering,a=t.columnResizing,l=t.currentRows,d=t.draggedHeaderRef,s=t.editColumns,c=t.flattenedRows,u=t.forceUpdate,f=t.getBorderClass,h=t.handleMouseDown,v=t.handleMouseOver,g=t.headersRef,w=t.hiddenColumns,m=t.hoveredHeaderRef,p=t.isSelected,x=t.isInitialFocusedCell,R=t.isWidthDragging,I=t.mainBodyRef,C=t.onCellEdit,b=t.onColumnOrderChange,y=t.onSort,M=t.onTableHeaderDragEnd,H=t.pinnedLeftRef,S=t.pinnedRightRef,E=t.rowHeight,D=t.scrollbarWidth,j=t.selectableColumns,k=t.setIsWidthDragging,N=t.setFlattenedRows,T=t.setScrollTop,O=t.setSelectedCells,B=t.shouldPaginate,W=t.sort,A=t.sortDownIcon,F=t.sortUpIcon,P=t.tableBodyContainerRef,z=t.visibleRows,U=n.useRef(null),q=n.useRef(null),G=n.useRef(null),J=n.useRef(null),X=g.current.filter((function(e){return!e.pinned})),Y=g.current.filter((function(e){return"left"===e.pinned})),_=g.current.filter((function(e){return"right"===e.pinned})),$=n.useMemo((function(){return V({headers:Y,hiddenColumns:w})}),[Y,w]),Q=n.useMemo((function(){return V({headers:X,hiddenColumns:w})}),[X,w]),Z=n.useMemo((function(){return V({headers:_,hiddenColumns:w})}),[_,w]),ee={allowAnimations:o,centerHeaderRef:G,columnResizing:a,currentRows:l,columnReordering:i,draggedHeaderRef:d,forceUpdate:u,headerContainerRef:U,headersRef:g,hiddenColumns:w,hoveredHeaderRef:m,isWidthDragging:R,mainBodyRef:I,mainTemplateColumns:Q,onColumnOrderChange:b,onSort:y,onTableHeaderDragEnd:M,pinnedLeftColumns:Y,pinnedLeftHeaderRef:q,pinnedLeftTemplateColumns:$,pinnedRightColumns:_,pinnedRightHeaderRef:J,pinnedRightTemplateColumns:Z,rowHeight:E,selectableColumns:j,setIsWidthDragging:k,setSelectedCells:O,sort:W,sortDownIcon:A,sortUpIcon:F,tableBodyContainerRef:P},ne={allowAnimations:o,centerHeaderRef:G,draggedHeaderRef:d,flattenedRows:c,getBorderClass:f,handleMouseDown:h,handleMouseOver:v,headerContainerRef:U,headers:g.current,headersRef:g,hiddenColumns:w,hoveredHeaderRef:m,isSelected:p,isInitialFocusedCell:x,isWidthDragging:R,mainBodyRef:I,mainTemplateColumns:Q,onCellEdit:C,onTableHeaderDragEnd:M,pinnedLeftColumns:Y,pinnedLeftHeaderRef:q,pinnedLeftRef:H,pinnedLeftTemplateColumns:$,pinnedRightColumns:_,pinnedRightHeaderRef:J,pinnedRightRef:S,pinnedRightTemplateColumns:Z,rowHeight:E,scrollbarWidth:D,setFlattenedRows:N,shouldPaginate:B,setScrollTop:T,tableBodyContainerRef:P,visibleRows:z};return e.jsxs("div",r({className:"st-table-content",style:{width:s?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(K,r({},ee)),e.jsx(L,r({},ne))]}))},X=function(e){var r=e.callback,t=e.ref,o=e.widthAttribute;n.useEffect((function(){var e=t.current;if(e){var n=function(){r(e[o]||0)};n();var i=new ResizeObserver((function(){n()}));return i.observe(e),function(){return i.disconnect()}}}),[r,t,o])},Y=function(t){var o=t.mainBodyRef,i=t.pinnedLeftRef,a=t.pinnedRightRef,l=t.tableContentWidth,d=n.useState(0),s=d[0],c=d[1],u=n.useState(0),f=u[0],h=u[1],v=n.useState(0),g=v[0],w=v[1],m=n.useRef(null);return X({widthAttribute:"offsetWidth",callback:c,ref:i}),X({widthAttribute:"scrollWidth",callback:w,ref:o}),X({widthAttribute:"offsetWidth",callback:h,ref:a}),O(o,m),!o.current||o.current.scrollWidth<=o.current.clientWidth?null:e.jsxs("div",r({className:"st-horizontal-scrollbar-container",style:{width:l}},{children:[s>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s}}),g>0&&e.jsx("div",r({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&o.current&&o.current.scrollTo({left:n,behavior:"auto"})},ref:m},{children:e.jsx("div",{style:{width:g}})})),f>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:f}})]}))},_=function(e){var r=e.headers,t=e.tableRows,o=n.useState(null),i=o[0],a=o[1],l=n.useMemo((function(){var e={};return r.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[r]),d=n.useState(l),s=d[0],c=d[1],u=n.useMemo((function(){if(!i)return t;var e=function(e,n,r){return{sortedData:A(n,r,e),newSortConfig:r}}(r,t,i).sortedData;return e}),[t,i,r]);return{sort:i,setSort:a,updateSort:function(e,n){var t=r.find((function(e){return e.accessor===n}));t&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:t,direction:"descending"}:null:{key:t,direction:"ascending"}}))},sortedRows:u,hiddenColumns:s,setHiddenColumns:c}},$=function(t){var o=t.checked,i=void 0!==o&&o,a=t.children,l=t.onChange,d=n.useState(i),s=d[0],c=d[1];return e.jsxs("label",r({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:s,className:"st-checkbox-input",onChange:function(){var e=!s;c(e),l&&l(e)},type:"checkbox"}),e.jsx("span",r({className:"st-checkbox-custom ".concat(s?"st-checked":"")},{children:s&&e.jsx("span",{className:"st-checkbox-checkmark"})})),a]}))},Q=function(n){var t=n.headers,o=n.open,i=n.position;n.setOpen;var a=n.setHiddenColumns,l=n.hiddenColumns,d="left"===i?"left":"";return e.jsx("div",r({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(d),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",r({className:"st-column-editor-popout-content"},{children:t.map((function(n,t){return e.jsx($,r({checked:l[n.accessor],onChange:function(e){var t;return a(r(r({},l),((t={})[n.accessor]=e,t)))}},{children:n.label}),t)}))}))}))},Z=function(t){var o=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,d=t.position,s=void 0===d?"right":d,c=t.setHiddenColumns,u=t.hiddenColumns,f=n.useState(a),h=f[0],v=f[1];return i?e.jsxs("div",r({className:"st-column-editor ".concat(h?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!h)}},{children:[e.jsx("div",r({className:"st-column-editor-text"},{children:o})),e.jsx(Q,{headers:l,open:h,position:s,setOpen:v,setHiddenColumns:c,hiddenColumns:u})]})):null};!function(e){e.Left="left",e.Right="right"}(T||(T={}));var ee=n.memo((function(t){var o=t.allowAnimations,i=void 0!==o&&o,f=t.columnEditorPosition,h=void 0===f?T.Right:f,v=t.columnEditorText,g=void 0===v?"Columns":v,w=t.columnResizing,m=void 0!==w&&w,p=t.defaultHeaders,x=t.editColumns,R=void 0!==x&&x,I=t.editColumnsInitOpen,C=void 0!==I&&I,b=t.columnReordering,y=void 0!==b&&b,M=t.height,H=t.hideFooter,S=void 0!==H&&H,E=t.nextIcon,D=void 0===E?e.jsx(s,{className:"st-next-prev-icon"}):E,j=t.onCellEdit,k=t.onColumnOrderChange,N=t.onNextPage,L=t.onPreviousPage,O=t.prevIcon,B=void 0===O?e.jsx(d,{className:"st-next-prev-icon"}):O,W=t.rowHeight,A=void 0===W?40:W,F=t.rows,P=t.rowsPerPage,z=void 0===P?10:P,U=t.selectableCells,q=void 0!==U&&U,G=t.selectableColumns,K=void 0!==G&&G,V=t.shouldPaginate,X=void 0!==V&&V,$=t.sortDownIcon,Q=void 0===$?e.jsx(u,{className:"st-sort-icon"}):$,ee=t.sortUpIcon,ne=void 0===ee?e.jsx(c,{className:"st-sort-icon"}):ee,re=t.theme,te=void 0===re?"light":re,oe=t.totalPages,ie=n.useRef(null),ae=n.useRef(p),le=n.useRef(null),de=n.useRef(null),se=n.useRef(null),ce=n.useRef(null),ue=n.useRef(null),fe=n.useState(!1),he=fe[0],ve=fe[1],ge=n.useState(1),we=ge[0],me=ge[1],pe=n.useState(0),xe=pe[0],Re=pe[1],Ie=n.useState(0),Ce=Ie[0],be=Ie[1],ye=n.useState(0),Me=ye[0],He=ye[1],Se=_({headers:ae.current,tableRows:F}),Ee=Se.sort,De=Se.sortedRows,je=Se.hiddenColumns,ke=Se.setHiddenColumns,Ne=Se.updateSort,Te=n.useMemo((function(){if(!X)return De;var e=(we-1)*z,n=e+z;return De.slice(e,n)}),[we,z,X,De]),Le=n.useState(Te),Oe=Le[0],Be=Le[1];n.useEffect((function(){Be(Te)}),[Te]);var We=n.useMemo((function(){var e;if(!M)return window.innerHeight-A;var n=document.querySelector(".simple-table-root"),r=0;if(M.endsWith("px"))r=parseInt(M,10);else if(M.endsWith("vh")){var t=parseInt(M,10);r=window.innerHeight*t/100}else if(M.endsWith("%")){var o=parseInt(M,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-A)}),[M,A]),Ae=n.useMemo((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=[],l=0,d=Math.max(0,i-o*n),s=i+r+o*n,c=function(e,n){for(var r,t=0,i=e;t<i.length;t++){var u=i[t],f=l*o;if(f>=s)break;f+o>d&&a.push({row:u,depth:n,position:l,isLastGroupRow:Boolean(null===(r=u.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),l+=1,u.rowMeta.isExpanded&&u.rowMeta.children&&c(u.rowMeta.children,n+1)}};return c(t,0),a}({bufferRowCount:5,contentHeight:We,flattenedRows:Oe,rowHeight:A,scrollTop:Me})}),[We,A,Oe,Me]),Fe=n.useReducer((function(e){return e+1}),0)[1],Pe=function(e){var r=e.selectableCells,t=e.headers,o=e.visibleRows,i=n.useState(new Set),l=i[0],d=i[1],s=n.useState(null),c=s[0],u=s[1],f=n.useRef(!1),h=n.useRef(null),v=n.useCallback((function(){var e=Array.from(l).reduce((function(e,n){var r=n.split("-").map(Number),i=r[0],a=r[1];return e[i]||(e[i]=[]),e[i][a]=o[i].row.rowData[t[a].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");l.size>0&&navigator.clipboard.writeText(n)}),[t,l,o]),g=n.useCallback((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),l=Math.min(e.colIndex,n.colIndex),s=Math.max(e.colIndex,n.colIndex),c=t;c<=i;c++)for(var u=l;u<=s;u++)if(c>=0&&c<o.length){var f=o[c].row.rowMeta.rowId;r.add(a({colIndex:u,rowIndex:c,rowId:f}))}d(r)}),[o]),w=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<t.length){var n=a(e);d(new Set([n])),u(e)}}),[t.length,o.length]);n.useEffect((function(){var e=function(e){if(r&&c){var n=c.rowIndex,i=c.colIndex,a=c.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(o[n].row.rowMeta.rowId!==a){var l=o.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===l)return;n=l}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var s={rowIndex:n-1,colIndex:i,rowId:o[n-1].row.rowMeta.rowId};w(s)}}else"ArrowDown"===e.key?(e.preventDefault(),n<o.length-1&&(s={rowIndex:n+1,colIndex:i,rowId:o[n+1].row.rowMeta.rowId},w(s))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(s={rowIndex:n,colIndex:i-1,rowId:o[n].row.rowMeta.rowId},w(s))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<t.length-1&&(s={rowIndex:n,colIndex:i+1,rowId:o[n].row.rowMeta.rowId},w(s))):"Escape"===e.key&&(d(new Set),h.current=null,u(null))}else v()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[v,t.length,c,g,w,r,o]);var m=n.useCallback((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=a({colIndex:n,rowIndex:r,rowId:t});return l.has(o)}),[l]),p=n.useCallback((function(e){var n,r,t,i,a,l,d=e.colIndex,s=e.rowIndex,c=e.rowId,u=[],f=null===(t=null===(r=null===(n=o[s-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,h={colIndex:d,rowIndex:s+1,rowId:null===(l=null===(a=null===(i=o[s+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===l?void 0:l.rowId},v={colIndex:d-1,rowIndex:s,rowId:c},g={colIndex:d+1,rowIndex:s,rowId:c};return m({colIndex:d,rowIndex:s-1,rowId:f})||u.push("st-selected-top-border"),m(h)||u.push("st-selected-bottom-border"),m(v)||u.push("st-selected-left-border"),m(g)||u.push("st-selected-right-border"),u.join(" ")}),[m,o]),x=n.useMemo((function(){return c?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===c.rowIndex&&r===c.colIndex&&t===c.rowId}:function(){return!1}}),[c]);return{getBorderClass:p,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId;if(r){f.current=!0,h.current={rowIndex:t,colIndex:n,rowId:o};var i=a({colIndex:n,rowIndex:t,rowId:o});d(new Set([i])),u({rowIndex:t,colIndex:n,rowId:o})}},handleMouseOver:function(e){var n=e.colIndex,t=e.rowIndex;if(e.rowId,r&&f.current&&h.current){for(var i=new Set,l=Math.min(h.current.rowIndex,t),s=Math.max(h.current.rowIndex,t),c=Math.min(h.current.colIndex,n),u=Math.max(h.current.colIndex,n),v=l;v<=s;v++)for(var g=c;g<=u;g++)if(v>=0&&v<o.length){var w=o[v].row.rowMeta.rowId;i.add(a({colIndex:g,rowIndex:v,rowId:w}))}d(i)}},handleMouseUp:function(){f.current=!1},isInitialFocusedCell:x,isSelected:m,selectedCells:l,setSelectedCells:d}}({selectableCells:q,headers:ae.current,visibleRows:Ae}),ze=Pe.handleMouseDown,Ue=Pe.handleMouseOver,qe=Pe.handleMouseUp,Ge=Pe.isSelected,Ke=Pe.getBorderClass,Ve=Pe.isInitialFocusedCell,Je=Pe.setSelectedCells,Xe=n.useCallback((function(e,n){Ne(e,n)}),[Ne]),Ye=n.useCallback((function(e){ae.current=e,Fe()}),[]);return n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||K&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||Je(new Set)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[K,Je]),n.useLayoutEffect((function(){if(ue.current){var e=ue.current.offsetWidth-ue.current.clientWidth,n=ue.current.clientWidth;Re(e),be(n)}}),[]),n.useLayoutEffect((function(){var e=function(){if(Fe(),ue.current){var e=ue.current.offsetWidth-ue.current.clientWidth,n=ue.current.clientWidth;Re(e),be(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),e.jsxs("div",r({className:"simple-table-root st-wrapper theme-".concat(te),style:M?{height:M}:{}},{children:[e.jsxs("div",r({className:"st-table-wrapper-container"},{children:[e.jsxs("div",r({className:"st-table-wrapper",onMouseUp:qe,onMouseLeave:qe},{children:[e.jsx(J,{allowAnimations:i,columnReordering:y,columnResizing:m,currentRows:Te,draggedHeaderRef:ie,editColumns:R,flattenedRows:Oe,forceUpdate:Fe,getBorderClass:Ke,handleMouseDown:ze,handleMouseOver:Ue,headersRef:ae,hiddenColumns:je,hoveredHeaderRef:le,isInitialFocusedCell:Ve,isSelected:Ge,isWidthDragging:he,mainBodyRef:de,onCellEdit:j,onColumnOrderChange:k,onSort:Xe,onTableHeaderDragEnd:Ye,pinnedLeftRef:se,pinnedRightRef:ce,rowHeight:A,scrollbarWidth:xe,selectableColumns:K,setIsWidthDragging:ve,setFlattenedRows:Be,setScrollTop:He,setSelectedCells:Je,shouldPaginate:X,sort:Ee,sortDownIcon:Q,sortUpIcon:ne,tableBodyContainerRef:ue,visibleRows:Ae}),e.jsx(Z,{columnEditorText:g,editColumns:R,editColumnsInitOpen:C,headers:ae.current,hiddenColumns:je,position:h,setHiddenColumns:ke})]})),e.jsx(Y,{mainBodyRef:de,pinnedLeftRef:se,pinnedRightRef:ce,tableContentWidth:Ce})]})),e.jsx(l,{currentPage:we,hideFooter:S,nextIcon:D,onPageChange:me,onNextPage:N,onPreviousPage:L,prevIcon:B,shouldPaginate:X,totalPages:oe||Math.ceil(De.length/z)})]}))}));exports.SimpleTable=ee;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.simple-table-root{--st-after-width:11.01px;--st-resize-handle-width:2px;--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:1rem;--st-font-weight-normal:400;--st-font-weight-bold:700;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:#0000;--st-scrollbar-thumb-color:var(--st-slate-200);--st-white:#fff;--st-black:#000;--st-slate-50:#f8fafc;--st-slate-100:#f1f5f9;--st-slate-200:#e2e8f0;--st-slate-300:#cbd5e1;--st-slate-400:#94a3b8;--st-slate-500:#64748b;--st-slate-600:#475569;--st-slate-700:#334155;--st-slate-800:#1e293b;--st-slate-900:#0f172a;--st-slate-950:#020617;--st-gray-50:#f9fafb;--st-gray-100:#f3f4f6;--st-gray-200:#e5e7eb;--st-gray-300:#d1d5db;--st-gray-400:#9ca3af;--st-gray-500:#6b7280;--st-gray-600:#4b5563;--st-gray-700:#374151;--st-gray-800:#1f2937;--st-gray-900:#111827;--st-gray-950:#030712;--st-zinc-50:#fafafa;--st-zinc-100:#f4f4f5;--st-zinc-200:#e4e4e7;--st-zinc-300:#d4d4d8;--st-zinc-400:#a1a1aa;--st-zinc-500:#71717a;--st-zinc-600:#52525b;--st-zinc-700:#3f3f46;--st-zinc-800:#27272a;--st-zinc-900:#18181b;--st-zinc-950:#09090b;--st-neutral-50:#fafafa;--st-neutral-100:#f5f5f5;--st-neutral-200:#e5e5e5;--st-neutral-300:#d4d4d4;--st-neutral-400:#a3a3a3;--st-neutral-500:#737373;--st-neutral-600:#525252;--st-neutral-700:#404040;--st-neutral-800:#262626;--st-neutral-900:#171717;--st-neutral-950:#0a0a0a;--st-stone-50:#fafaf9;--st-stone-100:#f5f5f4;--st-stone-200:#e7e5e4;--st-stone-300:#d6d3d1;--st-stone-400:#a8a29e;--st-stone-500:#78716c;--st-stone-600:#57534e;--st-stone-700:#44403c;--st-stone-800:#292524;--st-stone-900:#1c1917;--st-stone-950:#0c0a09;--st-red-50:#fef2f2;--st-red-100:#fee2e2;--st-red-200:#fecaca;--st-red-300:#fca5a5;--st-red-400:#f87171;--st-red-500:#ef4444;--st-red-600:#dc2626;--st-red-700:#b91c1c;--st-red-800:#991b1b;--st-red-900:#7f1d1d;--st-red-950:#450a0a;--st-orange-50:#fff7ed;--st-orange-100:#ffedd5;--st-orange-200:#fed7aa;--st-orange-300:#fdba74;--st-orange-400:#fb923c;--st-orange-500:#f97316;--st-orange-600:#ea580c;--st-orange-700:#c2410c;--st-orange-800:#9a3412;--st-orange-900:#7c2d12;--st-orange-950:#431407;--st-amber-50:#fffbeb;--st-amber-100:#fef3c7;--st-amber-200:#fde68a;--st-amber-300:#fcd34d;--st-amber-400:#fbbf24;--st-amber-500:#f59e0b;--st-amber-600:#d97706;--st-amber-700:#b45309;--st-amber-800:#92400e;--st-amber-900:#78350f;--st-amber-950:#451a03;--st-yellow-50:#fefce8;--st-yellow-100:#fef9c3;--st-yellow-200:#fef08a;--st-yellow-300:#fde047;--st-yellow-400:#facc15;--st-yellow-500:#eab308;--st-yellow-600:#ca8a04;--st-yellow-700:#a16207;--st-yellow-800:#854d0e;--st-yellow-900:#713f12;--st-yellow-950:#422006;--st-lime-50:#f7fee7;--st-lime-100:#ecfccb;--st-lime-200:#d9f99d;--st-lime-300:#bef264;--st-lime-400:#a3e635;--st-lime-500:#84cc16;--st-lime-600:#65a30d;--st-lime-700:#4d7c0f;--st-lime-800:#3f6212;--st-lime-900:#365314;--st-lime-950:#1a2e05;--st-green-50:#f0fdf4;--st-green-100:#dcfce7;--st-green-200:#bbf7d0;--st-green-300:#86efac;--st-green-400:#4ade80;--st-green-500:#22c55e;--st-green-600:#16a34a;--st-green-700:#15803d;--st-green-800:#166534;--st-green-900:#14532d;--st-green-950:#052e16;--st-emerald-50:#ecfdf5;--st-emerald-100:#d1fae5;--st-emerald-200:#a7f3d0;--st-emerald-300:#6ee7b7;--st-emerald-400:#34d399;--st-emerald-500:#10b981;--st-emerald-600:#059669;--st-emerald-700:#047857;--st-emerald-800:#065f46;--st-emerald-900:#064e3b;--st-emerald-950:#022c22;--st-teal-50:#f0fdfa;--st-teal-100:#ccfbf1;--st-teal-200:#99f6e4;--st-teal-300:#5eead4;--st-teal-400:#2dd4bf;--st-teal-500:#14b8a6;--st-teal-600:#0d9488;--st-teal-700:#0f766e;--st-teal-800:#115e59;--st-teal-900:#134e4a;--st-teal-950:#042f2e;--st-cyan-50:#ecfeff;--st-cyan-100:#cffafe;--st-cyan-200:#a5f3fc;--st-cyan-300:#67e8f9;--st-cyan-400:#22d3ee;--st-cyan-500:#06b6d4;--st-cyan-600:#0891b2;--st-cyan-700:#0e7490;--st-cyan-800:#155e75;--st-cyan-900:#164e63;--st-cyan-950:#083344;--st-sky-50:#f0f9ff;--st-sky-100:#e0f2fe;--st-sky-200:#bae6fd;--st-sky-300:#7dd3fc;--st-sky-400:#38bdf8;--st-sky-500:#0ea5e9;--st-sky-600:#0284c7;--st-sky-700:#0369a1;--st-sky-800:#075985;--st-sky-900:#0c4a6e;--st-sky-950:#082f49;--st-blue-50:#eff6ff;--st-blue-100:#dbeafe;--st-blue-200:#bfdbfe;--st-blue-300:#93c5fd;--st-blue-400:#60a5fa;--st-blue-500:#3b82f6;--st-blue-600:#2563eb;--st-blue-700:#1d4ed8;--st-blue-800:#1e40af;--st-blue-900:#1e3a8a;--st-blue-950:#172554;--st-indigo-50:#eef2ff;--st-indigo-100:#e0e7ff;--st-indigo-200:#c7d2fe;--st-indigo-300:#a5b4fc;--st-indigo-400:#818cf8;--st-indigo-500:#6366f1;--st-indigo-600:#4f46e5;--st-indigo-700:#4338ca;--st-indigo-800:#3730a3;--st-indigo-900:#312e81;--st-indigo-950:#1e1b4b;--st-violet-50:#f5f3ff;--st-violet-100:#ede9fe;--st-violet-200:#ddd6fe;--st-violet-300:#c4b5fd;--st-violet-400:#a78bfa;--st-violet-500:#8b5cf6;--st-violet-600:#7c3aed;--st-violet-700:#6d28d9;--st-violet-800:#5b21b6;--st-violet-900:#4c1d95;--st-violet-950:#2e1065;--st-purple-50:#faf5ff;--st-purple-100:#f3e8ff;--st-purple-200:#e9d5ff;--st-purple-300:#d8b4fe;--st-purple-400:#c084fc;--st-purple-500:#a855f7;--st-purple-600:#9333ea;--st-purple-700:#7e22ce;--st-purple-800:#6b21a8;--st-purple-900:#581c87;--st-purple-950:#3b0764;--st-fuchsia-50:#fdf4ff;--st-fuchsia-100:#fae8ff;--st-fuchsia-200:#f5d0fe;--st-fuchsia-300:#f0abfc;--st-fuchsia-400:#e879f9;--st-fuchsia-500:#d946ef;--st-fuchsia-600:#c026d3;--st-fuchsia-700:#a21caf;--st-fuchsia-800:#86198f;--st-fuchsia-900:#701a75;--st-fuchsia-950:#4a044e;--st-pink-50:#fdf2f8;--st-pink-100:#fce7f3;--st-pink-200:#fbcfe8;--st-pink-300:#f9a8d4;--st-pink-400:#f472b6;--st-pink-500:#ec4899;--st-pink-600:#db2777;--st-pink-700:#be185d;--st-pink-800:#9d174d;--st-pink-900:#831843;--st-pink-950:#500724;--st-rose-50:#fff1f2;--st-rose-100:#ffe4e6;--st-rose-200:#fecdd3;--st-rose-300:#fda4af;--st-rose-400:#fb7185;--st-rose-500:#f43f5e;--st-rose-600:#e11d48;--st-rose-700:#be123c;--st-rose-800:#9f1239;--st-rose-900:#881337;--st-rose-950:#4c0519}.theme-light{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-slate-50);--st-scrollbar-thumb-color:var(--st-slate-300);--st-border-color:var(--st-gray-300);--st-odd-row-background-color:var(--st-white);--st-even-row-background-color:var(--st-white);--st-header-background-color:var(--st-white);--st-dragging-background-color:var(--st-gray-200);--st-selected-cell-background-color:var(--st-blue-200);--st-selected-first-cell-background-color:var(--st-blue-100);--st-footer-background-color:var(--st-white);--st-cell-color:var(--st-gray-800);--st-cell-odd-row-color:var(--st-gray-700);--st-edit-cell-shadow:0 1px 2px 0 #0000000d,0 1px 1px -1px #0000000d;--st-selected-cell-color:var(--st-gray-900);--st-selected-first-cell-color:var(--st-gray-900);--st-resize-handle-color:var(--st-blue-300);--st-separator-border-color:var(--st-slate-100);--st-last-group-row-separator-border-color:var(--st-slate-300);--st-selected-border-top-color:var(--st-blue-600);--st-selected-border-bottom-color:var(--st-blue-600);--st-selected-border-left-color:var(--st-blue-600);--st-selected-border-right-color:var(--st-blue-600);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-gray-200);--st-button-active-background-color:var(--st-blue-800);--st-font-family:"Roboto",sans-serif;--st-editable-cell-focus-border-color:var(--st-blue-600)}.theme-dark{--st-border-radius:6px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-slate-800);--st-scrollbar-thumb-color:var(--st-slate-600);--st-border-color:var(--st-slate-800);--st-odd-row-background-color:var(--st-slate-800);--st-even-row-background-color:var(--st-slate-900);--st-header-background-color:var(--st-slate-700);--st-dragging-background-color:var(--st-blue-800);--st-selected-cell-background-color:var(--st-blue-900);--st-selected-first-cell-background-color:var(--st-blue-800);--st-footer-background-color:var(--st-slate-900);--st-cell-color:var(--st-white);--st-cell-odd-row-color:var(--st-slate-300);--st-edit-cell-shadow:0 1px 3px 0 var(--st-white/0.1),0 1px 2px -1px var(--st-white/0.1);--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-slate-600);--st-separator-border-color:var(--st-slate-500);--st-last-group-row-separator-border-color:var(--st-slate-700);--st-selected-border-top-color:var(--st-blue-400);--st-selected-border-bottom-color:var(--st-blue-400);--st-selected-border-left-color:var(--st-blue-400);--st-selected-border-right-color:var(--st-blue-400);--st-checkbox-checked-background-color:var(--st-blue-700);--st-checkbox-checked-border-color:var(--st-blue-700);--st-column-editor-background-color:var(--st-slate-800);--st-column-editor-popout-background-color:var(--st-slate-800);--st-button-hover-background-color:var(--st-slate-600);--st-button-active-background-color:var(--st-slate-700);--st-font-family:"Open Sans",sans-serif;--st-editable-cell-focus-border-color:var(--st-slate-600)}.theme-high-contrast{--st-border-radius:0;--st-border-width:2px;--st-cell-padding:12px;--st-font-size:1rem;--st-font-weight-normal:500;--st-font-weight-bold:800;--st-transition-duration:0s;--st-transition-ease:ease;--st-opacity-disabled:0.7;--st-spacing-small:8px;--st-spacing-medium:12px;--st-spacing-large:24px;--st-scrollbar-bg-color:var(--st-slate-950);--st-scrollbar-thumb-color:var(--st-slate-200);--st-border-color:var(--st-slate-900);--st-odd-row-background-color:var(--st-slate-400);--st-even-row-background-color:var(--st-slate-900);--st-header-background-color:var(--st-slate-900);--st-dragging-background-color:var(--st-yellow-500);--st-selected-cell-background-color:var(--st-slate-900);--st-selected-first-cell-background-color:var(--st-red-500);--st-footer-background-color:var(--st-slate-900);--st-cell-color:var(--st-white);--st-cell-odd-row-color:var(--st-slate-900);--st-edit-cell-shadow:none;--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-white);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-900);--st-selected-border-top-color:var(--st-orange-600);--st-selected-border-bottom-color:var(--st-orange-600);--st-selected-border-left-color:var(--st-orange-600);--st-selected-border-right-color:var(--st-orange-600);--st-checkbox-checked-background-color:var(--st-slate-50);--st-checkbox-checked-border-color:var(--st-slate-50);--st-column-editor-background-color:var(--st-slate-900);--st-column-editor-popout-background-color:var(--st-slate-900);--st-button-hover-background-color:var(--st-slate-50);--st-button-active-background-color:var(--st-slate-900);--st-font-family:"Arial",sans-serif;--st-editable-cell-focus-border-color:var(--st-orange-600)}.theme-pastel{--st-border-radius:8px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.9rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-purple-100);--st-scrollbar-thumb-color:var(--st-purple-300);--st-border-color:var(--st-purple-200);--st-odd-row-background-color:var(--st-purple-50);--st-even-row-background-color:var(--st-blue-50);--st-header-background-color:var(--st-blue-50);--st-dragging-background-color:var(--st-cyan-50);--st-selected-cell-background-color:var(--st-orange-50);--st-selected-first-cell-background-color:var(--st-amber-50);--st-footer-background-color:var(--st-purple-50);--st-cell-color:var(--st-slate-600);--st-cell-odd-row-color:var(--st-slate-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-slate-600);--st-selected-first-cell-color:var(--st-slate-600);--st-resize-handle-color:var(--st-purple-200);--st-separator-border-color:var(--st-purple-200);--st-last-group-row-separator-border-color:var(--st-purple-500);--st-selected-border-top-color:var(--st-amber-500);--st-selected-border-bottom-color:var(--st-amber-500);--st-selected-border-left-color:var(--st-amber-500);--st-selected-border-right-color:var(--st-amber-500);--st-checkbox-checked-background-color:var(--st-purple-200);--st-checkbox-checked-border-color:var(--st-purple-200);--st-column-editor-background-color:var(--st-purple-50);--st-column-editor-popout-background-color:var(--st-purple-50);--st-button-hover-background-color:var(--st-purple-100);--st-button-active-background-color:var(--st-purple-200);--st-font-family:"Comic Sans MS",cursive,sans-serif;--st-editable-cell-focus-border-color:var(--st-purple-300)}.theme-vibrant{--st-border-radius:12px;--st-border-width:2px;--st-cell-padding:12px;--st-font-size:1rem;--st-font-weight-normal:500;--st-font-weight-bold:700;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:8px;--st-spacing-medium:12px;--st-spacing-large:24px;--st-scrollbar-bg-color:var(--st-orange-200);--st-scrollbar-thumb-color:var(--st-orange-300);--st-border-color:var(--st-orange-500);--st-odd-row-background-color:var(--st-orange-100);--st-even-row-background-color:var(--st-orange-200);--st-header-background-color:var(--st-orange-300);--st-dragging-background-color:var(--st-blue-300);--st-selected-cell-background-color:var(--st-blue-400);--st-selected-first-cell-background-color:var(--st-amber-300);--st-footer-background-color:var(--st-orange-50);--st-cell-color:var(--st-orange-900);--st-cell-odd-row-color:var(--st-orange-800);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.2),0 1px 2px -1px var(--st-black/0.2);--st-selected-cell-color:var(--st-orange-900);--st-selected-first-cell-color:var(--st-orange-900);--st-resize-handle-color:var(--st-orange-400);--st-separator-border-color:var(--st-orange-200);--st-last-group-row-separator-border-color:var(--st-orange-500);--st-selected-border-top-color:var(--st-orange-700);--st-selected-border-bottom-color:var(--st-orange-700);--st-selected-border-left-color:var(--st-orange-700);--st-selected-border-right-color:var(--st-orange-700);--st-checkbox-checked-background-color:var(--st-orange-500);--st-checkbox-checked-border-color:var(--st-orange-500);--st-column-editor-background-color:var(--st-orange-100);--st-column-editor-popout-background-color:var(--st-orange-100);--st-button-hover-background-color:var(--st-orange-300);--st-button-active-background-color:var(--st-orange-400);--st-font-family:"Lobster",cursive;--st-editable-cell-focus-border-color:var(--st-orange-600)}.theme-solarized-light{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-yellow-100);--st-scrollbar-thumb-color:var(--st-yellow-300);--st-border-color:var(--st-yellow-300);--st-odd-row-background-color:var(--st-yellow-50);--st-even-row-background-color:var(--st-yellow-200);--st-header-background-color:var(--st-yellow-200);--st-dragging-background-color:var(--st-yellow-300);--st-selected-cell-background-color:var(--st-slate-400);--st-selected-first-cell-background-color:var(--st-slate-300);--st-footer-background-color:var(--st-yellow-50);--st-cell-color:var(--st-slate-600);--st-cell-odd-row-color:var(--st-slate-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-slate-600);--st-selected-first-cell-color:var(--st-slate-600);--st-resize-handle-color:var(--st-slate-400);--st-separator-border-color:var(--st-yellow-300);--st-last-group-row-separator-border-color:var(--st-yellow-500);--st-selected-border-top-color:var(--st-yellow-600);--st-selected-border-bottom-color:var(--st-yellow-600);--st-selected-border-left-color:var(--st-yellow-600);--st-selected-border-right-color:var(--st-yellow-600);--st-checkbox-checked-background-color:var(--st-slate-400);--st-checkbox-checked-border-color:var(--st-slate-400);--st-column-editor-background-color:var(--st-yellow-200);--st-column-editor-popout-background-color:var(--st-yellow-200);--st-button-hover-background-color:var(--st-yellow-200);--st-button-active-background-color:var(--st-slate-400);--st-font-family:"Georgia",serif;--st-editable-cell-focus-border-color:var(--st-yellow-400)}.theme-solarized-dark{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-slate-800);--st-scrollbar-thumb-color:var(--st-slate-600);--st-border-color:var(--st-slate-800);--st-odd-row-background-color:var(--st-slate-900);--st-even-row-background-color:var(--st-slate-800);--st-header-background-color:var(--st-slate-800);--st-dragging-background-color:var(--st-slate-800);--st-selected-cell-background-color:var(--st-slate-600);--st-selected-first-cell-background-color:var(--st-slate-500);--st-footer-background-color:var(--st-slate-900);--st-cell-color:var(--st-slate-300);--st-cell-odd-row-color:var(--st-slate-400);--st-edit-cell-shadow:0 1px 3px 0 var(--st-white/0.1),0 1px 2px -1px var(--st-white/0.1);--st-selected-cell-color:var(--st-slate-300);--st-selected-first-cell-color:var(--st-slate-300);--st-resize-handle-color:var(--st-slate-600);--st-separator-border-color:var(--st-slate-400);--st-last-group-row-separator-border-color:var(--st-slate-600);--st-selected-border-top-color:var(--st-blue-800);--st-selected-border-bottom-color:var(--st-blue-800);--st-selected-border-left-color:var(--st-blue-800);--st-selected-border-right-color:var(--st-blue-800);--st-checkbox-checked-background-color:var(--st-slate-600);--st-checkbox-checked-border-color:var(--st-slate-600);--st-column-editor-background-color:var(--st-slate-800);--st-column-editor-popout-background-color:var(--st-slate-800);--st-button-hover-background-color:var(--st-slate-600);--st-button-active-background-color:var(--st-slate-800);--st-font-family:"Courier New",monospace;--st-editable-cell-focus-border-color:var(--st-blue-800)}.theme-ocean{--st-border-radius:6px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.9rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-cyan-100);--st-scrollbar-thumb-color:var(--st-cyan-300);--st-border-color:var(--st-cyan-700);--st-odd-row-background-color:var(--st-cyan-50);--st-even-row-background-color:var(--st-cyan-100);--st-header-background-color:var(--st-cyan-100);--st-dragging-background-color:var(--st-cyan-300);--st-selected-cell-background-color:var(--st-cyan-700);--st-selected-first-cell-background-color:var(--st-cyan-600);--st-footer-background-color:var(--st-cyan-50);--st-cell-color:var(--st-slate-900);--st-cell-odd-row-color:var(--st-cyan-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-slate-900);--st-selected-first-cell-color:var(--st-slate-900);--st-resize-handle-color:var(--st-cyan-300);--st-separator-border-color:var(--st-cyan-200);--st-last-group-row-separator-border-color:var(--st-cyan-500);--st-selected-border-top-color:var(--st-blue-700);--st-selected-border-bottom-color:var(--st-blue-700);--st-selected-border-left-color:var(--st-blue-700);--st-selected-border-right-color:var(--st-blue-700);--st-checkbox-checked-background-color:var(--st-cyan-700);--st-checkbox-checked-border-color:var(--st-cyan-700);--st-column-editor-background-color:var(--st-cyan-100);--st-column-editor-popout-background-color:var(--st-cyan-100);--st-button-hover-background-color:var(--st-cyan-300);--st-button-active-background-color:var(--st-cyan-700);--st-font-family:"Verdana",sans-serif;--st-editable-cell-focus-border-color:var(--st-cyan-500)}.theme-forest{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-green-100);--st-scrollbar-thumb-color:var(--st-green-400);--st-border-color:var(--st-green-800);--st-odd-row-background-color:var(--st-green-50);--st-even-row-background-color:var(--st-green-100);--st-header-background-color:var(--st-green-100);--st-dragging-background-color:var(--st-green-400);--st-selected-cell-background-color:var(--st-green-700);--st-selected-first-cell-background-color:var(--st-green-600);--st-footer-background-color:var(--st-green-50);--st-cell-color:var(--st-green-900);--st-cell-odd-row-color:var(--st-green-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-green-900);--st-selected-first-cell-color:var(--st-green-900);--st-resize-handle-color:var(--st-green-400);--st-separator-border-color:var(--st-green-200);--st-last-group-row-separator-border-color:var(--st-green-500);--st-selected-border-top-color:var(--st-green-600);--st-selected-border-bottom-color:var(--st-green-600);--st-selected-border-left-color:var(--st-green-600);--st-selected-border-right-color:var(--st-green-600);--st-checkbox-checked-background-color:var(--st-green-700);--st-checkbox-checked-border-color:var(--st-green-700);--st-column-editor-background-color:var(--st-green-100);--st-column-editor-popout-background-color:var(--st-green-100);--st-button-hover-background-color:var(--st-green-400);--st-button-active-background-color:var(--st-green-700);--st-font-family:"Tahoma",sans-serif;--st-editable-cell-focus-border-color:var(--st-green-600)}.theme-desert{--st-border-radius:8px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.9rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-amber-100);--st-scrollbar-thumb-color:var(--st-amber-300);--st-border-color:var(--st-amber-600);--st-odd-row-background-color:var(--st-amber-50);--st-even-row-background-color:var(--st-amber-100);--st-header-background-color:var(--st-amber-100);--st-dragging-background-color:var(--st-amber-300);--st-selected-cell-background-color:var(--st-amber-600);--st-selected-first-cell-background-color:var(--st-amber-500);--st-footer-background-color:var(--st-amber-50);--st-cell-color:var(--st-amber-800);--st-cell-odd-row-color:var(--st-amber-600);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-amber-800);--st-selected-first-cell-color:var(--st-amber-800);--st-resize-handle-color:var(--st-amber-300);--st-separator-border-color:var(--st-amber-200);--st-last-group-row-separator-border-color:var(--st-amber-500);--st-selected-border-top-color:var(--st-amber-700);--st-selected-border-bottom-color:var(--st-amber-700);--st-selected-border-left-color:var(--st-amber-700);--st-selected-border-right-color:var(--st-amber-700);--st-checkbox-checked-background-color:var(--st-amber-600);--st-checkbox-checked-border-color:var(--st-amber-600);--st-column-editor-background-color:var(--st-amber-100);--st-column-editor-popout-background-color:var(--st-amber-100);--st-button-hover-background-color:var(--st-amber-300);--st-button-active-background-color:var(--st-amber-600);--st-font-family:"Times New Roman",serif;--st-editable-cell-focus-border-color:var(--st-amber-700)}.theme-bubblegum{--st-border-radius:16px;--st-border-width:2px;--st-cell-padding:12px;--st-font-size:1rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:8px;--st-spacing-medium:12px;--st-spacing-large:24px;--st-scrollbar-bg-color:var(--st-pink-50);--st-scrollbar-thumb-color:var(--st-pink-300);--st-border-color:var(--st-pink-500);--st-odd-row-background-color:var(--st-pink-50);--st-even-row-background-color:var(--st-pink-100);--st-header-background-color:var(--st-pink-200);--st-dragging-background-color:var(--st-pink-300);--st-selected-cell-background-color:var(--st-pink-400);--st-selected-first-cell-background-color:var(--st-pink-300);--st-footer-background-color:var(--st-pink-50);--st-cell-color:var(--st-pink-900);--st-cell-odd-row-color:var(--st-pink-800);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-pink-900);--st-selected-first-cell-color:var(--st-pink-900);--st-resize-handle-color:var(--st-pink-400);--st-separator-border-color:var(--st-pink-200);--st-last-group-row-separator-border-color:var(--st-pink-500);--st-selected-border-top-color:var(--st-pink-700);--st-selected-border-bottom-color:var(--st-pink-700);--st-selected-border-left-color:var(--st-pink-700);--st-selected-border-right-color:var(--st-pink-700);--st-checkbox-checked-background-color:var(--st-pink-500);--st-checkbox-checked-border-color:var(--st-pink-500);--st-column-editor-background-color:var(--st-pink-100);--st-column-editor-popout-background-color:var(--st-pink-100);--st-button-hover-background-color:var(--st-pink-300);--st-button-active-background-color:var(--st-pink-400);--st-font-family:"Pacifico",cursive;--st-editable-cell-focus-border-color:var(--st-pink-600)}.theme-90s{--st-border-radius:0;--st-border-width:2px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:700;--st-transition-duration:0.1s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-gray-200);--st-scrollbar-thumb-color:var(--st-gray-400);--st-border-color:var(--st-gray-500);--st-odd-row-background-color:var(--st-gray-100);--st-even-row-background-color:var(--st-gray-200);--st-header-background-color:var(--st-gray-300);--st-dragging-background-color:var(--st-gray-400);--st-selected-cell-background-color:var(--st-gray-500);--st-selected-first-cell-background-color:var(--st-gray-400);--st-footer-background-color:var(--st-gray-100);--st-cell-color:var(--st-gray-900);--st-cell-odd-row-color:var(--st-gray-800);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-gray-900);--st-selected-first-cell-color:var(--st-gray-900);--st-resize-handle-color:var(--st-gray-400);--st-separator-border-color:var(--st-gray-200);--st-last-group-row-separator-border-color:var(--st-gray-500);--st-selected-border-top-color:var(--st-gray-700);--st-selected-border-bottom-color:var(--st-gray-700);--st-selected-border-left-color:var(--st-gray-700);--st-selected-border-right-color:var(--st-gray-700);--st-checkbox-checked-background-color:var(--st-gray-500);--st-checkbox-checked-border-color:var(--st-gray-500);--st-column-editor-background-color:var(--st-gray-200);--st-column-editor-popout-background-color:var(--st-gray-200);--st-button-hover-background-color:var(--st-gray-300);--st-button-active-background-color:var(--st-gray-400);--st-font-family:"Courier New",monospace;--st-editable-cell-focus-border-color:var(--st-gray-600)}.simple-table-root,.st-cell,.st-column-editor,.st-column-editor-popout,.st-footer,.st-header-cell,.st-header-container,.st-horizontal-scrollbar-container,.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-middle,.st-horizontal-scrollbar-right,.st-table-body-container,.st-table-body-main,.st-table-body-pinned-left,.st-table-body-pinned-right,.st-table-content,.st-table-wrapper,.st-table-wrapper-container,.st-wrapper{box-sizing:border-box;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:var(--st-font-family,sans-serif)}.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-container{display:flex;flex-direction:column;height:100%;position:relative;width:100%}.st-table-wrapper{display:flex;flex:1;min-height:0;position:relative;width:100%}.st-table-content{display:flex;flex-direction:column}.st-header-container{display:flex}.st-header-container.st-header-scroll-padding:after{background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);content:"";display:block;flex-shrink:0;width:var(--st-after-width,default-width)}.st-header-main,.st-header-pinned-left,.st-header-pinned-right{display:grid}.st-header-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-header-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-header-main{overflow:auto;scrollbar-width:none;width:100%}.st-header-main::-webkit-scrollbar{display:none}.st-table-body-container{display:flex;height:max-content;overflow:auto;width:100%}.st-table-body-main,.st-table-body-pinned-left,.st-table-body-pinned-right{display:grid;height:max-content}.st-table-body-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-table-body-main{overflow:auto;scrollbar-width:none}.st-table-body-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-table-row{display:grid;position:absolute;transform:translateZ(0);transition:background .2s ease;width:100%}.st-header-cell{align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);border-top:var(--st-border-width) solid #0000;display:flex;font-weight:var(--st-font-weight-bold);gap:var(--st-spacing-small);position:sticky;top:0;z-index:1}.st-header-cell.clickable{cursor:pointer}.st-header-cell.draggable{cursor:grab}.st-cell,.st-header-cell{align-items:center;color:var(--st-slate-800);display:flex;gap:var(--st-spacing-small);overflow:hidden}.st-cell.right-aligned,.st-header-cell.right-aligned{justify-content:flex-end;text-align:right}.st-cell.right-aligned>.st-cell-content,.st-header-cell.right-aligned>.st-header-label{text-align:right}.st-cell.center-aligned,.st-header-cell.center-aligned{justify-content:center;text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label{text-align:center}.st-cell.clickable{cursor:pointer}.st-cell,.st-cell-editing,.st-header-cell{height:100%;width:100%}.st-cell-editing{position:relative}.st-header-label{align-items:center;display:flex}.st-header-label.right-aligned{justify-content:flex-end;text-align:right}.st-header-label.left-aligned{justify-content:flex-start;text-align:left}.st-header-label.center-aligned{justify-content:center;text-align:center}.st-cell-content,.st-header-label{align-items:center;box-sizing:border-box;color:var(--st-cell-color);display:flex;flex:1;height:100%;overflow:hidden;padding-left:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;user-select:none;white-space:nowrap;width:100%}.st-header-label{padding-right:var(--st-cell-padding)}.st-cell-content{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width))}.st-cell-content.right-aligned{justify-content:flex-end;text-align:right}.st-cell-content.left-aligned{justify-content:flex-start;text-align:left}.st-cell-content.center-aligned{justify-content:center;text-align:center}.st-cell{border:var(--st-border-width) solid #0000;position:relative}.st-cell-depth-1{padding-left:calc(var(--st-cell-padding)*4)}.st-cell-depth-2{padding-left:calc(var(--st-cell-padding)*8)}.st-cell-depth-3{padding-left:calc(var(--st-cell-padding)*12)}.st-cell-depth-4{padding-left:calc(var(--st-cell-padding)*16)}.st-cell-depth-5{padding-left:calc(var(--st-cell-padding)*20)}.st-cell-depth-6{padding-left:calc(var(--st-cell-padding)*24)}.st-cell-depth-7{padding-left:calc(var(--st-cell-padding)*28)}.st-sort-icon-container{align-items:center;display:flex;justify-content:center;margin-left:4px}.st-sort-icon{fill:var(--st-slate-500)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);cursor:col-resize;height:12px;right:0;top:0;width:var(--st-resize-handle-width)}.st-row-separator{background-color:var(--st-separator-border-color);grid-column:1/-1;height:1px}.st-row-separator.st-last-group-row{background-color:var(--st-last-group-row-separator-border-color)}.st-cell-even-row{background-color:var(--st-even-row-background-color)}.st-cell-odd-row:not(.st-cell-selected){background-color:var(--st-odd-row-background-color);color:var(--st-cell-odd-row-color)}.st-cell:not(.st-cell-odd-row):not(.st-cell-selected){color:var(--st-cell-color)}.st-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color);border-left:var(--st-border-width) solid var(--st-selected-border-left-color);border-right:var(--st-border-width) solid var(--st-selected-border-right-color);color:var(--st-selected-first-cell-color)}.st-cell-selected-first,.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-top-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-left-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-right-color)}.st-horizontal-scrollbar-container{align-items:center;border-top:var(--st-border-width) solid var(--st-border-color);display:flex;flex-shrink:0}.st-horizontal-scrollbar-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-right{background-color:var(--st-scrollbar-bg-color);height:100%}.st-horizontal-scrollbar-middle{overflow:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);padding:var(--st-spacing-medium)}.st-footer,.st-next-prev-btn{align-items:center;display:flex}.st-next-prev-btn{fill:var(--st-slate-600);background-color:initial;border:none;border-radius:var(--st-border-radius);cursor:pointer;justify-content:center;padding:var(--st-spacing-small);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.disabled>.st-next-prev-icon{fill:var(--st-slate-400);cursor:not-allowed}.st-next-prev-btn:not(.disabled):hover{background-color:var(--st-slate-100)}.st-page-btn{background-color:initial;border:none;border-radius:var(--st-border-radius);color:var(--st-slate-600);cursor:pointer;margin-left:var(--st-spacing-small);padding:var(--st-spacing-small);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-page-btn:hover{background-color:var(--st-button-hover-background-color)}.st-page-btn.active{background-color:var(--st-button-active-background-color);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-edit-cell-shadow-color);box-sizing:border-box;font-size:var(--st-font-size);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(--st-editable-cell-focus-border-color)}.st-column-editor{background:var(--st-footer-background-color);border-left:var(--st-border-width) solid var(--st-border-color);color:var(--st-slate-500);cursor:pointer;flex-shrink:0;position:relative;user-select:none}.st-column-editor-text{padding:var(--st-spacing-medium) var(--st-spacing-small);writing-mode:vertical-rl;z-index:2}.st-column-editor.open,.st-column-editor.open .st-column-editor-text{background-color:var(--st-column-editor-background-color)}.st-column-editor-popout{background-color:var(--st-column-editor-popout-background-color);height:100%;overflow:hidden;position:absolute;right:calc(100% + 1px);top:0;transition:width var(--st-transition-duration) var(--st-transition-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:var(--st-spacing-small);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small)}.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:var(--st-spacing-medium)}.st-checkbox-input{display:none}.st-checkbox-custom{align-items:center;background-color:#fff;border:var(--st-border-width) solid var(--st-slate-300);border-radius:var(--st-border-radius);display:flex;height:24px;justify-content:center;transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);width:24px}.st-checkbox-custom.st-checked{background-color:var(--st-checkbox-checked-background-color);border-color:var(--st-checkbox-checked-border-color)}.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)}}.st-group-header{align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);color:var(--st-cell-color);cursor:pointer;display:flex;font-weight:var(--st-font-weight-bold);height:40px;transition:background-color var(--st-transition-duration) var(--st-transition-ease);user-select:none}.st-group-header:hover{background-color:var(--st-button-hover-background-color)}.st-group-header-content{align-items:center;display:flex;gap:var(--st-spacing-medium)}.st-group-toggle-icon{align-items:center;display:flex;font-size:.8em;height:16px;justify-content:center;width:16px}.st-group-name{font-weight:var(--st-font-weight-bold)}.st-group-count{color:var(--st-cell-odd-row-color);font-size:.9em}.st-group-header.expanded .st-group-toggle-icon{transform:rotate(0deg);transition:transform var(--st-transition-duration) var(--st-transition-ease)}.st-group-header.collapsed .st-group-toggle-icon{transform:rotate(-90deg);transition:transform var(--st-transition-duration) var(--st-transition-ease)}
|
|
1
|
+
.simple-table-root{--st-after-width:11.01px;--st-resize-handle-width:2px;--st-resize-handle-margin-right:2px;--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:1rem;--st-font-weight-normal:400;--st-font-weight-bold:700;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:#0000;--st-scrollbar-thumb-color:var(--st-slate-200);--st-white:#fff;--st-black:#000;--st-slate-50:#f8fafc;--st-slate-100:#f1f5f9;--st-slate-200:#e2e8f0;--st-slate-300:#cbd5e1;--st-slate-400:#94a3b8;--st-slate-500:#64748b;--st-slate-600:#475569;--st-slate-700:#334155;--st-slate-800:#1e293b;--st-slate-900:#0f172a;--st-slate-950:#020617;--st-gray-50:#f9fafb;--st-gray-100:#f3f4f6;--st-gray-200:#e5e7eb;--st-gray-300:#d1d5db;--st-gray-400:#9ca3af;--st-gray-500:#6b7280;--st-gray-600:#4b5563;--st-gray-700:#374151;--st-gray-800:#1f2937;--st-gray-900:#111827;--st-gray-950:#030712;--st-zinc-50:#fafafa;--st-zinc-100:#f4f4f5;--st-zinc-200:#e4e4e7;--st-zinc-300:#d4d4d8;--st-zinc-400:#a1a1aa;--st-zinc-500:#71717a;--st-zinc-600:#52525b;--st-zinc-700:#3f3f46;--st-zinc-800:#27272a;--st-zinc-900:#18181b;--st-zinc-950:#09090b;--st-neutral-50:#fafafa;--st-neutral-100:#f5f5f5;--st-neutral-200:#e5e5e5;--st-neutral-300:#d4d4d4;--st-neutral-400:#a3a3a3;--st-neutral-500:#737373;--st-neutral-600:#525252;--st-neutral-700:#404040;--st-neutral-800:#262626;--st-neutral-900:#171717;--st-neutral-950:#0a0a0a;--st-stone-50:#fafaf9;--st-stone-100:#f5f5f4;--st-stone-200:#e7e5e4;--st-stone-300:#d6d3d1;--st-stone-400:#a8a29e;--st-stone-500:#78716c;--st-stone-600:#57534e;--st-stone-700:#44403c;--st-stone-800:#292524;--st-stone-900:#1c1917;--st-stone-950:#0c0a09;--st-red-50:#fef2f2;--st-red-100:#fee2e2;--st-red-200:#fecaca;--st-red-300:#fca5a5;--st-red-400:#f87171;--st-red-500:#ef4444;--st-red-600:#dc2626;--st-red-700:#b91c1c;--st-red-800:#991b1b;--st-red-900:#7f1d1d;--st-red-950:#450a0a;--st-orange-50:#fff7ed;--st-orange-100:#ffedd5;--st-orange-200:#fed7aa;--st-orange-300:#fdba74;--st-orange-400:#fb923c;--st-orange-500:#f97316;--st-orange-600:#ea580c;--st-orange-700:#c2410c;--st-orange-800:#9a3412;--st-orange-900:#7c2d12;--st-orange-950:#431407;--st-amber-50:#fffbeb;--st-amber-100:#fef3c7;--st-amber-200:#fde68a;--st-amber-300:#fcd34d;--st-amber-400:#fbbf24;--st-amber-500:#f59e0b;--st-amber-600:#d97706;--st-amber-700:#b45309;--st-amber-800:#92400e;--st-amber-900:#78350f;--st-amber-950:#451a03;--st-yellow-50:#fefce8;--st-yellow-100:#fef9c3;--st-yellow-200:#fef08a;--st-yellow-300:#fde047;--st-yellow-400:#facc15;--st-yellow-500:#eab308;--st-yellow-600:#ca8a04;--st-yellow-700:#a16207;--st-yellow-800:#854d0e;--st-yellow-900:#713f12;--st-yellow-950:#422006;--st-lime-50:#f7fee7;--st-lime-100:#ecfccb;--st-lime-200:#d9f99d;--st-lime-300:#bef264;--st-lime-400:#a3e635;--st-lime-500:#84cc16;--st-lime-600:#65a30d;--st-lime-700:#4d7c0f;--st-lime-800:#3f6212;--st-lime-900:#365314;--st-lime-950:#1a2e05;--st-green-50:#f0fdf4;--st-green-100:#dcfce7;--st-green-200:#bbf7d0;--st-green-300:#86efac;--st-green-400:#4ade80;--st-green-500:#22c55e;--st-green-600:#16a34a;--st-green-700:#15803d;--st-green-800:#166534;--st-green-900:#14532d;--st-green-950:#052e16;--st-emerald-50:#ecfdf5;--st-emerald-100:#d1fae5;--st-emerald-200:#a7f3d0;--st-emerald-300:#6ee7b7;--st-emerald-400:#34d399;--st-emerald-500:#10b981;--st-emerald-600:#059669;--st-emerald-700:#047857;--st-emerald-800:#065f46;--st-emerald-900:#064e3b;--st-emerald-950:#022c22;--st-teal-50:#f0fdfa;--st-teal-100:#ccfbf1;--st-teal-200:#99f6e4;--st-teal-300:#5eead4;--st-teal-400:#2dd4bf;--st-teal-500:#14b8a6;--st-teal-600:#0d9488;--st-teal-700:#0f766e;--st-teal-800:#115e59;--st-teal-900:#134e4a;--st-teal-950:#042f2e;--st-cyan-50:#ecfeff;--st-cyan-100:#cffafe;--st-cyan-200:#a5f3fc;--st-cyan-300:#67e8f9;--st-cyan-400:#22d3ee;--st-cyan-500:#06b6d4;--st-cyan-600:#0891b2;--st-cyan-700:#0e7490;--st-cyan-800:#155e75;--st-cyan-900:#164e63;--st-cyan-950:#083344;--st-sky-50:#f0f9ff;--st-sky-100:#e0f2fe;--st-sky-200:#bae6fd;--st-sky-300:#7dd3fc;--st-sky-400:#38bdf8;--st-sky-500:#0ea5e9;--st-sky-600:#0284c7;--st-sky-700:#0369a1;--st-sky-800:#075985;--st-sky-900:#0c4a6e;--st-sky-950:#082f49;--st-blue-50:#eff6ff;--st-blue-100:#dbeafe;--st-blue-200:#bfdbfe;--st-blue-300:#93c5fd;--st-blue-400:#60a5fa;--st-blue-500:#3b82f6;--st-blue-600:#2563eb;--st-blue-700:#1d4ed8;--st-blue-800:#1e40af;--st-blue-900:#1e3a8a;--st-blue-950:#172554;--st-indigo-50:#eef2ff;--st-indigo-100:#e0e7ff;--st-indigo-200:#c7d2fe;--st-indigo-300:#a5b4fc;--st-indigo-400:#818cf8;--st-indigo-500:#6366f1;--st-indigo-600:#4f46e5;--st-indigo-700:#4338ca;--st-indigo-800:#3730a3;--st-indigo-900:#312e81;--st-indigo-950:#1e1b4b;--st-violet-50:#f5f3ff;--st-violet-100:#ede9fe;--st-violet-200:#ddd6fe;--st-violet-300:#c4b5fd;--st-violet-400:#a78bfa;--st-violet-500:#8b5cf6;--st-violet-600:#7c3aed;--st-violet-700:#6d28d9;--st-violet-800:#5b21b6;--st-violet-900:#4c1d95;--st-violet-950:#2e1065;--st-purple-50:#faf5ff;--st-purple-100:#f3e8ff;--st-purple-200:#e9d5ff;--st-purple-300:#d8b4fe;--st-purple-400:#c084fc;--st-purple-500:#a855f7;--st-purple-600:#9333ea;--st-purple-700:#7e22ce;--st-purple-800:#6b21a8;--st-purple-900:#581c87;--st-purple-950:#3b0764;--st-fuchsia-50:#fdf4ff;--st-fuchsia-100:#fae8ff;--st-fuchsia-200:#f5d0fe;--st-fuchsia-300:#f0abfc;--st-fuchsia-400:#e879f9;--st-fuchsia-500:#d946ef;--st-fuchsia-600:#c026d3;--st-fuchsia-700:#a21caf;--st-fuchsia-800:#86198f;--st-fuchsia-900:#701a75;--st-fuchsia-950:#4a044e;--st-pink-50:#fdf2f8;--st-pink-100:#fce7f3;--st-pink-200:#fbcfe8;--st-pink-300:#f9a8d4;--st-pink-400:#f472b6;--st-pink-500:#ec4899;--st-pink-600:#db2777;--st-pink-700:#be185d;--st-pink-800:#9d174d;--st-pink-900:#831843;--st-pink-950:#500724;--st-rose-50:#fff1f2;--st-rose-100:#ffe4e6;--st-rose-200:#fecdd3;--st-rose-300:#fda4af;--st-rose-400:#fb7185;--st-rose-500:#f43f5e;--st-rose-600:#e11d48;--st-rose-700:#be123c;--st-rose-800:#9f1239;--st-rose-900:#881337;--st-rose-950:#4c0519}.theme-light{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-slate-50);--st-scrollbar-thumb-color:var(--st-slate-300);--st-border-color:var(--st-gray-300);--st-odd-row-background-color:var(--st-white);--st-even-row-background-color:var(--st-white);--st-header-background-color:var(--st-white);--st-dragging-background-color:var(--st-gray-200);--st-selected-cell-background-color:var(--st-blue-200);--st-selected-first-cell-background-color:var(--st-blue-100);--st-footer-background-color:var(--st-white);--st-cell-color:var(--st-gray-800);--st-cell-odd-row-color:var(--st-gray-700);--st-edit-cell-shadow:0 1px 2px 0 #0000000d,0 1px 1px -1px #0000000d;--st-selected-cell-color:var(--st-gray-900);--st-selected-first-cell-color:var(--st-gray-900);--st-resize-handle-color:var(--st-blue-300);--st-separator-border-color:var(--st-slate-100);--st-last-group-row-separator-border-color:var(--st-slate-300);--st-selected-border-top-color:var(--st-blue-600);--st-selected-border-bottom-color:var(--st-blue-600);--st-selected-border-left-color:var(--st-blue-600);--st-selected-border-right-color:var(--st-blue-600);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-gray-200);--st-button-active-background-color:var(--st-blue-800);--st-font-family:"Roboto",sans-serif;--st-editable-cell-focus-border-color:var(--st-blue-600)}.theme-dark{--st-border-radius:6px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-slate-800);--st-scrollbar-thumb-color:var(--st-slate-600);--st-border-color:var(--st-slate-800);--st-odd-row-background-color:var(--st-slate-800);--st-even-row-background-color:var(--st-slate-900);--st-header-background-color:var(--st-slate-700);--st-dragging-background-color:var(--st-blue-800);--st-selected-cell-background-color:var(--st-blue-900);--st-selected-first-cell-background-color:var(--st-blue-800);--st-footer-background-color:var(--st-slate-900);--st-cell-color:var(--st-white);--st-cell-odd-row-color:var(--st-slate-300);--st-edit-cell-shadow:0 1px 3px 0 var(--st-white/0.1),0 1px 2px -1px var(--st-white/0.1);--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-slate-600);--st-separator-border-color:var(--st-slate-500);--st-last-group-row-separator-border-color:var(--st-slate-700);--st-selected-border-top-color:var(--st-blue-400);--st-selected-border-bottom-color:var(--st-blue-400);--st-selected-border-left-color:var(--st-blue-400);--st-selected-border-right-color:var(--st-blue-400);--st-checkbox-checked-background-color:var(--st-blue-700);--st-checkbox-checked-border-color:var(--st-blue-700);--st-column-editor-background-color:var(--st-slate-800);--st-column-editor-popout-background-color:var(--st-slate-800);--st-button-hover-background-color:var(--st-slate-600);--st-button-active-background-color:var(--st-slate-700);--st-font-family:"Open Sans",sans-serif;--st-editable-cell-focus-border-color:var(--st-slate-600)}.theme-high-contrast{--st-border-radius:0;--st-border-width:2px;--st-cell-padding:12px;--st-font-size:1rem;--st-font-weight-normal:500;--st-font-weight-bold:800;--st-transition-duration:0s;--st-transition-ease:ease;--st-opacity-disabled:0.7;--st-spacing-small:8px;--st-spacing-medium:12px;--st-spacing-large:24px;--st-scrollbar-bg-color:var(--st-slate-950);--st-scrollbar-thumb-color:var(--st-slate-200);--st-border-color:var(--st-slate-900);--st-odd-row-background-color:var(--st-slate-400);--st-even-row-background-color:var(--st-slate-900);--st-header-background-color:var(--st-slate-900);--st-dragging-background-color:var(--st-yellow-500);--st-selected-cell-background-color:var(--st-slate-900);--st-selected-first-cell-background-color:var(--st-red-500);--st-footer-background-color:var(--st-slate-900);--st-cell-color:var(--st-white);--st-cell-odd-row-color:var(--st-slate-900);--st-edit-cell-shadow:none;--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-white);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-900);--st-selected-border-top-color:var(--st-orange-600);--st-selected-border-bottom-color:var(--st-orange-600);--st-selected-border-left-color:var(--st-orange-600);--st-selected-border-right-color:var(--st-orange-600);--st-checkbox-checked-background-color:var(--st-slate-50);--st-checkbox-checked-border-color:var(--st-slate-50);--st-column-editor-background-color:var(--st-slate-900);--st-column-editor-popout-background-color:var(--st-slate-900);--st-button-hover-background-color:var(--st-slate-50);--st-button-active-background-color:var(--st-slate-900);--st-font-family:"Arial",sans-serif;--st-editable-cell-focus-border-color:var(--st-orange-600)}.theme-pastel{--st-border-radius:8px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.9rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-purple-100);--st-scrollbar-thumb-color:var(--st-purple-300);--st-border-color:var(--st-purple-200);--st-odd-row-background-color:var(--st-purple-50);--st-even-row-background-color:var(--st-blue-50);--st-header-background-color:var(--st-blue-50);--st-dragging-background-color:var(--st-cyan-50);--st-selected-cell-background-color:var(--st-orange-50);--st-selected-first-cell-background-color:var(--st-amber-50);--st-footer-background-color:var(--st-purple-50);--st-cell-color:var(--st-slate-600);--st-cell-odd-row-color:var(--st-slate-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-slate-600);--st-selected-first-cell-color:var(--st-slate-600);--st-resize-handle-color:var(--st-purple-200);--st-separator-border-color:var(--st-purple-200);--st-last-group-row-separator-border-color:var(--st-purple-500);--st-selected-border-top-color:var(--st-amber-500);--st-selected-border-bottom-color:var(--st-amber-500);--st-selected-border-left-color:var(--st-amber-500);--st-selected-border-right-color:var(--st-amber-500);--st-checkbox-checked-background-color:var(--st-purple-200);--st-checkbox-checked-border-color:var(--st-purple-200);--st-column-editor-background-color:var(--st-purple-50);--st-column-editor-popout-background-color:var(--st-purple-50);--st-button-hover-background-color:var(--st-purple-100);--st-button-active-background-color:var(--st-purple-200);--st-font-family:"Comic Sans MS",cursive,sans-serif;--st-editable-cell-focus-border-color:var(--st-purple-300)}.theme-vibrant{--st-border-radius:12px;--st-border-width:2px;--st-cell-padding:12px;--st-font-size:1rem;--st-font-weight-normal:500;--st-font-weight-bold:700;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:8px;--st-spacing-medium:12px;--st-spacing-large:24px;--st-scrollbar-bg-color:var(--st-orange-200);--st-scrollbar-thumb-color:var(--st-orange-300);--st-border-color:var(--st-orange-500);--st-odd-row-background-color:var(--st-orange-100);--st-even-row-background-color:var(--st-orange-200);--st-header-background-color:var(--st-orange-300);--st-dragging-background-color:var(--st-blue-300);--st-selected-cell-background-color:var(--st-blue-400);--st-selected-first-cell-background-color:var(--st-amber-300);--st-footer-background-color:var(--st-orange-50);--st-cell-color:var(--st-orange-900);--st-cell-odd-row-color:var(--st-orange-800);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.2),0 1px 2px -1px var(--st-black/0.2);--st-selected-cell-color:var(--st-orange-900);--st-selected-first-cell-color:var(--st-orange-900);--st-resize-handle-color:var(--st-orange-400);--st-separator-border-color:var(--st-orange-200);--st-last-group-row-separator-border-color:var(--st-orange-500);--st-selected-border-top-color:var(--st-orange-700);--st-selected-border-bottom-color:var(--st-orange-700);--st-selected-border-left-color:var(--st-orange-700);--st-selected-border-right-color:var(--st-orange-700);--st-checkbox-checked-background-color:var(--st-orange-500);--st-checkbox-checked-border-color:var(--st-orange-500);--st-column-editor-background-color:var(--st-orange-100);--st-column-editor-popout-background-color:var(--st-orange-100);--st-button-hover-background-color:var(--st-orange-300);--st-button-active-background-color:var(--st-orange-400);--st-font-family:"Lobster",cursive;--st-editable-cell-focus-border-color:var(--st-orange-600)}.theme-solarized-light{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-yellow-100);--st-scrollbar-thumb-color:var(--st-yellow-300);--st-border-color:var(--st-yellow-300);--st-odd-row-background-color:var(--st-yellow-50);--st-even-row-background-color:var(--st-yellow-200);--st-header-background-color:var(--st-yellow-200);--st-dragging-background-color:var(--st-yellow-300);--st-selected-cell-background-color:var(--st-slate-400);--st-selected-first-cell-background-color:var(--st-slate-300);--st-footer-background-color:var(--st-yellow-50);--st-cell-color:var(--st-slate-600);--st-cell-odd-row-color:var(--st-slate-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-slate-600);--st-selected-first-cell-color:var(--st-slate-600);--st-resize-handle-color:var(--st-slate-400);--st-separator-border-color:var(--st-yellow-300);--st-last-group-row-separator-border-color:var(--st-yellow-500);--st-selected-border-top-color:var(--st-yellow-600);--st-selected-border-bottom-color:var(--st-yellow-600);--st-selected-border-left-color:var(--st-yellow-600);--st-selected-border-right-color:var(--st-yellow-600);--st-checkbox-checked-background-color:var(--st-slate-400);--st-checkbox-checked-border-color:var(--st-slate-400);--st-column-editor-background-color:var(--st-yellow-200);--st-column-editor-popout-background-color:var(--st-yellow-200);--st-button-hover-background-color:var(--st-yellow-200);--st-button-active-background-color:var(--st-slate-400);--st-font-family:"Georgia",serif;--st-editable-cell-focus-border-color:var(--st-yellow-400)}.theme-solarized-dark{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-slate-800);--st-scrollbar-thumb-color:var(--st-slate-600);--st-border-color:var(--st-slate-800);--st-odd-row-background-color:var(--st-slate-900);--st-even-row-background-color:var(--st-slate-800);--st-header-background-color:var(--st-slate-800);--st-dragging-background-color:var(--st-slate-800);--st-selected-cell-background-color:var(--st-slate-600);--st-selected-first-cell-background-color:var(--st-slate-500);--st-footer-background-color:var(--st-slate-900);--st-cell-color:var(--st-slate-300);--st-cell-odd-row-color:var(--st-slate-400);--st-edit-cell-shadow:0 1px 3px 0 var(--st-white/0.1),0 1px 2px -1px var(--st-white/0.1);--st-selected-cell-color:var(--st-slate-300);--st-selected-first-cell-color:var(--st-slate-300);--st-resize-handle-color:var(--st-slate-600);--st-separator-border-color:var(--st-slate-400);--st-last-group-row-separator-border-color:var(--st-slate-600);--st-selected-border-top-color:var(--st-blue-800);--st-selected-border-bottom-color:var(--st-blue-800);--st-selected-border-left-color:var(--st-blue-800);--st-selected-border-right-color:var(--st-blue-800);--st-checkbox-checked-background-color:var(--st-slate-600);--st-checkbox-checked-border-color:var(--st-slate-600);--st-column-editor-background-color:var(--st-slate-800);--st-column-editor-popout-background-color:var(--st-slate-800);--st-button-hover-background-color:var(--st-slate-600);--st-button-active-background-color:var(--st-slate-800);--st-font-family:"Courier New",monospace;--st-editable-cell-focus-border-color:var(--st-blue-800)}.theme-ocean{--st-border-radius:6px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.9rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-cyan-100);--st-scrollbar-thumb-color:var(--st-cyan-300);--st-border-color:var(--st-cyan-700);--st-odd-row-background-color:var(--st-cyan-50);--st-even-row-background-color:var(--st-cyan-100);--st-header-background-color:var(--st-cyan-100);--st-dragging-background-color:var(--st-cyan-300);--st-selected-cell-background-color:var(--st-cyan-700);--st-selected-first-cell-background-color:var(--st-cyan-600);--st-footer-background-color:var(--st-cyan-50);--st-cell-color:var(--st-slate-900);--st-cell-odd-row-color:var(--st-cyan-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-slate-900);--st-selected-first-cell-color:var(--st-slate-900);--st-resize-handle-color:var(--st-cyan-300);--st-separator-border-color:var(--st-cyan-200);--st-last-group-row-separator-border-color:var(--st-cyan-500);--st-selected-border-top-color:var(--st-blue-700);--st-selected-border-bottom-color:var(--st-blue-700);--st-selected-border-left-color:var(--st-blue-700);--st-selected-border-right-color:var(--st-blue-700);--st-checkbox-checked-background-color:var(--st-cyan-700);--st-checkbox-checked-border-color:var(--st-cyan-700);--st-column-editor-background-color:var(--st-cyan-100);--st-column-editor-popout-background-color:var(--st-cyan-100);--st-button-hover-background-color:var(--st-cyan-300);--st-button-active-background-color:var(--st-cyan-700);--st-font-family:"Verdana",sans-serif;--st-editable-cell-focus-border-color:var(--st-cyan-500)}.theme-forest{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-green-100);--st-scrollbar-thumb-color:var(--st-green-400);--st-border-color:var(--st-green-800);--st-odd-row-background-color:var(--st-green-50);--st-even-row-background-color:var(--st-green-100);--st-header-background-color:var(--st-green-100);--st-dragging-background-color:var(--st-green-400);--st-selected-cell-background-color:var(--st-green-700);--st-selected-first-cell-background-color:var(--st-green-600);--st-footer-background-color:var(--st-green-50);--st-cell-color:var(--st-green-900);--st-cell-odd-row-color:var(--st-green-700);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-green-900);--st-selected-first-cell-color:var(--st-green-900);--st-resize-handle-color:var(--st-green-400);--st-separator-border-color:var(--st-green-200);--st-last-group-row-separator-border-color:var(--st-green-500);--st-selected-border-top-color:var(--st-green-600);--st-selected-border-bottom-color:var(--st-green-600);--st-selected-border-left-color:var(--st-green-600);--st-selected-border-right-color:var(--st-green-600);--st-checkbox-checked-background-color:var(--st-green-700);--st-checkbox-checked-border-color:var(--st-green-700);--st-column-editor-background-color:var(--st-green-100);--st-column-editor-popout-background-color:var(--st-green-100);--st-button-hover-background-color:var(--st-green-400);--st-button-active-background-color:var(--st-green-700);--st-font-family:"Tahoma",sans-serif;--st-editable-cell-focus-border-color:var(--st-green-600)}.theme-desert{--st-border-radius:8px;--st-border-width:1px;--st-cell-padding:10px;--st-font-size:0.9rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-amber-100);--st-scrollbar-thumb-color:var(--st-amber-300);--st-border-color:var(--st-amber-600);--st-odd-row-background-color:var(--st-amber-50);--st-even-row-background-color:var(--st-amber-100);--st-header-background-color:var(--st-amber-100);--st-dragging-background-color:var(--st-amber-300);--st-selected-cell-background-color:var(--st-amber-600);--st-selected-first-cell-background-color:var(--st-amber-500);--st-footer-background-color:var(--st-amber-50);--st-cell-color:var(--st-amber-800);--st-cell-odd-row-color:var(--st-amber-600);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-amber-800);--st-selected-first-cell-color:var(--st-amber-800);--st-resize-handle-color:var(--st-amber-300);--st-separator-border-color:var(--st-amber-200);--st-last-group-row-separator-border-color:var(--st-amber-500);--st-selected-border-top-color:var(--st-amber-700);--st-selected-border-bottom-color:var(--st-amber-700);--st-selected-border-left-color:var(--st-amber-700);--st-selected-border-right-color:var(--st-amber-700);--st-checkbox-checked-background-color:var(--st-amber-600);--st-checkbox-checked-border-color:var(--st-amber-600);--st-column-editor-background-color:var(--st-amber-100);--st-column-editor-popout-background-color:var(--st-amber-100);--st-button-hover-background-color:var(--st-amber-300);--st-button-active-background-color:var(--st-amber-600);--st-font-family:"Times New Roman",serif;--st-editable-cell-focus-border-color:var(--st-amber-700)}.theme-bubblegum{--st-border-radius:16px;--st-border-width:2px;--st-cell-padding:12px;--st-font-size:1rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:8px;--st-spacing-medium:12px;--st-spacing-large:24px;--st-scrollbar-bg-color:var(--st-pink-50);--st-scrollbar-thumb-color:var(--st-pink-300);--st-border-color:var(--st-pink-500);--st-odd-row-background-color:var(--st-pink-50);--st-even-row-background-color:var(--st-pink-100);--st-header-background-color:var(--st-pink-200);--st-dragging-background-color:var(--st-pink-300);--st-selected-cell-background-color:var(--st-pink-400);--st-selected-first-cell-background-color:var(--st-pink-300);--st-footer-background-color:var(--st-pink-50);--st-cell-color:var(--st-pink-900);--st-cell-odd-row-color:var(--st-pink-800);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-pink-900);--st-selected-first-cell-color:var(--st-pink-900);--st-resize-handle-color:var(--st-pink-400);--st-separator-border-color:var(--st-pink-200);--st-last-group-row-separator-border-color:var(--st-pink-500);--st-selected-border-top-color:var(--st-pink-700);--st-selected-border-bottom-color:var(--st-pink-700);--st-selected-border-left-color:var(--st-pink-700);--st-selected-border-right-color:var(--st-pink-700);--st-checkbox-checked-background-color:var(--st-pink-500);--st-checkbox-checked-border-color:var(--st-pink-500);--st-column-editor-background-color:var(--st-pink-100);--st-column-editor-popout-background-color:var(--st-pink-100);--st-button-hover-background-color:var(--st-pink-300);--st-button-active-background-color:var(--st-pink-400);--st-font-family:"Pacifico",cursive;--st-editable-cell-focus-border-color:var(--st-pink-600)}.theme-90s{--st-border-radius:0;--st-border-width:2px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:700;--st-transition-duration:0.1s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-gray-200);--st-scrollbar-thumb-color:var(--st-gray-400);--st-border-color:var(--st-gray-500);--st-odd-row-background-color:var(--st-gray-100);--st-even-row-background-color:var(--st-gray-200);--st-header-background-color:var(--st-gray-300);--st-dragging-background-color:var(--st-gray-400);--st-selected-cell-background-color:var(--st-gray-500);--st-selected-first-cell-background-color:var(--st-gray-400);--st-footer-background-color:var(--st-gray-100);--st-cell-color:var(--st-gray-900);--st-cell-odd-row-color:var(--st-gray-800);--st-edit-cell-shadow:0 1px 3px 0 var(--st-black/0.1),0 1px 2px -1px var(--st-black/0.1);--st-selected-cell-color:var(--st-gray-900);--st-selected-first-cell-color:var(--st-gray-900);--st-resize-handle-color:var(--st-gray-400);--st-separator-border-color:var(--st-gray-200);--st-last-group-row-separator-border-color:var(--st-gray-500);--st-selected-border-top-color:var(--st-gray-700);--st-selected-border-bottom-color:var(--st-gray-700);--st-selected-border-left-color:var(--st-gray-700);--st-selected-border-right-color:var(--st-gray-700);--st-checkbox-checked-background-color:var(--st-gray-500);--st-checkbox-checked-border-color:var(--st-gray-500);--st-column-editor-background-color:var(--st-gray-200);--st-column-editor-popout-background-color:var(--st-gray-200);--st-button-hover-background-color:var(--st-gray-300);--st-button-active-background-color:var(--st-gray-400);--st-font-family:"Courier New",monospace;--st-editable-cell-focus-border-color:var(--st-gray-600)}.simple-table-root,.st-cell,.st-column-editor,.st-column-editor-popout,.st-footer,.st-header-cell,.st-header-container,.st-horizontal-scrollbar-container,.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-middle,.st-horizontal-scrollbar-right,.st-table-body-container,.st-table-body-main,.st-table-body-pinned-left,.st-table-body-pinned-right,.st-table-content,.st-table-wrapper,.st-table-wrapper-container,.st-wrapper{box-sizing:border-box;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:var(--st-font-family,sans-serif)}.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-container{display:flex;flex-direction:column;height:100%;position:relative;width:100%}.st-table-wrapper{display:flex;flex:1;min-height:0;position:relative;width:100%}.st-table-content{display:flex;flex-direction:column}.st-header-container{display:flex}.st-header-container.st-header-scroll-padding:after{background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);content:"";display:block;flex-shrink:0;width:var(--st-after-width,default-width)}.st-header-main,.st-header-pinned-left,.st-header-pinned-right{display:grid}.st-header-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-header-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-header-main{overflow:auto;scrollbar-width:none;width:100%}.st-header-main::-webkit-scrollbar{display:none}.st-table-body-container{display:flex;height:max-content;overflow:auto;width:100%}.st-table-body-main,.st-table-body-pinned-left,.st-table-body-pinned-right{display:grid;height:max-content}.st-table-body-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-table-body-main{overflow:auto;scrollbar-width:none}.st-table-body-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-table-row{display:grid;position:absolute;transform:translateZ(0);transition:background .2s ease;width:100%}.st-header-cell{align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);border-top:var(--st-border-width) solid #0000;display:flex;font-weight:var(--st-font-weight-bold);gap:var(--st-spacing-small);position:sticky;top:0;z-index:1}.st-header-cell.clickable{cursor:pointer}.st-header-cell.draggable{cursor:grab}.st-cell,.st-header-cell{align-items:center;color:var(--st-slate-800);display:flex;gap:var(--st-spacing-small);overflow:hidden}.st-cell.right-aligned,.st-header-cell.right-aligned{justify-content:flex-end;text-align:right}.st-cell.right-aligned>.st-cell-content,.st-header-cell.right-aligned>.st-header-label{text-align:right}.st-cell.center-aligned,.st-header-cell.center-aligned{justify-content:center;text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label{text-align:center}.st-cell.clickable{cursor:pointer}.st-cell,.st-cell-editing,.st-header-cell{height:100%;width:100%}.st-cell-editing{position:relative}.st-header-label{align-items:center;display:flex}.st-header-label.right-aligned{justify-content:flex-end;text-align:right}.st-header-label.left-aligned{justify-content:flex-start;text-align:left}.st-header-label.center-aligned{justify-content:center;text-align:center}.st-cell-content,.st-header-label{align-items:center;box-sizing:border-box;color:var(--st-cell-color);display:flex;flex:1;height:100%;overflow:hidden;padding-left:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;user-select:none;white-space:nowrap;width:100%}.st-header-label{padding-right:var(--st-cell-padding)}.st-cell-content{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell-content.right-aligned{justify-content:flex-end;text-align:right}.st-cell-content.left-aligned{justify-content:flex-start;text-align:left}.st-cell-content.center-aligned{justify-content:center;text-align:center}.st-cell{border:var(--st-border-width) solid #0000;position:relative}.st-cell-depth-1{padding-left:calc(var(--st-cell-padding)*4)}.st-cell-depth-2{padding-left:calc(var(--st-cell-padding)*8)}.st-cell-depth-3{padding-left:calc(var(--st-cell-padding)*12)}.st-cell-depth-4{padding-left:calc(var(--st-cell-padding)*16)}.st-cell-depth-5{padding-left:calc(var(--st-cell-padding)*20)}.st-cell-depth-6{padding-left:calc(var(--st-cell-padding)*24)}.st-cell-depth-7{padding-left:calc(var(--st-cell-padding)*28)}.st-sort-icon-container{align-items:center;display:flex;justify-content:center;margin-left:4px}.st-sort-icon{fill:var(--st-slate-500)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);cursor:col-resize;height:calc(100% - 20px);margin-right:var(--st-resize-handle-margin-right);right:0;top:0;width:var(--st-resize-handle-width)}.st-row-separator{background-color:var(--st-separator-border-color);grid-column:1/-1;height:1px}.st-row-separator.st-last-group-row{background-color:var(--st-last-group-row-separator-border-color)}.st-cell-even-row{background-color:var(--st-even-row-background-color)}.st-cell-odd-row:not(.st-cell-selected){background-color:var(--st-odd-row-background-color);color:var(--st-cell-odd-row-color)}.st-cell:not(.st-cell-odd-row):not(.st-cell-selected){color:var(--st-cell-color)}.st-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color);border-left:var(--st-border-width) solid var(--st-selected-border-left-color);border-right:var(--st-border-width) solid var(--st-selected-border-right-color);color:var(--st-selected-first-cell-color)}.st-cell-selected-first,.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-top-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-left-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-right-color)}.st-horizontal-scrollbar-container{align-items:center;border-top:var(--st-border-width) solid var(--st-border-color);display:flex;flex-shrink:0}.st-horizontal-scrollbar-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-right{background-color:var(--st-scrollbar-bg-color);height:100%}.st-horizontal-scrollbar-middle{overflow:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);padding:var(--st-spacing-medium)}.st-footer,.st-next-prev-btn{align-items:center;display:flex}.st-next-prev-btn{fill:var(--st-slate-600);background-color:initial;border:none;border-radius:var(--st-border-radius);cursor:pointer;justify-content:center;padding:var(--st-spacing-small);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.disabled>.st-next-prev-icon{fill:var(--st-slate-400);cursor:not-allowed}.st-next-prev-btn:not(.disabled):hover{background-color:var(--st-slate-100)}.st-page-btn{background-color:initial;border:none;border-radius:var(--st-border-radius);color:var(--st-slate-600);cursor:pointer;margin-left:var(--st-spacing-small);padding:var(--st-spacing-small);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-page-btn:hover{background-color:var(--st-button-hover-background-color)}.st-page-btn.active{background-color:var(--st-button-active-background-color);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-edit-cell-shadow-color);box-sizing:border-box;font-size:var(--st-font-size);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(--st-editable-cell-focus-border-color)}.st-column-editor{background:var(--st-footer-background-color);border-left:var(--st-border-width) solid var(--st-border-color);color:var(--st-slate-500);cursor:pointer;flex-shrink:0;position:relative;user-select:none}.st-column-editor-text{padding:var(--st-spacing-medium) var(--st-spacing-small);writing-mode:vertical-rl;z-index:2}.st-column-editor.open,.st-column-editor.open .st-column-editor-text{background-color:var(--st-column-editor-background-color)}.st-column-editor-popout{background-color:var(--st-column-editor-popout-background-color);height:100%;overflow:hidden;position:absolute;right:calc(100% + 1px);top:0;transition:width var(--st-transition-duration) var(--st-transition-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:var(--st-spacing-small);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small)}.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:var(--st-spacing-medium)}.st-checkbox-input{display:none}.st-checkbox-custom{align-items:center;background-color:#fff;border:var(--st-border-width) solid var(--st-slate-300);border-radius:var(--st-border-radius);display:flex;height:24px;justify-content:center;transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);width:24px}.st-checkbox-custom.st-checked{background-color:var(--st-checkbox-checked-background-color);border-color:var(--st-checkbox-checked-border-color)}.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)}}.st-group-header{align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);color:var(--st-cell-color);cursor:pointer;display:flex;font-weight:var(--st-font-weight-bold);height:40px;transition:background-color var(--st-transition-duration) var(--st-transition-ease);user-select:none}.st-group-header:hover{background-color:var(--st-button-hover-background-color)}.st-group-header-content{align-items:center;display:flex;gap:var(--st-spacing-medium)}.st-group-toggle-icon{align-items:center;display:flex;font-size:.8em;height:16px;justify-content:center;width:16px}.st-group-name{font-weight:var(--st-font-weight-bold)}.st-group-count{color:var(--st-cell-odd-row-color);font-size:.9em}.st-group-header.expanded .st-group-toggle-icon{transform:rotate(0deg);transition:transform var(--st-transition-duration) var(--st-transition-ease)}.st-group-header.collapsed .st-group-toggle-icon{transform:rotate(-90deg);transition:transform var(--st-transition-duration) var(--st-transition-ease)}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import Row from "./Row";
|
|
3
|
+
import { Pinned } from "../enums/Pinned";
|
|
3
4
|
type HeaderObject = {
|
|
4
5
|
accessor: string;
|
|
5
6
|
align?: "left" | "center" | "right";
|
|
6
|
-
cellRenderer?: ({ accessor, colIndex, row }: {
|
|
7
|
+
cellRenderer?: ({ accessor, colIndex, row, }: {
|
|
7
8
|
accessor: string;
|
|
8
9
|
colIndex: number;
|
|
9
10
|
row: Row;
|
|
10
11
|
}) => ReactNode | string;
|
|
12
|
+
children?: HeaderObject[];
|
|
11
13
|
expandable?: boolean;
|
|
12
14
|
hide?: boolean;
|
|
13
15
|
isEditable?: boolean;
|
|
14
16
|
isSortable?: boolean;
|
|
15
17
|
label: string;
|
|
16
18
|
minWidth?: number | string;
|
|
17
|
-
pinned?:
|
|
19
|
+
pinned?: Pinned;
|
|
18
20
|
type?: "string" | "number" | "boolean" | "date" | "enum";
|
|
19
21
|
width: number | string;
|
|
20
22
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Dispatch, ReactNode, SetStateAction, UIEvent } from "react";
|
|
2
|
+
import Row from "./Row";
|
|
3
|
+
import { Pinned } from "../enums/Pinned";
|
|
4
|
+
import { OnSortProps, SortConfig } from "..";
|
|
5
|
+
import { HeaderObject } from "..";
|
|
6
|
+
import { RefObject } from "react";
|
|
7
|
+
interface TableHeaderSectionProps {
|
|
8
|
+
allowAnimations: boolean;
|
|
9
|
+
columnReordering: boolean;
|
|
10
|
+
columnResizing: boolean;
|
|
11
|
+
currentRows: Row[];
|
|
12
|
+
draggedHeaderRef: RefObject<HeaderObject | null>;
|
|
13
|
+
forceUpdate: () => void;
|
|
14
|
+
gridTemplateColumns: string;
|
|
15
|
+
handleScroll?: (event: UIEvent<HTMLDivElement>) => void;
|
|
16
|
+
headersRef: RefObject<HeaderObject[]>;
|
|
17
|
+
hiddenColumns: Record<string, boolean>;
|
|
18
|
+
hoveredHeaderRef: RefObject<HeaderObject | null>;
|
|
19
|
+
isWidthDragging: boolean;
|
|
20
|
+
mainBodyRef: RefObject<HTMLDivElement | null>;
|
|
21
|
+
maxDepth: number;
|
|
22
|
+
onColumnOrderChange?: (newHeaders: HeaderObject[]) => void;
|
|
23
|
+
onSort: OnSortProps;
|
|
24
|
+
onTableHeaderDragEnd: (newHeaders: HeaderObject[]) => void;
|
|
25
|
+
pinned?: Pinned;
|
|
26
|
+
rowHeight: number;
|
|
27
|
+
sectionRef: RefObject<HTMLDivElement | null>;
|
|
28
|
+
selectableColumns: boolean;
|
|
29
|
+
setIsWidthDragging: Dispatch<SetStateAction<boolean>>;
|
|
30
|
+
setSelectedCells: Dispatch<SetStateAction<Set<string>>>;
|
|
31
|
+
sort: SortConfig | null;
|
|
32
|
+
sortDownIcon?: ReactNode;
|
|
33
|
+
sortUpIcon?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
export default TableHeaderSectionProps;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import HeaderObject from "../types/HeaderObject";
|
|
2
|
-
|
|
2
|
+
import { Pinned } from "../enums/Pinned";
|
|
3
|
+
export declare const getCellId: ({ accessor, rowIndex }: {
|
|
3
4
|
accessor: string;
|
|
4
5
|
rowIndex: number;
|
|
5
6
|
}) => string;
|
|
6
7
|
export declare const displayCell: ({ hiddenColumns, header, pinned, }: {
|
|
7
8
|
hiddenColumns: Record<string, boolean>;
|
|
8
9
|
header: HeaderObject;
|
|
9
|
-
pinned?:
|
|
10
|
+
pinned?: Pinned | undefined;
|
|
10
11
|
}) => true | null;
|
|
@@ -6,12 +6,12 @@ export declare const handleSort: (headers: HeaderObject[], rows: Row[], sortConf
|
|
|
6
6
|
sortedData: Row[];
|
|
7
7
|
newSortConfig: SortConfig;
|
|
8
8
|
};
|
|
9
|
-
export declare const handleResizeStart: ({ event, forceUpdate, header, headersRef,
|
|
9
|
+
export declare const handleResizeStart: ({ colIndex, event, forceUpdate, header, headersRef, reverse, setIsWidthDragging, startWidth, }: {
|
|
10
|
+
colIndex: number;
|
|
10
11
|
event: MouseEvent;
|
|
11
12
|
forceUpdate: () => void;
|
|
12
13
|
header: HeaderObject;
|
|
13
14
|
headersRef: React.RefObject<HeaderObject[]>;
|
|
14
|
-
index: number;
|
|
15
15
|
reverse?: boolean | undefined;
|
|
16
16
|
setIsWidthDragging: Dispatch<SetStateAction<boolean>>;
|
|
17
17
|
startWidth: number;
|