@progress/kendo-vue-buttons 6.1.0-develop.9 → 6.1.1-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.
@@ -5,18 +5,26 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as n, createVNode as a } from "vue";
9
- import { validatePackage as u, kendoThemeMaps as l, getDefaultSlots as f, Keys as r } from "@progress/kendo-vue-common";
10
- import { toolbarButtons as d, internalButtons as h } from "../util.mjs";
11
- import { packageMetadata as c } from "../package-metadata.mjs";
12
- const y = /* @__PURE__ */ n({
8
+ import { defineComponent as d, cloneVNode as u, createVNode as a, Fragment as b } from "vue";
9
+ import { validatePackage as p, kendoThemeMaps as S, canUseDOM as c, getDefaultSlots as v, Keys as h } from "@progress/kendo-vue-common";
10
+ import { toolbarButtons as w, internalButtons as g } from "../util.mjs";
11
+ import { packageMetadata as m } from "../package-metadata.mjs";
12
+ import { ToolbarScrollable as y } from "./tools/ToolbarScrollable.mjs";
13
+ import { ToolbarOverflowSection as T } from "./tools/ToolbarOverflowSection.mjs";
14
+ const I = /* @__PURE__ */ d({
13
15
  name: "KendoToolbar",
14
16
  props: {
15
17
  tabIndex: {
16
18
  type: Number,
17
19
  default: 0
18
20
  },
19
- dir: String,
21
+ dir: {
22
+ type: String,
23
+ validator: function(t) {
24
+ return [null, "ltr", "rtl"].includes(t);
25
+ },
26
+ default: "ltr"
27
+ },
20
28
  keyboardNavigation: {
21
29
  type: Boolean,
22
30
  default: !0
@@ -40,54 +48,142 @@ const y = /* @__PURE__ */ n({
40
48
  return [null, "solid", "flat", "outline"].includes(t);
41
49
  }
42
50
  },
43
- ariaLabel: String
51
+ ariaLabel: String,
52
+ overflow: {
53
+ type: String,
54
+ default: "section",
55
+ validator: function(t) {
56
+ return [null, "none", "section", "scroll"].includes(t);
57
+ }
58
+ },
59
+ scrollButtons: {
60
+ type: String,
61
+ default: "auto",
62
+ validator: function(t) {
63
+ return [null, "hidden", "visible", "auto"].includes(t);
64
+ }
65
+ },
66
+ scrollButtonsPosition: {
67
+ type: String,
68
+ default: "split",
69
+ validator: function(t) {
70
+ return [null, "start", "end", "split"].includes(t);
71
+ }
72
+ },
73
+ buttonScrollSpeed: {
74
+ type: Number,
75
+ default: 100
76
+ }
77
+ },
78
+ data() {
79
+ return {
80
+ defaultSlot: null,
81
+ offsetWidth: 0,
82
+ offsetHeight: 0,
83
+ currentButtons: [],
84
+ focusedSelector: "",
85
+ isScrollStartPosition: !0,
86
+ isScrollEndPosition: !1,
87
+ focusableButtons: [],
88
+ isOverflowing: !1,
89
+ scrollContentRef: null,
90
+ lastToolbarWidthRef: 0,
91
+ overFlowToolsRef: [],
92
+ overFlowOpened: !1,
93
+ visibleToolsRef: void 0
94
+ };
44
95
  },
45
96
  created() {
46
- this.offsetHeight = 0, this.offsetWidth = 0, this.currentButtons = [], this.focusedSelector = this.selectors.map((t) => t + ":focus").join(","), u(c);
97
+ this.focusedSelector = this.selectors.map((t) => t + ":focus").join(","), p(m);
47
98
  },
48
99
  computed: {
49
100
  selectors() {
50
- return this.$props.buttons || d;
101
+ return this.$props.buttons || w;
51
102
  },
52
103
  wrapperClass() {
53
104
  const {
54
105
  size: t,
55
- fillMode: e
106
+ fillMode: e,
107
+ overflow: o,
108
+ scrollButtons: s
56
109
  } = this.$props;
57
110
  return {
58
111
  "k-toolbar": !0,
59
112
  [`k-toolbar-${e}`]: e,
60
- [`k-toolbar-${l.sizeMap[t] || t}`]: t
113
+ [`k-toolbar-${S.sizeMap[t] || t}`]: t,
114
+ "k-toolbar-scrollable": o === "scroll",
115
+ "k-toolbar-scrollable-overlay": o === "scroll" && (s === "hidden" || s === void 0),
116
+ "k-toolbar-scrollable-start": o === "scroll" && s === "hidden" && this.isScrollStartPosition,
117
+ "k-toolbar-scrollable-end": o === "scroll" && s === "hidden" && this.isScrollEndPosition,
118
+ "k-toolbar-section": o && o === "section"
61
119
  };
62
120
  }
63
121
  },
64
122
  mounted() {
65
- window.addEventListener("resize", this.onWindowResize);
123
+ c && window.ResizeObserver && (this.observerResize = new window.ResizeObserver(this.onWindowResize), this.observerResize.observe(this.$el));
66
124
  const t = this.$el;
67
- t && (this.offsetWidth = t.offsetWidth, this.offsetHeight = t.offsetHeight, this.$props.keyboardNavigation !== !1 && (this.currentButtons = this.getCurrentButtons(), this.setTabIndex(0)));
125
+ t && (this.offsetWidth = t.offsetWidth, this.offsetHeight = t.offsetHeight, this.$props.keyboardNavigation !== !1 && (this.currentButtons = this.getCurrentButtons(), this.setTabIndex(0))), this.scrollContentRef = this.$refs.toolbarScrollable && this.$refs.toolbarScrollable.scrollContentRef, this.defaultSlot && (this.visibleToolsRef = this.defaultSlot.filter((e) => e && e.type).map((e, o) => u(e, {
126
+ key: e.key || o
127
+ })), this.$nextTick(() => {
128
+ this.checkOverflow(), this.initOverflow(this.$refs.toolbar);
129
+ }));
68
130
  },
69
131
  updated() {
70
132
  !this.$el || this.$props.keyboardNavigation === !1 || (this.currentButtons = this.getCurrentButtons(), this.setTabIndex(this.focusedIndex()));
71
133
  },
72
134
  unmounted() {
73
- window.removeEventListener("resize", this.onWindowResize), this.currentButtons.length = 0;
135
+ c && this.observerResize && this.observerResize.disconnect(), this.currentButtons.length = 0;
74
136
  },
75
137
  render() {
76
- const t = f(this);
77
- return a("div", {
138
+ const {
139
+ overflow: t,
140
+ scrollButtons: e,
141
+ scrollButtonsPosition: o,
142
+ prevButton: s,
143
+ nextButton: l,
144
+ buttonScrollSpeed: n,
145
+ dir: f,
146
+ fillMode: i,
147
+ size: r
148
+ } = this.$props;
149
+ return this.defaultSlot = v(this), a("div", {
150
+ ref: "toolbar",
78
151
  class: this.wrapperClass,
79
152
  role: "toolbar",
80
- dir: this.$props.dir,
153
+ dir: f,
81
154
  "aria-label": this.$props.ariaLabel,
82
155
  onKeydown: this.onKeyDown
83
- }, [t]);
156
+ }, [t === "scroll" && a(b, null, [a(y, {
157
+ ref: "toolbarScrollable",
158
+ scrollButtons: e,
159
+ scrollButtonsPosition: o,
160
+ prevButton: s,
161
+ nextButton: l,
162
+ isOverflowing: this.isOverflowing,
163
+ buttonScrollSpeed: n,
164
+ dir: f,
165
+ isScrollStartPosition: this.isScrollStartPosition,
166
+ isScrollEndPosition: this.isScrollEndPosition,
167
+ toolbarItems: this.defaultSlot,
168
+ onContentscroll: this.onContentScroll
169
+ }, null)]), t === "section" && a(T, {
170
+ opened: this.overFlowOpened,
171
+ toolbarRef: this.$refs.toolbar,
172
+ toolbarWidth: this.offsetWidth,
173
+ fillMode: i,
174
+ size: r,
175
+ visibleTools: this.visibleToolsRef,
176
+ overFlowTools: this.overFlowToolsRef,
177
+ onToggleoverflow: this.onToggleoverflow,
178
+ allTools: this.defaultSlot
179
+ }, null), t === "none" && this.defaultSlot]);
84
180
  },
85
181
  methods: {
86
182
  getCurrentButtons() {
87
183
  return this.$el && this.$el.querySelectorAll ? Array.from(this.$el.querySelectorAll(this.selectors.join(","))) : [];
88
184
  },
89
185
  getInternalButtons() {
90
- return this.$el && this.$el.querySelectorAll ? Array.from(this.$el.querySelectorAll(h)) : [];
186
+ return this.$el && this.$el.querySelectorAll ? Array.from(this.$el.querySelectorAll(g)) : [];
91
187
  },
92
188
  focusedIndex() {
93
189
  const t = this.$el && this.$el.querySelector && this.$el.querySelector(this.focusedSelector);
@@ -107,10 +203,10 @@ const y = /* @__PURE__ */ n({
107
203
  if (this.$props.keyboardNavigation === !1)
108
204
  return;
109
205
  const e = t.target;
110
- if (!(t.keyCode === r.left || t.keyCode === r.right) || t.defaultPrevented || this.currentButtons.findIndex((i) => i === e) === -1)
206
+ if (!(t.keyCode === h.left || t.keyCode === h.right) || t.defaultPrevented || this.currentButtons.findIndex((l) => l === e) === -1)
111
207
  return;
112
208
  const s = this.focusedIndex();
113
- t.keyCode === r.left ? this.focusButton(s, s - 1) : this.focusButton(s, s + 1);
209
+ t.keyCode === h.left ? this.focusButton(s, s - 1) : this.focusButton(s, s + 1);
114
210
  },
115
211
  focusButton(t, e) {
116
212
  const {
@@ -118,30 +214,71 @@ const y = /* @__PURE__ */ n({
118
214
  } = this.$props, s = this.currentButtons[e];
119
215
  if (s) {
120
216
  s.tabIndex = o, s.focus();
121
- const i = this.currentButtons[t];
122
- i && (i.tabIndex = -1);
217
+ const l = this.currentButtons[t];
218
+ l && (l.tabIndex = -1);
123
219
  }
124
220
  },
125
- onWindowResize(t) {
126
- const e = this.$el;
127
- if (!e)
128
- return;
129
- const o = e.offsetWidth, s = e.offsetHeight;
130
- if (this.offsetWidth !== o || this.offsetHeight !== s) {
131
- this.offsetWidth = o, this.offsetHeight = s;
132
- const i = {
133
- offsetWidth: this.offsetWidth,
134
- offsetHeight: this.offsetHeight
135
- };
136
- this.$emit("resize", {
137
- target: this,
138
- ...i,
139
- nativeEvent: t
140
- });
221
+ initOverflow(t, e) {
222
+ let o = 200;
223
+ const s = [], l = [];
224
+ Array.from(t.children).forEach((n, f) => {
225
+ o += Math.ceil(n.clientWidth), o <= this.$refs.toolbar.offsetWidth - 50 ? s.push(this.visibleToolsRef[f]) : l.push(this.visibleToolsRef[f]);
226
+ }), this.visibleToolsRef = s, this.overFlowToolsRef = l;
227
+ },
228
+ checkOverflow() {
229
+ if (this.$props.overflow === "scroll") {
230
+ const t = this.scrollContentRef;
231
+ t && (this.isOverflowing = t.scrollWidth > t.clientWidth || t.scrollHeight > t.clientHeight, this.isOverflowing ? this.onContentScroll() : (this.isScrollStartPosition = !0, this.isScrollEndPosition = !0));
232
+ } else if (this.$props.overflow === "section" || this.$props.overflow === void 0) {
233
+ const t = this.$refs.toolbar;
234
+ let e = 0;
235
+ if (t) {
236
+ const o = t.offsetWidth, s = parseInt(window.getComputedStyle(t).gap || "0", 10), l = Array.from(t.children).reduce((i, r) => (i += Math.ceil(r.clientWidth), i), 0), n = Array.from(t.children).length, f = s * 2;
237
+ if (e = 36 + Number(l) + n * s + f, e > o) {
238
+ const i = [...this.visibleToolsRef], r = i.pop();
239
+ this.visibleToolsRef = i, r && (this.overFlowToolsRef = [r, ...this.overFlowToolsRef]), this.lastToolbarWidthRef = o;
240
+ } else if (o > this.lastToolbarWidthRef + s * n / 2.75) {
241
+ const i = [...this.overFlowToolsRef], r = i.shift();
242
+ r && this.lastToolbarWidthRef + s * n > 30 && (this.overFlowToolsRef = i, this.visibleToolsRef = [...this.visibleToolsRef, r]), this.lastToolbarWidthRef = o;
243
+ } else
244
+ this.$forceUpdate();
245
+ }
141
246
  }
247
+ },
248
+ onWindowResize(t) {
249
+ window.requestAnimationFrame(() => {
250
+ const e = this.$el;
251
+ if (this.overFlowOpened = !1, !e)
252
+ return;
253
+ const o = e.offsetWidth, s = e.offsetHeight;
254
+ if (this.offsetWidth !== o || this.offsetHeight !== s) {
255
+ this.offsetWidth = o, this.offsetHeight = s;
256
+ const l = {
257
+ offsetWidth: this.offsetWidth,
258
+ offsetHeight: this.offsetHeight
259
+ };
260
+ this.$emit("resize", {
261
+ target: this,
262
+ ...l,
263
+ nativeEvent: t
264
+ });
265
+ }
266
+ this.checkOverflow();
267
+ });
268
+ },
269
+ onContentScroll(t) {
270
+ const e = this.scrollContentRef;
271
+ if (t && e) {
272
+ let o, s;
273
+ t === "next" ? o = !1 : e.scrollLeft <= this.$props.buttonScrollSpeed ? o = !0 : o = e.scrollLeft === 0, t === "prev" ? s = !1 : e.scrollLeft + e.clientWidth + this.$props.buttonScrollSpeed >= e.scrollWidth ? s = !0 : s = e.scrollLeft + e.clientWidth === e.scrollWidth, this.isScrollStartPosition = !!o, this.isScrollEndPosition = !!s;
274
+ } else
275
+ this.isScrollStartPosition = !0, this.isScrollEndPosition = !1;
276
+ },
277
+ onToggleoverflow(t) {
278
+ this.overFlowOpened = t;
142
279
  }
143
280
  }
144
281
  });
145
282
  export {
146
- y as Toolbar
283
+ I as Toolbar
147
284
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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="prevArrow.title",e="nextArrow.title",o="moreButtonTitle.title",r={[t]:"Previous scroll button",[e]:"Next scroll button",[o]:"More button"};exports.messages=r;exports.moreButtonTitle=o;exports.nextArrowTitle=e;exports.prevArrowTitle=t;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ const t = "prevArrow.title", o = "nextArrow.title", e = "moreButtonTitle.title", r = {
9
+ [t]: "Previous scroll button",
10
+ [o]: "Next scroll button",
11
+ [e]: "More button"
12
+ };
13
+ export {
14
+ r as messages,
15
+ e as moreButtonTitle,
16
+ o as nextArrowTitle,
17
+ t as prevArrowTitle
18
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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 o=require("vue"),c=require("@progress/kendo-vue-popup"),u=require("./ToolbarSeparator.js"),p=require("../../Button.js"),d=require("@progress/kendo-svg-icons"),b=require("@progress/kendo-vue-intl"),l=require("../messages/index.js"),g=require("@progress/kendo-vue-common"),h=o.defineComponent({name:"ToolbarOverflowSection",props:{toolbarRef:Object,toolbarWidth:Number,fillMode:String,size:String,visibleTools:Array,overFlowTools:Array,opened:Boolean,allTools:Array},emits:["toggleoverflow"],inject:{kendoLocalizationService:{default:null}},methods:{handleClick(){this.$emit("toggleoverflow",!this.$props.opened)}},render(){const{visibleTools:e,overFlowTools:n,allTools:t}=this.$props,{toolbarRef:i,toolbarWidth:r,fillMode:s,size:a}=this.$props;return o.createVNode(o.Fragment,null,[e&&[...t].splice(0,e.length),n.length>0&&o.createVNode(o.Fragment,null,[o.createVNode(u.ToolbarSeparator,{class:"k-toolbar-button-separator"},null),o.createVNode(p.Button,{ref:"buttonRef",class:"k-toolbar-overflow-button",fillMode:"flat",svgIcon:d.moreHorizontalIcon,title:b.provideLocalizationService(this).toLanguageString(l.moreButtonTitle,l.messages[l.moreButtonTitle]),onClick:this.handleClick},null),o.createVNode(c.Popup,{anchor:i,show:this.$props.opened,popupClass:"k-toolbar-popup",key:r,style:{width:r+"px"}},{default:()=>[o.createVNode("span",{class:`k-toolbar-items-list k-toolbar-items-list-${g.kendoThemeMaps.sizeMap[a]} k-toolbar-items-list-${s}`},[e&&[...t].splice(e.length,t.length)])]})])])}});exports.ToolbarOverflowSection=h;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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, createVNode as o, Fragment as r } from "vue";
9
+ import { Popup as f } from "@progress/kendo-vue-popup";
10
+ import { ToolbarSeparator as c } from "./ToolbarSeparator.mjs";
11
+ import { Button as b } from "../../Button.mjs";
12
+ import { moreHorizontalIcon as d } from "@progress/kendo-svg-icons";
13
+ import { provideLocalizationService as h } from "@progress/kendo-vue-intl";
14
+ import { moreButtonTitle as i, messages as u } from "../messages/index.mjs";
15
+ import { kendoThemeMaps as g } from "@progress/kendo-vue-common";
16
+ const C = /* @__PURE__ */ m({
17
+ name: "ToolbarOverflowSection",
18
+ props: {
19
+ toolbarRef: Object,
20
+ toolbarWidth: Number,
21
+ fillMode: String,
22
+ size: String,
23
+ visibleTools: Array,
24
+ overFlowTools: Array,
25
+ opened: Boolean,
26
+ allTools: Array
27
+ },
28
+ emits: ["toggleoverflow"],
29
+ inject: {
30
+ kendoLocalizationService: {
31
+ default: null
32
+ }
33
+ },
34
+ methods: {
35
+ handleClick() {
36
+ this.$emit("toggleoverflow", !this.$props.opened);
37
+ }
38
+ },
39
+ render() {
40
+ const {
41
+ visibleTools: e,
42
+ overFlowTools: s,
43
+ allTools: t
44
+ } = this.$props, {
45
+ toolbarRef: a,
46
+ toolbarWidth: l,
47
+ fillMode: n,
48
+ size: p
49
+ } = this.$props;
50
+ return o(r, null, [e && [...t].splice(0, e.length), s.length > 0 && o(r, null, [o(c, {
51
+ class: "k-toolbar-button-separator"
52
+ }, null), o(b, {
53
+ ref: "buttonRef",
54
+ class: "k-toolbar-overflow-button",
55
+ fillMode: "flat",
56
+ svgIcon: d,
57
+ title: h(this).toLanguageString(i, u[i]),
58
+ onClick: this.handleClick
59
+ }, null), o(f, {
60
+ anchor: a,
61
+ show: this.$props.opened,
62
+ popupClass: "k-toolbar-popup",
63
+ key: l,
64
+ style: {
65
+ width: l + "px"
66
+ }
67
+ }, {
68
+ default: () => [o("span", {
69
+ class: `k-toolbar-items-list k-toolbar-items-list-${g.sizeMap[p]} k-toolbar-items-list-${n}`
70
+ }, [e && [...t].splice(e.length, t.length)])]
71
+ })])]);
72
+ }
73
+ });
74
+ export {
75
+ C as ToolbarOverflowSection
76
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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 i=require("vue"),s=require("@progress/kendo-vue-common"),e=require("../messages/index.js"),c=require("@progress/kendo-svg-icons"),r=require("@progress/kendo-vue-intl"),u=i.defineComponent({name:"KendoToolbarScrollButton",props:{buttonScrollSpeed:Number,disabled:Boolean,scrollContentRef:Object,type:String,prevButton:Object,nextButton:Object,dir:String},inject:{kendoLocalizationService:{default:null}},emits:["contentscroll"],methods:{getScrollButtonTitle(){const{dir:o,type:t}=this.$props;return o!=="rtl"?t==="prev"?r.provideLocalizationService(this).toLanguageString(e.prevArrowTitle,e.messages[e.prevArrowTitle]):r.provideLocalizationService(this).toLanguageString(e.nextArrowTitle,e.messages[e.nextArrowTitle]):t==="prev"?r.provideLocalizationService(this).toLanguageString(e.nextArrowTitle,e.messages[e.nextArrowTitle]):r.provideLocalizationService(this).toLanguageString(e.prevArrowTitle,e.messages[e.prevArrowTitle])}},render(){const{disabled:o,type:t,scrollContentRef:l,buttonScrollSpeed:n,prevButton:d,nextButton:p}=this.$props,a=()=>{l&&n&&(l.scrollBy({left:t==="next"?n:-n,behavior:"smooth"}),this.$emit("contentscroll",t))};return i.createVNode("span",{class:s.classNames("k-button","k-button-md","k-button-solid","k-button-solid-base","k-rounded-md","k-icon-button",`k-toolbar-${t}`,{"k-disabled":o}),title:this.getScrollButtonTitle(),"aria-hidden":!0,tabindex:o?-1:void 0,onClick:a},[i.createVNode(s.SvgIcon,{icon:t==="prev"?c.caretAltLeftIcon:c.caretAltRightIcon,class:"k-button-icon"},null)])}});exports.ToolbarScrollButton=u;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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 d, createVNode as c } from "vue";
9
+ import { classNames as u, SvgIcon as p } from "@progress/kendo-vue-common";
10
+ import { prevArrowTitle as e, messages as n, nextArrowTitle as r } from "../messages/index.mjs";
11
+ import { caretAltLeftIcon as b, caretAltRightIcon as m } from "@progress/kendo-svg-icons";
12
+ import { provideLocalizationService as l } from "@progress/kendo-vue-intl";
13
+ const L = /* @__PURE__ */ d({
14
+ name: "KendoToolbarScrollButton",
15
+ props: {
16
+ buttonScrollSpeed: Number,
17
+ disabled: Boolean,
18
+ scrollContentRef: Object,
19
+ type: String,
20
+ prevButton: Object,
21
+ nextButton: Object,
22
+ dir: String
23
+ },
24
+ inject: {
25
+ kendoLocalizationService: {
26
+ default: null
27
+ }
28
+ },
29
+ emits: ["contentscroll"],
30
+ methods: {
31
+ getScrollButtonTitle() {
32
+ const {
33
+ dir: o,
34
+ type: t
35
+ } = this.$props;
36
+ return o !== "rtl" ? t === "prev" ? l(this).toLanguageString(e, n[e]) : l(this).toLanguageString(r, n[r]) : t === "prev" ? l(this).toLanguageString(r, n[r]) : l(this).toLanguageString(e, n[e]);
37
+ }
38
+ },
39
+ render() {
40
+ const {
41
+ disabled: o,
42
+ type: t,
43
+ scrollContentRef: s,
44
+ buttonScrollSpeed: i,
45
+ prevButton: g,
46
+ nextButton: S
47
+ } = this.$props, a = () => {
48
+ s && i && (s.scrollBy({
49
+ left: t === "next" ? i : -i,
50
+ behavior: "smooth"
51
+ }), this.$emit("contentscroll", t));
52
+ };
53
+ return (
54
+ // Using span instead of real Button component is intentional.
55
+ // Ref: https://progresssoftware.atlassian.net/wiki/spaces/DE/pages/edit-v2/544997922#Hidden-interactive-elements
56
+ c("span", {
57
+ class: u("k-button", "k-button-md", "k-button-solid", "k-button-solid-base", "k-rounded-md", "k-icon-button", `k-toolbar-${t}`, {
58
+ "k-disabled": o
59
+ }),
60
+ title: this.getScrollButtonTitle(),
61
+ "aria-hidden": !0,
62
+ tabindex: o ? -1 : void 0,
63
+ onClick: a
64
+ }, [c(p, {
65
+ icon: t === "prev" ? b : m,
66
+ class: "k-button-icon"
67
+ }, null)])
68
+ );
69
+ }
70
+ });
71
+ export {
72
+ L as ToolbarScrollButton
73
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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"),s=require("./ToolbarSeparator.js"),m=require("./ToolbarScrollButton.js"),B=t.defineComponent({name:"ToolbarScrollable",props:{scrollButtons:String,scrollButtonsPosition:String,isOverflowing:Boolean,buttonScrollSpeed:Number,dir:String,isScrollStartPosition:Boolean,isScrollEndPosition:Boolean,prevButton:Object,nextButton:Object,toolbarItems:Object},emits:["contentscroll"],data(){return{scrollContentRef:null}},mounted(){this.scrollContentRef=this.$refs.scrollContentRef},methods:{onContentScroll(r){this.$emit("contentscroll",r)}},render(){const{scrollButtons:r,buttonScrollSpeed:i,prevButton:u,nextButton:b,scrollButtonsPosition:l,dir:o,isScrollStartPosition:a,isScrollEndPosition:c,toolbarItems:p}=this.$props,e=(S,d)=>t.createVNode(m.ToolbarScrollButton,{type:S,dir:o,disabled:d,scrollContentRef:this.scrollContentRef,buttonScrollSpeed:i,prevButton:u,nextButton:b,onContentscroll:this.onContentScroll},null),n=r==="visible"||r==="auto"&&this.$props.isOverflowing;return t.createVNode(t.Fragment,null,[n&&l==="split"&&t.createVNode(t.Fragment,null,[e(o!=="rtl"?"prev":"next",a),t.createVNode(s.ToolbarSeparator,{class:"k-toolbar-button-separator"},null)]),n&&l==="start"&&t.createVNode(t.Fragment,null,[e(o!=="rtl"?"prev":"next",a),e(o!=="rtl"?"next":"prev",c),t.createVNode(s.ToolbarSeparator,{class:"k-toolbar-button-separator"},null)]),t.createVNode("span",{class:"k-toolbar-items k-toolbar-items-scroll",ref:"scrollContentRef"},[p]),n&&l==="split"&&t.createVNode(t.Fragment,null,[t.createVNode(s.ToolbarSeparator,{class:"k-toolbar-button-separator"},null),e(o!=="rtl"?"next":"prev",c)]),n&&l==="end"&&t.createVNode(t.Fragment,null,[t.createVNode(s.ToolbarSeparator,{class:"k-toolbar-button-separator"},null),e(o!=="rtl"?"prev":"next",a),e(o!=="rtl"?"next":"prev",c)])])}});exports.ToolbarScrollable=B;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 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 B, createVNode as t, Fragment as r } from "vue";
9
+ import { ToolbarSeparator as i } from "./ToolbarSeparator.mjs";
10
+ import { ToolbarScrollButton as f } from "./ToolbarScrollButton.mjs";
11
+ const h = /* @__PURE__ */ B({
12
+ name: "ToolbarScrollable",
13
+ props: {
14
+ scrollButtons: String,
15
+ scrollButtonsPosition: String,
16
+ isOverflowing: Boolean,
17
+ buttonScrollSpeed: Number,
18
+ dir: String,
19
+ isScrollStartPosition: Boolean,
20
+ isScrollEndPosition: Boolean,
21
+ prevButton: Object,
22
+ nextButton: Object,
23
+ toolbarItems: Object
24
+ },
25
+ emits: ["contentscroll"],
26
+ data() {
27
+ return {
28
+ scrollContentRef: null
29
+ };
30
+ },
31
+ mounted() {
32
+ this.scrollContentRef = this.$refs.scrollContentRef;
33
+ },
34
+ methods: {
35
+ onContentScroll(n) {
36
+ this.$emit("contentscroll", n);
37
+ }
38
+ },
39
+ render() {
40
+ const {
41
+ scrollButtons: n,
42
+ buttonScrollSpeed: u,
43
+ prevButton: p,
44
+ nextButton: b,
45
+ scrollButtonsPosition: e,
46
+ dir: o,
47
+ isScrollStartPosition: a,
48
+ isScrollEndPosition: c,
49
+ toolbarItems: S
50
+ } = this.$props, l = (d, m) => t(f, {
51
+ type: d,
52
+ dir: o,
53
+ disabled: m,
54
+ scrollContentRef: this.scrollContentRef,
55
+ buttonScrollSpeed: u,
56
+ prevButton: p,
57
+ nextButton: b,
58
+ onContentscroll: this.onContentScroll
59
+ }, null), s = n === "visible" || n === "auto" && this.$props.isOverflowing;
60
+ return t(r, null, [s && e === "split" && t(r, null, [l(o !== "rtl" ? "prev" : "next", a), t(i, {
61
+ class: "k-toolbar-button-separator"
62
+ }, null)]), s && e === "start" && t(r, null, [l(o !== "rtl" ? "prev" : "next", a), l(o !== "rtl" ? "next" : "prev", c), t(i, {
63
+ class: "k-toolbar-button-separator"
64
+ }, null)]), t("span", {
65
+ class: "k-toolbar-items k-toolbar-items-scroll",
66
+ ref: "scrollContentRef"
67
+ }, [S]), s && e === "split" && t(r, null, [t(i, {
68
+ class: "k-toolbar-button-separator"
69
+ }, null), l(o !== "rtl" ? "next" : "prev", c)]), s && e === "end" && t(r, null, [t(i, {
70
+ class: "k-toolbar-button-separator"
71
+ }, null), l(o !== "rtl" ? "prev" : "next", a), l(o !== "rtl" ? "next" : "prev", c)])]);
72
+ }
73
+ });
74
+ export {
75
+ h as ToolbarScrollable
76
+ };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=e.defineComponent({name:"KendoToolbarItem",render(){return e.createVNode("div",{class:"k-separator"},null)}});exports.ToolbarSeparator=r;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=e.defineComponent({name:"KendoToolbarItem",render(){return e.createVNode("div",{class:"k-toolbar-separator k-separator"},null)}});exports.ToolbarSeparator=r;
@@ -5,12 +5,12 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as e, createVNode as o } from "vue";
9
- const a = /* @__PURE__ */ e({
8
+ import { defineComponent as o, createVNode as r } from "vue";
9
+ const a = /* @__PURE__ */ o({
10
10
  name: "KendoToolbarItem",
11
11
  render() {
12
- return o("div", {
13
- class: "k-separator"
12
+ return r("div", {
13
+ class: "k-toolbar-separator k-separator"
14
14
  }, null);
15
15
  }
16
16
  });