epic-designer-gold
Version:
基于vue3的设计器,可视化开发页面表单
1,412 lines (1,411 loc) • 69.2 kB
JavaScript
import { c as K } from "./_commonjsHelpers-BVfed4GL.js";
import { f as je, b as Ae, c as Xe, a as De, d as we, e as Ee, g as so, u as uo, r as Mt } from "./index-B2_JTx7E.js";
import { g as St, c as Pt, a as Tt, s as Ot, i as fo, _ as Re, e as ho, h as vo, j as mo, r as Nt, d as jt } from "./index-kOCEDlqX.js";
import { r as fe } from "./_vue_commonjs-external-NwvjgbHK.js";
import { u as bo } from "./utils-BM69FtWE.js";
import { f as go } from "./fade-in-scale-up.cssr-JG1L7qTi.js";
function po(e, i) {
for (var l = 0; l < i.length; l++) {
const a = i[l];
if (typeof a != "string" && !Array.isArray(a)) {
for (const c in a)
if (c !== "default" && !(c in e)) {
const o = Object.getOwnPropertyDescriptor(a, c);
o && Object.defineProperty(e, c, o.get ? o : {
enumerable: !0,
get: () => a[c]
});
}
}
}
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
}
var Dt = {}, Ft = {}, Bt = {}, Ze = {}, Ve = {}, et = {}, Fe = {}, tt = {};
Object.defineProperty(tt, "__esModule", { value: !0 });
tt.default = {
sizeSmall: "14px",
sizeMedium: "16px",
sizeLarge: "18px",
labelPadding: "0 8px",
labelFontWeight: "400"
};
var ko = K && K.__importDefault || function(e) {
return e && e.__esModule ? e : { default: e };
};
Object.defineProperty(Fe, "__esModule", { value: !0 });
Fe.self = zt;
const yo = je, _o = Ae, xo = ko(tt);
function zt(e) {
const { baseColor: i, inputColorDisabled: l, cardColor: a, modalColor: c, popoverColor: o, textColorDisabled: C, borderColor: m, primaryColor: p, textColor2: b, fontSizeSmall: F, fontSizeMedium: I, fontSizeLarge: E, borderRadiusSmall: X, lineHeight: V } = e;
return Object.assign(Object.assign({}, xo.default), {
labelLineHeight: V,
fontSizeSmall: F,
fontSizeMedium: I,
fontSizeLarge: E,
borderRadius: X,
color: i,
colorChecked: p,
colorDisabled: l,
colorDisabledChecked: l,
colorTableHeader: a,
colorTableHeaderModal: c,
colorTableHeaderPopover: o,
checkMarkColor: i,
checkMarkColorDisabled: C,
checkMarkColorDisabledChecked: C,
border: `1px solid ${m}`,
borderDisabled: `1px solid ${m}`,
borderDisabledChecked: `1px solid ${m}`,
borderChecked: `1px solid ${p}`,
borderFocus: `1px solid ${p}`,
boxShadowFocus: `0 0 0 2px ${(0, yo.changeColor)(p, { alpha: 0.3 })}`,
textColor: b,
textColorDisabled: C
});
}
const Co = {
name: "Checkbox",
common: _o.commonLight,
self: zt
};
Fe.default = Co;
Object.defineProperty(et, "__esModule", { value: !0 });
const wo = Ae, Ro = Fe, Mo = {
name: "Checkbox",
common: wo.commonDark,
self(e) {
const { cardColor: i } = e, l = (0, Ro.self)(e);
return l.color = "#0000", l.checkMarkColor = i, l;
}
};
et.default = Mo;
var Ue = {}, ot = {};
Object.defineProperty(ot, "__esModule", {
value: !0
});
const yt = Xe;
ot.default = (0, yt.cB)("checkbox", [(0, yt.cM)("rtl", `
direction: rtl;
`)]);
var So = K && K.__importDefault || function(e) {
return e && e.__esModule ? e : { default: e };
};
Object.defineProperty(Ue, "__esModule", { value: !0 });
Ue.checkboxRtl = void 0;
const Po = So(ot);
Ue.checkboxRtl = {
name: "Checkbox",
style: Po.default
};
(function(e) {
var i = K && K.__importDefault || function(o) {
return o && o.__esModule ? o : { default: o };
};
Object.defineProperty(e, "__esModule", { value: !0 }), e.checkboxRtl = e.checkboxLight = e.checkboxDark = void 0;
var l = et;
Object.defineProperty(e, "checkboxDark", { enumerable: !0, get: function() {
return i(l).default;
} });
var a = Fe;
Object.defineProperty(e, "checkboxLight", { enumerable: !0, get: function() {
return i(a).default;
} });
var c = Ue;
Object.defineProperty(e, "checkboxRtl", { enumerable: !0, get: function() {
return c.checkboxRtl;
} });
})(Ve);
var Be = {};
Object.defineProperty(Be, "__esModule", { value: !0 });
Be.self = Lt;
const To = Pt, Oo = Ot, No = Tt, jo = De, Do = Ae, Fo = Ve, Bo = St;
function Lt(e) {
const { borderRadius: i, boxShadow2: l, popoverColor: a, textColor2: c, textColor3: o, primaryColor: C, textColorDisabled: m, dividerColor: p, hoverColor: b, fontSizeMedium: F, heightMedium: I } = e;
return {
menuBorderRadius: i,
menuColor: a,
menuBoxShadow: l,
menuDividerColor: p,
menuHeight: "calc(var(--n-option-height) * 6.6)",
optionArrowColor: o,
optionHeight: I,
optionFontSize: F,
optionColorHover: b,
optionTextColor: c,
optionTextColorActive: C,
optionTextColorDisabled: m,
optionCheckMarkColor: C,
loadingColor: C,
columnWidth: "180px"
};
}
const zo = (0, jo.createTheme)({
name: "Cascader",
common: Do.commonLight,
peers: {
InternalSelectMenu: Oo.internalSelectMenuLight,
InternalSelection: No.internalSelectionLight,
Scrollbar: To.scrollbarLight,
Checkbox: Fo.checkboxLight,
Empty: Bo.emptyLight
},
self: Lt
});
Be.default = zo;
Object.defineProperty(Ze, "__esModule", { value: !0 });
const Lo = Pt, Io = Ot, $o = Tt, Ko = Ae, Ao = Ve, Eo = St, Vo = Be, Uo = {
name: "Cascader",
common: Ko.commonDark,
peers: {
InternalSelectMenu: Io.internalSelectMenuDark,
InternalSelection: $o.internalSelectionDark,
Scrollbar: Lo.scrollbarDark,
Checkbox: Ao.checkboxDark,
Empty: Eo.emptyLight
},
self: Vo.self
};
Ze.default = Uo;
(function(e) {
var i = K && K.__importDefault || function(c) {
return c && c.__esModule ? c : { default: c };
};
Object.defineProperty(e, "__esModule", { value: !0 }), e.cascaderLight = e.cascaderDark = void 0;
var l = Ze;
Object.defineProperty(e, "cascaderDark", { enumerable: !0, get: function() {
return i(l).default;
} });
var a = Be;
Object.defineProperty(e, "cascaderLight", { enumerable: !0, get: function() {
return i(a).default;
} });
})(Bt);
var nt = {}, rt = {}, lt = {}, It = {}, $t = {}, at = {};
(function(e) {
Object.defineProperty(e, "__esModule", { value: !0 }), e.checkboxGroupProps = e.checkboxGroupInjectionKey = void 0;
const i = Ee, l = fe, a = De, c = we;
e.checkboxGroupInjectionKey = (0, c.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(o) {
process.env.NODE_ENV !== "production" && (0, l.watchEffect)(() => {
o.onChange !== void 0 && (0, c.warnOnce)("checkbox-group", "`on-change` is deprecated, please use `on-update:value` instead.");
});
const { mergedClsPrefixRef: C } = (0, a.useConfig)(o), m = (0, a.useFormItem)(o), { mergedSizeRef: p, mergedDisabledRef: b } = m, F = (0, l.ref)(o.defaultValue), I = (0, l.computed)(() => o.value), E = (0, i.useMergedState)(I, F), X = (0, l.computed)(() => {
var n;
return ((n = E.value) === null || n === void 0 ? void 0 : n.length) || 0;
}), V = (0, l.computed)(() => Array.isArray(E.value) ? new Set(E.value) : /* @__PURE__ */ new Set());
function g(n, k) {
const { nTriggerFormInput: s, nTriggerFormChange: y } = m, { onChange: M, "onUpdate:value": T, onUpdateValue: L } = o;
if (Array.isArray(E.value)) {
const O = Array.from(E.value), N = O.findIndex((U) => U === k);
n ? ~N || (O.push(k), L && (0, c.call)(L, O, {
actionType: "check",
value: k
}), T && (0, c.call)(T, O, {
actionType: "check",
value: k
}), s(), y(), F.value = O, M && (0, c.call)(M, O)) : ~N && (O.splice(N, 1), L && (0, c.call)(L, O, {
actionType: "uncheck",
value: k
}), T && (0, c.call)(T, O, {
actionType: "uncheck",
value: k
}), M && (0, c.call)(M, O), F.value = O, s(), y());
} else
n ? (L && (0, c.call)(L, [k], {
actionType: "check",
value: k
}), T && (0, c.call)(T, [k], {
actionType: "check",
value: k
}), M && (0, c.call)(M, [k]), F.value = [k], s(), y()) : (L && (0, c.call)(L, [], {
actionType: "uncheck",
value: k
}), T && (0, c.call)(T, [], {
actionType: "uncheck",
value: k
}), M && (0, c.call)(M, []), F.value = [], s(), y());
}
return (0, l.provide)(e.checkboxGroupInjectionKey, {
checkedCountRef: X,
maxRef: (0, l.toRef)(o, "max"),
minRef: (0, l.toRef)(o, "min"),
valueSetRef: V,
disabledRef: b,
mergedSizeRef: p,
toggleCheckbox: g
}), {
mergedClsPrefix: C
};
},
render() {
return (0, l.h)("div", { class: `${this.mergedClsPrefix}-checkbox-group`, role: "group" }, this.$slots);
}
});
})(at);
var ct = {};
Object.defineProperty(ct, "__esModule", { value: !0 });
const _t = fe;
ct.default = () => (0, _t.h)(
"svg",
{ viewBox: "0 0 64 64", class: "check-icon" },
(0, _t.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 it = {};
Object.defineProperty(it, "__esModule", { value: !0 });
const xt = fe;
it.default = () => (0, xt.h)(
"svg",
{ viewBox: "0 0 100 100", class: "line-icon" },
(0, xt.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 st = {};
Object.defineProperty(st, "__esModule", {
value: !0
});
const Ho = fo, u = Xe;
st.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, Ho.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 i = K && K.__importDefault || function(g) {
return g && g.__esModule ? g : { default: g };
};
Object.defineProperty(e, "__esModule", { value: !0 }), e.checkboxProps = void 0;
const l = so, a = je, c = Ee, o = fe, C = Re, m = De, p = uo, b = we, F = Ve, I = at, E = i(ct), X = i(it), V = i(st);
e.checkboxProps = Object.assign(Object.assign({}, m.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(g) {
process.env.NODE_ENV !== "production" && (0, o.watchEffect)(() => {
g.onChange && (0, b.warnOnce)("checkbox", "`on-change` is deprecated, please use `on-update:checked` instead.");
});
const n = (0, o.inject)(I.checkboxGroupInjectionKey, null), k = (0, o.ref)(null), { mergedClsPrefixRef: s, inlineThemeDisabled: y, mergedRtlRef: M, mergedComponentPropsRef: T } = (0, m.useConfig)(g), L = (0, o.ref)(g.defaultChecked), O = (0, o.toRef)(g, "checked"), N = (0, c.useMergedState)(O, L), U = (0, c.useMemo)(() => {
if (n) {
const h = n.valueSetRef.value;
return h && g.value !== void 0 ? h.has(g.value) : !1;
} else
return N.value === g.checkedValue;
}), re = (0, m.useFormItem)(g, {
mergedSize(h) {
var A, q;
const { size: Y } = g;
if (Y !== void 0)
return Y;
if (n) {
const { value: H } = n.mergedSizeRef;
if (H !== void 0)
return H;
}
if (h) {
const { mergedSize: H } = h;
if (H !== void 0)
return H.value;
}
const J = (q = (A = T == null ? void 0 : T.value) === null || A === void 0 ? void 0 : A.Checkbox) === null || q === void 0 ? void 0 : q.size;
return J || "medium";
},
mergedDisabled(h) {
const { disabled: A } = g;
if (A !== void 0)
return A;
if (n) {
if (n.disabledRef.value)
return !0;
const { maxRef: { value: q }, checkedCountRef: Y } = n;
if (q !== void 0 && Y.value >= q && !U.value)
return !0;
const { minRef: { value: J } } = n;
if (J !== void 0 && Y.value <= J && U.value)
return !0;
}
return h ? h.disabled.value : !1;
}
}), { mergedDisabledRef: v, mergedSizeRef: w } = re, D = (0, m.useTheme)("Checkbox", "-checkbox", V.default, F.checkboxLight, g, s);
function W(h) {
if (n && g.value !== void 0)
n.toggleCheckbox(!U.value, g.value);
else {
const { onChange: A, "onUpdate:checked": q, onUpdateChecked: Y } = g, { nTriggerFormInput: J, nTriggerFormChange: H } = re, oe = U.value ? g.uncheckedValue : g.checkedValue;
q && (0, b.call)(q, oe, h), Y && (0, b.call)(Y, oe, h), A && (0, b.call)(A, oe, h), J(), H(), L.value = oe;
}
}
function pe(h) {
v.value || W(h);
}
function le(h) {
if (!v.value)
switch (h.key) {
case " ":
case "Enter":
W(h);
}
}
function _e(h) {
switch (h.key) {
case " ":
h.preventDefault();
}
}
const Z = {
focus: () => {
var h;
(h = k.value) === null || h === void 0 || h.focus();
},
blur: () => {
var h;
(h = k.value) === null || h === void 0 || h.blur();
}
}, se = (0, p.useRtl)("Checkbox", M, s), ee = (0, o.computed)(() => {
const { value: h } = w, { common: { cubicBezierEaseInOut: A }, self: { borderRadius: q, color: Y, colorChecked: J, colorDisabled: H, colorTableHeader: oe, colorTableHeaderModal: he, colorTableHeaderPopover: P, checkMarkColor: Q, checkMarkColorDisabled: ve, border: me, borderFocus: ae, borderDisabled: Se, borderChecked: ce, boxShadowFocus: ze, textColor: Le, textColorDisabled: de, checkMarkColorDisabledChecked: be, colorDisabledChecked: ke, borderDisabledChecked: Pe, labelPadding: Ie, labelLineHeight: Te, labelFontWeight: He, [(0, b.createKey)("fontSize", h)]: qe, [(0, b.createKey)("size", h)]: Ge } } = D.value;
return {
"--n-label-line-height": Te,
"--n-label-font-weight": He,
"--n-size": Ge,
"--n-bezier": A,
"--n-border-radius": q,
"--n-border": me,
"--n-border-checked": ce,
"--n-border-focus": ae,
"--n-border-disabled": Se,
"--n-border-disabled-checked": Pe,
"--n-box-shadow-focus": ze,
"--n-color": Y,
"--n-color-checked": J,
"--n-color-table": oe,
"--n-color-table-modal": he,
"--n-color-table-popover": P,
"--n-color-disabled": H,
"--n-color-disabled-checked": ke,
"--n-text-color": Le,
"--n-text-color-disabled": de,
"--n-check-mark-color": Q,
"--n-check-mark-color-disabled": ve,
"--n-check-mark-color-disabled-checked": be,
"--n-font-size": qe,
"--n-label-padding": Ie
};
}), $ = y ? (0, m.useThemeClass)("checkbox", (0, o.computed)(() => w.value[0]), ee, g) : void 0;
return Object.assign(re, Z, {
rtlEnabled: se,
selfRef: k,
mergedClsPrefix: s,
mergedDisabled: v,
renderedChecked: U,
mergedTheme: D,
labelId: (0, a.createId)(),
handleClick: pe,
handleKeyUp: le,
handleKeyDown: _e,
cssVars: y ? void 0 : ee,
themeClass: $ == null ? void 0 : $.themeClass,
onRender: $ == null ? void 0 : $.onRender
});
},
render() {
var g;
const { $slots: n, renderedChecked: k, mergedDisabled: s, indeterminate: y, privateInsideTable: M, cssVars: T, labelId: L, label: O, mergedClsPrefix: N, focusable: U, handleKeyUp: re, handleKeyDown: v, handleClick: w } = this;
(g = this.onRender) === null || g === void 0 || g.call(this);
const D = (0, b.resolveWrappedSlot)(n.default, (W) => O || W ? (0, o.h)("span", { class: `${N}-checkbox__label`, id: L }, O || W) : null);
return (0, o.h)(
"div",
{ ref: "selfRef", class: [
`${N}-checkbox`,
this.themeClass,
this.rtlEnabled && `${N}-checkbox--rtl`,
k && `${N}-checkbox--checked`,
s && `${N}-checkbox--disabled`,
y && `${N}-checkbox--indeterminate`,
M && `${N}-checkbox--inside-table`,
D && `${N}-checkbox--show-label`
], tabindex: s || !U ? void 0 : 0, role: "checkbox", "aria-checked": y ? "mixed" : k, "aria-labelledby": L, style: T, onKeyup: re, onKeydown: v, onClick: w, onMousedown: () => {
(0, l.on)("selectstart", window, (W) => {
W.preventDefault();
}, {
once: !0
});
} },
(0, o.h)(
"div",
{ class: `${N}-checkbox-box-wrapper` },
" ",
(0, o.h)(
"div",
{ class: `${N}-checkbox-box` },
(0, o.h)(C.NIconSwitchTransition, null, {
default: () => this.indeterminate ? (0, o.h)("div", { key: "indeterminate", class: `${N}-checkbox-icon` }, (0, X.default)()) : (0, o.h)("div", { key: "check", class: `${N}-checkbox-icon` }, (0, E.default)())
}),
(0, o.h)("div", { class: `${N}-checkbox-box__border` })
)
),
D
);
}
});
})($t);
(function(e) {
var i = K && K.__importDefault || function(c) {
return c && c.__esModule ? c : { default: c };
};
Object.defineProperty(e, "__esModule", { value: !0 }), e.NCheckboxGroup = e.checkboxGroupProps = e.NCheckbox = e.checkboxProps = void 0;
var l = $t;
Object.defineProperty(e, "checkboxProps", { enumerable: !0, get: function() {
return l.checkboxProps;
} }), Object.defineProperty(e, "NCheckbox", { enumerable: !0, get: function() {
return i(l).default;
} });
var a = at;
Object.defineProperty(e, "checkboxGroupProps", { enumerable: !0, get: function() {
return a.checkboxGroupProps;
} }), Object.defineProperty(e, "NCheckboxGroup", { enumerable: !0, get: function() {
return i(a).default;
} });
})(It);
var ge = {};
Object.defineProperty(ge, "__esModule", { value: !0 });
ge.cascaderInjectionKey = void 0;
const qo = we;
ge.cascaderInjectionKey = (0, qo.createInjectionKey)("n-cascader");
Object.defineProperty(lt, "__esModule", { value: !0 });
const Go = je, Ne = Ee, z = fe, Je = Re, Ct = ho, Wo = It, Yo = ge;
lt.default = (0, z.defineComponent)({
name: "NCascaderOption",
props: {
tmNode: {
type: Object,
required: !0
}
},
setup(e) {
const { expandTriggerRef: i, remoteRef: l, multipleRef: a, mergedValueRef: c, checkedKeysRef: o, indeterminateKeysRef: C, hoverKeyPathRef: m, keyboardKeyRef: p, loadingKeySetRef: b, cascadeRef: F, mergedCheckStrategyRef: I, onLoadRef: E, mergedClsPrefixRef: X, mergedThemeRef: V, labelFieldRef: g, showCheckboxRef: n, renderPrefixRef: k, renderSuffixRef: s, spinPropsRef: y, updateHoverKey: M, updateKeyboardKey: T, addLoadingKey: L, deleteLoadingKey: O, closeMenu: N, doCheck: U, doUncheck: re, renderLabelRef: v } = (0, z.inject)(Yo.cascaderInjectionKey), w = (0, z.computed)(() => e.tmNode.key), D = (0, z.computed)(() => {
const { value: P } = i, { value: Q } = l;
return !Q && P === "hover";
}), W = (0, z.computed)(() => {
if (D.value)
return J;
}), pe = (0, z.computed)(() => {
if (D.value)
return H;
}), le = (0, Ne.useMemo)(() => {
const { value: P } = a;
return P ? o.value.includes(w.value) : c.value === w.value;
}), _e = (0, Ne.useMemo)(() => a.value ? C.value.includes(w.value) : !1), Z = (0, Ne.useMemo)(() => m.value.includes(w.value)), se = (0, Ne.useMemo)(() => {
const { value: P } = p;
return P === null ? !1 : P === w.value;
}), ee = (0, Ne.useMemo)(() => l.value ? b.value.has(w.value) : !1), $ = (0, z.computed)(() => e.tmNode.isLeaf), h = (0, z.computed)(() => e.tmNode.disabled), A = (0, z.computed)(() => e.tmNode.rawNode[g.value]), q = (0, z.computed)(() => e.tmNode.shallowLoaded);
function Y(P) {
if (h.value)
return;
const { value: Q } = l, { value: ve } = b, { value: me } = E, { value: ae } = w, { value: Se } = $, { value: ce } = q;
(0, Go.happensIn)(P, "checkbox") || (Q && !ce && !ve.has(ae) && me && (L(ae), me(e.tmNode.rawNode).then(() => {
O(ae);
}).catch(() => {
O(ae);
})), M(ae), T(ae)), Se && he();
}
function J() {
if (!D.value || h.value)
return;
const { value: P } = w;
M(P), T(P);
}
function H() {
D.value && J();
}
function oe() {
const { value: P } = $;
P || he();
}
function he() {
const { value: P } = a, { value: Q } = w;
P ? _e.value || le.value ? re(Q) : U(Q) : (U(Q), N(!0));
}
return {
checkStrategy: I,
multiple: a,
cascade: F,
checked: le,
indeterminate: _e,
hoverPending: Z,
keyboardPending: se,
isLoading: ee,
showCheckbox: n,
isLeaf: $,
disabled: h,
label: A,
mergedClsPrefix: X,
mergedTheme: V,
spinProps: y,
handleClick: Y,
handleCheckboxUpdateValue: oe,
mergedHandleMouseEnter: W,
mergedHandleMouseMove: pe,
renderLabel: v,
renderPrefix: k,
renderSuffix: s
};
},
render() {
const { mergedClsPrefix: e, showCheckbox: i, renderLabel: l, renderPrefix: a, renderSuffix: c } = this;
let o = null;
if (i || a) {
const p = this.showCheckbox ? (0, z.h)(Wo.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;
o = (0, z.h)("div", { class: `${e}-cascader-option__prefix` }, a ? a({
option: this.tmNode.rawNode,
checked: this.checked,
node: p
}) : p);
}
let C = null;
const m = (0, z.h)("div", { class: `${e}-cascader-option-icon-placeholder` }, this.isLeaf ? this.checkStrategy === "child" && !(this.multiple && this.cascade) ? (0, z.h)(z.Transition, { name: "fade-in-scale-up-transition" }, {
default: () => this.checked ? (0, z.h)(Je.NBaseIcon, { clsPrefix: e, class: `${e}-cascader-option-icon ${e}-cascader-option-icon--checkmark` }, { default: () => (0, z.h)(Ct.CheckmarkIcon, null) }) : null
}) : null : (0, z.h)(Je.NBaseLoading, Object.assign({ clsPrefix: e, scale: 0.85, strokeWidth: 24, show: this.isLoading, class: `${e}-cascader-option-icon` }, this.spinProps), {
default: () => (0, z.h)(Je.NBaseIcon, { clsPrefix: e, key: "arrow", class: `${e}-cascader-option-icon ${e}-cascader-option-icon--arrow` }, {
default: () => (0, z.h)(Ct.ChevronRightIcon, null)
})
}));
return C = (0, z.h)("div", { class: `${e}-cascader-option__suffix` }, c ? c({
option: this.tmNode.rawNode,
checked: this.checked,
node: m
}) : m), (0, z.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 },
o,
(0, z.h)("span", { class: `${e}-cascader-option__label` }, l ? l(this.tmNode.rawNode, this.checked) : this.label),
C
);
}
});
var Jo = K && K.__importDefault || function(e) {
return e && e.__esModule ? e : { default: e };
};
Object.defineProperty(rt, "__esModule", { value: !0 });
const Qo = je, ie = fe, Xo = Mt, Zo = Re, wt = Jo(lt), en = ge;
rt.default = (0, ie.defineComponent)({
name: "CascaderSubmenu",
props: {
depth: {
type: Number,
required: !0
},
tmNodes: {
type: Array,
required: !0
}
},
setup() {
const { virtualScrollRef: e, mergedClsPrefixRef: i, mergedThemeRef: l, optionHeightRef: a } = (0, ie.inject)(en.cascaderInjectionKey), c = (0, ie.ref)(null), o = (0, ie.ref)(null), C = {
scroll(m, p) {
var b, F;
e.value ? (b = o.value) === null || b === void 0 || b.scrollTo({
index: m
}) : (F = c.value) === null || F === void 0 || F.scrollTo({
index: m,
elSize: p
});
}
};
return Object.assign({
mergedClsPrefix: i,
mergedTheme: l,
scrollbarInstRef: c,
vlInstRef: o,
virtualScroll: e,
itemSize: (0, ie.computed)(() => (0, Qo.depx)(a.value)),
handleVlScroll: () => {
var m;
(m = c.value) === null || m === void 0 || m.sync();
},
getVlContainer: () => {
var m;
return (m = o.value) === null || m === void 0 ? void 0 : m.listElRef;
},
getVlContent: () => {
var m;
return (m = o.value) === null || m === void 0 ? void 0 : m.itemsElRef;
}
}, C);
},
render() {
const { mergedClsPrefix: e, mergedTheme: i, virtualScroll: l } = this;
return (0, ie.h)(
"div",
{ class: [
l && `${e}-cascader-submenu--virtual`,
`${e}-cascader-submenu`
] },
(0, ie.h)(Zo.NScrollbar, { ref: "scrollbarInstRef", theme: i.peers.Scrollbar, themeOverrides: i.peerOverrides.Scrollbar, container: l ? this.getVlContainer : void 0, content: l ? this.getVlContent : void 0 }, {
default: () => l ? (0, ie.h)(Xo.VirtualList, { items: this.tmNodes, itemSize: this.itemSize, onScroll: this.handleVlScroll, showScrollbar: !1, ref: "vlInstRef" }, {
default: ({ item: a }) => (0, ie.h)(wt.default, { key: a.key, tmNode: a })
}) : this.tmNodes.map((a) => (0, ie.h)(wt.default, { key: a.key, tmNode: a }))
})
);
}
});
var Kt = K && K.__importDefault || function(e) {
return e && e.__esModule ? e : { default: e };
};
Object.defineProperty(nt, "__esModule", { value: !0 });
const tn = Nt, G = fe, on = Re, nn = Kt(vo), rn = De, Qe = we, ln = mo, an = Kt(rt), cn = ge;
nt.default = (0, G.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: i, isMountedRef: l, mergedClsPrefixRef: a, syncCascaderMenuPosition: c, handleCascaderMenuClickOutside: o, mergedThemeRef: C, getColumnStyleRef: m } = (0, G.inject)(cn.cascaderInjectionKey), { mergedComponentPropsRef: p } = (0, rn.useConfig)(), b = [], F = (0, G.ref)(null), I = (0, G.ref)(null);
function E() {
c();
}
(0, Qe.useOnResize)(I, E);
function X(s) {
var y;
const { value: { loadingRequiredMessage: M } } = i;
(y = F.value) === null || y === void 0 || y.showOnce(M(s));
}
function V(s) {
o(s);
}
function g(s) {
const { value: y } = I;
y && (y.contains(s.relatedTarget) || e.onFocus(s));
}
function n(s) {
const { value: y } = I;
y && (y.contains(s.relatedTarget) || e.onBlur(s));
}
const k = {
scroll(s, y, M) {
const T = b[s];
T && T.scroll(y, M);
},
showErrorMessage: X
};
return Object.assign({
isMounted: l,
mergedClsPrefix: a,
selfElRef: I,
submenuInstRefs: b,
maskInstRef: F,
mergedTheme: C,
mergedRenderEmpty: (0, G.computed)(() => {
var s, y;
return (y = (s = p == null ? void 0 : p.value) === null || s === void 0 ? void 0 : s.Cascader) === null || y === void 0 ? void 0 : y.renderEmpty;
}),
getColumnStyle: m,
handleFocusin: g,
handleFocusout: n,
handleClickOutside: V
}, k);
},
render() {
const { submenuInstRefs: e, mergedClsPrefix: i, mergedTheme: l } = this;
return (0, G.h)(G.Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted }, {
default: () => this.show ? (0, G.withDirectives)((0, G.h)(
"div",
{ tabindex: "0", ref: "selfElRef", class: `${i}-cascader-menu`, onMousedown: this.onMousedown, onFocusin: this.handleFocusin, onFocusout: this.handleFocusout, onKeydown: this.onKeydown },
this.menuModel[0].length ? (0, G.h)(
"div",
{ class: `${i}-cascader-submenu-wrapper` },
this.menuModel.map((a, c) => {
var o;
return (0, G.h)(an.default, { style: (o = this.getColumnStyle) === null || o === void 0 ? void 0 : o.call(this, { level: c }), ref: (C) => {
C && (e[c] = C);
}, key: c, tmNodes: a, depth: c + 1 });
}),
(0, G.h)(on.NBaseMenuMask, { clsPrefix: i, ref: "maskInstRef" })
) : (0, G.h)("div", { class: `${i}-cascader-menu__empty` }, (0, Qe.resolveSlot)(this.$slots.empty, () => {
var a;
return [
((a = this.mergedRenderEmpty) === null || a === void 0 ? void 0 : a.call(this)) || (0, G.h)(ln.NEmpty, { theme: l.peers.Empty, themeOverrides: l.peerOverrides.Empty })
];
})),
(0, Qe.resolveWrappedSlot)(this.$slots.action, (a) => a && (0, G.h)("div", { class: `${i}-cascader-menu-action`, "data-action": !0 }, a)),
(0, G.h)(nn.default, { onFocus: this.onTabout })
), [
[
tn.clickoutside,
this.handleClickOutside,
void 0,
{ capture: !0 }
]
]) : null
});
}
});
var dt = {}, Me = {};
Object.defineProperty(Me, "__esModule", { value: !0 });
Me.getRawNodePath = sn;
Me.createSelectOptions = dn;
Me.getPathLabel = At;
function sn(e) {
return e ? e.map((i) => i.rawNode) : null;
}
function dn(e, i, l, a) {
const c = [], o = [];
function C(m) {
for (const p of m) {
if (p.disabled)
continue;
const { rawNode: b } = p;
o.push(b), (p.isLeaf || !i) && c.push({
label: At(p, a, l),
value: p.key,
rawNode: p.rawNode,
path: Array.from(o)
}), !p.isLeaf && p.children && C(p.children), o.pop();
}
}
return C(e), c;
}
function At(e, i, l) {
const a = [];
for (; e; )
a.push(e.rawNode[l]), e = e.parent;
return a.reverse().join(i);
}
Object.defineProperty(dt, "__esModule", { value: !0 });
const un = jt, fn = Nt, ne = fe, hn = Re, vn = we, mn = bo, bn = ge, gn = Me;
dt.default = (0, ne.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: i, mergedValueRef: l, mergedClsPrefixRef: a, mergedThemeRef: c, mergedCheckStrategyRef: o, slots: C, syncSelectMenuPosition: m, closeMenu: p, handleSelectMenuClickOutside: b, doUncheck: F, doCheck: I, scrollbarPropsRef: E, clearPattern: X } = (0, ne.inject)(bn.cascaderInjectionKey), V = (0, ne.ref)(null), g = (0, ne.computed)(() => (0, gn.createSelectOptions)(e.tmNodes, o.value === "child", e.labelField, e.separator)), n = (0, ne.computed)(() => {
const { filter: v } = e;
if (v)
return v;
const { labelField: w } = e;
return (D, W, pe) => pe.some((le) => le[w] && ~le[w].toLowerCase().indexOf(D.toLowerCase()));
}), k = (0, ne.computed)(() => {
const { pattern: v } = e, { value: w } = n;
return (v ? g.value.filter((D) => w(v, D.rawNode, D.path)) : g.value).map((D) => ({
value: D.value,
label: D.label
}));
}), s = (0, ne.computed)(() => (0, un.createTreeMate)(k.value, (0, mn.createTmOptions)("value", "children")));
function y() {
m();
}
function M(v) {
T(v);
}
function T(v) {
if (e.multiple) {
const { value: w } = l;
Array.isArray(w) ? w.includes(v.key) ? F(v.key) : I(v.key) : w === null && I(v.key), X();
} else
I(v.key), p(!0);
}
function L() {
var v;
(v = V.value) === null || v === void 0 || v.prev();
}
function O() {
var v;
(v = V.value) === null || v === void 0 || v.next();
}
function N() {
var v;
if (V) {
const w = (v = V.value) === null || v === void 0 ? void 0 : v.getPendingTmNode();
return w && T(w), !0;
}
return !1;
}
function U(v) {
b(v);
}
return Object.assign({
isMounted: i,
mergedTheme: c,
mergedClsPrefix: a,
menuInstRef: V,
selectTreeMate: s,
handleResize: y,
handleToggle: M,
handleClickOutside: U,
cascaderSlots: C,
scrollbarProps: E
}, {
prev: L,
next: O,
enter: N
});
},
render() {
const { mergedClsPrefix: e, isMounted: i, mergedTheme: l, cascaderSlots: a } = this;
return (0, ne.h)(ne.Transition, { name: "fade-in-scale-up-transition", appear: i }, {
default: () => this.show ? (0, ne.withDirectives)((0, ne.h)(hn.NInternalSelectMenu, { ref: "menuInstRef", onResize: this.handleResize, clsPrefix: e, class: `${e}-cascader-menu`, autoPending: !0, themeOverrides: l.peerOverrides.InternalSelectMenu, theme: l.peers.InternalSelectMenu, treeMate: this.selectTreeMate, multiple: this.multiple, value: this.value, onToggle: this.handleToggle, scrollbarProps: this.scrollbarProps }, {
empty: () => (0, vn.resolveSlot)(a["not-found"], () => [])
}), [
[
fn.clickoutside,
this.handleClickOutside,
void 0,
{ capture: !0 }
]
]) : null
});
}
});
var ut = {};
Object.defineProperty(ut, "__esModule", {
value: !0
});
const Rt = go, S = Xe;
ut.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, Rt.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, Rt.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 i = K && K.__importDefault || function(n) {
return n && n.__esModule ? n : { default: n };
};
Object.defineProperty(e, "__esModule", { value: !0 }), e.cascaderProps = void 0;
const l = je, a = jt, c = Ee, o = fe, C = Mt, m = Re, p = De, b = we, F = Bt, I = i(nt), E = i(dt), X = ge, V = i(ut), g = Me;
e.cascaderProps = Object.assign(Object.assign({}, p.useTheme.props), {
allowCheckingNotLoaded: Boolean,
to: b.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,
spinProps: Object,
renderPrefix: Function,
renderSuffix: Function,
scrollbarProps: Object,
// deprecated
onChange: [Function, Array]
}), e.default = (0, o.defineComponent)({
name: "Cascader",
props: e.cascaderProps,
slots: Object,
setup(n, { slots: k }) {
process.env.NODE_ENV !== "production" && (0, o.watchEffect)(() => {
n.leafOnly && (0, b.warnOnce)("cascader", '`leaf-only` is deprecated, please use `check-strategy="child"` instead'), n.onChange !== void 0 && (0, b.warnOnce)("cascader", "`on-change` is deprecated, please use `on-update:value` instead.");
});
const { mergedBorderedRef: s, mergedClsPrefixRef: y, namespaceRef: M, inlineThemeDisabled: T, mergedComponentPropsRef: L } = (0, p.useConfig)(n), O = (0, p.useTheme)("Cascader", "-cascader", V.default, F.cascaderLight, n, y), { localeRef: N } = (0, p.useLocale)("Cascader"), U = (0, o.ref)(n.defaultValue), re = (0, o.computed)(() => n.value), v = (0, c.useMergedState)(re, U), w = (0, o.computed)(() => n.leafOnly ? "child" : n.checkStrategy), D = (0, o.ref)(""), W = (0, p.useFormItem)(n, {
mergedSize: (t) => {
var r, d;
const { size: x } = n;
if (x)
return x;
const { mergedSize: f } = t || {};
if (f != null && f.value)
return f.value;
const j = (d = (r = L == null ? void 0 : L.value) === null || r === void 0 ? void 0 : r.Cascader) === null || d === void 0 ? void 0 : d.size;
return j || "medium";
}
}), { mergedSizeRef: pe, mergedDisabledRef: le, mergedStatusRef: _e } = W, Z = (0, o.ref)(null), se = (0, o.ref)(null), ee = (0, o.ref)(null), $ = (0, o.ref)(null), h = (0, o.ref)(null), A = (0, o.ref)(/* @__PURE__ */ new Set()), q = (0, o.ref)(null), Y = (0, o.ref)(null), J = (0, b.useAdjustedTo)(n), H = (0, o.ref)(!1), oe = (t) => {
A.value.add(t);
}, he = (t) => {
A.value.delete(t);
}, P = (0, o.computed)(() => {
const { valueField: t, childrenField: r, disabledField: d } = n;
return (0, a.createTreeMate)(n.options, {
getDisabled(x) {
return x[d];
},
getKey(x) {
return x[t];
},
getChildren(x) {
return x[r];
}
});
}), Q = (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)(() => Q.value.checkedKeys), me = (0, o.computed)(() => Q.value.indeterminateKeys), ae = (0, o.computed)(() => {
const { treeNodePath: t, treeNode: r } = P.value.getPath(h.value);
let d;
return r === null ? d = [P.value.treeNodes] : (d = t.map((x) => x.siblings), !r.isLeaf && !A.value.has(r.key) && r.children && d.push(r.children)), d;
}), Se = (0, o.computed)(() => {
const { keyPath: t } = P.value.getPath(h.value);
return t;
}), ce = (0, o.computed)(() => O.value.self.optionHeight);
(0, o.isReactive)(n.options) && (0, o.watch)(n.options, (t, r) => {
t !== r && (h.value = null, $.value = null);
});
const ze = (0, o.ref)(!1);
function Le(t) {
const { onUpdateShow: r, "onUpdate:show": d } = n;
r && (0, b.call)(r, t), d && (0, b.call)(d, t), ze.value = t;
}
function de(t, r, d) {
const { onUpdateValue: x, "onUpdate:value": f, onChange: j } = n, { nTriggerFormInput: _, nTriggerFormChange: B } = W;
x && (0, b.call)(x, t, r, d), f && (0, b.call)(f, t, r, d), j && (0, b.call)(j, t, r, d), U.value = t, _(), B();
}
function be(t) {
$.value = t;
}
function ke(t) {
h.value = t;
}
function Pe(t) {
const { value: { getNode: r } } = P;
return t.map((d) => {
var x;
return ((x = r(d)) === null || x === void 0 ? void 0 : x.rawNode) || null;
});
}
function Ie(t) {
var r;
const { cascade: d, multiple: x, filterable: f } = n, { value: { check: j, getNode: _, getPath: B } } = P;
if (x)
try {
const { checkedKeys: R } = j(t, Q.value.checkedKeys, {
cascade: d,
checkStrategy: w.value,
allowNotLoaded: n.allowCheckingNotLoaded