@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
|
LoadingCell
|
|
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";
|
|
@@ -478,30 +478,10 @@ function formatCurrencyDisplay(value) {
|
|
|
478
478
|
}
|
|
479
479
|
|
|
480
480
|
// src/utils/date.ts
|
|
481
|
-
function parseInputDate(input) {
|
|
482
|
-
const match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
|
|
483
|
-
if (!match) {
|
|
484
|
-
return null;
|
|
485
|
-
}
|
|
486
|
-
const [, month, day, year] = match;
|
|
487
|
-
const paddedMonth = month.padStart(2, "0");
|
|
488
|
-
const paddedDay = day.padStart(2, "0");
|
|
489
|
-
return `${year}-${paddedMonth}-${paddedDay}`;
|
|
490
|
-
}
|
|
491
481
|
function isValidDate(dateString) {
|
|
492
482
|
const date = new Date(dateString);
|
|
493
483
|
return date instanceof Date && !isNaN(date.getTime()) && dateString === date.toISOString().split("T")[0];
|
|
494
484
|
}
|
|
495
|
-
function formatInputValue(value) {
|
|
496
|
-
const digits = value.replace(/\D/g, "");
|
|
497
|
-
if (digits.length < 2) {
|
|
498
|
-
return digits;
|
|
499
|
-
}
|
|
500
|
-
if (digits.length >= 4) {
|
|
501
|
-
return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
|
|
502
|
-
}
|
|
503
|
-
return `${digits.slice(0, 2)}/${digits.slice(2)}`;
|
|
504
|
-
}
|
|
505
485
|
function isDigit(character) {
|
|
506
486
|
return /\d/.test(character);
|
|
507
487
|
}
|
|
@@ -3384,6 +3364,10 @@ function DataGrid({
|
|
|
3384
3364
|
(0, import_core.useSensor)(import_core.KeyboardSensor)
|
|
3385
3365
|
);
|
|
3386
3366
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
3367
|
+
const nonPinnedColumnIds = table.getCenterLeafColumns().map((col) => col.id);
|
|
3368
|
+
const sortableColumnOrder = columnOrder.filter(
|
|
3369
|
+
(id2) => nonPinnedColumnIds.includes(id2)
|
|
3370
|
+
);
|
|
3387
3371
|
const columnVirtualizer = (0, import_react_virtual2.useVirtualizer)({
|
|
3388
3372
|
count: visibleColumns.length,
|
|
3389
3373
|
estimateSize: (index) => visibleColumns[index].getSize(),
|
|
@@ -3412,7 +3396,7 @@ function DataGrid({
|
|
|
3412
3396
|
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3413
3397
|
import_sortable2.SortableContext,
|
|
3414
3398
|
{
|
|
3415
|
-
items:
|
|
3399
|
+
items: sortableColumnOrder,
|
|
3416
3400
|
strategy: import_sortable2.horizontalListSortingStrategy,
|
|
3417
3401
|
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3418
3402
|
"div",
|
|
@@ -4771,6 +4755,60 @@ function CalendarPane({
|
|
|
4771
4755
|
] }, month.name + month.year);
|
|
4772
4756
|
}
|
|
4773
4757
|
|
|
4758
|
+
// src/utils/date-patch-dashes.ts
|
|
4759
|
+
function formatInputValueWithDashes(value, dateInDashes) {
|
|
4760
|
+
const digits = value.replace(/\D/g, "");
|
|
4761
|
+
if (dateInDashes) {
|
|
4762
|
+
if (digits.length <= 4) return digits;
|
|
4763
|
+
if (digits.length <= 6) return `${digits.slice(0, 4)}-${digits.slice(4)}`;
|
|
4764
|
+
return `${digits.slice(4, 6)}-${digits.slice(6, 8)}-${digits.slice(0, 4)}`;
|
|
4765
|
+
} else {
|
|
4766
|
+
if (digits.length <= 2) return digits;
|
|
4767
|
+
if (digits.length <= 4) return `${digits.slice(0, 2)}/${digits.slice(2)}`;
|
|
4768
|
+
return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4771
|
+
function formatDateWithDashes(value, dateInDashes) {
|
|
4772
|
+
if (!value) return "";
|
|
4773
|
+
let year = "", month = "", day = "";
|
|
4774
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
|
4775
|
+
[year, month, day] = value.split("-");
|
|
4776
|
+
} else if (/^\d{2}-\d{2}-\d{4}$/.test(value)) {
|
|
4777
|
+
[month, day, year] = value.split("-");
|
|
4778
|
+
} else if (/^\d{2}\/\d{2}\/\d{4}$/.test(value)) {
|
|
4779
|
+
[month, day, year] = value.split("/");
|
|
4780
|
+
} else {
|
|
4781
|
+
return value;
|
|
4782
|
+
}
|
|
4783
|
+
if (!year || !month || !day) return value;
|
|
4784
|
+
if (dateInDashes) {
|
|
4785
|
+
return `${month}-${day}-${year}`;
|
|
4786
|
+
}
|
|
4787
|
+
return `${month}/${day}/${year}`;
|
|
4788
|
+
}
|
|
4789
|
+
function parseInputDateWithDashes(value, dateInDashes) {
|
|
4790
|
+
if (!value) return "";
|
|
4791
|
+
let year = "", month = "", day = "";
|
|
4792
|
+
if (dateInDashes) {
|
|
4793
|
+
let match = value.match(/^(\d{2})-(\d{2})-(\d{4})$/);
|
|
4794
|
+
if (match) {
|
|
4795
|
+
[, month, day, year] = match;
|
|
4796
|
+
} else {
|
|
4797
|
+
match = value.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
4798
|
+
if (match) {
|
|
4799
|
+
[, year, month, day] = match;
|
|
4800
|
+
}
|
|
4801
|
+
}
|
|
4802
|
+
} else {
|
|
4803
|
+
const match = value.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
|
|
4804
|
+
if (match) {
|
|
4805
|
+
[, month, day, year] = match;
|
|
4806
|
+
}
|
|
4807
|
+
}
|
|
4808
|
+
if (!year || !month || !day) return "";
|
|
4809
|
+
return `${month}-${day}-${year}`;
|
|
4810
|
+
}
|
|
4811
|
+
|
|
4774
4812
|
// src/components/DateInput.tsx
|
|
4775
4813
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4776
4814
|
var DateInput = (_a) => {
|
|
@@ -4784,7 +4822,8 @@ var DateInput = (_a) => {
|
|
|
4784
4822
|
readOnly = false,
|
|
4785
4823
|
label,
|
|
4786
4824
|
isDateAvailable,
|
|
4787
|
-
disableManualInput
|
|
4825
|
+
disableManualInput,
|
|
4826
|
+
dateInDashes = false
|
|
4788
4827
|
} = _b, props = __objRest(_b, [
|
|
4789
4828
|
"id",
|
|
4790
4829
|
"testid",
|
|
@@ -4795,7 +4834,8 @@ var DateInput = (_a) => {
|
|
|
4795
4834
|
"readOnly",
|
|
4796
4835
|
"label",
|
|
4797
4836
|
"isDateAvailable",
|
|
4798
|
-
"disableManualInput"
|
|
4837
|
+
"disableManualInput",
|
|
4838
|
+
"dateInDashes"
|
|
4799
4839
|
]);
|
|
4800
4840
|
const [visible, setVisible] = (0, import_react20.useState)(false);
|
|
4801
4841
|
const [inputValue, setInputValue] = (0, import_react20.useState)("");
|
|
@@ -4811,9 +4851,9 @@ var DateInput = (_a) => {
|
|
|
4811
4851
|
const [from, to] = [value, ""];
|
|
4812
4852
|
(0, import_react20.useEffect)(() => {
|
|
4813
4853
|
if (!isTyping) {
|
|
4814
|
-
setInputValue(formatDisplayValue(from));
|
|
4854
|
+
setInputValue(formatDisplayValue(from, dateInDashes));
|
|
4815
4855
|
}
|
|
4816
|
-
}, [from, isTyping]);
|
|
4856
|
+
}, [from, isTyping, dateInDashes]);
|
|
4817
4857
|
(0, import_react20.useLayoutEffect)(() => {
|
|
4818
4858
|
if (visible) {
|
|
4819
4859
|
updatePosition();
|
|
@@ -4876,7 +4916,7 @@ var DateInput = (_a) => {
|
|
|
4876
4916
|
const rawValue = event.target.value;
|
|
4877
4917
|
const cursorPosition = event.target.selectionStart || 0;
|
|
4878
4918
|
setIsTyping(true);
|
|
4879
|
-
const formattedValue =
|
|
4919
|
+
const formattedValue = formatInputValueWithDashes(rawValue, dateInDashes);
|
|
4880
4920
|
setInputValue(formattedValue);
|
|
4881
4921
|
requestAnimationFrame(() => {
|
|
4882
4922
|
if (triggerRef.current) {
|
|
@@ -4888,16 +4928,16 @@ var DateInput = (_a) => {
|
|
|
4888
4928
|
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
4889
4929
|
}
|
|
4890
4930
|
});
|
|
4891
|
-
const parsedDate =
|
|
4931
|
+
const parsedDate = parseInputDateWithDashes(formattedValue, dateInDashes);
|
|
4892
4932
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
4893
4933
|
onChange(parsedDate);
|
|
4894
4934
|
}
|
|
4895
4935
|
};
|
|
4896
4936
|
const handleBlur = () => {
|
|
4897
4937
|
setIsTyping(false);
|
|
4898
|
-
const parsedDate =
|
|
4938
|
+
const parsedDate = parseInputDateWithDashes(inputValue, dateInDashes);
|
|
4899
4939
|
if (!parsedDate || !isValidDate(parsedDate)) {
|
|
4900
|
-
setInputValue(formatDisplayValue(from));
|
|
4940
|
+
setInputValue(formatDisplayValue(from, dateInDashes));
|
|
4901
4941
|
}
|
|
4902
4942
|
};
|
|
4903
4943
|
const handleKeyDown = (event) => {
|
|
@@ -4905,10 +4945,11 @@ var DateInput = (_a) => {
|
|
|
4905
4945
|
const input = event.target;
|
|
4906
4946
|
const cursorPosition = input.selectionStart || 0;
|
|
4907
4947
|
const value2 = input.value;
|
|
4908
|
-
|
|
4948
|
+
const sep = dateInDashes ? "-" : "/";
|
|
4949
|
+
if (cursorPosition > 0 && value2[cursorPosition - 1] === sep) {
|
|
4909
4950
|
event.preventDefault();
|
|
4910
4951
|
const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
|
|
4911
|
-
const formattedValue =
|
|
4952
|
+
const formattedValue = formatInputValueWithDashes(newValue, dateInDashes);
|
|
4912
4953
|
setInputValue(formattedValue);
|
|
4913
4954
|
requestAnimationFrame(() => {
|
|
4914
4955
|
if (triggerRef.current) {
|
|
@@ -4921,7 +4962,7 @@ var DateInput = (_a) => {
|
|
|
4921
4962
|
}
|
|
4922
4963
|
}
|
|
4923
4964
|
if (event.key === "Enter") {
|
|
4924
|
-
const parsedDate =
|
|
4965
|
+
const parsedDate = parseInputDateWithDashes(inputValue, dateInDashes);
|
|
4925
4966
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
4926
4967
|
onChange(parsedDate);
|
|
4927
4968
|
setVisible(false);
|
|
@@ -5010,14 +5051,14 @@ var DateInput = (_a) => {
|
|
|
5010
5051
|
] });
|
|
5011
5052
|
};
|
|
5012
5053
|
DateInput.displayName = "DateInput";
|
|
5013
|
-
function formatDisplayValue(from) {
|
|
5054
|
+
function formatDisplayValue(from, dateInDashes) {
|
|
5014
5055
|
if (!from) {
|
|
5015
5056
|
return "";
|
|
5016
5057
|
}
|
|
5017
5058
|
if (!isValidDate(from)) {
|
|
5018
5059
|
return "";
|
|
5019
5060
|
}
|
|
5020
|
-
return
|
|
5061
|
+
return formatDateWithDashes(from, dateInDashes);
|
|
5021
5062
|
}
|
|
5022
5063
|
|
|
5023
5064
|
// src/components/Accordion.tsx
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TableBodyRow
|
|
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
|
}
|
|
@@ -3196,6 +3176,10 @@ function DataGrid({
|
|
|
3196
3176
|
(0, import_core.useSensor)(import_core.KeyboardSensor)
|
|
3197
3177
|
);
|
|
3198
3178
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
3179
|
+
const nonPinnedColumnIds = table.getCenterLeafColumns().map((col) => col.id);
|
|
3180
|
+
const sortableColumnOrder = columnOrder.filter(
|
|
3181
|
+
(id2) => nonPinnedColumnIds.includes(id2)
|
|
3182
|
+
);
|
|
3199
3183
|
const columnVirtualizer = (0, import_react_virtual.useVirtualizer)({
|
|
3200
3184
|
count: visibleColumns.length,
|
|
3201
3185
|
estimateSize: (index) => visibleColumns[index].getSize(),
|
|
@@ -3224,7 +3208,7 @@ function DataGrid({
|
|
|
3224
3208
|
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3225
3209
|
import_sortable2.SortableContext,
|
|
3226
3210
|
{
|
|
3227
|
-
items:
|
|
3211
|
+
items: sortableColumnOrder,
|
|
3228
3212
|
strategy: import_sortable2.horizontalListSortingStrategy,
|
|
3229
3213
|
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3230
3214
|
"div",
|
|
@@ -4583,6 +4567,60 @@ function CalendarPane({
|
|
|
4583
4567
|
] }, month.name + month.year);
|
|
4584
4568
|
}
|
|
4585
4569
|
|
|
4570
|
+
// src/utils/date-patch-dashes.ts
|
|
4571
|
+
function formatInputValueWithDashes(value, dateInDashes) {
|
|
4572
|
+
const digits = value.replace(/\D/g, "");
|
|
4573
|
+
if (dateInDashes) {
|
|
4574
|
+
if (digits.length <= 4) return digits;
|
|
4575
|
+
if (digits.length <= 6) return `${digits.slice(0, 4)}-${digits.slice(4)}`;
|
|
4576
|
+
return `${digits.slice(4, 6)}-${digits.slice(6, 8)}-${digits.slice(0, 4)}`;
|
|
4577
|
+
} else {
|
|
4578
|
+
if (digits.length <= 2) return digits;
|
|
4579
|
+
if (digits.length <= 4) return `${digits.slice(0, 2)}/${digits.slice(2)}`;
|
|
4580
|
+
return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
|
|
4581
|
+
}
|
|
4582
|
+
}
|
|
4583
|
+
function formatDateWithDashes(value, dateInDashes) {
|
|
4584
|
+
if (!value) return "";
|
|
4585
|
+
let year = "", month = "", day = "";
|
|
4586
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
|
4587
|
+
[year, month, day] = value.split("-");
|
|
4588
|
+
} else if (/^\d{2}-\d{2}-\d{4}$/.test(value)) {
|
|
4589
|
+
[month, day, year] = value.split("-");
|
|
4590
|
+
} else if (/^\d{2}\/\d{2}\/\d{4}$/.test(value)) {
|
|
4591
|
+
[month, day, year] = value.split("/");
|
|
4592
|
+
} else {
|
|
4593
|
+
return value;
|
|
4594
|
+
}
|
|
4595
|
+
if (!year || !month || !day) return value;
|
|
4596
|
+
if (dateInDashes) {
|
|
4597
|
+
return `${month}-${day}-${year}`;
|
|
4598
|
+
}
|
|
4599
|
+
return `${month}/${day}/${year}`;
|
|
4600
|
+
}
|
|
4601
|
+
function parseInputDateWithDashes(value, dateInDashes) {
|
|
4602
|
+
if (!value) return "";
|
|
4603
|
+
let year = "", month = "", day = "";
|
|
4604
|
+
if (dateInDashes) {
|
|
4605
|
+
let match = value.match(/^(\d{2})-(\d{2})-(\d{4})$/);
|
|
4606
|
+
if (match) {
|
|
4607
|
+
[, month, day, year] = match;
|
|
4608
|
+
} else {
|
|
4609
|
+
match = value.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
4610
|
+
if (match) {
|
|
4611
|
+
[, year, month, day] = match;
|
|
4612
|
+
}
|
|
4613
|
+
}
|
|
4614
|
+
} else {
|
|
4615
|
+
const match = value.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
|
|
4616
|
+
if (match) {
|
|
4617
|
+
[, month, day, year] = match;
|
|
4618
|
+
}
|
|
4619
|
+
}
|
|
4620
|
+
if (!year || !month || !day) return "";
|
|
4621
|
+
return `${month}-${day}-${year}`;
|
|
4622
|
+
}
|
|
4623
|
+
|
|
4586
4624
|
// src/components/DateInput.tsx
|
|
4587
4625
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4588
4626
|
var DateInput = (_a) => {
|
|
@@ -4596,7 +4634,8 @@ var DateInput = (_a) => {
|
|
|
4596
4634
|
readOnly = false,
|
|
4597
4635
|
label,
|
|
4598
4636
|
isDateAvailable,
|
|
4599
|
-
disableManualInput
|
|
4637
|
+
disableManualInput,
|
|
4638
|
+
dateInDashes = false
|
|
4600
4639
|
} = _b, props = __objRest(_b, [
|
|
4601
4640
|
"id",
|
|
4602
4641
|
"testid",
|
|
@@ -4607,7 +4646,8 @@ var DateInput = (_a) => {
|
|
|
4607
4646
|
"readOnly",
|
|
4608
4647
|
"label",
|
|
4609
4648
|
"isDateAvailable",
|
|
4610
|
-
"disableManualInput"
|
|
4649
|
+
"disableManualInput",
|
|
4650
|
+
"dateInDashes"
|
|
4611
4651
|
]);
|
|
4612
4652
|
const [visible, setVisible] = (0, import_react20.useState)(false);
|
|
4613
4653
|
const [inputValue, setInputValue] = (0, import_react20.useState)("");
|
|
@@ -4623,9 +4663,9 @@ var DateInput = (_a) => {
|
|
|
4623
4663
|
const [from, to] = [value, ""];
|
|
4624
4664
|
(0, import_react20.useEffect)(() => {
|
|
4625
4665
|
if (!isTyping) {
|
|
4626
|
-
setInputValue(formatDisplayValue(from));
|
|
4666
|
+
setInputValue(formatDisplayValue(from, dateInDashes));
|
|
4627
4667
|
}
|
|
4628
|
-
}, [from, isTyping]);
|
|
4668
|
+
}, [from, isTyping, dateInDashes]);
|
|
4629
4669
|
(0, import_react20.useLayoutEffect)(() => {
|
|
4630
4670
|
if (visible) {
|
|
4631
4671
|
updatePosition();
|
|
@@ -4688,7 +4728,7 @@ var DateInput = (_a) => {
|
|
|
4688
4728
|
const rawValue = event.target.value;
|
|
4689
4729
|
const cursorPosition = event.target.selectionStart || 0;
|
|
4690
4730
|
setIsTyping(true);
|
|
4691
|
-
const formattedValue =
|
|
4731
|
+
const formattedValue = formatInputValueWithDashes(rawValue, dateInDashes);
|
|
4692
4732
|
setInputValue(formattedValue);
|
|
4693
4733
|
requestAnimationFrame(() => {
|
|
4694
4734
|
if (triggerRef.current) {
|
|
@@ -4700,16 +4740,16 @@ var DateInput = (_a) => {
|
|
|
4700
4740
|
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
4701
4741
|
}
|
|
4702
4742
|
});
|
|
4703
|
-
const parsedDate =
|
|
4743
|
+
const parsedDate = parseInputDateWithDashes(formattedValue, dateInDashes);
|
|
4704
4744
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
4705
4745
|
onChange(parsedDate);
|
|
4706
4746
|
}
|
|
4707
4747
|
};
|
|
4708
4748
|
const handleBlur = () => {
|
|
4709
4749
|
setIsTyping(false);
|
|
4710
|
-
const parsedDate =
|
|
4750
|
+
const parsedDate = parseInputDateWithDashes(inputValue, dateInDashes);
|
|
4711
4751
|
if (!parsedDate || !isValidDate(parsedDate)) {
|
|
4712
|
-
setInputValue(formatDisplayValue(from));
|
|
4752
|
+
setInputValue(formatDisplayValue(from, dateInDashes));
|
|
4713
4753
|
}
|
|
4714
4754
|
};
|
|
4715
4755
|
const handleKeyDown = (event) => {
|
|
@@ -4717,10 +4757,11 @@ var DateInput = (_a) => {
|
|
|
4717
4757
|
const input = event.target;
|
|
4718
4758
|
const cursorPosition = input.selectionStart || 0;
|
|
4719
4759
|
const value2 = input.value;
|
|
4720
|
-
|
|
4760
|
+
const sep = dateInDashes ? "-" : "/";
|
|
4761
|
+
if (cursorPosition > 0 && value2[cursorPosition - 1] === sep) {
|
|
4721
4762
|
event.preventDefault();
|
|
4722
4763
|
const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
|
|
4723
|
-
const formattedValue =
|
|
4764
|
+
const formattedValue = formatInputValueWithDashes(newValue, dateInDashes);
|
|
4724
4765
|
setInputValue(formattedValue);
|
|
4725
4766
|
requestAnimationFrame(() => {
|
|
4726
4767
|
if (triggerRef.current) {
|
|
@@ -4733,7 +4774,7 @@ var DateInput = (_a) => {
|
|
|
4733
4774
|
}
|
|
4734
4775
|
}
|
|
4735
4776
|
if (event.key === "Enter") {
|
|
4736
|
-
const parsedDate =
|
|
4777
|
+
const parsedDate = parseInputDateWithDashes(inputValue, dateInDashes);
|
|
4737
4778
|
if (parsedDate && isValidDate(parsedDate)) {
|
|
4738
4779
|
onChange(parsedDate);
|
|
4739
4780
|
setVisible(false);
|
|
@@ -4822,14 +4863,14 @@ var DateInput = (_a) => {
|
|
|
4822
4863
|
] });
|
|
4823
4864
|
};
|
|
4824
4865
|
DateInput.displayName = "DateInput";
|
|
4825
|
-
function formatDisplayValue(from) {
|
|
4866
|
+
function formatDisplayValue(from, dateInDashes) {
|
|
4826
4867
|
if (!from) {
|
|
4827
4868
|
return "";
|
|
4828
4869
|
}
|
|
4829
4870
|
if (!isValidDate(from)) {
|
|
4830
4871
|
return "";
|
|
4831
4872
|
}
|
|
4832
|
-
return
|
|
4873
|
+
return formatDateWithDashes(from, dateInDashes);
|
|
4833
4874
|
}
|
|
4834
4875
|
|
|
4835
4876
|
// src/components/Accordion.tsx
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TableBody
|
|
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";
|