@openrewrite/recipes-angular 1.27.0 → 1.28.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/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +188 -1
- package/dist/index.js.map +1 -1
- package/dist/libraries/components/lst.d.ts +7 -0
- package/dist/libraries/components/lst.d.ts.map +1 -1
- package/dist/libraries/components/lst.js +12 -0
- package/dist/libraries/components/lst.js.map +1 -1
- package/dist/libraries/components/style-sources.d.ts +15 -0
- package/dist/libraries/components/style-sources.d.ts.map +1 -0
- package/dist/libraries/components/style-sources.js +108 -0
- package/dist/libraries/components/style-sources.js.map +1 -0
- package/dist/libraries/components/stylesheets.d.ts +12 -0
- package/dist/libraries/components/stylesheets.d.ts.map +1 -1
- package/dist/libraries/components/stylesheets.js +37 -1
- package/dist/libraries/components/stylesheets.js.map +1 -1
- package/dist/libraries/components/symbols.d.ts +21 -1
- package/dist/libraries/components/symbols.d.ts.map +1 -1
- package/dist/libraries/components/symbols.js +124 -9
- package/dist/libraries/components/symbols.js.map +1 -1
- package/dist/libraries/components/template-elements.d.ts +38 -0
- package/dist/libraries/components/template-elements.d.ts.map +1 -0
- package/dist/libraries/components/template-elements.js +90 -0
- package/dist/libraries/components/template-elements.js.map +1 -0
- package/dist/libraries/components/templates.d.ts +6 -0
- package/dist/libraries/components/templates.d.ts.map +1 -1
- package/dist/libraries/components/templates.js +17 -2
- package/dist/libraries/components/templates.js.map +1 -1
- package/dist/libraries/material/add-system-variables-prefix.d.ts +9 -0
- package/dist/libraries/material/add-system-variables-prefix.d.ts.map +1 -0
- package/dist/libraries/material/add-system-variables-prefix.js +74 -0
- package/dist/libraries/material/add-system-variables-prefix.js.map +1 -0
- package/dist/libraries/material/add-theme-base-mixins.d.ts +19 -0
- package/dist/libraries/material/add-theme-base-mixins.d.ts.map +1 -0
- package/dist/libraries/material/add-theme-base-mixins.js +176 -0
- package/dist/libraries/material/add-theme-base-mixins.js.map +1 -0
- package/dist/libraries/material/find-chip-input-event-without-chip-input.d.ts +8 -0
- package/dist/libraries/material/find-chip-input-event-without-chip-input.d.ts.map +1 -0
- package/dist/libraries/material/find-chip-input-event-without-chip-input.js +95 -0
- package/dist/libraries/material/find-chip-input-event-without-chip-input.js.map +1 -0
- package/dist/libraries/material/find-legacy-material-usage.d.ts +8 -0
- package/dist/libraries/material/find-legacy-material-usage.d.ts.map +1 -0
- package/dist/libraries/material/find-legacy-material-usage.js +103 -0
- package/dist/libraries/material/find-legacy-material-usage.js.map +1 -0
- package/dist/libraries/material/find-material-constructor-changes.d.ts +74 -0
- package/dist/libraries/material/find-material-constructor-changes.d.ts.map +1 -0
- package/dist/libraries/material/find-material-constructor-changes.js +267 -0
- package/dist/libraries/material/find-material-constructor-changes.js.map +1 -0
- package/dist/libraries/material/find-mdc-breaking-changes.d.ts +45 -0
- package/dist/libraries/material/find-mdc-breaking-changes.d.ts.map +1 -0
- package/dist/libraries/material/find-mdc-breaking-changes.js +326 -0
- package/dist/libraries/material/find-mdc-breaking-changes.js.map +1 -0
- package/dist/libraries/material/find-mixin-error-state-without-state-changes.d.ts +8 -0
- package/dist/libraries/material/find-mixin-error-state-without-state-changes.d.ts.map +1 -0
- package/dist/libraries/material/find-mixin-error-state-without-state-changes.js +125 -0
- package/dist/libraries/material/find-mixin-error-state-without-state-changes.js.map +1 -0
- package/dist/libraries/material/find-raw-palette-themes.d.ts +28 -0
- package/dist/libraries/material/find-raw-palette-themes.d.ts.map +1 -0
- package/dist/libraries/material/find-raw-palette-themes.js +124 -0
- package/dist/libraries/material/find-raw-palette-themes.js.map +1 -0
- package/dist/libraries/material/find-removed-material-apis.d.ts +20 -0
- package/dist/libraries/material/find-removed-material-apis.d.ts.map +1 -0
- package/dist/libraries/material/find-removed-material-apis.js +60 -0
- package/dist/libraries/material/find-removed-material-apis.js.map +1 -0
- package/dist/libraries/material/find-removed-material-classes.d.ts +13 -0
- package/dist/libraries/material/find-removed-material-classes.d.ts.map +1 -0
- package/dist/libraries/material/find-removed-material-classes.js +154 -0
- package/dist/libraries/material/find-removed-material-classes.js.map +1 -0
- package/dist/libraries/material/find-removed-material-members.d.ts +67 -0
- package/dist/libraries/material/find-removed-material-members.d.ts.map +1 -0
- package/dist/libraries/material/find-removed-material-members.js +168 -0
- package/dist/libraries/material/find-removed-material-members.js.map +1 -0
- package/dist/libraries/material/find-slide-toggle-drag-options.d.ts +8 -0
- package/dist/libraries/material/find-slide-toggle-drag-options.d.ts.map +1 -0
- package/dist/libraries/material/find-slide-toggle-drag-options.js +102 -0
- package/dist/libraries/material/find-slide-toggle-drag-options.js.map +1 -0
- package/dist/libraries/material/material-15-classes.d.ts +6 -0
- package/dist/libraries/material/material-15-classes.d.ts.map +1 -0
- package/dist/libraries/material/material-15-classes.js +435 -0
- package/dist/libraries/material/material-15-classes.js.map +1 -0
- package/dist/libraries/material/material-entry-points.d.ts +3 -0
- package/dist/libraries/material/material-entry-points.d.ts.map +1 -0
- package/dist/libraries/material/material-entry-points.js +201 -0
- package/dist/libraries/material/material-entry-points.js.map +1 -0
- package/dist/libraries/material/material-legacy-symbols.d.ts +2 -0
- package/dist/libraries/material/material-legacy-symbols.d.ts.map +1 -0
- package/dist/libraries/material/material-legacy-symbols.js +559 -0
- package/dist/libraries/material/material-legacy-symbols.js.map +1 -0
- package/dist/libraries/material/material-theming-api.d.ts +23 -0
- package/dist/libraries/material/material-theming-api.d.ts.map +1 -0
- package/dist/libraries/material/material-theming-api.js +446 -0
- package/dist/libraries/material/material-theming-api.js.map +1 -0
- package/dist/libraries/material/material-version.d.ts +24 -0
- package/dist/libraries/material/material-version.d.ts.map +1 -0
- package/dist/libraries/material/material-version.js +160 -0
- package/dist/libraries/material/material-version.js.map +1 -0
- package/dist/libraries/material/migrate-legacy-material.d.ts +60 -0
- package/dist/libraries/material/migrate-legacy-material.d.ts.map +1 -0
- package/dist/libraries/material/migrate-legacy-material.js +230 -0
- package/dist/libraries/material/migrate-legacy-material.js.map +1 -0
- package/dist/libraries/material/migrate-list-item-harness-content-loader.d.ts +8 -0
- package/dist/libraries/material/migrate-list-item-harness-content-loader.d.ts.map +1 -0
- package/dist/libraries/material/migrate-list-item-harness-content-loader.js +62 -0
- package/dist/libraries/material/migrate-list-item-harness-content-loader.js.map +1 -0
- package/dist/libraries/material/migrate-m2-theming-api.d.ts +12 -0
- package/dist/libraries/material/migrate-m2-theming-api.d.ts.map +1 -0
- package/dist/libraries/material/migrate-m2-theming-api.js +120 -0
- package/dist/libraries/material/migrate-m2-theming-api.js.map +1 -0
- package/dist/libraries/material/migrate-mat-core-to-elevation-classes.d.ts +9 -0
- package/dist/libraries/material/migrate-mat-core-to-elevation-classes.d.ts.map +1 -0
- package/dist/libraries/material/migrate-mat-core-to-elevation-classes.js +36 -0
- package/dist/libraries/material/migrate-mat-core-to-elevation-classes.js.map +1 -0
- package/dist/libraries/material/migrate-material-15-typography.d.ts +21 -0
- package/dist/libraries/material/migrate-material-15-typography.d.ts.map +1 -0
- package/dist/libraries/material/migrate-material-15-typography.js +185 -0
- package/dist/libraries/material/migrate-material-15-typography.js.map +1 -0
- package/dist/libraries/material/migrate-material-secondary-entry-points.d.ts +8 -0
- package/dist/libraries/material/migrate-material-secondary-entry-points.d.ts.map +1 -0
- package/dist/libraries/material/migrate-material-secondary-entry-points.js +157 -0
- package/dist/libraries/material/migrate-material-secondary-entry-points.js.map +1 -0
- package/dist/libraries/material/migrate-material-theming-api.d.ts +17 -0
- package/dist/libraries/material/migrate-material-theming-api.d.ts.map +1 -0
- package/dist/libraries/material/migrate-material-theming-api.js +190 -0
- package/dist/libraries/material/migrate-material-theming-api.js.map +1 -0
- package/dist/libraries/material/migrate-mdc-styles.d.ts +23 -0
- package/dist/libraries/material/migrate-mdc-styles.d.ts.map +1 -0
- package/dist/libraries/material/migrate-mdc-styles.js +145 -0
- package/dist/libraries/material/migrate-mdc-styles.js.map +1 -0
- package/dist/libraries/material/migrate-mdc-templates.d.ts +18 -0
- package/dist/libraries/material/migrate-mdc-templates.d.ts.map +1 -0
- package/dist/libraries/material/migrate-mdc-templates.js +306 -0
- package/dist/libraries/material/migrate-mdc-templates.js.map +1 -0
- package/dist/libraries/material/migrate-selection-list-change-option.d.ts +8 -0
- package/dist/libraries/material/migrate-selection-list-change-option.d.ts.map +1 -0
- package/dist/libraries/material/migrate-selection-list-change-option.js +49 -0
- package/dist/libraries/material/migrate-selection-list-change-option.js.map +1 -0
- package/dist/libraries/material/remove-mat-stepper-document-argument.d.ts +8 -0
- package/dist/libraries/material/remove-mat-stepper-document-argument.d.ts.map +1 -0
- package/dist/libraries/material/remove-mat-stepper-document-argument.js +72 -0
- package/dist/libraries/material/remove-mat-stepper-document-argument.js.map +1 -0
- package/dist/libraries/material/remove-update-active-link-argument.d.ts +8 -0
- package/dist/libraries/material/remove-update-active-link-argument.d.ts.map +1 -0
- package/dist/libraries/material/remove-update-active-link-argument.js +54 -0
- package/dist/libraries/material/remove-update-active-link-argument.js.map +1 -0
- package/dist/libraries/material/rename-material-members.d.ts +51 -0
- package/dist/libraries/material/rename-material-members.d.ts.map +1 -0
- package/dist/libraries/material/rename-material-members.js +125 -0
- package/dist/libraries/material/rename-material-members.js.map +1 -0
- package/dist/libraries/material/rename-material-style-names.d.ts +28 -0
- package/dist/libraries/material/rename-material-style-names.d.ts.map +1 -0
- package/dist/libraries/material/rename-material-style-names.js +148 -0
- package/dist/libraries/material/rename-material-style-names.js.map +1 -0
- package/dist/libraries/material/rename-textarea-autosize-attributes.d.ts +20 -0
- package/dist/libraries/material/rename-textarea-autosize-attributes.d.ts.map +1 -0
- package/dist/libraries/material/rename-textarea-autosize-attributes.js +32 -0
- package/dist/libraries/material/rename-textarea-autosize-attributes.js.map +1 -0
- package/dist/libraries/material/upgrade-to-material.d.ts +74 -0
- package/dist/libraries/material/upgrade-to-material.d.ts.map +1 -0
- package/dist/libraries/material/upgrade-to-material.js +324 -0
- package/dist/libraries/material/upgrade-to-material.js.map +1 -0
- package/dist/migration/upgrade-angular-dependencies.d.ts +2 -0
- package/dist/migration/upgrade-angular-dependencies.d.ts.map +1 -1
- package/dist/migration/upgrade-angular-dependencies.js +6 -0
- package/dist/migration/upgrade-angular-dependencies.js.map +1 -1
- package/dist/migration/upgrade-to-angular-10.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-10.js +5 -1
- package/dist/migration/upgrade-to-angular-10.js.map +1 -1
- package/dist/migration/upgrade-to-angular-11.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-11.js +10 -1
- package/dist/migration/upgrade-to-angular-11.js.map +1 -1
- package/dist/migration/upgrade-to-angular-12.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-12.js +5 -1
- package/dist/migration/upgrade-to-angular-12.js.map +1 -1
- package/dist/migration/upgrade-to-angular-13.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-13.js +5 -1
- package/dist/migration/upgrade-to-angular-13.js.map +1 -1
- package/dist/migration/upgrade-to-angular-14.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-14.js +5 -1
- package/dist/migration/upgrade-to-angular-14.js.map +1 -1
- package/dist/migration/upgrade-to-angular-15.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-15.js +5 -1
- package/dist/migration/upgrade-to-angular-15.js.map +1 -1
- package/dist/migration/upgrade-to-angular-16.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-16.js +2 -1
- package/dist/migration/upgrade-to-angular-16.js.map +1 -1
- package/dist/migration/upgrade-to-angular-17.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-17.js +5 -1
- package/dist/migration/upgrade-to-angular-17.js.map +1 -1
- package/dist/migration/upgrade-to-angular-18.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-18.js +5 -1
- package/dist/migration/upgrade-to-angular-18.js.map +1 -1
- package/dist/migration/upgrade-to-angular-19.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-19.js +5 -1
- package/dist/migration/upgrade-to-angular-19.js.map +1 -1
- package/dist/migration/upgrade-to-angular-20.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-20.js +5 -1
- package/dist/migration/upgrade-to-angular-20.js.map +1 -1
- package/dist/migration/upgrade-to-angular-21.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-21.js +2 -1
- package/dist/migration/upgrade-to-angular-21.js.map +1 -1
- package/dist/migration/upgrade-to-angular-22.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-22.js +2 -1
- package/dist/migration/upgrade-to-angular-22.js.map +1 -1
- package/dist/migration/upgrade-to-angular-8.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-8.js +6 -1
- package/dist/migration/upgrade-to-angular-8.js.map +1 -1
- package/dist/migration/upgrade-to-angular-9.d.ts.map +1 -1
- package/dist/migration/upgrade-to-angular-9.js +5 -1
- package/dist/migration/upgrade-to-angular-9.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +189 -0
- package/src/libraries/components/lst.ts +13 -2
- package/src/libraries/components/style-sources.ts +80 -0
- package/src/libraries/components/stylesheets.ts +37 -0
- package/src/libraries/components/symbols.ts +95 -10
- package/src/libraries/components/template-elements.ts +113 -0
- package/src/libraries/components/templates.ts +18 -4
- package/src/libraries/material/add-system-variables-prefix.ts +71 -0
- package/src/libraries/material/add-theme-base-mixins.ts +159 -0
- package/src/libraries/material/find-chip-input-event-without-chip-input.ts +63 -0
- package/src/libraries/material/find-legacy-material-usage.ts +73 -0
- package/src/libraries/material/find-material-constructor-changes.ts +231 -0
- package/src/libraries/material/find-mdc-breaking-changes.ts +273 -0
- package/src/libraries/material/find-mixin-error-state-without-state-changes.ts +89 -0
- package/src/libraries/material/find-raw-palette-themes.ts +100 -0
- package/src/libraries/material/find-removed-material-apis.ts +54 -0
- package/src/libraries/material/find-removed-material-classes.ts +127 -0
- package/src/libraries/material/find-removed-material-members.ts +146 -0
- package/src/libraries/material/find-slide-toggle-drag-options.ts +69 -0
- package/src/libraries/material/material-15-classes.ts +435 -0
- package/src/libraries/material/material-entry-points.ts +198 -0
- package/src/libraries/material/material-legacy-symbols.ts +557 -0
- package/src/libraries/material/material-theming-api.ts +454 -0
- package/src/libraries/material/material-version.ts +142 -0
- package/src/libraries/material/migrate-legacy-material.ts +202 -0
- package/src/libraries/material/migrate-list-item-harness-content-loader.ts +39 -0
- package/src/libraries/material/migrate-m2-theming-api.ts +98 -0
- package/src/libraries/material/migrate-mat-core-to-elevation-classes.ts +32 -0
- package/src/libraries/material/migrate-material-15-typography.ts +153 -0
- package/src/libraries/material/migrate-material-secondary-entry-points.ts +154 -0
- package/src/libraries/material/migrate-material-theming-api.ts +189 -0
- package/src/libraries/material/migrate-mdc-styles.ts +117 -0
- package/src/libraries/material/migrate-mdc-templates.ts +269 -0
- package/src/libraries/material/migrate-selection-list-change-option.ts +28 -0
- package/src/libraries/material/remove-mat-stepper-document-argument.ts +44 -0
- package/src/libraries/material/remove-update-active-link-argument.ts +33 -0
- package/src/libraries/material/rename-material-members.ts +109 -0
- package/src/libraries/material/rename-material-style-names.ts +116 -0
- package/src/libraries/material/rename-textarea-autosize-attributes.ts +27 -0
- package/src/libraries/material/upgrade-to-material.ts +286 -0
- package/src/migration/upgrade-angular-dependencies.ts +6 -0
- package/src/migration/upgrade-to-angular-10.ts +6 -2
- package/src/migration/upgrade-to-angular-11.ts +11 -2
- package/src/migration/upgrade-to-angular-12.ts +6 -2
- package/src/migration/upgrade-to-angular-13.ts +6 -2
- package/src/migration/upgrade-to-angular-14.ts +6 -2
- package/src/migration/upgrade-to-angular-15.ts +6 -2
- package/src/migration/upgrade-to-angular-16.ts +3 -2
- package/src/migration/upgrade-to-angular-17.ts +6 -2
- package/src/migration/upgrade-to-angular-18.ts +6 -2
- package/src/migration/upgrade-to-angular-19.ts +6 -2
- package/src/migration/upgrade-to-angular-20.ts +6 -2
- package/src/migration/upgrade-to-angular-21.ts +3 -2
- package/src/migration/upgrade-to-angular-22.ts +3 -2
- package/src/migration/upgrade-to-angular-8.ts +6 -1
- package/src/migration/upgrade-to-angular-9.ts +6 -2
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 the original author or authors.
|
|
3
|
+
*
|
|
4
|
+
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {ExecutionContext, foundSearchResult, ScanningRecipe, TreeVisitor} from "@openrewrite/rewrite";
|
|
8
|
+
import {JavaScriptVisitor, JS} from "@openrewrite/rewrite/javascript";
|
|
9
|
+
import {J} from "@openrewrite/rewrite/java";
|
|
10
|
+
import {accessesMaterialClass, isMaterialClass} from "./rename-material-members";
|
|
11
|
+
import {beforeMaterialVersion, MaterialProjects, materialProjects, materialProjectScanner} from "./material-version";
|
|
12
|
+
import {hasSearchResult} from "../components/lst";
|
|
13
|
+
|
|
14
|
+
/** A method or property of `@angular/material` classes that a major version removed or changed without a drop-in replacement. */
|
|
15
|
+
export interface RemovedMember {
|
|
16
|
+
/** The class that declares the member, and the base classes that declare it in some versions. */
|
|
17
|
+
classNames: string[];
|
|
18
|
+
name: string;
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Marks calls and property reads of members whose owner resolves to one of the given `@angular/material` classes, in
|
|
24
|
+
* files whose `package.json` is not on the major version that changed them yet.
|
|
25
|
+
*/
|
|
26
|
+
export abstract class FindRemovedMaterialMembers extends ScanningRecipe<MaterialProjects> {
|
|
27
|
+
protected abstract readonly version: number;
|
|
28
|
+
protected abstract readonly members: RemovedMember[];
|
|
29
|
+
|
|
30
|
+
/** Whether the recipe applies to a source file, which by default means its project is not on the version yet. */
|
|
31
|
+
protected appliesTo(projects: MaterialProjects, sourcePath: string): boolean {
|
|
32
|
+
return beforeMaterialVersion(projects.majors, sourcePath, this.version);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
initialValue(_ctx: ExecutionContext): MaterialProjects {
|
|
36
|
+
return materialProjects();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async scanner(projects: MaterialProjects): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
40
|
+
return materialProjectScanner(projects);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async editorWithData(projects: MaterialProjects): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
44
|
+
const applies = (sourcePath: string) => this.appliesTo(projects, sourcePath);
|
|
45
|
+
const members = this.members;
|
|
46
|
+
const removed = (owner: any, name: string) =>
|
|
47
|
+
members.find(m => m.name === name && m.classNames.some(c => isMaterialClass(owner, c)));
|
|
48
|
+
return new class extends JavaScriptVisitor<ExecutionContext> {
|
|
49
|
+
protected async visitJsCompilationUnit(cu: JS.CompilationUnit, p: ExecutionContext): Promise<J | undefined> {
|
|
50
|
+
return applies(cu.sourcePath) ? super.visitJsCompilationUnit(cu, p) : cu;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
protected async visitMethodInvocation(method: J.MethodInvocation, p: ExecutionContext): Promise<J | undefined> {
|
|
54
|
+
const m = await super.visitMethodInvocation(method, p) as J.MethodInvocation;
|
|
55
|
+
const member = removed(m.methodType?.declaringType, m.name.simpleName);
|
|
56
|
+
return member && !hasSearchResult(m, member.message) ? foundSearchResult(m, member.message) : m;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
protected async visitFieldAccess(fieldAccess: J.FieldAccess, p: ExecutionContext): Promise<J | undefined> {
|
|
60
|
+
const f = await super.visitFieldAccess(fieldAccess, p) as J.FieldAccess;
|
|
61
|
+
const name = f.name.element.simpleName;
|
|
62
|
+
const member = members.find(m => m.name === name && m.classNames.some(c => accessesMaterialClass(f, c)));
|
|
63
|
+
return member && !hasSearchResult(f, member.message) ? foundSearchResult(f, member.message) : f;
|
|
64
|
+
}
|
|
65
|
+
}();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class FindRemovedMaterial10Members extends FindRemovedMaterialMembers {
|
|
70
|
+
readonly name = "org.openrewrite.angular.material.FindRemovedMaterial10Members";
|
|
71
|
+
readonly displayName = "Find members removed in Angular Material 10";
|
|
72
|
+
readonly description = "Finds uses of `MatSlideToggle.dragChange`, which Angular Material 10 removed together " +
|
|
73
|
+
"with dragging the slide toggle thumb.";
|
|
74
|
+
|
|
75
|
+
protected readonly version = 10;
|
|
76
|
+
protected readonly members = [{
|
|
77
|
+
classNames: ['MatSlideToggle'],
|
|
78
|
+
name: 'dragChange',
|
|
79
|
+
message: "`MatSlideToggle.dragChange` was removed in @angular/material 10, since the thumb can no longer be " +
|
|
80
|
+
"dragged. Listen to `change` instead.",
|
|
81
|
+
}];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export class FindRemovedMaterial11Members extends FindRemovedMaterialMembers {
|
|
85
|
+
readonly name = "org.openrewrite.angular.material.FindRemovedMaterial11Members";
|
|
86
|
+
readonly displayName = "Find members changed in Angular Material 11";
|
|
87
|
+
readonly description = "Finds calls of `MatSnackBarHarness.getRole`, which no longer reports the role of a snack " +
|
|
88
|
+
"bar in Angular Material 11, since snack bars use `aria-live` instead of the `alert` and `status` roles.";
|
|
89
|
+
|
|
90
|
+
protected readonly version = 11;
|
|
91
|
+
protected readonly members = [{
|
|
92
|
+
classNames: ['MatSnackBarHarness'],
|
|
93
|
+
name: 'getRole',
|
|
94
|
+
message: "Snack bars no longer have the `alert` or `status` role as of @angular/material 11. Assert on " +
|
|
95
|
+
"`getAriaLive()` instead, which returns `assertive` or `polite`.",
|
|
96
|
+
}];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export class FindRemovedMaterial13Members extends FindRemovedMaterialMembers {
|
|
100
|
+
readonly name = "org.openrewrite.angular.material.FindRemovedMaterial13Members";
|
|
101
|
+
readonly displayName = "Find members removed in Angular Material 13";
|
|
102
|
+
readonly description = "Finds uses of `MatFormField.underlineRef` and of the `MatFormFieldHarness` and " +
|
|
103
|
+
"`MatTabHarness` methods that Angular Material 13 removed without a drop-in replacement.";
|
|
104
|
+
|
|
105
|
+
protected readonly version = 13;
|
|
106
|
+
protected readonly members = [
|
|
107
|
+
{
|
|
108
|
+
classNames: ['MatFormFieldHarness', '_MatFormFieldHarnessBase'],
|
|
109
|
+
name: 'getHarnessLoaderForPrefix',
|
|
110
|
+
message: "`MatFormFieldHarness.getHarnessLoaderForPrefix` was removed in @angular/material 13. Use " +
|
|
111
|
+
"`getPrefixText()` to read the prefix, or `getHarness(...)` on the form field harness to load harnesses in it.",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
classNames: ['MatFormFieldHarness', '_MatFormFieldHarnessBase'],
|
|
115
|
+
name: 'getHarnessLoaderForSuffix',
|
|
116
|
+
message: "`MatFormFieldHarness.getHarnessLoaderForSuffix` was removed in @angular/material 13. Use " +
|
|
117
|
+
"`getSuffixText()` to read the suffix, or `getHarness(...)` on the form field harness to load harnesses in it.",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
classNames: ['MatFormField'],
|
|
121
|
+
name: 'underlineRef',
|
|
122
|
+
message: "`MatFormField.underlineRef` was removed in @angular/material 13. Query the `.mat-form-field-underline` " +
|
|
123
|
+
"element of the form field instead.",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
classNames: ['MatTabHarness'],
|
|
127
|
+
name: 'getHarnessLoaderForContent',
|
|
128
|
+
message: "`MatTabHarness.getHarnessLoaderForContent` was removed in @angular/material 13. Call `getHarness(...)` " +
|
|
129
|
+
"and the other loader methods on the tab harness itself, which search the content of the tab.",
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export class FindRemovedMaterial14Members extends FindRemovedMaterialMembers {
|
|
135
|
+
readonly name = "org.openrewrite.angular.material.FindRemovedMaterial14Members";
|
|
136
|
+
readonly displayName = "Find members removed in Angular Material 14";
|
|
137
|
+
readonly description = "Finds uses of `MatSelectionList.tabIndex`, which Angular Material 14 removed.";
|
|
138
|
+
|
|
139
|
+
protected readonly version = 14;
|
|
140
|
+
protected readonly members = [{
|
|
141
|
+
classNames: ['MatSelectionList'],
|
|
142
|
+
name: 'tabIndex',
|
|
143
|
+
message: "`MatSelectionList.tabIndex` was removed in @angular/material 14, since the list manages the tab " +
|
|
144
|
+
"index of its options itself.",
|
|
145
|
+
}];
|
|
146
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 the original author or authors.
|
|
3
|
+
*
|
|
4
|
+
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {Cursor, ExecutionContext, foundSearchResult, Recipe, Tree, TreeVisitor} from "@openrewrite/rewrite";
|
|
8
|
+
import {PlainText, PlainTextVisitor} from "@openrewrite/rewrite/text";
|
|
9
|
+
import {JavaScriptVisitor, JS} from "@openrewrite/rewrite/javascript";
|
|
10
|
+
import {isIdentifier, isLiteral, J} from "@openrewrite/rewrite/java";
|
|
11
|
+
import {moduleOf} from "../components/symbols";
|
|
12
|
+
import {hasSearchResult} from "../components/lst";
|
|
13
|
+
|
|
14
|
+
const DRAG_CHANGE_BINDING = /\(dragChange\)\s*=/;
|
|
15
|
+
|
|
16
|
+
const OPTION_MESSAGE = "`disableDragValue` was removed from `MatSlideToggleDefaultOptions` in @angular/material 10, " +
|
|
17
|
+
"since the thumb can no longer be dragged. Remove it.";
|
|
18
|
+
|
|
19
|
+
const BINDING_MESSAGE = "`MatSlideToggle.dragChange` was removed in @angular/material 10, since the thumb can no longer " +
|
|
20
|
+
"be dragged. Bind to `(change)` instead.";
|
|
21
|
+
|
|
22
|
+
export class FindSlideToggleDragOptions extends Recipe {
|
|
23
|
+
readonly name = "org.openrewrite.angular.material.FindSlideToggleDragOptions";
|
|
24
|
+
readonly displayName = "Find slide toggle drag options and bindings";
|
|
25
|
+
readonly description = "Finds `disableDragValue` in the slide toggle default options and `(dragChange)` bindings " +
|
|
26
|
+
"in `.html` templates and inline `template` metadata, which Angular Material 10 removed together with dragging " +
|
|
27
|
+
"the slide toggle thumb.";
|
|
28
|
+
|
|
29
|
+
async editor(): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
30
|
+
const html = new class extends PlainTextVisitor<ExecutionContext> {
|
|
31
|
+
override async visitText(text: PlainText, p: ExecutionContext): Promise<PlainText | undefined> {
|
|
32
|
+
const t = await super.visitText(text, p) as PlainText;
|
|
33
|
+
if (!t || !t.sourcePath.endsWith('.html') || !DRAG_CHANGE_BINDING.test(t.text)) return t;
|
|
34
|
+
return hasSearchResult(t, BINDING_MESSAGE) ? t : foundSearchResult(t, BINDING_MESSAGE);
|
|
35
|
+
}
|
|
36
|
+
}();
|
|
37
|
+
const typescript = new class extends JavaScriptVisitor<ExecutionContext> {
|
|
38
|
+
private importsSlideToggle = false;
|
|
39
|
+
|
|
40
|
+
protected async visitJsCompilationUnit(cu: JS.CompilationUnit, p: ExecutionContext): Promise<J | undefined> {
|
|
41
|
+
this.importsSlideToggle = cu.statements.some(s => s.element.kind === JS.Kind.Import &&
|
|
42
|
+
moduleOf(s.element as JS.Import) === '@angular/material/slide-toggle');
|
|
43
|
+
return super.visitJsCompilationUnit(cu, p);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
protected async visitPropertyAssignment(property: JS.PropertyAssignment, p: ExecutionContext): Promise<J | undefined> {
|
|
47
|
+
const prop = await super.visitPropertyAssignment(property, p) as JS.PropertyAssignment;
|
|
48
|
+
const name = prop.name.element;
|
|
49
|
+
if (!isIdentifier(name) || hasSearchResult(prop, OPTION_MESSAGE) || hasSearchResult(prop, BINDING_MESSAGE)) return prop;
|
|
50
|
+
if (name.simpleName === 'disableDragValue' && this.importsSlideToggle) {
|
|
51
|
+
return foundSearchResult(prop, OPTION_MESSAGE);
|
|
52
|
+
}
|
|
53
|
+
const initializer = prop.initializer;
|
|
54
|
+
if (name.simpleName === 'template' && initializer && isLiteral(initializer) &&
|
|
55
|
+
typeof initializer.value === 'string' && DRAG_CHANGE_BINDING.test(initializer.value)) {
|
|
56
|
+
return foundSearchResult(prop, BINDING_MESSAGE);
|
|
57
|
+
}
|
|
58
|
+
return prop;
|
|
59
|
+
}
|
|
60
|
+
}();
|
|
61
|
+
// Each visitor returns a source file it does not accept unchanged.
|
|
62
|
+
return new class extends TreeVisitor<any, ExecutionContext> {
|
|
63
|
+
async visit<R extends Tree>(tree: Tree, p: ExecutionContext, parent?: Cursor): Promise<R | undefined> {
|
|
64
|
+
const visited = await html.visit<Tree>(tree, p, parent);
|
|
65
|
+
return visited && await typescript.visit(visited, p, parent) as R | undefined;
|
|
66
|
+
}
|
|
67
|
+
}();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 the original author or authors.
|
|
3
|
+
*
|
|
4
|
+
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Classes of the pre-MDC components of `@angular/material` 14.2.7 that the MDC components of 15.2.9 no longer apply,
|
|
8
|
+
// with the class of the MDC components that replaces them, where there is one.
|
|
9
|
+
|
|
10
|
+
export const REMOVED_CLASSES: Record<string, string | null> = {
|
|
11
|
+
'mat-3-line': null,
|
|
12
|
+
'mat-action-list': null,
|
|
13
|
+
'mat-active': null,
|
|
14
|
+
'mat-autocomplete': 'mat-mdc-autocomplete',
|
|
15
|
+
'mat-autocomplete-hidden': null,
|
|
16
|
+
'mat-autocomplete-panel': null,
|
|
17
|
+
'mat-autocomplete-panel-above': null,
|
|
18
|
+
'mat-autocomplete-trigger': 'mat-mdc-autocomplete-trigger',
|
|
19
|
+
'mat-autocomplete-visible': null,
|
|
20
|
+
'mat-basic-chip': 'mat-mdc-basic-chip',
|
|
21
|
+
'mat-button': 'mat-mdc-button',
|
|
22
|
+
'mat-button-base': 'mat-mdc-button-base',
|
|
23
|
+
'mat-button-disabled': null,
|
|
24
|
+
'mat-button-focus-overlay': null,
|
|
25
|
+
'mat-button-ripple': null,
|
|
26
|
+
'mat-button-ripple-round': null,
|
|
27
|
+
'mat-button-wrapper': null,
|
|
28
|
+
'mat-card': 'mat-mdc-card',
|
|
29
|
+
'mat-card-actions': 'mat-mdc-card-actions',
|
|
30
|
+
'mat-card-actions-align-end': null,
|
|
31
|
+
'mat-card-avatar': 'mat-mdc-card-avatar',
|
|
32
|
+
'mat-card-content': 'mat-mdc-card-content',
|
|
33
|
+
'mat-card-footer': 'mat-mdc-card-footer',
|
|
34
|
+
'mat-card-header': 'mat-mdc-card-header',
|
|
35
|
+
'mat-card-header-text': null,
|
|
36
|
+
'mat-card-image': 'mat-mdc-card-image',
|
|
37
|
+
'mat-card-lg-image': 'mat-mdc-card-lg-image',
|
|
38
|
+
'mat-card-md-image': 'mat-mdc-card-md-image',
|
|
39
|
+
'mat-card-sm-image': 'mat-mdc-card-sm-image',
|
|
40
|
+
'mat-card-subtitle': 'mat-mdc-card-subtitle',
|
|
41
|
+
'mat-card-title': 'mat-mdc-card-title',
|
|
42
|
+
'mat-card-title-group': 'mat-mdc-card-title-group',
|
|
43
|
+
'mat-card-xl-image': 'mat-mdc-card-xl-image',
|
|
44
|
+
'mat-cell': 'mat-mdc-cell',
|
|
45
|
+
'mat-checkbox': 'mat-mdc-checkbox',
|
|
46
|
+
'mat-checkbox-anim-checked-indeterminate': null,
|
|
47
|
+
'mat-checkbox-anim-checked-unchecked': null,
|
|
48
|
+
'mat-checkbox-anim-indeterminate-checked': null,
|
|
49
|
+
'mat-checkbox-anim-indeterminate-unchecked': null,
|
|
50
|
+
'mat-checkbox-anim-unchecked-checked': null,
|
|
51
|
+
'mat-checkbox-anim-unchecked-indeterminate': null,
|
|
52
|
+
'mat-checkbox-background': null,
|
|
53
|
+
'mat-checkbox-checked': null,
|
|
54
|
+
'mat-checkbox-checkmark': null,
|
|
55
|
+
'mat-checkbox-checkmark-path': null,
|
|
56
|
+
'mat-checkbox-disabled': null,
|
|
57
|
+
'mat-checkbox-frame': null,
|
|
58
|
+
'mat-checkbox-indeterminate': null,
|
|
59
|
+
'mat-checkbox-inner-container': null,
|
|
60
|
+
'mat-checkbox-inner-container-no-side-margin': null,
|
|
61
|
+
'mat-checkbox-input': null,
|
|
62
|
+
'mat-checkbox-label': null,
|
|
63
|
+
'mat-checkbox-label-before': null,
|
|
64
|
+
'mat-checkbox-layout': null,
|
|
65
|
+
'mat-checkbox-mixedmark': null,
|
|
66
|
+
'mat-checkbox-persistent-ripple': null,
|
|
67
|
+
'mat-checkbox-ripple': null,
|
|
68
|
+
'mat-checkbox-unchecked': null,
|
|
69
|
+
'mat-checked': null,
|
|
70
|
+
'mat-chip': 'mat-mdc-chip',
|
|
71
|
+
'mat-chip-avatar': null,
|
|
72
|
+
'mat-chip-disabled': null,
|
|
73
|
+
'mat-chip-grid': 'mat-mdc-chip-grid',
|
|
74
|
+
'mat-chip-input': 'mat-mdc-chip-input',
|
|
75
|
+
'mat-chip-list': 'mat-mdc-chip-set',
|
|
76
|
+
'mat-chip-list-disabled': null,
|
|
77
|
+
'mat-chip-list-invalid': null,
|
|
78
|
+
'mat-chip-list-required': null,
|
|
79
|
+
'mat-chip-list-stacked': null,
|
|
80
|
+
'mat-chip-list-wrapper': null,
|
|
81
|
+
'mat-chip-remove': null,
|
|
82
|
+
'mat-chip-ripple': null,
|
|
83
|
+
'mat-chip-selected': null,
|
|
84
|
+
'mat-chip-set': 'mat-mdc-chip-set',
|
|
85
|
+
'mat-chip-trailing-icon': null,
|
|
86
|
+
'mat-chip-with-avatar': null,
|
|
87
|
+
'mat-chip-with-trailing-icon': null,
|
|
88
|
+
'mat-date-range-input-start-wrapper': null,
|
|
89
|
+
'mat-dialog': 'mat-mdc-dialog',
|
|
90
|
+
'mat-dialog-actions': 'mat-mdc-dialog-actions',
|
|
91
|
+
'mat-dialog-actions-align-center': null,
|
|
92
|
+
'mat-dialog-actions-align-end': null,
|
|
93
|
+
'mat-dialog-container': 'mat-mdc-dialog-container',
|
|
94
|
+
'mat-dialog-content': 'mat-mdc-dialog-content',
|
|
95
|
+
'mat-dialog-title': 'mat-mdc-dialog-title',
|
|
96
|
+
'mat-disabled': null,
|
|
97
|
+
'mat-empty': null,
|
|
98
|
+
'mat-error': 'mat-mdc-form-field-error',
|
|
99
|
+
'mat-fab': 'mat-mdc-fab',
|
|
100
|
+
'mat-flat-button': 'mat-mdc-unelevated-button',
|
|
101
|
+
'mat-footer-cell': 'mat-mdc-footer-cell',
|
|
102
|
+
'mat-footer-row': 'mat-mdc-footer-row',
|
|
103
|
+
'mat-form-field': 'mat-mdc-form-field',
|
|
104
|
+
'mat-form-field-appearance-standard': null,
|
|
105
|
+
'mat-form-field-autofill-control': null,
|
|
106
|
+
'mat-form-field-can-float': null,
|
|
107
|
+
'mat-form-field-control-wrapper': null,
|
|
108
|
+
'mat-form-field-empty': null,
|
|
109
|
+
'mat-form-field-flex': null,
|
|
110
|
+
'mat-form-field-has-label': null,
|
|
111
|
+
'mat-form-field-hint-end': null,
|
|
112
|
+
'mat-form-field-hint-spacer': null,
|
|
113
|
+
'mat-form-field-hint-wrapper': null,
|
|
114
|
+
'mat-form-field-infix': null,
|
|
115
|
+
'mat-form-field-label': null,
|
|
116
|
+
'mat-form-field-label-wrapper': null,
|
|
117
|
+
'mat-form-field-outline': null,
|
|
118
|
+
'mat-form-field-outline-end': null,
|
|
119
|
+
'mat-form-field-outline-gap': null,
|
|
120
|
+
'mat-form-field-outline-start': null,
|
|
121
|
+
'mat-form-field-outline-thick': null,
|
|
122
|
+
'mat-form-field-prefix': null,
|
|
123
|
+
'mat-form-field-ripple': null,
|
|
124
|
+
'mat-form-field-should-float': null,
|
|
125
|
+
'mat-form-field-subscript-wrapper': null,
|
|
126
|
+
'mat-form-field-suffix': null,
|
|
127
|
+
'mat-form-field-type-mat-date-range-input': null,
|
|
128
|
+
'mat-form-field-type-mat-native-select': null,
|
|
129
|
+
'mat-form-field-type-mat-select': null,
|
|
130
|
+
'mat-form-field-underline': null,
|
|
131
|
+
'mat-form-field-wrapper': null,
|
|
132
|
+
'mat-header-cell': 'mat-mdc-header-cell',
|
|
133
|
+
'mat-header-row': 'mat-mdc-header-row',
|
|
134
|
+
'mat-hint': 'mat-mdc-form-field-hint',
|
|
135
|
+
'mat-icon-button': 'mat-mdc-icon-button',
|
|
136
|
+
'mat-ink-bar': null,
|
|
137
|
+
'mat-list': 'mat-mdc-list',
|
|
138
|
+
'mat-list-avatar': 'mat-mdc-list-item-avatar',
|
|
139
|
+
'mat-list-base': 'mat-mdc-list-base',
|
|
140
|
+
'mat-list-icon': 'mat-mdc-list-item-icon',
|
|
141
|
+
'mat-list-item': 'mat-mdc-list-item',
|
|
142
|
+
'mat-list-item-content': null,
|
|
143
|
+
'mat-list-item-content-reverse': null,
|
|
144
|
+
'mat-list-item-disabled': null,
|
|
145
|
+
'mat-list-item-ripple': null,
|
|
146
|
+
'mat-list-item-with-avatar': null,
|
|
147
|
+
'mat-list-option': null,
|
|
148
|
+
'mat-list-single-selected-option': null,
|
|
149
|
+
'mat-list-text': null,
|
|
150
|
+
'mat-menu-content': 'mat-mdc-menu-content',
|
|
151
|
+
'mat-menu-item': 'mat-mdc-menu-item',
|
|
152
|
+
'mat-menu-item-highlighted': null,
|
|
153
|
+
'mat-menu-item-submenu-trigger': 'mat-mdc-menu-item-submenu-trigger',
|
|
154
|
+
'mat-menu-panel': 'mat-mdc-menu-panel',
|
|
155
|
+
'mat-menu-ripple': null,
|
|
156
|
+
'mat-menu-submenu-icon': null,
|
|
157
|
+
'mat-menu-trigger': 'mat-mdc-menu-trigger',
|
|
158
|
+
'mat-mini-fab': 'mat-mdc-mini-fab',
|
|
159
|
+
'mat-multi-line': null,
|
|
160
|
+
'mat-native-select-inline': null,
|
|
161
|
+
'mat-nav-list': null,
|
|
162
|
+
'mat-optgroup': 'mat-mdc-optgroup',
|
|
163
|
+
'mat-optgroup-disabled': null,
|
|
164
|
+
'mat-optgroup-label': 'mat-mdc-optgroup-label',
|
|
165
|
+
'mat-option': 'mat-mdc-option',
|
|
166
|
+
'mat-option-disabled': null,
|
|
167
|
+
'mat-option-multiple': 'mat-mdc-option-multiple',
|
|
168
|
+
'mat-option-pseudo-checkbox': 'mat-mdc-option-pseudo-checkbox',
|
|
169
|
+
'mat-option-ripple': 'mat-mdc-option-ripple',
|
|
170
|
+
'mat-option-text': null,
|
|
171
|
+
'mat-paginator': 'mat-mdc-paginator',
|
|
172
|
+
'mat-paginator-container': 'mat-mdc-paginator-container',
|
|
173
|
+
'mat-paginator-icon': 'mat-mdc-paginator-icon',
|
|
174
|
+
'mat-paginator-navigation-first': 'mat-mdc-paginator-navigation-first',
|
|
175
|
+
'mat-paginator-navigation-last': 'mat-mdc-paginator-navigation-last',
|
|
176
|
+
'mat-paginator-navigation-next': 'mat-mdc-paginator-navigation-next',
|
|
177
|
+
'mat-paginator-navigation-previous': 'mat-mdc-paginator-navigation-previous',
|
|
178
|
+
'mat-paginator-outer-container': 'mat-mdc-paginator-outer-container',
|
|
179
|
+
'mat-paginator-page-size': 'mat-mdc-paginator-page-size',
|
|
180
|
+
'mat-paginator-page-size-label': 'mat-mdc-paginator-page-size-label',
|
|
181
|
+
'mat-paginator-page-size-select': null,
|
|
182
|
+
'mat-paginator-page-size-value': 'mat-mdc-paginator-page-size-value',
|
|
183
|
+
'mat-paginator-range-actions': 'mat-mdc-paginator-range-actions',
|
|
184
|
+
'mat-paginator-range-label': 'mat-mdc-paginator-range-label',
|
|
185
|
+
'mat-progress-bar': 'mat-mdc-progress-bar',
|
|
186
|
+
'mat-progress-bar-background': null,
|
|
187
|
+
'mat-progress-bar-buffer': null,
|
|
188
|
+
'mat-progress-bar-element': null,
|
|
189
|
+
'mat-progress-bar-fill': null,
|
|
190
|
+
'mat-progress-bar-primary': null,
|
|
191
|
+
'mat-progress-bar-secondary': null,
|
|
192
|
+
'mat-progress-spinner': 'mat-mdc-progress-spinner',
|
|
193
|
+
'mat-radio-button': 'mat-mdc-radio-button',
|
|
194
|
+
'mat-radio-checked': null,
|
|
195
|
+
'mat-radio-container': null,
|
|
196
|
+
'mat-radio-disabled': null,
|
|
197
|
+
'mat-radio-group': 'mat-mdc-radio-group',
|
|
198
|
+
'mat-radio-inner-circle': null,
|
|
199
|
+
'mat-radio-input': null,
|
|
200
|
+
'mat-radio-label': null,
|
|
201
|
+
'mat-radio-label-before': null,
|
|
202
|
+
'mat-radio-label-content': null,
|
|
203
|
+
'mat-radio-outer-circle': null,
|
|
204
|
+
'mat-raised-button': 'mat-mdc-raised-button',
|
|
205
|
+
'mat-row': 'mat-mdc-row',
|
|
206
|
+
'mat-select': 'mat-mdc-select',
|
|
207
|
+
'mat-select-arrow': null,
|
|
208
|
+
'mat-select-arrow-wrapper': null,
|
|
209
|
+
'mat-select-disabled': null,
|
|
210
|
+
'mat-select-empty': null,
|
|
211
|
+
'mat-select-invalid': null,
|
|
212
|
+
'mat-select-min-line': null,
|
|
213
|
+
'mat-select-multiple': null,
|
|
214
|
+
'mat-select-panel': 'mat-mdc-select-panel',
|
|
215
|
+
'mat-select-panel-wrap': null,
|
|
216
|
+
'mat-select-placeholder': null,
|
|
217
|
+
'mat-select-required': null,
|
|
218
|
+
'mat-select-trigger': null,
|
|
219
|
+
'mat-select-value': null,
|
|
220
|
+
'mat-select-value-text': null,
|
|
221
|
+
'mat-selected': null,
|
|
222
|
+
'mat-simple-snack-bar-content': 'mat-mdc-snack-bar-label',
|
|
223
|
+
'mat-simple-snackbar': 'mat-mdc-simple-snack-bar',
|
|
224
|
+
'mat-simple-snackbar-action': 'mat-mdc-snack-bar-action',
|
|
225
|
+
'mat-slide-toggle': 'mat-mdc-slide-toggle',
|
|
226
|
+
'mat-slide-toggle-bar': null,
|
|
227
|
+
'mat-slide-toggle-bar-no-side-margin': null,
|
|
228
|
+
'mat-slide-toggle-content': null,
|
|
229
|
+
'mat-slide-toggle-input': null,
|
|
230
|
+
'mat-slide-toggle-label': null,
|
|
231
|
+
'mat-slide-toggle-label-before': null,
|
|
232
|
+
'mat-slide-toggle-persistent-ripple': null,
|
|
233
|
+
'mat-slide-toggle-ripple': null,
|
|
234
|
+
'mat-slide-toggle-thumb': null,
|
|
235
|
+
'mat-slide-toggle-thumb-container': null,
|
|
236
|
+
'mat-slider': 'mat-mdc-slider',
|
|
237
|
+
'mat-slider-axis-inverted': null,
|
|
238
|
+
'mat-slider-disabled': null,
|
|
239
|
+
'mat-slider-focus-ring': null,
|
|
240
|
+
'mat-slider-has-ticks': null,
|
|
241
|
+
'mat-slider-hide-last-tick': null,
|
|
242
|
+
'mat-slider-horizontal': null,
|
|
243
|
+
'mat-slider-invert-mouse-coords': null,
|
|
244
|
+
'mat-slider-min-value': null,
|
|
245
|
+
'mat-slider-sliding': null,
|
|
246
|
+
'mat-slider-thumb': null,
|
|
247
|
+
'mat-slider-thumb-container': null,
|
|
248
|
+
'mat-slider-thumb-label': null,
|
|
249
|
+
'mat-slider-thumb-label-showing': null,
|
|
250
|
+
'mat-slider-thumb-label-text': null,
|
|
251
|
+
'mat-slider-ticks': null,
|
|
252
|
+
'mat-slider-ticks-container': null,
|
|
253
|
+
'mat-slider-track-background': null,
|
|
254
|
+
'mat-slider-track-fill': null,
|
|
255
|
+
'mat-slider-track-wrapper': null,
|
|
256
|
+
'mat-slider-vertical': null,
|
|
257
|
+
'mat-slider-wrapper': null,
|
|
258
|
+
'mat-snack-bar-container': 'mat-mdc-snack-bar-container',
|
|
259
|
+
'mat-snack-bar-handset': 'mat-mdc-snack-bar-handset',
|
|
260
|
+
'mat-spinner': 'mat-mdc-progress-spinner',
|
|
261
|
+
'mat-standard-chip': 'mat-mdc-standard-chip',
|
|
262
|
+
'mat-stroked-button': 'mat-mdc-outlined-button',
|
|
263
|
+
'mat-subheader': 'mat-mdc-subheader',
|
|
264
|
+
'mat-tab': 'mat-mdc-tab',
|
|
265
|
+
'mat-tab-body': 'mat-mdc-tab-body',
|
|
266
|
+
'mat-tab-body-active': null,
|
|
267
|
+
'mat-tab-body-content': null,
|
|
268
|
+
'mat-tab-body-wrapper': null,
|
|
269
|
+
'mat-tab-disabled': null,
|
|
270
|
+
'mat-tab-group': 'mat-mdc-tab-group',
|
|
271
|
+
'mat-tab-group-dynamic-height': null,
|
|
272
|
+
'mat-tab-group-inverted-header': null,
|
|
273
|
+
'mat-tab-header': 'mat-mdc-tab-header',
|
|
274
|
+
'mat-tab-header-pagination': null,
|
|
275
|
+
'mat-tab-header-pagination-after': null,
|
|
276
|
+
'mat-tab-header-pagination-before': null,
|
|
277
|
+
'mat-tab-header-pagination-chevron': null,
|
|
278
|
+
'mat-tab-header-pagination-controls-enabled': null,
|
|
279
|
+
'mat-tab-header-pagination-disabled': null,
|
|
280
|
+
'mat-tab-header-rtl': null,
|
|
281
|
+
'mat-tab-label': null,
|
|
282
|
+
'mat-tab-label-active': null,
|
|
283
|
+
'mat-tab-label-container': null,
|
|
284
|
+
'mat-tab-label-content': null,
|
|
285
|
+
'mat-tab-labels': null,
|
|
286
|
+
'mat-tab-link': 'mat-mdc-tab-link',
|
|
287
|
+
'mat-tab-link-container': null,
|
|
288
|
+
'mat-tab-links': null,
|
|
289
|
+
'mat-tab-list': null,
|
|
290
|
+
'mat-tab-nav-bar': 'mat-mdc-tab-nav-bar',
|
|
291
|
+
'mat-table': 'mat-mdc-table',
|
|
292
|
+
'mat-table-fixed-layout': null,
|
|
293
|
+
'mat-table-sticky': 'mat-mdc-table-sticky',
|
|
294
|
+
'mat-table-sticky-border-elem-left': 'mat-mdc-table-sticky-border-elem-left',
|
|
295
|
+
'mat-table-sticky-border-elem-right': 'mat-mdc-table-sticky-border-elem-right',
|
|
296
|
+
'mat-tooltip': 'mat-mdc-tooltip',
|
|
297
|
+
'mat-tooltip-handset': null,
|
|
298
|
+
'mat-tooltip-hide': null,
|
|
299
|
+
'mat-tooltip-panel': 'mat-mdc-tooltip-panel',
|
|
300
|
+
'mat-tooltip-panel-above': 'mat-mdc-tooltip-panel-above',
|
|
301
|
+
'mat-tooltip-panel-after': 'mat-mdc-tooltip-panel-after',
|
|
302
|
+
'mat-tooltip-panel-before': 'mat-mdc-tooltip-panel-before',
|
|
303
|
+
'mat-tooltip-panel-below': 'mat-mdc-tooltip-panel-below',
|
|
304
|
+
'mat-tooltip-panel-left': 'mat-mdc-tooltip-panel-left',
|
|
305
|
+
'mat-tooltip-panel-non-interactive': null,
|
|
306
|
+
'mat-tooltip-panel-right': 'mat-mdc-tooltip-panel-right',
|
|
307
|
+
'mat-tooltip-show': null,
|
|
308
|
+
'mat-tooltip-trigger': 'mat-mdc-tooltip-trigger',
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
/** Typography classes that Material 15 renamed to the 2018 Material Design type scale, from the `mdc-migration` schematic. */
|
|
312
|
+
export const RENAMED_TYPOGRAPHY_CLASSES: Record<string, string> = {
|
|
313
|
+
'mat-display-4': 'mat-headline-1',
|
|
314
|
+
'mat-display-3': 'mat-headline-2',
|
|
315
|
+
'mat-display-2': 'mat-headline-3',
|
|
316
|
+
'mat-display-1': 'mat-headline-4',
|
|
317
|
+
'mat-headline': 'mat-headline-5',
|
|
318
|
+
'mat-title': 'mat-headline-6',
|
|
319
|
+
'mat-subheading-2': 'mat-subtitle-1',
|
|
320
|
+
'mat-body-2': 'mat-subtitle-2',
|
|
321
|
+
'mat-subheading-1': 'mat-body-1',
|
|
322
|
+
'mat-body-1': 'mat-body-2',
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
/** The class selectors that the `mdc-migration` schematic of Material 15 renames to the classes of the MDC components. */
|
|
326
|
+
export const MDC_CLASS_RENAMES: Record<string, string> = {
|
|
327
|
+
'mat-autocomplete': 'mat-mdc-autocomplete',
|
|
328
|
+
'mat-basic-chip': 'mat-mdc-basic-chip',
|
|
329
|
+
'mat-button': 'mat-mdc-button',
|
|
330
|
+
'mat-button-base': 'mat-mdc-button-base',
|
|
331
|
+
'mat-card': 'mat-mdc-card',
|
|
332
|
+
'mat-card-actions': 'mat-mdc-card-actions',
|
|
333
|
+
'mat-card-avatar': 'mat-mdc-card-avatar',
|
|
334
|
+
'mat-card-content': 'mat-mdc-card-content',
|
|
335
|
+
'mat-card-footer': 'mat-mdc-card-footer',
|
|
336
|
+
'mat-card-header': 'mat-mdc-card-header',
|
|
337
|
+
'mat-card-image': 'mat-mdc-card-image',
|
|
338
|
+
'mat-card-lg-image': 'mat-mdc-card-lg-image',
|
|
339
|
+
'mat-card-md-image': 'mat-mdc-card-md-image',
|
|
340
|
+
'mat-card-sm-image': 'mat-mdc-card-sm-image',
|
|
341
|
+
'mat-card-subtitle': 'mat-mdc-card-subtitle',
|
|
342
|
+
'mat-card-title': 'mat-mdc-card-title',
|
|
343
|
+
'mat-card-title-group': 'mat-mdc-card-title-group',
|
|
344
|
+
'mat-card-xl-image': 'mat-mdc-card-xl-image',
|
|
345
|
+
'mat-cell': 'mat-mdc-cell',
|
|
346
|
+
'mat-checkbox': 'mat-mdc-checkbox',
|
|
347
|
+
'mat-chip': 'mat-mdc-chip',
|
|
348
|
+
'mat-chip-grid': 'mat-mdc-chip-grid',
|
|
349
|
+
'mat-chip-input': 'mat-mdc-chip-input',
|
|
350
|
+
'mat-chip-set': 'mat-mdc-chip-set',
|
|
351
|
+
'mat-dialog': 'mat-mdc-dialog',
|
|
352
|
+
'mat-dialog-actions': 'mat-mdc-dialog-actions',
|
|
353
|
+
'mat-dialog-container': 'mat-mdc-dialog-container',
|
|
354
|
+
'mat-dialog-content': 'mat-mdc-dialog-content',
|
|
355
|
+
'mat-dialog-title': 'mat-mdc-dialog-title',
|
|
356
|
+
'mat-error': 'mat-mdc-form-field-error',
|
|
357
|
+
'mat-fab': 'mat-mdc-fab',
|
|
358
|
+
'mat-flat-button': 'mat-mdc-unelevated-button',
|
|
359
|
+
'mat-footer-cell': 'mat-mdc-footer-cell',
|
|
360
|
+
'mat-footer-row': 'mat-mdc-footer-row',
|
|
361
|
+
'mat-form-field': 'mat-mdc-form-field',
|
|
362
|
+
'mat-header-cell': 'mat-mdc-header-cell',
|
|
363
|
+
'mat-header-row': 'mat-mdc-header-row',
|
|
364
|
+
'mat-hint': 'mat-mdc-form-field-hint',
|
|
365
|
+
'mat-icon-button': 'mat-mdc-icon-button',
|
|
366
|
+
'mat-input-element': 'mat-mdc-input-element',
|
|
367
|
+
'mat-list': 'mat-mdc-list',
|
|
368
|
+
'mat-list-avatar': 'mat-mdc-list-item-avatar',
|
|
369
|
+
'mat-list-base': 'mat-mdc-list-base',
|
|
370
|
+
'mat-list-icon': 'mat-mdc-list-item-icon',
|
|
371
|
+
'mat-list-item': 'mat-mdc-list-item',
|
|
372
|
+
'mat-menu-content': 'mat-mdc-menu-content',
|
|
373
|
+
'mat-menu-item': 'mat-mdc-menu-item',
|
|
374
|
+
'mat-menu-item-submenu-trigger': 'mat-mdc-menu-item-submenu-trigger',
|
|
375
|
+
'mat-menu-panel': 'mat-mdc-menu-panel',
|
|
376
|
+
'mat-menu-trigger': 'mat-mdc-menu-trigger',
|
|
377
|
+
'mat-mini-fab': 'mat-mdc-mini-fab',
|
|
378
|
+
'mat-optgroup': 'mat-mdc-optgroup',
|
|
379
|
+
'mat-optgroup-label': 'mat-mdc-optgroup-label',
|
|
380
|
+
'mat-option': 'mat-mdc-option',
|
|
381
|
+
'mat-option-multiple': 'mat-mdc-option-multiple',
|
|
382
|
+
'mat-option-pseudo-checkbox': 'mat-mdc-option-pseudo-checkbox',
|
|
383
|
+
'mat-option-ripple': 'mat-mdc-option-ripple',
|
|
384
|
+
'mat-paginator': 'mat-mdc-paginator',
|
|
385
|
+
'mat-paginator-container': 'mat-mdc-paginator-container',
|
|
386
|
+
'mat-paginator-icon': 'mat-mdc-paginator-icon',
|
|
387
|
+
'mat-paginator-navigation-first': 'mat-mdc-paginator-navigation-first',
|
|
388
|
+
'mat-paginator-navigation-last': 'mat-mdc-paginator-navigation-last',
|
|
389
|
+
'mat-paginator-navigation-next': 'mat-mdc-paginator-navigation-next',
|
|
390
|
+
'mat-paginator-navigation-previous': 'mat-mdc-paginator-navigation-previous',
|
|
391
|
+
'mat-paginator-outer-container': 'mat-mdc-paginator-outer-container',
|
|
392
|
+
'mat-paginator-page-size': 'mat-mdc-paginator-page-size',
|
|
393
|
+
'mat-paginator-page-size-label': 'mat-mdc-paginator-page-size-label',
|
|
394
|
+
'mat-paginator-page-size-value': 'mat-mdc-paginator-page-size-value',
|
|
395
|
+
'mat-paginator-range-actions': 'mat-mdc-paginator-range-actions',
|
|
396
|
+
'mat-paginator-range-label': 'mat-mdc-paginator-range-label',
|
|
397
|
+
'mat-progress-bar': 'mat-mdc-progress-bar',
|
|
398
|
+
'mat-progress-spinner': 'mat-mdc-progress-spinner',
|
|
399
|
+
'mat-radio-button': 'mat-mdc-radio-button',
|
|
400
|
+
'mat-radio-group': 'mat-mdc-radio-group',
|
|
401
|
+
'mat-raised-button': 'mat-mdc-raised-button',
|
|
402
|
+
'mat-row': 'mat-mdc-row',
|
|
403
|
+
'mat-select': 'mat-mdc-select',
|
|
404
|
+
'mat-select-panel': 'mat-mdc-select-panel',
|
|
405
|
+
'mat-simple-snack-bar-content': 'mat-mdc-snack-bar-label',
|
|
406
|
+
'mat-simple-snackbar': 'mat-mdc-simple-snack-bar',
|
|
407
|
+
'mat-simple-snackbar-action': 'mat-mdc-snack-bar-action',
|
|
408
|
+
'mat-slide-toggle': 'mat-mdc-slide-toggle',
|
|
409
|
+
'mat-slider': 'mat-mdc-slider',
|
|
410
|
+
'mat-snack-bar-container': 'mat-mdc-snack-bar-container',
|
|
411
|
+
'mat-snack-bar-handset': 'mat-mdc-snack-bar-handset',
|
|
412
|
+
'mat-spinner': 'mat-mdc-progress-spinner',
|
|
413
|
+
'mat-standard-chip': 'mat-mdc-standard-chip',
|
|
414
|
+
'mat-stroked-button': 'mat-mdc-outlined-button',
|
|
415
|
+
'mat-subheader': 'mat-mdc-subheader',
|
|
416
|
+
'mat-tab': 'mat-mdc-tab',
|
|
417
|
+
'mat-tab-body': 'mat-mdc-tab-body',
|
|
418
|
+
'mat-tab-group': 'mat-mdc-tab-group',
|
|
419
|
+
'mat-tab-header': 'mat-mdc-tab-header',
|
|
420
|
+
'mat-tab-link': 'mat-mdc-tab-link',
|
|
421
|
+
'mat-tab-nav-bar': 'mat-mdc-tab-nav-bar',
|
|
422
|
+
'mat-table': 'mat-mdc-table',
|
|
423
|
+
'mat-table-sticky': 'mat-mdc-table-sticky',
|
|
424
|
+
'mat-table-sticky-border-elem-left': 'mat-mdc-table-sticky-border-elem-left',
|
|
425
|
+
'mat-table-sticky-border-elem-right': 'mat-mdc-table-sticky-border-elem-right',
|
|
426
|
+
'mat-tooltip': 'mat-mdc-tooltip',
|
|
427
|
+
'mat-tooltip-panel': 'mat-mdc-tooltip-panel',
|
|
428
|
+
'mat-tooltip-panel-above': 'mat-mdc-tooltip-panel-above',
|
|
429
|
+
'mat-tooltip-panel-after': 'mat-mdc-tooltip-panel-after',
|
|
430
|
+
'mat-tooltip-panel-before': 'mat-mdc-tooltip-panel-before',
|
|
431
|
+
'mat-tooltip-panel-below': 'mat-mdc-tooltip-panel-below',
|
|
432
|
+
'mat-tooltip-panel-left': 'mat-mdc-tooltip-panel-left',
|
|
433
|
+
'mat-tooltip-panel-right': 'mat-mdc-tooltip-panel-right',
|
|
434
|
+
'mat-tooltip-trigger': 'mat-mdc-tooltip-trigger',
|
|
435
|
+
};
|