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
package/lib/PromptSession.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BasePromptSession, Framework, ProjectLibrary, PromptTaskContext, Task }
|
|
|
2
2
|
export declare class PromptSession extends BasePromptSession {
|
|
3
3
|
static chooseTerm(): Promise<string>;
|
|
4
4
|
protected getProjectLibrary(framework: Framework): Promise<ProjectLibrary>;
|
|
5
|
-
protected
|
|
5
|
+
protected complete(): Promise<void>;
|
|
6
6
|
protected upgradePackages(): Promise<void>;
|
|
7
7
|
protected configureAI(frameworkId: string): Promise<void>;
|
|
8
8
|
protected templateSelectedTask(type?: "component" | "view"): Task<PromptTaskContext>;
|
package/lib/PromptSession.js
CHANGED
|
@@ -16,7 +16,6 @@ exports.PromptSession = void 0;
|
|
|
16
16
|
const cli_core_1 = require("@igniteui/cli-core");
|
|
17
17
|
const add_1 = __importDefault(require("./commands/add"));
|
|
18
18
|
const ai_config_1 = require("./commands/ai-config");
|
|
19
|
-
const start_1 = __importDefault(require("./commands/start"));
|
|
20
19
|
const upgrade_1 = __importDefault(require("./commands/upgrade"));
|
|
21
20
|
class PromptSession extends cli_core_1.BasePromptSession {
|
|
22
21
|
static chooseTerm() {
|
|
@@ -45,10 +44,10 @@ class PromptSession extends cli_core_1.BasePromptSession {
|
|
|
45
44
|
return result;
|
|
46
45
|
});
|
|
47
46
|
}
|
|
48
|
-
|
|
47
|
+
complete() {
|
|
49
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
yield cli_core_1.PackageManager.installPackages();
|
|
50
50
|
yield cli_core_1.PackageManager.flushQueue(true);
|
|
51
|
-
yield start_1.default.start({ port });
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
53
|
upgradePackages() {
|
package/lib/commands/new.js
CHANGED
|
@@ -68,6 +68,16 @@ const command = {
|
|
|
68
68
|
alias: "th",
|
|
69
69
|
describe: "Project theme (depends on project type)",
|
|
70
70
|
type: "string"
|
|
71
|
+
})
|
|
72
|
+
.option("hosting", {
|
|
73
|
+
describe: "Blazor hosting model (Blazor projects only)",
|
|
74
|
+
type: "string",
|
|
75
|
+
choices: ["Server", "Wasm", "Auto"]
|
|
76
|
+
})
|
|
77
|
+
.option("variant", {
|
|
78
|
+
describe: "Theme variant (Blazor projects only)",
|
|
79
|
+
type: "string",
|
|
80
|
+
choices: ["light", "dark"]
|
|
71
81
|
})
|
|
72
82
|
.option("skip-git", {
|
|
73
83
|
alias: "sg",
|
|
@@ -169,6 +179,44 @@ const command = {
|
|
|
169
179
|
cd11: !!argv.skipGit,
|
|
170
180
|
cd14: theme
|
|
171
181
|
});
|
|
182
|
+
if (typeof projTemplate.scaffold === "function") {
|
|
183
|
+
if (!/^[a-zA-Z][a-zA-Z0-9-]*$/.test(argv.name)) {
|
|
184
|
+
cli_core_1.Util.warn(`The project namespace will be derived from the name '${argv.name}'. ` +
|
|
185
|
+
"Use only letters, digits and dashes for a clean identifier.", "yellow");
|
|
186
|
+
}
|
|
187
|
+
const extraConfig = {};
|
|
188
|
+
if (argv.hosting) {
|
|
189
|
+
extraConfig.Hosting = argv.hosting;
|
|
190
|
+
}
|
|
191
|
+
if (argv.variant) {
|
|
192
|
+
extraConfig.Variant = argv.variant;
|
|
193
|
+
}
|
|
194
|
+
const success = yield projTemplate.scaffold({
|
|
195
|
+
name: argv.name,
|
|
196
|
+
theme,
|
|
197
|
+
skipInstall: !!argv.skipInstall,
|
|
198
|
+
skipGit: !!argv.skipGit,
|
|
199
|
+
extraConfig
|
|
200
|
+
});
|
|
201
|
+
if (!success) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
process.chdir(argv.name);
|
|
205
|
+
yield (0, ai_config_1.configure)(argv.framework, {
|
|
206
|
+
agents: argv.agents,
|
|
207
|
+
assistants: argv.assistants
|
|
208
|
+
});
|
|
209
|
+
process.chdir("..");
|
|
210
|
+
if (!argv["skip-git"] && !cli_core_1.ProjectConfig.getConfig().skipGit) {
|
|
211
|
+
cli_core_1.Util.gitInit(process.cwd(), argv.name);
|
|
212
|
+
}
|
|
213
|
+
const quotedName = cli_core_1.Util.quoteIfNeeded(argv.name);
|
|
214
|
+
cli_core_1.Util.log("");
|
|
215
|
+
cli_core_1.Util.log("Next Steps:");
|
|
216
|
+
cli_core_1.Util.log(` cd ${quotedName}`);
|
|
217
|
+
cli_core_1.Util.log(` dotnet run --project ${quotedName}`);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
172
220
|
const config = projTemplate.generateConfig(argv.name, theme);
|
|
173
221
|
for (const templatePath of projTemplate.templatePaths) {
|
|
174
222
|
yield cli_core_1.Util.processTemplates(templatePath, path.join(process.cwd(), argv.name), config, projTemplate.delimiters, false);
|
|
@@ -190,7 +238,7 @@ const command = {
|
|
|
190
238
|
}
|
|
191
239
|
cli_core_1.Util.log("");
|
|
192
240
|
cli_core_1.Util.log("Next Steps:");
|
|
193
|
-
cli_core_1.Util.log(` cd ${argv.name}`);
|
|
241
|
+
cli_core_1.Util.log(` cd ${cli_core_1.Util.quoteIfNeeded(argv.name)}`);
|
|
194
242
|
cli_core_1.Util.log(" ig add start guided mode for adding views to the app");
|
|
195
243
|
cli_core_1.Util.log(" ig start starts a web server and opens the app in the default browser");
|
|
196
244
|
});
|
package/lib/commands/types.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export interface PositionalArgs {
|
|
|
9
9
|
type?: string;
|
|
10
10
|
/** Which theme to use when creating a new project. */
|
|
11
11
|
theme?: string;
|
|
12
|
+
/** Blazor hosting model (Blazor projects only). */
|
|
13
|
+
hosting?: string;
|
|
14
|
+
/** Theme variant (Blazor projects only). */
|
|
15
|
+
variant?: string;
|
|
12
16
|
template?: string;
|
|
13
17
|
module?: string;
|
|
14
18
|
skipRoute?: boolean;
|
|
@@ -59,6 +59,7 @@ class IgniteUIForWebComponentsTemplate {
|
|
|
59
59
|
if (!(options && options.skipRoute) &&
|
|
60
60
|
cli_core_1.App.container.get(cli_core_1.FS_TOKEN).fileExists(routeModulePath)) {
|
|
61
61
|
const modulePath = `./${cli_core_1.Util.lowerDashed(fullName)}/${cli_core_1.Util.lowerDashed(fullName)}-routing`;
|
|
62
|
+
const componentTag = `app-${this.fileName(fullName)}`;
|
|
62
63
|
const child = {
|
|
63
64
|
identifierName: cli_core_1.ROUTES_VARIABLE_NAME,
|
|
64
65
|
aliasName: options.routerChildren,
|
|
@@ -67,7 +68,7 @@ class IgniteUIForWebComponentsTemplate {
|
|
|
67
68
|
if (defaultPath) {
|
|
68
69
|
routingModule.addRoute({
|
|
69
70
|
path: "",
|
|
70
|
-
redirectTo:
|
|
71
|
+
redirectTo: componentTag,
|
|
71
72
|
name: cli_core_1.Util.nameFromPath(fullName)
|
|
72
73
|
});
|
|
73
74
|
if (options.hasChildren) {
|
|
@@ -76,7 +77,7 @@ class IgniteUIForWebComponentsTemplate {
|
|
|
76
77
|
}
|
|
77
78
|
routingModule.addRoute({
|
|
78
79
|
path: this.fileName(fullName),
|
|
79
|
-
identifierName:
|
|
80
|
+
identifierName: componentTag,
|
|
80
81
|
name: cli_core_1.Util.nameFromPath(fullName)
|
|
81
82
|
}, false // multiline
|
|
82
83
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "igniteui-cli",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.4.0",
|
|
4
4
|
"description": "CLI tool for creating Ignite UI projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"all": true
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@igniteui/angular-templates": "~
|
|
70
|
-
"@igniteui/cli-core": "~15.
|
|
71
|
-
"@igniteui/mcp-server": "~15.
|
|
69
|
+
"@igniteui/angular-templates": "~22.0.1540",
|
|
70
|
+
"@igniteui/cli-core": "~15.4.0",
|
|
71
|
+
"@igniteui/mcp-server": "~15.4.0",
|
|
72
72
|
"@inquirer/prompts": "^7.9.0",
|
|
73
73
|
"chalk": "^5.3.0",
|
|
74
74
|
"glob": "^11.0.0",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"yargs": "^17.7.2"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@angular-devkit/core": "^
|
|
83
|
-
"@angular-devkit/schematics": "^
|
|
84
|
-
"@schematics/angular": "^
|
|
82
|
+
"@angular-devkit/core": "^22.0.0",
|
|
83
|
+
"@angular-devkit/schematics": "^22.0.0",
|
|
84
|
+
"@schematics/angular": "^22.0.0",
|
|
85
85
|
"@types/jasmine": "^5.1.4",
|
|
86
86
|
"@types/node": "^22.5.5",
|
|
87
87
|
"@types/yargs": "^17.0.33",
|
|
@@ -6,7 +6,7 @@ class IgbBlazorProjectLibrary extends cli_core_1.BaseProjectLibrary {
|
|
|
6
6
|
super(__dirname);
|
|
7
7
|
this.name = "Ignite UI for Blazor";
|
|
8
8
|
this.projectType = "igb";
|
|
9
|
-
this.themes = ["
|
|
9
|
+
this.themes = ["bootstrap", "material", "fluent", "indigo"];
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
module.exports = new IgbBlazorProjectLibrary();
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
# Grid Migration - Grid Lite → Premium IgbGrid
|
|
2
|
+
|
|
3
|
+
> **Part of the [`igniteui-blazor-grids`](../SKILL.md) skill hub.**
|
|
4
|
+
> For `IgbGrid` setup and column configuration — see [`structure.md`](./structure.md).
|
|
5
|
+
> For specialized grid types including `IgbGridLite` — see [`types.md`](./types.md).
|
|
6
|
+
> For cell and row editing after migration — see [`editing.md`](./editing.md).
|
|
7
|
+
|
|
8
|
+
## Contents
|
|
9
|
+
|
|
10
|
+
- [When to Migrate from Grid Lite to IgbGrid](#when-to-migrate-from-grid-lite-to-igbgrid)
|
|
11
|
+
- [Setup](#setup)
|
|
12
|
+
- [Minimal Migration Example](#minimal-migration-example)
|
|
13
|
+
- [Component and API Changes](#component-and-api-changes)
|
|
14
|
+
- [Cell Templates](#cell-templates)
|
|
15
|
+
- [Header Templates](#header-templates)
|
|
16
|
+
- [Remote Data](#remote-data)
|
|
17
|
+
- [Programmatic Sort / Filter](#programmatic-sort--filter)
|
|
18
|
+
- [Common Enterprise Features](#common-enterprise-features)
|
|
19
|
+
- [Cleanup After Migration](#cleanup-after-migration)
|
|
20
|
+
- [Key Rules](#key-rules)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## When to Migrate from Grid Lite to IgbGrid
|
|
25
|
+
|
|
26
|
+
Migrate when you need any of the following features (not available in `IgbGridLite`):
|
|
27
|
+
|
|
28
|
+
| Feature | Grid Lite | Premium Grid (`IgbGrid`) |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| Cell editing | ✗ | ✓ `Editable` on column, `RowEditable` on grid |
|
|
31
|
+
| Batch editing (with undo) | ✗ | ✗ (not supported in Blazor) |
|
|
32
|
+
| Row adding / deleting | ✗ | ✓ `RowEditable` + `IgbActionStrip` |
|
|
33
|
+
| Row selection | ✗ | ✓ `RowSelection="GridSelectionMode.Single|Multiple"` |
|
|
34
|
+
| Cell selection | ✗ | ✓ `CellSelection` |
|
|
35
|
+
| Column selection | ✗ | ✓ `ColumnSelection` |
|
|
36
|
+
| Paging | ✗ | ✓ `IgbPaginator` child |
|
|
37
|
+
| GroupBy | ✗ | ✓ `GroupingExpressions` (IgbGrid only) |
|
|
38
|
+
| Column summaries | ✗ | ✓ `HasSummary` on `IgbColumn` |
|
|
39
|
+
| Column pinning | ✗ | ✓ `Pinned` on `IgbColumn` |
|
|
40
|
+
| Column moving | ✗ | ✓ `Moving="true"` on grid |
|
|
41
|
+
| Master-detail rows | ✗ | ✓ `IgbGrid` row expansion |
|
|
42
|
+
| Excel / CSV export (toolbar) | ✗ | ✓ `IgbGridToolbarExporter` |
|
|
43
|
+
| Column hiding toolbar | ✗ | ✓ `IgbGridToolbarHiding` |
|
|
44
|
+
| Column pinning toolbar | ✗ | ✓ `IgbGridToolbarPinning` |
|
|
45
|
+
| Advanced filtering UI | ✗ | ✓ `IgbGridToolbarAdvancedFiltering` |
|
|
46
|
+
| State persistence | ✗ | ✓ `IgbGridState` |
|
|
47
|
+
| Clipboard operations | ✗ | ✓ `ClipboardOptions` |
|
|
48
|
+
| Action strip | ✗ | ✓ `IgbActionStrip` |
|
|
49
|
+
| Row drag and drop | ✗ | ✓ `RowDraggable="true"` |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Setup
|
|
54
|
+
|
|
55
|
+
### 1. Replace the NuGet package registration
|
|
56
|
+
|
|
57
|
+
```csharp
|
|
58
|
+
// Remove:
|
|
59
|
+
builder.Services.AddIgniteUIBlazor(typeof(IgbGridLiteModule));
|
|
60
|
+
|
|
61
|
+
// Add:
|
|
62
|
+
builder.Services.AddIgniteUIBlazor(typeof(IgbGridModule));
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 2. Replace the CSS link in `index.html`
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<!-- Remove: -->
|
|
69
|
+
<link href="_content/IgniteUI.Blazor.GridLite/css/themes/light/bootstrap.css" rel="stylesheet" />
|
|
70
|
+
|
|
71
|
+
<!-- Add: -->
|
|
72
|
+
<link href="_content/IgniteUI.Blazor/themes/light/bootstrap.css" rel="stylesheet" />
|
|
73
|
+
<link href="_content/IgniteUI.Blazor/themes/grid/light/bootstrap.css" rel="stylesheet" />
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. Update `_Imports.razor`
|
|
77
|
+
|
|
78
|
+
`IgniteUI.Blazor.Controls` covers both `IgbGridLite` and `IgbGrid` — no change needed if already present.
|
|
79
|
+
|
|
80
|
+
```razor
|
|
81
|
+
@using IgniteUI.Blazor.Controls
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Minimal Migration Example
|
|
87
|
+
|
|
88
|
+
```razor
|
|
89
|
+
<!-- Before: -->
|
|
90
|
+
<IgbGridLite TItem="Product" Data="@products">
|
|
91
|
+
<IgbGridLiteColumn Field="Name" Header="Name" DataType="GridLiteColumnDataType.String" Sortable Filterable Resizable />
|
|
92
|
+
<IgbGridLiteColumn Field="Price" Header="Price" DataType="GridLiteColumnDataType.Number" />
|
|
93
|
+
</IgbGridLite>
|
|
94
|
+
|
|
95
|
+
<!-- After: -->
|
|
96
|
+
<IgbGrid @ref="grid" Data="@products" PrimaryKey="Id" AutoGenerate="false"
|
|
97
|
+
Width="100%" Height="600px" AllowFiltering="true">
|
|
98
|
+
<IgbColumn Field="Name" Header="Name" DataType="GridColumnDataType.String" Sortable="true" Filterable="true" Resizable="true" />
|
|
99
|
+
<IgbColumn Field="Price" Header="Price" DataType="GridColumnDataType.Number" Sortable="true" />
|
|
100
|
+
</IgbGrid>
|
|
101
|
+
|
|
102
|
+
@code {
|
|
103
|
+
private IgbGrid grid = default!;
|
|
104
|
+
private List<Product> products = new();
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Key additions vs Grid Lite:**
|
|
109
|
+
- `PrimaryKey` — required for editing, selection, and row-targeted APIs
|
|
110
|
+
- `Height` — required for row virtualization
|
|
111
|
+
- `AllowFiltering="true"` on the grid — enables the filter row UI; `Filterable="true"` on a column opts that column in
|
|
112
|
+
- `@ref` — required for programmatic API access
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Component and API Changes
|
|
117
|
+
|
|
118
|
+
| Grid Lite | Premium Grid |
|
|
119
|
+
|---|---|
|
|
120
|
+
| `IgbGridLite` | `IgbGrid` |
|
|
121
|
+
| `IgbGridLiteColumn` | `IgbColumn` |
|
|
122
|
+
| `GridLiteColumnDataType` | `GridColumnDataType` |
|
|
123
|
+
| `IgbGridLiteModule` | `IgbGridModule` |
|
|
124
|
+
| `IgbGridLiteSortingExpression` | `IgbSortingExpression` |
|
|
125
|
+
| `IgbGridLiteFilterExpression` | `IgbFilteringExpression` |
|
|
126
|
+
| Column `Key` (in sort/filter objects) | Column `FieldName` (in sort/filter objects) |
|
|
127
|
+
| `TItem` generic parameter | `TItem` (unchanged) |
|
|
128
|
+
| No `PrimaryKey` | `PrimaryKey` required for most features |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Cell Templates
|
|
133
|
+
|
|
134
|
+
Grid Lite has no cell templates. In `IgbGrid`, use the `BodyTemplate` render fragment on `IgbColumn`:
|
|
135
|
+
|
|
136
|
+
```razor
|
|
137
|
+
<IgbColumn Field="Status" Header="Status">
|
|
138
|
+
<BodyTemplate>
|
|
139
|
+
@{
|
|
140
|
+
var cell = (IgbCellTemplateContext)context;
|
|
141
|
+
var status = cell.Cell.Value?.ToString();
|
|
142
|
+
}
|
|
143
|
+
<span style="color: @(status == "Active" ? "green" : "red")">@status</span>
|
|
144
|
+
</BodyTemplate>
|
|
145
|
+
</IgbColumn>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
| | Grid Lite | Premium Grid |
|
|
149
|
+
|---|---|---|
|
|
150
|
+
| Cell template | Not supported | `BodyTemplate` render fragment |
|
|
151
|
+
| Cell value | — | `((IgbCellTemplateContext)context).Cell.Value` |
|
|
152
|
+
| Row data | — | `((IgbCellTemplateContext)context).Cell.Row.Data` |
|
|
153
|
+
| Edit template | — | `InlineEditorTemplate` render fragment |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Header Templates
|
|
158
|
+
|
|
159
|
+
Grid Lite has no header templates. In `IgbGrid`, use the `HeaderTemplate` render fragment:
|
|
160
|
+
|
|
161
|
+
```razor
|
|
162
|
+
<IgbColumn Field="Price" Header="Price">
|
|
163
|
+
<HeaderTemplate>
|
|
164
|
+
<strong>@((context as IgbColumnTemplateContext)?.Column.Header)</strong>
|
|
165
|
+
</HeaderTemplate>
|
|
166
|
+
</IgbColumn>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Remote Data
|
|
172
|
+
|
|
173
|
+
For server-side sort/filter, handle the `SortingDone` / `FilteringDone` events to reload data:
|
|
174
|
+
```razor
|
|
175
|
+
<IgbGrid @ref="grid" Data="@data" PrimaryKey="Id" Height="600px"
|
|
176
|
+
SortingDone="OnSortingDone" FilteringDone="OnFilteringDone">
|
|
177
|
+
</IgbGrid>
|
|
178
|
+
|
|
179
|
+
@code {
|
|
180
|
+
private IgbGrid grid = default!;
|
|
181
|
+
private List<MyItem> data = new();
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
private async Task OnSortingDone(IgbSortingExpressionEventArgs args)
|
|
185
|
+
{
|
|
186
|
+
data = await DataService.SortAsync(args.Detail);
|
|
187
|
+
StateHasChanged();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
private async Task OnFilteringDone(IgbFilteringExpressionsTreeEventArgs args)
|
|
191
|
+
{
|
|
192
|
+
data = await DataService.FilterAsync(args.Detail);
|
|
193
|
+
StateHasChanged();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Programmatic Sort / Filter
|
|
201
|
+
|
|
202
|
+
```razor
|
|
203
|
+
@code {
|
|
204
|
+
private IgbGrid grid = default!;
|
|
205
|
+
|
|
206
|
+
// Sort
|
|
207
|
+
private async Task SortByName()
|
|
208
|
+
{
|
|
209
|
+
await grid.SortAsync(new IgbSortingExpression[]
|
|
210
|
+
{
|
|
211
|
+
new IgbSortingExpression { FieldName = "Name", Dir = SortingDirection.Asc }
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
private async Task ClearSorting() => await grid.ClearSortAsync();
|
|
216
|
+
|
|
217
|
+
// Filter
|
|
218
|
+
private void FilterActive()
|
|
219
|
+
{
|
|
220
|
+
var tree = new IgbFilteringExpressionsTree() { Operator = FilteringLogic.And };
|
|
221
|
+
tree.FilteringOperands = new IgbFilteringExpression[]
|
|
222
|
+
{
|
|
223
|
+
new IgbFilteringExpression { FieldName = "IsActive", ConditionName = "true", SearchVal = true }
|
|
224
|
+
};
|
|
225
|
+
grid.FilteringExpressionsTree = tree;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
private async Task ClearFilters() => await grid.ClearFilterAsync();
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
> In Grid Lite, sort/filter expressions used a `Key` property. In `IgbGrid`, use `FieldName`.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Common Enterprise Features
|
|
237
|
+
|
|
238
|
+
### Editing
|
|
239
|
+
|
|
240
|
+
```razor
|
|
241
|
+
<IgbGrid Data="@data" PrimaryKey="Id" RowEditable="true" Height="600px">
|
|
242
|
+
<IgbColumn Field="Name" Editable="true" />
|
|
243
|
+
<IgbColumn Field="Price" Editable="true" DataType="GridColumnDataType.Number" />
|
|
244
|
+
</IgbGrid>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
See [`editing.md`](./editing.md) for cell editing, row editing, validation, and custom editors.
|
|
248
|
+
|
|
249
|
+
### Row Selection
|
|
250
|
+
|
|
251
|
+
```razor
|
|
252
|
+
<IgbGrid Data="@data" PrimaryKey="Id" RowSelection="GridSelectionMode.Multiple" Height="600px">
|
|
253
|
+
<IgbColumn Field="Name" />
|
|
254
|
+
</IgbGrid>
|
|
255
|
+
|
|
256
|
+
@code {
|
|
257
|
+
// Read selected rows via grid.SelectedRows
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Paging
|
|
262
|
+
|
|
263
|
+
```razor
|
|
264
|
+
<IgbGrid Data="@data" PrimaryKey="Id" Height="600px">
|
|
265
|
+
<IgbPaginator PerPage="15" />
|
|
266
|
+
<IgbColumn Field="Name" />
|
|
267
|
+
</IgbGrid>
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
See [`paging-remote.md`](./paging-remote.md) for remote paging and paginator configuration.
|
|
271
|
+
|
|
272
|
+
### Summaries
|
|
273
|
+
|
|
274
|
+
```razor
|
|
275
|
+
<IgbColumn Field="Price" DataType="GridColumnDataType.Number" HasSummary="true" />
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Toolbar + Export
|
|
279
|
+
|
|
280
|
+
```razor
|
|
281
|
+
<IgbGrid Data="@data" PrimaryKey="Id" Height="600px">
|
|
282
|
+
<IgbGridToolbar>
|
|
283
|
+
<IgbGridToolbarTitle>Products</IgbGridToolbarTitle>
|
|
284
|
+
<IgbGridToolbarActions>
|
|
285
|
+
<IgbGridToolbarHiding />
|
|
286
|
+
<IgbGridToolbarPinning />
|
|
287
|
+
<IgbGridToolbarAdvancedFiltering />
|
|
288
|
+
<IgbGridToolbarExporter ExportExcel="true" ExportCSV="true" />
|
|
289
|
+
</IgbGridToolbarActions>
|
|
290
|
+
</IgbGridToolbar>
|
|
291
|
+
<IgbColumn Field="Name" />
|
|
292
|
+
<IgbColumn Field="Price" />
|
|
293
|
+
</IgbGrid>
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
See [`features.md`](./features.md) for toolbar customization, export events, grouping, summaries, and action strip.
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Cleanup After Migration
|
|
301
|
+
|
|
302
|
+
1. Remove `IgbGridLiteModule` registration from `Program.cs`.
|
|
303
|
+
2. Remove the `IgniteUI.Blazor.GridLite` CSS `<link>` from `index.html`.
|
|
304
|
+
3. Rename all `IgbGridLite` → `IgbGrid`, `IgbGridLiteColumn` → `IgbColumn` in `.razor` files.
|
|
305
|
+
4. Replace `GridLiteColumnDataType` → `GridColumnDataType` enum values.
|
|
306
|
+
5. In sort/filter expression objects, rename the `Key` property → `FieldName`.
|
|
307
|
+
6. Remove the `IgniteUI.Blazor.GridLite` NuGet package if no `IgbGridLite` instances remain:
|
|
308
|
+
```bash
|
|
309
|
+
dotnet remove package IgniteUI.Blazor.GridLite
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Key Rules
|
|
315
|
+
|
|
316
|
+
- `PrimaryKey` is required for editing, selection, row APIs, and `IgbActionStrip` — Grid Lite had no equivalent.
|
|
317
|
+
- `Height` (or a CSS-constrained container) is required for row virtualization in `IgbGrid`.
|
|
318
|
+
- `AllowFiltering="true"` must be set on the grid to show the filter row; `Filterable="true"` on a column opts that column in.
|
|
319
|
+
- Cell and header templates use Blazor render fragments (`BodyTemplate`, `HeaderTemplate`, `InlineEditorTemplate`) — not callbacks or delegates.
|
|
320
|
+
- For remote data, handle `SortingDone` / `FilteringDone` and reload `Data` from your server.
|
|
321
|
+
- `IgbColumn.FieldName` (in expression objects) replaces `IgbGridLiteColumn.Key` used in Grid Lite sort/filter expressions.
|
|
322
|
+
|
|
@@ -265,12 +265,14 @@ Apply different sizing to a specific grid:
|
|
|
265
265
|
|
|
266
266
|
## Key Rules
|
|
267
267
|
|
|
268
|
-
1. **
|
|
269
|
-
2. **
|
|
270
|
-
3. **
|
|
271
|
-
4. **
|
|
272
|
-
5.
|
|
273
|
-
6.
|
|
274
|
-
7.
|
|
275
|
-
8.
|
|
276
|
-
9. **
|
|
268
|
+
1. **Do not add column `Width` unless explicitly requested** — omitting `Width` causes the grid to distribute available space proportionally across all columns, producing a responsive layout with no empty space. Only set explicit pixel or percentage widths when the user specifically asks for fixed column sizing.
|
|
269
|
+
2. **If any column has a specified `Width`, leave at least one column without `Width`** - so it fills the remaining space in the grid.
|
|
270
|
+
3. **Always set `Height` for performance** - without it, virtualization is disabled and all rows render to the DOM.
|
|
271
|
+
4. **Percentage height needs a sized parent** - `Height="100%"` only works if the parent element has an explicit height.
|
|
272
|
+
5. **Box model is border-box** - column widths include padding and borders.
|
|
273
|
+
6. **Horizontal scroll triggers when columns overflow** - if total column width > grid width, a horizontal scrollbar appears.
|
|
274
|
+
7. **`MinWidth` and `MaxWidth` constrain resizing** - always set them when `Resizable="true"` for predictable UX.
|
|
275
|
+
8. **`--ig-size` controls the overall density** - it affects row height, cell padding, header height, and internal spacing.
|
|
276
|
+
9. **Column virtualization works without explicit per-column widths** — when no `Width` is set on a column, the grid distributes available space across all columns (minimum 136px per column). If columns cannot fit at that minimum, a horizontal scrollbar appears and horizontal virtualization activates automatically. You can also set a grid-level default with `ColumnWidth` on `IgbGrid` instead of setting per-column widths. Only set per-column `Width` when a specific column needs a fixed or percentage size.
|
|
277
|
+
10. **Auto-size is a one-time operation** - `Width="auto"` on a column fits content at initial render; it doesn't update dynamically as data changes.
|
|
278
|
+
11. **Row height consistency** - all rows in a grid have the same height. Variable row height is not supported.
|
|
@@ -497,4 +497,5 @@ Or grid-wide:
|
|
|
497
497
|
4. **Registration is mandatory** - every grid module must be registered in `Program.cs` or the component silently fails to render.
|
|
498
498
|
5. **Use PascalCase for all parameters** - Blazor parameters use PascalCase (`Sortable`, `Filterable`), not kebab-case.
|
|
499
499
|
6. **Data must be a C# collection** - `List<T>`, `T[]`, or `IEnumerable<T>`. Not a JSON string or JavaScript object.
|
|
500
|
-
7. **Use `@ref` for programmatic access** - declare `private IgbGrid grid = default!;` and use `@ref="grid"` on the component.
|
|
500
|
+
7. **Use `@ref` for programmatic access** - declare `private IgbGrid grid = default!;` and use `@ref="grid"` on the component.
|
|
501
|
+
8. **Do not add column `Width` unless explicitly requested** - omitting `Width` lets the grid distribute available space proportionally, filling the container with no empty right-side gap. Only set pixel or percentage widths when the user specifically asks for fixed column sizing.
|
|
@@ -40,7 +40,7 @@ Columns are declared as child elements (`<IgbGridLiteColumn>`), not via a `Colum
|
|
|
40
40
|
<IgbGridLite TItem="Employee" Data="@employees">
|
|
41
41
|
<IgbGridLiteColumn Field="@nameof(Employee.Name)" Header="Name" DataType="GridLiteColumnDataType.String" Sortable Filterable Resizable />
|
|
42
42
|
<IgbGridLiteColumn Field="@nameof(Employee.Department)" Header="Department" Sortable />
|
|
43
|
-
<IgbGridLiteColumn Field="@nameof(Employee.Salary)" Header="Salary" DataType="GridLiteColumnDataType.Number"
|
|
43
|
+
<IgbGridLiteColumn Field="@nameof(Employee.Salary)" Header="Salary" DataType="GridLiteColumnDataType.Number" Sortable />
|
|
44
44
|
<IgbGridLiteColumn Field="@nameof(Employee.HireDate)" Header="Hire Date" DataType="GridLiteColumnDataType.Date" Sortable />
|
|
45
45
|
</IgbGridLite>
|
|
46
46
|
```
|
|
@@ -67,7 +67,7 @@ Columns are declared as child elements (`<IgbGridLiteColumn>`), not via a `Colum
|
|
|
67
67
|
```razor
|
|
68
68
|
<IgbGridLite TItem="ProductInfo" Data="@products" SortingOptions="@sortingOptions">
|
|
69
69
|
<IgbGridLiteColumn Field="Name" Header="Name" DataType="GridLiteColumnDataType.String" Sortable />
|
|
70
|
-
<IgbGridLiteColumn Field="Price" Header="Price" DataType="GridLiteColumnDataType.Number"
|
|
70
|
+
<IgbGridLiteColumn Field="Price" Header="Price" DataType="GridLiteColumnDataType.Number" Sortable />
|
|
71
71
|
</IgbGridLite>
|
|
72
72
|
|
|
73
73
|
@code {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ControlExtraConfiguration, ProjectTemplate, ScaffoldOptions } from "@igniteui/cli-core";
|
|
2
|
+
export declare class EmptyIgbProject implements ProjectTemplate {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
framework: string;
|
|
7
|
+
projectType: string;
|
|
8
|
+
dependencies: string[];
|
|
9
|
+
hasExtraConfiguration: boolean;
|
|
10
|
+
isHidden: boolean;
|
|
11
|
+
delimiters: import("@igniteui/cli-core").TemplateDelimiters;
|
|
12
|
+
templatePaths: string[];
|
|
13
|
+
private extraConfiguration;
|
|
14
|
+
getExtraConfiguration(): ControlExtraConfiguration[];
|
|
15
|
+
setExtraConfiguration(extraConfigKeys: {} | any[]): void;
|
|
16
|
+
scaffold(options: ScaffoldOptions): Promise<boolean>;
|
|
17
|
+
installModules(): void;
|
|
18
|
+
upgradeIgniteUIPackages(_projectPath: string, _packagePath: string): Promise<boolean>;
|
|
19
|
+
generateConfig(_name: string, _theme: string, ..._options: any[]): {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
declare const _default: EmptyIgbProject;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmptyIgbProject = void 0;
|
|
4
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
5
|
+
class EmptyIgbProject {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.id = "empty";
|
|
8
|
+
this.name = "Blazor Web App";
|
|
9
|
+
this.description = "Ignite UI for Blazor Web App, scaffolded via the IgniteUI.Blazor.Templates package";
|
|
10
|
+
this.framework = "blazor";
|
|
11
|
+
this.projectType = "igb";
|
|
12
|
+
this.dependencies = [];
|
|
13
|
+
this.hasExtraConfiguration = true;
|
|
14
|
+
this.isHidden = false;
|
|
15
|
+
this.delimiters = cli_core_1.defaultDelimiters;
|
|
16
|
+
this.templatePaths = [];
|
|
17
|
+
this.extraConfiguration = {};
|
|
18
|
+
}
|
|
19
|
+
getExtraConfiguration() {
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
choices: ["Server", "Wasm", "Auto"],
|
|
23
|
+
default: "Server",
|
|
24
|
+
key: "Hosting",
|
|
25
|
+
message: "Choose the hosting model:",
|
|
26
|
+
type: 0 /* ControlExtraConfigType.Choice */
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
choices: ["light", "dark"],
|
|
30
|
+
default: "light",
|
|
31
|
+
key: "Variant",
|
|
32
|
+
message: "Choose the theme variant:",
|
|
33
|
+
type: 0 /* ControlExtraConfigType.Choice */
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
setExtraConfiguration(extraConfigKeys) {
|
|
38
|
+
if (Array.isArray(extraConfigKeys)) {
|
|
39
|
+
// the wizard supplies answers positionally, matching getExtraConfiguration() order
|
|
40
|
+
const keys = this.getExtraConfiguration().map(c => c.key);
|
|
41
|
+
extraConfigKeys.forEach((value, i) => {
|
|
42
|
+
if (keys[i] !== undefined) {
|
|
43
|
+
this.extraConfiguration[keys[i]] = value;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.extraConfiguration = Object.assign(Object.assign({}, this.extraConfiguration), extraConfigKeys);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
scaffold(options) {
|
|
52
|
+
const extraConfig = Object.assign(Object.assign({}, this.extraConfiguration), options.extraConfig);
|
|
53
|
+
return Promise.resolve(cli_core_1.DotnetTemplateManager.scaffold(Object.assign(Object.assign({}, options), { extraConfig })));
|
|
54
|
+
}
|
|
55
|
+
// Unused — the host calls scaffold() instead of the generateConfig pipeline when scaffold exists.
|
|
56
|
+
installModules() {
|
|
57
|
+
throw new Error("Method not implemented.");
|
|
58
|
+
}
|
|
59
|
+
upgradeIgniteUIPackages(_projectPath, _packagePath) {
|
|
60
|
+
throw new Error("Method not implemented.");
|
|
61
|
+
}
|
|
62
|
+
generateConfig(_name, _theme, ..._options) {
|
|
63
|
+
throw new Error("Method not implemented.");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.EmptyIgbProject = EmptyIgbProject;
|
|
67
|
+
exports.default = new EmptyIgbProject();
|