@progress/kendo-vue-scrollview 5.3.0-dev.202410141143 → 5.3.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.
@@ -1,353 +0,0 @@
1
- // @ts-ignore
2
- import * as Vue from 'vue';
3
- var allVue = Vue;
4
- var gh = allVue.h;
5
- var isV3 = allVue.version && allVue.version[0] === '3';
6
- import { classNames, getListeners, getRef, getTemplate, Icon, isRtl, Keys, setRef, templateRendering, validatePackage } from '@progress/kendo-vue-common';
7
- import { packageMetadata } from './package-metadata.js';
8
- import { chevronLeftIcon, chevronRightIcon } from '@progress/kendo-svg-icons';
9
- /**
10
- * @hidden
11
- */
12
- var ScrollViewVue2 = {
13
- name: 'KendoScrollView',
14
- props: {
15
- activeView: {
16
- type: Number,
17
- default: 1
18
- },
19
- dataItems: {
20
- type: Array,
21
- default: function _default() {
22
- return [];
23
- }
24
- },
25
- arrows: {
26
- type: Boolean,
27
- default: true
28
- },
29
- automaticViewChange: {
30
- type: Boolean,
31
- default: true
32
- },
33
- automaticViewChangeInterval: {
34
- type: Number,
35
- default: 5000
36
- },
37
- content: [Object, String, Function],
38
- dir: String,
39
- endless: Boolean,
40
- pageable: {
41
- type: Boolean,
42
- default: true
43
- },
44
- pagerOverlay: {
45
- type: String,
46
- default: 'none'
47
- }
48
- },
49
- created: function created() {
50
- validatePackage(packageMetadata);
51
- this.timeoutRef = null;
52
- },
53
- mounted: function mounted() {
54
- this.wrapElement = getRef(this, 'wrapElement');
55
- this.currentDir = this.$props.dir !== undefined ? this.$props.dir : isRtl(this.$el) ? 'rtl' : 'ltr';
56
- this.runAutomaticChange();
57
- },
58
- updated: function updated() {
59
- var viewsCount = this.dataItems.length;
60
- if (this.wrapElement) {
61
- this.wrapElement.style.setProperty('--kendo-scrollview-views', "".concat(viewsCount));
62
- this.wrapElement.style.setProperty('--kendo-scrollview-current', "".concat(this.active));
63
- }
64
- this.runAutomaticChange();
65
- },
66
- data: function data() {
67
- return {
68
- active: this.activeView || 1,
69
- currentDir: undefined
70
- };
71
- },
72
- computed: {
73
- scrollViewClasses: function scrollViewClasses() {
74
- return {
75
- 'k-scrollview': true,
76
- 'k-scrollview-light': this.pagerOverlay === 'light',
77
- 'k-scrollview-dark': this.pagerOverlay === 'dark'
78
- };
79
- },
80
- displayLeftArrow: function displayLeftArrow() {
81
- var isNotBorderItem;
82
- if (this.isRtl) {
83
- isNotBorderItem = this.active < this.dataItems.length;
84
- } else {
85
- isNotBorderItem = this.active > 1;
86
- }
87
- return (this.endless || isNotBorderItem) && this.dataItems.length > 0;
88
- },
89
- displayRightArrow: function displayRightArrow() {
90
- var isNotBorderItem;
91
- if (this.isRtl) {
92
- isNotBorderItem = this.active > 1;
93
- } else {
94
- isNotBorderItem = this.active < this.dataItems.length;
95
- }
96
- return (this.endless || isNotBorderItem) && this.dataItems.length > 0;
97
- },
98
- isRtl: function isRtl() {
99
- return this.currentDir === 'rtl';
100
- }
101
- },
102
- // @ts-ignore
103
- setup: !isV3 ? undefined : function () {
104
- var v3 = !!isV3;
105
- return {
106
- v3: v3
107
- };
108
- },
109
- // @ts-ignore
110
- render: function render(createElement) {
111
- var h = gh || createElement;
112
- var _a = this.$props,
113
- pageable = _a.pageable,
114
- arrows = _a.arrows,
115
- content = _a.content;
116
- var viewsCount = this.dataItems.length;
117
- var allContent = this.dataItems.map(function (item, index) {
118
- var contentTemplate = templateRendering.call(this, item.content || content, getListeners.call(this));
119
- var contentRender = getTemplate.call(this, {
120
- h: h,
121
- template: contentTemplate,
122
- defaultRendering: null,
123
- additionalProps: {
124
- item: item,
125
- items: this.dataItems
126
- }
127
- });
128
- return h("div", {
129
- "class": "k-scrollview-view",
130
- "aria-hidden": this.active === index + 1 ? false : true,
131
- attrs: this.v3 ? undefined : {
132
- "aria-hidden": this.active === index + 1 ? false : true
133
- }
134
- }, [contentRender]);
135
- }, this);
136
- return h("div", {
137
- "class": this.scrollViewClasses,
138
- tabindex: 0,
139
- attrs: this.v3 ? undefined : {
140
- tabindex: 0,
141
- dir: this.currentDir
142
- },
143
- dir: this.currentDir,
144
- onKeydown: this.handleKeyDown,
145
- on: this.v3 ? undefined : {
146
- "keydown": this.handleKeyDown
147
- }
148
- }, [h("div", {
149
- "class": "k-scrollview-wrap k-scrollview-animate",
150
- style: "--kendo-scrollview-views:".concat(viewsCount, "; --kendo-scrollview-current:").concat(this.active, ";"),
151
- ref: setRef(this, 'wrapElement')
152
- }, [allContent]), h("div", {
153
- "class": "k-scrollview-elements"
154
- }, [arrows && [this.displayLeftArrow && h("span", {
155
- "class": "k-scrollview-prev",
156
- "aria-label": "previous",
157
- attrs: this.v3 ? undefined : {
158
- "aria-label": "previous"
159
- },
160
- onClick: this.handlePrevClick,
161
- on: this.v3 ? undefined : {
162
- "click": this.handlePrevClick
163
- }
164
- }, [h(Icon, {
165
- name: this.isRtl ? 'chevron-right' : 'chevron-left',
166
- attrs: this.v3 ? undefined : {
167
- name: this.isRtl ? 'chevron-right' : 'chevron-left',
168
- icon: this.isRtl ? chevronRightIcon : chevronLeftIcon,
169
- size: 'xxxlarge'
170
- },
171
- icon: this.isRtl ? chevronRightIcon : chevronLeftIcon,
172
- size: 'xxxlarge'
173
- })]), this.displayRightArrow && h("span", {
174
- "class": "k-scrollview-next",
175
- "aria-label": "next",
176
- attrs: this.v3 ? undefined : {
177
- "aria-label": "next"
178
- },
179
- onClick: this.handleNextClick,
180
- on: this.v3 ? undefined : {
181
- "click": this.handleNextClick
182
- }
183
- }, [h(Icon, {
184
- name: this.isRtl ? 'chevron-left' : 'chevron-right',
185
- attrs: this.v3 ? undefined : {
186
- name: this.isRtl ? 'chevron-left' : 'chevron-right',
187
- icon: this.isRtl ? chevronLeftIcon : chevronRightIcon,
188
- size: 'xxxlarge'
189
- },
190
- icon: this.isRtl ? chevronLeftIcon : chevronRightIcon,
191
- size: 'xxxlarge'
192
- })])], pageable && h("div", {
193
- "class": "k-scrollview-nav-wrap"
194
- }, [h("ul", {
195
- "class": "k-scrollview-nav"
196
- }, [this.dataItems.map(function (_, index) {
197
- var _this = this;
198
- return h("li", {
199
- "class": classNames('k-link', {
200
- 'k-primary': this.active === index + 1
201
- }),
202
- key: index + 1,
203
- onClick: function onClick() {
204
- return _this.setActive(index + 1);
205
- },
206
- on: this.v3 ? undefined : {
207
- "click": function onClick() {
208
- return _this.setActive(index + 1);
209
- }
210
- }
211
- });
212
- }, this)])])])]);
213
- },
214
- methods: {
215
- runAutomaticChange: function runAutomaticChange() {
216
- if (this.automaticViewChange) {
217
- this.resetTimeout();
218
- var that_1 = this;
219
- var prevIndex_1 = this.active;
220
- this.timeoutRef = setTimeout(function () {
221
- that_1.setActive(prevIndex_1 === that_1.dataItems.length ? that_1.endless ? 1 : prevIndex_1 : prevIndex_1 + 1);
222
- }, this.automaticViewChangeInterval);
223
- }
224
- },
225
- resetTimeout: function resetTimeout() {
226
- if (this.timeoutRef) {
227
- clearTimeout(this.timeoutRef);
228
- }
229
- },
230
- setActive: function setActive(value) {
231
- this.active = value;
232
- },
233
- focusElement: function focusElement() {
234
- if (this.$el) {
235
- this.$el.focus();
236
- }
237
- },
238
- prev: function prev() {
239
- if (!this.endless) {
240
- if (this.active > 1) {
241
- this.setActive(this.active - 1);
242
- }
243
- } else {
244
- this.active > 1 ? this.setActive(this.active - 1) : this.setActive(this.dataItems.length);
245
- }
246
- },
247
- next: function next() {
248
- if (!this.endless) {
249
- if (this.active < this.dataItems.length) {
250
- this.setActive(this.active + 1);
251
- }
252
- } else {
253
- this.active < this.dataItems.length ? this.setActive(this.active + 1) : this.setActive(1);
254
- }
255
- },
256
- handlePrevClick: function handlePrevClick() {
257
- if (!this.isRtl) {
258
- this.prev();
259
- } else {
260
- this.next();
261
- }
262
- },
263
- handleNextClick: function handleNextClick() {
264
- if (!this.isRtl) {
265
- this.next();
266
- } else {
267
- this.prev();
268
- }
269
- },
270
- handleKeyDown: function handleKeyDown(event) {
271
- switch (event.keyCode) {
272
- case Keys.left:
273
- event.preventDefault();
274
- if (!this.isRtl) {
275
- this.prev();
276
- } else {
277
- this.next();
278
- }
279
- break;
280
- case Keys.right:
281
- event.preventDefault();
282
- if (!this.isRtl) {
283
- this.next();
284
- } else {
285
- this.prev();
286
- }
287
- break;
288
- default:
289
- break;
290
- }
291
- }
292
- }
293
- };
294
- /**
295
- *
296
- * Represents the [Kendo UI for Vue Native ScrollView component]({% slug overview_scrollview %}).
297
- *
298
- * ```jsx
299
- * <template>
300
- * <div>
301
- * <ScrollView
302
- * :style="{
303
- * width: '512px',
304
- * height: '384px',
305
- * }"
306
- * :data-items="items"
307
- * :content="'content'"
308
- * >
309
- * <template v-slot:content="{ props }">
310
- * <div class="image-with-text">
311
- * <img
312
- * :src="props.item.url"
313
- * :alt="`Photo ${props.item.position}`"
314
- * :style="{
315
- * width: '512px',
316
- * height: '384px',
317
- * }"
318
- * :draggable="false"
319
- * />
320
- * </div>
321
- * </template>
322
- * </ScrollView>
323
- * </div>
324
- * </template>
325
- *
326
- * <script>
327
- * import { ScrollView } from '@progress/kendo-vue-scrollview';
328
- *
329
- * export default {
330
- * components: {
331
- * ScrollView,
332
- * },
333
- * data() {
334
- * return {
335
- * items: [
336
- * {
337
- * url: 'https://www.telerik.com/kendo-vue-ui/components/layout/assets/card/kukeri.jpg',
338
- * },
339
- * {
340
- * url: 'https://www.telerik.com/kendo-vue-ui/components/layout/assets/card/martenitsa.jpg',
341
- * },
342
- * {
343
- * url: 'https://www.telerik.com/kendo-vue-ui/components/layout/assets/card/rose_festival.jpg',
344
- * },
345
- * ],
346
- * };
347
- * },
348
- * };
349
- * </script>
350
- * ```
351
- */
352
- var ScrollView = ScrollViewVue2;
353
- export { ScrollView, ScrollViewVue2 };
@@ -1,54 +0,0 @@
1
- /**
2
- * Represents the props of the [Kendo UI for Vue ScrollView component]({% slug overview_scrollview %}).
3
- */
4
- export interface ScrollViewProps {
5
- /**
6
- * Represents the current active view ([see example]({% slug activeview_scrollview %})). Defaults to `1`.
7
- */
8
- activeView?: number;
9
- /**
10
- * Enables or disables the built-in navigation arrows ([see example]({% slug arrows_scrollview %})). Defaults to `true`.
11
- */
12
- arrows?: boolean;
13
- /**
14
- * Allows the ScrollView to switch the next page automatically after a short delay ([see example]({% slug automatic_scrolling_scrollview %})).
15
- * Defaults to `true`.
16
- */
17
- automaticViewChange?: boolean;
18
- /**
19
- * Defines the automatic page change delay in milliseconds ([see example]({% slug automatic_scrolling_scrollview %})).
20
- * Defaults to `5000`.
21
- */
22
- automaticViewChangeInterval?: number;
23
- /**
24
- * Content Template for the ScrollView items.
25
- */
26
- content?: any;
27
- /**
28
- * An array of the items that are passed to the ScrollView component.
29
- */
30
- dataItems?: any[];
31
- /**
32
- * Represents the `dir` HTML attribute. This is used to switch from LTR to RTL.
33
- */
34
- dir?: string;
35
- /**
36
- * Toggles the endless scrolling mode in which the data items are endlessly looped
37
- * ([see example]({% slug endlessscrolling_scrollview %})). Defaults to `false`.
38
- */
39
- endless?: boolean;
40
- /**
41
- * Toggles the built-in pager ([see example]({% slug paging_scrollview %})). Defaults to `true`.
42
- */
43
- pageable?: boolean;
44
- /**
45
- * Sets the pager overlay ([see example]({% slug paging_scrollview %})).
46
- *
47
- * * The possible values are:
48
- * * `none`(Default) &mdash; No overlay is set.
49
- * * `dark` &mdash; Dark overlay is set.
50
- * * `light` &mdash; Light overlay is set.
51
- *
52
- */
53
- pagerOverlay?: 'dark' | 'light' | 'none' | string;
54
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- // @ts-ignore
2
- import { DefineComponent } from 'vue';
3
- // @ts-ignore
4
- import * as Vue from 'vue';
5
-
6
- /**
7
- * @hidden
8
- */
9
- // @ts-ignore
10
- type Vue2type = Vue.default;
11
-
12
- /**
13
- * @hidden
14
- */
15
- // @ts-ignore
16
- import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
17
- /**
18
- * @hidden
19
- */
20
- // @ts-ignore
21
- export { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type };
@@ -1,2 +0,0 @@
1
- export * from './ScrollView';
2
- export * from './ScrollViewProps';
package/dist/esm/main.js DELETED
@@ -1,2 +0,0 @@
1
- export * from './ScrollView.js';
2
- export * from './ScrollViewProps.js';
@@ -1,5 +0,0 @@
1
- import { PackageMetadata } from '@progress/kendo-licensing';
2
- /**
3
- * @hidden
4
- */
5
- export declare const packageMetadata: PackageMetadata;
@@ -1,11 +0,0 @@
1
- /**
2
- * @hidden
3
- */
4
- export var packageMetadata = {
5
- name: '@progress/kendo-vue-scrollview',
6
- productName: 'Kendo UI for Vue',
7
- productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
8
- publishDate: 1728906087,
9
- version: '',
10
- licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
11
- };
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,115 +0,0 @@
1
- import { DefineComponent } from './additionalTypes';
2
- import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
3
- declare type DefaultData<V> = object | ((this: V) => {});
4
- declare type DefaultMethods<V> = {
5
- [key: string]: (this: V, ...args: any[]) => any;
6
- };
7
- import { ScrollViewProps } from './ScrollViewProps';
8
- /**
9
- * @hidden
10
- */
11
- export interface ScrollViewHandle {
12
- /**
13
- * The ScrollView element.
14
- */
15
- element: HTMLDivElement | null;
16
- /**
17
- * Focus the ScrollView.
18
- */
19
- focus: () => void;
20
- }
21
- /**
22
- * @hidden
23
- */
24
- export interface ScrollViewState {
25
- timeoutRef: any;
26
- }
27
- /**
28
- * @hidden
29
- */
30
- export interface ScrollViewComputed {
31
- [key: string]: any;
32
- scrollViewClasses: object;
33
- }
34
- /**
35
- * @hidden
36
- */
37
- export interface ScrollViewMethods {
38
- [key: string]: any;
39
- }
40
- /**
41
- * @hidden
42
- */
43
- export interface ScrollViewData {
44
- active: number;
45
- currentDir?: string;
46
- }
47
- /**
48
- * @hidden
49
- */
50
- export interface ScrollViewAll extends Vue, ScrollViewMethods, ScrollViewData, ScrollViewComputed, ScrollViewState {
51
- }
52
- /**
53
- * @hidden
54
- */
55
- declare let ScrollViewVue2: ComponentOptions<ScrollViewAll, DefaultData<ScrollViewData>, DefaultMethods<ScrollViewAll>, ScrollViewComputed, RecordPropsDefinition<ScrollViewProps>>;
56
- /**
57
- *
58
- * Represents the [Kendo UI for Vue Native ScrollView component]({% slug overview_scrollview %}).
59
- *
60
- * ```jsx
61
- * <template>
62
- * <div>
63
- * <ScrollView
64
- * :style="{
65
- * width: '512px',
66
- * height: '384px',
67
- * }"
68
- * :data-items="items"
69
- * :content="'content'"
70
- * >
71
- * <template v-slot:content="{ props }">
72
- * <div class="image-with-text">
73
- * <img
74
- * :src="props.item.url"
75
- * :alt="`Photo ${props.item.position}`"
76
- * :style="{
77
- * width: '512px',
78
- * height: '384px',
79
- * }"
80
- * :draggable="false"
81
- * />
82
- * </div>
83
- * </template>
84
- * </ScrollView>
85
- * </div>
86
- * </template>
87
- *
88
- * <script>
89
- * import { ScrollView } from '@progress/kendo-vue-scrollview';
90
- *
91
- * export default {
92
- * components: {
93
- * ScrollView,
94
- * },
95
- * data() {
96
- * return {
97
- * items: [
98
- * {
99
- * url: 'https://www.telerik.com/kendo-vue-ui/components/layout/assets/card/kukeri.jpg',
100
- * },
101
- * {
102
- * url: 'https://www.telerik.com/kendo-vue-ui/components/layout/assets/card/martenitsa.jpg',
103
- * },
104
- * {
105
- * url: 'https://www.telerik.com/kendo-vue-ui/components/layout/assets/card/rose_festival.jpg',
106
- * },
107
- * ],
108
- * };
109
- * },
110
- * };
111
- * </script>
112
- * ```
113
- */
114
- declare const ScrollView: DefineComponent<ScrollViewProps, any, ScrollViewData, ScrollViewComputed, ScrollViewMethods, {}, {}, {}, string, ScrollViewProps, ScrollViewProps, {}>;
115
- export { ScrollView, ScrollViewVue2 };