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