@progress/kendo-vue-scrollview 5.3.0-dev.202409130647 → 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.
package/README.md CHANGED
@@ -1,39 +1,46 @@
1
- <a href="https://www.telerik.com/kendo-vue-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview&utm_content=banner" target="_blank">
1
+ <a href="https://www.telerik.com/kendo-vue-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-utils&utm_content=banner" target="_blank">
2
2
  <img src="https://www.telerik.com/kendo-vue-ui/npm-banner.svg" alt="Kendo UI for Vue NPM Banner">
3
3
  </a>
4
4
 
5
-
6
- # Kendo UI for Vue ScrollView Component for Vue
5
+ ## Kendo UI for Vue Scrollview Package for Vue
7
6
 
8
7
  > **Important**
9
- > * This package is а part of [Kendo UI for Vue](https://www.telerik.com/kendo-vue-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview)&mdash;a commercial UI library.
10
- > * You will need to install a license key when adding the package to your project. For more information, please refer to the [Kendo UI for Vue My License page](https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview).
11
- > * To receive a license key, you need to either [purchase a license](https://www.telerik.com/purchase/kendo-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview) or register for a [free trial](https://www.telerik.com/try/kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview). Doing so indicates that you [accept the Kendo UI for Vue License Agreement](https://www.telerik.com/purchase/license-agreement/progress-kendovue?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview).
12
- > * The 30-day free trial gives you access to all the Kendo UI for Vue components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the Kendo UI for Vue dev team!
13
8
  >
14
- > [Start using Kendo UI for Vue](https://www.telerik.com/try/kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview) and speed up your development process!
9
+ > - This package is а part of [Kendo UI for Vue](https://www.telerik.com/kendo-vue-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview)&mdash;a commercial UI library.
10
+ > - You will need to install a license key when adding the package to your project. For more information, please refer to the [Kendo UI for Vue My License page](https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview).
11
+ > - To receive a license key, you need to either [purchase a license](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview) or register for a [free trial](https://www.telerik.com/download-login-v2-kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview). Doing so indicates that you [accept the Kendo UI for Vue License Agreement](https://www.telerik.com/kendo-vue-ui-develop/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview).
12
+ > - The 30-day free trial gives you access to all the Kendo UI for Vue components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the Kendo UI for Vue dev team!
13
+ >
14
+ > [Start using Kendo UI for Vue](https://www.telerik.com/download-login-v2-kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview) and speed up your development process!
15
+
16
+ ## Vue Scrollview
15
17
 
16
18
  > Historically, all Kendo UI for Vue Native components support both **Vue 2** and **Vue 3**, however, Vue 2 is currently in its end-of-support phase till Nov 2024. After our last major release for 2024, Vue 2 will no longer be supported in the new versions of the Kendo UI for Vue components. Please check our [Vue 2 End of Support article](https://www.telerik.com/kendo-vue-ui/components/vue2-deprecation/) for more details.
17
19
 
20
+ Among the many features which the Kendo UI for Vue Scrollview deliver are:
21
+
22
+ - TODO 1
23
+ - TODO 2
24
+ - TODO 3
25
+
18
26
  ## Support Options
19
27
 
20
- For any issues you might encounter while working with the Kendo UI for Vue ScrollView, use any of the available support channels:
28
+ For any issues you might encounter while working with the Kendo UI for Vue Scrollview, use any of the available support channels:
21
29
 
22
- * Industry-leading technical support&mdash;Kendo UI for Vue paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use [the dedicated Kendo UI for Vue support system](https://www.telerik.com/account/support-tickets?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview).
23
- * Product forums&mdash;The [Kendo UI for Vue forums](https://www.telerik.com/forums/kendo-ui-vue?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview) are part of the free support you can get from the community and from the Kendo UI for Vue team.
24
- * Feedback portal&mdash;The [Kendo UI for Vue feedback portal](https://feedback.telerik.com/kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview) is where you can request and vote for new features to be added.
30
+ - Industry-leading technical support&mdash;Kendo UI for Vue paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use [the dedicated Kendo UI for Vue support system](https://www.telerik.com/account/support-tickets?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview).
31
+ - Product forums&mdash;The [Kendo UI for Vue forums](https://www.telerik.com/forums/kendo-ui-vue?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview) are part of the free support you can get from the community and from the Kendo UI for Vue team.
32
+ - Feedback portal&mdash;The [Kendo UI for Vue feedback portal](https://feedback.telerik.com/kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview) is where you can request and vote for new features to be added.
25
33
 
26
34
  ## Resources
27
35
 
28
- * [Getting Started with Kendo UI for Vue](https://www.telerik.com/kendo-vue-ui/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview)
29
- * [Get Started with the Kendo UI for Vue ScrollView](https://www.telerik.com/kendo-vue-ui/components/scrollview/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview)
30
- * [API Reference of the Kendo UI for Vue ScrollView](https://www.telerik.com/kendo-vue-ui/components/scrollview/api/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview)
31
- * [Kendo UI for Vue Roadmap](https://www.telerik.com/support/whats-new/kendo-vue-ui/roadmap?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview)
32
- * [Blogs](https://www.telerik.com/blogs/tag/vue?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview)
33
- * [Demos, documentation, and component reference](https://www.telerik.com/kendo-vue-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview)
34
- * [Kendo UI for Vue pricing and licensing](https://www.telerik.com/purchase/kendo-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview)
35
- * [Changelog](https://www.telerik.com/kendo-vue-ui/components/changelogs/ui-for-vue/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-scrollview)
36
+ - [Getting Started with Kendo UI for Vue](https://www.telerik.com/kendo-vue-ui/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview)
37
+ - [Getting Started with the Kendo UI for Vue Scrollview](https://www.telerik.com/kendo-vue-ui/components/scrollview/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview)
38
+ - [API Reference of the Kendo UI for Vue Scrollview](https://www.telerik.com/kendo-vue-ui/components/scrollview/api/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview)
39
+ - [Kendo UI for Vue Roadmap](https://www.telerik.com/kendo-vue-ui/roadmap/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview)
40
+ - [Blogs](https://www.telerik.com/blogs/tag/vue?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview)
41
+ - [Demos, documentation, and component reference](https://www.telerik.com/kendo-vue-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview)
42
+ - [Kendo UI for Vue pricing and licensing](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmscrollview)
36
43
 
37
- *Copyright © 2021 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.*
44
+ _Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved._
38
45
 
39
- *Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.*
46
+ _Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries._
package/ScrollView.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),i=require("@progress/kendo-vue-common"),v=require("./package-metadata.js"),l=require("@progress/kendo-svg-icons"),u=t.defineComponent({name:"KendoScrollView",props:{activeView:{type:Number,default:1},dataItems:{type:Array,default:function(){return[]}},arrows:{type:Boolean,default:!0},automaticViewChange:{type:Boolean,default:!0},automaticViewChangeInterval:{type:Number,default:5e3},content:[Object,String,Function],dir:String,endless:Boolean,pageable:{type:Boolean,default:!0},pagerOverlay:{type:String,default:"none"}},created(){i.validatePackage(v.packageMetadata),this.timeoutRef=null},mounted(){this.wrapElement=i.getRef(this,"wrapElement"),this.currentDir=this.$props.dir!==void 0?this.$props.dir:i.isRtl(this.$el)?"rtl":"ltr",this.runAutomaticChange()},updated(){const e=this.dataItems.length;this.wrapElement&&(this.wrapElement.style.setProperty("--kendo-scrollview-views",`${e}`),this.wrapElement.style.setProperty("--kendo-scrollview-current",`${this.active}`)),this.runAutomaticChange()},data(){return{active:this.activeView||1,currentDir:void 0}},computed:{scrollViewClasses(){return{"k-scrollview":!0,"k-scrollview-light":this.pagerOverlay==="light","k-scrollview-dark":this.pagerOverlay==="dark"}},displayLeftArrow(){let e;return this.isRtl?e=this.active<this.dataItems.length:e=this.active>1,(this.endless||e)&&this.dataItems.length>0},displayRightArrow(){let e;return this.isRtl?e=this.active>1:e=this.active<this.dataItems.length,(this.endless||e)&&this.dataItems.length>0},isRtl(){return this.currentDir==="rtl"}},render(){const{pageable:e,arrows:s,content:n}=this.$props,c=this.dataItems.length,o=this.dataItems.map(function(r,a){const h=i.templateRendering.call(this,r.content||n,i.getListeners.call(this)),d=i.getTemplate.call(this,{h:t.h,template:h,defaultRendering:null,additionalProps:{item:r,items:this.dataItems}});return t.createVNode("div",{class:"k-scrollview-view","aria-hidden":this.active!==a+1},[d])},this);return t.createVNode("div",{class:this.scrollViewClasses,tabindex:0,dir:this.currentDir,onKeydown:this.handleKeyDown},[t.createVNode("div",{class:"k-scrollview-wrap k-scrollview-animate",style:`--kendo-scrollview-views:${c}; --kendo-scrollview-current:${this.active};`,ref:i.setRef(this,"wrapElement")},[o]),t.createVNode("div",{class:"k-scrollview-elements"},[s&&[this.displayLeftArrow&&t.createVNode("span",{class:"k-scrollview-prev","aria-label":"previous",onClick:this.handlePrevClick},[t.createVNode(i.Icon,{name:this.isRtl?"chevron-right":"chevron-left",icon:this.isRtl?l.chevronRightIcon:l.chevronLeftIcon,size:"xxxlarge"},null)]),this.displayRightArrow&&t.createVNode("span",{class:"k-scrollview-next","aria-label":"next",onClick:this.handleNextClick},[t.createVNode(i.Icon,{name:this.isRtl?"chevron-left":"chevron-right",icon:this.isRtl?l.chevronLeftIcon:l.chevronRightIcon,size:"xxxlarge"},null)])],e&&t.createVNode("div",{class:"k-scrollview-nav-wrap"},[t.createVNode("ul",{class:"k-scrollview-nav"},[this.dataItems.map(function(r,a){return t.createVNode("li",{class:i.classNames("k-link",{"k-primary":this.active===a+1}),key:a+1,onClick:()=>this.setActive(a+1)},null)},this)])])])])},methods:{runAutomaticChange(){if(this.automaticViewChange){this.resetTimeout();const e=this,s=this.active;this.timeoutRef=setTimeout(function(){e.setActive(s===e.dataItems.length?e.endless?1:s:s+1)},this.automaticViewChangeInterval)}},resetTimeout(){this.timeoutRef&&clearTimeout(this.timeoutRef)},setActive(e){this.active=e},focusElement(){this.$el&&this.$el.focus()},prev(){this.endless?this.active>1?this.setActive(this.active-1):this.setActive(this.dataItems.length):this.active>1&&this.setActive(this.active-1)},next(){this.endless?this.active<this.dataItems.length?this.setActive(this.active+1):this.setActive(1):this.active<this.dataItems.length&&this.setActive(this.active+1)},handlePrevClick(){this.isRtl?this.next():this.prev()},handleNextClick(){this.isRtl?this.prev():this.next()},handleKeyDown(e){switch(e.keyCode){case i.Keys.left:e.preventDefault(),this.isRtl?this.next():this.prev();break;case i.Keys.right:e.preventDefault(),this.isRtl?this.prev():this.next();break}}}});exports.ScrollView=u;
package/ScrollView.mjs ADDED
@@ -0,0 +1,191 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { defineComponent as m, h as p, createVNode as e } from "vue";
9
+ import { validatePackage as f, getRef as w, isRtl as g, templateRendering as k, getListeners as y, getTemplate as R, setRef as I, Icon as l, classNames as C, Keys as r } from "@progress/kendo-vue-common";
10
+ import { packageMetadata as A } from "./package-metadata.mjs";
11
+ import { chevronRightIcon as n, chevronLeftIcon as h } from "@progress/kendo-svg-icons";
12
+ const D = /* @__PURE__ */ m({
13
+ name: "KendoScrollView",
14
+ props: {
15
+ activeView: {
16
+ type: Number,
17
+ default: 1
18
+ },
19
+ dataItems: {
20
+ type: Array,
21
+ default: function() {
22
+ return [];
23
+ }
24
+ },
25
+ arrows: {
26
+ type: Boolean,
27
+ default: !0
28
+ },
29
+ automaticViewChange: {
30
+ type: Boolean,
31
+ default: !0
32
+ },
33
+ automaticViewChangeInterval: {
34
+ type: Number,
35
+ default: 5e3
36
+ },
37
+ content: [Object, String, Function],
38
+ dir: String,
39
+ endless: Boolean,
40
+ pageable: {
41
+ type: Boolean,
42
+ default: !0
43
+ },
44
+ pagerOverlay: {
45
+ type: String,
46
+ default: "none"
47
+ }
48
+ },
49
+ created() {
50
+ f(A), this.timeoutRef = null;
51
+ },
52
+ mounted() {
53
+ this.wrapElement = w(this, "wrapElement"), this.currentDir = this.$props.dir !== void 0 ? this.$props.dir : g(this.$el) ? "rtl" : "ltr", this.runAutomaticChange();
54
+ },
55
+ updated() {
56
+ const t = this.dataItems.length;
57
+ this.wrapElement && (this.wrapElement.style.setProperty("--kendo-scrollview-views", `${t}`), this.wrapElement.style.setProperty("--kendo-scrollview-current", `${this.active}`)), this.runAutomaticChange();
58
+ },
59
+ data() {
60
+ return {
61
+ active: this.activeView || 1,
62
+ currentDir: void 0
63
+ };
64
+ },
65
+ computed: {
66
+ scrollViewClasses() {
67
+ return {
68
+ "k-scrollview": !0,
69
+ "k-scrollview-light": this.pagerOverlay === "light",
70
+ "k-scrollview-dark": this.pagerOverlay === "dark"
71
+ };
72
+ },
73
+ displayLeftArrow() {
74
+ let t;
75
+ return this.isRtl ? t = this.active < this.dataItems.length : t = this.active > 1, (this.endless || t) && this.dataItems.length > 0;
76
+ },
77
+ displayRightArrow() {
78
+ let t;
79
+ return this.isRtl ? t = this.active > 1 : t = this.active < this.dataItems.length, (this.endless || t) && this.dataItems.length > 0;
80
+ },
81
+ isRtl() {
82
+ return this.currentDir === "rtl";
83
+ }
84
+ },
85
+ render() {
86
+ const {
87
+ pageable: t,
88
+ arrows: i,
89
+ content: o
90
+ } = this.$props, c = this.dataItems.length, d = this.dataItems.map(function(a, s) {
91
+ const v = k.call(this, a.content || o, y.call(this)), u = R.call(this, {
92
+ h: p,
93
+ template: v,
94
+ defaultRendering: null,
95
+ additionalProps: {
96
+ item: a,
97
+ items: this.dataItems
98
+ }
99
+ });
100
+ return e("div", {
101
+ class: "k-scrollview-view",
102
+ "aria-hidden": this.active !== s + 1
103
+ }, [u]);
104
+ }, this);
105
+ return e("div", {
106
+ class: this.scrollViewClasses,
107
+ tabindex: 0,
108
+ dir: this.currentDir,
109
+ onKeydown: this.handleKeyDown
110
+ }, [e("div", {
111
+ class: "k-scrollview-wrap k-scrollview-animate",
112
+ style: `--kendo-scrollview-views:${c}; --kendo-scrollview-current:${this.active};`,
113
+ ref: I(this, "wrapElement")
114
+ }, [d]), e("div", {
115
+ class: "k-scrollview-elements"
116
+ }, [i && [this.displayLeftArrow && e("span", {
117
+ class: "k-scrollview-prev",
118
+ "aria-label": "previous",
119
+ onClick: this.handlePrevClick
120
+ }, [e(l, {
121
+ name: this.isRtl ? "chevron-right" : "chevron-left",
122
+ icon: this.isRtl ? n : h,
123
+ size: "xxxlarge"
124
+ }, null)]), this.displayRightArrow && e("span", {
125
+ class: "k-scrollview-next",
126
+ "aria-label": "next",
127
+ onClick: this.handleNextClick
128
+ }, [e(l, {
129
+ name: this.isRtl ? "chevron-left" : "chevron-right",
130
+ icon: this.isRtl ? h : n,
131
+ size: "xxxlarge"
132
+ }, null)])], t && e("div", {
133
+ class: "k-scrollview-nav-wrap"
134
+ }, [e("ul", {
135
+ class: "k-scrollview-nav"
136
+ }, [this.dataItems.map(function(a, s) {
137
+ return e("li", {
138
+ class: C("k-link", {
139
+ "k-primary": this.active === s + 1
140
+ }),
141
+ key: s + 1,
142
+ onClick: () => this.setActive(s + 1)
143
+ }, null);
144
+ }, this)])])])]);
145
+ },
146
+ methods: {
147
+ runAutomaticChange() {
148
+ if (this.automaticViewChange) {
149
+ this.resetTimeout();
150
+ const t = this, i = this.active;
151
+ this.timeoutRef = setTimeout(function() {
152
+ t.setActive(i === t.dataItems.length ? t.endless ? 1 : i : i + 1);
153
+ }, this.automaticViewChangeInterval);
154
+ }
155
+ },
156
+ resetTimeout() {
157
+ this.timeoutRef && clearTimeout(this.timeoutRef);
158
+ },
159
+ setActive(t) {
160
+ this.active = t;
161
+ },
162
+ focusElement() {
163
+ this.$el && this.$el.focus();
164
+ },
165
+ prev() {
166
+ this.endless ? this.active > 1 ? this.setActive(this.active - 1) : this.setActive(this.dataItems.length) : this.active > 1 && this.setActive(this.active - 1);
167
+ },
168
+ next() {
169
+ this.endless ? this.active < this.dataItems.length ? this.setActive(this.active + 1) : this.setActive(1) : this.active < this.dataItems.length && this.setActive(this.active + 1);
170
+ },
171
+ handlePrevClick() {
172
+ this.isRtl ? this.next() : this.prev();
173
+ },
174
+ handleNextClick() {
175
+ this.isRtl ? this.prev() : this.next();
176
+ },
177
+ handleKeyDown(t) {
178
+ switch (t.keyCode) {
179
+ case r.left:
180
+ t.preventDefault(), this.isRtl ? this.next() : this.prev();
181
+ break;
182
+ case r.right:
183
+ t.preventDefault(), this.isRtl ? this.prev() : this.next();
184
+ break;
185
+ }
186
+ }
187
+ }
188
+ });
189
+ export {
190
+ D as ScrollView
191
+ };