@taiga-ui/addon-charts 4.52.0-canary.b61d3d0 → 4.52.0-canary.b741982
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.
- package/README.md +2 -2
- package/components/line-chart/line-chart-hint.directive.d.ts +3 -3
- package/components/line-chart/line-chart.component.d.ts +4 -3
- package/components/line-chart/line-chart.options.d.ts +1 -3
- package/fesm2022/taiga-ui-addon-charts-components-arc-chart.mjs +5 -6
- package/fesm2022/taiga-ui-addon-charts-components-arc-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-axes.mjs +5 -6
- package/fesm2022/taiga-ui-addon-charts-components-axes.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-bar-chart.mjs +7 -8
- package/fesm2022/taiga-ui-addon-charts-components-bar-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-bar-set.mjs +3 -3
- package/fesm2022/taiga-ui-addon-charts-components-bar-set.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-bar.mjs +3 -3
- package/fesm2022/taiga-ui-addon-charts-components-bar.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-legend-item.mjs +3 -3
- package/fesm2022/taiga-ui-addon-charts-components-legend-item.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-line-chart.mjs +26 -30
- package/fesm2022/taiga-ui-addon-charts-components-line-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-line-days-chart.mjs +13 -13
- package/fesm2022/taiga-ui-addon-charts-components-line-days-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-pie-chart.mjs +12 -14
- package/fesm2022/taiga-ui-addon-charts-components-pie-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-ring-chart.mjs +4 -4
- package/fesm2022/taiga-ui-addon-charts-components-ring-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-utils.mjs +6 -3
- package/fesm2022/taiga-ui-addon-charts-utils.mjs.map +1 -1
- package/package.json +9 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AfterViewInit
|
|
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:
|
|
24
|
-
drivers
|
|
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
|
|
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/
|
|
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:
|
|
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,7 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { signal, ViewChildren, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { TuiRepeatTimes } from '@taiga-ui/cdk/directives/repeat-times';
|
|
5
4
|
import { tuiTypedFromEvent, tuiZonefree } from '@taiga-ui/cdk/observables';
|
|
6
5
|
import { merge, map, ReplaySubject, timer, switchMap, startWith, tap } from 'rxjs';
|
|
7
6
|
|
|
@@ -53,17 +52,17 @@ class TuiArcChart {
|
|
|
53
52
|
getOffset(index) {
|
|
54
53
|
return (this.getLength(index) * (1 - Math.min((this.value[index] || 0) / this.max, 1)));
|
|
55
54
|
}
|
|
56
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
57
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
55
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiArcChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
56
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", 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: "@for (_ of '-'.repeat(value.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>{{ minLabel }}</span>\n <span>{{ maxLabel }}</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-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"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
58
57
|
}
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiArcChart, decorators: [{
|
|
60
59
|
type: Component,
|
|
61
|
-
args: [{ selector: 'tui-arc-chart',
|
|
60
|
+
args: [{ selector: 'tui-arc-chart', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
62
61
|
'[attr.data-size]': 'size',
|
|
63
62
|
'[style.width.rem]': 'width',
|
|
64
63
|
'[style.height.rem]': 'width',
|
|
65
64
|
'[style.strokeWidth.rem]': 'strokeWidth',
|
|
66
|
-
}, template: "
|
|
65
|
+
}, template: "@for (_ of '-'.repeat(value.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>{{ minLabel }}</span>\n <span>{{ maxLabel }}</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-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
66
|
}], propDecorators: { value: [{
|
|
68
67
|
type: Input
|
|
69
68
|
}], size: [{
|
|
@@ -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 {
|
|
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 {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 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","@for (_ of '-'.repeat(value.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>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAwBA,MAAM,GAAG,GAAG,IAAI,CAAC;AACjB,MAAM,IAAI,GAAG,EAAC,CAAC,EA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sBADjB,YAAY;uBAAC,KAAK;;;AE1FvB;;AAEG;;;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { 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';
|
|
@@ -39,15 +38,15 @@ class TuiAxes {
|
|
|
39
38
|
get centeredXLabels() {
|
|
40
39
|
return this.axisY === 'none';
|
|
41
40
|
}
|
|
42
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
43
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiAxes, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
42
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", 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 @for (_ of '-'.repeat(verticalLines); track $index) {\n <div\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.border-right-style]=\"verticalLinesHandler($index, verticalLines)\"\n ></div>\n }\n </div>\n <div class=\"t-horizontal\">\n @for (_ of '-'.repeat(horizontalLines); track $index) {\n <div\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.border-top-style]=\"horizontalLinesHandler($index, horizontalLines)\"\n ></div>\n }\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;inset:0 0 -1px -1px;display:flex;align-items:flex-end}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
44
43
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiAxes, decorators: [{
|
|
46
45
|
type: Component,
|
|
47
|
-
args: [{ selector: 'tui-axes',
|
|
46
|
+
args: [{ selector: 'tui-axes', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
48
47
|
dir: 'ltr',
|
|
49
48
|
'[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
|
|
49
|
+
}, 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 @for (_ of '-'.repeat(verticalLines); track $index) {\n <div\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.border-right-style]=\"verticalLinesHandler($index, verticalLines)\"\n ></div>\n }\n </div>\n <div class=\"t-horizontal\">\n @for (_ of '-'.repeat(horizontalLines); track $index) {\n <div\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.border-top-style]=\"horizontalLinesHandler($index, horizontalLines)\"\n ></div>\n }\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;inset:0 0 -1px -1px;display:flex;align-items:flex-end}\n"] }]
|
|
51
50
|
}], propDecorators: { axisX: [{
|
|
52
51
|
type: Input
|
|
53
52
|
}], axisXLabels: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-charts-components-axes.mjs","sources":["../../../projects/addon-charts/components/axes/axes.component.ts","../../../projects/addon-charts/components/axes/axes.template.html","../../../projects/addon-charts/components/axes/taiga-ui-addon-charts-components-axes.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {type TuiLineHandler, type TuiLineType} from '@taiga-ui/addon-charts/types';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk/constants';\
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-charts-components-axes.mjs","sources":["../../../projects/addon-charts/components/axes/axes.component.ts","../../../projects/addon-charts/components/axes/axes.template.html","../../../projects/addon-charts/components/axes/taiga-ui-addon-charts-components-axes.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {type TuiLineHandler, type TuiLineType} from '@taiga-ui/addon-charts/types';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk/constants';\n\nexport const TUI_ALWAYS_DASHED: TuiLineHandler = () => 'dashed';\nexport const TUI_ALWAYS_DOTTED: TuiLineHandler = () => 'dotted';\nexport const TUI_ALWAYS_SOLID: TuiLineHandler = () => 'solid';\nexport const TUI_ALWAYS_NONE: TuiLineHandler = () => 'none';\n\n@Component({\n selector: 'tui-axes',\n templateUrl: './axes.template.html',\n styleUrl: './axes.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n dir: 'ltr',\n '[class._centered]': 'centeredXLabels',\n },\n})\nexport class TuiAxes {\n @Input()\n public axisX: TuiLineType = 'solid';\n\n @Input()\n public axisXLabels: ReadonlyArray<string | null> = [];\n\n @Input()\n public axisY: TuiLineType = 'solid';\n\n @Input()\n public axisYInset = false;\n\n @Input()\n public axisYLabels: readonly string[] = [];\n\n @Input()\n public axisYName = '';\n\n @Input()\n public axisYSecondaryInset = false;\n\n @Input()\n public axisYSecondaryLabels: readonly string[] = [];\n\n @Input()\n public axisYSecondaryName = '';\n\n @Input()\n public horizontalLines = 0;\n\n @Input()\n public horizontalLinesHandler: TuiLineHandler = TUI_ALWAYS_SOLID;\n\n @Input()\n public verticalLines = 0;\n\n @Input()\n public verticalLinesHandler: TuiLineHandler = TUI_ALWAYS_DASHED;\n\n public get hasXLabels(): boolean {\n return !!this.axisXLabels.length;\n }\n\n public get hasYLabels(): boolean {\n return (!!this.axisYLabels.length && !this.axisYInset) || !!this.axisYName;\n }\n\n public get hasYSecondaryLabels(): boolean {\n return (\n (!!this.axisYSecondaryLabels.length && !this.axisYSecondaryInset) ||\n !!this.axisYSecondaryName\n );\n }\n\n public fallback(label: string | null): string {\n return label || CHAR_NO_BREAK_SPACE;\n }\n\n protected get centeredXLabels(): boolean {\n return this.axisY === 'none';\n }\n}\n","@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 @for (_ of '-'.repeat(verticalLines); track $index) {\n <div\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.border-right-style]=\"verticalLinesHandler($index, verticalLines)\"\n ></div>\n }\n </div>\n <div class=\"t-horizontal\">\n @for (_ of '-'.repeat(horizontalLines); track $index) {\n <div\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.border-top-style]=\"horizontalLinesHandler($index, horizontalLines)\"\n ></div>\n }\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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAIa,iBAAiB,GAAmB,MAAM;MAC1C,iBAAiB,GAAmB,MAAM;MAC1C,gBAAgB,GAAmB,MAAM;MACzC,eAAe,GAAmB,MAAM;MAYxC,OAAO,CAAA;AAVpB,IAAA,WAAA,GAAA;QAYW,IAAA,CAAA,KAAK,GAAgB,OAAO;QAG5B,IAAA,CAAA,WAAW,GAAiC,EAAE;QAG9C,IAAA,CAAA,KAAK,GAAgB,OAAO;QAG5B,IAAA,CAAA,UAAU,GAAG,KAAK;QAGlB,IAAA,CAAA,WAAW,GAAsB,EAAE;QAGnC,IAAA,CAAA,SAAS,GAAG,EAAE;QAGd,IAAA,CAAA,mBAAmB,GAAG,KAAK;QAG3B,IAAA,CAAA,oBAAoB,GAAsB,EAAE;QAG5C,IAAA,CAAA,kBAAkB,GAAG,EAAE;QAGvB,IAAA,CAAA,eAAe,GAAG,CAAC;QAGnB,IAAA,CAAA,sBAAsB,GAAmB,gBAAgB;QAGzD,IAAA,CAAA,aAAa,GAAG,CAAC;QAGjB,IAAA,CAAA,oBAAoB,GAAmB,iBAAiB;AAwBlE,IAAA;AAtBG,IAAA,IAAW,UAAU,GAAA;AACjB,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM;IACpC;AAEA,IAAA,IAAW,UAAU,GAAA;QACjB,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS;IAC9E;AAEA,IAAA,IAAW,mBAAmB,GAAA;AAC1B,QAAA,QACI,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,IAAI,CAAC,IAAI,CA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rB;gBAIM,sBAAsB,EAAA,CAAA;sBAD5B;gBAIM,aAAa,EAAA,CAAA;sBADnB;gBAIM,oBAAoB,EAAA,CAAA;sBAD1B;;;AExDL;;AAEG;;;;"}
|
|
@@ -5,16 +5,15 @@ import { inject, EventEmitter, Output, Input, ViewChildren, ChangeDetectionStrat
|
|
|
5
5
|
import { TuiBarSet } from '@taiga-ui/addon-charts/components/bar-set';
|
|
6
6
|
import { EMPTY_QUERY } from '@taiga-ui/cdk/constants';
|
|
7
7
|
import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
|
|
8
|
-
import { tuiInjectId } from '@taiga-ui/cdk/services';
|
|
9
8
|
import { tuiSum } from '@taiga-ui/cdk/utils/math';
|
|
10
|
-
import { tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
11
|
-
import * as i1 from '@taiga-ui/core/
|
|
12
|
-
import { TuiHintOptionsDirective, tuiHintOptionsProvider, TuiHintHover, TuiHint } from '@taiga-ui/core/
|
|
9
|
+
import { tuiGenerateId, tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
10
|
+
import * as i1 from '@taiga-ui/core/portals/hint';
|
|
11
|
+
import { TuiHintOptionsDirective, tuiHintOptionsProvider, TuiHintHover, TuiHint } from '@taiga-ui/core/portals/hint';
|
|
13
12
|
|
|
14
13
|
class TuiBarChart {
|
|
15
14
|
constructor() {
|
|
16
15
|
this.hintOptions = inject(TuiHintOptionsDirective, { optional: true });
|
|
17
|
-
this.autoId =
|
|
16
|
+
this.autoId = tuiGenerateId();
|
|
18
17
|
this.drivers = EMPTY_QUERY;
|
|
19
18
|
this.value = [];
|
|
20
19
|
this.max = NaN;
|
|
@@ -48,8 +47,8 @@ class TuiBarChart {
|
|
|
48
47
|
...values.reduce((result, next) => result.map((value, index) => value + (next[index] || 0))))
|
|
49
48
|
: values.reduce((max, value) => Math.max(...value, max), 0);
|
|
50
49
|
}
|
|
51
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
52
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
50
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiBarChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
51
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", type: TuiBarChart, isStandalone: true, selector: "tui-bar-chart", inputs: { value: "value", max: "max", size: "size", collapsed: "collapsed" }, outputs: { tapColumn: "tapColumn" }, viewQueries: [{ propertyName: "drivers", predicate: TuiHintHover, descendants: true }], ngImport: i0, template: "@for (set of transposed; track set) {\n <div\n class=\"t-wrapper\"\n [class.t-wrapper_hoverable]=\"!!hintContent\"\n [class.t-wrapper_hovered]=\"drivers.get($index) | async\"\n [tuiHint]=\"hintContent\"\n [tuiHintAppearance]=\"hintAppearance\"\n [tuiHintContext]=\"{$implicit: $index}\"\n [tuiHintDescribe]=\"getHintId($index)\"\n [tuiHintHost]=\"hintHost\"\n (click)=\"tapColumn.emit($index)\"\n (keydown.enter)=\"tapColumn.emit($index)\"\n (mouseenter.once)=\"(0)\"\n >\n <div\n class=\"t-container\"\n [style.height.%]=\"set | tuiMapper: percentMapper : collapsed : computedMax\"\n >\n <div\n #hintHost\n class=\"t-host\"\n ></div>\n <tui-bar-set\n class=\"t-set\"\n [collapsed]=\"collapsed\"\n [id]=\"getHintId($index)\"\n [size]=\"size\"\n [tabIndex]=\"hintContent ? 0 : -1\"\n [value]=\"set\"\n />\n </div>\n </div>\n}\n", styles: [":host{display:flex;flex:1;block-size:100%}.t-wrapper{transition-property:background-color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;display:flex;flex:1;align-items:flex-end;justify-content:center;block-size:100%}.t-wrapper_hoverable{cursor:pointer}.t-wrapper_hoverable:hover,.t-wrapper_hoverable.t-wrapper_hovered{background-color:#0000000d}.t-container{flex:1}.t-host{position:absolute;left:50%;right:50%}.t-set{border-radius:var(--tui-radius-m);pointer-events:none;outline:none}.t-set:focus{box-shadow:0 0 0 2px var(--tui-border-focus)}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: TuiBarSet, selector: "tui-bar-set", inputs: ["value", "size", "collapsed"] }, { kind: "directive", type: i1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"], outputs: ["tuiHintVisible"] }, { kind: "directive", type: i1.TuiHintDescribe, selector: "[tuiHintDescribe]", inputs: ["tuiHintDescribe"] }, { kind: "directive", type: i1.TuiHintHost, selector: "[tuiHint][tuiHintHost]", inputs: ["tuiHintHost"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }], viewProviders: [tuiHintOptionsProvider({ direction: 'top' })], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
53
52
|
}
|
|
54
53
|
__decorate([
|
|
55
54
|
tuiPure
|
|
@@ -57,7 +56,7 @@ __decorate([
|
|
|
57
56
|
__decorate([
|
|
58
57
|
tuiPure
|
|
59
58
|
], TuiBarChart.prototype, "getMax", null);
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiBarChart, decorators: [{
|
|
61
60
|
type: Component,
|
|
62
61
|
args: [{ selector: 'tui-bar-chart', imports: [AsyncPipe, TuiBarSet, TuiHint, TuiMapperPipe], changeDetection: ChangeDetectionStrategy.OnPush, viewProviders: [tuiHintOptionsProvider({ direction: 'top' })], template: "@for (set of transposed; track set) {\n <div\n class=\"t-wrapper\"\n [class.t-wrapper_hoverable]=\"!!hintContent\"\n [class.t-wrapper_hovered]=\"drivers.get($index) | async\"\n [tuiHint]=\"hintContent\"\n [tuiHintAppearance]=\"hintAppearance\"\n [tuiHintContext]=\"{$implicit: $index}\"\n [tuiHintDescribe]=\"getHintId($index)\"\n [tuiHintHost]=\"hintHost\"\n (click)=\"tapColumn.emit($index)\"\n (keydown.enter)=\"tapColumn.emit($index)\"\n (mouseenter.once)=\"(0)\"\n >\n <div\n class=\"t-container\"\n [style.height.%]=\"set | tuiMapper: percentMapper : collapsed : computedMax\"\n >\n <div\n #hintHost\n class=\"t-host\"\n ></div>\n <tui-bar-set\n class=\"t-set\"\n [collapsed]=\"collapsed\"\n [id]=\"getHintId($index)\"\n [size]=\"size\"\n [tabIndex]=\"hintContent ? 0 : -1\"\n [value]=\"set\"\n />\n </div>\n </div>\n}\n", styles: [":host{display:flex;flex:1;block-size:100%}.t-wrapper{transition-property:background-color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;display:flex;flex:1;align-items:flex-end;justify-content:center;block-size:100%}.t-wrapper_hoverable{cursor:pointer}.t-wrapper_hoverable:hover,.t-wrapper_hoverable.t-wrapper_hovered{background-color:#0000000d}.t-container{flex:1}.t-host{position:absolute;left:50%;right:50%}.t-set{border-radius:var(--tui-radius-m);pointer-events:none;outline:none}.t-set:focus{box-shadow:0 0 0 2px var(--tui-border-focus)}\n"] }]
|
|
63
62
|
}], propDecorators: { drivers: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-charts-components-bar-chart.mjs","sources":["../../../projects/addon-charts/components/bar-chart/bar-chart.component.ts","../../../projects/addon-charts/components/bar-chart/bar-chart.template.html","../../../projects/addon-charts/components/bar-chart/taiga-ui-addon-charts-components-bar-chart.ts"],"sourcesContent":["import {AsyncPipe} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n inject,\n Input,\n Output,\n type QueryList,\n ViewChildren,\n} from '@angular/core';\nimport {TuiBarSet} from '@taiga-ui/addon-charts/components/bar-set';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-charts-components-bar-chart.mjs","sources":["../../../projects/addon-charts/components/bar-chart/bar-chart.component.ts","../../../projects/addon-charts/components/bar-chart/bar-chart.template.html","../../../projects/addon-charts/components/bar-chart/taiga-ui-addon-charts-components-bar-chart.ts"],"sourcesContent":["import {AsyncPipe} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n inject,\n Input,\n Output,\n type QueryList,\n ViewChildren,\n} from '@angular/core';\nimport {TuiBarSet} from '@taiga-ui/addon-charts/components/bar-set';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {type TuiContext, type TuiMapper} from '@taiga-ui/cdk/types';\nimport {tuiSum} from '@taiga-ui/cdk/utils/math';\nimport {tuiGenerateId, tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TuiHint,\n TuiHintHover,\n TuiHintOptionsDirective,\n tuiHintOptionsProvider,\n} from '@taiga-ui/core/portals/hint';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {type Observable} from 'rxjs';\n\n@Component({\n selector: 'tui-bar-chart',\n imports: [AsyncPipe, TuiBarSet, TuiHint, TuiMapperPipe],\n templateUrl: './bar-chart.template.html',\n styleUrl: './bar-chart.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [tuiHintOptionsProvider({direction: 'top'})],\n})\nexport class TuiBarChart {\n private readonly hintOptions = inject(TuiHintOptionsDirective, {optional: true});\n private readonly autoId = tuiGenerateId();\n\n @ViewChildren(TuiHintHover)\n protected readonly drivers: QueryList<Observable<boolean>> = EMPTY_QUERY;\n\n @Input()\n public value: ReadonlyArray<readonly number[]> = [];\n\n @Input()\n public max = NaN;\n\n @Input()\n public size: TuiSizeL | TuiSizeS | null = 'm';\n\n @Input()\n public collapsed = false;\n\n @Output()\n public readonly tapColumn = new EventEmitter<number>();\n\n public get transposed(): ReadonlyArray<readonly number[]> {\n return this.transpose(this.value);\n }\n\n public get computedMax(): number {\n return this.max || this.getMax(this.value, this.collapsed);\n }\n\n public readonly percentMapper: TuiMapper<\n [readonly number[], boolean, number],\n number\n > = (set, collapsed, max) =>\n (100 * (collapsed ? tuiSum(...set) : Math.max(...set))) / max;\n\n protected get hintContent(): PolymorpheusContent<TuiContext<number>> {\n return this.hintOptions?.content || '';\n }\n\n protected get hintAppearance(): string {\n return this.hintOptions?.appearance || '';\n }\n\n protected getHintId(index: number): string {\n return `${this.autoId}_${index}`;\n }\n\n @tuiPure\n private transpose(\n value: ReadonlyArray<readonly number[]>,\n ): ReadonlyArray<readonly number[]> {\n return value.reduce<ReadonlyArray<readonly number[]>>(\n (result, next) =>\n next.map((_, index) => [...(result[index] || []), next[index] || 0]),\n [],\n );\n }\n\n @tuiPure\n private getMax(values: ReadonlyArray<readonly number[]>, collapsed: boolean): number {\n return collapsed\n ? Math.max(\n // eslint-disable-next-line no-restricted-syntax\n ...values.reduce((result, next) =>\n result.map((value, index) => value + (next[index] || 0)),\n ),\n )\n : values.reduce((max, value) => Math.max(...value, max), 0);\n }\n}\n","@for (set of transposed; track set) {\n <div\n class=\"t-wrapper\"\n [class.t-wrapper_hoverable]=\"!!hintContent\"\n [class.t-wrapper_hovered]=\"drivers.get($index) | async\"\n [tuiHint]=\"hintContent\"\n [tuiHintAppearance]=\"hintAppearance\"\n [tuiHintContext]=\"{$implicit: $index}\"\n [tuiHintDescribe]=\"getHintId($index)\"\n [tuiHintHost]=\"hintHost\"\n (click)=\"tapColumn.emit($index)\"\n (keydown.enter)=\"tapColumn.emit($index)\"\n (mouseenter.once)=\"(0)\"\n >\n <div\n class=\"t-container\"\n [style.height.%]=\"set | tuiMapper: percentMapper : collapsed : computedMax\"\n >\n <div\n #hintHost\n class=\"t-host\"\n ></div>\n <tui-bar-set\n class=\"t-set\"\n [collapsed]=\"collapsed\"\n [id]=\"getHintId($index)\"\n [size]=\"size\"\n [tabIndex]=\"hintContent ? 0 : -1\"\n [value]=\"set\"\n />\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAmCa,WAAW,CAAA;AARxB,IAAA,WAAA,GAAA;QASqB,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,uBAAuB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;QAC/D,IAAA,CAAA,MAAM,GAAG,aAAa,EAAE;QAGtB,IAAA,CAAA,OAAO,GAAmC,WAAW;QAGjE,IAAA,CAAA,KAAK,GAAqC,EAAE;QAG5C,IAAA,CAAA,GAAG,GAAG,GAAG;QAGT,IAAA,CAAA,IAAI,GAA+B,GAAG;QAGtC,IAAA,CAAA,SAAS,GAAG,KAAK;AAGR,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAAU;AAUtC,QAAA,IAAA,CAAA,aAAa,GAGzB,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,KACpB,CAAC,GAAG,IAAI,SAAS,GAAG,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,GAAG;AAoCpE,IAAA;AAhDG,IAAA,IAAW,UAAU,GAAA;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;IACrC;AAEA,IAAA,IAAW,WAAW,GAAA;AAClB,QAAA,OAAO,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC;IAC9D;AAQA,IAAA,IAAc,WAAW,GAAA;AACrB,QAAA,OAAO,IAAI,CAAC,WAAW,EAAE,OAAO,IAAI,EAAE;IAC1C;AAEA,IAAA,I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AAA;kBARvB,SAAS;+BACI,eAAe,EAAA,OAAA,EAChB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,CAAC,EAAA,eAAA,EAGtC,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,CAAC,sBAAsB,CAAC,EAAC,SAAS,EAAE,KAAK,EAAC,CAAC,CAAC,EAAA,QAAA,EAAA,imCAAA,EAAA,MAAA,EAAA,CAAA,0lBAAA,CAAA,EAAA;8BAOxC,OAAO,EAAA,CAAA;sBADzB,YAAY;uBAAC,YAAY;gBAInB,KAAK,EAAA,CAAA;sBADX;gBAIM,GAAG,EAAA,CAAA;sBADT;gBAIM,IAAI,EAAA,CAAA;sBADV;gBAIM,SAAS,EAAA,CAAA;sBADf;gBAIe,SAAS,EAAA,CAAA;sBADxB;AA8BO,aAAA,CAAA,EAAA,SAAS,MAWT,MAAM,EAAA,EAAA,EAAA,EAAA,CAAA;;AE/FlB;;AAEG;;;;"}
|
|
@@ -31,13 +31,13 @@ class TuiBarSet {
|
|
|
31
31
|
? value.reduce((a, b) => (a > b ? a : b), 0)
|
|
32
32
|
: Math.abs(value.reduce((a, b) => (a < b ? a : b), 0));
|
|
33
33
|
}
|
|
34
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
35
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
34
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiBarSet, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
35
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", type: TuiBarSet, isStandalone: true, selector: "tui-bar-set", inputs: { value: "value", size: "size", collapsed: "collapsed" }, ngImport: i0, template: "@if (size) {\n @for (item of computedValue; track item) {\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: $index, flexible: false}\"\n />\n }\n} @else {\n @for (item of computedValue; track item) {\n <div class=\"t-wrapper\">\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: $index, flexible: true}\"\n />\n </div>\n }\n}\n<ng-template\n #bar\n let-flexible=\"flexible\"\n let-index=\"index\"\n let-item\n>\n <tui-bar\n automation-id=\"tui-bar-set__bar\"\n class=\"t-bar\"\n [class.t-bar_flexible]=\"flexible\"\n [class.t-bar_negative]=\"item < 0\"\n [size]=\"computedSize\"\n [style.background]=\"`var(--tui-chart-categorical-${index.toString().padStart(2, '0')})`\"\n [style.height.%]=\"getHeight(item)\"\n [value]=\"computedSegments\"\n />\n</ng-template>\n<span class=\"t-label\">\n <ng-content />\n</span>\n", styles: [":host{position:relative;display:flex;block-size:100%;align-items:flex-end;justify-content:center}.t-wrapper{display:flex;flex:1;block-size:100%;align-items:flex-end}.t-wrapper:first-of-type{margin-inline-start:25%}.t-wrapper:last-of-type{margin-inline-end:25%}.t-bar{transform-origin:bottom center}.t-bar_negative{transform:rotate(180deg);opacity:var(--tui-disabled-opacity)}.t-bar.t-bar_flexible{max-inline-size:none;inline-size:75%;margin:0 auto}.t-label{position:absolute;top:-1.5rem;font:var(--tui-font-text-xs);color:var(--tui-text-secondary)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiBar, selector: "tui-bar", inputs: ["value", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
36
36
|
}
|
|
37
37
|
__decorate([
|
|
38
38
|
tuiPure
|
|
39
39
|
], TuiBarSet.prototype, "getLargest", null);
|
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiBarSet, decorators: [{
|
|
41
41
|
type: Component,
|
|
42
42
|
args: [{ selector: 'tui-bar-set', imports: [NgTemplateOutlet, TuiBar], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (size) {\n @for (item of computedValue; track item) {\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: $index, flexible: false}\"\n />\n }\n} @else {\n @for (item of computedValue; track item) {\n <div class=\"t-wrapper\">\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: $index, flexible: true}\"\n />\n </div>\n }\n}\n<ng-template\n #bar\n let-flexible=\"flexible\"\n let-index=\"index\"\n let-item\n>\n <tui-bar\n automation-id=\"tui-bar-set__bar\"\n class=\"t-bar\"\n [class.t-bar_flexible]=\"flexible\"\n [class.t-bar_negative]=\"item < 0\"\n [size]=\"computedSize\"\n [style.background]=\"`var(--tui-chart-categorical-${index.toString().padStart(2, '0')})`\"\n [style.height.%]=\"getHeight(item)\"\n [value]=\"computedSegments\"\n />\n</ng-template>\n<span class=\"t-label\">\n <ng-content />\n</span>\n", styles: [":host{position:relative;display:flex;block-size:100%;align-items:flex-end;justify-content:center}.t-wrapper{display:flex;flex:1;block-size:100%;align-items:flex-end}.t-wrapper:first-of-type{margin-inline-start:25%}.t-wrapper:last-of-type{margin-inline-end:25%}.t-bar{transform-origin:bottom center}.t-bar_negative{transform:rotate(180deg);opacity:var(--tui-disabled-opacity)}.t-bar.t-bar_flexible{max-inline-size:none;inline-size:75%;margin:0 auto}.t-label{position:absolute;top:-1.5rem;font:var(--tui-font-text-xs);color:var(--tui-text-secondary)}\n"] }]
|
|
43
43
|
}], propDecorators: { value: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-charts-components-bar-set.mjs","sources":["../../../projects/addon-charts/components/bar-set/bar-set.component.ts","../../../projects/addon-charts/components/bar-set/bar-set.template.html","../../../projects/addon-charts/components/bar-set/taiga-ui-addon-charts-components-bar-set.ts"],"sourcesContent":["import {NgTemplateOutlet} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {TuiBar} from '@taiga-ui/addon-charts/components/bar';\nimport {tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\n\nconst PERCENT = 100;\nconst EMPTY_ARRAY: readonly number[] = [];\nconst FILLER_ARRAY: readonly number[] = [1];\n\n@Component({\n selector: 'tui-bar-set',\n imports: [NgTemplateOutlet, TuiBar],\n templateUrl: './bar-set.template.html',\n styleUrl: './bar-set.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiBarSet {\n @Input()\n public value: readonly number[] = [];\n\n @Input()\n public size: TuiSizeL | TuiSizeS | null = 'm';\n\n @Input()\n public collapsed = false;\n\n protected get computedValue(): readonly number[] {\n return this.collapsed ? FILLER_ARRAY : this.value;\n }\n\n protected get computedSegments(): readonly number[] {\n return this.collapsed ? this.value : EMPTY_ARRAY;\n }\n\n protected get computedSize(): TuiSizeL | TuiSizeS {\n return this.size || 'm';\n }\n\n protected getHeight(value: number): number {\n return Math.abs((PERCENT * value) / this.getLargest(this.computedValue));\n }\n\n @tuiPure\n private getLargest(value: readonly number[]): number {\n return value.some((a) => a > 0)\n ? value.reduce((a, b) => (a > b ? a : b), 0)\n : Math.abs(value.reduce((a, b) => (a < b ? a : b), 0));\n }\n}\n","@if (size) {\n @for (item of computedValue; track item) {\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: $index, flexible: false}\"\n />\n }\n} @else {\n @for (item of computedValue; track item) {\n <div class=\"t-wrapper\">\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: $index, flexible: true}\"\n />\n </div>\n }\n}\n<ng-template\n #bar\n let-flexible=\"flexible\"\n let-index=\"index\"\n let-item\n>\n <tui-bar\n automation-id=\"tui-bar-set__bar\"\n class=\"t-bar\"\n [class.t-bar_flexible]=\"flexible\"\n [class.t-bar_negative]=\"item < 0\"\n [size]=\"computedSize\"\n [style.background]=\"`var(--tui-chart-categorical-${index.toString().padStart(2, '0')})`\"\n [style.height.%]=\"getHeight(item)\"\n [value]=\"computedSegments\"\n />\n</ng-template>\n<span class=\"t-label\">\n <ng-content />\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMA,MAAM,OAAO,GAAG,GAAG;AACnB,MAAM,WAAW,GAAsB,EAAE;AACzC,MAAM,YAAY,GAAsB,CAAC,CAAC,CAAC;MAS9B,SAAS,CAAA;AAPtB,IAAA,WAAA,GAAA;QASW,
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-charts-components-bar-set.mjs","sources":["../../../projects/addon-charts/components/bar-set/bar-set.component.ts","../../../projects/addon-charts/components/bar-set/bar-set.template.html","../../../projects/addon-charts/components/bar-set/taiga-ui-addon-charts-components-bar-set.ts"],"sourcesContent":["import {NgTemplateOutlet} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {TuiBar} from '@taiga-ui/addon-charts/components/bar';\nimport {tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\n\nconst PERCENT = 100;\nconst EMPTY_ARRAY: readonly number[] = [];\nconst FILLER_ARRAY: readonly number[] = [1];\n\n@Component({\n selector: 'tui-bar-set',\n imports: [NgTemplateOutlet, TuiBar],\n templateUrl: './bar-set.template.html',\n styleUrl: './bar-set.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiBarSet {\n @Input()\n public value: readonly number[] = [];\n\n @Input()\n public size: TuiSizeL | TuiSizeS | null = 'm';\n\n @Input()\n public collapsed = false;\n\n protected get computedValue(): readonly number[] {\n return this.collapsed ? FILLER_ARRAY : this.value;\n }\n\n protected get computedSegments(): readonly number[] {\n return this.collapsed ? this.value : EMPTY_ARRAY;\n }\n\n protected get computedSize(): TuiSizeL | TuiSizeS {\n return this.size || 'm';\n }\n\n protected getHeight(value: number): number {\n return Math.abs((PERCENT * value) / this.getLargest(this.computedValue));\n }\n\n @tuiPure\n private getLargest(value: readonly number[]): number {\n return value.some((a) => a > 0)\n ? value.reduce((a, b) => (a > b ? a : b), 0)\n : Math.abs(value.reduce((a, b) => (a < b ? a : b), 0));\n }\n}\n","@if (size) {\n @for (item of computedValue; track item) {\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: $index, flexible: false}\"\n />\n }\n} @else {\n @for (item of computedValue; track item) {\n <div class=\"t-wrapper\">\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: $index, flexible: true}\"\n />\n </div>\n }\n}\n<ng-template\n #bar\n let-flexible=\"flexible\"\n let-index=\"index\"\n let-item\n>\n <tui-bar\n automation-id=\"tui-bar-set__bar\"\n class=\"t-bar\"\n [class.t-bar_flexible]=\"flexible\"\n [class.t-bar_negative]=\"item < 0\"\n [size]=\"computedSize\"\n [style.background]=\"`var(--tui-chart-categorical-${index.toString().padStart(2, '0')})`\"\n [style.height.%]=\"getHeight(item)\"\n [value]=\"computedSegments\"\n />\n</ng-template>\n<span class=\"t-label\">\n <ng-content />\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMA,MAAM,OAAO,GAAG,GAAG;AACnB,MAAM,WAAW,GAAsB,EAAE;AACzC,MAAM,YAAY,GAAsB,CAAC,CAAC,CAAC;MAS9B,SAAS,CAAA;AAPtB,IAAA,WAAA,GAAA;QASW,IAAA,CAAA,KAAK,GAAsB,EAAE;QAG7B,IAAA,CAAA,IAAI,GAA+B,GAAG;QAGtC,IAAA,CAAA,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A,KAAA,EAAA,OAAA,EAAA,IAAA,EAAA,MAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECjBtB,olCAqCA,EAAA,MAAA,EAAA,CAAA,wiBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDzBc,gBAAgB,oJAAE,MAAM,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,MAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;AAgC1B,UAAA,CAAA;IADP;AAKA,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,YAAA,EAAA,IAAA,CAAA;4FA/BQ,SAAS,EAAA,UAAA,EAAA,CAAA;kBAPrB,SAAS;+BACI,aAAa,EAAA,OAAA,EACd,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAAA,eAAA,EAGlB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,olCAAA,EAAA,MAAA,EAAA,CAAA,wiBAAA,CAAA,EAAA;8BAIxC,KAAK,EAAA,CAAA;sBADX;gBAIM,IAAI,EAAA,CAAA;sBADV;gBAIM,SAAS,EAAA,CAAA;sBADf;gBAoBO,UAAU,EAAA,EAAA,EAAA,EAAA,CAAA;;AE5CtB;;AAEG;;;;"}
|
|
@@ -15,13 +15,13 @@ class TuiBar {
|
|
|
15
15
|
getSum(value) {
|
|
16
16
|
return tuiSum(...value);
|
|
17
17
|
}
|
|
18
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
19
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
18
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiBar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
19
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.16", type: TuiBar, isStandalone: true, selector: "tui-bar", inputs: { value: "value", size: "size" }, host: { properties: { "attr.data-size": "size" } }, ngImport: i0, template: "@for (item of value; track item) {\n <div\n automation-id=\"tui-bar__bar\"\n [style.background]=\"`var(--tui-chart-categorical-${$index.toString().padStart(2, '0')})`\"\n [style.height.%]=\"getHeight(item)\"\n ></div>\n}\n", styles: [":host{display:flex;min-inline-size:.125rem;flex-direction:column-reverse;border-top-left-radius:var(--tui-radius-l);border-top-right-radius:var(--tui-radius-l);overflow:hidden}:host[data-size=l]{inline-size:1rem;max-inline-size:1rem;margin:0 .1875rem}:host[data-size=m]{inline-size:.5rem;max-inline-size:.5rem;margin:0 .1875rem}:host[data-size=s]{inline-size:.25rem;max-inline-size:.5rem;margin:0 .125rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
20
20
|
}
|
|
21
21
|
__decorate([
|
|
22
22
|
tuiPure
|
|
23
23
|
], TuiBar.prototype, "getSum", null);
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiBar, decorators: [{
|
|
25
25
|
type: Component,
|
|
26
26
|
args: [{ selector: 'tui-bar', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
27
27
|
'[attr.data-size]': 'size',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-charts-components-bar.mjs","sources":["../../../projects/addon-charts/components/bar/bar.component.ts","../../../projects/addon-charts/components/bar/bar.template.html","../../../projects/addon-charts/components/bar/taiga-ui-addon-charts-components-bar.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {tuiSum} from '@taiga-ui/cdk/utils/math';\nimport {tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\n\n@Component({\n selector: 'tui-bar',\n templateUrl: './bar.template.html',\n styleUrl: './bar.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-size]': 'size',\n },\n})\nexport class TuiBar {\n @Input()\n public value: readonly number[] = [];\n\n @Input()\n public size: TuiSizeL | TuiSizeS = 'm';\n\n protected getHeight(value: number): number {\n return (100 * value) / this.getSum(this.value);\n }\n\n @tuiPure\n private getSum(value: readonly number[]): number {\n return tuiSum(...value);\n }\n}\n","@for (item of value; track item) {\n <div\n automation-id=\"tui-bar__bar\"\n [style.background]=\"`var(--tui-chart-categorical-${$index.toString().padStart(2, '0')})`\"\n [style.height.%]=\"getHeight(item)\"\n ></div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAca,MAAM,CAAA;AATnB,IAAA,WAAA,GAAA;QAWW,
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-charts-components-bar.mjs","sources":["../../../projects/addon-charts/components/bar/bar.component.ts","../../../projects/addon-charts/components/bar/bar.template.html","../../../projects/addon-charts/components/bar/taiga-ui-addon-charts-components-bar.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {tuiSum} from '@taiga-ui/cdk/utils/math';\nimport {tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\n\n@Component({\n selector: 'tui-bar',\n templateUrl: './bar.template.html',\n styleUrl: './bar.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-size]': 'size',\n },\n})\nexport class TuiBar {\n @Input()\n public value: readonly number[] = [];\n\n @Input()\n public size: TuiSizeL | TuiSizeS = 'm';\n\n protected getHeight(value: number): number {\n return (100 * value) / this.getSum(this.value);\n }\n\n @tuiPure\n private getSum(value: readonly number[]): number {\n return tuiSum(...value);\n }\n}\n","@for (item of value; track item) {\n <div\n automation-id=\"tui-bar__bar\"\n [style.background]=\"`var(--tui-chart-categorical-${$index.toString().padStart(2, '0')})`\"\n [style.height.%]=\"getHeight(item)\"\n ></div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAca,MAAM,CAAA;AATnB,IAAA,WAAA,GAAA;QAWW,IAAA,CAAA,KAAK,GAAsB,EAAE;QAG7B,IAAA,CAAA,IAAI,GAAwB,GAAG;AAUzC,IAAA;AARa,IAAA,SAAS,CAAC,KAAa,EAAA;AAC7B,QAAA,OAAO,CAAC,GAAG,GAAG,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;IAClD;AAGQ,IAAA,MAAM,CAAC,KAAwB,EAAA;AACnC,QAAA,OAAO,MAAM,CAAC,GAAG,KAAK,CAAC;IAC3B;+GAdS,MAAM,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAN,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,MAAM,iKCdnB,2PAOA,EAAA,MAAA,EAAA,CAAA,yZAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;ADmBY,UAAA,CAAA;IADP;AAGA,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;4FAdQ,MAAM,EAAA,UAAA,EAAA,CAAA;kBATlB,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,EAAA,eAAA,EAGF,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACF,wBAAA,kBAAkB,EAAE,MAAM;AAC7B,qBAAA,EAAA,QAAA,EAAA,2PAAA,EAAA,MAAA,EAAA,CAAA,yZAAA,CAAA,EAAA;8BAIM,KAAK,EAAA,CAAA;sBADX;gBAIM,IAAI,EAAA,CAAA;sBADV;gBAQO,MAAM,EAAA,EAAA,EAAA,EAAA,CAAA;;AE1BlB;;AAEG;;;;"}
|
|
@@ -13,10 +13,10 @@ class TuiLegendItem {
|
|
|
13
13
|
get computedColor() {
|
|
14
14
|
return this.color === 'var(--tui-background-accent-1)' ? null : this.color;
|
|
15
15
|
}
|
|
16
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
17
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiLegendItem, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
17
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.16", type: TuiLegendItem, isStandalone: true, selector: "tui-legend-item", inputs: { active: "active", color: "color", text: "text", size: "size", disabled: "disabled" }, host: { properties: { "attr.data-size": "size", "class._disabled": "disabled", "style.--tui-background-accent-1": "computedColor" } }, ngImport: i0, template: "<button\n appearance=\"outline-grayscale\"\n size=\"s\"\n tuiButton\n type=\"button\"\n class=\"t-button\"\n [tuiAppearanceState]=\"active ? 'hover' : null\"\n>\n <div class=\"t-wrapper\">\n <ng-content select=\"[tuiCheckbox]\" />\n <span\n class=\"t-dot\"\n [style.backgroundColor]=\"color || 'var(--tui-background-accent-1)'\"\n ></span>\n <span class=\"t-text\">{{ text }}</span>\n <ng-content />\n </div>\n</button>\n", styles: [":host{display:inline-block}.t-button{block-size:2rem;font-weight:700}:host[data-size=m] .t-button{block-size:2.25rem;font:var(--tui-font-text-m);font-weight:700}.t-wrapper{display:flex;align-items:center;pointer-events:none}:host._disabled .t-wrapper{color:var(--tui-text-tertiary)}.t-dot{inline-size:.5rem;block-size:.5rem;border-radius:100%;flex-shrink:0}:host._disabled .t-dot{background:var(--tui-border-normal)}.t-dot:not(:first-child){display:none}.t-text{margin:0 .5rem;font-weight:400}\n"], dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
18
18
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiLegendItem, decorators: [{
|
|
20
20
|
type: Component,
|
|
21
21
|
args: [{ selector: 'tui-legend-item', imports: [TuiButton], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
22
22
|
'[attr.data-size]': 'size',
|