@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
|
@@ -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
|
-
|
|
688
|
+
)
|
|
689
|
+
);
|
|
690
|
+
} else {
|
|
691
|
+
localStorage.setItem(
|
|
692
|
+
getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
|
|
693
|
+
JSON.stringify(initialColumns)
|
|
676
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");
|
|
@@ -2658,7 +2680,7 @@ var import_clsx13 = __toESM(require("clsx"), 1);
|
|
|
2658
2680
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
2659
2681
|
var import_react_table2 = require("@tanstack/react-table");
|
|
2660
2682
|
var import_clsx12 = __toESM(require("clsx"), 1);
|
|
2661
|
-
var
|
|
2683
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
2662
2684
|
|
|
2663
2685
|
// src/components/DataGrid/TableBody/index.tsx
|
|
2664
2686
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -2667,7 +2689,7 @@ var import_clsx11 = __toESM(require("clsx"), 1);
|
|
|
2667
2689
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
2668
2690
|
var import_clsx10 = __toESM(require("clsx"), 1);
|
|
2669
2691
|
var import_react_table = require("@tanstack/react-table");
|
|
2670
|
-
var
|
|
2692
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2671
2693
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2672
2694
|
var valueFormatters = {
|
|
2673
2695
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -2735,7 +2757,7 @@ function TableBodyRow({
|
|
|
2735
2757
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
2736
2758
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
2737
2759
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
2738
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2760
|
+
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react13.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2739
2761
|
CellElement,
|
|
2740
2762
|
{
|
|
2741
2763
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -2949,10 +2971,10 @@ function TableBody({
|
|
|
2949
2971
|
}
|
|
2950
2972
|
|
|
2951
2973
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
2952
|
-
var
|
|
2974
|
+
var import_react15 = require("react");
|
|
2953
2975
|
|
|
2954
2976
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
2955
|
-
var
|
|
2977
|
+
var import_react14 = require("react");
|
|
2956
2978
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2957
2979
|
function ColumnSelectorMenuOption({
|
|
2958
2980
|
id,
|
|
@@ -2960,7 +2982,7 @@ function ColumnSelectorMenuOption({
|
|
|
2960
2982
|
column,
|
|
2961
2983
|
toggleColumnVisibility
|
|
2962
2984
|
}) {
|
|
2963
|
-
const [isVisible, setIsVisible] = (0,
|
|
2985
|
+
const [isVisible, setIsVisible] = (0, import_react14.useState)(column.getIsVisible());
|
|
2964
2986
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
2965
2987
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2966
2988
|
Checkbox,
|
|
@@ -2986,8 +3008,8 @@ function ColumnSelectorHeaderCell({
|
|
|
2986
3008
|
toggleColumnVisibility,
|
|
2987
3009
|
resetColumnVisibility
|
|
2988
3010
|
}) {
|
|
2989
|
-
const ref = (0,
|
|
2990
|
-
const [show, setShow] = (0,
|
|
3011
|
+
const ref = (0, import_react15.useRef)(null);
|
|
3012
|
+
const [show, setShow] = (0, import_react15.useState)(false);
|
|
2991
3013
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2992
3014
|
DataGridCell,
|
|
2993
3015
|
{
|
|
@@ -3156,7 +3178,7 @@ function PinnedColumns(_a) {
|
|
|
3156
3178
|
header.id
|
|
3157
3179
|
);
|
|
3158
3180
|
}
|
|
3159
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react16.default.Fragment, { children: ((_f = header.column.columnDef.meta) == null ? void 0 : _f.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3160
3182
|
Checkbox,
|
|
3161
3183
|
{
|
|
3162
3184
|
checked: allSelectedAcrossPages,
|
|
@@ -3238,23 +3260,23 @@ function DataGrid({
|
|
|
3238
3260
|
ref
|
|
3239
3261
|
}) {
|
|
3240
3262
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3241
|
-
(0,
|
|
3263
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
3242
3264
|
getSavedLayout: () => {
|
|
3243
3265
|
return getSavedLayout();
|
|
3244
3266
|
}
|
|
3245
3267
|
}));
|
|
3246
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3247
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3248
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3268
|
+
const [localSorting, setLocalSorting] = (0, import_react17.useState)([]);
|
|
3269
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react17.useState)([]);
|
|
3270
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react17.useState)({});
|
|
3249
3271
|
const {
|
|
3250
3272
|
columns: tableColumns,
|
|
3251
3273
|
setColumns: setTableColumns,
|
|
3252
3274
|
getSavedLayout
|
|
3253
3275
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3254
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3276
|
+
const [columnOrder, setColumnOrder] = (0, import_react17.useState)(
|
|
3255
3277
|
tableColumns.map((c) => c.id)
|
|
3256
3278
|
);
|
|
3257
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3279
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react17.useState)(
|
|
3258
3280
|
Object.fromEntries(
|
|
3259
3281
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3260
3282
|
var _a2, _b2;
|
|
@@ -3262,7 +3284,7 @@ function DataGrid({
|
|
|
3262
3284
|
})
|
|
3263
3285
|
)
|
|
3264
3286
|
);
|
|
3265
|
-
const updateColumnVisibility = (0,
|
|
3287
|
+
const updateColumnVisibility = (0, import_react17.useCallback)(
|
|
3266
3288
|
(updateOrder) => {
|
|
3267
3289
|
setColumnVisibility(
|
|
3268
3290
|
Object.fromEntries(
|
|
@@ -3276,7 +3298,7 @@ function DataGrid({
|
|
|
3276
3298
|
},
|
|
3277
3299
|
[tableColumns]
|
|
3278
3300
|
);
|
|
3279
|
-
const resetDefaultColumnVisibility = (0,
|
|
3301
|
+
const resetDefaultColumnVisibility = (0, import_react17.useCallback)(() => {
|
|
3280
3302
|
setTableColumns((prev) => {
|
|
3281
3303
|
columns.forEach((column) => {
|
|
3282
3304
|
var _a2, _b2;
|
|
@@ -3292,7 +3314,7 @@ function DataGrid({
|
|
|
3292
3314
|
return [...prev];
|
|
3293
3315
|
}, true);
|
|
3294
3316
|
}, [columns, setTableColumns]);
|
|
3295
|
-
(0,
|
|
3317
|
+
(0, import_react17.useEffect)(() => {
|
|
3296
3318
|
updateColumnVisibility(true);
|
|
3297
3319
|
}, [updateColumnVisibility]);
|
|
3298
3320
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3308,7 +3330,7 @@ function DataGrid({
|
|
|
3308
3330
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3309
3331
|
} : setLocalColumnFilters;
|
|
3310
3332
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3311
|
-
const setRowSelection = (0,
|
|
3333
|
+
const setRowSelection = (0, import_react17.useCallback)(
|
|
3312
3334
|
(updaterOrValue) => {
|
|
3313
3335
|
if (pagination) {
|
|
3314
3336
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3322,9 +3344,9 @@ function DataGrid({
|
|
|
3322
3344
|
},
|
|
3323
3345
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3324
3346
|
);
|
|
3325
|
-
const dndId = (0,
|
|
3326
|
-
const containerRef =
|
|
3327
|
-
const toggleColumnVisibility = (0,
|
|
3347
|
+
const dndId = (0, import_react17.useId)();
|
|
3348
|
+
const containerRef = import_react17.default.useRef(null);
|
|
3349
|
+
const toggleColumnVisibility = (0, import_react17.useCallback)(
|
|
3328
3350
|
(columnId, isVisible) => {
|
|
3329
3351
|
setTableColumns((prev) => {
|
|
3330
3352
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3572,7 +3594,7 @@ function DataGrid({
|
|
|
3572
3594
|
header.id
|
|
3573
3595
|
);
|
|
3574
3596
|
}
|
|
3575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react17.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3576
3598
|
DataGridCell,
|
|
3577
3599
|
{
|
|
3578
3600
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3778,7 +3800,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3778
3800
|
}
|
|
3779
3801
|
|
|
3780
3802
|
// src/components/Select.tsx
|
|
3781
|
-
var
|
|
3803
|
+
var import_react18 = require("react");
|
|
3782
3804
|
var import_clsx14 = __toESM(require("clsx"), 1);
|
|
3783
3805
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3784
3806
|
var Select = (_a) => {
|
|
@@ -3812,11 +3834,11 @@ var Select = (_a) => {
|
|
|
3812
3834
|
"value"
|
|
3813
3835
|
]);
|
|
3814
3836
|
var _a2;
|
|
3815
|
-
const inputRef = (0,
|
|
3816
|
-
const inputContainerRef = (0,
|
|
3817
|
-
const preventFocusOnInitialRender = (0,
|
|
3818
|
-
const [show, setShow] = (0,
|
|
3819
|
-
(0,
|
|
3837
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
3838
|
+
const inputContainerRef = (0, import_react18.useRef)(null);
|
|
3839
|
+
const preventFocusOnInitialRender = (0, import_react18.useRef)(true);
|
|
3840
|
+
const [show, setShow] = (0, import_react18.useState)(false);
|
|
3841
|
+
(0, import_react18.useEffect)(() => {
|
|
3820
3842
|
var _a3;
|
|
3821
3843
|
if (preventFocusOnInitialRender.current) {
|
|
3822
3844
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4238,7 +4260,7 @@ Button.displayName = "Button";
|
|
|
4238
4260
|
|
|
4239
4261
|
// src/components/Tooltip.tsx
|
|
4240
4262
|
var import_clsx18 = __toESM(require("clsx"), 1);
|
|
4241
|
-
var
|
|
4263
|
+
var import_react19 = require("react");
|
|
4242
4264
|
var import_react_dom2 = require("react-dom");
|
|
4243
4265
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4244
4266
|
var Tooltip = ({
|
|
@@ -4251,11 +4273,11 @@ var Tooltip = ({
|
|
|
4251
4273
|
offset = 8,
|
|
4252
4274
|
keepHidden = false
|
|
4253
4275
|
}) => {
|
|
4254
|
-
const ref = (0,
|
|
4255
|
-
const tooltipRef = (0,
|
|
4256
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4257
|
-
const [isVisible, setIsVisible] = (0,
|
|
4258
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4276
|
+
const ref = (0, import_react19.useRef)(null);
|
|
4277
|
+
const tooltipRef = (0, import_react19.useRef)(null);
|
|
4278
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react19.useState)({ top: 0, left: 0 });
|
|
4279
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
4280
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react19.useState)(false);
|
|
4259
4281
|
const updatePosition = () => {
|
|
4260
4282
|
if (!ref.current || !tooltipRef.current) return;
|
|
4261
4283
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4294,14 +4316,14 @@ var Tooltip = ({
|
|
|
4294
4316
|
setIsVisible(false);
|
|
4295
4317
|
setRemoveOpacity(false);
|
|
4296
4318
|
};
|
|
4297
|
-
(0,
|
|
4319
|
+
(0, import_react19.useEffect)(() => {
|
|
4298
4320
|
if (isVisible && tooltipRef.current) {
|
|
4299
4321
|
requestAnimationFrame(() => {
|
|
4300
4322
|
updatePosition();
|
|
4301
4323
|
});
|
|
4302
4324
|
}
|
|
4303
4325
|
}, [isVisible]);
|
|
4304
|
-
(0,
|
|
4326
|
+
(0, import_react19.useEffect)(() => {
|
|
4305
4327
|
if (isVisible) {
|
|
4306
4328
|
window.addEventListener("resize", updatePosition);
|
|
4307
4329
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4359,12 +4381,12 @@ var Tooltip = ({
|
|
|
4359
4381
|
Tooltip.displayName = "Tooltip";
|
|
4360
4382
|
|
|
4361
4383
|
// src/components/DateInput.tsx
|
|
4362
|
-
var
|
|
4384
|
+
var import_react21 = require("react");
|
|
4363
4385
|
var import_react_dom3 = require("react-dom");
|
|
4364
4386
|
|
|
4365
4387
|
// src/components/CalendarRange.tsx
|
|
4366
4388
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4367
|
-
var
|
|
4389
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
4368
4390
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
4369
4391
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4370
4392
|
function DateCell(_a) {
|
|
@@ -4477,20 +4499,20 @@ function CalendarRange({
|
|
|
4477
4499
|
const fromDate = parseDate(from);
|
|
4478
4500
|
const toDate = parseDate(to);
|
|
4479
4501
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4480
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
4502
|
+
const [baseMonth, setBaseMonth] = (0, import_react20.useState)(
|
|
4481
4503
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4482
4504
|
);
|
|
4483
|
-
const [selecting, setSelecting] = (0,
|
|
4484
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4485
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4486
|
-
(0,
|
|
4505
|
+
const [selecting, setSelecting] = (0, import_react20.useState)("from");
|
|
4506
|
+
const [pendingFrom, setPendingFrom] = (0, import_react20.useState)(void 0);
|
|
4507
|
+
const [hoveredDate, setHoveredDate] = (0, import_react20.useState)(void 0);
|
|
4508
|
+
(0, import_react20.useEffect)(() => {
|
|
4487
4509
|
if (fromDate) {
|
|
4488
4510
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4489
4511
|
} else if (toDate) {
|
|
4490
4512
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4491
4513
|
}
|
|
4492
4514
|
}, [from, to]);
|
|
4493
|
-
(0,
|
|
4515
|
+
(0, import_react20.useEffect)(() => {
|
|
4494
4516
|
if (fromDate && toDate) {
|
|
4495
4517
|
setSelecting("from");
|
|
4496
4518
|
setPendingFrom(void 0);
|
|
@@ -4636,14 +4658,14 @@ function CalendarPane({
|
|
|
4636
4658
|
const years = Array.from({ length: 100 }).map(
|
|
4637
4659
|
(_, i) => baseMonth.year - 50 + i
|
|
4638
4660
|
);
|
|
4639
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
4640
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
4641
|
-
const monthMenuRef = (0,
|
|
4642
|
-
const yearMenuRef = (0,
|
|
4661
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react20.useState)(false);
|
|
4662
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react20.useState)(false);
|
|
4663
|
+
const monthMenuRef = (0, import_react20.useRef)(null);
|
|
4664
|
+
const yearMenuRef = (0, import_react20.useRef)(null);
|
|
4643
4665
|
const month = getMonthData(offset);
|
|
4644
4666
|
const totalCells = 42;
|
|
4645
4667
|
const emptyCells = month.firstDayOffset;
|
|
4646
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react20.default.Fragment, { children: [
|
|
4647
4669
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4648
4670
|
"div",
|
|
4649
4671
|
{
|
|
@@ -4851,24 +4873,24 @@ var DateInput = (_a) => {
|
|
|
4851
4873
|
"label",
|
|
4852
4874
|
"isDateAvailable"
|
|
4853
4875
|
]);
|
|
4854
|
-
const [visible, setVisible] = (0,
|
|
4855
|
-
const [inputValue, setInputValue] = (0,
|
|
4856
|
-
const [isTyping, setIsTyping] = (0,
|
|
4857
|
-
const popoverRef = (0,
|
|
4858
|
-
const triggerRef = (0,
|
|
4859
|
-
const rootRef = (0,
|
|
4860
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
4876
|
+
const [visible, setVisible] = (0, import_react21.useState)(false);
|
|
4877
|
+
const [inputValue, setInputValue] = (0, import_react21.useState)("");
|
|
4878
|
+
const [isTyping, setIsTyping] = (0, import_react21.useState)(false);
|
|
4879
|
+
const popoverRef = (0, import_react21.useRef)(null);
|
|
4880
|
+
const triggerRef = (0, import_react21.useRef)(null);
|
|
4881
|
+
const rootRef = (0, import_react21.useRef)(null);
|
|
4882
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react21.useState)({
|
|
4861
4883
|
top: 0,
|
|
4862
4884
|
left: 0,
|
|
4863
4885
|
width: 0
|
|
4864
4886
|
});
|
|
4865
4887
|
const [from, to] = [value, ""];
|
|
4866
|
-
(0,
|
|
4888
|
+
(0, import_react21.useEffect)(() => {
|
|
4867
4889
|
if (!isTyping) {
|
|
4868
4890
|
setInputValue(formatDisplayValue(from));
|
|
4869
4891
|
}
|
|
4870
4892
|
}, [from, isTyping]);
|
|
4871
|
-
(0,
|
|
4893
|
+
(0, import_react21.useLayoutEffect)(() => {
|
|
4872
4894
|
if (visible) {
|
|
4873
4895
|
updatePosition();
|
|
4874
4896
|
}
|
|
@@ -4883,7 +4905,7 @@ var DateInput = (_a) => {
|
|
|
4883
4905
|
});
|
|
4884
4906
|
}
|
|
4885
4907
|
};
|
|
4886
|
-
(0,
|
|
4908
|
+
(0, import_react21.useEffect)(() => {
|
|
4887
4909
|
updatePosition();
|
|
4888
4910
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4889
4911
|
if (triggerRef.current) {
|
|
@@ -4895,7 +4917,7 @@ var DateInput = (_a) => {
|
|
|
4895
4917
|
window.removeEventListener("scroll", updatePosition);
|
|
4896
4918
|
};
|
|
4897
4919
|
}, []);
|
|
4898
|
-
(0,
|
|
4920
|
+
(0, import_react21.useEffect)(() => {
|
|
4899
4921
|
const handleKeyDown2 = (event) => {
|
|
4900
4922
|
var _a2;
|
|
4901
4923
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -4908,7 +4930,7 @@ var DateInput = (_a) => {
|
|
|
4908
4930
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
4909
4931
|
};
|
|
4910
4932
|
});
|
|
4911
|
-
(0,
|
|
4933
|
+
(0, import_react21.useEffect)(() => {
|
|
4912
4934
|
const handleClickOutside = (event) => {
|
|
4913
4935
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4914
4936
|
setVisible(false);
|
|
@@ -5129,14 +5151,14 @@ Heading3.displayName = "Heading3";
|
|
|
5129
5151
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5130
5152
|
|
|
5131
5153
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5132
|
-
var
|
|
5154
|
+
var import_react24 = require("react");
|
|
5133
5155
|
|
|
5134
5156
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5135
|
-
var
|
|
5157
|
+
var import_react23 = require("react");
|
|
5136
5158
|
|
|
5137
5159
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5138
|
-
var
|
|
5139
|
-
var GridContext = (0,
|
|
5160
|
+
var import_react22 = require("react");
|
|
5161
|
+
var GridContext = (0, import_react22.createContext)(null);
|
|
5140
5162
|
|
|
5141
5163
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5142
5164
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -5145,12 +5167,12 @@ var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
|
5145
5167
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5146
5168
|
|
|
5147
5169
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5148
|
-
var
|
|
5170
|
+
var import_react25 = require("react");
|
|
5149
5171
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5150
5172
|
|
|
5151
5173
|
// src/components/Modal.tsx
|
|
5152
5174
|
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
5153
|
-
var
|
|
5175
|
+
var import_react27 = require("react");
|
|
5154
5176
|
|
|
5155
5177
|
// src/components/ModalHeader.tsx
|
|
5156
5178
|
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
@@ -5326,10 +5348,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
5326
5348
|
var import_react_use = require("react-use");
|
|
5327
5349
|
|
|
5328
5350
|
// src/components/useMounted.tsx
|
|
5329
|
-
var
|
|
5351
|
+
var import_react26 = require("react");
|
|
5330
5352
|
var useMounted = () => {
|
|
5331
|
-
const [isMounted, setIsMounted] = (0,
|
|
5332
|
-
(0,
|
|
5353
|
+
const [isMounted, setIsMounted] = (0, import_react26.useState)(false);
|
|
5354
|
+
(0, import_react26.useEffect)(() => {
|
|
5333
5355
|
setIsMounted(true);
|
|
5334
5356
|
return () => setIsMounted(false);
|
|
5335
5357
|
}, []);
|
|
@@ -5423,12 +5445,12 @@ var Modal = ({
|
|
|
5423
5445
|
}) => {
|
|
5424
5446
|
var _a;
|
|
5425
5447
|
const mounted = useMounted();
|
|
5426
|
-
const modalRef = (0,
|
|
5427
|
-
const bgRef = (0,
|
|
5448
|
+
const modalRef = (0, import_react27.useRef)(null);
|
|
5449
|
+
const bgRef = (0, import_react27.useRef)(null);
|
|
5428
5450
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5429
5451
|
const isMobile = useMatchesMobile();
|
|
5430
5452
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5431
|
-
(0,
|
|
5453
|
+
(0, import_react27.useEffect)(() => {
|
|
5432
5454
|
if (!mounted) return;
|
|
5433
5455
|
if (!modalRef.current || !bgRef.current) {
|
|
5434
5456
|
console.error("Modal or background reference is not set.");
|
|
@@ -5448,7 +5470,7 @@ var Modal = ({
|
|
|
5448
5470
|
bgFadeIn(bgRef.current);
|
|
5449
5471
|
}
|
|
5450
5472
|
}, [mounted, onClose, open, wasOpen]);
|
|
5451
|
-
const handleKeyDown = (0,
|
|
5473
|
+
const handleKeyDown = (0, import_react27.useCallback)(
|
|
5452
5474
|
(e) => {
|
|
5453
5475
|
if (e.key === "Escape") {
|
|
5454
5476
|
if (onClose) {
|
|
@@ -5459,12 +5481,12 @@ var Modal = ({
|
|
|
5459
5481
|
},
|
|
5460
5482
|
[onClose]
|
|
5461
5483
|
);
|
|
5462
|
-
const handleClose = (0,
|
|
5484
|
+
const handleClose = (0, import_react27.useCallback)(() => {
|
|
5463
5485
|
if (onClose) {
|
|
5464
5486
|
onClose();
|
|
5465
5487
|
}
|
|
5466
5488
|
}, [onClose]);
|
|
5467
|
-
(0,
|
|
5489
|
+
(0, import_react27.useEffect)(() => {
|
|
5468
5490
|
if (open) {
|
|
5469
5491
|
document.addEventListener("keyup", handleKeyDown);
|
|
5470
5492
|
}
|
|
@@ -5472,7 +5494,7 @@ var Modal = ({
|
|
|
5472
5494
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5473
5495
|
};
|
|
5474
5496
|
}, [open, handleKeyDown]);
|
|
5475
|
-
(0,
|
|
5497
|
+
(0, import_react27.useEffect)(() => {
|
|
5476
5498
|
if (!open) return;
|
|
5477
5499
|
const scrollY = window.scrollY;
|
|
5478
5500
|
const body = document.body;
|
|
@@ -5493,7 +5515,7 @@ var Modal = ({
|
|
|
5493
5515
|
};
|
|
5494
5516
|
}, [open]);
|
|
5495
5517
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5496
|
-
const backgroundClickHandler = (0,
|
|
5518
|
+
const backgroundClickHandler = (0, import_react27.useCallback)(
|
|
5497
5519
|
(e) => {
|
|
5498
5520
|
const target = e.target;
|
|
5499
5521
|
const currentTarget = e.currentTarget;
|
|
@@ -5602,10 +5624,10 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
|
5602
5624
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5603
5625
|
|
|
5604
5626
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5605
|
-
var
|
|
5627
|
+
var import_react29 = require("react");
|
|
5606
5628
|
|
|
5607
5629
|
// src/components/ImagePlaceholder.tsx
|
|
5608
|
-
var
|
|
5630
|
+
var import_react28 = require("react");
|
|
5609
5631
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5610
5632
|
|
|
5611
5633
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5616,11 +5638,11 @@ var import_clsx31 = __toESM(require("clsx"), 1);
|
|
|
5616
5638
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5617
5639
|
|
|
5618
5640
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5619
|
-
var
|
|
5641
|
+
var import_react30 = require("react");
|
|
5620
5642
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5621
5643
|
|
|
5622
5644
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5623
|
-
var
|
|
5645
|
+
var import_react31 = require("react");
|
|
5624
5646
|
|
|
5625
5647
|
// src/components/Surface.tsx
|
|
5626
5648
|
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
@@ -5665,17 +5687,17 @@ var import_clsx33 = require("clsx");
|
|
|
5665
5687
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5666
5688
|
|
|
5667
5689
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5668
|
-
var
|
|
5690
|
+
var import_react32 = require("react");
|
|
5669
5691
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5670
5692
|
|
|
5671
5693
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5672
|
-
var
|
|
5694
|
+
var import_react33 = require("react");
|
|
5673
5695
|
|
|
5674
5696
|
// src/components/ProductImagePreview/index.tsx
|
|
5675
5697
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5676
5698
|
|
|
5677
5699
|
// src/components/CompactImagesPreview.tsx
|
|
5678
|
-
var
|
|
5700
|
+
var import_react34 = require("react");
|
|
5679
5701
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
5680
5702
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5681
5703
|
|
|
@@ -5684,12 +5706,12 @@ var import_clsx35 = __toESM(require("clsx"), 1);
|
|
|
5684
5706
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5685
5707
|
|
|
5686
5708
|
// src/components/ListGroup.tsx
|
|
5687
|
-
var
|
|
5709
|
+
var import_react35 = require("react");
|
|
5688
5710
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
5689
5711
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5690
5712
|
|
|
5691
5713
|
// src/components/Pagination.tsx
|
|
5692
|
-
var
|
|
5714
|
+
var import_react36 = require("react");
|
|
5693
5715
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5694
5716
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5695
5717
|
var Pagination = ({
|
|
@@ -5701,7 +5723,7 @@ var Pagination = ({
|
|
|
5701
5723
|
className,
|
|
5702
5724
|
disabled
|
|
5703
5725
|
}) => {
|
|
5704
|
-
const goTo = (0,
|
|
5726
|
+
const goTo = (0, import_react36.useCallback)(
|
|
5705
5727
|
(page) => {
|
|
5706
5728
|
if (disabled) return;
|
|
5707
5729
|
onPageChange(page);
|
|
@@ -5718,7 +5740,7 @@ var Pagination = ({
|
|
|
5718
5740
|
goTo(currentPage + 1);
|
|
5719
5741
|
}
|
|
5720
5742
|
};
|
|
5721
|
-
const pageTokens = (0,
|
|
5743
|
+
const pageTokens = (0, import_react36.useMemo)(() => {
|
|
5722
5744
|
if (totalPages <= 5) {
|
|
5723
5745
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5724
5746
|
}
|
|
@@ -5841,21 +5863,21 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
|
5841
5863
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5842
5864
|
|
|
5843
5865
|
// src/components/SearchResultImage/index.tsx
|
|
5844
|
-
var
|
|
5866
|
+
var import_react37 = require("react");
|
|
5845
5867
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5846
5868
|
|
|
5847
5869
|
// src/components/Alert.tsx
|
|
5848
5870
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
5849
|
-
var
|
|
5871
|
+
var import_react38 = require("react");
|
|
5850
5872
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5851
5873
|
|
|
5852
5874
|
// src/components/OrderCheckIcon.tsx
|
|
5853
5875
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5854
5876
|
|
|
5855
5877
|
// src/components/EditingContext.tsx
|
|
5856
|
-
var
|
|
5878
|
+
var import_react39 = require("react");
|
|
5857
5879
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5858
|
-
var EditingContext = (0,
|
|
5880
|
+
var EditingContext = (0, import_react39.createContext)(null);
|
|
5859
5881
|
|
|
5860
5882
|
// src/components/AccessCard.tsx
|
|
5861
5883
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
@@ -5989,7 +6011,7 @@ var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
|
5989
6011
|
|
|
5990
6012
|
// src/components/AccessCardGroup.tsx
|
|
5991
6013
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
5992
|
-
var
|
|
6014
|
+
var import_react40 = require("react");
|
|
5993
6015
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5994
6016
|
|
|
5995
6017
|
// src/components/DataGrid/utils.tsx
|