@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
|
@@ -24,7 +24,7 @@ import { SendMethod as SendMethod$1 } from '@colijnit/mainapi/build/model/send-m
|
|
|
24
24
|
import { PrintStockStickers } from '@colijnit/sharedapi/build/model/print-stock-stickers';
|
|
25
25
|
import { GetStockHistoryRequest } from '@colijnit/articleapi/build/model/get-stock-history-request';
|
|
26
26
|
import { ArticleStock as ArticleStock$1 } from '@colijnit/articleapi/build/model/article-stock';
|
|
27
|
-
import { InputCheckboxModule, IconModule, CoDialogModule, ButtonModule, InputComboBoxModule, CoGridModule, InputRadioButtonModule, DropDownModule, SimpleGridModule, ImageModule, InputTextModule, InputNumberPickerModule, CoDialogWizardModule, InputTextareaModule, InputDatePickerModule } from '@colijnit/corecomponents_v12';
|
|
27
|
+
import { InputCheckboxModule, IconModule, CoDialogModule, ButtonModule, InputComboBoxModule, CoGridModule, InputRadioButtonModule, DropDownModule, SimpleGridModule, ImageModule, InputTextModule, InputNumberPickerModule, CoDialogWizardModule, InputTextareaModule, ClickoutsideModule, InputDatePickerModule } from '@colijnit/corecomponents_v12';
|
|
28
28
|
import * as i1 from '@angular/platform-browser';
|
|
29
29
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
30
30
|
import { ArticleStockManagement } from '@colijnit/articleapi/build/model/article-stock-management';
|
|
@@ -2963,15 +2963,19 @@ LayoutSwitcherModule.decorators = [
|
|
|
2963
2963
|
},] }
|
|
2964
2964
|
];
|
|
2965
2965
|
|
|
2966
|
-
var GaugeColor
|
|
2966
|
+
var GaugeColor;
|
|
2967
2967
|
(function (GaugeColor) {
|
|
2968
|
-
GaugeColor["
|
|
2969
|
-
GaugeColor["
|
|
2970
|
-
GaugeColor["
|
|
2971
|
-
|
|
2968
|
+
GaugeColor["Lowest"] = "#E0E0E0";
|
|
2969
|
+
GaugeColor["Low"] = "#fff7b8";
|
|
2970
|
+
GaugeColor["MediumLow"] = "#ffe367";
|
|
2971
|
+
GaugeColor["MediumHigh"] = "#ffc15b";
|
|
2972
|
+
GaugeColor["High"] = "#F88952";
|
|
2973
|
+
GaugeColor["Highest"] = "#5FDCB3";
|
|
2974
|
+
})(GaugeColor || (GaugeColor = {}));
|
|
2975
|
+
|
|
2972
2976
|
class CoCircularGaugeComponent {
|
|
2973
2977
|
constructor() {
|
|
2974
|
-
this._color = GaugeColor
|
|
2978
|
+
this._color = GaugeColor.Low;
|
|
2975
2979
|
this.majorTicks = {
|
|
2976
2980
|
height: 0,
|
|
2977
2981
|
};
|
|
@@ -3044,25 +3048,33 @@ class CoCircularGaugeComponent {
|
|
|
3044
3048
|
}
|
|
3045
3049
|
;
|
|
3046
3050
|
getAnnotations() {
|
|
3047
|
-
if (this.value) {
|
|
3051
|
+
if (this.value !== undefined) {
|
|
3052
|
+
const label = this.value ? this.value + "%" : "0%";
|
|
3048
3053
|
return [{
|
|
3049
|
-
content: '<div class="annotation">' +
|
|
3050
|
-
|
|
3051
|
-
angle: 90,
|
|
3052
|
-
radius: '50%',
|
|
3054
|
+
content: '<div class="annotation" style="width:20px;height:20px;">' +
|
|
3055
|
+
'<div class="annotation-label">' + label + '</div></div>',
|
|
3053
3056
|
zIndex: '10',
|
|
3054
3057
|
}];
|
|
3055
3058
|
}
|
|
3056
3059
|
}
|
|
3057
3060
|
_setColor() {
|
|
3058
3061
|
if (this.value == 0) {
|
|
3059
|
-
this._color = GaugeColor
|
|
3062
|
+
this._color = GaugeColor.Lowest;
|
|
3063
|
+
}
|
|
3064
|
+
else if (this.value >= 1 && this.value < 25) {
|
|
3065
|
+
this._color = GaugeColor.Low;
|
|
3066
|
+
}
|
|
3067
|
+
else if (this.value >= 25 && this.value < 50) {
|
|
3068
|
+
this._color = GaugeColor.MediumLow;
|
|
3060
3069
|
}
|
|
3061
|
-
else if (this.value >=
|
|
3062
|
-
this._color = GaugeColor
|
|
3070
|
+
else if (this.value >= 50 && this.value < 75) {
|
|
3071
|
+
this._color = GaugeColor.MediumHigh;
|
|
3072
|
+
}
|
|
3073
|
+
else if (this.value >= 75 && this.value < 100) {
|
|
3074
|
+
this._color = GaugeColor.High;
|
|
3063
3075
|
}
|
|
3064
3076
|
else if (this.value == 100) {
|
|
3065
|
-
this._color = GaugeColor
|
|
3077
|
+
this._color = GaugeColor.Highest;
|
|
3066
3078
|
}
|
|
3067
3079
|
}
|
|
3068
3080
|
}
|
|
@@ -3104,12 +3116,6 @@ CoCircularGaugeModule.decorators = [
|
|
|
3104
3116
|
},] }
|
|
3105
3117
|
];
|
|
3106
3118
|
|
|
3107
|
-
var GaugeColor;
|
|
3108
|
-
(function (GaugeColor) {
|
|
3109
|
-
GaugeColor["Low"] = "#E0E0E0";
|
|
3110
|
-
GaugeColor["Medium"] = "#F88952";
|
|
3111
|
-
GaugeColor["High"] = "#5FDCB3";
|
|
3112
|
-
})(GaugeColor || (GaugeColor = {}));
|
|
3113
3119
|
class CoLinearGaugeComponent {
|
|
3114
3120
|
constructor() {
|
|
3115
3121
|
this.color = GaugeColor.Low;
|
|
@@ -3129,14 +3135,23 @@ class CoLinearGaugeComponent {
|
|
|
3129
3135
|
}
|
|
3130
3136
|
_setColor() {
|
|
3131
3137
|
if (this.value == 0) {
|
|
3138
|
+
this.color = GaugeColor.Lowest;
|
|
3139
|
+
}
|
|
3140
|
+
else if (this.value >= 1 && this.value < 25) {
|
|
3132
3141
|
this.color = GaugeColor.Low;
|
|
3133
3142
|
}
|
|
3134
|
-
else if (this.value >=
|
|
3135
|
-
this.color = GaugeColor.
|
|
3143
|
+
else if (this.value >= 25 && this.value < 50) {
|
|
3144
|
+
this.color = GaugeColor.MediumLow;
|
|
3136
3145
|
}
|
|
3137
|
-
else if (this.value
|
|
3146
|
+
else if (this.value >= 50 && this.value < 75) {
|
|
3147
|
+
this.color = GaugeColor.MediumHigh;
|
|
3148
|
+
}
|
|
3149
|
+
else if (this.value >= 75 && this.value < 100) {
|
|
3138
3150
|
this.color = GaugeColor.High;
|
|
3139
3151
|
}
|
|
3152
|
+
else if (this.value == 100) {
|
|
3153
|
+
this.color = GaugeColor.Highest;
|
|
3154
|
+
}
|
|
3140
3155
|
}
|
|
3141
3156
|
}
|
|
3142
3157
|
CoLinearGaugeComponent.decorators = [
|
|
@@ -3182,6 +3197,7 @@ class StatusbarComponent {
|
|
|
3182
3197
|
}
|
|
3183
3198
|
set statusbarData(value) {
|
|
3184
3199
|
this._statusbarData = value;
|
|
3200
|
+
this.adjustTooHighPercentages();
|
|
3185
3201
|
}
|
|
3186
3202
|
get statusbarData() {
|
|
3187
3203
|
return this._statusbarData;
|
|
@@ -3189,17 +3205,13 @@ class StatusbarComponent {
|
|
|
3189
3205
|
showClass() {
|
|
3190
3206
|
return true;
|
|
3191
3207
|
}
|
|
3192
|
-
|
|
3193
|
-
this.showPopup =
|
|
3194
|
-
this.
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
this.showPopup = false;
|
|
3200
|
-
}
|
|
3201
|
-
onStatusbarClick() {
|
|
3202
|
-
this.statusbarClick.emit();
|
|
3208
|
+
onStatusbarClick(event) {
|
|
3209
|
+
this.showPopup = !this.showPopup;
|
|
3210
|
+
if (this.showPopup) {
|
|
3211
|
+
this._mouseY = event.screenY;
|
|
3212
|
+
this._windowHeight = window.innerHeight;
|
|
3213
|
+
this.setPopupClass();
|
|
3214
|
+
}
|
|
3203
3215
|
}
|
|
3204
3216
|
setPopupClass() {
|
|
3205
3217
|
const popupHeight = this.statusbarData.length * 30;
|
|
@@ -3211,6 +3223,9 @@ class StatusbarComponent {
|
|
|
3211
3223
|
this.popupClass = 'dropup';
|
|
3212
3224
|
}
|
|
3213
3225
|
}
|
|
3226
|
+
adjustTooHighPercentages() {
|
|
3227
|
+
this._statusbarData.forEach(data => data.percentage > 100 ? data.percentage = 100 : false);
|
|
3228
|
+
}
|
|
3214
3229
|
}
|
|
3215
3230
|
StatusbarComponent.decorators = [
|
|
3216
3231
|
{ type: Component, args: [{
|
|
@@ -3218,16 +3233,14 @@ StatusbarComponent.decorators = [
|
|
|
3218
3233
|
template: `
|
|
3219
3234
|
<div class="co-statusbar-wrapper"
|
|
3220
3235
|
*ngIf="statusbarData"
|
|
3221
|
-
(
|
|
3222
|
-
(mouseleave)="onLeave()"
|
|
3223
|
-
(click)="onStatusbarClick()">
|
|
3236
|
+
(click)="onStatusbarClick($event)">
|
|
3224
3237
|
<div class="statuses">
|
|
3225
3238
|
<div *ngFor="let data of statusbarData; let index = index" class="status">
|
|
3226
3239
|
<co-linear-gauge [class.focused-status]="focusedStatusIndex !== undefined && focusedStatusIndex === index"
|
|
3227
3240
|
[value]="data.percentage" [count]="data.count ? data.count : undefined"></co-linear-gauge>
|
|
3228
3241
|
</div>
|
|
3229
3242
|
</div>
|
|
3230
|
-
<div class=status-description-popup *ngIf="showPopup" @showHidePopup [ngClass]="popupClass">
|
|
3243
|
+
<div class=status-description-popup *ngIf="showPopup" @showHidePopup [ngClass]="popupClass" clickOutside (clickOutside)="showPopup=false">
|
|
3231
3244
|
<div class="status-descriptions">
|
|
3232
3245
|
<div *ngFor="let data of statusbarData; let index = index" class="status-description">
|
|
3233
3246
|
<co-circular-gauge [value]="data.percentage"></co-circular-gauge>
|
|
@@ -3262,7 +3275,8 @@ StatusbarModule.decorators = [
|
|
|
3262
3275
|
imports: [
|
|
3263
3276
|
CommonModule,
|
|
3264
3277
|
CoCircularGaugeModule,
|
|
3265
|
-
CoLinearGaugeModule
|
|
3278
|
+
CoLinearGaugeModule,
|
|
3279
|
+
ClickoutsideModule
|
|
3266
3280
|
],
|
|
3267
3281
|
declarations: [
|
|
3268
3282
|
StatusbarComponent
|