Skip to content

refactor(multiple): Updated components to use host binding for ngSkipHydration #26763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2023
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
1 change: 1 addition & 0 deletions src/cdk/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export interface RenderRow<T> {
host: {
'class': 'cdk-table',
'[class.cdk-table-fixed-layout]': 'fixedLayout',
'ngSkipHydration': 'true',
},
encapsulation: ViewEncapsulation.None,
// The "OnPush" status for the `MatTable` component is effectively a noop, so we are removing it.
Expand Down
1 change: 1 addition & 0 deletions src/material/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ export abstract class _MatAutocompleteBase
inputs: ['disableRipple'],
host: {
'class': 'mat-mdc-autocomplete',
'ngSkipHydration': 'true',
},
providers: [{provide: MAT_OPTION_PARENT_COMPONENT, useExisting: MatAutocomplete}],
animations: [panelAnimation],
Expand Down
1 change: 1 addition & 0 deletions src/material/chips/chip-listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +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',
'[class.mat-mdc-chip-list-disabled]': 'disabled',
'[class.mat-mdc-chip-list-required]': 'required',
'(focus)': 'focus()',
Expand Down
1 change: 1 addition & 0 deletions src/material/legacy-autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {_MatAutocompleteBase} from '@angular/material/autocomplete';
inputs: ['disableRipple'],
host: {
'class': 'mat-autocomplete',
'ngSkipHydration': 'true',
},
providers: [{provide: MAT_LEGACY_OPTION_PARENT_COMPONENT, useExisting: MatLegacyAutocomplete}],
})
Expand Down
1 change: 1 addition & 0 deletions src/material/legacy-chips/chip-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export class MatLegacyChipListChange {
'(blur)': '_blur()',
'(keydown)': '_keydown($event)',
'[id]': '_uid',
'ngSkipHydration': 'true',
},
providers: [{provide: MatLegacyFormFieldControl, useExisting: MatLegacyChipList}],
styleUrls: ['chips.css'],
Expand Down
1 change: 1 addition & 0 deletions src/material/legacy-form-field/form-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +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',
},
inputs: ['color'],
encapsulation: ViewEncapsulation.None,
Expand Down
1 change: 1 addition & 0 deletions src/material/legacy-menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
'[attr.aria-label]': 'null',
'[attr.aria-labelledby]': 'null',
'[attr.aria-describedby]': 'null',
'ngSkipHydration': 'true',
},
animations: [matMenuAnimations.transformMenu, matMenuAnimations.fadeInItems],
providers: [{provide: MAT_MENU_PANEL, useExisting: MatLegacyMenu}],
Expand Down
1 change: 1 addition & 0 deletions src/material/legacy-select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export class MatLegacySelectTrigger {}
'(keydown)': '_handleKeydown($event)',
'(focus)': '_onFocus()',
'(blur)': '_onBlur()',
'ngSkipHydration': 'true',
},
animations: [
matLegacySelectAnimations.transformPanelWrap,
Expand Down
1 change: 1 addition & 0 deletions src/material/legacy-table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class MatLegacyRecycleRows {}
host: {
'class': 'mat-table',
'[class.mat-table-fixed-layout]': 'fixedLayout',
'ngSkipHydration': 'true',
},
providers: [
// TODO(michaeljamesparsons) Abstract the view repeater strategy to a directive API so this code
Expand Down
1 change: 1 addition & 0 deletions src/material/legacy-tabs/tab-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {
'class': 'mat-tab-group',
'[class.mat-tab-group-dynamic-height]': 'dynamicHeight',
'[class.mat-tab-group-inverted-header]': 'headerPosition === "below"',
'ngSkipHydration': 'true',
},
})
export class MatLegacyTabGroup extends _MatTabGroupBase {
Expand Down
1 change: 1 addition & 0 deletions src/material/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ export class _MatMenuBase
'[attr.aria-label]': 'null',
'[attr.aria-labelledby]': 'null',
'[attr.aria-describedby]': 'null',
'ngSkipHydration': 'true',
},
animations: [matMenuAnimations.transformMenu, matMenuAnimations.fadeInItems],
providers: [{provide: MAT_MENU_PANEL, useExisting: MatMenu}],
Expand Down
1 change: 1 addition & 0 deletions src/material/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,7 @@ export class MatSelectTrigger {}
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.aria-invalid]': 'errorState',
'[attr.aria-activedescendant]': '_getAriaActiveDescendant()',
'ngSkipHydration': 'true',
'[class.mat-mdc-select-disabled]': 'disabled',
'[class.mat-mdc-select-invalid]': 'errorState',
'[class.mat-mdc-select-required]': 'required',
Expand Down
3 changes: 3 additions & 0 deletions src/material/sidenav/drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +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',
},
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
Expand Down Expand Up @@ -150,6 +151,7 @@ export class MatDrawerContent extends CdkScrollable implements AfterContentInit
'[@transform]': '_animationState',
'(@transform.start)': '_animationStarted.next($event)',
'(@transform.done)': '_animationEnd.next($event)',
'ngSkipHydration': 'true',
},
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
Expand Down Expand Up @@ -635,6 +637,7 @@ export class MatDrawer implements AfterViewInit, AfterContentChecked, OnDestroy
host: {
'class': 'mat-drawer-container',
'[class.mat-drawer-container-explicit-backdrop]': '_backdropOverride',
'ngSkipHydration': 'true',
},
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
Expand Down
3 changes: 3 additions & 0 deletions src/material/sidenav/sidenav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +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',
},
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
Expand Down Expand Up @@ -77,6 +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',
},
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
Expand Down Expand Up @@ -127,6 +129,7 @@ export class MatSidenav extends MatDrawer {
host: {
'class': 'mat-drawer-container mat-sidenav-container',
'[class.mat-drawer-container-explicit-backdrop]': '_backdropOverride',
'ngSkipHydration': 'true',
},
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
Expand Down
5 changes: 4 additions & 1 deletion src/material/sort/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ const _MatSortBase = mixinInitialized(mixinDisabled(class {}));
@Directive({
selector: '[matSort]',
exportAs: 'matSort',
host: {'class': 'mat-sort'},
host: {
'class': 'mat-sort',
'ngSkipHydration': 'true',
},
inputs: ['disabled: matSortDisabled'],
})
export class MatSort
Expand Down
1 change: 1 addition & 0 deletions src/material/stepper/stepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,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',
},
animations: [
matStepperAnimations.horizontalStepTransition,
Expand Down
1 change: 1 addition & 0 deletions src/material/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export class MatRecycleRows {}
host: {
'class': 'mat-mdc-table mdc-data-table__table',
'[class.mdc-table-fixed-layout]': 'fixedLayout',
'ngSkipHydration': 'true',
},
providers: [
{provide: CdkTable, useExisting: MatTable},
Expand Down
1 change: 1 addition & 0 deletions src/material/tabs/tab-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ export abstract class _MatTabGroupBase
},
],
host: {
'ngSkipHydration': 'true',
'class': 'mat-mdc-tab-group',
'[class.mat-mdc-tab-group-dynamic-height]': 'dynamicHeight',
'[class.mat-mdc-tab-group-inverted-header]': 'headerPosition === "below"',
Expand Down