@progress/kendo-angular-scrollview 4.1.4 → 5.0.0-next.202203230844

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 (51) hide show
  1. package/bundles/kendo-angular-scrollview.umd.js +5 -0
  2. package/{dist/es2015/change-event-args.d.ts → change-event-args.d.ts} +0 -0
  3. package/{dist/es2015/data.collection.d.ts → data.collection.d.ts} +4 -4
  4. package/{dist/es2015/direction.d.ts → direction.d.ts} +0 -0
  5. package/{dist/es2015/enums.d.ts → enums.d.ts} +0 -0
  6. package/{dist/es2015 → esm2015}/change-event-args.js +1 -0
  7. package/{dist/es2015 → esm2015}/data.collection.js +0 -1
  8. package/{dist/es → esm2015}/direction.js +1 -0
  9. package/{dist/es → esm2015}/enums.js +0 -0
  10. package/{dist/es/index.js → esm2015/kendo-angular-scrollview.js} +0 -0
  11. package/{dist/es → esm2015}/main.js +0 -0
  12. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  13. package/esm2015/scrollview-pager.component.js +53 -0
  14. package/{dist/es2015 → esm2015}/scrollview.component.js +160 -136
  15. package/{dist/es2015 → esm2015}/scrollview.module.js +15 -11
  16. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-scrollview.js} +221 -191
  17. package/{dist/es2015/index.d.ts → kendo-angular-scrollview.d.ts} +1 -0
  18. package/{dist/es2015/main.d.ts → main.d.ts} +0 -0
  19. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  20. package/package.json +33 -94
  21. package/schematics/ngAdd/index.js +5 -2
  22. package/schematics/ngAdd/index.js.map +1 -1
  23. package/{dist/es2015/scrollview-pager.component.d.ts → scrollview-pager.component.d.ts} +3 -0
  24. package/{dist/es2015/scrollview.component.d.ts → scrollview.component.d.ts} +12 -8
  25. package/{dist/es2015/scrollview.module.d.ts → scrollview.module.d.ts} +8 -0
  26. package/dist/cdn/js/kendo-angular-scrollview.js +0 -20
  27. package/dist/cdn/main.js +0 -5
  28. package/dist/es/change-event-args.js +0 -4
  29. package/dist/es/data.collection.js +0 -109
  30. package/dist/es/package-metadata.js +0 -15
  31. package/dist/es/scrollview-pager.component.js +0 -43
  32. package/dist/es/scrollview.component.js +0 -543
  33. package/dist/es/scrollview.module.js +0 -61
  34. package/dist/es2015/direction.js +0 -4
  35. package/dist/es2015/enums.js +0 -12
  36. package/dist/es2015/index.js +0 -8
  37. package/dist/es2015/index.metadata.json +0 -1
  38. package/dist/es2015/main.js +0 -7
  39. package/dist/es2015/scrollview-pager.component.js +0 -52
  40. package/dist/fesm5/index.js +0 -759
  41. package/dist/npm/change-event-args.js +0 -6
  42. package/dist/npm/data.collection.js +0 -111
  43. package/dist/npm/direction.js +0 -6
  44. package/dist/npm/enums.js +0 -14
  45. package/dist/npm/index.js +0 -11
  46. package/dist/npm/main.js +0 -12
  47. package/dist/npm/package-metadata.js +0 -17
  48. package/dist/npm/scrollview-pager.component.js +0 -45
  49. package/dist/npm/scrollview.component.js +0 -545
  50. package/dist/npm/scrollview.module.js +0 -63
  51. package/dist/systemjs/kendo-angular-scrollview.js +0 -5
@@ -1,545 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var animations_1 = require("@angular/animations");
10
- var enums_1 = require("./enums");
11
- var kendo_angular_common_1 = require("@progress/kendo-angular-common");
12
- var kendo_licensing_1 = require("@progress/kendo-licensing");
13
- var package_metadata_1 = require("./package-metadata");
14
- var data_collection_1 = require("./data.collection");
15
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
16
- /**
17
- * Represents the [Kendo UI ScrollView component for Angular]({% slug overview_scrollview %}).
18
- *
19
- * @example
20
- * ```ts
21
- *
22
- * _@Component({
23
- * selector: 'my-app',
24
- * template: `
25
- * <kendo-scrollview
26
- * [data]="items"
27
- * [width]="width"
28
- * [height]="height"
29
- * [endless]="endless"
30
- * [pageable]="pageable">
31
- * <ng-template let-item="item">
32
- * <h2 class="demo-title">{{item.title}}</h2>
33
- * <img src='{{item.url}}' alt='{{item.title}}' [ngStyle]="{minWidth: width}" draggable="false" />
34
- * </ng-template>
35
- * </kendo-scrollview>
36
- * `,
37
- * styles: [`
38
- * .k-scrollview-wrap {
39
- * margin: 0 auto;
40
- * }
41
- * .demo-title {
42
- * position: absolute;
43
- * top: 0;
44
- * left: 0;
45
- * right: 0;
46
- * margin: 0;
47
- * padding: 15px;
48
- * color: #fff;
49
- * background-color: rgba(0,0,0,.4);
50
- * text-align: center;
51
- * font-size: 24px;
52
- * }
53
- * `]
54
- * })
55
- *
56
- * class AppComponent {
57
- * public width: string = "600px";
58
- * public height: string = "400px";
59
- * public endless: boolean = false;
60
- * public pageable: boolean = false;
61
- * public items: any[] = [
62
- * { title: 'Flower', url: 'https://bit.ly/2cJjYuB' },
63
- * { title: 'Mountain', url: 'https://bit.ly/2cTBNaL' },
64
- * { title: 'Sky', url: 'https://bit.ly/2cJl3Cx' }
65
- * ];
66
- * }
67
- * ```
68
- */
69
- var ScrollViewComponent = /** @class */ (function () {
70
- function ScrollViewComponent(element, localization, ngZone, renderer) {
71
- var _this = this;
72
- this.element = element;
73
- this.localization = localization;
74
- this.ngZone = ngZone;
75
- this.renderer = renderer;
76
- /**
77
- * Provides the data source for the ScrollView ([see example]({% slug datasources_scrollview %})).
78
- */
79
- this.data = [];
80
- /**
81
- * Enables or disables the endless scrolling mode in which the data source items are endlessly looped
82
- * ([see example]({% slug endlessscrolling_scrollview %})). By default, `endless` is set to `false`
83
- * and the endless scrolling mode is disabled.
84
- */
85
- this.endless = false;
86
- /**
87
- * Sets `pagerOverlay` to one of three possible values: `dark`, `light` or `none`.
88
- * By default, the pager overlay is set to `none`.
89
- */
90
- this.pagerOverlay = 'none';
91
- /**
92
- * Enables or disables the built-in animations ([see example]({% slug animations_scrollview %})).
93
- * By default, `animate` is set to `true` and animations are enabled.
94
- */
95
- this.animate = true;
96
- /**
97
- * Enables or disables the built-in pager ([see example]({% slug paging_scrollview %})).
98
- * By default, `pageable` is set to `false` and paging is disabled.
99
- */
100
- this.pageable = false;
101
- /**
102
- * Enables or disables the built-in navigation arrows ([see example]({% slug arrows_scrollview %})).
103
- * By default, `arrows` is set to `false` and arrows are disabled.
104
- */
105
- this.arrows = false;
106
- /**
107
- * Fires after the current item is changed.
108
- */
109
- this.itemChanged = new core_1.EventEmitter();
110
- /**
111
- * Fires after the activeIndex has changed. Allows for two-way binding of the activeIndex property.
112
- */
113
- this.activeIndexChange = new core_1.EventEmitter();
114
- this.scrollViewClass = true;
115
- this.tabIndex = 1;
116
- this.ariaLive = 'assertive';
117
- this.touchAction = 'pan-y pinch-zoom';
118
- this.animationState = null;
119
- this.view = new data_collection_1.DataCollection(function () {
120
- return new data_collection_1.DataResultIterator(_this.data, _this.activeIndex, _this.endless, _this.pageIndex, _this.isRTL);
121
- });
122
- this.isDataSourceEmpty = false;
123
- this._activeIndex = 0;
124
- this.index = 0;
125
- this.pageIndex = null;
126
- this.transforms = ['translateX(-100%)', 'translateX(0%)', 'translateX(100%)'];
127
- kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
128
- }
129
- Object.defineProperty(ScrollViewComponent.prototype, "activeIndex", {
130
- get: function () {
131
- return this._activeIndex;
132
- },
133
- /**
134
- * Represents the current item index ([see example]({% slug activeitems_scrollview %})).
135
- */
136
- set: function (value) {
137
- this.index = this._activeIndex = value;
138
- },
139
- enumerable: true,
140
- configurable: true
141
- });
142
- Object.defineProperty(ScrollViewComponent.prototype, "scrollViewLightOverlayClass", {
143
- get: function () {
144
- return this.pagerOverlay === 'light';
145
- },
146
- enumerable: true,
147
- configurable: true
148
- });
149
- Object.defineProperty(ScrollViewComponent.prototype, "scrollViewDarkOverlayClass", {
150
- get: function () {
151
- return this.pagerOverlay === 'dark';
152
- },
153
- enumerable: true,
154
- configurable: true
155
- });
156
- Object.defineProperty(ScrollViewComponent.prototype, "hostWidth", {
157
- get: function () { return this.width; },
158
- enumerable: true,
159
- configurable: true
160
- });
161
- Object.defineProperty(ScrollViewComponent.prototype, "hostHeight", {
162
- get: function () { return this.height; },
163
- enumerable: true,
164
- configurable: true
165
- });
166
- Object.defineProperty(ScrollViewComponent.prototype, "dir", {
167
- get: function () {
168
- return this.direction;
169
- },
170
- enumerable: true,
171
- configurable: true
172
- });
173
- Object.defineProperty(ScrollViewComponent.prototype, "direction", {
174
- get: function () {
175
- return this.localization.rtl ? 'rtl' : 'ltr';
176
- },
177
- enumerable: true,
178
- configurable: true
179
- });
180
- /**
181
- * @hidden
182
- */
183
- ScrollViewComponent.prototype.keyDown = function (e) {
184
- if (e.keyCode === kendo_angular_common_1.Keys.ArrowLeft) {
185
- if (this.isRTL) {
186
- this.next();
187
- }
188
- else {
189
- this.prev();
190
- }
191
- }
192
- if (e.keyCode === kendo_angular_common_1.Keys.ArrowRight) {
193
- if (this.isRTL) {
194
- this.prev();
195
- }
196
- else {
197
- this.next();
198
- }
199
- }
200
- };
201
- ScrollViewComponent.prototype.ngOnChanges = function (_) {
202
- this.activeIndex = Math.max(Math.min(this.activeIndex, this.view.total - 1), 0);
203
- };
204
- /**
205
- * Navigates the ScrollView to the previous item.
206
- */
207
- ScrollViewComponent.prototype.prev = function () {
208
- this.navigate(enums_1.Dir.Prev);
209
- };
210
- /**
211
- * Navigates the ScrollView to the next item.
212
- */
213
- ScrollViewComponent.prototype.next = function () {
214
- this.navigate(enums_1.Dir.Next);
215
- };
216
- /**
217
- * @hidden
218
- */
219
- ScrollViewComponent.prototype.transitionEndHandler = function (e) {
220
- this.animationState = null;
221
- if (e.toState === 'left' || e.toState === 'right') {
222
- if (this.pageIndex !== null) {
223
- this.activeIndex = this.pageIndex;
224
- this.pageIndex = null;
225
- }
226
- this.activeIndex = this.index;
227
- this.activeIndexChange.emit(this.activeIndex);
228
- this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
229
- }
230
- };
231
- /**
232
- * @hidden
233
- */
234
- ScrollViewComponent.prototype.handlePress = function (e) {
235
- this.initialTouchCoordinate = e.pageX;
236
- };
237
- /**
238
- * @hidden
239
- */
240
- ScrollViewComponent.prototype.handleDrag = function (e) {
241
- var deltaX = e.pageX - this.initialTouchCoordinate;
242
- if (!this.animationState && !this.isDragForbidden(deltaX) && this.draggedInsideBounds(deltaX)) {
243
- this.renderer.setStyle(this.itemWrapper.nativeElement, 'transform', "translateX(" + deltaX + "px)");
244
- }
245
- };
246
- /**
247
- * @hidden
248
- */
249
- ScrollViewComponent.prototype.handleRelease = function (e) {
250
- var _this = this;
251
- var deltaX = e.pageX - this.initialTouchCoordinate;
252
- if (this.isDragForbidden(deltaX)) {
253
- return;
254
- }
255
- this.ngZone.run(function () {
256
- if (_this.draggedEnoughToNavigate(deltaX)) {
257
- if (_this.isRTL) {
258
- _this.changeIndex(deltaX < 0 ? enums_1.Dir.Prev : enums_1.Dir.Next);
259
- }
260
- else {
261
- _this.changeIndex(deltaX > 0 ? enums_1.Dir.Prev : enums_1.Dir.Next);
262
- }
263
- if (!_this.animate) {
264
- _this.renderer.removeStyle(_this.itemWrapper.nativeElement, 'transform');
265
- _this.activeIndexChange.emit(_this.activeIndex);
266
- _this.itemChanged.emit({ index: _this.activeIndex, item: _this.view.item(1) });
267
- }
268
- }
269
- else {
270
- if (_this.animate && deltaX) {
271
- _this.animationState = 'center';
272
- }
273
- else {
274
- _this.renderer.removeStyle(_this.itemWrapper.nativeElement, 'transform');
275
- }
276
- }
277
- });
278
- };
279
- /**
280
- * @hidden
281
- */
282
- ScrollViewComponent.prototype.pageChange = function (idx) {
283
- if (!this.animationState && this.activeIndex !== idx) {
284
- if (this.animate) {
285
- this.pageIndex = idx;
286
- if (this.isRTL) {
287
- this.animationState = (this.pageIndex > this.index ? 'right' : 'left');
288
- }
289
- else {
290
- this.animationState = (this.pageIndex > this.index ? 'left' : 'right');
291
- }
292
- }
293
- else {
294
- this.activeIndex = idx;
295
- }
296
- }
297
- };
298
- /**
299
- * @hidden
300
- */
301
- ScrollViewComponent.prototype.inlineListItemStyles = function (idx) {
302
- return {
303
- 'height': this.height,
304
- 'transform': this.transforms[idx],
305
- 'width': '100%'
306
- };
307
- };
308
- /**
309
- * @hidden
310
- */
311
- ScrollViewComponent.prototype.displayLeftArrow = function () {
312
- var isNotBorderItem;
313
- if (this.isRTL) {
314
- isNotBorderItem = this.activeIndex + 1 < this.view.total;
315
- }
316
- else {
317
- isNotBorderItem = this.activeIndex > 0;
318
- }
319
- return (this.endless || isNotBorderItem) && this.view.total > 0;
320
- };
321
- /**
322
- * @hidden
323
- */
324
- ScrollViewComponent.prototype.leftArrowClick = function () {
325
- if (this.isRTL) {
326
- this.next();
327
- }
328
- else {
329
- this.prev();
330
- }
331
- };
332
- /**
333
- * @hidden
334
- */
335
- ScrollViewComponent.prototype.displayRightArrow = function () {
336
- var isNotBorderItem;
337
- if (this.isRTL) {
338
- isNotBorderItem = this.activeIndex > 0;
339
- }
340
- else {
341
- isNotBorderItem = this.activeIndex + 1 < this.view.total;
342
- }
343
- return (this.endless || isNotBorderItem) && this.view.total > 0;
344
- };
345
- /**
346
- * @hidden
347
- */
348
- ScrollViewComponent.prototype.rightArrowClick = function () {
349
- if (this.isRTL) {
350
- this.prev();
351
- }
352
- else {
353
- this.next();
354
- }
355
- };
356
- ScrollViewComponent.prototype.draggedInsideBounds = function (deltaX) {
357
- return Math.abs(deltaX) <= this.element.nativeElement.offsetWidth;
358
- };
359
- ScrollViewComponent.prototype.draggedEnoughToNavigate = function (deltaX) {
360
- return Math.abs(deltaX) > (this.element.nativeElement.offsetWidth / 2);
361
- };
362
- ScrollViewComponent.prototype.isDragForbidden = function (deltaX) {
363
- var pastEnd;
364
- var isEndReached;
365
- if (this.isRTL) {
366
- pastEnd = deltaX < 0 && deltaX !== 0;
367
- }
368
- else {
369
- pastEnd = deltaX > 0 && deltaX !== 0;
370
- }
371
- isEndReached = ((this.activeIndex === 0 && pastEnd) || (this.activeIndex === this.view.total - 1 && !pastEnd));
372
- return !this.endless && isEndReached;
373
- };
374
- ScrollViewComponent.prototype.navigate = function (direction) {
375
- if (this.isDataSourceEmpty || this.animationState) {
376
- return;
377
- }
378
- this.changeIndex(direction);
379
- if (!this.animate) {
380
- this.activeIndexChange.emit(this.activeIndex);
381
- this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
382
- }
383
- };
384
- ScrollViewComponent.prototype.changeIndex = function (direction) {
385
- if (direction === enums_1.Dir.Next && this.view.canMoveNext()) {
386
- this.index = (this.index + 1) % this.view.total;
387
- if (this.animate) {
388
- this.animationState = this.isRTL ? 'right' : 'left';
389
- }
390
- else {
391
- this.activeIndex = this.index;
392
- }
393
- }
394
- else if (direction === enums_1.Dir.Prev && this.view.canMovePrev()) {
395
- this.index = this.index === 0 ? this.view.total - 1 : this.index - 1;
396
- if (this.animate) {
397
- this.animationState = this.isRTL ? 'left' : 'right';
398
- }
399
- else {
400
- this.activeIndex = this.index;
401
- }
402
- }
403
- };
404
- Object.defineProperty(ScrollViewComponent.prototype, "isRTL", {
405
- get: function () {
406
- return this.direction === 'rtl';
407
- },
408
- enumerable: true,
409
- configurable: true
410
- });
411
- tslib_1.__decorate([
412
- core_1.Input(),
413
- tslib_1.__metadata("design:type", Array)
414
- ], ScrollViewComponent.prototype, "data", void 0);
415
- tslib_1.__decorate([
416
- core_1.Input(),
417
- tslib_1.__metadata("design:type", Number),
418
- tslib_1.__metadata("design:paramtypes", [Number])
419
- ], ScrollViewComponent.prototype, "activeIndex", null);
420
- tslib_1.__decorate([
421
- core_1.Input(),
422
- tslib_1.__metadata("design:type", String)
423
- ], ScrollViewComponent.prototype, "width", void 0);
424
- tslib_1.__decorate([
425
- core_1.Input(),
426
- tslib_1.__metadata("design:type", String)
427
- ], ScrollViewComponent.prototype, "height", void 0);
428
- tslib_1.__decorate([
429
- core_1.Input(),
430
- tslib_1.__metadata("design:type", Boolean)
431
- ], ScrollViewComponent.prototype, "endless", void 0);
432
- tslib_1.__decorate([
433
- core_1.Input(),
434
- tslib_1.__metadata("design:type", String)
435
- ], ScrollViewComponent.prototype, "pagerOverlay", void 0);
436
- tslib_1.__decorate([
437
- core_1.Input(),
438
- tslib_1.__metadata("design:type", Boolean)
439
- ], ScrollViewComponent.prototype, "animate", void 0);
440
- tslib_1.__decorate([
441
- core_1.Input(),
442
- tslib_1.__metadata("design:type", Boolean)
443
- ], ScrollViewComponent.prototype, "pageable", void 0);
444
- tslib_1.__decorate([
445
- core_1.Input(),
446
- tslib_1.__metadata("design:type", Boolean)
447
- ], ScrollViewComponent.prototype, "arrows", void 0);
448
- tslib_1.__decorate([
449
- core_1.Output(),
450
- tslib_1.__metadata("design:type", core_1.EventEmitter)
451
- ], ScrollViewComponent.prototype, "itemChanged", void 0);
452
- tslib_1.__decorate([
453
- core_1.Output(),
454
- tslib_1.__metadata("design:type", core_1.EventEmitter)
455
- ], ScrollViewComponent.prototype, "activeIndexChange", void 0);
456
- tslib_1.__decorate([
457
- core_1.ContentChild(core_1.TemplateRef, { static: false }),
458
- tslib_1.__metadata("design:type", core_1.TemplateRef)
459
- ], ScrollViewComponent.prototype, "itemTemplateRef", void 0);
460
- tslib_1.__decorate([
461
- core_1.ViewChild('itemWrapper', { static: false }),
462
- tslib_1.__metadata("design:type", core_1.ElementRef)
463
- ], ScrollViewComponent.prototype, "itemWrapper", void 0);
464
- tslib_1.__decorate([
465
- core_1.HostBinding('class.k-scrollview'),
466
- tslib_1.__metadata("design:type", Boolean)
467
- ], ScrollViewComponent.prototype, "scrollViewClass", void 0);
468
- tslib_1.__decorate([
469
- core_1.HostBinding('class.k-scrollview-light'),
470
- tslib_1.__metadata("design:type", Boolean),
471
- tslib_1.__metadata("design:paramtypes", [])
472
- ], ScrollViewComponent.prototype, "scrollViewLightOverlayClass", null);
473
- tslib_1.__decorate([
474
- core_1.HostBinding('class.k-scrollview-dark'),
475
- tslib_1.__metadata("design:type", Boolean),
476
- tslib_1.__metadata("design:paramtypes", [])
477
- ], ScrollViewComponent.prototype, "scrollViewDarkOverlayClass", null);
478
- tslib_1.__decorate([
479
- core_1.HostBinding('style.width'),
480
- tslib_1.__metadata("design:type", String),
481
- tslib_1.__metadata("design:paramtypes", [])
482
- ], ScrollViewComponent.prototype, "hostWidth", null);
483
- tslib_1.__decorate([
484
- core_1.HostBinding('style.height'),
485
- tslib_1.__metadata("design:type", String),
486
- tslib_1.__metadata("design:paramtypes", [])
487
- ], ScrollViewComponent.prototype, "hostHeight", null);
488
- tslib_1.__decorate([
489
- core_1.HostBinding('attr.tabindex'),
490
- tslib_1.__metadata("design:type", Number)
491
- ], ScrollViewComponent.prototype, "tabIndex", void 0);
492
- tslib_1.__decorate([
493
- core_1.HostBinding('attr.aria-live'),
494
- tslib_1.__metadata("design:type", String)
495
- ], ScrollViewComponent.prototype, "ariaLive", void 0);
496
- tslib_1.__decorate([
497
- core_1.HostBinding('attr.dir'),
498
- tslib_1.__metadata("design:type", String),
499
- tslib_1.__metadata("design:paramtypes", [])
500
- ], ScrollViewComponent.prototype, "dir", null);
501
- tslib_1.__decorate([
502
- core_1.HostBinding('style.touch-action'),
503
- tslib_1.__metadata("design:type", String)
504
- ], ScrollViewComponent.prototype, "touchAction", void 0);
505
- tslib_1.__decorate([
506
- core_1.HostListener('keydown', ['$event']),
507
- tslib_1.__metadata("design:type", Function),
508
- tslib_1.__metadata("design:paramtypes", [Object]),
509
- tslib_1.__metadata("design:returntype", void 0)
510
- ], ScrollViewComponent.prototype, "keyDown", null);
511
- ScrollViewComponent = tslib_1.__decorate([
512
- core_1.Component({
513
- animations: [
514
- animations_1.trigger('animateTo', [
515
- animations_1.state('center, left, right', animations_1.style({ transform: 'translateX(0)' })),
516
- animations_1.transition('* => right', [
517
- animations_1.animate('300ms ease-out', animations_1.style({ transform: 'translateX(100%)' }))
518
- ]),
519
- animations_1.transition('* => left', [
520
- animations_1.animate('300ms ease-out', animations_1.style({ transform: 'translateX(-100%)' }))
521
- ]),
522
- animations_1.transition('* => center', [
523
- animations_1.animate('300ms ease-out')
524
- ])
525
- ])
526
- ],
527
- exportAs: 'kendoScrollView',
528
- providers: [
529
- kendo_angular_l10n_1.LocalizationService,
530
- {
531
- provide: kendo_angular_l10n_1.L10N_PREFIX,
532
- useValue: 'kendo.scrollview'
533
- }
534
- ],
535
- selector: 'kendo-scrollview',
536
- 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 "
537
- }),
538
- tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
539
- kendo_angular_l10n_1.LocalizationService,
540
- core_1.NgZone,
541
- core_1.Renderer2])
542
- ], ScrollViewComponent);
543
- return ScrollViewComponent;
544
- }());
545
- exports.ScrollViewComponent = ScrollViewComponent;
@@ -1,63 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var common_1 = require("@angular/common");
10
- var scrollview_component_1 = require("./scrollview.component");
11
- var scrollview_pager_component_1 = require("./scrollview-pager.component");
12
- var kendo_angular_common_1 = require("@progress/kendo-angular-common");
13
- var DECLARATIONS = [
14
- scrollview_component_1.ScrollViewComponent,
15
- scrollview_pager_component_1.ScrollViewPagerComponent
16
- ];
17
- var EXPORTS = [
18
- scrollview_component_1.ScrollViewComponent
19
- ];
20
- /**
21
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
22
- * definition for the ScrollView component.
23
- *
24
- * @example
25
- *
26
- * ```ts-no-run
27
- * // Import the ScrollView module
28
- * import { ScrollViewModule } from '@progress/kendo-angular-scrollview';
29
- *
30
- * // The browser platform with a compiler
31
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32
- *
33
- * import { NgModule } from '@angular/core';
34
- *
35
- * // Import the app component
36
- * import { AppComponent } from './app.component';
37
- *
38
- * // Define the app module
39
- * _@NgModule({
40
- * declarations: [AppComponent], // declare app component
41
- * imports: [BrowserModule, ScrollViewModule], // import ScrollView module
42
- * bootstrap: [AppComponent]
43
- * })
44
- * export class AppModule {}
45
- *
46
- * // Compile and launch the module
47
- * platformBrowserDynamic().bootstrapModule(AppModule);
48
- *
49
- * ```
50
- */
51
- var ScrollViewModule = /** @class */ (function () {
52
- function ScrollViewModule() {
53
- }
54
- ScrollViewModule = tslib_1.__decorate([
55
- core_1.NgModule({
56
- declarations: [DECLARATIONS],
57
- exports: [EXPORTS],
58
- imports: [common_1.CommonModule, kendo_angular_common_1.DraggableModule]
59
- })
60
- ], ScrollViewModule);
61
- return ScrollViewModule;
62
- }());
63
- exports.ScrollViewModule = ScrollViewModule;
@@ -1,5 +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
- System.register("@progress/kendo-angular-scrollview",["tslib","@angular/core","@angular/common","@angular/animations","@progress/kendo-angular-common","@progress/kendo-angular-l10n","@progress/kendo-licensing"],function(o){var r,s,d,l,p,c,h;function t(e){return e.__useDefault?e.default:e}return{setters:[function(e){r=t(e)},function(e){s=t(e)},function(e){d=t(e)},function(e){l=t(e)},function(e){p=t(e)},function(e){c=t(e)},function(e){h=t(e)}],execute:function(){function i(e){if(a[e])return a[e].exports;var t=a[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}var n,a;n=[function(e,t){e.exports=s},function(e,t){e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=n(0),r=n(0),n=(o.prototype.itemClass=function(e){return{"k-primary":e===this.activeIndex}},o.prototype.indexChange=function(e){this.pagerIndexChange.emit(e)},i.__decorate([a.Input(),i.__metadata("design:type",Number)],o.prototype,"activeIndex",void 0),i.__decorate([a.Input(),i.__metadata("design:type",Array)],o.prototype,"data",void 0),i.__decorate([a.Output(),i.__metadata("design:type",r.EventEmitter)],o.prototype,"pagerIndexChange",void 0),i.__decorate([a.Component({selector:"kendo-scrollview-pager",template:'\n <ul class="k-scrollview-pageable k-scrollview-nav">\n <li class="k-button" *ngFor="let item of data; let i = index"\n [ngClass]="itemClass(i)"\n (click)="indexChange(i)">\n </li>\n </ul>\n '})],o));function o(){this.pagerIndexChange=new r.EventEmitter}t.ScrollViewPagerComponent=n},function(e,t){e.exports=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),r=n(0),a=n(12),o=n(11),s=n(3),d=n(10),l=n(9),p=n(8),n=n(7),a=(Object.defineProperty(c.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(e){this.index=this._activeIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"scrollViewLightOverlayClass",{get:function(){return"light"===this.pagerOverlay},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"scrollViewDarkOverlayClass",{get:function(){return"dark"===this.pagerOverlay},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"hostWidth",{get:function(){return this.width},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"hostHeight",{get:function(){return this.height},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"direction",{get:function(){return this.localization.rtl?"rtl":"ltr"},enumerable:!0,configurable:!0}),c.prototype.keyDown=function(e){e.keyCode===s.Keys.ArrowLeft&&(this.isRTL?this.next():this.prev()),e.keyCode===s.Keys.ArrowRight&&(this.isRTL?this.prev():this.next())},c.prototype.ngOnChanges=function(e){this.activeIndex=Math.max(Math.min(this.activeIndex,this.view.total-1),0)},c.prototype.prev=function(){this.navigate(o.Dir.Prev)},c.prototype.next=function(){this.navigate(o.Dir.Next)},c.prototype.transitionEndHandler=function(e){this.animationState=null,"left"!==e.toState&&"right"!==e.toState||(null!==this.pageIndex&&(this.activeIndex=this.pageIndex,this.pageIndex=null),this.activeIndex=this.index,this.activeIndexChange.emit(this.activeIndex),this.itemChanged.emit({index:this.activeIndex,item:this.view.item(1)}))},c.prototype.handlePress=function(e){this.initialTouchCoordinate=e.pageX},c.prototype.handleDrag=function(e){e=e.pageX-this.initialTouchCoordinate;this.animationState||this.isDragForbidden(e)||!this.draggedInsideBounds(e)||this.renderer.setStyle(this.itemWrapper.nativeElement,"transform","translateX("+e+"px)")},c.prototype.handleRelease=function(e){var t=this,n=e.pageX-this.initialTouchCoordinate;this.isDragForbidden(n)||this.ngZone.run(function(){t.draggedEnoughToNavigate(n)?(t.isRTL?t.changeIndex(n<0?o.Dir.Prev:o.Dir.Next):t.changeIndex(0<n?o.Dir.Prev:o.Dir.Next),t.animate||(t.renderer.removeStyle(t.itemWrapper.nativeElement,"transform"),t.activeIndexChange.emit(t.activeIndex),t.itemChanged.emit({index:t.activeIndex,item:t.view.item(1)}))):t.animate&&n?t.animationState="center":t.renderer.removeStyle(t.itemWrapper.nativeElement,"transform")})},c.prototype.pageChange=function(e){this.animationState||this.activeIndex===e||(this.animate?(this.pageIndex=e,this.isRTL?this.animationState=this.pageIndex>this.index?"right":"left":this.animationState=this.pageIndex>this.index?"left":"right"):this.activeIndex=e)},c.prototype.inlineListItemStyles=function(e){return{height:this.height,transform:this.transforms[e],width:"100%"}},c.prototype.displayLeftArrow=function(){var e=this.isRTL?this.activeIndex+1<this.view.total:0<this.activeIndex;return(this.endless||e)&&0<this.view.total},c.prototype.leftArrowClick=function(){this.isRTL?this.next():this.prev()},c.prototype.displayRightArrow=function(){var e=this.isRTL?0<this.activeIndex:this.activeIndex+1<this.view.total;return(this.endless||e)&&0<this.view.total},c.prototype.rightArrowClick=function(){this.isRTL?this.prev():this.next()},c.prototype.draggedInsideBounds=function(e){return Math.abs(e)<=this.element.nativeElement.offsetWidth},c.prototype.draggedEnoughToNavigate=function(e){return Math.abs(e)>this.element.nativeElement.offsetWidth/2},c.prototype.isDragForbidden=function(e){e=this.isRTL?e<0&&0!==e:0<e&&0!==e,e=0===this.activeIndex&&e||this.activeIndex===this.view.total-1&&!e;return!this.endless&&e},c.prototype.navigate=function(e){this.isDataSourceEmpty||this.animationState||(this.changeIndex(e),this.animate||(this.activeIndexChange.emit(this.activeIndex),this.itemChanged.emit({index:this.activeIndex,item:this.view.item(1)})))},c.prototype.changeIndex=function(e){e===o.Dir.Next&&this.view.canMoveNext()?(this.index=(this.index+1)%this.view.total,this.animate?this.animationState=this.isRTL?"right":"left":this.activeIndex=this.index):e===o.Dir.Prev&&this.view.canMovePrev()&&(this.index=0===this.index?this.view.total-1:this.index-1,this.animate?this.animationState=this.isRTL?"left":"right":this.activeIndex=this.index)},Object.defineProperty(c.prototype,"isRTL",{get:function(){return"rtl"===this.direction},enumerable:!0,configurable:!0}),i.__decorate([r.Input(),i.__metadata("design:type",Array)],c.prototype,"data",void 0),i.__decorate([r.Input(),i.__metadata("design:type",Number),i.__metadata("design:paramtypes",[Number])],c.prototype,"activeIndex",null),i.__decorate([r.Input(),i.__metadata("design:type",String)],c.prototype,"width",void 0),i.__decorate([r.Input(),i.__metadata("design:type",String)],c.prototype,"height",void 0),i.__decorate([r.Input(),i.__metadata("design:type",Boolean)],c.prototype,"endless",void 0),i.__decorate([r.Input(),i.__metadata("design:type",String)],c.prototype,"pagerOverlay",void 0),i.__decorate([r.Input(),i.__metadata("design:type",Boolean)],c.prototype,"animate",void 0),i.__decorate([r.Input(),i.__metadata("design:type",Boolean)],c.prototype,"pageable",void 0),i.__decorate([r.Input(),i.__metadata("design:type",Boolean)],c.prototype,"arrows",void 0),i.__decorate([r.Output(),i.__metadata("design:type",r.EventEmitter)],c.prototype,"itemChanged",void 0),i.__decorate([r.Output(),i.__metadata("design:type",r.EventEmitter)],c.prototype,"activeIndexChange",void 0),i.__decorate([r.ContentChild(r.TemplateRef,{static:!1}),i.__metadata("design:type",r.TemplateRef)],c.prototype,"itemTemplateRef",void 0),i.__decorate([r.ViewChild("itemWrapper",{static:!1}),i.__metadata("design:type",r.ElementRef)],c.prototype,"itemWrapper",void 0),i.__decorate([r.HostBinding("class.k-scrollview"),i.__metadata("design:type",Boolean)],c.prototype,"scrollViewClass",void 0),i.__decorate([r.HostBinding("class.k-scrollview-light"),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[])],c.prototype,"scrollViewLightOverlayClass",null),i.__decorate([r.HostBinding("class.k-scrollview-dark"),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[])],c.prototype,"scrollViewDarkOverlayClass",null),i.__decorate([r.HostBinding("style.width"),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[])],c.prototype,"hostWidth",null),i.__decorate([r.HostBinding("style.height"),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[])],c.prototype,"hostHeight",null),i.__decorate([r.HostBinding("attr.tabindex"),i.__metadata("design:type",Number)],c.prototype,"tabIndex",void 0),i.__decorate([r.HostBinding("attr.aria-live"),i.__metadata("design:type",String)],c.prototype,"ariaLive",void 0),i.__decorate([r.HostBinding("attr.dir"),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[])],c.prototype,"dir",null),i.__decorate([r.HostBinding("style.touch-action"),i.__metadata("design:type",String)],c.prototype,"touchAction",void 0),i.__decorate([r.HostListener("keydown",["$event"]),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[Object]),i.__metadata("design:returntype",void 0)],c.prototype,"keyDown",null),i.__decorate([r.Component({animations:[a.trigger("animateTo",[a.state("center, left, right",a.style({transform:"translateX(0)"})),a.transition("* => right",[a.animate("300ms ease-out",a.style({transform:"translateX(100%)"}))]),a.transition("* => left",[a.animate("300ms ease-out",a.style({transform:"translateX(-100%)"}))]),a.transition("* => center",[a.animate("300ms ease-out")])])],exportAs:"kendoScrollView",providers:[n.LocalizationService,{provide:n.L10N_PREFIX,useValue:"kendo.scrollview"}],selector:"kendo-scrollview",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 '}),i.__metadata("design:paramtypes",[r.ElementRef,n.LocalizationService,r.NgZone,r.Renderer2])],c));function c(e,t,n,i){var a=this;this.element=e,this.localization=t,this.ngZone=n,this.renderer=i,this.data=[],this.endless=!1,this.pagerOverlay="none",this.animate=!0,this.pageable=!1,this.arrows=!1,this.itemChanged=new r.EventEmitter,this.activeIndexChange=new r.EventEmitter,this.scrollViewClass=!0,this.tabIndex=1,this.ariaLive="assertive",this.touchAction="pan-y pinch-zoom",this.animationState=null,this.view=new p.DataCollection(function(){return new p.DataResultIterator(a.data,a.activeIndex,a.endless,a.pageIndex,a.isRTL)}),this.isDataSourceEmpty=!1,this._activeIndex=0,this.index=0,this.pageIndex=null,this.transforms=["translateX(-100%)","translateX(0%)","translateX(100%)"],d.validatePackage(l.packageMetadata)}t.ScrollViewComponent=a},function(e,t){e.exports=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=n(0),r=n(5),o=n(4),s=n(2),n=n(3),s=[o.ScrollViewComponent,s.ScrollViewPagerComponent],o=[o.ScrollViewComponent],i=i.__decorate([a.NgModule({declarations:[s],exports:[o],imports:[r.CommonModule,n.DraggableModule]})],d);function d(){}t.ScrollViewModule=i},function(e,t){e.exports=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){if("function"==typeof Symbol&&Symbol.iterator)return Symbol.iterator;for(var e=Object.getOwnPropertyNames(Map.prototype),t=Map.prototype,n=0;n<e.length;++n){var i=e[n];if("entries"!==i&&"size"!==i&&t[i]===t.entries)return i}}(),a={};function r(e,t,n,i,a){this.rtl=!1,this.source=e||[],this.index=t||0,this.endless=n,this.pageIndex=i,this.rtl=a}function o(e){this.accessor=e}Object.defineProperty(r.prototype,"data",{get:function(){var e=this.total,e=this.endless?[this.source[(this.index-1+e)%e],this.source[this.index%e],this.source[(this.index+1+e)%e]]:[a].concat(this.source,[a]).slice(this.index,this.index+3);return null!==this.pageIndex&&(e[this.pageIndex>this.index?2:0]=this.source[this.pageIndex]),this.rtl?e.reverse():e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"total",{get:function(){return this.source.length},enumerable:!0,configurable:!0}),r.prototype.canMoveNext=function(){return this.endless||this.index<this.total-1},r.prototype.canMovePrev=function(){return this.endless||0<this.index},r.prototype[i]=function(){return this.data[i]()},t.DataResultIterator=r,Object.defineProperty(o.prototype,"length",{get:function(){return this.accessor().data.length},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"total",{get:function(){return this.accessor().total},enumerable:!0,configurable:!0}),o.prototype.item=function(e){return this.accessor().data[e]},o.prototype.canMoveNext=function(){return this.accessor().canMoveNext()},o.prototype.canMovePrev=function(){return this.accessor().canMovePrev()},o.prototype[Symbol.iterator]=function(){return this.accessor()[Symbol.iterator]()},t.DataCollection=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata={name:"@progress/kendo-angular-scrollview",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1646219224,version:"",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"}},function(e,t){e.exports=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(t=t.Dir||(t.Dir={}))[t.Next=1]="Next",t[t.Prev=-1]="Prev"},function(e,t){e.exports=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=n(4),a=(t.ScrollViewComponent=a.ScrollViewComponent,n(6)),a=(t.ScrollViewModule=a.ScrollViewModule,n(2)),r=(t.ScrollViewPagerComponent=a.ScrollViewPagerComponent,t);for(i in r)o(i,r[i])}],a={},i.m=n,i.c=a,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=13)}}});