fastapi-rtk 1.0.43 → 1.0.45
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/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/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/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/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 +44 -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 +50 -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 +50 -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/cjs/_virtual/_nodeUtil.cjs +4 -0
- package/dist/core/cjs/_virtual/isBuffer.cjs +4 -0
- package/dist/core/cjs/_virtual/isEqual.cjs +6 -0
- package/dist/core/esm/Tables/NextGenDataGrid/HooksComponent.mjs +21 -0
- package/dist/core/esm/Tables/NextGenDataGrid/NextGenDataGrid.mjs +46 -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 +50 -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 +50 -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/esm/_virtual/_nodeUtil.mjs +4 -0
- package/dist/core/esm/_virtual/isBuffer.mjs +4 -0
- package/dist/core/esm/_virtual/isEqual.mjs +7 -0
- package/dist/core/lib/Tables/NextGenDataGrid/HooksComponent.d.ts +7 -0
- package/dist/core/lib/Tables/NextGenDataGrid/NextGenDataGrid.d.ts +19 -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 +36 -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 +5 -1
- package/dist/utils/cjs/useWatchRef/useWatchRef.cjs +28 -0
- 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 +6 -2
- package/dist/utils/esm/useWatchRef/useWatchRef.mjs +28 -0
- 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 +2 -1
- package/dist/utils/lib/useWatchRef/index.d.ts +1 -0
- package/dist/utils/lib/useWatchRef/useWatchRef.d.ts +1 -0
- 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");
|
|
@@ -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,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;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
;/* empty css */
|
|
5
5
|
;/* empty css */
|
|
6
|
+
const constants = require("fastapi-rtk/constants");
|
|
6
7
|
const utils = require("fastapi-rtk/utils");
|
|
7
8
|
const core = require("@mantine/core");
|
|
8
9
|
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");
|
|
@@ -13,26 +14,29 @@ const EditDialog = require("../../Dialogs/EditDialog.cjs");
|
|
|
13
14
|
const ViewDialog = require("../../Dialogs/ViewDialog.cjs");
|
|
14
15
|
const LazyLoadWrapper = require("../../Wrappers/LazyLoadWrapper/LazyLoadWrapper.cjs");
|
|
15
16
|
const useApi = require("../../hooks/api/useApi.cjs");
|
|
16
|
-
const useForms = require("../../hooks/api/useForms.cjs");
|
|
17
17
|
const ErrorDialog = require("../DataGrid/ErrorDialog.cjs");
|
|
18
|
+
const HooksComponent = require("./HooksComponent.cjs");
|
|
19
|
+
const zustand = require("./components/OptimizedMRT_RowSelectColumn/zustand.cjs");
|
|
18
20
|
const useActions = require("./hooks/useActions.cjs");
|
|
19
|
-
const useCheckbox = require("./hooks/useCheckbox.cjs");
|
|
20
21
|
const useColumns = require("./hooks/useColumns/useColumns.cjs");
|
|
21
22
|
const useData = require("./hooks/useData.cjs");
|
|
22
23
|
const useEvent = require("./hooks/useEvent.cjs");
|
|
23
24
|
const useFilters = require("./hooks/useFilters.cjs");
|
|
24
25
|
const useGlobalFilter = require("./hooks/useGlobalFilter.cjs");
|
|
25
26
|
const useI18n = require("./hooks/useI18n.cjs");
|
|
27
|
+
const useOptimizations = require("./hooks/useOptimizations.cjs");
|
|
26
28
|
const usePagination = require("./hooks/usePagination.cjs");
|
|
29
|
+
const useSelection = require("./hooks/useSelection/useSelection.cjs");
|
|
27
30
|
const useSize = require("./hooks/useSize.cjs");
|
|
28
31
|
const useSorting = require("./hooks/useSorting.cjs");
|
|
29
32
|
const useToolbar = require("./hooks/useToolbar/useToolbar.cjs");
|
|
30
33
|
const useToolbarAlertBanner = require("./hooks/useToolbarAlertBanner/useToolbarAlertBanner.cjs");
|
|
31
34
|
const MantineReactTable = require("./patch/MantineReactTable.cjs");
|
|
32
35
|
const baseProps = { enableStickyHeader: true, enableColumnPinning: true };
|
|
36
|
+
const defaultProps = { optimizations: { loading: true, selectionSyncDelay: constants.DEBOUNCE_DELAY } };
|
|
33
37
|
const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
34
38
|
var _a, _b, _c, _d, _e;
|
|
35
|
-
const { info,
|
|
39
|
+
const { info, specialKey } = useApi.useApi();
|
|
36
40
|
const propsFromMantineTheme = core.useProps("NextGenDataGrid", {}, {});
|
|
37
41
|
const {
|
|
38
42
|
children,
|
|
@@ -61,6 +65,7 @@ const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
|
61
65
|
wrapperProps,
|
|
62
66
|
memo,
|
|
63
67
|
queryOnlyVisibleColumns,
|
|
68
|
+
optimizations,
|
|
64
69
|
// Deprecated props
|
|
65
70
|
bodySeparator,
|
|
66
71
|
bodyTruncate,
|
|
@@ -71,7 +76,7 @@ const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
|
71
76
|
hideDownload,
|
|
72
77
|
hideFilter,
|
|
73
78
|
...rest
|
|
74
|
-
} = React.useMemo(() => utils.deepMerge(propsFromMantineTheme, props), [props, propsFromMantineTheme]);
|
|
79
|
+
} = React.useMemo(() => utils.deepMerge(defaultProps, propsFromMantineTheme, props), [props, propsFromMantineTheme]);
|
|
75
80
|
if (bodySeparator) {
|
|
76
81
|
Object.keys(body).forEach((col) => {
|
|
77
82
|
body[col] = body[col] || {};
|
|
@@ -149,11 +154,11 @@ const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
|
149
154
|
const globalFilterProps = useGlobalFilter.useGlobalFilter();
|
|
150
155
|
const toolbarProps = useToolbar.useToolbar(toolbar, quickFilters, quickFiltersComponent, hideToolbar, enableAdvancedFilters);
|
|
151
156
|
const eventProps = useEvent.useEvent(onClickEntry);
|
|
152
|
-
const checkboxProps =
|
|
157
|
+
const checkboxProps = useSelection.useSelection(onSelectCheckbox, bulkActions, optimizations);
|
|
153
158
|
const filterProps = useFilters.useFilters();
|
|
154
|
-
const toolbarAlertBannerProps = useToolbarAlertBanner.useToolbarAlertBanner(toolbar);
|
|
159
|
+
const toolbarAlertBannerProps = useToolbarAlertBanner.useToolbarAlertBanner(toolbar, optimizations);
|
|
155
160
|
const i18nProps = useI18n.useI18n();
|
|
156
|
-
const
|
|
161
|
+
const _mrtProps = React.useMemo(() => {
|
|
157
162
|
const result = utils.deepMerge(
|
|
158
163
|
baseProps,
|
|
159
164
|
{ mantinePaperProps: { ref }, getRowId: utils.getItemId, enableColumnFilters: !enableAdvancedFilters },
|
|
@@ -190,39 +195,28 @@ const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
|
190
195
|
i18nProps,
|
|
191
196
|
table
|
|
192
197
|
]);
|
|
198
|
+
const tableOptions = index_esm.useMRT_TableOptions(_mrtProps);
|
|
199
|
+
const optimizationsProps = useOptimizations.useOptimizations(tableOptions, _mrtProps.columns, optimizations);
|
|
200
|
+
const mrtProps = React.useMemo(() => utils.deepMerge(_mrtProps, optimizationsProps), [_mrtProps, optimizationsProps]);
|
|
193
201
|
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
|
-
}, []);
|
|
202
|
+
mrtTable.refs.selectionStoreRef = React.useRef(zustand.selectionStoreFactory());
|
|
203
|
+
mrtTable.refs.options = React.useRef(tableOptions);
|
|
204
|
+
mrtTable.refs.options.current = tableOptions;
|
|
205
|
+
mrtTable.refs.optimizations = React.useRef(optimizations);
|
|
206
|
+
mrtTable.refs.optimizations.current = optimizations;
|
|
207
|
+
const useOnLoadProps = React.useMemo(() => fetchOnMount, [fetchOnMount]);
|
|
208
|
+
const useViewProps = React.useMemo(() => form, [form]);
|
|
209
|
+
const useTableSelectionProps = React.useMemo(
|
|
210
|
+
() => [mrtTable, onSelectCheckbox, bulkActions],
|
|
211
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
212
|
+
[onSelectCheckbox, bulkActions]
|
|
213
|
+
);
|
|
214
|
+
const useTableOptimizationsProps = React.useMemo(
|
|
215
|
+
() => [mrtTable, onSelectCheckbox, bulkActions, optimizations],
|
|
216
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
217
|
+
[onSelectCheckbox, bulkActions, optimizations]
|
|
218
|
+
);
|
|
219
|
+
const useQueryOnlyVisibleColumnsProps = React.useMemo(() => [mrtTable, queryOnlyVisibleColumns], [queryOnlyVisibleColumns]);
|
|
226
220
|
return /* @__PURE__ */ jsxRuntime.jsxs(core.Box, { pos: "relative", h: "100%", w: "100%", mih: 0, flex: 1, ...wrapperProps, children: [
|
|
227
221
|
/* @__PURE__ */ jsxRuntime.jsxs(LazyLoadWrapper.LazyLoadWrapper, { cond: !!info, children: [
|
|
228
222
|
/* @__PURE__ */ jsxRuntime.jsx(ViewDialog.ViewDialog, { ...(_b = form == null ? void 0 : form.view) == null ? void 0 : _b.dialogProps }),
|
|
@@ -230,6 +224,17 @@ const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
|
230
224
|
/* @__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
225
|
/* @__PURE__ */ jsxRuntime.jsx(DeleteDialog.DeleteDialog, { ...(_e = form == null ? void 0 : form.delete) == null ? void 0 : _e.dialogProps })
|
|
232
226
|
] }),
|
|
227
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
228
|
+
HooksComponent.HooksComponent,
|
|
229
|
+
{
|
|
230
|
+
table: mrtTable,
|
|
231
|
+
useOnLoadProps,
|
|
232
|
+
useViewProps,
|
|
233
|
+
useTableSelectionProps,
|
|
234
|
+
useTableOptimizationsProps,
|
|
235
|
+
useQueryOnlyVisibleColumnsProps
|
|
236
|
+
}
|
|
237
|
+
),
|
|
233
238
|
/* @__PURE__ */ jsxRuntime.jsx(MantineReactTable.MantineReactTable, { table: mrtTable, ...rest }),
|
|
234
239
|
children == null ? void 0 : children({ table: mrtTable }),
|
|
235
240
|
!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,50 @@
|
|
|
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
|
+
refs: /* @__PURE__ */ new Set(),
|
|
7
|
+
getSelectedRows: () => Object.keys(get().rowSelection),
|
|
8
|
+
setSelectedRows: (ids) => set(() => {
|
|
9
|
+
const newRowSelection = {};
|
|
10
|
+
ids.forEach((id) => {
|
|
11
|
+
newRowSelection[id] = true;
|
|
12
|
+
});
|
|
13
|
+
get().refs.forEach((ref) => ref.current = ids);
|
|
14
|
+
return { rowSelection: newRowSelection };
|
|
15
|
+
}),
|
|
16
|
+
getIsAllRowsSelected: (table) => {
|
|
17
|
+
const rowModel = table.getRowModel();
|
|
18
|
+
return rowModel.rows.length > 0 && rowModel.rows.every((row) => get().rowSelection[row.id]);
|
|
19
|
+
},
|
|
20
|
+
getIsSomeRowsSelected: (table) => {
|
|
21
|
+
const rowModel = table.getRowModel();
|
|
22
|
+
return rowModel.rows.some((row) => get().rowSelection[row.id]);
|
|
23
|
+
},
|
|
24
|
+
toggleRowSelected: (rowId) => set((state) => {
|
|
25
|
+
const isSelected = state.rowSelection[rowId];
|
|
26
|
+
const newRowSelection = { ...state.rowSelection };
|
|
27
|
+
if (isSelected) {
|
|
28
|
+
delete newRowSelection[rowId];
|
|
29
|
+
} else {
|
|
30
|
+
newRowSelection[rowId] = true;
|
|
31
|
+
}
|
|
32
|
+
get().refs.forEach((ref) => ref.current = Object.keys(newRowSelection));
|
|
33
|
+
return { rowSelection: newRowSelection };
|
|
34
|
+
}),
|
|
35
|
+
toggleAllRowsSelected: (table, value) => set((state) => {
|
|
36
|
+
const newRowSelection = { ...state.rowSelection };
|
|
37
|
+
table.getRowModel().rows.forEach((row) => {
|
|
38
|
+
if (value) {
|
|
39
|
+
newRowSelection[row.id] = true;
|
|
40
|
+
} else {
|
|
41
|
+
delete newRowSelection[row.id];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
get().refs.forEach((ref) => ref.current = Object.keys(newRowSelection));
|
|
45
|
+
return { rowSelection: newRowSelection };
|
|
46
|
+
})
|
|
47
|
+
}));
|
|
48
|
+
const useSelectionStore = (store, selector) => store(selector);
|
|
49
|
+
exports.selectionStoreFactory = selectionStoreFactory;
|
|
50
|
+
exports.useSelectionStore = useSelectionStore;
|
|
@@ -156,10 +156,6 @@ function ColumnHeaderFilterInput({
|
|
|
156
156
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
157
157
|
[actionIconProps]
|
|
158
158
|
);
|
|
159
|
-
const configuration = React.useMemo(
|
|
160
|
-
() => utils.parseFromValuesOrFunc(enableFilterModes ? utils.mergeProps(filterProps, opr) : filterProps, functionProps),
|
|
161
|
-
[enableFilterModes, filterProps, functionProps, opr]
|
|
162
|
-
);
|
|
163
159
|
const headerInputProps = React.useMemo(
|
|
164
160
|
() => {
|
|
165
161
|
var _a2, _b2;
|
|
@@ -209,13 +205,20 @@ function ColumnHeaderFilterInput({
|
|
|
209
205
|
if (node) {
|
|
210
206
|
mrtProps.table.refs.filterInputRefs.current[`${mrtProps.column.id}-0`] = node;
|
|
211
207
|
}
|
|
212
|
-
}
|
|
213
|
-
...field.isDirty() ? { clearIcon: /* @__PURE__ */ jsxRuntime.jsx(core.CloseButton, { ...clearIconProps }) } : {},
|
|
214
|
-
...configuration,
|
|
215
|
-
cleariconprops: clearIconProps
|
|
208
|
+
}
|
|
216
209
|
};
|
|
217
210
|
},
|
|
218
|
-
|
|
211
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
212
|
+
[filters.length, t]
|
|
213
|
+
);
|
|
214
|
+
const headerIconProps = React.useMemo(
|
|
215
|
+
() => field.isDirty() ? { clearIcon: /* @__PURE__ */ jsxRuntime.jsx(core.CloseButton, { ...clearIconProps }), cleariconprops: clearIconProps } : {},
|
|
216
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
217
|
+
[clearIconProps, field.isDirty()]
|
|
218
|
+
);
|
|
219
|
+
const configuration = utils.parseFromValuesOrFunc(
|
|
220
|
+
enableFilterModes ? utils.mergeProps(filterProps, opr) : filterProps,
|
|
221
|
+
functionProps
|
|
219
222
|
);
|
|
220
223
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
221
224
|
utils.MemoWrapper,
|
|
@@ -224,7 +227,19 @@ function ColumnHeaderFilterInput({
|
|
|
224
227
|
component,
|
|
225
228
|
value: field.getInputProps().value,
|
|
226
229
|
headerInputProps,
|
|
227
|
-
|
|
230
|
+
headerIconProps,
|
|
231
|
+
configuration,
|
|
232
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
233
|
+
HeaderInput.HeaderInput,
|
|
234
|
+
{
|
|
235
|
+
component,
|
|
236
|
+
field,
|
|
237
|
+
...field.getInputProps(),
|
|
238
|
+
...headerInputProps,
|
|
239
|
+
...headerIconProps,
|
|
240
|
+
...configuration
|
|
241
|
+
}
|
|
242
|
+
)
|
|
228
243
|
}
|
|
229
244
|
);
|
|
230
245
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const useApi = require("../../../hooks/api/useApi.cjs");
|
|
5
|
+
const useOnLoad = (fetchOnMount) => {
|
|
6
|
+
const { queryParams, refetch } = useApi.useApi();
|
|
7
|
+
React.useEffect(() => {
|
|
8
|
+
if (!queryParams && fetchOnMount) {
|
|
9
|
+
refetch();
|
|
10
|
+
}
|
|
11
|
+
}, []);
|
|
12
|
+
};
|
|
13
|
+
exports.useOnLoad = useOnLoad;
|