@linzjs/step-ag-grid 29.5.0 → 29.6.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 +21 -19
- package/dist/src/components/gridFilter/GridFilterColumnsMultiSelect.d.ts +30 -0
- package/package.json +14 -14
- package/src/components/gridFilter/GridFilterColumnsMultiSelect.scss +20 -0
- package/src/components/gridFilter/GridFilterColumnsMultiSelect.tsx +189 -0
- package/src/stories/grid/GridFilterColumnsMultiSelect.stories.tsx +122 -0
- package/src/styles/GridTheme.scss +21 -19
package/dist/GridTheme.scss
CHANGED
|
@@ -58,31 +58,30 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
58
58
|
)
|
|
59
59
|
);
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
.ag-theme-step-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
.ag-theme-step-default.theme-specific,
|
|
62
|
+
.ag-theme-step-compact.theme-specific {
|
|
63
|
+
// Don't hide the drag handle
|
|
64
|
+
.ag-drag-handle.ag-row-drag {
|
|
65
|
+
opacity: 1 !important;
|
|
66
|
+
}
|
|
65
67
|
|
|
66
|
-
.ag-header-hide-default-select .ag-labeled {
|
|
67
|
-
|
|
68
|
-
}
|
|
68
|
+
.ag-header-hide-default-select .ag-labeled {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
69
71
|
|
|
70
|
-
.ag-header-
|
|
71
|
-
|
|
72
|
-
}
|
|
72
|
+
div.ag-header-cell.ag-header-select-draggable[col-id='ag-Grid-SelectionColumn'] {
|
|
73
|
+
padding-left: 40px;
|
|
74
|
+
}
|
|
73
75
|
|
|
74
|
-
div.ag-header-cell.ag-header-select-draggable[col-id='ag-Grid-SelectionColumn'] {
|
|
75
|
-
|
|
76
|
-
}
|
|
76
|
+
div.ag-header-cell:not(.ag-header-select-draggable)[col-id='ag-Grid-SelectionColumn'] {
|
|
77
|
+
padding-left: 12px;
|
|
78
|
+
}
|
|
77
79
|
|
|
78
|
-
.ag-
|
|
79
|
-
|
|
80
|
-
margin:
|
|
80
|
+
div.ag-cell-wrapper {
|
|
81
|
+
margin-left: 4px;
|
|
82
|
+
margin-right: 4px;
|
|
81
83
|
}
|
|
82
|
-
}
|
|
83
84
|
|
|
84
|
-
.ag-theme-step-default.theme-specific,
|
|
85
|
-
.ag-theme-step-compact.theme-specific {
|
|
86
85
|
div.ag-center-cols-viewport {
|
|
87
86
|
// when using domLayout={"autoHeight"}, ag grid has a default min-height
|
|
88
87
|
// set to 150px so the !important is necessary here
|
|
@@ -158,6 +157,9 @@ div.ag-header-cell.ag-header-select-draggable[col-id='ag-Grid-SelectionColumn']
|
|
|
158
157
|
}
|
|
159
158
|
}
|
|
160
159
|
|
|
160
|
+
div.ag-cell-wrapper .ag-selection-checkbox {
|
|
161
|
+
margin: 0;
|
|
162
|
+
}
|
|
161
163
|
|
|
162
164
|
.ag-cell {
|
|
163
165
|
display: flex;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import './GridFilterColumnsMultiSelect.scss';
|
|
2
|
+
import type { IDoesFilterPassParams, IFilterComp, IFilterParams } from 'ag-grid-community';
|
|
3
|
+
export interface CheckboxMultiFilterParams extends IFilterParams {
|
|
4
|
+
labels?: Record<string, string>;
|
|
5
|
+
labelFormatter?: (value: string) => string;
|
|
6
|
+
}
|
|
7
|
+
export interface CheckboxMultiFilterModel {
|
|
8
|
+
values: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare class GridFilterColumnsMultiSelect implements IFilterComp {
|
|
11
|
+
private params;
|
|
12
|
+
private selectedValues;
|
|
13
|
+
private labels;
|
|
14
|
+
private allValues;
|
|
15
|
+
private gui;
|
|
16
|
+
private labelFormatter?;
|
|
17
|
+
private reactRoot;
|
|
18
|
+
private loadFieldValues;
|
|
19
|
+
init(params: CheckboxMultiFilterParams): void;
|
|
20
|
+
private render;
|
|
21
|
+
private handleToggleAll;
|
|
22
|
+
private handleToggleOne;
|
|
23
|
+
getGui(): HTMLElement;
|
|
24
|
+
isFilterActive(): boolean;
|
|
25
|
+
doesFilterPass(params: IDoesFilterPassParams): boolean;
|
|
26
|
+
getModel(): CheckboxMultiFilterModel | null;
|
|
27
|
+
setModel(model: CheckboxMultiFilterModel | null): void;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare const createCheckboxMultiFilterParams: (labels?: Record<string, string>, labelFormatter?: (value: string) => string) => Partial<CheckboxMultiFilterParams>;
|
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": "29.
|
|
5
|
+
"version": "29.6.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"aggrid",
|
|
8
8
|
"ag-grid",
|
|
@@ -76,22 +76,22 @@
|
|
|
76
76
|
]
|
|
77
77
|
},
|
|
78
78
|
"optionalDependencies": {
|
|
79
|
-
"@rollup/rollup-linux-x64-gnu": "^4.52.
|
|
79
|
+
"@rollup/rollup-linux-x64-gnu": "^4.52.4",
|
|
80
80
|
"@swc/core-linux-x64-gnu": "^1.13.20"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@chromatic-com/storybook": "^4.1.1",
|
|
84
|
-
"@linzjs/lui": "^23.
|
|
84
|
+
"@linzjs/lui": "^23.14.2",
|
|
85
85
|
"@linzjs/style": "^5.4.0",
|
|
86
86
|
"@linzjs/windows": "^5.7.0",
|
|
87
|
-
"@rollup/plugin-commonjs": "^28.0.
|
|
87
|
+
"@rollup/plugin-commonjs": "^28.0.8",
|
|
88
88
|
"@rollup/plugin-json": "^6.1.0",
|
|
89
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
89
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
90
90
|
"@semantic-release/git": "^10.0.1",
|
|
91
|
-
"@storybook/addon-docs": "^9.1.
|
|
92
|
-
"@storybook/addon-links": "^9.1.
|
|
93
|
-
"@storybook/react": "^9.1.
|
|
94
|
-
"@storybook/react-vite": "^9.1.
|
|
91
|
+
"@storybook/addon-docs": "^9.1.12",
|
|
92
|
+
"@storybook/addon-links": "^9.1.12",
|
|
93
|
+
"@storybook/react": "^9.1.12",
|
|
94
|
+
"@storybook/react-vite": "^9.1.12",
|
|
95
95
|
"@testing-library/dom": "^10.4.1",
|
|
96
96
|
"@testing-library/react": "^16.3.0",
|
|
97
97
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"cross-env": "^10.1.0",
|
|
112
112
|
"css-loader": "^7.1.2",
|
|
113
113
|
"eslint-plugin-react": "^7.37.5",
|
|
114
|
-
"eslint-plugin-storybook": "^9.1.
|
|
114
|
+
"eslint-plugin-storybook": "^9.1.12",
|
|
115
115
|
"jsdom": "^26.1.0",
|
|
116
116
|
"lodash-es": "^4.17.21",
|
|
117
117
|
"mkdirp": "^3.0.1",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"react-app-polyfill": "^3.0.0",
|
|
124
124
|
"react-dom": "^18.3.1",
|
|
125
125
|
"rimraf": "^6.0.1",
|
|
126
|
-
"rollup": "^4.52.
|
|
126
|
+
"rollup": "^4.52.4",
|
|
127
127
|
"rollup-plugin-copy": "^3.5.0",
|
|
128
128
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
129
129
|
"rollup-plugin-postcss": "^4.0.2",
|
|
@@ -131,11 +131,11 @@
|
|
|
131
131
|
"sass": "^1.93.2",
|
|
132
132
|
"sass-loader": "^16.0.5",
|
|
133
133
|
"semantic-release": "^24.2.9",
|
|
134
|
-
"storybook": "^9.1.
|
|
134
|
+
"storybook": "^9.1.12",
|
|
135
135
|
"storybook-css-modules-preset": "^1.1.1",
|
|
136
136
|
"style-loader": "^4.0.0",
|
|
137
|
-
"typescript": "^5.9.
|
|
138
|
-
"vite": "^7.1.
|
|
137
|
+
"typescript": "^5.9.3",
|
|
138
|
+
"vite": "^7.1.10",
|
|
139
139
|
"vite-plugin-html": "^3.2.2",
|
|
140
140
|
"vite-tsconfig-paths": "^5.1.4",
|
|
141
141
|
"vitest": "^3.2.4"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@use "@linzjs/lui/dist/scss/Core" as lui;
|
|
2
|
+
|
|
3
|
+
.GridFilterColsMultiSelect {
|
|
4
|
+
background: #fff;
|
|
5
|
+
padding: 8px;
|
|
6
|
+
@include lui.font-semibold();
|
|
7
|
+
|
|
8
|
+
.LuiCheckboxInput-selectAll,
|
|
9
|
+
.LuiCheckboxInput-item {
|
|
10
|
+
color: lui.$charcoal;
|
|
11
|
+
line-height: 20px;
|
|
12
|
+
margin-bottom: 0;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
font-style: SemiBold;
|
|
15
|
+
font-size: 16px;
|
|
16
|
+
line-height: 24px;
|
|
17
|
+
letter-spacing: 0%;
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import './GridFilterColumnsMultiSelect.scss';
|
|
2
|
+
|
|
3
|
+
import { LuiCheckboxInput } from '@linzjs/lui';
|
|
4
|
+
import type { IDoesFilterPassParams, IFilterComp, IFilterParams } from 'ag-grid-community';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { createRoot, Root } from 'react-dom/client';
|
|
7
|
+
|
|
8
|
+
export interface CheckboxMultiFilterParams extends IFilterParams {
|
|
9
|
+
labels?: Record<string, string>;
|
|
10
|
+
labelFormatter?: (value: string) => string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface CheckboxMultiFilterModel {
|
|
14
|
+
values: string[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface FilterUIProps {
|
|
18
|
+
allValues: string[];
|
|
19
|
+
selected: Set<string>;
|
|
20
|
+
labels: Record<string, string>;
|
|
21
|
+
labelFormatter?: (value: string) => string;
|
|
22
|
+
onToggleAll: (checked: boolean) => void;
|
|
23
|
+
onToggleOne: (value: string, checked: boolean) => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const FilterUI: React.FC<FilterUIProps> = ({
|
|
27
|
+
allValues,
|
|
28
|
+
selected,
|
|
29
|
+
labels,
|
|
30
|
+
labelFormatter,
|
|
31
|
+
onToggleAll,
|
|
32
|
+
onToggleOne,
|
|
33
|
+
}) => {
|
|
34
|
+
const allChecked = allValues.length > 0 && selected.size === allValues.length;
|
|
35
|
+
|
|
36
|
+
const getDisplayLabel = (raw: string): string => {
|
|
37
|
+
const mapped = labels[raw] ?? raw;
|
|
38
|
+
return labelFormatter ? labelFormatter(mapped) : mapped;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div className="GridFilterColsMultiSelect">
|
|
43
|
+
<span className="LuiSelect-label-text">Filter column</span>
|
|
44
|
+
|
|
45
|
+
<LuiCheckboxInput
|
|
46
|
+
className="LuiCheckboxInput-selectAll"
|
|
47
|
+
label={'Select All'}
|
|
48
|
+
value="true"
|
|
49
|
+
isChecked={allChecked}
|
|
50
|
+
onChange={(e) => onToggleAll(e.target.checked)}
|
|
51
|
+
/>
|
|
52
|
+
{allValues.map((val) => (
|
|
53
|
+
<LuiCheckboxInput
|
|
54
|
+
key={val}
|
|
55
|
+
className="LuiCheckboxInput-item"
|
|
56
|
+
label={getDisplayLabel(val)}
|
|
57
|
+
value={val}
|
|
58
|
+
isChecked={selected.has(val)}
|
|
59
|
+
onChange={(e) => onToggleOne(val, e.target.checked)}
|
|
60
|
+
/>
|
|
61
|
+
))}
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export class GridFilterColumnsMultiSelect implements IFilterComp {
|
|
67
|
+
private params!: CheckboxMultiFilterParams;
|
|
68
|
+
private selectedValues = new Set<string>();
|
|
69
|
+
private labels: Record<string, string> = {};
|
|
70
|
+
private allValues: string[] = [];
|
|
71
|
+
private gui!: HTMLElement;
|
|
72
|
+
private labelFormatter?: (value: string) => string;
|
|
73
|
+
private reactRoot: Root | null = null;
|
|
74
|
+
|
|
75
|
+
private loadFieldValues(): string[] {
|
|
76
|
+
const field = this.params.colDef.field as string;
|
|
77
|
+
const values = new Set<string>();
|
|
78
|
+
|
|
79
|
+
this.params.api.forEachNode((node) => {
|
|
80
|
+
const data = node.data;
|
|
81
|
+
const cellValue = data?.[field];
|
|
82
|
+
if (
|
|
83
|
+
data &&
|
|
84
|
+
typeof data === 'object' &&
|
|
85
|
+
field in data &&
|
|
86
|
+
typeof cellValue === 'string' &&
|
|
87
|
+
cellValue !== undefined &&
|
|
88
|
+
cellValue !== null
|
|
89
|
+
) {
|
|
90
|
+
values.add(cellValue);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
return Array.from(values).sort();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
init(params: CheckboxMultiFilterParams): void {
|
|
98
|
+
this.params = params;
|
|
99
|
+
this.labels = { ...params.labels };
|
|
100
|
+
this.labelFormatter = params.labelFormatter;
|
|
101
|
+
|
|
102
|
+
this.allValues = this.loadFieldValues();
|
|
103
|
+
|
|
104
|
+
this.gui = document.createElement('div');
|
|
105
|
+
this.reactRoot = createRoot(this.gui);
|
|
106
|
+
this.render();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
private render(): void {
|
|
110
|
+
if (!this.reactRoot) return;
|
|
111
|
+
|
|
112
|
+
this.reactRoot.render(
|
|
113
|
+
<FilterUI
|
|
114
|
+
allValues={this.allValues}
|
|
115
|
+
selected={this.selectedValues}
|
|
116
|
+
labels={this.labels}
|
|
117
|
+
labelFormatter={this.labelFormatter}
|
|
118
|
+
onToggleAll={this.handleToggleAll.bind(this)}
|
|
119
|
+
onToggleOne={this.handleToggleOne.bind(this)}
|
|
120
|
+
/>,
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
private handleToggleAll(checked: boolean): void {
|
|
125
|
+
if (checked) {
|
|
126
|
+
this.allValues.forEach((val) => this.selectedValues.add(val));
|
|
127
|
+
} else {
|
|
128
|
+
this.selectedValues.clear();
|
|
129
|
+
}
|
|
130
|
+
this.render();
|
|
131
|
+
this.params.filterChangedCallback();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
private handleToggleOne(value: string, checked: boolean): void {
|
|
135
|
+
if (checked) {
|
|
136
|
+
this.selectedValues.add(value);
|
|
137
|
+
} else {
|
|
138
|
+
this.selectedValues.delete(value);
|
|
139
|
+
}
|
|
140
|
+
this.render();
|
|
141
|
+
this.params.filterChangedCallback();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
getGui(): HTMLElement {
|
|
145
|
+
return this.gui;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
isFilterActive(): boolean {
|
|
149
|
+
return this.selectedValues.size > 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
doesFilterPass(params: IDoesFilterPassParams): boolean {
|
|
153
|
+
const field = this.params.colDef.field as string;
|
|
154
|
+
if (!params.data || typeof params.data !== 'object' || !(field in params.data)) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const cellValue = (params.data as Record<string, unknown>)[field];
|
|
159
|
+
if (typeof cellValue !== 'string') {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return this.selectedValues.has(cellValue);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
getModel(): CheckboxMultiFilterModel | null {
|
|
167
|
+
return this.selectedValues.size > 0 ? { values: Array.from(this.selectedValues) } : null;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
setModel(model: CheckboxMultiFilterModel | null): void {
|
|
171
|
+
this.selectedValues = new Set(model?.values || []);
|
|
172
|
+
this.render();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
destroy(): void {
|
|
176
|
+
if (this.reactRoot) {
|
|
177
|
+
this.reactRoot.unmount();
|
|
178
|
+
this.reactRoot = null;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export const createCheckboxMultiFilterParams = (
|
|
184
|
+
labels: Record<string, string> = {},
|
|
185
|
+
labelFormatter?: (value: string) => string,
|
|
186
|
+
): Partial<CheckboxMultiFilterParams> => ({
|
|
187
|
+
labels,
|
|
188
|
+
labelFormatter,
|
|
189
|
+
});
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import '../../styles/GridTheme.scss';
|
|
2
|
+
import '../../styles/index.scss';
|
|
3
|
+
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
+
import '@linzjs/lui/dist/fonts';
|
|
5
|
+
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
7
|
+
import {
|
|
8
|
+
createCheckboxMultiFilterParams,
|
|
9
|
+
GridFilterColumnsMultiSelect,
|
|
10
|
+
} from 'components/gridFilter/GridFilterColumnsMultiSelect';
|
|
11
|
+
import { useMemo, useState } from 'react';
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
ColDefT,
|
|
15
|
+
Grid,
|
|
16
|
+
GridCell,
|
|
17
|
+
GridContextProvider,
|
|
18
|
+
GridFilterButtons,
|
|
19
|
+
GridFilterQuick,
|
|
20
|
+
GridFilters,
|
|
21
|
+
GridProps,
|
|
22
|
+
GridUpdatingContextProvider,
|
|
23
|
+
GridWrapper,
|
|
24
|
+
} from '../..';
|
|
25
|
+
import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
title: 'Components / Grids',
|
|
29
|
+
component: Grid,
|
|
30
|
+
decorators: [
|
|
31
|
+
(Story) => (
|
|
32
|
+
<div style={{ width: 1024, height: 400, display: 'flex' }}>
|
|
33
|
+
<GridUpdatingContextProvider>
|
|
34
|
+
<GridContextProvider>
|
|
35
|
+
<Story />
|
|
36
|
+
</GridContextProvider>
|
|
37
|
+
</GridUpdatingContextProvider>
|
|
38
|
+
</div>
|
|
39
|
+
),
|
|
40
|
+
],
|
|
41
|
+
} as Meta<typeof Grid>;
|
|
42
|
+
|
|
43
|
+
interface ITestRow {
|
|
44
|
+
id: number;
|
|
45
|
+
position: string;
|
|
46
|
+
desc: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const GridFilterColumnsMultiSelectTemplate: StoryFn<typeof Grid<ITestRow>> = (props: GridProps<ITestRow>) => {
|
|
50
|
+
const columnDefs: ColDefT<ITestRow>[] = useMemo(
|
|
51
|
+
() => [
|
|
52
|
+
GridCell({
|
|
53
|
+
field: 'id',
|
|
54
|
+
headerName: 'Id',
|
|
55
|
+
}),
|
|
56
|
+
GridCell({
|
|
57
|
+
field: 'position',
|
|
58
|
+
headerName: 'Position',
|
|
59
|
+
filter: GridFilterColumnsMultiSelect,
|
|
60
|
+
filterParams: createCheckboxMultiFilterParams({
|
|
61
|
+
Developer: 'FE Dev',
|
|
62
|
+
Manager: 'Tech Manager',
|
|
63
|
+
}),
|
|
64
|
+
}),
|
|
65
|
+
GridCell({
|
|
66
|
+
field: 'desc',
|
|
67
|
+
headerName: 'Description',
|
|
68
|
+
flex: 1,
|
|
69
|
+
}),
|
|
70
|
+
],
|
|
71
|
+
[],
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const [rowData] = useState([
|
|
75
|
+
{
|
|
76
|
+
id: 1000,
|
|
77
|
+
position: 'Tester',
|
|
78
|
+
age: 30,
|
|
79
|
+
desc: 'Integration tester - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur a lectus neque. Nunc congue magna ut lorem pretium, vitae congue lorem malesuada. Etiam eget eleifend sapien, sed egestas felis. Aliquam ac augue sapien.',
|
|
80
|
+
},
|
|
81
|
+
{ id: 1001, position: 'Developer', age: 12, desc: 'Frontend developer' },
|
|
82
|
+
{ id: 1002, position: 'Manager', age: 65, desc: 'Technical Manager' },
|
|
83
|
+
{ id: 1003, position: 'Tester', age: 30, desc: 'E2E tester' },
|
|
84
|
+
{ id: 1004, position: 'Developer', age: 12, desc: 'Fullstack Developer' },
|
|
85
|
+
{ id: 1005, position: 'Developer', age: 12, desc: 'Backend Developer' },
|
|
86
|
+
{ id: 1006, position: 'Architect', age: 30, desc: 'Architect' },
|
|
87
|
+
]);
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<GridWrapper>
|
|
91
|
+
<GridFilters>
|
|
92
|
+
<GridFilterQuick quickFilterPlaceholder={'Custom placeholder...'} />
|
|
93
|
+
<GridFilterButtons<ITestRow>
|
|
94
|
+
luiButtonProps={{ style: { whiteSpace: 'nowrap' } }}
|
|
95
|
+
options={[
|
|
96
|
+
{
|
|
97
|
+
label: 'All',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: 'Developers',
|
|
101
|
+
filter: (row) => row.position === 'Developer',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: 'Testers',
|
|
105
|
+
filter: (row) => row.position === 'Tester',
|
|
106
|
+
},
|
|
107
|
+
]}
|
|
108
|
+
/>
|
|
109
|
+
</GridFilters>
|
|
110
|
+
<Grid
|
|
111
|
+
{...props}
|
|
112
|
+
rowSelection={'multiple'}
|
|
113
|
+
columnDefs={columnDefs}
|
|
114
|
+
rowData={rowData}
|
|
115
|
+
sizeColumns={'auto-skip-headers'}
|
|
116
|
+
/>
|
|
117
|
+
</GridWrapper>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const _FilterColumnsMultiSelectExample = GridFilterColumnsMultiSelectTemplate.bind({});
|
|
122
|
+
_FilterColumnsMultiSelectExample.play = waitForGridReady;
|
|
@@ -58,31 +58,30 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
58
58
|
)
|
|
59
59
|
);
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
.ag-theme-step-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
.ag-theme-step-default.theme-specific,
|
|
62
|
+
.ag-theme-step-compact.theme-specific {
|
|
63
|
+
// Don't hide the drag handle
|
|
64
|
+
.ag-drag-handle.ag-row-drag {
|
|
65
|
+
opacity: 1 !important;
|
|
66
|
+
}
|
|
65
67
|
|
|
66
|
-
.ag-header-hide-default-select .ag-labeled {
|
|
67
|
-
|
|
68
|
-
}
|
|
68
|
+
.ag-header-hide-default-select .ag-labeled {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
69
71
|
|
|
70
|
-
.ag-header-
|
|
71
|
-
|
|
72
|
-
}
|
|
72
|
+
div.ag-header-cell.ag-header-select-draggable[col-id='ag-Grid-SelectionColumn'] {
|
|
73
|
+
padding-left: 40px;
|
|
74
|
+
}
|
|
73
75
|
|
|
74
|
-
div.ag-header-cell.ag-header-select-draggable[col-id='ag-Grid-SelectionColumn'] {
|
|
75
|
-
|
|
76
|
-
}
|
|
76
|
+
div.ag-header-cell:not(.ag-header-select-draggable)[col-id='ag-Grid-SelectionColumn'] {
|
|
77
|
+
padding-left: 12px;
|
|
78
|
+
}
|
|
77
79
|
|
|
78
|
-
.ag-
|
|
79
|
-
|
|
80
|
-
margin:
|
|
80
|
+
div.ag-cell-wrapper {
|
|
81
|
+
margin-left: 4px;
|
|
82
|
+
margin-right: 4px;
|
|
81
83
|
}
|
|
82
|
-
}
|
|
83
84
|
|
|
84
|
-
.ag-theme-step-default.theme-specific,
|
|
85
|
-
.ag-theme-step-compact.theme-specific {
|
|
86
85
|
div.ag-center-cols-viewport {
|
|
87
86
|
// when using domLayout={"autoHeight"}, ag grid has a default min-height
|
|
88
87
|
// set to 150px so the !important is necessary here
|
|
@@ -158,6 +157,9 @@ div.ag-header-cell.ag-header-select-draggable[col-id='ag-Grid-SelectionColumn']
|
|
|
158
157
|
}
|
|
159
158
|
}
|
|
160
159
|
|
|
160
|
+
div.ag-cell-wrapper .ag-selection-checkbox {
|
|
161
|
+
margin: 0;
|
|
162
|
+
}
|
|
161
163
|
|
|
162
164
|
.ag-cell {
|
|
163
165
|
display: flex;
|