@dmsi/wedgekit-react 0.0.162 → 0.0.164

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 (36) hide show
  1. package/dist/{chunk-SBSHZ327.js → chunk-A3FTZOB3.js} +7 -11
  2. package/dist/{chunk-PMBEIP24.js → chunk-IDSFWKOR.js} +1 -1
  3. package/dist/{chunk-XH65MD2C.js → chunk-KADNOKNW.js} +1 -1
  4. package/dist/{chunk-RLK4TBXR.js → chunk-UZZLQASG.js} +23 -7
  5. package/dist/components/DataGridCell.cjs +22 -10
  6. package/dist/components/DataGridCell.js +8 -8
  7. package/dist/components/DateInput.js +9 -9
  8. package/dist/components/DateRangeInput.js +10 -10
  9. package/dist/components/FilterGroup.js +7 -7
  10. package/dist/components/Input.js +2 -2
  11. package/dist/components/Menu.cjs +20 -4
  12. package/dist/components/Menu.js +2 -2
  13. package/dist/components/MenuOption.js +2 -2
  14. package/dist/components/MobileDataGrid.js +3 -3
  15. package/dist/components/Modal.js +2 -2
  16. package/dist/components/NestedMenu.js +2 -2
  17. package/dist/components/Notification.js +3 -3
  18. package/dist/components/PDFViewer.js +5 -5
  19. package/dist/components/Password.js +2 -2
  20. package/dist/components/Search.js +3 -3
  21. package/dist/components/Select.js +3 -3
  22. package/dist/components/Stepper.js +2 -2
  23. package/dist/components/Time.js +2 -2
  24. package/dist/components/Toast.js +3 -3
  25. package/dist/components/Upload.js +3 -3
  26. package/dist/components/index.cjs +25 -12
  27. package/dist/components/index.js +20 -19
  28. package/dist/index.css +5 -2
  29. package/package.json +1 -1
  30. package/src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx +1 -0
  31. package/src/components/DataGrid/index.tsx +2 -2
  32. package/src/components/DataGridCell.tsx +1 -1
  33. package/src/components/Menu.tsx +25 -3
  34. package/dist/{chunk-FFU6FB3K.js → chunk-AEDEFN7A.js} +3 -3
  35. package/dist/{chunk-4T3DRGLF.js → chunk-MVGOAMTP.js} +3 -3
  36. package/dist/{chunk-FCREADUH.js → chunk-O7RLJT6I.js} +3 -3
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  Menu
3
- } from "./chunk-RLK4TBXR.js";
3
+ } from "./chunk-UZZLQASG.js";
4
4
  import {
5
5
  useSubMenuSystem
6
6
  } from "./chunk-5GUW4DUY.js";
7
7
  import {
8
8
  MenuOption
9
- } from "./chunk-FFU6FB3K.js";
10
- import {
11
- Search
12
- } from "./chunk-PMBEIP24.js";
9
+ } from "./chunk-AEDEFN7A.js";
13
10
  import {
14
11
  CSS
15
12
  } from "./chunk-WVUIIBRR.js";
13
+ import {
14
+ Search
15
+ } from "./chunk-IDSFWKOR.js";
16
16
  import {
17
17
  Icon
18
18
  } from "./chunk-NKUETCDA.js";
@@ -323,7 +323,7 @@ function DataCellHeader(_a) {
323
323
  children: "Filter"
324
324
  })
325
325
  ),
326
- !predeterminedPinned.current && header.column.getCanPin() && /* @__PURE__ */ jsxs(
326
+ !predeterminedPinned.current && header.column.getCanPin() && /* @__PURE__ */ jsx(
327
327
  MenuOption,
328
328
  __spreadProps(__spreadValues({
329
329
  onClick: () => {
@@ -374,11 +374,7 @@ function DataCellHeader(_a) {
374
374
  })
375
375
  );
376
376
  },
377
- children: [
378
- "Freeze [",
379
- header.column.columnDef.header,
380
- "]"
381
- ]
377
+ children: `Freeze [${header.column.columnDef.header}]`
382
378
  })
383
379
  )
384
380
  ]
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Input
3
- } from "./chunk-4T3DRGLF.js";
3
+ } from "./chunk-MVGOAMTP.js";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadValues
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InputBase
3
- } from "./chunk-4T3DRGLF.js";
3
+ } from "./chunk-MVGOAMTP.js";
4
4
  import {
5
5
  Icon
6
6
  } from "./chunk-NKUETCDA.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useMenuPosition
3
3
  } from "./chunk-5GUW4DUY.js";
4
- import {
5
- useMatchesMobile
6
- } from "./chunk-WNQ53SVY.js";
7
4
  import {
8
5
  findDocumentRoot
9
6
  } from "./chunk-6LN6QT6M.js";
7
+ import {
8
+ useMatchesMobile
9
+ } from "./chunk-WNQ53SVY.js";
10
10
  import {
11
11
  __objRest,
12
12
  __spreadProps,
@@ -40,7 +40,8 @@ var Menu = (_a) => {
40
40
  mobileHide,
41
41
  useDefaultMinWidth,
42
42
  autoFocusOff,
43
- menuName
43
+ menuName,
44
+ calculateMinMaxHeight
44
45
  } = _b, props = __objRest(_b, [
45
46
  "id",
46
47
  "testid",
@@ -58,7 +59,8 @@ var Menu = (_a) => {
58
59
  "mobileHide",
59
60
  "useDefaultMinWidth",
60
61
  "autoFocusOff",
61
- "menuName"
62
+ "menuName",
63
+ "calculateMinMaxHeight"
62
64
  ]);
63
65
  const internalRef = useRef(null);
64
66
  const actualRef = ref || internalRef;
@@ -75,8 +77,11 @@ var Menu = (_a) => {
75
77
  }
76
78
  );
77
79
  useEffect(() => {
80
+ if (calculateMinMaxHeight) {
81
+ return;
82
+ }
78
83
  const raf = requestAnimationFrame(() => {
79
- if (!actualRef || !actualRef.current || customMaxHeight) {
84
+ if (!actualRef.current || customMaxHeight) {
80
85
  return;
81
86
  }
82
87
  if (actualRef.current.childElementCount > 4) {
@@ -94,7 +99,18 @@ var Menu = (_a) => {
94
99
  return () => {
95
100
  cancelAnimationFrame(raf);
96
101
  };
97
- }, [actualRef, customMaxHeight]);
102
+ }, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
103
+ useEffect(() => {
104
+ if (!calculateMinMaxHeight) {
105
+ return;
106
+ }
107
+ if ((positionTo == null ? void 0 : positionTo.current) && actualRef.current) {
108
+ const positionToRect = positionTo.current.getBoundingClientRect();
109
+ const offsetInPx = 16;
110
+ const calculatedMaxHeight = window.innerHeight - positionToRect.bottom - offsetInPx;
111
+ setMaxHeight(`${calculatedMaxHeight}px`);
112
+ }
113
+ }, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
98
114
  useEffect(() => {
99
115
  if (!show) {
100
116
  return;
@@ -1228,7 +1228,8 @@ var Menu = (_a) => {
1228
1228
  mobileHide,
1229
1229
  useDefaultMinWidth,
1230
1230
  autoFocusOff,
1231
- menuName
1231
+ menuName,
1232
+ calculateMinMaxHeight
1232
1233
  } = _b, props = __objRest(_b, [
1233
1234
  "id",
1234
1235
  "testid",
@@ -1246,7 +1247,8 @@ var Menu = (_a) => {
1246
1247
  "mobileHide",
1247
1248
  "useDefaultMinWidth",
1248
1249
  "autoFocusOff",
1249
- "menuName"
1250
+ "menuName",
1251
+ "calculateMinMaxHeight"
1250
1252
  ]);
1251
1253
  const internalRef = (0, import_react8.useRef)(null);
1252
1254
  const actualRef = ref || internalRef;
@@ -1263,8 +1265,11 @@ var Menu = (_a) => {
1263
1265
  }
1264
1266
  );
1265
1267
  (0, import_react8.useEffect)(() => {
1268
+ if (calculateMinMaxHeight) {
1269
+ return;
1270
+ }
1266
1271
  const raf = requestAnimationFrame(() => {
1267
- if (!actualRef || !actualRef.current || customMaxHeight) {
1272
+ if (!actualRef.current || customMaxHeight) {
1268
1273
  return;
1269
1274
  }
1270
1275
  if (actualRef.current.childElementCount > 4) {
@@ -1282,7 +1287,18 @@ var Menu = (_a) => {
1282
1287
  return () => {
1283
1288
  cancelAnimationFrame(raf);
1284
1289
  };
1285
- }, [actualRef, customMaxHeight]);
1290
+ }, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
1291
+ (0, import_react8.useEffect)(() => {
1292
+ if (!calculateMinMaxHeight) {
1293
+ return;
1294
+ }
1295
+ if ((positionTo == null ? void 0 : positionTo.current) && actualRef.current) {
1296
+ const positionToRect = positionTo.current.getBoundingClientRect();
1297
+ const offsetInPx = 16;
1298
+ const calculatedMaxHeight = window.innerHeight - positionToRect.bottom - offsetInPx;
1299
+ setMaxHeight(`${calculatedMaxHeight}px`);
1300
+ }
1301
+ }, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
1286
1302
  (0, import_react8.useEffect)(() => {
1287
1303
  if (!show) {
1288
1304
  return;
@@ -1961,7 +1977,7 @@ function DataCellHeader(_a) {
1961
1977
  children: "Filter"
1962
1978
  })
1963
1979
  ),
1964
- !predeterminedPinned.current && header.column.getCanPin() && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1980
+ !predeterminedPinned.current && header.column.getCanPin() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1965
1981
  MenuOption,
1966
1982
  __spreadProps(__spreadValues({
1967
1983
  onClick: () => {
@@ -2012,11 +2028,7 @@ function DataCellHeader(_a) {
2012
2028
  })
2013
2029
  );
2014
2030
  },
2015
- children: [
2016
- "Freeze [",
2017
- header.column.columnDef.header,
2018
- "]"
2019
- ]
2031
+ children: `Freeze [${header.column.columnDef.header}]`
2020
2032
  })
2021
2033
  )
2022
2034
  ]
@@ -4,17 +4,17 @@ import {
4
4
  DataGridCell,
5
5
  DragAlongCell,
6
6
  DraggableCellHeader
7
- } from "../chunk-SBSHZ327.js";
8
- import "../chunk-RLK4TBXR.js";
7
+ } from "../chunk-A3FTZOB3.js";
8
+ import "../chunk-UZZLQASG.js";
9
9
  import "../chunk-5GUW4DUY.js";
10
- import "../chunk-FFU6FB3K.js";
11
- import "../chunk-WNQ53SVY.js";
10
+ import "../chunk-AEDEFN7A.js";
11
+ import "../chunk-WVUIIBRR.js";
12
12
  import "../chunk-6LN6QT6M.js";
13
- import "../chunk-PMBEIP24.js";
14
- import "../chunk-4T3DRGLF.js";
15
- import "../chunk-5UH6QUFB.js";
13
+ import "../chunk-IDSFWKOR.js";
14
+ import "../chunk-MVGOAMTP.js";
16
15
  import "../chunk-JWCT72WR.js";
17
- import "../chunk-WVUIIBRR.js";
16
+ import "../chunk-WNQ53SVY.js";
17
+ import "../chunk-5UH6QUFB.js";
18
18
  import "../chunk-HVI3CL7Y.js";
19
19
  import "../chunk-NKUETCDA.js";
20
20
  import "../chunk-RDLEIAQU.js";
@@ -1,21 +1,21 @@
1
- import {
2
- calculateCursorPosition,
3
- formatDate,
4
- formatInputValue,
5
- isValidDate,
6
- parseInputDate
7
- } from "../chunk-M3433XEJ.js";
8
1
  import {
9
2
  findDocumentRoot
10
3
  } from "../chunk-6LN6QT6M.js";
11
4
  import {
12
5
  InputBase
13
- } from "../chunk-4T3DRGLF.js";
14
- import "../chunk-5UH6QUFB.js";
6
+ } from "../chunk-MVGOAMTP.js";
15
7
  import "../chunk-JWCT72WR.js";
16
8
  import {
17
9
  CalendarRange
18
10
  } from "../chunk-4XA32LKR.js";
11
+ import {
12
+ calculateCursorPosition,
13
+ formatDate,
14
+ formatInputValue,
15
+ isValidDate,
16
+ parseInputDate
17
+ } from "../chunk-M3433XEJ.js";
18
+ import "../chunk-5UH6QUFB.js";
19
19
  import {
20
20
  Icon
21
21
  } from "../chunk-NKUETCDA.js";
@@ -1,22 +1,22 @@
1
- import {
2
- calculateCursorPosition,
3
- formatDate,
4
- formatInputValue,
5
- isValidDate,
6
- isValidDateRangeOrder,
7
- parseInputDate
8
- } from "../chunk-M3433XEJ.js";
9
1
  import {
10
2
  findDocumentRoot
11
3
  } from "../chunk-6LN6QT6M.js";
12
4
  import {
13
5
  InputBase
14
- } from "../chunk-4T3DRGLF.js";
15
- import "../chunk-5UH6QUFB.js";
6
+ } from "../chunk-MVGOAMTP.js";
16
7
  import "../chunk-JWCT72WR.js";
17
8
  import {
18
9
  CalendarRange
19
10
  } from "../chunk-4XA32LKR.js";
11
+ import {
12
+ calculateCursorPosition,
13
+ formatDate,
14
+ formatInputValue,
15
+ isValidDate,
16
+ isValidDateRangeOrder,
17
+ parseInputDate
18
+ } from "../chunk-M3433XEJ.js";
19
+ import "../chunk-5UH6QUFB.js";
20
20
  import {
21
21
  Icon
22
22
  } from "../chunk-NKUETCDA.js";
@@ -2,22 +2,22 @@
2
2
  import {
3
3
  OptionPill
4
4
  } from "../chunk-LM5MKBPM.js";
5
- import {
6
- Checkbox
7
- } from "../chunk-WFQEE2OO.js";
8
5
  import {
9
6
  Search
10
- } from "../chunk-PMBEIP24.js";
11
- import "../chunk-4T3DRGLF.js";
12
- import "../chunk-5UH6QUFB.js";
7
+ } from "../chunk-IDSFWKOR.js";
8
+ import "../chunk-MVGOAMTP.js";
13
9
  import {
14
10
  Label
15
11
  } from "../chunk-JWCT72WR.js";
12
+ import {
13
+ Checkbox
14
+ } from "../chunk-WFQEE2OO.js";
15
+ import "../chunk-FKMKHLQH.js";
16
+ import "../chunk-5UH6QUFB.js";
16
17
  import "../chunk-HVI3CL7Y.js";
17
18
  import {
18
19
  Link
19
20
  } from "../chunk-I6GEUF6Y.js";
20
- import "../chunk-FKMKHLQH.js";
21
21
  import {
22
22
  Icon
23
23
  } from "../chunk-NKUETCDA.js";
@@ -6,9 +6,9 @@ import {
6
6
  InputBase,
7
7
  Percentage,
8
8
  UOM
9
- } from "../chunk-4T3DRGLF.js";
10
- import "../chunk-5UH6QUFB.js";
9
+ } from "../chunk-MVGOAMTP.js";
11
10
  import "../chunk-JWCT72WR.js";
11
+ import "../chunk-5UH6QUFB.js";
12
12
  import "../chunk-NKUETCDA.js";
13
13
  import "../chunk-RDLEIAQU.js";
14
14
  import "../chunk-ORMEWXMH.js";
@@ -221,7 +221,8 @@ var Menu = (_a) => {
221
221
  mobileHide,
222
222
  useDefaultMinWidth,
223
223
  autoFocusOff,
224
- menuName
224
+ menuName,
225
+ calculateMinMaxHeight
225
226
  } = _b, props = __objRest(_b, [
226
227
  "id",
227
228
  "testid",
@@ -239,7 +240,8 @@ var Menu = (_a) => {
239
240
  "mobileHide",
240
241
  "useDefaultMinWidth",
241
242
  "autoFocusOff",
242
- "menuName"
243
+ "menuName",
244
+ "calculateMinMaxHeight"
243
245
  ]);
244
246
  const internalRef = (0, import_react5.useRef)(null);
245
247
  const actualRef = ref || internalRef;
@@ -256,8 +258,11 @@ var Menu = (_a) => {
256
258
  }
257
259
  );
258
260
  (0, import_react5.useEffect)(() => {
261
+ if (calculateMinMaxHeight) {
262
+ return;
263
+ }
259
264
  const raf = requestAnimationFrame(() => {
260
- if (!actualRef || !actualRef.current || customMaxHeight) {
265
+ if (!actualRef.current || customMaxHeight) {
261
266
  return;
262
267
  }
263
268
  if (actualRef.current.childElementCount > 4) {
@@ -275,7 +280,18 @@ var Menu = (_a) => {
275
280
  return () => {
276
281
  cancelAnimationFrame(raf);
277
282
  };
278
- }, [actualRef, customMaxHeight]);
283
+ }, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
284
+ (0, import_react5.useEffect)(() => {
285
+ if (!calculateMinMaxHeight) {
286
+ return;
287
+ }
288
+ if ((positionTo == null ? void 0 : positionTo.current) && actualRef.current) {
289
+ const positionToRect = positionTo.current.getBoundingClientRect();
290
+ const offsetInPx = 16;
291
+ const calculatedMaxHeight = window.innerHeight - positionToRect.bottom - offsetInPx;
292
+ setMaxHeight(`${calculatedMaxHeight}px`);
293
+ }
294
+ }, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
279
295
  (0, import_react5.useEffect)(() => {
280
296
  if (!show) {
281
297
  return;
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Menu
4
- } from "../chunk-RLK4TBXR.js";
4
+ } from "../chunk-UZZLQASG.js";
5
5
  import "../chunk-5GUW4DUY.js";
6
- import "../chunk-WNQ53SVY.js";
7
6
  import "../chunk-6LN6QT6M.js";
7
+ import "../chunk-WNQ53SVY.js";
8
8
  import "../chunk-ORMEWXMH.js";
9
9
  export {
10
10
  Menu
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  MenuOption
4
- } from "../chunk-FFU6FB3K.js";
5
- import "../chunk-WNQ53SVY.js";
4
+ } from "../chunk-AEDEFN7A.js";
6
5
  import "../chunk-JWCT72WR.js";
6
+ import "../chunk-WNQ53SVY.js";
7
7
  import "../chunk-HVI3CL7Y.js";
8
8
  import "../chunk-NKUETCDA.js";
9
9
  import "../chunk-RDLEIAQU.js";
@@ -4,15 +4,15 @@ import {
4
4
  import {
5
5
  Heading3
6
6
  } from "../chunk-AZ7LVLOK.js";
7
+ import {
8
+ Button
9
+ } from "../chunk-FKMKHLQH.js";
7
10
  import {
8
11
  Stack
9
12
  } from "../chunk-N6JVLYEE.js";
10
13
  import {
11
14
  Paragraph
12
15
  } from "../chunk-HVI3CL7Y.js";
13
- import {
14
- Button
15
- } from "../chunk-FKMKHLQH.js";
16
16
  import {
17
17
  Icon
18
18
  } from "../chunk-NKUETCDA.js";
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import {
3
3
  Modal
4
- } from "../chunk-FCREADUH.js";
4
+ } from "../chunk-O7RLJT6I.js";
5
5
  import "../chunk-4RJKB7LC.js";
6
6
  import "../chunk-C4JGTH6G.js";
7
7
  import "../chunk-SYEJVSE4.js";
8
8
  import "../chunk-R7ELP5C5.js";
9
9
  import "../chunk-ZFOANBWG.js";
10
10
  import "../chunk-AZ7LVLOK.js";
11
- import "../chunk-WNQ53SVY.js";
12
11
  import "../chunk-6LN6QT6M.js";
13
12
  import "../chunk-FKMKHLQH.js";
13
+ import "../chunk-WNQ53SVY.js";
14
14
  import "../chunk-NKUETCDA.js";
15
15
  import "../chunk-RDLEIAQU.js";
16
16
  import "../chunk-ORMEWXMH.js";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  MenuOption
4
- } from "../chunk-FFU6FB3K.js";
4
+ } from "../chunk-AEDEFN7A.js";
5
+ import "../chunk-JWCT72WR.js";
5
6
  import {
6
7
  useKeydown
7
8
  } from "../chunk-WNQ53SVY.js";
8
- import "../chunk-JWCT72WR.js";
9
9
  import "../chunk-HVI3CL7Y.js";
10
10
  import {
11
11
  Icon
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  Heading3
4
4
  } from "../chunk-AZ7LVLOK.js";
5
+ import {
6
+ Button
7
+ } from "../chunk-FKMKHLQH.js";
5
8
  import {
6
9
  Stack
7
10
  } from "../chunk-N6JVLYEE.js";
8
11
  import {
9
12
  Paragraph
10
13
  } from "../chunk-HVI3CL7Y.js";
11
- import {
12
- Button
13
- } from "../chunk-FKMKHLQH.js";
14
14
  import {
15
15
  Icon
16
16
  } from "../chunk-NKUETCDA.js";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Modal
4
- } from "../chunk-FCREADUH.js";
4
+ } from "../chunk-O7RLJT6I.js";
5
5
  import "../chunk-4RJKB7LC.js";
6
6
  import "../chunk-C4JGTH6G.js";
7
7
  import "../chunk-SYEJVSE4.js";
@@ -11,17 +11,17 @@ import {
11
11
  Spinner
12
12
  } from "../chunk-PLMGI5K5.js";
13
13
  import "../chunk-AZ7LVLOK.js";
14
+ import "../chunk-6LN6QT6M.js";
14
15
  import {
15
16
  Caption
16
17
  } from "../chunk-E7D24OHM.js";
18
+ import {
19
+ Button
20
+ } from "../chunk-FKMKHLQH.js";
17
21
  import "../chunk-WNQ53SVY.js";
18
- import "../chunk-6LN6QT6M.js";
19
22
  import {
20
23
  Stack
21
24
  } from "../chunk-N6JVLYEE.js";
22
- import {
23
- Button
24
- } from "../chunk-FKMKHLQH.js";
25
25
  import {
26
26
  Icon
27
27
  } from "../chunk-NKUETCDA.js";
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  InputBase
4
- } from "../chunk-4T3DRGLF.js";
5
- import "../chunk-5UH6QUFB.js";
4
+ } from "../chunk-MVGOAMTP.js";
6
5
  import "../chunk-JWCT72WR.js";
6
+ import "../chunk-5UH6QUFB.js";
7
7
  import {
8
8
  Icon
9
9
  } from "../chunk-NKUETCDA.js";
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Search
4
- } from "../chunk-PMBEIP24.js";
5
- import "../chunk-4T3DRGLF.js";
6
- import "../chunk-5UH6QUFB.js";
4
+ } from "../chunk-IDSFWKOR.js";
5
+ import "../chunk-MVGOAMTP.js";
7
6
  import "../chunk-JWCT72WR.js";
7
+ import "../chunk-5UH6QUFB.js";
8
8
  import "../chunk-NKUETCDA.js";
9
9
  import "../chunk-RDLEIAQU.js";
10
10
  import "../chunk-ORMEWXMH.js";
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Select
4
- } from "../chunk-XH65MD2C.js";
5
- import "../chunk-4T3DRGLF.js";
6
- import "../chunk-5UH6QUFB.js";
4
+ } from "../chunk-KADNOKNW.js";
5
+ import "../chunk-MVGOAMTP.js";
7
6
  import "../chunk-JWCT72WR.js";
7
+ import "../chunk-5UH6QUFB.js";
8
8
  import "../chunk-NKUETCDA.js";
9
9
  import "../chunk-RDLEIAQU.js";
10
10
  import "../chunk-ORMEWXMH.js";
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  InputBase
4
- } from "../chunk-4T3DRGLF.js";
5
- import "../chunk-5UH6QUFB.js";
4
+ } from "../chunk-MVGOAMTP.js";
6
5
  import "../chunk-JWCT72WR.js";
7
6
  import {
8
7
  Button
9
8
  } from "../chunk-FKMKHLQH.js";
9
+ import "../chunk-5UH6QUFB.js";
10
10
  import {
11
11
  Icon
12
12
  } from "../chunk-NKUETCDA.js";
@@ -3,9 +3,9 @@ import {
3
3
  } from "../chunk-6LN6QT6M.js";
4
4
  import {
5
5
  InputBase
6
- } from "../chunk-4T3DRGLF.js";
7
- import "../chunk-5UH6QUFB.js";
6
+ } from "../chunk-MVGOAMTP.js";
8
7
  import "../chunk-JWCT72WR.js";
8
+ import "../chunk-5UH6QUFB.js";
9
9
  import {
10
10
  Stack
11
11
  } from "../chunk-N6JVLYEE.js";
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  Heading3
4
4
  } from "../chunk-AZ7LVLOK.js";
5
- import {
6
- Paragraph
7
- } from "../chunk-HVI3CL7Y.js";
8
5
  import {
9
6
  Button
10
7
  } from "../chunk-FKMKHLQH.js";
8
+ import {
9
+ Paragraph
10
+ } from "../chunk-HVI3CL7Y.js";
11
11
  import {
12
12
  Icon
13
13
  } from "../chunk-NKUETCDA.js";
@@ -1,9 +1,9 @@
1
- import {
2
- Paragraph
3
- } from "../chunk-HVI3CL7Y.js";
4
1
  import {
5
2
  Button
6
3
  } from "../chunk-FKMKHLQH.js";
4
+ import {
5
+ Paragraph
6
+ } from "../chunk-HVI3CL7Y.js";
7
7
  import {
8
8
  Icon
9
9
  } from "../chunk-NKUETCDA.js";
@@ -1270,7 +1270,8 @@ var Menu = (_a) => {
1270
1270
  mobileHide,
1271
1271
  useDefaultMinWidth,
1272
1272
  autoFocusOff,
1273
- menuName
1273
+ menuName,
1274
+ calculateMinMaxHeight
1274
1275
  } = _b, props = __objRest(_b, [
1275
1276
  "id",
1276
1277
  "testid",
@@ -1288,7 +1289,8 @@ var Menu = (_a) => {
1288
1289
  "mobileHide",
1289
1290
  "useDefaultMinWidth",
1290
1291
  "autoFocusOff",
1291
- "menuName"
1292
+ "menuName",
1293
+ "calculateMinMaxHeight"
1292
1294
  ]);
1293
1295
  const internalRef = (0, import_react8.useRef)(null);
1294
1296
  const actualRef = ref || internalRef;
@@ -1305,8 +1307,11 @@ var Menu = (_a) => {
1305
1307
  }
1306
1308
  );
1307
1309
  (0, import_react8.useEffect)(() => {
1310
+ if (calculateMinMaxHeight) {
1311
+ return;
1312
+ }
1308
1313
  const raf = requestAnimationFrame(() => {
1309
- if (!actualRef || !actualRef.current || customMaxHeight) {
1314
+ if (!actualRef.current || customMaxHeight) {
1310
1315
  return;
1311
1316
  }
1312
1317
  if (actualRef.current.childElementCount > 4) {
@@ -1324,7 +1329,18 @@ var Menu = (_a) => {
1324
1329
  return () => {
1325
1330
  cancelAnimationFrame(raf);
1326
1331
  };
1327
- }, [actualRef, customMaxHeight]);
1332
+ }, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
1333
+ (0, import_react8.useEffect)(() => {
1334
+ if (!calculateMinMaxHeight) {
1335
+ return;
1336
+ }
1337
+ if ((positionTo == null ? void 0 : positionTo.current) && actualRef.current) {
1338
+ const positionToRect = positionTo.current.getBoundingClientRect();
1339
+ const offsetInPx = 16;
1340
+ const calculatedMaxHeight = window.innerHeight - positionToRect.bottom - offsetInPx;
1341
+ setMaxHeight(`${calculatedMaxHeight}px`);
1342
+ }
1343
+ }, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
1328
1344
  (0, import_react8.useEffect)(() => {
1329
1345
  if (!show) {
1330
1346
  return;
@@ -2003,7 +2019,7 @@ function DataCellHeader(_a) {
2003
2019
  children: "Filter"
2004
2020
  })
2005
2021
  ),
2006
- !predeterminedPinned.current && header.column.getCanPin() && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2022
+ !predeterminedPinned.current && header.column.getCanPin() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2007
2023
  MenuOption,
2008
2024
  __spreadProps(__spreadValues({
2009
2025
  onClick: () => {
@@ -2054,11 +2070,7 @@ function DataCellHeader(_a) {
2054
2070
  })
2055
2071
  );
2056
2072
  },
2057
- children: [
2058
- "Freeze [",
2059
- header.column.columnDef.header,
2060
- "]"
2061
- ]
2073
+ children: `Freeze [${header.column.columnDef.header}]`
2062
2074
  })
2063
2075
  )
2064
2076
  ]
@@ -2632,6 +2644,7 @@ function ColumnSelectorHeaderCell({
2632
2644
  position: "bottom-right",
2633
2645
  show,
2634
2646
  setShow,
2647
+ calculateMinMaxHeight: true,
2635
2648
  children: [
2636
2649
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2637
2650
  Button,
@@ -2670,7 +2683,7 @@ function ColumnSelectorHeaderCell({
2670
2683
  // src/components/DataGrid/index.tsx
2671
2684
  var import_jsx_runtime16 = require("react/jsx-runtime");
2672
2685
  var PAGE_SIZE_OPTIONS = [5, 10, 15, 20, 25, 30, 35];
2673
- var NO_RESULTS_HEIGHT = "h-[120px]";
2686
+ var NO_RESULTS_HEIGHT = "h-[80px]";
2674
2687
  function DataGrid({
2675
2688
  id,
2676
2689
  testid,
@@ -2888,7 +2901,7 @@ function DataGrid({
2888
2901
  {
2889
2902
  className: (0, import_clsx13.default)(
2890
2903
  "flex overflow-auto scrollbar-thin relative contain-paint will-change-transform",
2891
- empty ? "overflow-y-hidden" : "h-full"
2904
+ empty ? "overflow-y-hidden" : "min-h-[120px]"
2892
2905
  ),
2893
2906
  ref: containerRef,
2894
2907
  children: [
@@ -3,38 +3,41 @@ import {
3
3
  } from "../chunk-4VTOTNKJ.js";
4
4
  import {
5
5
  Select
6
- } from "../chunk-XH65MD2C.js";
7
- import {
8
- Checkbox
9
- } from "../chunk-WFQEE2OO.js";
6
+ } from "../chunk-KADNOKNW.js";
10
7
  import {
11
8
  DataCellHeader,
12
9
  DataGridCell,
13
10
  DragAlongCell,
14
11
  DraggableCellHeader
15
- } from "../chunk-SBSHZ327.js";
12
+ } from "../chunk-A3FTZOB3.js";
16
13
  import {
17
14
  Menu
18
- } from "../chunk-RLK4TBXR.js";
15
+ } from "../chunk-UZZLQASG.js";
19
16
  import "../chunk-5GUW4DUY.js";
20
17
  import {
21
18
  MenuOption
22
- } from "../chunk-FFU6FB3K.js";
23
- import {
24
- useInfiniteScroll
25
- } from "../chunk-WNQ53SVY.js";
19
+ } from "../chunk-AEDEFN7A.js";
20
+ import "../chunk-WVUIIBRR.js";
26
21
  import "../chunk-6LN6QT6M.js";
27
22
  import {
28
23
  Search
29
- } from "../chunk-PMBEIP24.js";
24
+ } from "../chunk-IDSFWKOR.js";
30
25
  import {
31
26
  Input
32
- } from "../chunk-4T3DRGLF.js";
33
- import "../chunk-5UH6QUFB.js";
27
+ } from "../chunk-MVGOAMTP.js";
34
28
  import {
35
29
  Label
36
30
  } from "../chunk-JWCT72WR.js";
37
- import "../chunk-WVUIIBRR.js";
31
+ import {
32
+ Checkbox
33
+ } from "../chunk-WFQEE2OO.js";
34
+ import {
35
+ Button
36
+ } from "../chunk-FKMKHLQH.js";
37
+ import {
38
+ useInfiniteScroll
39
+ } from "../chunk-WNQ53SVY.js";
40
+ import "../chunk-5UH6QUFB.js";
38
41
  import {
39
42
  Subheader
40
43
  } from "../chunk-CYZL57LH.js";
@@ -48,9 +51,6 @@ import {
48
51
  import {
49
52
  Paragraph
50
53
  } from "../chunk-HVI3CL7Y.js";
51
- import {
52
- Button
53
- } from "../chunk-FKMKHLQH.js";
54
54
  import {
55
55
  Icon
56
56
  } from "../chunk-NKUETCDA.js";
@@ -560,6 +560,7 @@ function ColumnSelectorHeaderCell({
560
560
  position: "bottom-right",
561
561
  show,
562
562
  setShow,
563
+ calculateMinMaxHeight: true,
563
564
  children: [
564
565
  /* @__PURE__ */ jsx7(
565
566
  Button,
@@ -598,7 +599,7 @@ function ColumnSelectorHeaderCell({
598
599
  // src/components/DataGrid/index.tsx
599
600
  import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
600
601
  var PAGE_SIZE_OPTIONS = [5, 10, 15, 20, 25, 30, 35];
601
- var NO_RESULTS_HEIGHT = "h-[120px]";
602
+ var NO_RESULTS_HEIGHT = "h-[80px]";
602
603
  function DataGrid({
603
604
  id,
604
605
  testid,
@@ -816,7 +817,7 @@ function DataGrid({
816
817
  {
817
818
  className: clsx5(
818
819
  "flex overflow-auto scrollbar-thin relative contain-paint will-change-transform",
819
- empty ? "overflow-y-hidden" : "h-full"
820
+ empty ? "overflow-y-hidden" : "min-h-[120px]"
820
821
  ),
821
822
  ref: containerRef,
822
823
  children: [
package/dist/index.css CHANGED
@@ -741,8 +741,8 @@
741
741
  .h-60 {
742
742
  height: calc(var(--spacing) * 60);
743
743
  }
744
- .h-\[120px\] {
745
- height: 120px;
744
+ .h-\[80px\] {
745
+ height: 80px;
746
746
  }
747
747
  .h-\[166px\] {
748
748
  height: 166px;
@@ -777,6 +777,9 @@
777
777
  .min-h-\[34px\] {
778
778
  min-height: 34px;
779
779
  }
780
+ .min-h-\[120px\] {
781
+ min-height: 120px;
782
+ }
780
783
  .min-h-min {
781
784
  min-height: min-content;
782
785
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.162",
4
+ "version": "0.0.164",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",
@@ -43,6 +43,7 @@ export function ColumnSelectorHeaderCell<T>({
43
43
  position="bottom-right"
44
44
  show={show}
45
45
  setShow={setShow}
46
+ calculateMinMaxHeight
46
47
  >
47
48
  <Button
48
49
  id={id ? `${id}-reset-button` : undefined}
@@ -53,7 +53,7 @@ import { ColumnSelectorHeaderCell } from "./ColumnSelectorHeaderCell";
53
53
 
54
54
  // Constants
55
55
  const PAGE_SIZE_OPTIONS = [5, 10, 15, 20, 25, 30, 35];
56
- const NO_RESULTS_HEIGHT = "h-[120px]";
56
+ const NO_RESULTS_HEIGHT = "h-[80px]";
57
57
 
58
58
  export function DataGrid<T extends Record<string, unknown>>({
59
59
  id,
@@ -336,7 +336,7 @@ export function DataGrid<T extends Record<string, unknown>>({
336
336
  <div
337
337
  className={clsx(
338
338
  "flex overflow-auto scrollbar-thin relative contain-paint will-change-transform",
339
- empty ? "overflow-y-hidden" : "h-full",
339
+ empty ? "overflow-y-hidden" : "min-h-[120px]",
340
340
  )}
341
341
  ref={containerRef}
342
342
  >
@@ -405,7 +405,7 @@ export function DataCellHeader<T>({
405
405
  </Menu>
406
406
  )}
407
407
  >
408
- Freeze [{header.column.columnDef.header as string}]
408
+ {`Freeze [${header.column.columnDef.header as string}]`}
409
409
  </MenuOption>
410
410
  )}
411
411
  </Menu>
@@ -31,6 +31,7 @@ type MenuProps = {
31
31
  useDefaultMinWidth?: boolean;
32
32
  autoFocusOff?: boolean;
33
33
  menuName?: string;
34
+ calculateMinMaxHeight?: boolean;
34
35
  };
35
36
 
36
37
  export const Menu = ({
@@ -51,6 +52,7 @@ export const Menu = ({
51
52
  useDefaultMinWidth,
52
53
  autoFocusOff,
53
54
  menuName,
55
+ calculateMinMaxHeight,
54
56
  ...props
55
57
  }: ComponentProps<"div"> & MenuProps) => {
56
58
  const internalRef = useRef<HTMLDivElement>(null);
@@ -69,8 +71,12 @@ export const Menu = ({
69
71
  );
70
72
 
71
73
  useEffect(() => {
74
+ if (calculateMinMaxHeight) {
75
+ return;
76
+ }
77
+
72
78
  const raf = requestAnimationFrame(() => {
73
- if (!actualRef || !actualRef.current || customMaxHeight) {
79
+ if (!actualRef.current || customMaxHeight) {
74
80
  return;
75
81
  }
76
82
 
@@ -85,15 +91,31 @@ export const Menu = ({
85
91
  accumulatedHeight += child.clientHeight;
86
92
  });
87
93
 
88
- accumulatedHeight = (accumulatedHeight / 5) * 4.5;
94
+ accumulatedHeight = (accumulatedHeight / 5) * 4.5; // default max height is set to 4.5 times of the first 5 child height of the menu
89
95
 
90
96
  setMaxHeight(`${accumulatedHeight}px`);
91
97
  }
92
98
  });
99
+
93
100
  return () => {
94
101
  cancelAnimationFrame(raf);
95
102
  };
96
- }, [actualRef, customMaxHeight]);
103
+ }, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
104
+
105
+ useEffect(() => {
106
+ if (!calculateMinMaxHeight) {
107
+ return;
108
+ }
109
+
110
+ if (positionTo?.current && actualRef.current) {
111
+ const positionToRect = positionTo.current.getBoundingClientRect();
112
+ const offsetInPx = 16;
113
+
114
+ const calculatedMaxHeight = window.innerHeight - positionToRect.bottom - offsetInPx;
115
+
116
+ setMaxHeight(`${calculatedMaxHeight}px`);
117
+ }
118
+ }, [actualRef.current, positionTo?.current, calculateMinMaxHeight])
97
119
 
98
120
  useEffect(() => {
99
121
  if (!show) {
@@ -1,9 +1,9 @@
1
- import {
2
- useMatchesMobile
3
- } from "./chunk-WNQ53SVY.js";
4
1
  import {
5
2
  Label
6
3
  } from "./chunk-JWCT72WR.js";
4
+ import {
5
+ useMatchesMobile
6
+ } from "./chunk-WNQ53SVY.js";
7
7
  import {
8
8
  Paragraph
9
9
  } from "./chunk-HVI3CL7Y.js";
@@ -1,11 +1,11 @@
1
+ import {
2
+ Label
3
+ } from "./chunk-JWCT72WR.js";
1
4
  import {
2
5
  formatCurrencyDisplay,
3
6
  formatDecimalValue,
4
7
  getDecimalPlaceholder
5
8
  } from "./chunk-5UH6QUFB.js";
6
- import {
7
- Label
8
- } from "./chunk-JWCT72WR.js";
9
9
  import {
10
10
  Icon
11
11
  } from "./chunk-NKUETCDA.js";
@@ -13,12 +13,12 @@ import {
13
13
  import {
14
14
  ModalScrim
15
15
  } from "./chunk-ZFOANBWG.js";
16
- import {
17
- useMatchesMobile
18
- } from "./chunk-WNQ53SVY.js";
19
16
  import {
20
17
  findDocumentRoot
21
18
  } from "./chunk-6LN6QT6M.js";
19
+ import {
20
+ useMatchesMobile
21
+ } from "./chunk-WNQ53SVY.js";
22
22
 
23
23
  // src/components/Modal.tsx
24
24
  import clsx from "clsx";