Socket
Socket
Sign inDemoInstall

vs-autocomplete

Package Overview
Dependencies
188
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.6.17 to 1.6.18

432

dist/vs-autocomplete.es.js

@@ -1,9 +0,32 @@

(function(){"use strict";try{if(typeof document<"u"){var d=document.createElement("style");d.id="vs-autocomplete",d.appendChild(document.createTextNode(".v-tree-dropdown[data-v-c63dbbfd]{--primary-color: #1f73b7;--background-color: #1f73b714;--hint-color: #828485;--border: 1px solid #d8dcde;--v-dropdown-width: 300px;--max-width: 10000000px;--box-shadow: rgb(255, 255, 255) 0px 0px 0px 1px, rgb(31, 115, 183) 0px 0px 0px 3px;--bezier-curve: .1s cubic-bezier(0, 0, .95, 1.03);--animation-delay: .2s;position:relative;width:var(--v-dropdown-width);max-width:var(--max-width);outline:none}.v-dd[data-v-c63dbbfd]{display:flex;flex-direction:column}.v-dd>label[data-v-c63dbbfd],.v-dd-option>.label[data-v-c63dbbfd]{font-weight:600;text-align:left}.v-dd>label[data-v-c63dbbfd],.v-dd>label+.v-dd-label-hint[data-v-c63dbbfd]{line-height:1.45;text-align:left}.v-tree-dropdown .v-dd>label+.v-dd-label-hint[data-v-c63dbbfd]{color:var(--hint-color)}.v-dd:hover .v-dd-search[data-v-c63dbbfd]{border-color:var(--primary-color)}.c-btn__icon[data-v-c63dbbfd]{width:16px;height:16px;margin-top:-2px;vertical-align:middle}.u-truncate[data-v-c63dbbfd]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v-dd-search[data-v-c63dbbfd]{position:relative;display:flex;align-items:center;justify-content:space-between;border:var(--border);padding:.75rem;margin-top:.5rem;border-radius:4px;cursor:pointer;outline:none;z-index:1}.v-dd-search.compact[data-v-c63dbbfd]{padding:.5rem .75rem;margin-top:.25rem}.v-dd-search[data-v-c63dbbfd]:active,.v-dd-search[data-v-c63dbbfd]:focus,.v-dd-search[data-v-c63dbbfd]:focus-within{border-color:var(--primary-color);box-shadow:var(--box-shadow);transition:border-color var(--animation-delay) ease-in-out,box-shadow var(--animation-delay) ease-in-out}.v-dd-search>svg[data-v-c63dbbfd]{position:absolute}.v-dd-search>svg[aria-labelledby=zd-search][data-v-c63dbbfd]{left:1rem}.v-dd-search>svg[aria-labelledby=zd-down-pointer][data-v-c63dbbfd]{right:1rem}.v-dd-search>svg[aria-labelledby=zd-down-pointer].open[data-v-c63dbbfd]{transform:rotate(180deg);transition:transform var(--animation-delay) ease-in-out}.v-dd-search>svg[aria-labelledby=zd-down-pointer].close[data-v-c63dbbfd]{transform:rotate(0);transition:transform var(--animation-delay) ease-in-out}.v-dd-search>input[data-v-c63dbbfd],.v-dd-search>div[data-v-c63dbbfd]{font-size:1em;height:1.25rem;line-height:1.25rem;flex-grow:1;padding:0 2rem}.v-dd-input[data-v-c63dbbfd]{border:none;outline:none}.v-dd-input.hide[data-v-c63dbbfd]{position:absolute;width:0px;height:1px;padding:0}.v-dd+ul[data-v-c63dbbfd]{position:absolute;display:flex;flex-direction:column;top:calc(100% + 5px);left:0;width:100%;max-height:500px;border:var(--border);border-radius:4px;background-color:#fff;z-index:1;padding:.25rem 0;margin:0;max-height:350px;overflow-y:auto;box-shadow:#17494d26 0 20px 30px;animation:v-dd-menu-open-c63dbbfd var(--bezier-curve) 0s 1 normal;transition:display var(--bezier-curve)}.v-dd-option[data-v-c63dbbfd]{position:relative;display:flex;align-items:center;justify-content:space-between;cursor:pointer;padding:.5rem 1.25rem}.v-dd+ul.compact>li[data-v-c63dbbfd]{padding:.5rem 1.25rem}.v-dd+ul>li.parent-option[data-v-c63dbbfd]{border-bottom:var(--border);padding:.5rem .75rem}.v-dd+ul.compact>li.parent-option[data-v-c63dbbfd]{padding:.35rem .75rem}li.v-dd-option>svg[aria-labelledby=zd-check][data-v-c63dbbfd],li.v-dd-option>svg[aria-labelledby=zd-contains][data-v-c63dbbfd]{position:absolute}.v-dd-option>span[data-v-c63dbbfd]{padding:0 2rem;flex-grow:1;text-align:left}.v-dd-option.no-data[data-v-c63dbbfd],.v-dd-option[disabled=disabled][data-v-c63dbbfd]{-webkit-user-select:none;user-select:none;pointer-events:none;opacity:.7;cursor:not-allowed}.v-dd-option>svg[aria-labelledby=zd-down-pointer][data-v-c63dbbfd]{position:absolute;right:1rem;transform:rotate(-90deg)}.v-dd-option[data-v-c63dbbfd]:hover,.v-dd-option[data-v-c63dbbfd]:focus,.v-dd-option.active[data-v-c63dbbfd]{background-color:var(--background-color)}.v-dd-option.parent-option>svg[data-v-c63dbbfd]{left:.75rem;transform:rotate(90deg)}@keyframes v-dd-menu-open-c63dbbfd{0%{transform:translateY(2px)}to{transform:translateY(0)}}")),document.head.appendChild(d)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
import { openBlock as d, createElementBlock as p, createElementVNode as a, toDisplayString as h, defineComponent as C, resolveComponent as $, createCommentVNode as f, normalizeClass as O, createVNode as I, withDirectives as b, vModelText as D, vShow as M, Fragment as _, renderList as q, createBlock as g } from "vue";
const P = (e, t) => {
const o = e.__vccOpts || e;
for (const [s, i] of t)
o[s] = i;
return o;
}, T = {
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.id="vs-autocomplete",a.appendChild(document.createTextNode(".v-tree-dropdown[data-v-a62f7223]{--primary-color: #1f73b7;--background-color: #1f73b714;--hint-color: #828485;--border: 1px solid #d8dcde;--v-dropdown-width: 300px;--max-width: 10000000px;--box-shadow: rgb(255, 255, 255) 0px 0px 0px 1px, rgb(31, 115, 183) 0px 0px 0px 3px;--bezier-curve: .1s cubic-bezier(0, 0, .95, 1.03);--animation-delay: .2s;position:relative;width:var(--v-dropdown-width);max-width:var(--max-width);outline:none}.v-dd[data-v-a62f7223]{display:flex;flex-direction:column}.v-dd>label[data-v-a62f7223],.v-dd-option>.label[data-v-a62f7223]{font-weight:600;text-align:left}.v-dd>label[data-v-a62f7223],.v-dd>label+.v-dd-label-hint[data-v-a62f7223]{line-height:1.45;text-align:left}.v-tree-dropdown .v-dd>label+.v-dd-label-hint[data-v-a62f7223]{color:var(--hint-color)}.v-dd:hover .v-dd-search[data-v-a62f7223]{border-color:var(--primary-color)}.c-btn__icon[data-v-a62f7223]{width:16px;height:16px;margin-top:-2px;vertical-align:middle}.u-truncate[data-v-a62f7223]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v-dd-search[data-v-a62f7223]{position:relative;display:flex;align-items:center;justify-content:space-between;border:var(--border);padding:.75rem;margin-top:.5rem;border-radius:4px;cursor:pointer;outline:none;z-index:1}.v-dd-search.compact[data-v-a62f7223]{padding:.5rem .75rem;margin-top:.25rem}.v-dd-search[data-v-a62f7223]:active,.v-dd-search[data-v-a62f7223]:focus,.v-dd-search[data-v-a62f7223]:focus-within{border-color:var(--primary-color);box-shadow:var(--box-shadow);transition:border-color var(--animation-delay) ease-in-out,box-shadow var(--animation-delay) ease-in-out}.v-dd-search>svg[data-v-a62f7223]{position:absolute}.v-dd-search>svg[aria-labelledby=zd-search][data-v-a62f7223]{left:1rem}.v-dd-search>svg[aria-labelledby=zd-down-pointer][data-v-a62f7223]{right:1rem}.v-dd-search>svg[aria-labelledby=zd-down-pointer].open[data-v-a62f7223]{transform:rotate(180deg);transition:transform var(--animation-delay) ease-in-out}.v-dd-search>svg[aria-labelledby=zd-down-pointer].close[data-v-a62f7223]{transform:rotate(0);transition:transform var(--animation-delay) ease-in-out}.v-dd-search>input[data-v-a62f7223],.v-dd-search>div[data-v-a62f7223]{font-size:1em;height:1.25rem;line-height:1.25rem;flex-grow:1;padding:0 2rem}.v-dd-input[data-v-a62f7223]{border:none;outline:none}.v-dd-input.hide[data-v-a62f7223]{position:absolute;width:0px;height:1px;padding:0}.v-dd+ul[data-v-a62f7223]{position:absolute;display:flex;flex-direction:column;top:calc(100% + 5px);left:0;width:100%;max-height:500px;border:var(--border);border-radius:4px;background-color:#fff;z-index:1;padding:.25rem 0;margin:0;max-height:350px;overflow-y:auto;box-shadow:#17494d26 0 20px 30px;animation:v-dd-menu-open-a62f7223 var(--bezier-curve) 0s 1 normal;transition:display var(--bezier-curve)}.v-dd-option[data-v-a62f7223]{position:relative;display:flex;align-items:center;justify-content:space-between;cursor:pointer;padding:.5rem 1.25rem}.v-dd+ul.compact>li[data-v-a62f7223]{padding:.5rem 1.25rem}.v-dd+ul>li.parent-option[data-v-a62f7223]{border-bottom:var(--border);padding:.5rem .75rem}.v-dd+ul.compact>li.parent-option[data-v-a62f7223]{padding:.35rem .75rem}li.v-dd-option>svg[aria-labelledby=zd-check][data-v-a62f7223],li.v-dd-option>svg[aria-labelledby=zd-contains][data-v-a62f7223]{position:absolute}.v-dd-option>span[data-v-a62f7223]{padding:0 2rem;flex-grow:1;text-align:left}.v-dd-option.no-data[data-v-a62f7223],.v-dd-option[disabled=disabled][data-v-a62f7223]{-webkit-user-select:none;user-select:none;pointer-events:none;opacity:.7;cursor:not-allowed}.v-dd-option>svg[aria-labelledby=zd-down-pointer][data-v-a62f7223]{position:absolute;right:1rem;transform:rotate(-90deg)}.v-dd-option[data-v-a62f7223]:hover,.v-dd-option[data-v-a62f7223]:focus,.v-dd-option.active[data-v-a62f7223]{background-color:var(--background-color)}.v-dd-option.parent-option>svg[data-v-a62f7223]{left:.75rem;transform:rotate(90deg)}@keyframes v-dd-menu-open-a62f7223{0%{transform:translateY(2px)}to{transform:translateY(0)}}")),document.head.appendChild(a)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
function _(s, e, t, i, n, l, a, c) {
var r = typeof s == "function" ? s.options : s;
e && (r.render = e, r.staticRenderFns = t, r._compiled = !0), i && (r.functional = !0), l && (r._scopeId = "data-v-" + l);
var o;
if (a ? (o = function(d) {
d = d || // cached call
this.$vnode && this.$vnode.ssrContext || // stateful
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !d && typeof __VUE_SSR_CONTEXT__ < "u" && (d = __VUE_SSR_CONTEXT__), n && n.call(this, d), d && d._registeredComponents && d._registeredComponents.add(a);
}, r._ssrRegister = o) : n && (o = c ? function() {
n.call(
this,
(r.functional ? this.parent : this).$root.$options.shadowRoot
);
} : n), o)
if (r.functional) {
r._injectStyles = o;
var p = r.render;
r.render = function(O, f) {
return o.call(f), p(O, f);
};
} else {
var h = r.beforeCreate;
r.beforeCreate = h ? [].concat(h, o) : [o];
}
return {
exports: s,
options: r
};
}
const m = {
props: {

@@ -40,28 +63,20 @@ icon: {

}
}, L = T, z = ["color", "role", "aria-labelledby"], V = ["id"], B = ["innerHTML"];
function A(e, t, o, s, i, c) {
return d(), p("svg", {
xmlns: "http://www.w3.org/2000/svg",
color: e.color,
role: e.role,
"aria-labelledby": e.icon,
focusable: "false",
"aria-hidden": "true",
class: "c-btn__icon"
}, [
a("title", {
id: e.name || e.icon
}, h(e.name || e.icon) + " Icon", 9, V),
a("desc", null, h(e.iconDescription || e.name), 1),
(d(), p("svg", {
width: "16",
height: "16",
viewBox: "0 0 16 16",
innerHTML: e.paths[e.icon]
}, null, 8, B))
], 8, z);
}
const E = /* @__PURE__ */ P(L, [["render", A]]), N = C({
}, v = m;
var I = function() {
var e = this, t = e._self._c;
return e._self._setupProxy, t("svg", { staticClass: "c-btn__icon", attrs: { xmlns: "http://www.w3.org/2000/svg", color: e.color, role: e.role, "aria-labelledby": e.icon, focusable: "false", "aria-hidden": "true" } }, [t("title", { attrs: { id: e.name || e.icon } }, [e._v(e._s(e.name || e.icon) + " Icon")]), t("desc", [e._v(e._s(e.iconDescription || e.name))]), t("svg", { attrs: { width: "16", height: "16", viewBox: "0 0 16 16" }, domProps: { innerHTML: e._s(e.paths[e.icon]) } })]);
}, g = [], b = /* @__PURE__ */ _(
v,
I,
g,
!1,
null,
null,
null,
null
);
const w = b.exports;
const x = {
components: {
SvgIcon: E
SvgIcon: w
},

@@ -120,3 +135,3 @@ props: {

},
emits: ["update:modelValue", "open", "close"],
emits: ["input", "update:modelValue", "open", "close"],
data() {

@@ -155,12 +170,12 @@ return {

selectedOptions: {
handler(e, t) {
const o = t.map((i) => i.__identifier), s = e.map((i) => i.__identifier);
if (e.length !== t.length || !s.every((i) => o.includes(i)))
handler(s, e) {
const t = e.map((n) => n.__identifier), i = s.map((n) => n.__identifier);
if (s.length !== e.length || !i.every((n) => t.includes(n)))
try {
this.$emit(
"update:modelValue",
this.selectedOptions.map(({ __identifier: i, __selected: c, ...r }) => r)
"input",
this.selectedOptions.map(({ __identifier: n, __selected: l, ...a }) => a)
);
} catch (i) {
console.log("Unknown Event ", i);
} catch (n) {
console.log("Unknown Event ", n);
}

@@ -187,8 +202,8 @@ },

try {
const e = JSON.parse(JSON.stringify(this.options)), { formattedOptions: t, selectedOptions: o } = this.parseInputOptions(e);
if (this.ddOptions = t, this.selectedOptions = o, this.searchInput) {
const s = this.filterMatchingOptions(this.searchInput, this.ddOptions);
this.currentOptions = s, this.filteredOptions = s;
const s = JSON.parse(JSON.stringify(this.options)), { formattedOptions: e, selectedOptions: t } = this.parseInputOptions(s);
if (this.ddOptions = e, this.selectedOptions = t, this.searchInput) {
const i = this.filterMatchingOptions(this.searchInput, this.ddOptions);
this.currentOptions = i, this.filteredOptions = i;
} else
this.currentOptions = t, this.filteredOptions = t;
this.currentOptions = e, this.filteredOptions = e;
} catch {

@@ -202,261 +217,160 @@ console.error("[vs-autocomplete]: Options must be a valid JSON Array");

focusSearchInput() {
var e;
(e = this.$refs.searchInput) == null || e.focus();
var s;
(s = this.$refs.searchInput) == null || s.focus();
},
toggleDropdownMenu(e) {
e.stopPropagation(), this.menuIsOpen = !this.menuIsOpen, this.focusSearchInput();
toggleDropdownMenu(s) {
s.stopPropagation(), this.menuIsOpen = !this.menuIsOpen, this.focusSearchInput();
},
closeDropdownMenu() {
var e;
this.menuIsOpen = !1, (e = this.searchInput) != null && e.trim().length || (this.searchInput = "", this.selectedParent = null, this.filteredOptions = this.ddOptions, this.currentOptions = this.ddOptions, this.selectedIndex = -1);
var s;
this.menuIsOpen = !1, (s = this.searchInput) != null && s.trim().length || (this.searchInput = "", this.selectedParent = null, this.filteredOptions = this.ddOptions, this.currentOptions = this.ddOptions, this.selectedIndex = -1);
},
keepMenuOpen(e) {
e == null || e.stopPropagation(), this.menuIsOpen || (this.menuIsOpen = !0), this.focusSearchInput();
keepMenuOpen(s) {
s == null || s.stopPropagation(), this.menuIsOpen || (this.menuIsOpen = !0), this.focusSearchInput();
},
closeDropdownMenuOnBlur(e) {
var t;
(t = e.path || e.composedPath()) != null && t.includes(this.$refs.dropdown) || this.closeDropdownMenu();
closeDropdownMenuOnBlur(s) {
var e;
(e = s.path || s.composedPath()) != null && e.includes(this.$refs.dropdown) || this.closeDropdownMenu();
},
parseInputOptions(e = [], t = [], o = []) {
return e.forEach((s) => {
var c;
const i = [...t, s.label];
typeof s.value < "u" && i.push(s.value), s.__identifier = i.join("__"), (c = s.children) != null && c.length ? this.parseInputOptions(s.children, i, o) : s.selected && o.push(s);
}), { formattedOptions: e, selectedOptions: o };
parseInputOptions(s = [], e = [], t = []) {
return s.forEach((i) => {
var l;
const n = [...e, i.label];
typeof i.value < "u" && n.push(i.value), i.__identifier = n.join("__"), (l = i.children) != null && l.length ? this.parseInputOptions(i.children, n, t) : i.selected && t.push(i);
}), { formattedOptions: s, selectedOptions: t };
},
isOptionSelected(e) {
return this.selectedOptions.findIndex((t) => t.__identifier === e.__identifier) > -1;
isOptionSelected(s) {
return this.selectedOptions.findIndex((e) => e.__identifier === s.__identifier) > -1;
},
hasSelectedOptions(e) {
return e.some(
(t) => {
var o;
return (o = t.children) != null && o.length ? this.hasSelectedOptions(t.children) : this.isOptionSelected(t);
hasSelectedOptions(s) {
return s.some(
(e) => {
var t;
return (t = e.children) != null && t.length ? this.hasSelectedOptions(e.children) : this.isOptionSelected(e);
}
);
},
goToPreviousOptions(e = null, t = this.filteredOptions) {
var o;
for (const s of t)
if ((o = s.children) != null && o.length) {
if (s.__identifier === this.selectedParent.__identifier && s.children.length === this.currentOptions.length) {
this.currentOptions = t, this.selectedParent = e;
goToPreviousOptions(s = null, e = this.filteredOptions) {
var t;
for (const i of e)
if ((t = i.children) != null && t.length) {
if (i.__identifier === this.selectedParent.__identifier && i.children.length === this.currentOptions.length) {
this.currentOptions = e, this.selectedParent = s;
return;
}
this.goToPreviousOptions(s, s.children);
this.goToPreviousOptions(i, i.children);
}
},
filterMatchingOptions(e, t) {
var s;
let o = [];
for (const i of t) {
const { __identifier: c, __selected: r, ...u } = i, n = this.searchOptionMatcher(e, u);
if (typeof n == "boolean" ? n : i.label.toLowerCase().includes(e.toLowerCase()))
o.push(i);
else if ((s = i.children) != null && s.length) {
const l = this.filterMatchingOptions(e, i.children);
l.length && o.push({ ...i, children: l });
filterMatchingOptions(s, e) {
var i;
let t = [];
for (const n of e) {
const { __identifier: l, __selected: a, ...c } = n, r = this.searchOptionMatcher(s, c);
if (typeof r == "boolean" ? r : n.label.toLowerCase().includes(s.toLowerCase()))
t.push(n);
else if ((i = n.children) != null && i.length) {
const o = this.filterMatchingOptions(s, n.children);
o.length && t.push({ ...n, children: o });
}
}
return o;
return t;
},
selectOption(e) {
var o;
const t = this.currentOptions[e];
if ((o = t.children) != null && o.length)
this.selectedParent = t, this.currentOptions = t.children;
else if (t.__selected || this.isOptionSelected(t, this.selectedParent)) {
selectOption(s) {
var t;
const e = this.currentOptions[s];
if ((t = e.children) != null && t.length)
this.selectedParent = e, this.currentOptions = e.children;
else if (e.__selected || this.isOptionSelected(e, this.selectedParent)) {
if (this.multiple) {
const s = this.selectedOptions.findIndex(
(i) => i.__identifier === t.__identifier
const i = this.selectedOptions.findIndex(
(n) => n.__identifier === e.__identifier
);
s > -1 && (this.selectedOptions = [
...this.selectedOptions.slice(0, s),
...this.selectedOptions.slice(s + 1)
i > -1 && (this.selectedOptions = [
...this.selectedOptions.slice(0, i),
...this.selectedOptions.slice(i + 1)
]);
} else
this.selectedOptions = [];
this.currentOptions[e].__selected = !1;
this.currentOptions[s].__selected = !1;
} else {
if (this.multiple)
this.selectedOptions = [...this.selectedOptions, t];
this.selectedOptions = [...this.selectedOptions, e];
else {
const s = this.currentOptions.findIndex(
(i) => i.__selected === !0
const i = this.currentOptions.findIndex(
(n) => n.__selected === !0
);
s > -1 && (this.currentOptions[s].__selected = !1), this.selectedOptions = [t], this.closeDropdownMenu();
i > -1 && (this.currentOptions[i].__selected = !1), this.selectedOptions = [e], this.closeDropdownMenu();
}
this.currentOptions[e].__selected = !0;
this.currentOptions[s].__selected = !0;
}
},
handleKeyDown(e) {
var o, s, i, c, r, u;
const { key: t } = e;
if (t === "Escape")
handleKeyDown(s) {
var t, i, n, l, a, c, r;
const { key: e } = s;
if (e === "Escape")
this.closeDropdownMenu();
else if (t === "Enter" || t.length === 1) {
if (this.menuIsOpen || this.keepMenuOpen(e), t === "Enter") {
else if (e === "Enter" || e.length === 1) {
if (this.menuIsOpen || this.keepMenuOpen(s), e === "Enter") {
if (this.maxSelectableCount && ((t = this.selectedOptions) == null ? void 0 : t.length) >= this.maxSelectableCount)
return;
if (this.selectedParent && this.selectedIndex === 0)
this.goToPreviousOptions(), this.selectedIndex = 0;
else if (this.selectedIndex !== -1) {
const n = this.selectedParent ? this.selectedIndex - 1 : this.selectedIndex;
if (!((o = this.currentOptions[n]) != null && o.disabled)) {
const l = (s = this.selectedParent) == null ? void 0 : s.label;
this.selectOption(n), l !== ((i = this.selectedParent) == null ? void 0 : i.label) && (this.selectedParent ? this.selectedIndex = 1 : this.selectedIndex = 0);
const o = this.selectedParent ? this.selectedIndex - 1 : this.selectedIndex;
if (!((i = this.currentOptions[o]) != null && i.disabled)) {
const p = (n = this.selectedParent) == null ? void 0 : n.label;
this.selectOption(o), p !== ((l = this.selectedParent) == null ? void 0 : l.label) && (this.selectedParent ? this.selectedIndex = 1 : this.selectedIndex = 0);
}
}
}
} else if (t === "ArrowUp")
} else if (e === "ArrowUp")
if (this.selectedIndex === 0) {
const n = this.currentOptions.length;
this.selectedIndex = this.selectedParent ? n : n - 1;
const o = this.currentOptions.length;
this.selectedIndex = this.selectedParent ? o : o - 1;
} else
this.selectedIndex--;
else if (t === "ArrowRight") {
const n = this.selectedParent ? this.selectedIndex - 1 : this.selectedIndex;
!((c = this.currentOptions[n]) != null && c.disabled) && ((u = (r = this.currentOptions[n]) == null ? void 0 : r.children) != null && u.length) && (this.selectOption(n), this.selectedParent && (this.selectedIndex = 1));
} else if (t === "ArrowDown") {
const n = this.currentOptions.length;
this.selectedIndex === (this.selectedParent ? n : n - 1) ? this.selectedIndex = 0 : this.selectedIndex++;
else if (e === "ArrowRight") {
const o = this.selectedParent ? this.selectedIndex - 1 : this.selectedIndex;
!((a = this.currentOptions[o]) != null && a.disabled) && ((r = (c = this.currentOptions[o]) == null ? void 0 : c.children) != null && r.length) && (this.selectOption(o), this.selectedParent && (this.selectedIndex = 1));
} else if (e === "ArrowDown") {
const o = this.currentOptions.length;
this.selectedIndex === (this.selectedParent ? o : o - 1) ? this.selectedIndex = 0 : this.selectedIndex++;
} else
t === "ArrowLeft" && this.selectedParent && (this.goToPreviousOptions(), this.selectedIndex = 0);
e === "ArrowLeft" && this.selectedParent && (this.goToPreviousOptions(), this.selectedIndex = 0);
}
}
}), H = {
class: "v-tree-dropdown",
ref: "dropdown"
}, R = { class: "v-dd" }, K = ["for", "id"], U = ["aria-labelledby"], j = ["aria-expanded", "aria-owns", "aria-labelledby"], J = ["id", "aria-labelledby", "aria-controls", "aria-activedescendant"], F = ["innerHTML"], G = ["id", "aria-labelledby", "aria-multiselectable"], Q = {
key: 0,
class: "v-dd-option no-data",
role: "option"
}, W = ["id"], X = { class: "u-truncate label" }, Y = ["id", "onClick", "aria-selected", "disabled"], Z = { class: "u-truncate" };
function x(e, t, o, s, i, c) {
var u;
const r = $("svg-icon");
return d(), p("div", H, [
a("div", R, [
a("label", {
for: "v-dd-search__input" + e.uniqueId,
id: "v-dd-label" + e.uniqueId
}, h(e.label), 9, K),
e.labelHint ? (d(), p("div", {
key: 0,
class: "v-dd-label-hint",
"aria-labelledby": "v-dd-label" + e.uniqueId
}, h(e.labelHint), 9, U)) : f("", !0),
a("div", {
class: O("v-dd-search" + (e.menuIsOpen ? " active" : "") + (e.compact ? " compact" : "")),
onClick: t[3] || (t[3] = (...n) => e.toggleDropdownMenu && e.toggleDropdownMenu(...n)),
"aria-haspopup": "listbox",
"aria-expanded": "" + e.menuIsOpen,
"aria-owns": "v-dd-options-menu" + e.uniqueId,
"aria-labelledby": "v-dd-label" + e.uniqueId
}, [
I(r, {
icon: "zd-search",
name: "Search"
}),
b(a("input", {
ref: "searchInput",
type: "text",
autocomplete: "off",
id: "v-dd-search__input" + e.uniqueId,
class: O("c-txt v-dd-input" + (e.menuIsOpen ? "" : " hide")),
"onUpdate:modelValue": t[0] || (t[0] = (n) => e.searchInput = n),
onClick: t[1] || (t[1] = (...n) => e.keepMenuOpen && e.keepMenuOpen(...n)),
onKeydown: t[2] || (t[2] = (...n) => e.handleKeyDown && e.handleKeyDown(...n)),
role: "combobox",
"aria-labelledby": "v-dd-label" + e.uniqueId,
"aria-autocomplete": "list",
"aria-controls": e.menuIsOpen ? "v-dd-options-menu" + e.uniqueId : !1,
"aria-activedescendant": e.menuIsOpen ? "v-dd-option-" + e.selectedIndex : !1
}, null, 42, J), [
[D, e.searchInput]
]),
b(a("div", {
class: "c-txt u-truncate",
innerHTML: e.selectedOptions.map((n) => n.label).join(", ")
}, null, 8, F), [
[M, !e.menuIsOpen]
]),
I(r, {
icon: "zd-down-pointer",
name: e.menuIsOpen ? "Up arrow" : "Down arrow",
class: O(e.menuIsOpen ? "open" : "close")
}, null, 8, ["name", "class"])
], 10, j)
]),
b(a("ul", {
ref: "menu",
id: "v-dd-options-menu" + e.uniqueId,
class: O(e.compact ? "compact" : ""),
role: "listbox",
"aria-labelledby": "v-dd-label" + e.uniqueId,
"aria-multiselectable": !!e.multiple
}, [
(u = e.currentOptions) != null && u.length ? f("", !0) : (d(), p("li", Q, [
a("span", null, h(e.noSearchResultsText), 1)
])),
e.selectedParent ? (d(), p("li", {
key: 1,
id: "v-dd-option-0" + e.uniqueId,
class: O("v-dd-option parent-option" + (e.selectedIndex === 0 ? " active" : "")),
onClick: t[4] || (t[4] = (n) => e.goToPreviousOptions()),
role: "option"
}, [
I(r, {
icon: "zd-down-pointer",
name: "Left arrow",
iconDescription: "Click to go back to previous menu",
color: "#1f73b7"
}),
a("span", X, h(e.selectedParent.label), 1)
], 10, W)) : f("", !0),
(d(!0), p(_, null, q(e.currentOptions, (n, l) => {
var v, w, y, k, S;
return d(), p("li", {
key: n.label + "__" + (n.value ?? l),
id: "v-dd-option-" + (e.selectedParent ? l + 1 : l) + e.uniqueId,
class: O("v-dd-option" + (e.selectedIndex === (e.selectedParent ? l + 1 : l) ? " active" : "")),
onClick: (ne) => e.selectOption(l),
role: "option",
"aria-selected": e.selectedIndex === (e.selectedParent ? l + 1 : l),
disabled: n.disabled || e.maxSelectableCount && ((v = e.selectedOptions) == null ? void 0 : v.length) >= e.maxSelectableCount && !((w = n.children) != null && w.length) && !e.isOptionSelected(n) ? "disabled" : null
}, [
(y = n.children) != null && y.length && e.hasSelectedOptions(n.children) ? (d(), g(r, {
key: 0,
icon: "zd-contains",
name: "Contains",
color: "#1f73b7"
})) : f("", !0),
!((k = n.children) != null && k.length) && e.isOptionSelected(n) ? (d(), g(r, {
key: 1,
icon: "zd-check",
name: "Selected",
color: "#1f73b7"
})) : f("", !0),
a("span", Z, h(n.label), 1),
(S = n.children) != null && S.length ? (d(), g(r, {
key: 2,
icon: "zd-down-pointer",
name: "Right arrow",
iconDescription: "Click to open sub-menu options"
})) : f("", !0)
], 10, Y);
}), 128))
], 10, G), [
[M, e.menuIsOpen]
])
], 512);
}
const ee = /* @__PURE__ */ P(N, [["render", x], ["__scopeId", "data-v-c63dbbfd"]]), te = {
install(e, t) {
e.component("VsAutocomplete", ee);
};
var S = function() {
var i;
var e = this, t = e._self._c;
return t("div", { ref: "dropdown", staticClass: "v-tree-dropdown" }, [t("div", { staticClass: "v-dd" }, [t("label", { attrs: { for: "v-dd-search__input" + e.uniqueId, id: "v-dd-label" + e.uniqueId } }, [e._v(" " + e._s(e.label) + " ")]), e.labelHint ? t("div", { staticClass: "v-dd-label-hint", attrs: { "aria-labelledby": "v-dd-label" + e.uniqueId } }, [e._v(" " + e._s(e.labelHint) + " ")]) : e._e(), t("div", { class: "v-dd-search" + (e.menuIsOpen ? " active" : "") + (e.compact ? " compact" : ""), attrs: { "aria-haspopup": "listbox", "aria-expanded": "" + e.menuIsOpen, "aria-owns": "v-dd-options-menu" + e.uniqueId, "aria-labelledby": "v-dd-label" + e.uniqueId }, on: { click: e.toggleDropdownMenu } }, [t("svg-icon", { attrs: { icon: "zd-search", name: "Search" } }), t("input", { directives: [{ name: "model", rawName: "v-model", value: e.searchInput, expression: "searchInput" }], ref: "searchInput", class: "c-txt v-dd-input" + (e.menuIsOpen ? "" : " hide"), attrs: { type: "text", autocomplete: "off", id: "v-dd-search__input" + e.uniqueId, role: "combobox", "aria-labelledby": "v-dd-label" + e.uniqueId, "aria-autocomplete": "list", "aria-controls": e.menuIsOpen ? "v-dd-options-menu" + e.uniqueId : !1, "aria-activedescendant": e.menuIsOpen ? "v-dd-option-" + e.selectedIndex : !1 }, domProps: { value: e.searchInput }, on: { click: e.keepMenuOpen, keydown: e.handleKeyDown, input: function(n) {
n.target.composing || (e.searchInput = n.target.value);
} } }), t("div", { directives: [{ name: "show", rawName: "v-show", value: !e.menuIsOpen, expression: "!menuIsOpen" }], staticClass: "c-txt u-truncate", domProps: { innerHTML: e._s(e.selectedOptions.map((n) => n.label).join(", ")) } }), t("svg-icon", { class: e.menuIsOpen ? "open" : "close", attrs: { icon: "zd-down-pointer", name: e.menuIsOpen ? "Up arrow" : "Down arrow" } })], 1)]), t("ul", { directives: [{ name: "show", rawName: "v-show", value: e.menuIsOpen, expression: "menuIsOpen" }], ref: "menu", class: e.compact ? "compact" : "", attrs: { id: "v-dd-options-menu" + e.uniqueId, role: "listbox", "aria-labelledby": "v-dd-label" + e.uniqueId, "aria-multiselectable": !!e.multiple } }, [(i = e.currentOptions) != null && i.length ? e._e() : t("li", { staticClass: "v-dd-option no-data", attrs: { role: "option" } }, [t("span", [e._v(e._s(e.noSearchResultsText))])]), e.selectedParent ? t("li", { class: "v-dd-option parent-option" + (e.selectedIndex === 0 ? " active" : ""), attrs: { id: "v-dd-option-0" + e.uniqueId, role: "option" }, on: { click: function(n) {
return e.goToPreviousOptions();
} } }, [t("svg-icon", { attrs: { icon: "zd-down-pointer", name: "Left arrow", iconDescription: "Click to go back to previous menu", color: "#1f73b7" } }), t("span", { staticClass: "u-truncate label" }, [e._v(e._s(e.selectedParent.label))])], 1) : e._e(), e._l(e.currentOptions, function(n, l) {
var a, c, r, o, p;
return t("li", { key: n.label + "__" + (n.value ?? l), class: "v-dd-option" + (e.selectedIndex === (e.selectedParent ? l + 1 : l) ? " active" : ""), attrs: { id: "v-dd-option-" + (e.selectedParent ? l + 1 : l) + e.uniqueId, role: "option", "aria-selected": e.selectedIndex === (e.selectedParent ? l + 1 : l), disabled: n.disabled || e.maxSelectableCount && ((a = e.selectedOptions) == null ? void 0 : a.length) >= e.maxSelectableCount && !((c = n.children) != null && c.length) && !e.isOptionSelected(n) ? "disabled" : null }, on: { click: function(h) {
return e.selectOption(l);
} } }, [(r = n.children) != null && r.length && e.hasSelectedOptions(n.children) ? t("svg-icon", { attrs: { icon: "zd-contains", name: "Contains", color: "#1f73b7" } }) : e._e(), !((o = n.children) != null && o.length) && e.isOptionSelected(n) ? t("svg-icon", { attrs: { icon: "zd-check", name: "Selected", color: "#1f73b7" } }) : e._e(), t("span", { staticClass: "u-truncate" }, [e._v(e._s(n.label))]), (p = n.children) != null && p.length ? t("svg-icon", { attrs: { icon: "zd-down-pointer", name: "Right arrow", iconDescription: "Click to open sub-menu options" } }) : e._e()], 1);
})], 2)]);
}, y = [], C = /* @__PURE__ */ _(
x,
S,
y,
!1,
null,
"a62f7223",
null,
null
);
const P = C.exports, k = {
install(s, e) {
s.component("VsAutocomplete", P);
}
};
let m = null;
typeof window < "u" ? m = window.Vue : typeof global < "u" && (m = global.Vue);
m && m.use && m.use(te);
let u = null;
typeof window < "u" ? u = window.Vue : typeof global < "u" && (u = global.Vue);
u && u.use && u.use(k);
export {
ee as default
P as default
};

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

(function(){"use strict";try{if(typeof document<"u"){var d=document.createElement("style");d.id="vs-autocomplete",d.appendChild(document.createTextNode(".v-tree-dropdown[data-v-c63dbbfd]{--primary-color: #1f73b7;--background-color: #1f73b714;--hint-color: #828485;--border: 1px solid #d8dcde;--v-dropdown-width: 300px;--max-width: 10000000px;--box-shadow: rgb(255, 255, 255) 0px 0px 0px 1px, rgb(31, 115, 183) 0px 0px 0px 3px;--bezier-curve: .1s cubic-bezier(0, 0, .95, 1.03);--animation-delay: .2s;position:relative;width:var(--v-dropdown-width);max-width:var(--max-width);outline:none}.v-dd[data-v-c63dbbfd]{display:flex;flex-direction:column}.v-dd>label[data-v-c63dbbfd],.v-dd-option>.label[data-v-c63dbbfd]{font-weight:600;text-align:left}.v-dd>label[data-v-c63dbbfd],.v-dd>label+.v-dd-label-hint[data-v-c63dbbfd]{line-height:1.45;text-align:left}.v-tree-dropdown .v-dd>label+.v-dd-label-hint[data-v-c63dbbfd]{color:var(--hint-color)}.v-dd:hover .v-dd-search[data-v-c63dbbfd]{border-color:var(--primary-color)}.c-btn__icon[data-v-c63dbbfd]{width:16px;height:16px;margin-top:-2px;vertical-align:middle}.u-truncate[data-v-c63dbbfd]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v-dd-search[data-v-c63dbbfd]{position:relative;display:flex;align-items:center;justify-content:space-between;border:var(--border);padding:.75rem;margin-top:.5rem;border-radius:4px;cursor:pointer;outline:none;z-index:1}.v-dd-search.compact[data-v-c63dbbfd]{padding:.5rem .75rem;margin-top:.25rem}.v-dd-search[data-v-c63dbbfd]:active,.v-dd-search[data-v-c63dbbfd]:focus,.v-dd-search[data-v-c63dbbfd]:focus-within{border-color:var(--primary-color);box-shadow:var(--box-shadow);transition:border-color var(--animation-delay) ease-in-out,box-shadow var(--animation-delay) ease-in-out}.v-dd-search>svg[data-v-c63dbbfd]{position:absolute}.v-dd-search>svg[aria-labelledby=zd-search][data-v-c63dbbfd]{left:1rem}.v-dd-search>svg[aria-labelledby=zd-down-pointer][data-v-c63dbbfd]{right:1rem}.v-dd-search>svg[aria-labelledby=zd-down-pointer].open[data-v-c63dbbfd]{transform:rotate(180deg);transition:transform var(--animation-delay) ease-in-out}.v-dd-search>svg[aria-labelledby=zd-down-pointer].close[data-v-c63dbbfd]{transform:rotate(0);transition:transform var(--animation-delay) ease-in-out}.v-dd-search>input[data-v-c63dbbfd],.v-dd-search>div[data-v-c63dbbfd]{font-size:1em;height:1.25rem;line-height:1.25rem;flex-grow:1;padding:0 2rem}.v-dd-input[data-v-c63dbbfd]{border:none;outline:none}.v-dd-input.hide[data-v-c63dbbfd]{position:absolute;width:0px;height:1px;padding:0}.v-dd+ul[data-v-c63dbbfd]{position:absolute;display:flex;flex-direction:column;top:calc(100% + 5px);left:0;width:100%;max-height:500px;border:var(--border);border-radius:4px;background-color:#fff;z-index:1;padding:.25rem 0;margin:0;max-height:350px;overflow-y:auto;box-shadow:#17494d26 0 20px 30px;animation:v-dd-menu-open-c63dbbfd var(--bezier-curve) 0s 1 normal;transition:display var(--bezier-curve)}.v-dd-option[data-v-c63dbbfd]{position:relative;display:flex;align-items:center;justify-content:space-between;cursor:pointer;padding:.5rem 1.25rem}.v-dd+ul.compact>li[data-v-c63dbbfd]{padding:.5rem 1.25rem}.v-dd+ul>li.parent-option[data-v-c63dbbfd]{border-bottom:var(--border);padding:.5rem .75rem}.v-dd+ul.compact>li.parent-option[data-v-c63dbbfd]{padding:.35rem .75rem}li.v-dd-option>svg[aria-labelledby=zd-check][data-v-c63dbbfd],li.v-dd-option>svg[aria-labelledby=zd-contains][data-v-c63dbbfd]{position:absolute}.v-dd-option>span[data-v-c63dbbfd]{padding:0 2rem;flex-grow:1;text-align:left}.v-dd-option.no-data[data-v-c63dbbfd],.v-dd-option[disabled=disabled][data-v-c63dbbfd]{-webkit-user-select:none;user-select:none;pointer-events:none;opacity:.7;cursor:not-allowed}.v-dd-option>svg[aria-labelledby=zd-down-pointer][data-v-c63dbbfd]{position:absolute;right:1rem;transform:rotate(-90deg)}.v-dd-option[data-v-c63dbbfd]:hover,.v-dd-option[data-v-c63dbbfd]:focus,.v-dd-option.active[data-v-c63dbbfd]{background-color:var(--background-color)}.v-dd-option.parent-option>svg[data-v-c63dbbfd]{left:.75rem;transform:rotate(90deg)}@keyframes v-dd-menu-open-c63dbbfd{0%{transform:translateY(2px)}to{transform:translateY(0)}}")),document.head.appendChild(d)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
(function(t,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("vue")):typeof define=="function"&&define.amd?define(["vue"],p):(t=typeof globalThis<"u"?globalThis:t||self,t.VsAutocomplete=p(t.Vue))})(this,function(t){"use strict";const p=(e,n)=>{const l=e.__vccOpts||e;for(const[i,o]of n)l[i]=o;return l},b={props:{icon:{type:String,default:""},color:{type:String},role:{type:String,default:"presentation"},iconDescription:{type:String,default:""},name:{type:String,default:""}},data(){return{paths:{"zd-search":'<circle cx="6" cy="6" r="5.5" fill="none" stroke="currentColor"></circle><path stroke="currentColor" stroke-linecap="round" d="M15 15l-5-5"></path>',"zd-down-pointer":'<path fill="currentColor" d="M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"></path>',"zd-check":'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M1 9l4 4L15 3"></path>',"zd-contains":'<path fill="none" stroke="currentColor" stroke-linecap="round" d="M.5 8.5h15"></path>'}}}},k=["color","role","aria-labelledby"],y=["id"],w=["innerHTML"];function S(e,n,l,i,o,a){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",color:e.color,role:e.role,"aria-labelledby":e.icon,focusable:"false","aria-hidden":"true",class:"c-btn__icon"},[t.createElementVNode("title",{id:e.name||e.icon},t.toDisplayString(e.name||e.icon)+" Icon",9,y),t.createElementVNode("desc",null,t.toDisplayString(e.iconDescription||e.name),1),(t.openBlock(),t.createElementBlock("svg",{width:"16",height:"16",viewBox:"0 0 16 16",innerHTML:e.paths[e.icon]},null,8,w))],8,k)}const C=p(b,[["render",S]]),M=t.defineComponent({components:{SvgIcon:C},props:{label:{type:String,required:!1},options:{type:Array,default:[],required:!0},multiple:{type:Boolean,default:!1,required:!1},searchInputText:{type:String,default:"",required:!1},searchOptionMatcher:{type:Function,default:()=>{},required:!1},keepMenuOpenOnRender:{type:Boolean,default:!1,required:!1},maxSelectableCount:{type:Number,default:0,required:!1},compact:{type:Boolean,default:!1,required:!1},noSearchResultsText:{type:String,default:"No options found",required:!1},labelHint:{type:String,default:"",required:!1}},emits:["update:modelValue","open","close"],data(){return{ddOptions:[],searchInput:this.searchInputText,menuIsOpen:!1,selectedParent:null,selectedOptions:[],currentOptions:[],filteredOptions:[],selectedIndex:-1,selectedIndices:[],currentIndex:-1,uniqueId:Math.random().toString(36).substring(2,8)}},watch:{menuIsOpen(){this.menuIsOpen?(document.addEventListener("click",this.closeDropdownMenuOnBlur),this.$emit("open",this.$refs.dropdown,this.$refs.menu)):(document.removeEventListener("click",this.closeDropdownMenuOnBlur),this.$emit("close",this.$refs.dropdown,this.$refs.menu))},searchInput(){this.handleSearchInputChange()},selectedOptions:{handler(e,n){const l=n.map(o=>o.__identifier),i=e.map(o=>o.__identifier);if(e.length!==n.length||!i.every(o=>l.includes(o)))try{this.$emit("update:modelValue",this.selectedOptions.map(({__identifier:o,__selected:a,...d})=>d))}catch(o){console.log("Unknown Event ",o)}},deep:!0},options:{handler(){this.constructCompData()},deep:!0},searchInputText(){this.searchInput=this.searchInputText,this.keepMenuOpen()}},created(){this.constructCompData(),this.keepMenuOpenOnRender&&this.keepMenuOpen()},methods:{constructCompData(){try{const e=JSON.parse(JSON.stringify(this.options)),{formattedOptions:n,selectedOptions:l}=this.parseInputOptions(e);if(this.ddOptions=n,this.selectedOptions=l,this.searchInput){const i=this.filterMatchingOptions(this.searchInput,this.ddOptions);this.currentOptions=i,this.filteredOptions=i}else this.currentOptions=n,this.filteredOptions=n}catch{console.error("[vs-autocomplete]: Options must be a valid JSON Array")}},handleSearchInputChange(){this.searchInput?this.currentOptions=this.filterMatchingOptions(this.searchInput,this.ddOptions):this.currentOptions=this.ddOptions,this.filteredOptions=this.currentOptions,this.selectedParent=null},focusSearchInput(){var e;(e=this.$refs.searchInput)==null||e.focus()},toggleDropdownMenu(e){e.stopPropagation(),this.menuIsOpen=!this.menuIsOpen,this.focusSearchInput()},closeDropdownMenu(){var e;this.menuIsOpen=!1,(e=this.searchInput)!=null&&e.trim().length||(this.searchInput="",this.selectedParent=null,this.filteredOptions=this.ddOptions,this.currentOptions=this.ddOptions,this.selectedIndex=-1)},keepMenuOpen(e){e==null||e.stopPropagation(),this.menuIsOpen||(this.menuIsOpen=!0),this.focusSearchInput()},closeDropdownMenuOnBlur(e){var n;(n=e.path||e.composedPath())!=null&&n.includes(this.$refs.dropdown)||this.closeDropdownMenu()},parseInputOptions(e=[],n=[],l=[]){return e.forEach(i=>{var a;const o=[...n,i.label];typeof i.value<"u"&&o.push(i.value),i.__identifier=o.join("__"),(a=i.children)!=null&&a.length?this.parseInputOptions(i.children,o,l):i.selected&&l.push(i)}),{formattedOptions:e,selectedOptions:l}},isOptionSelected(e){return this.selectedOptions.findIndex(n=>n.__identifier===e.__identifier)>-1},hasSelectedOptions(e){return e.some(n=>{var l;return(l=n.children)!=null&&l.length?this.hasSelectedOptions(n.children):this.isOptionSelected(n)})},goToPreviousOptions(e=null,n=this.filteredOptions){var l;for(const i of n)if((l=i.children)!=null&&l.length){if(i.__identifier===this.selectedParent.__identifier&&i.children.length===this.currentOptions.length){this.currentOptions=n,this.selectedParent=e;return}this.goToPreviousOptions(i,i.children)}},filterMatchingOptions(e,n){var i;let l=[];for(const o of n){const{__identifier:a,__selected:d,...c}=o,s=this.searchOptionMatcher(e,c);if(typeof s=="boolean"?s:o.label.toLowerCase().includes(e.toLowerCase()))l.push(o);else if((i=o.children)!=null&&i.length){const r=this.filterMatchingOptions(e,o.children);r.length&&l.push({...o,children:r})}}return l},selectOption(e){var l;const n=this.currentOptions[e];if((l=n.children)!=null&&l.length)this.selectedParent=n,this.currentOptions=n.children;else if(n.__selected||this.isOptionSelected(n,this.selectedParent)){if(this.multiple){const i=this.selectedOptions.findIndex(o=>o.__identifier===n.__identifier);i>-1&&(this.selectedOptions=[...this.selectedOptions.slice(0,i),...this.selectedOptions.slice(i+1)])}else this.selectedOptions=[];this.currentOptions[e].__selected=!1}else{if(this.multiple)this.selectedOptions=[...this.selectedOptions,n];else{const i=this.currentOptions.findIndex(o=>o.__selected===!0);i>-1&&(this.currentOptions[i].__selected=!1),this.selectedOptions=[n],this.closeDropdownMenu()}this.currentOptions[e].__selected=!0}},handleKeyDown(e){var l,i,o,a,d,c;const{key:n}=e;if(n==="Escape")this.closeDropdownMenu();else if(n==="Enter"||n.length===1){if(this.menuIsOpen||this.keepMenuOpen(e),n==="Enter"){if(this.selectedParent&&this.selectedIndex===0)this.goToPreviousOptions(),this.selectedIndex=0;else if(this.selectedIndex!==-1){const s=this.selectedParent?this.selectedIndex-1:this.selectedIndex;if(!((l=this.currentOptions[s])!=null&&l.disabled)){const r=(i=this.selectedParent)==null?void 0:i.label;this.selectOption(s),r!==((o=this.selectedParent)==null?void 0:o.label)&&(this.selectedParent?this.selectedIndex=1:this.selectedIndex=0)}}}}else if(n==="ArrowUp")if(this.selectedIndex===0){const s=this.currentOptions.length;this.selectedIndex=this.selectedParent?s:s-1}else this.selectedIndex--;else if(n==="ArrowRight"){const s=this.selectedParent?this.selectedIndex-1:this.selectedIndex;!((a=this.currentOptions[s])!=null&&a.disabled)&&((c=(d=this.currentOptions[s])==null?void 0:d.children)!=null&&c.length)&&(this.selectOption(s),this.selectedParent&&(this.selectedIndex=1))}else if(n==="ArrowDown"){const s=this.currentOptions.length;this.selectedIndex===(this.selectedParent?s:s-1)?this.selectedIndex=0:this.selectedIndex++}else n==="ArrowLeft"&&this.selectedParent&&(this.goToPreviousOptions(),this.selectedIndex=0)}}}),D={class:"v-tree-dropdown",ref:"dropdown"},P={class:"v-dd"},V=["for","id"],B=["aria-labelledby"],E=["aria-expanded","aria-owns","aria-labelledby"],N=["id","aria-labelledby","aria-controls","aria-activedescendant"],$=["innerHTML"],q=["id","aria-labelledby","aria-multiselectable"],_={key:0,class:"v-dd-option no-data",role:"option"},T=["id"],z={class:"u-truncate label"},L=["id","onClick","aria-selected","disabled"],A={class:"u-truncate"};function H(e,n,l,i,o,a){var c;const d=t.resolveComponent("svg-icon");return t.openBlock(),t.createElementBlock("div",D,[t.createElementVNode("div",P,[t.createElementVNode("label",{for:"v-dd-search__input"+e.uniqueId,id:"v-dd-label"+e.uniqueId},t.toDisplayString(e.label),9,V),e.labelHint?(t.openBlock(),t.createElementBlock("div",{key:0,class:"v-dd-label-hint","aria-labelledby":"v-dd-label"+e.uniqueId},t.toDisplayString(e.labelHint),9,B)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass("v-dd-search"+(e.menuIsOpen?" active":"")+(e.compact?" compact":"")),onClick:n[3]||(n[3]=(...s)=>e.toggleDropdownMenu&&e.toggleDropdownMenu(...s)),"aria-haspopup":"listbox","aria-expanded":""+e.menuIsOpen,"aria-owns":"v-dd-options-menu"+e.uniqueId,"aria-labelledby":"v-dd-label"+e.uniqueId},[t.createVNode(d,{icon:"zd-search",name:"Search"}),t.withDirectives(t.createElementVNode("input",{ref:"searchInput",type:"text",autocomplete:"off",id:"v-dd-search__input"+e.uniqueId,class:t.normalizeClass("c-txt v-dd-input"+(e.menuIsOpen?"":" hide")),"onUpdate:modelValue":n[0]||(n[0]=s=>e.searchInput=s),onClick:n[1]||(n[1]=(...s)=>e.keepMenuOpen&&e.keepMenuOpen(...s)),onKeydown:n[2]||(n[2]=(...s)=>e.handleKeyDown&&e.handleKeyDown(...s)),role:"combobox","aria-labelledby":"v-dd-label"+e.uniqueId,"aria-autocomplete":"list","aria-controls":e.menuIsOpen?"v-dd-options-menu"+e.uniqueId:!1,"aria-activedescendant":e.menuIsOpen?"v-dd-option-"+e.selectedIndex:!1},null,42,N),[[t.vModelText,e.searchInput]]),t.withDirectives(t.createElementVNode("div",{class:"c-txt u-truncate",innerHTML:e.selectedOptions.map(s=>s.label).join(", ")},null,8,$),[[t.vShow,!e.menuIsOpen]]),t.createVNode(d,{icon:"zd-down-pointer",name:e.menuIsOpen?"Up arrow":"Down arrow",class:t.normalizeClass(e.menuIsOpen?"open":"close")},null,8,["name","class"])],10,E)]),t.withDirectives(t.createElementVNode("ul",{ref:"menu",id:"v-dd-options-menu"+e.uniqueId,class:t.normalizeClass(e.compact?"compact":""),role:"listbox","aria-labelledby":"v-dd-label"+e.uniqueId,"aria-multiselectable":!!e.multiple},[(c=e.currentOptions)!=null&&c.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("li",_,[t.createElementVNode("span",null,t.toDisplayString(e.noSearchResultsText),1)])),e.selectedParent?(t.openBlock(),t.createElementBlock("li",{key:1,id:"v-dd-option-0"+e.uniqueId,class:t.normalizeClass("v-dd-option parent-option"+(e.selectedIndex===0?" active":"")),onClick:n[4]||(n[4]=s=>e.goToPreviousOptions()),role:"option"},[t.createVNode(d,{icon:"zd-down-pointer",name:"Left arrow",iconDescription:"Click to go back to previous menu",color:"#1f73b7"}),t.createElementVNode("span",z,t.toDisplayString(e.selectedParent.label),1)],10,T)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.currentOptions,(s,r)=>{var f,m,O,I,g;return t.openBlock(),t.createElementBlock("li",{key:s.label+"__"+(s.value??r),id:"v-dd-option-"+(e.selectedParent?r+1:r)+e.uniqueId,class:t.normalizeClass("v-dd-option"+(e.selectedIndex===(e.selectedParent?r+1:r)?" active":"")),onClick:j=>e.selectOption(r),role:"option","aria-selected":e.selectedIndex===(e.selectedParent?r+1:r),disabled:s.disabled||e.maxSelectableCount&&((f=e.selectedOptions)==null?void 0:f.length)>=e.maxSelectableCount&&!((m=s.children)!=null&&m.length)&&!e.isOptionSelected(s)?"disabled":null},[(O=s.children)!=null&&O.length&&e.hasSelectedOptions(s.children)?(t.openBlock(),t.createBlock(d,{key:0,icon:"zd-contains",name:"Contains",color:"#1f73b7"})):t.createCommentVNode("",!0),!((I=s.children)!=null&&I.length)&&e.isOptionSelected(s)?(t.openBlock(),t.createBlock(d,{key:1,icon:"zd-check",name:"Selected",color:"#1f73b7"})):t.createCommentVNode("",!0),t.createElementVNode("span",A,t.toDisplayString(s.label),1),(g=s.children)!=null&&g.length?(t.openBlock(),t.createBlock(d,{key:2,icon:"zd-down-pointer",name:"Right arrow",iconDescription:"Click to open sub-menu options"})):t.createCommentVNode("",!0)],10,L)}),128))],10,q),[[t.vShow,e.menuIsOpen]])],512)}const u=p(M,[["render",H],["__scopeId","data-v-c63dbbfd"]]),R={install(e,n){e.component("VsAutocomplete",u)}};let h=null;return typeof window<"u"?h=window.Vue:typeof global<"u"&&(h=global.Vue),h&&h.use&&h.use(R),u});
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.id="vs-autocomplete",a.appendChild(document.createTextNode(".v-tree-dropdown[data-v-a62f7223]{--primary-color: #1f73b7;--background-color: #1f73b714;--hint-color: #828485;--border: 1px solid #d8dcde;--v-dropdown-width: 300px;--max-width: 10000000px;--box-shadow: rgb(255, 255, 255) 0px 0px 0px 1px, rgb(31, 115, 183) 0px 0px 0px 3px;--bezier-curve: .1s cubic-bezier(0, 0, .95, 1.03);--animation-delay: .2s;position:relative;width:var(--v-dropdown-width);max-width:var(--max-width);outline:none}.v-dd[data-v-a62f7223]{display:flex;flex-direction:column}.v-dd>label[data-v-a62f7223],.v-dd-option>.label[data-v-a62f7223]{font-weight:600;text-align:left}.v-dd>label[data-v-a62f7223],.v-dd>label+.v-dd-label-hint[data-v-a62f7223]{line-height:1.45;text-align:left}.v-tree-dropdown .v-dd>label+.v-dd-label-hint[data-v-a62f7223]{color:var(--hint-color)}.v-dd:hover .v-dd-search[data-v-a62f7223]{border-color:var(--primary-color)}.c-btn__icon[data-v-a62f7223]{width:16px;height:16px;margin-top:-2px;vertical-align:middle}.u-truncate[data-v-a62f7223]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v-dd-search[data-v-a62f7223]{position:relative;display:flex;align-items:center;justify-content:space-between;border:var(--border);padding:.75rem;margin-top:.5rem;border-radius:4px;cursor:pointer;outline:none;z-index:1}.v-dd-search.compact[data-v-a62f7223]{padding:.5rem .75rem;margin-top:.25rem}.v-dd-search[data-v-a62f7223]:active,.v-dd-search[data-v-a62f7223]:focus,.v-dd-search[data-v-a62f7223]:focus-within{border-color:var(--primary-color);box-shadow:var(--box-shadow);transition:border-color var(--animation-delay) ease-in-out,box-shadow var(--animation-delay) ease-in-out}.v-dd-search>svg[data-v-a62f7223]{position:absolute}.v-dd-search>svg[aria-labelledby=zd-search][data-v-a62f7223]{left:1rem}.v-dd-search>svg[aria-labelledby=zd-down-pointer][data-v-a62f7223]{right:1rem}.v-dd-search>svg[aria-labelledby=zd-down-pointer].open[data-v-a62f7223]{transform:rotate(180deg);transition:transform var(--animation-delay) ease-in-out}.v-dd-search>svg[aria-labelledby=zd-down-pointer].close[data-v-a62f7223]{transform:rotate(0);transition:transform var(--animation-delay) ease-in-out}.v-dd-search>input[data-v-a62f7223],.v-dd-search>div[data-v-a62f7223]{font-size:1em;height:1.25rem;line-height:1.25rem;flex-grow:1;padding:0 2rem}.v-dd-input[data-v-a62f7223]{border:none;outline:none}.v-dd-input.hide[data-v-a62f7223]{position:absolute;width:0px;height:1px;padding:0}.v-dd+ul[data-v-a62f7223]{position:absolute;display:flex;flex-direction:column;top:calc(100% + 5px);left:0;width:100%;max-height:500px;border:var(--border);border-radius:4px;background-color:#fff;z-index:1;padding:.25rem 0;margin:0;max-height:350px;overflow-y:auto;box-shadow:#17494d26 0 20px 30px;animation:v-dd-menu-open-a62f7223 var(--bezier-curve) 0s 1 normal;transition:display var(--bezier-curve)}.v-dd-option[data-v-a62f7223]{position:relative;display:flex;align-items:center;justify-content:space-between;cursor:pointer;padding:.5rem 1.25rem}.v-dd+ul.compact>li[data-v-a62f7223]{padding:.5rem 1.25rem}.v-dd+ul>li.parent-option[data-v-a62f7223]{border-bottom:var(--border);padding:.5rem .75rem}.v-dd+ul.compact>li.parent-option[data-v-a62f7223]{padding:.35rem .75rem}li.v-dd-option>svg[aria-labelledby=zd-check][data-v-a62f7223],li.v-dd-option>svg[aria-labelledby=zd-contains][data-v-a62f7223]{position:absolute}.v-dd-option>span[data-v-a62f7223]{padding:0 2rem;flex-grow:1;text-align:left}.v-dd-option.no-data[data-v-a62f7223],.v-dd-option[disabled=disabled][data-v-a62f7223]{-webkit-user-select:none;user-select:none;pointer-events:none;opacity:.7;cursor:not-allowed}.v-dd-option>svg[aria-labelledby=zd-down-pointer][data-v-a62f7223]{position:absolute;right:1rem;transform:rotate(-90deg)}.v-dd-option[data-v-a62f7223]:hover,.v-dd-option[data-v-a62f7223]:focus,.v-dd-option.active[data-v-a62f7223]{background-color:var(--background-color)}.v-dd-option.parent-option>svg[data-v-a62f7223]{left:.75rem;transform:rotate(90deg)}@keyframes v-dd-menu-open-a62f7223{0%{transform:translateY(2px)}to{transform:translateY(0)}}")),document.head.appendChild(a)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
(function(p,f){typeof exports=="object"&&typeof module<"u"?module.exports=f():typeof define=="function"&&define.amd?define(f):(p=typeof globalThis<"u"?globalThis:p||self,p.VsAutocomplete=f())})(this,function(){"use strict";function p(s,e,t,i,n,l,d,a){var r=typeof s=="function"?s.options:s;e&&(r.render=e,r.staticRenderFns=t,r._compiled=!0),i&&(r.functional=!0),l&&(r._scopeId="data-v-"+l);var o;if(d?(o=function(c){c=c||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!c&&typeof __VUE_SSR_CONTEXT__<"u"&&(c=__VUE_SSR_CONTEXT__),n&&n.call(this,c),c&&c._registeredComponents&&c._registeredComponents.add(d)},r._ssrRegister=o):n&&(o=a?function(){n.call(this,(r.functional?this.parent:this).$root.$options.shadowRoot)}:n),o)if(r.functional){r._injectStyles=o;var u=r.render;r.render=function(k,m){return o.call(m),u(k,m)}}else{var _=r.beforeCreate;r.beforeCreate=_?[].concat(_,o):[o]}return{exports:s,options:r}}const v={props:{icon:{type:String,default:""},color:{type:String},role:{type:String,default:"presentation"},iconDescription:{type:String,default:""},name:{type:String,default:""}},data(){return{paths:{"zd-search":'<circle cx="6" cy="6" r="5.5" fill="none" stroke="currentColor"></circle><path stroke="currentColor" stroke-linecap="round" d="M15 15l-5-5"></path>',"zd-down-pointer":'<path fill="currentColor" d="M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"></path>',"zd-check":'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M1 9l4 4L15 3"></path>',"zd-contains":'<path fill="none" stroke="currentColor" stroke-linecap="round" d="M.5 8.5h15"></path>'}}}};var I=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("svg",{staticClass:"c-btn__icon",attrs:{xmlns:"http://www.w3.org/2000/svg",color:e.color,role:e.role,"aria-labelledby":e.icon,focusable:"false","aria-hidden":"true"}},[t("title",{attrs:{id:e.name||e.icon}},[e._v(e._s(e.name||e.icon)+" Icon")]),t("desc",[e._v(e._s(e.iconDescription||e.name))]),t("svg",{attrs:{width:"16",height:"16",viewBox:"0 0 16 16"},domProps:{innerHTML:e._s(e.paths[e.icon])}})])},g=[],b=p(v,I,g,!1,null,null,null,null);const w=b.exports,M="",x={components:{SvgIcon:w},props:{label:{type:String,required:!1},options:{type:Array,default:[],required:!0},multiple:{type:Boolean,default:!1,required:!1},searchInputText:{type:String,default:"",required:!1},searchOptionMatcher:{type:Function,default:()=>{},required:!1},keepMenuOpenOnRender:{type:Boolean,default:!1,required:!1},maxSelectableCount:{type:Number,default:0,required:!1},compact:{type:Boolean,default:!1,required:!1},noSearchResultsText:{type:String,default:"No options found",required:!1},labelHint:{type:String,default:"",required:!1}},emits:["input","update:modelValue","open","close"],data(){return{ddOptions:[],searchInput:this.searchInputText,menuIsOpen:!1,selectedParent:null,selectedOptions:[],currentOptions:[],filteredOptions:[],selectedIndex:-1,selectedIndices:[],currentIndex:-1,uniqueId:Math.random().toString(36).substring(2,8)}},watch:{menuIsOpen(){this.menuIsOpen?(document.addEventListener("click",this.closeDropdownMenuOnBlur),this.$emit("open",this.$refs.dropdown,this.$refs.menu)):(document.removeEventListener("click",this.closeDropdownMenuOnBlur),this.$emit("close",this.$refs.dropdown,this.$refs.menu))},searchInput(){this.handleSearchInputChange()},selectedOptions:{handler(s,e){const t=e.map(n=>n.__identifier),i=s.map(n=>n.__identifier);if(s.length!==e.length||!i.every(n=>t.includes(n)))try{this.$emit("input",this.selectedOptions.map(({__identifier:n,__selected:l,...d})=>d))}catch(n){console.log("Unknown Event ",n)}},deep:!0},options:{handler(){this.constructCompData()},deep:!0},searchInputText(){this.searchInput=this.searchInputText,this.keepMenuOpen()}},created(){this.constructCompData(),this.keepMenuOpenOnRender&&this.keepMenuOpen()},methods:{constructCompData(){try{const s=JSON.parse(JSON.stringify(this.options)),{formattedOptions:e,selectedOptions:t}=this.parseInputOptions(s);if(this.ddOptions=e,this.selectedOptions=t,this.searchInput){const i=this.filterMatchingOptions(this.searchInput,this.ddOptions);this.currentOptions=i,this.filteredOptions=i}else this.currentOptions=e,this.filteredOptions=e}catch{console.error("[vs-autocomplete]: Options must be a valid JSON Array")}},handleSearchInputChange(){this.searchInput?this.currentOptions=this.filterMatchingOptions(this.searchInput,this.ddOptions):this.currentOptions=this.ddOptions,this.filteredOptions=this.currentOptions,this.selectedParent=null},focusSearchInput(){var s;(s=this.$refs.searchInput)==null||s.focus()},toggleDropdownMenu(s){s.stopPropagation(),this.menuIsOpen=!this.menuIsOpen,this.focusSearchInput()},closeDropdownMenu(){var s;this.menuIsOpen=!1,(s=this.searchInput)!=null&&s.trim().length||(this.searchInput="",this.selectedParent=null,this.filteredOptions=this.ddOptions,this.currentOptions=this.ddOptions,this.selectedIndex=-1)},keepMenuOpen(s){s==null||s.stopPropagation(),this.menuIsOpen||(this.menuIsOpen=!0),this.focusSearchInput()},closeDropdownMenuOnBlur(s){var e;(e=s.path||s.composedPath())!=null&&e.includes(this.$refs.dropdown)||this.closeDropdownMenu()},parseInputOptions(s=[],e=[],t=[]){return s.forEach(i=>{var l;const n=[...e,i.label];typeof i.value<"u"&&n.push(i.value),i.__identifier=n.join("__"),(l=i.children)!=null&&l.length?this.parseInputOptions(i.children,n,t):i.selected&&t.push(i)}),{formattedOptions:s,selectedOptions:t}},isOptionSelected(s){return this.selectedOptions.findIndex(e=>e.__identifier===s.__identifier)>-1},hasSelectedOptions(s){return s.some(e=>{var t;return(t=e.children)!=null&&t.length?this.hasSelectedOptions(e.children):this.isOptionSelected(e)})},goToPreviousOptions(s=null,e=this.filteredOptions){var t;for(const i of e)if((t=i.children)!=null&&t.length){if(i.__identifier===this.selectedParent.__identifier&&i.children.length===this.currentOptions.length){this.currentOptions=e,this.selectedParent=s;return}this.goToPreviousOptions(i,i.children)}},filterMatchingOptions(s,e){var i;let t=[];for(const n of e){const{__identifier:l,__selected:d,...a}=n,r=this.searchOptionMatcher(s,a);if(typeof r=="boolean"?r:n.label.toLowerCase().includes(s.toLowerCase()))t.push(n);else if((i=n.children)!=null&&i.length){const o=this.filterMatchingOptions(s,n.children);o.length&&t.push({...n,children:o})}}return t},selectOption(s){var t;const e=this.currentOptions[s];if((t=e.children)!=null&&t.length)this.selectedParent=e,this.currentOptions=e.children;else if(e.__selected||this.isOptionSelected(e,this.selectedParent)){if(this.multiple){const i=this.selectedOptions.findIndex(n=>n.__identifier===e.__identifier);i>-1&&(this.selectedOptions=[...this.selectedOptions.slice(0,i),...this.selectedOptions.slice(i+1)])}else this.selectedOptions=[];this.currentOptions[s].__selected=!1}else{if(this.multiple)this.selectedOptions=[...this.selectedOptions,e];else{const i=this.currentOptions.findIndex(n=>n.__selected===!0);i>-1&&(this.currentOptions[i].__selected=!1),this.selectedOptions=[e],this.closeDropdownMenu()}this.currentOptions[s].__selected=!0}},handleKeyDown(s){var t,i,n,l,d,a,r;const{key:e}=s;if(e==="Escape")this.closeDropdownMenu();else if(e==="Enter"||e.length===1){if(this.menuIsOpen||this.keepMenuOpen(s),e==="Enter"){if(this.maxSelectableCount&&((t=this.selectedOptions)==null?void 0:t.length)>=this.maxSelectableCount)return;if(this.selectedParent&&this.selectedIndex===0)this.goToPreviousOptions(),this.selectedIndex=0;else if(this.selectedIndex!==-1){const o=this.selectedParent?this.selectedIndex-1:this.selectedIndex;if(!((i=this.currentOptions[o])!=null&&i.disabled)){const u=(n=this.selectedParent)==null?void 0:n.label;this.selectOption(o),u!==((l=this.selectedParent)==null?void 0:l.label)&&(this.selectedParent?this.selectedIndex=1:this.selectedIndex=0)}}}}else if(e==="ArrowUp")if(this.selectedIndex===0){const o=this.currentOptions.length;this.selectedIndex=this.selectedParent?o:o-1}else this.selectedIndex--;else if(e==="ArrowRight"){const o=this.selectedParent?this.selectedIndex-1:this.selectedIndex;!((d=this.currentOptions[o])!=null&&d.disabled)&&((r=(a=this.currentOptions[o])==null?void 0:a.children)!=null&&r.length)&&(this.selectOption(o),this.selectedParent&&(this.selectedIndex=1))}else if(e==="ArrowDown"){const o=this.currentOptions.length;this.selectedIndex===(this.selectedParent?o:o-1)?this.selectedIndex=0:this.selectedIndex++}else e==="ArrowLeft"&&this.selectedParent&&(this.goToPreviousOptions(),this.selectedIndex=0)}}};var y=function(){var i;var e=this,t=e._self._c;return t("div",{ref:"dropdown",staticClass:"v-tree-dropdown"},[t("div",{staticClass:"v-dd"},[t("label",{attrs:{for:"v-dd-search__input"+e.uniqueId,id:"v-dd-label"+e.uniqueId}},[e._v(" "+e._s(e.label)+" ")]),e.labelHint?t("div",{staticClass:"v-dd-label-hint",attrs:{"aria-labelledby":"v-dd-label"+e.uniqueId}},[e._v(" "+e._s(e.labelHint)+" ")]):e._e(),t("div",{class:"v-dd-search"+(e.menuIsOpen?" active":"")+(e.compact?" compact":""),attrs:{"aria-haspopup":"listbox","aria-expanded":""+e.menuIsOpen,"aria-owns":"v-dd-options-menu"+e.uniqueId,"aria-labelledby":"v-dd-label"+e.uniqueId},on:{click:e.toggleDropdownMenu}},[t("svg-icon",{attrs:{icon:"zd-search",name:"Search"}}),t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchInput,expression:"searchInput"}],ref:"searchInput",class:"c-txt v-dd-input"+(e.menuIsOpen?"":" hide"),attrs:{type:"text",autocomplete:"off",id:"v-dd-search__input"+e.uniqueId,role:"combobox","aria-labelledby":"v-dd-label"+e.uniqueId,"aria-autocomplete":"list","aria-controls":e.menuIsOpen?"v-dd-options-menu"+e.uniqueId:!1,"aria-activedescendant":e.menuIsOpen?"v-dd-option-"+e.selectedIndex:!1},domProps:{value:e.searchInput},on:{click:e.keepMenuOpen,keydown:e.handleKeyDown,input:function(n){n.target.composing||(e.searchInput=n.target.value)}}}),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.menuIsOpen,expression:"!menuIsOpen"}],staticClass:"c-txt u-truncate",domProps:{innerHTML:e._s(e.selectedOptions.map(n=>n.label).join(", "))}}),t("svg-icon",{class:e.menuIsOpen?"open":"close",attrs:{icon:"zd-down-pointer",name:e.menuIsOpen?"Up arrow":"Down arrow"}})],1)]),t("ul",{directives:[{name:"show",rawName:"v-show",value:e.menuIsOpen,expression:"menuIsOpen"}],ref:"menu",class:e.compact?"compact":"",attrs:{id:"v-dd-options-menu"+e.uniqueId,role:"listbox","aria-labelledby":"v-dd-label"+e.uniqueId,"aria-multiselectable":!!e.multiple}},[(i=e.currentOptions)!=null&&i.length?e._e():t("li",{staticClass:"v-dd-option no-data",attrs:{role:"option"}},[t("span",[e._v(e._s(e.noSearchResultsText))])]),e.selectedParent?t("li",{class:"v-dd-option parent-option"+(e.selectedIndex===0?" active":""),attrs:{id:"v-dd-option-0"+e.uniqueId,role:"option"},on:{click:function(n){return e.goToPreviousOptions()}}},[t("svg-icon",{attrs:{icon:"zd-down-pointer",name:"Left arrow",iconDescription:"Click to go back to previous menu",color:"#1f73b7"}}),t("span",{staticClass:"u-truncate label"},[e._v(e._s(e.selectedParent.label))])],1):e._e(),e._l(e.currentOptions,function(n,l){var d,a,r,o,u;return t("li",{key:n.label+"__"+(n.value??l),class:"v-dd-option"+(e.selectedIndex===(e.selectedParent?l+1:l)?" active":""),attrs:{id:"v-dd-option-"+(e.selectedParent?l+1:l)+e.uniqueId,role:"option","aria-selected":e.selectedIndex===(e.selectedParent?l+1:l),disabled:n.disabled||e.maxSelectableCount&&((d=e.selectedOptions)==null?void 0:d.length)>=e.maxSelectableCount&&!((a=n.children)!=null&&a.length)&&!e.isOptionSelected(n)?"disabled":null},on:{click:function(_){return e.selectOption(l)}}},[(r=n.children)!=null&&r.length&&e.hasSelectedOptions(n.children)?t("svg-icon",{attrs:{icon:"zd-contains",name:"Contains",color:"#1f73b7"}}):e._e(),!((o=n.children)!=null&&o.length)&&e.isOptionSelected(n)?t("svg-icon",{attrs:{icon:"zd-check",name:"Selected",color:"#1f73b7"}}):e._e(),t("span",{staticClass:"u-truncate"},[e._v(e._s(n.label))]),(u=n.children)!=null&&u.length?t("svg-icon",{attrs:{icon:"zd-down-pointer",name:"Right arrow",iconDescription:"Click to open sub-menu options"}}):e._e()],1)})],2)])},S=[],C=p(x,y,S,!1,null,"a62f7223",null,null);const O=C.exports,P={install(s,e){s.component("VsAutocomplete",O)}};let h=null;return typeof window<"u"?h=window.Vue:typeof global<"u"&&(h=global.Vue),h&&h.use&&h.use(P),O});
{
"name": "vs-autocomplete",
"private": false,
"version": "1.6.17",
"version": "1.6.18",
"type": "module",

@@ -24,7 +24,7 @@ "files": [

"vite-plugin-css-injected-by-js": "^3.0.1",
"vue": "^3.4.19"
"vue": "^2.6.12"
},
"devDependencies": {
"vite": "^5.1.3",
"@vitejs/plugin-vue": "^5.0.4"
"vite": "^4.1.3",
"@vitejs/plugin-vue2": "^2.3.1"
},

@@ -31,0 +31,0 @@ "keywords": [

@@ -0,4 +1,6 @@

This branch is for component in Vue 2. For Vue 3, please use the [main branch](https://github.com/sureshUngarala/vue-components/tree/main/vs-autocomplete).
## Vs Autocomplete Dropdown
Nested-Autocomplete-Multiselect-Dropdown for Vue 3, refer GitHub branch [v2](https://github.com/sureshungarala/vue-components/tree/v2/vs-autocomplete) for usage and installation in Vue 2
Nested-Autocomplete-Multiselect-Dropdown for Vue 3, refer GitHub branch [v2](https://github.com/sureshungarala/vue-components/tree/v2/vs-autocomplete) for Vue 2
<img src="https://img.shields.io/npm/dt/vs-autocomplete" /> <img src="https://img.shields.io/jsdelivr/npm/hy/vs-autocomplete" />

@@ -10,6 +12,4 @@

#### :film_projector: [Demo](https://codesandbox.io/s/vs-autocomplete-vue3-4v1bkr) for Vue3.
#### :film_projector: [Demo](https://codesandbox.io/s/vs-autocomplete-vue2-9zfyf1)
#### :film_projector: [Demo](https://codesandbox.io/s/vs-autocomplete-vue2-9zfyf1) for Vue2.
#### :rocket: Usage

@@ -40,3 +40,3 @@

```bash
npm install vs-autocomplete@latest
npm install vs-autocomplete@1.6.18
```

@@ -47,3 +47,3 @@

```bash
yarn add vs-autocomplete@latest
yarn add vs-autocomplete@1.6.18
```

@@ -54,8 +54,8 @@

```html
<script src="https://cdn.jsdelivr.net/npm/vs-autocomplete@latest/dist/vs-autocomplete.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vs-autocomplete@1.6.18/dist/vs-autocomplete.umd.min.js"></script>
OR
<script src="https://unpkg.com/vs-autocomplete@latest/dist/vs-autocomplete.umd.js"></script>
<script src="https://unpkg.com/vs-autocomplete@1.6.18/dist/vs-autocomplete.umd.js"></script>
```
In [Vue 2](https://github.com/sureshungarala/vue-components/tree/v2/vs-autocomplete#npm), UMD component is auto-registered globally.
In Vue 2, UMD component is auto-registered globally.

@@ -62,0 +62,0 @@ In Vue 3, you need to either register the component globally by calling

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc