@linzjs/step-ag-grid 32.7.0 → 33.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 (58) hide show
  1. package/dist/src/components/gridFilter/GridFilterColumnsMultiSelect.d.ts +6 -25
  2. package/dist/step-ag-grid.cjs +115 -181
  3. package/dist/step-ag-grid.cjs.map +1 -1
  4. package/dist/step-ag-grid.esm.js +115 -181
  5. package/dist/step-ag-grid.esm.js.map +1 -1
  6. package/package.json +17 -17
  7. package/src/components/Grid.tsx +6 -4
  8. package/src/components/gridFilter/GridFilterColumnsMultiSelect.tsx +110 -199
  9. package/src/components/gridHook/useGridRangeSelection.ts +8 -6
  10. package/src/react-menu3/components/ControlledMenu.tsx +5 -3
  11. package/src/react-menu3/components/MenuList.tsx +6 -3
  12. package/src/react-menu3/hooks/useItems.ts +1 -1
  13. package/src/stories/components/ActionButton.stories.tsx +12 -11
  14. package/src/stories/decorators/withOpenInPanelDecorator.tsx +35 -0
  15. package/src/stories/grid/GridCopy.stories.tsx +38 -35
  16. package/src/stories/grid/GridDragRow.stories.tsx +41 -36
  17. package/src/stories/grid/GridFilterButtons.stories.tsx +25 -19
  18. package/src/stories/grid/GridFilterColumnsMultiSelect.stories.tsx +42 -37
  19. package/src/stories/grid/GridInlineText.stories.tsx +42 -35
  20. package/src/stories/grid/GridNoRowsOverlay.stories.tsx +28 -23
  21. package/src/stories/grid/GridNonEditableRow.stories.tsx +30 -24
  22. package/src/stories/grid/GridPinnedRow.stories.tsx +37 -31
  23. package/src/stories/grid/GridPopoutContextMenu.stories.tsx +29 -24
  24. package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +89 -82
  25. package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +27 -22
  26. package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +29 -24
  27. package/src/stories/grid/GridPopoverEditBearing.stories.tsx +30 -25
  28. package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +29 -24
  29. package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +29 -24
  30. package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +28 -24
  31. package/src/stories/grid/GridReadOnly.stories.tsx +56 -52
  32. package/src/stories/grid/GridSorting.stories.tsx +81 -79
  33. package/src/stories/grid/GridViewList.stories.tsx +31 -26
  34. package/src/stories/grid/GridViewSelectableList.stories.tsx +31 -26
  35. package/src/stories/grid/gridAutosize/GridAutoSize.stories.tsx +41 -37
  36. package/src/stories/grid/gridAutosize/GridFitSize.stories.tsx +40 -36
  37. package/src/stories/grid/gridAutosize/GridFitSizeFlex.stories.tsx +40 -36
  38. package/src/stories/grid/gridAutosize/ShowPanelResizingAgGrid/ShowPanelResizingStepAgGrid.tsx +14 -6
  39. package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +74 -74
  40. package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +59 -59
  41. package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +58 -58
  42. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +62 -62
  43. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +118 -118
  44. package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +107 -105
  45. package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +72 -64
  46. package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +82 -73
  47. package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +12 -13
  48. package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +12 -13
  49. package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +11 -13
  50. package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +11 -13
  51. package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +11 -13
  52. package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +11 -13
  53. package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +11 -13
  54. package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +11 -13
  55. package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +110 -107
  56. package/src/stories/react-menu/ReactMenu.stories.tsx +70 -73
  57. package/src/styles/GridLoadableCell.scss +1 -1
  58. package/src/utils/useSharedInterval.ts +3 -3
@@ -1,27 +1,15 @@
1
- import '../../react-menu3/styles/index.scss';
2
-
3
- import { Meta, StoryFn } from '@storybook/react-vite';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
4
2
  import { expect } from 'storybook/test';
5
3
  import * as test from 'storybook/test';
6
4
  import { userEvent, within } from 'storybook/test';
7
5
 
8
- import { Grid } from '../../components/Grid';
9
6
  import { Menu, MenuButton, MenuDivider, MenuItem, SubMenu } from '../../react-menu3';
10
7
  import { wait } from '../../utils/util';
11
8
 
12
- export default {
13
- title: 'Components / React-menu',
14
- component: Grid,
15
- args: {
16
- externalSelectedItems: [],
17
- setExternalSelectedItems: () => {},
18
- },
19
- } as Meta<typeof Grid>;
20
-
21
9
  const menuItemClickAction = test.fn();
22
10
  const newFileAction = test.fn();
23
11
 
24
- const ReactMenuTemplate: StoryFn<typeof Grid> = () => {
12
+ const ReactMenuTemplate = () => {
25
13
  return (
26
14
  <>
27
15
  <Menu menuButton={<MenuButton>Open menu</MenuButton>} onItemClick={menuItemClickAction}>
@@ -40,63 +28,72 @@ const ReactMenuTemplate: StoryFn<typeof Grid> = () => {
40
28
  );
41
29
  };
42
30
 
43
- export const ReactMenuControlled = ReactMenuTemplate.bind({});
44
- ReactMenuControlled.play = async ({ canvasElement }) => {
45
- const canvas = within(canvasElement);
46
-
47
- const keyboard = async (key: string) => {
48
- await userEvent.keyboard(key);
49
- await wait(100); // Wait for debounce
50
- };
51
-
52
- const menuButton = await canvas.findByRole('button');
53
- expect(menuButton).toBeInTheDocument();
54
-
55
- const openMenu = async () => {
56
- await wait(500); // Wait for debounce
57
- await userEvent.click(menuButton);
58
- expect(await canvas.findByRole('menuitem', { name: 'New File' })).toBeInTheDocument();
59
- };
60
-
61
- // Check menu closes on click outside
62
- await openMenu();
63
- await userEvent.click(menuButton.parentElement as Element);
64
- expect(canvas.queryByRole('menuitem', { name: 'New File' })).not.toBeInTheDocument();
65
-
66
- // Test arrow down/up
67
- await openMenu();
68
- await keyboard('{arrowdown}');
69
- await keyboard('{arrowdown}');
70
- await keyboard('{arrowdown}');
71
- await keyboard('{arrowdown}');
72
- await keyboard('{arrowdown}');
73
- expect(document.activeElement?.innerHTML).toBe('Exit');
74
-
75
- await keyboard('{arrowup}');
76
- expect(document.activeElement?.innerHTML).toBe('Print...');
77
-
78
- // Escape close
79
- await userEvent.type(menuButton.parentElement as Element, '{Escape}');
80
- expect(canvas.queryByRole('menuitem', { name: 'New File' })).not.toBeInTheDocument();
81
-
82
- // Test enter to select
83
- await openMenu();
84
- await keyboard('{arrowdown}');
85
- await keyboard('{enter}');
86
- expect(menuItemClickAction).toHaveBeenCalled();
87
- expect(newFileAction).toHaveBeenCalled();
88
-
89
- menuItemClickAction.mockClear();
90
- newFileAction.mockClear();
91
-
92
- // Test tab to select
93
- await openMenu();
94
- await keyboard('{arrowdown}');
95
- // For some reason arrow down takes a little time to activate
96
- await wait(10);
97
- await keyboard('{Tab}');
98
- expect(menuItemClickAction).toHaveBeenCalled();
99
- expect(newFileAction).toHaveBeenCalled();
100
-
101
- newFileAction.mockClear();
31
+ const meta: Meta<typeof ReactMenuTemplate> = {
32
+ title: 'Components / React-menu',
33
+ component: ReactMenuTemplate,
34
+ };
35
+ export default meta;
36
+
37
+ type Story = StoryObj<typeof meta>;
38
+
39
+ export const ReactMenuControlled: Story = {
40
+ play: async ({ canvasElement }) => {
41
+ const canvas = within(canvasElement);
42
+
43
+ const keyboard = async (key: string) => {
44
+ await userEvent.keyboard(key);
45
+ await wait(100); // Wait for debounce
46
+ };
47
+
48
+ const menuButton = await canvas.findByRole('button');
49
+ await expect(menuButton).toBeInTheDocument();
50
+
51
+ const openMenu = async () => {
52
+ await wait(500); // Wait for debounce
53
+ await userEvent.click(menuButton);
54
+ await expect(await canvas.findByRole('menuitem', { name: 'New File' })).toBeInTheDocument();
55
+ };
56
+
57
+ // Check menu closes on click outside
58
+ await openMenu();
59
+ await userEvent.click(menuButton.parentElement as Element);
60
+ await expect(canvas.queryByRole('menuitem', { name: 'New File' })).not.toBeInTheDocument();
61
+
62
+ // Test arrow down/up
63
+ await openMenu();
64
+ await keyboard('{arrowdown}');
65
+ await keyboard('{arrowdown}');
66
+ await keyboard('{arrowdown}');
67
+ await keyboard('{arrowdown}');
68
+ await keyboard('{arrowdown}');
69
+ await expect(document.activeElement?.innerHTML).toBe('Exit');
70
+
71
+ await keyboard('{arrowup}');
72
+ await expect(document.activeElement?.innerHTML).toBe('Print...');
73
+
74
+ // Escape close
75
+ await userEvent.type(menuButton.parentElement as Element, '{Escape}');
76
+ await expect(canvas.queryByRole('menuitem', { name: 'New File' })).not.toBeInTheDocument();
77
+
78
+ // Test enter to select
79
+ await openMenu();
80
+ await keyboard('{arrowdown}');
81
+ await keyboard('{enter}');
82
+ await expect(menuItemClickAction).toHaveBeenCalled();
83
+ await expect(newFileAction).toHaveBeenCalled();
84
+
85
+ menuItemClickAction.mockClear();
86
+ newFileAction.mockClear();
87
+
88
+ // Test tab to select
89
+ await openMenu();
90
+ await keyboard('{arrowdown}');
91
+ // For some reason arrow down takes a little time to activate
92
+ await wait(10);
93
+ await keyboard('{Tab}');
94
+ await expect(menuItemClickAction).toHaveBeenCalled();
95
+ await expect(newFileAction).toHaveBeenCalled();
96
+
97
+ newFileAction.mockClear();
98
+ },
102
99
  };
@@ -7,4 +7,4 @@
7
7
 
8
8
  .GridCellAlignCenter .GridLoadableCell-container {
9
9
  justify-content: center;
10
- }
10
+ }
@@ -21,7 +21,7 @@ const startSharedInterval = () => {
21
21
  }
22
22
  });
23
23
  }, 100);
24
- }
24
+ };
25
25
 
26
26
  const stopSharedInterval = () => {
27
27
  if (sharedIntervalId === null) {
@@ -29,7 +29,7 @@ const stopSharedInterval = () => {
29
29
  }
30
30
  clearInterval(sharedIntervalId);
31
31
  sharedIntervalId = null;
32
- }
32
+ };
33
33
 
34
34
  /**
35
35
  * Like useInterval, but all callers share a single 100ms interval.
@@ -54,4 +54,4 @@ export const useSharedInterval = (callback: () => void) => {
54
54
  }
55
55
  };
56
56
  }, []);
57
- }
57
+ };