UNPKG

@progress/kendo-vue-buttons

Version:
74 lines (73 loc) 2.36 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { defineComponent as p, createVNode as s } from "vue"; import { classNames as u, SvgIcon as d } from "@progress/kendo-vue-common"; import { prevArrowTitle as o, messages as n, nextArrowTitle as r } from "../messages/index.mjs"; import { chevronLeftIcon as g, chevronRightIcon as m } from "@progress/kendo-svg-icons"; import { provideLocalizationService as i } from "@progress/kendo-vue-intl"; const k = /* @__PURE__ */ p({ name: "KendoToolbarScrollButton", props: { buttonScrollSpeed: Number, disabled: Boolean, scrollContentRef: Object, type: String, prevButton: Object, nextButton: Object, dir: String }, inject: { kendoLocalizationService: { default: null } }, emits: { contentscroll: (e) => !0 }, methods: { getScrollButtonTitle() { const { dir: e, type: t } = this.$props; return e !== "rtl" ? t === "prev" ? i(this).toLanguageString(o, n[o]) : i(this).toLanguageString(r, n[r]) : t === "prev" ? i(this).toLanguageString(r, n[r]) : i(this).toLanguageString(o, n[o]); } }, render() { const { disabled: e, type: t, scrollContentRef: c, buttonScrollSpeed: l, prevButton: S, nextButton: b } = this.$props, a = () => { c && l && (c.scrollBy({ left: t === "next" ? l : -l, behavior: "smooth" }), this.$emit("contentscroll", t)); }; return ( // Using span instead of real Button component is intentional. // Ref: https://progresssoftware.atlassian.net/wiki/spaces/DE/pages/edit-v2/544997922#Hidden-interactive-elements s("span", { class: u("k-button", "k-icon-button", `k-toolbar-${t}`), title: this.getScrollButtonTitle(), "aria-hidden": !0, tabindex: e ? -1 : void 0, onClick: a }, [s(d, { icon: t === "prev" ? g : m, class: "k-button-icon" }, null)]) ); } }); export { k as ToolbarScrollButton };