@dmsi/wedgekit-react 0.0.643 → 0.0.645
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/{chunk-XX5GVIPZ.js → chunk-3MV3KMQH.js} +2 -2
- package/dist/{chunk-V7GPM6Z3.js → chunk-3PBA2EZ5.js} +1 -1
- package/dist/{chunk-3R3AY5MT.js → chunk-B3T7KBDA.js} +1 -1
- package/dist/{chunk-FIOXWZWU.js → chunk-ECYXZZWC.js} +1 -1
- package/dist/{chunk-RQMOWYB7.js → chunk-EXCAOI2L.js} +3 -3
- package/dist/{chunk-MQB6BSRX.js → chunk-FCGPQNS2.js} +1 -1
- package/dist/{chunk-SJ3SULQB.js → chunk-FJXWYGB7.js} +7 -7
- package/dist/{chunk-QJZ3XHNH.js → chunk-HCHKYUNQ.js} +19 -5
- package/dist/{chunk-5JHKFK73.js → chunk-HIGNJAQA.js} +2 -2
- package/dist/{chunk-IATOG76G.js → chunk-ISRG77J6.js} +1 -1
- package/dist/{chunk-UB3GEENN.js → chunk-OZEKRO4L.js} +1 -1
- package/dist/{chunk-LGX34HML.js → chunk-Q4AANHJY.js} +1 -1
- package/dist/{chunk-PS7MBNUT.js → chunk-REC2XOPI.js} +1 -1
- package/dist/{chunk-ARWHCWG7.js → chunk-XT4BQXSX.js} +1 -1
- package/dist/{chunk-YR4ZO2XL.js → chunk-ZSRTAMSW.js} +56 -23
- package/dist/components/CalendarRange.cjs +202 -180
- package/dist/components/CalendarRange.js +15 -15
- package/dist/components/CompactImagesPreview.cjs +6 -3
- package/dist/components/CompactImagesPreview.js +3 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +202 -180
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +15 -15
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +202 -180
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +15 -15
- package/dist/components/DataGrid/PinnedColumns.cjs +202 -180
- package/dist/components/DataGrid/PinnedColumns.js +15 -15
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +202 -180
- package/dist/components/DataGrid/TableBody/LoadingCell.js +15 -15
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +202 -180
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +15 -15
- package/dist/components/DataGrid/TableBody/index.cjs +202 -180
- package/dist/components/DataGrid/TableBody/index.js +15 -15
- package/dist/components/DataGrid/index.cjs +203 -181
- package/dist/components/DataGrid/index.js +15 -15
- package/dist/components/DataGrid/utils.cjs +202 -180
- package/dist/components/DataGrid/utils.js +15 -15
- package/dist/components/DataGridCell.cjs +61 -58
- package/dist/components/DataGridCell.js +6 -6
- package/dist/components/DateInput.cjs +195 -173
- package/dist/components/DateInput.js +15 -15
- package/dist/components/DateRangeInput.cjs +208 -186
- package/dist/components/DateRangeInput.js +15 -15
- package/dist/components/Menu.cjs +15 -12
- package/dist/components/Menu.js +4 -4
- package/dist/components/MenuOption.cjs +8 -5
- package/dist/components/MenuOption.js +3 -3
- package/dist/components/MobileDataGrid/ColumnList.js +4 -4
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +206 -184
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +15 -15
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +3 -3
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +206 -184
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +15 -15
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +3 -3
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +19 -16
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +6 -6
- package/dist/components/MobileDataGrid/index.cjs +215 -193
- package/dist/components/MobileDataGrid/index.js +15 -15
- package/dist/components/Modal.cjs +15 -12
- package/dist/components/Modal.js +3 -3
- package/dist/components/NestedMenu.cjs +11 -8
- package/dist/components/NestedMenu.js +3 -3
- package/dist/components/PDFViewer/index.cjs +31 -28
- package/dist/components/PDFViewer/index.js +3 -3
- package/dist/components/ProductImagePreview/index.cjs +18 -15
- package/dist/components/ProductImagePreview/index.js +3 -3
- package/dist/components/ProjectBar.cjs +3 -0
- package/dist/components/ProjectBar.js +2 -2
- package/dist/components/Time.js +1 -1
- package/dist/components/index.cjs +263 -241
- package/dist/components/index.js +15 -15
- package/dist/components/useMenuSystem.cjs +22 -19
- package/dist/components/useMenuSystem.js +3 -3
- package/dist/hooks/index.cjs +76 -26
- package/dist/hooks/index.js +4 -2
- package/dist/utils/index.cjs +21 -5
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
|
@@ -62,7 +62,7 @@ __export(ColumnSelector_exports, {
|
|
|
62
62
|
ColumnSelector: () => ColumnSelector
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(ColumnSelector_exports);
|
|
65
|
-
var
|
|
65
|
+
var import_react40 = require("react");
|
|
66
66
|
|
|
67
67
|
// src/components/DataGridCell.tsx
|
|
68
68
|
var import_sortable = require("@dnd-kit/sortable");
|
|
@@ -117,7 +117,7 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
117
117
|
|
|
118
118
|
// src/components/DataGridCell.tsx
|
|
119
119
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
120
|
-
var
|
|
120
|
+
var import_react12 = require("react");
|
|
121
121
|
|
|
122
122
|
// src/classNames.ts
|
|
123
123
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
@@ -261,7 +261,7 @@ var gapUsingContainerPadding = (0, import_clsx.default)(
|
|
|
261
261
|
|
|
262
262
|
// src/components/MenuOption.tsx
|
|
263
263
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
264
|
-
var
|
|
264
|
+
var import_react7 = require("react");
|
|
265
265
|
|
|
266
266
|
// src/components/Label.tsx
|
|
267
267
|
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
@@ -595,11 +595,24 @@ function formatDate(date) {
|
|
|
595
595
|
|
|
596
596
|
// src/utils/mergeObjectArrays.ts
|
|
597
597
|
function mergeObjectArrays(arr1, arr2) {
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
598
|
+
const arr2Map = /* @__PURE__ */ new Map();
|
|
599
|
+
for (const item of arr2) {
|
|
600
|
+
const id = item.id;
|
|
601
|
+
if (id !== void 0) {
|
|
602
|
+
arr2Map.set(id, item);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return arr1.map((item1) => {
|
|
606
|
+
const id = item1.id;
|
|
607
|
+
if (id !== void 0 && arr2Map.has(id)) {
|
|
608
|
+
const item2 = arr2Map.get(id);
|
|
609
|
+
const meta1 = item1.meta;
|
|
610
|
+
const meta2 = item2.meta;
|
|
611
|
+
const mergedMeta = meta1 && meta2 && typeof meta1 === "object" && typeof meta2 === "object" ? __spreadValues(__spreadValues({}, meta1), meta2) : meta2 != null ? meta2 : meta1;
|
|
612
|
+
return __spreadProps(__spreadValues(__spreadValues({}, item1), item2), { meta: mergedMeta });
|
|
613
|
+
}
|
|
614
|
+
return item1;
|
|
615
|
+
});
|
|
603
616
|
}
|
|
604
617
|
|
|
605
618
|
// src/utils/index.ts
|
|
@@ -635,52 +648,58 @@ var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
|
|
|
635
648
|
function useTableLayout(initialColumns, key, autosync = true) {
|
|
636
649
|
const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
|
|
637
650
|
const [isReady, setIsReady] = (0, import_react5.useState)(false);
|
|
638
|
-
const
|
|
651
|
+
const isReadyRef = (0, import_react5.useRef)(false);
|
|
652
|
+
const keyRef = (0, import_react5.useRef)(key);
|
|
653
|
+
(0, import_react5.useEffect)(() => {
|
|
654
|
+
isReadyRef.current = isReady;
|
|
655
|
+
keyRef.current = key;
|
|
656
|
+
}, [isReady, key]);
|
|
639
657
|
const handleSaveLayout = (0, import_react5.useCallback)(
|
|
640
658
|
(setter, _internal) => {
|
|
641
|
-
if (!
|
|
659
|
+
if (!isReadyRef.current && !_internal || !keyRef.current) return;
|
|
642
660
|
setColumns((prevColumns) => {
|
|
643
661
|
const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
|
|
644
|
-
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
|
|
662
|
+
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal) {
|
|
645
663
|
return prevColumns;
|
|
664
|
+
}
|
|
646
665
|
localStorage.setItem(
|
|
647
|
-
getLocalStorageKeyWithPrefix(`${
|
|
666
|
+
getLocalStorageKeyWithPrefix(`${keyRef.current}-tableLayout`),
|
|
648
667
|
JSON.stringify(newColumns)
|
|
649
668
|
);
|
|
650
669
|
return newColumns;
|
|
651
670
|
});
|
|
652
671
|
},
|
|
653
|
-
[
|
|
672
|
+
[]
|
|
654
673
|
);
|
|
655
674
|
(0, import_react5.useEffect)(() => {
|
|
656
675
|
if (!autosync) return;
|
|
657
|
-
if (!key)
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
`useTableLayout should only be called once per component render cycle.
|
|
661
|
-
${renderCountRef.current} Renders detected.
|
|
662
|
-
Check dependency stability`
|
|
663
|
-
);
|
|
676
|
+
if (!key) {
|
|
677
|
+
setIsReady(true);
|
|
678
|
+
return;
|
|
664
679
|
}
|
|
665
|
-
renderCountRef.current += 1;
|
|
666
680
|
const savedLayout = localStorage.getItem(
|
|
667
681
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
668
682
|
);
|
|
669
683
|
if (savedLayout) {
|
|
670
|
-
|
|
684
|
+
setColumns(
|
|
671
685
|
mergeObjectArrays(
|
|
672
686
|
initialColumns,
|
|
673
687
|
JSON.parse(savedLayout)
|
|
674
|
-
)
|
|
675
|
-
true
|
|
688
|
+
)
|
|
676
689
|
);
|
|
690
|
+
} else {
|
|
691
|
+
localStorage.setItem(
|
|
692
|
+
getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
|
|
693
|
+
JSON.stringify(initialColumns)
|
|
694
|
+
);
|
|
695
|
+
setColumns((prev) => {
|
|
696
|
+
if (JSON.stringify(initialColumns) === JSON.stringify(prev))
|
|
697
|
+
return prev;
|
|
698
|
+
return initialColumns;
|
|
699
|
+
});
|
|
677
700
|
}
|
|
678
|
-
if (!savedLayout) handleSaveLayout(initialColumns, true);
|
|
679
701
|
setIsReady(true);
|
|
680
|
-
|
|
681
|
-
renderCountRef.current = 0;
|
|
682
|
-
};
|
|
683
|
-
}, [handleSaveLayout, initialColumns, key, autosync]);
|
|
702
|
+
}, [initialColumns, key, autosync]);
|
|
684
703
|
const getSavedLayout = (0, import_react5.useCallback)(() => {
|
|
685
704
|
const savedLayout = localStorage.getItem(
|
|
686
705
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
@@ -692,6 +711,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
692
711
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
693
712
|
}
|
|
694
713
|
|
|
714
|
+
// src/hooks/useEditCell.tsx
|
|
715
|
+
var import_react6 = require("react");
|
|
716
|
+
|
|
695
717
|
// src/components/Caption.tsx
|
|
696
718
|
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
697
719
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -843,12 +865,12 @@ var MenuOption = ({
|
|
|
843
865
|
onMouseMove,
|
|
844
866
|
small = false
|
|
845
867
|
}) => {
|
|
846
|
-
const uniqueId = (0,
|
|
847
|
-
const internalRef = (0,
|
|
868
|
+
const uniqueId = (0, import_react7.useId)();
|
|
869
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
848
870
|
const actualRef = ref || internalRef;
|
|
849
|
-
const menuId = (0,
|
|
871
|
+
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
850
872
|
const isMobile = useMatchesMobile();
|
|
851
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
873
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
852
874
|
const handleMouseEnter = () => {
|
|
853
875
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
854
876
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1008,27 +1030,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1008
1030
|
|
|
1009
1031
|
// src/components/Menu.tsx
|
|
1010
1032
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
1011
|
-
var
|
|
1033
|
+
var import_react9 = require("react");
|
|
1012
1034
|
var import_react_dom = require("react-dom");
|
|
1013
1035
|
|
|
1014
1036
|
// src/components/useMenuSystem.tsx
|
|
1015
|
-
var
|
|
1037
|
+
var import_react8 = require("react");
|
|
1016
1038
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1017
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1039
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
1018
1040
|
{}
|
|
1019
1041
|
);
|
|
1020
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1021
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1042
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
1043
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
1022
1044
|
null
|
|
1023
1045
|
);
|
|
1024
|
-
const menuRootRef = (0,
|
|
1025
|
-
const subMenuRefs = (0,
|
|
1026
|
-
const hoverTimeoutRef = (0,
|
|
1027
|
-
const closeTimeoutRef = (0,
|
|
1028
|
-
const mouseStopTimeoutRef = (0,
|
|
1029
|
-
const isMouseMovingRef = (0,
|
|
1030
|
-
const pendingOpenActionRef = (0,
|
|
1031
|
-
const pendingCloseActionRef = (0,
|
|
1046
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
1047
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
1048
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
1049
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
1050
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
1051
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
1052
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
1053
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
1032
1054
|
const isMobile = useMatchesMobile();
|
|
1033
1055
|
const toggleMenu = (menuId, level) => {
|
|
1034
1056
|
if (closeTimeoutRef.current) {
|
|
@@ -1068,7 +1090,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1068
1090
|
return newActiveMenus;
|
|
1069
1091
|
});
|
|
1070
1092
|
};
|
|
1071
|
-
const executePendingActions = (0,
|
|
1093
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
1072
1094
|
if (pendingCloseActionRef.current) {
|
|
1073
1095
|
pendingCloseActionRef.current();
|
|
1074
1096
|
pendingCloseActionRef.current = null;
|
|
@@ -1157,7 +1179,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1157
1179
|
const isMenuActive = (menuId, level) => {
|
|
1158
1180
|
return activeMenus[level] === menuId;
|
|
1159
1181
|
};
|
|
1160
|
-
(0,
|
|
1182
|
+
(0, import_react8.useEffect)(() => {
|
|
1161
1183
|
const handleClickOutside = (event) => {
|
|
1162
1184
|
var _a;
|
|
1163
1185
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1176,7 +1198,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1176
1198
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1177
1199
|
};
|
|
1178
1200
|
}, [activeMenus]);
|
|
1179
|
-
(0,
|
|
1201
|
+
(0, import_react8.useEffect)(() => {
|
|
1180
1202
|
return () => {
|
|
1181
1203
|
if (hoverTimeoutRef.current) {
|
|
1182
1204
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1254,13 +1276,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1254
1276
|
};
|
|
1255
1277
|
}
|
|
1256
1278
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1257
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1279
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1258
1280
|
top: 0,
|
|
1259
1281
|
left: 0,
|
|
1260
1282
|
minWidth: 0
|
|
1261
1283
|
});
|
|
1262
1284
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1263
|
-
const updatePosition = (0,
|
|
1285
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1264
1286
|
var _a, _b, _c;
|
|
1265
1287
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1266
1288
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1308,7 +1330,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1308
1330
|
minWidth: triggerRect.width
|
|
1309
1331
|
});
|
|
1310
1332
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1311
|
-
(0,
|
|
1333
|
+
(0, import_react8.useEffect)(() => {
|
|
1312
1334
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1313
1335
|
const handleClickOutside = (event) => {
|
|
1314
1336
|
var _a, _b, _c, _d, _e;
|
|
@@ -1334,7 +1356,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1334
1356
|
options == null ? void 0 : options.menuRef,
|
|
1335
1357
|
options == null ? void 0 : options.additionalRefs
|
|
1336
1358
|
]);
|
|
1337
|
-
(0,
|
|
1359
|
+
(0, import_react8.useEffect)(() => {
|
|
1338
1360
|
updatePosition();
|
|
1339
1361
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1340
1362
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1415,9 +1437,9 @@ var Menu = (_a) => {
|
|
|
1415
1437
|
"menuName",
|
|
1416
1438
|
"calculateMinMaxHeight"
|
|
1417
1439
|
]);
|
|
1418
|
-
const internalRef = (0,
|
|
1440
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1419
1441
|
const actualRef = ref || internalRef;
|
|
1420
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1442
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1421
1443
|
const isMobile = useMatchesMobile();
|
|
1422
1444
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1423
1445
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1430,7 +1452,7 @@ var Menu = (_a) => {
|
|
|
1430
1452
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1431
1453
|
}
|
|
1432
1454
|
);
|
|
1433
|
-
(0,
|
|
1455
|
+
(0, import_react9.useEffect)(() => {
|
|
1434
1456
|
if (calculateMinMaxHeight) {
|
|
1435
1457
|
return;
|
|
1436
1458
|
}
|
|
@@ -1454,7 +1476,7 @@ var Menu = (_a) => {
|
|
|
1454
1476
|
cancelAnimationFrame(raf);
|
|
1455
1477
|
};
|
|
1456
1478
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1457
|
-
(0,
|
|
1479
|
+
(0, import_react9.useEffect)(() => {
|
|
1458
1480
|
if (!calculateMinMaxHeight) {
|
|
1459
1481
|
return;
|
|
1460
1482
|
}
|
|
@@ -1465,14 +1487,14 @@ var Menu = (_a) => {
|
|
|
1465
1487
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1466
1488
|
}
|
|
1467
1489
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1468
|
-
(0,
|
|
1490
|
+
(0, import_react9.useEffect)(() => {
|
|
1469
1491
|
if (!show) {
|
|
1470
1492
|
return;
|
|
1471
1493
|
}
|
|
1472
1494
|
initializeMenuFocus();
|
|
1473
1495
|
updatePosition();
|
|
1474
1496
|
}, [show, updatePosition]);
|
|
1475
|
-
(0,
|
|
1497
|
+
(0, import_react9.useEffect)(() => {
|
|
1476
1498
|
if (!show || !setShow) {
|
|
1477
1499
|
return;
|
|
1478
1500
|
}
|
|
@@ -1626,10 +1648,10 @@ var Menu = (_a) => {
|
|
|
1626
1648
|
Menu.displayName = "Menu";
|
|
1627
1649
|
|
|
1628
1650
|
// src/components/Search.tsx
|
|
1629
|
-
var
|
|
1651
|
+
var import_react11 = require("react");
|
|
1630
1652
|
|
|
1631
1653
|
// src/components/Input.tsx
|
|
1632
|
-
var
|
|
1654
|
+
var import_react10 = require("react");
|
|
1633
1655
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1634
1656
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1635
1657
|
var InputBase = (_a) => {
|
|
@@ -1686,9 +1708,9 @@ var InputBase = (_a) => {
|
|
|
1686
1708
|
"data-error": error && !focus || null,
|
|
1687
1709
|
"data-focus": focus || null
|
|
1688
1710
|
};
|
|
1689
|
-
const inputRef = (0,
|
|
1711
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
1690
1712
|
const inputId = id ? `${id}-input` : void 0;
|
|
1691
|
-
(0,
|
|
1713
|
+
(0, import_react10.useEffect)(() => {
|
|
1692
1714
|
var _a2;
|
|
1693
1715
|
const input = inputRef.current;
|
|
1694
1716
|
const focusHandler = () => {
|
|
@@ -1847,15 +1869,15 @@ var Input = (_a) => {
|
|
|
1847
1869
|
"testid",
|
|
1848
1870
|
"rightAdornment"
|
|
1849
1871
|
]);
|
|
1850
|
-
const [internalValue, setInternalValue] = (0,
|
|
1851
|
-
const [displayValue, setDisplayValue] = (0,
|
|
1852
|
-
(0,
|
|
1872
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
1873
|
+
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
1874
|
+
(0, import_react10.useEffect)(() => {
|
|
1853
1875
|
var _a2;
|
|
1854
1876
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
1855
1877
|
setInternalValue(stringValue);
|
|
1856
1878
|
setDisplayValue(stringValue);
|
|
1857
1879
|
}, [propValue]);
|
|
1858
|
-
(0,
|
|
1880
|
+
(0, import_react10.useEffect)(() => {
|
|
1859
1881
|
var _a2;
|
|
1860
1882
|
if (variant !== "currency") {
|
|
1861
1883
|
return;
|
|
@@ -2116,14 +2138,14 @@ var Search = (_a) => {
|
|
|
2116
2138
|
"removeRoundness",
|
|
2117
2139
|
"autocompletePadding"
|
|
2118
2140
|
]);
|
|
2119
|
-
const inputRef = (0,
|
|
2120
|
-
const inputContainerRef = (0,
|
|
2121
|
-
const preventFocusOnInitialRender = (0,
|
|
2122
|
-
const [show, setShow] = (0,
|
|
2123
|
-
const [clearing, setClearing] = (0,
|
|
2124
|
-
const uniqueId = (0,
|
|
2141
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2142
|
+
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
2143
|
+
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
2144
|
+
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2145
|
+
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2146
|
+
const uniqueId = (0, import_react11.useId)();
|
|
2125
2147
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2126
|
-
(0,
|
|
2148
|
+
(0, import_react11.useEffect)(() => {
|
|
2127
2149
|
var _a2;
|
|
2128
2150
|
if (preventFocusOnInitialRender.current) {
|
|
2129
2151
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2207,7 +2229,7 @@ Search.displayName = "Search";
|
|
|
2207
2229
|
|
|
2208
2230
|
// src/components/DataGridCell.tsx
|
|
2209
2231
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2210
|
-
var DataGridCell = (0,
|
|
2232
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2211
2233
|
(_a) => {
|
|
2212
2234
|
var _b = _a, {
|
|
2213
2235
|
id,
|
|
@@ -2249,10 +2271,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2249
2271
|
"testid"
|
|
2250
2272
|
]);
|
|
2251
2273
|
const Element = type === "header" ? "th" : "td";
|
|
2252
|
-
const timerRef = (0,
|
|
2253
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2254
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2255
|
-
(0,
|
|
2274
|
+
const timerRef = (0, import_react12.useRef)(null);
|
|
2275
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2276
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2277
|
+
(0, import_react12.useEffect)(() => {
|
|
2256
2278
|
return () => {
|
|
2257
2279
|
if (timerRef.current) {
|
|
2258
2280
|
clearTimeout(timerRef.current);
|
|
@@ -2362,12 +2384,12 @@ function DataCellHeader(_a) {
|
|
|
2362
2384
|
"useMenuDefaultMinWidth"
|
|
2363
2385
|
]);
|
|
2364
2386
|
var _a2;
|
|
2365
|
-
const [showMenu, setShowMenu] = (0,
|
|
2366
|
-
const [filter, setFilter] = (0,
|
|
2387
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2388
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2367
2389
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2368
2390
|
);
|
|
2369
|
-
const ref = (0,
|
|
2370
|
-
const predeterminedPinned = (0,
|
|
2391
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2392
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2371
2393
|
const { column, getContext } = header;
|
|
2372
2394
|
const { id: columnId, setFilterValue } = column;
|
|
2373
2395
|
const {
|
|
@@ -2377,14 +2399,14 @@ function DataCellHeader(_a) {
|
|
|
2377
2399
|
listeners: subMenuListeners,
|
|
2378
2400
|
mobileHide
|
|
2379
2401
|
} = useSubMenuSystem(node ? node : ref);
|
|
2380
|
-
(0,
|
|
2402
|
+
(0, import_react12.useEffect)(() => {
|
|
2381
2403
|
var _a3, _b2, _c;
|
|
2382
2404
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2383
2405
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2384
2406
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2385
2407
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2386
2408
|
}, [columnId, getContext]);
|
|
2387
|
-
(0,
|
|
2409
|
+
(0, import_react12.useEffect)(() => {
|
|
2388
2410
|
const handler = setTimeout(() => {
|
|
2389
2411
|
setFilterValue(filter);
|
|
2390
2412
|
}, 500);
|
|
@@ -2647,7 +2669,7 @@ function DragAlongCell(_a) {
|
|
|
2647
2669
|
DragAlongCell.displayName = "DragAlongCell";
|
|
2648
2670
|
|
|
2649
2671
|
// src/components/DataGrid/index.tsx
|
|
2650
|
-
var
|
|
2672
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
2651
2673
|
var import_react_table3 = require("@tanstack/react-table");
|
|
2652
2674
|
var import_core = require("@dnd-kit/core");
|
|
2653
2675
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -2675,7 +2697,7 @@ function getSortIcon(sort, nextSort = false) {
|
|
|
2675
2697
|
}
|
|
2676
2698
|
|
|
2677
2699
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
2678
|
-
var
|
|
2700
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
2679
2701
|
|
|
2680
2702
|
// src/components/DataGrid/TableBody/index.tsx
|
|
2681
2703
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -2684,7 +2706,7 @@ var import_clsx12 = __toESM(require("clsx"), 1);
|
|
|
2684
2706
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
2685
2707
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
2686
2708
|
var import_react_table = require("@tanstack/react-table");
|
|
2687
|
-
var
|
|
2709
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2688
2710
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2689
2711
|
var valueFormatters = {
|
|
2690
2712
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -2752,7 +2774,7 @@ function TableBodyRow({
|
|
|
2752
2774
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
2753
2775
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
2754
2776
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
2755
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2777
|
+
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react13.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2756
2778
|
CellElement,
|
|
2757
2779
|
{
|
|
2758
2780
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -2966,10 +2988,10 @@ function TableBody({
|
|
|
2966
2988
|
}
|
|
2967
2989
|
|
|
2968
2990
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
2969
|
-
var
|
|
2991
|
+
var import_react15 = require("react");
|
|
2970
2992
|
|
|
2971
2993
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
2972
|
-
var
|
|
2994
|
+
var import_react14 = require("react");
|
|
2973
2995
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2974
2996
|
function ColumnSelectorMenuOption({
|
|
2975
2997
|
id,
|
|
@@ -2977,7 +2999,7 @@ function ColumnSelectorMenuOption({
|
|
|
2977
2999
|
column,
|
|
2978
3000
|
toggleColumnVisibility
|
|
2979
3001
|
}) {
|
|
2980
|
-
const [isVisible, setIsVisible] = (0,
|
|
3002
|
+
const [isVisible, setIsVisible] = (0, import_react14.useState)(column.getIsVisible());
|
|
2981
3003
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
2982
3004
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2983
3005
|
Checkbox,
|
|
@@ -3003,8 +3025,8 @@ function ColumnSelectorHeaderCell({
|
|
|
3003
3025
|
toggleColumnVisibility,
|
|
3004
3026
|
resetColumnVisibility
|
|
3005
3027
|
}) {
|
|
3006
|
-
const ref = (0,
|
|
3007
|
-
const [show, setShow] = (0,
|
|
3028
|
+
const ref = (0, import_react15.useRef)(null);
|
|
3029
|
+
const [show, setShow] = (0, import_react15.useState)(false);
|
|
3008
3030
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3009
3031
|
DataGridCell,
|
|
3010
3032
|
{
|
|
@@ -3173,7 +3195,7 @@ function PinnedColumns(_a) {
|
|
|
3173
3195
|
header.id
|
|
3174
3196
|
);
|
|
3175
3197
|
}
|
|
3176
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react16.default.Fragment, { children: ((_f = header.column.columnDef.meta) == null ? void 0 : _f.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3177
3199
|
Checkbox,
|
|
3178
3200
|
{
|
|
3179
3201
|
checked: allSelectedAcrossPages,
|
|
@@ -3255,23 +3277,23 @@ function DataGrid({
|
|
|
3255
3277
|
ref
|
|
3256
3278
|
}) {
|
|
3257
3279
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3258
|
-
(0,
|
|
3280
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
3259
3281
|
getSavedLayout: () => {
|
|
3260
3282
|
return getSavedLayout();
|
|
3261
3283
|
}
|
|
3262
3284
|
}));
|
|
3263
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3264
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3265
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3285
|
+
const [localSorting, setLocalSorting] = (0, import_react17.useState)([]);
|
|
3286
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react17.useState)([]);
|
|
3287
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react17.useState)({});
|
|
3266
3288
|
const {
|
|
3267
3289
|
columns: tableColumns,
|
|
3268
3290
|
setColumns: setTableColumns,
|
|
3269
3291
|
getSavedLayout
|
|
3270
3292
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3271
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3293
|
+
const [columnOrder, setColumnOrder] = (0, import_react17.useState)(
|
|
3272
3294
|
tableColumns.map((c) => c.id)
|
|
3273
3295
|
);
|
|
3274
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3296
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react17.useState)(
|
|
3275
3297
|
Object.fromEntries(
|
|
3276
3298
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3277
3299
|
var _a2, _b2;
|
|
@@ -3279,7 +3301,7 @@ function DataGrid({
|
|
|
3279
3301
|
})
|
|
3280
3302
|
)
|
|
3281
3303
|
);
|
|
3282
|
-
const updateColumnVisibility = (0,
|
|
3304
|
+
const updateColumnVisibility = (0, import_react17.useCallback)(
|
|
3283
3305
|
(updateOrder) => {
|
|
3284
3306
|
setColumnVisibility(
|
|
3285
3307
|
Object.fromEntries(
|
|
@@ -3293,7 +3315,7 @@ function DataGrid({
|
|
|
3293
3315
|
},
|
|
3294
3316
|
[tableColumns]
|
|
3295
3317
|
);
|
|
3296
|
-
const resetDefaultColumnVisibility = (0,
|
|
3318
|
+
const resetDefaultColumnVisibility = (0, import_react17.useCallback)(() => {
|
|
3297
3319
|
setTableColumns((prev) => {
|
|
3298
3320
|
columns.forEach((column) => {
|
|
3299
3321
|
var _a2, _b2;
|
|
@@ -3309,7 +3331,7 @@ function DataGrid({
|
|
|
3309
3331
|
return [...prev];
|
|
3310
3332
|
}, true);
|
|
3311
3333
|
}, [columns, setTableColumns]);
|
|
3312
|
-
(0,
|
|
3334
|
+
(0, import_react17.useEffect)(() => {
|
|
3313
3335
|
updateColumnVisibility(true);
|
|
3314
3336
|
}, [updateColumnVisibility]);
|
|
3315
3337
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3325,7 +3347,7 @@ function DataGrid({
|
|
|
3325
3347
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3326
3348
|
} : setLocalColumnFilters;
|
|
3327
3349
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3328
|
-
const setRowSelection = (0,
|
|
3350
|
+
const setRowSelection = (0, import_react17.useCallback)(
|
|
3329
3351
|
(updaterOrValue) => {
|
|
3330
3352
|
if (pagination) {
|
|
3331
3353
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3339,9 +3361,9 @@ function DataGrid({
|
|
|
3339
3361
|
},
|
|
3340
3362
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3341
3363
|
);
|
|
3342
|
-
const dndId = (0,
|
|
3343
|
-
const containerRef =
|
|
3344
|
-
const toggleColumnVisibility = (0,
|
|
3364
|
+
const dndId = (0, import_react17.useId)();
|
|
3365
|
+
const containerRef = import_react17.default.useRef(null);
|
|
3366
|
+
const toggleColumnVisibility = (0, import_react17.useCallback)(
|
|
3345
3367
|
(columnId, isVisible) => {
|
|
3346
3368
|
setTableColumns((prev) => {
|
|
3347
3369
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3589,7 +3611,7 @@ function DataGrid({
|
|
|
3589
3611
|
header.id
|
|
3590
3612
|
);
|
|
3591
3613
|
}
|
|
3592
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react17.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3593
3615
|
DataGridCell,
|
|
3594
3616
|
{
|
|
3595
3617
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3795,7 +3817,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3795
3817
|
}
|
|
3796
3818
|
|
|
3797
3819
|
// src/components/Select.tsx
|
|
3798
|
-
var
|
|
3820
|
+
var import_react18 = require("react");
|
|
3799
3821
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
3800
3822
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3801
3823
|
var Select = (_a) => {
|
|
@@ -3829,11 +3851,11 @@ var Select = (_a) => {
|
|
|
3829
3851
|
"value"
|
|
3830
3852
|
]);
|
|
3831
3853
|
var _a2;
|
|
3832
|
-
const inputRef = (0,
|
|
3833
|
-
const inputContainerRef = (0,
|
|
3834
|
-
const preventFocusOnInitialRender = (0,
|
|
3835
|
-
const [show, setShow] = (0,
|
|
3836
|
-
(0,
|
|
3854
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
3855
|
+
const inputContainerRef = (0, import_react18.useRef)(null);
|
|
3856
|
+
const preventFocusOnInitialRender = (0, import_react18.useRef)(true);
|
|
3857
|
+
const [show, setShow] = (0, import_react18.useState)(false);
|
|
3858
|
+
(0, import_react18.useEffect)(() => {
|
|
3837
3859
|
var _a3;
|
|
3838
3860
|
if (preventFocusOnInitialRender.current) {
|
|
3839
3861
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4255,7 +4277,7 @@ Button.displayName = "Button";
|
|
|
4255
4277
|
|
|
4256
4278
|
// src/components/Tooltip.tsx
|
|
4257
4279
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4258
|
-
var
|
|
4280
|
+
var import_react19 = require("react");
|
|
4259
4281
|
var import_react_dom2 = require("react-dom");
|
|
4260
4282
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4261
4283
|
var Tooltip = ({
|
|
@@ -4268,11 +4290,11 @@ var Tooltip = ({
|
|
|
4268
4290
|
offset = 8,
|
|
4269
4291
|
keepHidden = false
|
|
4270
4292
|
}) => {
|
|
4271
|
-
const ref = (0,
|
|
4272
|
-
const tooltipRef = (0,
|
|
4273
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4274
|
-
const [isVisible, setIsVisible] = (0,
|
|
4275
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4293
|
+
const ref = (0, import_react19.useRef)(null);
|
|
4294
|
+
const tooltipRef = (0, import_react19.useRef)(null);
|
|
4295
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react19.useState)({ top: 0, left: 0 });
|
|
4296
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
4297
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react19.useState)(false);
|
|
4276
4298
|
const updatePosition = () => {
|
|
4277
4299
|
if (!ref.current || !tooltipRef.current) return;
|
|
4278
4300
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4311,14 +4333,14 @@ var Tooltip = ({
|
|
|
4311
4333
|
setIsVisible(false);
|
|
4312
4334
|
setRemoveOpacity(false);
|
|
4313
4335
|
};
|
|
4314
|
-
(0,
|
|
4336
|
+
(0, import_react19.useEffect)(() => {
|
|
4315
4337
|
if (isVisible && tooltipRef.current) {
|
|
4316
4338
|
requestAnimationFrame(() => {
|
|
4317
4339
|
updatePosition();
|
|
4318
4340
|
});
|
|
4319
4341
|
}
|
|
4320
4342
|
}, [isVisible]);
|
|
4321
|
-
(0,
|
|
4343
|
+
(0, import_react19.useEffect)(() => {
|
|
4322
4344
|
if (isVisible) {
|
|
4323
4345
|
window.addEventListener("resize", updatePosition);
|
|
4324
4346
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4376,12 +4398,12 @@ var Tooltip = ({
|
|
|
4376
4398
|
Tooltip.displayName = "Tooltip";
|
|
4377
4399
|
|
|
4378
4400
|
// src/components/DateInput.tsx
|
|
4379
|
-
var
|
|
4401
|
+
var import_react21 = require("react");
|
|
4380
4402
|
var import_react_dom3 = require("react-dom");
|
|
4381
4403
|
|
|
4382
4404
|
// src/components/CalendarRange.tsx
|
|
4383
4405
|
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
4384
|
-
var
|
|
4406
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
4385
4407
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
4386
4408
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4387
4409
|
function DateCell(_a) {
|
|
@@ -4494,20 +4516,20 @@ function CalendarRange({
|
|
|
4494
4516
|
const fromDate = parseDate(from);
|
|
4495
4517
|
const toDate = parseDate(to);
|
|
4496
4518
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4497
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
4519
|
+
const [baseMonth, setBaseMonth] = (0, import_react20.useState)(
|
|
4498
4520
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4499
4521
|
);
|
|
4500
|
-
const [selecting, setSelecting] = (0,
|
|
4501
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4502
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4503
|
-
(0,
|
|
4522
|
+
const [selecting, setSelecting] = (0, import_react20.useState)("from");
|
|
4523
|
+
const [pendingFrom, setPendingFrom] = (0, import_react20.useState)(void 0);
|
|
4524
|
+
const [hoveredDate, setHoveredDate] = (0, import_react20.useState)(void 0);
|
|
4525
|
+
(0, import_react20.useEffect)(() => {
|
|
4504
4526
|
if (fromDate) {
|
|
4505
4527
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4506
4528
|
} else if (toDate) {
|
|
4507
4529
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4508
4530
|
}
|
|
4509
4531
|
}, [from, to]);
|
|
4510
|
-
(0,
|
|
4532
|
+
(0, import_react20.useEffect)(() => {
|
|
4511
4533
|
if (fromDate && toDate) {
|
|
4512
4534
|
setSelecting("from");
|
|
4513
4535
|
setPendingFrom(void 0);
|
|
@@ -4653,14 +4675,14 @@ function CalendarPane({
|
|
|
4653
4675
|
const years = Array.from({ length: 100 }).map(
|
|
4654
4676
|
(_, i) => baseMonth.year - 50 + i
|
|
4655
4677
|
);
|
|
4656
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
4657
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
4658
|
-
const monthMenuRef = (0,
|
|
4659
|
-
const yearMenuRef = (0,
|
|
4678
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react20.useState)(false);
|
|
4679
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react20.useState)(false);
|
|
4680
|
+
const monthMenuRef = (0, import_react20.useRef)(null);
|
|
4681
|
+
const yearMenuRef = (0, import_react20.useRef)(null);
|
|
4660
4682
|
const month = getMonthData(offset);
|
|
4661
4683
|
const totalCells = 42;
|
|
4662
4684
|
const emptyCells = month.firstDayOffset;
|
|
4663
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react20.default.Fragment, { children: [
|
|
4664
4686
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4665
4687
|
"div",
|
|
4666
4688
|
{
|
|
@@ -4868,24 +4890,24 @@ var DateInput = (_a) => {
|
|
|
4868
4890
|
"label",
|
|
4869
4891
|
"isDateAvailable"
|
|
4870
4892
|
]);
|
|
4871
|
-
const [visible, setVisible] = (0,
|
|
4872
|
-
const [inputValue, setInputValue] = (0,
|
|
4873
|
-
const [isTyping, setIsTyping] = (0,
|
|
4874
|
-
const popoverRef = (0,
|
|
4875
|
-
const triggerRef = (0,
|
|
4876
|
-
const rootRef = (0,
|
|
4877
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
4893
|
+
const [visible, setVisible] = (0, import_react21.useState)(false);
|
|
4894
|
+
const [inputValue, setInputValue] = (0, import_react21.useState)("");
|
|
4895
|
+
const [isTyping, setIsTyping] = (0, import_react21.useState)(false);
|
|
4896
|
+
const popoverRef = (0, import_react21.useRef)(null);
|
|
4897
|
+
const triggerRef = (0, import_react21.useRef)(null);
|
|
4898
|
+
const rootRef = (0, import_react21.useRef)(null);
|
|
4899
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react21.useState)({
|
|
4878
4900
|
top: 0,
|
|
4879
4901
|
left: 0,
|
|
4880
4902
|
width: 0
|
|
4881
4903
|
});
|
|
4882
4904
|
const [from, to] = [value, ""];
|
|
4883
|
-
(0,
|
|
4905
|
+
(0, import_react21.useEffect)(() => {
|
|
4884
4906
|
if (!isTyping) {
|
|
4885
4907
|
setInputValue(formatDisplayValue(from));
|
|
4886
4908
|
}
|
|
4887
4909
|
}, [from, isTyping]);
|
|
4888
|
-
(0,
|
|
4910
|
+
(0, import_react21.useLayoutEffect)(() => {
|
|
4889
4911
|
if (visible) {
|
|
4890
4912
|
updatePosition();
|
|
4891
4913
|
}
|
|
@@ -4900,7 +4922,7 @@ var DateInput = (_a) => {
|
|
|
4900
4922
|
});
|
|
4901
4923
|
}
|
|
4902
4924
|
};
|
|
4903
|
-
(0,
|
|
4925
|
+
(0, import_react21.useEffect)(() => {
|
|
4904
4926
|
updatePosition();
|
|
4905
4927
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4906
4928
|
if (triggerRef.current) {
|
|
@@ -4912,7 +4934,7 @@ var DateInput = (_a) => {
|
|
|
4912
4934
|
window.removeEventListener("scroll", updatePosition);
|
|
4913
4935
|
};
|
|
4914
4936
|
}, []);
|
|
4915
|
-
(0,
|
|
4937
|
+
(0, import_react21.useEffect)(() => {
|
|
4916
4938
|
const handleKeyDown2 = (event) => {
|
|
4917
4939
|
var _a2;
|
|
4918
4940
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -4925,7 +4947,7 @@ var DateInput = (_a) => {
|
|
|
4925
4947
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
4926
4948
|
};
|
|
4927
4949
|
});
|
|
4928
|
-
(0,
|
|
4950
|
+
(0, import_react21.useEffect)(() => {
|
|
4929
4951
|
const handleClickOutside = (event) => {
|
|
4930
4952
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4931
4953
|
setVisible(false);
|
|
@@ -5146,15 +5168,15 @@ Heading3.displayName = "Heading3";
|
|
|
5146
5168
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5147
5169
|
|
|
5148
5170
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5149
|
-
var
|
|
5171
|
+
var import_react23 = require("react");
|
|
5150
5172
|
|
|
5151
5173
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5152
|
-
var
|
|
5153
|
-
var GridContext = (0,
|
|
5174
|
+
var import_react22 = require("react");
|
|
5175
|
+
var GridContext = (0, import_react22.createContext)(null);
|
|
5154
5176
|
|
|
5155
5177
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5156
5178
|
function useGridContext() {
|
|
5157
|
-
const ctx = (0,
|
|
5179
|
+
const ctx = (0, import_react23.useContext)(GridContext);
|
|
5158
5180
|
if (!ctx) {
|
|
5159
5181
|
throw new Error("useGridContext must be used within GridContextProvider");
|
|
5160
5182
|
}
|
|
@@ -5165,12 +5187,12 @@ function useGridContext() {
|
|
|
5165
5187
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5166
5188
|
|
|
5167
5189
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5168
|
-
var
|
|
5190
|
+
var import_react24 = require("react");
|
|
5169
5191
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5170
5192
|
|
|
5171
5193
|
// src/components/Modal.tsx
|
|
5172
5194
|
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
5173
|
-
var
|
|
5195
|
+
var import_react26 = require("react");
|
|
5174
5196
|
|
|
5175
5197
|
// src/components/ModalHeader.tsx
|
|
5176
5198
|
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
@@ -5346,10 +5368,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
5346
5368
|
var import_react_use = require("react-use");
|
|
5347
5369
|
|
|
5348
5370
|
// src/components/useMounted.tsx
|
|
5349
|
-
var
|
|
5371
|
+
var import_react25 = require("react");
|
|
5350
5372
|
var useMounted = () => {
|
|
5351
|
-
const [isMounted, setIsMounted] = (0,
|
|
5352
|
-
(0,
|
|
5373
|
+
const [isMounted, setIsMounted] = (0, import_react25.useState)(false);
|
|
5374
|
+
(0, import_react25.useEffect)(() => {
|
|
5353
5375
|
setIsMounted(true);
|
|
5354
5376
|
return () => setIsMounted(false);
|
|
5355
5377
|
}, []);
|
|
@@ -5443,12 +5465,12 @@ var Modal = ({
|
|
|
5443
5465
|
}) => {
|
|
5444
5466
|
var _a;
|
|
5445
5467
|
const mounted = useMounted();
|
|
5446
|
-
const modalRef = (0,
|
|
5447
|
-
const bgRef = (0,
|
|
5468
|
+
const modalRef = (0, import_react26.useRef)(null);
|
|
5469
|
+
const bgRef = (0, import_react26.useRef)(null);
|
|
5448
5470
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5449
5471
|
const isMobile = useMatchesMobile();
|
|
5450
5472
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5451
|
-
(0,
|
|
5473
|
+
(0, import_react26.useEffect)(() => {
|
|
5452
5474
|
if (!mounted) return;
|
|
5453
5475
|
if (!modalRef.current || !bgRef.current) {
|
|
5454
5476
|
console.error("Modal or background reference is not set.");
|
|
@@ -5468,7 +5490,7 @@ var Modal = ({
|
|
|
5468
5490
|
bgFadeIn(bgRef.current);
|
|
5469
5491
|
}
|
|
5470
5492
|
}, [mounted, onClose, open, wasOpen]);
|
|
5471
|
-
const handleKeyDown = (0,
|
|
5493
|
+
const handleKeyDown = (0, import_react26.useCallback)(
|
|
5472
5494
|
(e) => {
|
|
5473
5495
|
if (e.key === "Escape") {
|
|
5474
5496
|
if (onClose) {
|
|
@@ -5479,12 +5501,12 @@ var Modal = ({
|
|
|
5479
5501
|
},
|
|
5480
5502
|
[onClose]
|
|
5481
5503
|
);
|
|
5482
|
-
const handleClose = (0,
|
|
5504
|
+
const handleClose = (0, import_react26.useCallback)(() => {
|
|
5483
5505
|
if (onClose) {
|
|
5484
5506
|
onClose();
|
|
5485
5507
|
}
|
|
5486
5508
|
}, [onClose]);
|
|
5487
|
-
(0,
|
|
5509
|
+
(0, import_react26.useEffect)(() => {
|
|
5488
5510
|
if (open) {
|
|
5489
5511
|
document.addEventListener("keyup", handleKeyDown);
|
|
5490
5512
|
}
|
|
@@ -5492,7 +5514,7 @@ var Modal = ({
|
|
|
5492
5514
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5493
5515
|
};
|
|
5494
5516
|
}, [open, handleKeyDown]);
|
|
5495
|
-
(0,
|
|
5517
|
+
(0, import_react26.useEffect)(() => {
|
|
5496
5518
|
if (!open) return;
|
|
5497
5519
|
const scrollY = window.scrollY;
|
|
5498
5520
|
const body = document.body;
|
|
@@ -5513,7 +5535,7 @@ var Modal = ({
|
|
|
5513
5535
|
};
|
|
5514
5536
|
}, [open]);
|
|
5515
5537
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5516
|
-
const backgroundClickHandler = (0,
|
|
5538
|
+
const backgroundClickHandler = (0, import_react26.useCallback)(
|
|
5517
5539
|
(e) => {
|
|
5518
5540
|
const target = e.target;
|
|
5519
5541
|
const currentTarget = e.currentTarget;
|
|
@@ -5622,10 +5644,10 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
|
5622
5644
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5623
5645
|
|
|
5624
5646
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5625
|
-
var
|
|
5647
|
+
var import_react28 = require("react");
|
|
5626
5648
|
|
|
5627
5649
|
// src/components/ImagePlaceholder.tsx
|
|
5628
|
-
var
|
|
5650
|
+
var import_react27 = require("react");
|
|
5629
5651
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5630
5652
|
|
|
5631
5653
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5636,11 +5658,11 @@ var import_clsx32 = __toESM(require("clsx"), 1);
|
|
|
5636
5658
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5637
5659
|
|
|
5638
5660
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5639
|
-
var
|
|
5661
|
+
var import_react29 = require("react");
|
|
5640
5662
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5641
5663
|
|
|
5642
5664
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5643
|
-
var
|
|
5665
|
+
var import_react30 = require("react");
|
|
5644
5666
|
|
|
5645
5667
|
// src/components/Surface.tsx
|
|
5646
5668
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
@@ -5685,17 +5707,17 @@ var import_clsx34 = require("clsx");
|
|
|
5685
5707
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5686
5708
|
|
|
5687
5709
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5688
|
-
var
|
|
5710
|
+
var import_react31 = require("react");
|
|
5689
5711
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5690
5712
|
|
|
5691
5713
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5692
|
-
var
|
|
5714
|
+
var import_react32 = require("react");
|
|
5693
5715
|
|
|
5694
5716
|
// src/components/ProductImagePreview/index.tsx
|
|
5695
5717
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5696
5718
|
|
|
5697
5719
|
// src/components/CompactImagesPreview.tsx
|
|
5698
|
-
var
|
|
5720
|
+
var import_react33 = require("react");
|
|
5699
5721
|
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
5700
5722
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5701
5723
|
|
|
@@ -5704,12 +5726,12 @@ var import_clsx36 = __toESM(require("clsx"), 1);
|
|
|
5704
5726
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5705
5727
|
|
|
5706
5728
|
// src/components/ListGroup.tsx
|
|
5707
|
-
var
|
|
5729
|
+
var import_react34 = require("react");
|
|
5708
5730
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5709
5731
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5710
5732
|
|
|
5711
5733
|
// src/components/Pagination.tsx
|
|
5712
|
-
var
|
|
5734
|
+
var import_react35 = require("react");
|
|
5713
5735
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
5714
5736
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5715
5737
|
var Pagination = ({
|
|
@@ -5721,7 +5743,7 @@ var Pagination = ({
|
|
|
5721
5743
|
className,
|
|
5722
5744
|
disabled
|
|
5723
5745
|
}) => {
|
|
5724
|
-
const goTo = (0,
|
|
5746
|
+
const goTo = (0, import_react35.useCallback)(
|
|
5725
5747
|
(page) => {
|
|
5726
5748
|
if (disabled) return;
|
|
5727
5749
|
onPageChange(page);
|
|
@@ -5738,7 +5760,7 @@ var Pagination = ({
|
|
|
5738
5760
|
goTo(currentPage + 1);
|
|
5739
5761
|
}
|
|
5740
5762
|
};
|
|
5741
|
-
const pageTokens = (0,
|
|
5763
|
+
const pageTokens = (0, import_react35.useMemo)(() => {
|
|
5742
5764
|
if (totalPages <= 5) {
|
|
5743
5765
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5744
5766
|
}
|
|
@@ -5861,21 +5883,21 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
|
5861
5883
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5862
5884
|
|
|
5863
5885
|
// src/components/SearchResultImage/index.tsx
|
|
5864
|
-
var
|
|
5886
|
+
var import_react36 = require("react");
|
|
5865
5887
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5866
5888
|
|
|
5867
5889
|
// src/components/Alert.tsx
|
|
5868
5890
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
5869
|
-
var
|
|
5891
|
+
var import_react37 = require("react");
|
|
5870
5892
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5871
5893
|
|
|
5872
5894
|
// src/components/OrderCheckIcon.tsx
|
|
5873
5895
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5874
5896
|
|
|
5875
5897
|
// src/components/EditingContext.tsx
|
|
5876
|
-
var
|
|
5898
|
+
var import_react38 = require("react");
|
|
5877
5899
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5878
|
-
var EditingContext = (0,
|
|
5900
|
+
var EditingContext = (0, import_react38.createContext)(null);
|
|
5879
5901
|
|
|
5880
5902
|
// src/components/AccessCard.tsx
|
|
5881
5903
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
@@ -6009,15 +6031,15 @@ var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
|
6009
6031
|
|
|
6010
6032
|
// src/components/AccessCardGroup.tsx
|
|
6011
6033
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
6012
|
-
var
|
|
6034
|
+
var import_react39 = require("react");
|
|
6013
6035
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6014
6036
|
|
|
6015
6037
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
6016
6038
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
6017
6039
|
function ColumnSelector() {
|
|
6018
6040
|
const context = useGridContext();
|
|
6019
|
-
const ref = (0,
|
|
6020
|
-
const [show, setShow] = (0,
|
|
6041
|
+
const ref = (0, import_react40.useRef)(null);
|
|
6042
|
+
const [show, setShow] = (0, import_react40.useState)(false);
|
|
6021
6043
|
const {
|
|
6022
6044
|
columns,
|
|
6023
6045
|
id,
|
|
@@ -6028,7 +6050,7 @@ function ColumnSelector() {
|
|
|
6028
6050
|
resetColumnVisibility,
|
|
6029
6051
|
dispatch
|
|
6030
6052
|
} = context;
|
|
6031
|
-
const toggleColumnVisibility = (0,
|
|
6053
|
+
const toggleColumnVisibility = (0, import_react40.useCallback)(
|
|
6032
6054
|
(index, visible) => {
|
|
6033
6055
|
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
6034
6056
|
},
|