@ulu/frontend-vue 0.6.26 → 0.6.28
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 +716 -656
- package/dist/plugins/tour/UluTourContent.vue.d.ts.map +1 -1
- package/dist/plugins/tour/UluTourContent.vue.js +14 -12
- package/dist/plugins/tour/UluTourPager.vue.d.ts.map +1 -1
- package/dist/plugins/tour/UluTourPager.vue.js +20 -14
- package/dist/plugins/tour/api.d.ts +8 -0
- package/dist/plugins/tour/api.d.ts.map +1 -1
- package/dist/plugins/tour/api.js +3 -0
- package/lib/plugins/tour/UluTourContent.vue +16 -3
- package/lib/plugins/tour/UluTourPager.vue +7 -4
- 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":"AAeA;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { computed as c, createElementBlock as a, openBlock as o, createBlock as i, createCommentVNode as l, createVNode as u, resolveDynamicComponent as m, normalizeClass as d, withCtx as p, createTextVNode as f, toDisplayString as r } from "vue";
|
|
2
|
+
import C from "../../components/elements/UluRule.vue.js";
|
|
3
|
+
import { useTour as h } from "./useTour.js";
|
|
4
|
+
const v = { class: "tour-content crop-margins" }, y = { key: 1 }, M = {
|
|
4
5
|
__name: "UluTourContent",
|
|
5
6
|
props: {
|
|
6
7
|
/**
|
|
@@ -19,21 +20,22 @@ const u = { class: "tour-content crop-margins" }, p = { key: 1 }, C = {
|
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
22
|
setup(e) {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
const { state: s } = h(), t = e, n = c(() => t.step.titleClass ? t.step.titleClass : t.isModal ? s.active?.modalTitleClass || ["h3", "no-margin"] : s.active?.popoverTitleClass || ["h4", "display-block", "no-margin"]);
|
|
24
|
+
return (k, T) => (o(), a("div", v, [
|
|
25
|
+
e.step?.title ? (o(), i(m(e.isModal ? "h2" : "strong"), {
|
|
24
26
|
key: 0,
|
|
25
|
-
class:
|
|
27
|
+
class: d(n.value)
|
|
26
28
|
}, {
|
|
27
|
-
default:
|
|
28
|
-
|
|
29
|
+
default: p(() => [
|
|
30
|
+
f(r(e.step.title), 1)
|
|
29
31
|
]),
|
|
30
32
|
_: 1
|
|
31
|
-
}, 8, ["class"])) :
|
|
32
|
-
|
|
33
|
-
e.step?.content ? (
|
|
33
|
+
}, 8, ["class"])) : l("", !0),
|
|
34
|
+
u(C),
|
|
35
|
+
e.step?.content ? (o(), a("p", y, r(e.step.content), 1)) : l("", !0)
|
|
34
36
|
]));
|
|
35
37
|
}
|
|
36
38
|
};
|
|
37
39
|
export {
|
|
38
|
-
|
|
40
|
+
M as default
|
|
39
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluTourPager.vue.d.ts","sourceRoot":"","sources":["../../../lib/plugins/tour/UluTourPager.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UluTourPager.vue.d.ts","sourceRoot":"","sources":["../../../lib/plugins/tour/UluTourPager.vue"],"names":[],"mappings":"AAyBA;"}
|
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { useTour as
|
|
1
|
+
import { computed as a, createElementBlock as u, openBlock as c, normalizeClass as m, unref as s, createVNode as o } from "vue";
|
|
2
|
+
import { useTour as d } from "./useTour.js";
|
|
3
3
|
import l from "../../components/elements/UluButton.vue.js";
|
|
4
|
-
const
|
|
4
|
+
const y = {
|
|
5
5
|
__name: "UluTourPager",
|
|
6
|
-
setup(
|
|
7
|
-
const { api:
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
setup(v) {
|
|
7
|
+
const { api: n, state: e } = d(), i = a(() => e.active?.steps[e.stepIndex]), r = a(() => e.active && e.stepIndex === e.active.steps.length - 1);
|
|
8
|
+
return (x, t) => (c(), u("div", {
|
|
9
|
+
class: m([
|
|
10
|
+
"tour-pager layout-flex-justified",
|
|
11
|
+
s(e).active?.pagerClass,
|
|
12
|
+
i.value?.pagerClass
|
|
13
|
+
])
|
|
14
|
+
}, [
|
|
15
|
+
o(l, {
|
|
16
|
+
onClick: t[0] || (t[0] = (p) => s(n).prev()),
|
|
11
17
|
text: "Previous",
|
|
12
|
-
disabled:
|
|
18
|
+
disabled: s(e).stepIndex === 0,
|
|
13
19
|
icon: "type:previous",
|
|
14
20
|
iconBefore: "",
|
|
15
21
|
small: "",
|
|
16
22
|
secondary: "",
|
|
17
23
|
transparent: ""
|
|
18
24
|
}, null, 8, ["disabled"]),
|
|
19
|
-
|
|
25
|
+
o(l, {
|
|
20
26
|
primary: "",
|
|
21
|
-
icon:
|
|
22
|
-
onClick: t[1] || (t[1] = (
|
|
23
|
-
text:
|
|
27
|
+
icon: r.value ? null : "type:next",
|
|
28
|
+
onClick: t[1] || (t[1] = (p) => s(n).next()),
|
|
29
|
+
text: r.value ? "Finish" : "Next",
|
|
24
30
|
small: ""
|
|
25
31
|
}, null, 8, ["icon", "text"])
|
|
26
|
-
]));
|
|
32
|
+
], 2));
|
|
27
33
|
}
|
|
28
34
|
};
|
|
29
35
|
export {
|
|
@@ -8,6 +8,14 @@ export type TourStep = {
|
|
|
8
8
|
* - The title text for the step.
|
|
9
9
|
*/
|
|
10
10
|
title?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* - Class to apply to the title.
|
|
13
|
+
*/
|
|
14
|
+
titleClass?: string | Object | any[] | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* - Class to apply to the pager footer.
|
|
17
|
+
*/
|
|
18
|
+
pagerClass?: string | Object | any[] | undefined;
|
|
11
19
|
/**
|
|
12
20
|
* - The content text for the step.
|
|
13
21
|
*/
|
|
@@ -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":"AAyBO,iCAHI,MAAM,GACJ,MAAM,CAgEjB"}
|
package/dist/plugins/tour/api.js
CHANGED
|
@@ -7,6 +7,9 @@ const o = (e) => ({
|
|
|
7
7
|
* @param {String} [tour.name] - Optional name for the tour
|
|
8
8
|
* @param {Object} [tour.modalProps] - Global props applied to all modal steps in this tour (can be overridden by step)
|
|
9
9
|
* @param {Object} [tour.popoverProps] - Global props applied to all popover steps in this tour (can be overridden by step)
|
|
10
|
+
* @param {String|Array|Object} [tour.modalTitleClass] - Global class applied to the title of modal steps.
|
|
11
|
+
* @param {String|Array|Object} [tour.popoverTitleClass] - Global class applied to the title of popover steps.
|
|
12
|
+
* @param {String|Array|Object} [tour.pagerClass] - Global class applied to the pager.
|
|
10
13
|
*/
|
|
11
14
|
async start(n) {
|
|
12
15
|
n?.steps?.length && (await this._runHooks(n.steps[0]), e.active = t(n), e.stepIndex = 0);
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
<component
|
|
4
4
|
v-if="step?.title"
|
|
5
5
|
:is="isModal ? 'h2' : 'strong'"
|
|
6
|
-
:class="
|
|
7
|
-
class="display-block no-margin"
|
|
6
|
+
:class="resolvedTitleClass"
|
|
8
7
|
>
|
|
9
8
|
{{ step.title }}
|
|
10
9
|
</component>
|
|
@@ -16,9 +15,13 @@
|
|
|
16
15
|
</template>
|
|
17
16
|
|
|
18
17
|
<script setup>
|
|
18
|
+
import { computed } from "vue";
|
|
19
19
|
import UluRule from "../../components/elements/UluRule.vue";
|
|
20
|
+
import { useTour } from "./useTour.js";
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
const { state: tourState } = useTour();
|
|
23
|
+
|
|
24
|
+
const props = defineProps({
|
|
22
25
|
/**
|
|
23
26
|
* The tour step configuration object
|
|
24
27
|
*/
|
|
@@ -34,4 +37,14 @@
|
|
|
34
37
|
default: false
|
|
35
38
|
}
|
|
36
39
|
});
|
|
40
|
+
|
|
41
|
+
const resolvedTitleClass = computed(() => {
|
|
42
|
+
if (props.step.titleClass) return props.step.titleClass;
|
|
43
|
+
|
|
44
|
+
if (props.isModal) {
|
|
45
|
+
return tourState.active?.modalTitleClass || ['h3', 'no-margin'];
|
|
46
|
+
} else {
|
|
47
|
+
return tourState.active?.popoverTitleClass || ['h4', 'display-block', 'no-margin'];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
37
50
|
</script>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div :class="[
|
|
3
|
+
'tour-pager layout-flex-justified',
|
|
4
|
+
state.active?.pagerClass,
|
|
5
|
+
currentStep?.pagerClass
|
|
6
|
+
]">
|
|
3
7
|
<UluButton
|
|
4
8
|
@click="api.prev()"
|
|
5
9
|
text="Previous"
|
|
@@ -27,10 +31,9 @@
|
|
|
27
31
|
|
|
28
32
|
const { api, state } = useTour();
|
|
29
33
|
|
|
34
|
+
const currentStep = computed(() => state.active?.steps[state.stepIndex]);
|
|
35
|
+
|
|
30
36
|
const isLastStep = computed(() => {
|
|
31
37
|
return state.active && state.stepIndex === state.active.steps.length - 1;
|
|
32
38
|
});
|
|
33
|
-
const isFirstStep = computed(() => {
|
|
34
|
-
return state.active && state.stepIndex === 0;
|
|
35
|
-
});
|
|
36
39
|
</script>
|
package/lib/plugins/tour/api.js
CHANGED
|
@@ -4,6 +4,8 @@ import { markRaw } from "vue";
|
|
|
4
4
|
* @typedef {Object} TourStep
|
|
5
5
|
* @property {String} [target] - The CSS selector for the target element. If omitted, step renders as a modal.
|
|
6
6
|
* @property {String} [title] - The title text for the step.
|
|
7
|
+
* @property {String|Array|Object} [titleClass] - Class to apply to the title.
|
|
8
|
+
* @property {String|Array|Object} [pagerClass] - Class to apply to the pager footer.
|
|
7
9
|
* @property {String} [content] - The content text for the step.
|
|
8
10
|
* @property {Object} [component] - A Vue component to completely replace the modal/popover wrapper and layout.
|
|
9
11
|
* @property {Object} [contentComponent] - A Vue component to replace the step text content, keeping the modal/popover wrappers and default footer.
|
|
@@ -29,6 +31,9 @@ export const createApi = (state) => ({
|
|
|
29
31
|
* @param {String} [tour.name] - Optional name for the tour
|
|
30
32
|
* @param {Object} [tour.modalProps] - Global props applied to all modal steps in this tour (can be overridden by step)
|
|
31
33
|
* @param {Object} [tour.popoverProps] - Global props applied to all popover steps in this tour (can be overridden by step)
|
|
34
|
+
* @param {String|Array|Object} [tour.modalTitleClass] - Global class applied to the title of modal steps.
|
|
35
|
+
* @param {String|Array|Object} [tour.popoverTitleClass] - Global class applied to the title of popover steps.
|
|
36
|
+
* @param {String|Array|Object} [tour.pagerClass] - Global class applied to the pager.
|
|
32
37
|
*/
|
|
33
38
|
async start(tour) {
|
|
34
39
|
if (!tour?.steps?.length) return;
|
package/package.json
CHANGED