Skip to content

Commit

Permalink
fix(legacy): during serialization angular was unable to find an eleme…
Browse files Browse the repository at this point in the history
…nt in the DOM (#9063)

Co-authored-by: taiga-family-bot <[email protected]>
  • Loading branch information
splincode and taiga-family-bot authored Sep 19, 2024
1 parent 0635555 commit 7817c18
Show file tree
Hide file tree
Showing 50 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions projects/legacy/components/arrow/arrow.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {TUI_ARROW_OPTIONS} from './arrow.options';
styleUrls: ['./arrow.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
'[class._rotated]': 'rotated',
'[class._small]': 'small',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const HEX_MODE_LENGTH = 6;
templateUrl: './color-edit.template.html',
styleUrls: ['./color-edit.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
},
})
export class TuiColorEditComponent {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import type {TuiPoint} from '@taiga-ui/core/types';
templateUrl: './color-picker.template.html',
styleUrls: ['./color-picker.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
},
})
export class TuiColorPickerComponent {
private readonly sanitizer = inject(DomSanitizer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ import {
templateUrl: './color-selector.template.html',
styleUrls: ['./color-selector.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
},
})
export class TuiColorSelectorComponent {
private readonly selectorOptions = inject(TUI_COLOR_SELECTOR_OPTIONS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import {TuiPickerService} from '../services/picker.service';
styleUrls: ['./flat-picker.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [TuiPickerService],
host: {
ngSkipHydration: 'true',
},
})
export class TuiFlatPickerComponent {
protected readonly $ = inject(TuiPickerService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {TuiPickerService} from '../services/picker.service';
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [TuiPickerService],
host: {
ngSkipHydration: 'true',
'(document:mouseup)': 'onMouseUp()',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import {TuiPickerService} from '../services/picker.service';
styleUrls: ['./linear-picker.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [TuiPickerService],
host: {
ngSkipHydration: 'true',
},
})
export class TuiLinearPickerComponent {
protected readonly $ = inject(TuiPickerService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import {
templateUrl: './palette.template.html',
styleUrls: ['./palette.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
},
})
export class TuiPaletteComponent {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import type {PolymorpheusContent} from '@taiga-ui/polymorpheus';
],
viewProviders: [FIXED_DROPDOWN_CONTROLLER_PROVIDER],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type MaskMode = 'gradient' | 'hex' | 'rgb';
changeDetection: ChangeDetectionStrategy.OnPush,
viewProviders: [tuiDropdownOptionsProvider({maxHeight: 600})],
host: {
ngSkipHydration: 'true',
'(click)': 'onClick()',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {TUI_INPUT_COPY_OPTIONS} from './input-copy.options';
tuiAsControl(TuiInputCopyComponent),
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import {map} from 'rxjs';
TUI_MOBILE_CALENDAR_PROVIDER,
],
host: {
ngSkipHydration: 'true',
'[class._editable]': 'editable',
'[attr.data-size]': 'size',
'(click)': 'onClick()',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import {map} from 'rxjs';
TUI_MOBILE_CALENDAR_PROVIDER,
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
'(click)': 'onClick()',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const DATE_TIME_SEPARATOR = ', ';
tuiDateStreamWithTransformer(TUI_DATE_TIME_VALUE_TRANSFORMER),
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
'(click)': 'onClick()',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import {map} from 'rxjs';
TUI_MOBILE_CALENDAR_PROVIDER,
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
'(click)': 'onClick()',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
TuiMonthPipe,
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
TuiMonthPipe,
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const TUI_NUMBER_VALUE_TRANSFORMER = new InjectionToken<
TEXTFIELD_CONTROLLER_PROVIDER,
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
'(keydown.arrowDown)': 'onArrow(-step)',
'(keydown.arrowUp)': 'onArrow(step)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {TUI_INPUT_PASSWORD_OPTIONS} from './input-password.options';
tuiAsControl(TuiInputPasswordComponent),
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const MASK_SYMBOLS = /[ \-_()]/g;
],
viewProviders: [FIXED_DROPDOWN_CONTROLLER_PROVIDER],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
'(paste.capture.prevent.stop)': 'onPaste($event)',
'(drop.capture.prevent.stop)': 'onPaste($event)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function isText(value: string): boolean {
],
viewProviders: [FIXED_DROPDOWN_CONTROLLER_PROVIDER],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import type {PolymorpheusContent} from '@taiga-ui/polymorpheus';
TEXTFIELD_CONTROLLER_PROVIDER,
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'controller.size',
'[class._label-outside]': 'controller.labelOutside',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import type {PolymorpheusContent} from '@taiga-ui/polymorpheus';
TEXTFIELD_CONTROLLER_PROVIDER,
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'controller.size',
'[class._label-outside]': 'controller.labelOutside',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const TAG_VERTICAL_SPACE_REM = 0.125;
],
viewProviders: [FIXED_DROPDOWN_CONTROLLER_PROVIDER],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
'[class._icon-start]': 'iconStart',
'[class._expandable]': 'expandable',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {TUI_INPUT_TIME_OPTIONS} from './input-time.options';
],
viewProviders: [FIXED_DROPDOWN_CONTROLLER_PROVIDER],
host: {
ngSkipHydration: 'true',
'(click)': 'onClick()',
'[attr.data-size]': 'size',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import type {TuiInputTimeDirective} from '../input-time.directive';
styleUrls: ['./native-time.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
type: 'time',
'[attr.list]': 'autoId',
'[tabIndex]': '-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const UP_TO_4_DIGITS_REG = /^\d{0,4}$/;
tuiAsControl(TuiInputYearComponent),
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
},
})
Expand Down
1 change: 1 addition & 0 deletions projects/legacy/components/input/input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import type {PolymorpheusContent} from '@taiga-ui/polymorpheus';
],
viewProviders: [FIXED_DROPDOWN_CONTROLLER_PROVIDER],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import {TuiSelectOptionComponent} from '@taiga-ui/legacy/components/select-optio
templateUrl: './multi-select-option.template.html',
styleUrls: ['./multi-select-option.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
},
})
export class TuiMultiSelectOptionComponent<
T extends any[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {combineLatest, map} from 'rxjs';
styleUrls: ['./multi-select-group.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
'[class._label]': 'label',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import {AbstractTuiNativeMultiSelect} from './native-multi-select/native-multi-s
],
viewProviders: [FIXED_DROPDOWN_CONTROLLER_PROVIDER],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
'[class._editable]': 'editable',
'[class._expandable]': 'rows > 1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {AbstractTuiNativeMultiSelect} from './native-multi-select';
},
],
host: {
ngSkipHydration: 'true',
'[attr.aria-invalid]': 'host.invalid',
'[disabled]': 'host.disabled || control.readOnly',
'[tabIndex]': 'host.focusable ? 0 : -1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {AbstractTuiNativeMultiSelect} from './native-multi-select';
},
],
host: {
ngSkipHydration: 'true',
'[attr.aria-invalid]': 'host.invalid',
'[disabled]': 'host.disabled || control.readOnly',
'[tabIndex]': 'host.focusable ? 0 : -1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const TUI_ICON_START_PADDINGS: Record<TuiSizeL | TuiSizeS, number> = {
TEXTFIELD_CONTROLLER_PROVIDER,
],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
'[class._readonly]': 'readOnly',
'[class._hidden]': 'inputHidden',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {TUI_TEXTFIELD_HOST} from '@taiga-ui/legacy/tokens';
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [TEXTFIELD_CONTROLLER_PROVIDER],
host: {
ngSkipHydration: 'true',
type: 'text',
'[attr.id]': 'id',
'[attr.inputMode]': 'inputMode',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type {TuiPrimitiveTextfield} from '../primitive-textfield-types';
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
changeDetection: ChangeDetectionStrategy.Default,
host: {
ngSkipHydration: 'true',
'[class._table]': 'isContextTable',
'[class._filler]': 'filler',
'(animationstart)': 'ngDoCheck()',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import {distinctUntilChanged, EMPTY, map, merge, startWith, Subject} from 'rxjs'
templateUrl: './select-option.template.html',
styleUrls: ['./select-option.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
},
})
export class TuiSelectOptionComponent<T> implements OnInit, DoCheck {
private readonly host = inject<TuiDataListHost<T>>(TUI_DATA_LIST_HOST);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {TuiSelectDirective} from '../select.directive';
},
],
host: {
ngSkipHydration: 'true',
'[attr.aria-invalid]': 'host.invalid',
'[disabled]': 'host.disabled || control.readOnly',
'[tabIndex]': 'host.focusable ? 0 : -1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {TuiSelectDirective} from '../select.directive';
},
],
host: {
ngSkipHydration: 'true',
'[attr.aria-invalid]': 'host.invalid',
'[disabled]': 'host.disabled || control.readOnly',
'[tabIndex]': 'host.focusable ? 0 : -1',
Expand Down
1 change: 1 addition & 0 deletions projects/legacy/components/select/select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import {TUI_SELECT_OPTIONS} from './select.options';
],
viewProviders: [FIXED_DROPDOWN_CONTROLLER_PROVIDER],
host: {
ngSkipHydration: 'true',
'[attr.data-size]': 'size',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import {TUI_SHEET, TUI_SHEET_SCROLL} from '../../sheet-tokens';
templateUrl: './sheet-bar.template.html',
styleUrls: ['./sheet-bar.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
},
})
export class TuiSheetBarComponent {
private readonly sheet = inject(TUI_SHEET);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export const TUI_SHEET_ID = 'tui-sheet-id';
templateUrl: './sheet-heading.template.html',
styleUrls: ['./sheet-heading.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
},
})
export class TuiSheetHeadingComponent implements AfterViewInit {
private readonly el = tuiInjectElement();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {TUI_SHEET_PROVIDERS} from './sheet.providers';
providers: TUI_SHEET_PROVIDERS,
animations: [tuiSlideInTop],
host: {
ngSkipHydration: 'true',
role: 'dialog',
'[attr.aria-labelledby]': 'id',
'[class._ios]': 'isIos',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import {TuiSheetService} from '../../sheet.service';
styleUrls: ['./sheets-host.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [tuiSlideInTop, tuiFadeIn],
host: {
ngSkipHydration: 'true',
},
})
export class TuiSheetsHostComponent implements OnInit {
private readonly service = inject(TuiSheetService);
Expand Down
3 changes: 3 additions & 0 deletions projects/legacy/components/svg/svg.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export interface TuiIconError {
templateUrl: './svg.template.html',
styleUrls: ['./svg.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
ngSkipHydration: 'true',
},
})
export class TuiSvgComponent {
private icon: TuiSafeHtml = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type {TuiTableBarOptions} from './table-bar.options';
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [tuiSlideInTop, tuiParentAnimation],
host: {
ngSkipHydration: 'true',
'[@tuiSlideInTop]': 'animation',
'[attr.data-appearance]': 'context.mode',
},
Expand Down
Loading

0 comments on commit 7817c18

Please sign in to comment.