@linzjs/step-ag-grid 15.1.3 → 17.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/GridTheme.scss +138 -106
- package/dist/index.css +1 -8
- package/dist/node_modules/@linzjs/lui/dist/assets/svg-content.d.ts +7 -0
- package/dist/src/components/ComponentLoadingWrapper.d.ts +3 -4
- package/dist/src/components/Grid.d.ts +2 -2
- package/dist/src/components/GridCell.d.ts +6 -6
- package/dist/src/components/GridCellMultiEditor.d.ts +2 -2
- 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 +5 -4
- package/dist/src/components/GridPopoverHook.d.ts +3 -3
- package/dist/src/components/GridWrapper.d.ts +2 -3
- package/dist/src/components/PostSortRowsHook.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterButtons.d.ts +2 -2
- package/dist/src/components/gridFilter/GridFilterColumnsToggle.d.ts +2 -2
- 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 +2 -5
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +3 -3
- package/dist/src/components/gridForm/GridFormEditBearing.d.ts +1 -2
- package/dist/src/components/gridForm/GridFormMessage.d.ts +3 -3
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +3 -3
- package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormSubComponentTextArea.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormTextArea.d.ts +2 -2
- 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/GridRenderGenericCell.d.ts +2 -2
- package/dist/src/components/gridRender/GridRenderPopoutMenuCell.d.ts +1 -2
- package/dist/src/contexts/GridContext.d.ts +5 -5
- package/dist/src/contexts/GridContextProvider.d.ts +2 -6
- package/dist/src/contexts/GridPopoverContextProvider.d.ts +2 -3
- package/dist/src/contexts/GridUpdatingContextProvider.d.ts +2 -6
- package/dist/src/lui/ActionButton.d.ts +3 -3
- package/dist/src/lui/FormError.d.ts +3 -3
- package/dist/src/lui/TextAreaInput.d.ts +4 -4
- package/dist/src/lui/TextInputFormatted.d.ts +3 -3
- package/dist/src/react-menu3/components/ControlledMenu.d.ts +3 -3
- package/dist/src/react-menu3/components/FocusableItem.d.ts +4 -4
- 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/src/react-menu3/utils/withHovering.d.ts +2 -2
- package/dist/src/utils/textValidator.d.ts +3 -3
- package/dist/step-ag-grid.cjs.js +1007 -3909
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +1008 -3910
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +63 -59
- package/src/components/ComponentLoadingWrapper.tsx +9 -6
- package/src/components/Grid.tsx +32 -27
- package/src/components/GridCell.tsx +5 -5
- package/src/components/GridCellMultiEditor.tsx +2 -2
- package/src/components/GridIcon.tsx +2 -1
- package/src/components/GridNoRowsOverlay.tsx +10 -11
- package/src/components/GridPopoverHook.tsx +4 -4
- package/src/components/GridWrapper.tsx +2 -3
- package/src/components/PostSortRowsHook.ts +4 -4
- package/src/components/gridFilter/GridFilterButtons.tsx +2 -2
- package/src/components/gridFilter/GridFilterColumnsToggle.tsx +2 -2
- package/src/components/gridFilter/GridFilters.tsx +4 -6
- package/src/components/gridForm/GridFormDropDown.tsx +4 -4
- package/src/components/gridForm/GridFormMessage.tsx +3 -3
- package/src/components/gridForm/GridFormMultiSelect.tsx +2 -1
- package/src/components/gridForm/GridFormPopoverMenu.tsx +4 -4
- package/src/components/gridForm/GridFormSubComponentTextArea.tsx +2 -2
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +2 -2
- package/src/components/gridForm/GridFormTextArea.tsx +2 -2
- package/src/components/gridPopoverEdit/GridPopoverMessage.ts +1 -1
- package/src/components/gridRender/GridRenderGenericCell.tsx +2 -1
- package/src/contexts/GridContext.tsx +5 -5
- package/src/contexts/GridContextProvider.tsx +57 -32
- package/src/contexts/GridPopoverContextProvider.tsx +2 -3
- package/src/contexts/GridUpdatingContextProvider.tsx +2 -6
- package/src/lui/ActionButton.tsx +4 -3
- package/src/lui/FormError.tsx +3 -1
- package/src/lui/TextAreaInput.tsx +3 -3
- package/src/lui/TextInputFormatted.tsx +5 -4
- package/src/lui/reactUtils.test.tsx +7 -6
- package/src/react-menu3/components/FocusableItem.tsx +2 -2
- package/src/react-menu3/utils/utils.ts +1 -1
- package/src/react-menu3/utils/withHovering.tsx +2 -2
- package/src/stories/components/ActionButton.stories.tsx +2 -1
- package/src/stories/grid/FormTest.tsx +4 -3
- package/src/stories/grid/GridFilterButtons.stories.tsx +13 -16
- package/src/stories/grid/GridNoRowsOverlay.stories.tsx +14 -11
- package/src/stories/grid/GridNonEditableRow.stories.tsx +13 -5
- package/src/stories/grid/GridPopoutContextMenu.stories.tsx +12 -4
- package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +12 -4
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +13 -5
- package/src/stories/grid/GridPopoverEditBearing.stories.tsx +11 -3
- package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +11 -3
- package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +11 -3
- package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +12 -3
- package/src/stories/grid/GridReadOnly.stories.tsx +22 -5
- package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +15 -12
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +20 -12
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +20 -12
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +13 -10
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +19 -16
- package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +21 -17
- package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +13 -10
- package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +15 -12
- package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +5 -2
- package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +5 -2
- package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +5 -2
- package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +6 -3
- 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 +5 -2
- package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +5 -2
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +25 -12
- package/src/stories/react-menu/ReactMenu.stories.tsx +6 -4
- package/src/styles/ComponentLoadingWrapper.scss +1 -4
- package/src/styles/Grid.scss +0 -4
- package/src/styles/GridTheme.scss +138 -106
- package/src/utils/testUtil.ts +3 -0
- package/src/utils/textValidator.ts +3 -1
|
@@ -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 }}>
|
|
@@ -216,6 +225,10 @@ GridKeyboardInteractions.play = async ({ canvasElement }) => {
|
|
|
216
225
|
multiEditAction.mockReset();
|
|
217
226
|
eAction.mockReset();
|
|
218
227
|
|
|
228
|
+
await waitFor(() => {
|
|
229
|
+
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
230
|
+
});
|
|
231
|
+
|
|
219
232
|
// Ensure first row/cell is selected on render
|
|
220
233
|
await waitFor(async () => {
|
|
221
234
|
const activeCell = canvasElement.ownerDocument.activeElement;
|
|
@@ -223,14 +236,14 @@ GridKeyboardInteractions.play = async ({ canvasElement }) => {
|
|
|
223
236
|
expect(activeCell).toHaveAttribute("aria-colindex", "1");
|
|
224
237
|
expect(activeCell?.parentElement).toHaveAttribute("row-index", "0");
|
|
225
238
|
});
|
|
226
|
-
userEvent.keyboard("{arrowdown}{arrowdown}");
|
|
227
|
-
userEvent.keyboard("{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}");
|
|
239
|
+
await userEvent.keyboard("{arrowdown}{arrowdown}");
|
|
240
|
+
await userEvent.keyboard("{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}");
|
|
228
241
|
|
|
229
242
|
// Test enter post focus
|
|
230
243
|
const test = async (fn: () => any, colId: string, rowId: string) => {
|
|
231
|
-
userEvent.keyboard("{Enter}");
|
|
244
|
+
await userEvent.keyboard("{Enter}");
|
|
232
245
|
await wait(1000);
|
|
233
|
-
userEvent.keyboard("{arrowdown}{arrowdown}");
|
|
246
|
+
await userEvent.keyboard("{arrowdown}{arrowdown}");
|
|
234
247
|
fn();
|
|
235
248
|
await waitFor(async () => {
|
|
236
249
|
expect(multiEditAction).toHaveBeenCalled();
|
|
@@ -247,16 +260,16 @@ GridKeyboardInteractions.play = async ({ canvasElement }) => {
|
|
|
247
260
|
|
|
248
261
|
await test(() => userEvent.keyboard("{Enter}"), "8", "2");
|
|
249
262
|
await test(() => userEvent.tab(), "9", "2");
|
|
250
|
-
userEvent.tab({ shift: true });
|
|
263
|
+
await userEvent.tab({ shift: true });
|
|
251
264
|
await test(() => userEvent.tab({ shift: true }), "6", "2");
|
|
252
|
-
userEvent.keyboard("{Esc}");
|
|
253
|
-
userEvent.tab();
|
|
265
|
+
await userEvent.keyboard("{Esc}");
|
|
266
|
+
await userEvent.tab();
|
|
254
267
|
|
|
255
|
-
userEvent.keyboard("{Enter}");
|
|
268
|
+
await userEvent.keyboard("{Enter}");
|
|
256
269
|
await wait(250);
|
|
257
270
|
expect(eAction).not.toHaveBeenCalled();
|
|
258
271
|
|
|
259
|
-
userEvent.keyboard("e");
|
|
272
|
+
await userEvent.keyboard("e");
|
|
260
273
|
await waitFor(async () => {
|
|
261
274
|
expect(eAction).toHaveBeenCalled();
|
|
262
275
|
});
|
|
@@ -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/styles/Grid.scss
CHANGED
|
@@ -1,106 +1,138 @@
|
|
|
1
|
-
@use "@linzjs/lui/dist/scss/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
1
|
+
@use "@linzjs/lui/dist/scss/Core" as lui;
|
|
2
|
+
@use "node_modules/ag-grid-community/styles" as ag;
|
|
3
|
+
|
|
4
|
+
// ag-grid likes to add 1px to this, so we subtract to compensate
|
|
5
|
+
$grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
6
|
+
|
|
7
|
+
// GridTheme that support ag-grid v29 new SASS API
|
|
8
|
+
@include ag.grid-styles(
|
|
9
|
+
(
|
|
10
|
+
themes: (
|
|
11
|
+
step-compact: (
|
|
12
|
+
extend-theme: alpine,
|
|
13
|
+
--ag-row-height: 36px,
|
|
14
|
+
--ag-header-height: 36px,
|
|
15
|
+
--ag-font-size: calc($grid-base-font-size - 2px),
|
|
16
|
+
),
|
|
17
|
+
step-default: (
|
|
18
|
+
extend-theme: alpine,
|
|
19
|
+
--ag-row-height: 40px,
|
|
20
|
+
--ag-header-height: 40px,
|
|
21
|
+
--ag-font-size: calc($grid-base-font-size),
|
|
22
|
+
),
|
|
23
|
+
),
|
|
24
|
+
|
|
25
|
+
alpine-active-color: lui.$sea,
|
|
26
|
+
background-color: lui.$white,
|
|
27
|
+
border-color: lui.$dew,
|
|
28
|
+
borders: false,
|
|
29
|
+
borders-critical: true,
|
|
30
|
+
borders-secondary: false,
|
|
31
|
+
cell-horizontal-border: solid lui.$dew,
|
|
32
|
+
cell-horizontal-padding: lui.$unit-sm,
|
|
33
|
+
data-color: lui.$charcoal,
|
|
34
|
+
foreground-color: lui.$charcoal,
|
|
35
|
+
font-family: (
|
|
36
|
+
"Open Sans",
|
|
37
|
+
system-ui,
|
|
38
|
+
sans-serif,
|
|
39
|
+
),
|
|
40
|
+
font-size: 1rem,
|
|
41
|
+
header-background-color: lui.$white,
|
|
42
|
+
header-foreground-color: lui.$surfie,
|
|
43
|
+
odd-row-background-color: lui.$white,
|
|
44
|
+
row-hover-color: lui.$hint,
|
|
45
|
+
secondary-border-color: lui.$dew,
|
|
46
|
+
selected-row-background-color: lui.$polar,
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// Fix that when you click below checkbox it doesn't process a click
|
|
51
|
+
.ag-cell[col-id="selection"] {
|
|
52
|
+
display: flex;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Fix that when you click below checkbox it doesn't process a click
|
|
56
|
+
.ag-cell-wrapper > *:not(.ag-cell-value, .ag-group-value) {
|
|
57
|
+
height: auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ag-row:last-of-type {
|
|
61
|
+
border-bottom: 1px solid lui.$dew;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ag-header-cell {
|
|
65
|
+
font-size: 14px;
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
|
|
68
|
+
// fix: Display descender line
|
|
69
|
+
padding: 0 11px;
|
|
70
|
+
|
|
71
|
+
.LuiIcon {
|
|
72
|
+
fill: lui.$surfie;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ag-cell-label-container {
|
|
77
|
+
padding: 8px 0;
|
|
78
|
+
|
|
79
|
+
// Help ag-grid to calculate column height in react portal
|
|
80
|
+
height: fit-content;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ag-header .ag-header-cell[aria-colindex="1"] {
|
|
84
|
+
padding-left: lui.$unit-rg;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ag-cell[role="gridcell"] {
|
|
88
|
+
border-right: none;
|
|
89
|
+
border-left: 1px var(--ag-cell-horizontal-border);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ag-cell[aria-colindex="1"] {
|
|
93
|
+
border-left: none;
|
|
94
|
+
padding-left: lui.$unit-rg;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ag-cell {
|
|
98
|
+
padding-left: 11px;
|
|
99
|
+
padding-right: 11px;
|
|
100
|
+
display: flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.ag-cell-wrap-text {
|
|
105
|
+
word-break: break-word;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.ag-cell.ag-cell-popup-editing,
|
|
109
|
+
.ag-cell.ag-selected-for-edit,
|
|
110
|
+
.ag-cell-inline-editing {
|
|
111
|
+
padding-left: 9px;
|
|
112
|
+
padding-right: 9px;
|
|
113
|
+
background: rgb(72 160 244 / 20%);
|
|
114
|
+
|
|
115
|
+
// These are important, it needs to override ag-grid to work
|
|
116
|
+
border: 3px solid #48a0f4 !important;
|
|
117
|
+
border-right: 3px solid #48a0f4 !important;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.ag-row .ag-cell-data-changed {
|
|
121
|
+
// ag-grid natively has !important on this style so we have to use it here :(
|
|
122
|
+
background-color: lightgoldenrodyellow;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ag-center-cols-clipper {
|
|
126
|
+
// when using domLayout={"autoHeight"}, ag grid has a default min-height
|
|
127
|
+
// set to 150px so the !important is necessary here
|
|
128
|
+
min-height: 40px !important;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ag-body-horizontal-scroll-viewport {
|
|
132
|
+
// It's set to scroll by default, but this causes issues with selecting the last row
|
|
133
|
+
overflow-x: auto;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.Grid-container .ag-cell {
|
|
137
|
+
font-weight: 400;
|
|
138
|
+
}
|
package/src/utils/testUtil.ts
CHANGED
|
@@ -18,6 +18,9 @@ export const countRows = async (within?: HTMLElement): Promise<number> => {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export const findRow = async (rowId: number | string, within?: HTMLElement): Promise<HTMLDivElement> => {
|
|
21
|
+
await waitFor(async () => {
|
|
22
|
+
expect(getAllQuick({ classes: ".ag-row" }).length > 0).toBe(true);
|
|
23
|
+
});
|
|
21
24
|
return await findQuick<HTMLDivElement>({ tagName: `div[row-id='${rowId}']:not(:empty)` }, within);
|
|
22
25
|
};
|
|
23
26
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
|
|
1
3
|
import { GridBaseRow } from "../components/Grid";
|
|
2
4
|
import { isFloat, stringByteLengthIsInvalid } from "./util";
|
|
3
5
|
|
|
@@ -5,7 +7,7 @@ export interface TextInputValidatorProps<RowType extends GridBaseRow> {
|
|
|
5
7
|
required?: boolean;
|
|
6
8
|
maxLength?: number;
|
|
7
9
|
maxBytes?: number;
|
|
8
|
-
invalid?: (value: string, data: RowType, context: any) =>
|
|
10
|
+
invalid?: (value: string, data: RowType, context: any) => ReactElement | string | null;
|
|
9
11
|
numberFormat?: {
|
|
10
12
|
precision?: number;
|
|
11
13
|
scale?: number;
|