x-next 1.2.0 → 1.3.1
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/AI_USAGE.md +647 -0
- package/CHANGELOG.md +22 -0
- package/README.md +8 -0
- package/dist/components/dropdown/Dropdown.vue.d.ts +27 -1
- package/dist/components/dropdown/DropdownButton.vue.d.ts +27 -1
- package/dist/components/dropdown/DropdownOption.vue.d.ts +2 -0
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +158 -1
- package/dist/components/dropdown/context.d.ts +14 -1
- package/dist/components/dropdown/dropdown-panel.vue.d.ts +7 -1
- package/dist/components/dropdown/index.d.ts +588 -6
- package/dist/components/dropdown/use-keyboard.d.ts +10 -0
- package/dist/components/form-select/hooks/use-select.d.ts +2 -1
- package/dist/es/_hooks/use-overflow.js +45 -40
- package/dist/es/components/_components/select-view/select-view.js +49 -55
- package/dist/es/components/dialog/Dialog.js +106 -97
- package/dist/es/components/dropdown/Dropdown.vue.js +18 -15
- package/dist/es/components/dropdown/Dropdown.vue2.js +52 -31
- package/dist/es/components/dropdown/DropdownOption.vue.js +22 -21
- package/dist/es/components/dropdown/DropdownOption.vue2.js +23 -19
- package/dist/es/components/dropdown/DropdownSubmenu.vue.js +49 -36
- package/dist/es/components/dropdown/DropdownSubmenu.vue2.js +45 -24
- package/dist/es/components/dropdown/context.js +3 -2
- package/dist/es/components/dropdown/dropdown-panel.vue.js +24 -21
- package/dist/es/components/dropdown/dropdown-panel.vue2.js +83 -31
- package/dist/es/components/dropdown/use-keyboard.js +45 -0
- package/dist/es/components/form-checkbox/Checkbox.js +49 -49
- package/dist/es/components/form-select/Select.js +25 -24
- package/dist/es/components/form-select/hooks/use-select.js +128 -128
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/style/base.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +9 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
1
|
+
import l from "./Dropdown.vue2.js";
|
|
2
|
+
import { resolveComponent as n, openBlock as a, createBlock as d, withCtx as e, createVNode as i, createSlots as m, renderSlot as t } from "vue";
|
|
3
3
|
import f from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
return
|
|
4
|
+
function g(o, u, c, h, b, y) {
|
|
5
|
+
const p = n("RenderFunction"), r = n("DropdownPanel"), s = n("Trigger");
|
|
6
|
+
return a(), d(s, {
|
|
7
7
|
"popup-visible": o.computedPopupVisible,
|
|
8
8
|
"animation-name": "x-slide-dynamic-origin",
|
|
9
9
|
"auto-fit-transform-origin": "",
|
|
@@ -13,10 +13,13 @@ function d(o, g, u, c, h, $) {
|
|
|
13
13
|
"popup-offset": 4,
|
|
14
14
|
"popup-container": o.popupContainer,
|
|
15
15
|
"opened-class": o.className.modifier("open"),
|
|
16
|
-
onPopupVisibleChange: o.handlePopupVisibleChange
|
|
16
|
+
onPopupVisibleChange: o.handlePopupVisibleChange,
|
|
17
|
+
onShow: o.handleShow
|
|
17
18
|
}, {
|
|
18
19
|
content: e(() => [
|
|
19
|
-
|
|
20
|
+
i(r, {
|
|
21
|
+
ref: "panelRef",
|
|
22
|
+
onClose: o.handleClose,
|
|
20
23
|
loading: o.loading,
|
|
21
24
|
"is-empty": o.isEmpty,
|
|
22
25
|
"bottom-offset": o.bottomOffset,
|
|
@@ -24,33 +27,33 @@ function d(o, g, u, c, h, $) {
|
|
|
24
27
|
onReachBottom: o.handleReachBottom
|
|
25
28
|
}, m({
|
|
26
29
|
default: e(() => [
|
|
27
|
-
|
|
30
|
+
t(o.$slots, "content")
|
|
28
31
|
]),
|
|
29
32
|
_: 2
|
|
30
33
|
}, [
|
|
31
34
|
o.$slots.empty ? {
|
|
32
35
|
name: "empty",
|
|
33
36
|
fn: e(() => [
|
|
34
|
-
|
|
37
|
+
t(o.$slots, "empty")
|
|
35
38
|
]),
|
|
36
39
|
key: "0"
|
|
37
40
|
} : void 0,
|
|
38
41
|
o.$slots.footer ? {
|
|
39
42
|
name: "footer",
|
|
40
43
|
fn: e(() => [
|
|
41
|
-
|
|
44
|
+
t(o.$slots, "footer")
|
|
42
45
|
]),
|
|
43
46
|
key: "1"
|
|
44
47
|
} : void 0
|
|
45
|
-
]), 1032, ["loading", "is-empty", "bottom-offset", "onScroll", "onReachBottom"])
|
|
48
|
+
]), 1032, ["onClose", "loading", "is-empty", "bottom-offset", "onScroll", "onReachBottom"])
|
|
46
49
|
]),
|
|
47
50
|
default: e(() => [
|
|
48
|
-
|
|
51
|
+
i(p, { "render-func": o.renderTrigger }, null, 8, ["render-func"])
|
|
49
52
|
]),
|
|
50
53
|
_: 3
|
|
51
|
-
}, 8, ["popup-visible", "trigger", "position", "align-point", "popup-container", "opened-class", "onPopupVisibleChange"]);
|
|
54
|
+
}, 8, ["popup-visible", "trigger", "position", "align-point", "popup-container", "opened-class", "onPopupVisibleChange", "onShow"]);
|
|
52
55
|
}
|
|
53
|
-
const
|
|
56
|
+
const w = /* @__PURE__ */ f(l, [["render", g]]);
|
|
54
57
|
export {
|
|
55
|
-
|
|
58
|
+
w as default
|
|
56
59
|
};
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Trigger as
|
|
3
|
-
import
|
|
4
|
-
import { useTrigger as
|
|
5
|
-
import { dropdownInjectionKey as
|
|
6
|
-
import { getClassNameMixin as
|
|
7
|
-
|
|
1
|
+
import { defineComponent as v, toRefs as B, provide as C, reactive as w } from "vue";
|
|
2
|
+
import { Trigger as V } from "../trigger/index.js";
|
|
3
|
+
import F from "./dropdown-panel.vue.js";
|
|
4
|
+
import { useTrigger as S } from "../../_hooks/use-trigger.js";
|
|
5
|
+
import { dropdownInjectionKey as O } from "./context.js";
|
|
6
|
+
import { getClassNameMixin as P } from "../../_utils/config.js";
|
|
7
|
+
import T from "../../_container/render-function.js";
|
|
8
|
+
import { useFirstElement as k } from "../../_hooks/use-first-element.js";
|
|
9
|
+
import { mergeFirstChild as K } from "../../_utils/vue-eco.js";
|
|
10
|
+
import { useDropdownKeyboard as x } from "./use-keyboard.js";
|
|
11
|
+
const q = v({
|
|
8
12
|
name: "Dropdown",
|
|
9
13
|
components: {
|
|
10
|
-
Trigger:
|
|
11
|
-
DropdownPanel:
|
|
14
|
+
Trigger: V,
|
|
15
|
+
DropdownPanel: F,
|
|
16
|
+
RenderFunction: T
|
|
12
17
|
},
|
|
13
18
|
props: {
|
|
14
19
|
/**
|
|
@@ -113,7 +118,7 @@ const N = c({
|
|
|
113
118
|
* @param {string | number | Record<string, any> | undefined } value
|
|
114
119
|
* @param {Event} ev
|
|
115
120
|
*/
|
|
116
|
-
select: (e,
|
|
121
|
+
select: (e, t) => !0,
|
|
117
122
|
/**
|
|
118
123
|
* @zh 下拉菜单滚动时触发
|
|
119
124
|
* @en Triggered when the dropdown scrolls
|
|
@@ -143,33 +148,49 @@ const N = c({
|
|
|
143
148
|
* @en Empty content
|
|
144
149
|
* @slot empty
|
|
145
150
|
*/
|
|
146
|
-
setup(e, { emit:
|
|
147
|
-
const { defaultPopupVisible:
|
|
148
|
-
defaultPopupVisible:
|
|
149
|
-
popupVisible:
|
|
150
|
-
emit:
|
|
151
|
-
}),
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
setup(e, { emit: t, slots: n }) {
|
|
152
|
+
const { defaultPopupVisible: d, popupVisible: s, popupMaxHeight: c } = B(e), f = P("dropdown"), { computedPopupVisible: a, handlePopupVisibleChange: p } = S({
|
|
153
|
+
defaultPopupVisible: d,
|
|
154
|
+
popupVisible: s,
|
|
155
|
+
emit: t
|
|
156
|
+
}), { children: l, firstElement: m } = k(), r = x(
|
|
157
|
+
a,
|
|
158
|
+
p,
|
|
159
|
+
m
|
|
160
|
+
), g = (o) => {
|
|
161
|
+
var i;
|
|
162
|
+
return l.value = ((i = n.default) == null ? void 0 : i.call(n)) ?? [], K(l.value, {
|
|
163
|
+
...o,
|
|
164
|
+
onKeydown: (u) => {
|
|
165
|
+
u.key !== "ArrowRight" && r.handleTriggerKeydown(u);
|
|
166
|
+
},
|
|
167
|
+
onFocusinCapture: r.handleTriggerFocus,
|
|
168
|
+
onFocusoutCapture: r.handleTriggerFocus
|
|
169
|
+
}), l.value;
|
|
170
|
+
}, h = (o, i) => {
|
|
171
|
+
t("select", o, i), e.hideOnSelect && (r.handleKeyboardSelect(i), p(!1));
|
|
172
|
+
}, y = (o) => {
|
|
173
|
+
t("scroll", o);
|
|
174
|
+
}, b = (o) => {
|
|
175
|
+
t("reachBottom", o);
|
|
157
176
|
};
|
|
158
|
-
return
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
popupMaxHeight:
|
|
162
|
-
onOptionClick:
|
|
177
|
+
return C(
|
|
178
|
+
O,
|
|
179
|
+
w({
|
|
180
|
+
popupMaxHeight: c,
|
|
181
|
+
onOptionClick: h
|
|
163
182
|
})
|
|
164
183
|
), {
|
|
165
|
-
|
|
166
|
-
|
|
184
|
+
...r,
|
|
185
|
+
renderTrigger: g,
|
|
186
|
+
className: f,
|
|
187
|
+
computedPopupVisible: a,
|
|
167
188
|
handlePopupVisibleChange: p,
|
|
168
|
-
handleScroll:
|
|
169
|
-
handleReachBottom:
|
|
189
|
+
handleScroll: y,
|
|
190
|
+
handleReachBottom: b
|
|
170
191
|
};
|
|
171
192
|
}
|
|
172
193
|
});
|
|
173
194
|
export {
|
|
174
|
-
|
|
195
|
+
q as default
|
|
175
196
|
};
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
return
|
|
1
|
+
import r from "./DropdownOption.vue2.js";
|
|
2
|
+
import { openBlock as l, createElementBlock as a, normalizeClass as n, renderSlot as i, createCommentVNode as d, createElementVNode as f } from "vue";
|
|
3
|
+
import m from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const t = ["aria-disabled", "tabindex"];
|
|
5
|
+
function u(e, s, p, $, k, b) {
|
|
6
|
+
return l(), a("li", {
|
|
7
7
|
ref: "liRef",
|
|
8
|
-
class:
|
|
8
|
+
class: n([e.cls, { [e.className.modifier("has-suffix")]: !!e.$slots.suffix }]),
|
|
9
9
|
role: "menuitem",
|
|
10
10
|
"aria-disabled": e.disabled,
|
|
11
|
-
tabindex: e.
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
tabindex: e.tabIndex,
|
|
12
|
+
onFocus: s[0] || (s[0] = (...o) => e.handleFocus && e.handleFocus(...o)),
|
|
13
|
+
onClick: s[1] || (s[1] = (...o) => e.handleClick && e.handleClick(...o)),
|
|
14
|
+
onKeydown: s[2] || (s[2] = (...o) => e.handleKeydown && e.handleKeydown(...o))
|
|
14
15
|
}, [
|
|
15
|
-
e.$slots.icon ? (
|
|
16
|
+
e.$slots.icon ? (l(), a("span", {
|
|
16
17
|
key: 0,
|
|
17
|
-
class:
|
|
18
|
+
class: n(e.className.element("icon"))
|
|
18
19
|
}, [
|
|
19
20
|
i(e.$slots, "icon")
|
|
20
|
-
], 2)) :
|
|
21
|
-
|
|
22
|
-
class:
|
|
21
|
+
], 2)) : d("", !0),
|
|
22
|
+
f("span", {
|
|
23
|
+
class: n(e.className.element("content"))
|
|
23
24
|
}, [
|
|
24
25
|
i(e.$slots, "default")
|
|
25
26
|
], 2),
|
|
26
|
-
e.$slots.suffix ? (
|
|
27
|
+
e.$slots.suffix ? (l(), a("span", {
|
|
27
28
|
key: 1,
|
|
28
|
-
class:
|
|
29
|
+
class: n(e.className.element("suffix"))
|
|
29
30
|
}, [
|
|
30
31
|
i(e.$slots, "suffix")
|
|
31
|
-
], 2)) :
|
|
32
|
-
], 42,
|
|
32
|
+
], 2)) : d("", !0)
|
|
33
|
+
], 42, t);
|
|
33
34
|
}
|
|
34
|
-
const
|
|
35
|
+
const w = /* @__PURE__ */ m(r, [["render", u]]);
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
w as default
|
|
37
38
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { dropdownInjectionKey as
|
|
3
|
-
import { getClassNameMixin as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as y, ref as j, computed as a, inject as m, onBeforeUnmount as p } from "vue";
|
|
2
|
+
import { dropdownInjectionKey as I, dropdownMenuInjectionKey as g } from "./context.js";
|
|
3
|
+
import { getClassNameMixin as w } from "../../_utils/config.js";
|
|
4
|
+
const K = y({
|
|
5
5
|
name: "DropdownOption",
|
|
6
6
|
props: {
|
|
7
7
|
/**
|
|
@@ -36,30 +36,34 @@ const C = r({
|
|
|
36
36
|
* @en Icon
|
|
37
37
|
* @slot icon
|
|
38
38
|
*/
|
|
39
|
-
setup(t, { emit:
|
|
40
|
-
const
|
|
39
|
+
setup(t, { emit: r }) {
|
|
40
|
+
const o = w("dropdown--option"), i = j(), u = a(() => {
|
|
41
41
|
var e;
|
|
42
42
|
return t.value ?? ((e = i.value) == null ? void 0 : e.textContent) ?? void 0;
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
t.disabled || (
|
|
47
|
-
},
|
|
48
|
-
|
|
43
|
+
}), d = t.uninjectContext ? void 0 : m(I, void 0), n = m(g, void 0), c = { element: i, disabled: a(() => t.disabled) }, l = n == null ? void 0 : n.registerItem(c);
|
|
44
|
+
p(() => l == null ? void 0 : l());
|
|
45
|
+
const f = a(() => t.disabled ? -1 : !n || n.activeItem.value === c ? 0 : -1), b = () => n == null ? void 0 : n.setActiveItem(c), s = (e) => {
|
|
46
|
+
t.disabled || (r("click", e), d == null || d.onOptionClick(u.value, e));
|
|
47
|
+
}, v = (e) => {
|
|
48
|
+
t.disabled || e.defaultPrevented || e.isComposing || e.target !== i.value || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), s(e));
|
|
49
|
+
}, k = a(() => [
|
|
50
|
+
o.block,
|
|
49
51
|
{
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
+
[o.modifier("disabled")]: t.disabled,
|
|
53
|
+
[o.modifier("active")]: t.active
|
|
52
54
|
}
|
|
53
55
|
]);
|
|
54
56
|
return {
|
|
55
|
-
className:
|
|
56
|
-
cls:
|
|
57
|
+
className: o,
|
|
58
|
+
cls: k,
|
|
57
59
|
liRef: i,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
tabIndex: f,
|
|
61
|
+
handleFocus: b,
|
|
62
|
+
handleClick: s,
|
|
63
|
+
handleKeydown: v
|
|
60
64
|
};
|
|
61
65
|
}
|
|
62
66
|
});
|
|
63
67
|
export {
|
|
64
|
-
|
|
68
|
+
K as default
|
|
65
69
|
};
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as s, openBlock as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
return
|
|
1
|
+
import u from "./DropdownSubmenu.vue2.js";
|
|
2
|
+
import { resolveComponent as s, openBlock as f, createBlock as c, withCtx as e, createVNode as p, mergeProps as g, createSlots as r, renderSlot as n, normalizeClass as m } from "vue";
|
|
3
|
+
import b from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
function h(o, C, w, $, P, v) {
|
|
5
|
+
const a = s("IconRight"), t = s("dropdown-option"), l = s("dropdown-panel"), d = s("Trigger");
|
|
6
|
+
return f(), c(d, {
|
|
7
7
|
"popup-visible": o.computedPopupVisible,
|
|
8
8
|
trigger: o.trigger,
|
|
9
9
|
position: o.position,
|
|
10
10
|
disabled: o.disabled,
|
|
11
11
|
"popup-offset": 4,
|
|
12
|
-
onPopupVisibleChange: o.handlePopupVisibleChange
|
|
12
|
+
onPopupVisibleChange: o.handlePopupVisibleChange,
|
|
13
|
+
onShow: o.handleShow
|
|
13
14
|
}, {
|
|
14
15
|
content: e(() => [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
p(l, {
|
|
17
|
+
ref: "panelRef",
|
|
18
|
+
class: m(o.className.block),
|
|
19
|
+
"close-on-arrow-left": "",
|
|
20
|
+
onClose: o.handleClose
|
|
21
|
+
}, r({
|
|
18
22
|
default: e(() => [
|
|
19
23
|
n(o.$slots, "content")
|
|
20
24
|
]),
|
|
@@ -27,36 +31,45 @@ function b(o, $, h, v, P, _) {
|
|
|
27
31
|
]),
|
|
28
32
|
key: "0"
|
|
29
33
|
} : void 0
|
|
30
|
-
]), 1032, ["class"])
|
|
34
|
+
]), 1032, ["class", "onClose"])
|
|
31
35
|
]),
|
|
32
|
-
default: e(() =>
|
|
33
|
-
i
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
fn: e(() => [
|
|
50
|
-
n(o.$slots, "icon")
|
|
36
|
+
default: e(() => {
|
|
37
|
+
var i;
|
|
38
|
+
return [
|
|
39
|
+
p(t, g({ ref: "optionRef" }, o.optionProps, {
|
|
40
|
+
disabled: o.disabled || ((i = o.optionProps) == null ? void 0 : i.disabled),
|
|
41
|
+
active: o.computedPopupVisible,
|
|
42
|
+
"uninject-context": "",
|
|
43
|
+
"aria-haspopup": "menu",
|
|
44
|
+
"aria-expanded": o.computedPopupVisible,
|
|
45
|
+
onKeydownCapture: o.handleTriggerKeydown,
|
|
46
|
+
onFocusinCapture: o.handleTriggerFocus,
|
|
47
|
+
onFocusoutCapture: o.handleTriggerFocus
|
|
48
|
+
}), r({
|
|
49
|
+
suffix: e(() => [
|
|
50
|
+
n(o.$slots, "suffix", {}, () => [
|
|
51
|
+
p(a)
|
|
52
|
+
])
|
|
51
53
|
]),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
default: e(() => [
|
|
55
|
+
n(o.$slots, "default")
|
|
56
|
+
]),
|
|
57
|
+
_: 2
|
|
58
|
+
}, [
|
|
59
|
+
o.$slots.icon ? {
|
|
60
|
+
name: "icon",
|
|
61
|
+
fn: e(() => [
|
|
62
|
+
n(o.$slots, "icon")
|
|
63
|
+
]),
|
|
64
|
+
key: "0"
|
|
65
|
+
} : void 0
|
|
66
|
+
]), 1040, ["disabled", "active", "aria-expanded", "onKeydownCapture", "onFocusinCapture", "onFocusoutCapture"])
|
|
67
|
+
];
|
|
68
|
+
}),
|
|
56
69
|
_: 3
|
|
57
|
-
}, 8, ["popup-visible", "trigger", "position", "disabled", "onPopupVisibleChange"]);
|
|
70
|
+
}, 8, ["popup-visible", "trigger", "position", "disabled", "onPopupVisibleChange", "onShow"]);
|
|
58
71
|
}
|
|
59
|
-
const k = /* @__PURE__ */
|
|
72
|
+
const k = /* @__PURE__ */ b(u, [["render", h]]);
|
|
60
73
|
export {
|
|
61
74
|
k as default
|
|
62
75
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Trigger as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useTrigger as
|
|
7
|
-
import { getClassNameMixin as
|
|
8
|
-
|
|
1
|
+
import { defineComponent as u, toRefs as m, ref as f, computed as g } from "vue";
|
|
2
|
+
import { Trigger as b } from "../trigger/index.js";
|
|
3
|
+
import c from "./dropdown-panel.vue.js";
|
|
4
|
+
import y from "./DropdownOption.vue.js";
|
|
5
|
+
import w from "../../icons/_self/dropdown/more.js";
|
|
6
|
+
import { useTrigger as V } from "../../_hooks/use-trigger.js";
|
|
7
|
+
import { getClassNameMixin as P } from "../../_utils/config.js";
|
|
8
|
+
import { useDropdownKeyboard as h } from "./use-keyboard.js";
|
|
9
|
+
const K = u({
|
|
9
10
|
name: "DropdownSubmenu",
|
|
10
11
|
components: {
|
|
11
|
-
Trigger:
|
|
12
|
-
DropdownPanel:
|
|
13
|
-
DropdownOption:
|
|
14
|
-
IconRight:
|
|
12
|
+
Trigger: b,
|
|
13
|
+
DropdownPanel: c,
|
|
14
|
+
DropdownOption: y,
|
|
15
|
+
IconRight: w
|
|
15
16
|
},
|
|
16
17
|
props: {
|
|
17
18
|
/**
|
|
@@ -77,13 +78,13 @@ const v = s({
|
|
|
77
78
|
}
|
|
78
79
|
},
|
|
79
80
|
emits: {
|
|
80
|
-
"update:popupVisible": (
|
|
81
|
+
"update:popupVisible": (o) => !0,
|
|
81
82
|
/**
|
|
82
83
|
* @zh 下拉框显示状态发生改变时触发
|
|
83
84
|
* @en Triggered when the display status of the drop-down box changes
|
|
84
85
|
* @property {boolean} visible
|
|
85
86
|
*/
|
|
86
|
-
popupVisibleChange: (
|
|
87
|
+
popupVisibleChange: (o) => !0
|
|
87
88
|
},
|
|
88
89
|
/**
|
|
89
90
|
* @zh 子菜单内容
|
|
@@ -102,19 +103,39 @@ const v = s({
|
|
|
102
103
|
* @slot icon
|
|
103
104
|
* @version 2.29.0
|
|
104
105
|
*/
|
|
105
|
-
setup(
|
|
106
|
-
const { defaultPopupVisible:
|
|
107
|
-
defaultPopupVisible:
|
|
108
|
-
popupVisible:
|
|
109
|
-
emit:
|
|
110
|
-
})
|
|
106
|
+
setup(o, { emit: n }) {
|
|
107
|
+
const { defaultPopupVisible: l, popupVisible: s } = m(o), a = P("dropdown--submenu"), { computedPopupVisible: t, handlePopupVisibleChange: i } = V({
|
|
108
|
+
defaultPopupVisible: l,
|
|
109
|
+
popupVisible: s,
|
|
110
|
+
emit: n
|
|
111
|
+
}), p = f(), d = g({
|
|
112
|
+
get: () => {
|
|
113
|
+
var e;
|
|
114
|
+
return (e = p.value) == null ? void 0 : e.$el;
|
|
115
|
+
},
|
|
116
|
+
set: () => {
|
|
117
|
+
}
|
|
118
|
+
}), r = h(
|
|
119
|
+
t,
|
|
120
|
+
i,
|
|
121
|
+
d,
|
|
122
|
+
() => {
|
|
123
|
+
var e;
|
|
124
|
+
return o.disabled || !!((e = o.optionProps) != null && e.disabled);
|
|
125
|
+
}
|
|
126
|
+
);
|
|
111
127
|
return {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
128
|
+
...r,
|
|
129
|
+
optionRef: p,
|
|
130
|
+
className: a,
|
|
131
|
+
computedPopupVisible: t,
|
|
132
|
+
handlePopupVisibleChange: i,
|
|
133
|
+
handleTriggerKeydown: (e) => {
|
|
134
|
+
e.key !== "ArrowDown" && e.key !== "ArrowUp" && r.handleTriggerKeydown(e);
|
|
135
|
+
}
|
|
115
136
|
};
|
|
116
137
|
}
|
|
117
138
|
});
|
|
118
139
|
export {
|
|
119
|
-
|
|
140
|
+
K as default
|
|
120
141
|
};
|
|
@@ -1,49 +1,52 @@
|
|
|
1
1
|
import c from "./dropdown-panel.vue2.js";
|
|
2
|
-
import { resolveComponent as s, openBlock as o, createElementBlock as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
return o(),
|
|
7
|
-
|
|
2
|
+
import { resolveComponent as s, openBlock as o, createElementBlock as n, normalizeClass as l, createBlock as t, renderSlot as a, createVNode as y, normalizeStyle as f, withCtx as u, createElementVNode as k, createCommentVNode as N } from "vue";
|
|
3
|
+
import $ from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
function w(e, r, S, E, b, g) {
|
|
5
|
+
const m = s("spin"), p = s("empty"), d = s("Scrollbar");
|
|
6
|
+
return o(), n("div", {
|
|
7
|
+
ref: "panelElement",
|
|
8
|
+
class: l(e.cls),
|
|
9
|
+
tabindex: "-1",
|
|
10
|
+
onKeydown: r[0] || (r[0] = (...i) => e.handleKeydown && e.handleKeydown(...i))
|
|
8
11
|
}, [
|
|
9
|
-
e.loading ? (o(), t(
|
|
12
|
+
e.loading ? (o(), t(m, {
|
|
10
13
|
key: 0,
|
|
11
14
|
class: l(e.className.element("loading")),
|
|
12
15
|
display: "block",
|
|
13
16
|
tip: e.t("common.loading")
|
|
14
|
-
}, null, 8, ["class", "tip"])) : e.isEmpty ? (o(),
|
|
17
|
+
}, null, 8, ["class", "tip"])) : e.isEmpty ? (o(), n("div", {
|
|
15
18
|
key: 1,
|
|
16
19
|
class: l(e.className.element("empty"))
|
|
17
20
|
}, [
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
a(e.$slots, "empty", {}, () => [
|
|
22
|
+
y(p)
|
|
20
23
|
])
|
|
21
|
-
], 2)) : (o(), t(
|
|
24
|
+
], 2)) : (o(), t(d, {
|
|
22
25
|
key: 2,
|
|
23
26
|
ref: "wrapperRef",
|
|
24
27
|
class: l(e.className.element("list--wrapper")),
|
|
25
|
-
style:
|
|
28
|
+
style: f(e.style),
|
|
26
29
|
onScroll: e.handleScroll
|
|
27
30
|
}, {
|
|
28
|
-
default:
|
|
29
|
-
|
|
31
|
+
default: u(() => [
|
|
32
|
+
k("ul", {
|
|
30
33
|
class: l(e.className.element("list")),
|
|
31
34
|
role: "menu"
|
|
32
35
|
}, [
|
|
33
|
-
|
|
36
|
+
a(e.$slots, "default")
|
|
34
37
|
], 2)
|
|
35
38
|
]),
|
|
36
39
|
_: 3
|
|
37
40
|
}, 8, ["class", "style", "onScroll"])),
|
|
38
|
-
e.$slots.footer && !e.loading && !e.isEmpty ? (o(),
|
|
41
|
+
e.$slots.footer && !e.loading && !e.isEmpty ? (o(), n("div", {
|
|
39
42
|
key: 3,
|
|
40
43
|
class: l(e.className.element("footer"))
|
|
41
44
|
}, [
|
|
42
|
-
|
|
43
|
-
], 2)) :
|
|
44
|
-
],
|
|
45
|
+
a(e.$slots, "footer")
|
|
46
|
+
], 2)) : N("", !0)
|
|
47
|
+
], 34);
|
|
45
48
|
}
|
|
46
|
-
const
|
|
49
|
+
const B = /* @__PURE__ */ $(c, [["render", w]]);
|
|
47
50
|
export {
|
|
48
|
-
|
|
51
|
+
B as default
|
|
49
52
|
};
|