@dmsi/wedgekit-react 0.0.1080 → 0.0.1082

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 (52) hide show
  1. package/dist/{chunk-NEMOTB6U.js → chunk-KZPIH2K5.js} +20 -3
  2. package/dist/{chunk-FD2FKB5M.js → chunk-QNGEDR4I.js} +5 -5
  3. package/dist/{chunk-IEKZBWVL.js → chunk-SISDU5GI.js} +1 -1
  4. package/dist/{chunk-72WLEGGU.js → chunk-TINCHPB4.js} +1 -1
  5. package/dist/{chunk-RMKITIDU.js → chunk-Y2N7A2PP.js} +1 -1
  6. package/dist/components/CalendarRange.cjs +20 -3
  7. package/dist/components/CalendarRange.js +5 -5
  8. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +20 -3
  9. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +5 -5
  10. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +20 -3
  11. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +5 -5
  12. package/dist/components/DataGrid/PinnedColumns.cjs +20 -3
  13. package/dist/components/DataGrid/PinnedColumns.js +5 -5
  14. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +20 -3
  15. package/dist/components/DataGrid/TableBody/LoadingCell.js +5 -5
  16. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +20 -3
  17. package/dist/components/DataGrid/TableBody/TableBodyRow.js +5 -5
  18. package/dist/components/DataGrid/TableBody/index.cjs +20 -3
  19. package/dist/components/DataGrid/TableBody/index.js +5 -5
  20. package/dist/components/DataGrid/index.cjs +20 -3
  21. package/dist/components/DataGrid/index.js +5 -5
  22. package/dist/components/DataGrid/utils.cjs +20 -3
  23. package/dist/components/DataGrid/utils.js +5 -5
  24. package/dist/components/DataGridCell.cjs +20 -3
  25. package/dist/components/DataGridCell.js +3 -3
  26. package/dist/components/DateInput.cjs +20 -3
  27. package/dist/components/DateInput.js +5 -5
  28. package/dist/components/DateRangeInput.cjs +20 -3
  29. package/dist/components/DateRangeInput.js +5 -5
  30. package/dist/components/FilterGroup.cjs +20 -3
  31. package/dist/components/FilterGroup.js +2 -2
  32. package/dist/components/Input.cjs +20 -3
  33. package/dist/components/Input.js +1 -1
  34. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +20 -3
  35. package/dist/components/MobileDataGrid/ColumnSelector/index.js +5 -5
  36. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +20 -3
  37. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +5 -5
  38. package/dist/components/MobileDataGrid/index.cjs +21 -4
  39. package/dist/components/MobileDataGrid/index.js +5 -5
  40. package/dist/components/Password.cjs +20 -3
  41. package/dist/components/Password.js +1 -1
  42. package/dist/components/Search.cjs +20 -3
  43. package/dist/components/Search.js +2 -2
  44. package/dist/components/Select.cjs +20 -3
  45. package/dist/components/Select.js +2 -2
  46. package/dist/components/Stepper.cjs +20 -3
  47. package/dist/components/Stepper.js +1 -1
  48. package/dist/components/Time.cjs +20 -3
  49. package/dist/components/Time.js +1 -1
  50. package/dist/components/index.cjs +21 -4
  51. package/dist/components/index.js +5 -5
  52. package/package.json +1 -1
@@ -2140,6 +2140,7 @@ var Input = (_a) => {
2140
2140
  decimals,
2141
2141
  uom,
2142
2142
  currencyFormat = false,
2143
+ formatOnBlur = false,
2143
2144
  removeSearchIcon,
2144
2145
  value: propValue,
2145
2146
  onChange,
@@ -2153,6 +2154,7 @@ var Input = (_a) => {
2153
2154
  "decimals",
2154
2155
  "uom",
2155
2156
  "currencyFormat",
2157
+ "formatOnBlur",
2156
2158
  "removeSearchIcon",
2157
2159
  "value",
2158
2160
  "onChange",
@@ -2164,6 +2166,7 @@ var Input = (_a) => {
2164
2166
  ]);
2165
2167
  const [internalValue, setInternalValue] = (0, import_react10.useState)("");
2166
2168
  const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
2169
+ const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
2167
2170
  (0, import_react10.useEffect)(() => {
2168
2171
  var _a2;
2169
2172
  const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
@@ -2179,9 +2182,14 @@ var Input = (_a) => {
2179
2182
  return;
2180
2183
  }
2181
2184
  const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
2185
+ if (formatOnBlur && isFocused) {
2186
+ setInternalValue(stringValue);
2187
+ setDisplayValue(stringValue);
2188
+ return;
2189
+ }
2182
2190
  setInternalValue(formatted);
2183
2191
  setDisplayValue(formatCurrencyDisplay(formatted));
2184
- }, [propValue, variant, currencyFormat, decimals]);
2192
+ }, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
2185
2193
  const getInputProps = () => {
2186
2194
  var _a2;
2187
2195
  const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
@@ -2296,7 +2304,9 @@ var Input = (_a) => {
2296
2304
  currentDecimals
2297
2305
  );
2298
2306
  setInternalValue(formattedClamped);
2299
- setDisplayValue(formatCurrencyDisplay(formattedClamped));
2307
+ setDisplayValue(
2308
+ formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
2309
+ );
2300
2310
  if (onChange) {
2301
2311
  const syntheticEvent = __spreadProps(__spreadValues({}, e), {
2302
2312
  target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
@@ -2306,7 +2316,7 @@ var Input = (_a) => {
2306
2316
  return;
2307
2317
  }
2308
2318
  setInternalValue(raw);
2309
- setDisplayValue(formatCurrencyDisplay(raw));
2319
+ setDisplayValue(formatOnBlur ? raw : formatCurrencyDisplay(raw));
2310
2320
  if (!isNaN(asNumber) && onChange) {
2311
2321
  const syntheticEvent = __spreadProps(__spreadValues({}, e), {
2312
2322
  target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
@@ -2392,6 +2402,7 @@ var Input = (_a) => {
2392
2402
  }
2393
2403
  };
2394
2404
  const handleBlur = (e) => {
2405
+ setIsFocused(false);
2395
2406
  if (!internalValue) {
2396
2407
  onBlur == null ? void 0 : onBlur(e);
2397
2408
  return;
@@ -2426,12 +2437,18 @@ var Input = (_a) => {
2426
2437
  }
2427
2438
  onBlur == null ? void 0 : onBlur(e);
2428
2439
  };
2440
+ const handleFocus = (e) => {
2441
+ var _a2;
2442
+ setIsFocused(true);
2443
+ (_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
2444
+ };
2429
2445
  const inputProps = getInputProps();
2430
2446
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2431
2447
  InputBase,
2432
2448
  __spreadProps(__spreadValues({}, inputProps), {
2433
2449
  before: getBeforeElement(),
2434
2450
  after: getAfterElement(),
2451
+ onFocus: handleFocus,
2435
2452
  onChange: handleChange,
2436
2453
  onBlur: handleBlur,
2437
2454
  testid,
@@ -7190,7 +7207,7 @@ function MobileDataGrid(props) {
7190
7207
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
7191
7208
  Stack,
7192
7209
  {
7193
- height: isFramed ? "screen" : "full",
7210
+ height: isFramed ? "calc(100dvh - 40dvh)" : "full",
7194
7211
  rounded,
7195
7212
  overflowX: "hidden",
7196
7213
  overflowY: "hidden",
@@ -2,7 +2,7 @@ import {
2
2
  DataGrid,
3
3
  DateInput,
4
4
  MobileDataGrid
5
- } from "../chunk-FD2FKB5M.js";
5
+ } from "../chunk-QNGEDR4I.js";
6
6
  import "../chunk-M7INAUAJ.js";
7
7
  import "../chunk-ICHD7DUS.js";
8
8
  import "../chunk-XPZY6KEI.js";
@@ -33,7 +33,7 @@ import "../chunk-EWGHVZL5.js";
33
33
  import "../chunk-AT4AWD6B.js";
34
34
  import {
35
35
  Select
36
- } from "../chunk-IEKZBWVL.js";
36
+ } from "../chunk-SISDU5GI.js";
37
37
  import {
38
38
  SimpleTable
39
39
  } from "../chunk-KWMG6SN2.js";
@@ -71,7 +71,7 @@ import {
71
71
  DataGridCell,
72
72
  DragAlongCell,
73
73
  DraggableCellHeader
74
- } from "../chunk-RMKITIDU.js";
74
+ } from "../chunk-Y2N7A2PP.js";
75
75
  import {
76
76
  MenuOption
77
77
  } from "../chunk-X3NDEFVA.js";
@@ -81,10 +81,10 @@ import {
81
81
  import "../chunk-PE3EZP56.js";
82
82
  import {
83
83
  Search
84
- } from "../chunk-72WLEGGU.js";
84
+ } from "../chunk-TINCHPB4.js";
85
85
  import {
86
86
  Input
87
- } from "../chunk-NEMOTB6U.js";
87
+ } from "../chunk-KZPIH2K5.js";
88
88
  import {
89
89
  Label
90
90
  } from "../chunk-HXGJVYGQ.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.1080",
4
+ "version": "0.0.1082",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",