schummar-table 0.7.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +441 -387
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mui4Theme.js +5 -5
- package/dist/cjs/mui4Theme.js.map +1 -1
- package/dist/cjs/mui5Theme.js +6 -6
- package/dist/cjs/mui5Theme.js.map +1 -1
- package/dist/cjs/tableTheme.js +20 -7
- package/dist/cjs/tableTheme.js.map +1 -1
- package/dist/es/index.js +442 -388
- package/dist/es/index.js.map +1 -1
- package/dist/es/mui4Theme.js +5 -5
- package/dist/es/mui4Theme.js.map +1 -1
- package/dist/es/mui5Theme.js +6 -6
- package/dist/es/mui5Theme.js.map +1 -1
- package/dist/es/tableTheme.js +20 -7
- package/dist/es/tableTheme.js.map +1 -1
- package/dist/types/components/columnFooter.d.ts +1 -0
- package/dist/types/components/columnHeader.d.ts +1 -2
- package/dist/types/components/virtualized.d.ts +2 -1
- package/dist/types/theme/defaultTheme/defaultClasses.d.ts +3 -0
- package/dist/types/types.d.ts +12 -3
- package/package.json +11 -11
package/dist/es/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { createContext, useContext, useMemo, useState, useEffect,
|
|
32
|
+
import { createContext, useContext, useMemo, useState, useEffect, useCallback, useRef, memo, useLayoutEffect, cloneElement, Fragment as Fragment$1 } from "react";
|
|
33
33
|
import { Store, StoreScope } from "schummar-state/react";
|
|
34
34
|
import { d as defaultClasses, a as darkGray, l as lightGray, P as Popover, T as TableThemeContext, m as mergeThemes, g as globalTableTheme, b as PopoverContext, c as gray } from "./tableTheme.js";
|
|
35
35
|
export { T as TableThemeContext, f as TableThemeProvider, e as configureTableTheme, m as mergeThemes } from "./tableTheme.js";
|
|
@@ -42,7 +42,7 @@ const TableMemoContext = createContext(/* @__PURE__ */ new Map());
|
|
|
42
42
|
function TableMemoContextProvider({
|
|
43
43
|
children
|
|
44
44
|
}) {
|
|
45
|
-
return jsx(TableMemoContext.Provider, {
|
|
45
|
+
return /* @__PURE__ */ jsx(TableMemoContext.Provider, {
|
|
46
46
|
value: useMemo(() => /* @__PURE__ */ new Map(), []),
|
|
47
47
|
children
|
|
48
48
|
});
|
|
@@ -399,7 +399,7 @@ const noopParentId = () => void 0;
|
|
|
399
399
|
function calcProps(props) {
|
|
400
400
|
const cache = useTableMemo();
|
|
401
401
|
return useMemo(() => {
|
|
402
|
-
var
|
|
402
|
+
var _f, _g, _h, _i, _j, _k, _l;
|
|
403
403
|
let id;
|
|
404
404
|
if (props.id instanceof Function || Array.isArray(props.id)) {
|
|
405
405
|
id = cache("id", props.id);
|
|
@@ -424,10 +424,11 @@ function calcProps(props) {
|
|
|
424
424
|
const mapColumn = ({
|
|
425
425
|
id: _id,
|
|
426
426
|
header = ((_a) => (_a = defCol == null ? void 0 : defCol.header) != null ? _a : null)(),
|
|
427
|
+
footer = ((_b) => (_b = defCol == null ? void 0 : defCol.footer) != null ? _b : null)(),
|
|
427
428
|
value,
|
|
428
|
-
renderCell = ((
|
|
429
|
-
exportCell = ((
|
|
430
|
-
sortBy = ((
|
|
429
|
+
renderCell = ((_c) => (_c = defCol == null ? void 0 : defCol.renderCell) != null ? _c : asString)(),
|
|
430
|
+
exportCell = ((_d) => (_d = defCol == null ? void 0 : defCol.exportCell) != null ? _d : asString)(),
|
|
431
|
+
sortBy = ((_e) => (_e = defCol == null ? void 0 : defCol.sortBy) != null ? _e : [(v) => typeof v === "number" || v instanceof Date ? v : String(v)])(),
|
|
431
432
|
cannotHide = defCol == null ? void 0 : defCol.cannotHide,
|
|
432
433
|
classes = defCol == null ? void 0 : defCol.classes,
|
|
433
434
|
filter = defCol == null ? void 0 : defCol.filter,
|
|
@@ -437,7 +438,8 @@ function calcProps(props) {
|
|
|
437
438
|
const cacheKey = typeof id2 === "string" ? `s${id2}` : `n${id2}`;
|
|
438
439
|
return {
|
|
439
440
|
id: id2,
|
|
440
|
-
header,
|
|
441
|
+
header: header instanceof Function ? cache(`columns.${cacheKey}.header`, header) : header,
|
|
442
|
+
footer: footer instanceof Function ? cache(`columns.${cacheKey}.footer`, footer) : footer,
|
|
441
443
|
value: cache(`columns.${cacheKey}.value`, value),
|
|
442
444
|
renderCell: cache(`columns.${cacheKey}.renderCell`, renderCell),
|
|
443
445
|
exportCell,
|
|
@@ -470,13 +472,14 @@ function calcProps(props) {
|
|
|
470
472
|
columns,
|
|
471
473
|
wrapCell,
|
|
472
474
|
rowAction,
|
|
473
|
-
enableSelection: (
|
|
474
|
-
selectSyncChildren: (
|
|
475
|
-
stickyHeader: (
|
|
475
|
+
enableSelection: (_f = props.enableSelection) != null ? _f : true,
|
|
476
|
+
selectSyncChildren: (_g = props.selectSyncChildren) != null ? _g : true,
|
|
477
|
+
stickyHeader: (_h = props.stickyHeader) != null ? _h : true,
|
|
478
|
+
stickyFooter: (_i = props.stickyFooter) != null ? _i : true,
|
|
476
479
|
enableExport,
|
|
477
|
-
enableColumnSelection: (
|
|
478
|
-
enableColumnResize: (
|
|
479
|
-
enableColumnReorder: (
|
|
480
|
+
enableColumnSelection: (_j = props.enableColumnSelection) != null ? _j : true,
|
|
481
|
+
enableColumnResize: (_k = props.enableColumnResize) != null ? _k : true,
|
|
482
|
+
enableColumnReorder: (_l = props.enableColumnReorder) != null ? _l : true
|
|
480
483
|
});
|
|
481
484
|
}, [props]);
|
|
482
485
|
}
|
|
@@ -616,14 +619,259 @@ function useCssVariables() {
|
|
|
616
619
|
"--secondaryContrastText": colors.secondary.contrastText
|
|
617
620
|
}));
|
|
618
621
|
}
|
|
622
|
+
function ColumnFooter() {
|
|
623
|
+
const table = useTableContext();
|
|
624
|
+
const columnId = useColumnContext();
|
|
625
|
+
const stickyFooter = table.useState("props.stickyFooter");
|
|
626
|
+
const columnStyleOverride = table.useState((state) => state.columnStyleOverride.get(columnId), {
|
|
627
|
+
throttle: 16
|
|
628
|
+
});
|
|
629
|
+
const columnClasses = table.useState((state) => {
|
|
630
|
+
var _a;
|
|
631
|
+
return (_a = state.activeColumns.find((column) => column.id === columnId)) == null ? void 0 : _a.classes;
|
|
632
|
+
});
|
|
633
|
+
const classes = useTheme((theme) => theme.classes);
|
|
634
|
+
const content = table.useState((state) => {
|
|
635
|
+
const column = state.activeColumns.find((column2) => column2.id === columnId);
|
|
636
|
+
if ((column == null ? void 0 : column.footer) instanceof Function) {
|
|
637
|
+
const items = state.activeItems;
|
|
638
|
+
const values = items.map((item) => column == null ? void 0 : column.value(item.value));
|
|
639
|
+
return column == null ? void 0 : column.footer(values, items);
|
|
640
|
+
}
|
|
641
|
+
return column == null ? void 0 : column.footer;
|
|
642
|
+
});
|
|
643
|
+
return /* @__PURE__ */ jsx("div", {
|
|
644
|
+
className: cx(classes == null ? void 0 : classes.footerCell, columnClasses == null ? void 0 : columnClasses.footerCell),
|
|
645
|
+
css: [defaultClasses.footerCell, columnStyleOverride, stickyFooter && defaultClasses.stickyBottom, stickyFooter instanceof Object && stickyFooter],
|
|
646
|
+
children: content
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
const FilterControlContext = createContext(() => void 0);
|
|
650
|
+
function FilterControl() {
|
|
651
|
+
const table = useTableContext();
|
|
652
|
+
const columnId = useColumnContext();
|
|
653
|
+
const IconButton2 = useTheme((t) => t.components.IconButton);
|
|
654
|
+
const Popover2 = useTheme((t) => t.components.Popover);
|
|
655
|
+
const FilterList2 = useTheme((t) => t.icons.FilterList);
|
|
656
|
+
const ArrowDropDown2 = useTheme((t) => t.icons.ArrowDropDown);
|
|
657
|
+
const cssVariables = useCssVariables();
|
|
658
|
+
const [anchor, setAnchor] = useState(null);
|
|
659
|
+
const isActive = table.useState((state) => {
|
|
660
|
+
const filter2 = state.filters.get(columnId);
|
|
661
|
+
const filterValue = state.filterValues.get(columnId);
|
|
662
|
+
return filter2 !== void 0 && filterValue !== void 0 && filter2.isActive(filterValue);
|
|
663
|
+
});
|
|
664
|
+
const filter = table.useState((state) => {
|
|
665
|
+
var _a;
|
|
666
|
+
return (_a = state.activeColumns.find((column) => column.id === columnId)) == null ? void 0 : _a.filter;
|
|
667
|
+
});
|
|
668
|
+
function reset() {
|
|
669
|
+
table.update((state) => {
|
|
670
|
+
state.filterValues.delete(columnId);
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
const close = useCallback(function() {
|
|
674
|
+
setAnchor(null);
|
|
675
|
+
}, []);
|
|
676
|
+
if (!filter)
|
|
677
|
+
return null;
|
|
678
|
+
return /* @__PURE__ */ jsxs(FilterControlContext.Provider, {
|
|
679
|
+
value: close,
|
|
680
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
681
|
+
onClick: (e2) => setAnchor(e2.currentTarget),
|
|
682
|
+
onContextMenu: (e2) => {
|
|
683
|
+
reset();
|
|
684
|
+
e2.preventDefault();
|
|
685
|
+
return false;
|
|
686
|
+
},
|
|
687
|
+
children: /* @__PURE__ */ jsx(IconButton2, {
|
|
688
|
+
css: [{
|
|
689
|
+
color: "#b0bac9"
|
|
690
|
+
}, isActive && {
|
|
691
|
+
color: "var(--primaryMain) !important"
|
|
692
|
+
}],
|
|
693
|
+
children: isActive ? /* @__PURE__ */ jsx(FilterList2, {}) : /* @__PURE__ */ jsx(ArrowDropDown2, {})
|
|
694
|
+
})
|
|
695
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
696
|
+
onPointerDown: (e2) => {
|
|
697
|
+
e2.stopPropagation();
|
|
698
|
+
},
|
|
699
|
+
onPointerMove: (e2) => {
|
|
700
|
+
e2.stopPropagation();
|
|
701
|
+
},
|
|
702
|
+
children: /* @__PURE__ */ jsx(Popover2, {
|
|
703
|
+
open: true,
|
|
704
|
+
hidden: !anchor,
|
|
705
|
+
onClose: () => setAnchor(null),
|
|
706
|
+
anchorEl: anchor != null ? anchor : document.body,
|
|
707
|
+
css: cssVariables,
|
|
708
|
+
children: filter
|
|
709
|
+
})
|
|
710
|
+
})]
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
function ResizeHandle() {
|
|
714
|
+
const table = useTableContext();
|
|
715
|
+
const columnId = useColumnContext();
|
|
716
|
+
const enabled = table.useState("props.enableColumnResize");
|
|
717
|
+
function onPointerDown(e2) {
|
|
718
|
+
e2.stopPropagation();
|
|
719
|
+
const div = e2.target;
|
|
720
|
+
div.setPointerCapture(e2.pointerId);
|
|
721
|
+
}
|
|
722
|
+
function onPointerMove(e2) {
|
|
723
|
+
e2.stopPropagation();
|
|
724
|
+
const div = e2.target;
|
|
725
|
+
if (!div.hasPointerCapture(e2.pointerId))
|
|
726
|
+
return;
|
|
727
|
+
const parent = div.parentElement;
|
|
728
|
+
const width = Math.max(e2.clientX - parent.getBoundingClientRect().left + 5, 50);
|
|
729
|
+
table.update((state) => {
|
|
730
|
+
state.columnWidths.set(columnId, `${width}px`);
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
function onPointerUp(e2) {
|
|
734
|
+
e2.stopPropagation();
|
|
735
|
+
const div = e2.target;
|
|
736
|
+
div.releasePointerCapture(e2.pointerId);
|
|
737
|
+
}
|
|
738
|
+
function onDoubleClick(e2) {
|
|
739
|
+
table.update((state) => {
|
|
740
|
+
if (e2.getModifierState("Control")) {
|
|
741
|
+
state.columnWidths.delete(columnId);
|
|
742
|
+
} else {
|
|
743
|
+
state.columnWidths.set(columnId, "max-content");
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
return /* @__PURE__ */ jsx(ResizeHandleView, {
|
|
748
|
+
enabled,
|
|
749
|
+
onPointerDown: enabled ? onPointerDown : void 0,
|
|
750
|
+
onPointerMove: enabled ? onPointerMove : void 0,
|
|
751
|
+
onPointerUp: enabled ? onPointerUp : void 0,
|
|
752
|
+
onDoubleClick: enabled ? onDoubleClick : void 0
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
function ResizeHandleView(_a) {
|
|
756
|
+
var _b = _a, {
|
|
757
|
+
enabled
|
|
758
|
+
} = _b, props = __objRest(_b, [
|
|
759
|
+
"enabled"
|
|
760
|
+
]);
|
|
761
|
+
return /* @__PURE__ */ jsx("div", __spreadValues({
|
|
762
|
+
css: {
|
|
763
|
+
alignSelf: "stretch",
|
|
764
|
+
padding: "0 5px",
|
|
765
|
+
cursor: enabled ? "col-resize" : "initial",
|
|
766
|
+
display: "flex",
|
|
767
|
+
alignItems: "center",
|
|
768
|
+
"&:after": {
|
|
769
|
+
content: '""',
|
|
770
|
+
width: 1,
|
|
771
|
+
height: "1.5em",
|
|
772
|
+
background: "#c9cfda",
|
|
773
|
+
transition: "transform 300ms"
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}, props));
|
|
777
|
+
}
|
|
778
|
+
function SortComponent({
|
|
779
|
+
children
|
|
780
|
+
}) {
|
|
781
|
+
const table = useTableContext();
|
|
782
|
+
const columnId = useColumnContext();
|
|
783
|
+
const Badge2 = useTheme((t) => t.components.Badge);
|
|
784
|
+
const ArrowUpward2 = useTheme((t) => t.icons.ArrowUpward);
|
|
785
|
+
const {
|
|
786
|
+
direction,
|
|
787
|
+
index
|
|
788
|
+
} = table.useState((state) => {
|
|
789
|
+
var _a, _b;
|
|
790
|
+
const index2 = (_a = state.sort.findIndex((s) => s.columnId === columnId)) != null ? _a : -1;
|
|
791
|
+
return {
|
|
792
|
+
direction: (_b = state.sort[index2]) == null ? void 0 : _b.direction,
|
|
793
|
+
index: index2 >= 0 && state.sort.length > 1 ? index2 + 1 : void 0
|
|
794
|
+
};
|
|
795
|
+
});
|
|
796
|
+
function toggle2(e2, off) {
|
|
797
|
+
const {
|
|
798
|
+
props: {
|
|
799
|
+
sort: controlledSort,
|
|
800
|
+
onSortChange
|
|
801
|
+
}
|
|
802
|
+
} = table.getState();
|
|
803
|
+
const newDirection = direction === "asc" ? "desc" : "asc";
|
|
804
|
+
const newSort = e2.getModifierState("Control") || off ? table.getState().sort.filter((s) => s.columnId !== columnId) : [];
|
|
805
|
+
if (!off) {
|
|
806
|
+
newSort.push({
|
|
807
|
+
columnId,
|
|
808
|
+
direction: newDirection
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
onSortChange == null ? void 0 : onSortChange(newSort);
|
|
812
|
+
if (!controlledSort) {
|
|
813
|
+
table.update((state) => {
|
|
814
|
+
state.sort = newSort;
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
e2.preventDefault();
|
|
818
|
+
return false;
|
|
819
|
+
}
|
|
820
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
821
|
+
css: {
|
|
822
|
+
userSelect: "none",
|
|
823
|
+
display: "grid",
|
|
824
|
+
gridTemplateColumns: "minmax(0, 1fr) max-content",
|
|
825
|
+
alignItems: "center",
|
|
826
|
+
cursor: "pointer",
|
|
827
|
+
"& > div": {
|
|
828
|
+
overflow: "hidden",
|
|
829
|
+
textOverflow: "ellipsis"
|
|
830
|
+
}
|
|
831
|
+
},
|
|
832
|
+
onClick: (e2) => toggle2(e2),
|
|
833
|
+
onContextMenu: (e2) => toggle2(e2, true),
|
|
834
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
835
|
+
children
|
|
836
|
+
}), /* @__PURE__ */ jsx(Badge2, {
|
|
837
|
+
badgeContent: index,
|
|
838
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
839
|
+
css: [{
|
|
840
|
+
transition: "all 300ms",
|
|
841
|
+
fontSize: "0.8em"
|
|
842
|
+
}, !direction && {
|
|
843
|
+
opacity: 0
|
|
844
|
+
}, direction === "desc" && {
|
|
845
|
+
transform: "rotate3d(0, 0, 1, 180deg)"
|
|
846
|
+
}],
|
|
847
|
+
children: /* @__PURE__ */ jsx(ArrowUpward2, {})
|
|
848
|
+
})
|
|
849
|
+
})]
|
|
850
|
+
});
|
|
851
|
+
}
|
|
619
852
|
const ColumnHeaderContext = new StoreScope({
|
|
620
853
|
items: /* @__PURE__ */ new Map()
|
|
621
854
|
});
|
|
622
|
-
function ColumnHeader(
|
|
855
|
+
function ColumnHeader() {
|
|
623
856
|
const ref = useRef(null);
|
|
624
857
|
const columnId = useColumnContext();
|
|
625
858
|
const table = useTableContext();
|
|
626
859
|
const enabled = table.useState("props.enableColumnReorder");
|
|
860
|
+
const columnStyleOverride = table.useState((state) => state.columnStyleOverride.get(columnId), {
|
|
861
|
+
throttle: 16
|
|
862
|
+
});
|
|
863
|
+
const stickyHeader = table.useState("props.stickyHeader");
|
|
864
|
+
const classes = useTheme((theme) => theme.classes);
|
|
865
|
+
const {
|
|
866
|
+
header,
|
|
867
|
+
columnClasses
|
|
868
|
+
} = table.useState((state) => {
|
|
869
|
+
const column = state.activeColumns.find((column2) => column2.id === columnId);
|
|
870
|
+
return {
|
|
871
|
+
header: column == null ? void 0 : column.header,
|
|
872
|
+
columnClasses: column == null ? void 0 : column.classes
|
|
873
|
+
};
|
|
874
|
+
});
|
|
627
875
|
const store = ColumnHeaderContext.useStore();
|
|
628
876
|
const draggingStart = useRef();
|
|
629
877
|
const clone = useRef();
|
|
@@ -742,24 +990,31 @@ function ColumnHeader(props) {
|
|
|
742
990
|
clone.current = void 0;
|
|
743
991
|
});
|
|
744
992
|
}
|
|
745
|
-
return
|
|
746
|
-
|
|
993
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
994
|
+
ref,
|
|
995
|
+
className: cx(classes == null ? void 0 : classes.headerCell, columnClasses == null ? void 0 : columnClasses.headerCell),
|
|
996
|
+
css: [{
|
|
747
997
|
position: "relative",
|
|
748
998
|
userSelect: "none"
|
|
749
|
-
},
|
|
750
|
-
ref,
|
|
999
|
+
}, defaultClasses.headerCell, columnStyleOverride, stickyHeader && defaultClasses.sticky, stickyHeader instanceof Object && stickyHeader],
|
|
751
1000
|
onPointerDown: enabled ? onPointerDown : void 0,
|
|
752
1001
|
onPointerMove: enabled ? onPointerMove : void 0,
|
|
753
1002
|
onPointerUp: enabled ? onPointerUp : void 0,
|
|
754
|
-
children:
|
|
755
|
-
|
|
1003
|
+
children: [/* @__PURE__ */ jsx(SortComponent, {
|
|
1004
|
+
children: header
|
|
1005
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1006
|
+
css: {
|
|
1007
|
+
flex: 1
|
|
1008
|
+
}
|
|
1009
|
+
}), /* @__PURE__ */ jsx(FilterControl, {}), /* @__PURE__ */ jsx(ResizeHandle, {})]
|
|
1010
|
+
});
|
|
756
1011
|
}
|
|
757
1012
|
function FormControlLabel({
|
|
758
1013
|
control,
|
|
759
1014
|
label,
|
|
760
1015
|
disabled
|
|
761
1016
|
}) {
|
|
762
|
-
return jsxs("label", {
|
|
1017
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
763
1018
|
css: [{
|
|
764
1019
|
display: "flex",
|
|
765
1020
|
alignItems: "center",
|
|
@@ -771,7 +1026,7 @@ function FormControlLabel({
|
|
|
771
1026
|
}, disabled && {
|
|
772
1027
|
color: "rgba(0, 0, 0, 0.26)"
|
|
773
1028
|
}],
|
|
774
|
-
children: [control, jsx("span", {
|
|
1029
|
+
children: [control, /* @__PURE__ */ jsx("span", {
|
|
775
1030
|
css: {
|
|
776
1031
|
marginLeft: "var(--spacing)"
|
|
777
1032
|
},
|
|
@@ -809,27 +1064,27 @@ function ColumnSelection() {
|
|
|
809
1064
|
}
|
|
810
1065
|
onHiddenColumnsChange == null ? void 0 : onHiddenColumnsChange(newValue);
|
|
811
1066
|
};
|
|
812
|
-
return jsxs(Fragment, {
|
|
813
|
-
children: [jsx(IconButton2, {
|
|
1067
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
1068
|
+
children: [/* @__PURE__ */ jsx(IconButton2, {
|
|
814
1069
|
onClick: (e2) => setAnchorEl(anchorEl ? null : e2.currentTarget),
|
|
815
|
-
children: jsx(Settings2, {})
|
|
816
|
-
}), jsx(Popover2, {
|
|
1070
|
+
children: /* @__PURE__ */ jsx(Settings2, {})
|
|
1071
|
+
}), /* @__PURE__ */ jsx(Popover2, {
|
|
817
1072
|
anchorEl,
|
|
818
1073
|
open: !!anchorEl,
|
|
819
1074
|
onClose: () => setAnchorEl(null),
|
|
820
1075
|
css: cssVariables,
|
|
821
|
-
children: jsxs("div", {
|
|
1076
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
822
1077
|
css: {
|
|
823
1078
|
padding: `calc(var(--spacing) * 2)`,
|
|
824
1079
|
display: "grid"
|
|
825
1080
|
},
|
|
826
|
-
children: [jsx("div", {
|
|
1081
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
827
1082
|
css: {
|
|
828
1083
|
marginBottom: "var(--spacing)"
|
|
829
1084
|
},
|
|
830
1085
|
children: selectColumns
|
|
831
|
-
}), columns.map((column) => jsx(FormControlLabel, {
|
|
832
|
-
control: jsx(Checkbox2, {
|
|
1086
|
+
}), columns.map((column) => /* @__PURE__ */ jsx(FormControlLabel, {
|
|
1087
|
+
control: /* @__PURE__ */ jsx(Checkbox2, {
|
|
833
1088
|
checked: !hiddenColumns.has(column.id),
|
|
834
1089
|
onChange: () => toggle2(column),
|
|
835
1090
|
disabled: column.cannotHide
|
|
@@ -883,20 +1138,20 @@ function Export$1() {
|
|
|
883
1138
|
a.click();
|
|
884
1139
|
document.body.removeChild(a);
|
|
885
1140
|
};
|
|
886
|
-
return jsxs(Fragment, {
|
|
887
|
-
children: [jsx(IconButton2, {
|
|
1141
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
1142
|
+
children: [/* @__PURE__ */ jsx(IconButton2, {
|
|
888
1143
|
onClick: (e2) => setAnchor(anchor ? null : e2.currentTarget),
|
|
889
|
-
children: jsx(Export2, {
|
|
1144
|
+
children: /* @__PURE__ */ jsx(Export2, {
|
|
890
1145
|
css: !!anchor && {
|
|
891
1146
|
color: "var(--primaryMain)"
|
|
892
1147
|
}
|
|
893
1148
|
})
|
|
894
|
-
}), jsx(Popover2, {
|
|
1149
|
+
}), /* @__PURE__ */ jsx(Popover2, {
|
|
895
1150
|
open: !!anchor,
|
|
896
1151
|
onClose: () => setAnchor(null),
|
|
897
1152
|
anchorEl: anchor,
|
|
898
1153
|
css: cssVariables,
|
|
899
|
-
children: jsxs("div", {
|
|
1154
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
900
1155
|
css: {
|
|
901
1156
|
padding: `calc(var(--spacing) * 2)`,
|
|
902
1157
|
display: "grid",
|
|
@@ -906,17 +1161,17 @@ function Export$1() {
|
|
|
906
1161
|
justifyContent: "start"
|
|
907
1162
|
}
|
|
908
1163
|
},
|
|
909
|
-
children: [jsx("div", {
|
|
1164
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
910
1165
|
css: {
|
|
911
1166
|
marginBottom: "var(--spacing)"
|
|
912
1167
|
},
|
|
913
1168
|
children: exportTitle
|
|
914
|
-
}), jsx(Button2, {
|
|
915
|
-
startIcon: jsx(Clipboard2, {}),
|
|
1169
|
+
}), /* @__PURE__ */ jsx(Button2, {
|
|
1170
|
+
startIcon: /* @__PURE__ */ jsx(Clipboard2, {}),
|
|
916
1171
|
onClick: copy,
|
|
917
1172
|
children: exportCopy
|
|
918
|
-
}), jsx(Button2, {
|
|
919
|
-
startIcon: jsx(Export2, {}),
|
|
1173
|
+
}), /* @__PURE__ */ jsx(Button2, {
|
|
1174
|
+
startIcon: /* @__PURE__ */ jsx(Export2, {}),
|
|
920
1175
|
onClick: download,
|
|
921
1176
|
children: exportDownload
|
|
922
1177
|
})]
|
|
@@ -924,138 +1179,9 @@ function Export$1() {
|
|
|
924
1179
|
})]
|
|
925
1180
|
});
|
|
926
1181
|
}
|
|
927
|
-
const FilterControlContext = createContext(() => void 0);
|
|
928
|
-
function FilterControl() {
|
|
929
|
-
const table = useTableContext();
|
|
930
|
-
const columnId = useColumnContext();
|
|
931
|
-
const IconButton2 = useTheme((t) => t.components.IconButton);
|
|
932
|
-
const Popover2 = useTheme((t) => t.components.Popover);
|
|
933
|
-
const FilterList2 = useTheme((t) => t.icons.FilterList);
|
|
934
|
-
const ArrowDropDown2 = useTheme((t) => t.icons.ArrowDropDown);
|
|
935
|
-
const cssVariables = useCssVariables();
|
|
936
|
-
const [anchor, setAnchor] = useState(null);
|
|
937
|
-
const isActive = table.useState((state) => {
|
|
938
|
-
const filter2 = state.filters.get(columnId);
|
|
939
|
-
const filterValue = state.filterValues.get(columnId);
|
|
940
|
-
return filter2 !== void 0 && filterValue !== void 0 && filter2.isActive(filterValue);
|
|
941
|
-
});
|
|
942
|
-
const filter = table.useState((state) => {
|
|
943
|
-
var _a;
|
|
944
|
-
return (_a = state.activeColumns.find((column) => column.id === columnId)) == null ? void 0 : _a.filter;
|
|
945
|
-
});
|
|
946
|
-
function reset() {
|
|
947
|
-
table.update((state) => {
|
|
948
|
-
state.filterValues.delete(columnId);
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
const close = useCallback(function() {
|
|
952
|
-
setAnchor(null);
|
|
953
|
-
}, []);
|
|
954
|
-
if (!filter)
|
|
955
|
-
return null;
|
|
956
|
-
return jsxs(FilterControlContext.Provider, {
|
|
957
|
-
value: close,
|
|
958
|
-
children: [jsx("div", {
|
|
959
|
-
onClick: (e2) => setAnchor(e2.currentTarget),
|
|
960
|
-
onContextMenu: (e2) => {
|
|
961
|
-
reset();
|
|
962
|
-
e2.preventDefault();
|
|
963
|
-
return false;
|
|
964
|
-
},
|
|
965
|
-
children: jsx(IconButton2, {
|
|
966
|
-
css: [{
|
|
967
|
-
color: "#b0bac9"
|
|
968
|
-
}, isActive && {
|
|
969
|
-
color: "var(--primaryMain) !important"
|
|
970
|
-
}],
|
|
971
|
-
children: isActive ? jsx(FilterList2, {}) : jsx(ArrowDropDown2, {})
|
|
972
|
-
})
|
|
973
|
-
}), jsx("div", {
|
|
974
|
-
onPointerDown: (e2) => {
|
|
975
|
-
e2.stopPropagation();
|
|
976
|
-
},
|
|
977
|
-
onPointerMove: (e2) => {
|
|
978
|
-
e2.stopPropagation();
|
|
979
|
-
},
|
|
980
|
-
children: jsx(Popover2, {
|
|
981
|
-
open: true,
|
|
982
|
-
hidden: !anchor,
|
|
983
|
-
onClose: () => setAnchor(null),
|
|
984
|
-
anchorEl: anchor != null ? anchor : document.body,
|
|
985
|
-
css: cssVariables,
|
|
986
|
-
children: filter
|
|
987
|
-
})
|
|
988
|
-
})]
|
|
989
|
-
});
|
|
990
|
-
}
|
|
991
|
-
function ResizeHandle() {
|
|
992
|
-
const table = useTableContext();
|
|
993
|
-
const columnId = useColumnContext();
|
|
994
|
-
const enabled = table.useState("props.enableColumnResize");
|
|
995
|
-
function onPointerDown(e2) {
|
|
996
|
-
e2.stopPropagation();
|
|
997
|
-
const div = e2.target;
|
|
998
|
-
div.setPointerCapture(e2.pointerId);
|
|
999
|
-
}
|
|
1000
|
-
function onPointerMove(e2) {
|
|
1001
|
-
e2.stopPropagation();
|
|
1002
|
-
const div = e2.target;
|
|
1003
|
-
if (!div.hasPointerCapture(e2.pointerId))
|
|
1004
|
-
return;
|
|
1005
|
-
const parent = div.parentElement;
|
|
1006
|
-
const width = Math.max(e2.clientX - parent.getBoundingClientRect().left + 5, 50);
|
|
1007
|
-
table.update((state) => {
|
|
1008
|
-
state.columnWidths.set(columnId, `${width}px`);
|
|
1009
|
-
});
|
|
1010
|
-
}
|
|
1011
|
-
function onPointerUp(e2) {
|
|
1012
|
-
e2.stopPropagation();
|
|
1013
|
-
const div = e2.target;
|
|
1014
|
-
div.releasePointerCapture(e2.pointerId);
|
|
1015
|
-
}
|
|
1016
|
-
function onDoubleClick(e2) {
|
|
1017
|
-
table.update((state) => {
|
|
1018
|
-
if (e2.getModifierState("Control")) {
|
|
1019
|
-
state.columnWidths.delete(columnId);
|
|
1020
|
-
} else {
|
|
1021
|
-
state.columnWidths.set(columnId, "max-content");
|
|
1022
|
-
}
|
|
1023
|
-
});
|
|
1024
|
-
}
|
|
1025
|
-
return jsx(ResizeHandleView, {
|
|
1026
|
-
enabled,
|
|
1027
|
-
onPointerDown: enabled ? onPointerDown : void 0,
|
|
1028
|
-
onPointerMove: enabled ? onPointerMove : void 0,
|
|
1029
|
-
onPointerUp: enabled ? onPointerUp : void 0,
|
|
1030
|
-
onDoubleClick: enabled ? onDoubleClick : void 0
|
|
1031
|
-
});
|
|
1032
|
-
}
|
|
1033
|
-
function ResizeHandleView(_a) {
|
|
1034
|
-
var _b = _a, {
|
|
1035
|
-
enabled
|
|
1036
|
-
} = _b, props = __objRest(_b, [
|
|
1037
|
-
"enabled"
|
|
1038
|
-
]);
|
|
1039
|
-
return jsx("div", __spreadValues({
|
|
1040
|
-
css: {
|
|
1041
|
-
alignSelf: "stretch",
|
|
1042
|
-
padding: "0 5px",
|
|
1043
|
-
cursor: enabled ? "col-resize" : "initial",
|
|
1044
|
-
display: "flex",
|
|
1045
|
-
alignItems: "center",
|
|
1046
|
-
"&:after": {
|
|
1047
|
-
content: '""',
|
|
1048
|
-
width: 1,
|
|
1049
|
-
height: "1.5em",
|
|
1050
|
-
background: "#c9cfda",
|
|
1051
|
-
transition: "transform 300ms"
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
}, props));
|
|
1055
|
-
}
|
|
1056
1182
|
const defaultWrapCell = (content) => {
|
|
1057
1183
|
if (typeof content === "string") {
|
|
1058
|
-
return jsx("span", {
|
|
1184
|
+
return /* @__PURE__ */ jsx("span", {
|
|
1059
1185
|
css: defaultClasses.text,
|
|
1060
1186
|
title: content,
|
|
1061
1187
|
children: content
|
|
@@ -1090,7 +1216,7 @@ const Cell = memo(function Cell2({
|
|
|
1090
1216
|
if (!column || !item)
|
|
1091
1217
|
return null;
|
|
1092
1218
|
const content = column.renderCell(column.value(item.value), item.value);
|
|
1093
|
-
return jsx("div", {
|
|
1219
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1094
1220
|
className: className2,
|
|
1095
1221
|
css: [defaultClasses.cell, columnStyleOverride],
|
|
1096
1222
|
children: wrapCell(content, column.value(item.value), item.value, rowIndex)
|
|
@@ -1139,21 +1265,21 @@ function ExpandControl({
|
|
|
1139
1265
|
}
|
|
1140
1266
|
}
|
|
1141
1267
|
if (isExpanded && hasDeferredChildren && !hasChildren) {
|
|
1142
|
-
return jsx(Spinner2, {
|
|
1268
|
+
return /* @__PURE__ */ jsx(Spinner2, {
|
|
1143
1269
|
css: {
|
|
1144
1270
|
margin: "0 var(--spacing)"
|
|
1145
1271
|
}
|
|
1146
1272
|
});
|
|
1147
1273
|
}
|
|
1148
|
-
return jsx(IconButton2, {
|
|
1274
|
+
return /* @__PURE__ */ jsx(IconButton2, {
|
|
1149
1275
|
onClick: toggle2,
|
|
1150
|
-
children: jsx("span", {
|
|
1276
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
1151
1277
|
css: {
|
|
1152
1278
|
display: "inline-flex",
|
|
1153
1279
|
transition: "all 300ms",
|
|
1154
1280
|
transform: isExpanded ? "rotate3d(0, 0, 1, 90deg)" : "rotate3d(0, 0, 1, 0deg)"
|
|
1155
1281
|
},
|
|
1156
|
-
children: jsx(ChevronRight2, {})
|
|
1282
|
+
children: /* @__PURE__ */ jsx(ChevronRight2, {})
|
|
1157
1283
|
})
|
|
1158
1284
|
});
|
|
1159
1285
|
}
|
|
@@ -1213,7 +1339,7 @@ function SelectComponent({
|
|
|
1213
1339
|
state.lastSelectedId = itemId;
|
|
1214
1340
|
});
|
|
1215
1341
|
}
|
|
1216
|
-
return jsx(Checkbox2, {
|
|
1342
|
+
return /* @__PURE__ */ jsx(Checkbox2, {
|
|
1217
1343
|
css: {
|
|
1218
1344
|
justifySelf: "start",
|
|
1219
1345
|
color: "#c9cfda"
|
|
@@ -1271,110 +1397,36 @@ const Row = memo(function Row2({
|
|
|
1271
1397
|
var _a, _b;
|
|
1272
1398
|
return (_b = (_a = table.getState().props).debugRender) == null ? void 0 : _b.call(_a, "render row", itemId);
|
|
1273
1399
|
});
|
|
1274
|
-
return jsxs(Fragment, {
|
|
1275
|
-
children: [jsx("div", {
|
|
1400
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
1401
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1276
1402
|
className: className2,
|
|
1277
1403
|
css: [defaultClasses.cellFill],
|
|
1278
1404
|
ref: divRef
|
|
1279
|
-
}), jsxs("div", {
|
|
1405
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1280
1406
|
className: className2,
|
|
1281
1407
|
css: [defaultClasses.cell, defaultClasses.firstCell],
|
|
1282
|
-
children: [jsx("div", {
|
|
1408
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1283
1409
|
css: {
|
|
1284
1410
|
width: indent * 20
|
|
1285
1411
|
}
|
|
1286
|
-
}), enableSelection && jsx(SelectComponent, {
|
|
1412
|
+
}), enableSelection && /* @__PURE__ */ jsx(SelectComponent, {
|
|
1287
1413
|
itemId
|
|
1288
|
-
}), (hasChildren || hasDeferredChildren) && jsx(ExpandControl, {
|
|
1414
|
+
}), (hasChildren || hasDeferredChildren) && /* @__PURE__ */ jsx(ExpandControl, {
|
|
1289
1415
|
itemId,
|
|
1290
1416
|
hasDeferredChildren
|
|
1291
1417
|
}), rowAction]
|
|
1292
|
-
}), columnIds.map((columnId) => jsx(ColumnContext.Provider, {
|
|
1418
|
+
}), columnIds.map((columnId) => /* @__PURE__ */ jsx(ColumnContext.Provider, {
|
|
1293
1419
|
value: columnId,
|
|
1294
|
-
children: jsx(Cell, {
|
|
1420
|
+
children: /* @__PURE__ */ jsx(Cell, {
|
|
1295
1421
|
itemId,
|
|
1296
1422
|
rowIndex
|
|
1297
1423
|
})
|
|
1298
|
-
}, columnId)), jsx("div", {
|
|
1424
|
+
}, columnId)), /* @__PURE__ */ jsx("div", {
|
|
1299
1425
|
className: className2,
|
|
1300
1426
|
css: [defaultClasses.cellFill]
|
|
1301
1427
|
})]
|
|
1302
1428
|
});
|
|
1303
1429
|
});
|
|
1304
|
-
function SortComponent({
|
|
1305
|
-
children
|
|
1306
|
-
}) {
|
|
1307
|
-
const table = useTableContext();
|
|
1308
|
-
const columnId = useColumnContext();
|
|
1309
|
-
const Badge2 = useTheme((t) => t.components.Badge);
|
|
1310
|
-
const ArrowUpward2 = useTheme((t) => t.icons.ArrowUpward);
|
|
1311
|
-
const {
|
|
1312
|
-
direction,
|
|
1313
|
-
index
|
|
1314
|
-
} = table.useState((state) => {
|
|
1315
|
-
var _a, _b;
|
|
1316
|
-
const index2 = (_a = state.sort.findIndex((s) => s.columnId === columnId)) != null ? _a : -1;
|
|
1317
|
-
return {
|
|
1318
|
-
direction: (_b = state.sort[index2]) == null ? void 0 : _b.direction,
|
|
1319
|
-
index: index2 >= 0 && state.sort.length > 1 ? index2 + 1 : void 0
|
|
1320
|
-
};
|
|
1321
|
-
});
|
|
1322
|
-
function toggle2(e2, off) {
|
|
1323
|
-
const {
|
|
1324
|
-
props: {
|
|
1325
|
-
sort: controlledSort,
|
|
1326
|
-
onSortChange
|
|
1327
|
-
}
|
|
1328
|
-
} = table.getState();
|
|
1329
|
-
const newDirection = direction === "asc" ? "desc" : "asc";
|
|
1330
|
-
const newSort = e2.getModifierState("Control") || off ? table.getState().sort.filter((s) => s.columnId !== columnId) : [];
|
|
1331
|
-
if (!off) {
|
|
1332
|
-
newSort.push({
|
|
1333
|
-
columnId,
|
|
1334
|
-
direction: newDirection
|
|
1335
|
-
});
|
|
1336
|
-
}
|
|
1337
|
-
onSortChange == null ? void 0 : onSortChange(newSort);
|
|
1338
|
-
if (!controlledSort) {
|
|
1339
|
-
table.update((state) => {
|
|
1340
|
-
state.sort = newSort;
|
|
1341
|
-
});
|
|
1342
|
-
}
|
|
1343
|
-
e2.preventDefault();
|
|
1344
|
-
return false;
|
|
1345
|
-
}
|
|
1346
|
-
return jsxs("div", {
|
|
1347
|
-
css: {
|
|
1348
|
-
userSelect: "none",
|
|
1349
|
-
display: "grid",
|
|
1350
|
-
gridTemplateColumns: "minmax(0, 1fr) max-content",
|
|
1351
|
-
alignItems: "center",
|
|
1352
|
-
cursor: "pointer",
|
|
1353
|
-
"& > div": {
|
|
1354
|
-
overflow: "hidden",
|
|
1355
|
-
textOverflow: "ellipsis"
|
|
1356
|
-
}
|
|
1357
|
-
},
|
|
1358
|
-
onClick: (e2) => toggle2(e2),
|
|
1359
|
-
onContextMenu: (e2) => toggle2(e2, true),
|
|
1360
|
-
children: [jsx("div", {
|
|
1361
|
-
children
|
|
1362
|
-
}), jsx(Badge2, {
|
|
1363
|
-
badgeContent: index,
|
|
1364
|
-
children: jsx("span", {
|
|
1365
|
-
css: [{
|
|
1366
|
-
transition: "all 300ms",
|
|
1367
|
-
fontSize: "0.8em"
|
|
1368
|
-
}, !direction && {
|
|
1369
|
-
opacity: 0
|
|
1370
|
-
}, direction === "desc" && {
|
|
1371
|
-
transform: "rotate3d(0, 0, 1, 180deg)"
|
|
1372
|
-
}],
|
|
1373
|
-
children: jsx(ArrowUpward2, {})
|
|
1374
|
-
})
|
|
1375
|
-
})]
|
|
1376
|
-
});
|
|
1377
|
-
}
|
|
1378
1430
|
function throttle(fn, ms) {
|
|
1379
1431
|
let last = 0;
|
|
1380
1432
|
let lastArgs;
|
|
@@ -1427,9 +1479,11 @@ const relativeOffset = (x, y) => {
|
|
|
1427
1479
|
function Virtualized(_c) {
|
|
1428
1480
|
var _d = _c, {
|
|
1429
1481
|
header,
|
|
1482
|
+
footer,
|
|
1430
1483
|
children
|
|
1431
1484
|
} = _d, props = __objRest(_d, [
|
|
1432
1485
|
"header",
|
|
1486
|
+
"footer",
|
|
1433
1487
|
"children"
|
|
1434
1488
|
]);
|
|
1435
1489
|
var _a, _b;
|
|
@@ -1511,19 +1565,19 @@ function Virtualized(_c) {
|
|
|
1511
1565
|
var _a2, _b2;
|
|
1512
1566
|
return (_b2 = (_a2 = table.getState().props).debugRender) == null ? void 0 : _b2.call(_a2, `Virtualalized render ${from} to ${to}`);
|
|
1513
1567
|
});
|
|
1514
|
-
return jsxs("div", __spreadProps(__spreadValues({}, props), {
|
|
1515
|
-
children: [header, virtual && jsx("div", {
|
|
1568
|
+
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, props), {
|
|
1569
|
+
children: [header, virtual && /* @__PURE__ */ jsx("div", {
|
|
1516
1570
|
style: {
|
|
1517
1571
|
gridColumn: "1 / -1",
|
|
1518
1572
|
height: before
|
|
1519
1573
|
},
|
|
1520
1574
|
ref: probeRef
|
|
1521
|
-
}), children(itemIds, from), virtual && jsx("div", {
|
|
1575
|
+
}), children(itemIds, from), virtual && /* @__PURE__ */ jsx("div", {
|
|
1522
1576
|
style: {
|
|
1523
1577
|
gridColumn: "1 / -1",
|
|
1524
1578
|
height: after
|
|
1525
1579
|
}
|
|
1526
|
-
})]
|
|
1580
|
+
}), footer]
|
|
1527
1581
|
}));
|
|
1528
1582
|
}
|
|
1529
1583
|
const TableContext = createContext(null);
|
|
@@ -1546,10 +1600,10 @@ function Table(props) {
|
|
|
1546
1600
|
var _a, _b;
|
|
1547
1601
|
return (_b = (_a = table.getState().props).debugRender) == null ? void 0 : _b.call(_a, "render table");
|
|
1548
1602
|
});
|
|
1549
|
-
return jsx(TableContext.Provider, {
|
|
1603
|
+
return /* @__PURE__ */ jsx(TableContext.Provider, {
|
|
1550
1604
|
value: table,
|
|
1551
|
-
children: jsx(TableMemoContextProvider, {
|
|
1552
|
-
children: jsx(TableLoadingState, {})
|
|
1605
|
+
children: /* @__PURE__ */ jsx(TableMemoContextProvider, {
|
|
1606
|
+
children: /* @__PURE__ */ jsx(TableLoadingState, {})
|
|
1553
1607
|
})
|
|
1554
1608
|
});
|
|
1555
1609
|
}
|
|
@@ -1561,10 +1615,10 @@ function TableLoadingState() {
|
|
|
1561
1615
|
const handle = setTimeout(() => setShowLoading(true), 500);
|
|
1562
1616
|
return () => clearTimeout(handle);
|
|
1563
1617
|
});
|
|
1564
|
-
return jsxs(Fragment, {
|
|
1565
|
-
children: [!isHydrated && showLoading && jsx("div", {
|
|
1618
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
1619
|
+
children: [!isHydrated && showLoading && /* @__PURE__ */ jsx("div", {
|
|
1566
1620
|
children: loadingText
|
|
1567
|
-
}), jsx(TableInner, {
|
|
1621
|
+
}), /* @__PURE__ */ jsx(TableInner, {
|
|
1568
1622
|
hidden: !isHydrated
|
|
1569
1623
|
})]
|
|
1570
1624
|
});
|
|
@@ -1577,17 +1631,15 @@ const TableInner = memo(function TableInner2({
|
|
|
1577
1631
|
const activeColumns = table.useState((state) => state.activeColumns.map((column) => ({
|
|
1578
1632
|
id: column.id,
|
|
1579
1633
|
width: column.width,
|
|
1580
|
-
classes: column.classes
|
|
1581
|
-
header: column.header
|
|
1634
|
+
classes: column.classes
|
|
1582
1635
|
})));
|
|
1583
1636
|
const columnWidths = table.useState("columnWidths", {
|
|
1584
1637
|
throttle: 16
|
|
1585
1638
|
});
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1588
|
-
});
|
|
1589
|
-
const classes = table.useState("props.classes");
|
|
1639
|
+
const hasFooter = table.useState((state) => state.activeColumns.some((column) => column.footer));
|
|
1640
|
+
const classes = useTheme((theme) => theme.classes);
|
|
1590
1641
|
const stickyHeader = table.useState("props.stickyHeader");
|
|
1642
|
+
const stickyFooter = table.useState("props.stickyFooter");
|
|
1591
1643
|
const enableSelection = table.useState("props.enableSelection");
|
|
1592
1644
|
const enableColumnSelection = table.useState("props.enableColumnSelection");
|
|
1593
1645
|
const enableExport = table.useState((state) => !!state.props.enableExport.copy || !!state.props.enableExport.download);
|
|
@@ -1596,7 +1648,7 @@ const TableInner = memo(function TableInner2({
|
|
|
1596
1648
|
var _a, _b;
|
|
1597
1649
|
return (_b = (_a = table.getState().props).debugRender) == null ? void 0 : _b.call(_a, "render table inner");
|
|
1598
1650
|
});
|
|
1599
|
-
return jsx(Virtualized, {
|
|
1651
|
+
return /* @__PURE__ */ jsx(Virtualized, {
|
|
1600
1652
|
className: classes == null ? void 0 : classes.table,
|
|
1601
1653
|
css: [cssVariables, defaultClasses.table, {
|
|
1602
1654
|
gridTemplateColumns: [
|
|
@@ -1611,38 +1663,40 @@ const TableInner = memo(function TableInner2({
|
|
|
1611
1663
|
}, hidden && {
|
|
1612
1664
|
visibility: "hidden"
|
|
1613
1665
|
}],
|
|
1614
|
-
header: jsxs(Fragment, {
|
|
1615
|
-
children: [jsx("div", {
|
|
1666
|
+
header: /* @__PURE__ */ jsxs(Fragment, {
|
|
1667
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1616
1668
|
className: classes == null ? void 0 : classes.headerCell,
|
|
1617
1669
|
css: [defaultClasses.headerFill, stickyHeader && defaultClasses.sticky, stickyHeader instanceof Object && stickyHeader]
|
|
1618
|
-
}), jsxs("div", {
|
|
1670
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1619
1671
|
className: classes == null ? void 0 : classes.headerCell,
|
|
1620
1672
|
css: [defaultClasses.headerCell, stickyHeader && defaultClasses.sticky, stickyHeader instanceof Object && stickyHeader],
|
|
1621
|
-
children: [enableSelection && jsx(SelectComponent, {}), enableColumnSelection && jsx(ColumnSelection, {}), enableExport && jsx(Export$1, {}), jsx(ResizeHandleView, {})]
|
|
1622
|
-
}), jsx(ColumnHeaderContext.Provider, {
|
|
1623
|
-
children: activeColumns.map((column) => {
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
className: cx(classes == null ? void 0 : classes.headerCell, (_a = column.classes) == null ? void 0 : _a.headerCell),
|
|
1629
|
-
css: [defaultClasses.headerCell, columnStyleOverride.get(column.id), stickyHeader && defaultClasses.sticky, stickyHeader instanceof Object && stickyHeader],
|
|
1630
|
-
children: [jsx(SortComponent, {
|
|
1631
|
-
children: column.header
|
|
1632
|
-
}), jsx("div", {
|
|
1633
|
-
css: {
|
|
1634
|
-
flex: 1
|
|
1635
|
-
}
|
|
1636
|
-
}), jsx(FilterControl, {}), jsx(ResizeHandle, {})]
|
|
1637
|
-
}, column.id)
|
|
1638
|
-
}, column.id);
|
|
1639
|
-
})
|
|
1640
|
-
}), jsx("div", {
|
|
1673
|
+
children: [enableSelection && /* @__PURE__ */ jsx(SelectComponent, {}), enableColumnSelection && /* @__PURE__ */ jsx(ColumnSelection, {}), enableExport && /* @__PURE__ */ jsx(Export$1, {}), /* @__PURE__ */ jsx(ResizeHandleView, {})]
|
|
1674
|
+
}), /* @__PURE__ */ jsx(ColumnHeaderContext.Provider, {
|
|
1675
|
+
children: activeColumns.map((column) => /* @__PURE__ */ jsx(ColumnContext.Provider, {
|
|
1676
|
+
value: column.id,
|
|
1677
|
+
children: /* @__PURE__ */ jsx(ColumnHeader, {})
|
|
1678
|
+
}, column.id))
|
|
1679
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1641
1680
|
className: classes == null ? void 0 : classes.headerCell,
|
|
1642
1681
|
css: [defaultClasses.headerFill, stickyHeader && defaultClasses.sticky, stickyHeader instanceof Object && stickyHeader]
|
|
1643
1682
|
})]
|
|
1644
1683
|
}),
|
|
1645
|
-
|
|
1684
|
+
footer: hasFooter && /* @__PURE__ */ jsxs(Fragment, {
|
|
1685
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1686
|
+
className: classes == null ? void 0 : classes.footerCell,
|
|
1687
|
+
css: [defaultClasses.footerFill, stickyFooter && defaultClasses.stickyBottom, stickyFooter instanceof Object && stickyFooter]
|
|
1688
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1689
|
+
className: classes == null ? void 0 : classes.footerCell,
|
|
1690
|
+
css: [defaultClasses.footerFill, stickyFooter && defaultClasses.stickyBottom, stickyFooter instanceof Object && stickyFooter]
|
|
1691
|
+
}), activeColumns.map((column) => /* @__PURE__ */ jsx(ColumnContext.Provider, {
|
|
1692
|
+
value: column.id,
|
|
1693
|
+
children: /* @__PURE__ */ jsx(ColumnFooter, {})
|
|
1694
|
+
}, column.id)), /* @__PURE__ */ jsx("div", {
|
|
1695
|
+
className: classes == null ? void 0 : classes.footerCell,
|
|
1696
|
+
css: [defaultClasses.footerFill, stickyFooter && defaultClasses.stickyBottom, stickyFooter instanceof Object && stickyFooter]
|
|
1697
|
+
})]
|
|
1698
|
+
}),
|
|
1699
|
+
children: (itemIds, startIndex) => itemIds.map((itemId, index) => /* @__PURE__ */ jsx(Row, {
|
|
1646
1700
|
itemId,
|
|
1647
1701
|
rowIndex: startIndex + index
|
|
1648
1702
|
}, itemId))
|
|
@@ -1655,7 +1709,7 @@ const defaultColors = {
|
|
|
1655
1709
|
function Spinner({
|
|
1656
1710
|
className: className2
|
|
1657
1711
|
}) {
|
|
1658
|
-
return jsxs("div", {
|
|
1712
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1659
1713
|
className: className2,
|
|
1660
1714
|
css: css`
|
|
1661
1715
|
display: inline-block;
|
|
@@ -1693,7 +1747,7 @@ function Spinner({
|
|
|
1693
1747
|
}
|
|
1694
1748
|
}
|
|
1695
1749
|
`,
|
|
1696
|
-
children: [jsx("div", {}), jsx("div", {}), jsx("div", {})]
|
|
1750
|
+
children: [/* @__PURE__ */ jsx("div", {}), /* @__PURE__ */ jsx("div", {}), /* @__PURE__ */ jsx("div", {})]
|
|
1697
1751
|
});
|
|
1698
1752
|
}
|
|
1699
1753
|
const Badge = ({
|
|
@@ -1702,14 +1756,14 @@ const Badge = ({
|
|
|
1702
1756
|
}) => {
|
|
1703
1757
|
if (!open)
|
|
1704
1758
|
return null;
|
|
1705
|
-
return jsxs("span", {
|
|
1759
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
1706
1760
|
css: {
|
|
1707
1761
|
display: "inline-flex",
|
|
1708
1762
|
position: "relative",
|
|
1709
1763
|
flexShrink: 0,
|
|
1710
1764
|
verticalAlign: "middle"
|
|
1711
1765
|
},
|
|
1712
|
-
children: [children, jsx("span", {
|
|
1766
|
+
children: [children, /* @__PURE__ */ jsx("span", {
|
|
1713
1767
|
css: [{
|
|
1714
1768
|
top: 0,
|
|
1715
1769
|
right: 0,
|
|
@@ -1747,7 +1801,7 @@ const Button = (_e) => {
|
|
|
1747
1801
|
"children",
|
|
1748
1802
|
"variant"
|
|
1749
1803
|
]);
|
|
1750
|
-
return jsxs("button", __spreadProps(__spreadValues({
|
|
1804
|
+
return /* @__PURE__ */ jsxs("button", __spreadProps(__spreadValues({
|
|
1751
1805
|
css: [{
|
|
1752
1806
|
padding: `var(--spacing) calc(var(--spacing) * 2)`,
|
|
1753
1807
|
display: "inline-flex",
|
|
@@ -1782,12 +1836,12 @@ const Button = (_e) => {
|
|
|
1782
1836
|
}
|
|
1783
1837
|
}]
|
|
1784
1838
|
}, props), {
|
|
1785
|
-
children: [startIcon && jsx("span", {
|
|
1839
|
+
children: [startIcon && /* @__PURE__ */ jsx("span", {
|
|
1786
1840
|
css: {
|
|
1787
1841
|
marginRight: `calc(var(--spacing) * 2)`
|
|
1788
1842
|
},
|
|
1789
1843
|
children: startIcon
|
|
1790
|
-
}), jsx("span", {
|
|
1844
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1791
1845
|
children
|
|
1792
1846
|
})]
|
|
1793
1847
|
}));
|
|
@@ -1798,7 +1852,7 @@ const Checkbox = (_g) => {
|
|
|
1798
1852
|
} = _h, props = __objRest(_h, [
|
|
1799
1853
|
"className"
|
|
1800
1854
|
]);
|
|
1801
|
-
return jsxs("label", {
|
|
1855
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
1802
1856
|
css: [{
|
|
1803
1857
|
padding: "calc(var(--spacing) * 1.8)",
|
|
1804
1858
|
display: "flex",
|
|
@@ -1812,9 +1866,9 @@ const Checkbox = (_g) => {
|
|
|
1812
1866
|
color: "rgba(0, 0, 0, 0.26)"
|
|
1813
1867
|
}],
|
|
1814
1868
|
className: className2,
|
|
1815
|
-
children: [jsx("input", __spreadValues({
|
|
1869
|
+
children: [/* @__PURE__ */ jsx("input", __spreadValues({
|
|
1816
1870
|
type: "checkbox"
|
|
1817
|
-
}, props)), props.checked ? jsx("svg", {
|
|
1871
|
+
}, props)), props.checked ? /* @__PURE__ */ jsx("svg", {
|
|
1818
1872
|
css: {
|
|
1819
1873
|
fontSize: "1.25rem",
|
|
1820
1874
|
width: "1em",
|
|
@@ -1824,10 +1878,10 @@ const Checkbox = (_g) => {
|
|
|
1824
1878
|
focusable: "false",
|
|
1825
1879
|
viewBox: "0 0 24 24",
|
|
1826
1880
|
"aria-hidden": "true",
|
|
1827
|
-
children: jsx("path", {
|
|
1881
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
1828
1882
|
d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
1829
1883
|
})
|
|
1830
|
-
}) : jsx("svg", {
|
|
1884
|
+
}) : /* @__PURE__ */ jsx("svg", {
|
|
1831
1885
|
css: {
|
|
1832
1886
|
fontSize: "1.25rem",
|
|
1833
1887
|
width: "1em",
|
|
@@ -1837,14 +1891,14 @@ const Checkbox = (_g) => {
|
|
|
1837
1891
|
focusable: "false",
|
|
1838
1892
|
viewBox: "0 0 24 24",
|
|
1839
1893
|
"aria-hidden": "true",
|
|
1840
|
-
children: jsx("path", {
|
|
1894
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
1841
1895
|
d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
|
1842
1896
|
})
|
|
1843
1897
|
})]
|
|
1844
1898
|
});
|
|
1845
1899
|
};
|
|
1846
1900
|
const IconButton = (props) => {
|
|
1847
|
-
return jsx("button", __spreadValues({
|
|
1901
|
+
return /* @__PURE__ */ jsx("button", __spreadValues({
|
|
1848
1902
|
css: {
|
|
1849
1903
|
padding: "var(--spacing)",
|
|
1850
1904
|
borderRadius: "50%",
|
|
@@ -1877,12 +1931,12 @@ const TextField = (_i) => {
|
|
|
1877
1931
|
]);
|
|
1878
1932
|
var _a;
|
|
1879
1933
|
const [focus, setFocus] = useState(false);
|
|
1880
|
-
return jsx("div", {
|
|
1934
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1881
1935
|
className: className2,
|
|
1882
1936
|
css: {
|
|
1883
1937
|
display: "flex"
|
|
1884
1938
|
},
|
|
1885
|
-
children: jsxs("span", {
|
|
1939
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
1886
1940
|
css: [{
|
|
1887
1941
|
flex: 1,
|
|
1888
1942
|
display: "flex",
|
|
@@ -1893,7 +1947,7 @@ const TextField = (_i) => {
|
|
|
1893
1947
|
border: "2px solid var(--primaryMain)",
|
|
1894
1948
|
margin: -1
|
|
1895
1949
|
}],
|
|
1896
|
-
children: [jsx("input", __spreadProps(__spreadValues({
|
|
1950
|
+
children: [/* @__PURE__ */ jsx("input", __spreadProps(__spreadValues({
|
|
1897
1951
|
ref: inputRef
|
|
1898
1952
|
}, props), {
|
|
1899
1953
|
value: (_a = props.value) != null ? _a : "",
|
|
@@ -1927,7 +1981,7 @@ const IconDefaultStyle = css({
|
|
|
1927
1981
|
color: "inherit"
|
|
1928
1982
|
});
|
|
1929
1983
|
function Icon(svg) {
|
|
1930
|
-
return (props) => jsx(ClassNames, {
|
|
1984
|
+
return (props) => /* @__PURE__ */ jsx(ClassNames, {
|
|
1931
1985
|
children: ({
|
|
1932
1986
|
css: css2
|
|
1933
1987
|
}) => cloneElement(svg, __spreadProps(__spreadValues({}, props), {
|
|
@@ -1935,120 +1989,120 @@ function Icon(svg) {
|
|
|
1935
1989
|
}))
|
|
1936
1990
|
});
|
|
1937
1991
|
}
|
|
1938
|
-
const Settings = Icon(jsxs("svg", {
|
|
1992
|
+
const Settings = Icon(/* @__PURE__ */ jsxs("svg", {
|
|
1939
1993
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1940
1994
|
height: "24px",
|
|
1941
1995
|
viewBox: "0 0 24 24",
|
|
1942
1996
|
width: "24px",
|
|
1943
1997
|
fill: "currentColor",
|
|
1944
|
-
children: [jsx("path", {
|
|
1998
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
1945
1999
|
d: "M0 0h24v24H0V0z",
|
|
1946
2000
|
fill: "none"
|
|
1947
|
-
}), jsx("path", {
|
|
2001
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
1948
2002
|
d: "M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"
|
|
1949
2003
|
})]
|
|
1950
2004
|
}));
|
|
1951
|
-
const Export = Icon(jsxs("svg", {
|
|
2005
|
+
const Export = Icon(/* @__PURE__ */ jsxs("svg", {
|
|
1952
2006
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1953
2007
|
enableBackground: "new 0 0 24 24",
|
|
1954
2008
|
height: "24px",
|
|
1955
2009
|
viewBox: "0 0 24 24",
|
|
1956
2010
|
width: "24px",
|
|
1957
2011
|
fill: "currentColor",
|
|
1958
|
-
children: [jsx("g", {
|
|
1959
|
-
children: jsx("rect", {
|
|
2012
|
+
children: [/* @__PURE__ */ jsx("g", {
|
|
2013
|
+
children: /* @__PURE__ */ jsx("rect", {
|
|
1960
2014
|
fill: "none",
|
|
1961
2015
|
height: "24",
|
|
1962
2016
|
width: "24"
|
|
1963
2017
|
})
|
|
1964
|
-
}), jsx("g", {
|
|
1965
|
-
children: jsx("path", {
|
|
2018
|
+
}), /* @__PURE__ */ jsx("g", {
|
|
2019
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
1966
2020
|
d: "M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z"
|
|
1967
2021
|
})
|
|
1968
2022
|
})]
|
|
1969
2023
|
}));
|
|
1970
|
-
const Clipboard = Icon(jsxs("svg", {
|
|
2024
|
+
const Clipboard = Icon(/* @__PURE__ */ jsxs("svg", {
|
|
1971
2025
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1972
2026
|
height: "24px",
|
|
1973
2027
|
viewBox: "0 0 24 24",
|
|
1974
2028
|
width: "24px",
|
|
1975
2029
|
fill: "currentColor",
|
|
1976
|
-
children: [jsx("path", {
|
|
2030
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
1977
2031
|
d: "M0 0h24v24H0V0z",
|
|
1978
2032
|
fill: "none"
|
|
1979
|
-
}), jsx("path", {
|
|
2033
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
1980
2034
|
d: "M19 2h-4.18C14.4.84 13.3 0 12 0S9.6.84 9.18 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z"
|
|
1981
2035
|
})]
|
|
1982
2036
|
}));
|
|
1983
|
-
const ChevronRight = Icon(jsxs("svg", {
|
|
2037
|
+
const ChevronRight = Icon(/* @__PURE__ */ jsxs("svg", {
|
|
1984
2038
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1985
2039
|
height: "24px",
|
|
1986
2040
|
viewBox: "0 0 24 24",
|
|
1987
2041
|
width: "24px",
|
|
1988
2042
|
fill: "currentColor",
|
|
1989
|
-
children: [jsx("path", {
|
|
2043
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
1990
2044
|
d: "M0 0h24v24H0V0z",
|
|
1991
2045
|
fill: "none"
|
|
1992
|
-
}), jsx("path", {
|
|
2046
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
1993
2047
|
d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"
|
|
1994
2048
|
})]
|
|
1995
2049
|
}));
|
|
1996
|
-
const Search = Icon(jsxs("svg", {
|
|
2050
|
+
const Search = Icon(/* @__PURE__ */ jsxs("svg", {
|
|
1997
2051
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1998
2052
|
height: "24px",
|
|
1999
2053
|
viewBox: "0 0 24 24",
|
|
2000
2054
|
width: "24px",
|
|
2001
2055
|
fill: "currentColor",
|
|
2002
|
-
children: [jsx("path", {
|
|
2056
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
2003
2057
|
d: "M0 0h24v24H0V0z",
|
|
2004
2058
|
fill: "none"
|
|
2005
|
-
}), jsx("path", {
|
|
2059
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
2006
2060
|
d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"
|
|
2007
2061
|
})]
|
|
2008
2062
|
}));
|
|
2009
|
-
const Clear = Icon(jsxs("svg", {
|
|
2063
|
+
const Clear = Icon(/* @__PURE__ */ jsxs("svg", {
|
|
2010
2064
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2011
2065
|
height: "24px",
|
|
2012
2066
|
viewBox: "0 0 24 24",
|
|
2013
2067
|
width: "24px",
|
|
2014
2068
|
fill: "currentColor",
|
|
2015
|
-
children: [jsx("path", {
|
|
2069
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
2016
2070
|
d: "M0 0h24v24H0V0z",
|
|
2017
2071
|
fill: "none"
|
|
2018
|
-
}), jsx("path", {
|
|
2072
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
2019
2073
|
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
2020
2074
|
})]
|
|
2021
2075
|
}));
|
|
2022
|
-
const ArrowDropDown = Icon(jsxs("svg", {
|
|
2076
|
+
const ArrowDropDown = Icon(/* @__PURE__ */ jsxs("svg", {
|
|
2023
2077
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2024
2078
|
height: "24px",
|
|
2025
2079
|
viewBox: "0 0 24 24",
|
|
2026
2080
|
width: "24px",
|
|
2027
2081
|
fill: "currentColor",
|
|
2028
|
-
children: [jsx("path", {
|
|
2082
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
2029
2083
|
d: "M0 0h24v24H0V0z",
|
|
2030
2084
|
fill: "none"
|
|
2031
|
-
}), jsx("path", {
|
|
2085
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
2032
2086
|
d: "M7 10l5 5 5-5H7z"
|
|
2033
2087
|
})]
|
|
2034
2088
|
}));
|
|
2035
|
-
const FilterList = Icon(jsx("svg", {
|
|
2089
|
+
const FilterList = Icon(/* @__PURE__ */ jsx("svg", {
|
|
2036
2090
|
viewBox: "0 0 24 24",
|
|
2037
|
-
children: jsx("path", {
|
|
2091
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
2038
2092
|
fill: "currentColor",
|
|
2039
2093
|
d: "M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z"
|
|
2040
2094
|
})
|
|
2041
2095
|
}));
|
|
2042
|
-
const ArrowUpward = Icon(jsxs("svg", {
|
|
2096
|
+
const ArrowUpward = Icon(/* @__PURE__ */ jsxs("svg", {
|
|
2043
2097
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2044
2098
|
height: "24px",
|
|
2045
2099
|
viewBox: "0 0 24 24",
|
|
2046
2100
|
width: "24px",
|
|
2047
2101
|
fill: "currentColor",
|
|
2048
|
-
children: [jsx("path", {
|
|
2102
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
2049
2103
|
d: "M0 0h24v24H0V0z",
|
|
2050
2104
|
fill: "none"
|
|
2051
|
-
}), jsx("path", {
|
|
2105
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
2052
2106
|
d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"
|
|
2053
2107
|
})]
|
|
2054
2108
|
}));
|
|
@@ -2131,7 +2185,7 @@ function AutoFocusTextField(props) {
|
|
|
2131
2185
|
ref.current.focus();
|
|
2132
2186
|
}
|
|
2133
2187
|
}, [visible]);
|
|
2134
|
-
return jsx(TextField2, __spreadProps(__spreadValues({}, props), {
|
|
2188
|
+
return /* @__PURE__ */ jsx(TextField2, __spreadProps(__spreadValues({}, props), {
|
|
2135
2189
|
inputRef: ref
|
|
2136
2190
|
}));
|
|
2137
2191
|
}
|
|
@@ -2189,7 +2243,7 @@ function DateInput({
|
|
|
2189
2243
|
}), [locale]);
|
|
2190
2244
|
const parts = format.formatToParts(value != null ? value : defaultDate);
|
|
2191
2245
|
const isEmpty = !value;
|
|
2192
|
-
return jsx("div", {
|
|
2246
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2193
2247
|
css: {
|
|
2194
2248
|
display: "flex",
|
|
2195
2249
|
alignItems: "baseline"
|
|
@@ -2197,8 +2251,8 @@ function DateInput({
|
|
|
2197
2251
|
children: parts.map(({
|
|
2198
2252
|
type,
|
|
2199
2253
|
value: value2
|
|
2200
|
-
}, index) => jsx(Fragment$1, {
|
|
2201
|
-
children: isIncludedType(type) ? jsx("input", {
|
|
2254
|
+
}, index) => /* @__PURE__ */ jsx(Fragment$1, {
|
|
2255
|
+
children: isIncludedType(type) ? /* @__PURE__ */ jsx("input", {
|
|
2202
2256
|
className,
|
|
2203
2257
|
css: {
|
|
2204
2258
|
width: `${length(type, value2)}ch`,
|
|
@@ -2225,7 +2279,7 @@ function DateInput({
|
|
|
2225
2279
|
},
|
|
2226
2280
|
onFocus: (e2) => e2.target.select(),
|
|
2227
2281
|
onBlur: commit
|
|
2228
|
-
}) : type === "literal" ? jsx("span", {
|
|
2282
|
+
}) : type === "literal" ? /* @__PURE__ */ jsx("span", {
|
|
2229
2283
|
children: value2
|
|
2230
2284
|
}) : null
|
|
2231
2285
|
}, index))
|
|
@@ -2363,8 +2417,8 @@ function DatePicker({
|
|
|
2363
2417
|
});
|
|
2364
2418
|
return (year) => format(new Date(year, 0, 1));
|
|
2365
2419
|
}, [locale]);
|
|
2366
|
-
return jsxs("div", {
|
|
2367
|
-
children: [jsxs("div", {
|
|
2420
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2421
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
2368
2422
|
css: {
|
|
2369
2423
|
display: "grid",
|
|
2370
2424
|
gridAutoFlow: "column",
|
|
@@ -2372,12 +2426,12 @@ function DatePicker({
|
|
|
2372
2426
|
alignItems: "baseline",
|
|
2373
2427
|
gap: "var(--spacing)"
|
|
2374
2428
|
},
|
|
2375
|
-
children: [jsx(DateInput, {
|
|
2429
|
+
children: [/* @__PURE__ */ jsx(DateInput, {
|
|
2376
2430
|
value: min != null ? min : null,
|
|
2377
2431
|
onChange: (date) => set(date != null ? date : void 0, max, "min"),
|
|
2378
2432
|
locale
|
|
2379
|
-
}), rangeSelect && jsxs(Fragment, {
|
|
2380
|
-
children: [" - ", jsx(DateInput, {
|
|
2433
|
+
}), rangeSelect && /* @__PURE__ */ jsxs(Fragment, {
|
|
2434
|
+
children: [" - ", /* @__PURE__ */ jsx(DateInput, {
|
|
2381
2435
|
value: max != null ? max : null,
|
|
2382
2436
|
onChange: (date) => set(min, date != null ? date : void 0, "max"),
|
|
2383
2437
|
locale
|
|
@@ -2387,11 +2441,11 @@ function DatePicker({
|
|
|
2387
2441
|
month,
|
|
2388
2442
|
year,
|
|
2389
2443
|
weeks
|
|
2390
|
-
}) => jsxs("div", {
|
|
2444
|
+
}) => /* @__PURE__ */ jsxs("div", {
|
|
2391
2445
|
css: {
|
|
2392
2446
|
display: "grid"
|
|
2393
2447
|
},
|
|
2394
|
-
children: [jsxs("div", {
|
|
2448
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
2395
2449
|
css: {
|
|
2396
2450
|
margin: "calc(var(--spacing) * 4) 0",
|
|
2397
2451
|
display: "grid",
|
|
@@ -2399,32 +2453,32 @@ function DatePicker({
|
|
|
2399
2453
|
justifyContent: "space-between",
|
|
2400
2454
|
alignItems: "center"
|
|
2401
2455
|
},
|
|
2402
|
-
children: [jsx(IconButton2, __spreadProps(__spreadValues({}, getBackProps({
|
|
2456
|
+
children: [/* @__PURE__ */ jsx(IconButton2, __spreadProps(__spreadValues({}, getBackProps({
|
|
2403
2457
|
calendars
|
|
2404
2458
|
})), {
|
|
2405
|
-
children: jsx(ChevronRight2, {
|
|
2459
|
+
children: /* @__PURE__ */ jsx(ChevronRight2, {
|
|
2406
2460
|
css: {
|
|
2407
2461
|
transform: "rotate3d(0, 0, 1, 180deg)"
|
|
2408
2462
|
}
|
|
2409
2463
|
})
|
|
2410
|
-
})), jsxs("div", {
|
|
2464
|
+
})), /* @__PURE__ */ jsxs("div", {
|
|
2411
2465
|
css: {
|
|
2412
2466
|
display: "flex"
|
|
2413
2467
|
},
|
|
2414
2468
|
children: [formatMonth(month), " ", formatYear(year)]
|
|
2415
|
-
}), jsx(IconButton2, __spreadProps(__spreadValues({}, getForwardProps({
|
|
2469
|
+
}), /* @__PURE__ */ jsx(IconButton2, __spreadProps(__spreadValues({}, getForwardProps({
|
|
2416
2470
|
calendars
|
|
2417
2471
|
})), {
|
|
2418
|
-
children: jsx(ChevronRight2, {})
|
|
2472
|
+
children: /* @__PURE__ */ jsx(ChevronRight2, {})
|
|
2419
2473
|
}))]
|
|
2420
|
-
}), jsxs("div", {
|
|
2474
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
2421
2475
|
css: {
|
|
2422
2476
|
justifySelf: "center",
|
|
2423
2477
|
display: "grid",
|
|
2424
2478
|
gridTemplateColumns: "repeat(7, max-content)",
|
|
2425
2479
|
fontWeight: "bold"
|
|
2426
2480
|
},
|
|
2427
|
-
children: [weekDays.map((_v, weekDay) => jsx("div", {
|
|
2481
|
+
children: [weekDays.map((_v, weekDay) => /* @__PURE__ */ jsx("div", {
|
|
2428
2482
|
css: {
|
|
2429
2483
|
justifySelf: "center",
|
|
2430
2484
|
marginBottom: "var(--spacing)"
|
|
@@ -2432,7 +2486,7 @@ function DatePicker({
|
|
|
2432
2486
|
children: formatWeekday(weekDay)
|
|
2433
2487
|
}, weekDay)), weeks.map((week, index) => week.map((dateObj, dayIndex) => {
|
|
2434
2488
|
if (!dateObj) {
|
|
2435
|
-
return jsx("div", {});
|
|
2489
|
+
return /* @__PURE__ */ jsx("div", {});
|
|
2436
2490
|
}
|
|
2437
2491
|
const {
|
|
2438
2492
|
prevMonth,
|
|
@@ -2451,7 +2505,7 @@ function DatePicker({
|
|
|
2451
2505
|
min: hovered,
|
|
2452
2506
|
max: min
|
|
2453
2507
|
}));
|
|
2454
|
-
return jsx("button", __spreadProps(__spreadValues({
|
|
2508
|
+
return /* @__PURE__ */ jsx("button", __spreadProps(__spreadValues({
|
|
2455
2509
|
css: [{
|
|
2456
2510
|
padding: 10,
|
|
2457
2511
|
border: "1px solid transparent",
|
|
@@ -2487,28 +2541,28 @@ function DatePicker({
|
|
|
2487
2541
|
}), `${index}-${dayIndex}`);
|
|
2488
2542
|
}))]
|
|
2489
2543
|
})]
|
|
2490
|
-
}, `${month}${year}`)), jsxs("div", {
|
|
2544
|
+
}, `${month}${year}`)), /* @__PURE__ */ jsxs("div", {
|
|
2491
2545
|
css: {
|
|
2492
2546
|
marginTop: "var(--spacing)",
|
|
2493
2547
|
display: "grid",
|
|
2494
2548
|
gridAutoFlow: "column",
|
|
2495
2549
|
justifyContent: "center"
|
|
2496
2550
|
},
|
|
2497
|
-
children: [jsx(Button2, {
|
|
2551
|
+
children: [/* @__PURE__ */ jsx(Button2, {
|
|
2498
2552
|
variant: "text",
|
|
2499
2553
|
onClick: () => {
|
|
2500
2554
|
setDirty(void 0);
|
|
2501
2555
|
onChange(today());
|
|
2502
2556
|
},
|
|
2503
2557
|
children: textToday
|
|
2504
|
-
}), jsx(Button2, {
|
|
2558
|
+
}), /* @__PURE__ */ jsx(Button2, {
|
|
2505
2559
|
variant: "text",
|
|
2506
2560
|
onClick: () => {
|
|
2507
2561
|
setDirty(void 0);
|
|
2508
2562
|
onChange(thisWeek(firstDayOfWeek));
|
|
2509
2563
|
},
|
|
2510
2564
|
children: textThisWeek
|
|
2511
|
-
}), jsx(Button2, {
|
|
2565
|
+
}), /* @__PURE__ */ jsx(Button2, {
|
|
2512
2566
|
variant: "text",
|
|
2513
2567
|
onClick: () => {
|
|
2514
2568
|
setDirty(void 0);
|
|
@@ -2566,12 +2620,12 @@ function DateFilter(_k) {
|
|
|
2566
2620
|
return dateIntersect(filterValue, value2);
|
|
2567
2621
|
}
|
|
2568
2622
|
}));
|
|
2569
|
-
return jsx("div", {
|
|
2623
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2570
2624
|
css: {
|
|
2571
2625
|
padding: "calc(var(--spacing) * 2)",
|
|
2572
2626
|
display: "grid"
|
|
2573
2627
|
},
|
|
2574
|
-
children: jsx(DatePicker, {
|
|
2628
|
+
children: /* @__PURE__ */ jsx(DatePicker, {
|
|
2575
2629
|
rangeSelect: !singleSelect,
|
|
2576
2630
|
value,
|
|
2577
2631
|
onChange,
|
|
@@ -2632,45 +2686,45 @@ function SelectFilter(_m) {
|
|
|
2632
2686
|
});
|
|
2633
2687
|
const [query, setQuery] = useState("");
|
|
2634
2688
|
const filtered = options.filter((option) => !query || stringValue(option).toLowerCase().includes(query.toLowerCase()));
|
|
2635
|
-
return jsxs("div", {
|
|
2689
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2636
2690
|
css: {
|
|
2637
2691
|
padding: "calc(var(--spacing) * 2)",
|
|
2638
2692
|
display: "grid",
|
|
2639
2693
|
gap: "var(--spacing)"
|
|
2640
2694
|
},
|
|
2641
|
-
children: [jsx(AutoFocusTextField, {
|
|
2695
|
+
children: [/* @__PURE__ */ jsx(AutoFocusTextField, {
|
|
2642
2696
|
value: query,
|
|
2643
2697
|
onChange: (e2) => setQuery(e2.target.value),
|
|
2644
|
-
endIcon: jsx(IconButton2, {
|
|
2698
|
+
endIcon: /* @__PURE__ */ jsx(IconButton2, {
|
|
2645
2699
|
onClick: () => setQuery(""),
|
|
2646
|
-
children: !query ? jsx(Search2, {}) : jsx(Clear2, {})
|
|
2700
|
+
children: !query ? /* @__PURE__ */ jsx(Search2, {}) : /* @__PURE__ */ jsx(Clear2, {})
|
|
2647
2701
|
}),
|
|
2648
2702
|
css: {
|
|
2649
2703
|
marginBottom: "var(--spacing)"
|
|
2650
2704
|
}
|
|
2651
|
-
}), jsxs("div", {
|
|
2705
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
2652
2706
|
css: {
|
|
2653
2707
|
maxHeight: "20em",
|
|
2654
2708
|
overflowY: "auto"
|
|
2655
2709
|
},
|
|
2656
|
-
children: [jsx(FormControlLabel, {
|
|
2710
|
+
children: [/* @__PURE__ */ jsx(FormControlLabel, {
|
|
2657
2711
|
disabled: value.size === 0,
|
|
2658
|
-
control: jsx(Checkbox2, {
|
|
2712
|
+
control: /* @__PURE__ */ jsx(Checkbox2, {
|
|
2659
2713
|
disabled: value.size === 0,
|
|
2660
2714
|
checked: value.size > 0,
|
|
2661
2715
|
onChange: () => onChange(/* @__PURE__ */ new Set())
|
|
2662
2716
|
}),
|
|
2663
|
-
label: jsxs(Fragment, {
|
|
2717
|
+
label: /* @__PURE__ */ jsxs(Fragment, {
|
|
2664
2718
|
children: ["<", selected(value.size), ">"]
|
|
2665
2719
|
})
|
|
2666
|
-
}), filtered.map((option, index) => jsx(FormControlLabel, {
|
|
2667
|
-
control: jsx(Checkbox2, {
|
|
2720
|
+
}), filtered.map((option, index) => /* @__PURE__ */ jsx(FormControlLabel, {
|
|
2721
|
+
control: /* @__PURE__ */ jsx(Checkbox2, {
|
|
2668
2722
|
checked: value.has(option),
|
|
2669
2723
|
onChange: () => onChange(toggle(value, option, singleSelect))
|
|
2670
2724
|
}),
|
|
2671
2725
|
label: render(option)
|
|
2672
2726
|
}, index))]
|
|
2673
|
-
}), filtered.length === 0 && jsx("span", {
|
|
2727
|
+
}), filtered.length === 0 && /* @__PURE__ */ jsx("span", {
|
|
2674
2728
|
css: {
|
|
2675
2729
|
textAlign: "center"
|
|
2676
2730
|
},
|
|
@@ -2798,17 +2852,17 @@ function TextFilter(_o) {
|
|
|
2798
2852
|
return compare(value2, filterValue);
|
|
2799
2853
|
}
|
|
2800
2854
|
}));
|
|
2801
|
-
return jsx("div", {
|
|
2855
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2802
2856
|
css: {
|
|
2803
2857
|
padding: `calc(var(--spacing) * 2)`,
|
|
2804
2858
|
display: "grid"
|
|
2805
2859
|
},
|
|
2806
|
-
children: jsx(AutoFocusTextField, {
|
|
2860
|
+
children: /* @__PURE__ */ jsx(AutoFocusTextField, {
|
|
2807
2861
|
value,
|
|
2808
2862
|
onChange: (e2) => onChange(e2.target.value),
|
|
2809
|
-
endIcon: jsx(IconButton2, {
|
|
2863
|
+
endIcon: /* @__PURE__ */ jsx(IconButton2, {
|
|
2810
2864
|
onClick: () => onChange(""),
|
|
2811
|
-
children: !value ? jsx(Search2, {}) : jsx(Clear2, {})
|
|
2865
|
+
children: !value ? /* @__PURE__ */ jsx(Search2, {}) : /* @__PURE__ */ jsx(Clear2, {})
|
|
2812
2866
|
})
|
|
2813
2867
|
})
|
|
2814
2868
|
});
|