epic-designer-gold
Version:
基于vue3的设计器,可视化开发页面表单
1,421 lines • 67.7 kB
JavaScript
import { c as K } from "./_commonjsHelpers-BVfed4GL.js";
import { r as fe } from "./_vue_commonjs-external-NwvjgbHK.js";
import { s as Rt, b as Mt, c as St, g as Pt, a as io, _ as Ce, i as so, h as uo, e as Tt, j as fo, r as Ot } from "./index-gA02bxwJ.js";
import { r as Ne, c as Ie, a as Qe, b as Ke, e as Ae, _ as we, i as ho, p as vo, f as Nt } from "./index-D1ZL6feZ.js";
import { u as bo } from "./utils-BM69FtWE.js";
import { f as mo } from "./fade-in-scale-up.cssr-BXjoIAAA.js";
function go(e, l) {
for (var o = 0; o < l.length; o++) {
const c = l[o];
if (typeof c != "string" && !Array.isArray(c)) {
for (const a in c)
if (a !== "default" && !(a in e)) {
const i = Object.getOwnPropertyDescriptor(c, a);
i && Object.defineProperty(e, a, i.get ? i : {
enumerable: !0,
get: () => c[a]
});
}
}
}
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
}
var $t = {}, jt = {}, Dt = {}, Xe = {}, Ee = {}, Ze = {}, $e = {}, et = {};
Object.defineProperty(et, "__esModule", { value: !0 });
et.default = {
sizeSmall: "14px",
sizeMedium: "16px",
sizeLarge: "18px",
labelPadding: "0 8px",
labelFontWeight: "400"
};
var po = K && K.__importDefault || function(e) {
return e && e.__esModule ? e : { default: e };
};
Object.defineProperty($e, "__esModule", { value: !0 });
$e.self = Ft;
const ko = Ne, yo = Ie, _o = po(et);
function Ft(e) {
const { baseColor: l, inputColorDisabled: o, cardColor: c, modalColor: a, popoverColor: i, textColorDisabled: k, borderColor: p, primaryColor: h, textColor2: y, fontSizeSmall: O, fontSizeMedium: z, fontSizeLarge: V, borderRadiusSmall: U, lineHeight: q } = e;
return Object.assign(Object.assign({}, _o.default), {
labelLineHeight: q,
fontSizeSmall: O,
fontSizeMedium: z,
fontSizeLarge: V,
borderRadius: U,
color: l,
colorChecked: h,
colorDisabled: o,
colorDisabledChecked: o,
colorTableHeader: c,
colorTableHeaderModal: a,
colorTableHeaderPopover: i,
checkMarkColor: l,
checkMarkColorDisabled: k,
checkMarkColorDisabledChecked: k,
border: `1px solid ${p}`,
borderDisabled: `1px solid ${p}`,
borderDisabledChecked: `1px solid ${p}`,
borderChecked: `1px solid ${h}`,
borderFocus: `1px solid ${h}`,
boxShadowFocus: `0 0 0 2px ${(0, ko.changeColor)(h, { alpha: 0.3 })}`,
textColor: y,
textColorDisabled: k
});
}
const xo = {
name: "Checkbox",
common: yo.commonLight,
self: Ft
};
$e.default = xo;
Object.defineProperty(Ze, "__esModule", { value: !0 });
const Co = Ie, wo = $e, Ro = {
name: "Checkbox",
common: Co.commonDark,
self(e) {
const { cardColor: l } = e, o = (0, wo.self)(e);
return o.color = "#0000", o.checkMarkColor = l, o;
}
};
Ze.default = Ro;
var Ve = {}, tt = {};
Object.defineProperty(tt, "__esModule", {
value: !0
});
const kt = Qe;
tt.default = (0, kt.cB)("checkbox", [(0, kt.cM)("rtl", `
direction: rtl;
`)]);
var Mo = K && K.__importDefault || function(e) {
return e && e.__esModule ? e : { default: e };
};
Object.defineProperty(Ve, "__esModule", { value: !0 });
Ve.checkboxRtl = void 0;
const So = Mo(tt);
Ve.checkboxRtl = {
name: "Checkbox",
style: So.default
};
(function(e) {
var l = K && K.__importDefault || function(i) {
return i && i.__esModule ? i : { default: i };
};
Object.defineProperty(e, "__esModule", { value: !0 }), e.checkboxRtl = e.checkboxLight = e.checkboxDark = void 0;
var o = Ze;
Object.defineProperty(e, "checkboxDark", { enumerable: !0, get: function() {
return l(o).default;
} });
var c = $e;
Object.defineProperty(e, "checkboxLight", { enumerable: !0, get: function() {
return l(c).default;
} });
var a = Ve;
Object.defineProperty(e, "checkboxRtl", { enumerable: !0, get: function() {
return a.checkboxRtl;
} });
})(Ee);
var je = {};
Object.defineProperty(je, "__esModule", { value: !0 });
je.self = Bt;
const Po = Rt, To = Mt, Oo = St, No = Ee, $o = Ie, jo = Ke, Do = Pt;
function Bt(e) {
const { borderRadius: l, boxShadow2: o, popoverColor: c, textColor2: a, textColor3: i, primaryColor: k, textColorDisabled: p, dividerColor: h, hoverColor: y, fontSizeMedium: O, heightMedium: z } = e;
return {
menuBorderRadius: l,
menuColor: c,
menuBoxShadow: o,
menuDividerColor: h,
menuHeight: "calc(var(--n-option-height) * 6.6)",
optionArrowColor: i,
optionHeight: z,
optionFontSize: O,
optionColorHover: y,
optionTextColor: a,
optionTextColorActive: k,
optionTextColorDisabled: p,
optionCheckMarkColor: k,
loadingColor: k,
columnWidth: "180px"
};
}
const Fo = (0, jo.createTheme)({
name: "Cascader",
common: $o.commonLight,
peers: {
InternalSelectMenu: To.internalSelectMenuLight,
InternalSelection: Po.internalSelectionLight,
Scrollbar: Oo.scrollbarLight,
Checkbox: No.checkboxLight,
Empty: Do.emptyLight
},
self: Bt
});
je.default = Fo;
Object.defineProperty(Xe, "__esModule", { value: !0 });
const Bo = Rt, zo = Mt, Lo = St, Io = Ee, Ko = Ie, Ao = Pt, Eo = je, Vo = {
name: "Cascader",
common: Ko.commonDark,
peers: {
InternalSelectMenu: zo.internalSelectMenuDark,
InternalSelection: Bo.internalSelectionDark,
Scrollbar: Lo.scrollbarDark,
Checkbox: Io.checkboxDark,
Empty: Ao.emptyLight
},
self: Eo.self
};
Xe.default = Vo;
(function(e) {
var l = K && K.__importDefault || function(a) {
return a && a.__esModule ? a : { default: a };
};
Object.defineProperty(e, "__esModule", { value: !0 }), e.cascaderLight = e.cascaderDark = void 0;
var o = Xe;
Object.defineProperty(e, "cascaderDark", { enumerable: !0, get: function() {
return l(o).default;
} });
var c = je;
Object.defineProperty(e, "cascaderLight", { enumerable: !0, get: function() {
return l(c).default;
} });
})(Dt);
var Re = {};
Object.defineProperty(Re, "__esModule", { value: !0 });
Re.getRawNodePath = Uo;
Re.createSelectOptions = Ho;
Re.getPathLabel = zt;
function Uo(e) {
return e ? e.map((l) => l.rawNode) : null;
}
function Ho(e, l, o, c) {
const a = [], i = [];
function k(p) {
for (const h of p) {
if (h.disabled)
continue;
const { rawNode: y } = h;
i.push(y), (h.isLeaf || !l) && a.push({
label: zt(h, c, o),
value: h.key,
rawNode: h.rawNode,
path: Array.from(i)
}), !h.isLeaf && h.children && k(h.children), i.pop();
}
}
return k(e), a;
}
function zt(e, l, o) {
const c = [];
for (; e; )
c.push(e.rawNode[o]), e = e.parent;
return c.reverse().join(l);
}
var ot = {}, nt = {}, rt = {}, Lt = {}, It = {}, lt = {};
Object.defineProperty(lt, "__esModule", { value: !0 });
const yt = fe;
lt.default = (0, yt.h)(
"svg",
{ viewBox: "0 0 64 64", class: "check-icon" },
(0, yt.h)("path", { d: "M50.42,16.76L22.34,39.45l-8.1-11.46c-1.12-1.58-3.3-1.96-4.88-0.84c-1.58,1.12-1.95,3.3-0.84,4.88l10.26,14.51 c0.56,0.79,1.42,1.31,2.38,1.45c0.16,0.02,0.32,0.03,0.48,0.03c0.8,0,1.57-0.27,2.2-0.78l30.99-25.03c1.5-1.21,1.74-3.42,0.52-4.92 C54.13,15.78,51.93,15.55,50.42,16.76z" })
);
var at = {};
Object.defineProperty(at, "__esModule", { value: !0 });
const _t = fe;
at.default = (0, _t.h)(
"svg",
{ viewBox: "0 0 100 100", class: "line-icon" },
(0, _t.h)("path", { d: "M80.2,55.5H21.4c-2.8,0-5.1-2.5-5.1-5.5l0,0c0-3,2.3-5.5,5.1-5.5h58.7c2.8,0,5.1,2.5,5.1,5.5l0,0C85.2,53.1,82.9,55.5,80.2,55.5z" })
);
var ct = {};
(function(e) {
Object.defineProperty(e, "__esModule", { value: !0 }), e.checkboxGroupProps = e.checkboxGroupInjectionKey = void 0;
const l = fe, o = Ae, c = Ke, a = we;
e.checkboxGroupInjectionKey = (0, a.createInjectionKey)("n-checkbox-group"), e.checkboxGroupProps = {
min: Number,
max: Number,
size: String,
value: Array,
defaultValue: {
type: Array,
default: null
},
disabled: {
type: Boolean,
default: void 0
},
"onUpdate:value": [Function, Array],
onUpdateValue: [Function, Array],
// deprecated
onChange: [Function, Array]
}, e.default = (0, l.defineComponent)({
name: "CheckboxGroup",
props: e.checkboxGroupProps,
setup(i) {
process.env.NODE_ENV !== "production" && (0, l.watchEffect)(() => {
i.onChange !== void 0 && (0, a.warnOnce)("checkbox-group", "`on-change` is deprecated, please use `on-update:value` instead.");
});
const { mergedClsPrefixRef: k } = (0, c.useConfig)(i), p = (0, c.useFormItem)(i), { mergedSizeRef: h, mergedDisabledRef: y } = p, O = (0, l.ref)(i.defaultValue), z = (0, l.computed)(() => i.value), V = (0, o.useMergedState)(z, O), U = (0, l.computed)(() => {
var n;
return ((n = V.value) === null || n === void 0 ? void 0 : n.length) || 0;
}), q = (0, l.computed)(() => Array.isArray(V.value) ? new Set(V.value) : /* @__PURE__ */ new Set());
function _(n, s) {
const { nTriggerFormInput: d, nTriggerFormChange: T } = p, { onChange: R, "onUpdate:value": L, onUpdateValue: $ } = i;
if (Array.isArray(V.value)) {
const j = Array.from(V.value), M = j.findIndex((X) => X === s);
n ? ~M || (j.push(s), $ && (0, a.call)($, j, {
actionType: "check",
value: s
}), L && (0, a.call)(L, j, {
actionType: "check",
value: s
}), d(), T(), O.value = j, R && (0, a.call)(R, j)) : ~M && (j.splice(M, 1), $ && (0, a.call)($, j, {
actionType: "uncheck",
value: s
}), L && (0, a.call)(L, j, {
actionType: "uncheck",
value: s
}), R && (0, a.call)(R, j), O.value = j, d(), T());
} else
n ? ($ && (0, a.call)($, [s], {
actionType: "check",
value: s
}), L && (0, a.call)(L, [s], {
actionType: "check",
value: s
}), R && (0, a.call)(R, [s]), O.value = [s], d(), T()) : ($ && (0, a.call)($, [], {
actionType: "uncheck",
value: s
}), L && (0, a.call)(L, [], {
actionType: "uncheck",
value: s
}), R && (0, a.call)(R, []), O.value = [], d(), T());
}
return (0, l.provide)(e.checkboxGroupInjectionKey, {
checkedCountRef: U,
maxRef: (0, l.toRef)(i, "max"),
minRef: (0, l.toRef)(i, "min"),
valueSetRef: q,
disabledRef: y,
mergedSizeRef: h,
toggleCheckbox: _
}), {
mergedClsPrefix: k
};
},
render() {
return (0, l.h)("div", { class: `${this.mergedClsPrefix}-checkbox-group`, role: "group" }, this.$slots);
}
});
})(ct);
var it = {};
Object.defineProperty(it, "__esModule", {
value: !0
});
const u = Qe, qo = io;
it.default = (0, u.c)([
(0, u.cB)("checkbox", `
font-size: var(--n-font-size);
outline: none;
cursor: pointer;
display: inline-flex;
flex-wrap: nowrap;
align-items: flex-start;
word-break: break-word;
line-height: var(--n-size);
--n-merged-color-table: var(--n-color-table);
`, [(0, u.cM)("show-label", "line-height: var(--n-label-line-height);"), (0, u.c)("&:hover", [(0, u.cB)("checkbox-box", [(0, u.cE)("border", "border: var(--n-border-checked);")])]), (0, u.c)("&:focus:not(:active)", [(0, u.cB)("checkbox-box", [(0, u.cE)("border", `
border: var(--n-border-focus);
box-shadow: var(--n-box-shadow-focus);
`)])]), (0, u.cM)("inside-table", [(0, u.cB)("checkbox-box", `
background-color: var(--n-merged-color-table);
`)]), (0, u.cM)("checked", [(0, u.cB)("checkbox-box", `
background-color: var(--n-color-checked);
`, [(0, u.cB)("checkbox-icon", [
// if not set width to 100%, safari & old chrome won't display the icon
(0, u.c)(".check-icon", `
opacity: 1;
transform: scale(1);
`)
])])]), (0, u.cM)("indeterminate", [(0, u.cB)("checkbox-box", [(0, u.cB)("checkbox-icon", [(0, u.c)(".check-icon", `
opacity: 0;
transform: scale(.5);
`), (0, u.c)(".line-icon", `
opacity: 1;
transform: scale(1);
`)])])]), (0, u.cM)("checked, indeterminate", [(0, u.c)("&:focus:not(:active)", [(0, u.cB)("checkbox-box", [(0, u.cE)("border", `
border: var(--n-border-checked);
box-shadow: var(--n-box-shadow-focus);
`)])]), (0, u.cB)("checkbox-box", `
background-color: var(--n-color-checked);
border-left: 0;
border-top: 0;
`, [(0, u.cE)("border", {
border: "var(--n-border-checked)"
})])]), (0, u.cM)("disabled", {
cursor: "not-allowed"
}, [(0, u.cM)("checked", [(0, u.cB)("checkbox-box", `
background-color: var(--n-color-disabled-checked);
`, [(0, u.cE)("border", {
border: "var(--n-border-disabled-checked)"
}), (0, u.cB)("checkbox-icon", [(0, u.c)(".check-icon, .line-icon", {
fill: "var(--n-check-mark-color-disabled-checked)"
})])])]), (0, u.cB)("checkbox-box", `
background-color: var(--n-color-disabled);
`, [(0, u.cE)("border", `
border: var(--n-border-disabled);
`), (0, u.cB)("checkbox-icon", [(0, u.c)(".check-icon, .line-icon", `
fill: var(--n-check-mark-color-disabled);
`)])]), (0, u.cE)("label", `
color: var(--n-text-color-disabled);
`)]), (0, u.cB)("checkbox-box-wrapper", `
position: relative;
width: var(--n-size);
flex-shrink: 0;
flex-grow: 0;
user-select: none;
-webkit-user-select: none;
`), (0, u.cB)("checkbox-box", `
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
height: var(--n-size);
width: var(--n-size);
display: inline-block;
box-sizing: border-box;
border-radius: var(--n-border-radius);
background-color: var(--n-color);
transition: background-color 0.3s var(--n-bezier);
`, [(0, u.cE)("border", `
transition:
border-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
border-radius: inherit;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border: var(--n-border);
`), (0, u.cB)("checkbox-icon", `
display: flex;
align-items: center;
justify-content: center;
position: absolute;
left: 1px;
right: 1px;
top: 1px;
bottom: 1px;
`, [(0, u.c)(".check-icon, .line-icon", `
width: 100%;
fill: var(--n-check-mark-color);
opacity: 0;
transform: scale(0.5);
transform-origin: center;
transition:
fill 0.3s var(--n-bezier),
transform 0.3s var(--n-bezier),
opacity 0.3s var(--n-bezier),
border-color 0.3s var(--n-bezier);
`), (0, qo.iconSwitchTransition)({
left: "1px",
top: "1px"
})])]), (0, u.cE)("label", `
color: var(--n-text-color);
transition: color .3s var(--n-bezier);
user-select: none;
-webkit-user-select: none;
padding: var(--n-label-padding);
font-weight: var(--n-label-font-weight);
`, [(0, u.c)("&:empty", {
display: "none"
})])]),
// modal table header checkbox
(0, u.insideModal)((0, u.cB)("checkbox", `
--n-merged-color-table: var(--n-color-table-modal);
`)),
// popover table header checkbox
(0, u.insidePopover)((0, u.cB)("checkbox", `
--n-merged-color-table: var(--n-color-table-popover);
`))
]);
(function(e) {
var l = K && K.__importDefault || function(_) {
return _ && _.__esModule ? _ : { default: _ };
};
Object.defineProperty(e, "__esModule", { value: !0 }), e.checkboxProps = void 0;
const o = fe, c = Ae, a = Ne, i = ho, k = Ke, p = Ce, h = we, y = Ee, O = vo, z = l(lt), V = l(at), U = ct, q = l(it);
e.checkboxProps = Object.assign(Object.assign({}, k.useTheme.props), {
size: String,
checked: {
type: [Boolean, String, Number],
default: void 0
},
defaultChecked: {
type: [Boolean, String, Number],
default: !1
},
value: [String, Number],
disabled: {
type: Boolean,
default: void 0
},
indeterminate: Boolean,
label: String,
focusable: {
type: Boolean,
default: !0
},
checkedValue: {
type: [Boolean, String, Number],
default: !0
},
uncheckedValue: {
type: [Boolean, String, Number],
default: !1
},
"onUpdate:checked": [Function, Array],
onUpdateChecked: [Function, Array],
// private
privateInsideTable: Boolean,
// deprecated
onChange: [Function, Array]
}), e.default = (0, o.defineComponent)({
name: "Checkbox",
props: e.checkboxProps,
setup(_) {
process.env.NODE_ENV !== "production" && (0, o.watchEffect)(() => {
_.onChange && (0, h.warnOnce)("checkbox", "`on-change` is deprecated, please use `on-update:checked` instead.");
});
const n = (0, o.inject)(U.checkboxGroupInjectionKey, null), s = (0, o.ref)(null), { mergedClsPrefixRef: d, inlineThemeDisabled: T, mergedRtlRef: R } = (0, k.useConfig)(_), L = (0, o.ref)(_.defaultChecked), $ = (0, o.toRef)(_, "checked"), j = (0, c.useMergedState)($, L), M = (0, c.useMemo)(() => {
if (n) {
const f = n.valueSetRef.value;
return f && _.value !== void 0 ? f.has(_.value) : !1;
} else
return j.value === _.checkedValue;
}), X = (0, k.useFormItem)(_, {
mergedSize(f) {
const { size: A } = _;
if (A !== void 0)
return A;
if (n) {
const { value: E } = n.mergedSizeRef;
if (E !== void 0)
return E;
}
if (f) {
const { mergedSize: E } = f;
if (E !== void 0)
return E.value;
}
return "medium";
},
mergedDisabled(f) {
const { disabled: A } = _;
if (A !== void 0)
return A;
if (n) {
if (n.disabledRef.value)
return !0;
const { maxRef: { value: E }, checkedCountRef: ee } = n;
if (E !== void 0 && ee.value >= E && !M.value)
return !0;
const { minRef: { value: te } } = n;
if (te !== void 0 && ee.value <= te && M.value)
return !0;
}
return f ? f.disabled.value : !1;
}
}), { mergedDisabledRef: v, mergedSizeRef: x } = X, N = (0, k.useTheme)("Checkbox", "-checkbox", q.default, y.checkboxLight, _, d);
function W(f) {
if (n && _.value !== void 0)
n.toggleCheckbox(!M.value, _.value);
else {
const { onChange: A, "onUpdate:checked": E, onUpdateChecked: ee } = _, { nTriggerFormInput: te, nTriggerFormChange: oe } = X, ne = M.value ? _.uncheckedValue : _.checkedValue;
E && (0, h.call)(E, ne, f), ee && (0, h.call)(ee, ne, f), A && (0, h.call)(A, ne, f), te(), oe(), L.value = ne;
}
}
function Z(f) {
v.value || W(f);
}
function le(f) {
if (!v.value)
switch (f.key) {
case " ":
case "Enter":
W(f);
}
}
function ye(f) {
switch (f.key) {
case " ":
f.preventDefault();
}
}
const Y = {
focus: () => {
var f;
(f = s.value) === null || f === void 0 || f.focus();
},
blur: () => {
var f;
(f = s.value) === null || f === void 0 || f.blur();
}
}, se = (0, O.useRtl)("Checkbox", R, d), J = (0, o.computed)(() => {
const { value: f } = x, { common: { cubicBezierEaseInOut: A }, self: { borderRadius: E, color: ee, colorChecked: te, colorDisabled: oe, colorTableHeader: ne, colorTableHeaderModal: he, colorTableHeaderPopover: P, checkMarkColor: G, checkMarkColorDisabled: ve, border: be, borderFocus: ae, borderDisabled: Me, borderChecked: ce, boxShadowFocus: De, textColor: Fe, textColorDisabled: de, checkMarkColorDisabledChecked: me, colorDisabledChecked: pe, borderDisabledChecked: Se, labelPadding: Be, labelLineHeight: Pe, labelFontWeight: Ue, [(0, h.createKey)("fontSize", f)]: He, [(0, h.createKey)("size", f)]: qe } } = N.value;
return {
"--n-label-line-height": Pe,
"--n-label-font-weight": Ue,
"--n-size": qe,
"--n-bezier": A,
"--n-border-radius": E,
"--n-border": be,
"--n-border-checked": ce,
"--n-border-focus": ae,
"--n-border-disabled": Me,
"--n-border-disabled-checked": Se,
"--n-box-shadow-focus": De,
"--n-color": ee,
"--n-color-checked": te,
"--n-color-table": ne,
"--n-color-table-modal": he,
"--n-color-table-popover": P,
"--n-color-disabled": oe,
"--n-color-disabled-checked": pe,
"--n-text-color": Fe,
"--n-text-color-disabled": de,
"--n-check-mark-color": G,
"--n-check-mark-color-disabled": ve,
"--n-check-mark-color-disabled-checked": me,
"--n-font-size": He,
"--n-label-padding": Be
};
}), I = T ? (0, k.useThemeClass)("checkbox", (0, o.computed)(() => x.value[0]), J, _) : void 0;
return Object.assign(X, Y, {
rtlEnabled: se,
selfRef: s,
mergedClsPrefix: d,
mergedDisabled: v,
renderedChecked: M,
mergedTheme: N,
labelId: (0, a.createId)(),
handleClick: Z,
handleKeyUp: le,
handleKeyDown: ye,
cssVars: T ? void 0 : J,
themeClass: I == null ? void 0 : I.themeClass,
onRender: I == null ? void 0 : I.onRender
});
},
render() {
var _;
const { $slots: n, renderedChecked: s, mergedDisabled: d, indeterminate: T, privateInsideTable: R, cssVars: L, labelId: $, label: j, mergedClsPrefix: M, focusable: X, handleKeyUp: v, handleKeyDown: x, handleClick: N } = this;
(_ = this.onRender) === null || _ === void 0 || _.call(this);
const W = (0, h.resolveWrappedSlot)(n.default, (Z) => j || Z ? (0, o.h)("span", { class: `${M}-checkbox__label`, id: $ }, j || Z) : null);
return (0, o.h)(
"div",
{ ref: "selfRef", class: [
`${M}-checkbox`,
this.themeClass,
this.rtlEnabled && `${M}-checkbox--rtl`,
s && `${M}-checkbox--checked`,
d && `${M}-checkbox--disabled`,
T && `${M}-checkbox--indeterminate`,
R && `${M}-checkbox--inside-table`,
W && `${M}-checkbox--show-label`
], tabindex: d || !X ? void 0 : 0, role: "checkbox", "aria-checked": T ? "mixed" : s, "aria-labelledby": $, style: L, onKeyup: v, onKeydown: x, onClick: N, onMousedown: () => {
(0, i.on)("selectstart", window, (Z) => {
Z.preventDefault();
}, {
once: !0
});
} },
(0, o.h)(
"div",
{ class: `${M}-checkbox-box-wrapper` },
" ",
(0, o.h)(
"div",
{ class: `${M}-checkbox-box` },
(0, o.h)(p.NIconSwitchTransition, null, {
default: () => this.indeterminate ? (0, o.h)("div", { key: "indeterminate", class: `${M}-checkbox-icon` }, V.default) : (0, o.h)("div", { key: "check", class: `${M}-checkbox-icon` }, z.default)
}),
(0, o.h)("div", { class: `${M}-checkbox-box__border` })
)
),
W
);
}
});
})(It);
(function(e) {
var l = K && K.__importDefault || function(a) {
return a && a.__esModule ? a : { default: a };
};
Object.defineProperty(e, "__esModule", { value: !0 }), e.checkboxGroupProps = e.NCheckboxGroup = e.checkboxProps = e.NCheckbox = void 0;
var o = It;
Object.defineProperty(e, "NCheckbox", { enumerable: !0, get: function() {
return l(o).default;
} }), Object.defineProperty(e, "checkboxProps", { enumerable: !0, get: function() {
return o.checkboxProps;
} });
var c = ct;
Object.defineProperty(e, "NCheckboxGroup", { enumerable: !0, get: function() {
return l(c).default;
} }), Object.defineProperty(e, "checkboxGroupProps", { enumerable: !0, get: function() {
return c.checkboxGroupProps;
} });
})(Lt);
var ge = {};
Object.defineProperty(ge, "__esModule", { value: !0 });
ge.cascaderInjectionKey = void 0;
const Go = we;
ge.cascaderInjectionKey = (0, Go.createInjectionKey)("n-cascader");
Object.defineProperty(rt, "__esModule", { value: !0 });
const B = fe, Oe = Ae, Wo = Ne, Yo = Lt, Ye = Ce, xt = so, Jo = ge;
rt.default = (0, B.defineComponent)({
name: "NCascaderOption",
props: {
tmNode: {
type: Object,
required: !0
}
},
setup(e) {
const { expandTriggerRef: l, remoteRef: o, multipleRef: c, mergedValueRef: a, checkedKeysRef: i, indeterminateKeysRef: k, hoverKeyPathRef: p, keyboardKeyRef: h, loadingKeySetRef: y, cascadeRef: O, mergedCheckStrategyRef: z, onLoadRef: V, mergedClsPrefixRef: U, mergedThemeRef: q, labelFieldRef: _, showCheckboxRef: n, renderPrefixRef: s, renderSuffixRef: d, updateHoverKey: T, updateKeyboardKey: R, addLoadingKey: L, deleteLoadingKey: $, closeMenu: j, doCheck: M, doUncheck: X, renderLabelRef: v } = (0, B.inject)(Jo.cascaderInjectionKey), x = (0, B.computed)(() => e.tmNode.key), N = (0, B.computed)(() => {
const { value: P } = l, { value: G } = o;
return !G && P === "hover";
}), W = (0, B.computed)(() => {
if (N.value)
return te;
}), Z = (0, B.computed)(() => {
if (N.value)
return oe;
}), le = (0, Oe.useMemo)(() => {
const { value: P } = c;
return P ? i.value.includes(x.value) : a.value === x.value;
}), ye = (0, Oe.useMemo)(() => c.value ? k.value.includes(x.value) : !1), Y = (0, Oe.useMemo)(() => p.value.includes(x.value)), se = (0, Oe.useMemo)(() => {
const { value: P } = h;
return P === null ? !1 : P === x.value;
}), J = (0, Oe.useMemo)(() => o.value ? y.value.has(x.value) : !1), I = (0, B.computed)(() => e.tmNode.isLeaf), f = (0, B.computed)(() => e.tmNode.disabled), A = (0, B.computed)(() => e.tmNode.rawNode[_.value]), E = (0, B.computed)(() => e.tmNode.shallowLoaded);
function ee(P) {
if (f.value)
return;
const { value: G } = o, { value: ve } = y, { value: be } = V, { value: ae } = x, { value: Me } = I, { value: ce } = E;
(0, Wo.happensIn)(P, "checkbox") || (G && !ce && !ve.has(ae) && be && (L(ae), be(e.tmNode.rawNode).then(() => {
$(ae);
}).catch(() => {
$(ae);
})), T(ae), R(ae)), Me && he();
}
function te() {
if (!N.value || f.value)
return;
const { value: P } = x;
T(P), R(P);
}
function oe() {
N.value && te();
}
function ne() {
const { value: P } = I;
P || he();
}
function he() {
const { value: P } = c, { value: G } = x;
P ? ye.value || le.value ? X(G) : M(G) : (M(G), j(!0));
}
return {
checkStrategy: z,
multiple: c,
cascade: O,
checked: le,
indeterminate: ye,
hoverPending: Y,
keyboardPending: se,
isLoading: J,
showCheckbox: n,
isLeaf: I,
disabled: f,
label: A,
mergedClsPrefix: U,
mergedTheme: q,
handleClick: ee,
handleCheckboxUpdateValue: ne,
mergedHandleMouseEnter: W,
mergedHandleMouseMove: Z,
renderLabel: v,
renderPrefix: s,
renderSuffix: d
};
},
render() {
const { mergedClsPrefix: e, showCheckbox: l, renderLabel: o, renderPrefix: c, renderSuffix: a } = this;
let i = null;
if (l || c) {
const h = this.showCheckbox ? (0, B.h)(Yo.NCheckbox, { focusable: !1, "data-checkbox": !0, disabled: this.disabled, checked: this.checked, indeterminate: this.indeterminate, theme: this.mergedTheme.peers.Checkbox, themeOverrides: this.mergedTheme.peerOverrides.Checkbox, onUpdateChecked: this.handleCheckboxUpdateValue }) : null;
i = (0, B.h)("div", { class: `${e}-cascader-option__prefix` }, c ? c({
option: this.tmNode.rawNode,
checked: this.checked,
node: h
}) : h);
}
let k = null;
const p = (0, B.h)("div", { class: `${e}-cascader-option-icon-placeholder` }, this.isLeaf ? this.checkStrategy === "child" && !(this.multiple && this.cascade) ? (0, B.h)(B.Transition, { name: "fade-in-scale-up-transition" }, {
default: () => this.checked ? (0, B.h)(Ye.NBaseIcon, { clsPrefix: e, class: `${e}-cascader-option-icon ${e}-cascader-option-icon--checkmark` }, { default: () => (0, B.h)(xt.CheckmarkIcon, null) }) : null
}) : null : (0, B.h)(Ye.NBaseLoading, { clsPrefix: e, scale: 0.85, strokeWidth: 24, show: this.isLoading, class: `${e}-cascader-option-icon` }, {
default: () => (0, B.h)(Ye.NBaseIcon, { clsPrefix: e, key: "arrow", class: `${e}-cascader-option-icon ${e}-cascader-option-icon--arrow` }, {
default: () => (0, B.h)(xt.ChevronRightIcon, null)
})
}));
return k = (0, B.h)("div", { class: `${e}-cascader-option__suffix` }, a ? a({
option: this.tmNode.rawNode,
checked: this.checked,
node: p
}) : p), (0, B.h)(
"div",
{ class: [
`${e}-cascader-option`,
this.keyboardPending || this.hoverPending && `${e}-cascader-option--pending`,
this.disabled && `${e}-cascader-option--disabled`,
this.showCheckbox && `${e}-cascader-option--show-prefix`
], onMouseenter: this.mergedHandleMouseEnter, onMousemove: this.mergedHandleMouseMove, onClick: this.handleClick },
i,
(0, B.h)("span", { class: `${e}-cascader-option__label` }, o ? o(this.tmNode.rawNode, this.checked) : this.label),
k
);
}
});
var Qo = K && K.__importDefault || function(e) {
return e && e.__esModule ? e : { default: e };
};
Object.defineProperty(nt, "__esModule", { value: !0 });
const ie = fe, Xo = Nt, Zo = Ne, en = Ce, Ct = Qo(rt), tn = ge;
nt.default = (0, ie.defineComponent)({
name: "CascaderSubmenu",
props: {
depth: {
type: Number,
required: !0
},
tmNodes: {
type: Array,
required: !0
}
},
setup() {
const { virtualScrollRef: e, mergedClsPrefixRef: l, mergedThemeRef: o, optionHeightRef: c } = (0, ie.inject)(tn.cascaderInjectionKey), a = (0, ie.ref)(null), i = (0, ie.ref)(null), k = {
scroll(p, h) {
var y, O;
e.value ? (y = i.value) === null || y === void 0 || y.scrollTo({
index: p
}) : (O = a.value) === null || O === void 0 || O.scrollTo({
index: p,
elSize: h
});
}
};
return Object.assign({
mergedClsPrefix: l,
mergedTheme: o,
scrollbarInstRef: a,
vlInstRef: i,
virtualScroll: e,
itemSize: (0, ie.computed)(() => (0, Zo.depx)(c.value)),
handleVlScroll: () => {
var p;
(p = a.value) === null || p === void 0 || p.sync();
},
getVlContainer: () => {
var p;
return (p = i.value) === null || p === void 0 ? void 0 : p.listElRef;
},
getVlContent: () => {
var p;
return (p = i.value) === null || p === void 0 ? void 0 : p.itemsElRef;
}
}, k);
},
render() {
const { mergedClsPrefix: e, mergedTheme: l, virtualScroll: o } = this;
return (0, ie.h)(
"div",
{ class: [
o && `${e}-cascader-submenu--virtual`,
`${e}-cascader-submenu`
] },
(0, ie.h)(en.NScrollbar, { ref: "scrollbarInstRef", theme: l.peers.Scrollbar, themeOverrides: l.peerOverrides.Scrollbar, container: o ? this.getVlContainer : void 0, content: o ? this.getVlContent : void 0 }, {
default: () => o ? (0, ie.h)(Xo.VirtualList, { items: this.tmNodes, itemSize: this.itemSize, onScroll: this.handleVlScroll, showScrollbar: !1, ref: "vlInstRef" }, {
default: ({ item: c }) => (0, ie.h)(Ct.default, { key: c.key, tmNode: c })
}) : this.tmNodes.map((c) => (0, ie.h)(Ct.default, { key: c.key, tmNode: c }))
})
);
}
});
var Kt = K && K.__importDefault || function(e) {
return e && e.__esModule ? e : { default: e };
};
Object.defineProperty(ot, "__esModule", { value: !0 });
const H = fe, on = Tt, nn = Kt(uo), Je = we, rn = fo, ln = Ce, an = Kt(nt), cn = ge;
ot.default = (0, H.defineComponent)({
name: "NCascaderMenu",
props: {
value: [String, Number, Array],
placement: {
type: String,
default: "bottom-start"
},
show: Boolean,
menuModel: {
type: Array,
required: !0
},
loading: Boolean,
onFocus: {
type: Function,
required: !0
},
onBlur: {
type: Function,
required: !0
},
onKeydown: {
type: Function,
required: !0
},
onMousedown: {
type: Function,
required: !0
},
onTabout: {
type: Function,
required: !0
}
},
setup(e) {
const { localeRef: l, isMountedRef: o, mergedClsPrefixRef: c, syncCascaderMenuPosition: a, handleCascaderMenuClickOutside: i, mergedThemeRef: k, getColumnStyleRef: p } = (0, H.inject)(cn.cascaderInjectionKey), h = [], y = (0, H.ref)(null), O = (0, H.ref)(null);
function z() {
a();
}
(0, Je.useOnResize)(O, z);
function V(s) {
var d;
const { value: { loadingRequiredMessage: T } } = l;
(d = y.value) === null || d === void 0 || d.showOnce(T(s));
}
function U(s) {
i(s);
}
function q(s) {
const { value: d } = O;
d && (d.contains(s.relatedTarget) || e.onFocus(s));
}
function _(s) {
const { value: d } = O;
d && (d.contains(s.relatedTarget) || e.onBlur(s));
}
return Object.assign({
isMounted: o,
mergedClsPrefix: c,
selfElRef: O,
submenuInstRefs: h,
maskInstRef: y,
mergedTheme: k,
getColumnStyle: p,
handleFocusin: q,
handleFocusout: _,
handleClickOutside: U
}, {
scroll(s, d, T) {
const R = h[s];
R && R.scroll(d, T);
},
showErrorMessage: V
});
},
render() {
const { submenuInstRefs: e, mergedClsPrefix: l, mergedTheme: o } = this;
return (0, H.h)(H.Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted }, {
default: () => this.show ? (0, H.withDirectives)((0, H.h)(
"div",
{ tabindex: "0", ref: "selfElRef", class: `${l}-cascader-menu`, onMousedown: this.onMousedown, onFocusin: this.handleFocusin, onFocusout: this.handleFocusout, onKeydown: this.onKeydown },
this.menuModel[0].length ? (0, H.h)(
"div",
{ class: `${l}-cascader-submenu-wrapper` },
this.menuModel.map((c, a) => {
var i;
return (0, H.h)(an.default, { style: (i = this.getColumnStyle) === null || i === void 0 ? void 0 : i.call(this, { level: a }), ref: (k) => {
k && (e[a] = k);
}, key: a, tmNodes: c, depth: a + 1 });
}),
(0, H.h)(ln.NBaseMenuMask, { clsPrefix: l, ref: "maskInstRef" })
) : (0, H.h)("div", { class: `${l}-cascader-menu__empty` }, (0, Je.resolveSlot)(this.$slots.empty, () => [
(0, H.h)(rn.NEmpty, { theme: o.peers.Empty, themeOverrides: o.peerOverrides.Empty })
])),
(0, Je.resolveWrappedSlot)(this.$slots.action, (c) => c && (0, H.h)("div", { class: `${l}-cascader-menu-action`, "data-action": !0 }, c)),
(0, H.h)(nn.default, { onFocus: this.onTabout })
), [
[
on.clickoutside,
this.handleClickOutside,
void 0,
{ capture: !0 }
]
]) : null
});
}
});
var st = {};
Object.defineProperty(st, "__esModule", { value: !0 });
const re = fe, sn = Tt, dn = Ot, un = bo, fn = Ce, hn = we, vn = Re, bn = ge;
st.default = (0, re.defineComponent)({
name: "NCascaderSelectMenu",
props: {
value: {
type: [String, Number, Array],
default: null
},
show: Boolean,
pattern: {
type: String,
default: ""
},
multiple: Boolean,
tmNodes: {
type: Array,
default: () => []
},
filter: Function,
labelField: {
type: String,
required: !0
},
separator: {
type: String,
required: !0
}
},
setup(e) {
const { isMountedRef: l, mergedValueRef: o, mergedClsPrefixRef: c, mergedThemeRef: a, mergedCheckStrategyRef: i, slots: k, syncSelectMenuPosition: p, closeMenu: h, handleSelectMenuClickOutside: y, doUncheck: O, doCheck: z, clearPattern: V } = (0, re.inject)(bn.cascaderInjectionKey), U = (0, re.ref)(null), q = (0, re.computed)(() => (0, vn.createSelectOptions)(e.tmNodes, i.value === "child", e.labelField, e.separator)), _ = (0, re.computed)(() => {
const { filter: v } = e;
if (v)
return v;
const { labelField: x } = e;
return (N, W, Z) => Z.some((le) => le[x] && ~le[x].toLowerCase().indexOf(N.toLowerCase()));
}), n = (0, re.computed)(() => {
const { pattern: v } = e, { value: x } = _;
return (v ? q.value.filter((N) => x(v, N.rawNode, N.path)) : q.value).map((N) => ({
value: N.value,
label: N.label
}));
}), s = (0, re.computed)(() => (0, dn.createTreeMate)(n.value, (0, un.createTmOptions)("value", "children")));
function d() {
p();
}
function T(v) {
R(v);
}
function R(v) {
if (e.multiple) {
const { value: x } = o;
Array.isArray(x) ? x.includes(v.key) ? O(v.key) : z(v.key) : x === null && z(v.key), V();
} else
z(v.key), h(!0);
}
function L() {
var v;
(v = U.value) === null || v === void 0 || v.prev();
}
function $() {
var v;
(v = U.value) === null || v === void 0 || v.next();
}
function j() {
var v;
if (U) {
const x = (v = U.value) === null || v === void 0 ? void 0 : v.getPendingTmNode();
return x && R(x), !0;
}
return !1;
}
function M(v) {
y(v);
}
return Object.assign({
isMounted: l,
mergedTheme: a,
mergedClsPrefix: c,
menuInstRef: U,
selectTreeMate: s,
handleResize: d,
handleToggle: T,
handleClickOutside: M,
cascaderSlots: k
}, {
prev: L,
next: $,
enter: j
});
},
render() {
const { mergedClsPrefix: e, isMounted: l, mergedTheme: o, cascaderSlots: c } = this;
return (0, re.h)(re.Transition, { name: "fade-in-scale-up-transition", appear: l }, {
default: () => this.show ? (0, re.withDirectives)((0, re.h)(fn.NInternalSelectMenu, { ref: "menuInstRef", onResize: this.handleResize, clsPrefix: e, class: `${e}-cascader-menu`, autoPending: !0, themeOverrides: o.peerOverrides.InternalSelectMenu, theme: o.peers.InternalSelectMenu, treeMate: this.selectTreeMate, multiple: this.multiple, value: this.value, onToggle: this.handleToggle }, {
empty: () => (0, hn.resolveSlot)(c["not-found"], () => [])
}), [
[
sn.clickoutside,
this.handleClickOutside,
void 0,
{ capture: !0 }
]
]) : null
});
}
});
var dt = {};
Object.defineProperty(dt, "__esModule", {
value: !0
});
const S = Qe, wt = mo;
dt.default = (0, S.c)([(0, S.cB)("cascader-menu", `
outline: none;
position: relative;
margin: 4px 0;
display: flex;
flex-flow: column nowrap;
border-radius: var(--n-menu-border-radius);
overflow: hidden;
box-shadow: var(--n-menu-box-shadow);
color: var(--n-option-text-color);
background-color: var(--n-menu-color);
`, [
(0, wt.fadeInScaleUpTransition)({
transformOrigin: "inherit",
duration: "0.2s"
}),
(0, S.cE)("empty", `
display: flex;
padding: 12px 32px;
flex: 1;
justify-content: center;
`),
// if width not set, cascader select menu's inner scroll area's width is
// not correct, which won't change after select menu width is set
(0, S.cB)("scrollbar", `
width: 100%;
`),
(0, S.cB)("base-menu-mask", `
background-color: var(--n-menu-mask-color);
`),
(0, S.cB)("base-loading", `
color: var(--n-loading-color);
`),
(0, S.cB)("cascader-submenu-wrapper", `
position: relative;
display: flex;
flex-wrap: nowrap;
`),
(0, S.cB)("cascader-submenu", `
height: var(--n-menu-height);
min-width: var(--n-column-width);
position: relative;
`, [(0, S.cM)("virtual", `
width: var(--n-column-width);
`), (0, S.cB)("scrollbar-content", `
position: relative;
`), (0, S.c)("&:first-child", `
border-top-left-radius: var(--n-menu-border-radius);
border-bottom-left-radius: var(--n-menu-border-radius);
`), (0, S.c)("&:last-child", `
border-top-right-radius: var(--n-menu-border-radius);
border-bottom-right-radius: var(--n-menu-border-radius);
`), (0, S.c)("&:not(:first-child)", `
border-left: 1px solid var(--n-menu-divider-color);
`)]),
(0, S.cB)("cascader-menu-action", `
box-sizing: border-box;
padding: 8px;
border-top: 1px solid var(--n-menu-divider-color);
`),
(0, S.cB)("cascader-option", `
height: var(--n-option-height);
line-height: var(--n-option-height);
font-size: var(--n-option-font-size);
padding: 0 0 0 18px;
box-sizing: border-box;
min-width: 182px;
background-color: #0000;
display: flex;
align-items: center;
white-space: nowrap;
position: relative;
cursor: pointer;
transition:
background-color .2s var(--n-bezier),
color 0.2s var(--n-bezier);
`, [(0, S.cM)("show-prefix", `
padding-left: 0;
`), (0, S.cE)("label", `
flex: 1 0 0;
overflow: hidden;
text-overflow: ellipsis;
`), (0, S.cE)("prefix", `
min-width: 32px;
display: flex;
align-items: center;
justify-content: center;
`), (0, S.cE)("suffix", `
min-width: 32px;
display: flex;
align-items: center;
justify-content: center;
`), (0, S.cB)("cascader-option-icon-placeholder", `
line-height: 0;
position: relative;
width: 16px;
height: 16px;
font-size: 16px;
`, [(0, S.cB)("cascader-option-icon", [(0, S.cM)("checkmark", `
color: var(--n-option-check-mark-color);
`, [(0, wt.fadeInScaleUpTransition)({
originalTransition: "background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"
})]), (0, S.cM)("arrow", `
color: var(--n-option-arrow-color);
`)])]), (0, S.cM)("selected", `
color: var(--n-option-text-color-active);
`), (0, S.cM)("active", `
color: var(--n-option-text-color-active);
background-color: var(--n-option-color-hover);
`), (0, S.cM)("pending", `
background-color: var(--n-option-color-hover);
`), (0, S.c)("&:hover", `
background-color: var(--n-option-color-hover);
`), (0, S.cM)("disabled", `
color: var(--n-option-text-color-disabled);
background-color: #0000;
cursor: not-allowed;
`, [(0, S.cB)("cascader-option-icon", [(0, S.cM)("arrow", `
color: var(--n-option-text-color-disabled);
`)])])])
]), (0, S.cB)("cascader", `
z-index: auto;
position: relative;
width: 100%;
`)]);
(function(e) {
var l = K && K.__importDefault || function(n) {
return n && n.__esModule ? n : { default: n };
};
Object.defineProperty(e, "__esModule", { value: !0 }), e.cascaderProps = void 0;
const o = fe, c = Ot, a = Nt, i = Ne, k = Ae, p = Ce, h = Ke, y = we, O = Dt, z = Re, V = l(ot), U = l(st), q = ge, _ = l(dt);
e.cascaderProps = Object.assign(Object.assign({}, h.useTheme.props), {
allowCheckingNotLoaded: Boolean,
to: y.useAdjustedTo.propTo,
bordered: {
type: Boolean,
default: void 0
},
options: {
type: Array,
default: () => []
},
value: [String, Number, Array],
defaultValue: {
type: [String, Number, Array],
default: null
},
placeholder: String,
multiple: Boolean,
size: String,
filterable: Boolean,
disabled: {
type: Boolean,
default: void 0
},
disabledField: {
type: String,
default: "disabled"
},
expandTrigger: {
type: String,
default: "click"
},
clearable: Boolean,
clearFilterAfterSelect: {
type: Boolean,
default: !0
},
remote: Boolean,
onLoad: Function,
separator: {
type: String,
default: " / "
},
filter: Function,
placement: {
type: String,
default: "bottom-start"
},
cascade: {
type: Boolean,
default: !0
},
leafOnly: Boolean,
showPath: {
type: Boolean,
default: !0
},
show: {
type: Boolean,
default: void 0
},
maxTagCount: [String, Number],
ellipsisTagPopoverProps: Object,
menuProps: Object,
filterMenuProps: Object,
virtualScroll: {
type: Boolean,
default: !0
},
checkStrategy: {
type: String,
default: "all"
},
valueField: {
type: String,
default: "value"
},
labelField: {
type: String,
default: "label"
},
childrenField: {
type: String,
default: "children"
},
renderLabel: Function,
status: String,
"onUpdate:value": [Function, Array],
onUpdateValue: [Function, Array],
"onUpdate:show": [Function, Array],
onUpdateShow: [Function, Array],
onBlur: Function,
onFocus: Function,
getColumnStyle: Function,
renderPrefix: Function,
renderSuffix: Function,
// deprecated
onChange: [Function, Array]
}), e.default = (0, o.defineComponent)({
name: "Cascader",
props: e.cascaderProps,
setup(n, { slots: s }) {
process.env.NODE_ENV !== "production" && (0, o.watchEffect)(() => {
n.leafOnly && (0, y.warnOnce)("cascader", '`leaf-only` is deprecated, please use `check-strategy="child"` instead'), n.onChange !== void 0 && (0, y.warnOnce)("cascader", "`on-change` is deprecated, please use `on-update:value` instead.");
});
const { mergedBorderedRef: d, mergedClsPrefixRef: T, namespaceRef: R, inlineThemeDisabled: L } = (0, h.useConfig)(n), $ = (0, h.useTheme)("Cascader", "-cascader", _.default, O.cascaderLight, n, T), { localeRef: j } = (0, h.useLocale)("Cascader"), M = (0, o.ref)(n.defaultValue), X = (0, o.computed)(() => n.value), v = (0, k.useMergedState)(X, M), x = (0, o.computed)(() => n.leafOnly ? "child" : n.checkStrategy), N = (0, o.ref)(""), W = (0, h.useFormItem)(n), { mergedSizeRef: Z, mergedDisabledRef: le, mergedStatusRef: ye } = W, Y = (0, o.ref)(null), se = (0, o.ref)(null), J = (0, o.ref)(null), I = (0, o.ref)(null), f = (0, o.ref)(null), A = (0, o.ref)(/* @__PURE__ */ new Set()), E = (0, o.ref)(null), ee = (0, o.ref)(null), te = (0, y.useAdjustedTo)(n), oe = (0, o.ref)(!1), ne = (t) => {
A.value.add(t);
}, he = (t) => {
A.value.delete(t);
}, P = (0, o.computed)(() => {
const { valueField: t, childrenField: r, disabledField: b } = n;
return (0, c.createTreeMate)(n.options, {
getDisabled(C) {
return C[b];
},
getKey(C) {
return C[t];
},
getChildren(C) {
return C[r];
}
});
}), G = (0, o.computed)(() => {
const { cascade: t, multiple: r } = n;
return r && Array.isArray(v.value) ? P.value.getCheckedKeys(v.value, {
cascade: t,
allowNotLoaded: n.allowCheckingNotLoaded
}) : {
checkedKeys: [],
indeterminateKeys: []
};
}), ve = (0, o.computed)(() => G.value.checkedKeys), be = (0, o.computed)(() => G.value.indeterminateKeys), ae = (0, o.computed)(() => {
const { treeNodePath: t, treeNode: r } = P.value.getPath(f.value);
let b;
return r === null ? b = [P.value.treeNodes] : (b = t.map((C) => C.siblings), !r.isLeaf && !A.value.has(r.key) && r.children && b.push(r.children)), b;
}), Me = (0, o.computed)(() => {
const { keyPath: t } = P.value.getPath(f.value);
return t;
}), ce = (0, o.computed)(() => $.value.self.optionHeight);
(0, o.isReactive)(n.options) && (0, o.watch)(n.options, (t, r) => {
t !== r && (f.value = null, I.value = null);
});
const De = (0, o.ref)(!1);
function Fe(t) {
const { onUpdateShow: r, "onUpdate:show": b } = n;
r && (0, y.call)(r, t), b && (0, y.call)(b, t), De.value = t;
}
function de(t, r, b) {
const { onUpdateValue: C, "onUpdate:value": m, onChange: D } = n, { nTriggerFormInput: g, nTriggerFormChange: F } = W;
C && (0, y.call)(C, t, r, b), m && (0, y.call)(m, t, r, b), D && (0, y.call)(D, t, r, b), M.value = t, g(), F();
}
function me(t) {
I.value = t;
}
function pe(t) {
f.value = t;
}
function Se(t) {
const { value: { getNode: r } } = P;
return t.map((b) => {
var C;
return ((C = r(b)) === null || C === void 0 ? void 0 : C.rawNode) || null;
});
}
function Be(t) {
var r;
const { cascade: b, multiple: C, filterable: m } = n, { value: { check: D, getNode: g, getPath: F } } = P;
if (C)
try {
const { checkedKeys: w } = D(t, G.value.checkedKeys, {
cascade: b,
checkStrategy: x.value,
allowNotLoaded: n.allowCheckingNotLoaded
});
de(w, Se(w), w.map((xe) => {
var Te;
return (0, z.getRawNodePath)((Te = F(xe)) === null || Te === void 0 ? void 0 : Te.treeNodePath);
})), m && Ge(), I.value = t, f.value = t;
} catch (w) {
if (w instanceof c.SubtreeNotLoadedError) {
if (Y.value) {
const xe = g(t);
xe !== null && Y.value.showErrorMessage(xe.rawNode[n.labelField]);
}
} else
throw w;
}
else if (x.value === "child") {
const w = g(t);
if (w != null && w.isLeaf)
de(t, w.rawNode, (0, z.getRawNodePath)(F(t).treeNodePath));
else
return !1;
} else {
const w = g(t);
de(t, (w == null ? void 0 : w.rawNode) || null, (0, z.getRawNodePath)((r = F(t)) === null || r === void 0 ? void 0 : r.treeNodePath));
}
return !0;
}
function Pe(t) {
const { cascade: r, multiple: b } = n;
if (b) {
const { value: { uncheck: C, getNode: m, getPath: D } } = P, { checkedKeys: g } = C(t, G.value.checkedKeys, {
cascade: r,
checkStrategy: x.value,
allowNotLoaded: n.allowCheckingNotLoaded
});
de(g, g.map((F) => {
v