UNPKG

@progress/kendo-vue-inputs

Version:
64 lines (63 loc) 1.83 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 s, createVNode as l } from "vue"; import { getDefaultSlots as n, classNames as a } from "@progress/kendo-vue-common"; const k = "data-slider-label", h = /* @__PURE__ */ s({ name: "KendoSliderLabel", emits: { click: null }, props: { position: Number, title: String, vertical: Boolean }, data() { return { currentDir: "ltr" }; }, inject: ["kendoMax", "kendoMin", "kendoVertical"], mounted() { if (this.sliderLabelRef = this.$refs.sliderLabelRef, !this.currentDir && window && this.$el) { const t = window.getComputedStyle(this.$el).direction; t && (this.currentDir = t); } }, render() { let t = this.currentDir; const o = n(this), e = 100 * (this.$props.position - this.kendoMin) / (this.kendoMax - this.kendoMin), i = this.kendoVertical, r = i ? { bottom: `${e}%` } : { [t === "rtl" ? "right" : "left"]: `${e}%` }; return l("li", { ref: "sliderLabelRef", class: a("k-tick", "k-tick-large", i ? "k-tick-vertical" : "k-tick-horizontal"), title: this.$props.title, style: { zIndex: 1, position: "absolute", ...r } }, [l("span", { "data-slider-label": !0, class: "k-label", onClick: this.onClick }, [o])]); }, methods: { onClick(t) { this.$emit("click", t); } } }); export { k as SLIDER_LABEL_ATTRIBUTE, h as SliderLabel };