@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, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryFn, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import { useMemo, useState } from 'react';
|
|
3
3
|
import { expect, within } from 'storybook/test';
|
|
4
4
|
import { fn } from 'storybook/test';
|
|
@@ -21,37 +21,7 @@ import {
|
|
|
21
21
|
wait,
|
|
22
22
|
} from '../../../';
|
|
23
23
|
import { waitForGridReady } from '../../../utils/__tests__/storybookTestUtil';
|
|
24
|
-
|
|
25
|
-
export default {
|
|
26
|
-
title: 'Components / Grids',
|
|
27
|
-
component: Grid,
|
|
28
|
-
args: {
|
|
29
|
-
quickFilter: true,
|
|
30
|
-
quickFilterValue: '',
|
|
31
|
-
quickFilterPlaceholder: 'Quick filter...',
|
|
32
|
-
selectable: false,
|
|
33
|
-
rowSelection: 'single',
|
|
34
|
-
},
|
|
35
|
-
// Storybook hangs otherwise
|
|
36
|
-
parameters: {
|
|
37
|
-
docs: {
|
|
38
|
-
source: {
|
|
39
|
-
type: 'code',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
decorators: [
|
|
44
|
-
(Story) => (
|
|
45
|
-
<div style={{ width: 1024, height: 400 }}>
|
|
46
|
-
<GridUpdatingContextProvider>
|
|
47
|
-
<GridContextProvider>
|
|
48
|
-
<Story />
|
|
49
|
-
</GridContextProvider>
|
|
50
|
-
</GridUpdatingContextProvider>
|
|
51
|
-
</div>
|
|
52
|
-
),
|
|
53
|
-
],
|
|
54
|
-
} as Meta<typeof Grid>;
|
|
24
|
+
import { withOpenInPanelDecorator } from '../../decorators/withOpenInPanelDecorator';
|
|
55
25
|
|
|
56
26
|
interface ITestRow {
|
|
57
27
|
id: number;
|
|
@@ -229,94 +199,127 @@ const GridKeyboardInteractionsTemplate: StoryFn<typeof Grid<ITestRow>> = (props:
|
|
|
229
199
|
);
|
|
230
200
|
};
|
|
231
201
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
202
|
+
const meta: Meta<typeof GridKeyboardInteractionsTemplate> = {
|
|
203
|
+
title: 'Components / Grids',
|
|
204
|
+
component: GridKeyboardInteractionsTemplate,
|
|
205
|
+
args: {
|
|
206
|
+
selectable: false,
|
|
207
|
+
rowSelection: 'single',
|
|
208
|
+
},
|
|
209
|
+
// Storybook hangs otherwise
|
|
210
|
+
parameters: {
|
|
211
|
+
docs: {
|
|
212
|
+
source: {
|
|
213
|
+
type: 'code',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
decorators: [
|
|
218
|
+
(Story) => (
|
|
219
|
+
<div style={{ width: 1024, height: 400 }}>
|
|
220
|
+
<GridUpdatingContextProvider>
|
|
221
|
+
<GridContextProvider>
|
|
222
|
+
<Story />
|
|
223
|
+
</GridContextProvider>
|
|
224
|
+
</GridUpdatingContextProvider>
|
|
225
|
+
</div>
|
|
226
|
+
),
|
|
227
|
+
withOpenInPanelDecorator,
|
|
228
|
+
],
|
|
229
|
+
};
|
|
230
|
+
export default meta;
|
|
231
|
+
|
|
232
|
+
type Story = StoryObj<typeof meta>;
|
|
235
233
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
await waitForGridReady({ canvasElement });
|
|
234
|
+
export const KeyboardInteractions: Story = {
|
|
235
|
+
play: async ({ canvasElement }) => {
|
|
236
|
+
const canvas = within(document.body);
|
|
240
237
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
expect(activeCell).toHaveAttribute('aria-colindex', '1');
|
|
246
|
-
expect(activeCell?.parentElement).toHaveAttribute('row-index', '0');
|
|
247
|
-
});
|
|
248
|
-
console.log('arrow down to 3rd row');
|
|
249
|
-
await userEvent.keyboard('{arrowdown}{arrowdown}');
|
|
250
|
-
console.log('arrow right to first popup menu');
|
|
251
|
-
await userEvent.keyboard('{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}');
|
|
238
|
+
multiEditAction.mockClear();
|
|
239
|
+
eAction.mockClear();
|
|
240
|
+
bulkEditingCallback.mockClear();
|
|
241
|
+
await waitForGridReady({ canvasElement });
|
|
252
242
|
|
|
253
|
-
|
|
254
|
-
const test = async (fn: () => Promise<any>, coldIndex: string, rowIndex: string) => {
|
|
255
|
-
await userEvent.keyboard('{Enter}');
|
|
243
|
+
// Ensure first row/cell is selected on render
|
|
256
244
|
await waitFor(() => {
|
|
257
|
-
|
|
245
|
+
const activeCell = canvasElement.ownerDocument.activeElement;
|
|
246
|
+
expect(activeCell).toHaveClass('ag-cell-focus');
|
|
247
|
+
expect(activeCell).toHaveAttribute('aria-colindex', '1');
|
|
248
|
+
expect(activeCell?.parentElement).toHaveAttribute('row-index', '0');
|
|
258
249
|
});
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
250
|
+
console.log('arrow down to 3rd row');
|
|
251
|
+
await userEvent.keyboard('{arrowdown}{arrowdown}');
|
|
252
|
+
console.log('arrow right to first popup menu');
|
|
253
|
+
await userEvent.keyboard('{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}');
|
|
254
|
+
|
|
255
|
+
// Test enter post focus
|
|
256
|
+
const test = async (fn: () => Promise<any>, coldIndex: string, rowIndex: string) => {
|
|
257
|
+
await userEvent.keyboard('{Enter}');
|
|
262
258
|
await waitFor(() => {
|
|
263
|
-
|
|
264
|
-
expect(menuItems[i]).toHaveClass('szh-menu__item--hover');
|
|
259
|
+
expect(canvasElement.ownerDocument.querySelector('.szh-menu')).toBeInTheDocument();
|
|
265
260
|
});
|
|
266
|
-
|
|
267
|
-
|
|
261
|
+
await wait(1000);
|
|
262
|
+
for (let i = 0; i < 2; i++) {
|
|
263
|
+
await userEvent.keyboard('{arrowdown}');
|
|
264
|
+
await waitFor(() => {
|
|
265
|
+
const menuItems = canvasElement.ownerDocument.querySelectorAll('[role="menuitem"]');
|
|
266
|
+
expect(menuItems[i]).toHaveClass('szh-menu__item--hover');
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
await fn();
|
|
268
270
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
271
|
+
await waitFor(() => {
|
|
272
|
+
const activeCell = canvasElement.ownerDocument.activeElement;
|
|
273
|
+
expect(activeCell).toHaveClass('ag-cell-focus');
|
|
274
|
+
expect(activeCell).toHaveAttribute('aria-colindex', coldIndex);
|
|
275
|
+
expect(activeCell?.parentElement).toHaveAttribute('row-index', rowIndex);
|
|
276
|
+
});
|
|
277
|
+
await wait(200);
|
|
278
|
+
};
|
|
277
279
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
280
|
+
console.log('At 2nd to last cell open the popup menu and select 2nd option');
|
|
281
|
+
await test(() => userEvent.keyboard('{Enter}'), '8', '2');
|
|
282
|
+
await expect(multiEditAction).toHaveBeenCalled();
|
|
281
283
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
284
|
+
console.log('Open 2nd to last popup menu, tab to next disabled popup should fail');
|
|
285
|
+
await test(() => userEvent.tab(), '8', '2');
|
|
286
|
+
await expect(bulkEditingCallback).toHaveBeenCalled();
|
|
287
|
+
bulkEditingCallback.mockClear();
|
|
286
288
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
289
|
+
console.log('Open 2nd to last popup menu, tab to desc cell');
|
|
290
|
+
await test(() => userEvent.tab({ shift: true }), '5', '2');
|
|
291
|
+
console.log('Cancel edit');
|
|
292
|
+
await wait(500);
|
|
293
|
+
await userEvent.keyboard('{Esc}');
|
|
294
|
+
await expect(bulkEditingCallback).toHaveBeenCalled();
|
|
295
|
+
bulkEditingCallback.mockClear();
|
|
296
|
+
await wait(500);
|
|
295
297
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
298
|
+
console.log('Open desc cell');
|
|
299
|
+
await userEvent.keyboard('{Enter}');
|
|
300
|
+
const textInput = await canvas.findByRole('textbox');
|
|
301
|
+
await expect(textInput).toBeInTheDocument();
|
|
302
|
+
await userEvent.clear(textInput);
|
|
303
|
+
await userEvent.type(textInput, 'foo');
|
|
302
304
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
+
await userEvent.tab();
|
|
306
|
+
await userEvent.keyboard('{arrowleft}{arrowleft}{arrowleft}');
|
|
305
307
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
308
|
+
await userEvent.keyboard('{Enter}');
|
|
309
|
+
await waitFor(
|
|
310
|
+
async () => {
|
|
311
|
+
await canvas.findByText(/There are 1 row/);
|
|
312
|
+
},
|
|
313
|
+
{ timeout: 5000 },
|
|
314
|
+
);
|
|
315
|
+
await userEvent.keyboard('{Esc}');
|
|
316
|
+
await userEvent.tab();
|
|
315
317
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
318
|
+
await expect(eAction).not.toHaveBeenCalled();
|
|
319
|
+
await userEvent.keyboard('{Enter}');
|
|
320
|
+
await userEvent.keyboard('e');
|
|
321
|
+
await waitFor(() => {
|
|
322
|
+
expect(eAction).toHaveBeenCalled();
|
|
323
|
+
});
|
|
324
|
+
},
|
|
322
325
|
};
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
import '
|
|
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
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
};
|
|
@@ -23,7 +23,7 @@ export const clickColumnHeaderToSort = async (colId: string, within: HTMLElement
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export const getNumberOfGridRows = (props?: { grid?: HTMLElement }): number => {
|
|
26
|
-
return queryAllQuick({ classes: '.ag-row' }, props?.grid).length;
|
|
26
|
+
return queryAllQuick({ classes: '.ag-center-cols-viewport .ag-row' }, props?.grid).length;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export const gridColumnValues = (colId: string, within: HTMLElement): string[] => {
|
|
@@ -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
|
+
};
|