@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.
Files changed (102) hide show
  1. package/dist/GridTheme.scss +138 -106
  2. package/dist/index.css +1 -8
  3. package/dist/node_modules/@linzjs/lui/dist/assets/svg-content.d.ts +7 -0
  4. package/dist/src/components/ComponentLoadingWrapper.d.ts +3 -4
  5. package/dist/src/components/Grid.d.ts +2 -2
  6. package/dist/src/components/GridCell.d.ts +5 -5
  7. package/dist/src/components/GridCellMultiEditor.d.ts +2 -2
  8. package/dist/src/components/GridNoRowsOverlay.d.ts +3 -2
  9. package/dist/src/components/GridPopoverHook.d.ts +3 -3
  10. package/dist/src/components/GridWrapper.d.ts +2 -3
  11. package/dist/src/components/PostSortRowsHook.d.ts +1 -1
  12. package/dist/src/components/gridFilter/GridFilterButtons.d.ts +2 -2
  13. package/dist/src/components/gridFilter/GridFilterColumnsToggle.d.ts +2 -2
  14. package/dist/src/components/gridFilter/GridFilters.d.ts +2 -5
  15. package/dist/src/components/gridForm/GridFormDropDown.d.ts +2 -2
  16. package/dist/src/components/gridForm/GridFormMessage.d.ts +2 -2
  17. package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +2 -2
  18. package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +3 -3
  19. package/dist/src/components/gridForm/GridFormSubComponentTextArea.d.ts +2 -2
  20. package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +2 -2
  21. package/dist/src/components/gridForm/GridFormTextArea.d.ts +2 -2
  22. package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +2 -2
  23. package/dist/src/contexts/GridContext.d.ts +4 -4
  24. package/dist/src/contexts/GridContextProvider.d.ts +2 -6
  25. package/dist/src/contexts/GridPopoverContextProvider.d.ts +2 -3
  26. package/dist/src/contexts/GridUpdatingContextProvider.d.ts +2 -6
  27. package/dist/src/lui/ActionButton.d.ts +2 -2
  28. package/dist/src/lui/FormError.d.ts +2 -2
  29. package/dist/src/lui/TextAreaInput.d.ts +3 -3
  30. package/dist/src/lui/TextInputFormatted.d.ts +3 -3
  31. package/dist/src/react-menu3/components/FocusableItem.d.ts +2 -2
  32. package/dist/src/react-menu3/utils/withHovering.d.ts +2 -2
  33. package/dist/src/utils/textValidator.d.ts +3 -3
  34. package/dist/step-ag-grid.cjs.js +31 -15
  35. package/dist/step-ag-grid.cjs.js.map +1 -1
  36. package/dist/step-ag-grid.esm.js +31 -15
  37. package/dist/step-ag-grid.esm.js.map +1 -1
  38. package/package.json +45 -45
  39. package/src/components/ComponentLoadingWrapper.tsx +9 -6
  40. package/src/components/Grid.tsx +19 -10
  41. package/src/components/GridCell.tsx +5 -5
  42. package/src/components/GridCellMultiEditor.tsx +2 -2
  43. package/src/components/GridNoRowsOverlay.tsx +4 -2
  44. package/src/components/GridPopoverHook.tsx +4 -4
  45. package/src/components/GridWrapper.tsx +2 -3
  46. package/src/components/PostSortRowsHook.ts +4 -4
  47. package/src/components/gridFilter/GridFilterButtons.tsx +2 -2
  48. package/src/components/gridFilter/GridFilterColumnsToggle.tsx +2 -2
  49. package/src/components/gridFilter/GridFilters.tsx +4 -6
  50. package/src/components/gridForm/GridFormDropDown.tsx +4 -4
  51. package/src/components/gridForm/GridFormMessage.tsx +3 -3
  52. package/src/components/gridForm/GridFormMultiSelect.tsx +2 -1
  53. package/src/components/gridForm/GridFormPopoverMenu.tsx +4 -4
  54. package/src/components/gridForm/GridFormSubComponentTextArea.tsx +2 -2
  55. package/src/components/gridForm/GridFormSubComponentTextInput.tsx +2 -2
  56. package/src/components/gridForm/GridFormTextArea.tsx +2 -2
  57. package/src/components/gridPopoverEdit/GridPopoverMessage.ts +1 -1
  58. package/src/components/gridRender/GridRenderGenericCell.tsx +2 -1
  59. package/src/contexts/GridContext.tsx +4 -4
  60. package/src/contexts/GridContextProvider.tsx +26 -20
  61. package/src/contexts/GridPopoverContextProvider.tsx +2 -3
  62. package/src/contexts/GridUpdatingContextProvider.tsx +2 -6
  63. package/src/lui/ActionButton.tsx +2 -2
  64. package/src/lui/FormError.tsx +3 -1
  65. package/src/lui/TextAreaInput.tsx +3 -3
  66. package/src/lui/TextInputFormatted.tsx +3 -3
  67. package/src/lui/reactUtils.test.tsx +3 -3
  68. package/src/react-menu3/components/FocusableItem.tsx +2 -2
  69. package/src/react-menu3/utils/utils.ts +1 -1
  70. package/src/react-menu3/utils/withHovering.tsx +2 -2
  71. package/src/stories/grid/FormTest.tsx +2 -2
  72. package/src/stories/grid/GridFilterButtons.stories.tsx +8 -1
  73. package/src/stories/grid/GridNoRowsOverlay.stories.tsx +8 -8
  74. package/src/stories/grid/GridNonEditableRow.stories.tsx +9 -2
  75. package/src/stories/grid/GridPopoutContextMenu.stories.tsx +8 -1
  76. package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +8 -1
  77. package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +8 -1
  78. package/src/stories/grid/GridPopoverEditBearing.stories.tsx +7 -0
  79. package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +7 -0
  80. package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +7 -0
  81. package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +8 -0
  82. package/src/stories/grid/GridReadOnly.stories.tsx +10 -2
  83. package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +2 -2
  84. package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +7 -2
  85. package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +7 -2
  86. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +1 -1
  87. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +2 -2
  88. package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +4 -3
  89. package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +3 -3
  90. package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +3 -3
  91. package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +1 -1
  92. package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +1 -1
  93. package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +1 -1
  94. package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +2 -2
  95. package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +1 -1
  96. package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +1 -1
  97. package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +4 -0
  98. package/src/styles/ComponentLoadingWrapper.scss +1 -4
  99. package/src/styles/Grid.scss +0 -4
  100. package/src/styles/GridTheme.scss +138 -106
  101. package/src/utils/testUtil.ts +3 -0
  102. package/src/utils/textValidator.ts +3 -1
@@ -10,7 +10,12 @@ import { useRef } from "react";
10
10
 
11
11
  import "@linzjs/lui/dist/fonts";
12
12
 
13
- import { GridContextProvider, GridFormEditBearing, GridPopoverEditBearingCorrectionEditorParams } from "../../..";
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 { GridContextProvider, GridFormEditBearing, GridPopoverEditBearingEditorParams } from "../../..";
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;
@@ -1,9 +1,6 @@
1
1
  .ComponentLoadingWrapper-saveOverlay {
2
2
  position: absolute;
3
- left: 0;
4
- top: 0;
5
- bottom: 0;
6
- right: 0;
3
+ inset: 0;
7
4
  background-color: rgb(64 64 64 / 10%);
8
5
  z-index: 1000;
9
6
  }
@@ -94,10 +94,6 @@
94
94
  color: colors.$fuscous;
95
95
  }
96
96
 
97
- .Grid-container.ag-theme-alpine .ag-cell {
98
- font-weight: 400;
99
- }
100
-
101
97
  .Grid-container.ag-theme-alpine .ag-cell:not(.ag-cell-focus) .Grid-displayWhenCellFocused {
102
98
  visibility: hidden;
103
99
  }
@@ -1,106 +1,138 @@
1
- @use "@linzjs/lui/dist/scss/Foundation/Variables/ColorVars" as lui;
2
-
3
- // These break if we use urls so ignore stylelint
4
- /* stylelint-disable-next-line */
5
- @import "ag-grid-community/src/styles/ag-grid";
6
- /* stylelint-disable-next-line */
7
- @import "ag-grid-community/src/styles/ag-theme-alpine/sass/ag-theme-alpine-mixin";
8
-
9
- .ag-theme-alpine {
10
- // AG Grid themes can be customized using theme parameters, which are arguments that change its appearance. Refer to
11
- // https://www.ag-grid.com/javascript-data-grid/themes-customising/#full-list-of-theme-parameters for a full list of
12
- // the available theme parameters, which should be used whenever possible.
13
- @include ag-theme-alpine(
14
- (
15
- alpine-active-color: lui.$sea,
16
- foreground-color: lui.$charcoal,
17
- data-color: lui.$charcoal,
18
- // ag-grid-community >=28
19
- selected-row-background-color: lui.$polar,
20
- header-foreground-color: lui.$surfie,
21
- background-color: lui.$white,
22
- odd-row-background-color: lui.$white,
23
- header-background-color: lui.$white,
24
- border-color: lui.$lily,
25
- secondary-border-color: lui.$lily,
26
- cell-horizontal-border: solid ag-derived(secondary-border-color),
27
- cell-horizontal-padding: 12,
28
- row-hover-color: lui.$hint,
29
- font-family: (
30
- "Open Sans",
31
- system-ui,
32
- sans-serif,
33
- ),
34
- font-size: 1rem !important,
35
- borders: false,
36
- borders-critical: true,
37
- borders-secondary: false,
38
- )
39
- );
40
-
41
- // Fix that when you click below checkbox it doesn't process a click
42
- .ag-cell[col-id="selection"] {
43
- display: flex;
44
- }
45
-
46
- // Fix that when you click below checkbox it doesn't process a click
47
- .ag-cell-wrapper > *:not(.ag-cell-value, .ag-group-value) {
48
- height: auto;
49
- }
50
-
51
- .ag-row:last-of-type {
52
- border-bottom: 1px solid lui.$lily;
53
- }
54
-
55
- // ag-grid-community 27.x.x needs this vs 28 using the selected-row-background-color above
56
- // You can set a background _color_ with theme parameters, but for something like a gradient, you need to override CSS.
57
- .ag-row-selected {
58
- background-color: lui.$polar;
59
- }
60
-
61
- .ag-header-cell {
62
- font-weight: 600;
63
- padding: 7px 11px;
64
-
65
- .LuiIcon {
66
- fill: lui.$surfie;
67
- }
68
- }
69
-
70
- .ag-cell {
71
- padding-left: 11px;
72
- padding-right: 11px;
73
- display: flex;
74
- align-items: center;
75
- }
76
-
77
- .ag-cell-wrap-text {
78
- word-break: break-word;
79
- }
80
-
81
- .ag-cell.ag-cell-popup-editing,
82
- .ag-cell.ag-selected-for-edit,
83
- .ag-cell-inline-editing {
84
- padding-left: 9px;
85
- padding-right: 9px;
86
- background: rgb(72 160 244 / 20%);
87
- // These are important, it needs to override ag-grid to work
88
- border: 3px solid #48a0f4 !important;
89
- border-right: 3px solid #48a0f4 !important;
90
- }
91
-
92
- .ag-row .ag-cell-data-changed {
93
- // ag-grid natively has !important on this style so we have to use it here :(
94
- background-color: lightgoldenrodyellow !important;
95
- }
96
-
97
- .ag-center-cols-clipper {
98
- // when using domLayout={"autoHeight"}, ag grid has a default min-height set to 150px so the !important is necessary here
99
- min-height: 40px !important;
100
- }
101
-
102
- .ag-body-horizontal-scroll-viewport {
103
- // It's set to scroll by default, but this causes issues with selecting the last row
104
- overflow-x: auto;
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
+ }
@@ -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) => JSX.Element | string | null;
10
+ invalid?: (value: string, data: RowType, context: any) => ReactElement | string | null;
9
11
  numberFormat?: {
10
12
  precision?: number;
11
13
  scale?: number;