UNPKG

@progress/kendo-vue-buttons

Version:
77 lines (76 loc) 2.57 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { defineComponent as B, createVNode as t, Fragment as r } from "vue"; import { ToolbarSeparator as i } from "./ToolbarSeparator.mjs"; import { ToolbarScrollButton as f } from "./ToolbarScrollButton.mjs"; const h = /* @__PURE__ */ B({ 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(n) { this.$emit("contentscroll", n); } }, render() { const { scrollButtons: n, buttonScrollSpeed: u, prevButton: p, nextButton: b, scrollButtonsPosition: e, dir: o, isScrollStartPosition: a, isScrollEndPosition: c, toolbarItems: S } = this.$props, l = (d, m) => t(f, { type: d, dir: o, disabled: m, scrollContentRef: this.scrollContentRef, buttonScrollSpeed: u, prevButton: p, nextButton: b, onContentscroll: this.onContentScroll }, null), s = n === "visible" || n === "auto" && this.$props.isOverflowing; return t(r, null, [s && e === "split" && t(r, null, [l(o !== "rtl" ? "prev" : "next", a), t(i, { class: "k-toolbar-button-separator" }, null)]), s && e === "start" && t(r, null, [l(o !== "rtl" ? "prev" : "next", a), l(o !== "rtl" ? "next" : "prev", c), t(i, { class: "k-toolbar-button-separator" }, null)]), t("span", { class: "k-toolbar-items k-toolbar-items-scroll", ref: "scrollContentRef" }, [S]), s && e === "split" && t(r, null, [t(i, { class: "k-toolbar-button-separator" }, null), l(o !== "rtl" ? "next" : "prev", c)]), s && e === "end" && t(r, null, [t(i, { class: "k-toolbar-button-separator" }, null), l(o !== "rtl" ? "prev" : "next", a), l(o !== "rtl" ? "next" : "prev", c)])]); } }); export { h as ToolbarScrollable };