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