@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.
- package/README.md +2 -2
- package/components/arc-chart/arc-chart.component.d.ts +15 -14
- package/components/axes/axes.component.d.ts +23 -19
- 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 +34 -51
- package/fesm2022/taiga-ui-addon-charts-components-arc-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-axes.mjs +38 -64
- 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 +4 -4
- package/fesm2022/taiga-ui-addon-charts-components-bar.mjs +3 -3
- package/fesm2022/taiga-ui-addon-charts-components-legend-item.mjs +4 -4
- package/fesm2022/taiga-ui-addon-charts-components-line-chart.mjs +26 -31
- 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 -14
- 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 -15
- 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 +5 -2
|
@@ -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,
|
|
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, computed, 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 protected readonly centeredXLabels = computed(() => this.axisY() === 'none');\n\n public readonly axisX = input<TuiLineType>('solid');\n\n public readonly axisXLabels = input<ReadonlyArray<string | null>>([]);\n\n public readonly axisY = input<TuiLineType>('solid');\n\n public readonly axisYInset = input(false);\n\n public readonly axisYLabels = input<readonly string[]>([]);\n\n public readonly axisYName = input('');\n\n public readonly axisYSecondaryInset = input(false);\n\n public readonly axisYSecondaryLabels = input<readonly string[]>([]);\n\n public readonly axisYSecondaryName = input('');\n\n public readonly horizontalLines = input(0);\n\n public readonly horizontalLinesHandler = input<TuiLineHandler>(TUI_ALWAYS_SOLID);\n\n public readonly verticalLines = input(0);\n\n /**\n * A function to handle vertical lines style.\n * Initially set to always dashed.\n */\n public readonly verticalLinesHandler = input<TuiLineHandler>(TUI_ALWAYS_DASHED);\n\n public readonly fallbackLabel = CHAR_NO_BREAK_SPACE;\n\n public readonly hasXLabels = computed(() => !!this.axisXLabels().length);\n\n public readonly hasYLabels = computed(() => {\n // keep this to prevent tracking loss on short circuits\n const yN = this.axisYName();\n\n return (this.axisYLabels().length && !this.axisYInset()) || !!yN;\n });\n\n public readonly hasYSecondaryLabels = computed(() => {\n // keep this to prevent tracking loss on short circuits\n const ySN = this.axisYSecondaryName();\n\n return (\n (this.axisYSecondaryLabels().length && !this.axisYSecondaryInset()) || !!ySN\n );\n });\n}\n","@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","/**\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,OAA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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.17", ngImport: i0, type: TuiBarChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
51
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", 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.17", 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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,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,15 +31,15 @@ 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.17", ngImport: i0, type: TuiBarSet, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
35
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", 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-body-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.17", ngImport: i0, type: TuiBarSet, decorators: [{
|
|
41
41
|
type: Component,
|
|
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-
|
|
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-body-xs);color:var(--tui-text-secondary)}\n"] }]
|
|
43
43
|
}], propDecorators: { value: [{
|
|
44
44
|
type: Input
|
|
45
45
|
}], size: [{
|
|
@@ -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.17", ngImport: i0, type: TuiBar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
19
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", 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.17", 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',
|
|
@@ -13,16 +13,16 @@ 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.17", ngImport: i0, type: TuiLegendItem, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
17
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", 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-body-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.17", 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',
|
|
23
23
|
'[class._disabled]': 'disabled',
|
|
24
24
|
'[style.--tui-background-accent-1]': 'computedColor',
|
|
25
|
-
}, 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-
|
|
25
|
+
}, 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-body-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"] }]
|
|
26
26
|
}], propDecorators: { active: [{
|
|
27
27
|
type: Input
|
|
28
28
|
}], color: [{
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
2
|
import { AsyncPipe } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import {
|
|
5
|
-
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { inject, Renderer2, DestroyRef, NgZone, ElementRef, Input, forwardRef, ContentChildren, Directive, signal, computed, viewChildren, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
+
import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { ResizeObserverService } from '@ng-web-apis/resize-observer';
|
|
7
7
|
import { tuiDraw } from '@taiga-ui/addon-charts/utils';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import * as i1 from '@taiga-ui/core/directives/hint';
|
|
13
|
-
import { TuiHintOptionsDirective, tuiHintOptionsProvider, TuiHintHover, TuiHint } from '@taiga-ui/core/directives/hint';
|
|
8
|
+
import { tuiZonefree, tuiZoneOptimized } from '@taiga-ui/cdk/observables';
|
|
9
|
+
import { tuiPure, tuiGenerateId, tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
10
|
+
import * as i1 from '@taiga-ui/core/portals/hint';
|
|
11
|
+
import { TuiHintOptionsDirective, TuiHintHover, tuiHintOptionsProvider, TuiHint } from '@taiga-ui/core/portals/hint';
|
|
14
12
|
import { combineLatest, filter, map, startWith, switchMap, distinctUntilChanged, Subject } from 'rxjs';
|
|
13
|
+
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
14
|
+
import { EMPTY_QUERY } from '@taiga-ui/cdk/constants';
|
|
15
15
|
import { TuiHoveredService } from '@taiga-ui/cdk/directives/hovered';
|
|
16
16
|
|
|
17
17
|
const TUI_LINE_CHART_DEFAULT_OPTIONS = {
|
|
@@ -19,12 +19,7 @@ const TUI_LINE_CHART_DEFAULT_OPTIONS = {
|
|
|
19
19
|
filled: false,
|
|
20
20
|
smoothingFactor: 0,
|
|
21
21
|
};
|
|
22
|
-
const TUI_LINE_CHART_OPTIONS =
|
|
23
|
-
factory: () => TUI_LINE_CHART_DEFAULT_OPTIONS,
|
|
24
|
-
});
|
|
25
|
-
function tuiLineChartOptionsProvider(options) {
|
|
26
|
-
return tuiProvideOptions(TUI_LINE_CHART_OPTIONS, options, TUI_LINE_CHART_DEFAULT_OPTIONS);
|
|
27
|
-
}
|
|
22
|
+
const [TUI_LINE_CHART_OPTIONS, tuiLineChartOptionsProvider] = tuiCreateOptions(TUI_LINE_CHART_DEFAULT_OPTIONS);
|
|
28
23
|
|
|
29
24
|
class TuiLineChartHint {
|
|
30
25
|
constructor() {
|
|
@@ -36,7 +31,7 @@ class TuiLineChartHint {
|
|
|
36
31
|
this.hovered$ = inject(TuiHoveredService);
|
|
37
32
|
}
|
|
38
33
|
ngAfterViewInit() {
|
|
39
|
-
combineLatest([tuiLineChartDrivers(this.charts), this.hovered$])
|
|
34
|
+
combineLatest([tuiLineChartDrivers(this.charts.toArray()), this.hovered$])
|
|
40
35
|
.pipe(filter((result) => !result.some(Boolean)), tuiZonefree(this.zone), takeUntilDestroyed(this.destroyRef))
|
|
41
36
|
.subscribe(() => {
|
|
42
37
|
this.charts.forEach((chart) => chart.onHovered(NaN));
|
|
@@ -56,16 +51,15 @@ class TuiLineChartHint {
|
|
|
56
51
|
computeContext(...values) {
|
|
57
52
|
return (values[0] || []).map((_, index) => values.map((value) => value[index] ?? [0, 0]));
|
|
58
53
|
}
|
|
59
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
60
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiLineChartHint, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
55
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiLineChartHint, isStandalone: true, selector: "[tuiLineChartHint]", inputs: { hint: ["tuiLineChartHint", "hint"] }, providers: [TuiHoveredService], queries: [{ propertyName: "charts", predicate: i0.forwardRef(() => TuiLineChart) }, { propertyName: "chartsRef", predicate: i0.forwardRef(() => TuiLineChart), read: ElementRef }], ngImport: i0 }); }
|
|
61
56
|
}
|
|
62
57
|
__decorate([
|
|
63
58
|
tuiPure
|
|
64
59
|
], TuiLineChartHint.prototype, "computeContext", null);
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiLineChartHint, decorators: [{
|
|
66
61
|
type: Directive,
|
|
67
62
|
args: [{
|
|
68
|
-
standalone: true,
|
|
69
63
|
selector: '[tuiLineChartHint]',
|
|
70
64
|
providers: [TuiHoveredService],
|
|
71
65
|
}]
|
|
@@ -80,7 +74,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
80
74
|
args: ['tuiLineChartHint']
|
|
81
75
|
}], computeContext: [] } });
|
|
82
76
|
function tuiLineChartDrivers(charts) {
|
|
83
|
-
return combineLatest(charts.map(({ drivers }) =>
|
|
77
|
+
return combineLatest(charts.map(({ drivers$ }) => drivers$.pipe(map((drivers) => drivers.map((driver) => driver.pipe(startWith(false))))))).pipe(map((all) => all.reduce((acc, drivers) => acc.concat(drivers), [])), switchMap((drivers) => combineLatest(drivers)), map((values) => values.some(Boolean)), distinctUntilChanged());
|
|
84
78
|
}
|
|
85
79
|
|
|
86
80
|
class TuiLineChart {
|
|
@@ -88,17 +82,21 @@ class TuiLineChart {
|
|
|
88
82
|
this.zone = inject(NgZone);
|
|
89
83
|
this.options = inject(TUI_LINE_CHART_OPTIONS);
|
|
90
84
|
this.hover$ = new Subject();
|
|
91
|
-
this.autoId =
|
|
92
|
-
this.resize = toSignal(inject(ResizeObserverService, { self: true }).pipe(map(([e]) => e?.contentRect.height ||
|
|
85
|
+
this.autoId = tuiGenerateId();
|
|
86
|
+
this.resize = toSignal(inject(ResizeObserverService, { self: true }).pipe(map(([e]) => e?.contentRect.height || NaN), filter((height) => !Number.isNaN(height))), { initialValue: NaN });
|
|
93
87
|
this.box = signal('');
|
|
94
88
|
this.hintDirective = inject(TuiLineChartHint, { optional: true });
|
|
95
89
|
this.hintOptions = inject(TuiHintOptionsDirective, { optional: true });
|
|
96
90
|
this.viewBox = computed(() => {
|
|
91
|
+
if (Number.isNaN(this.resize())) {
|
|
92
|
+
return '0 0 0 0';
|
|
93
|
+
}
|
|
97
94
|
const offset = this.height / Math.max(this.resize(), 1);
|
|
98
95
|
const [x = 0, y = 0, width = 0, height = 0] = this.box().split(' ').map(Number);
|
|
99
96
|
return `${x} ${y - offset} ${width} ${height + 2 * offset}`;
|
|
100
97
|
});
|
|
101
|
-
this.drivers =
|
|
98
|
+
this.drivers = viewChildren(TuiHintHover);
|
|
99
|
+
this.drivers$ = toObservable(this.drivers);
|
|
102
100
|
this.x = 0;
|
|
103
101
|
this.y = 0;
|
|
104
102
|
this.width = 0;
|
|
@@ -205,8 +203,8 @@ class TuiLineChart {
|
|
|
205
203
|
? 2 * ((this.value[index]?.[0] || 0) - this.getX(index))
|
|
206
204
|
: this.getX(index + 1) - this.getX(index);
|
|
207
205
|
}
|
|
208
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
209
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
206
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiLineChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
207
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiLineChart, isStandalone: true, selector: "tui-line-chart", inputs: { x: "x", y: "y", width: "width", height: "height", smoothingFactor: "smoothingFactor", xStringify: "xStringify", yStringify: "yStringify", filled: "filled", dots: "dots", valueSetter: ["value", "valueSetter"] }, host: { listeners: { "mouseleave": "onMouseLeave()" } }, providers: [ResizeObserverService], viewQueries: [{ propertyName: "drivers", predicate: TuiHintHover, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@let hovered = hovered$ | async;\n\n<svg\n focusable=\"false\"\n height=\"100%\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [attr.viewBox]=\"viewBox()\"\n>\n <defs>\n <linearGradient\n x1=\"0\"\n x2=\"0\"\n y1=\"1\"\n y2=\"0\"\n [attr.id]=\"fillId\"\n >\n <stop\n offset=\"0%\"\n stop-color=\"currentColor\"\n stop-opacity=\"0.5\"\n />\n <stop\n offset=\"100%\"\n stop-color=\"currentColor\"\n stop-opacity=\"0\"\n />\n </linearGradient>\n </defs>\n <path\n stroke=\"none\"\n [attr.d]=\"fillD\"\n [attr.fill]=\"fill\"\n />\n <path\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n vector-effect=\"non-scaling-stroke\"\n [attr.d]=\"d\"\n />\n</svg>\n@if (dots) {\n @for (point of value; track point) {\n <div\n class=\"t-dot\"\n [style.inset-block-end.%]=\"getBottom(point[1])\"\n [style.inset-inline-start.%]=\"getLeft(point[0])\"\n ></div>\n }\n}\n@if (hasHints) {\n @for (point of value; track point) {\n <!-- TODO: Fix hint type -->\n @if ($count > 1 || dots) {\n <div\n class=\"t-column\"\n [class.t-column_hint_hovered]=\"drivers()[$index] | async\"\n [class.t-column_hovered]=\"hovered === $index\"\n [style.inset-inline-start.%]=\"getLeft(getX($index))\"\n [style.width.%]=\"getWidth($index)\"\n [tuiHint]=\"$any(hintDirective?.hint || hintContent)\"\n [tuiHintContext]=\"{$implicit: getImplicit(point), index: $index}\"\n [tuiHintDescribe]=\"isFocusable ? getHintId($index) : null\"\n [tuiHintHost]=\"hintHost\"\n (mouseenter)=\"onMouseEnter($index)\"\n >\n <div\n class=\"t-line t-line_vertical\"\n [style.inset-inline-start.%]=\"getOffset($index)\"\n ></div>\n <div\n #hintHost\n class=\"t-host\"\n [id]=\"getHintId($index)\"\n [style.inset-block-end.%]=\"getBottom(point[1])\"\n [style.inset-inline-start.%]=\"getOffset($index)\"\n [tabIndex]=\"isFocusable ? 0 : -1\"\n ></div>\n </div>\n }\n @if (isFocusable) {\n <div\n class=\"t-line t-line_horizontal\"\n [style.inset-block-end.%]=\"getBottom(point[1])\"\n ></div>\n }\n }\n}\n@if (getHovered(hovered); as point) {\n @if (xStringify) {\n <div\n class=\"t-hint t-hint_x\"\n [style.inset-inline-start.%]=\"getLeft(point[0])\"\n >\n {{ xStringify(point[0]) }}\n </div>\n }\n @if (yStringify) {\n <div\n class=\"t-hint t-hint_y\"\n [style.inset-block-end.%]=\"getBottom(point[1])\"\n >\n {{ yStringify(point[1]) }}\n </div>\n }\n}\n", styles: [":host{display:flex;inline-size:100%;block-size:100%;pointer-events:none}.t-svg{block-size:calc(100% + 1px);transform:scaleY(-1);margin:-.03125rem 0}.t-column{position:absolute;top:0;block-size:100%;pointer-events:auto}.t-dot{position:absolute;inline-size:.375rem;block-size:.375rem;border-radius:100%;background:currentColor;margin:-.1875rem;box-shadow:0 0 0 2px #fff}.t-host{position:absolute;left:50%;inline-size:.5rem;block-size:.5rem;border-radius:100%;opacity:0;background:#fff;margin:-.25rem;box-shadow:0 0 0 2px currentColor,0 .0625rem .1875rem .125rem #0000001a;outline:none;pointer-events:none}.t-host:focus,.t-column_hovered .t-host,.t-column:hover .t-host,.t-column_hint_hovered .t-host{opacity:1}.t-line{position:absolute;opacity:0;background:var(--tui-border-normal)}.t-line_vertical{top:0;bottom:0;left:50%;inline-size:1px}.t-line_horizontal{z-index:-1;inline-size:100%;block-size:1px}:host[style^=\"z-index: 0\"] .t-column_hovered .t-line,:host:not([style]) .t-column:hover .t-line,:host:not([style]) .t-column_hint_hovered .t-line,:host[style^=\"z-index: 0\"] .t-column_hovered+.t-line,:host:not([style]) .t-column:hover+.t-line,:host:not([style]) .t-column_hint_hovered+.t-line{opacity:1}.t-hint{position:absolute;box-shadow:var(--tui-shadow-small);font:var(--tui-font-body-xs);block-size:1.25rem;line-height:1.25rem;margin-block-end:-.625rem;padding:0 .375rem;white-space:nowrap;color:var(--tui-text-primary);background:var(--tui-background-base);transform:translate3d(-50%,0,0)}.t-hint_x{bottom:0}.t-hint_y{left:0}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { 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"] }], viewProviders: [tuiHintOptionsProvider({ direction: 'top', hideDelay: 0 })], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
210
208
|
}
|
|
211
209
|
__decorate([
|
|
212
210
|
tuiPure
|
|
@@ -214,15 +212,12 @@ __decorate([
|
|
|
214
212
|
__decorate([
|
|
215
213
|
tuiPure
|
|
216
214
|
], TuiLineChart.prototype, "getD", null);
|
|
217
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiLineChart, decorators: [{
|
|
218
216
|
type: Component,
|
|
219
217
|
args: [{ selector: 'tui-line-chart', imports: [AsyncPipe, TuiHint], changeDetection: ChangeDetectionStrategy.OnPush, providers: [ResizeObserverService], viewProviders: [tuiHintOptionsProvider({ direction: 'top', hideDelay: 0 })], host: {
|
|
220
218
|
'(mouseleave)': 'onMouseLeave()',
|
|
221
|
-
}, template: "@let hovered = hovered$ | async;\n\n<svg\n focusable=\"false\"\n height=\"100%\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [attr.viewBox]=\"viewBox()\"\n>\n <defs>\n <linearGradient\n x1=\"0\"\n x2=\"0\"\n y1=\"1\"\n y2=\"0\"\n [attr.id]=\"fillId\"\n >\n <stop\n offset=\"0%\"\n stop-color=\"currentColor\"\n stop-opacity=\"0.5\"\n />\n <stop\n offset=\"100%\"\n stop-color=\"currentColor\"\n stop-opacity=\"0\"\n />\n </linearGradient>\n </defs>\n <path\n stroke=\"none\"\n [attr.d]=\"fillD\"\n [attr.fill]=\"fill\"\n />\n <path\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n vector-effect=\"non-scaling-stroke\"\n [attr.d]=\"d\"\n />\n</svg>\n@if (dots) {\n @for (point of value; track point) {\n <div\n class=\"t-dot\"\n [style.inset-block-end.%]=\"getBottom(point[1])\"\n [style.inset-inline-start.%]=\"getLeft(point[0])\"\n ></div>\n }\n}\n@if (hasHints) {\n @for (point of value; track point) {\n <!-- TODO: Fix hint type -->\n @if ($count > 1 || dots) {\n <div\n class=\"t-column\"\n [class.t-column_hint_hovered]=\"drivers
|
|
222
|
-
}], propDecorators: {
|
|
223
|
-
type: ViewChildren,
|
|
224
|
-
args: [TuiHintHover]
|
|
225
|
-
}], x: [{
|
|
219
|
+
}, template: "@let hovered = hovered$ | async;\n\n<svg\n focusable=\"false\"\n height=\"100%\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [attr.viewBox]=\"viewBox()\"\n>\n <defs>\n <linearGradient\n x1=\"0\"\n x2=\"0\"\n y1=\"1\"\n y2=\"0\"\n [attr.id]=\"fillId\"\n >\n <stop\n offset=\"0%\"\n stop-color=\"currentColor\"\n stop-opacity=\"0.5\"\n />\n <stop\n offset=\"100%\"\n stop-color=\"currentColor\"\n stop-opacity=\"0\"\n />\n </linearGradient>\n </defs>\n <path\n stroke=\"none\"\n [attr.d]=\"fillD\"\n [attr.fill]=\"fill\"\n />\n <path\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n vector-effect=\"non-scaling-stroke\"\n [attr.d]=\"d\"\n />\n</svg>\n@if (dots) {\n @for (point of value; track point) {\n <div\n class=\"t-dot\"\n [style.inset-block-end.%]=\"getBottom(point[1])\"\n [style.inset-inline-start.%]=\"getLeft(point[0])\"\n ></div>\n }\n}\n@if (hasHints) {\n @for (point of value; track point) {\n <!-- TODO: Fix hint type -->\n @if ($count > 1 || dots) {\n <div\n class=\"t-column\"\n [class.t-column_hint_hovered]=\"drivers()[$index] | async\"\n [class.t-column_hovered]=\"hovered === $index\"\n [style.inset-inline-start.%]=\"getLeft(getX($index))\"\n [style.width.%]=\"getWidth($index)\"\n [tuiHint]=\"$any(hintDirective?.hint || hintContent)\"\n [tuiHintContext]=\"{$implicit: getImplicit(point), index: $index}\"\n [tuiHintDescribe]=\"isFocusable ? getHintId($index) : null\"\n [tuiHintHost]=\"hintHost\"\n (mouseenter)=\"onMouseEnter($index)\"\n >\n <div\n class=\"t-line t-line_vertical\"\n [style.inset-inline-start.%]=\"getOffset($index)\"\n ></div>\n <div\n #hintHost\n class=\"t-host\"\n [id]=\"getHintId($index)\"\n [style.inset-block-end.%]=\"getBottom(point[1])\"\n [style.inset-inline-start.%]=\"getOffset($index)\"\n [tabIndex]=\"isFocusable ? 0 : -1\"\n ></div>\n </div>\n }\n @if (isFocusable) {\n <div\n class=\"t-line t-line_horizontal\"\n [style.inset-block-end.%]=\"getBottom(point[1])\"\n ></div>\n }\n }\n}\n@if (getHovered(hovered); as point) {\n @if (xStringify) {\n <div\n class=\"t-hint t-hint_x\"\n [style.inset-inline-start.%]=\"getLeft(point[0])\"\n >\n {{ xStringify(point[0]) }}\n </div>\n }\n @if (yStringify) {\n <div\n class=\"t-hint t-hint_y\"\n [style.inset-block-end.%]=\"getBottom(point[1])\"\n >\n {{ yStringify(point[1]) }}\n </div>\n }\n}\n", styles: [":host{display:flex;inline-size:100%;block-size:100%;pointer-events:none}.t-svg{block-size:calc(100% + 1px);transform:scaleY(-1);margin:-.03125rem 0}.t-column{position:absolute;top:0;block-size:100%;pointer-events:auto}.t-dot{position:absolute;inline-size:.375rem;block-size:.375rem;border-radius:100%;background:currentColor;margin:-.1875rem;box-shadow:0 0 0 2px #fff}.t-host{position:absolute;left:50%;inline-size:.5rem;block-size:.5rem;border-radius:100%;opacity:0;background:#fff;margin:-.25rem;box-shadow:0 0 0 2px currentColor,0 .0625rem .1875rem .125rem #0000001a;outline:none;pointer-events:none}.t-host:focus,.t-column_hovered .t-host,.t-column:hover .t-host,.t-column_hint_hovered .t-host{opacity:1}.t-line{position:absolute;opacity:0;background:var(--tui-border-normal)}.t-line_vertical{top:0;bottom:0;left:50%;inline-size:1px}.t-line_horizontal{z-index:-1;inline-size:100%;block-size:1px}:host[style^=\"z-index: 0\"] .t-column_hovered .t-line,:host:not([style]) .t-column:hover .t-line,:host:not([style]) .t-column_hint_hovered .t-line,:host[style^=\"z-index: 0\"] .t-column_hovered+.t-line,:host:not([style]) .t-column:hover+.t-line,:host:not([style]) .t-column_hint_hovered+.t-line{opacity:1}.t-hint{position:absolute;box-shadow:var(--tui-shadow-small);font:var(--tui-font-body-xs);block-size:1.25rem;line-height:1.25rem;margin-block-end:-.625rem;padding:0 .375rem;white-space:nowrap;color:var(--tui-text-primary);background:var(--tui-background-base);transform:translate3d(-50%,0,0)}.t-hint_x{bottom:0}.t-hint_y{left:0}\n"] }]
|
|
220
|
+
}], propDecorators: { x: [{
|
|
226
221
|
type: Input
|
|
227
222
|
}], y: [{
|
|
228
223
|
type: Input
|