@linzjs/step-ag-grid 17.4.5 → 17.4.7
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 +126 -74
- package/dist/index.css +5 -51
- package/dist/step-ag-grid.cjs.js +10 -1
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +10 -1
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/stories/grid/GridDragRow.stories.tsx +1 -1
- package/src/styles/Grid.scss +6 -54
- package/src/styles/GridTheme.scss +126 -74
- package/src/utils/testUtil.ts +20 -2
package/package.json
CHANGED
|
@@ -109,7 +109,7 @@ const GridDragRowTemplate: ComponentStory<typeof Grid> = (props: GridProps) => {
|
|
|
109
109
|
columnDefs={columnDefs}
|
|
110
110
|
defaultColDef={{ sortable: false }}
|
|
111
111
|
rowData={rowData}
|
|
112
|
-
onRowDragEnd={(row, _, targetIndex) => {
|
|
112
|
+
onRowDragEnd={async (row, _, targetIndex) => {
|
|
113
113
|
alert(`Row ${row.id} request to be moved to index ${targetIndex}.`);
|
|
114
114
|
}}
|
|
115
115
|
rowDragText={(params) => `${params.rowNode?.data.id} - ${params.rowNode?.data.position}`}
|
package/src/styles/Grid.scss
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
flex: 1;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
|
|
18
19
|
.Grid-sortIsStale {
|
|
19
20
|
span.ag-icon.ag-icon-desc::after {
|
|
20
21
|
content: "*";
|
|
@@ -71,60 +72,6 @@
|
|
|
71
72
|
padding: 0.375rem 0.75rem;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
.ag-cell-value {
|
|
75
|
-
display: flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.ag-cell .GridCell-editableIcon {
|
|
80
|
-
fill: colors.$silver;
|
|
81
|
-
visibility: hidden;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.ag-cell:hover .GridCell-editableIcon, .ag-cell.ag-cell-focus .GridCell-editableIcon {
|
|
85
|
-
visibility: visible;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.ag-drag-handle.ag-row-drag{
|
|
89
|
-
opacity: 0;
|
|
90
|
-
|
|
91
|
-
.ag-icon-grip{
|
|
92
|
-
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%239999B3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2Zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2Zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z' /%3E%3C/svg%3E");
|
|
93
|
-
background-repeat: no-repeat no-repeat;
|
|
94
|
-
background-position: center center;
|
|
95
|
-
background-size: cover;
|
|
96
|
-
color:transparent;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.ag-row:hover{
|
|
101
|
-
.ag-drag-handle.ag-row-drag{
|
|
102
|
-
opacity: 1;
|
|
103
|
-
transition: opacity 0.2s ease-in-out;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.GridFormMessage-container {
|
|
108
|
-
padding: 4px 8px;
|
|
109
|
-
max-width: 400px;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.GridCell-readonly {
|
|
113
|
-
color: colors.$fuscous;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.Grid-container.ag-theme-alpine .ag-cell:not(.ag-cell-focus) .Grid-displayWhenCellFocused {
|
|
117
|
-
visibility: hidden;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.Grid-container.ag-theme-alpine .ag-cell:hover .Grid-displayWhenCellFocused {
|
|
121
|
-
visibility: inherit;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.Grid-container.ag-theme-alpine .ag-cell-wrapper {
|
|
125
|
-
width: 100%;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
75
|
.flex-col-center {
|
|
129
76
|
display: flex;
|
|
130
77
|
flex-direction: column;
|
|
@@ -137,3 +84,8 @@
|
|
|
137
84
|
align-items: center;
|
|
138
85
|
}
|
|
139
86
|
|
|
87
|
+
.GridFormMessage-container {
|
|
88
|
+
padding: 4px 8px;
|
|
89
|
+
max-width: 400px;
|
|
90
|
+
}
|
|
91
|
+
|
|
@@ -47,98 +47,150 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
47
47
|
)
|
|
48
48
|
);
|
|
49
49
|
|
|
50
|
+
.ag-theme-step-default,
|
|
51
|
+
.ag-theme-step-compact {
|
|
52
|
+
.ag-cell[col-id="selection"] {
|
|
53
|
+
display: flex; // Fix that when you click below checkbox it doesn't process a click
|
|
54
|
+
}
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
// fix alignment of cell content when grabber is present
|
|
57
|
+
.ag-header-cell-comp-wrapper {
|
|
58
|
+
justify-content: end;
|
|
59
|
+
}
|
|
54
60
|
|
|
55
|
-
//
|
|
56
|
-
.ag-
|
|
57
|
-
|
|
58
|
-
}
|
|
61
|
+
// Fix that when you click below checkbox it doesn't process a click
|
|
62
|
+
.ag-cell-wrapper > *:not(.ag-cell-value, .ag-group-value) {
|
|
63
|
+
height: auto;
|
|
64
|
+
}
|
|
59
65
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
66
|
+
.ag-row:last-of-type {
|
|
67
|
+
border-bottom: 1px solid lui.$dew;
|
|
68
|
+
}
|
|
64
69
|
|
|
65
|
-
.ag-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
.ag-header-cell {
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
|
|
74
|
+
// fix: Display descender line
|
|
75
|
+
padding: 0 11px;
|
|
68
76
|
|
|
69
|
-
.
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
.LuiIcon {
|
|
78
|
+
fill: lui.$surfie;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
72
81
|
|
|
73
|
-
|
|
74
|
-
|
|
82
|
+
.ag-cell-label-container {
|
|
83
|
+
padding: 8px 0;
|
|
75
84
|
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
// Help ag-grid to calculate column height in react portal
|
|
86
|
+
height: fit-content;
|
|
78
87
|
}
|
|
79
|
-
}
|
|
80
88
|
|
|
81
|
-
.ag-cell-
|
|
82
|
-
|
|
89
|
+
.ag-header .ag-header-cell[aria-colindex="1"] {
|
|
90
|
+
padding-left: 17px;
|
|
91
|
+
padding-right: 15px;
|
|
92
|
+
}
|
|
83
93
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
.ag-cell[role="gridcell"] {
|
|
95
|
+
border-right: none;
|
|
96
|
+
border-left: 1px var(--ag-cell-horizontal-border);
|
|
97
|
+
}
|
|
87
98
|
|
|
88
|
-
.ag-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
99
|
+
.ag-cell[aria-colindex="1"] {
|
|
100
|
+
border-left: 1px solid transparent;
|
|
101
|
+
padding-left: lui.$unit-rg;
|
|
102
|
+
}
|
|
92
103
|
|
|
93
|
-
.ag-cell
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
.ag-cell {
|
|
105
|
+
padding-left: 11px;
|
|
106
|
+
padding-right: 11px;
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
}
|
|
97
110
|
|
|
98
|
-
.ag-cell
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
111
|
+
.ag-cell-wrap-text {
|
|
112
|
+
word-break: break-word;
|
|
113
|
+
}
|
|
102
114
|
|
|
103
|
-
.ag-cell
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
115
|
+
.ag-cell.ag-cell-popup-editing,
|
|
116
|
+
.ag-cell.ag-selected-for-edit,
|
|
117
|
+
.ag-cell-inline-editing {
|
|
118
|
+
padding-left: 9px;
|
|
119
|
+
padding-right: 9px;
|
|
120
|
+
background: rgb(72 160 244 / 20%);
|
|
109
121
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
122
|
+
// These are important, it needs to override ag-grid to work
|
|
123
|
+
border: 3px solid #48a0f4 !important;
|
|
124
|
+
border-right: 3px solid #48a0f4 !important;
|
|
125
|
+
}
|
|
113
126
|
|
|
114
|
-
.ag-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
padding-right: 9px;
|
|
119
|
-
background: rgb(72 160 244 / 20%);
|
|
127
|
+
.ag-row .ag-cell-data-changed {
|
|
128
|
+
// ag-grid natively has !important on this style so we have to use it here :(
|
|
129
|
+
background-color: lightgoldenrodyellow;
|
|
130
|
+
}
|
|
120
131
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
132
|
+
.ag-center-cols-clipper {
|
|
133
|
+
// when using domLayout={"autoHeight"}, ag grid has a default min-height
|
|
134
|
+
// set to 150px so the !important is necessary here
|
|
135
|
+
min-height: 40px !important;
|
|
136
|
+
}
|
|
125
137
|
|
|
126
|
-
.ag-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
138
|
+
.ag-body-horizontal-scroll-viewport {
|
|
139
|
+
// It's set to scroll by default, but this causes issues with selecting the last row
|
|
140
|
+
overflow-x: auto;
|
|
141
|
+
}
|
|
130
142
|
|
|
131
|
-
.ag-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
min-height: 40px !important;
|
|
135
|
-
}
|
|
143
|
+
.ag-cell {
|
|
144
|
+
font-weight: 400;
|
|
145
|
+
}
|
|
136
146
|
|
|
137
|
-
.ag-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
147
|
+
.ag-cell-value {
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.ag-cell .GridCell-editableIcon {
|
|
153
|
+
fill: lui.$silver;
|
|
154
|
+
visibility: hidden;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.ag-cell:hover .GridCell-editableIcon,
|
|
158
|
+
.ag-cell.ag-cell-focus .GridCell-editableIcon {
|
|
159
|
+
visibility: visible;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.ag-drag-handle.ag-row-drag {
|
|
163
|
+
opacity: 0;
|
|
141
164
|
|
|
142
|
-
.
|
|
143
|
-
|
|
144
|
-
|
|
165
|
+
.ag-icon-grip {
|
|
166
|
+
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%239999B3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2Zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2Zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z' /%3E%3C/svg%3E");
|
|
167
|
+
background-repeat: no-repeat no-repeat;
|
|
168
|
+
background-position: center center;
|
|
169
|
+
background-size: cover;
|
|
170
|
+
color: transparent;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.ag-row:hover {
|
|
175
|
+
.ag-drag-handle.ag-row-drag {
|
|
176
|
+
opacity: 1;
|
|
177
|
+
transition: opacity 0.2s ease-in-out;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.GridCell-readonly {
|
|
182
|
+
color: lui.$fuscous;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.ag-cell:not(.ag-cell-focus) .Grid-displayWhenCellFocused {
|
|
186
|
+
visibility: hidden;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.ag-cell:hover .Grid-displayWhenCellFocused {
|
|
190
|
+
visibility: inherit;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.ag-cell-wrapper {
|
|
194
|
+
width: 100%;
|
|
195
|
+
}
|
|
196
|
+
}
|
package/src/utils/testUtil.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { waitFor, within } from "@testing-library/react";
|
|
1
|
+
import { act, waitFor, within } from "@testing-library/react";
|
|
2
2
|
import userEvent from "@testing-library/user-event";
|
|
3
3
|
import { isEqual } from "lodash-es";
|
|
4
4
|
|
|
@@ -21,7 +21,25 @@ export const findRow = async (rowId: number | string, within?: HTMLElement): Pro
|
|
|
21
21
|
await waitFor(async () => {
|
|
22
22
|
expect(getAllQuick({ classes: ".ag-row" }).length > 0).toBe(true);
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
//if this is not wrapped in an act console errors are logged during testing
|
|
25
|
+
let row!: HTMLDivElement;
|
|
26
|
+
await act(async () => {
|
|
27
|
+
row = await findQuick<HTMLDivElement>(
|
|
28
|
+
{ tagName: `.ag-center-cols-container div[row-id='${rowId}']:not(:empty)` },
|
|
29
|
+
within,
|
|
30
|
+
);
|
|
31
|
+
const leftCols = await findQuick<HTMLDivElement>(
|
|
32
|
+
{ tagName: `.ag-pinned-left-cols-container div[row-id='${rowId}']` },
|
|
33
|
+
within,
|
|
34
|
+
);
|
|
35
|
+
const rightCols = await findQuick<HTMLDivElement>(
|
|
36
|
+
{ tagName: `.ag-pinned-right-cols-container div[row-id='${rowId}']` },
|
|
37
|
+
within,
|
|
38
|
+
);
|
|
39
|
+
const combineChildren = [...leftCols.children, ...row.children, ...rightCols.children];
|
|
40
|
+
row.replaceChildren(...combineChildren);
|
|
41
|
+
});
|
|
42
|
+
return row;
|
|
25
43
|
};
|
|
26
44
|
|
|
27
45
|
export const queryRow = async (rowId: number | string, within?: HTMLElement): Promise<HTMLDivElement | null> => {
|