@colijnit/sharedcomponents 1.0.31 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -24
- package/bundles/colijnit-sharedcomponents.umd.js +53 -37
- package/bundles/colijnit-sharedcomponents.umd.js.map +1 -1
- package/colijnit-sharedcomponents.metadata.json +1 -1
- package/esm2015/lib/components/circular-gauge/co-circular-gauge.component.js +18 -15
- package/esm2015/lib/components/linear-gauge/co-linear-gauge.component.js +14 -10
- package/esm2015/lib/components/statusbar/statusbar.component.js +14 -16
- package/esm2015/lib/components/statusbar/statusbar.module.js +4 -2
- package/esm2015/lib/enum/gauge-color.enum.js +10 -0
- package/esm2015/lib/enum/icon.enum.js +1 -1
- package/esm2015/lib/model/icon-svg.js +1 -1
- package/fesm2015/colijnit-sharedcomponents.js +55 -41
- package/fesm2015/colijnit-sharedcomponents.js.map +1 -1
- package/lib/components/circular-gauge/style/_layout.scss +6 -3
- package/lib/components/linear-gauge/co-linear-gauge.component.d.ts +1 -6
- package/lib/components/statusbar/statusbar.component.d.ts +2 -3
- package/lib/enum/gauge-color.enum.d.ts +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# Sharedcomponents
|
|
2
|
-
|
|
3
|
-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.1.0.
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Run `ng generate component component-name --project sharedcomponents` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project sharedcomponents`.
|
|
8
|
-
> Note: Don't forget to add `--project sharedcomponents` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
-
|
|
10
|
-
## Build
|
|
11
|
-
|
|
12
|
-
Run `ng build sharedcomponents` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
-
|
|
14
|
-
## Publishing
|
|
15
|
-
|
|
16
|
-
After building your library with `ng build sharedcomponents`, go to the dist folder `cd dist/sharedcomponents` and run `npm publish`.
|
|
17
|
-
|
|
18
|
-
## Running unit tests
|
|
19
|
-
|
|
20
|
-
Run `ng test sharedcomponents` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
-
|
|
22
|
-
## Further help
|
|
23
|
-
|
|
24
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
1
|
+
# Sharedcomponents
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.1.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project sharedcomponents` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project sharedcomponents`.
|
|
8
|
+
> Note: Don't forget to add `--project sharedcomponents` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
|
|
12
|
+
Run `ng build sharedcomponents` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
|
|
14
|
+
## Publishing
|
|
15
|
+
|
|
16
|
+
After building your library with `ng build sharedcomponents`, go to the dist folder `cd dist/sharedcomponents` and run `npm publish`.
|
|
17
|
+
|
|
18
|
+
## Running unit tests
|
|
19
|
+
|
|
20
|
+
Run `ng test sharedcomponents` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
+
|
|
22
|
+
## Further help
|
|
23
|
+
|
|
24
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
@@ -3100,15 +3100,19 @@
|
|
|
3100
3100
|
},] }
|
|
3101
3101
|
];
|
|
3102
3102
|
|
|
3103
|
-
var GaugeColor
|
|
3103
|
+
var GaugeColor;
|
|
3104
3104
|
(function (GaugeColor) {
|
|
3105
|
-
GaugeColor["
|
|
3106
|
-
GaugeColor["
|
|
3107
|
-
GaugeColor["
|
|
3108
|
-
|
|
3105
|
+
GaugeColor["Lowest"] = "#E0E0E0";
|
|
3106
|
+
GaugeColor["Low"] = "#fff7b8";
|
|
3107
|
+
GaugeColor["MediumLow"] = "#ffe367";
|
|
3108
|
+
GaugeColor["MediumHigh"] = "#ffc15b";
|
|
3109
|
+
GaugeColor["High"] = "#F88952";
|
|
3110
|
+
GaugeColor["Highest"] = "#5FDCB3";
|
|
3111
|
+
})(GaugeColor || (GaugeColor = {}));
|
|
3112
|
+
|
|
3109
3113
|
var CoCircularGaugeComponent = /** @class */ (function () {
|
|
3110
3114
|
function CoCircularGaugeComponent() {
|
|
3111
|
-
this._color = GaugeColor
|
|
3115
|
+
this._color = GaugeColor.Low;
|
|
3112
3116
|
this.majorTicks = {
|
|
3113
3117
|
height: 0,
|
|
3114
3118
|
};
|
|
@@ -3189,25 +3193,33 @@
|
|
|
3189
3193
|
};
|
|
3190
3194
|
;
|
|
3191
3195
|
CoCircularGaugeComponent.prototype.getAnnotations = function () {
|
|
3192
|
-
if (this.value) {
|
|
3196
|
+
if (this.value !== undefined) {
|
|
3197
|
+
var label = this.value ? this.value + "%" : "0%";
|
|
3193
3198
|
return [{
|
|
3194
|
-
content: '<div class="annotation">' +
|
|
3195
|
-
|
|
3196
|
-
angle: 90,
|
|
3197
|
-
radius: '50%',
|
|
3199
|
+
content: '<div class="annotation" style="width:20px;height:20px;">' +
|
|
3200
|
+
'<div class="annotation-label">' + label + '</div></div>',
|
|
3198
3201
|
zIndex: '10',
|
|
3199
3202
|
}];
|
|
3200
3203
|
}
|
|
3201
3204
|
};
|
|
3202
3205
|
CoCircularGaugeComponent.prototype._setColor = function () {
|
|
3203
3206
|
if (this.value == 0) {
|
|
3204
|
-
this._color = GaugeColor
|
|
3207
|
+
this._color = GaugeColor.Lowest;
|
|
3208
|
+
}
|
|
3209
|
+
else if (this.value >= 1 && this.value < 25) {
|
|
3210
|
+
this._color = GaugeColor.Low;
|
|
3211
|
+
}
|
|
3212
|
+
else if (this.value >= 25 && this.value < 50) {
|
|
3213
|
+
this._color = GaugeColor.MediumLow;
|
|
3205
3214
|
}
|
|
3206
|
-
else if (this.value >=
|
|
3207
|
-
this._color = GaugeColor
|
|
3215
|
+
else if (this.value >= 50 && this.value < 75) {
|
|
3216
|
+
this._color = GaugeColor.MediumHigh;
|
|
3217
|
+
}
|
|
3218
|
+
else if (this.value >= 75 && this.value < 100) {
|
|
3219
|
+
this._color = GaugeColor.High;
|
|
3208
3220
|
}
|
|
3209
3221
|
else if (this.value == 100) {
|
|
3210
|
-
this._color = GaugeColor
|
|
3222
|
+
this._color = GaugeColor.Highest;
|
|
3211
3223
|
}
|
|
3212
3224
|
};
|
|
3213
3225
|
return CoCircularGaugeComponent;
|
|
@@ -3245,12 +3257,6 @@
|
|
|
3245
3257
|
},] }
|
|
3246
3258
|
];
|
|
3247
3259
|
|
|
3248
|
-
var GaugeColor;
|
|
3249
|
-
(function (GaugeColor) {
|
|
3250
|
-
GaugeColor["Low"] = "#E0E0E0";
|
|
3251
|
-
GaugeColor["Medium"] = "#F88952";
|
|
3252
|
-
GaugeColor["High"] = "#5FDCB3";
|
|
3253
|
-
})(GaugeColor || (GaugeColor = {}));
|
|
3254
3260
|
var CoLinearGaugeComponent = /** @class */ (function () {
|
|
3255
3261
|
function CoLinearGaugeComponent() {
|
|
3256
3262
|
this.color = GaugeColor.Low;
|
|
@@ -3274,14 +3280,23 @@
|
|
|
3274
3280
|
};
|
|
3275
3281
|
CoLinearGaugeComponent.prototype._setColor = function () {
|
|
3276
3282
|
if (this.value == 0) {
|
|
3283
|
+
this.color = GaugeColor.Lowest;
|
|
3284
|
+
}
|
|
3285
|
+
else if (this.value >= 1 && this.value < 25) {
|
|
3277
3286
|
this.color = GaugeColor.Low;
|
|
3278
3287
|
}
|
|
3279
|
-
else if (this.value >=
|
|
3280
|
-
this.color = GaugeColor.
|
|
3288
|
+
else if (this.value >= 25 && this.value < 50) {
|
|
3289
|
+
this.color = GaugeColor.MediumLow;
|
|
3281
3290
|
}
|
|
3282
|
-
else if (this.value
|
|
3291
|
+
else if (this.value >= 50 && this.value < 75) {
|
|
3292
|
+
this.color = GaugeColor.MediumHigh;
|
|
3293
|
+
}
|
|
3294
|
+
else if (this.value >= 75 && this.value < 100) {
|
|
3283
3295
|
this.color = GaugeColor.High;
|
|
3284
3296
|
}
|
|
3297
|
+
else if (this.value == 100) {
|
|
3298
|
+
this.color = GaugeColor.Highest;
|
|
3299
|
+
}
|
|
3285
3300
|
};
|
|
3286
3301
|
return CoLinearGaugeComponent;
|
|
3287
3302
|
}());
|
|
@@ -3329,6 +3344,7 @@
|
|
|
3329
3344
|
},
|
|
3330
3345
|
set: function (value) {
|
|
3331
3346
|
this._statusbarData = value;
|
|
3347
|
+
this.adjustTooHighPercentages();
|
|
3332
3348
|
},
|
|
3333
3349
|
enumerable: false,
|
|
3334
3350
|
configurable: true
|
|
@@ -3336,17 +3352,13 @@
|
|
|
3336
3352
|
StatusbarComponent.prototype.showClass = function () {
|
|
3337
3353
|
return true;
|
|
3338
3354
|
};
|
|
3339
|
-
StatusbarComponent.prototype.
|
|
3340
|
-
this.showPopup =
|
|
3341
|
-
this.
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
this.showPopup = false;
|
|
3347
|
-
};
|
|
3348
|
-
StatusbarComponent.prototype.onStatusbarClick = function () {
|
|
3349
|
-
this.statusbarClick.emit();
|
|
3355
|
+
StatusbarComponent.prototype.onStatusbarClick = function (event) {
|
|
3356
|
+
this.showPopup = !this.showPopup;
|
|
3357
|
+
if (this.showPopup) {
|
|
3358
|
+
this._mouseY = event.screenY;
|
|
3359
|
+
this._windowHeight = window.innerHeight;
|
|
3360
|
+
this.setPopupClass();
|
|
3361
|
+
}
|
|
3350
3362
|
};
|
|
3351
3363
|
StatusbarComponent.prototype.setPopupClass = function () {
|
|
3352
3364
|
var popupHeight = this.statusbarData.length * 30;
|
|
@@ -3358,12 +3370,15 @@
|
|
|
3358
3370
|
this.popupClass = 'dropup';
|
|
3359
3371
|
}
|
|
3360
3372
|
};
|
|
3373
|
+
StatusbarComponent.prototype.adjustTooHighPercentages = function () {
|
|
3374
|
+
this._statusbarData.forEach(function (data) { return data.percentage > 100 ? data.percentage = 100 : false; });
|
|
3375
|
+
};
|
|
3361
3376
|
return StatusbarComponent;
|
|
3362
3377
|
}());
|
|
3363
3378
|
StatusbarComponent.decorators = [
|
|
3364
3379
|
{ type: i0.Component, args: [{
|
|
3365
3380
|
selector: "co-statusbar",
|
|
3366
|
-
template: "\n <div class=\"co-statusbar-wrapper\"\n *ngIf=\"statusbarData\"\n (
|
|
3381
|
+
template: "\n <div class=\"co-statusbar-wrapper\"\n *ngIf=\"statusbarData\"\n (click)=\"onStatusbarClick($event)\">\n <div class=\"statuses\">\n <div *ngFor=\"let data of statusbarData; let index = index\" class=\"status\">\n <co-linear-gauge [class.focused-status]=\"focusedStatusIndex !== undefined && focusedStatusIndex === index\"\n [value]=\"data.percentage\" [count]=\"data.count ? data.count : undefined\"></co-linear-gauge>\n </div>\n </div>\n <div class=status-description-popup *ngIf=\"showPopup\" @showHidePopup [ngClass]=\"popupClass\" clickOutside (clickOutside)=\"showPopup=false\">\n <div class=\"status-descriptions\">\n <div *ngFor=\"let data of statusbarData; let index = index\" class=\"status-description\">\n <co-circular-gauge [value]=\"data.percentage\"></co-circular-gauge>\n <span [textContent]=\"data.label\"></span>\n </div>\n </div>\n </div>\n </div>\n ",
|
|
3367
3382
|
animations: [
|
|
3368
3383
|
animations.trigger("showHidePopup", [
|
|
3369
3384
|
animations.state("void", animations.style({ opacity: 0 })),
|
|
@@ -3392,7 +3407,8 @@
|
|
|
3392
3407
|
imports: [
|
|
3393
3408
|
common.CommonModule,
|
|
3394
3409
|
CoCircularGaugeModule,
|
|
3395
|
-
CoLinearGaugeModule
|
|
3410
|
+
CoLinearGaugeModule,
|
|
3411
|
+
corecomponents_v12.ClickoutsideModule
|
|
3396
3412
|
],
|
|
3397
3413
|
declarations: [
|
|
3398
3414
|
StatusbarComponent
|