igniteui-angular 22.1.0-beta.7 → 22.1.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.
Files changed (153) hide show
  1. package/README.md +1 -0
  2. package/fesm2022/igniteui-angular-accordion.mjs +4 -4
  3. package/fesm2022/igniteui-angular-accordion.mjs.map +1 -1
  4. package/fesm2022/igniteui-angular-action-strip.mjs +48 -12
  5. package/fesm2022/igniteui-angular-action-strip.mjs.map +1 -1
  6. package/fesm2022/igniteui-angular-avatar.mjs.map +1 -1
  7. package/fesm2022/igniteui-angular-badge.mjs +1 -0
  8. package/fesm2022/igniteui-angular-badge.mjs.map +1 -1
  9. package/fesm2022/igniteui-angular-banner.mjs +2 -2
  10. package/fesm2022/igniteui-angular-banner.mjs.map +1 -1
  11. package/fesm2022/igniteui-angular-button-group.mjs.map +1 -1
  12. package/fesm2022/igniteui-angular-calendar.mjs +5 -4
  13. package/fesm2022/igniteui-angular-calendar.mjs.map +1 -1
  14. package/fesm2022/igniteui-angular-card.mjs.map +1 -1
  15. package/fesm2022/igniteui-angular-carousel.mjs.map +1 -1
  16. package/fesm2022/igniteui-angular-chips.mjs +18 -2
  17. package/fesm2022/igniteui-angular-chips.mjs.map +1 -1
  18. package/fesm2022/igniteui-angular-combo.mjs +6 -17
  19. package/fesm2022/igniteui-angular-combo.mjs.map +1 -1
  20. package/fesm2022/igniteui-angular-core.mjs +337 -16
  21. package/fesm2022/igniteui-angular-core.mjs.map +1 -1
  22. package/fesm2022/igniteui-angular-date-picker.mjs +15 -13
  23. package/fesm2022/igniteui-angular-date-picker.mjs.map +1 -1
  24. package/fesm2022/igniteui-angular-dialog.mjs +1 -1
  25. package/fesm2022/igniteui-angular-dialog.mjs.map +1 -1
  26. package/fesm2022/igniteui-angular-directives.mjs +47 -45
  27. package/fesm2022/igniteui-angular-directives.mjs.map +1 -1
  28. package/fesm2022/igniteui-angular-drop-down.mjs +2 -3
  29. package/fesm2022/igniteui-angular-drop-down.mjs.map +1 -1
  30. package/fesm2022/igniteui-angular-expansion-panel.mjs +12 -23
  31. package/fesm2022/igniteui-angular-expansion-panel.mjs.map +1 -1
  32. package/fesm2022/igniteui-angular-grids-core.mjs +220 -484
  33. package/fesm2022/igniteui-angular-grids-core.mjs.map +1 -1
  34. package/fesm2022/igniteui-angular-grids-grid.mjs +96 -117
  35. package/fesm2022/igniteui-angular-grids-grid.mjs.map +1 -1
  36. package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs +19 -15
  37. package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs.map +1 -1
  38. package/fesm2022/igniteui-angular-grids-lite.mjs +2 -8
  39. package/fesm2022/igniteui-angular-grids-lite.mjs.map +1 -1
  40. package/fesm2022/igniteui-angular-grids-pivot-grid.mjs +153 -75
  41. package/fesm2022/igniteui-angular-grids-pivot-grid.mjs.map +1 -1
  42. package/fesm2022/igniteui-angular-grids-tree-grid.mjs +36 -29
  43. package/fesm2022/igniteui-angular-grids-tree-grid.mjs.map +1 -1
  44. package/fesm2022/igniteui-angular-icon.mjs.map +1 -1
  45. package/fesm2022/igniteui-angular-input-group.mjs +1 -1
  46. package/fesm2022/igniteui-angular-input-group.mjs.map +1 -1
  47. package/fesm2022/igniteui-angular-list.mjs.map +1 -1
  48. package/fesm2022/igniteui-angular-navbar.mjs.map +1 -1
  49. package/fesm2022/igniteui-angular-navigation-drawer.mjs +3 -2
  50. package/fesm2022/igniteui-angular-navigation-drawer.mjs.map +1 -1
  51. package/fesm2022/igniteui-angular-paginator.mjs.map +1 -1
  52. package/fesm2022/igniteui-angular-progressbar.mjs +2 -5
  53. package/fesm2022/igniteui-angular-progressbar.mjs.map +1 -1
  54. package/fesm2022/igniteui-angular-query-builder.mjs +19 -18
  55. package/fesm2022/igniteui-angular-query-builder.mjs.map +1 -1
  56. package/fesm2022/igniteui-angular-radio.mjs +1 -1
  57. package/fesm2022/igniteui-angular-radio.mjs.map +1 -1
  58. package/fesm2022/igniteui-angular-select.mjs.map +1 -1
  59. package/fesm2022/igniteui-angular-simple-combo.mjs +7 -10
  60. package/fesm2022/igniteui-angular-simple-combo.mjs.map +1 -1
  61. package/fesm2022/igniteui-angular-slider.mjs +3 -3
  62. package/fesm2022/igniteui-angular-slider.mjs.map +1 -1
  63. package/fesm2022/igniteui-angular-splitter.mjs +1 -1
  64. package/fesm2022/igniteui-angular-splitter.mjs.map +1 -1
  65. package/fesm2022/igniteui-angular-stepper.mjs +1 -1
  66. package/fesm2022/igniteui-angular-stepper.mjs.map +1 -1
  67. package/fesm2022/igniteui-angular-tabs.mjs.map +1 -1
  68. package/fesm2022/igniteui-angular-time-picker.mjs +6 -3
  69. package/fesm2022/igniteui-angular-time-picker.mjs.map +1 -1
  70. package/fesm2022/igniteui-angular-tree.mjs +10 -8
  71. package/fesm2022/igniteui-angular-tree.mjs.map +1 -1
  72. package/migrations/migration-collection.json +10 -0
  73. package/migrations/update-21_0_0_import-migration/index.js +11 -5
  74. package/migrations/update-21_0_0_import-migration/index.spec.d.ts +1 -0
  75. package/migrations/update-21_0_0_import-migration/index.spec.js +175 -0
  76. package/migrations/update-21_1_0_import-migration/index.js +14 -5
  77. package/migrations/update-21_1_0_import-migration/index.spec.d.ts +1 -0
  78. package/migrations/update-21_1_0_import-migration/index.spec.js +146 -0
  79. package/migrations/update-22_1_0_chip-outline/changes/theme-changes.json +17 -0
  80. package/migrations/update-22_1_0_chip-outline/index.d.ts +3 -0
  81. package/migrations/update-22_1_0_chip-outline/index.js +18 -0
  82. package/migrations/update-22_1_0_chip-outline/index.spec.d.ts +1 -0
  83. package/migrations/update-22_1_0_chip-outline/index.spec.js +68 -0
  84. package/migrations/update-22_1_0_import-migration/index.d.ts +2 -0
  85. package/migrations/update-22_1_0_import-migration/index.js +228 -0
  86. package/migrations/update-22_1_0_import-migration/index.spec.d.ts +1 -0
  87. package/migrations/update-22_1_0_import-migration/index.spec.js +188 -0
  88. package/package.json +4 -4
  89. package/skills/igniteui-angular-components/SKILL.md +1 -0
  90. package/skills/igniteui-angular-figma-to-app/SKILL.md +1 -0
  91. package/skills/igniteui-angular-generate-from-image-design/SKILL.md +1 -0
  92. package/skills/igniteui-angular-grids/SKILL.md +1 -0
  93. package/skills/igniteui-angular-theming/SKILL.md +1 -0
  94. package/styles/igniteui-angular-dark.css +1 -1
  95. package/styles/igniteui-angular.css +1 -1
  96. package/styles/igniteui-bootstrap-dark.css +1 -1
  97. package/styles/igniteui-bootstrap-light.css +1 -1
  98. package/styles/igniteui-dark-green.css +1 -1
  99. package/styles/igniteui-fluent-dark-excel.css +1 -1
  100. package/styles/igniteui-fluent-dark-word.css +1 -1
  101. package/styles/igniteui-fluent-dark.css +1 -1
  102. package/styles/igniteui-fluent-light-excel.css +1 -1
  103. package/styles/igniteui-fluent-light-word.css +1 -1
  104. package/styles/igniteui-fluent-light.css +1 -1
  105. package/styles/igniteui-indigo-dark.css +1 -1
  106. package/styles/igniteui-indigo-light.css +1 -1
  107. package/styles/maps/igniteui-angular-dark.css.map +1 -1
  108. package/styles/maps/igniteui-angular.css.map +1 -1
  109. package/styles/maps/igniteui-bootstrap-dark.css.map +1 -1
  110. package/styles/maps/igniteui-bootstrap-light.css.map +1 -1
  111. package/styles/maps/igniteui-dark-green.css.map +1 -1
  112. package/styles/maps/igniteui-fluent-dark-excel.css.map +1 -1
  113. package/styles/maps/igniteui-fluent-dark-word.css.map +1 -1
  114. package/styles/maps/igniteui-fluent-dark.css.map +1 -1
  115. package/styles/maps/igniteui-fluent-light-excel.css.map +1 -1
  116. package/styles/maps/igniteui-fluent-light-word.css.map +1 -1
  117. package/styles/maps/igniteui-fluent-light.css.map +1 -1
  118. package/styles/maps/igniteui-indigo-dark.css.map +1 -1
  119. package/styles/maps/igniteui-indigo-light.css.map +1 -1
  120. package/types/igniteui-angular-action-strip.d.ts +15 -2
  121. package/types/igniteui-angular-avatar.d.ts +1 -1
  122. package/types/igniteui-angular-banner.d.ts +3 -3
  123. package/types/igniteui-angular-calendar.d.ts +9 -9
  124. package/types/igniteui-angular-card.d.ts +1 -1
  125. package/types/igniteui-angular-carousel.d.ts +9 -9
  126. package/types/igniteui-angular-chat.d.ts +1 -1
  127. package/types/igniteui-angular-chips.d.ts +17 -6
  128. package/types/igniteui-angular-combo.d.ts +13 -17
  129. package/types/igniteui-angular-core.d.ts +504 -202
  130. package/types/igniteui-angular-date-picker.d.ts +3 -3
  131. package/types/igniteui-angular-dialog.d.ts +4 -4
  132. package/types/igniteui-angular-directives.d.ts +59 -60
  133. package/types/igniteui-angular-drop-down.d.ts +16 -16
  134. package/types/igniteui-angular-expansion-panel.d.ts +6 -6
  135. package/types/igniteui-angular-grids-core.d.ts +796 -1053
  136. package/types/igniteui-angular-grids-grid.d.ts +267 -104
  137. package/types/igniteui-angular-grids-hierarchical-grid.d.ts +547 -68
  138. package/types/igniteui-angular-grids-lite.d.ts +18 -9
  139. package/types/igniteui-angular-grids-pivot-grid.d.ts +129 -94
  140. package/types/igniteui-angular-grids-tree-grid.d.ts +51 -5
  141. package/types/igniteui-angular-icon.d.ts +2 -2
  142. package/types/igniteui-angular-input-group.d.ts +4 -4
  143. package/types/igniteui-angular-list.d.ts +4 -4
  144. package/types/igniteui-angular-navigation-drawer.d.ts +3 -3
  145. package/types/igniteui-angular-progressbar.d.ts +0 -1
  146. package/types/igniteui-angular-query-builder.d.ts +9 -9
  147. package/types/igniteui-angular-radio.d.ts +1 -1
  148. package/types/igniteui-angular-select.d.ts +5 -5
  149. package/types/igniteui-angular-simple-combo.d.ts +2 -2
  150. package/types/igniteui-angular-slider.d.ts +4 -4
  151. package/types/igniteui-angular-splitter.d.ts +3 -3
  152. package/types/igniteui-angular-time-picker.d.ts +8 -8
  153. package/types/igniteui-angular-tree.d.ts +8 -8
@@ -142,8 +142,6 @@ const ENTRY_POINT_MAP = new Map([
142
142
  ['IgxButtonGroupComponent', 'button-group'],
143
143
  ['IgxButtonGroupModule', 'button-group'],
144
144
  ['IGX_BUTTON_GROUP_DIRECTIVES', 'button-group'],
145
- ['IgxButtonDirective', 'button-group'],
146
- ['IgxIconButtonDirective', 'button-group'],
147
145
  ['IButtonGroupEventArgs', 'button-group'],
148
146
  ['ButtonGroupAlignment', 'button-group'],
149
147
  // Calendar
@@ -706,6 +704,8 @@ const TYPE_RENAMES = new Map([
706
704
  ['Direction', { newName: 'CarouselAnimationDirection', entryPoint: 'carousel' }],
707
705
  ['IgxColumPatternValidatorDirective', { newName: 'IgxColumnPatternValidatorDirective', entryPoint: 'grids/core' }],
708
706
  ]);
707
+ /** Sorts specifiers alphabetically by their imported symbol name. */
708
+ const sortByName = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
709
709
  function migrateImportDeclaration(node, sourceFile) {
710
710
  var _a;
711
711
  if (!(0, tsUtils_1.igNamedImportFilter)(node)) {
@@ -719,6 +719,10 @@ function migrateImportDeclaration(node, sourceFile) {
719
719
  }
720
720
  // Group imports by entry point
721
721
  const entryPointGroups = new Map();
722
+ // `import type { ... }` applies to the whole declaration, so it carries over to every generated import.
723
+ // `phaseModifier` is TS 5.9+; the deprecated `isTypeOnly` keeps this working when an older workspace TS resolves at runtime.
724
+ const isTypeOnly = node.importClause.phaseModifier === ts.SyntaxKind.TypeKeyword || node.importClause.isTypeOnly;
725
+ const typeModifier = isTypeOnly ? 'type ' : '';
722
726
  for (const element of namedBindings.elements) {
723
727
  const name = element.name.text;
724
728
  const alias = (_a = element.propertyName) === null || _a === void 0 ? void 0 : _a.text;
@@ -729,6 +733,8 @@ function migrateImportDeclaration(node, sourceFile) {
729
733
  const rename = TYPE_RENAMES.get(importName);
730
734
  actualImportName = rename.newName;
731
735
  }
736
+ // Per-specifier modifier, e.g. `import { type CellType, IgxGridComponent }`
737
+ const typePrefix = element.isTypeOnly ? 'type ' : '';
732
738
  const fullImport = alias ? `${actualImportName} as ${name}` : actualImportName;
733
739
  // Determine target entry point
734
740
  let targetEntryPoint = 'core'; // Default to core
@@ -742,13 +748,13 @@ function migrateImportDeclaration(node, sourceFile) {
742
748
  if (!entryPointGroups.has(targetEntryPoint)) {
743
749
  entryPointGroups.set(targetEntryPoint, []);
744
750
  }
745
- entryPointGroups.get(targetEntryPoint).push(fullImport);
751
+ entryPointGroups.get(targetEntryPoint).push({ key: actualImportName, text: `${typePrefix}${fullImport}` });
746
752
  }
747
753
  // Generate new import statements
748
754
  const newImports = [];
749
755
  for (const [entryPoint, imports] of entryPointGroups) {
750
- const sortedImports = imports.sort();
751
- newImports.push(`import { ${sortedImports.join(', ')} } from '${importPath}/${entryPoint}';`);
756
+ const sortedImports = imports.sort(sortByName).map(specifier => specifier.text);
757
+ newImports.push(`import ${typeModifier}{ ${sortedImports.join(', ')} } from '${importPath}/${entryPoint}';`);
752
758
  }
753
759
  return {
754
760
  start: node.getStart(sourceFile),
@@ -0,0 +1,175 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ const path = __importStar(require("path"));
46
+ const index_js_1 = require("@angular-devkit/schematics/testing/index.js");
47
+ const setup_spec_1 = require("../common/setup.spec");
48
+ const version = '21.0.0';
49
+ describe(`Update to ${version}`, () => {
50
+ let appTree;
51
+ const schematicRunner = new index_js_1.SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json'));
52
+ beforeEach(() => {
53
+ appTree = (0, setup_spec_1.setupTestTree)();
54
+ });
55
+ const migrationName = 'migration-51';
56
+ const filePath = '/testSrc/appPrefix/component/test.component.ts';
57
+ it('should split a root import into granular entry points', () => __awaiter(void 0, void 0, void 0, function* () {
58
+ appTree.create(filePath, `import { IgxGridComponent, IgxIconComponent, IgxColumnComponent } from 'igniteui-angular';`);
59
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
60
+ expect(tree.readContent(filePath))
61
+ .toEqual(`import { IgxGridComponent } from 'igniteui-angular/grids/grid';\n` +
62
+ `import { IgxIconComponent } from 'igniteui-angular/icon';\n` +
63
+ `import { IgxColumnComponent } from 'igniteui-angular/grids/core';`);
64
+ }));
65
+ it('should sort the exports of an entry point alphabetically', () => __awaiter(void 0, void 0, void 0, function* () {
66
+ appTree.create(filePath, `import { IgxColumnComponent, IgxCellTemplateDirective, IgxCsvExporterService } from 'igniteui-angular';`);
67
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
68
+ expect(tree.readContent(filePath))
69
+ .toEqual(`import { IgxCellTemplateDirective, IgxColumnComponent, IgxCsvExporterService } from 'igniteui-angular/grids/core';`);
70
+ }));
71
+ it('should default unmapped exports to core', () => __awaiter(void 0, void 0, void 0, function* () {
72
+ appTree.create(filePath, `import { IgxOverlayService } from 'igniteui-angular';`);
73
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
74
+ expect(tree.readContent(filePath))
75
+ .toEqual(`import { IgxOverlayService } from 'igniteui-angular/core';`);
76
+ }));
77
+ it('should preserve aliased imports', () => __awaiter(void 0, void 0, void 0, function* () {
78
+ appTree.create(filePath, `import { IgxGridComponent as Grid } from 'igniteui-angular';`);
79
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
80
+ expect(tree.readContent(filePath))
81
+ .toEqual(`import { IgxGridComponent as Grid } from 'igniteui-angular/grids/grid';`);
82
+ }));
83
+ it('should migrate imports from the licensed package', () => __awaiter(void 0, void 0, void 0, function* () {
84
+ appTree.create(filePath, `import { IgxGridComponent } from '@infragistics/igniteui-angular';`);
85
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
86
+ expect(tree.readContent(filePath))
87
+ .toEqual(`import { IgxGridComponent } from '@infragistics/igniteui-angular/grids/grid';`);
88
+ }));
89
+ it('should NOT modify imports that already use a granular entry point', () => __awaiter(void 0, void 0, void 0, function* () {
90
+ const content = `import { IgxGridComponent } from 'igniteui-angular/grids/grid';`;
91
+ appTree.create(filePath, content);
92
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
93
+ expect(tree.readContent(filePath)).toEqual(content);
94
+ }));
95
+ it('should preserve the type modifier of an import type declaration', () => __awaiter(void 0, void 0, void 0, function* () {
96
+ appTree.create(filePath, `import type { CellType, IgxGridComponent } from 'igniteui-angular';`);
97
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
98
+ expect(tree.readContent(filePath))
99
+ .toEqual(`import type { CellType } from 'igniteui-angular/grids/core';\n` +
100
+ `import type { IgxGridComponent } from 'igniteui-angular/grids/grid';`);
101
+ }));
102
+ it('should preserve a per-specifier inline type modifier', () => __awaiter(void 0, void 0, void 0, function* () {
103
+ appTree.create(filePath, `import { type CellType, IgxColumnComponent } from 'igniteui-angular';`);
104
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
105
+ expect(tree.readContent(filePath))
106
+ .toEqual(`import { type CellType, IgxColumnComponent } from 'igniteui-angular/grids/core';`);
107
+ }));
108
+ it('should split inline type specifiers into their own entry points', () => __awaiter(void 0, void 0, void 0, function* () {
109
+ appTree.create(filePath, `import { IgxGridComponent, type CellType } from 'igniteui-angular';`);
110
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
111
+ expect(tree.readContent(filePath))
112
+ .toEqual(`import { IgxGridComponent } from 'igniteui-angular/grids/grid';\n` +
113
+ `import { type CellType } from 'igniteui-angular/grids/core';`);
114
+ }));
115
+ it('should rename Direction to CarouselAnimationDirection and move it to carousel', () => __awaiter(void 0, void 0, void 0, function* () {
116
+ appTree.create(filePath, `import { Direction, IgxCarouselComponent } from 'igniteui-angular';\n` +
117
+ `export class TestComponent {\n` +
118
+ ` public animationDirection: Direction;\n` +
119
+ `}`);
120
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
121
+ expect(tree.readContent(filePath))
122
+ .toEqual(`import { CarouselAnimationDirection, IgxCarouselComponent } from 'igniteui-angular/carousel';\n` +
123
+ `export class TestComponent {\n` +
124
+ ` public animationDirection: CarouselAnimationDirection;\n` +
125
+ `}`);
126
+ }));
127
+ it('should rename a type in an import type declaration', () => __awaiter(void 0, void 0, void 0, function* () {
128
+ appTree.create(filePath, `import type { Direction } from 'igniteui-angular';\n` +
129
+ `export class TestComponent {\n` +
130
+ ` public animationDirection: Direction;\n` +
131
+ `}`);
132
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
133
+ expect(tree.readContent(filePath))
134
+ .toEqual(`import type { CarouselAnimationDirection } from 'igniteui-angular/carousel';\n` +
135
+ `export class TestComponent {\n` +
136
+ ` public animationDirection: CarouselAnimationDirection;\n` +
137
+ `}`);
138
+ }));
139
+ it('should move the button directives to directives', () => __awaiter(void 0, void 0, void 0, function* () {
140
+ appTree.create(filePath, `import { IgxButtonDirective, IgxIconButtonDirective, IgxButtonGroupComponent } from 'igniteui-angular';`);
141
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
142
+ expect(tree.readContent(filePath))
143
+ .toEqual(`import { IgxButtonDirective, IgxIconButtonDirective } from 'igniteui-angular/directives';\n` +
144
+ `import { IgxButtonGroupComponent } from 'igniteui-angular/button-group';`);
145
+ }));
146
+ it('should rename the misspelled column pattern validator directive', () => __awaiter(void 0, void 0, void 0, function* () {
147
+ appTree.create(filePath, `import { IgxColumPatternValidatorDirective } from 'igniteui-angular';`);
148
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
149
+ expect(tree.readContent(filePath))
150
+ .toEqual(`import { IgxColumnPatternValidatorDirective } from 'igniteui-angular/grids/core';`);
151
+ }));
152
+ it('should migrate a component file, leaving unrelated imports untouched', () => __awaiter(void 0, void 0, void 0, function* () {
153
+ appTree.create(filePath, `import { Component, ViewChild } from '@angular/core';\n` +
154
+ `import { IgxGridComponent, IgxColumnComponent, type CellType } from 'igniteui-angular';\n` +
155
+ `import { DATA } from '../../data/localData';\n` +
156
+ `@Component({ selector: 'app-test', template: '' })\n` +
157
+ `export class TestComponent {\n` +
158
+ ` @ViewChild(IgxGridComponent, { static: true })\n` +
159
+ ` public grid: IgxGridComponent;\n` +
160
+ ` public data = DATA;\n` +
161
+ `}`);
162
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
163
+ expect(tree.readContent(filePath))
164
+ .toEqual(`import { Component, ViewChild } from '@angular/core';\n` +
165
+ `import { IgxGridComponent } from 'igniteui-angular/grids/grid';\n` +
166
+ `import { type CellType, IgxColumnComponent } from 'igniteui-angular/grids/core';\n` +
167
+ `import { DATA } from '../../data/localData';\n` +
168
+ `@Component({ selector: 'app-test', template: '' })\n` +
169
+ `export class TestComponent {\n` +
170
+ ` @ViewChild(IgxGridComponent, { static: true })\n` +
171
+ ` public grid: IgxGridComponent;\n` +
172
+ ` public data = DATA;\n` +
173
+ `}`);
174
+ }));
175
+ });
@@ -51,6 +51,8 @@ const ENTRY_POINT_MAP = new Map([
51
51
  // IgxGridGroupByAreaComponent moved from grids/core to grids/grid
52
52
  ['IgxGridGroupByAreaComponent', 'grids/grid']
53
53
  ]);
54
+ /** Sorts specifiers alphabetically by their imported symbol name. */
55
+ const sortByName = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
54
56
  function migrateImportDeclaration(node, sourceFile) {
55
57
  var _a;
56
58
  if (!(0, tsUtils_1.igNamedImportFilter)(node)) {
@@ -65,11 +67,18 @@ function migrateImportDeclaration(node, sourceFile) {
65
67
  // Group imports by entry point
66
68
  const entryPointGroups = new Map();
67
69
  const remainingInCore = [];
70
+ // `import type { ... }` applies to the whole declaration, so it carries over to every generated import.
71
+ // `phaseModifier` is TS 5.9+; the deprecated `isTypeOnly` keeps this working when an older workspace TS resolves at runtime.
72
+ const isTypeOnly = node.importClause.phaseModifier === ts.SyntaxKind.TypeKeyword || node.importClause.isTypeOnly;
73
+ const typeModifier = isTypeOnly ? 'type ' : '';
68
74
  for (const element of namedBindings.elements) {
69
75
  const name = element.name.text;
70
76
  const alias = (_a = element.propertyName) === null || _a === void 0 ? void 0 : _a.text;
71
77
  const importName = alias || name;
72
- const fullImport = alias ? `${importName} as ${name}` : importName;
78
+ // Per-specifier modifier, e.g. `import { type CellType, IgxColumnComponent }`
79
+ const typePrefix = element.isTypeOnly ? 'type ' : '';
80
+ const specifier = alias ? `${importName} as ${name}` : importName;
81
+ const fullImport = { key: importName, text: `${typePrefix}${specifier}` };
73
82
  // Check if this import needs to be moved
74
83
  if (ENTRY_POINT_MAP.has(importName)) {
75
84
  const targetEntryPoint = ENTRY_POINT_MAP.get(importName);
@@ -91,14 +100,14 @@ function migrateImportDeclaration(node, sourceFile) {
91
100
  const newImports = [];
92
101
  // Add remaining grids/core imports first
93
102
  if (remainingInCore.length > 0) {
94
- const sortedImports = remainingInCore.sort();
95
- newImports.push(`import { ${sortedImports.join(', ')} } from '${importPath}';`);
103
+ const sortedImports = remainingInCore.sort(sortByName).map(specifier => specifier.text);
104
+ newImports.push(`import ${typeModifier}{ ${sortedImports.join(', ')} } from '${importPath}';`);
96
105
  }
97
106
  // Add moved imports
98
107
  for (const [entryPoint, imports] of entryPointGroups) {
99
- const sortedImports = imports.sort();
108
+ const sortedImports = imports.sort(sortByName).map(specifier => specifier.text);
100
109
  const basePackage = importPath.replace('/grids/core', '');
101
- newImports.push(`import { ${sortedImports.join(', ')} } from '${basePackage}/${entryPoint}';`);
110
+ newImports.push(`import ${typeModifier}{ ${sortedImports.join(', ')} } from '${basePackage}/${entryPoint}';`);
102
111
  }
103
112
  return {
104
113
  start: node.getStart(sourceFile),
@@ -0,0 +1,146 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ const path = __importStar(require("path"));
46
+ const index_js_1 = require("@angular-devkit/schematics/testing/index.js");
47
+ const setup_spec_1 = require("../common/setup.spec");
48
+ const version = '21.1.0';
49
+ describe(`Update to ${version}`, () => {
50
+ let appTree;
51
+ const schematicRunner = new index_js_1.SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json'));
52
+ beforeEach(() => {
53
+ appTree = (0, setup_spec_1.setupTestTree)();
54
+ });
55
+ const migrationName = 'migration-52';
56
+ const filePath = '/testSrc/appPrefix/component/test.component.ts';
57
+ it('should move IgxGridGroupByAreaComponent from grids/core to grids/grid', () => __awaiter(void 0, void 0, void 0, function* () {
58
+ appTree.create(filePath, `import { IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/core';`);
59
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
60
+ expect(tree.readContent(filePath))
61
+ .toEqual(`import { IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/grid';`);
62
+ }));
63
+ it('should split the moved export out, keeping the other exports in grids/core', () => __awaiter(void 0, void 0, void 0, function* () {
64
+ appTree.create(filePath, `import { IgxColumnComponent, IgxGridGroupByAreaComponent, IgxCellTemplateDirective } from 'igniteui-angular/grids/core';`);
65
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
66
+ expect(tree.readContent(filePath))
67
+ .toEqual(`import { IgxCellTemplateDirective, IgxColumnComponent } from 'igniteui-angular/grids/core';\n` +
68
+ `import { IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/grid';`);
69
+ }));
70
+ it('should preserve aliased imports', () => __awaiter(void 0, void 0, void 0, function* () {
71
+ appTree.create(filePath, `import { IgxGridGroupByAreaComponent as GroupByArea } from 'igniteui-angular/grids/core';`);
72
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
73
+ expect(tree.readContent(filePath))
74
+ .toEqual(`import { IgxGridGroupByAreaComponent as GroupByArea } from 'igniteui-angular/grids/grid';`);
75
+ }));
76
+ it('should migrate imports from the licensed package', () => __awaiter(void 0, void 0, void 0, function* () {
77
+ appTree.create(filePath, `import { IgxGridGroupByAreaComponent } from '@infragistics/igniteui-angular/grids/core';`);
78
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
79
+ expect(tree.readContent(filePath))
80
+ .toEqual(`import { IgxGridGroupByAreaComponent } from '@infragistics/igniteui-angular/grids/grid';`);
81
+ }));
82
+ it('should NOT modify grids/core imports that are not moved', () => __awaiter(void 0, void 0, void 0, function* () {
83
+ const content = `import { IgxColumnComponent } from 'igniteui-angular/grids/core';`;
84
+ appTree.create(filePath, content);
85
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
86
+ expect(tree.readContent(filePath)).toEqual(content);
87
+ }));
88
+ it('should NOT modify IgxGridGroupByAreaComponent when imported from grids/grid', () => __awaiter(void 0, void 0, void 0, function* () {
89
+ const content = `import { IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/grid';`;
90
+ appTree.create(filePath, content);
91
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
92
+ expect(tree.readContent(filePath)).toEqual(content);
93
+ }));
94
+ it('should preserve the type modifier of an import type declaration', () => __awaiter(void 0, void 0, void 0, function* () {
95
+ appTree.create(filePath, `import type { IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/core';`);
96
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
97
+ expect(tree.readContent(filePath))
98
+ .toEqual(`import type { IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/grid';`);
99
+ }));
100
+ it('should preserve the type modifier on both sides of a split import type declaration', () => __awaiter(void 0, void 0, void 0, function* () {
101
+ appTree.create(filePath, `import type { IgxColumnComponent, IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/core';`);
102
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
103
+ expect(tree.readContent(filePath))
104
+ .toEqual(`import type { IgxColumnComponent } from 'igniteui-angular/grids/core';\n` +
105
+ `import type { IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/grid';`);
106
+ }));
107
+ it('should preserve a per-specifier inline type modifier on the moved export', () => __awaiter(void 0, void 0, void 0, function* () {
108
+ appTree.create(filePath, `import { type IgxGridGroupByAreaComponent, IgxColumnComponent } from 'igniteui-angular/grids/core';`);
109
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
110
+ expect(tree.readContent(filePath))
111
+ .toEqual(`import { IgxColumnComponent } from 'igniteui-angular/grids/core';\n` +
112
+ `import { type IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/grid';`);
113
+ }));
114
+ it('should preserve a per-specifier inline type modifier on a retained export', () => __awaiter(void 0, void 0, void 0, function* () {
115
+ appTree.create(filePath, `import { IgxGridGroupByAreaComponent, type CellType, IgxColumnComponent } from 'igniteui-angular/grids/core';`);
116
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
117
+ expect(tree.readContent(filePath))
118
+ .toEqual(`import { type CellType, IgxColumnComponent } from 'igniteui-angular/grids/core';\n` +
119
+ `import { IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/grid';`);
120
+ }));
121
+ it('should migrate a component file, leaving unrelated imports untouched', () => __awaiter(void 0, void 0, void 0, function* () {
122
+ appTree.create(filePath, `import { Component, ViewChild } from '@angular/core';\n` +
123
+ `import { IgxColumnComponent, IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/core';\n` +
124
+ `import { IgxGridComponent } from 'igniteui-angular/grids/grid';\n` +
125
+ `import { DATA } from '../../data/localData';\n` +
126
+ `@Component({ selector: 'app-test', template: '' })\n` +
127
+ `export class TestComponent {\n` +
128
+ ` @ViewChild(IgxGridGroupByAreaComponent, { static: true })\n` +
129
+ ` public groupByArea: IgxGridGroupByAreaComponent;\n` +
130
+ ` public data = DATA;\n` +
131
+ `}`);
132
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
133
+ expect(tree.readContent(filePath))
134
+ .toEqual(`import { Component, ViewChild } from '@angular/core';\n` +
135
+ `import { IgxColumnComponent } from 'igniteui-angular/grids/core';\n` +
136
+ `import { IgxGridGroupByAreaComponent } from 'igniteui-angular/grids/grid';\n` +
137
+ `import { IgxGridComponent } from 'igniteui-angular/grids/grid';\n` +
138
+ `import { DATA } from '../../data/localData';\n` +
139
+ `@Component({ selector: 'app-test', template: '' })\n` +
140
+ `export class TestComponent {\n` +
141
+ ` @ViewChild(IgxGridGroupByAreaComponent, { static: true })\n` +
142
+ ` public groupByArea: IgxGridGroupByAreaComponent;\n` +
143
+ ` public data = DATA;\n` +
144
+ `}`);
145
+ }));
146
+ });
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "../../common/schema/theme-changes.schema.json",
3
+ "changes": [
4
+ {
5
+ "name": "$focus-outline-color",
6
+ "replaceWith": "$focus-shadow-color",
7
+ "owner": "chip-theme",
8
+ "type": "property"
9
+ },
10
+ {
11
+ "name": "$focus-selected-outline-color",
12
+ "replaceWith": "$focus-selected-shadow-color",
13
+ "owner": "chip-theme",
14
+ "type": "property"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,3 @@
1
+ import type { Rule } from '@angular-devkit/schematics';
2
+ declare const _default: () => Rule;
3
+ export default _default;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const UpdateChanges_1 = require("../common/UpdateChanges");
13
+ const version = '22.1.0';
14
+ exports.default = () => (host, context) => __awaiter(void 0, void 0, void 0, function* () {
15
+ context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`);
16
+ const update = new UpdateChanges_1.UpdateChanges(__dirname, host, context);
17
+ update.applyChanges();
18
+ });
@@ -0,0 +1,68 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ const path = __importStar(require("path"));
46
+ const index_js_1 = require("@angular-devkit/schematics/testing/index.js");
47
+ const setup_spec_1 = require("../common/setup.spec");
48
+ const version = '22.1.0';
49
+ describe(`Update to ${version}`, () => {
50
+ let appTree;
51
+ const schematicRunner = new index_js_1.SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json'));
52
+ beforeEach(() => {
53
+ appTree = (0, setup_spec_1.setupTestTree)();
54
+ });
55
+ const migrationName = 'migration-60';
56
+ it('should rename focus-outline-color and focus-selected-outline-color in chip-theme', () => __awaiter(void 0, void 0, void 0, function* () {
57
+ const testFilePath = `/testSrc/appPrefix/component/test.component.scss`;
58
+ appTree.create(testFilePath, `$my-chip-theme: chip-theme(
59
+ $focus-outline-color: red,
60
+ $focus-selected-outline-color: blue
61
+ );`);
62
+ const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
63
+ expect(tree.readContent(testFilePath)).toEqual(`$my-chip-theme: chip-theme(
64
+ $focus-shadow-color: red,
65
+ $focus-selected-shadow-color: blue
66
+ );`);
67
+ }));
68
+ });
@@ -0,0 +1,2 @@
1
+ import type { Rule } from '@angular-devkit/schematics';
2
+ export default function migrate(): Rule;