@progress/kendo-angular-scrollview 4.1.1 → 4.1.3
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/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-scrollview.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/scrollview.component.js +23 -58
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/scrollview.component.d.ts +7 -11
- package/dist/es2015/scrollview.component.js +23 -41
- package/dist/fesm2015/index.js +24 -42
- package/dist/fesm5/index.js +24 -59
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/scrollview.component.js +22 -57
- package/dist/systemjs/kendo-angular-scrollview.js +1 -1
- package/package.json +6 -5
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
|
-
import {
|
|
6
|
+
import { Component, ContentChild, ElementRef, EventEmitter, HostBinding, HostListener, Input, Output, TemplateRef, NgZone, ViewChild, Renderer2 } from '@angular/core';
|
|
7
7
|
import { animate, state, style, transition, trigger } from '@angular/animations';
|
|
8
8
|
import { Dir } from './enums';
|
|
9
9
|
import { Keys } from '@progress/kendo-angular-common';
|
|
@@ -65,11 +65,11 @@ import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
67
|
let ScrollViewComponent = class ScrollViewComponent {
|
|
68
|
-
constructor(element,
|
|
68
|
+
constructor(element, localization, ngZone, renderer) {
|
|
69
69
|
this.element = element;
|
|
70
|
-
this.application = application;
|
|
71
70
|
this.localization = localization;
|
|
72
71
|
this.ngZone = ngZone;
|
|
72
|
+
this.renderer = renderer;
|
|
73
73
|
/**
|
|
74
74
|
* Provides the data source for the ScrollView ([see example]({% slug datasources_scrollview %})).
|
|
75
75
|
*/
|
|
@@ -108,9 +108,11 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
108
108
|
* Fires after the activeIndex has changed. Allows for two-way binding of the activeIndex property.
|
|
109
109
|
*/
|
|
110
110
|
this.activeIndexChange = new EventEmitter();
|
|
111
|
+
this.scrollViewClass = true;
|
|
112
|
+
this.tabIndex = 1;
|
|
113
|
+
this.ariaLive = 'assertive';
|
|
111
114
|
this.touchAction = 'pan-y pinch-zoom';
|
|
112
115
|
this.animationState = null;
|
|
113
|
-
this.transitionStyle = null;
|
|
114
116
|
this.view = new DataCollection(() => new DataResultIterator(this.data, this.activeIndex, this.endless, this.pageIndex, this.isRTL));
|
|
115
117
|
this.isDataSourceEmpty = false;
|
|
116
118
|
this._activeIndex = 0;
|
|
@@ -128,12 +130,6 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
128
130
|
get activeIndex() {
|
|
129
131
|
return this._activeIndex;
|
|
130
132
|
}
|
|
131
|
-
get widgetClass() {
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
get scrollViewClass() {
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
133
|
get scrollViewLightOverlayClass() {
|
|
138
134
|
return this.pagerOverlay === 'light';
|
|
139
135
|
}
|
|
@@ -142,8 +138,6 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
142
138
|
}
|
|
143
139
|
get hostWidth() { return this.width; }
|
|
144
140
|
get hostHeight() { return this.height; }
|
|
145
|
-
get tabIndex() { return 1; }
|
|
146
|
-
get ariaLive() { return 'assertive'; }
|
|
147
141
|
get dir() {
|
|
148
142
|
return this.direction;
|
|
149
143
|
}
|
|
@@ -171,9 +165,6 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
171
165
|
}
|
|
172
166
|
}
|
|
173
167
|
}
|
|
174
|
-
/**
|
|
175
|
-
* @hidden
|
|
176
|
-
*/
|
|
177
168
|
ngOnChanges(_) {
|
|
178
169
|
this.activeIndex = Math.max(Math.min(this.activeIndex, this.view.total - 1), 0);
|
|
179
170
|
}
|
|
@@ -194,7 +185,6 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
194
185
|
*/
|
|
195
186
|
transitionEndHandler(e) {
|
|
196
187
|
this.animationState = null;
|
|
197
|
-
this.transitionStyle = null;
|
|
198
188
|
if (e.toState === 'left' || e.toState === 'right') {
|
|
199
189
|
if (this.pageIndex !== null) {
|
|
200
190
|
this.activeIndex = this.pageIndex;
|
|
@@ -203,7 +193,6 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
203
193
|
this.activeIndex = this.index;
|
|
204
194
|
this.activeIndexChange.emit(this.activeIndex);
|
|
205
195
|
this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
|
|
206
|
-
this.application.tick();
|
|
207
196
|
}
|
|
208
197
|
}
|
|
209
198
|
/**
|
|
@@ -218,10 +207,7 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
218
207
|
handleDrag(e) {
|
|
219
208
|
const deltaX = e.pageX - this.initialTouchCoordinate;
|
|
220
209
|
if (!this.animationState && !this.isDragForbidden(deltaX) && this.draggedInsideBounds(deltaX)) {
|
|
221
|
-
|
|
222
|
-
this.ngZone.run(() => {
|
|
223
|
-
this.transitionStyle = `translateX(${deltaX}px)`;
|
|
224
|
-
});
|
|
210
|
+
this.renderer.setStyle(this.itemWrapper.nativeElement, 'transform', `translateX(${deltaX}px)`);
|
|
225
211
|
}
|
|
226
212
|
}
|
|
227
213
|
/**
|
|
@@ -241,17 +227,17 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
241
227
|
this.changeIndex(deltaX > 0 ? Dir.Prev : Dir.Next);
|
|
242
228
|
}
|
|
243
229
|
if (!this.animate) {
|
|
244
|
-
this.
|
|
230
|
+
this.renderer.removeStyle(this.itemWrapper.nativeElement, 'transform');
|
|
245
231
|
this.activeIndexChange.emit(this.activeIndex);
|
|
246
232
|
this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
|
|
247
233
|
}
|
|
248
234
|
}
|
|
249
|
-
else
|
|
250
|
-
if (this.animate) {
|
|
235
|
+
else {
|
|
236
|
+
if (this.animate && deltaX) {
|
|
251
237
|
this.animationState = 'center';
|
|
252
238
|
}
|
|
253
239
|
else {
|
|
254
|
-
this.
|
|
240
|
+
this.renderer.removeStyle(this.itemWrapper.nativeElement, 'transform');
|
|
255
241
|
}
|
|
256
242
|
}
|
|
257
243
|
});
|
|
@@ -435,15 +421,13 @@ tslib_1.__decorate([
|
|
|
435
421
|
tslib_1.__metadata("design:type", TemplateRef)
|
|
436
422
|
], ScrollViewComponent.prototype, "itemTemplateRef", void 0);
|
|
437
423
|
tslib_1.__decorate([
|
|
438
|
-
|
|
439
|
-
tslib_1.__metadata("design:type",
|
|
440
|
-
|
|
441
|
-
], ScrollViewComponent.prototype, "widgetClass", null);
|
|
424
|
+
ViewChild('itemWrapper', { static: false }),
|
|
425
|
+
tslib_1.__metadata("design:type", ElementRef)
|
|
426
|
+
], ScrollViewComponent.prototype, "itemWrapper", void 0);
|
|
442
427
|
tslib_1.__decorate([
|
|
443
428
|
HostBinding('class.k-scrollview'),
|
|
444
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
445
|
-
|
|
446
|
-
], ScrollViewComponent.prototype, "scrollViewClass", null);
|
|
429
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
430
|
+
], ScrollViewComponent.prototype, "scrollViewClass", void 0);
|
|
447
431
|
tslib_1.__decorate([
|
|
448
432
|
HostBinding('class.k-scrollview-light'),
|
|
449
433
|
tslib_1.__metadata("design:type", Boolean),
|
|
@@ -466,14 +450,12 @@ tslib_1.__decorate([
|
|
|
466
450
|
], ScrollViewComponent.prototype, "hostHeight", null);
|
|
467
451
|
tslib_1.__decorate([
|
|
468
452
|
HostBinding('attr.tabindex'),
|
|
469
|
-
tslib_1.__metadata("design:type", Number)
|
|
470
|
-
|
|
471
|
-
], ScrollViewComponent.prototype, "tabIndex", null);
|
|
453
|
+
tslib_1.__metadata("design:type", Number)
|
|
454
|
+
], ScrollViewComponent.prototype, "tabIndex", void 0);
|
|
472
455
|
tslib_1.__decorate([
|
|
473
456
|
HostBinding('attr.aria-live'),
|
|
474
|
-
tslib_1.__metadata("design:type", String)
|
|
475
|
-
|
|
476
|
-
], ScrollViewComponent.prototype, "ariaLive", null);
|
|
457
|
+
tslib_1.__metadata("design:type", String)
|
|
458
|
+
], ScrollViewComponent.prototype, "ariaLive", void 0);
|
|
477
459
|
tslib_1.__decorate([
|
|
478
460
|
HostBinding('attr.dir'),
|
|
479
461
|
tslib_1.__metadata("design:type", String),
|
|
@@ -516,7 +498,7 @@ ScrollViewComponent = tslib_1.__decorate([
|
|
|
516
498
|
selector: 'kendo-scrollview',
|
|
517
499
|
template: `
|
|
518
500
|
<ul class='k-scrollview-wrap'
|
|
519
|
-
|
|
501
|
+
#itemWrapper
|
|
520
502
|
[@animateTo]="animationState"
|
|
521
503
|
(@animateTo.done)="transitionEndHandler($event)"
|
|
522
504
|
kendoDraggable
|
|
@@ -562,8 +544,8 @@ ScrollViewComponent = tslib_1.__decorate([
|
|
|
562
544
|
`
|
|
563
545
|
}),
|
|
564
546
|
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
565
|
-
ApplicationRef,
|
|
566
547
|
LocalizationService,
|
|
567
|
-
NgZone
|
|
548
|
+
NgZone,
|
|
549
|
+
Renderer2])
|
|
568
550
|
], ScrollViewComponent);
|
|
569
551
|
export { ScrollViewComponent };
|
package/dist/fesm2015/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { __decorate, __metadata } from 'tslib';
|
|
6
|
-
import { EventEmitter, Input, Output, ContentChild, TemplateRef, HostBinding, HostListener, Component,
|
|
6
|
+
import { EventEmitter, Input, Output, ContentChild, TemplateRef, ViewChild, ElementRef, HostBinding, HostListener, Component, NgZone, Renderer2, NgModule } from '@angular/core';
|
|
7
7
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
8
8
|
import { Keys, DraggableModule } from '@progress/kendo-angular-common';
|
|
9
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
@@ -26,7 +26,7 @@ const packageMetadata = {
|
|
|
26
26
|
name: '@progress/kendo-angular-scrollview',
|
|
27
27
|
productName: 'Kendo UI for Angular',
|
|
28
28
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
29
|
-
publishDate:
|
|
29
|
+
publishDate: 1642584967,
|
|
30
30
|
version: '',
|
|
31
31
|
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'
|
|
32
32
|
};
|
|
@@ -171,11 +171,11 @@ class DataCollection {
|
|
|
171
171
|
* ```
|
|
172
172
|
*/
|
|
173
173
|
let ScrollViewComponent = class ScrollViewComponent {
|
|
174
|
-
constructor(element,
|
|
174
|
+
constructor(element, localization, ngZone, renderer) {
|
|
175
175
|
this.element = element;
|
|
176
|
-
this.application = application;
|
|
177
176
|
this.localization = localization;
|
|
178
177
|
this.ngZone = ngZone;
|
|
178
|
+
this.renderer = renderer;
|
|
179
179
|
/**
|
|
180
180
|
* Provides the data source for the ScrollView ([see example]({% slug datasources_scrollview %})).
|
|
181
181
|
*/
|
|
@@ -214,9 +214,11 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
214
214
|
* Fires after the activeIndex has changed. Allows for two-way binding of the activeIndex property.
|
|
215
215
|
*/
|
|
216
216
|
this.activeIndexChange = new EventEmitter();
|
|
217
|
+
this.scrollViewClass = true;
|
|
218
|
+
this.tabIndex = 1;
|
|
219
|
+
this.ariaLive = 'assertive';
|
|
217
220
|
this.touchAction = 'pan-y pinch-zoom';
|
|
218
221
|
this.animationState = null;
|
|
219
|
-
this.transitionStyle = null;
|
|
220
222
|
this.view = new DataCollection(() => new DataResultIterator(this.data, this.activeIndex, this.endless, this.pageIndex, this.isRTL));
|
|
221
223
|
this.isDataSourceEmpty = false;
|
|
222
224
|
this._activeIndex = 0;
|
|
@@ -234,12 +236,6 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
234
236
|
get activeIndex() {
|
|
235
237
|
return this._activeIndex;
|
|
236
238
|
}
|
|
237
|
-
get widgetClass() {
|
|
238
|
-
return true;
|
|
239
|
-
}
|
|
240
|
-
get scrollViewClass() {
|
|
241
|
-
return true;
|
|
242
|
-
}
|
|
243
239
|
get scrollViewLightOverlayClass() {
|
|
244
240
|
return this.pagerOverlay === 'light';
|
|
245
241
|
}
|
|
@@ -248,8 +244,6 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
248
244
|
}
|
|
249
245
|
get hostWidth() { return this.width; }
|
|
250
246
|
get hostHeight() { return this.height; }
|
|
251
|
-
get tabIndex() { return 1; }
|
|
252
|
-
get ariaLive() { return 'assertive'; }
|
|
253
247
|
get dir() {
|
|
254
248
|
return this.direction;
|
|
255
249
|
}
|
|
@@ -277,9 +271,6 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
277
271
|
}
|
|
278
272
|
}
|
|
279
273
|
}
|
|
280
|
-
/**
|
|
281
|
-
* @hidden
|
|
282
|
-
*/
|
|
283
274
|
ngOnChanges(_) {
|
|
284
275
|
this.activeIndex = Math.max(Math.min(this.activeIndex, this.view.total - 1), 0);
|
|
285
276
|
}
|
|
@@ -300,7 +291,6 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
300
291
|
*/
|
|
301
292
|
transitionEndHandler(e) {
|
|
302
293
|
this.animationState = null;
|
|
303
|
-
this.transitionStyle = null;
|
|
304
294
|
if (e.toState === 'left' || e.toState === 'right') {
|
|
305
295
|
if (this.pageIndex !== null) {
|
|
306
296
|
this.activeIndex = this.pageIndex;
|
|
@@ -309,7 +299,6 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
309
299
|
this.activeIndex = this.index;
|
|
310
300
|
this.activeIndexChange.emit(this.activeIndex);
|
|
311
301
|
this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
|
|
312
|
-
this.application.tick();
|
|
313
302
|
}
|
|
314
303
|
}
|
|
315
304
|
/**
|
|
@@ -324,10 +313,7 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
324
313
|
handleDrag(e) {
|
|
325
314
|
const deltaX = e.pageX - this.initialTouchCoordinate;
|
|
326
315
|
if (!this.animationState && !this.isDragForbidden(deltaX) && this.draggedInsideBounds(deltaX)) {
|
|
327
|
-
|
|
328
|
-
this.ngZone.run(() => {
|
|
329
|
-
this.transitionStyle = `translateX(${deltaX}px)`;
|
|
330
|
-
});
|
|
316
|
+
this.renderer.setStyle(this.itemWrapper.nativeElement, 'transform', `translateX(${deltaX}px)`);
|
|
331
317
|
}
|
|
332
318
|
}
|
|
333
319
|
/**
|
|
@@ -347,17 +333,17 @@ let ScrollViewComponent = class ScrollViewComponent {
|
|
|
347
333
|
this.changeIndex(deltaX > 0 ? Dir.Prev : Dir.Next);
|
|
348
334
|
}
|
|
349
335
|
if (!this.animate) {
|
|
350
|
-
this.
|
|
336
|
+
this.renderer.removeStyle(this.itemWrapper.nativeElement, 'transform');
|
|
351
337
|
this.activeIndexChange.emit(this.activeIndex);
|
|
352
338
|
this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
|
|
353
339
|
}
|
|
354
340
|
}
|
|
355
|
-
else
|
|
356
|
-
if (this.animate) {
|
|
341
|
+
else {
|
|
342
|
+
if (this.animate && deltaX) {
|
|
357
343
|
this.animationState = 'center';
|
|
358
344
|
}
|
|
359
345
|
else {
|
|
360
|
-
this.
|
|
346
|
+
this.renderer.removeStyle(this.itemWrapper.nativeElement, 'transform');
|
|
361
347
|
}
|
|
362
348
|
}
|
|
363
349
|
});
|
|
@@ -541,15 +527,13 @@ __decorate([
|
|
|
541
527
|
__metadata("design:type", TemplateRef)
|
|
542
528
|
], ScrollViewComponent.prototype, "itemTemplateRef", void 0);
|
|
543
529
|
__decorate([
|
|
544
|
-
|
|
545
|
-
__metadata("design:type",
|
|
546
|
-
|
|
547
|
-
], ScrollViewComponent.prototype, "widgetClass", null);
|
|
530
|
+
ViewChild('itemWrapper', { static: false }),
|
|
531
|
+
__metadata("design:type", ElementRef)
|
|
532
|
+
], ScrollViewComponent.prototype, "itemWrapper", void 0);
|
|
548
533
|
__decorate([
|
|
549
534
|
HostBinding('class.k-scrollview'),
|
|
550
|
-
__metadata("design:type", Boolean)
|
|
551
|
-
|
|
552
|
-
], ScrollViewComponent.prototype, "scrollViewClass", null);
|
|
535
|
+
__metadata("design:type", Boolean)
|
|
536
|
+
], ScrollViewComponent.prototype, "scrollViewClass", void 0);
|
|
553
537
|
__decorate([
|
|
554
538
|
HostBinding('class.k-scrollview-light'),
|
|
555
539
|
__metadata("design:type", Boolean),
|
|
@@ -572,14 +556,12 @@ __decorate([
|
|
|
572
556
|
], ScrollViewComponent.prototype, "hostHeight", null);
|
|
573
557
|
__decorate([
|
|
574
558
|
HostBinding('attr.tabindex'),
|
|
575
|
-
__metadata("design:type", Number)
|
|
576
|
-
|
|
577
|
-
], ScrollViewComponent.prototype, "tabIndex", null);
|
|
559
|
+
__metadata("design:type", Number)
|
|
560
|
+
], ScrollViewComponent.prototype, "tabIndex", void 0);
|
|
578
561
|
__decorate([
|
|
579
562
|
HostBinding('attr.aria-live'),
|
|
580
|
-
__metadata("design:type", String)
|
|
581
|
-
|
|
582
|
-
], ScrollViewComponent.prototype, "ariaLive", null);
|
|
563
|
+
__metadata("design:type", String)
|
|
564
|
+
], ScrollViewComponent.prototype, "ariaLive", void 0);
|
|
583
565
|
__decorate([
|
|
584
566
|
HostBinding('attr.dir'),
|
|
585
567
|
__metadata("design:type", String),
|
|
@@ -622,7 +604,7 @@ ScrollViewComponent = __decorate([
|
|
|
622
604
|
selector: 'kendo-scrollview',
|
|
623
605
|
template: `
|
|
624
606
|
<ul class='k-scrollview-wrap'
|
|
625
|
-
|
|
607
|
+
#itemWrapper
|
|
626
608
|
[@animateTo]="animationState"
|
|
627
609
|
(@animateTo.done)="transitionEndHandler($event)"
|
|
628
610
|
kendoDraggable
|
|
@@ -668,9 +650,9 @@ ScrollViewComponent = __decorate([
|
|
|
668
650
|
`
|
|
669
651
|
}),
|
|
670
652
|
__metadata("design:paramtypes", [ElementRef,
|
|
671
|
-
ApplicationRef,
|
|
672
653
|
LocalizationService,
|
|
673
|
-
NgZone
|
|
654
|
+
NgZone,
|
|
655
|
+
Renderer2])
|
|
674
656
|
], ScrollViewComponent);
|
|
675
657
|
|
|
676
658
|
/**
|
package/dist/fesm5/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { __decorate, __metadata } from 'tslib';
|
|
6
|
-
import { Input, Output, EventEmitter, ContentChild, TemplateRef, HostBinding, HostListener, Component,
|
|
6
|
+
import { Input, Output, EventEmitter, ContentChild, TemplateRef, ViewChild, ElementRef, HostBinding, HostListener, Component, NgZone, Renderer2, NgModule } from '@angular/core';
|
|
7
7
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
8
8
|
import { Keys, DraggableModule } from '@progress/kendo-angular-common';
|
|
9
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
@@ -26,7 +26,7 @@ var packageMetadata = {
|
|
|
26
26
|
name: '@progress/kendo-angular-scrollview',
|
|
27
27
|
productName: 'Kendo UI for Angular',
|
|
28
28
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
29
|
-
publishDate:
|
|
29
|
+
publishDate: 1642584967,
|
|
30
30
|
version: '',
|
|
31
31
|
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'
|
|
32
32
|
};
|
|
@@ -189,12 +189,12 @@ var DataCollection = /** @class */ (function () {
|
|
|
189
189
|
* ```
|
|
190
190
|
*/
|
|
191
191
|
var ScrollViewComponent = /** @class */ (function () {
|
|
192
|
-
function ScrollViewComponent(element,
|
|
192
|
+
function ScrollViewComponent(element, localization, ngZone, renderer) {
|
|
193
193
|
var _this = this;
|
|
194
194
|
this.element = element;
|
|
195
|
-
this.application = application;
|
|
196
195
|
this.localization = localization;
|
|
197
196
|
this.ngZone = ngZone;
|
|
197
|
+
this.renderer = renderer;
|
|
198
198
|
/**
|
|
199
199
|
* Provides the data source for the ScrollView ([see example]({% slug datasources_scrollview %})).
|
|
200
200
|
*/
|
|
@@ -233,9 +233,11 @@ var ScrollViewComponent = /** @class */ (function () {
|
|
|
233
233
|
* Fires after the activeIndex has changed. Allows for two-way binding of the activeIndex property.
|
|
234
234
|
*/
|
|
235
235
|
this.activeIndexChange = new EventEmitter();
|
|
236
|
+
this.scrollViewClass = true;
|
|
237
|
+
this.tabIndex = 1;
|
|
238
|
+
this.ariaLive = 'assertive';
|
|
236
239
|
this.touchAction = 'pan-y pinch-zoom';
|
|
237
240
|
this.animationState = null;
|
|
238
|
-
this.transitionStyle = null;
|
|
239
241
|
this.view = new DataCollection(function () {
|
|
240
242
|
return new DataResultIterator(_this.data, _this.activeIndex, _this.endless, _this.pageIndex, _this.isRTL);
|
|
241
243
|
});
|
|
@@ -259,20 +261,6 @@ var ScrollViewComponent = /** @class */ (function () {
|
|
|
259
261
|
enumerable: true,
|
|
260
262
|
configurable: true
|
|
261
263
|
});
|
|
262
|
-
Object.defineProperty(ScrollViewComponent.prototype, "widgetClass", {
|
|
263
|
-
get: function () {
|
|
264
|
-
return true;
|
|
265
|
-
},
|
|
266
|
-
enumerable: true,
|
|
267
|
-
configurable: true
|
|
268
|
-
});
|
|
269
|
-
Object.defineProperty(ScrollViewComponent.prototype, "scrollViewClass", {
|
|
270
|
-
get: function () {
|
|
271
|
-
return true;
|
|
272
|
-
},
|
|
273
|
-
enumerable: true,
|
|
274
|
-
configurable: true
|
|
275
|
-
});
|
|
276
264
|
Object.defineProperty(ScrollViewComponent.prototype, "scrollViewLightOverlayClass", {
|
|
277
265
|
get: function () {
|
|
278
266
|
return this.pagerOverlay === 'light';
|
|
@@ -297,16 +285,6 @@ var ScrollViewComponent = /** @class */ (function () {
|
|
|
297
285
|
enumerable: true,
|
|
298
286
|
configurable: true
|
|
299
287
|
});
|
|
300
|
-
Object.defineProperty(ScrollViewComponent.prototype, "tabIndex", {
|
|
301
|
-
get: function () { return 1; },
|
|
302
|
-
enumerable: true,
|
|
303
|
-
configurable: true
|
|
304
|
-
});
|
|
305
|
-
Object.defineProperty(ScrollViewComponent.prototype, "ariaLive", {
|
|
306
|
-
get: function () { return 'assertive'; },
|
|
307
|
-
enumerable: true,
|
|
308
|
-
configurable: true
|
|
309
|
-
});
|
|
310
288
|
Object.defineProperty(ScrollViewComponent.prototype, "dir", {
|
|
311
289
|
get: function () {
|
|
312
290
|
return this.direction;
|
|
@@ -342,9 +320,6 @@ var ScrollViewComponent = /** @class */ (function () {
|
|
|
342
320
|
}
|
|
343
321
|
}
|
|
344
322
|
};
|
|
345
|
-
/**
|
|
346
|
-
* @hidden
|
|
347
|
-
*/
|
|
348
323
|
ScrollViewComponent.prototype.ngOnChanges = function (_) {
|
|
349
324
|
this.activeIndex = Math.max(Math.min(this.activeIndex, this.view.total - 1), 0);
|
|
350
325
|
};
|
|
@@ -365,7 +340,6 @@ var ScrollViewComponent = /** @class */ (function () {
|
|
|
365
340
|
*/
|
|
366
341
|
ScrollViewComponent.prototype.transitionEndHandler = function (e) {
|
|
367
342
|
this.animationState = null;
|
|
368
|
-
this.transitionStyle = null;
|
|
369
343
|
if (e.toState === 'left' || e.toState === 'right') {
|
|
370
344
|
if (this.pageIndex !== null) {
|
|
371
345
|
this.activeIndex = this.pageIndex;
|
|
@@ -374,7 +348,6 @@ var ScrollViewComponent = /** @class */ (function () {
|
|
|
374
348
|
this.activeIndex = this.index;
|
|
375
349
|
this.activeIndexChange.emit(this.activeIndex);
|
|
376
350
|
this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
|
|
377
|
-
this.application.tick();
|
|
378
351
|
}
|
|
379
352
|
};
|
|
380
353
|
/**
|
|
@@ -387,13 +360,9 @@ var ScrollViewComponent = /** @class */ (function () {
|
|
|
387
360
|
* @hidden
|
|
388
361
|
*/
|
|
389
362
|
ScrollViewComponent.prototype.handleDrag = function (e) {
|
|
390
|
-
var _this = this;
|
|
391
363
|
var deltaX = e.pageX - this.initialTouchCoordinate;
|
|
392
364
|
if (!this.animationState && !this.isDragForbidden(deltaX) && this.draggedInsideBounds(deltaX)) {
|
|
393
|
-
|
|
394
|
-
this.ngZone.run(function () {
|
|
395
|
-
_this.transitionStyle = "translateX(" + deltaX + "px)";
|
|
396
|
-
});
|
|
365
|
+
this.renderer.setStyle(this.itemWrapper.nativeElement, 'transform', "translateX(" + deltaX + "px)");
|
|
397
366
|
}
|
|
398
367
|
};
|
|
399
368
|
/**
|
|
@@ -414,17 +383,17 @@ var ScrollViewComponent = /** @class */ (function () {
|
|
|
414
383
|
_this.changeIndex(deltaX > 0 ? Dir.Prev : Dir.Next);
|
|
415
384
|
}
|
|
416
385
|
if (!_this.animate) {
|
|
417
|
-
_this.
|
|
386
|
+
_this.renderer.removeStyle(_this.itemWrapper.nativeElement, 'transform');
|
|
418
387
|
_this.activeIndexChange.emit(_this.activeIndex);
|
|
419
388
|
_this.itemChanged.emit({ index: _this.activeIndex, item: _this.view.item(1) });
|
|
420
389
|
}
|
|
421
390
|
}
|
|
422
|
-
else
|
|
423
|
-
if (_this.animate) {
|
|
391
|
+
else {
|
|
392
|
+
if (_this.animate && deltaX) {
|
|
424
393
|
_this.animationState = 'center';
|
|
425
394
|
}
|
|
426
395
|
else {
|
|
427
|
-
_this.
|
|
396
|
+
_this.renderer.removeStyle(_this.itemWrapper.nativeElement, 'transform');
|
|
428
397
|
}
|
|
429
398
|
}
|
|
430
399
|
});
|
|
@@ -611,15 +580,13 @@ var ScrollViewComponent = /** @class */ (function () {
|
|
|
611
580
|
__metadata("design:type", TemplateRef)
|
|
612
581
|
], ScrollViewComponent.prototype, "itemTemplateRef", void 0);
|
|
613
582
|
__decorate([
|
|
614
|
-
|
|
615
|
-
__metadata("design:type",
|
|
616
|
-
|
|
617
|
-
], ScrollViewComponent.prototype, "widgetClass", null);
|
|
583
|
+
ViewChild('itemWrapper', { static: false }),
|
|
584
|
+
__metadata("design:type", ElementRef)
|
|
585
|
+
], ScrollViewComponent.prototype, "itemWrapper", void 0);
|
|
618
586
|
__decorate([
|
|
619
587
|
HostBinding('class.k-scrollview'),
|
|
620
|
-
__metadata("design:type", Boolean)
|
|
621
|
-
|
|
622
|
-
], ScrollViewComponent.prototype, "scrollViewClass", null);
|
|
588
|
+
__metadata("design:type", Boolean)
|
|
589
|
+
], ScrollViewComponent.prototype, "scrollViewClass", void 0);
|
|
623
590
|
__decorate([
|
|
624
591
|
HostBinding('class.k-scrollview-light'),
|
|
625
592
|
__metadata("design:type", Boolean),
|
|
@@ -642,14 +609,12 @@ var ScrollViewComponent = /** @class */ (function () {
|
|
|
642
609
|
], ScrollViewComponent.prototype, "hostHeight", null);
|
|
643
610
|
__decorate([
|
|
644
611
|
HostBinding('attr.tabindex'),
|
|
645
|
-
__metadata("design:type", Number)
|
|
646
|
-
|
|
647
|
-
], ScrollViewComponent.prototype, "tabIndex", null);
|
|
612
|
+
__metadata("design:type", Number)
|
|
613
|
+
], ScrollViewComponent.prototype, "tabIndex", void 0);
|
|
648
614
|
__decorate([
|
|
649
615
|
HostBinding('attr.aria-live'),
|
|
650
|
-
__metadata("design:type", String)
|
|
651
|
-
|
|
652
|
-
], ScrollViewComponent.prototype, "ariaLive", null);
|
|
616
|
+
__metadata("design:type", String)
|
|
617
|
+
], ScrollViewComponent.prototype, "ariaLive", void 0);
|
|
653
618
|
__decorate([
|
|
654
619
|
HostBinding('attr.dir'),
|
|
655
620
|
__metadata("design:type", String),
|
|
@@ -690,12 +655,12 @@ var ScrollViewComponent = /** @class */ (function () {
|
|
|
690
655
|
}
|
|
691
656
|
],
|
|
692
657
|
selector: 'kendo-scrollview',
|
|
693
|
-
template: "\n <ul class='k-scrollview-wrap'\n
|
|
658
|
+
template: "\n <ul class='k-scrollview-wrap'\n #itemWrapper\n [@animateTo]=\"animationState\"\n (@animateTo.done)=\"transitionEndHandler($event)\"\n kendoDraggable\n (kendoDrag)=\"handleDrag($event)\"\n (kendoPress)=\"handlePress($event)\"\n (kendoRelease)=\"handleRelease($event)\"\n >\n <li\n *ngFor=\"let item of view;let i=index\"\n [ngStyle]=\"inlineListItemStyles(i)\"\n [attr.aria-hidden]=\"i !== 1\"\n >\n <ng-template\n [ngTemplateOutlet]=\"itemTemplateRef\"\n [ngTemplateOutletContext]=\"{ item: item }\">\n </ng-template>\n </li>\n </ul>\n <div class='k-scrollview-elements'\n [ngStyle]=\"{'height': height}\"\n *ngIf=\"!isDataSourceEmpty && (pageable||arrows)\">\n\n <a class=\"k-scrollview-prev\"\n aria-label=\"previous\"\n *ngIf=\"arrows && displayLeftArrow()\"\n (click)=\"leftArrowClick()\">\n <span class=\"k-icon k-i-arrowhead-w\"></span>\n </a>\n <a class=\"k-scrollview-next\"\n aria-label=\"next\"\n *ngIf=\"arrows && displayRightArrow()\"\n (click)=\"rightArrowClick()\">\n <span class=\"k-icon k-i-arrowhead-e\"></span>\n </a>\n <kendo-scrollview-pager\n class='k-scrollview-nav-wrap'\n *ngIf=\"pageable\"\n (pagerIndexChange)=\"pageChange($event)\"\n [data]=\"data\"\n [activeIndex]=\"activeIndex\">\n </kendo-scrollview-pager>\n </div>\n "
|
|
694
659
|
}),
|
|
695
660
|
__metadata("design:paramtypes", [ElementRef,
|
|
696
|
-
ApplicationRef,
|
|
697
661
|
LocalizationService,
|
|
698
|
-
NgZone
|
|
662
|
+
NgZone,
|
|
663
|
+
Renderer2])
|
|
699
664
|
], ScrollViewComponent);
|
|
700
665
|
return ScrollViewComponent;
|
|
701
666
|
}());
|
|
@@ -11,7 +11,7 @@ exports.packageMetadata = {
|
|
|
11
11
|
name: '@progress/kendo-angular-scrollview',
|
|
12
12
|
productName: 'Kendo UI for Angular',
|
|
13
13
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
14
|
-
publishDate:
|
|
14
|
+
publishDate: 1642584967,
|
|
15
15
|
version: '',
|
|
16
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
17
|
};
|