@linzjs/step-ag-grid 19.1.0 → 20.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 +19 -23
- package/dist/step-ag-grid.cjs.js +3 -51226
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +7 -51230
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +9 -10
- package/src/components/GridCell.tsx +1 -1
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +5 -3
- package/src/styles/GridTheme.scss +19 -23
- package/src/utils/testUtil.ts +10 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@linzjs/step-ag-grid",
|
|
3
3
|
"repository": "github:linz/step-ag-grid.git",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "20.0.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"aggrid",
|
|
8
8
|
"ag-grid",
|
|
@@ -28,21 +28,17 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@linzjs/lui": ">=21",
|
|
31
|
-
"ag-grid-
|
|
31
|
+
"ag-grid-community": "^30",
|
|
32
|
+
"ag-grid-react": "^30",
|
|
32
33
|
"lodash-es": ">=4",
|
|
33
34
|
"react": ">=18",
|
|
34
35
|
"react-dom": ">=18"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"@linzjs/lui": ">=21",
|
|
38
|
-
"ag-grid-community": "~29",
|
|
39
|
-
"ag-grid-react": "~29",
|
|
40
38
|
"clsx": "^2.1.1",
|
|
41
39
|
"debounce-promise": "^3.1.2",
|
|
42
40
|
"lodash-es": ">=4",
|
|
43
41
|
"matcher": "^5.0.0",
|
|
44
|
-
"react": ">=18",
|
|
45
|
-
"react-dom": ">=18",
|
|
46
42
|
"react-transition-state": "^2.1.1",
|
|
47
43
|
"usehooks-ts": "^3.1.0",
|
|
48
44
|
"uuid": "^9.0.1"
|
|
@@ -91,7 +87,6 @@
|
|
|
91
87
|
"@semantic-release/git": "^10.0.1",
|
|
92
88
|
"@storybook/addon-essentials": "^8.1.0",
|
|
93
89
|
"@storybook/addon-interactions": "^8.1.0",
|
|
94
|
-
"@storybook/addon-postcss": "^2.0.0",
|
|
95
90
|
"@storybook/preset-create-react-app": "^8.1.0",
|
|
96
91
|
"@storybook/react": "^8.1.0",
|
|
97
92
|
"@storybook/react-webpack5": "^8.1.0",
|
|
@@ -114,7 +109,6 @@
|
|
|
114
109
|
"babel-jest": "^29.7.0",
|
|
115
110
|
"babel-preset-react-app": "^10.0.1",
|
|
116
111
|
"chromatic": "^11.3.2",
|
|
117
|
-
"conventional-changelog-conventionalcommits": "^6.1.0",
|
|
118
112
|
"css-loader": "^7.1.1",
|
|
119
113
|
"esbuild": "^0.21.2",
|
|
120
114
|
"eslint": "^8.57.0",
|
|
@@ -158,7 +152,12 @@
|
|
|
158
152
|
"stylelint-prettier": "^4.1.0",
|
|
159
153
|
"stylelint-scss": "^5.3.2",
|
|
160
154
|
"tsconfig-paths-webpack-plugin": "^4.1.0",
|
|
161
|
-
"typescript": "^4.9.5"
|
|
155
|
+
"typescript": "^4.9.5",
|
|
156
|
+
"@linzjs/lui": ">=21",
|
|
157
|
+
"ag-grid-community": "^30",
|
|
158
|
+
"ag-grid-react": "^30",
|
|
159
|
+
"react": ">=18",
|
|
160
|
+
"react-dom": ">=18"
|
|
162
161
|
},
|
|
163
162
|
"babel": {
|
|
164
163
|
"presets": [
|
|
@@ -65,7 +65,7 @@ export interface ColDefT<RowType extends GridBaseRow> extends ColDef {
|
|
|
65
65
|
export const suppressCellKeyboardEvents = (e: SuppressKeyboardEventParams) => {
|
|
66
66
|
const shortcutKeys = e.colDef.cellRendererParams?.shortcutKeys ?? {};
|
|
67
67
|
const exec = shortcutKeys[e.event.key];
|
|
68
|
-
if (!e.editing && !e.event.repeat && e.event.type === "
|
|
68
|
+
if (exec && !e.editing && !e.event.repeat && e.event.type === "keydown") {
|
|
69
69
|
const editable = fnOrVar(e.colDef?.editable, e);
|
|
70
70
|
return editable ? exec(e) ?? true : true;
|
|
71
71
|
}
|
|
@@ -4,7 +4,7 @@ import "@linzjs/lui/dist/scss/base.scss";
|
|
|
4
4
|
|
|
5
5
|
import { Meta, StoryFn } from "@storybook/react";
|
|
6
6
|
import { expect } from "@storybook/test";
|
|
7
|
-
import
|
|
7
|
+
import { fn } from "@storybook/test";
|
|
8
8
|
import { userEvent, waitFor } from "@storybook/test";
|
|
9
9
|
import { useMemo, useState } from "react";
|
|
10
10
|
|
|
@@ -66,11 +66,13 @@ interface ITestRow {
|
|
|
66
66
|
dd: string;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
const multiEditAction =
|
|
69
|
+
const multiEditAction = fn(async () => {
|
|
70
70
|
await wait(500);
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
-
const eAction =
|
|
73
|
+
const eAction = fn(() => {
|
|
74
|
+
return true;
|
|
75
|
+
});
|
|
74
76
|
|
|
75
77
|
const GridKeyboardInteractionsTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
76
78
|
const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
|
|
@@ -60,7 +60,11 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
60
60
|
|
|
61
61
|
.ag-theme-step-default.theme-specific,
|
|
62
62
|
.ag-theme-step-compact.theme-specific {
|
|
63
|
-
|
|
63
|
+
div.ag-center-cols-viewport {
|
|
64
|
+
// when using domLayout={"autoHeight"}, ag grid has a default min-height
|
|
65
|
+
// set to 150px so the !important is necessary here
|
|
66
|
+
min-height: 40px !important;
|
|
67
|
+
}
|
|
64
68
|
// fix alignment of cell content when grabber is present
|
|
65
69
|
.ag-header-cell-comp-wrapper {
|
|
66
70
|
justify-content: end;
|
|
@@ -140,17 +144,25 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
140
144
|
background-color: lightgoldenrodyellow;
|
|
141
145
|
}
|
|
142
146
|
|
|
143
|
-
.ag-center-cols-clipper {
|
|
144
|
-
// when using domLayout={"autoHeight"}, ag grid has a default min-height
|
|
145
|
-
// set to 150px so the !important is necessary here
|
|
146
|
-
min-height: 40px !important;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
147
|
.ag-body-horizontal-scroll-viewport {
|
|
150
148
|
// It's set to scroll by default, but this causes issues with selecting the last row
|
|
151
149
|
overflow-x: auto;
|
|
152
150
|
}
|
|
153
151
|
|
|
152
|
+
.ag-header-group-cell {
|
|
153
|
+
text-transform: uppercase;
|
|
154
|
+
font-size: 12px;
|
|
155
|
+
margin-top: 12px;
|
|
156
|
+
height: 28px;
|
|
157
|
+
font-weight: 800;
|
|
158
|
+
letter-spacing: 2px;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
|
|
161
|
+
&.ag-header-group-cell-with-group {
|
|
162
|
+
background-color: lui.$iceberg;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
154
166
|
.ag-cell {
|
|
155
167
|
font-weight: 400;
|
|
156
168
|
}
|
|
@@ -224,22 +236,6 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
224
236
|
border-bottom: 2px dashed lui.$andrea;
|
|
225
237
|
}
|
|
226
238
|
|
|
227
|
-
// .ag-header .ag-pinned-left-header:after,
|
|
228
|
-
// .ag-body-viewport .ag-pinned-left-cols-container:after {
|
|
229
|
-
// content: " ";
|
|
230
|
-
// height: 100%;
|
|
231
|
-
// position: absolute;
|
|
232
|
-
// z-index: 1;
|
|
233
|
-
// top: 0;
|
|
234
|
-
// width: 15px;
|
|
235
|
-
// box-shadow: -4px 0px 15px -4px rgba(0, 0, 0, 0.1);
|
|
236
|
-
// right: -4px;
|
|
237
|
-
// }
|
|
238
|
-
|
|
239
|
-
// div:after {
|
|
240
|
-
// box-shadow: 15px 0 15px -15px inset;
|
|
241
|
-
// right: -15px;
|
|
242
|
-
// }
|
|
243
239
|
.ag-pinned-left-header,
|
|
244
240
|
.ag-pinned-right-header,
|
|
245
241
|
.ag-pinned-right-cols-container,
|
package/src/utils/testUtil.ts
CHANGED
|
@@ -28,19 +28,26 @@ export const findRow = async (rowId: number | string, within?: HTMLElement): Pro
|
|
|
28
28
|
{ tagName: `.ag-center-cols-container div[row-id='${rowId}']:not(:empty)` },
|
|
29
29
|
within,
|
|
30
30
|
);
|
|
31
|
-
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
let combineChildren = [...row.children];
|
|
32
33
|
|
|
33
34
|
const leftCols = queryQuick<HTMLDivElement>(
|
|
34
35
|
{ tagName: `.ag-pinned-left-cols-container div[row-id='${rowId}']` },
|
|
35
36
|
within,
|
|
36
37
|
);
|
|
37
|
-
if (leftCols)
|
|
38
|
+
if (leftCols) {
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
combineChildren = [...leftCols.children, ...combineChildren];
|
|
41
|
+
}
|
|
38
42
|
|
|
39
43
|
const rightCols = queryQuick<HTMLDivElement>(
|
|
40
44
|
{ tagName: `.ag-pinned-right-cols-container div[row-id='${rowId}']` },
|
|
41
45
|
within,
|
|
42
46
|
);
|
|
43
|
-
if (rightCols)
|
|
47
|
+
if (rightCols) {
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
combineChildren = [...rightCols.children, ...combineChildren];
|
|
50
|
+
}
|
|
44
51
|
|
|
45
52
|
row.replaceChildren(...combineChildren);
|
|
46
53
|
});
|