@dmsi/wedgekit-react 0.0.257 → 0.0.259
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-7PWT532Y.js → chunk-6GAYJCFE.js} +1 -1
- package/dist/{chunk-2MZ5WKCL.js → chunk-ANDTMNGV.js} +1 -1
- package/dist/{chunk-SYN5FFHV.js → chunk-I3WFZOFY.js} +1 -1
- package/dist/{chunk-KIAURU7N.js → chunk-OAIAELMQ.js} +24 -8
- package/dist/{chunk-5NIAGAA7.js → chunk-RJUN52HJ.js} +9 -2
- package/dist/components/CalendarRange.cjs +29 -6
- package/dist/components/CalendarRange.js +5 -5
- package/dist/components/DataGridCell.cjs +9 -2
- package/dist/components/DataGridCell.js +3 -3
- package/dist/components/DateInput.cjs +35 -10
- package/dist/components/DateInput.js +11 -9
- package/dist/components/DateRangeInput.cjs +35 -10
- package/dist/components/DateRangeInput.js +11 -9
- package/dist/components/FilterGroup.cjs +9 -2
- package/dist/components/FilterGroup.js +2 -2
- package/dist/components/Input.cjs +9 -2
- package/dist/components/Input.js +1 -1
- package/dist/components/Password.cjs +9 -2
- package/dist/components/Password.js +1 -1
- package/dist/components/Search.cjs +9 -2
- package/dist/components/Search.js +2 -2
- package/dist/components/Select.cjs +9 -2
- package/dist/components/Select.js +2 -2
- package/dist/components/Stepper.cjs +9 -2
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Time.cjs +9 -2
- package/dist/components/Time.js +1 -1
- package/dist/components/index.cjs +29 -6
- package/dist/components/index.js +5 -5
- package/package.json +1 -1
- package/src/components/DataGrid/index.tsx +22 -4
- package/src/components/DateInput.tsx +6 -4
- package/src/components/DateRangeInput.tsx +6 -4
- package/src/components/Input.tsx +7 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-QQ5G773N.js";
|
|
4
4
|
import {
|
|
5
5
|
Select
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-I3WFZOFY.js";
|
|
7
7
|
import {
|
|
8
8
|
Checkbox
|
|
9
9
|
} from "./chunk-NO5BIKWS.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
DataGridCell,
|
|
13
13
|
DragAlongCell,
|
|
14
14
|
DraggableCellHeader
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ANDTMNGV.js";
|
|
16
16
|
import {
|
|
17
17
|
Menu
|
|
18
18
|
} from "./chunk-PGSDEGBP.js";
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
} from "./chunk-TYTD4FLW.js";
|
|
29
29
|
import {
|
|
30
30
|
Search
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-6GAYJCFE.js";
|
|
32
32
|
import {
|
|
33
33
|
Input
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-RJUN52HJ.js";
|
|
35
35
|
import {
|
|
36
36
|
formatCurrencyDisplay
|
|
37
37
|
} from "./chunk-5UH6QUFB.js";
|
|
@@ -689,7 +689,7 @@ function DataGrid({
|
|
|
689
689
|
})
|
|
690
690
|
)
|
|
691
691
|
);
|
|
692
|
-
const
|
|
692
|
+
const updateColumnVisibility = useCallback(
|
|
693
693
|
(updateOrder) => {
|
|
694
694
|
setColumnVisibility(
|
|
695
695
|
Object.fromEntries(
|
|
@@ -703,9 +703,25 @@ function DataGrid({
|
|
|
703
703
|
},
|
|
704
704
|
[tableColumns]
|
|
705
705
|
);
|
|
706
|
+
const resetDefaultColumnVisibility = useCallback(() => {
|
|
707
|
+
setTableColumns((prev) => {
|
|
708
|
+
columns.forEach((column) => {
|
|
709
|
+
var _a2, _b2;
|
|
710
|
+
const columnId = column.id;
|
|
711
|
+
const isVisible = (_b2 = (_a2 = column.meta) == null ? void 0 : _a2.visible) != null ? _b2 : true;
|
|
712
|
+
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
713
|
+
if (persistedIndex !== -1) {
|
|
714
|
+
prev[persistedIndex].meta = __spreadProps(__spreadValues({}, prev[persistedIndex].meta), {
|
|
715
|
+
visible: isVisible
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
return [...prev];
|
|
720
|
+
}, true);
|
|
721
|
+
}, [columns, setTableColumns]);
|
|
706
722
|
useEffect(() => {
|
|
707
|
-
|
|
708
|
-
}, [
|
|
723
|
+
updateColumnVisibility(true);
|
|
724
|
+
}, [updateColumnVisibility]);
|
|
709
725
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
710
726
|
const setSortingState = pagination ? (updaterOrValue) => {
|
|
711
727
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(
|
|
@@ -1043,7 +1059,7 @@ function DataGrid({
|
|
|
1043
1059
|
id,
|
|
1044
1060
|
enableColumnSelector,
|
|
1045
1061
|
toggleColumnVisibility,
|
|
1046
|
-
resetColumnVisibility,
|
|
1062
|
+
resetColumnVisibility: resetDefaultColumnVisibility,
|
|
1047
1063
|
testid,
|
|
1048
1064
|
pinDirection: "right",
|
|
1049
1065
|
table,
|
|
@@ -50,7 +50,8 @@ var InputBase = (_a) => {
|
|
|
50
50
|
wrapperClassName,
|
|
51
51
|
focus,
|
|
52
52
|
secondaryIconColor,
|
|
53
|
-
fullWidth = true
|
|
53
|
+
fullWidth = true,
|
|
54
|
+
wrapperRef
|
|
54
55
|
} = _b, props = __objRest(_b, [
|
|
55
56
|
"id",
|
|
56
57
|
"testid",
|
|
@@ -70,7 +71,8 @@ var InputBase = (_a) => {
|
|
|
70
71
|
"wrapperClassName",
|
|
71
72
|
"focus",
|
|
72
73
|
"secondaryIconColor",
|
|
73
|
-
"fullWidth"
|
|
74
|
+
"fullWidth",
|
|
75
|
+
"wrapperRef"
|
|
74
76
|
]);
|
|
75
77
|
const attributes = {
|
|
76
78
|
"data-error": error && !focus || null,
|
|
@@ -161,6 +163,11 @@ var InputBase = (_a) => {
|
|
|
161
163
|
inputReadOnlyClass,
|
|
162
164
|
wrapperClassName
|
|
163
165
|
),
|
|
166
|
+
ref: (el) => {
|
|
167
|
+
if (wrapperRef) {
|
|
168
|
+
wrapperRef.current = el;
|
|
169
|
+
}
|
|
170
|
+
},
|
|
164
171
|
children: [
|
|
165
172
|
before,
|
|
166
173
|
/* @__PURE__ */ jsx(
|
|
@@ -1404,7 +1404,8 @@ var InputBase = (_a) => {
|
|
|
1404
1404
|
wrapperClassName,
|
|
1405
1405
|
focus,
|
|
1406
1406
|
secondaryIconColor,
|
|
1407
|
-
fullWidth = true
|
|
1407
|
+
fullWidth = true,
|
|
1408
|
+
wrapperRef
|
|
1408
1409
|
} = _b, props = __objRest(_b, [
|
|
1409
1410
|
"id",
|
|
1410
1411
|
"testid",
|
|
@@ -1424,7 +1425,8 @@ var InputBase = (_a) => {
|
|
|
1424
1425
|
"wrapperClassName",
|
|
1425
1426
|
"focus",
|
|
1426
1427
|
"secondaryIconColor",
|
|
1427
|
-
"fullWidth"
|
|
1428
|
+
"fullWidth",
|
|
1429
|
+
"wrapperRef"
|
|
1428
1430
|
]);
|
|
1429
1431
|
const attributes = {
|
|
1430
1432
|
"data-error": error && !focus || null,
|
|
@@ -1515,6 +1517,11 @@ var InputBase = (_a) => {
|
|
|
1515
1517
|
inputReadOnlyClass,
|
|
1516
1518
|
wrapperClassName
|
|
1517
1519
|
),
|
|
1520
|
+
ref: (el) => {
|
|
1521
|
+
if (wrapperRef) {
|
|
1522
|
+
wrapperRef.current = el;
|
|
1523
|
+
}
|
|
1524
|
+
},
|
|
1518
1525
|
children: [
|
|
1519
1526
|
before,
|
|
1520
1527
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -2941,7 +2948,7 @@ function DataGrid({
|
|
|
2941
2948
|
})
|
|
2942
2949
|
)
|
|
2943
2950
|
);
|
|
2944
|
-
const
|
|
2951
|
+
const updateColumnVisibility = (0, import_react16.useCallback)(
|
|
2945
2952
|
(updateOrder) => {
|
|
2946
2953
|
setColumnVisibility(
|
|
2947
2954
|
Object.fromEntries(
|
|
@@ -2955,9 +2962,25 @@ function DataGrid({
|
|
|
2955
2962
|
},
|
|
2956
2963
|
[tableColumns]
|
|
2957
2964
|
);
|
|
2965
|
+
const resetDefaultColumnVisibility = (0, import_react16.useCallback)(() => {
|
|
2966
|
+
setTableColumns((prev) => {
|
|
2967
|
+
columns.forEach((column) => {
|
|
2968
|
+
var _a2, _b2;
|
|
2969
|
+
const columnId = column.id;
|
|
2970
|
+
const isVisible = (_b2 = (_a2 = column.meta) == null ? void 0 : _a2.visible) != null ? _b2 : true;
|
|
2971
|
+
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
2972
|
+
if (persistedIndex !== -1) {
|
|
2973
|
+
prev[persistedIndex].meta = __spreadProps(__spreadValues({}, prev[persistedIndex].meta), {
|
|
2974
|
+
visible: isVisible
|
|
2975
|
+
});
|
|
2976
|
+
}
|
|
2977
|
+
});
|
|
2978
|
+
return [...prev];
|
|
2979
|
+
}, true);
|
|
2980
|
+
}, [columns, setTableColumns]);
|
|
2958
2981
|
(0, import_react16.useEffect)(() => {
|
|
2959
|
-
|
|
2960
|
-
}, [
|
|
2982
|
+
updateColumnVisibility(true);
|
|
2983
|
+
}, [updateColumnVisibility]);
|
|
2961
2984
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
2962
2985
|
const setSortingState = pagination ? (updaterOrValue) => {
|
|
2963
2986
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(
|
|
@@ -3295,7 +3318,7 @@ function DataGrid({
|
|
|
3295
3318
|
id,
|
|
3296
3319
|
enableColumnSelector,
|
|
3297
3320
|
toggleColumnVisibility,
|
|
3298
|
-
resetColumnVisibility,
|
|
3321
|
+
resetColumnVisibility: resetDefaultColumnVisibility,
|
|
3299
3322
|
testid,
|
|
3300
3323
|
pinDirection: "right",
|
|
3301
3324
|
table,
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
CalendarRange_default,
|
|
4
4
|
isWeekend
|
|
5
5
|
} from "../chunk-PEB3BNN6.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-OAIAELMQ.js";
|
|
7
7
|
import "../chunk-QQ5G773N.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-I3WFZOFY.js";
|
|
9
9
|
import "../chunk-NO5BIKWS.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-ANDTMNGV.js";
|
|
11
11
|
import "../chunk-PGSDEGBP.js";
|
|
12
12
|
import "../chunk-CCOQOO23.js";
|
|
13
13
|
import "../chunk-FLVYV4T4.js";
|
|
14
14
|
import "../chunk-HIVPC3T4.js";
|
|
15
15
|
import "../chunk-VXWSAIB5.js";
|
|
16
16
|
import "../chunk-TYTD4FLW.js";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-6GAYJCFE.js";
|
|
18
|
+
import "../chunk-RJUN52HJ.js";
|
|
19
19
|
import "../chunk-5UH6QUFB.js";
|
|
20
20
|
import "../chunk-7CS736EF.js";
|
|
21
21
|
import "../chunk-WVUIIBRR.js";
|
|
@@ -1271,7 +1271,8 @@ var InputBase = (_a) => {
|
|
|
1271
1271
|
wrapperClassName,
|
|
1272
1272
|
focus,
|
|
1273
1273
|
secondaryIconColor,
|
|
1274
|
-
fullWidth = true
|
|
1274
|
+
fullWidth = true,
|
|
1275
|
+
wrapperRef
|
|
1275
1276
|
} = _b, props = __objRest(_b, [
|
|
1276
1277
|
"id",
|
|
1277
1278
|
"testid",
|
|
@@ -1291,7 +1292,8 @@ var InputBase = (_a) => {
|
|
|
1291
1292
|
"wrapperClassName",
|
|
1292
1293
|
"focus",
|
|
1293
1294
|
"secondaryIconColor",
|
|
1294
|
-
"fullWidth"
|
|
1295
|
+
"fullWidth",
|
|
1296
|
+
"wrapperRef"
|
|
1295
1297
|
]);
|
|
1296
1298
|
const attributes = {
|
|
1297
1299
|
"data-error": error && !focus || null,
|
|
@@ -1382,6 +1384,11 @@ var InputBase = (_a) => {
|
|
|
1382
1384
|
inputReadOnlyClass,
|
|
1383
1385
|
wrapperClassName
|
|
1384
1386
|
),
|
|
1387
|
+
ref: (el) => {
|
|
1388
|
+
if (wrapperRef) {
|
|
1389
|
+
wrapperRef.current = el;
|
|
1390
|
+
}
|
|
1391
|
+
},
|
|
1385
1392
|
children: [
|
|
1386
1393
|
before,
|
|
1387
1394
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
DataGridCell,
|
|
5
5
|
DragAlongCell,
|
|
6
6
|
DraggableCellHeader
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-ANDTMNGV.js";
|
|
8
8
|
import "../chunk-PGSDEGBP.js";
|
|
9
9
|
import "../chunk-CCOQOO23.js";
|
|
10
10
|
import "../chunk-FLVYV4T4.js";
|
|
11
11
|
import "../chunk-HIVPC3T4.js";
|
|
12
12
|
import "../chunk-VXWSAIB5.js";
|
|
13
13
|
import "../chunk-TYTD4FLW.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-6GAYJCFE.js";
|
|
15
|
+
import "../chunk-RJUN52HJ.js";
|
|
16
16
|
import "../chunk-5UH6QUFB.js";
|
|
17
17
|
import "../chunk-7CS736EF.js";
|
|
18
18
|
import "../chunk-WVUIIBRR.js";
|
|
@@ -334,7 +334,8 @@ var InputBase = (_a) => {
|
|
|
334
334
|
wrapperClassName,
|
|
335
335
|
focus,
|
|
336
336
|
secondaryIconColor,
|
|
337
|
-
fullWidth = true
|
|
337
|
+
fullWidth = true,
|
|
338
|
+
wrapperRef
|
|
338
339
|
} = _b, props = __objRest(_b, [
|
|
339
340
|
"id",
|
|
340
341
|
"testid",
|
|
@@ -354,7 +355,8 @@ var InputBase = (_a) => {
|
|
|
354
355
|
"wrapperClassName",
|
|
355
356
|
"focus",
|
|
356
357
|
"secondaryIconColor",
|
|
357
|
-
"fullWidth"
|
|
358
|
+
"fullWidth",
|
|
359
|
+
"wrapperRef"
|
|
358
360
|
]);
|
|
359
361
|
const attributes = {
|
|
360
362
|
"data-error": error && !focus || null,
|
|
@@ -445,6 +447,11 @@ var InputBase = (_a) => {
|
|
|
445
447
|
inputReadOnlyClass,
|
|
446
448
|
wrapperClassName
|
|
447
449
|
),
|
|
450
|
+
ref: (el) => {
|
|
451
|
+
if (wrapperRef) {
|
|
452
|
+
wrapperRef.current = el;
|
|
453
|
+
}
|
|
454
|
+
},
|
|
448
455
|
children: [
|
|
449
456
|
before,
|
|
450
457
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -3011,7 +3018,7 @@ function DataGrid({
|
|
|
3011
3018
|
})
|
|
3012
3019
|
)
|
|
3013
3020
|
);
|
|
3014
|
-
const
|
|
3021
|
+
const updateColumnVisibility = (0, import_react16.useCallback)(
|
|
3015
3022
|
(updateOrder) => {
|
|
3016
3023
|
setColumnVisibility(
|
|
3017
3024
|
Object.fromEntries(
|
|
@@ -3025,9 +3032,25 @@ function DataGrid({
|
|
|
3025
3032
|
},
|
|
3026
3033
|
[tableColumns]
|
|
3027
3034
|
);
|
|
3035
|
+
const resetDefaultColumnVisibility = (0, import_react16.useCallback)(() => {
|
|
3036
|
+
setTableColumns((prev) => {
|
|
3037
|
+
columns.forEach((column) => {
|
|
3038
|
+
var _a2, _b2;
|
|
3039
|
+
const columnId = column.id;
|
|
3040
|
+
const isVisible = (_b2 = (_a2 = column.meta) == null ? void 0 : _a2.visible) != null ? _b2 : true;
|
|
3041
|
+
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
3042
|
+
if (persistedIndex !== -1) {
|
|
3043
|
+
prev[persistedIndex].meta = __spreadProps(__spreadValues({}, prev[persistedIndex].meta), {
|
|
3044
|
+
visible: isVisible
|
|
3045
|
+
});
|
|
3046
|
+
}
|
|
3047
|
+
});
|
|
3048
|
+
return [...prev];
|
|
3049
|
+
}, true);
|
|
3050
|
+
}, [columns, setTableColumns]);
|
|
3028
3051
|
(0, import_react16.useEffect)(() => {
|
|
3029
|
-
|
|
3030
|
-
}, [
|
|
3052
|
+
updateColumnVisibility(true);
|
|
3053
|
+
}, [updateColumnVisibility]);
|
|
3031
3054
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
3032
3055
|
const setSortingState = pagination ? (updaterOrValue) => {
|
|
3033
3056
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(
|
|
@@ -3365,7 +3388,7 @@ function DataGrid({
|
|
|
3365
3388
|
id,
|
|
3366
3389
|
enableColumnSelector,
|
|
3367
3390
|
toggleColumnVisibility,
|
|
3368
|
-
resetColumnVisibility,
|
|
3391
|
+
resetColumnVisibility: resetDefaultColumnVisibility,
|
|
3369
3392
|
testid,
|
|
3370
3393
|
pinDirection: "right",
|
|
3371
3394
|
table,
|
|
@@ -4546,6 +4569,7 @@ var DateInput = (_a) => {
|
|
|
4546
4569
|
const [isTyping, setIsTyping] = (0, import_react20.useState)(false);
|
|
4547
4570
|
const popoverRef = (0, import_react20.useRef)(null);
|
|
4548
4571
|
const triggerRef = (0, import_react20.useRef)(null);
|
|
4572
|
+
const rootRef = (0, import_react20.useRef)(null);
|
|
4549
4573
|
const [calendarPosition, setCalendarPosition] = (0, import_react20.useState)({
|
|
4550
4574
|
top: 0,
|
|
4551
4575
|
left: 0,
|
|
@@ -4563,8 +4587,8 @@ var DateInput = (_a) => {
|
|
|
4563
4587
|
}
|
|
4564
4588
|
}, [visible]);
|
|
4565
4589
|
const updatePosition = () => {
|
|
4566
|
-
if (
|
|
4567
|
-
const rect =
|
|
4590
|
+
if (rootRef.current) {
|
|
4591
|
+
const rect = rootRef.current.getBoundingClientRect();
|
|
4568
4592
|
setCalendarPosition({
|
|
4569
4593
|
top: rect.bottom + window.scrollY,
|
|
4570
4594
|
left: rect.left + window.scrollX,
|
|
@@ -4688,6 +4712,7 @@ var DateInput = (_a) => {
|
|
|
4688
4712
|
triggerRef.current = el;
|
|
4689
4713
|
}
|
|
4690
4714
|
}, props), {
|
|
4715
|
+
wrapperRef: rootRef,
|
|
4691
4716
|
value: inputValue,
|
|
4692
4717
|
placeholder,
|
|
4693
4718
|
disabled,
|
|
@@ -4711,8 +4736,8 @@ var DateInput = (_a) => {
|
|
|
4711
4736
|
},
|
|
4712
4737
|
className: "absolute z-40 bg-white",
|
|
4713
4738
|
style: {
|
|
4714
|
-
top: `${calendarPosition.top +
|
|
4715
|
-
left: `${calendarPosition.left
|
|
4739
|
+
top: `${calendarPosition.top + 4}px`,
|
|
4740
|
+
left: `${calendarPosition.left}px`,
|
|
4716
4741
|
minWidth: `${calendarPosition.width}px`
|
|
4717
4742
|
},
|
|
4718
4743
|
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CalendarRange
|
|
3
3
|
} from "../chunk-PEB3BNN6.js";
|
|
4
|
-
import "../chunk-
|
|
4
|
+
import "../chunk-OAIAELMQ.js";
|
|
5
5
|
import "../chunk-QQ5G773N.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-I3WFZOFY.js";
|
|
7
7
|
import "../chunk-NO5BIKWS.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-ANDTMNGV.js";
|
|
9
9
|
import "../chunk-PGSDEGBP.js";
|
|
10
10
|
import "../chunk-CCOQOO23.js";
|
|
11
11
|
import "../chunk-FLVYV4T4.js";
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
isValidDate,
|
|
21
21
|
parseInputDate
|
|
22
22
|
} from "../chunk-TYTD4FLW.js";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-6GAYJCFE.js";
|
|
24
24
|
import {
|
|
25
25
|
InputBase
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-RJUN52HJ.js";
|
|
27
27
|
import "../chunk-5UH6QUFB.js";
|
|
28
28
|
import "../chunk-7CS736EF.js";
|
|
29
29
|
import "../chunk-WVUIIBRR.js";
|
|
@@ -72,6 +72,7 @@ var DateInput = (_a) => {
|
|
|
72
72
|
const [isTyping, setIsTyping] = useState(false);
|
|
73
73
|
const popoverRef = useRef(null);
|
|
74
74
|
const triggerRef = useRef(null);
|
|
75
|
+
const rootRef = useRef(null);
|
|
75
76
|
const [calendarPosition, setCalendarPosition] = useState({
|
|
76
77
|
top: 0,
|
|
77
78
|
left: 0,
|
|
@@ -89,8 +90,8 @@ var DateInput = (_a) => {
|
|
|
89
90
|
}
|
|
90
91
|
}, [visible]);
|
|
91
92
|
const updatePosition = () => {
|
|
92
|
-
if (
|
|
93
|
-
const rect =
|
|
93
|
+
if (rootRef.current) {
|
|
94
|
+
const rect = rootRef.current.getBoundingClientRect();
|
|
94
95
|
setCalendarPosition({
|
|
95
96
|
top: rect.bottom + window.scrollY,
|
|
96
97
|
left: rect.left + window.scrollX,
|
|
@@ -214,6 +215,7 @@ var DateInput = (_a) => {
|
|
|
214
215
|
triggerRef.current = el;
|
|
215
216
|
}
|
|
216
217
|
}, props), {
|
|
218
|
+
wrapperRef: rootRef,
|
|
217
219
|
value: inputValue,
|
|
218
220
|
placeholder,
|
|
219
221
|
disabled,
|
|
@@ -237,8 +239,8 @@ var DateInput = (_a) => {
|
|
|
237
239
|
},
|
|
238
240
|
className: "absolute z-40 bg-white",
|
|
239
241
|
style: {
|
|
240
|
-
top: `${calendarPosition.top +
|
|
241
|
-
left: `${calendarPosition.left
|
|
242
|
+
top: `${calendarPosition.top + 4}px`,
|
|
243
|
+
left: `${calendarPosition.left}px`,
|
|
242
244
|
minWidth: `${calendarPosition.width}px`
|
|
243
245
|
},
|
|
244
246
|
children: /* @__PURE__ */ jsx(
|
|
@@ -334,7 +334,8 @@ var InputBase = (_a) => {
|
|
|
334
334
|
wrapperClassName,
|
|
335
335
|
focus,
|
|
336
336
|
secondaryIconColor,
|
|
337
|
-
fullWidth = true
|
|
337
|
+
fullWidth = true,
|
|
338
|
+
wrapperRef
|
|
338
339
|
} = _b, props = __objRest(_b, [
|
|
339
340
|
"id",
|
|
340
341
|
"testid",
|
|
@@ -354,7 +355,8 @@ var InputBase = (_a) => {
|
|
|
354
355
|
"wrapperClassName",
|
|
355
356
|
"focus",
|
|
356
357
|
"secondaryIconColor",
|
|
357
|
-
"fullWidth"
|
|
358
|
+
"fullWidth",
|
|
359
|
+
"wrapperRef"
|
|
358
360
|
]);
|
|
359
361
|
const attributes = {
|
|
360
362
|
"data-error": error && !focus || null,
|
|
@@ -445,6 +447,11 @@ var InputBase = (_a) => {
|
|
|
445
447
|
inputReadOnlyClass,
|
|
446
448
|
wrapperClassName
|
|
447
449
|
),
|
|
450
|
+
ref: (el) => {
|
|
451
|
+
if (wrapperRef) {
|
|
452
|
+
wrapperRef.current = el;
|
|
453
|
+
}
|
|
454
|
+
},
|
|
448
455
|
children: [
|
|
449
456
|
before,
|
|
450
457
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -3019,7 +3026,7 @@ function DataGrid({
|
|
|
3019
3026
|
})
|
|
3020
3027
|
)
|
|
3021
3028
|
);
|
|
3022
|
-
const
|
|
3029
|
+
const updateColumnVisibility = (0, import_react16.useCallback)(
|
|
3023
3030
|
(updateOrder) => {
|
|
3024
3031
|
setColumnVisibility(
|
|
3025
3032
|
Object.fromEntries(
|
|
@@ -3033,9 +3040,25 @@ function DataGrid({
|
|
|
3033
3040
|
},
|
|
3034
3041
|
[tableColumns]
|
|
3035
3042
|
);
|
|
3043
|
+
const resetDefaultColumnVisibility = (0, import_react16.useCallback)(() => {
|
|
3044
|
+
setTableColumns((prev) => {
|
|
3045
|
+
columns.forEach((column) => {
|
|
3046
|
+
var _a2, _b2;
|
|
3047
|
+
const columnId = column.id;
|
|
3048
|
+
const isVisible = (_b2 = (_a2 = column.meta) == null ? void 0 : _a2.visible) != null ? _b2 : true;
|
|
3049
|
+
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
3050
|
+
if (persistedIndex !== -1) {
|
|
3051
|
+
prev[persistedIndex].meta = __spreadProps(__spreadValues({}, prev[persistedIndex].meta), {
|
|
3052
|
+
visible: isVisible
|
|
3053
|
+
});
|
|
3054
|
+
}
|
|
3055
|
+
});
|
|
3056
|
+
return [...prev];
|
|
3057
|
+
}, true);
|
|
3058
|
+
}, [columns, setTableColumns]);
|
|
3036
3059
|
(0, import_react16.useEffect)(() => {
|
|
3037
|
-
|
|
3038
|
-
}, [
|
|
3060
|
+
updateColumnVisibility(true);
|
|
3061
|
+
}, [updateColumnVisibility]);
|
|
3039
3062
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
3040
3063
|
const setSortingState = pagination ? (updaterOrValue) => {
|
|
3041
3064
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(
|
|
@@ -3373,7 +3396,7 @@ function DataGrid({
|
|
|
3373
3396
|
id,
|
|
3374
3397
|
enableColumnSelector,
|
|
3375
3398
|
toggleColumnVisibility,
|
|
3376
|
-
resetColumnVisibility,
|
|
3399
|
+
resetColumnVisibility: resetDefaultColumnVisibility,
|
|
3377
3400
|
testid,
|
|
3378
3401
|
pinDirection: "right",
|
|
3379
3402
|
table,
|
|
@@ -4557,6 +4580,7 @@ var DateRangeInput = (_a) => {
|
|
|
4557
4580
|
const [inputValue, setInputValue] = (0, import_react20.useState)("");
|
|
4558
4581
|
const [isTyping, setIsTyping] = (0, import_react20.useState)(false);
|
|
4559
4582
|
const popoverRef = (0, import_react20.useRef)(null);
|
|
4583
|
+
const rootRef = (0, import_react20.useRef)(null);
|
|
4560
4584
|
const triggerRef = (0, import_react20.useRef)(null);
|
|
4561
4585
|
const [calendarPosition, setCalendarPosition] = (0, import_react20.useState)({
|
|
4562
4586
|
top: 0,
|
|
@@ -4575,8 +4599,8 @@ var DateRangeInput = (_a) => {
|
|
|
4575
4599
|
}
|
|
4576
4600
|
}, [visible]);
|
|
4577
4601
|
const updatePosition = () => {
|
|
4578
|
-
if (
|
|
4579
|
-
const rect =
|
|
4602
|
+
if (rootRef.current) {
|
|
4603
|
+
const rect = rootRef.current.getBoundingClientRect();
|
|
4580
4604
|
setCalendarPosition({
|
|
4581
4605
|
top: rect.bottom + window.scrollY,
|
|
4582
4606
|
left: rect.left + window.scrollX,
|
|
@@ -4954,6 +4978,7 @@ var DateRangeInput = (_a) => {
|
|
|
4954
4978
|
triggerRef.current = el;
|
|
4955
4979
|
}
|
|
4956
4980
|
}, props), {
|
|
4981
|
+
wrapperRef: rootRef,
|
|
4957
4982
|
value: inputValue,
|
|
4958
4983
|
placeholder: disableRange ? "MM/DD/YYYY" : placeholder,
|
|
4959
4984
|
disabled,
|
|
@@ -4977,8 +5002,8 @@ var DateRangeInput = (_a) => {
|
|
|
4977
5002
|
},
|
|
4978
5003
|
className: "absolute z-40 bg-white",
|
|
4979
5004
|
style: {
|
|
4980
|
-
top: `${calendarPosition.top +
|
|
4981
|
-
left: `${calendarPosition.left
|
|
5005
|
+
top: `${calendarPosition.top + 4}px`,
|
|
5006
|
+
left: `${calendarPosition.left}px`,
|
|
4982
5007
|
minWidth: `${calendarPosition.width}px`
|
|
4983
5008
|
},
|
|
4984
5009
|
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CalendarRange
|
|
3
3
|
} from "../chunk-PEB3BNN6.js";
|
|
4
|
-
import "../chunk-
|
|
4
|
+
import "../chunk-OAIAELMQ.js";
|
|
5
5
|
import "../chunk-QQ5G773N.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-I3WFZOFY.js";
|
|
7
7
|
import "../chunk-NO5BIKWS.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-ANDTMNGV.js";
|
|
9
9
|
import "../chunk-PGSDEGBP.js";
|
|
10
10
|
import "../chunk-CCOQOO23.js";
|
|
11
11
|
import "../chunk-FLVYV4T4.js";
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
isValidDateRangeOrder,
|
|
22
22
|
parseInputDate
|
|
23
23
|
} from "../chunk-TYTD4FLW.js";
|
|
24
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-6GAYJCFE.js";
|
|
25
25
|
import {
|
|
26
26
|
InputBase
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-RJUN52HJ.js";
|
|
28
28
|
import "../chunk-5UH6QUFB.js";
|
|
29
29
|
import "../chunk-7CS736EF.js";
|
|
30
30
|
import "../chunk-WVUIIBRR.js";
|
|
@@ -76,6 +76,7 @@ var DateRangeInput = (_a) => {
|
|
|
76
76
|
const [inputValue, setInputValue] = useState("");
|
|
77
77
|
const [isTyping, setIsTyping] = useState(false);
|
|
78
78
|
const popoverRef = useRef(null);
|
|
79
|
+
const rootRef = useRef(null);
|
|
79
80
|
const triggerRef = useRef(null);
|
|
80
81
|
const [calendarPosition, setCalendarPosition] = useState({
|
|
81
82
|
top: 0,
|
|
@@ -94,8 +95,8 @@ var DateRangeInput = (_a) => {
|
|
|
94
95
|
}
|
|
95
96
|
}, [visible]);
|
|
96
97
|
const updatePosition = () => {
|
|
97
|
-
if (
|
|
98
|
-
const rect =
|
|
98
|
+
if (rootRef.current) {
|
|
99
|
+
const rect = rootRef.current.getBoundingClientRect();
|
|
99
100
|
setCalendarPosition({
|
|
100
101
|
top: rect.bottom + window.scrollY,
|
|
101
102
|
left: rect.left + window.scrollX,
|
|
@@ -473,6 +474,7 @@ var DateRangeInput = (_a) => {
|
|
|
473
474
|
triggerRef.current = el;
|
|
474
475
|
}
|
|
475
476
|
}, props), {
|
|
477
|
+
wrapperRef: rootRef,
|
|
476
478
|
value: inputValue,
|
|
477
479
|
placeholder: disableRange ? "MM/DD/YYYY" : placeholder,
|
|
478
480
|
disabled,
|
|
@@ -496,8 +498,8 @@ var DateRangeInput = (_a) => {
|
|
|
496
498
|
},
|
|
497
499
|
className: "absolute z-40 bg-white",
|
|
498
500
|
style: {
|
|
499
|
-
top: `${calendarPosition.top +
|
|
500
|
-
left: `${calendarPosition.left
|
|
501
|
+
top: `${calendarPosition.top + 4}px`,
|
|
502
|
+
left: `${calendarPosition.left}px`,
|
|
501
503
|
minWidth: `${calendarPosition.width}px`
|
|
502
504
|
},
|
|
503
505
|
children: /* @__PURE__ */ jsx(
|
|
@@ -854,7 +854,8 @@ var InputBase = (_a) => {
|
|
|
854
854
|
wrapperClassName,
|
|
855
855
|
focus,
|
|
856
856
|
secondaryIconColor,
|
|
857
|
-
fullWidth = true
|
|
857
|
+
fullWidth = true,
|
|
858
|
+
wrapperRef
|
|
858
859
|
} = _b, props = __objRest(_b, [
|
|
859
860
|
"id",
|
|
860
861
|
"testid",
|
|
@@ -874,7 +875,8 @@ var InputBase = (_a) => {
|
|
|
874
875
|
"wrapperClassName",
|
|
875
876
|
"focus",
|
|
876
877
|
"secondaryIconColor",
|
|
877
|
-
"fullWidth"
|
|
878
|
+
"fullWidth",
|
|
879
|
+
"wrapperRef"
|
|
878
880
|
]);
|
|
879
881
|
const attributes = {
|
|
880
882
|
"data-error": error && !focus || null,
|
|
@@ -965,6 +967,11 @@ var InputBase = (_a) => {
|
|
|
965
967
|
inputReadOnlyClass,
|
|
966
968
|
wrapperClassName
|
|
967
969
|
),
|
|
970
|
+
ref: (el) => {
|
|
971
|
+
if (wrapperRef) {
|
|
972
|
+
wrapperRef.current = el;
|
|
973
|
+
}
|
|
974
|
+
},
|
|
968
975
|
children: [
|
|
969
976
|
before,
|
|
970
977
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
@@ -336,7 +336,8 @@ var InputBase = (_a) => {
|
|
|
336
336
|
wrapperClassName,
|
|
337
337
|
focus,
|
|
338
338
|
secondaryIconColor,
|
|
339
|
-
fullWidth = true
|
|
339
|
+
fullWidth = true,
|
|
340
|
+
wrapperRef
|
|
340
341
|
} = _b, props = __objRest(_b, [
|
|
341
342
|
"id",
|
|
342
343
|
"testid",
|
|
@@ -356,7 +357,8 @@ var InputBase = (_a) => {
|
|
|
356
357
|
"wrapperClassName",
|
|
357
358
|
"focus",
|
|
358
359
|
"secondaryIconColor",
|
|
359
|
-
"fullWidth"
|
|
360
|
+
"fullWidth",
|
|
361
|
+
"wrapperRef"
|
|
360
362
|
]);
|
|
361
363
|
const attributes = {
|
|
362
364
|
"data-error": error && !focus || null,
|
|
@@ -447,6 +449,11 @@ var InputBase = (_a) => {
|
|
|
447
449
|
inputReadOnlyClass,
|
|
448
450
|
wrapperClassName
|
|
449
451
|
),
|
|
452
|
+
ref: (el) => {
|
|
453
|
+
if (wrapperRef) {
|
|
454
|
+
wrapperRef.current = el;
|
|
455
|
+
}
|
|
456
|
+
},
|
|
450
457
|
children: [
|
|
451
458
|
before,
|
|
452
459
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
package/dist/components/Input.js
CHANGED
|
@@ -334,7 +334,8 @@ var InputBase = (_a) => {
|
|
|
334
334
|
wrapperClassName,
|
|
335
335
|
focus,
|
|
336
336
|
secondaryIconColor,
|
|
337
|
-
fullWidth = true
|
|
337
|
+
fullWidth = true,
|
|
338
|
+
wrapperRef
|
|
338
339
|
} = _b, props = __objRest(_b, [
|
|
339
340
|
"id",
|
|
340
341
|
"testid",
|
|
@@ -354,7 +355,8 @@ var InputBase = (_a) => {
|
|
|
354
355
|
"wrapperClassName",
|
|
355
356
|
"focus",
|
|
356
357
|
"secondaryIconColor",
|
|
357
|
-
"fullWidth"
|
|
358
|
+
"fullWidth",
|
|
359
|
+
"wrapperRef"
|
|
358
360
|
]);
|
|
359
361
|
const attributes = {
|
|
360
362
|
"data-error": error && !focus || null,
|
|
@@ -445,6 +447,11 @@ var InputBase = (_a) => {
|
|
|
445
447
|
inputReadOnlyClass,
|
|
446
448
|
wrapperClassName
|
|
447
449
|
),
|
|
450
|
+
ref: (el) => {
|
|
451
|
+
if (wrapperRef) {
|
|
452
|
+
wrapperRef.current = el;
|
|
453
|
+
}
|
|
454
|
+
},
|
|
448
455
|
children: [
|
|
449
456
|
before,
|
|
450
457
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -334,7 +334,8 @@ var InputBase = (_a) => {
|
|
|
334
334
|
wrapperClassName,
|
|
335
335
|
focus,
|
|
336
336
|
secondaryIconColor,
|
|
337
|
-
fullWidth = true
|
|
337
|
+
fullWidth = true,
|
|
338
|
+
wrapperRef
|
|
338
339
|
} = _b, props = __objRest(_b, [
|
|
339
340
|
"id",
|
|
340
341
|
"testid",
|
|
@@ -354,7 +355,8 @@ var InputBase = (_a) => {
|
|
|
354
355
|
"wrapperClassName",
|
|
355
356
|
"focus",
|
|
356
357
|
"secondaryIconColor",
|
|
357
|
-
"fullWidth"
|
|
358
|
+
"fullWidth",
|
|
359
|
+
"wrapperRef"
|
|
358
360
|
]);
|
|
359
361
|
const attributes = {
|
|
360
362
|
"data-error": error && !focus || null,
|
|
@@ -445,6 +447,11 @@ var InputBase = (_a) => {
|
|
|
445
447
|
inputReadOnlyClass,
|
|
446
448
|
wrapperClassName
|
|
447
449
|
),
|
|
450
|
+
ref: (el) => {
|
|
451
|
+
if (wrapperRef) {
|
|
452
|
+
wrapperRef.current = el;
|
|
453
|
+
}
|
|
454
|
+
},
|
|
448
455
|
children: [
|
|
449
456
|
before,
|
|
450
457
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Search
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-6GAYJCFE.js";
|
|
5
|
+
import "../chunk-RJUN52HJ.js";
|
|
6
6
|
import "../chunk-5UH6QUFB.js";
|
|
7
7
|
import "../chunk-7CS736EF.js";
|
|
8
8
|
import "../chunk-NKUETCDA.js";
|
|
@@ -334,7 +334,8 @@ var InputBase = (_a) => {
|
|
|
334
334
|
wrapperClassName,
|
|
335
335
|
focus,
|
|
336
336
|
secondaryIconColor,
|
|
337
|
-
fullWidth = true
|
|
337
|
+
fullWidth = true,
|
|
338
|
+
wrapperRef
|
|
338
339
|
} = _b, props = __objRest(_b, [
|
|
339
340
|
"id",
|
|
340
341
|
"testid",
|
|
@@ -354,7 +355,8 @@ var InputBase = (_a) => {
|
|
|
354
355
|
"wrapperClassName",
|
|
355
356
|
"focus",
|
|
356
357
|
"secondaryIconColor",
|
|
357
|
-
"fullWidth"
|
|
358
|
+
"fullWidth",
|
|
359
|
+
"wrapperRef"
|
|
358
360
|
]);
|
|
359
361
|
const attributes = {
|
|
360
362
|
"data-error": error && !focus || null,
|
|
@@ -445,6 +447,11 @@ var InputBase = (_a) => {
|
|
|
445
447
|
inputReadOnlyClass,
|
|
446
448
|
wrapperClassName
|
|
447
449
|
),
|
|
450
|
+
ref: (el) => {
|
|
451
|
+
if (wrapperRef) {
|
|
452
|
+
wrapperRef.current = el;
|
|
453
|
+
}
|
|
454
|
+
},
|
|
448
455
|
children: [
|
|
449
456
|
before,
|
|
450
457
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Select
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-I3WFZOFY.js";
|
|
5
|
+
import "../chunk-RJUN52HJ.js";
|
|
6
6
|
import "../chunk-5UH6QUFB.js";
|
|
7
7
|
import "../chunk-7CS736EF.js";
|
|
8
8
|
import "../chunk-NKUETCDA.js";
|
|
@@ -474,7 +474,8 @@ var InputBase = (_a) => {
|
|
|
474
474
|
wrapperClassName,
|
|
475
475
|
focus,
|
|
476
476
|
secondaryIconColor,
|
|
477
|
-
fullWidth = true
|
|
477
|
+
fullWidth = true,
|
|
478
|
+
wrapperRef
|
|
478
479
|
} = _b, props = __objRest(_b, [
|
|
479
480
|
"id",
|
|
480
481
|
"testid",
|
|
@@ -494,7 +495,8 @@ var InputBase = (_a) => {
|
|
|
494
495
|
"wrapperClassName",
|
|
495
496
|
"focus",
|
|
496
497
|
"secondaryIconColor",
|
|
497
|
-
"fullWidth"
|
|
498
|
+
"fullWidth",
|
|
499
|
+
"wrapperRef"
|
|
498
500
|
]);
|
|
499
501
|
const attributes = {
|
|
500
502
|
"data-error": error && !focus || null,
|
|
@@ -585,6 +587,11 @@ var InputBase = (_a) => {
|
|
|
585
587
|
inputReadOnlyClass,
|
|
586
588
|
wrapperClassName
|
|
587
589
|
),
|
|
590
|
+
ref: (el) => {
|
|
591
|
+
if (wrapperRef) {
|
|
592
|
+
wrapperRef.current = el;
|
|
593
|
+
}
|
|
594
|
+
},
|
|
588
595
|
children: [
|
|
589
596
|
before,
|
|
590
597
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
package/dist/components/Time.cjs
CHANGED
|
@@ -333,7 +333,8 @@ var InputBase = (_a) => {
|
|
|
333
333
|
wrapperClassName,
|
|
334
334
|
focus,
|
|
335
335
|
secondaryIconColor,
|
|
336
|
-
fullWidth = true
|
|
336
|
+
fullWidth = true,
|
|
337
|
+
wrapperRef
|
|
337
338
|
} = _b, props = __objRest(_b, [
|
|
338
339
|
"id",
|
|
339
340
|
"testid",
|
|
@@ -353,7 +354,8 @@ var InputBase = (_a) => {
|
|
|
353
354
|
"wrapperClassName",
|
|
354
355
|
"focus",
|
|
355
356
|
"secondaryIconColor",
|
|
356
|
-
"fullWidth"
|
|
357
|
+
"fullWidth",
|
|
358
|
+
"wrapperRef"
|
|
357
359
|
]);
|
|
358
360
|
const attributes = {
|
|
359
361
|
"data-error": error && !focus || null,
|
|
@@ -444,6 +446,11 @@ var InputBase = (_a) => {
|
|
|
444
446
|
inputReadOnlyClass,
|
|
445
447
|
wrapperClassName
|
|
446
448
|
),
|
|
449
|
+
ref: (el) => {
|
|
450
|
+
if (wrapperRef) {
|
|
451
|
+
wrapperRef.current = el;
|
|
452
|
+
}
|
|
453
|
+
},
|
|
447
454
|
children: [
|
|
448
455
|
before,
|
|
449
456
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
package/dist/components/Time.js
CHANGED
|
@@ -1415,7 +1415,8 @@ var InputBase = (_a) => {
|
|
|
1415
1415
|
wrapperClassName,
|
|
1416
1416
|
focus,
|
|
1417
1417
|
secondaryIconColor,
|
|
1418
|
-
fullWidth = true
|
|
1418
|
+
fullWidth = true,
|
|
1419
|
+
wrapperRef
|
|
1419
1420
|
} = _b, props = __objRest(_b, [
|
|
1420
1421
|
"id",
|
|
1421
1422
|
"testid",
|
|
@@ -1435,7 +1436,8 @@ var InputBase = (_a) => {
|
|
|
1435
1436
|
"wrapperClassName",
|
|
1436
1437
|
"focus",
|
|
1437
1438
|
"secondaryIconColor",
|
|
1438
|
-
"fullWidth"
|
|
1439
|
+
"fullWidth",
|
|
1440
|
+
"wrapperRef"
|
|
1439
1441
|
]);
|
|
1440
1442
|
const attributes = {
|
|
1441
1443
|
"data-error": error && !focus || null,
|
|
@@ -1526,6 +1528,11 @@ var InputBase = (_a) => {
|
|
|
1526
1528
|
inputReadOnlyClass,
|
|
1527
1529
|
wrapperClassName
|
|
1528
1530
|
),
|
|
1531
|
+
ref: (el) => {
|
|
1532
|
+
if (wrapperRef) {
|
|
1533
|
+
wrapperRef.current = el;
|
|
1534
|
+
}
|
|
1535
|
+
},
|
|
1529
1536
|
children: [
|
|
1530
1537
|
before,
|
|
1531
1538
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -2952,7 +2959,7 @@ function DataGrid({
|
|
|
2952
2959
|
})
|
|
2953
2960
|
)
|
|
2954
2961
|
);
|
|
2955
|
-
const
|
|
2962
|
+
const updateColumnVisibility = (0, import_react16.useCallback)(
|
|
2956
2963
|
(updateOrder) => {
|
|
2957
2964
|
setColumnVisibility(
|
|
2958
2965
|
Object.fromEntries(
|
|
@@ -2966,9 +2973,25 @@ function DataGrid({
|
|
|
2966
2973
|
},
|
|
2967
2974
|
[tableColumns]
|
|
2968
2975
|
);
|
|
2976
|
+
const resetDefaultColumnVisibility = (0, import_react16.useCallback)(() => {
|
|
2977
|
+
setTableColumns((prev) => {
|
|
2978
|
+
columns.forEach((column) => {
|
|
2979
|
+
var _a2, _b2;
|
|
2980
|
+
const columnId = column.id;
|
|
2981
|
+
const isVisible = (_b2 = (_a2 = column.meta) == null ? void 0 : _a2.visible) != null ? _b2 : true;
|
|
2982
|
+
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
2983
|
+
if (persistedIndex !== -1) {
|
|
2984
|
+
prev[persistedIndex].meta = __spreadProps(__spreadValues({}, prev[persistedIndex].meta), {
|
|
2985
|
+
visible: isVisible
|
|
2986
|
+
});
|
|
2987
|
+
}
|
|
2988
|
+
});
|
|
2989
|
+
return [...prev];
|
|
2990
|
+
}, true);
|
|
2991
|
+
}, [columns, setTableColumns]);
|
|
2969
2992
|
(0, import_react16.useEffect)(() => {
|
|
2970
|
-
|
|
2971
|
-
}, [
|
|
2993
|
+
updateColumnVisibility(true);
|
|
2994
|
+
}, [updateColumnVisibility]);
|
|
2972
2995
|
const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
|
|
2973
2996
|
const setSortingState = pagination ? (updaterOrValue) => {
|
|
2974
2997
|
const value = typeof updaterOrValue === "function" ? updaterOrValue(
|
|
@@ -3306,7 +3329,7 @@ function DataGrid({
|
|
|
3306
3329
|
id,
|
|
3307
3330
|
enableColumnSelector,
|
|
3308
3331
|
toggleColumnVisibility,
|
|
3309
|
-
resetColumnVisibility,
|
|
3332
|
+
resetColumnVisibility: resetDefaultColumnVisibility,
|
|
3310
3333
|
testid,
|
|
3311
3334
|
pinDirection: "right",
|
|
3312
3335
|
table,
|
package/dist/components/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataGrid
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-OAIAELMQ.js";
|
|
4
4
|
import {
|
|
5
5
|
Tooltip
|
|
6
6
|
} from "../chunk-QQ5G773N.js";
|
|
7
7
|
import {
|
|
8
8
|
Select
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-I3WFZOFY.js";
|
|
10
10
|
import {
|
|
11
11
|
Checkbox
|
|
12
12
|
} from "../chunk-NO5BIKWS.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
DataGridCell,
|
|
16
16
|
DragAlongCell,
|
|
17
17
|
DraggableCellHeader
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-ANDTMNGV.js";
|
|
19
19
|
import {
|
|
20
20
|
Menu
|
|
21
21
|
} from "../chunk-PGSDEGBP.js";
|
|
@@ -28,10 +28,10 @@ import "../chunk-VXWSAIB5.js";
|
|
|
28
28
|
import "../chunk-TYTD4FLW.js";
|
|
29
29
|
import {
|
|
30
30
|
Search
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-6GAYJCFE.js";
|
|
32
32
|
import {
|
|
33
33
|
Input
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-RJUN52HJ.js";
|
|
35
35
|
import "../chunk-5UH6QUFB.js";
|
|
36
36
|
import {
|
|
37
37
|
Label
|
package/package.json
CHANGED
|
@@ -104,7 +104,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
104
104
|
),
|
|
105
105
|
);
|
|
106
106
|
|
|
107
|
-
const
|
|
107
|
+
const updateColumnVisibility = useCallback(
|
|
108
108
|
(updateOrder?: boolean) => {
|
|
109
109
|
setColumnVisibility(
|
|
110
110
|
Object.fromEntries(
|
|
@@ -118,9 +118,27 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
118
118
|
[tableColumns],
|
|
119
119
|
);
|
|
120
120
|
|
|
121
|
+
const resetDefaultColumnVisibility = useCallback(() => {
|
|
122
|
+
setTableColumns((prev) => {
|
|
123
|
+
columns.forEach((column) => {
|
|
124
|
+
const columnId = column.id;
|
|
125
|
+
const isVisible = column.meta?.visible ?? true;
|
|
126
|
+
const persistedIndex = prev.findIndex((col) => col.id === columnId);
|
|
127
|
+
if (persistedIndex !== -1) {
|
|
128
|
+
prev[persistedIndex].meta = {
|
|
129
|
+
...prev[persistedIndex].meta,
|
|
130
|
+
visible: isVisible,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
return [...prev];
|
|
135
|
+
// @ts-expect-error Internal usage only
|
|
136
|
+
}, true);
|
|
137
|
+
}, [columns, setTableColumns]);
|
|
138
|
+
|
|
121
139
|
useEffect(() => {
|
|
122
|
-
|
|
123
|
-
}, [
|
|
140
|
+
updateColumnVisibility(true);
|
|
141
|
+
}, [updateColumnVisibility]);
|
|
124
142
|
|
|
125
143
|
const sortingState = pagination
|
|
126
144
|
? (externalSorting ?? localSorting)
|
|
@@ -563,7 +581,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
563
581
|
id={id}
|
|
564
582
|
enableColumnSelector={enableColumnSelector}
|
|
565
583
|
toggleColumnVisibility={toggleColumnVisibility}
|
|
566
|
-
resetColumnVisibility={
|
|
584
|
+
resetColumnVisibility={resetDefaultColumnVisibility}
|
|
567
585
|
testid={testid}
|
|
568
586
|
pinDirection="right"
|
|
569
587
|
table={table}
|
|
@@ -57,6 +57,7 @@ export const DateInput = ({
|
|
|
57
57
|
const [isTyping, setIsTyping] = useState(false);
|
|
58
58
|
const popoverRef = useRef<HTMLDivElement | null>(null);
|
|
59
59
|
const triggerRef = useRef<HTMLInputElement | null>(null);
|
|
60
|
+
const rootRef = useRef<HTMLDivElement | null>(null);
|
|
60
61
|
const [calendarPosition, setCalendarPosition] = useState({
|
|
61
62
|
top: 0,
|
|
62
63
|
left: 0,
|
|
@@ -80,8 +81,8 @@ export const DateInput = ({
|
|
|
80
81
|
}, [visible]);
|
|
81
82
|
|
|
82
83
|
const updatePosition = () => {
|
|
83
|
-
if (
|
|
84
|
-
const rect =
|
|
84
|
+
if (rootRef.current) {
|
|
85
|
+
const rect = rootRef.current.getBoundingClientRect();
|
|
85
86
|
setCalendarPosition({
|
|
86
87
|
top: rect.bottom + window.scrollY,
|
|
87
88
|
left: rect.left + window.scrollX,
|
|
@@ -237,6 +238,7 @@ export const DateInput = ({
|
|
|
237
238
|
triggerRef.current = el;
|
|
238
239
|
}}
|
|
239
240
|
{...props}
|
|
241
|
+
wrapperRef={rootRef}
|
|
240
242
|
value={inputValue}
|
|
241
243
|
placeholder={placeholder}
|
|
242
244
|
disabled={disabled}
|
|
@@ -259,8 +261,8 @@ export const DateInput = ({
|
|
|
259
261
|
}}
|
|
260
262
|
className="absolute z-40 bg-white"
|
|
261
263
|
style={{
|
|
262
|
-
top: `${calendarPosition.top +
|
|
263
|
-
left: `${calendarPosition.left
|
|
264
|
+
top: `${calendarPosition.top + 4}px`,
|
|
265
|
+
left: `${calendarPosition.left}px`,
|
|
264
266
|
minWidth: `${calendarPosition.width}px`,
|
|
265
267
|
}}
|
|
266
268
|
>
|
|
@@ -61,6 +61,7 @@ export const DateRangeInput = ({
|
|
|
61
61
|
const [inputValue, setInputValue] = useState("");
|
|
62
62
|
const [isTyping, setIsTyping] = useState(false);
|
|
63
63
|
const popoverRef = useRef<HTMLDivElement | null>(null);
|
|
64
|
+
const rootRef = useRef<HTMLDivElement | null>(null);
|
|
64
65
|
const triggerRef = useRef<HTMLInputElement | null>(null);
|
|
65
66
|
const [calendarPosition, setCalendarPosition] = useState({
|
|
66
67
|
top: 0,
|
|
@@ -84,8 +85,8 @@ export const DateRangeInput = ({
|
|
|
84
85
|
}, [visible]);
|
|
85
86
|
|
|
86
87
|
const updatePosition = () => {
|
|
87
|
-
if (
|
|
88
|
-
const rect =
|
|
88
|
+
if (rootRef.current) {
|
|
89
|
+
const rect = rootRef.current.getBoundingClientRect();
|
|
89
90
|
setCalendarPosition({
|
|
90
91
|
top: rect.bottom + window.scrollY,
|
|
91
92
|
left: rect.left + window.scrollX,
|
|
@@ -583,6 +584,7 @@ export const DateRangeInput = ({
|
|
|
583
584
|
triggerRef.current = el;
|
|
584
585
|
}}
|
|
585
586
|
{...props}
|
|
587
|
+
wrapperRef={rootRef}
|
|
586
588
|
value={inputValue}
|
|
587
589
|
placeholder={disableRange ? "MM/DD/YYYY" : placeholder}
|
|
588
590
|
disabled={disabled}
|
|
@@ -605,8 +607,8 @@ export const DateRangeInput = ({
|
|
|
605
607
|
}}
|
|
606
608
|
className="absolute z-40 bg-white"
|
|
607
609
|
style={{
|
|
608
|
-
top: `${calendarPosition.top +
|
|
609
|
-
left: `${calendarPosition.left
|
|
610
|
+
top: `${calendarPosition.top + 4}px`,
|
|
611
|
+
left: `${calendarPosition.left}px`,
|
|
610
612
|
minWidth: `${calendarPosition.width}px`,
|
|
611
613
|
}}
|
|
612
614
|
>
|
package/src/components/Input.tsx
CHANGED
|
@@ -58,6 +58,7 @@ export type InputBaseProps = {
|
|
|
58
58
|
focus?: boolean;
|
|
59
59
|
secondaryIconColor?: boolean;
|
|
60
60
|
fullWidth?: boolean; // If true, input takes full width of the container
|
|
61
|
+
wrapperRef?: RefObject<HTMLDivElement | null>;
|
|
61
62
|
} & InputFormatting &
|
|
62
63
|
Omit<ComponentProps<"input">, "align" | "id">;
|
|
63
64
|
|
|
@@ -81,6 +82,7 @@ export const InputBase = ({
|
|
|
81
82
|
focus,
|
|
82
83
|
secondaryIconColor,
|
|
83
84
|
fullWidth = true,
|
|
85
|
+
wrapperRef,
|
|
84
86
|
...props
|
|
85
87
|
}: InputBaseProps) => {
|
|
86
88
|
const attributes = {
|
|
@@ -182,6 +184,11 @@ export const InputBase = ({
|
|
|
182
184
|
inputReadOnlyClass,
|
|
183
185
|
wrapperClassName,
|
|
184
186
|
)}
|
|
187
|
+
ref={(el) => {
|
|
188
|
+
if (wrapperRef) {
|
|
189
|
+
wrapperRef.current = el;
|
|
190
|
+
}
|
|
191
|
+
}}
|
|
185
192
|
>
|
|
186
193
|
{before}
|
|
187
194
|
|