@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.
- package/dist/src/components/gridFilter/GridFilterColumnsMultiSelect.d.ts +6 -25
- package/dist/step-ag-grid.cjs +115 -181
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +115 -181
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +17 -17
- package/src/components/Grid.tsx +6 -4
- package/src/components/gridFilter/GridFilterColumnsMultiSelect.tsx +110 -199
- package/src/components/gridHook/useGridRangeSelection.ts +8 -6
- package/src/react-menu3/components/ControlledMenu.tsx +5 -3
- package/src/react-menu3/components/MenuList.tsx +6 -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 +42 -35
- 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 +81 -79
- 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/useSharedInterval.ts +3 -3
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
@@ -13,13 +9,7 @@ import {
|
|
|
13
9
|
GridPopoverEditBearingEditorParams,
|
|
14
10
|
} from '../../..';
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
title: 'GridForm / Static Tests',
|
|
18
|
-
component: GridFormEditBearing,
|
|
19
|
-
args: {},
|
|
20
|
-
} as Meta<typeof GridFormEditBearing>;
|
|
21
|
-
|
|
22
|
-
const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearingProps<any>) => {
|
|
12
|
+
const Template = (props: GridFormEditBearingProps<any>) => {
|
|
23
13
|
const values: [string, GridFormEditBearingProps<any>, number | null][] = [
|
|
24
14
|
['Null value', {}, null],
|
|
25
15
|
['Custom placeholder', { placeHolder: 'Custom placeholder' }, null],
|
|
@@ -52,4 +42,13 @@ const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearin
|
|
|
52
42
|
);
|
|
53
43
|
};
|
|
54
44
|
|
|
55
|
-
|
|
45
|
+
const meta: Meta<typeof Template> = {
|
|
46
|
+
title: 'GridForm / Static Tests',
|
|
47
|
+
component: Template,
|
|
48
|
+
args: {},
|
|
49
|
+
};
|
|
50
|
+
export default meta;
|
|
51
|
+
|
|
52
|
+
type Story = StoryObj<typeof meta>;
|
|
53
|
+
|
|
54
|
+
export const GridFormEditBearing_: Story = {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
@@ -13,13 +9,7 @@ import {
|
|
|
13
9
|
GridPopoverEditBearingCorrectionEditorParams,
|
|
14
10
|
} from '../../..';
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
title: 'GridForm / Static Tests',
|
|
18
|
-
component: GridFormEditBearing,
|
|
19
|
-
args: {},
|
|
20
|
-
} as Meta<typeof GridFormEditBearing>;
|
|
21
|
-
|
|
22
|
-
const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearingProps<any>) => {
|
|
12
|
+
const Template = (props: GridFormEditBearingProps<any>) => {
|
|
23
13
|
const values: [string, GridFormEditBearingProps<any>, number | null][] = [
|
|
24
14
|
['Null value', {}, null],
|
|
25
15
|
['Custom placeholder', { placeHolder: 'Custom placeholder' }, null],
|
|
@@ -52,4 +42,12 @@ const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearin
|
|
|
52
42
|
);
|
|
53
43
|
};
|
|
54
44
|
|
|
55
|
-
|
|
45
|
+
const meta: Meta<typeof Template> = {
|
|
46
|
+
title: 'GridForm / Static Tests',
|
|
47
|
+
component: Template,
|
|
48
|
+
};
|
|
49
|
+
export default meta;
|
|
50
|
+
|
|
51
|
+
type Story = StoryObj<typeof meta>;
|
|
52
|
+
|
|
53
|
+
export const GridFormEditBearingCorrection_: Story = {};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
9
5
|
import { GridContextProvider, GridFormMessage, GridFormMessageProps } from '../../..';
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
title: 'GridForm / Static Tests',
|
|
13
|
-
component: GridFormMessage,
|
|
14
|
-
args: {},
|
|
15
|
-
} as Meta<typeof GridFormMessage>;
|
|
16
|
-
|
|
17
|
-
const Template: StoryFn<typeof GridFormMessage> = (props: GridFormMessageProps<any>) => {
|
|
7
|
+
const Template = (props: GridFormMessageProps<any>) => {
|
|
18
8
|
const anchorRef1 = useRef<HTMLHeadingElement>(null);
|
|
19
9
|
|
|
20
10
|
return (
|
|
@@ -29,4 +19,12 @@ const Template: StoryFn<typeof GridFormMessage> = (props: GridFormMessageProps<a
|
|
|
29
19
|
);
|
|
30
20
|
};
|
|
31
21
|
|
|
32
|
-
|
|
22
|
+
const meta: Meta<typeof Template> = {
|
|
23
|
+
title: 'GridForm / Static Tests',
|
|
24
|
+
component: Template,
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
|
|
30
|
+
export const GridFormMessage_: Story = {};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
9
5
|
import { GridBaseRow, GridContextProvider, GridFormMultiSelect, GridFormMultiSelectProps } from '../../..';
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
title: 'GridForm / Static Tests',
|
|
13
|
-
component: GridFormMultiSelect,
|
|
14
|
-
args: {},
|
|
15
|
-
} as Meta<typeof GridFormMultiSelect>;
|
|
16
|
-
|
|
17
|
-
const Template: StoryFn<typeof GridFormMultiSelect> = (props) => {
|
|
7
|
+
const Template = (props: GridFormMultiSelectProps<any>) => {
|
|
18
8
|
const configs: [string, GridFormMultiSelectProps<GridBaseRow>, string?][] = [
|
|
19
9
|
['No options', { options: [] }],
|
|
20
10
|
['Custom no options', { options: [], noOptionsMessage: 'Custom no options' }],
|
|
@@ -67,4 +57,12 @@ const Template: StoryFn<typeof GridFormMultiSelect> = (props) => {
|
|
|
67
57
|
);
|
|
68
58
|
};
|
|
69
59
|
|
|
70
|
-
|
|
60
|
+
const meta: Meta<typeof Template> = {
|
|
61
|
+
title: 'GridForm / Static Tests',
|
|
62
|
+
component: Template,
|
|
63
|
+
};
|
|
64
|
+
export default meta;
|
|
65
|
+
|
|
66
|
+
type Story = StoryObj<typeof meta>;
|
|
67
|
+
|
|
68
|
+
export const GridFormMultiSelect_: Story = {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
@@ -14,13 +10,7 @@ import {
|
|
|
14
10
|
PopoutMenuSeparator,
|
|
15
11
|
} from '../../..';
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
title: 'GridForm / Static Tests',
|
|
19
|
-
component: GridFormPopoverMenu,
|
|
20
|
-
args: {},
|
|
21
|
-
} as Meta<typeof GridFormPopoverMenu>;
|
|
22
|
-
|
|
23
|
-
const Template: StoryFn<typeof GridFormPopoverMenu> = (props) => {
|
|
13
|
+
const Template = (props: GridFormPopoverMenuProps<any>) => {
|
|
24
14
|
const configs: [string, GridFormPopoverMenuProps<GridBaseRow>][] = [
|
|
25
15
|
['No options', { options: () => [] }],
|
|
26
16
|
[
|
|
@@ -63,4 +53,12 @@ const Template: StoryFn<typeof GridFormPopoverMenu> = (props) => {
|
|
|
63
53
|
);
|
|
64
54
|
};
|
|
65
55
|
|
|
66
|
-
|
|
56
|
+
const meta: Meta<typeof Template> = {
|
|
57
|
+
title: 'GridForm / Static Tests',
|
|
58
|
+
component: Template,
|
|
59
|
+
};
|
|
60
|
+
export default meta;
|
|
61
|
+
|
|
62
|
+
type Story = StoryObj<typeof meta>;
|
|
63
|
+
|
|
64
|
+
export const GridFormPopoverMenu_: Story = {};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
9
5
|
import { GridBaseRow, GridContextProvider, GridFormTextArea, GridFormTextAreaProps } from '../../..';
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
title: 'GridForm / Static Tests',
|
|
13
|
-
component: GridFormTextArea,
|
|
14
|
-
args: {},
|
|
15
|
-
} as Meta<typeof GridFormTextArea>;
|
|
16
|
-
|
|
17
|
-
const Template: StoryFn<typeof GridFormTextArea> = (props: GridFormTextAreaProps<any>) => {
|
|
7
|
+
const Template = (props: GridFormTextAreaProps<any>) => {
|
|
18
8
|
const configs: [string, GridFormTextAreaProps<GridBaseRow>, string?][] = [
|
|
19
9
|
['Text area', {}],
|
|
20
10
|
['Text area with text', {}, 'Some text'],
|
|
@@ -41,4 +31,12 @@ const Template: StoryFn<typeof GridFormTextArea> = (props: GridFormTextAreaProps
|
|
|
41
31
|
);
|
|
42
32
|
};
|
|
43
33
|
|
|
44
|
-
|
|
34
|
+
const meta: Meta<typeof Template> = {
|
|
35
|
+
title: 'GridForm / Static Tests',
|
|
36
|
+
component: Template,
|
|
37
|
+
};
|
|
38
|
+
export default meta;
|
|
39
|
+
|
|
40
|
+
type Story = StoryObj<typeof meta>;
|
|
41
|
+
|
|
42
|
+
export const GridFormTextArea_: Story = {};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
9
5
|
import { GridBaseRow, GridContextProvider, GridFormTextInput, GridFormTextInputProps } from '../../..';
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
title: 'GridForm / Static Tests',
|
|
13
|
-
component: GridFormTextInput,
|
|
14
|
-
args: {},
|
|
15
|
-
} as Meta<typeof GridFormTextInput>;
|
|
16
|
-
|
|
17
|
-
const Template: StoryFn<typeof GridFormTextInput> = (props: GridFormTextInputProps<any>) => {
|
|
7
|
+
const Template = (props: GridFormTextInputProps<any>) => {
|
|
18
8
|
const configs: [string, GridFormTextInputProps<GridBaseRow>, string?][] = [
|
|
19
9
|
['Text input', {}],
|
|
20
10
|
['Text input with text', {}, 'Some text'],
|
|
@@ -41,4 +31,12 @@ const Template: StoryFn<typeof GridFormTextInput> = (props: GridFormTextInputPro
|
|
|
41
31
|
);
|
|
42
32
|
};
|
|
43
33
|
|
|
44
|
-
|
|
34
|
+
const meta: Meta<typeof Template> = {
|
|
35
|
+
title: 'GridForm / Static Tests',
|
|
36
|
+
component: Template,
|
|
37
|
+
};
|
|
38
|
+
export default meta;
|
|
39
|
+
|
|
40
|
+
type Story = StoryObj<typeof meta>;
|
|
41
|
+
|
|
42
|
+
export const GridFormTextInput_: Story = {};
|
|
@@ -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
|
};
|