@progress/kendo-angular-progressbar 2.0.4 → 3.0.0-dev.202204131905
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/kendo-angular-progressbar.umd.js +5 -0
- package/{dist/es2015/chunk → chunk}/chunk-progressbar.component.d.ts +6 -3
- package/{dist/es2015/common → common}/constants.d.ts +0 -0
- package/{dist/es2015/common → common}/progressbar-base.d.ts +19 -16
- package/{dist/es2015/common → common}/util.d.ts +0 -0
- package/{dist/es2015 → esm2015}/chunk/chunk-progressbar.component.js +51 -39
- package/{dist/es2015 → esm2015}/common/constants.js +0 -0
- package/{dist/es2015 → esm2015}/common/progressbar-base.js +61 -84
- package/{dist/es2015 → esm2015}/common/util.js +0 -3
- package/{dist/es2015/index.d.ts → esm2015/kendo-angular-progressbar.js} +0 -1
- package/{dist/es → esm2015}/main.js +0 -0
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/{dist/es2015 → esm2015}/progressbar.component.js +79 -58
- package/{dist/es2015 → esm2015}/progressbar.module.js +14 -11
- package/{dist/es2015 → esm2015}/types/animation-end-event.js +1 -0
- package/{dist/es2015 → esm2015}/types/animation-options.interface.js +1 -0
- package/{dist/es2015 → esm2015}/types/label-fn-type.js +1 -0
- package/{dist/es → esm2015}/types/label-position.js +1 -0
- package/{dist/es → esm2015}/types/label-settings.interface.js +1 -0
- package/{dist/es → esm2015}/types/label-type.js +1 -0
- package/{dist/es → esm2015}/types/progressbar-animation.interface.js +1 -0
- package/{dist/es → esm2015}/types/progressbar-orientation.js +1 -0
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-progressbar.js} +201 -187
- package/{dist/es/index.js → kendo-angular-progressbar.d.ts} +1 -1
- package/{dist/es2015/main.d.ts → main.d.ts} +0 -0
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +34 -104
- package/{dist/es2015/progressbar.component.d.ts → progressbar.component.d.ts} +10 -7
- package/{dist/es2015/progressbar.module.d.ts → progressbar.module.d.ts} +7 -0
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/{dist/es2015/types → types}/animation-end-event.d.ts +0 -0
- package/{dist/es2015/types → types}/animation-options.interface.d.ts +0 -0
- package/{dist/es2015/types → types}/label-fn-type.d.ts +0 -0
- package/{dist/es2015/types → types}/label-position.d.ts +0 -0
- package/{dist/es2015/types → types}/label-settings.interface.d.ts +0 -0
- package/{dist/es2015/types → types}/label-type.d.ts +0 -0
- package/{dist/es2015/types → types}/progressbar-animation.interface.d.ts +0 -0
- package/{dist/es2015/types → types}/progressbar-orientation.d.ts +0 -0
- package/dist/cdn/js/kendo-angular-progressbar.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/chunk/chunk-progressbar.component.js +0 -129
- package/dist/es/common/constants.js +0 -16
- package/dist/es/common/progressbar-base.js +0 -305
- package/dist/es/common/util.js +0 -86
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/progressbar.component.js +0 -304
- package/dist/es/progressbar.module.js +0 -55
- package/dist/es/types/animation-end-event.js +0 -4
- package/dist/es/types/animation-options.interface.js +0 -4
- package/dist/es/types/label-fn-type.js +0 -4
- package/dist/es2015/index.js +0 -9
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/main.js +0 -7
- package/dist/es2015/types/label-position.js +0 -4
- package/dist/es2015/types/label-settings.interface.js +0 -4
- package/dist/es2015/types/label-type.js +0 -4
- package/dist/es2015/types/progressbar-animation.interface.js +0 -4
- package/dist/es2015/types/progressbar-orientation.js +0 -4
- package/dist/fesm5/index.js +0 -875
- package/dist/npm/chunk/chunk-progressbar.component.js +0 -131
- package/dist/npm/common/constants.js +0 -18
- package/dist/npm/common/progressbar-base.js +0 -307
- package/dist/npm/common/util.js +0 -89
- package/dist/npm/index.js +0 -13
- package/dist/npm/main.js +0 -12
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/progressbar.component.js +0 -306
- package/dist/npm/progressbar.module.js +0 -57
- package/dist/npm/types/animation-end-event.js +0 -6
- package/dist/npm/types/animation-options.interface.js +0 -6
- package/dist/npm/types/label-fn-type.js +0 -6
- package/dist/npm/types/label-position.js +0 -6
- package/dist/npm/types/label-settings.interface.js +0 -6
- package/dist/npm/types/label-type.js +0 -6
- package/dist/npm/types/progressbar-animation.interface.js +0 -6
- package/dist/npm/types/progressbar-orientation.js +0 -6
- package/dist/systemjs/kendo-angular-progressbar.js +0 -5
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var tslib_1 = require("tslib");
|
|
8
|
-
var progressbar_base_1 = require("../common/progressbar-base");
|
|
9
|
-
var core_1 = require("@angular/core");
|
|
10
|
-
var util_1 = require("../common/util");
|
|
11
|
-
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
12
|
-
/**
|
|
13
|
-
* Represents the [Kendo UI ChunkProgressBar component for Angular]({% slug overview_chunkprogressbar %}).
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts-preview
|
|
17
|
-
* _@Component({
|
|
18
|
-
* selector: 'my-app',
|
|
19
|
-
* template: `
|
|
20
|
-
* <kendo-chunkprogressbar [value]="value">
|
|
21
|
-
* </kendo-chunkprogressbar>
|
|
22
|
-
* `
|
|
23
|
-
* })
|
|
24
|
-
* class AppComponent {
|
|
25
|
-
* public value = 40;
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
var ChunkProgressBarComponent = /** @class */ (function (_super) {
|
|
30
|
-
tslib_1.__extends(ChunkProgressBarComponent, _super);
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
function ChunkProgressBarComponent(localization) {
|
|
35
|
-
var _this = _super.call(this, localization) || this;
|
|
36
|
-
_this.localization = localization;
|
|
37
|
-
/**
|
|
38
|
-
* Sets the number of chunks into which the ChunkProgressBar will be split.
|
|
39
|
-
* Defaults to `5`.
|
|
40
|
-
*/
|
|
41
|
-
_this.chunkCount = 5;
|
|
42
|
-
_this._orientationStyles = {
|
|
43
|
-
width: _this.chunkSizePercentage + "%"
|
|
44
|
-
};
|
|
45
|
-
return _this;
|
|
46
|
-
}
|
|
47
|
-
Object.defineProperty(ChunkProgressBarComponent.prototype, "chunks", {
|
|
48
|
-
/**
|
|
49
|
-
* @hidden
|
|
50
|
-
*/
|
|
51
|
-
get: function () {
|
|
52
|
-
var count = this.chunkCount;
|
|
53
|
-
var chunks = Array(count).fill(false);
|
|
54
|
-
var completedChunks = Math.floor(this._progressRatio * count);
|
|
55
|
-
for (var i = 0; i < completedChunks; i++) {
|
|
56
|
-
chunks[i] = true;
|
|
57
|
-
}
|
|
58
|
-
if (util_1.reverseChunks(this.orientation, this.reverse)) {
|
|
59
|
-
chunks.reverse();
|
|
60
|
-
}
|
|
61
|
-
return chunks;
|
|
62
|
-
},
|
|
63
|
-
enumerable: true,
|
|
64
|
-
configurable: true
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(ChunkProgressBarComponent.prototype, "chunkSizePercentage", {
|
|
67
|
-
/**
|
|
68
|
-
* @hidden
|
|
69
|
-
*/
|
|
70
|
-
get: function () {
|
|
71
|
-
return 100 / this.chunkCount;
|
|
72
|
-
},
|
|
73
|
-
enumerable: true,
|
|
74
|
-
configurable: true
|
|
75
|
-
});
|
|
76
|
-
Object.defineProperty(ChunkProgressBarComponent.prototype, "orientationStyles", {
|
|
77
|
-
/**
|
|
78
|
-
* @hidden
|
|
79
|
-
*/
|
|
80
|
-
get: function () {
|
|
81
|
-
if (this.orientation === 'horizontal') {
|
|
82
|
-
this._orientationStyles.width = this.chunkSizePercentage + "%";
|
|
83
|
-
this._orientationStyles.height = undefined;
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
this._orientationStyles.height = this.chunkSizePercentage + "%";
|
|
87
|
-
this._orientationStyles.width = undefined;
|
|
88
|
-
}
|
|
89
|
-
return this._orientationStyles;
|
|
90
|
-
},
|
|
91
|
-
enumerable: true,
|
|
92
|
-
configurable: true
|
|
93
|
-
});
|
|
94
|
-
tslib_1.__decorate([
|
|
95
|
-
core_1.Input(),
|
|
96
|
-
tslib_1.__metadata("design:type", Number)
|
|
97
|
-
], ChunkProgressBarComponent.prototype, "chunkCount", void 0);
|
|
98
|
-
tslib_1.__decorate([
|
|
99
|
-
core_1.Input(),
|
|
100
|
-
tslib_1.__metadata("design:type", Object)
|
|
101
|
-
], ChunkProgressBarComponent.prototype, "progressCssStyle", void 0);
|
|
102
|
-
tslib_1.__decorate([
|
|
103
|
-
core_1.Input(),
|
|
104
|
-
tslib_1.__metadata("design:type", Object)
|
|
105
|
-
], ChunkProgressBarComponent.prototype, "progressCssClass", void 0);
|
|
106
|
-
tslib_1.__decorate([
|
|
107
|
-
core_1.Input(),
|
|
108
|
-
tslib_1.__metadata("design:type", Object)
|
|
109
|
-
], ChunkProgressBarComponent.prototype, "emptyCssStyle", void 0);
|
|
110
|
-
tslib_1.__decorate([
|
|
111
|
-
core_1.Input(),
|
|
112
|
-
tslib_1.__metadata("design:type", Object)
|
|
113
|
-
], ChunkProgressBarComponent.prototype, "emptyCssClass", void 0);
|
|
114
|
-
ChunkProgressBarComponent = tslib_1.__decorate([
|
|
115
|
-
core_1.Component({
|
|
116
|
-
exportAs: 'kendoChunkProgressBar',
|
|
117
|
-
selector: 'kendo-chunkprogressbar',
|
|
118
|
-
template: "\n <ul class=\"k-reset\">\n <li class=\"k-item\" *ngFor=\"let chunk of chunks; let i = index;\"\n [class.k-first]=\"i === 0\"\n [class.k-last]=\"i === chunkCount - 1\"\n [class.k-state-selected]=\"chunk\"\n [ngClass]=\"chunk ? progressCssClass : emptyCssClass\"\n [ngStyle]=\"chunk ? progressCssStyle : emptyCssStyle\"\n [style.width]=\"orientationStyles.width\"\n [style.height]=\"orientationStyles.height\"\n >\n </li>\n </ul>\n ",
|
|
119
|
-
providers: [
|
|
120
|
-
kendo_angular_l10n_1.LocalizationService,
|
|
121
|
-
{
|
|
122
|
-
provide: kendo_angular_l10n_1.L10N_PREFIX,
|
|
123
|
-
useValue: 'kendo.chunkprogressbar'
|
|
124
|
-
}
|
|
125
|
-
]
|
|
126
|
-
}),
|
|
127
|
-
tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService])
|
|
128
|
-
], ChunkProgressBarComponent);
|
|
129
|
-
return ChunkProgressBarComponent;
|
|
130
|
-
}(progressbar_base_1.ProgressBarBase));
|
|
131
|
-
exports.ChunkProgressBarComponent = ChunkProgressBarComponent;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
exports.MIN_MAX_ERROR_MESSAGE = "The max value should be greater than the min.";
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
exports.LABEL_DECIMALS = 3;
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
exports.MIN_RATIO = 0.0001;
|
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var tslib_1 = require("tslib");
|
|
8
|
-
var core_1 = require("@angular/core");
|
|
9
|
-
var kendo_licensing_1 = require("@progress/kendo-licensing");
|
|
10
|
-
var package_metadata_1 = require("../package-metadata");
|
|
11
|
-
var util_1 = require("./util");
|
|
12
|
-
/**
|
|
13
|
-
* @hidden
|
|
14
|
-
*/
|
|
15
|
-
var ProgressBarBase = /** @class */ (function () {
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
function ProgressBarBase(localization) {
|
|
20
|
-
var _this = this;
|
|
21
|
-
this.localization = localization;
|
|
22
|
-
this.widgetClasses = true;
|
|
23
|
-
this.roleAttribute = 'progressbar';
|
|
24
|
-
/**
|
|
25
|
-
* The maximum value of the ProgressBar.
|
|
26
|
-
* Defaults to `100`.
|
|
27
|
-
*/
|
|
28
|
-
this.max = 100;
|
|
29
|
-
/**
|
|
30
|
-
* The minimum value of the ProgressBar.
|
|
31
|
-
* Defaults to `0`.
|
|
32
|
-
*/
|
|
33
|
-
this.min = 0;
|
|
34
|
-
/**
|
|
35
|
-
* The value of the ProgressBar.
|
|
36
|
-
* Has to be between `min` and `max`.
|
|
37
|
-
* By default, the value is equal to the `min` value.
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* The value of the ProgressBar.
|
|
41
|
-
* Has to be between `min` and `max`.
|
|
42
|
-
* Defaults to `0`.
|
|
43
|
-
*/
|
|
44
|
-
this.value = 0;
|
|
45
|
-
/**
|
|
46
|
-
* Defines the orientation of the ProgressBar
|
|
47
|
-
* ([see example]({% slug progressbar_orientation %})).
|
|
48
|
-
* Defaults to `horizontal`.
|
|
49
|
-
*/
|
|
50
|
-
this.orientation = 'horizontal';
|
|
51
|
-
/**
|
|
52
|
-
* If set to `true`, the ProgressBar will be disabled
|
|
53
|
-
* ([see example]({% slug progressbar_disabled %})).
|
|
54
|
-
* It will still allow you to change its value.
|
|
55
|
-
* Defaults to `false`.
|
|
56
|
-
*/
|
|
57
|
-
this.disabled = false;
|
|
58
|
-
/**
|
|
59
|
-
* If set to `true`, the ProgressBar will be reversed
|
|
60
|
-
* ([see example]({% slug progressbar_direction %})).
|
|
61
|
-
* Defaults to `false`.
|
|
62
|
-
*/
|
|
63
|
-
this.reverse = false;
|
|
64
|
-
/**
|
|
65
|
-
* Sets the `indeterminate` state of the ProgressBar.
|
|
66
|
-
* Defaults to `false`.
|
|
67
|
-
*/
|
|
68
|
-
this.indeterminate = false;
|
|
69
|
-
this.displayValue = 0;
|
|
70
|
-
this.previousValue = 0;
|
|
71
|
-
kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
|
|
72
|
-
this.localizationChangeSubscription = localization.changes.subscribe(function (_a) {
|
|
73
|
-
var rtl = _a.rtl;
|
|
74
|
-
_this.direction = rtl ? 'rtl' : 'ltr';
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
Object.defineProperty(ProgressBarBase.prototype, "isHorizontal", {
|
|
78
|
-
get: function () {
|
|
79
|
-
return this.orientation === 'horizontal';
|
|
80
|
-
},
|
|
81
|
-
enumerable: true,
|
|
82
|
-
configurable: true
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(ProgressBarBase.prototype, "isVertical", {
|
|
85
|
-
get: function () {
|
|
86
|
-
return this.orientation === 'vertical';
|
|
87
|
-
},
|
|
88
|
-
enumerable: true,
|
|
89
|
-
configurable: true
|
|
90
|
-
});
|
|
91
|
-
Object.defineProperty(ProgressBarBase.prototype, "disabledClass", {
|
|
92
|
-
get: function () {
|
|
93
|
-
return this.disabled;
|
|
94
|
-
},
|
|
95
|
-
enumerable: true,
|
|
96
|
-
configurable: true
|
|
97
|
-
});
|
|
98
|
-
Object.defineProperty(ProgressBarBase.prototype, "reverseClass", {
|
|
99
|
-
get: function () {
|
|
100
|
-
return this.reverse;
|
|
101
|
-
},
|
|
102
|
-
enumerable: true,
|
|
103
|
-
configurable: true
|
|
104
|
-
});
|
|
105
|
-
Object.defineProperty(ProgressBarBase.prototype, "indeterminateClass", {
|
|
106
|
-
get: function () {
|
|
107
|
-
return this.indeterminate;
|
|
108
|
-
},
|
|
109
|
-
enumerable: true,
|
|
110
|
-
configurable: true
|
|
111
|
-
});
|
|
112
|
-
Object.defineProperty(ProgressBarBase.prototype, "dirAttribute", {
|
|
113
|
-
get: function () {
|
|
114
|
-
return this.direction;
|
|
115
|
-
},
|
|
116
|
-
enumerable: true,
|
|
117
|
-
configurable: true
|
|
118
|
-
});
|
|
119
|
-
Object.defineProperty(ProgressBarBase.prototype, "ariaMinAttribute", {
|
|
120
|
-
get: function () {
|
|
121
|
-
return String(this.min);
|
|
122
|
-
},
|
|
123
|
-
enumerable: true,
|
|
124
|
-
configurable: true
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(ProgressBarBase.prototype, "ariaMaxAttribute", {
|
|
127
|
-
get: function () {
|
|
128
|
-
return String(this.max);
|
|
129
|
-
},
|
|
130
|
-
enumerable: true,
|
|
131
|
-
configurable: true
|
|
132
|
-
});
|
|
133
|
-
Object.defineProperty(ProgressBarBase.prototype, "ariaValueAttribute", {
|
|
134
|
-
get: function () {
|
|
135
|
-
return this.indeterminate ? undefined : String(this.displayValue);
|
|
136
|
-
},
|
|
137
|
-
enumerable: true,
|
|
138
|
-
configurable: true
|
|
139
|
-
});
|
|
140
|
-
Object.defineProperty(ProgressBarBase.prototype, "isCompleted", {
|
|
141
|
-
/**
|
|
142
|
-
* @hidden
|
|
143
|
-
*/
|
|
144
|
-
get: function () {
|
|
145
|
-
return this.value === this.max;
|
|
146
|
-
},
|
|
147
|
-
enumerable: true,
|
|
148
|
-
configurable: true
|
|
149
|
-
});
|
|
150
|
-
Object.defineProperty(ProgressBarBase.prototype, "statusWidth", {
|
|
151
|
-
/**
|
|
152
|
-
* @hidden
|
|
153
|
-
*/
|
|
154
|
-
get: function () {
|
|
155
|
-
return this.orientation === 'horizontal' ? this._progressRatio * 100 : 100;
|
|
156
|
-
},
|
|
157
|
-
enumerable: true,
|
|
158
|
-
configurable: true
|
|
159
|
-
});
|
|
160
|
-
Object.defineProperty(ProgressBarBase.prototype, "statusHeight", {
|
|
161
|
-
/**
|
|
162
|
-
* @hidden
|
|
163
|
-
*/
|
|
164
|
-
get: function () {
|
|
165
|
-
return this.orientation === 'vertical' ? this._progressRatio * 100 : 100;
|
|
166
|
-
},
|
|
167
|
-
enumerable: true,
|
|
168
|
-
configurable: true
|
|
169
|
-
});
|
|
170
|
-
Object.defineProperty(ProgressBarBase.prototype, "statusWrapperWidth", {
|
|
171
|
-
/**
|
|
172
|
-
* @hidden
|
|
173
|
-
*/
|
|
174
|
-
get: function () {
|
|
175
|
-
return this.orientation === 'horizontal' ? 100 / this._progressRatio : 100;
|
|
176
|
-
},
|
|
177
|
-
enumerable: true,
|
|
178
|
-
configurable: true
|
|
179
|
-
});
|
|
180
|
-
Object.defineProperty(ProgressBarBase.prototype, "statusWrapperHeight", {
|
|
181
|
-
/**
|
|
182
|
-
* @hidden
|
|
183
|
-
*/
|
|
184
|
-
get: function () {
|
|
185
|
-
return this.orientation === 'vertical' ? 100 / this._progressRatio : 100;
|
|
186
|
-
},
|
|
187
|
-
enumerable: true,
|
|
188
|
-
configurable: true
|
|
189
|
-
});
|
|
190
|
-
Object.defineProperty(ProgressBarBase.prototype, "_progressRatio", {
|
|
191
|
-
get: function () {
|
|
192
|
-
return util_1.calculateRatio(this.min, this.max, this.displayValue);
|
|
193
|
-
},
|
|
194
|
-
enumerable: true,
|
|
195
|
-
configurable: true
|
|
196
|
-
});
|
|
197
|
-
ProgressBarBase.prototype.ngOnChanges = function (changes) {
|
|
198
|
-
var min = util_1.extractValueFromChanges(changes, 'min', this.min);
|
|
199
|
-
var max = util_1.extractValueFromChanges(changes, 'max', this.max);
|
|
200
|
-
var value = util_1.extractValueFromChanges(changes, 'value', this.value);
|
|
201
|
-
if (changes.min || changes.max || changes.value) {
|
|
202
|
-
if (changes.min || changes.max) {
|
|
203
|
-
util_1.validateRange(min, max);
|
|
204
|
-
}
|
|
205
|
-
if (changes.value) {
|
|
206
|
-
if (value == null || Number.isNaN(value)) {
|
|
207
|
-
this.value = min;
|
|
208
|
-
}
|
|
209
|
-
var previousValue = this.displayValue;
|
|
210
|
-
this.displayValue = util_1.adjustValueToRange(this.min, this.max, value);
|
|
211
|
-
this.previousValue = previousValue;
|
|
212
|
-
}
|
|
213
|
-
this.min = min;
|
|
214
|
-
this.max = max;
|
|
215
|
-
this.displayValue = util_1.adjustValueToRange(this.min, this.max, value);
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
ProgressBarBase.prototype.ngOnDestroy = function () {
|
|
219
|
-
if (this.localizationChangeSubscription) {
|
|
220
|
-
this.localizationChangeSubscription.unsubscribe();
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
tslib_1.__decorate([
|
|
224
|
-
core_1.HostBinding('class.k-widget'),
|
|
225
|
-
core_1.HostBinding('class.k-progressbar'),
|
|
226
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
227
|
-
], ProgressBarBase.prototype, "widgetClasses", void 0);
|
|
228
|
-
tslib_1.__decorate([
|
|
229
|
-
core_1.HostBinding('class.k-progressbar-horizontal'),
|
|
230
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
231
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
232
|
-
], ProgressBarBase.prototype, "isHorizontal", null);
|
|
233
|
-
tslib_1.__decorate([
|
|
234
|
-
core_1.HostBinding('class.k-progressbar-vertical'),
|
|
235
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
236
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
237
|
-
], ProgressBarBase.prototype, "isVertical", null);
|
|
238
|
-
tslib_1.__decorate([
|
|
239
|
-
core_1.HostBinding('class.k-state-disabled'),
|
|
240
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
241
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
242
|
-
], ProgressBarBase.prototype, "disabledClass", null);
|
|
243
|
-
tslib_1.__decorate([
|
|
244
|
-
core_1.HostBinding('class.k-progressbar-reverse'),
|
|
245
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
246
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
247
|
-
], ProgressBarBase.prototype, "reverseClass", null);
|
|
248
|
-
tslib_1.__decorate([
|
|
249
|
-
core_1.HostBinding('class.k-progressbar-indeterminate'),
|
|
250
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
251
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
252
|
-
], ProgressBarBase.prototype, "indeterminateClass", null);
|
|
253
|
-
tslib_1.__decorate([
|
|
254
|
-
core_1.HostBinding('attr.dir'),
|
|
255
|
-
tslib_1.__metadata("design:type", String),
|
|
256
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
257
|
-
], ProgressBarBase.prototype, "dirAttribute", null);
|
|
258
|
-
tslib_1.__decorate([
|
|
259
|
-
core_1.HostBinding('attr.role'),
|
|
260
|
-
tslib_1.__metadata("design:type", String)
|
|
261
|
-
], ProgressBarBase.prototype, "roleAttribute", void 0);
|
|
262
|
-
tslib_1.__decorate([
|
|
263
|
-
core_1.HostBinding('attr.aria-valuemin'),
|
|
264
|
-
tslib_1.__metadata("design:type", String),
|
|
265
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
266
|
-
], ProgressBarBase.prototype, "ariaMinAttribute", null);
|
|
267
|
-
tslib_1.__decorate([
|
|
268
|
-
core_1.HostBinding('attr.aria-valuemax'),
|
|
269
|
-
tslib_1.__metadata("design:type", String),
|
|
270
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
271
|
-
], ProgressBarBase.prototype, "ariaMaxAttribute", null);
|
|
272
|
-
tslib_1.__decorate([
|
|
273
|
-
core_1.HostBinding('attr.aria-valuenow'),
|
|
274
|
-
tslib_1.__metadata("design:type", String),
|
|
275
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
276
|
-
], ProgressBarBase.prototype, "ariaValueAttribute", null);
|
|
277
|
-
tslib_1.__decorate([
|
|
278
|
-
core_1.Input(),
|
|
279
|
-
tslib_1.__metadata("design:type", Number)
|
|
280
|
-
], ProgressBarBase.prototype, "max", void 0);
|
|
281
|
-
tslib_1.__decorate([
|
|
282
|
-
core_1.Input(),
|
|
283
|
-
tslib_1.__metadata("design:type", Number)
|
|
284
|
-
], ProgressBarBase.prototype, "min", void 0);
|
|
285
|
-
tslib_1.__decorate([
|
|
286
|
-
core_1.Input(),
|
|
287
|
-
tslib_1.__metadata("design:type", Number)
|
|
288
|
-
], ProgressBarBase.prototype, "value", void 0);
|
|
289
|
-
tslib_1.__decorate([
|
|
290
|
-
core_1.Input(),
|
|
291
|
-
tslib_1.__metadata("design:type", String)
|
|
292
|
-
], ProgressBarBase.prototype, "orientation", void 0);
|
|
293
|
-
tslib_1.__decorate([
|
|
294
|
-
core_1.Input(),
|
|
295
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
296
|
-
], ProgressBarBase.prototype, "disabled", void 0);
|
|
297
|
-
tslib_1.__decorate([
|
|
298
|
-
core_1.Input(),
|
|
299
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
300
|
-
], ProgressBarBase.prototype, "reverse", void 0);
|
|
301
|
-
tslib_1.__decorate([
|
|
302
|
-
core_1.Input(),
|
|
303
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
304
|
-
], ProgressBarBase.prototype, "indeterminate", void 0);
|
|
305
|
-
return ProgressBarBase;
|
|
306
|
-
}());
|
|
307
|
-
exports.ProgressBarBase = ProgressBarBase;
|
package/dist/npm/common/util.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var constants_1 = require("./constants");
|
|
8
|
-
var core_1 = require("@angular/core");
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
exports.reverseChunks = function (orientation, reverse) { return (orientation === 'vertical' && !reverse || orientation === 'horizontal' && reverse); };
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
exports.formatValue = function (value, min, max, label) {
|
|
17
|
-
var defaultFormattedValue = truncateNumber(value);
|
|
18
|
-
if (typeof label !== 'boolean') {
|
|
19
|
-
if (typeof label.format === 'string') {
|
|
20
|
-
switch (label.format) {
|
|
21
|
-
case 'value':
|
|
22
|
-
return defaultFormattedValue;
|
|
23
|
-
case 'percent':
|
|
24
|
-
return Math.floor(calculatePercentage(value, min, max)) + "%";
|
|
25
|
-
default:
|
|
26
|
-
return defaultFormattedValue;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
else if (typeof label.format === 'function') {
|
|
30
|
-
return label.format(value);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return defaultFormattedValue;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return defaultFormattedValue;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* @hidden
|
|
40
|
-
*/
|
|
41
|
-
exports.validateRange = function (min, max) {
|
|
42
|
-
if (core_1.isDevMode && min > max) {
|
|
43
|
-
throw new Error(constants_1.MIN_MAX_ERROR_MESSAGE);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* @hidden
|
|
48
|
-
*/
|
|
49
|
-
exports.adjustValueToRange = function (min, max, value) { return Math.max(Math.min(value, max), min); };
|
|
50
|
-
/**
|
|
51
|
-
* @hidden
|
|
52
|
-
*/
|
|
53
|
-
var calculatePercentage = function (value, min, max) {
|
|
54
|
-
var onePercent = Math.abs((max - min) / 100);
|
|
55
|
-
return Math.abs((value - min) / onePercent);
|
|
56
|
-
};
|
|
57
|
-
var ɵ0 = calculatePercentage;
|
|
58
|
-
exports.ɵ0 = ɵ0;
|
|
59
|
-
/**
|
|
60
|
-
* @hidden
|
|
61
|
-
*/
|
|
62
|
-
var truncateNumber = function (value) {
|
|
63
|
-
var numberParts = value.toString().split('.');
|
|
64
|
-
return numberParts.length === 1 ? "" + numberParts[0] : numberParts[0] + "." + numberParts[1].substr(0, constants_1.LABEL_DECIMALS);
|
|
65
|
-
};
|
|
66
|
-
var ɵ1 = truncateNumber;
|
|
67
|
-
exports.ɵ1 = ɵ1;
|
|
68
|
-
/**
|
|
69
|
-
* @hidden
|
|
70
|
-
*/
|
|
71
|
-
exports.calculateRatio = function (min, max, value) { return Math.max((value - min) / (max - min), constants_1.MIN_RATIO); };
|
|
72
|
-
/**
|
|
73
|
-
* @hidden
|
|
74
|
-
*/
|
|
75
|
-
exports.extractValueFromChanges = function (changes, type, value) {
|
|
76
|
-
return changes[type] && changes[type].currentValue !== undefined ? changes[type].currentValue : value;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* @hidden
|
|
80
|
-
*/
|
|
81
|
-
exports.runAnimation = function (changes, animation, previousValue, displayValue) { return animation && typeof requestAnimationFrame !== 'undefined' && changes.value && previousValue !== displayValue; };
|
|
82
|
-
/**
|
|
83
|
-
* @hidden
|
|
84
|
-
*/
|
|
85
|
-
exports.stopCurrentAnimation = function (changes) {
|
|
86
|
-
var isAnimationChanged = Boolean(changes.animation);
|
|
87
|
-
var hasAnimation = isAnimationChanged && changes.animation.currentValue;
|
|
88
|
-
return isAnimationChanged && !hasAnimation;
|
|
89
|
-
};
|
package/dist/npm/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use strict";
|
|
6
|
-
/**
|
|
7
|
-
* Generated bundle index. Do not edit.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
var tslib_1 = require("tslib");
|
|
11
|
-
tslib_1.__exportStar(require("./main"), exports);
|
|
12
|
-
var progressbar_base_1 = require("./common/progressbar-base");
|
|
13
|
-
exports.ProgressBarBase = progressbar_base_1.ProgressBarBase
|
package/dist/npm/main.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var progressbar_component_1 = require("./progressbar.component");
|
|
8
|
-
exports.ProgressBarComponent = progressbar_component_1.ProgressBarComponent;
|
|
9
|
-
var chunk_progressbar_component_1 = require("./chunk/chunk-progressbar.component");
|
|
10
|
-
exports.ChunkProgressBarComponent = chunk_progressbar_component_1.ChunkProgressBarComponent;
|
|
11
|
-
var progressbar_module_1 = require("./progressbar.module");
|
|
12
|
-
exports.ProgressBarModule = progressbar_module_1.ProgressBarModule;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
exports.packageMetadata = {
|
|
11
|
-
name: '@progress/kendo-angular-progressbar',
|
|
12
|
-
productName: 'Kendo UI for Angular',
|
|
13
|
-
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
14
|
-
publishDate: 1646219371,
|
|
15
|
-
version: '',
|
|
16
|
-
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
17
|
-
};
|