@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.
Files changed (33) hide show
  1. package/README.md +36 -1
  2. package/dist/GridTheme.scss +2 -2
  3. package/dist/index.css +26 -2
  4. package/dist/src/components/Grid.d.ts +2 -1
  5. package/dist/src/components/GridCell.d.ts +1 -1
  6. package/dist/src/components/gridFilter/GridFilterColumnsToggle.d.ts +5 -0
  7. package/dist/src/components/gridFilter/GridFilterHeaderIconButton.d.ts +11 -0
  8. package/dist/src/components/gridFilter/index.d.ts +3 -0
  9. package/dist/src/components/{GridFilter.d.ts → gridFilter/useGridFilter.d.ts} +2 -2
  10. package/dist/src/components/index.d.ts +0 -1
  11. package/dist/src/contexts/GridContext.d.ts +8 -3
  12. package/dist/src/contexts/GridContextProvider.d.ts +1 -1
  13. package/dist/step-ag-grid.esm.js +405 -238
  14. package/dist/step-ag-grid.esm.js.map +1 -1
  15. package/package.json +1 -1
  16. package/src/components/Grid.tsx +20 -14
  17. package/src/components/GridCell.tsx +1 -1
  18. package/src/components/gridFilter/GridFilterButtons.tsx +2 -2
  19. package/src/components/gridFilter/GridFilterColumnsToggle.tsx +141 -0
  20. package/src/components/gridFilter/GridFilterHeaderIconButton.tsx +33 -0
  21. package/src/components/gridFilter/GridFilterQuick.tsx +2 -2
  22. package/src/components/gridFilter/index.ts +3 -0
  23. package/src/components/{GridFilter.ts → gridFilter/useGridFilter.ts} +2 -2
  24. package/src/components/index.ts +0 -1
  25. package/src/contexts/GridContext.tsx +26 -5
  26. package/src/contexts/GridContextProvider.tsx +94 -29
  27. package/src/contexts/GridPopoverContextProvider.tsx +4 -3
  28. package/src/stories/grid/GridReadOnly.stories.tsx +13 -6
  29. package/src/styles/Grid.scss +18 -2
  30. package/src/styles/GridFilterColumnsToggle.scss +4 -0
  31. package/src/styles/GridFilterHeaderIconButton.scss +3 -0
  32. package/src/styles/GridTheme.scss +2 -2
  33. 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
- <div>
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 <input type={"text"} defaultValue={value} onChange={(e) => updateValue(e.target.value)} />;
265
+ return (
266
+ <div className={"flex-row-center"}>
267
+ <div style={{ whiteSpace: "nowrap" }}>{props.text}</div>
268
+ &#160;
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({});
@@ -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: 48px;
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.$gray;
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
+
@@ -0,0 +1,4 @@
1
+ .GridFilterColumnsToggle-container {
2
+ max-height: 280px;
3
+ overflow: auto;
4
+ }
@@ -0,0 +1,3 @@
1
+ .MenuItem-icon {
2
+ margin-right: 8px;
3
+ }
@@ -13,8 +13,8 @@
13
13
  @include ag-theme-alpine(
14
14
  (
15
15
  alpine-active-color: lui.$sea,
16
- foreground-color: lui.$grey-80,
17
- data-color: lui.$grey-80,
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,
@@ -8,3 +8,6 @@
8
8
  @use "./GridIcon";
9
9
  @use "./GridLoadableCell";
10
10
  @use "./GridPopoverMenu";
11
+ @use "./GridFilterColumnsToggle";
12
+ @use "./GridFilterHeaderIconButton";
13
+