refactor(snack-bar): remove 6.0.0 deletion targets (#10253)

Removes the targets marked for deletion in 6.0.0 inside the `material/snack-bar` entry point.

BREAKING CHANGES:
* `extraClasses` which was deprecated in 5.0.0 has been removed. Use `panelClass` instead.
This commit is contained in:
Kristiyan Kostadinov
2018-03-09 10:30:46 -05:00
committed by Jeremy Elbourn
parent 158b1dbc0b
commit 88bb6f3f35
2 changed files with 8 additions and 26 deletions
-7
View File
@@ -38,13 +38,6 @@ export class MatSnackBarConfig<D = any> {
/** Extra CSS classes to be added to the snack bar container. */
panelClass?: string | string[];
/**
* Extra CSS classes to be added to the snack bar container.
* @deprecated Use `panelClass` instead.
* @deletion-target 6.0.0
*/
extraClasses?: string | string[];
/** Text layout direction for the snack bar. */
direction?: Direction;
+8 -19
View File
@@ -141,29 +141,18 @@ export class MatSnackBarContainer extends BasePortalOutlet implements OnDestroy
});
}
/** Applies the user-specified list of CSS classes to the element. */
private _setCssClasses(classList: undefined|string|string[]) {
if (!classList) {
return;
}
const element = this._elementRef.nativeElement;
if (Array.isArray(classList)) {
// Note that we can't use a spread here, because IE doesn't support multiple arguments.
classList.forEach(cssClass => element.classList.add(cssClass));
} else {
element.classList.add(classList);
}
}
/** Applies the various positioning and user-configured CSS classes to the snack bar. */
private _applySnackBarClasses() {
const element: HTMLElement = this._elementRef.nativeElement;
const panelClasses = this.snackBarConfig.panelClass;
if (this.snackBarConfig.panelClass || this.snackBarConfig.extraClasses) {
this._setCssClasses(this.snackBarConfig.panelClass);
this._setCssClasses(this.snackBarConfig.extraClasses);
if (panelClasses) {
if (Array.isArray(panelClasses)) {
// Note that we can't use a spread here, because IE doesn't support multiple arguments.
panelClasses.forEach(cssClass => element.classList.add(cssClass));
} else {
element.classList.add(panelClasses);
}
}
if (this.snackBarConfig.horizontalPosition === 'center') {