From f6700d174992c436262a728727bd222b8befee55 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Mon, 8 May 2023 06:14:26 +0200 Subject: [PATCH] refactor(multiple): simplify ngSkipHydration expressions We don't need to specify a value for `ngSkipHydration`. --- src/cdk/table/table.ts | 2 +- src/material/autocomplete/autocomplete.ts | 2 +- src/material/chips/chip-listbox.ts | 2 +- src/material/legacy-autocomplete/autocomplete.ts | 2 +- src/material/legacy-chips/chip-list.ts | 2 +- src/material/legacy-form-field/form-field.ts | 2 +- src/material/legacy-menu/menu.ts | 2 +- src/material/legacy-select/select.ts | 2 +- src/material/legacy-table/table.ts | 2 +- src/material/legacy-tabs/tab-group.ts | 2 +- src/material/menu/menu.ts | 2 +- src/material/select/select.ts | 2 +- src/material/sidenav/drawer.ts | 6 +++--- src/material/sidenav/sidenav.ts | 6 +++--- src/material/stepper/stepper.ts | 2 +- src/material/table/table.ts | 2 +- src/material/tabs/tab-group.ts | 2 +- 17 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/cdk/table/table.ts b/src/cdk/table/table.ts index f68d60b9e539..3668a2d0b0f5 100644 --- a/src/cdk/table/table.ts +++ b/src/cdk/table/table.ts @@ -205,7 +205,7 @@ export interface RenderRow { host: { 'class': 'cdk-table', '[class.cdk-table-fixed-layout]': 'fixedLayout', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, encapsulation: ViewEncapsulation.None, // The "OnPush" status for the `MatTable` component is effectively a noop, so we are removing it. diff --git a/src/material/autocomplete/autocomplete.ts b/src/material/autocomplete/autocomplete.ts index ef9844e8dcbc..d707a7aac1d2 100644 --- a/src/material/autocomplete/autocomplete.ts +++ b/src/material/autocomplete/autocomplete.ts @@ -338,7 +338,7 @@ export abstract class _MatAutocompleteBase inputs: ['disableRipple'], host: { 'class': 'mat-mdc-autocomplete', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, providers: [{provide: MAT_OPTION_PARENT_COMPONENT, useExisting: MatAutocomplete}], animations: [panelAnimation], diff --git a/src/material/chips/chip-listbox.ts b/src/material/chips/chip-listbox.ts index 3f0e7eb5344f..542543e17e65 100644 --- a/src/material/chips/chip-listbox.ts +++ b/src/material/chips/chip-listbox.ts @@ -75,7 +75,7 @@ export const MAT_CHIP_LISTBOX_CONTROL_VALUE_ACCESSOR: any = { '[attr.aria-disabled]': 'disabled.toString()', '[attr.aria-multiselectable]': 'multiple', '[attr.aria-orientation]': 'ariaOrientation', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', '[class.mat-mdc-chip-list-disabled]': 'disabled', '[class.mat-mdc-chip-list-required]': 'required', '(focus)': 'focus()', diff --git a/src/material/legacy-autocomplete/autocomplete.ts b/src/material/legacy-autocomplete/autocomplete.ts index 5c1f1ad0e855..2fca99864382 100644 --- a/src/material/legacy-autocomplete/autocomplete.ts +++ b/src/material/legacy-autocomplete/autocomplete.ts @@ -35,7 +35,7 @@ import {_MatAutocompleteBase} from '@angular/material/autocomplete'; inputs: ['disableRipple'], host: { 'class': 'mat-autocomplete', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, providers: [{provide: MAT_LEGACY_OPTION_PARENT_COMPONENT, useExisting: MatLegacyAutocomplete}], }) diff --git a/src/material/legacy-chips/chip-list.ts b/src/material/legacy-chips/chip-list.ts index 491279b55f5c..dc7f17da615c 100644 --- a/src/material/legacy-chips/chip-list.ts +++ b/src/material/legacy-chips/chip-list.ts @@ -109,7 +109,7 @@ export class MatLegacyChipListChange { '(blur)': '_blur()', '(keydown)': '_keydown($event)', '[id]': '_uid', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, providers: [{provide: MatLegacyFormFieldControl, useExisting: MatLegacyChipList}], styleUrls: ['chips.css'], diff --git a/src/material/legacy-form-field/form-field.ts b/src/material/legacy-form-field/form-field.ts index e3f8858cfbe3..b988d8dade9c 100644 --- a/src/material/legacy-form-field/form-field.ts +++ b/src/material/legacy-form-field/form-field.ts @@ -153,7 +153,7 @@ export const MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS = '[class.ng-invalid]': '_shouldForward("invalid")', '[class.ng-pending]': '_shouldForward("pending")', '[class._mat-animation-noopable]': '!_animationsEnabled', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, inputs: ['color'], encapsulation: ViewEncapsulation.None, diff --git a/src/material/legacy-menu/menu.ts b/src/material/legacy-menu/menu.ts index b08fc89c3d62..a996c2a14c59 100644 --- a/src/material/legacy-menu/menu.ts +++ b/src/material/legacy-menu/menu.ts @@ -39,7 +39,7 @@ import { '[attr.aria-label]': 'null', '[attr.aria-labelledby]': 'null', '[attr.aria-describedby]': 'null', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, animations: [matMenuAnimations.transformMenu, matMenuAnimations.fadeInItems], providers: [{provide: MAT_MENU_PANEL, useExisting: MatLegacyMenu}], diff --git a/src/material/legacy-select/select.ts b/src/material/legacy-select/select.ts index a63fde7061f6..84a018e74ccd 100644 --- a/src/material/legacy-select/select.ts +++ b/src/material/legacy-select/select.ts @@ -149,7 +149,7 @@ export class MatLegacySelectTrigger {} '(keydown)': '_handleKeydown($event)', '(focus)': '_onFocus()', '(blur)': '_onBlur()', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, animations: [ matLegacySelectAnimations.transformPanelWrap, diff --git a/src/material/legacy-table/table.ts b/src/material/legacy-table/table.ts index ce827873c91b..fa8bcb04a3d5 100644 --- a/src/material/legacy-table/table.ts +++ b/src/material/legacy-table/table.ts @@ -46,7 +46,7 @@ export class MatLegacyRecycleRows {} host: { 'class': 'mat-table', '[class.mat-table-fixed-layout]': 'fixedLayout', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, providers: [ // TODO(michaeljamesparsons) Abstract the view repeater strategy to a directive API so this code diff --git a/src/material/legacy-tabs/tab-group.ts b/src/material/legacy-tabs/tab-group.ts index f73ad6645ae4..a2173371d51e 100644 --- a/src/material/legacy-tabs/tab-group.ts +++ b/src/material/legacy-tabs/tab-group.ts @@ -54,7 +54,7 @@ import { 'class': 'mat-tab-group', '[class.mat-tab-group-dynamic-height]': 'dynamicHeight', '[class.mat-tab-group-inverted-header]': 'headerPosition === "below"', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, }) export class MatLegacyTabGroup extends _MatTabGroupBase { diff --git a/src/material/menu/menu.ts b/src/material/menu/menu.ts index 0846822ed049..2947ce104c61 100644 --- a/src/material/menu/menu.ts +++ b/src/material/menu/menu.ts @@ -551,7 +551,7 @@ export class _MatMenuBase '[attr.aria-label]': 'null', '[attr.aria-labelledby]': 'null', '[attr.aria-describedby]': 'null', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, animations: [matMenuAnimations.transformMenu, matMenuAnimations.fadeInItems], providers: [{provide: MAT_MENU_PANEL, useExisting: MatMenu}], diff --git a/src/material/select/select.ts b/src/material/select/select.ts index 70a77cb88fa9..b9db8e89460b 100644 --- a/src/material/select/select.ts +++ b/src/material/select/select.ts @@ -1261,7 +1261,7 @@ export class MatSelectTrigger {} '[attr.aria-disabled]': 'disabled.toString()', '[attr.aria-invalid]': 'errorState', '[attr.aria-activedescendant]': '_getAriaActiveDescendant()', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', '[class.mat-mdc-select-disabled]': 'disabled', '[class.mat-mdc-select-invalid]': 'errorState', '[class.mat-mdc-select-required]': 'required', diff --git a/src/material/sidenav/drawer.ts b/src/material/sidenav/drawer.ts index c9b08c7b352d..342124513a0d 100644 --- a/src/material/sidenav/drawer.ts +++ b/src/material/sidenav/drawer.ts @@ -101,7 +101,7 @@ export function MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY(): boolean { 'class': 'mat-drawer-content', '[style.margin-left.px]': '_container._contentMargins.left', '[style.margin-right.px]': '_container._contentMargins.right', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, @@ -151,7 +151,7 @@ export class MatDrawerContent extends CdkScrollable implements AfterContentInit '[@transform]': '_animationState', '(@transform.start)': '_animationStarted.next($event)', '(@transform.done)': '_animationEnd.next($event)', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, @@ -637,7 +637,7 @@ export class MatDrawer implements AfterViewInit, AfterContentChecked, OnDestroy host: { 'class': 'mat-drawer-container', '[class.mat-drawer-container-explicit-backdrop]': '_backdropOverride', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, diff --git a/src/material/sidenav/sidenav.ts b/src/material/sidenav/sidenav.ts index 53023974b273..417d00f76ed5 100644 --- a/src/material/sidenav/sidenav.ts +++ b/src/material/sidenav/sidenav.ts @@ -37,7 +37,7 @@ import {ScrollDispatcher, CdkScrollable} from '@angular/cdk/scrolling'; 'class': 'mat-drawer-content mat-sidenav-content', '[style.margin-left.px]': '_container._contentMargins.left', '[style.margin-right.px]': '_container._contentMargins.right', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, @@ -78,7 +78,7 @@ export class MatSidenavContent extends MatDrawerContent { '[class.mat-sidenav-fixed]': 'fixedInViewport', '[style.top.px]': 'fixedInViewport ? fixedTopGap : null', '[style.bottom.px]': 'fixedInViewport ? fixedBottomGap : null', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, @@ -129,7 +129,7 @@ export class MatSidenav extends MatDrawer { host: { 'class': 'mat-drawer-container mat-sidenav-container', '[class.mat-drawer-container-explicit-backdrop]': '_backdropOverride', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, diff --git a/src/material/stepper/stepper.ts b/src/material/stepper/stepper.ts index 73645969b901..9d05f72bf380 100644 --- a/src/material/stepper/stepper.ts +++ b/src/material/stepper/stepper.ts @@ -139,7 +139,7 @@ export class MatStep extends CdkStep implements ErrorStateMatcher, AfterContentI '[class.mat-stepper-header-position-bottom]': 'headerPosition === "bottom"', '[attr.aria-orientation]': 'orientation', 'role': 'tablist', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, animations: [ matStepperAnimations.horizontalStepTransition, diff --git a/src/material/table/table.ts b/src/material/table/table.ts index befd1dbc834e..688bdb4756a7 100644 --- a/src/material/table/table.ts +++ b/src/material/table/table.ts @@ -45,7 +45,7 @@ export class MatRecycleRows {} host: { 'class': 'mat-mdc-table mdc-data-table__table', '[class.mdc-table-fixed-layout]': 'fixedLayout', - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', }, providers: [ {provide: CdkTable, useExisting: MatTable}, diff --git a/src/material/tabs/tab-group.ts b/src/material/tabs/tab-group.ts index 4157bf08ab14..2fa1abc41491 100644 --- a/src/material/tabs/tab-group.ts +++ b/src/material/tabs/tab-group.ts @@ -523,7 +523,7 @@ export abstract class _MatTabGroupBase }, ], host: { - 'ngSkipHydration': 'true', + 'ngSkipHydration': '', 'class': 'mat-mdc-tab-group', '[class.mat-mdc-tab-group-dynamic-height]': 'dynamicHeight', '[class.mat-mdc-tab-group-inverted-header]': 'headerPosition === "below"',