@element-plus/nightly 0.0.20240507 → 0.0.20240508
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/autocomplete/src/autocomplete.mjs +1 -1
- package/es/components/cascader/src/cascader.mjs +1 -1
- package/es/components/color-picker/index.mjs +2 -2
- package/es/components/color-picker/src/color-picker.mjs +412 -46
- package/es/components/color-picker/src/color-picker.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker2.mjs +46 -412
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/color-picker/src/components/predefine.mjs +1 -1
- package/es/components/dropdown/index.mjs +2 -2
- package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
- package/es/components/dropdown/src/dropdown-item.mjs +1 -1
- package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +306 -97
- package/es/components/dropdown/src/dropdown.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown2.mjs +97 -306
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/index.mjs +6 -6
- package/es/components/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +110 -47
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +47 -110
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/popover/src/popover.mjs +2 -2
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-group.mjs +77 -39
- package/es/components/radio/src/radio-group.mjs.map +1 -1
- package/es/components/radio/src/radio-group2.mjs +39 -77
- package/es/components/radio/src/radio-group2.mjs.map +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/slider/src/button.mjs +21 -93
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +93 -21
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +1 -1
- package/es/components/timeline/index.mjs +2 -2
- package/es/components/timeline/src/timeline-item.mjs +72 -42
- package/es/components/timeline/src/timeline-item.mjs.map +1 -1
- package/es/components/timeline/src/timeline-item2.mjs +42 -72
- package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +1 -1
- package/es/components/tooltip/src/content.mjs +177 -32
- package/es/components/tooltip/src/content.mjs.map +1 -1
- package/es/components/tooltip/src/content2.mjs +32 -177
- package/es/components/tooltip/src/content2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +3 -3
- package/es/components/tooltip-v2/src/content2.mjs +1 -1
- package/es/components/tooltip-v2/src/root.mjs +17 -80
- package/es/components/tooltip-v2/src/root.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root2.mjs +80 -17
- package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +20 -73
- package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +73 -20
- package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
- package/es/components/visual-hidden/index.mjs +3 -3
- package/es/components/visual-hidden/src/visual-hidden.mjs +7 -35
- package/es/components/visual-hidden/src/visual-hidden.mjs.map +1 -1
- package/es/components/visual-hidden/src/visual-hidden2.mjs +35 -7
- package/es/components/visual-hidden/src/visual-hidden2.mjs.map +1 -1
- package/es/index.mjs +6 -6
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.js +1 -1
- package/lib/components/cascader/src/cascader.js +1 -1
- package/lib/components/color-picker/index.js +2 -2
- package/lib/components/color-picker/src/color-picker.js +410 -46
- package/lib/components/color-picker/src/color-picker.js.map +1 -1
- package/lib/components/color-picker/src/color-picker2.js +46 -410
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/color-picker/src/components/predefine.js +1 -1
- package/lib/components/dropdown/index.js +2 -2
- package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
- package/lib/components/dropdown/src/dropdown-item.js +1 -1
- package/lib/components/dropdown/src/dropdown-menu.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +306 -106
- package/lib/components/dropdown/src/dropdown.js.map +1 -1
- package/lib/components/dropdown/src/dropdown2.js +106 -306
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/index.js +6 -6
- package/lib/components/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +110 -48
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +48 -110
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/popover/src/popover.js +2 -2
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-group.js +77 -40
- package/lib/components/radio/src/radio-group.js.map +1 -1
- package/lib/components/radio/src/radio-group2.js +40 -77
- package/lib/components/radio/src/radio-group2.js.map +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/slider/src/button.js +22 -93
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +93 -22
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider2.js +1 -1
- package/lib/components/timeline/index.js +2 -2
- package/lib/components/timeline/src/timeline-item.js +72 -42
- package/lib/components/timeline/src/timeline-item.js.map +1 -1
- package/lib/components/timeline/src/timeline-item2.js +42 -72
- package/lib/components/timeline/src/timeline-item2.js.map +1 -1
- package/lib/components/tooltip/index.js +1 -1
- package/lib/components/tooltip/src/content.js +177 -32
- package/lib/components/tooltip/src/content.js.map +1 -1
- package/lib/components/tooltip/src/content2.js +32 -177
- package/lib/components/tooltip/src/content2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/tooltip-v2/index.js +3 -3
- package/lib/components/tooltip-v2/src/content2.js +1 -1
- package/lib/components/tooltip-v2/src/root.js +17 -80
- package/lib/components/tooltip-v2/src/root.js.map +1 -1
- package/lib/components/tooltip-v2/src/root2.js +80 -17
- package/lib/components/tooltip-v2/src/root2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +20 -73
- package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +73 -20
- package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
- package/lib/components/visual-hidden/index.js +2 -2
- package/lib/components/visual-hidden/src/visual-hidden.js +7 -35
- package/lib/components/visual-hidden/src/visual-hidden.js.map +1 -1
- package/lib/components/visual-hidden/src/visual-hidden2.js +35 -7
- package/lib/components/visual-hidden/src/visual-hidden2.js.map +1 -1
- package/lib/index.js +6 -6
- 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
|
@@ -2,186 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var core = require('@vueuse/core');
|
|
7
|
-
require('../../../hooks/index.js');
|
|
8
5
|
require('../../../utils/index.js');
|
|
9
6
|
require('../../popper/index.js');
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var index$1 = require('../../../hooks/use-
|
|
15
|
-
var event = require('../../../utils/dom/event.js');
|
|
16
|
-
var content$1 = require('../../popper/src/content2.js');
|
|
7
|
+
require('../../../hooks/index.js');
|
|
8
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
9
|
+
var index = require('../../../hooks/use-delayed-toggle/index.js');
|
|
10
|
+
var content = require('../../popper/src/content.js');
|
|
11
|
+
var index$1 = require('../../../hooks/use-aria/index.js');
|
|
17
12
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return props.transition || `${ns.namespace.value}-fade-in-linear`;
|
|
45
|
-
});
|
|
46
|
-
const persistentRef = vue.computed(() => {
|
|
47
|
-
if (process.env.NODE_ENV === "test") {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
return props.persistent;
|
|
51
|
-
});
|
|
52
|
-
vue.onBeforeUnmount(() => {
|
|
53
|
-
destroyed.value = true;
|
|
54
|
-
});
|
|
55
|
-
const shouldRender = vue.computed(() => {
|
|
56
|
-
return vue.unref(persistentRef) ? true : vue.unref(open);
|
|
57
|
-
});
|
|
58
|
-
const shouldShow = vue.computed(() => {
|
|
59
|
-
return props.disabled ? false : vue.unref(open);
|
|
60
|
-
});
|
|
61
|
-
const appendTo = vue.computed(() => {
|
|
62
|
-
return props.appendTo || selector.value;
|
|
63
|
-
});
|
|
64
|
-
const contentStyle = vue.computed(() => {
|
|
65
|
-
var _a;
|
|
66
|
-
return (_a = props.style) != null ? _a : {};
|
|
67
|
-
});
|
|
68
|
-
const ariaHidden = vue.computed(() => !vue.unref(open));
|
|
69
|
-
const onTransitionLeave = () => {
|
|
70
|
-
onHide();
|
|
71
|
-
};
|
|
72
|
-
const stopWhenControlled = () => {
|
|
73
|
-
if (vue.unref(controlled))
|
|
74
|
-
return true;
|
|
75
|
-
};
|
|
76
|
-
const onContentEnter = event.composeEventHandlers(stopWhenControlled, () => {
|
|
77
|
-
if (props.enterable && vue.unref(trigger) === "hover") {
|
|
78
|
-
onOpen();
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
const onContentLeave = event.composeEventHandlers(stopWhenControlled, () => {
|
|
82
|
-
if (vue.unref(trigger) === "hover") {
|
|
83
|
-
onClose();
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
const onBeforeEnter = () => {
|
|
87
|
-
var _a, _b;
|
|
88
|
-
(_b = (_a = contentRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
|
|
89
|
-
onBeforeShow == null ? void 0 : onBeforeShow();
|
|
90
|
-
};
|
|
91
|
-
const onBeforeLeave = () => {
|
|
92
|
-
onBeforeHide == null ? void 0 : onBeforeHide();
|
|
93
|
-
};
|
|
94
|
-
const onAfterShow = () => {
|
|
95
|
-
onShow();
|
|
96
|
-
stopHandle = core.onClickOutside(vue.computed(() => {
|
|
97
|
-
var _a;
|
|
98
|
-
return (_a = contentRef.value) == null ? void 0 : _a.popperContentRef;
|
|
99
|
-
}), () => {
|
|
100
|
-
if (vue.unref(controlled))
|
|
101
|
-
return;
|
|
102
|
-
const $trigger = vue.unref(trigger);
|
|
103
|
-
if ($trigger !== "hover") {
|
|
104
|
-
onClose();
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
|
-
const onBlur = () => {
|
|
109
|
-
if (!props.virtualTriggering) {
|
|
110
|
-
onClose();
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
let stopHandle;
|
|
114
|
-
vue.watch(() => vue.unref(open), (val) => {
|
|
115
|
-
if (!val) {
|
|
116
|
-
stopHandle == null ? void 0 : stopHandle();
|
|
117
|
-
}
|
|
118
|
-
}, {
|
|
119
|
-
flush: "post"
|
|
120
|
-
});
|
|
121
|
-
vue.watch(() => props.content, () => {
|
|
122
|
-
var _a, _b;
|
|
123
|
-
(_b = (_a = contentRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
|
|
124
|
-
});
|
|
125
|
-
expose({
|
|
126
|
-
contentRef
|
|
127
|
-
});
|
|
128
|
-
return (_ctx, _cache) => {
|
|
129
|
-
return vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
130
|
-
disabled: !_ctx.teleported,
|
|
131
|
-
to: vue.unref(appendTo)
|
|
132
|
-
}, [
|
|
133
|
-
vue.createVNode(vue.Transition, {
|
|
134
|
-
name: vue.unref(transitionClass),
|
|
135
|
-
onAfterLeave: onTransitionLeave,
|
|
136
|
-
onBeforeEnter,
|
|
137
|
-
onAfterEnter: onAfterShow,
|
|
138
|
-
onBeforeLeave
|
|
139
|
-
}, {
|
|
140
|
-
default: vue.withCtx(() => [
|
|
141
|
-
vue.unref(shouldRender) ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(content$1["default"]), vue.mergeProps({
|
|
142
|
-
key: 0,
|
|
143
|
-
id: vue.unref(id),
|
|
144
|
-
ref_key: "contentRef",
|
|
145
|
-
ref: contentRef
|
|
146
|
-
}, _ctx.$attrs, {
|
|
147
|
-
"aria-label": _ctx.ariaLabel,
|
|
148
|
-
"aria-hidden": vue.unref(ariaHidden),
|
|
149
|
-
"boundaries-padding": _ctx.boundariesPadding,
|
|
150
|
-
"fallback-placements": _ctx.fallbackPlacements,
|
|
151
|
-
"gpu-acceleration": _ctx.gpuAcceleration,
|
|
152
|
-
offset: _ctx.offset,
|
|
153
|
-
placement: _ctx.placement,
|
|
154
|
-
"popper-options": _ctx.popperOptions,
|
|
155
|
-
strategy: _ctx.strategy,
|
|
156
|
-
effect: _ctx.effect,
|
|
157
|
-
enterable: _ctx.enterable,
|
|
158
|
-
pure: _ctx.pure,
|
|
159
|
-
"popper-class": _ctx.popperClass,
|
|
160
|
-
"popper-style": [_ctx.popperStyle, vue.unref(contentStyle)],
|
|
161
|
-
"reference-el": _ctx.referenceEl,
|
|
162
|
-
"trigger-target-el": _ctx.triggerTargetEl,
|
|
163
|
-
visible: vue.unref(shouldShow),
|
|
164
|
-
"z-index": _ctx.zIndex,
|
|
165
|
-
onMouseenter: vue.unref(onContentEnter),
|
|
166
|
-
onMouseleave: vue.unref(onContentLeave),
|
|
167
|
-
onBlur,
|
|
168
|
-
onClose: vue.unref(onClose)
|
|
169
|
-
}), {
|
|
170
|
-
default: vue.withCtx(() => [
|
|
171
|
-
!destroyed.value ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : vue.createCommentVNode("v-if", true)
|
|
172
|
-
]),
|
|
173
|
-
_: 3
|
|
174
|
-
}, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [
|
|
175
|
-
[vue.vShow, vue.unref(shouldShow)]
|
|
176
|
-
]) : vue.createCommentVNode("v-if", true)
|
|
177
|
-
]),
|
|
178
|
-
_: 3
|
|
179
|
-
}, 8, ["name"])
|
|
180
|
-
], 8, ["disabled", "to"]);
|
|
181
|
-
};
|
|
182
|
-
}
|
|
13
|
+
const useTooltipContentProps = runtime.buildProps({
|
|
14
|
+
...index.useDelayedToggleProps,
|
|
15
|
+
...content.popperContentProps,
|
|
16
|
+
appendTo: {
|
|
17
|
+
type: runtime.definePropType([String, Object])
|
|
18
|
+
},
|
|
19
|
+
content: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
23
|
+
rawContent: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
persistent: Boolean,
|
|
28
|
+
visible: {
|
|
29
|
+
type: runtime.definePropType(Boolean),
|
|
30
|
+
default: null
|
|
31
|
+
},
|
|
32
|
+
transition: String,
|
|
33
|
+
teleported: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
},
|
|
37
|
+
disabled: Boolean,
|
|
38
|
+
...index$1.useAriaProps(["ariaLabel"])
|
|
183
39
|
});
|
|
184
|
-
var ElTooltipContent = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "content.vue"]]);
|
|
185
40
|
|
|
186
|
-
exports
|
|
41
|
+
exports.useTooltipContentProps = useTooltipContentProps;
|
|
187
42
|
//# sourceMappingURL=content2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content2.js","sources":["../../../../../../packages/components/tooltip/src/content.
|
|
1
|
+
{"version":3,"file":"content2.js","sources":["../../../../../../packages/components/tooltip/src/content.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport { popperContentProps } from '@element-plus/components/popper'\nimport { useAriaProps, useDelayedToggleProps } from '@element-plus/hooks'\n\nimport type TooltipContent from './content.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const useTooltipContentProps = buildProps({\n ...useDelayedToggleProps,\n ...popperContentProps,\n /**\n * @description which element the tooltip CONTENT appends to\n */\n appendTo: {\n type: definePropType<string | HTMLElement>([String, Object]),\n },\n /**\n * @description display content, can be overridden by `slot#content`\n */\n content: {\n type: String,\n default: '',\n },\n /**\n * @description whether `content` is treated as HTML string\n */\n rawContent: {\n type: Boolean,\n default: false,\n },\n /**\n * @description when tooltip inactive and `persistent` is `false` , popconfirm will be destroyed\n */\n persistent: Boolean,\n // because model toggle prop is generated dynamically\n // so the typing cannot be evaluated by typescript as type:\n // [name]: { type: Boolean, default: null }\n // so we need to declare that again for type checking.\n /**\n * @description visibility of Tooltip\n */\n visible: {\n type: definePropType<boolean | null>(Boolean),\n default: null,\n },\n /**\n * @description animation name\n */\n transition: String,\n /**\n * @description whether tooltip content is teleported, if `true` it will be teleported to where `append-to` sets\n */\n teleported: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether Tooltip is disabled\n */\n disabled: Boolean,\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport type ElTooltipContentProps = ExtractPropTypes<\n typeof useTooltipContentProps\n>\n\nexport type TooltipContentInstance = InstanceType<typeof TooltipContent>\n"],"names":["buildProps","useDelayedToggleProps","popperContentProps","definePropType","useAriaProps"],"mappings":";;;;;;;;;;;;AAGY,MAAC,sBAAsB,GAAGA,kBAAU,CAAC;AACjD,EAAE,GAAGC,2BAAqB;AAC1B,EAAE,GAAGC,0BAAkB;AACvB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,UAAU,EAAE,OAAO;AACrB,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEA,sBAAc,CAAC,OAAO,CAAC;AACjC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,GAAGC,oBAAY,CAAC,CAAC,WAAW,CAAC,CAAC;AAChC,CAAC;;;;"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
require('../../../utils/index.js');
|
|
6
6
|
require('../../../hooks/index.js');
|
|
7
7
|
require('../../popper/index.js');
|
|
8
|
-
var content = require('./
|
|
8
|
+
var content = require('./content2.js');
|
|
9
9
|
var trigger = require('./trigger.js');
|
|
10
10
|
var index = require('../../../hooks/use-model-toggle/index.js');
|
|
11
11
|
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
@@ -9,7 +9,7 @@ require('../../../hooks/index.js');
|
|
|
9
9
|
var constants = require('./constants.js');
|
|
10
10
|
var tooltip = require('./tooltip.js');
|
|
11
11
|
var trigger = require('./trigger2.js');
|
|
12
|
-
var content = require('./
|
|
12
|
+
var content = require('./content.js');
|
|
13
13
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
14
14
|
var index = require('../../../hooks/use-popper-container/index.js');
|
|
15
15
|
var index$1 = require('../../../hooks/use-id/index.js');
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var tooltip$1 = require('./src/
|
|
6
|
+
var tooltip$1 = require('./src/tooltip2.js');
|
|
7
7
|
var arrow = require('./src/arrow.js');
|
|
8
8
|
var content = require('./src/content.js');
|
|
9
|
-
var root = require('./src/
|
|
10
|
-
var tooltip = require('./src/
|
|
9
|
+
var root = require('./src/root.js');
|
|
10
|
+
var tooltip = require('./src/tooltip.js');
|
|
11
11
|
var trigger = require('./src/trigger.js');
|
|
12
12
|
var constants = require('./src/constants.js');
|
|
13
13
|
var install = require('../../utils/vue/install.js');
|
|
@@ -13,7 +13,7 @@ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper
|
|
|
13
13
|
var index = require('../../../hooks/use-floating/index.js');
|
|
14
14
|
var index$1 = require('../../../hooks/use-z-index/index.js');
|
|
15
15
|
var index$2 = require('../../../hooks/use-namespace/index.js');
|
|
16
|
-
var visualHidden = require('../../visual-hidden/src/visual-
|
|
16
|
+
var visualHidden = require('../../visual-hidden/src/visual-hidden2.js');
|
|
17
17
|
|
|
18
18
|
const _hoisted_1 = ["data-side"];
|
|
19
19
|
const __default__ = vue.defineComponent({
|
|
@@ -2,89 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var core = require('@vueuse/core');
|
|
7
|
-
require('../../../hooks/index.js');
|
|
8
5
|
require('../../../utils/index.js');
|
|
9
|
-
var
|
|
10
|
-
var root = require('./root2.js');
|
|
11
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
-
var types = require('../../../utils/types.js');
|
|
13
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
14
|
-
var index$1 = require('../../../hooks/use-id/index.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
15
7
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
(_a = props["onUpdate:open"]) == null ? void 0 : _a.call(props, open2);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
const isOpenDelayed = vue.computed(() => types.isNumber(props.delayDuration) && props.delayDuration > 0);
|
|
35
|
-
const { start: onDelayedOpen, stop: clearTimer } = core.useTimeoutFn(() => {
|
|
36
|
-
open.value = true;
|
|
37
|
-
}, vue.computed(() => props.delayDuration), {
|
|
38
|
-
immediate: false
|
|
39
|
-
});
|
|
40
|
-
const ns = index.useNamespace("tooltip-v2");
|
|
41
|
-
const contentId = index$1.useId();
|
|
42
|
-
const onNormalOpen = () => {
|
|
43
|
-
clearTimer();
|
|
44
|
-
open.value = true;
|
|
45
|
-
};
|
|
46
|
-
const onDelayOpen = () => {
|
|
47
|
-
vue.unref(isOpenDelayed) ? onDelayedOpen() : onNormalOpen();
|
|
48
|
-
};
|
|
49
|
-
const onOpen = onNormalOpen;
|
|
50
|
-
const onClose = () => {
|
|
51
|
-
clearTimer();
|
|
52
|
-
open.value = false;
|
|
53
|
-
};
|
|
54
|
-
const onChange = (open2) => {
|
|
55
|
-
var _a;
|
|
56
|
-
if (open2) {
|
|
57
|
-
document.dispatchEvent(new CustomEvent(constants.TOOLTIP_V2_OPEN));
|
|
58
|
-
onOpen();
|
|
59
|
-
}
|
|
60
|
-
(_a = props.onOpenChange) == null ? void 0 : _a.call(props, open2);
|
|
61
|
-
};
|
|
62
|
-
vue.watch(open, onChange);
|
|
63
|
-
vue.onMounted(() => {
|
|
64
|
-
document.addEventListener(constants.TOOLTIP_V2_OPEN, onClose);
|
|
65
|
-
});
|
|
66
|
-
vue.onBeforeUnmount(() => {
|
|
67
|
-
clearTimer();
|
|
68
|
-
document.removeEventListener(constants.TOOLTIP_V2_OPEN, onClose);
|
|
69
|
-
});
|
|
70
|
-
vue.provide(constants.tooltipV2RootKey, {
|
|
71
|
-
contentId,
|
|
72
|
-
triggerRef,
|
|
73
|
-
ns,
|
|
74
|
-
onClose,
|
|
75
|
-
onDelayOpen,
|
|
76
|
-
onOpen
|
|
77
|
-
});
|
|
78
|
-
expose({
|
|
79
|
-
onOpen,
|
|
80
|
-
onClose
|
|
81
|
-
});
|
|
82
|
-
return (_ctx, _cache) => {
|
|
83
|
-
return vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open) });
|
|
84
|
-
};
|
|
8
|
+
const tooltipV2RootProps = runtime.buildProps({
|
|
9
|
+
delayDuration: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 300
|
|
12
|
+
},
|
|
13
|
+
defaultOpen: Boolean,
|
|
14
|
+
open: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
onOpenChange: {
|
|
19
|
+
type: runtime.definePropType(Function)
|
|
20
|
+
},
|
|
21
|
+
"onUpdate:open": {
|
|
22
|
+
type: runtime.definePropType(Function)
|
|
85
23
|
}
|
|
86
24
|
});
|
|
87
|
-
var TooltipV2Root = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "root.vue"]]);
|
|
88
25
|
|
|
89
|
-
exports
|
|
26
|
+
exports.tooltipV2RootProps = tooltipV2RootProps;
|
|
90
27
|
//# sourceMappingURL=root.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.js","sources":["../../../../../../packages/components/tooltip-v2/src/root.
|
|
1
|
+
{"version":3,"file":"root.js","sources":["../../../../../../packages/components/tooltip-v2/src/root.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\n\ntype StateUpdater = (state: boolean) => void\n\nexport const tooltipV2RootProps = buildProps({\n delayDuration: {\n type: Number,\n default: 300,\n },\n defaultOpen: Boolean,\n open: {\n type: Boolean,\n default: undefined,\n },\n onOpenChange: {\n type: definePropType<StateUpdater>(Function),\n },\n 'onUpdate:open': {\n type: definePropType<StateUpdater>(Function),\n },\n} as const)\n\nexport type TooltipV2RootProps = ExtractPropTypes<typeof tooltipV2RootProps>\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;;AACY,MAAC,kBAAkB,GAAGA,kBAAU,CAAC;AAC7C,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,WAAW,EAAE,OAAO;AACtB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAEC,sBAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAEA,sBAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,CAAC;;;;"}
|
|
@@ -2,26 +2,89 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var core = require('@vueuse/core');
|
|
7
|
+
require('../../../hooks/index.js');
|
|
5
8
|
require('../../../utils/index.js');
|
|
6
|
-
var
|
|
9
|
+
var constants = require('./constants.js');
|
|
10
|
+
var root = require('./root.js');
|
|
11
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
+
var types = require('../../../utils/types.js');
|
|
13
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
14
|
+
var index$1 = require('../../../hooks/use-id/index.js');
|
|
7
15
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
const __default__ = vue.defineComponent({
|
|
17
|
+
name: "ElTooltipV2Root"
|
|
18
|
+
});
|
|
19
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
20
|
+
...__default__,
|
|
21
|
+
props: root.tooltipV2RootProps,
|
|
22
|
+
setup(__props, { expose }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const _open = vue.ref(props.defaultOpen);
|
|
25
|
+
const triggerRef = vue.ref(null);
|
|
26
|
+
const open = vue.computed({
|
|
27
|
+
get: () => types.isPropAbsent(props.open) ? _open.value : props.open,
|
|
28
|
+
set: (open2) => {
|
|
29
|
+
var _a;
|
|
30
|
+
_open.value = open2;
|
|
31
|
+
(_a = props["onUpdate:open"]) == null ? void 0 : _a.call(props, open2);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const isOpenDelayed = vue.computed(() => types.isNumber(props.delayDuration) && props.delayDuration > 0);
|
|
35
|
+
const { start: onDelayedOpen, stop: clearTimer } = core.useTimeoutFn(() => {
|
|
36
|
+
open.value = true;
|
|
37
|
+
}, vue.computed(() => props.delayDuration), {
|
|
38
|
+
immediate: false
|
|
39
|
+
});
|
|
40
|
+
const ns = index.useNamespace("tooltip-v2");
|
|
41
|
+
const contentId = index$1.useId();
|
|
42
|
+
const onNormalOpen = () => {
|
|
43
|
+
clearTimer();
|
|
44
|
+
open.value = true;
|
|
45
|
+
};
|
|
46
|
+
const onDelayOpen = () => {
|
|
47
|
+
vue.unref(isOpenDelayed) ? onDelayedOpen() : onNormalOpen();
|
|
48
|
+
};
|
|
49
|
+
const onOpen = onNormalOpen;
|
|
50
|
+
const onClose = () => {
|
|
51
|
+
clearTimer();
|
|
52
|
+
open.value = false;
|
|
53
|
+
};
|
|
54
|
+
const onChange = (open2) => {
|
|
55
|
+
var _a;
|
|
56
|
+
if (open2) {
|
|
57
|
+
document.dispatchEvent(new CustomEvent(constants.TOOLTIP_V2_OPEN));
|
|
58
|
+
onOpen();
|
|
59
|
+
}
|
|
60
|
+
(_a = props.onOpenChange) == null ? void 0 : _a.call(props, open2);
|
|
61
|
+
};
|
|
62
|
+
vue.watch(open, onChange);
|
|
63
|
+
vue.onMounted(() => {
|
|
64
|
+
document.addEventListener(constants.TOOLTIP_V2_OPEN, onClose);
|
|
65
|
+
});
|
|
66
|
+
vue.onBeforeUnmount(() => {
|
|
67
|
+
clearTimer();
|
|
68
|
+
document.removeEventListener(constants.TOOLTIP_V2_OPEN, onClose);
|
|
69
|
+
});
|
|
70
|
+
vue.provide(constants.tooltipV2RootKey, {
|
|
71
|
+
contentId,
|
|
72
|
+
triggerRef,
|
|
73
|
+
ns,
|
|
74
|
+
onClose,
|
|
75
|
+
onDelayOpen,
|
|
76
|
+
onOpen
|
|
77
|
+
});
|
|
78
|
+
expose({
|
|
79
|
+
onOpen,
|
|
80
|
+
onClose
|
|
81
|
+
});
|
|
82
|
+
return (_ctx, _cache) => {
|
|
83
|
+
return vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open) });
|
|
84
|
+
};
|
|
23
85
|
}
|
|
24
86
|
});
|
|
87
|
+
var TooltipV2Root = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "root.vue"]]);
|
|
25
88
|
|
|
26
|
-
exports
|
|
89
|
+
exports["default"] = TooltipV2Root;
|
|
27
90
|
//# sourceMappingURL=root2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root2.js","sources":["../../../../../../packages/components/tooltip-v2/src/root.
|
|
1
|
+
{"version":3,"file":"root2.js","sources":["../../../../../../packages/components/tooltip-v2/src/root.vue"],"sourcesContent":["<template>\n <slot :open=\"open\" />\n</template>\n\n<script setup lang=\"ts\">\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n unref,\n watch,\n} from 'vue'\nimport { useTimeoutFn } from '@vueuse/core'\nimport { useId, useNamespace } from '@element-plus/hooks'\nimport { isNumber, isPropAbsent } from '@element-plus/utils'\nimport { TOOLTIP_V2_OPEN, tooltipV2RootKey } from './constants'\nimport { tooltipV2RootProps } from './root'\n\ndefineOptions({\n name: 'ElTooltipV2Root',\n})\n\nconst props = defineProps(tooltipV2RootProps)\n\n/**\n * internal open state, when no model value was provided, use this as indicator instead\n */\nconst _open = ref(props.defaultOpen)\nconst triggerRef = ref<HTMLElement | null>(null)\n\nconst open = computed<boolean>({\n get: () => (isPropAbsent(props.open) ? _open.value : props.open),\n set: (open) => {\n _open.value = open\n props['onUpdate:open']?.(open)\n },\n})\n\nconst isOpenDelayed = computed(\n () => isNumber(props.delayDuration) && props.delayDuration > 0\n)\n\nconst { start: onDelayedOpen, stop: clearTimer } = useTimeoutFn(\n () => {\n open.value = true\n },\n computed(() => props.delayDuration),\n {\n immediate: false,\n }\n)\n\nconst ns = useNamespace('tooltip-v2')\n\nconst contentId = useId()\n\nconst onNormalOpen = () => {\n clearTimer()\n open.value = true\n}\n\nconst onDelayOpen = () => {\n unref(isOpenDelayed) ? onDelayedOpen() : onNormalOpen()\n}\n\nconst onOpen = onNormalOpen\n\nconst onClose = () => {\n clearTimer()\n open.value = false\n}\n\nconst onChange = (open: boolean) => {\n if (open) {\n document.dispatchEvent(new CustomEvent(TOOLTIP_V2_OPEN))\n onOpen()\n }\n\n props.onOpenChange?.(open)\n}\n\nwatch(open, onChange)\n\nonMounted(() => {\n // Keeps only 1 tooltip open at a time\n document.addEventListener(TOOLTIP_V2_OPEN, onClose)\n})\n\nonBeforeUnmount(() => {\n clearTimer()\n document.removeEventListener(TOOLTIP_V2_OPEN, onClose)\n})\n\nprovide(tooltipV2RootKey, {\n contentId,\n triggerRef,\n ns,\n\n onClose,\n onDelayOpen,\n onOpen,\n})\n\ndefineExpose({\n /**\n * @description open tooltip programmatically\n */\n onOpen,\n\n /**\n * @description close tooltip programmatically\n */\n onClose,\n})\n</script>\n"],"names":["ref","computed","isPropAbsent","isNumber","useTimeoutFn","unref","TOOLTIP_V2_OPEN","watch","onMounted","onBeforeUnmount","provide","tooltipV2RootKey"],"mappings":"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"}
|