igniteui-cli 15.3.0 → 15.4.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/lib/PromptSession.d.ts +1 -1
- package/lib/PromptSession.js +2 -3
- package/lib/commands/new.js +49 -1
- package/lib/commands/types.d.ts +4 -0
- package/lib/templates/IgniteUIForWebComponentsTemplate.js +3 -2
- package/package.json +7 -7
- package/templates/blazor/igb/index.js +1 -1
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/grid-migration.md +322 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/sizing.md +11 -9
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/structure.md +2 -1
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/types.md +2 -2
- package/templates/blazor/igb/projects/empty/index.d.ts +24 -0
- package/templates/blazor/igb/projects/empty/index.js +67 -0
- package/templates/blazor/index.js +1 -1
- package/templates/react/igr-ts/grid/basic/files/src/app/__path__/__filePrefix__.tsx +49 -40
- package/templates/react/igr-ts/grid/basic/files/src/app/__path__/style.module.css +17 -7
- package/templates/react/igr-ts/grid/basic/index.js +31 -0
- package/templates/react/igr-ts/hierarchical-grid/basic/files/src/app/__path__/__filePrefix__.test.tsx +13 -0
- package/templates/react/igr-ts/hierarchical-grid/basic/files/src/app/__path__/__filePrefix__.tsx +43 -0
- package/templates/react/igr-ts/hierarchical-grid/basic/files/src/app/__path__/style.module.css +27 -0
- package/templates/react/igr-ts/hierarchical-grid/basic/index.d.ts +1 -0
- package/templates/react/igr-ts/hierarchical-grid/basic/index.js +50 -0
- package/templates/react/igr-ts/hierarchical-grid/index.d.ts +1 -0
- package/templates/react/igr-ts/hierarchical-grid/index.js +12 -0
- package/templates/react/igr-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.test.tsx +13 -0
- package/templates/react/igr-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.tsx +54 -0
- package/templates/react/igr-ts/pivot-grid/basic/files/src/app/__path__/style.module.css +27 -0
- package/templates/react/igr-ts/pivot-grid/basic/index.d.ts +1 -0
- package/templates/react/igr-ts/pivot-grid/basic/index.js +50 -0
- package/templates/react/igr-ts/pivot-grid/index.d.ts +1 -0
- package/templates/react/igr-ts/pivot-grid/index.js +12 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/grid-lite-to-igr-grid-migration/SKILL.md +274 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/SKILL.md +1 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/CHARTS-GRIDS.md +9 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/gotchas.md +6 -2
- package/templates/react/igr-ts/projects/side-nav/files/src/app/app.tsx +5 -3
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/app.tsx +5 -3
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/app.tsx +4 -3
- package/templates/react/igr-ts/projects/side-nav-mini-auth/files/src/app/app.tsx +4 -3
- package/templates/react/igr-ts/tree-grid/basic/files/src/app/__path__/__filePrefix__.test.tsx +13 -0
- package/templates/react/igr-ts/tree-grid/basic/files/src/app/__path__/__filePrefix__.tsx +30 -0
- package/templates/react/igr-ts/tree-grid/basic/files/src/app/__path__/style.module.css +27 -0
- package/templates/react/igr-ts/tree-grid/basic/index.d.ts +1 -0
- package/templates/react/igr-ts/tree-grid/basic/index.js +50 -0
- package/templates/react/igr-ts/tree-grid/index.d.ts +1 -0
- package/templates/react/igr-ts/tree-grid/index.js +12 -0
- package/templates/webcomponents/igc-ts/grid/default/files/src/app/__path__/__filePrefix__.ts +65 -52
- package/templates/webcomponents/igc-ts/grid/default/index.js +31 -0
- package/templates/webcomponents/igc-ts/hierarchical-grid/basic/files/src/app/__path__/__filePrefix__.test.ts +9 -0
- package/templates/webcomponents/igc-ts/hierarchical-grid/basic/files/src/app/__path__/__filePrefix__.ts +100 -0
- package/templates/webcomponents/igc-ts/hierarchical-grid/basic/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/hierarchical-grid/basic/index.js +48 -0
- package/templates/webcomponents/igc-ts/hierarchical-grid/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/hierarchical-grid/index.js +12 -0
- package/templates/webcomponents/igc-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.test.ts +9 -0
- package/templates/webcomponents/igc-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.ts +113 -0
- package/templates/webcomponents/igc-ts/pivot-grid/basic/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/pivot-grid/basic/index.js +48 -0
- package/templates/webcomponents/igc-ts/pivot-grid/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/pivot-grid/index.js +12 -0
- package/templates/webcomponents/igc-ts/projects/_base/files/index.html +1 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/index.html +1 -0
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +15 -1
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +446 -0
- package/templates/webcomponents/igc-ts/projects/side-nav/files/src/app/app.ts +10 -3
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/index.html +1 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/app.ts +9 -3
- package/templates/webcomponents/igc-ts/projects/side-nav-mini/files/src/app/app.ts +10 -3
- package/templates/webcomponents/igc-ts/projects/side-nav-mini-auth/files/src/app/app.ts +10 -3
- package/templates/webcomponents/igc-ts/tree-grid/basic/files/src/app/__path__/__filePrefix__.test.ts +9 -0
- package/templates/webcomponents/igc-ts/tree-grid/basic/files/src/app/__path__/__filePrefix__.ts +87 -0
- package/templates/webcomponents/igc-ts/tree-grid/basic/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/tree-grid/basic/index.js +48 -0
- package/templates/webcomponents/igc-ts/tree-grid/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/tree-grid/index.js +12 -0
- package/templates/react/igr-ts/grid/basic/files/src/app/__path__/data.tsx +0 -46
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grid-lite-to-igr-grid-migration
|
|
3
|
+
description: Step-by-step migration guide from Grid Lite (IgrGridLite) to the premium Ignite UI for React Data Grid (IgrGrid), covering every import, registration, component name, property, event, template, sorting, filtering, and toolbar API change.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Ignite UI for React — Grid Lite → Premium Data Grid Migration
|
|
8
|
+
|
|
9
|
+
## MANDATORY AGENT PROTOCOL
|
|
10
|
+
|
|
11
|
+
> **DO NOT write any code from memory.** Grid APIs change between versions.
|
|
12
|
+
|
|
13
|
+
Before producing migration code:
|
|
14
|
+
|
|
15
|
+
1. **Read the user's existing component files** to understand current Grid Lite usage (columns, templates, data binding, `dataPipelineConfiguration`).
|
|
16
|
+
2. **Use the MCP server** — call `get_doc` or `search_docs` with `framework: "react"` to confirm API details when in doubt.
|
|
17
|
+
3. **Only then produce output** — base all code on verified references, not memory.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## When to Migrate from Grid Lite to Premium Grid
|
|
22
|
+
|
|
23
|
+
Migrate when you need any of the following features (not available in Grid Lite):
|
|
24
|
+
|
|
25
|
+
| Feature | Grid Lite | Premium Grid (`IgrGrid`) |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| Cell editing | ✗ | ✓ `editable`, `rowEditable` |
|
|
28
|
+
| Batch editing (with undo) | ✗ | ✓ Transaction service |
|
|
29
|
+
| Row adding / deleting | ✗ | ✓ `rowEditable` + `IgrActionStrip` |
|
|
30
|
+
| Row selection | ✗ | ✓ `rowSelection="single|multiple"` |
|
|
31
|
+
| Cell selection | ✗ | ✓ `cellSelection` |
|
|
32
|
+
| Column selection | ✗ | ✓ `columnSelection` |
|
|
33
|
+
| Paging | ✗ | ✓ `IgrPaginator` child |
|
|
34
|
+
| GroupBy | ✗ | ✓ `groupingExpressions` |
|
|
35
|
+
| Column summaries | ✗ | ✓ `hasSummary` on `IgrColumn` |
|
|
36
|
+
| Column pinning | ✗ | ✓ `pinned` on `IgrColumn` |
|
|
37
|
+
| Column moving | ✗ | ✓ `moving={true}` on grid |
|
|
38
|
+
| Master-detail rows | ✗ | ✓ `IgrGrid` row expansion |
|
|
39
|
+
| Excel / CSV export (toolbar) | ✗ | ✓ `IgrGridToolbarExporter` |
|
|
40
|
+
| Column hiding toolbar | ✗ | ✓ `IgrGridToolbarHiding` |
|
|
41
|
+
| Column pinning toolbar | ✗ | ✓ `IgrGridToolbarPinning` |
|
|
42
|
+
| Advanced filtering UI | ✗ | ✓ `filterMode="excelStyleFilter"` / `IgrGridToolbarAdvancedFiltering` |
|
|
43
|
+
| State persistence | ✗ | ✓ `IgrGridState` directive |
|
|
44
|
+
| Clipboard operations | ✗ | ✓ `clipboardOptions` |
|
|
45
|
+
| Action strip | ✗ | ✓ `IgrActionStrip` |
|
|
46
|
+
| Row drag and drop | ✗ | ✓ `rowDraggable={true}` |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Setup
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install --save igniteui-react-grids
|
|
54
|
+
# licensed: npm install --save @infragistics/igniteui-react-grids
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { IgrGridModule, IgrGrid, IgrColumn, IgrPaginator,
|
|
59
|
+
IgrCellTemplateContext, IgrColumnTemplateContext } from "igniteui-react-grids";
|
|
60
|
+
import "igniteui-react-grids/grids/themes/light/bootstrap.css";
|
|
61
|
+
|
|
62
|
+
// Required once before render — Grid Lite has no equivalent
|
|
63
|
+
IgrGridModule.register();
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
> Use `@infragistics/igniteui-react-grids` and the matching CSS path for the licensed package.
|
|
67
|
+
> Check `package.json` — `igniteui-grid-lite` may be a standalone dependency alongside `igniteui-react`.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Minimal Migration Example
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { useRef, useState } from "react";
|
|
75
|
+
import { IgrGrid, IgrColumn, IgrGridModule } from "igniteui-react-grids";
|
|
76
|
+
import "igniteui-react-grids/grids/themes/light/bootstrap.css";
|
|
77
|
+
IgrGridModule.register();
|
|
78
|
+
|
|
79
|
+
export default function MyView() {
|
|
80
|
+
const gridRef = useRef<IgrGrid>(null);
|
|
81
|
+
const [data] = useState<Product[]>([]);
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<IgrGrid ref={gridRef} data={data} primaryKey="id" autoGenerate={false}
|
|
85
|
+
height="600px" allowFiltering={true}>
|
|
86
|
+
<IgrColumn field="name" header="Name" sortable={true} filterable={true} resizable={true} />
|
|
87
|
+
<IgrColumn field="price" header="Price" dataType="number" sortable={true} />
|
|
88
|
+
</IgrGrid>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Key additions vs Grid Lite:**
|
|
94
|
+
- `primaryKey` — required for editing, selection, row-targeted APIs
|
|
95
|
+
- `height` — required for row virtualization
|
|
96
|
+
- `allowFiltering={true}` on the grid — required for filter UI; `filterable={true}` on the column opts that column in
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Cell Templates
|
|
101
|
+
|
|
102
|
+
Prop renamed: `cellTemplate` → `bodyTemplate`. Context type changes.
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
import { IgrCellTemplateContext } from "igniteui-react-grids";
|
|
106
|
+
|
|
107
|
+
const statusCell = (ctx: IgrCellTemplateContext) => (
|
|
108
|
+
<span style={{ color: ctx.cell.value === "Active" ? "green" : "red" }}>
|
|
109
|
+
{ctx.cell.value}
|
|
110
|
+
</span>
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
<IgrColumn field="status" bodyTemplate={statusCell} />
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
| | Grid Lite | Premium Grid |
|
|
117
|
+
|---|---|---|
|
|
118
|
+
| Prop | `cellTemplate` | `bodyTemplate` |
|
|
119
|
+
| Value | `ctx.value` | `ctx.cell.value` or `ctx.implicit` |
|
|
120
|
+
| Row data | `ctx.row.data` | `ctx.cell.row.data` |
|
|
121
|
+
| Edit template | — | `inlineEditorTemplate` |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Header Templates
|
|
126
|
+
|
|
127
|
+
Prop name unchanged (`headerTemplate`); context type changes to `IgrColumnTemplateContext` from `igniteui-react-grids`.
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
import { IgrColumnTemplateContext } from "igniteui-react-grids";
|
|
131
|
+
|
|
132
|
+
const priceHeader = (ctx: IgrColumnTemplateContext) => (
|
|
133
|
+
<strong>{ctx.column.header}</strong>
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
<IgrColumn field="price" headerTemplate={priceHeader} />
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Remote Data (replaces `dataPipelineConfiguration`)
|
|
142
|
+
|
|
143
|
+
For server-side operations, disable local sort/filter processing first by assigning noop strategies, then listen to the done events to issue new requests.
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import { IgrGrid, IgrGridModule,
|
|
147
|
+
IgrNoopSortingStrategy, IgrNoopFilteringStrategy } from "igniteui-react-grids";
|
|
148
|
+
|
|
149
|
+
// Disable built-in sort/filter so the grid does not process data locally.
|
|
150
|
+
// Set these once after the grid mounts (e.g., in a useEffect or ref callback).
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
if (!gridRef.current) return;
|
|
153
|
+
gridRef.current.sortStrategy = IgrNoopSortingStrategy.instance();
|
|
154
|
+
gridRef.current.filterStrategy = IgrNoopFilteringStrategy.instance();
|
|
155
|
+
}, []);
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
```tsx
|
|
159
|
+
const handleSortingDone = async () => {
|
|
160
|
+
if (!gridRef.current) return;
|
|
161
|
+
setData(await dataService.sort(gridRef.current.sortingExpressions));
|
|
162
|
+
};
|
|
163
|
+
const handleFilteringDone = async () => {
|
|
164
|
+
if (!gridRef.current) return;
|
|
165
|
+
setData(await dataService.filter(gridRef.current.filteringExpressionsTree));
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
<IgrGrid ref={gridRef} data={data} primaryKey="id" height="600px"
|
|
169
|
+
onSortingDone={handleSortingDone} onFilteringDone={handleFilteringDone}>
|
|
170
|
+
{/* columns */}
|
|
171
|
+
</IgrGrid>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Programmatic Sort / Filter
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
import { SortingDirection, IgrNumberFilteringOperand } from "igniteui-react-grids";
|
|
180
|
+
|
|
181
|
+
// fieldName + SortingDirection enum (not key + string)
|
|
182
|
+
gridRef.current.sort([{ fieldName: 'name', dir: SortingDirection.Asc, ignoreCase: true }]);
|
|
183
|
+
gridRef.current.clearSort('name'); // or clearSort() for all
|
|
184
|
+
|
|
185
|
+
// Positional args with operand
|
|
186
|
+
// Note: verify IgrNumberFilteringOperand.instance() is available in your version
|
|
187
|
+
gridRef.current.filter('age', 21, IgrNumberFilteringOperand.instance().condition('greaterThan'));
|
|
188
|
+
gridRef.current.clearFilter('age'); // or clearFilter() for all
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Common Enterprise Features
|
|
194
|
+
|
|
195
|
+
### Editing
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
<IgrGrid data={data} primaryKey="id" rowEditable={true} onRowEditDone={handleRowEditDone} height="600px">
|
|
199
|
+
<IgrColumn field="name" editable={true} />
|
|
200
|
+
</IgrGrid>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Row Selection
|
|
204
|
+
|
|
205
|
+
```tsx
|
|
206
|
+
<IgrGrid data={data} primaryKey="id" rowSelection="multiple" height="600px">
|
|
207
|
+
{/* columns */}
|
|
208
|
+
</IgrGrid>
|
|
209
|
+
// Read: gridRef.current.selectedRows
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Paging
|
|
213
|
+
|
|
214
|
+
```tsx
|
|
215
|
+
<IgrGrid data={data} primaryKey="id" height="600px">
|
|
216
|
+
<IgrPaginator perPage={15} />
|
|
217
|
+
</IgrGrid>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Summaries
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
<IgrColumn field="price" dataType="number" hasSummary={true} />
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Toolbar + Export
|
|
227
|
+
|
|
228
|
+
> **Note:** `IgrExcelExporterService` / `IgrExcelExporterOptions` (programmatic export) must be imported from `"igniteui-react"`, **not** `"igniteui-react-grids"`. The toolbar approach below does not need them.
|
|
229
|
+
|
|
230
|
+
```tsx
|
|
231
|
+
import { IgrGrid, IgrColumn, IgrGridToolbar, IgrGridToolbarTitle,
|
|
232
|
+
IgrGridToolbarActions, IgrGridToolbarHiding, IgrGridToolbarPinning,
|
|
233
|
+
IgrGridToolbarExporter, IgrGridToolbarAdvancedFiltering,
|
|
234
|
+
IgrGridToolbarExportEventArgs, IgrGridModule } from "igniteui-react-grids";
|
|
235
|
+
IgrGridModule.register();
|
|
236
|
+
|
|
237
|
+
<IgrGrid data={data} primaryKey="id" height="600px" onToolbarExporting={handleExporting}>
|
|
238
|
+
<IgrGridToolbar>
|
|
239
|
+
<IgrGridToolbarTitle>Products</IgrGridToolbarTitle>
|
|
240
|
+
<IgrGridToolbarActions>
|
|
241
|
+
<IgrGridToolbarHiding />
|
|
242
|
+
<IgrGridToolbarPinning />
|
|
243
|
+
<IgrGridToolbarAdvancedFiltering />
|
|
244
|
+
<IgrGridToolbarExporter exportExcel={true} exportCSV={true} />
|
|
245
|
+
</IgrGridToolbarActions>
|
|
246
|
+
</IgrGridToolbar>
|
|
247
|
+
{/* columns */}
|
|
248
|
+
</IgrGrid>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
```tsx
|
|
252
|
+
const handleExporting = (e: IgrGridToolbarExportEventArgs) => {
|
|
253
|
+
e.detail.options.fileName = "MyExport";
|
|
254
|
+
// set e.detail.cancel = true to abort
|
|
255
|
+
};
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Cleanup After Migration
|
|
261
|
+
|
|
262
|
+
1. Remove all `dataPipelineConfiguration` usage — replace with events (see Remote Data).
|
|
263
|
+
2. Remove `IgrCellContext` / `IgrHeaderContext` imports from `igniteui-react/grid-lite`.
|
|
264
|
+
3. Uninstall `igniteui-grid-lite` if no Grid Lite instances remain: `npm uninstall igniteui-grid-lite`.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Related Skills
|
|
269
|
+
|
|
270
|
+
- [igniteui-react-components](../igniteui-react-components/SKILL.md) — Identify the right `Igr*` components, install, import, and use them; covers JSX patterns, events, refs, and forms. Use this after migrating to explore the full premium grid feature set.
|
|
271
|
+
- [igniteui-react-customize-theme](../igniteui-react-customize-theme/SKILL.md) — Customize `IgrGrid` styling using CSS custom properties and the Ignite UI theming system.
|
|
272
|
+
- [igniteui-react-optimize-bundle-size](../igniteui-react-optimize-bundle-size/SKILL.md) — Reduce bundle size after migrating to `igniteui-react-grids` with granular imports, tree-shaking, and lazy loading.
|
|
273
|
+
- [igniteui-react-generate-from-image-design](../igniteui-react-generate-from-image-design/SKILL.md) — Build a full React view from a screenshot or mockup using Ignite UI components and MCP-driven theming.
|
|
274
|
+
|
package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/SKILL.md
CHANGED
|
@@ -178,3 +178,4 @@ Use [COMPONENT-CATALOGUE.md](./reference/COMPONENT-CATALOGUE.md) to map any UI n
|
|
|
178
178
|
6. **Handle events as `CustomEvent`** — not `React.SyntheticEvent`
|
|
179
179
|
7. **Use refs sparingly** — prefer declarative props
|
|
180
180
|
8. **Check slot names** in the docs
|
|
181
|
+
9. **Never add `width` to grid columns by default** — `IgrGridLiteColumn` defaults to `minmax(136px, 1fr)` (responsive) and `IgrColumn` auto-sizes. Adding explicit pixel widths leaves empty space and breaks responsiveness. Only set `width` when the user explicitly requests it. If some columns have explicit widths, leave at least one column without a `width` to fill remaining space.
|
|
@@ -383,6 +383,15 @@ export default function OrderList() {
|
|
|
383
383
|
}
|
|
384
384
|
```
|
|
385
385
|
|
|
386
|
+
## Column Width Rule (Grid Lite and Advanced Grids)
|
|
387
|
+
|
|
388
|
+
> **⚠️ Do NOT set `width` on columns unless the user explicitly asks for specific column widths.**
|
|
389
|
+
>
|
|
390
|
+
> - `IgrGridLiteColumn` defaults to `minmax(136px, 1fr)` — columns are already responsive and fill all available space.
|
|
391
|
+
> - `IgrColumn` (in `IgrGrid`, `IgrTreeGrid`, `IgrHierarchicalGrid`) also auto-sizes by default.
|
|
392
|
+
> - Adding explicit pixel widths causes a fixed layout that leaves empty space on the right side of the grid.
|
|
393
|
+
> - If widths are set on some columns, leave at least one column without a `width` so it expands to fill the remaining space.
|
|
394
|
+
|
|
386
395
|
> **Column configuration notes:**
|
|
387
396
|
> - `dataType` accepts `"string"` (default), `"number"`, `"boolean"` — set it explicitly so sorting and filtering work correctly for each column type.
|
|
388
397
|
> - `cellTemplate` receives an `IgrCellContext<T>` where `ctx.value` is the cell value and `ctx.row.data` is the full row object.
|
|
@@ -99,6 +99,10 @@ In a flexible CSS Grid track, set `min-height: 0` on the grid cell and make the
|
|
|
99
99
|
### `roundShape` does NOT exist on `IgrAvatar`
|
|
100
100
|
Use the supported `shape` input alone. Do not add `roundShape`.
|
|
101
101
|
|
|
102
|
+
### Omit column `width` — both grid types are fluid by default
|
|
103
|
+
|
|
104
|
+
Do not add `width` to `IgrGridLiteColumn` or `IgrColumn` — columns are responsive by default. Fixed pixel widths leave empty space on the right side of the grid. Only set `width` if the user explicitly asks for it. If some columns need explicit widths, leave at least one column without a `width` to fill the remaining space.
|
|
105
|
+
|
|
102
106
|
### Tabs used for navigation should be label-only
|
|
103
107
|
When a screenshot shows tabs that drive routed page content, use label-only `IgrTab` items and keep the routed content outside the `IgrTabs` component. Do not place inline tab panel content inside router-driven tabs.
|
|
104
108
|
|
|
@@ -139,8 +143,8 @@ For core UI component theming, prefer `create_component_theme` and apply the ret
|
|
|
139
143
|
Override the drawer width using the nav drawer CSS custom properties measured from the design image:
|
|
140
144
|
```css
|
|
141
145
|
igc-nav-drawer {
|
|
142
|
-
--
|
|
143
|
-
--
|
|
146
|
+
--menu-full-width: <extracted-sidebar-width>;
|
|
147
|
+
--menu-mini-width: <extracted-mini-drawer-width>;
|
|
144
148
|
}
|
|
145
149
|
```
|
|
146
150
|
|
|
@@ -50,8 +50,10 @@ export default function App() {
|
|
|
50
50
|
return () => mediaQuery.removeEventListener("change", updateDrawerState);
|
|
51
51
|
}, []);
|
|
52
52
|
|
|
53
|
+
const toAbsPath = (p: string) => p.startsWith('/') ? p : `/${p}`;
|
|
54
|
+
|
|
53
55
|
const handleRouteClick = (path: string) => {
|
|
54
|
-
navigate(path);
|
|
56
|
+
navigate(toAbsPath(path));
|
|
55
57
|
|
|
56
58
|
if (window.matchMedia("(max-width: 1024px)").matches) {
|
|
57
59
|
setDrawerOpen(false);
|
|
@@ -80,7 +82,7 @@ export default function App() {
|
|
|
80
82
|
{visibleRoutes.map((route) => (
|
|
81
83
|
<IgrNavDrawerItem
|
|
82
84
|
key={route.path}
|
|
83
|
-
active={location.pathname === route.path}
|
|
85
|
+
active={location.pathname === toAbsPath(route.path)}
|
|
84
86
|
onClick={() => handleRouteClick(route.path)}
|
|
85
87
|
>
|
|
86
88
|
<IgrIcon
|
|
@@ -88,7 +90,7 @@ export default function App() {
|
|
|
88
90
|
name={route.icon || "home"}
|
|
89
91
|
collection="material"
|
|
90
92
|
style={{
|
|
91
|
-
color: location.pathname === route.path ? "#0075D2" : undefined,
|
|
93
|
+
color: location.pathname === toAbsPath(route.path) ? "#0075D2" : undefined,
|
|
92
94
|
}}
|
|
93
95
|
/>
|
|
94
96
|
<span slot="content">{route.text}</span>
|
|
@@ -60,8 +60,10 @@ function AppContent() {
|
|
|
60
60
|
return () => mediaQuery.removeEventListener("change", updateDrawerState);
|
|
61
61
|
}, []);
|
|
62
62
|
|
|
63
|
+
const toAbsPath = (p: string) => p.startsWith('/') ? p : `/${p}`;
|
|
64
|
+
|
|
63
65
|
const handleRouteClick = (path: string) => {
|
|
64
|
-
navigate(path);
|
|
66
|
+
navigate(toAbsPath(path));
|
|
65
67
|
|
|
66
68
|
if (window.matchMedia("(max-width: 1024px)").matches) {
|
|
67
69
|
setDrawerOpen(false);
|
|
@@ -92,7 +94,7 @@ function AppContent() {
|
|
|
92
94
|
{visibleRoutes.map((route) => (
|
|
93
95
|
<IgrNavDrawerItem
|
|
94
96
|
key={route.path}
|
|
95
|
-
active={location.pathname === route.path}
|
|
97
|
+
active={location.pathname === toAbsPath(route.path)}
|
|
96
98
|
onClick={() => handleRouteClick(route.path)}
|
|
97
99
|
>
|
|
98
100
|
<IgrIcon
|
|
@@ -100,7 +102,7 @@ function AppContent() {
|
|
|
100
102
|
name={route.icon || "home"}
|
|
101
103
|
collection="material"
|
|
102
104
|
style={{
|
|
103
|
-
color: location.pathname === route.path ? "#0075D2" : "#2d2d2d",
|
|
105
|
+
color: location.pathname === toAbsPath(route.path) ? "#0075D2" : "#2d2d2d",
|
|
104
106
|
}}
|
|
105
107
|
/>
|
|
106
108
|
<span slot="content">{route.text}</span>
|
|
@@ -32,6 +32,7 @@ export default function App() {
|
|
|
32
32
|
const [drawerOpen, setDrawerOpen] = useState(true);
|
|
33
33
|
const navigate = useNavigate();
|
|
34
34
|
const location = useLocation();
|
|
35
|
+
const toAbsPath = (p: string) => p.startsWith('/') ? p : `/${p}`;
|
|
35
36
|
|
|
36
37
|
useEffect(() => {
|
|
37
38
|
const mq = window.matchMedia('(min-width: 1025px)');
|
|
@@ -59,14 +60,14 @@ export default function App() {
|
|
|
59
60
|
{navRoutes.map((route) => (
|
|
60
61
|
<IgrNavDrawerItem
|
|
61
62
|
key={route.path}
|
|
62
|
-
active={location.pathname === route.path}
|
|
63
|
-
onClick={() => navigate(route.path)}
|
|
63
|
+
active={location.pathname === toAbsPath(route.path)}
|
|
64
|
+
onClick={() => navigate(toAbsPath(route.path))}
|
|
64
65
|
>
|
|
65
66
|
<IgrIcon
|
|
66
67
|
slot="icon"
|
|
67
68
|
name={route.icon || 'apps'}
|
|
68
69
|
collection="material"
|
|
69
|
-
style={location.pathname === route.path ? { color: '#0075D2' } : undefined}
|
|
70
|
+
style={location.pathname === toAbsPath(route.path) ? { color: '#0075D2' } : undefined}
|
|
70
71
|
/>
|
|
71
72
|
<span slot="content">{route.text}</span>
|
|
72
73
|
</IgrNavDrawerItem>
|
|
@@ -36,6 +36,7 @@ function AppContent() {
|
|
|
36
36
|
const navigate = useNavigate();
|
|
37
37
|
const location = useLocation();
|
|
38
38
|
const { currentUser } = useAuth();
|
|
39
|
+
const toAbsPath = (p: string) => p.startsWith('/') ? p : `/${p}`;
|
|
39
40
|
|
|
40
41
|
const navRoutes = useMemo(() => routes.filter((r) => {
|
|
41
42
|
if (!r.text) return false;
|
|
@@ -71,14 +72,14 @@ function AppContent() {
|
|
|
71
72
|
{navRoutes.map((route) => (
|
|
72
73
|
<IgrNavDrawerItem
|
|
73
74
|
key={route.path}
|
|
74
|
-
active={location.pathname === route.path}
|
|
75
|
-
onClick={() => navigate(route.path)}
|
|
75
|
+
active={location.pathname === toAbsPath(route.path)}
|
|
76
|
+
onClick={() => navigate(toAbsPath(route.path))}
|
|
76
77
|
>
|
|
77
78
|
<IgrIcon
|
|
78
79
|
slot="icon"
|
|
79
80
|
name={route.icon || 'apps'}
|
|
80
81
|
collection="material"
|
|
81
|
-
style={location.pathname === route.path ? { color: '#0075D2' } : undefined}
|
|
82
|
+
style={location.pathname === toAbsPath(route.path) ? { color: '#0075D2' } : undefined}
|
|
82
83
|
/>
|
|
83
84
|
<span slot="content">{route.text}</span>
|
|
84
85
|
</IgrNavDrawerItem>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { beforeAll, expect, test } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import $(ClassName) from './$(path)';
|
|
4
|
+
import { setupTestMocks } from '../../setupTests';
|
|
5
|
+
|
|
6
|
+
beforeAll(() => {
|
|
7
|
+
setupTestMocks();
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
test('renders $(ClassName) component', () => {
|
|
11
|
+
const wrapper = render(<$(ClassName) />);
|
|
12
|
+
expect(wrapper).toBeTruthy();
|
|
13
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import style from './style.module.css';
|
|
2
|
+
import { IgrTreeGrid, IgrColumn } from 'igniteui-react-grids';
|
|
3
|
+
import 'igniteui-react-grids/grids/themes/light/bootstrap.css';
|
|
4
|
+
|
|
5
|
+
import { EMPLOYEE_DATA } from './data';
|
|
6
|
+
|
|
7
|
+
export default function $(ClassName)() {
|
|
8
|
+
const title = '$(name)';
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div className={style.page}>
|
|
12
|
+
<p className={style.title}>{title}</p>
|
|
13
|
+
<p className={style.subtitle}>
|
|
14
|
+
IgrTreeGrid component displaying hierarchical data using a child collection.<br />
|
|
15
|
+
You can read more about configuring the IgrTreeGrid component in the
|
|
16
|
+
<a href="https://www.infragistics.com/products/ignite-ui-react/react/components/grids/tree-grid/overview.html" target="_blank" rel="noopener noreferrer">
|
|
17
|
+
official documentation
|
|
18
|
+
</a>.
|
|
19
|
+
</p>
|
|
20
|
+
<div className={style.grid}>
|
|
21
|
+
<IgrTreeGrid data={EMPLOYEE_DATA} primaryKey="ID" childDataKey="Employees" autoGenerate={false} height="650px" width="100%">
|
|
22
|
+
<IgrColumn field="Name" dataType="string" />
|
|
23
|
+
<IgrColumn field="Location" dataType="string" />
|
|
24
|
+
<IgrColumn field="HireDate" header="Hire Date" dataType="date" />
|
|
25
|
+
<IgrColumn field="Age" dataType="number" />
|
|
26
|
+
</IgrTreeGrid>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
:local(.page) {
|
|
2
|
+
width: 100%;
|
|
3
|
+
margin-top: 40px;
|
|
4
|
+
padding: 0 48px;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:local(.title) {
|
|
11
|
+
color: rgb(0, 153, 255);
|
|
12
|
+
text-align: center;
|
|
13
|
+
font-size: 2.5rem;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:local(.subtitle) {
|
|
18
|
+
text-align: center;
|
|
19
|
+
margin-bottom: 32px;
|
|
20
|
+
margin-top: 16px;
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:local(.grid) {
|
|
25
|
+
width: 100%;
|
|
26
|
+
max-width: 1200px;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const IgniteUIForReactTemplate_1 = require("../../../../../lib/templates/IgniteUIForReactTemplate");
|
|
27
|
+
const constants_1 = require("../../constants");
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const SHARED_DATA_ROOT = path.join(path.dirname(require.resolve("@igniteui/angular-templates/package.json")), "shared-data");
|
|
30
|
+
class TreeGridTemplate extends IgniteUIForReactTemplate_1.IgniteUIForReactTemplate {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(__dirname);
|
|
33
|
+
this.id = "tree-grid";
|
|
34
|
+
this.name = "Tree Grid";
|
|
35
|
+
this.widget = "igTreeGrid";
|
|
36
|
+
this.description = "IgrTreeGrid template for React";
|
|
37
|
+
this.projectType = "igr-ts";
|
|
38
|
+
this.components = ["Tree Grid"];
|
|
39
|
+
this.controlGroup = "Data Grids";
|
|
40
|
+
this.packages = [constants_1.IGNITEUI_REACT_GRIDS_PACKAGE];
|
|
41
|
+
this.hasExtraConfiguration = false;
|
|
42
|
+
}
|
|
43
|
+
get templatePaths() {
|
|
44
|
+
return [
|
|
45
|
+
...super.templatePaths,
|
|
46
|
+
path.join(SHARED_DATA_ROOT, "tree-grid", "files")
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
module.exports = new TreeGridTemplate();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
4
|
+
class IgrTsTreeGridComponent extends cli_core_1.BaseComponent {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(__dirname);
|
|
7
|
+
this.name = "Tree Grid";
|
|
8
|
+
this.group = "Grids & Lists";
|
|
9
|
+
this.description = "IgrTreeGrid component for React";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
module.exports = new IgrTsTreeGridComponent();
|