@element-plus/nightly 0.0.20240328 → 0.0.20240329
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.full.js +44 -16
- package/dist/index.full.min.js +10 -10
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +10 -10
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +44 -16
- 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/badge/index.d.ts +3 -0
- package/es/components/badge/src/badge.d.ts +1 -0
- package/es/components/badge/src/badge.mjs +2 -1
- package/es/components/badge/src/badge.mjs.map +1 -1
- package/es/components/badge/src/badge.vue.d.ts +3 -0
- package/es/components/badge/src/badge2.mjs +3 -2
- package/es/components/badge/src/badge2.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-range.mjs +2 -0
- package/es/components/date-picker/src/date-picker-com/panel-date-range.mjs.map +1 -1
- package/es/components/index.mjs +2 -2
- package/es/components/input-number/src/input-number2.mjs +17 -13
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/message/src/message.vue.d.ts +3 -0
- package/es/components/notification/index.mjs +1 -1
- package/es/components/notification/src/notification.mjs +149 -67
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification2.mjs +67 -149
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +2 -2
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/popper.mjs +25 -32
- package/es/components/popper/src/popper.mjs.map +1 -1
- package/es/components/popper/src/popper2.mjs +32 -25
- package/es/components/popper/src/popper2.mjs.map +1 -1
- package/es/components/scrollbar/src/bar.mjs +64 -11
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar2.mjs +11 -64
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +2 -2
- package/es/components/tooltip-v2/src/arrow.mjs +22 -37
- package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
- package/es/components/tooltip-v2/src/arrow2.mjs +37 -22
- package/es/components/tooltip-v2/src/arrow2.mjs.map +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 +2 -2
- package/es/components/tooltip-v2/src/tooltip2.mjs +4 -4
- package/es/components/tour/src/content.mjs +44 -69
- package/es/components/tour/src/content.mjs.map +1 -1
- package/es/components/tour/src/content2.mjs +69 -44
- package/es/components/tour/src/content2.mjs.map +1 -1
- package/es/components/tour/src/step.mjs +1 -1
- package/es/components/tour/src/tour.mjs +1 -1
- package/es/components/tour/src/tour2.mjs +1 -1
- package/es/components/tree/index.d.ts +16 -0
- package/es/components/tree/src/model/node.d.ts +2 -0
- package/es/components/tree/src/model/node.mjs +13 -0
- package/es/components/tree/src/model/node.mjs.map +1 -1
- package/es/components/tree/src/model/useDragNode.mjs +6 -0
- package/es/components/tree/src/model/useDragNode.mjs.map +1 -1
- package/es/components/tree/src/tree-node.mjs +1 -0
- package/es/components/tree/src/tree-node.mjs.map +1 -1
- package/es/components/tree/src/tree.vue.d.ts +8 -0
- 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/badge/index.d.ts +3 -0
- package/lib/components/badge/src/badge.d.ts +1 -0
- package/lib/components/badge/src/badge.js +2 -1
- package/lib/components/badge/src/badge.js.map +1 -1
- package/lib/components/badge/src/badge.vue.d.ts +3 -0
- package/lib/components/badge/src/badge2.js +2 -1
- package/lib/components/badge/src/badge2.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.js +2 -0
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.js.map +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/input-number/src/input-number2.js +16 -12
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/message/src/message.vue.d.ts +3 -0
- package/lib/components/notification/index.js +1 -1
- package/lib/components/notification/src/notification.js +148 -68
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification2.js +68 -148
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +2 -2
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/popper.js +28 -32
- package/lib/components/popper/src/popper.js.map +1 -1
- package/lib/components/popper/src/popper2.js +32 -28
- package/lib/components/popper/src/popper2.js.map +1 -1
- package/lib/components/scrollbar/src/bar.js +64 -11
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar2.js +11 -64
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip-v2/index.js +2 -2
- package/lib/components/tooltip-v2/src/arrow.js +23 -37
- package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
- package/lib/components/tooltip-v2/src/arrow2.js +37 -23
- package/lib/components/tooltip-v2/src/arrow2.js.map +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 +2 -2
- package/lib/components/tooltip-v2/src/tooltip2.js +4 -4
- package/lib/components/tour/src/content.js +45 -69
- package/lib/components/tour/src/content.js.map +1 -1
- package/lib/components/tour/src/content2.js +69 -45
- package/lib/components/tour/src/content2.js.map +1 -1
- package/lib/components/tour/src/step.js +1 -1
- package/lib/components/tour/src/tour.js +1 -1
- package/lib/components/tour/src/tour2.js +1 -1
- package/lib/components/tree/index.d.ts +16 -0
- package/lib/components/tree/src/model/node.d.ts +2 -0
- package/lib/components/tree/src/model/node.js +13 -0
- package/lib/components/tree/src/model/node.js.map +1 -1
- package/lib/components/tree/src/model/useDragNode.js +6 -0
- package/lib/components/tree/src/model/useDragNode.js.map +1 -1
- package/lib/components/tree/src/tree-node.js +1 -0
- package/lib/components/tree/src/tree-node.js.map +1 -1
- package/lib/components/tree/src/tree.vue.d.ts +8 -0
- 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/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,23 +1,86 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, unref, watch, onMounted, onBeforeUnmount, provide, renderSlot } from 'vue';
|
|
2
|
+
import { useTimeoutFn } from '@vueuse/core';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
1
4
|
import '../../../utils/index.mjs';
|
|
2
|
-
import {
|
|
5
|
+
import { TOOLTIP_V2_OPEN, tooltipV2RootKey } from './constants.mjs';
|
|
6
|
+
import { tooltipV2RootProps } from './root.mjs';
|
|
7
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
+
import { isPropAbsent, isNumber } from '../../../utils/types.mjs';
|
|
9
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
10
|
+
import { useId } from '../../../hooks/use-id/index.mjs';
|
|
3
11
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const __default__ = defineComponent({
|
|
13
|
+
name: "ElTooltipV2Root"
|
|
14
|
+
});
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
+
...__default__,
|
|
17
|
+
props: tooltipV2RootProps,
|
|
18
|
+
setup(__props, { expose }) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const _open = ref(props.defaultOpen);
|
|
21
|
+
const triggerRef = ref(null);
|
|
22
|
+
const open = computed({
|
|
23
|
+
get: () => isPropAbsent(props.open) ? _open.value : props.open,
|
|
24
|
+
set: (open2) => {
|
|
25
|
+
var _a;
|
|
26
|
+
_open.value = open2;
|
|
27
|
+
(_a = props["onUpdate:open"]) == null ? void 0 : _a.call(props, open2);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const isOpenDelayed = computed(() => isNumber(props.delayDuration) && props.delayDuration > 0);
|
|
31
|
+
const { start: onDelayedOpen, stop: clearTimer } = useTimeoutFn(() => {
|
|
32
|
+
open.value = true;
|
|
33
|
+
}, computed(() => props.delayDuration), {
|
|
34
|
+
immediate: false
|
|
35
|
+
});
|
|
36
|
+
const ns = useNamespace("tooltip-v2");
|
|
37
|
+
const contentId = useId();
|
|
38
|
+
const onNormalOpen = () => {
|
|
39
|
+
clearTimer();
|
|
40
|
+
open.value = true;
|
|
41
|
+
};
|
|
42
|
+
const onDelayOpen = () => {
|
|
43
|
+
unref(isOpenDelayed) ? onDelayedOpen() : onNormalOpen();
|
|
44
|
+
};
|
|
45
|
+
const onOpen = onNormalOpen;
|
|
46
|
+
const onClose = () => {
|
|
47
|
+
clearTimer();
|
|
48
|
+
open.value = false;
|
|
49
|
+
};
|
|
50
|
+
const onChange = (open2) => {
|
|
51
|
+
var _a;
|
|
52
|
+
if (open2) {
|
|
53
|
+
document.dispatchEvent(new CustomEvent(TOOLTIP_V2_OPEN));
|
|
54
|
+
onOpen();
|
|
55
|
+
}
|
|
56
|
+
(_a = props.onOpenChange) == null ? void 0 : _a.call(props, open2);
|
|
57
|
+
};
|
|
58
|
+
watch(open, onChange);
|
|
59
|
+
onMounted(() => {
|
|
60
|
+
document.addEventListener(TOOLTIP_V2_OPEN, onClose);
|
|
61
|
+
});
|
|
62
|
+
onBeforeUnmount(() => {
|
|
63
|
+
clearTimer();
|
|
64
|
+
document.removeEventListener(TOOLTIP_V2_OPEN, onClose);
|
|
65
|
+
});
|
|
66
|
+
provide(tooltipV2RootKey, {
|
|
67
|
+
contentId,
|
|
68
|
+
triggerRef,
|
|
69
|
+
ns,
|
|
70
|
+
onClose,
|
|
71
|
+
onDelayOpen,
|
|
72
|
+
onOpen
|
|
73
|
+
});
|
|
74
|
+
expose({
|
|
75
|
+
onOpen,
|
|
76
|
+
onClose
|
|
77
|
+
});
|
|
78
|
+
return (_ctx, _cache) => {
|
|
79
|
+
return renderSlot(_ctx.$slots, "default", { open: unref(open) });
|
|
80
|
+
};
|
|
19
81
|
}
|
|
20
82
|
});
|
|
83
|
+
var TooltipV2Root = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "root.vue"]]);
|
|
21
84
|
|
|
22
|
-
export {
|
|
85
|
+
export { TooltipV2Root as default };
|
|
23
86
|
//# sourceMappingURL=root2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root2.mjs","sources":["../../../../../../packages/components/tooltip-v2/src/root.
|
|
1
|
+
{"version":3,"file":"root2.mjs","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":[],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../../utils/index.mjs';
|
|
2
|
-
import { tooltipV2RootProps } from './
|
|
2
|
+
import { tooltipV2RootProps } from './root.mjs';
|
|
3
3
|
import { tooltipV2TriggerProps } from './trigger.mjs';
|
|
4
|
-
import { tooltipV2ArrowProps } from './
|
|
4
|
+
import { tooltipV2ArrowProps } from './arrow.mjs';
|
|
5
5
|
import { tooltipV2ContentProps } from './content.mjs';
|
|
6
6
|
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
7
7
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent, toRefs, reactive, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, mergeProps, renderSlot, Teleport, Transition, createCommentVNode, createElementBlock, Fragment } from 'vue';
|
|
2
2
|
import { pick } from 'lodash-unified';
|
|
3
|
-
import { tooltipV2ArrowProps } from './
|
|
3
|
+
import { tooltipV2ArrowProps } from './arrow.mjs';
|
|
4
4
|
import { tooltipV2ContentProps } from './content.mjs';
|
|
5
|
-
import { tooltipV2RootProps } from './
|
|
5
|
+
import { tooltipV2RootProps } from './root.mjs';
|
|
6
6
|
import { tooltipV2Props } from './tooltip.mjs';
|
|
7
7
|
import { tooltipV2TriggerProps } from './trigger.mjs';
|
|
8
|
-
import TooltipV2Root from './
|
|
9
|
-
import TooltipV2Arrow from './
|
|
8
|
+
import TooltipV2Root from './root2.mjs';
|
|
9
|
+
import TooltipV2Arrow from './arrow2.mjs';
|
|
10
10
|
import TooltipV2Content from './content2.mjs';
|
|
11
11
|
import TooltipV2Trigger from './trigger2.mjs';
|
|
12
12
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
@@ -1,74 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
3
|
-
import { tourContentProps, tourContentEmits } from './content2.mjs';
|
|
4
|
-
import { useFloating, tourKey } from './helper.mjs';
|
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
-
import ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
7
3
|
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
}, [
|
|
47
|
-
createVNode(unref(ElFocusTrap), {
|
|
48
|
-
loop: "",
|
|
49
|
-
trapped: "",
|
|
50
|
-
"focus-start-el": "container",
|
|
51
|
-
"focus-trap-el": contentRef.value || void 0,
|
|
52
|
-
onReleaseRequested: onCloseRequested,
|
|
53
|
-
onFocusoutPrevented
|
|
54
|
-
}, {
|
|
55
|
-
default: withCtx(() => [
|
|
56
|
-
renderSlot(_ctx.$slots, "default")
|
|
57
|
-
]),
|
|
58
|
-
_: 3
|
|
59
|
-
}, 8, ["focus-trap-el"]),
|
|
60
|
-
_ctx.showArrow ? (openBlock(), createElementBlock("span", {
|
|
61
|
-
key: 0,
|
|
62
|
-
ref_key: "arrowRef",
|
|
63
|
-
ref: arrowRef,
|
|
64
|
-
style: normalizeStyle(unref(arrowStyle)),
|
|
65
|
-
class: normalizeClass(unref(ns).e("arrow"))
|
|
66
|
-
}, null, 6)) : createCommentVNode("v-if", true)
|
|
67
|
-
], 14, _hoisted_1);
|
|
68
|
-
};
|
|
4
|
+
const tourStrategies = ["absolute", "fixed"];
|
|
5
|
+
const tourPlacements = [
|
|
6
|
+
"top-start",
|
|
7
|
+
"top-end",
|
|
8
|
+
"top",
|
|
9
|
+
"bottom-start",
|
|
10
|
+
"bottom-end",
|
|
11
|
+
"bottom",
|
|
12
|
+
"left-start",
|
|
13
|
+
"left-end",
|
|
14
|
+
"left",
|
|
15
|
+
"right-start",
|
|
16
|
+
"right-end",
|
|
17
|
+
"right"
|
|
18
|
+
];
|
|
19
|
+
const tourContentProps = buildProps({
|
|
20
|
+
placement: {
|
|
21
|
+
type: definePropType(String),
|
|
22
|
+
values: tourPlacements,
|
|
23
|
+
default: "bottom"
|
|
24
|
+
},
|
|
25
|
+
reference: {
|
|
26
|
+
type: definePropType(Object),
|
|
27
|
+
default: null
|
|
28
|
+
},
|
|
29
|
+
strategy: {
|
|
30
|
+
type: definePropType(String),
|
|
31
|
+
values: tourStrategies,
|
|
32
|
+
default: "absolute"
|
|
33
|
+
},
|
|
34
|
+
offset: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 10
|
|
37
|
+
},
|
|
38
|
+
showArrow: Boolean,
|
|
39
|
+
zIndex: {
|
|
40
|
+
type: Number,
|
|
41
|
+
default: 2001
|
|
69
42
|
}
|
|
70
43
|
});
|
|
71
|
-
|
|
44
|
+
const tourContentEmits = {
|
|
45
|
+
close: () => true
|
|
46
|
+
};
|
|
72
47
|
|
|
73
|
-
export {
|
|
48
|
+
export { tourContentEmits, tourContentProps };
|
|
74
49
|
//# sourceMappingURL=content.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.mjs","sources":["../../../../../../packages/components/tour/src/content.
|
|
1
|
+
{"version":3,"file":"content.mjs","sources":["../../../../../../packages/components/tour/src/content.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { Placement, Strategy, VirtualElement } from '@floating-ui/dom'\n\nconst tourStrategies = ['absolute', 'fixed'] as const\n\nconst tourPlacements = [\n 'top-start',\n 'top-end',\n 'top',\n 'bottom-start',\n 'bottom-end',\n 'bottom',\n 'left-start',\n 'left-end',\n 'left',\n 'right-start',\n 'right-end',\n 'right',\n] as const\n\nexport const tourContentProps = buildProps({\n /**\n * @description position of the guide card relative to the target element\n */\n placement: {\n type: definePropType<Placement>(String),\n values: tourPlacements,\n default: 'bottom',\n },\n /**\n * @description the reference dom\n */\n reference: {\n type: definePropType<HTMLElement | VirtualElement | null>(Object),\n default: null,\n },\n /**\n * @description position strategy of the content\n */\n strategy: {\n type: definePropType<Strategy>(String),\n values: tourStrategies,\n default: 'absolute',\n },\n /**\n * @description offset of the arrow\n */\n offset: {\n type: Number,\n default: 10,\n },\n /**\n * @description @description whether to show the arrow\n */\n showArrow: Boolean,\n /**\n * @description content's zIndex\n */\n zIndex: {\n type: Number,\n default: 2001,\n },\n})\n\nexport type TourContentProps = ExtractPropTypes<typeof tourContentProps>\n\nexport const tourContentEmits = {\n close: () => true,\n}\nexport type TourContentEmits = typeof tourContentEmits\n"],"names":[],"mappings":";;;AACA,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC7C,MAAM,cAAc,GAAG;AACvB,EAAE,WAAW;AACb,EAAE,SAAS;AACX,EAAE,KAAK;AACP,EAAE,cAAc;AAChB,EAAE,YAAY;AACd,EAAE,QAAQ;AACV,EAAE,YAAY;AACd,EAAE,UAAU;AACZ,EAAE,MAAM;AACR,EAAE,aAAa;AACf,EAAE,WAAW;AACb,EAAE,OAAO;AACT,CAAC,CAAC;AACU,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,UAAU;AACvB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,KAAK,EAAE,MAAM,IAAI;AACnB;;;;"}
|
|
@@ -1,49 +1,74 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, ref, watch, toRef, computed, inject, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, createVNode, withCtx, renderSlot, createCommentVNode } from 'vue';
|
|
2
|
+
import '../../focus-trap/index.mjs';
|
|
3
|
+
import { tourContentProps, tourContentEmits } from './content.mjs';
|
|
4
|
+
import { useFloating, tourKey } from './helper.mjs';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';
|
|
3
7
|
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
8
|
+
const _hoisted_1 = ["data-side"];
|
|
9
|
+
const __default__ = defineComponent({
|
|
10
|
+
name: "ElTourContent"
|
|
11
|
+
});
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
...__default__,
|
|
14
|
+
props: tourContentProps,
|
|
15
|
+
emits: tourContentEmits,
|
|
16
|
+
setup(__props, { emit }) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const placement = ref(props.placement);
|
|
19
|
+
const strategy = ref(props.strategy);
|
|
20
|
+
const contentRef = ref(null);
|
|
21
|
+
const arrowRef = ref(null);
|
|
22
|
+
watch(() => props.placement, () => {
|
|
23
|
+
placement.value = props.placement;
|
|
24
|
+
});
|
|
25
|
+
const { contentStyle, arrowStyle } = useFloating(toRef(props, "reference"), contentRef, arrowRef, placement, strategy, toRef(props, "offset"), toRef(props, "zIndex"), toRef(props, "showArrow"));
|
|
26
|
+
const side = computed(() => {
|
|
27
|
+
return placement.value.split("-")[0];
|
|
28
|
+
});
|
|
29
|
+
const { ns } = inject(tourKey);
|
|
30
|
+
const onCloseRequested = () => {
|
|
31
|
+
emit("close");
|
|
32
|
+
};
|
|
33
|
+
const onFocusoutPrevented = (event) => {
|
|
34
|
+
if (event.detail.focusReason === "pointer") {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return (_ctx, _cache) => {
|
|
39
|
+
return openBlock(), createElementBlock("div", {
|
|
40
|
+
ref_key: "contentRef",
|
|
41
|
+
ref: contentRef,
|
|
42
|
+
style: normalizeStyle(unref(contentStyle)),
|
|
43
|
+
class: normalizeClass(unref(ns).e("content")),
|
|
44
|
+
"data-side": unref(side),
|
|
45
|
+
tabindex: "-1"
|
|
46
|
+
}, [
|
|
47
|
+
createVNode(unref(ElFocusTrap), {
|
|
48
|
+
loop: "",
|
|
49
|
+
trapped: "",
|
|
50
|
+
"focus-start-el": "container",
|
|
51
|
+
"focus-trap-el": contentRef.value || void 0,
|
|
52
|
+
onReleaseRequested: onCloseRequested,
|
|
53
|
+
onFocusoutPrevented
|
|
54
|
+
}, {
|
|
55
|
+
default: withCtx(() => [
|
|
56
|
+
renderSlot(_ctx.$slots, "default")
|
|
57
|
+
]),
|
|
58
|
+
_: 3
|
|
59
|
+
}, 8, ["focus-trap-el"]),
|
|
60
|
+
_ctx.showArrow ? (openBlock(), createElementBlock("span", {
|
|
61
|
+
key: 0,
|
|
62
|
+
ref_key: "arrowRef",
|
|
63
|
+
ref: arrowRef,
|
|
64
|
+
style: normalizeStyle(unref(arrowStyle)),
|
|
65
|
+
class: normalizeClass(unref(ns).e("arrow"))
|
|
66
|
+
}, null, 6)) : createCommentVNode("v-if", true)
|
|
67
|
+
], 14, _hoisted_1);
|
|
68
|
+
};
|
|
42
69
|
}
|
|
43
70
|
});
|
|
44
|
-
|
|
45
|
-
close: () => true
|
|
46
|
-
};
|
|
71
|
+
var ElTourContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "content.vue"]]);
|
|
47
72
|
|
|
48
|
-
export {
|
|
73
|
+
export { ElTourContent as default };
|
|
49
74
|
//# sourceMappingURL=content2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content2.mjs","sources":["../../../../../../packages/components/tour/src/content.
|
|
1
|
+
{"version":3,"file":"content2.mjs","sources":["../../../../../../packages/components/tour/src/content.vue"],"sourcesContent":["<template>\n <div\n ref=\"contentRef\"\n :style=\"contentStyle\"\n :class=\"ns.e('content')\"\n :data-side=\"side\"\n tabindex=\"-1\"\n >\n <el-focus-trap\n loop\n trapped\n focus-start-el=\"container\"\n :focus-trap-el=\"contentRef || undefined\"\n @release-requested=\"onCloseRequested\"\n @focusout-prevented=\"onFocusoutPrevented\"\n >\n <slot />\n </el-focus-trap>\n <span\n v-if=\"showArrow\"\n ref=\"arrowRef\"\n :style=\"arrowStyle\"\n :class=\"ns.e('arrow')\"\n />\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { computed, inject, ref, toRef, watch } from 'vue'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { tourContentEmits, tourContentProps } from './content'\nimport { tourKey, useFloating } from './helper'\n\ndefineOptions({\n name: 'ElTourContent',\n})\n\nconst props = defineProps(tourContentProps)\nconst emit = defineEmits(tourContentEmits)\n\nconst placement = ref(props.placement)\nconst strategy = ref(props.strategy)\nconst contentRef = ref<HTMLElement | null>(null)\nconst arrowRef = ref<HTMLElement | null>(null)\n\nwatch(\n () => props.placement,\n () => {\n placement.value = props.placement\n }\n)\n\nconst { contentStyle, arrowStyle } = useFloating(\n toRef(props, 'reference'),\n contentRef,\n arrowRef,\n placement,\n strategy,\n toRef(props, 'offset'),\n toRef(props, 'zIndex'),\n toRef(props, 'showArrow')\n)\n\nconst side = computed(() => {\n return placement.value.split('-')[0]\n})\n\nconst { ns } = inject(tourKey)!\n\nconst onCloseRequested = () => {\n emit('close')\n}\n\nconst onFocusoutPrevented = (event: CustomEvent) => {\n if (event.detail.focusReason === 'pointer') {\n event.preventDefault()\n }\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;mCAgCc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,SAAA,GAAY,GAAI,CAAA,KAAA,CAAM,SAAS,CAAA,CAAA;AACrC,IAAM,MAAA,QAAA,GAAW,GAAI,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AACnC,IAAM,MAAA,UAAA,GAAa,IAAwB,IAAI,CAAA,CAAA;AAC/C,IAAM,MAAA,QAAA,GAAW,IAAwB,IAAI,CAAA,CAAA;AAE7C,IACE,KAAA,CAAA,MAAM,KAAM,CAAA,SAAA,EACZ,MAAM;AACJ,MAAA,SAAA,CAAU,QAAQ,KAAM,CAAA,SAAA,CAAA;AAAA,KAE5B,CAAA,CAAA;AAEA,IAAM,MAAA,EAAE,cAAc,UAAe,EAAA,GAAA,WAAA,CACnC,MAAM,KAAO,EAAA,WAAW,CACxB,EAAA,UAAA,EACA,QACA,EAAA,SAAA,EACA,UACA,KAAM,CAAA,KAAA,EAAO,QAAQ,CAAA,EACrB,KAAM,CAAA,KAAA,EAAO,QAAQ,CACrB,EAAA,KAAA,CAAM,KAAO,EAAA,WAAW,CAC1B,CAAA,CAAA;AAEA,IAAM,MAAA,IAAA,GAAO,SAAS,MAAM;AAC1B,MAAA,OAAO,SAAU,CAAA,KAAA,CAAM,KAAM,CAAA,GAAG,CAAE,CAAA,CAAA,CAAA,CAAA;AAAA,KACnC,CAAA,CAAA;AAED,IAAM,MAAA,EAAE,EAAO,EAAA,GAAA,MAAA,CAAO,OAAO,CAAA,CAAA;AAE7B,IAAA,MAAM,mBAAmB,MAAM;AAC7B,MAAA,IAAA,CAAK,OAAO,CAAA,CAAA;AAAA,KACd,CAAA;AAEA,IAAM,MAAA,mBAAA,GAAsB,CAAC,KAAuB,KAAA;AAClD,MAAI,IAAA,KAAA,CAAM,MAAO,CAAA,WAAA,KAAgB,SAAW,EAAA;AAC1C,QAAA,KAAA,CAAM,cAAe,EAAA,CAAA;AAAA,OACvB;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../../../utils/index.mjs';
|
|
2
|
-
import { tourContentProps } from './
|
|
2
|
+
import { tourContentProps } from './content.mjs';
|
|
3
3
|
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
4
4
|
import { iconPropType } from '../../../utils/vue/icon.mjs';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../../utils/index.mjs';
|
|
2
2
|
import '../../../constants/index.mjs';
|
|
3
|
-
import { tourContentProps } from './
|
|
3
|
+
import { tourContentProps } from './content.mjs';
|
|
4
4
|
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
5
5
|
import { iconPropType } from '../../../utils/vue/icon.mjs';
|
|
6
6
|
import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
|
|
@@ -3,7 +3,7 @@ import { useVModel } from '@vueuse/core';
|
|
|
3
3
|
import '../../../hooks/index.mjs';
|
|
4
4
|
import '../../../utils/index.mjs';
|
|
5
5
|
import ElTourMask from './mask2.mjs';
|
|
6
|
-
import ElTourContent from './
|
|
6
|
+
import ElTourContent from './content2.mjs';
|
|
7
7
|
import ElTourSteps from './steps.mjs';
|
|
8
8
|
import { tourProps, tourEmits } from './tour.mjs';
|
|
9
9
|
import { useTarget, tourKey } from './helper.mjs';
|
|
@@ -125,6 +125,8 @@ declare const _Tree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
125
125
|
getChildren: (forceInit?: boolean) => import("./src/tree.type").TreeNodeData | import("./src/tree.type").TreeNodeData[];
|
|
126
126
|
updateChildren: () => void;
|
|
127
127
|
loadData: (callback: (node: import("./src/model/node").default) => void, defaultProps?: import("./src/tree.type").TreeNodeLoadedDefaultProps) => void;
|
|
128
|
+
eachNode: (callback: (node: import("./src/model/node").default) => void) => void;
|
|
129
|
+
reInitChecked: () => void;
|
|
128
130
|
};
|
|
129
131
|
currentNodeKey: import("./src/tree.type").TreeKey;
|
|
130
132
|
nodesMap: import("./src/tree.type").TreeStoreNodesMap;
|
|
@@ -169,6 +171,8 @@ declare const _Tree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
169
171
|
getChildren: (forceInit?: boolean) => import("./src/tree.type").TreeNodeData | import("./src/tree.type").TreeNodeData[];
|
|
170
172
|
updateChildren: () => void;
|
|
171
173
|
loadData: (callback: (node: import("./src/model/node").default) => void, defaultProps?: import("./src/tree.type").TreeNodeLoadedDefaultProps) => void;
|
|
174
|
+
eachNode: (callback: (node: import("./src/model/node").default) => void) => void;
|
|
175
|
+
reInitChecked: () => void;
|
|
172
176
|
};
|
|
173
177
|
data: import("./src/tree.type").TreeNodeData[];
|
|
174
178
|
lazy: boolean;
|
|
@@ -262,6 +266,8 @@ declare const _Tree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
262
266
|
getChildren: (forceInit?: boolean) => import("./src/tree.type").TreeNodeData | import("./src/tree.type").TreeNodeData[];
|
|
263
267
|
updateChildren: () => void;
|
|
264
268
|
loadData: (callback: (node: import("./src/model/node").default) => void, defaultProps?: import("./src/tree.type").TreeNodeLoadedDefaultProps) => void;
|
|
269
|
+
eachNode: (callback: (node: import("./src/model/node").default) => void) => void;
|
|
270
|
+
reInitChecked: () => void;
|
|
265
271
|
}>;
|
|
266
272
|
currentNode: import("vue").Ref<{
|
|
267
273
|
id: number;
|
|
@@ -304,6 +310,8 @@ declare const _Tree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
304
310
|
getChildren: (forceInit?: boolean) => import("./src/tree.type").TreeNodeData | import("./src/tree.type").TreeNodeData[];
|
|
305
311
|
updateChildren: () => void;
|
|
306
312
|
loadData: (callback: (node: import("./src/model/node").default) => void, defaultProps?: import("./src/tree.type").TreeNodeLoadedDefaultProps) => void;
|
|
313
|
+
eachNode: (callback: (node: import("./src/model/node").default) => void) => void;
|
|
314
|
+
reInitChecked: () => void;
|
|
307
315
|
}>;
|
|
308
316
|
dragState: import("vue").Ref<{
|
|
309
317
|
showDropIndicator: boolean;
|
|
@@ -560,6 +568,8 @@ export declare const ElTree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
560
568
|
getChildren: (forceInit?: boolean) => import("./src/tree.type").TreeNodeData | import("./src/tree.type").TreeNodeData[];
|
|
561
569
|
updateChildren: () => void;
|
|
562
570
|
loadData: (callback: (node: import("./src/model/node").default) => void, defaultProps?: import("./src/tree.type").TreeNodeLoadedDefaultProps) => void;
|
|
571
|
+
eachNode: (callback: (node: import("./src/model/node").default) => void) => void;
|
|
572
|
+
reInitChecked: () => void;
|
|
563
573
|
};
|
|
564
574
|
currentNodeKey: import("./src/tree.type").TreeKey;
|
|
565
575
|
nodesMap: import("./src/tree.type").TreeStoreNodesMap;
|
|
@@ -604,6 +614,8 @@ export declare const ElTree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
604
614
|
getChildren: (forceInit?: boolean) => import("./src/tree.type").TreeNodeData | import("./src/tree.type").TreeNodeData[];
|
|
605
615
|
updateChildren: () => void;
|
|
606
616
|
loadData: (callback: (node: import("./src/model/node").default) => void, defaultProps?: import("./src/tree.type").TreeNodeLoadedDefaultProps) => void;
|
|
617
|
+
eachNode: (callback: (node: import("./src/model/node").default) => void) => void;
|
|
618
|
+
reInitChecked: () => void;
|
|
607
619
|
};
|
|
608
620
|
data: import("./src/tree.type").TreeNodeData[];
|
|
609
621
|
lazy: boolean;
|
|
@@ -697,6 +709,8 @@ export declare const ElTree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
697
709
|
getChildren: (forceInit?: boolean) => import("./src/tree.type").TreeNodeData | import("./src/tree.type").TreeNodeData[];
|
|
698
710
|
updateChildren: () => void;
|
|
699
711
|
loadData: (callback: (node: import("./src/model/node").default) => void, defaultProps?: import("./src/tree.type").TreeNodeLoadedDefaultProps) => void;
|
|
712
|
+
eachNode: (callback: (node: import("./src/model/node").default) => void) => void;
|
|
713
|
+
reInitChecked: () => void;
|
|
700
714
|
}>;
|
|
701
715
|
currentNode: import("vue").Ref<{
|
|
702
716
|
id: number;
|
|
@@ -739,6 +753,8 @@ export declare const ElTree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
739
753
|
getChildren: (forceInit?: boolean) => import("./src/tree.type").TreeNodeData | import("./src/tree.type").TreeNodeData[];
|
|
740
754
|
updateChildren: () => void;
|
|
741
755
|
loadData: (callback: (node: import("./src/model/node").default) => void, defaultProps?: import("./src/tree.type").TreeNodeLoadedDefaultProps) => void;
|
|
756
|
+
eachNode: (callback: (node: import("./src/model/node").default) => void) => void;
|
|
757
|
+
reInitChecked: () => void;
|
|
742
758
|
}>;
|
|
743
759
|
dragState: import("vue").Ref<{
|
|
744
760
|
showDropIndicator: boolean;
|
|
@@ -44,5 +44,7 @@ declare class Node {
|
|
|
44
44
|
getChildren(forceInit?: boolean): TreeNodeData | TreeNodeData[];
|
|
45
45
|
updateChildren(): void;
|
|
46
46
|
loadData(callback: (node: Node) => void, defaultProps?: TreeNodeLoadedDefaultProps): void;
|
|
47
|
+
eachNode(callback: (node: Node) => void): void;
|
|
48
|
+
reInitChecked(): void;
|
|
47
49
|
}
|
|
48
50
|
export default Node;
|
|
@@ -425,6 +425,19 @@ class Node {
|
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
|
+
eachNode(callback) {
|
|
429
|
+
const arr = [this];
|
|
430
|
+
while (arr.length) {
|
|
431
|
+
const node = arr.shift();
|
|
432
|
+
arr.unshift(...node.childNodes);
|
|
433
|
+
callback(node);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
reInitChecked() {
|
|
437
|
+
if (this.store.checkStrictly)
|
|
438
|
+
return;
|
|
439
|
+
reInitChecked(this);
|
|
440
|
+
}
|
|
428
441
|
}
|
|
429
442
|
|
|
430
443
|
export { Node as default, getChildState };
|