@taiga-ui/addon-charts 4.4.1 → 4.5.0
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/components/bar-chart/bar-chart.component.d.ts +1 -1
- package/components/line-chart/line-chart.component.d.ts +1 -1
- package/components/line-days-chart/line-days-chart.component.d.ts +5 -5
- package/components/pie-chart/pie-chart.component.d.ts +1 -1
- package/esm2022/components/arc-chart/arc-chart.component.mjs +3 -3
- package/esm2022/components/axes/axes.component.mjs +3 -3
- package/esm2022/components/bar/bar.component.mjs +3 -3
- package/esm2022/components/bar-chart/bar-chart.component.mjs +6 -6
- package/esm2022/components/bar-set/bar-set.component.mjs +3 -3
- package/esm2022/components/legend-item/legend-item.component.mjs +3 -3
- package/esm2022/components/line-chart/line-chart.component.mjs +9 -12
- package/esm2022/components/line-days-chart/line-days-chart.component.mjs +26 -25
- package/esm2022/components/pie-chart/pie-chart.component.mjs +6 -6
- package/esm2022/components/pie-chart/pie-chart.directive.mjs +3 -3
- package/esm2022/components/ring-chart/ring-chart.component.mjs +3 -3
- package/fesm2022/taiga-ui-addon-charts-components-arc-chart.mjs +2 -2
- package/fesm2022/taiga-ui-addon-charts-components-arc-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-axes.mjs +2 -2
- package/fesm2022/taiga-ui-addon-charts-components-axes.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-bar-chart.mjs +5 -5
- package/fesm2022/taiga-ui-addon-charts-components-bar-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-bar-set.mjs +2 -2
- package/fesm2022/taiga-ui-addon-charts-components-bar-set.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-bar.mjs +2 -2
- package/fesm2022/taiga-ui-addon-charts-components-bar.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-legend-item.mjs +2 -2
- package/fesm2022/taiga-ui-addon-charts-components-legend-item.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-line-chart.mjs +8 -11
- package/fesm2022/taiga-ui-addon-charts-components-line-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-line-days-chart.mjs +24 -24
- package/fesm2022/taiga-ui-addon-charts-components-line-days-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-pie-chart.mjs +7 -7
- package/fesm2022/taiga-ui-addon-charts-components-pie-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-ring-chart.mjs +2 -2
- package/fesm2022/taiga-ui-addon-charts-components-ring-chart.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Directive, inject, Input
|
|
1
|
+
import { Directive, inject, Input } from '@angular/core';
|
|
2
2
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
3
|
import { WA_ANIMATION_FRAME, WA_PERFORMANCE } from '@ng-web-apis/common';
|
|
4
4
|
import { tuiDescribeSector } from '@taiga-ui/addon-charts/utils';
|
|
@@ -26,7 +26,7 @@ class TuiPieChartDirective {
|
|
|
26
26
|
prev[0] + startDelta * progress,
|
|
27
27
|
cur[1] > 359 ? cur[1] : prev[1] + endDelta * progress,
|
|
28
28
|
]));
|
|
29
|
-
}), tuiZonefree(
|
|
29
|
+
}), tuiZonefree(), takeUntilDestroyed())
|
|
30
30
|
.subscribe(([start, end]) => el.setAttribute('d', tuiDescribeSector(start, end)));
|
|
31
31
|
}
|
|
32
32
|
set tuiPieChart(sector) {
|
|
@@ -45,4 +45,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
45
45
|
}], ctorParameters: function () { return []; }, propDecorators: { tuiPieChart: [{
|
|
46
46
|
type: Input
|
|
47
47
|
}] } });
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaW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G4gICAgICAgIGNvbnN0IGVsID0gdHVpSW5qZWN0RWxlbWVudDxTVkdQYXRoRWxlbWVudD4oKTtcbiAgICAgICAgY29uc3QgcGVyZm9ybWFuY2UgPSBpbmplY3QoV0FfUEVSRk9STUFOQ0UpO1xuICAgICAgICBjb25zdCBhbmltYXRpb25GcmFtZSQgPSBpbmplY3QoV0FfQU5JTUFUSU9OX0ZSQU1FKTtcbiAgICAgICAgY29uc3Qgc3BlZWQgPSBpbmplY3QoVFVJX0FOSU1BVElPTlNfU1BFRUQpO1xuXG4gICAgICAgIHRoaXMuc2VjdG9yJFxuICAgICAgICAgICAgLnBpcGUoXG4gICAgICAgICAgICAgICAgcGFpcndpc2UoKSxcbiAgICAgICAgICAgICAgICBzd2l0Y2hNYXAoKFtwcmV2LCBjdXJdKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG5vdyA9IHBlcmZvcm1hbmNlLm5vdygpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBzdGFydERlbHRhID0gY3VyWzBdIC0gcHJldlswXTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZW5kRGVsdGEgPSBjdXJbMV0gLSBwcmV2WzFdO1xuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhbmltYXRpb25GcmFtZSQucGlwZShcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hcCgodGltZXN0YW1wKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR1aUVhc2VJbk91dFF1YWQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR1aUNsYW1wKCh0aW1lc3RhbXAgLSBub3cpIC8gdHVpR2V0RHVyYXRpb24oc3BlZWQpLCAwLCAxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRha2VXaGlsZSgocHJvZ3Jlc3MpID0+IHByb2dyZXNzIDwgMSwgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXAoKHByb2dyZXNzKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldlswXSArIHN0YXJ0RGVsdGEgKiBwcm9ncmVzcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJbMV0gPiAzNTkgPyBjdXJbMV0gOiBwcmV2WzFdICsgZW5kRGVsdGEgKiBwcm9ncmVzcyxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgIHR1aVpvbmVmcmVlKCksXG4gICAgICAgICAgICAgICAgdGFrZVVudGlsRGVzdHJveWVkKCksXG4gICAgICAgICAgICApXG4gICAgICAgICAgICAuc3Vic2NyaWJlKChbc3RhcnQsIGVuZF0pID0+XG4gICAgICAgICAgICAgICAgZWwuc2V0QXR0cmlidXRlKCdkJywgdHVpRGVzY3JpYmVTZWN0b3Ioc3RhcnQsIGVuZCkpLFxuICAgICAgICAgICAgKTtcbiAgICB9XG5cbiAgICBASW5wdXQoKVxuICAgIHB1YmxpYyBzZXQgdHVpUGllQ2hhcnQoc2VjdG9yOiByZWFkb25seSBbbnVtYmVyLCBudW1iZXJdKSB7XG4gICAgICAgIHRoaXMuc2VjdG9yJC5uZXh0KHNlY3Rvcik7XG4gICAgfVxufVxuIl19
|
|
@@ -19,14 +19,14 @@ class TuiRingChart {
|
|
|
19
19
|
this.activeItemIndexChange.next(index);
|
|
20
20
|
}
|
|
21
21
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiRingChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
22
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiRingChart, isStandalone: true, selector: "tui-ring-chart", inputs: { value: "value", size: "size", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "size" } }, ngImport: i0, template: "<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n\n<tui-pie-chart\n class=\"t-chart\"\n [activeItemIndex]=\"activeItemIndex\"\n [masked]=\"true\"\n [size]=\"size\"\n [value]=\"value\"\n (activeItemIndexChange)=\"onActiveItemIndexChange($event)\"\n/>\n\n<div class=\"t-shield\"></div>\n", styles: [":host{position:relative;display:block;
|
|
22
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiRingChart, isStandalone: true, selector: "tui-ring-chart", inputs: { value: "value", size: "size", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "size" } }, ngImport: i0, template: "<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n\n<tui-pie-chart\n class=\"t-chart\"\n [activeItemIndex]=\"activeItemIndex\"\n [masked]=\"true\"\n [size]=\"size\"\n [value]=\"value\"\n (activeItemIndexChange)=\"onActiveItemIndexChange($event)\"\n/>\n\n<div class=\"t-shield\"></div>\n", styles: [":host{position:relative;display:block;inline-size:var(--t-size);block-size:var(--t-size);flex-shrink:0}:host[data-size=xs]{--t-size: 3rem}:host[data-size=s]{--t-size: 4rem}:host[data-size=m]{--t-size: 9rem}:host[data-size=l]{--t-size: 11rem}:host[data-size=xl]{--t-size: 16rem}.t-content{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;font:var(--tui-font-text-m);max-block-size:100%;flex-direction:column;justify-content:center;text-align:center;padding:1.5rem;border-radius:100%;box-sizing:border-box;overflow:hidden;word-break:break-word;white-space:pre-wrap;color:var(--tui-text-secondary)}:host[data-size=m] .t-content{font:var(--tui-font-text-xs)}.t-wrapper:first-line{color:var(--tui-text-primary)}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-text-l);font-weight:700}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-text-m);font-weight:700}.t-shield{position:absolute;top:25%;left:25%;right:25%;bottom:25%;border-radius:100%}.t-chart{inline-size:100%;block-size:100%}\n"], dependencies: [{ kind: "component", type: TuiPieChart, selector: "tui-pie-chart", inputs: ["value", "size", "masked", "activeItemIndex"], outputs: ["activeItemIndexChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
23
23
|
}
|
|
24
24
|
export { TuiRingChart };
|
|
25
25
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiRingChart, decorators: [{
|
|
26
26
|
type: Component,
|
|
27
27
|
args: [{ standalone: true, selector: 'tui-ring-chart', imports: [TuiPieChart], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
28
28
|
'[attr.data-size]': 'size',
|
|
29
|
-
}, template: "<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n\n<tui-pie-chart\n class=\"t-chart\"\n [activeItemIndex]=\"activeItemIndex\"\n [masked]=\"true\"\n [size]=\"size\"\n [value]=\"value\"\n (activeItemIndexChange)=\"onActiveItemIndexChange($event)\"\n/>\n\n<div class=\"t-shield\"></div>\n", styles: [":host{position:relative;display:block;
|
|
29
|
+
}, template: "<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n\n<tui-pie-chart\n class=\"t-chart\"\n [activeItemIndex]=\"activeItemIndex\"\n [masked]=\"true\"\n [size]=\"size\"\n [value]=\"value\"\n (activeItemIndexChange)=\"onActiveItemIndexChange($event)\"\n/>\n\n<div class=\"t-shield\"></div>\n", styles: [":host{position:relative;display:block;inline-size:var(--t-size);block-size:var(--t-size);flex-shrink:0}:host[data-size=xs]{--t-size: 3rem}:host[data-size=s]{--t-size: 4rem}:host[data-size=m]{--t-size: 9rem}:host[data-size=l]{--t-size: 11rem}:host[data-size=xl]{--t-size: 16rem}.t-content{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;font:var(--tui-font-text-m);max-block-size:100%;flex-direction:column;justify-content:center;text-align:center;padding:1.5rem;border-radius:100%;box-sizing:border-box;overflow:hidden;word-break:break-word;white-space:pre-wrap;color:var(--tui-text-secondary)}:host[data-size=m] .t-content{font:var(--tui-font-text-xs)}.t-wrapper:first-line{color:var(--tui-text-primary)}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-text-l);font-weight:700}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-text-m);font-weight:700}.t-shield{position:absolute;top:25%;left:25%;right:25%;bottom:25%;border-radius:100%}.t-chart{inline-size:100%;block-size:100%}\n"] }]
|
|
30
30
|
}], propDecorators: { value: [{
|
|
31
31
|
type: Input
|
|
32
32
|
}], size: [{
|
|
@@ -36,4 +36,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
36
36
|
}], activeItemIndexChange: [{
|
|
37
37
|
type: Output
|
|
38
38
|
}] } });
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmluZy1jaGFydC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hZGRvbi1jaGFydHMvY29tcG9uZW50cy9yaW5nLWNoYXJ0L3JpbmctY2hhcnQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYWRkb24tY2hhcnRzL2NvbXBvbmVudHMvcmluZy1jaGFydC9yaW5nLWNoYXJ0LnRlbXBsYXRlLmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNILHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsWUFBWSxFQUNaLEtBQUssRUFDTC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5kZXhDaGFuZ2UgPSBuZXcgRXZlbnRFbWl0dGVyPG51bWJlcj4oKTtcblxuICAgIHByb3RlY3RlZCBvbkFjdGl2ZUl0ZW1JbmRleENoYW5nZShpbmRleDogbnVtYmVyKTogdm9pZCB7XG4gICAgICAgIHRoaXMudXBkYXRlQWN0aXZlSXRlbUluZGV4KGluZGV4KTtcbiAgICB9XG5cbiAgICBwcml2YXRlIHVwZGF0ZUFjdGl2ZUl0ZW1JbmRleChpbmRleDogbnVtYmVyKTogdm9pZCB7XG4gICAgICAgIGlmIChpbmRleCA9PT0gdGhpcy5hY3RpdmVJdGVtSW5kZXgpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuYWN0aXZlSXRlbUluZGV4ID0gaW5kZXg7XG4gICAgICAgIHRoaXMuYWN0aXZlSXRlbUluZGV4Q2hhbmdlLm5leHQoaW5kZXgpO1xuICAgIH1cbn1cbiIsIjxkaXYgY2xhc3M9XCJ0LWNvbnRlbnRcIj5cbiAgICA8ZGl2IGNsYXNzPVwidC13cmFwcGVyXCI+XG4gICAgICAgIDxuZy1jb250ZW50IC8+XG4gICAgPC9kaXY+XG48L2Rpdj5cblxuPHR1aS1waWUtY2hhcnRcbiAgICBjbGFzcz1cInQtY2hhcnRcIlxuICAgIFthY3RpdmVJdGVtSW5kZXhdPVwiYWN0aXZlSXRlbUluZGV4XCJcbiAgICBbbWFza2VkXT1cInRydWVcIlxuICAgIFtzaXplXT1cInNpemVcIlxuICAgIFt2YWx1ZV09XCJ2YWx1ZVwiXG4gICAgKGFjdGl2ZUl0ZW1JbmRleENoYW5nZSk9XCJvbkFjdGl2ZUl0ZW1JbmRleENoYW5nZSgkZXZlbnQpXCJcbi8+XG5cbjxkaXYgY2xhc3M9XCJ0LXNoaWVsZFwiPjwvZGl2PlxuIl19
|
|
@@ -69,7 +69,7 @@ class TuiArcChart {
|
|
|
69
69
|
return (this.getLength(index) * (1 - Math.min((this.value[index] || 0) / this.max, 1)));
|
|
70
70
|
}
|
|
71
71
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiArcChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
72
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiArcChart, isStandalone: true, selector: "tui-arc-chart", inputs: { value: "value", size: "size", max: "max", minLabel: "minLabel", maxLabel: "maxLabel", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "size", "style.width.rem": "width", "style.height.rem": "width", "style.strokeWidth.rem": "strokeWidth" } }, viewQueries: [{ propertyName: "arcs", predicate: ["arc"], descendants: true }], ngImport: i0, template: "<svg\n *tuiRepeatTimes=\"let index of value.length\"\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.em]=\"getDiameter(index)\"\n [style.left.em]=\"getInset(index)\"\n [style.top.em]=\"getInset(index)\"\n [style.width.em]=\"getDiameter(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-0' + index + ')'\"\n [style.strokeDasharray.em]=\"getLength(index)\"\n [style.strokeDashoffset.em]=\"initialized ? getOffset(index) : getLength(index)\"\n />\n</svg>\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n", styles: [":host{position:relative;display:block;flex-shrink:0}.t-svg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;color:var(--tui-background-neutral-1);font-size:1rem;pointer-events:none}.t-value{pointer-events:auto;transition:stroke-dashoffset var(--tui-duration) ease-in-out,opacity var(--tui-duration) ease-in-out .1s}.t-value_inactive{transition-property:stroke-dashoffset,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:.16}.t-content{position:absolute;top:0;left:0;
|
|
72
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiArcChart, isStandalone: true, selector: "tui-arc-chart", inputs: { value: "value", size: "size", max: "max", minLabel: "minLabel", maxLabel: "maxLabel", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "size", "style.width.rem": "width", "style.height.rem": "width", "style.strokeWidth.rem": "strokeWidth" } }, viewQueries: [{ propertyName: "arcs", predicate: ["arc"], descendants: true }], ngImport: i0, template: "<svg\n *tuiRepeatTimes=\"let index of value.length\"\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.em]=\"getDiameter(index)\"\n [style.left.em]=\"getInset(index)\"\n [style.top.em]=\"getInset(index)\"\n [style.width.em]=\"getDiameter(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-0' + index + ')'\"\n [style.strokeDasharray.em]=\"getLength(index)\"\n [style.strokeDashoffset.em]=\"initialized ? getOffset(index) : getLength(index)\"\n />\n</svg>\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n", styles: [":host{position:relative;display:block;flex-shrink:0}.t-svg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;color:var(--tui-background-neutral-1);font-size:1rem;pointer-events:none}.t-value{pointer-events:auto;transition:stroke-dashoffset var(--tui-duration) ease-in-out,opacity var(--tui-duration) ease-in-out .1s}.t-value_inactive{transition-property:stroke-dashoffset,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:.16}.t-content{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;justify-content:center;align-items:center;text-align:center;color:var(--tui-text-secondary);font:var(--tui-font-text-xs);pointer-events:none}:host[data-size=xl] .t-content{font:var(--tui-font-text-m)}.t-wrapper{pointer-events:auto}.t-wrapper:first-line{color:var(--tui-text-primary)}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-text-s);font-weight:700}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-text-m);font-weight:700}:host[data-size=xl] .t-wrapper:first-line{font:var(--tui-font-heading-5)}.t-percent{position:absolute;left:25%;bottom:11%;display:flex;inline-size:50%;justify-content:space-between;font:var(--tui-font-text-xs);color:var(--tui-text-secondary)}:host[data-size=xl] .t-percent{font:var(--tui-font-text-m)}\n"], dependencies: [{ kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
73
73
|
}
|
|
74
74
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiArcChart, decorators: [{
|
|
75
75
|
type: Component,
|
|
@@ -78,7 +78,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
78
78
|
'[style.width.rem]': 'width',
|
|
79
79
|
'[style.height.rem]': 'width',
|
|
80
80
|
'[style.strokeWidth.rem]': 'strokeWidth',
|
|
81
|
-
}, template: "<svg\n *tuiRepeatTimes=\"let index of value.length\"\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.em]=\"getDiameter(index)\"\n [style.left.em]=\"getInset(index)\"\n [style.top.em]=\"getInset(index)\"\n [style.width.em]=\"getDiameter(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-0' + index + ')'\"\n [style.strokeDasharray.em]=\"getLength(index)\"\n [style.strokeDashoffset.em]=\"initialized ? getOffset(index) : getLength(index)\"\n />\n</svg>\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n", styles: [":host{position:relative;display:block;flex-shrink:0}.t-svg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;color:var(--tui-background-neutral-1);font-size:1rem;pointer-events:none}.t-value{pointer-events:auto;transition:stroke-dashoffset var(--tui-duration) ease-in-out,opacity var(--tui-duration) ease-in-out .1s}.t-value_inactive{transition-property:stroke-dashoffset,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:.16}.t-content{position:absolute;top:0;left:0;
|
|
81
|
+
}, template: "<svg\n *tuiRepeatTimes=\"let index of value.length\"\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.em]=\"getDiameter(index)\"\n [style.left.em]=\"getInset(index)\"\n [style.top.em]=\"getInset(index)\"\n [style.width.em]=\"getDiameter(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-0' + index + ')'\"\n [style.strokeDasharray.em]=\"getLength(index)\"\n [style.strokeDashoffset.em]=\"initialized ? getOffset(index) : getLength(index)\"\n />\n</svg>\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n", styles: [":host{position:relative;display:block;flex-shrink:0}.t-svg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;color:var(--tui-background-neutral-1);font-size:1rem;pointer-events:none}.t-value{pointer-events:auto;transition:stroke-dashoffset var(--tui-duration) ease-in-out,opacity var(--tui-duration) ease-in-out .1s}.t-value_inactive{transition-property:stroke-dashoffset,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:.16}.t-content{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;display:flex;justify-content:center;align-items:center;text-align:center;color:var(--tui-text-secondary);font:var(--tui-font-text-xs);pointer-events:none}:host[data-size=xl] .t-content{font:var(--tui-font-text-m)}.t-wrapper{pointer-events:auto}.t-wrapper:first-line{color:var(--tui-text-primary)}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-text-s);font-weight:700}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-text-m);font-weight:700}:host[data-size=xl] .t-wrapper:first-line{font:var(--tui-font-heading-5)}.t-percent{position:absolute;left:25%;bottom:11%;display:flex;inline-size:50%;justify-content:space-between;font:var(--tui-font-text-xs);color:var(--tui-text-secondary)}:host[data-size=xl] .t-percent{font:var(--tui-font-text-m)}\n"] }]
|
|
82
82
|
}], ctorParameters: function () { return []; }, propDecorators: { value: [{
|
|
83
83
|
type: Input
|
|
84
84
|
}], 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 type {ElementRef, QueryList} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n inject,\n Input,\n Output,\n ViewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {tuiTypedFromEvent, tuiWatch} from '@taiga-ui/cdk/observables';\nimport type {TuiSizeXL} from '@taiga-ui/core/types';\nimport type {Observable} from 'rxjs';\nimport {map, merge, ReplaySubject, startWith, switchMap, tap, timer} from 'rxjs';\n// 3/4 with 1% safety offset\nconst ARC = 0.76;\n\nconst SIZE: Record<TuiSizeXL, number> = {\n m: 9,\n l: 11,\n xl: 16,\n};\n\nconst WIDTH: Record<TuiSizeXL, number> = {\n m: 0.25,\n l: 0.375,\n xl: 0.5625,\n};\n\nconst GAP: Record<TuiSizeXL, number> = {\n m: 0.125,\n l: 0.1875,\n xl: 0.25,\n};\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 standalone: true,\n selector: 'tui-arc-chart',\n imports: [TuiRepeatTimes],\n templateUrl: './arc-chart.template.html',\n styleUrls: ['./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 = false;\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 constructor() {\n timer(0)\n .pipe(tuiWatch(inject(ChangeDetectorRef)), takeUntilDestroyed())\n .subscribe(() => {\n this.initialized = true;\n });\n }\n\n @ViewChildren('arc')\n protected set arcs(arcs: QueryList<ElementRef<SVGElement>>) {\n this.arcs$.next(arcs);\n }\n\n protected get width(): number {\n return SIZE[this.size];\n }\n\n protected get strokeWidth(): number {\n return WIDTH[this.size];\n }\n\n protected isInactive(index: number): boolean {\n return !Number.isNaN(this.activeItemIndex) && index !== this.activeItemIndex;\n }\n\n protected getInset(index: number): number {\n return this.strokeWidth / 2 + index * (this.strokeWidth + GAP[this.size]);\n }\n\n protected getDiameter(index: number): number {\n return SIZE[this.size] - 2 * this.getInset(index);\n }\n\n protected getLength(index: number): number {\n return Math.PI * this.getDiameter(index) * ARC;\n }\n\n protected getOffset(index: number): number {\n return (\n this.getLength(index) * (1 - Math.min((this.value[index] || 0) / this.max, 1))\n );\n }\n}\n","<svg\n *tuiRepeatTimes=\"let index of value.length\"\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.em]=\"getDiameter(index)\"\n [style.left.em]=\"getInset(index)\"\n [style.top.em]=\"getInset(index)\"\n [style.width.em]=\"getDiameter(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-0' + index + ')'\"\n [style.strokeDasharray.em]=\"getLength(index)\"\n [style.strokeDashoffset.em]=\"initialized ? getOffset(index) : getLength(index)\"\n />\n</svg>\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAgBA;AACA,MAAM,GAAG,GAAG,IAAI,CAAC;AAEjB,MAAM,IAAI,GAA8B;AACpC,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,EAAE,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,KAAK,GAA8B;AACrC,IAAA,CAAC,EAAE,IAAI;AACP,IAAA,CAAC,EAAE,KAAK;AACR,IAAA,EAAE,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,GAAG,GAA8B;AACnC,IAAA,CAAC,EAAE,KAAK;AACR,IAAA,CAAC,EAAE,MAAM;AACT,IAAA,EAAE,EAAE,IAAI;CACX,CAAC;AAEF,SAAS,WAAW,CAAC,IAAuC,EAAA;IACxD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAC,aAAa,EAAC,EAAE,KAAK,KACnC,KAAK,CACD,iBAAiB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG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,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,OAAA,EAAA,IAAA,EAAA,MAAA,EAAA,GAAA,EAAA,KAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,UAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,EAAA,OAAA,EAAA,EAAA,qBAAA,EAAA,uBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,kBAAA,EAAA,OAAA,EAAA,uBAAA,EAAA,aAAA,EAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,MAAA,EAAA,SAAA,EAAA,CAAA,KAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC5DxB,qlCAmCA,EAAA,MAAA,EAAA,CAAA,
|
|
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 type {ElementRef, QueryList} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n inject,\n Input,\n Output,\n ViewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {tuiTypedFromEvent, tuiWatch} from '@taiga-ui/cdk/observables';\nimport type {TuiSizeXL} from '@taiga-ui/core/types';\nimport type {Observable} from 'rxjs';\nimport {map, merge, ReplaySubject, startWith, switchMap, tap, timer} from 'rxjs';\n// 3/4 with 1% safety offset\nconst ARC = 0.76;\n\nconst SIZE: Record<TuiSizeXL, number> = {\n m: 9,\n l: 11,\n xl: 16,\n};\n\nconst WIDTH: Record<TuiSizeXL, number> = {\n m: 0.25,\n l: 0.375,\n xl: 0.5625,\n};\n\nconst GAP: Record<TuiSizeXL, number> = {\n m: 0.125,\n l: 0.1875,\n xl: 0.25,\n};\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 standalone: true,\n selector: 'tui-arc-chart',\n imports: [TuiRepeatTimes],\n templateUrl: './arc-chart.template.html',\n styleUrls: ['./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 = false;\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 constructor() {\n timer(0)\n .pipe(tuiWatch(inject(ChangeDetectorRef)), takeUntilDestroyed())\n .subscribe(() => {\n this.initialized = true;\n });\n }\n\n @ViewChildren('arc')\n protected set arcs(arcs: QueryList<ElementRef<SVGElement>>) {\n this.arcs$.next(arcs);\n }\n\n protected get width(): number {\n return SIZE[this.size];\n }\n\n protected get strokeWidth(): number {\n return WIDTH[this.size];\n }\n\n protected isInactive(index: number): boolean {\n return !Number.isNaN(this.activeItemIndex) && index !== this.activeItemIndex;\n }\n\n protected getInset(index: number): number {\n return this.strokeWidth / 2 + index * (this.strokeWidth + GAP[this.size]);\n }\n\n protected getDiameter(index: number): number {\n return SIZE[this.size] - 2 * this.getInset(index);\n }\n\n protected getLength(index: number): number {\n return Math.PI * this.getDiameter(index) * ARC;\n }\n\n protected getOffset(index: number): number {\n return (\n this.getLength(index) * (1 - Math.min((this.value[index] || 0) / this.max, 1))\n );\n }\n}\n","<svg\n *tuiRepeatTimes=\"let index of value.length\"\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.em]=\"getDiameter(index)\"\n [style.left.em]=\"getInset(index)\"\n [style.top.em]=\"getInset(index)\"\n [style.width.em]=\"getDiameter(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-0' + index + ')'\"\n [style.strokeDasharray.em]=\"getLength(index)\"\n [style.strokeDashoffset.em]=\"initialized ? getOffset(index) : getLength(index)\"\n />\n</svg>\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAgBA;AACA,MAAM,GAAG,GAAG,IAAI,CAAC;AAEjB,MAAM,IAAI,GAA8B;AACpC,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,EAAE,EAA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eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;4FAWf,WAAW,EAAA,UAAA,EAAA,CAAA;kBAdvB,SAAS;iCACM,IAAI,EAAA,QAAA,EACN,eAAe,EAAA,OAAA,EAChB,CAAC,cAAc,CAAC,EAGR,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,kBAAkB,EAAE,MAAM;AAC1B,wBAAA,mBAAmB,EAAE,OAAO;AAC5B,wBAAA,oBAAoB,EAAE,OAAO;AAC7B,wBAAA,yBAAyB,EAAE,aAAa;AAC3C,qBAAA,EAAA,QAAA,EAAA,qlCAAA,EAAA,MAAA,EAAA,CAAA,42CAAA,CAAA,EAAA,CAAA;0EAQM,KAAK,EAAA,CAAA;sBADX,KAAK;gBAIC,IAAI,EAAA,CAAA;sBADV,KAAK;gBAIC,GAAG,EAAA,CAAA;sBADT,KAAK;gBAIC,QAAQ,EAAA,CAAA;sBADd,KAAK;gBAIC,QAAQ,EAAA,CAAA;sBADd,KAAK;gBAIC,eAAe,EAAA,CAAA;sBADrB,KAAK;gBAIU,qBAAqB,EAAA,CAAA;sBADpC,MAAM;gBAsBO,IAAI,EAAA,CAAA;sBADjB,YAAY;uBAAC,KAAK,CAAA;;;AExGvB;;AAEG;;;;"}
|
|
@@ -41,13 +41,13 @@ class TuiAxes {
|
|
|
41
41
|
return this.axisY === 'none';
|
|
42
42
|
}
|
|
43
43
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiAxes, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
44
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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: { properties: { "class._centered": "centeredXLabels" } }, ngImport: i0, template: "<div\n *ngIf=\"hasYLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"axisYName\"\n automation-id=\"tui-axex__axis-y-name\"\n class=\"t-name t-name_primary\"\n >\n {{ axisYName }}\n </div>\n <div\n *ngIf=\"!axisYInset\"\n class=\"t-labels-y t-labels-y_primary\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n</div>\n<div class=\"t-wrapper\">\n <div\n class=\"t-grid\"\n [style.borderBottomStyle]=\"axisX\"\n [style.borderLeftStyle]=\"axisY\"\n >\n <div class=\"t-vertical\">\n <div\n *tuiRepeatTimes=\"let index of verticalLines\"\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.borderRightStyle]=\"verticalLinesHandler(index, verticalLines)\"\n ></div>\n </div>\n <div class=\"t-horizontal\">\n <div\n *tuiRepeatTimes=\"let index of horizontalLines\"\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.borderTopStyle]=\"horizontalLinesHandler(index, horizontalLines)\"\n ></div>\n </div>\n <div\n *ngIf=\"axisYInset\"\n class=\"t-labels-y t-labels-y_inset\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_inset t-labels-y_inset_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div class=\"t-content\">\n <ng-content />\n </div>\n </div>\n <div\n *ngIf=\"hasXLabels\"\n class=\"t-labels-x\"\n >\n <div\n *ngFor=\"let label of axisXLabels\"\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 </div>\n</div>\n<div\n *ngIf=\"hasYSecondaryLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"!axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryName\"\n automation-id=\"tui-axex__axis-y-secondary-name\"\n class=\"t-name\"\n >\n {{ axisYSecondaryName }}\n </div>\n</div>\n", styles: [":host{display:flex}.t-wrapper{display:flex;flex:1;
|
|
44
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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: { properties: { "class._centered": "centeredXLabels" } }, ngImport: i0, template: "<div\n *ngIf=\"hasYLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"axisYName\"\n automation-id=\"tui-axex__axis-y-name\"\n class=\"t-name t-name_primary\"\n >\n {{ axisYName }}\n </div>\n <div\n *ngIf=\"!axisYInset\"\n class=\"t-labels-y t-labels-y_primary\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n</div>\n<div class=\"t-wrapper\">\n <div\n class=\"t-grid\"\n [style.borderBottomStyle]=\"axisX\"\n [style.borderLeftStyle]=\"axisY\"\n >\n <div class=\"t-vertical\">\n <div\n *tuiRepeatTimes=\"let index of verticalLines\"\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.borderRightStyle]=\"verticalLinesHandler(index, verticalLines)\"\n ></div>\n </div>\n <div class=\"t-horizontal\">\n <div\n *tuiRepeatTimes=\"let index of horizontalLines\"\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.borderTopStyle]=\"horizontalLinesHandler(index, horizontalLines)\"\n ></div>\n </div>\n <div\n *ngIf=\"axisYInset\"\n class=\"t-labels-y t-labels-y_inset\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_inset t-labels-y_inset_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div class=\"t-content\">\n <ng-content />\n </div>\n </div>\n <div\n *ngIf=\"hasXLabels\"\n class=\"t-labels-x\"\n >\n <div\n *ngFor=\"let label of axisXLabels\"\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 </div>\n</div>\n<div\n *ngIf=\"hasYSecondaryLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"!axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryName\"\n automation-id=\"tui-axex__axis-y-secondary-name\"\n class=\"t-name\"\n >\n {{ axisYSecondaryName }}\n </div>\n</div>\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-bottom:2rem}.t-name{font:var(--tui-font-text-xs);writing-mode:tb;text-align:center;padding-left:.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-right:.75rem}.t-labels-y_secondary{padding-left:.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-bottom: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-bottom:-.375rem}.t-label-y:last-child{margin-top:-.375rem}.t-content{position:absolute;top:0;left:-1px;right:0;bottom:-1px;display:flex;align-items:flex-end}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
45
45
|
}
|
|
46
46
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiAxes, decorators: [{
|
|
47
47
|
type: Component,
|
|
48
48
|
args: [{ standalone: true, selector: 'tui-axes', imports: [NgIf, NgForOf, TuiRepeatTimes], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
49
49
|
'[class._centered]': 'centeredXLabels',
|
|
50
|
-
}, template: "<div\n *ngIf=\"hasYLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"axisYName\"\n automation-id=\"tui-axex__axis-y-name\"\n class=\"t-name t-name_primary\"\n >\n {{ axisYName }}\n </div>\n <div\n *ngIf=\"!axisYInset\"\n class=\"t-labels-y t-labels-y_primary\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n</div>\n<div class=\"t-wrapper\">\n <div\n class=\"t-grid\"\n [style.borderBottomStyle]=\"axisX\"\n [style.borderLeftStyle]=\"axisY\"\n >\n <div class=\"t-vertical\">\n <div\n *tuiRepeatTimes=\"let index of verticalLines\"\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.borderRightStyle]=\"verticalLinesHandler(index, verticalLines)\"\n ></div>\n </div>\n <div class=\"t-horizontal\">\n <div\n *tuiRepeatTimes=\"let index of horizontalLines\"\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.borderTopStyle]=\"horizontalLinesHandler(index, horizontalLines)\"\n ></div>\n </div>\n <div\n *ngIf=\"axisYInset\"\n class=\"t-labels-y t-labels-y_inset\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_inset t-labels-y_inset_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div class=\"t-content\">\n <ng-content />\n </div>\n </div>\n <div\n *ngIf=\"hasXLabels\"\n class=\"t-labels-x\"\n >\n <div\n *ngFor=\"let label of axisXLabels\"\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 </div>\n</div>\n<div\n *ngIf=\"hasYSecondaryLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"!axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryName\"\n automation-id=\"tui-axex__axis-y-secondary-name\"\n class=\"t-name\"\n >\n {{ axisYSecondaryName }}\n </div>\n</div>\n", styles: [":host{display:flex}.t-wrapper{display:flex;flex:1;
|
|
50
|
+
}, template: "<div\n *ngIf=\"hasYLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"axisYName\"\n automation-id=\"tui-axex__axis-y-name\"\n class=\"t-name t-name_primary\"\n >\n {{ axisYName }}\n </div>\n <div\n *ngIf=\"!axisYInset\"\n class=\"t-labels-y t-labels-y_primary\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n</div>\n<div class=\"t-wrapper\">\n <div\n class=\"t-grid\"\n [style.borderBottomStyle]=\"axisX\"\n [style.borderLeftStyle]=\"axisY\"\n >\n <div class=\"t-vertical\">\n <div\n *tuiRepeatTimes=\"let index of verticalLines\"\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.borderRightStyle]=\"verticalLinesHandler(index, verticalLines)\"\n ></div>\n </div>\n <div class=\"t-horizontal\">\n <div\n *tuiRepeatTimes=\"let index of horizontalLines\"\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.borderTopStyle]=\"horizontalLinesHandler(index, horizontalLines)\"\n ></div>\n </div>\n <div\n *ngIf=\"axisYInset\"\n class=\"t-labels-y t-labels-y_inset\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_inset t-labels-y_inset_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div class=\"t-content\">\n <ng-content />\n </div>\n </div>\n <div\n *ngIf=\"hasXLabels\"\n class=\"t-labels-x\"\n >\n <div\n *ngFor=\"let label of axisXLabels\"\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 </div>\n</div>\n<div\n *ngIf=\"hasYSecondaryLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"!axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryName\"\n automation-id=\"tui-axex__axis-y-secondary-name\"\n class=\"t-name\"\n >\n {{ axisYSecondaryName }}\n </div>\n</div>\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-bottom:2rem}.t-name{font:var(--tui-font-text-xs);writing-mode:tb;text-align:center;padding-left:.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-right:.75rem}.t-labels-y_secondary{padding-left:.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-bottom: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-bottom:-.375rem}.t-label-y:last-child{margin-top:-.375rem}.t-content{position:absolute;top:0;left:-1px;right:0;bottom:-1px;display:flex;align-items:flex-end}\n"] }]
|
|
51
51
|
}], propDecorators: { axisX: [{
|
|
52
52
|
type: Input
|
|
53
53
|
}], 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 {NgForOf, NgIf} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport type {TuiLineHandler, TuiLineType} from '@taiga-ui/addon-charts/types';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk/constants';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\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 standalone: true,\n selector: 'tui-axes',\n imports: [NgIf, NgForOf, TuiRepeatTimes],\n templateUrl: './axes.template.html',\n styleUrls: ['./axes.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\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","<div\n *ngIf=\"hasYLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"axisYName\"\n automation-id=\"tui-axex__axis-y-name\"\n class=\"t-name t-name_primary\"\n >\n {{ axisYName }}\n </div>\n <div\n *ngIf=\"!axisYInset\"\n class=\"t-labels-y t-labels-y_primary\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n</div>\n<div class=\"t-wrapper\">\n <div\n class=\"t-grid\"\n [style.borderBottomStyle]=\"axisX\"\n [style.borderLeftStyle]=\"axisY\"\n >\n <div class=\"t-vertical\">\n <div\n *tuiRepeatTimes=\"let index of verticalLines\"\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.borderRightStyle]=\"verticalLinesHandler(index, verticalLines)\"\n ></div>\n </div>\n <div class=\"t-horizontal\">\n <div\n *tuiRepeatTimes=\"let index of horizontalLines\"\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.borderTopStyle]=\"horizontalLinesHandler(index, horizontalLines)\"\n ></div>\n </div>\n <div\n *ngIf=\"axisYInset\"\n class=\"t-labels-y t-labels-y_inset\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_inset t-labels-y_inset_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div class=\"t-content\">\n <ng-content />\n </div>\n </div>\n <div\n *ngIf=\"hasXLabels\"\n class=\"t-labels-x\"\n >\n <div\n *ngFor=\"let label of axisXLabels\"\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 </div>\n</div>\n<div\n *ngIf=\"hasYSecondaryLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"!axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryName\"\n automation-id=\"tui-axex__axis-y-secondary-name\"\n class=\"t-name\"\n >\n {{ axisYSecondaryName }}\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAMa,iBAAiB,GAAmB,MAAM,SAAS;MACnD,iBAAiB,GAAmB,MAAM,SAAS;MACnD,gBAAgB,GAAmB,MAAM,QAAQ;MACjD,eAAe,GAAmB,MAAM,OAAO;AAE5D,MAWa,OAAO,CAAA;AAXpB,IAAA,WAAA,GAAA;QAaW,IAAK,CAAA,KAAA,GAAgB,OAAO,CAAC;QAG7B,IAAW,CAAA,WAAA,GAAiC,EAAE,CAAC;QAG/C,IAAK,CAAA,KAAA,GAAgB,OAAO,CAAC;QAG7B,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;QAGnB,IAAW,CAAA,WAAA,GAAsB,EAAE,CAAC;QAGpC,IAAS,CAAA,SAAA,GAAG,EAAE,CAAC;QAGf,IAAmB,CAAA,mBAAA,GAAG,KAAK,CAAC;QAG5B,IAAoB,CAAA,oBAAA,GAAsB,EAAE,CAAC;QAG7C,IAAkB,CAAA,kBAAA,GAAG,EAAE,CAAC;QAGxB,IAAe,CAAA,eAAA,GAAG,CAAC,CAAC;QAGpB,IAAsB,CAAA,sBAAA,GAAmB,gBAAgB,CAAC;QAG1D,IAAa,CAAA,aAAA,GAAG,CAAC,CAAC;QAGlB,IAAoB,CAAA,oBAAA,GAAmB,iBAAiB,CAAC;AAwBnE,KAAA;AAtBG,IAAA,IAAW,UAAU,GAAA;AACjB,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;KACpC;AAED,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,CAAC;KAC9E;AAED,IAAA,IAAW,mBAAmB,GAAA;AAC1B,QAAA,QACI,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,mBAAmB;AAChE,YAAA,CAAC,CAAC,IAAI,CAAC,kBAAkB,EAC3B;KACL;AAEM,IAAA,QAAQ,CAAC,KAAoB,EAAA;QAChC,OAAO,KAAK,IAAI,mBAAmB,CAAC;KACvC;AAED,IAAA,IAAc,eAAe,GAAA;AACzB,QAAA,OAAO,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC;KAChC;+GA7DQ,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAP,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,OAAO,kkBCtBpB,myGAkHA,EAAA,MAAA,EAAA,CAAA,
|
|
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 {NgForOf, NgIf} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport type {TuiLineHandler, TuiLineType} from '@taiga-ui/addon-charts/types';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk/constants';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\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 standalone: true,\n selector: 'tui-axes',\n imports: [NgIf, NgForOf, TuiRepeatTimes],\n templateUrl: './axes.template.html',\n styleUrls: ['./axes.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\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","<div\n *ngIf=\"hasYLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"axisYName\"\n automation-id=\"tui-axex__axis-y-name\"\n class=\"t-name t-name_primary\"\n >\n {{ axisYName }}\n </div>\n <div\n *ngIf=\"!axisYInset\"\n class=\"t-labels-y t-labels-y_primary\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n</div>\n<div class=\"t-wrapper\">\n <div\n class=\"t-grid\"\n [style.borderBottomStyle]=\"axisX\"\n [style.borderLeftStyle]=\"axisY\"\n >\n <div class=\"t-vertical\">\n <div\n *tuiRepeatTimes=\"let index of verticalLines\"\n automation-id=\"tui-axex__vertical-line\"\n class=\"t-line t-line_vertical\"\n [style.borderRightStyle]=\"verticalLinesHandler(index, verticalLines)\"\n ></div>\n </div>\n <div class=\"t-horizontal\">\n <div\n *tuiRepeatTimes=\"let index of horizontalLines\"\n automation-id=\"tui-axex__horizontal-line\"\n class=\"t-line\"\n [style.borderTopStyle]=\"horizontalLinesHandler(index, horizontalLines)\"\n ></div>\n </div>\n <div\n *ngIf=\"axisYInset\"\n class=\"t-labels-y t-labels-y_inset\"\n >\n <div\n *ngFor=\"let label of axisYLabels\"\n automation-id=\"tui-axex__axis-y-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_inset t-labels-y_inset_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div class=\"t-content\">\n <ng-content />\n </div>\n </div>\n <div\n *ngIf=\"hasXLabels\"\n class=\"t-labels-x\"\n >\n <div\n *ngFor=\"let label of axisXLabels\"\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 </div>\n</div>\n<div\n *ngIf=\"hasYSecondaryLabels\"\n class=\"t-side\"\n [class.t-side_padding]=\"hasXLabels\"\n>\n <div\n *ngIf=\"!axisYSecondaryInset\"\n class=\"t-labels-y t-labels-y_secondary\"\n >\n <div\n *ngFor=\"let label of axisYSecondaryLabels\"\n automation-id=\"tui-axex__axis-y-secondary-label\"\n class=\"t-label-y\"\n >\n {{ fallback(label) }}\n </div>\n </div>\n <div\n *ngIf=\"axisYSecondaryName\"\n automation-id=\"tui-axex__axis-y-secondary-name\"\n class=\"t-name\"\n >\n {{ axisYSecondaryName }}\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAMa,iBAAiB,GAAmB,MAAM,SAAS;MACnD,iBAAiB,GAAmB,MAAM,SAAS;MACnD,gBAAgB,GAAmB,MAAM,QAAQ;MACjD,eAAe,GAAmB,MAAM,OAAO;AAE5D,MAWa,OAAO,CAAA;AAXpB,IAAA,WAAA,GAAA;QAaW,IAAK,CAAA,KAAA,GAAgB,OAAO,CAAC;QAG7B,IAAW,CAAA,WAAA,GAAiC,EAAE,CAAC;QAG/C,IAAK,CAAA,KAAA,GAAgB,OAAO,CAAC;QAG7B,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;QAGnB,IAAW,CAAA,WAAA,GAAsB,EAAE,CAAC;QAGpC,IAAS,CAAA,SAAA,GAAG,EAAE,CAAC;QAGf,IAAmB,CAAA,mBAAA,GAAG,KAAK,CAAC;QAG5B,IAAoB,CAAA,oBAAA,GAAsB,EAAE,CAAC;QAG7C,IAAkB,CAAA,kBAAA,GAAG,EAAE,CAAC;QAGxB,IAAe,CAAA,eAAA,GAAG,CAAC,CAAC;QAGpB,IAAsB,CAAA,sBAAA,GAAmB,gBAAgB,CAAC;QAG1D,IAAa,CAAA,aAAA,GAAG,CAAC,CAAC;QAGlB,IAAoB,CAAA,oBAAA,GAAmB,iBAAiB,CAAC;AAwBnE,KAAA;AAtBG,IAAA,IAAW,UAAU,GAAA;AACjB,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;KACpC;AAED,IAA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UAAA,EAAA,CAAA;kBAXnB,SAAS;AACM,YAAA,IAAA,EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,EACN,QAAA,EAAA,UAAU,EACX,OAAA,EAAA,CAAC,IAAI,EAAE,OAAO,EAAE,cAAc,CAAC,EAAA,eAAA,EAGvB,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,mBAAmB,EAAE,iBAAiB;AACzC,qBAAA,EAAA,QAAA,EAAA,myGAAA,EAAA,MAAA,EAAA,CAAA,ooEAAA,CAAA,EAAA,CAAA;8BAIM,KAAK,EAAA,CAAA;sBADX,KAAK;gBAIC,WAAW,EAAA,CAAA;sBADjB,KAAK;gBAIC,KAAK,EAAA,CAAA;sBADX,KAAK;gBAIC,UAAU,EAAA,CAAA;sBADhB,KAAK;gBAIC,WAAW,EAAA,CAAA;sBADjB,KAAK;gBAIC,SAAS,EAAA,CAAA;sBADf,KAAK;gBAIC,mBAAmB,EAAA,CAAA;sBADzB,KAAK;gBAIC,oBAAoB,EAAA,CAAA;sBAD1B,KAAK;gBAIC,kBAAkB,EAAA,CAAA;sBADxB,KAAK;gBAIC,eAAe,EAAA,CAAA;sBADrB,KAAK;gBAIC,sBAAsB,EAAA,CAAA;sBAD5B,KAAK;gBAIC,aAAa,EAAA,CAAA;sBADnB,KAAK;gBAIC,oBAAoB,EAAA,CAAA;sBAD1B,KAAK;;;AE3DV;;AAEG;;;;"}
|
|
@@ -5,7 +5,7 @@ import { inject, Component, ChangeDetectionStrategy, ViewChildren, Input } from
|
|
|
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 {
|
|
8
|
+
import { tuiInjectId } from '@taiga-ui/cdk/services';
|
|
9
9
|
import { tuiSum } from '@taiga-ui/cdk/utils/math';
|
|
10
10
|
import { tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
11
11
|
import * as i1 from '@taiga-ui/core/directives/hint';
|
|
@@ -14,7 +14,7 @@ import { TuiHintOptionsDirective, TuiHintHover, tuiHintOptionsProvider, TuiHint
|
|
|
14
14
|
class TuiBarChart {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.hintOptions = inject(TuiHintOptionsDirective, { optional: true });
|
|
17
|
-
this.
|
|
17
|
+
this.autoId = tuiInjectId();
|
|
18
18
|
this.drivers = EMPTY_QUERY;
|
|
19
19
|
this.value = [];
|
|
20
20
|
this.max = NaN;
|
|
@@ -32,7 +32,7 @@ class TuiBarChart {
|
|
|
32
32
|
return this.hintOptions?.content || '';
|
|
33
33
|
}
|
|
34
34
|
getHintId(index) {
|
|
35
|
-
return `${this.
|
|
35
|
+
return `${this.autoId}_${index}`;
|
|
36
36
|
}
|
|
37
37
|
transpose(value) {
|
|
38
38
|
return value.reduce((result, next) => next.map((_, index) => [...(result[index] || []), next[index] || 0]), []);
|
|
@@ -45,7 +45,7 @@ class TuiBarChart {
|
|
|
45
45
|
: values.reduce((max, value) => Math.max(...value, max), 0);
|
|
46
46
|
}
|
|
47
47
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiBarChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
48
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiBarChart, isStandalone: true, selector: "tui-bar-chart", inputs: { value: "value", max: "max", size: "size", collapsed: "collapsed" }, viewQueries: [{ propertyName: "drivers", predicate: TuiHintHover, descendants: true }], ngImport: i0, template: "<div\n *ngFor=\"let set of transposed; let index = index\"\n class=\"t-wrapper\"\n [class.t-wrapper_hoverable]=\"!!hintContent\"\n [class.t-wrapper_hovered]=\"drivers.get(index) | async\"\n [tuiHint]=\"hintContent\"\n [tuiHintContext]=\"{$implicit: index}\"\n [tuiHintDescribe]=\"getHintId(index)\"\n [tuiHintHost]=\"hintHost\"\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", styles: [":host{display:flex;flex:1;
|
|
48
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiBarChart, isStandalone: true, selector: "tui-bar-chart", inputs: { value: "value", max: "max", size: "size", collapsed: "collapsed" }, viewQueries: [{ propertyName: "drivers", predicate: TuiHintHover, descendants: true }], ngImport: i0, template: "<div\n *ngFor=\"let set of transposed; let index = index\"\n class=\"t-wrapper\"\n [class.t-wrapper_hoverable]=\"!!hintContent\"\n [class.t-wrapper_hovered]=\"drivers.get(index) | async\"\n [tuiHint]=\"hintContent\"\n [tuiHintContext]=\"{$implicit: index}\"\n [tuiHintDescribe]=\"getHintId(index)\"\n [tuiHintHost]=\"hintHost\"\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", 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: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { 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" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: TuiBarSet, selector: "tui-bar-set", inputs: ["value", "size", "collapsed"] }], viewProviders: [tuiHintOptionsProvider({ direction: 'top' })], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
49
49
|
}
|
|
50
50
|
__decorate([
|
|
51
51
|
tuiPure
|
|
@@ -55,7 +55,7 @@ __decorate([
|
|
|
55
55
|
], TuiBarChart.prototype, "getMax", null);
|
|
56
56
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiBarChart, decorators: [{
|
|
57
57
|
type: Component,
|
|
58
|
-
args: [{ standalone: true, selector: 'tui-bar-chart', imports: [NgForOf, TuiHint, TuiMapperPipe, AsyncPipe, TuiBarSet], changeDetection: ChangeDetectionStrategy.OnPush, viewProviders: [tuiHintOptionsProvider({ direction: 'top' })], template: "<div\n *ngFor=\"let set of transposed; let index = index\"\n class=\"t-wrapper\"\n [class.t-wrapper_hoverable]=\"!!hintContent\"\n [class.t-wrapper_hovered]=\"drivers.get(index) | async\"\n [tuiHint]=\"hintContent\"\n [tuiHintContext]=\"{$implicit: index}\"\n [tuiHintDescribe]=\"getHintId(index)\"\n [tuiHintHost]=\"hintHost\"\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", styles: [":host{display:flex;flex:1;
|
|
58
|
+
args: [{ standalone: true, selector: 'tui-bar-chart', imports: [NgForOf, TuiHint, TuiMapperPipe, AsyncPipe, TuiBarSet], changeDetection: ChangeDetectionStrategy.OnPush, viewProviders: [tuiHintOptionsProvider({ direction: 'top' })], template: "<div\n *ngFor=\"let set of transposed; let index = index\"\n class=\"t-wrapper\"\n [class.t-wrapper_hoverable]=\"!!hintContent\"\n [class.t-wrapper_hovered]=\"drivers.get(index) | async\"\n [tuiHint]=\"hintContent\"\n [tuiHintContext]=\"{$implicit: index}\"\n [tuiHintDescribe]=\"getHintId(index)\"\n [tuiHintHost]=\"hintHost\"\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", 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"] }]
|
|
59
59
|
}], propDecorators: { drivers: [{
|
|
60
60
|
type: ViewChildren,
|
|
61
61
|
args: [TuiHintHover]
|
|
@@ -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, NgForOf} from '@angular/common';\nimport type {QueryList} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n Input,\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, NgForOf} from '@angular/common';\nimport type {QueryList} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n Input,\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 {tuiInjectId} from '@taiga-ui/cdk/services';\nimport type {TuiContext, TuiMapper} from '@taiga-ui/cdk/types';\nimport {tuiSum} from '@taiga-ui/cdk/utils/math';\nimport {tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TuiHint,\n TuiHintHover,\n TuiHintOptionsDirective,\n tuiHintOptionsProvider,\n} from '@taiga-ui/core/directives/hint';\nimport type {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport type {Observable} from 'rxjs';\n\n@Component({\n standalone: true,\n selector: 'tui-bar-chart',\n imports: [NgForOf, TuiHint, TuiMapperPipe, AsyncPipe, TuiBarSet],\n templateUrl: './bar-chart.template.html',\n styleUrls: ['./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 = tuiInjectId();\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 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 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","<div\n *ngFor=\"let set of transposed; let index = index\"\n class=\"t-wrapper\"\n [class.t-wrapper_hoverable]=\"!!hintContent\"\n [class.t-wrapper_hovered]=\"drivers.get(index) | async\"\n [tuiHint]=\"hintContent\"\n [tuiHintContext]=\"{$implicit: index}\"\n [tuiHintDescribe]=\"getHintId(index)\"\n [tuiHintHost]=\"hintHost\"\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 * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AA0BA,MASa,WAAW,CAAA;AATxB,IAAA,WAAA,GAAA;QAUqB,IAAW,CAAA,WAAA,GAAG,MAAM,CAAC,uBAAuB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;QAChE,IAAM,CAAA,MAAA,GAAG,WAAW,EAAE,CAAC;QAGrB,IAAO,CAAA,OAAA,GAAmC,WAAW,CAAC;QAGlE,IAAK,CAAA,KAAA,GAAqC,EAAE,CAAC;QAG7C,IAAG,CAAA,GAAA,GAAG,GAAG,CAAC;QAGV,IAAI,CAAA,IAAA,GAA+B,GAAG,CAAC;QAGvC,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;AAUT,QAAA,IAAA,CAAA,aAAa,GAGzB,CAAC,GAAG,EAAE,SAAS,EAAE,G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AM,EAAA,EAAA,EAAA,EAAA,CAAA;;AExFlB;;AAEG;;;;"}
|
|
@@ -32,14 +32,14 @@ class TuiBarSet {
|
|
|
32
32
|
: Math.abs(value.reduce((a, b) => (a < b ? a : b), 0));
|
|
33
33
|
}
|
|
34
34
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiBarSet, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
35
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiBarSet, isStandalone: true, selector: "tui-bar-set", inputs: { value: "value", size: "size", collapsed: "collapsed" }, ngImport: i0, template: "<ng-container *ngIf=\"size; else flexible\">\n <ng-container\n *ngFor=\"let item of computedValue; let index = index\"\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: false}\"\n />\n</ng-container>\n<ng-template #flexible>\n <div\n *ngFor=\"let item of computedValue; let index = index\"\n class=\"t-wrapper\"\n >\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: true}\"\n />\n </div>\n</ng-template>\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-0' + index + ')'\"\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;
|
|
35
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiBarSet, isStandalone: true, selector: "tui-bar-set", inputs: { value: "value", size: "size", collapsed: "collapsed" }, ngImport: i0, template: "<ng-container *ngIf=\"size; else flexible\">\n <ng-container\n *ngFor=\"let item of computedValue; let index = index\"\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: false}\"\n />\n</ng-container>\n<ng-template #flexible>\n <div\n *ngFor=\"let item of computedValue; let index = index\"\n class=\"t-wrapper\"\n >\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: true}\"\n />\n </div>\n</ng-template>\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-0' + index + ')'\"\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-left:25%}.t-wrapper:last-of-type{margin-right: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: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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
40
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiBarSet, decorators: [{
|
|
41
41
|
type: Component,
|
|
42
|
-
args: [{ standalone: true, selector: 'tui-bar-set', imports: [NgIf, NgForOf, NgTemplateOutlet, TuiBar], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"size; else flexible\">\n <ng-container\n *ngFor=\"let item of computedValue; let index = index\"\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: false}\"\n />\n</ng-container>\n<ng-template #flexible>\n <div\n *ngFor=\"let item of computedValue; let index = index\"\n class=\"t-wrapper\"\n >\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: true}\"\n />\n </div>\n</ng-template>\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-0' + index + ')'\"\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;
|
|
42
|
+
args: [{ standalone: true, selector: 'tui-bar-set', imports: [NgIf, NgForOf, NgTemplateOutlet, TuiBar], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"size; else flexible\">\n <ng-container\n *ngFor=\"let item of computedValue; let index = index\"\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: false}\"\n />\n</ng-container>\n<ng-template #flexible>\n <div\n *ngFor=\"let item of computedValue; let index = index\"\n class=\"t-wrapper\"\n >\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: true}\"\n />\n </div>\n</ng-template>\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-0' + index + ')'\"\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-left:25%}.t-wrapper:last-of-type{margin-right: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: [{
|
|
44
44
|
type: Input
|
|
45
45
|
}], size: [{
|
|
@@ -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 {NgForOf, NgIf, 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, 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 standalone: true,\n selector: 'tui-bar-set',\n imports: [NgIf, NgForOf, NgTemplateOutlet, TuiBar],\n templateUrl: './bar-set.template.html',\n styleUrls: ['./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","<ng-container *ngIf=\"size; else flexible\">\n <ng-container\n *ngFor=\"let item of computedValue; let index = index\"\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: false}\"\n />\n</ng-container>\n<ng-template #flexible>\n <div\n *ngFor=\"let item of computedValue; let index = index\"\n class=\"t-wrapper\"\n >\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: true}\"\n />\n </div>\n</ng-template>\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-0' + index + ')'\"\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,CAAC;AACpB,MAAM,WAAW,GAAsB,EAAE,CAAC;AAC1C,MAAM,YAAY,GAAsB,CAAC,CAAC,CAAC,CAAC;AAE5C,MAQa,SAAS,CAAA;AARtB,IAAA,WAAA,GAAA;QAUW,IAAK,CAAA,KAAA,GAAsB,EAAE,CAAC;QAG9B,IAAI,CAAA,IAAA,GAA+B,GAAG,CAAC;QAGvC,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;AAwB5B,KAAA;AAtBG,IAAA,IAAc,aAAa,GAAA;AACvB,QAAA,OAAO,IAAI,CAAC,SAAS,GAAG,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC;KACrD;AAED,IAAA,IAAc,gBAAgB,GAAA;AAC1B,QAAA,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;KACpD;AAED,IAAA,IAAc,YAAY,GAAA;AACtB,QAAA,OAAO,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC;KAC3B;AAES,IAAA,SAAS,CAAC,KAAa,EAAA;AAC7B,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;KAC5E;AAGO,IAAA,UAAU,CAAC,KAAwB,EAAA;AACvC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;cACzB,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AAC5C,cAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC9D;+GA/BQ,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,OAAA,EAAA,IAAA,EAAA,MAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EClBtB,moCAsCA,EDzBc,MAAA,EAAA,CAAA,
|
|
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 {NgForOf, NgIf, 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, 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 standalone: true,\n selector: 'tui-bar-set',\n imports: [NgIf, NgForOf, NgTemplateOutlet, TuiBar],\n templateUrl: './bar-set.template.html',\n styleUrls: ['./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","<ng-container *ngIf=\"size; else flexible\">\n <ng-container\n *ngFor=\"let item of computedValue; let index = index\"\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: false}\"\n />\n</ng-container>\n<ng-template #flexible>\n <div\n *ngFor=\"let item of computedValue; let index = index\"\n class=\"t-wrapper\"\n >\n <ng-container\n [ngTemplateOutlet]=\"bar\"\n [ngTemplateOutletContext]=\"{$implicit: item, index: index, flexible: true}\"\n />\n </div>\n</ng-template>\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-0' + index + ')'\"\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,CAAC;AACpB,MAAM,WAAW,GAA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AAA,EAAA,CAAA,2hBAAA,CAAA,EAAA,CAAA;8BAIxC,KAAK,EAAA,CAAA;sBADX,KAAK;gBAIC,IAAI,EAAA,CAAA;sBADV,KAAK;gBAIC,SAAS,EAAA,CAAA;sBADf,KAAK;gBAoBE,UAAU,EAAA,EAAA,EAAA,EAAA,CAAA;;AE7CtB;;AAEG;;;;"}
|
|
@@ -17,7 +17,7 @@ class TuiBar {
|
|
|
17
17
|
return tuiSum(...value);
|
|
18
18
|
}
|
|
19
19
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiBar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
20
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiBar, isStandalone: true, selector: "tui-bar", inputs: { value: "value", size: "size" }, host: { properties: { "attr.data-size": "size" } }, ngImport: i0, template: "<div\n *ngFor=\"let item of value; let index = index\"\n automation-id=\"tui-bar__bar\"\n [style.background]=\"'var(--tui-chart-categorical-0' + index + ')'\"\n [style.height.%]=\"getHeight(item)\"\n></div>\n", styles: [":host{display:flex;min-
|
|
20
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiBar, isStandalone: true, selector: "tui-bar", inputs: { value: "value", size: "size" }, host: { properties: { "attr.data-size": "size" } }, ngImport: i0, template: "<div\n *ngFor=\"let item of value; let index = index\"\n automation-id=\"tui-bar__bar\"\n [style.background]=\"'var(--tui-chart-categorical-0' + index + ')'\"\n [style.height.%]=\"getHeight(item)\"\n></div>\n", styles: [":host{display:flex;min-inline-size:.125rem;flex-direction:column-reverse;border-start-start-radius:var(--tui-radius-l);border-start-end-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"], dependencies: [{ kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
21
21
|
}
|
|
22
22
|
__decorate([
|
|
23
23
|
tuiPure
|
|
@@ -26,7 +26,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
26
26
|
type: Component,
|
|
27
27
|
args: [{ standalone: true, selector: 'tui-bar', imports: [NgForOf], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
28
28
|
'[attr.data-size]': 'size',
|
|
29
|
-
}, template: "<div\n *ngFor=\"let item of value; let index = index\"\n automation-id=\"tui-bar__bar\"\n [style.background]=\"'var(--tui-chart-categorical-0' + index + ')'\"\n [style.height.%]=\"getHeight(item)\"\n></div>\n", styles: [":host{display:flex;min-
|
|
29
|
+
}, template: "<div\n *ngFor=\"let item of value; let index = index\"\n automation-id=\"tui-bar__bar\"\n [style.background]=\"'var(--tui-chart-categorical-0' + index + ')'\"\n [style.height.%]=\"getHeight(item)\"\n></div>\n", styles: [":host{display:flex;min-inline-size:.125rem;flex-direction:column-reverse;border-start-start-radius:var(--tui-radius-l);border-start-end-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"] }]
|
|
30
30
|
}], propDecorators: { value: [{
|
|
31
31
|
type: Input
|
|
32
32
|
}], 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 {NgForOf} from '@angular/common';\nimport {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, TuiSizeS} from '@taiga-ui/core/types';\n\n@Component({\n standalone: true,\n selector: 'tui-bar',\n imports: [NgForOf],\n templateUrl: './bar.template.html',\n styleUrls: ['./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","<div\n *ngFor=\"let item of value; let index = index\"\n automation-id=\"tui-bar__bar\"\n [style.background]=\"'var(--tui-chart-categorical-0' + index + ')'\"\n [style.height.%]=\"getHeight(item)\"\n></div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMA,MAWa,MAAM,CAAA;AAXnB,IAAA,WAAA,GAAA;QAaW,IAAK,CAAA,KAAA,GAAsB,EAAE,CAAC;QAG9B,IAAI,CAAA,IAAA,GAAwB,GAAG,CAAC;AAU1C,KAAA;AARa,IAAA,SAAS,CAAC,KAAa,EAAA;AAC7B,QAAA,OAAO,CAAC,GAAG,GAAG,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAClD;AAGO,IAAA,MAAM,CAAC,KAAwB,EAAA;AACnC,QAAA,OAAO,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;KAC3B;+GAdQ,MAAM,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAAN,MAAM,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,OAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECjBnB,8NAMA,EAAA,MAAA,EAAA,CAAA
|
|
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 {NgForOf} from '@angular/common';\nimport {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, TuiSizeS} from '@taiga-ui/core/types';\n\n@Component({\n standalone: true,\n selector: 'tui-bar',\n imports: [NgForOf],\n templateUrl: './bar.template.html',\n styleUrls: ['./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","<div\n *ngFor=\"let item of value; let index = index\"\n automation-id=\"tui-bar__bar\"\n [style.background]=\"'var(--tui-chart-categorical-0' + index + ')'\"\n [style.height.%]=\"getHeight(item)\"\n></div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMA,MAWa,MAAM,CAAA;AAXnB,IAAA,WAAA,GA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