@dmsi/wedgekit-react 0.0.1248 → 0.0.1250
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-MOBFZ672.js → chunk-3DJWSTPS.js} +1 -1
- package/dist/{chunk-5UPADXVU.js → chunk-3V5OMIYB.js} +6 -6
- package/dist/{chunk-EA6Y4HXQ.js → chunk-4FUZDLWX.js} +1 -1
- package/dist/{chunk-PABII472.js → chunk-H5SHC4XZ.js} +40 -33
- package/dist/{chunk-MAEVKATN.js → chunk-HRPW6VXG.js} +1 -1
- package/dist/{chunk-OG2PGA3X.js → chunk-JYECZBCJ.js} +1 -1
- package/dist/{chunk-PBJ2MEHM.js → chunk-QW4AJ5FK.js} +1 -1
- package/dist/{chunk-I3W5K76C.js → chunk-RN465M4S.js} +1 -1
- package/dist/components/CalendarRange.cjs +41 -34
- package/dist/components/CalendarRange.css +3 -0
- package/dist/components/CalendarRange.js +8 -8
- package/dist/components/Checkbox.cjs +1 -1
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +41 -34
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +3 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +8 -8
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +41 -34
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +3 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +8 -8
- package/dist/components/DataGrid/PinnedColumns.cjs +41 -34
- package/dist/components/DataGrid/PinnedColumns.css +3 -0
- package/dist/components/DataGrid/PinnedColumns.js +8 -8
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +41 -34
- package/dist/components/DataGrid/TableBody/LoadingCell.css +3 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.js +8 -8
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +41 -34
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +3 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +8 -8
- package/dist/components/DataGrid/TableBody/index.cjs +41 -34
- package/dist/components/DataGrid/TableBody/index.css +3 -0
- package/dist/components/DataGrid/TableBody/index.js +8 -8
- package/dist/components/DataGrid/index.cjs +41 -34
- package/dist/components/DataGrid/index.css +3 -0
- package/dist/components/DataGrid/index.js +8 -8
- package/dist/components/DataGrid/utils.cjs +41 -34
- package/dist/components/DataGrid/utils.css +3 -0
- package/dist/components/DataGrid/utils.js +8 -8
- package/dist/components/DataGridCell.cjs +40 -33
- package/dist/components/DataGridCell.js +3 -3
- package/dist/components/DateInput.cjs +41 -34
- package/dist/components/DateInput.css +3 -0
- package/dist/components/DateInput.js +8 -8
- package/dist/components/DateRangeInput.cjs +41 -34
- package/dist/components/DateRangeInput.css +3 -0
- package/dist/components/DateRangeInput.js +8 -8
- package/dist/components/FilterGroup.cjs +41 -34
- package/dist/components/FilterGroup.js +3 -3
- package/dist/components/Input.cjs +40 -33
- package/dist/components/Input.js +1 -1
- package/dist/components/MobileDataGrid/ColumnList.cjs +1 -1
- package/dist/components/MobileDataGrid/ColumnList.css +3 -0
- package/dist/components/MobileDataGrid/ColumnList.js +3 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +41 -34
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +3 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +8 -8
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +1 -1
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +41 -34
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +3 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +8 -8
- package/dist/components/MobileDataGrid/index.cjs +41 -34
- package/dist/components/MobileDataGrid/index.css +3 -0
- package/dist/components/MobileDataGrid/index.js +8 -8
- package/dist/components/Password.cjs +40 -33
- package/dist/components/Password.js +1 -1
- package/dist/components/Search.cjs +40 -33
- package/dist/components/Search.js +2 -2
- package/dist/components/Select.cjs +40 -33
- package/dist/components/Select.js +2 -2
- package/dist/components/Stepper.cjs +40 -33
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Time.cjs +40 -33
- package/dist/components/Time.js +1 -1
- package/dist/components/index.cjs +41 -34
- package/dist/components/index.css +3 -0
- package/dist/components/index.js +8 -8
- package/dist/index.css +3 -0
- package/package.json +1 -1
|
@@ -1945,6 +1945,14 @@ var import_react11 = require("react");
|
|
|
1945
1945
|
var import_react10 = require("react");
|
|
1946
1946
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1947
1947
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1948
|
+
function hasEquivalentNumericValue(currentValue, nextValue) {
|
|
1949
|
+
if (!currentValue || !nextValue) {
|
|
1950
|
+
return false;
|
|
1951
|
+
}
|
|
1952
|
+
const currentNumericValue = Number(currentValue.replace(/,/g, ""));
|
|
1953
|
+
const nextNumericValue = Number(nextValue.replace(/,/g, ""));
|
|
1954
|
+
return !Number.isNaN(currentNumericValue) && !Number.isNaN(nextNumericValue) && currentNumericValue === nextNumericValue;
|
|
1955
|
+
}
|
|
1948
1956
|
var InputBase = (_a) => {
|
|
1949
1957
|
var _b = _a, {
|
|
1950
1958
|
id,
|
|
@@ -2167,28 +2175,33 @@ var Input = (_a) => {
|
|
|
2167
2175
|
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
2168
2176
|
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
2169
2177
|
const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
|
|
2178
|
+
const internalValueRef = (0, import_react10.useRef)("");
|
|
2179
|
+
const setInputValues = (nextInternalValue, nextDisplayValue) => {
|
|
2180
|
+
internalValueRef.current = nextInternalValue;
|
|
2181
|
+
setInternalValue(nextInternalValue);
|
|
2182
|
+
setDisplayValue(nextDisplayValue);
|
|
2183
|
+
};
|
|
2170
2184
|
(0, import_react10.useEffect)(() => {
|
|
2171
2185
|
var _a2;
|
|
2172
2186
|
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
2173
2187
|
const shouldUseThousandsFormatting = variant === "currency" || variant === "uom" && currencyFormat;
|
|
2174
2188
|
if (!stringValue) {
|
|
2175
|
-
|
|
2176
|
-
setDisplayValue("");
|
|
2189
|
+
setInputValues("", "");
|
|
2177
2190
|
return;
|
|
2178
2191
|
}
|
|
2179
2192
|
if (!shouldUseThousandsFormatting) {
|
|
2180
|
-
|
|
2181
|
-
|
|
2193
|
+
setInputValues(stringValue, stringValue);
|
|
2194
|
+
return;
|
|
2195
|
+
}
|
|
2196
|
+
if (isFocused && hasEquivalentNumericValue(internalValueRef.current, stringValue)) {
|
|
2182
2197
|
return;
|
|
2183
2198
|
}
|
|
2184
|
-
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2185
2199
|
if (formatOnBlur && isFocused) {
|
|
2186
|
-
|
|
2187
|
-
setDisplayValue(stringValue);
|
|
2200
|
+
setInputValues(stringValue, stringValue);
|
|
2188
2201
|
return;
|
|
2189
2202
|
}
|
|
2190
|
-
|
|
2191
|
-
|
|
2203
|
+
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
2204
|
+
setInputValues(formatted, formatCurrencyDisplay(formatted));
|
|
2192
2205
|
}, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
|
|
2193
2206
|
const getInputProps = () => {
|
|
2194
2207
|
var _a2;
|
|
@@ -2210,6 +2223,7 @@ var Input = (_a) => {
|
|
|
2210
2223
|
return __spreadProps(__spreadValues({}, baseProps), {
|
|
2211
2224
|
align: "right",
|
|
2212
2225
|
type: "text",
|
|
2226
|
+
inputMode: "decimal",
|
|
2213
2227
|
value: displayValue
|
|
2214
2228
|
});
|
|
2215
2229
|
case "percentage":
|
|
@@ -2217,6 +2231,7 @@ var Input = (_a) => {
|
|
|
2217
2231
|
return __spreadProps(__spreadValues({}, baseProps), {
|
|
2218
2232
|
type: currencyFormat ? "text" : "number",
|
|
2219
2233
|
align: "right",
|
|
2234
|
+
inputMode: currencyFormat ? "decimal" : void 0,
|
|
2220
2235
|
value: currencyFormat ? displayValue : propValue
|
|
2221
2236
|
});
|
|
2222
2237
|
default:
|
|
@@ -2263,8 +2278,7 @@ var Input = (_a) => {
|
|
|
2263
2278
|
}
|
|
2264
2279
|
};
|
|
2265
2280
|
const handleSearchReset = () => {
|
|
2266
|
-
|
|
2267
|
-
setDisplayValue("");
|
|
2281
|
+
setInputValues("", "");
|
|
2268
2282
|
if (onChange) {
|
|
2269
2283
|
const syntheticEvent = {
|
|
2270
2284
|
target: { value: "" }
|
|
@@ -2281,8 +2295,7 @@ var Input = (_a) => {
|
|
|
2281
2295
|
if (variant === "currency") {
|
|
2282
2296
|
const raw = rawValue.replace(/,/g, "");
|
|
2283
2297
|
if (raw === "") {
|
|
2284
|
-
|
|
2285
|
-
setDisplayValue("");
|
|
2298
|
+
setInputValues("", "");
|
|
2286
2299
|
if (onChange) {
|
|
2287
2300
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2288
2301
|
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
@@ -2303,8 +2316,8 @@ var Input = (_a) => {
|
|
|
2303
2316
|
clamped.toString(),
|
|
2304
2317
|
currentDecimals
|
|
2305
2318
|
);
|
|
2306
|
-
|
|
2307
|
-
|
|
2319
|
+
setInputValues(
|
|
2320
|
+
formattedClamped,
|
|
2308
2321
|
formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
|
|
2309
2322
|
);
|
|
2310
2323
|
if (onChange) {
|
|
@@ -2315,8 +2328,7 @@ var Input = (_a) => {
|
|
|
2315
2328
|
}
|
|
2316
2329
|
return;
|
|
2317
2330
|
}
|
|
2318
|
-
|
|
2319
|
-
setDisplayValue(formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
2331
|
+
setInputValues(raw, formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
2320
2332
|
if (!isNaN(asNumber) && onChange) {
|
|
2321
2333
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2322
2334
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -2328,8 +2340,7 @@ var Input = (_a) => {
|
|
|
2328
2340
|
if (variant === "uom" && currencyFormat) {
|
|
2329
2341
|
const raw = rawValue.replace(/,/g, "");
|
|
2330
2342
|
if (raw === "") {
|
|
2331
|
-
|
|
2332
|
-
setDisplayValue("");
|
|
2343
|
+
setInputValues("", "");
|
|
2333
2344
|
if (onChange) {
|
|
2334
2345
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2335
2346
|
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
@@ -2350,8 +2361,10 @@ var Input = (_a) => {
|
|
|
2350
2361
|
clamped.toString(),
|
|
2351
2362
|
currentDecimals
|
|
2352
2363
|
);
|
|
2353
|
-
|
|
2354
|
-
|
|
2364
|
+
setInputValues(
|
|
2365
|
+
formattedClamped,
|
|
2366
|
+
formatCurrencyDisplay(formattedClamped)
|
|
2367
|
+
);
|
|
2355
2368
|
if (onChange) {
|
|
2356
2369
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2357
2370
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -2360,8 +2373,7 @@ var Input = (_a) => {
|
|
|
2360
2373
|
}
|
|
2361
2374
|
return;
|
|
2362
2375
|
}
|
|
2363
|
-
|
|
2364
|
-
setDisplayValue(formatCurrencyDisplay(raw));
|
|
2376
|
+
setInputValues(raw, formatCurrencyDisplay(raw));
|
|
2365
2377
|
if (!isNaN(asNumber) && onChange) {
|
|
2366
2378
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2367
2379
|
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
@@ -2378,8 +2390,7 @@ var Input = (_a) => {
|
|
|
2378
2390
|
clamped.toString(),
|
|
2379
2391
|
decimals != null ? decimals : 0
|
|
2380
2392
|
);
|
|
2381
|
-
|
|
2382
|
-
setDisplayValue(formattedClamped);
|
|
2393
|
+
setInputValues(formattedClamped, formattedClamped);
|
|
2383
2394
|
if (typeof onChange === "function") {
|
|
2384
2395
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
2385
2396
|
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
@@ -2388,15 +2399,13 @@ var Input = (_a) => {
|
|
|
2388
2399
|
}
|
|
2389
2400
|
return;
|
|
2390
2401
|
}
|
|
2391
|
-
|
|
2392
|
-
setDisplayValue(rawValue);
|
|
2402
|
+
setInputValues(rawValue, rawValue);
|
|
2393
2403
|
if (typeof onChange === "function") {
|
|
2394
2404
|
onChange(e);
|
|
2395
2405
|
}
|
|
2396
2406
|
return;
|
|
2397
2407
|
}
|
|
2398
|
-
|
|
2399
|
-
setDisplayValue(rawValue);
|
|
2408
|
+
setInputValues(rawValue, rawValue);
|
|
2400
2409
|
if (typeof onChange === "function") {
|
|
2401
2410
|
onChange(e);
|
|
2402
2411
|
}
|
|
@@ -2409,8 +2418,7 @@ var Input = (_a) => {
|
|
|
2409
2418
|
}
|
|
2410
2419
|
if (variant === "currency") {
|
|
2411
2420
|
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
2412
|
-
|
|
2413
|
-
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2421
|
+
setInputValues(formatted, formatCurrencyDisplay(formatted));
|
|
2414
2422
|
const asNumber = Number(formatted);
|
|
2415
2423
|
if (!isNaN(asNumber) && onChange) {
|
|
2416
2424
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
@@ -2421,8 +2429,7 @@ var Input = (_a) => {
|
|
|
2421
2429
|
} else if (variant === "uom") {
|
|
2422
2430
|
if (currencyFormat) {
|
|
2423
2431
|
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
2424
|
-
|
|
2425
|
-
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
2432
|
+
setInputValues(formatted, formatCurrencyDisplay(formatted));
|
|
2426
2433
|
const asNumber = Number(formatted);
|
|
2427
2434
|
if (!isNaN(asNumber) && onChange) {
|
|
2428
2435
|
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
@@ -4448,7 +4455,7 @@ var Checkbox = (_a) => {
|
|
|
4448
4455
|
as: "span",
|
|
4449
4456
|
padded: true,
|
|
4450
4457
|
className: (0, import_clsx17.default)(
|
|
4451
|
-
"text-nowrap",
|
|
4458
|
+
!(paragraphClassName == null ? void 0 : paragraphClassName.includes("text-wrap")) && "text-nowrap",
|
|
4452
4459
|
disabled && !error && "!text-text-primary-disabled",
|
|
4453
4460
|
error && !disabled && !readOnly && "!text-text-primary-error",
|
|
4454
4461
|
paragraphClassName
|
package/dist/components/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DataGrid,
|
|
3
3
|
DateInput,
|
|
4
4
|
MobileDataGrid
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-3V5OMIYB.js";
|
|
6
6
|
import "../chunk-3UPUZBP5.js";
|
|
7
7
|
import "../chunk-7ZJIGTFN.js";
|
|
8
8
|
import "../chunk-E3FOCECQ.js";
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
EmblaCarousel
|
|
22
22
|
} from "../chunk-YULGJORA.js";
|
|
23
23
|
import "../chunk-Z2HPSFEQ.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-HRPW6VXG.js";
|
|
25
|
+
import "../chunk-JYECZBCJ.js";
|
|
26
26
|
import {
|
|
27
27
|
useGridContext
|
|
28
28
|
} from "../chunk-5IFPG6TS.js";
|
|
@@ -33,7 +33,7 @@ import "../chunk-EWGHVZL5.js";
|
|
|
33
33
|
import "../chunk-AT4AWD6B.js";
|
|
34
34
|
import {
|
|
35
35
|
Select
|
|
36
|
-
} from "../chunk-
|
|
36
|
+
} from "../chunk-4FUZDLWX.js";
|
|
37
37
|
import {
|
|
38
38
|
SimpleTable
|
|
39
39
|
} from "../chunk-CIYLALYO.js";
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
DataGridCell,
|
|
72
72
|
DragAlongCell,
|
|
73
73
|
DraggableCellHeader
|
|
74
|
-
} from "../chunk-
|
|
74
|
+
} from "../chunk-QW4AJ5FK.js";
|
|
75
75
|
import {
|
|
76
76
|
MenuOption
|
|
77
77
|
} from "../chunk-3JUIYULW.js";
|
|
@@ -81,17 +81,17 @@ import {
|
|
|
81
81
|
import "../chunk-PE3EZP56.js";
|
|
82
82
|
import {
|
|
83
83
|
Search
|
|
84
|
-
} from "../chunk-
|
|
84
|
+
} from "../chunk-3DJWSTPS.js";
|
|
85
85
|
import {
|
|
86
86
|
Input
|
|
87
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-H5SHC4XZ.js";
|
|
88
88
|
import {
|
|
89
89
|
Label
|
|
90
90
|
} from "../chunk-4UGMSWWA.js";
|
|
91
91
|
import "../chunk-WVUIIBRR.js";
|
|
92
92
|
import {
|
|
93
93
|
Checkbox
|
|
94
|
-
} from "../chunk-
|
|
94
|
+
} from "../chunk-RN465M4S.js";
|
|
95
95
|
import {
|
|
96
96
|
CompactImagesPreview
|
|
97
97
|
} from "../chunk-Z5YP2GI6.js";
|
package/dist/index.css
CHANGED