suis 1.0.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/lib/components/index.mjs +2 -1
- package/esm2022/lib/components/suis-chart/index.mjs +3 -0
- package/esm2022/lib/components/suis-chart/suis-chart-data.pipe.mjs +35 -0
- package/esm2022/lib/components/suis-chart/suis-chart-height.pipe.mjs +19 -0
- package/esm2022/lib/components/suis-chart/suis-chart.component.mjs +82 -0
- package/esm2022/lib/components/suis-chart/suis-chart.interfaces.mjs +2 -0
- package/esm2022/lib/components/suis-progress-bar/suis-progress-bar.component.mjs +13 -23
- package/esm2022/lib/components/suis-progress-bar/suis-progress-bar.pipe.mjs +5 -3
- package/fesm2022/suis.mjs +144 -26
- package/fesm2022/suis.mjs.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/suis-chart/index.d.ts +2 -0
- package/lib/components/suis-chart/suis-chart-data.pipe.d.ts +8 -0
- package/lib/components/suis-chart/suis-chart-height.pipe.d.ts +7 -0
- package/lib/components/suis-chart/suis-chart.component.d.ts +43 -0
- package/lib/components/suis-chart/suis-chart.interfaces.d.ts +10 -0
- package/lib/components/suis-progress-bar/suis-progress-bar.component.d.ts +7 -7
- package/lib/components/suis-progress-bar/suis-progress-bar.pipe.d.ts +1 -1
- package/package.json +1 -1
@@ -5,6 +5,7 @@ export * from './suis-breadcrumbs';
|
|
5
5
|
export * from './suis-button';
|
6
6
|
export * from './suis-button-link';
|
7
7
|
export * from './suis-button-outlined';
|
8
|
+
export * from './suis-chart';
|
8
9
|
export * from './suis-chip';
|
9
10
|
export * from './suis-container';
|
10
11
|
export * from './suis-dialog';
|
@@ -39,4 +40,4 @@ export * from './suis-text-area';
|
|
39
40
|
export * from './suis-title';
|
40
41
|
export * from './suis-toggle';
|
41
42
|
export * from './suis-toolbar';
|
42
|
-
//# sourceMappingURL=data:application/json;base64,
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb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KiBmcm9tICcuL3N1aXMtdGFicyc7XG5leHBvcnQgKiBmcm9tICcuL3N1aXMtdGV4dC1hcmVhJztcbmV4cG9ydCAqIGZyb20gJy4vc3Vpcy10aXRsZSc7XG5leHBvcnQgKiBmcm9tICcuL3N1aXMtdG9nZ2xlJztcbmV4cG9ydCAqIGZyb20gJy4vc3Vpcy10b29sYmFyJztcbiJdfQ==
|
@@ -0,0 +1,3 @@
|
|
1
|
+
export * from './suis-chart.component';
|
2
|
+
export * from './suis-chart.interfaces';
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL3N1aXMvc3JjL2xpYi9jb21wb25lbnRzL3N1aXMtY2hhcnQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLHlCQUF5QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9zdWlzLWNoYXJ0LmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL3N1aXMtY2hhcnQuaW50ZXJmYWNlcyc7XG4iXX0=
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { Pipe } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export class SuisChartDataPipe {
|
4
|
+
transform(data, compareData) {
|
5
|
+
if (!compareData.length)
|
6
|
+
return data;
|
7
|
+
const combinedData = [];
|
8
|
+
data.forEach((item, index) => {
|
9
|
+
combinedData.push(item);
|
10
|
+
if (compareData.length - 1 >= index) {
|
11
|
+
combinedData.push({
|
12
|
+
...compareData[index],
|
13
|
+
compare: true,
|
14
|
+
});
|
15
|
+
}
|
16
|
+
else {
|
17
|
+
combinedData.push({
|
18
|
+
value: 0,
|
19
|
+
compare: true,
|
20
|
+
});
|
21
|
+
}
|
22
|
+
});
|
23
|
+
return combinedData;
|
24
|
+
}
|
25
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SuisChartDataPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
26
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: SuisChartDataPipe, isStandalone: true, name: "suisChartData" }); }
|
27
|
+
}
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SuisChartDataPipe, decorators: [{
|
29
|
+
type: Pipe,
|
30
|
+
args: [{
|
31
|
+
name: 'suisChartData',
|
32
|
+
standalone: true,
|
33
|
+
}]
|
34
|
+
}] });
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Vpcy1jaGFydC1kYXRhLnBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL3N1aXMvc3JjL2xpYi9jb21wb25lbnRzL3N1aXMtY2hhcnQvc3Vpcy1jaGFydC1kYXRhLnBpcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLElBQUksRUFBaUIsTUFBTSxlQUFlLENBQUM7O0FBVXBELE1BQU0sT0FBTyxpQkFBaUI7SUFDNUIsU0FBUyxDQUNQLElBQXlCLEVBQ3pCLFdBQWdDO1FBRWhDLElBQUksQ0FBQyxXQUFXLENBQUMsTUFBTTtZQUFFLE9BQU8sSUFBSSxDQUFDO1FBRXJDLE1BQU0sWUFBWSxHQUFtQyxFQUFFLENBQUM7UUFFeEQsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLElBQUksRUFBRSxLQUFLLEVBQUUsRUFBRTtZQUMzQixZQUFZLEN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mVEYXRhOiBTdWlzQ2hhcnREYXRhSXRlbVtdXG4gICk6IFN1aXNDaGFydERhdGFDb21wYXJpc2lvbkl0ZW1bXSB7XG4gICAgaWYgKCFjb21wYXJlRGF0YS5sZW5ndGgpIHJldHVybiBkYXRhO1xuXG4gICAgY29uc3QgY29tYmluZWREYXRhOiBTdWlzQ2hhcnREYXRhQ29tcGFyaXNpb25JdGVtW10gPSBbXTtcblxuICAgIGRhdGEuZm9yRWFjaCgoaXRlbSwgaW5kZXgpID0+IHtcbiAgICAgIGNvbWJpbmVkRGF0YS5wdXNoKGl0ZW0pO1xuICAgICAgaWYgKGNvbXBhcmVEYXRhLmxlbmd0aCAtIDEgPj0gaW5kZXgpIHtcbiAgICAgICAgY29tYmluZWREYXRhLnB1c2goe1xuICAgICAgICAgIC4uLmNvbXBhcmVEYXRhW2luZGV4XSxcbiAgICAgICAgICBjb21wYXJlOiB0cnVlLFxuICAgICAgICB9KTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGNvbWJpbmVkRGF0YS5wdXNoKHtcbiAgICAgICAgICB2YWx1ZTogMCxcbiAgICAgICAgICBjb21wYXJlOiB0cnVlLFxuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICB9KTtcblxuICAgIHJldHVybiBjb21iaW5lZERhdGE7XG4gIH1cbn1cbiJdfQ==
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { Pipe } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export class SuisChartHeightPipe {
|
4
|
+
transform(value, maxValue) {
|
5
|
+
if (value > maxValue)
|
6
|
+
return '100%';
|
7
|
+
return `${(value / maxValue) * 100}%`;
|
8
|
+
}
|
9
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SuisChartHeightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
10
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: SuisChartHeightPipe, isStandalone: true, name: "suisChartHeight" }); }
|
11
|
+
}
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SuisChartHeightPipe, decorators: [{
|
13
|
+
type: Pipe,
|
14
|
+
args: [{
|
15
|
+
name: 'suisChartHeight',
|
16
|
+
standalone: true,
|
17
|
+
}]
|
18
|
+
}] });
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Vpcy1jaGFydC1oZWlnaHQucGlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvc3Vpcy9zcmMvbGliL2NvbXBvbmVudHMvc3Vpcy1jaGFydC9zdWlzLWNoYXJ0LWhlaWdodC5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxJQUFJLEVBQWlCLE1BQU0sZUFBZSxDQUFDOztBQU1wRCxNQUFNLE9BQU8sbUJBQW1CO0lBQzlCLFNBQVMsQ0FBQyxLQUFhLEVBQUUsUUFBZ0I7UUFDdkMsSUFBSSxLQUFLLEdBQUcsUUFBUTtZQUFFLE9BQU8sTUFBTSxDQUFDO1FBQ3BDLE9BQU8sR0FBRyxDQUFDLEtBQUssR0FBRyxRQUFRLENBQUMsR0FBRyxHQUFHLEdBQUcsQ0FBQztJQUN4QyxDQUFDOytHQUpVLG1CQUFtQjs2R0FBbkIsbUJBQW1COzs0RkFBbkIsbUJBQW1CO2tCQUovQixJQUFJO21CQUFDO29CQUNKLElBQUksRUFBRSxpQkFBaUI7b0JBQ3ZCLFVBQVUsRUFBRSxJQUFJO2lCQUNqQiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFBpcGUsIFBpcGVUcmFuc2Zvcm0gfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuQFBpcGUoe1xuICBuYW1lOiAnc3Vpc0NoYXJ0SGVpZ2h0JyxcbiAgc3RhbmRhbG9uZTogdHJ1ZSxcbn0pXG5leHBvcnQgY2xhc3MgU3Vpc0NoYXJ0SGVpZ2h0UGlwZSBpbXBsZW1lbnRzIFBpcGVUcmFuc2Zvcm0ge1xuICB0cmFuc2Zvcm0odmFsdWU6IG51bWJlciwgbWF4VmFsdWU6IG51bWJlcik6IHN0cmluZyB7XG4gICAgaWYgKHZhbHVlID4gbWF4VmFsdWUpIHJldHVybiAnMTAwJSc7XG4gICAgcmV0dXJuIGAkeyh2YWx1ZSAvIG1heFZhbHVlKSAqIDEwMH0lYDtcbiAgfVxufVxuIl19
|
@@ -0,0 +1,82 @@
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
2
|
+
import { NgClass, NgForOf, NgIf } from '@angular/common';
|
3
|
+
import { SuisChartHeightPipe } from './suis-chart-height.pipe';
|
4
|
+
import { SuisNgClassPipe } from '../../pipes';
|
5
|
+
import { SuisChartDataPipe } from './suis-chart-data.pipe';
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
export class SuisChartComponent {
|
8
|
+
constructor() {
|
9
|
+
/** @internal */
|
10
|
+
this._maxValue = 100;
|
11
|
+
/**
|
12
|
+
* Array of the chart bars labels. By default set to empty array.
|
13
|
+
*/
|
14
|
+
this.labels = [];
|
15
|
+
/**
|
16
|
+
* Array of data values and optionally colors. Type of SuisChartDataItem[]. By default set to empty array.
|
17
|
+
*/
|
18
|
+
this.data = [];
|
19
|
+
/**
|
20
|
+
* Sets the default color of the chart bars. Type of SuisColor. By default set to 'primary'.
|
21
|
+
*/
|
22
|
+
this.color = 'primary';
|
23
|
+
/**
|
24
|
+
* Adjusts the width of the chart bars. Type of SuisSize. By default set to 'md'.
|
25
|
+
*/
|
26
|
+
this.size = 'md';
|
27
|
+
/**
|
28
|
+
* Sets the maximum value automatically based on data values. By default set to false.
|
29
|
+
*/
|
30
|
+
this.autoMax = false;
|
31
|
+
/**
|
32
|
+
* Array of comparision data values and optionally colors. Type of SuisChartDataItem[]. By default set to empty array.
|
33
|
+
*/
|
34
|
+
this.compareData = [];
|
35
|
+
/**
|
36
|
+
* Sets the default color of the comparision chart bars. Type of SuisColor. By default set to 'warning'.
|
37
|
+
*/
|
38
|
+
this.compareColor = 'warning';
|
39
|
+
}
|
40
|
+
/** @internal */
|
41
|
+
get maxValue() {
|
42
|
+
if (!this.autoMax)
|
43
|
+
return this._maxValue;
|
44
|
+
return Math.max(...[...this.data, ...this.compareData].map((item) => item.value));
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* Set the maximum value of the chart bars. By default set to 100.
|
48
|
+
*/
|
49
|
+
set maxValue(value) {
|
50
|
+
this._maxValue = value;
|
51
|
+
}
|
52
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SuisChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
53
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SuisChartComponent, isStandalone: true, selector: "suis-chart", inputs: { maxValue: "maxValue", labels: "labels", data: "data", color: "color", size: "size", autoMax: "autoMax", compareData: "compareData", compareColor: "compareColor" }, ngImport: i0, template: "<div class=\"suis-chart\">\n <div\n class=\"suis-chart__content\"\n [ngClass]=\"'suis-chart__content' | suisNgClass : size\"\n >\n <div\n *ngFor=\"let item of data | suisChartData : compareData\"\n class=\"suis-chart__content__item\"\n [ngClass]=\"\n 'suis-chart__content__item'\n | suisNgClass\n : (item.compare ? item.color || compareColor : item.color || color)\n : (item.compare ? 'compare' : 'single')\n \"\n [style.height]=\"item.value | suisChartHeight : maxValue\"\n >\n <div class=\"suis-chart__content__item__value\">\n {{ item.value }}\n </div>\n </div>\n </div>\n <div\n class=\"suis-chart__labels\"\n [ngClass]=\"'suis-chart__labels' | suisNgClass : size\"\n >\n <div\n *ngFor=\"let label of labels\"\n class=\"suis-chart__labels__item\"\n [class.suis-chart__labels__item--double]=\"compareData.length\"\n >\n {{ label }}\n </div>\n </div>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:host{display:block;height:100%}.suis-chart{height:100%}.suis-chart__content,.suis-chart__labels{display:flex;align-items:flex-end;justify-content:center}.suis-chart__content--xs .suis-chart__content__item,.suis-chart__content--xs .suis-chart__labels__item,.suis-chart__labels--xs .suis-chart__content__item,.suis-chart__labels--xs .suis-chart__labels__item{width:1rem}.suis-chart__content--xs .suis-chart__content__item:not(:last-child),.suis-chart__content--xs .suis-chart__labels__item:not(:last-child),.suis-chart__labels--xs .suis-chart__content__item:not(:last-child),.suis-chart__labels--xs .suis-chart__labels__item:not(:last-child){margin-right:.5rem}.suis-chart__content--xs .suis-chart__content__item--compare,.suis-chart__content--xs .suis-chart__labels__item--compare,.suis-chart__labels--xs .suis-chart__content__item--compare,.suis-chart__labels--xs .suis-chart__labels__item--compare{margin-left:-.5rem}.suis-chart__content--xs .suis-chart__content__item--double,.suis-chart__content--xs .suis-chart__labels__item--double,.suis-chart__labels--xs .suis-chart__content__item--double,.suis-chart__labels--xs .suis-chart__labels__item--double{width:2rem}.suis-chart__content--sm .suis-chart__content__item,.suis-chart__content--sm .suis-chart__labels__item,.suis-chart__labels--sm .suis-chart__content__item,.suis-chart__labels--sm .suis-chart__labels__item{width:1.25rem}.suis-chart__content--sm .suis-chart__content__item:not(:last-child),.suis-chart__content--sm .suis-chart__labels__item:not(:last-child),.suis-chart__labels--sm .suis-chart__content__item:not(:last-child),.suis-chart__labels--sm .suis-chart__labels__item:not(:last-child){margin-right:.625rem}.suis-chart__content--sm .suis-chart__content__item--compare,.suis-chart__content--sm .suis-chart__labels__item--compare,.suis-chart__labels--sm .suis-chart__content__item--compare,.suis-chart__labels--sm .suis-chart__labels__item--compare{margin-left:-.625rem}.suis-chart__content--sm .suis-chart__content__item--double,.suis-chart__content--sm .suis-chart__labels__item--double,.suis-chart__labels--sm .suis-chart__content__item--double,.suis-chart__labels--sm .suis-chart__labels__item--double{width:2.5rem}.suis-chart__content--md .suis-chart__content__item,.suis-chart__content--md .suis-chart__labels__item,.suis-chart__labels--md .suis-chart__content__item,.suis-chart__labels--md .suis-chart__labels__item{width:1.5rem}.suis-chart__content--md .suis-chart__content__item:not(:last-child),.suis-chart__content--md .suis-chart__labels__item:not(:last-child),.suis-chart__labels--md .suis-chart__content__item:not(:last-child),.suis-chart__labels--md .suis-chart__labels__item:not(:last-child){margin-right:.75rem}.suis-chart__content--md .suis-chart__content__item--compare,.suis-chart__content--md .suis-chart__labels__item--compare,.suis-chart__labels--md .suis-chart__content__item--compare,.suis-chart__labels--md .suis-chart__labels__item--compare{margin-left:-.75rem}.suis-chart__content--md .suis-chart__content__item--double,.suis-chart__content--md .suis-chart__labels__item--double,.suis-chart__labels--md .suis-chart__content__item--double,.suis-chart__labels--md .suis-chart__labels__item--double{width:3rem}.suis-chart__content--lg .suis-chart__content__item,.suis-chart__content--lg .suis-chart__labels__item,.suis-chart__labels--lg .suis-chart__content__item,.suis-chart__labels--lg .suis-chart__labels__item{width:1.75rem}.suis-chart__content--lg .suis-chart__content__item:not(:last-child),.suis-chart__content--lg .suis-chart__labels__item:not(:last-child),.suis-chart__labels--lg .suis-chart__content__item:not(:last-child),.suis-chart__labels--lg .suis-chart__labels__item:not(:last-child){margin-right:.875rem}.suis-chart__content--lg .suis-chart__content__item--compare,.suis-chart__content--lg .suis-chart__labels__item--compare,.suis-chart__labels--lg .suis-chart__content__item--compare,.suis-chart__labels--lg .suis-chart__labels__item--compare{margin-left:-1rem}.suis-chart__content--lg .suis-chart__content__item--double,.suis-chart__content--lg .suis-chart__labels__item--double,.suis-chart__labels--lg .suis-chart__content__item--double,.suis-chart__labels--lg .suis-chart__labels__item--double{width:3.5rem}.suis-chart__content--xl .suis-chart__content__item,.suis-chart__content--xl .suis-chart__labels__item,.suis-chart__labels--xl .suis-chart__content__item,.suis-chart__labels--xl .suis-chart__labels__item{width:2rem}.suis-chart__content--xl .suis-chart__content__item:not(:last-child),.suis-chart__content--xl .suis-chart__labels__item:not(:last-child),.suis-chart__labels--xl .suis-chart__content__item:not(:last-child),.suis-chart__labels--xl .suis-chart__labels__item:not(:last-child){margin-right:1rem}.suis-chart__content--xl .suis-chart__content__item--compare,.suis-chart__content--xl .suis-chart__labels__item--compare,.suis-chart__labels--xl .suis-chart__content__item--compare,.suis-chart__labels--xl .suis-chart__labels__item--compare{margin-left:-1rem}.suis-chart__content--xl .suis-chart__content__item--double,.suis-chart__content--xl .suis-chart__labels__item--double,.suis-chart__labels--xl .suis-chart__content__item--double,.suis-chart__labels--xl .suis-chart__labels__item--double{width:4rem}.suis-chart__content{height:100%}.suis-chart__content__item{background-color:#192a56;min-height:.0625rem;position:relative}.suis-chart__content__item--primary{background-color:#192a56}.suis-chart__content__item--secondary{background-color:#273c75}.suis-chart__content__item--tertiary{background-color:#dcdde1}.suis-chart__content__item--complementary{background-color:#f5f6fa}.suis-chart__content__item--success{background-color:#2ed573}.suis-chart__content__item--warning{background-color:#ffa502}.suis-chart__content__item--danger{background-color:#ff4757}.suis-chart__content__item--white{background-color:#fff}.suis-chart__content__item--gray{background-color:#bcbcbc}.suis-chart__content__item--dark{background-color:#000}.suis-chart__content__item__value{position:absolute;top:-1rem;text-align:center;width:100%;font-size:.75rem;color:#a4a7b0}.suis-chart__labels__item{margin-top:.25rem;font-size:.75rem;color:#a4a7b0;text-align:center}\n"], dependencies: [{ kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: SuisChartHeightPipe, name: "suisChartHeight" }, { kind: "pipe", type: SuisChartDataPipe, name: "suisChartData" }, { kind: "pipe", type: SuisNgClassPipe, name: "suisNgClass" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
54
|
+
}
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SuisChartComponent, decorators: [{
|
56
|
+
type: Component,
|
57
|
+
args: [{ selector: 'suis-chart', standalone: true, imports: [
|
58
|
+
NgForOf,
|
59
|
+
NgIf,
|
60
|
+
NgClass,
|
61
|
+
SuisChartHeightPipe,
|
62
|
+
SuisChartDataPipe,
|
63
|
+
SuisNgClassPipe,
|
64
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"suis-chart\">\n <div\n class=\"suis-chart__content\"\n [ngClass]=\"'suis-chart__content' | suisNgClass : size\"\n >\n <div\n *ngFor=\"let item of data | suisChartData : compareData\"\n class=\"suis-chart__content__item\"\n [ngClass]=\"\n 'suis-chart__content__item'\n | suisNgClass\n : (item.compare ? item.color || compareColor : item.color || color)\n : (item.compare ? 'compare' : 'single')\n \"\n [style.height]=\"item.value | suisChartHeight : maxValue\"\n >\n <div class=\"suis-chart__content__item__value\">\n {{ item.value }}\n </div>\n </div>\n </div>\n <div\n class=\"suis-chart__labels\"\n [ngClass]=\"'suis-chart__labels' | suisNgClass : size\"\n >\n <div\n *ngFor=\"let label of labels\"\n class=\"suis-chart__labels__item\"\n [class.suis-chart__labels__item--double]=\"compareData.length\"\n >\n {{ label }}\n </div>\n </div>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:host{display:block;height:100%}.suis-chart{height:100%}.suis-chart__content,.suis-chart__labels{display:flex;align-items:flex-end;justify-content:center}.suis-chart__content--xs .suis-chart__content__item,.suis-chart__content--xs .suis-chart__labels__item,.suis-chart__labels--xs .suis-chart__content__item,.suis-chart__labels--xs .suis-chart__labels__item{width:1rem}.suis-chart__content--xs .suis-chart__content__item:not(:last-child),.suis-chart__content--xs .suis-chart__labels__item:not(:last-child),.suis-chart__labels--xs .suis-chart__content__item:not(:last-child),.suis-chart__labels--xs .suis-chart__labels__item:not(:last-child){margin-right:.5rem}.suis-chart__content--xs .suis-chart__content__item--compare,.suis-chart__content--xs .suis-chart__labels__item--compare,.suis-chart__labels--xs .suis-chart__content__item--compare,.suis-chart__labels--xs .suis-chart__labels__item--compare{margin-left:-.5rem}.suis-chart__content--xs .suis-chart__content__item--double,.suis-chart__content--xs .suis-chart__labels__item--double,.suis-chart__labels--xs .suis-chart__content__item--double,.suis-chart__labels--xs .suis-chart__labels__item--double{width:2rem}.suis-chart__content--sm .suis-chart__content__item,.suis-chart__content--sm .suis-chart__labels__item,.suis-chart__labels--sm .suis-chart__content__item,.suis-chart__labels--sm .suis-chart__labels__item{width:1.25rem}.suis-chart__content--sm .suis-chart__content__item:not(:last-child),.suis-chart__content--sm .suis-chart__labels__item:not(:last-child),.suis-chart__labels--sm .suis-chart__content__item:not(:last-child),.suis-chart__labels--sm .suis-chart__labels__item:not(:last-child){margin-right:.625rem}.suis-chart__content--sm .suis-chart__content__item--compare,.suis-chart__content--sm .suis-chart__labels__item--compare,.suis-chart__labels--sm .suis-chart__content__item--compare,.suis-chart__labels--sm .suis-chart__labels__item--compare{margin-left:-.625rem}.suis-chart__content--sm .suis-chart__content__item--double,.suis-chart__content--sm .suis-chart__labels__item--double,.suis-chart__labels--sm .suis-chart__content__item--double,.suis-chart__labels--sm .suis-chart__labels__item--double{width:2.5rem}.suis-chart__content--md .suis-chart__content__item,.suis-chart__content--md .suis-chart__labels__item,.suis-chart__labels--md .suis-chart__content__item,.suis-chart__labels--md .suis-chart__labels__item{width:1.5rem}.suis-chart__content--md .suis-chart__content__item:not(:last-child),.suis-chart__content--md .suis-chart__labels__item:not(:last-child),.suis-chart__labels--md .suis-chart__content__item:not(:last-child),.suis-chart__labels--md .suis-chart__labels__item:not(:last-child){margin-right:.75rem}.suis-chart__content--md .suis-chart__content__item--compare,.suis-chart__content--md .suis-chart__labels__item--compare,.suis-chart__labels--md .suis-chart__content__item--compare,.suis-chart__labels--md .suis-chart__labels__item--compare{margin-left:-.75rem}.suis-chart__content--md .suis-chart__content__item--double,.suis-chart__content--md .suis-chart__labels__item--double,.suis-chart__labels--md .suis-chart__content__item--double,.suis-chart__labels--md .suis-chart__labels__item--double{width:3rem}.suis-chart__content--lg .suis-chart__content__item,.suis-chart__content--lg .suis-chart__labels__item,.suis-chart__labels--lg .suis-chart__content__item,.suis-chart__labels--lg .suis-chart__labels__item{width:1.75rem}.suis-chart__content--lg .suis-chart__content__item:not(:last-child),.suis-chart__content--lg .suis-chart__labels__item:not(:last-child),.suis-chart__labels--lg .suis-chart__content__item:not(:last-child),.suis-chart__labels--lg .suis-chart__labels__item:not(:last-child){margin-right:.875rem}.suis-chart__content--lg .suis-chart__content__item--compare,.suis-chart__content--lg .suis-chart__labels__item--compare,.suis-chart__labels--lg .suis-chart__content__item--compare,.suis-chart__labels--lg .suis-chart__labels__item--compare{margin-left:-1rem}.suis-chart__content--lg .suis-chart__content__item--double,.suis-chart__content--lg .suis-chart__labels__item--double,.suis-chart__labels--lg .suis-chart__content__item--double,.suis-chart__labels--lg .suis-chart__labels__item--double{width:3.5rem}.suis-chart__content--xl .suis-chart__content__item,.suis-chart__content--xl .suis-chart__labels__item,.suis-chart__labels--xl .suis-chart__content__item,.suis-chart__labels--xl .suis-chart__labels__item{width:2rem}.suis-chart__content--xl .suis-chart__content__item:not(:last-child),.suis-chart__content--xl .suis-chart__labels__item:not(:last-child),.suis-chart__labels--xl .suis-chart__content__item:not(:last-child),.suis-chart__labels--xl .suis-chart__labels__item:not(:last-child){margin-right:1rem}.suis-chart__content--xl .suis-chart__content__item--compare,.suis-chart__content--xl .suis-chart__labels__item--compare,.suis-chart__labels--xl .suis-chart__content__item--compare,.suis-chart__labels--xl .suis-chart__labels__item--compare{margin-left:-1rem}.suis-chart__content--xl .suis-chart__content__item--double,.suis-chart__content--xl .suis-chart__labels__item--double,.suis-chart__labels--xl .suis-chart__content__item--double,.suis-chart__labels--xl .suis-chart__labels__item--double{width:4rem}.suis-chart__content{height:100%}.suis-chart__content__item{background-color:#192a56;min-height:.0625rem;position:relative}.suis-chart__content__item--primary{background-color:#192a56}.suis-chart__content__item--secondary{background-color:#273c75}.suis-chart__content__item--tertiary{background-color:#dcdde1}.suis-chart__content__item--complementary{background-color:#f5f6fa}.suis-chart__content__item--success{background-color:#2ed573}.suis-chart__content__item--warning{background-color:#ffa502}.suis-chart__content__item--danger{background-color:#ff4757}.suis-chart__content__item--white{background-color:#fff}.suis-chart__content__item--gray{background-color:#bcbcbc}.suis-chart__content__item--dark{background-color:#000}.suis-chart__content__item__value{position:absolute;top:-1rem;text-align:center;width:100%;font-size:.75rem;color:#a4a7b0}.suis-chart__labels__item{margin-top:.25rem;font-size:.75rem;color:#a4a7b0;text-align:center}\n"] }]
|
65
|
+
}], propDecorators: { maxValue: [{
|
66
|
+
type: Input
|
67
|
+
}], labels: [{
|
68
|
+
type: Input
|
69
|
+
}], data: [{
|
70
|
+
type: Input
|
71
|
+
}], color: [{
|
72
|
+
type: Input
|
73
|
+
}], size: [{
|
74
|
+
type: Input
|
75
|
+
}], autoMax: [{
|
76
|
+
type: Input
|
77
|
+
}], compareData: [{
|
78
|
+
type: Input
|
79
|
+
}], compareColor: [{
|
80
|
+
type: Input
|
81
|
+
}] } });
|
82
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Vpcy1jaGFydC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL3N1aXMvc3JjL2xpYi9jb21wb25lbnRzL3N1aXMtY2hhcnQvc3Vpcy1jaGFydC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL3N1aXMvc3JjL2xpYi9jb21wb25lbnRzL3N1aXMtY2hhcnQvc3Vpcy1jaGFydC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W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oic3Vpcy1jaGFydC5pbnRlcmZhY2VzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9zdWlzL3NyYy9saWIvY29tcG9uZW50cy9zdWlzLWNoYXJ0L3N1aXMtY2hhcnQuaW50ZXJmYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgU3Vpc0NvbG9yIH0gZnJvbSAnLi4vLi4vdHlwZXMvc3Vpcy1jb2xvci50eXBlJztcblxuZXhwb3J0IGludGVyZmFjZSBTdWlzQ2hhcnREYXRhSXRlbSB7XG4gIHZhbHVlOiBudW1iZXI7XG4gIGNvbG9yPzogU3Vpc0NvbG9yO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIFN1aXNDaGFydERhdGFDb21wYXJpc2lvbkl0ZW0ge1xuICB2YWx1ZTogbnVtYmVyO1xuICBjb2xvcj86IFN1aXNDb2xvcjtcbiAgY29tcGFyZT86IGJvb2xlYW47XG59XG4iXX0=
|
@@ -5,8 +5,14 @@ import { SuisNgClassPipe } from '../../pipes';
|
|
5
5
|
import * as i0 from "@angular/core";
|
6
6
|
export class SuisProgressBarComponent {
|
7
7
|
constructor() {
|
8
|
-
/**
|
9
|
-
|
8
|
+
/**
|
9
|
+
* The value corresponding to the progress bar. By default set to 0.
|
10
|
+
*/
|
11
|
+
this.value = 0;
|
12
|
+
/**
|
13
|
+
* Maximum value of the progress bar. By default set to 100.
|
14
|
+
*/
|
15
|
+
this.maxValue = 100;
|
10
16
|
/**
|
11
17
|
* Sets the color of the progress bar. Type of SuisColor. By default set to 'primary'.
|
12
18
|
*/
|
@@ -20,32 +26,16 @@ export class SuisProgressBarComponent {
|
|
20
26
|
*/
|
21
27
|
this.size = 'md';
|
22
28
|
}
|
23
|
-
/** @internal */
|
24
|
-
get value() {
|
25
|
-
return this._value;
|
26
|
-
}
|
27
|
-
/**
|
28
|
-
* Width of the progress bar in percentage (value >= 0 && value <= 100). By default set to 0.
|
29
|
-
*/
|
30
|
-
set value(value) {
|
31
|
-
if (value >= 0 && value <= 100) {
|
32
|
-
this._value = value;
|
33
|
-
}
|
34
|
-
else if (value > 100) {
|
35
|
-
this._value = 100;
|
36
|
-
}
|
37
|
-
else {
|
38
|
-
this._value = 0;
|
39
|
-
}
|
40
|
-
}
|
41
29
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SuisProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
42
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SuisProgressBarComponent, isStandalone: true, selector: "suis-progress-bar", inputs: { value: "value", color: "color", backgroundColor: "backgroundColor", size: "size" }, ngImport: i0, template: "<div\n class=\"suis-progress-bar\"\n [ngClass]=\"'suis-progress-bar' | suisNgClass : backgroundColor : size\"\n>\n <div\n class=\"suis-progress-bar__progress\"\n [style]=\"{ width: value | suisProgressBar }\"\n [ngClass]=\"'suis-progress-bar__progress' | suisNgClass : color : size\"\n ></div>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:host{display:block}.suis-progress-bar{width:100%}.suis-progress-bar,.suis-progress-bar__progress{border-radius:1rem}.suis-progress-bar--primary,.suis-progress-bar__progress--primary{background-color:#192a56}.suis-progress-bar--secondary,.suis-progress-bar__progress--secondary{background-color:#273c75}.suis-progress-bar--tertiary,.suis-progress-bar__progress--tertiary{background-color:#dcdde1}.suis-progress-bar--complementary,.suis-progress-bar__progress--complementary{background-color:#f5f6fa}.suis-progress-bar--success,.suis-progress-bar__progress--success{background-color:#2ed573}.suis-progress-bar--warning,.suis-progress-bar__progress--warning{background-color:#ffa502}.suis-progress-bar--danger,.suis-progress-bar__progress--danger{background-color:#ff4757}.suis-progress-bar--white,.suis-progress-bar__progress--white{background-color:#fff}.suis-progress-bar--gray,.suis-progress-bar__progress--gray{background-color:#bcbcbc}.suis-progress-bar--dark,.suis-progress-bar__progress--dark{background-color:#000}.suis-progress-bar--xs,.suis-progress-bar__progress--xs{height:.375rem}.suis-progress-bar--sm,.suis-progress-bar__progress--sm{height:.5rem}.suis-progress-bar--md,.suis-progress-bar__progress--md{height:.625rem}.suis-progress-bar--lg,.suis-progress-bar__progress--lg{height:.75rem}.suis-progress-bar--xl,.suis-progress-bar__progress--xl{height:1rem}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: SuisNgClassPipe, name: "suisNgClass" }, { kind: "pipe", type: SuisProgressBarPipe, name: "suisProgressBar" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
30
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SuisProgressBarComponent, isStandalone: true, selector: "suis-progress-bar", inputs: { value: "value", maxValue: "maxValue", color: "color", backgroundColor: "backgroundColor", size: "size" }, ngImport: i0, template: "<div\n class=\"suis-progress-bar\"\n [ngClass]=\"'suis-progress-bar' | suisNgClass : backgroundColor : size\"\n>\n <div\n class=\"suis-progress-bar__progress\"\n [style]=\"{ width: value | suisProgressBar : maxValue }\"\n [ngClass]=\"'suis-progress-bar__progress' | suisNgClass : color : size\"\n ></div>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:host{display:block}.suis-progress-bar{width:100%}.suis-progress-bar,.suis-progress-bar__progress{border-radius:1rem}.suis-progress-bar--primary,.suis-progress-bar__progress--primary{background-color:#192a56}.suis-progress-bar--secondary,.suis-progress-bar__progress--secondary{background-color:#273c75}.suis-progress-bar--tertiary,.suis-progress-bar__progress--tertiary{background-color:#dcdde1}.suis-progress-bar--complementary,.suis-progress-bar__progress--complementary{background-color:#f5f6fa}.suis-progress-bar--success,.suis-progress-bar__progress--success{background-color:#2ed573}.suis-progress-bar--warning,.suis-progress-bar__progress--warning{background-color:#ffa502}.suis-progress-bar--danger,.suis-progress-bar__progress--danger{background-color:#ff4757}.suis-progress-bar--white,.suis-progress-bar__progress--white{background-color:#fff}.suis-progress-bar--gray,.suis-progress-bar__progress--gray{background-color:#bcbcbc}.suis-progress-bar--dark,.suis-progress-bar__progress--dark{background-color:#000}.suis-progress-bar--xs,.suis-progress-bar__progress--xs{height:.375rem}.suis-progress-bar--sm,.suis-progress-bar__progress--sm{height:.5rem}.suis-progress-bar--md,.suis-progress-bar__progress--md{height:.625rem}.suis-progress-bar--lg,.suis-progress-bar__progress--lg{height:.75rem}.suis-progress-bar--xl,.suis-progress-bar__progress--xl{height:1rem}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: SuisNgClassPipe, name: "suisNgClass" }, { kind: "pipe", type: SuisProgressBarPipe, name: "suisProgressBar" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
43
31
|
}
|
44
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SuisProgressBarComponent, decorators: [{
|
45
33
|
type: Component,
|
46
|
-
args: [{ selector: 'suis-progress-bar', standalone: true, imports: [NgClass, SuisNgClassPipe, SuisProgressBarPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"suis-progress-bar\"\n [ngClass]=\"'suis-progress-bar' | suisNgClass : backgroundColor : size\"\n>\n <div\n class=\"suis-progress-bar__progress\"\n [style]=\"{ width: value | suisProgressBar }\"\n [ngClass]=\"'suis-progress-bar__progress' | suisNgClass : color : size\"\n ></div>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:host{display:block}.suis-progress-bar{width:100%}.suis-progress-bar,.suis-progress-bar__progress{border-radius:1rem}.suis-progress-bar--primary,.suis-progress-bar__progress--primary{background-color:#192a56}.suis-progress-bar--secondary,.suis-progress-bar__progress--secondary{background-color:#273c75}.suis-progress-bar--tertiary,.suis-progress-bar__progress--tertiary{background-color:#dcdde1}.suis-progress-bar--complementary,.suis-progress-bar__progress--complementary{background-color:#f5f6fa}.suis-progress-bar--success,.suis-progress-bar__progress--success{background-color:#2ed573}.suis-progress-bar--warning,.suis-progress-bar__progress--warning{background-color:#ffa502}.suis-progress-bar--danger,.suis-progress-bar__progress--danger{background-color:#ff4757}.suis-progress-bar--white,.suis-progress-bar__progress--white{background-color:#fff}.suis-progress-bar--gray,.suis-progress-bar__progress--gray{background-color:#bcbcbc}.suis-progress-bar--dark,.suis-progress-bar__progress--dark{background-color:#000}.suis-progress-bar--xs,.suis-progress-bar__progress--xs{height:.375rem}.suis-progress-bar--sm,.suis-progress-bar__progress--sm{height:.5rem}.suis-progress-bar--md,.suis-progress-bar__progress--md{height:.625rem}.suis-progress-bar--lg,.suis-progress-bar__progress--lg{height:.75rem}.suis-progress-bar--xl,.suis-progress-bar__progress--xl{height:1rem}\n"] }]
|
34
|
+
args: [{ selector: 'suis-progress-bar', standalone: true, imports: [NgClass, SuisNgClassPipe, SuisProgressBarPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"suis-progress-bar\"\n [ngClass]=\"'suis-progress-bar' | suisNgClass : backgroundColor : size\"\n>\n <div\n class=\"suis-progress-bar__progress\"\n [style]=\"{ width: value | suisProgressBar : maxValue }\"\n [ngClass]=\"'suis-progress-bar__progress' | suisNgClass : color : size\"\n ></div>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:host{display:block}.suis-progress-bar{width:100%}.suis-progress-bar,.suis-progress-bar__progress{border-radius:1rem}.suis-progress-bar--primary,.suis-progress-bar__progress--primary{background-color:#192a56}.suis-progress-bar--secondary,.suis-progress-bar__progress--secondary{background-color:#273c75}.suis-progress-bar--tertiary,.suis-progress-bar__progress--tertiary{background-color:#dcdde1}.suis-progress-bar--complementary,.suis-progress-bar__progress--complementary{background-color:#f5f6fa}.suis-progress-bar--success,.suis-progress-bar__progress--success{background-color:#2ed573}.suis-progress-bar--warning,.suis-progress-bar__progress--warning{background-color:#ffa502}.suis-progress-bar--danger,.suis-progress-bar__progress--danger{background-color:#ff4757}.suis-progress-bar--white,.suis-progress-bar__progress--white{background-color:#fff}.suis-progress-bar--gray,.suis-progress-bar__progress--gray{background-color:#bcbcbc}.suis-progress-bar--dark,.suis-progress-bar__progress--dark{background-color:#000}.suis-progress-bar--xs,.suis-progress-bar__progress--xs{height:.375rem}.suis-progress-bar--sm,.suis-progress-bar__progress--sm{height:.5rem}.suis-progress-bar--md,.suis-progress-bar__progress--md{height:.625rem}.suis-progress-bar--lg,.suis-progress-bar__progress--lg{height:.75rem}.suis-progress-bar--xl,.suis-progress-bar__progress--xl{height:1rem}\n"] }]
|
47
35
|
}], propDecorators: { value: [{
|
48
36
|
type: Input
|
37
|
+
}], maxValue: [{
|
38
|
+
type: Input
|
49
39
|
}], color: [{
|
50
40
|
type: Input
|
51
41
|
}], backgroundColor: [{
|
@@ -53,4 +43,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
53
43
|
}], size: [{
|
54
44
|
type: Input
|
55
45
|
}] } });
|
56
|
-
//# sourceMappingURL=data:application/json;base64,
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Vpcy1wcm9ncmVzcy1iYXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9zdWlzL3NyYy9saWIvY29tcG9uZW50cy9zdWlzLXByb2dyZXNzLWJhci9zdWlzLXByb2dyZXNzLWJhci5jb21wb25lbnQudHMiLCIuLi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mFsdWUgfCBzdWlzUHJvZ3Jlc3NCYXIgOiBtYXhWYWx1ZSB9XCJcbiAgICBbbmdDbGFzc109XCInc3Vpcy1wcm9ncmVzcy1iYXJfX3Byb2dyZXNzJyB8IHN1aXNOZ0NsYXNzIDogY29sb3IgOiBzaXplXCJcbiAgPjwvZGl2PlxuPC9kaXY+XG4iXX0=
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import { Pipe } from '@angular/core';
|
2
2
|
import * as i0 from "@angular/core";
|
3
3
|
export class SuisProgressBarPipe {
|
4
|
-
transform(value) {
|
5
|
-
|
4
|
+
transform(value, maxValue) {
|
5
|
+
if (value > maxValue)
|
6
|
+
return '100%';
|
7
|
+
return `${(value / maxValue) * 100}%`;
|
6
8
|
}
|
7
9
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SuisProgressBarPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
8
10
|
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: SuisProgressBarPipe, isStandalone: true, name: "suisProgressBar" }); }
|
@@ -14,4 +16,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
14
16
|
name: 'suisProgressBar',
|
15
17
|
}]
|
16
18
|
}] });
|
17
|
-
//# sourceMappingURL=data:application/json;base64,
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Vpcy1wcm9ncmVzcy1iYXIucGlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvc3Vpcy9zcmMvbGliL2NvbXBvbmVudHMvc3Vpcy1wcm9ncmVzcy1iYXIvc3Vpcy1wcm9ncmVzcy1iYXIucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzI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