fastapi-rtk 1.0.43 → 1.0.44
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/.bundled/jsonforms/cjs/_virtual/index11.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index12.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index3.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index4.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index5.cjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index11.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index12.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index3.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index4.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index5.mjs +2 -2
- package/dist/.external/cjs/ajv@8.18.0/ajv/dist/compile/codegen/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.18.0/ajv/dist/compile/validate/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.18.0/ajv/dist/vocabularies/discriminator/index.cjs +1 -1
- package/dist/.external/cjs/fast-uri@3.1.0/fast-uri/index.cjs +1 -1
- package/dist/.external/cjs/json-schema-traverse@1.0.0/json-schema-traverse/index.cjs +1 -1
- package/dist/.external/cjs/mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._7jqiyi5sshrifwwn7z7vmkfdl4/mantine-react-table/dist/index.esm.cjs +13 -13
- package/dist/.external/esm/ajv@8.18.0/ajv/dist/compile/codegen/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.18.0/ajv/dist/compile/validate/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.18.0/ajv/dist/vocabularies/discriminator/index.mjs +1 -1
- package/dist/.external/esm/fast-uri@3.1.0/fast-uri/index.mjs +1 -1
- package/dist/.external/esm/json-schema-traverse@1.0.0/json-schema-traverse/index.mjs +1 -1
- package/dist/.external/esm/mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._7jqiyi5sshrifwwn7z7vmkfdl4/mantine-react-table/dist/index.esm.mjs +5 -5
- package/dist/core/cjs/Tables/NextGenDataGrid/HooksComponent.cjs +21 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/NextGenDataGrid.cjs +43 -39
- package/dist/core/cjs/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/getOptimizedMRT_RowSelectColumnDef.cjs +85 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.cjs +38 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/ColumnHeaderFilterInput.cjs +25 -10
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useOnLoad.cjs +13 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useOptimizations.cjs +26 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useQueryOnlyVisibleColumns.cjs +20 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useSelection/useSelection.cjs +14 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/FASTAPI_RTK_ToolbarAlertBanner.cjs +3 -66
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/useToolbarAlertBanner.cjs +12 -3
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useView.cjs +18 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/MRT_TableContainer.cjs +34 -25
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/MRT_TopToolbar.cjs +2 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/body/MRT_TableBody.cjs +146 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/body/MRT_TableBody.module.css.cjs +14 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/body/MRT_TableBodyRow.cjs +164 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/body/MRT_TableBodyRow.module.css.cjs +10 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/table/MRT_Table.cjs +67 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/table/MRT_Table.module.css.cjs +9 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/toolbar/MRT_ToolbarAlertBanner.cjs +132 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/toolbar/MRT_ToolbarAlertBanner.module.css.cjs +13 -0
- package/dist/core/esm/Tables/NextGenDataGrid/HooksComponent.mjs +21 -0
- package/dist/core/esm/Tables/NextGenDataGrid/NextGenDataGrid.mjs +45 -41
- package/dist/core/esm/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/getOptimizedMRT_RowSelectColumnDef.mjs +85 -0
- package/dist/core/esm/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.mjs +38 -0
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/ColumnHeaderFilterInput.mjs +25 -10
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useOnLoad.mjs +13 -0
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useOptimizations.mjs +26 -0
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useQueryOnlyVisibleColumns.mjs +20 -0
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useSelection/useSelection.mjs +14 -0
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/FASTAPI_RTK_ToolbarAlertBanner.mjs +5 -68
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/useToolbarAlertBanner.mjs +12 -3
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useView.mjs +18 -0
- package/dist/core/esm/Tables/NextGenDataGrid/patch/MRT_TableContainer.mjs +36 -27
- package/dist/core/esm/Tables/NextGenDataGrid/patch/MRT_TopToolbar.mjs +2 -1
- package/dist/core/esm/Tables/NextGenDataGrid/patch/body/MRT_TableBody.mjs +146 -0
- package/dist/core/esm/Tables/NextGenDataGrid/patch/body/MRT_TableBody.module.css.mjs +14 -0
- package/dist/core/esm/Tables/NextGenDataGrid/patch/body/MRT_TableBodyRow.mjs +164 -0
- package/dist/core/esm/Tables/NextGenDataGrid/patch/body/MRT_TableBodyRow.module.css.mjs +10 -0
- package/dist/core/esm/Tables/NextGenDataGrid/patch/table/MRT_Table.mjs +67 -0
- package/dist/core/esm/Tables/NextGenDataGrid/patch/table/MRT_Table.module.css.mjs +9 -0
- package/dist/core/esm/Tables/NextGenDataGrid/patch/toolbar/MRT_ToolbarAlertBanner.mjs +132 -0
- package/dist/core/esm/Tables/NextGenDataGrid/patch/toolbar/MRT_ToolbarAlertBanner.module.css.mjs +13 -0
- package/dist/core/lib/Tables/NextGenDataGrid/HooksComponent.d.ts +7 -0
- package/dist/core/lib/Tables/NextGenDataGrid/NextGenDataGrid.d.ts +15 -1
- package/dist/core/lib/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/index.d.ts +2 -0
- package/dist/core/lib/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.d.ts +24 -0
- package/dist/core/lib/Tables/NextGenDataGrid/components/index.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useOnLoad.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useOptimizations.d.ts +5 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useQueryOnlyVisibleColumns.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useSelection/useSelection.d.ts +4 -0
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/FASTAPI_RTK_ToolbarAlertBanner.d.ts +4 -2
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/useToolbarAlertBanner.d.ts +4 -2
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useView.d.ts +1 -0
- package/dist/core/lib/Tables/NextGenDataGrid/patch/body/MRT_TableBody.d.ts +12 -0
- package/dist/core/lib/Tables/NextGenDataGrid/patch/body/MRT_TableBodyRow.d.ts +26 -0
- package/dist/core/lib/Tables/NextGenDataGrid/patch/table/MRT_Table.d.ts +4 -0
- package/dist/core/lib/Tables/NextGenDataGrid/patch/toolbar/MRT_ToolbarAlertBanner.d.ts +5 -0
- package/dist/core/styles.css +273 -0
- package/dist/utils/cjs/{MemoWrapper → Memoizer}/MemoWrapper.cjs +1 -1
- package/dist/utils/cjs/Memoizer/RenderWrapper.cjs +20 -0
- package/dist/utils/cjs/index.cjs +3 -1
- package/dist/utils/esm/{MemoWrapper → Memoizer}/MemoWrapper.mjs +1 -1
- package/dist/utils/esm/Memoizer/RenderWrapper.mjs +20 -0
- package/dist/utils/esm/index.mjs +3 -1
- package/dist/utils/lib/Memoizer/RenderWrapper.d.ts +10 -0
- package/dist/utils/lib/Memoizer/index.d.ts +2 -0
- package/dist/utils/lib/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useCheckbox.cjs +0 -6
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useCheckbox.mjs +0 -6
- package/dist/core/lib/Tables/NextGenDataGrid/hooks/useCheckbox.d.ts +0 -3
- package/dist/utils/lib/MemoWrapper/index.d.ts +0 -1
- /package/dist/utils/lib/{MemoWrapper → Memoizer}/MemoWrapper.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/
|
|
3
|
+
const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index3.cjs");
|
|
4
4
|
const code = require("./code.cjs");
|
|
5
5
|
const scope = require("./scope.cjs");
|
|
6
6
|
var hasRequiredCodegen;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/
|
|
3
|
+
const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index5.cjs");
|
|
4
4
|
const boolSchema = require("./boolSchema.cjs");
|
|
5
5
|
const dataType = require("./dataType.cjs");
|
|
6
6
|
const applicability = require("./applicability.cjs");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/
|
|
3
|
+
const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index4.cjs");
|
|
4
4
|
const index$1 = require("../../compile/codegen/index.cjs");
|
|
5
5
|
const types = require("./types.cjs");
|
|
6
6
|
const index$2 = require("../../compile/index.cjs");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../../../../.bundled/jsonforms/cjs/_virtual/
|
|
3
|
+
const index = require("../../../../.bundled/jsonforms/cjs/_virtual/index11.cjs");
|
|
4
4
|
const utils = require("./lib/utils.cjs");
|
|
5
5
|
const schemes = require("./lib/schemes.cjs");
|
|
6
6
|
var hasRequiredFastUri;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../../../../.bundled/jsonforms/cjs/_virtual/
|
|
3
|
+
const index = require("../../../../.bundled/jsonforms/cjs/_virtual/index12.cjs");
|
|
4
4
|
var hasRequiredJsonSchemaTraverse;
|
|
5
5
|
function requireJsonSchemaTraverse() {
|
|
6
6
|
if (hasRequiredJsonSchemaTraverse) return index.__module.exports;
|
|
@@ -4,11 +4,13 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const clsx = require("../../../clsx@2.1.1/clsx/dist/clsx.cjs");
|
|
5
5
|
const React = require("react");
|
|
6
6
|
const core = require("@mantine/core");
|
|
7
|
-
const index = require("../../../@tanstack_react-table@8.20.5_react-dom@19.2.4_react@19.2.4/@tanstack/react-table/build/lib/index.cjs");
|
|
8
|
-
const index$
|
|
9
|
-
const index
|
|
7
|
+
const index$3 = require("../../../@tanstack_react-table@8.20.5_react-dom@19.2.4_react@19.2.4/@tanstack/react-table/build/lib/index.cjs");
|
|
8
|
+
const index$4 = require("../../../@tanstack_match-sorter-utils@8.19.4/@tanstack/match-sorter-utils/build/lib/index.cjs");
|
|
9
|
+
const index = require("../../../@tanstack_react-virtual@3.11.2_react-dom@19.2.4_react@19.2.4/@tanstack/react-virtual/dist/esm/index.cjs");
|
|
10
10
|
const hooks = require("@mantine/hooks");
|
|
11
11
|
const dates = require("@mantine/dates");
|
|
12
|
+
const index$1 = require("../../../@tanstack_table-core@8.20.5/@tanstack/table-core/build/lib/index.cjs");
|
|
13
|
+
const index$2 = require("../../../@tanstack_virtual-core@3.11.2/@tanstack/virtual-core/dist/esm/index.cjs");
|
|
12
14
|
const IconX = require("../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconX.cjs");
|
|
13
15
|
const IconSortDescending = require("../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconSortDescending.cjs");
|
|
14
16
|
const IconSortAscending = require("../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconSortAscending.cjs");
|
|
@@ -42,8 +44,6 @@ const IconBaselineDensityMedium = require("../../../@tabler_icons-react@3.18.0_r
|
|
|
42
44
|
const IconBaselineDensityLarge = require("../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconBaselineDensityLarge.cjs");
|
|
43
45
|
const IconArrowsSort = require("../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconArrowsSort.cjs");
|
|
44
46
|
const IconArrowAutofitContent = require("../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconArrowAutofitContent.cjs");
|
|
45
|
-
const index$1 = require("../../../@tanstack_table-core@8.20.5/@tanstack/table-core/build/lib/index.cjs");
|
|
46
|
-
const index$4 = require("../../../@tanstack_virtual-core@3.11.2/@tanstack/virtual-core/dist/esm/index.cjs");
|
|
47
47
|
function __rest(s, e) {
|
|
48
48
|
var t = {};
|
|
49
49
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -401,7 +401,7 @@ const MRT_TableDetailPanel = (_a) => {
|
|
|
401
401
|
const fuzzy$1 = (rowA, rowB, columnId) => {
|
|
402
402
|
let dir = 0;
|
|
403
403
|
if (rowA.columnFiltersMeta[columnId]) {
|
|
404
|
-
dir = index$
|
|
404
|
+
dir = index$4.compareItems(rowA.columnFiltersMeta[columnId], rowB.columnFiltersMeta[columnId]);
|
|
405
405
|
}
|
|
406
406
|
return dir === 0 ? index$1.sortingFns.alphanumeric(rowA, rowB, columnId) : dir;
|
|
407
407
|
};
|
|
@@ -635,7 +635,7 @@ const useMRT_Rows = (table) => {
|
|
|
635
635
|
return rows;
|
|
636
636
|
};
|
|
637
637
|
const extraIndexRangeExtractor = (range, draggingIndex) => {
|
|
638
|
-
const newIndexes = index$
|
|
638
|
+
const newIndexes = index$2.defaultRangeExtractor(range);
|
|
639
639
|
if (draggingIndex === void 0)
|
|
640
640
|
return newIndexes;
|
|
641
641
|
if (draggingIndex >= 0 && draggingIndex < Math.max(range.startIndex - range.overscan, 0)) {
|
|
@@ -657,7 +657,7 @@ const useMRT_RowVirtualizer = (table, rows) => {
|
|
|
657
657
|
});
|
|
658
658
|
const rowCount = (_a = rows === null || rows === void 0 ? void 0 : rows.length) !== null && _a !== void 0 ? _a : getRowModel().rows.length;
|
|
659
659
|
const normalRowHeight = density === "xs" ? 42.7 : density === "md" ? 54.7 : 70.7;
|
|
660
|
-
const rowVirtualizer = index
|
|
660
|
+
const rowVirtualizer = index.useVirtualizer(Object.assign({ count: renderDetailPanel ? rowCount * 2 : rowCount, estimateSize: (index2) => renderDetailPanel && index2 % 2 === 1 ? expanded === true ? 100 : 0 : normalRowHeight, getScrollElement: () => tableContainerRef.current, measureElement: typeof window !== "undefined" && navigator.userAgent.indexOf("Firefox") === -1 ? (element) => element === null || element === void 0 ? void 0 : element.getBoundingClientRect().height : void 0, overscan: 4, rangeExtractor: React.useCallback((range) => {
|
|
661
661
|
var _a2;
|
|
662
662
|
return extraIndexRangeExtractor(range, (_a2 = draggingRow === null || draggingRow === void 0 ? void 0 : draggingRow.index) !== null && _a2 !== void 0 ? _a2 : 0);
|
|
663
663
|
}, [draggingRow]) }, rowVirtualizerProps));
|
|
@@ -1180,8 +1180,8 @@ var classes$m = { "root": "MRT_TableHeadRow-module_root__hUKv4", "layout-mode-gr
|
|
|
1180
1180
|
var classes$l = { "root": "MRT_TableHeadCell-module_root__6y50a", "root-grid": "MRT_TableHeadCell-module_root-grid__bAf1d", "root-virtualized": "MRT_TableHeadCell-module_root-virtualized__CWLit", "root-no-select": "MRT_TableHeadCell-module_root-no-select__BEOVU", "content": "MRT_TableHeadCell-module_content__-pzSK", "content-spaced": "MRT_TableHeadCell-module_content-spaced__S85Aa", "content-center": "MRT_TableHeadCell-module_content-center__c-17L", "content-right": "MRT_TableHeadCell-module_content-right__NSRZU", "content-wrapper": "MRT_TableHeadCell-module_content-wrapper__py6aJ", "content-wrapper-hidden-overflow": "MRT_TableHeadCell-module_content-wrapper-hidden-overflow__QY40r", "content-wrapper-nowrap": "MRT_TableHeadCell-module_content-wrapper-nowrap__-4aIg", "labels": "MRT_TableHeadCell-module_labels__oiMSr", "labels-right": "MRT_TableHeadCell-module_labels-right__6ZJp-", "labels-center": "MRT_TableHeadCell-module_labels-center__MM9q8", "labels-sortable": "MRT_TableHeadCell-module_labels-sortable__tyuLr", "labels-data": "MRT_TableHeadCell-module_labels-data__PvFGO", "content-actions": "MRT_TableHeadCell-module_content-actions__utxbm" };
|
|
1181
1181
|
var classes$k = { "filter-mode-label": "MRT_TableHeadCellFilterContainer-module_filter-mode-label__8reK-" };
|
|
1182
1182
|
const fuzzy = (row, columnId, filterValue, addMeta) => {
|
|
1183
|
-
const itemRank = index$
|
|
1184
|
-
threshold: index$
|
|
1183
|
+
const itemRank = index$4.rankItem(row.getValue(columnId), filterValue, {
|
|
1184
|
+
threshold: index$4.rankings.MATCHES
|
|
1185
1185
|
});
|
|
1186
1186
|
addMeta(itemRank);
|
|
1187
1187
|
return itemRank.passed;
|
|
@@ -2019,7 +2019,7 @@ const MRT_GlobalFilterTextInput = (_a) => {
|
|
|
2019
2019
|
}
|
|
2020
2020
|
} }))] });
|
|
2021
2021
|
};
|
|
2022
|
-
const flexRender = index.flexRender;
|
|
2022
|
+
const flexRender = index$3.flexRender;
|
|
2023
2023
|
function createMRTColumnHelper() {
|
|
2024
2024
|
return {
|
|
2025
2025
|
accessor: (accessor, column) => {
|
|
@@ -2534,7 +2534,7 @@ const useMRT_TableInstance = (definedTableOptions) => {
|
|
|
2534
2534
|
statefulTableOptions.state.isLoading,
|
|
2535
2535
|
statefulTableOptions.state.showSkeletons
|
|
2536
2536
|
]);
|
|
2537
|
-
const table = index.useReactTable(Object.assign(Object.assign({
|
|
2537
|
+
const table = index$3.useReactTable(Object.assign(Object.assign({
|
|
2538
2538
|
onColumnOrderChange,
|
|
2539
2539
|
onColumnSizingInfoChange,
|
|
2540
2540
|
onGroupingChange,
|
|
@@ -2602,7 +2602,7 @@ const useMRT_ColumnVirtualizer = (table) => {
|
|
|
2602
2602
|
const numPinnedLeft = leftPinnedIndexes.length;
|
|
2603
2603
|
const numPinnedRight = rightPinnedIndexes.length;
|
|
2604
2604
|
const draggingColumnIndex = React.useMemo(() => (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) ? visibleColumns.findIndex((c) => c.id === (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id)) : void 0, [draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id]);
|
|
2605
|
-
const columnVirtualizer = index
|
|
2605
|
+
const columnVirtualizer = index.useVirtualizer(Object.assign({ count: visibleColumns.length, estimateSize: (index2) => visibleColumns[index2].getSize(), getScrollElement: () => tableContainerRef.current, horizontal: true, overscan: 3, rangeExtractor: React.useCallback((range) => {
|
|
2606
2606
|
const newIndexes = extraIndexRangeExtractor(range, draggingColumnIndex);
|
|
2607
2607
|
if (!numPinnedLeft && !numPinnedRight) {
|
|
2608
2608
|
return newIndexes;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as codegen } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as codegen } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index3.mjs";
|
|
2
2
|
import { __require as requireCode } from "./code.mjs";
|
|
3
3
|
import { __require as requireScope } from "./scope.mjs";
|
|
4
4
|
var hasRequiredCodegen;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as validate } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as validate } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index5.mjs";
|
|
2
2
|
import { __require as requireBoolSchema } from "./boolSchema.mjs";
|
|
3
3
|
import { __require as requireDataType } from "./dataType.mjs";
|
|
4
4
|
import { __require as requireApplicability } from "./applicability.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as discriminator } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as discriminator } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index4.mjs";
|
|
2
2
|
import { __require as requireCodegen } from "../../compile/codegen/index.mjs";
|
|
3
3
|
import { __require as requireTypes } from "./types.mjs";
|
|
4
4
|
import { __require as requireCompile } from "../../compile/index.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as fastUri } from "../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __module as fastUri } from "../../../../.bundled/jsonforms/esm/_virtual/index11.mjs";
|
|
2
2
|
import { __require as requireUtils } from "./lib/utils.mjs";
|
|
3
3
|
import { __require as requireSchemes } from "./lib/schemes.mjs";
|
|
4
4
|
var hasRequiredFastUri;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as jsonSchemaTraverse } from "../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __module as jsonSchemaTraverse } from "../../../../.bundled/jsonforms/esm/_virtual/index12.mjs";
|
|
2
2
|
var hasRequiredJsonSchemaTraverse;
|
|
3
3
|
function requireJsonSchemaTraverse() {
|
|
4
4
|
if (hasRequiredJsonSchemaTraverse) return jsonSchemaTraverse.exports;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { jsx,
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { clsx } from "../../../clsx@2.1.1/clsx/dist/clsx.mjs";
|
|
3
|
-
import { useRef, useMemo,
|
|
4
|
-
import { useDirection,
|
|
3
|
+
import { memo, useState, useEffect, useRef, useMemo, useCallback, useReducer, createElement, Fragment as Fragment$1, useLayoutEffect } from "react";
|
|
4
|
+
import { useDirection, TableTd, TableTr, Collapse, Skeleton, Select, MultiSelect, TextInput, CopyButton, Tooltip, UnstyledButton, Highlight, Text, Box, ActionIcon, Switch, Radio, Checkbox, Flex, Menu, Transition, Group, Pagination, Progress, Modal, Stack, Button, Badge, Alert, TableThead, TableTh, TableTfoot, useMantineTheme, Popover, Indicator, RangeSlider, Autocomplete, useMantineColorScheme, Table, lighten, darken, TableTbody, LoadingOverlay, Paper } from "@mantine/core";
|
|
5
5
|
import { useReactTable, flexRender as flexRender$1 } from "../../../@tanstack_react-table@8.20.5_react-dom@19.2.4_react@19.2.4/@tanstack/react-table/build/lib/index.mjs";
|
|
6
6
|
import { rankItem, compareItems, rankings } from "../../../@tanstack_match-sorter-utils@8.19.4/@tanstack/match-sorter-utils/build/lib/index.mjs";
|
|
7
7
|
import { useVirtualizer } from "../../../@tanstack_react-virtual@3.11.2_react-dom@19.2.4_react@19.2.4/@tanstack/react-virtual/dist/esm/index.mjs";
|
|
8
8
|
import { useMediaQuery, useDebouncedValue, useHover } from "@mantine/hooks";
|
|
9
9
|
import { DateInput } from "@mantine/dates";
|
|
10
|
+
import { createRow as createRow$1, getSortedRowModel, getPaginationRowModel, getGroupedRowModel, getFilteredRowModel, getFacetedUniqueValues, getFacetedRowModel, getFacetedMinMaxValues, getExpandedRowModel, getCoreRowModel, aggregationFns, filterFns, sortingFns } from "../../../@tanstack_table-core@8.20.5/@tanstack/table-core/build/lib/index.mjs";
|
|
11
|
+
import { defaultRangeExtractor } from "../../../@tanstack_virtual-core@3.11.2/@tanstack/virtual-core/dist/esm/index.mjs";
|
|
10
12
|
import IconX from "../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconX.mjs";
|
|
11
13
|
import IconSortDescending from "../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs";
|
|
12
14
|
import IconSortAscending from "../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs";
|
|
@@ -40,8 +42,6 @@ import IconBaselineDensityMedium from "../../../@tabler_icons-react@3.18.0_react
|
|
|
40
42
|
import IconBaselineDensityLarge from "../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconBaselineDensityLarge.mjs";
|
|
41
43
|
import IconArrowsSort from "../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconArrowsSort.mjs";
|
|
42
44
|
import IconArrowAutofitContent from "../../../@tabler_icons-react@3.18.0_react@19.2.4/@tabler/icons-react/dist/esm/icons/IconArrowAutofitContent.mjs";
|
|
43
|
-
import { getSortedRowModel, getPaginationRowModel, getGroupedRowModel, getFilteredRowModel, getFacetedUniqueValues, getFacetedRowModel, getFacetedMinMaxValues, getExpandedRowModel, getCoreRowModel, createRow as createRow$1, aggregationFns, filterFns, sortingFns } from "../../../@tanstack_table-core@8.20.5/@tanstack/table-core/build/lib/index.mjs";
|
|
44
|
-
import { defaultRangeExtractor } from "../../../@tanstack_virtual-core@3.11.2/@tanstack/virtual-core/dist/esm/index.mjs";
|
|
45
45
|
function __rest(s, e) {
|
|
46
46
|
var t = {};
|
|
47
47
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const useOnLoad = require("./hooks/useOnLoad.cjs");
|
|
4
|
+
const useOptimizations = require("./hooks/useOptimizations.cjs");
|
|
5
|
+
const useQueryOnlyVisibleColumns = require("./hooks/useQueryOnlyVisibleColumns.cjs");
|
|
6
|
+
const useSelection = require("./hooks/useSelection/useSelection.cjs");
|
|
7
|
+
const useView = require("./hooks/useView.cjs");
|
|
8
|
+
const HooksComponent = ({
|
|
9
|
+
useOnLoadProps,
|
|
10
|
+
useViewProps,
|
|
11
|
+
useTableSelectionProps,
|
|
12
|
+
useTableOptimizationsProps,
|
|
13
|
+
useQueryOnlyVisibleColumnsProps
|
|
14
|
+
}) => {
|
|
15
|
+
useOnLoad.useOnLoad(useOnLoadProps);
|
|
16
|
+
useView.useView(useViewProps);
|
|
17
|
+
useSelection.useTableSelection(...useTableSelectionProps);
|
|
18
|
+
useOptimizations.useTableOptimizations(...useTableOptimizationsProps);
|
|
19
|
+
useQueryOnlyVisibleColumns.useQueryOnlyVisibleColumns(...useQueryOnlyVisibleColumnsProps);
|
|
20
|
+
};
|
|
21
|
+
exports.HooksComponent = HooksComponent;
|
|
@@ -13,26 +13,29 @@ const EditDialog = require("../../Dialogs/EditDialog.cjs");
|
|
|
13
13
|
const ViewDialog = require("../../Dialogs/ViewDialog.cjs");
|
|
14
14
|
const LazyLoadWrapper = require("../../Wrappers/LazyLoadWrapper/LazyLoadWrapper.cjs");
|
|
15
15
|
const useApi = require("../../hooks/api/useApi.cjs");
|
|
16
|
-
const useForms = require("../../hooks/api/useForms.cjs");
|
|
17
16
|
const ErrorDialog = require("../DataGrid/ErrorDialog.cjs");
|
|
17
|
+
const HooksComponent = require("./HooksComponent.cjs");
|
|
18
|
+
const zustand = require("./components/OptimizedMRT_RowSelectColumn/zustand.cjs");
|
|
18
19
|
const useActions = require("./hooks/useActions.cjs");
|
|
19
|
-
const useCheckbox = require("./hooks/useCheckbox.cjs");
|
|
20
20
|
const useColumns = require("./hooks/useColumns/useColumns.cjs");
|
|
21
21
|
const useData = require("./hooks/useData.cjs");
|
|
22
22
|
const useEvent = require("./hooks/useEvent.cjs");
|
|
23
23
|
const useFilters = require("./hooks/useFilters.cjs");
|
|
24
24
|
const useGlobalFilter = require("./hooks/useGlobalFilter.cjs");
|
|
25
25
|
const useI18n = require("./hooks/useI18n.cjs");
|
|
26
|
+
const useOptimizations = require("./hooks/useOptimizations.cjs");
|
|
26
27
|
const usePagination = require("./hooks/usePagination.cjs");
|
|
28
|
+
const useSelection = require("./hooks/useSelection/useSelection.cjs");
|
|
27
29
|
const useSize = require("./hooks/useSize.cjs");
|
|
28
30
|
const useSorting = require("./hooks/useSorting.cjs");
|
|
29
31
|
const useToolbar = require("./hooks/useToolbar/useToolbar.cjs");
|
|
30
32
|
const useToolbarAlertBanner = require("./hooks/useToolbarAlertBanner/useToolbarAlertBanner.cjs");
|
|
31
33
|
const MantineReactTable = require("./patch/MantineReactTable.cjs");
|
|
32
34
|
const baseProps = { enableStickyHeader: true, enableColumnPinning: true };
|
|
35
|
+
const defaultProps = { optimizations: { loading: true } };
|
|
33
36
|
const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
34
37
|
var _a, _b, _c, _d, _e;
|
|
35
|
-
const { info,
|
|
38
|
+
const { info, specialKey } = useApi.useApi();
|
|
36
39
|
const propsFromMantineTheme = core.useProps("NextGenDataGrid", {}, {});
|
|
37
40
|
const {
|
|
38
41
|
children,
|
|
@@ -61,6 +64,7 @@ const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
|
61
64
|
wrapperProps,
|
|
62
65
|
memo,
|
|
63
66
|
queryOnlyVisibleColumns,
|
|
67
|
+
optimizations,
|
|
64
68
|
// Deprecated props
|
|
65
69
|
bodySeparator,
|
|
66
70
|
bodyTruncate,
|
|
@@ -71,7 +75,7 @@ const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
|
71
75
|
hideDownload,
|
|
72
76
|
hideFilter,
|
|
73
77
|
...rest
|
|
74
|
-
} = React.useMemo(() => utils.deepMerge(propsFromMantineTheme, props), [props, propsFromMantineTheme]);
|
|
78
|
+
} = React.useMemo(() => utils.deepMerge(defaultProps, propsFromMantineTheme, props), [props, propsFromMantineTheme]);
|
|
75
79
|
if (bodySeparator) {
|
|
76
80
|
Object.keys(body).forEach((col) => {
|
|
77
81
|
body[col] = body[col] || {};
|
|
@@ -149,11 +153,11 @@ const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
|
149
153
|
const globalFilterProps = useGlobalFilter.useGlobalFilter();
|
|
150
154
|
const toolbarProps = useToolbar.useToolbar(toolbar, quickFilters, quickFiltersComponent, hideToolbar, enableAdvancedFilters);
|
|
151
155
|
const eventProps = useEvent.useEvent(onClickEntry);
|
|
152
|
-
const checkboxProps =
|
|
156
|
+
const checkboxProps = useSelection.useSelection(onSelectCheckbox, bulkActions);
|
|
153
157
|
const filterProps = useFilters.useFilters();
|
|
154
|
-
const toolbarAlertBannerProps = useToolbarAlertBanner.useToolbarAlertBanner(toolbar);
|
|
158
|
+
const toolbarAlertBannerProps = useToolbarAlertBanner.useToolbarAlertBanner(toolbar, optimizations);
|
|
155
159
|
const i18nProps = useI18n.useI18n();
|
|
156
|
-
const
|
|
160
|
+
const _mrtProps = React.useMemo(() => {
|
|
157
161
|
const result = utils.deepMerge(
|
|
158
162
|
baseProps,
|
|
159
163
|
{ mantinePaperProps: { ref }, getRowId: utils.getItemId, enableColumnFilters: !enableAdvancedFilters },
|
|
@@ -190,39 +194,28 @@ const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
|
190
194
|
i18nProps,
|
|
191
195
|
table
|
|
192
196
|
]);
|
|
197
|
+
const tableOptions = index_esm.useMRT_TableOptions(_mrtProps);
|
|
198
|
+
const optimizationsProps = useOptimizations.useOptimizations(tableOptions, _mrtProps.columns, optimizations);
|
|
199
|
+
const mrtProps = React.useMemo(() => utils.deepMerge(_mrtProps, optimizationsProps), [_mrtProps, optimizationsProps]);
|
|
193
200
|
const mrtTable = index_esm.useMantineReactTable(mrtProps);
|
|
194
|
-
React.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
React.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
setQueryParams({ columns: visibleColumns.map((col) => col.id) });
|
|
214
|
-
}, [mrtTable.getState().columnVisibility, setQueryParams]);
|
|
215
|
-
const { setView: setViewAdd } = useForms.useForms("add");
|
|
216
|
-
const { setView: setViewEdit } = useForms.useForms("edit");
|
|
217
|
-
React.useEffect(() => {
|
|
218
|
-
var _a2, _b2;
|
|
219
|
-
if ((_a2 = form == null ? void 0 : form.add) == null ? void 0 : _a2.initialView) {
|
|
220
|
-
setViewAdd(form.add.initialView);
|
|
221
|
-
}
|
|
222
|
-
if ((_b2 = form == null ? void 0 : form.edit) == null ? void 0 : _b2.initialView) {
|
|
223
|
-
setViewEdit(form.edit.initialView);
|
|
224
|
-
}
|
|
225
|
-
}, []);
|
|
201
|
+
mrtTable.refs.selectionStoreRef = React.useRef(zustand.selectionStoreFactory());
|
|
202
|
+
mrtTable.refs.options = React.useRef(tableOptions);
|
|
203
|
+
mrtTable.refs.options.current = tableOptions;
|
|
204
|
+
mrtTable.refs.optimizations = React.useRef(optimizations);
|
|
205
|
+
mrtTable.refs.optimizations.current = optimizations;
|
|
206
|
+
const useOnLoadProps = React.useMemo(() => fetchOnMount, [fetchOnMount]);
|
|
207
|
+
const useViewProps = React.useMemo(() => form, [form]);
|
|
208
|
+
const useTableSelectionProps = React.useMemo(
|
|
209
|
+
() => [mrtTable, onSelectCheckbox, bulkActions],
|
|
210
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
211
|
+
[onSelectCheckbox, bulkActions]
|
|
212
|
+
);
|
|
213
|
+
const useTableOptimizationsProps = React.useMemo(
|
|
214
|
+
() => [mrtTable, onSelectCheckbox, bulkActions, optimizations],
|
|
215
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
216
|
+
[onSelectCheckbox, bulkActions, optimizations]
|
|
217
|
+
);
|
|
218
|
+
const useQueryOnlyVisibleColumnsProps = React.useMemo(() => [mrtTable, queryOnlyVisibleColumns], [queryOnlyVisibleColumns]);
|
|
226
219
|
return /* @__PURE__ */ jsxRuntime.jsxs(core.Box, { pos: "relative", h: "100%", w: "100%", mih: 0, flex: 1, ...wrapperProps, children: [
|
|
227
220
|
/* @__PURE__ */ jsxRuntime.jsxs(LazyLoadWrapper.LazyLoadWrapper, { cond: !!info, children: [
|
|
228
221
|
/* @__PURE__ */ jsxRuntime.jsx(ViewDialog.ViewDialog, { ...(_b = form == null ? void 0 : form.view) == null ? void 0 : _b.dialogProps }),
|
|
@@ -230,6 +223,17 @@ const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
|
230
223
|
/* @__PURE__ */ jsxRuntime.jsx(EditDialog.EditDialog, { jsonForms: form == null ? void 0 : form.edit, ...(_d = form == null ? void 0 : form.edit) == null ? void 0 : _d.dialogProps }),
|
|
231
224
|
/* @__PURE__ */ jsxRuntime.jsx(DeleteDialog.DeleteDialog, { ...(_e = form == null ? void 0 : form.delete) == null ? void 0 : _e.dialogProps })
|
|
232
225
|
] }),
|
|
226
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
227
|
+
HooksComponent.HooksComponent,
|
|
228
|
+
{
|
|
229
|
+
table: mrtTable,
|
|
230
|
+
useOnLoadProps,
|
|
231
|
+
useViewProps,
|
|
232
|
+
useTableSelectionProps,
|
|
233
|
+
useTableOptimizationsProps,
|
|
234
|
+
useQueryOnlyVisibleColumnsProps
|
|
235
|
+
}
|
|
236
|
+
),
|
|
233
237
|
/* @__PURE__ */ jsxRuntime.jsx(MantineReactTable.MantineReactTable, { table: mrtTable, ...rest }),
|
|
234
238
|
children == null ? void 0 : children({ table: mrtTable }),
|
|
235
239
|
!hideError ? /* @__PURE__ */ jsxRuntime.jsx(ErrorDialog.ErrorDialog, {}) : null
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const utils = require("fastapi-rtk/utils");
|
|
5
|
+
const index_esm = require("../../../../../../.external/cjs/mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._7jqiyi5sshrifwwn7z7vmkfdl4/mantine-react-table/dist/index.esm.cjs");
|
|
6
|
+
const React = require("react");
|
|
7
|
+
const zustand = require("./zustand.cjs");
|
|
8
|
+
const Cell = ({ renderedRowIndex, row, table }) => {
|
|
9
|
+
const store = table.refs.selectionStoreRef.current;
|
|
10
|
+
const rowId = React.useMemo(() => row.id, [row.id]);
|
|
11
|
+
const checked = zustand.useSelectionStore(store, (state) => state.rowSelection[rowId] ?? false);
|
|
12
|
+
const storeOnChange = zustand.useSelectionStore(store, (state) => state.toggleRowSelected);
|
|
13
|
+
const onChange = React.useMemo(
|
|
14
|
+
() => (event) => {
|
|
15
|
+
event.stopPropagation();
|
|
16
|
+
storeOnChange(rowId);
|
|
17
|
+
},
|
|
18
|
+
[storeOnChange, rowId]
|
|
19
|
+
);
|
|
20
|
+
row.getCanSelect = () => {
|
|
21
|
+
if (typeof table.refs.options.enableRowSelection === "function") {
|
|
22
|
+
return table.refs.options.enableRowSelection(row);
|
|
23
|
+
}
|
|
24
|
+
return table.refs.options.enableRowSelection ?? true;
|
|
25
|
+
};
|
|
26
|
+
const {
|
|
27
|
+
options: { mantineSelectCheckboxProps }
|
|
28
|
+
} = table;
|
|
29
|
+
const checkboxProps = utils.parseFromValuesOrFunc(mantineSelectCheckboxProps, { row, table });
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31
|
+
index_esm.MRT_SelectCheckbox,
|
|
32
|
+
{
|
|
33
|
+
renderedRowIndex,
|
|
34
|
+
row,
|
|
35
|
+
table,
|
|
36
|
+
checked: (checkboxProps == null ? void 0 : checkboxProps.checked) ?? checked,
|
|
37
|
+
onChange: (checkboxProps == null ? void 0 : checkboxProps.onChange) ?? onChange
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
const Header = ({ table }) => {
|
|
42
|
+
const store = table.refs.selectionStoreRef.current;
|
|
43
|
+
const checked = zustand.useSelectionStore(store, (state) => state.getIsAllRowsSelected(table));
|
|
44
|
+
const indeterminate = zustand.useSelectionStore(
|
|
45
|
+
store,
|
|
46
|
+
(state) => !state.getIsAllRowsSelected(table) && state.getIsSomeRowsSelected(table)
|
|
47
|
+
);
|
|
48
|
+
const storeToggleAll = zustand.useSelectionStore(store, (state) => state.toggleAllRowsSelected);
|
|
49
|
+
const onChange = React.useMemo(
|
|
50
|
+
() => (event) => {
|
|
51
|
+
event.stopPropagation();
|
|
52
|
+
storeToggleAll(table, !checked);
|
|
53
|
+
},
|
|
54
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
|
+
[storeToggleAll, checked]
|
|
56
|
+
);
|
|
57
|
+
const {
|
|
58
|
+
options: { mantineSelectAllCheckboxProps }
|
|
59
|
+
} = table;
|
|
60
|
+
const checkboxProps = utils.parseFromValuesOrFunc(mantineSelectAllCheckboxProps, { table });
|
|
61
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
+
index_esm.MRT_SelectCheckbox,
|
|
63
|
+
{
|
|
64
|
+
table,
|
|
65
|
+
checked: (checkboxProps == null ? void 0 : checkboxProps.checked) ?? checked,
|
|
66
|
+
indeterminate: (checkboxProps == null ? void 0 : checkboxProps.indeterminate) ?? indeterminate,
|
|
67
|
+
onChange: (checkboxProps == null ? void 0 : checkboxProps.onChange) ?? onChange
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
const getOptimizedMRT_RowSelectColumnDef = (tableOptions) => {
|
|
72
|
+
const { enableMultiRowSelection, enableSelectAll } = tableOptions;
|
|
73
|
+
return {
|
|
74
|
+
Cell,
|
|
75
|
+
grow: false,
|
|
76
|
+
Header: enableSelectAll && enableMultiRowSelection ? Header : void 0,
|
|
77
|
+
...index_esm.defaultDisplayColumnProps({
|
|
78
|
+
header: "select",
|
|
79
|
+
id: "mrt-row-select",
|
|
80
|
+
size: enableSelectAll ? 60 : 70,
|
|
81
|
+
tableOptions
|
|
82
|
+
})
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
exports.getOptimizedMRT_RowSelectColumnDef = getOptimizedMRT_RowSelectColumnDef;
|
package/dist/core/cjs/Tables/NextGenDataGrid/components/OptimizedMRT_RowSelectColumn/zustand.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const react = require("../../../../../../.external/cjs/zustand@5.0.11_@types_react@19.2.14_react@19.2.4/zustand/esm/react.cjs");
|
|
4
|
+
const selectionStoreFactory = () => react.create((set, get) => ({
|
|
5
|
+
rowSelection: {},
|
|
6
|
+
getIsAllRowsSelected: (table) => {
|
|
7
|
+
const rowModel = table.getRowModel();
|
|
8
|
+
return rowModel.rows.length > 0 && rowModel.rows.every((row) => get().rowSelection[row.id]);
|
|
9
|
+
},
|
|
10
|
+
getIsSomeRowsSelected: (table) => {
|
|
11
|
+
const rowModel = table.getRowModel();
|
|
12
|
+
return rowModel.rows.some((row) => get().rowSelection[row.id]);
|
|
13
|
+
},
|
|
14
|
+
toggleRowSelected: (rowId) => set((state) => {
|
|
15
|
+
const isSelected = state.rowSelection[rowId];
|
|
16
|
+
const newRowSelection = { ...state.rowSelection };
|
|
17
|
+
if (isSelected) {
|
|
18
|
+
delete newRowSelection[rowId];
|
|
19
|
+
} else {
|
|
20
|
+
newRowSelection[rowId] = true;
|
|
21
|
+
}
|
|
22
|
+
return { rowSelection: newRowSelection };
|
|
23
|
+
}),
|
|
24
|
+
toggleAllRowsSelected: (table, value) => set((state) => {
|
|
25
|
+
const newRowSelection = { ...state.rowSelection };
|
|
26
|
+
table.getRowModel().rows.forEach((row) => {
|
|
27
|
+
if (value) {
|
|
28
|
+
newRowSelection[row.id] = true;
|
|
29
|
+
} else {
|
|
30
|
+
delete newRowSelection[row.id];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return { rowSelection: newRowSelection };
|
|
34
|
+
})
|
|
35
|
+
}));
|
|
36
|
+
const useSelectionStore = (store, selector) => store(selector);
|
|
37
|
+
exports.selectionStoreFactory = selectionStoreFactory;
|
|
38
|
+
exports.useSelectionStore = useSelectionStore;
|