@progress/kendo-angular-scrollview 21.4.1 → 22.0.0-develop.1
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/fesm2022/progress-kendo-angular-scrollview.mjs +23 -23
- package/localization/messages.d.ts +1 -1
- package/package.json +10 -18
- package/esm2022/change-event-args.mjs +0 -5
- package/esm2022/data.collection.mjs +0 -93
- package/esm2022/direction.mjs +0 -5
- package/esm2022/directives.mjs +0 -32
- package/esm2022/enums.mjs +0 -12
- package/esm2022/index.mjs +0 -9
- package/esm2022/localization/custom-messages.component.mjs +0 -54
- package/esm2022/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/localization/messages.mjs +0 -28
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-scrollview.mjs +0 -8
- package/esm2022/scrollview-pager.component.mjs +0 -71
- package/esm2022/scrollview.component.mjs +0 -703
- package/esm2022/scrollview.module.mjs +0 -43
|
@@ -1,703 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-inferrable-types */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
-
import { Component, ContentChild, ElementRef, EventEmitter, HostBinding, Input, Output, TemplateRef, NgZone, ViewChild, Renderer2 } from '@angular/core';
|
|
9
|
-
import { animate, state, style, transition, trigger } from '@angular/animations';
|
|
10
|
-
import { Dir } from './enums';
|
|
11
|
-
import { DraggableDirective, Keys, normalizeKeys } from '@progress/kendo-angular-common';
|
|
12
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
13
|
-
import { packageMetadata } from './package-metadata';
|
|
14
|
-
import { DataCollection, DataResultIterator } from './data.collection';
|
|
15
|
-
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
16
|
-
import { chevronLeftIcon, chevronRightIcon } from '@progress/kendo-svg-icons';
|
|
17
|
-
import { Subscription } from 'rxjs';
|
|
18
|
-
import { ScrollViewPagerComponent } from './scrollview-pager.component';
|
|
19
|
-
import { NgStyle, NgTemplateOutlet } from '@angular/common';
|
|
20
|
-
import { LocalizedMessagesDirective } from './localization/localized-messages.directive';
|
|
21
|
-
import { IconWrapperComponent } from '@progress/kendo-angular-icons';
|
|
22
|
-
import * as i0 from "@angular/core";
|
|
23
|
-
import * as i1 from "@progress/kendo-angular-l10n";
|
|
24
|
-
let idx = 0;
|
|
25
|
-
/**
|
|
26
|
-
* Represents the [Kendo UI ScrollView component for Angular](slug:overview_scrollview).
|
|
27
|
-
*
|
|
28
|
-
* Use the ScrollViewComponent to display a horizontally scrollable list of items. You can customize the content and navigation.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```html
|
|
32
|
-
* <kendo-scrollview [data]="items" [width]="width" [height]="height">
|
|
33
|
-
* <ng-template let-item="item">
|
|
34
|
-
* <h2>{{item.title}}</h2>
|
|
35
|
-
* <img width="100%" [src]="item.url" />
|
|
36
|
-
* </ng-template>
|
|
37
|
-
* </kendo-scrollview>
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @remarks
|
|
41
|
-
* Supported children components are: {@link CustomMessagesComponent}
|
|
42
|
-
*/
|
|
43
|
-
export class ScrollViewComponent {
|
|
44
|
-
element;
|
|
45
|
-
localization;
|
|
46
|
-
ngZone;
|
|
47
|
-
renderer;
|
|
48
|
-
/**
|
|
49
|
-
* @hidden
|
|
50
|
-
*/
|
|
51
|
-
chevronLeftIcon = chevronLeftIcon;
|
|
52
|
-
/**
|
|
53
|
-
* @hidden
|
|
54
|
-
*/
|
|
55
|
-
chevronRightIcon = chevronRightIcon;
|
|
56
|
-
/**
|
|
57
|
-
* Provides the data source for the ScrollView ([see example](slug:datasources_scrollview)).
|
|
58
|
-
* @default []
|
|
59
|
-
*/
|
|
60
|
-
data = [];
|
|
61
|
-
/**
|
|
62
|
-
* Sets the current item index ([see example](slug:activeitems_scrollview)).
|
|
63
|
-
* @default 0
|
|
64
|
-
*/
|
|
65
|
-
set activeIndex(value) {
|
|
66
|
-
this.index = this._activeIndex = value;
|
|
67
|
-
}
|
|
68
|
-
get activeIndex() {
|
|
69
|
-
return this._activeIndex;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Sets the width of the ScrollView ([see example](slug:dimensions_scrollview)).
|
|
73
|
-
* By default, the width is not set and must be explicitly defined.
|
|
74
|
-
*/
|
|
75
|
-
width;
|
|
76
|
-
/**
|
|
77
|
-
* Sets the height of the ScrollView ([see example](slug:dimensions_scrollview)).
|
|
78
|
-
* By default, the height is not set and must be explicitly defined.
|
|
79
|
-
*/
|
|
80
|
-
height;
|
|
81
|
-
/**
|
|
82
|
-
* Enables or disables endless scrolling mode, where items loop endlessly ([see example](slug:endlessscrolling_scrollview)).
|
|
83
|
-
* @default false
|
|
84
|
-
*/
|
|
85
|
-
endless = false;
|
|
86
|
-
/**
|
|
87
|
-
* Sets the pager overlay style to `dark`, `light`, or `none`.
|
|
88
|
-
* @default 'none'
|
|
89
|
-
*/
|
|
90
|
-
pagerOverlay = 'none';
|
|
91
|
-
/**
|
|
92
|
-
* Enables or disables built-in animations ([see example](slug:animations_scrollview)).
|
|
93
|
-
* @default true
|
|
94
|
-
*/
|
|
95
|
-
animate = true;
|
|
96
|
-
/**
|
|
97
|
-
* Enables or disables the built-in pager ([see example](slug:paging_scrollview)).
|
|
98
|
-
* @default false
|
|
99
|
-
*/
|
|
100
|
-
pageable = false;
|
|
101
|
-
/**
|
|
102
|
-
* Enables or disables the built-in navigation arrows ([see example](slug:arrows_scrollview)).
|
|
103
|
-
* @default false
|
|
104
|
-
*/
|
|
105
|
-
arrows = false;
|
|
106
|
-
/**
|
|
107
|
-
* Fires after the current item is changed.
|
|
108
|
-
*/
|
|
109
|
-
itemChanged = new EventEmitter();
|
|
110
|
-
/**
|
|
111
|
-
* Fires after the `activeIndex` has changed. Allows for two-way binding of the `activeIndex` property.
|
|
112
|
-
*/
|
|
113
|
-
activeIndexChange = new EventEmitter();
|
|
114
|
-
itemTemplateRef;
|
|
115
|
-
itemWrapper;
|
|
116
|
-
prevButton;
|
|
117
|
-
nextButton;
|
|
118
|
-
scrollViewClass = true;
|
|
119
|
-
scrollViewRole = 'application';
|
|
120
|
-
scrollViewRoleDescription = 'carousel';
|
|
121
|
-
get scrollViewLightOverlayClass() {
|
|
122
|
-
return this.pagerOverlay === 'light';
|
|
123
|
-
}
|
|
124
|
-
get scrollViewDarkOverlayClass() {
|
|
125
|
-
return this.pagerOverlay === 'dark';
|
|
126
|
-
}
|
|
127
|
-
get hostWidth() { return this.width; }
|
|
128
|
-
get hostHeight() { return this.height; }
|
|
129
|
-
tabIndex = 0;
|
|
130
|
-
ariaLive = 'assertive';
|
|
131
|
-
get dir() {
|
|
132
|
-
return this.direction;
|
|
133
|
-
}
|
|
134
|
-
touchAction = 'pan-y pinch-zoom';
|
|
135
|
-
animationState = null;
|
|
136
|
-
view = new DataCollection(() => new DataResultIterator(this.data, this.activeIndex, this.endless, this.pageIndex, this.isRTL));
|
|
137
|
-
/**
|
|
138
|
-
* @hidden
|
|
139
|
-
*/
|
|
140
|
-
scrollviewId;
|
|
141
|
-
isDataSourceEmpty = false;
|
|
142
|
-
subs = new Subscription();
|
|
143
|
-
_activeIndex = 0;
|
|
144
|
-
index = 0;
|
|
145
|
-
initialTouchCoordinate;
|
|
146
|
-
pageIndex = null;
|
|
147
|
-
transforms = ['translateX(-100%)', 'translateX(0%)', 'translateX(100%)'];
|
|
148
|
-
get direction() {
|
|
149
|
-
return this.localization.rtl ? 'rtl' : 'ltr';
|
|
150
|
-
}
|
|
151
|
-
constructor(element, localization, ngZone, renderer) {
|
|
152
|
-
this.element = element;
|
|
153
|
-
this.localization = localization;
|
|
154
|
-
this.ngZone = ngZone;
|
|
155
|
-
this.renderer = renderer;
|
|
156
|
-
validatePackage(packageMetadata);
|
|
157
|
-
}
|
|
158
|
-
ngOnInit() {
|
|
159
|
-
this.subs.add(this.renderer.listen(this.element.nativeElement, 'keydown', event => this.keyDown(event)));
|
|
160
|
-
if (this.arrows) {
|
|
161
|
-
this.scrollviewId = `k-scrollview-wrap-${++idx}`;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
ngOnDestroy() {
|
|
165
|
-
this.subs.unsubscribe();
|
|
166
|
-
}
|
|
167
|
-
ngOnChanges(_) {
|
|
168
|
-
if (this.data && this.data.length === 0) {
|
|
169
|
-
this.activeIndex = Math.max(Math.min(this.activeIndex, this.view.total - 1), 0);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Navigates the ScrollView to the previous item.
|
|
174
|
-
*/
|
|
175
|
-
prev() {
|
|
176
|
-
this.navigate(Dir.Prev);
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Navigates the ScrollView to the next item.
|
|
180
|
-
*/
|
|
181
|
-
next() {
|
|
182
|
-
this.navigate(Dir.Next);
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* @hidden
|
|
186
|
-
*/
|
|
187
|
-
transitionEndHandler(e) {
|
|
188
|
-
this.animationState = null;
|
|
189
|
-
if (e.toState === 'left' || e.toState === 'right') {
|
|
190
|
-
if (this.pageIndex !== null) {
|
|
191
|
-
this.activeIndex = this.pageIndex;
|
|
192
|
-
this.pageIndex = null;
|
|
193
|
-
}
|
|
194
|
-
this.activeIndex = this.index;
|
|
195
|
-
this.activeIndexChange.emit(this.activeIndex);
|
|
196
|
-
this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* @hidden
|
|
201
|
-
*/
|
|
202
|
-
handlePress(e) {
|
|
203
|
-
this.initialTouchCoordinate = e.pageX;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* @hidden
|
|
207
|
-
*/
|
|
208
|
-
handleDrag(e) {
|
|
209
|
-
const deltaX = e.pageX - this.initialTouchCoordinate;
|
|
210
|
-
if (!this.animationState && !this.isDragForbidden(deltaX) && this.draggedInsideBounds(deltaX)) {
|
|
211
|
-
this.renderer.setStyle(this.itemWrapper.nativeElement, 'transform', `translateX(${deltaX}px)`);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* @hidden
|
|
216
|
-
*/
|
|
217
|
-
handleRelease(e) {
|
|
218
|
-
const deltaX = e.pageX - this.initialTouchCoordinate;
|
|
219
|
-
if (this.isDragForbidden(deltaX)) {
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
this.ngZone.run(() => {
|
|
223
|
-
if (this.draggedEnoughToNavigate(deltaX)) {
|
|
224
|
-
if (this.isRTL) {
|
|
225
|
-
this.changeIndex(deltaX < 0 ? Dir.Prev : Dir.Next);
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
this.changeIndex(deltaX > 0 ? Dir.Prev : Dir.Next);
|
|
229
|
-
}
|
|
230
|
-
if (!this.animate) {
|
|
231
|
-
this.renderer.removeStyle(this.itemWrapper.nativeElement, 'transform');
|
|
232
|
-
this.activeIndexChange.emit(this.activeIndex);
|
|
233
|
-
this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
if (this.animate && deltaX) {
|
|
238
|
-
this.animationState = 'center';
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
this.renderer.removeStyle(this.itemWrapper.nativeElement, 'transform');
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* @hidden
|
|
248
|
-
*/
|
|
249
|
-
pageChange(idx) {
|
|
250
|
-
if (!this.animationState && this.activeIndex !== idx) {
|
|
251
|
-
if (this.animate) {
|
|
252
|
-
this.pageIndex = idx;
|
|
253
|
-
if (this.isRTL) {
|
|
254
|
-
this.animationState = (this.pageIndex > this.index ? 'right' : 'left');
|
|
255
|
-
}
|
|
256
|
-
else {
|
|
257
|
-
this.animationState = (this.pageIndex > this.index ? 'left' : 'right');
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
this.activeIndex = idx;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* @hidden
|
|
267
|
-
*/
|
|
268
|
-
inlineListItemStyles(idx) {
|
|
269
|
-
return {
|
|
270
|
-
'height': this.height,
|
|
271
|
-
'transform': this.transforms[idx],
|
|
272
|
-
'width': '100%',
|
|
273
|
-
'position': 'absolute',
|
|
274
|
-
'top': '0',
|
|
275
|
-
'left': '0'
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* @hidden
|
|
280
|
-
*/
|
|
281
|
-
displayLeftArrow() {
|
|
282
|
-
let isNotBorderItem;
|
|
283
|
-
if (this.isRTL) {
|
|
284
|
-
isNotBorderItem = this.activeIndex + 1 < this.view.total;
|
|
285
|
-
}
|
|
286
|
-
else {
|
|
287
|
-
isNotBorderItem = this.activeIndex > 0;
|
|
288
|
-
}
|
|
289
|
-
return (this.endless || isNotBorderItem) && this.view.total > 0;
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* @hidden
|
|
293
|
-
*/
|
|
294
|
-
leftArrowClick() {
|
|
295
|
-
if (this.isRTL) {
|
|
296
|
-
this.next();
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
this.prev();
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* @hidden
|
|
304
|
-
*/
|
|
305
|
-
displayRightArrow() {
|
|
306
|
-
let isNotBorderItem;
|
|
307
|
-
if (this.isRTL) {
|
|
308
|
-
isNotBorderItem = this.activeIndex > 0;
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
isNotBorderItem = this.activeIndex + 1 < this.view.total;
|
|
312
|
-
}
|
|
313
|
-
return (this.endless || isNotBorderItem) && this.view.total > 0;
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* @hidden
|
|
317
|
-
*/
|
|
318
|
-
rightArrowClick() {
|
|
319
|
-
if (this.isRTL) {
|
|
320
|
-
this.prev();
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
this.next();
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
draggedInsideBounds(deltaX) {
|
|
327
|
-
return Math.abs(deltaX) <= this.element.nativeElement.offsetWidth;
|
|
328
|
-
}
|
|
329
|
-
draggedEnoughToNavigate(deltaX) {
|
|
330
|
-
return Math.abs(deltaX) > (this.element.nativeElement.offsetWidth / 2);
|
|
331
|
-
}
|
|
332
|
-
isDragForbidden(deltaX) {
|
|
333
|
-
let pastEnd;
|
|
334
|
-
if (this.isRTL) {
|
|
335
|
-
pastEnd = deltaX < 0 && deltaX !== 0;
|
|
336
|
-
}
|
|
337
|
-
else {
|
|
338
|
-
pastEnd = deltaX > 0 && deltaX !== 0;
|
|
339
|
-
}
|
|
340
|
-
const isEndReached = ((this.activeIndex === 0 && pastEnd) || (this.activeIndex === this.view.total - 1 && !pastEnd));
|
|
341
|
-
return !this.endless && isEndReached;
|
|
342
|
-
}
|
|
343
|
-
keyDown(e) {
|
|
344
|
-
const keyCode = normalizeKeys(e);
|
|
345
|
-
if (keyCode === Keys.ArrowLeft) {
|
|
346
|
-
if (this.isRTL) {
|
|
347
|
-
this.next();
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
this.prev();
|
|
351
|
-
}
|
|
352
|
-
else if (keyCode === Keys.ArrowRight) {
|
|
353
|
-
if (this.isRTL) {
|
|
354
|
-
this.prev();
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
this.next();
|
|
358
|
-
}
|
|
359
|
-
if (this.arrows && (keyCode === Keys.Space || keyCode === Keys.Enter)) {
|
|
360
|
-
const prevButton = this.prevButton?.nativeElement;
|
|
361
|
-
const nextButton = this.nextButton?.nativeElement;
|
|
362
|
-
const activeElement = document.activeElement;
|
|
363
|
-
const isPrevButtonFocused = activeElement === prevButton;
|
|
364
|
-
const isNextButtonFocused = activeElement === nextButton;
|
|
365
|
-
if (isPrevButtonFocused) {
|
|
366
|
-
if (this.isRTL) {
|
|
367
|
-
this.next();
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
this.prev();
|
|
371
|
-
}
|
|
372
|
-
else if (isNextButtonFocused) {
|
|
373
|
-
if (this.isRTL) {
|
|
374
|
-
this.prev();
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
this.next();
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
navigate(direction) {
|
|
382
|
-
if (this.isDataSourceEmpty || this.animationState) {
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
this.changeIndex(direction);
|
|
386
|
-
if (!this.animate) {
|
|
387
|
-
this.activeIndexChange.emit(this.activeIndex);
|
|
388
|
-
this.itemChanged.emit({ index: this.activeIndex, item: this.view.item(1) });
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
changeIndex(direction) {
|
|
392
|
-
if (direction === Dir.Next && this.view.canMoveNext()) {
|
|
393
|
-
this.index = (this.index + 1) % this.view.total;
|
|
394
|
-
if (this.animate) {
|
|
395
|
-
this.animationState = this.isRTL ? 'right' : 'left';
|
|
396
|
-
}
|
|
397
|
-
else {
|
|
398
|
-
this.activeIndex = this.index;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
else if (direction === Dir.Prev && this.view.canMovePrev()) {
|
|
402
|
-
this.index = this.index === 0 ? this.view.total - 1 : this.index - 1;
|
|
403
|
-
if (this.animate) {
|
|
404
|
-
this.animationState = this.isRTL ? 'left' : 'right';
|
|
405
|
-
}
|
|
406
|
-
else {
|
|
407
|
-
this.activeIndex = this.index;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
get isRTL() {
|
|
412
|
-
return this.direction === 'rtl';
|
|
413
|
-
}
|
|
414
|
-
get prevButtonArrowIcon() {
|
|
415
|
-
return this.direction === 'ltr' ? 'chevron-left' : 'chevron-right';
|
|
416
|
-
}
|
|
417
|
-
get nextButtonArrowIcon() {
|
|
418
|
-
return this.direction === 'ltr' ? 'chevron-right' : 'chevron-left';
|
|
419
|
-
}
|
|
420
|
-
get prevButtonArrowSVGIcon() {
|
|
421
|
-
return this.direction === 'ltr' ? this.chevronLeftIcon : this.chevronRightIcon;
|
|
422
|
-
}
|
|
423
|
-
get nextButtonArrowSVGIcon() {
|
|
424
|
-
return this.direction === 'ltr' ? this.chevronRightIcon : this.chevronLeftIcon;
|
|
425
|
-
}
|
|
426
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScrollViewComponent, deps: [{ token: i0.ElementRef }, { token: i1.LocalizationService }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
427
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", 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: [
|
|
428
|
-
LocalizationService,
|
|
429
|
-
{
|
|
430
|
-
provide: L10N_PREFIX,
|
|
431
|
-
useValue: 'kendo.scrollview'
|
|
432
|
-
}
|
|
433
|
-
], 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: `
|
|
434
|
-
|
|
435
|
-
<ng-container kendoScrollViewLocalizedMessages
|
|
436
|
-
i18n-pagerButtonLabel="kendo.scrollview.pagerButtonLabel|The label for the buttons inside the ScrollView Pager"
|
|
437
|
-
pagerButtonLabel="{{ 'Item {itemIndex}' }}">
|
|
438
|
-
<ng-container>
|
|
439
|
-
|
|
440
|
-
<div class="k-scrollview-wrap k-scrollview-animate"
|
|
441
|
-
#itemWrapper
|
|
442
|
-
role="list"
|
|
443
|
-
[id]="scrollviewId"
|
|
444
|
-
[@animateTo]="animationState"
|
|
445
|
-
(@animateTo.done)="transitionEndHandler($event)"
|
|
446
|
-
kendoDraggable
|
|
447
|
-
(kendoDrag)="handleDrag($event)"
|
|
448
|
-
(kendoPress)="handlePress($event)"
|
|
449
|
-
(kendoRelease)="handleRelease($event)"
|
|
450
|
-
>
|
|
451
|
-
@for (item of view; track $index; let i = $index) {
|
|
452
|
-
<div class="k-scrollview-view"
|
|
453
|
-
role="listitem"
|
|
454
|
-
aria-roledescription="slide"
|
|
455
|
-
[ngStyle]="inlineListItemStyles(i)"
|
|
456
|
-
[attr.aria-hidden]="i !== 1"
|
|
457
|
-
>
|
|
458
|
-
<ng-template
|
|
459
|
-
[ngTemplateOutlet]="itemTemplateRef"
|
|
460
|
-
[ngTemplateOutletContext]="{ item: item }">
|
|
461
|
-
</ng-template>
|
|
462
|
-
</div>
|
|
463
|
-
}
|
|
464
|
-
</div>
|
|
465
|
-
@if (!isDataSourceEmpty && (pageable || arrows)) {
|
|
466
|
-
<div class='k-scrollview-elements'
|
|
467
|
-
[ngStyle]="{'height': height}"
|
|
468
|
-
>
|
|
469
|
-
@if (arrows && displayLeftArrow()) {
|
|
470
|
-
<span
|
|
471
|
-
#prevButton
|
|
472
|
-
class="k-scrollview-prev"
|
|
473
|
-
role="button"
|
|
474
|
-
[attr.aria-controls]="scrollviewId"
|
|
475
|
-
aria-label="previous"
|
|
476
|
-
(click)="leftArrowClick()">
|
|
477
|
-
<kendo-icon-wrapper
|
|
478
|
-
size="xxxlarge"
|
|
479
|
-
[name]="prevButtonArrowIcon"
|
|
480
|
-
[svgIcon]="prevButtonArrowSVGIcon"
|
|
481
|
-
>
|
|
482
|
-
</kendo-icon-wrapper>
|
|
483
|
-
</span>
|
|
484
|
-
}
|
|
485
|
-
@if (arrows && displayRightArrow()) {
|
|
486
|
-
<span
|
|
487
|
-
#nextButton
|
|
488
|
-
class="k-scrollview-next"
|
|
489
|
-
role="button"
|
|
490
|
-
[attr.aria-controls]="scrollviewId"
|
|
491
|
-
aria-label="next"
|
|
492
|
-
(click)="rightArrowClick()">
|
|
493
|
-
<kendo-icon-wrapper
|
|
494
|
-
size="xxxlarge"
|
|
495
|
-
[name]="nextButtonArrowIcon"
|
|
496
|
-
[svgIcon]="nextButtonArrowSVGIcon"
|
|
497
|
-
>
|
|
498
|
-
</kendo-icon-wrapper>
|
|
499
|
-
</span>
|
|
500
|
-
}
|
|
501
|
-
@if (pageable) {
|
|
502
|
-
<kendo-scrollview-pager
|
|
503
|
-
class='k-scrollview-nav-wrap'
|
|
504
|
-
(pagerIndexChange)="pageChange($event)"
|
|
505
|
-
[data]="data"
|
|
506
|
-
[activeIndex]="activeIndex">
|
|
507
|
-
</kendo-scrollview-pager>
|
|
508
|
-
}
|
|
509
|
-
</div>
|
|
510
|
-
}
|
|
511
|
-
<div class="k-sr-only" aria-live="polite"></div>
|
|
512
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoScrollViewLocalizedMessages]" }, { kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: ScrollViewPagerComponent, selector: "kendo-scrollview-pager", inputs: ["activeIndex", "data"], outputs: ["pagerIndexChange"] }], animations: [
|
|
513
|
-
trigger('animateTo', [
|
|
514
|
-
state('center, left, right', style({ transform: 'translateX(0)' })),
|
|
515
|
-
transition('* => right', [
|
|
516
|
-
animate('300ms ease-out', style({ transform: 'translateX(100%)' }))
|
|
517
|
-
]),
|
|
518
|
-
transition('* => left', [
|
|
519
|
-
animate('300ms ease-out', style({ transform: 'translateX(-100%)' }))
|
|
520
|
-
]),
|
|
521
|
-
transition('* => center', [
|
|
522
|
-
animate('300ms ease-out')
|
|
523
|
-
])
|
|
524
|
-
])
|
|
525
|
-
] });
|
|
526
|
-
}
|
|
527
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScrollViewComponent, decorators: [{
|
|
528
|
-
type: Component,
|
|
529
|
-
args: [{
|
|
530
|
-
animations: [
|
|
531
|
-
trigger('animateTo', [
|
|
532
|
-
state('center, left, right', style({ transform: 'translateX(0)' })),
|
|
533
|
-
transition('* => right', [
|
|
534
|
-
animate('300ms ease-out', style({ transform: 'translateX(100%)' }))
|
|
535
|
-
]),
|
|
536
|
-
transition('* => left', [
|
|
537
|
-
animate('300ms ease-out', style({ transform: 'translateX(-100%)' }))
|
|
538
|
-
]),
|
|
539
|
-
transition('* => center', [
|
|
540
|
-
animate('300ms ease-out')
|
|
541
|
-
])
|
|
542
|
-
])
|
|
543
|
-
],
|
|
544
|
-
exportAs: 'kendoScrollView',
|
|
545
|
-
providers: [
|
|
546
|
-
LocalizationService,
|
|
547
|
-
{
|
|
548
|
-
provide: L10N_PREFIX,
|
|
549
|
-
useValue: 'kendo.scrollview'
|
|
550
|
-
}
|
|
551
|
-
],
|
|
552
|
-
selector: 'kendo-scrollview',
|
|
553
|
-
template: `
|
|
554
|
-
|
|
555
|
-
<ng-container kendoScrollViewLocalizedMessages
|
|
556
|
-
i18n-pagerButtonLabel="kendo.scrollview.pagerButtonLabel|The label for the buttons inside the ScrollView Pager"
|
|
557
|
-
pagerButtonLabel="{{ 'Item {itemIndex}' }}">
|
|
558
|
-
<ng-container>
|
|
559
|
-
|
|
560
|
-
<div class="k-scrollview-wrap k-scrollview-animate"
|
|
561
|
-
#itemWrapper
|
|
562
|
-
role="list"
|
|
563
|
-
[id]="scrollviewId"
|
|
564
|
-
[@animateTo]="animationState"
|
|
565
|
-
(@animateTo.done)="transitionEndHandler($event)"
|
|
566
|
-
kendoDraggable
|
|
567
|
-
(kendoDrag)="handleDrag($event)"
|
|
568
|
-
(kendoPress)="handlePress($event)"
|
|
569
|
-
(kendoRelease)="handleRelease($event)"
|
|
570
|
-
>
|
|
571
|
-
@for (item of view; track $index; let i = $index) {
|
|
572
|
-
<div class="k-scrollview-view"
|
|
573
|
-
role="listitem"
|
|
574
|
-
aria-roledescription="slide"
|
|
575
|
-
[ngStyle]="inlineListItemStyles(i)"
|
|
576
|
-
[attr.aria-hidden]="i !== 1"
|
|
577
|
-
>
|
|
578
|
-
<ng-template
|
|
579
|
-
[ngTemplateOutlet]="itemTemplateRef"
|
|
580
|
-
[ngTemplateOutletContext]="{ item: item }">
|
|
581
|
-
</ng-template>
|
|
582
|
-
</div>
|
|
583
|
-
}
|
|
584
|
-
</div>
|
|
585
|
-
@if (!isDataSourceEmpty && (pageable || arrows)) {
|
|
586
|
-
<div class='k-scrollview-elements'
|
|
587
|
-
[ngStyle]="{'height': height}"
|
|
588
|
-
>
|
|
589
|
-
@if (arrows && displayLeftArrow()) {
|
|
590
|
-
<span
|
|
591
|
-
#prevButton
|
|
592
|
-
class="k-scrollview-prev"
|
|
593
|
-
role="button"
|
|
594
|
-
[attr.aria-controls]="scrollviewId"
|
|
595
|
-
aria-label="previous"
|
|
596
|
-
(click)="leftArrowClick()">
|
|
597
|
-
<kendo-icon-wrapper
|
|
598
|
-
size="xxxlarge"
|
|
599
|
-
[name]="prevButtonArrowIcon"
|
|
600
|
-
[svgIcon]="prevButtonArrowSVGIcon"
|
|
601
|
-
>
|
|
602
|
-
</kendo-icon-wrapper>
|
|
603
|
-
</span>
|
|
604
|
-
}
|
|
605
|
-
@if (arrows && displayRightArrow()) {
|
|
606
|
-
<span
|
|
607
|
-
#nextButton
|
|
608
|
-
class="k-scrollview-next"
|
|
609
|
-
role="button"
|
|
610
|
-
[attr.aria-controls]="scrollviewId"
|
|
611
|
-
aria-label="next"
|
|
612
|
-
(click)="rightArrowClick()">
|
|
613
|
-
<kendo-icon-wrapper
|
|
614
|
-
size="xxxlarge"
|
|
615
|
-
[name]="nextButtonArrowIcon"
|
|
616
|
-
[svgIcon]="nextButtonArrowSVGIcon"
|
|
617
|
-
>
|
|
618
|
-
</kendo-icon-wrapper>
|
|
619
|
-
</span>
|
|
620
|
-
}
|
|
621
|
-
@if (pageable) {
|
|
622
|
-
<kendo-scrollview-pager
|
|
623
|
-
class='k-scrollview-nav-wrap'
|
|
624
|
-
(pagerIndexChange)="pageChange($event)"
|
|
625
|
-
[data]="data"
|
|
626
|
-
[activeIndex]="activeIndex">
|
|
627
|
-
</kendo-scrollview-pager>
|
|
628
|
-
}
|
|
629
|
-
</div>
|
|
630
|
-
}
|
|
631
|
-
<div class="k-sr-only" aria-live="polite"></div>
|
|
632
|
-
`,
|
|
633
|
-
standalone: true,
|
|
634
|
-
imports: [LocalizedMessagesDirective, DraggableDirective, NgStyle, NgTemplateOutlet, IconWrapperComponent, ScrollViewPagerComponent]
|
|
635
|
-
}]
|
|
636
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.LocalizationService }, { type: i0.NgZone }, { type: i0.Renderer2 }], propDecorators: { data: [{
|
|
637
|
-
type: Input
|
|
638
|
-
}], activeIndex: [{
|
|
639
|
-
type: Input
|
|
640
|
-
}], width: [{
|
|
641
|
-
type: Input
|
|
642
|
-
}], height: [{
|
|
643
|
-
type: Input
|
|
644
|
-
}], endless: [{
|
|
645
|
-
type: Input
|
|
646
|
-
}], pagerOverlay: [{
|
|
647
|
-
type: Input
|
|
648
|
-
}], animate: [{
|
|
649
|
-
type: Input
|
|
650
|
-
}], pageable: [{
|
|
651
|
-
type: Input
|
|
652
|
-
}], arrows: [{
|
|
653
|
-
type: Input
|
|
654
|
-
}], itemChanged: [{
|
|
655
|
-
type: Output
|
|
656
|
-
}], activeIndexChange: [{
|
|
657
|
-
type: Output
|
|
658
|
-
}], itemTemplateRef: [{
|
|
659
|
-
type: ContentChild,
|
|
660
|
-
args: [TemplateRef]
|
|
661
|
-
}], itemWrapper: [{
|
|
662
|
-
type: ViewChild,
|
|
663
|
-
args: ['itemWrapper']
|
|
664
|
-
}], prevButton: [{
|
|
665
|
-
type: ViewChild,
|
|
666
|
-
args: ['prevButton']
|
|
667
|
-
}], nextButton: [{
|
|
668
|
-
type: ViewChild,
|
|
669
|
-
args: ['nextButton']
|
|
670
|
-
}], scrollViewClass: [{
|
|
671
|
-
type: HostBinding,
|
|
672
|
-
args: ['class.k-scrollview']
|
|
673
|
-
}], scrollViewRole: [{
|
|
674
|
-
type: HostBinding,
|
|
675
|
-
args: ['attr.role']
|
|
676
|
-
}], scrollViewRoleDescription: [{
|
|
677
|
-
type: HostBinding,
|
|
678
|
-
args: ['attr.aria-roledescription']
|
|
679
|
-
}], scrollViewLightOverlayClass: [{
|
|
680
|
-
type: HostBinding,
|
|
681
|
-
args: ['class.k-scrollview-light']
|
|
682
|
-
}], scrollViewDarkOverlayClass: [{
|
|
683
|
-
type: HostBinding,
|
|
684
|
-
args: ['class.k-scrollview-dark']
|
|
685
|
-
}], hostWidth: [{
|
|
686
|
-
type: HostBinding,
|
|
687
|
-
args: ['style.width']
|
|
688
|
-
}], hostHeight: [{
|
|
689
|
-
type: HostBinding,
|
|
690
|
-
args: ['style.height']
|
|
691
|
-
}], tabIndex: [{
|
|
692
|
-
type: HostBinding,
|
|
693
|
-
args: ['attr.tabindex']
|
|
694
|
-
}], ariaLive: [{
|
|
695
|
-
type: HostBinding,
|
|
696
|
-
args: ['attr.aria-live']
|
|
697
|
-
}], dir: [{
|
|
698
|
-
type: HostBinding,
|
|
699
|
-
args: ['attr.dir']
|
|
700
|
-
}], touchAction: [{
|
|
701
|
-
type: HostBinding,
|
|
702
|
-
args: ['style.touch-action']
|
|
703
|
-
}] } });
|