vft 0.0.511 → 0.0.513
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/autocomplete/autocomplete.vue.d.ts +2 -2
- package/es/components/autocomplete/index.d.ts +6 -6
- package/es/components/button/index.d.ts +9 -9
- package/es/components/cascader/cascader.vue2.js +202 -203
- package/es/components/cascader-panel/menu.vue2.js +49 -50
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +18 -19
- package/es/components/color-picker/color-picker.vue2.js +133 -134
- package/es/components/config-provider/config-provider.vue.d.ts +0 -2
- package/es/components/config-provider/config-provider.vue2.js +4 -5
- package/es/components/config-provider/constants.d.ts +0 -1
- package/es/components/config-provider/constants.js +2 -3
- package/es/components/config-provider/hooks/use-global-config.js +30 -33
- package/es/components/config-provider/index.d.ts +0 -9
- package/es/components/config-provider/index.js +5 -6
- package/es/components/date-picker/composables/use-basic-date-table.js +82 -83
- package/es/components/date-picker/composables/use-month-range-header.js +14 -15
- package/es/components/date-picker/composables/use-panel-date-range.js +23 -24
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +183 -184
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +224 -225
- package/es/components/date-time-select/date-time-select.vue2.js +36 -39
- package/es/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue2.js +67 -68
- package/es/components/dropdown/index.d.ts +33 -33
- package/es/components/empty/empty.vue2.js +38 -39
- package/es/components/full-screen/full-screen.vue2.js +17 -18
- package/es/components/image/image.vue2.js +59 -60
- package/es/components/image-viewer/image-viewer.vue2.js +44 -45
- package/es/components/index.js +97 -98
- package/es/components/md-container/md-container.vue2.js +74 -75
- package/es/components/md-container/toc.js +36 -37
- package/es/components/message-box/message-box.vue2.js +3 -3
- package/es/components/message-box/method.js +47 -48
- package/es/components/modal/modal-footer-action.vue2.js +24 -25
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -16
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +53 -54
- package/es/components/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/popconfirm/popconfirm.vue2.js +39 -40
- package/es/components/search/search.vue2.js +50 -51
- package/es/components/select/index.d.ts +4 -4
- package/es/components/select/select.vue.d.ts +4 -4
- package/es/components/select/useSelect.d.ts +4 -4
- package/es/components/select/useSelect.js +231 -232
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +65 -66
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +133 -134
- package/es/components/transfer/transfer-panel.vue2.js +56 -57
- package/es/components/transfer/transfer.vue2.js +69 -70
- package/es/components/tree/tree.vue2.js +59 -60
- package/es/components/upload/upload-content.vue2.js +49 -50
- package/es/components/upload/upload-list.vue2.js +45 -46
- package/es/components/upload/upload.vue2.js +99 -100
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -5
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/lib/components/autocomplete/index.d.ts +6 -6
- package/lib/components/button/index.d.ts +9 -9
- 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 +0 -2
- 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 +0 -1
- 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 +0 -9
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +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-item-impl.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/dropdown/index.d.ts +33 -33
- 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/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/toc.cjs +1 -1
- package/lib/components/message-box/message-box.vue2.cjs +1 -1
- package/lib/components/message-box/method.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/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/index.d.ts +4 -4
- package/lib/components/select/select.vue.d.ts +4 -4
- package/lib/components/select/useSelect.cjs +1 -1
- package/lib/components/select/useSelect.d.ts +4 -4
- 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/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +0 -1
- 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/message-box.scss +2 -2
- package/theme-style/src/table.scss +2 -0
- package/theme-style/vft-message-box.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
- package/es/locale/index.d.js +0 -1
- package/es/locale/index.d.ts +0 -26
- package/es/locale/index.js +0 -10
- package/es/locale/lang/en.d.ts +0 -183
- package/es/locale/lang/en.js +0 -241
- package/es/locale/lang/zh-cn.d.ts +0 -183
- package/es/locale/lang/zh-cn.js +0 -241
- package/es/locale/lang/zh-tw.d.ts +0 -183
- package/es/locale/lang/zh-tw.js +0 -241
- package/es/locale/use-locale.d.ts +0 -17
- package/es/locale/use-locale.js +0 -56
- package/lib/locale/index.cjs +0 -1
- package/lib/locale/index.d.cjs +0 -1
- package/lib/locale/index.d.ts +0 -26
- package/lib/locale/lang/en.cjs +0 -1
- package/lib/locale/lang/en.d.ts +0 -183
- package/lib/locale/lang/zh-cn.cjs +0 -1
- package/lib/locale/lang/zh-cn.d.ts +0 -183
- package/lib/locale/lang/zh-tw.cjs +0 -1
- package/lib/locale/lang/zh-tw.d.ts +0 -183
- package/lib/locale/use-locale.cjs +0 -1
- package/lib/locale/use-locale.d.ts +0 -17
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import "../form/index.js";
|
|
2
|
-
import { EVENT_CODE as
|
|
3
|
-
import { UPDATE_MODEL_EVENT as
|
|
2
|
+
import { EVENT_CODE as xt } from "../../constants/aria.js";
|
|
3
|
+
import { UPDATE_MODEL_EVENT as Ot, CHANGE_EVENT as It } from "../../constants/event.js";
|
|
4
4
|
import { useResizeObserver as p } from "@vueuse/core";
|
|
5
|
-
import { isArray as w, isFunction as
|
|
6
|
-
import { debugWarn as
|
|
5
|
+
import { isArray as w, isFunction as z, isObject as ee, isNumber as pt, isUndefined as wt } from "@vft/utils";
|
|
6
|
+
import { debugWarn as te } from "../../utils/error.js";
|
|
7
7
|
import "../config-provider/hooks/use-global-config.js";
|
|
8
|
-
import { reactive as
|
|
9
|
-
import { escapeStringRegexp as
|
|
10
|
-
import { debounce as
|
|
8
|
+
import { reactive as yt, ref as m, computed as o, toRaw as Ct, watch as T, nextTick as h, watchEffect as Se, onMounted as Et } from "vue";
|
|
9
|
+
import { escapeStringRegexp as Tt } from "../../utils/vue/data-helper.js";
|
|
10
|
+
import { debounce as St, get as A, isEqual as _, findLastIndex as Rt } from "lodash-es";
|
|
11
11
|
import { useNamespace as Re } from "../../hooks/use-namespace/index.js";
|
|
12
12
|
import "../../hooks/use-model-toggle/index.js";
|
|
13
13
|
import "@popperjs/core";
|
|
14
14
|
import "../../hooks/use-z-index/index.js";
|
|
15
|
-
import { useComposition as
|
|
16
|
-
import { useFocusController as
|
|
17
|
-
import { useEmptyValues as
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}), { aliasProps: ae, getLabel: g, getValue: r, getDisabled: R, getOptions: Le } = Ht(t), { valueOnClear: Ne, isEmptyValue: ie } = Lt(t), l = Ct({
|
|
15
|
+
import { useComposition as Mt } from "../../hooks/use-composition/index.js";
|
|
16
|
+
import { useFocusController as Wt } from "../../hooks/use-focus-controller/index.js";
|
|
17
|
+
import { useEmptyValues as Ft } from "../../hooks/use-empty-values/index.js";
|
|
18
|
+
import { useAllowCreate as Lt } from "./useAllowCreate.js";
|
|
19
|
+
import { useProps as Nt } from "./useProps.js";
|
|
20
|
+
import { useFormItem as Dt, useFormItemInputId as Ht } from "../form/hooks/use-form-item.js";
|
|
21
|
+
import { useFormSize as Bt } from "../form/hooks/use-form-common-props.js";
|
|
22
|
+
const il = (t, v) => {
|
|
23
|
+
const $ = Re("select"), Me = Re("input"), { form: le, formItem: S } = Dt(), { inputId: We } = Ht(t, {
|
|
24
|
+
formItemContext: S
|
|
25
|
+
}), { aliasProps: ne, getLabel: g, getValue: d, getDisabled: R, getOptions: Fe } = Nt(t), { valueOnClear: Le, isEmptyValue: ae } = Ft(t), l = yt({
|
|
27
26
|
inputValue: "",
|
|
28
27
|
cachedOptions: [],
|
|
29
28
|
createdOptions: [],
|
|
@@ -36,186 +35,186 @@ const sl = (t, v) => {
|
|
|
36
35
|
selectedLabel: "",
|
|
37
36
|
menuVisibleOnFocus: !1,
|
|
38
37
|
isBeforeHide: !1
|
|
39
|
-
}),
|
|
40
|
-
isComposing:
|
|
41
|
-
handleCompositionStart:
|
|
42
|
-
handleCompositionEnd:
|
|
43
|
-
handleCompositionUpdate:
|
|
44
|
-
} =
|
|
45
|
-
afterComposition: (e) =>
|
|
46
|
-
}), x = o(() => t.disabled || !!
|
|
38
|
+
}), M = m(-1), G = m(), y = m(), W = m(), Q = m(), V = m(), Ne = m(), De = m(), b = m(), ie = m(), F = m(), {
|
|
39
|
+
isComposing: oe,
|
|
40
|
+
handleCompositionStart: He,
|
|
41
|
+
handleCompositionEnd: Be,
|
|
42
|
+
handleCompositionUpdate: Pe
|
|
43
|
+
} = Mt({
|
|
44
|
+
afterComposition: (e) => Ee(e)
|
|
45
|
+
}), x = o(() => t.disabled || !!le?.disabled), { wrapperRef: ue, isFocused: se, handleBlur: Ke } = Wt(V, {
|
|
47
46
|
disabled: x,
|
|
48
47
|
afterFocus() {
|
|
49
48
|
t.automaticDropdown && !u.value && (u.value = !0, l.menuVisibleOnFocus = !0);
|
|
50
49
|
},
|
|
51
50
|
beforeBlur(e) {
|
|
52
|
-
return
|
|
51
|
+
return W.value?.isFocusInsideContent(e) || Q.value?.isFocusInsideContent(e);
|
|
53
52
|
},
|
|
54
53
|
afterBlur() {
|
|
55
|
-
u.value = !1, l.menuVisibleOnFocus = !1, t.validateEvent &&
|
|
54
|
+
u.value = !1, l.menuVisibleOnFocus = !1, t.validateEvent && S?.validate?.("blur").catch((e) => te(e));
|
|
56
55
|
}
|
|
57
|
-
}),
|
|
56
|
+
}), ce = o(() => me("")), L = o(() => t.loading ? !1 : t.options.length > 0 || l.createdOptions.length > 0), s = m([]), u = m(!1), ke = o(() => le?.statusIcon ?? !1), ze = o(() => {
|
|
58
57
|
const e = s.value.length * t.itemHeight;
|
|
59
58
|
return e > t.height ? t.height : e;
|
|
60
|
-
}),
|
|
59
|
+
}), N = o(() => t.multiple ? w(t.modelValue) && t.modelValue.length > 0 : !ae(t.modelValue)), Ae = o(() => t.clearable && !x.value && l.inputHovering && N.value), de = o(
|
|
61
60
|
() => t.remote && t.filterable ? "" : "icon-arrow-down"
|
|
62
|
-
),
|
|
63
|
-
() => de.value &&
|
|
64
|
-
),
|
|
65
|
-
const n = new RegExp(
|
|
61
|
+
), _e = o(
|
|
62
|
+
() => de.value && $.is("reverse", u.value)
|
|
63
|
+
), $e = o(() => S?.validateState || ""), Ge = "validateIcon", re = o(() => t.remote ? 300 : 0), fe = o(() => t.loading ? t.loadingText || "加载中" : t.remote && !l.inputValue && !L.value ? !1 : t.filterable && l.inputValue && L.value && s.value.length === 0 ? t.noMatchText || "无匹配数据" : L.value ? null : t.noDataText || "暂无数据"), me = (e) => {
|
|
64
|
+
const n = new RegExp(Tt(e), "i"), { filterMethod: a, remoteMethod: i } = Ct(t), c = t.filterable && z(a), f = t.filterable && t.remote && z(i), P = (O) => c || f ? !0 : e ? n.test(g(O) || "") : !0;
|
|
66
65
|
return t.loading ? [] : [...l.createdOptions, ...t.options].reduce((O, I) => {
|
|
67
|
-
const
|
|
68
|
-
if (w(
|
|
69
|
-
const
|
|
70
|
-
|
|
66
|
+
const K = Fe(I);
|
|
67
|
+
if (w(K)) {
|
|
68
|
+
const k = K.filter(P);
|
|
69
|
+
k.length > 0 && O.push(
|
|
71
70
|
{
|
|
72
71
|
label: g(I),
|
|
73
72
|
type: "Group"
|
|
74
73
|
},
|
|
75
|
-
...
|
|
74
|
+
...k
|
|
76
75
|
);
|
|
77
|
-
} else (t.remote ||
|
|
76
|
+
} else (t.remote || P(I)) && O.push(I);
|
|
78
77
|
return O;
|
|
79
78
|
}, []);
|
|
80
|
-
},
|
|
81
|
-
s.value =
|
|
82
|
-
},
|
|
79
|
+
}, he = () => {
|
|
80
|
+
s.value = me(l.inputValue);
|
|
81
|
+
}, ve = o(() => {
|
|
83
82
|
const e = /* @__PURE__ */ new Map();
|
|
84
|
-
return
|
|
85
|
-
e.set(d(
|
|
83
|
+
return ce.value.forEach((n, a) => {
|
|
84
|
+
e.set(r(d(n)), { option: n, index: a });
|
|
86
85
|
}), e;
|
|
87
|
-
}),
|
|
86
|
+
}), D = o(() => {
|
|
88
87
|
const e = /* @__PURE__ */ new Map();
|
|
89
88
|
return s.value.forEach((n, a) => {
|
|
90
|
-
e.set(d(
|
|
89
|
+
e.set(r(d(n)), { option: n, index: a });
|
|
91
90
|
}), e;
|
|
92
|
-
}),
|
|
91
|
+
}), Qe = o(
|
|
93
92
|
() => s.value.every((e) => R(e))
|
|
94
|
-
),
|
|
95
|
-
() =>
|
|
93
|
+
), ge = Bt(), Ue = o(
|
|
94
|
+
() => ge.value === "small" ? "small" : "default"
|
|
96
95
|
), C = () => {
|
|
97
|
-
if (
|
|
98
|
-
|
|
96
|
+
if (pt(t.fitInputWidth)) {
|
|
97
|
+
M.value = t.fitInputWidth;
|
|
99
98
|
return;
|
|
100
99
|
}
|
|
101
|
-
const e =
|
|
102
|
-
!t.fitInputWidth &&
|
|
103
|
-
|
|
104
|
-
}) :
|
|
105
|
-
},
|
|
106
|
-
const n = document.createElement("canvas").getContext("2d"), a =
|
|
100
|
+
const e = G.value?.offsetWidth || 200;
|
|
101
|
+
!t.fitInputWidth && L.value ? h(() => {
|
|
102
|
+
M.value = Math.max(e, je());
|
|
103
|
+
}) : M.value = e;
|
|
104
|
+
}, je = () => {
|
|
105
|
+
const n = document.createElement("canvas").getContext("2d"), a = $.be("dropdown", "item"), c = (b.value?.listRef?.innerRef || document).querySelector(`.${a}`);
|
|
107
106
|
if (c === null || n === null) return 0;
|
|
108
|
-
const f = getComputedStyle(c),
|
|
107
|
+
const f = getComputedStyle(c), P = Number.parseFloat(f.paddingLeft) + Number.parseFloat(f.paddingRight);
|
|
109
108
|
return n.font = `bold ${f.font.replace(
|
|
110
109
|
new RegExp(`\\b${f.fontWeight}\\b`),
|
|
111
110
|
""
|
|
112
|
-
)}`, s.value.reduce((I,
|
|
113
|
-
const
|
|
114
|
-
return Math.max(
|
|
115
|
-
}, 0) +
|
|
116
|
-
},
|
|
111
|
+
)}`, s.value.reduce((I, K) => {
|
|
112
|
+
const k = n.measureText(g(K));
|
|
113
|
+
return Math.max(k.width, I);
|
|
114
|
+
}, 0) + P;
|
|
115
|
+
}, qe = () => {
|
|
117
116
|
if (!y.value) return 0;
|
|
118
117
|
const e = window.getComputedStyle(y.value);
|
|
119
118
|
return Number.parseFloat(e.gap || "6px");
|
|
120
|
-
},
|
|
121
|
-
const e =
|
|
122
|
-
return { maxWidth: `${
|
|
123
|
-
}),
|
|
124
|
-
const e = t.placeholder ||
|
|
125
|
-
return t.multiple || !
|
|
126
|
-
}),
|
|
119
|
+
}, Je = o(() => {
|
|
120
|
+
const e = qe();
|
|
121
|
+
return { maxWidth: `${F.value && t.maxCollapseTags === 1 ? l.selectionWidth - l.collapseItemWidth - e : l.selectionWidth}px` };
|
|
122
|
+
}), Xe = o(() => ({ maxWidth: `${l.selectionWidth}px` })), Ye = o(() => w(t.modelValue) ? t.modelValue.length === 0 && !l.inputValue : t.filterable ? !l.inputValue : !0), Ze = o(() => {
|
|
123
|
+
const e = t.placeholder || "请选择";
|
|
124
|
+
return t.multiple || !N.value ? e : l.selectedLabel;
|
|
125
|
+
}), et = o(() => W.value?.popperRef?.contentRef), tt = o(() => {
|
|
127
126
|
if (t.multiple) {
|
|
128
127
|
const e = t.modelValue.length;
|
|
129
|
-
if (t.modelValue.length > 0 &&
|
|
130
|
-
const { index: n } =
|
|
128
|
+
if (t.modelValue.length > 0 && D.value.has(t.modelValue[e - 1])) {
|
|
129
|
+
const { index: n } = D.value.get(
|
|
131
130
|
t.modelValue[e - 1]
|
|
132
131
|
);
|
|
133
132
|
return n;
|
|
134
133
|
}
|
|
135
|
-
} else if (!
|
|
136
|
-
const { index: e } =
|
|
134
|
+
} else if (!ae(t.modelValue) && D.value.has(t.modelValue)) {
|
|
135
|
+
const { index: e } = D.value.get(t.modelValue);
|
|
137
136
|
return e;
|
|
138
137
|
}
|
|
139
138
|
return -1;
|
|
140
|
-
}),
|
|
139
|
+
}), lt = o({
|
|
141
140
|
get() {
|
|
142
|
-
return u.value &&
|
|
141
|
+
return u.value && fe.value !== !1;
|
|
143
142
|
},
|
|
144
143
|
set(e) {
|
|
145
144
|
u.value = e;
|
|
146
145
|
}
|
|
147
|
-
}),
|
|
148
|
-
createNewOption:
|
|
149
|
-
removeNewOption:
|
|
150
|
-
selectNewOption:
|
|
151
|
-
clearAllNewOption:
|
|
152
|
-
} =
|
|
146
|
+
}), nt = o(() => t.multiple ? t.collapseTags ? l.cachedOptions.slice(0, t.maxCollapseTags) : l.cachedOptions : []), at = o(() => t.multiple ? t.collapseTags ? l.cachedOptions.slice(t.maxCollapseTags) : [] : []), {
|
|
147
|
+
createNewOption: Ve,
|
|
148
|
+
removeNewOption: U,
|
|
149
|
+
selectNewOption: be,
|
|
150
|
+
clearAllNewOption: j
|
|
151
|
+
} = Lt(t, l), q = () => {
|
|
153
152
|
x.value || (l.menuVisibleOnFocus ? l.menuVisibleOnFocus = !1 : u.value = !u.value);
|
|
154
|
-
},
|
|
155
|
-
l.inputValue.length > 0 && !u.value && (u.value = !0),
|
|
156
|
-
|
|
153
|
+
}, xe = () => {
|
|
154
|
+
l.inputValue.length > 0 && !u.value && (u.value = !0), Ve(l.inputValue), h(() => {
|
|
155
|
+
J(l.inputValue);
|
|
157
156
|
});
|
|
158
|
-
},
|
|
159
|
-
l.previousQuery === e ||
|
|
160
|
-
},
|
|
157
|
+
}, Oe = St(xe, re.value), J = (e) => {
|
|
158
|
+
l.previousQuery === e || oe.value || (l.previousQuery = e, t.filterable && z(t.filterMethod) ? t.filterMethod(e) : t.filterable && t.remote && z(t.remoteMethod) && t.remoteMethod(e), t.defaultFirstOption && (t.filterable || t.remote) && s.value.length ? h(it) : h(gt));
|
|
159
|
+
}, it = () => {
|
|
161
160
|
const e = s.value.filter(
|
|
162
161
|
(i) => !i.disabled && i.type !== "Group"
|
|
163
162
|
), n = e.find((i) => i.created), a = e[0];
|
|
164
|
-
l.hoveringIndex =
|
|
163
|
+
l.hoveringIndex = X(
|
|
165
164
|
s.value,
|
|
166
165
|
n || a
|
|
167
166
|
);
|
|
168
|
-
},
|
|
169
|
-
|
|
167
|
+
}, ot = (e) => {
|
|
168
|
+
_(t.modelValue, e) || v(It, e);
|
|
170
169
|
}, E = (e) => {
|
|
171
|
-
v(
|
|
170
|
+
v(Ot, e), ot(e), l.previousValue = t.multiple ? String(e) : e, h(() => {
|
|
172
171
|
if (t.multiple && w(t.modelValue)) {
|
|
173
172
|
const n = l.cachedOptions.slice(), a = t.modelValue.map(
|
|
174
|
-
(i) =>
|
|
173
|
+
(i) => Te(i, n)
|
|
175
174
|
);
|
|
176
|
-
|
|
175
|
+
_(l.cachedOptions, a) || (l.cachedOptions = a);
|
|
177
176
|
} else
|
|
178
|
-
|
|
177
|
+
B(!0);
|
|
179
178
|
});
|
|
180
|
-
},
|
|
181
|
-
if (!
|
|
179
|
+
}, X = (e = [], n) => {
|
|
180
|
+
if (!ee(n))
|
|
182
181
|
return e.indexOf(n);
|
|
183
182
|
const a = t.valueKey;
|
|
184
183
|
let i = -1;
|
|
185
|
-
return e.some((c, f) =>
|
|
186
|
-
},
|
|
184
|
+
return e.some((c, f) => A(c, a) === A(n, a) ? (i = f, !0) : !1), i;
|
|
185
|
+
}, r = (e) => ee(e) ? A(e, t.valueKey) : e, Ie = () => {
|
|
187
186
|
C();
|
|
188
|
-
},
|
|
187
|
+
}, pe = () => {
|
|
189
188
|
l.selectionWidth = Number.parseFloat(
|
|
190
189
|
window.getComputedStyle(y.value).width
|
|
191
190
|
);
|
|
192
|
-
},
|
|
193
|
-
l.collapseItemWidth =
|
|
194
|
-
},
|
|
195
|
-
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
},
|
|
191
|
+
}, ut = () => {
|
|
192
|
+
l.collapseItemWidth = F.value.getBoundingClientRect().width;
|
|
193
|
+
}, Y = () => {
|
|
194
|
+
W.value?.updatePopper?.();
|
|
195
|
+
}, we = () => {
|
|
196
|
+
Q.value?.updatePopper?.();
|
|
197
|
+
}, ye = (e) => {
|
|
199
198
|
if (t.multiple) {
|
|
200
199
|
let n = t.modelValue.slice();
|
|
201
|
-
const a =
|
|
200
|
+
const a = X(n, d(e));
|
|
202
201
|
a > -1 ? (n = [
|
|
203
202
|
...n.slice(0, a),
|
|
204
203
|
...n.slice(a + 1)
|
|
205
|
-
], l.cachedOptions.splice(a, 1),
|
|
204
|
+
], l.cachedOptions.splice(a, 1), U(e)) : (t.multipleLimit <= 0 || n.length < t.multipleLimit) && (n = [...n, d(e)], l.cachedOptions.push(e), be(e)), E(n), e.created && J(""), t.filterable && !t.reserveKeyword && (l.inputValue = "");
|
|
206
205
|
} else
|
|
207
|
-
l.selectedLabel = g(e), E(
|
|
208
|
-
|
|
209
|
-
},
|
|
206
|
+
l.selectedLabel = g(e), E(d(e)), u.value = !1, be(e), e.created || j();
|
|
207
|
+
H();
|
|
208
|
+
}, st = (e, n) => {
|
|
210
209
|
let a = t.modelValue.slice();
|
|
211
|
-
const i =
|
|
210
|
+
const i = X(a, d(n));
|
|
212
211
|
i > -1 && !x.value && (a = [
|
|
213
212
|
...t.modelValue.slice(0, i),
|
|
214
213
|
...t.modelValue.slice(i + 1)
|
|
215
|
-
], l.cachedOptions.splice(i, 1), E(a), v("remove-tag",
|
|
216
|
-
},
|
|
214
|
+
], l.cachedOptions.splice(i, 1), E(a), v("remove-tag", d(n)), U(n)), e.stopPropagation(), H();
|
|
215
|
+
}, H = () => {
|
|
217
216
|
V.value?.focus();
|
|
218
|
-
},
|
|
217
|
+
}, ct = () => {
|
|
219
218
|
if (u.value) {
|
|
220
219
|
u.value = !1, h(() => V.value?.blur());
|
|
221
220
|
return;
|
|
@@ -223,100 +222,100 @@ const sl = (t, v) => {
|
|
|
223
222
|
V.value?.blur();
|
|
224
223
|
}, dt = () => {
|
|
225
224
|
l.inputValue.length > 0 ? l.inputValue = "" : u.value = !1;
|
|
226
|
-
},
|
|
225
|
+
}, rt = (e) => Rt(
|
|
227
226
|
e,
|
|
228
227
|
(n) => !l.cachedOptions.some(
|
|
229
|
-
(a) =>
|
|
228
|
+
(a) => d(a) === n && R(a)
|
|
230
229
|
)
|
|
231
|
-
),
|
|
232
|
-
if (t.multiple && e.code !==
|
|
230
|
+
), ft = (e) => {
|
|
231
|
+
if (t.multiple && e.code !== xt.delete && l.inputValue.length === 0) {
|
|
233
232
|
e.preventDefault();
|
|
234
|
-
const n = t.modelValue.slice(), a =
|
|
233
|
+
const n = t.modelValue.slice(), a = rt(n);
|
|
235
234
|
if (a < 0) return;
|
|
236
235
|
const i = n[a];
|
|
237
236
|
n.splice(a, 1);
|
|
238
237
|
const c = l.cachedOptions[a];
|
|
239
|
-
l.cachedOptions.splice(a, 1),
|
|
238
|
+
l.cachedOptions.splice(a, 1), U(c), E(n), v("remove-tag", i);
|
|
240
239
|
}
|
|
241
|
-
},
|
|
240
|
+
}, mt = () => {
|
|
242
241
|
let e;
|
|
243
|
-
w(t.modelValue) ? e = [] : e =
|
|
244
|
-
},
|
|
242
|
+
w(t.modelValue) ? e = [] : e = Le.value, l.selectedLabel = "", u.value = !1, E(e), v("clear"), j(), H();
|
|
243
|
+
}, Ce = (e, n = void 0) => {
|
|
245
244
|
const a = s.value;
|
|
246
|
-
if (!["forward", "backward"].includes(e) || x.value || a.length <= 0 ||
|
|
245
|
+
if (!["forward", "backward"].includes(e) || x.value || a.length <= 0 || Qe.value || oe.value)
|
|
247
246
|
return;
|
|
248
247
|
if (!u.value)
|
|
249
|
-
return
|
|
250
|
-
|
|
248
|
+
return q();
|
|
249
|
+
wt(n) && (n = l.hoveringIndex);
|
|
251
250
|
let i = -1;
|
|
252
251
|
e === "forward" ? (i = n + 1, i >= a.length && (i = 0)) : e === "backward" && (i = n - 1, (i < 0 || i >= a.length) && (i = a.length - 1));
|
|
253
252
|
const c = a[i];
|
|
254
253
|
if (R(c) || c.type === "Group")
|
|
255
|
-
return
|
|
256
|
-
l.hoveringIndex = i,
|
|
257
|
-
},
|
|
254
|
+
return Ce(e, i);
|
|
255
|
+
l.hoveringIndex = i, Z(i);
|
|
256
|
+
}, ht = () => {
|
|
258
257
|
if (u.value)
|
|
259
|
-
~l.hoveringIndex && s.value[l.hoveringIndex] &&
|
|
260
|
-
else return
|
|
261
|
-
},
|
|
258
|
+
~l.hoveringIndex && s.value[l.hoveringIndex] && ye(s.value[l.hoveringIndex]);
|
|
259
|
+
else return q();
|
|
260
|
+
}, vt = (e) => {
|
|
262
261
|
l.hoveringIndex = e ?? -1;
|
|
263
|
-
},
|
|
262
|
+
}, gt = () => {
|
|
264
263
|
t.multiple ? l.hoveringIndex = s.value.findIndex(
|
|
265
264
|
(e) => t.modelValue.some(
|
|
266
|
-
(n) =>
|
|
265
|
+
(n) => r(n) === r(d(e))
|
|
267
266
|
)
|
|
268
|
-
) : l.hoveringIndex = s.value.findIndex((e) => d(
|
|
269
|
-
},
|
|
267
|
+
) : l.hoveringIndex = s.value.findIndex((e) => r(d(e)) === r(t.modelValue));
|
|
268
|
+
}, Ee = (e) => {
|
|
270
269
|
if (l.inputValue = e.target.value, t.remote)
|
|
271
|
-
|
|
270
|
+
Oe();
|
|
272
271
|
else
|
|
273
|
-
return
|
|
274
|
-
},
|
|
275
|
-
if (u.value = !1,
|
|
272
|
+
return xe();
|
|
273
|
+
}, Vt = (e) => {
|
|
274
|
+
if (u.value = !1, se.value) {
|
|
276
275
|
const n = new FocusEvent("focus", e);
|
|
277
|
-
|
|
276
|
+
Ke(n);
|
|
278
277
|
}
|
|
279
|
-
},
|
|
280
|
-
~
|
|
281
|
-
})),
|
|
278
|
+
}, bt = () => (l.isBeforeHide = !1, h(() => {
|
|
279
|
+
~tt.value && Z(l.hoveringIndex);
|
|
280
|
+
})), Z = (e) => {
|
|
282
281
|
b.value.scrollToItem(e);
|
|
283
|
-
},
|
|
284
|
-
const a =
|
|
285
|
-
if (
|
|
286
|
-
const { option: i } =
|
|
282
|
+
}, Te = (e, n) => {
|
|
283
|
+
const a = r(e);
|
|
284
|
+
if (ve.value.has(a)) {
|
|
285
|
+
const { option: i } = ve.value.get(a);
|
|
287
286
|
return i;
|
|
288
287
|
}
|
|
289
288
|
if (n && n.length) {
|
|
290
289
|
const i = n.find(
|
|
291
|
-
(c) => d(
|
|
290
|
+
(c) => r(d(c)) === a
|
|
292
291
|
);
|
|
293
292
|
if (i)
|
|
294
293
|
return i;
|
|
295
294
|
}
|
|
296
295
|
return {
|
|
297
|
-
[
|
|
298
|
-
[
|
|
296
|
+
[ne.value.value]: e,
|
|
297
|
+
[ne.value.label]: e
|
|
299
298
|
};
|
|
300
|
-
},
|
|
299
|
+
}, B = (e = !1) => {
|
|
301
300
|
if (t.multiple)
|
|
302
301
|
if (t.modelValue.length > 0) {
|
|
303
302
|
const n = l.cachedOptions.slice();
|
|
304
303
|
l.cachedOptions.length = 0, l.previousValue = t.modelValue.toString();
|
|
305
304
|
for (const a of t.modelValue) {
|
|
306
|
-
const i =
|
|
305
|
+
const i = Te(a, n);
|
|
307
306
|
l.cachedOptions.push(i);
|
|
308
307
|
}
|
|
309
308
|
} else
|
|
310
309
|
l.cachedOptions = [], l.previousValue = void 0;
|
|
311
|
-
else if (
|
|
310
|
+
else if (N.value) {
|
|
312
311
|
l.previousValue = t.modelValue;
|
|
313
312
|
const n = s.value, a = n.findIndex(
|
|
314
|
-
(i) => d(
|
|
313
|
+
(i) => r(d(i)) === r(t.modelValue)
|
|
315
314
|
);
|
|
316
|
-
~a ? l.selectedLabel = g(n[a]) : (!l.selectedLabel || e) && (l.selectedLabel =
|
|
315
|
+
~a ? l.selectedLabel = g(n[a]) : (!l.selectedLabel || e) && (l.selectedLabel = r(t.modelValue));
|
|
317
316
|
} else
|
|
318
317
|
l.selectedLabel = "", l.previousValue = void 0;
|
|
319
|
-
|
|
318
|
+
j(), C();
|
|
320
319
|
};
|
|
321
320
|
return T(
|
|
322
321
|
() => t.fitInputWidth,
|
|
@@ -324,11 +323,11 @@ const sl = (t, v) => {
|
|
|
324
323
|
C();
|
|
325
324
|
}
|
|
326
325
|
), T(u, (e) => {
|
|
327
|
-
e ? (t.persistent || C(),
|
|
326
|
+
e ? (t.persistent || C(), J("")) : (l.inputValue = "", l.previousQuery = null, l.isBeforeHide = !0, Ve("")), v("visible-change", e);
|
|
328
327
|
}), T(
|
|
329
328
|
() => t.modelValue,
|
|
330
329
|
(e, n) => {
|
|
331
|
-
(!e || w(e) && e.length === 0 || t.multiple &&
|
|
330
|
+
(!e || w(e) && e.length === 0 || t.multiple && !_(e.toString(), l.previousValue) || !t.multiple && r(e) !== r(l.previousValue)) && B(!0), !_(e, n) && t.validateEvent && S?.validate?.("change").catch((i) => te(i));
|
|
332
331
|
},
|
|
333
332
|
{
|
|
334
333
|
deep: !0
|
|
@@ -337,7 +336,7 @@ const sl = (t, v) => {
|
|
|
337
336
|
() => t.options,
|
|
338
337
|
() => {
|
|
339
338
|
const e = V.value;
|
|
340
|
-
(!e || e && document.activeElement !== e) &&
|
|
339
|
+
(!e || e && document.activeElement !== e) && B();
|
|
341
340
|
},
|
|
342
341
|
{
|
|
343
342
|
deep: !0,
|
|
@@ -346,15 +345,15 @@ const sl = (t, v) => {
|
|
|
346
345
|
), T(
|
|
347
346
|
() => s.value,
|
|
348
347
|
() => (C(), b.value && h(b.value.resetScrollTop))
|
|
349
|
-
),
|
|
350
|
-
l.isBeforeHide ||
|
|
351
|
-
}),
|
|
348
|
+
), Se(() => {
|
|
349
|
+
l.isBeforeHide || he();
|
|
350
|
+
}), Se(() => {
|
|
352
351
|
const { valueKey: e, options: n } = t, a = /* @__PURE__ */ new Map();
|
|
353
352
|
for (const i of n) {
|
|
354
|
-
const c =
|
|
353
|
+
const c = d(i);
|
|
355
354
|
let f = c;
|
|
356
|
-
if (
|
|
357
|
-
|
|
355
|
+
if (ee(f) && (f = A(c, e)), a.get(f)) {
|
|
356
|
+
te(
|
|
358
357
|
"ElSelectV2",
|
|
359
358
|
"The option values you provided seem to be duplicated, which may cause some problems, please check."
|
|
360
359
|
);
|
|
@@ -362,83 +361,83 @@ const sl = (t, v) => {
|
|
|
362
361
|
} else
|
|
363
362
|
a.set(f, !0);
|
|
364
363
|
}
|
|
365
|
-
}),
|
|
366
|
-
|
|
367
|
-
}), p(
|
|
364
|
+
}), Et(() => {
|
|
365
|
+
B();
|
|
366
|
+
}), p(G, Ie), p(y, pe), p(b, Y), p(ue, Y), p(ie, we), p(F, ut), {
|
|
368
367
|
// data exports
|
|
369
|
-
inputId:
|
|
370
|
-
collapseTagSize:
|
|
371
|
-
currentPlaceholder:
|
|
368
|
+
inputId: We,
|
|
369
|
+
collapseTagSize: Ue,
|
|
370
|
+
currentPlaceholder: Ze,
|
|
372
371
|
expanded: u,
|
|
373
|
-
emptyText:
|
|
374
|
-
popupHeight:
|
|
375
|
-
debounce:
|
|
376
|
-
allOptions:
|
|
372
|
+
emptyText: fe,
|
|
373
|
+
popupHeight: ze,
|
|
374
|
+
debounce: re,
|
|
375
|
+
allOptions: ce,
|
|
377
376
|
filteredOptions: s,
|
|
378
377
|
iconComponent: de,
|
|
379
|
-
iconReverse:
|
|
380
|
-
tagStyle:
|
|
381
|
-
collapseTagStyle:
|
|
382
|
-
popperSize:
|
|
383
|
-
dropdownMenuVisible:
|
|
384
|
-
hasModelValue:
|
|
385
|
-
shouldShowPlaceholder:
|
|
378
|
+
iconReverse: _e,
|
|
379
|
+
tagStyle: Je,
|
|
380
|
+
collapseTagStyle: Xe,
|
|
381
|
+
popperSize: M,
|
|
382
|
+
dropdownMenuVisible: lt,
|
|
383
|
+
hasModelValue: N,
|
|
384
|
+
shouldShowPlaceholder: Ye,
|
|
386
385
|
selectDisabled: x,
|
|
387
|
-
selectSize:
|
|
388
|
-
needStatusIcon:
|
|
389
|
-
showClearBtn:
|
|
386
|
+
selectSize: ge,
|
|
387
|
+
needStatusIcon: ke,
|
|
388
|
+
showClearBtn: Ae,
|
|
390
389
|
states: l,
|
|
391
|
-
isFocused:
|
|
392
|
-
nsSelect:
|
|
393
|
-
nsInput:
|
|
390
|
+
isFocused: se,
|
|
391
|
+
nsSelect: $,
|
|
392
|
+
nsInput: Me,
|
|
394
393
|
// refs items exports
|
|
395
394
|
inputRef: V,
|
|
396
395
|
menuRef: b,
|
|
397
|
-
tagMenuRef:
|
|
398
|
-
tooltipRef:
|
|
399
|
-
tagTooltipRef:
|
|
400
|
-
selectRef:
|
|
401
|
-
wrapperRef:
|
|
396
|
+
tagMenuRef: ie,
|
|
397
|
+
tooltipRef: W,
|
|
398
|
+
tagTooltipRef: Q,
|
|
399
|
+
selectRef: G,
|
|
400
|
+
wrapperRef: ue,
|
|
402
401
|
selectionRef: y,
|
|
403
|
-
prefixRef:
|
|
404
|
-
suffixRef:
|
|
405
|
-
collapseItemRef:
|
|
406
|
-
popperRef:
|
|
407
|
-
validateState:
|
|
408
|
-
validateIcon:
|
|
409
|
-
showTagList:
|
|
410
|
-
collapseTagList:
|
|
402
|
+
prefixRef: Ne,
|
|
403
|
+
suffixRef: De,
|
|
404
|
+
collapseItemRef: F,
|
|
405
|
+
popperRef: et,
|
|
406
|
+
validateState: $e,
|
|
407
|
+
validateIcon: Ge,
|
|
408
|
+
showTagList: nt,
|
|
409
|
+
collapseTagList: at,
|
|
411
410
|
// methods exports
|
|
412
|
-
debouncedOnInputChange:
|
|
413
|
-
deleteTag:
|
|
411
|
+
debouncedOnInputChange: Oe,
|
|
412
|
+
deleteTag: st,
|
|
414
413
|
getLabel: g,
|
|
415
|
-
getValue:
|
|
414
|
+
getValue: d,
|
|
416
415
|
getDisabled: R,
|
|
417
|
-
getValueKey:
|
|
418
|
-
handleClear:
|
|
419
|
-
handleClickOutside:
|
|
420
|
-
handleDel:
|
|
416
|
+
getValueKey: r,
|
|
417
|
+
handleClear: mt,
|
|
418
|
+
handleClickOutside: Vt,
|
|
419
|
+
handleDel: ft,
|
|
421
420
|
handleEsc: dt,
|
|
422
|
-
focus:
|
|
423
|
-
blur:
|
|
424
|
-
handleMenuEnter:
|
|
425
|
-
handleResize:
|
|
426
|
-
resetSelectionWidth:
|
|
427
|
-
updateTooltip:
|
|
428
|
-
updateTagTooltip:
|
|
429
|
-
updateOptions:
|
|
430
|
-
toggleMenu:
|
|
431
|
-
scrollTo:
|
|
432
|
-
onInput:
|
|
433
|
-
onKeyboardNavigate:
|
|
434
|
-
onKeyboardSelect:
|
|
435
|
-
onSelect:
|
|
436
|
-
onHover:
|
|
437
|
-
handleCompositionStart:
|
|
438
|
-
handleCompositionEnd:
|
|
439
|
-
handleCompositionUpdate:
|
|
421
|
+
focus: H,
|
|
422
|
+
blur: ct,
|
|
423
|
+
handleMenuEnter: bt,
|
|
424
|
+
handleResize: Ie,
|
|
425
|
+
resetSelectionWidth: pe,
|
|
426
|
+
updateTooltip: Y,
|
|
427
|
+
updateTagTooltip: we,
|
|
428
|
+
updateOptions: he,
|
|
429
|
+
toggleMenu: q,
|
|
430
|
+
scrollTo: Z,
|
|
431
|
+
onInput: Ee,
|
|
432
|
+
onKeyboardNavigate: Ce,
|
|
433
|
+
onKeyboardSelect: ht,
|
|
434
|
+
onSelect: ye,
|
|
435
|
+
onHover: vt,
|
|
436
|
+
handleCompositionStart: He,
|
|
437
|
+
handleCompositionEnd: Be,
|
|
438
|
+
handleCompositionUpdate: Pe
|
|
440
439
|
};
|
|
441
440
|
};
|
|
442
441
|
export {
|
|
443
|
-
|
|
442
|
+
il as default
|
|
444
443
|
};
|