@v-c/tour 0.0.1
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/LICENSE +21 -0
- package/dist/Mask.cjs +162 -0
- package/dist/Mask.d.ts +21 -0
- package/dist/Mask.js +159 -0
- package/dist/Placeholder.cjs +58 -0
- package/dist/Placeholder.d.ts +8 -0
- package/dist/Placeholder.js +54 -0
- package/dist/Tour.cjs +324 -0
- package/dist/Tour.d.ts +4 -0
- package/dist/Tour.js +321 -0
- package/dist/TourStep/DefaultPanel.cjs +175 -0
- package/dist/TourStep/DefaultPanel.d.ts +8 -0
- package/dist/TourStep/DefaultPanel.js +171 -0
- package/dist/TourStep/index.cjs +128 -0
- package/dist/TourStep/index.d.ts +5 -0
- package/dist/TourStep/index.js +125 -0
- package/dist/_virtual/rolldown_runtime.cjs +21 -0
- package/dist/hooks/useClosable.cjs +23 -0
- package/dist/hooks/useClosable.d.ts +5 -0
- package/dist/hooks/useClosable.js +22 -0
- package/dist/hooks/useTarget.cjs +74 -0
- package/dist/hooks/useTarget.d.ts +20 -0
- package/dist/hooks/useTarget.js +72 -0
- package/dist/index.cjs +4 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/interface.cjs +0 -0
- package/dist/interface.d.ts +81 -0
- package/dist/interface.js +0 -0
- package/dist/placements.cjs +65 -0
- package/dist/placements.d.ts +4 -0
- package/dist/placements.js +64 -0
- package/dist/util.cjs +11 -0
- package/dist/util.d.ts +3 -0
- package/dist/util.js +10 -0
- package/package.json +42 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
|
+
let vue = require("vue");
|
|
4
|
+
let __v_c_util = require("@v-c/util");
|
|
5
|
+
let __v_c_util_dist_pickAttrs = require("@v-c/util/dist/pickAttrs");
|
|
6
|
+
__v_c_util_dist_pickAttrs = require_rolldown_runtime.__toESM(__v_c_util_dist_pickAttrs);
|
|
7
|
+
var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
|
|
8
|
+
return () => {
|
|
9
|
+
const { prefixCls, current, total, title, description, onClose, onPrev, onNext, onFinish, closable, classNames: tourClassNames, styles } = props;
|
|
10
|
+
const ariaProps = (0, __v_c_util_dist_pickAttrs.default)(closable || {}, true);
|
|
11
|
+
const closeIcon = closable?.closeIcon ?? (0, vue.createVNode)("span", { "class": `${prefixCls}-close-x` }, [(0, vue.createTextVNode)("×")]);
|
|
12
|
+
const mergedClosable = !!closable;
|
|
13
|
+
const className = attrs.class;
|
|
14
|
+
return (0, vue.createVNode)("div", { "class": (0, __v_c_util.clsx)(`${prefixCls}-panel`, className) }, [(0, vue.createVNode)("div", {
|
|
15
|
+
"class": (0, __v_c_util.clsx)(`${prefixCls}-section`, tourClassNames?.section),
|
|
16
|
+
"style": styles?.section
|
|
17
|
+
}, [
|
|
18
|
+
mergedClosable && (0, vue.createVNode)("button", (0, vue.mergeProps)({
|
|
19
|
+
"type": "button",
|
|
20
|
+
"onClick": onClose,
|
|
21
|
+
"aria-label": "Close"
|
|
22
|
+
}, ariaProps, { "class": `${prefixCls}-close` }), [closeIcon]),
|
|
23
|
+
(0, vue.createVNode)("div", {
|
|
24
|
+
"class": (0, __v_c_util.clsx)(`${prefixCls}-header`, tourClassNames?.header),
|
|
25
|
+
"style": styles?.header
|
|
26
|
+
}, [(0, vue.createVNode)("div", {
|
|
27
|
+
"class": (0, __v_c_util.clsx)(`${prefixCls}-title`, tourClassNames?.title),
|
|
28
|
+
"style": styles?.title
|
|
29
|
+
}, [title])]),
|
|
30
|
+
(0, vue.createVNode)("div", {
|
|
31
|
+
"class": (0, __v_c_util.clsx)(`${prefixCls}-description`, tourClassNames?.description),
|
|
32
|
+
"style": styles?.description
|
|
33
|
+
}, [description]),
|
|
34
|
+
(0, vue.createVNode)("div", {
|
|
35
|
+
"class": (0, __v_c_util.clsx)(`${prefixCls}-footer`, tourClassNames?.footer),
|
|
36
|
+
"style": styles?.footer
|
|
37
|
+
}, [(0, vue.createVNode)("div", { "class": `${prefixCls}-sliders` }, [total > 1 ? [...Array.from({ length: total }).keys()].map((item, index) => {
|
|
38
|
+
return (0, vue.createVNode)("span", {
|
|
39
|
+
"key": item,
|
|
40
|
+
"class": index === current ? "active" : ""
|
|
41
|
+
}, null);
|
|
42
|
+
}) : null]), (0, vue.createVNode)("div", {
|
|
43
|
+
"class": (0, __v_c_util.clsx)(`${prefixCls}-actions`, tourClassNames?.actions),
|
|
44
|
+
"style": styles?.actions
|
|
45
|
+
}, [current !== 0 ? (0, vue.createVNode)("button", {
|
|
46
|
+
"class": `${prefixCls}-prev-btn`,
|
|
47
|
+
"onClick": onPrev
|
|
48
|
+
}, [(0, vue.createTextVNode)("Prev")]) : null, current === total - 1 ? (0, vue.createVNode)("button", {
|
|
49
|
+
"class": `${prefixCls}-finish-btn`,
|
|
50
|
+
"onClick": onFinish
|
|
51
|
+
}, [(0, vue.createTextVNode)("Finish")]) : (0, vue.createVNode)("button", {
|
|
52
|
+
"class": `${prefixCls}-next-btn`,
|
|
53
|
+
"onClick": onNext
|
|
54
|
+
}, [(0, vue.createTextVNode)("Next")])])])
|
|
55
|
+
])]);
|
|
56
|
+
};
|
|
57
|
+
}, {
|
|
58
|
+
props: {
|
|
59
|
+
prefixCls: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: false,
|
|
62
|
+
default: void 0
|
|
63
|
+
},
|
|
64
|
+
total: {
|
|
65
|
+
type: Number,
|
|
66
|
+
required: false,
|
|
67
|
+
default: void 0
|
|
68
|
+
},
|
|
69
|
+
current: {
|
|
70
|
+
type: Number,
|
|
71
|
+
required: false,
|
|
72
|
+
default: void 0
|
|
73
|
+
},
|
|
74
|
+
onClose: {
|
|
75
|
+
type: Function,
|
|
76
|
+
required: false,
|
|
77
|
+
default: void 0
|
|
78
|
+
},
|
|
79
|
+
onFinish: {
|
|
80
|
+
type: Function,
|
|
81
|
+
required: false,
|
|
82
|
+
default: void 0
|
|
83
|
+
},
|
|
84
|
+
renderPanel: {
|
|
85
|
+
type: Function,
|
|
86
|
+
required: false,
|
|
87
|
+
default: void 0
|
|
88
|
+
},
|
|
89
|
+
onPrev: {
|
|
90
|
+
type: Function,
|
|
91
|
+
required: false,
|
|
92
|
+
default: void 0
|
|
93
|
+
},
|
|
94
|
+
onNext: {
|
|
95
|
+
type: Function,
|
|
96
|
+
required: false,
|
|
97
|
+
default: void 0
|
|
98
|
+
},
|
|
99
|
+
classNames: {
|
|
100
|
+
type: Object,
|
|
101
|
+
required: false,
|
|
102
|
+
default: void 0
|
|
103
|
+
},
|
|
104
|
+
styles: {
|
|
105
|
+
type: Object,
|
|
106
|
+
required: false,
|
|
107
|
+
default: void 0
|
|
108
|
+
},
|
|
109
|
+
arrow: {
|
|
110
|
+
type: [Boolean, Object],
|
|
111
|
+
required: false,
|
|
112
|
+
default: void 0
|
|
113
|
+
},
|
|
114
|
+
target: {
|
|
115
|
+
type: [null, Function],
|
|
116
|
+
required: false,
|
|
117
|
+
skipCheck: true,
|
|
118
|
+
default: void 0
|
|
119
|
+
},
|
|
120
|
+
title: {
|
|
121
|
+
type: null,
|
|
122
|
+
required: true,
|
|
123
|
+
default: void 0
|
|
124
|
+
},
|
|
125
|
+
description: {
|
|
126
|
+
type: null,
|
|
127
|
+
required: false,
|
|
128
|
+
default: void 0
|
|
129
|
+
},
|
|
130
|
+
placement: {
|
|
131
|
+
type: String,
|
|
132
|
+
required: false,
|
|
133
|
+
default: void 0
|
|
134
|
+
},
|
|
135
|
+
className: {
|
|
136
|
+
type: String,
|
|
137
|
+
required: false,
|
|
138
|
+
default: void 0
|
|
139
|
+
},
|
|
140
|
+
style: {
|
|
141
|
+
type: null,
|
|
142
|
+
required: false,
|
|
143
|
+
default: void 0
|
|
144
|
+
},
|
|
145
|
+
mask: {
|
|
146
|
+
type: [Boolean, Object],
|
|
147
|
+
required: false,
|
|
148
|
+
default: void 0
|
|
149
|
+
},
|
|
150
|
+
scrollIntoViewOptions: {
|
|
151
|
+
type: Boolean,
|
|
152
|
+
required: false,
|
|
153
|
+
skipCheck: true,
|
|
154
|
+
default: void 0
|
|
155
|
+
},
|
|
156
|
+
closeIcon: {
|
|
157
|
+
type: null,
|
|
158
|
+
required: false,
|
|
159
|
+
default: void 0
|
|
160
|
+
},
|
|
161
|
+
closable: {
|
|
162
|
+
type: [
|
|
163
|
+
Boolean,
|
|
164
|
+
Object,
|
|
165
|
+
null
|
|
166
|
+
],
|
|
167
|
+
required: false,
|
|
168
|
+
default: void 0
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
name: "TourDefaultPanel",
|
|
172
|
+
inheritAttrs: false
|
|
173
|
+
});
|
|
174
|
+
var DefaultPanel_default = DefaultPanel;
|
|
175
|
+
exports.default = DefaultPanel_default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TourStepProps } from '../interface';
|
|
2
|
+
export type DefaultPanelProps = Omit<TourStepProps, 'closable'> & {
|
|
3
|
+
closable?: Exclude<TourStepProps['closable'], boolean> | null;
|
|
4
|
+
};
|
|
5
|
+
declare const DefaultPanel: import('vue').DefineSetupFnComponent<DefaultPanelProps, {}, {}, Omit<TourStepProps, "closable"> & {
|
|
6
|
+
closable?: Exclude<TourStepProps["closable"], boolean> | null;
|
|
7
|
+
} & {}, import('vue').PublicProps>;
|
|
8
|
+
export default DefaultPanel;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { createTextVNode, createVNode, defineComponent, mergeProps } from "vue";
|
|
2
|
+
import { clsx } from "@v-c/util";
|
|
3
|
+
import pickAttrs from "@v-c/util/dist/pickAttrs";
|
|
4
|
+
var DefaultPanel_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
5
|
+
return () => {
|
|
6
|
+
const { prefixCls, current, total, title, description, onClose, onPrev, onNext, onFinish, closable, classNames: tourClassNames, styles } = props;
|
|
7
|
+
const ariaProps = pickAttrs(closable || {}, true);
|
|
8
|
+
const closeIcon = closable?.closeIcon ?? createVNode("span", { "class": `${prefixCls}-close-x` }, [createTextVNode("×")]);
|
|
9
|
+
const mergedClosable = !!closable;
|
|
10
|
+
const className = attrs.class;
|
|
11
|
+
return createVNode("div", { "class": clsx(`${prefixCls}-panel`, className) }, [createVNode("div", {
|
|
12
|
+
"class": clsx(`${prefixCls}-section`, tourClassNames?.section),
|
|
13
|
+
"style": styles?.section
|
|
14
|
+
}, [
|
|
15
|
+
mergedClosable && createVNode("button", mergeProps({
|
|
16
|
+
"type": "button",
|
|
17
|
+
"onClick": onClose,
|
|
18
|
+
"aria-label": "Close"
|
|
19
|
+
}, ariaProps, { "class": `${prefixCls}-close` }), [closeIcon]),
|
|
20
|
+
createVNode("div", {
|
|
21
|
+
"class": clsx(`${prefixCls}-header`, tourClassNames?.header),
|
|
22
|
+
"style": styles?.header
|
|
23
|
+
}, [createVNode("div", {
|
|
24
|
+
"class": clsx(`${prefixCls}-title`, tourClassNames?.title),
|
|
25
|
+
"style": styles?.title
|
|
26
|
+
}, [title])]),
|
|
27
|
+
createVNode("div", {
|
|
28
|
+
"class": clsx(`${prefixCls}-description`, tourClassNames?.description),
|
|
29
|
+
"style": styles?.description
|
|
30
|
+
}, [description]),
|
|
31
|
+
createVNode("div", {
|
|
32
|
+
"class": clsx(`${prefixCls}-footer`, tourClassNames?.footer),
|
|
33
|
+
"style": styles?.footer
|
|
34
|
+
}, [createVNode("div", { "class": `${prefixCls}-sliders` }, [total > 1 ? [...Array.from({ length: total }).keys()].map((item, index) => {
|
|
35
|
+
return createVNode("span", {
|
|
36
|
+
"key": item,
|
|
37
|
+
"class": index === current ? "active" : ""
|
|
38
|
+
}, null);
|
|
39
|
+
}) : null]), createVNode("div", {
|
|
40
|
+
"class": clsx(`${prefixCls}-actions`, tourClassNames?.actions),
|
|
41
|
+
"style": styles?.actions
|
|
42
|
+
}, [current !== 0 ? createVNode("button", {
|
|
43
|
+
"class": `${prefixCls}-prev-btn`,
|
|
44
|
+
"onClick": onPrev
|
|
45
|
+
}, [createTextVNode("Prev")]) : null, current === total - 1 ? createVNode("button", {
|
|
46
|
+
"class": `${prefixCls}-finish-btn`,
|
|
47
|
+
"onClick": onFinish
|
|
48
|
+
}, [createTextVNode("Finish")]) : createVNode("button", {
|
|
49
|
+
"class": `${prefixCls}-next-btn`,
|
|
50
|
+
"onClick": onNext
|
|
51
|
+
}, [createTextVNode("Next")])])])
|
|
52
|
+
])]);
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
props: {
|
|
56
|
+
prefixCls: {
|
|
57
|
+
type: String,
|
|
58
|
+
required: false,
|
|
59
|
+
default: void 0
|
|
60
|
+
},
|
|
61
|
+
total: {
|
|
62
|
+
type: Number,
|
|
63
|
+
required: false,
|
|
64
|
+
default: void 0
|
|
65
|
+
},
|
|
66
|
+
current: {
|
|
67
|
+
type: Number,
|
|
68
|
+
required: false,
|
|
69
|
+
default: void 0
|
|
70
|
+
},
|
|
71
|
+
onClose: {
|
|
72
|
+
type: Function,
|
|
73
|
+
required: false,
|
|
74
|
+
default: void 0
|
|
75
|
+
},
|
|
76
|
+
onFinish: {
|
|
77
|
+
type: Function,
|
|
78
|
+
required: false,
|
|
79
|
+
default: void 0
|
|
80
|
+
},
|
|
81
|
+
renderPanel: {
|
|
82
|
+
type: Function,
|
|
83
|
+
required: false,
|
|
84
|
+
default: void 0
|
|
85
|
+
},
|
|
86
|
+
onPrev: {
|
|
87
|
+
type: Function,
|
|
88
|
+
required: false,
|
|
89
|
+
default: void 0
|
|
90
|
+
},
|
|
91
|
+
onNext: {
|
|
92
|
+
type: Function,
|
|
93
|
+
required: false,
|
|
94
|
+
default: void 0
|
|
95
|
+
},
|
|
96
|
+
classNames: {
|
|
97
|
+
type: Object,
|
|
98
|
+
required: false,
|
|
99
|
+
default: void 0
|
|
100
|
+
},
|
|
101
|
+
styles: {
|
|
102
|
+
type: Object,
|
|
103
|
+
required: false,
|
|
104
|
+
default: void 0
|
|
105
|
+
},
|
|
106
|
+
arrow: {
|
|
107
|
+
type: [Boolean, Object],
|
|
108
|
+
required: false,
|
|
109
|
+
default: void 0
|
|
110
|
+
},
|
|
111
|
+
target: {
|
|
112
|
+
type: [null, Function],
|
|
113
|
+
required: false,
|
|
114
|
+
skipCheck: true,
|
|
115
|
+
default: void 0
|
|
116
|
+
},
|
|
117
|
+
title: {
|
|
118
|
+
type: null,
|
|
119
|
+
required: true,
|
|
120
|
+
default: void 0
|
|
121
|
+
},
|
|
122
|
+
description: {
|
|
123
|
+
type: null,
|
|
124
|
+
required: false,
|
|
125
|
+
default: void 0
|
|
126
|
+
},
|
|
127
|
+
placement: {
|
|
128
|
+
type: String,
|
|
129
|
+
required: false,
|
|
130
|
+
default: void 0
|
|
131
|
+
},
|
|
132
|
+
className: {
|
|
133
|
+
type: String,
|
|
134
|
+
required: false,
|
|
135
|
+
default: void 0
|
|
136
|
+
},
|
|
137
|
+
style: {
|
|
138
|
+
type: null,
|
|
139
|
+
required: false,
|
|
140
|
+
default: void 0
|
|
141
|
+
},
|
|
142
|
+
mask: {
|
|
143
|
+
type: [Boolean, Object],
|
|
144
|
+
required: false,
|
|
145
|
+
default: void 0
|
|
146
|
+
},
|
|
147
|
+
scrollIntoViewOptions: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
required: false,
|
|
150
|
+
skipCheck: true,
|
|
151
|
+
default: void 0
|
|
152
|
+
},
|
|
153
|
+
closeIcon: {
|
|
154
|
+
type: null,
|
|
155
|
+
required: false,
|
|
156
|
+
default: void 0
|
|
157
|
+
},
|
|
158
|
+
closable: {
|
|
159
|
+
type: [
|
|
160
|
+
Boolean,
|
|
161
|
+
Object,
|
|
162
|
+
null
|
|
163
|
+
],
|
|
164
|
+
required: false,
|
|
165
|
+
default: void 0
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
name: "TourDefaultPanel",
|
|
169
|
+
inheritAttrs: false
|
|
170
|
+
});
|
|
171
|
+
export { DefaultPanel_default as default };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
|
+
const require_DefaultPanel = require("./DefaultPanel.cjs");
|
|
4
|
+
let vue = require("vue");
|
|
5
|
+
var TourStep = /* @__PURE__ */ (0, vue.defineComponent)((props) => {
|
|
6
|
+
return () => {
|
|
7
|
+
const { current, renderPanel } = props;
|
|
8
|
+
return (0, vue.createVNode)(vue.Fragment, null, [typeof renderPanel === "function" ? renderPanel(props, current) : (0, vue.createVNode)(require_DefaultPanel.default, props, null)]);
|
|
9
|
+
};
|
|
10
|
+
}, {
|
|
11
|
+
props: {
|
|
12
|
+
prefixCls: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: false,
|
|
15
|
+
default: void 0
|
|
16
|
+
},
|
|
17
|
+
total: {
|
|
18
|
+
type: Number,
|
|
19
|
+
required: false,
|
|
20
|
+
default: void 0
|
|
21
|
+
},
|
|
22
|
+
current: {
|
|
23
|
+
type: Number,
|
|
24
|
+
required: false,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
onClose: {
|
|
28
|
+
type: Function,
|
|
29
|
+
required: false,
|
|
30
|
+
default: void 0
|
|
31
|
+
},
|
|
32
|
+
onFinish: {
|
|
33
|
+
type: Function,
|
|
34
|
+
required: false,
|
|
35
|
+
default: void 0
|
|
36
|
+
},
|
|
37
|
+
renderPanel: {
|
|
38
|
+
type: Function,
|
|
39
|
+
required: false,
|
|
40
|
+
default: void 0
|
|
41
|
+
},
|
|
42
|
+
onPrev: {
|
|
43
|
+
type: Function,
|
|
44
|
+
required: false,
|
|
45
|
+
default: void 0
|
|
46
|
+
},
|
|
47
|
+
onNext: {
|
|
48
|
+
type: Function,
|
|
49
|
+
required: false,
|
|
50
|
+
default: void 0
|
|
51
|
+
},
|
|
52
|
+
classNames: {
|
|
53
|
+
type: Object,
|
|
54
|
+
required: false,
|
|
55
|
+
default: void 0
|
|
56
|
+
},
|
|
57
|
+
styles: {
|
|
58
|
+
type: Object,
|
|
59
|
+
required: false,
|
|
60
|
+
default: void 0
|
|
61
|
+
},
|
|
62
|
+
arrow: {
|
|
63
|
+
type: [Boolean, Object],
|
|
64
|
+
required: false,
|
|
65
|
+
default: void 0
|
|
66
|
+
},
|
|
67
|
+
target: {
|
|
68
|
+
type: [null, Function],
|
|
69
|
+
required: false,
|
|
70
|
+
skipCheck: true,
|
|
71
|
+
default: void 0
|
|
72
|
+
},
|
|
73
|
+
title: {
|
|
74
|
+
type: null,
|
|
75
|
+
required: true,
|
|
76
|
+
default: void 0
|
|
77
|
+
},
|
|
78
|
+
description: {
|
|
79
|
+
type: null,
|
|
80
|
+
required: false,
|
|
81
|
+
default: void 0
|
|
82
|
+
},
|
|
83
|
+
placement: {
|
|
84
|
+
type: String,
|
|
85
|
+
required: false,
|
|
86
|
+
default: void 0
|
|
87
|
+
},
|
|
88
|
+
className: {
|
|
89
|
+
type: String,
|
|
90
|
+
required: false,
|
|
91
|
+
default: void 0
|
|
92
|
+
},
|
|
93
|
+
style: {
|
|
94
|
+
type: null,
|
|
95
|
+
required: false,
|
|
96
|
+
default: void 0
|
|
97
|
+
},
|
|
98
|
+
mask: {
|
|
99
|
+
type: [Boolean, Object],
|
|
100
|
+
required: false,
|
|
101
|
+
default: void 0
|
|
102
|
+
},
|
|
103
|
+
scrollIntoViewOptions: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
required: false,
|
|
106
|
+
skipCheck: true,
|
|
107
|
+
default: void 0
|
|
108
|
+
},
|
|
109
|
+
closeIcon: {
|
|
110
|
+
type: null,
|
|
111
|
+
required: false,
|
|
112
|
+
default: void 0
|
|
113
|
+
},
|
|
114
|
+
closable: {
|
|
115
|
+
type: [
|
|
116
|
+
Boolean,
|
|
117
|
+
Object,
|
|
118
|
+
null
|
|
119
|
+
],
|
|
120
|
+
required: false,
|
|
121
|
+
default: void 0
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
name: "TourStep",
|
|
125
|
+
inheritAttrs: false
|
|
126
|
+
});
|
|
127
|
+
var TourStep_default = TourStep;
|
|
128
|
+
exports.default = TourStep_default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DefaultPanelProps } from './DefaultPanel.tsx';
|
|
2
|
+
declare const TourStep: import('vue').DefineSetupFnComponent<DefaultPanelProps, {}, {}, Omit<import('../interface.ts').TourStepProps, "closable"> & {
|
|
3
|
+
closable?: Exclude<import('../interface.ts').TourStepProps["closable"], boolean> | null;
|
|
4
|
+
} & {}, import('vue').PublicProps>;
|
|
5
|
+
export default TourStep;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import DefaultPanel_default from "./DefaultPanel.js";
|
|
2
|
+
import { Fragment, createVNode, defineComponent } from "vue";
|
|
3
|
+
var TourStep_default = /* @__PURE__ */ defineComponent((props) => {
|
|
4
|
+
return () => {
|
|
5
|
+
const { current, renderPanel } = props;
|
|
6
|
+
return createVNode(Fragment, null, [typeof renderPanel === "function" ? renderPanel(props, current) : createVNode(DefaultPanel_default, props, null)]);
|
|
7
|
+
};
|
|
8
|
+
}, {
|
|
9
|
+
props: {
|
|
10
|
+
prefixCls: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: false,
|
|
13
|
+
default: void 0
|
|
14
|
+
},
|
|
15
|
+
total: {
|
|
16
|
+
type: Number,
|
|
17
|
+
required: false,
|
|
18
|
+
default: void 0
|
|
19
|
+
},
|
|
20
|
+
current: {
|
|
21
|
+
type: Number,
|
|
22
|
+
required: false,
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
25
|
+
onClose: {
|
|
26
|
+
type: Function,
|
|
27
|
+
required: false,
|
|
28
|
+
default: void 0
|
|
29
|
+
},
|
|
30
|
+
onFinish: {
|
|
31
|
+
type: Function,
|
|
32
|
+
required: false,
|
|
33
|
+
default: void 0
|
|
34
|
+
},
|
|
35
|
+
renderPanel: {
|
|
36
|
+
type: Function,
|
|
37
|
+
required: false,
|
|
38
|
+
default: void 0
|
|
39
|
+
},
|
|
40
|
+
onPrev: {
|
|
41
|
+
type: Function,
|
|
42
|
+
required: false,
|
|
43
|
+
default: void 0
|
|
44
|
+
},
|
|
45
|
+
onNext: {
|
|
46
|
+
type: Function,
|
|
47
|
+
required: false,
|
|
48
|
+
default: void 0
|
|
49
|
+
},
|
|
50
|
+
classNames: {
|
|
51
|
+
type: Object,
|
|
52
|
+
required: false,
|
|
53
|
+
default: void 0
|
|
54
|
+
},
|
|
55
|
+
styles: {
|
|
56
|
+
type: Object,
|
|
57
|
+
required: false,
|
|
58
|
+
default: void 0
|
|
59
|
+
},
|
|
60
|
+
arrow: {
|
|
61
|
+
type: [Boolean, Object],
|
|
62
|
+
required: false,
|
|
63
|
+
default: void 0
|
|
64
|
+
},
|
|
65
|
+
target: {
|
|
66
|
+
type: [null, Function],
|
|
67
|
+
required: false,
|
|
68
|
+
skipCheck: true,
|
|
69
|
+
default: void 0
|
|
70
|
+
},
|
|
71
|
+
title: {
|
|
72
|
+
type: null,
|
|
73
|
+
required: true,
|
|
74
|
+
default: void 0
|
|
75
|
+
},
|
|
76
|
+
description: {
|
|
77
|
+
type: null,
|
|
78
|
+
required: false,
|
|
79
|
+
default: void 0
|
|
80
|
+
},
|
|
81
|
+
placement: {
|
|
82
|
+
type: String,
|
|
83
|
+
required: false,
|
|
84
|
+
default: void 0
|
|
85
|
+
},
|
|
86
|
+
className: {
|
|
87
|
+
type: String,
|
|
88
|
+
required: false,
|
|
89
|
+
default: void 0
|
|
90
|
+
},
|
|
91
|
+
style: {
|
|
92
|
+
type: null,
|
|
93
|
+
required: false,
|
|
94
|
+
default: void 0
|
|
95
|
+
},
|
|
96
|
+
mask: {
|
|
97
|
+
type: [Boolean, Object],
|
|
98
|
+
required: false,
|
|
99
|
+
default: void 0
|
|
100
|
+
},
|
|
101
|
+
scrollIntoViewOptions: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
required: false,
|
|
104
|
+
skipCheck: true,
|
|
105
|
+
default: void 0
|
|
106
|
+
},
|
|
107
|
+
closeIcon: {
|
|
108
|
+
type: null,
|
|
109
|
+
required: false,
|
|
110
|
+
default: void 0
|
|
111
|
+
},
|
|
112
|
+
closable: {
|
|
113
|
+
type: [
|
|
114
|
+
Boolean,
|
|
115
|
+
Object,
|
|
116
|
+
null
|
|
117
|
+
],
|
|
118
|
+
required: false,
|
|
119
|
+
default: void 0
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
name: "TourStep",
|
|
123
|
+
inheritAttrs: false
|
|
124
|
+
});
|
|
125
|
+
export { TourStep_default as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
9
|
+
key = keys[i];
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: ((k) => from[k]).bind(null, key),
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
18
|
+
value: mod,
|
|
19
|
+
enumerable: true
|
|
20
|
+
}) : target, mod));
|
|
21
|
+
exports.__toESM = __toESM;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
2
|
+
let vue = require("vue");
|
|
3
|
+
function isConfigObj(closable) {
|
|
4
|
+
return closable !== null && typeof closable === "object";
|
|
5
|
+
}
|
|
6
|
+
function getClosableConfig(closable, closeIcon, preset) {
|
|
7
|
+
if (closable === false || closeIcon === false && (!isConfigObj(closable) || !closable?.closeIcon)) return null;
|
|
8
|
+
const mergedCloseIcon = typeof closeIcon !== "boolean" ? closeIcon : void 0;
|
|
9
|
+
if (isConfigObj(closable)) return {
|
|
10
|
+
...closable,
|
|
11
|
+
closeIcon: closable?.closeIcon ?? mergedCloseIcon
|
|
12
|
+
};
|
|
13
|
+
return preset || closable || closeIcon ? { closeIcon: mergedCloseIcon } : "empty";
|
|
14
|
+
}
|
|
15
|
+
function useClosable(stepClosable, stepCloseIcon, closable, closeIcon) {
|
|
16
|
+
return (0, vue.computed)(() => {
|
|
17
|
+
const stepClosableConfig = getClosableConfig(stepClosable.value, stepCloseIcon.value, false);
|
|
18
|
+
const rootCloseableConfig = getClosableConfig(closable.value, closeIcon.value, true);
|
|
19
|
+
if (stepClosableConfig !== "empty") return stepClosableConfig;
|
|
20
|
+
return rootCloseableConfig;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.useClosable = useClosable;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { TourProps, TourStepInfo } from '../interface';
|
|
3
|
+
type ClosableConfig = Exclude<TourStepInfo['closable'], boolean> | null;
|
|
4
|
+
export declare function useClosable(stepClosable: Ref<TourStepInfo['closable']>, stepCloseIcon: Ref<TourStepInfo['closeIcon']>, closable: Ref<TourProps['closable']>, closeIcon: Ref<TourProps['closeIcon']>): import('vue').ComputedRef<ClosableConfig>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
function isConfigObj(closable) {
|
|
3
|
+
return closable !== null && typeof closable === "object";
|
|
4
|
+
}
|
|
5
|
+
function getClosableConfig(closable, closeIcon, preset) {
|
|
6
|
+
if (closable === false || closeIcon === false && (!isConfigObj(closable) || !closable?.closeIcon)) return null;
|
|
7
|
+
const mergedCloseIcon = typeof closeIcon !== "boolean" ? closeIcon : void 0;
|
|
8
|
+
if (isConfigObj(closable)) return {
|
|
9
|
+
...closable,
|
|
10
|
+
closeIcon: closable?.closeIcon ?? mergedCloseIcon
|
|
11
|
+
};
|
|
12
|
+
return preset || closable || closeIcon ? { closeIcon: mergedCloseIcon } : "empty";
|
|
13
|
+
}
|
|
14
|
+
function useClosable(stepClosable, stepCloseIcon, closable, closeIcon) {
|
|
15
|
+
return computed(() => {
|
|
16
|
+
const stepClosableConfig = getClosableConfig(stepClosable.value, stepCloseIcon.value, false);
|
|
17
|
+
const rootCloseableConfig = getClosableConfig(closable.value, closeIcon.value, true);
|
|
18
|
+
if (stepClosableConfig !== "empty") return stepClosableConfig;
|
|
19
|
+
return rootCloseableConfig;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export { useClosable };
|