@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.
Files changed (78) hide show
  1. package/dist/{chunk-MOBFZ672.js → chunk-3DJWSTPS.js} +1 -1
  2. package/dist/{chunk-5UPADXVU.js → chunk-3V5OMIYB.js} +6 -6
  3. package/dist/{chunk-EA6Y4HXQ.js → chunk-4FUZDLWX.js} +1 -1
  4. package/dist/{chunk-PABII472.js → chunk-H5SHC4XZ.js} +40 -33
  5. package/dist/{chunk-MAEVKATN.js → chunk-HRPW6VXG.js} +1 -1
  6. package/dist/{chunk-OG2PGA3X.js → chunk-JYECZBCJ.js} +1 -1
  7. package/dist/{chunk-PBJ2MEHM.js → chunk-QW4AJ5FK.js} +1 -1
  8. package/dist/{chunk-I3W5K76C.js → chunk-RN465M4S.js} +1 -1
  9. package/dist/components/CalendarRange.cjs +41 -34
  10. package/dist/components/CalendarRange.css +3 -0
  11. package/dist/components/CalendarRange.js +8 -8
  12. package/dist/components/Checkbox.cjs +1 -1
  13. package/dist/components/Checkbox.js +1 -1
  14. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +41 -34
  15. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +3 -0
  16. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +8 -8
  17. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +41 -34
  18. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +3 -0
  19. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +8 -8
  20. package/dist/components/DataGrid/PinnedColumns.cjs +41 -34
  21. package/dist/components/DataGrid/PinnedColumns.css +3 -0
  22. package/dist/components/DataGrid/PinnedColumns.js +8 -8
  23. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +41 -34
  24. package/dist/components/DataGrid/TableBody/LoadingCell.css +3 -0
  25. package/dist/components/DataGrid/TableBody/LoadingCell.js +8 -8
  26. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +41 -34
  27. package/dist/components/DataGrid/TableBody/TableBodyRow.css +3 -0
  28. package/dist/components/DataGrid/TableBody/TableBodyRow.js +8 -8
  29. package/dist/components/DataGrid/TableBody/index.cjs +41 -34
  30. package/dist/components/DataGrid/TableBody/index.css +3 -0
  31. package/dist/components/DataGrid/TableBody/index.js +8 -8
  32. package/dist/components/DataGrid/index.cjs +41 -34
  33. package/dist/components/DataGrid/index.css +3 -0
  34. package/dist/components/DataGrid/index.js +8 -8
  35. package/dist/components/DataGrid/utils.cjs +41 -34
  36. package/dist/components/DataGrid/utils.css +3 -0
  37. package/dist/components/DataGrid/utils.js +8 -8
  38. package/dist/components/DataGridCell.cjs +40 -33
  39. package/dist/components/DataGridCell.js +3 -3
  40. package/dist/components/DateInput.cjs +41 -34
  41. package/dist/components/DateInput.css +3 -0
  42. package/dist/components/DateInput.js +8 -8
  43. package/dist/components/DateRangeInput.cjs +41 -34
  44. package/dist/components/DateRangeInput.css +3 -0
  45. package/dist/components/DateRangeInput.js +8 -8
  46. package/dist/components/FilterGroup.cjs +41 -34
  47. package/dist/components/FilterGroup.js +3 -3
  48. package/dist/components/Input.cjs +40 -33
  49. package/dist/components/Input.js +1 -1
  50. package/dist/components/MobileDataGrid/ColumnList.cjs +1 -1
  51. package/dist/components/MobileDataGrid/ColumnList.css +3 -0
  52. package/dist/components/MobileDataGrid/ColumnList.js +3 -3
  53. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +41 -34
  54. package/dist/components/MobileDataGrid/ColumnSelector/index.css +3 -0
  55. package/dist/components/MobileDataGrid/ColumnSelector/index.js +8 -8
  56. package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +1 -1
  57. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
  58. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +41 -34
  59. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +3 -0
  60. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +8 -8
  61. package/dist/components/MobileDataGrid/index.cjs +41 -34
  62. package/dist/components/MobileDataGrid/index.css +3 -0
  63. package/dist/components/MobileDataGrid/index.js +8 -8
  64. package/dist/components/Password.cjs +40 -33
  65. package/dist/components/Password.js +1 -1
  66. package/dist/components/Search.cjs +40 -33
  67. package/dist/components/Search.js +2 -2
  68. package/dist/components/Select.cjs +40 -33
  69. package/dist/components/Select.js +2 -2
  70. package/dist/components/Stepper.cjs +40 -33
  71. package/dist/components/Stepper.js +1 -1
  72. package/dist/components/Time.cjs +40 -33
  73. package/dist/components/Time.js +1 -1
  74. package/dist/components/index.cjs +41 -34
  75. package/dist/components/index.css +3 -0
  76. package/dist/components/index.js +8 -8
  77. package/dist/index.css +3 -0
  78. 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
- setInternalValue("");
2176
- setDisplayValue("");
2189
+ setInputValues("", "");
2177
2190
  return;
2178
2191
  }
2179
2192
  if (!shouldUseThousandsFormatting) {
2180
- setInternalValue(stringValue);
2181
- setDisplayValue(stringValue);
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
- setInternalValue(stringValue);
2187
- setDisplayValue(stringValue);
2200
+ setInputValues(stringValue, stringValue);
2188
2201
  return;
2189
2202
  }
2190
- setInternalValue(formatted);
2191
- setDisplayValue(formatCurrencyDisplay(formatted));
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
- setInternalValue("");
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
- setInternalValue("");
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
- setInternalValue(formattedClamped);
2307
- setDisplayValue(
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
- setInternalValue(raw);
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
- setInternalValue("");
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
- setInternalValue(formattedClamped);
2354
- setDisplayValue(formatCurrencyDisplay(formattedClamped));
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
- setInternalValue(raw);
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
- setInternalValue(formattedClamped);
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
- setInternalValue(rawValue);
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
- setInternalValue(rawValue);
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
- setInternalValue(formatted);
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
- setInternalValue(formatted);
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
@@ -2327,6 +2327,9 @@
2327
2327
  .text-nowrap {
2328
2328
  text-wrap: nowrap;
2329
2329
  }
2330
+ .text-wrap {
2331
+ text-wrap: wrap;
2332
+ }
2330
2333
  .text-ellipsis {
2331
2334
  text-overflow: ellipsis;
2332
2335
  }
@@ -2,7 +2,7 @@ import {
2
2
  DataGrid,
3
3
  DateInput,
4
4
  MobileDataGrid
5
- } from "../chunk-5UPADXVU.js";
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-MAEVKATN.js";
25
- import "../chunk-OG2PGA3X.js";
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-EA6Y4HXQ.js";
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-PBJ2MEHM.js";
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-MOBFZ672.js";
84
+ } from "../chunk-3DJWSTPS.js";
85
85
  import {
86
86
  Input
87
- } from "../chunk-PABII472.js";
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-I3W5K76C.js";
94
+ } from "../chunk-RN465M4S.js";
95
95
  import {
96
96
  CompactImagesPreview
97
97
  } from "../chunk-Z5YP2GI6.js";
package/dist/index.css CHANGED
@@ -2305,6 +2305,9 @@
2305
2305
  .text-nowrap {
2306
2306
  text-wrap: nowrap;
2307
2307
  }
2308
+ .text-wrap {
2309
+ text-wrap: wrap;
2310
+ }
2308
2311
  .text-ellipsis {
2309
2312
  text-overflow: ellipsis;
2310
2313
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.1248",
4
+ "version": "0.0.1250",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",