Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/schematics/update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {createUpdateRule} from './update';
/** Possible versions that can be automatically migrated by `ng update`. */
export enum TargetVersion {
V6,
V7
V7,
}

/** Entry point for the migration schematics with target of Angular Material 6.0.0 */
Expand Down
35 changes: 19 additions & 16 deletions src/lib/schematics/update/material/data/attribute-selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

import {transformChanges} from '../transform-change-data';
import {VersionChanges} from '../transform-change-data';
import {TargetVersion} from '../../index';

export interface MaterialAttributeSelectorData {
/** The attribute name to replace. */
Expand All @@ -15,18 +16,20 @@ export interface MaterialAttributeSelectorData {
replaceWith: string;
}

export const attributeSelectors = transformChanges<MaterialAttributeSelectorData>([
{
pr: 'https://github.com/angular/material2/pull/10257',
changes: [
{
replace: 'cdkPortalHost',
replaceWith: 'cdkPortalOutlet'
},
{
replace: 'portalHost',
replaceWith: 'cdkPortalOutlet'
}
]
}
]);
export const attributeSelectors: VersionChanges<MaterialAttributeSelectorData> = {
[TargetVersion.V6]: [
{
pr: 'https://github.com/angular/material2/pull/10257',
changes: [
{
replace: 'cdkPortalHost',
replaceWith: 'cdkPortalOutlet'
},
{
replace: 'portalHost',
replaceWith: 'cdkPortalOutlet'
}
]
}
]
};
105 changes: 54 additions & 51 deletions src/lib/schematics/update/material/data/class-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

import {transformChanges} from '../transform-change-data';
import {TargetVersion} from '../../index';
import {VersionChanges} from '../transform-change-data';

export interface MaterialClassNameData {
/** The Class name to replace. */
Expand All @@ -15,56 +16,58 @@ export interface MaterialClassNameData {
replaceWith: string;
}

export const classNames = transformChanges<MaterialClassNameData>([
{
pr: 'https://github.com/angular/material2/pull/10161',
changes: [
{
replace: 'ConnectedOverlayDirective',
replaceWith: 'CdkConnectedOverlay'
},
{
replace: 'OverlayOrigin',
replaceWith: 'CdkOverlayOrigin'
}
]
},
export const classNames: VersionChanges<MaterialClassNameData> = {
[TargetVersion.V6]: [
{
pr: 'https://github.com/angular/material2/pull/10161',
changes: [
{
replace: 'ConnectedOverlayDirective',
replaceWith: 'CdkConnectedOverlay'
},
{
replace: 'OverlayOrigin',
replaceWith: 'CdkOverlayOrigin'
}
]
},

{
pr: 'https://github.com/angular/material2/pull/10267',
changes: [
{
replace: 'ObserveContent',
replaceWith: 'CdkObserveContent'
}
]
},
{
pr: 'https://github.com/angular/material2/pull/10267',
changes: [
{
replace: 'ObserveContent',
replaceWith: 'CdkObserveContent'
}
]
},

{
pr: 'https://github.com/angular/material2/pull/10291',
changes: [
{
replace: 'FloatPlaceholderType',
replaceWith: 'FloatLabelType'
},
{
replace: 'MAT_PLACEHOLDER_GLOBAL_OPTIONS',
replaceWith: 'MAT_LABEL_GLOBAL_OPTIONS'
},
{
replace: 'PlaceholderOptions',
replaceWith: 'LabelOptions'
}
]
},
{
pr: 'https://github.com/angular/material2/pull/10291',
changes: [
{
replace: 'FloatPlaceholderType',
replaceWith: 'FloatLabelType'
},
{
replace: 'MAT_PLACEHOLDER_GLOBAL_OPTIONS',
replaceWith: 'MAT_LABEL_GLOBAL_OPTIONS'
},
{
replace: 'PlaceholderOptions',
replaceWith: 'LabelOptions'
}
]
},

{
pr: 'https://github.com/angular/material2/pull/10325',
changes: [
{
replace: 'FocusTrapDirective',
replaceWith: 'CdkTrapFocus'
}
]
}
]);
{
pr: 'https://github.com/angular/material2/pull/10325',
changes: [
{
replace: 'FocusTrapDirective',
replaceWith: 'CdkTrapFocus'
}
]
}
]
};
164 changes: 84 additions & 80 deletions src/lib/schematics/update/material/data/css-selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

import {transformChanges} from '../transform-change-data';
import {TargetVersion} from '../../index';
import {VersionChanges} from '../transform-change-data';

export interface MaterialCssSelectorData {
/** The CSS selector to replace. */
Expand All @@ -24,84 +25,87 @@ export interface MaterialCssSelectorData {
};
}

export const cssSelectors = transformChanges<MaterialCssSelectorData>([
{
pr: 'https://github.com/angular/material2/pull/10296',
changes: [
{
replace: '.mat-form-field-placeholder',
replaceWith: '.mat-form-field-label'
},
{
replace: '.mat-input-container',
replaceWith: '.mat-form-field'
},
{
replace: '.mat-input-flex',
replaceWith: '.mat-form-field-flex'
},
{
replace: '.mat-input-hint-spacer',
replaceWith: '.mat-form-field-hint-spacer'
},
{
replace: '.mat-input-hint-wrapper',
replaceWith: '.mat-form-field-hint-wrapper'
},
{
replace: '.mat-input-infix',
replaceWith: '.mat-form-field-infix'
},
{
replace: '.mat-input-invalid',
replaceWith: '.mat-form-field-invalid'
},
{
replace: '.mat-input-placeholder',
replaceWith: '.mat-form-field-label'
},
{
replace: '.mat-input-placeholder-wrapper',
replaceWith: '.mat-form-field-label-wrapper'
},
{
replace: '.mat-input-prefix',
replaceWith: '.mat-form-field-prefix'
},
{
replace: '.mat-input-ripple',
replaceWith: '.mat-form-field-ripple'
},
{
replace: '.mat-input-subscript-wrapper',
replaceWith: '.mat-form-field-subscript-wrapper'
},
{
replace: '.mat-input-suffix',
replaceWith: '.mat-form-field-suffix'
},
{
replace: '.mat-input-underline',
replaceWith: '.mat-form-field-underline'
},
{
replace: '.mat-input-wrapper',
replaceWith: '.mat-form-field-wrapper'
}
]
},
export const cssSelectors: VersionChanges<MaterialCssSelectorData> = {
[TargetVersion.V6]: [
{
pr: 'https://github.com/angular/material2/pull/10296',
changes: [
{
replace: '.mat-form-field-placeholder',
replaceWith: '.mat-form-field-label'
},
{
replace: '.mat-input-container',
replaceWith: '.mat-form-field'
},
{
replace: '.mat-input-flex',
replaceWith: '.mat-form-field-flex'
},
{
replace: '.mat-input-hint-spacer',
replaceWith: '.mat-form-field-hint-spacer'
},
{
replace: '.mat-input-hint-wrapper',
replaceWith: '.mat-form-field-hint-wrapper'
},
{
replace: '.mat-input-infix',
replaceWith: '.mat-form-field-infix'
},
{
replace: '.mat-input-invalid',
replaceWith: '.mat-form-field-invalid'
},
{
replace: '.mat-input-placeholder',
replaceWith: '.mat-form-field-label'
},
{
replace: '.mat-input-placeholder-wrapper',
replaceWith: '.mat-form-field-label-wrapper'
},
{
replace: '.mat-input-prefix',
replaceWith: '.mat-form-field-prefix'
},
{
replace: '.mat-input-ripple',
replaceWith: '.mat-form-field-ripple'
},
{
replace: '.mat-input-subscript-wrapper',
replaceWith: '.mat-form-field-subscript-wrapper'
},
{
replace: '.mat-input-suffix',
replaceWith: '.mat-form-field-suffix'
},
{
replace: '.mat-input-underline',
replaceWith: '.mat-form-field-underline'
},
{
replace: '.mat-input-wrapper',
replaceWith: '.mat-form-field-wrapper'
}
]
},

// TODO(devversion): this shouldn't be here because it's not a CSS selector. Move into misc rule.
{
pr: 'https://github.com/angular/material2/pull/10430',
changes: [
{
replace: '$mat-font-family',
replaceWith: "Roboto, 'Helvetica Neue', sans-serif",
whitelist: {
stylesheet: true
// TODO(devversion): this shouldn't be here because it's not a CSS selector. Move into misc
// rule.
{
pr: 'https://github.com/angular/material2/pull/10430',
changes: [
{
replace: '$mat-font-family',
replaceWith: "Roboto, 'Helvetica Neue', sans-serif",
whitelist: {
stylesheet: true
}
}
}
]
}
]);
]
}
]
};
27 changes: 15 additions & 12 deletions src/lib/schematics/update/material/data/element-selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

import {transformChanges} from '../transform-change-data';
import {TargetVersion} from '../../index';
import {VersionChanges} from '../transform-change-data';

export interface MaterialElementSelectorData {
/** The element name to replace. */
Expand All @@ -15,14 +16,16 @@ export interface MaterialElementSelectorData {
replaceWith: string;
}

export const elementSelectors = transformChanges<MaterialElementSelectorData>([
{
pr: 'https://github.com/angular/material2/pull/10297',
changes: [
{
replace: 'mat-input-container',
replaceWith: 'mat-form-field'
}
]
}
]);
export const elementSelectors: VersionChanges<MaterialElementSelectorData> = {
[TargetVersion.V6]: [
{
pr: 'https://github.com/angular/material2/pull/10297',
changes: [
{
replace: 'mat-input-container',
replaceWith: 'mat-form-field'
}
]
}
]
};
Loading