UNPKG

dk-plus

Version:
114 lines (113 loc) 4.53 kB
import b from "./index2.js"; import { resolveComponent as w, openBlock as s, createElementBlock as l, normalizeClass as f, createElementVNode as t, normalizeStyle as i, Fragment as u, renderList as m, createCommentVNode as r, toDisplayString as p, withModifiers as d, withDirectives as v, vShow as k, createBlock as g, createVNode as y } from "vue"; import S from "../../_virtual/index.js"; const $ = { class: "dk-slider_mark-text" }, V = { key: 0, class: "dk-slider_input" }, I = /* @__PURE__ */ t("span", { class: "dk-slider_input-separator" }, "-", -1); function M(e, n, T, C, B, D) { const a = w("dk-input-number"); return s(), l("div", { class: f(["dk-slider", { "is-disabled": e.disabled, "is-vertical": e.vertical }]) }, [ t("div", { ref: "runwayRef", class: "dk-slider_runway", style: i(e.runwayStyle), onMousedown: n[12] || (n[12] = (...o) => e.onRunwayMouseDown && e.onRunwayMouseDown(...o)) }, [ t("div", { class: "dk-slider_bar", style: i(e.barStyle) }, null, 4), e.showStops ? (s(!0), l(u, { key: 0 }, m(e.stops, (o) => (s(), l("span", { key: o, class: "dk-slider_stop", style: i(e.stopStyle(o)) }, null, 4))), 128)) : r("", !0), e.marksList.length ? (s(!0), l(u, { key: 1 }, m(e.marksList, (o) => (s(), l("span", { key: o.value, class: "dk-slider_mark", style: i({ ...e.markStyle(o.value), ...o.style || {} }) }, [ t("span", $, p(o.label), 1) ], 4))), 128)) : r("", !0), t("div", { class: "dk-slider_button-wrapper", style: i(e.buttonStyle(0)), onMouseenter: n[2] || (n[2] = (o) => e.state.hoverIndex = 0), onMouseleave: n[3] || (n[3] = (o) => e.state.hoverIndex = null), onMousedown: n[4] || (n[4] = d((o) => e.onButtonDown(0, o), ["stop", "prevent"])), onTouchstart: n[5] || (n[5] = d((o) => e.onButtonTouchStart(0), ["stop", "prevent"])) }, [ t("div", { class: "dk-slider_button", tabindex: "0", onFocus: n[0] || (n[0] = (o) => e.state.activeIndex = 0), onKeydown: n[1] || (n[1] = (o) => e.onKeydown(0, o)) }, null, 32), e.showTooltip ? v((s(), l("div", { key: 0, class: "dk-slider_tooltip" }, p(e.formatTooltipText(e.isRange ? e.minValue : e.firstValue)), 513)), [ [k, e.tooltipVisible(0)] ]) : r("", !0) ], 36), e.isRange ? (s(), l("div", { key: 2, class: "dk-slider_button-wrapper", style: i(e.buttonStyle(1)), onMouseenter: n[8] || (n[8] = (o) => e.state.hoverIndex = 1), onMouseleave: n[9] || (n[9] = (o) => e.state.hoverIndex = null), onMousedown: n[10] || (n[10] = d((o) => e.onButtonDown(1, o), ["stop", "prevent"])), onTouchstart: n[11] || (n[11] = d((o) => e.onButtonTouchStart(1), ["stop", "prevent"])) }, [ t("div", { class: "dk-slider_button", tabindex: "0", onFocus: n[6] || (n[6] = (o) => e.state.activeIndex = 1), onKeydown: n[7] || (n[7] = (o) => e.onKeydown(1, o)) }, null, 32), e.showTooltip ? v((s(), l("div", { key: 0, class: "dk-slider_tooltip" }, p(e.formatTooltipText(e.maxValue)), 513)), [ [k, e.tooltipVisible(1)] ]) : r("", !0) ], 36)) : r("", !0) ], 36), e.showInput ? (s(), l("div", V, [ e.isRange ? (s(), l(u, { key: 1 }, [ y(a, { "model-value": e.minValue, min: e.min, max: e.max, step: e.step, disabled: e.disabled, onChange: n[14] || (n[14] = (o) => e.onInputNumberChange(0, o)) }, null, 8, ["model-value", "min", "max", "step", "disabled"]), I, y(a, { "model-value": e.maxValue, min: e.min, max: e.max, step: e.step, disabled: e.disabled, onChange: n[15] || (n[15] = (o) => e.onInputNumberChange(1, o)) }, null, 8, ["model-value", "min", "max", "step", "disabled"]) ], 64)) : (s(), g(a, { key: 0, "model-value": e.firstValue, min: e.min, max: e.max, step: e.step, disabled: e.disabled, onChange: n[13] || (n[13] = (o) => e.onInputNumberChange(0, o)) }, null, 8, ["model-value", "min", "max", "step", "disabled"])) ])) : r("", !0) ], 2); } const F = /* @__PURE__ */ S(b, [["render", M]]); export { F as default };