@element-plus/nightly 0.0.20241105 → 0.0.20241106
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/attributes.json +1 -1
- package/dist/index.full.js +5 -3
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +3 -3
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +5 -3
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +181 -27
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +27 -181
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/index.mjs +1 -1
- package/es/components/mention/src/mention-dropdown.mjs +15 -167
- package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
- package/es/components/mention/src/mention-dropdown2.mjs +167 -15
- package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs +1 -1
- package/es/components/scrollbar/src/bar.mjs +11 -64
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar2.mjs +64 -11
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
- package/es/components/select-v2/src/defaults.d.ts +1 -0
- package/es/components/select-v2/src/defaults.mjs +1 -0
- package/es/components/select-v2/src/defaults.mjs.map +1 -1
- package/es/components/select-v2/src/select.mjs +2 -1
- package/es/components/select-v2/src/select.mjs.map +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +2 -0
- package/es/index.mjs +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +181 -28
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +28 -181
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/mention/src/mention-dropdown.js +16 -167
- package/lib/components/mention/src/mention-dropdown.js.map +1 -1
- package/lib/components/mention/src/mention-dropdown2.js +167 -16
- package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
- package/lib/components/mention/src/mention2.js +1 -1
- package/lib/components/scrollbar/src/bar.js +11 -64
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar2.js +64 -11
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +1 -1
- package/lib/components/select-v2/src/defaults.d.ts +1 -0
- package/lib/components/select-v2/src/defaults.js +1 -0
- package/lib/components/select-v2/src/defaults.js.map +1 -1
- package/lib/components/select-v2/src/select.js +2 -1
- package/lib/components/select-v2/src/select.js.map +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +2 -0
- package/lib/index.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,187 +1,33 @@
|
|
|
1
|
-
import { defineComponent, useSlots, computed, ref, openBlock, createBlock, unref, withCtx, createVNode, Transition, withDirectives, createElementVNode, mergeProps, withModifiers, normalizeClass, createElementBlock, renderSlot, toDisplayString, createCommentVNode, vShow } from 'vue';
|
|
2
|
-
import { Close } from '@element-plus/icons-vue';
|
|
3
|
-
import { ElOverlay } from '../../overlay/index.mjs';
|
|
4
|
-
import '../../focus-trap/index.mjs';
|
|
5
|
-
import { ElTeleport } from '../../teleport/index.mjs';
|
|
6
|
-
import '../../dialog/index.mjs';
|
|
7
1
|
import '../../../utils/index.mjs';
|
|
8
|
-
import
|
|
9
|
-
import '../../../
|
|
10
|
-
import {
|
|
11
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
12
|
-
import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
|
|
13
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
14
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
15
|
-
import { useDialog } from '../../dialog/src/use-dialog.mjs';
|
|
16
|
-
import { addUnit } from '../../../utils/dom/style.mjs';
|
|
17
|
-
import ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';
|
|
2
|
+
import '../../dialog/index.mjs';
|
|
3
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
4
|
+
import { dialogProps, dialogEmits } from '../../dialog/src/dialog.mjs';
|
|
18
5
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const {
|
|
42
|
-
afterEnter,
|
|
43
|
-
afterLeave,
|
|
44
|
-
beforeLeave,
|
|
45
|
-
visible,
|
|
46
|
-
rendered,
|
|
47
|
-
titleId,
|
|
48
|
-
bodyId,
|
|
49
|
-
zIndex,
|
|
50
|
-
onModalClick,
|
|
51
|
-
onOpenAutoFocus,
|
|
52
|
-
onCloseAutoFocus,
|
|
53
|
-
onFocusoutPrevented,
|
|
54
|
-
onCloseRequested,
|
|
55
|
-
handleClose
|
|
56
|
-
} = useDialog(props, drawerRef);
|
|
57
|
-
const isHorizontal = computed(() => props.direction === "rtl" || props.direction === "ltr");
|
|
58
|
-
const drawerSize = computed(() => addUnit(props.size));
|
|
59
|
-
expose({
|
|
60
|
-
handleClose,
|
|
61
|
-
afterEnter,
|
|
62
|
-
afterLeave
|
|
63
|
-
});
|
|
64
|
-
return (_ctx, _cache) => {
|
|
65
|
-
return openBlock(), createBlock(unref(ElTeleport), {
|
|
66
|
-
to: _ctx.appendTo,
|
|
67
|
-
disabled: _ctx.appendTo !== "body" ? false : !_ctx.appendToBody
|
|
68
|
-
}, {
|
|
69
|
-
default: withCtx(() => [
|
|
70
|
-
createVNode(Transition, {
|
|
71
|
-
name: unref(ns).b("fade"),
|
|
72
|
-
onAfterEnter: unref(afterEnter),
|
|
73
|
-
onAfterLeave: unref(afterLeave),
|
|
74
|
-
onBeforeLeave: unref(beforeLeave),
|
|
75
|
-
persisted: ""
|
|
76
|
-
}, {
|
|
77
|
-
default: withCtx(() => [
|
|
78
|
-
withDirectives(createVNode(unref(ElOverlay), {
|
|
79
|
-
mask: _ctx.modal,
|
|
80
|
-
"overlay-class": _ctx.modalClass,
|
|
81
|
-
"z-index": unref(zIndex),
|
|
82
|
-
onClick: unref(onModalClick)
|
|
83
|
-
}, {
|
|
84
|
-
default: withCtx(() => [
|
|
85
|
-
createVNode(unref(ElFocusTrap), {
|
|
86
|
-
loop: "",
|
|
87
|
-
trapped: unref(visible),
|
|
88
|
-
"focus-trap-el": drawerRef.value,
|
|
89
|
-
"focus-start-el": focusStartRef.value,
|
|
90
|
-
onFocusAfterTrapped: unref(onOpenAutoFocus),
|
|
91
|
-
onFocusAfterReleased: unref(onCloseAutoFocus),
|
|
92
|
-
onFocusoutPrevented: unref(onFocusoutPrevented),
|
|
93
|
-
onReleaseRequested: unref(onCloseRequested)
|
|
94
|
-
}, {
|
|
95
|
-
default: withCtx(() => [
|
|
96
|
-
createElementVNode("div", mergeProps({
|
|
97
|
-
ref_key: "drawerRef",
|
|
98
|
-
ref: drawerRef,
|
|
99
|
-
"aria-modal": "true",
|
|
100
|
-
"aria-label": _ctx.title || void 0,
|
|
101
|
-
"aria-labelledby": !_ctx.title ? unref(titleId) : void 0,
|
|
102
|
-
"aria-describedby": unref(bodyId)
|
|
103
|
-
}, _ctx.$attrs, {
|
|
104
|
-
class: [unref(ns).b(), _ctx.direction, unref(visible) && "open"],
|
|
105
|
-
style: unref(isHorizontal) ? "width: " + unref(drawerSize) : "height: " + unref(drawerSize),
|
|
106
|
-
role: "dialog",
|
|
107
|
-
onClick: withModifiers(() => {
|
|
108
|
-
}, ["stop"])
|
|
109
|
-
}), [
|
|
110
|
-
createElementVNode("span", {
|
|
111
|
-
ref_key: "focusStartRef",
|
|
112
|
-
ref: focusStartRef,
|
|
113
|
-
class: normalizeClass(unref(ns).e("sr-focus")),
|
|
114
|
-
tabindex: "-1"
|
|
115
|
-
}, null, 2),
|
|
116
|
-
_ctx.withHeader ? (openBlock(), createElementBlock("header", {
|
|
117
|
-
key: 0,
|
|
118
|
-
class: normalizeClass(unref(ns).e("header"))
|
|
119
|
-
}, [
|
|
120
|
-
!_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
|
|
121
|
-
key: 0,
|
|
122
|
-
close: unref(handleClose),
|
|
123
|
-
titleId: unref(titleId),
|
|
124
|
-
titleClass: unref(ns).e("title")
|
|
125
|
-
}, () => [
|
|
126
|
-
!_ctx.$slots.title ? (openBlock(), createElementBlock("span", {
|
|
127
|
-
key: 0,
|
|
128
|
-
id: unref(titleId),
|
|
129
|
-
role: "heading",
|
|
130
|
-
"aria-level": _ctx.headerAriaLevel,
|
|
131
|
-
class: normalizeClass(unref(ns).e("title"))
|
|
132
|
-
}, toDisplayString(_ctx.title), 11, ["id", "aria-level"])) : createCommentVNode("v-if", true)
|
|
133
|
-
]) : renderSlot(_ctx.$slots, "title", { key: 1 }, () => [
|
|
134
|
-
createCommentVNode(" DEPRECATED SLOT ")
|
|
135
|
-
]),
|
|
136
|
-
_ctx.showClose ? (openBlock(), createElementBlock("button", {
|
|
137
|
-
key: 2,
|
|
138
|
-
"aria-label": unref(t)("el.drawer.close"),
|
|
139
|
-
class: normalizeClass(unref(ns).e("close-btn")),
|
|
140
|
-
type: "button",
|
|
141
|
-
onClick: unref(handleClose)
|
|
142
|
-
}, [
|
|
143
|
-
createVNode(unref(ElIcon), {
|
|
144
|
-
class: normalizeClass(unref(ns).e("close"))
|
|
145
|
-
}, {
|
|
146
|
-
default: withCtx(() => [
|
|
147
|
-
createVNode(unref(Close))
|
|
148
|
-
]),
|
|
149
|
-
_: 1
|
|
150
|
-
}, 8, ["class"])
|
|
151
|
-
], 10, ["aria-label", "onClick"])) : createCommentVNode("v-if", true)
|
|
152
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
153
|
-
unref(rendered) ? (openBlock(), createElementBlock("div", {
|
|
154
|
-
key: 1,
|
|
155
|
-
id: unref(bodyId),
|
|
156
|
-
class: normalizeClass(unref(ns).e("body"))
|
|
157
|
-
}, [
|
|
158
|
-
renderSlot(_ctx.$slots, "default")
|
|
159
|
-
], 10, ["id"])) : createCommentVNode("v-if", true),
|
|
160
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
|
|
161
|
-
key: 2,
|
|
162
|
-
class: normalizeClass(unref(ns).e("footer"))
|
|
163
|
-
}, [
|
|
164
|
-
renderSlot(_ctx.$slots, "footer")
|
|
165
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
166
|
-
], 16, ["aria-label", "aria-labelledby", "aria-describedby", "onClick"])
|
|
167
|
-
]),
|
|
168
|
-
_: 3
|
|
169
|
-
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
|
|
170
|
-
]),
|
|
171
|
-
_: 3
|
|
172
|
-
}, 8, ["mask", "overlay-class", "z-index", "onClick"]), [
|
|
173
|
-
[vShow, unref(visible)]
|
|
174
|
-
])
|
|
175
|
-
]),
|
|
176
|
-
_: 3
|
|
177
|
-
}, 8, ["name", "onAfterEnter", "onAfterLeave", "onBeforeLeave"])
|
|
178
|
-
]),
|
|
179
|
-
_: 3
|
|
180
|
-
}, 8, ["to", "disabled"]);
|
|
181
|
-
};
|
|
6
|
+
const drawerProps = buildProps({
|
|
7
|
+
...dialogProps,
|
|
8
|
+
direction: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: "rtl",
|
|
11
|
+
values: ["ltr", "rtl", "ttb", "btt"]
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
type: [String, Number],
|
|
15
|
+
default: "30%"
|
|
16
|
+
},
|
|
17
|
+
withHeader: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true
|
|
20
|
+
},
|
|
21
|
+
modalFade: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
headerAriaLevel: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "2"
|
|
182
28
|
}
|
|
183
29
|
});
|
|
184
|
-
|
|
30
|
+
const drawerEmits = dialogEmits;
|
|
185
31
|
|
|
186
|
-
export {
|
|
32
|
+
export { drawerEmits, drawerProps };
|
|
187
33
|
//# sourceMappingURL=drawer2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer2.mjs","sources":["../../../../../../packages/components/drawer/src/drawer.
|
|
1
|
+
{"version":3,"file":"drawer2.mjs","sources":["../../../../../../packages/components/drawer/src/drawer.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { dialogEmits, dialogProps } from '@element-plus/components/dialog'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const drawerProps = buildProps({\n ...dialogProps,\n direction: {\n type: String,\n default: 'rtl',\n values: ['ltr', 'rtl', 'ttb', 'btt'],\n },\n size: {\n type: [String, Number],\n default: '30%',\n },\n withHeader: {\n type: Boolean,\n default: true,\n },\n modalFade: {\n type: Boolean,\n default: true,\n },\n headerAriaLevel: {\n type: String,\n default: '2',\n },\n} as const)\n\nexport type DrawerProps = ExtractPropTypes<typeof drawerProps>\n\nexport const drawerEmits = dialogEmits\n"],"names":[],"mappings":";;;;;AAEY,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,GAAG,WAAW;AAChB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;AACxC,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,WAAW,GAAG;;;;"}
|
package/es/components/index.mjs
CHANGED
|
@@ -121,7 +121,7 @@ export { useDialog } from './dialog/src/use-dialog.mjs';
|
|
|
121
121
|
export { dialogEmits, dialogProps } from './dialog/src/dialog.mjs';
|
|
122
122
|
export { dialogInjectionKey } from './dialog/src/constants.mjs';
|
|
123
123
|
export { dividerProps } from './divider/src/divider.mjs';
|
|
124
|
-
export { drawerEmits, drawerProps } from './drawer/src/
|
|
124
|
+
export { drawerEmits, drawerProps } from './drawer/src/drawer2.mjs';
|
|
125
125
|
export { DROPDOWN_COLLECTION_INJECTION_KEY, DROPDOWN_COLLECTION_ITEM_INJECTION_KEY, ElCollection, ElCollectionItem, FIRST_KEYS, FIRST_LAST_KEYS, LAST_KEYS, dropdownItemProps, dropdownMenuProps, dropdownProps } from './dropdown/src/dropdown.mjs';
|
|
126
126
|
export { DROPDOWN_INJECTION_KEY } from './dropdown/src/tokens.mjs';
|
|
127
127
|
export { emptyProps } from './empty/src/empty.mjs';
|
|
@@ -1,172 +1,20 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, nextTick, watch, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createCommentVNode, withDirectives, createVNode, withCtx, Fragment, renderList, withModifiers, createElementVNode, toDisplayString, vShow, createTextVNode } from 'vue';
|
|
2
|
-
import '../../../hooks/index.mjs';
|
|
3
1
|
import '../../../utils/index.mjs';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
8
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
9
|
-
import { scrollIntoView } from '../../../utils/dom/scroll.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
import { isString } from '@vue/shared';
|
|
10
4
|
|
|
11
|
-
const
|
|
12
|
-
|
|
5
|
+
const mentionDropdownProps = buildProps({
|
|
6
|
+
options: {
|
|
7
|
+
type: definePropType(Array),
|
|
8
|
+
default: () => []
|
|
9
|
+
},
|
|
10
|
+
loading: Boolean,
|
|
11
|
+
disabled: Boolean,
|
|
12
|
+
contentId: String,
|
|
13
|
+
ariaLabel: String
|
|
13
14
|
});
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
emits: mentionDropdownEmits,
|
|
18
|
-
setup(__props, { expose, emit }) {
|
|
19
|
-
const props = __props;
|
|
20
|
-
const ns = useNamespace("mention");
|
|
21
|
-
const { t } = useLocale();
|
|
22
|
-
const hoveringIndex = ref(-1);
|
|
23
|
-
const scrollbarRef = ref();
|
|
24
|
-
const optionRefs = ref();
|
|
25
|
-
const dropdownRef = ref();
|
|
26
|
-
const optionkls = (item, index) => [
|
|
27
|
-
ns.be("dropdown", "item"),
|
|
28
|
-
ns.is("hovering", hoveringIndex.value === index),
|
|
29
|
-
ns.is("disabled", item.disabled || props.disabled)
|
|
30
|
-
];
|
|
31
|
-
const handleSelect = (item) => {
|
|
32
|
-
if (item.disabled || props.disabled)
|
|
33
|
-
return;
|
|
34
|
-
emit("select", item);
|
|
35
|
-
};
|
|
36
|
-
const handleMouseEnter = (index) => {
|
|
37
|
-
hoveringIndex.value = index;
|
|
38
|
-
};
|
|
39
|
-
const filteredAllDisabled = computed(() => props.disabled || props.options.every((item) => item.disabled));
|
|
40
|
-
const hoverOption = computed(() => props.options[hoveringIndex.value]);
|
|
41
|
-
const selectHoverOption = () => {
|
|
42
|
-
if (!hoverOption.value)
|
|
43
|
-
return;
|
|
44
|
-
emit("select", hoverOption.value);
|
|
45
|
-
};
|
|
46
|
-
const navigateOptions = (direction) => {
|
|
47
|
-
const { options } = props;
|
|
48
|
-
if (options.length === 0 || filteredAllDisabled.value)
|
|
49
|
-
return;
|
|
50
|
-
if (direction === "next") {
|
|
51
|
-
hoveringIndex.value++;
|
|
52
|
-
if (hoveringIndex.value === options.length) {
|
|
53
|
-
hoveringIndex.value = 0;
|
|
54
|
-
}
|
|
55
|
-
} else if (direction === "prev") {
|
|
56
|
-
hoveringIndex.value--;
|
|
57
|
-
if (hoveringIndex.value < 0) {
|
|
58
|
-
hoveringIndex.value = options.length - 1;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const option = options[hoveringIndex.value];
|
|
62
|
-
if (option.disabled) {
|
|
63
|
-
navigateOptions(direction);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
nextTick(() => scrollToOption(option));
|
|
67
|
-
};
|
|
68
|
-
const scrollToOption = (option) => {
|
|
69
|
-
var _a, _b, _c, _d;
|
|
70
|
-
const { options } = props;
|
|
71
|
-
const index = options.findIndex((item) => item.value === option.value);
|
|
72
|
-
const target = (_a = optionRefs.value) == null ? void 0 : _a[index];
|
|
73
|
-
if (target) {
|
|
74
|
-
const menu = (_c = (_b = dropdownRef.value) == null ? void 0 : _b.querySelector) == null ? void 0 : _c.call(_b, `.${ns.be("dropdown", "wrap")}`);
|
|
75
|
-
if (menu) {
|
|
76
|
-
scrollIntoView(menu, target);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
(_d = scrollbarRef.value) == null ? void 0 : _d.handleScroll();
|
|
80
|
-
};
|
|
81
|
-
const resetHoveringIndex = () => {
|
|
82
|
-
if (filteredAllDisabled.value || props.options.length === 0) {
|
|
83
|
-
hoveringIndex.value = -1;
|
|
84
|
-
} else {
|
|
85
|
-
hoveringIndex.value = 0;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
watch(() => props.options, resetHoveringIndex, {
|
|
89
|
-
immediate: true
|
|
90
|
-
});
|
|
91
|
-
expose({
|
|
92
|
-
hoveringIndex,
|
|
93
|
-
navigateOptions,
|
|
94
|
-
selectHoverOption,
|
|
95
|
-
hoverOption
|
|
96
|
-
});
|
|
97
|
-
return (_ctx, _cache) => {
|
|
98
|
-
return openBlock(), createElementBlock("div", {
|
|
99
|
-
ref_key: "dropdownRef",
|
|
100
|
-
ref: dropdownRef,
|
|
101
|
-
class: normalizeClass(unref(ns).b("dropdown"))
|
|
102
|
-
}, [
|
|
103
|
-
_ctx.$slots.header ? (openBlock(), createElementBlock("div", {
|
|
104
|
-
key: 0,
|
|
105
|
-
class: normalizeClass(unref(ns).be("dropdown", "header"))
|
|
106
|
-
}, [
|
|
107
|
-
renderSlot(_ctx.$slots, "header")
|
|
108
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
109
|
-
withDirectives(createVNode(unref(ElScrollbar), {
|
|
110
|
-
id: _ctx.contentId,
|
|
111
|
-
ref_key: "scrollbarRef",
|
|
112
|
-
ref: scrollbarRef,
|
|
113
|
-
tag: "ul",
|
|
114
|
-
"wrap-class": unref(ns).be("dropdown", "wrap"),
|
|
115
|
-
"view-class": unref(ns).be("dropdown", "list"),
|
|
116
|
-
role: "listbox",
|
|
117
|
-
"aria-label": _ctx.ariaLabel,
|
|
118
|
-
"aria-orientation": "vertical"
|
|
119
|
-
}, {
|
|
120
|
-
default: withCtx(() => [
|
|
121
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, index) => {
|
|
122
|
-
return openBlock(), createElementBlock("li", {
|
|
123
|
-
id: `${_ctx.contentId}-${index}`,
|
|
124
|
-
ref_for: true,
|
|
125
|
-
ref_key: "optionRefs",
|
|
126
|
-
ref: optionRefs,
|
|
127
|
-
key: item.value,
|
|
128
|
-
class: normalizeClass(optionkls(item, index)),
|
|
129
|
-
role: "option",
|
|
130
|
-
"aria-disabled": item.disabled || _ctx.disabled || void 0,
|
|
131
|
-
"aria-selected": hoveringIndex.value === index,
|
|
132
|
-
onMousemove: ($event) => handleMouseEnter(index),
|
|
133
|
-
onClick: withModifiers(($event) => handleSelect(item), ["stop"])
|
|
134
|
-
}, [
|
|
135
|
-
renderSlot(_ctx.$slots, "label", {
|
|
136
|
-
item,
|
|
137
|
-
index
|
|
138
|
-
}, () => {
|
|
139
|
-
var _a;
|
|
140
|
-
return [
|
|
141
|
-
createElementVNode("span", null, toDisplayString((_a = item.label) != null ? _a : item.value), 1)
|
|
142
|
-
];
|
|
143
|
-
})
|
|
144
|
-
], 42, ["id", "aria-disabled", "aria-selected", "onMousemove", "onClick"]);
|
|
145
|
-
}), 128))
|
|
146
|
-
]),
|
|
147
|
-
_: 3
|
|
148
|
-
}, 8, ["id", "wrap-class", "view-class", "aria-label"]), [
|
|
149
|
-
[vShow, _ctx.options.length > 0 && !_ctx.loading]
|
|
150
|
-
]),
|
|
151
|
-
_ctx.loading ? (openBlock(), createElementBlock("div", {
|
|
152
|
-
key: 1,
|
|
153
|
-
class: normalizeClass(unref(ns).be("dropdown", "loading"))
|
|
154
|
-
}, [
|
|
155
|
-
renderSlot(_ctx.$slots, "loading", {}, () => [
|
|
156
|
-
createTextVNode(toDisplayString(unref(t)("el.mention.loading")), 1)
|
|
157
|
-
])
|
|
158
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
159
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
|
|
160
|
-
key: 2,
|
|
161
|
-
class: normalizeClass(unref(ns).be("dropdown", "footer"))
|
|
162
|
-
}, [
|
|
163
|
-
renderSlot(_ctx.$slots, "footer")
|
|
164
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
165
|
-
], 2);
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
var ElMentionDropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "mention-dropdown.vue"]]);
|
|
15
|
+
const mentionDropdownEmits = {
|
|
16
|
+
select: (option) => isString(option.value)
|
|
17
|
+
};
|
|
170
18
|
|
|
171
|
-
export {
|
|
19
|
+
export { mentionDropdownEmits, mentionDropdownProps };
|
|
172
20
|
//# sourceMappingURL=mention-dropdown.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mention-dropdown.mjs","sources":["../../../../../../packages/components/mention/src/mention-dropdown.
|
|
1
|
+
{"version":3,"file":"mention-dropdown.mjs","sources":["../../../../../../packages/components/mention/src/mention-dropdown.ts"],"sourcesContent":["import { buildProps, definePropType, isString } from '@element-plus/utils'\n\nimport type { MentionOption } from './types'\n\nexport const mentionDropdownProps = buildProps({\n options: {\n type: definePropType<MentionOption[]>(Array),\n default: () => [],\n },\n loading: Boolean,\n disabled: Boolean,\n contentId: String,\n ariaLabel: String,\n})\n\nexport const mentionDropdownEmits = {\n select: (option: MentionOption) => isString(option.value),\n}\n"],"names":[],"mappings":";;;;AACY,MAAC,oBAAoB,GAAG,UAAU,CAAC;AAC/C,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,SAAS,EAAE,MAAM;AACnB,CAAC,EAAE;AACS,MAAC,oBAAoB,GAAG;AACpC,EAAE,MAAM,EAAE,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC;AAC5C;;;;"}
|
|
@@ -1,20 +1,172 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, nextTick, watch, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createCommentVNode, withDirectives, createVNode, withCtx, Fragment, renderList, withModifiers, createElementVNode, toDisplayString, vShow, createTextVNode } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
1
3
|
import '../../../utils/index.mjs';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
+
import { ElScrollbar } from '../../scrollbar/index.mjs';
|
|
5
|
+
import { mentionDropdownProps, mentionDropdownEmits } from './mention-dropdown.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
8
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
9
|
+
import { scrollIntoView } from '../../../utils/dom/scroll.mjs';
|
|
4
10
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
type: definePropType(Array),
|
|
8
|
-
default: () => []
|
|
9
|
-
},
|
|
10
|
-
loading: Boolean,
|
|
11
|
-
disabled: Boolean,
|
|
12
|
-
contentId: String,
|
|
13
|
-
ariaLabel: String
|
|
11
|
+
const __default__ = defineComponent({
|
|
12
|
+
name: "ElMentionDropdown"
|
|
14
13
|
});
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
...__default__,
|
|
16
|
+
props: mentionDropdownProps,
|
|
17
|
+
emits: mentionDropdownEmits,
|
|
18
|
+
setup(__props, { expose, emit }) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const ns = useNamespace("mention");
|
|
21
|
+
const { t } = useLocale();
|
|
22
|
+
const hoveringIndex = ref(-1);
|
|
23
|
+
const scrollbarRef = ref();
|
|
24
|
+
const optionRefs = ref();
|
|
25
|
+
const dropdownRef = ref();
|
|
26
|
+
const optionkls = (item, index) => [
|
|
27
|
+
ns.be("dropdown", "item"),
|
|
28
|
+
ns.is("hovering", hoveringIndex.value === index),
|
|
29
|
+
ns.is("disabled", item.disabled || props.disabled)
|
|
30
|
+
];
|
|
31
|
+
const handleSelect = (item) => {
|
|
32
|
+
if (item.disabled || props.disabled)
|
|
33
|
+
return;
|
|
34
|
+
emit("select", item);
|
|
35
|
+
};
|
|
36
|
+
const handleMouseEnter = (index) => {
|
|
37
|
+
hoveringIndex.value = index;
|
|
38
|
+
};
|
|
39
|
+
const filteredAllDisabled = computed(() => props.disabled || props.options.every((item) => item.disabled));
|
|
40
|
+
const hoverOption = computed(() => props.options[hoveringIndex.value]);
|
|
41
|
+
const selectHoverOption = () => {
|
|
42
|
+
if (!hoverOption.value)
|
|
43
|
+
return;
|
|
44
|
+
emit("select", hoverOption.value);
|
|
45
|
+
};
|
|
46
|
+
const navigateOptions = (direction) => {
|
|
47
|
+
const { options } = props;
|
|
48
|
+
if (options.length === 0 || filteredAllDisabled.value)
|
|
49
|
+
return;
|
|
50
|
+
if (direction === "next") {
|
|
51
|
+
hoveringIndex.value++;
|
|
52
|
+
if (hoveringIndex.value === options.length) {
|
|
53
|
+
hoveringIndex.value = 0;
|
|
54
|
+
}
|
|
55
|
+
} else if (direction === "prev") {
|
|
56
|
+
hoveringIndex.value--;
|
|
57
|
+
if (hoveringIndex.value < 0) {
|
|
58
|
+
hoveringIndex.value = options.length - 1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const option = options[hoveringIndex.value];
|
|
62
|
+
if (option.disabled) {
|
|
63
|
+
navigateOptions(direction);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
nextTick(() => scrollToOption(option));
|
|
67
|
+
};
|
|
68
|
+
const scrollToOption = (option) => {
|
|
69
|
+
var _a, _b, _c, _d;
|
|
70
|
+
const { options } = props;
|
|
71
|
+
const index = options.findIndex((item) => item.value === option.value);
|
|
72
|
+
const target = (_a = optionRefs.value) == null ? void 0 : _a[index];
|
|
73
|
+
if (target) {
|
|
74
|
+
const menu = (_c = (_b = dropdownRef.value) == null ? void 0 : _b.querySelector) == null ? void 0 : _c.call(_b, `.${ns.be("dropdown", "wrap")}`);
|
|
75
|
+
if (menu) {
|
|
76
|
+
scrollIntoView(menu, target);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
(_d = scrollbarRef.value) == null ? void 0 : _d.handleScroll();
|
|
80
|
+
};
|
|
81
|
+
const resetHoveringIndex = () => {
|
|
82
|
+
if (filteredAllDisabled.value || props.options.length === 0) {
|
|
83
|
+
hoveringIndex.value = -1;
|
|
84
|
+
} else {
|
|
85
|
+
hoveringIndex.value = 0;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
watch(() => props.options, resetHoveringIndex, {
|
|
89
|
+
immediate: true
|
|
90
|
+
});
|
|
91
|
+
expose({
|
|
92
|
+
hoveringIndex,
|
|
93
|
+
navigateOptions,
|
|
94
|
+
selectHoverOption,
|
|
95
|
+
hoverOption
|
|
96
|
+
});
|
|
97
|
+
return (_ctx, _cache) => {
|
|
98
|
+
return openBlock(), createElementBlock("div", {
|
|
99
|
+
ref_key: "dropdownRef",
|
|
100
|
+
ref: dropdownRef,
|
|
101
|
+
class: normalizeClass(unref(ns).b("dropdown"))
|
|
102
|
+
}, [
|
|
103
|
+
_ctx.$slots.header ? (openBlock(), createElementBlock("div", {
|
|
104
|
+
key: 0,
|
|
105
|
+
class: normalizeClass(unref(ns).be("dropdown", "header"))
|
|
106
|
+
}, [
|
|
107
|
+
renderSlot(_ctx.$slots, "header")
|
|
108
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
109
|
+
withDirectives(createVNode(unref(ElScrollbar), {
|
|
110
|
+
id: _ctx.contentId,
|
|
111
|
+
ref_key: "scrollbarRef",
|
|
112
|
+
ref: scrollbarRef,
|
|
113
|
+
tag: "ul",
|
|
114
|
+
"wrap-class": unref(ns).be("dropdown", "wrap"),
|
|
115
|
+
"view-class": unref(ns).be("dropdown", "list"),
|
|
116
|
+
role: "listbox",
|
|
117
|
+
"aria-label": _ctx.ariaLabel,
|
|
118
|
+
"aria-orientation": "vertical"
|
|
119
|
+
}, {
|
|
120
|
+
default: withCtx(() => [
|
|
121
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, index) => {
|
|
122
|
+
return openBlock(), createElementBlock("li", {
|
|
123
|
+
id: `${_ctx.contentId}-${index}`,
|
|
124
|
+
ref_for: true,
|
|
125
|
+
ref_key: "optionRefs",
|
|
126
|
+
ref: optionRefs,
|
|
127
|
+
key: item.value,
|
|
128
|
+
class: normalizeClass(optionkls(item, index)),
|
|
129
|
+
role: "option",
|
|
130
|
+
"aria-disabled": item.disabled || _ctx.disabled || void 0,
|
|
131
|
+
"aria-selected": hoveringIndex.value === index,
|
|
132
|
+
onMousemove: ($event) => handleMouseEnter(index),
|
|
133
|
+
onClick: withModifiers(($event) => handleSelect(item), ["stop"])
|
|
134
|
+
}, [
|
|
135
|
+
renderSlot(_ctx.$slots, "label", {
|
|
136
|
+
item,
|
|
137
|
+
index
|
|
138
|
+
}, () => {
|
|
139
|
+
var _a;
|
|
140
|
+
return [
|
|
141
|
+
createElementVNode("span", null, toDisplayString((_a = item.label) != null ? _a : item.value), 1)
|
|
142
|
+
];
|
|
143
|
+
})
|
|
144
|
+
], 42, ["id", "aria-disabled", "aria-selected", "onMousemove", "onClick"]);
|
|
145
|
+
}), 128))
|
|
146
|
+
]),
|
|
147
|
+
_: 3
|
|
148
|
+
}, 8, ["id", "wrap-class", "view-class", "aria-label"]), [
|
|
149
|
+
[vShow, _ctx.options.length > 0 && !_ctx.loading]
|
|
150
|
+
]),
|
|
151
|
+
_ctx.loading ? (openBlock(), createElementBlock("div", {
|
|
152
|
+
key: 1,
|
|
153
|
+
class: normalizeClass(unref(ns).be("dropdown", "loading"))
|
|
154
|
+
}, [
|
|
155
|
+
renderSlot(_ctx.$slots, "loading", {}, () => [
|
|
156
|
+
createTextVNode(toDisplayString(unref(t)("el.mention.loading")), 1)
|
|
157
|
+
])
|
|
158
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
159
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
|
|
160
|
+
key: 2,
|
|
161
|
+
class: normalizeClass(unref(ns).be("dropdown", "footer"))
|
|
162
|
+
}, [
|
|
163
|
+
renderSlot(_ctx.$slots, "footer")
|
|
164
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
165
|
+
], 2);
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
var ElMentionDropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "mention-dropdown.vue"]]);
|
|
18
170
|
|
|
19
|
-
export {
|
|
171
|
+
export { ElMentionDropdown as default };
|
|
20
172
|
//# sourceMappingURL=mention-dropdown2.mjs.map
|