@progress/kendo-angular-scrollview 17.0.0-develop.3 → 17.0.0-develop.31

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.
@@ -1,1007 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as i0 from '@angular/core';
6
- import { EventEmitter, Component, Input, Output, Directive, forwardRef, TemplateRef, ContentChild, ViewChild, HostBinding, NgModule } from '@angular/core';
7
- import { trigger, state, style, transition, animate } from '@angular/animations';
8
- import { Keys, DraggableDirective } from '@progress/kendo-angular-common';
9
- import { validatePackage } from '@progress/kendo-licensing';
10
- import * as i1 from '@progress/kendo-angular-l10n';
11
- import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
12
- import { chevronLeftIcon, chevronRightIcon } from '@progress/kendo-svg-icons';
13
- import { Subscription } from 'rxjs';
14
- import { NgFor, NgClass, NgStyle, NgTemplateOutlet, NgIf } from '@angular/common';
15
- import { IconWrapperComponent, IconsService } from '@progress/kendo-angular-icons';
16
-
17
- /**
18
- * @hidden
19
- */
20
- var Dir;
21
- (function (Dir) {
22
- Dir[Dir["Next"] = 1] = "Next";
23
- Dir[Dir["Prev"] = -1] = "Prev";
24
- })(Dir || (Dir = {}));
25
-
26
- /**
27
- * @hidden
28
- */
29
- const packageMetadata = {
30
- name: '@progress/kendo-angular-scrollview',
31
- productName: 'Kendo UI for Angular',
32
- productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
33
- publishDate: 1728917597,
34
- version: '17.0.0-develop.3',
35
- licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
36
- };
37
-
38
- /** @hidden */
39
- const iterator = getIterator();
40
- // TODO: Move to kendo-common
41
- function getIterator() {
42
- if (typeof Symbol === 'function' && Symbol.iterator) {
43
- return Symbol.iterator;
44
- }
45
- const keys = Object.getOwnPropertyNames(Map.prototype);
46
- const proto = Map.prototype;
47
- for (let i = 0; i < keys.length; ++i) {
48
- const key = keys[i];
49
- if (key !== 'entries' && key !== 'size' && proto[key] === proto.entries) {
50
- return key;
51
- }
52
- }
53
- }
54
- const EMPTY_OBJ = {};
55
- /**
56
- * @hidden
57
- */
58
- class DataResultIterator {
59
- constructor(source, index, endless, pageIndex, rtl) {
60
- this.rtl = false;
61
- this.source = source ? source : [];
62
- this.index = index ? index : 0;
63
- this.endless = endless;
64
- this.pageIndex = pageIndex;
65
- this.rtl = rtl;
66
- }
67
- get data() {
68
- const itemCount = this.total;
69
- let result;
70
- if (this.endless) {
71
- result = [
72
- this.source[(this.index - 1 + itemCount) % itemCount],
73
- this.source[this.index % itemCount],
74
- this.source[(this.index + 1 + itemCount) % itemCount]
75
- ];
76
- }
77
- else {
78
- const data = [EMPTY_OBJ, ...this.source, EMPTY_OBJ];
79
- result = data.slice(this.index, this.index + 3);
80
- }
81
- if (this.pageIndex !== null) {
82
- const isForward = this.pageIndex > this.index;
83
- result[isForward ? 2 : 0] = this.source[this.pageIndex];
84
- }
85
- return this.rtl ? result.reverse() : result;
86
- }
87
- get total() {
88
- return this.source.length;
89
- }
90
- canMoveNext() {
91
- return (this.endless || (this.index < this.total - 1));
92
- }
93
- canMovePrev() {
94
- return (this.endless || this.index > 0);
95
- }
96
- [iterator]() {
97
- return this.data[iterator]();
98
- }
99
- }
100
- /**
101
- * @hidden
102
- */
103
- class DataCollection {
104
- constructor(accessor) {
105
- this.accessor = accessor;
106
- }
107
- get length() { return this.accessor().data.length; }
108
- get total() { return this.accessor().total; }
109
- item(index) {
110
- return this.accessor().data[index];
111
- }
112
- canMoveNext() {
113
- return this.accessor().canMoveNext();
114
- }
115
- canMovePrev() {
116
- return this.accessor().canMovePrev();
117
- }
118
- [Symbol.iterator]() {
119
- return this.accessor()[Symbol.iterator]();
120
- }
121
- }
122
-
123
- /* eslint-disable @typescript-eslint/no-explicit-any */
124
- /**
125
- * @hidden
126
- */
127
- class ScrollViewPagerComponent {
128
- constructor(localization) {
129
- this.localization = localization;
130
- this.pagerIndexChange = new EventEmitter();
131
- }
132
- itemClass(idx) {
133
- return {
134
- 'k-primary': idx === this.activeIndex
135
- };
136
- }
137
- indexChange(selectedIndex) {
138
- this.pagerIndexChange.emit(selectedIndex);
139
- }
140
- pagerButtonLabel(itemIndex) {
141
- const localizationMsg = this.localization.get('pagerButtonLabel') || '';
142
- return this.replaceMessagePlaceholder(localizationMsg, 'itemIndex', itemIndex.toString());
143
- }
144
- replaceMessagePlaceholder(message, name, value) {
145
- return message.replace(new RegExp(`\{\\s*${name}\\s*\}`, 'g'), value);
146
- }
147
- }
148
- ScrollViewPagerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ScrollViewPagerComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
149
- ScrollViewPagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ScrollViewPagerComponent, isStandalone: true, selector: "kendo-scrollview-pager", inputs: { activeIndex: "activeIndex", data: "data" }, outputs: { pagerIndexChange: "pagerIndexChange" }, ngImport: i0, template: `
150
- <div class="k-scrollview-nav">
151
- <span [attr.aria-label]="pagerButtonLabel(i + 1)" role="button" class="k-link" *ngFor="let item of data; let i = index"
152
- [ngClass]="itemClass(i)"
153
- (click)="indexChange(i)">
154
- </span>
155
- </div>
156
- `, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ScrollViewPagerComponent, decorators: [{
158
- type: Component,
159
- args: [{
160
- selector: 'kendo-scrollview-pager',
161
- template: `
162
- <div class="k-scrollview-nav">
163
- <span [attr.aria-label]="pagerButtonLabel(i + 1)" role="button" class="k-link" *ngFor="let item of data; let i = index"
164
- [ngClass]="itemClass(i)"
165
- (click)="indexChange(i)">
166
- </span>
167
- </div>
168
- `,
169
- standalone: true,
170
- imports: [NgFor, NgClass]
171
- }]
172
- }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { activeIndex: [{
173
- type: Input
174
- }], data: [{
175
- type: Input
176
- }], pagerIndexChange: [{
177
- type: Output
178
- }] } });
179
-
180
- /**
181
- * @hidden
182
- */
183
- class ScrollViewMessages extends ComponentMessages {
184
- }
185
- ScrollViewMessages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ScrollViewMessages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
186
- ScrollViewMessages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: ScrollViewMessages, selector: "kendo-scrollview-messages-base", inputs: { pagerButtonLabel: "pagerButtonLabel" }, usesInheritance: true, ngImport: i0 });
187
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ScrollViewMessages, decorators: [{
188
- type: Directive,
189
- args: [{
190
- // eslint-disable-next-line @angular-eslint/directive-selector
191
- selector: 'kendo-scrollview-messages-base'
192
- }]
193
- }], propDecorators: { pagerButtonLabel: [{
194
- type: Input
195
- }] } });
196
-
197
- /**
198
- * @hidden
199
- */
200
- class LocalizedMessagesDirective extends ScrollViewMessages {
201
- constructor(service) {
202
- super();
203
- this.service = service;
204
- }
205
- }
206
- LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
207
- LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LocalizedMessagesDirective, isStandalone: true, selector: "[kendoScrollViewLocalizedMessages]", providers: [
208
- {
209
- provide: ScrollViewMessages,
210
- useExisting: forwardRef(() => LocalizedMessagesDirective)
211
- }
212
- ], usesInheritance: true, ngImport: i0 });
213
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
214
- type: Directive,
215
- args: [{
216
- providers: [
217
- {
218
- provide: ScrollViewMessages,
219
- useExisting: forwardRef(() => LocalizedMessagesDirective)
220
- }
221
- ],
222
- selector: '[kendoScrollViewLocalizedMessages]',
223
- standalone: true
224
- }]
225
- }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
226
-
227
- /* eslint-disable @typescript-eslint/no-inferrable-types */
228
- /* eslint-disable @typescript-eslint/no-unused-vars */
229
- /* eslint-disable @typescript-eslint/no-explicit-any */
230
- let idx = 0;
231
- /**
232
- * Represents the [Kendo UI ScrollView component for Angular]({% slug overview_scrollview %}).
233
- *
234
- * @example
235
- * ```ts
236
- *
237
- * _@Component({
238
- * selector: 'my-app',
239
- * template: `
240
- * <kendo-scrollview
241
- * [data]="items"
242
- * [width]="width"
243
- * [height]="height"
244
- * [endless]="endless"
245
- * [pageable]="pageable">
246
- * <ng-template let-item="item">
247
- * <h2 class="demo-title">{{item.title}}</h2>
248
- * <img src='{{item.url}}' alt='{{item.title}}' [ngStyle]="{minWidth: width}" draggable="false" />
249
- * </ng-template>
250
- * </kendo-scrollview>
251
- * `,
252
- * styles: [`
253
- * .k-scrollview-wrap {
254
- * margin: 0 auto;
255
- * }
256
- * .demo-title {
257
- * position: absolute;
258
- * top: 0;
259
- * left: 0;
260
- * right: 0;
261
- * margin: 0;
262
- * padding: 15px;
263
- * color: #fff;
264
- * background-color: rgba(0,0,0,.4);
265
- * text-align: center;
266
- * font-size: 24px;
267
- * }
268
- * `]
269
- * })
270
- *
271
- * class AppComponent {
272
- * public width: string = "600px";
273
- * public height: string = "400px";
274
- * public endless: boolean = false;
275
- * public pageable: boolean = false;
276
- * public items: any[] = [
277
- * { title: 'Flower', url: 'https://bit.ly/2cJjYuB' },
278
- * { title: 'Mountain', url: 'https://bit.ly/2cTBNaL' },
279
- * { title: 'Sky', url: 'https://bit.ly/2cJl3Cx' }
280
- * ];
281
- * }
282
- * ```
283
- */
284
- class ScrollViewComponent {
285
- constructor(element, localization, ngZone, renderer) {
286
- this.element = element;
287
- this.localization = localization;
288
- this.ngZone = ngZone;
289
- this.renderer = renderer;
290
- /**
291
- * @hidden
292
- */
293
- this.chevronLeftIcon = chevronLeftIcon;
294
- /**
295
- * @hidden
296
- */
297
- this.chevronRightIcon = chevronRightIcon;
298
- /**
299
- * Provides the data source for the ScrollView ([see example]({% slug datasources_scrollview %})).
300
- */
301
- this.data = [];
302
- /**
303
- * Enables or disables the endless scrolling mode in which the data source items are endlessly looped
304
- * ([see example]({% slug endlessscrolling_scrollview %})). By default, `endless` is set to `false`
305
- * and the endless scrolling mode is disabled.
306
- */
307
- this.endless = false;
308
- /**
309
- * Sets `pagerOverlay` to one of three possible values: `dark`, `light` or `none`.
310
- * By default, the pager overlay is set to `none`.
311
- */
312
- this.pagerOverlay = 'none';
313
- /**
314
- * Enables or disables the built-in animations ([see example]({% slug animations_scrollview %})).
315
- * By default, `animate` is set to `true` and animations are enabled.
316
- */
317
- this.animate = true;
318
- /**
319
- * Enables or disables the built-in pager ([see example]({% slug paging_scrollview %})).
320
- * By default, `pageable` is set to `false` and paging is disabled.
321
- */
322
- this.pageable = false;
323
- /**
324
- * Enables or disables the built-in navigation arrows ([see example]({% slug arrows_scrollview %})).
325
- * By default, `arrows` is set to `false` and arrows are disabled.
326
- */
327
- this.arrows = false;
328
- /**
329
- * Fires after the current item is changed.
330
- */
331
- this.itemChanged = new EventEmitter();
332
- /**
333
- * Fires after the activeIndex has changed. Allows for two-way binding of the activeIndex property.
334
- */
335
- this.activeIndexChange = new EventEmitter();
336
- this.scrollViewClass = true;
337
- this.scrollViewRole = 'application';
338
- this.scrollViewRoleDescription = 'carousel';
339
- this.tabIndex = 0;
340
- this.ariaLive = 'assertive';
341
- this.touchAction = 'pan-y pinch-zoom';
342
- this.animationState = null;
343
- this.view = new DataCollection(() => new DataResultIterator(this.data, this.activeIndex, this.endless, this.pageIndex, this.isRTL));
344
- this.isDataSourceEmpty = false;
345
- this.subs = new Subscription();
346
- this._activeIndex = 0;
347
- this.index = 0;
348
- this.pageIndex = null;
349
- this.transforms = ['translateX(-100%)', 'translateX(0%)', 'translateX(100%)'];
350
- validatePackage(packageMetadata);
351
- }
352
- /**
353
- * Represents the current item index ([see example]({% slug activeitems_scrollview %})).
354
- */
355
- set activeIndex(value) {
356
- this.index = this._activeIndex = value;
357
- }
358
- get activeIndex() {
359
- return this._activeIndex;
360
- }
361
- get scrollViewLightOverlayClass() {
362
- return this.pagerOverlay === 'light';
363
- }
364
- get scrollViewDarkOverlayClass() {
365
- return this.pagerOverlay === 'dark';
366
- }
367
- get hostWidth() { return this.width; }
368
- get hostHeight() { return this.height; }
369
- get dir() {
370
- return this.direction;
371
- }
372
- get direction() {
373
- return this.localization.rtl ? 'rtl' : 'ltr';
374
- }
375
- ngOnInit() {
376
- this.subs.add(this.renderer.listen(this.element.nativeElement, 'keydown', event => this.keyDown(event)));
377
- if (this.arrows) {
378
- this.scrollviewId = `k-scrollview-wrap-${++idx}`;
379
- }
380
- }
381
- ngOnDestroy() {
382
- this.subs.unsubscribe();
383
- }
384
- ngOnChanges(_) {
385
- if (this.data && this.data.length === 0) {
386
- this.activeIndex = Math.max(Math.min(this.activeIndex, this.view.total - 1), 0);
387
- }
388
- }
389
- /**
390
- * Navigates the ScrollView to the previous item.
391
- */
392
- prev() {
393
- this.navigate(Dir.Prev);
394
- }
395
- /**
396
- * Navigates the ScrollView to the next item.
397
- */
398
- next() {
399
- this.navigate(Dir.Next);
400
- }
401
- /**
402
- * @hidden
403
- */
404
- transitionEndHandler(e) {
405
- this.animationState = null;
406
- if (e.toState === 'left' || e.toState === 'right') {
407
- if (this.pageIndex !== null) {
408
- this.activeIndex = this.pageIndex;
409
- this.pageIndex = null;
410
- }
411
- this.activeIndex = this.index;
412
- this.activeIndexChange.emit(this.activeIndex);
413
- this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
414
- }
415
- }
416
- /**
417
- * @hidden
418
- */
419
- handlePress(e) {
420
- this.initialTouchCoordinate = e.pageX;
421
- }
422
- /**
423
- * @hidden
424
- */
425
- handleDrag(e) {
426
- const deltaX = e.pageX - this.initialTouchCoordinate;
427
- if (!this.animationState && !this.isDragForbidden(deltaX) && this.draggedInsideBounds(deltaX)) {
428
- this.renderer.setStyle(this.itemWrapper.nativeElement, 'transform', `translateX(${deltaX}px)`);
429
- }
430
- }
431
- /**
432
- * @hidden
433
- */
434
- handleRelease(e) {
435
- const deltaX = e.pageX - this.initialTouchCoordinate;
436
- if (this.isDragForbidden(deltaX)) {
437
- return;
438
- }
439
- this.ngZone.run(() => {
440
- if (this.draggedEnoughToNavigate(deltaX)) {
441
- if (this.isRTL) {
442
- this.changeIndex(deltaX < 0 ? Dir.Prev : Dir.Next);
443
- }
444
- else {
445
- this.changeIndex(deltaX > 0 ? Dir.Prev : Dir.Next);
446
- }
447
- if (!this.animate) {
448
- this.renderer.removeStyle(this.itemWrapper.nativeElement, 'transform');
449
- this.activeIndexChange.emit(this.activeIndex);
450
- this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
451
- }
452
- }
453
- else {
454
- if (this.animate && deltaX) {
455
- this.animationState = 'center';
456
- }
457
- else {
458
- this.renderer.removeStyle(this.itemWrapper.nativeElement, 'transform');
459
- }
460
- }
461
- });
462
- }
463
- /**
464
- * @hidden
465
- */
466
- pageChange(idx) {
467
- if (!this.animationState && this.activeIndex !== idx) {
468
- if (this.animate) {
469
- this.pageIndex = idx;
470
- if (this.isRTL) {
471
- this.animationState = (this.pageIndex > this.index ? 'right' : 'left');
472
- }
473
- else {
474
- this.animationState = (this.pageIndex > this.index ? 'left' : 'right');
475
- }
476
- }
477
- else {
478
- this.activeIndex = idx;
479
- }
480
- }
481
- }
482
- /**
483
- * @hidden
484
- */
485
- inlineListItemStyles(idx) {
486
- return {
487
- 'height': this.height,
488
- 'transform': this.transforms[idx],
489
- 'width': '100%',
490
- 'position': 'absolute',
491
- 'top': '0',
492
- 'left': '0'
493
- };
494
- }
495
- /**
496
- * @hidden
497
- */
498
- displayLeftArrow() {
499
- let isNotBorderItem;
500
- if (this.isRTL) {
501
- isNotBorderItem = this.activeIndex + 1 < this.view.total;
502
- }
503
- else {
504
- isNotBorderItem = this.activeIndex > 0;
505
- }
506
- return (this.endless || isNotBorderItem) && this.view.total > 0;
507
- }
508
- /**
509
- * @hidden
510
- */
511
- leftArrowClick() {
512
- if (this.isRTL) {
513
- this.next();
514
- }
515
- else {
516
- this.prev();
517
- }
518
- }
519
- /**
520
- * @hidden
521
- */
522
- displayRightArrow() {
523
- let isNotBorderItem;
524
- if (this.isRTL) {
525
- isNotBorderItem = this.activeIndex > 0;
526
- }
527
- else {
528
- isNotBorderItem = this.activeIndex + 1 < this.view.total;
529
- }
530
- return (this.endless || isNotBorderItem) && this.view.total > 0;
531
- }
532
- /**
533
- * @hidden
534
- */
535
- rightArrowClick() {
536
- if (this.isRTL) {
537
- this.prev();
538
- }
539
- else {
540
- this.next();
541
- }
542
- }
543
- draggedInsideBounds(deltaX) {
544
- return Math.abs(deltaX) <= this.element.nativeElement.offsetWidth;
545
- }
546
- draggedEnoughToNavigate(deltaX) {
547
- return Math.abs(deltaX) > (this.element.nativeElement.offsetWidth / 2);
548
- }
549
- isDragForbidden(deltaX) {
550
- let pastEnd;
551
- if (this.isRTL) {
552
- pastEnd = deltaX < 0 && deltaX !== 0;
553
- }
554
- else {
555
- pastEnd = deltaX > 0 && deltaX !== 0;
556
- }
557
- const isEndReached = ((this.activeIndex === 0 && pastEnd) || (this.activeIndex === this.view.total - 1 && !pastEnd));
558
- return !this.endless && isEndReached;
559
- }
560
- keyDown(e) {
561
- var _a, _b;
562
- const keyCode = e.keyCode;
563
- if (keyCode === Keys.ArrowLeft) {
564
- if (this.isRTL) {
565
- this.next();
566
- return;
567
- }
568
- this.prev();
569
- }
570
- else if (keyCode === Keys.ArrowRight) {
571
- if (this.isRTL) {
572
- this.prev();
573
- return;
574
- }
575
- this.next();
576
- }
577
- if (this.arrows && keyCode === Keys.Space || keyCode === Keys.Enter) {
578
- const prevButton = (_a = this.prevButton) === null || _a === void 0 ? void 0 : _a.nativeElement;
579
- const nextButton = (_b = this.nextButton) === null || _b === void 0 ? void 0 : _b.nativeElement;
580
- const activeElement = document.activeElement;
581
- const isPrevButtonFocused = activeElement === prevButton;
582
- const isNextButtonFocused = activeElement === nextButton;
583
- if (isPrevButtonFocused) {
584
- if (this.isRTL) {
585
- this.next();
586
- return;
587
- }
588
- this.prev();
589
- }
590
- else if (isNextButtonFocused) {
591
- if (this.isRTL) {
592
- this.prev();
593
- return;
594
- }
595
- this.next();
596
- }
597
- }
598
- }
599
- navigate(direction) {
600
- if (this.isDataSourceEmpty || this.animationState) {
601
- return;
602
- }
603
- this.changeIndex(direction);
604
- if (!this.animate) {
605
- this.activeIndexChange.emit(this.activeIndex);
606
- this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
607
- }
608
- }
609
- changeIndex(direction) {
610
- if (direction === Dir.Next && this.view.canMoveNext()) {
611
- this.index = (this.index + 1) % this.view.total;
612
- if (this.animate) {
613
- this.animationState = this.isRTL ? 'right' : 'left';
614
- }
615
- else {
616
- this.activeIndex = this.index;
617
- }
618
- }
619
- else if (direction === Dir.Prev && this.view.canMovePrev()) {
620
- this.index = this.index === 0 ? this.view.total - 1 : this.index - 1;
621
- if (this.animate) {
622
- this.animationState = this.isRTL ? 'left' : 'right';
623
- }
624
- else {
625
- this.activeIndex = this.index;
626
- }
627
- }
628
- }
629
- get isRTL() {
630
- return this.direction === 'rtl';
631
- }
632
- get prevButtonArrowIcon() {
633
- return this.direction === 'ltr' ? 'chevron-left' : 'chevron-right';
634
- }
635
- get nextButtonArrowIcon() {
636
- return this.direction === 'ltr' ? 'chevron-right' : 'chevron-left';
637
- }
638
- get prevButtonArrowSVGIcon() {
639
- return this.direction === 'ltr' ? this.chevronLeftIcon : this.chevronRightIcon;
640
- }
641
- get nextButtonArrowSVGIcon() {
642
- return this.direction === 'ltr' ? this.chevronRightIcon : this.chevronLeftIcon;
643
- }
644
- }
645
- ScrollViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ScrollViewComponent, deps: [{ token: i0.ElementRef }, { token: i1.LocalizationService }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
646
- ScrollViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ScrollViewComponent, isStandalone: true, selector: "kendo-scrollview", inputs: { data: "data", activeIndex: "activeIndex", width: "width", height: "height", endless: "endless", pagerOverlay: "pagerOverlay", animate: "animate", pageable: "pageable", arrows: "arrows" }, outputs: { itemChanged: "itemChanged", activeIndexChange: "activeIndexChange" }, host: { properties: { "class.k-scrollview": "this.scrollViewClass", "attr.role": "this.scrollViewRole", "attr.aria-roledescription": "this.scrollViewRoleDescription", "class.k-scrollview-light": "this.scrollViewLightOverlayClass", "class.k-scrollview-dark": "this.scrollViewDarkOverlayClass", "style.width": "this.hostWidth", "style.height": "this.hostHeight", "attr.tabindex": "this.tabIndex", "attr.aria-live": "this.ariaLive", "attr.dir": "this.dir", "style.touch-action": "this.touchAction" } }, providers: [
647
- LocalizationService,
648
- {
649
- provide: L10N_PREFIX,
650
- useValue: 'kendo.scrollview'
651
- }
652
- ], queries: [{ propertyName: "itemTemplateRef", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "itemWrapper", first: true, predicate: ["itemWrapper"], descendants: true }, { propertyName: "prevButton", first: true, predicate: ["prevButton"], descendants: true }, { propertyName: "nextButton", first: true, predicate: ["nextButton"], descendants: true }], exportAs: ["kendoScrollView"], usesOnChanges: true, ngImport: i0, template: `
653
-
654
- <ng-container kendoScrollViewLocalizedMessages
655
- i18n-pagerButtonLabel="kendo.scrollview.pagerButtonLabel|The label for the buttons inside the ScrollView Pager"
656
- pagerButtonLabel="{{ 'Item {itemIndex}' }}">
657
- <ng-container>
658
-
659
- <div class="k-scrollview-wrap k-scrollview-animate"
660
- #itemWrapper
661
- role="list"
662
- [id]="scrollviewId"
663
- [@animateTo]="animationState"
664
- (@animateTo.done)="transitionEndHandler($event)"
665
- kendoDraggable
666
- (kendoDrag)="handleDrag($event)"
667
- (kendoPress)="handlePress($event)"
668
- (kendoRelease)="handleRelease($event)"
669
- >
670
- <div class="k-scrollview-view"
671
- *ngFor="let item of view;let i=index"
672
- role="listitem"
673
- aria-roledescription="slide"
674
- [ngStyle]="inlineListItemStyles(i)"
675
- [attr.aria-hidden]="i !== 1"
676
- >
677
- <ng-template
678
- [ngTemplateOutlet]="itemTemplateRef"
679
- [ngTemplateOutletContext]="{ item: item }">
680
- </ng-template>
681
- </div>
682
- </div>
683
- <div class='k-scrollview-elements'
684
- [ngStyle]="{'height': height}"
685
- *ngIf="!isDataSourceEmpty && (pageable||arrows)">
686
-
687
- <span
688
- #prevButton
689
- class="k-scrollview-prev"
690
- role="button"
691
- [attr.aria-controls]="scrollviewId"
692
- aria-label="previous"
693
- *ngIf="arrows && displayLeftArrow()"
694
- (click)="leftArrowClick()">
695
- <kendo-icon-wrapper
696
- size="xxxlarge"
697
- [name]="prevButtonArrowIcon"
698
- [svgIcon]="prevButtonArrowSVGIcon"
699
- >
700
- </kendo-icon-wrapper>
701
- </span>
702
- <span
703
- #nextButton
704
- class="k-scrollview-next"
705
- role="button"
706
- [attr.aria-controls]="scrollviewId"
707
- aria-label="next"
708
- *ngIf="arrows && displayRightArrow()"
709
- (click)="rightArrowClick()">
710
- <kendo-icon-wrapper
711
- size="xxxlarge"
712
- [name]="nextButtonArrowIcon"
713
- [svgIcon]="nextButtonArrowSVGIcon"
714
- >
715
- </kendo-icon-wrapper>
716
- </span>
717
- <kendo-scrollview-pager
718
- class='k-scrollview-nav-wrap'
719
- *ngIf="pageable"
720
- (pagerIndexChange)="pageChange($event)"
721
- [data]="data"
722
- [activeIndex]="activeIndex">
723
- </kendo-scrollview-pager>
724
- </div>
725
- <div class="k-sr-only" aria-live="polite"></div>
726
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoScrollViewLocalizedMessages]" }, { kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: [
727
- trigger('animateTo', [
728
- state('center, left, right', style({ transform: 'translateX(0)' })),
729
- transition('* => right', [
730
- animate('300ms ease-out', style({ transform: 'translateX(100%)' }))
731
- ]),
732
- transition('* => left', [
733
- animate('300ms ease-out', style({ transform: 'translateX(-100%)' }))
734
- ]),
735
- transition('* => center', [
736
- animate('300ms ease-out')
737
- ])
738
- ])
739
- ] });
740
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ScrollViewComponent, decorators: [{
741
- type: Component,
742
- args: [{
743
- animations: [
744
- trigger('animateTo', [
745
- state('center, left, right', style({ transform: 'translateX(0)' })),
746
- transition('* => right', [
747
- animate('300ms ease-out', style({ transform: 'translateX(100%)' }))
748
- ]),
749
- transition('* => left', [
750
- animate('300ms ease-out', style({ transform: 'translateX(-100%)' }))
751
- ]),
752
- transition('* => center', [
753
- animate('300ms ease-out')
754
- ])
755
- ])
756
- ],
757
- exportAs: 'kendoScrollView',
758
- providers: [
759
- LocalizationService,
760
- {
761
- provide: L10N_PREFIX,
762
- useValue: 'kendo.scrollview'
763
- }
764
- ],
765
- selector: 'kendo-scrollview',
766
- template: `
767
-
768
- <ng-container kendoScrollViewLocalizedMessages
769
- i18n-pagerButtonLabel="kendo.scrollview.pagerButtonLabel|The label for the buttons inside the ScrollView Pager"
770
- pagerButtonLabel="{{ 'Item {itemIndex}' }}">
771
- <ng-container>
772
-
773
- <div class="k-scrollview-wrap k-scrollview-animate"
774
- #itemWrapper
775
- role="list"
776
- [id]="scrollviewId"
777
- [@animateTo]="animationState"
778
- (@animateTo.done)="transitionEndHandler($event)"
779
- kendoDraggable
780
- (kendoDrag)="handleDrag($event)"
781
- (kendoPress)="handlePress($event)"
782
- (kendoRelease)="handleRelease($event)"
783
- >
784
- <div class="k-scrollview-view"
785
- *ngFor="let item of view;let i=index"
786
- role="listitem"
787
- aria-roledescription="slide"
788
- [ngStyle]="inlineListItemStyles(i)"
789
- [attr.aria-hidden]="i !== 1"
790
- >
791
- <ng-template
792
- [ngTemplateOutlet]="itemTemplateRef"
793
- [ngTemplateOutletContext]="{ item: item }">
794
- </ng-template>
795
- </div>
796
- </div>
797
- <div class='k-scrollview-elements'
798
- [ngStyle]="{'height': height}"
799
- *ngIf="!isDataSourceEmpty && (pageable||arrows)">
800
-
801
- <span
802
- #prevButton
803
- class="k-scrollview-prev"
804
- role="button"
805
- [attr.aria-controls]="scrollviewId"
806
- aria-label="previous"
807
- *ngIf="arrows && displayLeftArrow()"
808
- (click)="leftArrowClick()">
809
- <kendo-icon-wrapper
810
- size="xxxlarge"
811
- [name]="prevButtonArrowIcon"
812
- [svgIcon]="prevButtonArrowSVGIcon"
813
- >
814
- </kendo-icon-wrapper>
815
- </span>
816
- <span
817
- #nextButton
818
- class="k-scrollview-next"
819
- role="button"
820
- [attr.aria-controls]="scrollviewId"
821
- aria-label="next"
822
- *ngIf="arrows && displayRightArrow()"
823
- (click)="rightArrowClick()">
824
- <kendo-icon-wrapper
825
- size="xxxlarge"
826
- [name]="nextButtonArrowIcon"
827
- [svgIcon]="nextButtonArrowSVGIcon"
828
- >
829
- </kendo-icon-wrapper>
830
- </span>
831
- <kendo-scrollview-pager
832
- class='k-scrollview-nav-wrap'
833
- *ngIf="pageable"
834
- (pagerIndexChange)="pageChange($event)"
835
- [data]="data"
836
- [activeIndex]="activeIndex">
837
- </kendo-scrollview-pager>
838
- </div>
839
- <div class="k-sr-only" aria-live="polite"></div>
840
- `,
841
- standalone: true,
842
- imports: [LocalizedMessagesDirective, DraggableDirective, NgFor, NgStyle, NgTemplateOutlet, NgIf, IconWrapperComponent, ScrollViewPagerComponent]
843
- }]
844
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.LocalizationService }, { type: i0.NgZone }, { type: i0.Renderer2 }]; }, propDecorators: { data: [{
845
- type: Input
846
- }], activeIndex: [{
847
- type: Input
848
- }], width: [{
849
- type: Input
850
- }], height: [{
851
- type: Input
852
- }], endless: [{
853
- type: Input
854
- }], pagerOverlay: [{
855
- type: Input
856
- }], animate: [{
857
- type: Input
858
- }], pageable: [{
859
- type: Input
860
- }], arrows: [{
861
- type: Input
862
- }], itemChanged: [{
863
- type: Output
864
- }], activeIndexChange: [{
865
- type: Output
866
- }], itemTemplateRef: [{
867
- type: ContentChild,
868
- args: [TemplateRef]
869
- }], itemWrapper: [{
870
- type: ViewChild,
871
- args: ['itemWrapper']
872
- }], prevButton: [{
873
- type: ViewChild,
874
- args: ['prevButton']
875
- }], nextButton: [{
876
- type: ViewChild,
877
- args: ['nextButton']
878
- }], scrollViewClass: [{
879
- type: HostBinding,
880
- args: ['class.k-scrollview']
881
- }], scrollViewRole: [{
882
- type: HostBinding,
883
- args: ['attr.role']
884
- }], scrollViewRoleDescription: [{
885
- type: HostBinding,
886
- args: ['attr.aria-roledescription']
887
- }], scrollViewLightOverlayClass: [{
888
- type: HostBinding,
889
- args: ['class.k-scrollview-light']
890
- }], scrollViewDarkOverlayClass: [{
891
- type: HostBinding,
892
- args: ['class.k-scrollview-dark']
893
- }], hostWidth: [{
894
- type: HostBinding,
895
- args: ['style.width']
896
- }], hostHeight: [{
897
- type: HostBinding,
898
- args: ['style.height']
899
- }], tabIndex: [{
900
- type: HostBinding,
901
- args: ['attr.tabindex']
902
- }], ariaLive: [{
903
- type: HostBinding,
904
- args: ['attr.aria-live']
905
- }], dir: [{
906
- type: HostBinding,
907
- args: ['attr.dir']
908
- }], touchAction: [{
909
- type: HostBinding,
910
- args: ['style.touch-action']
911
- }] } });
912
-
913
- /**
914
- * Custom component messages override default component messages
915
- * ([see example](slug:rtl_scrollview#toc-custom-messages)).
916
- */
917
- class CustomMessagesComponent extends ScrollViewMessages {
918
- constructor(service) {
919
- super();
920
- this.service = service;
921
- }
922
- get override() {
923
- return true;
924
- }
925
- }
926
- CustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
927
- CustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CustomMessagesComponent, isStandalone: true, selector: "kendo-scrollview-messages", providers: [
928
- {
929
- provide: ScrollViewMessages,
930
- useExisting: forwardRef(() => CustomMessagesComponent)
931
- }
932
- ], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
933
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomMessagesComponent, decorators: [{
934
- type: Component,
935
- args: [{
936
- providers: [
937
- {
938
- provide: ScrollViewMessages,
939
- useExisting: forwardRef(() => CustomMessagesComponent)
940
- }
941
- ],
942
- selector: 'kendo-scrollview-messages',
943
- template: ``,
944
- standalone: true
945
- }]
946
- }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
947
-
948
- /**
949
- * Utility array that contains all `@progress/kendo-angular-scrollview` related components and directives
950
- */
951
- const KENDO_SCROLLVIEW = [
952
- ScrollViewComponent,
953
- CustomMessagesComponent
954
- ];
955
-
956
- //IMPORTANT: NgModule export kept for backwards compatibility
957
- /**
958
- * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
959
- * definition for the ScrollView component.
960
- *
961
- * @example
962
- *
963
- * ```ts-no-run
964
- * // Import the ScrollView module
965
- * import { ScrollViewModule } from '@progress/kendo-angular-scrollview';
966
- *
967
- * // The browser platform with a compiler
968
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
969
- *
970
- * import { NgModule } from '@angular/core';
971
- *
972
- * // Import the app component
973
- * import { AppComponent } from './app.component';
974
- *
975
- * // Define the app module
976
- * _@NgModule({
977
- * declarations: [AppComponent], // declare app component
978
- * imports: [BrowserModule, ScrollViewModule], // import ScrollView module
979
- * bootstrap: [AppComponent]
980
- * })
981
- * export class AppModule {}
982
- *
983
- * // Compile and launch the module
984
- * platformBrowserDynamic().bootstrapModule(AppModule);
985
- *
986
- * ```
987
- */
988
- class ScrollViewModule {
989
- }
990
- ScrollViewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ScrollViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
991
- ScrollViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: ScrollViewModule, imports: [ScrollViewComponent, CustomMessagesComponent], exports: [ScrollViewComponent, CustomMessagesComponent] });
992
- ScrollViewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ScrollViewModule, providers: [IconsService], imports: [KENDO_SCROLLVIEW] });
993
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ScrollViewModule, decorators: [{
994
- type: NgModule,
995
- args: [{
996
- imports: [...KENDO_SCROLLVIEW],
997
- exports: [...KENDO_SCROLLVIEW],
998
- providers: [IconsService]
999
- }]
1000
- }] });
1001
-
1002
- /**
1003
- * Generated bundle index. Do not edit.
1004
- */
1005
-
1006
- export { CustomMessagesComponent, KENDO_SCROLLVIEW, ScrollViewComponent, ScrollViewModule, ScrollViewPagerComponent };
1007
-