@linzjs/step-ag-grid 32.7.1 → 34.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 (66) hide show
  1. package/dist/src/components/PostSortRowsHook.test.d.ts +1 -0
  2. package/dist/src/components/gridFilter/GridFilterColumnsMultiSelect.d.ts +6 -25
  3. package/dist/src/components/gridForm/GridFormTextInput.d.ts +2 -1
  4. package/dist/src/utils/__tests__/storybookTestUtil.ts +1 -1
  5. package/dist/step-ag-grid.cjs +190 -206
  6. package/dist/step-ag-grid.cjs.map +1 -1
  7. package/dist/step-ag-grid.esm.js +190 -206
  8. package/dist/step-ag-grid.esm.js.map +1 -1
  9. package/package.json +17 -17
  10. package/src/components/Grid.tsx +8 -10
  11. package/src/components/PostSortRowsHook.test.ts +300 -0
  12. package/src/components/PostSortRowsHook.ts +127 -24
  13. package/src/components/gridFilter/GridFilterColumnsMultiSelect.tsx +110 -199
  14. package/src/components/gridForm/GridFormTextInput.tsx +2 -1
  15. package/src/components/gridHook/useGridRangeSelection.ts +8 -6
  16. package/src/contexts/GridContextProvider.tsx +5 -9
  17. package/src/react-menu3/components/ControlledMenu.tsx +5 -3
  18. package/src/react-menu3/components/MenuList.tsx +7 -3
  19. package/src/react-menu3/hooks/useItems.ts +1 -1
  20. package/src/stories/components/ActionButton.stories.tsx +12 -11
  21. package/src/stories/decorators/withOpenInPanelDecorator.tsx +35 -0
  22. package/src/stories/grid/GridCopy.stories.tsx +38 -35
  23. package/src/stories/grid/GridDragRow.stories.tsx +41 -36
  24. package/src/stories/grid/GridFilterButtons.stories.tsx +25 -19
  25. package/src/stories/grid/GridFilterColumnsMultiSelect.stories.tsx +42 -37
  26. package/src/stories/grid/GridInlineText.stories.tsx +62 -49
  27. package/src/stories/grid/GridNoRowsOverlay.stories.tsx +28 -23
  28. package/src/stories/grid/GridNonEditableRow.stories.tsx +30 -24
  29. package/src/stories/grid/GridPinnedRow.stories.tsx +37 -31
  30. package/src/stories/grid/GridPopoutContextMenu.stories.tsx +29 -24
  31. package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +89 -82
  32. package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +27 -22
  33. package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +29 -24
  34. package/src/stories/grid/GridPopoverEditBearing.stories.tsx +30 -25
  35. package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +29 -24
  36. package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +29 -24
  37. package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +28 -24
  38. package/src/stories/grid/GridReadOnly.stories.tsx +56 -52
  39. package/src/stories/grid/GridSorting.stories.tsx +498 -86
  40. package/src/stories/grid/GridViewList.stories.tsx +31 -26
  41. package/src/stories/grid/GridViewSelectableList.stories.tsx +31 -26
  42. package/src/stories/grid/gridAutosize/GridAutoSize.stories.tsx +41 -37
  43. package/src/stories/grid/gridAutosize/GridFitSize.stories.tsx +40 -36
  44. package/src/stories/grid/gridAutosize/GridFitSizeFlex.stories.tsx +40 -36
  45. package/src/stories/grid/gridAutosize/ShowPanelResizingAgGrid/ShowPanelResizingStepAgGrid.tsx +14 -6
  46. package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +74 -74
  47. package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +59 -59
  48. package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +58 -58
  49. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +62 -62
  50. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +118 -118
  51. package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +107 -105
  52. package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +72 -64
  53. package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +82 -73
  54. package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +12 -13
  55. package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +12 -13
  56. package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +11 -13
  57. package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +11 -13
  58. package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +11 -13
  59. package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +11 -13
  60. package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +11 -13
  61. package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +11 -13
  62. package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +110 -107
  63. package/src/stories/react-menu/ReactMenu.stories.tsx +70 -73
  64. package/src/styles/GridLoadableCell.scss +1 -1
  65. package/src/utils/__tests__/storybookTestUtil.ts +1 -1
  66. package/src/utils/useSharedInterval.ts +3 -3
@@ -1,4 +1,4 @@
1
- import { Meta, StoryFn } from '@storybook/react-vite';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { ReactElement, useCallback, useContext, useMemo, useState } from 'react';
3
3
 
4
4
  import {
@@ -16,26 +16,7 @@ import {
16
16
  } from '../..';
17
17
  import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
18
18
  import { IFormTestRow } from './FormTest';
19
-
20
- export default {
21
- title: 'Components / Grids',
22
- component: Grid,
23
- args: {
24
- quickFilterValue: '',
25
- selectable: true,
26
- },
27
- decorators: [
28
- (Story) => (
29
- <div style={{ width: 1024, height: 400 }}>
30
- <GridUpdatingContextProvider>
31
- <GridContextProvider>
32
- <Story />
33
- </GridContextProvider>
34
- </GridUpdatingContextProvider>
35
- </div>
36
- ),
37
- ],
38
- } as Meta<typeof Grid>;
19
+ import { withOpenInPanelDecorator } from '../decorators/withOpenInPanelDecorator';
39
20
 
40
21
  const ContextMenu = ({ clickedRow, colDef, close }: GridContextMenuComponentProps<IFormTestRow>): ReactElement => {
41
22
  const onClick = useCallback(() => {
@@ -58,7 +39,7 @@ const ContextMenu = ({ clickedRow, colDef, close }: GridContextMenuComponentProp
58
39
  );
59
40
  };
60
41
 
61
- const GridPopoutContextMenuTemplate: StoryFn<typeof Grid<IFormTestRow>> = (props: GridProps<IFormTestRow>) => {
42
+ const GridPopoutContextMenuTemplate = (props: GridProps<IFormTestRow>) => {
62
43
  const { selectRowsWithFlashDiff } = useContext(GridContext);
63
44
  const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
64
45
  const [rowData, setRowData] = useState([
@@ -131,5 +112,29 @@ const GridPopoutContextMenuTemplate: StoryFn<typeof Grid<IFormTestRow>> = (props
131
112
  );
132
113
  };
133
114
 
134
- export const _EditContextMenu = GridPopoutContextMenuTemplate.bind({});
135
- _EditContextMenu.play = waitForGridReady;
115
+ const meta: Meta<typeof GridPopoutContextMenuTemplate> = {
116
+ title: 'Components / Grids',
117
+ component: GridPopoutContextMenuTemplate,
118
+ args: {
119
+ selectable: true,
120
+ },
121
+ decorators: [
122
+ (Story) => (
123
+ <div style={{ width: 1024, height: 400 }}>
124
+ <GridUpdatingContextProvider>
125
+ <GridContextProvider>
126
+ <Story />
127
+ </GridContextProvider>
128
+ </GridUpdatingContextProvider>
129
+ </div>
130
+ ),
131
+ withOpenInPanelDecorator,
132
+ ],
133
+ };
134
+ export default meta;
135
+
136
+ type Story = StoryObj<typeof meta>;
137
+
138
+ export const _EditContextMenu: Story = {
139
+ play: waitForGridReady,
140
+ };
@@ -1,4 +1,4 @@
1
- import { Meta, StoryFn } from '@storybook/react-vite';
1
+ import { Meta, StoryFn, StoryObj } from '@storybook/react-vite';
2
2
  import { useMemo, useState } from 'react';
3
3
 
4
4
  import {
@@ -15,6 +15,7 @@ import {
15
15
  import { expect, userEvent, fireEvent, waitFor } from 'storybook/test';
16
16
 
17
17
  import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
18
+ import { withOpenInPanelDecorator } from '../decorators/withOpenInPanelDecorator';
18
19
 
19
20
  interface IBoolTestRow {
20
21
  id: number;
@@ -23,22 +24,6 @@ interface IBoolTestRow {
23
24
  boldMultiSelect: boolean;
24
25
  }
25
26
 
26
- export default {
27
- title: 'Components / Grids',
28
- component: Grid,
29
- decorators: [
30
- (Story) => (
31
- <div style={{ width: 1024, height: 400 }}>
32
- <GridUpdatingContextProvider>
33
- <GridContextProvider>
34
- <Story />
35
- </GridContextProvider>
36
- </GridUpdatingContextProvider>
37
- </div>
38
- ),
39
- ],
40
- } as Meta<typeof Grid>;
41
-
42
27
  const GridPopoutEditBooleanTemplate: StoryFn<typeof Grid> = () => {
43
28
  const [rowData, setRowData] = useState([
44
29
  { id: 1000, name: 'IS IS DP12345', boldSingleSelect: true, boldMultiSelect: false },
@@ -128,28 +113,50 @@ const GridPopoutEditBooleanTemplate: StoryFn<typeof Grid> = () => {
128
113
  );
129
114
  };
130
115
 
131
- export const _EditBoolean = GridPopoutEditBooleanTemplate.bind({});
132
- _EditBoolean.play = waitForGridReady;
116
+ const meta: Meta<typeof GridPopoutEditBooleanTemplate> = {
117
+ title: 'Components / Grids',
118
+ component: GridPopoutEditBooleanTemplate,
119
+ decorators: [
120
+ (Story) => (
121
+ <div style={{ width: 1024, height: 400 }}>
122
+ <GridUpdatingContextProvider>
123
+ <GridContextProvider>
124
+ <Story />
125
+ </GridContextProvider>
126
+ </GridUpdatingContextProvider>
127
+ </div>
128
+ ),
129
+ withOpenInPanelDecorator,
130
+ ],
131
+ };
132
+ export default meta;
133
133
 
134
- export const _EditBooleanRetainsFocusAfterToggle = GridPopoutEditBooleanTemplate.bind({});
135
- _EditBooleanRetainsFocusAfterToggle.play = async ({ canvasElement }) => {
136
- await waitForGridReady({ canvasElement });
134
+ type Story = StoryObj<typeof meta>;
137
135
 
138
- // Use boldMultiSelect (no async delay) so the redraw happens immediately
139
- const getBoolInput = () =>
140
- canvasElement.querySelector('.ag-cell[col-id="boldMultiSelect"] input.ag-checkbox-input') as HTMLElement;
136
+ export const _EditBoolean: Story = {
137
+ play: waitForGridReady,
138
+ };
139
+
140
+ export const _EditBooleanRetainsFocusAfterToggle: Story = {
141
+ play: async ({ canvasElement }) => {
142
+ await waitForGridReady({ canvasElement });
143
+
144
+ // Use boldMultiSelect (no async delay) so the redraw happens immediately
145
+ const getBoolInput = () =>
146
+ canvasElement.querySelector('.ag-cell[col-id="boldMultiSelect"] input.ag-checkbox-input') as HTMLElement;
141
147
 
142
- const button = canvasElement.querySelector('.ag-cell[col-id="boldMultiSelect"]') as HTMLElement;
143
- await expect(button).toBeInTheDocument();
144
- await fireEvent.click(button);
145
- await waitFor(() => expect(getBoolInput()).toHaveFocus(), { timeout: 1500 });
148
+ const button = canvasElement.querySelector('.ag-cell[col-id="boldMultiSelect"]') as HTMLElement;
149
+ await expect(button).toBeInTheDocument();
150
+ await fireEvent.click(button);
151
+ await waitFor(() => expect(getBoolInput()).toHaveFocus(), { timeout: 1500 });
146
152
 
147
- // Space toggles the checkbox, which triggers redrawRows — ag-grid moves focus from the
148
- // input to the cell div (role="gridcell"). The shared interval should detect this and restore focus.
149
- await fireEvent.keyPress(getBoolInput(), { key: 'Space', code: 'KeySpace' });
153
+ // Space toggles the checkbox, which triggers redrawRows — ag-grid moves focus from the
154
+ // input to the cell div (role="gridcell"). The shared interval should detect this and restore focus.
155
+ await fireEvent.keyPress(getBoolInput(), { key: 'Space', code: 'KeySpace' });
150
156
 
151
- // Re-query the input each retry since redraw replaces the DOM node
152
- await waitFor(() => expect(getBoolInput()).toHaveFocus(), { timeout: 1500 });
157
+ // Re-query the input each retry since redraw replaces the DOM node
158
+ await waitFor(() => expect(getBoolInput()).toHaveFocus(), { timeout: 1500 });
159
+ },
153
160
  };
154
161
 
155
162
  const selectRow = async (canvasElement: HTMLElement, rowId: string) => {
@@ -166,54 +173,54 @@ const getBoolInput = (canvasElement: HTMLElement, rowId: string, colId: string)
166
173
  `.ag-row[row-id="${rowId}"] .ag-cell[col-id="${colId}"] input.ag-checkbox-input`,
167
174
  ) as HTMLInputElement;
168
175
 
169
- export const _EditBooleanSingleSelectOnlyAffectsClickedRow = GridPopoutEditBooleanTemplate.bind({});
170
- _EditBooleanSingleSelectOnlyAffectsClickedRow.play = async (context) => {
171
- await waitForGridReady(context);
172
- const { canvasElement } = context;
173
-
174
- // Select both rows so we can prove single-select ignores the multi-row selection
175
- await selectRow(canvasElement, '1000');
176
- await selectRow(canvasElement, '1001');
177
-
178
- // Both rows start with boldSingleSelect: true
179
- await waitFor(() => {
180
- expect(getBoolInput(canvasElement, '1000', 'boldSingleSelect').checked).toBe(true);
181
- expect(getBoolInput(canvasElement, '1001', 'boldSingleSelect').checked).toBe(true);
182
- });
183
-
184
- // Click row 1000's boldSingleSelect — multiEdit defaults to false, so only row 1000 changes
185
- await userEvent.click(
186
- canvasElement.querySelector('.ag-row[row-id="1000"] .ag-cell[col-id="boldSingleSelect"]') as HTMLElement,
187
- );
188
-
189
- await waitFor(() => {
190
- expect(getBoolInput(canvasElement, '1000', 'boldSingleSelect').checked).toBe(false);
191
- expect(getBoolInput(canvasElement, '1001', 'boldSingleSelect').checked).toBe(true); // unchanged
192
- });
176
+ export const _EditBooleanSingleSelectOnlyAffectsClickedRow: Story = {
177
+ play: async ({ canvasElement }) => {
178
+ await waitForGridReady({ canvasElement });
179
+
180
+ // Select both rows so we can prove single-select ignores the multi-row selection
181
+ await selectRow(canvasElement, '1000');
182
+ await selectRow(canvasElement, '1001');
183
+
184
+ // Both rows start with boldSingleSelect: true
185
+ await waitFor(() => {
186
+ expect(getBoolInput(canvasElement, '1000', 'boldSingleSelect').checked).toBe(true);
187
+ expect(getBoolInput(canvasElement, '1001', 'boldSingleSelect').checked).toBe(true);
188
+ });
189
+
190
+ // Click row 1000's boldSingleSelect — multiEdit defaults to false, so only row 1000 changes
191
+ await userEvent.click(
192
+ canvasElement.querySelector('.ag-row[row-id="1000"] .ag-cell[col-id="boldSingleSelect"]') as HTMLElement,
193
+ );
194
+
195
+ await waitFor(() => {
196
+ expect(getBoolInput(canvasElement, '1000', 'boldSingleSelect').checked).toBe(false);
197
+ expect(getBoolInput(canvasElement, '1001', 'boldSingleSelect').checked).toBe(true); // unchanged
198
+ });
199
+ },
193
200
  };
194
201
 
195
- export const _EditBooleanMultiSelectEditsAllSelectedRows = GridPopoutEditBooleanTemplate.bind({});
196
- _EditBooleanMultiSelectEditsAllSelectedRows.play = async (context) => {
197
- await waitForGridReady(context);
198
- const { canvasElement } = context;
199
-
200
- // Select both rows before clicking
201
- await selectRow(canvasElement, '1000');
202
- await selectRow(canvasElement, '1001');
203
-
204
- // Both rows start with boldMultiSelect: false
205
- await waitFor(() => {
206
- expect(getBoolInput(canvasElement, '1000', 'boldMultiSelect').checked).toBe(false);
207
- expect(getBoolInput(canvasElement, '1001', 'boldMultiSelect').checked).toBe(false);
208
- });
209
-
210
- // Click row 1000's boldMultiSelect — multiEdit: true, so all selected rows change
211
- await userEvent.click(
212
- canvasElement.querySelector('.ag-row[row-id="1000"] .ag-cell[col-id="boldMultiSelect"]') as HTMLElement,
213
- );
214
-
215
- await waitFor(() => {
216
- expect(getBoolInput(canvasElement, '1000', 'boldMultiSelect').checked).toBe(true);
217
- expect(getBoolInput(canvasElement, '1001', 'boldMultiSelect').checked).toBe(true); // also changed
218
- });
202
+ export const _EditBooleanMultiSelectEditsAllSelectedRows: Story = {
203
+ play: async ({ canvasElement }) => {
204
+ await waitForGridReady({ canvasElement });
205
+
206
+ // Select both rows before clicking
207
+ await selectRow(canvasElement, '1000');
208
+ await selectRow(canvasElement, '1001');
209
+
210
+ // Both rows start with boldMultiSelect: false
211
+ await waitFor(() => {
212
+ expect(getBoolInput(canvasElement, '1000', 'boldMultiSelect').checked).toBe(false);
213
+ expect(getBoolInput(canvasElement, '1001', 'boldMultiSelect').checked).toBe(false);
214
+ });
215
+
216
+ // Click row 1000's boldMultiSelect — multiEdit: true, so all selected rows change
217
+ await userEvent.click(
218
+ canvasElement.querySelector('.ag-row[row-id="1000"] .ag-cell[col-id="boldMultiSelect"]') as HTMLElement,
219
+ );
220
+
221
+ await waitFor(() => {
222
+ expect(getBoolInput(canvasElement, '1000', 'boldMultiSelect').checked).toBe(true);
223
+ expect(getBoolInput(canvasElement, '1001', 'boldMultiSelect').checked).toBe(true); // also changed
224
+ });
225
+ },
219
226
  };
@@ -1,29 +1,12 @@
1
- import { Meta, StoryFn } from '@storybook/react-vite';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { useMemo, useState } from 'react';
3
3
 
4
4
  import { ColDefT, Grid, GridCell, GridContextProvider, GridProps, GridUpdatingContextProvider } from '../..';
5
5
  import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
6
6
  import { FormTest, IFormTestRow } from './FormTest';
7
+ import { withOpenInPanelDecorator } from '../decorators/withOpenInPanelDecorator';
7
8
 
8
- export default {
9
- title: 'Components / Grids',
10
- component: Grid,
11
- args: {
12
- quickFilterValue: '',
13
- selectable: true,
14
- },
15
- decorators: [
16
- (Story) => (
17
- <GridUpdatingContextProvider>
18
- <GridContextProvider>
19
- <Story />
20
- </GridContextProvider>
21
- </GridUpdatingContextProvider>
22
- ),
23
- ],
24
- } as Meta<typeof Grid>;
25
-
26
- const GridPopoutEditGenericTemplate: StoryFn<typeof Grid<IFormTestRow>> = (props: GridProps<IFormTestRow>) => {
9
+ const GridPopoutEditGenericTemplate = (props: GridProps<IFormTestRow>) => {
27
10
  const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
28
11
  const columnDefs: ColDefT<IFormTestRow>[] = useMemo(
29
12
  () => [
@@ -71,5 +54,27 @@ const GridPopoutEditGenericTemplate: StoryFn<typeof Grid<IFormTestRow>> = (props
71
54
  );
72
55
  };
73
56
 
74
- export const _EditGeneric = GridPopoutEditGenericTemplate.bind({});
75
- _EditGeneric.play = waitForGridReady;
57
+ const meta: Meta<typeof GridPopoutEditGenericTemplate> = {
58
+ title: 'Components / Grids',
59
+ component: GridPopoutEditGenericTemplate,
60
+ args: {
61
+ selectable: true,
62
+ },
63
+ decorators: [
64
+ (Story) => (
65
+ <GridUpdatingContextProvider>
66
+ <GridContextProvider>
67
+ <Story />
68
+ </GridContextProvider>
69
+ </GridUpdatingContextProvider>
70
+ ),
71
+ withOpenInPanelDecorator,
72
+ ],
73
+ };
74
+ export default meta;
75
+
76
+ type Story = StoryObj<typeof meta>;
77
+
78
+ export const _EditGeneric: Story = {
79
+ play: waitForGridReady,
80
+ };
@@ -1,4 +1,4 @@
1
- import { Meta, StoryFn } from '@storybook/react-vite';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { useCallback, useContext, useMemo, useState } from 'react';
3
3
 
4
4
  import {
@@ -22,28 +22,9 @@ import {
22
22
  } from '../..';
23
23
  import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
24
24
  import { IFormTestRow } from './FormTest';
25
+ import { withOpenInPanelDecorator } from '../decorators/withOpenInPanelDecorator';
25
26
 
26
- export default {
27
- title: 'Components / Grids',
28
- component: Grid,
29
- args: {
30
- quickFilterValue: '',
31
- selectable: true,
32
- },
33
- decorators: [
34
- (Story) => (
35
- <div style={{ width: 1024, height: 400 }}>
36
- <GridUpdatingContextProvider>
37
- <GridContextProvider>
38
- <Story />
39
- </GridContextProvider>
40
- </GridUpdatingContextProvider>
41
- </div>
42
- ),
43
- ],
44
- } as Meta<typeof Grid>;
45
-
46
- const GridPopoutEditGenericTemplate: StoryFn<typeof Grid<IFormTestRow>> = (props: GridProps<IFormTestRow>) => {
27
+ const GridPopoutEditGenericTemplate = (props: GridProps<IFormTestRow>) => {
47
28
  const { selectRowsWithFlashDiff } = useContext(GridContext);
48
29
  const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
49
30
  const [rowData, setRowData] = useState([
@@ -222,5 +203,29 @@ const GridPopoutEditGenericTemplate: StoryFn<typeof Grid<IFormTestRow>> = (props
222
203
  );
223
204
  };
224
205
 
225
- export const _EditGenericTextArea = GridPopoutEditGenericTemplate.bind({});
226
- _EditGenericTextArea.play = waitForGridReady;
206
+ const meta: Meta<typeof GridPopoutEditGenericTemplate> = {
207
+ title: 'Components / Grids',
208
+ component: GridPopoutEditGenericTemplate,
209
+ args: {
210
+ selectable: true,
211
+ },
212
+ decorators: [
213
+ (Story) => (
214
+ <div style={{ width: 1024, height: 400 }}>
215
+ <GridUpdatingContextProvider>
216
+ <GridContextProvider>
217
+ <Story />
218
+ </GridContextProvider>
219
+ </GridUpdatingContextProvider>
220
+ </div>
221
+ ),
222
+ withOpenInPanelDecorator,
223
+ ],
224
+ };
225
+ export default meta;
226
+
227
+ type Story = StoryObj<typeof meta>;
228
+
229
+ export const _EditGenericTextArea: Story = {
230
+ play: waitForGridReady,
231
+ };
@@ -1,4 +1,4 @@
1
- import { Meta, StoryFn } from '@storybook/react-vite';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { useMemo, useState } from 'react';
3
3
 
4
4
  import {
@@ -18,27 +18,7 @@ import {
18
18
  wait,
19
19
  } from '../..';
20
20
  import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
21
-
22
- export default {
23
- title: 'Components / Grids',
24
- component: Grid,
25
- args: {
26
- quickFilterValue: '',
27
- selectable: true,
28
- alwaysShowVerticalScroll: false,
29
- },
30
- decorators: [
31
- (Story) => (
32
- <div style={{ width: 1024, height: 400 }}>
33
- <GridUpdatingContextProvider>
34
- <GridContextProvider>
35
- <Story />
36
- </GridContextProvider>
37
- </GridUpdatingContextProvider>
38
- </div>
39
- ),
40
- ],
41
- } as Meta<typeof Grid>;
21
+ import { withOpenInPanelDecorator } from '../decorators/withOpenInPanelDecorator';
42
22
 
43
23
  interface ITestRow {
44
24
  id: number;
@@ -46,7 +26,7 @@ interface ITestRow {
46
26
  bearing: string | number | null;
47
27
  }
48
28
 
49
- const GridPopoverEditBearingTemplate: StoryFn<typeof Grid<ITestRow>> = (props: GridProps<ITestRow>) => {
29
+ const GridPopoverEditBearingTemplate = (props: GridProps<ITestRow>) => {
50
30
  const [externalSelectedIds, setExternalSelectedIds] = useState<number[]>([]);
51
31
  const columnDefs: ColDefT<ITestRow>[] = useMemo(
52
32
  () => [
@@ -116,5 +96,30 @@ const GridPopoverEditBearingTemplate: StoryFn<typeof Grid<ITestRow>> = (props: G
116
96
  );
117
97
  };
118
98
 
119
- export const _GridPopoverEditBearing = GridPopoverEditBearingTemplate.bind({});
120
- _GridPopoverEditBearing.play = waitForGridReady;
99
+ const meta: Meta<typeof GridPopoverEditBearingTemplate> = {
100
+ title: 'Components / Grids',
101
+ component: GridPopoverEditBearingTemplate,
102
+ args: {
103
+ selectable: true,
104
+ alwaysShowVerticalScroll: false,
105
+ },
106
+ decorators: [
107
+ (Story) => (
108
+ <div style={{ width: 1024, height: 400 }}>
109
+ <GridUpdatingContextProvider>
110
+ <GridContextProvider>
111
+ <Story />
112
+ </GridContextProvider>
113
+ </GridUpdatingContextProvider>
114
+ </div>
115
+ ),
116
+ withOpenInPanelDecorator,
117
+ ],
118
+ };
119
+ export default meta;
120
+
121
+ type Story = StoryObj<typeof meta>;
122
+
123
+ export const _GridPopoverEditBearing: Story = {
124
+ play: waitForGridReady,
125
+ };
@@ -1,4 +1,4 @@
1
- import { Meta, StoryFn } from '@storybook/react-vite';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { useCallback, useMemo, useState } from 'react';
3
3
 
4
4
  import {
@@ -24,26 +24,7 @@ import {
24
24
  wait,
25
25
  } from '../..';
26
26
  import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
27
-
28
- export default {
29
- title: 'Components / Grids',
30
- component: Grid,
31
- args: {
32
- quickFilterValue: '',
33
- selectable: true,
34
- },
35
- decorators: [
36
- (Story) => (
37
- <div style={{ width: 1224, height: 400 }}>
38
- <GridUpdatingContextProvider>
39
- <GridContextProvider>
40
- <Story />
41
- </GridContextProvider>
42
- </GridUpdatingContextProvider>
43
- </div>
44
- ),
45
- ],
46
- } as Meta<typeof Grid>;
27
+ import { withOpenInPanelDecorator } from '../decorators/withOpenInPanelDecorator';
47
28
 
48
29
  interface ITestRow {
49
30
  id: number;
@@ -60,7 +41,7 @@ interface ICode {
60
41
  desc: string;
61
42
  }
62
43
 
63
- const GridEditDropDownTemplate: StoryFn<typeof Grid<ITestRow>> = (props: GridProps<ITestRow>) => {
44
+ const GridEditDropDownTemplate = (props: GridProps<ITestRow>) => {
64
45
  const [externalSelectedIds, setExternalSelectedIds] = useState<number[]>([]);
65
46
 
66
47
  const optionsFn = useCallback(async (selectedRows: ITestRow[], filter?: string) => {
@@ -325,5 +306,29 @@ const GridEditDropDownTemplate: StoryFn<typeof Grid<ITestRow>> = (props: GridPro
325
306
  );
326
307
  };
327
308
 
328
- export const EditDropdown = GridEditDropDownTemplate.bind({});
329
- EditDropdown.play = waitForGridReady;
309
+ const meta: Meta<typeof GridEditDropDownTemplate> = {
310
+ title: 'Components / Grids',
311
+ component: GridEditDropDownTemplate,
312
+ args: {
313
+ selectable: true,
314
+ },
315
+ decorators: [
316
+ (Story) => (
317
+ <div style={{ width: 1224, height: 400 }}>
318
+ <GridUpdatingContextProvider>
319
+ <GridContextProvider>
320
+ <Story />
321
+ </GridContextProvider>
322
+ </GridUpdatingContextProvider>
323
+ </div>
324
+ ),
325
+ withOpenInPanelDecorator,
326
+ ],
327
+ };
328
+ export default meta;
329
+
330
+ type Story = StoryObj<typeof meta>;
331
+
332
+ export const EditDropdown: Story = {
333
+ play: waitForGridReady,
334
+ };
@@ -1,4 +1,4 @@
1
- import { Meta, StoryFn } from '@storybook/react-vite';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { isEmpty, partition } from 'lodash-es';
3
3
  import { useMemo, useState } from 'react';
4
4
 
@@ -16,26 +16,7 @@ import {
16
16
  wait,
17
17
  } from '../..';
18
18
  import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
19
-
20
- export default {
21
- title: 'Components / Grids',
22
- component: Grid,
23
- args: {
24
- quickFilterValue: '',
25
- selectable: true,
26
- },
27
- decorators: [
28
- (Story) => (
29
- <div style={{ width: 1024, height: 400 }}>
30
- <GridUpdatingContextProvider>
31
- <GridContextProvider>
32
- <Story />
33
- </GridContextProvider>
34
- </GridUpdatingContextProvider>
35
- </div>
36
- ),
37
- ],
38
- } as Meta<typeof Grid>;
19
+ import { withOpenInPanelDecorator } from '../decorators/withOpenInPanelDecorator';
39
20
 
40
21
  interface ITestRow {
41
22
  id: number;
@@ -44,7 +25,7 @@ interface ITestRow {
44
25
  position3: string | null;
45
26
  }
46
27
 
47
- const GridEditMultiSelectTemplate: StoryFn<typeof Grid<ITestRow>> = (props: GridProps<ITestRow>) => {
28
+ const GridEditMultiSelectTemplate = (props: GridProps<ITestRow>) => {
48
29
  const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
49
30
 
50
31
  const columnDefs: ColDefT<ITestRow>[] = useMemo(() => {
@@ -192,5 +173,29 @@ const GridEditMultiSelectTemplate: StoryFn<typeof Grid<ITestRow>> = (props: Grid
192
173
  );
193
174
  };
194
175
 
195
- export const EditMultiSelect = GridEditMultiSelectTemplate.bind({});
196
- EditMultiSelect.play = waitForGridReady;
176
+ const meta: Meta<typeof GridEditMultiSelectTemplate> = {
177
+ title: 'Components / Grids',
178
+ component: GridEditMultiSelectTemplate,
179
+ args: {
180
+ selectable: true,
181
+ },
182
+ decorators: [
183
+ (Story) => (
184
+ <div style={{ width: 1024, height: 400 }}>
185
+ <GridUpdatingContextProvider>
186
+ <GridContextProvider>
187
+ <Story />
188
+ </GridContextProvider>
189
+ </GridUpdatingContextProvider>
190
+ </div>
191
+ ),
192
+ withOpenInPanelDecorator,
193
+ ],
194
+ };
195
+ export default meta;
196
+
197
+ type Story = StoryObj<typeof meta>;
198
+
199
+ export const EditMultiSelect: Story = {
200
+ play: waitForGridReady,
201
+ };