@taiga-ui/addon-charts 4.52.0-canary.ece97e9 → 4.52.0-canary.efbd0d4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/README.md +2 -2
  2. package/components/arc-chart/arc-chart.component.d.ts +15 -14
  3. package/components/axes/axes.component.d.ts +23 -19
  4. package/components/line-chart/line-chart-hint.directive.d.ts +3 -3
  5. package/components/line-chart/line-chart.component.d.ts +4 -3
  6. package/components/line-chart/line-chart.options.d.ts +1 -3
  7. package/fesm2022/taiga-ui-addon-charts-components-arc-chart.mjs +34 -51
  8. package/fesm2022/taiga-ui-addon-charts-components-arc-chart.mjs.map +1 -1
  9. package/fesm2022/taiga-ui-addon-charts-components-axes.mjs +38 -64
  10. package/fesm2022/taiga-ui-addon-charts-components-axes.mjs.map +1 -1
  11. package/fesm2022/taiga-ui-addon-charts-components-bar-chart.mjs +7 -8
  12. package/fesm2022/taiga-ui-addon-charts-components-bar-chart.mjs.map +1 -1
  13. package/fesm2022/taiga-ui-addon-charts-components-bar-set.mjs +4 -4
  14. package/fesm2022/taiga-ui-addon-charts-components-bar.mjs +3 -3
  15. package/fesm2022/taiga-ui-addon-charts-components-legend-item.mjs +4 -4
  16. package/fesm2022/taiga-ui-addon-charts-components-line-chart.mjs +26 -31
  17. package/fesm2022/taiga-ui-addon-charts-components-line-chart.mjs.map +1 -1
  18. package/fesm2022/taiga-ui-addon-charts-components-line-days-chart.mjs +13 -14
  19. package/fesm2022/taiga-ui-addon-charts-components-line-days-chart.mjs.map +1 -1
  20. package/fesm2022/taiga-ui-addon-charts-components-pie-chart.mjs +12 -15
  21. package/fesm2022/taiga-ui-addon-charts-components-pie-chart.mjs.map +1 -1
  22. package/fesm2022/taiga-ui-addon-charts-components-ring-chart.mjs +4 -4
  23. package/fesm2022/taiga-ui-addon-charts-components-ring-chart.mjs.map +1 -1
  24. package/fesm2022/taiga-ui-addon-charts-utils.mjs +6 -3
  25. package/fesm2022/taiga-ui-addon-charts-utils.mjs.map +1 -1
  26. package/package.json +5 -2
package/README.md CHANGED
@@ -16,13 +16,13 @@ consisting of multiple base libraries and several add-ons
16
16
 
17
17
  Install base packages:
18
18
 
19
- ```
19
+ ```bash
20
20
  npm i @taiga-ui/{cdk,core}
21
21
  ```
22
22
 
23
23
  Install addon-charts:
24
24
 
25
- ```
25
+ ```bash
26
26
  npm i @taiga-ui/addon-charts
27
27
  ```
28
28
 
@@ -1,19 +1,20 @@
1
- import { type ElementRef, type QueryList } from '@angular/core';
2
1
  import { type TuiSizeXL } from '@taiga-ui/core/types';
3
- import { type Observable } from 'rxjs';
4
2
  import * as i0 from "@angular/core";
5
3
  export declare class TuiArcChart {
6
- private readonly arcs$;
7
- protected initialized: import("@angular/core").WritableSignal<boolean>;
8
- protected readonly $: import("rxjs").Subscription;
9
- value: readonly number[];
10
- size: TuiSizeXL;
11
- max: number;
12
- minLabel: string;
13
- maxLabel: string;
14
- activeItemIndex: number;
15
- readonly activeItemIndexChange: Observable<number>;
16
- protected set arcs(arcs: QueryList<ElementRef<SVGElement>>);
4
+ private readonly arcs;
5
+ private readonly indexChange$;
6
+ protected readonly initialized: import("@angular/core").Signal<boolean>;
7
+ readonly value: import("@angular/core").InputSignal<readonly number[]>;
8
+ readonly size: import("@angular/core").InputSignal<TuiSizeXL>;
9
+ readonly max: import("@angular/core").InputSignal<number>;
10
+ readonly minLabel: import("@angular/core").InputSignal<string>;
11
+ readonly maxLabel: import("@angular/core").InputSignal<string>;
12
+ /**
13
+ * Set to change the index of the active arc.
14
+ * Will be overridden by hover state.
15
+ */
16
+ readonly activeItemIndex: import("@angular/core").ModelSignal<number>;
17
+ readonly activeItemIndexChange: import("@angular/core").OutputRef<number>;
17
18
  protected get width(): number;
18
19
  protected get strokeWidth(): number;
19
20
  protected isInactive(index: number): boolean;
@@ -22,5 +23,5 @@ export declare class TuiArcChart {
22
23
  protected getLength(index: number): number;
23
24
  protected getOffset(index: number): number;
24
25
  static ɵfac: i0.ɵɵFactoryDeclaration<TuiArcChart, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<TuiArcChart, "tui-arc-chart", never, { "value": { "alias": "value"; "required": false; }; "size": { "alias": "size"; "required": false; }; "max": { "alias": "max"; "required": false; }; "minLabel": { "alias": "minLabel"; "required": false; }; "maxLabel": { "alias": "maxLabel"; "required": false; }; "activeItemIndex": { "alias": "activeItemIndex"; "required": false; }; }, { "activeItemIndexChange": "activeItemIndexChange"; }, never, ["*"], true, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<TuiArcChart, "tui-arc-chart", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "minLabel": { "alias": "minLabel"; "required": false; "isSignal": true; }; "maxLabel": { "alias": "maxLabel"; "required": false; "isSignal": true; }; "activeItemIndex": { "alias": "activeItemIndex"; "required": false; "isSignal": true; }; }, { "activeItemIndex": "activeItemIndexChange"; "activeItemIndexChange": "activeItemIndexChange"; }, never, ["*"], true, never>;
26
27
  }
@@ -5,24 +5,28 @@ export declare const TUI_ALWAYS_DOTTED: TuiLineHandler;
5
5
  export declare const TUI_ALWAYS_SOLID: TuiLineHandler;
6
6
  export declare const TUI_ALWAYS_NONE: TuiLineHandler;
7
7
  export declare class TuiAxes {
8
- axisX: TuiLineType;
9
- axisXLabels: ReadonlyArray<string | null>;
10
- axisY: TuiLineType;
11
- axisYInset: boolean;
12
- axisYLabels: readonly string[];
13
- axisYName: string;
14
- axisYSecondaryInset: boolean;
15
- axisYSecondaryLabels: readonly string[];
16
- axisYSecondaryName: string;
17
- horizontalLines: number;
18
- horizontalLinesHandler: TuiLineHandler;
19
- verticalLines: number;
20
- verticalLinesHandler: TuiLineHandler;
21
- get hasXLabels(): boolean;
22
- get hasYLabels(): boolean;
23
- get hasYSecondaryLabels(): boolean;
24
- fallback(label: string | null): string;
25
- protected get centeredXLabels(): boolean;
8
+ protected readonly centeredXLabels: import("@angular/core").Signal<boolean>;
9
+ readonly axisX: import("@angular/core").InputSignal<TuiLineType>;
10
+ readonly axisXLabels: import("@angular/core").InputSignal<readonly (string | null)[]>;
11
+ readonly axisY: import("@angular/core").InputSignal<TuiLineType>;
12
+ readonly axisYInset: import("@angular/core").InputSignal<boolean>;
13
+ readonly axisYLabels: import("@angular/core").InputSignal<readonly string[]>;
14
+ readonly axisYName: import("@angular/core").InputSignal<string>;
15
+ readonly axisYSecondaryInset: import("@angular/core").InputSignal<boolean>;
16
+ readonly axisYSecondaryLabels: import("@angular/core").InputSignal<readonly string[]>;
17
+ readonly axisYSecondaryName: import("@angular/core").InputSignal<string>;
18
+ readonly horizontalLines: import("@angular/core").InputSignal<number>;
19
+ readonly horizontalLinesHandler: import("@angular/core").InputSignal<TuiLineHandler>;
20
+ readonly verticalLines: import("@angular/core").InputSignal<number>;
21
+ /**
22
+ * A function to handle vertical lines style.
23
+ * Initially set to always dashed.
24
+ */
25
+ readonly verticalLinesHandler: import("@angular/core").InputSignal<TuiLineHandler>;
26
+ readonly fallbackLabel = "\u00A0";
27
+ readonly hasXLabels: import("@angular/core").Signal<boolean>;
28
+ readonly hasYLabels: import("@angular/core").Signal<boolean>;
29
+ readonly hasYSecondaryLabels: import("@angular/core").Signal<boolean>;
26
30
  static ɵfac: i0.ɵɵFactoryDeclaration<TuiAxes, never>;
27
- static ɵcmp: i0.ɵɵComponentDeclaration<TuiAxes, "tui-axes", never, { "axisX": { "alias": "axisX"; "required": false; }; "axisXLabels": { "alias": "axisXLabels"; "required": false; }; "axisY": { "alias": "axisY"; "required": false; }; "axisYInset": { "alias": "axisYInset"; "required": false; }; "axisYLabels": { "alias": "axisYLabels"; "required": false; }; "axisYName": { "alias": "axisYName"; "required": false; }; "axisYSecondaryInset": { "alias": "axisYSecondaryInset"; "required": false; }; "axisYSecondaryLabels": { "alias": "axisYSecondaryLabels"; "required": false; }; "axisYSecondaryName": { "alias": "axisYSecondaryName"; "required": false; }; "horizontalLines": { "alias": "horizontalLines"; "required": false; }; "horizontalLinesHandler": { "alias": "horizontalLinesHandler"; "required": false; }; "verticalLines": { "alias": "verticalLines"; "required": false; }; "verticalLinesHandler": { "alias": "verticalLinesHandler"; "required": false; }; }, {}, never, ["*"], true, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<TuiAxes, "tui-axes", never, { "axisX": { "alias": "axisX"; "required": false; "isSignal": true; }; "axisXLabels": { "alias": "axisXLabels"; "required": false; "isSignal": true; }; "axisY": { "alias": "axisY"; "required": false; "isSignal": true; }; "axisYInset": { "alias": "axisYInset"; "required": false; "isSignal": true; }; "axisYLabels": { "alias": "axisYLabels"; "required": false; "isSignal": true; }; "axisYName": { "alias": "axisYName"; "required": false; "isSignal": true; }; "axisYSecondaryInset": { "alias": "axisYSecondaryInset"; "required": false; "isSignal": true; }; "axisYSecondaryLabels": { "alias": "axisYSecondaryLabels"; "required": false; "isSignal": true; }; "axisYSecondaryName": { "alias": "axisYSecondaryName"; "required": false; "isSignal": true; }; "horizontalLines": { "alias": "horizontalLines"; "required": false; "isSignal": true; }; "horizontalLinesHandler": { "alias": "horizontalLinesHandler"; "required": false; "isSignal": true; }; "verticalLines": { "alias": "verticalLines"; "required": false; "isSignal": true; }; "verticalLinesHandler": { "alias": "verticalLinesHandler"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
28
32
  }
@@ -1,4 +1,4 @@
1
- import { type AfterViewInit, type QueryList } from '@angular/core';
1
+ import { type AfterViewInit } from '@angular/core';
2
2
  import { type TuiContext } from '@taiga-ui/cdk/types';
3
3
  import { type TuiPoint } from '@taiga-ui/core/types';
4
4
  import { type PolymorpheusContent } from '@taiga-ui/polymorpheus';
@@ -20,6 +20,6 @@ export declare class TuiLineChartHint implements AfterViewInit {
20
20
  static ɵfac: i0.ɵɵFactoryDeclaration<TuiLineChartHint, never>;
21
21
  static ɵdir: i0.ɵɵDirectiveDeclaration<TuiLineChartHint, "[tuiLineChartHint]", never, { "hint": { "alias": "tuiLineChartHint"; "required": false; }; }, {}, ["charts", "chartsRef"], never, true, never>;
22
22
  }
23
- export declare function tuiLineChartDrivers(charts: QueryList<{
24
- drivers: QueryList<Observable<boolean>>;
23
+ export declare function tuiLineChartDrivers(charts: ReadonlyArray<{
24
+ drivers$: Observable<ReadonlyArray<Observable<boolean>>>;
25
25
  }>): Observable<boolean>;
@@ -1,7 +1,7 @@
1
- import { type OnChanges, type QueryList } from '@angular/core';
1
+ import { type OnChanges } from '@angular/core';
2
2
  import { type TuiLineChartHintContext } from '@taiga-ui/addon-charts/types';
3
3
  import { type TuiStringHandler } from '@taiga-ui/cdk/types';
4
- import { TuiHintOptionsDirective } from '@taiga-ui/core/directives/hint';
4
+ import { TuiHintHover, TuiHintOptionsDirective } from '@taiga-ui/core/portals/hint';
5
5
  import { type TuiPoint } from '@taiga-ui/core/types';
6
6
  import { type PolymorpheusContent } from '@taiga-ui/polymorpheus';
7
7
  import { type Observable } from 'rxjs';
@@ -17,7 +17,8 @@ export declare class TuiLineChart implements OnChanges {
17
17
  protected readonly hintDirective: TuiLineChartHint | null;
18
18
  protected readonly hintOptions: TuiHintOptionsDirective | null;
19
19
  protected readonly viewBox: import("@angular/core").Signal<string>;
20
- readonly drivers: QueryList<Observable<boolean>>;
20
+ readonly drivers: import("@angular/core").Signal<readonly TuiHintHover[]>;
21
+ readonly drivers$: Observable<readonly TuiHintHover[]>;
21
22
  x: number;
22
23
  y: number;
23
24
  width: number;
@@ -1,9 +1,7 @@
1
- import { InjectionToken, type Provider } from '@angular/core';
2
1
  export interface TuiLineChartOptions {
3
2
  readonly dots: boolean;
4
3
  readonly filled: boolean;
5
4
  readonly smoothingFactor: number;
6
5
  }
7
6
  export declare const TUI_LINE_CHART_DEFAULT_OPTIONS: TuiLineChartOptions;
8
- export declare const TUI_LINE_CHART_OPTIONS: InjectionToken<TuiLineChartOptions>;
9
- export declare function tuiLineChartOptionsProvider(options: Partial<TuiLineChartOptions>): Provider;
7
+ export declare const TUI_LINE_CHART_OPTIONS: import("@angular/core").InjectionToken<TuiLineChartOptions>, tuiLineChartOptionsProvider: (item: Partial<TuiLineChartOptions> | (() => Partial<TuiLineChartOptions>)) => import("@angular/core").FactoryProvider;
@@ -1,9 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, ViewChildren, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
- import { TuiRepeatTimes } from '@taiga-ui/cdk/directives/repeat-times';
2
+ import { viewChildren, input, model, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { toObservable, takeUntilDestroyed, toSignal, outputFromObservable } from '@angular/core/rxjs-interop';
5
4
  import { tuiTypedFromEvent, tuiZonefree } from '@taiga-ui/cdk/observables';
6
- import { merge, map, ReplaySubject, timer, switchMap, startWith, tap } from 'rxjs';
5
+ import { merge, map, switchMap, tap, timer, take } from 'rxjs';
7
6
 
8
7
  const ARC = 0.76; // 3/4 with 1% safety offset
9
8
  const SIZE = { m: 9, l: 11, xl: 16 };
@@ -14,74 +13,58 @@ function arcsToIndex(arcs) {
14
13
  }
15
14
  class TuiArcChart {
16
15
  constructor() {
17
- this.arcs$ = new ReplaySubject(1);
18
- this.initialized = signal(false);
19
- this.$ = timer(0)
20
- .pipe(tuiZonefree(), takeUntilDestroyed())
21
- .subscribe(() => this.initialized.set(true));
22
- this.value = [];
23
- this.size = 'm';
24
- this.max = 100;
25
- this.minLabel = '0%';
26
- this.maxLabel = '100%';
27
- this.activeItemIndex = NaN;
28
- this.activeItemIndexChange = this.arcs$.pipe(switchMap((arcs) => arcs.changes.pipe(startWith(null), switchMap(() => merge(...arcsToIndex(arcs))))), tap((index) => {
29
- this.activeItemIndex = index;
30
- }));
31
- }
32
- set arcs(arcs) {
33
- this.arcs$.next(arcs);
16
+ this.arcs = viewChildren('arc');
17
+ this.indexChange$ = toObservable(this.arcs).pipe(takeUntilDestroyed(), switchMap((arcs) => merge(...arcsToIndex(arcs)).pipe(tap((i) => this.activeItemIndex.set(i)))));
18
+ this.initialized = toSignal(timer(0).pipe(tuiZonefree(), take(1),
19
+ // The linter rule 'no-restricted-syntax' incorrectly flags 'map(() => true)' here,
20
+ // because the literal 'true' has type 'true' (not 'boolean'), which is intentional for this signal initialization.
21
+ map(() => true)), { initialValue: false });
22
+ this.value = input([]);
23
+ this.size = input('m');
24
+ this.max = input(100);
25
+ this.minLabel = input('0%');
26
+ this.maxLabel = input('100%');
27
+ /**
28
+ * Set to change the index of the active arc.
29
+ * Will be overridden by hover state.
30
+ */
31
+ this.activeItemIndex = model(NaN);
32
+ this.activeItemIndexChange = outputFromObservable(this.indexChange$);
34
33
  }
35
34
  get width() {
36
- return SIZE[this.size];
35
+ return SIZE[this.size()];
37
36
  }
38
37
  get strokeWidth() {
39
- return WIDTH[this.size];
38
+ return WIDTH[this.size()];
40
39
  }
41
40
  isInactive(index) {
42
- return !Number.isNaN(this.activeItemIndex) && index !== this.activeItemIndex;
41
+ return !Number.isNaN(this.activeItemIndex()) && index !== this.activeItemIndex();
43
42
  }
44
43
  getInset(index) {
45
- return this.strokeWidth / 2 + index * (this.strokeWidth + GAP[this.size]);
44
+ return this.strokeWidth / 2 + index * (this.strokeWidth + GAP[this.size()]);
46
45
  }
47
46
  getDiameter(index) {
48
- return SIZE[this.size] - 2 * this.getInset(index);
47
+ return SIZE[this.size()] - 2 * this.getInset(index);
49
48
  }
50
49
  getLength(index) {
51
50
  return Math.PI * this.getDiameter(index) * ARC;
52
51
  }
53
52
  getOffset(index) {
54
- return (this.getLength(index) * (1 - Math.min((this.value[index] || 0) / this.max, 1)));
53
+ return (this.getLength(index) *
54
+ (1 - Math.min((this.value()[index] || 0) / this.max(), 1)));
55
55
  }
56
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiArcChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
57
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiArcChart, isStandalone: true, selector: "tui-arc-chart", inputs: { value: "value", size: "size", max: "max", minLabel: "minLabel", maxLabel: "maxLabel", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "size", "style.width.rem": "width", "style.height.rem": "width", "style.strokeWidth.rem": "strokeWidth" } }, viewQueries: [{ propertyName: "arcs", predicate: ["arc"], descendants: true }], ngImport: i0, template: "<svg\n *tuiRepeatTimes=\"let index of value.length\"\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.rem]=\"getDiameter(index)\"\n [style.inset-block-start.rem]=\"getInset(index)\"\n [style.inset-inline-end.rem]=\"getInset(index)\"\n [style.inset-inline-start.rem]=\"getInset(index)\"\n>\n <path\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n />\n <path\n #arc\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n class=\"t-value\"\n [class.t-value_inactive]=\"isInactive(index)\"\n [style.stroke]=\"`var(--tui-chart-categorical-${index.toString().padStart(2, '0')})`\"\n [style.strokeDasharray.em]=\"getLength(index)\"\n [style.strokeDashoffset.em]=\"initialized() ? getOffset(index) : getLength(index)\"\n />\n</svg>\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n", styles: [":host{position:relative;display:block;flex-shrink:0}.t-svg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;color:var(--tui-background-neutral-1);font-size:1rem;pointer-events:none}.t-value{pointer-events:auto;transition:stroke-dashoffset var(--tui-duration) ease-in-out,opacity var(--tui-duration) ease-in-out .1s}.t-value_inactive{transition-property:stroke-dashoffset,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:.16}.t-content{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;justify-content:center;align-items:center;text-align:center;color:var(--tui-text-secondary);font:var(--tui-font-text-xs);pointer-events:none}:host[data-size=xl] .t-content{font:var(--tui-font-text-m)}.t-wrapper{pointer-events:auto}.t-wrapper:first-line{color:var(--tui-text-primary)}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-text-s);font-weight:700}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-text-m);font-weight:700}:host[data-size=xl] .t-wrapper:first-line{font:var(--tui-font-heading-5)}.t-percent{position:absolute;left:25%;bottom:11%;display:flex;inline-size:50%;justify-content:space-between;font:var(--tui-font-text-xs);color:var(--tui-text-secondary)}:host[data-size=xl] .t-percent{font:var(--tui-font-text-m)}\n"], dependencies: [{ kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
56
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiArcChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
57
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiArcChart, isStandalone: true, selector: "tui-arc-chart", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, minLabel: { classPropertyName: "minLabel", publicName: "minLabel", isSignal: true, isRequired: false, transformFunction: null }, maxLabel: { classPropertyName: "maxLabel", publicName: "maxLabel", isSignal: true, isRequired: false, transformFunction: null }, activeItemIndex: { classPropertyName: "activeItemIndex", publicName: "activeItemIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeItemIndex: "activeItemIndexChange", activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "size()", "style.width.rem": "width", "style.height.rem": "width", "style.strokeWidth.rem": "strokeWidth" } }, viewQueries: [{ propertyName: "arcs", predicate: ["arc"], descendants: true, isSignal: true }], ngImport: i0, template: "@let data = value();\n@let min = minLabel();\n@let max = maxLabel();\n@for (_ of '-'.repeat(data.length); track $index) {\n <svg\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.rem]=\"getDiameter($index)\"\n [style.inset-block-start.rem]=\"getInset($index)\"\n [style.inset-inline-end.rem]=\"getInset($index)\"\n [style.inset-inline-start.rem]=\"getInset($index)\"\n >\n <path\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n />\n <path\n #arc\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n class=\"t-value\"\n [class.t-value_inactive]=\"isInactive($index)\"\n [style.stroke]=\"`var(--tui-chart-categorical-${$index.toString().padStart(2, '0')})`\"\n [style.strokeDasharray.em]=\"getLength($index)\"\n [style.strokeDashoffset.em]=\"initialized() ? getOffset($index) : getLength($index)\"\n />\n </svg>\n}\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ min }}</span>\n <span>{{ max }}</span>\n</div>\n", styles: [":host{position:relative;display:block;flex-shrink:0}.t-svg{position:absolute;inset:0;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;color:var(--tui-background-neutral-1);font-size:1rem;pointer-events:none}.t-value{pointer-events:auto;transition:stroke-dashoffset var(--tui-duration) ease-in-out,opacity var(--tui-duration) ease-in-out .1s}.t-value_inactive{transition-property:stroke-dashoffset,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:.16}.t-content{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;justify-content:center;align-items:center;text-align:center;color:var(--tui-text-secondary);font:var(--tui-font-body-xs);pointer-events:none}:host[data-size=xl] .t-content{font:var(--tui-font-body-m)}.t-wrapper{pointer-events:auto}.t-wrapper:first-line{color:var(--tui-text-primary)}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-body-s);font-weight:700}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-body-m);font-weight:700}:host[data-size=xl] .t-wrapper:first-line{font:var(--tui-font-heading-h5)}.t-percent{position:absolute;left:25%;bottom:11%;display:flex;inline-size:50%;justify-content:space-between;font:var(--tui-font-body-xs);color:var(--tui-text-secondary)}:host[data-size=xl] .t-percent{font:var(--tui-font-body-m)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
58
58
  }
59
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiArcChart, decorators: [{
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiArcChart, decorators: [{
60
60
  type: Component,
61
- args: [{ selector: 'tui-arc-chart', imports: [TuiRepeatTimes], changeDetection: ChangeDetectionStrategy.OnPush, host: {
62
- '[attr.data-size]': 'size',
61
+ args: [{ selector: 'tui-arc-chart', changeDetection: ChangeDetectionStrategy.OnPush, host: {
62
+ '[attr.data-size]': 'size()',
63
63
  '[style.width.rem]': 'width',
64
64
  '[style.height.rem]': 'width',
65
65
  '[style.strokeWidth.rem]': 'strokeWidth',
66
- }, template: "<svg\n *tuiRepeatTimes=\"let index of value.length\"\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.rem]=\"getDiameter(index)\"\n [style.inset-block-start.rem]=\"getInset(index)\"\n [style.inset-inline-end.rem]=\"getInset(index)\"\n [style.inset-inline-start.rem]=\"getInset(index)\"\n>\n <path\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n />\n <path\n #arc\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n class=\"t-value\"\n [class.t-value_inactive]=\"isInactive(index)\"\n [style.stroke]=\"`var(--tui-chart-categorical-${index.toString().padStart(2, '0')})`\"\n [style.strokeDasharray.em]=\"getLength(index)\"\n [style.strokeDashoffset.em]=\"initialized() ? getOffset(index) : getLength(index)\"\n />\n</svg>\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n", styles: [":host{position:relative;display:block;flex-shrink:0}.t-svg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;color:var(--tui-background-neutral-1);font-size:1rem;pointer-events:none}.t-value{pointer-events:auto;transition:stroke-dashoffset var(--tui-duration) ease-in-out,opacity var(--tui-duration) ease-in-out .1s}.t-value_inactive{transition-property:stroke-dashoffset,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:.16}.t-content{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;justify-content:center;align-items:center;text-align:center;color:var(--tui-text-secondary);font:var(--tui-font-text-xs);pointer-events:none}:host[data-size=xl] .t-content{font:var(--tui-font-text-m)}.t-wrapper{pointer-events:auto}.t-wrapper:first-line{color:var(--tui-text-primary)}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-text-s);font-weight:700}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-text-m);font-weight:700}:host[data-size=xl] .t-wrapper:first-line{font:var(--tui-font-heading-5)}.t-percent{position:absolute;left:25%;bottom:11%;display:flex;inline-size:50%;justify-content:space-between;font:var(--tui-font-text-xs);color:var(--tui-text-secondary)}:host[data-size=xl] .t-percent{font:var(--tui-font-text-m)}\n"] }]
67
- }], propDecorators: { value: [{
68
- type: Input
69
- }], size: [{
70
- type: Input
71
- }], max: [{
72
- type: Input
73
- }], minLabel: [{
74
- type: Input
75
- }], maxLabel: [{
76
- type: Input
77
- }], activeItemIndex: [{
78
- type: Input
79
- }], activeItemIndexChange: [{
80
- type: Output
81
- }], arcs: [{
82
- type: ViewChildren,
83
- args: ['arc']
84
- }] } });
66
+ }, template: "@let data = value();\n@let min = minLabel();\n@let max = maxLabel();\n@for (_ of '-'.repeat(data.length); track $index) {\n <svg\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.rem]=\"getDiameter($index)\"\n [style.inset-block-start.rem]=\"getInset($index)\"\n [style.inset-inline-end.rem]=\"getInset($index)\"\n [style.inset-inline-start.rem]=\"getInset($index)\"\n >\n <path\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n />\n <path\n #arc\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n class=\"t-value\"\n [class.t-value_inactive]=\"isInactive($index)\"\n [style.stroke]=\"`var(--tui-chart-categorical-${$index.toString().padStart(2, '0')})`\"\n [style.strokeDasharray.em]=\"getLength($index)\"\n [style.strokeDashoffset.em]=\"initialized() ? getOffset($index) : getLength($index)\"\n />\n </svg>\n}\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ min }}</span>\n <span>{{ max }}</span>\n</div>\n", styles: [":host{position:relative;display:block;flex-shrink:0}.t-svg{position:absolute;inset:0;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;color:var(--tui-background-neutral-1);font-size:1rem;pointer-events:none}.t-value{pointer-events:auto;transition:stroke-dashoffset var(--tui-duration) ease-in-out,opacity var(--tui-duration) ease-in-out .1s}.t-value_inactive{transition-property:stroke-dashoffset,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:.16}.t-content{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;justify-content:center;align-items:center;text-align:center;color:var(--tui-text-secondary);font:var(--tui-font-body-xs);pointer-events:none}:host[data-size=xl] .t-content{font:var(--tui-font-body-m)}.t-wrapper{pointer-events:auto}.t-wrapper:first-line{color:var(--tui-text-primary)}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-body-s);font-weight:700}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-body-m);font-weight:700}:host[data-size=xl] .t-wrapper:first-line{font:var(--tui-font-heading-h5)}.t-percent{position:absolute;left:25%;bottom:11%;display:flex;inline-size:50%;justify-content:space-between;font:var(--tui-font-body-xs);color:var(--tui-text-secondary)}:host[data-size=xl] .t-percent{font:var(--tui-font-body-m)}\n"] }]
67
+ }] });
85
68
 
86
69
  /**
87
70
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-charts-components-arc-chart.mjs","sources":["../../../projects/addon-charts/components/arc-chart/arc-chart.component.ts","../../../projects/addon-charts/components/arc-chart/arc-chart.template.html","../../../projects/addon-charts/components/arc-chart/taiga-ui-addon-charts-components-arc-chart.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n Input,\n Output,\n type QueryList,\n signal,\n ViewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {tuiTypedFromEvent, tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {type TuiSizeXL} from '@taiga-ui/core/types';\nimport {\n map,\n merge,\n type Observable,\n ReplaySubject,\n startWith,\n switchMap,\n tap,\n timer,\n} from 'rxjs';\n\nconst ARC = 0.76; // 3/4 with 1% safety offset\nconst SIZE = {m: 9, l: 11, xl: 16} as const;\nconst WIDTH = {m: 0.25, l: 0.375, xl: 0.5625} as const;\nconst GAP = {m: 0.125, l: 0.1875, xl: 0.25} as const;\n\nfunction arcsToIndex(arcs: QueryList<ElementRef<SVGElement>>): Array<Observable<number>> {\n return arcs.map(({nativeElement}, index) =>\n merge(\n tuiTypedFromEvent(nativeElement, 'mouseenter').pipe(map(() => index)),\n tuiTypedFromEvent(nativeElement, 'mouseleave').pipe(map(() => NaN)),\n ),\n );\n}\n\n@Component({\n selector: 'tui-arc-chart',\n imports: [TuiRepeatTimes],\n templateUrl: './arc-chart.template.html',\n styleUrl: './arc-chart.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-size]': 'size',\n '[style.width.rem]': 'width',\n '[style.height.rem]': 'width',\n '[style.strokeWidth.rem]': 'strokeWidth',\n },\n})\nexport class TuiArcChart {\n private readonly arcs$ = new ReplaySubject<QueryList<ElementRef<SVGElement>>>(1);\n\n protected initialized = signal(false);\n\n protected readonly $ = timer(0)\n .pipe(tuiZonefree(), takeUntilDestroyed())\n .subscribe(() => this.initialized.set(true));\n\n @Input()\n public value: readonly number[] = [];\n\n @Input()\n public size: TuiSizeXL = 'm';\n\n @Input()\n public max = 100;\n\n @Input()\n public minLabel = '0%';\n\n @Input()\n public maxLabel = '100%';\n\n @Input()\n public activeItemIndex = NaN;\n\n @Output()\n public readonly activeItemIndexChange = this.arcs$.pipe(\n switchMap((arcs) =>\n arcs.changes.pipe(\n startWith(null),\n switchMap(() => merge(...arcsToIndex(arcs))),\n ),\n ),\n tap((index) => {\n this.activeItemIndex = index;\n }),\n );\n\n @ViewChildren('arc')\n protected set arcs(arcs: QueryList<ElementRef<SVGElement>>) {\n this.arcs$.next(arcs);\n }\n\n protected get width(): number {\n return SIZE[this.size];\n }\n\n protected get strokeWidth(): number {\n return WIDTH[this.size];\n }\n\n protected isInactive(index: number): boolean {\n return !Number.isNaN(this.activeItemIndex) && index !== this.activeItemIndex;\n }\n\n protected getInset(index: number): number {\n return this.strokeWidth / 2 + index * (this.strokeWidth + GAP[this.size]);\n }\n\n protected getDiameter(index: number): number {\n return SIZE[this.size] - 2 * this.getInset(index);\n }\n\n protected getLength(index: number): number {\n return Math.PI * this.getDiameter(index) * ARC;\n }\n\n protected getOffset(index: number): number {\n return (\n this.getLength(index) * (1 - Math.min((this.value[index] || 0) / this.max, 1))\n );\n }\n}\n","<svg\n *tuiRepeatTimes=\"let index of value.length\"\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.rem]=\"getDiameter(index)\"\n [style.inset-block-start.rem]=\"getInset(index)\"\n [style.inset-inline-end.rem]=\"getInset(index)\"\n [style.inset-inline-start.rem]=\"getInset(index)\"\n>\n <path\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n />\n <path\n #arc\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n class=\"t-value\"\n [class.t-value_inactive]=\"isInactive(index)\"\n [style.stroke]=\"`var(--tui-chart-categorical-${index.toString().padStart(2, '0')})`\"\n [style.strokeDasharray.em]=\"getLength(index)\"\n [style.strokeDashoffset.em]=\"initialized() ? getOffset(index) : getLength(index)\"\n />\n</svg>\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAyBA,MAAM,GAAG,GAAG,IAAI,CAAC;AACjB,MAAM,IAAI,GAAG,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAU;AAC3C,MAAM,KAAK,GAAG,EAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EA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BAAoB,EAAE,OAAO;AAC7B,wBAAA,yBAAyB,EAAE,aAAa;AAC3C,qBAAA,EAAA,QAAA,EAAA,qpCAAA,EAAA,MAAA,EAAA,CAAA,42CAAA,CAAA,EAAA;8BAYM,KAAK,EAAA,CAAA;sBADX;gBAIM,IAAI,EAAA,CAAA;sBADV;gBAIM,GAAG,EAAA,CAAA;sBADT;gBAIM,QAAQ,EAAA,CAAA;sBADd;gBAIM,QAAQ,EAAA,CAAA;sBADd;gBAIM,eAAe,EAAA,CAAA;sBADrB;gBAIe,qBAAqB,EAAA,CAAA;sBADpC;gBAca,IAAI,EAAA,CAAA;sBADjB,YAAY;uBAAC,KAAK;;;AE5FvB;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-charts-components-arc-chart.mjs","sources":["../../../projects/addon-charts/components/arc-chart/arc-chart.component.ts","../../../projects/addon-charts/components/arc-chart/arc-chart.template.html","../../../projects/addon-charts/components/arc-chart/taiga-ui-addon-charts-components-arc-chart.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n input,\n model,\n viewChildren,\n} from '@angular/core';\nimport {\n outputFromObservable,\n takeUntilDestroyed,\n toObservable,\n toSignal,\n} from '@angular/core/rxjs-interop';\nimport {tuiTypedFromEvent, tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {type TuiSizeXL} from '@taiga-ui/core/types';\nimport {map, merge, type Observable, switchMap, take, tap, timer} from 'rxjs';\n\nconst ARC = 0.76; // 3/4 with 1% safety offset\nconst SIZE = {m: 9, l: 11, xl: 16} as const;\nconst WIDTH = {m: 0.25, l: 0.375, xl: 0.5625} as const;\nconst GAP = {m: 0.125, l: 0.1875, xl: 0.25} as const;\n\nfunction arcsToIndex(arcs: Array<ElementRef<SVGElement>>): Array<Observable<number>> {\n return arcs.map(({nativeElement}, index) =>\n merge(\n tuiTypedFromEvent(nativeElement, 'mouseenter').pipe(map(() => index)),\n tuiTypedFromEvent(nativeElement, 'mouseleave').pipe(map(() => NaN)),\n ),\n );\n}\n\n@Component({\n selector: 'tui-arc-chart',\n templateUrl: './arc-chart.template.html',\n styleUrl: './arc-chart.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-size]': 'size()',\n '[style.width.rem]': 'width',\n '[style.height.rem]': 'width',\n '[style.strokeWidth.rem]': 'strokeWidth',\n },\n})\nexport class TuiArcChart {\n private readonly arcs = viewChildren<ElementRef<SVGElement>>('arc');\n\n private readonly indexChange$ = toObservable(this.arcs).pipe(\n takeUntilDestroyed(),\n switchMap((arcs) =>\n merge(...arcsToIndex(arcs as Array<ElementRef<SVGElement>>)).pipe(\n tap((i) => this.activeItemIndex.set(i)),\n ),\n ),\n );\n\n protected readonly initialized = toSignal(\n timer(0).pipe(\n tuiZonefree(),\n take(1),\n // The linter rule 'no-restricted-syntax' incorrectly flags 'map(() => true)' here,\n // because the literal 'true' has type 'true' (not 'boolean'), which is intentional for this signal initialization.\n map(() => true),\n ),\n {initialValue: false},\n );\n\n public readonly value = input<readonly number[]>([]);\n\n public readonly size = input<TuiSizeXL>('m');\n\n public readonly max = input(100);\n\n public readonly minLabel = input('0%');\n\n public readonly maxLabel = input('100%');\n\n /**\n * Set to change the index of the active arc.\n * Will be overridden by hover state.\n */\n public readonly activeItemIndex = model<number>(NaN);\n\n public readonly activeItemIndexChange = outputFromObservable(this.indexChange$);\n\n protected get width(): number {\n return SIZE[this.size()];\n }\n\n protected get strokeWidth(): number {\n return WIDTH[this.size()];\n }\n\n protected isInactive(index: number): boolean {\n return !Number.isNaN(this.activeItemIndex()) && index !== this.activeItemIndex();\n }\n\n protected getInset(index: number): number {\n return this.strokeWidth / 2 + index * (this.strokeWidth + GAP[this.size()]);\n }\n\n protected getDiameter(index: number): number {\n return SIZE[this.size()] - 2 * this.getInset(index);\n }\n\n protected getLength(index: number): number {\n return Math.PI * this.getDiameter(index) * ARC;\n }\n\n protected getOffset(index: number): number {\n return (\n this.getLength(index) *\n (1 - Math.min((this.value()[index] || 0) / this.max(), 1))\n );\n }\n}\n","@let data = value();\n@let min = minLabel();\n@let max = maxLabel();\n@for (_ of '-'.repeat(data.length); track $index) {\n <svg\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.rem]=\"getDiameter($index)\"\n [style.inset-block-start.rem]=\"getInset($index)\"\n [style.inset-inline-end.rem]=\"getInset($index)\"\n [style.inset-inline-start.rem]=\"getInset($index)\"\n >\n <path\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n />\n <path\n #arc\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n class=\"t-value\"\n [class.t-value_inactive]=\"isInactive($index)\"\n [style.stroke]=\"`var(--tui-chart-categorical-${$index.toString().padStart(2, '0')})`\"\n [style.strokeDasharray.em]=\"getLength($index)\"\n [style.strokeDashoffset.em]=\"initialized() ? getOffset($index) : getLength($index)\"\n />\n </svg>\n}\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ min }}</span>\n <span>{{ max }}</span>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAkBA,MAAM,GAAG,GAAG,IAAI,CAAC;AACjB,MAAM,IAAI,GAAG,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAU;AAC3C,MAAM,KAAK,GAAG,EAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAU;AACtD,MAAM,GAAG,GAAG,EAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAU;AAEpD,SAAS,WAAW,CAAC,IAAmC,EAAA;IACpD,OAAO,IAAI,C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EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAX,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,WAAW,0qCC5CxB,m0CAuCA,EAAA,MAAA,EAAA,CAAA,u1CAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FDKa,WAAW,EAAA,UAAA,EAAA,CAAA;kBAZvB,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAGR,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,kBAAkB,EAAE,QAAQ;AAC5B,wBAAA,mBAAmB,EAAE,OAAO;AAC5B,wBAAA,oBAAoB,EAAE,OAAO;AAC7B,wBAAA,yBAAyB,EAAE,aAAa;AAC3C,qBAAA,EAAA,QAAA,EAAA,m0CAAA,EAAA,MAAA,EAAA,CAAA,u1CAAA,CAAA,EAAA;;;AE1CL;;AAEG;;;;"}
@@ -1,7 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { computed, input, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { CHAR_NO_BREAK_SPACE } from '@taiga-ui/cdk/constants';
4
- import { TuiRepeatTimes } from '@taiga-ui/cdk/directives/repeat-times';
5
4
 
6
5
  const TUI_ALWAYS_DASHED = () => 'dashed';
7
6
  const TUI_ALWAYS_DOTTED = () => 'dotted';
@@ -9,72 +8,47 @@ const TUI_ALWAYS_SOLID = () => 'solid';
9
8
  const TUI_ALWAYS_NONE = () => 'none';
10
9
  class TuiAxes {
11
10
  constructor() {
12
- this.axisX = 'solid';
13
- this.axisXLabels = [];
14
- this.axisY = 'solid';
15
- this.axisYInset = false;
16
- this.axisYLabels = [];
17
- this.axisYName = '';
18
- this.axisYSecondaryInset = false;
19
- this.axisYSecondaryLabels = [];
20
- this.axisYSecondaryName = '';
21
- this.horizontalLines = 0;
22
- this.horizontalLinesHandler = TUI_ALWAYS_SOLID;
23
- this.verticalLines = 0;
24
- this.verticalLinesHandler = TUI_ALWAYS_DASHED;
11
+ this.centeredXLabels = computed(() => this.axisY() === 'none');
12
+ this.axisX = input('solid');
13
+ this.axisXLabels = input([]);
14
+ this.axisY = input('solid');
15
+ this.axisYInset = input(false);
16
+ this.axisYLabels = input([]);
17
+ this.axisYName = input('');
18
+ this.axisYSecondaryInset = input(false);
19
+ this.axisYSecondaryLabels = input([]);
20
+ this.axisYSecondaryName = input('');
21
+ this.horizontalLines = input(0);
22
+ this.horizontalLinesHandler = input(TUI_ALWAYS_SOLID);
23
+ this.verticalLines = input(0);
24
+ /**
25
+ * A function to handle vertical lines style.
26
+ * Initially set to always dashed.
27
+ */
28
+ this.verticalLinesHandler = input(TUI_ALWAYS_DASHED);
29
+ this.fallbackLabel = CHAR_NO_BREAK_SPACE;
30
+ this.hasXLabels = computed(() => !!this.axisXLabels().length);
31
+ this.hasYLabels = computed(() => {
32
+ // keep this to prevent tracking loss on short circuits
33
+ const yN = this.axisYName();
34
+ return (this.axisYLabels().length && !this.axisYInset()) || !!yN;
35
+ });
36
+ this.hasYSecondaryLabels = computed(() => {
37
+ // keep this to prevent tracking loss on short circuits
38
+ const ySN = this.axisYSecondaryName();
39
+ return ((this.axisYSecondaryLabels().length && !this.axisYSecondaryInset()) || !!ySN);
40
+ });
25
41
  }
26
- get hasXLabels() {
27
- return !!this.axisXLabels.length;
28
- }
29
- get hasYLabels() {
30
- return (!!this.axisYLabels.length && !this.axisYInset) || !!this.axisYName;
31
- }
32
- get hasYSecondaryLabels() {
33
- return ((!!this.axisYSecondaryLabels.length && !this.axisYSecondaryInset) ||
34
- !!this.axisYSecondaryName);
35
- }
36
- fallback(label) {
37
- return label || CHAR_NO_BREAK_SPACE;
38
- }
39
- get centeredXLabels() {
40
- return this.axisY === 'none';
41
- }
42
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAxes, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
43
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiAxes, isStandalone: true, selector: "tui-axes", inputs: { axisX: "axisX", axisXLabels: "axisXLabels", axisY: "axisY", axisYInset: "axisYInset", axisYLabels: "axisYLabels", axisYName: "axisYName", axisYSecondaryInset: "axisYSecondaryInset", axisYSecondaryLabels: "axisYSecondaryLabels", axisYSecondaryName: "axisYSecondaryName", horizontalLines: "horizontalLines", horizontalLinesHandler: "horizontalLinesHandler", verticalLines: "verticalLines", verticalLinesHandler: "verticalLinesHandler" }, host: { attributes: { "dir": "ltr" }, properties: { "class._centered": "centeredXLabels" } }, ngImport: i0, template: "@if (hasYLabels) {\n <div\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n >\n @if (axisYName) {\n <div\n automation-id=\"tui-axex__axis-y-name\"\n class=\"t-name t-name_primary\"\n >\n {{ axisYName }}\n </div>\n }\n @if (!axisYInset) {\n <div class=\"t-labels-y t-labels-y_primary\">\n @for (label of axisYLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n }\n </div>\n }\n </div>\n}\n<div class=\"t-wrapper\">\n <div\n class=\"t-grid\"\n [style.borderBottomStyle]=\"axisX\"\n [style.borderLeftStyle]=\"axisY\"\n >\n <div class=\"t-vertical\">\n <div\n *tuiRepeatTimes=\"let index of verticalLines\"\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.borderRightStyle]=\"verticalLinesHandler(index, verticalLines)\"\n ></div>\n </div>\n <div class=\"t-horizontal\">\n <div\n *tuiRepeatTimes=\"let index of horizontalLines\"\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.borderTopStyle]=\"horizontalLinesHandler(index, horizontalLines)\"\n ></div>\n </div>\n @if (axisYInset) {\n <div class=\"t-labels-y t-labels-y_inset\">\n @for (label of axisYLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n }\n </div>\n }\n @if (axisYSecondaryInset) {\n <div class=\"t-labels-y t-labels-y_inset t-labels-y_inset_secondary\">\n @for (label of axisYSecondaryLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n }\n </div>\n }\n <div class=\"t-content\">\n <ng-content />\n </div>\n </div>\n @if (hasXLabels) {\n <div class=\"t-labels-x\">\n @for (label of axisXLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-x-label\"\n class=\"t-label-x\"\n [class.t-label-x_transparent]=\"label === null\"\n >\n {{ fallback(label) }}\n </div>\n }\n </div>\n }\n</div>\n@if (hasYSecondaryLabels) {\n <div\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n >\n @if (!axisYSecondaryInset) {\n <div class=\"t-labels-y t-labels-y_secondary\">\n @for (label of axisYSecondaryLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n }\n </div>\n }\n @if (axisYSecondaryName) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-name\"\n class=\"t-name\"\n >\n {{ axisYSecondaryName }}\n </div>\n }\n </div>\n}\n", styles: [":host{display:flex}.t-wrapper{display:flex;flex:1;block-size:100%;flex-direction:column}.t-grid{position:relative;display:flex;flex:1;justify-content:space-around;align-items:flex-end;border-width:1px;border-color:var(--tui-border-normal);isolation:isolate}.t-horizontal{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;flex-direction:column}.t-vertical{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex}:host._centered .t-vertical:after{content:\"\";display:block;flex:1 0 1px}.t-line{flex:2 0 1px;box-sizing:border-box;border-width:1px;border-color:var(--tui-border-normal)}:host._centered .t-line_vertical:first-child{flex:1 0 1px;pointer-events:none}.t-side{display:flex;align-items:stretch}.t-side_padding{padding-block-end:2rem}.t-name{font:var(--tui-font-text-xs);writing-mode:tb;text-align:center;padding-block-end:.75rem;color:var(--tui-text-secondary)}.t-name_primary{transform:rotate(180deg)}.t-labels-y{display:flex;font:var(--tui-font-text-xs);flex-direction:column-reverse;justify-content:space-between;color:var(--tui-text-secondary)}.t-labels-y_primary{text-align:end;padding-inline-end:.75rem}.t-labels-y_secondary{padding-inline-start:.75rem}.t-labels-y_transparent{border-color:transparent}.t-labels-y_inset{position:absolute;top:.5625rem;left:.25rem;bottom:-.75rem;pointer-events:none}.t-labels-y_inset_secondary{left:auto;right:.25rem;text-align:end}.t-labels-x{position:relative;display:flex;font:var(--tui-font-text-xs);border-inline-end:1px solid transparent;color:var(--tui-text-secondary)}.t-label-x{block-size:.4375rem;border-inline-start:1px solid var(--tui-border-normal);flex:1;margin-block-end:1.5625rem}.t-label-x:before{content:\"\";display:block;block-size:.5625rem}.t-label-x_transparent{border-color:transparent}:host._centered .t-label-x{block-size:2rem;text-align:center;border:none;margin:0}:host:not(._centered) .t-label-x:last-child:not(:first-child){position:absolute;right:0;text-align:end;border-inline-start:none}.t-label-y:first-child{margin-block-end:-.375rem}.t-label-y:last-child{margin-block-start:-.375rem}.t-content{position:absolute;top:0;left:-1px;right:0;bottom:-1px;display:flex;align-items:flex-end}\n"], dependencies: [{ kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
42
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiAxes, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
43
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiAxes, isStandalone: true, selector: "tui-axes", inputs: { axisX: { classPropertyName: "axisX", publicName: "axisX", isSignal: true, isRequired: false, transformFunction: null }, axisXLabels: { classPropertyName: "axisXLabels", publicName: "axisXLabels", isSignal: true, isRequired: false, transformFunction: null }, axisY: { classPropertyName: "axisY", publicName: "axisY", isSignal: true, isRequired: false, transformFunction: null }, axisYInset: { classPropertyName: "axisYInset", publicName: "axisYInset", isSignal: true, isRequired: false, transformFunction: null }, axisYLabels: { classPropertyName: "axisYLabels", publicName: "axisYLabels", isSignal: true, isRequired: false, transformFunction: null }, axisYName: { classPropertyName: "axisYName", publicName: "axisYName", isSignal: true, isRequired: false, transformFunction: null }, axisYSecondaryInset: { classPropertyName: "axisYSecondaryInset", publicName: "axisYSecondaryInset", isSignal: true, isRequired: false, transformFunction: null }, axisYSecondaryLabels: { classPropertyName: "axisYSecondaryLabels", publicName: "axisYSecondaryLabels", isSignal: true, isRequired: false, transformFunction: null }, axisYSecondaryName: { classPropertyName: "axisYSecondaryName", publicName: "axisYSecondaryName", isSignal: true, isRequired: false, transformFunction: null }, horizontalLines: { classPropertyName: "horizontalLines", publicName: "horizontalLines", isSignal: true, isRequired: false, transformFunction: null }, horizontalLinesHandler: { classPropertyName: "horizontalLinesHandler", publicName: "horizontalLinesHandler", isSignal: true, isRequired: false, transformFunction: null }, verticalLines: { classPropertyName: "verticalLines", publicName: "verticalLines", isSignal: true, isRequired: false, transformFunction: null }, verticalLinesHandler: { classPropertyName: "verticalLinesHandler", publicName: "verticalLinesHandler", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "dir": "ltr" }, properties: { "class._centered": "centeredXLabels()" } }, ngImport: i0, template: "@let ySecLabels = axisYSecondaryLabels();\n@let ySecInset = axisYSecondaryInset();\n@let yLabels = axisYLabels();\n@let yInset = axisYInset();\n@let hasXs = hasXLabels();\n\n@if (hasYLabels()) {\n <div\n class=\"t-side\"\n [class.t-side_padding]=\"hasXs\"\n >\n @let yName = axisYName();\n @if (yName) {\n <div\n automation-id=\"tui-axex__axis-y-name\"\n class=\"t-name t-name_primary\"\n >\n {{ yName }}\n </div>\n }\n @if (!yInset) {\n <div class=\"t-labels-y t-labels-y_primary\">\n @for (label of yLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ label || fallbackLabel }}\n </div>\n }\n </div>\n }\n </div>\n}\n<div class=\"t-wrapper\">\n <div\n class=\"t-grid\"\n [style.borderBottomStyle]=\"axisX()\"\n [style.borderLeftStyle]=\"axisY()\"\n >\n <div class=\"t-vertical\">\n @let vLineFn = verticalLinesHandler();\n @let vLines = verticalLines();\n @for (_ of '-'.repeat(vLines); track $index) {\n <div\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.border-right-style]=\"vLineFn($index, vLines)\"\n ></div>\n }\n </div>\n <div class=\"t-horizontal\">\n @let hLineFn = horizontalLinesHandler();\n @let hLines = horizontalLines();\n @for (_ of '-'.repeat(hLines); track $index) {\n <div\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.border-top-style]=\"hLineFn($index, hLines)\"\n ></div>\n }\n </div>\n @if (yInset) {\n <div class=\"t-labels-y t-labels-y_inset\">\n @for (label of yLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ label || fallbackLabel }}\n </div>\n }\n </div>\n }\n @if (ySecInset) {\n <div class=\"t-labels-y t-labels-y_inset t-labels-y_inset_secondary\">\n @for (label of ySecLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ label || fallbackLabel }}\n </div>\n }\n </div>\n }\n <div class=\"t-content\">\n <ng-content />\n </div>\n </div>\n @if (hasXs) {\n <div class=\"t-labels-x\">\n @for (label of axisXLabels(); track label) {\n <div\n automation-id=\"tui-axex__axis-x-label\"\n class=\"t-label-x\"\n [class.t-label-x_transparent]=\"label === null\"\n >\n {{ label || fallbackLabel }}\n </div>\n }\n </div>\n }\n</div>\n@if (hasYSecondaryLabels()) {\n <div\n class=\"t-side\"\n [class.t-side_padding]=\"hasXs\"\n >\n @if (!ySecInset) {\n <div class=\"t-labels-y t-labels-y_secondary\">\n @for (label of ySecLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ label || fallbackLabel }}\n </div>\n }\n </div>\n }\n @let axisYSec = axisYSecondaryName();\n @if (axisYSec) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-name\"\n class=\"t-name\"\n >\n {{ axisYSec }}\n </div>\n }\n </div>\n}\n", styles: [":host{display:flex}.t-wrapper{display:flex;flex:1;block-size:100%;flex-direction:column}.t-grid{position:relative;display:flex;flex:1;justify-content:space-around;align-items:flex-end;border-width:1px;border-color:var(--tui-border-normal);isolation:isolate}.t-horizontal{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;flex-direction:column}.t-vertical{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex}:host._centered .t-vertical:after{content:\"\";display:block;flex:1 0 1px}.t-line{flex:2 0 1px;box-sizing:border-box;border-width:1px;border-color:var(--tui-border-normal)}:host._centered .t-line_vertical:first-child{flex:1 0 1px;pointer-events:none}.t-side{display:flex;align-items:stretch}.t-side_padding{padding-block-end:2rem}.t-name{font:var(--tui-font-body-xs);writing-mode:tb;text-align:center;padding-block-end:.75rem;color:var(--tui-text-secondary)}.t-name_primary{transform:rotate(180deg)}.t-labels-y{display:flex;font:var(--tui-font-body-xs);flex-direction:column-reverse;justify-content:space-between;color:var(--tui-text-secondary)}.t-labels-y_primary{text-align:end;padding-inline-end:.75rem}.t-labels-y_secondary{padding-inline-start:.75rem}.t-labels-y_transparent{border-color:transparent}.t-labels-y_inset{position:absolute;top:.5625rem;left:.25rem;bottom:-.75rem;pointer-events:none}.t-labels-y_inset_secondary{left:auto;right:.25rem;text-align:end}.t-labels-x{position:relative;display:flex;font:var(--tui-font-body-xs);border-inline-end:1px solid transparent;color:var(--tui-text-secondary)}.t-label-x{block-size:.4375rem;border-inline-start:1px solid var(--tui-border-normal);flex:1;margin-block-end:1.5625rem}.t-label-x:before{content:\"\";display:block;block-size:.5625rem}.t-label-x_transparent{border-color:transparent}:host._centered .t-label-x{block-size:2rem;text-align:center;border:none;margin:0}:host:not(._centered) .t-label-x:last-child:not(:first-child){position:absolute;right:0;text-align:end;border-inline-start:none}.t-label-y:first-child{margin-block-end:-.375rem}.t-label-y:last-child{margin-block-start:-.375rem}.t-content{position:absolute;inset:0 0 -1px -1px;display:flex;align-items:flex-end}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
44
44
  }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAxes, decorators: [{
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiAxes, decorators: [{
46
46
  type: Component,
47
- args: [{ selector: 'tui-axes', imports: [TuiRepeatTimes], changeDetection: ChangeDetectionStrategy.OnPush, host: {
47
+ args: [{ selector: 'tui-axes', changeDetection: ChangeDetectionStrategy.OnPush, host: {
48
48
  dir: 'ltr',
49
- '[class._centered]': 'centeredXLabels',
50
- }, template: "@if (hasYLabels) {\n <div\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n >\n @if (axisYName) {\n <div\n automation-id=\"tui-axex__axis-y-name\"\n class=\"t-name t-name_primary\"\n >\n {{ axisYName }}\n </div>\n }\n @if (!axisYInset) {\n <div class=\"t-labels-y t-labels-y_primary\">\n @for (label of axisYLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n }\n </div>\n }\n </div>\n}\n<div class=\"t-wrapper\">\n <div\n class=\"t-grid\"\n [style.borderBottomStyle]=\"axisX\"\n [style.borderLeftStyle]=\"axisY\"\n >\n <div class=\"t-vertical\">\n <div\n *tuiRepeatTimes=\"let index of verticalLines\"\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.borderRightStyle]=\"verticalLinesHandler(index, verticalLines)\"\n ></div>\n </div>\n <div class=\"t-horizontal\">\n <div\n *tuiRepeatTimes=\"let index of horizontalLines\"\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.borderTopStyle]=\"horizontalLinesHandler(index, horizontalLines)\"\n ></div>\n </div>\n @if (axisYInset) {\n <div class=\"t-labels-y t-labels-y_inset\">\n @for (label of axisYLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n }\n </div>\n }\n @if (axisYSecondaryInset) {\n <div class=\"t-labels-y t-labels-y_inset t-labels-y_inset_secondary\">\n @for (label of axisYSecondaryLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n }\n </div>\n }\n <div class=\"t-content\">\n <ng-content />\n </div>\n </div>\n @if (hasXLabels) {\n <div class=\"t-labels-x\">\n @for (label of axisXLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-x-label\"\n class=\"t-label-x\"\n [class.t-label-x_transparent]=\"label === null\"\n >\n {{ fallback(label) }}\n </div>\n }\n </div>\n }\n</div>\n@if (hasYSecondaryLabels) {\n <div\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n >\n @if (!axisYSecondaryInset) {\n <div class=\"t-labels-y t-labels-y_secondary\">\n @for (label of axisYSecondaryLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n }\n </div>\n }\n @if (axisYSecondaryName) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-name\"\n class=\"t-name\"\n >\n {{ axisYSecondaryName }}\n </div>\n }\n </div>\n}\n", styles: [":host{display:flex}.t-wrapper{display:flex;flex:1;block-size:100%;flex-direction:column}.t-grid{position:relative;display:flex;flex:1;justify-content:space-around;align-items:flex-end;border-width:1px;border-color:var(--tui-border-normal);isolation:isolate}.t-horizontal{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;flex-direction:column}.t-vertical{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex}:host._centered .t-vertical:after{content:\"\";display:block;flex:1 0 1px}.t-line{flex:2 0 1px;box-sizing:border-box;border-width:1px;border-color:var(--tui-border-normal)}:host._centered .t-line_vertical:first-child{flex:1 0 1px;pointer-events:none}.t-side{display:flex;align-items:stretch}.t-side_padding{padding-block-end:2rem}.t-name{font:var(--tui-font-text-xs);writing-mode:tb;text-align:center;padding-block-end:.75rem;color:var(--tui-text-secondary)}.t-name_primary{transform:rotate(180deg)}.t-labels-y{display:flex;font:var(--tui-font-text-xs);flex-direction:column-reverse;justify-content:space-between;color:var(--tui-text-secondary)}.t-labels-y_primary{text-align:end;padding-inline-end:.75rem}.t-labels-y_secondary{padding-inline-start:.75rem}.t-labels-y_transparent{border-color:transparent}.t-labels-y_inset{position:absolute;top:.5625rem;left:.25rem;bottom:-.75rem;pointer-events:none}.t-labels-y_inset_secondary{left:auto;right:.25rem;text-align:end}.t-labels-x{position:relative;display:flex;font:var(--tui-font-text-xs);border-inline-end:1px solid transparent;color:var(--tui-text-secondary)}.t-label-x{block-size:.4375rem;border-inline-start:1px solid var(--tui-border-normal);flex:1;margin-block-end:1.5625rem}.t-label-x:before{content:\"\";display:block;block-size:.5625rem}.t-label-x_transparent{border-color:transparent}:host._centered .t-label-x{block-size:2rem;text-align:center;border:none;margin:0}:host:not(._centered) .t-label-x:last-child:not(:first-child){position:absolute;right:0;text-align:end;border-inline-start:none}.t-label-y:first-child{margin-block-end:-.375rem}.t-label-y:last-child{margin-block-start:-.375rem}.t-content{position:absolute;top:0;left:-1px;right:0;bottom:-1px;display:flex;align-items:flex-end}\n"] }]
51
- }], propDecorators: { axisX: [{
52
- type: Input
53
- }], axisXLabels: [{
54
- type: Input
55
- }], axisY: [{
56
- type: Input
57
- }], axisYInset: [{
58
- type: Input
59
- }], axisYLabels: [{
60
- type: Input
61
- }], axisYName: [{
62
- type: Input
63
- }], axisYSecondaryInset: [{
64
- type: Input
65
- }], axisYSecondaryLabels: [{
66
- type: Input
67
- }], axisYSecondaryName: [{
68
- type: Input
69
- }], horizontalLines: [{
70
- type: Input
71
- }], horizontalLinesHandler: [{
72
- type: Input
73
- }], verticalLines: [{
74
- type: Input
75
- }], verticalLinesHandler: [{
76
- type: Input
77
- }] } });
49
+ '[class._centered]': 'centeredXLabels()',
50
+ }, template: "@let ySecLabels = axisYSecondaryLabels();\n@let ySecInset = axisYSecondaryInset();\n@let yLabels = axisYLabels();\n@let yInset = axisYInset();\n@let hasXs = hasXLabels();\n\n@if (hasYLabels()) {\n <div\n class=\"t-side\"\n [class.t-side_padding]=\"hasXs\"\n >\n @let yName = axisYName();\n @if (yName) {\n <div\n automation-id=\"tui-axex__axis-y-name\"\n class=\"t-name t-name_primary\"\n >\n {{ yName }}\n </div>\n }\n @if (!yInset) {\n <div class=\"t-labels-y t-labels-y_primary\">\n @for (label of yLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ label || fallbackLabel }}\n </div>\n }\n </div>\n }\n </div>\n}\n<div class=\"t-wrapper\">\n <div\n class=\"t-grid\"\n [style.borderBottomStyle]=\"axisX()\"\n [style.borderLeftStyle]=\"axisY()\"\n >\n <div class=\"t-vertical\">\n @let vLineFn = verticalLinesHandler();\n @let vLines = verticalLines();\n @for (_ of '-'.repeat(vLines); track $index) {\n <div\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.border-right-style]=\"vLineFn($index, vLines)\"\n ></div>\n }\n </div>\n <div class=\"t-horizontal\">\n @let hLineFn = horizontalLinesHandler();\n @let hLines = horizontalLines();\n @for (_ of '-'.repeat(hLines); track $index) {\n <div\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.border-top-style]=\"hLineFn($index, hLines)\"\n ></div>\n }\n </div>\n @if (yInset) {\n <div class=\"t-labels-y t-labels-y_inset\">\n @for (label of yLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ label || fallbackLabel }}\n </div>\n }\n </div>\n }\n @if (ySecInset) {\n <div class=\"t-labels-y t-labels-y_inset t-labels-y_inset_secondary\">\n @for (label of ySecLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ label || fallbackLabel }}\n </div>\n }\n </div>\n }\n <div class=\"t-content\">\n <ng-content />\n </div>\n </div>\n @if (hasXs) {\n <div class=\"t-labels-x\">\n @for (label of axisXLabels(); track label) {\n <div\n automation-id=\"tui-axex__axis-x-label\"\n class=\"t-label-x\"\n [class.t-label-x_transparent]=\"label === null\"\n >\n {{ label || fallbackLabel }}\n </div>\n }\n </div>\n }\n</div>\n@if (hasYSecondaryLabels()) {\n <div\n class=\"t-side\"\n [class.t-side_padding]=\"hasXs\"\n >\n @if (!ySecInset) {\n <div class=\"t-labels-y t-labels-y_secondary\">\n @for (label of ySecLabels; track label) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ label || fallbackLabel }}\n </div>\n }\n </div>\n }\n @let axisYSec = axisYSecondaryName();\n @if (axisYSec) {\n <div\n automation-id=\"tui-axex__axis-y-secondary-name\"\n class=\"t-name\"\n >\n {{ axisYSec }}\n </div>\n }\n </div>\n}\n", styles: [":host{display:flex}.t-wrapper{display:flex;flex:1;block-size:100%;flex-direction:column}.t-grid{position:relative;display:flex;flex:1;justify-content:space-around;align-items:flex-end;border-width:1px;border-color:var(--tui-border-normal);isolation:isolate}.t-horizontal{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;flex-direction:column}.t-vertical{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex}:host._centered .t-vertical:after{content:\"\";display:block;flex:1 0 1px}.t-line{flex:2 0 1px;box-sizing:border-box;border-width:1px;border-color:var(--tui-border-normal)}:host._centered .t-line_vertical:first-child{flex:1 0 1px;pointer-events:none}.t-side{display:flex;align-items:stretch}.t-side_padding{padding-block-end:2rem}.t-name{font:var(--tui-font-body-xs);writing-mode:tb;text-align:center;padding-block-end:.75rem;color:var(--tui-text-secondary)}.t-name_primary{transform:rotate(180deg)}.t-labels-y{display:flex;font:var(--tui-font-body-xs);flex-direction:column-reverse;justify-content:space-between;color:var(--tui-text-secondary)}.t-labels-y_primary{text-align:end;padding-inline-end:.75rem}.t-labels-y_secondary{padding-inline-start:.75rem}.t-labels-y_transparent{border-color:transparent}.t-labels-y_inset{position:absolute;top:.5625rem;left:.25rem;bottom:-.75rem;pointer-events:none}.t-labels-y_inset_secondary{left:auto;right:.25rem;text-align:end}.t-labels-x{position:relative;display:flex;font:var(--tui-font-body-xs);border-inline-end:1px solid transparent;color:var(--tui-text-secondary)}.t-label-x{block-size:.4375rem;border-inline-start:1px solid var(--tui-border-normal);flex:1;margin-block-end:1.5625rem}.t-label-x:before{content:\"\";display:block;block-size:.5625rem}.t-label-x_transparent{border-color:transparent}:host._centered .t-label-x{block-size:2rem;text-align:center;border:none;margin:0}:host:not(._centered) .t-label-x:last-child:not(:first-child){position:absolute;right:0;text-align:end;border-inline-start:none}.t-label-y:first-child{margin-block-end:-.375rem}.t-label-y:last-child{margin-block-start:-.375rem}.t-content{position:absolute;inset:0 0 -1px -1px;display:flex;align-items:flex-end}\n"] }]
51
+ }] });
78
52
 
79
53
  /**
80
54
  * Generated bundle index. Do not edit.