@element-plus/nightly 0.0.20240315 → 0.0.20240316
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 +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- 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/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse-item.mjs +13 -91
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item2.mjs +91 -13
- package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/index.mjs +2 -2
- package/es/components/popover/src/popover.mjs +1 -1
- package/es/components/teleport/index.mjs +2 -2
- package/es/components/teleport/src/teleport.mjs +44 -18
- package/es/components/teleport/src/teleport.mjs.map +1 -1
- package/es/components/teleport/src/teleport2.mjs +18 -44
- package/es/components/teleport/src/teleport2.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/tooltip/src/trigger.mjs +73 -16
- package/es/components/tooltip/src/trigger.mjs.map +1 -1
- package/es/components/tooltip/src/trigger2.mjs +16 -73
- package/es/components/tooltip/src/trigger2.mjs.map +1 -1
- package/es/index.mjs +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse-item.js +13 -91
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/collapse/src/collapse-item2.js +91 -13
- package/lib/components/collapse/src/collapse-item2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/popover/src/popover.js +1 -1
- package/lib/components/teleport/index.js +2 -2
- package/lib/components/teleport/src/teleport.js +44 -18
- package/lib/components/teleport/src/teleport.js.map +1 -1
- package/lib/components/teleport/src/teleport2.js +18 -44
- package/lib/components/teleport/src/teleport2.js.map +1 -1
- package/lib/components/tooltip/index.js +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/tooltip/src/trigger.js +73 -16
- package/lib/components/tooltip/src/trigger.js.map +1 -1
- package/lib/components/tooltip/src/trigger2.js +16 -73
- package/lib/components/tooltip/src/trigger2.js.map +1 -1
- package/lib/index.js +2 -2
- 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
|
@@ -1,95 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { ElIcon } from '../../icon/index.mjs';
|
|
4
|
-
import { ArrowRight } from '@element-plus/icons-vue';
|
|
5
|
-
import { collapseItemProps } from './collapse-item2.mjs';
|
|
6
|
-
import { useCollapseItem, useCollapseItemDOM } from './use-collapse-item.mjs';
|
|
7
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
8
3
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
const collapseItemProps = buildProps({
|
|
5
|
+
title: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: ""
|
|
8
|
+
},
|
|
9
|
+
name: {
|
|
10
|
+
type: definePropType([String, Number]),
|
|
11
|
+
default: void 0
|
|
12
|
+
},
|
|
13
|
+
disabled: Boolean
|
|
13
14
|
});
|
|
14
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
-
...__default__,
|
|
16
|
-
props: collapseItemProps,
|
|
17
|
-
setup(__props, { expose }) {
|
|
18
|
-
const props = __props;
|
|
19
|
-
const {
|
|
20
|
-
focusing,
|
|
21
|
-
id,
|
|
22
|
-
isActive,
|
|
23
|
-
handleFocus,
|
|
24
|
-
handleHeaderClick,
|
|
25
|
-
handleEnterClick
|
|
26
|
-
} = useCollapseItem(props);
|
|
27
|
-
const {
|
|
28
|
-
arrowKls,
|
|
29
|
-
headKls,
|
|
30
|
-
rootKls,
|
|
31
|
-
itemWrapperKls,
|
|
32
|
-
itemContentKls,
|
|
33
|
-
scopedContentId,
|
|
34
|
-
scopedHeadId
|
|
35
|
-
} = useCollapseItemDOM(props, { focusing, isActive, id });
|
|
36
|
-
expose({
|
|
37
|
-
isActive
|
|
38
|
-
});
|
|
39
|
-
return (_ctx, _cache) => {
|
|
40
|
-
return openBlock(), createElementBlock("div", {
|
|
41
|
-
class: normalizeClass(unref(rootKls))
|
|
42
|
-
}, [
|
|
43
|
-
createElementVNode("button", {
|
|
44
|
-
id: unref(scopedHeadId),
|
|
45
|
-
class: normalizeClass(unref(headKls)),
|
|
46
|
-
"aria-expanded": unref(isActive),
|
|
47
|
-
"aria-controls": unref(scopedContentId),
|
|
48
|
-
"aria-describedby": unref(scopedContentId),
|
|
49
|
-
tabindex: _ctx.disabled ? -1 : 0,
|
|
50
|
-
type: "button",
|
|
51
|
-
onClick: _cache[0] || (_cache[0] = (...args) => unref(handleHeaderClick) && unref(handleHeaderClick)(...args)),
|
|
52
|
-
onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers((...args) => unref(handleEnterClick) && unref(handleEnterClick)(...args), ["stop", "prevent"]), ["space", "enter"])),
|
|
53
|
-
onFocus: _cache[2] || (_cache[2] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)),
|
|
54
|
-
onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false)
|
|
55
|
-
}, [
|
|
56
|
-
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
57
|
-
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
58
|
-
]),
|
|
59
|
-
createVNode(unref(ElIcon), {
|
|
60
|
-
class: normalizeClass(unref(arrowKls))
|
|
61
|
-
}, {
|
|
62
|
-
default: withCtx(() => [
|
|
63
|
-
createVNode(unref(ArrowRight))
|
|
64
|
-
]),
|
|
65
|
-
_: 1
|
|
66
|
-
}, 8, ["class"])
|
|
67
|
-
], 42, _hoisted_1),
|
|
68
|
-
createVNode(unref(_CollapseTransition), null, {
|
|
69
|
-
default: withCtx(() => [
|
|
70
|
-
withDirectives(createElementVNode("div", {
|
|
71
|
-
id: unref(scopedContentId),
|
|
72
|
-
role: "region",
|
|
73
|
-
class: normalizeClass(unref(itemWrapperKls)),
|
|
74
|
-
"aria-hidden": !unref(isActive),
|
|
75
|
-
"aria-labelledby": unref(scopedHeadId)
|
|
76
|
-
}, [
|
|
77
|
-
createElementVNode("div", {
|
|
78
|
-
class: normalizeClass(unref(itemContentKls))
|
|
79
|
-
}, [
|
|
80
|
-
renderSlot(_ctx.$slots, "default")
|
|
81
|
-
], 2)
|
|
82
|
-
], 10, _hoisted_2), [
|
|
83
|
-
[vShow, unref(isActive)]
|
|
84
|
-
])
|
|
85
|
-
]),
|
|
86
|
-
_: 3
|
|
87
|
-
})
|
|
88
|
-
], 2);
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
var CollapseItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "collapse-item.vue"]]);
|
|
93
15
|
|
|
94
|
-
export {
|
|
16
|
+
export { collapseItemProps };
|
|
95
17
|
//# sourceMappingURL=collapse-item.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse-item.mjs","sources":["../../../../../../packages/components/collapse/src/collapse-item.
|
|
1
|
+
{"version":3,"file":"collapse-item.mjs","sources":["../../../../../../packages/components/collapse/src/collapse-item.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { CollapseActiveName } from './collapse'\n\nexport const collapseItemProps = buildProps({\n /**\n * @description title of the panel\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description unique identification of the panel\n */\n name: {\n type: definePropType<CollapseActiveName>([String, Number]),\n default: undefined,\n },\n /**\n * @description disable the collapse item\n */\n disabled: Boolean,\n} as const)\nexport type CollapseItemProps = ExtractPropTypes<typeof collapseItemProps>\n"],"names":[],"mappings":";;;AACY,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,CAAC;;;;"}
|
|
@@ -1,17 +1,95 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, withKeys, withModifiers, renderSlot, createTextVNode, toDisplayString, createVNode, withCtx, withDirectives, vShow } from 'vue';
|
|
2
|
+
import _CollapseTransition from '../../collapse-transition/index.mjs';
|
|
3
|
+
import { ElIcon } from '../../icon/index.mjs';
|
|
4
|
+
import { ArrowRight } from '@element-plus/icons-vue';
|
|
5
|
+
import { collapseItemProps } from './collapse-item.mjs';
|
|
6
|
+
import { useCollapseItem, useCollapseItemDOM } from './use-collapse-item.mjs';
|
|
7
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
3
8
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
name: {
|
|
10
|
-
type: definePropType([String, Number]),
|
|
11
|
-
default: void 0
|
|
12
|
-
},
|
|
13
|
-
disabled: Boolean
|
|
9
|
+
const _hoisted_1 = ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex"];
|
|
10
|
+
const _hoisted_2 = ["id", "aria-hidden", "aria-labelledby"];
|
|
11
|
+
const __default__ = defineComponent({
|
|
12
|
+
name: "ElCollapseItem"
|
|
14
13
|
});
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
...__default__,
|
|
16
|
+
props: collapseItemProps,
|
|
17
|
+
setup(__props, { expose }) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const {
|
|
20
|
+
focusing,
|
|
21
|
+
id,
|
|
22
|
+
isActive,
|
|
23
|
+
handleFocus,
|
|
24
|
+
handleHeaderClick,
|
|
25
|
+
handleEnterClick
|
|
26
|
+
} = useCollapseItem(props);
|
|
27
|
+
const {
|
|
28
|
+
arrowKls,
|
|
29
|
+
headKls,
|
|
30
|
+
rootKls,
|
|
31
|
+
itemWrapperKls,
|
|
32
|
+
itemContentKls,
|
|
33
|
+
scopedContentId,
|
|
34
|
+
scopedHeadId
|
|
35
|
+
} = useCollapseItemDOM(props, { focusing, isActive, id });
|
|
36
|
+
expose({
|
|
37
|
+
isActive
|
|
38
|
+
});
|
|
39
|
+
return (_ctx, _cache) => {
|
|
40
|
+
return openBlock(), createElementBlock("div", {
|
|
41
|
+
class: normalizeClass(unref(rootKls))
|
|
42
|
+
}, [
|
|
43
|
+
createElementVNode("button", {
|
|
44
|
+
id: unref(scopedHeadId),
|
|
45
|
+
class: normalizeClass(unref(headKls)),
|
|
46
|
+
"aria-expanded": unref(isActive),
|
|
47
|
+
"aria-controls": unref(scopedContentId),
|
|
48
|
+
"aria-describedby": unref(scopedContentId),
|
|
49
|
+
tabindex: _ctx.disabled ? -1 : 0,
|
|
50
|
+
type: "button",
|
|
51
|
+
onClick: _cache[0] || (_cache[0] = (...args) => unref(handleHeaderClick) && unref(handleHeaderClick)(...args)),
|
|
52
|
+
onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers((...args) => unref(handleEnterClick) && unref(handleEnterClick)(...args), ["stop", "prevent"]), ["space", "enter"])),
|
|
53
|
+
onFocus: _cache[2] || (_cache[2] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)),
|
|
54
|
+
onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false)
|
|
55
|
+
}, [
|
|
56
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
57
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
58
|
+
]),
|
|
59
|
+
createVNode(unref(ElIcon), {
|
|
60
|
+
class: normalizeClass(unref(arrowKls))
|
|
61
|
+
}, {
|
|
62
|
+
default: withCtx(() => [
|
|
63
|
+
createVNode(unref(ArrowRight))
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
}, 8, ["class"])
|
|
67
|
+
], 42, _hoisted_1),
|
|
68
|
+
createVNode(unref(_CollapseTransition), null, {
|
|
69
|
+
default: withCtx(() => [
|
|
70
|
+
withDirectives(createElementVNode("div", {
|
|
71
|
+
id: unref(scopedContentId),
|
|
72
|
+
role: "region",
|
|
73
|
+
class: normalizeClass(unref(itemWrapperKls)),
|
|
74
|
+
"aria-hidden": !unref(isActive),
|
|
75
|
+
"aria-labelledby": unref(scopedHeadId)
|
|
76
|
+
}, [
|
|
77
|
+
createElementVNode("div", {
|
|
78
|
+
class: normalizeClass(unref(itemContentKls))
|
|
79
|
+
}, [
|
|
80
|
+
renderSlot(_ctx.$slots, "default")
|
|
81
|
+
], 2)
|
|
82
|
+
], 10, _hoisted_2), [
|
|
83
|
+
[vShow, unref(isActive)]
|
|
84
|
+
])
|
|
85
|
+
]),
|
|
86
|
+
_: 3
|
|
87
|
+
})
|
|
88
|
+
], 2);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
var CollapseItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "collapse-item.vue"]]);
|
|
15
93
|
|
|
16
|
-
export {
|
|
94
|
+
export { CollapseItem as default };
|
|
17
95
|
//# sourceMappingURL=collapse-item2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse-item2.mjs","sources":["../../../../../../packages/components/collapse/src/collapse-item.
|
|
1
|
+
{"version":3,"file":"collapse-item2.mjs","sources":["../../../../../../packages/components/collapse/src/collapse-item.vue"],"sourcesContent":["<template>\n <div :class=\"rootKls\">\n <button\n :id=\"scopedHeadId\"\n :class=\"headKls\"\n :aria-expanded=\"isActive\"\n :aria-controls=\"scopedContentId\"\n :aria-describedby=\"scopedContentId\"\n :tabindex=\"disabled ? -1 : 0\"\n type=\"button\"\n @click=\"handleHeaderClick\"\n @keydown.space.enter.stop.prevent=\"handleEnterClick\"\n @focus=\"handleFocus\"\n @blur=\"focusing = false\"\n >\n <slot name=\"title\">{{ title }}</slot>\n <el-icon :class=\"arrowKls\">\n <arrow-right />\n </el-icon>\n </button>\n\n <el-collapse-transition>\n <div\n v-show=\"isActive\"\n :id=\"scopedContentId\"\n role=\"region\"\n :class=\"itemWrapperKls\"\n :aria-hidden=\"!isActive\"\n :aria-labelledby=\"scopedHeadId\"\n >\n <div :class=\"itemContentKls\">\n <slot />\n </div>\n </div>\n </el-collapse-transition>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport ElCollapseTransition from '@element-plus/components/collapse-transition'\nimport ElIcon from '@element-plus/components/icon'\nimport { ArrowRight } from '@element-plus/icons-vue'\nimport { collapseItemProps } from './collapse-item'\nimport { useCollapseItem, useCollapseItemDOM } from './use-collapse-item'\n\ndefineOptions({\n name: 'ElCollapseItem',\n})\n\nconst props = defineProps(collapseItemProps)\nconst {\n focusing,\n id,\n isActive,\n handleFocus,\n handleHeaderClick,\n handleEnterClick,\n} = useCollapseItem(props)\n\nconst {\n arrowKls,\n headKls,\n rootKls,\n itemWrapperKls,\n itemContentKls,\n scopedContentId,\n scopedHeadId,\n} = useCollapseItemDOM(props, { focusing, isActive, id })\n\ndefineExpose({\n /** @description current collapse-item whether active */\n isActive,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;mCA6Cc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAGA,IAAM,MAAA;AAAA,MACJ,QAAA;AAAA,MACA,EAAA;AAAA,MACA,QAAA;AAAA,MACA,WAAA;AAAA,MACA,iBAAA;AAAA,MACA,gBAAA;AAAA,KAAA,GACE,gBAAgB,KAAK,CAAA,CAAA;AAEzB,IAAM,MAAA;AAAA,MACJ,QAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,cAAA;AAAA,MACA,cAAA;AAAA,MACA,eAAA;AAAA,MACA,YAAA;AAAA,KAAA,GACE,mBAAmB,KAAO,EAAA,EAAE,QAAU,EAAA,QAAA,EAAU,IAAI,CAAA,CAAA;AAExD,IAAa,MAAA,CAAA;AAAA,MAEX,QAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,7 +3,7 @@ import '../../../constants/index.mjs';
|
|
|
3
3
|
import '../../collection/index.mjs';
|
|
4
4
|
import '../../tooltip/index.mjs';
|
|
5
5
|
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
6
|
-
import { useTooltipTriggerProps } from '../../tooltip/src/
|
|
6
|
+
import { useTooltipTriggerProps } from '../../tooltip/src/trigger2.mjs';
|
|
7
7
|
import { useTooltipContentProps } from '../../tooltip/src/content.mjs';
|
|
8
8
|
import { iconPropType } from '../../../utils/vue/icon.mjs';
|
|
9
9
|
import { EVENT_CODE } from '../../../constants/aria.mjs';
|
package/es/components/index.mjs
CHANGED
|
@@ -103,7 +103,7 @@ export { checkboxEmits, checkboxProps } from './checkbox/src/checkbox.mjs';
|
|
|
103
103
|
export { checkboxGroupContextKey } from './checkbox/src/constants.mjs';
|
|
104
104
|
export { colProps } from './col/src/col.mjs';
|
|
105
105
|
export { collapseEmits, collapseProps, emitChangeFn } from './collapse/src/collapse.mjs';
|
|
106
|
-
export { collapseItemProps } from './collapse/src/collapse-
|
|
106
|
+
export { collapseItemProps } from './collapse/src/collapse-item.mjs';
|
|
107
107
|
export { collapseContextKey } from './collapse/src/constants.mjs';
|
|
108
108
|
export { colorPickerContextKey, colorPickerEmits, colorPickerProps } from './color-picker/src/color-picker.mjs';
|
|
109
109
|
export { messageConfig } from './config-provider/src/config-provider.mjs';
|
|
@@ -195,7 +195,7 @@ export { default as CommonPicker } from './time-picker/src/common/picker.mjs';
|
|
|
195
195
|
export { default as TimePickPanel } from './time-picker/src/time-picker-com/panel-time-pick.mjs';
|
|
196
196
|
export { timelineItemProps } from './timeline/src/timeline-item.mjs';
|
|
197
197
|
export { tooltipEmits, useTooltipModelToggle, useTooltipModelToggleEmits, useTooltipModelToggleProps, useTooltipProps } from './tooltip/src/tooltip.mjs';
|
|
198
|
-
export { useTooltipTriggerProps } from './tooltip/src/
|
|
198
|
+
export { useTooltipTriggerProps } from './tooltip/src/trigger2.mjs';
|
|
199
199
|
export { useTooltipContentProps } from './tooltip/src/content.mjs';
|
|
200
200
|
export { TOOLTIP_INJECTION_KEY } from './tooltip/src/constants.mjs';
|
|
201
201
|
export { LEFT_CHECK_CHANGE_EVENT, RIGHT_CHECK_CHANGE_EVENT, transferCheckedChangeFn, transferEmits, transferProps } from './transfer/src/transfer.mjs';
|
|
@@ -2,7 +2,7 @@ import '../../../utils/index.mjs';
|
|
|
2
2
|
import '../../tooltip/index.mjs';
|
|
3
3
|
import '../../dropdown/index.mjs';
|
|
4
4
|
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
5
|
-
import { useTooltipTriggerProps } from '../../tooltip/src/
|
|
5
|
+
import { useTooltipTriggerProps } from '../../tooltip/src/trigger2.mjs';
|
|
6
6
|
import { dropdownProps } from '../../dropdown/src/dropdown.mjs';
|
|
7
7
|
import { useTooltipContentProps } from '../../tooltip/src/content.mjs';
|
|
8
8
|
import { isBoolean } from '../../../utils/types.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Teleport from './src/
|
|
3
|
-
export { teleportProps } from './src/
|
|
2
|
+
import Teleport from './src/teleport.mjs';
|
|
3
|
+
export { teleportProps } from './src/teleport2.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const ElTeleport = withInstall(Teleport);
|
|
@@ -1,23 +1,49 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, ref, computed, openBlock, createBlock, Teleport as Teleport$1, createElementVNode, normalizeClass, unref, normalizeStyle, renderSlot, createCommentVNode } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
3
|
+
import { teleportProps } from './teleport2.mjs';
|
|
4
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
3
6
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "teleport",
|
|
9
|
+
props: teleportProps,
|
|
10
|
+
setup(__props, { expose }) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
const ns = useNamespace("teleport");
|
|
13
|
+
const containerRef = ref();
|
|
14
|
+
const containerStyle = computed(() => {
|
|
15
|
+
return props.container === "body" ? [
|
|
16
|
+
props.style,
|
|
17
|
+
{
|
|
18
|
+
position: "absolute",
|
|
19
|
+
top: `0px`,
|
|
20
|
+
left: `0px`,
|
|
21
|
+
zIndex: props.zIndex
|
|
22
|
+
}
|
|
23
|
+
] : {};
|
|
24
|
+
});
|
|
25
|
+
expose({
|
|
26
|
+
containerRef
|
|
27
|
+
});
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return _ctx.container ? (openBlock(), createBlock(Teleport$1, {
|
|
30
|
+
key: 0,
|
|
31
|
+
to: _ctx.container,
|
|
32
|
+
disabled: _ctx.disabled
|
|
33
|
+
}, [
|
|
34
|
+
createElementVNode("div", {
|
|
35
|
+
ref_key: "containerRef",
|
|
36
|
+
ref: containerRef,
|
|
37
|
+
class: normalizeClass(unref(ns).b()),
|
|
38
|
+
style: normalizeStyle(unref(containerStyle))
|
|
39
|
+
}, [
|
|
40
|
+
renderSlot(_ctx.$slots, "default")
|
|
41
|
+
], 6)
|
|
42
|
+
], 8, ["to", "disabled"])) : createCommentVNode("v-if", true);
|
|
43
|
+
};
|
|
19
44
|
}
|
|
20
45
|
});
|
|
46
|
+
var Teleport = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "teleport.vue"]]);
|
|
21
47
|
|
|
22
|
-
export {
|
|
48
|
+
export { Teleport as default };
|
|
23
49
|
//# sourceMappingURL=teleport.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teleport.mjs","sources":["../../../../../../packages/components/teleport/src/teleport.
|
|
1
|
+
{"version":3,"file":"teleport.mjs","sources":["../../../../../../packages/components/teleport/src/teleport.vue"],"sourcesContent":["<template>\n <teleport v-if=\"container\" :to=\"container\" :disabled=\"disabled\">\n <div ref=\"containerRef\" :class=\"ns.b()\" :style=\"containerStyle\">\n <slot />\n </div>\n </teleport>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { teleportProps } from './teleport'\nimport type { StyleValue } from 'vue'\n\nconst props = defineProps(teleportProps)\n\nconst ns = useNamespace('teleport')\nconst containerRef = ref<HTMLElement>()\n\nconst containerStyle = computed<StyleValue>(() => {\n return props.container === 'body'\n ? [\n props.style,\n {\n position: 'absolute',\n top: `0px`,\n left: `0px`,\n zIndex: props.zIndex,\n },\n ]\n : {}\n})\n\ndefineExpose({\n /** @description container element */\n containerRef,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;AAgBA,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAClC,IAAA,MAAM,eAAe,GAAiB,EAAA,CAAA;AAEtC,IAAM,MAAA,cAAA,GAAiB,SAAqB,MAAM;AAChD,MAAO,OAAA,KAAA,CAAM,cAAc,MACvB,GAAA;AAAA,QACE,KAAM,CAAA,KAAA;AAAA,QACN;AAAA,UACE,QAAU,EAAA,UAAA;AAAA,UACV,GAAK,EAAA,CAAA,GAAA,CAAA;AAAA,UACL,IAAM,EAAA,CAAA,GAAA,CAAA;AAAA,UACN,QAAQ,KAAM,CAAA,MAAA;AAAA,SAChB;AAAA,UAEF,EAAC,CAAA;AAAA,KACN,CAAA,CAAA;AAED,IAAa,MAAA,CAAA;AAAA,MAEX,YAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,49 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../../
|
|
3
|
-
import { teleportProps } from './teleport.mjs';
|
|
4
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
6
3
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
] : {};
|
|
24
|
-
});
|
|
25
|
-
expose({
|
|
26
|
-
containerRef
|
|
27
|
-
});
|
|
28
|
-
return (_ctx, _cache) => {
|
|
29
|
-
return _ctx.container ? (openBlock(), createBlock(Teleport$1, {
|
|
30
|
-
key: 0,
|
|
31
|
-
to: _ctx.container,
|
|
32
|
-
disabled: _ctx.disabled
|
|
33
|
-
}, [
|
|
34
|
-
createElementVNode("div", {
|
|
35
|
-
ref_key: "containerRef",
|
|
36
|
-
ref: containerRef,
|
|
37
|
-
class: normalizeClass(unref(ns).b()),
|
|
38
|
-
style: normalizeStyle(unref(containerStyle))
|
|
39
|
-
}, [
|
|
40
|
-
renderSlot(_ctx.$slots, "default")
|
|
41
|
-
], 6)
|
|
42
|
-
], 8, ["to", "disabled"])) : createCommentVNode("v-if", true);
|
|
43
|
-
};
|
|
4
|
+
const teleportProps = buildProps({
|
|
5
|
+
container: {
|
|
6
|
+
type: definePropType(String),
|
|
7
|
+
default: "body"
|
|
8
|
+
},
|
|
9
|
+
disabled: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false
|
|
12
|
+
},
|
|
13
|
+
style: {
|
|
14
|
+
type: definePropType([String, Array, Object])
|
|
15
|
+
},
|
|
16
|
+
zIndex: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "2000"
|
|
44
19
|
}
|
|
45
20
|
});
|
|
46
|
-
var Teleport = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "teleport.vue"]]);
|
|
47
21
|
|
|
48
|
-
export {
|
|
22
|
+
export { teleportProps };
|
|
49
23
|
//# sourceMappingURL=teleport2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teleport2.mjs","sources":["../../../../../../packages/components/teleport/src/teleport.
|
|
1
|
+
{"version":3,"file":"teleport2.mjs","sources":["../../../../../../packages/components/teleport/src/teleport.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes, StyleValue } from 'vue'\nimport type Teleport from './teleport.vue'\n\nexport const teleportProps = buildProps({\n container: {\n type: definePropType<string>(String),\n default: 'body',\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n style: {\n type: definePropType<StyleValue>([String, Array, Object]),\n },\n zIndex: {\n type: String,\n default: '2000',\n },\n} as const)\n\nexport type TeleportProps = ExtractPropTypes<typeof teleportProps>\nexport type TeleportInstance = InstanceType<typeof Teleport>\n"],"names":[],"mappings":";;;AACY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACjD,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
2
|
import Tooltip from './src/tooltip2.mjs';
|
|
3
3
|
export { tooltipEmits, useTooltipModelToggle, useTooltipModelToggleEmits, useTooltipModelToggleProps, useTooltipProps } from './src/tooltip.mjs';
|
|
4
|
-
export { useTooltipTriggerProps } from './src/
|
|
4
|
+
export { useTooltipTriggerProps } from './src/trigger2.mjs';
|
|
5
5
|
export { useTooltipContentProps } from './src/content.mjs';
|
|
6
6
|
export { TOOLTIP_INJECTION_KEY } from './src/constants.mjs';
|
|
7
7
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
@@ -2,7 +2,7 @@ import '../../../utils/index.mjs';
|
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
3
|
import '../../popper/index.mjs';
|
|
4
4
|
import { useTooltipContentProps } from './content.mjs';
|
|
5
|
-
import { useTooltipTriggerProps } from './
|
|
5
|
+
import { useTooltipTriggerProps } from './trigger2.mjs';
|
|
6
6
|
import { createModelToggleComposable } from '../../../hooks/use-model-toggle/index.mjs';
|
|
7
7
|
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
8
8
|
import { popperProps } from '../../popper/src/popper.mjs';
|
|
@@ -4,7 +4,7 @@ import '../../../utils/index.mjs';
|
|
|
4
4
|
import '../../../hooks/index.mjs';
|
|
5
5
|
import { TOOLTIP_INJECTION_KEY } from './constants.mjs';
|
|
6
6
|
import { useTooltipProps, tooltipEmits, useTooltipModelToggle } from './tooltip.mjs';
|
|
7
|
-
import ElTooltipTrigger from './
|
|
7
|
+
import ElTooltipTrigger from './trigger.mjs';
|
|
8
8
|
import ElTooltipContent from './content2.mjs';
|
|
9
9
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
10
10
|
import { usePopperContainer } from '../../../hooks/use-popper-container/index.mjs';
|
|
@@ -1,22 +1,79 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { defineComponent, inject, ref, unref, toRef, openBlock, createBlock, normalizeClass, withCtx, renderSlot } from 'vue';
|
|
2
2
|
import '../../popper/index.mjs';
|
|
3
|
-
import '../../../
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import '../../../utils/index.mjs';
|
|
4
|
+
import '../../../hooks/index.mjs';
|
|
5
|
+
import { TOOLTIP_INJECTION_KEY } from './constants.mjs';
|
|
6
|
+
import { useTooltipTriggerProps } from './trigger2.mjs';
|
|
7
|
+
import { whenTrigger } from './utils.mjs';
|
|
8
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
9
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
10
|
+
import { composeEventHandlers } from '../../../utils/dom/event.mjs';
|
|
11
|
+
import ElPopperTrigger from '../../popper/src/trigger2.mjs';
|
|
7
12
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const __default__ = defineComponent({
|
|
14
|
+
name: "ElTooltipTrigger"
|
|
15
|
+
});
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: useTooltipTriggerProps,
|
|
19
|
+
setup(__props, { expose }) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const ns = useNamespace("tooltip");
|
|
22
|
+
const { controlled, id, open, onOpen, onClose, onToggle } = inject(TOOLTIP_INJECTION_KEY, void 0);
|
|
23
|
+
const triggerRef = ref(null);
|
|
24
|
+
const stopWhenControlledOrDisabled = () => {
|
|
25
|
+
if (unref(controlled) || props.disabled) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const trigger = toRef(props, "trigger");
|
|
30
|
+
const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", onOpen));
|
|
31
|
+
const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", onClose));
|
|
32
|
+
const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "click", (e) => {
|
|
33
|
+
if (e.button === 0) {
|
|
34
|
+
onToggle(e);
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onOpen));
|
|
38
|
+
const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onClose));
|
|
39
|
+
const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "contextmenu", (e) => {
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
onToggle(e);
|
|
42
|
+
}));
|
|
43
|
+
const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e) => {
|
|
44
|
+
const { code } = e;
|
|
45
|
+
if (props.triggerKeys.includes(code)) {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
onToggle(e);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
expose({
|
|
51
|
+
triggerRef
|
|
52
|
+
});
|
|
53
|
+
return (_ctx, _cache) => {
|
|
54
|
+
return openBlock(), createBlock(unref(ElPopperTrigger), {
|
|
55
|
+
id: unref(id),
|
|
56
|
+
"virtual-ref": _ctx.virtualRef,
|
|
57
|
+
open: unref(open),
|
|
58
|
+
"virtual-triggering": _ctx.virtualTriggering,
|
|
59
|
+
class: normalizeClass(unref(ns).e("trigger")),
|
|
60
|
+
onBlur: unref(onBlur),
|
|
61
|
+
onClick: unref(onClick),
|
|
62
|
+
onContextmenu: unref(onContextMenu),
|
|
63
|
+
onFocus: unref(onFocus),
|
|
64
|
+
onMouseenter: unref(onMouseenter),
|
|
65
|
+
onMouseleave: unref(onMouseleave),
|
|
66
|
+
onKeydown: unref(onKeydown)
|
|
67
|
+
}, {
|
|
68
|
+
default: withCtx(() => [
|
|
69
|
+
renderSlot(_ctx.$slots, "default")
|
|
70
|
+
]),
|
|
71
|
+
_: 3
|
|
72
|
+
}, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]);
|
|
73
|
+
};
|
|
18
74
|
}
|
|
19
75
|
});
|
|
76
|
+
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "trigger.vue"]]);
|
|
20
77
|
|
|
21
|
-
export {
|
|
78
|
+
export { ElTooltipTrigger as default };
|
|
22
79
|
//# sourceMappingURL=trigger.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.mjs","sources":["../../../../../../packages/components/tooltip/src/trigger.
|
|
1
|
+
{"version":3,"file":"trigger.mjs","sources":["../../../../../../packages/components/tooltip/src/trigger.vue"],"sourcesContent":["<template>\n <el-popper-trigger\n :id=\"id\"\n :virtual-ref=\"virtualRef\"\n :open=\"open\"\n :virtual-triggering=\"virtualTriggering\"\n :class=\"ns.e('trigger')\"\n @blur=\"onBlur\"\n @click=\"onClick\"\n @contextmenu=\"onContextMenu\"\n @focus=\"onFocus\"\n @mouseenter=\"onMouseenter\"\n @mouseleave=\"onMouseleave\"\n @keydown=\"onKeydown\"\n >\n <slot />\n </el-popper-trigger>\n</template>\n<script lang=\"ts\" setup>\nimport { inject, ref, toRef, unref } from 'vue'\nimport { ElPopperTrigger } from '@element-plus/components/popper'\nimport { composeEventHandlers } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { TOOLTIP_INJECTION_KEY } from './constants'\nimport { useTooltipTriggerProps } from './trigger'\nimport { whenTrigger } from './utils'\nimport type { OnlyChildExpose } from '@element-plus/components/slot'\n\ndefineOptions({\n name: 'ElTooltipTrigger',\n})\n\nconst props = defineProps(useTooltipTriggerProps)\n\nconst ns = useNamespace('tooltip')\nconst { controlled, id, open, onOpen, onClose, onToggle } = inject(\n TOOLTIP_INJECTION_KEY,\n undefined\n)!\n\nconst triggerRef = ref<OnlyChildExpose | null>(null)\n\nconst stopWhenControlledOrDisabled = () => {\n if (unref(controlled) || props.disabled) {\n return true\n }\n}\nconst trigger = toRef(props, 'trigger')\nconst onMouseenter = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'hover', onOpen)\n)\nconst onMouseleave = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'hover', onClose)\n)\nconst onClick = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'click', (e) => {\n // distinguish left click\n if ((e as MouseEvent).button === 0) {\n onToggle(e)\n }\n })\n)\n\nconst onFocus = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'focus', onOpen)\n)\n\nconst onBlur = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'focus', onClose)\n)\n\nconst onContextMenu = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'contextmenu', (e: Event) => {\n e.preventDefault()\n onToggle(e)\n })\n)\n\nconst onKeydown = composeEventHandlers(\n stopWhenControlledOrDisabled,\n (e: KeyboardEvent) => {\n const { code } = e\n if (props.triggerKeys.includes(code)) {\n e.preventDefault()\n onToggle(e)\n }\n }\n)\n\ndefineExpose({\n /**\n * @description trigger element\n */\n triggerRef,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;mCA4Bc,CAAA;AAAA,EACZ,IAAM,EAAA,kBAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,SAAS,CAAA,CAAA;AACjC,IAAM,MAAA,EAAE,YAAY,EAAI,EAAA,IAAA,EAAM,QAAQ,OAAS,EAAA,QAAA,EAAA,GAAa,MAC1D,CAAA,qBAAA,EACA,KACF,CAAA,CAAA,CAAA;AAEA,IAAM,MAAA,UAAA,GAAa,IAA4B,IAAI,CAAA,CAAA;AAEnD,IAAA,MAAM,+BAA+B,MAAM;AACzC,MAAA,IAAI,KAAM,CAAA,UAAU,CAAK,IAAA,KAAA,CAAM,QAAU,EAAA;AACvC,QAAO,OAAA,IAAA,CAAA;AAAA,OACT;AAAA,KACF,CAAA;AACA,IAAM,MAAA,OAAA,GAAU,KAAM,CAAA,KAAA,EAAO,SAAS,CAAA,CAAA;AACtC,IAAA,MAAM,eAAe,oBACnB,CAAA,4BAAA,EACA,YAAY,OAAS,EAAA,OAAA,EAAS,MAAM,CACtC,CAAA,CAAA;AACA,IAAA,MAAM,eAAe,oBACnB,CAAA,4BAAA,EACA,YAAY,OAAS,EAAA,OAAA,EAAS,OAAO,CACvC,CAAA,CAAA;AACA,IAAA,MAAM,UAAU,oBACd,CAAA,4BAAA,EACA,YAAY,OAAS,EAAA,OAAA,EAAS,CAAC,CAAM,KAAA;AAEnC,MAAK,IAAA,CAAA,CAAiB,WAAW,CAAG,EAAA;AAClC,QAAA,QAAA,CAAS,CAAC,CAAA,CAAA;AAAA,OACZ;AAAA,KACD,CACH,CAAA,CAAA;AAEA,IAAA,MAAM,UAAU,oBACd,CAAA,4BAAA,EACA,YAAY,OAAS,EAAA,OAAA,EAAS,MAAM,CACtC,CAAA,CAAA;AAEA,IAAA,MAAM,SAAS,oBACb,CAAA,4BAAA,EACA,YAAY,OAAS,EAAA,OAAA,EAAS,OAAO,CACvC,CAAA,CAAA;AAEA,IAAA,MAAM,gBAAgB,oBACpB,CAAA,4BAAA,EACA,YAAY,OAAS,EAAA,aAAA,EAAe,CAAC,CAAa,KAAA;AAChD,MAAA,CAAA,CAAE,cAAe,EAAA,CAAA;AACjB,MAAA,QAAA,CAAS,CAAC,CAAA,CAAA;AAAA,KACX,CACH,CAAA,CAAA;AAEA,IAAA,MAAM,SAAY,GAAA,oBAAA,CAChB,4BACA,EAAA,CAAC,CAAqB,KAAA;AACpB,MAAA,MAAM,EAAE,IAAS,EAAA,GAAA,CAAA,CAAA;AACjB,MAAA,IAAI,KAAM,CAAA,WAAA,CAAY,QAAS,CAAA,IAAI,CAAG,EAAA;AACpC,QAAA,CAAA,CAAE,cAAe,EAAA,CAAA;AACjB,QAAA,QAAA,CAAS,CAAC,CAAA,CAAA;AAAA,OACZ;AAAA,KAEJ,CAAA,CAAA;AAEA,IAAa,MAAA,CAAA;AAAA,MAIX,UAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|