@linzjs/step-ag-grid 13.0.0 → 13.1.1
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/README.md +36 -1
- package/dist/GridTheme.scss +2 -2
- package/dist/index.css +26 -2
- package/dist/src/components/Grid.d.ts +2 -1
- package/dist/src/components/GridCell.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterColumnsToggle.d.ts +5 -0
- package/dist/src/components/gridFilter/GridFilterHeaderIconButton.d.ts +11 -0
- package/dist/src/components/gridFilter/index.d.ts +3 -0
- package/dist/src/components/{GridFilter.d.ts → gridFilter/useGridFilter.d.ts} +2 -2
- package/dist/src/components/index.d.ts +0 -1
- package/dist/src/contexts/GridContext.d.ts +8 -3
- package/dist/src/contexts/GridContextProvider.d.ts +1 -1
- package/dist/step-ag-grid.esm.js +405 -238
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +20 -14
- package/src/components/GridCell.tsx +1 -1
- package/src/components/gridFilter/GridFilterButtons.tsx +2 -2
- package/src/components/gridFilter/GridFilterColumnsToggle.tsx +141 -0
- package/src/components/gridFilter/GridFilterHeaderIconButton.tsx +33 -0
- package/src/components/gridFilter/GridFilterQuick.tsx +2 -2
- package/src/components/gridFilter/index.ts +3 -0
- package/src/components/{GridFilter.ts → gridFilter/useGridFilter.ts} +2 -2
- package/src/components/index.ts +0 -1
- package/src/contexts/GridContext.tsx +26 -5
- package/src/contexts/GridContextProvider.tsx +94 -29
- package/src/contexts/GridPopoverContextProvider.tsx +4 -3
- package/src/stories/grid/GridReadOnly.stories.tsx +13 -6
- package/src/styles/Grid.scss +18 -2
- package/src/styles/GridFilterColumnsToggle.scss +4 -0
- package/src/styles/GridFilterHeaderIconButton.scss +3 -0
- package/src/styles/GridTheme.scss +2 -2
- package/src/styles/index.scss +3 -0
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
useGridFilter,
|
|
24
24
|
wait,
|
|
25
25
|
} from "../..";
|
|
26
|
+
import { GridFilterColumnsToggle } from "../../components";
|
|
26
27
|
import "../../styles/GridTheme.scss";
|
|
27
28
|
import "../../styles/index.scss";
|
|
28
29
|
|
|
@@ -66,6 +67,7 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
66
67
|
headerName: "Id",
|
|
67
68
|
initialWidth: 65,
|
|
68
69
|
maxWidth: 85,
|
|
70
|
+
lockVisible: true,
|
|
69
71
|
}),
|
|
70
72
|
GridCell({
|
|
71
73
|
field: "position",
|
|
@@ -213,10 +215,7 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
213
215
|
<GridWrapper maxHeight={300}>
|
|
214
216
|
<GridFilters>
|
|
215
217
|
<GridFilterQuick quickFilterPlaceholder={"Custom placeholder..."} />
|
|
216
|
-
<
|
|
217
|
-
Custom filter: Age less than:
|
|
218
|
-
<GridFilterLessThan field={"age"} />
|
|
219
|
-
</div>
|
|
218
|
+
<GridFilterLessThan text="Age <" field={"age"} />
|
|
220
219
|
<GridFilterButtons<ITestRow>
|
|
221
220
|
luiButtonProps={{ style: { whiteSpace: "nowrap" } }}
|
|
222
221
|
options={[
|
|
@@ -229,8 +228,10 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
229
228
|
},
|
|
230
229
|
]}
|
|
231
230
|
/>
|
|
231
|
+
<GridFilterColumnsToggle />
|
|
232
232
|
</GridFilters>
|
|
233
233
|
<Grid
|
|
234
|
+
data-testid={"readonly"}
|
|
234
235
|
{...props}
|
|
235
236
|
selectable={true}
|
|
236
237
|
autoSelectFirstRow={true}
|
|
@@ -243,7 +244,7 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
243
244
|
);
|
|
244
245
|
};
|
|
245
246
|
|
|
246
|
-
const GridFilterLessThan = (props: { field: keyof ITestRow }): JSX.Element => {
|
|
247
|
+
const GridFilterLessThan = (props: { field: keyof ITestRow; text: string }): JSX.Element => {
|
|
247
248
|
const [value, setValue] = useState<number>();
|
|
248
249
|
|
|
249
250
|
const filter = useCallback(
|
|
@@ -261,7 +262,13 @@ const GridFilterLessThan = (props: { field: keyof ITestRow }): JSX.Element => {
|
|
|
261
262
|
}
|
|
262
263
|
};
|
|
263
264
|
|
|
264
|
-
return
|
|
265
|
+
return (
|
|
266
|
+
<div className={"flex-row-center"}>
|
|
267
|
+
<div style={{ whiteSpace: "nowrap" }}>{props.text}</div>
|
|
268
|
+
 
|
|
269
|
+
<input type={"text"} defaultValue={value} onChange={(e) => updateValue(e.target.value)} style={{ width: 64 }} />
|
|
270
|
+
</div>
|
|
271
|
+
);
|
|
265
272
|
};
|
|
266
273
|
|
|
267
274
|
export const ReadOnlySingleSelection = GridReadOnlyTemplate.bind({});
|
package/src/styles/Grid.scss
CHANGED
|
@@ -30,18 +30,21 @@
|
|
|
30
30
|
margin-bottom: 16px;
|
|
31
31
|
flex: 0;
|
|
32
32
|
display: flex;
|
|
33
|
+
align-items: center;
|
|
33
34
|
flex-direction: row;
|
|
34
35
|
grid-column-gap: 1em;
|
|
36
|
+
padding: 0.25rem 0;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
|
|
38
40
|
.Grid-quickFilterBox {
|
|
39
41
|
width: 100%;
|
|
40
|
-
height:
|
|
42
|
+
height: 40px;
|
|
41
43
|
border: 0.06rem solid colors.$silver;
|
|
42
44
|
border-radius: 3px;
|
|
43
45
|
padding-left: 0.75rem;
|
|
44
46
|
padding-right: 0.75rem;
|
|
47
|
+
font-family: "Open Sans", system-ui, sans-serif;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
.Grid-popoverContainer {
|
|
@@ -63,7 +66,7 @@
|
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
.GridCell-readonly {
|
|
66
|
-
color: colors.$
|
|
69
|
+
color: colors.$fuscous;
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
.Grid-container.ag-theme-alpine .ag-cell {
|
|
@@ -81,3 +84,16 @@
|
|
|
81
84
|
.Grid-container.ag-theme-alpine .ag-cell-wrapper {
|
|
82
85
|
width: 100%;
|
|
83
86
|
}
|
|
87
|
+
|
|
88
|
+
.flex-col-center {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
align-items: center;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.flex-row-center {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: row;
|
|
97
|
+
align-items: center;
|
|
98
|
+
}
|
|
99
|
+
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
@include ag-theme-alpine(
|
|
14
14
|
(
|
|
15
15
|
alpine-active-color: lui.$sea,
|
|
16
|
-
foreground-color: lui.$
|
|
17
|
-
data-color: lui.$
|
|
16
|
+
foreground-color: lui.$charcoal,
|
|
17
|
+
data-color: lui.$charcoal,
|
|
18
18
|
// ag-grid-community >=28
|
|
19
19
|
selected-row-background-color: lui.$polar,
|
|
20
20
|
header-foreground-color: lui.$surfie,
|