@linzjs/step-ag-grid 15.1.2 → 16.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/GridCell.d.ts +1 -1
- package/dist/src/components/GridIcon.d.ts +2 -2
- package/dist/src/components/GridLoadableCell.d.ts +1 -2
- package/dist/src/components/GridNoRowsOverlay.d.ts +3 -3
- package/dist/src/components/GridPopoverHook.d.ts +1 -1
- package/dist/src/components/GridWrapper.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterDownloadCsvButton.d.ts +1 -2
- package/dist/src/components/gridFilter/GridFilterQuick.d.ts +1 -2
- package/dist/src/components/gridFilter/GridFilters.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormEditBearing.d.ts +1 -2
- package/dist/src/components/gridForm/GridFormMessage.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormTextInput.d.ts +1 -2
- package/dist/src/components/gridHeader/GridHeaderSelect.d.ts +1 -2
- package/dist/src/components/gridHook/useGridContextMenu.d.ts +1 -1
- package/dist/src/components/gridRender/GridRenderPopoutMenuCell.d.ts +1 -2
- package/dist/src/contexts/GridContext.d.ts +1 -1
- package/dist/src/contexts/GridPopoverContextProvider.d.ts +1 -1
- package/dist/src/contexts/GridUpdatingContextProvider.d.ts +1 -1
- package/dist/src/lui/ActionButton.d.ts +1 -1
- package/dist/src/lui/FormError.d.ts +1 -1
- package/dist/src/lui/TextAreaInput.d.ts +1 -1
- package/dist/src/lui/TextInputFormatted.d.ts +1 -1
- package/dist/src/react-menu3/components/ControlledMenu.d.ts +3 -3
- package/dist/src/react-menu3/components/FocusableItem.d.ts +2 -2
- package/dist/src/react-menu3/components/Menu.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuButton.d.ts +1 -1
- package/dist/src/react-menu3/components/MenuDivider.d.ts +1 -1
- package/dist/src/react-menu3/components/MenuGroup.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuHeader.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuItem.d.ts +1 -1
- package/dist/src/react-menu3/components/MenuList.d.ts +1 -2
- package/dist/src/react-menu3/components/MenuRadioGroup.d.ts +2 -2
- package/dist/src/react-menu3/components/SubMenu.d.ts +2 -2
- package/dist/src/react-menu3/utils/utils.d.ts +1 -1
- package/dist/step-ag-grid.cjs.js +986 -3896
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +987 -3897
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +27 -23
- package/src/components/Grid.tsx +14 -18
- package/src/components/GridIcon.tsx +2 -1
- package/src/components/GridNoRowsOverlay.tsx +7 -10
- package/src/contexts/GridContext.tsx +1 -1
- package/src/contexts/GridContextProvider.tsx +32 -13
- package/src/lui/ActionButton.tsx +2 -1
- package/src/lui/TextInputFormatted.tsx +2 -1
- package/src/lui/reactUtils.test.tsx +4 -3
- package/src/stories/components/ActionButton.stories.tsx +2 -1
- package/src/stories/grid/FormTest.tsx +2 -1
- package/src/stories/grid/GridFilterButtons.stories.tsx +5 -15
- package/src/stories/grid/GridNoRowsOverlay.stories.tsx +6 -3
- package/src/stories/grid/GridNonEditableRow.stories.tsx +4 -3
- package/src/stories/grid/GridPopoutContextMenu.stories.tsx +4 -3
- package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +4 -3
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +5 -4
- package/src/stories/grid/GridPopoverEditBearing.stories.tsx +4 -3
- package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +4 -3
- package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +4 -3
- package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +4 -3
- package/src/stories/grid/GridReadOnly.stories.tsx +12 -3
- package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +13 -10
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +13 -10
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +13 -10
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +12 -9
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +17 -14
- package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +17 -14
- package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +10 -7
- package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +12 -9
- package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +4 -1
- package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +4 -1
- package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +4 -1
- package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +4 -1
- package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +4 -1
- package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +4 -1
- package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +4 -1
- package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +4 -1
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +21 -12
- package/src/stories/react-menu/ReactMenu.stories.tsx +6 -4
- package/src/utils/testQuick.ts +10 -2
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import "../../../react-menu3/styles/index.scss";
|
|
2
|
+
import "../../../styles/index.scss";
|
|
3
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
|
+
|
|
1
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
2
6
|
import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
|
|
3
7
|
import { useRef } from "react";
|
|
4
8
|
|
|
5
9
|
import "@linzjs/lui/dist/fonts";
|
|
6
|
-
import "@linzjs/lui/dist/scss/base.scss";
|
|
7
10
|
|
|
8
11
|
import {
|
|
9
12
|
GridContextProvider,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import "../../../react-menu3/styles/index.scss";
|
|
2
|
+
import "../../../styles/index.scss";
|
|
3
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
|
+
|
|
1
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
2
6
|
import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
|
|
3
7
|
import { useRef } from "react";
|
|
4
8
|
|
|
5
9
|
import "@linzjs/lui/dist/fonts";
|
|
6
|
-
import "@linzjs/lui/dist/scss/base.scss";
|
|
7
10
|
|
|
8
11
|
import { GridContextProvider, GridFormMessage } from "../../..";
|
|
9
12
|
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import "../../../react-menu3/styles/index.scss";
|
|
2
|
+
import "../../../styles/index.scss";
|
|
3
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
|
+
|
|
1
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
2
6
|
import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
|
|
3
7
|
import { useRef } from "react";
|
|
4
8
|
|
|
5
9
|
import "@linzjs/lui/dist/fonts";
|
|
6
|
-
import "@linzjs/lui/dist/scss/base.scss";
|
|
7
10
|
|
|
8
11
|
import { GridBaseRow, GridContextProvider, GridFormMultiSelect, GridFormMultiSelectProps } from "../../..";
|
|
9
12
|
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import "../../../react-menu3/styles/index.scss";
|
|
2
|
+
import "../../../styles/index.scss";
|
|
3
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
|
+
|
|
1
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
2
6
|
import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
|
|
3
7
|
import { useRef } from "react";
|
|
4
8
|
|
|
5
9
|
import "@linzjs/lui/dist/fonts";
|
|
6
|
-
import "@linzjs/lui/dist/scss/base.scss";
|
|
7
10
|
|
|
8
11
|
import {
|
|
9
12
|
GridBaseRow,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import "../../../react-menu3/styles/index.scss";
|
|
2
|
+
import "../../../styles/index.scss";
|
|
3
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
|
+
|
|
1
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
2
6
|
import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
|
|
3
7
|
import { useRef } from "react";
|
|
4
8
|
|
|
5
9
|
import "@linzjs/lui/dist/fonts";
|
|
6
|
-
import "@linzjs/lui/dist/scss/base.scss";
|
|
7
10
|
|
|
8
11
|
import { GridBaseRow, GridContextProvider, GridFormTextArea, GridFormTextAreaProps } from "../../..";
|
|
9
12
|
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import "../../../react-menu3/styles/index.scss";
|
|
2
|
+
import "../../../styles/index.scss";
|
|
3
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
|
+
|
|
1
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
2
6
|
import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
|
|
3
7
|
import { useRef } from "react";
|
|
4
8
|
|
|
5
9
|
import "@linzjs/lui/dist/fonts";
|
|
6
|
-
import "@linzjs/lui/dist/scss/base.scss";
|
|
7
10
|
|
|
8
11
|
import { GridBaseRow, GridContextProvider, GridFormTextInput, GridFormTextInputProps } from "../../..";
|
|
9
12
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import "../../../styles/GridTheme.scss";
|
|
2
|
+
import "../../../styles/index.scss";
|
|
3
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
|
+
|
|
1
5
|
import { expect, jest } from "@storybook/jest";
|
|
2
6
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
3
7
|
import { userEvent, waitFor } from "@storybook/testing-library";
|
|
4
8
|
import { useMemo, useState } from "react";
|
|
5
9
|
|
|
6
10
|
import "@linzjs/lui/dist/fonts";
|
|
7
|
-
import "@linzjs/lui/dist/scss/base.scss";
|
|
8
11
|
|
|
9
12
|
import {
|
|
10
13
|
ColDefT,
|
|
@@ -21,8 +24,6 @@ import {
|
|
|
21
24
|
MenuOption,
|
|
22
25
|
wait,
|
|
23
26
|
} from "../../../";
|
|
24
|
-
import "../../../styles/GridTheme.scss";
|
|
25
|
-
import "../../../styles/index.scss";
|
|
26
27
|
|
|
27
28
|
export default {
|
|
28
29
|
title: "Components / Grids",
|
|
@@ -34,6 +35,14 @@ export default {
|
|
|
34
35
|
selectable: false,
|
|
35
36
|
rowSelection: "single",
|
|
36
37
|
},
|
|
38
|
+
// Storybook hangs otherwise
|
|
39
|
+
parameters: {
|
|
40
|
+
docs: {
|
|
41
|
+
source: {
|
|
42
|
+
type: "code",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
37
46
|
decorators: [
|
|
38
47
|
(Story) => (
|
|
39
48
|
<div style={{ width: 1024, height: 400 }}>
|
|
@@ -223,14 +232,14 @@ GridKeyboardInteractions.play = async ({ canvasElement }) => {
|
|
|
223
232
|
expect(activeCell).toHaveAttribute("aria-colindex", "1");
|
|
224
233
|
expect(activeCell?.parentElement).toHaveAttribute("row-index", "0");
|
|
225
234
|
});
|
|
226
|
-
userEvent.keyboard("{arrowdown}{arrowdown}");
|
|
227
|
-
userEvent.keyboard("{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}");
|
|
235
|
+
await userEvent.keyboard("{arrowdown}{arrowdown}");
|
|
236
|
+
await userEvent.keyboard("{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}");
|
|
228
237
|
|
|
229
238
|
// Test enter post focus
|
|
230
239
|
const test = async (fn: () => any, colId: string, rowId: string) => {
|
|
231
|
-
userEvent.keyboard("{Enter}");
|
|
240
|
+
await userEvent.keyboard("{Enter}");
|
|
232
241
|
await wait(1000);
|
|
233
|
-
userEvent.keyboard("{arrowdown}{arrowdown}");
|
|
242
|
+
await userEvent.keyboard("{arrowdown}{arrowdown}");
|
|
234
243
|
fn();
|
|
235
244
|
await waitFor(async () => {
|
|
236
245
|
expect(multiEditAction).toHaveBeenCalled();
|
|
@@ -247,16 +256,16 @@ GridKeyboardInteractions.play = async ({ canvasElement }) => {
|
|
|
247
256
|
|
|
248
257
|
await test(() => userEvent.keyboard("{Enter}"), "8", "2");
|
|
249
258
|
await test(() => userEvent.tab(), "9", "2");
|
|
250
|
-
userEvent.tab({ shift: true });
|
|
259
|
+
await userEvent.tab({ shift: true });
|
|
251
260
|
await test(() => userEvent.tab({ shift: true }), "6", "2");
|
|
252
|
-
userEvent.keyboard("{Esc}");
|
|
253
|
-
userEvent.tab();
|
|
261
|
+
await userEvent.keyboard("{Esc}");
|
|
262
|
+
await userEvent.tab();
|
|
254
263
|
|
|
255
|
-
userEvent.keyboard("{Enter}");
|
|
264
|
+
await userEvent.keyboard("{Enter}");
|
|
256
265
|
await wait(250);
|
|
257
266
|
expect(eAction).not.toHaveBeenCalled();
|
|
258
267
|
|
|
259
|
-
userEvent.keyboard("e");
|
|
268
|
+
await userEvent.keyboard("e");
|
|
260
269
|
await waitFor(async () => {
|
|
261
270
|
expect(eAction).toHaveBeenCalled();
|
|
262
271
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "../../react-menu3/styles/index.scss";
|
|
2
|
+
|
|
1
3
|
import { expect, jest } from "@storybook/jest";
|
|
2
4
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
3
5
|
import { userEvent, within } from "@storybook/testing-library";
|
|
@@ -42,7 +44,7 @@ ReactMenuControlled.play = async ({ canvasElement }) => {
|
|
|
42
44
|
const canvas = within(canvasElement);
|
|
43
45
|
|
|
44
46
|
const keyboard = async (key: string) => {
|
|
45
|
-
userEvent.keyboard(key);
|
|
47
|
+
await userEvent.keyboard(key);
|
|
46
48
|
await wait(100); // Wait for debounce
|
|
47
49
|
};
|
|
48
50
|
|
|
@@ -51,13 +53,13 @@ ReactMenuControlled.play = async ({ canvasElement }) => {
|
|
|
51
53
|
|
|
52
54
|
const openMenu = async () => {
|
|
53
55
|
await wait(500); // Wait for debounce
|
|
54
|
-
userEvent.click(menuButton);
|
|
56
|
+
await userEvent.click(menuButton);
|
|
55
57
|
expect(await canvas.findByRole("menuitem", { name: "New File" })).toBeInTheDocument();
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
// Check menu closes on click outside
|
|
59
61
|
await openMenu();
|
|
60
|
-
userEvent.click(menuButton.parentElement as Element);
|
|
62
|
+
await userEvent.click(menuButton.parentElement as Element);
|
|
61
63
|
expect(canvas.queryByRole("menuitem", { name: "New File" })).not.toBeInTheDocument();
|
|
62
64
|
|
|
63
65
|
// Test arrow down/up
|
|
@@ -73,7 +75,7 @@ ReactMenuControlled.play = async ({ canvasElement }) => {
|
|
|
73
75
|
expect(document.activeElement?.innerHTML).toBe("Print...");
|
|
74
76
|
|
|
75
77
|
// Escape close
|
|
76
|
-
userEvent.type(menuButton.parentElement as Element, "{Escape}");
|
|
78
|
+
await userEvent.type(menuButton.parentElement as Element, "{Escape}");
|
|
77
79
|
expect(canvas.queryByRole("menuitem", { name: "New File" })).not.toBeInTheDocument();
|
|
78
80
|
|
|
79
81
|
// Test enter to select
|
package/src/utils/testQuick.ts
CHANGED
|
@@ -70,7 +70,15 @@ const quickSelector = <T extends HTMLElement>(
|
|
|
70
70
|
els = els.filter(matcher);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
return {
|
|
73
|
+
return {
|
|
74
|
+
selector: [
|
|
75
|
+
selector,
|
|
76
|
+
typeof lastIQueryQuick.text == "string" ? JSON.stringify(lastIQueryQuick.text) : lastIQueryQuick.text,
|
|
77
|
+
]
|
|
78
|
+
.filter((r) => r)
|
|
79
|
+
.join(" "),
|
|
80
|
+
els,
|
|
81
|
+
};
|
|
74
82
|
};
|
|
75
83
|
|
|
76
84
|
/**
|
|
@@ -110,7 +118,7 @@ export const queryAllQuick = <T extends HTMLElement>(filter: IQueryQuick, contai
|
|
|
110
118
|
export const getAllQuick = <T extends HTMLElement>(filter: IQueryQuick, container?: HTMLElement): T[] => {
|
|
111
119
|
const els = queryAllQuick(filter, container);
|
|
112
120
|
if (els.length == 0) {
|
|
113
|
-
throw Error(`getAllQuick not found, selector: ${quickSelector(filter)}`);
|
|
121
|
+
throw Error(`getAllQuick not found, selector: ${quickSelector(filter).selector}`);
|
|
114
122
|
}
|
|
115
123
|
return els as T[];
|
|
116
124
|
};
|