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