tedir-select
Advanced tools
Comparing version 0.0.1-alpha-5 to 0.0.1-alpha-6
@@ -1,3 +0,3 @@ | ||
import { defineComponent as A, ref as $, watch as M, computed as T, openBlock as c, createElementBlock as n, normalizeClass as N, createElementVNode as i, normalizeStyle as L, unref as g, Fragment as p, createTextVNode as w, toDisplayString as C, renderList as O, withModifiers as V, renderSlot as _, reactive as E, withDirectives as R, withKeys as H, vModelText as W, pushScopeId as F, popScopeId as D } from "vue"; | ||
const K = { class: "pickerWrap" }, U = { class: "pickerContent" }, P = { class: "pickerHeader" }, q = ["onClick"], G = { class: "check" }, J = ["checked", "id"], Q = ["for"], X = ["onClick"], Y = { class: "check" }, Z = ["checked", "id"], ee = ["for"], le = ["onClick"], te = ["onClick"], ae = ["onClick"], se = ["onClick"], ue = /* @__PURE__ */ A({ | ||
import { defineComponent as z, ref as C, watch as M, computed as B, openBlock as r, createElementBlock as o, normalizeClass as N, createElementVNode as v, normalizeStyle as V, toDisplayString as _, unref as m, Fragment as $, renderList as O, withModifiers as x, renderSlot as L, reactive as E, createTextVNode as R, withDirectives as F, withKeys as H, vModelText as W, pushScopeId as D, popScopeId as K } from "vue"; | ||
const U = { class: "pickerWrap" }, P = { class: "pickerContent" }, q = { class: "pickerHeader" }, G = ["onClick"], J = { class: "check" }, Q = ["checked", "id"], X = ["for"], Y = ["onClick"], Z = { class: "check" }, ee = ["checked", "id"], le = ["for"], te = ["onClick"], ae = ["onClick"], se = ["onClick"], ue = ["onClick"], ce = /* @__PURE__ */ z({ | ||
__name: "SelectBox", | ||
@@ -15,74 +15,72 @@ props: { | ||
emits: ["update:modelValue", "change", "search"], | ||
setup(s, { emit: h }) { | ||
const d = s, e = $(d.modelValue || {}), r = $(!1), k = $(""), m = $(null), I = $(void 0); | ||
M(() => d.modelValue, () => { | ||
e.value = d.modelValue; | ||
setup(u, { emit: k }) { | ||
const c = u, e = C(c.modelValue || {}), i = C(!1), h = C(""), b = C(null), w = C(void 0); | ||
M(() => c.modelValue, () => { | ||
e.value = c.modelValue; | ||
}); | ||
const j = () => { | ||
clearTimeout(I.value), I.value = setTimeout(() => { | ||
var l, t; | ||
k.value = "", ((l = m.value) == null ? void 0 : l.value) && ((t = m.value) == null ? void 0 : t.value) !== "" && (k.value = m.value.value), h("search", k.value); | ||
clearTimeout(w.value), w.value = setTimeout(() => { | ||
var a, t; | ||
h.value = "", ((a = b.value) == null ? void 0 : a.value) && ((t = b.value) == null ? void 0 : t.value) !== "" && (h.value = b.value.value), k("search", h.value); | ||
}, 500); | ||
}, S = T(() => { | ||
let l = d.options; | ||
return k.value.length >= 1 && (l = l.filter((t) => { | ||
if (isNaN(t) === !1 && Number(t) === Number(k.value)) | ||
}, S = B(() => { | ||
let a = c.options; | ||
return h.value.length >= 1 && (a = a.filter((t) => { | ||
if (isNaN(t) === !1 && Number(t) === Number(h.value)) | ||
return !0; | ||
if (typeof t == "string" && t.toLowerCase().includes(k.value.toLowerCase())) | ||
if (typeof t == "string" && t.toLowerCase().includes(h.value.toLowerCase())) | ||
return !0; | ||
if (typeof t == "object" && t !== null && Object.prototype.toString.call(t) === "[object Object]") | ||
for (const a of Object.keys(t)) { | ||
if (isNaN(t[a]) === !1 && Number(t[a]) === Number(k.value)) | ||
for (const l of Object.keys(t)) { | ||
if (isNaN(t[l]) === !1 && Number(t[l]) === Number(h.value)) | ||
return !0; | ||
if (typeof t[a] == "string" && t[a].toLowerCase().includes(k.value.toLowerCase())) | ||
if (typeof t[l] == "string" && t[l].toLowerCase().includes(h.value.toLowerCase())) | ||
return !0; | ||
} | ||
return !1; | ||
})), l; | ||
}), y = ((l = 10) => { | ||
let t = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", a = ""; | ||
for (let u = 0; u < l; u++) | ||
a += t.charAt(Math.floor(Math.random() * t.length)); | ||
})), a; | ||
}), y = ((a = 10) => { | ||
let t = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", l = ""; | ||
for (let n = 0; n < a; n++) | ||
l += t.charAt(Math.floor(Math.random() * t.length)); | ||
return l; | ||
})(), f = (a) => { | ||
var t; | ||
a.target.style.display = "none", i.value = !1, (t = b.value) != null && t.value && (b.value.value = "", h.value = ""); | ||
}, p = (a, t = "") => { | ||
t !== "" ? e.value.map((l) => l[t]).includes(a[t]) ? e.value.splice(e.value.findIndex((l) => l[t] === a[t]), 1) : e.value.push(a) : e.value.includes(a) ? e.value.splice(e.value.findIndex((l) => l === a), 1) : e.value.push(a), k("update:modelValue", e.value), k("change", e.value, a); | ||
}, d = (a) => { | ||
typeof a == "object" && a !== null && String(c.datatype).toLowerCase() === "string" ? (e.value = a[String(c.dataprop || c.prop)], k("update:modelValue", String(e.value))) : typeof a == "object" && a !== null && String(c.datatype).toLowerCase() === "number" ? (e.value = a[String(c.dataprop || c.prop)], k("update:modelValue", Number(e.value))) : (e.value = a, k("update:modelValue", e.value)), i.value = !1, k("change", e.value, a); | ||
}, s = B(() => { | ||
let a = (c == null ? void 0 : c.placeholder) || "-- Select option --"; | ||
if (S.value.length >= 1) | ||
if (typeof e.value == "number") { | ||
let t = S.value.filter((l) => Number(l[String(c.dataprop || c.prop)]) === Number(e.value)); | ||
typeof S.value[0] == "object" && t.length >= 1 ? a = t[0][String(c.prop)] : typeof S.value[0] == "number" && (a = e.value); | ||
} else if (typeof e.value == "string") { | ||
let t = S.value.filter((l) => String(l[String(c.dataprop || c.prop)]) === e.value); | ||
typeof S.value[0] == "object" && t.length >= 1 ? a = t[0][String(c.prop)] : typeof S.value[0] == "string" && e.value !== "" && (a = e.value); | ||
} else | ||
typeof e.value == "object" && (Array.isArray(e.value) && e.value.length >= 1 ? typeof e.value[0] == "object" && String(c.prop) in e.value[0] ? a = e.value.map((t) => t[String(c.prop)]).join(", ") : a = e.value.join(", ") : e.value !== null && String(c.prop) in e.value && (a = e.value[String(c.prop)])); | ||
return a; | ||
})(), v = (l) => { | ||
var t; | ||
l.target.style.display = "none", r.value = !1, (t = m.value) != null && t.value && (m.value.value = "", k.value = ""); | ||
}, f = (l, t = "") => { | ||
t !== "" ? e.value.map((a) => a[t]).includes(l[t]) ? e.value.splice(e.value.findIndex((a) => a[t] === l[t]), 1) : e.value.push(l) : e.value.includes(l) ? e.value.splice(e.value.findIndex((a) => a === l), 1) : e.value.push(l), h("update:modelValue", e.value), h("change", e.value, l); | ||
}, o = (l) => { | ||
typeof l == "object" && l !== null && String(d.datatype).toLowerCase() === "string" ? (e.value = l[String(d.dataprop || d.prop)], h("update:modelValue", String(e.value))) : typeof l == "object" && l !== null && String(d.datatype).toLowerCase() === "number" ? (e.value = l[String(d.dataprop || d.prop)], h("update:modelValue", Number(e.value))) : (e.value = l, h("update:modelValue", e.value)), r.value = !1, h("change", e.value, l); | ||
}; | ||
return (l, t) => (c(), n("div", { | ||
class: N(["picker suggestion", r.value ? "active" : ""]) | ||
}); | ||
return (a, t) => (r(), o("div", { | ||
class: N(["picker suggestion", i.value ? "active" : ""]) | ||
}, [ | ||
i("div", { | ||
v("div", { | ||
class: "pickerBackdrop", | ||
style: L({ display: r.value ? "block" : "none" }), | ||
onClick: v | ||
style: V({ display: i.value ? "block" : "none" }), | ||
onClick: f | ||
}, null, 4), | ||
i("div", K, [ | ||
i("div", { | ||
v("div", U, [ | ||
v("div", { | ||
class: "select pickerToggler", | ||
onClick: t[0] || (t[0] = (a) => r.value = !r.value) | ||
}, [ | ||
typeof e.value == "string" && e.value !== "" && g(S).length >= 1 && typeof g(S)[0] == "string" ? (c(), n(p, { key: 0 }, [ | ||
w(C(e.value), 1) | ||
], 64)) : typeof e.value == "string" && g(S).filter((a) => String(a[String(s.dataprop || s.prop)]) === e.value).length >= 1 && typeof g(S).filter((a) => String(a[String(s.dataprop || s.prop)]) === e.value)[0] == "object" ? (c(), n(p, { key: 1 }, [ | ||
w(C(g(S).filter((a) => String(a[String(s.dataprop || s.prop)]) === e.value)[0][s.prop]), 1) | ||
], 64)) : typeof e.value == "object" && e.value !== null && s.prop in e.value ? (c(), n(p, { key: 2 }, [ | ||
w(C(e.value[s.prop]), 1) | ||
], 64)) : Array.isArray(e.value) && e.value.length >= 1 && typeof e.value[0] == "string" ? (c(), n(p, { key: 3 }, [ | ||
w(C(e.value.join(", ")), 1) | ||
], 64)) : Array.isArray(e.value) && e.value.length >= 1 && typeof e.value[0] == "object" && s.prop in e.value[0] ? (c(), n(p, { key: 4 }, [ | ||
w(C(e.value.map((a) => a[s.prop]).join(", ")), 1) | ||
], 64)) : (c(), n(p, { key: 5 }, [ | ||
w(C(s.placeholder), 1) | ||
], 64)) | ||
]), | ||
i("div", U, [ | ||
i("div", P, [ | ||
i("input", { | ||
onClick: t[0] || (t[0] = (l) => i.value = !i.value) | ||
}, _(m(s)), 1), | ||
v("div", P, [ | ||
v("div", q, [ | ||
v("input", { | ||
type: "search", | ||
ref_key: "searchRef", | ||
ref: m, | ||
ref: b, | ||
onInput: j, | ||
@@ -92,85 +90,85 @@ class: "input" | ||
]), | ||
Array.isArray(e.value) ? (c(), n("div", { | ||
Array.isArray(e.value) ? (r(), o("div", { | ||
key: 0, | ||
class: "pickerMenu", | ||
style: L({ "max-height": Number(s.size) !== 0 ? Number(s.size) * 42 + "px" : "auto" }) | ||
style: V({ "max-height": Number(u.size) !== 0 ? Number(u.size) * 42 + "px" : "auto" }) | ||
}, [ | ||
(c(!0), n(p, null, O(g(S), (a, u) => (c(), n(p, { | ||
key: "option-" + a | ||
(r(!0), o($, null, O(m(S), (l, n) => (r(), o($, { | ||
key: "option-" + l | ||
}, [ | ||
typeof a == "string" && s.type !== "slot" ? (c(), n("div", { | ||
typeof l == "string" && u.type !== "slot" ? (r(), o("div", { | ||
key: 0, | ||
onClick: V((x) => f(a), ["stop"]), | ||
onClick: x((I) => p(l), ["stop"]), | ||
class: "pickerItem" | ||
}, [ | ||
i("div", G, [ | ||
i("input", { | ||
v("div", J, [ | ||
v("input", { | ||
type: "checkbox", | ||
class: "checkInput", | ||
checked: e.value.includes(a), | ||
id: "check-" + (g(y) + String(u)), | ||
checked: e.value.includes(l), | ||
id: "check-" + (m(y) + String(n)), | ||
style: { "pointer-events": "none" } | ||
}, null, 8, J), | ||
i("label", { | ||
}, null, 8, Q), | ||
v("label", { | ||
class: "checkLabel", | ||
for: "check-" + (g(y) + String(u)), | ||
for: "check-" + (m(y) + String(n)), | ||
style: { "pointer-events": "none" } | ||
}, C(a), 9, Q) | ||
}, _(l), 9, X) | ||
]) | ||
], 8, q)) : typeof a == "object" && a !== null && s.prop in a && s.type !== "slot" ? (c(), n("div", { | ||
], 8, G)) : typeof l == "object" && l !== null && u.prop in l && u.type !== "slot" ? (r(), o("div", { | ||
key: 1, | ||
onClick: V((x) => f(a, s.prop), ["stop"]), | ||
onClick: x((I) => p(l, u.prop), ["stop"]), | ||
class: "pickerItem" | ||
}, [ | ||
i("div", Y, [ | ||
i("input", { | ||
v("div", Z, [ | ||
v("input", { | ||
type: "checkbox", | ||
class: "checkInput", | ||
checked: e.value.includes(a), | ||
id: "check-" + (g(y) + String(u)), | ||
checked: e.value.includes(l), | ||
id: "check-" + (m(y) + String(n)), | ||
style: { "pointer-events": "none" } | ||
}, null, 8, Z), | ||
i("label", { | ||
}, null, 8, ee), | ||
v("label", { | ||
class: "checkLabel", | ||
for: "check-" + (g(y) + String(u)), | ||
for: "check-" + (m(y) + String(n)), | ||
style: { "pointer-events": "none" } | ||
}, C(a[s.prop]), 9, ee) | ||
}, _(l[u.prop]), 9, le) | ||
]) | ||
], 8, X)) : (c(), n("div", { | ||
], 8, Y)) : (r(), o("div", { | ||
key: 2, | ||
onClick: V((x) => f(a), ["stop"]), | ||
onClick: x((I) => p(l), ["stop"]), | ||
class: "pickerItem" | ||
}, [ | ||
_(l.$slots, "default", { | ||
option: a, | ||
L(a.$slots, "default", { | ||
option: l, | ||
selected: e.value | ||
}, void 0, !0) | ||
], 8, le)) | ||
], 8, te)) | ||
], 64))), 128)) | ||
], 4)) : (c(), n("div", { | ||
], 4)) : (r(), o("div", { | ||
key: 1, | ||
class: "pickerMenu", | ||
style: L({ "max-height": Number(s.size) !== 0 ? Number(s.size) * 42 + "px" : "auto" }) | ||
style: V({ "max-height": Number(u.size) !== 0 ? Number(u.size) * 42 + "px" : "auto" }) | ||
}, [ | ||
(c(!0), n(p, null, O(g(S), (a, u) => (c(), n(p, { | ||
key: "option-" + a | ||
(r(!0), o($, null, O(m(S), (l, n) => (r(), o($, { | ||
key: "option-" + l | ||
}, [ | ||
typeof a == "string" && s.type !== "slot" ? (c(), n("div", { | ||
typeof l == "string" && u.type !== "slot" ? (r(), o("div", { | ||
key: 0, | ||
onClick: (x) => o(a), | ||
class: N(["pickerItem", e.value === a ? "active" : ""]) | ||
}, C(a), 11, te)) : typeof a == "object" && a !== null && s.prop in a && s.type !== "slot" ? (c(), n("div", { | ||
onClick: (I) => d(l), | ||
class: N(["pickerItem", e.value === l ? "active" : ""]) | ||
}, _(l), 11, ae)) : typeof l == "object" && l !== null && u.prop in l && u.type !== "slot" ? (r(), o("div", { | ||
key: 1, | ||
onClick: (x) => o(a), | ||
class: N(["pickerItem", e.value[s.prop] === a[s.prop] || String(a[s.dataprop || s.prop]) === String(e.value) ? "active" : ""]) | ||
}, C(a[s.prop]), 11, ae)) : (c(), n("div", { | ||
onClick: (I) => d(l), | ||
class: N(["pickerItem", e.value[u.prop] === l[u.prop] || String(l[u.dataprop || u.prop]) === String(e.value) ? "active" : ""]) | ||
}, _(l[u.prop]), 11, se)) : (r(), o("div", { | ||
key: 2, | ||
onClick: V((x) => o(a), ["stop"]), | ||
class: N(["pickerItem", e.value === a ? "active" : ""]) | ||
onClick: x((I) => d(l), ["stop"]), | ||
class: N(["pickerItem", e.value === l ? "active" : ""]) | ||
}, [ | ||
_(l.$slots, "default", { | ||
option: a, | ||
L(a.$slots, "default", { | ||
option: l, | ||
selected: e.value | ||
}, void 0, !0) | ||
], 10, se)) | ||
], 10, ue)) | ||
], 64))), 128)) | ||
@@ -183,8 +181,8 @@ ], 4)) | ||
}); | ||
const z = (s, h) => { | ||
const d = s.__vccOpts || s; | ||
for (const [e, r] of h) | ||
d[e] = r; | ||
return d; | ||
}, sl = /* @__PURE__ */ z(ue, [["__scopeId", "data-v-50169185"]]), ce = { class: "pickerWrap" }, ne = { class: "pickerContent pickerSizing" }, re = ["onClick"], oe = ["onClick"], ie = ["onClick"], de = /* @__PURE__ */ A({ | ||
const A = (u, k) => { | ||
const c = u.__vccOpts || u; | ||
for (const [e, i] of k) | ||
c[e] = i; | ||
return c; | ||
}, ul = /* @__PURE__ */ A(ce, [["__scopeId", "data-v-f5c4006d"]]), ne = { class: "pickerWrap" }, re = { class: "pickerContent pickerSizing" }, oe = ["onClick"], ie = ["onClick"], de = ["onClick"], ve = /* @__PURE__ */ z({ | ||
__name: "ComboBox", | ||
@@ -200,78 +198,78 @@ props: { | ||
emits: ["update:modelValue", "search"], | ||
setup(s, { emit: h }) { | ||
const d = s, e = $(!1), r = $(""), k = $(null), m = $(void 0), I = T(() => { | ||
let b = d.options; | ||
return r.value.length >= 1 && (b = b.filter((y) => { | ||
if (isNaN(y) === !1 && Number(y) === Number(r.value)) | ||
setup(u, { emit: k }) { | ||
const c = u, e = C(!1), i = C(""), h = C(null), b = C(void 0), w = B(() => { | ||
let g = c.options; | ||
return i.value.length >= 1 && (g = g.filter((y) => { | ||
if (isNaN(y) === !1 && Number(y) === Number(i.value)) | ||
return !0; | ||
if (typeof y == "string" && y.toLowerCase().includes(r.value.toLowerCase())) | ||
if (typeof y == "string" && y.toLowerCase().includes(i.value.toLowerCase())) | ||
return !0; | ||
if (typeof y == "object" && y !== null && Object.prototype.toString.call(y) === "[object Object]") | ||
for (const v of Object.keys(y)) { | ||
if (isNaN(y[v]) === !1 && Number(y[v]) === Number(r.value)) | ||
for (const f of Object.keys(y)) { | ||
if (isNaN(y[f]) === !1 && Number(y[f]) === Number(i.value)) | ||
return !0; | ||
if (typeof y[v] == "string" && y[v].toLowerCase().includes(r.value.toLowerCase())) | ||
if (typeof y[f] == "string" && y[f].toLowerCase().includes(i.value.toLowerCase())) | ||
return !0; | ||
} | ||
return !1; | ||
})), b; | ||
})), g; | ||
}), j = () => { | ||
clearTimeout(m.value), m.value = setTimeout(() => { | ||
var b, y; | ||
r.value = "", ((b = k.value) == null ? void 0 : b.value) && ((y = k.value) == null ? void 0 : y.value) !== "" && (r.value = k.value.value), h("search", r.value), I.value.length >= 1 && r.value !== "" ? e.value = !0 : e.value = !1; | ||
clearTimeout(b.value), b.value = setTimeout(() => { | ||
var g, y; | ||
i.value = "", ((g = h.value) == null ? void 0 : g.value) && ((y = h.value) == null ? void 0 : y.value) !== "" && (i.value = h.value.value), k("search", i.value), w.value.length >= 1 && i.value !== "" ? e.value = !0 : e.value = !1; | ||
}, 500); | ||
}, S = (b) => { | ||
b.target.style.display = "none", e.value = !1; | ||
}, S = (g) => { | ||
g.target.style.display = "none", e.value = !1; | ||
}; | ||
return (b, y) => (c(), n("div", { | ||
return (g, y) => (r(), o("div", { | ||
class: N(["picker suggestion", e.value ? "active" : ""]) | ||
}, [ | ||
i("div", { | ||
v("div", { | ||
class: "pickerBackdrop", | ||
style: L({ display: e.value ? "block" : "none" }), | ||
style: V({ display: e.value ? "block" : "none" }), | ||
onClick: S | ||
}, null, 4), | ||
i("div", ce, [ | ||
s.select ? (c(), n("input", { | ||
v("div", ne, [ | ||
u.select ? (r(), o("input", { | ||
key: 0, | ||
type: "search", | ||
ref_key: "searchRef", | ||
ref: k, | ||
ref: h, | ||
onInput: j, | ||
onClick: y[0] || (y[0] = (v) => e.value = !0), | ||
onClick: y[0] || (y[0] = (f) => e.value = !0), | ||
class: "select" | ||
}, null, 544)) : (c(), n("input", { | ||
}, null, 544)) : (r(), o("input", { | ||
key: 1, | ||
type: "search", | ||
ref_key: "searchRef", | ||
ref: k, | ||
ref: h, | ||
onInput: j, | ||
onClick: y[1] || (y[1] = (v) => g(I).length >= 1 && r.value !== "" ? e.value = !0 : e.value = !1), | ||
onClick: y[1] || (y[1] = (f) => m(w).length >= 1 && i.value !== "" ? e.value = !0 : e.value = !1), | ||
class: "input" | ||
}, null, 544)), | ||
i("div", ne, [ | ||
(c(!0), n(p, null, O(g(I), (v, f) => (c(), n(p, { | ||
key: "option-" + v | ||
v("div", re, [ | ||
(r(!0), o($, null, O(m(w), (f, p) => (r(), o($, { | ||
key: "option-" + f | ||
}, [ | ||
typeof v == "string" ? (c(), n("div", { | ||
typeof f == "string" ? (r(), o("div", { | ||
key: 0, | ||
onClick: (o) => { | ||
r.value = v, h("update:modelValue", v), e.value = !1; | ||
onClick: (d) => { | ||
i.value = f, k("update:modelValue", f), e.value = !1; | ||
}, | ||
class: N(["pickerItem", s.modelValue === v ? "active" : ""]) | ||
}, C(v), 11, re)) : typeof v == "object" && s.prop in v ? (c(), n("div", { | ||
class: N(["pickerItem", u.modelValue === f ? "active" : ""]) | ||
}, _(f), 11, oe)) : typeof f == "object" && u.prop in f ? (r(), o("div", { | ||
key: 1, | ||
onClick: (o) => { | ||
r.value = v[s.prop], h("update:modelValue", v), e.value = !1; | ||
onClick: (d) => { | ||
i.value = f[u.prop], k("update:modelValue", f), e.value = !1; | ||
}, | ||
class: N(["pickerItem", s.modelValue[s.prop] === v[s.prop] ? "active" : ""]) | ||
}, C(v[s.prop]), 11, oe)) : (c(), n("div", { | ||
class: N(["pickerItem", u.modelValue[u.prop] === f[u.prop] ? "active" : ""]) | ||
}, _(f[u.prop]), 11, ie)) : (r(), o("div", { | ||
key: 2, | ||
onClick: (o) => { | ||
r.value = v, h("update:modelValue", v), e.value = !1; | ||
onClick: (d) => { | ||
i.value = f, k("update:modelValue", f), e.value = !1; | ||
}, | ||
class: N(["pickerItem", s.modelValue === v ? "active" : ""]) | ||
class: N(["pickerItem", u.modelValue === f ? "active" : ""]) | ||
}, [ | ||
_(b.$slots, "default", { option: v }, void 0, !0) | ||
], 10, ie)) | ||
L(g.$slots, "default", { option: f }, void 0, !0) | ||
], 10, de)) | ||
], 64))), 128)) | ||
@@ -283,3 +281,3 @@ ]) | ||
}); | ||
const ul = /* @__PURE__ */ z(de, [["__scopeId", "data-v-f7a05695"]]), ve = { class: "list" }, fe = { class: "listHeader" }, ke = ["onClick"], he = { class: "check" }, ye = ["checked", "id"], pe = ["for"], ge = ["onClick"], Ce = { class: "check" }, be = ["checked", "id"], me = ["for"], $e = ["onClick"], Se = ["onClick"], Ne = ["onClick"], Ie = ["onClick"], je = /* @__PURE__ */ A({ | ||
const cl = /* @__PURE__ */ A(ve, [["__scopeId", "data-v-f7a05695"]]), fe = { class: "list" }, pe = { class: "listHeader" }, he = ["onClick"], ke = { class: "check" }, ye = ["checked", "id"], ge = ["for"], be = ["onClick"], Ce = { class: "check" }, me = ["checked", "id"], Se = ["for"], _e = ["onClick"], $e = ["onClick"], Ne = ["onClick"], we = ["onClick"], je = /* @__PURE__ */ z({ | ||
__name: "ListBox", | ||
@@ -295,132 +293,132 @@ props: { | ||
emits: ["update:modelValue", "change", "search"], | ||
setup(s, { emit: h }) { | ||
const d = s, e = $(d.modelValue || {}), r = $(""), k = $(null), m = $(void 0); | ||
M(() => d.modelValue, () => { | ||
e.value = d.modelValue; | ||
setup(u, { emit: k }) { | ||
const c = u, e = C(c.modelValue || {}), i = C(""), h = C(null), b = C(void 0); | ||
M(() => c.modelValue, () => { | ||
e.value = c.modelValue; | ||
}); | ||
const I = () => { | ||
clearTimeout(m.value), m.value = setTimeout(() => { | ||
var f, o; | ||
r.value = "", ((f = k.value) == null ? void 0 : f.value) && ((o = k.value) == null ? void 0 : o.value) !== "" && (r.value = k.value.value), h("search", r.value); | ||
const w = () => { | ||
clearTimeout(b.value), b.value = setTimeout(() => { | ||
var p, d; | ||
i.value = "", ((p = h.value) == null ? void 0 : p.value) && ((d = h.value) == null ? void 0 : d.value) !== "" && (i.value = h.value.value), k("search", i.value); | ||
}, 500); | ||
}, j = T(() => { | ||
let f = d.options; | ||
return r.value.length >= 1 && (f = f.filter((o) => { | ||
if (isNaN(o) === !1 && Number(o) === Number(r.value)) | ||
}, j = B(() => { | ||
let p = c.options; | ||
return i.value.length >= 1 && (p = p.filter((d) => { | ||
if (isNaN(d) === !1 && Number(d) === Number(i.value)) | ||
return !0; | ||
if (typeof o == "string" && o.toLowerCase().includes(r.value.toLowerCase())) | ||
if (typeof d == "string" && d.toLowerCase().includes(i.value.toLowerCase())) | ||
return !0; | ||
if (typeof o == "object" && o !== null && Object.prototype.toString.call(o) === "[object Object]") | ||
for (const l of Object.keys(o)) { | ||
if (isNaN(o[l]) === !1 && Number(o[l]) === Number(r.value)) | ||
if (typeof d == "object" && d !== null && Object.prototype.toString.call(d) === "[object Object]") | ||
for (const s of Object.keys(d)) { | ||
if (isNaN(d[s]) === !1 && Number(d[s]) === Number(i.value)) | ||
return !0; | ||
if (typeof o[l] == "string" && o[l].toLowerCase().includes(r.value.toLowerCase())) | ||
if (typeof d[s] == "string" && d[s].toLowerCase().includes(i.value.toLowerCase())) | ||
return !0; | ||
} | ||
return !1; | ||
})), f; | ||
}), b = (() => { | ||
let f = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", o = ""; | ||
for (let l = 0; l < 10; l++) | ||
o += f.charAt(Math.floor(Math.random() * f.length)); | ||
return o; | ||
})(), y = (f, o = "") => { | ||
o !== "" ? e.value.map((l) => l[o]).includes(f[o]) ? e.value.splice(e.value.findIndex((l) => l[o] === f[o]), 1) : e.value.push(f) : e.value.includes(f) ? e.value.splice(e.value.findIndex((l) => l === f), 1) : e.value.push(f), h("update:modelValue", e.value), h("change", e.value, f); | ||
}, v = (f) => { | ||
typeof f == "object" && f !== null && String(d.datatype).toLowerCase() === "string" ? (e.value = f[String(d.dataprop || d.prop)], h("update:modelValue", String(e.value))) : typeof f == "object" && f !== null && String(d.datatype).toLowerCase() === "number" ? (e.value = f[String(d.dataprop || d.prop)], h("update:modelValue", Number(e.value))) : (e.value = f, h("update:modelValue", e.value)), h("change", e.value, f); | ||
})), p; | ||
}), g = (() => { | ||
let p = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", d = ""; | ||
for (let s = 0; s < 10; s++) | ||
d += p.charAt(Math.floor(Math.random() * p.length)); | ||
return d; | ||
})(), y = (p, d = "") => { | ||
d !== "" ? e.value.map((s) => s[d]).includes(p[d]) ? e.value.splice(e.value.findIndex((s) => s[d] === p[d]), 1) : e.value.push(p) : e.value.includes(p) ? e.value.splice(e.value.findIndex((s) => s === p), 1) : e.value.push(p), k("update:modelValue", e.value), k("change", e.value, p); | ||
}, f = (p) => { | ||
typeof p == "object" && p !== null && String(c.datatype).toLowerCase() === "string" ? (e.value = p[String(c.dataprop || c.prop)], k("update:modelValue", String(e.value))) : typeof p == "object" && p !== null && String(c.datatype).toLowerCase() === "number" ? (e.value = p[String(c.dataprop || c.prop)], k("update:modelValue", Number(e.value))) : (e.value = p, k("update:modelValue", e.value)), k("change", e.value, p); | ||
}; | ||
return (f, o) => (c(), n("div", null, [ | ||
i("div", ve, [ | ||
i("div", fe, [ | ||
i("input", { | ||
return (p, d) => (r(), o("div", null, [ | ||
v("div", fe, [ | ||
v("div", pe, [ | ||
v("input", { | ||
type: "search", | ||
ref_key: "searchRef", | ||
ref: k, | ||
onInput: I, | ||
ref: h, | ||
onInput: w, | ||
class: "input" | ||
}, null, 544) | ||
]), | ||
Array.isArray(s.modelValue) ? (c(), n("div", { | ||
Array.isArray(u.modelValue) ? (r(), o("div", { | ||
key: 0, | ||
class: "listMenu", | ||
style: L({ "max-height": Number(s.size) !== 0 ? Number(s.size) * 44 + "px" : "auto" }) | ||
style: V({ "max-height": Number(u.size) !== 0 ? Number(u.size) * 44 + "px" : "auto" }) | ||
}, [ | ||
(c(!0), n(p, null, O(g(j), (l, t) => (c(), n(p, { | ||
key: "option-" + l | ||
(r(!0), o($, null, O(m(j), (s, a) => (r(), o($, { | ||
key: "option-" + s | ||
}, [ | ||
typeof l == "string" ? (c(), n("div", { | ||
typeof s == "string" ? (r(), o("div", { | ||
key: 0, | ||
onClick: V((a) => y(l), ["stop"]), | ||
onClick: x((t) => y(s), ["stop"]), | ||
class: "listItem" | ||
}, [ | ||
i("div", he, [ | ||
i("input", { | ||
v("div", ke, [ | ||
v("input", { | ||
type: "checkbox", | ||
class: "checkInput", | ||
checked: e.value.includes(l), | ||
id: "check-" + (g(b) + String(t)), | ||
checked: e.value.includes(s), | ||
id: "check-" + (m(g) + String(a)), | ||
style: { "pointer-events": "none" } | ||
}, null, 8, ye), | ||
i("label", { | ||
v("label", { | ||
class: "checkLabel", | ||
for: "check-" + (g(b) + String(t)), | ||
for: "check-" + (m(g) + String(a)), | ||
style: { "pointer-events": "none" } | ||
}, C(l), 9, pe) | ||
}, _(s), 9, ge) | ||
]) | ||
], 8, ke)) : typeof l == "object" && s.prop in l ? (c(), n("div", { | ||
], 8, he)) : typeof s == "object" && u.prop in s ? (r(), o("div", { | ||
key: 1, | ||
onClick: V((a) => y(l, s.prop), ["stop"]), | ||
onClick: x((t) => y(s, u.prop), ["stop"]), | ||
class: "listItem" | ||
}, [ | ||
i("div", Ce, [ | ||
i("input", { | ||
v("div", Ce, [ | ||
v("input", { | ||
type: "checkbox", | ||
class: "checkInput", | ||
checked: e.value.includes(l), | ||
id: "check-" + (g(b) + String(t)), | ||
checked: e.value.includes(s), | ||
id: "check-" + (m(g) + String(a)), | ||
style: { "pointer-events": "none" } | ||
}, null, 8, be), | ||
i("label", { | ||
}, null, 8, me), | ||
v("label", { | ||
class: "checkLabel", | ||
for: "check-" + (g(b) + String(t)), | ||
for: "check-" + (m(g) + String(a)), | ||
style: { "pointer-events": "none" } | ||
}, C(l[s.prop]), 9, me) | ||
}, _(s[u.prop]), 9, Se) | ||
]) | ||
], 8, ge)) : (c(), n("div", { | ||
], 8, be)) : (r(), o("div", { | ||
key: 2, | ||
onClick: V((a) => y(l), ["stop"]), | ||
class: N(["listItem", e.value.includes(l) ? "active" : ""]) | ||
onClick: x((t) => y(s), ["stop"]), | ||
class: N(["listItem", e.value.includes(s) ? "active" : ""]) | ||
}, [ | ||
_(f.$slots, "default", { | ||
option: l, | ||
L(p.$slots, "default", { | ||
option: s, | ||
selected: e.value | ||
}, void 0, !0) | ||
], 10, $e)) | ||
], 10, _e)) | ||
], 64))), 128)) | ||
], 4)) : (c(), n("div", { | ||
], 4)) : (r(), o("div", { | ||
key: 1, | ||
class: "listMenu", | ||
style: L({ "max-height": Number(s.size) !== 0 ? Number(s.size) * 44 + "px" : "auto" }) | ||
style: V({ "max-height": Number(u.size) !== 0 ? Number(u.size) * 44 + "px" : "auto" }) | ||
}, [ | ||
(c(!0), n(p, null, O(g(j), (l, t) => (c(), n(p, { | ||
key: "option-" + l | ||
(r(!0), o($, null, O(m(j), (s, a) => (r(), o($, { | ||
key: "option-" + s | ||
}, [ | ||
typeof l == "string" ? (c(), n("div", { | ||
typeof s == "string" ? (r(), o("div", { | ||
key: 0, | ||
onClick: (a) => v(l), | ||
class: N(["listItem", e.value === l ? "active" : ""]) | ||
}, C(l), 11, Se)) : typeof l == "object" && s.prop in l ? (c(), n("div", { | ||
onClick: (t) => f(s), | ||
class: N(["listItem", e.value === s ? "active" : ""]) | ||
}, _(s), 11, $e)) : typeof s == "object" && u.prop in s ? (r(), o("div", { | ||
key: 1, | ||
onClick: (a) => v(l), | ||
class: N(["listItem", e.value[s.prop] === l[s.prop] || String(l[s.dataprop || s.prop]) === String(e.value) ? "active" : ""]) | ||
}, C(l[s.prop]), 11, Ne)) : (c(), n("div", { | ||
onClick: (t) => f(s), | ||
class: N(["listItem", e.value[u.prop] === s[u.prop] || String(s[u.dataprop || u.prop]) === String(e.value) ? "active" : ""]) | ||
}, _(s[u.prop]), 11, Ne)) : (r(), o("div", { | ||
key: 2, | ||
onClick: V((a) => v(l), ["stop"]), | ||
class: N(["listItem", e.value === l ? "active" : ""]) | ||
onClick: x((t) => f(s), ["stop"]), | ||
class: N(["listItem", e.value === s ? "active" : ""]) | ||
}, [ | ||
_(f.$slots, "default", { | ||
option: l, | ||
L(p.$slots, "default", { | ||
option: s, | ||
selected: e.value | ||
}, void 0, !0) | ||
], 10, Ie)) | ||
], 10, we)) | ||
], 64))), 128)) | ||
@@ -432,3 +430,3 @@ ], 4)) | ||
}); | ||
const cl = /* @__PURE__ */ z(je, [["__scopeId", "data-v-d7fed8bc"]]), we = (s) => (F("data-v-3acd22f1"), s = s(), D(), s), xe = { class: "tagWrap" }, Ve = { class: "tags" }, Le = { class: "tag groupItem" }, Oe = ["onClick"], _e = /* @__PURE__ */ we(() => /* @__PURE__ */ i("svg", { | ||
const nl = /* @__PURE__ */ A(je, [["__scopeId", "data-v-d7fed8bc"]]), Ie = (u) => (D("data-v-3acd22f1"), u = u(), K(), u), xe = { class: "tagWrap" }, Ve = { class: "tags" }, Oe = { class: "tag groupItem" }, Le = ["onClick"], Be = /* @__PURE__ */ Ie(() => /* @__PURE__ */ v("svg", { | ||
xmlns: "http://www.w3.org/2000/svg", | ||
@@ -444,3 +442,3 @@ width: "16", | ||
}, [ | ||
/* @__PURE__ */ i("line", { | ||
/* @__PURE__ */ v("line", { | ||
x1: "18", | ||
@@ -451,3 +449,3 @@ y1: "6", | ||
}), | ||
/* @__PURE__ */ i("line", { | ||
/* @__PURE__ */ v("line", { | ||
x1: "6", | ||
@@ -458,5 +456,5 @@ y1: "6", | ||
}) | ||
], -1)), Be = [ | ||
_e | ||
], Ae = { class: "tagContent" }, Te = ["onClick"], ze = ["onClick"], Me = ["onClick"], Re = /* @__PURE__ */ A({ | ||
], -1)), Te = [ | ||
Be | ||
], ze = { class: "tagContent" }, Ae = ["onClick"], Me = ["onClick"], Re = ["onClick"], Fe = /* @__PURE__ */ z({ | ||
__name: "TagBox", | ||
@@ -472,111 +470,111 @@ props: { | ||
emits: ["update:modelValue"], | ||
setup(s, { emit: h }) { | ||
const d = s, e = $(!1), r = $(""), k = $(null), m = E(d.modelValue || []), I = $(d.options || []), j = $(d.separator || ","), S = $(d.prop || "value"), b = T(() => { | ||
let o = I.value; | ||
return r.value.length >= 1 && (o = o.filter((l) => { | ||
if (isNaN(l) === !1 && Number(l) === Number(r.value)) | ||
setup(u, { emit: k }) { | ||
const c = u, e = C(!1), i = C(""), h = C(null), b = E(c.modelValue || []), w = C(c.options || []), j = C(c.separator || ","), S = C(c.prop || "value"), g = B(() => { | ||
let d = w.value; | ||
return i.value.length >= 1 && (d = d.filter((s) => { | ||
if (isNaN(s) === !1 && Number(s) === Number(i.value)) | ||
return !0; | ||
if (typeof l == "string" && l.toLowerCase().includes(r.value.toLowerCase())) | ||
if (typeof s == "string" && s.toLowerCase().includes(i.value.toLowerCase())) | ||
return !0; | ||
if (typeof l == "object" && l !== null && Object.prototype.toString.call(l) === "[object Object]") | ||
for (const t of Object.keys(l)) { | ||
if (isNaN(l[t]) === !1 && Number(l[t]) === Number(r.value)) | ||
if (typeof s == "object" && s !== null && Object.prototype.toString.call(s) === "[object Object]") | ||
for (const a of Object.keys(s)) { | ||
if (isNaN(s[a]) === !1 && Number(s[a]) === Number(i.value)) | ||
return !0; | ||
if (typeof l[t] == "string" && l[t].toLowerCase().includes(r.value.toLowerCase())) | ||
if (typeof s[a] == "string" && s[a].toLowerCase().includes(i.value.toLowerCase())) | ||
return !0; | ||
} | ||
return !1; | ||
})), o; | ||
})), d; | ||
}), y = () => { | ||
k.value.focus(); | ||
}, v = (o) => { | ||
if (o.key !== "Enter" && b.value.length >= 1 ? e.value = !0 : e.value = !1, r.value.endsWith(j.value) || o.key === "Enter") { | ||
const l = r.value.replace(j.value, ""); | ||
m.includes(l) || (m.push(l), I.value.includes(l) && (I.value = I.value.filter((t) => typeof t == "string" && t !== l ? !0 : typeof t == "object" && S.value in t && t[S.value] !== l))), r.value = "", h("update:modelValue", m); | ||
h.value.focus(); | ||
}, f = (d) => { | ||
if (d.key !== "Enter" && g.value.length >= 1 ? e.value = !0 : e.value = !1, i.value.endsWith(j.value) || d.key === "Enter") { | ||
const s = i.value.replace(j.value, ""); | ||
b.includes(s) || (b.push(s), w.value.includes(s) && (w.value = w.value.filter((a) => typeof a == "string" && a !== s ? !0 : typeof a == "object" && S.value in a && a[S.value] !== s))), i.value = "", k("update:modelValue", b); | ||
} | ||
}; | ||
M(r, () => { | ||
if (k.value !== null) { | ||
const o = document.createElement("div"); | ||
o.style.width = "max-content", o.style.position = "absolute", o.style.visibility = "hidden"; | ||
const l = r.value.length >= 2 ? r.value : k.value.getAttribute("placeholder"); | ||
o.innerHTML = l.replace(/ /g, " ").trim(), document.body.appendChild(o); | ||
const t = Math.ceil(Number(window.getComputedStyle(o).width.replace("px", ""))) + 30; | ||
k.value.style.setProperty("width", t + "px"), o.remove(); | ||
M(i, () => { | ||
if (h.value !== null) { | ||
const d = document.createElement("div"); | ||
d.style.width = "max-content", d.style.position = "absolute", d.style.visibility = "hidden"; | ||
const s = i.value.length >= 2 ? i.value : h.value.getAttribute("placeholder"); | ||
d.innerHTML = s.replace(/ /g, " ").trim(), document.body.appendChild(d); | ||
const a = Math.ceil(Number(window.getComputedStyle(d).width.replace("px", ""))) + 30; | ||
h.value.style.setProperty("width", a + "px"), d.remove(); | ||
} | ||
}); | ||
const f = (o) => { | ||
o.target.style.display = "none", e.value = !1; | ||
const p = (d) => { | ||
d.target.style.display = "none", e.value = !1; | ||
}; | ||
return (o, l) => (c(), n("div", { | ||
return (d, s) => (r(), o("div", { | ||
class: N(["taggable", { active: e.value === !0 }]) | ||
}, [ | ||
i("div", { | ||
v("div", { | ||
class: "tagBackdrop", | ||
style: L({ display: e.value ? "block" : "none" }), | ||
onClick: f | ||
style: V({ display: e.value ? "block" : "none" }), | ||
onClick: p | ||
}, null, 4), | ||
i("div", xe, [ | ||
i("div", { | ||
v("div", xe, [ | ||
v("div", { | ||
class: "input tagToggler", | ||
onClick: y | ||
}, [ | ||
i("div", Ve, [ | ||
(c(!0), n(p, null, O(m, (t, a) => (c(), n("div", { | ||
key: "tag-" + a, | ||
v("div", Ve, [ | ||
(r(!0), o($, null, O(b, (a, t) => (r(), o("div", { | ||
key: "tag-" + t, | ||
class: "group" | ||
}, [ | ||
i("div", Le, [ | ||
typeof t == "string" && t !== "" ? (c(), n(p, { key: 0 }, [ | ||
w(C(t), 1) | ||
], 64)) : typeof t == "object" && S.value in t ? (c(), n(p, { key: 1 }, [ | ||
w(C(t[S.value]), 1) | ||
], 64)) : (c(), n(p, { key: 2 }, [ | ||
w(C(s.placeholder), 1) | ||
v("div", Oe, [ | ||
typeof a == "string" && a !== "" ? (r(), o($, { key: 0 }, [ | ||
R(_(a), 1) | ||
], 64)) : typeof a == "object" && S.value in a ? (r(), o($, { key: 1 }, [ | ||
R(_(a[S.value]), 1) | ||
], 64)) : (r(), o($, { key: 2 }, [ | ||
R(_(u.placeholder), 1) | ||
], 64)) | ||
]), | ||
i("div", { | ||
v("div", { | ||
class: "tag groupItem", | ||
onClick: (u) => m.splice(a, 1) | ||
}, Be, 8, Oe) | ||
onClick: (l) => b.splice(t, 1) | ||
}, Te, 8, Le) | ||
]))), 128)), | ||
R(i("input", { | ||
F(v("input", { | ||
type: "search", | ||
ref_key: "inputRef", | ||
ref: k, | ||
"onUpdate:modelValue": l[0] || (l[0] = (t) => r.value = t), | ||
ref: h, | ||
"onUpdate:modelValue": s[0] || (s[0] = (a) => i.value = a), | ||
class: "tagInput", | ||
onInput: l[1] || (l[1] = (t) => v(t)), | ||
onKeyup: l[2] || (l[2] = H((t) => v(t), ["enter"])), | ||
onInput: s[1] || (s[1] = (a) => f(a)), | ||
onKeyup: s[2] || (s[2] = H((a) => f(a), ["enter"])), | ||
placeholder: "Add new tag" | ||
}, null, 544), [ | ||
[W, r.value] | ||
[W, i.value] | ||
]) | ||
]) | ||
]), | ||
i("div", Ae, [ | ||
(c(!0), n(p, null, O(g(b), (t, a) => (c(), n(p, { | ||
key: "option-" + t | ||
v("div", ze, [ | ||
(r(!0), o($, null, O(m(g), (a, t) => (r(), o($, { | ||
key: "option-" + a | ||
}, [ | ||
typeof t == "string" ? (c(), n("div", { | ||
typeof a == "string" ? (r(), o("div", { | ||
key: 0, | ||
onClick: (u) => { | ||
r.value = t + ",", v(u); | ||
onClick: (l) => { | ||
i.value = a + ",", f(l); | ||
}, | ||
class: "tagItem" | ||
}, C(t), 9, Te)) : typeof t == "object" && S.value in t ? (c(), n("div", { | ||
}, _(a), 9, Ae)) : typeof a == "object" && S.value in a ? (r(), o("div", { | ||
key: 1, | ||
onClick: (u) => { | ||
r.value = t[S.value] + ",", v(u); | ||
onClick: (l) => { | ||
i.value = a[S.value] + ",", f(l); | ||
}, | ||
class: "tagItem" | ||
}, C(t[S.value]), 9, ze)) : (c(), n("div", { | ||
}, _(a[S.value]), 9, Me)) : (r(), o("div", { | ||
key: 2, | ||
onClick: (u) => { | ||
r.value = t + ",", v(u); | ||
onClick: (l) => { | ||
i.value = a + ",", f(l); | ||
}, | ||
class: "tagItem" | ||
}, [ | ||
_(o.$slots, "default", { option: t }, void 0, !0) | ||
], 8, Me)) | ||
L(d.$slots, "default", { option: a }, void 0, !0) | ||
], 8, Re)) | ||
], 64))), 128)) | ||
@@ -588,3 +586,3 @@ ]) | ||
}); | ||
const nl = /* @__PURE__ */ z(Re, [["__scopeId", "data-v-3acd22f1"]]), We = { class: "pickerOverlay pickerWrap" }, Ee = { class: "pickerContent" }, He = { class: "pickerHeader" }, Fe = ["onClick"], De = { class: "check" }, Ke = ["checked", "id"], Ue = ["for"], Pe = ["onClick"], qe = { class: "check" }, Ge = ["checked", "id"], Je = ["for"], Qe = ["onClick"], Xe = ["onClick"], Ye = ["onClick"], Ze = ["onClick"], el = { class: "pickerFooter" }, ll = { class: "tedirCategoryAdd" }, tl = /* @__PURE__ */ A({ | ||
const rl = /* @__PURE__ */ A(Fe, [["__scopeId", "data-v-3acd22f1"]]), We = { class: "pickerOverlay pickerWrap" }, Ee = { class: "pickerContent" }, He = { class: "pickerHeader" }, De = ["onClick"], Ke = { class: "check" }, Ue = ["checked", "id"], Pe = ["for"], qe = ["onClick"], Ge = { class: "check" }, Je = ["checked", "id"], Qe = ["for"], Xe = ["onClick"], Ye = ["onClick"], Ze = ["onClick"], el = ["onClick"], ll = { class: "pickerFooter" }, tl = { class: "tedirCategoryAdd" }, al = /* @__PURE__ */ z({ | ||
__name: "CategoryBox", | ||
@@ -601,24 +599,24 @@ props: { | ||
emits: ["update:modelValue", "change", "add", "search"], | ||
setup(s, { emit: h }) { | ||
const d = s, e = $(d.modelValue || {}), r = $(!1), k = $(""), m = $(null), I = $(void 0), j = $(""); | ||
M(() => d.modelValue, () => { | ||
e.value = d.modelValue; | ||
setup(u, { emit: k }) { | ||
const c = u, e = C(c.modelValue || {}), i = C(!1), h = C(""), b = C(null), w = C(void 0), j = C(""); | ||
M(() => c.modelValue, () => { | ||
e.value = c.modelValue; | ||
}); | ||
const S = () => { | ||
clearTimeout(I.value), I.value = setTimeout(() => { | ||
var t, a; | ||
k.value = "", ((t = m.value) == null ? void 0 : t.value) && ((a = m.value) == null ? void 0 : a.value) !== "" && (k.value = m.value.value), h("search", k.value); | ||
clearTimeout(w.value), w.value = setTimeout(() => { | ||
var t, l; | ||
h.value = "", ((t = b.value) == null ? void 0 : t.value) && ((l = b.value) == null ? void 0 : l.value) !== "" && (h.value = b.value.value), k("search", h.value); | ||
}, 500); | ||
}, b = T(() => { | ||
let t = d.options; | ||
return k.value.length >= 1 && (t = t.filter((a) => { | ||
if (isNaN(a) === !1 && Number(a) === Number(k.value)) | ||
}, g = B(() => { | ||
let t = c.options; | ||
return h.value.length >= 1 && (t = t.filter((l) => { | ||
if (isNaN(l) === !1 && Number(l) === Number(h.value)) | ||
return !0; | ||
if (typeof a == "string" && a.toLowerCase().includes(k.value.toLowerCase())) | ||
if (typeof l == "string" && l.toLowerCase().includes(h.value.toLowerCase())) | ||
return !0; | ||
if (typeof a == "object" && a !== null && Object.prototype.toString.call(a) === "[object Object]") | ||
for (const u of Object.keys(a)) { | ||
if (isNaN(a[u]) === !1 && Number(a[u]) === Number(k.value)) | ||
if (typeof l == "object" && l !== null && Object.prototype.toString.call(l) === "[object Object]") | ||
for (const n of Object.keys(l)) { | ||
if (isNaN(l[n]) === !1 && Number(l[n]) === Number(h.value)) | ||
return !0; | ||
if (typeof a[u] == "string" && a[u].toLowerCase().includes(k.value.toLowerCase())) | ||
if (typeof l[n] == "string" && l[n].toLowerCase().includes(h.value.toLowerCase())) | ||
return !0; | ||
@@ -628,48 +626,46 @@ } | ||
})), t; | ||
}), v = ((t = 10) => { | ||
let a = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", u = ""; | ||
for (let x = 0; x < t; x++) | ||
u += a.charAt(Math.floor(Math.random() * a.length)); | ||
return u; | ||
})(), f = (t) => { | ||
var a; | ||
t.target.style.display = "none", r.value = !1, (a = m.value) != null && a.value && (m.value.value = "", k.value = ""); | ||
}, o = (t, a = "") => { | ||
a !== "" ? e.value.map((u) => u[a]).includes(t[a]) ? e.value.splice(e.value.findIndex((u) => u[a] === t[a]), 1) : e.value.push(t) : e.value.includes(t) ? e.value.splice(e.value.findIndex((u) => u === t), 1) : e.value.push(t), h("update:modelValue", e.value), h("change", e.value, t); | ||
}, l = (t) => { | ||
typeof t == "object" && t !== null && String(d.datatype).toLowerCase() === "string" ? (e.value = t[String(d.dataprop || d.prop)], h("update:modelValue", String(e.value))) : typeof t == "object" && t !== null && String(d.datatype).toLowerCase() === "number" ? (e.value = t[String(d.dataprop || d.prop)], h("update:modelValue", Number(e.value))) : (e.value = t, h("update:modelValue", e.value)), r.value = !1, h("change", e.value, t); | ||
}; | ||
return (t, a) => (c(), n("div", { | ||
class: N(["picker suggestion tedirCategory", r.value ? "active" : ""]) | ||
}), f = ((t = 10) => { | ||
let l = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", n = ""; | ||
for (let I = 0; I < t; I++) | ||
n += l.charAt(Math.floor(Math.random() * l.length)); | ||
return n; | ||
})(), p = (t) => { | ||
var l; | ||
t.target.style.display = "none", i.value = !1, (l = b.value) != null && l.value && (b.value.value = "", h.value = ""); | ||
}, d = (t, l = "") => { | ||
l !== "" ? e.value.map((n) => n[l]).includes(t[l]) ? e.value.splice(e.value.findIndex((n) => n[l] === t[l]), 1) : e.value.push(t) : e.value.includes(t) ? e.value.splice(e.value.findIndex((n) => n === t), 1) : e.value.push(t), k("update:modelValue", e.value), k("change", e.value, t); | ||
}, s = (t) => { | ||
typeof t == "object" && t !== null && String(c.datatype).toLowerCase() === "string" ? (e.value = t[String(c.dataprop || c.prop)], k("update:modelValue", String(e.value))) : typeof t == "object" && t !== null && String(c.datatype).toLowerCase() === "number" ? (e.value = t[String(c.dataprop || c.prop)], k("update:modelValue", Number(e.value))) : (e.value = t, k("update:modelValue", e.value)), i.value = !1, k("change", e.value, t); | ||
}, a = B(() => { | ||
let t = (c == null ? void 0 : c.placeholder) || "-- Select option --"; | ||
if (g.value.length >= 1) | ||
if (typeof e.value == "number") { | ||
let l = g.value.filter((n) => Number(n[String(c.dataprop || c.prop)]) === Number(e.value)); | ||
typeof g.value[0] == "object" && l.length >= 1 ? t = l[0][String(c.prop)] : typeof g.value[0] == "number" && (t = e.value); | ||
} else if (typeof e.value == "string") { | ||
let l = g.value.filter((n) => String(n[String(c.dataprop || c.prop)]) === e.value); | ||
typeof g.value[0] == "object" && l.length >= 1 ? t = l[0][String(c.prop)] : typeof g.value[0] == "string" && e.value !== "" && (t = e.value); | ||
} else | ||
typeof e.value == "object" && (Array.isArray(e.value) && e.value.length >= 1 ? typeof e.value[0] == "object" && String(c.prop) in e.value[0] ? t = e.value.map((l) => l[String(c.prop)]).join(", ") : t = e.value.join(", ") : e.value !== null && String(c.prop) in e.value && (t = e.value[String(c.prop)])); | ||
return t; | ||
}); | ||
return (t, l) => (r(), o("div", { | ||
class: N(["picker suggestion tedirCategory", i.value ? "active" : ""]) | ||
}, [ | ||
i("div", { | ||
v("div", { | ||
class: "pickerBackdrop", | ||
style: L({ display: r.value ? "block" : "none" }), | ||
onClick: f | ||
style: V({ display: i.value ? "block" : "none" }), | ||
onClick: p | ||
}, null, 4), | ||
i("div", We, [ | ||
i("div", { | ||
v("div", We, [ | ||
v("div", { | ||
class: "select pickerToggler", | ||
onClick: a[0] || (a[0] = (u) => r.value = !r.value) | ||
}, [ | ||
typeof e.value == "string" && e.value !== "" && g(b).length >= 1 && typeof g(b)[0] == "string" ? (c(), n(p, { key: 0 }, [ | ||
w(C(e.value), 1) | ||
], 64)) : typeof e.value == "string" && g(b).filter((u) => String(u[String(s.dataprop || s.prop)]) === e.value).length >= 1 && typeof g(b).filter((u) => String(u[String(s.dataprop || s.prop)]) === e.value)[0] == "object" ? (c(), n(p, { key: 1 }, [ | ||
w(C(g(b).filter((u) => String(u[String(s.dataprop || s.prop)]) === e.value)[0][s.prop]), 1) | ||
], 64)) : typeof e.value == "object" && e.value !== null && s.prop in e.value ? (c(), n(p, { key: 2 }, [ | ||
w(C(e.value[s.prop]), 1) | ||
], 64)) : Array.isArray(e.value) && e.value.length >= 1 && typeof e.value[0] == "string" ? (c(), n(p, { key: 3 }, [ | ||
w(C(e.value.join(", ")), 1) | ||
], 64)) : Array.isArray(e.value) && e.value.length >= 1 && typeof e.value[0] == "object" && s.prop in e.value[0] ? (c(), n(p, { key: 4 }, [ | ||
w(C(e.value.map((u) => u[s.prop]).join(", ")), 1) | ||
], 64)) : (c(), n(p, { key: 5 }, [ | ||
w(C(s.placeholder), 1) | ||
], 64)) | ||
]), | ||
i("div", Ee, [ | ||
i("div", He, [ | ||
i("input", { | ||
onClick: l[0] || (l[0] = (n) => i.value = !i.value) | ||
}, _(m(a)), 1), | ||
v("div", Ee, [ | ||
v("div", He, [ | ||
v("input", { | ||
type: "search", | ||
ref_key: "searchRef", | ||
ref: m, | ||
ref: b, | ||
onInput: S, | ||
@@ -679,92 +675,92 @@ class: "input" | ||
]), | ||
Array.isArray(e.value) ? (c(), n("div", { | ||
Array.isArray(e.value) ? (r(), o("div", { | ||
key: 0, | ||
class: "pickerMenu", | ||
style: L({ "max-height": Number(s.size) !== 0 ? Number(s.size) * 42 + "px" : "auto" }) | ||
style: V({ "max-height": Number(u.size) !== 0 ? Number(u.size) * 42 + "px" : "auto" }) | ||
}, [ | ||
(c(!0), n(p, null, O(g(b), (u, x) => (c(), n(p, { | ||
key: "option-" + u | ||
(r(!0), o($, null, O(m(g), (n, I) => (r(), o($, { | ||
key: "option-" + n | ||
}, [ | ||
typeof u == "string" ? (c(), n("div", { | ||
typeof n == "string" ? (r(), o("div", { | ||
key: 0, | ||
onClick: V((B) => o(u), ["stop"]), | ||
onClick: x((T) => d(n), ["stop"]), | ||
class: "pickerItem" | ||
}, [ | ||
i("div", De, [ | ||
i("input", { | ||
v("div", Ke, [ | ||
v("input", { | ||
type: "checkbox", | ||
class: "checkInput", | ||
checked: e.value.includes(u), | ||
id: "check-" + (g(v) + String(x)), | ||
checked: e.value.includes(n), | ||
id: "check-" + (m(f) + String(I)), | ||
style: { "pointer-events": "none" } | ||
}, null, 8, Ke), | ||
i("label", { | ||
}, null, 8, Ue), | ||
v("label", { | ||
class: "checkLabel", | ||
for: "check-" + (g(v) + String(x)), | ||
for: "check-" + (m(f) + String(I)), | ||
style: { "pointer-events": "none" } | ||
}, C(u), 9, Ue) | ||
}, _(n), 9, Pe) | ||
]) | ||
], 8, Fe)) : typeof u == "object" && u !== null && s.prop in u ? (c(), n("div", { | ||
], 8, De)) : typeof n == "object" && n !== null && u.prop in n ? (r(), o("div", { | ||
key: 1, | ||
onClick: V((B) => o(u, s.prop), ["stop"]), | ||
onClick: x((T) => d(n, u.prop), ["stop"]), | ||
class: "pickerItem" | ||
}, [ | ||
i("div", qe, [ | ||
i("input", { | ||
v("div", Ge, [ | ||
v("input", { | ||
type: "checkbox", | ||
class: "checkInput", | ||
checked: e.value.includes(u), | ||
id: "check-" + (g(v) + String(x)), | ||
checked: e.value.includes(n), | ||
id: "check-" + (m(f) + String(I)), | ||
style: { "pointer-events": "none" } | ||
}, null, 8, Ge), | ||
i("label", { | ||
}, null, 8, Je), | ||
v("label", { | ||
class: "checkLabel", | ||
for: "check-" + (g(v) + String(x)), | ||
for: "check-" + (m(f) + String(I)), | ||
style: { "pointer-events": "none" } | ||
}, C(u[s.prop]), 9, Je) | ||
}, _(n[u.prop]), 9, Qe) | ||
]) | ||
], 8, Pe)) : (c(), n("div", { | ||
], 8, qe)) : (r(), o("div", { | ||
key: 2, | ||
onClick: V((B) => o(u), ["stop"]), | ||
onClick: x((T) => d(n), ["stop"]), | ||
class: "pickerItem" | ||
}, [ | ||
_(t.$slots, "default", { | ||
option: u, | ||
L(t.$slots, "default", { | ||
option: n, | ||
selected: e.value | ||
}, void 0, !0) | ||
], 8, Qe)) | ||
], 8, Xe)) | ||
], 64))), 128)) | ||
], 4)) : (c(), n("div", { | ||
], 4)) : (r(), o("div", { | ||
key: 1, | ||
class: "pickerMenu", | ||
style: L({ "max-height": Number(s.size) !== 0 ? Number(s.size) * 42 + "px" : "auto" }) | ||
style: V({ "max-height": Number(u.size) !== 0 ? Number(u.size) * 42 + "px" : "auto" }) | ||
}, [ | ||
(c(!0), n(p, null, O(g(b), (u, x) => (c(), n(p, { | ||
key: "option-" + u | ||
(r(!0), o($, null, O(m(g), (n, I) => (r(), o($, { | ||
key: "option-" + n | ||
}, [ | ||
typeof u == "string" ? (c(), n("div", { | ||
typeof n == "string" ? (r(), o("div", { | ||
key: 0, | ||
onClick: (B) => l(u), | ||
class: N(["pickerItem", e.value === u ? "active" : ""]) | ||
}, C(u), 11, Xe)) : typeof u == "object" && u !== null && s.prop in u ? (c(), n("div", { | ||
onClick: (T) => s(n), | ||
class: N(["pickerItem", e.value === n ? "active" : ""]) | ||
}, _(n), 11, Ye)) : typeof n == "object" && n !== null && u.prop in n ? (r(), o("div", { | ||
key: 1, | ||
onClick: (B) => l(u), | ||
class: N(["pickerItem", e.value[s.prop] === u[s.prop] || String(u[s.dataprop || s.prop]) === String(e.value) ? "active" : ""]) | ||
}, C(u[s.prop]), 11, Ye)) : (c(), n("div", { | ||
onClick: (T) => s(n), | ||
class: N(["pickerItem", e.value[u.prop] === n[u.prop] || String(n[u.dataprop || u.prop]) === String(e.value) ? "active" : ""]) | ||
}, _(n[u.prop]), 11, Ze)) : (r(), o("div", { | ||
key: 2, | ||
onClick: V((B) => l(u), ["stop"]), | ||
class: N(["pickerItem", e.value === u ? "active" : ""]) | ||
onClick: x((T) => s(n), ["stop"]), | ||
class: N(["pickerItem", e.value === n ? "active" : ""]) | ||
}, [ | ||
_(t.$slots, "default", { | ||
option: u, | ||
L(t.$slots, "default", { | ||
option: n, | ||
selected: e.value | ||
}, void 0, !0) | ||
], 10, Ze)) | ||
], 10, el)) | ||
], 64))), 128)) | ||
], 4)), | ||
i("div", el, [ | ||
i("div", ll, [ | ||
R(i("input", { | ||
v("div", ll, [ | ||
v("div", tl, [ | ||
F(v("input", { | ||
type: "text", | ||
"onUpdate:modelValue": a[1] || (a[1] = (u) => j.value = u), | ||
"onUpdate:modelValue": l[1] || (l[1] = (n) => j.value = n), | ||
class: "input", | ||
@@ -775,7 +771,7 @@ placeholder: "Add New Category" | ||
]), | ||
i("button", { | ||
v("button", { | ||
type: "button", | ||
class: "button tedirCategoryButton", | ||
onClick: a[2] || (a[2] = (u) => { | ||
h("add", j.value), j.value = ""; | ||
onClick: l[2] || (l[2] = (n) => { | ||
k("add", j.value), j.value = ""; | ||
}) | ||
@@ -790,9 +786,9 @@ }, "Save") | ||
}); | ||
const rl = /* @__PURE__ */ z(tl, [["__scopeId", "data-v-1814db96"]]); | ||
const ol = /* @__PURE__ */ A(al, [["__scopeId", "data-v-93d03657"]]); | ||
export { | ||
rl as CategoryBox, | ||
ul as ComboBox, | ||
cl as ListBox, | ||
sl as SelectBox, | ||
nl as TagBox | ||
ol as CategoryBox, | ||
cl as ComboBox, | ||
nl as ListBox, | ||
ul as SelectBox, | ||
rl as TagBox | ||
}; |
@@ -1,1 +0,1 @@ | ||
(function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.TedirSelect={},b.Vue))})(this,function(b,e){"use strict";const S={class:"pickerWrap"},V={class:"pickerContent"},$={class:"pickerHeader"},w=["onClick"],x={class:"check"},j=["checked","id"],I=["for"],L=["onClick"],z={class:"check"},T=["checked","id"],v=["for"],O=["onClick"],_=["onClick"],F=["onClick"],D=["onClick"],M=e.defineComponent({__name:"SelectBox",props:{modelValue:{default:{}},options:{default:[]},prop:{default:"value"},datatype:{default:""},dataprop:{default:""},placeholder:{default:"-- Select option --"},size:{default:0},type:{default:""}},emits:["update:modelValue","change","search"],setup(c,{emit:u}){const i=c,t=e.ref(i.modelValue||{}),o=e.ref(!1),f=e.ref(""),y=e.ref(null),g=e.ref(void 0);e.watch(()=>i.modelValue,()=>{t.value=i.modelValue});const B=()=>{clearTimeout(g.value),g.value=setTimeout(()=>{var l,a;f.value="",((l=y.value)==null?void 0:l.value)&&((a=y.value)==null?void 0:a.value)!==""&&(f.value=y.value.value),u("search",f.value)},500)},h=e.computed(()=>{let l=i.options;return f.value.length>=1&&(l=l.filter(a=>{if(isNaN(a)===!1&&Number(a)===Number(f.value))return!0;if(typeof a=="string"&&a.toLowerCase().includes(f.value.toLowerCase()))return!0;if(typeof a=="object"&&a!==null&&Object.prototype.toString.call(a)==="[object Object]")for(const n of Object.keys(a)){if(isNaN(a[n])===!1&&Number(a[n])===Number(f.value))return!0;if(typeof a[n]=="string"&&a[n].toLowerCase().includes(f.value.toLowerCase()))return!0}return!1})),l}),p=((l=10)=>{let a="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n="";for(let r=0;r<l;r++)n+=a.charAt(Math.floor(Math.random()*a.length));return n})(),d=l=>{var a;l.target.style.display="none",o.value=!1,(a=y.value)!=null&&a.value&&(y.value.value="",f.value="")},k=(l,a="")=>{a!==""?t.value.map(n=>n[a]).includes(l[a])?t.value.splice(t.value.findIndex(n=>n[a]===l[a]),1):t.value.push(l):t.value.includes(l)?t.value.splice(t.value.findIndex(n=>n===l),1):t.value.push(l),u("update:modelValue",t.value),u("change",t.value,l)},s=l=>{typeof l=="object"&&l!==null&&String(i.datatype).toLowerCase()==="string"?(t.value=l[String(i.dataprop||i.prop)],u("update:modelValue",String(t.value))):typeof l=="object"&&l!==null&&String(i.datatype).toLowerCase()==="number"?(t.value=l[String(i.dataprop||i.prop)],u("update:modelValue",Number(t.value))):(t.value=l,u("update:modelValue",t.value)),o.value=!1,u("change",t.value,l)};return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["picker suggestion",o.value?"active":""])},[e.createElementVNode("div",{class:"pickerBackdrop",style:e.normalizeStyle({display:o.value?"block":"none"}),onClick:d},null,4),e.createElementVNode("div",S,[e.createElementVNode("div",{class:"select pickerToggler",onClick:a[0]||(a[0]=n=>o.value=!o.value)},[typeof t.value=="string"&&t.value!==""&&e.unref(h).length>=1&&typeof e.unref(h)[0]=="string"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.value),1)],64)):typeof t.value=="string"&&e.unref(h).filter(n=>String(n[String(c.dataprop||c.prop)])===t.value).length>=1&&typeof e.unref(h).filter(n=>String(n[String(c.dataprop||c.prop)])===t.value)[0]=="object"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(h).filter(n=>String(n[String(c.dataprop||c.prop)])===t.value)[0][c.prop]),1)],64)):typeof t.value=="object"&&t.value!==null&&c.prop in t.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.value[c.prop]),1)],64)):Array.isArray(t.value)&&t.value.length>=1&&typeof t.value[0]=="string"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(t.value.join(", ")),1)],64)):Array.isArray(t.value)&&t.value.length>=1&&typeof t.value[0]=="object"&&c.prop in t.value[0]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(t.value.map(n=>n[c.prop]).join(", ")),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createTextVNode(e.toDisplayString(c.placeholder),1)],64))]),e.createElementVNode("div",V,[e.createElementVNode("div",$,[e.createElementVNode("input",{type:"search",ref_key:"searchRef",ref:y,onInput:B,class:"input"},null,544)]),Array.isArray(t.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pickerMenu",style:e.normalizeStyle({"max-height":Number(c.size)!==0?Number(c.size)*42+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+n},[typeof n=="string"&&c.type!=="slot"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:e.withModifiers(C=>k(n),["stop"]),class:"pickerItem"},[e.createElementVNode("div",x,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:t.value.includes(n),id:"check-"+(e.unref(p)+String(r)),style:{"pointer-events":"none"}},null,8,j),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(p)+String(r)),style:{"pointer-events":"none"}},e.toDisplayString(n),9,I)])],8,w)):typeof n=="object"&&n!==null&&c.prop in n&&c.type!=="slot"?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:e.withModifiers(C=>k(n,c.prop),["stop"]),class:"pickerItem"},[e.createElementVNode("div",z,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:t.value.includes(n),id:"check-"+(e.unref(p)+String(r)),style:{"pointer-events":"none"}},null,8,T),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(p)+String(r)),style:{"pointer-events":"none"}},e.toDisplayString(n[c.prop]),9,v)])],8,L)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(C=>k(n),["stop"]),class:"pickerItem"},[e.renderSlot(l.$slots,"default",{option:n,selected:t.value},void 0,!0)],8,O))],64))),128))],4)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"pickerMenu",style:e.normalizeStyle({"max-height":Number(c.size)!==0?Number(c.size)*42+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+n},[typeof n=="string"&&c.type!=="slot"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:C=>s(n),class:e.normalizeClass(["pickerItem",t.value===n?"active":""])},e.toDisplayString(n),11,_)):typeof n=="object"&&n!==null&&c.prop in n&&c.type!=="slot"?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:C=>s(n),class:e.normalizeClass(["pickerItem",t.value[c.prop]===n[c.prop]||String(n[c.dataprop||c.prop])===String(t.value)?"active":""])},e.toDisplayString(n[c.prop]),11,F)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(C=>s(n),["stop"]),class:e.normalizeClass(["pickerItem",t.value===n?"active":""])},[e.renderSlot(l.$slots,"default",{option:n,selected:t.value},void 0,!0)],10,D))],64))),128))],4))])])],2))}}),Re="",E=(c,u)=>{const i=c.__vccOpts||c;for(const[t,o]of u)i[t]=o;return i},A=E(M,[["__scopeId","data-v-50169185"]]),R={class:"pickerWrap"},W={class:"pickerContent pickerSizing"},H=["onClick"],K=["onClick"],P=["onClick"],U=e.defineComponent({__name:"ComboBox",props:{modelValue:{default:null},options:{default:[]},prop:{default:"value"},placeholder:{default:"Search option"},size:{default:0},select:{type:Boolean,default:!1}},emits:["update:modelValue","search"],setup(c,{emit:u}){const i=c,t=e.ref(!1),o=e.ref(""),f=e.ref(null),y=e.ref(void 0),g=e.computed(()=>{let m=i.options;return o.value.length>=1&&(m=m.filter(p=>{if(isNaN(p)===!1&&Number(p)===Number(o.value))return!0;if(typeof p=="string"&&p.toLowerCase().includes(o.value.toLowerCase()))return!0;if(typeof p=="object"&&p!==null&&Object.prototype.toString.call(p)==="[object Object]")for(const d of Object.keys(p)){if(isNaN(p[d])===!1&&Number(p[d])===Number(o.value))return!0;if(typeof p[d]=="string"&&p[d].toLowerCase().includes(o.value.toLowerCase()))return!0}return!1})),m}),B=()=>{clearTimeout(y.value),y.value=setTimeout(()=>{var m,p;o.value="",((m=f.value)==null?void 0:m.value)&&((p=f.value)==null?void 0:p.value)!==""&&(o.value=f.value.value),u("search",o.value),g.value.length>=1&&o.value!==""?t.value=!0:t.value=!1},500)},h=m=>{m.target.style.display="none",t.value=!1};return(m,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["picker suggestion",t.value?"active":""])},[e.createElementVNode("div",{class:"pickerBackdrop",style:e.normalizeStyle({display:t.value?"block":"none"}),onClick:h},null,4),e.createElementVNode("div",R,[c.select?(e.openBlock(),e.createElementBlock("input",{key:0,type:"search",ref_key:"searchRef",ref:f,onInput:B,onClick:p[0]||(p[0]=d=>t.value=!0),class:"select"},null,544)):(e.openBlock(),e.createElementBlock("input",{key:1,type:"search",ref_key:"searchRef",ref:f,onInput:B,onClick:p[1]||(p[1]=d=>e.unref(g).length>=1&&o.value!==""?t.value=!0:t.value=!1),class:"input"},null,544)),e.createElementVNode("div",W,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(d,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+d},[typeof d=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:s=>{o.value=d,u("update:modelValue",d),t.value=!1},class:e.normalizeClass(["pickerItem",c.modelValue===d?"active":""])},e.toDisplayString(d),11,H)):typeof d=="object"&&c.prop in d?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:s=>{o.value=d[c.prop],u("update:modelValue",d),t.value=!1},class:e.normalizeClass(["pickerItem",c.modelValue[c.prop]===d[c.prop]?"active":""])},e.toDisplayString(d[c.prop]),11,K)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:s=>{o.value=d,u("update:modelValue",d),t.value=!1},class:e.normalizeClass(["pickerItem",c.modelValue===d?"active":""])},[e.renderSlot(m.$slots,"default",{option:d},void 0,!0)],10,P))],64))),128))])])],2))}}),We="",q=E(U,[["__scopeId","data-v-f7a05695"]]),G={class:"list"},J={class:"listHeader"},Q=["onClick"],X={class:"check"},Y=["checked","id"],Z=["for"],ee=["onClick"],te={class:"check"},le=["checked","id"],ae=["for"],ne=["onClick"],ce=["onClick"],re=["onClick"],oe=["onClick"],se=e.defineComponent({__name:"ListBox",props:{modelValue:{default:{}},options:{default:[]},prop:{default:"value"},datatype:{default:""},dataprop:{default:""},size:{default:0}},emits:["update:modelValue","change","search"],setup(c,{emit:u}){const i=c,t=e.ref(i.modelValue||{}),o=e.ref(""),f=e.ref(null),y=e.ref(void 0);e.watch(()=>i.modelValue,()=>{t.value=i.modelValue});const g=()=>{clearTimeout(y.value),y.value=setTimeout(()=>{var k,s;o.value="",((k=f.value)==null?void 0:k.value)&&((s=f.value)==null?void 0:s.value)!==""&&(o.value=f.value.value),u("search",o.value)},500)},B=e.computed(()=>{let k=i.options;return o.value.length>=1&&(k=k.filter(s=>{if(isNaN(s)===!1&&Number(s)===Number(o.value))return!0;if(typeof s=="string"&&s.toLowerCase().includes(o.value.toLowerCase()))return!0;if(typeof s=="object"&&s!==null&&Object.prototype.toString.call(s)==="[object Object]")for(const l of Object.keys(s)){if(isNaN(s[l])===!1&&Number(s[l])===Number(o.value))return!0;if(typeof s[l]=="string"&&s[l].toLowerCase().includes(o.value.toLowerCase()))return!0}return!1})),k}),m=(()=>{let k="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s="";for(let l=0;l<10;l++)s+=k.charAt(Math.floor(Math.random()*k.length));return s})(),p=(k,s="")=>{s!==""?t.value.map(l=>l[s]).includes(k[s])?t.value.splice(t.value.findIndex(l=>l[s]===k[s]),1):t.value.push(k):t.value.includes(k)?t.value.splice(t.value.findIndex(l=>l===k),1):t.value.push(k),u("update:modelValue",t.value),u("change",t.value,k)},d=k=>{typeof k=="object"&&k!==null&&String(i.datatype).toLowerCase()==="string"?(t.value=k[String(i.dataprop||i.prop)],u("update:modelValue",String(t.value))):typeof k=="object"&&k!==null&&String(i.datatype).toLowerCase()==="number"?(t.value=k[String(i.dataprop||i.prop)],u("update:modelValue",Number(t.value))):(t.value=k,u("update:modelValue",t.value)),u("change",t.value,k)};return(k,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",G,[e.createElementVNode("div",J,[e.createElementVNode("input",{type:"search",ref_key:"searchRef",ref:f,onInput:g,class:"input"},null,544)]),Array.isArray(c.modelValue)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"listMenu",style:e.normalizeStyle({"max-height":Number(c.size)!==0?Number(c.size)*44+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(B),(l,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+l},[typeof l=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:e.withModifiers(n=>p(l),["stop"]),class:"listItem"},[e.createElementVNode("div",X,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:t.value.includes(l),id:"check-"+(e.unref(m)+String(a)),style:{"pointer-events":"none"}},null,8,Y),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(m)+String(a)),style:{"pointer-events":"none"}},e.toDisplayString(l),9,Z)])],8,Q)):typeof l=="object"&&c.prop in l?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:e.withModifiers(n=>p(l,c.prop),["stop"]),class:"listItem"},[e.createElementVNode("div",te,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:t.value.includes(l),id:"check-"+(e.unref(m)+String(a)),style:{"pointer-events":"none"}},null,8,le),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(m)+String(a)),style:{"pointer-events":"none"}},e.toDisplayString(l[c.prop]),9,ae)])],8,ee)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(n=>p(l),["stop"]),class:e.normalizeClass(["listItem",t.value.includes(l)?"active":""])},[e.renderSlot(k.$slots,"default",{option:l,selected:t.value},void 0,!0)],10,ne))],64))),128))],4)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"listMenu",style:e.normalizeStyle({"max-height":Number(c.size)!==0?Number(c.size)*44+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(B),(l,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+l},[typeof l=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:n=>d(l),class:e.normalizeClass(["listItem",t.value===l?"active":""])},e.toDisplayString(l),11,ce)):typeof l=="object"&&c.prop in l?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:n=>d(l),class:e.normalizeClass(["listItem",t.value[c.prop]===l[c.prop]||String(l[c.dataprop||c.prop])===String(t.value)?"active":""])},e.toDisplayString(l[c.prop]),11,re)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(n=>d(l),["stop"]),class:e.normalizeClass(["listItem",t.value===l?"active":""])},[e.renderSlot(k.$slots,"default",{option:l,selected:t.value},void 0,!0)],10,oe))],64))),128))],4))])]))}}),He="",ie=E(se,[["__scopeId","data-v-d7fed8bc"]]),de=c=>(e.pushScopeId("data-v-3acd22f1"),c=c(),e.popScopeId(),c),ke={class:"tagWrap"},fe={class:"tags"},ue={class:"tag groupItem"},pe=["onClick"],me=[de(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1))],ye={class:"tagContent"},he=["onClick"],ge=["onClick"],Be=["onClick"],Ce=e.defineComponent({__name:"TagBox",props:{modelValue:{default:[]},options:{default:[]},prop:{default:"value"},placeholder:{default:"Add new tag"},size:{default:0},separator:{default:","}},emits:["update:modelValue"],setup(c,{emit:u}){const i=c,t=e.ref(!1),o=e.ref(""),f=e.ref(null),y=e.reactive(i.modelValue||[]),g=e.ref(i.options||[]),B=e.ref(i.separator||","),h=e.ref(i.prop||"value"),m=e.computed(()=>{let s=g.value;return o.value.length>=1&&(s=s.filter(l=>{if(isNaN(l)===!1&&Number(l)===Number(o.value))return!0;if(typeof l=="string"&&l.toLowerCase().includes(o.value.toLowerCase()))return!0;if(typeof l=="object"&&l!==null&&Object.prototype.toString.call(l)==="[object Object]")for(const a of Object.keys(l)){if(isNaN(l[a])===!1&&Number(l[a])===Number(o.value))return!0;if(typeof l[a]=="string"&&l[a].toLowerCase().includes(o.value.toLowerCase()))return!0}return!1})),s}),p=()=>{f.value.focus()},d=s=>{if(s.key!=="Enter"&&m.value.length>=1?t.value=!0:t.value=!1,o.value.endsWith(B.value)||s.key==="Enter"){const l=o.value.replace(B.value,"");y.includes(l)||(y.push(l),g.value.includes(l)&&(g.value=g.value.filter(a=>typeof a=="string"&&a!==l?!0:typeof a=="object"&&h.value in a&&a[h.value]!==l))),o.value="",u("update:modelValue",y)}};e.watch(o,()=>{if(f.value!==null){const s=document.createElement("div");s.style.width="max-content",s.style.position="absolute",s.style.visibility="hidden";const l=o.value.length>=2?o.value:f.value.getAttribute("placeholder");s.innerHTML=l.replace(/ /g," ").trim(),document.body.appendChild(s);const a=Math.ceil(Number(window.getComputedStyle(s).width.replace("px","")))+30;f.value.style.setProperty("width",a+"px"),s.remove()}});const k=s=>{s.target.style.display="none",t.value=!1};return(s,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["taggable",{active:t.value===!0}])},[e.createElementVNode("div",{class:"tagBackdrop",style:e.normalizeStyle({display:t.value?"block":"none"}),onClick:k},null,4),e.createElementVNode("div",ke,[e.createElementVNode("div",{class:"input tagToggler",onClick:p},[e.createElementVNode("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y,(a,n)=>(e.openBlock(),e.createElementBlock("div",{key:"tag-"+n,class:"group"},[e.createElementVNode("div",ue,[typeof a=="string"&&a!==""?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(a),1)],64)):typeof a=="object"&&h.value in a?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(a[h.value]),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(c.placeholder),1)],64))]),e.createElementVNode("div",{class:"tag groupItem",onClick:r=>y.splice(n,1)},me,8,pe)]))),128)),e.withDirectives(e.createElementVNode("input",{type:"search",ref_key:"inputRef",ref:f,"onUpdate:modelValue":l[0]||(l[0]=a=>o.value=a),class:"tagInput",onInput:l[1]||(l[1]=a=>d(a)),onKeyup:l[2]||(l[2]=e.withKeys(a=>d(a),["enter"])),placeholder:"Add new tag"},null,544),[[e.vModelText,o.value]])])]),e.createElementVNode("div",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+a},[typeof a=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:r=>{o.value=a+",",d(r)},class:"tagItem"},e.toDisplayString(a),9,he)):typeof a=="object"&&h.value in a?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:r=>{o.value=a[h.value]+",",d(r)},class:"tagItem"},e.toDisplayString(a[h.value]),9,ge)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:r=>{o.value=a+",",d(r)},class:"tagItem"},[e.renderSlot(s.$slots,"default",{option:a},void 0,!0)],8,Be))],64))),128))])])],2))}}),Pe="",be=E(Ce,[["__scopeId","data-v-3acd22f1"]]),Ee={class:"pickerOverlay pickerWrap"},Ne={class:"pickerContent"},Se={class:"pickerHeader"},Ve=["onClick"],$e={class:"check"},we=["checked","id"],xe=["for"],je=["onClick"],Ie={class:"check"},Le=["checked","id"],ze=["for"],Te=["onClick"],ve=["onClick"],Oe=["onClick"],_e=["onClick"],Fe={class:"pickerFooter"},De={class:"tedirCategoryAdd"},Me=e.defineComponent({__name:"CategoryBox",props:{modelValue:{default:{}},options:{default:[]},prop:{default:"value"},datatype:{default:""},dataprop:{default:""},placeholder:{default:"-- Select option --"},size:{default:0}},emits:["update:modelValue","change","add","search"],setup(c,{emit:u}){const i=c,t=e.ref(i.modelValue||{}),o=e.ref(!1),f=e.ref(""),y=e.ref(null),g=e.ref(void 0),B=e.ref("");e.watch(()=>i.modelValue,()=>{t.value=i.modelValue});const h=()=>{clearTimeout(g.value),g.value=setTimeout(()=>{var a,n;f.value="",((a=y.value)==null?void 0:a.value)&&((n=y.value)==null?void 0:n.value)!==""&&(f.value=y.value.value),u("search",f.value)},500)},m=e.computed(()=>{let a=i.options;return f.value.length>=1&&(a=a.filter(n=>{if(isNaN(n)===!1&&Number(n)===Number(f.value))return!0;if(typeof n=="string"&&n.toLowerCase().includes(f.value.toLowerCase()))return!0;if(typeof n=="object"&&n!==null&&Object.prototype.toString.call(n)==="[object Object]")for(const r of Object.keys(n)){if(isNaN(n[r])===!1&&Number(n[r])===Number(f.value))return!0;if(typeof n[r]=="string"&&n[r].toLowerCase().includes(f.value.toLowerCase()))return!0}return!1})),a}),d=((a=10)=>{let n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="";for(let C=0;C<a;C++)r+=n.charAt(Math.floor(Math.random()*n.length));return r})(),k=a=>{var n;a.target.style.display="none",o.value=!1,(n=y.value)!=null&&n.value&&(y.value.value="",f.value="")},s=(a,n="")=>{n!==""?t.value.map(r=>r[n]).includes(a[n])?t.value.splice(t.value.findIndex(r=>r[n]===a[n]),1):t.value.push(a):t.value.includes(a)?t.value.splice(t.value.findIndex(r=>r===a),1):t.value.push(a),u("update:modelValue",t.value),u("change",t.value,a)},l=a=>{typeof a=="object"&&a!==null&&String(i.datatype).toLowerCase()==="string"?(t.value=a[String(i.dataprop||i.prop)],u("update:modelValue",String(t.value))):typeof a=="object"&&a!==null&&String(i.datatype).toLowerCase()==="number"?(t.value=a[String(i.dataprop||i.prop)],u("update:modelValue",Number(t.value))):(t.value=a,u("update:modelValue",t.value)),o.value=!1,u("change",t.value,a)};return(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["picker suggestion tedirCategory",o.value?"active":""])},[e.createElementVNode("div",{class:"pickerBackdrop",style:e.normalizeStyle({display:o.value?"block":"none"}),onClick:k},null,4),e.createElementVNode("div",Ee,[e.createElementVNode("div",{class:"select pickerToggler",onClick:n[0]||(n[0]=r=>o.value=!o.value)},[typeof t.value=="string"&&t.value!==""&&e.unref(m).length>=1&&typeof e.unref(m)[0]=="string"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.value),1)],64)):typeof t.value=="string"&&e.unref(m).filter(r=>String(r[String(c.dataprop||c.prop)])===t.value).length>=1&&typeof e.unref(m).filter(r=>String(r[String(c.dataprop||c.prop)])===t.value)[0]=="object"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(m).filter(r=>String(r[String(c.dataprop||c.prop)])===t.value)[0][c.prop]),1)],64)):typeof t.value=="object"&&t.value!==null&&c.prop in t.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.value[c.prop]),1)],64)):Array.isArray(t.value)&&t.value.length>=1&&typeof t.value[0]=="string"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(t.value.join(", ")),1)],64)):Array.isArray(t.value)&&t.value.length>=1&&typeof t.value[0]=="object"&&c.prop in t.value[0]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(t.value.map(r=>r[c.prop]).join(", ")),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createTextVNode(e.toDisplayString(c.placeholder),1)],64))]),e.createElementVNode("div",Ne,[e.createElementVNode("div",Se,[e.createElementVNode("input",{type:"search",ref_key:"searchRef",ref:y,onInput:h,class:"input"},null,544)]),Array.isArray(t.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pickerMenu",style:e.normalizeStyle({"max-height":Number(c.size)!==0?Number(c.size)*42+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(r,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+r},[typeof r=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:e.withModifiers(N=>s(r),["stop"]),class:"pickerItem"},[e.createElementVNode("div",$e,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:t.value.includes(r),id:"check-"+(e.unref(d)+String(C)),style:{"pointer-events":"none"}},null,8,we),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(d)+String(C)),style:{"pointer-events":"none"}},e.toDisplayString(r),9,xe)])],8,Ve)):typeof r=="object"&&r!==null&&c.prop in r?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:e.withModifiers(N=>s(r,c.prop),["stop"]),class:"pickerItem"},[e.createElementVNode("div",Ie,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:t.value.includes(r),id:"check-"+(e.unref(d)+String(C)),style:{"pointer-events":"none"}},null,8,Le),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(d)+String(C)),style:{"pointer-events":"none"}},e.toDisplayString(r[c.prop]),9,ze)])],8,je)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(N=>s(r),["stop"]),class:"pickerItem"},[e.renderSlot(a.$slots,"default",{option:r,selected:t.value},void 0,!0)],8,Te))],64))),128))],4)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"pickerMenu",style:e.normalizeStyle({"max-height":Number(c.size)!==0?Number(c.size)*42+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(r,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+r},[typeof r=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:N=>l(r),class:e.normalizeClass(["pickerItem",t.value===r?"active":""])},e.toDisplayString(r),11,ve)):typeof r=="object"&&r!==null&&c.prop in r?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:N=>l(r),class:e.normalizeClass(["pickerItem",t.value[c.prop]===r[c.prop]||String(r[c.dataprop||c.prop])===String(t.value)?"active":""])},e.toDisplayString(r[c.prop]),11,Oe)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(N=>l(r),["stop"]),class:e.normalizeClass(["pickerItem",t.value===r?"active":""])},[e.renderSlot(a.$slots,"default",{option:r,selected:t.value},void 0,!0)],10,_e))],64))),128))],4)),e.createElementVNode("div",Fe,[e.createElementVNode("div",De,[e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[1]||(n[1]=r=>B.value=r),class:"input",placeholder:"Add New Category"},null,512),[[e.vModelText,B.value]]),e.createElementVNode("button",{type:"button",class:"button tedirCategoryButton",onClick:n[2]||(n[2]=r=>{u("add",B.value),B.value=""})},"Save")])])])])],2))}}),Ue="",Ae=E(Me,[["__scopeId","data-v-1814db96"]]);b.CategoryBox=Ae,b.ComboBox=q,b.ListBox=ie,b.SelectBox=A,b.TagBox=be,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
(function(S,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(S=typeof globalThis<"u"?globalThis:S||self,e(S.TedirSelect={},S.Vue))})(this,function(S,e){"use strict";const v={class:"pickerWrap"},V={class:"pickerContent"},_={class:"pickerHeader"},$=["onClick"],w={class:"check"},j=["checked","id"],x=["for"],I=["onClick"],L={class:"check"},z=["checked","id"],O=["for"],M=["onClick"],T=["onClick"],F=["onClick"],D=["onClick"],A=e.defineComponent({__name:"SelectBox",props:{modelValue:{default:{}},options:{default:[]},prop:{default:"value"},datatype:{default:""},dataprop:{default:""},placeholder:{default:"-- Select option --"},size:{default:0},type:{default:""}},emits:["update:modelValue","change","search"],setup(r,{emit:k}){const s=r,l=e.ref(s.modelValue||{}),i=e.ref(!1),p=e.ref(""),y=e.ref(null),B=e.ref(void 0);e.watch(()=>s.modelValue,()=>{l.value=s.modelValue});const C=()=>{clearTimeout(B.value),B.value=setTimeout(()=>{var n,a;p.value="",((n=y.value)==null?void 0:n.value)&&((a=y.value)==null?void 0:a.value)!==""&&(p.value=y.value.value),k("search",p.value)},500)},g=e.computed(()=>{let n=s.options;return p.value.length>=1&&(n=n.filter(a=>{if(isNaN(a)===!1&&Number(a)===Number(p.value))return!0;if(typeof a=="string"&&a.toLowerCase().includes(p.value.toLowerCase()))return!0;if(typeof a=="object"&&a!==null&&Object.prototype.toString.call(a)==="[object Object]")for(const t of Object.keys(a)){if(isNaN(a[t])===!1&&Number(a[t])===Number(p.value))return!0;if(typeof a[t]=="string"&&a[t].toLowerCase().includes(p.value.toLowerCase()))return!0}return!1})),n}),m=((n=10)=>{let a="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",t="";for(let o=0;o<n;o++)t+=a.charAt(Math.floor(Math.random()*a.length));return t})(),u=n=>{var a;n.target.style.display="none",i.value=!1,(a=y.value)!=null&&a.value&&(y.value.value="",p.value="")},f=(n,a="")=>{a!==""?l.value.map(t=>t[a]).includes(n[a])?l.value.splice(l.value.findIndex(t=>t[a]===n[a]),1):l.value.push(n):l.value.includes(n)?l.value.splice(l.value.findIndex(t=>t===n),1):l.value.push(n),k("update:modelValue",l.value),k("change",l.value,n)},d=n=>{typeof n=="object"&&n!==null&&String(s.datatype).toLowerCase()==="string"?(l.value=n[String(s.dataprop||s.prop)],k("update:modelValue",String(l.value))):typeof n=="object"&&n!==null&&String(s.datatype).toLowerCase()==="number"?(l.value=n[String(s.dataprop||s.prop)],k("update:modelValue",Number(l.value))):(l.value=n,k("update:modelValue",l.value)),i.value=!1,k("change",l.value,n)},c=e.computed(()=>{let n=(s==null?void 0:s.placeholder)||"-- Select option --";if(g.value.length>=1)if(typeof l.value=="number"){let a=g.value.filter(t=>Number(t[String(s.dataprop||s.prop)])===Number(l.value));typeof g.value[0]=="object"&&a.length>=1?n=a[0][String(s.prop)]:typeof g.value[0]=="number"&&(n=l.value)}else if(typeof l.value=="string"){let a=g.value.filter(t=>String(t[String(s.dataprop||s.prop)])===l.value);typeof g.value[0]=="object"&&a.length>=1?n=a[0][String(s.prop)]:typeof g.value[0]=="string"&&l.value!==""&&(n=l.value)}else typeof l.value=="object"&&(Array.isArray(l.value)&&l.value.length>=1?typeof l.value[0]=="object"&&String(s.prop)in l.value[0]?n=l.value.map(a=>a[String(s.prop)]).join(", "):n=l.value.join(", "):l.value!==null&&String(s.prop)in l.value&&(n=l.value[String(s.prop)]));return n});return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["picker suggestion",i.value?"active":""])},[e.createElementVNode("div",{class:"pickerBackdrop",style:e.normalizeStyle({display:i.value?"block":"none"}),onClick:u},null,4),e.createElementVNode("div",v,[e.createElementVNode("div",{class:"select pickerToggler",onClick:a[0]||(a[0]=t=>i.value=!i.value)},e.toDisplayString(e.unref(c)),1),e.createElementVNode("div",V,[e.createElementVNode("div",_,[e.createElementVNode("input",{type:"search",ref_key:"searchRef",ref:y,onInput:C,class:"input"},null,544)]),Array.isArray(l.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pickerMenu",style:e.normalizeStyle({"max-height":Number(r.size)!==0?Number(r.size)*42+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+t},[typeof t=="string"&&r.type!=="slot"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:e.withModifiers(b=>f(t),["stop"]),class:"pickerItem"},[e.createElementVNode("div",w,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:l.value.includes(t),id:"check-"+(e.unref(m)+String(o)),style:{"pointer-events":"none"}},null,8,j),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(m)+String(o)),style:{"pointer-events":"none"}},e.toDisplayString(t),9,x)])],8,$)):typeof t=="object"&&t!==null&&r.prop in t&&r.type!=="slot"?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:e.withModifiers(b=>f(t,r.prop),["stop"]),class:"pickerItem"},[e.createElementVNode("div",L,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:l.value.includes(t),id:"check-"+(e.unref(m)+String(o)),style:{"pointer-events":"none"}},null,8,z),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(m)+String(o)),style:{"pointer-events":"none"}},e.toDisplayString(t[r.prop]),9,O)])],8,I)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(b=>f(t),["stop"]),class:"pickerItem"},[e.renderSlot(n.$slots,"default",{option:t,selected:l.value},void 0,!0)],8,M))],64))),128))],4)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"pickerMenu",style:e.normalizeStyle({"max-height":Number(r.size)!==0?Number(r.size)*42+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+t},[typeof t=="string"&&r.type!=="slot"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:b=>d(t),class:e.normalizeClass(["pickerItem",l.value===t?"active":""])},e.toDisplayString(t),11,T)):typeof t=="object"&&t!==null&&r.prop in t&&r.type!=="slot"?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:b=>d(t),class:e.normalizeClass(["pickerItem",l.value[r.prop]===t[r.prop]||String(t[r.dataprop||r.prop])===String(l.value)?"active":""])},e.toDisplayString(t[r.prop]),11,F)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(b=>d(t),["stop"]),class:e.normalizeClass(["pickerItem",l.value===t?"active":""])},[e.renderSlot(n.$slots,"default",{option:t,selected:l.value},void 0,!0)],10,D))],64))),128))],4))])])],2))}}),We="",N=(r,k)=>{const s=r.__vccOpts||r;for(const[l,i]of k)s[l]=i;return s},R=N(A,[["__scopeId","data-v-f5c4006d"]]),W={class:"pickerWrap"},H={class:"pickerContent pickerSizing"},K=["onClick"],P=["onClick"],U=["onClick"],q=e.defineComponent({__name:"ComboBox",props:{modelValue:{default:null},options:{default:[]},prop:{default:"value"},placeholder:{default:"Search option"},size:{default:0},select:{type:Boolean,default:!1}},emits:["update:modelValue","search"],setup(r,{emit:k}){const s=r,l=e.ref(!1),i=e.ref(""),p=e.ref(null),y=e.ref(void 0),B=e.computed(()=>{let h=s.options;return i.value.length>=1&&(h=h.filter(m=>{if(isNaN(m)===!1&&Number(m)===Number(i.value))return!0;if(typeof m=="string"&&m.toLowerCase().includes(i.value.toLowerCase()))return!0;if(typeof m=="object"&&m!==null&&Object.prototype.toString.call(m)==="[object Object]")for(const u of Object.keys(m)){if(isNaN(m[u])===!1&&Number(m[u])===Number(i.value))return!0;if(typeof m[u]=="string"&&m[u].toLowerCase().includes(i.value.toLowerCase()))return!0}return!1})),h}),C=()=>{clearTimeout(y.value),y.value=setTimeout(()=>{var h,m;i.value="",((h=p.value)==null?void 0:h.value)&&((m=p.value)==null?void 0:m.value)!==""&&(i.value=p.value.value),k("search",i.value),B.value.length>=1&&i.value!==""?l.value=!0:l.value=!1},500)},g=h=>{h.target.style.display="none",l.value=!1};return(h,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["picker suggestion",l.value?"active":""])},[e.createElementVNode("div",{class:"pickerBackdrop",style:e.normalizeStyle({display:l.value?"block":"none"}),onClick:g},null,4),e.createElementVNode("div",W,[r.select?(e.openBlock(),e.createElementBlock("input",{key:0,type:"search",ref_key:"searchRef",ref:p,onInput:C,onClick:m[0]||(m[0]=u=>l.value=!0),class:"select"},null,544)):(e.openBlock(),e.createElementBlock("input",{key:1,type:"search",ref_key:"searchRef",ref:p,onInput:C,onClick:m[1]||(m[1]=u=>e.unref(B).length>=1&&i.value!==""?l.value=!0:l.value=!1),class:"input"},null,544)),e.createElementVNode("div",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(B),(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+u},[typeof u=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:d=>{i.value=u,k("update:modelValue",u),l.value=!1},class:e.normalizeClass(["pickerItem",r.modelValue===u?"active":""])},e.toDisplayString(u),11,K)):typeof u=="object"&&r.prop in u?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:d=>{i.value=u[r.prop],k("update:modelValue",u),l.value=!1},class:e.normalizeClass(["pickerItem",r.modelValue[r.prop]===u[r.prop]?"active":""])},e.toDisplayString(u[r.prop]),11,P)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:d=>{i.value=u,k("update:modelValue",u),l.value=!1},class:e.normalizeClass(["pickerItem",r.modelValue===u?"active":""])},[e.renderSlot(h.$slots,"default",{option:u},void 0,!0)],10,U))],64))),128))])])],2))}}),He="",G=N(q,[["__scopeId","data-v-f7a05695"]]),J={class:"list"},Q={class:"listHeader"},X=["onClick"],Y={class:"check"},Z=["checked","id"],ee=["for"],le=["onClick"],te={class:"check"},ae=["checked","id"],ne=["for"],ce=["onClick"],re=["onClick"],se=["onClick"],oe=["onClick"],ie=e.defineComponent({__name:"ListBox",props:{modelValue:{default:{}},options:{default:[]},prop:{default:"value"},datatype:{default:""},dataprop:{default:""},size:{default:0}},emits:["update:modelValue","change","search"],setup(r,{emit:k}){const s=r,l=e.ref(s.modelValue||{}),i=e.ref(""),p=e.ref(null),y=e.ref(void 0);e.watch(()=>s.modelValue,()=>{l.value=s.modelValue});const B=()=>{clearTimeout(y.value),y.value=setTimeout(()=>{var f,d;i.value="",((f=p.value)==null?void 0:f.value)&&((d=p.value)==null?void 0:d.value)!==""&&(i.value=p.value.value),k("search",i.value)},500)},C=e.computed(()=>{let f=s.options;return i.value.length>=1&&(f=f.filter(d=>{if(isNaN(d)===!1&&Number(d)===Number(i.value))return!0;if(typeof d=="string"&&d.toLowerCase().includes(i.value.toLowerCase()))return!0;if(typeof d=="object"&&d!==null&&Object.prototype.toString.call(d)==="[object Object]")for(const c of Object.keys(d)){if(isNaN(d[c])===!1&&Number(d[c])===Number(i.value))return!0;if(typeof d[c]=="string"&&d[c].toLowerCase().includes(i.value.toLowerCase()))return!0}return!1})),f}),h=(()=>{let f="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",d="";for(let c=0;c<10;c++)d+=f.charAt(Math.floor(Math.random()*f.length));return d})(),m=(f,d="")=>{d!==""?l.value.map(c=>c[d]).includes(f[d])?l.value.splice(l.value.findIndex(c=>c[d]===f[d]),1):l.value.push(f):l.value.includes(f)?l.value.splice(l.value.findIndex(c=>c===f),1):l.value.push(f),k("update:modelValue",l.value),k("change",l.value,f)},u=f=>{typeof f=="object"&&f!==null&&String(s.datatype).toLowerCase()==="string"?(l.value=f[String(s.dataprop||s.prop)],k("update:modelValue",String(l.value))):typeof f=="object"&&f!==null&&String(s.datatype).toLowerCase()==="number"?(l.value=f[String(s.dataprop||s.prop)],k("update:modelValue",Number(l.value))):(l.value=f,k("update:modelValue",l.value)),k("change",l.value,f)};return(f,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",J,[e.createElementVNode("div",Q,[e.createElementVNode("input",{type:"search",ref_key:"searchRef",ref:p,onInput:B,class:"input"},null,544)]),Array.isArray(r.modelValue)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"listMenu",style:e.normalizeStyle({"max-height":Number(r.size)!==0?Number(r.size)*44+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(C),(c,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+c},[typeof c=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:e.withModifiers(a=>m(c),["stop"]),class:"listItem"},[e.createElementVNode("div",Y,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:l.value.includes(c),id:"check-"+(e.unref(h)+String(n)),style:{"pointer-events":"none"}},null,8,Z),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(h)+String(n)),style:{"pointer-events":"none"}},e.toDisplayString(c),9,ee)])],8,X)):typeof c=="object"&&r.prop in c?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:e.withModifiers(a=>m(c,r.prop),["stop"]),class:"listItem"},[e.createElementVNode("div",te,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:l.value.includes(c),id:"check-"+(e.unref(h)+String(n)),style:{"pointer-events":"none"}},null,8,ae),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(h)+String(n)),style:{"pointer-events":"none"}},e.toDisplayString(c[r.prop]),9,ne)])],8,le)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(a=>m(c),["stop"]),class:e.normalizeClass(["listItem",l.value.includes(c)?"active":""])},[e.renderSlot(f.$slots,"default",{option:c,selected:l.value},void 0,!0)],10,ce))],64))),128))],4)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"listMenu",style:e.normalizeStyle({"max-height":Number(r.size)!==0?Number(r.size)*44+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(C),(c,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+c},[typeof c=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:a=>u(c),class:e.normalizeClass(["listItem",l.value===c?"active":""])},e.toDisplayString(c),11,re)):typeof c=="object"&&r.prop in c?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:a=>u(c),class:e.normalizeClass(["listItem",l.value[r.prop]===c[r.prop]||String(c[r.dataprop||r.prop])===String(l.value)?"active":""])},e.toDisplayString(c[r.prop]),11,se)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(a=>u(c),["stop"]),class:e.normalizeClass(["listItem",l.value===c?"active":""])},[e.renderSlot(f.$slots,"default",{option:c,selected:l.value},void 0,!0)],10,oe))],64))),128))],4))])]))}}),Ke="",de=N(ie,[["__scopeId","data-v-d7fed8bc"]]),ue=r=>(e.pushScopeId("data-v-3acd22f1"),r=r(),e.popScopeId(),r),fe={class:"tagWrap"},pe={class:"tags"},ke={class:"tag groupItem"},me=["onClick"],he=[ue(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1))],ye={class:"tagContent"},ge=["onClick"],Be=["onClick"],Ce=["onClick"],be=e.defineComponent({__name:"TagBox",props:{modelValue:{default:[]},options:{default:[]},prop:{default:"value"},placeholder:{default:"Add new tag"},size:{default:0},separator:{default:","}},emits:["update:modelValue"],setup(r,{emit:k}){const s=r,l=e.ref(!1),i=e.ref(""),p=e.ref(null),y=e.reactive(s.modelValue||[]),B=e.ref(s.options||[]),C=e.ref(s.separator||","),g=e.ref(s.prop||"value"),h=e.computed(()=>{let d=B.value;return i.value.length>=1&&(d=d.filter(c=>{if(isNaN(c)===!1&&Number(c)===Number(i.value))return!0;if(typeof c=="string"&&c.toLowerCase().includes(i.value.toLowerCase()))return!0;if(typeof c=="object"&&c!==null&&Object.prototype.toString.call(c)==="[object Object]")for(const n of Object.keys(c)){if(isNaN(c[n])===!1&&Number(c[n])===Number(i.value))return!0;if(typeof c[n]=="string"&&c[n].toLowerCase().includes(i.value.toLowerCase()))return!0}return!1})),d}),m=()=>{p.value.focus()},u=d=>{if(d.key!=="Enter"&&h.value.length>=1?l.value=!0:l.value=!1,i.value.endsWith(C.value)||d.key==="Enter"){const c=i.value.replace(C.value,"");y.includes(c)||(y.push(c),B.value.includes(c)&&(B.value=B.value.filter(n=>typeof n=="string"&&n!==c?!0:typeof n=="object"&&g.value in n&&n[g.value]!==c))),i.value="",k("update:modelValue",y)}};e.watch(i,()=>{if(p.value!==null){const d=document.createElement("div");d.style.width="max-content",d.style.position="absolute",d.style.visibility="hidden";const c=i.value.length>=2?i.value:p.value.getAttribute("placeholder");d.innerHTML=c.replace(/ /g," ").trim(),document.body.appendChild(d);const n=Math.ceil(Number(window.getComputedStyle(d).width.replace("px","")))+30;p.value.style.setProperty("width",n+"px"),d.remove()}});const f=d=>{d.target.style.display="none",l.value=!1};return(d,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["taggable",{active:l.value===!0}])},[e.createElementVNode("div",{class:"tagBackdrop",style:e.normalizeStyle({display:l.value?"block":"none"}),onClick:f},null,4),e.createElementVNode("div",fe,[e.createElementVNode("div",{class:"input tagToggler",onClick:m},[e.createElementVNode("div",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y,(n,a)=>(e.openBlock(),e.createElementBlock("div",{key:"tag-"+a,class:"group"},[e.createElementVNode("div",ke,[typeof n=="string"&&n!==""?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(n),1)],64)):typeof n=="object"&&g.value in n?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n[g.value]),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(r.placeholder),1)],64))]),e.createElementVNode("div",{class:"tag groupItem",onClick:t=>y.splice(a,1)},he,8,me)]))),128)),e.withDirectives(e.createElementVNode("input",{type:"search",ref_key:"inputRef",ref:p,"onUpdate:modelValue":c[0]||(c[0]=n=>i.value=n),class:"tagInput",onInput:c[1]||(c[1]=n=>u(n)),onKeyup:c[2]||(c[2]=e.withKeys(n=>u(n),["enter"])),placeholder:"Add new tag"},null,544),[[e.vModelText,i.value]])])]),e.createElementVNode("div",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+n},[typeof n=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:t=>{i.value=n+",",u(t)},class:"tagItem"},e.toDisplayString(n),9,ge)):typeof n=="object"&&g.value in n?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:t=>{i.value=n[g.value]+",",u(t)},class:"tagItem"},e.toDisplayString(n[g.value]),9,Be)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:t=>{i.value=n+",",u(t)},class:"tagItem"},[e.renderSlot(d.$slots,"default",{option:n},void 0,!0)],8,Ce))],64))),128))])])],2))}}),Ue="",Se=N(be,[["__scopeId","data-v-3acd22f1"]]),Ne={class:"pickerOverlay pickerWrap"},Ee={class:"pickerContent"},ve={class:"pickerHeader"},Ve=["onClick"],_e={class:"check"},$e=["checked","id"],we=["for"],je=["onClick"],xe={class:"check"},Ie=["checked","id"],Le=["for"],ze=["onClick"],Oe=["onClick"],Me=["onClick"],Te=["onClick"],Fe={class:"pickerFooter"},De={class:"tedirCategoryAdd"},Ae=e.defineComponent({__name:"CategoryBox",props:{modelValue:{default:{}},options:{default:[]},prop:{default:"value"},datatype:{default:""},dataprop:{default:""},placeholder:{default:"-- Select option --"},size:{default:0}},emits:["update:modelValue","change","add","search"],setup(r,{emit:k}){const s=r,l=e.ref(s.modelValue||{}),i=e.ref(!1),p=e.ref(""),y=e.ref(null),B=e.ref(void 0),C=e.ref("");e.watch(()=>s.modelValue,()=>{l.value=s.modelValue});const g=()=>{clearTimeout(B.value),B.value=setTimeout(()=>{var a,t;p.value="",((a=y.value)==null?void 0:a.value)&&((t=y.value)==null?void 0:t.value)!==""&&(p.value=y.value.value),k("search",p.value)},500)},h=e.computed(()=>{let a=s.options;return p.value.length>=1&&(a=a.filter(t=>{if(isNaN(t)===!1&&Number(t)===Number(p.value))return!0;if(typeof t=="string"&&t.toLowerCase().includes(p.value.toLowerCase()))return!0;if(typeof t=="object"&&t!==null&&Object.prototype.toString.call(t)==="[object Object]")for(const o of Object.keys(t)){if(isNaN(t[o])===!1&&Number(t[o])===Number(p.value))return!0;if(typeof t[o]=="string"&&t[o].toLowerCase().includes(p.value.toLowerCase()))return!0}return!1})),a}),u=((a=10)=>{let t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",o="";for(let b=0;b<a;b++)o+=t.charAt(Math.floor(Math.random()*t.length));return o})(),f=a=>{var t;a.target.style.display="none",i.value=!1,(t=y.value)!=null&&t.value&&(y.value.value="",p.value="")},d=(a,t="")=>{t!==""?l.value.map(o=>o[t]).includes(a[t])?l.value.splice(l.value.findIndex(o=>o[t]===a[t]),1):l.value.push(a):l.value.includes(a)?l.value.splice(l.value.findIndex(o=>o===a),1):l.value.push(a),k("update:modelValue",l.value),k("change",l.value,a)},c=a=>{typeof a=="object"&&a!==null&&String(s.datatype).toLowerCase()==="string"?(l.value=a[String(s.dataprop||s.prop)],k("update:modelValue",String(l.value))):typeof a=="object"&&a!==null&&String(s.datatype).toLowerCase()==="number"?(l.value=a[String(s.dataprop||s.prop)],k("update:modelValue",Number(l.value))):(l.value=a,k("update:modelValue",l.value)),i.value=!1,k("change",l.value,a)},n=e.computed(()=>{let a=(s==null?void 0:s.placeholder)||"-- Select option --";if(h.value.length>=1)if(typeof l.value=="number"){let t=h.value.filter(o=>Number(o[String(s.dataprop||s.prop)])===Number(l.value));typeof h.value[0]=="object"&&t.length>=1?a=t[0][String(s.prop)]:typeof h.value[0]=="number"&&(a=l.value)}else if(typeof l.value=="string"){let t=h.value.filter(o=>String(o[String(s.dataprop||s.prop)])===l.value);typeof h.value[0]=="object"&&t.length>=1?a=t[0][String(s.prop)]:typeof h.value[0]=="string"&&l.value!==""&&(a=l.value)}else typeof l.value=="object"&&(Array.isArray(l.value)&&l.value.length>=1?typeof l.value[0]=="object"&&String(s.prop)in l.value[0]?a=l.value.map(t=>t[String(s.prop)]).join(", "):a=l.value.join(", "):l.value!==null&&String(s.prop)in l.value&&(a=l.value[String(s.prop)]));return a});return(a,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["picker suggestion tedirCategory",i.value?"active":""])},[e.createElementVNode("div",{class:"pickerBackdrop",style:e.normalizeStyle({display:i.value?"block":"none"}),onClick:f},null,4),e.createElementVNode("div",Ne,[e.createElementVNode("div",{class:"select pickerToggler",onClick:t[0]||(t[0]=o=>i.value=!i.value)},e.toDisplayString(e.unref(n)),1),e.createElementVNode("div",Ee,[e.createElementVNode("div",ve,[e.createElementVNode("input",{type:"search",ref_key:"searchRef",ref:y,onInput:g,class:"input"},null,544)]),Array.isArray(l.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pickerMenu",style:e.normalizeStyle({"max-height":Number(r.size)!==0?Number(r.size)*42+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(o,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+o},[typeof o=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:e.withModifiers(E=>d(o),["stop"]),class:"pickerItem"},[e.createElementVNode("div",_e,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:l.value.includes(o),id:"check-"+(e.unref(u)+String(b)),style:{"pointer-events":"none"}},null,8,$e),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(u)+String(b)),style:{"pointer-events":"none"}},e.toDisplayString(o),9,we)])],8,Ve)):typeof o=="object"&&o!==null&&r.prop in o?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:e.withModifiers(E=>d(o,r.prop),["stop"]),class:"pickerItem"},[e.createElementVNode("div",xe,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:l.value.includes(o),id:"check-"+(e.unref(u)+String(b)),style:{"pointer-events":"none"}},null,8,Ie),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(u)+String(b)),style:{"pointer-events":"none"}},e.toDisplayString(o[r.prop]),9,Le)])],8,je)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(E=>d(o),["stop"]),class:"pickerItem"},[e.renderSlot(a.$slots,"default",{option:o,selected:l.value},void 0,!0)],8,ze))],64))),128))],4)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"pickerMenu",style:e.normalizeStyle({"max-height":Number(r.size)!==0?Number(r.size)*42+"px":"auto"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(o,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+o},[typeof o=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:E=>c(o),class:e.normalizeClass(["pickerItem",l.value===o?"active":""])},e.toDisplayString(o),11,Oe)):typeof o=="object"&&o!==null&&r.prop in o?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:E=>c(o),class:e.normalizeClass(["pickerItem",l.value[r.prop]===o[r.prop]||String(o[r.dataprop||r.prop])===String(l.value)?"active":""])},e.toDisplayString(o[r.prop]),11,Me)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(E=>c(o),["stop"]),class:e.normalizeClass(["pickerItem",l.value===o?"active":""])},[e.renderSlot(a.$slots,"default",{option:o,selected:l.value},void 0,!0)],10,Te))],64))),128))],4)),e.createElementVNode("div",Fe,[e.createElementVNode("div",De,[e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":t[1]||(t[1]=o=>C.value=o),class:"input",placeholder:"Add New Category"},null,512),[[e.vModelText,C.value]]),e.createElementVNode("button",{type:"button",class:"button tedirCategoryButton",onClick:t[2]||(t[2]=o=>{k("add",C.value),C.value=""})},"Save")])])])])],2))}}),qe="",Re=N(Ae,[["__scopeId","data-v-93d03657"]]);S.CategoryBox=Re,S.ComboBox=G,S.ListBox=de,S.SelectBox=R,S.TagBox=Se,Object.defineProperties(S,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); |
{ | ||
"name": "tedir-select", | ||
"version": "0.0.1-alpha-5", | ||
"version": "0.0.1-alpha-6", | ||
"description": "Tedir Select is a Vue 3 & Web Component Custom SelectBox, ListBox, Taggable, etc.", | ||
@@ -5,0 +5,0 @@ "main": "dist/vue/tedir-select-vue.umd.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
552804
6514