@angular/material 15.0.0-next.1 → 15.0.0-next.2

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 (127) hide show
  1. package/bottom-sheet/index.d.ts +2 -0
  2. package/core/_core.scss +6 -2
  3. package/core/theming/_theming.scss +19 -1
  4. package/datepicker/_datepicker-legacy-compat.scss +85 -0
  5. package/datepicker/_datepicker-theme.scss +8 -2
  6. package/datepicker/index.d.ts +21 -11
  7. package/dialog/index.d.ts +2 -0
  8. package/esm2020/bottom-sheet/bottom-sheet-config.mjs +3 -1
  9. package/esm2020/bottom-sheet/bottom-sheet-container.mjs +3 -3
  10. package/esm2020/core/version.mjs +1 -1
  11. package/esm2020/datepicker/calendar.mjs +43 -20
  12. package/esm2020/datepicker/date-range-input.mjs +10 -10
  13. package/esm2020/datepicker/datepicker-actions.mjs +2 -2
  14. package/esm2020/datepicker/datepicker-base.mjs +3 -3
  15. package/esm2020/datepicker/datepicker-input.mjs +9 -9
  16. package/esm2020/datepicker/datepicker-module.mjs +5 -5
  17. package/esm2020/datepicker/datepicker-toggle.mjs +5 -5
  18. package/esm2020/dialog/dialog-config.mjs +3 -1
  19. package/esm2020/form-field/testing/error-harness.mjs +31 -0
  20. package/esm2020/form-field/testing/form-field-harness.mjs +9 -4
  21. package/esm2020/form-field/testing/public-api.mjs +2 -1
  22. package/esm2020/legacy-autocomplete/autocomplete.mjs +5 -5
  23. package/esm2020/legacy-autocomplete/testing/autocomplete-harness.mjs +1 -1
  24. package/esm2020/legacy-button/button.mjs +4 -4
  25. package/esm2020/legacy-core/option/index.mjs +8 -8
  26. package/esm2020/legacy-core/public-api.mjs +26 -26
  27. package/esm2020/legacy-core/testing/optgroup-harness-filters.mjs +1 -1
  28. package/esm2020/legacy-core/testing/optgroup-harness.mjs +1 -1
  29. package/esm2020/legacy-core/testing/option-harness-filters.mjs +1 -1
  30. package/esm2020/legacy-core/testing/option-harness.mjs +1 -1
  31. package/esm2020/legacy-form-field/form-field.mjs +3 -3
  32. package/esm2020/legacy-form-field/testing/error-harness.mjs +26 -0
  33. package/esm2020/legacy-form-field/testing/form-field-harness.mjs +3 -1
  34. package/esm2020/legacy-form-field/testing/public-api.mjs +2 -1
  35. package/esm2020/legacy-select/select.mjs +9 -9
  36. package/esm2020/legacy-select/testing/select-harness.mjs +1 -1
  37. package/esm2020/select/select.mjs +2 -1
  38. package/esm2020/stepper/stepper.mjs +3 -3
  39. package/esm2020/tooltip/tooltip.mjs +16 -10
  40. package/fesm2015/bottom-sheet.mjs +4 -2
  41. package/fesm2015/bottom-sheet.mjs.map +1 -1
  42. package/fesm2015/core.mjs +1 -1
  43. package/fesm2015/core.mjs.map +1 -1
  44. package/fesm2015/datepicker.mjs +66 -43
  45. package/fesm2015/datepicker.mjs.map +1 -1
  46. package/fesm2015/dialog.mjs +2 -0
  47. package/fesm2015/dialog.mjs.map +1 -1
  48. package/fesm2015/form-field/testing.mjs +36 -5
  49. package/fesm2015/form-field/testing.mjs.map +1 -1
  50. package/fesm2015/legacy-autocomplete/testing.mjs.map +1 -1
  51. package/fesm2015/legacy-autocomplete.mjs +4 -4
  52. package/fesm2015/legacy-autocomplete.mjs.map +1 -1
  53. package/fesm2015/legacy-button.mjs +4 -4
  54. package/fesm2015/legacy-button.mjs.map +1 -1
  55. package/fesm2015/legacy-core/testing.mjs.map +1 -1
  56. package/fesm2015/legacy-core.mjs +1 -1
  57. package/fesm2015/legacy-core.mjs.map +1 -1
  58. package/fesm2015/legacy-form-field/testing.mjs +28 -2
  59. package/fesm2015/legacy-form-field/testing.mjs.map +1 -1
  60. package/fesm2015/legacy-form-field.mjs +2 -2
  61. package/fesm2015/legacy-form-field.mjs.map +1 -1
  62. package/fesm2015/legacy-select/testing.mjs.map +1 -1
  63. package/fesm2015/legacy-select.mjs +8 -8
  64. package/fesm2015/legacy-select.mjs.map +1 -1
  65. package/fesm2015/select.mjs +1 -0
  66. package/fesm2015/select.mjs.map +1 -1
  67. package/fesm2015/stepper.mjs +2 -2
  68. package/fesm2015/stepper.mjs.map +1 -1
  69. package/fesm2015/tooltip.mjs +16 -9
  70. package/fesm2015/tooltip.mjs.map +1 -1
  71. package/fesm2020/bottom-sheet.mjs +4 -2
  72. package/fesm2020/bottom-sheet.mjs.map +1 -1
  73. package/fesm2020/core.mjs +1 -1
  74. package/fesm2020/core.mjs.map +1 -1
  75. package/fesm2020/datepicker.mjs +66 -43
  76. package/fesm2020/datepicker.mjs.map +1 -1
  77. package/fesm2020/dialog.mjs +2 -0
  78. package/fesm2020/dialog.mjs.map +1 -1
  79. package/fesm2020/form-field/testing.mjs +39 -5
  80. package/fesm2020/form-field/testing.mjs.map +1 -1
  81. package/fesm2020/legacy-autocomplete/testing.mjs.map +1 -1
  82. package/fesm2020/legacy-autocomplete.mjs +4 -4
  83. package/fesm2020/legacy-autocomplete.mjs.map +1 -1
  84. package/fesm2020/legacy-button.mjs +4 -4
  85. package/fesm2020/legacy-button.mjs.map +1 -1
  86. package/fesm2020/legacy-core/testing.mjs.map +1 -1
  87. package/fesm2020/legacy-core.mjs +1 -1
  88. package/fesm2020/legacy-core.mjs.map +1 -1
  89. package/fesm2020/legacy-form-field/testing.mjs +28 -2
  90. package/fesm2020/legacy-form-field/testing.mjs.map +1 -1
  91. package/fesm2020/legacy-form-field.mjs +2 -2
  92. package/fesm2020/legacy-form-field.mjs.map +1 -1
  93. package/fesm2020/legacy-select/testing.mjs.map +1 -1
  94. package/fesm2020/legacy-select.mjs +8 -8
  95. package/fesm2020/legacy-select.mjs.map +1 -1
  96. package/fesm2020/select.mjs +1 -0
  97. package/fesm2020/select.mjs.map +1 -1
  98. package/fesm2020/stepper.mjs +2 -2
  99. package/fesm2020/stepper.mjs.map +1 -1
  100. package/fesm2020/tooltip.mjs +15 -9
  101. package/fesm2020/tooltip.mjs.map +1 -1
  102. package/form-field/testing/index.d.ts +36 -4
  103. package/legacy-autocomplete/testing/index.d.ts +3 -3
  104. package/legacy-button/_button-theme.scss +20 -1
  105. package/legacy-core/_core.scss +6 -2
  106. package/legacy-core/index.d.ts +132 -132
  107. package/legacy-core/testing/index.d.ts +20 -20
  108. package/legacy-form-field/testing/index.d.ts +23 -1
  109. package/legacy-prebuilt-themes/legacy-deeppurple-amber.css +1 -1
  110. package/legacy-prebuilt-themes/legacy-indigo-pink.css +1 -1
  111. package/legacy-prebuilt-themes/legacy-pink-bluegrey.css +1 -1
  112. package/legacy-prebuilt-themes/legacy-purple-green.css +1 -1
  113. package/legacy-select/testing/index.d.ts +3 -3
  114. package/package.json +2 -2
  115. package/prebuilt-themes/deeppurple-amber.css +1 -1
  116. package/prebuilt-themes/indigo-pink.css +1 -1
  117. package/prebuilt-themes/pink-bluegrey.css +1 -1
  118. package/prebuilt-themes/purple-green.css +1 -1
  119. package/schematics/ng-add/index.js +1 -1
  120. package/schematics/ng-add/index.mjs +1 -1
  121. package/schematics/ng-generate/mdc-migration/index_bundled.js +151 -66
  122. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +2 -2
  123. package/schematics/ng-generate/mdc-migration/mdc_migration_bundle_metadata.json +1 -1
  124. package/schematics/ng-update/index_bundled.js +175 -27
  125. package/schematics/ng-update/index_bundled.js.map +2 -2
  126. package/schematics/ng-update/ng_update_index_metadata.json +1 -1
  127. package/tooltip/index.d.ts +4 -4
@@ -18,7 +18,7 @@ const package_config_1 = require("./package-config");
18
18
  * Note that the fallback version range does not use caret, but tilde because that is
19
19
  * the default for Angular framework dependencies in CLI projects.
20
20
  */
21
- const fallbackMaterialVersionRange = `~15.0.0-next.0`;
21
+ const fallbackMaterialVersionRange = `~15.0.0-next.2`;
22
22
  /**
23
23
  * Schematic factory entry-point for the `ng-add` schematic. The ng-add schematic will be
24
24
  * automatically executed if developers run `ng add @angular/material`.
@@ -18,7 +18,7 @@ const package_config_1 = require("./package-config");
18
18
  * Note that the fallback version range does not use caret, but tilde because that is
19
19
  * the default for Angular framework dependencies in CLI projects.
20
20
  */
21
- const fallbackMaterialVersionRange = `~15.0.0-next.0`;
21
+ const fallbackMaterialVersionRange = `~15.0.0-next.2`;
22
22
  /**
23
23
  * Schematic factory entry-point for the `ng-add` schematic. The ng-add schematic will be
24
24
  * automatically executed if developers run `ng add @angular/material`.
@@ -21681,76 +21681,76 @@ var ts = __toESM(require("typescript"));
21681
21681
  // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/ts-migration/import-replacements.js
21682
21682
  var IMPORT_REPLACEMENTS = {
21683
21683
  "button": {
21684
- old: "@angular/material/button",
21685
- new: "@angular/material-experimental/mdc-button"
21684
+ old: "@angular/material/legacy-button",
21685
+ new: "@angular/material/button"
21686
21686
  },
21687
21687
  "card": {
21688
- old: "@angular/material/card",
21689
- new: "@angular/material-experimental/mdc-card"
21688
+ old: "@angular/material/legacy-card",
21689
+ new: "@angular/material/card"
21690
21690
  },
21691
21691
  "checkbox": {
21692
21692
  old: "@angular/material/legacy-checkbox",
21693
21693
  new: "@angular/material/checkbox"
21694
21694
  },
21695
21695
  "chips": {
21696
- old: "@angular/material/chips",
21697
- new: "@angular/material-experimental/mdc-chips"
21696
+ old: "@angular/material/legacy-chips",
21697
+ new: "@angular/material/chips"
21698
21698
  },
21699
21699
  "dialog": {
21700
21700
  old: "@angular/material/legacy-dialog",
21701
21701
  new: "@angular/material/dialog"
21702
21702
  },
21703
21703
  "autocomplete": {
21704
- old: "@angular/material/autocomplete",
21705
- new: "@angular/material-experimental/mdc-autocomplete"
21704
+ old: "@angular/material/legacy-autocomplete",
21705
+ new: "@angular/material/autocomplete"
21706
21706
  },
21707
21707
  "form-field": {
21708
- old: "@angular/material/form-field",
21709
- new: "@angular/material-experimental/mdc-form-field"
21708
+ old: "@angular/material/legacy-form-field",
21709
+ new: "@angular/material/form-field"
21710
21710
  },
21711
21711
  "input": {
21712
- old: "@angular/material/input",
21713
- new: "@angular/material-experimental/mdc-input"
21712
+ old: "@angular/material/legacy-input",
21713
+ new: "@angular/material/input"
21714
21714
  },
21715
21715
  "select": {
21716
- old: "@angular/material/select",
21717
- new: "@angular/material-experimental/mdc-select"
21716
+ old: "@angular/material/legacy-select",
21717
+ new: "@angular/material/select"
21718
21718
  },
21719
21719
  "core": {
21720
- old: "@angular/material/core",
21720
+ old: "@angular/material/legacy-core",
21721
21721
  new: "@angular/material/core"
21722
21722
  },
21723
21723
  "list": {
21724
- old: "@angular/material/list",
21725
- new: "@angular/material-experimental/mdc-list"
21724
+ old: "@angular/material/legacy-list",
21725
+ new: "@angular/material/list"
21726
21726
  },
21727
21727
  "menu": {
21728
- old: "@angular/material/menu",
21729
- new: "@angular/material-experimental/mdc-menu"
21728
+ old: "@angular/material/legacy-menu",
21729
+ new: "@angular/material/menu"
21730
21730
  },
21731
21731
  "progress-bar": {
21732
- old: "@angular/material/progress-bar",
21733
- new: "@angular/material-experimental/mdc-progress-bar"
21732
+ old: "@angular/material/legacy-progress-bar",
21733
+ new: "@angular/material/progress-bar"
21734
21734
  },
21735
21735
  "progress-spinner": {
21736
21736
  old: "@angular/material/legacy-progress-spinner",
21737
21737
  new: "@angular/material/progress-spinner"
21738
21738
  },
21739
21739
  "radio": {
21740
- old: "@angular/material/radio",
21741
- new: "@angular/material-experimental/mdc-radio"
21740
+ old: "@angular/material/legacy-radio",
21741
+ new: "@angular/material/radio"
21742
21742
  },
21743
21743
  "sidenav": {
21744
- old: "@angular/material/sidenav",
21745
- new: "@angular/material-experimental/mdc-sidenav"
21744
+ old: "@angular/material/legacy-sidenav",
21745
+ new: "@angular/material-experimental/legacy-sidenav"
21746
21746
  },
21747
21747
  "slide-toggle": {
21748
21748
  old: "@angular/material/legacy-slide-toggle",
21749
21749
  new: "@angular/material/slide-toggle"
21750
21750
  },
21751
21751
  "slider": {
21752
- old: "@angular/material/slider",
21753
- new: "@angular/material-experimental/mdc-slider"
21752
+ old: "@angular/material/legacy-slider",
21753
+ new: "@angular/material/slider"
21754
21754
  },
21755
21755
  "snack-bar": {
21756
21756
  old: "@angular/material/legacy-snack-bar",
@@ -21769,8 +21769,8 @@ var IMPORT_REPLACEMENTS = {
21769
21769
  new: "@angular/material/paginator"
21770
21770
  },
21771
21771
  "tooltip": {
21772
- old: "@angular/material/tooltip",
21773
- new: "@angular/material-experimental/mdc-tooltip"
21772
+ old: "@angular/material/legacy-tooltip",
21773
+ new: "@angular/material/tooltip"
21774
21774
  }
21775
21775
  };
21776
21776
 
@@ -21780,6 +21780,42 @@ var RuntimeMigrator = class {
21780
21780
  const replacements = IMPORT_REPLACEMENTS[component];
21781
21781
  this.oldImportModule = replacements.old;
21782
21782
  this.newImportModule = replacements.new;
21783
+ const firstLetterCapitalizedComponent = component[0].toUpperCase() + component.slice(1);
21784
+ const capitalizedComponent = component.toUpperCase();
21785
+ this.importSpecifierReplacements = [
21786
+ {
21787
+ old: "MatLegacy" + firstLetterCapitalizedComponent,
21788
+ new: "Mat" + firstLetterCapitalizedComponent
21789
+ },
21790
+ {
21791
+ old: "MAT_LEGACY_" + capitalizedComponent,
21792
+ new: "MAT_" + capitalizedComponent
21793
+ }
21794
+ ];
21795
+ }
21796
+ updateImportOrExportSpecifier(specifier) {
21797
+ const newSpecifier = this._getNewSpecifier(specifier);
21798
+ if (!newSpecifier) {
21799
+ return null;
21800
+ }
21801
+ return ts.factory.createIdentifier(newSpecifier);
21802
+ }
21803
+ updateImportSpecifierWithPossibleAlias(importSpecifier) {
21804
+ var _a;
21805
+ const newImport = this._getNewSpecifier((_a = importSpecifier.propertyName) != null ? _a : importSpecifier.name);
21806
+ if (!newImport) {
21807
+ return null;
21808
+ }
21809
+ let newPropertyName;
21810
+ let newName;
21811
+ if (importSpecifier.propertyName && importSpecifier.name.text !== newImport) {
21812
+ newPropertyName = ts.factory.createIdentifier(newImport);
21813
+ newName = importSpecifier.name;
21814
+ } else {
21815
+ newPropertyName = void 0;
21816
+ newName = ts.factory.createIdentifier(newImport);
21817
+ }
21818
+ return ts.factory.createImportSpecifier(false, newPropertyName, newName);
21783
21819
  }
21784
21820
  updateModuleSpecifier(specifier) {
21785
21821
  if (specifier.text !== this.oldImportModule) {
@@ -21787,6 +21823,15 @@ var RuntimeMigrator = class {
21787
21823
  }
21788
21824
  return ts.factory.createStringLiteral(this.newImportModule, this._isSingleQuoteLiteral(specifier));
21789
21825
  }
21826
+ _getNewSpecifier(node) {
21827
+ let newImport = null;
21828
+ this.importSpecifierReplacements.forEach((replacement) => {
21829
+ if (node.text.match(replacement.old)) {
21830
+ newImport = node.text.replace(replacement.old, replacement.new);
21831
+ }
21832
+ });
21833
+ return newImport;
21834
+ }
21790
21835
  _isSingleQuoteLiteral(literal2) {
21791
21836
  return literal2.getText()[0] !== `"`;
21792
21837
  }
@@ -22183,35 +22228,58 @@ var RuntimeCodeMigration = class extends import_schematics3.Migration {
22183
22228
  } else if (this._isTypeImportExpression(node)) {
22184
22229
  this._migrateModuleSpecifier(node.argument.literal);
22185
22230
  } else if (ts2.isImportDeclaration(node)) {
22186
- this._migrateModuleSpecifier(node.moduleSpecifier);
22187
- } else if (this._isComponentDecorator(node)) {
22188
- this._migrateTemplatesAndStyles(node);
22231
+ this._migrateModuleSpecifier(node.moduleSpecifier, node.importClause);
22232
+ } else if (ts2.isDecorator(node) && (this._isNgModuleDecorator(node) || this._isComponentDecorator(node))) {
22233
+ this._migrateDecoratorProperties(node);
22189
22234
  }
22190
22235
  }
22191
- _migrateTemplatesAndStyles(node) {
22192
- if (node.getChildCount() > 0) {
22193
- if (node.kind === ts2.SyntaxKind.PropertyAssignment) {
22194
- const identifier = node.getChildAt(0);
22195
- if (identifier.getText() === "styles") {
22196
- this._migrateStyles(node);
22197
- } else if (this._hasPossibleTemplateMigrations && identifier.getText() === "template") {
22198
- this._migrateTemplate(node);
22236
+ _migrateDecoratorProperties(node) {
22237
+ if (!ts2.isCallExpression(node.expression)) {
22238
+ return;
22239
+ }
22240
+ const metadata = node.expression.arguments[0];
22241
+ if (!ts2.isObjectLiteralExpression(metadata)) {
22242
+ return;
22243
+ }
22244
+ for (const prop of metadata.properties) {
22245
+ if (prop.name) {
22246
+ switch ((0, import_schematics3.getPropertyNameText)(prop.name)) {
22247
+ case "imports":
22248
+ this._migrateImportsAndExports(prop);
22249
+ break;
22250
+ case "exports":
22251
+ this._migrateImportsAndExports(prop);
22252
+ break;
22253
+ case "styles":
22254
+ this._migrateStyles(prop);
22255
+ break;
22256
+ case "template":
22257
+ if (this._hasPossibleTemplateMigrations) {
22258
+ this._migrateTemplate(prop);
22259
+ }
22260
+ break;
22199
22261
  }
22200
- } else {
22201
- node.forEachChild((child) => this._migrateTemplatesAndStyles(child));
22202
22262
  }
22203
22263
  }
22204
22264
  }
22265
+ _migrateImportsAndExports(node) {
22266
+ node.initializer.forEachChild((specifier) => {
22267
+ var _a;
22268
+ for (const migrator of this.upgradeData) {
22269
+ const newSpecifier = (_a = migrator.runtime) == null ? void 0 : _a.updateImportOrExportSpecifier(specifier);
22270
+ if (newSpecifier) {
22271
+ this._printAndUpdateNode(specifier.getSourceFile(), specifier, newSpecifier);
22272
+ break;
22273
+ }
22274
+ }
22275
+ });
22276
+ }
22205
22277
  _migrateStyles(node) {
22206
22278
  if (!this._stylesMigration) {
22207
22279
  this._stylesMigration = new ThemingStylesMigration(this.program, this.typeChecker, this.targetVersion, this.context, this.upgradeData, this.fileSystem, this.logger);
22208
22280
  }
22209
- node.forEachChild((childNode) => {
22210
- if (childNode.kind === ts2.SyntaxKind.ArrayLiteralExpression) {
22211
- childNode.forEachChild((stringLiteralNode) => {
22212
- this._migratePropertyAssignment(stringLiteralNode, this._stylesMigration);
22213
- });
22214
- }
22281
+ node.initializer.forEachChild((stringLiteralNode) => {
22282
+ this._migratePropertyAssignment(stringLiteralNode, this._stylesMigration);
22215
22283
  });
22216
22284
  }
22217
22285
  _migrateTemplate(node) {
@@ -22224,36 +22292,42 @@ var RuntimeCodeMigration = class extends import_schematics3.Migration {
22224
22292
  this._templateMigration = new TemplateMigration(this.program, this.typeChecker, this.targetVersion, this.context, templateUpgradeData, this.fileSystem, this.logger);
22225
22293
  }
22226
22294
  }
22227
- node.forEachChild((childNode) => {
22228
- this._migratePropertyAssignment(childNode, this._templateMigration);
22229
- });
22295
+ this._migratePropertyAssignment(node.initializer, this._templateMigration);
22230
22296
  }
22231
22297
  _migratePropertyAssignment(node, migration) {
22232
- if (node.kind === ts2.SyntaxKind.StringLiteral || node.kind === ts2.SyntaxKind.NoSubstitutionTemplateLiteral) {
22233
- let nodeText = node.getText();
22234
- const trimmedNodeText = nodeText.trimStart().trimEnd();
22235
- const nodeTextWithoutQuotes = trimmedNodeText.substring(1, trimmedNodeText.length - 1);
22236
- const migratedText = migration.migrate(nodeTextWithoutQuotes);
22237
- const migratedTextLines = migratedText.split("\n");
22238
- const isMultiline = migratedTextLines.length > 1;
22239
- if (isMultiline) {
22240
- nodeText = nodeText.replace(trimmedNodeText, "`" + nodeTextWithoutQuotes + "`");
22241
- }
22242
- this._printAndUpdateNode(node.getSourceFile(), node, ts2.factory.createRegularExpressionLiteral(nodeText.replace(nodeTextWithoutQuotes, migratedTextLines.map((line, index2) => {
22243
- if (isMultiline && index2 !== 0 && line != "\n") {
22298
+ let migratedText = migration.migrate(node.text);
22299
+ let migratedTextLines = migratedText.split("\n");
22300
+ if (migratedTextLines.length > 1) {
22301
+ migratedText = migratedTextLines.map((line, index2) => {
22302
+ if (index2 !== 0 && line != "\n") {
22244
22303
  const leadingWidth = node.getLeadingTriviaWidth();
22245
22304
  if (leadingWidth > 0) {
22246
22305
  line = " ".repeat(leadingWidth - 1) + line;
22247
22306
  }
22248
22307
  }
22249
22308
  return line;
22250
- }).join("\n"))));
22309
+ }).join("\n");
22310
+ migratedText = "`" + migratedText + "`";
22311
+ } else {
22312
+ const quotation = node.getText().trimStart()[0];
22313
+ migratedText = quotation + migratedText + quotation;
22251
22314
  }
22315
+ this._printAndUpdateNode(node.getSourceFile(), node, ts2.factory.createRegularExpressionLiteral(migratedText));
22252
22316
  }
22253
- _migrateModuleSpecifier(specifierLiteral) {
22317
+ _migrateModuleSpecifier(specifierLiteral, importClause) {
22254
22318
  var _a, _b;
22255
22319
  const sourceFile = specifierLiteral.getSourceFile();
22256
22320
  for (const migrator of this.upgradeData) {
22321
+ if (importClause && importClause.namedBindings) {
22322
+ const importSpecifiers = importClause.namedBindings.elements;
22323
+ importSpecifiers.forEach((importSpecifer) => {
22324
+ var _a2;
22325
+ const newImportSpecifier = (_a2 = migrator.runtime) == null ? void 0 : _a2.updateImportSpecifierWithPossibleAlias(importSpecifer);
22326
+ if (newImportSpecifier) {
22327
+ this._printAndUpdateNode(sourceFile, importSpecifer, newImportSpecifier);
22328
+ }
22329
+ });
22330
+ }
22257
22331
  const newModuleSpecifier = (_b = (_a = migrator.runtime) == null ? void 0 : _a.updateModuleSpecifier(specifierLiteral)) != null ? _b : null;
22258
22332
  if (newModuleSpecifier !== null) {
22259
22333
  this._printAndUpdateNode(sourceFile, specifierLiteral, newModuleSpecifier);
@@ -22261,8 +22335,19 @@ var RuntimeCodeMigration = class extends import_schematics3.Migration {
22261
22335
  }
22262
22336
  }
22263
22337
  }
22338
+ _isNgModuleDecorator(node) {
22339
+ const call = node.expression;
22340
+ if (!ts2.isCallExpression(call) || !ts2.isIdentifier(call.expression)) {
22341
+ return false;
22342
+ }
22343
+ return call.expression.text === "NgModule";
22344
+ }
22264
22345
  _isComponentDecorator(node) {
22265
- return node.kind === ts2.SyntaxKind.Decorator && node.getText().startsWith("@Component");
22346
+ const call = node.expression;
22347
+ if (!ts2.isCallExpression(call) || !ts2.isIdentifier(call.expression)) {
22348
+ return false;
22349
+ }
22350
+ return call.expression.text === "Component";
22266
22351
  }
22267
22352
  _isImportExpression(node) {
22268
22353
  return ts2.isCallExpression(node) && node.expression.kind === ts2.SyntaxKind.ImportKeyword && node.arguments.length === 1 && ts2.isStringLiteralLike(node.arguments[0]);