@v-c/tour 1.0.1 → 1.0.3
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/Mask.cjs +9 -6
- package/dist/Mask.js +2 -1
- package/dist/Placeholder.cjs +7 -4
- package/dist/Tour.cjs +10 -7
- package/dist/Tour.js +1 -1
- package/dist/TourStep/DefaultPanel.cjs +15 -12
- package/dist/TourStep/index.cjs +4 -1
- package/dist/hooks/useClosable.cjs +1 -0
- package/dist/hooks/useTarget.cjs +10 -3
- package/dist/hooks/useTarget.js +3 -0
- package/dist/index.cjs +4 -1
- package/dist/interface.cjs +1 -0
- package/dist/placements.cjs +1 -0
- package/dist/util.cjs +1 -0
- package/package.json +4 -4
package/dist/Mask.cjs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("./_virtual/rolldown_runtime.cjs");
|
|
3
6
|
let vue = require("vue");
|
|
4
|
-
let
|
|
5
|
-
|
|
6
|
-
let
|
|
7
|
+
let _v_c_portal = require("@v-c/portal");
|
|
8
|
+
_v_c_portal = require_rolldown_runtime.__toESM(_v_c_portal);
|
|
9
|
+
let _v_c_util = require("@v-c/util");
|
|
7
10
|
var COVER_PROPS = {
|
|
8
11
|
"fill": "transparent",
|
|
9
12
|
"pointer-events": "auto"
|
|
@@ -23,12 +26,12 @@ var Mask = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
|
|
|
23
26
|
height: "100vh"
|
|
24
27
|
};
|
|
25
28
|
const inlineMode = getPopupContainer === false;
|
|
26
|
-
return (0, vue.createVNode)(
|
|
29
|
+
return (0, vue.createVNode)(_v_c_portal.default, {
|
|
27
30
|
"open": open,
|
|
28
31
|
"autoLock": !inlineMode,
|
|
29
32
|
"getContainer": getPopupContainer
|
|
30
33
|
}, { default: () => [(0, vue.createVNode)("div", {
|
|
31
|
-
"class": (0,
|
|
34
|
+
"class": (0, _v_c_util.clsx)(`${prefixCls}-mask`, rootClassName, tourClassNames?.mask),
|
|
32
35
|
"style": {
|
|
33
36
|
position: inlineMode ? "absolute" : "fixed",
|
|
34
37
|
left: `0px`,
|
package/dist/Mask.js
CHANGED
|
@@ -147,8 +147,9 @@ var Mask_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
147
147
|
default: void 0
|
|
148
148
|
},
|
|
149
149
|
getPopupContainer: {
|
|
150
|
-
type:
|
|
150
|
+
type: Boolean,
|
|
151
151
|
required: false,
|
|
152
|
+
skipCheck: true,
|
|
152
153
|
default: void 0
|
|
153
154
|
}
|
|
154
155
|
},
|
package/dist/Placeholder.cjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("./_virtual/rolldown_runtime.cjs");
|
|
3
6
|
let vue = require("vue");
|
|
4
|
-
let
|
|
5
|
-
|
|
7
|
+
let _v_c_portal = require("@v-c/portal");
|
|
8
|
+
_v_c_portal = require_rolldown_runtime.__toESM(_v_c_portal);
|
|
6
9
|
var Placeholder = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, attrs }) => {
|
|
7
10
|
expose({
|
|
8
11
|
getDom: () => {
|
|
@@ -12,7 +15,7 @@ var Placeholder = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, att
|
|
|
12
15
|
});
|
|
13
16
|
return () => {
|
|
14
17
|
const { open, autoLock, getContainer } = props;
|
|
15
|
-
return (0, vue.createVNode)(
|
|
18
|
+
return (0, vue.createVNode)(_v_c_portal.default, {
|
|
16
19
|
"open": open,
|
|
17
20
|
"autoLock": autoLock,
|
|
18
21
|
"getContainer": getContainer
|
package/dist/Tour.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("./_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_Mask = require("./Mask.cjs");
|
|
4
7
|
const require_Placeholder = require("./Placeholder.cjs");
|
|
@@ -8,8 +11,8 @@ const require_useTarget = require("./hooks/useTarget.cjs");
|
|
|
8
11
|
const require_placements = require("./placements.cjs");
|
|
9
12
|
const require_index = require("./TourStep/index.cjs");
|
|
10
13
|
let vue = require("vue");
|
|
11
|
-
let
|
|
12
|
-
let
|
|
14
|
+
let _v_c_util = require("@v-c/util");
|
|
15
|
+
let _v_c_trigger = require("@v-c/trigger");
|
|
13
16
|
var CENTER_PLACEHOLDER = {
|
|
14
17
|
left: "50%",
|
|
15
18
|
top: "50%",
|
|
@@ -94,11 +97,11 @@ var Tour = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
|
|
|
94
97
|
};
|
|
95
98
|
return () => {
|
|
96
99
|
const { styles, classNames, renderPanel, rootClassName, animated, zIndex = 1001, getPopupContainer, className, style, disabledInteraction, onPopupAlign } = props;
|
|
97
|
-
const { class: attrClass, style: attrStyle
|
|
100
|
+
const { class: attrClass, style: attrStyle, ...restAttrs } = attrs;
|
|
98
101
|
const mergedMaskValue = mergedMask.value;
|
|
99
102
|
const mergedShowMask = typeof mergedMaskValue === "boolean" ? mergedMaskValue : !!mergedMaskValue;
|
|
100
103
|
const mergedMaskStyle = typeof mergedMaskValue === "boolean" ? void 0 : mergedMaskValue;
|
|
101
|
-
const placeholderClassName = (0,
|
|
104
|
+
const placeholderClassName = (0, _v_c_util.clsx)(className, attrClass, rootClassName, `${prefixCls.value}-target-placeholder`);
|
|
102
105
|
const placeholderStyle = {
|
|
103
106
|
...posInfo.value ? {
|
|
104
107
|
left: `${posInfo.value.left}px`,
|
|
@@ -147,14 +150,14 @@ var Tour = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
|
|
|
147
150
|
"animated": animated,
|
|
148
151
|
"rootClassName": rootClassName,
|
|
149
152
|
"disabledInteraction": disabledInteraction
|
|
150
|
-
}, null), (0, vue.createVNode)(
|
|
153
|
+
}, null), (0, vue.createVNode)(_v_c_trigger.Trigger, (0, vue.mergeProps)(restAttrs, {
|
|
151
154
|
"getPopupContainer": getPopupContainer,
|
|
152
155
|
"builtinPlacements": mergedBuiltinPlacements.value,
|
|
153
156
|
"ref": triggerRef,
|
|
154
157
|
"popupStyle": stepStyle.value,
|
|
155
158
|
"popupPlacement": mergedPlacement.value,
|
|
156
159
|
"popupVisible": mergedOpen.value,
|
|
157
|
-
"popupClassName": (0,
|
|
160
|
+
"popupClassName": (0, _v_c_util.clsx)(rootClassName, stepClassName.value),
|
|
158
161
|
"prefixCls": prefixCls.value,
|
|
159
162
|
"popup": popupElement,
|
|
160
163
|
"forceRender": false,
|
package/dist/Tour.js
CHANGED
|
@@ -92,7 +92,7 @@ var Tour_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
92
92
|
};
|
|
93
93
|
return () => {
|
|
94
94
|
const { styles, classNames, renderPanel, rootClassName, animated, zIndex = 1001, getPopupContainer, className, style, disabledInteraction, onPopupAlign } = props;
|
|
95
|
-
const { class: attrClass, style: attrStyle
|
|
95
|
+
const { class: attrClass, style: attrStyle, ...restAttrs } = attrs;
|
|
96
96
|
const mergedMaskValue = mergedMask.value;
|
|
97
97
|
const mergedShowMask = typeof mergedMaskValue === "boolean" ? mergedMaskValue : !!mergedMaskValue;
|
|
98
98
|
const mergedMaskStyle = typeof mergedMaskValue === "boolean" ? void 0 : mergedMaskValue;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
let vue = require("vue");
|
|
4
|
-
let
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
+
let _v_c_util = require("@v-c/util");
|
|
8
|
+
let _v_c_util_dist_pickAttrs = require("@v-c/util/dist/pickAttrs");
|
|
9
|
+
_v_c_util_dist_pickAttrs = require_rolldown_runtime.__toESM(_v_c_util_dist_pickAttrs);
|
|
7
10
|
var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
|
|
8
11
|
return () => {
|
|
9
12
|
const { prefixCls, current, total, title, description, onClose, onPrev, onNext, onFinish, closable, classNames: tourClassNames, styles } = props;
|
|
10
|
-
const ariaProps = (0,
|
|
13
|
+
const ariaProps = (0, _v_c_util_dist_pickAttrs.default)(closable || {}, true);
|
|
11
14
|
const closeIcon = closable?.closeIcon ?? (0, vue.createVNode)("span", { "class": `${prefixCls}-close-x` }, [(0, vue.createTextVNode)("×")]);
|
|
12
15
|
const mergedClosable = !!closable;
|
|
13
16
|
const className = attrs.class;
|
|
14
|
-
return (0, vue.createVNode)("div", { "class": (0,
|
|
15
|
-
"class": (0,
|
|
17
|
+
return (0, vue.createVNode)("div", { "class": (0, _v_c_util.clsx)(`${prefixCls}-panel`, className) }, [(0, vue.createVNode)("div", {
|
|
18
|
+
"class": (0, _v_c_util.clsx)(`${prefixCls}-section`, tourClassNames?.section),
|
|
16
19
|
"style": styles?.section
|
|
17
20
|
}, [
|
|
18
21
|
mergedClosable && (0, vue.createVNode)("button", (0, vue.mergeProps)({
|
|
@@ -21,18 +24,18 @@ var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) =
|
|
|
21
24
|
"aria-label": "Close"
|
|
22
25
|
}, ariaProps, { "class": `${prefixCls}-close` }), [closeIcon]),
|
|
23
26
|
(0, vue.createVNode)("div", {
|
|
24
|
-
"class": (0,
|
|
27
|
+
"class": (0, _v_c_util.clsx)(`${prefixCls}-header`, tourClassNames?.header),
|
|
25
28
|
"style": styles?.header
|
|
26
29
|
}, [(0, vue.createVNode)("div", {
|
|
27
|
-
"class": (0,
|
|
30
|
+
"class": (0, _v_c_util.clsx)(`${prefixCls}-title`, tourClassNames?.title),
|
|
28
31
|
"style": styles?.title
|
|
29
32
|
}, [title])]),
|
|
30
33
|
(0, vue.createVNode)("div", {
|
|
31
|
-
"class": (0,
|
|
34
|
+
"class": (0, _v_c_util.clsx)(`${prefixCls}-description`, tourClassNames?.description),
|
|
32
35
|
"style": styles?.description
|
|
33
36
|
}, [description]),
|
|
34
37
|
(0, vue.createVNode)("div", {
|
|
35
|
-
"class": (0,
|
|
38
|
+
"class": (0, _v_c_util.clsx)(`${prefixCls}-footer`, tourClassNames?.footer),
|
|
36
39
|
"style": styles?.footer
|
|
37
40
|
}, [(0, vue.createVNode)("div", { "class": `${prefixCls}-sliders` }, [total > 1 ? [...Array.from({ length: total }).keys()].map((item, index) => {
|
|
38
41
|
return (0, vue.createVNode)("span", {
|
|
@@ -40,7 +43,7 @@ var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) =
|
|
|
40
43
|
"class": index === current ? "active" : ""
|
|
41
44
|
}, null);
|
|
42
45
|
}) : null]), (0, vue.createVNode)("div", {
|
|
43
|
-
"class": (0,
|
|
46
|
+
"class": (0, _v_c_util.clsx)(`${prefixCls}-actions`, tourClassNames?.actions),
|
|
44
47
|
"style": styles?.actions
|
|
45
48
|
}, [current !== 0 ? (0, vue.createVNode)("button", {
|
|
46
49
|
"class": `${prefixCls}-prev-btn`,
|
package/dist/TourStep/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_DefaultPanel = require("./DefaultPanel.cjs");
|
|
4
7
|
let vue = require("vue");
|
package/dist/hooks/useTarget.cjs
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_util = require("../util.cjs");
|
|
4
7
|
let vue = require("vue");
|
|
5
|
-
let
|
|
8
|
+
let _v_c_util_dist_Dom_canUseDom = require("@v-c/util/dist/Dom/canUseDom");
|
|
9
|
+
_v_c_util_dist_Dom_canUseDom = require_rolldown_runtime.__toESM(_v_c_util_dist_Dom_canUseDom);
|
|
10
|
+
let _v_c_util_dist_vnode = require("@v-c/util/dist/vnode");
|
|
6
11
|
function isValidNumber(val) {
|
|
7
12
|
return typeof val === "number" && !Number.isNaN(val);
|
|
8
13
|
}
|
|
9
14
|
function useTarget(target, open, gap, scrollIntoViewOptions, inlineMode, placeholderRef) {
|
|
10
15
|
const targetElement = (0, vue.shallowRef)(null);
|
|
11
16
|
const syncTargetElement = () => {
|
|
12
|
-
targetElement.value = (0,
|
|
17
|
+
targetElement.value = (0, _v_c_util_dist_vnode.resolveToElement)((typeof target.value === "function" ? target.value() : target.value) || null);
|
|
13
18
|
};
|
|
14
19
|
(0, vue.watch)(target, () => {
|
|
20
|
+
if (!(0, _v_c_util_dist_Dom_canUseDom.default)()) return;
|
|
15
21
|
syncTargetElement();
|
|
16
22
|
}, {
|
|
17
23
|
immediate: true,
|
|
@@ -46,6 +52,7 @@ function useTarget(target, open, gap, scrollIntoViewOptions, inlineMode, placeho
|
|
|
46
52
|
});
|
|
47
53
|
const getGapOffset = (index) => (Array.isArray(gap?.value?.offset) ? gap?.value?.offset[index] : gap?.value?.offset) ?? 6;
|
|
48
54
|
(0, vue.watch)([targetElement, open], async (_n, _o, onCleanup) => {
|
|
55
|
+
if (!(0, _v_c_util_dist_Dom_canUseDom.default)()) return;
|
|
49
56
|
await (0, vue.nextTick)();
|
|
50
57
|
updatePos();
|
|
51
58
|
window.addEventListener("resize", updatePos);
|
package/dist/hooks/useTarget.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isInViewPort } from "../util.js";
|
|
2
2
|
import { computed, nextTick, onMounted, shallowRef, watch } from "vue";
|
|
3
|
+
import canUseDom from "@v-c/util/dist/Dom/canUseDom";
|
|
3
4
|
import { resolveToElement } from "@v-c/util/dist/vnode";
|
|
4
5
|
function isValidNumber(val) {
|
|
5
6
|
return typeof val === "number" && !Number.isNaN(val);
|
|
@@ -10,6 +11,7 @@ function useTarget(target, open, gap, scrollIntoViewOptions, inlineMode, placeho
|
|
|
10
11
|
targetElement.value = resolveToElement((typeof target.value === "function" ? target.value() : target.value) || null);
|
|
11
12
|
};
|
|
12
13
|
watch(target, () => {
|
|
14
|
+
if (!canUseDom()) return;
|
|
13
15
|
syncTargetElement();
|
|
14
16
|
}, {
|
|
15
17
|
immediate: true,
|
|
@@ -44,6 +46,7 @@ function useTarget(target, open, gap, scrollIntoViewOptions, inlineMode, placeho
|
|
|
44
46
|
});
|
|
45
47
|
const getGapOffset = (index) => (Array.isArray(gap?.value?.offset) ? gap?.value?.offset[index] : gap?.value?.offset) ?? 6;
|
|
46
48
|
watch([targetElement, open], async (_n, _o, onCleanup) => {
|
|
49
|
+
if (!canUseDom()) return;
|
|
47
50
|
await nextTick();
|
|
48
51
|
updatePos();
|
|
49
52
|
window.addEventListener("resize", updatePos);
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_Tour = require("./Tour.cjs");
|
|
3
6
|
var src_default = require_Tour.default;
|
|
4
7
|
exports.default = src_default;
|
package/dist/interface.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
package/dist/placements.cjs
CHANGED
package/dist/util.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/tour",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"vue": "^3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@v-c/
|
|
33
|
-
"@v-c/
|
|
34
|
-
"@v-c/util": "^1.0.
|
|
32
|
+
"@v-c/portal": "^1.0.6",
|
|
33
|
+
"@v-c/trigger": "^1.0.6",
|
|
34
|
+
"@v-c/util": "^1.0.9"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "vite build",
|