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