@dmsi/wedgekit-react 0.0.854 → 0.0.856
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-T7NSOCGM.js → chunk-RESDUVMA.js} +76 -17
- package/dist/components/CalendarRange.cjs +77 -34
- package/dist/components/CalendarRange.js +3 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +75 -34
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +3 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +75 -34
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +3 -3
- package/dist/components/DataGrid/PinnedColumns.cjs +75 -34
- package/dist/components/DataGrid/PinnedColumns.js +3 -3
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +75 -34
- package/dist/components/DataGrid/TableBody/LoadingCell.js +3 -3
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +75 -34
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +3 -3
- package/dist/components/DataGrid/TableBody/index.cjs +75 -34
- package/dist/components/DataGrid/TableBody/index.js +3 -3
- package/dist/components/DataGrid/index.cjs +75 -34
- package/dist/components/DataGrid/index.js +3 -3
- package/dist/components/DataGrid/utils.cjs +75 -34
- package/dist/components/DataGrid/utils.js +3 -3
- package/dist/components/DateInput.cjs +75 -34
- package/dist/components/DateInput.js +3 -3
- package/dist/components/DateRangeInput.cjs +77 -14
- package/dist/components/DateRangeInput.js +3 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +75 -34
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +3 -3
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +75 -34
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +3 -3
- package/dist/components/MobileDataGrid/index.cjs +75 -34
- package/dist/components/MobileDataGrid/index.js +3 -3
- package/dist/components/ProductImagePreview/index.js +2 -2
- package/dist/components/index.cjs +75 -34
- package/dist/components/index.js +3 -3
- package/package.json +1 -1
- package/dist/{chunk-C5DKGJ4E.js → chunk-Y75MQKNY.js} +3 -3
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DateInput
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-RESDUVMA.js";
|
|
4
4
|
import "../chunk-WJJB7IJZ.js";
|
|
5
5
|
import "../chunk-Q4YDNW7N.js";
|
|
6
6
|
import "../chunk-M7INAUAJ.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-Y75MQKNY.js";
|
|
8
|
+
import "../chunk-MBZ55T2D.js";
|
|
8
9
|
import "../chunk-2IKT6IHB.js";
|
|
9
10
|
import "../chunk-YCDDBSVU.js";
|
|
10
11
|
import "../chunk-3X3Y4TMS.js";
|
|
11
12
|
import "../chunk-BQNPOGD5.js";
|
|
12
13
|
import "../chunk-Y5GD2FJA.js";
|
|
13
|
-
import "../chunk-MBZ55T2D.js";
|
|
14
14
|
import "../chunk-SZ47M32R.js";
|
|
15
15
|
import "../chunk-B4AE3DCA.js";
|
|
16
16
|
import "../chunk-FP3Y5JJN.js";
|
|
@@ -3507,6 +3507,10 @@ function DataGrid({
|
|
|
3507
3507
|
(0, import_core.useSensor)(import_core.KeyboardSensor)
|
|
3508
3508
|
);
|
|
3509
3509
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
3510
|
+
const nonPinnedColumnIds = table.getCenterLeafColumns().map((col) => col.id);
|
|
3511
|
+
const sortableColumnOrder = columnOrder.filter(
|
|
3512
|
+
(id2) => nonPinnedColumnIds.includes(id2)
|
|
3513
|
+
);
|
|
3510
3514
|
const columnVirtualizer = (0, import_react_virtual2.useVirtualizer)({
|
|
3511
3515
|
count: visibleColumns.length,
|
|
3512
3516
|
estimateSize: (index) => visibleColumns[index].getSize(),
|
|
@@ -3535,7 +3539,7 @@ function DataGrid({
|
|
|
3535
3539
|
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3536
3540
|
import_sortable2.SortableContext,
|
|
3537
3541
|
{
|
|
3538
|
-
items:
|
|
3542
|
+
items: sortableColumnOrder,
|
|
3539
3543
|
strategy: import_sortable2.horizontalListSortingStrategy,
|
|
3540
3544
|
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3541
3545
|
"div",
|
|
@@ -4428,6 +4432,62 @@ Tooltip.displayName = "Tooltip";
|
|
|
4428
4432
|
// src/components/DateInput.tsx
|
|
4429
4433
|
var import_react20 = require("react");
|
|
4430
4434
|
var import_react_dom3 = require("react-dom");
|
|
4435
|
+
|
|
4436
|
+
// src/utils/date-patch-dashes.ts
|
|
4437
|
+
function formatInputValueWithDashes(value, dateInDashes) {
|
|
4438
|
+
const digits = value.replace(/\D/g, "");
|
|
4439
|
+
if (dateInDashes) {
|
|
4440
|
+
if (digits.length <= 4) return digits;
|
|
4441
|
+
if (digits.length <= 6) return `${digits.slice(0, 4)}-${digits.slice(4)}`;
|
|
4442
|
+
return `${digits.slice(4, 6)}-${digits.slice(6, 8)}-${digits.slice(0, 4)}`;
|
|
4443
|
+
} else {
|
|
4444
|
+
if (digits.length <= 2) return digits;
|
|
4445
|
+
if (digits.length <= 4) return `${digits.slice(0, 2)}/${digits.slice(2)}`;
|
|
4446
|
+
return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
|
|
4447
|
+
}
|
|
4448
|
+
}
|
|
4449
|
+
function formatDateWithDashes(value, dateInDashes) {
|
|
4450
|
+
if (!value) return "";
|
|
4451
|
+
let year = "", month = "", day = "";
|
|
4452
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
|
4453
|
+
[year, month, day] = value.split("-");
|
|
4454
|
+
} else if (/^\d{2}-\d{2}-\d{4}$/.test(value)) {
|
|
4455
|
+
[month, day, year] = value.split("-");
|
|
4456
|
+
} else if (/^\d{2}\/\d{2}\/\d{4}$/.test(value)) {
|
|
4457
|
+
[month, day, year] = value.split("/");
|
|
4458
|
+
} else {
|
|
4459
|
+
return value;
|
|
4460
|
+
}
|
|
4461
|
+
if (!year || !month || !day) return value;
|
|
4462
|
+
if (dateInDashes) {
|
|
4463
|
+
return `${month}-${day}-${year}`;
|
|
4464
|
+
}
|
|
4465
|
+
return `${month}/${day}/${year}`;
|
|
4466
|
+
}
|
|
4467
|
+
function parseInputDateWithDashes(value, dateInDashes) {
|
|
4468
|
+
if (!value) return "";
|
|
4469
|
+
let year = "", month = "", day = "";
|
|
4470
|
+
if (dateInDashes) {
|
|
4471
|
+
let match = value.match(/^(\d{2})-(\d{2})-(\d{4})$/);
|
|
4472
|
+
if (match) {
|
|
4473
|
+
[, month, day, year] = match;
|
|
4474
|
+
} else {
|
|
4475
|
+
match = value.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
4476
|
+
if (match) {
|
|
4477
|
+
[, year, month, day] = match;
|
|
4478
|
+
}
|
|
4479
|
+
}
|
|
4480
|
+
} else {
|
|
4481
|
+
const match = value.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
|
|
4482
|
+
if (match) {
|
|
4483
|
+
[, month, day, year] = match;
|
|
4484
|
+
}
|
|
4485
|
+
}
|
|
4486
|
+
if (!year || !month || !day) return "";
|
|
4487
|
+
return `${month}-${day}-${year}`;
|
|
4488
|
+
}
|
|
4489
|
+
|
|
4490
|
+
// src/components/DateInput.tsx
|
|
4431
4491
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4432
4492
|
var DateInput = (_a) => {
|
|
4433
4493
|
var _b = _a, {
|
|
@@ -4440,7 +4500,8 @@ var DateInput = (_a) => {
|
|
|
4440
4500
|
readOnly = false,
|
|
4441
4501
|
label,
|
|
4442
4502
|
isDateAvailable,
|
|
4443
|
-
disableManualInput
|
|
4503
|
+
disableManualInput,
|
|
4504
|
+
dateInDashes = false
|
|
4444
4505
|
} = _b, props = __objRest(_b, [
|
|
4445
4506
|
"id",
|
|
4446
4507
|
"testid",
|
|
@@ -4451,7 +4512,8 @@ var DateInput = (_a) => {
|
|
|
4451
4512
|
"readOnly",
|
|
4452
4513
|
"label",
|
|
4453
4514
|
"isDateAvailable",
|
|
4454
|
-
"disableManualInput"
|
|
4515
|
+
"disableManualInput",
|
|
4516
|
+
"dateInDashes"
|
|
4455
4517
|
]);
|
|
4456
4518
|
const [visible, setVisible] = (0, import_react20.useState)(false);
|
|
4457
4519
|
const [inputValue, setInputValue] = (0, import_react20.useState)("");
|
|
@@ -4467,9 +4529,9 @@ var DateInput = (_a) => {
|
|
|
4467
4529
|
const [from, to] = [value, ""];
|
|
4468
4530
|
(0, import_react20.useEffect)(() => {
|
|
4469
4531
|
if (!isTyping) {
|
|
4470
|
-
setInputValue(formatDisplayValue(from));
|
|
4532
|
+
setInputValue(formatDisplayValue(from, dateInDashes));
|
|
4471
4533
|
}
|
|
4472
|
-
}, [from, isTyping]);
|
|
4534
|
+
}, [from, isTyping, dateInDashes]);
|
|
4473
4535
|
(0, import_react20.useLayoutEffect)(() => {
|
|
4474
4536
|
if (visible) {
|
|
4475
4537
|
updatePosition();
|
|
@@ -4532,7 +4594,7 @@ var DateInput = (_a) => {
|
|
|
4532
4594
|
const rawValue = event.target.value;
|
|
4533
4595
|
const cursorPosition = event.target.selectionStart || 0;
|
|
4534
4596
|
setIsTyping(true);
|
|
4535
|
-
const formattedValue =
|
|
4597
|
+
const formattedValue = formatInputValueWithDashes(rawValue, dateInDashes);
|
|
4536
4598
|
setInputValue(formattedValue);
|
|
4537
4599
|
requestAnimationFrame(() => {
|
|
4538
4600
|
if (triggerRef.current) {
|
|
@@ -4544,16 +4606,16 @@ var DateInput = (_a) => {
|
|
|
4544
4606
|
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
4545
4607
|
}
|
|
4546
4608
|
});
|
|
4547
|
-
const parsedDate =
|
|
4609
|
+
const parsedDate = parseInputDateWithDashes(formattedValue, dateInDashes);
|
|
4548
4610
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
4549
4611
|
onChange(parsedDate);
|
|
4550
4612
|
}
|
|
4551
4613
|
};
|
|
4552
4614
|
const handleBlur = () => {
|
|
4553
4615
|
setIsTyping(false);
|
|
4554
|
-
const parsedDate =
|
|
4616
|
+
const parsedDate = parseInputDateWithDashes(inputValue, dateInDashes);
|
|
4555
4617
|
if (!parsedDate || !isValidDate(parsedDate)) {
|
|
4556
|
-
setInputValue(formatDisplayValue(from));
|
|
4618
|
+
setInputValue(formatDisplayValue(from, dateInDashes));
|
|
4557
4619
|
}
|
|
4558
4620
|
};
|
|
4559
4621
|
const handleKeyDown = (event) => {
|
|
@@ -4561,10 +4623,11 @@ var DateInput = (_a) => {
|
|
|
4561
4623
|
const input = event.target;
|
|
4562
4624
|
const cursorPosition = input.selectionStart || 0;
|
|
4563
4625
|
const value2 = input.value;
|
|
4564
|
-
|
|
4626
|
+
const sep = dateInDashes ? "-" : "/";
|
|
4627
|
+
if (cursorPosition > 0 && value2[cursorPosition - 1] === sep) {
|
|
4565
4628
|
event.preventDefault();
|
|
4566
4629
|
const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
|
|
4567
|
-
const formattedValue =
|
|
4630
|
+
const formattedValue = formatInputValueWithDashes(newValue, dateInDashes);
|
|
4568
4631
|
setInputValue(formattedValue);
|
|
4569
4632
|
requestAnimationFrame(() => {
|
|
4570
4633
|
if (triggerRef.current) {
|
|
@@ -4577,7 +4640,7 @@ var DateInput = (_a) => {
|
|
|
4577
4640
|
}
|
|
4578
4641
|
}
|
|
4579
4642
|
if (event.key === "Enter") {
|
|
4580
|
-
const parsedDate =
|
|
4643
|
+
const parsedDate = parseInputDateWithDashes(inputValue, dateInDashes);
|
|
4581
4644
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
4582
4645
|
onChange(parsedDate);
|
|
4583
4646
|
setVisible(false);
|
|
@@ -4666,14 +4729,14 @@ var DateInput = (_a) => {
|
|
|
4666
4729
|
] });
|
|
4667
4730
|
};
|
|
4668
4731
|
DateInput.displayName = "DateInput";
|
|
4669
|
-
function formatDisplayValue(from) {
|
|
4732
|
+
function formatDisplayValue(from, dateInDashes) {
|
|
4670
4733
|
if (!from) {
|
|
4671
4734
|
return "";
|
|
4672
4735
|
}
|
|
4673
4736
|
if (!isValidDate(from)) {
|
|
4674
4737
|
return "";
|
|
4675
4738
|
}
|
|
4676
|
-
return
|
|
4739
|
+
return formatDateWithDashes(from, dateInDashes);
|
|
4677
4740
|
}
|
|
4678
4741
|
|
|
4679
4742
|
// src/components/Accordion.tsx
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CalendarRange
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-RESDUVMA.js";
|
|
4
4
|
import "../chunk-WJJB7IJZ.js";
|
|
5
5
|
import "../chunk-Q4YDNW7N.js";
|
|
6
6
|
import "../chunk-M7INAUAJ.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-Y75MQKNY.js";
|
|
8
|
+
import "../chunk-MBZ55T2D.js";
|
|
8
9
|
import "../chunk-2IKT6IHB.js";
|
|
9
10
|
import "../chunk-YCDDBSVU.js";
|
|
10
11
|
import "../chunk-3X3Y4TMS.js";
|
|
11
12
|
import "../chunk-BQNPOGD5.js";
|
|
12
13
|
import "../chunk-Y5GD2FJA.js";
|
|
13
|
-
import "../chunk-MBZ55T2D.js";
|
|
14
14
|
import "../chunk-SZ47M32R.js";
|
|
15
15
|
import "../chunk-B4AE3DCA.js";
|
|
16
16
|
import "../chunk-FP3Y5JJN.js";
|
|
@@ -476,30 +476,10 @@ function formatCurrencyDisplay(value) {
|
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
// src/utils/date.ts
|
|
479
|
-
function parseInputDate(input) {
|
|
480
|
-
const match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
|
|
481
|
-
if (!match) {
|
|
482
|
-
return null;
|
|
483
|
-
}
|
|
484
|
-
const [, month, day, year] = match;
|
|
485
|
-
const paddedMonth = month.padStart(2, "0");
|
|
486
|
-
const paddedDay = day.padStart(2, "0");
|
|
487
|
-
return `${year}-${paddedMonth}-${paddedDay}`;
|
|
488
|
-
}
|
|
489
479
|
function isValidDate(dateString) {
|
|
490
480
|
const date = new Date(dateString);
|
|
491
481
|
return date instanceof Date && !isNaN(date.getTime()) && dateString === date.toISOString().split("T")[0];
|
|
492
482
|
}
|
|
493
|
-
function formatInputValue(value) {
|
|
494
|
-
const digits = value.replace(/\D/g, "");
|
|
495
|
-
if (digits.length < 2) {
|
|
496
|
-
return digits;
|
|
497
|
-
}
|
|
498
|
-
if (digits.length >= 4) {
|
|
499
|
-
return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
|
|
500
|
-
}
|
|
501
|
-
return `${digits.slice(0, 2)}/${digits.slice(2)}`;
|
|
502
|
-
}
|
|
503
483
|
function isDigit(character) {
|
|
504
484
|
return /\d/.test(character);
|
|
505
485
|
}
|
|
@@ -3493,6 +3473,10 @@ function DataGrid({
|
|
|
3493
3473
|
(0, import_core.useSensor)(import_core.KeyboardSensor)
|
|
3494
3474
|
);
|
|
3495
3475
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
3476
|
+
const nonPinnedColumnIds = table.getCenterLeafColumns().map((col) => col.id);
|
|
3477
|
+
const sortableColumnOrder = columnOrder.filter(
|
|
3478
|
+
(id2) => nonPinnedColumnIds.includes(id2)
|
|
3479
|
+
);
|
|
3496
3480
|
const columnVirtualizer = (0, import_react_virtual2.useVirtualizer)({
|
|
3497
3481
|
count: visibleColumns.length,
|
|
3498
3482
|
estimateSize: (index) => visibleColumns[index].getSize(),
|
|
@@ -3521,7 +3505,7 @@ function DataGrid({
|
|
|
3521
3505
|
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3522
3506
|
import_sortable2.SortableContext,
|
|
3523
3507
|
{
|
|
3524
|
-
items:
|
|
3508
|
+
items: sortableColumnOrder,
|
|
3525
3509
|
strategy: import_sortable2.horizontalListSortingStrategy,
|
|
3526
3510
|
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3527
3511
|
"div",
|
|
@@ -4880,6 +4864,60 @@ function CalendarPane({
|
|
|
4880
4864
|
] }, month.name + month.year);
|
|
4881
4865
|
}
|
|
4882
4866
|
|
|
4867
|
+
// src/utils/date-patch-dashes.ts
|
|
4868
|
+
function formatInputValueWithDashes(value, dateInDashes) {
|
|
4869
|
+
const digits = value.replace(/\D/g, "");
|
|
4870
|
+
if (dateInDashes) {
|
|
4871
|
+
if (digits.length <= 4) return digits;
|
|
4872
|
+
if (digits.length <= 6) return `${digits.slice(0, 4)}-${digits.slice(4)}`;
|
|
4873
|
+
return `${digits.slice(4, 6)}-${digits.slice(6, 8)}-${digits.slice(0, 4)}`;
|
|
4874
|
+
} else {
|
|
4875
|
+
if (digits.length <= 2) return digits;
|
|
4876
|
+
if (digits.length <= 4) return `${digits.slice(0, 2)}/${digits.slice(2)}`;
|
|
4877
|
+
return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
|
|
4878
|
+
}
|
|
4879
|
+
}
|
|
4880
|
+
function formatDateWithDashes(value, dateInDashes) {
|
|
4881
|
+
if (!value) return "";
|
|
4882
|
+
let year = "", month = "", day = "";
|
|
4883
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
|
4884
|
+
[year, month, day] = value.split("-");
|
|
4885
|
+
} else if (/^\d{2}-\d{2}-\d{4}$/.test(value)) {
|
|
4886
|
+
[month, day, year] = value.split("-");
|
|
4887
|
+
} else if (/^\d{2}\/\d{2}\/\d{4}$/.test(value)) {
|
|
4888
|
+
[month, day, year] = value.split("/");
|
|
4889
|
+
} else {
|
|
4890
|
+
return value;
|
|
4891
|
+
}
|
|
4892
|
+
if (!year || !month || !day) return value;
|
|
4893
|
+
if (dateInDashes) {
|
|
4894
|
+
return `${month}-${day}-${year}`;
|
|
4895
|
+
}
|
|
4896
|
+
return `${month}/${day}/${year}`;
|
|
4897
|
+
}
|
|
4898
|
+
function parseInputDateWithDashes(value, dateInDashes) {
|
|
4899
|
+
if (!value) return "";
|
|
4900
|
+
let year = "", month = "", day = "";
|
|
4901
|
+
if (dateInDashes) {
|
|
4902
|
+
let match = value.match(/^(\d{2})-(\d{2})-(\d{4})$/);
|
|
4903
|
+
if (match) {
|
|
4904
|
+
[, month, day, year] = match;
|
|
4905
|
+
} else {
|
|
4906
|
+
match = value.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
4907
|
+
if (match) {
|
|
4908
|
+
[, year, month, day] = match;
|
|
4909
|
+
}
|
|
4910
|
+
}
|
|
4911
|
+
} else {
|
|
4912
|
+
const match = value.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
|
|
4913
|
+
if (match) {
|
|
4914
|
+
[, month, day, year] = match;
|
|
4915
|
+
}
|
|
4916
|
+
}
|
|
4917
|
+
if (!year || !month || !day) return "";
|
|
4918
|
+
return `${month}-${day}-${year}`;
|
|
4919
|
+
}
|
|
4920
|
+
|
|
4883
4921
|
// src/components/DateInput.tsx
|
|
4884
4922
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4885
4923
|
var DateInput = (_a) => {
|
|
@@ -4893,7 +4931,8 @@ var DateInput = (_a) => {
|
|
|
4893
4931
|
readOnly = false,
|
|
4894
4932
|
label,
|
|
4895
4933
|
isDateAvailable,
|
|
4896
|
-
disableManualInput
|
|
4934
|
+
disableManualInput,
|
|
4935
|
+
dateInDashes = false
|
|
4897
4936
|
} = _b, props = __objRest(_b, [
|
|
4898
4937
|
"id",
|
|
4899
4938
|
"testid",
|
|
@@ -4904,7 +4943,8 @@ var DateInput = (_a) => {
|
|
|
4904
4943
|
"readOnly",
|
|
4905
4944
|
"label",
|
|
4906
4945
|
"isDateAvailable",
|
|
4907
|
-
"disableManualInput"
|
|
4946
|
+
"disableManualInput",
|
|
4947
|
+
"dateInDashes"
|
|
4908
4948
|
]);
|
|
4909
4949
|
const [visible, setVisible] = (0, import_react21.useState)(false);
|
|
4910
4950
|
const [inputValue, setInputValue] = (0, import_react21.useState)("");
|
|
@@ -4920,9 +4960,9 @@ var DateInput = (_a) => {
|
|
|
4920
4960
|
const [from, to] = [value, ""];
|
|
4921
4961
|
(0, import_react21.useEffect)(() => {
|
|
4922
4962
|
if (!isTyping) {
|
|
4923
|
-
setInputValue(formatDisplayValue(from));
|
|
4963
|
+
setInputValue(formatDisplayValue(from, dateInDashes));
|
|
4924
4964
|
}
|
|
4925
|
-
}, [from, isTyping]);
|
|
4965
|
+
}, [from, isTyping, dateInDashes]);
|
|
4926
4966
|
(0, import_react21.useLayoutEffect)(() => {
|
|
4927
4967
|
if (visible) {
|
|
4928
4968
|
updatePosition();
|
|
@@ -4985,7 +5025,7 @@ var DateInput = (_a) => {
|
|
|
4985
5025
|
const rawValue = event.target.value;
|
|
4986
5026
|
const cursorPosition = event.target.selectionStart || 0;
|
|
4987
5027
|
setIsTyping(true);
|
|
4988
|
-
const formattedValue =
|
|
5028
|
+
const formattedValue = formatInputValueWithDashes(rawValue, dateInDashes);
|
|
4989
5029
|
setInputValue(formattedValue);
|
|
4990
5030
|
requestAnimationFrame(() => {
|
|
4991
5031
|
if (triggerRef.current) {
|
|
@@ -4997,16 +5037,16 @@ var DateInput = (_a) => {
|
|
|
4997
5037
|
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
4998
5038
|
}
|
|
4999
5039
|
});
|
|
5000
|
-
const parsedDate =
|
|
5040
|
+
const parsedDate = parseInputDateWithDashes(formattedValue, dateInDashes);
|
|
5001
5041
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
5002
5042
|
onChange(parsedDate);
|
|
5003
5043
|
}
|
|
5004
5044
|
};
|
|
5005
5045
|
const handleBlur = () => {
|
|
5006
5046
|
setIsTyping(false);
|
|
5007
|
-
const parsedDate =
|
|
5047
|
+
const parsedDate = parseInputDateWithDashes(inputValue, dateInDashes);
|
|
5008
5048
|
if (!parsedDate || !isValidDate(parsedDate)) {
|
|
5009
|
-
setInputValue(formatDisplayValue(from));
|
|
5049
|
+
setInputValue(formatDisplayValue(from, dateInDashes));
|
|
5010
5050
|
}
|
|
5011
5051
|
};
|
|
5012
5052
|
const handleKeyDown = (event) => {
|
|
@@ -5014,10 +5054,11 @@ var DateInput = (_a) => {
|
|
|
5014
5054
|
const input = event.target;
|
|
5015
5055
|
const cursorPosition = input.selectionStart || 0;
|
|
5016
5056
|
const value2 = input.value;
|
|
5017
|
-
|
|
5057
|
+
const sep = dateInDashes ? "-" : "/";
|
|
5058
|
+
if (cursorPosition > 0 && value2[cursorPosition - 1] === sep) {
|
|
5018
5059
|
event.preventDefault();
|
|
5019
5060
|
const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
|
|
5020
|
-
const formattedValue =
|
|
5061
|
+
const formattedValue = formatInputValueWithDashes(newValue, dateInDashes);
|
|
5021
5062
|
setInputValue(formattedValue);
|
|
5022
5063
|
requestAnimationFrame(() => {
|
|
5023
5064
|
if (triggerRef.current) {
|
|
@@ -5030,7 +5071,7 @@ var DateInput = (_a) => {
|
|
|
5030
5071
|
}
|
|
5031
5072
|
}
|
|
5032
5073
|
if (event.key === "Enter") {
|
|
5033
|
-
const parsedDate =
|
|
5074
|
+
const parsedDate = parseInputDateWithDashes(inputValue, dateInDashes);
|
|
5034
5075
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
5035
5076
|
onChange(parsedDate);
|
|
5036
5077
|
setVisible(false);
|
|
@@ -5119,14 +5160,14 @@ var DateInput = (_a) => {
|
|
|
5119
5160
|
] });
|
|
5120
5161
|
};
|
|
5121
5162
|
DateInput.displayName = "DateInput";
|
|
5122
|
-
function formatDisplayValue(from) {
|
|
5163
|
+
function formatDisplayValue(from, dateInDashes) {
|
|
5123
5164
|
if (!from) {
|
|
5124
5165
|
return "";
|
|
5125
5166
|
}
|
|
5126
5167
|
if (!isValidDate(from)) {
|
|
5127
5168
|
return "";
|
|
5128
5169
|
}
|
|
5129
|
-
return
|
|
5170
|
+
return formatDateWithDashes(from, dateInDashes);
|
|
5130
5171
|
}
|
|
5131
5172
|
|
|
5132
5173
|
// src/components/Accordion.tsx
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ColumnSelector
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-RESDUVMA.js";
|
|
4
4
|
import "../../../chunk-WJJB7IJZ.js";
|
|
5
5
|
import "../../../chunk-Q4YDNW7N.js";
|
|
6
6
|
import "../../../chunk-M7INAUAJ.js";
|
|
7
|
-
import "../../../chunk-
|
|
7
|
+
import "../../../chunk-Y75MQKNY.js";
|
|
8
|
+
import "../../../chunk-MBZ55T2D.js";
|
|
8
9
|
import "../../../chunk-2IKT6IHB.js";
|
|
9
10
|
import "../../../chunk-YCDDBSVU.js";
|
|
10
11
|
import "../../../chunk-3X3Y4TMS.js";
|
|
11
12
|
import "../../../chunk-BQNPOGD5.js";
|
|
12
13
|
import "../../../chunk-Y5GD2FJA.js";
|
|
13
|
-
import "../../../chunk-MBZ55T2D.js";
|
|
14
14
|
import "../../../chunk-SZ47M32R.js";
|
|
15
15
|
import "../../../chunk-B4AE3DCA.js";
|
|
16
16
|
import "../../../chunk-FP3Y5JJN.js";
|
|
@@ -907,30 +907,10 @@ function formatCurrencyDisplay(value) {
|
|
|
907
907
|
}
|
|
908
908
|
|
|
909
909
|
// src/utils/date.ts
|
|
910
|
-
function parseInputDate(input) {
|
|
911
|
-
const match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
|
|
912
|
-
if (!match) {
|
|
913
|
-
return null;
|
|
914
|
-
}
|
|
915
|
-
const [, month, day, year] = match;
|
|
916
|
-
const paddedMonth = month.padStart(2, "0");
|
|
917
|
-
const paddedDay = day.padStart(2, "0");
|
|
918
|
-
return `${year}-${paddedMonth}-${paddedDay}`;
|
|
919
|
-
}
|
|
920
910
|
function isValidDate(dateString) {
|
|
921
911
|
const date = new Date(dateString);
|
|
922
912
|
return date instanceof Date && !isNaN(date.getTime()) && dateString === date.toISOString().split("T")[0];
|
|
923
913
|
}
|
|
924
|
-
function formatInputValue(value) {
|
|
925
|
-
const digits = value.replace(/\D/g, "");
|
|
926
|
-
if (digits.length < 2) {
|
|
927
|
-
return digits;
|
|
928
|
-
}
|
|
929
|
-
if (digits.length >= 4) {
|
|
930
|
-
return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
|
|
931
|
-
}
|
|
932
|
-
return `${digits.slice(0, 2)}/${digits.slice(2)}`;
|
|
933
|
-
}
|
|
934
914
|
function isDigit(character) {
|
|
935
915
|
return /\d/.test(character);
|
|
936
916
|
}
|
|
@@ -3924,6 +3904,10 @@ function DataGrid({
|
|
|
3924
3904
|
(0, import_core.useSensor)(import_core.KeyboardSensor)
|
|
3925
3905
|
);
|
|
3926
3906
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
3907
|
+
const nonPinnedColumnIds = table.getCenterLeafColumns().map((col) => col.id);
|
|
3908
|
+
const sortableColumnOrder = columnOrder.filter(
|
|
3909
|
+
(id2) => nonPinnedColumnIds.includes(id2)
|
|
3910
|
+
);
|
|
3927
3911
|
const columnVirtualizer = (0, import_react_virtual2.useVirtualizer)({
|
|
3928
3912
|
count: visibleColumns.length,
|
|
3929
3913
|
estimateSize: (index) => visibleColumns[index].getSize(),
|
|
@@ -3952,7 +3936,7 @@ function DataGrid({
|
|
|
3952
3936
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3953
3937
|
import_sortable2.SortableContext,
|
|
3954
3938
|
{
|
|
3955
|
-
items:
|
|
3939
|
+
items: sortableColumnOrder,
|
|
3956
3940
|
strategy: import_sortable2.horizontalListSortingStrategy,
|
|
3957
3941
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3958
3942
|
"div",
|
|
@@ -5187,6 +5171,60 @@ function CalendarPane({
|
|
|
5187
5171
|
] }, month.name + month.year);
|
|
5188
5172
|
}
|
|
5189
5173
|
|
|
5174
|
+
// src/utils/date-patch-dashes.ts
|
|
5175
|
+
function formatInputValueWithDashes(value, dateInDashes) {
|
|
5176
|
+
const digits = value.replace(/\D/g, "");
|
|
5177
|
+
if (dateInDashes) {
|
|
5178
|
+
if (digits.length <= 4) return digits;
|
|
5179
|
+
if (digits.length <= 6) return `${digits.slice(0, 4)}-${digits.slice(4)}`;
|
|
5180
|
+
return `${digits.slice(4, 6)}-${digits.slice(6, 8)}-${digits.slice(0, 4)}`;
|
|
5181
|
+
} else {
|
|
5182
|
+
if (digits.length <= 2) return digits;
|
|
5183
|
+
if (digits.length <= 4) return `${digits.slice(0, 2)}/${digits.slice(2)}`;
|
|
5184
|
+
return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
|
|
5185
|
+
}
|
|
5186
|
+
}
|
|
5187
|
+
function formatDateWithDashes(value, dateInDashes) {
|
|
5188
|
+
if (!value) return "";
|
|
5189
|
+
let year = "", month = "", day = "";
|
|
5190
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
|
5191
|
+
[year, month, day] = value.split("-");
|
|
5192
|
+
} else if (/^\d{2}-\d{2}-\d{4}$/.test(value)) {
|
|
5193
|
+
[month, day, year] = value.split("-");
|
|
5194
|
+
} else if (/^\d{2}\/\d{2}\/\d{4}$/.test(value)) {
|
|
5195
|
+
[month, day, year] = value.split("/");
|
|
5196
|
+
} else {
|
|
5197
|
+
return value;
|
|
5198
|
+
}
|
|
5199
|
+
if (!year || !month || !day) return value;
|
|
5200
|
+
if (dateInDashes) {
|
|
5201
|
+
return `${month}-${day}-${year}`;
|
|
5202
|
+
}
|
|
5203
|
+
return `${month}/${day}/${year}`;
|
|
5204
|
+
}
|
|
5205
|
+
function parseInputDateWithDashes(value, dateInDashes) {
|
|
5206
|
+
if (!value) return "";
|
|
5207
|
+
let year = "", month = "", day = "";
|
|
5208
|
+
if (dateInDashes) {
|
|
5209
|
+
let match = value.match(/^(\d{2})-(\d{2})-(\d{4})$/);
|
|
5210
|
+
if (match) {
|
|
5211
|
+
[, month, day, year] = match;
|
|
5212
|
+
} else {
|
|
5213
|
+
match = value.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
5214
|
+
if (match) {
|
|
5215
|
+
[, year, month, day] = match;
|
|
5216
|
+
}
|
|
5217
|
+
}
|
|
5218
|
+
} else {
|
|
5219
|
+
const match = value.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
|
|
5220
|
+
if (match) {
|
|
5221
|
+
[, month, day, year] = match;
|
|
5222
|
+
}
|
|
5223
|
+
}
|
|
5224
|
+
if (!year || !month || !day) return "";
|
|
5225
|
+
return `${month}-${day}-${year}`;
|
|
5226
|
+
}
|
|
5227
|
+
|
|
5190
5228
|
// src/components/DateInput.tsx
|
|
5191
5229
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
5192
5230
|
var DateInput = (_a) => {
|
|
@@ -5200,7 +5238,8 @@ var DateInput = (_a) => {
|
|
|
5200
5238
|
readOnly = false,
|
|
5201
5239
|
label,
|
|
5202
5240
|
isDateAvailable,
|
|
5203
|
-
disableManualInput
|
|
5241
|
+
disableManualInput,
|
|
5242
|
+
dateInDashes = false
|
|
5204
5243
|
} = _b, props = __objRest(_b, [
|
|
5205
5244
|
"id",
|
|
5206
5245
|
"testid",
|
|
@@ -5211,7 +5250,8 @@ var DateInput = (_a) => {
|
|
|
5211
5250
|
"readOnly",
|
|
5212
5251
|
"label",
|
|
5213
5252
|
"isDateAvailable",
|
|
5214
|
-
"disableManualInput"
|
|
5253
|
+
"disableManualInput",
|
|
5254
|
+
"dateInDashes"
|
|
5215
5255
|
]);
|
|
5216
5256
|
const [visible, setVisible] = (0, import_react21.useState)(false);
|
|
5217
5257
|
const [inputValue, setInputValue] = (0, import_react21.useState)("");
|
|
@@ -5227,9 +5267,9 @@ var DateInput = (_a) => {
|
|
|
5227
5267
|
const [from, to] = [value, ""];
|
|
5228
5268
|
(0, import_react21.useEffect)(() => {
|
|
5229
5269
|
if (!isTyping) {
|
|
5230
|
-
setInputValue(formatDisplayValue(from));
|
|
5270
|
+
setInputValue(formatDisplayValue(from, dateInDashes));
|
|
5231
5271
|
}
|
|
5232
|
-
}, [from, isTyping]);
|
|
5272
|
+
}, [from, isTyping, dateInDashes]);
|
|
5233
5273
|
(0, import_react21.useLayoutEffect)(() => {
|
|
5234
5274
|
if (visible) {
|
|
5235
5275
|
updatePosition();
|
|
@@ -5292,7 +5332,7 @@ var DateInput = (_a) => {
|
|
|
5292
5332
|
const rawValue = event.target.value;
|
|
5293
5333
|
const cursorPosition = event.target.selectionStart || 0;
|
|
5294
5334
|
setIsTyping(true);
|
|
5295
|
-
const formattedValue =
|
|
5335
|
+
const formattedValue = formatInputValueWithDashes(rawValue, dateInDashes);
|
|
5296
5336
|
setInputValue(formattedValue);
|
|
5297
5337
|
requestAnimationFrame(() => {
|
|
5298
5338
|
if (triggerRef.current) {
|
|
@@ -5304,16 +5344,16 @@ var DateInput = (_a) => {
|
|
|
5304
5344
|
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
5305
5345
|
}
|
|
5306
5346
|
});
|
|
5307
|
-
const parsedDate =
|
|
5347
|
+
const parsedDate = parseInputDateWithDashes(formattedValue, dateInDashes);
|
|
5308
5348
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
5309
5349
|
onChange(parsedDate);
|
|
5310
5350
|
}
|
|
5311
5351
|
};
|
|
5312
5352
|
const handleBlur = () => {
|
|
5313
5353
|
setIsTyping(false);
|
|
5314
|
-
const parsedDate =
|
|
5354
|
+
const parsedDate = parseInputDateWithDashes(inputValue, dateInDashes);
|
|
5315
5355
|
if (!parsedDate || !isValidDate(parsedDate)) {
|
|
5316
|
-
setInputValue(formatDisplayValue(from));
|
|
5356
|
+
setInputValue(formatDisplayValue(from, dateInDashes));
|
|
5317
5357
|
}
|
|
5318
5358
|
};
|
|
5319
5359
|
const handleKeyDown = (event) => {
|
|
@@ -5321,10 +5361,11 @@ var DateInput = (_a) => {
|
|
|
5321
5361
|
const input = event.target;
|
|
5322
5362
|
const cursorPosition = input.selectionStart || 0;
|
|
5323
5363
|
const value2 = input.value;
|
|
5324
|
-
|
|
5364
|
+
const sep = dateInDashes ? "-" : "/";
|
|
5365
|
+
if (cursorPosition > 0 && value2[cursorPosition - 1] === sep) {
|
|
5325
5366
|
event.preventDefault();
|
|
5326
5367
|
const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
|
|
5327
|
-
const formattedValue =
|
|
5368
|
+
const formattedValue = formatInputValueWithDashes(newValue, dateInDashes);
|
|
5328
5369
|
setInputValue(formattedValue);
|
|
5329
5370
|
requestAnimationFrame(() => {
|
|
5330
5371
|
if (triggerRef.current) {
|
|
@@ -5337,7 +5378,7 @@ var DateInput = (_a) => {
|
|
|
5337
5378
|
}
|
|
5338
5379
|
}
|
|
5339
5380
|
if (event.key === "Enter") {
|
|
5340
|
-
const parsedDate =
|
|
5381
|
+
const parsedDate = parseInputDateWithDashes(inputValue, dateInDashes);
|
|
5341
5382
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
5342
5383
|
onChange(parsedDate);
|
|
5343
5384
|
setVisible(false);
|
|
@@ -5426,14 +5467,14 @@ var DateInput = (_a) => {
|
|
|
5426
5467
|
] });
|
|
5427
5468
|
};
|
|
5428
5469
|
DateInput.displayName = "DateInput";
|
|
5429
|
-
function formatDisplayValue(from) {
|
|
5470
|
+
function formatDisplayValue(from, dateInDashes) {
|
|
5430
5471
|
if (!from) {
|
|
5431
5472
|
return "";
|
|
5432
5473
|
}
|
|
5433
5474
|
if (!isValidDate(from)) {
|
|
5434
5475
|
return "";
|
|
5435
5476
|
}
|
|
5436
|
-
return
|
|
5477
|
+
return formatDateWithDashes(from, dateInDashes);
|
|
5437
5478
|
}
|
|
5438
5479
|
|
|
5439
5480
|
// src/components/Accordion.tsx
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MobileDataGridHeader
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-RESDUVMA.js";
|
|
4
4
|
import "../../chunk-WJJB7IJZ.js";
|
|
5
5
|
import "../../chunk-Q4YDNW7N.js";
|
|
6
6
|
import "../../chunk-M7INAUAJ.js";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-Y75MQKNY.js";
|
|
8
|
+
import "../../chunk-MBZ55T2D.js";
|
|
8
9
|
import "../../chunk-2IKT6IHB.js";
|
|
9
10
|
import "../../chunk-YCDDBSVU.js";
|
|
10
11
|
import "../../chunk-3X3Y4TMS.js";
|
|
11
12
|
import "../../chunk-BQNPOGD5.js";
|
|
12
13
|
import "../../chunk-Y5GD2FJA.js";
|
|
13
|
-
import "../../chunk-MBZ55T2D.js";
|
|
14
14
|
import "../../chunk-SZ47M32R.js";
|
|
15
15
|
import "../../chunk-B4AE3DCA.js";
|
|
16
16
|
import "../../chunk-FP3Y5JJN.js";
|