@ulu/frontend-vue 0.6.35 → 0.6.36
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/mcp-data.json +2694 -2638
- package/dist/plugins/tour/UluTourContent.vue.d.ts.map +1 -1
- package/dist/plugins/tour/UluTourContent.vue.js +22 -14
- package/dist/plugins/tour/UluTourDisplay.vue.js +83 -72
- package/dist/plugins/tour/api.d.ts +12 -0
- package/dist/plugins/tour/api.d.ts.map +1 -1
- package/dist/plugins/tour/api.js +2 -0
- package/lib/plugins/tour/UluTourContent.vue +32 -2
- package/lib/plugins/tour/UluTourDisplay.vue +35 -14
- package/lib/plugins/tour/api.js +5 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluTourContent.vue.d.ts","sourceRoot":"","sources":["../../../lib/plugins/tour/UluTourContent.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UluTourContent.vue.d.ts","sourceRoot":"","sources":["../../../lib/plugins/tour/UluTourContent.vue"],"names":[],"mappings":"AA2BA;"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import
|
|
3
|
-
import { useTour as
|
|
4
|
-
const
|
|
1
|
+
import { computed as r, createElementBlock as a, openBlock as o, createBlock as f, createCommentVNode as l, createVNode as h, resolveDynamicComponent as C, normalizeClass as c, withCtx as _, createElementVNode as u, toDisplayString as n } from "vue";
|
|
2
|
+
import y from "../../components/elements/UluRule.vue.js";
|
|
3
|
+
import { useTour as P } from "./useTour.js";
|
|
4
|
+
const k = { class: "tour-content crop-margins" }, x = { class: "tour-content__title-text" }, T = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "tour-content__body"
|
|
7
|
+
}, V = {
|
|
5
8
|
__name: "UluTourContent",
|
|
6
9
|
props: {
|
|
7
10
|
/**
|
|
@@ -19,23 +22,28 @@ const v = { class: "tour-content crop-margins" }, y = { key: 1 }, M = {
|
|
|
19
22
|
default: !1
|
|
20
23
|
}
|
|
21
24
|
},
|
|
22
|
-
setup(
|
|
23
|
-
const { state:
|
|
24
|
-
return (
|
|
25
|
-
|
|
25
|
+
setup(t) {
|
|
26
|
+
const { state: e } = P(), s = t, d = r(() => s.step.titleClass ? s.step.titleClass : s.isModal ? e.active?.modalTitleClass || ["h3", "no-margin"] : e.active?.popoverTitleClass || ["h4", "display-block", "no-margin"]), p = r(() => s.step.progressClass || e.active?.progressClass || "headline-label"), m = r(() => e.stepIndex + 1), g = r(() => e.active?.steps?.length || 0), v = r(() => s.step.hideProgress !== void 0 ? !s.step.hideProgress : e.active?.hideProgress !== void 0 ? !e.active.hideProgress : !0);
|
|
27
|
+
return (b, i) => (o(), a("div", k, [
|
|
28
|
+
t.step?.title ? (o(), f(C(t.isModal ? "h2" : "strong"), {
|
|
26
29
|
key: 0,
|
|
27
|
-
class: d
|
|
30
|
+
class: c(["tour-content__title", d.value])
|
|
28
31
|
}, {
|
|
29
|
-
default:
|
|
30
|
-
|
|
32
|
+
default: _(() => [
|
|
33
|
+
v.value ? (o(), a("span", {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: c(["tour-content__title-progress", p.value])
|
|
36
|
+
}, " Part " + n(m.value) + " / " + n(g.value), 3)) : l("", !0),
|
|
37
|
+
i[0] || (i[0] = u("span", { class: "hidden-visually" }, ":", -1)),
|
|
38
|
+
u("span", x, n(t.step.title), 1)
|
|
31
39
|
]),
|
|
32
40
|
_: 1
|
|
33
41
|
}, 8, ["class"])) : l("", !0),
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
h(y),
|
|
43
|
+
t.step?.content ? (o(), a("p", T, n(t.step.content), 1)) : l("", !0)
|
|
36
44
|
]));
|
|
37
45
|
}
|
|
38
46
|
};
|
|
39
47
|
export {
|
|
40
|
-
|
|
48
|
+
V as default
|
|
41
49
|
};
|
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useTour as
|
|
7
|
-
const
|
|
1
|
+
import { computed as r, ref as h, unref as n, watch as M, nextTick as $, onMounted as R, onUnmounted as q, createBlock as a, openBlock as u, Teleport as U, createElementBlock as P, createCommentVNode as S, Fragment as V, resolveDynamicComponent as i, mergeProps as d, createSlots as _, withCtx as y, normalizeStyle as H } from "vue";
|
|
2
|
+
import N from "../../components/collapsible/UluModal.vue.js";
|
|
3
|
+
import O from "../popovers/UluPopoverBase.vue.js";
|
|
4
|
+
import j from "./UluTourPager.vue.js";
|
|
5
|
+
import E from "./UluTourContent.vue.js";
|
|
6
|
+
import { useTour as A } from "./useTour.js";
|
|
7
|
+
const Z = {
|
|
8
8
|
__name: "UluTourDisplay",
|
|
9
|
-
setup(
|
|
10
|
-
const { api: s, state:
|
|
11
|
-
const e = t.value?.target;
|
|
12
|
-
return typeof e == "function" ? e() : e;
|
|
13
|
-
}),
|
|
9
|
+
setup(G) {
|
|
10
|
+
const { api: s, state: l } = A(), t = r(() => l.active?.steps[l.stepIndex]), w = r(() => t.value?.component || l.active?.component), f = r(() => t.value?.contentComponent || l.active?.contentComponent), x = r(() => t.value?.pagerComponent || l.active?.pagerComponent || j), T = r(() => t.value?.modalComponent || l.active?.modalComponent || N), B = r(() => t.value?.popoverComponent || l.active?.popoverComponent || O), v = h(null), g = h(null), C = h(null), k = r(() => {
|
|
11
|
+
const e = n(t.value?.target);
|
|
12
|
+
return typeof e == "function" ? n(e()) : e;
|
|
13
|
+
}), b = r(() => {
|
|
14
|
+
const e = n(t.value?.highlightElement);
|
|
15
|
+
return typeof e == "function" ? n(e()) : e;
|
|
16
|
+
}), z = r(() => ({
|
|
14
17
|
placement: t.value?.placement || "bottom",
|
|
15
18
|
arrow: !0,
|
|
16
19
|
offset: 8
|
|
17
|
-
})),
|
|
18
|
-
...
|
|
20
|
+
})), L = r(() => ({
|
|
21
|
+
...l.active?.modalProps || {},
|
|
19
22
|
...t.value?.modalProps || {}
|
|
20
|
-
})),
|
|
23
|
+
})), F = r(() => ({
|
|
21
24
|
modifiers: "large",
|
|
22
|
-
...
|
|
25
|
+
...l.active?.popoverProps || {},
|
|
23
26
|
...t.value?.popoverProps || {}
|
|
24
|
-
})),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
})), m = h(null), c = () => {
|
|
28
|
+
const e = g.value || v.value;
|
|
29
|
+
if (e) {
|
|
30
|
+
const o = e.getBoundingClientRect();
|
|
31
|
+
m.value = {
|
|
32
|
+
top: o.top,
|
|
33
|
+
left: o.left,
|
|
34
|
+
width: o.width,
|
|
35
|
+
height: o.height
|
|
32
36
|
};
|
|
33
37
|
} else
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
if (!
|
|
37
|
-
const e =
|
|
38
|
+
m.value = null;
|
|
39
|
+
}, I = r(() => {
|
|
40
|
+
if (!m.value) return {};
|
|
41
|
+
const e = m.value;
|
|
38
42
|
return {
|
|
39
43
|
position: "fixed",
|
|
40
44
|
top: 0,
|
|
@@ -59,44 +63,51 @@ const W = {
|
|
|
59
63
|
)`
|
|
60
64
|
};
|
|
61
65
|
});
|
|
62
|
-
return
|
|
66
|
+
return M([k, b], async ([e, o]) => {
|
|
63
67
|
if (e) {
|
|
64
|
-
await
|
|
65
|
-
const
|
|
66
|
-
|
|
68
|
+
await $();
|
|
69
|
+
const p = typeof e == "string" ? document.querySelector(e) : n(e);
|
|
70
|
+
p ? (v.value = p, C.value && C.value.update()) : (console.warn("Tour target not found:", e), v.value = null);
|
|
71
|
+
} else
|
|
72
|
+
v.value = null;
|
|
73
|
+
if (o) {
|
|
74
|
+
await $();
|
|
75
|
+
const p = typeof o == "string" ? document.querySelector(o) : n(o);
|
|
76
|
+
p ? g.value = p : (console.warn("Tour highlight element not found:", o), g.value = null);
|
|
67
77
|
} else
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
g.value = null;
|
|
79
|
+
t.value?.highlight && c();
|
|
80
|
+
}, { immediate: !0 }), R(() => {
|
|
81
|
+
window.addEventListener("resize", c), window.addEventListener("scroll", c);
|
|
82
|
+
}), q(() => {
|
|
83
|
+
window.removeEventListener("resize", c), window.removeEventListener("scroll", c);
|
|
84
|
+
}), (e, o) => (u(), a(U, { to: "body" }, [
|
|
85
|
+
n(l).active ? (u(), P(V, { key: 0 }, [
|
|
86
|
+
w.value ? (u(), a(i(w.value), d({
|
|
76
87
|
key: 0,
|
|
77
88
|
"data-ulu-tour-ui": "true",
|
|
78
89
|
step: t.value,
|
|
79
|
-
tourState:
|
|
80
|
-
api:
|
|
81
|
-
}, t.value.componentProps), null, 16, ["step", "tourState", "api"])) :
|
|
90
|
+
tourState: n(l),
|
|
91
|
+
api: n(s)
|
|
92
|
+
}, t.value.componentProps), null, 16, ["step", "tourState", "api"])) : k.value ? (u(), a(i(B.value), d({
|
|
82
93
|
key: 2,
|
|
83
94
|
ref_key: "popoverBase",
|
|
84
|
-
ref:
|
|
85
|
-
trigger:
|
|
86
|
-
config:
|
|
95
|
+
ref: C,
|
|
96
|
+
trigger: v.value,
|
|
97
|
+
config: z.value,
|
|
87
98
|
style: { zIndex: 9999 },
|
|
88
99
|
isOpen: !0,
|
|
89
100
|
"data-ulu-tour-ui": "true",
|
|
90
|
-
onClose:
|
|
91
|
-
},
|
|
92
|
-
default:
|
|
93
|
-
|
|
101
|
+
onClose: o[1] || (o[1] = (p) => n(s).stop())
|
|
102
|
+
}, F.value), _({
|
|
103
|
+
default: y(() => [
|
|
104
|
+
f.value ? (u(), a(i(f.value), d({
|
|
94
105
|
key: 0,
|
|
95
106
|
step: t.value,
|
|
96
|
-
tourState:
|
|
97
|
-
api:
|
|
107
|
+
tourState: n(l),
|
|
108
|
+
api: n(s),
|
|
98
109
|
"is-modal": !1
|
|
99
|
-
}, t.value.componentProps), null, 16, ["step", "tourState", "api"])) : (
|
|
110
|
+
}, t.value.componentProps), null, 16, ["step", "tourState", "api"])) : (u(), a(E, {
|
|
100
111
|
key: 1,
|
|
101
112
|
step: t.value,
|
|
102
113
|
"is-modal": !1
|
|
@@ -106,26 +117,26 @@ const W = {
|
|
|
106
117
|
}, [
|
|
107
118
|
t.value?.hideFooter ? void 0 : {
|
|
108
119
|
name: "footer",
|
|
109
|
-
fn:
|
|
110
|
-
(
|
|
120
|
+
fn: y(() => [
|
|
121
|
+
(u(), a(i(x.value)))
|
|
111
122
|
]),
|
|
112
123
|
key: "0"
|
|
113
124
|
}
|
|
114
|
-
]), 1040, ["trigger", "config"])) : (
|
|
125
|
+
]), 1040, ["trigger", "config"])) : (u(), a(i(T.value), d({
|
|
115
126
|
key: 1,
|
|
116
127
|
modelValue: !0,
|
|
117
128
|
"data-ulu-tour-ui": "true"
|
|
118
|
-
},
|
|
119
|
-
onClose:
|
|
120
|
-
}),
|
|
121
|
-
default:
|
|
122
|
-
|
|
129
|
+
}, L.value, {
|
|
130
|
+
onClose: o[0] || (o[0] = (p) => n(s).stop())
|
|
131
|
+
}), _({
|
|
132
|
+
default: y(() => [
|
|
133
|
+
f.value ? (u(), a(i(f.value), d({
|
|
123
134
|
key: 0,
|
|
124
135
|
step: t.value,
|
|
125
|
-
tourState:
|
|
126
|
-
api:
|
|
136
|
+
tourState: n(l),
|
|
137
|
+
api: n(s),
|
|
127
138
|
"is-modal": !0
|
|
128
|
-
}, t.value.componentProps), null, 16, ["step", "tourState", "api"])) : (
|
|
139
|
+
}, t.value.componentProps), null, 16, ["step", "tourState", "api"])) : (u(), a(E, {
|
|
129
140
|
key: 1,
|
|
130
141
|
step: t.value,
|
|
131
142
|
"is-modal": !0
|
|
@@ -135,23 +146,23 @@ const W = {
|
|
|
135
146
|
}, [
|
|
136
147
|
t.value?.hideFooter ? void 0 : {
|
|
137
148
|
name: "footer",
|
|
138
|
-
fn:
|
|
139
|
-
(
|
|
149
|
+
fn: y(() => [
|
|
150
|
+
(u(), a(i(x.value)))
|
|
140
151
|
]),
|
|
141
152
|
key: "0"
|
|
142
153
|
}
|
|
143
154
|
]), 1040)),
|
|
144
|
-
t.value?.target && t.value?.highlight &&
|
|
155
|
+
t.value?.target && t.value?.highlight && m.value ? (u(), P("div", {
|
|
145
156
|
key: 3,
|
|
146
157
|
class: "tour-highlight-backdrop",
|
|
147
|
-
style:
|
|
158
|
+
style: H(I.value),
|
|
148
159
|
"data-ulu-tour-ui": "true",
|
|
149
|
-
onClick:
|
|
150
|
-
}, null, 4)) :
|
|
151
|
-
], 64)) :
|
|
160
|
+
onClick: o[2] || (o[2] = (p) => n(s).stop())
|
|
161
|
+
}, null, 4)) : S("", !0)
|
|
162
|
+
], 64)) : S("", !0)
|
|
152
163
|
]));
|
|
153
164
|
}
|
|
154
165
|
};
|
|
155
166
|
export {
|
|
156
|
-
|
|
167
|
+
Z as default
|
|
157
168
|
};
|
|
@@ -4,6 +4,10 @@ export type TourStep = {
|
|
|
4
4
|
* - The CSS selector, DOM element, or function returning either, for the target element. If omitted or resolves to falsy, step renders as a modal.
|
|
5
5
|
*/
|
|
6
6
|
target?: string | Function | HTMLElement | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* - Element to highlight if different from target. Falls back to target if not provided.
|
|
9
|
+
*/
|
|
10
|
+
highlightElement?: string | Function | HTMLElement | undefined;
|
|
7
11
|
/**
|
|
8
12
|
* - The title text for the step.
|
|
9
13
|
*/
|
|
@@ -16,6 +20,10 @@ export type TourStep = {
|
|
|
16
20
|
* - Class to apply to the pager footer.
|
|
17
21
|
*/
|
|
18
22
|
pagerClass?: string | Object | any[] | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* - Class to apply to the progress indicator.
|
|
25
|
+
*/
|
|
26
|
+
progressClass?: string | Object | any[] | undefined;
|
|
19
27
|
/**
|
|
20
28
|
* - The content text for the step.
|
|
21
29
|
*/
|
|
@@ -36,6 +44,10 @@ export type TourStep = {
|
|
|
36
44
|
* - If true, hides the default tour footer (Next/Back buttons).
|
|
37
45
|
*/
|
|
38
46
|
hideFooter?: boolean | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* - If true, hides the "Part X / Y" progress indicator for this step.
|
|
49
|
+
*/
|
|
50
|
+
hideProgress?: boolean | undefined;
|
|
39
51
|
/**
|
|
40
52
|
* - Floating UI placement string (e.g. 'bottom', 'right').
|
|
41
53
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../lib/plugins/tour/api.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../lib/plugins/tour/api.js"],"names":[],"mappings":"AA8BO,iCAHI,MAAM,GACJ,MAAM,CAgJjB"}
|
package/dist/plugins/tour/api.js
CHANGED
|
@@ -10,6 +10,8 @@ const a = (n) => ({
|
|
|
10
10
|
* @param {String|Array|Object} [tour.modalTitleClass] - Global class applied to the title of modal steps.
|
|
11
11
|
* @param {String|Array|Object} [tour.popoverTitleClass] - Global class applied to the title of popover steps.
|
|
12
12
|
* @param {String|Array|Object} [tour.pagerClass] - Global class applied to the pager.
|
|
13
|
+
* @param {String|Array|Object} [tour.progressClass] - Global class applied to the progress indicator.
|
|
14
|
+
* @param {Boolean} [tour.hideProgress] - Globally hides the progress indicator for all steps unless overridden.
|
|
13
15
|
* @param {Function} [tour.onStart] - Async hook called before the tour starts.
|
|
14
16
|
* @param {Function} [tour.onStop] - Async hook called when the tour is closed/finished.
|
|
15
17
|
*/
|
|
@@ -2,13 +2,25 @@
|
|
|
2
2
|
<div class="tour-content crop-margins">
|
|
3
3
|
<component
|
|
4
4
|
v-if="step?.title"
|
|
5
|
+
class="tour-content__title"
|
|
5
6
|
:is="isModal ? 'h2' : 'strong'"
|
|
6
7
|
:class="resolvedTitleClass"
|
|
7
8
|
>
|
|
8
|
-
|
|
9
|
+
<span
|
|
10
|
+
v-if="showProgress"
|
|
11
|
+
class="tour-content__title-progress"
|
|
12
|
+
:class="resolvedProgressClass"
|
|
13
|
+
>
|
|
14
|
+
Part {{ currentProgress }} / {{ totalProgress }}
|
|
15
|
+
</span>
|
|
16
|
+
<span class="hidden-visually">:</span>
|
|
17
|
+
<span class="tour-content__title-text">{{ step.title }}</span>
|
|
9
18
|
</component>
|
|
10
19
|
<UluRule />
|
|
11
|
-
<p
|
|
20
|
+
<p
|
|
21
|
+
class="tour-content__body"
|
|
22
|
+
v-if="step?.content"
|
|
23
|
+
>
|
|
12
24
|
{{ step.content }}
|
|
13
25
|
</p>
|
|
14
26
|
</div>
|
|
@@ -47,4 +59,22 @@
|
|
|
47
59
|
return tourState.active?.popoverTitleClass || ['h4', 'display-block', 'no-margin'];
|
|
48
60
|
}
|
|
49
61
|
});
|
|
62
|
+
|
|
63
|
+
const resolvedProgressClass = computed(() => {
|
|
64
|
+
return props.step.progressClass || tourState.active?.progressClass || 'headline-label';
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const currentProgress = computed(() => tourState.stepIndex + 1);
|
|
68
|
+
|
|
69
|
+
const totalProgress = computed(() => tourState.active?.steps?.length || 0);
|
|
70
|
+
|
|
71
|
+
const showProgress = computed(() => {
|
|
72
|
+
if (props.step.hideProgress !== undefined) {
|
|
73
|
+
return !props.step.hideProgress;
|
|
74
|
+
}
|
|
75
|
+
if (tourState.active?.hideProgress !== undefined) {
|
|
76
|
+
return !tourState.active.hideProgress;
|
|
77
|
+
}
|
|
78
|
+
return true;
|
|
79
|
+
});
|
|
50
80
|
</script>
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
</template>
|
|
81
81
|
|
|
82
82
|
<script setup>
|
|
83
|
-
import { ref, computed, watch, nextTick, onMounted, onUnmounted } from 'vue';
|
|
83
|
+
import { ref, computed, watch, nextTick, onMounted, onUnmounted, unref } from 'vue';
|
|
84
84
|
import UluModal from '../../components/collapsible/UluModal.vue';
|
|
85
85
|
import UluPopoverBase from '../popovers/UluPopoverBase.vue';
|
|
86
86
|
import UluTourPager from './UluTourPager.vue';
|
|
@@ -100,14 +100,21 @@
|
|
|
100
100
|
|
|
101
101
|
// Floating UI Setup for Popovers
|
|
102
102
|
const targetEl = ref(null);
|
|
103
|
+
const highlightEl = ref(null);
|
|
103
104
|
const popoverBase = ref(null);
|
|
104
105
|
|
|
105
106
|
const resolvedTargetDescriptor = computed(() => {
|
|
106
|
-
const t = currentStep.value?.target;
|
|
107
|
-
if (typeof t === 'function') return t();
|
|
107
|
+
const t = unref(currentStep.value?.target);
|
|
108
|
+
if (typeof t === 'function') return unref(t());
|
|
108
109
|
return t;
|
|
109
110
|
});
|
|
110
111
|
|
|
112
|
+
const resolvedHighlightDescriptor = computed(() => {
|
|
113
|
+
const h = unref(currentStep.value?.highlightElement);
|
|
114
|
+
if (typeof h === 'function') return unref(h());
|
|
115
|
+
return h;
|
|
116
|
+
});
|
|
117
|
+
|
|
111
118
|
const resolvedConfig = computed(() => ({
|
|
112
119
|
placement: currentStep.value?.placement || 'bottom',
|
|
113
120
|
arrow: true,
|
|
@@ -134,8 +141,9 @@
|
|
|
134
141
|
const targetRect = ref(null);
|
|
135
142
|
|
|
136
143
|
const updateTargetRect = () => {
|
|
137
|
-
|
|
138
|
-
|
|
144
|
+
const el = highlightEl.value || targetEl.value;
|
|
145
|
+
if (el) {
|
|
146
|
+
const rect = el.getBoundingClientRect();
|
|
139
147
|
targetRect.value = {
|
|
140
148
|
top: rect.top,
|
|
141
149
|
left: rect.left,
|
|
@@ -175,11 +183,11 @@
|
|
|
175
183
|
};
|
|
176
184
|
});
|
|
177
185
|
|
|
178
|
-
// Watch for step changes to update floating UI target
|
|
179
|
-
watch(resolvedTargetDescriptor, async (
|
|
180
|
-
if (
|
|
186
|
+
// Watch for step changes to update floating UI target and highlight target
|
|
187
|
+
watch([resolvedTargetDescriptor, resolvedHighlightDescriptor], async ([targetDesc, highlightDesc]) => {
|
|
188
|
+
if (targetDesc) {
|
|
181
189
|
await nextTick();
|
|
182
|
-
const el = typeof
|
|
190
|
+
const el = typeof targetDesc === 'string' ? document.querySelector(targetDesc) : unref(targetDesc);
|
|
183
191
|
if (el) {
|
|
184
192
|
targetEl.value = el;
|
|
185
193
|
// UluPopoverBase's isOpen watcher automatically calls update(),
|
|
@@ -188,16 +196,29 @@
|
|
|
188
196
|
if (popoverBase.value) {
|
|
189
197
|
popoverBase.value.update();
|
|
190
198
|
}
|
|
191
|
-
if (currentStep.value?.highlight) {
|
|
192
|
-
updateTargetRect();
|
|
193
|
-
}
|
|
194
199
|
} else {
|
|
195
|
-
console.warn(`Tour target not found:`,
|
|
200
|
+
console.warn(`Tour target not found:`, targetDesc);
|
|
196
201
|
targetEl.value = null;
|
|
197
202
|
}
|
|
198
203
|
} else {
|
|
199
204
|
targetEl.value = null;
|
|
200
|
-
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (highlightDesc) {
|
|
208
|
+
await nextTick();
|
|
209
|
+
const hEl = typeof highlightDesc === 'string' ? document.querySelector(highlightDesc) : unref(highlightDesc);
|
|
210
|
+
if (hEl) {
|
|
211
|
+
highlightEl.value = hEl;
|
|
212
|
+
} else {
|
|
213
|
+
console.warn(`Tour highlight element not found:`, highlightDesc);
|
|
214
|
+
highlightEl.value = null;
|
|
215
|
+
}
|
|
216
|
+
} else {
|
|
217
|
+
highlightEl.value = null;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (currentStep.value?.highlight) {
|
|
221
|
+
updateTargetRect();
|
|
201
222
|
}
|
|
202
223
|
}, { immediate: true });
|
|
203
224
|
|
package/lib/plugins/tour/api.js
CHANGED
|
@@ -3,14 +3,17 @@ import { markRaw } from "vue";
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef {Object} TourStep
|
|
5
5
|
* @property {String|Function|HTMLElement} [target] - The CSS selector, DOM element, or function returning either, for the target element. If omitted or resolves to falsy, step renders as a modal.
|
|
6
|
+
* @property {String|Function|HTMLElement} [highlightElement] - Element to highlight if different from target. Falls back to target if not provided.
|
|
6
7
|
* @property {String} [title] - The title text for the step.
|
|
7
8
|
* @property {String|Array|Object} [titleClass] - Class to apply to the title.
|
|
8
9
|
* @property {String|Array|Object} [pagerClass] - Class to apply to the pager footer.
|
|
10
|
+
* @property {String|Array|Object} [progressClass] - Class to apply to the progress indicator.
|
|
9
11
|
* @property {String} [content] - The content text for the step.
|
|
10
12
|
* @property {Object} [component] - A Vue component to completely replace the modal/popover wrapper and layout.
|
|
11
13
|
* @property {Object} [contentComponent] - A Vue component to replace the step text content, keeping the modal/popover wrappers and default footer.
|
|
12
14
|
* @property {Object} [componentProps] - Props to bind to the custom component.
|
|
13
15
|
* @property {Boolean} [hideFooter] - If true, hides the default tour footer (Next/Back buttons).
|
|
16
|
+
* @property {Boolean} [hideProgress] - If true, hides the "Part X / Y" progress indicator for this step.
|
|
14
17
|
* @property {String} [placement] - Floating UI placement string (e.g. 'bottom', 'right').
|
|
15
18
|
* @property {Boolean} [highlight] - If true, darkens the backdrop around the target element.
|
|
16
19
|
* @property {Boolean|Function} [skip] - If true or returns true, this step will be skipped when navigating the tour.
|
|
@@ -36,6 +39,8 @@ export const createApi = (state) => ({
|
|
|
36
39
|
* @param {String|Array|Object} [tour.modalTitleClass] - Global class applied to the title of modal steps.
|
|
37
40
|
* @param {String|Array|Object} [tour.popoverTitleClass] - Global class applied to the title of popover steps.
|
|
38
41
|
* @param {String|Array|Object} [tour.pagerClass] - Global class applied to the pager.
|
|
42
|
+
* @param {String|Array|Object} [tour.progressClass] - Global class applied to the progress indicator.
|
|
43
|
+
* @param {Boolean} [tour.hideProgress] - Globally hides the progress indicator for all steps unless overridden.
|
|
39
44
|
* @param {Function} [tour.onStart] - Async hook called before the tour starts.
|
|
40
45
|
* @param {Function} [tour.onStop] - Async hook called when the tour is closed/finished.
|
|
41
46
|
*/
|
package/package.json
CHANGED