UNPKG

uiv

Version:

Bootstrap 3 components implemented by Vue.

1,660 lines 121 kB
import { ref as P, reactive as Re, watch as ie, onMounted as de, onBeforeUnmount as Ae, openBlock as u, createElementBlock as h, renderSlot as V, unref as $, createElementVNode as r, Fragment as F, renderList as j, normalizeClass as k, createCommentVNode as N, withModifiers as M, nextTick as Pe, getCurrentInstance as Yt, onBeforeMount as Wt, defineComponent as bt, h as Se, createVNode as B, Teleport as Ct, computed as R, createBlock as Y, resolveDynamicComponent as kt, withCtx as O, resolveComponent as $e, createTextVNode as q, toDisplayString as I, withDirectives as te, vShow as ye, normalizeStyle as ge, onUnmounted as qt, withKeys as W, vModelText as Ze, useSlots as Gt, normalizeProps as jt, mergeProps as Zt, render as ce, createSlots as Jt, vModelDynamic as Xt } from "vue"; function J(e) { return typeof e < "u" && e !== null; } function he(e) { return typeof e == "function"; } function we(e) { return typeof e == "number"; } function ue(e) { return typeof e == "string"; } function Fe(e, t) { return Object.prototype.hasOwnProperty.call(e, t); } const Qt = { class: "carousel-indicators" }, el = ["onClick"], tl = { class: "carousel-inner", role: "listbox" }, ll = /* @__PURE__ */ r("span", { class: "sr-only" }, "Previous", -1), nl = /* @__PURE__ */ r("span", { class: "sr-only" }, "Next", -1), sl = { __name: "Carousel", props: { modelValue: { type: Number, default: void 0 }, indicators: { type: Boolean, default: !0 }, controls: { type: Boolean, default: !0 }, interval: { type: Number, default: 5e3 }, iconControlLeft: { type: String, default: "glyphicon glyphicon-chevron-left" }, iconControlRight: { type: String, default: "glyphicon glyphicon-chevron-right" } }, emits: ["update:modelValue", "change"], setup(e, { expose: t, emit: l }) { const n = e; let o = P(0), s = 0, a = 0; const i = Re([]); function d(b, S) { const x = S || 0; let C; b > x ? C = ["next", "left"] : C = ["prev", "right"], i[b].exposed.slideClass[C[0]] = !0, Pe(() => { i[b].vnode.el.offsetHeight, i.forEach((E, z) => { z === x ? (E.exposed.slideClass.active = !0, E.exposed.slideClass[C[1]] = !0) : z === b && (E.exposed.slideClass[C[1]] = !0); }), s = setTimeout(() => { c(b), l("change", b), s = 0; }, 600); }); } function p() { f(), n.interval > 0 && (a = setInterval(() => { v(); }, n.interval)); } function f() { clearInterval(a), a = 0; } function m() { i.forEach((b) => { b.exposed.slideClass.active = !1, b.exposed.slideClass.left = !1, b.exposed.slideClass.right = !1, b.exposed.slideClass.next = !1, b.exposed.slideClass.prev = !1; }); } function c(b) { m(), i[b].exposed.slideClass.active = !0; } function y(b) { s !== 0 || b === o.value || (J(n.modelValue) ? l("update:modelValue", b) : (d(b, o.value), o.value = b)); } function g() { y(o.value === 0 ? i.length - 1 : o.value - 1); } function v() { y(o.value === i.length - 1 ? 0 : o.value + 1); } return ie( () => n.interval, () => { p(); } ), ie( () => n.modelValue, (b, S) => { d(b, S), o.value = b; } ), de(() => { J(n.modelValue) && (o.value = n.modelValue), i.length > 0 && c(o.value), p(); }), Ae(() => { f(); }), t({ slides: i }), (b, S) => (u(), h("div", { class: "carousel slide", "data-ride": "carousel", onMouseenter: f, onMouseleave: p }, [ e.indicators ? V(b.$slots, "indicators", { key: 0, select: y, activeIndex: $(o) }, () => [ r("ol", Qt, [ (u(!0), h(F, null, j(i, (x, C) => (u(), h("li", { key: C, class: k({ active: C === $(o) }), onClick: (E) => y(C) }, null, 10, el))), 128)) ]) ]) : N("", !0), r("div", tl, [ V(b.$slots, "default") ]), e.controls ? (u(), h("a", { key: 1, class: "left carousel-control", href: "#", role: "button", onClick: S[0] || (S[0] = M((x) => g(), ["prevent"])) }, [ r("span", { class: k(e.iconControlLeft), "aria-hidden": "true" }, null, 2), ll ])) : N("", !0), e.controls ? (u(), h("a", { key: 2, class: "right carousel-control", href: "#", role: "button", onClick: S[1] || (S[1] = M((x) => v(), ["prevent"])) }, [ r("span", { class: k(e.iconControlRight), "aria-hidden": "true" }, null, 2), nl ])) : N("", !0) ], 32)); } }; function ot(e, t) { if (Array.isArray(e)) { const l = e.indexOf(t); l >= 0 && e.splice(l, 1); } } function ol(e, t = 0, l = 1) { const n = []; for (let o = t; o < e; o += l) n.push(o); return n; } function il(e, t, l) { return l.indexOf(e) === t; } const al = { __name: "Slide", setup(e, { expose: t }) { const l = Yt(), n = Re({ active: !1, prev: !1, next: !1, left: !1, right: !1 }); return Wt(() => { var o, s, a; (a = (s = (o = l.parent) == null ? void 0 : o.exposed) == null ? void 0 : s.slides) == null || a.push(l); }), Ae(() => { var o, s; ot((s = (o = l.parent) == null ? void 0 : o.exposed) == null ? void 0 : s.slides, l); }), t({ slideClass: n }), (o, s) => (u(), h("div", { class: k(["item", n]) }, [ V(o.$slots, "default") ], 2)); } }, w = { MOUSE_ENTER: "mouseenter", MOUSE_LEAVE: "mouseleave", MOUSE_DOWN: "mousedown", MOUSE_UP: "mouseup", FOCUS: "focus", BLUR: "blur", CLICK: "click", INPUT: "input", KEY_DOWN: "keydown", KEY_UP: "keyup", KEY_PRESS: "keypress", RESIZE: "resize", SCROLL: "scroll", TOUCH_START: "touchstart", TOUCH_END: "touchend" }, ee = { CLICK: "click", HOVER: "hover", FOCUS: "focus", HOVER_FOCUS: "hover-focus", OUTSIDE_CLICK: "outside-click", MANUAL: "manual" }, G = { TOP: "top", RIGHT: "right", BOTTOM: "bottom", LEFT: "left" }; function Je(e) { return window.getComputedStyle(e); } function it() { const e = window.innerWidth || 0, t = window.innerHeight || 0; return { width: e, height: t }; } let Be = null, He = null; function rl(e = !1) { const t = it(); if (Be !== null && !e && t.height === He.height && t.width === He.width) return Be; if (document.readyState === "loading") return null; const l = document.createElement("div"), n = document.createElement("div"); return l.style.width = n.style.width = l.style.height = n.style.height = "100px", l.style.overflow = "scroll", n.style.overflow = "hidden", document.body.appendChild(l), document.body.appendChild(n), Be = Math.abs(l.scrollHeight - n.scrollHeight), document.body.removeChild(l), document.body.removeChild(n), He = t, Be; } function L(e, t, l) { e.addEventListener(t, l); } function _(e, t, l) { e.removeEventListener(t, l); } function le(e) { return e && e.nodeType === Node.ELEMENT_NODE; } function ae(e) { le(e) && le(e.parentNode) && e.parentNode.removeChild(e); } function H(e, t) { le(e) && e.classList.add(t); } function Z(e, t) { le(e) && e.classList.remove(t); } function ul(e, t) { return le(e) ? e.classList.contains(t) : !1; } function dl(e, t, l = {}) { const n = document.documentElement, o = (window.pageXOffset || n.scrollLeft) - (n.clientLeft || 0), s = (window.pageYOffset || n.scrollTop) - (n.clientTop || 0), a = t.getBoundingClientRect(), i = e.getBoundingClientRect(); if (e.style.right = "auto", e.style.bottom = "auto", l.menuRight) { const d = o + a.left + a.width - i.width; e.style.left = d < 0 ? 0 : d + "px"; } else e.style.left = o + a.left + "px"; l.dropup ? e.style.top = s + a.top - i.height - 4 + "px" : e.style.top = s + a.top + a.height + "px"; } function rt(e, t, l) { const n = e.getBoundingClientRect(), o = t.getBoundingClientRect(), s = it(); let a = !0, i = !0, d = !0, p = !0; switch (l) { case G.TOP: a = n.top >= o.height, p = n.left + n.width / 2 >= o.width / 2, i = n.right - n.width / 2 + o.width / 2 <= s.width; break; case G.BOTTOM: d = n.bottom + o.height <= s.height, p = n.left + n.width / 2 >= o.width / 2, i = n.right - n.width / 2 + o.width / 2 <= s.width; break; case G.RIGHT: i = n.right + o.width <= s.width, a = n.top + n.height / 2 >= o.height / 2, d = n.bottom - n.height / 2 + o.height / 2 <= s.height; break; case G.LEFT: p = n.left >= o.width, a = n.top + n.height / 2 >= o.height / 2, d = n.bottom - n.height / 2 + o.height / 2 <= s.height; break; } return a && i && d && p; } function cl(e, t, l, n, o, s, a) { if (!le(e) || !le(t)) return; const i = e && e.className && e.className.indexOf("popover") >= 0; let d, p; if (!J(o) || o === "body" || s === "body") { const v = document.documentElement; p = (window.pageXOffset || v.scrollLeft) - (v.clientLeft || 0), d = (window.pageYOffset || v.scrollTop) - (v.clientTop || 0); } else { const v = Le(s || o); p = v.scrollLeft, d = v.scrollTop; } if (n) { const v = [ G.RIGHT, G.BOTTOM, G.LEFT, G.TOP ], b = (S) => { v.forEach((x) => { Z(e, x); }), H(e, S); }; if (!rt(t, e, l)) { for (let S = 0, x = v.length; S < x; S++) if (b(v[S]), rt(t, e, v[S])) { l = v[S]; break; } b(l); } } const f = t.getBoundingClientRect(), m = e.getBoundingClientRect(); let c, y; l === G.BOTTOM ? (c = d + f.top + f.height, y = p + f.left + f.width / 2 - m.width / 2) : l === G.LEFT ? (c = d + f.top + f.height / 2 - m.height / 2, y = p + f.left - m.width) : l === G.RIGHT ? (c = d + f.top + f.height / 2 - m.height / 2, y = p + f.left + f.width + 1) : (c = d + f.top - m.height, y = p + f.left + f.width / 2 - m.width / 2); let g; if (ue(a) ? g = document.querySelector(a) : he(a) && (g = a(t)), le(g)) { const v = i ? 11 : 0, b = g.getBoundingClientRect(), S = d + b.top, x = p + b.left, C = S + b.height, E = x + b.width; c < S ? c = S : c + m.height > C && (c = C - m.height), y < x ? y = x : y + m.width > E && (y = E - m.width), l === G.BOTTOM ? c -= v : l === G.LEFT ? y += v : l === G.RIGHT ? y -= v : c += v; } e.style.top = `${c}px`, e.style.left = `${y}px`; } function ut(e) { const t = "scroll", l = e.scrollHeight > e.clientHeight, n = Je(e); return l || n.overflow === t || n.overflowY === t; } function ze(e) { const t = "modal-open", l = ".navbar-fixed-top, .navbar-fixed-bottom", n = document.body; if (e) Z(n, t), n.style.paddingRight = null, [...document.querySelectorAll(l)].forEach((o) => { o.style.paddingRight = null; }); else { if (ut(document.documentElement) || ut(document.body)) { const s = rl(); n.style.paddingRight = `${s}px`, [...document.querySelectorAll(l)].forEach((a) => { a.style.paddingRight = `${s}px`; }); } H(n, t); } } function hl(e, t) { return le(e) ? e.closest(t) : null; } function Xe(e, t, l = null) { const n = []; let o = e.parentElement; for (; o; ) { if (o.matches(t)) n.push(o); else if (l && (l === o || o.matches(l))) break; o = o.parentElement; } return n; } function Ke(e) { le(e) && (e.getAttribute("tabindex") || e.setAttribute("tabindex", "-1"), e.focus()); } const fl = "modal-backdrop"; function Tt() { return document.querySelectorAll(`.${fl}`); } function Me() { return Tt().length; } function Le(e) { return ue(e) ? document.querySelector(e) : le(e) ? e : le(e.$el) ? e.$el : null; } const wt = bt({ props: { tag: { type: String, default: "div" }, modelValue: { type: Boolean, default: !1 }, transition: { type: Number, default: 350 } }, emits: ["show", "shown", "hide", "hidden"], setup(e, { emit: t, slots: l }) { const n = "collapse", o = "in", s = "collapsing"; let a = 0; const i = P(null); function d() { const p = e.modelValue, f = i.value; if (clearTimeout(a), !!f) if (p) { t("show"), Z(f, n), f.style.height = "auto"; const m = window.getComputedStyle(f).height; f.style.height = null, H(f, s), f.offsetHeight, f.style.height = m, a = setTimeout(() => { Z(f, s), H(f, n), H(f, o), f.style.height = null, a = 0, t("shown"); }, e.transition); } else t("hide"), f.style.height = window.getComputedStyle(f).height, Z(f, o), Z(f, n), f.offsetHeight, f.style.height = null, H(f, s), a = setTimeout(() => { H(f, n), Z(f, s), f.style.height = null, a = 0, t("hidden"); }, e.transition); } return ie( () => e.modelValue, () => { d(); } ), de(() => { e.modelValue && H(i.value, o); }), () => { var p; return Se(e.tag, { ref: i, class: n }, (p = l.default) == null ? void 0 : p.call(l)); }; } }), dt = "div", Ue = /* @__PURE__ */ bt({ props: { tag: { type: String, default: dt }, appendToBody: { type: Boolean, default: !1 }, modelValue: Boolean, dropup: { type: Boolean, default: !1 }, menuRight: { type: Boolean, default: !1 }, disabled: { type: Boolean, default: !1 }, notCloseElements: { type: Array, default: () => [] }, positionElement: { type: null, default: void 0 } }, emits: ["update:modelValue"], setup(e, { emit: t, slots: l }) { const n = P(!1), o = P(void 0), s = P(null), a = P(null); function i() { var c; return (c = s.value) == null ? void 0 : c.querySelector("li > a:focus"); } function d(c) { var y, g; if (n.value) { const v = s.value, b = c.keyCode; if (b === 27) f(!1), (y = o.value) == null || y.focus(); else if (b === 13) (g = i()) == null || g.click(); else if (b === 38 || b === 40) { c.preventDefault(), c.stopPropagation(); const S = i(), x = v.querySelectorAll("li:not(.disabled) > a"); if (!S) Ke(x[0]); else for (let C = 0; C < x.length; C++) if (S === x[C]) { b === 38 && C < x.length > 0 ? Ke(x[C - 1]) : b === 40 && C < x.length - 1 && Ke(x[C + 1]); break; } } } } function p() { var y, g, v; const c = ((y = a.value) == null ? void 0 : y.querySelector('[data-role="trigger"]')) || ((g = a.value) == null ? void 0 : g.querySelector(".dropdown-toggle")) || ((v = a.value) == null ? void 0 : v.firstChild); o.value = c && c !== s.value ? c : null; } function f(c) { var y; if (!e.disabled) { if (typeof c == "boolean" ? n.value = c : n.value = !n.value, e.appendToBody) if (n.value) { s.value.style.display = "block"; const g = e.positionElement || a.value; dl(s.value, g, e); } else (y = s.value) == null || y.removeAttribute("style"); t("update:modelValue", n.value); } } function m(c) { var g, v, b; const y = c.target; if (n.value && y) { let S = !1; if (e.notCloseElements) for (let z = 0, U = e.notCloseElements.length; z < U; z++) { const A = e.notCloseElements[z].contains(y); let oe = A; if (e.appendToBody) { const pe = (g = s.value) == null ? void 0 : g.contains(y), T = e.notCloseElements.indexOf(a.value) >= 0; oe = A || pe && T; } if (oe) { S = !0; break; } } const x = (v = s.value) == null ? void 0 : v.contains(y), C = ((b = a.value) == null ? void 0 : b.contains(y)) && !x, E = x && c.type === "touchend"; !C && !S && !E && f(!1); } } return de(() => { p(), o.value && (L(o.value, w.CLICK, f), L(o.value, w.KEY_DOWN, d)), L(s.value, w.KEY_DOWN, d), L(window, w.CLICK, m), L(window, w.TOUCH_END, m), e.modelValue && f(!0); }), Ae(() => { o.value && (_(o.value, w.CLICK, f), _(o.value, w.KEY_DOWN, d)), _(s.value, w.KEY_DOWN, d), _(window, w.CLICK, m), _(window, w.TOUCH_END, m); }), ie(() => e.modelValue, (c) => { f(c); }), () => { const c = e.tag; return B(c, { ref: a, class: { "btn-group": e.tag === dt, dropdown: !e.dropup, dropup: e.dropup, open: n.value } }, { default: () => { var y; return [(y = l.default) == null ? void 0 : y.call(l), B(Ct, { to: "body", disabled: !e.appendToBody || !n.value }, { default: () => { var g; return [B("ul", { ref: s, class: { "dropdown-menu": !0, "dropdown-menu-right": e.menuRight } }, [(g = l.dropdown) == null ? void 0 : g.call(l)])]; } })]; } }); }; } }), pl = { uiv: { datePicker: { clear: "Clear", today: "Today", month: "Month", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", year: "Year", week1: "Mon", week2: "Tue", week3: "Wed", week4: "Thu", week5: "Fri", week6: "Sat", week7: "Sun" }, timePicker: { am: "AM", pm: "PM" }, modal: { cancel: "Cancel", ok: "OK" }, multiSelect: { placeholder: "Select...", filterPlaceholder: "Search..." } } }; let Qe = pl, et = function() { return "$t" in this ? this.$t.apply(this, arguments) : null; }; const se = function(e, t) { t = t || {}; let l; try { if (l = et.apply(this, arguments), J(l) && !t.$$locale) return l; } catch { } const n = e.split("."); let o = t.$$locale || Qe; for (let s = 0, a = n.length; s < a; s++) { const i = n[s]; if (l = o[i], s === a - 1) return l; if (!l) return ""; o = l; } return ""; }, ml = function(e) { Qe = e || Qe; }, yl = function(e) { et = e || et; }, ct = { use: ml, t: se, i18n: yl }, St = { __name: "BtnGroup", props: { size: { type: String, default: void 0 }, vertical: { type: Boolean, default: !1 }, justified: { type: Boolean, default: !1 } }, setup(e) { return (t, l) => (u(), h("div", { class: k({ "btn-group": !e.vertical, "btn-group-vertical": e.vertical, "btn-group-justified": e.justified, [`btn-group-${e.size}`]: e.size }), role: "group", "data-toggle": "buttons" }, [ V(t.$slots, "default") ], 2)); } }, $t = { // <a> props href: { type: String, default: void 0 }, target: { type: String, default: void 0 }, // <router-link> props to: { type: null, default: void 0 }, replace: { type: Boolean, default: !1 }, append: { type: Boolean, default: !1 }, exact: { type: Boolean, default: !1 } }, gl = ["href", "target"], vl = ["type", "checked", "disabled"], bl = ["type", "disabled"], Cl = ["type", "disabled"], D = { __name: "Btn", props: { ...$t, justified: { type: Boolean, default: !1 }, type: { type: String, default: "default" }, nativeType: { type: String, default: "button" }, size: { type: String, default: void 0 }, block: { type: Boolean, default: !1 }, active: { type: Boolean, default: !1 }, disabled: { type: Boolean, default: !1 }, // <input> props modelValue: { type: null, default: null }, inputValue: { type: null, default: null }, inputType: { type: String, validator(e) { return e === "checkbox" || e === "radio"; }, default: void 0 } }, emits: ["update:modelValue"], setup(e, { emit: t }) { const l = e, n = R( () => l.inputType === "checkbox" ? l.modelValue.indexOf(l.inputValue) >= 0 : l.modelValue === l.inputValue ), o = R(() => ({ btn: !0, active: l.inputType ? n.value : l.active, disabled: l.disabled, "btn-block": l.block, [`btn-${l.type}`]: !!l.type, [`btn-${l.size}`]: !!l.size })); function s(i) { l.disabled && i instanceof Event && (i.preventDefault(), i.stopPropagation()); } function a() { if (l.inputType === "checkbox") { const i = l.modelValue.slice(); n.value ? i.splice(i.indexOf(l.inputValue), 1) : i.push(l.inputValue), t("update:modelValue", i); } else t("update:modelValue", l.inputValue); } return (i, d) => i.href ? (u(), h("a", { key: 0, href: i.href, target: i.target, role: "button", class: k($(o)), onClick: s }, [ V(i.$slots, "default") ], 10, gl)) : i.to ? (u(), Y(kt("RouterLink"), { key: 1, to: i.to, class: k($(o)), event: e.disabled ? "" : "click", replace: i.replace, append: i.append, exact: i.exact, role: "button", onClick: s }, { default: O(() => [ V(i.$slots, "default") ]), _: 3 }, 8, ["to", "class", "event", "replace", "append", "exact"])) : e.inputType ? (u(), h("label", { key: 2, class: k($(o)), onClick: s }, [ r("input", { autocomplete: "off", type: e.inputType, checked: $(n), disabled: e.disabled, onInput: d[0] || (d[0] = M(() => { }, ["stop"])), onChange: a }, null, 40, vl), V(i.$slots, "default") ], 2)) : e.justified ? (u(), Y(St, { key: 3 }, { default: O(() => [ r("button", { class: k($(o)), type: e.nativeType, disabled: e.disabled, onClick: s }, [ V(i.$slots, "default") ], 10, bl) ]), _: 3 })) : (u(), h("button", { key: 4, class: k($(o)), type: e.nativeType, disabled: e.disabled, onClick: s }, [ V(i.$slots, "default") ], 10, Cl)); } }, ke = (e, t) => { const l = e.__vccOpts || e; for (const [n, o] of t) l[n] = o; return l; }, Ie = "in", kl = { components: { Btn: D }, props: { modelValue: { type: Boolean, default: !1 }, title: { type: String, default: void 0 }, size: { type: String, default: void 0 }, backdrop: { type: Boolean, default: !0 }, footer: { type: Boolean, default: !0 }, header: { type: Boolean, default: !0 }, cancelText: { type: String, default: void 0 }, cancelType: { type: String, default: "default" }, okText: { type: String, default: void 0 }, okType: { type: String, default: "primary" }, dismissBtn: { type: Boolean, default: !0 }, transition: { type: Number, default: 150 }, autoFocus: { type: Boolean, default: !1 }, keyboard: { type: Boolean, default: !0 }, beforeClose: { type: Function, default: void 0 }, zOffset: { type: Number, default: 20 }, appendToBody: { type: Boolean, default: !1 }, displayStyle: { type: String, default: "block" } }, emits: ["update:modelValue", "show", "hide"], data() { return { msg: "" }; }, computed: { modalSizeClass() { return { [`modal-${this.size}`]: !!this.size }; } }, watch: { modelValue(e) { this.$toggle(e); } }, mounted() { ae(this.$refs.backdrop), L(window, w.MOUSE_DOWN, this.suppressBackgroundClose), L(window, w.KEY_UP, this.onKeyPress), this.modelValue && this.$toggle(!0); }, beforeUnmount() { clearTimeout(this.timeoutId), ae(this.$refs.backdrop), ae(this.$el), Me() === 0 && ze(!0), _(window, w.MOUSE_DOWN, this.suppressBackgroundClose), _(window, w.MOUSE_UP, this.unsuppressBackgroundClose), _(window, w.KEY_UP, this.onKeyPress); }, methods: { t: se, onKeyPress(e) { if (this.keyboard && this.modelValue && e.keyCode === 27) { const t = this.$refs.backdrop; let l = t.style.zIndex; l = l && l !== "auto" ? parseInt(l) : 0; const n = Tt(), o = n.length; for (let s = 0; s < o; s++) if (n[s] !== t) { let a = n[s].style.zIndex; if (a = a && a !== "auto" ? parseInt(a) : 0, a > l) return; } this.hideModal(); } }, hideModal(e) { const t = he(this.beforeClose) ? this.beforeClose(e) : !0; Promise.resolve(t).then((l) => { l && (this.msg = e, this.$emit("update:modelValue", !1)); }); }, $toggle(e) { const t = this.$el, l = this.$refs.backdrop; clearTimeout(this.timeoutId), e ? this.$nextTick(() => { const n = Me(); if (document.body.appendChild(l), this.appendToBody && document.body.appendChild(t), t.style.display = this.displayStyle, t.scrollTop = 0, l.offsetHeight, ze(!1), H(l, Ie), H(t, Ie), n > 0) { const o = parseInt(Je(t).zIndex) || 1050, s = parseInt(Je(l).zIndex) || 1040, a = n * this.zOffset; t.style.zIndex = `${o + a}`, l.style.zIndex = `${s + a}`; } this.timeoutId = setTimeout(() => { if (this.autoFocus) { const o = this.$el.querySelector('[data-action="auto-focus"]'); o && (o.focus(), o.setAttribute("data-focused", "true")); } this.$emit("show"), this.timeoutId = 0; }, this.transition); }) : (Z(l, Ie), Z(t, Ie), this.timeoutId = setTimeout(() => { t.style.display = "none", ae(l), this.appendToBody && ae(t), Me() === 0 && ze(!0), this.$emit("hide", this.msg || "dismiss"), this.msg = "", this.timeoutId = 0, t.style.zIndex = "", l.style.zIndex = ""; }, this.transition)); }, suppressBackgroundClose(e) { e && e.target === this.$el || (this.isCloseSuppressed = !0, L(window, "mouseup", this.unsuppressBackgroundClose)); }, unsuppressBackgroundClose() { this.isCloseSuppressed && (_(window, "mouseup", this.unsuppressBackgroundClose), setTimeout(() => { this.isCloseSuppressed = !1; }, 1)); }, backdropClicked() { this.backdrop && !this.isCloseSuppressed && this.hideModal(); } } }, Tl = { class: "modal-content" }, wl = { key: 0, class: "modal-header" }, Sl = /* @__PURE__ */ r("span", { "aria-hidden": "true" }, "×", -1), $l = [ Sl ], El = { class: "modal-title" }, Ol = { class: "modal-body" }, xl = { key: 1, class: "modal-footer" }; function Bl(e, t, l, n, o, s) { const a = $e("btn"); return u(), h("div", { tabindex: "-1", role: "dialog", class: k(["modal", { fade: l.transition > 0 }]), onClick: t[3] || (t[3] = M((...i) => s.backdropClicked && s.backdropClicked(...i), ["self"])) }, [ r("div", { ref: "dialog", class: k(["modal-dialog", s.modalSizeClass]), role: "document" }, [ r("div", Tl, [ l.header ? (u(), h("div", wl, [ V(e.$slots, "header", {}, () => [ l.dismissBtn ? (u(), h("button", { key: 0, type: "button", class: "close", "aria-label": "Close", style: { position: "relative", "z-index": "1060" }, onClick: t[0] || (t[0] = (i) => s.hideModal()) }, $l)) : N("", !0), r("h4", El, [ V(e.$slots, "title", {}, () => [ q(I(l.title), 1) ]) ]) ]) ])) : N("", !0), r("div", Ol, [ V(e.$slots, "default") ]), l.footer ? (u(), h("div", xl, [ V(e.$slots, "footer", {}, () => [ B(a, { type: l.cancelType, onClick: t[1] || (t[1] = (i) => s.hideModal("cancel")) }, { default: O(() => [ r("span", null, I(l.cancelText || s.t("uiv.modal.cancel")), 1) ]), _: 1 }, 8, ["type"]), B(a, { type: l.okType, "data-action": "auto-focus", onClick: t[2] || (t[2] = (i) => s.hideModal("ok")) }, { default: O(() => [ r("span", null, I(l.okText || s.t("uiv.modal.ok")), 1) ]), _: 1 }, 8, ["type"]) ]) ])) : N("", !0) ]) ], 2), r("div", { ref: "backdrop", class: k(["modal-backdrop", { fade: l.transition > 0 }]) }, null, 2) ], 2); } const Et = /* @__PURE__ */ ke(kl, [["render", Bl]]), Ye = "active", We = "in"; let Il = 0; const Vl = { props: { title: { type: String, default: "Tab Title" }, disabled: { type: Boolean, default: !1 }, tabClasses: { type: Object, default: () => ({}) }, group: { type: String, default: void 0 }, pullRight: { type: Boolean, default: !1 }, hidden: { type: Boolean, default: !1 } }, data() { return { active: null, transition: 150, uid: `tab_${++Il}`, isMounted: !1 }; }, watch: { active(e) { e ? setTimeout(() => { H(this.$el, Ye), this.$el.offsetHeight, H(this.$el, We); try { this.$parent.$emit("changed", this.$parent.activeIndex); } catch { throw new Error("<tab> parent must be <tabs>."); } }, this.transition) : (Z(this.$el, We), setTimeout(() => { Z(this.$el, Ye); }, this.transition)); } }, created() { try { this.$parent.tabs.push(this); } catch { throw new Error("<tab> parent must be <tabs>."); } }, mounted() { this.isMounted = !0; }, beforeUnmount() { const e = this.$parent && this.$parent.tabs; ot(e, this); }, methods: { show() { this.$nextTick(() => { H(this.$el, Ye), H(this.$el, We); }); } } }; function Nl(e, t, l, n, o, s) { return u(), h("div", { class: k(["tab-pane", { fade: o.transition > 0 }]), role: "tabpanel" }, [ V(e.$slots, "default"), o.isMounted && e.$slots.title ? (u(), Y(Ct, { key: 0, to: "#" + o.uid.toString() }, [ V(e.$slots, "title") ], 8, ["to"])) : N("", !0) ], 2); } const Ml = /* @__PURE__ */ ke(Vl, [["render", Nl]]), _l = { components: { Dropdown: Ue }, props: { modelValue: { type: Number, validator: (e) => e >= 0, default: void 0 }, transition: { type: Number, default: 150 }, justified: Boolean, pills: Boolean, stacked: Boolean, customNavClass: { type: null, default: void 0 }, customContentClass: { type: null, default: void 0 }, beforeChange: { type: Function, default: void 0 } }, emits: ["update:modelValue", "change", "changed"], data() { return { tabs: [], activeIndex: 0 // Make v-model not required }; }, computed: { navClasses() { const e = { nav: !0, "nav-justified": this.justified, "nav-tabs": !this.pills, "nav-pills": this.pills, "nav-stacked": this.stacked && this.pills }, t = this.customNavClass; return J(t) ? ue(t) ? { ...e, [t]: !0 } : { ...e, ...t } : e; }, contentClasses() { const e = { "tab-content": !0 }, t = this.customContentClass; return J(t) ? ue(t) ? { ...e, [t]: !0 } : { ...e, ...t } : e; }, groupedTabs() { let e = []; const t = {}; return this.tabs.forEach((l) => { l.group ? (Fe(t, l.group) ? e[t[l.group]].tabs.push(l) : (e.push({ tabs: [l], group: l.group }), t[l.group] = e.length - 1), l.active && (e[t[l.group]].active = !0), l.pullRight && (e[t[l.group]].pullRight = !0)) : e.push(l); }), e = e.map((l) => (Array.isArray(l.tabs) && (l.hidden = l.tabs.filter((n) => n.hidden).length === l.tabs.length), l)), e; } }, watch: { modelValue: { handler(e) { we(e) && (this.activeIndex = e, this.selectCurrent()); }, immediate: !0 }, tabs(e) { e.forEach((t, l) => { t.transition = this.transition, l === this.activeIndex && t.show(); }), this.selectCurrent(); } }, mounted() { this.selectCurrent(); }, methods: { getTabClasses(e, t = !1) { return { ...{ active: e.active, disabled: e.disabled, "pull-right": e.pullRight && !t }, ...e.tabClasses }; }, selectCurrent() { let e = !1; this.tabs.forEach((t, l) => { l === this.activeIndex ? (e = !t.active, t.active = !0) : t.active = !1; }), e && this.$emit("change", this.activeIndex); }, selectValidate(e) { he(this.beforeChange) ? this.beforeChange(this.activeIndex, e, (t) => { J(t) || this.$select(e); }) : this.$select(e); }, select(e) { !this.tabs[e].disabled && e !== this.activeIndex && this.selectValidate(e); }, $select(e) { we(this.modelValue) ? this.$emit("update:modelValue", e) : (this.activeIndex = e, this.selectCurrent()); } } }, Pl = /* @__PURE__ */ r("span", { class: "caret" }, null, -1), Ll = ["onClick"], Dl = ["id", "onClick"], Rl = ["onClick", "textContent"], Al = { key: 0, class: "pull-right" }; function Fl(e, t, l, n, o, s) { const a = $e("dropdown"); return u(), h("section", null, [ r("ul", { class: k(s.navClasses), role: "tablist" }, [ (u(!0), h(F, null, j(s.groupedTabs, (i, d) => (u(), h(F, { key: d }, [ i.tabs ? te((u(), Y(a, { key: 0, role: "presentation", tag: "li", class: k(s.getTabClasses(i)) }, { dropdown: O(() => [ (u(!0), h(F, null, j(i.tabs, (p, f) => te((u(), h("li", { key: `${d}_${f}`, class: k(s.getTabClasses(p, !0)) }, [ r("a", { href: "#", onClick: M((m) => s.select(o.tabs.indexOf(p)), ["prevent"]) }, I(p.title), 9, Ll) ], 2)), [ [ye, !p.hidden] ])), 128)) ]), default: O(() => [ r("a", { class: "dropdown-toggle", role: "tab", href: "#", onClick: t[0] || (t[0] = M(() => { }, ["prevent"])) }, [ q(I(i.group) + " ", 1), Pl ]) ]), _: 2 }, 1032, ["class"])), [ [ye, !i.hidden] ]) : te((u(), h("li", { key: 1, role: "presentation", class: k(s.getTabClasses(i)) }, [ i.$slots.title ? (u(), h("a", { key: 0, id: i.uid, role: "tab", href: "#", onClick: M((p) => s.select(o.tabs.indexOf(i)), ["prevent"]) }, null, 8, Dl)) : (u(), h("a", { key: 1, role: "tab", href: "#", onClick: M((p) => s.select(o.tabs.indexOf(i)), ["prevent"]), textContent: I(i.title) }, null, 8, Rl)) ], 2)), [ [ye, !i.hidden] ]) ], 64))), 128)), !l.justified && e.$slots["nav-right"] ? (u(), h("li", Al, [ V(e.$slots, "nav-right") ])) : N("", !0) ], 2), r("div", { class: k(s.contentClasses) }, [ V(e.$slots, "default") ], 2) ]); } const Ul = /* @__PURE__ */ ke(_l, [["render", Fl]]); function Ce(e, t) { let l = e.toString(); for (let n = t - l.length; n > 0; n--) l = "0" + l; return l; } const Hl = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; function zl(e, t) { return new Date(t, e + 1, 0).getDate(); } function Kl(e, t) { try { const l = e.getFullYear(), n = e.getMonth() + 1, o = e.getDate(), s = Hl[n - 1]; return t.replace(/yyyy/g, l).replace(/MMMM/g, s).replace(/MMM/g, s.substring(0, 3)).replace(/MM/g, Ce(n, 2)).replace(/dd/g, Ce(o, 2)).replace(/yy/g, l).replace(/M(?!a)/g, n).replace(/d/g, o); } catch { return ""; } } function ht(e) { return new Date( e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate(), e.getUTCHours(), e.getUTCMinutes(), e.getUTCSeconds() ); } function Yl(e) { const t = new Date(Date.UTC(e.year, e.month, e.date)); t.setUTCDate(t.getUTCDate() + 4 - (t.getUTCDay() || 7)); const l = new Date(Date.UTC(t.getUTCFullYear(), 0, 1)); return Math.ceil(((t - l) / 864e5 + 1) / 7); } const Wl = { role: "grid", style: { width: "100%" } }, ql = ["colspan"], Gl = { align: "center" }, jl = { key: 0 }, Zl = { class: "uiv-datepicker-week" }, Jl = { key: 0, class: "text-center", style: { "border-right": "1px solid #eee" } }, Xl = { class: "text-muted" }, Ql = { __name: "DateView", props: { month: { type: Number, default: void 0 }, year: { type: Number, default: void 0 }, date: { type: Date, default: void 0 }, today: { type: Date, default: void 0 }, limit: { type: Object, default: void 0 }, weekStartsWith: { type: Number, default: void 0 }, iconControlLeft: { type: String, default: void 0 }, iconControlRight: { type: String, default: void 0 }, dateClass: { type: Function, default: void 0 }, yearMonthFormatter: { type: Function, default: void 0 }, weekNumbers: Boolean }, emits: [ "date-change", "year-change", "month-change", "view-change" ], setup(e, { emit: t }) { const l = e, n = R(() => { const c = []; let y = l.weekStartsWith; for (; c.length < 7; ) c.push(y++), y > 6 && (y = 0); return c; }), o = R(() => l.yearMonthFormatter ? l.yearMonthFormatter(l.year, l.month) : J(l.month) ? `${l.year} ${se(`uiv.datePicker.month${l.month + 1}`)}` : l.year), s = R(() => { var x, C; const c = [], y = new Date(l.year, l.month, 1), g = new Date(l.year, l.month, 0).getDate(), v = y.getDay(), b = zl(l.month, l.year); let S = 0; l.weekStartsWith > v ? S = 7 - l.weekStartsWith : S = 0 - l.weekStartsWith; for (let E = 0; E < 6; E++) { c.push([]); for (let z = 0 - S; z < 7 - S; z++) { const U = E * 7 + z, A = { year: l.year, disabled: !1 }; U < v ? (A.date = g - v + U + 1, l.month > 0 ? A.month = l.month - 1 : (A.month = 11, A.year--)) : U < v + b ? (A.date = U - v + 1, A.month = l.month) : (A.date = U - v - b + 1, l.month < 11 ? A.month = l.month + 1 : (A.month = 0, A.year++)); const oe = new Date(A.year, A.month, A.date); let pe = !0, T = !0; (x = l.limit) != null && x.from && (pe = oe >= l.limit.from), (C = l.limit) != null && C.to && (T = oe < l.limit.to), A.disabled = !pe || !T, he(l.dateClass) ? A.classes = l.dateClass(oe, { currentMonth: l.month, currentYear: l.year }) : A.classes = "", c[E].push(A); } } return c; }); function a(c) { return se(`uiv.datePicker.week${c}`); } function i(c) { return l.date && c.date === l.date.getDate() && c.month === l.date.getMonth() && c.year === l.date.getFullYear() ? "primary" : c.date === l.today.getDate() && c.month === l.today.getMonth() && c.year === l.today.getFullYear() ? "info" : "default"; } function d(c) { t("date-change", c); } function p() { let c = l.month, y = l.year; l.month > 0 ? c-- : (c = 11, y--, t("year-change", y)), t("month-change", c); } function f() { let c = l.month, y = l.year; l.month < 11 ? c++ : (c = 0, y++, t("year-change", y)), t("month-change", c); } function m() { t("view-change", "m"); } return (c, y) => (u(), h("table", Wl, [ r("thead", null, [ r("tr", null, [ r("td", null, [ B(D, { class: "uiv-datepicker-pager-prev", block: "", size: "sm", style: { border: "none" }, onClick: p }, { default: O(() => [ r("i", { class: k(e.iconControlLeft) }, null, 2) ]), _: 1 }) ]), r("td", { colspan: e.weekNumbers ? 6 : 5 }, [ B(D, { class: "uiv-datepicker-title", block: "", size: "sm", style: { border: "none" }, onClick: m }, { default: O(() => [ r("b", null, I($(o)), 1) ]), _: 1 }) ], 8, ql), r("td", null, [ B(D, { class: "uiv-datepicker-pager-next", block: "", size: "sm", style: { border: "none" }, onClick: f }, { default: O(() => [ r("i", { class: k(e.iconControlRight) }, null, 2) ]), _: 1 }) ]) ]), r("tr", Gl, [ e.weekNumbers ? (u(), h("td", jl)) : N("", !0), (u(!0), h(F, null, j($(n), (g, v) => (u(), h("td", { key: v, width: "14.2857142857%" }, [ r("small", Zl, I(a(g === 0 ? 7 : g)), 1) ]))), 128)) ]) ]), r("tbody", null, [ (u(!0), h(F, null, j($(s), (g, v) => (u(), h("tr", { key: v }, [ e.weekNumbers ? (u(), h("td", Jl, [ r("small", Xl, I($(Yl)(g[e.weekStartsWith])), 1) ])) : N("", !0), (u(!0), h(F, null, j(g, (b, S) => (u(), h("td", { key: `${v}_${S}` }, [ B(D, { block: "", size: "sm", style: { border: "none" }, "data-action": "select", class: k(b.classes), type: i(b), disabled: b.disabled, onClick: (x) => d(b) }, { default: O(() => [ r("span", { "data-action": "select", class: k({ "text-muted": e.month !== b.month }) }, I(b.date), 3) ]), _: 2 }, 1032, ["class", "type", "disabled", "onClick"]) ]))), 128)) ]))), 128)) ]) ])); } }, en = { role: "grid", style: { width: "100%" } }, tn = { colspan: "4" }, ln = { __name: "MonthView", props: { month: { type: Number, default: void 0 }, year: { type: Number, default: void 0 }, iconControlLeft: { type: String, default: void 0 }, iconControlRight: { type: String, default: void 0 } }, emits: ["year-change", "month-change", "view-change"], setup(e, { emit: t }) { const l = e, n = Re([]); de(() => { for (let p = 0; p < 4; p++) { n.push([]); for (let f = 0; f < 3; f++) n[p].push(p * 3 + f + 1); } }); function o(p) { return se(`uiv.datePicker.month${p}`); } function s(p) { return p === l.month ? "primary" : "default"; } function a() { t("year-change", l.year - 1); } function i() { t("year-change", l.year + 1); } function d(p) { J(p) ? (t("month-change", p), t("view-change", "d")) : t("view-change", "y"); } return (p, f) => (u(), h("table", en, [ r("thead", null, [ r("tr", null, [ r("td", null, [ B(D, { class: "uiv-datepicker-pager-prev", block: "", size: "sm", style: { border: "none" }, onClick: a }, { default: O(() => [ r("i", { class: k(e.iconControlLeft) }, null, 2) ]), _: 1 }) ]), r("td", tn, [ B(D, { class: "uiv-datepicker-title", block: "", size: "sm", style: { border: "none" }, onClick: f[0] || (f[0] = (m) => d()) }, { default: O(() => [ r("b", null, I(e.year), 1) ]), _: 1 }) ]), r("td", null, [ B(D, { class: "uiv-datepicker-pager-next", block: "", size: "sm", style: { border: "none" }, onClick: i }, { default: O(() => [ r("i", { class: k(e.iconControlRight) }, null, 2) ]), _: 1 }) ]) ]) ]), r("tbody", null, [ (u(!0), h(F, null, j(n, (m, c) => (u(), h("tr", { key: c }, [ (u(!0), h(F, null, j(m, (y, g) => (u(), h("td", { key: `${c}_${g}`, colspan: "2", width: "33.333333%" }, [ B(D, { block: "", size: "sm", style: { border: "none" }, type: s(c * 3 + g), onClick: (v) => d(c * 3 + g) }, { default: O(() => [ r("span", null, I(o(y)), 1) ]), _: 2 }, 1032, ["type", "onClick"]) ]))), 128)) ]))), 128)) ]) ])); } }, nn = { role: "grid", style: { width: "100%" } }, sn = { colspan: "3" }, on = { __name: "YearView", props: { year: { type: Number, default: void 0 }, iconControlLeft: { type: String, default: void 0 }, iconControlRight: { type: String, default: void 0 } }, emits: ["year-change", "view-change"], setup(e, { emit: t }) { const l = e; function n(p) { return p === l.year ? "primary" : "default"; } function o() { t("year-change", l.year - 20); } function s() { t("year-change", l.year + 20); } function a(p) { t("year-change", p), t("view-change", "m"); } const i = R(() => { const p = [], f = l.year - l.year % 20; for (let m = 0; m < 4; m++) { p.push([]); for (let c = 0; c < 5; c++) p[m].push(f + m * 5 + c); } return p; }), d = R(() => { const p = l.year - l.year % 20; return `${p} ~ ${p + 19}`; }); return (p, f) => (u(), h("table", nn, [ r("thead", null, [ r("tr", null, [ r("td", null, [ B(D, { class: "uiv-datepicker-pager-prev", block: "", size: "sm", style: { border: "none" }, onClick: o }, { default: O(() => [ r("i", { class: k(e.iconControlLeft) }, null, 2) ]), _: 1 }) ]), r("td", sn, [ B(D, { class: "uiv-datepicker-title", block: "", size: "sm", style: { border: "none" } }, { default: O(() => [ r("b", null, I($(d)), 1) ]), _: 1 }) ]), r("td", null, [ B(D, { class: "uiv-datepicker-pager-next", block: "", size: "sm", style: { border: "none" }, onClick: s }, { default: O(() => [ r("i", { class: k(e.iconControlRight) }, null, 2) ]), _: 1 }) ]) ]) ]), r("tbody", null, [ (u(!0), h(F, null, j($(i), (m, c) => (u(), h("tr", { key: c }, [ (u(!0), h(F, null, j(m, (y, g) => (u(), h("td", { key: `${c}_${g}`, width: "20%" }, [ B(D, { block: "", size: "sm", style: { border: "none" }, type: n(y), onClick: (v) => a(y) }, { default: O(() => [ r("span", null, I(y), 1) ]), _: 2 }, 1032, ["type", "onClick"]) ]))), 128)) ]))), 128)) ]) ])); } }, an = { key: 0 }, rn = /* @__PURE__ */ r("br", null, null, -1), un = { class: "text-center" }, dn = { __name: "DatePicker", props: { modelValue: { type: null, required: !0 }, width: { type: Number, default: 270 }, todayBtn: { type: Boolean, default: !0 }, clearBtn: { type: Boolean, default: !0 }, closeOnSelected: { type: Boolean, default: !0 }, limitFrom: { type: null, default: void 0 }, limitTo: { type: null, default: void 0 }, format: { type: String, default: "yyyy-MM-dd" }, initialView: { type: String, default: "d" }, dateParser: { type: Function, default: Date.parse }, dateClass: { type: Function, default: void 0 }, yearMonthFormatter: { type: Function, default: void 0 }, weekStartsWith: { type: Number, default: 0, validator(e) { return e >= 0 && e <= 6; } }, weekNumbers: Boolean, iconControlLeft: { type: String, default: "glyphicon glyphicon-chevron-left" }, iconControlRight: { type: String, default: