@progress/kendo-angular-progressbar 3.0.0 → 3.1.0-dev.202207260903
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 +1 -1
- package/circularprogressbar/center-template.directive.d.ts +15 -0
- package/circularprogressbar/circular-progressbar.component.d.ts +113 -0
- package/circularprogressbar/models/center-template-context.interface.d.ts +17 -0
- package/circularprogressbar/models/circular-progressbar-progress-color-interface.d.ts +21 -0
- package/common/util.d.ts +9 -1
- package/esm2015/circularprogressbar/center-template.directive.js +22 -0
- package/esm2015/circularprogressbar/circular-progressbar.component.js +414 -0
- package/esm2015/circularprogressbar/models/center-template-context.interface.js +5 -0
- package/esm2015/circularprogressbar/models/circular-progressbar-progress-color-interface.js +8 -0
- package/esm2015/common/util.js +16 -0
- package/esm2015/main.js +2 -0
- package/esm2015/package-metadata.js +1 -1
- package/esm2015/progressbar.module.js +6 -3
- package/fesm2015/kendo-angular-progressbar.js +441 -7
- package/main.d.ts +3 -0
- package/package.json +6 -5
- package/progressbar.module.d.ts +5 -2
|
@@ -0,0 +1,414 @@
|
|
|
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 { Component, ContentChild, EventEmitter, HostBinding, Input, isDevMode, Output, ViewChild } from '@angular/core';
|
|
6
|
+
import { hasObservers } from '@progress/kendo-angular-common';
|
|
7
|
+
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
9
|
+
import { Subscription } from 'rxjs';
|
|
10
|
+
import { removeProgressBarStyles, setProgressBarStyles } from '../common/util';
|
|
11
|
+
import { packageMetadata } from '../package-metadata';
|
|
12
|
+
import { CircularProgressbarCenterTemplateDirective } from './center-template.directive';
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
15
|
+
import * as i2 from "@angular/common";
|
|
16
|
+
/**
|
|
17
|
+
* Represents the [Kendo UI Circular ProgressBar component for Angular]({% slug circular_progressbar %}).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts-preview
|
|
21
|
+
* _@Component({don’t
|
|
22
|
+
* selector: 'my-app',
|
|
23
|
+
* template: `
|
|
24
|
+
* <kendo-circularprogressbar [value]="value"></kendo-circularprogressbar>
|
|
25
|
+
* `
|
|
26
|
+
* })
|
|
27
|
+
* class AppComponent {
|
|
28
|
+
* public value: number = 50;
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export class CircularProgressBar {
|
|
33
|
+
constructor(renderer, cdr, localizationService, element) {
|
|
34
|
+
this.renderer = renderer;
|
|
35
|
+
this.cdr = cdr;
|
|
36
|
+
this.localizationService = localizationService;
|
|
37
|
+
this.element = element;
|
|
38
|
+
this.hostClasses = true;
|
|
39
|
+
this.WrapperSize = '200px';
|
|
40
|
+
/**
|
|
41
|
+
* Indicates whether an animation will be played on value changes.
|
|
42
|
+
*
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
this.animation = true;
|
|
46
|
+
/**
|
|
47
|
+
* The opacity of the value arc.
|
|
48
|
+
* @default 1
|
|
49
|
+
*/
|
|
50
|
+
this.opacity = 1;
|
|
51
|
+
/**
|
|
52
|
+
* Fires when the animation which indicates the latest value change is completed.
|
|
53
|
+
*/
|
|
54
|
+
this.animationEnd = new EventEmitter();
|
|
55
|
+
this.centerTemplateContext = {};
|
|
56
|
+
this._indeterminate = false;
|
|
57
|
+
this._max = 100;
|
|
58
|
+
this._min = 0;
|
|
59
|
+
this._value = 0;
|
|
60
|
+
this.internalValue = 0;
|
|
61
|
+
this.subscriptions = new Subscription();
|
|
62
|
+
validatePackage(packageMetadata);
|
|
63
|
+
this.subscriptions.add(this.localizationService.changes.subscribe(this.rtlChange.bind(this)));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Sets the default value of the Circular Progressbar between `min` and `max`.
|
|
67
|
+
*
|
|
68
|
+
* @default 0
|
|
69
|
+
*/
|
|
70
|
+
set value(value) {
|
|
71
|
+
if (value > this.max) {
|
|
72
|
+
this.handleErrors('value > max');
|
|
73
|
+
}
|
|
74
|
+
if (value < this.min) {
|
|
75
|
+
this.handleErrors('value < min');
|
|
76
|
+
}
|
|
77
|
+
this.previousValue = this.value;
|
|
78
|
+
this._value = value;
|
|
79
|
+
}
|
|
80
|
+
get value() {
|
|
81
|
+
return this._value;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The maximum value which the Circular Progressbar can accept.
|
|
85
|
+
*
|
|
86
|
+
* @default 100
|
|
87
|
+
*/
|
|
88
|
+
set max(max) {
|
|
89
|
+
if (max < this.min) {
|
|
90
|
+
this.handleErrors('max < min');
|
|
91
|
+
}
|
|
92
|
+
this._max = max;
|
|
93
|
+
}
|
|
94
|
+
get max() {
|
|
95
|
+
return this._max;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The minimum value which the Circular Progressbar can accept.
|
|
99
|
+
*
|
|
100
|
+
* @default 0
|
|
101
|
+
*/
|
|
102
|
+
set min(min) {
|
|
103
|
+
if (min > this.max) {
|
|
104
|
+
this.handleErrors('max < min');
|
|
105
|
+
}
|
|
106
|
+
this._min = min;
|
|
107
|
+
}
|
|
108
|
+
get min() {
|
|
109
|
+
return this._min;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Puts the Circular ProgressBar in indeterminate state.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
set indeterminate(indeterminate) {
|
|
116
|
+
this._indeterminate = indeterminate;
|
|
117
|
+
}
|
|
118
|
+
get indeterminate() {
|
|
119
|
+
return this._indeterminate;
|
|
120
|
+
}
|
|
121
|
+
ngAfterViewInit() {
|
|
122
|
+
this.initProgressArc();
|
|
123
|
+
}
|
|
124
|
+
ngOnChanges(changes) {
|
|
125
|
+
const isValueChanged = changes.value;
|
|
126
|
+
const isProgressArcCreated = this.progress;
|
|
127
|
+
const isValueSecondChange = !changes.value.firstChange;
|
|
128
|
+
if (isValueChanged && isProgressArcCreated && isValueSecondChange) {
|
|
129
|
+
if (this.animation) {
|
|
130
|
+
this.progressbarAnimation();
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
const value = this.value - this.min;
|
|
134
|
+
this.internalValue = changes.value.currentValue;
|
|
135
|
+
this.calculateProgress(value);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (changes.opacity && this.progress) {
|
|
139
|
+
setProgressBarStyles([{ method: 'setAttribute', el: this.progress.nativeElement, attr: 'opacity', attrValue: this.opacity }], this.renderer);
|
|
140
|
+
}
|
|
141
|
+
if (changes.indeterminate && !changes.indeterminate.firstChange) {
|
|
142
|
+
this.indeterminateState();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
ngOnDestroy() {
|
|
146
|
+
this.subscriptions.unsubscribe();
|
|
147
|
+
}
|
|
148
|
+
initProgressArc() {
|
|
149
|
+
this.setStyles();
|
|
150
|
+
if (this.indeterminate) {
|
|
151
|
+
this.indeterminateState();
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
if (!this.animation) {
|
|
155
|
+
const value = this.value - this.min;
|
|
156
|
+
this.calculateProgress(value);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
this.progressbarAnimation();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
calculateProgress(value) {
|
|
164
|
+
if (this.progressColor) {
|
|
165
|
+
this.updateProgressColor(value);
|
|
166
|
+
}
|
|
167
|
+
this.updateCenterTemplate(value + this.min);
|
|
168
|
+
const progressArc = this.progress.nativeElement;
|
|
169
|
+
const radius = this.progress.nativeElement.r.baseVal.value;
|
|
170
|
+
const circumference = Math.PI * (radius * 2);
|
|
171
|
+
const dir = this.rtl ? circumference * -1 : circumference;
|
|
172
|
+
const strokeDashOffest = circumference - dir * (value / (this.max - this.min));
|
|
173
|
+
const progressCalculations = [
|
|
174
|
+
{ method: 'setStyle', el: progressArc, attr: 'strokeDasharray', attrValue: circumference },
|
|
175
|
+
{ method: 'setStyle', el: progressArc, attr: 'strokeDashoffset', attrValue: strokeDashOffest }
|
|
176
|
+
];
|
|
177
|
+
setProgressBarStyles(progressCalculations, this.renderer);
|
|
178
|
+
}
|
|
179
|
+
progressbarAnimation() {
|
|
180
|
+
const forwardProgress = {
|
|
181
|
+
isOngoing: this.internalValue > this.value - this.min,
|
|
182
|
+
isPositive: this.value > this.previousValue
|
|
183
|
+
};
|
|
184
|
+
const backwardProgress = {
|
|
185
|
+
isOngoing: this.internalValue < this.value - this.min,
|
|
186
|
+
isNegative: this.value < this.previousValue
|
|
187
|
+
};
|
|
188
|
+
if (forwardProgress.isOngoing && forwardProgress.isPositive ||
|
|
189
|
+
backwardProgress.isOngoing && backwardProgress.isNegative) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
this.calculateProgress(this.internalValue);
|
|
193
|
+
const from = this.internalValue;
|
|
194
|
+
if (hasObservers(this.animationEnd)) {
|
|
195
|
+
this.animationEnd.emit({
|
|
196
|
+
from: from,
|
|
197
|
+
to: this.internalValue
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
// eslint-disable-next-line no-unused-expressions
|
|
201
|
+
forwardProgress.isPositive ? this.internalValue += 1 : this.internalValue -= 1;
|
|
202
|
+
requestAnimationFrame(this.progressbarAnimation.bind(this));
|
|
203
|
+
}
|
|
204
|
+
setStyles() {
|
|
205
|
+
const progressArc = this.progress.nativeElement;
|
|
206
|
+
const scale = this.scale.nativeElement;
|
|
207
|
+
const element = this.element.nativeElement;
|
|
208
|
+
const elWidth = element.getBoundingClientRect().width;
|
|
209
|
+
const attributesArray = [
|
|
210
|
+
{ method: 'setAttribute', el: progressArc, attr: 'r', attrValue: (elWidth / 2) - 10 },
|
|
211
|
+
{ method: 'setAttribute', el: progressArc, attr: 'cx', attrValue: (elWidth / 2) },
|
|
212
|
+
{ method: 'setAttribute', el: progressArc, attr: 'cy', attrValue: (elWidth / 2) },
|
|
213
|
+
{ method: 'setAttribute', el: progressArc, attr: 'opacity', attrValue: this.opacity },
|
|
214
|
+
{ method: 'setAttribute', el: scale, attr: 'r', attrValue: (elWidth / 2) - 10 },
|
|
215
|
+
{ method: 'setAttribute', el: scale, attr: 'cx', attrValue: (elWidth / 2) },
|
|
216
|
+
{ method: 'setAttribute', el: scale, attr: 'cy', attrValue: (elWidth / 2) }
|
|
217
|
+
];
|
|
218
|
+
setProgressBarStyles(attributesArray, this.renderer);
|
|
219
|
+
}
|
|
220
|
+
indeterminateState() {
|
|
221
|
+
const progressArc = this.progress.nativeElement;
|
|
222
|
+
if (this.indeterminate) {
|
|
223
|
+
// the indeterminate state wont work as the `k-circular-progressbar-arc` has a transform: rotate(-90deg) which is
|
|
224
|
+
// interfering with the svg animation as the animateTransform brings its own transform: rotate()
|
|
225
|
+
// This will be like this until the themes release a new version, bringing a new class `k-circular-progressbar-indeterminate-arc`
|
|
226
|
+
// containing only the necassery CSS styles and we will switch between them when the state of the progressbar is switched.
|
|
227
|
+
this.calculateProgress(this.value - this.min);
|
|
228
|
+
const rotate = this.rtl ? { from: 360, to: 0 } : { from: 0, to: 360 };
|
|
229
|
+
this.renderer.removeClass(progressArc, 'k-circular-progressbar-arc');
|
|
230
|
+
const indeterminateStyles = [
|
|
231
|
+
{ method: 'setStyle', el: progressArc, attr: 'transform-origin', attrValue: 'center' },
|
|
232
|
+
{ method: 'setStyle', el: progressArc, attr: 'fill', attrValue: 'none' },
|
|
233
|
+
{ method: 'setStyle', el: progressArc, attr: 'stroke-linecap', attrValue: 'round' }
|
|
234
|
+
];
|
|
235
|
+
setProgressBarStyles(indeterminateStyles, this.renderer);
|
|
236
|
+
progressArc.innerHTML = `<animateTransform attributeName="transform" type="rotate" from="${rotate.from} 0 0" to="${rotate.to} 0 0" dur="1s" repeatCount="indefinite" />`;
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
this.renderer.addClass(progressArc, 'k-circular-progressbar-arc');
|
|
240
|
+
const removeIndeterminateStyles = [
|
|
241
|
+
{ method: 'removeStyle', el: progressArc, attr: 'transform-origin' },
|
|
242
|
+
{ method: 'removeStyle', el: progressArc, attr: 'fill' },
|
|
243
|
+
{ method: 'removeStyle', el: progressArc, attr: 'stroke-linecap' }
|
|
244
|
+
];
|
|
245
|
+
removeProgressBarStyles(removeIndeterminateStyles, this.renderer);
|
|
246
|
+
progressArc.innerHTML = '';
|
|
247
|
+
if (this.animation) {
|
|
248
|
+
this.progressbarAnimation();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
updateCenterTemplate(value) {
|
|
253
|
+
if (!this.centerTemplate) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
this.centerTemplateContext.value = value;
|
|
257
|
+
this.centerTemplateContext.color = this.currentColor;
|
|
258
|
+
this.cdr.detectChanges();
|
|
259
|
+
this.positionLabel();
|
|
260
|
+
}
|
|
261
|
+
positionLabel() {
|
|
262
|
+
const labelEl = this.labelElement.nativeElement;
|
|
263
|
+
const svgWrapper = this.svgWrapper.nativeElement.getBoundingClientRect();
|
|
264
|
+
const svgWrapperWidth = svgWrapper.width;
|
|
265
|
+
const svgWrapperHeight = svgWrapper.height;
|
|
266
|
+
const left = (svgWrapperWidth / 2) - (labelEl.offsetWidth / 2);
|
|
267
|
+
const top = (svgWrapperHeight / 2) - (labelEl.offsetHeight / 2);
|
|
268
|
+
const labelCalculations = [
|
|
269
|
+
{ method: 'setStyle', el: labelEl, attr: 'left', attrValue: `${left}px` },
|
|
270
|
+
{ method: 'setStyle', el: labelEl, attr: 'top', attrValue: `${top}px` }
|
|
271
|
+
];
|
|
272
|
+
setProgressBarStyles(labelCalculations, this.renderer);
|
|
273
|
+
}
|
|
274
|
+
get currentColor() {
|
|
275
|
+
const currentColor = this.progress.nativeElement.style.stroke;
|
|
276
|
+
return currentColor;
|
|
277
|
+
}
|
|
278
|
+
updateProgressColor(value) {
|
|
279
|
+
const progressArc = this.progress.nativeElement;
|
|
280
|
+
if (typeof this.progressColor === 'string') {
|
|
281
|
+
this.renderer.setStyle(progressArc, 'stroke', this.progressColor);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
for (let i = 0; i < this.progressColor.length; i++) {
|
|
285
|
+
let from = this.progressColor[i].from;
|
|
286
|
+
let to = this.progressColor[i].to;
|
|
287
|
+
if (value >= from && value < to || (!from && value < to)) {
|
|
288
|
+
this.renderer.setStyle(progressArc, 'stroke', this.progressColor[i].color);
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
if (!to && value >= from) {
|
|
292
|
+
this.renderer.setStyle(progressArc, 'stroke', this.progressColor[i].color);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
handleErrors(type) {
|
|
298
|
+
if (isDevMode()) {
|
|
299
|
+
switch (type) {
|
|
300
|
+
case 'value > max':
|
|
301
|
+
throw new Error('The value of the Circular Progressbar cannot exceed the max value');
|
|
302
|
+
case 'value < min':
|
|
303
|
+
throw new Error('The value of the Circular Progressbar cannot be lower than the min value');
|
|
304
|
+
case 'max < min':
|
|
305
|
+
throw new Error('The min value cannot be higher than the max value');
|
|
306
|
+
default:
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
setDirection() {
|
|
311
|
+
this.rtl = this.localizationService.rtl;
|
|
312
|
+
if (this.element) {
|
|
313
|
+
this.renderer.setAttribute(this.element.nativeElement, 'dir', this.rtl ? 'rtl' : 'ltr');
|
|
314
|
+
}
|
|
315
|
+
if (this.labelElement) {
|
|
316
|
+
this.renderer.setAttribute(this.labelElement.nativeElement, 'dir', this.rtl ? 'rtl' : 'ltr');
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
rtlChange() {
|
|
320
|
+
if (this.element && this.rtl !== this.localizationService.rtl) {
|
|
321
|
+
this.setDirection();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
CircularProgressBar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CircularProgressBar, deps: [{ token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
326
|
+
CircularProgressBar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CircularProgressBar, selector: "kendo-circularprogressbar", inputs: { value: "value", max: "max", min: "min", animation: "animation", opacity: "opacity", indeterminate: "indeterminate", progressColor: "progressColor" }, outputs: { animationEnd: "animationEnd" }, host: { properties: { "class.k-circular-progressbar": "this.hostClasses", "style.width": "this.WrapperSize", "style.height": "this.WrapperSize" } }, providers: [
|
|
327
|
+
LocalizationService,
|
|
328
|
+
{
|
|
329
|
+
provide: L10N_PREFIX,
|
|
330
|
+
useValue: 'kendo.circularprogressbar'
|
|
331
|
+
}
|
|
332
|
+
], queries: [{ propertyName: "centerTemplate", first: true, predicate: CircularProgressbarCenterTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "progress", first: true, predicate: ["progress"], descendants: true }, { propertyName: "scale", first: true, predicate: ["scale"], descendants: true }, { propertyName: "labelElement", first: true, predicate: ["label"], descendants: true }, { propertyName: "svgWrapper", first: true, predicate: ["svgWrapper"], descendants: true }], exportAs: ["kendoCircularProgressBar"], usesOnChanges: true, ngImport: i0, template: `
|
|
333
|
+
<div class="k-circular-progressbar-surface">
|
|
334
|
+
<div #svgWrapper>
|
|
335
|
+
<svg #svg>
|
|
336
|
+
<g>
|
|
337
|
+
<circle class="k-circular-progressbar-scale" #scale stroke-width="9.5"></circle>
|
|
338
|
+
<circle class="k-circular-progressbar-arc" #progress stroke-width="9.5"></circle>
|
|
339
|
+
</g>
|
|
340
|
+
</svg>
|
|
341
|
+
<div class="k-circular-progressbar-label" *ngIf="centerTemplate" #label>
|
|
342
|
+
<ng-template [ngTemplateOutlet]="centerTemplate.templateRef" [ngTemplateOutletContext]="centerTemplateContext"></ng-template>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
`, isInline: true, directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CircularProgressBar, decorators: [{
|
|
348
|
+
type: Component,
|
|
349
|
+
args: [{
|
|
350
|
+
exportAs: 'kendoCircularProgressBar',
|
|
351
|
+
selector: 'kendo-circularprogressbar',
|
|
352
|
+
template: `
|
|
353
|
+
<div class="k-circular-progressbar-surface">
|
|
354
|
+
<div #svgWrapper>
|
|
355
|
+
<svg #svg>
|
|
356
|
+
<g>
|
|
357
|
+
<circle class="k-circular-progressbar-scale" #scale stroke-width="9.5"></circle>
|
|
358
|
+
<circle class="k-circular-progressbar-arc" #progress stroke-width="9.5"></circle>
|
|
359
|
+
</g>
|
|
360
|
+
</svg>
|
|
361
|
+
<div class="k-circular-progressbar-label" *ngIf="centerTemplate" #label>
|
|
362
|
+
<ng-template [ngTemplateOutlet]="centerTemplate.templateRef" [ngTemplateOutletContext]="centerTemplateContext"></ng-template>
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
</div>
|
|
366
|
+
`, providers: [
|
|
367
|
+
LocalizationService,
|
|
368
|
+
{
|
|
369
|
+
provide: L10N_PREFIX,
|
|
370
|
+
useValue: 'kendo.circularprogressbar'
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
}]
|
|
374
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1.LocalizationService }, { type: i0.ElementRef }]; }, propDecorators: { hostClasses: [{
|
|
375
|
+
type: HostBinding,
|
|
376
|
+
args: ['class.k-circular-progressbar']
|
|
377
|
+
}], WrapperSize: [{
|
|
378
|
+
type: HostBinding,
|
|
379
|
+
args: ['style.width']
|
|
380
|
+
}, {
|
|
381
|
+
type: HostBinding,
|
|
382
|
+
args: ['style.height']
|
|
383
|
+
}], value: [{
|
|
384
|
+
type: Input
|
|
385
|
+
}], max: [{
|
|
386
|
+
type: Input
|
|
387
|
+
}], min: [{
|
|
388
|
+
type: Input
|
|
389
|
+
}], animation: [{
|
|
390
|
+
type: Input
|
|
391
|
+
}], opacity: [{
|
|
392
|
+
type: Input
|
|
393
|
+
}], indeterminate: [{
|
|
394
|
+
type: Input
|
|
395
|
+
}], progressColor: [{
|
|
396
|
+
type: Input
|
|
397
|
+
}], animationEnd: [{
|
|
398
|
+
type: Output
|
|
399
|
+
}], progress: [{
|
|
400
|
+
type: ViewChild,
|
|
401
|
+
args: ['progress']
|
|
402
|
+
}], scale: [{
|
|
403
|
+
type: ViewChild,
|
|
404
|
+
args: ['scale']
|
|
405
|
+
}], labelElement: [{
|
|
406
|
+
type: ViewChild,
|
|
407
|
+
args: ["label"]
|
|
408
|
+
}], svgWrapper: [{
|
|
409
|
+
type: ViewChild,
|
|
410
|
+
args: ["svgWrapper"]
|
|
411
|
+
}], centerTemplate: [{
|
|
412
|
+
type: ContentChild,
|
|
413
|
+
args: [CircularProgressbarCenterTemplateDirective]
|
|
414
|
+
}] } });
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
* The color range configuration of the pointer.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
package/esm2015/common/util.js
CHANGED
|
@@ -79,3 +79,19 @@ export const stopCurrentAnimation = (changes) => {
|
|
|
79
79
|
const hasAnimation = isAnimationChanged && changes.animation.currentValue;
|
|
80
80
|
return isAnimationChanged && !hasAnimation;
|
|
81
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* @hidden
|
|
84
|
+
*/
|
|
85
|
+
export const setProgressBarStyles = (props, renderer) => {
|
|
86
|
+
props.forEach(prop => {
|
|
87
|
+
renderer[prop.method](prop.el, prop.attr, `${prop.attrValue}`);
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* @hidden
|
|
92
|
+
*/
|
|
93
|
+
export const removeProgressBarStyles = (props, renderer) => {
|
|
94
|
+
props.forEach(prop => {
|
|
95
|
+
renderer[prop.method](prop.el, prop.attr);
|
|
96
|
+
});
|
|
97
|
+
};
|
package/esm2015/main.js
CHANGED
|
@@ -4,4 +4,6 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
export { ProgressBarComponent } from './progressbar.component';
|
|
6
6
|
export { ChunkProgressBarComponent } from './chunk/chunk-progressbar.component';
|
|
7
|
+
export { CircularProgressBar } from './circularprogressbar/circular-progressbar.component';
|
|
8
|
+
export { CircularProgressbarCenterTemplateDirective } from './circularprogressbar/center-template.directive';
|
|
7
9
|
export { ProgressBarModule } from './progressbar.module';
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-progressbar',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1658826162,
|
|
13
13
|
version: '',
|
|
14
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
15
|
};
|
|
@@ -6,9 +6,12 @@ import { ChunkProgressBarComponent } from './chunk/chunk-progressbar.component';
|
|
|
6
6
|
import { NgModule } from '@angular/core';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
import { ProgressBarComponent } from './progressbar.component';
|
|
9
|
+
import { CircularProgressBar } from './circularprogressbar/circular-progressbar.component';
|
|
10
|
+
import { ResizeSensorModule } from '@progress/kendo-angular-common';
|
|
11
|
+
import { CircularProgressbarCenterTemplateDirective } from './circularprogressbar/center-template.directive';
|
|
9
12
|
import * as i0 from "@angular/core";
|
|
10
|
-
const COMPONENT_DIRECTIVES = [ProgressBarComponent, ChunkProgressBarComponent];
|
|
11
|
-
const MODULES = [CommonModule];
|
|
13
|
+
const COMPONENT_DIRECTIVES = [ProgressBarComponent, ChunkProgressBarComponent, CircularProgressBar, CircularProgressbarCenterTemplateDirective];
|
|
14
|
+
const MODULES = [CommonModule, ResizeSensorModule];
|
|
12
15
|
/**
|
|
13
16
|
* Represents the [NgModule]({{ site.data.urls.angular['ngmodules'] }})
|
|
14
17
|
* definition for the ProgressBar components.
|
|
@@ -43,7 +46,7 @@ const MODULES = [CommonModule];
|
|
|
43
46
|
export class ProgressBarModule {
|
|
44
47
|
}
|
|
45
48
|
ProgressBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ProgressBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
46
|
-
ProgressBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ProgressBarModule, declarations: [ProgressBarComponent, ChunkProgressBarComponent], imports: [CommonModule], exports: [ProgressBarComponent, ChunkProgressBarComponent] });
|
|
49
|
+
ProgressBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ProgressBarModule, declarations: [ProgressBarComponent, ChunkProgressBarComponent, CircularProgressBar, CircularProgressbarCenterTemplateDirective], imports: [CommonModule, ResizeSensorModule], exports: [ProgressBarComponent, ChunkProgressBarComponent, CircularProgressBar, CircularProgressbarCenterTemplateDirective] });
|
|
47
50
|
ProgressBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ProgressBarModule, imports: [MODULES] });
|
|
48
51
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ProgressBarModule, decorators: [{
|
|
49
52
|
type: NgModule,
|