Skip to content

Commit

Permalink
feat: migrate to polymorpheus 4 and update other deps (#2165)
Browse files Browse the repository at this point in the history
  • Loading branch information
waterplea authored and splincode committed Aug 30, 2022
1 parent 3e4dfd2 commit cb86c77
Show file tree
Hide file tree
Showing 159 changed files with 1,557 additions and 1,660 deletions.
912 changes: 488 additions & 424 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@
polymorpheus
>
<div
polymorpheus-outlet
*polymorpheusOutlet="hintContent as text; context: getContentContext(index)"
class="t-text"
[content]="hintContent"
[context]="getContentContext(index)"
[textContent]="text"
></div>
</ng-template>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,19 @@
[style.bottom.%]="getBottom(point[1])"
></div>
<ng-template #hint>
<div
*ngIf="hintDirective; else single"
polymorpheus-outlet
class="t-text"
[content]="hintDirective.hint"
[context]="getContentContext(point, index)"
></div>
<ng-container *ngIf="hintDirective; else single">
<div
*polymorpheusOutlet="hintDirective.hint as text; context: getContentContext(point, index)"
class="t-text"
[textContent]="text"
></div>
</ng-container>
<ng-template #single>
<!-- TODO: Polymorpheus fix type -->
<div
polymorpheus-outlet
*polymorpheusOutlet="$any(hintContent) as text; context: {$implicit: point, index: index}"
class="t-text"
[content]="hintContent"
[context]="{$implicit: point, index: index}"
[textContent]="text"
></div>
</ng-template>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
#hint
let-point
>
<div
polymorpheus-outlet
[content]="hintContent"
[context]="getHintContext(point[0], value)"
></div>
<ng-container *polymorpheusOutlet="hintContent as text; context: getHintContext(point[0], value)">
{{ text }}
</ng-container>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@
let-index
>
<div
polymorpheus-outlet
*polymorpheusOutlet="hintContent as text; context: {$implicit: index}"
class="t-text"
[content]="hintContent"
[context]="{$implicit: index}"
[textContent]="text"
></div>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ import {
Output,
} from '@angular/core';
import {TUI_DEFAULT_COLOR_HANDLER} from '@taiga-ui/addon-charts/constants';
import {TuiRingChartContext} from '@taiga-ui/addon-charts/interfaces';
import {TuiColorHandler} from '@taiga-ui/addon-charts/types';
import {tuiDefaultProp} from '@taiga-ui/cdk';
import {TuiSizeS, TuiSizeXL} from '@taiga-ui/core';
import {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';

// TODO: 3.0 Refactor to use ng-content
@Component({
selector: `tui-ring-chart`,
templateUrl: `./ring-chart.template.html`,
styleUrls: [`./ring-chart.style.less`],
selector: 'tui-ring-chart',
templateUrl: './ring-chart.template.html',
styleUrls: ['./ring-chart.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TuiRingChartComponent {
Expand All @@ -26,20 +23,15 @@ export class TuiRingChartComponent {
value: readonly number[] = [];

@Input()
@HostBinding(`attr.data-size`)
@HostBinding('attr.data-size')
@tuiDefaultProp()
size: TuiSizeS | TuiSizeXL = `m`;
size: TuiSizeS | TuiSizeXL = 'm';

/** @deprecated */
@Input()
@tuiDefaultProp()
colorHandler: TuiColorHandler = TUI_DEFAULT_COLOR_HANDLER;

/** @deprecated */
@Input()
@tuiDefaultProp()
content: PolymorpheusContent<TuiRingChartContext> = ``;

@Input()
@tuiDefaultProp()
masked = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
<div class="t-content">
<div
*ngIf="content; else ngContent"
polymorpheus-outlet
automation-id="tui-ring-chart__content"
class="t-wrapper"
[content]="content"
[context]="{$implicit: activeItemIndex, value: value}"
></div>
<ng-template #ngContent>
<div class="t-wrapper">
<ng-content></ng-content>
</div>
</ng-template>
<div class="t-wrapper">
<ng-content></ng-content>
</div>
</div>

<tui-pie-chart
Expand Down
1 change: 0 additions & 1 deletion projects/addon-charts/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './line-chart-hint-context';
export * from './ring-chart-context';
5 changes: 0 additions & 5 deletions projects/addon-charts/interfaces/ring-chart-context.ts

This file was deleted.

4 changes: 2 additions & 2 deletions projects/addon-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"peerDependencies": {
"@angular/common": ">=9.0.0",
"@angular/core": ">=9.0.0",
"@ng-web-apis/common": ">=1.12.1 < 2",
"@ng-web-apis/common": ">=2.0.0",
"@taiga-ui/cdk": ">=2.62.1",
"@taiga-ui/core": ">=2.62.1",
"@tinkoff/ng-polymorpheus": ">=3.1.12 < 4"
"@tinkoff/ng-polymorpheus": ">=4.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class TuiInputCardGroupedComponent

@Input()
@tuiDefaultProp()
cardSrc: PolymorpheusContent | null = null; // TODO: 3.0 will be deleted `null` in v3.0
cardSrc: PolymorpheusContent = '';

@Input()
@tuiDefaultProp()
Expand Down Expand Up @@ -198,15 +198,15 @@ export class TuiInputCardGroupedComponent
}

get card(): string {
return this.value?.card ?? '';
return this.value?.card || '';
}

get expire(): string {
return this.value?.expire ?? '';
return this.value?.expire || '';
}

get cvc(): string {
return this.value?.cvc ?? '';
return this.value?.cvc || '';
}

get hasCleaner(): boolean {
Expand All @@ -223,8 +223,8 @@ export class TuiInputCardGroupedComponent
return paymentSystem && ICONS[paymentSystem];
}

get icon(): PolymorpheusContent | null {
return this.cardSrc ?? this.defaultIcon;
get icon(): PolymorpheusContent {
return this.cardSrc || this.defaultIcon;
}

get bin(): string | null {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
}

.t-icon-outlet {
display: inherit;
display: flex;
}

.t-icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,14 @@
<div class="t-icons">
<div
*ngIf="icon"
polymorpheus-outlet
class="t-icon-outlet"
[content]="icon"
>
<ng-template let-icon>
<tui-svg
automation-id="tui-input-card-grouped__icon"
class="t-card"
[src]="icon"
></tui-svg>
</ng-template>
<tui-svg
*polymorpheusOutlet="icon as text"
automation-id="tui-input-card-grouped__icon"
class="t-card"
[src]="text"
></tui-svg>
</div>
<tui-svg
*ngIf="hasCleaner"
Expand Down
Loading

0 comments on commit cb86c77

Please sign in to comment.