@dmsi/wedgekit-react 0.0.1247 → 0.0.1249
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-MOBFZ672.js → chunk-3DJWSTPS.js} +1 -1
- package/dist/{chunk-EA6Y4HXQ.js → chunk-4FUZDLWX.js} +1 -1
- package/dist/{chunk-PABII472.js → chunk-H5SHC4XZ.js} +40 -33
- package/dist/{chunk-PBJ2MEHM.js → chunk-QW4AJ5FK.js} +1 -1
- package/dist/{chunk-5UPADXVU.js → chunk-WSZ3ET5G.js} +4 -4
- package/dist/components/CalendarRange.cjs +40 -33
- package/dist/components/CalendarRange.js +5 -5
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +40 -33
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +5 -5
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +40 -33
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +5 -5
- package/dist/components/DataGrid/PinnedColumns.cjs +40 -33
- package/dist/components/DataGrid/PinnedColumns.js +5 -5
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +40 -33
- package/dist/components/DataGrid/TableBody/LoadingCell.js +5 -5
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +40 -33
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +5 -5
- package/dist/components/DataGrid/TableBody/index.cjs +40 -33
- package/dist/components/DataGrid/TableBody/index.js +5 -5
- package/dist/components/DataGrid/index.cjs +40 -33
- package/dist/components/DataGrid/index.js +5 -5
- package/dist/components/DataGrid/utils.cjs +40 -33
- package/dist/components/DataGrid/utils.js +5 -5
- package/dist/components/DataGridCell.cjs +40 -33
- package/dist/components/DataGridCell.js +3 -3
- package/dist/components/DateInput.cjs +40 -33
- package/dist/components/DateInput.js +5 -5
- package/dist/components/DateRangeInput.cjs +40 -33
- package/dist/components/DateRangeInput.js +5 -5
- package/dist/components/FilterGroup.cjs +40 -33
- package/dist/components/FilterGroup.js +2 -2
- package/dist/components/Input.cjs +40 -33
- package/dist/components/Input.js +1 -1
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +40 -33
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +5 -5
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +40 -33
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +5 -5
- package/dist/components/MobileDataGrid/index.cjs +40 -33
- package/dist/components/MobileDataGrid/index.js +5 -5
- package/dist/components/Password.cjs +40 -33
- package/dist/components/Password.js +1 -1
- package/dist/components/Search.cjs +40 -33
- package/dist/components/Search.js +2 -2
- package/dist/components/Select.cjs +40 -33
- package/dist/components/Select.js +2 -2
- package/dist/components/Stepper.cjs +40 -33
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Time.cjs +40 -33
- package/dist/components/Time.js +1 -1
- package/dist/components/index.cjs +40 -33
- package/dist/components/index.js +5 -5
- package/package.json +1 -1
package/dist/components/Time.cjs
CHANGED
|
@@ -375,6 +375,14 @@ Paragraph.displayName = "Paragraph";
|
|
|
375
375
|
|
|
376
376
|
// src/components/Input.tsx
|
|
377
377
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
378
|
+
function hasEquivalentNumericValue(currentValue, nextValue) {
|
|
379
|
+
if (!currentValue || !nextValue) {
|
|
380
|
+
return false;
|
|
381
|
+
}
|
|
382
|
+
const currentNumericValue = Number(currentValue.replace(/,/g, ""));
|
|
383
|
+
const nextNumericValue = Number(nextValue.replace(/,/g, ""));
|
|
384
|
+
return !Number.isNaN(currentNumericValue) && !Number.isNaN(nextNumericValue) && currentNumericValue === nextNumericValue;
|
|
385
|
+
}
|
|
378
386
|
var InputBase = (_a) => {
|
|
379
387
|
var _b = _a, {
|
|
380
388
|
id,
|
|
@@ -597,28 +605,33 @@ var Input = (_a) => {
|
|
|
597
605
|
const [internalValue, setInternalValue] = (0, import_react.useState)("");
|
|
598
606
|
const [displayValue, setDisplayValue] = (0, import_react.useState)("");
|
|
599
607
|
const [isFocused, setIsFocused] = (0, import_react.useState)(false);
|
|
608
|
+
const internalValueRef = (0, import_react.useRef)("");
|
|
609
|
+
const setInputValues = (nextInternalValue, nextDisplayValue) => {
|
|
610
|
+
internalValueRef.current = nextInternalValue;
|
|
611
|
+
setInternalValue(nextInternalValue);
|
|
612
|
+
setDisplayValue(nextDisplayValue);
|
|
613
|
+
};
|
|
600
614
|
(0, import_react.useEffect)(() => {
|
|
601
615
|
var _a2;
|
|
602
616
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
603
617
|
const shouldUseThousandsFormatting = variant === "currency" || variant === "uom" && currencyFormat;
|
|
604
618
|
if (!stringValue) {
|
|
605
|
-
|
|
606
|
-
setDisplayValue("");
|
|
619
|
+
setInputValues("", "");
|
|
607
620
|
return;
|
|
608
621
|
}
|
|
609
622
|
if (!shouldUseThousandsFormatting) {
|
|
610
|
-
|
|
611
|
-
|
|
623
|
+
setInputValues(stringValue, stringValue);
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
if (isFocused && hasEquivalentNumericValue(internalValueRef.current, stringValue)) {
|
|
612
627
|
return;
|
|
613
628
|
}
|
|
614
|
-
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
615
629
|
if (formatOnBlur && isFocused) {
|
|
616
|
-
|
|
617
|
-
setDisplayValue(stringValue);
|
|
630
|
+
setInputValues(stringValue, stringValue);
|
|
618
631
|
return;
|
|
619
632
|
}
|
|
620
|
-
|
|
621
|
-
|
|
633
|
+
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
634
|
+
setInputValues(formatted, formatCurrencyDisplay(formatted));
|
|
622
635
|
}, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
|
|
623
636
|
const getInputProps = () => {
|
|
624
637
|
var _a2;
|
|
@@ -640,6 +653,7 @@ var Input = (_a) => {
|
|
|
640
653
|
return __spreadProps(__spreadValues({}, baseProps), {
|
|
641
654
|
align: "right",
|
|
642
655
|
type: "text",
|
|
656
|
+
inputMode: "decimal",
|
|
643
657
|
value: displayValue
|
|
644
658
|
});
|
|
645
659
|
case "percentage":
|
|
@@ -647,6 +661,7 @@ var Input = (_a) => {
|
|
|
647
661
|
return __spreadProps(__spreadValues({}, baseProps), {
|
|
648
662
|
type: currencyFormat ? "text" : "number",
|
|
649
663
|
align: "right",
|
|
664
|
+
inputMode: currencyFormat ? "decimal" : void 0,
|
|
650
665
|
value: currencyFormat ? displayValue : propValue
|
|
651
666
|
});
|
|
652
667
|
default:
|
|
@@ -693,8 +708,7 @@ var Input = (_a) => {
|
|
|
693
708
|
}
|
|
694
709
|
};
|
|
695
710
|
const handleSearchReset = () => {
|
|
696
|
-
|
|
697
|
-
setDisplayValue("");
|
|
711
|
+
setInputValues("", "");
|
|
698
712
|
if (onChange) {
|
|
699
713
|
const syntheticEvent = {
|
|
700
714
|
target: { value: "" }
|
|
@@ -711,8 +725,7 @@ var Input = (_a) => {
|
|
|
711
725
|
if (variant === "currency") {
|
|
712
726
|
const raw = rawValue.replace(/,/g, "");
|
|
713
727
|
if (raw === "") {
|
|
714
|
-
|
|
715
|
-
setDisplayValue("");
|
|
728
|
+
setInputValues("", "");
|
|
716
729
|
if (onChange) {
|
|
717
730
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
718
731
|
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
@@ -733,8 +746,8 @@ var Input = (_a) => {
|
|
|
733
746
|
clamped.toString(),
|
|
734
747
|
currentDecimals
|
|
735
748
|
);
|
|
736
|
-
|
|
737
|
-
|
|
749
|
+
setInputValues(
|
|
750
|
+
formattedClamped,
|
|
738
751
|
formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
|
|
739
752
|
);
|
|
740
753
|
if (onChange) {
|
|
@@ -745,8 +758,7 @@ var Input = (_a) => {
|
|
|
745
758
|
}
|
|
746
759
|
return;
|
|
747
760
|
}
|
|
748
|
-
|
|
749
|
-
setDisplayValue(formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
761
|
+
setInputValues(raw, formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
750
762
|
if (!isNaN(asNumber) && onChange) {
|
|
751
763
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
752
764
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -758,8 +770,7 @@ var Input = (_a) => {
|
|
|
758
770
|
if (variant === "uom" && currencyFormat) {
|
|
759
771
|
const raw = rawValue.replace(/,/g, "");
|
|
760
772
|
if (raw === "") {
|
|
761
|
-
|
|
762
|
-
setDisplayValue("");
|
|
773
|
+
setInputValues("", "");
|
|
763
774
|
if (onChange) {
|
|
764
775
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
765
776
|
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
@@ -780,8 +791,10 @@ var Input = (_a) => {
|
|
|
780
791
|
clamped.toString(),
|
|
781
792
|
currentDecimals
|
|
782
793
|
);
|
|
783
|
-
|
|
784
|
-
|
|
794
|
+
setInputValues(
|
|
795
|
+
formattedClamped,
|
|
796
|
+
formatCurrencyDisplay(formattedClamped)
|
|
797
|
+
);
|
|
785
798
|
if (onChange) {
|
|
786
799
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
787
800
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -790,8 +803,7 @@ var Input = (_a) => {
|
|
|
790
803
|
}
|
|
791
804
|
return;
|
|
792
805
|
}
|
|
793
|
-
|
|
794
|
-
setDisplayValue(formatCurrencyDisplay(raw));
|
|
806
|
+
setInputValues(raw, formatCurrencyDisplay(raw));
|
|
795
807
|
if (!isNaN(asNumber) && onChange) {
|
|
796
808
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
797
809
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -808,8 +820,7 @@ var Input = (_a) => {
|
|
|
808
820
|
clamped.toString(),
|
|
809
821
|
decimals != null ? decimals : 0
|
|
810
822
|
);
|
|
811
|
-
|
|
812
|
-
setDisplayValue(formattedClamped);
|
|
823
|
+
setInputValues(formattedClamped, formattedClamped);
|
|
813
824
|
if (typeof onChange === "function") {
|
|
814
825
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
815
826
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -818,15 +829,13 @@ var Input = (_a) => {
|
|
|
818
829
|
}
|
|
819
830
|
return;
|
|
820
831
|
}
|
|
821
|
-
|
|
822
|
-
setDisplayValue(rawValue);
|
|
832
|
+
setInputValues(rawValue, rawValue);
|
|
823
833
|
if (typeof onChange === "function") {
|
|
824
834
|
onChange(e);
|
|
825
835
|
}
|
|
826
836
|
return;
|
|
827
837
|
}
|
|
828
|
-
|
|
829
|
-
setDisplayValue(rawValue);
|
|
838
|
+
setInputValues(rawValue, rawValue);
|
|
830
839
|
if (typeof onChange === "function") {
|
|
831
840
|
onChange(e);
|
|
832
841
|
}
|
|
@@ -839,8 +848,7 @@ var Input = (_a) => {
|
|
|
839
848
|
}
|
|
840
849
|
if (variant === "currency") {
|
|
841
850
|
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
842
|
-
|
|
843
|
-
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
851
|
+
setInputValues(formatted, formatCurrencyDisplay(formatted));
|
|
844
852
|
const asNumber = Number(formatted);
|
|
845
853
|
if (!isNaN(asNumber) && onChange) {
|
|
846
854
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
@@ -851,8 +859,7 @@ var Input = (_a) => {
|
|
|
851
859
|
} else if (variant === "uom") {
|
|
852
860
|
if (currencyFormat) {
|
|
853
861
|
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
854
|
-
|
|
855
|
-
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
862
|
+
setInputValues(formatted, formatCurrencyDisplay(formatted));
|
|
856
863
|
const asNumber = Number(formatted);
|
|
857
864
|
if (!isNaN(asNumber) && onChange) {
|
|
858
865
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
package/dist/components/Time.js
CHANGED
|
@@ -1945,6 +1945,14 @@ var import_react11 = require("react");
|
|
|
1945
1945
|
var import_react10 = require("react");
|
|
1946
1946
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1947
1947
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1948
|
+
function hasEquivalentNumericValue(currentValue, nextValue) {
|
|
1949
|
+
if (!currentValue || !nextValue) {
|
|
1950
|
+
return false;
|
|
1951
|
+
}
|
|
1952
|
+
const currentNumericValue = Number(currentValue.replace(/,/g, ""));
|
|
1953
|
+
const nextNumericValue = Number(nextValue.replace(/,/g, ""));
|
|
1954
|
+
return !Number.isNaN(currentNumericValue) && !Number.isNaN(nextNumericValue) && currentNumericValue === nextNumericValue;
|
|
1955
|
+
}
|
|
1948
1956
|
var InputBase = (_a) => {
|
|
1949
1957
|
var _b = _a, {
|
|
1950
1958
|
id,
|
|
@@ -2167,28 +2175,33 @@ var Input = (_a) => {
|
|
|
2167
2175
|
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
2168
2176
|
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
2169
2177
|
const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
|
|
2178
|
+
const internalValueRef = (0, import_react10.useRef)("");
|
|
2179
|
+
const setInputValues = (nextInternalValue, nextDisplayValue) => {
|
|
2180
|
+
internalValueRef.current = nextInternalValue;
|
|
2181
|
+
setInternalValue(nextInternalValue);
|
|
2182
|
+
setDisplayValue(nextDisplayValue);
|
|
2183
|
+
};
|
|
2170
2184
|
(0, import_react10.useEffect)(() => {
|
|
2171
2185
|
var _a2;
|
|
2172
2186
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
2173
2187
|
const shouldUseThousandsFormatting = variant === "currency" || variant === "uom" && currencyFormat;
|
|
2174
2188
|
if (!stringValue) {
|
|
2175
|
-
|
|
2176
|
-
setDisplayValue("");
|
|
2189
|
+
setInputValues("", "");
|
|
2177
2190
|
return;
|
|
2178
2191
|
}
|
|
2179
2192
|
if (!shouldUseThousandsFormatting) {
|
|
2180
|
-
|
|
2181
|
-
|
|
2193
|
+
setInputValues(stringValue, stringValue);
|
|
2194
|
+
return;
|
|
2195
|
+
}
|
|
2196
|
+
if (isFocused && hasEquivalentNumericValue(internalValueRef.current, stringValue)) {
|
|
2182
2197
|
return;
|
|
2183
2198
|
}
|
|
2184
|
-
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2185
2199
|
if (formatOnBlur && isFocused) {
|
|
2186
|
-
|
|
2187
|
-
setDisplayValue(stringValue);
|
|
2200
|
+
setInputValues(stringValue, stringValue);
|
|
2188
2201
|
return;
|
|
2189
2202
|
}
|
|
2190
|
-
|
|
2191
|
-
|
|
2203
|
+
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2204
|
+
setInputValues(formatted, formatCurrencyDisplay(formatted));
|
|
2192
2205
|
}, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
|
|
2193
2206
|
const getInputProps = () => {
|
|
2194
2207
|
var _a2;
|
|
@@ -2210,6 +2223,7 @@ var Input = (_a) => {
|
|
|
2210
2223
|
return __spreadProps(__spreadValues({}, baseProps), {
|
|
2211
2224
|
align: "right",
|
|
2212
2225
|
type: "text",
|
|
2226
|
+
inputMode: "decimal",
|
|
2213
2227
|
value: displayValue
|
|
2214
2228
|
});
|
|
2215
2229
|
case "percentage":
|
|
@@ -2217,6 +2231,7 @@ var Input = (_a) => {
|
|
|
2217
2231
|
return __spreadProps(__spreadValues({}, baseProps), {
|
|
2218
2232
|
type: currencyFormat ? "text" : "number",
|
|
2219
2233
|
align: "right",
|
|
2234
|
+
inputMode: currencyFormat ? "decimal" : void 0,
|
|
2220
2235
|
value: currencyFormat ? displayValue : propValue
|
|
2221
2236
|
});
|
|
2222
2237
|
default:
|
|
@@ -2263,8 +2278,7 @@ var Input = (_a) => {
|
|
|
2263
2278
|
}
|
|
2264
2279
|
};
|
|
2265
2280
|
const handleSearchReset = () => {
|
|
2266
|
-
|
|
2267
|
-
setDisplayValue("");
|
|
2281
|
+
setInputValues("", "");
|
|
2268
2282
|
if (onChange) {
|
|
2269
2283
|
const syntheticEvent = {
|
|
2270
2284
|
target: { value: "" }
|
|
@@ -2281,8 +2295,7 @@ var Input = (_a) => {
|
|
|
2281
2295
|
if (variant === "currency") {
|
|
2282
2296
|
const raw = rawValue.replace(/,/g, "");
|
|
2283
2297
|
if (raw === "") {
|
|
2284
|
-
|
|
2285
|
-
setDisplayValue("");
|
|
2298
|
+
setInputValues("", "");
|
|
2286
2299
|
if (onChange) {
|
|
2287
2300
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2288
2301
|
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
@@ -2303,8 +2316,8 @@ var Input = (_a) => {
|
|
|
2303
2316
|
clamped.toString(),
|
|
2304
2317
|
currentDecimals
|
|
2305
2318
|
);
|
|
2306
|
-
|
|
2307
|
-
|
|
2319
|
+
setInputValues(
|
|
2320
|
+
formattedClamped,
|
|
2308
2321
|
formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
|
|
2309
2322
|
);
|
|
2310
2323
|
if (onChange) {
|
|
@@ -2315,8 +2328,7 @@ var Input = (_a) => {
|
|
|
2315
2328
|
}
|
|
2316
2329
|
return;
|
|
2317
2330
|
}
|
|
2318
|
-
|
|
2319
|
-
setDisplayValue(formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
2331
|
+
setInputValues(raw, formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
2320
2332
|
if (!isNaN(asNumber) && onChange) {
|
|
2321
2333
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2322
2334
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -2328,8 +2340,7 @@ var Input = (_a) => {
|
|
|
2328
2340
|
if (variant === "uom" && currencyFormat) {
|
|
2329
2341
|
const raw = rawValue.replace(/,/g, "");
|
|
2330
2342
|
if (raw === "") {
|
|
2331
|
-
|
|
2332
|
-
setDisplayValue("");
|
|
2343
|
+
setInputValues("", "");
|
|
2333
2344
|
if (onChange) {
|
|
2334
2345
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2335
2346
|
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
@@ -2350,8 +2361,10 @@ var Input = (_a) => {
|
|
|
2350
2361
|
clamped.toString(),
|
|
2351
2362
|
currentDecimals
|
|
2352
2363
|
);
|
|
2353
|
-
|
|
2354
|
-
|
|
2364
|
+
setInputValues(
|
|
2365
|
+
formattedClamped,
|
|
2366
|
+
formatCurrencyDisplay(formattedClamped)
|
|
2367
|
+
);
|
|
2355
2368
|
if (onChange) {
|
|
2356
2369
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2357
2370
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -2360,8 +2373,7 @@ var Input = (_a) => {
|
|
|
2360
2373
|
}
|
|
2361
2374
|
return;
|
|
2362
2375
|
}
|
|
2363
|
-
|
|
2364
|
-
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2376
|
+
setInputValues(raw, formatCurrencyDisplay(raw));
|
|
2365
2377
|
if (!isNaN(asNumber) && onChange) {
|
|
2366
2378
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2367
2379
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -2378,8 +2390,7 @@ var Input = (_a) => {
|
|
|
2378
2390
|
clamped.toString(),
|
|
2379
2391
|
decimals != null ? decimals : 0
|
|
2380
2392
|
);
|
|
2381
|
-
|
|
2382
|
-
setDisplayValue(formattedClamped);
|
|
2393
|
+
setInputValues(formattedClamped, formattedClamped);
|
|
2383
2394
|
if (typeof onChange === "function") {
|
|
2384
2395
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2385
2396
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -2388,15 +2399,13 @@ var Input = (_a) => {
|
|
|
2388
2399
|
}
|
|
2389
2400
|
return;
|
|
2390
2401
|
}
|
|
2391
|
-
|
|
2392
|
-
setDisplayValue(rawValue);
|
|
2402
|
+
setInputValues(rawValue, rawValue);
|
|
2393
2403
|
if (typeof onChange === "function") {
|
|
2394
2404
|
onChange(e);
|
|
2395
2405
|
}
|
|
2396
2406
|
return;
|
|
2397
2407
|
}
|
|
2398
|
-
|
|
2399
|
-
setDisplayValue(rawValue);
|
|
2408
|
+
setInputValues(rawValue, rawValue);
|
|
2400
2409
|
if (typeof onChange === "function") {
|
|
2401
2410
|
onChange(e);
|
|
2402
2411
|
}
|
|
@@ -2409,8 +2418,7 @@ var Input = (_a) => {
|
|
|
2409
2418
|
}
|
|
2410
2419
|
if (variant === "currency") {
|
|
2411
2420
|
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
2412
|
-
|
|
2413
|
-
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2421
|
+
setInputValues(formatted, formatCurrencyDisplay(formatted));
|
|
2414
2422
|
const asNumber = Number(formatted);
|
|
2415
2423
|
if (!isNaN(asNumber) && onChange) {
|
|
2416
2424
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
@@ -2421,8 +2429,7 @@ var Input = (_a) => {
|
|
|
2421
2429
|
} else if (variant === "uom") {
|
|
2422
2430
|
if (currencyFormat) {
|
|
2423
2431
|
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
2424
|
-
|
|
2425
|
-
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2432
|
+
setInputValues(formatted, formatCurrencyDisplay(formatted));
|
|
2426
2433
|
const asNumber = Number(formatted);
|
|
2427
2434
|
if (!isNaN(asNumber) && onChange) {
|
|
2428
2435
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
package/dist/components/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DataGrid,
|
|
3
3
|
DateInput,
|
|
4
4
|
MobileDataGrid
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-WSZ3ET5G.js";
|
|
6
6
|
import "../chunk-3UPUZBP5.js";
|
|
7
7
|
import "../chunk-7ZJIGTFN.js";
|
|
8
8
|
import "../chunk-E3FOCECQ.js";
|
|
@@ -33,7 +33,7 @@ import "../chunk-EWGHVZL5.js";
|
|
|
33
33
|
import "../chunk-AT4AWD6B.js";
|
|
34
34
|
import {
|
|
35
35
|
Select
|
|
36
|
-
} from "../chunk-
|
|
36
|
+
} from "../chunk-4FUZDLWX.js";
|
|
37
37
|
import {
|
|
38
38
|
SimpleTable
|
|
39
39
|
} from "../chunk-CIYLALYO.js";
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
DataGridCell,
|
|
72
72
|
DragAlongCell,
|
|
73
73
|
DraggableCellHeader
|
|
74
|
-
} from "../chunk-
|
|
74
|
+
} from "../chunk-QW4AJ5FK.js";
|
|
75
75
|
import {
|
|
76
76
|
MenuOption
|
|
77
77
|
} from "../chunk-3JUIYULW.js";
|
|
@@ -81,10 +81,10 @@ import {
|
|
|
81
81
|
import "../chunk-PE3EZP56.js";
|
|
82
82
|
import {
|
|
83
83
|
Search
|
|
84
|
-
} from "../chunk-
|
|
84
|
+
} from "../chunk-3DJWSTPS.js";
|
|
85
85
|
import {
|
|
86
86
|
Input
|
|
87
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-H5SHC4XZ.js";
|
|
88
88
|
import {
|
|
89
89
|
Label
|
|
90
90
|
} from "../chunk-4UGMSWWA.js";
|