@dmsi/wedgekit-react 0.0.1009 → 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
|
@@ -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
|
ColumnSelectorHeaderCell
|
|
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
|
PinnedColumns
|
|
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";
|
|
@@ -2104,6 +2104,7 @@ var Input = (_a) => {
|
|
|
2104
2104
|
variant = "default",
|
|
2105
2105
|
decimals,
|
|
2106
2106
|
uom,
|
|
2107
|
+
currencyFormat = false,
|
|
2107
2108
|
removeSearchIcon,
|
|
2108
2109
|
value: propValue,
|
|
2109
2110
|
onChange,
|
|
@@ -2116,6 +2117,7 @@ var Input = (_a) => {
|
|
|
2116
2117
|
"variant",
|
|
2117
2118
|
"decimals",
|
|
2118
2119
|
"uom",
|
|
2120
|
+
"currencyFormat",
|
|
2119
2121
|
"removeSearchIcon",
|
|
2120
2122
|
"value",
|
|
2121
2123
|
"onChange",
|
|
@@ -2130,22 +2132,21 @@ var Input = (_a) => {
|
|
|
2130
2132
|
(0, import_react10.useEffect)(() => {
|
|
2131
2133
|
var _a2;
|
|
2132
2134
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
var _a2;
|
|
2138
|
-
if (variant !== "currency") {
|
|
2135
|
+
const shouldUseThousandsFormatting = variant === "currency" || variant === "uom" && currencyFormat;
|
|
2136
|
+
if (!stringValue) {
|
|
2137
|
+
setInternalValue("");
|
|
2138
|
+
setDisplayValue("");
|
|
2139
2139
|
return;
|
|
2140
2140
|
}
|
|
2141
|
-
|
|
2142
|
-
|
|
2141
|
+
if (!shouldUseThousandsFormatting) {
|
|
2142
|
+
setInternalValue(stringValue);
|
|
2143
|
+
setDisplayValue(stringValue);
|
|
2143
2144
|
return;
|
|
2144
2145
|
}
|
|
2145
2146
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2146
2147
|
setInternalValue(formatted);
|
|
2147
2148
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2148
|
-
}, []);
|
|
2149
|
+
}, [propValue, variant, currencyFormat, decimals]);
|
|
2149
2150
|
const getInputProps = () => {
|
|
2150
2151
|
var _a2;
|
|
2151
2152
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -2171,8 +2172,9 @@ var Input = (_a) => {
|
|
|
2171
2172
|
case "percentage":
|
|
2172
2173
|
case "uom":
|
|
2173
2174
|
return __spreadProps(__spreadValues({}, baseProps), {
|
|
2174
|
-
type: "number",
|
|
2175
|
-
align: "right"
|
|
2175
|
+
type: currencyFormat ? "text" : "number",
|
|
2176
|
+
align: "right",
|
|
2177
|
+
value: currencyFormat ? displayValue : propValue
|
|
2176
2178
|
});
|
|
2177
2179
|
default:
|
|
2178
2180
|
return baseProps;
|
|
@@ -2185,6 +2187,8 @@ var Input = (_a) => {
|
|
|
2185
2187
|
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;
|
|
2186
2188
|
case "currency":
|
|
2187
2189
|
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" }) });
|
|
2190
|
+
case "uom":
|
|
2191
|
+
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;
|
|
2188
2192
|
default:
|
|
2189
2193
|
return null;
|
|
2190
2194
|
}
|
|
@@ -2276,6 +2280,51 @@ var Input = (_a) => {
|
|
|
2276
2280
|
}
|
|
2277
2281
|
return;
|
|
2278
2282
|
}
|
|
2283
|
+
if (variant === "uom" && currencyFormat) {
|
|
2284
|
+
const raw = rawValue.replace(/,/g, "");
|
|
2285
|
+
if (raw === "") {
|
|
2286
|
+
setInternalValue("");
|
|
2287
|
+
setDisplayValue("");
|
|
2288
|
+
if (onChange) {
|
|
2289
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2290
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
2291
|
+
});
|
|
2292
|
+
onChange(syntheticEvent);
|
|
2293
|
+
}
|
|
2294
|
+
return;
|
|
2295
|
+
}
|
|
2296
|
+
const regex = /^\d*\.?\d*$/;
|
|
2297
|
+
if (!regex.test(raw)) return;
|
|
2298
|
+
const parts = raw.split(".");
|
|
2299
|
+
const currentDecimals = decimals != null ? decimals : 2;
|
|
2300
|
+
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
2301
|
+
const asNumber = Number(raw);
|
|
2302
|
+
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
2303
|
+
const clamped = maxNumber;
|
|
2304
|
+
const formattedClamped = formatDecimalValue(
|
|
2305
|
+
clamped.toString(),
|
|
2306
|
+
currentDecimals
|
|
2307
|
+
);
|
|
2308
|
+
setInternalValue(formattedClamped);
|
|
2309
|
+
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
2310
|
+
if (onChange) {
|
|
2311
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2312
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
2313
|
+
});
|
|
2314
|
+
onChange(syntheticEvent);
|
|
2315
|
+
}
|
|
2316
|
+
return;
|
|
2317
|
+
}
|
|
2318
|
+
setInternalValue(raw);
|
|
2319
|
+
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2320
|
+
if (!isNaN(asNumber) && onChange) {
|
|
2321
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2322
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
2323
|
+
});
|
|
2324
|
+
onChange(syntheticEvent);
|
|
2325
|
+
}
|
|
2326
|
+
return;
|
|
2327
|
+
}
|
|
2279
2328
|
if (variant === "uom" && e.target.type === "number") {
|
|
2280
2329
|
const numeric = Number(rawValue);
|
|
2281
2330
|
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
@@ -2324,8 +2373,21 @@ var Input = (_a) => {
|
|
|
2324
2373
|
onChange(syntheticEvent);
|
|
2325
2374
|
}
|
|
2326
2375
|
} else if (variant === "uom") {
|
|
2327
|
-
|
|
2328
|
-
|
|
2376
|
+
if (currencyFormat) {
|
|
2377
|
+
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
2378
|
+
setInternalValue(formatted);
|
|
2379
|
+
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2380
|
+
const asNumber = Number(formatted);
|
|
2381
|
+
if (!isNaN(asNumber) && onChange) {
|
|
2382
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2383
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
2384
|
+
});
|
|
2385
|
+
onChange(syntheticEvent);
|
|
2386
|
+
}
|
|
2387
|
+
} else {
|
|
2388
|
+
const formattedValue = formatDecimalValue(e.target.value, decimals);
|
|
2389
|
+
e.target.value = formattedValue;
|
|
2390
|
+
}
|
|
2329
2391
|
}
|
|
2330
2392
|
onBlur == null ? void 0 : onBlur(e);
|
|
2331
2393
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LoadingCell
|
|
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";
|
|
@@ -2107,6 +2107,7 @@ var Input = (_a) => {
|
|
|
2107
2107
|
variant = "default",
|
|
2108
2108
|
decimals,
|
|
2109
2109
|
uom,
|
|
2110
|
+
currencyFormat = false,
|
|
2110
2111
|
removeSearchIcon,
|
|
2111
2112
|
value: propValue,
|
|
2112
2113
|
onChange,
|
|
@@ -2119,6 +2120,7 @@ var Input = (_a) => {
|
|
|
2119
2120
|
"variant",
|
|
2120
2121
|
"decimals",
|
|
2121
2122
|
"uom",
|
|
2123
|
+
"currencyFormat",
|
|
2122
2124
|
"removeSearchIcon",
|
|
2123
2125
|
"value",
|
|
2124
2126
|
"onChange",
|
|
@@ -2133,22 +2135,21 @@ var Input = (_a) => {
|
|
|
2133
2135
|
(0, import_react10.useEffect)(() => {
|
|
2134
2136
|
var _a2;
|
|
2135
2137
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
var _a2;
|
|
2141
|
-
if (variant !== "currency") {
|
|
2138
|
+
const shouldUseThousandsFormatting = variant === "currency" || variant === "uom" && currencyFormat;
|
|
2139
|
+
if (!stringValue) {
|
|
2140
|
+
setInternalValue("");
|
|
2141
|
+
setDisplayValue("");
|
|
2142
2142
|
return;
|
|
2143
2143
|
}
|
|
2144
|
-
|
|
2145
|
-
|
|
2144
|
+
if (!shouldUseThousandsFormatting) {
|
|
2145
|
+
setInternalValue(stringValue);
|
|
2146
|
+
setDisplayValue(stringValue);
|
|
2146
2147
|
return;
|
|
2147
2148
|
}
|
|
2148
2149
|
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2149
2150
|
setInternalValue(formatted);
|
|
2150
2151
|
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2151
|
-
}, []);
|
|
2152
|
+
}, [propValue, variant, currencyFormat, decimals]);
|
|
2152
2153
|
const getInputProps = () => {
|
|
2153
2154
|
var _a2;
|
|
2154
2155
|
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
@@ -2174,8 +2175,9 @@ var Input = (_a) => {
|
|
|
2174
2175
|
case "percentage":
|
|
2175
2176
|
case "uom":
|
|
2176
2177
|
return __spreadProps(__spreadValues({}, baseProps), {
|
|
2177
|
-
type: "number",
|
|
2178
|
-
align: "right"
|
|
2178
|
+
type: currencyFormat ? "text" : "number",
|
|
2179
|
+
align: "right",
|
|
2180
|
+
value: currencyFormat ? displayValue : propValue
|
|
2179
2181
|
});
|
|
2180
2182
|
default:
|
|
2181
2183
|
return baseProps;
|
|
@@ -2188,6 +2190,8 @@ var Input = (_a) => {
|
|
|
2188
2190
|
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;
|
|
2189
2191
|
case "currency":
|
|
2190
2192
|
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" }) });
|
|
2193
|
+
case "uom":
|
|
2194
|
+
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;
|
|
2191
2195
|
default:
|
|
2192
2196
|
return null;
|
|
2193
2197
|
}
|
|
@@ -2279,6 +2283,51 @@ var Input = (_a) => {
|
|
|
2279
2283
|
}
|
|
2280
2284
|
return;
|
|
2281
2285
|
}
|
|
2286
|
+
if (variant === "uom" && currencyFormat) {
|
|
2287
|
+
const raw = rawValue.replace(/,/g, "");
|
|
2288
|
+
if (raw === "") {
|
|
2289
|
+
setInternalValue("");
|
|
2290
|
+
setDisplayValue("");
|
|
2291
|
+
if (onChange) {
|
|
2292
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2293
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
2294
|
+
});
|
|
2295
|
+
onChange(syntheticEvent);
|
|
2296
|
+
}
|
|
2297
|
+
return;
|
|
2298
|
+
}
|
|
2299
|
+
const regex = /^\d*\.?\d*$/;
|
|
2300
|
+
if (!regex.test(raw)) return;
|
|
2301
|
+
const parts = raw.split(".");
|
|
2302
|
+
const currentDecimals = decimals != null ? decimals : 2;
|
|
2303
|
+
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
2304
|
+
const asNumber = Number(raw);
|
|
2305
|
+
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
2306
|
+
const clamped = maxNumber;
|
|
2307
|
+
const formattedClamped = formatDecimalValue(
|
|
2308
|
+
clamped.toString(),
|
|
2309
|
+
currentDecimals
|
|
2310
|
+
);
|
|
2311
|
+
setInternalValue(formattedClamped);
|
|
2312
|
+
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
2313
|
+
if (onChange) {
|
|
2314
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2315
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
2316
|
+
});
|
|
2317
|
+
onChange(syntheticEvent);
|
|
2318
|
+
}
|
|
2319
|
+
return;
|
|
2320
|
+
}
|
|
2321
|
+
setInternalValue(raw);
|
|
2322
|
+
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2323
|
+
if (!isNaN(asNumber) && onChange) {
|
|
2324
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2325
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
2326
|
+
});
|
|
2327
|
+
onChange(syntheticEvent);
|
|
2328
|
+
}
|
|
2329
|
+
return;
|
|
2330
|
+
}
|
|
2282
2331
|
if (variant === "uom" && e.target.type === "number") {
|
|
2283
2332
|
const numeric = Number(rawValue);
|
|
2284
2333
|
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
@@ -2327,8 +2376,21 @@ var Input = (_a) => {
|
|
|
2327
2376
|
onChange(syntheticEvent);
|
|
2328
2377
|
}
|
|
2329
2378
|
} else if (variant === "uom") {
|
|
2330
|
-
|
|
2331
|
-
|
|
2379
|
+
if (currencyFormat) {
|
|
2380
|
+
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
2381
|
+
setInternalValue(formatted);
|
|
2382
|
+
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2383
|
+
const asNumber = Number(formatted);
|
|
2384
|
+
if (!isNaN(asNumber) && onChange) {
|
|
2385
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2386
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
2387
|
+
});
|
|
2388
|
+
onChange(syntheticEvent);
|
|
2389
|
+
}
|
|
2390
|
+
} else {
|
|
2391
|
+
const formattedValue = formatDecimalValue(e.target.value, decimals);
|
|
2392
|
+
e.target.value = formattedValue;
|
|
2393
|
+
}
|
|
2332
2394
|
}
|
|
2333
2395
|
onBlur == null ? void 0 : onBlur(e);
|
|
2334
2396
|
};
|