Skip to content

Commit

Permalink
refactor!: remove deprecated core-enums, TuiColor, colorFallback, DEF…
Browse files Browse the repository at this point in the history
…AULT_COLORS, TuiColorHandler (#2158)
  • Loading branch information
vladimirpotekhin authored and splincode committed Jul 29, 2022
1 parent 309cb84 commit d8cfaab
Show file tree
Hide file tree
Showing 117 changed files with 599 additions and 1,192 deletions.
100 changes: 50 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 9 additions & 15 deletions projects/addon-charts/components/bar-chart/bar-chart.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core';
import {TUI_DEFAULT_COLOR_HANDLER} from '@taiga-ui/addon-charts/constants';
import {TuiColorHandler} from '@taiga-ui/addon-charts/types';
import {
sum,
TuiContextWithImplicit,
Expand All @@ -9,7 +7,7 @@ import {
TuiMapper,
tuiPure,
} from '@taiga-ui/cdk';
import {TuiHintModeT, TuiSizeL, TuiSizeS} from '@taiga-ui/core';
import {TuiHintMode, TuiSizeL, TuiSizeS} from '@taiga-ui/core';
import {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';

// eslint-disable-next-line @typescript-eslint/naming-convention
Expand All @@ -19,12 +17,12 @@ export function valueAssertion(value: ReadonlyArray<readonly number[]>): boolean
return valid;
}

const VALUE_ERROR = `All arrays must be of the same length`;
const VALUE_ERROR = 'All arrays must be of the same length';

@Component({
selector: `tui-bar-chart`,
templateUrl: `./bar-chart.template.html`,
styleUrls: [`./bar-chart.style.less`],
selector: 'tui-bar-chart',
templateUrl: './bar-chart.template.html',
styleUrls: ['./bar-chart.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TuiBarChartComponent {
Expand All @@ -40,23 +38,19 @@ export class TuiBarChartComponent {

@Input()
@tuiDefaultProp()
colorHandler: TuiColorHandler = TUI_DEFAULT_COLOR_HANDLER;

@Input()
@tuiDefaultProp()
size: TuiSizeS | TuiSizeL | null = `m`;
size: TuiSizeS | TuiSizeL | null = 'm';

@Input()
@tuiDefaultProp()
collapsed = false;

@Input()
@tuiDefaultProp()
hintContent: PolymorpheusContent<TuiContextWithImplicit<number>> = ``;
hintContent: PolymorpheusContent<TuiContextWithImplicit<number>> = '';

@Input()
@tuiDefaultProp()
hintMode: TuiHintModeT | null = null;
hintMode: TuiHintMode | null = null;

constructor(@Inject(TuiIdService) idService: TuiIdService) {
this.autoIdString = idService.generate();
Expand Down Expand Up @@ -88,7 +82,7 @@ export class TuiBarChartComponent {
) => (100 * (collapsed ? sum(...set) : Math.max(...set))) / max;

getHint(hint: PolymorpheusContent): PolymorpheusContent {
return this.hasHint ? hint : ``;
return this.hasHint ? hint : '';
}

getHintId(index: number): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
[value]="set"
[size]="size"
[collapsed]="collapsed"
[colorHandler]="colorHandler"
></tui-bar-set>
</div>
<ng-template
Expand Down
Loading

0 comments on commit d8cfaab

Please sign in to comment.