igniteui-cli 15.5.1 → 15.6.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/package.json +4 -4
- package/templates/blazor/igb/projects/ai-config/files/skills/AGENTS.md +6 -3
- package/templates/blazor/igb/projects/ai-config/files/skills/README.md +30 -45
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/SKILL.md +48 -96
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/charts.md +61 -238
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/data-display.md +60 -193
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/feedback.md +36 -92
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/form-controls.md +66 -224
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout-manager.md +39 -88
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout.md +75 -152
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/setup.md +40 -149
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/SKILL.md +58 -243
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/component-mapping.md +89 -280
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/gotchas.md +143 -431
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/SKILL.md +91 -157
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/data-operations.md +50 -228
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/editing.md +61 -222
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/features.md +67 -360
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/grid-migration.md +55 -236
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/paging-remote.md +53 -202
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/sizing.md +31 -232
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/state.md +27 -119
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/structure.md +88 -363
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/types.md +87 -415
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-lite-testing/SKILL.md +8 -4
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-lite-testing/references/interop-contracts.md +42 -6
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/SKILL.md +83 -211
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/common-patterns.md +93 -184
- package/templates/react/igr-ts/avatar/default/files/src/app/__path__/__filePrefix__.tsx +3 -3
- package/templates/react/igr-ts/avatar/default/files/src/app/__path__/style.module.css +9 -0
- package/templates/react/igr-ts/button/default/files/src/app/__path__/__filePrefix__.tsx +1 -1
- package/templates/react/igr-ts/button/default/files/src/app/__path__/style.module.css +3 -0
- package/templates/react/igr-ts/icon/default/files/src/app/__path__/__filePrefix__.tsx +2 -2
- package/templates/react/igr-ts/icon/default/files/src/app/__path__/style.module.css +3 -0
- package/templates/react/igr-ts/icon-button/default/files/src/app/__path__/__filePrefix__.tsx +1 -1
- package/templates/react/igr-ts/icon-button/default/files/src/app/__path__/style.module.css +3 -0
- package/templates/react/igr-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.tsx +3 -4
- package/templates/react/igr-ts/projects/_base/files/package.json +1 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/README.md +30 -83
- package/templates/react/igr-ts/projects/ai-config/files/skills/grid-lite-to-igr-grid-migration/SKILL.md +98 -191
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/SKILL.md +38 -147
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENTS.md +65 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/DATAVIZ.md +90 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/MCP.md +43 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/TROUBLESHOOTING.md +17 -145
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/USAGE.md +85 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/SKILL.md +83 -135
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/CSS-THEMING.md +51 -218
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/SKILL.md +58 -187
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/gotchas.md +55 -154
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-optimize-bundle-size/SKILL.md +48 -401
- package/templates/webcomponents/igc-ts/avatar/default/files/src/app/__path__/__filePrefix__.ts +7 -2
- package/templates/webcomponents/igc-ts/button/default/files/src/app/__path__/__filePrefix__.ts +8 -3
- package/templates/webcomponents/igc-ts/card/default/files/src/app/__path__/__filePrefix__.ts +3 -1
- package/templates/webcomponents/igc-ts/constants.d.ts +5 -5
- package/templates/webcomponents/igc-ts/constants.js +5 -5
- package/templates/webcomponents/igc-ts/date-time-input/default/files/src/app/__path__/__filePrefix__.ts +8 -2
- package/templates/webcomponents/igc-ts/icon/default/files/src/app/__path__/__filePrefix__.ts +7 -3
- package/templates/webcomponents/igc-ts/icon-button/default/files/src/app/__path__/__filePrefix__.ts +8 -2
- package/templates/webcomponents/igc-ts/projects/_base/files/package.json +1 -1
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +6 -6
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/README.md +1 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/login-bar/login-bar.ts +1 -1
- package/templates/webcomponents/igc-ts/tabs/default/files/src/app/__path__/__filePrefix__.ts +21 -15
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/mcp-setup.md +0 -78
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/mcp-setup.md +0 -78
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/mcp-setup.md +0 -81
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/CHARTS-GRIDS.md +0 -398
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENT-CATALOGUE.md +0 -161
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/EVENT-HANDLING.md +0 -72
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/INSTALLATION.md +0 -139
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/JSX-PATTERNS.md +0 -187
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/MCP-SERVER.md +0 -77
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/REFS-FORMS.md +0 -232
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/MCP-SERVER.md +0 -67
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/TROUBLESHOOTING.md +0 -35
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/component-mapping.md +0 -132
- /package/templates/webcomponents/igc-ts/tabs/default/files/src/app/__path__/{__filePrefix__.test → __filePrefix__.test.ts} +0 -0
|
@@ -1,43 +1,29 @@
|
|
|
1
1
|
# State Persistence
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
> For grid setup and column configuration — see [`structure.md`](./structure.md).
|
|
3
|
+
`IgbGridState` saves and restores the full grid state — sorting, filtering, advanced filtering, grouping, paging, selection, row expansion, and column order/width/visibility/pinning — as a JSON string. Available on `IgbGrid`, `IgbTreeGrid`, `IgbHierarchicalGrid`, and `IgbPivotGrid`; not on `IgbGridLite`.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
It is a **child component of the grid**, and `PrimaryKey` must be set for selection and row state to round-trip.
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
- [Key Rules](#key-rules)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## State Persistence
|
|
14
|
-
|
|
15
|
-
Save and restore the full grid state (sorting, filtering, grouping, paging, selection, column order, column widths, column visibility, pinning) to survive page reloads, navigation, or user sessions.
|
|
16
|
-
|
|
17
|
-
### Save state
|
|
7
|
+
## Save and restore
|
|
18
8
|
|
|
19
9
|
```razor
|
|
20
10
|
@inject IJSRuntime JS
|
|
21
11
|
|
|
22
12
|
<IgbGrid @ref="grid" Data="data" PrimaryKey="Id" AutoGenerate="false"
|
|
23
|
-
Width="100%" Height="500px">
|
|
24
|
-
<IgbGridState @ref="gridState"
|
|
13
|
+
Width="100%" Height="500px" Rendered="OnGridRendered">
|
|
14
|
+
<IgbGridState @ref="gridState" />
|
|
25
15
|
<IgbColumn Field="Name" Sortable="true" Filterable="true" />
|
|
26
16
|
<IgbColumn Field="Department" Sortable="true" Groupable="true" />
|
|
27
|
-
<IgbColumn Field="Salary" DataType="GridColumnDataType.Currency" HasSummary="true" />
|
|
28
17
|
<IgbPaginator PerPage="10" />
|
|
29
18
|
</IgbGrid>
|
|
30
19
|
|
|
31
|
-
<IgbButton @onclick="SaveState">Save State</IgbButton>
|
|
32
|
-
<IgbButton @onclick="RestoreState">Restore State</IgbButton>
|
|
33
|
-
|
|
34
20
|
@code {
|
|
35
21
|
private IgbGrid grid = default!;
|
|
36
22
|
private IgbGridState gridState = default!;
|
|
37
23
|
|
|
38
24
|
private async Task SaveState()
|
|
39
25
|
{
|
|
40
|
-
|
|
26
|
+
var json = await gridState.GetStateAsStringAsync(Array.Empty<string>());
|
|
41
27
|
await JS.InvokeVoidAsync("localStorage.setItem", "gridState", json);
|
|
42
28
|
}
|
|
43
29
|
|
|
@@ -45,129 +31,51 @@ Save and restore the full grid state (sorting, filtering, grouping, paging, sele
|
|
|
45
31
|
{
|
|
46
32
|
var json = await JS.InvokeAsync<string>("localStorage.getItem", "gridState");
|
|
47
33
|
if (!string.IsNullOrEmpty(json))
|
|
48
|
-
|
|
49
|
-
await gridState.ApplyStateFromStringAsync(json, new string[0]);
|
|
50
|
-
}
|
|
34
|
+
await gridState.ApplyStateFromStringAsync(json, Array.Empty<string>());
|
|
51
35
|
}
|
|
36
|
+
|
|
37
|
+
private async Task OnGridRendered() => await RestoreState();
|
|
52
38
|
}
|
|
53
39
|
```
|
|
54
40
|
|
|
55
|
-
|
|
41
|
+
**Restore only after the grid has rendered** — the `Rendered` event is the right hook; `ApplyStateFromStringAsync` from `OnInitialized` will not work.
|
|
56
42
|
|
|
57
|
-
|
|
58
|
-
|---|---|
|
|
59
|
-
| Columns | Order, width, visibility, pinned, data type |
|
|
60
|
-
| Sorting | Active sort expressions and directions |
|
|
61
|
-
| Filtering | Active filter expressions |
|
|
62
|
-
| Grouping | Active group-by expressions (IgbGrid only) |
|
|
63
|
-
| Paging | Current page, page size |
|
|
64
|
-
| Selection | Selected rows, selected cells, selected columns |
|
|
65
|
-
| Advanced Filtering | Advanced filtering expressions tree |
|
|
66
|
-
| Row expansion | Expanded row IDs (Tree Grid, Hierarchical Grid) |
|
|
67
|
-
| Column moving | Column positions after user reordering |
|
|
43
|
+
The same JSON goes to a server just as easily — swap `localStorage` for an API call in `SaveState` / `RestoreState`.
|
|
68
44
|
|
|
69
|
-
|
|
45
|
+
## Selective state
|
|
70
46
|
|
|
71
|
-
|
|
72
|
-
@implements IDisposable
|
|
73
|
-
|
|
74
|
-
<IgbGrid @ref="grid" Data="data" PrimaryKey="Id" Rendered="OnGridRendered">
|
|
75
|
-
<IgbGridState @ref="gridState"></IgbGridState>
|
|
76
|
-
...
|
|
77
|
-
</IgbGrid>
|
|
78
|
-
|
|
79
|
-
@code {
|
|
80
|
-
private IgbGrid grid = default!;
|
|
81
|
-
private IgbGridState gridState = default!;
|
|
82
|
-
|
|
83
|
-
void OnGridRendered()
|
|
84
|
-
{
|
|
85
|
-
RestoreGridState();
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
void IDisposable.Dispose()
|
|
89
|
-
{
|
|
90
|
-
SaveGridState();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
async void SaveGridState()
|
|
94
|
-
{
|
|
95
|
-
string state = await gridState.GetStateAsStringAsync(new string[0]);
|
|
96
|
-
await JS.InvokeVoidAsync("localStorage.setItem", "gridState", state);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
async void RestoreGridState()
|
|
100
|
-
{
|
|
101
|
-
string state = await JS.InvokeAsync<string>("localStorage.getItem", "gridState");
|
|
102
|
-
if (!string.IsNullOrEmpty(state))
|
|
103
|
-
{
|
|
104
|
-
await gridState.ApplyStateFromStringAsync(state, new string[0]);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Selective state save/restore
|
|
111
|
-
|
|
112
|
-
Save only specific parts of the state by passing feature name strings:
|
|
47
|
+
Both methods take an array of feature names. Empty means every feature:
|
|
113
48
|
|
|
114
49
|
```razor
|
|
115
50
|
@code {
|
|
116
|
-
private
|
|
117
|
-
|
|
118
|
-
private async Task SaveSortingOnly()
|
|
119
|
-
{
|
|
120
|
-
string state = await gridState.GetStateAsStringAsync(new string[] { "sorting" });
|
|
121
|
-
await JS.InvokeVoidAsync("localStorage.setItem", "gridSorting", state);
|
|
122
|
-
}
|
|
51
|
+
private Task<string> SaveSortingOnly()
|
|
52
|
+
=> gridState.GetStateAsStringAsync(new[] { "sorting", "filtering" });
|
|
123
53
|
}
|
|
124
54
|
```
|
|
125
55
|
|
|
126
|
-
To
|
|
56
|
+
To exclude features from tracking altogether, set `Options`:
|
|
127
57
|
|
|
128
58
|
```razor
|
|
59
|
+
<IgbGridState @ref="gridState" Options="@stateOptions" />
|
|
60
|
+
|
|
129
61
|
@code {
|
|
130
62
|
private IgbGridState gridState = default!;
|
|
131
|
-
|
|
132
|
-
protected override void OnInitialized()
|
|
63
|
+
private readonly IgbGridStateOptions stateOptions = new()
|
|
133
64
|
{
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
Sorting = false
|
|
138
|
-
};
|
|
139
|
-
}
|
|
65
|
+
CellSelection = false,
|
|
66
|
+
Sorting = false
|
|
67
|
+
};
|
|
140
68
|
}
|
|
141
69
|
```
|
|
142
70
|
|
|
143
|
-
|
|
71
|
+
## Auto-save on navigation
|
|
144
72
|
|
|
145
73
|
```razor
|
|
146
|
-
@
|
|
147
|
-
private IgbGridState gridState = default!;
|
|
148
|
-
|
|
149
|
-
private async Task SaveToServer()
|
|
150
|
-
{
|
|
151
|
-
string json = await gridState.GetStateAsStringAsync(new string[0]);
|
|
152
|
-
await UserPreferencesApi.SaveGridStateAsync(userId, "employeesGrid", json);
|
|
153
|
-
}
|
|
74
|
+
@implements IDisposable
|
|
154
75
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
var json = await UserPreferencesApi.GetGridStateAsync(userId, "employeesGrid");
|
|
158
|
-
if (!string.IsNullOrEmpty(json))
|
|
159
|
-
{
|
|
160
|
-
await gridState.ApplyStateFromStringAsync(json, new string[0]);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
76
|
+
@code {
|
|
77
|
+
void IDisposable.Dispose() => _ = SaveState();
|
|
163
78
|
}
|
|
164
79
|
```
|
|
165
80
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
## Key Rules
|
|
169
|
-
|
|
170
|
-
1. **`PrimaryKey` must be set on the grid** for state persistence to work reliably (especially for selection and row pinning).
|
|
171
|
-
2. **`IgbGridState` is a child component of the grid** - add `<IgbGridState @ref="gridState">` inside the grid markup and use its methods.
|
|
172
|
-
3. **Use `GetStateAsStringAsync` / `ApplyStateFromStringAsync`** - these accept/return JSON strings directly. Pass `new string[0]` for all features, or specific feature names like `new string[] { "sorting", "filtering" }`.
|
|
173
|
-
4. **Restore state in the grid's `Rendered` event** - the grid must be fully rendered before you can call `ApplyStateFromStringAsync`.
|
|
81
|
+
Combine with `Rendered` for restore, as above, so state survives navigation away and back.
|