Skip to content

Commit

Permalink
refactor: drop ngStyle (#9882)
Browse files Browse the repository at this point in the history
Co-authored-by: taiga-family-bot <[email protected]>
  • Loading branch information
splincode and taiga-family-bot authored Dec 3, 2024
1 parent 84fd6e4 commit 15f2a46
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 15 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@ npm-debug.log
/compiled/
dll/
tmp/
*.ngfactory.ts
*.css.shim.ts
*.ngsummary.json
*.shim.ngstyle.ts
.idea
*.iml
*/tmp
.rpt2_cache
quality-check
.DS_Store
dist
**/cypress/screenshots
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {AsyncPipe, NgStyle} from '@angular/common';
import {AsyncPipe} from '@angular/common';
import {ChangeDetectionStrategy, Component, inject, Input, Output} from '@angular/core';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {tuiScrollFrom, tuiZonefree} from '@taiga-ui/cdk/observables';
Expand All @@ -7,7 +7,7 @@ import type {TuiContext, TuiHandler} from '@taiga-ui/cdk/types';
import {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';
import {TUI_SCROLL_REF} from '@taiga-ui/core/tokens';
import type {PolymorpheusContent} from '@taiga-ui/polymorpheus';
import {PolymorpheusOutlet, PolymorpheusTemplate} from '@taiga-ui/polymorpheus';
import {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';
import type {Observable} from 'rxjs';
import {distinctUntilChanged, filter, map, startWith} from 'rxjs';

Expand All @@ -20,7 +20,7 @@ import {MICRO_OFFSET, TuiPullToRefreshService} from './pull-to-refresh.service';
@Component({
standalone: true,
selector: 'tui-pull-to-refresh',
imports: [AsyncPipe, NgStyle, PolymorpheusOutlet, PolymorpheusTemplate],
imports: [AsyncPipe, PolymorpheusOutlet],
templateUrl: './pull-to-refresh.template.html',
styleUrls: ['./pull-to-refresh.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand All @@ -41,7 +41,7 @@ export class TuiPullToRefresh {
);

@Input()
public styleHandler: TuiHandler<number, Record<string, any> | null> = this.isIOS
public styleHandler: TuiHandler<number, Record<string, unknown> | null> = this.isIOS
? (distance) => ({top: tuiPx(distance / 2)})
: () => null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<div
[class.t-drop]="dropped$ | async"
[ngStyle]="styleHandler((pulling$ | async) || 0)"
[style.position]="'relative'"
[style]="styleHandler((pulling$ | async) || 0)"
>
<ng-content />
</div>
3 changes: 1 addition & 2 deletions projects/kit/components/carousel/carousel.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {AsyncPipe, NgForOf, NgIf, NgStyle, NgTemplateOutlet} from '@angular/common';
import {AsyncPipe, NgForOf, NgIf, NgTemplateOutlet} from '@angular/common';
import type {QueryList} from '@angular/core';
import {
ChangeDetectionStrategy,
Expand Down Expand Up @@ -33,7 +33,6 @@ import {TuiCarouselScroll} from './carousel-scroll.directive';
AsyncPipe,
NgForOf,
NgIf,
NgStyle,
NgTemplateOutlet,
TuiCarouselAutoscroll,
TuiCarouselScroll,
Expand Down
2 changes: 1 addition & 1 deletion projects/kit/components/carousel/carousel.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*ngFor="let item of items; let i = index"
class="t-item"
[disabled]="isDisabled(i)"
[ngStyle]="getStyle(itemsCount)"
[style]="getStyle(itemsCount)"
(waIntersectionObservee)="$event[0] && onIntersection($event[0], i)"
>
<ng-container [ngTemplateOutlet]="item" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<ng-container *tuiLet="rotate$ | async as deg">
<div
class="t-bar"
[ngStyle]="{transform: 'rotate(-' + deg + 'deg)'}"
[style]="{transform: 'rotate(-' + deg + 'deg)'}"
></div>
<ng-content *ngIf="deg" />
<div
class="t-bar"
[ngStyle]="{transform: 'rotate(' + deg + 'deg)'}"
[style]="{transform: 'rotate(' + deg + 'deg)'}"
></div>
</ng-container>

0 comments on commit 15f2a46

Please sign in to comment.