@linzjs/step-ag-grid 16.0.0 → 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 +5 -5
- package/dist/src/components/GridCellMultiEditor.d.ts +2 -2
- package/dist/src/components/GridNoRowsOverlay.d.ts +3 -2
- 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/GridFilters.d.ts +2 -5
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormMessage.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +3 -3
- 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/gridRender/GridRenderGenericCell.d.ts +2 -2
- package/dist/src/contexts/GridContext.d.ts +4 -4
- 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 +2 -2
- package/dist/src/lui/FormError.d.ts +2 -2
- package/dist/src/lui/TextAreaInput.d.ts +3 -3
- package/dist/src/lui/TextInputFormatted.d.ts +3 -3
- package/dist/src/react-menu3/components/FocusableItem.d.ts +2 -2
- 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 +31 -15
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +31 -15
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +45 -45
- package/src/components/ComponentLoadingWrapper.tsx +9 -6
- package/src/components/Grid.tsx +19 -10
- package/src/components/GridCell.tsx +5 -5
- package/src/components/GridCellMultiEditor.tsx +2 -2
- package/src/components/GridNoRowsOverlay.tsx +4 -2
- 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 +4 -4
- package/src/contexts/GridContextProvider.tsx +26 -20
- package/src/contexts/GridPopoverContextProvider.tsx +2 -3
- package/src/contexts/GridUpdatingContextProvider.tsx +2 -6
- package/src/lui/ActionButton.tsx +2 -2
- package/src/lui/FormError.tsx +3 -1
- package/src/lui/TextAreaInput.tsx +3 -3
- package/src/lui/TextInputFormatted.tsx +3 -3
- package/src/lui/reactUtils.test.tsx +3 -3
- 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/grid/FormTest.tsx +2 -2
- package/src/stories/grid/GridFilterButtons.stories.tsx +8 -1
- package/src/stories/grid/GridNoRowsOverlay.stories.tsx +8 -8
- package/src/stories/grid/GridNonEditableRow.stories.tsx +9 -2
- package/src/stories/grid/GridPopoutContextMenu.stories.tsx +8 -1
- package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +8 -1
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +8 -1
- package/src/stories/grid/GridPopoverEditBearing.stories.tsx +7 -0
- package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +7 -0
- package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +7 -0
- package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +8 -0
- package/src/stories/grid/GridReadOnly.stories.tsx +10 -2
- package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +2 -2
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +7 -2
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +7 -2
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +1 -1
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +2 -2
- package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +4 -3
- package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +3 -3
- package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +3 -3
- package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +1 -1
- package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +1 -1
- package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +1 -1
- package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +2 -2
- package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +1 -1
- package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +1 -1
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +4 -0
- 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
package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx
CHANGED
|
@@ -10,7 +10,12 @@ import { useRef } from "react";
|
|
|
10
10
|
|
|
11
11
|
import "@linzjs/lui/dist/fonts";
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
GridContextProvider,
|
|
15
|
+
GridFormEditBearing,
|
|
16
|
+
GridFormEditBearingProps,
|
|
17
|
+
GridPopoverEditBearingCorrectionEditorParams,
|
|
18
|
+
} from "../../..";
|
|
14
19
|
|
|
15
20
|
export default {
|
|
16
21
|
title: "GridForm / Interactions",
|
|
@@ -20,7 +25,7 @@ export default {
|
|
|
20
25
|
|
|
21
26
|
const updateValue = jest.fn();
|
|
22
27
|
|
|
23
|
-
const Template: ComponentStory<typeof GridFormEditBearing> = (props) => {
|
|
28
|
+
const Template: ComponentStory<typeof GridFormEditBearing> = (props: GridFormEditBearingProps<any>) => {
|
|
24
29
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
25
30
|
|
|
26
31
|
return (
|
|
@@ -10,7 +10,12 @@ import { useRef } from "react";
|
|
|
10
10
|
|
|
11
11
|
import "@linzjs/lui/dist/fonts";
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
GridContextProvider,
|
|
15
|
+
GridFormEditBearing,
|
|
16
|
+
GridFormEditBearingProps,
|
|
17
|
+
GridPopoverEditBearingEditorParams,
|
|
18
|
+
} from "../../..";
|
|
14
19
|
|
|
15
20
|
export default {
|
|
16
21
|
title: "GridForm / Interactions",
|
|
@@ -20,7 +25,7 @@ export default {
|
|
|
20
25
|
|
|
21
26
|
const updateValue = jest.fn();
|
|
22
27
|
|
|
23
|
-
const Template: ComponentStory<typeof GridFormEditBearing> = (props) => {
|
|
28
|
+
const Template: ComponentStory<typeof GridFormEditBearing> = (props: GridFormEditBearingProps<any>) => {
|
|
24
29
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
25
30
|
|
|
26
31
|
return (
|
|
@@ -34,7 +34,7 @@ const onSave = jest
|
|
|
34
34
|
const onSelectFilter = jest.fn();
|
|
35
35
|
|
|
36
36
|
let options: MultiSelectGridOption[] = [];
|
|
37
|
-
const Template: ComponentStory<typeof GridFormMultiSelectGrid> = (props) => {
|
|
37
|
+
const Template: ComponentStory<typeof GridFormMultiSelectGrid> = (props: GridFormMultiSelectGridProps<any>) => {
|
|
38
38
|
options = [
|
|
39
39
|
{ label: "Zero", value: 0 },
|
|
40
40
|
{ label: "One", value: 1 },
|
|
@@ -34,7 +34,7 @@ const onSave = jest.fn<Promise<boolean>, [GridFormMultiSelectSaveProps<any>]>().
|
|
|
34
34
|
const onSelectFilter = jest.fn();
|
|
35
35
|
|
|
36
36
|
let options: MultiSelectOption[] = [];
|
|
37
|
-
const Template: ComponentStory<typeof GridFormMultiSelect> = (props) => {
|
|
37
|
+
const Template: ComponentStory<typeof GridFormMultiSelect> = (props: GridFormMultiSelectProps<any>) => {
|
|
38
38
|
options = [
|
|
39
39
|
{ label: "Zero", value: 0 },
|
|
40
40
|
{ label: "One", value: 1 },
|
|
@@ -145,7 +145,7 @@ GridFormMultiSelectInteractions_.play = async ({ canvasElement }) => {
|
|
|
145
145
|
// Test invalid value doesn't save
|
|
146
146
|
updateValue.mockClear();
|
|
147
147
|
onSave.mockClear();
|
|
148
|
-
userEvent.clear(textInput);
|
|
148
|
+
await userEvent.clear(textInput);
|
|
149
149
|
await userEvent.type(textInput, "{Enter}");
|
|
150
150
|
expect(updateValue).not.toHaveBeenCalled();
|
|
151
151
|
expect(onSave).not.toHaveBeenCalled();
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
GridBaseRow,
|
|
15
15
|
GridContextProvider,
|
|
16
16
|
GridFormPopoverMenu,
|
|
17
|
+
GridFormPopoverMenuProps,
|
|
17
18
|
GridFormSubComponentTextArea,
|
|
18
19
|
GridFormSubComponentTextInput,
|
|
19
20
|
PopoutMenuSeparator,
|
|
@@ -40,7 +41,7 @@ const disabledAction = jest
|
|
|
40
41
|
.fn<Promise<void>, [{ selectedRows: GridBaseRow[]; menuOption: SelectedMenuOptionResult<GridBaseRow> }]>()
|
|
41
42
|
.mockResolvedValue(undefined);
|
|
42
43
|
|
|
43
|
-
const Template: ComponentStory<typeof GridFormPopoverMenu> = (props) => {
|
|
44
|
+
const Template: ComponentStory<typeof GridFormPopoverMenu> = (props: GridFormPopoverMenuProps<any>) => {
|
|
44
45
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
45
46
|
|
|
46
47
|
return (
|
|
@@ -137,7 +138,7 @@ GridFormPopoverMenuInteractions_.play = async ({ canvasElement }) => {
|
|
|
137
138
|
|
|
138
139
|
// Test invalid value doesn't save
|
|
139
140
|
updateValue.mockClear();
|
|
140
|
-
userEvent.clear(textInput);
|
|
141
|
+
await userEvent.clear(textInput);
|
|
141
142
|
await userEvent.type(textInput, "{Enter}");
|
|
142
143
|
expect(updateValue).not.toHaveBeenCalled();
|
|
143
144
|
|
|
@@ -169,7 +170,7 @@ GridFormPopoverMenuInteractions_.play = async ({ canvasElement }) => {
|
|
|
169
170
|
|
|
170
171
|
// Test invalid value doesn't save
|
|
171
172
|
updateValue.mockClear();
|
|
172
|
-
userEvent.clear(textArea);
|
|
173
|
+
await userEvent.clear(textArea);
|
|
173
174
|
await userEvent.type(textArea, "{Enter}");
|
|
174
175
|
expect(updateValue).not.toHaveBeenCalled();
|
|
175
176
|
};
|
|
@@ -10,7 +10,7 @@ import { useRef } from "react";
|
|
|
10
10
|
|
|
11
11
|
import "@linzjs/lui/dist/fonts";
|
|
12
12
|
|
|
13
|
-
import { GridContextProvider, GridFormTextArea } from "../../..";
|
|
13
|
+
import { GridContextProvider, GridFormTextArea, GridFormTextAreaProps } from "../../..";
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
16
|
title: "GridForm / Interactions",
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
|
|
21
21
|
const updateValue = jest.fn();
|
|
22
22
|
|
|
23
|
-
const Template: ComponentStory<typeof GridFormTextArea> = (props) => {
|
|
23
|
+
const Template: ComponentStory<typeof GridFormTextArea> = (props: GridFormTextAreaProps<any>) => {
|
|
24
24
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
25
25
|
|
|
26
26
|
return (
|
|
@@ -71,7 +71,7 @@ GridFormTextAreaInteractions_.play = async ({ canvasElement }) => {
|
|
|
71
71
|
|
|
72
72
|
// Test invalid value doesn't save
|
|
73
73
|
updateValue.mockClear();
|
|
74
|
-
userEvent.clear(inputField);
|
|
74
|
+
await userEvent.clear(inputField);
|
|
75
75
|
|
|
76
76
|
expect(canvas.getByText("Must not be empty")).toBeInTheDocument();
|
|
77
77
|
await userEvent.tab();
|
|
@@ -10,7 +10,7 @@ import { useRef } from "react";
|
|
|
10
10
|
|
|
11
11
|
import "@linzjs/lui/dist/fonts";
|
|
12
12
|
|
|
13
|
-
import { GridContextProvider, GridFormTextInput } from "../../..";
|
|
13
|
+
import { GridContextProvider, GridFormTextInput, GridFormTextInputProps } from "../../..";
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
16
|
title: "GridForm / Interactions",
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
|
|
21
21
|
const updateValue = jest.fn();
|
|
22
22
|
|
|
23
|
-
const Template: ComponentStory<typeof GridFormTextInput> = (props) => {
|
|
23
|
+
const Template: ComponentStory<typeof GridFormTextInput> = (props: GridFormTextInputProps<any>) => {
|
|
24
24
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
25
25
|
|
|
26
26
|
return (
|
|
@@ -76,7 +76,7 @@ GridFormTextInputInteractions_.play = async ({ canvasElement }) => {
|
|
|
76
76
|
|
|
77
77
|
// Test invalid value doesn't save
|
|
78
78
|
updateValue.mockClear();
|
|
79
|
-
userEvent.clear(inputField);
|
|
79
|
+
await userEvent.clear(inputField);
|
|
80
80
|
|
|
81
81
|
expect(canvas.getByText("Must not be empty")).toBeInTheDocument();
|
|
82
82
|
await userEvent.type(inputField, "{Enter}");
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
args: {},
|
|
17
17
|
} as ComponentMeta<typeof GridFormDropDown>;
|
|
18
18
|
|
|
19
|
-
const Template: ComponentStory<typeof GridFormDropDown> = (props) => {
|
|
19
|
+
const Template: ComponentStory<typeof GridFormDropDown> = (props: GridFormDropDownProps<any>) => {
|
|
20
20
|
const configs: [string, GridFormDropDownProps<GridBaseRow>, string?][] = [
|
|
21
21
|
["No options", { options: [] }],
|
|
22
22
|
["Custom no options", { options: [], noOptionsMessage: "Custom no options" }],
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
args: {},
|
|
22
22
|
} as ComponentMeta<typeof GridFormEditBearing>;
|
|
23
23
|
|
|
24
|
-
const Template: ComponentStory<typeof GridFormEditBearing> = (props) => {
|
|
24
|
+
const Template: ComponentStory<typeof GridFormEditBearing> = (props: GridFormEditBearingProps<any>) => {
|
|
25
25
|
const values: [string, GridFormEditBearingProps<any>, number | null][] = [
|
|
26
26
|
["Null value", {}, null],
|
|
27
27
|
["Custom placeholder", { placeHolder: "Custom placeholder" }, null],
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
args: {},
|
|
22
22
|
} as ComponentMeta<typeof GridFormEditBearing>;
|
|
23
23
|
|
|
24
|
-
const Template: ComponentStory<typeof GridFormEditBearing> = (props) => {
|
|
24
|
+
const Template: ComponentStory<typeof GridFormEditBearing> = (props: GridFormEditBearingProps<any>) => {
|
|
25
25
|
const values: [string, GridFormEditBearingProps<any>, number | null][] = [
|
|
26
26
|
["Null value", {}, null],
|
|
27
27
|
["Custom placeholder", { placeHolder: "Custom placeholder" }, null],
|
|
@@ -8,7 +8,7 @@ import { useRef } from "react";
|
|
|
8
8
|
|
|
9
9
|
import "@linzjs/lui/dist/fonts";
|
|
10
10
|
|
|
11
|
-
import { GridContextProvider, GridFormMessage } from "../../..";
|
|
11
|
+
import { GridContextProvider, GridFormMessage, GridFormMessageProps } from "../../..";
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
title: "GridForm / Static Tests",
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
args: {},
|
|
17
17
|
} as ComponentMeta<typeof GridFormMessage>;
|
|
18
18
|
|
|
19
|
-
const Template: ComponentStory<typeof GridFormMessage> = (props) => {
|
|
19
|
+
const Template: ComponentStory<typeof GridFormMessage> = (props: GridFormMessageProps<any>) => {
|
|
20
20
|
const anchorRef1 = useRef<HTMLHeadingElement>(null);
|
|
21
21
|
|
|
22
22
|
return (
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
args: {},
|
|
17
17
|
} as ComponentMeta<typeof GridFormTextArea>;
|
|
18
18
|
|
|
19
|
-
const Template: ComponentStory<typeof GridFormTextArea> = (props) => {
|
|
19
|
+
const Template: ComponentStory<typeof GridFormTextArea> = (props: GridFormTextAreaProps<any>) => {
|
|
20
20
|
const configs: [string, GridFormTextAreaProps<GridBaseRow>, string?][] = [
|
|
21
21
|
["Text area", {}],
|
|
22
22
|
["Text area with text", {}, "Some text"],
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
args: {},
|
|
17
17
|
} as ComponentMeta<typeof GridFormTextInput>;
|
|
18
18
|
|
|
19
|
-
const Template: ComponentStory<typeof GridFormTextInput> = (props) => {
|
|
19
|
+
const Template: ComponentStory<typeof GridFormTextInput> = (props: GridFormTextInputProps<any>) => {
|
|
20
20
|
const configs: [string, GridFormTextInputProps<GridBaseRow>, string?][] = [
|
|
21
21
|
["Text input", {}],
|
|
22
22
|
["Text input with text", {}, "Some text"],
|
|
@@ -225,6 +225,10 @@ GridKeyboardInteractions.play = async ({ canvasElement }) => {
|
|
|
225
225
|
multiEditAction.mockReset();
|
|
226
226
|
eAction.mockReset();
|
|
227
227
|
|
|
228
|
+
await waitFor(() => {
|
|
229
|
+
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
230
|
+
});
|
|
231
|
+
|
|
228
232
|
// Ensure first row/cell is selected on render
|
|
229
233
|
await waitFor(async () => {
|
|
230
234
|
const activeCell = canvasElement.ownerDocument.activeElement;
|
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;
|