@linzjs/step-ag-grid 29.7.0 → 29.9.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 +13 -1
- package/dist/index.css +10 -0
- package/dist/src/components/GridCell.d.ts +1 -0
- package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +1 -0
- package/dist/step-ag-grid.cjs +8 -2
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +8 -2
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/GridCell.tsx +9 -0
- package/src/components/gridFilter/GridFilterColumnsMultiSelect.scss +5 -1
- package/src/components/gridFilter/GridFilterColumnsMultiSelect.tsx +1 -0
- package/src/components/gridRender/GridRenderGenericCell.tsx +1 -0
- package/src/stories/grid/GridReadOnly.stories.tsx +1 -0
- package/src/styles/GridIcon.scss +10 -0
- package/src/styles/GridTheme.scss +13 -1
package/package.json
CHANGED
|
@@ -33,10 +33,15 @@ export const GridCellRenderer = (props: ICellRendererParams) => {
|
|
|
33
33
|
const colDef = props.colDef as ColDef;
|
|
34
34
|
|
|
35
35
|
const rendererParams = colDef.cellRendererParams as GenericCellRendererParams<any> | undefined;
|
|
36
|
+
const errorFn = rendererParams?.error;
|
|
37
|
+
let errorText = props.data !== undefined && errorFn ? errorFn(props) : undefined;
|
|
36
38
|
const warningFn = rendererParams?.warning;
|
|
37
39
|
let warningText = props.data !== undefined && warningFn ? warningFn(props) : undefined;
|
|
38
40
|
const infoFn = rendererParams?.info;
|
|
39
41
|
let infoText = props.data !== undefined && infoFn ? infoFn(props) : undefined;
|
|
42
|
+
if (Array.isArray(errorText)) {
|
|
43
|
+
errorText = errorText.join('\n');
|
|
44
|
+
}
|
|
40
45
|
if (Array.isArray(warningText)) {
|
|
41
46
|
warningText = warningText.join('\n');
|
|
42
47
|
}
|
|
@@ -48,6 +53,9 @@ export const GridCellRenderer = (props: ICellRendererParams) => {
|
|
|
48
53
|
<GridLoadableCell />
|
|
49
54
|
) : (
|
|
50
55
|
<>
|
|
56
|
+
{!!errorText && (
|
|
57
|
+
<GridIcon icon={'ic_error_outline'} title={typeof errorText === 'string' ? errorText : 'Error'} />
|
|
58
|
+
)}
|
|
51
59
|
{!!warningText && (
|
|
52
60
|
<GridIcon icon={'ic_warning_outline'} title={typeof warningText === 'string' ? warningText : 'Warning'} />
|
|
53
61
|
)}
|
|
@@ -79,6 +87,7 @@ export interface ColDefT<TData extends GridBaseRow, ValueType = any> extends Col
|
|
|
79
87
|
originalCellRenderer?: any;
|
|
80
88
|
editAction?: (selectedRows: TData[]) => void;
|
|
81
89
|
shortcutKeys?: Record<string, () => void>;
|
|
90
|
+
error?: (props: ICellRendererParams<TData, ValueType>) => ReactElement | string | false | null | undefined;
|
|
82
91
|
warning?: (props: ICellRendererParams<TData, ValueType>) => ReactElement | string | false | null | undefined;
|
|
83
92
|
info?: (props: ICellRendererParams<TData, ValueType>) => ReactElement | string | false | null | undefined;
|
|
84
93
|
};
|
|
@@ -5,13 +5,17 @@
|
|
|
5
5
|
padding: 8px;
|
|
6
6
|
@include lui.font-semibold();
|
|
7
7
|
|
|
8
|
+
.LuiSelect-label-text {
|
|
9
|
+
color: lui.$fuscous;
|
|
10
|
+
display: inline-block;
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
.LuiCheckboxInput-selectAll,
|
|
9
14
|
.LuiCheckboxInput-item {
|
|
10
15
|
color: lui.$charcoal;
|
|
11
16
|
line-height: 20px;
|
|
12
17
|
margin-bottom: 0;
|
|
13
18
|
font-weight: 600;
|
|
14
|
-
font-style: SemiBold;
|
|
15
19
|
font-size: 16px;
|
|
16
20
|
line-height: 24px;
|
|
17
21
|
letter-spacing: 0%;
|
|
@@ -100,6 +100,7 @@ export class GridFilterColumnsMultiSelect implements IFilterComp {
|
|
|
100
100
|
this.labelFormatter = params.labelFormatter;
|
|
101
101
|
|
|
102
102
|
this.allValues = this.loadFieldValues();
|
|
103
|
+
this.selectedValues = new Set(this.allValues);
|
|
103
104
|
|
|
104
105
|
this.gui = document.createElement('div');
|
|
105
106
|
this.reactRoot = createRoot(this.gui);
|
|
@@ -13,6 +13,7 @@ export interface GenericCellRendererParams<TData extends GridBaseRow> {
|
|
|
13
13
|
rightHoverElement?: ReactElement | undefined;
|
|
14
14
|
editAction?: (selectedRows: TData[]) => void;
|
|
15
15
|
shortcutKeys?: Record<string, ((params: SuppressKeyboardEventParams) => boolean | void) | undefined>;
|
|
16
|
+
error?: (props: ICellRendererParams<TData>) => string | string[] | boolean | null | undefined;
|
|
16
17
|
warning?: (props: ICellRendererParams<TData>) => string | string[] | boolean | null | undefined;
|
|
17
18
|
info?: (props: ICellRendererParams<TData>) => string | string[] | boolean | null | undefined;
|
|
18
19
|
}
|
|
@@ -83,6 +83,7 @@ const GridReadOnlyTemplate: StoryFn<typeof Grid<ITestRow>> = (props: GridProps<I
|
|
|
83
83
|
field: 'position',
|
|
84
84
|
headerName: 'Position',
|
|
85
85
|
cellRendererParams: {
|
|
86
|
+
error: ({ value }) => value === 'Manager' && 'Managers need management',
|
|
86
87
|
warning: ({ value }) => value === 'Tester' && 'Testers are testing',
|
|
87
88
|
info: ({ value }) => value === 'Developer' && 'Developers are awesome',
|
|
88
89
|
},
|
package/src/styles/GridIcon.scss
CHANGED
|
@@ -24,6 +24,16 @@
|
|
|
24
24
|
fill: lui.$warning;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
.AgGridGenericCellRenderer-ic_error_Icon {
|
|
28
|
+
margin-right: 4px;
|
|
29
|
+
fill: lui.$error;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.AgGridGenericCellRenderer-ic_error_outlineIcon {
|
|
33
|
+
margin-right: 4px;
|
|
34
|
+
fill: lui.$error;
|
|
35
|
+
}
|
|
36
|
+
|
|
27
37
|
.GridIcon-disabled {
|
|
28
38
|
fill: lui.$silver !important;
|
|
29
39
|
}
|
|
@@ -143,6 +143,18 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
143
143
|
overflow-x: auto;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
.ag-icon-filter {
|
|
147
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232A292C'%3E%3Cpath d='M6 12.984v-1.969h12v1.969zM3 6h18v2.016H3zm6.984 12v-2.016h4.031V18z'/%3E%3C/svg%3E") !important;
|
|
148
|
+
background-repeat: no-repeat;
|
|
149
|
+
background-position: center;
|
|
150
|
+
background-size: contain;
|
|
151
|
+
background-color: transparent;
|
|
152
|
+
|
|
153
|
+
&::before {
|
|
154
|
+
content: none !important;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
146
158
|
.ag-header-group-cell {
|
|
147
159
|
text-transform: uppercase;
|
|
148
160
|
font-size: 12px;
|
|
@@ -265,4 +277,4 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
265
277
|
.ag-header-cell {
|
|
266
278
|
font-size: 14px;
|
|
267
279
|
}
|
|
268
|
-
}
|
|
280
|
+
}
|