New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tedir-select

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tedir-select - npm Package Compare versions

Comparing version 0.0.1-alpha-8 to 0.0.1-alpha-9

613

dist/vue/tedir-select-vue.es.js

@@ -1,2 +0,2 @@

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 U, popScopeId as D } from "vue";
import { defineComponent as z, ref as b, watch as M, computed as B, openBlock as o, createElementBlock as i, normalizeClass as N, createElementVNode as f, normalizeStyle as V, toDisplayString as S, 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 U, popScopeId as D } from "vue";
const K = { 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({

@@ -16,4 +16,4 @@ __name: "SelectBox",

emits: ["update:modelValue", "change", "search"],
setup(u, { emit: h }) {
const c = u, e = C(c.modelValue || {}), i = C(!1), k = C(""), b = C(null), w = C(void 0);
setup(u, { emit: k }) {
const c = u, e = b(c.modelValue || {}), d = b(!1), h = b(""), g = b(null), w = b(void 0);
M(() => c.modelValue, () => {

@@ -25,16 +25,16 @@ e.value = c.modelValue;

var a, t;
k.value = "", ((a = b.value) == null ? void 0 : a.value) && ((t = b.value) == null ? void 0 : t.value) !== "" && (k.value = b.value.value), h("search", k.value);
h.value = "", ((a = g.value) == null ? void 0 : a.value) && ((t = g.value) == null ? void 0 : t.value) !== "" && (h.value = g.value.value), k("search", h.value);
}, 500);
}, S = B(() => {
}, C = B(() => {
let a = c.options;
return k.value.length >= 1 && (a = a.filter((t) => {
if (isNaN(t) === !1 && Number(t) === Number(k.value))
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 l of Object.keys(t)) {
if (isNaN(t[l]) === !1 && Number(t[l]) === Number(k.value))
if (isNaN(t[l]) === !1 && Number(t[l]) === Number(h.value))
return !0;
if (typeof t[l] == "string" && t[l].toLowerCase().includes(k.value.toLowerCase()))
if (typeof t[l] == "string" && t[l].toLowerCase().includes(h.value.toLowerCase()))
return !0;

@@ -46,21 +46,21 @@ }

let t = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", l = "";
for (let n = 0; n < a; n++)
for (let r = 0; r < a; r++)
l += t.charAt(Math.floor(Math.random() * t.length));
return l;
})(), f = (a) => {
})(), p = (a) => {
var t;
a.target.style.display = "none", i.value = !1, (t = b.value) != null && t.value && (b.value.value = "", k.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), h("update:modelValue", e.value), h("change", e.value, a);
}, d = (a) => {
typeof a == "object" && a !== null && String(c.datatype).toLowerCase() === "string" ? (e.value = a[String(c.dataprop || c.prop)], h("update:modelValue", String(e.value))) : typeof a == "object" && a !== null && String(c.datatype).toLowerCase() === "number" ? (e.value = a[String(c.dataprop || c.prop)], h("update:modelValue", Number(e.value))) : (e.value = a, h("update:modelValue", e.value)), i.value = !1, h("change", e.value, a);
a.target.style.display = "none", d.value = !1, (t = g.value) != null && t.value && (g.value.value = "", h.value = "");
}, n = (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);
}, v = (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)), d.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 (C.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);
let t = C.value.filter((l) => Number(l[String(c.dataprop || c.prop)]) === Number(e.value));
typeof C.value[0] == "object" && t.length >= 1 ? a = t[0][String(c.prop)] : typeof C.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);
let t = C.value.filter((l) => String(l[String(c.dataprop || c.prop)]) === e.value);
typeof C.value[0] == "object" && t.length >= 1 ? a = t[0][String(c.prop)] : typeof C.value[0] == "string" && e.value !== "" && (a = e.value);
} else

@@ -70,21 +70,21 @@ 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, t) => (r(), o("div", {
class: N(["picker suggestion", { active: i.value, pickerUp: u.up }])
return (a, t) => (o(), i("div", {
class: N(["picker suggestion", { active: d.value, pickerUp: u.up }])
}, [
v("div", {
f("div", {
class: "pickerBackdrop",
style: V({ display: i.value ? "block" : "none" }),
onClick: f
style: V({ display: d.value ? "block" : "none" }),
onClick: p
}, null, 4),
v("div", K, [
v("div", {
f("div", K, [
f("div", {
class: "select pickerToggler",
onClick: t[0] || (t[0] = (l) => i.value = !i.value)
}, $(m(s)), 1),
v("div", P, [
v("div", q, [
v("input", {
onClick: t[0] || (t[0] = (l) => d.value = !d.value)
}, S(m(s)), 1),
f("div", P, [
f("div", q, [
f("input", {
type: "search",
ref_key: "searchRef",
ref: b,
ref: g,
onInput: j,

@@ -94,3 +94,3 @@ class: "input"

]),
Array.isArray(e.value) ? (r(), o("div", {
Array.isArray(e.value) ? (o(), i("div", {
key: 0,

@@ -100,46 +100,46 @@ class: "pickerMenu",

}, [
(r(!0), o(_, null, O(m(S), (l, n) => (r(), o(_, {
(o(!0), i(_, null, O(m(C), (l, r) => (o(), i(_, {
key: "option-" + l
}, [
typeof l == "string" && u.type !== "slot" ? (r(), o("div", {
typeof l == "string" && u.type !== "slot" ? (o(), i("div", {
key: 0,
onClick: x((I) => p(l), ["stop"]),
onClick: x((I) => n(l), ["stop"]),
class: "pickerItem"
}, [
v("div", J, [
v("input", {
f("div", J, [
f("input", {
type: "checkbox",
class: "checkInput",
checked: e.value.includes(l),
id: "check-" + (m(y) + String(n)),
id: "check-" + (m(y) + String(r)),
style: { "pointer-events": "none" }
}, null, 8, Q),
v("label", {
f("label", {
class: "checkLabel",
for: "check-" + (m(y) + String(n)),
for: "check-" + (m(y) + String(r)),
style: { "pointer-events": "none" }
}, $(l), 9, X)
}, S(l), 9, X)
])
], 8, G)) : typeof l == "object" && l !== null && u.prop in l && u.type !== "slot" ? (r(), o("div", {
], 8, G)) : typeof l == "object" && l !== null && u.prop in l && u.type !== "slot" ? (o(), i("div", {
key: 1,
onClick: x((I) => p(l, u.prop), ["stop"]),
onClick: x((I) => n(l, u.prop), ["stop"]),
class: "pickerItem"
}, [
v("div", Z, [
v("input", {
f("div", Z, [
f("input", {
type: "checkbox",
class: "checkInput",
checked: e.value.includes(l),
id: "check-" + (m(y) + String(n)),
id: "check-" + (m(y) + String(r)),
style: { "pointer-events": "none" }
}, null, 8, ee),
v("label", {
f("label", {
class: "checkLabel",
for: "check-" + (m(y) + String(n)),
for: "check-" + (m(y) + String(r)),
style: { "pointer-events": "none" }
}, $(l[u.prop]), 9, le)
}, S(l[u.prop]), 9, le)
])
], 8, Y)) : (r(), o("div", {
], 8, Y)) : (o(), i("div", {
key: 2,
onClick: x((I) => p(l), ["stop"]),
onClick: x((I) => n(l), ["stop"]),
class: "pickerItem"

@@ -153,3 +153,3 @@ }, [

], 64))), 128))
], 4)) : (r(), o("div", {
], 4)) : (o(), i("div", {
key: 1,

@@ -159,16 +159,16 @@ class: "pickerMenu",

}, [
(r(!0), o(_, null, O(m(S), (l, n) => (r(), o(_, {
(o(!0), i(_, null, O(m(C), (l, r) => (o(), i(_, {
key: "option-" + l
}, [
typeof l == "string" && u.type !== "slot" ? (r(), o("div", {
typeof l == "string" && u.type !== "slot" ? (o(), i("div", {
key: 0,
onClick: (I) => d(l),
onClick: (I) => v(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", {
}, S(l), 11, ae)) : typeof l == "object" && l !== null && u.prop in l && u.type !== "slot" ? (o(), i("div", {
key: 1,
onClick: (I) => d(l),
onClick: (I) => v(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", {
}, S(l[u.prop]), 11, se)) : (o(), i("div", {
key: 2,
onClick: x((I) => d(l), ["stop"]),
onClick: x((I) => v(l), ["stop"]),
class: N(["pickerItem", e.value === l ? "active" : ""])

@@ -188,6 +188,6 @@ }, [

});
const A = (u, h) => {
const A = (u, k) => {
const c = u.__vccOpts || u;
for (const [e, i] of h)
c[e] = i;
for (const [e, d] of k)
c[e] = d;
return c;

@@ -203,80 +203,77 @@ }, ul = /* @__PURE__ */ A(ce, [["__scopeId", "data-v-ca470346"]]), ne = { class: "pickerWrap" }, re = { class: "pickerContent pickerSizing" }, oe = ["onClick"], ie = ["onClick"], de = ["onClick"], ve = /* @__PURE__ */ z({

select: { type: Boolean, default: !1 },
up: { type: Boolean, default: !1 }
up: { type: Boolean, default: !1 },
serverSearch: { type: Boolean, default: !1 }
},
emits: ["update:modelValue", "change", "search"],
setup(u, { emit: h }) {
const c = u, e = C(!1), i = C(""), k = 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))
setup(u, { emit: k }) {
const c = u, e = b(!1), d = b(""), h = b(null), g = b(void 0), w = B(() => {
let y = c.options;
return d.value.length >= 1 && c.serverSearch !== !0 && (y = y.filter((p) => {
if (isNaN(p) === !1 && Number(p) === Number(d.value))
return !0;
if (typeof y == "string" && y.toLowerCase().includes(i.value.toLowerCase()))
if (typeof p == "string" && p.toLowerCase().includes(d.value.toLowerCase()))
return !0;
if (typeof y == "object" && y !== null && Object.prototype.toString.call(y) === "[object Object]")
for (const f of Object.keys(y)) {
if (isNaN(y[f]) === !1 && Number(y[f]) === Number(i.value))
if (typeof p == "object" && p !== null && Object.prototype.toString.call(p) === "[object Object]")
for (const n of Object.keys(p)) {
if (isNaN(p[n]) === !1 && Number(p[n]) === Number(d.value))
return !0;
if (typeof y[f] == "string" && y[f].toLowerCase().includes(i.value.toLowerCase()))
if (typeof p[n] == "string" && p[n].toLowerCase().includes(d.value.toLowerCase()))
return !0;
}
return !1;
})), g;
})), y;
}), j = () => {
clearTimeout(b.value), b.value = setTimeout(() => {
var g, y;
i.value = "", ((g = k.value) == null ? void 0 : g.value) && ((y = k.value) == null ? void 0 : y.value) !== "" && (i.value = k.value.value), h("search", i.value), w.value.length >= 1 && i.value !== "" ? e.value = !0 : e.value = !1;
clearTimeout(g.value), g.value = setTimeout(() => {
var y, p;
d.value = "", ((y = h.value) == null ? void 0 : y.value) && ((p = h.value) == null ? void 0 : p.value) !== "" && (d.value = h.value.value), k("search", d.value), w.value.length >= 1 && d.value !== "" ? e.value = !0 : e.value = !1;
}, 500);
}, S = (g) => {
g.target.style.display = "none", e.value = !1;
}, C = (y, p) => {
(typeof y == "string" || isNaN(y) === !1) && (d.value = y, h.value.value = y), k("update:modelValue", p), k("change", y, p), e.value = !1;
}, $ = (y) => {
y.target.style.display = "none", e.value = !1;
};
return (g, y) => (r(), o("div", {
return (y, p) => (o(), i("div", {
class: N(["picker suggestion", { active: e.value, pickerUp: u.up }])
}, [
v("div", {
f("div", {
class: "pickerBackdrop",
style: V({ display: e.value ? "block" : "none" }),
onClick: S
onClick: $
}, null, 4),
v("div", ne, [
u.select ? (r(), o("input", {
f("div", ne, [
u.select ? (o(), i("input", {
key: 0,
type: "search",
ref_key: "searchRef",
ref: k,
ref: h,
onInput: j,
onClick: y[0] || (y[0] = (f) => e.value = !0),
onClick: p[0] || (p[0] = (n) => e.value = !0),
class: "select"
}, null, 544)) : (r(), o("input", {
}, null, 544)) : (o(), i("input", {
key: 1,
type: "search",
ref_key: "searchRef",
ref: k,
ref: h,
onInput: j,
onClick: y[1] || (y[1] = (f) => m(w).length >= 1 && i.value !== "" ? e.value = !0 : e.value = !1),
onClick: p[1] || (p[1] = (n) => m(w).length >= 1 && d.value !== "" ? e.value = !0 : e.value = !1),
class: "input"
}, null, 544)),
v("div", re, [
(r(!0), o(_, null, O(m(w), (f, p) => (r(), o(_, {
key: "option-" + f
f("div", re, [
(o(!0), i(_, null, O(m(w), (n, v) => (o(), i(_, {
key: "option-" + n
}, [
typeof f == "string" ? (r(), o("div", {
typeof n == "string" ? (o(), i("div", {
key: 0,
onClick: (d) => {
i.value = f, h("update:modelValue", f), h("change", f, f), e.value = !1;
},
class: N(["pickerItem", u.modelValue === f ? "active" : ""])
}, $(f), 11, oe)) : typeof f == "object" && u.prop in f ? (r(), o("div", {
onClick: (s) => C(n, n),
class: N(["pickerItem", u.modelValue === n ? "active" : ""])
}, S(n), 11, oe)) : typeof n == "object" && u.prop in n ? (o(), i("div", {
key: 1,
onClick: (d) => {
i.value = f[u.prop], h("update:modelValue", f), h("change", f[u.prop], f), e.value = !1;
},
class: N(["pickerItem", u.modelValue[u.prop] === f[u.prop] ? "active" : ""])
}, $(f[u.prop]), 11, ie)) : (r(), o("div", {
onClick: (s) => C(n[u.prop], n),
class: N(["pickerItem", u.modelValue[u.prop] === n[u.prop] ? "active" : ""])
}, S(n[u.prop]), 11, ie)) : (o(), i("div", {
key: 2,
onClick: (d) => {
i.value = f, h("update:modelValue", f), h("change", f, f), e.value = !1;
},
class: N(["pickerItem", u.modelValue === f ? "active" : ""])
onClick: (s) => C(n, n),
class: N(["pickerItem", u.modelValue === n ? "active" : ""])
}, [
L(g.$slots, "default", { option: f }, void 0, !0)
L(y.$slots, "default", { option: n }, void 0, !0)
], 10, de))

@@ -289,3 +286,3 @@ ], 64))), 128))

});
const cl = /* @__PURE__ */ A(ve, [["__scopeId", "data-v-51416808"]]), 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({
const cl = /* @__PURE__ */ A(ve, [["__scopeId", "data-v-6171fab7"]]), 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",

@@ -301,4 +298,4 @@ props: {

emits: ["update:modelValue", "change", "search"],
setup(u, { emit: h }) {
const c = u, e = C(c.modelValue || {}), i = C(""), k = C(null), b = C(void 0);
setup(u, { emit: k }) {
const c = u, e = b(c.modelValue || {}), d = b(""), h = b(null), g = b(void 0);
M(() => c.modelValue, () => {

@@ -308,39 +305,39 @@ e.value = c.modelValue;

const w = () => {
clearTimeout(b.value), b.value = setTimeout(() => {
var p, d;
i.value = "", ((p = k.value) == null ? void 0 : p.value) && ((d = k.value) == null ? void 0 : d.value) !== "" && (i.value = k.value.value), h("search", i.value);
clearTimeout(g.value), g.value = setTimeout(() => {
var n, v;
d.value = "", ((n = h.value) == null ? void 0 : n.value) && ((v = h.value) == null ? void 0 : v.value) !== "" && (d.value = h.value.value), k("search", d.value);
}, 500);
}, j = B(() => {
let p = c.options;
return i.value.length >= 1 && (p = p.filter((d) => {
if (isNaN(d) === !1 && Number(d) === Number(i.value))
let n = c.options;
return d.value.length >= 1 && (n = n.filter((v) => {
if (isNaN(v) === !1 && Number(v) === Number(d.value))
return !0;
if (typeof d == "string" && d.toLowerCase().includes(i.value.toLowerCase()))
if (typeof v == "string" && v.toLowerCase().includes(d.value.toLowerCase()))
return !0;
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))
if (typeof v == "object" && v !== null && Object.prototype.toString.call(v) === "[object Object]")
for (const s of Object.keys(v)) {
if (isNaN(v[s]) === !1 && Number(v[s]) === Number(d.value))
return !0;
if (typeof d[s] == "string" && d[s].toLowerCase().includes(i.value.toLowerCase()))
if (typeof v[s] == "string" && v[s].toLowerCase().includes(d.value.toLowerCase()))
return !0;
}
return !1;
})), p;
}), g = (() => {
let p = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", d = "";
})), n;
}), $ = (() => {
let n = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", v = "";
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), h("update:modelValue", e.value), h("change", e.value, p);
}, f = (p) => {
typeof p == "object" && p !== null && String(c.datatype).toLowerCase() === "string" ? (e.value = p[String(c.dataprop || c.prop)], h("update:modelValue", String(e.value))) : typeof p == "object" && p !== null && String(c.datatype).toLowerCase() === "number" ? (e.value = p[String(c.dataprop || c.prop)], h("update:modelValue", Number(e.value))) : (e.value = p, h("update:modelValue", e.value)), h("change", e.value, p);
v += n.charAt(Math.floor(Math.random() * n.length));
return v;
})(), y = (n, v = "") => {
v !== "" ? e.value.map((s) => s[v]).includes(n[v]) ? e.value.splice(e.value.findIndex((s) => s[v] === n[v]), 1) : e.value.push(n) : e.value.includes(n) ? e.value.splice(e.value.findIndex((s) => s === n), 1) : e.value.push(n), k("update:modelValue", e.value), k("change", e.value, n);
}, p = (n) => {
typeof n == "object" && n !== null && String(c.datatype).toLowerCase() === "string" ? (e.value = n[String(c.dataprop || c.prop)], k("update:modelValue", String(e.value))) : typeof n == "object" && n !== null && String(c.datatype).toLowerCase() === "number" ? (e.value = n[String(c.dataprop || c.prop)], k("update:modelValue", Number(e.value))) : (e.value = n, k("update:modelValue", e.value)), k("change", e.value, n);
};
return (p, d) => (r(), o("div", null, [
v("div", fe, [
v("div", pe, [
v("input", {
return (n, v) => (o(), i("div", null, [
f("div", fe, [
f("div", pe, [
f("input", {
type: "search",
ref_key: "searchRef",
ref: k,
ref: h,
onInput: w,

@@ -350,3 +347,3 @@ class: "input"

]),
Array.isArray(u.modelValue) ? (r(), o("div", {
Array.isArray(u.modelValue) ? (o(), i("div", {
key: 0,

@@ -356,6 +353,6 @@ class: "listMenu",

}, [
(r(!0), o(_, null, O(m(j), (s, a) => (r(), o(_, {
(o(!0), i(_, null, O(m(j), (s, a) => (o(), i(_, {
key: "option-" + s
}, [
typeof s == "string" ? (r(), o("div", {
typeof s == "string" ? (o(), i("div", {
key: 0,

@@ -365,17 +362,17 @@ onClick: x((t) => y(s), ["stop"]),

}, [
v("div", ke, [
v("input", {
f("div", ke, [
f("input", {
type: "checkbox",
class: "checkInput",
checked: e.value.includes(s),
id: "check-" + (m(g) + String(a)),
id: "check-" + (m($) + String(a)),
style: { "pointer-events": "none" }
}, null, 8, ye),
v("label", {
f("label", {
class: "checkLabel",
for: "check-" + (m(g) + String(a)),
for: "check-" + (m($) + String(a)),
style: { "pointer-events": "none" }
}, $(s), 9, ge)
}, S(s), 9, ge)
])
], 8, he)) : typeof s == "object" && u.prop in s ? (r(), o("div", {
], 8, he)) : typeof s == "object" && u.prop in s ? (o(), i("div", {
key: 1,

@@ -385,17 +382,17 @@ onClick: x((t) => y(s, u.prop), ["stop"]),

}, [
v("div", Ce, [
v("input", {
f("div", Ce, [
f("input", {
type: "checkbox",
class: "checkInput",
checked: e.value.includes(s),
id: "check-" + (m(g) + String(a)),
id: "check-" + (m($) + String(a)),
style: { "pointer-events": "none" }
}, null, 8, me),
v("label", {
f("label", {
class: "checkLabel",
for: "check-" + (m(g) + String(a)),
for: "check-" + (m($) + String(a)),
style: { "pointer-events": "none" }
}, $(s[u.prop]), 9, Se)
}, S(s[u.prop]), 9, Se)
])
], 8, be)) : (r(), o("div", {
], 8, be)) : (o(), i("div", {
key: 2,

@@ -405,3 +402,3 @@ onClick: x((t) => y(s), ["stop"]),

}, [
L(p.$slots, "default", {
L(n.$slots, "default", {
option: s,

@@ -412,3 +409,3 @@ selected: e.value

], 64))), 128))
], 4)) : (r(), o("div", {
], 4)) : (o(), i("div", {
key: 1,

@@ -418,19 +415,19 @@ class: "listMenu",

}, [
(r(!0), o(_, null, O(m(j), (s, a) => (r(), o(_, {
(o(!0), i(_, null, O(m(j), (s, a) => (o(), i(_, {
key: "option-" + s
}, [
typeof s == "string" ? (r(), o("div", {
typeof s == "string" ? (o(), i("div", {
key: 0,
onClick: (t) => f(s),
onClick: (t) => p(s),
class: N(["listItem", e.value === s ? "active" : ""])
}, $(s), 11, _e)) : typeof s == "object" && u.prop in s ? (r(), o("div", {
}, S(s), 11, _e)) : typeof s == "object" && u.prop in s ? (o(), i("div", {
key: 1,
onClick: (t) => f(s),
onClick: (t) => p(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", {
}, S(s[u.prop]), 11, Ne)) : (o(), i("div", {
key: 2,
onClick: x((t) => f(s), ["stop"]),
onClick: x((t) => p(s), ["stop"]),
class: N(["listItem", e.value === s ? "active" : ""])
}, [
L(p.$slots, "default", {
L(n.$slots, "default", {
option: s,

@@ -446,3 +443,3 @@ selected: e.value

});
const nl = /* @__PURE__ */ A(je, [["__scopeId", "data-v-d7fed8bc"]]), Ie = (u) => (U("data-v-3acd22f1"), u = u(), D(), u), xe = { class: "tagWrap" }, Ve = { class: "tags" }, Oe = { class: "tag groupItem" }, Le = ["onClick"], Be = /* @__PURE__ */ Ie(() => /* @__PURE__ */ v("svg", {
const nl = /* @__PURE__ */ A(je, [["__scopeId", "data-v-d7fed8bc"]]), Ie = (u) => (U("data-v-3acd22f1"), u = u(), D(), u), xe = { class: "tagWrap" }, Ve = { class: "tags" }, Oe = { class: "tag groupItem" }, Le = ["onClick"], Be = /* @__PURE__ */ Ie(() => /* @__PURE__ */ f("svg", {
xmlns: "http://www.w3.org/2000/svg",

@@ -458,3 +455,3 @@ width: "16",

}, [
/* @__PURE__ */ v("line", {
/* @__PURE__ */ f("line", {
x1: "18",

@@ -465,3 +462,3 @@ y1: "6",

}),
/* @__PURE__ */ v("line", {
/* @__PURE__ */ f("line", {
x1: "6",

@@ -485,110 +482,110 @@ y1: "6",

emits: ["update:modelValue"],
setup(u, { emit: h }) {
const c = u, e = C(!1), i = C(""), k = 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))
setup(u, { emit: k }) {
const c = u, e = b(!1), d = b(""), h = b(null), g = E(c.modelValue || []), w = b(c.options || []), j = b(c.separator || ","), C = b(c.prop || "value"), $ = B(() => {
let v = w.value;
return d.value.length >= 1 && (v = v.filter((s) => {
if (isNaN(s) === !1 && Number(s) === Number(d.value))
return !0;
if (typeof s == "string" && s.toLowerCase().includes(i.value.toLowerCase()))
if (typeof s == "string" && s.toLowerCase().includes(d.value.toLowerCase()))
return !0;
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))
if (isNaN(s[a]) === !1 && Number(s[a]) === Number(d.value))
return !0;
if (typeof s[a] == "string" && s[a].toLowerCase().includes(i.value.toLowerCase()))
if (typeof s[a] == "string" && s[a].toLowerCase().includes(d.value.toLowerCase()))
return !0;
}
return !1;
})), d;
})), v;
}), y = () => {
k.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 = "", h("update:modelValue", b);
h.value.focus();
}, p = (v) => {
if (v.key !== "Enter" && $.value.length >= 1 ? e.value = !0 : e.value = !1, d.value.endsWith(j.value) || v.key === "Enter") {
const s = d.value.replace(j.value, "");
g.includes(s) || (g.push(s), w.value.includes(s) && (w.value = w.value.filter((a) => typeof a == "string" && a !== s ? !0 : typeof a == "object" && C.value in a && a[C.value] !== s))), d.value = "", k("update:modelValue", g);
}
};
M(i, () => {
if (k.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 : k.value.getAttribute("placeholder");
d.innerHTML = s.replace(/ /g, "&nbsp;").trim(), document.body.appendChild(d);
const a = Math.ceil(Number(window.getComputedStyle(d).width.replace("px", ""))) + 30;
k.value.style.setProperty("width", a + "px"), d.remove();
M(d, () => {
if (h.value !== null) {
const v = document.createElement("div");
v.style.width = "max-content", v.style.position = "absolute", v.style.visibility = "hidden";
const s = d.value.length >= 2 ? d.value : h.value.getAttribute("placeholder");
v.innerHTML = s.replace(/ /g, "&nbsp;").trim(), document.body.appendChild(v);
const a = Math.ceil(Number(window.getComputedStyle(v).width.replace("px", ""))) + 30;
h.value.style.setProperty("width", a + "px"), v.remove();
}
});
const p = (d) => {
d.target.style.display = "none", e.value = !1;
const n = (v) => {
v.target.style.display = "none", e.value = !1;
};
return (d, s) => (r(), o("div", {
return (v, s) => (o(), i("div", {
class: N(["taggable", { active: e.value === !0 }])
}, [
v("div", {
f("div", {
class: "tagBackdrop",
style: V({ display: e.value ? "block" : "none" }),
onClick: p
onClick: n
}, null, 4),
v("div", xe, [
v("div", {
f("div", xe, [
f("div", {
class: "input tagToggler",
onClick: y
}, [
v("div", Ve, [
(r(!0), o(_, null, O(b, (a, t) => (r(), o("div", {
f("div", Ve, [
(o(!0), i(_, null, O(g, (a, t) => (o(), i("div", {
key: "tag-" + t,
class: "group"
}, [
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)
f("div", Oe, [
typeof a == "string" && a !== "" ? (o(), i(_, { key: 0 }, [
R(S(a), 1)
], 64)) : typeof a == "object" && C.value in a ? (o(), i(_, { key: 1 }, [
R(S(a[C.value]), 1)
], 64)) : (o(), i(_, { key: 2 }, [
R(S(u.placeholder), 1)
], 64))
]),
v("div", {
f("div", {
class: "tag groupItem",
onClick: (l) => b.splice(t, 1)
onClick: (l) => g.splice(t, 1)
}, Te, 8, Le)
]))), 128)),
F(v("input", {
F(f("input", {
type: "search",
ref_key: "inputRef",
ref: k,
"onUpdate:modelValue": s[0] || (s[0] = (a) => i.value = a),
ref: h,
"onUpdate:modelValue": s[0] || (s[0] = (a) => d.value = a),
class: "tagInput",
onInput: s[1] || (s[1] = (a) => f(a)),
onKeyup: s[2] || (s[2] = H((a) => f(a), ["enter"])),
onInput: s[1] || (s[1] = (a) => p(a)),
onKeyup: s[2] || (s[2] = H((a) => p(a), ["enter"])),
placeholder: "Add new tag"
}, null, 544), [
[W, i.value]
[W, d.value]
])
])
]),
v("div", ze, [
(r(!0), o(_, null, O(m(g), (a, t) => (r(), o(_, {
f("div", ze, [
(o(!0), i(_, null, O(m($), (a, t) => (o(), i(_, {
key: "option-" + a
}, [
typeof a == "string" ? (r(), o("div", {
typeof a == "string" ? (o(), i("div", {
key: 0,
onClick: (l) => {
i.value = a + ",", f(l);
d.value = a + ",", p(l);
},
class: "tagItem"
}, $(a), 9, Ae)) : typeof a == "object" && S.value in a ? (r(), o("div", {
}, S(a), 9, Ae)) : typeof a == "object" && C.value in a ? (o(), i("div", {
key: 1,
onClick: (l) => {
i.value = a[S.value] + ",", f(l);
d.value = a[C.value] + ",", p(l);
},
class: "tagItem"
}, $(a[S.value]), 9, Me)) : (r(), o("div", {
}, S(a[C.value]), 9, Me)) : (o(), i("div", {
key: 2,
onClick: (l) => {
i.value = a + ",", f(l);
d.value = a + ",", p(l);
},
class: "tagItem"
}, [
L(d.$slots, "default", { option: a }, void 0, !0)
L(v.$slots, "default", { option: a }, void 0, !0)
], 8, Re))

@@ -614,24 +611,24 @@ ], 64))), 128))

emits: ["update:modelValue", "change", "add", "search"],
setup(u, { emit: h }) {
const c = u, e = C(c.modelValue || {}), i = C(!1), k = C(""), b = C(null), w = C(void 0), j = C("");
setup(u, { emit: k }) {
const c = u, e = b(c.modelValue || {}), d = b(!1), h = b(""), g = b(null), w = b(void 0), j = b("");
M(() => c.modelValue, () => {
e.value = c.modelValue;
});
const S = () => {
const C = () => {
clearTimeout(w.value), w.value = setTimeout(() => {
var t, l;
k.value = "", ((t = b.value) == null ? void 0 : t.value) && ((l = b.value) == null ? void 0 : l.value) !== "" && (k.value = b.value.value), h("search", k.value);
h.value = "", ((t = g.value) == null ? void 0 : t.value) && ((l = g.value) == null ? void 0 : l.value) !== "" && (h.value = g.value.value), k("search", h.value);
}, 500);
}, g = B(() => {
}, $ = B(() => {
let t = c.options;
return k.value.length >= 1 && (t = t.filter((l) => {
if (isNaN(l) === !1 && Number(l) === Number(k.value))
return h.value.length >= 1 && (t = t.filter((l) => {
if (isNaN(l) === !1 && Number(l) === Number(h.value))
return !0;
if (typeof l == "string" && l.toLowerCase().includes(k.value.toLowerCase()))
if (typeof l == "string" && l.toLowerCase().includes(h.value.toLowerCase()))
return !0;
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(k.value))
for (const r of Object.keys(l)) {
if (isNaN(l[r]) === !1 && Number(l[r]) === Number(h.value))
return !0;
if (typeof l[n] == "string" && l[n].toLowerCase().includes(k.value.toLowerCase()))
if (typeof l[r] == "string" && l[r].toLowerCase().includes(h.value.toLowerCase()))
return !0;

@@ -641,23 +638,23 @@ }

})), t;
}), f = ((t = 10) => {
let l = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", n = "";
}), p = ((t = 10) => {
let l = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", r = "";
for (let I = 0; I < t; I++)
n += l.charAt(Math.floor(Math.random() * l.length));
return n;
})(), p = (t) => {
r += l.charAt(Math.floor(Math.random() * l.length));
return r;
})(), n = (t) => {
var l;
t.target.style.display = "none", i.value = !1, (l = b.value) != null && l.value && (b.value.value = "", k.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), h("update:modelValue", e.value), h("change", e.value, t);
t.target.style.display = "none", d.value = !1, (l = g.value) != null && l.value && (g.value.value = "", h.value = "");
}, v = (t, l = "") => {
l !== "" ? e.value.map((r) => r[l]).includes(t[l]) ? e.value.splice(e.value.findIndex((r) => r[l] === t[l]), 1) : e.value.push(t) : e.value.includes(t) ? e.value.splice(e.value.findIndex((r) => r === 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)], h("update:modelValue", String(e.value))) : typeof t == "object" && t !== null && String(c.datatype).toLowerCase() === "number" ? (e.value = t[String(c.dataprop || c.prop)], h("update:modelValue", Number(e.value))) : (e.value = t, h("update:modelValue", e.value)), i.value = !1, h("change", e.value, 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)), d.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 ($.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);
let l = $.value.filter((r) => Number(r[String(c.dataprop || c.prop)]) === Number(e.value));
typeof $.value[0] == "object" && l.length >= 1 ? t = l[0][String(c.prop)] : typeof $.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);
let l = $.value.filter((r) => String(r[String(c.dataprop || c.prop)]) === e.value);
typeof $.value[0] == "object" && l.length >= 1 ? t = l[0][String(c.prop)] : typeof $.value[0] == "string" && e.value !== "" && (t = e.value);
} else

@@ -667,26 +664,26 @@ 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, l) => (r(), o("div", {
class: N(["picker suggestion tedirCategory", { active: i.value, pickerUp: u.up }])
return (t, l) => (o(), i("div", {
class: N(["picker suggestion tedirCategory", { active: d.value, pickerUp: u.up }])
}, [
v("div", {
f("div", {
class: "pickerBackdrop",
style: V({ display: i.value ? "block" : "none" }),
onClick: p
style: V({ display: d.value ? "block" : "none" }),
onClick: n
}, null, 4),
v("div", We, [
v("div", {
f("div", We, [
f("div", {
class: "select pickerToggler",
onClick: l[0] || (l[0] = (n) => i.value = !i.value)
}, $(m(a)), 1),
v("div", Ee, [
v("div", He, [
v("input", {
onClick: l[0] || (l[0] = (r) => d.value = !d.value)
}, S(m(a)), 1),
f("div", Ee, [
f("div", He, [
f("input", {
type: "search",
ref_key: "searchRef",
ref: b,
onInput: S,
ref: g,
onInput: C,
class: "input"
}, null, 544)
]),
Array.isArray(e.value) ? (r(), o("div", {
Array.isArray(e.value) ? (o(), i("div", {
key: 0,

@@ -696,50 +693,50 @@ class: "pickerMenu",

}, [
(r(!0), o(_, null, O(m(g), (n, I) => (r(), o(_, {
key: "option-" + n
(o(!0), i(_, null, O(m($), (r, I) => (o(), i(_, {
key: "option-" + r
}, [
typeof n == "string" ? (r(), o("div", {
typeof r == "string" ? (o(), i("div", {
key: 0,
onClick: x((T) => d(n), ["stop"]),
onClick: x((T) => v(r), ["stop"]),
class: "pickerItem"
}, [
v("div", De, [
v("input", {
f("div", De, [
f("input", {
type: "checkbox",
class: "checkInput",
checked: e.value.includes(n),
id: "check-" + (m(f) + String(I)),
checked: e.value.includes(r),
id: "check-" + (m(p) + String(I)),
style: { "pointer-events": "none" }
}, null, 8, Ke),
v("label", {
f("label", {
class: "checkLabel",
for: "check-" + (m(f) + String(I)),
for: "check-" + (m(p) + String(I)),
style: { "pointer-events": "none" }
}, $(n), 9, Pe)
}, S(r), 9, Pe)
])
], 8, Ue)) : typeof n == "object" && n !== null && u.prop in n ? (r(), o("div", {
], 8, Ue)) : typeof r == "object" && r !== null && u.prop in r ? (o(), i("div", {
key: 1,
onClick: x((T) => d(n, u.prop), ["stop"]),
onClick: x((T) => v(r, u.prop), ["stop"]),
class: "pickerItem"
}, [
v("div", Ge, [
v("input", {
f("div", Ge, [
f("input", {
type: "checkbox",
class: "checkInput",
checked: e.value.includes(n),
id: "check-" + (m(f) + String(I)),
checked: e.value.includes(r),
id: "check-" + (m(p) + String(I)),
style: { "pointer-events": "none" }
}, null, 8, Je),
v("label", {
f("label", {
class: "checkLabel",
for: "check-" + (m(f) + String(I)),
for: "check-" + (m(p) + String(I)),
style: { "pointer-events": "none" }
}, $(n[u.prop]), 9, Qe)
}, S(r[u.prop]), 9, Qe)
])
], 8, qe)) : (r(), o("div", {
], 8, qe)) : (o(), i("div", {
key: 2,
onClick: x((T) => d(n), ["stop"]),
onClick: x((T) => v(r), ["stop"]),
class: "pickerItem"
}, [
L(t.$slots, "default", {
option: n,
option: r,
selected: e.value

@@ -749,3 +746,3 @@ }, void 0, !0)

], 64))), 128))
], 4)) : (r(), o("div", {
], 4)) : (o(), i("div", {
key: 1,

@@ -755,20 +752,20 @@ class: "pickerMenu",

}, [
(r(!0), o(_, null, O(m(g), (n, I) => (r(), o(_, {
key: "option-" + n
(o(!0), i(_, null, O(m($), (r, I) => (o(), i(_, {
key: "option-" + r
}, [
typeof n == "string" ? (r(), o("div", {
typeof r == "string" ? (o(), i("div", {
key: 0,
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", {
onClick: (T) => s(r),
class: N(["pickerItem", e.value === r ? "active" : ""])
}, S(r), 11, Ye)) : typeof r == "object" && r !== null && u.prop in r ? (o(), i("div", {
key: 1,
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", {
onClick: (T) => s(r),
class: N(["pickerItem", e.value[u.prop] === r[u.prop] || String(r[u.dataprop || u.prop]) === String(e.value) ? "active" : ""])
}, S(r[u.prop]), 11, Ze)) : (o(), i("div", {
key: 2,
onClick: x((T) => s(n), ["stop"]),
class: N(["pickerItem", e.value === n ? "active" : ""])
onClick: x((T) => s(r), ["stop"]),
class: N(["pickerItem", e.value === r ? "active" : ""])
}, [
L(t.$slots, "default", {
option: n,
option: r,
selected: e.value

@@ -779,7 +776,7 @@ }, void 0, !0)

], 4)),
v("div", ll, [
v("div", tl, [
F(v("input", {
f("div", ll, [
f("div", tl, [
F(f("input", {
type: "text",
"onUpdate:modelValue": l[1] || (l[1] = (n) => j.value = n),
"onUpdate:modelValue": l[1] || (l[1] = (r) => j.value = r),
class: "input",

@@ -790,7 +787,7 @@ placeholder: "Add New Category"

]),
v("button", {
f("button", {
type: "button",
class: "button tedirCategoryButton",
onClick: l[2] || (l[2] = (n) => {
h("add", j.value), j.value = "";
onClick: l[2] || (l[2] = (r) => {
k("add", j.value), j.value = "";
})

@@ -797,0 +794,0 @@ }, "Save")

@@ -1,1 +0,1 @@

(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:""},up:{type:Boolean,default:!1}},emits:["update:modelValue","change","search"],setup(r,{emit:p}){const s=r,l=e.ref(s.modelValue||{}),i=e.ref(!1),k=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;k.value="",((n=y.value)==null?void 0:n.value)&&((a=y.value)==null?void 0:a.value)!==""&&(k.value=y.value.value),p("search",k.value)},500)},g=e.computed(()=>{let n=s.options;return k.value.length>=1&&(n=n.filter(a=>{if(isNaN(a)===!1&&Number(a)===Number(k.value))return!0;if(typeof a=="string"&&a.toLowerCase().includes(k.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(k.value))return!0;if(typeof a[t]=="string"&&a[t].toLowerCase().includes(k.value.toLowerCase()))return!0}return!1})),n}),h=((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="",k.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),p("update:modelValue",l.value),p("change",l.value,n)},d=n=>{typeof n=="object"&&n!==null&&String(s.datatype).toLowerCase()==="string"?(l.value=n[String(s.dataprop||s.prop)],p("update:modelValue",String(l.value))):typeof n=="object"&&n!==null&&String(s.datatype).toLowerCase()==="number"?(l.value=n[String(s.dataprop||s.prop)],p("update:modelValue",Number(l.value))):(l.value=n,p("update:modelValue",l.value)),i.value=!1,p("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",{active:i.value,pickerUp:r.up}])},[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(h)+String(o)),style:{"pointer-events":"none"}},null,8,j),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(h)+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(h)+String(o)),style:{"pointer-events":"none"}},null,8,z),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(h)+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,p)=>{const s=r.__vccOpts||r;for(const[l,i]of p)s[l]=i;return s},R=N(A,[["__scopeId","data-v-ca470346"]]),W={class:"pickerWrap"},H={class:"pickerContent pickerSizing"},U=["onClick"],K=["onClick"],P=["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},up:{type:Boolean,default:!1}},emits:["update:modelValue","change","search"],setup(r,{emit:p}){const s=r,l=e.ref(!1),i=e.ref(""),k=e.ref(null),y=e.ref(void 0),B=e.computed(()=>{let m=s.options;return i.value.length>=1&&(m=m.filter(h=>{if(isNaN(h)===!1&&Number(h)===Number(i.value))return!0;if(typeof h=="string"&&h.toLowerCase().includes(i.value.toLowerCase()))return!0;if(typeof h=="object"&&h!==null&&Object.prototype.toString.call(h)==="[object Object]")for(const u of Object.keys(h)){if(isNaN(h[u])===!1&&Number(h[u])===Number(i.value))return!0;if(typeof h[u]=="string"&&h[u].toLowerCase().includes(i.value.toLowerCase()))return!0}return!1})),m}),C=()=>{clearTimeout(y.value),y.value=setTimeout(()=>{var m,h;i.value="",((m=k.value)==null?void 0:m.value)&&((h=k.value)==null?void 0:h.value)!==""&&(i.value=k.value.value),p("search",i.value),B.value.length>=1&&i.value!==""?l.value=!0:l.value=!1},500)},g=m=>{m.target.style.display="none",l.value=!1};return(m,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["picker suggestion",{active:l.value,pickerUp:r.up}])},[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:k,onInput:C,onClick:h[0]||(h[0]=u=>l.value=!0),class:"select"},null,544)):(e.openBlock(),e.createElementBlock("input",{key:1,type:"search",ref_key:"searchRef",ref:k,onInput:C,onClick:h[1]||(h[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,p("update:modelValue",u),p("change",u,u),l.value=!1},class:e.normalizeClass(["pickerItem",r.modelValue===u?"active":""])},e.toDisplayString(u),11,U)):typeof u=="object"&&r.prop in u?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:d=>{i.value=u[r.prop],p("update:modelValue",u),p("change",u[r.prop],u),l.value=!1},class:e.normalizeClass(["pickerItem",r.modelValue[r.prop]===u[r.prop]?"active":""])},e.toDisplayString(u[r.prop]),11,K)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:d=>{i.value=u,p("update:modelValue",u),p("change",u,u),l.value=!1},class:e.normalizeClass(["pickerItem",r.modelValue===u?"active":""])},[e.renderSlot(m.$slots,"default",{option:u},void 0,!0)],10,P))],64))),128))])])],2))}}),He="",G=N(q,[["__scopeId","data-v-51416808"]]),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:p}){const s=r,l=e.ref(s.modelValue||{}),i=e.ref(""),k=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=k.value)==null?void 0:f.value)&&((d=k.value)==null?void 0:d.value)!==""&&(i.value=k.value.value),p("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}),m=(()=>{let f="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",d="";for(let c=0;c<10;c++)d+=f.charAt(Math.floor(Math.random()*f.length));return d})(),h=(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),p("update:modelValue",l.value),p("change",l.value,f)},u=f=>{typeof f=="object"&&f!==null&&String(s.datatype).toLowerCase()==="string"?(l.value=f[String(s.dataprop||s.prop)],p("update:modelValue",String(l.value))):typeof f=="object"&&f!==null&&String(s.datatype).toLowerCase()==="number"?(l.value=f[String(s.dataprop||s.prop)],p("update:modelValue",Number(l.value))):(l.value=f,p("update:modelValue",l.value)),p("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:k,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=>h(c),["stop"]),class:"listItem"},[e.createElementVNode("div",Y,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:l.value.includes(c),id:"check-"+(e.unref(m)+String(n)),style:{"pointer-events":"none"}},null,8,Z),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(m)+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=>h(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(m)+String(n)),style:{"pointer-events":"none"}},null,8,ae),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(m)+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=>h(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))])]))}}),Ue="",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"},he=["onClick"],me=[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:p}){const s=r,l=e.ref(!1),i=e.ref(""),k=e.ref(null),y=e.reactive(s.modelValue||[]),B=e.ref(s.options||[]),C=e.ref(s.separator||","),g=e.ref(s.prop||"value"),m=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}),h=()=>{k.value.focus()},u=d=>{if(d.key!=="Enter"&&m.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="",p("update:modelValue",y)}};e.watch(i,()=>{if(k.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:k.value.getAttribute("placeholder");d.innerHTML=c.replace(/ /g,"&nbsp;").trim(),document.body.appendChild(d);const n=Math.ceil(Number(window.getComputedStyle(d).width.replace("px","")))+30;k.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:h},[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)},me,8,he)]))),128)),e.withDirectives(e.createElementVNode("input",{type:"search",ref_key:"inputRef",ref:k,"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(m),(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))}}),Pe="",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},up:{type:Boolean,default:!1}},emits:["update:modelValue","change","add","search"],setup(r,{emit:p}){const s=r,l=e.ref(s.modelValue||{}),i=e.ref(!1),k=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;k.value="",((a=y.value)==null?void 0:a.value)&&((t=y.value)==null?void 0:t.value)!==""&&(k.value=y.value.value),p("search",k.value)},500)},m=e.computed(()=>{let a=s.options;return k.value.length>=1&&(a=a.filter(t=>{if(isNaN(t)===!1&&Number(t)===Number(k.value))return!0;if(typeof t=="string"&&t.toLowerCase().includes(k.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(k.value))return!0;if(typeof t[o]=="string"&&t[o].toLowerCase().includes(k.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="",k.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),p("update:modelValue",l.value),p("change",l.value,a)},c=a=>{typeof a=="object"&&a!==null&&String(s.datatype).toLowerCase()==="string"?(l.value=a[String(s.dataprop||s.prop)],p("update:modelValue",String(l.value))):typeof a=="object"&&a!==null&&String(s.datatype).toLowerCase()==="number"?(l.value=a[String(s.dataprop||s.prop)],p("update:modelValue",Number(l.value))):(l.value=a,p("update:modelValue",l.value)),i.value=!1,p("change",l.value,a)},n=e.computed(()=>{let a=(s==null?void 0:s.placeholder)||"-- Select option --";if(m.value.length>=1)if(typeof l.value=="number"){let t=m.value.filter(o=>Number(o[String(s.dataprop||s.prop)])===Number(l.value));typeof m.value[0]=="object"&&t.length>=1?a=t[0][String(s.prop)]:typeof m.value[0]=="number"&&(a=l.value)}else if(typeof l.value=="string"){let t=m.value.filter(o=>String(o[String(s.dataprop||s.prop)])===l.value);typeof m.value[0]=="object"&&t.length>=1?a=t[0][String(s.prop)]:typeof m.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",{active:i.value,pickerUp:r.up}])},[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(m),(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(m),(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=>{p("add",C.value),C.value=""})},"Save")])])])])],2))}}),qe="",Re=N(Ae,[["__scopeId","data-v-9bd9abf8"]]);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"}})});
(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:""},up:{type:Boolean,default:!1}},emits:["update:modelValue","change","search"],setup(r,{emit:k}){const s=r,l=e.ref(s.modelValue||{}),d=e.ref(!1),p=e.ref(""),h=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=h.value)==null?void 0:n.value)&&((a=h.value)==null?void 0:a.value)!==""&&(p.value=h.value.value),k("search",p.value)},500)},y=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 i=0;i<n;i++)t+=a.charAt(Math.floor(Math.random()*a.length));return t})(),f=n=>{var a;n.target.style.display="none",d.value=!1,(a=h.value)!=null&&a.value&&(h.value.value="",p.value="")},o=(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)},u=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)),d.value=!1,k("change",l.value,n)},c=e.computed(()=>{let n=(s==null?void 0:s.placeholder)||"-- Select option --";if(y.value.length>=1)if(typeof l.value=="number"){let a=y.value.filter(t=>Number(t[String(s.dataprop||s.prop)])===Number(l.value));typeof y.value[0]=="object"&&a.length>=1?n=a[0][String(s.prop)]:typeof y.value[0]=="number"&&(n=l.value)}else if(typeof l.value=="string"){let a=y.value.filter(t=>String(t[String(s.dataprop||s.prop)])===l.value);typeof y.value[0]=="object"&&a.length>=1?n=a[0][String(s.prop)]:typeof y.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",{active:d.value,pickerUp:r.up}])},[e.createElementVNode("div",{class:"pickerBackdrop",style:e.normalizeStyle({display:d.value?"block":"none"}),onClick:f},null,4),e.createElementVNode("div",v,[e.createElementVNode("div",{class:"select pickerToggler",onClick:a[0]||(a[0]=t=>d.value=!d.value)},e.toDisplayString(e.unref(c)),1),e.createElementVNode("div",V,[e.createElementVNode("div",$,[e.createElementVNode("input",{type:"search",ref_key:"searchRef",ref:h,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(y),(t,i)=>(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=>o(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(i)),style:{"pointer-events":"none"}},null,8,j),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(m)+String(i)),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=>o(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(i)),style:{"pointer-events":"none"}},null,8,z),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(m)+String(i)),style:{"pointer-events":"none"}},e.toDisplayString(t[r.prop]),9,O)])],8,I)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(b=>o(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(y),(t,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+t},[typeof t=="string"&&r.type!=="slot"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:b=>u(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=>u(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=>u(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,d]of k)s[l]=d;return s},R=N(A,[["__scopeId","data-v-ca470346"]]),W={class:"pickerWrap"},H={class:"pickerContent pickerSizing"},U=["onClick"],K=["onClick"],P=["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},up:{type:Boolean,default:!1},serverSearch:{type:Boolean,default:!1}},emits:["update:modelValue","change","search"],setup(r,{emit:k}){const s=r,l=e.ref(!1),d=e.ref(""),p=e.ref(null),h=e.ref(void 0),B=e.computed(()=>{let m=s.options;return d.value.length>=1&&s.serverSearch!==!0&&(m=m.filter(f=>{if(isNaN(f)===!1&&Number(f)===Number(d.value))return!0;if(typeof f=="string"&&f.toLowerCase().includes(d.value.toLowerCase()))return!0;if(typeof f=="object"&&f!==null&&Object.prototype.toString.call(f)==="[object Object]")for(const o of Object.keys(f)){if(isNaN(f[o])===!1&&Number(f[o])===Number(d.value))return!0;if(typeof f[o]=="string"&&f[o].toLowerCase().includes(d.value.toLowerCase()))return!0}return!1})),m}),C=()=>{clearTimeout(h.value),h.value=setTimeout(()=>{var m,f;d.value="",((m=p.value)==null?void 0:m.value)&&((f=p.value)==null?void 0:f.value)!==""&&(d.value=p.value.value),k("search",d.value),B.value.length>=1&&d.value!==""?l.value=!0:l.value=!1},500)},y=(m,f)=>{(typeof m=="string"||isNaN(m)===!1)&&(d.value=m,p.value.value=m),k("update:modelValue",f),k("change",m,f),l.value=!1},g=m=>{m.target.style.display="none",l.value=!1};return(m,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["picker suggestion",{active:l.value,pickerUp:r.up}])},[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:f[0]||(f[0]=o=>l.value=!0),class:"select"},null,544)):(e.openBlock(),e.createElementBlock("input",{key:1,type:"search",ref_key:"searchRef",ref:p,onInput:C,onClick:f[1]||(f[1]=o=>e.unref(B).length>=1&&d.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),(o,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+o},[typeof o=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:c=>y(o,o),class:e.normalizeClass(["pickerItem",r.modelValue===o?"active":""])},e.toDisplayString(o),11,U)):typeof o=="object"&&r.prop in o?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:c=>y(o[r.prop],o),class:e.normalizeClass(["pickerItem",r.modelValue[r.prop]===o[r.prop]?"active":""])},e.toDisplayString(o[r.prop]),11,K)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:c=>y(o,o),class:e.normalizeClass(["pickerItem",r.modelValue===o?"active":""])},[e.renderSlot(m.$slots,"default",{option:o},void 0,!0)],10,P))],64))),128))])])],2))}}),He="",G=N(q,[["__scopeId","data-v-6171fab7"]]),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||{}),d=e.ref(""),p=e.ref(null),h=e.ref(void 0);e.watch(()=>s.modelValue,()=>{l.value=s.modelValue});const B=()=>{clearTimeout(h.value),h.value=setTimeout(()=>{var o,u;d.value="",((o=p.value)==null?void 0:o.value)&&((u=p.value)==null?void 0:u.value)!==""&&(d.value=p.value.value),k("search",d.value)},500)},C=e.computed(()=>{let o=s.options;return d.value.length>=1&&(o=o.filter(u=>{if(isNaN(u)===!1&&Number(u)===Number(d.value))return!0;if(typeof u=="string"&&u.toLowerCase().includes(d.value.toLowerCase()))return!0;if(typeof u=="object"&&u!==null&&Object.prototype.toString.call(u)==="[object Object]")for(const c of Object.keys(u)){if(isNaN(u[c])===!1&&Number(u[c])===Number(d.value))return!0;if(typeof u[c]=="string"&&u[c].toLowerCase().includes(d.value.toLowerCase()))return!0}return!1})),o}),g=(()=>{let o="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",u="";for(let c=0;c<10;c++)u+=o.charAt(Math.floor(Math.random()*o.length));return u})(),m=(o,u="")=>{u!==""?l.value.map(c=>c[u]).includes(o[u])?l.value.splice(l.value.findIndex(c=>c[u]===o[u]),1):l.value.push(o):l.value.includes(o)?l.value.splice(l.value.findIndex(c=>c===o),1):l.value.push(o),k("update:modelValue",l.value),k("change",l.value,o)},f=o=>{typeof o=="object"&&o!==null&&String(s.datatype).toLowerCase()==="string"?(l.value=o[String(s.dataprop||s.prop)],k("update:modelValue",String(l.value))):typeof o=="object"&&o!==null&&String(s.datatype).toLowerCase()==="number"?(l.value=o[String(s.dataprop||s.prop)],k("update:modelValue",Number(l.value))):(l.value=o,k("update:modelValue",l.value)),k("change",l.value,o)};return(o,u)=>(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(g)+String(n)),style:{"pointer-events":"none"}},null,8,Z),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(g)+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(g)+String(n)),style:{"pointer-events":"none"}},null,8,ae),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(g)+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(o.$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=>f(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=>f(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=>f(c),["stop"]),class:e.normalizeClass(["listItem",l.value===c?"active":""])},[e.renderSlot(o.$slots,"default",{option:c,selected:l.value},void 0,!0)],10,oe))],64))),128))],4))])]))}}),Ue="",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),d=e.ref(""),p=e.ref(null),h=e.reactive(s.modelValue||[]),B=e.ref(s.options||[]),C=e.ref(s.separator||","),y=e.ref(s.prop||"value"),g=e.computed(()=>{let u=B.value;return d.value.length>=1&&(u=u.filter(c=>{if(isNaN(c)===!1&&Number(c)===Number(d.value))return!0;if(typeof c=="string"&&c.toLowerCase().includes(d.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(d.value))return!0;if(typeof c[n]=="string"&&c[n].toLowerCase().includes(d.value.toLowerCase()))return!0}return!1})),u}),m=()=>{p.value.focus()},f=u=>{if(u.key!=="Enter"&&g.value.length>=1?l.value=!0:l.value=!1,d.value.endsWith(C.value)||u.key==="Enter"){const c=d.value.replace(C.value,"");h.includes(c)||(h.push(c),B.value.includes(c)&&(B.value=B.value.filter(n=>typeof n=="string"&&n!==c?!0:typeof n=="object"&&y.value in n&&n[y.value]!==c))),d.value="",k("update:modelValue",h)}};e.watch(d,()=>{if(p.value!==null){const u=document.createElement("div");u.style.width="max-content",u.style.position="absolute",u.style.visibility="hidden";const c=d.value.length>=2?d.value:p.value.getAttribute("placeholder");u.innerHTML=c.replace(/ /g,"&nbsp;").trim(),document.body.appendChild(u);const n=Math.ceil(Number(window.getComputedStyle(u).width.replace("px","")))+30;p.value.style.setProperty("width",n+"px"),u.remove()}});const o=u=>{u.target.style.display="none",l.value=!1};return(u,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:o},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(h,(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"&&y.value in n?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n[y.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=>h.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=>d.value=n),class:"tagInput",onInput:c[1]||(c[1]=n=>f(n)),onKeyup:c[2]||(c[2]=e.withKeys(n=>f(n),["enter"])),placeholder:"Add new tag"},null,544),[[e.vModelText,d.value]])])]),e.createElementVNode("div",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+n},[typeof n=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:t=>{d.value=n+",",f(t)},class:"tagItem"},e.toDisplayString(n),9,ge)):typeof n=="object"&&y.value in n?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:t=>{d.value=n[y.value]+",",f(t)},class:"tagItem"},e.toDisplayString(n[y.value]),9,Be)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:t=>{d.value=n+",",f(t)},class:"tagItem"},[e.renderSlot(u.$slots,"default",{option:n},void 0,!0)],8,Ce))],64))),128))])])],2))}}),Pe="",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},up:{type:Boolean,default:!1}},emits:["update:modelValue","change","add","search"],setup(r,{emit:k}){const s=r,l=e.ref(s.modelValue||{}),d=e.ref(!1),p=e.ref(""),h=e.ref(null),B=e.ref(void 0),C=e.ref("");e.watch(()=>s.modelValue,()=>{l.value=s.modelValue});const y=()=>{clearTimeout(B.value),B.value=setTimeout(()=>{var a,t;p.value="",((a=h.value)==null?void 0:a.value)&&((t=h.value)==null?void 0:t.value)!==""&&(p.value=h.value.value),k("search",p.value)},500)},g=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 i of Object.keys(t)){if(isNaN(t[i])===!1&&Number(t[i])===Number(p.value))return!0;if(typeof t[i]=="string"&&t[i].toLowerCase().includes(p.value.toLowerCase()))return!0}return!1})),a}),f=((a=10)=>{let t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",i="";for(let b=0;b<a;b++)i+=t.charAt(Math.floor(Math.random()*t.length));return i})(),o=a=>{var t;a.target.style.display="none",d.value=!1,(t=h.value)!=null&&t.value&&(h.value.value="",p.value="")},u=(a,t="")=>{t!==""?l.value.map(i=>i[t]).includes(a[t])?l.value.splice(l.value.findIndex(i=>i[t]===a[t]),1):l.value.push(a):l.value.includes(a)?l.value.splice(l.value.findIndex(i=>i===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)),d.value=!1,k("change",l.value,a)},n=e.computed(()=>{let a=(s==null?void 0:s.placeholder)||"-- Select option --";if(g.value.length>=1)if(typeof l.value=="number"){let t=g.value.filter(i=>Number(i[String(s.dataprop||s.prop)])===Number(l.value));typeof g.value[0]=="object"&&t.length>=1?a=t[0][String(s.prop)]:typeof g.value[0]=="number"&&(a=l.value)}else if(typeof l.value=="string"){let t=g.value.filter(i=>String(i[String(s.dataprop||s.prop)])===l.value);typeof g.value[0]=="object"&&t.length>=1?a=t[0][String(s.prop)]:typeof g.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",{active:d.value,pickerUp:r.up}])},[e.createElementVNode("div",{class:"pickerBackdrop",style:e.normalizeStyle({display:d.value?"block":"none"}),onClick:o},null,4),e.createElementVNode("div",Ne,[e.createElementVNode("div",{class:"select pickerToggler",onClick:t[0]||(t[0]=i=>d.value=!d.value)},e.toDisplayString(e.unref(n)),1),e.createElementVNode("div",Ee,[e.createElementVNode("div",ve,[e.createElementVNode("input",{type:"search",ref_key:"searchRef",ref:h,onInput:y,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),(i,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+i},[typeof i=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:e.withModifiers(E=>u(i),["stop"]),class:"pickerItem"},[e.createElementVNode("div",$e,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:l.value.includes(i),id:"check-"+(e.unref(f)+String(b)),style:{"pointer-events":"none"}},null,8,_e),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(f)+String(b)),style:{"pointer-events":"none"}},e.toDisplayString(i),9,we)])],8,Ve)):typeof i=="object"&&i!==null&&r.prop in i?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:e.withModifiers(E=>u(i,r.prop),["stop"]),class:"pickerItem"},[e.createElementVNode("div",xe,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",checked:l.value.includes(i),id:"check-"+(e.unref(f)+String(b)),style:{"pointer-events":"none"}},null,8,Ie),e.createElementVNode("label",{class:"checkLabel",for:"check-"+(e.unref(f)+String(b)),style:{"pointer-events":"none"}},e.toDisplayString(i[r.prop]),9,Le)])],8,je)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(E=>u(i),["stop"]),class:"pickerItem"},[e.renderSlot(a.$slots,"default",{option:i,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(g),(i,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"option-"+i},[typeof i=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:E=>c(i),class:e.normalizeClass(["pickerItem",l.value===i?"active":""])},e.toDisplayString(i),11,Oe)):typeof i=="object"&&i!==null&&r.prop in i?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:E=>c(i),class:e.normalizeClass(["pickerItem",l.value[r.prop]===i[r.prop]||String(i[r.dataprop||r.prop])===String(l.value)?"active":""])},e.toDisplayString(i[r.prop]),11,Me)):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(E=>c(i),["stop"]),class:e.normalizeClass(["pickerItem",l.value===i?"active":""])},[e.renderSlot(a.$slots,"default",{option:i,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]=i=>C.value=i),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]=i=>{k("add",C.value),C.value=""})},"Save")])])])])],2))}}),qe="",Re=N(Ae,[["__scopeId","data-v-9bd9abf8"]]);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-8",
"version": "0.0.1-alpha-9",
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc