@dmsi/wedgekit-react 0.0.1080 → 0.0.1081
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-FD2FKB5M.js → chunk-FDQBM3O4.js} +4 -4
- package/dist/{chunk-NEMOTB6U.js → chunk-KZPIH2K5.js} +20 -3
- package/dist/{chunk-IEKZBWVL.js → chunk-SISDU5GI.js} +1 -1
- package/dist/{chunk-72WLEGGU.js → chunk-TINCHPB4.js} +1 -1
- package/dist/{chunk-RMKITIDU.js → chunk-Y2N7A2PP.js} +1 -1
- package/dist/components/CalendarRange.cjs +20 -3
- package/dist/components/CalendarRange.js +5 -5
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +20 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +5 -5
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +20 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +5 -5
- package/dist/components/DataGrid/PinnedColumns.cjs +20 -3
- package/dist/components/DataGrid/PinnedColumns.js +5 -5
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +20 -3
- package/dist/components/DataGrid/TableBody/LoadingCell.js +5 -5
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +20 -3
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +5 -5
- package/dist/components/DataGrid/TableBody/index.cjs +20 -3
- package/dist/components/DataGrid/TableBody/index.js +5 -5
- package/dist/components/DataGrid/index.cjs +20 -3
- package/dist/components/DataGrid/index.js +5 -5
- package/dist/components/DataGrid/utils.cjs +20 -3
- package/dist/components/DataGrid/utils.js +5 -5
- package/dist/components/DataGridCell.cjs +20 -3
- package/dist/components/DataGridCell.js +3 -3
- package/dist/components/DateInput.cjs +20 -3
- package/dist/components/DateInput.js +5 -5
- package/dist/components/DateRangeInput.cjs +20 -3
- package/dist/components/DateRangeInput.js +5 -5
- package/dist/components/FilterGroup.cjs +20 -3
- package/dist/components/FilterGroup.js +2 -2
- package/dist/components/Input.cjs +20 -3
- package/dist/components/Input.js +1 -1
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +20 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +5 -5
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +20 -3
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +5 -5
- package/dist/components/MobileDataGrid/index.cjs +20 -3
- package/dist/components/MobileDataGrid/index.js +5 -5
- package/dist/components/Password.cjs +20 -3
- package/dist/components/Password.js +1 -1
- package/dist/components/Search.cjs +20 -3
- package/dist/components/Search.js +2 -2
- package/dist/components/Select.cjs +20 -3
- package/dist/components/Select.js +2 -2
- package/dist/components/Stepper.cjs +20 -3
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Time.cjs +20 -3
- package/dist/components/Time.js +1 -1
- package/dist/components/index.cjs +20 -3
- package/dist/components/index.js +5 -5
- package/package.json +1 -1
|
@@ -2105,6 +2105,7 @@ var Input = (_a) => {
|
|
|
2105
2105
|
decimals,
|
|
2106
2106
|
uom,
|
|
2107
2107
|
currencyFormat = false,
|
|
2108
|
+
formatOnBlur = false,
|
|
2108
2109
|
removeSearchIcon,
|
|
2109
2110
|
value: propValue,
|
|
2110
2111
|
onChange,
|
|
@@ -2118,6 +2119,7 @@ var Input = (_a) => {
|
|
|
2118
2119
|
"decimals",
|
|
2119
2120
|
"uom",
|
|
2120
2121
|
"currencyFormat",
|
|
2122
|
+
"formatOnBlur",
|
|
2121
2123
|
"removeSearchIcon",
|
|
2122
2124
|
"value",
|
|
2123
2125
|
"onChange",
|
|
@@ -2129,6 +2131,7 @@ var Input = (_a) => {
|
|
|
2129
2131
|
]);
|
|
2130
2132
|
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
2131
2133
|
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
2134
|
+
const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
|
|
2132
2135
|
(0, import_react10.useEffect)(() => {
|
|
2133
2136
|
var _a2;
|
|
2134
2137
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
@@ -2144,9 +2147,14 @@ var Input = (_a) => {
|
|
|
2144
2147
|
return;
|
|
2145
2148
|
}
|
|
2146
2149
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2150
|
+
if (formatOnBlur && isFocused) {
|
|
2151
|
+
setInternalValue(stringValue);
|
|
2152
|
+
setDisplayValue(stringValue);
|
|
2153
|
+
return;
|
|
2154
|
+
}
|
|
2147
2155
|
setInternalValue(formatted);
|
|
2148
2156
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2149
|
-
}, [propValue, variant, currencyFormat, decimals]);
|
|
2157
|
+
}, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
|
|
2150
2158
|
const getInputProps = () => {
|
|
2151
2159
|
var _a2;
|
|
2152
2160
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -2261,7 +2269,9 @@ var Input = (_a) => {
|
|
|
2261
2269
|
currentDecimals
|
|
2262
2270
|
);
|
|
2263
2271
|
setInternalValue(formattedClamped);
|
|
2264
|
-
setDisplayValue(
|
|
2272
|
+
setDisplayValue(
|
|
2273
|
+
formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
|
|
2274
|
+
);
|
|
2265
2275
|
if (onChange) {
|
|
2266
2276
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2267
2277
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -2271,7 +2281,7 @@ var Input = (_a) => {
|
|
|
2271
2281
|
return;
|
|
2272
2282
|
}
|
|
2273
2283
|
setInternalValue(raw);
|
|
2274
|
-
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2284
|
+
setDisplayValue(formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
2275
2285
|
if (!isNaN(asNumber) && onChange) {
|
|
2276
2286
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2277
2287
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -2357,6 +2367,7 @@ var Input = (_a) => {
|
|
|
2357
2367
|
}
|
|
2358
2368
|
};
|
|
2359
2369
|
const handleBlur = (e) => {
|
|
2370
|
+
setIsFocused(false);
|
|
2360
2371
|
if (!internalValue) {
|
|
2361
2372
|
onBlur == null ? void 0 : onBlur(e);
|
|
2362
2373
|
return;
|
|
@@ -2391,12 +2402,18 @@ var Input = (_a) => {
|
|
|
2391
2402
|
}
|
|
2392
2403
|
onBlur == null ? void 0 : onBlur(e);
|
|
2393
2404
|
};
|
|
2405
|
+
const handleFocus = (e) => {
|
|
2406
|
+
var _a2;
|
|
2407
|
+
setIsFocused(true);
|
|
2408
|
+
(_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
|
|
2409
|
+
};
|
|
2394
2410
|
const inputProps = getInputProps();
|
|
2395
2411
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2396
2412
|
InputBase,
|
|
2397
2413
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
2398
2414
|
before: getBeforeElement(),
|
|
2399
2415
|
after: getAfterElement(),
|
|
2416
|
+
onFocus: handleFocus,
|
|
2400
2417
|
onChange: handleChange,
|
|
2401
2418
|
onBlur: handleBlur,
|
|
2402
2419
|
testid,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LoadingCell
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-FDQBM3O4.js";
|
|
4
4
|
import "../../../chunk-M7INAUAJ.js";
|
|
5
5
|
import "../../../chunk-ICHD7DUS.js";
|
|
6
6
|
import "../../../chunk-XPZY6KEI.js";
|
|
@@ -21,7 +21,7 @@ import "../../../chunk-AJ5M6MVX.js";
|
|
|
21
21
|
import "../../../chunk-7IPESTQS.js";
|
|
22
22
|
import "../../../chunk-EWGHVZL5.js";
|
|
23
23
|
import "../../../chunk-AT4AWD6B.js";
|
|
24
|
-
import "../../../chunk-
|
|
24
|
+
import "../../../chunk-SISDU5GI.js";
|
|
25
25
|
import "../../../chunk-KWMG6SN2.js";
|
|
26
26
|
import "../../../chunk-KBIEWFQS.js";
|
|
27
27
|
import "../../../chunk-NSZTJ5R4.js";
|
|
@@ -38,12 +38,12 @@ import "../../../chunk-O2IR67XN.js";
|
|
|
38
38
|
import "../../../chunk-SJZNVG4N.js";
|
|
39
39
|
import "../../../chunk-75USUR3I.js";
|
|
40
40
|
import "../../../chunk-BWPNXY7T.js";
|
|
41
|
-
import "../../../chunk-
|
|
41
|
+
import "../../../chunk-Y2N7A2PP.js";
|
|
42
42
|
import "../../../chunk-X3NDEFVA.js";
|
|
43
43
|
import "../../../chunk-OM7QLLI2.js";
|
|
44
44
|
import "../../../chunk-PE3EZP56.js";
|
|
45
|
-
import "../../../chunk-
|
|
46
|
-
import "../../../chunk-
|
|
45
|
+
import "../../../chunk-TINCHPB4.js";
|
|
46
|
+
import "../../../chunk-KZPIH2K5.js";
|
|
47
47
|
import "../../../chunk-HXGJVYGQ.js";
|
|
48
48
|
import "../../../chunk-WVUIIBRR.js";
|
|
49
49
|
import "../../../chunk-M7WHWZ2J.js";
|
|
@@ -2108,6 +2108,7 @@ var Input = (_a) => {
|
|
|
2108
2108
|
decimals,
|
|
2109
2109
|
uom,
|
|
2110
2110
|
currencyFormat = false,
|
|
2111
|
+
formatOnBlur = false,
|
|
2111
2112
|
removeSearchIcon,
|
|
2112
2113
|
value: propValue,
|
|
2113
2114
|
onChange,
|
|
@@ -2121,6 +2122,7 @@ var Input = (_a) => {
|
|
|
2121
2122
|
"decimals",
|
|
2122
2123
|
"uom",
|
|
2123
2124
|
"currencyFormat",
|
|
2125
|
+
"formatOnBlur",
|
|
2124
2126
|
"removeSearchIcon",
|
|
2125
2127
|
"value",
|
|
2126
2128
|
"onChange",
|
|
@@ -2132,6 +2134,7 @@ var Input = (_a) => {
|
|
|
2132
2134
|
]);
|
|
2133
2135
|
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
2134
2136
|
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
2137
|
+
const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
|
|
2135
2138
|
(0, import_react10.useEffect)(() => {
|
|
2136
2139
|
var _a2;
|
|
2137
2140
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
@@ -2147,9 +2150,14 @@ var Input = (_a) => {
|
|
|
2147
2150
|
return;
|
|
2148
2151
|
}
|
|
2149
2152
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2153
|
+
if (formatOnBlur && isFocused) {
|
|
2154
|
+
setInternalValue(stringValue);
|
|
2155
|
+
setDisplayValue(stringValue);
|
|
2156
|
+
return;
|
|
2157
|
+
}
|
|
2150
2158
|
setInternalValue(formatted);
|
|
2151
2159
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2152
|
-
}, [propValue, variant, currencyFormat, decimals]);
|
|
2160
|
+
}, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
|
|
2153
2161
|
const getInputProps = () => {
|
|
2154
2162
|
var _a2;
|
|
2155
2163
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -2264,7 +2272,9 @@ var Input = (_a) => {
|
|
|
2264
2272
|
currentDecimals
|
|
2265
2273
|
);
|
|
2266
2274
|
setInternalValue(formattedClamped);
|
|
2267
|
-
setDisplayValue(
|
|
2275
|
+
setDisplayValue(
|
|
2276
|
+
formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
|
|
2277
|
+
);
|
|
2268
2278
|
if (onChange) {
|
|
2269
2279
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2270
2280
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -2274,7 +2284,7 @@ var Input = (_a) => {
|
|
|
2274
2284
|
return;
|
|
2275
2285
|
}
|
|
2276
2286
|
setInternalValue(raw);
|
|
2277
|
-
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2287
|
+
setDisplayValue(formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
2278
2288
|
if (!isNaN(asNumber) && onChange) {
|
|
2279
2289
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2280
2290
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -2360,6 +2370,7 @@ var Input = (_a) => {
|
|
|
2360
2370
|
}
|
|
2361
2371
|
};
|
|
2362
2372
|
const handleBlur = (e) => {
|
|
2373
|
+
setIsFocused(false);
|
|
2363
2374
|
if (!internalValue) {
|
|
2364
2375
|
onBlur == null ? void 0 : onBlur(e);
|
|
2365
2376
|
return;
|
|
@@ -2394,12 +2405,18 @@ var Input = (_a) => {
|
|
|
2394
2405
|
}
|
|
2395
2406
|
onBlur == null ? void 0 : onBlur(e);
|
|
2396
2407
|
};
|
|
2408
|
+
const handleFocus = (e) => {
|
|
2409
|
+
var _a2;
|
|
2410
|
+
setIsFocused(true);
|
|
2411
|
+
(_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
|
|
2412
|
+
};
|
|
2397
2413
|
const inputProps = getInputProps();
|
|
2398
2414
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2399
2415
|
InputBase,
|
|
2400
2416
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
2401
2417
|
before: getBeforeElement(),
|
|
2402
2418
|
after: getAfterElement(),
|
|
2419
|
+
onFocus: handleFocus,
|
|
2403
2420
|
onChange: handleChange,
|
|
2404
2421
|
onBlur: handleBlur,
|
|
2405
2422
|
testid,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TableBodyRow
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-FDQBM3O4.js";
|
|
4
4
|
import "../../../chunk-M7INAUAJ.js";
|
|
5
5
|
import "../../../chunk-ICHD7DUS.js";
|
|
6
6
|
import "../../../chunk-XPZY6KEI.js";
|
|
@@ -21,7 +21,7 @@ import "../../../chunk-AJ5M6MVX.js";
|
|
|
21
21
|
import "../../../chunk-7IPESTQS.js";
|
|
22
22
|
import "../../../chunk-EWGHVZL5.js";
|
|
23
23
|
import "../../../chunk-AT4AWD6B.js";
|
|
24
|
-
import "../../../chunk-
|
|
24
|
+
import "../../../chunk-SISDU5GI.js";
|
|
25
25
|
import "../../../chunk-KWMG6SN2.js";
|
|
26
26
|
import "../../../chunk-KBIEWFQS.js";
|
|
27
27
|
import "../../../chunk-NSZTJ5R4.js";
|
|
@@ -38,12 +38,12 @@ import "../../../chunk-O2IR67XN.js";
|
|
|
38
38
|
import "../../../chunk-SJZNVG4N.js";
|
|
39
39
|
import "../../../chunk-75USUR3I.js";
|
|
40
40
|
import "../../../chunk-BWPNXY7T.js";
|
|
41
|
-
import "../../../chunk-
|
|
41
|
+
import "../../../chunk-Y2N7A2PP.js";
|
|
42
42
|
import "../../../chunk-X3NDEFVA.js";
|
|
43
43
|
import "../../../chunk-OM7QLLI2.js";
|
|
44
44
|
import "../../../chunk-PE3EZP56.js";
|
|
45
|
-
import "../../../chunk-
|
|
46
|
-
import "../../../chunk-
|
|
45
|
+
import "../../../chunk-TINCHPB4.js";
|
|
46
|
+
import "../../../chunk-KZPIH2K5.js";
|
|
47
47
|
import "../../../chunk-HXGJVYGQ.js";
|
|
48
48
|
import "../../../chunk-WVUIIBRR.js";
|
|
49
49
|
import "../../../chunk-M7WHWZ2J.js";
|
|
@@ -2106,6 +2106,7 @@ var Input = (_a) => {
|
|
|
2106
2106
|
decimals,
|
|
2107
2107
|
uom,
|
|
2108
2108
|
currencyFormat = false,
|
|
2109
|
+
formatOnBlur = false,
|
|
2109
2110
|
removeSearchIcon,
|
|
2110
2111
|
value: propValue,
|
|
2111
2112
|
onChange,
|
|
@@ -2119,6 +2120,7 @@ var Input = (_a) => {
|
|
|
2119
2120
|
"decimals",
|
|
2120
2121
|
"uom",
|
|
2121
2122
|
"currencyFormat",
|
|
2123
|
+
"formatOnBlur",
|
|
2122
2124
|
"removeSearchIcon",
|
|
2123
2125
|
"value",
|
|
2124
2126
|
"onChange",
|
|
@@ -2130,6 +2132,7 @@ var Input = (_a) => {
|
|
|
2130
2132
|
]);
|
|
2131
2133
|
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
2132
2134
|
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
2135
|
+
const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
|
|
2133
2136
|
(0, import_react10.useEffect)(() => {
|
|
2134
2137
|
var _a2;
|
|
2135
2138
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
@@ -2145,9 +2148,14 @@ var Input = (_a) => {
|
|
|
2145
2148
|
return;
|
|
2146
2149
|
}
|
|
2147
2150
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2151
|
+
if (formatOnBlur && isFocused) {
|
|
2152
|
+
setInternalValue(stringValue);
|
|
2153
|
+
setDisplayValue(stringValue);
|
|
2154
|
+
return;
|
|
2155
|
+
}
|
|
2148
2156
|
setInternalValue(formatted);
|
|
2149
2157
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2150
|
-
}, [propValue, variant, currencyFormat, decimals]);
|
|
2158
|
+
}, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
|
|
2151
2159
|
const getInputProps = () => {
|
|
2152
2160
|
var _a2;
|
|
2153
2161
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -2262,7 +2270,9 @@ var Input = (_a) => {
|
|
|
2262
2270
|
currentDecimals
|
|
2263
2271
|
);
|
|
2264
2272
|
setInternalValue(formattedClamped);
|
|
2265
|
-
setDisplayValue(
|
|
2273
|
+
setDisplayValue(
|
|
2274
|
+
formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
|
|
2275
|
+
);
|
|
2266
2276
|
if (onChange) {
|
|
2267
2277
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2268
2278
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -2272,7 +2282,7 @@ var Input = (_a) => {
|
|
|
2272
2282
|
return;
|
|
2273
2283
|
}
|
|
2274
2284
|
setInternalValue(raw);
|
|
2275
|
-
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2285
|
+
setDisplayValue(formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
2276
2286
|
if (!isNaN(asNumber) && onChange) {
|
|
2277
2287
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2278
2288
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -2358,6 +2368,7 @@ var Input = (_a) => {
|
|
|
2358
2368
|
}
|
|
2359
2369
|
};
|
|
2360
2370
|
const handleBlur = (e) => {
|
|
2371
|
+
setIsFocused(false);
|
|
2361
2372
|
if (!internalValue) {
|
|
2362
2373
|
onBlur == null ? void 0 : onBlur(e);
|
|
2363
2374
|
return;
|
|
@@ -2392,12 +2403,18 @@ var Input = (_a) => {
|
|
|
2392
2403
|
}
|
|
2393
2404
|
onBlur == null ? void 0 : onBlur(e);
|
|
2394
2405
|
};
|
|
2406
|
+
const handleFocus = (e) => {
|
|
2407
|
+
var _a2;
|
|
2408
|
+
setIsFocused(true);
|
|
2409
|
+
(_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
|
|
2410
|
+
};
|
|
2395
2411
|
const inputProps = getInputProps();
|
|
2396
2412
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2397
2413
|
InputBase,
|
|
2398
2414
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
2399
2415
|
before: getBeforeElement(),
|
|
2400
2416
|
after: getAfterElement(),
|
|
2417
|
+
onFocus: handleFocus,
|
|
2401
2418
|
onChange: handleChange,
|
|
2402
2419
|
onBlur: handleBlur,
|
|
2403
2420
|
testid,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TableBody
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-FDQBM3O4.js";
|
|
4
4
|
import "../../../chunk-M7INAUAJ.js";
|
|
5
5
|
import "../../../chunk-ICHD7DUS.js";
|
|
6
6
|
import "../../../chunk-XPZY6KEI.js";
|
|
@@ -21,7 +21,7 @@ import "../../../chunk-AJ5M6MVX.js";
|
|
|
21
21
|
import "../../../chunk-7IPESTQS.js";
|
|
22
22
|
import "../../../chunk-EWGHVZL5.js";
|
|
23
23
|
import "../../../chunk-AT4AWD6B.js";
|
|
24
|
-
import "../../../chunk-
|
|
24
|
+
import "../../../chunk-SISDU5GI.js";
|
|
25
25
|
import "../../../chunk-KWMG6SN2.js";
|
|
26
26
|
import "../../../chunk-KBIEWFQS.js";
|
|
27
27
|
import "../../../chunk-NSZTJ5R4.js";
|
|
@@ -38,12 +38,12 @@ import "../../../chunk-O2IR67XN.js";
|
|
|
38
38
|
import "../../../chunk-SJZNVG4N.js";
|
|
39
39
|
import "../../../chunk-75USUR3I.js";
|
|
40
40
|
import "../../../chunk-BWPNXY7T.js";
|
|
41
|
-
import "../../../chunk-
|
|
41
|
+
import "../../../chunk-Y2N7A2PP.js";
|
|
42
42
|
import "../../../chunk-X3NDEFVA.js";
|
|
43
43
|
import "../../../chunk-OM7QLLI2.js";
|
|
44
44
|
import "../../../chunk-PE3EZP56.js";
|
|
45
|
-
import "../../../chunk-
|
|
46
|
-
import "../../../chunk-
|
|
45
|
+
import "../../../chunk-TINCHPB4.js";
|
|
46
|
+
import "../../../chunk-KZPIH2K5.js";
|
|
47
47
|
import "../../../chunk-HXGJVYGQ.js";
|
|
48
48
|
import "../../../chunk-WVUIIBRR.js";
|
|
49
49
|
import "../../../chunk-M7WHWZ2J.js";
|
|
@@ -2107,6 +2107,7 @@ var Input = (_a) => {
|
|
|
2107
2107
|
decimals,
|
|
2108
2108
|
uom,
|
|
2109
2109
|
currencyFormat = false,
|
|
2110
|
+
formatOnBlur = false,
|
|
2110
2111
|
removeSearchIcon,
|
|
2111
2112
|
value: propValue,
|
|
2112
2113
|
onChange,
|
|
@@ -2120,6 +2121,7 @@ var Input = (_a) => {
|
|
|
2120
2121
|
"decimals",
|
|
2121
2122
|
"uom",
|
|
2122
2123
|
"currencyFormat",
|
|
2124
|
+
"formatOnBlur",
|
|
2123
2125
|
"removeSearchIcon",
|
|
2124
2126
|
"value",
|
|
2125
2127
|
"onChange",
|
|
@@ -2131,6 +2133,7 @@ var Input = (_a) => {
|
|
|
2131
2133
|
]);
|
|
2132
2134
|
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
2133
2135
|
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
2136
|
+
const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
|
|
2134
2137
|
(0, import_react10.useEffect)(() => {
|
|
2135
2138
|
var _a2;
|
|
2136
2139
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
@@ -2146,9 +2149,14 @@ var Input = (_a) => {
|
|
|
2146
2149
|
return;
|
|
2147
2150
|
}
|
|
2148
2151
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2152
|
+
if (formatOnBlur && isFocused) {
|
|
2153
|
+
setInternalValue(stringValue);
|
|
2154
|
+
setDisplayValue(stringValue);
|
|
2155
|
+
return;
|
|
2156
|
+
}
|
|
2149
2157
|
setInternalValue(formatted);
|
|
2150
2158
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2151
|
-
}, [propValue, variant, currencyFormat, decimals]);
|
|
2159
|
+
}, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
|
|
2152
2160
|
const getInputProps = () => {
|
|
2153
2161
|
var _a2;
|
|
2154
2162
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -2263,7 +2271,9 @@ var Input = (_a) => {
|
|
|
2263
2271
|
currentDecimals
|
|
2264
2272
|
);
|
|
2265
2273
|
setInternalValue(formattedClamped);
|
|
2266
|
-
setDisplayValue(
|
|
2274
|
+
setDisplayValue(
|
|
2275
|
+
formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
|
|
2276
|
+
);
|
|
2267
2277
|
if (onChange) {
|
|
2268
2278
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2269
2279
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -2273,7 +2283,7 @@ var Input = (_a) => {
|
|
|
2273
2283
|
return;
|
|
2274
2284
|
}
|
|
2275
2285
|
setInternalValue(raw);
|
|
2276
|
-
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2286
|
+
setDisplayValue(formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
2277
2287
|
if (!isNaN(asNumber) && onChange) {
|
|
2278
2288
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2279
2289
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -2359,6 +2369,7 @@ var Input = (_a) => {
|
|
|
2359
2369
|
}
|
|
2360
2370
|
};
|
|
2361
2371
|
const handleBlur = (e) => {
|
|
2372
|
+
setIsFocused(false);
|
|
2362
2373
|
if (!internalValue) {
|
|
2363
2374
|
onBlur == null ? void 0 : onBlur(e);
|
|
2364
2375
|
return;
|
|
@@ -2393,12 +2404,18 @@ var Input = (_a) => {
|
|
|
2393
2404
|
}
|
|
2394
2405
|
onBlur == null ? void 0 : onBlur(e);
|
|
2395
2406
|
};
|
|
2407
|
+
const handleFocus = (e) => {
|
|
2408
|
+
var _a2;
|
|
2409
|
+
setIsFocused(true);
|
|
2410
|
+
(_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
|
|
2411
|
+
};
|
|
2396
2412
|
const inputProps = getInputProps();
|
|
2397
2413
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2398
2414
|
InputBase,
|
|
2399
2415
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
2400
2416
|
before: getBeforeElement(),
|
|
2401
2417
|
after: getAfterElement(),
|
|
2418
|
+
onFocus: handleFocus,
|
|
2402
2419
|
onChange: handleChange,
|
|
2403
2420
|
onBlur: handleBlur,
|
|
2404
2421
|
testid,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
DataGrid,
|
|
4
4
|
DataGrid_default
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-FDQBM3O4.js";
|
|
6
6
|
import "../../chunk-M7INAUAJ.js";
|
|
7
7
|
import "../../chunk-ICHD7DUS.js";
|
|
8
8
|
import "../../chunk-XPZY6KEI.js";
|
|
@@ -23,7 +23,7 @@ import "../../chunk-AJ5M6MVX.js";
|
|
|
23
23
|
import "../../chunk-7IPESTQS.js";
|
|
24
24
|
import "../../chunk-EWGHVZL5.js";
|
|
25
25
|
import "../../chunk-AT4AWD6B.js";
|
|
26
|
-
import "../../chunk-
|
|
26
|
+
import "../../chunk-SISDU5GI.js";
|
|
27
27
|
import "../../chunk-KWMG6SN2.js";
|
|
28
28
|
import "../../chunk-KBIEWFQS.js";
|
|
29
29
|
import "../../chunk-NSZTJ5R4.js";
|
|
@@ -40,12 +40,12 @@ import "../../chunk-O2IR67XN.js";
|
|
|
40
40
|
import "../../chunk-SJZNVG4N.js";
|
|
41
41
|
import "../../chunk-75USUR3I.js";
|
|
42
42
|
import "../../chunk-BWPNXY7T.js";
|
|
43
|
-
import "../../chunk-
|
|
43
|
+
import "../../chunk-Y2N7A2PP.js";
|
|
44
44
|
import "../../chunk-X3NDEFVA.js";
|
|
45
45
|
import "../../chunk-OM7QLLI2.js";
|
|
46
46
|
import "../../chunk-PE3EZP56.js";
|
|
47
|
-
import "../../chunk-
|
|
48
|
-
import "../../chunk-
|
|
47
|
+
import "../../chunk-TINCHPB4.js";
|
|
48
|
+
import "../../chunk-KZPIH2K5.js";
|
|
49
49
|
import "../../chunk-HXGJVYGQ.js";
|
|
50
50
|
import "../../chunk-WVUIIBRR.js";
|
|
51
51
|
import "../../chunk-M7WHWZ2J.js";
|
|
@@ -2106,6 +2106,7 @@ var Input = (_a) => {
|
|
|
2106
2106
|
decimals,
|
|
2107
2107
|
uom,
|
|
2108
2108
|
currencyFormat = false,
|
|
2109
|
+
formatOnBlur = false,
|
|
2109
2110
|
removeSearchIcon,
|
|
2110
2111
|
value: propValue,
|
|
2111
2112
|
onChange,
|
|
@@ -2119,6 +2120,7 @@ var Input = (_a) => {
|
|
|
2119
2120
|
"decimals",
|
|
2120
2121
|
"uom",
|
|
2121
2122
|
"currencyFormat",
|
|
2123
|
+
"formatOnBlur",
|
|
2122
2124
|
"removeSearchIcon",
|
|
2123
2125
|
"value",
|
|
2124
2126
|
"onChange",
|
|
@@ -2130,6 +2132,7 @@ var Input = (_a) => {
|
|
|
2130
2132
|
]);
|
|
2131
2133
|
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
2132
2134
|
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
2135
|
+
const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
|
|
2133
2136
|
(0, import_react10.useEffect)(() => {
|
|
2134
2137
|
var _a2;
|
|
2135
2138
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
@@ -2145,9 +2148,14 @@ var Input = (_a) => {
|
|
|
2145
2148
|
return;
|
|
2146
2149
|
}
|
|
2147
2150
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2151
|
+
if (formatOnBlur && isFocused) {
|
|
2152
|
+
setInternalValue(stringValue);
|
|
2153
|
+
setDisplayValue(stringValue);
|
|
2154
|
+
return;
|
|
2155
|
+
}
|
|
2148
2156
|
setInternalValue(formatted);
|
|
2149
2157
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2150
|
-
}, [propValue, variant, currencyFormat, decimals]);
|
|
2158
|
+
}, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
|
|
2151
2159
|
const getInputProps = () => {
|
|
2152
2160
|
var _a2;
|
|
2153
2161
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -2262,7 +2270,9 @@ var Input = (_a) => {
|
|
|
2262
2270
|
currentDecimals
|
|
2263
2271
|
);
|
|
2264
2272
|
setInternalValue(formattedClamped);
|
|
2265
|
-
setDisplayValue(
|
|
2273
|
+
setDisplayValue(
|
|
2274
|
+
formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
|
|
2275
|
+
);
|
|
2266
2276
|
if (onChange) {
|
|
2267
2277
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2268
2278
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -2272,7 +2282,7 @@ var Input = (_a) => {
|
|
|
2272
2282
|
return;
|
|
2273
2283
|
}
|
|
2274
2284
|
setInternalValue(raw);
|
|
2275
|
-
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2285
|
+
setDisplayValue(formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
2276
2286
|
if (!isNaN(asNumber) && onChange) {
|
|
2277
2287
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2278
2288
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -2358,6 +2368,7 @@ var Input = (_a) => {
|
|
|
2358
2368
|
}
|
|
2359
2369
|
};
|
|
2360
2370
|
const handleBlur = (e) => {
|
|
2371
|
+
setIsFocused(false);
|
|
2361
2372
|
if (!internalValue) {
|
|
2362
2373
|
onBlur == null ? void 0 : onBlur(e);
|
|
2363
2374
|
return;
|
|
@@ -2392,12 +2403,18 @@ var Input = (_a) => {
|
|
|
2392
2403
|
}
|
|
2393
2404
|
onBlur == null ? void 0 : onBlur(e);
|
|
2394
2405
|
};
|
|
2406
|
+
const handleFocus = (e) => {
|
|
2407
|
+
var _a2;
|
|
2408
|
+
setIsFocused(true);
|
|
2409
|
+
(_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
|
|
2410
|
+
};
|
|
2395
2411
|
const inputProps = getInputProps();
|
|
2396
2412
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2397
2413
|
InputBase,
|
|
2398
2414
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
2399
2415
|
before: getBeforeElement(),
|
|
2400
2416
|
after: getAfterElement(),
|
|
2417
|
+
onFocus: handleFocus,
|
|
2401
2418
|
onChange: handleChange,
|
|
2402
2419
|
onBlur: handleBlur,
|
|
2403
2420
|
testid,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSortIcon
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-FDQBM3O4.js";
|
|
4
4
|
import "../../chunk-M7INAUAJ.js";
|
|
5
5
|
import "../../chunk-ICHD7DUS.js";
|
|
6
6
|
import "../../chunk-XPZY6KEI.js";
|
|
@@ -21,7 +21,7 @@ import "../../chunk-AJ5M6MVX.js";
|
|
|
21
21
|
import "../../chunk-7IPESTQS.js";
|
|
22
22
|
import "../../chunk-EWGHVZL5.js";
|
|
23
23
|
import "../../chunk-AT4AWD6B.js";
|
|
24
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-SISDU5GI.js";
|
|
25
25
|
import "../../chunk-KWMG6SN2.js";
|
|
26
26
|
import "../../chunk-KBIEWFQS.js";
|
|
27
27
|
import "../../chunk-NSZTJ5R4.js";
|
|
@@ -38,12 +38,12 @@ import "../../chunk-O2IR67XN.js";
|
|
|
38
38
|
import "../../chunk-SJZNVG4N.js";
|
|
39
39
|
import "../../chunk-75USUR3I.js";
|
|
40
40
|
import "../../chunk-BWPNXY7T.js";
|
|
41
|
-
import "../../chunk-
|
|
41
|
+
import "../../chunk-Y2N7A2PP.js";
|
|
42
42
|
import "../../chunk-X3NDEFVA.js";
|
|
43
43
|
import "../../chunk-OM7QLLI2.js";
|
|
44
44
|
import "../../chunk-PE3EZP56.js";
|
|
45
|
-
import "../../chunk-
|
|
46
|
-
import "../../chunk-
|
|
45
|
+
import "../../chunk-TINCHPB4.js";
|
|
46
|
+
import "../../chunk-KZPIH2K5.js";
|
|
47
47
|
import "../../chunk-HXGJVYGQ.js";
|
|
48
48
|
import "../../chunk-WVUIIBRR.js";
|
|
49
49
|
import "../../chunk-M7WHWZ2J.js";
|
|
@@ -1625,6 +1625,7 @@ var Input = (_a) => {
|
|
|
1625
1625
|
decimals,
|
|
1626
1626
|
uom,
|
|
1627
1627
|
currencyFormat = false,
|
|
1628
|
+
formatOnBlur = false,
|
|
1628
1629
|
removeSearchIcon,
|
|
1629
1630
|
value: propValue,
|
|
1630
1631
|
onChange,
|
|
@@ -1638,6 +1639,7 @@ var Input = (_a) => {
|
|
|
1638
1639
|
"decimals",
|
|
1639
1640
|
"uom",
|
|
1640
1641
|
"currencyFormat",
|
|
1642
|
+
"formatOnBlur",
|
|
1641
1643
|
"removeSearchIcon",
|
|
1642
1644
|
"value",
|
|
1643
1645
|
"onChange",
|
|
@@ -1649,6 +1651,7 @@ var Input = (_a) => {
|
|
|
1649
1651
|
]);
|
|
1650
1652
|
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
1651
1653
|
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
1654
|
+
const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
|
|
1652
1655
|
(0, import_react10.useEffect)(() => {
|
|
1653
1656
|
var _a2;
|
|
1654
1657
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
@@ -1664,9 +1667,14 @@ var Input = (_a) => {
|
|
|
1664
1667
|
return;
|
|
1665
1668
|
}
|
|
1666
1669
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
1670
|
+
if (formatOnBlur && isFocused) {
|
|
1671
|
+
setInternalValue(stringValue);
|
|
1672
|
+
setDisplayValue(stringValue);
|
|
1673
|
+
return;
|
|
1674
|
+
}
|
|
1667
1675
|
setInternalValue(formatted);
|
|
1668
1676
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
1669
|
-
}, [propValue, variant, currencyFormat, decimals]);
|
|
1677
|
+
}, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
|
|
1670
1678
|
const getInputProps = () => {
|
|
1671
1679
|
var _a2;
|
|
1672
1680
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -1781,7 +1789,9 @@ var Input = (_a) => {
|
|
|
1781
1789
|
currentDecimals
|
|
1782
1790
|
);
|
|
1783
1791
|
setInternalValue(formattedClamped);
|
|
1784
|
-
setDisplayValue(
|
|
1792
|
+
setDisplayValue(
|
|
1793
|
+
formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
|
|
1794
|
+
);
|
|
1785
1795
|
if (onChange) {
|
|
1786
1796
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
1787
1797
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -1791,7 +1801,7 @@ var Input = (_a) => {
|
|
|
1791
1801
|
return;
|
|
1792
1802
|
}
|
|
1793
1803
|
setInternalValue(raw);
|
|
1794
|
-
setDisplayValue(formatCurrencyDisplay(raw));
|
|
1804
|
+
setDisplayValue(formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
1795
1805
|
if (!isNaN(asNumber) && onChange) {
|
|
1796
1806
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
1797
1807
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -1877,6 +1887,7 @@ var Input = (_a) => {
|
|
|
1877
1887
|
}
|
|
1878
1888
|
};
|
|
1879
1889
|
const handleBlur = (e) => {
|
|
1890
|
+
setIsFocused(false);
|
|
1880
1891
|
if (!internalValue) {
|
|
1881
1892
|
onBlur == null ? void 0 : onBlur(e);
|
|
1882
1893
|
return;
|
|
@@ -1911,12 +1922,18 @@ var Input = (_a) => {
|
|
|
1911
1922
|
}
|
|
1912
1923
|
onBlur == null ? void 0 : onBlur(e);
|
|
1913
1924
|
};
|
|
1925
|
+
const handleFocus = (e) => {
|
|
1926
|
+
var _a2;
|
|
1927
|
+
setIsFocused(true);
|
|
1928
|
+
(_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
|
|
1929
|
+
};
|
|
1914
1930
|
const inputProps = getInputProps();
|
|
1915
1931
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1916
1932
|
InputBase,
|
|
1917
1933
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
1918
1934
|
before: getBeforeElement(),
|
|
1919
1935
|
after: getAfterElement(),
|
|
1936
|
+
onFocus: handleFocus,
|
|
1920
1937
|
onChange: handleChange,
|
|
1921
1938
|
onBlur: handleBlur,
|
|
1922
1939
|
testid,
|