v-tutorial 0.0.0-stage → 1.0.0
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/README.md +339 -2
- package/README.pt-BR.md +341 -0
- package/dist/TutorialProvider.vue.d.ts +224 -0
- package/dist/TutorialStep.vue.d.ts +66 -0
- package/dist/domResolver.d.ts +12 -0
- package/dist/index.d.ts +25 -0
- package/dist/keys.d.ts +3 -0
- package/dist/positioning.d.ts +23 -0
- package/dist/responsive.d.ts +5 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +152 -0
- package/dist/useTutorial.d.ts +180 -0
- package/dist/v-tutorial.js +1214 -0
- package/dist/v-tutorial.umd.cjs +1 -0
- package/package.json +88 -3
|
@@ -0,0 +1,1214 @@
|
|
|
1
|
+
import { ref as W, getCurrentScope as Re, onScopeDispose as De, nextTick as re, watch as se, computed as x, defineComponent as ut, provide as $t, onMounted as ct, onUnmounted as dt, openBlock as T, createElementBlock as I, Fragment as nt, renderSlot as H, createBlock as We, Teleport as vt, createVNode as Lt, Transition as Rt, withCtx as Dt, unref as m, normalizeClass as y, normalizeProps as ee, guardReactiveProps as te, createElementVNode as f, normalizeStyle as Y, mergeProps as it, createCommentVNode as ae, toDisplayString as G, resolveDynamicComponent as It, withModifiers as Ie, inject as Wt } from "vue";
|
|
2
|
+
const rt = [
|
|
3
|
+
"xs",
|
|
4
|
+
"sm",
|
|
5
|
+
"md",
|
|
6
|
+
"lg",
|
|
7
|
+
"xl",
|
|
8
|
+
"xxl"
|
|
9
|
+
], ft = {
|
|
10
|
+
xs: 0,
|
|
11
|
+
sm: 576,
|
|
12
|
+
md: 768,
|
|
13
|
+
lg: 992,
|
|
14
|
+
xl: 1200,
|
|
15
|
+
xxl: 1400
|
|
16
|
+
};
|
|
17
|
+
function Xt(a, t) {
|
|
18
|
+
return a >= t.xxl ? "xxl" : a >= t.xl ? "xl" : a >= t.lg ? "lg" : a >= t.md ? "md" : a >= t.sm ? "sm" : "xs";
|
|
19
|
+
}
|
|
20
|
+
function Nt(a, t) {
|
|
21
|
+
var s;
|
|
22
|
+
const e = { ...a }, r = rt.indexOf(t), n = {
|
|
23
|
+
sm: a.targetSm,
|
|
24
|
+
md: a.targetMd,
|
|
25
|
+
lg: a.targetLg,
|
|
26
|
+
xl: a.targetXl,
|
|
27
|
+
xxl: a.targetXxl
|
|
28
|
+
}, i = {
|
|
29
|
+
sm: a.placementSm,
|
|
30
|
+
md: a.placementMd,
|
|
31
|
+
lg: a.placementLg,
|
|
32
|
+
xl: a.placementXl,
|
|
33
|
+
xxl: a.placementXxl
|
|
34
|
+
};
|
|
35
|
+
for (let l = 0; l <= r; l++) {
|
|
36
|
+
const p = rt[l], o = (s = a.breakpoints) == null ? void 0 : s[p];
|
|
37
|
+
o && (o.disabled !== void 0 && (e.disabled = o.disabled), o.target !== void 0 && (e.target = o.target), o.title !== void 0 && (e.title = o.title), o.content !== void 0 && (e.content = o.content), o.mode !== void 0 && (e.mode = o.mode), o.placement !== void 0 && (e.placement = o.placement), o.hintText !== void 0 && (e.hintText = o.hintText), o.spotlightPadding !== void 0 && (e.spotlightPadding = o.spotlightPadding), o.cardWidth !== void 0 && (e.cardWidth = o.cardWidth), o.autoScroll !== void 0 && (e.autoScroll = o.autoScroll), o.route !== void 0 && (e.route = o.route), o.rollbackRoute !== void 0 && (e.rollbackRoute = o.rollbackRoute), o.enterActions !== void 0 && (e.enterActions = o.enterActions), o.rollbackActions !== void 0 && (e.rollbackActions = o.rollbackActions), o.leaveActions !== void 0 && (e.leaveActions = o.leaveActions)), n[p] !== void 0 && (e.target = n[p]), i[p] !== void 0 && (e.placement = i[p]);
|
|
38
|
+
}
|
|
39
|
+
return e;
|
|
40
|
+
}
|
|
41
|
+
const q = /* @__PURE__ */ new Map();
|
|
42
|
+
function fe(a) {
|
|
43
|
+
if (!a || typeof document > "u" || !document.body.contains(a)) return !1;
|
|
44
|
+
const t = a.getBoundingClientRect();
|
|
45
|
+
return t.width > 0 && t.height > 0;
|
|
46
|
+
}
|
|
47
|
+
function Vt(a) {
|
|
48
|
+
if (!a || typeof document > "u") return null;
|
|
49
|
+
const t = q.get(a);
|
|
50
|
+
if (t && fe(t.el))
|
|
51
|
+
return t.el;
|
|
52
|
+
const r = Array.from(
|
|
53
|
+
document.querySelectorAll(`[data-tutorial-id="${a}"]`)
|
|
54
|
+
).find((s) => fe(s));
|
|
55
|
+
if (r) return r;
|
|
56
|
+
const n = a.replace(/^#/, ""), i = document.getElementById(n);
|
|
57
|
+
if (fe(i)) return i;
|
|
58
|
+
try {
|
|
59
|
+
const s = Array.from(document.querySelectorAll(a)), l = s.find((p) => fe(p));
|
|
60
|
+
return l || s[0] || null;
|
|
61
|
+
} catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function Ae(a) {
|
|
66
|
+
if (!a || !a.target || a.placement === "center") return [];
|
|
67
|
+
const t = Array.isArray(a.target) ? a.target : [a.target], e = [];
|
|
68
|
+
for (const r of t) {
|
|
69
|
+
const n = Vt(r);
|
|
70
|
+
n && e.push(n);
|
|
71
|
+
}
|
|
72
|
+
return e;
|
|
73
|
+
}
|
|
74
|
+
function Xe(a) {
|
|
75
|
+
const t = Ae(a);
|
|
76
|
+
return t.find((r) => fe(r)) || t[0] || null;
|
|
77
|
+
}
|
|
78
|
+
function Ht(a) {
|
|
79
|
+
const t = Ae(a);
|
|
80
|
+
if (!t.length) return null;
|
|
81
|
+
const e = t.map((l) => l.getBoundingClientRect()).filter((l) => l.width > 0 && l.height > 0);
|
|
82
|
+
if (!e.length) return null;
|
|
83
|
+
if (e.length === 1) return e[0];
|
|
84
|
+
const r = Math.min(...e.map((l) => l.left)), n = Math.min(...e.map((l) => l.top)), i = Math.max(...e.map((l) => l.right)), s = Math.max(...e.map((l) => l.bottom));
|
|
85
|
+
return new DOMRect(r, n, i - r, s - n);
|
|
86
|
+
}
|
|
87
|
+
async function qt(a, t, e = "smooth") {
|
|
88
|
+
if (!t) return;
|
|
89
|
+
const r = a.getBoundingClientRect(), n = 70;
|
|
90
|
+
if (!(r.top >= n && r.left >= 0 && r.bottom <= window.innerHeight - n && r.right <= window.innerWidth))
|
|
91
|
+
try {
|
|
92
|
+
a.scrollIntoView({
|
|
93
|
+
behavior: e,
|
|
94
|
+
block: "center",
|
|
95
|
+
inline: "nearest"
|
|
96
|
+
}), await new Promise((s) => setTimeout(s, 220));
|
|
97
|
+
} catch {
|
|
98
|
+
a.scrollIntoView();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async function Ft(a, t, e = "smooth", r = 1200) {
|
|
102
|
+
if (!a || !a.target || a.placement === "center") return null;
|
|
103
|
+
const n = Date.now();
|
|
104
|
+
for (; Date.now() - n < r; ) {
|
|
105
|
+
const i = Xe(a);
|
|
106
|
+
if (i) {
|
|
107
|
+
const s = i.getBoundingClientRect();
|
|
108
|
+
if (s.width > 0 && s.height > 0)
|
|
109
|
+
return await qt(i, t, e), i;
|
|
110
|
+
}
|
|
111
|
+
await new Promise((s) => setTimeout(s, 40));
|
|
112
|
+
}
|
|
113
|
+
return Xe(a);
|
|
114
|
+
}
|
|
115
|
+
const Q = W(!1), Ve = W([]), U = W([]), A = W(0), E = W(!1), he = W("start"), ue = W(typeof window < "u" ? window.innerWidth : 1024);
|
|
116
|
+
let be;
|
|
117
|
+
const F = W({
|
|
118
|
+
storageKey: "v-tutorial-completed",
|
|
119
|
+
autoScroll: !0,
|
|
120
|
+
scrollBehavior: "smooth",
|
|
121
|
+
spotlightPadding: 6,
|
|
122
|
+
cardWidth: 370,
|
|
123
|
+
showArrow: !0,
|
|
124
|
+
unstyled: !1,
|
|
125
|
+
mobileSheetOnAuto: !0,
|
|
126
|
+
breakpoints: { ...ft }
|
|
127
|
+
}), pt = /* @__PURE__ */ new Map(), xe = /* @__PURE__ */ new Set(), ke = /* @__PURE__ */ new Set(), pe = /* @__PURE__ */ new Set(), He = x(() => ({
|
|
128
|
+
...ft,
|
|
129
|
+
...F.value.breakpoints || {}
|
|
130
|
+
})), Te = x(
|
|
131
|
+
() => Xt(ue.value, He.value)
|
|
132
|
+
), ht = x(() => ue.value < He.value.md), Kt = x(
|
|
133
|
+
() => U.value.length > 0 ? U.value : Ve.value
|
|
134
|
+
), S = x(() => {
|
|
135
|
+
const a = Te.value;
|
|
136
|
+
return Kt.value.map((t) => Nt(t, a)).filter((t) => !t.disabled);
|
|
137
|
+
}), J = x(
|
|
138
|
+
() => S.value[A.value] || null
|
|
139
|
+
), mt = x(() => S.value.length), gt = x(() => A.value <= 0), wt = x(
|
|
140
|
+
() => S.value.length > 0 && A.value === S.value.length - 1
|
|
141
|
+
), yt = x(() => S.value.length ? Math.round((A.value + 1) / S.value.length * 100) : 0), me = x(
|
|
142
|
+
() => F.value.storageKey || "v-tutorial-completed"
|
|
143
|
+
);
|
|
144
|
+
async function ie(a, ...t) {
|
|
145
|
+
try {
|
|
146
|
+
const e = pt.get(a);
|
|
147
|
+
if (e) return await e(...t);
|
|
148
|
+
} catch (e) {
|
|
149
|
+
console.warn(`[v-tutorial] Erro ao executar ação "${a}":`, e);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
async function le(a) {
|
|
153
|
+
if (a) {
|
|
154
|
+
if (Array.isArray(a)) {
|
|
155
|
+
for (const t of a)
|
|
156
|
+
await ie(t);
|
|
157
|
+
await re();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
for (const [t, e] of Object.entries(a))
|
|
161
|
+
Array.isArray(e) ? await ie(t, ...e) : e === void 0 ? await ie(t) : await ie(t, e);
|
|
162
|
+
await re();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async function Ne(a) {
|
|
166
|
+
var t, e;
|
|
167
|
+
if (!(!a || !be))
|
|
168
|
+
try {
|
|
169
|
+
const r = (e = (t = be.currentRoute) == null ? void 0 : t.value) == null ? void 0 : e.path;
|
|
170
|
+
r && r !== a && (await be.push(a), await re());
|
|
171
|
+
} catch (r) {
|
|
172
|
+
console.warn(`[v-tutorial] Erro ao navegar para rota "${a}":`, r);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function K(a = he.value) {
|
|
176
|
+
return {
|
|
177
|
+
currentStepIndex: A.value,
|
|
178
|
+
currentStep: J.value,
|
|
179
|
+
totalSteps: mt.value,
|
|
180
|
+
progress: yt.value,
|
|
181
|
+
isFirstStep: gt.value,
|
|
182
|
+
isLastStep: wt.value,
|
|
183
|
+
direction: a,
|
|
184
|
+
activeBreakpoint: Te.value,
|
|
185
|
+
viewportWidth: ue.value,
|
|
186
|
+
isMobileViewport: ht.value,
|
|
187
|
+
nextStep: Se,
|
|
188
|
+
prevStep: bt,
|
|
189
|
+
goToStep: Ce,
|
|
190
|
+
endTutorial: At,
|
|
191
|
+
restartTutorial: kt,
|
|
192
|
+
runRegisteredAction: ie,
|
|
193
|
+
runActionMap: le
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
async function qe(a, t = 1200) {
|
|
197
|
+
if (!a || !a.target || a.placement === "center") return null;
|
|
198
|
+
const e = a.autoScroll ?? F.value.autoScroll ?? !0, r = F.value.scrollBehavior || "smooth";
|
|
199
|
+
return Ft(a, e, r, t);
|
|
200
|
+
}
|
|
201
|
+
async function Ce(a, t = "forward") {
|
|
202
|
+
const e = typeof a == "number" ? a : S.value.findIndex((n) => n.id === a);
|
|
203
|
+
if (e < 0 || e >= S.value.length) return;
|
|
204
|
+
E.value = !0, he.value = t;
|
|
205
|
+
try {
|
|
206
|
+
const n = S.value[A.value];
|
|
207
|
+
n && Q.value && A.value !== e && (n.leaveActions && await le(n.leaveActions), n.afterLeave && await n.afterLeave(K(t))), A.value = e;
|
|
208
|
+
const i = S.value[e], s = K(t);
|
|
209
|
+
t === "backward" && ((i != null && i.rollbackRoute || i != null && i.route) && await Ne(i.rollbackRoute || i.route), i != null && i.rollbackActions && await le(i.rollbackActions), i != null && i.onRollback && await i.onRollback(s)), i != null && i.route && await Ne(i.route), i != null && i.enterActions && await le(i.enterActions), i != null && i.beforeEnter && await i.beforeEnter(s), await re(), await qe(i);
|
|
210
|
+
} catch (n) {
|
|
211
|
+
console.error("[v-tutorial] Erro durante transição de passo:", n);
|
|
212
|
+
} finally {
|
|
213
|
+
E.value = !1;
|
|
214
|
+
}
|
|
215
|
+
const r = K(t);
|
|
216
|
+
pe.forEach((n) => n(r));
|
|
217
|
+
}
|
|
218
|
+
async function Se() {
|
|
219
|
+
E.value || (A.value < S.value.length - 1 ? await Ce(A.value + 1, "forward") : St());
|
|
220
|
+
}
|
|
221
|
+
async function bt() {
|
|
222
|
+
E.value || A.value > 0 && await Ce(A.value - 1, "backward");
|
|
223
|
+
}
|
|
224
|
+
function jt(a) {
|
|
225
|
+
Ve.value = a;
|
|
226
|
+
}
|
|
227
|
+
function _t(a) {
|
|
228
|
+
const t = U.value.findIndex((e) => e.id === a.id);
|
|
229
|
+
t >= 0 ? U.value[t] = a : U.value.push(a);
|
|
230
|
+
}
|
|
231
|
+
function Ut(a) {
|
|
232
|
+
const t = U.value.findIndex((e) => e.id === a.id);
|
|
233
|
+
t >= 0 && (U.value[t] = a);
|
|
234
|
+
}
|
|
235
|
+
function zt(a) {
|
|
236
|
+
U.value = U.value.filter((t) => t.id !== a);
|
|
237
|
+
}
|
|
238
|
+
function st(a) {
|
|
239
|
+
a.router && (be = a.router);
|
|
240
|
+
const { router: t, ...e } = a;
|
|
241
|
+
F.value = {
|
|
242
|
+
...F.value,
|
|
243
|
+
...e,
|
|
244
|
+
breakpoints: {
|
|
245
|
+
...F.value.breakpoints,
|
|
246
|
+
...e.breakpoints
|
|
247
|
+
},
|
|
248
|
+
labels: {
|
|
249
|
+
...F.value.labels,
|
|
250
|
+
...e.labels
|
|
251
|
+
},
|
|
252
|
+
classes: {
|
|
253
|
+
...F.value.classes,
|
|
254
|
+
...e.classes
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
async function xt(a, t = !1) {
|
|
259
|
+
if (typeof window < "u" && (ue.value = window.innerWidth), a && a.length > 0 && (Ve.value = a), !(!t && typeof window < "u" && localStorage.getItem(me.value) === "true") && S.value.length) {
|
|
260
|
+
Q.value = !0, A.value = 0, he.value = "start", E.value = !0;
|
|
261
|
+
try {
|
|
262
|
+
const e = S.value[0], r = K("start");
|
|
263
|
+
e != null && e.route && await Ne(e.route), e != null && e.enterActions && await le(e.enterActions), e != null && e.beforeEnter && await e.beforeEnter(r), await re(), await qe(e);
|
|
264
|
+
} catch (e) {
|
|
265
|
+
console.error("[v-tutorial] Erro ao iniciar tutorial:", e);
|
|
266
|
+
} finally {
|
|
267
|
+
E.value = !1;
|
|
268
|
+
}
|
|
269
|
+
pe.forEach((e) => e(K("start")));
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
async function kt() {
|
|
273
|
+
typeof window < "u" && localStorage.removeItem(me.value), await xt(void 0, !0);
|
|
274
|
+
}
|
|
275
|
+
function St() {
|
|
276
|
+
typeof window < "u" && localStorage.setItem(me.value, "true"), E.value = !1, Q.value = !1;
|
|
277
|
+
const a = K("forward");
|
|
278
|
+
xe.forEach((t) => t(a));
|
|
279
|
+
}
|
|
280
|
+
function At(a = !0) {
|
|
281
|
+
a && typeof window < "u" && localStorage.setItem(me.value, "true"), E.value = !1, Q.value = !1;
|
|
282
|
+
const t = K(he.value);
|
|
283
|
+
ke.forEach((e) => e(t));
|
|
284
|
+
}
|
|
285
|
+
async function Ot(a) {
|
|
286
|
+
if (!Q.value || E.value) return;
|
|
287
|
+
const t = J.value;
|
|
288
|
+
if (!t || !t.target || t.placement === "center") return;
|
|
289
|
+
const e = Ae(t), r = a.target;
|
|
290
|
+
if (!r || !e.length) return;
|
|
291
|
+
const n = e.find((o) => o.contains(r));
|
|
292
|
+
if (!n) return;
|
|
293
|
+
const i = n.getAttribute("data-tutorial-id") || "", s = q.get(i);
|
|
294
|
+
(t.preventNativeClick ?? (s == null ? void 0 : s.config.preventNativeClick) ?? !1) && (a.preventDefault(), a.stopPropagation(), a.stopImmediatePropagation());
|
|
295
|
+
const p = K("forward");
|
|
296
|
+
if (s != null && s.config.onTutorialClick && await s.config.onTutorialClick(a, p), t.onTargetClick && await t.onTargetClick(a, p), t.mode === "wait-click" || t.mode === "optional-click") {
|
|
297
|
+
E.value = !0;
|
|
298
|
+
const o = t.afterClickDelay ?? 280;
|
|
299
|
+
setTimeout(async () => {
|
|
300
|
+
try {
|
|
301
|
+
t.afterClick && await t.afterClick(K("forward"));
|
|
302
|
+
} finally {
|
|
303
|
+
E.value = !1;
|
|
304
|
+
}
|
|
305
|
+
await Se();
|
|
306
|
+
}, o);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
typeof window < "u" && (window.addEventListener("click", Ot, !0), window.addEventListener(
|
|
310
|
+
"resize",
|
|
311
|
+
() => {
|
|
312
|
+
ue.value = window.innerWidth;
|
|
313
|
+
},
|
|
314
|
+
{ passive: !0 }
|
|
315
|
+
));
|
|
316
|
+
se(Te, async () => {
|
|
317
|
+
if (!Q.value || E.value) return;
|
|
318
|
+
A.value >= S.value.length && (A.value = Math.max(0, S.value.length - 1));
|
|
319
|
+
const a = J.value;
|
|
320
|
+
a != null && a.enterActions && await le(a.enterActions), await qe(a, 600);
|
|
321
|
+
});
|
|
322
|
+
function Fe(a) {
|
|
323
|
+
a && st(a);
|
|
324
|
+
function t(l, p) {
|
|
325
|
+
const o = typeof p == "string" ? { id: p } : p, g = (h) => {
|
|
326
|
+
h ? (h.setAttribute("data-tutorial-id", o.id), q.set(o.id, { el: h, config: o })) : q.delete(o.id);
|
|
327
|
+
};
|
|
328
|
+
"value" in l ? se(l, (h) => g(h), { immediate: !0 }) : g(l);
|
|
329
|
+
}
|
|
330
|
+
function e(l, p, o) {
|
|
331
|
+
return async (...g) => {
|
|
332
|
+
var h, u, P, b;
|
|
333
|
+
if (Q.value) {
|
|
334
|
+
const $ = Array.isArray((h = J.value) == null ? void 0 : h.target) ? (u = J.value) == null ? void 0 : u.target : [(P = J.value) == null ? void 0 : P.target], L = ((b = J.value) == null ? void 0 : b.id) === l || $.includes(l);
|
|
335
|
+
o != null && o.tutorialFn && await o.tutorialFn(...g), o != null && o.preventNativeWhenActive || await p(...g), L && ((o == null ? void 0 : o.autoAdvance) ?? !0) && await Se();
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
return p(...g);
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
function r(l, p) {
|
|
342
|
+
pt.set(l, p);
|
|
343
|
+
}
|
|
344
|
+
function n(l) {
|
|
345
|
+
return xe.add(l), Re() && De(() => xe.delete(l)), () => xe.delete(l);
|
|
346
|
+
}
|
|
347
|
+
function i(l) {
|
|
348
|
+
return ke.add(l), Re() && De(() => ke.delete(l)), () => ke.delete(l);
|
|
349
|
+
}
|
|
350
|
+
function s(l) {
|
|
351
|
+
return pe.add(l), Re() && De(() => pe.delete(l)), () => pe.delete(l);
|
|
352
|
+
}
|
|
353
|
+
return {
|
|
354
|
+
isActive: Q,
|
|
355
|
+
steps: S,
|
|
356
|
+
currentStepIndex: A,
|
|
357
|
+
currentStep: J,
|
|
358
|
+
totalSteps: mt,
|
|
359
|
+
progress: yt,
|
|
360
|
+
isFirstStep: gt,
|
|
361
|
+
isLastStep: wt,
|
|
362
|
+
isTransitioning: E,
|
|
363
|
+
lastDirection: he,
|
|
364
|
+
activeBreakpoint: Te,
|
|
365
|
+
viewportWidth: ue,
|
|
366
|
+
isMobileViewport: ht,
|
|
367
|
+
mergedBreakpoints: He,
|
|
368
|
+
storageKey: me,
|
|
369
|
+
globalOptions: F,
|
|
370
|
+
configureTutorial: st,
|
|
371
|
+
registerSteps: jt,
|
|
372
|
+
registerDeclarativeStep: _t,
|
|
373
|
+
updateDeclarativeStep: Ut,
|
|
374
|
+
unregisterDeclarativeStep: zt,
|
|
375
|
+
startTutorial: xt,
|
|
376
|
+
restartTutorial: kt,
|
|
377
|
+
nextStep: Se,
|
|
378
|
+
prevStep: bt,
|
|
379
|
+
goToStep: Ce,
|
|
380
|
+
endTutorial: At,
|
|
381
|
+
completeTutorial: St,
|
|
382
|
+
resolveStepElement: Xe,
|
|
383
|
+
resolveStepElements: Ae,
|
|
384
|
+
getStepBoundingRect: Ht,
|
|
385
|
+
registerTarget: t,
|
|
386
|
+
wrapTutorialAction: e,
|
|
387
|
+
registerAction: r,
|
|
388
|
+
runRegisteredAction: ie,
|
|
389
|
+
runActionMap: le,
|
|
390
|
+
onFinish: n,
|
|
391
|
+
onStop: i,
|
|
392
|
+
onStepChange: s,
|
|
393
|
+
getContext: K
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
const Yt = {
|
|
397
|
+
mounted(a, t) {
|
|
398
|
+
if (!t.value) return;
|
|
399
|
+
const e = typeof t.value == "string" ? { id: t.value } : t.value;
|
|
400
|
+
e != null && e.id && (a.setAttribute("data-tutorial-id", e.id), q.set(e.id, { el: a, config: e }));
|
|
401
|
+
},
|
|
402
|
+
updated(a, t) {
|
|
403
|
+
if (!t.value) {
|
|
404
|
+
const r = a.getAttribute("data-tutorial-id");
|
|
405
|
+
if (r) {
|
|
406
|
+
const n = q.get(r);
|
|
407
|
+
(n == null ? void 0 : n.el) === a && q.delete(r), a.removeAttribute("data-tutorial-id");
|
|
408
|
+
}
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
const e = typeof t.value == "string" ? { id: t.value } : t.value;
|
|
412
|
+
e != null && e.id && (a.setAttribute("data-tutorial-id", e.id), q.set(e.id, { el: a, config: e }));
|
|
413
|
+
},
|
|
414
|
+
unmounted(a, t) {
|
|
415
|
+
var r;
|
|
416
|
+
const e = typeof t.value == "string" ? t.value : ((r = t.value) == null ? void 0 : r.id) || a.getAttribute("data-tutorial-id");
|
|
417
|
+
if (e) {
|
|
418
|
+
const n = q.get(e);
|
|
419
|
+
(n == null ? void 0 : n.el) === a && q.delete(e);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
function Gt(a) {
|
|
424
|
+
const {
|
|
425
|
+
hasTargetBox: t,
|
|
426
|
+
spotlightBox: e,
|
|
427
|
+
viewportW: r,
|
|
428
|
+
viewportH: n,
|
|
429
|
+
maxCardW: i,
|
|
430
|
+
cardHeight: s,
|
|
431
|
+
requestedPlacement: l,
|
|
432
|
+
isMobileViewport: p,
|
|
433
|
+
useMobileSheet: o
|
|
434
|
+
} = a, g = Math.min(i, r - 24);
|
|
435
|
+
if (!t)
|
|
436
|
+
return {
|
|
437
|
+
resolvedPlacement: "center",
|
|
438
|
+
cardStyle: {
|
|
439
|
+
top: "50%",
|
|
440
|
+
left: "50%",
|
|
441
|
+
width: `${g}px`,
|
|
442
|
+
transform: "translate(-50%, -50%)"
|
|
443
|
+
},
|
|
444
|
+
arrowStyle: null
|
|
445
|
+
};
|
|
446
|
+
const h = 14;
|
|
447
|
+
let u = l || "auto";
|
|
448
|
+
const P = r - (e.x + e.width), b = e.x, $ = n - (e.y + e.height), L = e.y;
|
|
449
|
+
if (p && o && (u === "auto" || u === "left" || u === "right") && (u = $ >= L ? "bottom-sheet" : "top-sheet"), u === "top-sheet" || u === "bottom-sheet") {
|
|
450
|
+
const M = Math.min(r - 20, 440), X = Math.round((r - M) / 2), N = 12, Z = N + s, Pe = n - 12 - s, Be = n - 12, ge = e.y < Z + 10 && e.y + e.height > N - 10, we = e.y < Be + 10 && e.y + e.height > Pe - 10;
|
|
451
|
+
if (u === "top-sheet" && ge) {
|
|
452
|
+
if (!we)
|
|
453
|
+
u = "bottom-sheet";
|
|
454
|
+
else if ($ >= L) {
|
|
455
|
+
const d = Math.min(n - s - 10, e.y + e.height + 12);
|
|
456
|
+
return {
|
|
457
|
+
resolvedPlacement: "bottom",
|
|
458
|
+
cardStyle: {
|
|
459
|
+
top: `${Math.max(12, d)}px`,
|
|
460
|
+
left: `${X}px`,
|
|
461
|
+
bottom: "auto",
|
|
462
|
+
width: `${M}px`,
|
|
463
|
+
transform: "none"
|
|
464
|
+
},
|
|
465
|
+
arrowStyle: {
|
|
466
|
+
left: `${Math.max(24, Math.min(M - 24, e.x + e.width / 2 - X))}px`
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (u === "bottom-sheet" && we) {
|
|
472
|
+
if (!ge)
|
|
473
|
+
u = "top-sheet";
|
|
474
|
+
else if (L > $)
|
|
475
|
+
return {
|
|
476
|
+
resolvedPlacement: "top",
|
|
477
|
+
cardStyle: {
|
|
478
|
+
top: `${Math.max(12, e.y - s - 12)}px`,
|
|
479
|
+
left: `${X}px`,
|
|
480
|
+
bottom: "auto",
|
|
481
|
+
width: `${M}px`,
|
|
482
|
+
transform: "none"
|
|
483
|
+
},
|
|
484
|
+
arrowStyle: {
|
|
485
|
+
left: `${Math.max(24, Math.min(M - 24, e.x + e.width / 2 - X))}px`
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
if (u === "bottom-sheet")
|
|
490
|
+
return {
|
|
491
|
+
resolvedPlacement: "bottom-sheet",
|
|
492
|
+
cardStyle: {
|
|
493
|
+
bottom: "12px",
|
|
494
|
+
left: `${X}px`,
|
|
495
|
+
top: "auto",
|
|
496
|
+
width: `${M}px`,
|
|
497
|
+
transform: "none"
|
|
498
|
+
},
|
|
499
|
+
arrowStyle: null
|
|
500
|
+
};
|
|
501
|
+
if (u === "top-sheet")
|
|
502
|
+
return {
|
|
503
|
+
resolvedPlacement: "top-sheet",
|
|
504
|
+
cardStyle: {
|
|
505
|
+
top: "12px",
|
|
506
|
+
left: `${X}px`,
|
|
507
|
+
bottom: "auto",
|
|
508
|
+
width: `${M}px`,
|
|
509
|
+
transform: "none"
|
|
510
|
+
},
|
|
511
|
+
arrowStyle: null
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
if (u === "auto") {
|
|
515
|
+
const M = [
|
|
516
|
+
{ dir: "right", space: P, minReq: g + h + 16 },
|
|
517
|
+
{ dir: "left", space: b, minReq: g + h + 16 },
|
|
518
|
+
{ dir: "bottom", space: $, minReq: s + h + 16 },
|
|
519
|
+
{ dir: "top", space: L, minReq: s + h + 16 }
|
|
520
|
+
], X = M.filter((N) => N.space >= N.minReq);
|
|
521
|
+
X.length > 0 ? u = X.sort((N, Z) => Z.space - N.space)[0].dir : u = M.sort((N, Z) => Z.space - N.space)[0].dir;
|
|
522
|
+
} else
|
|
523
|
+
u === "right" && P < g + h && b > P ? u = "left" : u === "left" && b < g + h && P > b ? u = "right" : u === "bottom" && $ < s + h && L > $ ? u = "top" : u === "top" && L < s + h && $ > L && (u = "bottom");
|
|
524
|
+
let C = e.y, R = e.x;
|
|
525
|
+
u === "right" ? (R = e.x + e.width + h, C = e.y + e.height / 2 - s / 2) : u === "left" ? (R = e.x - g - h, C = e.y + e.height / 2 - s / 2) : u === "bottom" ? (C = e.y + e.height + h, R = e.x + e.width / 2 - g / 2) : u === "top" && (C = e.y - s - h, R = e.x + e.width / 2 - g / 2), R = Math.max(12, Math.min(R, r - g - 12)), C = Math.max(12, Math.min(C, n - s - 12));
|
|
526
|
+
const oe = R < e.x + e.width && R + g > e.x, ne = C < e.y + e.height && C + s > e.y;
|
|
527
|
+
oe && ne && ($ >= L ? (C = Math.min(n - s - 10, e.y + e.height + 12), u = "bottom") : (C = Math.max(12, e.y - s - 12), u = "top"));
|
|
528
|
+
const Me = e.x + e.width / 2, ce = e.y + e.height / 2;
|
|
529
|
+
let de = null;
|
|
530
|
+
return u === "right" || u === "left" ? de = { top: `${Math.max(22, Math.min(s - 22, ce - C))}px` } : (u === "bottom" || u === "top") && (de = { left: `${Math.max(24, Math.min(g - 24, Me - R))}px` }), {
|
|
531
|
+
resolvedPlacement: u,
|
|
532
|
+
cardStyle: {
|
|
533
|
+
top: `${C}px`,
|
|
534
|
+
left: `${R}px`,
|
|
535
|
+
bottom: "auto",
|
|
536
|
+
width: `${g}px`,
|
|
537
|
+
transform: "none"
|
|
538
|
+
},
|
|
539
|
+
arrowStyle: de
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
const Tt = Symbol(
|
|
543
|
+
"SISTEC_TUTORIAL_PROVIDER_KEY"
|
|
544
|
+
), Jt = ["innerHTML"], Qt = { class: "v-tutorial-nav-group d-flex align-items-center gap-2" }, Zt = {
|
|
545
|
+
key: 0,
|
|
546
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
547
|
+
width: "16",
|
|
548
|
+
height: "16",
|
|
549
|
+
viewBox: "0 0 24 24",
|
|
550
|
+
fill: "none",
|
|
551
|
+
stroke: "currentColor",
|
|
552
|
+
"stroke-width": "2.5",
|
|
553
|
+
"stroke-linecap": "round",
|
|
554
|
+
"stroke-linejoin": "round"
|
|
555
|
+
}, ea = {
|
|
556
|
+
key: 1,
|
|
557
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
558
|
+
width: "16",
|
|
559
|
+
height: "16",
|
|
560
|
+
viewBox: "0 0 24 24",
|
|
561
|
+
fill: "none",
|
|
562
|
+
stroke: "currentColor",
|
|
563
|
+
"stroke-width": "2",
|
|
564
|
+
"stroke-linecap": "round",
|
|
565
|
+
"stroke-linejoin": "round"
|
|
566
|
+
}, ta = /* @__PURE__ */ ut({
|
|
567
|
+
__name: "TutorialProvider",
|
|
568
|
+
props: {
|
|
569
|
+
steps: {},
|
|
570
|
+
storageKey: {},
|
|
571
|
+
autoStart: { type: Boolean, default: !1 },
|
|
572
|
+
startDelay: { default: 400 },
|
|
573
|
+
unstyled: { type: Boolean, default: void 0 },
|
|
574
|
+
showArrow: { type: Boolean, default: void 0 },
|
|
575
|
+
mobileSheetOnAuto: { type: Boolean, default: void 0 },
|
|
576
|
+
breakpoints: {},
|
|
577
|
+
spotlightPadding: {},
|
|
578
|
+
cardWidth: {},
|
|
579
|
+
labels: {},
|
|
580
|
+
classes: {}
|
|
581
|
+
},
|
|
582
|
+
emits: ["finish", "stop", "step-change"],
|
|
583
|
+
setup(a, { emit: t }) {
|
|
584
|
+
const e = a, r = t, {
|
|
585
|
+
isActive: n,
|
|
586
|
+
steps: i,
|
|
587
|
+
currentStepIndex: s,
|
|
588
|
+
currentStep: l,
|
|
589
|
+
isTransitioning: p,
|
|
590
|
+
progress: o,
|
|
591
|
+
isFirstStep: g,
|
|
592
|
+
isLastStep: h,
|
|
593
|
+
activeBreakpoint: u,
|
|
594
|
+
isMobileViewport: P,
|
|
595
|
+
globalOptions: b,
|
|
596
|
+
configureTutorial: $,
|
|
597
|
+
registerSteps: L,
|
|
598
|
+
startTutorial: C,
|
|
599
|
+
restartTutorial: R,
|
|
600
|
+
nextStep: oe,
|
|
601
|
+
prevStep: ne,
|
|
602
|
+
goToStep: Me,
|
|
603
|
+
endTutorial: ce,
|
|
604
|
+
resolveStepElements: de,
|
|
605
|
+
getStepBoundingRect: M,
|
|
606
|
+
registerDeclarativeStep: X,
|
|
607
|
+
updateDeclarativeStep: N,
|
|
608
|
+
unregisterDeclarativeStep: Z,
|
|
609
|
+
onFinish: Pe,
|
|
610
|
+
onStop: Be,
|
|
611
|
+
onStepChange: ge,
|
|
612
|
+
getContext: we
|
|
613
|
+
} = Fe();
|
|
614
|
+
(e.storageKey || e.breakpoints || e.mobileSheetOnAuto !== void 0) && $({
|
|
615
|
+
...e.storageKey ? { storageKey: e.storageKey } : {},
|
|
616
|
+
...e.breakpoints ? { breakpoints: e.breakpoints } : {},
|
|
617
|
+
...e.mobileSheetOnAuto !== void 0 ? { mobileSheetOnAuto: e.mobileSheetOnAuto } : {}
|
|
618
|
+
}), $t(Tt, {
|
|
619
|
+
registerDeclarativeStep: X,
|
|
620
|
+
updateDeclarativeStep: N,
|
|
621
|
+
unregisterDeclarativeStep: Z,
|
|
622
|
+
activeStepId: x(() => {
|
|
623
|
+
var c;
|
|
624
|
+
return ((c = l.value) == null ? void 0 : c.id) || null;
|
|
625
|
+
})
|
|
626
|
+
}), Pe(() => r("finish")), Be(() => r("stop")), ge((c) => r("step-change", c.currentStep, c.currentStepIndex));
|
|
627
|
+
const d = x(
|
|
628
|
+
() => e.unstyled ?? b.value.unstyled ?? !1
|
|
629
|
+
), Ct = x(
|
|
630
|
+
() => e.showArrow ?? b.value.showArrow ?? !0
|
|
631
|
+
), z = x(() => {
|
|
632
|
+
var c, v, D, Ue, ze, Oe, Ye, Ge, Je, Qe, Ze, et, tt, at, lt, ot;
|
|
633
|
+
return {
|
|
634
|
+
skipTutorial: ((c = e.labels) == null ? void 0 : c.skipTutorial) ?? ((v = b.value.labels) == null ? void 0 : v.skipTutorial) ?? "Pular tutorial",
|
|
635
|
+
previous: ((D = e.labels) == null ? void 0 : D.previous) ?? ((Ue = b.value.labels) == null ? void 0 : Ue.previous) ?? "Anterior",
|
|
636
|
+
next: ((ze = e.labels) == null ? void 0 : ze.next) ?? ((Oe = b.value.labels) == null ? void 0 : Oe.next) ?? "Próximo",
|
|
637
|
+
finish: ((Ye = e.labels) == null ? void 0 : Ye.finish) ?? ((Ge = b.value.labels) == null ? void 0 : Ge.finish) ?? "Concluir",
|
|
638
|
+
waitingClick: ((Je = e.labels) == null ? void 0 : Je.waitingClick) ?? ((Qe = b.value.labels) == null ? void 0 : Qe.waitingClick) ?? "Aguardando clique...",
|
|
639
|
+
interactiveBadge: ((Ze = e.labels) == null ? void 0 : Ze.interactiveBadge) ?? ((et = b.value.labels) == null ? void 0 : et.interactiveBadge) ?? "Interativo",
|
|
640
|
+
defaultHint: ((tt = e.labels) == null ? void 0 : tt.defaultHint) ?? ((at = b.value.labels) == null ? void 0 : at.defaultHint) ?? "Clique no item destacado na tela para continuar!",
|
|
641
|
+
stepCounter: ((lt = e.labels) == null ? void 0 : lt.stepCounter) ?? ((ot = b.value.labels) == null ? void 0 : ot.stepCounter) ?? ((Bt, Et) => `Passo ${Bt} de ${Et}`)
|
|
642
|
+
};
|
|
643
|
+
}), w = x(() => ({
|
|
644
|
+
...b.value.classes,
|
|
645
|
+
...e.classes
|
|
646
|
+
})), j = x(() => ({
|
|
647
|
+
...we(),
|
|
648
|
+
step: l.value,
|
|
649
|
+
stepIndex: s.value,
|
|
650
|
+
totalSteps: i.value.length,
|
|
651
|
+
progress: o.value,
|
|
652
|
+
isFirstStep: g.value,
|
|
653
|
+
isLastStep: h.value,
|
|
654
|
+
nextStep: oe,
|
|
655
|
+
prevStep: ne,
|
|
656
|
+
goToStep: Me,
|
|
657
|
+
endTutorial: ce,
|
|
658
|
+
restartTutorial: R
|
|
659
|
+
})), ye = W(null), V = W(null), Ee = W({
|
|
660
|
+
w: typeof window < "u" ? window.innerWidth : 1024,
|
|
661
|
+
h: typeof window < "u" ? window.innerHeight : 768
|
|
662
|
+
});
|
|
663
|
+
let _ = null, Ke = 0, B = null;
|
|
664
|
+
const Mt = x(
|
|
665
|
+
() => {
|
|
666
|
+
var c;
|
|
667
|
+
return ((c = l.value) == null ? void 0 : c.spotlightPadding) ?? e.spotlightPadding ?? b.value.spotlightPadding ?? 6;
|
|
668
|
+
}
|
|
669
|
+
), $e = x(() => {
|
|
670
|
+
var c;
|
|
671
|
+
return !!((c = l.value) != null && c.target) && l.value.placement !== "center" && !!V.value && V.value.width > 0 && V.value.height > 0;
|
|
672
|
+
}), k = x(() => {
|
|
673
|
+
if (!V.value) return { x: 0, y: 0, width: 0, height: 0 };
|
|
674
|
+
const c = Mt.value;
|
|
675
|
+
return {
|
|
676
|
+
x: Math.max(2, V.value.left - c),
|
|
677
|
+
y: Math.max(2, V.value.top - c),
|
|
678
|
+
width: V.value.width + c * 2,
|
|
679
|
+
height: V.value.height + c * 2
|
|
680
|
+
};
|
|
681
|
+
}), ve = x(
|
|
682
|
+
() => {
|
|
683
|
+
var c, v, D;
|
|
684
|
+
return Gt({
|
|
685
|
+
hasTargetBox: $e.value,
|
|
686
|
+
spotlightBox: k.value,
|
|
687
|
+
viewportW: Ee.value.w,
|
|
688
|
+
viewportH: Ee.value.h,
|
|
689
|
+
maxCardW: ((c = l.value) == null ? void 0 : c.cardWidth) ?? e.cardWidth ?? b.value.cardWidth ?? 370,
|
|
690
|
+
cardHeight: ((v = ye.value) == null ? void 0 : v.offsetHeight) || 245,
|
|
691
|
+
requestedPlacement: ((D = l.value) == null ? void 0 : D.placement) || "auto",
|
|
692
|
+
isMobileViewport: P.value,
|
|
693
|
+
useMobileSheet: e.mobileSheetOnAuto ?? b.value.mobileSheetOnAuto ?? !0
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
);
|
|
697
|
+
function je() {
|
|
698
|
+
var c;
|
|
699
|
+
if (n.value) {
|
|
700
|
+
if (Ee.value = {
|
|
701
|
+
w: window.innerWidth,
|
|
702
|
+
h: window.innerHeight
|
|
703
|
+
}, !((c = l.value) != null && c.target) || l.value.placement === "center") {
|
|
704
|
+
V.value = null;
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
V.value = M(l.value);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
function Le(c = 500) {
|
|
711
|
+
if (Ke = performance.now() + c, _ !== null) return;
|
|
712
|
+
const v = (D) => {
|
|
713
|
+
je(), n.value && D < Ke ? _ = requestAnimationFrame(v) : _ = null;
|
|
714
|
+
};
|
|
715
|
+
_ = requestAnimationFrame(v);
|
|
716
|
+
}
|
|
717
|
+
function Pt() {
|
|
718
|
+
if (B && B.disconnect(), typeof ResizeObserver > "u" || !n.value) return;
|
|
719
|
+
B = new ResizeObserver(() => {
|
|
720
|
+
Le(350);
|
|
721
|
+
}), de(l.value).forEach((v) => B == null ? void 0 : B.observe(v)), ye.value && B.observe(ye.value);
|
|
722
|
+
}
|
|
723
|
+
function O() {
|
|
724
|
+
n.value && Le(400);
|
|
725
|
+
}
|
|
726
|
+
function _e(c) {
|
|
727
|
+
var v;
|
|
728
|
+
n.value && (c.key === "Escape" ? ce(!0) : c.key === "ArrowRight" && ((v = l.value) == null ? void 0 : v.mode) !== "wait-click" ? oe() : c.key === "ArrowLeft" && ne());
|
|
729
|
+
}
|
|
730
|
+
return se(
|
|
731
|
+
() => e.steps,
|
|
732
|
+
(c) => {
|
|
733
|
+
c && c.length > 0 && L(c);
|
|
734
|
+
},
|
|
735
|
+
{ immediate: !0, deep: !0 }
|
|
736
|
+
), se(
|
|
737
|
+
() => {
|
|
738
|
+
var c, v;
|
|
739
|
+
return [
|
|
740
|
+
n.value,
|
|
741
|
+
p.value,
|
|
742
|
+
s.value,
|
|
743
|
+
u.value,
|
|
744
|
+
(c = l.value) == null ? void 0 : c.target,
|
|
745
|
+
(v = l.value) == null ? void 0 : v.placement
|
|
746
|
+
];
|
|
747
|
+
},
|
|
748
|
+
() => {
|
|
749
|
+
if (!n.value) {
|
|
750
|
+
_ && (cancelAnimationFrame(_), _ = null), B == null || B.disconnect();
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
je(), Pt(), Le(600);
|
|
754
|
+
},
|
|
755
|
+
{ immediate: !0 }
|
|
756
|
+
), ct(() => {
|
|
757
|
+
window.addEventListener("keydown", _e), window.addEventListener("resize", O, { passive: !0 }), window.addEventListener("scroll", O, {
|
|
758
|
+
passive: !0,
|
|
759
|
+
capture: !0
|
|
760
|
+
}), window.addEventListener("transitionrun", O, {
|
|
761
|
+
passive: !0,
|
|
762
|
+
capture: !0
|
|
763
|
+
}), window.addEventListener("animationstart", O, {
|
|
764
|
+
passive: !0,
|
|
765
|
+
capture: !0
|
|
766
|
+
}), e.autoStart && setTimeout(() => {
|
|
767
|
+
C();
|
|
768
|
+
}, e.startDelay);
|
|
769
|
+
}), dt(() => {
|
|
770
|
+
window.removeEventListener("keydown", _e), window.removeEventListener("resize", O), window.removeEventListener("scroll", O, !0), window.removeEventListener("transitionrun", O, !0), window.removeEventListener("animationstart", O, !0), _ && cancelAnimationFrame(_), B == null || B.disconnect();
|
|
771
|
+
}), (c, v) => (T(), I(nt, null, [
|
|
772
|
+
H(c.$slots, "default"),
|
|
773
|
+
(T(), We(vt, { to: "body" }, [
|
|
774
|
+
Lt(Rt, { name: "tutorial-fade" }, {
|
|
775
|
+
default: Dt(() => [
|
|
776
|
+
m(n) && m(l) ? (T(), I("div", {
|
|
777
|
+
key: 0,
|
|
778
|
+
class: y([
|
|
779
|
+
!d.value && "v-tutorial-root",
|
|
780
|
+
!d.value && `breakpoint-${m(u)}`,
|
|
781
|
+
w.value.root
|
|
782
|
+
])
|
|
783
|
+
}, [
|
|
784
|
+
H(c.$slots, "exit-button", ee(te(j.value))),
|
|
785
|
+
$e.value ? (T(), I(nt, { key: 0 }, [
|
|
786
|
+
f("div", {
|
|
787
|
+
class: y([!d.value && "sistec-click-shield", w.value.shield]),
|
|
788
|
+
style: Y({
|
|
789
|
+
top: "0px",
|
|
790
|
+
left: "0px",
|
|
791
|
+
width: "100vw",
|
|
792
|
+
height: `${k.value.y}px`
|
|
793
|
+
})
|
|
794
|
+
}, null, 6),
|
|
795
|
+
f("div", {
|
|
796
|
+
class: y([!d.value && "sistec-click-shield", w.value.shield]),
|
|
797
|
+
style: Y({
|
|
798
|
+
top: `${k.value.y + k.value.height}px`,
|
|
799
|
+
left: "0px",
|
|
800
|
+
width: "100vw",
|
|
801
|
+
bottom: "0px"
|
|
802
|
+
})
|
|
803
|
+
}, null, 6),
|
|
804
|
+
f("div", {
|
|
805
|
+
class: y([!d.value && "sistec-click-shield", w.value.shield]),
|
|
806
|
+
style: Y({
|
|
807
|
+
top: `${k.value.y}px`,
|
|
808
|
+
left: "0px",
|
|
809
|
+
width: `${k.value.x}px`,
|
|
810
|
+
height: `${k.value.height}px`
|
|
811
|
+
})
|
|
812
|
+
}, null, 6),
|
|
813
|
+
f("div", {
|
|
814
|
+
class: y([!d.value && "sistec-click-shield", w.value.shield]),
|
|
815
|
+
style: Y({
|
|
816
|
+
top: `${k.value.y}px`,
|
|
817
|
+
left: `${k.value.x + k.value.width}px`,
|
|
818
|
+
right: "0px",
|
|
819
|
+
height: `${k.value.height}px`
|
|
820
|
+
})
|
|
821
|
+
}, null, 6),
|
|
822
|
+
H(c.$slots, "spotlight", it(j.value, { spotlightBox: k.value }), () => [
|
|
823
|
+
f("div", {
|
|
824
|
+
class: y([
|
|
825
|
+
!d.value && "v-tutorial-spotlight-ring",
|
|
826
|
+
!d.value && m(l).mode === "wait-click" && "is-wait-click",
|
|
827
|
+
w.value.spotlight
|
|
828
|
+
]),
|
|
829
|
+
style: Y({
|
|
830
|
+
top: `${k.value.y}px`,
|
|
831
|
+
left: `${k.value.x}px`,
|
|
832
|
+
width: `${k.value.width}px`,
|
|
833
|
+
height: `${k.value.height}px`
|
|
834
|
+
})
|
|
835
|
+
}, null, 6)
|
|
836
|
+
])
|
|
837
|
+
], 64)) : (T(), I("div", {
|
|
838
|
+
key: 1,
|
|
839
|
+
class: y([!d.value && "sistec-full-backdrop", w.value.backdrop])
|
|
840
|
+
}, null, 2)),
|
|
841
|
+
f("div", {
|
|
842
|
+
ref_key: "cardRef",
|
|
843
|
+
ref: ye,
|
|
844
|
+
class: y([
|
|
845
|
+
!d.value && "v-tutorial-card",
|
|
846
|
+
!d.value && `is-placement-${ve.value.resolvedPlacement}`,
|
|
847
|
+
w.value.card
|
|
848
|
+
]),
|
|
849
|
+
style: Y(ve.value.cardStyle),
|
|
850
|
+
role: "dialog",
|
|
851
|
+
"aria-modal": "true"
|
|
852
|
+
}, [
|
|
853
|
+
$e.value && Ct.value && ve.value.arrowStyle ? (T(), I("div", {
|
|
854
|
+
key: 0,
|
|
855
|
+
class: y([
|
|
856
|
+
!d.value && "v-tutorial-arrow",
|
|
857
|
+
!d.value && `arrow-${ve.value.resolvedPlacement}`,
|
|
858
|
+
w.value.arrow
|
|
859
|
+
]),
|
|
860
|
+
style: Y(ve.value.arrowStyle)
|
|
861
|
+
}, null, 6)) : ae("", !0),
|
|
862
|
+
H(c.$slots, "card", ee(te(j.value)), () => [
|
|
863
|
+
H(c.$slots, "header", ee(te(j.value)), () => [
|
|
864
|
+
f("div", {
|
|
865
|
+
class: y([
|
|
866
|
+
!d.value && "v-tutorial-card-header",
|
|
867
|
+
w.value.header
|
|
868
|
+
])
|
|
869
|
+
}, [
|
|
870
|
+
f("span", {
|
|
871
|
+
class: y([
|
|
872
|
+
!d.value && "v-tutorial-step-badge",
|
|
873
|
+
w.value.badge
|
|
874
|
+
])
|
|
875
|
+
}, G(z.value.stepCounter(
|
|
876
|
+
m(s) + 1,
|
|
877
|
+
m(i).length
|
|
878
|
+
)), 3),
|
|
879
|
+
m(l).mode === "wait-click" ? (T(), I("span", {
|
|
880
|
+
key: 0,
|
|
881
|
+
class: y([
|
|
882
|
+
!d.value && "v-tutorial-mode-tag",
|
|
883
|
+
w.value.modeTag
|
|
884
|
+
])
|
|
885
|
+
}, G(z.value.interactiveBadge), 3)) : ae("", !0)
|
|
886
|
+
], 2)
|
|
887
|
+
]),
|
|
888
|
+
H(c.$slots, "body", ee(te(j.value)), () => [
|
|
889
|
+
f("div", {
|
|
890
|
+
class: y([
|
|
891
|
+
!d.value && "v-tutorial-card-body",
|
|
892
|
+
w.value.body
|
|
893
|
+
])
|
|
894
|
+
}, [
|
|
895
|
+
f("h3", {
|
|
896
|
+
class: y([
|
|
897
|
+
!d.value && "v-tutorial-title",
|
|
898
|
+
w.value.title
|
|
899
|
+
])
|
|
900
|
+
}, G(m(l).title), 3),
|
|
901
|
+
m(l).component ? (T(), We(It(m(l).component), it({ key: 0 }, m(l).componentProps, { context: j.value }), null, 16, ["context"])) : m(l).content ? (T(), I("div", {
|
|
902
|
+
key: 1,
|
|
903
|
+
class: y([
|
|
904
|
+
!d.value && "v-tutorial-content",
|
|
905
|
+
w.value.content
|
|
906
|
+
]),
|
|
907
|
+
innerHTML: m(l).content
|
|
908
|
+
}, null, 10, Jt)) : ae("", !0),
|
|
909
|
+
f("div", {
|
|
910
|
+
id: "v-tutorial-step-slot-anchor",
|
|
911
|
+
class: y([
|
|
912
|
+
!d.value && "v-tutorial-content",
|
|
913
|
+
w.value.content
|
|
914
|
+
])
|
|
915
|
+
}, null, 2)
|
|
916
|
+
], 2)
|
|
917
|
+
]),
|
|
918
|
+
m(l).mode === "wait-click" || m(l).mode === "optional-click" ? H(c.$slots, "hint", ee(te(j.value)), () => [
|
|
919
|
+
f("div", {
|
|
920
|
+
class: y([
|
|
921
|
+
!d.value && "v-tutorial-click-banner",
|
|
922
|
+
w.value.hintBanner
|
|
923
|
+
])
|
|
924
|
+
}, [
|
|
925
|
+
v[3] || (v[3] = f("svg", {
|
|
926
|
+
class: "pulse-click-icon",
|
|
927
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
928
|
+
width: "18",
|
|
929
|
+
height: "18",
|
|
930
|
+
viewBox: "0 0 24 24",
|
|
931
|
+
fill: "none",
|
|
932
|
+
stroke: "currentColor",
|
|
933
|
+
"stroke-width": "2",
|
|
934
|
+
"stroke-linecap": "round",
|
|
935
|
+
"stroke-linejoin": "round"
|
|
936
|
+
}, [
|
|
937
|
+
f("path", { d: "M3 12l3 0" }),
|
|
938
|
+
f("path", { d: "M12 3l0 3" }),
|
|
939
|
+
f("path", { d: "M7.8 7.8l-2.2 -2.2" }),
|
|
940
|
+
f("path", { d: "M16.2 7.8l2.2 -2.2" }),
|
|
941
|
+
f("path", { d: "M7.8 16.2l-2.2 2.2" }),
|
|
942
|
+
f("path", { d: "M12 12l9 3l-4 2l-2 4l-3 -9" })
|
|
943
|
+
], -1)),
|
|
944
|
+
f("span", null, G(m(l).hintText || z.value.defaultHint), 1)
|
|
945
|
+
], 2)
|
|
946
|
+
], void 0, 0) : ae("", !0),
|
|
947
|
+
H(c.$slots, "progress", ee(te(j.value)), () => [
|
|
948
|
+
f("div", {
|
|
949
|
+
class: y([
|
|
950
|
+
!d.value && "v-tutorial-progress",
|
|
951
|
+
w.value.progressContainer
|
|
952
|
+
])
|
|
953
|
+
}, [
|
|
954
|
+
f("div", {
|
|
955
|
+
class: y([
|
|
956
|
+
!d.value && "v-tutorial-progress-bar",
|
|
957
|
+
w.value.progressBar
|
|
958
|
+
]),
|
|
959
|
+
style: Y({ width: `${m(o)}%` })
|
|
960
|
+
}, null, 6)
|
|
961
|
+
], 2)
|
|
962
|
+
]),
|
|
963
|
+
H(c.$slots, "footer", ee(te(j.value)), () => [
|
|
964
|
+
f("div", {
|
|
965
|
+
class: y([
|
|
966
|
+
!d.value && "v-tutorial-card-footer",
|
|
967
|
+
w.value.footer
|
|
968
|
+
])
|
|
969
|
+
}, [
|
|
970
|
+
f("button", {
|
|
971
|
+
type: "button",
|
|
972
|
+
class: y([
|
|
973
|
+
!d.value && "v-tutorial-btn-skip btn btn-sm btn-outline-danger fw-semibold px-2 py-1",
|
|
974
|
+
w.value.skipButton
|
|
975
|
+
]),
|
|
976
|
+
onClick: v[0] || (v[0] = Ie((D) => m(ce)(!0), ["prevent"]))
|
|
977
|
+
}, G(z.value.skipTutorial), 3),
|
|
978
|
+
f("div", Qt, [
|
|
979
|
+
m(s) > 0 ? (T(), I("button", {
|
|
980
|
+
key: 0,
|
|
981
|
+
type: "button",
|
|
982
|
+
class: y([
|
|
983
|
+
!d.value && "v-tutorial-btn-prev btn btn-sm btn-ghost-secondary d-inline-flex align-items-center gap-1",
|
|
984
|
+
w.value.prevButton
|
|
985
|
+
]),
|
|
986
|
+
onClick: v[1] || (v[1] = Ie(
|
|
987
|
+
//@ts-ignore
|
|
988
|
+
(...D) => m(ne) && m(ne)(...D),
|
|
989
|
+
["prevent"]
|
|
990
|
+
))
|
|
991
|
+
}, [
|
|
992
|
+
v[4] || (v[4] = f("svg", {
|
|
993
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
994
|
+
width: "16",
|
|
995
|
+
height: "16",
|
|
996
|
+
viewBox: "0 0 24 24",
|
|
997
|
+
fill: "none",
|
|
998
|
+
stroke: "currentColor",
|
|
999
|
+
"stroke-width": "2",
|
|
1000
|
+
"stroke-linecap": "round",
|
|
1001
|
+
"stroke-linejoin": "round"
|
|
1002
|
+
}, [
|
|
1003
|
+
f("path", { d: "M15 6l-6 6l6 6" })
|
|
1004
|
+
], -1)),
|
|
1005
|
+
f("span", null, G(z.value.previous), 1)
|
|
1006
|
+
], 2)) : ae("", !0),
|
|
1007
|
+
m(l).mode !== "wait-click" ? (T(), I("button", {
|
|
1008
|
+
key: 1,
|
|
1009
|
+
type: "button",
|
|
1010
|
+
class: y([
|
|
1011
|
+
!d.value && "v-tutorial-btn-next btn btn-sm btn-primary d-inline-flex align-items-center gap-1 px-3 fw-bold",
|
|
1012
|
+
w.value.nextButton
|
|
1013
|
+
]),
|
|
1014
|
+
onClick: v[2] || (v[2] = Ie(
|
|
1015
|
+
//@ts-ignore
|
|
1016
|
+
(...D) => m(oe) && m(oe)(...D),
|
|
1017
|
+
["prevent"]
|
|
1018
|
+
))
|
|
1019
|
+
}, [
|
|
1020
|
+
f("span", null, G(m(h) ? z.value.finish : z.value.next), 1),
|
|
1021
|
+
m(h) ? (T(), I("svg", Zt, [...v[5] || (v[5] = [
|
|
1022
|
+
f("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
1023
|
+
])])) : (T(), I("svg", ea, [...v[6] || (v[6] = [
|
|
1024
|
+
f("path", { d: "M9 6l6 6l-6 6" }, null, -1)
|
|
1025
|
+
])]))
|
|
1026
|
+
], 2)) : (T(), I("span", {
|
|
1027
|
+
key: 2,
|
|
1028
|
+
class: y([
|
|
1029
|
+
!d.value && "sistec-wait-pill",
|
|
1030
|
+
w.value.waitPill
|
|
1031
|
+
])
|
|
1032
|
+
}, G(z.value.waitingClick), 3))
|
|
1033
|
+
])
|
|
1034
|
+
], 2)
|
|
1035
|
+
])
|
|
1036
|
+
])
|
|
1037
|
+
], 6)
|
|
1038
|
+
], 2)) : ae("", !0)
|
|
1039
|
+
]),
|
|
1040
|
+
_: 3
|
|
1041
|
+
})
|
|
1042
|
+
]))
|
|
1043
|
+
], 64));
|
|
1044
|
+
}
|
|
1045
|
+
}), aa = /* @__PURE__ */ ut({
|
|
1046
|
+
__name: "TutorialStep",
|
|
1047
|
+
props: {
|
|
1048
|
+
id: {},
|
|
1049
|
+
target: {},
|
|
1050
|
+
title: {},
|
|
1051
|
+
content: {},
|
|
1052
|
+
component: {},
|
|
1053
|
+
componentProps: {},
|
|
1054
|
+
mode: { default: "info" },
|
|
1055
|
+
placement: { default: "auto" },
|
|
1056
|
+
hintText: {},
|
|
1057
|
+
preventNativeClick: { type: Boolean },
|
|
1058
|
+
afterClickDelay: {},
|
|
1059
|
+
autoScroll: { type: Boolean },
|
|
1060
|
+
spotlightPadding: {},
|
|
1061
|
+
cardWidth: {},
|
|
1062
|
+
disabled: { type: Boolean, default: !1 },
|
|
1063
|
+
route: {},
|
|
1064
|
+
rollbackRoute: {},
|
|
1065
|
+
enterActions: {},
|
|
1066
|
+
rollbackActions: {},
|
|
1067
|
+
leaveActions: {},
|
|
1068
|
+
breakpoints: {},
|
|
1069
|
+
targetSm: {},
|
|
1070
|
+
targetMd: {},
|
|
1071
|
+
targetLg: {},
|
|
1072
|
+
targetXl: {},
|
|
1073
|
+
targetXxl: {},
|
|
1074
|
+
placementSm: {},
|
|
1075
|
+
placementMd: {},
|
|
1076
|
+
placementLg: {},
|
|
1077
|
+
placementXl: {},
|
|
1078
|
+
placementXxl: {},
|
|
1079
|
+
beforeEnter: {},
|
|
1080
|
+
onRollback: {},
|
|
1081
|
+
onTargetClick: {},
|
|
1082
|
+
afterClick: {},
|
|
1083
|
+
afterLeave: {}
|
|
1084
|
+
},
|
|
1085
|
+
setup(a) {
|
|
1086
|
+
const t = a, e = Wt(Tt, null), {
|
|
1087
|
+
currentStep: r,
|
|
1088
|
+
registerDeclarativeStep: n,
|
|
1089
|
+
updateDeclarativeStep: i,
|
|
1090
|
+
unregisterDeclarativeStep: s,
|
|
1091
|
+
getContext: l
|
|
1092
|
+
} = Fe(), p = t.id || `tutorial-step-${Math.random().toString(36).substring(2, 9)}`, o = W(!1), g = x(() => {
|
|
1093
|
+
var P;
|
|
1094
|
+
return ((e == null ? void 0 : e.activeStepId.value) ?? ((P = r.value) == null ? void 0 : P.id)) === p;
|
|
1095
|
+
});
|
|
1096
|
+
function h() {
|
|
1097
|
+
return {
|
|
1098
|
+
id: p,
|
|
1099
|
+
target: t.target,
|
|
1100
|
+
title: t.title,
|
|
1101
|
+
content: t.content,
|
|
1102
|
+
component: t.component,
|
|
1103
|
+
componentProps: t.componentProps,
|
|
1104
|
+
mode: t.mode,
|
|
1105
|
+
placement: t.placement,
|
|
1106
|
+
hintText: t.hintText,
|
|
1107
|
+
preventNativeClick: t.preventNativeClick,
|
|
1108
|
+
afterClickDelay: t.afterClickDelay,
|
|
1109
|
+
autoScroll: t.autoScroll,
|
|
1110
|
+
spotlightPadding: t.spotlightPadding,
|
|
1111
|
+
cardWidth: t.cardWidth,
|
|
1112
|
+
disabled: t.disabled,
|
|
1113
|
+
route: t.route,
|
|
1114
|
+
rollbackRoute: t.rollbackRoute,
|
|
1115
|
+
enterActions: t.enterActions,
|
|
1116
|
+
rollbackActions: t.rollbackActions,
|
|
1117
|
+
leaveActions: t.leaveActions,
|
|
1118
|
+
breakpoints: t.breakpoints,
|
|
1119
|
+
targetSm: t.targetSm,
|
|
1120
|
+
targetMd: t.targetMd,
|
|
1121
|
+
targetLg: t.targetLg,
|
|
1122
|
+
targetXl: t.targetXl,
|
|
1123
|
+
targetXxl: t.targetXxl,
|
|
1124
|
+
placementSm: t.placementSm,
|
|
1125
|
+
placementMd: t.placementMd,
|
|
1126
|
+
placementLg: t.placementLg,
|
|
1127
|
+
placementXl: t.placementXl,
|
|
1128
|
+
placementXxl: t.placementXxl,
|
|
1129
|
+
beforeEnter: t.beforeEnter,
|
|
1130
|
+
onRollback: t.onRollback,
|
|
1131
|
+
onTargetClick: t.onTargetClick,
|
|
1132
|
+
afterClick: t.afterClick,
|
|
1133
|
+
afterLeave: t.afterLeave
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
return se(
|
|
1137
|
+
g,
|
|
1138
|
+
async (u) => {
|
|
1139
|
+
u ? (await re(), o.value = !!document.getElementById("v-tutorial-step-slot-anchor")) : o.value = !1;
|
|
1140
|
+
},
|
|
1141
|
+
{ immediate: !0 }
|
|
1142
|
+
), se(
|
|
1143
|
+
() => [
|
|
1144
|
+
t.target,
|
|
1145
|
+
t.targetSm,
|
|
1146
|
+
t.targetMd,
|
|
1147
|
+
t.targetLg,
|
|
1148
|
+
t.targetXl,
|
|
1149
|
+
t.targetXxl,
|
|
1150
|
+
t.title,
|
|
1151
|
+
t.content,
|
|
1152
|
+
t.mode,
|
|
1153
|
+
t.placement,
|
|
1154
|
+
t.placementSm,
|
|
1155
|
+
t.placementMd,
|
|
1156
|
+
t.placementLg,
|
|
1157
|
+
t.placementXl,
|
|
1158
|
+
t.placementXxl,
|
|
1159
|
+
t.hintText,
|
|
1160
|
+
t.disabled,
|
|
1161
|
+
t.route,
|
|
1162
|
+
t.rollbackRoute,
|
|
1163
|
+
t.breakpoints
|
|
1164
|
+
],
|
|
1165
|
+
() => {
|
|
1166
|
+
const u = h();
|
|
1167
|
+
e ? e.updateDeclarativeStep(u) : i(u);
|
|
1168
|
+
}
|
|
1169
|
+
), ct(() => {
|
|
1170
|
+
const u = h();
|
|
1171
|
+
e ? e.registerDeclarativeStep(u) : n(u);
|
|
1172
|
+
}), dt(() => {
|
|
1173
|
+
e ? e.unregisterDeclarativeStep(p) : s(p);
|
|
1174
|
+
}), (u, P) => g.value && o.value && u.$slots.default ? (T(), We(vt, {
|
|
1175
|
+
key: 0,
|
|
1176
|
+
to: "#v-tutorial-step-slot-anchor"
|
|
1177
|
+
}, [
|
|
1178
|
+
H(u.$slots, "default", {
|
|
1179
|
+
context: m(l)()
|
|
1180
|
+
})
|
|
1181
|
+
])) : ae("", !0);
|
|
1182
|
+
}
|
|
1183
|
+
}), oa = {
|
|
1184
|
+
install(a, t) {
|
|
1185
|
+
if (t) {
|
|
1186
|
+
const { configureTutorial: e } = Fe();
|
|
1187
|
+
e(t);
|
|
1188
|
+
}
|
|
1189
|
+
a.directive("tutorial", Yt), a.component("TutorialProvider", ta), a.component("VTutorialStep", aa);
|
|
1190
|
+
}
|
|
1191
|
+
};
|
|
1192
|
+
export {
|
|
1193
|
+
rt as BOOTSTRAP_BREAKPOINT_ORDER,
|
|
1194
|
+
ft as DEFAULT_BOOTSTRAP_BREAKPOINTS,
|
|
1195
|
+
Tt as TUTORIAL_PROVIDER_KEY,
|
|
1196
|
+
oa as TutorialPlugin,
|
|
1197
|
+
ta as TutorialProvider,
|
|
1198
|
+
aa as TutorialStepComponent,
|
|
1199
|
+
aa as VTutorialStep,
|
|
1200
|
+
Ft as aguardarElementoNoDom,
|
|
1201
|
+
Xt as calcularBreakpointAtivo,
|
|
1202
|
+
Gt as calcularPosicaoCard,
|
|
1203
|
+
oa as default,
|
|
1204
|
+
Ht as getStepBoundingRect,
|
|
1205
|
+
q as registeredElements,
|
|
1206
|
+
Xe as resolveStepElement,
|
|
1207
|
+
Ae as resolveStepElements,
|
|
1208
|
+
Nt as resolverPassoResponsivo,
|
|
1209
|
+
Vt as resolverSeletorUnico,
|
|
1210
|
+
qt as rolarParaElementoSeNecessario,
|
|
1211
|
+
Fe as useTutorial,
|
|
1212
|
+
Yt as vTutorial,
|
|
1213
|
+
fe as verificarElementoVisivel
|
|
1214
|
+
};
|