@taiga-ui/addon-charts 2.61.0 → 3.0.0-rc.2
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/bundles/taiga-ui-addon-charts-components-arc-chart.umd.js +437 -319
- package/bundles/taiga-ui-addon-charts-components-arc-chart.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-components-axes.umd.js +461 -335
- package/bundles/taiga-ui-addon-charts-components-axes.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-components-bar-chart.umd.js +451 -342
- package/bundles/taiga-ui-addon-charts-components-bar-chart.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-components-bar-set.umd.js +401 -298
- package/bundles/taiga-ui-addon-charts-components-bar-set.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-components-bar.umd.js +396 -293
- package/bundles/taiga-ui-addon-charts-components-bar.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-components-legend-item.umd.js +408 -295
- package/bundles/taiga-ui-addon-charts-components-legend-item.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-components-line-chart.umd.js +572 -402
- package/bundles/taiga-ui-addon-charts-components-line-chart.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-components-line-days-chart.umd.js +544 -392
- package/bundles/taiga-ui-addon-charts-components-line-days-chart.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-components-pie-chart.umd.js +518 -393
- package/bundles/taiga-ui-addon-charts-components-pie-chart.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-components-ring-chart.umd.js +398 -302
- package/bundles/taiga-ui-addon-charts-components-ring-chart.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-components.umd.js +23 -43
- package/bundles/taiga-ui-addon-charts-components.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-constants.umd.js +17 -48
- package/bundles/taiga-ui-addon-charts-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-interfaces.umd.js +2 -2
- package/bundles/taiga-ui-addon-charts-interfaces.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-types.umd.js +2 -2
- package/bundles/taiga-ui-addon-charts-types.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts-utils.umd.js +350 -308
- package/bundles/taiga-ui-addon-charts-utils.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-charts.umd.js +18 -18
- package/bundles/taiga-ui-addon-charts.umd.js.map +1 -1
- package/components/arc-chart/arc-chart.component.d.ts +3 -0
- package/components/arc-chart/arc-chart.module.d.ts +6 -0
- package/components/arc-chart/package.json +2 -5
- package/components/arc-chart/taiga-ui-addon-charts-components-arc-chart.d.ts +1 -0
- package/components/axes/axes.component.d.ts +6 -3
- package/components/axes/axes.module.d.ts +7 -0
- package/components/axes/package.json +2 -5
- package/components/axes/taiga-ui-addon-charts-components-axes.d.ts +1 -0
- package/components/bar/bar.component.d.ts +4 -5
- package/components/bar/bar.module.d.ts +6 -0
- package/components/bar/package.json +2 -5
- package/components/bar/taiga-ui-addon-charts-components-bar.d.ts +1 -0
- package/components/bar-chart/bar-chart.component.d.ts +10 -10
- package/components/bar-chart/bar-chart.module.d.ts +9 -0
- package/components/bar-chart/package.json +2 -5
- package/components/bar-chart/taiga-ui-addon-charts-components-bar-chart.d.ts +1 -0
- package/components/bar-set/bar-set.component.d.ts +4 -5
- package/components/bar-set/bar-set.module.d.ts +7 -0
- package/components/bar-set/package.json +2 -5
- package/components/bar-set/taiga-ui-addon-charts-components-bar-set.d.ts +1 -0
- package/components/legend-item/legend-item.component.d.ts +3 -0
- package/components/legend-item/legend-item.module.d.ts +7 -0
- package/components/legend-item/package.json +2 -5
- package/components/legend-item/taiga-ui-addon-charts-components-legend-item.d.ts +1 -0
- package/components/line-chart/line-chart-hint.directive.d.ts +13 -3
- package/components/line-chart/line-chart.component.d.ts +10 -6
- package/components/line-chart/line-chart.module.d.ts +10 -0
- package/components/line-chart/package.json +2 -5
- package/components/line-chart/taiga-ui-addon-charts-components-line-chart.d.ts +1 -0
- package/components/line-days-chart/line-days-chart-hint.directive.d.ts +10 -3
- package/components/line-days-chart/line-days-chart.component.d.ts +7 -1
- package/components/line-days-chart/line-days-chart.module.d.ts +10 -0
- package/components/line-days-chart/package.json +2 -5
- package/components/line-days-chart/taiga-ui-addon-charts-components-line-days-chart.d.ts +1 -0
- package/components/package.json +2 -5
- package/components/pie-chart/package.json +2 -5
- package/components/pie-chart/pie-chart.component.d.ts +5 -6
- package/components/pie-chart/pie-chart.directive.d.ts +3 -0
- package/components/pie-chart/pie-chart.module.d.ts +10 -0
- package/components/pie-chart/taiga-ui-addon-charts-components-pie-chart.d.ts +1 -0
- package/components/ring-chart/package.json +2 -5
- package/components/ring-chart/ring-chart.component.d.ts +3 -8
- package/components/ring-chart/ring-chart.module.d.ts +8 -0
- package/components/ring-chart/taiga-ui-addon-charts-components-ring-chart.d.ts +1 -0
- package/components/taiga-ui-addon-charts-components.d.ts +1 -0
- package/constants/index.d.ts +0 -2
- package/constants/package.json +2 -5
- package/constants/taiga-ui-addon-charts-constants.d.ts +1 -0
- package/esm2015/components/arc-chart/arc-chart.component.js +57 -45
- package/esm2015/components/arc-chart/arc-chart.module.js +15 -12
- package/esm2015/components/arc-chart/index.js +1 -1
- package/esm2015/components/arc-chart/taiga-ui-addon-charts-components-arc-chart.js +1 -1
- package/esm2015/components/axes/axes.component.js +55 -38
- package/esm2015/components/axes/axes.module.js +15 -12
- package/esm2015/components/axes/index.js +1 -1
- package/esm2015/components/axes/taiga-ui-addon-charts-components-axes.js +1 -1
- package/esm2015/components/bar/bar.component.js +29 -35
- package/esm2015/components/bar/bar.module.js +15 -12
- package/esm2015/components/bar/index.js +1 -1
- package/esm2015/components/bar/taiga-ui-addon-charts-components-bar.js +1 -1
- package/esm2015/components/bar-chart/bar-chart.component.js +51 -56
- package/esm2015/components/bar-chart/bar-chart.module.js +28 -15
- package/esm2015/components/bar-chart/index.js +1 -1
- package/esm2015/components/bar-chart/taiga-ui-addon-charts-components-bar-chart.js +1 -1
- package/esm2015/components/bar-set/bar-set.component.js +27 -33
- package/esm2015/components/bar-set/bar-set.module.js +15 -12
- package/esm2015/components/bar-set/index.js +1 -1
- package/esm2015/components/bar-set/taiga-ui-addon-charts-components-bar-set.js +1 -1
- package/esm2015/components/index.js +1 -1
- package/esm2015/components/legend-item/index.js +1 -1
- package/esm2015/components/legend-item/legend-item.component.js +36 -30
- package/esm2015/components/legend-item/legend-item.module.js +15 -12
- package/esm2015/components/legend-item/taiga-ui-addon-charts-components-legend-item.js +1 -1
- package/esm2015/components/line-chart/index.js +1 -1
- package/esm2015/components/line-chart/line-chart-hint.directive.js +54 -39
- package/esm2015/components/line-chart/line-chart.component.js +81 -54
- package/esm2015/components/line-chart/line-chart.module.js +28 -13
- package/esm2015/components/line-chart/taiga-ui-addon-charts-components-line-chart.js +1 -1
- package/esm2015/components/line-days-chart/index.js +1 -1
- package/esm2015/components/line-days-chart/line-days-chart-hint.directive.js +46 -35
- package/esm2015/components/line-days-chart/line-days-chart.component.js +72 -48
- package/esm2015/components/line-days-chart/line-days-chart.module.js +29 -12
- package/esm2015/components/line-days-chart/taiga-ui-addon-charts-components-line-days-chart.js +1 -1
- package/esm2015/components/pie-chart/index.js +1 -1
- package/esm2015/components/pie-chart/pie-chart.component.js +50 -50
- package/esm2015/components/pie-chart/pie-chart.directive.js +40 -32
- package/esm2015/components/pie-chart/pie-chart.module.js +28 -15
- package/esm2015/components/pie-chart/taiga-ui-addon-charts-components-pie-chart.js +1 -1
- package/esm2015/components/ring-chart/index.js +1 -1
- package/esm2015/components/ring-chart/ring-chart.component.js +27 -38
- package/esm2015/components/ring-chart/ring-chart.module.js +15 -12
- package/esm2015/components/ring-chart/taiga-ui-addon-charts-components-ring-chart.js +1 -1
- package/esm2015/components/taiga-ui-addon-charts-components.js +1 -1
- package/esm2015/constants/index.js +1 -3
- package/esm2015/constants/line-handlers.js +1 -1
- package/esm2015/constants/taiga-ui-addon-charts-constants.js +1 -1
- package/esm2015/index.js +3 -2
- package/esm2015/interfaces/index.js +2 -1
- package/esm2015/interfaces/line-chart-hint-context.js +2 -1
- package/esm2015/interfaces/taiga-ui-addon-charts-interfaces.js +2 -1
- package/esm2015/taiga-ui-addon-charts.js +1 -1
- package/esm2015/types/index.js +3 -1
- package/esm2015/types/line-handler.js +2 -1
- package/esm2015/types/line-type.js +2 -1
- package/esm2015/types/taiga-ui-addon-charts-types.js +2 -1
- package/esm2015/utils/control-point.js +6 -11
- package/esm2015/utils/describe-sector.js +6 -9
- package/esm2015/utils/draw-curve.js +5 -10
- package/esm2015/utils/draw-line.js +2 -7
- package/esm2015/utils/draw.js +6 -11
- package/esm2015/utils/index.js +1 -1
- package/esm2015/utils/line-angle.js +2 -7
- package/esm2015/utils/line-length.js +2 -7
- package/esm2015/utils/taiga-ui-addon-charts-utils.js +1 -1
- package/fesm2015/taiga-ui-addon-charts-components-arc-chart.js +68 -51
- package/fesm2015/taiga-ui-addon-charts-components-arc-chart.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-components-axes.js +68 -46
- package/fesm2015/taiga-ui-addon-charts-components-axes.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-components-bar-chart.js +77 -68
- package/fesm2015/taiga-ui-addon-charts-components-bar-chart.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-components-bar-set.js +40 -41
- package/fesm2015/taiga-ui-addon-charts-components-bar-set.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-components-bar.js +41 -42
- package/fesm2015/taiga-ui-addon-charts-components-bar.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-components-legend-item.js +50 -38
- package/fesm2015/taiga-ui-addon-charts-components-legend-item.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-components-line-chart.js +154 -97
- package/fesm2015/taiga-ui-addon-charts-components-line-chart.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-components-line-days-chart.js +137 -86
- package/fesm2015/taiga-ui-addon-charts-components-line-days-chart.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-components-pie-chart.js +131 -109
- package/fesm2015/taiga-ui-addon-charts-components-pie-chart.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-components-ring-chart.js +41 -47
- package/fesm2015/taiga-ui-addon-charts-components-ring-chart.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-components.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-constants.js +1 -34
- package/fesm2015/taiga-ui-addon-charts-constants.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-interfaces.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-types.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts-utils.js +18 -51
- package/fesm2015/taiga-ui-addon-charts-utils.js.map +1 -1
- package/fesm2015/taiga-ui-addon-charts.js +2 -1
- package/fesm2015/taiga-ui-addon-charts.js.map +1 -1
- package/index.d.ts +0 -1
- package/interfaces/index.d.ts +0 -1
- package/interfaces/package.json +2 -5
- package/interfaces/taiga-ui-addon-charts-interfaces.d.ts +1 -0
- package/package.json +11 -14
- package/taiga-ui-addon-charts.d.ts +1 -0
- package/types/index.d.ts +0 -1
- package/types/line-handler.d.ts +2 -2
- package/types/line-type.d.ts +1 -1
- package/types/package.json +2 -5
- package/types/taiga-ui-addon-charts-types.d.ts +1 -0
- package/utils/control-point.d.ts +1 -5
- package/utils/describe-sector.d.ts +1 -3
- package/utils/draw-curve.d.ts +1 -5
- package/utils/draw-line.d.ts +1 -5
- package/utils/draw.d.ts +1 -5
- package/utils/line-angle.d.ts +1 -5
- package/utils/line-length.d.ts +1 -5
- package/utils/package.json +2 -5
- package/utils/taiga-ui-addon-charts-utils.d.ts +1 -0
- package/bundles/taiga-ui-addon-charts-components-arc-chart.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-components-arc-chart.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-components-axes.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-components-axes.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-components-bar-chart.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-components-bar-chart.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-components-bar-set.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-components-bar-set.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-components-bar.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-components-bar.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-components-legend-item.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-components-legend-item.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-components-line-chart.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-components-line-chart.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-components-line-days-chart.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-components-line-days-chart.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-components-pie-chart.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-components-pie-chart.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-components-ring-chart.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-components-ring-chart.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-components.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-components.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-constants.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-constants.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-enums.umd.js +0 -23
- package/bundles/taiga-ui-addon-charts-enums.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-enums.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-enums.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-interfaces.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-interfaces.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-types.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-types.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts-utils.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts-utils.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-charts.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-charts.umd.min.js.map +0 -1
- package/components/arc-chart/taiga-ui-addon-charts-components-arc-chart.metadata.json +0 -1
- package/components/axes/taiga-ui-addon-charts-components-axes.metadata.json +0 -1
- package/components/bar/taiga-ui-addon-charts-components-bar.metadata.json +0 -1
- package/components/bar-chart/taiga-ui-addon-charts-components-bar-chart.metadata.json +0 -1
- package/components/bar-set/taiga-ui-addon-charts-components-bar-set.metadata.json +0 -1
- package/components/legend-item/taiga-ui-addon-charts-components-legend-item.metadata.json +0 -1
- package/components/line-chart/taiga-ui-addon-charts-components-line-chart.metadata.json +0 -1
- package/components/line-days-chart/taiga-ui-addon-charts-components-line-days-chart.metadata.json +0 -1
- package/components/pie-chart/taiga-ui-addon-charts-components-pie-chart.metadata.json +0 -1
- package/components/ring-chart/taiga-ui-addon-charts-components-ring-chart.metadata.json +0 -1
- package/components/taiga-ui-addon-charts-components.metadata.json +0 -1
- package/constants/default-color-handler.d.ts +0 -3
- package/constants/default-colors.d.ts +0 -3
- package/constants/taiga-ui-addon-charts-constants.metadata.json +0 -1
- package/enums/index.d.ts +0 -1
- package/enums/line-type.d.ts +0 -11
- package/enums/package.json +0 -13
- package/enums/taiga-ui-addon-charts-enums.d.ts +0 -4
- package/enums/taiga-ui-addon-charts-enums.metadata.json +0 -1
- package/esm2015/constants/default-color-handler.js +0 -4
- package/esm2015/constants/default-colors.js +0 -30
- package/esm2015/enums/index.js +0 -2
- package/esm2015/enums/line-type.js +0 -13
- package/esm2015/enums/taiga-ui-addon-charts-enums.js +0 -5
- package/esm2015/interfaces/ring-chart-context.js +0 -1
- package/esm2015/types/color-handler.js +0 -1
- package/esm5/components/arc-chart/arc-chart.component.js +0 -149
- package/esm5/components/arc-chart/arc-chart.module.js +0 -18
- package/esm5/components/arc-chart/index.js +0 -3
- package/esm5/components/arc-chart/taiga-ui-addon-charts-components-arc-chart.js +0 -5
- package/esm5/components/axes/axes.component.js +0 -131
- package/esm5/components/axes/axes.module.js +0 -19
- package/esm5/components/axes/index.js +0 -3
- package/esm5/components/axes/taiga-ui-addon-charts-components-axes.js +0 -5
- package/esm5/components/bar/bar.component.js +0 -55
- package/esm5/components/bar/bar.module.js +0 -18
- package/esm5/components/bar/index.js +0 -3
- package/esm5/components/bar/taiga-ui-addon-charts-components-bar.js +0 -5
- package/esm5/components/bar-chart/bar-chart.component.js +0 -118
- package/esm5/components/bar-chart/bar-chart.module.js +0 -30
- package/esm5/components/bar-chart/index.js +0 -3
- package/esm5/components/bar-chart/taiga-ui-addon-charts-components-bar-chart.js +0 -5
- package/esm5/components/bar-set/bar-set.component.js +0 -83
- package/esm5/components/bar-set/bar-set.module.js +0 -19
- package/esm5/components/bar-set/index.js +0 -3
- package/esm5/components/bar-set/taiga-ui-addon-charts-components-bar-set.js +0 -5
- package/esm5/components/index.js +0 -11
- package/esm5/components/legend-item/index.js +0 -3
- package/esm5/components/legend-item/legend-item.component.js +0 -59
- package/esm5/components/legend-item/legend-item.module.js +0 -19
- package/esm5/components/legend-item/taiga-ui-addon-charts-components-legend-item.js +0 -5
- package/esm5/components/line-chart/index.js +0 -4
- package/esm5/components/line-chart/line-chart-hint.directive.js +0 -78
- package/esm5/components/line-chart/line-chart.component.js +0 -246
- package/esm5/components/line-chart/line-chart.module.js +0 -29
- package/esm5/components/line-chart/taiga-ui-addon-charts-components-line-chart.js +0 -5
- package/esm5/components/line-days-chart/index.js +0 -4
- package/esm5/components/line-days-chart/line-days-chart-hint.directive.js +0 -83
- package/esm5/components/line-days-chart/line-days-chart.component.js +0 -204
- package/esm5/components/line-days-chart/line-days-chart.module.js +0 -21
- package/esm5/components/line-days-chart/taiga-ui-addon-charts-components-line-days-chart.js +0 -5
- package/esm5/components/pie-chart/index.js +0 -4
- package/esm5/components/pie-chart/pie-chart.component.js +0 -168
- package/esm5/components/pie-chart/pie-chart.directive.js +0 -66
- package/esm5/components/pie-chart/pie-chart.module.js +0 -28
- package/esm5/components/pie-chart/taiga-ui-addon-charts-components-pie-chart.js +0 -5
- package/esm5/components/ring-chart/index.js +0 -3
- package/esm5/components/ring-chart/ring-chart.component.js +0 -67
- package/esm5/components/ring-chart/ring-chart.module.js +0 -20
- package/esm5/components/ring-chart/taiga-ui-addon-charts-components-ring-chart.js +0 -5
- package/esm5/components/taiga-ui-addon-charts-components.js +0 -5
- package/esm5/constants/default-color-handler.js +0 -4
- package/esm5/constants/default-colors.js +0 -30
- package/esm5/constants/index.js +0 -4
- package/esm5/constants/line-handlers.js +0 -5
- package/esm5/constants/taiga-ui-addon-charts-constants.js +0 -5
- package/esm5/enums/index.js +0 -2
- package/esm5/enums/line-type.js +0 -13
- package/esm5/enums/taiga-ui-addon-charts-enums.js +0 -5
- package/esm5/index.js +0 -4
- package/esm5/interfaces/index.js +0 -1
- package/esm5/interfaces/line-chart-hint-context.js +0 -1
- package/esm5/interfaces/ring-chart-context.js +0 -1
- package/esm5/interfaces/taiga-ui-addon-charts-interfaces.js +0 -4
- package/esm5/taiga-ui-addon-charts.js +0 -5
- package/esm5/types/color-handler.js +0 -1
- package/esm5/types/index.js +0 -1
- package/esm5/types/line-handler.js +0 -1
- package/esm5/types/line-type.js +0 -1
- package/esm5/types/taiga-ui-addon-charts-types.js +0 -4
- package/esm5/utils/control-point.js +0 -19
- package/esm5/utils/describe-sector.js +0 -36
- package/esm5/utils/draw-curve.js +0 -13
- package/esm5/utils/draw-line.js +0 -9
- package/esm5/utils/draw.js +0 -14
- package/esm5/utils/index.js +0 -8
- package/esm5/utils/line-angle.js +0 -11
- package/esm5/utils/line-length.js +0 -11
- package/esm5/utils/taiga-ui-addon-charts-utils.js +0 -5
- package/fesm2015/taiga-ui-addon-charts-enums.js +0 -19
- package/fesm2015/taiga-ui-addon-charts-enums.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-components-arc-chart.js +0 -168
- package/fesm5/taiga-ui-addon-charts-components-arc-chart.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-components-axes.js +0 -151
- package/fesm5/taiga-ui-addon-charts-components-axes.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-components-bar-chart.js +0 -149
- package/fesm5/taiga-ui-addon-charts-components-bar-chart.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-components-bar-set.js +0 -104
- package/fesm5/taiga-ui-addon-charts-components-bar-set.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-components-bar.js +0 -75
- package/fesm5/taiga-ui-addon-charts-components-bar.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-components-legend-item.js +0 -79
- package/fesm5/taiga-ui-addon-charts-components-legend-item.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-components-line-chart.js +0 -343
- package/fesm5/taiga-ui-addon-charts-components-line-chart.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-components-line-days-chart.js +0 -302
- package/fesm5/taiga-ui-addon-charts-components-line-days-chart.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-components-pie-chart.js +0 -255
- package/fesm5/taiga-ui-addon-charts-components-pie-chart.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-components-ring-chart.js +0 -89
- package/fesm5/taiga-ui-addon-charts-components-ring-chart.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-components.js +0 -15
- package/fesm5/taiga-ui-addon-charts-components.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-constants.js +0 -44
- package/fesm5/taiga-ui-addon-charts-constants.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-enums.js +0 -19
- package/fesm5/taiga-ui-addon-charts-enums.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-interfaces.js +0 -4
- package/fesm5/taiga-ui-addon-charts-interfaces.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-types.js +0 -4
- package/fesm5/taiga-ui-addon-charts-types.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts-utils.js +0 -115
- package/fesm5/taiga-ui-addon-charts-utils.js.map +0 -1
- package/fesm5/taiga-ui-addon-charts.js +0 -8
- package/fesm5/taiga-ui-addon-charts.js.map +0 -1
- package/interfaces/ring-chart-context.d.ts +0 -4
- package/interfaces/taiga-ui-addon-charts-interfaces.metadata.json +0 -1
- package/taiga-ui-addon-charts.metadata.json +0 -1
- package/types/color-handler.d.ts +0 -3
- package/types/taiga-ui-addon-charts-types.metadata.json +0 -1
- package/utils/taiga-ui-addon-charts-utils.metadata.json +0 -1
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { __decorate
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Component, ChangeDetectionStrategy, Optional, Inject, ViewChildren, Input, NgModule } from '@angular/core';
|
|
4
|
+
import * as i4 from '@taiga-ui/cdk';
|
|
5
|
+
import { EMPTY_QUERY, tuiSum, TuiIdService, tuiDefaultProp, tuiPure, TuiFocusableModule, TuiMapperPipeModule } from '@taiga-ui/cdk';
|
|
6
|
+
import * as i3 from '@taiga-ui/core';
|
|
7
|
+
import { TuiHintControllerDirective, TuiDriver, TUI_HINT_CONTROLLER_OPTIONS, TuiDescribedByModule, TuiHintModule } from '@taiga-ui/core';
|
|
8
|
+
import * as i1 from '@taiga-ui/addon-charts/components/bar-set';
|
|
6
9
|
import { TuiBarSetModule } from '@taiga-ui/addon-charts/components/bar-set';
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
10
|
+
import * as i2 from '@angular/common';
|
|
11
|
+
import { CommonModule } from '@angular/common';
|
|
9
12
|
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
13
|
function valueAssertion(value) {
|
|
12
14
|
const valid = value.every(array => array.length === value[0].length);
|
|
13
15
|
return valid;
|
|
14
16
|
}
|
|
15
17
|
const VALUE_ERROR = `All arrays must be of the same length`;
|
|
16
|
-
|
|
17
|
-
constructor(idService) {
|
|
18
|
+
class TuiBarChartComponent {
|
|
19
|
+
constructor(hintController, idService) {
|
|
20
|
+
this.hintController = hintController;
|
|
21
|
+
this.drivers = EMPTY_QUERY;
|
|
18
22
|
this.value = [];
|
|
19
23
|
this.max = NaN;
|
|
20
|
-
this.colorHandler = TUI_DEFAULT_COLOR_HANDLER;
|
|
21
24
|
this.size = `m`;
|
|
22
25
|
this.collapsed = false;
|
|
23
|
-
this.
|
|
24
|
-
this.hintMode = null;
|
|
25
|
-
this.percentMapper = (set, collapsed, max) => (100 * (collapsed ? sum(...set) : Math.max(...set))) / max;
|
|
26
|
+
this.percentMapper = (set, collapsed, max) => (100 * (collapsed ? tuiSum(...set) : Math.max(...set))) / max;
|
|
26
27
|
this.autoIdString = idService.generate();
|
|
27
28
|
}
|
|
28
|
-
get
|
|
29
|
-
|
|
29
|
+
get hintContent() {
|
|
30
|
+
var _a;
|
|
31
|
+
return ((_a = this.hintController) === null || _a === void 0 ? void 0 : _a.content) || ``;
|
|
30
32
|
}
|
|
31
33
|
get transposed() {
|
|
32
34
|
return this.transpose(this.value);
|
|
@@ -34,14 +36,6 @@ let TuiBarChartComponent = class TuiBarChartComponent {
|
|
|
34
36
|
get computedMax() {
|
|
35
37
|
return this.max || this.getMax(this.value, this.collapsed);
|
|
36
38
|
}
|
|
37
|
-
getContentContext(index) {
|
|
38
|
-
return {
|
|
39
|
-
$implicit: index,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
getHint(hint) {
|
|
43
|
-
return this.hasHint ? hint : ``;
|
|
44
|
-
}
|
|
45
39
|
getHintId(index) {
|
|
46
40
|
return `${this.autoIdString}_${index}`;
|
|
47
41
|
}
|
|
@@ -53,78 +47,93 @@ let TuiBarChartComponent = class TuiBarChartComponent {
|
|
|
53
47
|
? Math.max(...values.reduce((result, next) => result.map((value, index) => value + next[index])))
|
|
54
48
|
: values.reduce((max, value) => Math.max(...value, max), 0);
|
|
55
49
|
}
|
|
56
|
-
}
|
|
57
|
-
TuiBarChartComponent
|
|
58
|
-
{ type:
|
|
59
|
-
];
|
|
50
|
+
}
|
|
51
|
+
TuiBarChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarChartComponent, deps: [{ token: TuiHintControllerDirective, optional: true }, { token: TuiIdService }], target: i0.ɵɵFactoryTarget.Component });
|
|
52
|
+
TuiBarChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiBarChartComponent, selector: "tui-bar-chart", inputs: { value: "value", max: "max", size: "size", collapsed: "collapsed" }, viewQueries: [{ propertyName: "drivers", predicate: TuiDriver, descendants: true }], ngImport: i0, template: "<div\n *ngFor=\"let set of transposed; let index = index\"\n tuiHintDirection=\"top\"\n class=\"t-wrapper\"\n [class.t-wrapper_hoverable]=\"!!hintContent\"\n [class.t-wrapper_hovered]=\"drivers.get(index) | async\"\n [tuiHintHost]=\"hintHost\"\n [tuiHintId]=\"getHintId(index)\"\n [tuiHint]=\"hintContent\"\n [tuiHintContext]=\"{$implicit: index}\"\n (mouseenter.once)=\"(0)\"\n>\n <div\n class=\"t-container\"\n [style.height.%]=\"set | tuiMapper: percentMapper:collapsed:computedMax\"\n >\n <div\n #hintHost\n class=\"t-host\"\n ></div>\n <tui-bar-set\n class=\"t-set\"\n [tuiDescribedBy]=\"getHintId(index)\"\n [tuiFocusable]=\"!!hintContent\"\n [value]=\"set\"\n [size]=\"size\"\n [collapsed]=\"collapsed\"\n ></tui-bar-set>\n </div>\n</div>\n", styles: [":host{display:flex;flex:1;height:100%}.t-wrapper{transition-property:background-color;transition-duration:.3s;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;height:100%}.t-wrapper_hoverable{cursor:pointer}.t-wrapper_hoverable:hover,.t-wrapper_hoverable.t-wrapper_hovered{background-color:rgba(0,0,0,.05)}.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-focus)}\n"], components: [{ type: i1.TuiBarSetComponent, selector: "tui-bar-set", inputs: ["value", "size", "collapsed"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.TuiHintDirective, selector: "[tuiHint]:not(ng-container)", inputs: ["tuiHintId", "tuiHint", "tuiHintContext", "tuiHintAppearance"] }, { type: i3.TuiHintDriverDirective, selector: "[tuiHint]" }, { type: i3.TuiHintHoverDirective, selector: "[tuiHint]:not(ng-container)", inputs: ["tuiHintShowDelay", "tuiHintHideDelay"] }, { type: i3.TuiHintPositionDirective, selector: "[tuiHint]:not([tuiHintCustomPosition])", inputs: ["tuiHintDirection"] }, { type: i3.TuiHintHostDirective, selector: "[tuiHint][tuiHintHost]", inputs: ["tuiHintHost"] }, { type: i3.TuiDescribedByDirective, selector: "[tuiDescribedBy]:not(ng-container)", inputs: ["tuiDescribedBy"] }, { type: i4.TuiFocusableDirective, selector: "[tuiFocusable]", inputs: ["tuiFocusable"] }], pipes: { "async": i2.AsyncPipe, "tuiMapper": i4.TuiMapperPipe }, viewProviders: [TUI_HINT_CONTROLLER_OPTIONS], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
60
53
|
__decorate([
|
|
61
|
-
Input(),
|
|
62
54
|
tuiDefaultProp(valueAssertion, VALUE_ERROR)
|
|
63
55
|
], TuiBarChartComponent.prototype, "value", void 0);
|
|
64
56
|
__decorate([
|
|
65
|
-
Input(),
|
|
66
57
|
tuiDefaultProp()
|
|
67
58
|
], TuiBarChartComponent.prototype, "max", void 0);
|
|
68
59
|
__decorate([
|
|
69
|
-
Input(),
|
|
70
|
-
tuiDefaultProp()
|
|
71
|
-
], TuiBarChartComponent.prototype, "colorHandler", void 0);
|
|
72
|
-
__decorate([
|
|
73
|
-
Input(),
|
|
74
60
|
tuiDefaultProp()
|
|
75
61
|
], TuiBarChartComponent.prototype, "size", void 0);
|
|
76
62
|
__decorate([
|
|
77
|
-
Input(),
|
|
78
63
|
tuiDefaultProp()
|
|
79
64
|
], TuiBarChartComponent.prototype, "collapsed", void 0);
|
|
80
|
-
__decorate([
|
|
81
|
-
Input(),
|
|
82
|
-
tuiDefaultProp()
|
|
83
|
-
], TuiBarChartComponent.prototype, "hintContent", void 0);
|
|
84
|
-
__decorate([
|
|
85
|
-
Input(),
|
|
86
|
-
tuiDefaultProp()
|
|
87
|
-
], TuiBarChartComponent.prototype, "hintMode", void 0);
|
|
88
|
-
__decorate([
|
|
89
|
-
tuiPure
|
|
90
|
-
], TuiBarChartComponent.prototype, "getContentContext", null);
|
|
91
65
|
__decorate([
|
|
92
66
|
tuiPure
|
|
93
67
|
], TuiBarChartComponent.prototype, "transpose", null);
|
|
94
68
|
__decorate([
|
|
95
69
|
tuiPure
|
|
96
70
|
], TuiBarChartComponent.prototype, "getMax", null);
|
|
97
|
-
TuiBarChartComponent
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
]
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarChartComponent, decorators: [{
|
|
72
|
+
type: Component,
|
|
73
|
+
args: [{
|
|
74
|
+
selector: `tui-bar-chart`,
|
|
75
|
+
templateUrl: `./bar-chart.template.html`,
|
|
76
|
+
styleUrls: [`./bar-chart.style.less`],
|
|
77
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
78
|
+
viewProviders: [TUI_HINT_CONTROLLER_OPTIONS],
|
|
79
|
+
}]
|
|
80
|
+
}], ctorParameters: function () { return [{ type: i3.TuiHintControllerDirective, decorators: [{
|
|
81
|
+
type: Optional
|
|
82
|
+
}, {
|
|
83
|
+
type: Inject,
|
|
84
|
+
args: [TuiHintControllerDirective]
|
|
85
|
+
}] }, { type: i4.TuiIdService, decorators: [{
|
|
86
|
+
type: Inject,
|
|
87
|
+
args: [TuiIdService]
|
|
88
|
+
}] }]; }, propDecorators: { drivers: [{
|
|
89
|
+
type: ViewChildren,
|
|
90
|
+
args: [TuiDriver]
|
|
91
|
+
}], value: [{
|
|
92
|
+
type: Input
|
|
93
|
+
}], max: [{
|
|
94
|
+
type: Input
|
|
95
|
+
}], size: [{
|
|
96
|
+
type: Input
|
|
97
|
+
}], collapsed: [{
|
|
98
|
+
type: Input
|
|
99
|
+
}], transpose: [], getMax: [] } });
|
|
106
100
|
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
TuiBarChartModule =
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
class TuiBarChartModule {
|
|
102
|
+
}
|
|
103
|
+
TuiBarChartModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarChartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
104
|
+
TuiBarChartModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarChartModule, declarations: [TuiBarChartComponent], imports: [CommonModule,
|
|
105
|
+
TuiDescribedByModule,
|
|
106
|
+
TuiBarSetModule,
|
|
107
|
+
TuiFocusableModule,
|
|
108
|
+
TuiHintModule,
|
|
109
|
+
TuiMapperPipeModule], exports: [TuiBarChartComponent] });
|
|
110
|
+
TuiBarChartModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarChartModule, imports: [[
|
|
112
111
|
CommonModule,
|
|
113
|
-
PolymorpheusModule,
|
|
114
112
|
TuiDescribedByModule,
|
|
115
113
|
TuiBarSetModule,
|
|
116
114
|
TuiFocusableModule,
|
|
117
115
|
TuiHintModule,
|
|
118
116
|
TuiMapperPipeModule,
|
|
119
|
-
]
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
]] });
|
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarChartModule, decorators: [{
|
|
119
|
+
type: NgModule,
|
|
120
|
+
args: [{
|
|
121
|
+
imports: [
|
|
122
|
+
CommonModule,
|
|
123
|
+
TuiDescribedByModule,
|
|
124
|
+
TuiBarSetModule,
|
|
125
|
+
TuiFocusableModule,
|
|
126
|
+
TuiHintModule,
|
|
127
|
+
TuiMapperPipeModule,
|
|
128
|
+
],
|
|
129
|
+
declarations: [TuiBarChartComponent],
|
|
130
|
+
exports: [TuiBarChartComponent],
|
|
131
|
+
}]
|
|
132
|
+
}] });
|
|
124
133
|
|
|
125
134
|
/**
|
|
126
135
|
* Generated bundle index. Do not edit.
|
|
127
136
|
*/
|
|
128
137
|
|
|
129
|
-
export { TuiBarChartComponent, TuiBarChartModule
|
|
138
|
+
export { TuiBarChartComponent, TuiBarChartModule };
|
|
130
139
|
//# sourceMappingURL=taiga-ui-addon-charts-components-bar-chart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-charts-components-bar-chart.js","sources":["ng://@taiga-ui/addon-charts/components/bar-chart/bar-chart.component.ts","ng://@taiga-ui/addon-charts/components/bar-chart/bar-chart.module.ts","ng://@taiga-ui/addon-charts/components/bar-chart/taiga-ui-addon-charts-components-bar-chart.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core';\nimport {TUI_DEFAULT_COLOR_HANDLER} from '@taiga-ui/addon-charts/constants';\nimport {TuiColorHandler} from '@taiga-ui/addon-charts/types';\nimport {\n sum,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiIdService,\n TuiMapper,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {TuiHintModeT, TuiSizeL, TuiSizeS} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function valueAssertion(value: ReadonlyArray<readonly number[]>): boolean {\n const valid = value.every(array => array.length === value[0].length);\n\n return valid;\n}\n\nconst VALUE_ERROR = `All arrays must be of the same length`;\n\n@Component({\n selector: `tui-bar-chart`,\n templateUrl: `./bar-chart.template.html`,\n styleUrls: [`./bar-chart.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiBarChartComponent {\n private readonly autoIdString: string;\n\n @Input()\n @tuiDefaultProp(valueAssertion, VALUE_ERROR)\n value: ReadonlyArray<readonly number[]> = [];\n\n @Input()\n @tuiDefaultProp()\n max = NaN;\n\n @Input()\n @tuiDefaultProp()\n colorHandler: TuiColorHandler = TUI_DEFAULT_COLOR_HANDLER;\n\n @Input()\n @tuiDefaultProp()\n size: TuiSizeS | TuiSizeL | null = `m`;\n\n @Input()\n @tuiDefaultProp()\n collapsed = false;\n\n @Input()\n @tuiDefaultProp()\n hintContent: PolymorpheusContent<TuiContextWithImplicit<number>> = ``;\n\n @Input()\n @tuiDefaultProp()\n hintMode: TuiHintModeT | null = null;\n\n constructor(@Inject(TuiIdService) idService: TuiIdService) {\n this.autoIdString = idService.generate();\n }\n\n get hasHint(): boolean {\n return !!this.hintContent;\n }\n\n get transposed(): ReadonlyArray<readonly number[]> {\n return this.transpose(this.value);\n }\n\n get computedMax(): number {\n return this.max || this.getMax(this.value, this.collapsed);\n }\n\n @tuiPure\n getContentContext(index: number): TuiContextWithImplicit<number> {\n return {\n $implicit: index,\n };\n }\n\n readonly percentMapper: TuiMapper<readonly number[], number> = (\n set,\n collapsed: boolean,\n max: number,\n ) => (100 * (collapsed ? sum(...set) : Math.max(...set))) / max;\n\n getHint(hint: PolymorpheusContent): PolymorpheusContent {\n return this.hasHint ? hint : ``;\n }\n\n getHintId(index: number): string {\n return `${this.autoIdString}_${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]]),\n [],\n );\n }\n\n @tuiPure\n private getMax(values: ReadonlyArray<readonly number[]>, collapsed: boolean): number {\n return collapsed\n ? Math.max(\n ...values.reduce((result, next) =>\n result.map((value, index) => value + next[index]),\n ),\n )\n : values.reduce((max, value) => Math.max(...value, max), 0);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiBarSetModule} from '@taiga-ui/addon-charts/components/bar-set';\nimport {TuiFocusableModule, TuiMapperPipeModule} from '@taiga-ui/cdk';\nimport {TuiDescribedByModule, TuiHintModule} from '@taiga-ui/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiBarChartComponent} from './bar-chart.component';\n\n@NgModule({\n imports: [\n CommonModule,\n PolymorpheusModule,\n TuiDescribedByModule,\n TuiBarSetModule,\n TuiFocusableModule,\n TuiHintModule,\n TuiMapperPipeModule,\n ],\n declarations: [TuiBarChartComponent],\n exports: [TuiBarChartComponent],\n})\nexport class TuiBarChartModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAcA;SACgB,cAAc,CAAC,KAAuC;IAClE,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAErE,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,MAAM,WAAW,GAAG,uCAAuC,CAAC;IAQ/C,oBAAoB,GAAjC,MAAa,oBAAoB;IA+B7B,YAAkC,SAAuB;QA1BzD,UAAK,GAAqC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N,OAAO,EAAE;YACL,YAAY;YACZ,kBAAkB;YAClB,oBAAoB;YACpB,eAAe;YACf,kBAAkB;YAClB,aAAa;YACb,mBAAmB;SACtB;QACD,YAAY,EAAE,CAAC,oBAAoB,CAAC;QACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;KAClC,CAAC;GACW,iBAAiB,CAAG;;ACtBjC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-charts-components-bar-chart.js","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/bar-chart.module.ts","../../../projects/addon-charts/components/bar-chart/taiga-ui-addon-charts-components-bar-chart.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Inject,\n Input,\n Optional,\n QueryList,\n ViewChildren,\n} from '@angular/core';\nimport {\n EMPTY_QUERY,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiIdService,\n TuiMapper,\n tuiPure,\n tuiSum,\n} from '@taiga-ui/cdk';\nimport {\n TUI_HINT_CONTROLLER_OPTIONS,\n TuiDriver,\n TuiHintControllerDirective,\n TuiSizeL,\n TuiSizeS,\n} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\n\nfunction valueAssertion(value: ReadonlyArray<readonly number[]>): boolean {\n const valid = value.every(array => array.length === value[0].length);\n\n return valid;\n}\n\nconst VALUE_ERROR = `All arrays must be of the same length`;\n\n@Component({\n selector: `tui-bar-chart`,\n templateUrl: `./bar-chart.template.html`,\n styleUrls: [`./bar-chart.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [TUI_HINT_CONTROLLER_OPTIONS],\n})\nexport class TuiBarChartComponent {\n private readonly autoIdString: string;\n\n @ViewChildren(TuiDriver)\n readonly drivers: QueryList<Observable<boolean>> = EMPTY_QUERY;\n\n @Input()\n @tuiDefaultProp(valueAssertion, VALUE_ERROR)\n value: ReadonlyArray<readonly number[]> = [];\n\n @Input()\n @tuiDefaultProp()\n max = NaN;\n\n @Input()\n @tuiDefaultProp()\n size: TuiSizeS | TuiSizeL | null = `m`;\n\n @Input()\n @tuiDefaultProp()\n collapsed = false;\n\n constructor(\n @Optional()\n @Inject(TuiHintControllerDirective)\n private readonly hintController: TuiHintControllerDirective | null,\n @Inject(TuiIdService) idService: TuiIdService,\n ) {\n this.autoIdString = idService.generate();\n }\n\n get hintContent(): PolymorpheusContent<TuiContextWithImplicit<number>> {\n return this.hintController?.content || ``;\n }\n\n get transposed(): ReadonlyArray<readonly number[]> {\n return this.transpose(this.value);\n }\n\n get computedMax(): number {\n return this.max || this.getMax(this.value, this.collapsed);\n }\n\n readonly percentMapper: TuiMapper<readonly number[], number> = (\n set,\n collapsed: boolean,\n max: number,\n ) => (100 * (collapsed ? tuiSum(...set) : Math.max(...set))) / max;\n\n getHintId(index: number): string {\n return `${this.autoIdString}_${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]]),\n [],\n );\n }\n\n @tuiPure\n private getMax(values: ReadonlyArray<readonly number[]>, collapsed: boolean): number {\n return collapsed\n ? Math.max(\n ...values.reduce((result, next) =>\n result.map((value, index) => value + next[index]),\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 tuiHintDirection=\"top\"\n class=\"t-wrapper\"\n [class.t-wrapper_hoverable]=\"!!hintContent\"\n [class.t-wrapper_hovered]=\"drivers.get(index) | async\"\n [tuiHintHost]=\"hintHost\"\n [tuiHintId]=\"getHintId(index)\"\n [tuiHint]=\"hintContent\"\n [tuiHintContext]=\"{$implicit: index}\"\n (mouseenter.once)=\"(0)\"\n>\n <div\n class=\"t-container\"\n [style.height.%]=\"set | tuiMapper: percentMapper:collapsed:computedMax\"\n >\n <div\n #hintHost\n class=\"t-host\"\n ></div>\n <tui-bar-set\n class=\"t-set\"\n [tuiDescribedBy]=\"getHintId(index)\"\n [tuiFocusable]=\"!!hintContent\"\n [value]=\"set\"\n [size]=\"size\"\n [collapsed]=\"collapsed\"\n ></tui-bar-set>\n </div>\n</div>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiBarSetModule} from '@taiga-ui/addon-charts/components/bar-set';\nimport {TuiFocusableModule, TuiMapperPipeModule} from '@taiga-ui/cdk';\nimport {TuiDescribedByModule, TuiHintModule} from '@taiga-ui/core';\n\nimport {TuiBarChartComponent} from './bar-chart.component';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiDescribedByModule,\n TuiBarSetModule,\n TuiFocusableModule,\n TuiHintModule,\n TuiMapperPipeModule,\n ],\n declarations: [TuiBarChartComponent],\n exports: [TuiBarChartComponent],\n})\nexport class TuiBarChartModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AA4BA,SAAS,cAAc,CAAC,KAAuC,EAAA;IAC3D,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,IAAA,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,MAAM,WAAW,GAAG,CAAA,qCAAA,CAAuC,CAAC;MAS/C,oBAAoB,CAAA;IAsB7B,WAGqB,CAAA,cAAiD,EAC5C,SAAuB,EAAA;QAD5B,IAAc,CAAA,cAAA,GAAd,cAAc,CAAmC;QArB7D,IAAO,CAAA,OAAA,GAAmC,WAAW,CAAC;QAI/D,IAAK,CAAA,KAAA,GAAqC,EAAE,CAAC;QAI7C,IAAG,CAAA,GAAA,GAAG,GAAG,CAAC;QAIV,IAAI,CAAA,IAAA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A,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAjB,iBAAiB,EAAA,YAAA,EAAA,CAHX,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAP/B,YAAY;QACZ,oBAAoB;QACpB,eAAe;QACf,kBAAkB;QAClB,aAAa;AACb,QAAA,mBAAmB,aAGb,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAErB,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,EAXjB,OAAA,EAAA,CAAA;YACL,YAAY;YACZ,oBAAoB;YACpB,eAAe;YACf,kBAAkB;YAClB,aAAa;YACb,mBAAmB;AACtB,SAAA,CAAA,EAAA,CAAA,CAAA;4FAIQ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAZ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,oBAAoB;wBACpB,eAAe;wBACf,kBAAkB;wBAClB,aAAa;wBACb,mBAAmB;AACtB,qBAAA;oBACD,YAAY,EAAE,CAAC,oBAAoB,CAAC;oBACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAClC,iBAAA,CAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import { __decorate
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { TUI_DEFAULT_COLOR_HANDLER } from '@taiga-ui/addon-charts/constants';
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Component, ChangeDetectionStrategy, Input, NgModule } from '@angular/core';
|
|
5
4
|
import { tuiDefaultProp, tuiPure } from '@taiga-ui/cdk';
|
|
6
|
-
import
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1 from '@taiga-ui/addon-charts/components/bar';
|
|
8
6
|
import { TuiBarModule } from '@taiga-ui/addon-charts/components/bar';
|
|
7
|
+
import * as i2 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
9
|
|
|
10
10
|
const PERCENT = 100;
|
|
11
11
|
const EMPTY_ARRAY = [];
|
|
12
12
|
const FILLER_ARRAY = [1];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
constructor(sanitizer) {
|
|
16
|
-
this.sanitizer = sanitizer;
|
|
13
|
+
class TuiBarSetComponent {
|
|
14
|
+
constructor() {
|
|
17
15
|
this.value = [];
|
|
18
|
-
this.colorHandler = TUI_DEFAULT_COLOR_HANDLER;
|
|
19
16
|
this.size = `m`;
|
|
20
17
|
this.collapsed = false;
|
|
21
18
|
}
|
|
@@ -32,53 +29,55 @@ let TuiBarSetComponent = class TuiBarSetComponent {
|
|
|
32
29
|
return Math.abs((PERCENT * value) / this.getLargest(this.computedValue));
|
|
33
30
|
}
|
|
34
31
|
getColor(index) {
|
|
35
|
-
return
|
|
32
|
+
return `var(--tui-chart-${index}`;
|
|
36
33
|
}
|
|
37
34
|
getLargest(value) {
|
|
38
35
|
return value.reduce((a, b) => (a > b ? a : b), 0);
|
|
39
36
|
}
|
|
40
|
-
}
|
|
41
|
-
TuiBarSetComponent
|
|
42
|
-
{ type:
|
|
43
|
-
];
|
|
37
|
+
}
|
|
38
|
+
TuiBarSetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarSetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
39
|
+
TuiBarSetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiBarSetComponent, 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 ></ng-container>\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 ></ng-container>\n </div>\n</ng-template>\n<ng-template\n #bar\n let-item\n let-index=\"index\"\n let-flexible=\"flexible\"\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 [style.height.%]=\"getHeight(item)\"\n [style.background]=\"getColor(index)\"\n [value]=\"computedSegments\"\n [size]=\"computedSize\"\n ></tui-bar>\n</ng-template>\n", styles: [":host{display:flex;height:100%;align-items:flex-end;justify-content:center}.t-wrapper{display:flex;flex:1;height:100%;align-items:flex-end}.t-wrapper:first-child{margin-left:25%}.t-wrapper:last-child{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-width:none;width:75%;margin:0 auto}\n"], components: [{ type: i1.TuiBarComponent, selector: "tui-bar", inputs: ["value", "size"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
44
40
|
__decorate([
|
|
45
|
-
Input(),
|
|
46
41
|
tuiDefaultProp()
|
|
47
42
|
], TuiBarSetComponent.prototype, "value", void 0);
|
|
48
43
|
__decorate([
|
|
49
|
-
Input(),
|
|
50
|
-
tuiDefaultProp()
|
|
51
|
-
], TuiBarSetComponent.prototype, "colorHandler", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
Input(),
|
|
54
44
|
tuiDefaultProp()
|
|
55
45
|
], TuiBarSetComponent.prototype, "size", void 0);
|
|
56
46
|
__decorate([
|
|
57
|
-
Input(),
|
|
58
47
|
tuiDefaultProp()
|
|
59
48
|
], TuiBarSetComponent.prototype, "collapsed", void 0);
|
|
60
49
|
__decorate([
|
|
61
50
|
tuiPure
|
|
62
51
|
], TuiBarSetComponent.prototype, "getLargest", null);
|
|
63
|
-
TuiBarSetComponent
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
],
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarSetComponent, decorators: [{
|
|
53
|
+
type: Component,
|
|
54
|
+
args: [{
|
|
55
|
+
selector: `tui-bar-set`,
|
|
56
|
+
templateUrl: `./bar-set.template.html`,
|
|
57
|
+
styleUrls: [`./bar-set.style.less`],
|
|
58
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
59
|
+
}]
|
|
60
|
+
}], propDecorators: { value: [{
|
|
61
|
+
type: Input
|
|
62
|
+
}], size: [{
|
|
63
|
+
type: Input
|
|
64
|
+
}], collapsed: [{
|
|
65
|
+
type: Input
|
|
66
|
+
}], getLargest: [] } });
|
|
72
67
|
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
TuiBarSetModule =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
],
|
|
68
|
+
class TuiBarSetModule {
|
|
69
|
+
}
|
|
70
|
+
TuiBarSetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarSetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
71
|
+
TuiBarSetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarSetModule, declarations: [TuiBarSetComponent], imports: [CommonModule, TuiBarModule], exports: [TuiBarSetComponent] });
|
|
72
|
+
TuiBarSetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarSetModule, imports: [[CommonModule, TuiBarModule]] });
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarSetModule, decorators: [{
|
|
74
|
+
type: NgModule,
|
|
75
|
+
args: [{
|
|
76
|
+
imports: [CommonModule, TuiBarModule],
|
|
77
|
+
declarations: [TuiBarSetComponent],
|
|
78
|
+
exports: [TuiBarSetComponent],
|
|
79
|
+
}]
|
|
80
|
+
}] });
|
|
82
81
|
|
|
83
82
|
/**
|
|
84
83
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-charts-components-bar-set.js","sources":["
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-charts-components-bar-set.js","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/bar-set.module.ts","../../../projects/addon-charts/components/bar-set/taiga-ui-addon-charts-components-bar-set.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {SafeValue} from '@angular/platform-browser';\nimport {tuiDefaultProp, tuiPure} from '@taiga-ui/cdk';\nimport {TuiSizeL, TuiSizeS} from '@taiga-ui/core';\n\nconst PERCENT = 100;\nconst EMPTY_ARRAY: readonly number[] = [];\nconst FILLER_ARRAY: readonly number[] = [1];\n\n@Component({\n selector: `tui-bar-set`,\n templateUrl: `./bar-set.template.html`,\n styleUrls: [`./bar-set.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiBarSetComponent {\n @Input()\n @tuiDefaultProp()\n value: readonly number[] = [];\n\n @Input()\n @tuiDefaultProp()\n size: TuiSizeS | TuiSizeL | null = `m`;\n\n @Input()\n @tuiDefaultProp()\n collapsed = false;\n\n get computedValue(): readonly number[] {\n return this.collapsed ? FILLER_ARRAY : this.value;\n }\n\n get computedSegments(): readonly number[] {\n return this.collapsed ? this.value : EMPTY_ARRAY;\n }\n\n get computedSize(): TuiSizeS | TuiSizeL {\n return this.size || `m`;\n }\n\n getHeight(value: number): number {\n return Math.abs((PERCENT * value) / this.getLargest(this.computedValue));\n }\n\n getColor(index: number): SafeValue {\n return `var(--tui-chart-${index}`;\n }\n\n @tuiPure\n private getLargest(value: readonly number[]): number {\n return 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 ></ng-container>\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 ></ng-container>\n </div>\n</ng-template>\n<ng-template\n #bar\n let-item\n let-index=\"index\"\n let-flexible=\"flexible\"\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 [style.height.%]=\"getHeight(item)\"\n [style.background]=\"getColor(index)\"\n [value]=\"computedSegments\"\n [size]=\"computedSize\"\n ></tui-bar>\n</ng-template>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiBarModule} from '@taiga-ui/addon-charts/components/bar';\n\nimport {TuiBarSetComponent} from './bar-set.component';\n\n@NgModule({\n imports: [CommonModule, TuiBarModule],\n declarations: [TuiBarSetComponent],\n exports: [TuiBarSetComponent],\n})\nexport class TuiBarSetModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAKA,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,WAAW,GAAsB,EAAE,CAAC;AAC1C,MAAM,YAAY,GAAsB,CAAC,CAAC,CAAC,CAAC;MAQ/B,kBAAkB,CAAA;AAN/B,IAAA,WAAA,GAAA;QASI,IAAK,CAAA,KAAA,GAAsB,EAAE,CAAC;QAI9B,IAAI,CAAA,IAAA,GAA+B,GAAG,CAAC;QAIvC,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;AA0BrB,KAAA;AAxBG,IAAA,IAAI,aAAa,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,SAAS,GAAG,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC;KACrD;AAED,IAAA,IAAI,gBAAgB,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;KACpD;AAED,IAAA,IAAI,YAAY,GAAA;AACZ,QAAA,OAAO,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC;KAC3B;AAED,IAAA,SAAS,CAAC,KAAa,EAAA;AACnB,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;KAC5E;AAED,IAAA,QAAQ,CAAC,KAAa,EAAA;QAClB,OAAO,CAAA,gBAAA,EAAmB,KAAK,CAAA,CAAE,CAAC;KACrC;AAGO,IAAA,UAAU,CAAC,KAAwB,EAAA;QACvC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC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A;4FAI5B,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;oBACrC,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;AAChC,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -1,67 +1,66 @@
|
|
|
1
|
-
import { __decorate
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { colorFallback } from '@taiga-ui/core';
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Component, ChangeDetectionStrategy, Input, HostBinding, NgModule } from '@angular/core';
|
|
4
|
+
import { tuiSum, tuiDefaultProp, tuiPure } from '@taiga-ui/cdk';
|
|
5
|
+
import * as i1 from '@angular/common';
|
|
7
6
|
import { CommonModule } from '@angular/common';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
constructor(sanitizer) {
|
|
12
|
-
this.sanitizer = sanitizer;
|
|
8
|
+
class TuiBarComponent {
|
|
9
|
+
constructor() {
|
|
13
10
|
this.value = [];
|
|
14
|
-
this.colorHandler = TUI_DEFAULT_COLOR_HANDLER;
|
|
15
11
|
this.size = `m`;
|
|
16
12
|
}
|
|
17
13
|
getHeight(value) {
|
|
18
14
|
return (100 * value) / this.getSum(this.value);
|
|
19
15
|
}
|
|
20
16
|
getColor(index) {
|
|
21
|
-
return
|
|
17
|
+
return `var(--tui-chart-${index}`;
|
|
22
18
|
}
|
|
23
19
|
getSum(value) {
|
|
24
|
-
return
|
|
20
|
+
return tuiSum(...value);
|
|
25
21
|
}
|
|
26
|
-
}
|
|
27
|
-
TuiBarComponent
|
|
28
|
-
|
|
29
|
-
];
|
|
22
|
+
}
|
|
23
|
+
TuiBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
+
TuiBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiBarComponent, selector: "tui-bar", inputs: { value: "value", size: "size" }, host: { properties: { "attr.data-size": "this.size" } }, ngImport: i0, template: "<div\n *ngFor=\"let item of value; let index = index\"\n automation-id=\"tui-bar__bar\"\n [style.height.%]=\"getHeight(item)\"\n [style.background]=\"getColor(index)\"\n></div>\n", styles: [":host{display:flex;min-width:.125rem;flex-direction:column-reverse;border-top-left-radius:var(--tui-radius-l);border-top-right-radius:var(--tui-radius-l);overflow:hidden}:host[data-size=l]{width:1rem;max-width:1rem;margin:0 .1875rem}:host[data-size=m]{width:.5rem;max-width:.5rem;margin:0 .1875rem}:host[data-size=s]{width:.25rem;max-width:.5rem;margin:0 .125rem}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
30
25
|
__decorate([
|
|
31
|
-
Input(),
|
|
32
26
|
tuiDefaultProp()
|
|
33
27
|
], TuiBarComponent.prototype, "value", void 0);
|
|
34
28
|
__decorate([
|
|
35
|
-
Input(),
|
|
36
|
-
tuiDefaultProp()
|
|
37
|
-
], TuiBarComponent.prototype, "colorHandler", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
Input(),
|
|
40
|
-
HostBinding(`attr.data-size`),
|
|
41
29
|
tuiDefaultProp()
|
|
42
30
|
], TuiBarComponent.prototype, "size", void 0);
|
|
43
31
|
__decorate([
|
|
44
32
|
tuiPure
|
|
45
33
|
], TuiBarComponent.prototype, "getSum", null);
|
|
46
|
-
TuiBarComponent
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
],
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarComponent, decorators: [{
|
|
35
|
+
type: Component,
|
|
36
|
+
args: [{
|
|
37
|
+
selector: `tui-bar`,
|
|
38
|
+
templateUrl: `./bar.template.html`,
|
|
39
|
+
styleUrls: [`./bar.style.less`],
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
}]
|
|
42
|
+
}], propDecorators: { value: [{
|
|
43
|
+
type: Input
|
|
44
|
+
}], size: [{
|
|
45
|
+
type: Input
|
|
46
|
+
}, {
|
|
47
|
+
type: HostBinding,
|
|
48
|
+
args: [`attr.data-size`]
|
|
49
|
+
}], getSum: [] } });
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
TuiBarModule =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
],
|
|
51
|
+
class TuiBarModule {
|
|
52
|
+
}
|
|
53
|
+
TuiBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
54
|
+
TuiBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarModule, declarations: [TuiBarComponent], imports: [CommonModule], exports: [TuiBarComponent] });
|
|
55
|
+
TuiBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarModule, imports: [[CommonModule]] });
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiBarModule, decorators: [{
|
|
57
|
+
type: NgModule,
|
|
58
|
+
args: [{
|
|
59
|
+
imports: [CommonModule],
|
|
60
|
+
declarations: [TuiBarComponent],
|
|
61
|
+
exports: [TuiBarComponent],
|
|
62
|
+
}]
|
|
63
|
+
}] });
|
|
65
64
|
|
|
66
65
|
/**
|
|
67
66
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-charts-components-bar.js","sources":["
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-charts-components-bar.js","sources":["../../../projects/addon-charts/components/bar/bar.component.ts","../../../projects/addon-charts/components/bar/bar.template.html","../../../projects/addon-charts/components/bar/bar.module.ts","../../../projects/addon-charts/components/bar/taiga-ui-addon-charts-components-bar.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, HostBinding, Input} from '@angular/core';\nimport {SafeValue} from '@angular/platform-browser';\nimport {tuiDefaultProp, tuiPure, tuiSum} from '@taiga-ui/cdk';\nimport {TuiSizeL, TuiSizeS} from '@taiga-ui/core';\n\n@Component({\n selector: `tui-bar`,\n templateUrl: `./bar.template.html`,\n styleUrls: [`./bar.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiBarComponent {\n @Input()\n @tuiDefaultProp()\n value: readonly number[] = [];\n\n @Input()\n @HostBinding(`attr.data-size`)\n @tuiDefaultProp()\n size: TuiSizeS | TuiSizeL = `m`;\n\n getHeight(value: number): number {\n return (100 * value) / this.getSum(this.value);\n }\n\n getColor(index: number): SafeValue {\n return `var(--tui-chart-${index}`;\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.height.%]=\"getHeight(item)\"\n [style.background]=\"getColor(index)\"\n></div>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\n\nimport {TuiBarComponent} from './bar.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [TuiBarComponent],\n exports: [TuiBarComponent],\n})\nexport class TuiBarModule {}\n","/**\n * Generated bundle index.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