simple-table-core 0.7.8 → 0.7.11
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/README.md +2 -2
- package/dist/components/SimpleTable/RenderCells.d.ts +1 -2
- package/dist/components/SimpleTable/SimpleTable.d.ts +6 -5
- package/dist/components/SimpleTable/TableContent.d.ts +2 -4
- package/dist/components/SimpleTable/TableHeader.d.ts +1 -1
- package/dist/components/SimpleTable/TableHeaderCell.d.ts +5 -5
- package/dist/components/SimpleTable/TableHorizontalScrollbar.d.ts +1 -4
- package/dist/components/SimpleTable/TableRow.d.ts +4 -3
- package/dist/components/SimpleTable/TableSection.d.ts +6 -4
- package/dist/components/SimpleTable/table-column-editor/TableColumnEditor.d.ts +17 -0
- package/dist/components/SimpleTable/table-column-editor/TableColumnEditorPopout.d.ts +16 -0
- package/dist/hooks/useScrollbarVisibility.d.ts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/CellChangeProps.d.ts +1 -3
- package/dist/types/HeaderObject.d.ts +5 -1
- package/dist/types/SharedTableProps.d.ts +3 -0
- package/dist/types/TableBodyProps.d.ts +1 -4
- package/dist/types/TableCellProps.d.ts +1 -2
- package/dist/types/TableHeaderProps.d.ts +1 -1
- package/dist/types/TableRowProps.d.ts +1 -1
- package/dist/types/VisibleRow.d.ts +8 -0
- package/dist/utils/infiniteScrollUtils.d.ts +11 -0
- package/package.json +1 -1
- package/dist/types/GroupedRow.d.ts +0 -8
- /package/dist/components/SimpleTable/{EditableCell → editable-cells}/BooleanEdit.d.ts +0 -0
- /package/dist/components/SimpleTable/{EditableCell → editable-cells}/EditableCell.d.ts +0 -0
- /package/dist/components/SimpleTable/{EditableCell → editable-cells}/NumberEdit.d.ts +0 -0
- /package/dist/components/SimpleTable/{EditableCell → editable-cells}/StringEdit.d.ts +0 -0
package/README.md
CHANGED
|
@@ -74,13 +74,13 @@ The Simple Table component accepts the following props:
|
|
|
74
74
|
- **shouldPaginate**: A boolean to enable or disable pagination. Default is `true`.
|
|
75
75
|
- **rowsPerPage**: The number of rows to display per page. Default is `10`.
|
|
76
76
|
- **columnResizing**: A boolean to enable or disable column resizing. Default is `true`.
|
|
77
|
-
- **
|
|
77
|
+
- **columnReordering**: A boolean to enable or disable column dragging.
|
|
78
78
|
- **pinned**: A boolean to enable or disable column pinning.
|
|
79
79
|
- **editColumns**: A boolean to enable or disable column management.
|
|
80
80
|
- **hideFooter**: A boolean to hide or show the footer. Default is `false`.
|
|
81
81
|
- **selectableCells**: A boolean to enable or disable cell selection.
|
|
82
82
|
- **selectableColumns**: A boolean to enable selection of entire columns by clicking headers.
|
|
83
|
-
- **
|
|
83
|
+
- **onCellEdit**: A function called when a cell value changes.
|
|
84
84
|
- **nextIcon**: A React element to display as the next page icon.
|
|
85
85
|
- **prevIcon**: A React element to display as the previous page icon.
|
|
86
86
|
- **sortDownIcon**: A React element to display as the sort down icon.
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import Row from "../../types/Row";
|
|
2
2
|
import HeaderObject from "../../types/HeaderObject";
|
|
3
3
|
import TableBodyProps from "../../types/TableBodyProps";
|
|
4
|
-
declare const RenderCells: ({ getBorderClass, handleMouseDown, handleMouseOver, headers, hiddenColumns,
|
|
4
|
+
declare const RenderCells: ({ getBorderClass, handleMouseDown, handleMouseOver, headers, hiddenColumns, isSelected, isTopLeftCell, lastGroupRow, onExpandRowClick, pinned, row, rowIndex, shouldDisplayLastColumnCell, ...props }: {
|
|
5
5
|
depth: number;
|
|
6
6
|
headers: HeaderObject[];
|
|
7
7
|
hiddenColumns: Record<string, boolean>;
|
|
8
|
-
isRowExpanded: (rowId: string | number) => boolean;
|
|
9
8
|
lastGroupRow?: boolean | undefined;
|
|
10
9
|
onExpandRowClick: (rowIndex: number) => void;
|
|
11
10
|
pinned?: "left" | "right" | undefined;
|
|
@@ -12,15 +12,16 @@ interface SimpleTableProps {
|
|
|
12
12
|
allowAnimations?: boolean;
|
|
13
13
|
columnEditorPosition?: ColumnEditorPosition;
|
|
14
14
|
columnEditorText?: string;
|
|
15
|
+
columnReordering?: boolean;
|
|
15
16
|
columnResizing?: boolean;
|
|
16
17
|
defaultHeaders: HeaderObject[];
|
|
17
|
-
draggable?: boolean;
|
|
18
18
|
editColumns?: boolean;
|
|
19
19
|
editColumnsInitOpen?: boolean;
|
|
20
20
|
height?: string;
|
|
21
21
|
hideFooter?: boolean;
|
|
22
22
|
nextIcon?: ReactNode;
|
|
23
|
-
|
|
23
|
+
onCellEdit?: (props: CellChangeProps) => void;
|
|
24
|
+
onColumnOrderChange?: (newHeaders: HeaderObject[]) => void;
|
|
24
25
|
prevIcon?: ReactNode;
|
|
25
26
|
rows: Row[];
|
|
26
27
|
rowsPerPage?: number;
|
|
@@ -32,20 +33,20 @@ interface SimpleTableProps {
|
|
|
32
33
|
theme?: Theme;
|
|
33
34
|
}
|
|
34
35
|
declare const _default: import("react").MemoExoticComponent<{
|
|
35
|
-
({ allowAnimations, columnEditorPosition, columnEditorText, columnResizing, defaultHeaders,
|
|
36
|
+
({ allowAnimations, columnEditorPosition, columnEditorText, columnResizing, defaultHeaders, editColumns, editColumnsInitOpen, columnReordering, height, hideFooter, nextIcon, onCellEdit, onColumnOrderChange, prevIcon, rows, rowsPerPage, selectableCells, selectableColumns, shouldPaginate, sortDownIcon, sortUpIcon, theme, }: SimpleTableProps): import("react/jsx-runtime").JSX.Element;
|
|
36
37
|
defaultProps: {
|
|
37
38
|
allowAnimations: boolean;
|
|
38
39
|
columnEditorPosition: ColumnEditorPosition;
|
|
39
40
|
columnEditorText: string;
|
|
40
41
|
columnResizing: boolean;
|
|
41
42
|
defaultHeaders: never[];
|
|
42
|
-
draggable: boolean;
|
|
43
43
|
editColumns: boolean;
|
|
44
44
|
editColumnsInitOpen: boolean;
|
|
45
|
+
columnReordering: boolean;
|
|
45
46
|
height: string;
|
|
46
47
|
hideFooter: boolean;
|
|
47
48
|
nextIcon: import("react/jsx-runtime").JSX.Element;
|
|
48
|
-
|
|
49
|
+
onCellEdit: () => void;
|
|
49
50
|
prevIcon: import("react/jsx-runtime").JSX.Element;
|
|
50
51
|
rows: never[];
|
|
51
52
|
rowsPerPage: number;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { RefObject } from "react";
|
|
2
2
|
import TableBodyProps from "../../types/TableBodyProps";
|
|
3
3
|
import TableHeaderProps from "../../types/TableHeaderProps";
|
|
4
|
-
type OmittedTableProps = "headerContainerRef" | "
|
|
4
|
+
type OmittedTableProps = "centerHeaderRef" | "headerContainerRef" | "mainTemplateColumns" | "pinnedLeftColumns" | "pinnedLeftHeaderRef" | "pinnedLeftTemplateColumns" | "pinnedRightColumns" | "pinnedRightHeaderRef" | "pinnedRightTemplateColumns" | "shouldDisplayLastColumnCell";
|
|
5
5
|
interface TableContentProps extends Omit<TableHeaderProps, OmittedTableProps>, Omit<TableBodyProps, OmittedTableProps> {
|
|
6
6
|
editColumns: boolean;
|
|
7
7
|
pinnedLeftRef: RefObject<HTMLDivElement | null>;
|
|
8
8
|
pinnedRightRef: RefObject<HTMLDivElement | null>;
|
|
9
|
-
isRowExpanded: (rowId: string | number) => boolean;
|
|
10
|
-
onExpandRowClick: (rowIndex: number) => void;
|
|
11
9
|
}
|
|
12
|
-
declare const TableContent: ({ allowAnimations, columnResizing, currentRows,
|
|
10
|
+
declare const TableContent: ({ allowAnimations, columnResizing, currentRows, columnReordering, draggedHeaderRef, editColumns, forceUpdate, getBorderClass, handleMouseDown, handleMouseOver, headersRef, hiddenColumns, hoveredHeaderRef, isSelected, isTopLeftCell, isWidthDragging, mainBodyRef, onCellEdit, onSort, onTableHeaderDragEnd, pinnedLeftRef, pinnedRightRef, scrollbarWidth, selectableColumns, setIsWidthDragging, setSelectedCells, shouldPaginate, sort, sortDownIcon, sortUpIcon, tableBodyContainerRef, }: TableContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
11
|
export default TableContent;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import TableHeaderProps from "../../types/TableHeaderProps";
|
|
2
|
-
declare const TableHeader: ({ allowAnimations, columnResizing, currentRows,
|
|
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, shouldDisplayLastColumnCell, sort, sortDownIcon, sortUpIcon, }: TableHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TableHeader;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SetStateAction, Dispatch, ReactNode } from "react";
|
|
1
|
+
import { SetStateAction, Dispatch, ReactNode, RefObject } from "react";
|
|
2
2
|
import HeaderObject from "../../types/HeaderObject";
|
|
3
3
|
import SortConfig from "../../types/SortConfig";
|
|
4
4
|
import OnSortProps from "../../types/OnSortProps";
|
|
@@ -6,11 +6,11 @@ import Row from "../../types/Row";
|
|
|
6
6
|
interface TableHeaderCellProps {
|
|
7
7
|
columnResizing: boolean;
|
|
8
8
|
currentRows: Row[];
|
|
9
|
-
|
|
10
|
-
draggedHeaderRef:
|
|
9
|
+
columnReordering: boolean;
|
|
10
|
+
draggedHeaderRef: RefObject<HeaderObject | null>;
|
|
11
11
|
forceUpdate: () => void;
|
|
12
|
-
headersRef:
|
|
13
|
-
hoveredHeaderRef:
|
|
12
|
+
headersRef: RefObject<HeaderObject[]>;
|
|
13
|
+
hoveredHeaderRef: RefObject<HeaderObject | null>;
|
|
14
14
|
index: number;
|
|
15
15
|
onSort: OnSortProps;
|
|
16
16
|
onTableHeaderDragEnd: (newHeaders: HeaderObject[]) => void;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { RefObject } from "react";
|
|
2
|
-
|
|
3
|
-
declare const TableHorizontalScrollbar: ({ headersRef, mainBodyRef, pinnedLeftRef, pinnedRightRef, scrollbarHorizontalRef, tableContentWidth, }: {
|
|
4
|
-
headersRef: RefObject<HeaderObject[]>;
|
|
2
|
+
declare const TableHorizontalScrollbar: ({ mainBodyRef, pinnedLeftRef, pinnedRightRef, tableContentWidth, }: {
|
|
5
3
|
mainBodyRef: RefObject<HTMLDivElement | null>;
|
|
6
4
|
pinnedLeftRef: RefObject<HTMLDivElement | null>;
|
|
7
5
|
pinnedRightRef: RefObject<HTMLDivElement | null>;
|
|
8
|
-
scrollbarHorizontalRef: RefObject<HTMLDivElement | null>;
|
|
9
6
|
tableContentWidth: number;
|
|
10
7
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
8
|
export default TableHorizontalScrollbar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Row from "../../types/Row";
|
|
2
1
|
import TableBodyProps from "../../types/TableBodyProps";
|
|
3
|
-
|
|
2
|
+
import VisibleRow from "../../types/VisibleRow";
|
|
3
|
+
declare const TableRow: ({ depth, getNextRowIndex, index, lastGroupRow, pinned, props, rowHeight, visibleRow, }: {
|
|
4
4
|
depth?: number | undefined;
|
|
5
5
|
getNextRowIndex: () => number;
|
|
6
6
|
index: number;
|
|
@@ -9,6 +9,7 @@ declare const TableRow: ({ depth, getNextRowIndex, index, lastGroupRow, pinned,
|
|
|
9
9
|
props: Omit<TableBodyProps, "currentRows" | "headerContainerRef"> & {
|
|
10
10
|
onExpandRowClick: (rowIndex: number) => void;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
rowHeight: number;
|
|
13
|
+
visibleRow: VisibleRow;
|
|
13
14
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export default TableRow;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import Row from "../../types/Row";
|
|
2
1
|
import { RefObject } from "react";
|
|
3
2
|
import TableBodyProps from "../../types/TableBodyProps";
|
|
4
|
-
|
|
3
|
+
import VisibleRow from "../../types/VisibleRow";
|
|
4
|
+
declare const TableSection: ({ headerContainerRef, onExpandRowClick, pinned, rowHeight, sectionRef, templateColumns, totalHeight, visibleRows, width, ...props }: {
|
|
5
5
|
headerContainerRef: RefObject<HTMLDivElement | null>;
|
|
6
|
-
isRowExpanded: (rowId: string | number) => boolean;
|
|
7
6
|
onExpandRowClick: (rowIndex: number) => void;
|
|
8
7
|
pinned?: "left" | "right" | undefined;
|
|
9
|
-
|
|
8
|
+
rowHeight: number;
|
|
10
9
|
sectionRef?: RefObject<HTMLDivElement | null> | undefined;
|
|
11
10
|
templateColumns: string;
|
|
11
|
+
totalHeight: number;
|
|
12
|
+
visibleRows: VisibleRow[];
|
|
13
|
+
width?: number | undefined;
|
|
12
14
|
} & Omit<TableBodyProps, "currentRows">) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export default TableSection;
|
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
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;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { RefObject } from "react";
|
|
2
|
-
declare const useScrollbarVisibility: ({ headerContainerRef, mainSectionRef,
|
|
2
|
+
declare const useScrollbarVisibility: ({ headerContainerRef, mainSectionRef, scrollbarWidth, }: {
|
|
3
3
|
headerContainerRef?: RefObject<HTMLElement | null> | undefined;
|
|
4
4
|
mainSectionRef?: RefObject<HTMLElement | null> | undefined;
|
|
5
|
-
scrollbarHorizontalRef?: RefObject<HTMLElement | null> | undefined;
|
|
6
5
|
scrollbarWidth: number;
|
|
7
6
|
}) => void;
|
|
8
7
|
export default useScrollbarVisibility;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type Cell from "./types/Cell";
|
|
|
4
4
|
import type CellChangeProps from "./types/CellChangeProps";
|
|
5
5
|
import type CellValue from "./types/CellValue";
|
|
6
6
|
import type DragHandlerProps from "./types/DragHandlerProps";
|
|
7
|
-
import type GroupedRow from "./types/GroupedRow";
|
|
8
7
|
import type HeaderObject from "./types/HeaderObject";
|
|
9
8
|
import type OnSortProps from "./types/OnSortProps";
|
|
10
9
|
import type Row from "./types/Row";
|
|
@@ -16,4 +15,4 @@ import type TableHeaderProps from "./types/TableHeaderProps";
|
|
|
16
15
|
import type TableRowProps from "./types/TableRowProps";
|
|
17
16
|
import type Theme from "./types/Theme";
|
|
18
17
|
export { SimpleTable };
|
|
19
|
-
export type { BoundingBox, Cell, CellChangeProps, CellValue, DragHandlerProps,
|
|
18
|
+
export type { BoundingBox, Cell, CellChangeProps, CellValue, DragHandlerProps, HeaderObject, OnSortProps, Row, SharedTableProps, SortConfig, TableBodyProps, TableCellProps, TableHeaderProps, TableRowProps, Theme, };
|
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 a,useEffect as i,useMemo as l,createContext as c,forwardRef as s,useContext as d,useLayoutEffect as u,createElement as f,createRef as h,memo as v,useReducer as g}from"react";var m=function(){return m=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},m.apply(this,arguments)};function p(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 w(e,n,r){if(r||2===arguments.length)for(var t,o=0,a=n.length;o<a;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var R,C=function(r){var t=r.currentPage,o=r.hideFooter,a=r.nextIcon,i=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&&i(e)};return o||!s?null:e("div",m({className:"st-footer"},{children:[n("button",m({className:"st-next-prev-btn ".concat(f?"":"disabled"),onClick:function(){return v(t-1)},disabled:!f},{children:l})),n("button",m({className:"st-next-prev-btn ".concat(h?"":"disabled"),onClick:function(){return v(t+1)},disabled:!h},{children:a})),Array.from({length:u},(function(e,r){return n("button",m({onClick:function(){return v(r+1)},className:"st-page-btn ".concat(t===r+1?"active":"")},{children:r+1}),r)}))]}))},b=function(e){var r=e.className;return n("svg",m({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",m({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"})}))},y=c({rows:[],tableRows:[]}),I=function(e){var r=e.className;return n("svg",m({className:r,viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},E=function(e){var r=e.className;return n("svg",m({className:r,viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},D=function(r){var o=r.checked,a=void 0!==o&&o,i=r.children,l=r.onChange,c=t(a),s=c[0],d=c[1];return e("label",m({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",m({className:"st-checkbox-custom ".concat(s?"st-checked":"")},{children:s&&n("span",{className:"st-checkbox-checkmark"})})),i]}))},H=function(e){var r=e.headers,t=e.open,o=e.position;e.setOpen;var a=e.setHiddenColumns,i=e.hiddenColumns,l="left"===o?"left":"";return n("div",m({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:n("div",m({className:"st-column-editor-popout-content"},{children:r.map((function(e,r){return n(D,m({checked:i[e.accessor],onChange:function(n){var r;return a(m(m({},i),((r={})[e.accessor]=n,r)))}},{children:e.label}),r)}))}))}))},S=function(r){var o=r.columnEditorText,a=r.editColumns,i=r.editColumnsInitOpen,l=r.headers,c=r.position,s=void 0===c?"right":c,d=r.setHiddenColumns,u=r.hiddenColumns,f=t(i),h=f[0],v=f[1];return a?e("div",m({className:"st-column-editor ".concat(h?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!h)}},{children:[n("div",m({className:"st-column-editor-text"},{children:o})),n(H,{headers:l,open:h,position:s,setOpen:v,setHiddenColumns:d,hiddenColumns:u})]})):null},M=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},k=function(r){var t=r.value,o=r.onBlur,a=r.onChange;return e("select",m({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;a("true"===n)}},{children:[n("option",m({value:"true"},{children:"True"})),n("option",m({value:"false"},{children:"False"}))]}))},L=function(e){var r=e.defaultValue,t=e.onBlur,a=e.onChange,i=o(null);return n("input",{className:"editable-cell-input",ref:i,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:t,onChange:function(e){var n=e.target.value;a(n)}})},T=function(e){var r=e.defaultValue,t=e.onBlur,a=e.onChange,i=o(null);return n("input",{className:"editable-cell-input",ref:i,autoFocus:!0,defaultValue:r.toString(),onBlur:t,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&a(n)}})},B=function(e){var t=e.onChange,o=e.setIsEditing,a=e.value,i=function(e){null==t||t(e)},l=function(){o(!1)};return n(r,{children:"string"==typeof a||null==a?n(L,{defaultValue:a,onBlur:l,onChange:i}):"boolean"==typeof a?n(k,{onBlur:l,onChange:i,value:a}):"number"==typeof a?n(T,{defaultValue:a,onBlur:l,onChange:i}):null})},O=0,A=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===O||o-O>=t)&&(O=o,n(r))}},P=Date.now(),W={screenX:0,screenY:0},z=function(e){var n,r,t=e.draggedHeaderRef,a=e.headersRef,l=e.hoveredHeaderRef,c=e.onTableHeaderDragEnd,s=(n=a.current,r=o(n),i((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(),a.current){var i=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([],a.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),!(i||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(a.current))){var p=Date.now();JSON.stringify(h)===JSON.stringify(s)&&p-P<800&&f<50||(P=p,W={screenX:d,screenY:u},c(h))}}},handleDragEnd:function(){t.current=null,l.current=null}}},U=s((function(r,o){var a=r.borderClass,l=r.cellHasChildren,c=r.colIndex,s=r.content,u=r.depth,f=r.draggedHeaderRef,h=r.header,v=r.headersRef,g=r.hoveredHeaderRef,p=r.isRowExpanded,w=r.isSelected,R=r.isTopLeftCell,C=r.onCellChange,b=r.onExpandRowClick,I=r.onMouseDown,D=r.onMouseOver,H=r.onTableHeaderDragEnd,S=r.row,N=r.rowIndex,k=d(y);k.rows,k.tableRows;var L=t(s),T=L[0],O=L[1],P=t(!1),W=P[0],U=P[1],j=z({draggedHeaderRef:f,headersRef:v,hoveredHeaderRef:g,onTableHeaderDragEnd:H}).handleDragOver,F=A(),G=Boolean(null==h?void 0:h.isEditable),V=N%2==0,J="st-cell ".concat(u>0&&h.expandable?"st-cell-depth-".concat(u):""," ").concat(w?R?"st-cell-selected-first-cell ".concat(a):"st-cell-selected ".concat(a):""," ").concat(V?"st-cell-odd-row":"st-cell-even-row"," ").concat(G?"clickable":""," ").concat("right"===h.align?"right-aligned":"");i((function(){"object"!=typeof s&&O(s)}),[s]);return W?n("div",m({className:"st-cell-editing ".concat(V?"st-cell-odd-row":"st-cell-even-row"),id:M({accessor:h.accessor,rowIndex:N+1})},{children:n(B,{onChange:function(e){var n;O(e),null==C||C({accessor:h.accessor,newValue:e,newRowIndex:N,originalRowIndex:null===(n=S.rowMeta)||void 0===n?void 0:n.rowId,row:S})},setIsEditing:U,value:T})})):e("div",m({className:J,id:M({accessor:h.accessor,rowIndex:N+1}),onDoubleClick:function(){return h.isEditable&&U(!0)},onMouseDown:function(){return I(N,c)},onMouseOver:function(){return D(N,c)},onDragOver:function(e){return F({callback:j,callbackProps:{event:e,hoveredHeader:h},limit:50})},ref:o},{children:[h.expandable&&l?p(S.rowMeta.rowId)?n("div",m({className:"st-sort-icon-container",onClick:function(){return b(S.rowMeta.rowId)}},{children:n(E,{className:"st-sort-icon"})})):n("div",m({className:"st-sort-icon-container",onClick:function(){return b(S.rowMeta.rowId)}},{children:n(x,{className:"st-sort-icon"})})):null,n("span",{children:T})]}))})),j=s((function(e,r){return e.visible?n("div",{className:"st-cell",ref:r}):n("div",{ref:r})})),F=function(e){var r=e.lastGroupRow;return n("div",{className:"st-row-separator ".concat(r?"st-last-group-row":"")})},G=function(e){var t=e.allowAnimations,o=e.children,a=p(e,["allowAnimations","children"]);return t?n(V,m({},a,{children:o})):n(r,{children:o})},V=function(e){var a=e.allowHorizontalAnimate,l=void 0===a||a,c=e.children,s=e.draggedHeaderRef,d=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],C=o({}),b=d.current;return u((function(){if(b){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var a=document.getElementById(M({accessor:e.accessor,rowIndex:t}));if(a){var i=a.getAnimations().some((function(e){return"running"===e.playState})),l=a.getBoundingClientRect();i&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:b,draggedHeaderRef:s,rowIndex:g});JSON.stringify(e)!==JSON.stringify(w)&&(C.current=w,R(e))}}),[w,b,s,f,g]),u((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]),i((function(){v||m.current||Object.keys(C.current).length&&b&&b.forEach((function(e){var n=document.getElementById(M({accessor:e.accessor,rowIndex:g}));if(n){var r=C.current[e.accessor],t=w[e.accessor];if(r&&t){var o=r.left-t.left,a=l?0:r.top-t.top,i=Math.abs(o),c=Math.abs(a);(i>10||c>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(a,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[l,w,b,f,v,C,g]),n(r,{children:c})},J=function(r){var t,o=r.getBorderClass,a=r.handleMouseDown,i=r.handleMouseOver,l=r.headers,c=r.hiddenColumns,s=r.isRowExpanded,d=r.isSelected,u=r.isTopLeftCell,v=r.lastGroupRow,g=r.onExpandRowClick,w=r.pinned,R=r.row,C=r.rowIndex,b=r.shouldDisplayLastColumnCell,x=p(r,["getBorderClass","handleMouseDown","handleMouseOver","headers","hiddenColumns","isRowExpanded","isSelected","isTopLeftCell","lastGroupRow","onExpandRowClick","pinned","row","rowIndex","shouldDisplayLastColumnCell"]),y=null===(t=R.rowMeta)||void 0===t?void 0:t.children;return e(G,m({allowAnimations:x.allowAnimations,allowHorizontalAnimate:x.shouldPaginate,draggedHeaderRef:x.draggedHeaderRef,headersRef:x.headersRef,isBody:!0,mainBodyRef:x.mainBodyRef,pauseAnimation:x.isWidthDragging,rowIndex:C+1},{children:[0!==C&&n(F,{lastGroupRow:v}),l.map((function(e,n){if(!N({hiddenColumns:c,header:e,pinned:w}))return null;var r=R.rowData[e.accessor];return e.cellRenderer&&(r=e.cellRenderer(R)),f(U,m({},x,{borderClass:o(C,n),cellHasChildren:((null==y?void 0:y.length)||0)>0,colIndex:n,content:r,header:e,isRowExpanded:s,isSelected:d(C,n),isTopLeftCell:u(C,n),key:n,onExpandRowClick:g,onMouseDown:function(){return a({rowIndex:C,colIndex:n})},onMouseOver:function(){return i(C,n)},row:R,rowIndex:C}))})),n(j,{ref:h(),visible:b})]}))},X=function(t){var o,a,i,l=t.depth,c=void 0===l?0:l,s=t.getNextRowIndex,d=t.index,u=t.lastGroupRow,h=t.pinned,v=t.props,g=t.row,p=((null===(a=null===(o=g.rowMeta)||void 0===o?void 0:o.children)||void 0===a?void 0:a.length)||0)>0,w=s(),R=(null===(i=g.rowMeta)||void 0===i?void 0:i.children)||[];return e(r,{children:[f(J,m({},v,{depth:c,lastGroupRow:u,key:d,pinned:h,row:g,rowIndex:w})),p&&v.isRowExpanded(g.rowMeta.rowId)&&R.map((function(e,r){return n(X,{depth:c+1,getNextRowIndex:s,index:r,pinned:h,props:v,row:e},r)}))]})},Y=function(e){e.headerContainerRef;var r=e.isRowExpanded,t=e.onExpandRowClick,a=e.pinned,l=e.rows,c=e.sectionRef,s=e.templateColumns,d=p(e,["headerContainerRef","isRowExpanded","onExpandRowClick","pinned","rows","sectionRef","templateColumns"]),u=a?"st-table-body-pinned-".concat(a):"st-table-body-main",f=o(0);i((function(){f.current=0}));var h=function(){return f.current++};return n("div",m({className:u,ref:c,style:{gridTemplateColumns:s}},{children:l.map((function(e,o){var i,l;return n(X,{getNextRowIndex:h,index:o,lastGroupRow:Boolean(null===(l=null===(i=e.rowMeta)||void 0===i?void 0:i.children)||void 0===l?void 0:l.length),pinned:a,props:m(m({},d),{isRowExpanded:r,onExpandRowClick:t}),row:e},o)}))}))},q=function(r){var o=r.currentRows,a=r.headerContainerRef,l=r.isRowExpanded,c=r.mainBodyRef,s=r.mainTemplateColumns,d=r.onExpandRowClick,u=r.pinnedLeftColumns,f=r.pinnedLeftRef,h=r.pinnedLeftTemplateColumns,v=r.pinnedRightColumns,g=r.pinnedRightRef,p=r.pinnedRightTemplateColumns,w=r.scrollbarHorizontalRef,R=r.scrollbarWidth,C=r.tableBodyContainerRef;return function(e){var n=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarHorizontalRef,a=e.scrollbarWidth,l=t(!1),c=l[0],s=l[1];i((function(){var e=null==n?void 0:n.current,r=null==o?void 0:o.current;if(c&&e)return e.classList.add("st-header-scroll-padding"),null==r||r.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(a,"px")),null==r||r.style.setProperty("--st-after-width","".concat(a,"px")),function(){e.classList.remove("st-header-scroll-padding"),null==r||r.classList.remove("st-header-scroll-padding")}}),[n,c,o,a]),i((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;s(e)}};o();var a=new ResizeObserver((function(){o()}));return a.observe(t),function(){t&&a.unobserve(t)}}}),[n,r])}({headerContainerRef:a,mainSectionRef:C,scrollbarHorizontalRef:w,scrollbarWidth:R}),e("div",m({className:"st-table-body-container",ref:C},{children:[u.length>0&&n(Y,m({},r,{rows:o,templateColumns:h,pinned:"left",sectionRef:f,isRowExpanded:l,onExpandRowClick:d})),n(Y,m({},r,{rows:o,templateColumns:s,sectionRef:c,isRowExpanded:l,onExpandRowClick:d})),v.length>0&&n(Y,m({},r,{rows:o,templateColumns:p,pinned:"right",sectionRef:g,isRowExpanded:l,onExpandRowClick:d}))]}))},K={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var a=t.getTime()-o.getTime();return"ascending"===r?a:-a},enum:function(e,n,r){return K.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?K.string(e,n,r):"number"==typeof e&&"number"==typeof n?K.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?K.boolean(e,n,r):K.string(String(e),String(n),r)}},$=function(e,n,r,t){switch(void 0===r&&(r="string"),r){case"string":return K.string(String(e||""),String(n||""),t);case"number":return K.number(Number(e||0),Number(n||0),t);case"boolean":return K.boolean(Boolean(e),Boolean(n),t);case"date":return K.date(String(e||""),String(n||""),t);case"enum":return K.enum(String(e||""),String(n||""),t);default:return K.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",a=n.direction;return w([],e,!0).sort((function(e,r){var t,i,l=null===(t=null==e?void 0:e.rowData)||void 0===t?void 0:t[n.key.accessor],c=null===(i=null==r?void 0:r.rowData)||void 0===i?void 0:i[n.key.accessor];return $(l,c,o,a)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?m(m({},e),{rowMeta:m(m({},e.rowMeta),{children:Q(e.rowMeta.children,n,r)})}):e}))},Z=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",a=n.direction,i=[],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}))}))||i.push(n),n.rowMeta.children&&n.rowMeta.children.length>0&&l.set(n.rowMeta.rowId,n.rowMeta.children)})),w([],i,!0).sort((function(e,r){var t,i,l=null===(t=null==e?void 0:e.rowData)||void 0===t?void 0:t[n.key.accessor],c=null===(i=null==r?void 0:r.rowData)||void 0===i?void 0:i[n.key.accessor];return $(l,c,o,a)})).map((function(e){var t=m({},e);if(l.has(e.rowMeta.rowId)){var o=l.get(e.rowMeta.rowId)||[],a=Q(o,n,r);t.rowMeta=m(m({},t.rowMeta),{children:a})}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,a=e.index;e.reverse;var i=e.setIsWidthDragging;i(!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[a].width=n,r())},d=function(){document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d),i(!1)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",d)}},ee=s((function(r,o){var a,l=r.columnResizing,c=r.currentRows,s=r.draggable,d=r.draggedHeaderRef,u=r.forceUpdate,f=r.headersRef,h=r.hoveredHeaderRef,v=r.index,g=r.onSort,p=r.onTableHeaderDragEnd,w=r.reverse,R=r.selectableColumns,C=r.setIsWidthDragging,b=r.setSelectedCells,x=r.sort,y=r.sortDownIcon,I=r.sortUpIcon,E=t(!1),D=E[0],H=E[1],S=null===(a=f.current)||void 0===a?void 0:a[v],N=Boolean(null==S?void 0:S.isSortable),k="st-header-cell ".concat(S===h.current?"st-hovered":""," ").concat(D?"st-dragging":""," ").concat(N?"clickable":""," ").concat(s&&!N?"draggable":""," ").concat("right"===(null==S?void 0:S.align)?"right-aligned":""),L=z({draggedHeaderRef:d,headersRef:f,hoveredHeaderRef:h,onTableHeaderDragEnd:p}),T=L.handleDragStart,B=L.handleDragEnd,O=z({draggedHeaderRef:d,headersRef:f,hoveredHeaderRef:h,onTableHeaderDragEnd:p}).handleDragOver,P=A(),W=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)})),a=function(e,n){var r=new Set,o=Math.min(e,n),a=Math.max(e,n);return Array.from({length:t}).forEach((function(e,n){Array.from({length:a-o+1}).forEach((function(e,t){r.add("".concat(n,"-").concat(o+t))}))})),r};n.shiftKey?b((function(e){var n,r=Number(null===(n=Array.from(e)[0])||void 0===n?void 0:n.split("-")[1]),t=Number(o[0].split("-")[1]);return r===t?new Set(o):r>t?a(t,r):a(r,t)})):b(new Set(o))}else r.isSortable&&g(v,r.accessor)};if(i((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){P({callback:_,callbackProps:{event:e,forceUpdate:u,header:S,headersRef:f,index:v,setIsWidthDragging:C},limit:10})}});return e("div",m({className:k,id:M({accessor:S.accessor,rowIndex:0}),onDragOver:function(e){P({callback:O,callbackProps:{event:e,hoveredHeader:S},limit:50})},ref:o,style:{width:S.width}},{children:[w&&U,n("div",m({className:"st-header-label",draggable:s,onClick:function(e){return W({event:e,header:S})},onDragEnd:function(e){e.preventDefault(),H(!1),B()},onDragStart:function(e){s&&S&&function(e){H(!0),T(e)}(S)}},{children:null==S?void 0:S.label})),x&&x.key.accessor===S.accessor&&e("div",m({className:"st-sort-icon-container",onClick:function(e){return W({event:e,header:S})}},{children:["ascending"===x.direction&&I&&I,"descending"===x.direction&&y&&y]})),!w&&U]}))})),ne=function(e,n){i((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])},re=function(r){var t,a,i,l=r.allowAnimations,c=r.columnResizing,s=r.currentRows,d=r.draggable,u=r.draggedHeaderRef,f=r.forceUpdate,v=r.headerContainerRef,g=r.headersRef,p=r.hiddenColumns,w=r.hoveredHeaderRef,R=r.isWidthDragging,C=r.mainTemplateColumns,b=r.onSort,x=r.onTableHeaderDragEnd,y=r.pinnedLeftColumns,I=r.pinnedLeftTemplateColumns,E=r.pinnedRightColumns,D=r.pinnedRightTemplateColumns,H=r.selectableColumns,S=r.setIsWidthDragging,M=r.setSelectedCells,k=r.shouldDisplayLastColumnCell,L=r.sort,T=r.sortDownIcon,B=r.sortUpIcon,O=r.mainBodyRef,A=o(null);ne(O,A);return e("div",m({className:"st-header-container",ref:v},{children:[y.length>0&&n("div",m({className:"st-header-pinned-left",style:{gridTemplateColumns:I}},{children:n(G,m({allowAnimations:l,draggedHeaderRef:u,headersRef:g,mainBodyRef:O,pauseAnimation:R,rowIndex:0},{children:null===(t=g.current)||void 0===t?void 0:t.map((function(e,r){return N({hiddenColumns:p,header:e,pinned:"left"})?n(ee,{columnResizing:c,currentRows:s,draggable:d,draggedHeaderRef:u,forceUpdate:f,headersRef:g,hoveredHeaderRef:w,index:r,onSort:b,onTableHeaderDragEnd:x,ref:h(),selectableColumns:H,setIsWidthDragging:S,setSelectedCells:M,sort:L,sortDownIcon:T,sortUpIcon:B},e.accessor):null}))}))})),n("div",m({className:"st-header-main",onScroll:function(e){var n,r,t=null===(n=A.current)||void 0===n?void 0:n.scrollLeft;void 0!==t&&(null===(r=O.current)||void 0===r||r.scrollTo(t,0))},ref:A,style:{gridTemplateColumns:C}},{children:e(G,m({allowAnimations:l,draggedHeaderRef:u,headersRef:g,mainBodyRef:O,pauseAnimation:R,rowIndex:0},{children:[null===(a=g.current)||void 0===a?void 0:a.map((function(e,r){return N({hiddenColumns:p,header:e})?n(ee,{columnResizing:c,currentRows:s,draggable:d,draggedHeaderRef:u,forceUpdate:f,headersRef:g,hoveredHeaderRef:w,index:r,onSort:b,onTableHeaderDragEnd:x,ref:h(),selectableColumns:H,setIsWidthDragging:S,setSelectedCells:M,sort:L,sortDownIcon:T,sortUpIcon:B},e.accessor):null})),n(j,{ref:h(),visible:k})]}))})),E.length>0&&n("div",m({className:"st-header-pinned-right",style:{gridTemplateColumns:D}},{children:e(G,m({allowAnimations:l,draggedHeaderRef:u,headersRef:g,mainBodyRef:O,pauseAnimation:R,rowIndex:0},{children:[null===(i=g.current)||void 0===i?void 0:i.map((function(e,r){return N({hiddenColumns:p,header:e,pinned:"right"})?n(ee,{columnResizing:c,currentRows:s,draggable:d,draggedHeaderRef:u,forceUpdate:f,headersRef:g,hoveredHeaderRef:w,index:r,onSort:b,onTableHeaderDragEnd:x,reverse:!0,ref:h(),selectableColumns:H,setIsWidthDragging:S,setSelectedCells:M,sort:L,sortDownIcon:T,sortUpIcon:B},e.accessor):null})),n(j,{ref:h(),visible:k})]}))}))]}))},te=function(r){var t=r.allowAnimations,a=r.columnResizing,i=r.currentRows,c=r.draggable,s=r.draggedHeaderRef,d=r.editColumns,u=r.forceUpdate,f=r.getBorderClass,h=r.handleMouseDown,v=r.handleMouseOver,g=r.headersRef,p=r.hiddenColumns,w=r.hoveredHeaderRef,R=r.isRowExpanded,C=r.isSelected,b=r.isTopLeftCell,x=r.isWidthDragging,y=r.mainBodyRef,I=r.onCellChange,E=r.onExpandRowClick,D=r.onSort,H=r.onTableHeaderDragEnd,S=r.pinnedLeftRef,M=r.pinnedRightRef,N=r.scrollbarHorizontalRef,k=r.scrollbarWidth,L=r.selectableColumns,T=r.setIsWidthDragging,B=r.setSelectedCells,O=r.shouldPaginate,A=r.sort,P=r.sortDownIcon,W=r.sortUpIcon,z=r.tableBodyContainerRef,U=o(null),j=g.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=g.current.filter((function(e){return"left"===e.pinned&&!0!==e.hide})),V=g.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]),Y=l((function(){return"".concat(V.map((function(e){return"".concat(e.width,"px")})).join(" "))}),[V]),K={allowAnimations:t,columnResizing:a,currentRows:i,draggable:c,draggedHeaderRef:s,forceUpdate:u,headerContainerRef:U,headersRef:g,hiddenColumns:p,hoveredHeaderRef:w,isWidthDragging:x,mainBodyRef:y,mainTemplateColumns:X,onSort:D,onTableHeaderDragEnd:H,pinnedLeftColumns:G,pinnedLeftTemplateColumns:J,pinnedRightColumns:V,pinnedRightTemplateColumns:Y,selectableColumns:L,setIsWidthDragging:T,setSelectedCells:B,shouldDisplayLastColumnCell:F,sort:A,sortDownIcon:P,sortUpIcon:W,tableBodyContainerRef:z},$={allowAnimations:t,currentRows:i,draggedHeaderRef:s,getBorderClass:f,handleMouseDown:h,handleMouseOver:v,headerContainerRef:U,headers:g.current,headersRef:g,hiddenColumns:p,hoveredHeaderRef:w,isRowExpanded:R,isSelected:C,isTopLeftCell:b,isWidthDragging:x,mainBodyRef:y,mainTemplateColumns:X,onCellChange:I,onExpandRowClick:E,onTableHeaderDragEnd:H,pinnedLeftColumns:G,pinnedLeftRef:S,pinnedLeftTemplateColumns:J,pinnedRightColumns:V,pinnedRightRef:M,pinnedRightTemplateColumns:Y,scrollbarHorizontalRef:N,scrollbarWidth:k,shouldDisplayLastColumnCell:F,shouldPaginate:O,tableBodyContainerRef:z};return e("div",m({className:"st-table-content",style:{width:d?"calc(100% - 27.5px)":"100%"}},{children:[n(re,m({},K)),n(q,m({},$))]}))},oe=function(e){var n=e.callback,r=e.ref,t=e.widthAttribute;i((function(){var e=r.current;if(e){var o=function(){n(e[t]||0)};o();var a=new ResizeObserver((function(){o()}));return a.observe(e),function(){return a.disconnect()}}}),[n,r,t])},ae=function(r){r.headersRef;var a=r.mainBodyRef,i=r.pinnedLeftRef,l=r.pinnedRightRef,c=r.scrollbarHorizontalRef,s=r.tableContentWidth,d=t(0),u=d[0],f=d[1],h=t(0),v=h[0],g=h[1],p=t(0),w=p[0],R=p[1],C=o(null);return oe({widthAttribute:"offsetWidth",callback:f,ref:i}),oe({widthAttribute:"scrollWidth",callback:R,ref:a}),oe({widthAttribute:"offsetWidth",callback:g,ref:l}),ne(a,C),!a.current||a.current.scrollWidth<=a.current.clientWidth?null:n("div",m({className:"st-horizontal-scrollbar-container",ref:c},{children:e("div",m({style:{width:s}},{children:[u>0&&n("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u}}),w>0&&n("div",m({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&a.current&&a.current.scrollTo({left:n,behavior:"auto"})},ref:C},{children:n("div",{style:{width:w}})})),v>0&&n("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:v}})]}))}))};!function(e){e.Left="left",e.Right="right"}(R||(R={}));var ie=function(r){var c=r.allowAnimations,s=void 0!==c&&c,d=r.columnEditorPosition,f=void 0===d?R.Right:d,h=r.columnEditorText,v=void 0===h?"Columns":h,p=r.columnResizing,w=void 0!==p&&p,D=r.defaultHeaders,H=r.draggable,M=void 0!==H&&H,N=r.editColumns,k=void 0!==N&&N,L=r.editColumnsInitOpen,T=void 0!==L&&L,B=r.height,O=r.hideFooter,A=void 0!==O&&O,P=r.nextIcon,W=void 0===P?n(x,{className:"st-next-prev-icon"}):P,z=r.onCellChange,U=r.prevIcon,j=void 0===U?n(b,{className:"st-next-prev-icon"}):U,F=r.rows,G=r.rowsPerPage,V=void 0===G?10:G,J=r.selectableCells,X=void 0!==J&&J,Y=r.selectableColumns,q=void 0!==Y&&Y,K=r.shouldPaginate,$=void 0!==K&&K,Q=r.sortDownIcon,_=void 0===Q?n(E,{className:"st-sort-icon"}):Q,ee=r.sortUpIcon,ne=void 0===ee?n(I,{className:"st-sort-icon"}):ee,re=r.theme,oe=void 0===re?"light":re,ie=t((function(){return function(e){var n=new Set,r=function(e){var t;e.rowMeta.isExpanded&&n.add(e.rowMeta.rowId.toString()),null===(t=e.rowMeta.children)||void 0===t||t.forEach(r)};return e.forEach(r),n}(F)})),le=ie[0],ce=ie[1],se=l((function(){return F.map((function(e,n){return m(m({},e),{originalRowIndex:n})}))}),[F]),de=o(null),ue=o(D),fe=o(null),he=o(null),ve=o(null),ge=o(null),me=o(null),pe=o(null),we=t(!1),Re=we[0],Ce=we[1],be=t(1),xe=be[0],ye=be[1],Ie=t(0),Ee=Ie[0],De=Ie[1],He=t(0),Se=He[0],Me=He[1],Ne=function(e,n){var r=t(null),o=r[0],a=r[1],i=t({}),c=i[0],s=i[1],d=l((function(){return o?Z(n,e,o).sortedData:e}),[e,o,n]);return{sort:o,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:d,hiddenColumns:c,setHiddenColumns:s}}(se,ue.current),ke=Ne.sort,Le=Ne.sortedRows,Te=Ne.hiddenColumns,Be=Ne.setHiddenColumns,Oe=Ne.updateSort,Ae=a((function(e){var n=String(e);ce((function(e){var r=new Set(e);return r.has(n)?r.delete(n):r.add(n),r}))}),[]),Pe=a((function(e){return le.has(String(e))}),[le]),We=g((function(e){return e+1}),0)[1],ze=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=a((function(){var e=Array.from(d).reduce((function(e,n){var t=n.split("-").map(Number),o=t[0],a=t[1];return e[o]||(e[o]=[]),e[o][a]=c[o][r[a].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");navigator.clipboard.writeText(n)}),[d,c,r]);i((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=a((function(e,n){return d.has("".concat(e,"-").concat(n))}),[d]),m=a((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),a=Math.max(h.current.row,e),i=Math.min(h.current.col,r),l=Math.max(h.current.col,r),c=o;c<=a;c++)for(var s=i;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:ue.current,rows:Le}),Ue=ze.handleMouseDown,je=ze.handleMouseOver,Fe=ze.handleMouseUp,Ge=ze.isSelected,Ve=ze.getBorderClass,Je=ze.isTopLeftCell,Xe=ze.setSelectedCells,Ye=l((function(){return $?Le.slice((xe-1)*V,xe*V):Le}),[xe,V,$,Le]),qe=a((function(e,n){Oe(e,n)}),[Oe]),Ke=a((function(e){ue.current=e,We()}),[]);return i((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||q&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||Xe(new Set)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[q,Xe]),u((function(){if(pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth,n=pe.current.clientWidth;De(e),Me(n)}}),[]),n(y.Provider,m({value:{rows:F,tableRows:se}},{children:e("div",m({className:"simple-table-root st-wrapper theme-".concat(oe),style:B?{height:B}:{}},{children:[e("div",m({className:"st-table-wrapper-container"},{children:[e("div",m({className:"st-table-wrapper",onMouseUp:Fe,onMouseLeave:Fe},{children:[n(te,{allowAnimations:s,columnResizing:w,currentRows:Ye,draggable:M,draggedHeaderRef:de,editColumns:k,forceUpdate:We,getBorderClass:Ve,handleMouseDown:Ue,handleMouseOver:je,headers:ue.current,headersRef:ue,hiddenColumns:Te,hoveredHeaderRef:fe,isRowExpanded:Pe,isSelected:Ge,isTopLeftCell:Je,isWidthDragging:Re,mainBodyRef:he,onCellChange:z,onExpandRowClick:Ae,onSort:qe,onTableHeaderDragEnd:Ke,pinnedLeftRef:ve,pinnedRightRef:ge,scrollbarHorizontalRef:me,scrollbarWidth:Ee,selectableColumns:q,setIsWidthDragging:Ce,setSelectedCells:Xe,shouldPaginate:$,sort:ke,sortDownIcon:_,sortUpIcon:ne,tableBodyContainerRef:pe}),n(S,{columnEditorText:v,editColumns:k,editColumnsInitOpen:T,headers:ue.current,hiddenColumns:Te,position:f,setHiddenColumns:Be})]})),n(ae,{headersRef:ue,mainBodyRef:he,pinnedLeftRef:ve,pinnedRightRef:ge,scrollbarHorizontalRef:me,tableContentWidth:Se})]})),n(C,{currentPage:xe,hideFooter:A,nextIcon:W,onPageChange:ye,prevIcon:j,rowsPerPage:V,shouldPaginate:$,totalRows:Le.length})]}))}))};ie.defaultProps={allowAnimations:!1,columnEditorPosition:R.Right,columnEditorText:"Columns",columnResizing:!1,defaultHeaders:[],draggable:!1,editColumns:!1,editColumnsInitOpen:!1,height:"",hideFooter:!1,nextIcon:n(x,{className:"st-next-prev-icon"}),onCellChange:function(){},prevIcon:n(b,{className:"st-next-prev-icon"}),rows:[],rowsPerPage:10,selectableCells:!1,selectableColumns:!1,shouldPaginate:!1,sortDownIcon:n(E,{className:"st-sort-icon"}),sortUpIcon:n(I,{className:"st-sort-icon"}),theme:"light"};var le=v(ie);export{le 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,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");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};
|
|
2
2
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=function(){return r=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)};function t(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}function o(e,n,r){if(r||2===arguments.length)for(var t,o=0,a=n.length;o<a;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var a,s=function(n){var t=n.currentPage,o=n.hideFooter,a=n.nextIcon,s=n.onPageChange,l=n.prevIcon,i=n.rowsPerPage,c=n.shouldPaginate,d=n.totalRows,u=Math.ceil(d/i),f=t>1,h=t<u,v=function(e){e>=1&&e<=u&&s(e)};return o||!c?null:e.jsxs("div",r({className:"st-footer"},{children:[e.jsx("button",r({className:"st-next-prev-btn ".concat(f?"":"disabled"),onClick:function(){return v(t-1)},disabled:!f},{children:l})),e.jsx("button",r({className:"st-next-prev-btn ".concat(h?"":"disabled"),onClick:function(){return v(t+1)},disabled:!h},{children:a})),Array.from({length:u},(function(n,o){return e.jsx("button",r({onClick:function(){return v(o+1)},className:"st-page-btn ".concat(t===o+1?"active":"")},{children:o+1}),o)}))]}))},l=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},i=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},c=n.createContext({rows:[],tableRows:[]}),d=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},u=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 20 20",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},f=function(t){var o=t.checked,a=void 0!==o&&o,s=t.children,l=t.onChange,i=n.useState(a),c=i[0],d=i[1];return e.jsxs("label",r({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:c,className:"st-checkbox-input",onChange:function(){var e=!c;d(e),l&&l(e)},type:"checkbox"}),e.jsx("span",r({className:"st-checkbox-custom ".concat(c?"st-checked":"")},{children:c&&e.jsx("span",{className:"st-checkbox-checkmark"})})),s]}))},h=function(n){var t=n.headers,o=n.open,a=n.position;n.setOpen;var s=n.setHiddenColumns,l=n.hiddenColumns,i="left"===a?"left":"";return e.jsx("div",r({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(i),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",r({className:"st-column-editor-popout-content"},{children:t.map((function(n,t){return e.jsx(f,r({checked:l[n.accessor],onChange:function(e){var t;return s(r(r({},l),((t={})[n.accessor]=e,t)))}},{children:n.label}),t)}))}))}))},v=function(t){var o=t.columnEditorText,a=t.editColumns,s=t.editColumnsInitOpen,l=t.headers,i=t.position,c=void 0===i?"right":i,d=t.setHiddenColumns,u=t.hiddenColumns,f=n.useState(s),v=f[0],g=f[1];return a?e.jsxs("div",r({className:"st-column-editor ".concat(v?"open":""," ").concat(c),onClick:function(){return function(e){g(e)}(!v)}},{children:[e.jsx("div",r({className:"st-column-editor-text"},{children:o})),e.jsx(h,{headers:l,open:v,position:c,setOpen:g,setHiddenColumns:d,hiddenColumns:u})]})):null},g=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},m=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},p=function(n){var t=n.value,o=n.onBlur,a=n.onChange;return e.jsxs("select",r({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;a("true"===n)}},{children:[e.jsx("option",r({value:"true"},{children:"True"})),e.jsx("option",r({value:"false"},{children:"False"}))]}))},w=function(r){var t=r.defaultValue,o=r.onBlur,a=r.onChange,s=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:s,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){var n=e.target.value;a(n)}})},R=function(r){var t=r.defaultValue,o=r.onBlur,a=r.onChange,s=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:s,autoFocus:!0,defaultValue:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&a(n)}})},x=function(n){var r=n.onChange,t=n.setIsEditing,o=n.value,a=function(e){null==r||r(e)},s=function(){t(!1)};return e.jsx(e.Fragment,{children:"string"==typeof o||null==o?e.jsx(w,{defaultValue:o,onBlur:s,onChange:a}):"boolean"==typeof o?e.jsx(p,{onBlur:s,onChange:a,value:o}):"number"==typeof o?e.jsx(R,{defaultValue:o,onBlur:s,onChange:a}):null})},C=0,b=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===C||o-C>=t)&&(C=o,n(r))}},y=Date.now(),j={screenX:0,screenY:0},E=function(e){var r,t,a=e.draggedHeaderRef,s=e.headersRef,l=e.hoveredHeaderRef,i=e.onTableHeaderDragEnd,c=(r=s.current,t=n.useRef(r),n.useEffect((function(){t.current=r}),[r]),t.current);return{handleDragStart:function(e){a.current=e,y=Date.now()},handleDragOver:function(e){var n,r=e.event,t=e.hoveredHeader;if(r.preventDefault(),s.current){var d=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=r.screenX,f=r.screenY,h=Math.sqrt(Math.pow(u-j.screenX,2)+Math.pow(f-j.screenY,2));l.current=t;var v=o([],s.current,!0),g=v.findIndex((function(e){var n;return e.accessor===(null===(n=a.current)||void 0===n?void 0:n.accessor)})),m=v.findIndex((function(e){return e.accessor===t.accessor})),p=v.splice(g,1)[0];if(v.splice(m,0,p),!(d||t.accessor===(null===(n=a.current)||void 0===n?void 0:n.accessor)||null===a.current||h<10||void 0===g||void 0===m||JSON.stringify(v)===JSON.stringify(s.current))){var w=Date.now();JSON.stringify(v)===JSON.stringify(c)&&w-y<800&&h<50||(y=w,j={screenX:u,screenY:f},i(v))}}},handleDragEnd:function(){a.current=null,l.current=null}}},S=n.forwardRef((function(t,o){var a=t.borderClass,s=t.cellHasChildren,l=t.colIndex,d=t.content,f=t.depth,h=t.draggedHeaderRef,v=t.header,m=t.headersRef,p=t.hoveredHeaderRef,w=t.isRowExpanded,R=t.isSelected,C=t.isTopLeftCell,y=t.onCellChange,j=t.onExpandRowClick,S=t.onMouseDown,I=t.onMouseOver,D=t.onTableHeaderDragEnd,M=t.row,H=t.rowIndex,k=n.useContext(c);k.rows,k.tableRows;var N=n.useState(d),L=N[0],T=N[1],B=n.useState(!1),O=B[0],A=B[1],P=E({draggedHeaderRef:h,headersRef:m,hoveredHeaderRef:p,onTableHeaderDragEnd:D}).handleDragOver,W=b(),z=Boolean(null==v?void 0:v.isEditable),U=H%2==0,F="st-cell ".concat(f>0&&v.expandable?"st-cell-depth-".concat(f):""," ").concat(R?C?"st-cell-selected-first-cell ".concat(a):"st-cell-selected ".concat(a):""," ").concat(U?"st-cell-odd-row":"st-cell-even-row"," ").concat(z?"clickable":""," ").concat("right"===v.align?"right-aligned":"");n.useEffect((function(){"object"!=typeof d&&T(d)}),[d]);return O?e.jsx("div",r({className:"st-cell-editing ".concat(U?"st-cell-odd-row":"st-cell-even-row"),id:g({accessor:v.accessor,rowIndex:H+1})},{children:e.jsx(x,{onChange:function(e){var n;T(e),null==y||y({accessor:v.accessor,newValue:e,newRowIndex:H,originalRowIndex:null===(n=M.rowMeta)||void 0===n?void 0:n.rowId,row:M})},setIsEditing:A,value:L})})):e.jsxs("div",r({className:F,id:g({accessor:v.accessor,rowIndex:H+1}),onDoubleClick:function(){return v.isEditable&&A(!0)},onMouseDown:function(){return S(H,l)},onMouseOver:function(){return I(H,l)},onDragOver:function(e){return W({callback:P,callbackProps:{event:e,hoveredHeader:v},limit:50})},ref:o},{children:[v.expandable&&s?w(M.rowMeta.rowId)?e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return j(M.rowMeta.rowId)}},{children:e.jsx(u,{className:"st-sort-icon"})})):e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return j(M.rowMeta.rowId)}},{children:e.jsx(i,{className:"st-sort-icon"})})):null,e.jsx("span",{children:L})]}))})),I=n.forwardRef((function(n,r){return n.visible?e.jsx("div",{className:"st-cell",ref:r}):e.jsx("div",{ref:r})})),D=function(n){var r=n.lastGroupRow;return e.jsx("div",{className:"st-row-separator ".concat(r?"st-last-group-row":"")})},M=function(n){var o=n.allowAnimations,a=n.children,s=t(n,["allowAnimations","children"]);return o?e.jsx(H,r({},s,{children:a})):e.jsx(e.Fragment,{children:a})},H=function(r){var t=r.allowHorizontalAnimate,o=void 0===t||t,a=r.children,s=r.draggedHeaderRef,l=r.headersRef,i=r.isBody,c=r.mainBodyRef,d=r.pauseAnimation,u=r.rowIndex,f=n.useRef(!1),h=n.useState({}),v=h[0],m=h[1],p=n.useRef({}),w=l.current;return n.useLayoutEffect((function(){if(w){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var a=document.getElementById(g({accessor:e.accessor,rowIndex:t}));if(a){var s=a.getAnimations().some((function(e){return"running"===e.playState})),l=a.getBoundingClientRect();s&&(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:w,draggedHeaderRef:s,rowIndex:u});JSON.stringify(e)!==JSON.stringify(v)&&(p.current=v,m(e))}}),[v,w,s,i,u]),n.useLayoutEffect((function(){var e=c.current,n=function(){f.current=!0},r=function(){f.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[s,c]),n.useEffect((function(){d||f.current||Object.keys(p.current).length&&w&&w.forEach((function(e){var n=document.getElementById(g({accessor:e.accessor,rowIndex:u}));if(n){var r=p.current[e.accessor],t=v[e.accessor];if(r&&t){var a=r.left-t.left,s=o?0:r.top-t.top,l=Math.abs(a),i=Math.abs(s);(l>10||i>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(a,"px, ").concat(s,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[o,v,w,i,d,p,u]),e.jsx(e.Fragment,{children:a})},k=function(o){var a,s=o.getBorderClass,l=o.handleMouseDown,i=o.handleMouseOver,c=o.headers,d=o.hiddenColumns,u=o.isRowExpanded,f=o.isSelected,h=o.isTopLeftCell,v=o.lastGroupRow,g=o.onExpandRowClick,p=o.pinned,w=o.row,R=o.rowIndex,x=o.shouldDisplayLastColumnCell,C=t(o,["getBorderClass","handleMouseDown","handleMouseOver","headers","hiddenColumns","isRowExpanded","isSelected","isTopLeftCell","lastGroupRow","onExpandRowClick","pinned","row","rowIndex","shouldDisplayLastColumnCell"]),b=null===(a=w.rowMeta)||void 0===a?void 0:a.children;return e.jsxs(M,r({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&&e.jsx(D,{lastGroupRow:v}),c.map((function(e,t){if(!m({hiddenColumns:d,header:e,pinned:p}))return null;var o=w.rowData[e.accessor];return e.cellRenderer&&(o=e.cellRenderer(w)),n.createElement(S,r({},C,{borderClass:s(R,t),cellHasChildren:((null==b?void 0:b.length)||0)>0,colIndex:t,content:o,header:e,isRowExpanded:u,isSelected:f(R,t),isTopLeftCell:h(R,t),key:t,onExpandRowClick:g,onMouseDown:function(){return l({rowIndex:R,colIndex:t})},onMouseOver:function(){return i(R,t)},row:w,rowIndex:R}))})),e.jsx(I,{ref:n.createRef(),visible:x})]}))},N=function(t){var o,a,s,l=t.depth,i=void 0===l?0:l,c=t.getNextRowIndex,d=t.index,u=t.lastGroupRow,f=t.pinned,h=t.props,v=t.row,g=((null===(a=null===(o=v.rowMeta)||void 0===o?void 0:o.children)||void 0===a?void 0:a.length)||0)>0,m=c(),p=(null===(s=v.rowMeta)||void 0===s?void 0:s.children)||[];return e.jsxs(e.Fragment,{children:[n.createElement(k,r({},h,{depth:i,lastGroupRow:u,key:d,pinned:f,row:v,rowIndex:m})),g&&h.isRowExpanded(v.rowMeta.rowId)&&p.map((function(n,r){return e.jsx(N,{depth:i+1,getNextRowIndex:c,index:r,pinned:f,props:h,row:n},r)}))]})},L=function(o){o.headerContainerRef;var a=o.isRowExpanded,s=o.onExpandRowClick,l=o.pinned,i=o.rows,c=o.sectionRef,d=o.templateColumns,u=t(o,["headerContainerRef","isRowExpanded","onExpandRowClick","pinned","rows","sectionRef","templateColumns"]),f=l?"st-table-body-pinned-".concat(l):"st-table-body-main",h=n.useRef(0);n.useEffect((function(){h.current=0}));var v=function(){return h.current++};return e.jsx("div",r({className:f,ref:c,style:{gridTemplateColumns:d}},{children:i.map((function(n,t){var o,i;return e.jsx(N,{getNextRowIndex:v,index:t,lastGroupRow:Boolean(null===(i=null===(o=n.rowMeta)||void 0===o?void 0:o.children)||void 0===i?void 0:i.length),pinned:l,props:r(r({},u),{isRowExpanded:a,onExpandRowClick:s}),row:n},t)}))}))},T=function(t){var o=t.currentRows,a=t.headerContainerRef,s=t.isRowExpanded,l=t.mainBodyRef,i=t.mainTemplateColumns,c=t.onExpandRowClick,d=t.pinnedLeftColumns,u=t.pinnedLeftRef,f=t.pinnedLeftTemplateColumns,h=t.pinnedRightColumns,v=t.pinnedRightRef,g=t.pinnedRightTemplateColumns,m=t.scrollbarHorizontalRef,p=t.scrollbarWidth,w=t.tableBodyContainerRef;return function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarHorizontalRef,a=e.scrollbarWidth,s=n.useState(!1),l=s[0],i=s[1];n.useEffect((function(){var e=null==r?void 0:r.current,n=null==o?void 0:o.current;if(l&&e)return e.classList.add("st-header-scroll-padding"),null==n||n.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(a,"px")),null==n||n.style.setProperty("--st-after-width","".concat(a,"px")),function(){e.classList.remove("st-header-scroll-padding"),null==n||n.classList.remove("st-header-scroll-padding")}}),[r,l,o,a]),n.useEffect((function(){var e=null==r?void 0:r.current,n=null==t?void 0:t.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;i(e)}};o();var a=new ResizeObserver((function(){o()}));return a.observe(n),function(){n&&a.unobserve(n)}}}),[r,t])}({headerContainerRef:a,mainSectionRef:w,scrollbarHorizontalRef:m,scrollbarWidth:p}),e.jsxs("div",r({className:"st-table-body-container",ref:w},{children:[d.length>0&&e.jsx(L,r({},t,{rows:o,templateColumns:f,pinned:"left",sectionRef:u,isRowExpanded:s,onExpandRowClick:c})),e.jsx(L,r({},t,{rows:o,templateColumns:i,sectionRef:l,isRowExpanded:s,onExpandRowClick:c})),h.length>0&&e.jsx(L,r({},t,{rows:o,templateColumns:g,pinned:"right",sectionRef:v,isRowExpanded:s,onExpandRowClick:c}))]}))},B={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var a=t.getTime()-o.getTime();return"ascending"===r?a:-a},enum:function(e,n,r){return B.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?B.string(e,n,r):"number"==typeof e&&"number"==typeof n?B.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?B.boolean(e,n,r):B.string(String(e),String(n),r)}},O=function(e,n,r,t){switch(void 0===r&&(r="string"),r){case"string":return B.string(String(e||""),String(n||""),t);case"number":return B.number(Number(e||0),Number(n||0),t);case"boolean":return B.boolean(Boolean(e),Boolean(n),t);case"date":return B.date(String(e||""),String(n||""),t);case"enum":return B.enum(String(e||""),String(n||""),t);default:return B.default(e,n,t)}},A=function(e,n,t){var a=t.find((function(e){return e.accessor===n.key.accessor})),s=(null==a?void 0:a.type)||"string",l=n.direction;return o([],e,!0).sort((function(e,r){var t,o,a=null===(t=null==e?void 0:e.rowData)||void 0===t?void 0:t[n.key.accessor],i=null===(o=null==r?void 0:r.rowData)||void 0===o?void 0:o[n.key.accessor];return O(a,i,s,l)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?r(r({},e),{rowMeta:r(r({},e.rowMeta),{children:A(e.rowMeta.children,n,t)})}):e}))},P=function(e,n,t){var a=function(e,n,t){var a=t.find((function(e){return e.accessor===n.key.accessor})),s=(null==a?void 0:a.type)||"string",l=n.direction,i=[],c=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}))}))||i.push(n),n.rowMeta.children&&n.rowMeta.children.length>0&&c.set(n.rowMeta.rowId,n.rowMeta.children)})),o([],i,!0).sort((function(e,r){var t,o,a=null===(t=null==e?void 0:e.rowData)||void 0===t?void 0:t[n.key.accessor],i=null===(o=null==r?void 0:r.rowData)||void 0===o?void 0:o[n.key.accessor];return O(a,i,s,l)})).map((function(e){var o=r({},e);if(c.has(e.rowMeta.rowId)){var a=c.get(e.rowMeta.rowId)||[],s=A(a,n,t);o.rowMeta=r(r({},o.rowMeta),{children:s})}return o}))}(n,t,e);return{sortedData:a,newSortConfig:t}},W=function(e){var n=e.event,r=e.forceUpdate,t=e.header,o=e.headersRef,a=e.index;e.reverse;var s=e.setIsWidthDragging;s(!0),n.preventDefault();var l=n.clientX;if(t){var i=t.width,c=function(e){var n=Math.max(i+(e.clientX-l),40);t&&o.current&&(o.current[a].width=n,r())},d=function(){document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),s(!1)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",d)}},z=n.forwardRef((function(t,o){var a,s=t.columnResizing,l=t.currentRows,i=t.draggable,c=t.draggedHeaderRef,d=t.forceUpdate,u=t.headersRef,f=t.hoveredHeaderRef,h=t.index,v=t.onSort,m=t.onTableHeaderDragEnd,p=t.reverse,w=t.selectableColumns,R=t.setIsWidthDragging,x=t.setSelectedCells,C=t.sort,y=t.sortDownIcon,j=t.sortUpIcon,S=n.useState(!1),I=S[0],D=S[1],M=null===(a=u.current)||void 0===a?void 0:a[h],H=Boolean(null==M?void 0:M.isSortable),k="st-header-cell ".concat(M===f.current?"st-hovered":""," ").concat(I?"st-dragging":""," ").concat(H?"clickable":""," ").concat(i&&!H?"draggable":""," ").concat("right"===(null==M?void 0:M.align)?"right-aligned":""),N=E({draggedHeaderRef:c,headersRef:u,hoveredHeaderRef:f,onTableHeaderDragEnd:m}),L=N.handleDragStart,T=N.handleDragEnd,B=E({draggedHeaderRef:c,headersRef:u,hoveredHeaderRef:f,onTableHeaderDragEnd:m}).handleDragOver,O=b(),A=function(e){var n=e.event,r=e.header;if(w){var t=l.length,o=Array.from({length:t},(function(e,n){return"".concat(n,"-").concat(h)})),a=function(e,n){var r=new Set,o=Math.min(e,n),a=Math.max(e,n);return Array.from({length:t}).forEach((function(e,n){Array.from({length:a-o+1}).forEach((function(e,t){r.add("".concat(n,"-").concat(o+t))}))})),r};n.shiftKey?x((function(e){var n,r=Number(null===(n=Array.from(e)[0])||void 0===n?void 0:n.split("-")[1]),t=Number(o[0].split("-")[1]);return r===t?new Set(o):r>t?a(t,r):a(r,t)})):x(new Set(o))}else r.isSortable&&v(h,r.accessor)};if(n.useEffect((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!M)return null;var P=s&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){O({callback:W,callbackProps:{event:e,forceUpdate:d,header:M,headersRef:u,index:h,setIsWidthDragging:R},limit:10})}});return e.jsxs("div",r({className:k,id:g({accessor:M.accessor,rowIndex:0}),onDragOver:function(e){O({callback:B,callbackProps:{event:e,hoveredHeader:M},limit:50})},ref:o,style:{width:M.width}},{children:[p&&P,e.jsx("div",r({className:"st-header-label",draggable:i,onClick:function(e){return A({event:e,header:M})},onDragEnd:function(e){e.preventDefault(),D(!1),T()},onDragStart:function(e){i&&M&&function(e){D(!0),L(e)}(M)}},{children:null==M?void 0:M.label})),C&&C.key.accessor===M.accessor&&e.jsxs("div",r({className:"st-sort-icon-container",onClick:function(e){return A({event:e,header:M})}},{children:["ascending"===C.direction&&j&&j,"descending"===C.direction&&y&&y]})),!p&&P]}))})),U=function(e,r){n.useEffect((function(){if(e.current){var n=e.current,t=function(){var e,t=null==n?void 0:n.scrollLeft;void 0!==t&&(null===(e=r.current)||void 0===e||e.scrollTo(t,0))};return n.addEventListener("scroll",t),function(){null==n||n.removeEventListener("scroll",t)}}}),[e,r])},F=function(t){var o,a,s,l=t.allowAnimations,i=t.columnResizing,c=t.currentRows,d=t.draggable,u=t.draggedHeaderRef,f=t.forceUpdate,h=t.headerContainerRef,v=t.headersRef,g=t.hiddenColumns,p=t.hoveredHeaderRef,w=t.isWidthDragging,R=t.mainTemplateColumns,x=t.onSort,C=t.onTableHeaderDragEnd,b=t.pinnedLeftColumns,y=t.pinnedLeftTemplateColumns,j=t.pinnedRightColumns,E=t.pinnedRightTemplateColumns,S=t.selectableColumns,D=t.setIsWidthDragging,H=t.setSelectedCells,k=t.shouldDisplayLastColumnCell,N=t.sort,L=t.sortDownIcon,T=t.sortUpIcon,B=t.mainBodyRef,O=n.useRef(null);U(B,O);return e.jsxs("div",r({className:"st-header-container",ref:h},{children:[b.length>0&&e.jsx("div",r({className:"st-header-pinned-left",style:{gridTemplateColumns:y}},{children:e.jsx(M,r({allowAnimations:l,draggedHeaderRef:u,headersRef:v,mainBodyRef:B,pauseAnimation:w,rowIndex:0},{children:null===(o=v.current)||void 0===o?void 0:o.map((function(r,t){return m({hiddenColumns:g,header:r,pinned:"left"})?e.jsx(z,{columnResizing:i,currentRows:c,draggable:d,draggedHeaderRef:u,forceUpdate:f,headersRef:v,hoveredHeaderRef:p,index:t,onSort:x,onTableHeaderDragEnd:C,ref:n.createRef(),selectableColumns:S,setIsWidthDragging:D,setSelectedCells:H,sort:N,sortDownIcon:L,sortUpIcon:T},r.accessor):null}))}))})),e.jsx("div",r({className:"st-header-main",onScroll:function(e){var n,r,t=null===(n=O.current)||void 0===n?void 0:n.scrollLeft;void 0!==t&&(null===(r=B.current)||void 0===r||r.scrollTo(t,0))},ref:O,style:{gridTemplateColumns:R}},{children:e.jsxs(M,r({allowAnimations:l,draggedHeaderRef:u,headersRef:v,mainBodyRef:B,pauseAnimation:w,rowIndex:0},{children:[null===(a=v.current)||void 0===a?void 0:a.map((function(r,t){return m({hiddenColumns:g,header:r})?e.jsx(z,{columnResizing:i,currentRows:c,draggable:d,draggedHeaderRef:u,forceUpdate:f,headersRef:v,hoveredHeaderRef:p,index:t,onSort:x,onTableHeaderDragEnd:C,ref:n.createRef(),selectableColumns:S,setIsWidthDragging:D,setSelectedCells:H,sort:N,sortDownIcon:L,sortUpIcon:T},r.accessor):null})),e.jsx(I,{ref:n.createRef(),visible:k})]}))})),j.length>0&&e.jsx("div",r({className:"st-header-pinned-right",style:{gridTemplateColumns:E}},{children:e.jsxs(M,r({allowAnimations:l,draggedHeaderRef:u,headersRef:v,mainBodyRef:B,pauseAnimation:w,rowIndex:0},{children:[null===(s=v.current)||void 0===s?void 0:s.map((function(r,t){return m({hiddenColumns:g,header:r,pinned:"right"})?e.jsx(z,{columnResizing:i,currentRows:c,draggable:d,draggedHeaderRef:u,forceUpdate:f,headersRef:v,hoveredHeaderRef:p,index:t,onSort:x,onTableHeaderDragEnd:C,reverse:!0,ref:n.createRef(),selectableColumns:S,setIsWidthDragging:D,setSelectedCells:H,sort:N,sortDownIcon:L,sortUpIcon:T},r.accessor):null})),e.jsx(I,{ref:n.createRef(),visible:k})]}))}))]}))},G=function(t){var o=t.allowAnimations,a=t.columnResizing,s=t.currentRows,l=t.draggable,i=t.draggedHeaderRef,c=t.editColumns,d=t.forceUpdate,u=t.getBorderClass,f=t.handleMouseDown,h=t.handleMouseOver,v=t.headersRef,g=t.hiddenColumns,m=t.hoveredHeaderRef,p=t.isRowExpanded,w=t.isSelected,R=t.isTopLeftCell,x=t.isWidthDragging,C=t.mainBodyRef,b=t.onCellChange,y=t.onExpandRowClick,j=t.onSort,E=t.onTableHeaderDragEnd,S=t.pinnedLeftRef,I=t.pinnedRightRef,D=t.scrollbarHorizontalRef,M=t.scrollbarWidth,H=t.selectableColumns,k=t.setIsWidthDragging,N=t.setSelectedCells,L=t.shouldPaginate,B=t.sort,O=t.sortDownIcon,A=t.sortUpIcon,P=t.tableBodyContainerRef,W=n.useRef(null),z=v.current.filter((function(e){return!e.hide&&!e.pinned})),U=n.useMemo((function(){return!!C.current&&z.reduce((function(e,n){return e+n.width}),0)<C.current.clientWidth}),[z,C]),G=v.current.filter((function(e){return"left"===e.pinned&&!0!==e.hide})),V=v.current.filter((function(e){return"right"===e.pinned&&!0!==e.hide})),J=n.useMemo((function(){return"".concat(G.map((function(e){return"".concat(e.width,"px")})).join(" "))}),[G]),X=n.useMemo((function(){return"".concat(z.filter((function(e){return!0!==g[e.accessor]})).map((function(e){return"".concat(e.width,"px")})).join(" ")," 1fr")}),[z,g]),q=n.useMemo((function(){return"".concat(V.map((function(e){return"".concat(e.width,"px")})).join(" "))}),[V]),Y={allowAnimations:o,columnResizing:a,currentRows:s,draggable:l,draggedHeaderRef:i,forceUpdate:d,headerContainerRef:W,headersRef:v,hiddenColumns:g,hoveredHeaderRef:m,isWidthDragging:x,mainBodyRef:C,mainTemplateColumns:X,onSort:j,onTableHeaderDragEnd:E,pinnedLeftColumns:G,pinnedLeftTemplateColumns:J,pinnedRightColumns:V,pinnedRightTemplateColumns:q,selectableColumns:H,setIsWidthDragging:k,setSelectedCells:N,shouldDisplayLastColumnCell:U,sort:B,sortDownIcon:O,sortUpIcon:A,tableBodyContainerRef:P},K={allowAnimations:o,currentRows:s,draggedHeaderRef:i,getBorderClass:u,handleMouseDown:f,handleMouseOver:h,headerContainerRef:W,headers:v.current,headersRef:v,hiddenColumns:g,hoveredHeaderRef:m,isRowExpanded:p,isSelected:w,isTopLeftCell:R,isWidthDragging:x,mainBodyRef:C,mainTemplateColumns:X,onCellChange:b,onExpandRowClick:y,onTableHeaderDragEnd:E,pinnedLeftColumns:G,pinnedLeftRef:S,pinnedLeftTemplateColumns:J,pinnedRightColumns:V,pinnedRightRef:I,pinnedRightTemplateColumns:q,scrollbarHorizontalRef:D,scrollbarWidth:M,shouldDisplayLastColumnCell:U,shouldPaginate:L,tableBodyContainerRef:P};return e.jsxs("div",r({className:"st-table-content",style:{width:c?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(F,r({},Y)),e.jsx(T,r({},K))]}))},V=function(e){var r=e.callback,t=e.ref,o=e.widthAttribute;n.useEffect((function(){var e=t.current;if(e){var n=function(){r(e[o]||0)};n();var a=new ResizeObserver((function(){n()}));return a.observe(e),function(){return a.disconnect()}}}),[r,t,o])},J=function(t){t.headersRef;var o=t.mainBodyRef,a=t.pinnedLeftRef,s=t.pinnedRightRef,l=t.scrollbarHorizontalRef,i=t.tableContentWidth,c=n.useState(0),d=c[0],u=c[1],f=n.useState(0),h=f[0],v=f[1],g=n.useState(0),m=g[0],p=g[1],w=n.useRef(null);return V({widthAttribute:"offsetWidth",callback:u,ref:a}),V({widthAttribute:"scrollWidth",callback:p,ref:o}),V({widthAttribute:"offsetWidth",callback:v,ref:s}),U(o,w),!o.current||o.current.scrollWidth<=o.current.clientWidth?null:e.jsx("div",r({className:"st-horizontal-scrollbar-container",ref:l},{children:e.jsxs("div",r({style:{width:i}},{children:[d>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:d}}),m>0&&e.jsx("div",r({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&o.current&&o.current.scrollTo({left:n,behavior:"auto"})},ref:w},{children:e.jsx("div",{style:{width:m}})})),h>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:h}})]}))}))};!function(e){e.Left="left",e.Right="right"}(a||(a={}));var X=function(t){var o=t.allowAnimations,f=void 0!==o&&o,h=t.columnEditorPosition,g=void 0===h?a.Right:h,m=t.columnEditorText,p=void 0===m?"Columns":m,w=t.columnResizing,R=void 0!==w&&w,x=t.defaultHeaders,C=t.draggable,b=void 0!==C&&C,y=t.editColumns,j=void 0!==y&&y,E=t.editColumnsInitOpen,S=void 0!==E&&E,I=t.height,D=t.hideFooter,M=void 0!==D&&D,H=t.nextIcon,k=void 0===H?e.jsx(i,{className:"st-next-prev-icon"}):H,N=t.onCellChange,L=t.prevIcon,T=void 0===L?e.jsx(l,{className:"st-next-prev-icon"}):L,B=t.rows,O=t.rowsPerPage,A=void 0===O?10:O,W=t.selectableCells,z=void 0!==W&&W,U=t.selectableColumns,F=void 0!==U&&U,V=t.shouldPaginate,X=void 0!==V&&V,q=t.sortDownIcon,Y=void 0===q?e.jsx(u,{className:"st-sort-icon"}):q,K=t.sortUpIcon,_=void 0===K?e.jsx(d,{className:"st-sort-icon"}):K,$=t.theme,Q=void 0===$?"light":$,Z=n.useState((function(){return function(e){var n=new Set,r=function(e){var t;e.rowMeta.isExpanded&&n.add(e.rowMeta.rowId.toString()),null===(t=e.rowMeta.children)||void 0===t||t.forEach(r)};return e.forEach(r),n}(B)})),ee=Z[0],ne=Z[1],re=n.useMemo((function(){return B.map((function(e,n){return r(r({},e),{originalRowIndex:n})}))}),[B]),te=n.useRef(null),oe=n.useRef(x),ae=n.useRef(null),se=n.useRef(null),le=n.useRef(null),ie=n.useRef(null),ce=n.useRef(null),de=n.useRef(null),ue=n.useState(!1),fe=ue[0],he=ue[1],ve=n.useState(1),ge=ve[0],me=ve[1],pe=n.useState(0),we=pe[0],Re=pe[1],xe=n.useState(0),Ce=xe[0],be=xe[1],ye=function(e,r){var t=n.useState(null),o=t[0],a=t[1],s=n.useState({}),l=s[0],i=s[1],c=n.useMemo((function(){return o?P(r,e,o).sortedData:e}),[e,o,r]);return{sort:o,setSort:a,updateSort:function(e,n){var t=r.find((function(e){return e.accessor===n}));t&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:t,direction:"descending"}:null:{key:t,direction:"ascending"}}))},sortedRows:c,hiddenColumns:l,setHiddenColumns:i}}(re,oe.current),je=ye.sort,Ee=ye.sortedRows,Se=ye.hiddenColumns,Ie=ye.setHiddenColumns,De=ye.updateSort,Me=n.useCallback((function(e){var n=String(e);ne((function(e){var r=new Set(e);return r.has(n)?r.delete(n):r.add(n),r}))}),[]),He=n.useCallback((function(e){return ee.has(String(e))}),[ee]),ke=n.useReducer((function(e){return e+1}),0)[1],Ne=function(e){var r=e.selectableCells,t=e.headers,o=e.rows,a=n.useState(new Set),s=a[0],l=a[1],i=n.useRef(!1),c=n.useRef(null),d=n.useCallback((function(){var e=Array.from(s).reduce((function(e,n){var r=n.split("-").map(Number),a=r[0],s=r[1];return e[a]||(e[a]=[]),e[a][s]=o[a][t[s].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");navigator.clipboard.writeText(n)}),[s,o,t]);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 s.has("".concat(e,"-").concat(n))}),[s]),f=n.useCallback((function(e,n){var r=[];return u(e-1,n)||r.push("st-selected-top-border"),u(e+1,n)||r.push("st-selected-bottom-border"),u(e,n-1)||r.push("st-selected-left-border"),u(e,n+1)||r.push("st-selected-right-border"),r.join(" ")}),[u]),h=n.useMemo((function(){var e=Math.min.apply(Math,Array.from(s).map((function(e){return parseInt(e.split("-")[0])}))),n=Math.min.apply(Math,Array.from(s).map((function(e){return parseInt(e.split("-")[1])})));return function(r,t){return r===e&&t===n}}),[s]);return{selectedCells:s,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex;r&&(i.current=!0,c.current={row:t,col:n},l(new Set(["".concat(t,"-").concat(n)])))},handleMouseOver:function(e,n){if(r&&i.current&&c.current){for(var t=new Set,o=Math.min(c.current.row,e),a=Math.max(c.current.row,e),s=Math.min(c.current.col,n),d=Math.max(c.current.col,n),u=o;u<=a;u++)for(var f=s;f<=d;f++)t.add("".concat(u,"-").concat(f));l(t)}},handleMouseUp:function(){i.current=!1,c.current=null},isSelected:u,getBorderClass:f,isTopLeftCell:h,setSelectedCells:l}}({selectableCells:z,headers:oe.current,rows:Ee}),Le=Ne.handleMouseDown,Te=Ne.handleMouseOver,Be=Ne.handleMouseUp,Oe=Ne.isSelected,Ae=Ne.getBorderClass,Pe=Ne.isTopLeftCell,We=Ne.setSelectedCells,ze=n.useMemo((function(){return X?Ee.slice((ge-1)*A,ge*A):Ee}),[ge,A,X,Ee]),Ue=n.useCallback((function(e,n){De(e,n)}),[De]),Fe=n.useCallback((function(e){oe.current=e,ke()}),[]);return n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||F&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||We(new Set)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[F,We]),n.useLayoutEffect((function(){if(de.current){var e=de.current.offsetWidth-de.current.clientWidth,n=de.current.clientWidth;Re(e),be(n)}}),[]),e.jsx(c.Provider,r({value:{rows:B,tableRows:re}},{children:e.jsxs("div",r({className:"simple-table-root st-wrapper theme-".concat(Q),style:I?{height:I}:{}},{children:[e.jsxs("div",r({className:"st-table-wrapper-container"},{children:[e.jsxs("div",r({className:"st-table-wrapper",onMouseUp:Be,onMouseLeave:Be},{children:[e.jsx(G,{allowAnimations:f,columnResizing:R,currentRows:ze,draggable:b,draggedHeaderRef:te,editColumns:j,forceUpdate:ke,getBorderClass:Ae,handleMouseDown:Le,handleMouseOver:Te,headers:oe.current,headersRef:oe,hiddenColumns:Se,hoveredHeaderRef:ae,isRowExpanded:He,isSelected:Oe,isTopLeftCell:Pe,isWidthDragging:fe,mainBodyRef:se,onCellChange:N,onExpandRowClick:Me,onSort:Ue,onTableHeaderDragEnd:Fe,pinnedLeftRef:le,pinnedRightRef:ie,scrollbarHorizontalRef:ce,scrollbarWidth:we,selectableColumns:F,setIsWidthDragging:he,setSelectedCells:We,shouldPaginate:X,sort:je,sortDownIcon:Y,sortUpIcon:_,tableBodyContainerRef:de}),e.jsx(v,{columnEditorText:p,editColumns:j,editColumnsInitOpen:S,headers:oe.current,hiddenColumns:Se,position:g,setHiddenColumns:Ie})]})),e.jsx(J,{headersRef:oe,mainBodyRef:se,pinnedLeftRef:le,pinnedRightRef:ie,scrollbarHorizontalRef:ce,tableContentWidth:Ce})]})),e.jsx(s,{currentPage:ge,hideFooter:M,nextIcon:k,onPageChange:me,prevIcon:T,rowsPerPage:A,shouldPaginate:X,totalRows:Ee.length})]}))}))};X.defaultProps={allowAnimations:!1,columnEditorPosition:a.Right,columnEditorText:"Columns",columnResizing:!1,defaultHeaders:[],draggable:!1,editColumns:!1,editColumnsInitOpen:!1,height:"",hideFooter:!1,nextIcon:e.jsx(i,{className:"st-next-prev-icon"}),onCellChange:function(){},prevIcon:e.jsx(l,{className:"st-next-prev-icon"}),rows:[],rowsPerPage:10,selectableCells:!1,selectableColumns:!1,shouldPaginate:!1,sortDownIcon:e.jsx(u,{className:"st-sort-icon"}),sortUpIcon:e.jsx(d,{className:"st-sort-icon"}),theme:"light"};var q=n.memo(X);exports.SimpleTable=q;
|
|
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");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;
|
|
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:3px;--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-container.st-header-scroll-padding:after,.st-horizontal-scrollbar-container>div,.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}.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{-ms-overflow-style:none;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:40px;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-container>div{align-items:center;display:flex;height:100%}.st-horizontal-scrollbar-container.st-header-scroll-padding:after{content:"";display:block;flex-shrink:0;width:var(--st-after-width,default-width)}.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{height:12px;overflow:scroll}.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}.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)}
|
|
@@ -3,7 +3,11 @@ import Row from "./Row";
|
|
|
3
3
|
type HeaderObject = {
|
|
4
4
|
accessor: string;
|
|
5
5
|
align?: "left" | "center" | "right";
|
|
6
|
-
cellRenderer?: (row:
|
|
6
|
+
cellRenderer?: ({ accessor, colIndex, row }: {
|
|
7
|
+
accessor: string;
|
|
8
|
+
colIndex: number;
|
|
9
|
+
row: Row;
|
|
10
|
+
}) => ReactNode | string;
|
|
7
11
|
expandable?: boolean;
|
|
8
12
|
hide?: boolean;
|
|
9
13
|
isEditable?: boolean;
|
|
@@ -2,6 +2,7 @@ import { RefObject } from "react";
|
|
|
2
2
|
import HeaderObject from "./HeaderObject";
|
|
3
3
|
interface SharedTableProps {
|
|
4
4
|
allowAnimations: boolean;
|
|
5
|
+
centerHeaderRef: RefObject<HTMLDivElement | null>;
|
|
5
6
|
draggedHeaderRef: RefObject<HeaderObject | null>;
|
|
6
7
|
headerContainerRef: RefObject<HTMLDivElement | null>;
|
|
7
8
|
headersRef: RefObject<HeaderObject[]>;
|
|
@@ -12,8 +13,10 @@ interface SharedTableProps {
|
|
|
12
13
|
mainTemplateColumns: string;
|
|
13
14
|
onTableHeaderDragEnd: (newHeaders: HeaderObject[]) => void;
|
|
14
15
|
pinnedLeftColumns: HeaderObject[];
|
|
16
|
+
pinnedLeftHeaderRef: RefObject<HTMLDivElement | null>;
|
|
15
17
|
pinnedLeftTemplateColumns: string;
|
|
16
18
|
pinnedRightColumns: HeaderObject[];
|
|
19
|
+
pinnedRightHeaderRef: RefObject<HTMLDivElement | null>;
|
|
17
20
|
pinnedRightTemplateColumns: string;
|
|
18
21
|
shouldDisplayLastColumnCell: boolean;
|
|
19
22
|
tableBodyContainerRef: RefObject<HTMLDivElement | null>;
|
|
@@ -10,14 +10,11 @@ interface TableBodyProps extends SharedTableProps {
|
|
|
10
10
|
handleMouseDown: (props: MouseDownProps) => void;
|
|
11
11
|
handleMouseOver: (rowIndex: number, columnIndex: number) => void;
|
|
12
12
|
headers: HeaderObject[];
|
|
13
|
-
isRowExpanded: (rowId: string | number) => boolean;
|
|
14
13
|
isSelected: (rowIndex: number, columnIndex: number) => boolean;
|
|
15
14
|
isTopLeftCell: (rowIndex: number, columnIndex: number) => boolean;
|
|
16
|
-
|
|
17
|
-
onExpandRowClick: (rowIndex: number) => void;
|
|
15
|
+
onCellEdit?: (props: CellChangeProps) => void;
|
|
18
16
|
pinnedLeftRef: RefObject<HTMLDivElement | null>;
|
|
19
17
|
pinnedRightRef: RefObject<HTMLDivElement | null>;
|
|
20
|
-
scrollbarHorizontalRef: RefObject<HTMLDivElement | null>;
|
|
21
18
|
scrollbarWidth: number;
|
|
22
19
|
shouldPaginate: boolean;
|
|
23
20
|
}
|
|
@@ -13,10 +13,9 @@ export interface TableCellProps {
|
|
|
13
13
|
header: HeaderObject;
|
|
14
14
|
headersRef: RefObject<HeaderObject[]>;
|
|
15
15
|
hoveredHeaderRef: RefObject<HeaderObject | null>;
|
|
16
|
-
isRowExpanded: (rowId: string | number) => boolean;
|
|
17
16
|
isSelected: boolean;
|
|
18
17
|
isTopLeftCell: boolean;
|
|
19
|
-
|
|
18
|
+
onCellEdit?: (props: CellChangeProps) => void;
|
|
20
19
|
onExpandRowClick: (rowIndex: number) => void;
|
|
21
20
|
onMouseDown: (rowIndex: number, colIndex: number) => void;
|
|
22
21
|
onMouseOver: (rowIndex: number, colIndex: number) => void;
|
|
@@ -8,7 +8,7 @@ import OnSortProps from "./OnSortProps";
|
|
|
8
8
|
interface TableHeaderProps extends SharedTableProps {
|
|
9
9
|
columnResizing: boolean;
|
|
10
10
|
currentRows: Row[];
|
|
11
|
-
|
|
11
|
+
columnReordering: boolean;
|
|
12
12
|
forceUpdate: () => void;
|
|
13
13
|
onSort: OnSortProps;
|
|
14
14
|
selectableColumns: boolean;
|
|
@@ -19,7 +19,7 @@ type TableRowProps = {
|
|
|
19
19
|
isSelected: (rowIndex: number, columnIndex: number) => boolean;
|
|
20
20
|
isTopLeftCell: (rowIndex: number, columnIndex: number) => boolean;
|
|
21
21
|
isWidthDragging: boolean;
|
|
22
|
-
|
|
22
|
+
onCellEdit?: (props: CellChangeProps) => void;
|
|
23
23
|
onTableHeaderDragEnd: (newHeaders: HeaderObject[]) => void;
|
|
24
24
|
onToggleGroup: (rowId: number) => void;
|
|
25
25
|
row: Row;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Row from "../types/Row";
|
|
2
|
+
import VisibleRow from "../types/VisibleRow";
|
|
3
|
+
export declare const getTotalRowCount: (rows: Row[]) => number;
|
|
4
|
+
declare const getVisibleRows: ({ bufferRowCount, containerHeight, rowHeight, rows, scrollTop, }: {
|
|
5
|
+
bufferRowCount: number;
|
|
6
|
+
containerHeight: number;
|
|
7
|
+
rowHeight: number;
|
|
8
|
+
rows: Row[];
|
|
9
|
+
scrollTop: number;
|
|
10
|
+
}) => VisibleRow[];
|
|
11
|
+
export default getVisibleRows;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|