@dmsi/wedgekit-react 0.0.1010 → 0.0.1011
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-FHXCCVOG.js → chunk-72WLEGGU.js} +1 -1
- package/dist/{chunk-5NRKL5CJ.js → chunk-FFCSDPXR.js} +1 -1
- package/dist/{chunk-FZ2TEKOE.js → chunk-IEKZBWVL.js} +1 -1
- package/dist/{chunk-7T5RGDCN.js → chunk-NEMOTB6U.js} +75 -13
- package/dist/{chunk-RLJU65SD.js → chunk-PJQHRERH.js} +4 -4
- package/dist/components/CalendarRange.cjs +75 -13
- package/dist/components/CalendarRange.js +5 -5
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +75 -13
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +5 -5
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +75 -13
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +5 -5
- package/dist/components/DataGrid/PinnedColumns.cjs +75 -13
- package/dist/components/DataGrid/PinnedColumns.js +5 -5
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +75 -13
- package/dist/components/DataGrid/TableBody/LoadingCell.js +5 -5
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +75 -13
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +5 -5
- package/dist/components/DataGrid/TableBody/index.cjs +75 -13
- package/dist/components/DataGrid/TableBody/index.js +5 -5
- package/dist/components/DataGrid/index.cjs +75 -13
- package/dist/components/DataGrid/index.js +5 -5
- package/dist/components/DataGrid/utils.cjs +75 -13
- package/dist/components/DataGrid/utils.js +5 -5
- package/dist/components/DataGridCell.cjs +75 -13
- package/dist/components/DataGridCell.js +3 -3
- package/dist/components/DateInput.cjs +75 -13
- package/dist/components/DateInput.js +5 -5
- package/dist/components/DateRangeInput.cjs +75 -13
- package/dist/components/DateRangeInput.js +5 -5
- package/dist/components/FilterGroup.cjs +75 -13
- package/dist/components/FilterGroup.js +2 -2
- package/dist/components/Input.cjs +75 -13
- package/dist/components/Input.js +1 -1
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +75 -13
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +5 -5
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +75 -13
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +5 -5
- package/dist/components/MobileDataGrid/index.cjs +75 -13
- package/dist/components/MobileDataGrid/index.js +5 -5
- package/dist/components/Password.cjs +75 -13
- package/dist/components/Password.js +1 -1
- package/dist/components/Search.cjs +75 -13
- package/dist/components/Search.js +2 -2
- package/dist/components/Select.cjs +75 -13
- package/dist/components/Select.js +2 -2
- package/dist/components/Stepper.cjs +75 -13
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Time.cjs +75 -13
- package/dist/components/Time.js +1 -1
- package/dist/components/index.cjs +75 -13
- package/dist/components/index.js +5 -5
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TableBodyRow
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-PJQHRERH.js";
|
|
4
4
|
import "../../../chunk-2UNLVJU5.js";
|
|
5
5
|
import "../../../chunk-POZD6R3P.js";
|
|
6
6
|
import "../../../chunk-M7INAUAJ.js";
|
|
@@ -21,7 +21,7 @@ import "../../../chunk-7IPESTQS.js";
|
|
|
21
21
|
import "../../../chunk-Z2HPSFEQ.js";
|
|
22
22
|
import "../../../chunk-AT4AWD6B.js";
|
|
23
23
|
import "../../../chunk-EWGHVZL5.js";
|
|
24
|
-
import "../../../chunk-
|
|
24
|
+
import "../../../chunk-IEKZBWVL.js";
|
|
25
25
|
import "../../../chunk-I57U5THY.js";
|
|
26
26
|
import "../../../chunk-KBIEWFQS.js";
|
|
27
27
|
import "../../../chunk-NSZTJ5R4.js";
|
|
@@ -38,12 +38,12 @@ import "../../../chunk-3IAXYRUR.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-FFCSDPXR.js";
|
|
42
42
|
import "../../../chunk-OM7QLLI2.js";
|
|
43
43
|
import "../../../chunk-PE3EZP56.js";
|
|
44
44
|
import "../../../chunk-X3NDEFVA.js";
|
|
45
|
-
import "../../../chunk-
|
|
46
|
-
import "../../../chunk-
|
|
45
|
+
import "../../../chunk-72WLEGGU.js";
|
|
46
|
+
import "../../../chunk-NEMOTB6U.js";
|
|
47
47
|
import "../../../chunk-HXGJVYGQ.js";
|
|
48
48
|
import "../../../chunk-WVUIIBRR.js";
|
|
49
49
|
import "../../../chunk-M7WHWZ2J.js";
|
|
@@ -2105,6 +2105,7 @@ var Input = (_a) => {
|
|
|
2105
2105
|
variant = "default",
|
|
2106
2106
|
decimals,
|
|
2107
2107
|
uom,
|
|
2108
|
+
currencyFormat = false,
|
|
2108
2109
|
removeSearchIcon,
|
|
2109
2110
|
value: propValue,
|
|
2110
2111
|
onChange,
|
|
@@ -2117,6 +2118,7 @@ var Input = (_a) => {
|
|
|
2117
2118
|
"variant",
|
|
2118
2119
|
"decimals",
|
|
2119
2120
|
"uom",
|
|
2121
|
+
"currencyFormat",
|
|
2120
2122
|
"removeSearchIcon",
|
|
2121
2123
|
"value",
|
|
2122
2124
|
"onChange",
|
|
@@ -2131,22 +2133,21 @@ var Input = (_a) => {
|
|
|
2131
2133
|
(0, import_react10.useEffect)(() => {
|
|
2132
2134
|
var _a2;
|
|
2133
2135
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
var _a2;
|
|
2139
|
-
if (variant !== "currency") {
|
|
2136
|
+
const shouldUseThousandsFormatting = variant === "currency" || variant === "uom" && currencyFormat;
|
|
2137
|
+
if (!stringValue) {
|
|
2138
|
+
setInternalValue("");
|
|
2139
|
+
setDisplayValue("");
|
|
2140
2140
|
return;
|
|
2141
2141
|
}
|
|
2142
|
-
|
|
2143
|
-
|
|
2142
|
+
if (!shouldUseThousandsFormatting) {
|
|
2143
|
+
setInternalValue(stringValue);
|
|
2144
|
+
setDisplayValue(stringValue);
|
|
2144
2145
|
return;
|
|
2145
2146
|
}
|
|
2146
2147
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2147
2148
|
setInternalValue(formatted);
|
|
2148
2149
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2149
|
-
}, []);
|
|
2150
|
+
}, [propValue, variant, currencyFormat, decimals]);
|
|
2150
2151
|
const getInputProps = () => {
|
|
2151
2152
|
var _a2;
|
|
2152
2153
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -2172,8 +2173,9 @@ var Input = (_a) => {
|
|
|
2172
2173
|
case "percentage":
|
|
2173
2174
|
case "uom":
|
|
2174
2175
|
return __spreadProps(__spreadValues({}, baseProps), {
|
|
2175
|
-
type: "number",
|
|
2176
|
-
align: "right"
|
|
2176
|
+
type: currencyFormat ? "text" : "number",
|
|
2177
|
+
align: "right",
|
|
2178
|
+
value: currencyFormat ? displayValue : propValue
|
|
2177
2179
|
});
|
|
2178
2180
|
default:
|
|
2179
2181
|
return baseProps;
|
|
@@ -2186,6 +2188,8 @@ var Input = (_a) => {
|
|
|
2186
2188
|
return !removeSearchIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "search" }) }) : null;
|
|
2187
2189
|
case "currency":
|
|
2188
2190
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "attach_money" }) });
|
|
2191
|
+
case "uom":
|
|
2192
|
+
return currencyFormat ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "attach_money" }) }) : null;
|
|
2189
2193
|
default:
|
|
2190
2194
|
return null;
|
|
2191
2195
|
}
|
|
@@ -2277,6 +2281,51 @@ var Input = (_a) => {
|
|
|
2277
2281
|
}
|
|
2278
2282
|
return;
|
|
2279
2283
|
}
|
|
2284
|
+
if (variant === "uom" && currencyFormat) {
|
|
2285
|
+
const raw = rawValue.replace(/,/g, "");
|
|
2286
|
+
if (raw === "") {
|
|
2287
|
+
setInternalValue("");
|
|
2288
|
+
setDisplayValue("");
|
|
2289
|
+
if (onChange) {
|
|
2290
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2291
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
2292
|
+
});
|
|
2293
|
+
onChange(syntheticEvent);
|
|
2294
|
+
}
|
|
2295
|
+
return;
|
|
2296
|
+
}
|
|
2297
|
+
const regex = /^\d*\.?\d*$/;
|
|
2298
|
+
if (!regex.test(raw)) return;
|
|
2299
|
+
const parts = raw.split(".");
|
|
2300
|
+
const currentDecimals = decimals != null ? decimals : 2;
|
|
2301
|
+
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
2302
|
+
const asNumber = Number(raw);
|
|
2303
|
+
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
2304
|
+
const clamped = maxNumber;
|
|
2305
|
+
const formattedClamped = formatDecimalValue(
|
|
2306
|
+
clamped.toString(),
|
|
2307
|
+
currentDecimals
|
|
2308
|
+
);
|
|
2309
|
+
setInternalValue(formattedClamped);
|
|
2310
|
+
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
2311
|
+
if (onChange) {
|
|
2312
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2313
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
2314
|
+
});
|
|
2315
|
+
onChange(syntheticEvent);
|
|
2316
|
+
}
|
|
2317
|
+
return;
|
|
2318
|
+
}
|
|
2319
|
+
setInternalValue(raw);
|
|
2320
|
+
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2321
|
+
if (!isNaN(asNumber) && onChange) {
|
|
2322
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2323
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
2324
|
+
});
|
|
2325
|
+
onChange(syntheticEvent);
|
|
2326
|
+
}
|
|
2327
|
+
return;
|
|
2328
|
+
}
|
|
2280
2329
|
if (variant === "uom" && e.target.type === "number") {
|
|
2281
2330
|
const numeric = Number(rawValue);
|
|
2282
2331
|
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
@@ -2325,8 +2374,21 @@ var Input = (_a) => {
|
|
|
2325
2374
|
onChange(syntheticEvent);
|
|
2326
2375
|
}
|
|
2327
2376
|
} else if (variant === "uom") {
|
|
2328
|
-
|
|
2329
|
-
|
|
2377
|
+
if (currencyFormat) {
|
|
2378
|
+
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
2379
|
+
setInternalValue(formatted);
|
|
2380
|
+
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2381
|
+
const asNumber = Number(formatted);
|
|
2382
|
+
if (!isNaN(asNumber) && onChange) {
|
|
2383
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2384
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
2385
|
+
});
|
|
2386
|
+
onChange(syntheticEvent);
|
|
2387
|
+
}
|
|
2388
|
+
} else {
|
|
2389
|
+
const formattedValue = formatDecimalValue(e.target.value, decimals);
|
|
2390
|
+
e.target.value = formattedValue;
|
|
2391
|
+
}
|
|
2330
2392
|
}
|
|
2331
2393
|
onBlur == null ? void 0 : onBlur(e);
|
|
2332
2394
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TableBody
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-PJQHRERH.js";
|
|
4
4
|
import "../../../chunk-2UNLVJU5.js";
|
|
5
5
|
import "../../../chunk-POZD6R3P.js";
|
|
6
6
|
import "../../../chunk-M7INAUAJ.js";
|
|
@@ -21,7 +21,7 @@ import "../../../chunk-7IPESTQS.js";
|
|
|
21
21
|
import "../../../chunk-Z2HPSFEQ.js";
|
|
22
22
|
import "../../../chunk-AT4AWD6B.js";
|
|
23
23
|
import "../../../chunk-EWGHVZL5.js";
|
|
24
|
-
import "../../../chunk-
|
|
24
|
+
import "../../../chunk-IEKZBWVL.js";
|
|
25
25
|
import "../../../chunk-I57U5THY.js";
|
|
26
26
|
import "../../../chunk-KBIEWFQS.js";
|
|
27
27
|
import "../../../chunk-NSZTJ5R4.js";
|
|
@@ -38,12 +38,12 @@ import "../../../chunk-3IAXYRUR.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-FFCSDPXR.js";
|
|
42
42
|
import "../../../chunk-OM7QLLI2.js";
|
|
43
43
|
import "../../../chunk-PE3EZP56.js";
|
|
44
44
|
import "../../../chunk-X3NDEFVA.js";
|
|
45
|
-
import "../../../chunk-
|
|
46
|
-
import "../../../chunk-
|
|
45
|
+
import "../../../chunk-72WLEGGU.js";
|
|
46
|
+
import "../../../chunk-NEMOTB6U.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
|
variant = "default",
|
|
2107
2107
|
decimals,
|
|
2108
2108
|
uom,
|
|
2109
|
+
currencyFormat = false,
|
|
2109
2110
|
removeSearchIcon,
|
|
2110
2111
|
value: propValue,
|
|
2111
2112
|
onChange,
|
|
@@ -2118,6 +2119,7 @@ var Input = (_a) => {
|
|
|
2118
2119
|
"variant",
|
|
2119
2120
|
"decimals",
|
|
2120
2121
|
"uom",
|
|
2122
|
+
"currencyFormat",
|
|
2121
2123
|
"removeSearchIcon",
|
|
2122
2124
|
"value",
|
|
2123
2125
|
"onChange",
|
|
@@ -2132,22 +2134,21 @@ var Input = (_a) => {
|
|
|
2132
2134
|
(0, import_react10.useEffect)(() => {
|
|
2133
2135
|
var _a2;
|
|
2134
2136
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
var _a2;
|
|
2140
|
-
if (variant !== "currency") {
|
|
2137
|
+
const shouldUseThousandsFormatting = variant === "currency" || variant === "uom" && currencyFormat;
|
|
2138
|
+
if (!stringValue) {
|
|
2139
|
+
setInternalValue("");
|
|
2140
|
+
setDisplayValue("");
|
|
2141
2141
|
return;
|
|
2142
2142
|
}
|
|
2143
|
-
|
|
2144
|
-
|
|
2143
|
+
if (!shouldUseThousandsFormatting) {
|
|
2144
|
+
setInternalValue(stringValue);
|
|
2145
|
+
setDisplayValue(stringValue);
|
|
2145
2146
|
return;
|
|
2146
2147
|
}
|
|
2147
2148
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2148
2149
|
setInternalValue(formatted);
|
|
2149
2150
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2150
|
-
}, []);
|
|
2151
|
+
}, [propValue, variant, currencyFormat, decimals]);
|
|
2151
2152
|
const getInputProps = () => {
|
|
2152
2153
|
var _a2;
|
|
2153
2154
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -2173,8 +2174,9 @@ var Input = (_a) => {
|
|
|
2173
2174
|
case "percentage":
|
|
2174
2175
|
case "uom":
|
|
2175
2176
|
return __spreadProps(__spreadValues({}, baseProps), {
|
|
2176
|
-
type: "number",
|
|
2177
|
-
align: "right"
|
|
2177
|
+
type: currencyFormat ? "text" : "number",
|
|
2178
|
+
align: "right",
|
|
2179
|
+
value: currencyFormat ? displayValue : propValue
|
|
2178
2180
|
});
|
|
2179
2181
|
default:
|
|
2180
2182
|
return baseProps;
|
|
@@ -2187,6 +2189,8 @@ var Input = (_a) => {
|
|
|
2187
2189
|
return !removeSearchIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "search" }) }) : null;
|
|
2188
2190
|
case "currency":
|
|
2189
2191
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "attach_money" }) });
|
|
2192
|
+
case "uom":
|
|
2193
|
+
return currencyFormat ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "attach_money" }) }) : null;
|
|
2190
2194
|
default:
|
|
2191
2195
|
return null;
|
|
2192
2196
|
}
|
|
@@ -2278,6 +2282,51 @@ var Input = (_a) => {
|
|
|
2278
2282
|
}
|
|
2279
2283
|
return;
|
|
2280
2284
|
}
|
|
2285
|
+
if (variant === "uom" && currencyFormat) {
|
|
2286
|
+
const raw = rawValue.replace(/,/g, "");
|
|
2287
|
+
if (raw === "") {
|
|
2288
|
+
setInternalValue("");
|
|
2289
|
+
setDisplayValue("");
|
|
2290
|
+
if (onChange) {
|
|
2291
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2292
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
2293
|
+
});
|
|
2294
|
+
onChange(syntheticEvent);
|
|
2295
|
+
}
|
|
2296
|
+
return;
|
|
2297
|
+
}
|
|
2298
|
+
const regex = /^\d*\.?\d*$/;
|
|
2299
|
+
if (!regex.test(raw)) return;
|
|
2300
|
+
const parts = raw.split(".");
|
|
2301
|
+
const currentDecimals = decimals != null ? decimals : 2;
|
|
2302
|
+
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
2303
|
+
const asNumber = Number(raw);
|
|
2304
|
+
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
2305
|
+
const clamped = maxNumber;
|
|
2306
|
+
const formattedClamped = formatDecimalValue(
|
|
2307
|
+
clamped.toString(),
|
|
2308
|
+
currentDecimals
|
|
2309
|
+
);
|
|
2310
|
+
setInternalValue(formattedClamped);
|
|
2311
|
+
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
2312
|
+
if (onChange) {
|
|
2313
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2314
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
2315
|
+
});
|
|
2316
|
+
onChange(syntheticEvent);
|
|
2317
|
+
}
|
|
2318
|
+
return;
|
|
2319
|
+
}
|
|
2320
|
+
setInternalValue(raw);
|
|
2321
|
+
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2322
|
+
if (!isNaN(asNumber) && onChange) {
|
|
2323
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2324
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
2325
|
+
});
|
|
2326
|
+
onChange(syntheticEvent);
|
|
2327
|
+
}
|
|
2328
|
+
return;
|
|
2329
|
+
}
|
|
2281
2330
|
if (variant === "uom" && e.target.type === "number") {
|
|
2282
2331
|
const numeric = Number(rawValue);
|
|
2283
2332
|
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
@@ -2326,8 +2375,21 @@ var Input = (_a) => {
|
|
|
2326
2375
|
onChange(syntheticEvent);
|
|
2327
2376
|
}
|
|
2328
2377
|
} else if (variant === "uom") {
|
|
2329
|
-
|
|
2330
|
-
|
|
2378
|
+
if (currencyFormat) {
|
|
2379
|
+
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
2380
|
+
setInternalValue(formatted);
|
|
2381
|
+
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2382
|
+
const asNumber = Number(formatted);
|
|
2383
|
+
if (!isNaN(asNumber) && onChange) {
|
|
2384
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2385
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
2386
|
+
});
|
|
2387
|
+
onChange(syntheticEvent);
|
|
2388
|
+
}
|
|
2389
|
+
} else {
|
|
2390
|
+
const formattedValue = formatDecimalValue(e.target.value, decimals);
|
|
2391
|
+
e.target.value = formattedValue;
|
|
2392
|
+
}
|
|
2331
2393
|
}
|
|
2332
2394
|
onBlur == null ? void 0 : onBlur(e);
|
|
2333
2395
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
DataGrid,
|
|
4
4
|
DataGrid_default
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-PJQHRERH.js";
|
|
6
6
|
import "../../chunk-2UNLVJU5.js";
|
|
7
7
|
import "../../chunk-POZD6R3P.js";
|
|
8
8
|
import "../../chunk-M7INAUAJ.js";
|
|
@@ -23,7 +23,7 @@ import "../../chunk-7IPESTQS.js";
|
|
|
23
23
|
import "../../chunk-Z2HPSFEQ.js";
|
|
24
24
|
import "../../chunk-AT4AWD6B.js";
|
|
25
25
|
import "../../chunk-EWGHVZL5.js";
|
|
26
|
-
import "../../chunk-
|
|
26
|
+
import "../../chunk-IEKZBWVL.js";
|
|
27
27
|
import "../../chunk-I57U5THY.js";
|
|
28
28
|
import "../../chunk-KBIEWFQS.js";
|
|
29
29
|
import "../../chunk-NSZTJ5R4.js";
|
|
@@ -40,12 +40,12 @@ import "../../chunk-3IAXYRUR.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-FFCSDPXR.js";
|
|
44
44
|
import "../../chunk-OM7QLLI2.js";
|
|
45
45
|
import "../../chunk-PE3EZP56.js";
|
|
46
46
|
import "../../chunk-X3NDEFVA.js";
|
|
47
|
-
import "../../chunk-
|
|
48
|
-
import "../../chunk-
|
|
47
|
+
import "../../chunk-72WLEGGU.js";
|
|
48
|
+
import "../../chunk-NEMOTB6U.js";
|
|
49
49
|
import "../../chunk-HXGJVYGQ.js";
|
|
50
50
|
import "../../chunk-WVUIIBRR.js";
|
|
51
51
|
import "../../chunk-M7WHWZ2J.js";
|
|
@@ -2105,6 +2105,7 @@ var Input = (_a) => {
|
|
|
2105
2105
|
variant = "default",
|
|
2106
2106
|
decimals,
|
|
2107
2107
|
uom,
|
|
2108
|
+
currencyFormat = false,
|
|
2108
2109
|
removeSearchIcon,
|
|
2109
2110
|
value: propValue,
|
|
2110
2111
|
onChange,
|
|
@@ -2117,6 +2118,7 @@ var Input = (_a) => {
|
|
|
2117
2118
|
"variant",
|
|
2118
2119
|
"decimals",
|
|
2119
2120
|
"uom",
|
|
2121
|
+
"currencyFormat",
|
|
2120
2122
|
"removeSearchIcon",
|
|
2121
2123
|
"value",
|
|
2122
2124
|
"onChange",
|
|
@@ -2131,22 +2133,21 @@ var Input = (_a) => {
|
|
|
2131
2133
|
(0, import_react10.useEffect)(() => {
|
|
2132
2134
|
var _a2;
|
|
2133
2135
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
var _a2;
|
|
2139
|
-
if (variant !== "currency") {
|
|
2136
|
+
const shouldUseThousandsFormatting = variant === "currency" || variant === "uom" && currencyFormat;
|
|
2137
|
+
if (!stringValue) {
|
|
2138
|
+
setInternalValue("");
|
|
2139
|
+
setDisplayValue("");
|
|
2140
2140
|
return;
|
|
2141
2141
|
}
|
|
2142
|
-
|
|
2143
|
-
|
|
2142
|
+
if (!shouldUseThousandsFormatting) {
|
|
2143
|
+
setInternalValue(stringValue);
|
|
2144
|
+
setDisplayValue(stringValue);
|
|
2144
2145
|
return;
|
|
2145
2146
|
}
|
|
2146
2147
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2147
2148
|
setInternalValue(formatted);
|
|
2148
2149
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2149
|
-
}, []);
|
|
2150
|
+
}, [propValue, variant, currencyFormat, decimals]);
|
|
2150
2151
|
const getInputProps = () => {
|
|
2151
2152
|
var _a2;
|
|
2152
2153
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -2172,8 +2173,9 @@ var Input = (_a) => {
|
|
|
2172
2173
|
case "percentage":
|
|
2173
2174
|
case "uom":
|
|
2174
2175
|
return __spreadProps(__spreadValues({}, baseProps), {
|
|
2175
|
-
type: "number",
|
|
2176
|
-
align: "right"
|
|
2176
|
+
type: currencyFormat ? "text" : "number",
|
|
2177
|
+
align: "right",
|
|
2178
|
+
value: currencyFormat ? displayValue : propValue
|
|
2177
2179
|
});
|
|
2178
2180
|
default:
|
|
2179
2181
|
return baseProps;
|
|
@@ -2186,6 +2188,8 @@ var Input = (_a) => {
|
|
|
2186
2188
|
return !removeSearchIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "search" }) }) : null;
|
|
2187
2189
|
case "currency":
|
|
2188
2190
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "attach_money" }) });
|
|
2191
|
+
case "uom":
|
|
2192
|
+
return currencyFormat ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "attach_money" }) }) : null;
|
|
2189
2193
|
default:
|
|
2190
2194
|
return null;
|
|
2191
2195
|
}
|
|
@@ -2277,6 +2281,51 @@ var Input = (_a) => {
|
|
|
2277
2281
|
}
|
|
2278
2282
|
return;
|
|
2279
2283
|
}
|
|
2284
|
+
if (variant === "uom" && currencyFormat) {
|
|
2285
|
+
const raw = rawValue.replace(/,/g, "");
|
|
2286
|
+
if (raw === "") {
|
|
2287
|
+
setInternalValue("");
|
|
2288
|
+
setDisplayValue("");
|
|
2289
|
+
if (onChange) {
|
|
2290
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2291
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
2292
|
+
});
|
|
2293
|
+
onChange(syntheticEvent);
|
|
2294
|
+
}
|
|
2295
|
+
return;
|
|
2296
|
+
}
|
|
2297
|
+
const regex = /^\d*\.?\d*$/;
|
|
2298
|
+
if (!regex.test(raw)) return;
|
|
2299
|
+
const parts = raw.split(".");
|
|
2300
|
+
const currentDecimals = decimals != null ? decimals : 2;
|
|
2301
|
+
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
2302
|
+
const asNumber = Number(raw);
|
|
2303
|
+
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
2304
|
+
const clamped = maxNumber;
|
|
2305
|
+
const formattedClamped = formatDecimalValue(
|
|
2306
|
+
clamped.toString(),
|
|
2307
|
+
currentDecimals
|
|
2308
|
+
);
|
|
2309
|
+
setInternalValue(formattedClamped);
|
|
2310
|
+
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
2311
|
+
if (onChange) {
|
|
2312
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2313
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
2314
|
+
});
|
|
2315
|
+
onChange(syntheticEvent);
|
|
2316
|
+
}
|
|
2317
|
+
return;
|
|
2318
|
+
}
|
|
2319
|
+
setInternalValue(raw);
|
|
2320
|
+
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2321
|
+
if (!isNaN(asNumber) && onChange) {
|
|
2322
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2323
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
2324
|
+
});
|
|
2325
|
+
onChange(syntheticEvent);
|
|
2326
|
+
}
|
|
2327
|
+
return;
|
|
2328
|
+
}
|
|
2280
2329
|
if (variant === "uom" && e.target.type === "number") {
|
|
2281
2330
|
const numeric = Number(rawValue);
|
|
2282
2331
|
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
@@ -2325,8 +2374,21 @@ var Input = (_a) => {
|
|
|
2325
2374
|
onChange(syntheticEvent);
|
|
2326
2375
|
}
|
|
2327
2376
|
} else if (variant === "uom") {
|
|
2328
|
-
|
|
2329
|
-
|
|
2377
|
+
if (currencyFormat) {
|
|
2378
|
+
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
2379
|
+
setInternalValue(formatted);
|
|
2380
|
+
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2381
|
+
const asNumber = Number(formatted);
|
|
2382
|
+
if (!isNaN(asNumber) && onChange) {
|
|
2383
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2384
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
2385
|
+
});
|
|
2386
|
+
onChange(syntheticEvent);
|
|
2387
|
+
}
|
|
2388
|
+
} else {
|
|
2389
|
+
const formattedValue = formatDecimalValue(e.target.value, decimals);
|
|
2390
|
+
e.target.value = formattedValue;
|
|
2391
|
+
}
|
|
2330
2392
|
}
|
|
2331
2393
|
onBlur == null ? void 0 : onBlur(e);
|
|
2332
2394
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSortIcon
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-PJQHRERH.js";
|
|
4
4
|
import "../../chunk-2UNLVJU5.js";
|
|
5
5
|
import "../../chunk-POZD6R3P.js";
|
|
6
6
|
import "../../chunk-M7INAUAJ.js";
|
|
@@ -21,7 +21,7 @@ import "../../chunk-7IPESTQS.js";
|
|
|
21
21
|
import "../../chunk-Z2HPSFEQ.js";
|
|
22
22
|
import "../../chunk-AT4AWD6B.js";
|
|
23
23
|
import "../../chunk-EWGHVZL5.js";
|
|
24
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-IEKZBWVL.js";
|
|
25
25
|
import "../../chunk-I57U5THY.js";
|
|
26
26
|
import "../../chunk-KBIEWFQS.js";
|
|
27
27
|
import "../../chunk-NSZTJ5R4.js";
|
|
@@ -38,12 +38,12 @@ import "../../chunk-3IAXYRUR.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-FFCSDPXR.js";
|
|
42
42
|
import "../../chunk-OM7QLLI2.js";
|
|
43
43
|
import "../../chunk-PE3EZP56.js";
|
|
44
44
|
import "../../chunk-X3NDEFVA.js";
|
|
45
|
-
import "../../chunk-
|
|
46
|
-
import "../../chunk-
|
|
45
|
+
import "../../chunk-72WLEGGU.js";
|
|
46
|
+
import "../../chunk-NEMOTB6U.js";
|
|
47
47
|
import "../../chunk-HXGJVYGQ.js";
|
|
48
48
|
import "../../chunk-WVUIIBRR.js";
|
|
49
49
|
import "../../chunk-M7WHWZ2J.js";
|