simple-table-core 0.7.12 → 0.7.13
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 -7
- package/dist/components/SimpleTable/TableContent.d.ts +1 -1
- package/dist/components/SimpleTable/TableHeader.d.ts +1 -1
- package/dist/components/SimpleTable/TableRow.d.ts +4 -4
- package/dist/components/SimpleTable/TableRowSeparator.d.ts +4 -1
- package/dist/components/SimpleTable/TableSection.d.ts +2 -1
- package/dist/consts/general-consts.d.ts +1 -0
- package/dist/hooks/useSortableData.d.ts +4 -1
- 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 +2 -1
- package/dist/types/Row.d.ts +2 -1
- package/dist/types/RowId.d.ts +1 -0
- package/dist/types/SharedTableProps.d.ts +0 -1
- package/dist/types/TableCellProps.d.ts +5 -9
- package/dist/types/TableRowProps.d.ts +0 -1
- package/dist/utils/columnUtils.d.ts +2 -0
- package/dist/utils/infiniteScrollUtils.d.ts +9 -2
- package/dist/utils/sortUtils.d.ts +2 -1
- package/package.json +1 -1
- package/dist/components/SimpleTable/TableColumnEditor/TableColumnEditor.d.ts +0 -17
- package/dist/components/SimpleTable/TableColumnEditor/TableColumnEditorPopout.d.ts +0 -16
- package/dist/components/SimpleTable/TableLastColumnCell.d.ts +0 -5
- package/dist/context/TableContext.d.ts +0 -7
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import Row from "../../types/Row";
|
|
2
1
|
import HeaderObject from "../../types/HeaderObject";
|
|
3
2
|
import TableBodyProps from "../../types/TableBodyProps";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { RowId } from "../../types/RowId";
|
|
4
|
+
import VisibleRow from "../../types/VisibleRow";
|
|
5
|
+
declare const RenderCells: ({ getBorderClass, handleMouseDown, handleMouseOver, headers, hiddenColumns, isSelected, isTopLeftCell, onExpandRowClick, pinned, rowIndex, visibleRow, ...props }: {
|
|
6
6
|
headers: HeaderObject[];
|
|
7
7
|
hiddenColumns: Record<string, boolean>;
|
|
8
|
-
|
|
9
|
-
onExpandRowClick: (rowIndex: number) => void;
|
|
8
|
+
onExpandRowClick: (rowId: RowId) => void;
|
|
10
9
|
pinned?: "left" | "right" | undefined;
|
|
11
|
-
row: Row;
|
|
12
10
|
rowIndex: number;
|
|
13
|
-
|
|
11
|
+
visibleRow: VisibleRow;
|
|
14
12
|
} & Omit<TableBodyProps, "currentRows" | "headerContainerRef">) => import("react/jsx-runtime").JSX.Element;
|
|
15
13
|
export default RenderCells;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RefObject } from "react";
|
|
2
2
|
import TableBodyProps from "../../types/TableBodyProps";
|
|
3
3
|
import TableHeaderProps from "../../types/TableHeaderProps";
|
|
4
|
-
type OmittedTableProps = "centerHeaderRef" | "headerContainerRef" | "mainTemplateColumns" | "pinnedLeftColumns" | "pinnedLeftHeaderRef" | "pinnedLeftTemplateColumns" | "pinnedRightColumns" | "pinnedRightHeaderRef" | "pinnedRightTemplateColumns"
|
|
4
|
+
type OmittedTableProps = "centerHeaderRef" | "headerContainerRef" | "mainTemplateColumns" | "pinnedLeftColumns" | "pinnedLeftHeaderRef" | "pinnedLeftTemplateColumns" | "pinnedRightColumns" | "pinnedRightHeaderRef" | "pinnedRightTemplateColumns";
|
|
5
5
|
interface TableContentProps extends Omit<TableHeaderProps, OmittedTableProps>, Omit<TableBodyProps, OmittedTableProps> {
|
|
6
6
|
editColumns: boolean;
|
|
7
7
|
pinnedLeftRef: RefObject<HTMLDivElement | null>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import TableHeaderProps from "../../types/TableHeaderProps";
|
|
2
|
-
declare const TableHeader: ({ allowAnimations, centerHeaderRef, columnResizing, currentRows, columnReordering, draggedHeaderRef, forceUpdate, headerContainerRef, headersRef, hiddenColumns, hoveredHeaderRef, isWidthDragging, mainBodyRef, mainTemplateColumns, onSort, onTableHeaderDragEnd, pinnedLeftColumns, pinnedLeftHeaderRef, pinnedLeftTemplateColumns, pinnedRightColumns, pinnedRightHeaderRef, pinnedRightTemplateColumns, selectableColumns, setIsWidthDragging, setSelectedCells,
|
|
2
|
+
declare const TableHeader: ({ allowAnimations, centerHeaderRef, columnResizing, currentRows, columnReordering, draggedHeaderRef, forceUpdate, headerContainerRef, headersRef, hiddenColumns, hoveredHeaderRef, isWidthDragging, mainBodyRef, mainTemplateColumns, onSort, onTableHeaderDragEnd, pinnedLeftColumns, pinnedLeftHeaderRef, pinnedLeftTemplateColumns, pinnedRightColumns, pinnedRightHeaderRef, pinnedRightTemplateColumns, selectableColumns, setIsWidthDragging, setSelectedCells, sort, sortDownIcon, sortUpIcon, }: TableHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TableHeader;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { RowId } from "../../types/RowId";
|
|
1
2
|
import TableBodyProps from "../../types/TableBodyProps";
|
|
2
3
|
import VisibleRow from "../../types/VisibleRow";
|
|
3
|
-
declare const TableRow: ({
|
|
4
|
-
depth?: number | undefined;
|
|
4
|
+
declare const TableRow: ({ getNextRowIndex, gridTemplateColumns, index, pinned, props, rowHeight, visibleRow, }: {
|
|
5
5
|
getNextRowIndex: () => number;
|
|
6
|
+
gridTemplateColumns: string;
|
|
6
7
|
index: number;
|
|
7
|
-
lastGroupRow?: boolean | undefined;
|
|
8
8
|
pinned?: "left" | "right" | undefined;
|
|
9
9
|
props: Omit<TableBodyProps, "currentRows" | "headerContainerRef"> & {
|
|
10
|
-
onExpandRowClick: (
|
|
10
|
+
onExpandRowClick: (rowId: RowId) => void;
|
|
11
11
|
};
|
|
12
12
|
rowHeight: number;
|
|
13
13
|
visibleRow: VisibleRow;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
declare const TableRowSeparator: ({ lastGroupRow }: {
|
|
1
|
+
declare const TableRowSeparator: ({ lastGroupRow, position, rowHeight, templateColumns, }: {
|
|
2
2
|
lastGroupRow?: boolean | undefined;
|
|
3
|
+
position: number;
|
|
4
|
+
rowHeight: number;
|
|
5
|
+
templateColumns: string;
|
|
3
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
7
|
export default TableRowSeparator;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { RefObject } from "react";
|
|
2
2
|
import TableBodyProps from "../../types/TableBodyProps";
|
|
3
3
|
import VisibleRow from "../../types/VisibleRow";
|
|
4
|
+
import { RowId } from "../../types/RowId";
|
|
4
5
|
declare const TableSection: ({ headerContainerRef, onExpandRowClick, pinned, rowHeight, sectionRef, templateColumns, totalHeight, visibleRows, width, ...props }: {
|
|
5
6
|
headerContainerRef: RefObject<HTMLDivElement | null>;
|
|
6
|
-
onExpandRowClick: (
|
|
7
|
+
onExpandRowClick: (rowId: RowId) => void;
|
|
7
8
|
pinned?: "left" | "right" | undefined;
|
|
8
9
|
rowHeight: number;
|
|
9
10
|
sectionRef?: RefObject<HTMLDivElement | null> | undefined;
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import HeaderObject from "../types/HeaderObject";
|
|
3
3
|
import Row from "../types/Row";
|
|
4
4
|
import SortConfig from "../types/SortConfig";
|
|
5
|
-
declare const useSortableData: (
|
|
5
|
+
declare const useSortableData: ({ headers, tableRows }: {
|
|
6
|
+
headers: HeaderObject[];
|
|
7
|
+
tableRows: Row[];
|
|
8
|
+
}) => {
|
|
6
9
|
sort: SortConfig | null;
|
|
7
10
|
setSort: import("react").Dispatch<import("react").SetStateAction<SortConfig | null>>;
|
|
8
11
|
updateSort: (columnIndex: number, accessor: string) => void;
|
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,createContext as c,forwardRef as s,useLayoutEffect as d,createElement 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 m(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 p(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{c(t.next(e))}catch(e){i(e)}}function l(e){try{c(t.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,l)}c((t=t.apply(e,n||[])).next())}))}function w(e,n){var r,t,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&l[0]?t.return:l[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,l[1])).done)return o;switch(t=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,t=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],t=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function R(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 b,C=function(r){var t=r.currentPage,o=r.hideFooter,i=r.nextIcon,a=r.onPageChange,l=r.prevIcon,c=r.rowsPerPage,s=r.shouldPaginate,d=r.totalRows,u=Math.ceil(d/c),f=t>1,h=t<u,v=function(e){e>=1&&e<=u&&a(e)};return o||!s?null:(console.log("totalPages",u),e("div",g({className:"st-footer"},{children:[n("button",g({className:"st-next-prev-btn ".concat(f?"":"disabled"),onClick:function(){return v(t-1)},disabled:!f},{children:l})),n("button",g({className:"st-next-prev-btn ".concat(h?"":"disabled"),onClick:function(){return v(t+1)},disabled:!h},{children:i})),Array.from({length:u},(function(e,r){return n("button",g({onClick:function(){return v(r+1)},className:"st-page-btn ".concat(t===r+1?"active":"")},{children:r+1}),r)}))]})))},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:"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"})}))},H=c({rows:[],tableRows:[]}),I=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"})}))},M=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"})}))},D=function(r){var o=r.checked,i=void 0!==o&&o,a=r.children,l=r.onChange,c=t(i),s=c[0],d=c[1];return e("label",g({className:"st-checkbox-label"},{children:[n("input",{checked:s,className:"st-checkbox-input",onChange:function(){var e=!s;d(e),l&&l(e)},type:"checkbox"}),n("span",g({className:"st-checkbox-custom ".concat(s?"st-checked":"")},{children:s&&n("span",{className:"st-checkbox-checkmark"})})),a]}))},E=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(D,g({checked:a[e.accessor],onChange:function(n){var r;return i(g(g({},a),((r={})[e.accessor]=n,r)))}},{children:e.label}),r)}))}))}))},S=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,l=r.headers,c=r.position,s=void 0===c?"right":c,d=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(s),onClick:function(){return function(e){v(e)}(!h)}},{children:[n("div",g({className:"st-column-editor-text"},{children:o})),n(E,{headers:l,open:h,position:s,setOpen:v,setHiddenColumns:d,hiddenColumns:u})]})):null},k=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},N=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},L=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"}))]}))},T=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)}})},B=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)}})},O=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(T,{defaultValue:i,onBlur:l,onChange:a}):"boolean"==typeof i?n(L,{onBlur:l,onChange:a,value:i}):"number"==typeof i?n(B,{defaultValue:i,onBlur:l,onChange:a}):null})},A=0,W=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===A||o-A>=t)&&(A=o,n(r))}},P=Date.now(),z={screenX:0,screenY:0},U=function(e){var n,r,t=e.draggedHeaderRef,i=e.headersRef,l=e.hoveredHeaderRef,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,P=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-z.screenX,2)+Math.pow(u-z.screenY,2));l.current=o;var h=R([],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})),m=h.splice(v,1)[0];if(h.splice(g,0,m),!(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-P<800&&f<50||(P=p,z={screenX:d,screenY:u},c(h))}}},handleDragEnd:function(){t.current=null,l.current=null}}},j=s((function(r,o){var i=r.borderClass,l=r.cellHasChildren,c=r.colIndex,s=r.content,d=r.depth,u=r.draggedHeaderRef,f=r.header,h=r.headersRef,v=r.hoveredHeaderRef,m=r.isSelected,p=r.isTopLeftCell,w=r.onCellEdit,R=r.onExpandRowClick,b=r.onMouseDown,C=r.onMouseOver,y=r.onTableHeaderDragEnd,H=r.row,I=r.rowIndex,D=t(s),E=D[0],S=D[1],N=t(!1),L=N[0],T=N[1],B=U({draggedHeaderRef:u,headersRef:h,hoveredHeaderRef:v,onTableHeaderDragEnd:y}).handleDragOver,A=W(),P=Boolean(null==f?void 0:f.isEditable),z=I%2==0,j="st-cell ".concat(d>0&&f.expandable?"st-cell-depth-".concat(d):""," ").concat(m?p?"st-cell-selected-first-cell ".concat(i):"st-cell-selected ".concat(i):""," ").concat(z?"st-cell-odd-row":"st-cell-even-row"," ").concat(P?"clickable":""," ").concat("right"===f.align?"right-aligned":"");a((function(){"object"!=typeof s&&S(s)}),[s]);return L?n("div",g({className:"st-cell-editing ".concat(z?"st-cell-odd-row":"st-cell-even-row"),id:k({accessor:f.accessor,rowIndex:I+1})},{children:n(O,{onChange:function(e){S(e),null==w||w({accessor:f.accessor,newValue:e,row:H})},setIsEditing:T,value:E})})):e("div",g({className:j,id:k({accessor:f.accessor,rowIndex:I+1}),onDoubleClick:function(){return f.isEditable&&T(!0)},onMouseDown:function(){return b(I,c)},onMouseOver:function(){return C(I,c)},onDragOver:function(e){return A({callback:B,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:o},{children:[f.expandable&&l?H.rowMeta.isExpanded?n("div",g({className:"st-sort-icon-container",onClick:function(){return R(H.rowMeta.rowId)}},{children:n(M,{className:"st-sort-icon"})})):n("div",g({className:"st-sort-icon-container",onClick:function(){return R(H.rowMeta.rowId)}},{children:n(x,{className:"st-sort-icon"})})):null,n("span",{children:E})]}))})),F=s((function(e,r){return e.visible?n("div",{className:"st-cell",ref:r}):n("div",{ref:r})})),G=function(e){var r=e.lastGroupRow;return n("div",{className:"st-row-separator ".concat(r?"st-last-group-row":"")})},V=function(e){var t=e.allowAnimations,o=e.children,i=m(e,["allowAnimations","children"]);return t?n(J,g({},i,{children:o})):n(r,{children:o})},J=function(e){var i=e.allowHorizontalAnimate,l=void 0===i||i,c=e.children,s=e.draggedHeaderRef,u=e.headersRef,f=e.isBody,h=e.mainBodyRef,v=e.pauseAnimation,g=e.rowIndex,m=o(!1),p=t({}),w=p[0],R=p[1],b=o({}),C=u.current;return d((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(k({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(w)&&(b.current=w,R(e))}}),[w,C,s,f,g]),d((function(){var e=h.current,n=function(){m.current=!0},r=function(){m.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||m.current||Object.keys(b.current).length&&C&&C.forEach((function(e){var n=document.getElementById(k({accessor:e.accessor,rowIndex:g}));if(n){var r=b.current[e.accessor],t=w[e.accessor];if(r&&t){var o=r.left-t.left,i=l?0:r.top-t.top,a=Math.abs(o),c=Math.abs(i);(a>10||c>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,w,C,f,v,b,g]),n(r,{children:c})},X=function(r){var t,o=r.getBorderClass,i=r.handleMouseDown,a=r.handleMouseOver,l=r.headers,c=r.hiddenColumns,s=r.isSelected,d=r.isTopLeftCell,h=r.lastGroupRow,v=r.onExpandRowClick,p=r.pinned,w=r.row,R=r.rowIndex,b=r.shouldDisplayLastColumnCell,C=m(r,["getBorderClass","handleMouseDown","handleMouseOver","headers","hiddenColumns","isSelected","isTopLeftCell","lastGroupRow","onExpandRowClick","pinned","row","rowIndex","shouldDisplayLastColumnCell"]),y=null===(t=w.rowMeta)||void 0===t?void 0:t.children;return e(V,g({allowAnimations:C.allowAnimations,allowHorizontalAnimate:C.shouldPaginate,draggedHeaderRef:C.draggedHeaderRef,headersRef:C.headersRef,isBody:!0,mainBodyRef:C.mainBodyRef,pauseAnimation:C.isWidthDragging,rowIndex:R+1},{children:[0!==R&&n(G,{lastGroupRow:h}),l.map((function(e,n){if(!N({hiddenColumns:c,header:e,pinned:p}))return null;var r=w.rowData[e.accessor];return e.cellRenderer&&(r=e.cellRenderer({accessor:e.accessor,colIndex:n,row:w})),u(j,g({},C,{borderClass:o(R,n),cellHasChildren:((null==y?void 0:y.length)||0)>0,colIndex:n,content:r,header:e,isSelected:s(R,n),isTopLeftCell:d(R,n),key:n,onExpandRowClick:v,onMouseDown:function(){return i({rowIndex:R,colIndex:n})},onMouseOver:function(){return a(R,n)},row:w,rowIndex:R}))})),n(F,{ref:f(),visible:b})]}))},q=function(e){var r=e.depth,t=void 0===r?0:r,o=e.getNextRowIndex,i=e.index,a=e.lastGroupRow,l=e.pinned,c=e.props,s=e.rowHeight,d=e.visibleRow,f=d.row,h=d.position,v=o(),m=c.headers.filter((function(e){return l===e.pinned})).map((function(e){return"".concat(e.width,"px")})).join(" ");return n("div",g({style:{display:"grid",gridTemplateColumns:m,position:"absolute",top:"".concat(h*s,"px"),height:"".concat(s,"px"),transform:"translateZ(0)",transition:"background 0.2s ease"}},{children:u(X,g({},c,{depth:t,lastGroupRow:a,key:i,pinned:l,row:f,rowIndex:v}))}))},Y=function(e){e.headerContainerRef;var r=e.onExpandRowClick,t=e.pinned,i=e.rowHeight,l=e.sectionRef;e.templateColumns;var c=e.totalHeight,s=e.visibleRows,d=e.width,u=m(e,["headerContainerRef","onExpandRowClick","pinned","rowHeight","sectionRef","templateColumns","totalHeight","visibleRows","width"]),f=t?"st-table-body-pinned-".concat(t):"st-table-body-main",h=o(0);a((function(){h.current=0}));var v=function(){return h.current++};return n("div",g({className:f,ref:l,style:{position:"relative",height:"".concat(c,"px"),width:d}},{children:s.map((function(e,o){var a,l;return n(q,{getNextRowIndex:v,index:o,lastGroupRow:Boolean(null===(l=null===(a=e.row.rowMeta)||void 0===a?void 0:a.children)||void 0===l?void 0:l.length),pinned:t,props:g(g({},u),{onExpandRowClick:r}),rowHeight:i,visibleRow:e},o)}))}))},K=function(r){var c,s,d,u,f,h=r.centerHeaderRef,v=r.currentRows,m=r.headerContainerRef,b=r.mainBodyRef,C=r.mainTemplateColumns,y=r.pinnedLeftColumns,x=r.pinnedLeftHeaderRef,H=r.pinnedLeftRef,I=r.pinnedLeftTemplateColumns,M=r.pinnedRightColumns,D=r.pinnedRightHeaderRef,E=r.pinnedRightRef,S=r.pinnedRightTemplateColumns,k=r.scrollbarWidth,N=r.tableBodyContainerRef;!function(e){var n=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=t(!1),l=i[0],c=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;c(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(t),function(){t&&i.unobserve(t)}}}),[n,r])}({headerContainerRef:m,mainSectionRef:N,scrollbarWidth:k});var L=o(null),T=o(null),B=t(v),O=B[0],A=B[1],W=t(1),P=W[0],z=W[1],U=t(!1),j=U[0],F=U[1],G=t(!0),V=G[0],J=G[1],X=t(0),q=X[0],K=X[1],Z=function(e){var n=0,r=function(e){e.forEach((function(e){n+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&r(e.rowMeta.children)}))};return r(e),n}(O),$=40*Z,Q=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};A((function(e){return e.map(n)}))},_=l((function(){return function(e){var n=e.bufferRowCount,r=e.containerHeight,t=e.rowHeight,o=e.rows,i=e.scrollTop,a=[],l=0,c=Math.max(0,i-t*n),s=i+r+t*n,d=function(e,n){for(var r,o=0,i=e;o<i.length;o++){var u=i[o],f=l*t;if(f>=s)break;f+t>c&&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&&d(u.rowMeta.children,n+1)}};return d(o,0),a}({rows:O,scrollTop:q,containerHeight:600,rowHeight:40,bufferRowCount:15})}),[O,q]),ee=i((function(){return p(void 0,void 0,void 0,(function(){var e;return w(this,(function(n){return j||!V||(F(!0),e=v.slice(15*P,15*(P+1)),A((function(n){return R(R([],n,!0),e,!0)})),z((function(e){return e+1})),F(!1),e.length<5&&J(!1)),[2]}))}))}),[v,V,j,P]),ne=i((function(e){e[0].isIntersecting&&V&&!j&&ee()}),[V,j,ee]);a((function(){return L.current=new IntersectionObserver(ne,{root:null,rootMargin:"100px",threshold:0}),N.current&&L.current.observe(N.current),function(){L.current&&L.current.disconnect()}}),[ne,O,N]);var re=(null===(c=x.current)||void 0===c?void 0:c.clientWidth)?(null===(s=x.current)||void 0===s?void 0:s.clientWidth)+1:0,te=null===(d=h.current)||void 0===d?void 0:d.clientWidth,oe=(null===(u=D.current)||void 0===u?void 0:u.clientWidth)?(null===(f=D.current)||void 0===f?void 0:f.clientWidth)+1:0;return e("div",g({className:"st-table-body-container",ref:N,onScroll:function(e){var n=e.currentTarget.scrollTop;T.current&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame((function(){K(n)}))}},{children:[y.length>0&&n(Y,g({},r,{onExpandRowClick:Q,pinned:"left",rowHeight:40,sectionRef:H,templateColumns:I,totalHeight:$,visibleRows:_,width:re})),n(Y,g({},r,{onExpandRowClick:Q,rowHeight:40,sectionRef:b,templateColumns:C,totalHeight:$,visibleRows:_,width:te})),M.length>0&&n(Y,g({},r,{onExpandRowClick:Q,pinned:"right",rowHeight:40,sectionRef:E,templateColumns:S,totalHeight:$,visibleRows:_,width:oe}))]}))},Z={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 Z.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?Z.string(e,n,r):"number"==typeof e&&"number"==typeof n?Z.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?Z.boolean(e,n,r):Z.string(String(e),String(n),r)}},$=function(e,n,r,t){switch(void 0===r&&(r="string"),r){case"string":return Z.string(String(e||""),String(n||""),t);case"number":return Z.number(Number(e||0),Number(n||0),t);case"boolean":return Z.boolean(Boolean(e),Boolean(n),t);case"date":return Z.date(String(e||""),String(n||""),t);case"enum":return Z.enum(String(e||""),String(n||""),t);default:return Z.default(e,n,t)}},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 R([],e,!0).sort((function(e,r){var t,a,l=null===(t=null==e?void 0:e.rowData)||void 0===t?void 0:t[n.key.accessor],c=null===(a=null==r?void 0:r.rowData)||void 0===a?void 0:a[n.key.accessor];return $(l,c,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}))},_=function(e,n,r){var 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=[],l=new Map;return e.forEach((function(n){e.some((function(e){var r;return null===(r=e.rowMeta.children)||void 0===r?void 0:r.some((function(e){return e.rowMeta.rowId===n.rowMeta.rowId}))}))||a.push(n),n.rowMeta.children&&n.rowMeta.children.length>0&&l.set(n.rowMeta.rowId,n.rowMeta.children)})),R([],a,!0).sort((function(e,r){var t,a,l=null===(t=null==e?void 0:e.rowData)||void 0===t?void 0:t[n.key.accessor],c=null===(a=null==r?void 0:r.rowData)||void 0===a?void 0:a[n.key.accessor];return $(l,c,o,i)})).map((function(e){var t=g({},e);if(l.has(e.rowMeta.rowId)){var o=l.get(e.rowMeta.rowId)||[],i=Q(o,n,r);t.rowMeta=g(g({},t.rowMeta),{children:i})}return t}))}(n,r,e);return{sortedData:t,newSortConfig:r}},ee=function(e){var n=e.event,r=e.forceUpdate,t=e.header,o=e.headersRef,i=e.index;e.reverse;var a=e.setIsWidthDragging;a(!0),n.preventDefault();var l=n.clientX;if(t){var c=t.width,s=function(e){var n=Math.max(c+(e.clientX-l),40);t&&o.current&&(o.current[i].width=n,r())},d=function(){document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d),a(!1)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",d)}},ne=s((function(r,o){var i,l=r.columnResizing,c=r.currentRows,s=r.columnReordering,d=r.draggedHeaderRef,u=r.forceUpdate,f=r.headersRef,h=r.hoveredHeaderRef,v=r.index,m=r.onSort,p=r.onTableHeaderDragEnd,w=r.reverse,R=r.selectableColumns,b=r.setIsWidthDragging,C=r.setSelectedCells,y=r.sort,x=r.sortDownIcon,H=r.sortUpIcon,I=t(!1),M=I[0],D=I[1],E=null===(i=f.current)||void 0===i?void 0:i[v],S=Boolean(null==E?void 0:E.isSortable),N="st-header-cell ".concat(E===h.current?"st-hovered":""," ").concat(M?"st-dragging":""," ").concat(S?"clickable":""," ").concat(s&&!S?"columnReordering":""," ").concat("right"===(null==E?void 0:E.align)?"right-aligned":""),L=U({draggedHeaderRef:d,headersRef:f,hoveredHeaderRef:h,onTableHeaderDragEnd:p}),T=L.handleDragStart,B=L.handleDragEnd,O=U({draggedHeaderRef:d,headersRef:f,hoveredHeaderRef:h,onTableHeaderDragEnd:p}).handleDragOver,A=W(),P=function(e){var n=e.event,r=e.header;if(R){var t=c.length,o=Array.from({length:t},(function(e,n){return"".concat(n,"-").concat(v)})),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("".concat(n,"-").concat(o+t))}))})),r};n.shiftKey?C((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)})):C(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)}}),[]),!E)return null;var z=l&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){A({callback:ee,callbackProps:{event:e,forceUpdate:u,header:E,headersRef:f,index:v,setIsWidthDragging:b},limit:10})}});return e("div",g({className:N,id:k({accessor:E.accessor,rowIndex:0}),onDragOver:function(e){A({callback:O,callbackProps:{event:e,hoveredHeader:E},limit:50})},ref:o,style:{width:E.width}},{children:[w&&z,n("div",g({className:"st-header-label",draggable:s,onClick:function(e){return P({event:e,header:E})},onDragEnd:function(e){e.preventDefault(),D(!1),B()},onDragStart:function(e){s&&E&&function(e){D(!0),T(e)}(E)}},{children:null==E?void 0:E.label})),y&&y.key.accessor===E.accessor&&e("div",g({className:"st-sort-icon-container",onClick:function(e){return P({event:e,header:E})}},{children:["ascending"===y.direction&&H&&H,"descending"===y.direction&&x&&x]})),!w&&z]}))})),re=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])},te=function(r){var t,o,i,a=r.allowAnimations,l=r.centerHeaderRef,c=r.columnResizing,s=r.currentRows,d=r.columnReordering,u=r.draggedHeaderRef,h=r.forceUpdate,v=r.headerContainerRef,m=r.headersRef,p=r.hiddenColumns,w=r.hoveredHeaderRef,R=r.isWidthDragging,b=r.mainBodyRef,C=r.mainTemplateColumns,y=r.onSort,x=r.onTableHeaderDragEnd,H=r.pinnedLeftColumns,I=r.pinnedLeftHeaderRef,M=r.pinnedLeftTemplateColumns,D=r.pinnedRightColumns,E=r.pinnedRightHeaderRef,S=r.pinnedRightTemplateColumns,k=r.selectableColumns,L=r.setIsWidthDragging,T=r.setSelectedCells,B=r.shouldDisplayLastColumnCell,O=r.sort,A=r.sortDownIcon,W=r.sortUpIcon;re(b,l);return e("div",g({className:"st-header-container",ref:v},{children:[H.length>0&&n("div",g({className:"st-header-pinned-left",ref:I,style:{gridTemplateColumns:M}},{children:n(V,g({allowAnimations:a,draggedHeaderRef:u,headersRef:m,mainBodyRef:b,pauseAnimation:R,rowIndex:0},{children:null===(t=m.current)||void 0===t?void 0:t.map((function(e,r){return N({hiddenColumns:p,header:e,pinned:"left"})?n(ne,{columnResizing:c,currentRows:s,columnReordering:d,draggedHeaderRef:u,forceUpdate:h,headersRef:m,hoveredHeaderRef:w,index:r,onSort:y,onTableHeaderDragEnd:x,ref:f(),selectableColumns:k,setIsWidthDragging:L,setSelectedCells:T,sort:O,sortDownIcon:A,sortUpIcon:W},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=b.current)||void 0===r||r.scrollTo(t,0))},ref:l,style:{gridTemplateColumns:C}},{children:e(V,g({allowAnimations:a,draggedHeaderRef:u,headersRef:m,mainBodyRef:b,pauseAnimation:R,rowIndex:0},{children:[null===(o=m.current)||void 0===o?void 0:o.map((function(e,r){return N({hiddenColumns:p,header:e})?n(ne,{columnResizing:c,currentRows:s,columnReordering:d,draggedHeaderRef:u,forceUpdate:h,headersRef:m,hoveredHeaderRef:w,index:r,onSort:y,onTableHeaderDragEnd:x,ref:f(),selectableColumns:k,setIsWidthDragging:L,setSelectedCells:T,sort:O,sortDownIcon:A,sortUpIcon:W},e.accessor):null})),n(F,{ref:f(),visible:B})]}))})),D.length>0&&n("div",g({className:"st-header-pinned-right",ref:E,style:{gridTemplateColumns:S}},{children:e(V,g({allowAnimations:a,draggedHeaderRef:u,headersRef:m,mainBodyRef:b,pauseAnimation:R,rowIndex:0},{children:[null===(i=m.current)||void 0===i?void 0:i.map((function(e,r){return N({hiddenColumns:p,header:e,pinned:"right"})?n(ne,{columnResizing:c,currentRows:s,columnReordering:d,draggedHeaderRef:u,forceUpdate:h,headersRef:m,hoveredHeaderRef:w,index:r,onSort:y,onTableHeaderDragEnd:x,reverse:!0,ref:f(),selectableColumns:k,setIsWidthDragging:L,setSelectedCells:T,sort:O,sortDownIcon:A,sortUpIcon:W},e.accessor):null})),n(F,{ref:f(),visible:B})]}))}))]}))},oe=function(r){var t=r.allowAnimations,i=r.columnResizing,a=r.currentRows,c=r.columnReordering,s=r.draggedHeaderRef,d=r.editColumns,u=r.forceUpdate,f=r.getBorderClass,h=r.handleMouseDown,v=r.handleMouseOver,m=r.headersRef,p=r.hiddenColumns,w=r.hoveredHeaderRef,R=r.isSelected,b=r.isTopLeftCell,C=r.isWidthDragging,y=r.mainBodyRef,x=r.onCellEdit,H=r.onSort,I=r.onTableHeaderDragEnd,M=r.pinnedLeftRef,D=r.pinnedRightRef,E=r.scrollbarWidth,S=r.selectableColumns,k=r.setIsWidthDragging,N=r.setSelectedCells,L=r.shouldPaginate,T=r.sort,B=r.sortDownIcon,O=r.sortUpIcon,A=r.tableBodyContainerRef,W=o(null),P=o(null),z=o(null),U=o(null),j=m.current.filter((function(e){return!e.hide&&!e.pinned})),F=l((function(){return!!y.current&&j.reduce((function(e,n){return e+n.width}),0)<y.current.clientWidth}),[j,y]),G=m.current.filter((function(e){return"left"===e.pinned&&!0!==e.hide})),V=m.current.filter((function(e){return"right"===e.pinned&&!0!==e.hide})),J=l((function(){return"".concat(G.map((function(e){return"".concat(e.width,"px")})).join(" "))}),[G]),X=l((function(){return"".concat(j.filter((function(e){return!0!==p[e.accessor]})).map((function(e){return"".concat(e.width,"px")})).join(" ")," 1fr")}),[j,p]),q=l((function(){return"".concat(V.map((function(e){return"".concat(e.width,"px")})).join(" "))}),[V]),Y={allowAnimations:t,centerHeaderRef:z,columnResizing:i,currentRows:a,columnReordering:c,draggedHeaderRef:s,forceUpdate:u,headerContainerRef:W,headersRef:m,hiddenColumns:p,hoveredHeaderRef:w,isWidthDragging:C,mainBodyRef:y,mainTemplateColumns:X,onSort:H,onTableHeaderDragEnd:I,pinnedLeftColumns:G,pinnedLeftHeaderRef:P,pinnedLeftTemplateColumns:J,pinnedRightColumns:V,pinnedRightHeaderRef:U,pinnedRightTemplateColumns:q,selectableColumns:S,setIsWidthDragging:k,setSelectedCells:N,shouldDisplayLastColumnCell:F,sort:T,sortDownIcon:B,sortUpIcon:O,tableBodyContainerRef:A},Z={allowAnimations:t,centerHeaderRef:z,currentRows:a,draggedHeaderRef:s,getBorderClass:f,handleMouseDown:h,handleMouseOver:v,headerContainerRef:W,headers:m.current,headersRef:m,hiddenColumns:p,hoveredHeaderRef:w,isSelected:R,isTopLeftCell:b,isWidthDragging:C,mainBodyRef:y,mainTemplateColumns:X,onCellEdit:x,onTableHeaderDragEnd:I,pinnedLeftColumns:G,pinnedLeftHeaderRef:P,pinnedLeftRef:M,pinnedLeftTemplateColumns:J,pinnedRightColumns:V,pinnedRightHeaderRef:U,pinnedRightRef:D,pinnedRightTemplateColumns:q,scrollbarWidth:E,shouldDisplayLastColumnCell:F,shouldPaginate:L,tableBodyContainerRef:A};return e("div",g({className:"st-table-content",style:{width:d?"calc(100% - 27.5px)":"100%"}},{children:[n(te,g({},Y)),n(K,g({},Z))]}))},ie=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])},ae=function(r){var i=r.mainBodyRef,a=r.pinnedLeftRef,l=r.pinnedRightRef,c=r.tableContentWidth,s=t(0),d=s[0],u=s[1],f=t(0),h=f[0],v=f[1],m=t(0),p=m[0],w=m[1],R=o(null);return ie({widthAttribute:"offsetWidth",callback:u,ref:a}),ie({widthAttribute:"scrollWidth",callback:w,ref:i}),ie({widthAttribute:"offsetWidth",callback:v,ref:l}),re(i,R),!i.current||i.current.scrollWidth<=i.current.clientWidth?null:e("div",g({className:"st-horizontal-scrollbar-container",style:{width:c}},{children:[d>0&&n("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:d}}),p>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:p}})})),h>0&&n("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:h}})]}))};!function(e){e.Left="left",e.Right="right"}(b||(b={}));var le=function(r){var c=r.allowAnimations,s=void 0!==c&&c,u=r.columnEditorPosition,f=void 0===u?b.Right:u,h=r.columnEditorText,m=void 0===h?"Columns":h,p=r.columnResizing,w=void 0!==p&&p,R=r.defaultHeaders,D=r.editColumns,E=void 0!==D&&D,k=r.editColumnsInitOpen,N=void 0!==k&&k,L=r.columnReordering,T=void 0!==L&&L,B=r.height,O=r.hideFooter,A=void 0!==O&&O,W=r.nextIcon,P=void 0===W?n(x,{className:"st-next-prev-icon"}):W,z=r.onCellEdit,U=r.onColumnOrderChange,j=r.prevIcon,F=void 0===j?n(y,{className:"st-next-prev-icon"}):j,G=r.rows,V=r.rowsPerPage,J=void 0===V?10:V,X=r.selectableCells,q=void 0!==X&&X,Y=r.selectableColumns,K=void 0!==Y&&Y,Z=r.shouldPaginate,$=void 0!==Z&&Z,Q=r.sortDownIcon,ee=void 0===Q?n(M,{className:"st-sort-icon"}):Q,ne=r.sortUpIcon,re=void 0===ne?n(I,{className:"st-sort-icon"}):ne,te=r.theme,ie=void 0===te?"light":te,le=l((function(){return G.map((function(e,n){return g(g({},e),{originalRowIndex:n})}))}),[G]),ce=o(null),se=o(R),de=o(null),ue=o(null),fe=o(null),he=o(null),ve=o(null),ge=t(!1),me=ge[0],pe=ge[1],we=t(1),Re=we[0],be=we[1],Ce=t(0),ye=Ce[0],xe=Ce[1],He=t(0),Ie=He[0],Me=He[1],De=function(e,n){var r=t(null),o=r[0],i=r[1],a=t({}),c=a[0],s=a[1],d=l((function(){return o?_(n,e,o).sortedData:e}),[e,o,n]);return{sort:o,setSort:i,updateSort:function(e,r){var t=n.find((function(e){return e.accessor===r}));t&&i((function(e){return e&&e.key.accessor===r?"ascending"===e.direction?{key:t,direction:"descending"}:null:{key:t,direction:"ascending"}}))},sortedRows:d,hiddenColumns:c,setHiddenColumns:s}}(le,se.current),Ee=De.sort,Se=De.sortedRows,ke=De.hiddenColumns,Ne=De.setHiddenColumns,Le=De.updateSort,Te=v((function(e){return e+1}),0)[1],Be=function(e){var n=e.selectableCells,r=e.headers,c=e.rows,s=t(new Set),d=s[0],u=s[1],f=o(!1),h=o(null),v=i((function(){var e=Array.from(d).reduce((function(e,n){var t=n.split("-").map(Number),o=t[0],i=t[1];return e[o]||(e[o]=[]),e[o][i]=c[o][r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");d.size>0&&navigator.clipboard.writeText(n)}),[d,c,r]);a((function(){var e=function(e){(e.ctrlKey||e.metaKey)&&"c"===e.key&&v()};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[v]);var g=i((function(e,n){return d.has("".concat(e,"-").concat(n))}),[d]),m=i((function(e,n){var r=[];return g(e-1,n)||r.push("st-selected-top-border"),g(e+1,n)||r.push("st-selected-bottom-border"),g(e,n-1)||r.push("st-selected-left-border"),g(e,n+1)||r.push("st-selected-right-border"),r.join(" ")}),[g]),p=l((function(){var e=Math.min.apply(Math,Array.from(d).map((function(e){return parseInt(e.split("-")[0])}))),n=Math.min.apply(Math,Array.from(d).map((function(e){return parseInt(e.split("-")[1])})));return function(r,t){return r===e&&t===n}}),[d]);return{selectedCells:d,handleMouseDown:function(e){var r=e.colIndex,t=e.rowIndex;n&&(f.current=!0,h.current={row:t,col:r},u(new Set(["".concat(t,"-").concat(r)])))},handleMouseOver:function(e,r){if(n&&f.current&&h.current){for(var t=new Set,o=Math.min(h.current.row,e),i=Math.max(h.current.row,e),a=Math.min(h.current.col,r),l=Math.max(h.current.col,r),c=o;c<=i;c++)for(var s=a;s<=l;s++)t.add("".concat(c,"-").concat(s));u(t)}},handleMouseUp:function(){f.current=!1,h.current=null},isSelected:g,getBorderClass:m,isTopLeftCell:p,setSelectedCells:u}}({selectableCells:q,headers:se.current,rows:Se}),Oe=Be.handleMouseDown,Ae=Be.handleMouseOver,We=Be.handleMouseUp,Pe=Be.isSelected,ze=Be.getBorderClass,Ue=Be.isTopLeftCell,je=Be.setSelectedCells,Fe=l((function(){return $?Se.slice((Re-1)*J,Re*J):Se}),[Re,J,$,Se]),Ge=i((function(e,n){Le(e,n)}),[Le]),Ve=i((function(e){se.current=e,Te(),null==U||U(e)}),[]);return a((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]),d((function(){if(ve.current){var e=ve.current.offsetWidth-ve.current.clientWidth,n=ve.current.clientWidth;xe(e),Me(n)}}),[]),n(H.Provider,g({value:{rows:G,tableRows:le}},{children:e("div",g({className:"simple-table-root st-wrapper theme-".concat(ie),style:B?{height:B}:{}},{children:[e("div",g({className:"st-table-wrapper-container"},{children:[e("div",g({className:"st-table-wrapper",onMouseUp:We,onMouseLeave:We},{children:[n(oe,{allowAnimations:s,columnResizing:w,currentRows:Fe,draggedHeaderRef:ce,editColumns:E,columnReordering:T,forceUpdate:Te,getBorderClass:ze,handleMouseDown:Oe,handleMouseOver:Ae,headers:se.current,headersRef:se,hiddenColumns:ke,hoveredHeaderRef:de,isSelected:Pe,isTopLeftCell:Ue,isWidthDragging:me,mainBodyRef:ue,onCellEdit:z,onSort:Ge,onTableHeaderDragEnd:Ve,pinnedLeftRef:fe,pinnedRightRef:he,scrollbarWidth:ye,selectableColumns:K,setIsWidthDragging:pe,setSelectedCells:je,shouldPaginate:$,sort:Ee,sortDownIcon:ee,sortUpIcon:re,tableBodyContainerRef:ve}),n(S,{columnEditorText:m,editColumns:E,editColumnsInitOpen:N,headers:se.current,hiddenColumns:ke,position:f,setHiddenColumns:Ne})]})),n(ae,{mainBodyRef:ue,pinnedLeftRef:fe,pinnedRightRef:he,tableContentWidth:Ie})]})),n(C,{currentPage:Re,hideFooter:A,nextIcon:P,onPageChange:be,prevIcon:F,rowsPerPage:J,shouldPaginate:$,totalRows:Se.length})]}))}))};le.defaultProps={allowAnimations:!1,columnEditorPosition:b.Right,columnEditorText:"Columns",columnResizing:!1,defaultHeaders:[],editColumns:!1,editColumnsInitOpen:!1,columnReordering:!1,height:"",hideFooter:!1,nextIcon:n(x,{className:"st-next-prev-icon"}),onCellEdit:function(){},prevIcon:n(y,{className:"st-next-prev-icon"}),rows:[],rowsPerPage:10,selectableCells:!1,selectableColumns:!1,shouldPaginate:!1,sortDownIcon:n(M,{className:"st-sort-icon"}),sortUpIcon:n(I,{className:"st-sort-icon"}),theme:"light"};var ce=h(le);export{ce 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 c,useLayoutEffect as s,createElement as d,createRef as u,memo as f,useReducer as h}from"react";var v=function(){return v=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},v.apply(this,arguments)};function g(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,t){return new(r||(r=Promise))((function(o,i){function a(e){try{c(t.next(e))}catch(e){i(e)}}function l(e){try{c(t.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,l)}c((t=t.apply(e,n||[])).next())}))}function p(e,n){var r,t,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&l[0]?t.return:l[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,l[1])).done)return o;switch(t=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,t=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],t=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function w(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 R,b=function(r){var t=r.currentPage,o=r.hideFooter,i=r.nextIcon,a=r.onPageChange,l=r.prevIcon,c=r.rowsPerPage,s=r.shouldPaginate,d=r.totalRows,u=Math.ceil(d/c),f=t>1,h=t<u,g=function(e){e>=1&&e<=u&&a(e)};return o||!s?null:e("div",v({className:"st-footer"},{children:[n("button",v({className:"st-next-prev-btn ".concat(f?"":"disabled"),onClick:function(){return g(t-1)},disabled:!f},{children:l})),n("button",v({className:"st-next-prev-btn ".concat(h?"":"disabled"),onClick:function(){return g(t+1)},disabled:!h},{children:i})),Array.from({length:u},(function(e,r){return n("button",v({onClick:function(){return g(r+1)},className:"st-page-btn ".concat(t===r+1?"active":"")},{children:r+1}),r)}))]}))},C=function(e){var r=e.className;return n("svg",v({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"})}))},y=function(e){var r=e.className;return n("svg",v({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"})}))},x=function(e){var r=e.className;return n("svg",v({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"})}))},H=function(e){var r=e.className;return n("svg",v({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"})}))},I=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",v({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[n("option",v({value:"true"},{children:"True"})),n("option",v({value:"false"},{children:"False"}))]}))},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,type:"text",defaultValue:null!=r?r:"",onBlur:t,onChange:function(e){var n=e.target.value;i(n)}})},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,defaultValue:r.toString(),onBlur:t,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},L=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(N,{defaultValue:i,onBlur:l,onChange:a}):"boolean"==typeof i?n(S,{onBlur:l,onChange:a,value:i}):"number"==typeof i?n(k,{defaultValue:i,onBlur:l,onChange:a}):null})},T=0,B=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===T||o-T>=t)&&(T=o,n(r))}},O=Date.now(),W={screenX:0,screenY:0},A=function(e){var n,r,t=e.draggedHeaderRef,i=e.headersRef,l=e.hoveredHeaderRef,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,O=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=w([],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})),m=h.splice(v,1)[0];if(h.splice(g,0,m),!(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-O<800&&f<50||(O=p,W={screenX:d,screenY:u},c(h))}}},handleDragEnd:function(){t.current=null,l.current=null}}},P=c((function(r,o){var i,l,c=r.borderClass,s=r.colIndex,d=r.draggedHeaderRef,u=r.header,f=r.headersRef,h=r.hoveredHeaderRef,g=r.isSelected,m=r.isTopLeftCell,p=r.onCellEdit,w=r.onExpandRowClick,R=r.onMouseDown,b=r.onMouseOver,C=r.onTableHeaderDragEnd,x=r.rowIndex,I=r.visibleRow,M=I.depth,E=I.row,S=t(E.rowData[u.accessor]),N=S[0],k=S[1],T=t(!1),O=T[0],W=T[1],P=A({draggedHeaderRef:d,headersRef:f,hoveredHeaderRef:h,onTableHeaderDragEnd:C}).handleDragOver,z=B(),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),F=x%2==0,V="st-cell ".concat(M>0&&u.expandable?"st-cell-depth-".concat(M):""," ").concat(g?m?"st-cell-selected-first-cell ".concat(c):"st-cell-selected ".concat(c):""," ").concat(F?"st-cell-odd-row":"st-cell-even-row"," ").concat(j?"clickable":""," ").concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned");return a((function(){k(E.rowData[u.accessor])}),[u.accessor,E]),O?n("div",v({className:"st-cell-editing ".concat(F?"st-cell-odd-row":"st-cell-even-row"),id:D({accessor:u.accessor,rowIndex:x+1})},{children:n(L,{onChange:function(e){k(e),null==p||p({accessor:u.accessor,newValue:e,row:E})},setIsEditing:W,value:N})})):e("div",v({className:V,id:D({accessor:u.accessor,rowIndex:x+1}),onDoubleClick:function(){return u.isEditable&&W(!0)},onMouseDown:function(){return R(x,s)},onMouseOver:function(){return b(x,s)},onDragOver:function(e){return z({callback:P,callbackProps:{event:e,hoveredHeader:u},limit:50})},ref:o},{children:[u.expandable&&U?E.rowMeta.isExpanded?n("div",v({className:"st-sort-icon-container",onClick:function(){return w(E.rowMeta.rowId)}},{children:n(H,{className:"st-sort-icon"})})):n("div",v({className:"st-sort-icon-container",onClick:function(){return w(E.rowMeta.rowId)}},{children:n(y,{className:"st-sort-icon"})})):null,n("span",v({className:"st-cell-content"},{children:u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:E}):N}))]}))})),z=function(e){var t=e.allowAnimations,o=e.children,i=g(e,["allowAnimations","children"]);return t?n(U,v({},i,{children:o})):n(r,{children:o})},U=function(e){var i=e.allowHorizontalAnimate,l=void 0===i||i,c=e.children,d=e.draggedHeaderRef,u=e.headersRef,f=e.isBody,h=e.mainBodyRef,v=e.pauseAnimation,g=e.rowIndex,m=o(!1),p=t({}),w=p[0],R=p[1],b=o({}),C=u.current;return s((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:d,rowIndex:g});JSON.stringify(e)!==JSON.stringify(w)&&(b.current=w,R(e))}}),[w,C,d,f,g]),s((function(){var e=h.current,n=function(){m.current=!0},r=function(){m.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)}}),[d,h]),a((function(){v||m.current||Object.keys(b.current).length&&C&&C.forEach((function(e){var n=document.getElementById(D({accessor:e.accessor,rowIndex:g}));if(n){var r=b.current[e.accessor],t=w[e.accessor];if(r&&t){var o=r.left-t.left,i=l?0:r.top-t.top,a=Math.abs(o),c=Math.abs(i);(a>10||c>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,w,C,f,v,b,g]),n(r,{children:c})},j=function(e){var r=e.getBorderClass,t=e.handleMouseDown,o=e.handleMouseOver,i=e.headers,a=e.hiddenColumns,l=e.isSelected,c=e.isTopLeftCell,s=e.onExpandRowClick,u=e.pinned,f=e.rowIndex,h=e.visibleRow,m=g(e,["getBorderClass","handleMouseDown","handleMouseOver","headers","hiddenColumns","isSelected","isTopLeftCell","onExpandRowClick","pinned","rowIndex","visibleRow"]);return n(z,v({allowAnimations:m.allowAnimations,allowHorizontalAnimate:m.shouldPaginate,draggedHeaderRef:m.draggedHeaderRef,headersRef:m.headersRef,isBody:!0,mainBodyRef:m.mainBodyRef,pauseAnimation:m.isWidthDragging,rowIndex:f+1},{children:i.map((function(e,n){return E({hiddenColumns:a,header:e,pinned:u})?d(P,v({},m,{borderClass:r(f,n),colIndex:n,header:e,isSelected:l(f,n),isTopLeftCell:c(f,n),key:D({accessor:e.accessor,rowIndex:f+1}),onExpandRowClick:s,onMouseDown:function(){return t({rowIndex:f,colIndex:n})},onMouseOver:function(){return o(f,n)},rowIndex:f,visibleRow:h})):null}))}))},F=function(e){var r=e.getNextRowIndex,t=e.gridTemplateColumns,o=e.index,i=e.pinned,a=e.props,l=e.rowHeight,c=e.visibleRow,s=c.position,d=r();return n("div",v({className:"st-table-row",style:{gridTemplateColumns:t,top:M({position:s,rowHeight:l}),height:"".concat(l,"px")}},{children:n(j,v({pinned:i,rowIndex:d,visibleRow:c},a),o)}))},V=function(e){var r=e.lastGroupRow,t=e.position,o=e.rowHeight,i=e.templateColumns;return n("div",v({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:I({position:t,rowHeight:o})}},{children:n("div",{style:{gridColumn:"1 / -1"}})}))},J=function(t){t.headerContainerRef;var i=t.onExpandRowClick,l=t.pinned,c=t.rowHeight,s=t.sectionRef,d=t.templateColumns,u=t.totalHeight,f=t.visibleRows,h=t.width,m=g(t,["headerContainerRef","onExpandRowClick","pinned","rowHeight","sectionRef","templateColumns","totalHeight","visibleRows","width"]),p=l?"st-table-body-pinned-".concat(l):"st-table-body-main",w=o(0);a((function(){w.current=0}));var R=function(){return w.current++};return n("div",v({className:p,ref:s,style:{position:"relative",height:"".concat(u,"px"),width:h}},{children:f.map((function(t,o){var a,s,u=Boolean(null===(s=null===(a=t.row.rowMeta)||void 0===a?void 0:a.children)||void 0===s?void 0:s.length);return e(r,{children:[n(F,{getNextRowIndex:R,gridTemplateColumns:d,index:o,pinned:l,props:v(v({},m),{onExpandRowClick:i}),rowHeight:c,visibleRow:t},o),0!==o&&n(V,{lastGroupRow:u,position:t.position,rowHeight:c,templateColumns:d})]})}))}))},X=function(r){var c,s,d,u,f,h=r.centerHeaderRef,g=r.currentRows,R=r.headerContainerRef,b=r.mainBodyRef,C=r.mainTemplateColumns,y=r.pinnedLeftColumns,x=r.pinnedLeftHeaderRef,H=r.pinnedLeftRef,I=r.pinnedLeftTemplateColumns,M=r.pinnedRightColumns,D=r.pinnedRightHeaderRef,E=r.pinnedRightRef,S=r.pinnedRightTemplateColumns,N=r.scrollbarWidth,k=r.tableBodyContainerRef;!function(e){var n=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=t(!1),l=i[0],c=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;c(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(t),function(){t&&i.unobserve(t)}}}),[n,r])}({headerContainerRef:R,mainSectionRef:k,scrollbarWidth:N});var L=o(null),T=o(null),B=t(g),O=B[0],W=B[1],A=t(1),P=A[0],z=A[1],U=t(!1),j=U[0],F=U[1],V=t(!0),X=V[0],q=V[1],G=t(0),Y=G[0],K=G[1],$=function(e){var n=0,r=function(e){e.forEach((function(e){n+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&r(e.rowMeta.children)}))};return r(e),n}(O),Q=41*$-1,Z=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?v(v({},r),{rowMeta:v(v({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?v(v({},r),{rowMeta:v(v({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};W((function(e){return e.map(n)}))},_=l((function(){return function(e){var n=e.bufferRowCount,r=e.containerHeight,t=e.rowHeight,o=e.rows,i=e.scrollTop,a=[],l=0,c=Math.max(0,i-t*n),s=i+r+t*n,d=function(e,n){for(var r,o=0,i=e;o<i.length;o++){var u=i[o],f=l*t;if(f>=s)break;f+t>c&&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&&d(u.rowMeta.children,n+1)}};return d(o,0),a}({bufferRowCount:5,containerHeight:600,rowHeight:40,rows:O,scrollTop:Y})}),[O,Y]),ee=i((function(){return m(void 0,void 0,void 0,(function(){var e;return p(this,(function(n){return j||!X||(F(!0),e=g.slice(20*P,20*(P+1)),W((function(n){return w(w([],n,!0),e,!0)})),z((function(e){return e+1})),F(!1),e.length<20/3&&q(!1)),[2]}))}))}),[g,X,j,P]),ne=i((function(e){e[0].isIntersecting&&X&&!j&&ee()}),[X,j,ee]);a((function(){return L.current=new IntersectionObserver(ne,{root:null,rootMargin:"100px",threshold:0}),k.current&&L.current.observe(k.current),function(){L.current&&L.current.disconnect()}}),[ne,O,k]);var re=(null===(c=x.current)||void 0===c?void 0:c.clientWidth)?(null===(s=x.current)||void 0===s?void 0:s.clientWidth)+1:0,te=null===(d=h.current)||void 0===d?void 0:d.clientWidth,oe=(null===(u=D.current)||void 0===u?void 0:u.clientWidth)?(null===(f=D.current)||void 0===f?void 0:f.clientWidth)+1:0;return e("div",v({className:"st-table-body-container",ref:k,onScroll:function(e){var n=e.currentTarget.scrollTop;T.current&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame((function(){K(n)}))}},{children:[y.length>0&&n(J,v({},r,{onExpandRowClick:Z,pinned:"left",rowHeight:40,sectionRef:H,templateColumns:I,totalHeight:Q,visibleRows:_,width:re})),n(J,v({},r,{onExpandRowClick:Z,rowHeight:40,sectionRef:b,templateColumns:C,totalHeight:Q,visibleRows:_,width:te})),M.length>0&&n(J,v({},r,{onExpandRowClick:Z,pinned:"right",rowHeight:40,sectionRef:E,templateColumns:S,totalHeight:Q,visibleRows:_,width:oe}))]}))},q={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 q.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?q.string(e,n,r):"number"==typeof e&&"number"==typeof n?q.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?q.boolean(e,n,r):q.string(String(e),String(n),r)}},G=function(e,n,r,t){switch(void 0===r&&(r="string"),r){case"string":return q.string(String(e||""),String(n||""),t);case"number":return q.number(Number(e||0),Number(n||0),t);case"boolean":return q.boolean(Boolean(e),Boolean(n),t);case"date":return q.date(String(e||""),String(n||""),t);case"enum":return q.enum(String(e||""),String(n||""),t);default:return q.default(e,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;return w([],e,!0).sort((function(e,r){var t,a,l=null===(t=null==e?void 0:e.rowData)||void 0===t?void 0:t[n.key.accessor],c=null===(a=null==r?void 0:r.rowData)||void 0===a?void 0:a[n.key.accessor];return G(l,c,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?v(v({},e),{rowMeta:v(v({},e.rowMeta),{children:Y(e.rowMeta.children,n,r)})}):e}))},K=function(e,n,r){var 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=[],l=new Map;return e.forEach((function(n){e.some((function(e){var r;return null===(r=e.rowMeta.children)||void 0===r?void 0:r.some((function(e){return e.rowMeta.rowId===n.rowMeta.rowId}))}))||a.push(n),n.rowMeta.children&&n.rowMeta.children.length>0&&l.set(n.rowMeta.rowId,n.rowMeta.children)})),w([],a,!0).sort((function(e,r){var t,a,l=null===(t=null==e?void 0:e.rowData)||void 0===t?void 0:t[n.key.accessor],c=null===(a=null==r?void 0:r.rowData)||void 0===a?void 0:a[n.key.accessor];return G(l,c,o,i)})).map((function(e){var t=v({},e);if(l.has(e.rowMeta.rowId)){var o=l.get(e.rowMeta.rowId)||[],i=Y(o,n,r);t.rowMeta=v(v({},t.rowMeta),{children:i})}return t}))}(n,r,e);return{sortedData:t,newSortConfig:r}},$=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 c=n.clientX;if(t){var s=function(e){var n=Math.max(l+(e.clientX-c),40);t&&o.current&&(o.current[i].width=n,r())},d=function(){document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d),a(!1)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",d)}},Q=c((function(r,o){var i,l=r.columnResizing,c=r.currentRows,s=r.columnReordering,d=r.draggedHeaderRef,u=r.forceUpdate,f=r.headersRef,h=r.hoveredHeaderRef,g=r.index,m=r.onSort,p=r.onTableHeaderDragEnd,w=r.reverse,R=r.selectableColumns,b=r.setIsWidthDragging,C=r.setSelectedCells,y=r.sort,x=r.sortDownIcon,H=r.sortUpIcon,I=t(!1),M=I[0],E=I[1],S=null===(i=f.current)||void 0===i?void 0:i[g],N=Boolean(null==S?void 0:S.isSortable),k="st-header-cell ".concat(S===h.current?"st-hovered":""," ").concat(M?"st-dragging":""," ").concat(N?"clickable":""," ").concat(s&&!N?"columnReordering":""," ").concat("right"===(null==S?void 0:S.align)?"right-aligned":"center"===(null==S?void 0:S.align)?"center-aligned":""),L=A({draggedHeaderRef:d,headersRef:f,hoveredHeaderRef:h,onTableHeaderDragEnd:p}),T=L.handleDragStart,O=L.handleDragEnd,W=A({draggedHeaderRef:d,headersRef:f,hoveredHeaderRef:h,onTableHeaderDragEnd:p}).handleDragOver,P=B(),z=function(e){var n=e.event,r=e.header;if(R){var t=c.length,o=Array.from({length:t},(function(e,n){return"".concat(n,"-").concat(g)})),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("".concat(n,"-").concat(o+t))}))})),r};n.shiftKey?C((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)})):C(new Set(o))}else r.isSortable&&m(g,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)}}),[]),!S)return null;var U=l&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;P({callback:$,callbackProps:{event:e,forceUpdate:u,header:S,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})}});return e("div",v({className:k,id:D({accessor:S.accessor,rowIndex:0}),onDragOver:function(e){P({callback:W,callbackProps:{event:e,hoveredHeader:S},limit:50})},ref:o,style:{width:S.width}},{children:[w&&U,n("div",v({className:"st-header-label",draggable:s,onClick:function(e){return z({event:e,header:S})},onDragEnd:function(e){e.preventDefault(),E(!1),O()},onDragStart:function(e){s&&S&&function(e){E(!0),T(e)}(S)}},{children:null==S?void 0:S.label})),y&&y.key.accessor===S.accessor&&e("div",v({className:"st-sort-icon-container",onClick:function(e){return z({event:e,header:S})}},{children:["ascending"===y.direction&&H&&H,"descending"===y.direction&&x&&x]})),!w&&U]}))})),Z=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])},_=function(r){var t,o,i,a=r.allowAnimations,l=r.centerHeaderRef,c=r.columnResizing,s=r.currentRows,d=r.columnReordering,f=r.draggedHeaderRef,h=r.forceUpdate,g=r.headerContainerRef,m=r.headersRef,p=r.hiddenColumns,w=r.hoveredHeaderRef,R=r.isWidthDragging,b=r.mainBodyRef,C=r.mainTemplateColumns,y=r.onSort,x=r.onTableHeaderDragEnd,H=r.pinnedLeftColumns,I=r.pinnedLeftHeaderRef,M=r.pinnedLeftTemplateColumns,D=r.pinnedRightColumns,S=r.pinnedRightHeaderRef,N=r.pinnedRightTemplateColumns,k=r.selectableColumns,L=r.setIsWidthDragging,T=r.setSelectedCells,B=r.sort,O=r.sortDownIcon,W=r.sortUpIcon;Z(b,l);return e("div",v({className:"st-header-container",ref:g},{children:[H.length>0&&n("div",v({className:"st-header-pinned-left",ref:I,style:{gridTemplateColumns:M}},{children:n(z,v({allowAnimations:a,draggedHeaderRef:f,headersRef:m,mainBodyRef:b,pauseAnimation:R,rowIndex:0},{children:null===(t=m.current)||void 0===t?void 0:t.map((function(e,r){return E({hiddenColumns:p,header:e,pinned:"left"})?n(Q,{columnResizing:c,currentRows:s,columnReordering:d,draggedHeaderRef:f,forceUpdate:h,headersRef:m,hoveredHeaderRef:w,index:r,onSort:y,onTableHeaderDragEnd:x,ref:u(),selectableColumns:k,setIsWidthDragging:L,setSelectedCells:T,sort:B,sortDownIcon:O,sortUpIcon:W},e.accessor):null}))}))})),n("div",v({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=b.current)||void 0===r||r.scrollTo(t,0))},ref:l,style:{gridTemplateColumns:C}},{children:n(z,v({allowAnimations:a,draggedHeaderRef:f,headersRef:m,mainBodyRef:b,pauseAnimation:R,rowIndex:0},{children:null===(o=m.current)||void 0===o?void 0:o.map((function(e,r){return E({hiddenColumns:p,header:e})?n(Q,{columnResizing:c,currentRows:s,columnReordering:d,draggedHeaderRef:f,forceUpdate:h,headersRef:m,hoveredHeaderRef:w,index:r,onSort:y,onTableHeaderDragEnd:x,ref:u(),selectableColumns:k,setIsWidthDragging:L,setSelectedCells:T,sort:B,sortDownIcon:O,sortUpIcon:W},e.accessor):null}))}))})),D.length>0&&n("div",v({className:"st-header-pinned-right",ref:S,style:{gridTemplateColumns:N}},{children:n(z,v({allowAnimations:a,draggedHeaderRef:f,headersRef:m,mainBodyRef:b,pauseAnimation:R,rowIndex:0},{children:null===(i=m.current)||void 0===i?void 0:i.map((function(e,r){return E({hiddenColumns:p,header:e,pinned:"right"})?n(Q,{columnResizing:c,currentRows:s,columnReordering:d,draggedHeaderRef:f,forceUpdate:h,headersRef:m,hoveredHeaderRef:w,index:r,onSort:y,onTableHeaderDragEnd:x,reverse:!0,ref:u(),selectableColumns:k,setIsWidthDragging:L,setSelectedCells:T,sort:B,sortDownIcon:O,sortUpIcon:W},e.accessor):null}))}))}))]}))},ee=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},ne=function(r){var t=r.allowAnimations,i=r.columnResizing,a=r.currentRows,c=r.columnReordering,s=r.draggedHeaderRef,d=r.editColumns,u=r.forceUpdate,f=r.getBorderClass,h=r.handleMouseDown,g=r.handleMouseOver,m=r.headersRef,p=r.hiddenColumns,w=r.hoveredHeaderRef,R=r.isSelected,b=r.isTopLeftCell,C=r.isWidthDragging,y=r.mainBodyRef,x=r.onCellEdit,H=r.onSort,I=r.onTableHeaderDragEnd,M=r.pinnedLeftRef,D=r.pinnedRightRef,E=r.scrollbarWidth,S=r.selectableColumns,N=r.setIsWidthDragging,k=r.setSelectedCells,L=r.shouldPaginate,T=r.sort,B=r.sortDownIcon,O=r.sortUpIcon,W=r.tableBodyContainerRef,A=o(null),P=o(null),z=o(null),U=o(null),j=m.current.filter((function(e){return!e.hide&&!e.pinned})),F=m.current.filter((function(e){return"left"===e.pinned&&!0!==e.hide})),V=m.current.filter((function(e){return"right"===e.pinned&&!0!==e.hide})),J=l((function(){return"".concat(F.map((function(e){return ee(e)})).join(" "))}),[F]),q=l((function(){return"".concat(j.filter((function(e){return!0!==p[e.accessor]})).map((function(e){return ee(e)})).join(" "))}),[j,p]),G=l((function(){return"".concat(V.map((function(e){return ee(e)})).join(" "))}),[V]),Y={allowAnimations:t,centerHeaderRef:z,columnResizing:i,currentRows:a,columnReordering:c,draggedHeaderRef:s,forceUpdate:u,headerContainerRef:A,headersRef:m,hiddenColumns:p,hoveredHeaderRef:w,isWidthDragging:C,mainBodyRef:y,mainTemplateColumns:q,onSort:H,onTableHeaderDragEnd:I,pinnedLeftColumns:F,pinnedLeftHeaderRef:P,pinnedLeftTemplateColumns:J,pinnedRightColumns:V,pinnedRightHeaderRef:U,pinnedRightTemplateColumns:G,selectableColumns:S,setIsWidthDragging:N,setSelectedCells:k,sort:T,sortDownIcon:B,sortUpIcon:O,tableBodyContainerRef:W},K={allowAnimations:t,centerHeaderRef:z,currentRows:a,draggedHeaderRef:s,getBorderClass:f,handleMouseDown:h,handleMouseOver:g,headerContainerRef:A,headers:m.current,headersRef:m,hiddenColumns:p,hoveredHeaderRef:w,isSelected:R,isTopLeftCell:b,isWidthDragging:C,mainBodyRef:y,mainTemplateColumns:q,onCellEdit:x,onTableHeaderDragEnd:I,pinnedLeftColumns:F,pinnedLeftHeaderRef:P,pinnedLeftRef:M,pinnedLeftTemplateColumns:J,pinnedRightColumns:V,pinnedRightHeaderRef:U,pinnedRightRef:D,pinnedRightTemplateColumns:G,scrollbarWidth:E,shouldPaginate:L,tableBodyContainerRef:W};return e("div",v({className:"st-table-content",style:{width:d?"calc(100% - 27.5px)":"100%"}},{children:[n(_,v({},Y)),n(X,v({},K))]}))},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,c=r.tableContentWidth,s=t(0),d=s[0],u=s[1],f=t(0),h=f[0],g=f[1],m=t(0),p=m[0],w=m[1],R=o(null);return re({widthAttribute:"offsetWidth",callback:u,ref:a}),re({widthAttribute:"scrollWidth",callback:w,ref:i}),re({widthAttribute:"offsetWidth",callback:g,ref:l}),Z(i,R),!i.current||i.current.scrollWidth<=i.current.clientWidth?null:e("div",v({className:"st-horizontal-scrollbar-container",style:{width:c}},{children:[d>0&&n("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:d}}),p>0&&n("div",v({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:p}})})),h>0&&n("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:h}})]}))},oe=function(r){var o=r.checked,i=void 0!==o&&o,a=r.children,l=r.onChange,c=t(i),s=c[0],d=c[1];return e("label",v({className:"st-checkbox-label"},{children:[n("input",{checked:s,className:"st-checkbox-input",onChange:function(){var e=!s;d(e),l&&l(e)},type:"checkbox"}),n("span",v({className:"st-checkbox-custom ".concat(s?"st-checked":"")},{children:s&&n("span",{className:"st-checkbox-checkmark"})})),a]}))},ie=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",v({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:n("div",v({className:"st-column-editor-popout-content"},{children:r.map((function(e,r){return n(oe,v({checked:a[e.accessor],onChange:function(n){var r;return i(v(v({},a),((r={})[e.accessor]=n,r)))}},{children:e.label}),r)}))}))}))},ae=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,l=r.headers,c=r.position,s=void 0===c?"right":c,d=r.setHiddenColumns,u=r.hiddenColumns,f=t(a),h=f[0],g=f[1];return i?e("div",v({className:"st-column-editor ".concat(h?"open":""," ").concat(s),onClick:function(){return function(e){g(e)}(!h)}},{children:[n("div",v({className:"st-column-editor-text"},{children:o})),n(ie,{headers:l,open:h,position:s,setOpen:g,setHiddenColumns:d,hiddenColumns:u})]})):null};!function(e){e.Left="left",e.Right="right"}(R||(R={}));var le=function(r){var c=r.allowAnimations,d=void 0!==c&&c,u=r.columnEditorPosition,f=void 0===u?R.Right:u,g=r.columnEditorText,m=void 0===g?"Columns":g,p=r.columnResizing,w=void 0!==p&&p,I=r.defaultHeaders,M=r.editColumns,D=void 0!==M&&M,E=r.editColumnsInitOpen,S=void 0!==E&&E,N=r.columnReordering,k=void 0!==N&&N,L=r.height,T=r.hideFooter,B=void 0!==T&&T,O=r.nextIcon,W=void 0===O?n(y,{className:"st-next-prev-icon"}):O,A=r.onCellEdit,P=r.onColumnOrderChange,z=r.prevIcon,U=void 0===z?n(C,{className:"st-next-prev-icon"}):z,j=r.rows,F=r.rowsPerPage,V=void 0===F?10:F,J=r.selectableCells,X=void 0!==J&&J,q=r.selectableColumns,G=void 0!==q&&q,Y=r.shouldPaginate,$=void 0!==Y&&Y,Q=r.sortDownIcon,Z=void 0===Q?n(H,{className:"st-sort-icon"}):Q,_=r.sortUpIcon,ee=void 0===_?n(x,{className:"st-sort-icon"}):_,re=r.theme,oe=void 0===re?"light":re,ie=o(null),le=o(I),ce=o(null),se=o(null),de=o(null),ue=o(null),fe=o(null),he=t(!1),ve=he[0],ge=he[1],me=t(1),pe=me[0],we=me[1],Re=t(0),be=Re[0],Ce=Re[1],ye=t(0),xe=ye[0],He=ye[1],Ie=function(e){var n=e.headers,r=e.tableRows,o=t(null),i=o[0],a=o[1],c=l((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),s=t(c),d=s[0],u=s[1],f=l((function(){return i?K(n,r,i).sortedData:r}),[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:d,setHiddenColumns:u}}({headers:le.current,tableRows:j}),Me=Ie.sort,De=Ie.sortedRows,Ee=Ie.hiddenColumns,Se=Ie.setHiddenColumns,Ne=Ie.updateSort,ke=h((function(e){return e+1}),0)[1],Le=function(e){var n=e.selectableCells,r=e.headers,c=e.rows,s=t(new Set),d=s[0],u=s[1],f=o(!1),h=o(null),v=i((function(){var e=Array.from(d).reduce((function(e,n){var t=n.split("-").map(Number),o=t[0],i=t[1];return e[o]||(e[o]=[]),e[o][i]=c[o][r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");d.size>0&&navigator.clipboard.writeText(n)}),[d,c,r]);a((function(){var e=function(e){(e.ctrlKey||e.metaKey)&&"c"===e.key&&v()};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[v]);var g=i((function(e,n){return d.has("".concat(e,"-").concat(n))}),[d]),m=i((function(e,n){var r=[];return g(e-1,n)||r.push("st-selected-top-border"),g(e+1,n)||r.push("st-selected-bottom-border"),g(e,n-1)||r.push("st-selected-left-border"),g(e,n+1)||r.push("st-selected-right-border"),r.join(" ")}),[g]),p=l((function(){var e=Math.min.apply(Math,Array.from(d).map((function(e){return parseInt(e.split("-")[0])}))),n=Math.min.apply(Math,Array.from(d).map((function(e){return parseInt(e.split("-")[1])})));return function(r,t){return r===e&&t===n}}),[d]);return{selectedCells:d,handleMouseDown:function(e){var r=e.colIndex,t=e.rowIndex;n&&(f.current=!0,h.current={row:t,col:r},u(new Set(["".concat(t,"-").concat(r)])))},handleMouseOver:function(e,r){if(n&&f.current&&h.current){for(var t=new Set,o=Math.min(h.current.row,e),i=Math.max(h.current.row,e),a=Math.min(h.current.col,r),l=Math.max(h.current.col,r),c=o;c<=i;c++)for(var s=a;s<=l;s++)t.add("".concat(c,"-").concat(s));u(t)}},handleMouseUp:function(){f.current=!1,h.current=null},isSelected:g,getBorderClass:m,isTopLeftCell:p,setSelectedCells:u}}({selectableCells:X,headers:le.current,rows:De}),Te=Le.handleMouseDown,Be=Le.handleMouseOver,Oe=Le.handleMouseUp,We=Le.isSelected,Ae=Le.getBorderClass,Pe=Le.isTopLeftCell,ze=Le.setSelectedCells,Ue=l((function(){return $?De.slice((pe-1)*V,pe*V):De}),[pe,V,$,De]),je=i((function(e,n){Ne(e,n)}),[Ne]),Fe=i((function(e){le.current=e,ke(),null==P||P(e)}),[P]);return a((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"))||ze(new Set)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[G,ze]),s((function(){if(fe.current){var e=fe.current.offsetWidth-fe.current.clientWidth,n=fe.current.clientWidth;Ce(e),He(n)}}),[]),s((function(){var e=function(){if(ke(),fe.current){var e=fe.current.offsetWidth-fe.current.clientWidth,n=fe.current.clientWidth;Ce(e),He(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),e("div",v({className:"simple-table-root st-wrapper theme-".concat(oe),style:L?{height:L}:{}},{children:[e("div",v({className:"st-table-wrapper-container"},{children:[e("div",v({className:"st-table-wrapper",onMouseUp:Oe,onMouseLeave:Oe},{children:[n(ne,{allowAnimations:d,columnResizing:w,currentRows:Ue,draggedHeaderRef:ie,editColumns:D,columnReordering:k,forceUpdate:ke,getBorderClass:Ae,handleMouseDown:Te,handleMouseOver:Be,headers:le.current,headersRef:le,hiddenColumns:Ee,hoveredHeaderRef:ce,isSelected:We,isTopLeftCell:Pe,isWidthDragging:ve,mainBodyRef:se,onCellEdit:A,onSort:je,onTableHeaderDragEnd:Fe,pinnedLeftRef:de,pinnedRightRef:ue,scrollbarWidth:be,selectableColumns:G,setIsWidthDragging:ge,setSelectedCells:ze,shouldPaginate:$,sort:Me,sortDownIcon:Z,sortUpIcon:ee,tableBodyContainerRef:fe}),n(ae,{columnEditorText:m,editColumns:D,editColumnsInitOpen:S,headers:le.current,hiddenColumns:Ee,position:f,setHiddenColumns:Se})]})),n(te,{mainBodyRef:se,pinnedLeftRef:de,pinnedRightRef:ue,tableContentWidth:xe})]})),n(b,{currentPage:pe,hideFooter:B,nextIcon:W,onPageChange:we,prevIcon:U,rowsPerPage:V,shouldPaginate:$,totalRows:De.length})]}))};le.defaultProps={allowAnimations:!1,columnEditorPosition:R.Right,columnEditorText:"Columns",columnResizing:!1,defaultHeaders:[],editColumns:!1,editColumnsInitOpen:!1,columnReordering:!1,height:"",hideFooter:!1,nextIcon:n(y,{className:"st-next-prev-icon"}),onCellEdit:function(){},prevIcon:n(C,{className:"st-next-prev-icon"}),rows:[],rowsPerPage:10,selectableCells:!1,selectableColumns:!1,shouldPaginate:!1,sortDownIcon:n(H,{className:"st-sort-icon"}),sortUpIcon:n(x,{className:"st-sort-icon"}),theme:"light"};var ce=f(le);export{ce 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"),t=function(){return t=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},t.apply(this,arguments)};function r(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function o(e,n,t,r){return new(t||(t=Promise))((function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(i,s)}l((r=r.apply(e,n||[])).next())}))}function a(e,n){var t,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=n.call(e,a)}catch(e){s=[6,e],r=0}finally{t=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e,n,t){if(t||2===arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var s,l=function(n){var r=n.currentPage,o=n.hideFooter,a=n.nextIcon,i=n.onPageChange,s=n.prevIcon,l=n.rowsPerPage,c=n.shouldPaginate,d=n.totalRows,u=Math.ceil(d/l),f=r>1,h=r<u,v=function(e){e>=1&&e<=u&&i(e)};return o||!c?null:(console.log("totalPages",u),e.jsxs("div",t({className:"st-footer"},{children:[e.jsx("button",t({className:"st-next-prev-btn ".concat(f?"":"disabled"),onClick:function(){return v(r-1)},disabled:!f},{children:s})),e.jsx("button",t({className:"st-next-prev-btn ".concat(h?"":"disabled"),onClick:function(){return v(r+1)},disabled:!h},{children:a})),Array.from({length:u},(function(n,o){return e.jsx("button",t({onClick:function(){return v(o+1)},className:"st-page-btn ".concat(r===o+1?"active":"")},{children:o+1}),o)}))]})))},c=function(n){var r=n.className;return e.jsx("svg",t({className:r,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 r=n.className;return e.jsx("svg",t({className:r,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"})}))},u=n.createContext({rows:[],tableRows:[]}),f=function(n){var r=n.className;return e.jsx("svg",t({className:r,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"})}))},h=function(n){var r=n.className;return e.jsx("svg",t({className:r,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"})}))},v=function(r){var o=r.checked,a=void 0!==o&&o,i=r.children,s=r.onChange,l=n.useState(a),c=l[0],d=l[1];return e.jsxs("label",t({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:c,className:"st-checkbox-input",onChange:function(){var e=!c;d(e),s&&s(e)},type:"checkbox"}),e.jsx("span",t({className:"st-checkbox-custom ".concat(c?"st-checked":"")},{children:c&&e.jsx("span",{className:"st-checkbox-checkmark"})})),i]}))},m=function(n){var r=n.headers,o=n.open,a=n.position;n.setOpen;var i=n.setHiddenColumns,s=n.hiddenColumns,l="left"===a?"left":"";return e.jsx("div",t({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",t({className:"st-column-editor-popout-content"},{children:r.map((function(n,r){return e.jsx(v,t({checked:s[n.accessor],onChange:function(e){var r;return i(t(t({},s),((r={})[n.accessor]=e,r)))}},{children:n.label}),r)}))}))}))},g=function(r){var o=r.columnEditorText,a=r.editColumns,i=r.editColumnsInitOpen,s=r.headers,l=r.position,c=void 0===l?"right":l,d=r.setHiddenColumns,u=r.hiddenColumns,f=n.useState(i),h=f[0],v=f[1];return a?e.jsxs("div",t({className:"st-column-editor ".concat(h?"open":""," ").concat(c),onClick:function(){return function(e){v(e)}(!h)}},{children:[e.jsx("div",t({className:"st-column-editor-text"},{children:o})),e.jsx(m,{headers:s,open:h,position:c,setOpen:v,setHiddenColumns:d,hiddenColumns:u})]})):null},p=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},w=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},R=function(n){var r=n.value,o=n.onBlur,a=n.onChange;return e.jsxs("select",t({value:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;a("true"===n)}},{children:[e.jsx("option",t({value:"true"},{children:"True"})),e.jsx("option",t({value:"false"},{children:"False"}))]}))},x=function(t){var r=t.defaultValue,o=t.onBlur,a=t.onChange,i=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:i,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;a(n)}})},b=function(t){var r=t.defaultValue,o=t.onBlur,a=t.onChange,i=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:i,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&a(n)}})},C=function(n){var t=n.onChange,r=n.setIsEditing,o=n.value,a=function(e){null==t||t(e)},i=function(){r(!1)};return e.jsx(e.Fragment,{children:"string"==typeof o||null==o?e.jsx(x,{defaultValue:o,onBlur:i,onChange:a}):"boolean"==typeof o?e.jsx(R,{onBlur:i,onChange:a,value:o}):"number"==typeof o?e.jsx(b,{defaultValue:o,onBlur:i,onChange:a}):null})},y=0,j=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===y||o-y>=r)&&(y=o,n(t))}},H=Date.now(),S={screenX:0,screenY:0},M=function(e){var t,r,o=e.draggedHeaderRef,a=e.headersRef,s=e.hoveredHeaderRef,l=e.onTableHeaderDragEnd,c=(t=a.current,r=n.useRef(t),n.useEffect((function(){r.current=t}),[t]),r.current);return{handleDragStart:function(e){o.current=e,H=Date.now()},handleDragOver:function(e){var n,t=e.event,r=e.hoveredHeader;if(t.preventDefault(),a.current){var d=t.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=t.screenX,f=t.screenY,h=Math.sqrt(Math.pow(u-S.screenX,2)+Math.pow(f-S.screenY,2));s.current=r;var v=i([],a.current,!0),m=v.findIndex((function(e){var n;return e.accessor===(null===(n=o.current)||void 0===n?void 0:n.accessor)})),g=v.findIndex((function(e){return e.accessor===r.accessor})),p=v.splice(m,1)[0];if(v.splice(g,0,p),!(d||r.accessor===(null===(n=o.current)||void 0===n?void 0:n.accessor)||null===o.current||h<10||void 0===m||void 0===g||JSON.stringify(v)===JSON.stringify(a.current))){var w=Date.now();JSON.stringify(v)===JSON.stringify(c)&&w-H<800&&h<50||(H=w,S={screenX:u,screenY:f},l(v))}}},handleDragEnd:function(){o.current=null,s.current=null}}},E=n.forwardRef((function(r,o){var a=r.borderClass,i=r.cellHasChildren,s=r.colIndex,l=r.content,c=r.depth,u=r.draggedHeaderRef,f=r.header,v=r.headersRef,m=r.hoveredHeaderRef,g=r.isSelected,w=r.isTopLeftCell,R=r.onCellEdit,x=r.onExpandRowClick,b=r.onMouseDown,y=r.onMouseOver,H=r.onTableHeaderDragEnd,S=r.row,E=r.rowIndex,I=n.useState(l),D=I[0],k=I[1],L=n.useState(!1),N=L[0],T=L[1],B=M({draggedHeaderRef:u,headersRef:v,hoveredHeaderRef:m,onTableHeaderDragEnd:H}).handleDragOver,O=j(),A=Boolean(null==f?void 0:f.isEditable),W=E%2==0,P="st-cell ".concat(c>0&&f.expandable?"st-cell-depth-".concat(c):""," ").concat(g?w?"st-cell-selected-first-cell ".concat(a):"st-cell-selected ".concat(a):""," ").concat(W?"st-cell-odd-row":"st-cell-even-row"," ").concat(A?"clickable":""," ").concat("right"===f.align?"right-aligned":"");n.useEffect((function(){"object"!=typeof l&&k(l)}),[l]);return N?e.jsx("div",t({className:"st-cell-editing ".concat(W?"st-cell-odd-row":"st-cell-even-row"),id:p({accessor:f.accessor,rowIndex:E+1})},{children:e.jsx(C,{onChange:function(e){k(e),null==R||R({accessor:f.accessor,newValue:e,row:S})},setIsEditing:T,value:D})})):e.jsxs("div",t({className:P,id:p({accessor:f.accessor,rowIndex:E+1}),onDoubleClick:function(){return f.isEditable&&T(!0)},onMouseDown:function(){return b(E,s)},onMouseOver:function(){return y(E,s)},onDragOver:function(e){return O({callback:B,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:o},{children:[f.expandable&&i?S.rowMeta.isExpanded?e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return x(S.rowMeta.rowId)}},{children:e.jsx(h,{className:"st-sort-icon"})})):e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return x(S.rowMeta.rowId)}},{children:e.jsx(d,{className:"st-sort-icon"})})):null,e.jsx("span",{children:D})]}))})),I=n.forwardRef((function(n,t){return n.visible?e.jsx("div",{className:"st-cell",ref:t}):e.jsx("div",{ref:t})})),D=function(n){var t=n.lastGroupRow;return e.jsx("div",{className:"st-row-separator ".concat(t?"st-last-group-row":"")})},k=function(n){var o=n.allowAnimations,a=n.children,i=r(n,["allowAnimations","children"]);return o?e.jsx(L,t({},i,{children:a})):e.jsx(e.Fragment,{children:a})},L=function(t){var r=t.allowHorizontalAnimate,o=void 0===r||r,a=t.children,i=t.draggedHeaderRef,s=t.headersRef,l=t.isBody,c=t.mainBodyRef,d=t.pauseAnimation,u=t.rowIndex,f=n.useRef(!1),h=n.useState({}),v=h[0],m=h[1],g=n.useRef({}),w=s.current;return n.useLayoutEffect((function(){if(w){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var a=document.getElementById(p({accessor:e.accessor,rowIndex:r}));if(a){var i=a.getAnimations().some((function(e){return"running"===e.playState})),s=a.getBoundingClientRect();i&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=s}}})),o}({currentHeaders:w,draggedHeaderRef:i,rowIndex:u});JSON.stringify(e)!==JSON.stringify(v)&&(g.current=v,m(e))}}),[v,w,i,l,u]),n.useLayoutEffect((function(){var e=c.current,n=function(){f.current=!0},t=function(){f.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[i,c]),n.useEffect((function(){d||f.current||Object.keys(g.current).length&&w&&w.forEach((function(e){var n=document.getElementById(p({accessor:e.accessor,rowIndex:u}));if(n){var t=g.current[e.accessor],r=v[e.accessor];if(t&&r){var a=t.left-r.left,i=o?0:t.top-r.top,s=Math.abs(a),l=Math.abs(i);(s>10||l>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,v,w,l,d,g,u]),e.jsx(e.Fragment,{children:a})},N=function(o){var a,i=o.getBorderClass,s=o.handleMouseDown,l=o.handleMouseOver,c=o.headers,d=o.hiddenColumns,u=o.isSelected,f=o.isTopLeftCell,h=o.lastGroupRow,v=o.onExpandRowClick,m=o.pinned,g=o.row,p=o.rowIndex,R=o.shouldDisplayLastColumnCell,x=r(o,["getBorderClass","handleMouseDown","handleMouseOver","headers","hiddenColumns","isSelected","isTopLeftCell","lastGroupRow","onExpandRowClick","pinned","row","rowIndex","shouldDisplayLastColumnCell"]),b=null===(a=g.rowMeta)||void 0===a?void 0:a.children;return e.jsxs(k,t({allowAnimations:x.allowAnimations,allowHorizontalAnimate:x.shouldPaginate,draggedHeaderRef:x.draggedHeaderRef,headersRef:x.headersRef,isBody:!0,mainBodyRef:x.mainBodyRef,pauseAnimation:x.isWidthDragging,rowIndex:p+1},{children:[0!==p&&e.jsx(D,{lastGroupRow:h}),c.map((function(e,r){if(!w({hiddenColumns:d,header:e,pinned:m}))return null;var o=g.rowData[e.accessor];return e.cellRenderer&&(o=e.cellRenderer({accessor:e.accessor,colIndex:r,row:g})),n.createElement(E,t({},x,{borderClass:i(p,r),cellHasChildren:((null==b?void 0:b.length)||0)>0,colIndex:r,content:o,header:e,isSelected:u(p,r),isTopLeftCell:f(p,r),key:r,onExpandRowClick:v,onMouseDown:function(){return s({rowIndex:p,colIndex:r})},onMouseOver:function(){return l(p,r)},row:g,rowIndex:p}))})),e.jsx(I,{ref:n.createRef(),visible:R})]}))},T=function(r){var o=r.depth,a=void 0===o?0:o,i=r.getNextRowIndex,s=r.index,l=r.lastGroupRow,c=r.pinned,d=r.props,u=r.rowHeight,f=r.visibleRow,h=f.row,v=f.position,m=i(),g=d.headers.filter((function(e){return c===e.pinned})).map((function(e){return"".concat(e.width,"px")})).join(" ");return e.jsx("div",t({style:{display:"grid",gridTemplateColumns:g,position:"absolute",top:"".concat(v*u,"px"),height:"".concat(u,"px"),transform:"translateZ(0)",transition:"background 0.2s ease"}},{children:n.createElement(N,t({},d,{depth:a,lastGroupRow:l,key:s,pinned:c,row:h,rowIndex:m}))}))},B=function(o){o.headerContainerRef;var a=o.onExpandRowClick,i=o.pinned,s=o.rowHeight,l=o.sectionRef;o.templateColumns;var c=o.totalHeight,d=o.visibleRows,u=o.width,f=r(o,["headerContainerRef","onExpandRowClick","pinned","rowHeight","sectionRef","templateColumns","totalHeight","visibleRows","width"]),h=i?"st-table-body-pinned-".concat(i):"st-table-body-main",v=n.useRef(0);n.useEffect((function(){v.current=0}));var m=function(){return v.current++};return e.jsx("div",t({className:h,ref:l,style:{position:"relative",height:"".concat(c,"px"),width:u}},{children:d.map((function(n,r){var o,l;return e.jsx(T,{getNextRowIndex:m,index:r,lastGroupRow:Boolean(null===(l=null===(o=n.row.rowMeta)||void 0===o?void 0:o.children)||void 0===l?void 0:l.length),pinned:i,props:t(t({},f),{onExpandRowClick:a}),rowHeight:s,visibleRow:n},r)}))}))},O=function(r){var s,l,c,d,u,f=r.centerHeaderRef,h=r.currentRows,v=r.headerContainerRef,m=r.mainBodyRef,g=r.mainTemplateColumns,p=r.pinnedLeftColumns,w=r.pinnedLeftHeaderRef,R=r.pinnedLeftRef,x=r.pinnedLeftTemplateColumns,b=r.pinnedRightColumns,C=r.pinnedRightHeaderRef,y=r.pinnedRightRef,j=r.pinnedRightTemplateColumns,H=r.scrollbarWidth,S=r.tableBodyContainerRef;!function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,a=n.useState(!1),i=a[0],s=a[1];n.useEffect((function(){var e=null==t?void 0:t.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")}}),[t,i,o]),n.useEffect((function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;s(e)}};o();var a=new ResizeObserver((function(){o()}));return a.observe(n),function(){n&&a.unobserve(n)}}}),[t,r])}({headerContainerRef:v,mainSectionRef:S,scrollbarWidth:H});var M=n.useRef(null),E=n.useRef(null),I=n.useState(h),D=I[0],k=I[1],L=n.useState(1),N=L[0],T=L[1],O=n.useState(!1),A=O[0],W=O[1],P=n.useState(!0),z=P[0],U=P[1],F=n.useState(0),G=F[0],V=F[1],q=function(e){var n=0,t=function(e){e.forEach((function(e){n+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&t(e.rowMeta.children)}))};return t(e),n}(D),J=40*q,X=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};k((function(e){return e.map(n)}))},Y=n.useMemo((function(){return function(e){var n=e.bufferRowCount,t=e.containerHeight,r=e.rowHeight,o=e.rows,a=e.scrollTop,i=[],s=0,l=Math.max(0,a-r*n),c=a+t+r*n,d=function(e,n){for(var t,o=0,a=e;o<a.length;o++){var u=a[o],f=s*r;if(f>=c)break;f+r>l&&i.push({row:u,depth:n,position:s,isLastGroupRow:Boolean(null===(t=u.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),s+=1,u.rowMeta.isExpanded&&u.rowMeta.children&&d(u.rowMeta.children,n+1)}};return d(o,0),i}({rows:D,scrollTop:G,containerHeight:600,rowHeight:40,bufferRowCount:15})}),[D,G]),K=n.useCallback((function(){return o(void 0,void 0,void 0,(function(){var e;return a(this,(function(n){return A||!z||(W(!0),e=h.slice(15*N,15*(N+1)),k((function(n){return i(i([],n,!0),e,!0)})),T((function(e){return e+1})),W(!1),e.length<5&&U(!1)),[2]}))}))}),[h,z,A,N]),_=n.useCallback((function(e){e[0].isIntersecting&&z&&!A&&K()}),[z,A,K]);n.useEffect((function(){return M.current=new IntersectionObserver(_,{root:null,rootMargin:"100px",threshold:0}),S.current&&M.current.observe(S.current),function(){M.current&&M.current.disconnect()}}),[_,D,S]);var Z=(null===(s=w.current)||void 0===s?void 0:s.clientWidth)?(null===(l=w.current)||void 0===l?void 0:l.clientWidth)+1:0,$=null===(c=f.current)||void 0===c?void 0:c.clientWidth,Q=(null===(d=C.current)||void 0===d?void 0:d.clientWidth)?(null===(u=C.current)||void 0===u?void 0:u.clientWidth)+1:0;return e.jsxs("div",t({className:"st-table-body-container",ref:S,onScroll:function(e){var n=e.currentTarget.scrollTop;E.current&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame((function(){V(n)}))}},{children:[p.length>0&&e.jsx(B,t({},r,{onExpandRowClick:X,pinned:"left",rowHeight:40,sectionRef:R,templateColumns:x,totalHeight:J,visibleRows:Y,width:Z})),e.jsx(B,t({},r,{onExpandRowClick:X,rowHeight:40,sectionRef:m,templateColumns:g,totalHeight:J,visibleRows:Y,width:$})),b.length>0&&e.jsx(B,t({},r,{onExpandRowClick:X,pinned:"right",rowHeight:40,sectionRef:y,templateColumns:j,totalHeight:J,visibleRows:Y,width:Q}))]}))},A={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var a=r.getTime()-o.getTime();return"ascending"===t?a:-a},enum:function(e,n,t){return A.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?A.string(e,n,t):"number"==typeof e&&"number"==typeof n?A.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?A.boolean(e,n,t):A.string(String(e),String(n),t)}},W=function(e,n,t,r){switch(void 0===t&&(t="string"),t){case"string":return A.string(String(e||""),String(n||""),r);case"number":return A.number(Number(e||0),Number(n||0),r);case"boolean":return A.boolean(Boolean(e),Boolean(n),r);case"date":return A.date(String(e||""),String(n||""),r);case"enum":return A.enum(String(e||""),String(n||""),r);default:return A.default(e,n,r)}},P=function(e,n,r){var o=r.find((function(e){return e.accessor===n.key.accessor})),a=(null==o?void 0:o.type)||"string",s=n.direction;return i([],e,!0).sort((function(e,t){var r,o,i=null===(r=null==e?void 0:e.rowData)||void 0===r?void 0:r[n.key.accessor],l=null===(o=null==t?void 0:t.rowData)||void 0===o?void 0:o[n.key.accessor];return W(i,l,a,s)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?t(t({},e),{rowMeta:t(t({},e.rowMeta),{children:P(e.rowMeta.children,n,r)})}):e}))},z=function(e,n,r){var o=function(e,n,r){var o=r.find((function(e){return e.accessor===n.key.accessor})),a=(null==o?void 0:o.type)||"string",s=n.direction,l=[],c=new Map;return e.forEach((function(n){e.some((function(e){var t;return null===(t=e.rowMeta.children)||void 0===t?void 0:t.some((function(e){return e.rowMeta.rowId===n.rowMeta.rowId}))}))||l.push(n),n.rowMeta.children&&n.rowMeta.children.length>0&&c.set(n.rowMeta.rowId,n.rowMeta.children)})),i([],l,!0).sort((function(e,t){var r,o,i=null===(r=null==e?void 0:e.rowData)||void 0===r?void 0:r[n.key.accessor],l=null===(o=null==t?void 0:t.rowData)||void 0===o?void 0:o[n.key.accessor];return W(i,l,a,s)})).map((function(e){var o=t({},e);if(c.has(e.rowMeta.rowId)){var a=c.get(e.rowMeta.rowId)||[],i=P(a,n,r);o.rowMeta=t(t({},o.rowMeta),{children:i})}return o}))}(n,r,e);return{sortedData:o,newSortConfig:r}},U=function(e){var n=e.event,t=e.forceUpdate,r=e.header,o=e.headersRef,a=e.index;e.reverse;var i=e.setIsWidthDragging;i(!0),n.preventDefault();var s=n.clientX;if(r){var l=r.width,c=function(e){var n=Math.max(l+(e.clientX-s),40);r&&o.current&&(o.current[a].width=n,t())},d=function(){document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),i(!1)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",d)}},F=n.forwardRef((function(r,o){var a,i=r.columnResizing,s=r.currentRows,l=r.columnReordering,c=r.draggedHeaderRef,d=r.forceUpdate,u=r.headersRef,f=r.hoveredHeaderRef,h=r.index,v=r.onSort,m=r.onTableHeaderDragEnd,g=r.reverse,w=r.selectableColumns,R=r.setIsWidthDragging,x=r.setSelectedCells,b=r.sort,C=r.sortDownIcon,y=r.sortUpIcon,H=n.useState(!1),S=H[0],E=H[1],I=null===(a=u.current)||void 0===a?void 0:a[h],D=Boolean(null==I?void 0:I.isSortable),k="st-header-cell ".concat(I===f.current?"st-hovered":""," ").concat(S?"st-dragging":""," ").concat(D?"clickable":""," ").concat(l&&!D?"columnReordering":""," ").concat("right"===(null==I?void 0:I.align)?"right-aligned":""),L=M({draggedHeaderRef:c,headersRef:u,hoveredHeaderRef:f,onTableHeaderDragEnd:m}),N=L.handleDragStart,T=L.handleDragEnd,B=M({draggedHeaderRef:c,headersRef:u,hoveredHeaderRef:f,onTableHeaderDragEnd:m}).handleDragOver,O=j(),A=function(e){var n=e.event,t=e.header;if(w){var r=s.length,o=Array.from({length:r},(function(e,n){return"".concat(n,"-").concat(h)})),a=function(e,n){var t=new Set,o=Math.min(e,n),a=Math.max(e,n);return Array.from({length:r}).forEach((function(e,n){Array.from({length:a-o+1}).forEach((function(e,r){t.add("".concat(n,"-").concat(o+r))}))})),t};n.shiftKey?x((function(e){var n,t=Number(null===(n=Array.from(e)[0])||void 0===n?void 0:n.split("-")[1]),r=Number(o[0].split("-")[1]);return t===r?new Set(o):t>r?a(r,t):a(t,r)})):x(new Set(o))}else t.isSortable&&v(h,t.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)}}),[]),!I)return null;var W=i&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){O({callback:U,callbackProps:{event:e,forceUpdate:d,header:I,headersRef:u,index:h,setIsWidthDragging:R},limit:10})}});return e.jsxs("div",t({className:k,id:p({accessor:I.accessor,rowIndex:0}),onDragOver:function(e){O({callback:B,callbackProps:{event:e,hoveredHeader:I},limit:50})},ref:o,style:{width:I.width}},{children:[g&&W,e.jsx("div",t({className:"st-header-label",draggable:l,onClick:function(e){return A({event:e,header:I})},onDragEnd:function(e){e.preventDefault(),E(!1),T()},onDragStart:function(e){l&&I&&function(e){E(!0),N(e)}(I)}},{children:null==I?void 0:I.label})),b&&b.key.accessor===I.accessor&&e.jsxs("div",t({className:"st-sort-icon-container",onClick:function(e){return A({event:e,header:I})}},{children:["ascending"===b.direction&&y&&y,"descending"===b.direction&&C&&C]})),!g&&W]}))})),G=function(e,t){n.useEffect((function(){if(e.current){var n=e.current,r=function(){var e,r=null==n?void 0:n.scrollLeft;void 0!==r&&(null===(e=t.current)||void 0===e||e.scrollTo(r,0))};return n.addEventListener("scroll",r),function(){null==n||n.removeEventListener("scroll",r)}}}),[e,t])},V=function(r){var o,a,i,s=r.allowAnimations,l=r.centerHeaderRef,c=r.columnResizing,d=r.currentRows,u=r.columnReordering,f=r.draggedHeaderRef,h=r.forceUpdate,v=r.headerContainerRef,m=r.headersRef,g=r.hiddenColumns,p=r.hoveredHeaderRef,R=r.isWidthDragging,x=r.mainBodyRef,b=r.mainTemplateColumns,C=r.onSort,y=r.onTableHeaderDragEnd,j=r.pinnedLeftColumns,H=r.pinnedLeftHeaderRef,S=r.pinnedLeftTemplateColumns,M=r.pinnedRightColumns,E=r.pinnedRightHeaderRef,D=r.pinnedRightTemplateColumns,L=r.selectableColumns,N=r.setIsWidthDragging,T=r.setSelectedCells,B=r.shouldDisplayLastColumnCell,O=r.sort,A=r.sortDownIcon,W=r.sortUpIcon;G(x,l);return e.jsxs("div",t({className:"st-header-container",ref:v},{children:[j.length>0&&e.jsx("div",t({className:"st-header-pinned-left",ref:H,style:{gridTemplateColumns:S}},{children:e.jsx(k,t({allowAnimations:s,draggedHeaderRef:f,headersRef:m,mainBodyRef:x,pauseAnimation:R,rowIndex:0},{children:null===(o=m.current)||void 0===o?void 0:o.map((function(t,r){return w({hiddenColumns:g,header:t,pinned:"left"})?e.jsx(F,{columnResizing:c,currentRows:d,columnReordering:u,draggedHeaderRef:f,forceUpdate:h,headersRef:m,hoveredHeaderRef:p,index:r,onSort:C,onTableHeaderDragEnd:y,ref:n.createRef(),selectableColumns:L,setIsWidthDragging:N,setSelectedCells:T,sort:O,sortDownIcon:A,sortUpIcon:W},t.accessor):null}))}))})),e.jsx("div",t({className:"st-header-main",onScroll:function(e){var n,t,r=null===(n=l.current)||void 0===n?void 0:n.scrollLeft;void 0!==r&&(null===(t=x.current)||void 0===t||t.scrollTo(r,0))},ref:l,style:{gridTemplateColumns:b}},{children:e.jsxs(k,t({allowAnimations:s,draggedHeaderRef:f,headersRef:m,mainBodyRef:x,pauseAnimation:R,rowIndex:0},{children:[null===(a=m.current)||void 0===a?void 0:a.map((function(t,r){return w({hiddenColumns:g,header:t})?e.jsx(F,{columnResizing:c,currentRows:d,columnReordering:u,draggedHeaderRef:f,forceUpdate:h,headersRef:m,hoveredHeaderRef:p,index:r,onSort:C,onTableHeaderDragEnd:y,ref:n.createRef(),selectableColumns:L,setIsWidthDragging:N,setSelectedCells:T,sort:O,sortDownIcon:A,sortUpIcon:W},t.accessor):null})),e.jsx(I,{ref:n.createRef(),visible:B})]}))})),M.length>0&&e.jsx("div",t({className:"st-header-pinned-right",ref:E,style:{gridTemplateColumns:D}},{children:e.jsxs(k,t({allowAnimations:s,draggedHeaderRef:f,headersRef:m,mainBodyRef:x,pauseAnimation:R,rowIndex:0},{children:[null===(i=m.current)||void 0===i?void 0:i.map((function(t,r){return w({hiddenColumns:g,header:t,pinned:"right"})?e.jsx(F,{columnResizing:c,currentRows:d,columnReordering:u,draggedHeaderRef:f,forceUpdate:h,headersRef:m,hoveredHeaderRef:p,index:r,onSort:C,onTableHeaderDragEnd:y,reverse:!0,ref:n.createRef(),selectableColumns:L,setIsWidthDragging:N,setSelectedCells:T,sort:O,sortDownIcon:A,sortUpIcon:W},t.accessor):null})),e.jsx(I,{ref:n.createRef(),visible:B})]}))}))]}))},q=function(r){var o=r.allowAnimations,a=r.columnResizing,i=r.currentRows,s=r.columnReordering,l=r.draggedHeaderRef,c=r.editColumns,d=r.forceUpdate,u=r.getBorderClass,f=r.handleMouseDown,h=r.handleMouseOver,v=r.headersRef,m=r.hiddenColumns,g=r.hoveredHeaderRef,p=r.isSelected,w=r.isTopLeftCell,R=r.isWidthDragging,x=r.mainBodyRef,b=r.onCellEdit,C=r.onSort,y=r.onTableHeaderDragEnd,j=r.pinnedLeftRef,H=r.pinnedRightRef,S=r.scrollbarWidth,M=r.selectableColumns,E=r.setIsWidthDragging,I=r.setSelectedCells,D=r.shouldPaginate,k=r.sort,L=r.sortDownIcon,N=r.sortUpIcon,T=r.tableBodyContainerRef,B=n.useRef(null),A=n.useRef(null),W=n.useRef(null),P=n.useRef(null),z=v.current.filter((function(e){return!e.hide&&!e.pinned})),U=n.useMemo((function(){return!!x.current&&z.reduce((function(e,n){return e+n.width}),0)<x.current.clientWidth}),[z,x]),F=v.current.filter((function(e){return"left"===e.pinned&&!0!==e.hide})),G=v.current.filter((function(e){return"right"===e.pinned&&!0!==e.hide})),q=n.useMemo((function(){return"".concat(F.map((function(e){return"".concat(e.width,"px")})).join(" "))}),[F]),J=n.useMemo((function(){return"".concat(z.filter((function(e){return!0!==m[e.accessor]})).map((function(e){return"".concat(e.width,"px")})).join(" ")," 1fr")}),[z,m]),X=n.useMemo((function(){return"".concat(G.map((function(e){return"".concat(e.width,"px")})).join(" "))}),[G]),Y={allowAnimations:o,centerHeaderRef:W,columnResizing:a,currentRows:i,columnReordering:s,draggedHeaderRef:l,forceUpdate:d,headerContainerRef:B,headersRef:v,hiddenColumns:m,hoveredHeaderRef:g,isWidthDragging:R,mainBodyRef:x,mainTemplateColumns:J,onSort:C,onTableHeaderDragEnd:y,pinnedLeftColumns:F,pinnedLeftHeaderRef:A,pinnedLeftTemplateColumns:q,pinnedRightColumns:G,pinnedRightHeaderRef:P,pinnedRightTemplateColumns:X,selectableColumns:M,setIsWidthDragging:E,setSelectedCells:I,shouldDisplayLastColumnCell:U,sort:k,sortDownIcon:L,sortUpIcon:N,tableBodyContainerRef:T},K={allowAnimations:o,centerHeaderRef:W,currentRows:i,draggedHeaderRef:l,getBorderClass:u,handleMouseDown:f,handleMouseOver:h,headerContainerRef:B,headers:v.current,headersRef:v,hiddenColumns:m,hoveredHeaderRef:g,isSelected:p,isTopLeftCell:w,isWidthDragging:R,mainBodyRef:x,mainTemplateColumns:J,onCellEdit:b,onTableHeaderDragEnd:y,pinnedLeftColumns:F,pinnedLeftHeaderRef:A,pinnedLeftRef:j,pinnedLeftTemplateColumns:q,pinnedRightColumns:G,pinnedRightHeaderRef:P,pinnedRightRef:H,pinnedRightTemplateColumns:X,scrollbarWidth:S,shouldDisplayLastColumnCell:U,shouldPaginate:D,tableBodyContainerRef:T};return e.jsxs("div",t({className:"st-table-content",style:{width:c?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(V,t({},Y)),e.jsx(O,t({},K))]}))},J=function(e){var t=e.callback,r=e.ref,o=e.widthAttribute;n.useEffect((function(){var e=r.current;if(e){var n=function(){t(e[o]||0)};n();var a=new ResizeObserver((function(){n()}));return a.observe(e),function(){return a.disconnect()}}}),[t,r,o])},X=function(r){var o=r.mainBodyRef,a=r.pinnedLeftRef,i=r.pinnedRightRef,s=r.tableContentWidth,l=n.useState(0),c=l[0],d=l[1],u=n.useState(0),f=u[0],h=u[1],v=n.useState(0),m=v[0],g=v[1],p=n.useRef(null);return J({widthAttribute:"offsetWidth",callback:d,ref:a}),J({widthAttribute:"scrollWidth",callback:g,ref:o}),J({widthAttribute:"offsetWidth",callback:h,ref:i}),G(o,p),!o.current||o.current.scrollWidth<=o.current.clientWidth?null:e.jsxs("div",t({className:"st-horizontal-scrollbar-container",style:{width:s}},{children:[c>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:c}}),m>0&&e.jsx("div",t({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:p},{children:e.jsx("div",{style:{width:m}})})),f>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:f}})]}))};!function(e){e.Left="left",e.Right="right"}(s||(s={}));var Y=function(r){var o=r.allowAnimations,a=void 0!==o&&o,i=r.columnEditorPosition,v=void 0===i?s.Right:i,m=r.columnEditorText,p=void 0===m?"Columns":m,w=r.columnResizing,R=void 0!==w&&w,x=r.defaultHeaders,b=r.editColumns,C=void 0!==b&&b,y=r.editColumnsInitOpen,j=void 0!==y&&y,H=r.columnReordering,S=void 0!==H&&H,M=r.height,E=r.hideFooter,I=void 0!==E&&E,D=r.nextIcon,k=void 0===D?e.jsx(d,{className:"st-next-prev-icon"}):D,L=r.onCellEdit,N=r.onColumnOrderChange,T=r.prevIcon,B=void 0===T?e.jsx(c,{className:"st-next-prev-icon"}):T,O=r.rows,A=r.rowsPerPage,W=void 0===A?10:A,P=r.selectableCells,U=void 0!==P&&P,F=r.selectableColumns,G=void 0!==F&&F,V=r.shouldPaginate,J=void 0!==V&&V,Y=r.sortDownIcon,K=void 0===Y?e.jsx(h,{className:"st-sort-icon"}):Y,_=r.sortUpIcon,Z=void 0===_?e.jsx(f,{className:"st-sort-icon"}):_,$=r.theme,Q=void 0===$?"light":$,ee=n.useMemo((function(){return O.map((function(e,n){return t(t({},e),{originalRowIndex:n})}))}),[O]),ne=n.useRef(null),te=n.useRef(x),re=n.useRef(null),oe=n.useRef(null),ae=n.useRef(null),ie=n.useRef(null),se=n.useRef(null),le=n.useState(!1),ce=le[0],de=le[1],ue=n.useState(1),fe=ue[0],he=ue[1],ve=n.useState(0),me=ve[0],ge=ve[1],pe=n.useState(0),we=pe[0],Re=pe[1],xe=function(e,t){var r=n.useState(null),o=r[0],a=r[1],i=n.useState({}),s=i[0],l=i[1],c=n.useMemo((function(){return o?z(t,e,o).sortedData:e}),[e,o,t]);return{sort:o,setSort:a,updateSort:function(e,n){var r=t.find((function(e){return e.accessor===n}));r&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:r,direction:"descending"}:null:{key:r,direction:"ascending"}}))},sortedRows:c,hiddenColumns:s,setHiddenColumns:l}}(ee,te.current),be=xe.sort,Ce=xe.sortedRows,ye=xe.hiddenColumns,je=xe.setHiddenColumns,He=xe.updateSort,Se=n.useReducer((function(e){return e+1}),0)[1],Me=function(e){var t=e.selectableCells,r=e.headers,o=e.rows,a=n.useState(new Set),i=a[0],s=a[1],l=n.useRef(!1),c=n.useRef(null),d=n.useCallback((function(){var e=Array.from(i).reduce((function(e,n){var t=n.split("-").map(Number),a=t[0],i=t[1];return e[a]||(e[a]=[]),e[a][i]=o[a][r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");i.size>0&&navigator.clipboard.writeText(n)}),[i,o,r]);n.useEffect((function(){var e=function(e){(e.ctrlKey||e.metaKey)&&"c"===e.key&&d()};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[d]);var u=n.useCallback((function(e,n){return i.has("".concat(e,"-").concat(n))}),[i]),f=n.useCallback((function(e,n){var t=[];return u(e-1,n)||t.push("st-selected-top-border"),u(e+1,n)||t.push("st-selected-bottom-border"),u(e,n-1)||t.push("st-selected-left-border"),u(e,n+1)||t.push("st-selected-right-border"),t.join(" ")}),[u]),h=n.useMemo((function(){var e=Math.min.apply(Math,Array.from(i).map((function(e){return parseInt(e.split("-")[0])}))),n=Math.min.apply(Math,Array.from(i).map((function(e){return parseInt(e.split("-")[1])})));return function(t,r){return t===e&&r===n}}),[i]);return{selectedCells:i,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex;t&&(l.current=!0,c.current={row:r,col:n},s(new Set(["".concat(r,"-").concat(n)])))},handleMouseOver:function(e,n){if(t&&l.current&&c.current){for(var r=new Set,o=Math.min(c.current.row,e),a=Math.max(c.current.row,e),i=Math.min(c.current.col,n),d=Math.max(c.current.col,n),u=o;u<=a;u++)for(var f=i;f<=d;f++)r.add("".concat(u,"-").concat(f));s(r)}},handleMouseUp:function(){l.current=!1,c.current=null},isSelected:u,getBorderClass:f,isTopLeftCell:h,setSelectedCells:s}}({selectableCells:U,headers:te.current,rows:Ce}),Ee=Me.handleMouseDown,Ie=Me.handleMouseOver,De=Me.handleMouseUp,ke=Me.isSelected,Le=Me.getBorderClass,Ne=Me.isTopLeftCell,Te=Me.setSelectedCells,Be=n.useMemo((function(){return J?Ce.slice((fe-1)*W,fe*W):Ce}),[fe,W,J,Ce]),Oe=n.useCallback((function(e,n){He(e,n)}),[He]),Ae=n.useCallback((function(e){te.current=e,Se(),null==N||N(e)}),[]);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"))||Te(new Set)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[G,Te]),n.useLayoutEffect((function(){if(se.current){var e=se.current.offsetWidth-se.current.clientWidth,n=se.current.clientWidth;ge(e),Re(n)}}),[]),e.jsx(u.Provider,t({value:{rows:O,tableRows:ee}},{children:e.jsxs("div",t({className:"simple-table-root st-wrapper theme-".concat(Q),style:M?{height:M}:{}},{children:[e.jsxs("div",t({className:"st-table-wrapper-container"},{children:[e.jsxs("div",t({className:"st-table-wrapper",onMouseUp:De,onMouseLeave:De},{children:[e.jsx(q,{allowAnimations:a,columnResizing:R,currentRows:Be,draggedHeaderRef:ne,editColumns:C,columnReordering:S,forceUpdate:Se,getBorderClass:Le,handleMouseDown:Ee,handleMouseOver:Ie,headers:te.current,headersRef:te,hiddenColumns:ye,hoveredHeaderRef:re,isSelected:ke,isTopLeftCell:Ne,isWidthDragging:ce,mainBodyRef:oe,onCellEdit:L,onSort:Oe,onTableHeaderDragEnd:Ae,pinnedLeftRef:ae,pinnedRightRef:ie,scrollbarWidth:me,selectableColumns:G,setIsWidthDragging:de,setSelectedCells:Te,shouldPaginate:J,sort:be,sortDownIcon:K,sortUpIcon:Z,tableBodyContainerRef:se}),e.jsx(g,{columnEditorText:p,editColumns:C,editColumnsInitOpen:j,headers:te.current,hiddenColumns:ye,position:v,setHiddenColumns:je})]})),e.jsx(X,{mainBodyRef:oe,pinnedLeftRef:ae,pinnedRightRef:ie,tableContentWidth:we})]})),e.jsx(l,{currentPage:fe,hideFooter:I,nextIcon:k,onPageChange:he,prevIcon:B,rowsPerPage:W,shouldPaginate:J,totalRows:Ce.length})]}))}))};Y.defaultProps={allowAnimations:!1,columnEditorPosition:s.Right,columnEditorText:"Columns",columnResizing:!1,defaultHeaders:[],editColumns:!1,editColumnsInitOpen:!1,columnReordering:!1,height:"",hideFooter:!1,nextIcon:e.jsx(d,{className:"st-next-prev-icon"}),onCellEdit:function(){},prevIcon:e.jsx(c,{className:"st-next-prev-icon"}),rows:[],rowsPerPage:10,selectableCells:!1,selectableColumns:!1,shouldPaginate:!1,sortDownIcon:e.jsx(h,{className:"st-sort-icon"}),sortUpIcon:e.jsx(f,{className:"st-sort-icon"}),theme:"light"};var K=n.memo(Y);exports.SimpleTable=K;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=function(){return t=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},t.apply(this,arguments)};function r(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function o(e,n,t,r){return new(t||(t=Promise))((function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(i,s)}l((r=r.apply(e,n||[])).next())}))}function a(e,n){var t,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=n.call(e,a)}catch(e){s=[6,e],r=0}finally{t=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e,n,t){if(t||2===arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var s,l=function(n){var r=n.currentPage,o=n.hideFooter,a=n.nextIcon,i=n.onPageChange,s=n.prevIcon,l=n.rowsPerPage,c=n.shouldPaginate,d=n.totalRows,u=Math.ceil(d/l),f=r>1,h=r<u,v=function(e){e>=1&&e<=u&&i(e)};return o||!c?null:e.jsxs("div",t({className:"st-footer"},{children:[e.jsx("button",t({className:"st-next-prev-btn ".concat(f?"":"disabled"),onClick:function(){return v(r-1)},disabled:!f},{children:s})),e.jsx("button",t({className:"st-next-prev-btn ".concat(h?"":"disabled"),onClick:function(){return v(r+1)},disabled:!h},{children:a})),Array.from({length:u},(function(n,o){return e.jsx("button",t({onClick:function(){return v(o+1)},className:"st-page-btn ".concat(r===o+1?"active":"")},{children:o+1}),o)}))]}))},c=function(n){var r=n.className;return e.jsx("svg",t({className:r,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 r=n.className;return e.jsx("svg",t({className:r,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"})}))},u=function(n){var r=n.className;return e.jsx("svg",t({className:r,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"})}))},f=function(n){var r=n.className;return e.jsx("svg",t({className:r,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"})}))},h=function(e){return e.position*(e.rowHeight+1)-1},v=function(e){return e.position*(e.rowHeight+1)},m=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},g=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},p=function(n){var r=n.value,o=n.onBlur,a=n.onChange;return e.jsxs("select",t({value:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;a("true"===n)}},{children:[e.jsx("option",t({value:"true"},{children:"True"})),e.jsx("option",t({value:"false"},{children:"False"}))]}))},w=function(t){var r=t.defaultValue,o=t.onBlur,a=t.onChange,i=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:i,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;a(n)}})},R=function(t){var r=t.defaultValue,o=t.onBlur,a=t.onChange,i=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:i,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&a(n)}})},x=function(n){var t=n.onChange,r=n.setIsEditing,o=n.value,a=function(e){null==t||t(e)},i=function(){r(!1)};return e.jsx(e.Fragment,{children:"string"==typeof o||null==o?e.jsx(w,{defaultValue:o,onBlur:i,onChange:a}):"boolean"==typeof o?e.jsx(p,{onBlur:i,onChange:a,value:o}):"number"==typeof o?e.jsx(R,{defaultValue:o,onBlur:i,onChange:a}):null})},b=0,C=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===b||o-b>=r)&&(b=o,n(t))}},y=Date.now(),j={screenX:0,screenY:0},H=function(e){var t,r,o=e.draggedHeaderRef,a=e.headersRef,s=e.hoveredHeaderRef,l=e.onTableHeaderDragEnd,c=(t=a.current,r=n.useRef(t),n.useEffect((function(){r.current=t}),[t]),r.current);return{handleDragStart:function(e){o.current=e,y=Date.now()},handleDragOver:function(e){var n,t=e.event,r=e.hoveredHeader;if(t.preventDefault(),a.current){var d=t.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=t.screenX,f=t.screenY,h=Math.sqrt(Math.pow(u-j.screenX,2)+Math.pow(f-j.screenY,2));s.current=r;var v=i([],a.current,!0),m=v.findIndex((function(e){var n;return e.accessor===(null===(n=o.current)||void 0===n?void 0:n.accessor)})),g=v.findIndex((function(e){return e.accessor===r.accessor})),p=v.splice(m,1)[0];if(v.splice(g,0,p),!(d||r.accessor===(null===(n=o.current)||void 0===n?void 0:n.accessor)||null===o.current||h<10||void 0===m||void 0===g||JSON.stringify(v)===JSON.stringify(a.current))){var w=Date.now();JSON.stringify(v)===JSON.stringify(c)&&w-y<800&&h<50||(y=w,j={screenX:u,screenY:f},l(v))}}},handleDragEnd:function(){o.current=null,s.current=null}}},E=n.forwardRef((function(r,o){var a,i,s=r.borderClass,l=r.colIndex,c=r.draggedHeaderRef,u=r.header,h=r.headersRef,v=r.hoveredHeaderRef,g=r.isSelected,p=r.isTopLeftCell,w=r.onCellEdit,R=r.onExpandRowClick,b=r.onMouseDown,y=r.onMouseOver,j=r.onTableHeaderDragEnd,E=r.rowIndex,S=r.visibleRow,M=S.depth,I=S.row,D=n.useState(I.rowData[u.accessor]),k=D[0],N=D[1],L=n.useState(!1),T=L[0],B=L[1],O=H({draggedHeaderRef:c,headersRef:h,hoveredHeaderRef:v,onTableHeaderDragEnd:j}).handleDragOver,W=C(),A=Boolean(null===(i=null===(a=I.rowMeta)||void 0===a?void 0:a.children)||void 0===i?void 0:i.length),P=Boolean(null==u?void 0:u.isEditable),z=E%2==0,U="st-cell ".concat(M>0&&u.expandable?"st-cell-depth-".concat(M):""," ").concat(g?p?"st-cell-selected-first-cell ".concat(s):"st-cell-selected ".concat(s):""," ").concat(z?"st-cell-odd-row":"st-cell-even-row"," ").concat(P?"clickable":""," ").concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned");return n.useEffect((function(){N(I.rowData[u.accessor])}),[u.accessor,I]),T?e.jsx("div",t({className:"st-cell-editing ".concat(z?"st-cell-odd-row":"st-cell-even-row"),id:m({accessor:u.accessor,rowIndex:E+1})},{children:e.jsx(x,{onChange:function(e){N(e),null==w||w({accessor:u.accessor,newValue:e,row:I})},setIsEditing:B,value:k})})):e.jsxs("div",t({className:U,id:m({accessor:u.accessor,rowIndex:E+1}),onDoubleClick:function(){return u.isEditable&&B(!0)},onMouseDown:function(){return b(E,l)},onMouseOver:function(){return y(E,l)},onDragOver:function(e){return W({callback:O,callbackProps:{event:e,hoveredHeader:u},limit:50})},ref:o},{children:[u.expandable&&A?I.rowMeta.isExpanded?e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return R(I.rowMeta.rowId)}},{children:e.jsx(f,{className:"st-sort-icon"})})):e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return R(I.rowMeta.rowId)}},{children:e.jsx(d,{className:"st-sort-icon"})})):null,e.jsx("span",t({className:"st-cell-content"},{children:u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:l,row:I}):k}))]}))})),S=function(n){var o=n.allowAnimations,a=n.children,i=r(n,["allowAnimations","children"]);return o?e.jsx(M,t({},i,{children:a})):e.jsx(e.Fragment,{children:a})},M=function(t){var r=t.allowHorizontalAnimate,o=void 0===r||r,a=t.children,i=t.draggedHeaderRef,s=t.headersRef,l=t.isBody,c=t.mainBodyRef,d=t.pauseAnimation,u=t.rowIndex,f=n.useRef(!1),h=n.useState({}),v=h[0],g=h[1],p=n.useRef({}),w=s.current;return n.useLayoutEffect((function(){if(w){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var a=document.getElementById(m({accessor:e.accessor,rowIndex:r}));if(a){var i=a.getAnimations().some((function(e){return"running"===e.playState})),s=a.getBoundingClientRect();i&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=s}}})),o}({currentHeaders:w,draggedHeaderRef:i,rowIndex:u});JSON.stringify(e)!==JSON.stringify(v)&&(p.current=v,g(e))}}),[v,w,i,l,u]),n.useLayoutEffect((function(){var e=c.current,n=function(){f.current=!0},t=function(){f.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[i,c]),n.useEffect((function(){d||f.current||Object.keys(p.current).length&&w&&w.forEach((function(e){var n=document.getElementById(m({accessor:e.accessor,rowIndex:u}));if(n){var t=p.current[e.accessor],r=v[e.accessor];if(t&&r){var a=t.left-r.left,i=o?0:t.top-r.top,s=Math.abs(a),l=Math.abs(i);(s>10||l>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,v,w,l,d,p,u]),e.jsx(e.Fragment,{children:a})},I=function(o){var a=o.getBorderClass,i=o.handleMouseDown,s=o.handleMouseOver,l=o.headers,c=o.hiddenColumns,d=o.isSelected,u=o.isTopLeftCell,f=o.onExpandRowClick,h=o.pinned,v=o.rowIndex,p=o.visibleRow,w=r(o,["getBorderClass","handleMouseDown","handleMouseOver","headers","hiddenColumns","isSelected","isTopLeftCell","onExpandRowClick","pinned","rowIndex","visibleRow"]);return e.jsx(S,t({allowAnimations:w.allowAnimations,allowHorizontalAnimate:w.shouldPaginate,draggedHeaderRef:w.draggedHeaderRef,headersRef:w.headersRef,isBody:!0,mainBodyRef:w.mainBodyRef,pauseAnimation:w.isWidthDragging,rowIndex:v+1},{children:l.map((function(e,r){return g({hiddenColumns:c,header:e,pinned:h})?n.createElement(E,t({},w,{borderClass:a(v,r),colIndex:r,header:e,isSelected:d(v,r),isTopLeftCell:u(v,r),key:m({accessor:e.accessor,rowIndex:v+1}),onExpandRowClick:f,onMouseDown:function(){return i({rowIndex:v,colIndex:r})},onMouseOver:function(){return s(v,r)},rowIndex:v,visibleRow:p})):null}))}))},D=function(n){var r=n.getNextRowIndex,o=n.gridTemplateColumns,a=n.index,i=n.pinned,s=n.props,l=n.rowHeight,c=n.visibleRow,d=c.position,u=r();return e.jsx("div",t({className:"st-table-row",style:{gridTemplateColumns:o,top:v({position:d,rowHeight:l}),height:"".concat(l,"px")}},{children:e.jsx(I,t({pinned:i,rowIndex:u,visibleRow:c},s),a)}))},k=function(n){var r=n.lastGroupRow,o=n.position,a=n.rowHeight,i=n.templateColumns;return e.jsx("div",t({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:h({position:o,rowHeight:a})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},N=function(o){o.headerContainerRef;var a=o.onExpandRowClick,i=o.pinned,s=o.rowHeight,l=o.sectionRef,c=o.templateColumns,d=o.totalHeight,u=o.visibleRows,f=o.width,h=r(o,["headerContainerRef","onExpandRowClick","pinned","rowHeight","sectionRef","templateColumns","totalHeight","visibleRows","width"]),v=i?"st-table-body-pinned-".concat(i):"st-table-body-main",m=n.useRef(0);n.useEffect((function(){m.current=0}));var g=function(){return m.current++};return e.jsx("div",t({className:v,ref:l,style:{position:"relative",height:"".concat(d,"px"),width:f}},{children:u.map((function(n,r){var o,l,d=Boolean(null===(l=null===(o=n.row.rowMeta)||void 0===o?void 0:o.children)||void 0===l?void 0:l.length);return e.jsxs(e.Fragment,{children:[e.jsx(D,{getNextRowIndex:g,gridTemplateColumns:c,index:r,pinned:i,props:t(t({},h),{onExpandRowClick:a}),rowHeight:s,visibleRow:n},r),0!==r&&e.jsx(k,{lastGroupRow:d,position:n.position,rowHeight:s,templateColumns:c})]})}))}))},L=function(r){var s,l,c,d,u,f=r.centerHeaderRef,h=r.currentRows,v=r.headerContainerRef,m=r.mainBodyRef,g=r.mainTemplateColumns,p=r.pinnedLeftColumns,w=r.pinnedLeftHeaderRef,R=r.pinnedLeftRef,x=r.pinnedLeftTemplateColumns,b=r.pinnedRightColumns,C=r.pinnedRightHeaderRef,y=r.pinnedRightRef,j=r.pinnedRightTemplateColumns,H=r.scrollbarWidth,E=r.tableBodyContainerRef;!function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,a=n.useState(!1),i=a[0],s=a[1];n.useEffect((function(){var e=null==t?void 0:t.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")}}),[t,i,o]),n.useEffect((function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;s(e)}};o();var a=new ResizeObserver((function(){o()}));return a.observe(n),function(){n&&a.unobserve(n)}}}),[t,r])}({headerContainerRef:v,mainSectionRef:E,scrollbarWidth:H});var S=n.useRef(null),M=n.useRef(null),I=n.useState(h),D=I[0],k=I[1],L=n.useState(1),T=L[0],B=L[1],O=n.useState(!1),W=O[0],A=O[1],P=n.useState(!0),z=P[0],U=P[1],F=n.useState(0),V=F[0],q=F[1],J=function(e){var n=0,t=function(e){e.forEach((function(e){n+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&t(e.rowMeta.children)}))};return t(e),n}(D),X=41*J-1,G=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};k((function(e){return e.map(n)}))},Y=n.useMemo((function(){return function(e){var n=e.bufferRowCount,t=e.containerHeight,r=e.rowHeight,o=e.rows,a=e.scrollTop,i=[],s=0,l=Math.max(0,a-r*n),c=a+t+r*n,d=function(e,n){for(var t,o=0,a=e;o<a.length;o++){var u=a[o],f=s*r;if(f>=c)break;f+r>l&&i.push({row:u,depth:n,position:s,isLastGroupRow:Boolean(null===(t=u.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),s+=1,u.rowMeta.isExpanded&&u.rowMeta.children&&d(u.rowMeta.children,n+1)}};return d(o,0),i}({bufferRowCount:5,containerHeight:600,rowHeight:40,rows:D,scrollTop:V})}),[D,V]),K=n.useCallback((function(){return o(void 0,void 0,void 0,(function(){var e;return a(this,(function(n){return W||!z||(A(!0),e=h.slice(20*T,20*(T+1)),k((function(n){return i(i([],n,!0),e,!0)})),B((function(e){return e+1})),A(!1),e.length<20/3&&U(!1)),[2]}))}))}),[h,z,W,T]),_=n.useCallback((function(e){e[0].isIntersecting&&z&&!W&&K()}),[z,W,K]);n.useEffect((function(){return S.current=new IntersectionObserver(_,{root:null,rootMargin:"100px",threshold:0}),E.current&&S.current.observe(E.current),function(){S.current&&S.current.disconnect()}}),[_,D,E]);var $=(null===(s=w.current)||void 0===s?void 0:s.clientWidth)?(null===(l=w.current)||void 0===l?void 0:l.clientWidth)+1:0,Q=null===(c=f.current)||void 0===c?void 0:c.clientWidth,Z=(null===(d=C.current)||void 0===d?void 0:d.clientWidth)?(null===(u=C.current)||void 0===u?void 0:u.clientWidth)+1:0;return e.jsxs("div",t({className:"st-table-body-container",ref:E,onScroll:function(e){var n=e.currentTarget.scrollTop;M.current&&cancelAnimationFrame(M.current),M.current=requestAnimationFrame((function(){q(n)}))}},{children:[p.length>0&&e.jsx(N,t({},r,{onExpandRowClick:G,pinned:"left",rowHeight:40,sectionRef:R,templateColumns:x,totalHeight:X,visibleRows:Y,width:$})),e.jsx(N,t({},r,{onExpandRowClick:G,rowHeight:40,sectionRef:m,templateColumns:g,totalHeight:X,visibleRows:Y,width:Q})),b.length>0&&e.jsx(N,t({},r,{onExpandRowClick:G,pinned:"right",rowHeight:40,sectionRef:y,templateColumns:j,totalHeight:X,visibleRows:Y,width:Z}))]}))},T={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var a=r.getTime()-o.getTime();return"ascending"===t?a:-a},enum:function(e,n,t){return T.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?T.string(e,n,t):"number"==typeof e&&"number"==typeof n?T.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?T.boolean(e,n,t):T.string(String(e),String(n),t)}},B=function(e,n,t,r){switch(void 0===t&&(t="string"),t){case"string":return T.string(String(e||""),String(n||""),r);case"number":return T.number(Number(e||0),Number(n||0),r);case"boolean":return T.boolean(Boolean(e),Boolean(n),r);case"date":return T.date(String(e||""),String(n||""),r);case"enum":return T.enum(String(e||""),String(n||""),r);default:return T.default(e,n,r)}},O=function(e,n,r){var o=r.find((function(e){return e.accessor===n.key.accessor})),a=(null==o?void 0:o.type)||"string",s=n.direction;return i([],e,!0).sort((function(e,t){var r,o,i=null===(r=null==e?void 0:e.rowData)||void 0===r?void 0:r[n.key.accessor],l=null===(o=null==t?void 0:t.rowData)||void 0===o?void 0:o[n.key.accessor];return B(i,l,a,s)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?t(t({},e),{rowMeta:t(t({},e.rowMeta),{children:O(e.rowMeta.children,n,r)})}):e}))},W=function(e,n,r){var o=function(e,n,r){var o=r.find((function(e){return e.accessor===n.key.accessor})),a=(null==o?void 0:o.type)||"string",s=n.direction,l=[],c=new Map;return e.forEach((function(n){e.some((function(e){var t;return null===(t=e.rowMeta.children)||void 0===t?void 0:t.some((function(e){return e.rowMeta.rowId===n.rowMeta.rowId}))}))||l.push(n),n.rowMeta.children&&n.rowMeta.children.length>0&&c.set(n.rowMeta.rowId,n.rowMeta.children)})),i([],l,!0).sort((function(e,t){var r,o,i=null===(r=null==e?void 0:e.rowData)||void 0===r?void 0:r[n.key.accessor],l=null===(o=null==t?void 0:t.rowData)||void 0===o?void 0:o[n.key.accessor];return B(i,l,a,s)})).map((function(e){var o=t({},e);if(c.has(e.rowMeta.rowId)){var a=c.get(e.rowMeta.rowId)||[],i=O(a,n,r);o.rowMeta=t(t({},o.rowMeta),{children:i})}return o}))}(n,r,e);return{sortedData:o,newSortConfig:r}},A=function(e){var n=e.event,t=e.forceUpdate,r=e.header,o=e.headersRef,a=e.index;e.reverse;var i=e.setIsWidthDragging,s=e.startWidth;i(!0),n.preventDefault();var l=n.clientX;if(r){var c=function(e){var n=Math.max(s+(e.clientX-l),40);r&&o.current&&(o.current[a].width=n,t())},d=function(){document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),i(!1)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",d)}},P=n.forwardRef((function(r,o){var a,i=r.columnResizing,s=r.currentRows,l=r.columnReordering,c=r.draggedHeaderRef,d=r.forceUpdate,u=r.headersRef,f=r.hoveredHeaderRef,h=r.index,v=r.onSort,g=r.onTableHeaderDragEnd,p=r.reverse,w=r.selectableColumns,R=r.setIsWidthDragging,x=r.setSelectedCells,b=r.sort,y=r.sortDownIcon,j=r.sortUpIcon,E=n.useState(!1),S=E[0],M=E[1],I=null===(a=u.current)||void 0===a?void 0:a[h],D=Boolean(null==I?void 0:I.isSortable),k="st-header-cell ".concat(I===f.current?"st-hovered":""," ").concat(S?"st-dragging":""," ").concat(D?"clickable":""," ").concat(l&&!D?"columnReordering":""," ").concat("right"===(null==I?void 0:I.align)?"right-aligned":"center"===(null==I?void 0:I.align)?"center-aligned":""),N=H({draggedHeaderRef:c,headersRef:u,hoveredHeaderRef:f,onTableHeaderDragEnd:g}),L=N.handleDragStart,T=N.handleDragEnd,B=H({draggedHeaderRef:c,headersRef:u,hoveredHeaderRef:f,onTableHeaderDragEnd:g}).handleDragOver,O=C(),W=function(e){var n=e.event,t=e.header;if(w){var r=s.length,o=Array.from({length:r},(function(e,n){return"".concat(n,"-").concat(h)})),a=function(e,n){var t=new Set,o=Math.min(e,n),a=Math.max(e,n);return Array.from({length:r}).forEach((function(e,n){Array.from({length:a-o+1}).forEach((function(e,r){t.add("".concat(n,"-").concat(o+r))}))})),t};n.shiftKey?x((function(e){var n,t=Number(null===(n=Array.from(e)[0])||void 0===n?void 0:n.split("-")[1]),r=Number(o[0].split("-")[1]);return t===r?new Set(o):t>r?a(r,t):a(t,r)})):x(new Set(o))}else t.isSortable&&v(h,t.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)}}),[]),!I)return null;var P=i&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;O({callback:A,callbackProps:{event:e,forceUpdate:d,header:I,headersRef:u,index:h,setIsWidthDragging:R,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}});return e.jsxs("div",t({className:k,id:m({accessor:I.accessor,rowIndex:0}),onDragOver:function(e){O({callback:B,callbackProps:{event:e,hoveredHeader:I},limit:50})},ref:o,style:{width:I.width}},{children:[p&&P,e.jsx("div",t({className:"st-header-label",draggable:l,onClick:function(e){return W({event:e,header:I})},onDragEnd:function(e){e.preventDefault(),M(!1),T()},onDragStart:function(e){l&&I&&function(e){M(!0),L(e)}(I)}},{children:null==I?void 0:I.label})),b&&b.key.accessor===I.accessor&&e.jsxs("div",t({className:"st-sort-icon-container",onClick:function(e){return W({event:e,header:I})}},{children:["ascending"===b.direction&&j&&j,"descending"===b.direction&&y&&y]})),!p&&P]}))})),z=function(e,t){n.useEffect((function(){if(e.current){var n=e.current,r=function(){var e,r=null==n?void 0:n.scrollLeft;void 0!==r&&(null===(e=t.current)||void 0===e||e.scrollTo(r,0))};return n.addEventListener("scroll",r),function(){null==n||n.removeEventListener("scroll",r)}}}),[e,t])},U=function(r){var o,a,i,s=r.allowAnimations,l=r.centerHeaderRef,c=r.columnResizing,d=r.currentRows,u=r.columnReordering,f=r.draggedHeaderRef,h=r.forceUpdate,v=r.headerContainerRef,m=r.headersRef,p=r.hiddenColumns,w=r.hoveredHeaderRef,R=r.isWidthDragging,x=r.mainBodyRef,b=r.mainTemplateColumns,C=r.onSort,y=r.onTableHeaderDragEnd,j=r.pinnedLeftColumns,H=r.pinnedLeftHeaderRef,E=r.pinnedLeftTemplateColumns,M=r.pinnedRightColumns,I=r.pinnedRightHeaderRef,D=r.pinnedRightTemplateColumns,k=r.selectableColumns,N=r.setIsWidthDragging,L=r.setSelectedCells,T=r.sort,B=r.sortDownIcon,O=r.sortUpIcon;z(x,l);return e.jsxs("div",t({className:"st-header-container",ref:v},{children:[j.length>0&&e.jsx("div",t({className:"st-header-pinned-left",ref:H,style:{gridTemplateColumns:E}},{children:e.jsx(S,t({allowAnimations:s,draggedHeaderRef:f,headersRef:m,mainBodyRef:x,pauseAnimation:R,rowIndex:0},{children:null===(o=m.current)||void 0===o?void 0:o.map((function(t,r){return g({hiddenColumns:p,header:t,pinned:"left"})?e.jsx(P,{columnResizing:c,currentRows:d,columnReordering:u,draggedHeaderRef:f,forceUpdate:h,headersRef:m,hoveredHeaderRef:w,index:r,onSort:C,onTableHeaderDragEnd:y,ref:n.createRef(),selectableColumns:k,setIsWidthDragging:N,setSelectedCells:L,sort:T,sortDownIcon:B,sortUpIcon:O},t.accessor):null}))}))})),e.jsx("div",t({className:"st-header-main",onScroll:function(e){var n,t,r=null===(n=l.current)||void 0===n?void 0:n.scrollLeft;void 0!==r&&(null===(t=x.current)||void 0===t||t.scrollTo(r,0))},ref:l,style:{gridTemplateColumns:b}},{children:e.jsx(S,t({allowAnimations:s,draggedHeaderRef:f,headersRef:m,mainBodyRef:x,pauseAnimation:R,rowIndex:0},{children:null===(a=m.current)||void 0===a?void 0:a.map((function(t,r){return g({hiddenColumns:p,header:t})?e.jsx(P,{columnResizing:c,currentRows:d,columnReordering:u,draggedHeaderRef:f,forceUpdate:h,headersRef:m,hoveredHeaderRef:w,index:r,onSort:C,onTableHeaderDragEnd:y,ref:n.createRef(),selectableColumns:k,setIsWidthDragging:N,setSelectedCells:L,sort:T,sortDownIcon:B,sortUpIcon:O},t.accessor):null}))}))})),M.length>0&&e.jsx("div",t({className:"st-header-pinned-right",ref:I,style:{gridTemplateColumns:D}},{children:e.jsx(S,t({allowAnimations:s,draggedHeaderRef:f,headersRef:m,mainBodyRef:x,pauseAnimation:R,rowIndex:0},{children:null===(i=m.current)||void 0===i?void 0:i.map((function(t,r){return g({hiddenColumns:p,header:t,pinned:"right"})?e.jsx(P,{columnResizing:c,currentRows:d,columnReordering:u,draggedHeaderRef:f,forceUpdate:h,headersRef:m,hoveredHeaderRef:w,index:r,onSort:C,onTableHeaderDragEnd:y,reverse:!0,ref:n.createRef(),selectableColumns:k,setIsWidthDragging:N,setSelectedCells:L,sort:T,sortDownIcon:B,sortUpIcon:O},t.accessor):null}))}))}))]}))},F=function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"minmax(".concat(n,", ").concat(t,")"):t},V=function(r){var o=r.allowAnimations,a=r.columnResizing,i=r.currentRows,s=r.columnReordering,l=r.draggedHeaderRef,c=r.editColumns,d=r.forceUpdate,u=r.getBorderClass,f=r.handleMouseDown,h=r.handleMouseOver,v=r.headersRef,m=r.hiddenColumns,g=r.hoveredHeaderRef,p=r.isSelected,w=r.isTopLeftCell,R=r.isWidthDragging,x=r.mainBodyRef,b=r.onCellEdit,C=r.onSort,y=r.onTableHeaderDragEnd,j=r.pinnedLeftRef,H=r.pinnedRightRef,E=r.scrollbarWidth,S=r.selectableColumns,M=r.setIsWidthDragging,I=r.setSelectedCells,D=r.shouldPaginate,k=r.sort,N=r.sortDownIcon,T=r.sortUpIcon,B=r.tableBodyContainerRef,O=n.useRef(null),W=n.useRef(null),A=n.useRef(null),P=n.useRef(null),z=v.current.filter((function(e){return!e.hide&&!e.pinned})),V=v.current.filter((function(e){return"left"===e.pinned&&!0!==e.hide})),q=v.current.filter((function(e){return"right"===e.pinned&&!0!==e.hide})),J=n.useMemo((function(){return"".concat(V.map((function(e){return F(e)})).join(" "))}),[V]),X=n.useMemo((function(){return"".concat(z.filter((function(e){return!0!==m[e.accessor]})).map((function(e){return F(e)})).join(" "))}),[z,m]),G=n.useMemo((function(){return"".concat(q.map((function(e){return F(e)})).join(" "))}),[q]),Y={allowAnimations:o,centerHeaderRef:A,columnResizing:a,currentRows:i,columnReordering:s,draggedHeaderRef:l,forceUpdate:d,headerContainerRef:O,headersRef:v,hiddenColumns:m,hoveredHeaderRef:g,isWidthDragging:R,mainBodyRef:x,mainTemplateColumns:X,onSort:C,onTableHeaderDragEnd:y,pinnedLeftColumns:V,pinnedLeftHeaderRef:W,pinnedLeftTemplateColumns:J,pinnedRightColumns:q,pinnedRightHeaderRef:P,pinnedRightTemplateColumns:G,selectableColumns:S,setIsWidthDragging:M,setSelectedCells:I,sort:k,sortDownIcon:N,sortUpIcon:T,tableBodyContainerRef:B},K={allowAnimations:o,centerHeaderRef:A,currentRows:i,draggedHeaderRef:l,getBorderClass:u,handleMouseDown:f,handleMouseOver:h,headerContainerRef:O,headers:v.current,headersRef:v,hiddenColumns:m,hoveredHeaderRef:g,isSelected:p,isTopLeftCell:w,isWidthDragging:R,mainBodyRef:x,mainTemplateColumns:X,onCellEdit:b,onTableHeaderDragEnd:y,pinnedLeftColumns:V,pinnedLeftHeaderRef:W,pinnedLeftRef:j,pinnedLeftTemplateColumns:J,pinnedRightColumns:q,pinnedRightHeaderRef:P,pinnedRightRef:H,pinnedRightTemplateColumns:G,scrollbarWidth:E,shouldPaginate:D,tableBodyContainerRef:B};return e.jsxs("div",t({className:"st-table-content",style:{width:c?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(U,t({},Y)),e.jsx(L,t({},K))]}))},q=function(e){var t=e.callback,r=e.ref,o=e.widthAttribute;n.useEffect((function(){var e=r.current;if(e){var n=function(){t(e[o]||0)};n();var a=new ResizeObserver((function(){n()}));return a.observe(e),function(){return a.disconnect()}}}),[t,r,o])},J=function(r){var o=r.mainBodyRef,a=r.pinnedLeftRef,i=r.pinnedRightRef,s=r.tableContentWidth,l=n.useState(0),c=l[0],d=l[1],u=n.useState(0),f=u[0],h=u[1],v=n.useState(0),m=v[0],g=v[1],p=n.useRef(null);return q({widthAttribute:"offsetWidth",callback:d,ref:a}),q({widthAttribute:"scrollWidth",callback:g,ref:o}),q({widthAttribute:"offsetWidth",callback:h,ref:i}),z(o,p),!o.current||o.current.scrollWidth<=o.current.clientWidth?null:e.jsxs("div",t({className:"st-horizontal-scrollbar-container",style:{width:s}},{children:[c>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:c}}),m>0&&e.jsx("div",t({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:p},{children:e.jsx("div",{style:{width:m}})})),f>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:f}})]}))},X=function(r){var o=r.checked,a=void 0!==o&&o,i=r.children,s=r.onChange,l=n.useState(a),c=l[0],d=l[1];return e.jsxs("label",t({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:c,className:"st-checkbox-input",onChange:function(){var e=!c;d(e),s&&s(e)},type:"checkbox"}),e.jsx("span",t({className:"st-checkbox-custom ".concat(c?"st-checked":"")},{children:c&&e.jsx("span",{className:"st-checkbox-checkmark"})})),i]}))},G=function(n){var r=n.headers,o=n.open,a=n.position;n.setOpen;var i=n.setHiddenColumns,s=n.hiddenColumns,l="left"===a?"left":"";return e.jsx("div",t({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",t({className:"st-column-editor-popout-content"},{children:r.map((function(n,r){return e.jsx(X,t({checked:s[n.accessor],onChange:function(e){var r;return i(t(t({},s),((r={})[n.accessor]=e,r)))}},{children:n.label}),r)}))}))}))},Y=function(r){var o=r.columnEditorText,a=r.editColumns,i=r.editColumnsInitOpen,s=r.headers,l=r.position,c=void 0===l?"right":l,d=r.setHiddenColumns,u=r.hiddenColumns,f=n.useState(i),h=f[0],v=f[1];return a?e.jsxs("div",t({className:"st-column-editor ".concat(h?"open":""," ").concat(c),onClick:function(){return function(e){v(e)}(!h)}},{children:[e.jsx("div",t({className:"st-column-editor-text"},{children:o})),e.jsx(G,{headers:s,open:h,position:c,setOpen:v,setHiddenColumns:d,hiddenColumns:u})]})):null};!function(e){e.Left="left",e.Right="right"}(s||(s={}));var K=function(r){var o=r.allowAnimations,a=void 0!==o&&o,i=r.columnEditorPosition,h=void 0===i?s.Right:i,v=r.columnEditorText,m=void 0===v?"Columns":v,g=r.columnResizing,p=void 0!==g&&g,w=r.defaultHeaders,R=r.editColumns,x=void 0!==R&&R,b=r.editColumnsInitOpen,C=void 0!==b&&b,y=r.columnReordering,j=void 0!==y&&y,H=r.height,E=r.hideFooter,S=void 0!==E&&E,M=r.nextIcon,I=void 0===M?e.jsx(d,{className:"st-next-prev-icon"}):M,D=r.onCellEdit,k=r.onColumnOrderChange,N=r.prevIcon,L=void 0===N?e.jsx(c,{className:"st-next-prev-icon"}):N,T=r.rows,B=r.rowsPerPage,O=void 0===B?10:B,A=r.selectableCells,P=void 0!==A&&A,z=r.selectableColumns,U=void 0!==z&&z,F=r.shouldPaginate,q=void 0!==F&&F,X=r.sortDownIcon,G=void 0===X?e.jsx(f,{className:"st-sort-icon"}):X,K=r.sortUpIcon,_=void 0===K?e.jsx(u,{className:"st-sort-icon"}):K,$=r.theme,Q=void 0===$?"light":$,Z=n.useRef(null),ee=n.useRef(w),ne=n.useRef(null),te=n.useRef(null),re=n.useRef(null),oe=n.useRef(null),ae=n.useRef(null),ie=n.useState(!1),se=ie[0],le=ie[1],ce=n.useState(1),de=ce[0],ue=ce[1],fe=n.useState(0),he=fe[0],ve=fe[1],me=n.useState(0),ge=me[0],pe=me[1],we=function(e){var t=e.headers,r=e.tableRows,o=n.useState(null),a=o[0],i=o[1],s=n.useMemo((function(){var e={};return t.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[t]),l=n.useState(s),c=l[0],d=l[1],u=n.useMemo((function(){return a?W(t,r,a).sortedData:r}),[r,a,t]);return{sort:a,setSort:i,updateSort:function(e,n){var r=t.find((function(e){return e.accessor===n}));r&&i((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:r,direction:"descending"}:null:{key:r,direction:"ascending"}}))},sortedRows:u,hiddenColumns:c,setHiddenColumns:d}}({headers:ee.current,tableRows:T}),Re=we.sort,xe=we.sortedRows,be=we.hiddenColumns,Ce=we.setHiddenColumns,ye=we.updateSort,je=n.useReducer((function(e){return e+1}),0)[1],He=function(e){var t=e.selectableCells,r=e.headers,o=e.rows,a=n.useState(new Set),i=a[0],s=a[1],l=n.useRef(!1),c=n.useRef(null),d=n.useCallback((function(){var e=Array.from(i).reduce((function(e,n){var t=n.split("-").map(Number),a=t[0],i=t[1];return e[a]||(e[a]=[]),e[a][i]=o[a][r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");i.size>0&&navigator.clipboard.writeText(n)}),[i,o,r]);n.useEffect((function(){var e=function(e){(e.ctrlKey||e.metaKey)&&"c"===e.key&&d()};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[d]);var u=n.useCallback((function(e,n){return i.has("".concat(e,"-").concat(n))}),[i]),f=n.useCallback((function(e,n){var t=[];return u(e-1,n)||t.push("st-selected-top-border"),u(e+1,n)||t.push("st-selected-bottom-border"),u(e,n-1)||t.push("st-selected-left-border"),u(e,n+1)||t.push("st-selected-right-border"),t.join(" ")}),[u]),h=n.useMemo((function(){var e=Math.min.apply(Math,Array.from(i).map((function(e){return parseInt(e.split("-")[0])}))),n=Math.min.apply(Math,Array.from(i).map((function(e){return parseInt(e.split("-")[1])})));return function(t,r){return t===e&&r===n}}),[i]);return{selectedCells:i,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex;t&&(l.current=!0,c.current={row:r,col:n},s(new Set(["".concat(r,"-").concat(n)])))},handleMouseOver:function(e,n){if(t&&l.current&&c.current){for(var r=new Set,o=Math.min(c.current.row,e),a=Math.max(c.current.row,e),i=Math.min(c.current.col,n),d=Math.max(c.current.col,n),u=o;u<=a;u++)for(var f=i;f<=d;f++)r.add("".concat(u,"-").concat(f));s(r)}},handleMouseUp:function(){l.current=!1,c.current=null},isSelected:u,getBorderClass:f,isTopLeftCell:h,setSelectedCells:s}}({selectableCells:P,headers:ee.current,rows:xe}),Ee=He.handleMouseDown,Se=He.handleMouseOver,Me=He.handleMouseUp,Ie=He.isSelected,De=He.getBorderClass,ke=He.isTopLeftCell,Ne=He.setSelectedCells,Le=n.useMemo((function(){return q?xe.slice((de-1)*O,de*O):xe}),[de,O,q,xe]),Te=n.useCallback((function(e,n){ye(e,n)}),[ye]),Be=n.useCallback((function(e){ee.current=e,je(),null==k||k(e)}),[k]);return n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||U&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||Ne(new Set)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[U,Ne]),n.useLayoutEffect((function(){if(ae.current){var e=ae.current.offsetWidth-ae.current.clientWidth,n=ae.current.clientWidth;ve(e),pe(n)}}),[]),n.useLayoutEffect((function(){var e=function(){if(je(),ae.current){var e=ae.current.offsetWidth-ae.current.clientWidth,n=ae.current.clientWidth;ve(e),pe(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),e.jsxs("div",t({className:"simple-table-root st-wrapper theme-".concat(Q),style:H?{height:H}:{}},{children:[e.jsxs("div",t({className:"st-table-wrapper-container"},{children:[e.jsxs("div",t({className:"st-table-wrapper",onMouseUp:Me,onMouseLeave:Me},{children:[e.jsx(V,{allowAnimations:a,columnResizing:p,currentRows:Le,draggedHeaderRef:Z,editColumns:x,columnReordering:j,forceUpdate:je,getBorderClass:De,handleMouseDown:Ee,handleMouseOver:Se,headers:ee.current,headersRef:ee,hiddenColumns:be,hoveredHeaderRef:ne,isSelected:Ie,isTopLeftCell:ke,isWidthDragging:se,mainBodyRef:te,onCellEdit:D,onSort:Te,onTableHeaderDragEnd:Be,pinnedLeftRef:re,pinnedRightRef:oe,scrollbarWidth:he,selectableColumns:U,setIsWidthDragging:le,setSelectedCells:Ne,shouldPaginate:q,sort:Re,sortDownIcon:G,sortUpIcon:_,tableBodyContainerRef:ae}),e.jsx(Y,{columnEditorText:m,editColumns:x,editColumnsInitOpen:C,headers:ee.current,hiddenColumns:be,position:h,setHiddenColumns:Ce})]})),e.jsx(J,{mainBodyRef:te,pinnedLeftRef:re,pinnedRightRef:oe,tableContentWidth:ge})]})),e.jsx(l,{currentPage:de,hideFooter:S,nextIcon:I,onPageChange:ue,prevIcon:L,rowsPerPage:O,shouldPaginate:q,totalRows:xe.length})]}))};K.defaultProps={allowAnimations:!1,columnEditorPosition:s.Right,columnEditorText:"Columns",columnResizing:!1,defaultHeaders:[],editColumns:!1,editColumnsInitOpen:!1,columnReordering:!1,height:"",hideFooter:!1,nextIcon:e.jsx(d,{className:"st-next-prev-icon"}),onCellEdit:function(){},prevIcon:e.jsx(c,{className:"st-next-prev-icon"}),rows:[],rowsPerPage:10,selectableCells:!1,selectableColumns:!1,shouldPaginate:!1,sortDownIcon:e.jsx(f,{className:"st-sort-icon"}),sortUpIcon:e.jsx(u,{className:"st-sort-icon"}),theme:"light"};var _=n.memo(K);exports.SimpleTable=_;
|
|
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-200);--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-700);--st-selected-first-cell-background-color:var(--st-amber-700);--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-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-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-50);--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-amber-600);--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-amber-600);--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-slate-900);--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-900);--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-800);--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-600);--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-600);--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}.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)}.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)}.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{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width))}.st-header-cell.right-aligned>.st-header-label{text-align:right}.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{color:var(--st-cell-color);flex:1}.st-cell,.st-header-label{overflow:hidden;padding:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;user-select:none;white-space:nowrap;width:100%}.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)*5)}.st-cell-depth-3{padding-left:calc(var(--st-cell-padding)*6)}.st-cell-depth-4{padding-left:calc(var(--st-cell-padding)*7)}.st-cell-depth-5{padding-left:calc(var(--st-cell-padding)*8)}.st-cell-depth-6{padding-left:calc(var(--st-cell-padding)*9)}.st-cell-depth-7{padding-left:calc(var(--st-cell-padding)*10)}.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);color:var(--st-selected-first-cell-color)}.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-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-200);--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-700);--st-selected-first-cell-background-color:var(--st-amber-700);--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-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-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-50);--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-amber-600);--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-amber-600);--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-slate-900);--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-900);--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-800);--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-600);--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-600);--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)}.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)}.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-cell-content,.st-header-label{box-sizing:border-box;color:var(--st-cell-color);flex:1;height:100%;overflow:hidden;padding:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;user-select:none;white-space:nowrap;width:100%}.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);color:var(--st-selected-first-cell-color)}.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)}
|
|
@@ -13,8 +13,9 @@ type HeaderObject = {
|
|
|
13
13
|
isEditable?: boolean;
|
|
14
14
|
isSortable?: boolean;
|
|
15
15
|
label: string;
|
|
16
|
+
minWidth?: number | string;
|
|
16
17
|
pinned?: "left" | "right";
|
|
17
18
|
type?: "string" | "number" | "boolean" | "date" | "enum";
|
|
18
|
-
width: number;
|
|
19
|
+
width: number | string;
|
|
19
20
|
};
|
|
20
21
|
export default HeaderObject;
|
package/dist/types/Row.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type RowId = string | number;
|
|
@@ -18,7 +18,6 @@ interface SharedTableProps {
|
|
|
18
18
|
pinnedRightColumns: HeaderObject[];
|
|
19
19
|
pinnedRightHeaderRef: RefObject<HTMLDivElement | null>;
|
|
20
20
|
pinnedRightTemplateColumns: string;
|
|
21
|
-
shouldDisplayLastColumnCell: boolean;
|
|
22
21
|
tableBodyContainerRef: RefObject<HTMLDivElement | null>;
|
|
23
22
|
}
|
|
24
23
|
export default SharedTableProps;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RefObject } from "react";
|
|
2
2
|
import HeaderObject from "./HeaderObject";
|
|
3
3
|
import CellChangeProps from "./CellChangeProps";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import { RowId } from "./RowId";
|
|
5
|
+
import VisibleRow from "./VisibleRow";
|
|
6
6
|
export interface TableCellProps {
|
|
7
7
|
borderClass: string;
|
|
8
|
-
cellHasChildren: boolean;
|
|
9
8
|
colIndex: number;
|
|
10
|
-
content: CellValue | ReactNode;
|
|
11
|
-
depth: number;
|
|
12
9
|
draggedHeaderRef: RefObject<HeaderObject | null>;
|
|
13
10
|
header: HeaderObject;
|
|
14
11
|
headersRef: RefObject<HeaderObject[]>;
|
|
@@ -16,12 +13,11 @@ export interface TableCellProps {
|
|
|
16
13
|
isSelected: boolean;
|
|
17
14
|
isTopLeftCell: boolean;
|
|
18
15
|
onCellEdit?: (props: CellChangeProps) => void;
|
|
19
|
-
onExpandRowClick: (
|
|
16
|
+
onExpandRowClick: (rowId: RowId) => void;
|
|
20
17
|
onMouseDown: (rowIndex: number, colIndex: number) => void;
|
|
21
18
|
onMouseOver: (rowIndex: number, colIndex: number) => void;
|
|
22
19
|
onTableHeaderDragEnd: (newHeaders: HeaderObject[]) => void;
|
|
23
|
-
row: Row;
|
|
24
20
|
rowIndex: number;
|
|
25
|
-
|
|
21
|
+
visibleRow: VisibleRow;
|
|
26
22
|
}
|
|
27
23
|
export default TableCellProps;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import Row from "../types/Row";
|
|
2
2
|
import VisibleRow from "../types/VisibleRow";
|
|
3
3
|
export declare const getTotalRowCount: (rows: Row[]) => number;
|
|
4
|
-
declare const getVisibleRows: ({ bufferRowCount, containerHeight, rowHeight, rows, scrollTop, }: {
|
|
4
|
+
export declare const getVisibleRows: ({ bufferRowCount, containerHeight, rowHeight, rows, scrollTop, }: {
|
|
5
5
|
bufferRowCount: number;
|
|
6
6
|
containerHeight: number;
|
|
7
7
|
rowHeight: number;
|
|
8
8
|
rows: Row[];
|
|
9
9
|
scrollTop: number;
|
|
10
10
|
}) => VisibleRow[];
|
|
11
|
-
export
|
|
11
|
+
export declare const calculateSeparatorTopPosition: ({ position, rowHeight }: {
|
|
12
|
+
position: number;
|
|
13
|
+
rowHeight: number;
|
|
14
|
+
}) => number;
|
|
15
|
+
export declare const calculateRowTopPosition: ({ position, rowHeight }: {
|
|
16
|
+
position: number;
|
|
17
|
+
rowHeight: number;
|
|
18
|
+
}) => number;
|
|
@@ -6,7 +6,7 @@ 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, index, reverse, setIsWidthDragging, }: {
|
|
9
|
+
export declare const handleResizeStart: ({ event, forceUpdate, header, headersRef, index, reverse, setIsWidthDragging, startWidth, }: {
|
|
10
10
|
event: MouseEvent;
|
|
11
11
|
forceUpdate: () => void;
|
|
12
12
|
header: HeaderObject;
|
|
@@ -14,4 +14,5 @@ export declare const handleResizeStart: ({ event, forceUpdate, header, headersRe
|
|
|
14
14
|
index: number;
|
|
15
15
|
reverse?: boolean | undefined;
|
|
16
16
|
setIsWidthDragging: Dispatch<SetStateAction<boolean>>;
|
|
17
|
+
startWidth: number;
|
|
17
18
|
}) => void;
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from "react";
|
|
2
|
-
import HeaderObject from "../../../types/HeaderObject";
|
|
3
|
-
type TableColumnEditorProps = {
|
|
4
|
-
headers: HeaderObject[];
|
|
5
|
-
columnEditorText: string;
|
|
6
|
-
editColumns: boolean;
|
|
7
|
-
editColumnsInitOpen: boolean;
|
|
8
|
-
position: "left" | "right";
|
|
9
|
-
setHiddenColumns: Dispatch<SetStateAction<{
|
|
10
|
-
[key: string]: boolean;
|
|
11
|
-
}>>;
|
|
12
|
-
hiddenColumns: {
|
|
13
|
-
[key: string]: boolean;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
declare const TableColumnEditor: ({ columnEditorText, editColumns, editColumnsInitOpen, headers, position, setHiddenColumns, hiddenColumns, }: TableColumnEditorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
-
export default TableColumnEditor;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from "react";
|
|
2
|
-
import HeaderObject from "../../../types/HeaderObject";
|
|
3
|
-
type TableColumnEditorPopoutProps = {
|
|
4
|
-
headers: HeaderObject[];
|
|
5
|
-
open: boolean;
|
|
6
|
-
position: "left" | "right";
|
|
7
|
-
setOpen: (open: boolean) => void;
|
|
8
|
-
setHiddenColumns: Dispatch<SetStateAction<{
|
|
9
|
-
[key: string]: boolean;
|
|
10
|
-
}>>;
|
|
11
|
-
hiddenColumns: {
|
|
12
|
-
[key: string]: boolean;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
declare const TableColumnEditorPopout: ({ headers, open, position, setOpen, setHiddenColumns, hiddenColumns, }: TableColumnEditorPopoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export default TableColumnEditorPopout;
|