@progress/kendo-angular-progressbar 25.1.0-develop.2 → 25.1.0-develop.21

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.
@@ -5,7 +5,7 @@
5
5
  import * as i1 from '@progress/kendo-angular-l10n';
6
6
  import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
7
7
  import * as i0 from '@angular/core';
8
- import { isDevMode, signal, computed, Input, HostBinding, ChangeDetectionStrategy, Component, Directive, forwardRef, EventEmitter, effect, untracked, ViewChild, Output, afterNextRender, ContentChild, NgModule } from '@angular/core';
8
+ import { isDevMode, signal, Input, HostBinding, ChangeDetectionStrategy, Component, Directive, forwardRef, EventEmitter, ViewChild, Output, effect, untracked, afterNextRender, ContentChild, NgModule } from '@angular/core';
9
9
  import { validatePackage } from '@progress/kendo-licensing';
10
10
  import { hasObservers, isDocumentAvailable, ResizeSensorComponent, ResizeBatchService } from '@progress/kendo-angular-common';
11
11
  import { NgStyle, NgClass, NgTemplateOutlet } from '@angular/common';
@@ -19,8 +19,8 @@ const packageMetadata = {
19
19
  productName: 'Kendo UI for Angular',
20
20
  productCode: 'KENDOUIANGULAR',
21
21
  productCodes: ['KENDOUIANGULAR'],
22
- publishDate: 1786694073,
23
- version: '25.1.0-develop.2',
22
+ publishDate: 1788250556,
23
+ version: '25.1.0-develop.21',
24
24
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
25
25
  };
26
26
 
@@ -280,10 +280,15 @@ class ProgressBarBase {
280
280
  }
281
281
  direction;
282
282
  localizationChangeSubscription;
283
- previousValue = 0;
284
- /**
285
- * @hidden
286
- */
283
+ set previousValue(value) {
284
+ this._previousValue.set(value);
285
+ }
286
+ get previousValue() {
287
+ return this._previousValue();
288
+ }
289
+ set displayValue(value) {
290
+ this._displayValue.set(value);
291
+ }
287
292
  get displayValue() {
288
293
  return this._displayValue();
289
294
  }
@@ -299,6 +304,27 @@ class ProgressBarBase {
299
304
  this.direction = rtl ? 'rtl' : 'ltr';
300
305
  });
301
306
  }
307
+ ngOnChanges(changes) {
308
+ const min = extractValueFromChanges(changes, 'min', this.min);
309
+ const max = extractValueFromChanges(changes, 'max', this.max);
310
+ const value = extractValueFromChanges(changes, 'value', this.value);
311
+ if (changes['min'] || changes['max'] || changes['value']) {
312
+ if (changes['min'] || changes['max']) {
313
+ validateRange(min, max);
314
+ }
315
+ if (changes['value']) {
316
+ if (value == null || Number.isNaN(value)) {
317
+ this.value = min;
318
+ }
319
+ const previousValue = this.displayValue;
320
+ this.displayValue = adjustValueToRange(this.min, this.max, value);
321
+ this.previousValue = previousValue;
322
+ }
323
+ this.min = min;
324
+ this.max = max;
325
+ this.displayValue = adjustValueToRange(this.min, this.max, value);
326
+ }
327
+ }
302
328
  ngAfterViewInit() {
303
329
  const elem = this.elem.nativeElement;
304
330
  const label = this.localization.get('progressBarLabel');
@@ -316,9 +342,10 @@ class ProgressBarBase {
316
342
  _disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
317
343
  _reverse = signal(false, ...(ngDevMode ? [{ debugName: "_reverse" }] : []));
318
344
  _indeterminate = signal(false, ...(ngDevMode ? [{ debugName: "_indeterminate" }] : []));
319
- _displayValue = computed(() => adjustValueToRange(this._min(), this._max(), this._value()), ...(ngDevMode ? [{ debugName: "_displayValue" }] : []));
345
+ _displayValue = signal(0, ...(ngDevMode ? [{ debugName: "_displayValue" }] : []));
346
+ _previousValue = signal(0, ...(ngDevMode ? [{ debugName: "_previousValue" }] : []));
320
347
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ProgressBarBase, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
321
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.27", type: ProgressBarBase, isStandalone: true, selector: "ng-component", inputs: { max: "max", min: "min", value: "value", orientation: "orientation", disabled: "disabled", reverse: "reverse", indeterminate: "indeterminate" }, host: { properties: { "class.k-progressbar": "this.hostClasses", "class.k-progressbar-horizontal": "this.isHorizontal", "class.k-progressbar-vertical": "this.isVertical", "class.k-disabled": "this.disabledClass", "class.k-progressbar-reverse": "this.reverseClass", "class.k-progressbar-indeterminate": "this.indeterminateClass", "attr.dir": "this.dirAttribute", "attr.role": "this.roleAttribute", "attr.aria-valuemin": "this.ariaMinAttribute", "attr.aria-valuemax": "this.ariaMaxAttribute", "attr.aria-valuenow": "this.ariaValueAttribute" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
348
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.27", type: ProgressBarBase, isStandalone: true, selector: "ng-component", inputs: { max: "max", min: "min", value: "value", orientation: "orientation", disabled: "disabled", reverse: "reverse", indeterminate: "indeterminate" }, host: { properties: { "class.k-progressbar": "this.hostClasses", "class.k-progressbar-horizontal": "this.isHorizontal", "class.k-progressbar-vertical": "this.isVertical", "class.k-disabled": "this.disabledClass", "class.k-progressbar-reverse": "this.reverseClass", "class.k-progressbar-indeterminate": "this.indeterminateClass", "attr.dir": "this.dirAttribute", "attr.role": "this.roleAttribute", "attr.aria-valuemin": "this.ariaMinAttribute", "attr.aria-valuemax": "this.ariaMaxAttribute", "attr.aria-valuenow": "this.ariaValueAttribute" } }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
322
349
  }
323
350
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ProgressBarBase, decorators: [{
324
351
  type: Component,
@@ -518,7 +545,7 @@ class ProgressBarComponent extends ProgressBarBase {
518
545
  * Defaults to `100`.
519
546
  */
520
547
  set max(v) {
521
- this._previousMax = this.max;
548
+ this._previousMax.set(this.max);
522
549
  super.max = v;
523
550
  }
524
551
  get max() {
@@ -580,40 +607,46 @@ class ProgressBarComponent extends ProgressBarBase {
580
607
  get formattedLabelValue() {
581
608
  return formatValue(this.displayValue, this.min, this.max, this.label);
582
609
  }
610
+ /**
611
+ * @hidden
612
+ */
613
+ get statusWidth() {
614
+ return this.isAnimationInProgress && this.animatedStatusWidth != null ? this.animatedStatusWidth : super.statusWidth;
615
+ }
616
+ /**
617
+ * @hidden
618
+ */
619
+ get statusHeight() {
620
+ return this.isAnimationInProgress && this.animatedStatusHeight != null ? this.animatedStatusHeight : super.statusHeight;
621
+ }
622
+ /**
623
+ * @hidden
624
+ */
625
+ get statusWrapperWidth() {
626
+ return this.isAnimationInProgress && this.animatedStatusWrapperWidth != null ? this.animatedStatusWrapperWidth : super.statusWrapperWidth;
627
+ }
628
+ /**
629
+ * @hidden
630
+ */
631
+ get statusWrapperHeight() {
632
+ return this.isAnimationInProgress && this.animatedStatusWrapperHeight != null ? this.animatedStatusWrapperHeight : super.statusWrapperHeight;
633
+ }
583
634
  progressStatusElement;
584
635
  progressStatusWrapperElement;
585
636
  animationFrame;
586
637
  cancelCurrentAnimation;
587
638
  isAnimationInProgress;
588
- _previousMax;
589
- _valueEffectInitialized = false;
639
+ animatedStatusWidth = null;
640
+ animatedStatusHeight = null;
641
+ animatedStatusWrapperWidth = null;
642
+ animatedStatusWrapperHeight = null;
643
+ _previousMax = signal(null, ...(ngDevMode ? [{ debugName: "_previousMax" }] : []));
590
644
  _label = signal(true, ...(ngDevMode ? [{ debugName: "_label" }] : []));
591
645
  _progressCssStyle = signal(undefined, ...(ngDevMode ? [{ debugName: "_progressCssStyle" }] : []));
592
646
  _progressCssClass = signal(undefined, ...(ngDevMode ? [{ debugName: "_progressCssClass" }] : []));
593
647
  _emptyCssStyle = signal(undefined, ...(ngDevMode ? [{ debugName: "_emptyCssStyle" }] : []));
594
648
  _emptyCssClass = signal(undefined, ...(ngDevMode ? [{ debugName: "_emptyCssClass" }] : []));
595
649
  _animation = signal(false, ...(ngDevMode ? [{ debugName: "_animation" }] : []));
596
- valueChangeEffect = effect(() => {
597
- const _value = this.value; // tracks _value signal changes via public getter
598
- if (!this._valueEffectInitialized) {
599
- this._valueEffectInitialized = true;
600
- return;
601
- }
602
- const displayValue = untracked(() => this.displayValue);
603
- const animation = untracked(() => this.animation);
604
- if (animation && typeof requestAnimationFrame !== 'undefined' && this.previousValue !== displayValue) {
605
- if (!this.progressStatusElement?.nativeElement || !this.progressStatusWrapperElement?.nativeElement) {
606
- return;
607
- }
608
- this.startAnimation(this.previousValue);
609
- }
610
- }, ...(ngDevMode ? [{ debugName: "valueChangeEffect" }] : []));
611
- animationStopEffect = effect(() => {
612
- const animation = this.animation; // tracks _animation signal changes via public getter
613
- if (this.isAnimationInProgress && !animation) {
614
- this.cancelCurrentAnimation = true;
615
- }
616
- }, ...(ngDevMode ? [{ debugName: "animationStopEffect" }] : []));
617
650
  /**
618
651
  * @hidden
619
652
  */
@@ -624,6 +657,19 @@ class ProgressBarComponent extends ProgressBarBase {
624
657
  this.renderer = renderer;
625
658
  this.zone = zone;
626
659
  }
660
+ /**
661
+ * @hidden
662
+ */
663
+ ngOnChanges(changes) {
664
+ super.ngOnChanges(changes);
665
+ this._previousMax.set(changes['max'] ? changes['max'].previousValue : this.max);
666
+ if (this.isAnimationInProgress && stopCurrentAnimation(changes)) {
667
+ this.cancelCurrentAnimation = true;
668
+ }
669
+ if (runAnimation(changes, this.animation, this.previousValue, this.displayValue) && !changes['value'].firstChange) {
670
+ this.startAnimation(this.previousValue);
671
+ }
672
+ }
627
673
  /**
628
674
  * @hidden
629
675
  */
@@ -637,10 +683,12 @@ class ProgressBarComponent extends ProgressBarBase {
637
683
  * @hidden
638
684
  */
639
685
  startAnimation(previousValue) {
640
- this.isAnimationInProgress = true;
641
686
  const element = this.progressStatusElement.nativeElement;
642
687
  const wrapperElement = this.progressStatusWrapperElement.nativeElement;
643
688
  const animationOptions = this.getAnimationOptions(previousValue);
689
+ this.animatedStatusWidth = this.animatedStatusHeight = null;
690
+ this.animatedStatusWrapperWidth = this.animatedStatusWrapperHeight = null;
691
+ this.isAnimationInProgress = true;
644
692
  this.zone.runOutsideAngular(() => {
645
693
  if (this.animationFrame) {
646
694
  cancelAnimationFrame(this.animationFrame);
@@ -694,13 +742,16 @@ class ProgressBarComponent extends ProgressBarBase {
694
742
  }
695
743
  getAnimationOptions(value) {
696
744
  const isHorizontal = this.orientation === 'horizontal';
697
- const previousRatio = calculateRatio(this.min, this._previousMax ?? this.max, value);
745
+ const previousRatio = calculateRatio(this.min, this._previousMax() ?? this.max, value);
698
746
  const previousStatusWidth = isHorizontal ? previousRatio * 100 : 100;
699
747
  const previousStatusHeight = !isHorizontal ? previousRatio * 100 : 100;
700
748
  const property = isHorizontal ? 'width' : 'height';
701
749
  const startTime = new Date().getTime();
702
750
  const startSize = isHorizontal ? previousStatusWidth : previousStatusHeight;
703
- const deltaSize = isHorizontal ? this.statusWidth - previousStatusWidth : this.statusHeight - previousStatusHeight;
751
+ const targetRatio = calculateRatio(this.min, this.max, this.displayValue);
752
+ const targetStatusWidth = isHorizontal ? targetRatio * 100 : 100;
753
+ const targetStatusHeight = !isHorizontal ? targetRatio * 100 : 100;
754
+ const deltaSize = isHorizontal ? targetStatusWidth - previousStatusWidth : targetStatusHeight - previousStatusHeight;
704
755
  const duration = this.animationDuration * Math.abs((deltaSize / 100));
705
756
  return {
706
757
  property,
@@ -711,6 +762,14 @@ class ProgressBarComponent extends ProgressBarBase {
711
762
  };
712
763
  }
713
764
  renderValueChange(element, wrapperElement, property, size, wrapperSize) {
765
+ if (property === 'width') {
766
+ this.animatedStatusWidth = size;
767
+ this.animatedStatusWrapperWidth = wrapperSize;
768
+ }
769
+ else {
770
+ this.animatedStatusHeight = size;
771
+ this.animatedStatusWrapperHeight = wrapperSize;
772
+ }
714
773
  this.renderer.setStyle(element, property, size + '%');
715
774
  this.renderer.setStyle(wrapperElement, property, wrapperSize + '%');
716
775
  }
@@ -731,7 +790,7 @@ class ProgressBarComponent extends ProgressBarBase {
731
790
  provide: L10N_PREFIX,
732
791
  useValue: 'kendo.progressbar'
733
792
  }
734
- ], viewQueries: [{ propertyName: "progressStatusElement", first: true, predicate: ["progressStatus"], descendants: true }, { propertyName: "progressStatusWrapperElement", first: true, predicate: ["progressStatusWrap"], descendants: true }], exportAs: ["kendoProgressBar"], usesInheritance: true, ngImport: i0, template: `
793
+ ], viewQueries: [{ propertyName: "progressStatusElement", first: true, predicate: ["progressStatus"], descendants: true }, { propertyName: "progressStatusWrapperElement", first: true, predicate: ["progressStatusWrap"], descendants: true }], exportAs: ["kendoProgressBar"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
735
794
  <ng-container kendoProgressBarLocalizedMessages
736
795
  i18n-progressBarLabel="kendo.progressbar.progressBarLabel|The aria-label attribute for the ProgressBar component."
737
796
  progressBarLabel="Progressbar"
package/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { LocalizationService, ComponentMessages } from '@progress/kendo-angular-l10n';
6
6
  import * as i0 from '@angular/core';
7
- import { AfterViewInit, OnDestroy, ElementRef, Renderer2, EventEmitter, NgZone, TemplateRef, Injector } from '@angular/core';
7
+ import { AfterViewInit, OnDestroy, ElementRef, Renderer2, SimpleChanges, OnChanges, EventEmitter, NgZone, TemplateRef, Injector } from '@angular/core';
8
8
  import { Subscription } from 'rxjs';
9
9
 
10
10
  /**
@@ -114,15 +114,15 @@ declare abstract class ProgressBarBase implements AfterViewInit, OnDestroy {
114
114
  get indeterminate(): boolean;
115
115
  protected direction: string;
116
116
  protected localizationChangeSubscription: Subscription;
117
- protected previousValue: number;
118
- /**
119
- * @hidden
120
- */
117
+ protected set previousValue(value: number);
118
+ protected get previousValue(): number;
119
+ protected set displayValue(value: number);
121
120
  protected get displayValue(): number;
122
121
  /**
123
122
  * @hidden
124
123
  */
125
124
  constructor(elem: ElementRef, renderer: Renderer2, localization: LocalizationService);
125
+ ngOnChanges(changes: SimpleChanges): void;
126
126
  ngAfterViewInit(): void;
127
127
  ngOnDestroy(): void;
128
128
  private readonly _max;
@@ -133,6 +133,7 @@ declare abstract class ProgressBarBase implements AfterViewInit, OnDestroy {
133
133
  private readonly _reverse;
134
134
  private readonly _indeterminate;
135
135
  private readonly _displayValue;
136
+ private _previousValue;
136
137
  static ɵfac: i0.ɵɵFactoryDeclaration<ProgressBarBase, never>;
137
138
  static ɵcmp: i0.ɵɵComponentDeclaration<ProgressBarBase, "ng-component", never, { "max": { "alias": "max"; "required": false; }; "min": { "alias": "min"; "required": false; }; "value": { "alias": "value"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "reverse": { "alias": "reverse"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; }, {}, never, never, true, never>;
138
139
  }
@@ -217,7 +218,7 @@ interface ProgressBarAnimation {
217
218
  * @remarks
218
219
  * Supported children components are: {@link ProgressBarCustomMessagesComponent}
219
220
  */
220
- declare class ProgressBarComponent extends ProgressBarBase {
221
+ declare class ProgressBarComponent extends ProgressBarBase implements OnChanges, OnDestroy {
221
222
  localization: LocalizationService;
222
223
  elem: ElementRef;
223
224
  renderer: Renderer2;
@@ -312,25 +313,46 @@ declare class ProgressBarComponent extends ProgressBarBase {
312
313
  * @hidden
313
314
  */
314
315
  get formattedLabelValue(): string;
316
+ /**
317
+ * @hidden
318
+ */
319
+ get statusWidth(): number;
320
+ /**
321
+ * @hidden
322
+ */
323
+ get statusHeight(): number;
324
+ /**
325
+ * @hidden
326
+ */
327
+ get statusWrapperWidth(): number;
328
+ /**
329
+ * @hidden
330
+ */
331
+ get statusWrapperHeight(): number;
315
332
  private progressStatusElement;
316
333
  private progressStatusWrapperElement;
317
334
  private animationFrame;
318
335
  private cancelCurrentAnimation;
319
336
  private isAnimationInProgress;
337
+ private animatedStatusWidth;
338
+ private animatedStatusHeight;
339
+ private animatedStatusWrapperWidth;
340
+ private animatedStatusWrapperHeight;
320
341
  private _previousMax;
321
- private _valueEffectInitialized;
322
342
  private readonly _label;
323
343
  private readonly _progressCssStyle;
324
344
  private readonly _progressCssClass;
325
345
  private readonly _emptyCssStyle;
326
346
  private readonly _emptyCssClass;
327
347
  private readonly _animation;
328
- private readonly valueChangeEffect;
329
- private readonly animationStopEffect;
330
348
  /**
331
349
  * @hidden
332
350
  */
333
351
  constructor(localization: LocalizationService, elem: ElementRef, renderer: Renderer2, zone: NgZone);
352
+ /**
353
+ * @hidden
354
+ */
355
+ ngOnChanges(changes: SimpleChanges): void;
334
356
  /**
335
357
  * @hidden
336
358
  */
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1786694073,
11
- "version": "25.1.0-develop.2",
10
+ "publishDate": 1788250556,
11
+ "version": "25.1.0-develop.21",
12
12
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-progressbar",
3
- "version": "25.1.0-develop.2",
3
+ "version": "25.1.0-develop.21",
4
4
  "description": "Kendo UI Angular component starter template",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -19,7 +19,7 @@
19
19
  "package": {
20
20
  "productName": "Kendo UI for Angular",
21
21
  "productCode": "KENDOUIANGULAR",
22
- "publishDate": 1786694073,
22
+ "publishDate": 1788250556,
23
23
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
24
24
  }
25
25
  },
@@ -29,13 +29,13 @@
29
29
  "@angular/core": "20 - 22",
30
30
  "@angular/platform-browser": "20 - 22",
31
31
  "@progress/kendo-licensing": "^1.11.0",
32
- "@progress/kendo-angular-common": "25.1.0-develop.2",
33
- "@progress/kendo-angular-l10n": "25.1.0-develop.2",
32
+ "@progress/kendo-angular-common": "25.1.0-develop.21",
33
+ "@progress/kendo-angular-l10n": "25.1.0-develop.21",
34
34
  "rxjs": "^6.5.3 || ^7.0.0"
35
35
  },
36
36
  "dependencies": {
37
37
  "tslib": "^2.3.1",
38
- "@progress/kendo-angular-schematics": "25.1.0-develop.2"
38
+ "@progress/kendo-angular-schematics": "25.1.0-develop.21"
39
39
  },
40
40
  "schematics": "./schematics/collection.json",
41
41
  "module": "fesm2022/progress-kendo-angular-progressbar.mjs",