dk-plus
Version:
223 lines (222 loc) • 10.2 kB
JavaScript
import y from "./index2.js";
import { resolveComponent as u, openBlock as l, createElementBlock as n, normalizeClass as p, createElementVNode as o, createBlock as r, createVNode as s, toDisplayString as v, Transition as f, withCtx as h, Teleport as g, withDirectives as m, normalizeStyle as k, withModifiers as b, vShow as w } from "vue";
import c from "../../_virtual/index.js";
const S = {
key: 1,
class: "dk-time-picker_range"
}, U = { class: "dk-time-picker_range-separator" }, C = {
key: 1,
class: "dk-time-picker_range-panel"
}, V = /* @__PURE__ */ o("div", { class: "dk-time-picker_range-header" }, [
/* @__PURE__ */ o("span", { class: "dk-time-picker_range-title" }, "Start Time"),
/* @__PURE__ */ o("span", { class: "dk-time-picker_range-title" }, "End Time")
], -1), R = { class: "dk-time-picker_range-body" }, B = { class: "dk-time-picker_footer" }, z = ["disabled"], D = ["disabled"], F = {
key: 1,
class: "dk-time-picker_range-panel"
}, M = /* @__PURE__ */ o("div", { class: "dk-time-picker_range-header" }, [
/* @__PURE__ */ o("span", { class: "dk-time-picker_range-title" }, "Start Time"),
/* @__PURE__ */ o("span", { class: "dk-time-picker_range-title" }, "End Time")
], -1), P = { class: "dk-time-picker_range-body" }, A = { class: "dk-time-picker_footer" }, E = ["disabled"], T = ["disabled"];
function I(e, d, H, K, $, L) {
const t = u("dk-input"), i = u("dk-time-picker-panel");
return l(), n("div", {
ref: "rootRef",
class: p(["dk-time-picker", { "is-disabled": e.disabled }]),
onKeydown: d[9] || (d[9] = (...a) => e.onKeydown && e.onKeydown(...a))
}, [
o("div", {
ref: "triggerRef",
class: "dk-time-picker_trigger",
onClick: d[0] || (d[0] = (...a) => e.openDropdown && e.openDropdown(...a))
}, [
e.isRange ? (l(), n("div", S, [
s(t, {
id: Array.isArray(e.id) && e.id[0] || "",
"model-value": e.startText,
name: Array.isArray(e.name) && e.name[0] || "",
disabled: e.disabled,
readonly: e.readonly || !e.editable,
clearable: !1,
placeholder: e.startPlaceholder,
size: e.size,
"prefix-icon": e.prefixIcon,
tabindex: e.tabindex,
"aria-label": e.ariaLabel,
"onUpdate:modelValue": e.onStartInputUpdate,
onFocus: e.onStartFocus,
onBlur: e.onBlur
}, null, 8, ["id", "model-value", "name", "disabled", "readonly", "placeholder", "size", "prefix-icon", "tabindex", "aria-label", "onUpdate:modelValue", "onFocus", "onBlur"]),
o("span", U, v(e.rangeSeparator), 1),
s(t, {
id: Array.isArray(e.id) && e.id[1] || "",
"model-value": e.endText,
name: Array.isArray(e.name) && e.name[1] || "",
disabled: e.disabled,
readonly: e.readonly || !e.editable,
clearable: e.clearable,
placeholder: e.endPlaceholder,
size: e.size,
"clear-icon": e.clearIcon,
tabindex: e.tabindex,
"aria-label": e.ariaLabel,
"onUpdate:modelValue": e.onEndInputUpdate,
onFocus: e.onEndFocus,
onBlur: e.onBlur
}, null, 8, ["id", "model-value", "name", "disabled", "readonly", "clearable", "placeholder", "size", "clear-icon", "tabindex", "aria-label", "onUpdate:modelValue", "onFocus", "onBlur"])
])) : (l(), r(t, {
key: 0,
id: typeof e.id == "string" ? e.id : "",
"model-value": e.text,
name: typeof e.name == "string" ? e.name : "",
disabled: e.disabled,
readonly: e.readonly || !e.editable,
clearable: e.clearable,
placeholder: e.placeholder,
size: e.size,
"prefix-icon": e.prefixIcon,
"clear-icon": e.clearIcon,
tabindex: e.tabindex,
"aria-label": e.ariaLabel,
"onUpdate:modelValue": e.onInputUpdate,
onFocus: e.onFocus,
onBlur: e.onBlur
}, null, 8, ["id", "model-value", "name", "disabled", "readonly", "clearable", "placeholder", "size", "prefix-icon", "clear-icon", "tabindex", "aria-label", "onUpdate:modelValue", "onFocus", "onBlur"]))
], 512),
s(f, { name: "Dk-trigger" }, {
default: h(() => [
e.teleported ? (l(), r(g, {
key: 0,
to: "body"
}, [
m(o("div", {
ref: "dropdownRef",
class: p(["dk-time-picker_dropdown", e.popperClass]),
style: k([e.dropdownStyle, e.popperStyle]),
onMousedown: d[3] || (d[3] = b(() => {
}, ["prevent"])),
onClick: d[4] || (d[4] = b(() => {
}, ["stop"]))
}, [
e.isRange ? (l(), n("div", C, [
V,
o("div", R, [
s(i, {
"model-value": e.draftRange[0] || void 0,
disabled: e.disabled,
"arrow-control": e.arrowControl,
"show-seconds": e.showSeconds,
"disabled-hours": e.disabledHours,
"disabled-minutes": e.disabledMinutes,
"disabled-seconds": e.disabledSeconds,
"onUpdate:modelValue": e.onPickRangeDraftStart
}, null, 8, ["model-value", "disabled", "arrow-control", "show-seconds", "disabled-hours", "disabled-minutes", "disabled-seconds", "onUpdate:modelValue"]),
s(i, {
"model-value": e.draftRange[1] || void 0,
disabled: e.disabled,
"arrow-control": e.arrowControl,
"show-seconds": e.showSeconds,
"disabled-hours": e.disabledHours,
"disabled-minutes": e.disabledMinutes,
"disabled-seconds": e.disabledSeconds,
"onUpdate:modelValue": e.onPickRangeDraftEnd
}, null, 8, ["model-value", "disabled", "arrow-control", "show-seconds", "disabled-hours", "disabled-minutes", "disabled-seconds", "onUpdate:modelValue"])
])
])) : (l(), r(i, {
key: 0,
"model-value": e.draft || void 0,
disabled: e.disabled,
"arrow-control": e.arrowControl,
"show-seconds": e.showSeconds,
"disabled-hours": e.disabledHours,
"disabled-minutes": e.disabledMinutes,
"disabled-seconds": e.disabledSeconds,
"onUpdate:modelValue": e.onPickSingleDraft
}, null, 8, ["model-value", "disabled", "arrow-control", "show-seconds", "disabled-hours", "disabled-minutes", "disabled-seconds", "onUpdate:modelValue"])),
o("div", B, [
o("button", {
type: "button",
class: "dk-time-picker_btn",
disabled: e.disabled,
onClick: d[1] || (d[1] = (...a) => e.cancel && e.cancel(...a))
}, "Cancel", 8, z),
o("button", {
type: "button",
class: "dk-time-picker_btn primary",
disabled: e.disabled,
onClick: d[2] || (d[2] = (...a) => e.commit && e.commit(...a))
}, "OK", 8, D)
])
], 38), [
[w, e.open]
])
])) : m((l(), n("div", {
key: 1,
ref: "dropdownRef",
class: p(["dk-time-picker_dropdown", e.popperClass]),
style: k([e.popperStyle]),
onMousedown: d[7] || (d[7] = b(() => {
}, ["prevent"])),
onClick: d[8] || (d[8] = b(() => {
}, ["stop"]))
}, [
e.isRange ? (l(), n("div", F, [
M,
o("div", P, [
s(i, {
"model-value": e.draftRange[0] || void 0,
disabled: e.disabled,
"arrow-control": e.arrowControl,
"show-seconds": e.showSeconds,
"disabled-hours": e.disabledHours,
"disabled-minutes": e.disabledMinutes,
"disabled-seconds": e.disabledSeconds,
"onUpdate:modelValue": e.onPickRangeDraftStart
}, null, 8, ["model-value", "disabled", "arrow-control", "show-seconds", "disabled-hours", "disabled-minutes", "disabled-seconds", "onUpdate:modelValue"]),
s(i, {
"model-value": e.draftRange[1] || void 0,
disabled: e.disabled,
"arrow-control": e.arrowControl,
"show-seconds": e.showSeconds,
"disabled-hours": e.disabledHours,
"disabled-minutes": e.disabledMinutes,
"disabled-seconds": e.disabledSeconds,
"onUpdate:modelValue": e.onPickRangeDraftEnd
}, null, 8, ["model-value", "disabled", "arrow-control", "show-seconds", "disabled-hours", "disabled-minutes", "disabled-seconds", "onUpdate:modelValue"])
])
])) : (l(), r(i, {
key: 0,
"model-value": e.draft || void 0,
disabled: e.disabled,
"arrow-control": e.arrowControl,
"show-seconds": e.showSeconds,
"disabled-hours": e.disabledHours,
"disabled-minutes": e.disabledMinutes,
"disabled-seconds": e.disabledSeconds,
"onUpdate:modelValue": e.onPickSingleDraft
}, null, 8, ["model-value", "disabled", "arrow-control", "show-seconds", "disabled-hours", "disabled-minutes", "disabled-seconds", "onUpdate:modelValue"])),
o("div", A, [
o("button", {
type: "button",
class: "dk-time-picker_btn",
disabled: e.disabled,
onClick: d[5] || (d[5] = (...a) => e.cancel && e.cancel(...a))
}, "Cancel", 8, E),
o("button", {
type: "button",
class: "dk-time-picker_btn primary",
disabled: e.disabled,
onClick: d[6] || (d[6] = (...a) => e.commit && e.commit(...a))
}, "OK", 8, T)
])
], 38)), [
[w, e.open]
])
]),
_: 1
})
], 34);
}
const q = /* @__PURE__ */ c(y, [["render", I]]);
export {
q as default
};