@linzjs/step-ag-grid 15.1.3 → 16.0.0

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 (81) hide show
  1. package/dist/src/components/GridCell.d.ts +1 -1
  2. package/dist/src/components/GridIcon.d.ts +2 -2
  3. package/dist/src/components/GridLoadableCell.d.ts +1 -2
  4. package/dist/src/components/GridNoRowsOverlay.d.ts +3 -3
  5. package/dist/src/components/GridPopoverHook.d.ts +1 -1
  6. package/dist/src/components/GridWrapper.d.ts +1 -1
  7. package/dist/src/components/gridFilter/GridFilterDownloadCsvButton.d.ts +1 -2
  8. package/dist/src/components/gridFilter/GridFilterQuick.d.ts +1 -2
  9. package/dist/src/components/gridFilter/GridFilters.d.ts +1 -1
  10. package/dist/src/components/gridForm/GridFormDropDown.d.ts +1 -1
  11. package/dist/src/components/gridForm/GridFormEditBearing.d.ts +1 -2
  12. package/dist/src/components/gridForm/GridFormMessage.d.ts +1 -1
  13. package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +1 -1
  14. package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +1 -1
  15. package/dist/src/components/gridForm/GridFormTextInput.d.ts +1 -2
  16. package/dist/src/components/gridHeader/GridHeaderSelect.d.ts +1 -2
  17. package/dist/src/components/gridHook/useGridContextMenu.d.ts +1 -1
  18. package/dist/src/components/gridRender/GridRenderPopoutMenuCell.d.ts +1 -2
  19. package/dist/src/contexts/GridContext.d.ts +1 -1
  20. package/dist/src/contexts/GridPopoverContextProvider.d.ts +1 -1
  21. package/dist/src/contexts/GridUpdatingContextProvider.d.ts +1 -1
  22. package/dist/src/lui/ActionButton.d.ts +1 -1
  23. package/dist/src/lui/FormError.d.ts +1 -1
  24. package/dist/src/lui/TextAreaInput.d.ts +1 -1
  25. package/dist/src/lui/TextInputFormatted.d.ts +1 -1
  26. package/dist/src/react-menu3/components/ControlledMenu.d.ts +3 -3
  27. package/dist/src/react-menu3/components/FocusableItem.d.ts +2 -2
  28. package/dist/src/react-menu3/components/Menu.d.ts +2 -2
  29. package/dist/src/react-menu3/components/MenuButton.d.ts +1 -1
  30. package/dist/src/react-menu3/components/MenuDivider.d.ts +1 -1
  31. package/dist/src/react-menu3/components/MenuGroup.d.ts +2 -2
  32. package/dist/src/react-menu3/components/MenuHeader.d.ts +2 -2
  33. package/dist/src/react-menu3/components/MenuItem.d.ts +1 -1
  34. package/dist/src/react-menu3/components/MenuList.d.ts +1 -2
  35. package/dist/src/react-menu3/components/MenuRadioGroup.d.ts +2 -2
  36. package/dist/src/react-menu3/components/SubMenu.d.ts +2 -2
  37. package/dist/src/react-menu3/utils/utils.d.ts +1 -1
  38. package/dist/step-ag-grid.cjs.js +807 -3725
  39. package/dist/step-ag-grid.cjs.js.map +1 -1
  40. package/dist/step-ag-grid.esm.js +808 -3726
  41. package/dist/step-ag-grid.esm.js.map +1 -1
  42. package/package.json +27 -23
  43. package/src/components/Grid.tsx +14 -18
  44. package/src/components/GridIcon.tsx +2 -1
  45. package/src/components/GridNoRowsOverlay.tsx +7 -10
  46. package/src/contexts/GridContext.tsx +1 -1
  47. package/src/contexts/GridContextProvider.tsx +32 -13
  48. package/src/lui/ActionButton.tsx +2 -1
  49. package/src/lui/TextInputFormatted.tsx +2 -1
  50. package/src/lui/reactUtils.test.tsx +4 -3
  51. package/src/stories/components/ActionButton.stories.tsx +2 -1
  52. package/src/stories/grid/FormTest.tsx +2 -1
  53. package/src/stories/grid/GridFilterButtons.stories.tsx +5 -15
  54. package/src/stories/grid/GridNoRowsOverlay.stories.tsx +6 -3
  55. package/src/stories/grid/GridNonEditableRow.stories.tsx +4 -3
  56. package/src/stories/grid/GridPopoutContextMenu.stories.tsx +4 -3
  57. package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +4 -3
  58. package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +5 -4
  59. package/src/stories/grid/GridPopoverEditBearing.stories.tsx +4 -3
  60. package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +4 -3
  61. package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +4 -3
  62. package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +4 -3
  63. package/src/stories/grid/GridReadOnly.stories.tsx +12 -3
  64. package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +13 -10
  65. package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +13 -10
  66. package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +13 -10
  67. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +12 -9
  68. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +17 -14
  69. package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +17 -14
  70. package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +10 -7
  71. package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +12 -9
  72. package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +4 -1
  73. package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +4 -1
  74. package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +4 -1
  75. package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +4 -1
  76. package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +4 -1
  77. package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +4 -1
  78. package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +4 -1
  79. package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +4 -1
  80. package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +21 -12
  81. package/src/stories/react-menu/ReactMenu.stories.tsx +6 -4
@@ -1,9 +1,12 @@
1
+ import "../../../react-menu3/styles/index.scss";
2
+ import "../../../styles/index.scss";
3
+ import "@linzjs/lui/dist/scss/base.scss";
4
+
1
5
  import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
2
6
  import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
3
7
  import { useRef } from "react";
4
8
 
5
9
  import "@linzjs/lui/dist/fonts";
6
- import "@linzjs/lui/dist/scss/base.scss";
7
10
 
8
11
  import {
9
12
  GridContextProvider,
@@ -1,9 +1,12 @@
1
+ import "../../../react-menu3/styles/index.scss";
2
+ import "../../../styles/index.scss";
3
+ import "@linzjs/lui/dist/scss/base.scss";
4
+
1
5
  import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
2
6
  import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
3
7
  import { useRef } from "react";
4
8
 
5
9
  import "@linzjs/lui/dist/fonts";
6
- import "@linzjs/lui/dist/scss/base.scss";
7
10
 
8
11
  import { GridContextProvider, GridFormMessage } from "../../..";
9
12
 
@@ -1,9 +1,12 @@
1
+ import "../../../react-menu3/styles/index.scss";
2
+ import "../../../styles/index.scss";
3
+ import "@linzjs/lui/dist/scss/base.scss";
4
+
1
5
  import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
2
6
  import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
3
7
  import { useRef } from "react";
4
8
 
5
9
  import "@linzjs/lui/dist/fonts";
6
- import "@linzjs/lui/dist/scss/base.scss";
7
10
 
8
11
  import { GridBaseRow, GridContextProvider, GridFormMultiSelect, GridFormMultiSelectProps } from "../../..";
9
12
 
@@ -1,9 +1,12 @@
1
+ import "../../../react-menu3/styles/index.scss";
2
+ import "../../../styles/index.scss";
3
+ import "@linzjs/lui/dist/scss/base.scss";
4
+
1
5
  import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
2
6
  import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
3
7
  import { useRef } from "react";
4
8
 
5
9
  import "@linzjs/lui/dist/fonts";
6
- import "@linzjs/lui/dist/scss/base.scss";
7
10
 
8
11
  import {
9
12
  GridBaseRow,
@@ -1,9 +1,12 @@
1
+ import "../../../react-menu3/styles/index.scss";
2
+ import "../../../styles/index.scss";
3
+ import "@linzjs/lui/dist/scss/base.scss";
4
+
1
5
  import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
2
6
  import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
3
7
  import { useRef } from "react";
4
8
 
5
9
  import "@linzjs/lui/dist/fonts";
6
- import "@linzjs/lui/dist/scss/base.scss";
7
10
 
8
11
  import { GridBaseRow, GridContextProvider, GridFormTextArea, GridFormTextAreaProps } from "../../..";
9
12
 
@@ -1,9 +1,12 @@
1
+ import "../../../react-menu3/styles/index.scss";
2
+ import "../../../styles/index.scss";
3
+ import "@linzjs/lui/dist/scss/base.scss";
4
+
1
5
  import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
2
6
  import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
3
7
  import { useRef } from "react";
4
8
 
5
9
  import "@linzjs/lui/dist/fonts";
6
- import "@linzjs/lui/dist/scss/base.scss";
7
10
 
8
11
  import { GridBaseRow, GridContextProvider, GridFormTextInput, GridFormTextInputProps } from "../../..";
9
12
 
@@ -1,10 +1,13 @@
1
+ import "../../../styles/GridTheme.scss";
2
+ import "../../../styles/index.scss";
3
+ import "@linzjs/lui/dist/scss/base.scss";
4
+
1
5
  import { expect, jest } from "@storybook/jest";
2
6
  import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
3
7
  import { userEvent, waitFor } from "@storybook/testing-library";
4
8
  import { useMemo, useState } from "react";
5
9
 
6
10
  import "@linzjs/lui/dist/fonts";
7
- import "@linzjs/lui/dist/scss/base.scss";
8
11
 
9
12
  import {
10
13
  ColDefT,
@@ -21,8 +24,6 @@ import {
21
24
  MenuOption,
22
25
  wait,
23
26
  } from "../../../";
24
- import "../../../styles/GridTheme.scss";
25
- import "../../../styles/index.scss";
26
27
 
27
28
  export default {
28
29
  title: "Components / Grids",
@@ -34,6 +35,14 @@ export default {
34
35
  selectable: false,
35
36
  rowSelection: "single",
36
37
  },
38
+ // Storybook hangs otherwise
39
+ parameters: {
40
+ docs: {
41
+ source: {
42
+ type: "code",
43
+ },
44
+ },
45
+ },
37
46
  decorators: [
38
47
  (Story) => (
39
48
  <div style={{ width: 1024, height: 400 }}>
@@ -223,14 +232,14 @@ GridKeyboardInteractions.play = async ({ canvasElement }) => {
223
232
  expect(activeCell).toHaveAttribute("aria-colindex", "1");
224
233
  expect(activeCell?.parentElement).toHaveAttribute("row-index", "0");
225
234
  });
226
- userEvent.keyboard("{arrowdown}{arrowdown}");
227
- userEvent.keyboard("{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}");
235
+ await userEvent.keyboard("{arrowdown}{arrowdown}");
236
+ await userEvent.keyboard("{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}");
228
237
 
229
238
  // Test enter post focus
230
239
  const test = async (fn: () => any, colId: string, rowId: string) => {
231
- userEvent.keyboard("{Enter}");
240
+ await userEvent.keyboard("{Enter}");
232
241
  await wait(1000);
233
- userEvent.keyboard("{arrowdown}{arrowdown}");
242
+ await userEvent.keyboard("{arrowdown}{arrowdown}");
234
243
  fn();
235
244
  await waitFor(async () => {
236
245
  expect(multiEditAction).toHaveBeenCalled();
@@ -247,16 +256,16 @@ GridKeyboardInteractions.play = async ({ canvasElement }) => {
247
256
 
248
257
  await test(() => userEvent.keyboard("{Enter}"), "8", "2");
249
258
  await test(() => userEvent.tab(), "9", "2");
250
- userEvent.tab({ shift: true });
259
+ await userEvent.tab({ shift: true });
251
260
  await test(() => userEvent.tab({ shift: true }), "6", "2");
252
- userEvent.keyboard("{Esc}");
253
- userEvent.tab();
261
+ await userEvent.keyboard("{Esc}");
262
+ await userEvent.tab();
254
263
 
255
- userEvent.keyboard("{Enter}");
264
+ await userEvent.keyboard("{Enter}");
256
265
  await wait(250);
257
266
  expect(eAction).not.toHaveBeenCalled();
258
267
 
259
- userEvent.keyboard("e");
268
+ await userEvent.keyboard("e");
260
269
  await waitFor(async () => {
261
270
  expect(eAction).toHaveBeenCalled();
262
271
  });
@@ -1,3 +1,5 @@
1
+ import "../../react-menu3/styles/index.scss";
2
+
1
3
  import { expect, jest } from "@storybook/jest";
2
4
  import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
3
5
  import { userEvent, within } from "@storybook/testing-library";
@@ -42,7 +44,7 @@ ReactMenuControlled.play = async ({ canvasElement }) => {
42
44
  const canvas = within(canvasElement);
43
45
 
44
46
  const keyboard = async (key: string) => {
45
- userEvent.keyboard(key);
47
+ await userEvent.keyboard(key);
46
48
  await wait(100); // Wait for debounce
47
49
  };
48
50
 
@@ -51,13 +53,13 @@ ReactMenuControlled.play = async ({ canvasElement }) => {
51
53
 
52
54
  const openMenu = async () => {
53
55
  await wait(500); // Wait for debounce
54
- userEvent.click(menuButton);
56
+ await userEvent.click(menuButton);
55
57
  expect(await canvas.findByRole("menuitem", { name: "New File" })).toBeInTheDocument();
56
58
  };
57
59
 
58
60
  // Check menu closes on click outside
59
61
  await openMenu();
60
- userEvent.click(menuButton.parentElement as Element);
62
+ await userEvent.click(menuButton.parentElement as Element);
61
63
  expect(canvas.queryByRole("menuitem", { name: "New File" })).not.toBeInTheDocument();
62
64
 
63
65
  // Test arrow down/up
@@ -73,7 +75,7 @@ ReactMenuControlled.play = async ({ canvasElement }) => {
73
75
  expect(document.activeElement?.innerHTML).toBe("Print...");
74
76
 
75
77
  // Escape close
76
- userEvent.type(menuButton.parentElement as Element, "{Escape}");
78
+ await userEvent.type(menuButton.parentElement as Element, "{Escape}");
77
79
  expect(canvas.queryByRole("menuitem", { name: "New File" })).not.toBeInTheDocument();
78
80
 
79
81
  // Test enter to select