@progress/kendo-angular-scrollview 26.2.0-develop.6 → 26.2.0-develop.7

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.
@@ -4,8 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as i0 from '@angular/core';
6
6
  import { EventEmitter, signal, Output, Input, ChangeDetectionStrategy, Component, Directive, forwardRef, TemplateRef, HostBinding, ViewChild, ContentChild, NgModule } from '@angular/core';
7
- import { trigger, state, style, transition, animate } from '@angular/animations';
8
- import { replaceMessagePlaceholder, normalizeKeys, Keys, DraggableDirective, KENDO_WEBMCP_HOST, provideComponentName } from '@progress/kendo-angular-common';
7
+ import { replaceMessagePlaceholder, normalizeKeys, Keys, isDocumentAvailable, playAnimation, DraggableDirective, KENDO_WEBMCP_HOST, provideComponentName } from '@progress/kendo-angular-common';
9
8
  import { validatePackage } from '@progress/kendo-licensing';
10
9
  import * as i1 from '@progress/kendo-angular-l10n';
11
10
  import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
@@ -31,8 +30,8 @@ const packageMetadata = {
31
30
  productName: 'Kendo UI for Angular',
32
31
  productCode: 'KENDOUIANGULAR',
33
32
  productCodes: ['KENDOUIANGULAR'],
34
- publishDate: 1795439343,
35
- version: '26.2.0-develop.6',
33
+ publishDate: 1795445073,
34
+ version: '26.2.0-develop.7',
36
35
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
37
36
  };
38
37
 
@@ -258,6 +257,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImpo
258
257
  }], ctorParameters: () => [{ type: i1.LocalizationService }] });
259
258
 
260
259
  let idx = 0;
260
+ const SLIDE_TRANSFORMS = {
261
+ left: 'translateX(-100%)',
262
+ right: 'translateX(100%)',
263
+ center: 'translateX(0)'
264
+ };
261
265
  /**
262
266
  * Represents the [Kendo UI ScrollView component for Angular](https://www.telerik.com/kendo-angular-ui/components/scrollview).
263
267
  *
@@ -427,6 +431,7 @@ class ScrollViewComponent {
427
431
  scrollviewId;
428
432
  isDataSourceEmpty = false;
429
433
  subs = new Subscription();
434
+ slideAnimation;
430
435
  index = 0;
431
436
  initialTouchCoordinate;
432
437
  pageIndex = null;
@@ -459,6 +464,7 @@ class ScrollViewComponent {
459
464
  }
460
465
  ngOnDestroy() {
461
466
  this.subs.unsubscribe();
467
+ this.slideAnimation?.cancel();
462
468
  }
463
469
  /**
464
470
  * Navigates the ScrollView to the previous item.
@@ -475,9 +481,9 @@ class ScrollViewComponent {
475
481
  /**
476
482
  * @hidden
477
483
  */
478
- transitionEndHandler(e) {
484
+ transitionEndHandler(toState) {
479
485
  this.animationState = null;
480
- if (e.toState === 'left' || e.toState === 'right') {
486
+ if (toState === 'left' || toState === 'right') {
481
487
  if (this.pageIndex !== null) {
482
488
  this.activeIndex = this.pageIndex;
483
489
  this.pageIndex = null;
@@ -507,7 +513,7 @@ class ScrollViewComponent {
507
513
  */
508
514
  handleRelease(e) {
509
515
  const deltaX = e.pageX - this.initialTouchCoordinate;
510
- if (this.isDragForbidden(deltaX)) {
516
+ if (this.animationState || this.isDragForbidden(deltaX)) {
511
517
  return;
512
518
  }
513
519
  this.ngZone.run(() => {
@@ -526,7 +532,7 @@ class ScrollViewComponent {
526
532
  }
527
533
  else {
528
534
  if (this.animate && deltaX) {
529
- this.animationState = 'center';
535
+ this.animateTo('center');
530
536
  }
531
537
  else {
532
538
  this.renderer.removeStyle(this.itemWrapper.nativeElement, 'transform');
@@ -542,10 +548,10 @@ class ScrollViewComponent {
542
548
  if (this.animate) {
543
549
  this.pageIndex = idx;
544
550
  if (this.isRTL) {
545
- this.animationState = (this.pageIndex > this.index ? 'right' : 'left');
551
+ this.animateTo(this.pageIndex > this.index ? 'right' : 'left');
546
552
  }
547
553
  else {
548
- this.animationState = (this.pageIndex > this.index ? 'left' : 'right');
554
+ this.animateTo(this.pageIndex > this.index ? 'left' : 'right');
549
555
  }
550
556
  }
551
557
  else {
@@ -683,7 +689,7 @@ class ScrollViewComponent {
683
689
  if (direction === Dir.Next && this.view.canMoveNext()) {
684
690
  this.index = (this.index + 1) % this.view.total;
685
691
  if (this.animate) {
686
- this.animationState = this.isRTL ? 'right' : 'left';
692
+ this.animateTo(this.isRTL ? 'right' : 'left');
687
693
  }
688
694
  else {
689
695
  this.activeIndex = this.index;
@@ -692,7 +698,7 @@ class ScrollViewComponent {
692
698
  else if (direction === Dir.Prev && this.view.canMovePrev()) {
693
699
  this.index = this.index === 0 ? this.view.total - 1 : this.index - 1;
694
700
  if (this.animate) {
695
- this.animationState = this.isRTL ? 'left' : 'right';
701
+ this.animateTo(this.isRTL ? 'left' : 'right');
696
702
  }
697
703
  else {
698
704
  this.activeIndex = this.index;
@@ -702,6 +708,20 @@ class ScrollViewComponent {
702
708
  get isRTL() {
703
709
  return this.direction === 'rtl';
704
710
  }
711
+ animateTo(state) {
712
+ this.animationState = state;
713
+ const element = this.itemWrapper.nativeElement;
714
+ // Start from the rendered position, which lags behind the drag offset because of the theme's transform transition
715
+ const from = isDocumentAvailable() ? [{ transform: getComputedStyle(element).transform }] : [];
716
+ this.renderer.setStyle(element, 'transition', 'none');
717
+ this.renderer.removeStyle(element, 'transform');
718
+ this.slideAnimation = playAnimation(element, [...from, { transform: SLIDE_TRANSFORMS[state] }], { duration: 300, easing: 'ease-out' }, () => {
719
+ this.slideAnimation = null;
720
+ this.renderer.removeStyle(element, 'transform');
721
+ this.renderer.removeStyle(element, 'transition');
722
+ this.ngZone.run(() => this.transitionEndHandler(state));
723
+ });
724
+ }
705
725
  get prevButtonArrowIcon() {
706
726
  return this.direction === 'ltr' ? 'chevron-left' : 'chevron-right';
707
727
  }
@@ -734,8 +754,6 @@ class ScrollViewComponent {
734
754
  #itemWrapper
735
755
  role="list"
736
756
  [id]="scrollviewId"
737
- [@animateTo]="animationState"
738
- (@animateTo.done)="transitionEndHandler($event)"
739
757
  kendoDraggable
740
758
  (kendoDrag)="handleDrag($event)"
741
759
  (kendoPress)="handlePress($event)"
@@ -802,38 +820,11 @@ class ScrollViewComponent {
802
820
  </div>
803
821
  }
804
822
  <div class="k-sr-only" aria-live="polite"></div>
805
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoScrollViewLocalizedMessages]" }, { kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: ScrollViewPagerComponent, selector: "kendo-scrollview-pager", inputs: ["activeIndex", "data"], outputs: ["pagerIndexChange"] }], animations: [
806
- trigger('animateTo', [
807
- state('center, left, right', style({ transform: 'translateX(0)' })),
808
- transition('* => right', [
809
- animate('300ms ease-out', style({ transform: 'translateX(100%)' }))
810
- ]),
811
- transition('* => left', [
812
- animate('300ms ease-out', style({ transform: 'translateX(-100%)' }))
813
- ]),
814
- transition('* => center', [
815
- animate('300ms ease-out')
816
- ])
817
- ])
818
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
823
+ `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoScrollViewLocalizedMessages]" }, { kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: ScrollViewPagerComponent, selector: "kendo-scrollview-pager", inputs: ["activeIndex", "data"], outputs: ["pagerIndexChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
819
824
  }
820
825
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: ScrollViewComponent, decorators: [{
821
826
  type: Component,
822
827
  args: [{
823
- animations: [
824
- trigger('animateTo', [
825
- state('center, left, right', style({ transform: 'translateX(0)' })),
826
- transition('* => right', [
827
- animate('300ms ease-out', style({ transform: 'translateX(100%)' }))
828
- ]),
829
- transition('* => left', [
830
- animate('300ms ease-out', style({ transform: 'translateX(-100%)' }))
831
- ]),
832
- transition('* => center', [
833
- animate('300ms ease-out')
834
- ])
835
- ])
836
- ],
837
828
  exportAs: 'kendoScrollView',
838
829
  providers: [
839
830
  LocalizationService,
@@ -857,8 +848,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImpo
857
848
  #itemWrapper
858
849
  role="list"
859
850
  [id]="scrollviewId"
860
- [@animateTo]="animationState"
861
- (@animateTo.done)="transitionEndHandler($event)"
862
851
  kendoDraggable
863
852
  (kendoDrag)="handleDrag($event)"
864
853
  (kendoPress)="handlePress($event)"
package/index.d.ts CHANGED
@@ -4,7 +4,6 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as i0 from '@angular/core';
6
6
  import { OnInit, OnDestroy, ElementRef, EventEmitter, TemplateRef, NgZone, Renderer2 } from '@angular/core';
7
- import { AnimationEvent } from '@angular/animations';
8
7
  import { LocalizationService, ComponentMessages } from '@progress/kendo-angular-l10n';
9
8
  import { SVGIcon } from '@progress/kendo-svg-icons';
10
9
 
@@ -187,6 +186,7 @@ declare class ScrollViewComponent implements OnInit, OnDestroy {
187
186
  scrollviewId: string;
188
187
  isDataSourceEmpty: boolean;
189
188
  private subs;
189
+ private slideAnimation;
190
190
  private index;
191
191
  private initialTouchCoordinate;
192
192
  private pageIndex;
@@ -216,7 +216,7 @@ declare class ScrollViewComponent implements OnInit, OnDestroy {
216
216
  /**
217
217
  * @hidden
218
218
  */
219
- transitionEndHandler(e: AnimationEvent): void;
219
+ transitionEndHandler(toState: AnimationState): void;
220
220
  /**
221
221
  * @hidden
222
222
  */
@@ -262,6 +262,7 @@ declare class ScrollViewComponent implements OnInit, OnDestroy {
262
262
  private navigate;
263
263
  private changeIndex;
264
264
  private get isRTL();
265
+ private animateTo;
265
266
  get prevButtonArrowIcon(): string;
266
267
  get nextButtonArrowIcon(): string;
267
268
  get prevButtonArrowSVGIcon(): SVGIcon;
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1795439343,
11
- "version": "26.2.0-develop.6",
10
+ "publishDate": 1795445073,
11
+ "version": "26.2.0-develop.7",
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-scrollview",
3
- "version": "26.2.0-develop.6",
3
+ "version": "26.2.0-develop.7",
4
4
  "description": "A ScrollView Component for Angular",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -19,24 +19,23 @@
19
19
  "package": {
20
20
  "productName": "Kendo UI for Angular",
21
21
  "productCode": "KENDOUIANGULAR",
22
- "publishDate": 1795439343,
22
+ "publishDate": 1795445073,
23
23
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
24
24
  }
25
25
  },
26
26
  "peerDependencies": {
27
- "@angular/animations": "20 - 22",
28
27
  "@angular/common": "20 - 22",
29
28
  "@angular/core": "20 - 22",
30
29
  "@angular/platform-browser": "20 - 22",
31
30
  "@progress/kendo-licensing": "^1.13.1",
32
- "@progress/kendo-angular-common": "26.2.0-develop.6",
33
- "@progress/kendo-angular-l10n": "26.2.0-develop.6",
34
- "@progress/kendo-angular-icons": "26.2.0-develop.6",
31
+ "@progress/kendo-angular-common": "26.2.0-develop.7",
32
+ "@progress/kendo-angular-l10n": "26.2.0-develop.7",
33
+ "@progress/kendo-angular-icons": "26.2.0-develop.7",
35
34
  "rxjs": "^6.5.3 || ^7.0.0"
36
35
  },
37
36
  "dependencies": {
38
37
  "tslib": "^2.3.1",
39
- "@progress/kendo-angular-schematics": "26.2.0-develop.6"
38
+ "@progress/kendo-angular-schematics": "26.2.0-develop.7"
40
39
  },
41
40
  "schematics": "./schematics/collection.json",
42
41
  "module": "fesm2022/progress-kendo-angular-scrollview.mjs",