@element-plus/nightly 0.0.20240624 → 0.0.20240625
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.full.js +6 -3
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +6 -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/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/anchor/index.mjs +3 -3
- package/es/components/anchor/src/anchor-link.mjs +82 -6
- package/es/components/anchor/src/anchor-link.mjs.map +1 -1
- package/es/components/anchor/src/anchor-link2.mjs +6 -82
- package/es/components/anchor/src/anchor-link2.mjs.map +1 -1
- package/es/components/anchor/src/anchor.mjs +193 -38
- package/es/components/anchor/src/anchor.mjs.map +1 -1
- package/es/components/anchor/src/anchor2.mjs +38 -193
- package/es/components/anchor/src/anchor2.mjs.map +1 -1
- package/es/components/button/index.mjs +2 -2
- package/es/components/button/src/button-group.mjs +1 -1
- package/es/components/button/src/button.mjs +77 -57
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button2.mjs +57 -77
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/check-tag/index.mjs +2 -2
- package/es/components/check-tag/src/check-tag.mjs +35 -17
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag2.mjs +17 -35
- package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
- package/es/components/index.mjs +3 -3
- package/es/components/pagination/src/pagination.d.ts +12 -12
- package/es/components/pagination/src/pagination.mjs +5 -2
- package/es/components/pagination/src/pagination.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +2 -2
- package/es/components/tooltip-v2/src/trigger.mjs +89 -12
- package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
- package/es/components/tooltip-v2/src/trigger2.mjs +12 -89
- package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
- package/es/index.mjs +3 -3
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/anchor/index.js +3 -3
- package/lib/components/anchor/src/anchor-link.js +82 -6
- package/lib/components/anchor/src/anchor-link.js.map +1 -1
- package/lib/components/anchor/src/anchor-link2.js +6 -82
- package/lib/components/anchor/src/anchor-link2.js.map +1 -1
- package/lib/components/anchor/src/anchor.js +192 -38
- package/lib/components/anchor/src/anchor.js.map +1 -1
- package/lib/components/anchor/src/anchor2.js +38 -192
- package/lib/components/anchor/src/anchor2.js.map +1 -1
- package/lib/components/button/index.js +2 -2
- package/lib/components/button/src/button-group.js +1 -1
- package/lib/components/button/src/button.js +77 -60
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button2.js +60 -77
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/check-tag/index.js +2 -2
- package/lib/components/check-tag/src/check-tag.js +35 -18
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag2.js +18 -35
- package/lib/components/check-tag/src/check-tag2.js.map +1 -1
- package/lib/components/index.js +3 -3
- package/lib/components/pagination/src/pagination.d.ts +12 -12
- package/lib/components/pagination/src/pagination.js +4 -1
- package/lib/components/pagination/src/pagination.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm.js +1 -1
- package/lib/components/tooltip-v2/index.js +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +2 -2
- package/lib/components/tooltip-v2/src/trigger.js +89 -12
- package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
- package/lib/components/tooltip-v2/src/trigger2.js +12 -89
- package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
- package/lib/index.js +3 -3
- 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/web-types.json +1 -1
|
@@ -8,11 +8,11 @@ var arrow = require('./arrow.js');
|
|
|
8
8
|
var content = require('./content.js');
|
|
9
9
|
var root = require('./root.js');
|
|
10
10
|
var tooltip = require('./tooltip.js');
|
|
11
|
-
var trigger = require('./
|
|
11
|
+
var trigger = require('./trigger2.js');
|
|
12
12
|
var root$1 = require('./root2.js');
|
|
13
13
|
var arrow$1 = require('./arrow2.js');
|
|
14
14
|
var content$1 = require('./content2.js');
|
|
15
|
-
var trigger$1 = require('./
|
|
15
|
+
var trigger$1 = require('./trigger.js');
|
|
16
16
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
17
17
|
|
|
18
18
|
const __default__ = vue.defineComponent({
|
|
@@ -2,20 +2,97 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
5
6
|
require('../../../utils/index.js');
|
|
6
|
-
var
|
|
7
|
+
var constants = require('./constants.js');
|
|
8
|
+
var forwardRef = require('./forward-ref.js');
|
|
9
|
+
var trigger = require('./trigger2.js');
|
|
10
|
+
var common = require('./common.js');
|
|
11
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
+
var event = require('../../../utils/dom/event.js');
|
|
7
13
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
const tooltipV2TriggerProps = runtime.buildProps({
|
|
12
|
-
onBlur: EventHandler,
|
|
13
|
-
onClick: EventHandler,
|
|
14
|
-
onFocus: EventHandler,
|
|
15
|
-
onMouseDown: EventHandler,
|
|
16
|
-
onMouseEnter: EventHandler,
|
|
17
|
-
onMouseLeave: EventHandler
|
|
14
|
+
const __default__ = vue.defineComponent({
|
|
15
|
+
name: "ElTooltipV2Trigger"
|
|
18
16
|
});
|
|
17
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
18
|
+
...__default__,
|
|
19
|
+
props: {
|
|
20
|
+
...common.tooltipV2CommonProps,
|
|
21
|
+
...trigger.tooltipV2TriggerProps
|
|
22
|
+
},
|
|
23
|
+
setup(__props) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
const { onClose, onOpen, onDelayOpen, triggerRef, contentId } = vue.inject(constants.tooltipV2RootKey);
|
|
26
|
+
let isMousedown = false;
|
|
27
|
+
const setTriggerRef = (el) => {
|
|
28
|
+
triggerRef.value = el;
|
|
29
|
+
};
|
|
30
|
+
const onMouseup = () => {
|
|
31
|
+
isMousedown = false;
|
|
32
|
+
};
|
|
33
|
+
const onMouseenter = event.composeEventHandlers(props.onMouseEnter, onDelayOpen);
|
|
34
|
+
const onMouseleave = event.composeEventHandlers(props.onMouseLeave, onClose);
|
|
35
|
+
const onMousedown = event.composeEventHandlers(props.onMouseDown, () => {
|
|
36
|
+
onClose();
|
|
37
|
+
isMousedown = true;
|
|
38
|
+
document.addEventListener("mouseup", onMouseup, { once: true });
|
|
39
|
+
});
|
|
40
|
+
const onFocus = event.composeEventHandlers(props.onFocus, () => {
|
|
41
|
+
if (!isMousedown)
|
|
42
|
+
onOpen();
|
|
43
|
+
});
|
|
44
|
+
const onBlur = event.composeEventHandlers(props.onBlur, onClose);
|
|
45
|
+
const onClick = event.composeEventHandlers(props.onClick, (e) => {
|
|
46
|
+
if (e.detail === 0)
|
|
47
|
+
onClose();
|
|
48
|
+
});
|
|
49
|
+
const events = {
|
|
50
|
+
blur: onBlur,
|
|
51
|
+
click: onClick,
|
|
52
|
+
focus: onFocus,
|
|
53
|
+
mousedown: onMousedown,
|
|
54
|
+
mouseenter: onMouseenter,
|
|
55
|
+
mouseleave: onMouseleave
|
|
56
|
+
};
|
|
57
|
+
const setEvents = (el, events2, type) => {
|
|
58
|
+
if (el) {
|
|
59
|
+
Object.entries(events2).forEach(([name, handler]) => {
|
|
60
|
+
el[type](name, handler);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
vue.watch(triggerRef, (triggerEl, previousTriggerEl) => {
|
|
65
|
+
setEvents(triggerEl, events, "addEventListener");
|
|
66
|
+
setEvents(previousTriggerEl, events, "removeEventListener");
|
|
67
|
+
if (triggerEl) {
|
|
68
|
+
triggerEl.setAttribute("aria-describedby", contentId.value);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
vue.onBeforeUnmount(() => {
|
|
72
|
+
setEvents(triggerRef.value, events, "removeEventListener");
|
|
73
|
+
document.removeEventListener("mouseup", onMouseup);
|
|
74
|
+
});
|
|
75
|
+
return (_ctx, _cache) => {
|
|
76
|
+
return _ctx.nowrap ? (vue.openBlock(), vue.createBlock(vue.unref(forwardRef["default"]), {
|
|
77
|
+
key: 0,
|
|
78
|
+
"set-ref": setTriggerRef,
|
|
79
|
+
"only-child": ""
|
|
80
|
+
}, {
|
|
81
|
+
default: vue.withCtx(() => [
|
|
82
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
83
|
+
]),
|
|
84
|
+
_: 3
|
|
85
|
+
})) : (vue.openBlock(), vue.createElementBlock("button", vue.mergeProps({
|
|
86
|
+
key: 1,
|
|
87
|
+
ref_key: "triggerRef",
|
|
88
|
+
ref: triggerRef
|
|
89
|
+
}, _ctx.$attrs), [
|
|
90
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
91
|
+
], 16));
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
var TooltipV2Trigger = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "trigger.vue"]]);
|
|
19
96
|
|
|
20
|
-
exports
|
|
97
|
+
exports["default"] = TooltipV2Trigger;
|
|
21
98
|
//# sourceMappingURL=trigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.js","sources":["../../../../../../packages/components/tooltip-v2/src/trigger.
|
|
1
|
+
{"version":3,"file":"trigger.js","sources":["../../../../../../packages/components/tooltip-v2/src/trigger.vue"],"sourcesContent":["<template>\n <forward-ref v-if=\"nowrap\" :set-ref=\"setTriggerRef\" only-child>\n <slot />\n </forward-ref>\n <button v-else ref=\"triggerRef\" v-bind=\"$attrs\">\n <slot />\n </button>\n</template>\n\n<script setup lang=\"ts\">\nimport { inject, onBeforeUnmount, watch } from 'vue'\nimport { composeEventHandlers } from '@element-plus/utils'\nimport { tooltipV2RootKey } from './constants'\nimport ForwardRef from './forward-ref'\nimport { tooltipV2TriggerProps } from './trigger'\nimport { tooltipV2CommonProps } from './common'\n\ndefineOptions({\n name: 'ElTooltipV2Trigger',\n})\n\nconst props = defineProps({\n ...tooltipV2CommonProps,\n ...tooltipV2TriggerProps,\n})\n\n/**\n * onOpen opens the tooltip instantly, onTrigger acts a lil bit differently,\n * it will check if delayDuration is set to greater than 0 and based on that result,\n * if true, it opens the tooltip after delayDuration, otherwise it opens it instantly.\n */\nconst { onClose, onOpen, onDelayOpen, triggerRef, contentId } =\n inject(tooltipV2RootKey)!\n\nlet isMousedown = false\n\nconst setTriggerRef = (el: HTMLElement | null) => {\n triggerRef.value = el\n}\n\nconst onMouseup = () => {\n isMousedown = false\n}\n\nconst onMouseenter = composeEventHandlers(props.onMouseEnter, onDelayOpen)\n\nconst onMouseleave = composeEventHandlers(props.onMouseLeave, onClose)\n\nconst onMousedown = composeEventHandlers(props.onMouseDown, () => {\n onClose()\n isMousedown = true\n document.addEventListener('mouseup', onMouseup, { once: true })\n})\n\nconst onFocus = composeEventHandlers(props.onFocus, () => {\n if (!isMousedown) onOpen()\n})\n\nconst onBlur = composeEventHandlers(props.onBlur, onClose)\n\nconst onClick = composeEventHandlers(props.onClick, (e) => {\n if ((e as MouseEvent).detail === 0) onClose()\n})\n\nconst events = {\n blur: onBlur,\n click: onClick,\n focus: onFocus,\n mousedown: onMousedown,\n mouseenter: onMouseenter,\n mouseleave: onMouseleave,\n}\n\nconst setEvents = <T extends (e: Event) => void>(\n el: HTMLElement | null | undefined,\n events: Record<string, T>,\n type: 'addEventListener' | 'removeEventListener'\n) => {\n if (el) {\n Object.entries(events).forEach(([name, handler]) => {\n el[type](name, handler)\n })\n }\n}\n\nwatch(triggerRef, (triggerEl, previousTriggerEl) => {\n setEvents(triggerEl, events, 'addEventListener')\n setEvents(previousTriggerEl, events, 'removeEventListener')\n\n if (triggerEl) {\n triggerEl.setAttribute('aria-describedby', contentId.value)\n }\n})\n\nonBeforeUnmount(() => {\n setEvents(triggerRef.value, events, 'removeEventListener')\n document.removeEventListener('mouseup', onMouseup)\n})\n</script>\n"],"names":["inject","tooltipV2RootKey","composeEventHandlers","watch","onBeforeUnmount"],"mappings":"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"}
|
|
@@ -2,97 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
5
|
require('../../../utils/index.js');
|
|
7
|
-
var
|
|
8
|
-
var forwardRef = require('./forward-ref.js');
|
|
9
|
-
var trigger = require('./trigger.js');
|
|
10
|
-
var common = require('./common.js');
|
|
11
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
-
var event = require('../../../utils/dom/event.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
13
7
|
|
|
14
|
-
const
|
|
15
|
-
|
|
8
|
+
const EventHandler = {
|
|
9
|
+
type: runtime.definePropType(Function)
|
|
10
|
+
};
|
|
11
|
+
const tooltipV2TriggerProps = runtime.buildProps({
|
|
12
|
+
onBlur: EventHandler,
|
|
13
|
+
onClick: EventHandler,
|
|
14
|
+
onFocus: EventHandler,
|
|
15
|
+
onMouseDown: EventHandler,
|
|
16
|
+
onMouseEnter: EventHandler,
|
|
17
|
+
onMouseLeave: EventHandler
|
|
16
18
|
});
|
|
17
|
-
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
18
|
-
...__default__,
|
|
19
|
-
props: {
|
|
20
|
-
...common.tooltipV2CommonProps,
|
|
21
|
-
...trigger.tooltipV2TriggerProps
|
|
22
|
-
},
|
|
23
|
-
setup(__props) {
|
|
24
|
-
const props = __props;
|
|
25
|
-
const { onClose, onOpen, onDelayOpen, triggerRef, contentId } = vue.inject(constants.tooltipV2RootKey);
|
|
26
|
-
let isMousedown = false;
|
|
27
|
-
const setTriggerRef = (el) => {
|
|
28
|
-
triggerRef.value = el;
|
|
29
|
-
};
|
|
30
|
-
const onMouseup = () => {
|
|
31
|
-
isMousedown = false;
|
|
32
|
-
};
|
|
33
|
-
const onMouseenter = event.composeEventHandlers(props.onMouseEnter, onDelayOpen);
|
|
34
|
-
const onMouseleave = event.composeEventHandlers(props.onMouseLeave, onClose);
|
|
35
|
-
const onMousedown = event.composeEventHandlers(props.onMouseDown, () => {
|
|
36
|
-
onClose();
|
|
37
|
-
isMousedown = true;
|
|
38
|
-
document.addEventListener("mouseup", onMouseup, { once: true });
|
|
39
|
-
});
|
|
40
|
-
const onFocus = event.composeEventHandlers(props.onFocus, () => {
|
|
41
|
-
if (!isMousedown)
|
|
42
|
-
onOpen();
|
|
43
|
-
});
|
|
44
|
-
const onBlur = event.composeEventHandlers(props.onBlur, onClose);
|
|
45
|
-
const onClick = event.composeEventHandlers(props.onClick, (e) => {
|
|
46
|
-
if (e.detail === 0)
|
|
47
|
-
onClose();
|
|
48
|
-
});
|
|
49
|
-
const events = {
|
|
50
|
-
blur: onBlur,
|
|
51
|
-
click: onClick,
|
|
52
|
-
focus: onFocus,
|
|
53
|
-
mousedown: onMousedown,
|
|
54
|
-
mouseenter: onMouseenter,
|
|
55
|
-
mouseleave: onMouseleave
|
|
56
|
-
};
|
|
57
|
-
const setEvents = (el, events2, type) => {
|
|
58
|
-
if (el) {
|
|
59
|
-
Object.entries(events2).forEach(([name, handler]) => {
|
|
60
|
-
el[type](name, handler);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
vue.watch(triggerRef, (triggerEl, previousTriggerEl) => {
|
|
65
|
-
setEvents(triggerEl, events, "addEventListener");
|
|
66
|
-
setEvents(previousTriggerEl, events, "removeEventListener");
|
|
67
|
-
if (triggerEl) {
|
|
68
|
-
triggerEl.setAttribute("aria-describedby", contentId.value);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
vue.onBeforeUnmount(() => {
|
|
72
|
-
setEvents(triggerRef.value, events, "removeEventListener");
|
|
73
|
-
document.removeEventListener("mouseup", onMouseup);
|
|
74
|
-
});
|
|
75
|
-
return (_ctx, _cache) => {
|
|
76
|
-
return _ctx.nowrap ? (vue.openBlock(), vue.createBlock(vue.unref(forwardRef["default"]), {
|
|
77
|
-
key: 0,
|
|
78
|
-
"set-ref": setTriggerRef,
|
|
79
|
-
"only-child": ""
|
|
80
|
-
}, {
|
|
81
|
-
default: vue.withCtx(() => [
|
|
82
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
83
|
-
]),
|
|
84
|
-
_: 3
|
|
85
|
-
})) : (vue.openBlock(), vue.createElementBlock("button", vue.mergeProps({
|
|
86
|
-
key: 1,
|
|
87
|
-
ref_key: "triggerRef",
|
|
88
|
-
ref: triggerRef
|
|
89
|
-
}, _ctx.$attrs), [
|
|
90
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
91
|
-
], 16));
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
var TooltipV2Trigger = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "trigger.vue"]]);
|
|
96
19
|
|
|
97
|
-
exports
|
|
20
|
+
exports.tooltipV2TriggerProps = tooltipV2TriggerProps;
|
|
98
21
|
//# sourceMappingURL=trigger2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger2.js","sources":["../../../../../../packages/components/tooltip-v2/src/trigger.
|
|
1
|
+
{"version":3,"file":"trigger2.js","sources":["../../../../../../packages/components/tooltip-v2/src/trigger.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\n\nconst EventHandler = {\n type: definePropType<(e: Event) => boolean | void>(Function),\n} as const\n\nexport const tooltipV2TriggerProps = buildProps({\n onBlur: EventHandler,\n onClick: EventHandler,\n onFocus: EventHandler,\n onMouseDown: EventHandler,\n onMouseEnter: EventHandler,\n onMouseLeave: EventHandler,\n} as const)\n\nexport type TooltipV2TriggerProps = ExtractPropTypes<\n typeof tooltipV2TriggerProps\n>\n"],"names":["definePropType","buildProps"],"mappings":";;;;;;;AACA,MAAM,YAAY,GAAG;AACrB,EAAE,IAAI,EAAEA,sBAAc,CAAC,QAAQ,CAAC;AAChC,CAAC,CAAC;AACU,MAAC,qBAAqB,GAAGC,kBAAU,CAAC;AAChD,EAAE,MAAM,EAAE,YAAY;AACtB,EAAE,OAAO,EAAE,YAAY;AACvB,EAAE,OAAO,EAAE,YAAY;AACvB,EAAE,WAAW,EAAE,YAAY;AAC3B,EAAE,YAAY,EAAE,YAAY;AAC5B,EAAE,YAAY,EAAE,YAAY;AAC5B,CAAC;;;;"}
|
package/lib/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var breadcrumb = require('./components/breadcrumb/src/breadcrumb.js');
|
|
|
25
25
|
var breadcrumbItem = require('./components/breadcrumb/src/breadcrumb-item.js');
|
|
26
26
|
var constants = require('./components/breadcrumb/src/constants.js');
|
|
27
27
|
var index$6 = require('./components/breadcrumb/index.js');
|
|
28
|
-
var button = require('./components/button/src/
|
|
28
|
+
var button = require('./components/button/src/button2.js');
|
|
29
29
|
var constants$1 = require('./components/button/src/constants.js');
|
|
30
30
|
var index$7 = require('./components/button/index.js');
|
|
31
31
|
var calendar = require('./components/calendar/src/calendar.js');
|
|
@@ -41,7 +41,7 @@ var index$b = require('./components/cascader/index.js');
|
|
|
41
41
|
var types = require('./components/cascader-panel/src/types.js');
|
|
42
42
|
var config = require('./components/cascader-panel/src/config.js');
|
|
43
43
|
var index$c = require('./components/cascader-panel/index.js');
|
|
44
|
-
var checkTag = require('./components/check-tag/src/check-
|
|
44
|
+
var checkTag = require('./components/check-tag/src/check-tag2.js');
|
|
45
45
|
var index$d = require('./components/check-tag/index.js');
|
|
46
46
|
var checkboxGroup = require('./components/checkbox/src/checkbox-group.js');
|
|
47
47
|
var checkbox = require('./components/checkbox/src/checkbox.js');
|
|
@@ -218,7 +218,7 @@ var tour = require('./components/tour/src/tour.js');
|
|
|
218
218
|
var step = require('./components/tour/src/step.js');
|
|
219
219
|
var content$3 = require('./components/tour/src/content.js');
|
|
220
220
|
var index$17 = require('./components/tour/index.js');
|
|
221
|
-
var anchor = require('./components/anchor/src/
|
|
221
|
+
var anchor = require('./components/anchor/src/anchor2.js');
|
|
222
222
|
var index$18 = require('./components/anchor/index.js');
|
|
223
223
|
var segmented = require('./components/segmented/src/segmented.js');
|
|
224
224
|
var index$19 = require('./components/segmented/index.js');
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20240625";
|
package/lib/version.js
CHANGED
package/lib/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20240625'\n"],"names":[],"mappings":";;;;AAAY,MAAC,OAAO,GAAG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@element-plus/nightly",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20240625",
|
|
4
4
|
"description": "A Component Library for Vue 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"element-plus",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"not ie 11",
|
|
113
113
|
"not op_mini all"
|
|
114
114
|
],
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "9619e62d0cc16145a61518cce76130190eba7229"
|
|
116
116
|
}
|