@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.
- package/dist/src/components/PostSortRowsHook.test.d.ts +1 -0
- package/dist/src/components/gridFilter/GridFilterColumnsMultiSelect.d.ts +6 -25
- package/dist/src/components/gridForm/GridFormTextInput.d.ts +2 -1
- package/dist/src/utils/__tests__/storybookTestUtil.ts +1 -1
- package/dist/step-ag-grid.cjs +190 -206
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +190 -206
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +17 -17
- package/src/components/Grid.tsx +8 -10
- package/src/components/PostSortRowsHook.test.ts +300 -0
- package/src/components/PostSortRowsHook.ts +127 -24
- package/src/components/gridFilter/GridFilterColumnsMultiSelect.tsx +110 -199
- package/src/components/gridForm/GridFormTextInput.tsx +2 -1
- package/src/components/gridHook/useGridRangeSelection.ts +8 -6
- package/src/contexts/GridContextProvider.tsx +5 -9
- package/src/react-menu3/components/ControlledMenu.tsx +5 -3
- package/src/react-menu3/components/MenuList.tsx +7 -3
- package/src/react-menu3/hooks/useItems.ts +1 -1
- package/src/stories/components/ActionButton.stories.tsx +12 -11
- package/src/stories/decorators/withOpenInPanelDecorator.tsx +35 -0
- package/src/stories/grid/GridCopy.stories.tsx +38 -35
- package/src/stories/grid/GridDragRow.stories.tsx +41 -36
- package/src/stories/grid/GridFilterButtons.stories.tsx +25 -19
- package/src/stories/grid/GridFilterColumnsMultiSelect.stories.tsx +42 -37
- package/src/stories/grid/GridInlineText.stories.tsx +62 -49
- package/src/stories/grid/GridNoRowsOverlay.stories.tsx +28 -23
- package/src/stories/grid/GridNonEditableRow.stories.tsx +30 -24
- package/src/stories/grid/GridPinnedRow.stories.tsx +37 -31
- package/src/stories/grid/GridPopoutContextMenu.stories.tsx +29 -24
- package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +89 -82
- package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +27 -22
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +29 -24
- package/src/stories/grid/GridPopoverEditBearing.stories.tsx +30 -25
- package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +29 -24
- package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +29 -24
- package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +28 -24
- package/src/stories/grid/GridReadOnly.stories.tsx +56 -52
- package/src/stories/grid/GridSorting.stories.tsx +498 -86
- package/src/stories/grid/GridViewList.stories.tsx +31 -26
- package/src/stories/grid/GridViewSelectableList.stories.tsx +31 -26
- package/src/stories/grid/gridAutosize/GridAutoSize.stories.tsx +41 -37
- package/src/stories/grid/gridAutosize/GridFitSize.stories.tsx +40 -36
- package/src/stories/grid/gridAutosize/GridFitSizeFlex.stories.tsx +40 -36
- package/src/stories/grid/gridAutosize/ShowPanelResizingAgGrid/ShowPanelResizingStepAgGrid.tsx +14 -6
- package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +74 -74
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +59 -59
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +58 -58
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +62 -62
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +118 -118
- package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +107 -105
- package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +72 -64
- package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +82 -73
- package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +12 -13
- package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +12 -13
- package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +11 -13
- package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +11 -13
- package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +11 -13
- package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +11 -13
- package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +11 -13
- package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +11 -13
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +110 -107
- package/src/stories/react-menu/ReactMenu.stories.tsx +70 -73
- package/src/styles/GridLoadableCell.scss +1 -1
- package/src/utils/__tests__/storybookTestUtil.ts +1 -1
- package/src/utils/useSharedInterval.ts +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta,
|
|
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
|
|
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
|
-
|
|
135
|
-
|
|
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
|
-
|
|
132
|
-
|
|
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
|
-
|
|
135
|
-
_EditBooleanRetainsFocusAfterToggle.play = async ({ canvasElement }) => {
|
|
136
|
-
await waitForGridReady({ canvasElement });
|
|
134
|
+
type Story = StoryObj<typeof meta>;
|
|
137
135
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
-
|
|
152
|
-
|
|
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 =
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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 =
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
75
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
226
|
-
|
|
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,
|
|
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
|
|
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
|
-
|
|
120
|
-
|
|
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,
|
|
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
|
|
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
|
-
|
|
329
|
-
|
|
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,
|
|
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
|
|
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
|
-
|
|
196
|
-
|
|
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
|
+
};
|