@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
|
@@ -116,7 +116,7 @@ var CSS = /* @__PURE__ */ Object.freeze({
|
|
|
116
116
|
|
|
117
117
|
// src/components/DataGridCell.tsx
|
|
118
118
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
119
|
-
var
|
|
119
|
+
var import_react12 = require("react");
|
|
120
120
|
|
|
121
121
|
// src/classNames.ts
|
|
122
122
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
@@ -260,7 +260,7 @@ var gapUsingContainerPadding = (0, import_clsx.default)(
|
|
|
260
260
|
|
|
261
261
|
// src/components/MenuOption.tsx
|
|
262
262
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
263
|
-
var
|
|
263
|
+
var import_react7 = require("react");
|
|
264
264
|
|
|
265
265
|
// src/components/Label.tsx
|
|
266
266
|
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
@@ -594,11 +594,24 @@ function formatDate(date) {
|
|
|
594
594
|
|
|
595
595
|
// src/utils/mergeObjectArrays.ts
|
|
596
596
|
function mergeObjectArrays(arr1, arr2) {
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
597
|
+
const arr2Map = /* @__PURE__ */ new Map();
|
|
598
|
+
for (const item of arr2) {
|
|
599
|
+
const id = item.id;
|
|
600
|
+
if (id !== void 0) {
|
|
601
|
+
arr2Map.set(id, item);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
return arr1.map((item1) => {
|
|
605
|
+
const id = item1.id;
|
|
606
|
+
if (id !== void 0 && arr2Map.has(id)) {
|
|
607
|
+
const item2 = arr2Map.get(id);
|
|
608
|
+
const meta1 = item1.meta;
|
|
609
|
+
const meta2 = item2.meta;
|
|
610
|
+
const mergedMeta = meta1 && meta2 && typeof meta1 === "object" && typeof meta2 === "object" ? __spreadValues(__spreadValues({}, meta1), meta2) : meta2 != null ? meta2 : meta1;
|
|
611
|
+
return __spreadProps(__spreadValues(__spreadValues({}, item1), item2), { meta: mergedMeta });
|
|
612
|
+
}
|
|
613
|
+
return item1;
|
|
614
|
+
});
|
|
602
615
|
}
|
|
603
616
|
|
|
604
617
|
// src/utils/index.ts
|
|
@@ -634,52 +647,58 @@ var getLocalStorageKeyWithPrefix = (key) => `${LocalStoragePrefix}__${key}`;
|
|
|
634
647
|
function useTableLayout(initialColumns, key, autosync = true) {
|
|
635
648
|
const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
|
|
636
649
|
const [isReady, setIsReady] = (0, import_react5.useState)(false);
|
|
637
|
-
const
|
|
650
|
+
const isReadyRef = (0, import_react5.useRef)(false);
|
|
651
|
+
const keyRef = (0, import_react5.useRef)(key);
|
|
652
|
+
(0, import_react5.useEffect)(() => {
|
|
653
|
+
isReadyRef.current = isReady;
|
|
654
|
+
keyRef.current = key;
|
|
655
|
+
}, [isReady, key]);
|
|
638
656
|
const handleSaveLayout = (0, import_react5.useCallback)(
|
|
639
657
|
(setter, _internal) => {
|
|
640
|
-
if (!
|
|
658
|
+
if (!isReadyRef.current && !_internal || !keyRef.current) return;
|
|
641
659
|
setColumns((prevColumns) => {
|
|
642
660
|
const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
|
|
643
|
-
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
|
|
661
|
+
if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal) {
|
|
644
662
|
return prevColumns;
|
|
663
|
+
}
|
|
645
664
|
localStorage.setItem(
|
|
646
|
-
getLocalStorageKeyWithPrefix(`${
|
|
665
|
+
getLocalStorageKeyWithPrefix(`${keyRef.current}-tableLayout`),
|
|
647
666
|
JSON.stringify(newColumns)
|
|
648
667
|
);
|
|
649
668
|
return newColumns;
|
|
650
669
|
});
|
|
651
670
|
},
|
|
652
|
-
[
|
|
671
|
+
[]
|
|
653
672
|
);
|
|
654
673
|
(0, import_react5.useEffect)(() => {
|
|
655
674
|
if (!autosync) return;
|
|
656
|
-
if (!key)
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
`useTableLayout should only be called once per component render cycle.
|
|
660
|
-
${renderCountRef.current} Renders detected.
|
|
661
|
-
Check dependency stability`
|
|
662
|
-
);
|
|
675
|
+
if (!key) {
|
|
676
|
+
setIsReady(true);
|
|
677
|
+
return;
|
|
663
678
|
}
|
|
664
|
-
renderCountRef.current += 1;
|
|
665
679
|
const savedLayout = localStorage.getItem(
|
|
666
680
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
667
681
|
);
|
|
668
682
|
if (savedLayout) {
|
|
669
|
-
|
|
683
|
+
setColumns(
|
|
670
684
|
mergeObjectArrays(
|
|
671
685
|
initialColumns,
|
|
672
686
|
JSON.parse(savedLayout)
|
|
673
|
-
)
|
|
674
|
-
|
|
687
|
+
)
|
|
688
|
+
);
|
|
689
|
+
} else {
|
|
690
|
+
localStorage.setItem(
|
|
691
|
+
getLocalStorageKeyWithPrefix(`${key}-tableLayout`),
|
|
692
|
+
JSON.stringify(initialColumns)
|
|
675
693
|
);
|
|
694
|
+
setColumns((prev) => {
|
|
695
|
+
if (JSON.stringify(initialColumns) === JSON.stringify(prev))
|
|
696
|
+
return prev;
|
|
697
|
+
return initialColumns;
|
|
698
|
+
});
|
|
676
699
|
}
|
|
677
|
-
if (!savedLayout) handleSaveLayout(initialColumns, true);
|
|
678
700
|
setIsReady(true);
|
|
679
|
-
|
|
680
|
-
renderCountRef.current = 0;
|
|
681
|
-
};
|
|
682
|
-
}, [handleSaveLayout, initialColumns, key, autosync]);
|
|
701
|
+
}, [initialColumns, key, autosync]);
|
|
683
702
|
const getSavedLayout = (0, import_react5.useCallback)(() => {
|
|
684
703
|
const savedLayout = localStorage.getItem(
|
|
685
704
|
getLocalStorageKeyWithPrefix(`${key}-tableLayout`)
|
|
@@ -691,6 +710,9 @@ function useTableLayout(initialColumns, key, autosync = true) {
|
|
|
691
710
|
return { columns, setColumns: handleSaveLayout, isReady, getSavedLayout };
|
|
692
711
|
}
|
|
693
712
|
|
|
713
|
+
// src/hooks/useEditCell.tsx
|
|
714
|
+
var import_react6 = require("react");
|
|
715
|
+
|
|
694
716
|
// src/components/Caption.tsx
|
|
695
717
|
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
696
718
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -842,12 +864,12 @@ var MenuOption = ({
|
|
|
842
864
|
onMouseMove,
|
|
843
865
|
small = false
|
|
844
866
|
}) => {
|
|
845
|
-
const uniqueId = (0,
|
|
846
|
-
const internalRef = (0,
|
|
867
|
+
const uniqueId = (0, import_react7.useId)();
|
|
868
|
+
const internalRef = (0, import_react7.useRef)(null);
|
|
847
869
|
const actualRef = ref || internalRef;
|
|
848
|
-
const menuId = (0,
|
|
870
|
+
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
849
871
|
const isMobile = useMatchesMobile();
|
|
850
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0,
|
|
872
|
+
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
851
873
|
const handleMouseEnter = () => {
|
|
852
874
|
if (subMenu && onSubMenuHover && !disabled) {
|
|
853
875
|
onSubMenuHover(menuId.current, subMenuLevel);
|
|
@@ -1007,27 +1029,27 @@ function highlightMatch(text, searchValue) {
|
|
|
1007
1029
|
|
|
1008
1030
|
// src/components/Menu.tsx
|
|
1009
1031
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
1010
|
-
var
|
|
1032
|
+
var import_react9 = require("react");
|
|
1011
1033
|
var import_react_dom = require("react-dom");
|
|
1012
1034
|
|
|
1013
1035
|
// src/components/useMenuSystem.tsx
|
|
1014
|
-
var
|
|
1036
|
+
var import_react8 = require("react");
|
|
1015
1037
|
function useSubMenuSystem(mobilePositionTo) {
|
|
1016
|
-
const [activeMenus, setActiveMenus] = (0,
|
|
1038
|
+
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
1017
1039
|
{}
|
|
1018
1040
|
);
|
|
1019
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
1020
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0,
|
|
1041
|
+
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
1042
|
+
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
1021
1043
|
null
|
|
1022
1044
|
);
|
|
1023
|
-
const menuRootRef = (0,
|
|
1024
|
-
const subMenuRefs = (0,
|
|
1025
|
-
const hoverTimeoutRef = (0,
|
|
1026
|
-
const closeTimeoutRef = (0,
|
|
1027
|
-
const mouseStopTimeoutRef = (0,
|
|
1028
|
-
const isMouseMovingRef = (0,
|
|
1029
|
-
const pendingOpenActionRef = (0,
|
|
1030
|
-
const pendingCloseActionRef = (0,
|
|
1045
|
+
const menuRootRef = (0, import_react8.useRef)(null);
|
|
1046
|
+
const subMenuRefs = (0, import_react8.useRef)({});
|
|
1047
|
+
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
1048
|
+
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
1049
|
+
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
1050
|
+
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
1051
|
+
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
1052
|
+
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
1031
1053
|
const isMobile = useMatchesMobile();
|
|
1032
1054
|
const toggleMenu = (menuId, level) => {
|
|
1033
1055
|
if (closeTimeoutRef.current) {
|
|
@@ -1067,7 +1089,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1067
1089
|
return newActiveMenus;
|
|
1068
1090
|
});
|
|
1069
1091
|
};
|
|
1070
|
-
const executePendingActions = (0,
|
|
1092
|
+
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
1071
1093
|
if (pendingCloseActionRef.current) {
|
|
1072
1094
|
pendingCloseActionRef.current();
|
|
1073
1095
|
pendingCloseActionRef.current = null;
|
|
@@ -1156,7 +1178,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1156
1178
|
const isMenuActive = (menuId, level) => {
|
|
1157
1179
|
return activeMenus[level] === menuId;
|
|
1158
1180
|
};
|
|
1159
|
-
(0,
|
|
1181
|
+
(0, import_react8.useEffect)(() => {
|
|
1160
1182
|
const handleClickOutside = (event) => {
|
|
1161
1183
|
var _a;
|
|
1162
1184
|
if (Object.keys(activeMenus).length === 0) return;
|
|
@@ -1175,7 +1197,7 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1175
1197
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1176
1198
|
};
|
|
1177
1199
|
}, [activeMenus]);
|
|
1178
|
-
(0,
|
|
1200
|
+
(0, import_react8.useEffect)(() => {
|
|
1179
1201
|
return () => {
|
|
1180
1202
|
if (hoverTimeoutRef.current) {
|
|
1181
1203
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -1253,13 +1275,13 @@ function useSubMenuSystem(mobilePositionTo) {
|
|
|
1253
1275
|
};
|
|
1254
1276
|
}
|
|
1255
1277
|
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1256
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1278
|
+
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1257
1279
|
top: 0,
|
|
1258
1280
|
left: 0,
|
|
1259
1281
|
minWidth: 0
|
|
1260
1282
|
});
|
|
1261
1283
|
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1262
|
-
const updatePosition = (0,
|
|
1284
|
+
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1263
1285
|
var _a, _b, _c;
|
|
1264
1286
|
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1265
1287
|
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
@@ -1307,7 +1329,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1307
1329
|
minWidth: triggerRect.width
|
|
1308
1330
|
});
|
|
1309
1331
|
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1310
|
-
(0,
|
|
1332
|
+
(0, import_react8.useEffect)(() => {
|
|
1311
1333
|
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1312
1334
|
const handleClickOutside = (event) => {
|
|
1313
1335
|
var _a, _b, _c, _d, _e;
|
|
@@ -1333,7 +1355,7 @@ function useMenuPosition(elementRef, position = "bottom", options) {
|
|
|
1333
1355
|
options == null ? void 0 : options.menuRef,
|
|
1334
1356
|
options == null ? void 0 : options.additionalRefs
|
|
1335
1357
|
]);
|
|
1336
|
-
(0,
|
|
1358
|
+
(0, import_react8.useEffect)(() => {
|
|
1337
1359
|
updatePosition();
|
|
1338
1360
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1339
1361
|
if (elementRef == null ? void 0 : elementRef.current) {
|
|
@@ -1414,9 +1436,9 @@ var Menu = (_a) => {
|
|
|
1414
1436
|
"menuName",
|
|
1415
1437
|
"calculateMinMaxHeight"
|
|
1416
1438
|
]);
|
|
1417
|
-
const internalRef = (0,
|
|
1439
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
1418
1440
|
const actualRef = ref || internalRef;
|
|
1419
|
-
const [maxHeight, setMaxHeight] = (0,
|
|
1441
|
+
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1420
1442
|
const isMobile = useMatchesMobile();
|
|
1421
1443
|
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1422
1444
|
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
@@ -1429,7 +1451,7 @@ var Menu = (_a) => {
|
|
|
1429
1451
|
isMobile: !!(isMobile && mobilePositionTo)
|
|
1430
1452
|
}
|
|
1431
1453
|
);
|
|
1432
|
-
(0,
|
|
1454
|
+
(0, import_react9.useEffect)(() => {
|
|
1433
1455
|
if (calculateMinMaxHeight) {
|
|
1434
1456
|
return;
|
|
1435
1457
|
}
|
|
@@ -1453,7 +1475,7 @@ var Menu = (_a) => {
|
|
|
1453
1475
|
cancelAnimationFrame(raf);
|
|
1454
1476
|
};
|
|
1455
1477
|
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1456
|
-
(0,
|
|
1478
|
+
(0, import_react9.useEffect)(() => {
|
|
1457
1479
|
if (!calculateMinMaxHeight) {
|
|
1458
1480
|
return;
|
|
1459
1481
|
}
|
|
@@ -1464,14 +1486,14 @@ var Menu = (_a) => {
|
|
|
1464
1486
|
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1465
1487
|
}
|
|
1466
1488
|
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1467
|
-
(0,
|
|
1489
|
+
(0, import_react9.useEffect)(() => {
|
|
1468
1490
|
if (!show) {
|
|
1469
1491
|
return;
|
|
1470
1492
|
}
|
|
1471
1493
|
initializeMenuFocus();
|
|
1472
1494
|
updatePosition();
|
|
1473
1495
|
}, [show, updatePosition]);
|
|
1474
|
-
(0,
|
|
1496
|
+
(0, import_react9.useEffect)(() => {
|
|
1475
1497
|
if (!show || !setShow) {
|
|
1476
1498
|
return;
|
|
1477
1499
|
}
|
|
@@ -1625,10 +1647,10 @@ var Menu = (_a) => {
|
|
|
1625
1647
|
Menu.displayName = "Menu";
|
|
1626
1648
|
|
|
1627
1649
|
// src/components/Search.tsx
|
|
1628
|
-
var
|
|
1650
|
+
var import_react11 = require("react");
|
|
1629
1651
|
|
|
1630
1652
|
// src/components/Input.tsx
|
|
1631
|
-
var
|
|
1653
|
+
var import_react10 = require("react");
|
|
1632
1654
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1633
1655
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1634
1656
|
var InputBase = (_a) => {
|
|
@@ -1685,9 +1707,9 @@ var InputBase = (_a) => {
|
|
|
1685
1707
|
"data-error": error && !focus || null,
|
|
1686
1708
|
"data-focus": focus || null
|
|
1687
1709
|
};
|
|
1688
|
-
const inputRef = (0,
|
|
1710
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
1689
1711
|
const inputId = id ? `${id}-input` : void 0;
|
|
1690
|
-
(0,
|
|
1712
|
+
(0, import_react10.useEffect)(() => {
|
|
1691
1713
|
var _a2;
|
|
1692
1714
|
const input = inputRef.current;
|
|
1693
1715
|
const focusHandler = () => {
|
|
@@ -1846,15 +1868,15 @@ var Input = (_a) => {
|
|
|
1846
1868
|
"testid",
|
|
1847
1869
|
"rightAdornment"
|
|
1848
1870
|
]);
|
|
1849
|
-
const [internalValue, setInternalValue] = (0,
|
|
1850
|
-
const [displayValue, setDisplayValue] = (0,
|
|
1851
|
-
(0,
|
|
1871
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
1872
|
+
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
1873
|
+
(0, import_react10.useEffect)(() => {
|
|
1852
1874
|
var _a2;
|
|
1853
1875
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
1854
1876
|
setInternalValue(stringValue);
|
|
1855
1877
|
setDisplayValue(stringValue);
|
|
1856
1878
|
}, [propValue]);
|
|
1857
|
-
(0,
|
|
1879
|
+
(0, import_react10.useEffect)(() => {
|
|
1858
1880
|
var _a2;
|
|
1859
1881
|
if (variant !== "currency") {
|
|
1860
1882
|
return;
|
|
@@ -2115,14 +2137,14 @@ var Search = (_a) => {
|
|
|
2115
2137
|
"removeRoundness",
|
|
2116
2138
|
"autocompletePadding"
|
|
2117
2139
|
]);
|
|
2118
|
-
const inputRef = (0,
|
|
2119
|
-
const inputContainerRef = (0,
|
|
2120
|
-
const preventFocusOnInitialRender = (0,
|
|
2121
|
-
const [show, setShow] = (0,
|
|
2122
|
-
const [clearing, setClearing] = (0,
|
|
2123
|
-
const uniqueId = (0,
|
|
2140
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2141
|
+
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
2142
|
+
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
2143
|
+
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2144
|
+
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2145
|
+
const uniqueId = (0, import_react11.useId)();
|
|
2124
2146
|
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2125
|
-
(0,
|
|
2147
|
+
(0, import_react11.useEffect)(() => {
|
|
2126
2148
|
var _a2;
|
|
2127
2149
|
if (preventFocusOnInitialRender.current) {
|
|
2128
2150
|
preventFocusOnInitialRender.current = false;
|
|
@@ -2206,7 +2228,7 @@ Search.displayName = "Search";
|
|
|
2206
2228
|
|
|
2207
2229
|
// src/components/DataGridCell.tsx
|
|
2208
2230
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2209
|
-
var DataGridCell = (0,
|
|
2231
|
+
var DataGridCell = (0, import_react12.memo)(
|
|
2210
2232
|
(_a) => {
|
|
2211
2233
|
var _b = _a, {
|
|
2212
2234
|
id,
|
|
@@ -2248,10 +2270,10 @@ var DataGridCell = (0, import_react11.memo)(
|
|
|
2248
2270
|
"testid"
|
|
2249
2271
|
]);
|
|
2250
2272
|
const Element = type === "header" ? "th" : "td";
|
|
2251
|
-
const timerRef = (0,
|
|
2252
|
-
const [isGrabbing, setIsGrabbing] = (0,
|
|
2253
|
-
const [isPointerPressed, setIsPointerPressed] = (0,
|
|
2254
|
-
(0,
|
|
2273
|
+
const timerRef = (0, import_react12.useRef)(null);
|
|
2274
|
+
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2275
|
+
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2276
|
+
(0, import_react12.useEffect)(() => {
|
|
2255
2277
|
return () => {
|
|
2256
2278
|
if (timerRef.current) {
|
|
2257
2279
|
clearTimeout(timerRef.current);
|
|
@@ -2361,12 +2383,12 @@ function DataCellHeader(_a) {
|
|
|
2361
2383
|
"useMenuDefaultMinWidth"
|
|
2362
2384
|
]);
|
|
2363
2385
|
var _a2;
|
|
2364
|
-
const [showMenu, setShowMenu] = (0,
|
|
2365
|
-
const [filter, setFilter] = (0,
|
|
2386
|
+
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2387
|
+
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2366
2388
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2367
2389
|
);
|
|
2368
|
-
const ref = (0,
|
|
2369
|
-
const predeterminedPinned = (0,
|
|
2390
|
+
const ref = (0, import_react12.useRef)(null);
|
|
2391
|
+
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2370
2392
|
const { column, getContext } = header;
|
|
2371
2393
|
const { id: columnId, setFilterValue } = column;
|
|
2372
2394
|
const {
|
|
@@ -2376,14 +2398,14 @@ function DataCellHeader(_a) {
|
|
|
2376
2398
|
listeners: subMenuListeners,
|
|
2377
2399
|
mobileHide
|
|
2378
2400
|
} = useSubMenuSystem(node ? node : ref);
|
|
2379
|
-
(0,
|
|
2401
|
+
(0, import_react12.useEffect)(() => {
|
|
2380
2402
|
var _a3, _b2, _c;
|
|
2381
2403
|
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2382
2404
|
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2383
2405
|
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2384
2406
|
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2385
2407
|
}, [columnId, getContext]);
|
|
2386
|
-
(0,
|
|
2408
|
+
(0, import_react12.useEffect)(() => {
|
|
2387
2409
|
const handler = setTimeout(() => {
|
|
2388
2410
|
setFilterValue(filter);
|
|
2389
2411
|
}, 500);
|
|
@@ -2646,7 +2668,7 @@ function DragAlongCell(_a) {
|
|
|
2646
2668
|
DragAlongCell.displayName = "DragAlongCell";
|
|
2647
2669
|
|
|
2648
2670
|
// src/components/DataGrid/index.tsx
|
|
2649
|
-
var
|
|
2671
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
2650
2672
|
var import_react_table3 = require("@tanstack/react-table");
|
|
2651
2673
|
var import_core = require("@dnd-kit/core");
|
|
2652
2674
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -2674,7 +2696,7 @@ function getSortIcon(sort, nextSort = false) {
|
|
|
2674
2696
|
}
|
|
2675
2697
|
|
|
2676
2698
|
// src/components/DataGrid/PinnedColumns.tsx
|
|
2677
|
-
var
|
|
2699
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
2678
2700
|
|
|
2679
2701
|
// src/components/DataGrid/TableBody/index.tsx
|
|
2680
2702
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
@@ -2683,7 +2705,7 @@ var import_clsx12 = __toESM(require("clsx"), 1);
|
|
|
2683
2705
|
// src/components/DataGrid/TableBody/TableBodyRow.tsx
|
|
2684
2706
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
2685
2707
|
var import_react_table = require("@tanstack/react-table");
|
|
2686
|
-
var
|
|
2708
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2687
2709
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2688
2710
|
var valueFormatters = {
|
|
2689
2711
|
date: (value) => typeof value === "string" ? formatDate(value) : "",
|
|
@@ -2751,7 +2773,7 @@ function TableBodyRow({
|
|
|
2751
2773
|
const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
|
|
2752
2774
|
const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
|
|
2753
2775
|
const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
|
|
2754
|
-
return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2776
|
+
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)(
|
|
2755
2777
|
CellElement,
|
|
2756
2778
|
{
|
|
2757
2779
|
id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
|
|
@@ -2930,10 +2952,10 @@ function TableBody({
|
|
|
2930
2952
|
}
|
|
2931
2953
|
|
|
2932
2954
|
// src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
|
|
2933
|
-
var
|
|
2955
|
+
var import_react15 = require("react");
|
|
2934
2956
|
|
|
2935
2957
|
// src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
|
|
2936
|
-
var
|
|
2958
|
+
var import_react14 = require("react");
|
|
2937
2959
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2938
2960
|
function ColumnSelectorMenuOption({
|
|
2939
2961
|
id,
|
|
@@ -2941,7 +2963,7 @@ function ColumnSelectorMenuOption({
|
|
|
2941
2963
|
column,
|
|
2942
2964
|
toggleColumnVisibility
|
|
2943
2965
|
}) {
|
|
2944
|
-
const [isVisible, setIsVisible] = (0,
|
|
2966
|
+
const [isVisible, setIsVisible] = (0, import_react14.useState)(column.getIsVisible());
|
|
2945
2967
|
const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
|
|
2946
2968
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MenuOption, { id, testid, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2947
2969
|
Checkbox,
|
|
@@ -2967,8 +2989,8 @@ function ColumnSelectorHeaderCell({
|
|
|
2967
2989
|
toggleColumnVisibility,
|
|
2968
2990
|
resetColumnVisibility
|
|
2969
2991
|
}) {
|
|
2970
|
-
const ref = (0,
|
|
2971
|
-
const [show, setShow] = (0,
|
|
2992
|
+
const ref = (0, import_react15.useRef)(null);
|
|
2993
|
+
const [show, setShow] = (0, import_react15.useState)(false);
|
|
2972
2994
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2973
2995
|
DataGridCell,
|
|
2974
2996
|
{
|
|
@@ -3137,7 +3159,7 @@ function PinnedColumns(_a) {
|
|
|
3137
3159
|
header.id
|
|
3138
3160
|
);
|
|
3139
3161
|
}
|
|
3140
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3162
|
+
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)(
|
|
3141
3163
|
Checkbox,
|
|
3142
3164
|
{
|
|
3143
3165
|
checked: allSelectedAcrossPages,
|
|
@@ -3219,23 +3241,23 @@ function DataGrid({
|
|
|
3219
3241
|
ref
|
|
3220
3242
|
}) {
|
|
3221
3243
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3222
|
-
(0,
|
|
3244
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
3223
3245
|
getSavedLayout: () => {
|
|
3224
3246
|
return getSavedLayout();
|
|
3225
3247
|
}
|
|
3226
3248
|
}));
|
|
3227
|
-
const [localSorting, setLocalSorting] = (0,
|
|
3228
|
-
const [localColumnFilters, setLocalColumnFilters] = (0,
|
|
3229
|
-
const [localRowSelection, setLocalRowSelection] = (0,
|
|
3249
|
+
const [localSorting, setLocalSorting] = (0, import_react17.useState)([]);
|
|
3250
|
+
const [localColumnFilters, setLocalColumnFilters] = (0, import_react17.useState)([]);
|
|
3251
|
+
const [localRowSelection, setLocalRowSelection] = (0, import_react17.useState)({});
|
|
3230
3252
|
const {
|
|
3231
3253
|
columns: tableColumns,
|
|
3232
3254
|
setColumns: setTableColumns,
|
|
3233
3255
|
getSavedLayout
|
|
3234
3256
|
} = useTableLayout(columns, id != null ? id : testid);
|
|
3235
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
3257
|
+
const [columnOrder, setColumnOrder] = (0, import_react17.useState)(
|
|
3236
3258
|
tableColumns.map((c) => c.id)
|
|
3237
3259
|
);
|
|
3238
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3260
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react17.useState)(
|
|
3239
3261
|
Object.fromEntries(
|
|
3240
3262
|
tableColumns.filter((column) => !!column.id).map((column) => {
|
|
3241
3263
|
var _a2, _b2;
|
|
@@ -3243,7 +3265,7 @@ function DataGrid({
|
|
|
3243
3265
|
})
|
|
3244
3266
|
)
|
|
3245
3267
|
);
|
|
3246
|
-
const updateColumnVisibility = (0,
|
|
3268
|
+
const updateColumnVisibility = (0, import_react17.useCallback)(
|
|
3247
3269
|
(updateOrder) => {
|
|
3248
3270
|
setColumnVisibility(
|
|
3249
3271
|
Object.fromEntries(
|
|
@@ -3257,7 +3279,7 @@ function DataGrid({
|
|
|
3257
3279
|
},
|
|
3258
3280
|
[tableColumns]
|
|
3259
3281
|
);
|
|
3260
|
-
const resetDefaultColumnVisibility = (0,
|
|
3282
|
+
const resetDefaultColumnVisibility = (0, import_react17.useCallback)(() => {
|
|
3261
3283
|
setTableColumns((prev) => {
|
|
3262
3284
|
columns.forEach((column) => {
|
|
3263
3285
|
var _a2, _b2;
|
|
@@ -3273,7 +3295,7 @@ function DataGrid({
|
|
|
3273
3295
|
return [...prev];
|
|
3274
3296
|
}, true);
|
|
3275
3297
|
}, [columns, setTableColumns]);
|
|
3276
|
-
(0,
|
|
3298
|
+
(0, import_react17.useEffect)(() => {
|
|
3277
3299
|
updateColumnVisibility(true);
|
|
3278
3300
|
}, [updateColumnVisibility]);
|
|
3279
3301
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
@@ -3289,7 +3311,7 @@ function DataGrid({
|
|
|
3289
3311
|
(onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
|
|
3290
3312
|
} : setLocalColumnFilters;
|
|
3291
3313
|
const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
|
|
3292
|
-
const setRowSelection = (0,
|
|
3314
|
+
const setRowSelection = (0, import_react17.useCallback)(
|
|
3293
3315
|
(updaterOrValue) => {
|
|
3294
3316
|
if (pagination) {
|
|
3295
3317
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
|
|
@@ -3303,9 +3325,9 @@ function DataGrid({
|
|
|
3303
3325
|
},
|
|
3304
3326
|
[externalRowSelection, onRowSelectionChange, pagination]
|
|
3305
3327
|
);
|
|
3306
|
-
const dndId = (0,
|
|
3307
|
-
const containerRef =
|
|
3308
|
-
const toggleColumnVisibility = (0,
|
|
3328
|
+
const dndId = (0, import_react17.useId)();
|
|
3329
|
+
const containerRef = import_react17.default.useRef(null);
|
|
3330
|
+
const toggleColumnVisibility = (0, import_react17.useCallback)(
|
|
3309
3331
|
(columnId, isVisible) => {
|
|
3310
3332
|
setTableColumns((prev) => {
|
|
3311
3333
|
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
@@ -3553,7 +3575,7 @@ function DataGrid({
|
|
|
3553
3575
|
header.id
|
|
3554
3576
|
);
|
|
3555
3577
|
}
|
|
3556
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3578
|
+
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)(
|
|
3557
3579
|
DataGridCell,
|
|
3558
3580
|
{
|
|
3559
3581
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
@@ -3759,7 +3781,7 @@ function adaptTableStateSetter(setter) {
|
|
|
3759
3781
|
}
|
|
3760
3782
|
|
|
3761
3783
|
// src/components/Select.tsx
|
|
3762
|
-
var
|
|
3784
|
+
var import_react18 = require("react");
|
|
3763
3785
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
3764
3786
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3765
3787
|
var Select = (_a) => {
|
|
@@ -3793,11 +3815,11 @@ var Select = (_a) => {
|
|
|
3793
3815
|
"value"
|
|
3794
3816
|
]);
|
|
3795
3817
|
var _a2;
|
|
3796
|
-
const inputRef = (0,
|
|
3797
|
-
const inputContainerRef = (0,
|
|
3798
|
-
const preventFocusOnInitialRender = (0,
|
|
3799
|
-
const [show, setShow] = (0,
|
|
3800
|
-
(0,
|
|
3818
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
3819
|
+
const inputContainerRef = (0, import_react18.useRef)(null);
|
|
3820
|
+
const preventFocusOnInitialRender = (0, import_react18.useRef)(true);
|
|
3821
|
+
const [show, setShow] = (0, import_react18.useState)(false);
|
|
3822
|
+
(0, import_react18.useEffect)(() => {
|
|
3801
3823
|
var _a3;
|
|
3802
3824
|
if (preventFocusOnInitialRender.current) {
|
|
3803
3825
|
preventFocusOnInitialRender.current = false;
|
|
@@ -4219,7 +4241,7 @@ Button.displayName = "Button";
|
|
|
4219
4241
|
|
|
4220
4242
|
// src/components/Tooltip.tsx
|
|
4221
4243
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4222
|
-
var
|
|
4244
|
+
var import_react19 = require("react");
|
|
4223
4245
|
var import_react_dom2 = require("react-dom");
|
|
4224
4246
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4225
4247
|
var Tooltip = ({
|
|
@@ -4232,11 +4254,11 @@ var Tooltip = ({
|
|
|
4232
4254
|
offset = 8,
|
|
4233
4255
|
keepHidden = false
|
|
4234
4256
|
}) => {
|
|
4235
|
-
const ref = (0,
|
|
4236
|
-
const tooltipRef = (0,
|
|
4237
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
4238
|
-
const [isVisible, setIsVisible] = (0,
|
|
4239
|
-
const [removeOpacity, setRemoveOpacity] = (0,
|
|
4257
|
+
const ref = (0, import_react19.useRef)(null);
|
|
4258
|
+
const tooltipRef = (0, import_react19.useRef)(null);
|
|
4259
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react19.useState)({ top: 0, left: 0 });
|
|
4260
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
4261
|
+
const [removeOpacity, setRemoveOpacity] = (0, import_react19.useState)(false);
|
|
4240
4262
|
const updatePosition = () => {
|
|
4241
4263
|
if (!ref.current || !tooltipRef.current) return;
|
|
4242
4264
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -4275,14 +4297,14 @@ var Tooltip = ({
|
|
|
4275
4297
|
setIsVisible(false);
|
|
4276
4298
|
setRemoveOpacity(false);
|
|
4277
4299
|
};
|
|
4278
|
-
(0,
|
|
4300
|
+
(0, import_react19.useEffect)(() => {
|
|
4279
4301
|
if (isVisible && tooltipRef.current) {
|
|
4280
4302
|
requestAnimationFrame(() => {
|
|
4281
4303
|
updatePosition();
|
|
4282
4304
|
});
|
|
4283
4305
|
}
|
|
4284
4306
|
}, [isVisible]);
|
|
4285
|
-
(0,
|
|
4307
|
+
(0, import_react19.useEffect)(() => {
|
|
4286
4308
|
if (isVisible) {
|
|
4287
4309
|
window.addEventListener("resize", updatePosition);
|
|
4288
4310
|
return () => window.removeEventListener("resize", updatePosition);
|
|
@@ -4340,12 +4362,12 @@ var Tooltip = ({
|
|
|
4340
4362
|
Tooltip.displayName = "Tooltip";
|
|
4341
4363
|
|
|
4342
4364
|
// src/components/DateInput.tsx
|
|
4343
|
-
var
|
|
4365
|
+
var import_react21 = require("react");
|
|
4344
4366
|
var import_react_dom3 = require("react-dom");
|
|
4345
4367
|
|
|
4346
4368
|
// src/components/CalendarRange.tsx
|
|
4347
4369
|
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
4348
|
-
var
|
|
4370
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
4349
4371
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
4350
4372
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4351
4373
|
function DateCell(_a) {
|
|
@@ -4458,20 +4480,20 @@ function CalendarRange({
|
|
|
4458
4480
|
const fromDate = parseDate(from);
|
|
4459
4481
|
const toDate = parseDate(to);
|
|
4460
4482
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4461
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
4483
|
+
const [baseMonth, setBaseMonth] = (0, import_react20.useState)(
|
|
4462
4484
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4463
4485
|
);
|
|
4464
|
-
const [selecting, setSelecting] = (0,
|
|
4465
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4466
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4467
|
-
(0,
|
|
4486
|
+
const [selecting, setSelecting] = (0, import_react20.useState)("from");
|
|
4487
|
+
const [pendingFrom, setPendingFrom] = (0, import_react20.useState)(void 0);
|
|
4488
|
+
const [hoveredDate, setHoveredDate] = (0, import_react20.useState)(void 0);
|
|
4489
|
+
(0, import_react20.useEffect)(() => {
|
|
4468
4490
|
if (fromDate) {
|
|
4469
4491
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4470
4492
|
} else if (toDate) {
|
|
4471
4493
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4472
4494
|
}
|
|
4473
4495
|
}, [from, to]);
|
|
4474
|
-
(0,
|
|
4496
|
+
(0, import_react20.useEffect)(() => {
|
|
4475
4497
|
if (fromDate && toDate) {
|
|
4476
4498
|
setSelecting("from");
|
|
4477
4499
|
setPendingFrom(void 0);
|
|
@@ -4617,14 +4639,14 @@ function CalendarPane({
|
|
|
4617
4639
|
const years = Array.from({ length: 100 }).map(
|
|
4618
4640
|
(_, i) => baseMonth.year - 50 + i
|
|
4619
4641
|
);
|
|
4620
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
4621
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
4622
|
-
const monthMenuRef = (0,
|
|
4623
|
-
const yearMenuRef = (0,
|
|
4642
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react20.useState)(false);
|
|
4643
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react20.useState)(false);
|
|
4644
|
+
const monthMenuRef = (0, import_react20.useRef)(null);
|
|
4645
|
+
const yearMenuRef = (0, import_react20.useRef)(null);
|
|
4624
4646
|
const month = getMonthData(offset);
|
|
4625
4647
|
const totalCells = 42;
|
|
4626
4648
|
const emptyCells = month.firstDayOffset;
|
|
4627
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react20.default.Fragment, { children: [
|
|
4628
4650
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4629
4651
|
"div",
|
|
4630
4652
|
{
|
|
@@ -4832,24 +4854,24 @@ var DateInput = (_a) => {
|
|
|
4832
4854
|
"label",
|
|
4833
4855
|
"isDateAvailable"
|
|
4834
4856
|
]);
|
|
4835
|
-
const [visible, setVisible] = (0,
|
|
4836
|
-
const [inputValue, setInputValue] = (0,
|
|
4837
|
-
const [isTyping, setIsTyping] = (0,
|
|
4838
|
-
const popoverRef = (0,
|
|
4839
|
-
const triggerRef = (0,
|
|
4840
|
-
const rootRef = (0,
|
|
4841
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
4857
|
+
const [visible, setVisible] = (0, import_react21.useState)(false);
|
|
4858
|
+
const [inputValue, setInputValue] = (0, import_react21.useState)("");
|
|
4859
|
+
const [isTyping, setIsTyping] = (0, import_react21.useState)(false);
|
|
4860
|
+
const popoverRef = (0, import_react21.useRef)(null);
|
|
4861
|
+
const triggerRef = (0, import_react21.useRef)(null);
|
|
4862
|
+
const rootRef = (0, import_react21.useRef)(null);
|
|
4863
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react21.useState)({
|
|
4842
4864
|
top: 0,
|
|
4843
4865
|
left: 0,
|
|
4844
4866
|
width: 0
|
|
4845
4867
|
});
|
|
4846
4868
|
const [from, to] = [value, ""];
|
|
4847
|
-
(0,
|
|
4869
|
+
(0, import_react21.useEffect)(() => {
|
|
4848
4870
|
if (!isTyping) {
|
|
4849
4871
|
setInputValue(formatDisplayValue(from));
|
|
4850
4872
|
}
|
|
4851
4873
|
}, [from, isTyping]);
|
|
4852
|
-
(0,
|
|
4874
|
+
(0, import_react21.useLayoutEffect)(() => {
|
|
4853
4875
|
if (visible) {
|
|
4854
4876
|
updatePosition();
|
|
4855
4877
|
}
|
|
@@ -4864,7 +4886,7 @@ var DateInput = (_a) => {
|
|
|
4864
4886
|
});
|
|
4865
4887
|
}
|
|
4866
4888
|
};
|
|
4867
|
-
(0,
|
|
4889
|
+
(0, import_react21.useEffect)(() => {
|
|
4868
4890
|
updatePosition();
|
|
4869
4891
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4870
4892
|
if (triggerRef.current) {
|
|
@@ -4876,7 +4898,7 @@ var DateInput = (_a) => {
|
|
|
4876
4898
|
window.removeEventListener("scroll", updatePosition);
|
|
4877
4899
|
};
|
|
4878
4900
|
}, []);
|
|
4879
|
-
(0,
|
|
4901
|
+
(0, import_react21.useEffect)(() => {
|
|
4880
4902
|
const handleKeyDown2 = (event) => {
|
|
4881
4903
|
var _a2;
|
|
4882
4904
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -4889,7 +4911,7 @@ var DateInput = (_a) => {
|
|
|
4889
4911
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
4890
4912
|
};
|
|
4891
4913
|
});
|
|
4892
|
-
(0,
|
|
4914
|
+
(0, import_react21.useEffect)(() => {
|
|
4893
4915
|
const handleClickOutside = (event) => {
|
|
4894
4916
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4895
4917
|
setVisible(false);
|
|
@@ -5110,14 +5132,14 @@ Heading3.displayName = "Heading3";
|
|
|
5110
5132
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5111
5133
|
|
|
5112
5134
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5113
|
-
var
|
|
5135
|
+
var import_react24 = require("react");
|
|
5114
5136
|
|
|
5115
5137
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
5116
|
-
var
|
|
5138
|
+
var import_react23 = require("react");
|
|
5117
5139
|
|
|
5118
5140
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
5119
|
-
var
|
|
5120
|
-
var GridContext = (0,
|
|
5141
|
+
var import_react22 = require("react");
|
|
5142
|
+
var GridContext = (0, import_react22.createContext)(null);
|
|
5121
5143
|
|
|
5122
5144
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5123
5145
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -5126,12 +5148,12 @@ var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
|
5126
5148
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5127
5149
|
|
|
5128
5150
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
5129
|
-
var
|
|
5151
|
+
var import_react25 = require("react");
|
|
5130
5152
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5131
5153
|
|
|
5132
5154
|
// src/components/Modal.tsx
|
|
5133
5155
|
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
5134
|
-
var
|
|
5156
|
+
var import_react27 = require("react");
|
|
5135
5157
|
|
|
5136
5158
|
// src/components/ModalHeader.tsx
|
|
5137
5159
|
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
@@ -5307,10 +5329,10 @@ var import_react_dom4 = require("react-dom");
|
|
|
5307
5329
|
var import_react_use = require("react-use");
|
|
5308
5330
|
|
|
5309
5331
|
// src/components/useMounted.tsx
|
|
5310
|
-
var
|
|
5332
|
+
var import_react26 = require("react");
|
|
5311
5333
|
var useMounted = () => {
|
|
5312
|
-
const [isMounted, setIsMounted] = (0,
|
|
5313
|
-
(0,
|
|
5334
|
+
const [isMounted, setIsMounted] = (0, import_react26.useState)(false);
|
|
5335
|
+
(0, import_react26.useEffect)(() => {
|
|
5314
5336
|
setIsMounted(true);
|
|
5315
5337
|
return () => setIsMounted(false);
|
|
5316
5338
|
}, []);
|
|
@@ -5404,12 +5426,12 @@ var Modal = ({
|
|
|
5404
5426
|
}) => {
|
|
5405
5427
|
var _a;
|
|
5406
5428
|
const mounted = useMounted();
|
|
5407
|
-
const modalRef = (0,
|
|
5408
|
-
const bgRef = (0,
|
|
5429
|
+
const modalRef = (0, import_react27.useRef)(null);
|
|
5430
|
+
const bgRef = (0, import_react27.useRef)(null);
|
|
5409
5431
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5410
5432
|
const isMobile = useMatchesMobile();
|
|
5411
5433
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5412
|
-
(0,
|
|
5434
|
+
(0, import_react27.useEffect)(() => {
|
|
5413
5435
|
if (!mounted) return;
|
|
5414
5436
|
if (!modalRef.current || !bgRef.current) {
|
|
5415
5437
|
console.error("Modal or background reference is not set.");
|
|
@@ -5429,7 +5451,7 @@ var Modal = ({
|
|
|
5429
5451
|
bgFadeIn(bgRef.current);
|
|
5430
5452
|
}
|
|
5431
5453
|
}, [mounted, onClose, open, wasOpen]);
|
|
5432
|
-
const handleKeyDown = (0,
|
|
5454
|
+
const handleKeyDown = (0, import_react27.useCallback)(
|
|
5433
5455
|
(e) => {
|
|
5434
5456
|
if (e.key === "Escape") {
|
|
5435
5457
|
if (onClose) {
|
|
@@ -5440,12 +5462,12 @@ var Modal = ({
|
|
|
5440
5462
|
},
|
|
5441
5463
|
[onClose]
|
|
5442
5464
|
);
|
|
5443
|
-
const handleClose = (0,
|
|
5465
|
+
const handleClose = (0, import_react27.useCallback)(() => {
|
|
5444
5466
|
if (onClose) {
|
|
5445
5467
|
onClose();
|
|
5446
5468
|
}
|
|
5447
5469
|
}, [onClose]);
|
|
5448
|
-
(0,
|
|
5470
|
+
(0, import_react27.useEffect)(() => {
|
|
5449
5471
|
if (open) {
|
|
5450
5472
|
document.addEventListener("keyup", handleKeyDown);
|
|
5451
5473
|
}
|
|
@@ -5453,7 +5475,7 @@ var Modal = ({
|
|
|
5453
5475
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5454
5476
|
};
|
|
5455
5477
|
}, [open, handleKeyDown]);
|
|
5456
|
-
(0,
|
|
5478
|
+
(0, import_react27.useEffect)(() => {
|
|
5457
5479
|
if (!open) return;
|
|
5458
5480
|
const scrollY = window.scrollY;
|
|
5459
5481
|
const body = document.body;
|
|
@@ -5474,7 +5496,7 @@ var Modal = ({
|
|
|
5474
5496
|
};
|
|
5475
5497
|
}, [open]);
|
|
5476
5498
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5477
|
-
const backgroundClickHandler = (0,
|
|
5499
|
+
const backgroundClickHandler = (0, import_react27.useCallback)(
|
|
5478
5500
|
(e) => {
|
|
5479
5501
|
const target = e.target;
|
|
5480
5502
|
const currentTarget = e.currentTarget;
|
|
@@ -5583,10 +5605,10 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
|
5583
5605
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5584
5606
|
|
|
5585
5607
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5586
|
-
var
|
|
5608
|
+
var import_react29 = require("react");
|
|
5587
5609
|
|
|
5588
5610
|
// src/components/ImagePlaceholder.tsx
|
|
5589
|
-
var
|
|
5611
|
+
var import_react28 = require("react");
|
|
5590
5612
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5591
5613
|
|
|
5592
5614
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
@@ -5597,11 +5619,11 @@ var import_clsx32 = __toESM(require("clsx"), 1);
|
|
|
5597
5619
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5598
5620
|
|
|
5599
5621
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5600
|
-
var
|
|
5622
|
+
var import_react30 = require("react");
|
|
5601
5623
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5602
5624
|
|
|
5603
5625
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5604
|
-
var
|
|
5626
|
+
var import_react31 = require("react");
|
|
5605
5627
|
|
|
5606
5628
|
// src/components/Surface.tsx
|
|
5607
5629
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
@@ -5646,17 +5668,17 @@ var import_clsx34 = require("clsx");
|
|
|
5646
5668
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5647
5669
|
|
|
5648
5670
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
5649
|
-
var
|
|
5671
|
+
var import_react32 = require("react");
|
|
5650
5672
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5651
5673
|
|
|
5652
5674
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
5653
|
-
var
|
|
5675
|
+
var import_react33 = require("react");
|
|
5654
5676
|
|
|
5655
5677
|
// src/components/ProductImagePreview/index.tsx
|
|
5656
5678
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5657
5679
|
|
|
5658
5680
|
// src/components/CompactImagesPreview.tsx
|
|
5659
|
-
var
|
|
5681
|
+
var import_react34 = require("react");
|
|
5660
5682
|
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
5661
5683
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5662
5684
|
|
|
@@ -5665,12 +5687,12 @@ var import_clsx36 = __toESM(require("clsx"), 1);
|
|
|
5665
5687
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5666
5688
|
|
|
5667
5689
|
// src/components/ListGroup.tsx
|
|
5668
|
-
var
|
|
5690
|
+
var import_react35 = require("react");
|
|
5669
5691
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
5670
5692
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5671
5693
|
|
|
5672
5694
|
// src/components/Pagination.tsx
|
|
5673
|
-
var
|
|
5695
|
+
var import_react36 = require("react");
|
|
5674
5696
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
5675
5697
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5676
5698
|
var Pagination = ({
|
|
@@ -5682,7 +5704,7 @@ var Pagination = ({
|
|
|
5682
5704
|
className,
|
|
5683
5705
|
disabled
|
|
5684
5706
|
}) => {
|
|
5685
|
-
const goTo = (0,
|
|
5707
|
+
const goTo = (0, import_react36.useCallback)(
|
|
5686
5708
|
(page) => {
|
|
5687
5709
|
if (disabled) return;
|
|
5688
5710
|
onPageChange(page);
|
|
@@ -5699,7 +5721,7 @@ var Pagination = ({
|
|
|
5699
5721
|
goTo(currentPage + 1);
|
|
5700
5722
|
}
|
|
5701
5723
|
};
|
|
5702
|
-
const pageTokens = (0,
|
|
5724
|
+
const pageTokens = (0, import_react36.useMemo)(() => {
|
|
5703
5725
|
if (totalPages <= 5) {
|
|
5704
5726
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5705
5727
|
}
|
|
@@ -5822,21 +5844,21 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
|
5822
5844
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5823
5845
|
|
|
5824
5846
|
// src/components/SearchResultImage/index.tsx
|
|
5825
|
-
var
|
|
5847
|
+
var import_react37 = require("react");
|
|
5826
5848
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5827
5849
|
|
|
5828
5850
|
// src/components/Alert.tsx
|
|
5829
5851
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
5830
|
-
var
|
|
5852
|
+
var import_react38 = require("react");
|
|
5831
5853
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5832
5854
|
|
|
5833
5855
|
// src/components/OrderCheckIcon.tsx
|
|
5834
5856
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5835
5857
|
|
|
5836
5858
|
// src/components/EditingContext.tsx
|
|
5837
|
-
var
|
|
5859
|
+
var import_react39 = require("react");
|
|
5838
5860
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5839
|
-
var EditingContext = (0,
|
|
5861
|
+
var EditingContext = (0, import_react39.createContext)(null);
|
|
5840
5862
|
|
|
5841
5863
|
// src/components/AccessCard.tsx
|
|
5842
5864
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
@@ -5970,7 +5992,7 @@ var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
|
5970
5992
|
|
|
5971
5993
|
// src/components/AccessCardGroup.tsx
|
|
5972
5994
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
5973
|
-
var
|
|
5995
|
+
var import_react40 = require("react");
|
|
5974
5996
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5975
5997
|
|
|
5976
5998
|
// src/components/DataGrid/TableBody/LoadingCell.tsx
|