@dmsi/wedgekit-react 0.0.537 → 0.0.539
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-UV53RKAQ.js → chunk-BKBJOF4J.js} +1 -1
- package/dist/{chunk-U6W5E3XW.js → chunk-I5BV7UPG.js} +1 -1
- package/dist/{chunk-PMNNRB6S.js → chunk-NWTVBVBC.js} +44 -2
- package/dist/{chunk-UFGH5V7K.js → chunk-RB7F6QWD.js} +4 -4
- package/dist/{chunk-YHFOOBE2.js → chunk-Y3EFHKAG.js} +1 -1
- package/dist/components/CalendarRange.cjs +44 -2
- package/dist/components/CalendarRange.js +6 -6
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +44 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +6 -6
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +44 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +6 -6
- package/dist/components/DataGrid/PinnedColumns.cjs +44 -2
- package/dist/components/DataGrid/PinnedColumns.js +6 -6
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +44 -2
- package/dist/components/DataGrid/TableBody/LoadingCell.js +6 -6
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +44 -2
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +6 -6
- package/dist/components/DataGrid/TableBody/index.cjs +44 -2
- package/dist/components/DataGrid/TableBody/index.js +6 -6
- package/dist/components/DataGrid/index.cjs +44 -2
- package/dist/components/DataGrid/index.js +6 -6
- package/dist/components/DataGrid/utils.cjs +44 -2
- package/dist/components/DataGrid/utils.js +6 -6
- package/dist/components/DataGridCell.cjs +44 -2
- package/dist/components/DataGridCell.js +3 -3
- package/dist/components/DateInput.cjs +44 -2
- package/dist/components/DateInput.js +6 -6
- package/dist/components/DateRangeInput.cjs +44 -2
- package/dist/components/DateRangeInput.js +6 -6
- package/dist/components/FilterGroup.cjs +44 -2
- package/dist/components/FilterGroup.js +2 -2
- package/dist/components/Input.cjs +44 -2
- package/dist/components/Input.js +1 -1
- package/dist/components/MobileDataGrid/ColumnList.js +1 -1
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +44 -2
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +6 -6
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +1 -1
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +44 -2
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +6 -6
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +1 -1
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +1 -1
- package/dist/components/MobileDataGrid/index.cjs +44 -2
- package/dist/components/MobileDataGrid/index.js +6 -6
- package/dist/components/Password.cjs +44 -2
- package/dist/components/Password.js +1 -1
- package/dist/components/Search.cjs +44 -2
- package/dist/components/Search.js +2 -2
- package/dist/components/Select.cjs +44 -2
- package/dist/components/Select.js +2 -2
- package/dist/components/Stepper.cjs +44 -2
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Time.cjs +44 -2
- package/dist/components/Time.js +1 -1
- package/dist/components/index.cjs +44 -2
- package/dist/components/index.js +6 -6
- package/package.json +1 -1
- package/src/components/Input.tsx +62 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MobileDataGridHeader
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-RB7F6QWD.js";
|
|
4
4
|
import "../../chunk-M7INAUAJ.js";
|
|
5
5
|
import "../../chunk-ZIPJMN2E.js";
|
|
6
6
|
import "../../chunk-FJFZBIRG.js";
|
|
@@ -14,8 +14,8 @@ import "../../chunk-3X3Y4TMS.js";
|
|
|
14
14
|
import "../../chunk-4DXOA7NZ.js";
|
|
15
15
|
import "../../chunk-5BRIDIUA.js";
|
|
16
16
|
import "../../chunk-5IFPG6TS.js";
|
|
17
|
-
import "../../chunk-AJ5M6MVX.js";
|
|
18
17
|
import "../../chunk-M4FM3B3R.js";
|
|
18
|
+
import "../../chunk-AJ5M6MVX.js";
|
|
19
19
|
import "../../chunk-AT4AWD6B.js";
|
|
20
20
|
import "../../chunk-EWGHVZL5.js";
|
|
21
21
|
import "../../chunk-KJ5OQPPV.js";
|
|
@@ -23,7 +23,7 @@ import "../../chunk-L3BXRDLP.js";
|
|
|
23
23
|
import "../../chunk-34VEVX5H.js";
|
|
24
24
|
import "../../chunk-LB7UT6F3.js";
|
|
25
25
|
import "../../chunk-MDB26F6T.js";
|
|
26
|
-
import "../../chunk-
|
|
26
|
+
import "../../chunk-I5BV7UPG.js";
|
|
27
27
|
import "../../chunk-JADOJNBI.js";
|
|
28
28
|
import "../../chunk-4RJKB7LC.js";
|
|
29
29
|
import "../../chunk-WVVEOCEH.js";
|
|
@@ -33,12 +33,12 @@ import "../../chunk-AKJUBFJK.js";
|
|
|
33
33
|
import "../../chunk-Z2QAJY5I.js";
|
|
34
34
|
import "../../chunk-BWPNXY7T.js";
|
|
35
35
|
import "../../chunk-QVWYTQKL.js";
|
|
36
|
-
import "../../chunk-
|
|
36
|
+
import "../../chunk-Y3EFHKAG.js";
|
|
37
37
|
import "../../chunk-HGLOO52X.js";
|
|
38
38
|
import "../../chunk-MPYAHORM.js";
|
|
39
39
|
import "../../chunk-EZ4KZYKG.js";
|
|
40
|
-
import "../../chunk-
|
|
41
|
-
import "../../chunk-
|
|
40
|
+
import "../../chunk-BKBJOF4J.js";
|
|
41
|
+
import "../../chunk-NWTVBVBC.js";
|
|
42
42
|
import "../../chunk-HXGJVYGQ.js";
|
|
43
43
|
import "../../chunk-WVUIIBRR.js";
|
|
44
44
|
import "../../chunk-75USUR3I.js";
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
ModalContent
|
|
3
3
|
} from "../../../chunk-FJFZBIRG.js";
|
|
4
4
|
import "../../../chunk-5IFPG6TS.js";
|
|
5
|
-
import "../../../chunk-AJ5M6MVX.js";
|
|
6
5
|
import "../../../chunk-M4FM3B3R.js";
|
|
6
|
+
import "../../../chunk-AJ5M6MVX.js";
|
|
7
7
|
import "../../../chunk-VXWSAIB5.js";
|
|
8
8
|
import "../../../chunk-DQRQZE6O.js";
|
|
9
9
|
import "../../../chunk-5UH6QUFB.js";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../../../chunk-ZIPJMN2E.js";
|
|
4
4
|
import "../../../chunk-FJFZBIRG.js";
|
|
5
5
|
import "../../../chunk-5IFPG6TS.js";
|
|
6
|
-
import "../../../chunk-AJ5M6MVX.js";
|
|
7
6
|
import "../../../chunk-M4FM3B3R.js";
|
|
7
|
+
import "../../../chunk-AJ5M6MVX.js";
|
|
8
8
|
import "../../../chunk-JADOJNBI.js";
|
|
9
9
|
import "../../../chunk-4RJKB7LC.js";
|
|
10
10
|
import "../../../chunk-WVVEOCEH.js";
|
|
@@ -2294,7 +2294,7 @@ var Input = (_a) => {
|
|
|
2294
2294
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2295
2295
|
setInternalValue(formatted);
|
|
2296
2296
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2297
|
-
}, [
|
|
2297
|
+
}, []);
|
|
2298
2298
|
const getInputProps = () => {
|
|
2299
2299
|
var _a2;
|
|
2300
2300
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -2379,6 +2379,7 @@ var Input = (_a) => {
|
|
|
2379
2379
|
};
|
|
2380
2380
|
const handleChange = (e) => {
|
|
2381
2381
|
const rawValue = e.target.value;
|
|
2382
|
+
const maxNumber = props.max != null ? Number(String(props.max).replace(/,/g, "")) : void 0;
|
|
2382
2383
|
if (variant === "currency") {
|
|
2383
2384
|
const raw = rawValue.replace(/,/g, "");
|
|
2384
2385
|
if (raw === "") {
|
|
@@ -2397,9 +2398,25 @@ var Input = (_a) => {
|
|
|
2397
2398
|
const parts = raw.split(".");
|
|
2398
2399
|
const currentDecimals = decimals != null ? decimals : 2;
|
|
2399
2400
|
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
2401
|
+
const asNumber = Number(raw);
|
|
2402
|
+
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
2403
|
+
const clamped = maxNumber;
|
|
2404
|
+
const formattedClamped = formatDecimalValue(
|
|
2405
|
+
clamped.toString(),
|
|
2406
|
+
currentDecimals
|
|
2407
|
+
);
|
|
2408
|
+
setInternalValue(formattedClamped);
|
|
2409
|
+
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
2410
|
+
if (onChange) {
|
|
2411
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2412
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
2413
|
+
});
|
|
2414
|
+
onChange(syntheticEvent);
|
|
2415
|
+
}
|
|
2416
|
+
return;
|
|
2417
|
+
}
|
|
2400
2418
|
setInternalValue(raw);
|
|
2401
2419
|
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2402
|
-
const asNumber = Number(raw);
|
|
2403
2420
|
if (!isNaN(asNumber) && onChange) {
|
|
2404
2421
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2405
2422
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -2408,6 +2425,31 @@ var Input = (_a) => {
|
|
|
2408
2425
|
}
|
|
2409
2426
|
return;
|
|
2410
2427
|
}
|
|
2428
|
+
if ((variant === "percentage" || variant === "uom") && e.target.type === "number") {
|
|
2429
|
+
const numeric = Number(rawValue);
|
|
2430
|
+
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
2431
|
+
const clamped = maxNumber;
|
|
2432
|
+
const formattedClamped = formatDecimalValue(
|
|
2433
|
+
clamped.toString(),
|
|
2434
|
+
decimals != null ? decimals : 0
|
|
2435
|
+
);
|
|
2436
|
+
setInternalValue(formattedClamped);
|
|
2437
|
+
setDisplayValue(formattedClamped);
|
|
2438
|
+
if (typeof onChange === "function") {
|
|
2439
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2440
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
2441
|
+
});
|
|
2442
|
+
onChange(syntheticEvent);
|
|
2443
|
+
}
|
|
2444
|
+
return;
|
|
2445
|
+
}
|
|
2446
|
+
setInternalValue(rawValue);
|
|
2447
|
+
setDisplayValue(rawValue);
|
|
2448
|
+
if (typeof onChange === "function") {
|
|
2449
|
+
onChange(e);
|
|
2450
|
+
}
|
|
2451
|
+
return;
|
|
2452
|
+
}
|
|
2411
2453
|
setInternalValue(rawValue);
|
|
2412
2454
|
setDisplayValue(rawValue);
|
|
2413
2455
|
if (typeof onChange === "function") {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MobileDataGrid
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-RB7F6QWD.js";
|
|
4
4
|
import "../../chunk-M7INAUAJ.js";
|
|
5
5
|
import "../../chunk-ZIPJMN2E.js";
|
|
6
6
|
import "../../chunk-FJFZBIRG.js";
|
|
@@ -14,8 +14,8 @@ import "../../chunk-3X3Y4TMS.js";
|
|
|
14
14
|
import "../../chunk-4DXOA7NZ.js";
|
|
15
15
|
import "../../chunk-5BRIDIUA.js";
|
|
16
16
|
import "../../chunk-5IFPG6TS.js";
|
|
17
|
-
import "../../chunk-AJ5M6MVX.js";
|
|
18
17
|
import "../../chunk-M4FM3B3R.js";
|
|
18
|
+
import "../../chunk-AJ5M6MVX.js";
|
|
19
19
|
import "../../chunk-AT4AWD6B.js";
|
|
20
20
|
import "../../chunk-EWGHVZL5.js";
|
|
21
21
|
import "../../chunk-KJ5OQPPV.js";
|
|
@@ -23,7 +23,7 @@ import "../../chunk-L3BXRDLP.js";
|
|
|
23
23
|
import "../../chunk-34VEVX5H.js";
|
|
24
24
|
import "../../chunk-LB7UT6F3.js";
|
|
25
25
|
import "../../chunk-MDB26F6T.js";
|
|
26
|
-
import "../../chunk-
|
|
26
|
+
import "../../chunk-I5BV7UPG.js";
|
|
27
27
|
import "../../chunk-JADOJNBI.js";
|
|
28
28
|
import "../../chunk-4RJKB7LC.js";
|
|
29
29
|
import "../../chunk-WVVEOCEH.js";
|
|
@@ -33,12 +33,12 @@ import "../../chunk-AKJUBFJK.js";
|
|
|
33
33
|
import "../../chunk-Z2QAJY5I.js";
|
|
34
34
|
import "../../chunk-BWPNXY7T.js";
|
|
35
35
|
import "../../chunk-QVWYTQKL.js";
|
|
36
|
-
import "../../chunk-
|
|
36
|
+
import "../../chunk-Y3EFHKAG.js";
|
|
37
37
|
import "../../chunk-HGLOO52X.js";
|
|
38
38
|
import "../../chunk-MPYAHORM.js";
|
|
39
39
|
import "../../chunk-EZ4KZYKG.js";
|
|
40
|
-
import "../../chunk-
|
|
41
|
-
import "../../chunk-
|
|
40
|
+
import "../../chunk-BKBJOF4J.js";
|
|
41
|
+
import "../../chunk-NWTVBVBC.js";
|
|
42
42
|
import "../../chunk-HXGJVYGQ.js";
|
|
43
43
|
import "../../chunk-WVUIIBRR.js";
|
|
44
44
|
import "../../chunk-75USUR3I.js";
|
|
@@ -611,7 +611,7 @@ var Input = (_a) => {
|
|
|
611
611
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
612
612
|
setInternalValue(formatted);
|
|
613
613
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
614
|
-
}, [
|
|
614
|
+
}, []);
|
|
615
615
|
const getInputProps = () => {
|
|
616
616
|
var _a2;
|
|
617
617
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -696,6 +696,7 @@ var Input = (_a) => {
|
|
|
696
696
|
};
|
|
697
697
|
const handleChange = (e) => {
|
|
698
698
|
const rawValue = e.target.value;
|
|
699
|
+
const maxNumber = props.max != null ? Number(String(props.max).replace(/,/g, "")) : void 0;
|
|
699
700
|
if (variant === "currency") {
|
|
700
701
|
const raw = rawValue.replace(/,/g, "");
|
|
701
702
|
if (raw === "") {
|
|
@@ -714,9 +715,25 @@ var Input = (_a) => {
|
|
|
714
715
|
const parts = raw.split(".");
|
|
715
716
|
const currentDecimals = decimals != null ? decimals : 2;
|
|
716
717
|
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
718
|
+
const asNumber = Number(raw);
|
|
719
|
+
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
720
|
+
const clamped = maxNumber;
|
|
721
|
+
const formattedClamped = formatDecimalValue(
|
|
722
|
+
clamped.toString(),
|
|
723
|
+
currentDecimals
|
|
724
|
+
);
|
|
725
|
+
setInternalValue(formattedClamped);
|
|
726
|
+
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
727
|
+
if (onChange) {
|
|
728
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
729
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
730
|
+
});
|
|
731
|
+
onChange(syntheticEvent);
|
|
732
|
+
}
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
717
735
|
setInternalValue(raw);
|
|
718
736
|
setDisplayValue(formatCurrencyDisplay(raw));
|
|
719
|
-
const asNumber = Number(raw);
|
|
720
737
|
if (!isNaN(asNumber) && onChange) {
|
|
721
738
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
722
739
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -725,6 +742,31 @@ var Input = (_a) => {
|
|
|
725
742
|
}
|
|
726
743
|
return;
|
|
727
744
|
}
|
|
745
|
+
if ((variant === "percentage" || variant === "uom") && e.target.type === "number") {
|
|
746
|
+
const numeric = Number(rawValue);
|
|
747
|
+
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
748
|
+
const clamped = maxNumber;
|
|
749
|
+
const formattedClamped = formatDecimalValue(
|
|
750
|
+
clamped.toString(),
|
|
751
|
+
decimals != null ? decimals : 0
|
|
752
|
+
);
|
|
753
|
+
setInternalValue(formattedClamped);
|
|
754
|
+
setDisplayValue(formattedClamped);
|
|
755
|
+
if (typeof onChange === "function") {
|
|
756
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
757
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
758
|
+
});
|
|
759
|
+
onChange(syntheticEvent);
|
|
760
|
+
}
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
setInternalValue(rawValue);
|
|
764
|
+
setDisplayValue(rawValue);
|
|
765
|
+
if (typeof onChange === "function") {
|
|
766
|
+
onChange(e);
|
|
767
|
+
}
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
728
770
|
setInternalValue(rawValue);
|
|
729
771
|
setDisplayValue(rawValue);
|
|
730
772
|
if (typeof onChange === "function") {
|
|
@@ -611,7 +611,7 @@ var Input = (_a) => {
|
|
|
611
611
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
612
612
|
setInternalValue(formatted);
|
|
613
613
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
614
|
-
}, [
|
|
614
|
+
}, []);
|
|
615
615
|
const getInputProps = () => {
|
|
616
616
|
var _a2;
|
|
617
617
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -696,6 +696,7 @@ var Input = (_a) => {
|
|
|
696
696
|
};
|
|
697
697
|
const handleChange = (e) => {
|
|
698
698
|
const rawValue = e.target.value;
|
|
699
|
+
const maxNumber = props.max != null ? Number(String(props.max).replace(/,/g, "")) : void 0;
|
|
699
700
|
if (variant === "currency") {
|
|
700
701
|
const raw = rawValue.replace(/,/g, "");
|
|
701
702
|
if (raw === "") {
|
|
@@ -714,9 +715,25 @@ var Input = (_a) => {
|
|
|
714
715
|
const parts = raw.split(".");
|
|
715
716
|
const currentDecimals = decimals != null ? decimals : 2;
|
|
716
717
|
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
718
|
+
const asNumber = Number(raw);
|
|
719
|
+
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
720
|
+
const clamped = maxNumber;
|
|
721
|
+
const formattedClamped = formatDecimalValue(
|
|
722
|
+
clamped.toString(),
|
|
723
|
+
currentDecimals
|
|
724
|
+
);
|
|
725
|
+
setInternalValue(formattedClamped);
|
|
726
|
+
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
727
|
+
if (onChange) {
|
|
728
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
729
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
730
|
+
});
|
|
731
|
+
onChange(syntheticEvent);
|
|
732
|
+
}
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
717
735
|
setInternalValue(raw);
|
|
718
736
|
setDisplayValue(formatCurrencyDisplay(raw));
|
|
719
|
-
const asNumber = Number(raw);
|
|
720
737
|
if (!isNaN(asNumber) && onChange) {
|
|
721
738
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
722
739
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -725,6 +742,31 @@ var Input = (_a) => {
|
|
|
725
742
|
}
|
|
726
743
|
return;
|
|
727
744
|
}
|
|
745
|
+
if ((variant === "percentage" || variant === "uom") && e.target.type === "number") {
|
|
746
|
+
const numeric = Number(rawValue);
|
|
747
|
+
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
748
|
+
const clamped = maxNumber;
|
|
749
|
+
const formattedClamped = formatDecimalValue(
|
|
750
|
+
clamped.toString(),
|
|
751
|
+
decimals != null ? decimals : 0
|
|
752
|
+
);
|
|
753
|
+
setInternalValue(formattedClamped);
|
|
754
|
+
setDisplayValue(formattedClamped);
|
|
755
|
+
if (typeof onChange === "function") {
|
|
756
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
757
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
758
|
+
});
|
|
759
|
+
onChange(syntheticEvent);
|
|
760
|
+
}
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
setInternalValue(rawValue);
|
|
764
|
+
setDisplayValue(rawValue);
|
|
765
|
+
if (typeof onChange === "function") {
|
|
766
|
+
onChange(e);
|
|
767
|
+
}
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
728
770
|
setInternalValue(rawValue);
|
|
729
771
|
setDisplayValue(rawValue);
|
|
730
772
|
if (typeof onChange === "function") {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Search
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-BKBJOF4J.js";
|
|
5
|
+
import "../chunk-NWTVBVBC.js";
|
|
6
6
|
import "../chunk-HXGJVYGQ.js";
|
|
7
7
|
import "../chunk-5UH6QUFB.js";
|
|
8
8
|
import "../chunk-WMPWWFUJ.js";
|
|
@@ -611,7 +611,7 @@ var Input = (_a) => {
|
|
|
611
611
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
612
612
|
setInternalValue(formatted);
|
|
613
613
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
614
|
-
}, [
|
|
614
|
+
}, []);
|
|
615
615
|
const getInputProps = () => {
|
|
616
616
|
var _a2;
|
|
617
617
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -696,6 +696,7 @@ var Input = (_a) => {
|
|
|
696
696
|
};
|
|
697
697
|
const handleChange = (e) => {
|
|
698
698
|
const rawValue = e.target.value;
|
|
699
|
+
const maxNumber = props.max != null ? Number(String(props.max).replace(/,/g, "")) : void 0;
|
|
699
700
|
if (variant === "currency") {
|
|
700
701
|
const raw = rawValue.replace(/,/g, "");
|
|
701
702
|
if (raw === "") {
|
|
@@ -714,9 +715,25 @@ var Input = (_a) => {
|
|
|
714
715
|
const parts = raw.split(".");
|
|
715
716
|
const currentDecimals = decimals != null ? decimals : 2;
|
|
716
717
|
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
718
|
+
const asNumber = Number(raw);
|
|
719
|
+
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
720
|
+
const clamped = maxNumber;
|
|
721
|
+
const formattedClamped = formatDecimalValue(
|
|
722
|
+
clamped.toString(),
|
|
723
|
+
currentDecimals
|
|
724
|
+
);
|
|
725
|
+
setInternalValue(formattedClamped);
|
|
726
|
+
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
727
|
+
if (onChange) {
|
|
728
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
729
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
730
|
+
});
|
|
731
|
+
onChange(syntheticEvent);
|
|
732
|
+
}
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
717
735
|
setInternalValue(raw);
|
|
718
736
|
setDisplayValue(formatCurrencyDisplay(raw));
|
|
719
|
-
const asNumber = Number(raw);
|
|
720
737
|
if (!isNaN(asNumber) && onChange) {
|
|
721
738
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
722
739
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -725,6 +742,31 @@ var Input = (_a) => {
|
|
|
725
742
|
}
|
|
726
743
|
return;
|
|
727
744
|
}
|
|
745
|
+
if ((variant === "percentage" || variant === "uom") && e.target.type === "number") {
|
|
746
|
+
const numeric = Number(rawValue);
|
|
747
|
+
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
748
|
+
const clamped = maxNumber;
|
|
749
|
+
const formattedClamped = formatDecimalValue(
|
|
750
|
+
clamped.toString(),
|
|
751
|
+
decimals != null ? decimals : 0
|
|
752
|
+
);
|
|
753
|
+
setInternalValue(formattedClamped);
|
|
754
|
+
setDisplayValue(formattedClamped);
|
|
755
|
+
if (typeof onChange === "function") {
|
|
756
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
757
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
758
|
+
});
|
|
759
|
+
onChange(syntheticEvent);
|
|
760
|
+
}
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
setInternalValue(rawValue);
|
|
764
|
+
setDisplayValue(rawValue);
|
|
765
|
+
if (typeof onChange === "function") {
|
|
766
|
+
onChange(e);
|
|
767
|
+
}
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
728
770
|
setInternalValue(rawValue);
|
|
729
771
|
setDisplayValue(rawValue);
|
|
730
772
|
if (typeof onChange === "function") {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Select
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-I5BV7UPG.js";
|
|
5
|
+
import "../chunk-NWTVBVBC.js";
|
|
6
6
|
import "../chunk-HXGJVYGQ.js";
|
|
7
7
|
import "../chunk-5UH6QUFB.js";
|
|
8
8
|
import "../chunk-WMPWWFUJ.js";
|
|
@@ -751,7 +751,7 @@ var Input = (_a) => {
|
|
|
751
751
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
752
752
|
setInternalValue(formatted);
|
|
753
753
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
754
|
-
}, [
|
|
754
|
+
}, []);
|
|
755
755
|
const getInputProps = () => {
|
|
756
756
|
var _a2;
|
|
757
757
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -836,6 +836,7 @@ var Input = (_a) => {
|
|
|
836
836
|
};
|
|
837
837
|
const handleChange = (e) => {
|
|
838
838
|
const rawValue = e.target.value;
|
|
839
|
+
const maxNumber = props.max != null ? Number(String(props.max).replace(/,/g, "")) : void 0;
|
|
839
840
|
if (variant === "currency") {
|
|
840
841
|
const raw = rawValue.replace(/,/g, "");
|
|
841
842
|
if (raw === "") {
|
|
@@ -854,9 +855,25 @@ var Input = (_a) => {
|
|
|
854
855
|
const parts = raw.split(".");
|
|
855
856
|
const currentDecimals = decimals != null ? decimals : 2;
|
|
856
857
|
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
858
|
+
const asNumber = Number(raw);
|
|
859
|
+
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
860
|
+
const clamped = maxNumber;
|
|
861
|
+
const formattedClamped = formatDecimalValue(
|
|
862
|
+
clamped.toString(),
|
|
863
|
+
currentDecimals
|
|
864
|
+
);
|
|
865
|
+
setInternalValue(formattedClamped);
|
|
866
|
+
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
867
|
+
if (onChange) {
|
|
868
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
869
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
870
|
+
});
|
|
871
|
+
onChange(syntheticEvent);
|
|
872
|
+
}
|
|
873
|
+
return;
|
|
874
|
+
}
|
|
857
875
|
setInternalValue(raw);
|
|
858
876
|
setDisplayValue(formatCurrencyDisplay(raw));
|
|
859
|
-
const asNumber = Number(raw);
|
|
860
877
|
if (!isNaN(asNumber) && onChange) {
|
|
861
878
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
862
879
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -865,6 +882,31 @@ var Input = (_a) => {
|
|
|
865
882
|
}
|
|
866
883
|
return;
|
|
867
884
|
}
|
|
885
|
+
if ((variant === "percentage" || variant === "uom") && e.target.type === "number") {
|
|
886
|
+
const numeric = Number(rawValue);
|
|
887
|
+
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
888
|
+
const clamped = maxNumber;
|
|
889
|
+
const formattedClamped = formatDecimalValue(
|
|
890
|
+
clamped.toString(),
|
|
891
|
+
decimals != null ? decimals : 0
|
|
892
|
+
);
|
|
893
|
+
setInternalValue(formattedClamped);
|
|
894
|
+
setDisplayValue(formattedClamped);
|
|
895
|
+
if (typeof onChange === "function") {
|
|
896
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
897
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
898
|
+
});
|
|
899
|
+
onChange(syntheticEvent);
|
|
900
|
+
}
|
|
901
|
+
return;
|
|
902
|
+
}
|
|
903
|
+
setInternalValue(rawValue);
|
|
904
|
+
setDisplayValue(rawValue);
|
|
905
|
+
if (typeof onChange === "function") {
|
|
906
|
+
onChange(e);
|
|
907
|
+
}
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
868
910
|
setInternalValue(rawValue);
|
|
869
911
|
setDisplayValue(rawValue);
|
|
870
912
|
if (typeof onChange === "function") {
|
package/dist/components/Time.cjs
CHANGED
|
@@ -610,7 +610,7 @@ var Input = (_a) => {
|
|
|
610
610
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
611
611
|
setInternalValue(formatted);
|
|
612
612
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
613
|
-
}, [
|
|
613
|
+
}, []);
|
|
614
614
|
const getInputProps = () => {
|
|
615
615
|
var _a2;
|
|
616
616
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -695,6 +695,7 @@ var Input = (_a) => {
|
|
|
695
695
|
};
|
|
696
696
|
const handleChange = (e) => {
|
|
697
697
|
const rawValue = e.target.value;
|
|
698
|
+
const maxNumber = props.max != null ? Number(String(props.max).replace(/,/g, "")) : void 0;
|
|
698
699
|
if (variant === "currency") {
|
|
699
700
|
const raw = rawValue.replace(/,/g, "");
|
|
700
701
|
if (raw === "") {
|
|
@@ -713,9 +714,25 @@ var Input = (_a) => {
|
|
|
713
714
|
const parts = raw.split(".");
|
|
714
715
|
const currentDecimals = decimals != null ? decimals : 2;
|
|
715
716
|
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
717
|
+
const asNumber = Number(raw);
|
|
718
|
+
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
719
|
+
const clamped = maxNumber;
|
|
720
|
+
const formattedClamped = formatDecimalValue(
|
|
721
|
+
clamped.toString(),
|
|
722
|
+
currentDecimals
|
|
723
|
+
);
|
|
724
|
+
setInternalValue(formattedClamped);
|
|
725
|
+
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
726
|
+
if (onChange) {
|
|
727
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
728
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
729
|
+
});
|
|
730
|
+
onChange(syntheticEvent);
|
|
731
|
+
}
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
716
734
|
setInternalValue(raw);
|
|
717
735
|
setDisplayValue(formatCurrencyDisplay(raw));
|
|
718
|
-
const asNumber = Number(raw);
|
|
719
736
|
if (!isNaN(asNumber) && onChange) {
|
|
720
737
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
721
738
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -724,6 +741,31 @@ var Input = (_a) => {
|
|
|
724
741
|
}
|
|
725
742
|
return;
|
|
726
743
|
}
|
|
744
|
+
if ((variant === "percentage" || variant === "uom") && e.target.type === "number") {
|
|
745
|
+
const numeric = Number(rawValue);
|
|
746
|
+
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
747
|
+
const clamped = maxNumber;
|
|
748
|
+
const formattedClamped = formatDecimalValue(
|
|
749
|
+
clamped.toString(),
|
|
750
|
+
decimals != null ? decimals : 0
|
|
751
|
+
);
|
|
752
|
+
setInternalValue(formattedClamped);
|
|
753
|
+
setDisplayValue(formattedClamped);
|
|
754
|
+
if (typeof onChange === "function") {
|
|
755
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
756
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
757
|
+
});
|
|
758
|
+
onChange(syntheticEvent);
|
|
759
|
+
}
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
762
|
+
setInternalValue(rawValue);
|
|
763
|
+
setDisplayValue(rawValue);
|
|
764
|
+
if (typeof onChange === "function") {
|
|
765
|
+
onChange(e);
|
|
766
|
+
}
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
727
769
|
setInternalValue(rawValue);
|
|
728
770
|
setDisplayValue(rawValue);
|
|
729
771
|
if (typeof onChange === "function") {
|