ep-craft 0.1.40 → 0.1.42
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/components/affix/affix.d.ts +8 -0
- package/dist/components/affix/affix.js +77 -138
- package/dist/components/dialog/EpDialog.vue.d.ts +2 -2
- package/dist/components/dialog/EpDialog.vue.js +19 -19
- package/dist/components/drawer/EpDrawer.vue.d.ts +2 -2
- package/dist/components/drawer/EpDrawer.vue.js +16 -16
- package/dist/components/input-number/EpInputNumber.vue.js +62 -63
- package/dist/components/input-number/input-number.d.ts +5 -0
- package/dist/components/input-number/input-number.js +6 -6
- package/dist/components/menu/menu.js +154 -164
- package/dist/components/message-box/src/index2.vue.js +10 -10
- package/dist/components/progress/src/progress.vue.d.ts +1 -1
- package/dist/components/select/index.d.ts +6 -3
- package/dist/components/select/select.d.ts +1 -0
- package/dist/components/select/select.js +3 -3
- package/dist/components/select/select.vue.d.ts +3 -1
- package/dist/components/select/select.vue.js +9 -9
- package/dist/components/select/select2.vue.js +73 -75
- package/dist/components/select-v2/src/defaults.d.ts +1 -0
- package/dist/components/select-v2/src/defaults.js +1 -1
- package/dist/components/select-v2/src/select.vue.d.ts +3 -1
- package/dist/components/select-v2/src/select.vue.js +21 -21
- package/dist/components/select-v2/src/select2.vue.js +27 -29
- package/dist/components/tree-select/src/tree-select.vue.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import J from "./select2.vue.js";
|
|
2
|
-
import { resolveComponent as b, resolveDirective as Q, withDirectives as c, openBlock as l, createElementBlock as n, mergeProps as
|
|
2
|
+
import { resolveComponent as b, resolveDirective as Q, withDirectives as c, openBlock as l, createElementBlock as n, mergeProps as V, toHandlerKey as W, createVNode as m, withCtx as i, withModifiers as v, normalizeClass as s, renderSlot as f, createCommentVNode as p, createBlock as u, Fragment as C, renderList as k, vShow as X, createElementVNode as r, toDisplayString as g, normalizeStyle as L, createTextVNode as A, resolveDynamicComponent as R } from "vue";
|
|
3
3
|
import Y from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
const Z = ["id"], x = ["id", "value", "name", "disabled", "autocomplete", "tabindex", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "aria-labelledby"], _ = ["textContent"], ee = { key: 1 };
|
|
5
5
|
function le(e, o, oe, se, ae, ne) {
|
|
6
6
|
const w = b("el-tag"), I = b("el-tooltip"), T = b("el-icon"), h = b("el-option"), F = b("el-option-group"), U = b("el-options"), j = b("el-scrollbar"), q = b("el-select-menu"), G = Q("click-outside");
|
|
7
|
-
return c((l(), n("div",
|
|
7
|
+
return c((l(), n("div", V({
|
|
8
8
|
ref: "selectRef",
|
|
9
9
|
class: [e.nsSelect.b(), e.nsSelect.m(e.selectSize)]
|
|
10
10
|
}, {
|
|
@@ -88,7 +88,7 @@ function le(e, o, oe, se, ae, ne) {
|
|
|
88
88
|
type: e.tagType,
|
|
89
89
|
effect: e.tagEffect,
|
|
90
90
|
"disable-transitions": "",
|
|
91
|
-
style:
|
|
91
|
+
style: L(e.tagStyle),
|
|
92
92
|
onClose: ($) => e.deleteTag($, t)
|
|
93
93
|
}, {
|
|
94
94
|
default: i(() => [
|
|
@@ -141,7 +141,7 @@ function le(e, o, oe, se, ae, ne) {
|
|
|
141
141
|
type: e.tagType,
|
|
142
142
|
effect: e.tagEffect,
|
|
143
143
|
"disable-transitions": "",
|
|
144
|
-
style:
|
|
144
|
+
style: L(e.collapseTagStyle)
|
|
145
145
|
}, {
|
|
146
146
|
default: i(() => [
|
|
147
147
|
r("span", {
|
|
@@ -211,7 +211,7 @@ function le(e, o, oe, se, ae, ne) {
|
|
|
211
211
|
class: s([e.nsSelect.e("input"), e.nsSelect.is(e.selectSize)]),
|
|
212
212
|
disabled: e.selectDisabled,
|
|
213
213
|
autocomplete: e.autocomplete,
|
|
214
|
-
style:
|
|
214
|
+
style: L(e.inputStyle),
|
|
215
215
|
tabindex: e.tabindex,
|
|
216
216
|
role: "combobox",
|
|
217
217
|
readonly: !e.filterable,
|
|
@@ -220,7 +220,7 @@ function le(e, o, oe, se, ae, ne) {
|
|
|
220
220
|
"aria-controls": e.contentId,
|
|
221
221
|
"aria-expanded": e.dropdownMenuVisible,
|
|
222
222
|
"aria-label": e.ariaLabel,
|
|
223
|
-
"aria-labelledby": e.
|
|
223
|
+
"aria-labelledby": e.ariaLabelledbyValue,
|
|
224
224
|
"aria-autocomplete": "none",
|
|
225
225
|
"aria-haspopup": "listbox",
|
|
226
226
|
onKeydown: o[0] || (o[0] = (...a) => e.handleKeydown && e.handleKeydown(...a)),
|
|
@@ -324,7 +324,7 @@ function le(e, o, oe, se, ae, ne) {
|
|
|
324
324
|
class: s([e.nsSelect.is("empty", e.filteredOptionsCount === 0)]),
|
|
325
325
|
role: "listbox",
|
|
326
326
|
"aria-label": e.ariaLabel,
|
|
327
|
-
"aria-labelledby": e.
|
|
327
|
+
"aria-labelledby": e.ariaLabelledbyValue,
|
|
328
328
|
"aria-orientation": "vertical",
|
|
329
329
|
onScroll: e.popupScroll,
|
|
330
330
|
onEndReached: e.endReached
|
|
@@ -347,12 +347,12 @@ function le(e, o, oe, se, ae, ne) {
|
|
|
347
347
|
disabled: e.getDisabled(d)
|
|
348
348
|
}, {
|
|
349
349
|
default: i(() => [
|
|
350
|
-
(l(!0), n(C, null, k(e.getOptions(d), (y) => (l(), u(h,
|
|
350
|
+
(l(!0), n(C, null, k(e.getOptions(d), (y) => (l(), u(h, V({
|
|
351
351
|
key: e.getValue(y)
|
|
352
352
|
}, { ref_for: !0 }, e.getOptionProps(y)), null, 16))), 128))
|
|
353
353
|
]),
|
|
354
354
|
_: 2
|
|
355
|
-
}, 1032, ["label", "disabled"])) : (l(), u(h,
|
|
355
|
+
}, 1032, ["label", "disabled"])) : (l(), u(h, V({
|
|
356
356
|
key: 1,
|
|
357
357
|
ref_for: !0
|
|
358
358
|
}, e.getOptionProps(d)), null, 16))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as A, getCurrentInstance as P, computed as b, reactive as T, toRefs as k, toRef as N, watch as F, provide as I, onBeforeUnmount as j } from "vue";
|
|
2
2
|
import G from "../../directives/click-outside/index.js";
|
|
3
3
|
import { EpTooltip as B } from "../tooltip/index.js";
|
|
4
4
|
import { EpScrollbar as K } from "../scrollbar/index.js";
|
|
@@ -15,82 +15,80 @@ import { useProps as Z } from "../select-v2/src/useProps.js";
|
|
|
15
15
|
import $ from "./src/option.vue.js";
|
|
16
16
|
import ee from "./src/select-dropdown.vue.js";
|
|
17
17
|
import { useSelect as te } from "./src/useSelect.js";
|
|
18
|
-
import { selectKey as
|
|
19
|
-
import
|
|
20
|
-
import { selectEmits as
|
|
21
|
-
import
|
|
18
|
+
import { selectKey as re } from "./src/token.js";
|
|
19
|
+
import oe from "./src/options.js";
|
|
20
|
+
import { selectEmits as ne, selectProps as ae } from "./select.js";
|
|
21
|
+
import le from "./src/option-group.vue.js";
|
|
22
22
|
import { isArray as ie, isObject as E } from "@vue/shared";
|
|
23
|
-
const y = "EpSelect", m = /* @__PURE__ */ new WeakMap(), ce = (
|
|
24
|
-
var
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
23
|
+
const y = "EpSelect", m = /* @__PURE__ */ new WeakMap(), ce = (t) => (...o) => {
|
|
24
|
+
var u, s, p;
|
|
25
|
+
const a = o[0];
|
|
26
|
+
if (!a || a.includes(
|
|
27
27
|
'Slot "default" invoked outside of the render function'
|
|
28
|
-
) && ((
|
|
28
|
+
) && ((u = o[2]) != null && u.includes("ElTreeSelect") || (s = o[2]) != null && s.includes("EpTreeSelect")))
|
|
29
29
|
return;
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
|
|
30
|
+
const l = (p = m.get(t)) == null ? void 0 : p.originalWarnHandler;
|
|
31
|
+
if (l) {
|
|
32
|
+
l(...o);
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
console.warn(...
|
|
36
|
-
}, se = (
|
|
37
|
-
let
|
|
38
|
-
return
|
|
39
|
-
originalWarnHandler:
|
|
40
|
-
handler: ce(
|
|
35
|
+
console.warn(...o);
|
|
36
|
+
}, se = (t) => {
|
|
37
|
+
let o = m.get(t);
|
|
38
|
+
return o || (o = {
|
|
39
|
+
originalWarnHandler: t.config.warnHandler,
|
|
40
|
+
handler: ce(t),
|
|
41
41
|
count: 0
|
|
42
|
-
}, m.set(
|
|
43
|
-
},
|
|
42
|
+
}, m.set(t, o)), o;
|
|
43
|
+
}, xe = A({
|
|
44
44
|
name: y,
|
|
45
45
|
componentName: y,
|
|
46
46
|
components: {
|
|
47
47
|
ElSelectMenu: ee,
|
|
48
48
|
ElOption: $,
|
|
49
|
-
ElOptions:
|
|
50
|
-
ElOptionGroup:
|
|
49
|
+
ElOptions: oe,
|
|
50
|
+
ElOptionGroup: le,
|
|
51
51
|
ElTag: U,
|
|
52
52
|
ElScrollbar: K,
|
|
53
53
|
ElTooltip: B,
|
|
54
54
|
ElIcon: q
|
|
55
55
|
},
|
|
56
56
|
directives: { ClickOutside: G },
|
|
57
|
-
props:
|
|
58
|
-
emits:
|
|
59
|
-
setup(
|
|
60
|
-
const
|
|
61
|
-
|
|
57
|
+
props: ae,
|
|
58
|
+
emits: ne,
|
|
59
|
+
setup(t, { emit: o, slots: a }) {
|
|
60
|
+
const l = P(), u = se(l.appContext);
|
|
61
|
+
u.count += 1, l.appContext.config.warnHandler = u.handler;
|
|
62
62
|
const s = b(() => {
|
|
63
|
-
const { modelValue: e, multiple: i } =
|
|
64
|
-
return ie(e) ? i ? e :
|
|
65
|
-
}),
|
|
66
|
-
...k(
|
|
63
|
+
const { modelValue: e, multiple: i } = t, n = i ? [] : void 0;
|
|
64
|
+
return ie(e) ? i ? e : n : i ? n : e;
|
|
65
|
+
}), p = T({
|
|
66
|
+
...k(t),
|
|
67
67
|
modelValue: s
|
|
68
|
-
}),
|
|
69
|
-
floatLabel: N(
|
|
70
|
-
isFocused:
|
|
71
|
-
hasValue:
|
|
72
|
-
isDisabled:
|
|
68
|
+
}), r = te(p, o), { floatLabelClass: w } = Y({
|
|
69
|
+
floatLabel: N(t, "floatLabel"),
|
|
70
|
+
isFocused: r.isFocused,
|
|
71
|
+
hasValue: r.hasModelValue,
|
|
72
|
+
isDisabled: r.selectDisabled
|
|
73
73
|
}), { t: D } = J(), h = b(
|
|
74
|
-
() =>
|
|
75
|
-
), O = Q(), H = b(
|
|
76
|
-
()
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}), S = (e) => e.reduce((i, r) => (i.push(r), r.children && r.children.length > 0 && i.push(...S(r.children)), i), []), A = (e) => {
|
|
82
|
-
z(e || []).forEach((r) => {
|
|
74
|
+
() => t.placeholder ?? D("el.select.placeholder")
|
|
75
|
+
), O = Q(), H = b(() => t.ariaLabelledby ? t.ariaLabelledby : t.floatLabel && h.value && !t.ariaLabel ? O.value : void 0), { calculatorRef: R, inputStyle: M } = X(), { getLabel: L, getValue: g, getOptions: V, getDisabled: v } = Z(t), W = (e) => ({
|
|
76
|
+
label: L(e),
|
|
77
|
+
value: g(e),
|
|
78
|
+
disabled: v(e)
|
|
79
|
+
}), S = (e) => e.reduce((i, n) => (i.push(n), n.children && n.children.length > 0 && i.push(...S(n.children)), i), []), x = (e) => {
|
|
80
|
+
z(e || []).forEach((n) => {
|
|
83
81
|
var C;
|
|
84
|
-
const d =
|
|
85
|
-
if (E(
|
|
82
|
+
const d = n.type.name;
|
|
83
|
+
if (E(n) && (d === "ElOption" || d === "ElTree" || d === "EpTree")) {
|
|
86
84
|
if (d === "ElTree" || d === "EpTree") {
|
|
87
|
-
const c = ((C =
|
|
85
|
+
const c = ((C = n.props) == null ? void 0 : C.data) || [];
|
|
88
86
|
S(c).forEach((f) => {
|
|
89
|
-
f.currentLabel = f.label ?? (E(f.value) ? "" : f.value),
|
|
87
|
+
f.currentLabel = f.label ?? (E(f.value) ? "" : f.value), r.onOptionCreate(f);
|
|
90
88
|
});
|
|
91
89
|
} else if (d === "ElOption") {
|
|
92
|
-
const c = { ...
|
|
93
|
-
c.currentLabel = c.label ?? (E(c.value) ? "" : c.value),
|
|
90
|
+
const c = { ...n.props };
|
|
91
|
+
c.currentLabel = c.label ?? (E(c.value) ? "" : c.value), r.onOptionCreate(c);
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
94
|
});
|
|
@@ -99,52 +97,52 @@ const y = "EpSelect", m = /* @__PURE__ */ new WeakMap(), ce = (o) => (...n) => {
|
|
|
99
97
|
() => {
|
|
100
98
|
var e;
|
|
101
99
|
return [
|
|
102
|
-
|
|
100
|
+
t.persistent || r.expanded.value || !a.default || (e = a.default) == null ? void 0 : e.call(a),
|
|
103
101
|
s.value
|
|
104
102
|
];
|
|
105
103
|
},
|
|
106
104
|
() => {
|
|
107
105
|
var e;
|
|
108
|
-
|
|
106
|
+
t.persistent || r.expanded.value || a.default && (r.states.options.clear(), x((e = a.default) == null ? void 0 : e.call(a)));
|
|
109
107
|
},
|
|
110
108
|
{
|
|
111
109
|
immediate: !0
|
|
112
110
|
}
|
|
113
111
|
), I(
|
|
114
|
-
|
|
112
|
+
re,
|
|
115
113
|
T({
|
|
116
|
-
props:
|
|
117
|
-
states:
|
|
118
|
-
selectRef:
|
|
119
|
-
optionsArray:
|
|
120
|
-
setSelected:
|
|
121
|
-
handleOptionSelect:
|
|
122
|
-
onOptionCreate:
|
|
123
|
-
onOptionDestroy:
|
|
114
|
+
props: p,
|
|
115
|
+
states: r.states,
|
|
116
|
+
selectRef: r.selectRef,
|
|
117
|
+
optionsArray: r.optionsArray,
|
|
118
|
+
setSelected: r.setSelected,
|
|
119
|
+
handleOptionSelect: r.handleOptionSelect,
|
|
120
|
+
onOptionCreate: r.onOptionCreate,
|
|
121
|
+
onOptionDestroy: r.onOptionDestroy
|
|
124
122
|
})
|
|
125
123
|
);
|
|
126
|
-
const
|
|
124
|
+
const _ = b(() => t.multiple ? r.states.selected.map((e) => e.currentLabel) : r.states.selectedLabel);
|
|
127
125
|
return j(() => {
|
|
128
|
-
const e = m.get(
|
|
129
|
-
e && (e.count -= 1, e.count <= 0 && (
|
|
126
|
+
const e = m.get(l.appContext);
|
|
127
|
+
e && (e.count -= 1, e.count <= 0 && (l.appContext.config.warnHandler = e.originalWarnHandler, m.delete(l.appContext)));
|
|
130
128
|
}), {
|
|
131
|
-
...
|
|
129
|
+
...r,
|
|
132
130
|
modelValue: s,
|
|
133
|
-
selectedLabel:
|
|
131
|
+
selectedLabel: _,
|
|
134
132
|
floatLabelClass: w,
|
|
135
133
|
floatLabelText: h,
|
|
136
134
|
floatLabelId: O,
|
|
137
|
-
|
|
135
|
+
ariaLabelledbyValue: H,
|
|
138
136
|
calculatorRef: R,
|
|
139
137
|
inputStyle: M,
|
|
140
|
-
getLabel:
|
|
141
|
-
getValue:
|
|
142
|
-
getOptions:
|
|
143
|
-
getDisabled:
|
|
144
|
-
getOptionProps:
|
|
138
|
+
getLabel: L,
|
|
139
|
+
getValue: g,
|
|
140
|
+
getOptions: V,
|
|
141
|
+
getDisabled: v,
|
|
142
|
+
getOptionProps: W
|
|
145
143
|
};
|
|
146
144
|
}
|
|
147
145
|
});
|
|
148
146
|
export {
|
|
149
|
-
|
|
147
|
+
xe as default
|
|
150
148
|
};
|
|
@@ -24,6 +24,7 @@ export interface TagTooltipProps {
|
|
|
24
24
|
}
|
|
25
25
|
export declare const selectV2Props: {
|
|
26
26
|
readonly ariaLabel: StringConstructor;
|
|
27
|
+
readonly ariaLabelledby: StringConstructor;
|
|
27
28
|
readonly emptyValues: ArrayConstructor;
|
|
28
29
|
readonly valueOnClear: import("../../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
|
|
29
30
|
readonly floatLabel: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
2
|
readonly ariaLabel: StringConstructor;
|
|
3
|
+
readonly ariaLabelledby: StringConstructor;
|
|
3
4
|
readonly emptyValues: ArrayConstructor;
|
|
4
5
|
readonly valueOnClear: import("../../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
|
|
5
6
|
readonly floatLabel: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
@@ -201,7 +202,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
201
202
|
floatLabelClass: import("vue").ComputedRef<import("../../../hooks/index.js").FloatLabelClass>;
|
|
202
203
|
floatLabelText: import("vue").ComputedRef<string>;
|
|
203
204
|
floatLabelId: import("vue").Ref<string, string>;
|
|
204
|
-
|
|
205
|
+
ariaLabelledbyValue: import("vue").ComputedRef<string | undefined>;
|
|
205
206
|
calculatorRef: import("vue").ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
206
207
|
inputStyle: import("vue").ComputedRef<{
|
|
207
208
|
minWidth: string;
|
|
@@ -339,6 +340,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
339
340
|
clear: () => boolean;
|
|
340
341
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
341
342
|
readonly ariaLabel: StringConstructor;
|
|
343
|
+
readonly ariaLabelledby: StringConstructor;
|
|
342
344
|
readonly emptyValues: ArrayConstructor;
|
|
343
345
|
readonly valueOnClear: import("../../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
|
|
344
346
|
readonly floatLabel: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import W from "./select2.vue.js";
|
|
2
|
-
import { resolveComponent as y, resolveDirective as Z, withDirectives as P, openBlock as s, createElementBlock as r, normalizeClass as o, createVNode as m, withCtx as i, createSlots as j, renderSlot as d, normalizeProps as q, guardReactiveProps as G, createElementVNode as n, withModifiers as p, toDisplayString as u, createCommentVNode as f, Fragment as
|
|
2
|
+
import { resolveComponent as y, resolveDirective as Z, withDirectives as P, openBlock as s, createElementBlock as r, normalizeClass as o, createVNode as m, withCtx as i, createSlots as j, renderSlot as d, normalizeProps as q, guardReactiveProps as G, createElementVNode as n, withModifiers as p, toDisplayString as u, createCommentVNode as f, Fragment as H, renderList as N, normalizeStyle as T, createTextVNode as A, createBlock as b, withKeys as v, resolveDynamicComponent as w, vShow as J } from "vue";
|
|
3
3
|
import Q from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
const X = ["id"], Y = ["id", "value", "autocomplete", "tabindex", "aria-expanded", "aria-label", "aria-labelledby", "disabled", "aria-controls", "aria-activedescendant", "readonly", "name"], c = ["textContent"], x = { key: 1 };
|
|
5
5
|
function _(e, l, ee, le, oe, ae) {
|
|
@@ -7,8 +7,8 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
7
7
|
return P((s(), r("div", {
|
|
8
8
|
ref: "selectRef",
|
|
9
9
|
class: o([e.nsSelect.b(), e.nsSelect.m(e.selectSize)]),
|
|
10
|
-
onMouseenter: l[15] || (l[15] = (
|
|
11
|
-
onMouseleave: l[16] || (l[16] = (
|
|
10
|
+
onMouseenter: l[15] || (l[15] = (g) => e.states.inputHovering = !0),
|
|
11
|
+
onMouseleave: l[16] || (l[16] = (g) => e.states.inputHovering = !1)
|
|
12
12
|
}, [
|
|
13
13
|
m(k, {
|
|
14
14
|
ref: "tooltipRef",
|
|
@@ -30,10 +30,10 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
30
30
|
"show-arrow": e.showArrow,
|
|
31
31
|
offset: e.offset,
|
|
32
32
|
onBeforeShow: e.handleMenuEnter,
|
|
33
|
-
onHide: l[14] || (l[14] = (
|
|
33
|
+
onHide: l[14] || (l[14] = (g) => e.states.isBeforeHide = !1)
|
|
34
34
|
}, {
|
|
35
35
|
default: i(() => {
|
|
36
|
-
var
|
|
36
|
+
var g;
|
|
37
37
|
return [
|
|
38
38
|
n("div", {
|
|
39
39
|
ref: "wrapperRef",
|
|
@@ -76,7 +76,7 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
76
76
|
}, () => {
|
|
77
77
|
var a, I, $, V, R, L, z, D, E, M, O, B, K;
|
|
78
78
|
return [
|
|
79
|
-
(s(!0), r(
|
|
79
|
+
(s(!0), r(H, null, N(e.showTagList, (t) => (s(), r("div", {
|
|
80
80
|
key: e.getValueKey(e.getValue(t)),
|
|
81
81
|
class: o(e.nsSelect.e("selected-item"))
|
|
82
82
|
}, [
|
|
@@ -98,14 +98,14 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
98
98
|
label: e.getLabel(t),
|
|
99
99
|
value: e.getValue(t)
|
|
100
100
|
}, () => [
|
|
101
|
-
|
|
101
|
+
A(u(e.getLabel(t)), 1)
|
|
102
102
|
])
|
|
103
103
|
], 2)
|
|
104
104
|
]),
|
|
105
105
|
_: 2
|
|
106
106
|
}, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
|
|
107
107
|
], 2))), 128)),
|
|
108
|
-
e.collapseTags && e.states.cachedOptions.length > e.maxCollapseTags ? (s(),
|
|
108
|
+
e.collapseTags && e.states.cachedOptions.length > e.maxCollapseTags ? (s(), b(k, {
|
|
109
109
|
key: 0,
|
|
110
110
|
ref: "tagTooltipRef",
|
|
111
111
|
disabled: e.dropdownMenuVisible || !e.collapseTagsTooltip,
|
|
@@ -155,7 +155,7 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
155
155
|
ref: "tagMenuRef",
|
|
156
156
|
class: o(e.nsSelect.e("selection"))
|
|
157
157
|
}, [
|
|
158
|
-
(s(!0), r(
|
|
158
|
+
(s(!0), r(H, null, N(e.collapseTagList, (t) => (s(), r("div", {
|
|
159
159
|
key: e.getValueKey(e.getValue(t)),
|
|
160
160
|
class: o(e.nsSelect.e("selected-item"))
|
|
161
161
|
}, [
|
|
@@ -177,7 +177,7 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
177
177
|
label: e.getLabel(t),
|
|
178
178
|
value: e.getValue(t)
|
|
179
179
|
}, () => [
|
|
180
|
-
|
|
180
|
+
A(u(e.getLabel(t)), 1)
|
|
181
181
|
])
|
|
182
182
|
], 2)
|
|
183
183
|
]),
|
|
@@ -212,7 +212,7 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
212
212
|
autocapitalize: "off",
|
|
213
213
|
"aria-expanded": e.expanded,
|
|
214
214
|
"aria-label": e.ariaLabel,
|
|
215
|
-
"aria-labelledby": e.
|
|
215
|
+
"aria-labelledby": e.ariaLabelledbyValue,
|
|
216
216
|
class: o([e.nsSelect.e("input"), e.nsSelect.is(e.selectSize)]),
|
|
217
217
|
disabled: e.selectDisabled,
|
|
218
218
|
role: "combobox",
|
|
@@ -257,7 +257,7 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
257
257
|
])
|
|
258
258
|
}, [
|
|
259
259
|
e.hasModelValue ? d(e.$slots, "label", {
|
|
260
|
-
index: ((
|
|
260
|
+
index: ((g = e.allOptionsValueMap.get(e.modelValue)) == null ? void 0 : g.index) ?? -1,
|
|
261
261
|
label: e.currentPlaceholder,
|
|
262
262
|
value: e.modelValue
|
|
263
263
|
}, () => [
|
|
@@ -269,18 +269,18 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
269
269
|
ref: "suffixRef",
|
|
270
270
|
class: o(e.nsSelect.e("suffix"))
|
|
271
271
|
}, [
|
|
272
|
-
e.iconComponent ? P((s(),
|
|
272
|
+
e.iconComponent ? P((s(), b(h, {
|
|
273
273
|
key: 0,
|
|
274
274
|
class: o([e.nsSelect.e("caret"), e.nsInput.e("icon"), e.iconReverse])
|
|
275
275
|
}, {
|
|
276
276
|
default: i(() => [
|
|
277
|
-
(s(),
|
|
277
|
+
(s(), b(w(e.iconComponent)))
|
|
278
278
|
]),
|
|
279
279
|
_: 1
|
|
280
280
|
}, 8, ["class"])), [
|
|
281
281
|
[J, !e.showClearBtn]
|
|
282
282
|
]) : f("", !0),
|
|
283
|
-
e.showClearBtn && e.clearIcon ? (s(),
|
|
283
|
+
e.showClearBtn && e.clearIcon ? (s(), b(h, {
|
|
284
284
|
key: 1,
|
|
285
285
|
class: o([
|
|
286
286
|
e.nsSelect.e("caret"),
|
|
@@ -290,11 +290,11 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
290
290
|
onClick: p(e.handleClear, ["prevent", "stop"])
|
|
291
291
|
}, {
|
|
292
292
|
default: i(() => [
|
|
293
|
-
(s(),
|
|
293
|
+
(s(), b(w(e.clearIcon)))
|
|
294
294
|
]),
|
|
295
295
|
_: 1
|
|
296
296
|
}, 8, ["class", "onClick"])) : f("", !0),
|
|
297
|
-
e.validateState && e.validateIcon && e.needStatusIcon ? (s(),
|
|
297
|
+
e.validateState && e.validateIcon && e.needStatusIcon ? (s(), b(h, {
|
|
298
298
|
key: 2,
|
|
299
299
|
class: o([
|
|
300
300
|
e.nsInput.e("icon"),
|
|
@@ -303,7 +303,7 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
303
303
|
])
|
|
304
304
|
}, {
|
|
305
305
|
default: i(() => [
|
|
306
|
-
(s(),
|
|
306
|
+
(s(), b(w(e.validateIcon)))
|
|
307
307
|
]),
|
|
308
308
|
_: 1
|
|
309
309
|
}, 8, ["class"])) : f("", !0)
|
|
@@ -320,11 +320,11 @@ function _(e, l, ee, le, oe, ae) {
|
|
|
320
320
|
"hovering-index": e.states.hoveringIndex,
|
|
321
321
|
"scrollbar-always-on": e.scrollbarAlwaysOn,
|
|
322
322
|
"aria-label": e.ariaLabel,
|
|
323
|
-
"aria-labelledby": e.
|
|
323
|
+
"aria-labelledby": e.ariaLabelledbyValue,
|
|
324
324
|
onEndReached: e.onEndReached
|
|
325
325
|
}, j({
|
|
326
|
-
default: i((
|
|
327
|
-
d(e.$slots, "default", q(G(
|
|
326
|
+
default: i((g) => [
|
|
327
|
+
d(e.$slots, "default", q(G(g)))
|
|
328
328
|
]),
|
|
329
329
|
_: 2
|
|
330
330
|
}, [
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as I, computed as l, reactive as m, toRefs as d, toRef as V, provide as h } from "vue";
|
|
2
2
|
import R from "../../../directives/click-outside/index.js";
|
|
3
3
|
import { EpTooltip as S } from "../../tooltip/index.js";
|
|
4
4
|
import { EpTag as g } from "../../tag/index.js";
|
|
5
5
|
import { EpIcon as T } from "../../icon/index.js";
|
|
6
6
|
import { useLocale as H } from "../../../hooks/use-locale/index.js";
|
|
7
|
-
import { useId as
|
|
7
|
+
import { useId as f } from "../../../hooks/use-id/index.js";
|
|
8
8
|
import "../../../hooks/use-size/index.js";
|
|
9
9
|
import "../../../hooks/use-aria/index.js";
|
|
10
10
|
import { useCalcInputWidth as K } from "../../../hooks/use-calc-input-width/index.js";
|
|
11
11
|
import { useFloatLabel as O } from "../../../hooks/use-float-label/index.js";
|
|
12
12
|
import x from "./select-dropdown.js";
|
|
13
|
-
import
|
|
14
|
-
import { selectV2Emits as
|
|
15
|
-
import { selectV2InjectionKey as
|
|
13
|
+
import C from "./useSelect.js";
|
|
14
|
+
import { selectV2Emits as D, selectV2Props as _ } from "./defaults.js";
|
|
15
|
+
import { selectV2InjectionKey as A } from "./token.js";
|
|
16
16
|
import { BORDER_HORIZONTAL_WIDTH as F } from "../../../constants/form.js";
|
|
17
17
|
import { isArray as M } from "@vue/shared";
|
|
18
|
-
const ee =
|
|
18
|
+
const ee = I({
|
|
19
19
|
name: "EpSelectV2",
|
|
20
20
|
components: {
|
|
21
21
|
ElSelectMenu: x,
|
|
@@ -24,54 +24,52 @@ const ee = h({
|
|
|
24
24
|
ElIcon: T
|
|
25
25
|
},
|
|
26
26
|
directives: { ClickOutside: R },
|
|
27
|
-
props:
|
|
28
|
-
emits:
|
|
29
|
-
setup(
|
|
27
|
+
props: _,
|
|
28
|
+
emits: D,
|
|
29
|
+
setup(t, { emit: u }) {
|
|
30
30
|
const a = l(() => {
|
|
31
|
-
const { modelValue:
|
|
32
|
-
return M(
|
|
33
|
-
}), e =
|
|
31
|
+
const { modelValue: o, multiple: r } = t, s = r ? [] : void 0;
|
|
32
|
+
return M(o) ? r ? o : s : r ? s : o;
|
|
33
|
+
}), e = C(
|
|
34
34
|
m({
|
|
35
|
-
...
|
|
35
|
+
...d(t),
|
|
36
36
|
modelValue: a
|
|
37
37
|
}),
|
|
38
|
-
|
|
39
|
-
), { floatLabelClass:
|
|
40
|
-
floatLabel: V(
|
|
38
|
+
u
|
|
39
|
+
), { floatLabelClass: p } = O({
|
|
40
|
+
floatLabel: V(t, "floatLabel"),
|
|
41
41
|
isFocused: e.isFocused,
|
|
42
42
|
hasValue: e.hasModelValue,
|
|
43
43
|
isDisabled: e.selectDisabled
|
|
44
44
|
}), { t: b } = H(), i = l(
|
|
45
|
-
() =>
|
|
46
|
-
), c =
|
|
47
|
-
|
|
48
|
-
), { calculatorRef: v, inputStyle: E } = K(), s = d();
|
|
49
|
-
y(_, {
|
|
45
|
+
() => t.placeholder ?? b("el.select.placeholder")
|
|
46
|
+
), c = f(), L = l(() => t.ariaLabelledby ? t.ariaLabelledby : t.floatLabel && i.value && !t.ariaLabel ? c.value : void 0), { calculatorRef: v, inputStyle: y } = K(), n = f();
|
|
47
|
+
h(A, {
|
|
50
48
|
props: m({
|
|
51
|
-
...
|
|
49
|
+
...d(t),
|
|
52
50
|
height: e.popupHeight,
|
|
53
51
|
modelValue: a
|
|
54
52
|
}),
|
|
55
53
|
expanded: e.expanded,
|
|
56
54
|
tooltipRef: e.tooltipRef,
|
|
57
|
-
contentId:
|
|
55
|
+
contentId: n,
|
|
58
56
|
onSelect: e.onSelect,
|
|
59
57
|
onHover: e.onHover,
|
|
60
58
|
onKeyboardNavigate: e.onKeyboardNavigate,
|
|
61
59
|
onKeyboardSelect: e.onKeyboardSelect
|
|
62
60
|
});
|
|
63
|
-
const
|
|
61
|
+
const E = l(() => t.multiple ? e.states.cachedOptions.map((o) => e.getLabel(o)) : e.states.selectedLabel);
|
|
64
62
|
return {
|
|
65
63
|
...e,
|
|
66
64
|
modelValue: a,
|
|
67
|
-
selectedLabel:
|
|
68
|
-
floatLabelClass:
|
|
65
|
+
selectedLabel: E,
|
|
66
|
+
floatLabelClass: p,
|
|
69
67
|
floatLabelText: i,
|
|
70
68
|
floatLabelId: c,
|
|
71
|
-
|
|
69
|
+
ariaLabelledbyValue: L,
|
|
72
70
|
calculatorRef: v,
|
|
73
|
-
inputStyle:
|
|
74
|
-
contentId:
|
|
71
|
+
inputStyle: y,
|
|
72
|
+
contentId: n,
|
|
75
73
|
BORDER_HORIZONTAL_WIDTH: F
|
|
76
74
|
};
|
|
77
75
|
}
|
|
@@ -88,6 +88,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
88
88
|
__epPropKey: true;
|
|
89
89
|
};
|
|
90
90
|
ariaLabel: StringConstructor;
|
|
91
|
+
ariaLabelledby: StringConstructor;
|
|
91
92
|
emptyValues: ArrayConstructor;
|
|
92
93
|
valueOnClear: import("../../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
|
|
93
94
|
floatLabel: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
@@ -266,6 +267,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
266
267
|
__epPropKey: true;
|
|
267
268
|
};
|
|
268
269
|
ariaLabel: StringConstructor;
|
|
270
|
+
ariaLabelledby: StringConstructor;
|
|
269
271
|
emptyValues: ArrayConstructor;
|
|
270
272
|
valueOnClear: import("../../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
|
|
271
273
|
floatLabel: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|