vft 0.0.503 → 0.0.504
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/cascader/cascader.vue2.js +217 -211
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +87 -83
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +55 -39
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/cascader/cascader.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/theme-style/dark/css-vars.css +1 -1
- package/theme-style/display.css +1 -1
- package/theme-style/src/common/icon.scss +3 -0
- package/theme-style/src/multiple-tabs.scss +8 -0
- package/theme-style/vft-affix.css +1 -1
- package/theme-style/vft-alert.css +1 -1
- package/theme-style/vft-aside.css +1 -1
- package/theme-style/vft-autocomplete.css +1 -1
- package/theme-style/vft-avatar-stack.css +1 -1
- package/theme-style/vft-avatar.css +1 -1
- package/theme-style/vft-backtop.css +1 -1
- package/theme-style/vft-badge.css +1 -1
- package/theme-style/vft-breadcrumb.css +1 -1
- package/theme-style/vft-button-group.css +1 -1
- package/theme-style/vft-button.css +1 -1
- package/theme-style/vft-calendar.css +1 -1
- package/theme-style/vft-card.css +1 -1
- package/theme-style/vft-carousel-item.css +1 -1
- package/theme-style/vft-carousel.css +1 -1
- package/theme-style/vft-cascader-panel.css +1 -1
- package/theme-style/vft-cascader.css +1 -1
- package/theme-style/vft-check-tag.css +1 -1
- package/theme-style/vft-checkbox-button.css +1 -1
- package/theme-style/vft-checkbox-group.css +1 -1
- package/theme-style/vft-checkbox.css +1 -1
- package/theme-style/vft-clamp-toggle.css +1 -1
- package/theme-style/vft-col.css +1 -1
- package/theme-style/vft-collapse.css +1 -1
- package/theme-style/vft-color-picker.css +1 -1
- package/theme-style/vft-container.css +1 -1
- package/theme-style/vft-date-picker.css +1 -1
- package/theme-style/vft-date-time-select.css +1 -1
- package/theme-style/vft-descriptions-item.css +1 -1
- package/theme-style/vft-descriptions.css +1 -1
- package/theme-style/vft-dialog.css +1 -1
- package/theme-style/vft-divider.css +1 -1
- package/theme-style/vft-drawer.css +1 -1
- package/theme-style/vft-dropdown.css +1 -1
- package/theme-style/vft-empty.css +1 -1
- package/theme-style/vft-footer-layout.css +1 -1
- package/theme-style/vft-footer.css +1 -1
- package/theme-style/vft-form.css +1 -1
- package/theme-style/vft-full-screen.css +1 -1
- package/theme-style/vft-header-layout.css +1 -1
- package/theme-style/vft-header.css +1 -1
- package/theme-style/vft-horizontal-menu.css +1 -1
- package/theme-style/vft-icon-text.css +1 -1
- package/theme-style/vft-icon.css +1 -1
- package/theme-style/vft-iframe-layout.css +1 -1
- package/theme-style/vft-image-viewer.css +1 -1
- package/theme-style/vft-image.css +1 -1
- package/theme-style/vft-input-number.css +1 -1
- package/theme-style/vft-input-tag.css +1 -1
- package/theme-style/vft-input.css +1 -1
- package/theme-style/vft-link.css +1 -1
- package/theme-style/vft-list-cell.css +1 -1
- package/theme-style/vft-loading.css +1 -1
- package/theme-style/vft-logo.css +1 -1
- package/theme-style/vft-main.css +1 -1
- package/theme-style/vft-md-code-demo.css +1 -1
- package/theme-style/vft-md-code-tabs.css +1 -1
- package/theme-style/vft-md-comment.css +1 -1
- package/theme-style/vft-md-container.css +1 -1
- package/theme-style/vft-md-tabs.css +1 -1
- package/theme-style/vft-md-vue-playground.css +1 -1
- package/theme-style/vft-menu.css +1 -1
- package/theme-style/vft-message-box.css +1 -1
- package/theme-style/vft-message.css +1 -1
- package/theme-style/vft-multiple-tabs.css +1 -1
- package/theme-style/vft-notification.css +1 -1
- package/theme-style/vft-option-group.css +1 -1
- package/theme-style/vft-option-item.css +1 -1
- package/theme-style/vft-option.css +1 -1
- package/theme-style/vft-overlay.css +1 -1
- package/theme-style/vft-page-wrapper.css +1 -1
- package/theme-style/vft-pagination.css +1 -1
- package/theme-style/vft-popconfirm.css +1 -1
- package/theme-style/vft-popover.css +1 -1
- package/theme-style/vft-popper.css +1 -1
- package/theme-style/vft-progress.css +1 -1
- package/theme-style/vft-radio-button.css +1 -1
- package/theme-style/vft-radio-group.css +1 -1
- package/theme-style/vft-rate.css +1 -1
- package/theme-style/vft-result.css +1 -1
- package/theme-style/vft-row.css +1 -1
- package/theme-style/vft-scrollbar.css +1 -1
- package/theme-style/vft-search.css +1 -1
- package/theme-style/vft-segmented.css +1 -1
- package/theme-style/vft-select-dropdown-v2.css +1 -1
- package/theme-style/vft-select-dropdown.css +1 -1
- package/theme-style/vft-select.css +1 -1
- package/theme-style/vft-side-menu.css +1 -1
- package/theme-style/vft-skeleton-item.css +1 -1
- package/theme-style/vft-skeleton.css +1 -1
- package/theme-style/vft-slider.css +1 -1
- package/theme-style/vft-space.css +1 -1
- package/theme-style/vft-spinner.css +1 -1
- package/theme-style/vft-statistic.css +1 -1
- package/theme-style/vft-step.css +1 -1
- package/theme-style/vft-steps.css +1 -1
- package/theme-style/vft-super-form.css +1 -1
- package/theme-style/vft-switch.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/theme-style/vft-tabs.css +1 -1
- package/theme-style/vft-tag.css +1 -1
- package/theme-style/vft-time-picker.css +1 -1
- package/theme-style/vft-time-select.css +1 -1
- package/theme-style/vft-timeline-item.css +1 -1
- package/theme-style/vft-timeline.css +1 -1
- package/theme-style/vft-transfer.css +1 -1
- package/theme-style/vft-tree-select.css +1 -1
- package/theme-style/vft-tree.css +1 -1
- package/theme-style/vft-virtual-list.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cloneDeep as
|
|
3
|
-
import { useResizeObserver as
|
|
4
|
-
import { focusNode as
|
|
5
|
-
import { isPromise as
|
|
6
|
-
import { debugWarn as
|
|
1
|
+
import { defineComponent as Se, useAttrs as Ye, ref as c, computed as i, unref as s, watch as x, nextTick as N, onMounted as Ze, createBlock as E, openBlock as r, withCtx as v, createElementBlock as m, createCommentVNode as P, withDirectives as q, withModifiers as F, normalizeClass as d, renderSlot as V, createVNode as te, vShow as Te, Fragment as le, renderList as se, createElementVNode as z, toDisplayString as U, normalizeStyle as _e, createSlots as et, withKeys as tt, vModelText as lt } from "vue";
|
|
2
|
+
import { cloneDeep as st, debounce as ot } from "lodash-es";
|
|
3
|
+
import { useResizeObserver as at, useCssVar as nt } from "@vueuse/core";
|
|
4
|
+
import { focusNode as rt, getSibling as it } from "../../utils/dom/aria.js";
|
|
5
|
+
import { isPromise as ut, isClient as ct } from "@vft/utils";
|
|
6
|
+
import { debugWarn as pt } from "../../utils/error.js";
|
|
7
7
|
import "../config-provider/hooks/use-global-config.js";
|
|
8
8
|
import { EVENT_CODE as h } from "../../constants/aria.js";
|
|
9
|
-
import { UPDATE_MODEL_EVENT as
|
|
9
|
+
import { UPDATE_MODEL_EVENT as dt, CHANGE_EVENT as ft } from "../../constants/event.js";
|
|
10
10
|
import "../form/index.js";
|
|
11
|
-
import { VftCascaderPanel as
|
|
12
|
-
import { VftInput as
|
|
13
|
-
import { VftTooltip as
|
|
11
|
+
import { VftCascaderPanel as vt } from "../cascader-panel/index.js";
|
|
12
|
+
import { VftInput as mt } from "../input/index.js";
|
|
13
|
+
import { VftTooltip as Ee } from "../tooltip/index.js";
|
|
14
14
|
import { VftScrollbar as we } from "../scrollbar/index.js";
|
|
15
|
-
import { VftTag as
|
|
16
|
-
import { VftIcon as
|
|
17
|
-
import { ClickOutside as
|
|
18
|
-
import { useNamespace as
|
|
15
|
+
import { VftTag as $e } from "../tag/index.js";
|
|
16
|
+
import { VftIcon as oe } from "../icon/index.js";
|
|
17
|
+
import { ClickOutside as gt } from "@vft/directives";
|
|
18
|
+
import { useNamespace as Ve } from "../../hooks/use-namespace/index.js";
|
|
19
19
|
import "../../hooks/use-model-toggle/index.js";
|
|
20
20
|
import "@popperjs/core";
|
|
21
21
|
import "../../hooks/use-z-index/index.js";
|
|
22
|
-
import { useComposition as
|
|
23
|
-
import { useEmptyValues as
|
|
24
|
-
import { cascaderEmits as
|
|
25
|
-
import { useFormItem as
|
|
26
|
-
import { useFormSize as
|
|
27
|
-
const
|
|
28
|
-
name:
|
|
29
|
-
}),
|
|
30
|
-
...
|
|
31
|
-
props:
|
|
32
|
-
emits:
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
22
|
+
import { useComposition as ht } from "../../hooks/use-composition/index.js";
|
|
23
|
+
import { useEmptyValues as kt } from "../../hooks/use-empty-values/index.js";
|
|
24
|
+
import { cascaderEmits as Ct, cascaderProps as yt } from "./cascader.js";
|
|
25
|
+
import { useFormItem as bt } from "../form/hooks/use-form-item.js";
|
|
26
|
+
import { useFormSize as Tt } from "../form/hooks/use-form-common-props.js";
|
|
27
|
+
const Et = { key: 0 }, wt = ["placeholder"], $t = ["onClick"], Vt = "VftCascader", St = Se({
|
|
28
|
+
name: Vt
|
|
29
|
+
}), el = /* @__PURE__ */ Se({
|
|
30
|
+
...St,
|
|
31
|
+
props: yt,
|
|
32
|
+
emits: Ct,
|
|
33
|
+
setup(Ne, { expose: Pe, emit: De }) {
|
|
34
|
+
const a = Ne, C = De, Ie = {
|
|
35
35
|
modifiers: [
|
|
36
36
|
{
|
|
37
37
|
name: "arrowPosition",
|
|
@@ -44,47 +44,51 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
44
44
|
requires: ["arrow"]
|
|
45
45
|
}
|
|
46
46
|
]
|
|
47
|
-
},
|
|
48
|
-
let
|
|
49
|
-
const
|
|
47
|
+
}, ae = Ye();
|
|
48
|
+
let D = 0, G = 0;
|
|
49
|
+
const n = Ve("cascader"), j = Ve("input"), { form: xe, formItem: ne } = bt(), { valueOnClear: Fe } = kt(a), { isComposing: re, handleComposition: k } = ht({
|
|
50
50
|
afterComposition(e) {
|
|
51
51
|
const t = e.target?.value;
|
|
52
|
-
|
|
52
|
+
ee(t);
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
55
|
-
() =>
|
|
56
|
-
),
|
|
57
|
-
() =>
|
|
58
|
-
), T = i(() => !!
|
|
59
|
-
() => T.value ?
|
|
60
|
-
), O = i(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
}), A = c(null), S = c(null), ie = c(null), f = c(null), K = c(null), g = c(!1), ue = c(!1), y = c(!1), J = c(!1), B = c(""), w = c(""), $ = c([]), H = c([]), Q = c([]), ze = i(() => ae.style), b = i(() => a.disabled || xe?.disabled), ce = i(() => a.placeholder ?? "请选择"), Ae = i(
|
|
55
|
+
() => w.value || $.value.length > 0 || re.value ? "" : ce.value
|
|
56
|
+
), M = Tt(), pe = i(
|
|
57
|
+
() => M.value === "small" ? "small" : "default"
|
|
58
|
+
), T = i(() => !!a.props.multiple), de = i(() => !a.filterable || T.value), fe = i(
|
|
59
|
+
() => T.value ? w.value : B.value
|
|
60
|
+
), ve = [], O = i(() => {
|
|
61
|
+
const e = f.value;
|
|
62
|
+
if (!e)
|
|
63
|
+
return ve;
|
|
64
|
+
const t = e.checkedNodes, l = s(t);
|
|
65
|
+
return Array.isArray(l) && l.length ? l : ve;
|
|
66
|
+
}), Ke = i(() => !a.clearable || b.value || y.value ? !1 : !!O.value.length), L = i(() => {
|
|
67
|
+
const { showAllLevels: e, separator: t } = a, l = O.value;
|
|
64
68
|
return l.length ? T.value ? "" : l[0].calcText(e, t) : "";
|
|
65
|
-
}), Be = i(() =>
|
|
69
|
+
}), Be = i(() => ne?.validateState || ""), me = i({
|
|
66
70
|
get() {
|
|
67
|
-
return
|
|
71
|
+
return st(a.modelValue);
|
|
68
72
|
},
|
|
69
73
|
set(e) {
|
|
70
|
-
const t = e ??
|
|
71
|
-
C(
|
|
74
|
+
const t = e ?? Fe.value;
|
|
75
|
+
C(dt, t), C(ft, t), a.validateEvent && ne?.validate("change").catch((l) => pt(l));
|
|
72
76
|
}
|
|
73
77
|
}), He = i(() => [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
]),
|
|
79
|
-
b.value || (e = e ?? !g.value, e !== g.value && (g.value = e,
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
n.b(),
|
|
79
|
+
n.m(M.value),
|
|
80
|
+
n.is("disabled", b.value),
|
|
81
|
+
ae.class
|
|
82
|
+
]), Me = i(() => [j.e("icon"), n.is("reverse", g.value)]), Oe = i(() => n.is("focus", g.value || J.value)), ge = i(() => A.value?.popperRef?.contentRef), p = (e) => {
|
|
83
|
+
b.value || (e = e ?? !g.value, e !== g.value && (g.value = e, S.value?.input?.setAttribute("aria-expanded", `${e}`), e ? (I(), N(f.value?.scrollToExpandingNode)) : a.filterable && _(), C("visibleChange", e)));
|
|
84
|
+
}, I = () => {
|
|
85
|
+
N(() => {
|
|
86
|
+
A.value?.updatePopper();
|
|
83
87
|
});
|
|
84
|
-
},
|
|
88
|
+
}, X = () => {
|
|
85
89
|
y.value = !1;
|
|
86
|
-
},
|
|
87
|
-
const { showAllLevels: t, separator: l } =
|
|
90
|
+
}, Y = (e) => {
|
|
91
|
+
const { showAllLevels: t, separator: l } = a;
|
|
88
92
|
return {
|
|
89
93
|
node: e,
|
|
90
94
|
key: e.uid,
|
|
@@ -96,12 +100,12 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
96
100
|
}, R = (e) => {
|
|
97
101
|
const t = e.node;
|
|
98
102
|
t.doCheck(!1), f.value?.calculateCheckedValue(), C("removeTag", t.valueByOption);
|
|
99
|
-
},
|
|
100
|
-
switch (
|
|
103
|
+
}, Le = () => {
|
|
104
|
+
switch (a.showCheckedStrategy) {
|
|
101
105
|
case "child":
|
|
102
106
|
return O.value;
|
|
103
107
|
case "parent": {
|
|
104
|
-
const e =
|
|
108
|
+
const e = ke(!1), t = e.map((o) => o.value);
|
|
105
109
|
return e.filter(
|
|
106
110
|
(o) => !o.parent || !t.includes(o.parent.value)
|
|
107
111
|
);
|
|
@@ -111,57 +115,57 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
111
115
|
}
|
|
112
116
|
}, Re = () => {
|
|
113
117
|
if (!T.value) return;
|
|
114
|
-
const e =
|
|
115
|
-
if (e.forEach((o) => l.push(
|
|
116
|
-
e.slice(0,
|
|
117
|
-
const o = e.slice(
|
|
118
|
-
u && (
|
|
118
|
+
const e = Le(), t = [], l = [];
|
|
119
|
+
if (e.forEach((o) => l.push(Y(o))), H.value = l, e.length) {
|
|
120
|
+
e.slice(0, a.maxCollapseTags).forEach((W) => t.push(Y(W)));
|
|
121
|
+
const o = e.slice(a.maxCollapseTags), u = o.length;
|
|
122
|
+
u && (a.collapseTags ? t.push({
|
|
119
123
|
key: -1,
|
|
120
124
|
text: `+ ${u}`,
|
|
121
125
|
closable: !1,
|
|
122
126
|
isCollapseTag: !0
|
|
123
|
-
}) : o.forEach((
|
|
127
|
+
}) : o.forEach((W) => t.push(Y(W))));
|
|
124
128
|
}
|
|
125
129
|
$.value = t;
|
|
126
|
-
},
|
|
127
|
-
const { filterMethod: e, showAllLevels: t, separator: l } =
|
|
130
|
+
}, he = () => {
|
|
131
|
+
const { filterMethod: e, showAllLevels: t, separator: l } = a, o = f.value?.getFlattedNodes(!a.props.checkStrictly)?.filter((u) => u.isDisabled ? !1 : (u.calcText(t, l), e(u, fe.value)));
|
|
128
132
|
T.value && ($.value.forEach((u) => {
|
|
129
133
|
u.hitState = !1;
|
|
130
134
|
}), H.value.forEach((u) => {
|
|
131
135
|
u.hitState = !1;
|
|
132
|
-
})), y.value = !0,
|
|
133
|
-
},
|
|
136
|
+
})), y.value = !0, Q.value = o, I();
|
|
137
|
+
}, We = () => {
|
|
134
138
|
let e;
|
|
135
|
-
y.value &&
|
|
136
|
-
`.${
|
|
139
|
+
y.value && K.value ? e = K.value.$el.querySelector(
|
|
140
|
+
`.${n.e("suggestion-item")}`
|
|
137
141
|
) : e = f.value?.$el.querySelector(
|
|
138
|
-
`.${
|
|
142
|
+
`.${n.b("node")}[tabindex="-1"]`
|
|
139
143
|
), e && (e.focus(), !y.value && e.click());
|
|
140
|
-
},
|
|
141
|
-
const e =
|
|
142
|
-
if (!(!
|
|
144
|
+
}, Z = () => {
|
|
145
|
+
const e = S.value?.input, t = ie.value, l = K.value?.$el;
|
|
146
|
+
if (!(!ct || !e)) {
|
|
143
147
|
if (l) {
|
|
144
148
|
const o = l.querySelector(
|
|
145
|
-
`.${
|
|
149
|
+
`.${n.e("suggestion-list")}`
|
|
146
150
|
);
|
|
147
151
|
o.style.minWidth = `${e.offsetWidth}px`;
|
|
148
152
|
}
|
|
149
153
|
if (t) {
|
|
150
|
-
const { offsetHeight: o } = t, u = $.value.length > 0 ? `${Math.max(o,
|
|
151
|
-
e.style.height = u,
|
|
154
|
+
const { offsetHeight: o } = t, u = $.value.length > 0 ? `${Math.max(o, D) - 2}px` : `${D}px`;
|
|
155
|
+
e.style.height = u, I();
|
|
152
156
|
}
|
|
153
157
|
}
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
},
|
|
157
|
-
if (!
|
|
158
|
+
}, ke = (e) => f.value?.getCheckedNodes(e), qe = (e) => {
|
|
159
|
+
I(), C("expandChange", e);
|
|
160
|
+
}, Ue = (e) => {
|
|
161
|
+
if (!re.value)
|
|
158
162
|
switch (e.code) {
|
|
159
163
|
case h.enter:
|
|
160
164
|
case h.numpadEnter:
|
|
161
165
|
p();
|
|
162
166
|
break;
|
|
163
167
|
case h.down:
|
|
164
|
-
p(!0),
|
|
168
|
+
p(!0), N(We), e.preventDefault();
|
|
165
169
|
break;
|
|
166
170
|
case h.esc:
|
|
167
171
|
g.value === !0 && (e.preventDefault(), e.stopPropagation(), p(!1));
|
|
@@ -170,26 +174,26 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
170
174
|
p(!1);
|
|
171
175
|
break;
|
|
172
176
|
}
|
|
173
|
-
},
|
|
174
|
-
f.value?.clearCheckedNodes(), !g.value &&
|
|
175
|
-
},
|
|
176
|
-
const { value: e } =
|
|
177
|
-
B.value = e,
|
|
178
|
-
},
|
|
177
|
+
}, Ge = () => {
|
|
178
|
+
f.value?.clearCheckedNodes(), !g.value && a.filterable && _(), p(!1), C("clear");
|
|
179
|
+
}, _ = () => {
|
|
180
|
+
const { value: e } = L;
|
|
181
|
+
B.value = e, w.value = e;
|
|
182
|
+
}, je = (e) => {
|
|
179
183
|
const { checked: t } = e;
|
|
180
184
|
T.value ? f.value?.handleCheckChange(e, !t, !1) : (!t && f.value?.handleCheckChange(e, !0, !1), p(!1));
|
|
181
|
-
},
|
|
185
|
+
}, Je = (e) => {
|
|
182
186
|
const t = e.target, { code: l } = e;
|
|
183
187
|
switch (l) {
|
|
184
188
|
case h.up:
|
|
185
189
|
case h.down: {
|
|
186
190
|
e.preventDefault();
|
|
187
191
|
const o = l === h.up ? -1 : 1;
|
|
188
|
-
|
|
189
|
-
|
|
192
|
+
rt(
|
|
193
|
+
it(
|
|
190
194
|
t,
|
|
191
195
|
o,
|
|
192
|
-
`.${
|
|
196
|
+
`.${n.e("suggestion-item")}[tabindex="-1"]`
|
|
193
197
|
)
|
|
194
198
|
);
|
|
195
199
|
break;
|
|
@@ -199,42 +203,44 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
199
203
|
t.click();
|
|
200
204
|
break;
|
|
201
205
|
}
|
|
202
|
-
},
|
|
206
|
+
}, Qe = () => {
|
|
203
207
|
const e = $.value, t = e[e.length - 1];
|
|
204
|
-
|
|
205
|
-
}, ke = (e) => {
|
|
206
|
-
const t = e.target, l = a.e("search-input");
|
|
207
|
-
t.className === l && (Q.value = !0), C("focus", e);
|
|
208
|
+
G = w.value ? 0 : G + 1, !(!t || !G || a.collapseTags && e.length > 1) && (t.hitState ? R(t) : t.hitState = !0);
|
|
208
209
|
}, Ce = (e) => {
|
|
209
|
-
|
|
210
|
-
},
|
|
210
|
+
J.value = !0, C("focus", e);
|
|
211
|
+
}, ye = (e) => {
|
|
212
|
+
N(() => {
|
|
213
|
+
const t = S.value?.$el, l = document.activeElement;
|
|
214
|
+
t?.contains(l) || A.value?.isFocusInsideContent?.(e) || (J.value = !1);
|
|
215
|
+
}), C("blur", e);
|
|
216
|
+
}, Xe = ot(() => {
|
|
211
217
|
const { value: e } = fe;
|
|
212
218
|
if (!e) return;
|
|
213
|
-
const t =
|
|
214
|
-
|
|
215
|
-
}) : t !== !1 ?
|
|
216
|
-
},
|
|
217
|
-
!g.value && p(!0), !t?.isComposing && (e ?
|
|
218
|
-
},
|
|
219
|
-
|
|
219
|
+
const t = a.beforeFilter(e);
|
|
220
|
+
ut(t) ? t.then(he).catch(() => {
|
|
221
|
+
}) : t !== !1 ? he() : X();
|
|
222
|
+
}, a.debounce), ee = (e, t) => {
|
|
223
|
+
!g.value && p(!0), !t?.isComposing && (e ? Xe() : X());
|
|
224
|
+
}, be = (e) => Number.parseFloat(
|
|
225
|
+
nt(j.cssVarName("input-height"), e).value
|
|
220
226
|
) - 2;
|
|
221
|
-
return
|
|
222
|
-
[O, b, () =>
|
|
227
|
+
return x(y, I), x(
|
|
228
|
+
[O, b, () => a.collapseTags],
|
|
223
229
|
Re
|
|
224
|
-
),
|
|
225
|
-
|
|
226
|
-
}),
|
|
227
|
-
await
|
|
228
|
-
const e =
|
|
229
|
-
|
|
230
|
-
}),
|
|
231
|
-
const e =
|
|
232
|
-
|
|
233
|
-
}),
|
|
230
|
+
), x($, () => {
|
|
231
|
+
N(() => Z());
|
|
232
|
+
}), x(M, async () => {
|
|
233
|
+
await N();
|
|
234
|
+
const e = S.value.input;
|
|
235
|
+
D = be(e) || D, Z();
|
|
236
|
+
}), x(L, _, { immediate: !0 }), Ze(() => {
|
|
237
|
+
const e = S.value.input, t = be(e);
|
|
238
|
+
D = e.offsetHeight || t, at(e, Z);
|
|
239
|
+
}), Pe({
|
|
234
240
|
/**
|
|
235
241
|
* @description get an array of currently selected node,(leafOnly) whether only return the leaf checked nodes, default is `false`
|
|
236
242
|
*/
|
|
237
|
-
getCheckedNodes:
|
|
243
|
+
getCheckedNodes: ke,
|
|
238
244
|
/**
|
|
239
245
|
* @description cascader panel ref
|
|
240
246
|
*/
|
|
@@ -246,67 +252,67 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
246
252
|
/**
|
|
247
253
|
* @description cascader content ref
|
|
248
254
|
*/
|
|
249
|
-
contentRef:
|
|
255
|
+
contentRef: ge,
|
|
250
256
|
/**
|
|
251
257
|
* @description selected content text
|
|
252
258
|
*/
|
|
253
|
-
presentText:
|
|
254
|
-
}), (e, t) => (r(),
|
|
259
|
+
presentText: L
|
|
260
|
+
}), (e, t) => (r(), E(s(Ee), {
|
|
255
261
|
ref_key: "tooltipRef",
|
|
256
|
-
ref:
|
|
262
|
+
ref: A,
|
|
257
263
|
visible: g.value,
|
|
258
264
|
teleported: e.teleported,
|
|
259
|
-
"popper-class": [s(
|
|
260
|
-
"popper-options":
|
|
265
|
+
"popper-class": [s(n).e("dropdown"), e.popperClass],
|
|
266
|
+
"popper-options": Ie,
|
|
261
267
|
"fallback-placements": e.fallbackPlacements,
|
|
262
268
|
"stop-popper-mouse-event": !1,
|
|
263
269
|
"gpu-acceleration": !1,
|
|
264
270
|
placement: e.placement,
|
|
265
|
-
transition: `${s(
|
|
271
|
+
transition: `${s(n).namespace.value}-zoom-in-top`,
|
|
266
272
|
effect: e.effect,
|
|
267
273
|
pure: "",
|
|
268
274
|
persistent: e.persistent,
|
|
269
|
-
onHide:
|
|
275
|
+
onHide: X
|
|
270
276
|
}, {
|
|
271
277
|
default: v(() => [
|
|
272
|
-
|
|
278
|
+
q((r(), m("div", {
|
|
273
279
|
class: d(He.value),
|
|
274
|
-
style:
|
|
280
|
+
style: _e(ze.value),
|
|
275
281
|
onClick: t[8] || (t[8] = () => p(de.value ? void 0 : !0)),
|
|
276
|
-
onKeydown:
|
|
277
|
-
onMouseenter: t[9] || (t[9] = (l) =>
|
|
278
|
-
onMouseleave: t[10] || (t[10] = (l) =>
|
|
282
|
+
onKeydown: Ue,
|
|
283
|
+
onMouseenter: t[9] || (t[9] = (l) => ue.value = !0),
|
|
284
|
+
onMouseleave: t[10] || (t[10] = (l) => ue.value = !1)
|
|
279
285
|
}, [
|
|
280
|
-
|
|
286
|
+
te(s(mt), {
|
|
281
287
|
ref_key: "input",
|
|
282
|
-
ref:
|
|
288
|
+
ref: S,
|
|
283
289
|
modelValue: B.value,
|
|
284
290
|
"onUpdate:modelValue": t[1] || (t[1] = (l) => B.value = l),
|
|
285
|
-
placeholder:
|
|
291
|
+
placeholder: Ae.value,
|
|
286
292
|
readonly: de.value,
|
|
287
293
|
disabled: b.value,
|
|
288
294
|
"validate-event": !1,
|
|
289
|
-
size: s(
|
|
295
|
+
size: s(M),
|
|
290
296
|
class: d(Oe.value),
|
|
291
297
|
tabindex: T.value && e.filterable && !b.value ? -1 : void 0,
|
|
292
298
|
onCompositionstart: s(k),
|
|
293
299
|
onCompositionupdate: s(k),
|
|
294
300
|
onCompositionend: s(k),
|
|
295
|
-
onFocus:
|
|
296
|
-
onBlur:
|
|
297
|
-
onInput:
|
|
298
|
-
},
|
|
301
|
+
onFocus: Ce,
|
|
302
|
+
onBlur: ye,
|
|
303
|
+
onInput: ee
|
|
304
|
+
}, et({
|
|
299
305
|
suffix: v(() => [
|
|
300
|
-
|
|
306
|
+
Ke.value ? (r(), E(s(oe), {
|
|
301
307
|
key: "clear",
|
|
302
308
|
icon: "icon-circle-close",
|
|
303
|
-
class: d(["icon-circle-close", [s(
|
|
304
|
-
onClick:
|
|
305
|
-
}, null, 8, ["class"])) : (r(),
|
|
309
|
+
class: d(["icon-circle-close", [s(j).e("icon")]]),
|
|
310
|
+
onClick: F(Ge, ["stop"])
|
|
311
|
+
}, null, 8, ["class"])) : (r(), E(s(oe), {
|
|
306
312
|
icon: "icon-arrow-down",
|
|
307
313
|
key: "arrow-down",
|
|
308
|
-
class: d(
|
|
309
|
-
onClick: t[0] || (t[0] =
|
|
314
|
+
class: d(Me.value),
|
|
315
|
+
onClick: t[0] || (t[0] = F((l) => p(), ["stop"]))
|
|
310
316
|
}, null, 8, ["class"]))
|
|
311
317
|
]),
|
|
312
318
|
_: 2
|
|
@@ -314,7 +320,7 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
314
320
|
e.$slots.prefix ? {
|
|
315
321
|
name: "prefix",
|
|
316
322
|
fn: v(() => [
|
|
317
|
-
|
|
323
|
+
V(e.$slots, "prefix")
|
|
318
324
|
]),
|
|
319
325
|
key: "0"
|
|
320
326
|
} : void 0
|
|
@@ -322,17 +328,17 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
322
328
|
T.value ? (r(), m("div", {
|
|
323
329
|
key: 0,
|
|
324
330
|
ref_key: "tagWrapper",
|
|
325
|
-
ref:
|
|
331
|
+
ref: ie,
|
|
326
332
|
class: d([
|
|
327
|
-
s(
|
|
328
|
-
s(
|
|
333
|
+
s(n).e("tags"),
|
|
334
|
+
s(n).is("validate", !!Be.value)
|
|
329
335
|
])
|
|
330
336
|
}, [
|
|
331
|
-
|
|
337
|
+
V(e.$slots, "tag", {
|
|
332
338
|
data: H.value,
|
|
333
339
|
deleteTag: R
|
|
334
340
|
}, () => [
|
|
335
|
-
(r(!0), m(
|
|
341
|
+
(r(!0), m(le, null, se($.value, (l) => (r(), E(s($e), {
|
|
336
342
|
key: l.key,
|
|
337
343
|
type: e.tagType,
|
|
338
344
|
size: pe.value,
|
|
@@ -343,7 +349,7 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
343
349
|
onClose: (o) => R(l)
|
|
344
350
|
}, {
|
|
345
351
|
default: v(() => [
|
|
346
|
-
l.isCollapseTag === !1 ? (r(), m("span",
|
|
352
|
+
l.isCollapseTag === !1 ? (r(), m("span", Et, U(l.text), 1)) : (r(), E(s(Ee), {
|
|
347
353
|
key: 1,
|
|
348
354
|
disabled: g.value || !e.collapseTagsTooltip,
|
|
349
355
|
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
@@ -351,21 +357,21 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
351
357
|
effect: e.effect
|
|
352
358
|
}, {
|
|
353
359
|
default: v(() => [
|
|
354
|
-
|
|
360
|
+
z("span", null, U(l.text), 1)
|
|
355
361
|
]),
|
|
356
362
|
content: v(() => [
|
|
357
|
-
|
|
363
|
+
te(s(we), { "max-height": e.maxCollapseTagsTooltipHeight }, {
|
|
358
364
|
default: v(() => [
|
|
359
|
-
|
|
360
|
-
class: d(s(
|
|
365
|
+
z("div", {
|
|
366
|
+
class: d(s(n).e("collapse-tags"))
|
|
361
367
|
}, [
|
|
362
|
-
(r(!0), m(
|
|
368
|
+
(r(!0), m(le, null, se(H.value.slice(
|
|
363
369
|
e.maxCollapseTags
|
|
364
370
|
), (o, u) => (r(), m("div", {
|
|
365
371
|
key: u,
|
|
366
|
-
class: d(s(
|
|
372
|
+
class: d(s(n).e("collapse-tag"))
|
|
367
373
|
}, [
|
|
368
|
-
(r(),
|
|
374
|
+
(r(), E(s($e), {
|
|
369
375
|
key: o.key,
|
|
370
376
|
class: "in-tooltip",
|
|
371
377
|
type: e.tagType,
|
|
@@ -374,10 +380,10 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
374
380
|
hit: o.hitState,
|
|
375
381
|
closable: o.closable,
|
|
376
382
|
"disable-transitions": "",
|
|
377
|
-
onClose: (
|
|
383
|
+
onClose: (W) => R(o)
|
|
378
384
|
}, {
|
|
379
385
|
default: v(() => [
|
|
380
|
-
|
|
386
|
+
z("span", null, U(o.text), 1)
|
|
381
387
|
]),
|
|
382
388
|
_: 2
|
|
383
389
|
}, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]))
|
|
@@ -393,108 +399,108 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
|
|
|
393
399
|
_: 2
|
|
394
400
|
}, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]))), 128))
|
|
395
401
|
]),
|
|
396
|
-
e.filterable && !b.value ?
|
|
402
|
+
e.filterable && !b.value ? q((r(), m("input", {
|
|
397
403
|
key: 0,
|
|
398
|
-
"onUpdate:modelValue": t[2] || (t[2] = (l) =>
|
|
404
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => w.value = l),
|
|
399
405
|
type: "text",
|
|
400
|
-
class: d(s(
|
|
401
|
-
placeholder:
|
|
402
|
-
onInput: t[3] || (t[3] = (l) =>
|
|
403
|
-
onClick: t[4] || (t[4] =
|
|
404
|
-
onKeydown:
|
|
406
|
+
class: d(s(n).e("search-input")),
|
|
407
|
+
placeholder: L.value ? "" : ce.value,
|
|
408
|
+
onInput: t[3] || (t[3] = (l) => ee(w.value, l)),
|
|
409
|
+
onClick: t[4] || (t[4] = F((l) => p(!0), ["stop"])),
|
|
410
|
+
onKeydown: tt(Qe, ["delete"]),
|
|
405
411
|
onCompositionstart: t[5] || (t[5] = //@ts-ignore
|
|
406
412
|
(...l) => s(k) && s(k)(...l)),
|
|
407
413
|
onCompositionupdate: t[6] || (t[6] = //@ts-ignore
|
|
408
414
|
(...l) => s(k) && s(k)(...l)),
|
|
409
415
|
onCompositionend: t[7] || (t[7] = //@ts-ignore
|
|
410
416
|
(...l) => s(k) && s(k)(...l)),
|
|
411
|
-
onFocus:
|
|
412
|
-
onBlur:
|
|
417
|
+
onFocus: Ce,
|
|
418
|
+
onBlur: ye
|
|
413
419
|
}, null, 42, wt)), [
|
|
414
|
-
[
|
|
415
|
-
]) :
|
|
416
|
-
], 2)) :
|
|
420
|
+
[lt, w.value]
|
|
421
|
+
]) : P("", !0)
|
|
422
|
+
], 2)) : P("", !0)
|
|
417
423
|
], 38)), [
|
|
418
|
-
[s(
|
|
424
|
+
[s(gt), () => p(!1), ge.value]
|
|
419
425
|
])
|
|
420
426
|
]),
|
|
421
427
|
content: v(() => [
|
|
422
428
|
e.$slots.header ? (r(), m("div", {
|
|
423
429
|
key: 0,
|
|
424
|
-
class: d(s(
|
|
425
|
-
onClick: t[11] || (t[11] =
|
|
430
|
+
class: d(s(n).e("header")),
|
|
431
|
+
onClick: t[11] || (t[11] = F(() => {
|
|
426
432
|
}, ["stop"]))
|
|
427
433
|
}, [
|
|
428
|
-
|
|
429
|
-
], 2)) :
|
|
430
|
-
|
|
434
|
+
V(e.$slots, "header")
|
|
435
|
+
], 2)) : P("", !0),
|
|
436
|
+
q(te(s(vt), {
|
|
431
437
|
ref_key: "cascaderPanelRef",
|
|
432
438
|
ref: f,
|
|
433
|
-
modelValue:
|
|
434
|
-
"onUpdate:modelValue": t[12] || (t[12] = (l) =>
|
|
439
|
+
modelValue: me.value,
|
|
440
|
+
"onUpdate:modelValue": t[12] || (t[12] = (l) => me.value = l),
|
|
435
441
|
options: e.options,
|
|
436
|
-
props:
|
|
442
|
+
props: a.props,
|
|
437
443
|
border: !1,
|
|
438
444
|
"render-label": e.$slots.default,
|
|
439
|
-
onExpandChange:
|
|
445
|
+
onExpandChange: qe,
|
|
440
446
|
onClose: t[13] || (t[13] = (l) => e.$nextTick(() => p(!1)))
|
|
441
447
|
}, {
|
|
442
448
|
empty: v(() => [
|
|
443
|
-
|
|
449
|
+
V(e.$slots, "empty")
|
|
444
450
|
]),
|
|
445
451
|
_: 3
|
|
446
452
|
}, 8, ["modelValue", "options", "props", "render-label"]), [
|
|
447
|
-
[
|
|
453
|
+
[Te, !y.value]
|
|
448
454
|
]),
|
|
449
|
-
e.filterable ?
|
|
455
|
+
e.filterable ? q((r(), E(s(we), {
|
|
450
456
|
key: 1,
|
|
451
457
|
ref_key: "suggestionPanel",
|
|
452
|
-
ref:
|
|
458
|
+
ref: K,
|
|
453
459
|
tag: "ul",
|
|
454
|
-
class: d(s(
|
|
455
|
-
"view-class": s(
|
|
456
|
-
onKeydown:
|
|
460
|
+
class: d(s(n).e("suggestion-panel")),
|
|
461
|
+
"view-class": s(n).e("suggestion-list"),
|
|
462
|
+
onKeydown: Je
|
|
457
463
|
}, {
|
|
458
464
|
default: v(() => [
|
|
459
|
-
|
|
465
|
+
Q.value.length ? (r(!0), m(le, { key: 0 }, se(Q.value, (l) => (r(), m("li", {
|
|
460
466
|
key: l.uid,
|
|
461
467
|
class: d([
|
|
462
|
-
s(
|
|
463
|
-
s(
|
|
468
|
+
s(n).e("suggestion-item"),
|
|
469
|
+
s(n).is("checked", l.checked)
|
|
464
470
|
]),
|
|
465
471
|
tabindex: -1,
|
|
466
|
-
onClick: (o) =>
|
|
472
|
+
onClick: (o) => je(l)
|
|
467
473
|
}, [
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
l.checked ? (r(),
|
|
474
|
+
V(e.$slots, "suggestion-item", { item: l }, () => [
|
|
475
|
+
z("span", null, U(l.text), 1),
|
|
476
|
+
l.checked ? (r(), E(s(oe), {
|
|
471
477
|
key: 0,
|
|
472
478
|
icon: "icon-check"
|
|
473
|
-
})) :
|
|
479
|
+
})) : P("", !0)
|
|
474
480
|
])
|
|
475
|
-
], 10,
|
|
476
|
-
|
|
477
|
-
class: d(s(
|
|
481
|
+
], 10, $t))), 128)) : V(e.$slots, "empty", { key: 1 }, () => [
|
|
482
|
+
z("li", {
|
|
483
|
+
class: d(s(n).e("empty-text"))
|
|
478
484
|
}, "无匹配数据", 2)
|
|
479
485
|
])
|
|
480
486
|
]),
|
|
481
487
|
_: 3
|
|
482
488
|
}, 8, ["class", "view-class"])), [
|
|
483
|
-
[
|
|
484
|
-
]) :
|
|
489
|
+
[Te, y.value]
|
|
490
|
+
]) : P("", !0),
|
|
485
491
|
e.$slots.footer ? (r(), m("div", {
|
|
486
492
|
key: 2,
|
|
487
|
-
class: d(s(
|
|
488
|
-
onClick: t[14] || (t[14] =
|
|
493
|
+
class: d(s(n).e("footer")),
|
|
494
|
+
onClick: t[14] || (t[14] = F(() => {
|
|
489
495
|
}, ["stop"]))
|
|
490
496
|
}, [
|
|
491
|
-
|
|
492
|
-
], 2)) :
|
|
497
|
+
V(e.$slots, "footer")
|
|
498
|
+
], 2)) : P("", !0)
|
|
493
499
|
]),
|
|
494
500
|
_: 3
|
|
495
501
|
}, 8, ["visible", "teleported", "popper-class", "fallback-placements", "placement", "transition", "effect", "persistent"]));
|
|
496
502
|
}
|
|
497
503
|
});
|
|
498
504
|
export {
|
|
499
|
-
|
|
505
|
+
el as default
|
|
500
506
|
};
|