@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
840 lines (839 loc) • 29.6 kB
JavaScript
import { defineComponent as Vl, useSlots as Tl, toRef as Te, ref as y, computed as L, watchEffect as Sl, watch as A, nextTick as G, onBeforeUpdate as Al, reactive as El, openBlock as p, createElementBlock as $, unref as t, normalizeClass as h, createElementVNode as Se, withKeys as Xe, withModifiers as J, normalizeStyle as Ae, renderSlot as B, createVNode as k, withCtx as v, createCommentVNode as Q, createBlock as R, createTextVNode as q, toDisplayString as z, Fragment as se, renderList as Ze, mergeProps as ne, Transition as Pl, normalizeProps as Ol, guardReactiveProps as _l, createSlots as Fl } from "vue";
import "../icon/index.mjs";
import "../native-scroll/index.mjs";
import "../overflow/index.mjs";
import "../popper/index.mjs";
import "../renderer/index.mjs";
import "../tag/index.mjs";
import "../tooltip/index.mjs";
import "../form/index.mjs";
import "./cascader-panel.vue.mjs";
import { useNameHelper as Il, useProps as Nl, createSizeProp as Kl, createStateProp as zl, createIconProp as Ee, useIcons as Ml, useLocale as Hl, emitEvent as F } from "@vexip-ui/config";
import { placementWhileList as Bl, useClickOutside as Rl, usePopper as ql, useHover as Dl } from "@vexip-ui/hooks";
import { flatTree as Yl, transformTree as jl, getLast as re, isPromise as Ul, isNull as Wl, toAttrValue as el } from "@vexip-ui/utils";
import { cascaderProps as Gl } from "./props.mjs";
import { useFieldStore as Jl } from "../form/helper.mjs";
import D from "../renderer/renderer.mjs";
import X from "../icon/icon.mjs";
import Ql from "../overflow/overflow.mjs";
import ie from "../tag/tag.mjs";
import Xl from "../tooltip/tooltip.mjs";
import Zl from "../native-scroll/native-scroll.mjs";
import ea from "../popper/popper.vue.mjs";
import la from "./cascader-panel.vue2.mjs";
const aa = ["id", "aria-disabled", "aria-expanded", "aria-labelledby"], ta = { key: 1 }, sa = ["aria-label"], Sa = /* @__PURE__ */ Vl({
name: "Cascader",
__name: "cascader",
props: Gl,
emits: ["update:visible", "update:value"],
setup(ll, { expose: al, emit: tl }) {
const Pe = Symbol("ID_KEY"), Oe = Symbol("PARENT_KEY"), _e = {
value: "value",
label: "label",
children: "children",
disabled: "disabled",
hasChild: "hasChild"
}, {
idFor: Fe,
labelId: oe,
state: sl,
disabled: nl,
loading: rl,
size: il,
validateField: ol,
clearField: ul,
getFieldValue: dl,
setFieldValue: cl
} = Jl(() => {
var e;
return (e = O.value) == null ? void 0 : e.focus();
}), fl = ll, i = Il("cascader"), l = Nl("cascader", fl, {
size: Kl(il),
state: zl(sl),
locale: null,
value: {
default: () => dl(),
static: !0
},
visible: {
default: !1,
static: !0
},
options: {
default: () => [],
static: !0
},
placeholder: null,
prefix: Ee(),
prefixColor: "",
suffix: Ee(),
suffixColor: "",
noCascaded: !1,
multiple: !1,
disabled: () => nl.value,
clearable: !1,
placement: {
default: "bottom-start",
validator: (e) => Bl.includes(e)
},
transfer: !1,
staticSuffix: !1,
noSuffix: !1,
transitionName: () => i.ns("drop"),
outsideClose: !0,
keyConfig: () => ({}),
separator: {
default: "/",
validator: (e) => e.length === 1
},
hoverTrigger: !1,
maxTagCount: 0,
briefLabel: !1,
noRestTip: !1,
onAsyncLoad: {
default: null,
isFunc: !0
},
mergeTags: !1,
tagType: null,
emptyText: null,
loading: () => rl.value,
loadingIcon: Ee(),
loadingLock: !1,
loadingEffect: null,
transparent: !1,
popperAlive: null,
slots: () => ({})
}), ue = tl, de = Tl(), Y = Ml(), Z = Hl("select", Te(l, "locale")), x = y(l.visible), b = y([]), w = y([]), P = y([]), ee = y([]), ce = y(!1), pl = Te(l, "placement"), hl = Te(l, "transfer"), E = y(null), Ie = y(null), V = L(() => typeof l.onAsyncLoad == "function"), I = L(() => l.mergeTags && !l.noCascaded), j = L(
() => I.value ? P.value : b.value
), fe = L(
() => I.value ? ee.value : w.value
);
let M = null, c = null, C = null, pe = !1, he = -1, Ne;
const Ke = y(0);
Sl(() => {
l.keyConfig.value, l.keyConfig.label, l.keyConfig.disabled, l.keyConfig.hasChild, l.separator, V.value, Ne = Yl(l.options, {
keyField: Pe,
parentField: Oe,
childField: l.keyConfig.children ?? _e.children,
forceInject: !0
}), Ke.value++;
}), A(Ke, vl, { immediate: !0 });
function vl() {
const e = l.separator, s = V.value;
M = Re(Ne), c = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
for (let n = 0, r = M.length; n < r; ++n) {
const a = M[n];
qe(a, e), c.set(a.id, a), C.set(a.fullValue, a), s && (a.childrenLoaded = ke(a));
}
Ie.value = jl(M), De(E.value);
}
const T = y([]), N = L(() => [
Ie.value,
...T.value.map((e) => {
var s;
return (s = c.get(e)) == null ? void 0 : s.children;
}).filter(Boolean)
]), le = Rl(Ll), ve = y(), { reference: O, transferTo: ze, updatePopper: be } = ql({
placement: pl,
transfer: hl,
wrapper: le,
popper: L(() => {
var e;
return (e = ve.value) == null ? void 0 : e.wrapper;
}),
isDrop: !0
}), { isHover: Me } = Dl(O), K = y([]), ge = y(0), _ = y(!1), He = y(0), bl = L(() => ({
[i.b()]: !0,
[i.ns("input-vars")]: !0,
[i.bs("vars")]: !0,
[i.bm("inherit")]: l.inherit,
[i.bm("multiple")]: l.multiple,
[i.bm("responsive")]: l.multiple && l.maxTagCount <= 0
})), H = L(() => l.loading && l.loadingLock), gl = L(() => {
const e = i.be("selector");
return {
[e]: !0,
[`${e}--focused`]: !l.disabled && x.value,
[`${e}--disabled`]: l.disabled,
[`${e}--readonly`]: H.value,
[`${e}--loading`]: l.loading,
[`${e}--${l.size}`]: l.size !== "default",
[`${e}--${l.state}`]: l.state !== "default",
[`${e}--has-prefix`]: Be.value,
[`${e}--has-suffix`]: !l.noSuffix,
[`${e}--transparent`]: l.transparent
};
}), Be = L(() => !!(de.prefix || l.slots.prefix || l.prefix)), me = L(() => !!j.value[0]), ml = L(() => l.hoverTrigger && !V.value), ye = L(() => !l.disabled && !H.value && l.clearable && Me.value && me.value);
A(
() => l.visible,
(e) => {
x.value = e;
}
), A(x, async (e) => {
var s;
e ? (_.value = !1, He.value = ((s = le.value) == null ? void 0 : s.offsetWidth) || 0, await be(), G(() => {
var n, r;
(r = (n = re(K.value)) == null ? void 0 : n.$el) == null || r.focus();
})) : (ce.value = !1, O.value && !pe && O.value.focus()), pe = !1;
});
let ae = !1;
A(E, () => {
ae = !0;
}), A(
() => l.value,
(e) => {
(e !== E.value || ae) && (E.value = e, De(e), G(() => {
ae = !1;
}));
},
{ immediate: !0 }
), A(
() => l.briefLabel,
(e) => {
w.value = b.value.map((s) => {
var n;
return (n = C.get(s)) == null ? void 0 : n[e ? "label" : "fullLabel"];
}).filter(Boolean);
}
), A(V, (e) => {
if (e)
for (const s of c.values())
s.childrenLoaded = ke(s);
}), A(I, (e) => {
if (e && (P.value.length = 0, ee.value.length = 0, Ce()), V.value) {
const s = [];
for (const n of c.values())
n.checked && s.push(n), n.hasChild && !n.children.length && !n.loaded && (n.checked = !1);
for (let n = 0, r = s.length; n < r; ++n) {
const a = s[n];
Le(a), $e(a);
}
}
je();
}), A(
() => N.value.length,
() => {
be(), G(() => {
var e, s;
(s = (e = re(K.value)) == null ? void 0 : e.$el) == null || s.focus(), he = -1;
});
}
), A(
() => l.disabled,
(e) => {
e && U(!1);
}
), A(H, (e) => {
e && U(!1);
}), Al(() => {
K.value.length = 0;
}), al({
idFor: Fe,
labelId: oe,
currentVisible: x,
currentValues: b,
currentLabels: w,
isHover: Me,
openedIds: T,
restTagCount: ge,
restTipShow: _,
optionsList: N,
hasValue: me,
templateValues: j,
templateLabels: fe,
showClear: ye,
wrapper: le,
reference: O,
popper: ve,
panelElList: K,
handlePanelOpen: te,
handleOptionSelect: Ye,
handleOptionCheck: xe,
toggleVisible: W,
handleClear: We,
handlePanelBack: Je,
focus: (e) => {
var s;
return (s = O.value) == null ? void 0 : s.focus(e);
},
blur: () => {
var e;
return (e = O.value) == null ? void 0 : e.blur();
}
});
function Re(e) {
const {
value: s,
label: n,
disabled: r,
hasChild: a
} = { ..._e, ...l.keyConfig };
return e.map((o) => {
const {
[Pe]: d,
[Oe]: u,
[s]: g,
[n]: m,
[r]: f,
[a]: S
} = o;
return El({
id: d,
parent: u,
value: g,
disabled: f,
hasChild: S,
label: m || String(g),
fullValue: "",
fullLabel: "",
children: [],
checked: !1,
partial: !1,
loading: !1,
loaded: !1,
error: !1,
childrenLoaded: !1,
data: o
});
});
}
function qe(e, s) {
let n = e.value, r = e.label, a = c.get(e.parent);
for (; a; )
n = `${a.value}${s}${n}`, r = `${a.label}${s}${r}`, a = c.get(a.parent);
e.fullValue = n, e.fullLabel = r;
}
function ke(e) {
var n, r;
if (e.hasChild && !((n = e.children) != null && n.length))
return e.loaded;
const s = [...e.children];
for (; s.length; ) {
const a = s.shift();
if (!a.childrenLoaded) {
if (a.hasChild && !((r = a.children) != null && r.length) && (a.childrenLoaded = a.loaded, !a.loaded))
return !1;
s.push(...a.children);
}
}
return !0;
}
function Ce() {
const e = V.value ? b.value.concat(P.value) : b.value, s = new Set(e), n = [...e];
for (; n.length; ) {
const a = n.shift(), o = C.get(a);
if (o) {
const d = c.get(o.parent);
d != null && d.checked && (s.delete(a), s.add(d.fullValue), n.push(d.fullValue));
}
}
const r = l.briefLabel;
P.value = Array.from(s).filter((a) => C.has(a)), ee.value = P.value.map((a) => {
const o = C.get(a);
return r ? o.label : o.fullLabel;
}).filter(Boolean);
}
function yl(e) {
return !!e.length && !Array.isArray(e[0]);
}
function kl(e) {
return !!e.length && Array.isArray(e[0]);
}
function De(e) {
const s = () => {
I.value && (V.value && (P.value = Array.from(c.values()).filter((a) => a.checked).map((a) => a.fullValue)), Ce());
};
for (const a of M)
a.checked = !1, a.partial = !1;
if (!(e != null && e.length)) {
b.value = [], w.value = [], s();
return;
}
const n = l.briefLabel;
if (l.multiple) {
const a = yl(e) ? [e] : e, o = new Set(a.map((m) => m.join(l.separator))), d = [], u = [], g = [];
if (o.forEach((m) => {
const f = C.get(m);
f && (f.checked = !0, f.partial = !1, d.push(m), u.push(n ? f.label : f.fullLabel), g.push(f));
}), !l.noCascaded) {
const m = g.concat(
Array.from(c.values()).filter((f) => f.disabled && f.checked)
);
for (let f = 0, S = m.length; f < S; ++f) {
const Qe = m[f];
Le(Qe), $e(Qe);
}
}
b.value = d, w.value = u;
} else {
const o = (kl(e) ? e[0] : e).join(l.separator), d = C.get(o);
d ? (b.value = [o], w.value = [n ? d.label : d.fullLabel], l.noCascaded && (d.checked = !0, d.partial = !1)) : (b.value = [], w.value = []);
}
if (s(), T.value.length) return;
const r = b.value[0];
if (r) {
const a = C.get(r), o = [a.id];
let d = c.get(a.parent);
for (; d; )
o.push(d.id), d = c.get(d.parent);
T.value = o.reverse().slice(0, -1);
}
}
function U(e) {
x.value !== e && (x.value = e, ue("update:visible", e), F(l.onToggle, e));
}
async function te(e, s) {
var n, r;
if (!(!e.hasChild && !((n = e.children) != null && n.length))) {
if (V.value && !((r = e.children) != null && r.length) && !e.loaded) {
e.loading = !0;
let a;
try {
a = l.onAsyncLoad(e.data), a = Ul(a) ? await a : a;
} catch {
e.error = !0, e.loading = !1;
return;
}
const o = a;
if (!Array.isArray(o) || !o.length)
e.hasChild = !1;
else {
const u = Re(o), g = e.id, m = l.separator;
e.children.push(...u);
let f = Math.max(...Array.from(c.keys()).map(Number)) + 1;
u.forEach((S) => {
S.id = f++, S.parent = g, qe(S, m), c.set(S.id, S), C.set(S.fullValue, S);
}), M.push(...u);
}
e.loaded = !0, e.loading = !1, Cl(e).forEach((u) => {
u.childrenLoaded = ke(u);
});
}
s < T.value.length && (T.value = T.value.slice(0, s)), T.value.push(e.id), requestAnimationFrame(() => {
var a, o;
(o = (a = re(K.value)) == null ? void 0 : a.$el) == null || o.focus();
});
}
}
function Ye(e, s) {
var n;
e && (e.hasChild || (n = e.children) != null && n.length ? te(e, s) : we(e.fullValue));
}
function Cl(e) {
const s = [e];
let n = c.get(e.parent);
for (; n; )
s.push(n), n = c.get(n.parent);
return s;
}
function Le(e) {
let s = e;
for (; !Wl(s.parent); ) {
const n = c.get(s.parent);
if (!n || s.checked === n.checked && s.partial === n.partial)
break;
s.checked ? (n.checked = n.children.every((r) => r.disabled || r.checked), n.partial = !n.checked) : (n.checked = !1, n.partial = n.children.some((r) => r.checked || r.partial)), s = n;
}
}
function $e(e) {
var o;
const s = e.checked, n = e.partial, r = [...e.children];
let a;
for (; r.length; )
a = r.shift(), !a.disabled && (a.checked = s, a.partial = n, (o = a.children) != null && o.length && r.push(...a.children));
}
function xe(e) {
if (!e) return;
const s = Array.from(c.values()), n = !e.checked;
if (!l.multiple) {
for (let r = 0, a = s.length; r < a; ++r)
s[r].checked = !1;
return e.checked = n, e.partial = !1, we(e.fullValue);
}
if (e.checked = n, e.partial = !1, !l.noCascaded) {
const r = [e].concat(
s.filter((a) => a.disabled && a.checked)
);
for (let a = 0, o = r.length; a < o; ++a) {
const d = r[a];
Le(d), $e(d);
}
}
F(l[n ? "onSelect" : "onCancel"], e.fullValue, e.data), je();
}
function je() {
const e = Array.from(c.values()), s = l.noCascaded ? e.filter((u) => u.checked) : e.filter((u) => {
var g;
return u.checked && !(u.hasChild || (g = u.children) != null && g.length);
}), n = [], r = [], a = [], o = [], d = l.briefLabel;
s.forEach((u) => {
n.push(u.fullValue), r.push(d ? u.label : u.fullLabel);
const { value: g, data: m } = Ve(u.fullValue);
a.push(g), o.push(m);
}), b.value = n, w.value = r, I.value && (V.value && (P.value = e.filter((u) => u.checked).map((u) => u.fullValue)), Ce()), I.value && V.value && (a.length = 0, o.length = 0, P.value.forEach((u) => {
const g = C.get(u);
if (g) {
const { value: m, data: f } = Ve(g.fullValue);
a.push(m), o.push(f);
}
})), Ue(a, o), G(be);
}
function we(e) {
const s = C.get(e);
if (!s) return;
F(l.onSelect, e, s.data), e ? (b.value[0] = e, w.value[0] = l.briefLabel ? s.label : s.fullLabel) : (b.value.length = 0, w.value.length = 0);
const { value: n, data: r } = Ve(e);
Ue(n, r), U(!1);
}
function Ue(e, s) {
E.value = e, G(() => {
ae = !1, ue("update:value", e), cl(e), F(l.onChange, e, s), ol();
});
}
function Ve(e) {
let s = C.get(e);
if (!s) return { value: [], data: [] };
const n = [s.value], r = [s.data];
for (; s.parent; ) {
const a = c.get(s.parent);
if (!a) break;
n.push(a.value), r.push(a.data), s = a;
}
return {
value: n.reverse(),
data: r.reverse()
};
}
function W(e = !x.value) {
l.disabled || H.value || U(e);
}
function Ll() {
_.value = !1, F(l.onClickOutside), l.outsideClose && x.value && (U(!1), pe = !0, F(l.onOutsideClose));
}
function We() {
if (!(l.disabled || H.value) && l.clearable) {
const e = E.value;
b.value.length = 0, w.value.length = 0, P.value.length = 0, ee.value.length = 0, T.value.length = 0, E.value = (e == null ? void 0 : e.length) === 0 ? e : [], _.value = !1;
for (const s of c.values())
s.checked = !1, s.partial = !1;
(e == null ? void 0 : e.length) !== 0 && (ue("update:value", E.value), F(l.onChange, E.value, [])), F(l.onClear), ul(E.value);
}
}
function $l() {
x.value ? _.value = !1 : _.value = !_.value;
}
function Ge(e) {
l.disabled || H.value || (l.multiple ? xe(C.get(e)) : we(e));
}
function xl(e, s) {
te(e, s), requestAnimationFrame(() => {
const n = re(K.value);
n && n.currentHitting < 0 && (n.currentHitting = n.options.findIndex((r) => r.id === he), n.currentHitting < 0 && (n.currentHitting = 0));
});
}
function Je() {
he = T.value.pop();
}
function wl() {
requestAnimationFrame(() => {
ce.value = !0;
});
}
return (e, s) => (p(), $("div", {
id: t(Fe),
ref_key: "wrapper",
ref: le,
class: h(bl.value),
role: "group",
"aria-disabled": t(el)(t(l).disabled),
"aria-expanded": t(el)(x.value),
"aria-haspopup": "dialog",
"aria-labelledby": t(oe),
onClick: s[7] || (s[7] = (n) => W())
}, [
Se("div", {
ref_key: "reference",
ref: O,
class: h(gl.value),
tabindex: "0",
onKeydown: [
s[2] || (s[2] = Xe(J((n) => W(), ["prevent"]), ["space"])),
s[3] || (s[3] = Xe((n) => W(!1), ["tab"]))
]
}, [
Be.value ? (p(), $("div", {
key: 0,
class: h([t(i).be("icon"), t(i).be("prefix")]),
style: Ae({ color: t(l).prefixColor })
}, [
B(e.$slots, "prefix", {}, () => [
k(t(D), {
renderer: t(l).slots.prefix
}, {
default: v(() => [
k(t(X), {
icon: t(l).prefix
}, null, 8, ["icon"])
]),
_: 1
}, 8, ["renderer"])
])
], 6)) : Q("", !0),
Se("div", {
class: h(t(i).be("control"))
}, [
B(e.$slots, "control", {}, () => [
k(t(D), {
renderer: t(l).slots.control
}, {
default: v(() => [
t(l).multiple ? (p(), R(t(Ql), {
key: 0,
inherit: "",
class: h([t(i).be("tags")]),
items: j.value,
"max-count": t(l).maxTagCount,
onRestChange: s[1] || (s[1] = (n) => ge.value = n)
}, {
default: v(({ item: n, index: r }) => [
k(t(ie), {
inherit: "",
class: h(t(i).be("tag")),
type: t(l).tagType,
closable: "",
disabled: t(l).disabled,
onClick: s[0] || (s[0] = J((a) => W(), ["stop"])),
onClose: (a) => Ge(n)
}, {
default: v(() => [
q(z(fe.value[r]), 1)
]),
_: 2
}, 1032, ["class", "type", "disabled", "onClose"])
]),
counter: v(({ count: n }) => [
t(l).noRestTip ? (p(), R(t(ie), {
key: 0,
inherit: "",
class: h([t(i).be("tag"), t(i).be("counter")]),
type: t(l).tagType,
disabled: t(l).disabled
}, {
default: v(() => [
q(z(`+${n}`), 1)
]),
_: 2
}, 1032, ["class", "type", "disabled"])) : (p(), $("span", ta, [
k(t(Xl), {
inherit: "",
transfer: !1,
visible: _.value,
trigger: "custom",
placement: "top-end",
"tip-class": t(i).be("rest-tip"),
onClick: J($l, ["stop"])
}, {
trigger: v(() => [
k(t(ie), {
inherit: "",
class: h([t(i).be("tag"), t(i).be("counter")]),
type: t(l).tagType,
disabled: t(l).disabled
}, {
default: v(() => [
q(z(`+${n}`), 1)
]),
_: 2
}, 1032, ["class", "type", "disabled"])
]),
default: v(() => [
k(t(Zl), {
inherit: "",
"use-y-bar": ""
}, {
default: v(() => [
(p(!0), $(se, null, Ze(j.value, (r, a) => (p(), $(se, { key: a }, [
a >= j.value.length - ge.value ? (p(), R(t(ie), {
key: 0,
inherit: "",
class: h(t(i).be("tag")),
closable: "",
type: t(l).tagType,
disabled: t(l).disabled,
onClose: (o) => Ge(r)
}, {
default: v(() => [
q(z(fe.value[a]), 1)
]),
_: 2
}, 1032, ["class", "type", "disabled", "onClose"])) : Q("", !0)
], 64))), 128))
]),
_: 1
})
]),
_: 2
}, 1032, ["visible", "tip-class"])
]))
]),
_: 1
}, 8, ["class", "items", "max-count"])) : (p(), $(se, { key: 1 }, [
q(z(w.value[0]), 1)
], 64)),
(t(l).placeholder ?? t(Z).placeholder) && !me.value ? (p(), $("span", {
key: 2,
class: h(t(i).be("placeholder"))
}, z(t(l).placeholder ?? t(Z).placeholder), 3)) : Q("", !0)
]),
_: 1
}, 8, ["renderer"])
])
], 2),
t(l).noSuffix ? t(l).clearable || t(l).loading ? (p(), $("div", {
key: 2,
class: h([t(i).be("icon"), t(i).bem("icon", "placeholder"), t(i).be("suffix")])
}, null, 2)) : Q("", !0) : (p(), $("div", {
key: 1,
class: h([t(i).be("icon"), t(i).be("suffix")]),
style: Ae({
color: t(l).suffixColor,
opacity: ye.value || t(l).loading ? "0%" : ""
})
}, [
B(e.$slots, "suffix", {}, () => [
k(t(D), {
renderer: t(l).slots.suffix
}, {
default: v(() => [
t(l).suffix ? (p(), R(t(X), {
key: 0,
icon: t(l).suffix,
class: h({
[t(i).be("arrow")]: !t(l).staticSuffix
})
}, null, 8, ["icon", "class"])) : (p(), R(t(X), ne({ key: 1 }, t(Y).angleDown, {
class: t(i).be("arrow")
}), null, 16, ["class"]))
]),
_: 1
}, 8, ["renderer"])
])
], 6)),
k(Pl, {
name: t(i).ns("fade"),
appear: ""
}, {
default: v(() => [
ye.value ? (p(), $("button", {
key: 0,
class: h([t(i).be("icon"), t(i).be("clear")]),
type: "button",
tabindex: "-1",
"aria-label": t(Z).ariaLabel.clear,
onClick: J(We, ["stop"])
}, [
k(t(X), Ol(_l(t(Y).clear)), null, 16)
], 10, sa)) : t(l).loading ? (p(), $("div", {
key: 1,
class: h([t(i).be("icon"), t(i).be("loading")])
}, [
k(t(X), ne(t(Y).loading, {
effect: t(l).loadingEffect || t(Y).loading.effect,
icon: t(l).loadingIcon || t(Y).loading.icon
}), null, 16, ["effect", "icon"])
], 2)) : Q("", !0)
]),
_: 1
}, 8, ["name"])
], 34),
k(t(ea), {
ref_key: "popper",
ref: ve,
class: h([t(i).be("popper"), t(i).ns("input-vars"), t(i).bs("vars")]),
visible: x.value,
to: t(ze),
transition: t(l).transitionName,
alive: t(l).popperAlive ?? !t(ze),
onClick: s[6] || (s[6] = J(() => {
}, ["stop"])),
onEnter: wl
}, {
default: v(() => [
Se("div", {
class: h({
[t(i).be("panels")]: !0,
[t(i).bem("panels", "empty")]: !N.value[0] || !N.value[0].length
})
}, [
N.value[0] && N.value[0].length ? (p(!0), $(se, { key: 0 }, Ze(N.value, (n, r) => (p(), R(la, {
key: r,
ref_for: !0,
ref: (a) => a && K.value.push(a),
options: n,
"opened-id": T.value[r],
values: b.value,
ready: ce.value,
multiple: t(l).multiple,
"is-async": V.value,
merged: I.value,
"no-cascaded": t(l).noCascaded,
"labeled-by": t(oe),
onSelect: (a) => Ye(a, r),
onHover: (a) => ml.value && te(a, r),
onCheck: s[4] || (s[4] = (a) => xe(a)),
onOpen: (a) => xl(a, r),
onBack: Je,
onClose: s[5] || (s[5] = (a) => x.value = !1)
}, Fl({ _: 2 }, [
de.default || t(l).slots.default ? {
name: "default",
fn: v((a) => [
B(e.$slots, "default", ne({ ref_for: !0 }, a), () => [
k(t(D), {
renderer: t(l).slots.default,
data: a
}, null, 8, ["renderer", "data"])
])
]),
key: "0"
} : void 0,
de.label || t(l).slots.label ? {
name: "label",
fn: v((a) => [
B(e.$slots, "label", ne({ ref_for: !0 }, a), () => [
k(t(D), {
renderer: t(l).slots.label,
data: a
}, null, 8, ["renderer", "data"])
])
]),
key: "1"
} : void 0
]), 1032, ["options", "opened-id", "values", "ready", "multiple", "is-async", "merged", "no-cascaded", "labeled-by", "onSelect", "onHover", "onOpen"]))), 128)) : (p(), $("div", {
key: 1,
class: h(t(i).be("empty")),
style: Ae({ width: `${He.value}px` })
}, [
B(e.$slots, "empty", {}, () => [
k(t(D), {
renderer: t(l).slots.empty
}, {
default: v(() => [
q(z(t(l).emptyText ?? t(Z).empty), 1)
]),
_: 1
}, 8, ["renderer"])
])
], 6))
], 2)
]),
_: 3
}, 8, ["class", "visible", "to", "transition", "alive"])
], 10, aa));
}
});
export {
Sa as default
};
//# sourceMappingURL=cascader.vue2.mjs.map