v-onboarding 2.5.2 → 2.7.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/dist/v-onboarding.es.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1
20
|
import { createPopper } from "@popperjs/core";
|
|
2
21
|
import { ref, onMounted, onUnmounted, defineComponent, inject, computed, watch, nextTick, withDirectives, openBlock, createElementBlock, createElementVNode, renderSlot, toDisplayString, createCommentVNode, vShow, provide, resolveComponent, createBlock } from "vue";
|
|
3
22
|
const STATE_INJECT_KEY = Symbol("onboardingState");
|
|
@@ -5,6 +24,10 @@ const OnboardingState = {
|
|
|
5
24
|
IDLE: -1,
|
|
6
25
|
FINISHED: -2
|
|
7
26
|
};
|
|
27
|
+
const Direction = {
|
|
28
|
+
BACKWARD: -1,
|
|
29
|
+
FORWARD: 1
|
|
30
|
+
};
|
|
8
31
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
9
32
|
var lodash_merge = { exports: {} };
|
|
10
33
|
(function(module, exports) {
|
|
@@ -82,7 +105,7 @@ var lodash_merge = { exports: {} };
|
|
|
82
105
|
var nativeObjectToString = objectProto.toString;
|
|
83
106
|
var objectCtorString = funcToString.call(Object);
|
|
84
107
|
var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
85
|
-
var
|
|
108
|
+
var Buffer2 = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array2 = root.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
86
109
|
var defineProperty = function() {
|
|
87
110
|
try {
|
|
88
111
|
var func = getNative(Object, "defineProperty");
|
|
@@ -91,7 +114,7 @@ var lodash_merge = { exports: {} };
|
|
|
91
114
|
} catch (e) {
|
|
92
115
|
}
|
|
93
116
|
}();
|
|
94
|
-
var nativeIsBuffer =
|
|
117
|
+
var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeMax = Math.max, nativeNow = Date.now;
|
|
95
118
|
var Map = getNative(root, "Map"), nativeCreate = getNative(Object, "create");
|
|
96
119
|
var baseCreate = function() {
|
|
97
120
|
function object() {
|
|
@@ -428,7 +451,7 @@ var lodash_merge = { exports: {} };
|
|
|
428
451
|
}
|
|
429
452
|
function cloneArrayBuffer(arrayBuffer) {
|
|
430
453
|
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
431
|
-
new
|
|
454
|
+
new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
|
|
432
455
|
return result;
|
|
433
456
|
}
|
|
434
457
|
function cloneTypedArray(typedArray, isDeep) {
|
|
@@ -692,7 +715,8 @@ const defaultVOnboardingWrapperOptions = {
|
|
|
692
715
|
overlay: {
|
|
693
716
|
enabled: true,
|
|
694
717
|
padding: 0,
|
|
695
|
-
borderRadius: 0
|
|
718
|
+
borderRadius: 0,
|
|
719
|
+
preventOverlayInteraction: true
|
|
696
720
|
},
|
|
697
721
|
scrollToStep: {
|
|
698
722
|
enabled: true,
|
|
@@ -712,7 +736,8 @@ const defaultVOnboardingWrapperOptions = {
|
|
|
712
736
|
previous: false,
|
|
713
737
|
next: false,
|
|
714
738
|
exit: false
|
|
715
|
-
}
|
|
739
|
+
},
|
|
740
|
+
hideNextStepDuringHook: false
|
|
716
741
|
};
|
|
717
742
|
function useSvgOverlay() {
|
|
718
743
|
var _a, _b, _c, _d;
|
|
@@ -817,19 +842,19 @@ const _sfc_main$1 = defineComponent({
|
|
|
817
842
|
const { updatePath, path } = useSvgOverlay();
|
|
818
843
|
const stepElement = ref();
|
|
819
844
|
const attachElement = async () => {
|
|
820
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
845
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
821
846
|
await nextTick();
|
|
822
847
|
const element = useGetElement((_b = (_a = step == null ? void 0 : step.value) == null ? void 0 : _a.attachTo) == null ? void 0 : _b.element);
|
|
823
848
|
if (element && stepElement.value) {
|
|
824
849
|
show.value = true;
|
|
825
850
|
if ((_d = (_c = mergedOptions.value) == null ? void 0 : _c.scrollToStep) == null ? void 0 : _d.enabled) {
|
|
826
|
-
element.scrollIntoView((_f = (_e = mergedOptions.value) == null ? void 0 : _e.scrollToStep) == null ? void 0 : _f.options);
|
|
851
|
+
(_g = element.scrollIntoView) == null ? void 0 : _g.call(element, (_f = (_e = mergedOptions.value) == null ? void 0 : _e.scrollToStep) == null ? void 0 : _f.options);
|
|
827
852
|
}
|
|
828
853
|
createPopper(element, stepElement.value, mergedOptions.value.popper);
|
|
829
|
-
if ((
|
|
854
|
+
if ((_i = (_h = mergedOptions.value) == null ? void 0 : _h.overlay) == null ? void 0 : _i.enabled) {
|
|
830
855
|
updatePath(element, {
|
|
831
|
-
padding: (
|
|
832
|
-
borderRadius: (
|
|
856
|
+
padding: (_k = (_j = mergedOptions.value) == null ? void 0 : _j.overlay) == null ? void 0 : _k.padding,
|
|
857
|
+
borderRadius: (_m = (_l = mergedOptions.value) == null ? void 0 : _l.overlay) == null ? void 0 : _m.borderRadius
|
|
833
858
|
});
|
|
834
859
|
}
|
|
835
860
|
}
|
|
@@ -887,12 +912,13 @@ const _hoisted_7 = /* @__PURE__ */ createElementVNode("svg", {
|
|
|
887
912
|
const _hoisted_8 = [
|
|
888
913
|
_hoisted_7
|
|
889
914
|
];
|
|
890
|
-
const _hoisted_9 =
|
|
891
|
-
|
|
915
|
+
const _hoisted_9 = ["innerHTML"];
|
|
916
|
+
const _hoisted_10 = {
|
|
917
|
+
key: 1,
|
|
892
918
|
class: "v-onboarding-item__description"
|
|
893
919
|
};
|
|
894
|
-
const
|
|
895
|
-
const
|
|
920
|
+
const _hoisted_11 = { class: "v-onboarding-item__actions" };
|
|
921
|
+
const _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { "data-popper-arrow": "" }, null, -1);
|
|
896
922
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
897
923
|
return withDirectives((openBlock(), createElementBlock("div", null, [
|
|
898
924
|
(openBlock(), createElementBlock("svg", _hoisted_1$1, [
|
|
@@ -906,11 +932,16 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
906
932
|
_ctx.isButtonVisible.exit ? (openBlock(), createElementBlock("button", {
|
|
907
933
|
key: 1,
|
|
908
934
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.exit && _ctx.exit(...args)),
|
|
935
|
+
"aria-label": "Close",
|
|
909
936
|
class: "v-onboarding-item__header-close"
|
|
910
937
|
}, _hoisted_8)) : createCommentVNode("", true)
|
|
911
938
|
]),
|
|
912
|
-
_ctx.step.content.description ? (openBlock(), createElementBlock("p",
|
|
913
|
-
|
|
939
|
+
_ctx.step.content.description && _ctx.step.content.html ? (openBlock(), createElementBlock("p", {
|
|
940
|
+
key: 0,
|
|
941
|
+
class: "v-onboarding-item__description",
|
|
942
|
+
innerHTML: _ctx.step.content.description
|
|
943
|
+
}, null, 8, _hoisted_9)) : _ctx.step.content.description ? (openBlock(), createElementBlock("p", _hoisted_10, toDisplayString(_ctx.step.content.description), 1)) : createCommentVNode("", true),
|
|
944
|
+
createElementVNode("div", _hoisted_11, [
|
|
914
945
|
!_ctx.isFirstStep && _ctx.isButtonVisible.previous ? (openBlock(), createElementBlock("button", {
|
|
915
946
|
key: 0,
|
|
916
947
|
type: "button",
|
|
@@ -926,7 +957,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
926
957
|
])
|
|
927
958
|
])
|
|
928
959
|
]) : createCommentVNode("", true),
|
|
929
|
-
|
|
960
|
+
_hoisted_12
|
|
930
961
|
], 512)
|
|
931
962
|
], 512)), [
|
|
932
963
|
[vShow, _ctx.show]
|
|
@@ -950,6 +981,8 @@ const _sfc_main = defineComponent({
|
|
|
950
981
|
},
|
|
951
982
|
emits: ["finish", "exit"],
|
|
952
983
|
setup(props, { expose, emit }) {
|
|
984
|
+
const mergedOptions = computed(() => merge({}, defaultVOnboardingWrapperOptions, props.options));
|
|
985
|
+
const showStep = ref(true);
|
|
953
986
|
const index = ref(OnboardingState.IDLE);
|
|
954
987
|
const privateIndex = ref(index.value);
|
|
955
988
|
const setIndex = (value) => {
|
|
@@ -959,23 +992,64 @@ const _sfc_main = defineComponent({
|
|
|
959
992
|
index.value = value;
|
|
960
993
|
}
|
|
961
994
|
};
|
|
962
|
-
const { beforeHook, afterHook } = useStepHooks();
|
|
963
995
|
const activeStep = computed(() => {
|
|
964
996
|
var _a;
|
|
965
997
|
return (_a = props.steps) == null ? void 0 : _a[privateIndex.value];
|
|
966
998
|
});
|
|
999
|
+
const activeStepMergedOptions = computed(() => {
|
|
1000
|
+
return activeStep.value ? merge({}, mergedOptions.value, activeStep.value.options) : mergedOptions.value;
|
|
1001
|
+
});
|
|
1002
|
+
const mergeOptions = (step) => {
|
|
1003
|
+
return merge({}, mergedOptions.value, step.options);
|
|
1004
|
+
};
|
|
1005
|
+
const { beforeHook, afterHook } = useStepHooks(activeStepMergedOptions);
|
|
967
1006
|
watch(index, async (newIndex, oldIndex) => {
|
|
968
|
-
var _a, _b;
|
|
1007
|
+
var _a, _b, _c, _d;
|
|
1008
|
+
const direction = newIndex < oldIndex ? Direction.BACKWARD : Direction.FORWARD;
|
|
1009
|
+
const globalHookOptions = {
|
|
1010
|
+
direction,
|
|
1011
|
+
isForward: direction === Direction.FORWARD,
|
|
1012
|
+
isBackward: direction === Direction.BACKWARD
|
|
1013
|
+
};
|
|
969
1014
|
const oldStep = (_a = props.steps) == null ? void 0 : _a[oldIndex];
|
|
970
1015
|
if (oldStep) {
|
|
971
|
-
|
|
1016
|
+
const afterHookOptions = __spreadProps(__spreadValues({}, globalHookOptions), {
|
|
1017
|
+
index: oldIndex,
|
|
1018
|
+
step: oldStep
|
|
1019
|
+
});
|
|
1020
|
+
removePointerEvents(useGetElement(oldStep.attachTo.element));
|
|
1021
|
+
await afterHook(oldStep, afterHookOptions);
|
|
972
1022
|
}
|
|
973
1023
|
const newStep = (_b = props.steps) == null ? void 0 : _b[newIndex];
|
|
974
1024
|
if (newStep) {
|
|
975
|
-
|
|
1025
|
+
const beforeHookOptions = __spreadProps(__spreadValues({}, globalHookOptions), {
|
|
1026
|
+
index: newIndex,
|
|
1027
|
+
step: newStep
|
|
1028
|
+
});
|
|
1029
|
+
removePointerEvents(useGetElement(newStep.attachTo.element));
|
|
1030
|
+
if ((_c = mergeOptions(newStep)) == null ? void 0 : _c.hideNextStepDuringHook) {
|
|
1031
|
+
showStep.value = false;
|
|
1032
|
+
}
|
|
1033
|
+
await beforeHook(newStep, beforeHookOptions);
|
|
976
1034
|
}
|
|
977
1035
|
privateIndex.value = newIndex;
|
|
1036
|
+
showStep.value = true;
|
|
1037
|
+
removePointerEvents(useGetElement("body"));
|
|
1038
|
+
if ((_d = activeStepMergedOptions.value.overlay) == null ? void 0 : _d.preventOverlayInteraction) {
|
|
1039
|
+
updateBodyPointerEvents();
|
|
1040
|
+
}
|
|
978
1041
|
});
|
|
1042
|
+
const { addPointerEvents, removePointerEvents } = useSetPointerEvents();
|
|
1043
|
+
const updateBodyPointerEvents = () => {
|
|
1044
|
+
const body = useGetElement("body");
|
|
1045
|
+
if (!body)
|
|
1046
|
+
return;
|
|
1047
|
+
if ([OnboardingState.IDLE, OnboardingState.FINISHED].includes(privateIndex.value)) {
|
|
1048
|
+
removePointerEvents(body);
|
|
1049
|
+
} else {
|
|
1050
|
+
addPointerEvents(body, "none");
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
979
1053
|
const isFinished = computed(() => {
|
|
980
1054
|
return privateIndex.value === OnboardingState.FINISHED;
|
|
981
1055
|
});
|
|
@@ -1003,7 +1077,7 @@ const _sfc_main = defineComponent({
|
|
|
1003
1077
|
};
|
|
1004
1078
|
const state = computed(() => ({
|
|
1005
1079
|
step: activeStep,
|
|
1006
|
-
options:
|
|
1080
|
+
options: mergedOptions,
|
|
1007
1081
|
next,
|
|
1008
1082
|
previous,
|
|
1009
1083
|
finish,
|
|
@@ -1022,7 +1096,8 @@ const _sfc_main = defineComponent({
|
|
|
1022
1096
|
isFirstStep: state.value.isFirstStep,
|
|
1023
1097
|
isLastStep: state.value.isLastStep,
|
|
1024
1098
|
finish,
|
|
1025
|
-
exit
|
|
1099
|
+
exit,
|
|
1100
|
+
showStep
|
|
1026
1101
|
};
|
|
1027
1102
|
}
|
|
1028
1103
|
});
|
|
@@ -1039,28 +1114,62 @@ function useSetElementClassName() {
|
|
|
1039
1114
|
};
|
|
1040
1115
|
return { setClassName, unsetClassName };
|
|
1041
1116
|
}
|
|
1042
|
-
function
|
|
1117
|
+
function useSetPointerEvents() {
|
|
1118
|
+
const pointerEventsDataAttribute = "data-v-onboarding-pointer-events";
|
|
1119
|
+
const addPointerEvents = (element, value = "auto") => {
|
|
1120
|
+
if (!element)
|
|
1121
|
+
return;
|
|
1122
|
+
const currentPointerEvents = element.style.pointerEvents;
|
|
1123
|
+
if (currentPointerEvents) {
|
|
1124
|
+
element.setAttribute(pointerEventsDataAttribute, currentPointerEvents);
|
|
1125
|
+
}
|
|
1126
|
+
element.style.setProperty("pointer-events", value);
|
|
1127
|
+
};
|
|
1128
|
+
const removePointerEvents = (element) => {
|
|
1129
|
+
if (!element)
|
|
1130
|
+
return;
|
|
1131
|
+
const storedPointerEvent = element.getAttribute(pointerEventsDataAttribute);
|
|
1132
|
+
if (storedPointerEvent) {
|
|
1133
|
+
element.style.setProperty("pointer-events", storedPointerEvent);
|
|
1134
|
+
element.removeAttribute(pointerEventsDataAttribute);
|
|
1135
|
+
} else {
|
|
1136
|
+
element.style.removeProperty("pointer-events");
|
|
1137
|
+
}
|
|
1138
|
+
};
|
|
1139
|
+
return { addPointerEvents, removePointerEvents };
|
|
1140
|
+
}
|
|
1141
|
+
function useStepHooks(stepOptions) {
|
|
1043
1142
|
const { setClassName, unsetClassName } = useSetElementClassName();
|
|
1044
|
-
const
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1143
|
+
const { addPointerEvents, removePointerEvents } = useSetPointerEvents();
|
|
1144
|
+
const beforeHook = (step, options) => {
|
|
1145
|
+
var _a, _b, _c, _d;
|
|
1146
|
+
const element = useGetElement(step.attachTo.element);
|
|
1147
|
+
if ((_b = (_a = stepOptions.value) == null ? void 0 : _a.overlay) == null ? void 0 : _b.preventOverlayInteraction) {
|
|
1148
|
+
addPointerEvents(element);
|
|
1149
|
+
}
|
|
1150
|
+
setClassName({ element, classList: step.attachTo.classList });
|
|
1151
|
+
return (_d = (_c = step.on) == null ? void 0 : _c.beforeStep) == null ? void 0 : _d.call(_c, options);
|
|
1048
1152
|
};
|
|
1049
|
-
const afterHook = (step) => {
|
|
1050
|
-
var _a, _b;
|
|
1051
|
-
|
|
1052
|
-
|
|
1153
|
+
const afterHook = (step, options) => {
|
|
1154
|
+
var _a, _b, _c, _d;
|
|
1155
|
+
const element = useGetElement(step.attachTo.element);
|
|
1156
|
+
if ((_b = (_a = stepOptions.value) == null ? void 0 : _a.overlay) == null ? void 0 : _b.preventOverlayInteraction) {
|
|
1157
|
+
removePointerEvents(element);
|
|
1158
|
+
}
|
|
1159
|
+
unsetClassName({ element, classList: step.attachTo.classList });
|
|
1160
|
+
return (_d = (_c = step.on) == null ? void 0 : _c.afterStep) == null ? void 0 : _d.call(_c, options);
|
|
1053
1161
|
};
|
|
1054
1162
|
return { beforeHook, afterHook };
|
|
1055
1163
|
}
|
|
1056
1164
|
const _hoisted_1 = {
|
|
1057
1165
|
key: 0,
|
|
1058
|
-
"data-v-onboarding-wrapper": ""
|
|
1166
|
+
"data-v-onboarding-wrapper": "",
|
|
1167
|
+
style: { "pointer-events": "auto" }
|
|
1059
1168
|
};
|
|
1060
1169
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1061
1170
|
const _component_VOnboardingStep = resolveComponent("VOnboardingStep");
|
|
1062
1171
|
return !_ctx.isFinished ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1063
|
-
renderSlot(_ctx.$slots, "default", {
|
|
1172
|
+
_ctx.showStep ? renderSlot(_ctx.$slots, "default", {
|
|
1064
1173
|
key: _ctx.index,
|
|
1065
1174
|
step: _ctx.activeStep,
|
|
1066
1175
|
next: _ctx.next,
|
|
@@ -1071,7 +1180,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1071
1180
|
index: _ctx.index
|
|
1072
1181
|
}, () => [
|
|
1073
1182
|
(openBlock(), createBlock(_component_VOnboardingStep, { key: _ctx.index }))
|
|
1074
|
-
])
|
|
1183
|
+
]) : createCommentVNode("", true)
|
|
1075
1184
|
])) : createCommentVNode("", true);
|
|
1076
1185
|
}
|
|
1077
1186
|
var VOnboardingWrapper = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
package/dist/v-onboarding.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
(function(E,Y){typeof exports=="object"&&typeof module!="undefined"?Y(exports,require("@popperjs/core"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@popperjs/core","vue"],Y):(E=typeof globalThis!="undefined"?globalThis:E||self,Y(E["v-onboarding"]={},E.core,E.Vue))})(this,function(E,Y,o){"use strict";const Nt=Symbol("onboardingState"),mt={IDLE:-1,FINISHED:-2};var ot=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},vt={exports:{}};(function(r,b){var p=200,m="__lodash_hash_undefined__",f=800,s=16,v=9007199254740991,N="[object Arguments]",V="[object Array]",I="[object AsyncFunction]",T="[object Boolean]",S="[object Date]",L="[object Error]",$="[object Function]",z="[object GeneratorFunction]",C="[object Map]",w="[object Number]",Q="[object Null]",u="[object Object]",a="[object Proxy]",l="[object RegExp]",x="[object Set]",j="[object String]",A="[object Undefined]",P="[object WeakMap]",k="[object ArrayBuffer]",D="[object DataView]",M="[object Float32Array]",U="[object Float64Array]",G="[object Int8Array]",R="[object Int16Array]",at="[object Int32Array]",st="[object Uint8Array]",lt="[object Uint8ClampedArray]",Ce="[object Uint16Array]",Be="[object Uint32Array]",Ee=/[\\^$.*+?()[\]{}|]/g,$e=/^\[object .+?Constructor\]$/,je=/^(?:0|[1-9]\d*)$/,g={};g[M]=g[U]=g[G]=g[R]=g[at]=g[st]=g[lt]=g[Ce]=g[Be]=!0,g[N]=g[V]=g[k]=g[T]=g[D]=g[S]=g[L]=g[$]=g[C]=g[w]=g[u]=g[l]=g[x]=g[j]=g[P]=!1;var zt=typeof ot=="object"&&ot&&ot.Object===Object&&ot,Ae=typeof self=="object"&&self&&self.Object===Object&&self,X=zt||Ae||Function("return this")(),Ft=b&&!b.nodeType&&b,tt=Ft&&!0&&r&&!r.nodeType&&r,Ht=tt&&tt.exports===Ft,yt=Ht&&zt.process,Pt=function(){try{var t=tt&&tt.require&&tt.require("util").types;return t||yt&&yt.binding&&yt.binding("util")}catch{}}(),kt=Pt&&Pt.isTypedArray;function Ne(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ve(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function Ie(t){return function(e){return t(e)}}function Le(t,e){return t==null?void 0:t[e]}function ze(t,e){return function(n){return t(e(n))}}var Fe=Array.prototype,He=Function.prototype,ct=Object.prototype,Tt=X["__core-js_shared__"],dt=He.toString,F=ct.hasOwnProperty,Dt=function(){var t=/[^.]+$/.exec(Tt&&Tt.keys&&Tt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Mt=ct.toString,Pe=dt.call(Object),ke=RegExp("^"+dt.call(F).replace(Ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=Ht?X.Buffer:void 0,Ut=X.Symbol,Gt=X.Uint8Array,Rt=ut?ut.allocUnsafe:void 0,qt=ze(Object.getPrototypeOf,Object),Kt=Object.create,De=ct.propertyIsEnumerable,Me=Fe.splice,q=Ut?Ut.toStringTag:void 0,ft=function(){try{var t=xt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ue=ut?ut.isBuffer:void 0,Wt=Math.max,Ge=Date.now,Qt=xt(X,"Map"),et=xt(Object,"create"),Re=function(){function t(){}return function(e){if(!W(e))return{};if(Kt)return Kt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function K(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function qe(){this.__data__=et?et(null):{},this.size=0}function Ke(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function We(t){var e=this.__data__;if(et){var n=e[t];return n===m?void 0:n}return F.call(e,t)?e[t]:void 0}function Qe(t){var e=this.__data__;return et?e[t]!==void 0:F.call(e,t)}function Ze(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=et&&e===void 0?m:e,this}K.prototype.clear=qe,K.prototype.delete=Ke,K.prototype.get=We,K.prototype.has=Qe,K.prototype.set=Ze;function H(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Je(){this.__data__=[],this.size=0}function Ye(t){var e=this.__data__,n=pt(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():Me.call(e,n,1),--this.size,!0}function Xe(t){var e=this.__data__,n=pt(e,t);return n<0?void 0:e[n][1]}function tn(t){return pt(this.__data__,t)>-1}function en(t,e){var n=this.__data__,i=pt(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}H.prototype.clear=Je,H.prototype.delete=Ye,H.prototype.get=Xe,H.prototype.has=tn,H.prototype.set=en;function Z(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function nn(){this.size=0,this.__data__={hash:new K,map:new(Qt||H),string:new K}}function rn(t){var e=gt(this,t).delete(t);return this.size-=e?1:0,e}function on(t){return gt(this,t).get(t)}function an(t){return gt(this,t).has(t)}function sn(t,e){var n=gt(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}Z.prototype.clear=nn,Z.prototype.delete=rn,Z.prototype.get=on,Z.prototype.has=an,Z.prototype.set=sn;function J(t){var e=this.__data__=new H(t);this.size=e.size}function ln(){this.__data__=new H,this.size=0}function cn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function dn(t){return this.__data__.get(t)}function un(t){return this.__data__.has(t)}function fn(t,e){var n=this.__data__;if(n instanceof H){var i=n.__data__;if(!Qt||i.length<p-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Z(i)}return n.set(t,e),this.size=n.size,this}J.prototype.clear=ln,J.prototype.delete=cn,J.prototype.get=dn,J.prototype.has=un,J.prototype.set=fn;function pn(t,e){var n=Bt(t),i=!n&&Ct(t),d=!n&&!i&&te(t),h=!n&&!i&&!d&&ne(t),_=n||i||d||h,c=_?Ve(t.length,String):[],y=c.length;for(var B in t)(e||F.call(t,B))&&!(_&&(B=="length"||d&&(B=="offset"||B=="parent")||h&&(B=="buffer"||B=="byteLength"||B=="byteOffset")||Yt(B,y)))&&c.push(B);return c}function St(t,e,n){(n!==void 0&&!bt(t[e],n)||n===void 0&&!(e in t))&&wt(t,e,n)}function hn(t,e,n){var i=t[e];(!(F.call(t,e)&&bt(i,n))||n===void 0&&!(e in t))&&wt(t,e,n)}function pt(t,e){for(var n=t.length;n--;)if(bt(t[n][0],e))return n;return-1}function wt(t,e,n){e=="__proto__"&&ft?ft(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var gn=En();function ht(t){return t==null?t===void 0?A:Q:q&&q in Object(t)?$n(t):Ln(t)}function Zt(t){return nt(t)&&ht(t)==N}function bn(t){if(!W(t)||Vn(t))return!1;var e=$t(t)?ke:$e;return e.test(Pn(t))}function mn(t){return nt(t)&&ee(t.length)&&!!g[ht(t)]}function vn(t){if(!W(t))return In(t);var e=Xt(t),n=[];for(var i in t)i=="constructor"&&(e||!F.call(t,i))||n.push(i);return n}function Jt(t,e,n,i,d){t!==e&&gn(e,function(h,_){if(d||(d=new J),W(h))_n(t,e,_,n,Jt,i,d);else{var c=i?i(Ot(t,_),h,_+"",t,e,d):void 0;c===void 0&&(c=h),St(t,_,c)}},re)}function _n(t,e,n,i,d,h,_){var c=Ot(t,n),y=Ot(e,n),B=_.get(y);if(B){St(t,n,B);return}var O=h?h(c,y,n+"",t,e,_):void 0,rt=O===void 0;if(rt){var jt=Bt(y),At=!jt&&te(y),ie=!jt&&!At&&ne(y);O=y,jt||At||ie?Bt(c)?O=c:kn(c)?O=On(c):At?(rt=!1,O=Sn(y,!0)):ie?(rt=!1,O=xn(y,!0)):O=[]:Dn(y)||Ct(y)?(O=c,Ct(c)?O=Mn(c):(!W(c)||$t(c))&&(O=jn(y))):rt=!1}rt&&(_.set(y,O),d(O,y,i,h,_),_.delete(y)),St(t,n,O)}function yn(t,e){return Fn(zn(t,e,oe),t+"")}var Tn=ft?function(t,e){return ft(t,"toString",{configurable:!0,enumerable:!1,value:Gn(e),writable:!0})}:oe;function Sn(t,e){if(e)return t.slice();var n=t.length,i=Rt?Rt(n):new t.constructor(n);return t.copy(i),i}function wn(t){var e=new t.constructor(t.byteLength);return new Gt(e).set(new Gt(t)),e}function xn(t,e){var n=e?wn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function On(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function Cn(t,e,n,i){var d=!n;n||(n={});for(var h=-1,_=e.length;++h<_;){var c=e[h],y=i?i(n[c],t[c],c,n,t):void 0;y===void 0&&(y=t[c]),d?wt(n,c,y):hn(n,c,y)}return n}function Bn(t){return yn(function(e,n){var i=-1,d=n.length,h=d>1?n[d-1]:void 0,_=d>2?n[2]:void 0;for(h=t.length>3&&typeof h=="function"?(d--,h):void 0,_&&An(n[0],n[1],_)&&(h=d<3?void 0:h,d=1),e=Object(e);++i<d;){var c=n[i];c&&t(e,c,i,h)}return e})}function En(t){return function(e,n,i){for(var d=-1,h=Object(e),_=i(e),c=_.length;c--;){var y=_[t?c:++d];if(n(h[y],y,h)===!1)break}return e}}function gt(t,e){var n=t.__data__;return Nn(e)?n[typeof e=="string"?"string":"hash"]:n.map}function xt(t,e){var n=Le(t,e);return bn(n)?n:void 0}function $n(t){var e=F.call(t,q),n=t[q];try{t[q]=void 0;var i=!0}catch{}var d=Mt.call(t);return i&&(e?t[q]=n:delete t[q]),d}function jn(t){return typeof t.constructor=="function"&&!Xt(t)?Re(qt(t)):{}}function Yt(t,e){var n=typeof t;return e=e==null?v:e,!!e&&(n=="number"||n!="symbol"&&je.test(t))&&t>-1&&t%1==0&&t<e}function An(t,e,n){if(!W(n))return!1;var i=typeof e;return(i=="number"?Et(n)&&Yt(e,n.length):i=="string"&&e in n)?bt(n[e],t):!1}function Nn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Vn(t){return!!Dt&&Dt in t}function Xt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||ct;return t===n}function In(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Ln(t){return Mt.call(t)}function zn(t,e,n){return e=Wt(e===void 0?t.length-1:e,0),function(){for(var i=arguments,d=-1,h=Wt(i.length-e,0),_=Array(h);++d<h;)_[d]=i[e+d];d=-1;for(var c=Array(e+1);++d<e;)c[d]=i[d];return c[e]=n(_),Ne(t,this,c)}}function Ot(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Fn=Hn(Tn);function Hn(t){var e=0,n=0;return function(){var i=Ge(),d=s-(i-n);if(n=i,d>0){if(++e>=f)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Pn(t){if(t!=null){try{return dt.call(t)}catch{}try{return t+""}catch{}}return""}function bt(t,e){return t===e||t!==t&&e!==e}var Ct=Zt(function(){return arguments}())?Zt:function(t){return nt(t)&&F.call(t,"callee")&&!De.call(t,"callee")},Bt=Array.isArray;function Et(t){return t!=null&&ee(t.length)&&!$t(t)}function kn(t){return nt(t)&&Et(t)}var te=Ue||Rn;function $t(t){if(!W(t))return!1;var e=ht(t);return e==$||e==z||e==I||e==a}function ee(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=v}function W(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function nt(t){return t!=null&&typeof t=="object"}function Dn(t){if(!nt(t)||ht(t)!=u)return!1;var e=qt(t);if(e===null)return!0;var n=F.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&dt.call(n)==Pe}var ne=kt?Ie(kt):mn;function Mn(t){return Cn(t,re(t))}function re(t){return Et(t)?pn(t,!0):vn(t)}var Un=Bn(function(t,e,n){Jt(t,e,n)});function Gn(t){return function(){return t}}function oe(t){return t}function Rn(){return!1}r.exports=Un})(vt,vt.exports);var Vt=vt.exports;function _t(r){return typeof r=="string"?document.querySelector(r):typeof r=="function"?r():null}const it={popper:{},overlay:{enabled:!0,padding:0,borderRadius:0},scrollToStep:{enabled:!0,options:{behavior:"smooth",block:"center",inline:"center"}},autoFinishByExit:!0,labels:{previousButton:"Previous",nextButton:"Next",finishButton:"Finish"},hideButtons:{previous:!1,next:!1,exit:!1}};function ae(){var v,N,V,I;const r=o.ref(""),b=o.ref(null),p=o.ref((N=(v=it.overlay)==null?void 0:v.padding)!=null?N:0),m=o.ref((I=(V=it.overlay)==null?void 0:V.borderRadius)!=null?I:0),f=()=>{s(b.value,{padding:p.value,borderRadius:m.value})},s=async(T,S=it.overlay)=>{var j,A,P,k,D,M,U,G,R,at,st,lt;if(!T)return;const{innerWidth:L,innerHeight:$}=window,{left:z,top:C,width:w,height:Q}=T.getBoundingClientRect(),u=typeof S.padding=="number"?{top:S.padding,right:S.padding,bottom:S.padding,left:S.padding}:S.padding,a=typeof S.borderRadius=="number"?{leftTop:S.borderRadius,rightTop:S.borderRadius,rightBottom:S.borderRadius,leftBottom:S.borderRadius}:S.borderRadius,l={top:C-((j=u==null?void 0:u.top)!=null?j:0),right:z+w+((A=u==null?void 0:u.right)!=null?A:0),bottom:C+Q+((P=u==null?void 0:u.bottom)!=null?P:0),left:z-((k=u==null?void 0:u.left)!=null?k:0)},x={leftTop:`M${l.left+((D=a==null?void 0:a.leftTop)!=null?D:0)},${l.top} Q${l.left},${l.top} ${l.left},${l.top+((M=a==null?void 0:a.leftTop)!=null?M:0)}`,rightTop:`V${l.top+((U=a==null?void 0:a.rightTop)!=null?U:0)} Q${l.right},${l.top} ${l.right-((G=a==null?void 0:a.rightTop)!=null?G:0)},${l.top}`,rightBottom:`H${l.right-((R=a==null?void 0:a.rightBottom)!=null?R:0)} Q${l.right},${l.bottom} ${l.right},${l.bottom-((at=a==null?void 0:a.rightBottom)!=null?at:0)}`,leftBottom:`V${l.bottom-((st=a==null?void 0:a.leftBottom)!=null?st:0)} Q${l.left},${l.bottom} ${l.left+((lt=a==null?void 0:a.leftBottom)!=null?lt:0)},${l.bottom}`};r.value=`
|
|
2
|
-
M${
|
|
1
|
+
(function(O,x){typeof exports=="object"&&typeof module!="undefined"?x(exports,require("@popperjs/core"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@popperjs/core","vue"],x):(O=typeof globalThis!="undefined"?globalThis:O||self,x(O["v-onboarding"]={},O.core,O.Vue))})(this,function(O,x,o){"use strict";var Xn=Object.defineProperty,tr=Object.defineProperties;var er=Object.getOwnPropertyDescriptors;var de=Object.getOwnPropertySymbols;var nr=Object.prototype.hasOwnProperty,rr=Object.prototype.propertyIsEnumerable;var ue=(O,x,o)=>x in O?Xn(O,x,{enumerable:!0,configurable:!0,writable:!0,value:o}):O[x]=o,It=(O,x)=>{for(var o in x||(x={}))nr.call(x,o)&&ue(O,o,x[o]);if(de)for(var o of de(x))rr.call(x,o)&&ue(O,o,x[o]);return O},Pt=(O,x)=>tr(O,er(x));const Lt=Symbol("onboardingState"),rt={IDLE:-1,FINISHED:-2},ct={BACKWARD:-1,FORWARD:1};var dt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},St={exports:{}};(function(r,v){var h=200,d="__lodash_hash_undefined__",_=800,p=16,m=9007199254740991,E="[object Arguments]",A="[object Array]",C="[object AsyncFunction]",g="[object Boolean]",S="[object Date]",B="[object Error]",$="[object Function]",D="[object GeneratorFunction]",H="[object Map]",Q="[object Number]",tt="[object Null]",s="[object Object]",a="[object Proxy]",l="[object RegExp]",N="[object Set]",j="[object String]",f="[object Undefined]",F="[object WeakMap]",k="[object ArrayBuffer]",z="[object DataView]",P="[object Float32Array]",V="[object Float64Array]",M="[object Int8Array]",R="[object Int16Array]",U="[object Int32Array]",Z="[object Uint8Array]",K="[object Uint8ClampedArray]",Ve="[object Uint16Array]",Ie="[object Uint32Array]",Pe=/[\\^$.*+?()[\]{}|]/g,Le=/^\[object .+?Constructor\]$/,De=/^(?:0|[1-9]\d*)$/,y={};y[P]=y[V]=y[M]=y[R]=y[U]=y[Z]=y[K]=y[Ve]=y[Ie]=!0,y[E]=y[A]=y[k]=y[g]=y[z]=y[S]=y[B]=y[$]=y[H]=y[Q]=y[s]=y[l]=y[N]=y[j]=y[F]=!1;var Ht=typeof dt=="object"&&dt&&dt.Object===Object&&dt,Fe=typeof self=="object"&&self&&self.Object===Object&&self,ot=Ht||Fe||Function("return this")(),zt=v&&!v.nodeType&&v,it=zt&&!0&&r&&!r.nodeType&&r,Mt=it&&it.exports===zt,Tt=Mt&&Ht.process,Rt=function(){try{var t=it&&it.require&&it.require("util").types;return t||Tt&&Tt.binding&&Tt.binding("util")}catch{}}(),Ut=Rt&&Rt.isTypedArray;function ke(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function He(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function ze(t){return function(e){return t(e)}}function Me(t,e){return t==null?void 0:t[e]}function Re(t,e){return function(n){return t(e(n))}}var Ue=Array.prototype,Ge=Function.prototype,pt=Object.prototype,wt=ot["__core-js_shared__"],ht=Ge.toString,G=pt.hasOwnProperty,Gt=function(){var t=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Wt=pt.toString,We=ht.call(Object),Ke=RegExp("^"+ht.call(G).replace(Pe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gt=Mt?ot.Buffer:void 0,Kt=ot.Symbol,qt=ot.Uint8Array,Qt=gt?gt.allocUnsafe:void 0,Zt=Re(Object.getPrototypeOf,Object),Jt=Object.create,qe=pt.propertyIsEnumerable,Qe=Ue.splice,J=Kt?Kt.toStringTag:void 0,bt=function(){try{var t=xt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ze=gt?gt.isBuffer:void 0,Yt=Math.max,Je=Date.now,Xt=xt(ot,"Map"),at=xt(Object,"create"),Ye=function(){function t(){}return function(e){if(!X(e))return{};if(Jt)return Jt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Y(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Xe(){this.__data__=at?at(null):{},this.size=0}function tn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function en(t){var e=this.__data__;if(at){var n=e[t];return n===d?void 0:n}return G.call(e,t)?e[t]:void 0}function nn(t){var e=this.__data__;return at?e[t]!==void 0:G.call(e,t)}function rn(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=at&&e===void 0?d:e,this}Y.prototype.clear=Xe,Y.prototype.delete=tn,Y.prototype.get=en,Y.prototype.has=nn,Y.prototype.set=rn;function W(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function on(){this.__data__=[],this.size=0}function an(t){var e=this.__data__,n=vt(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():Qe.call(e,n,1),--this.size,!0}function sn(t){var e=this.__data__,n=vt(e,t);return n<0?void 0:e[n][1]}function ln(t){return vt(this.__data__,t)>-1}function cn(t,e){var n=this.__data__,i=vt(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}W.prototype.clear=on,W.prototype.delete=an,W.prototype.get=sn,W.prototype.has=ln,W.prototype.set=cn;function et(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function dn(){this.size=0,this.__data__={hash:new Y,map:new(Xt||W),string:new Y}}function un(t){var e=yt(this,t).delete(t);return this.size-=e?1:0,e}function fn(t){return yt(this,t).get(t)}function pn(t){return yt(this,t).has(t)}function hn(t,e){var n=yt(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}et.prototype.clear=dn,et.prototype.delete=un,et.prototype.get=fn,et.prototype.has=pn,et.prototype.set=hn;function nt(t){var e=this.__data__=new W(t);this.size=e.size}function gn(){this.__data__=new W,this.size=0}function bn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function vn(t){return this.__data__.get(t)}function mn(t){return this.__data__.has(t)}function yn(t,e){var n=this.__data__;if(n instanceof W){var i=n.__data__;if(!Xt||i.length<h-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new et(i)}return n.set(t,e),this.size=n.size,this}nt.prototype.clear=gn,nt.prototype.delete=bn,nt.prototype.get=vn,nt.prototype.has=mn,nt.prototype.set=yn;function _n(t,e){var n=At(t),i=!n&&Ct(t),u=!n&&!i&&oe(t),b=!n&&!i&&!u&&ae(t),T=n||i||u||b,c=T?He(t.length,String):[],w=c.length;for(var L in t)(e||G.call(t,L))&&!(T&&(L=="length"||u&&(L=="offset"||L=="parent")||b&&(L=="buffer"||L=="byteLength"||L=="byteOffset")||ne(L,w)))&&c.push(L);return c}function Et(t,e,n){(n!==void 0&&!_t(t[e],n)||n===void 0&&!(e in t))&&Ot(t,e,n)}function Sn(t,e,n){var i=t[e];(!(G.call(t,e)&&_t(i,n))||n===void 0&&!(e in t))&&Ot(t,e,n)}function vt(t,e){for(var n=t.length;n--;)if(_t(t[n][0],e))return n;return-1}function Ot(t,e,n){e=="__proto__"&&bt?bt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var Tn=Pn();function mt(t){return t==null?t===void 0?f:tt:J&&J in Object(t)?Ln(t):Mn(t)}function te(t){return st(t)&&mt(t)==E}function wn(t){if(!X(t)||Hn(t))return!1;var e=Nt(t)?Ke:Le;return e.test(Wn(t))}function En(t){return st(t)&&ie(t.length)&&!!y[mt(t)]}function On(t){if(!X(t))return zn(t);var e=re(t),n=[];for(var i in t)i=="constructor"&&(e||!G.call(t,i))||n.push(i);return n}function ee(t,e,n,i,u){t!==e&&Tn(e,function(b,T){if(u||(u=new nt),X(b))xn(t,e,T,n,ee,i,u);else{var c=i?i(Bt(t,T),b,T+"",t,e,u):void 0;c===void 0&&(c=b),Et(t,T,c)}},se)}function xn(t,e,n,i,u,b,T){var c=Bt(t,n),w=Bt(e,n),L=T.get(w);if(L){Et(t,n,L);return}var I=b?b(c,w,n+"",t,e,T):void 0,lt=I===void 0;if(lt){var jt=At(w),Vt=!jt&&oe(w),ce=!jt&&!Vt&&ae(w);I=w,jt||Vt||ce?At(c)?I=c:Kn(c)?I=jn(c):Vt?(lt=!1,I=An(w,!0)):ce?(lt=!1,I=Nn(w,!0)):I=[]:qn(w)||Ct(w)?(I=c,Ct(c)?I=Qn(c):(!X(c)||Nt(c))&&(I=Dn(w))):lt=!1}lt&&(T.set(w,I),u(I,w,i,b,T),T.delete(w)),Et(t,n,I)}function Bn(t,e){return Un(Rn(t,e,le),t+"")}var Cn=bt?function(t,e){return bt(t,"toString",{configurable:!0,enumerable:!1,value:Jn(e),writable:!0})}:le;function An(t,e){if(e)return t.slice();var n=t.length,i=Qt?Qt(n):new t.constructor(n);return t.copy(i),i}function $n(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function Nn(t,e){var n=e?$n(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function jn(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function Vn(t,e,n,i){var u=!n;n||(n={});for(var b=-1,T=e.length;++b<T;){var c=e[b],w=i?i(n[c],t[c],c,n,t):void 0;w===void 0&&(w=t[c]),u?Ot(n,c,w):Sn(n,c,w)}return n}function In(t){return Bn(function(e,n){var i=-1,u=n.length,b=u>1?n[u-1]:void 0,T=u>2?n[2]:void 0;for(b=t.length>3&&typeof b=="function"?(u--,b):void 0,T&&Fn(n[0],n[1],T)&&(b=u<3?void 0:b,u=1),e=Object(e);++i<u;){var c=n[i];c&&t(e,c,i,b)}return e})}function Pn(t){return function(e,n,i){for(var u=-1,b=Object(e),T=i(e),c=T.length;c--;){var w=T[t?c:++u];if(n(b[w],w,b)===!1)break}return e}}function yt(t,e){var n=t.__data__;return kn(e)?n[typeof e=="string"?"string":"hash"]:n.map}function xt(t,e){var n=Me(t,e);return wn(n)?n:void 0}function Ln(t){var e=G.call(t,J),n=t[J];try{t[J]=void 0;var i=!0}catch{}var u=Wt.call(t);return i&&(e?t[J]=n:delete t[J]),u}function Dn(t){return typeof t.constructor=="function"&&!re(t)?Ye(Zt(t)):{}}function ne(t,e){var n=typeof t;return e=e==null?m:e,!!e&&(n=="number"||n!="symbol"&&De.test(t))&&t>-1&&t%1==0&&t<e}function Fn(t,e,n){if(!X(n))return!1;var i=typeof e;return(i=="number"?$t(n)&&ne(e,n.length):i=="string"&&e in n)?_t(n[e],t):!1}function kn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Hn(t){return!!Gt&&Gt in t}function re(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||pt;return t===n}function zn(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Mn(t){return Wt.call(t)}function Rn(t,e,n){return e=Yt(e===void 0?t.length-1:e,0),function(){for(var i=arguments,u=-1,b=Yt(i.length-e,0),T=Array(b);++u<b;)T[u]=i[e+u];u=-1;for(var c=Array(e+1);++u<e;)c[u]=i[u];return c[e]=n(T),ke(t,this,c)}}function Bt(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Un=Gn(Cn);function Gn(t){var e=0,n=0;return function(){var i=Je(),u=p-(i-n);if(n=i,u>0){if(++e>=_)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Wn(t){if(t!=null){try{return ht.call(t)}catch{}try{return t+""}catch{}}return""}function _t(t,e){return t===e||t!==t&&e!==e}var Ct=te(function(){return arguments}())?te:function(t){return st(t)&&G.call(t,"callee")&&!qe.call(t,"callee")},At=Array.isArray;function $t(t){return t!=null&&ie(t.length)&&!Nt(t)}function Kn(t){return st(t)&&$t(t)}var oe=Ze||Yn;function Nt(t){if(!X(t))return!1;var e=mt(t);return e==$||e==D||e==C||e==a}function ie(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=m}function X(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function st(t){return t!=null&&typeof t=="object"}function qn(t){if(!st(t)||mt(t)!=s)return!1;var e=Zt(t);if(e===null)return!0;var n=G.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ht.call(n)==We}var ae=Ut?ze(Ut):En;function Qn(t){return Vn(t,se(t))}function se(t){return $t(t)?_n(t,!0):On(t)}var Zn=In(function(t,e,n){ee(t,e,n)});function Jn(t){return function(){return t}}function le(t){return t}function Yn(){return!1}r.exports=Zn})(St,St.exports);var ut=St.exports;function q(r){return typeof r=="string"?document.querySelector(r):typeof r=="function"?r():null}const ft={popper:{},overlay:{enabled:!0,padding:0,borderRadius:0,preventOverlayInteraction:!0},scrollToStep:{enabled:!0,options:{behavior:"smooth",block:"center",inline:"center"}},autoFinishByExit:!0,labels:{previousButton:"Previous",nextButton:"Next",finishButton:"Finish"},hideButtons:{previous:!1,next:!1,exit:!1},hideNextStepDuringHook:!1};function fe(){var m,E,A,C;const r=o.ref(""),v=o.ref(null),h=o.ref((E=(m=ft.overlay)==null?void 0:m.padding)!=null?E:0),d=o.ref((C=(A=ft.overlay)==null?void 0:A.borderRadius)!=null?C:0),_=()=>{p(v.value,{padding:h.value,borderRadius:d.value})},p=async(g,S=ft.overlay)=>{var j,f,F,k,z,P,V,M,R,U,Z,K;if(!g)return;const{innerWidth:B,innerHeight:$}=window,{left:D,top:H,width:Q,height:tt}=g.getBoundingClientRect(),s=typeof S.padding=="number"?{top:S.padding,right:S.padding,bottom:S.padding,left:S.padding}:S.padding,a=typeof S.borderRadius=="number"?{leftTop:S.borderRadius,rightTop:S.borderRadius,rightBottom:S.borderRadius,leftBottom:S.borderRadius}:S.borderRadius,l={top:H-((j=s==null?void 0:s.top)!=null?j:0),right:D+Q+((f=s==null?void 0:s.right)!=null?f:0),bottom:H+tt+((F=s==null?void 0:s.bottom)!=null?F:0),left:D-((k=s==null?void 0:s.left)!=null?k:0)},N={leftTop:`M${l.left+((z=a==null?void 0:a.leftTop)!=null?z:0)},${l.top} Q${l.left},${l.top} ${l.left},${l.top+((P=a==null?void 0:a.leftTop)!=null?P:0)}`,rightTop:`V${l.top+((V=a==null?void 0:a.rightTop)!=null?V:0)} Q${l.right},${l.top} ${l.right-((M=a==null?void 0:a.rightTop)!=null?M:0)},${l.top}`,rightBottom:`H${l.right-((R=a==null?void 0:a.rightBottom)!=null?R:0)} Q${l.right},${l.bottom} ${l.right},${l.bottom-((U=a==null?void 0:a.rightBottom)!=null?U:0)}`,leftBottom:`V${l.bottom-((Z=a==null?void 0:a.leftBottom)!=null?Z:0)} Q${l.left},${l.bottom} ${l.left+((K=a==null?void 0:a.leftBottom)!=null?K:0)},${l.bottom}`};r.value=`
|
|
2
|
+
M${B},${$}
|
|
3
3
|
H0V0
|
|
4
|
-
H${
|
|
4
|
+
H${B}V${$}
|
|
5
5
|
Z
|
|
6
|
-
${
|
|
7
|
-
${
|
|
8
|
-
${
|
|
9
|
-
${
|
|
6
|
+
${N.leftTop}
|
|
7
|
+
${N.leftBottom}
|
|
8
|
+
${N.rightBottom}
|
|
9
|
+
${N.rightTop}
|
|
10
10
|
Z
|
|
11
|
-
`,b.value=T,p.value=u,m.value=a};return o.onMounted(()=>{window.addEventListener("scroll",f),window.addEventListener("resize",f)}),o.onUnmounted(()=>{window.removeEventListener("scroll",f),window.removeEventListener("resize",f)}),{path:r,updatePath:s}}var It=(r,b)=>{const p=r.__vccOpts||r;for(const[m,f]of b)p[m]=f;return p};const se=o.defineComponent({name:"VOnboardingStep",setup(){const r=o.ref(!1),b=o.inject(Nt,{}),{step:p,isFirstStep:m,isLastStep:f,options:s,next:v,previous:N,exit:V,finish:I}=b.value,T=o.computed(()=>Vt({},s==null?void 0:s.value,p.value.options)),S=o.computed(()=>{var u,a,l;return{previous:!((u=T.value.hideButtons)!=null&&u.previous),next:!((a=T.value.hideButtons)!=null&&a.next),exit:!((l=T.value.hideButtons)!=null&&l.exit)}}),L=o.computed(()=>{var u,a,l,x,j,A;return{previous:(a=(u=T.value)==null?void 0:u.labels)==null?void 0:a.previousButton,next:(x=(l=T.value)==null?void 0:l.labels)==null?void 0:x.nextButton,finish:(A=(j=T.value)==null?void 0:j.labels)==null?void 0:A.finishButton}}),{updatePath:$,path:z}=ae(),C=o.ref(),w=async()=>{var a,l,x,j,A,P,k,D,M,U,G,R;await o.nextTick();const u=_t((l=(a=p==null?void 0:p.value)==null?void 0:a.attachTo)==null?void 0:l.element);u&&C.value&&(r.value=!0,(j=(x=T.value)==null?void 0:x.scrollToStep)!=null&&j.enabled&&u.scrollIntoView((P=(A=T.value)==null?void 0:A.scrollToStep)==null?void 0:P.options),Y.createPopper(u,C.value,T.value.popper),(D=(k=T.value)==null?void 0:k.overlay)!=null&&D.enabled&&$(u,{padding:(U=(M=T.value)==null?void 0:M.overlay)==null?void 0:U.padding,borderRadius:(R=(G=T.value)==null?void 0:G.overlay)==null?void 0:R.borderRadius}))};return o.watch(p,w,{immediate:!0}),{stepElement:C,next:v,previous:N,path:z,show:r,step:p,isFirstStep:m,isLastStep:f,exit:()=>{var u;V(),(u=T.value)!=null&&u.autoFinishByExit&&I()},finish:I,isButtonVisible:S,buttonLabels:L}}}),le={style:{width:"100%",height:"100%",position:"fixed",top:"0",left:"0",fill:"var(--v-onboarding-overlay-fill, black)",opacity:"var(--v-onboarding-overlay-opacity, 0.5)","z-index":"var(--v-onboarding-overlay-z, 10)","pointer-events":"none"}},ce=["d"],de={ref:"stepElement",style:{position:"relative","z-index":"var(--v-onboarding-step-z, 20)"}},ue={class:"v-onboarding-item"},fe={class:"v-onboarding-item__header"},pe={key:0,class:"v-onboarding-item__header-title"},he=[o.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[o.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)],ge={key:0,class:"v-onboarding-item__description"},be={class:"v-onboarding-item__actions"},me=o.createElementVNode("div",{"data-popper-arrow":""},null,-1);function ve(r,b,p,m,f,s){return o.withDirectives((o.openBlock(),o.createElementBlock("div",null,[(o.openBlock(),o.createElementBlock("svg",le,[o.createElementVNode("path",{d:r.path},null,8,ce)])),o.createElementVNode("div",de,[r.step?o.renderSlot(r.$slots,"default",{key:0},()=>[o.createElementVNode("div",ue,[o.createElementVNode("div",fe,[r.step.content.title?(o.openBlock(),o.createElementBlock("span",pe,o.toDisplayString(r.step.content.title),1)):o.createCommentVNode("",!0),r.isButtonVisible.exit?(o.openBlock(),o.createElementBlock("button",{key:1,onClick:b[0]||(b[0]=(...v)=>r.exit&&r.exit(...v)),class:"v-onboarding-item__header-close"},he)):o.createCommentVNode("",!0)]),r.step.content.description?(o.openBlock(),o.createElementBlock("p",ge,o.toDisplayString(r.step.content.description),1)):o.createCommentVNode("",!0),o.createElementVNode("div",be,[!r.isFirstStep&&r.isButtonVisible.previous?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",onClick:b[1]||(b[1]=(...v)=>r.previous&&r.previous(...v)),class:"v-onboarding-btn-secondary"},o.toDisplayString(r.buttonLabels.previous),1)):o.createCommentVNode("",!0),r.isButtonVisible.next?(o.openBlock(),o.createElementBlock("button",{key:1,onClick:b[2]||(b[2]=()=>r.isLastStep?r.finish():r.next()),type:"button",class:"v-onboarding-btn-primary"},o.toDisplayString(r.isLastStep?r.buttonLabels.finish:r.buttonLabels.next),1)):o.createCommentVNode("",!0)])])]):o.createCommentVNode("",!0),me],512)],512)),[[o.vShow,r.show]])}var Lt=It(se,[["render",ve]]);const _e=o.defineComponent({name:"VOnboardingWrapper",components:{VOnboardingStep:Lt},props:{steps:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})}},emits:["finish","exit"],setup(r,{expose:b,emit:p}){const m=o.ref(mt.IDLE),f=o.ref(m.value),s=w=>{typeof w=="function"?m.value=w(m.value):m.value=w},{beforeHook:v,afterHook:N}=Te(),V=o.computed(()=>{var w;return(w=r.steps)==null?void 0:w[f.value]});o.watch(m,async(w,Q)=>{var l,x;const u=(l=r.steps)==null?void 0:l[Q];u&&await N(u);const a=(x=r.steps)==null?void 0:x[w];a&&await v(a),f.value=w});const I=o.computed(()=>f.value===mt.FINISHED),T=()=>s(0),S=()=>{s(mt.FINISHED),p("finish")},L=()=>p("exit");b({start:T,finish:S,goToStep:s});const $=()=>{s(w=>w-1)},z=()=>{const w=f.value+1;if(w===r.steps.length){S();return}s(w)},C=o.computed(()=>({step:V,options:o.computed(()=>Vt({},it,r.options)),next:z,previous:$,finish:S,exit:L,isFirstStep:o.computed(()=>f.value===0),isLastStep:o.computed(()=>f.value===r.steps.length-1)}));return o.provide(Nt,C),{index:m,activeStep:V,next:z,previous:$,isFinished:I,setIndex:s,isFirstStep:C.value.isFirstStep,isLastStep:C.value.isLastStep,finish:S,exit:L}}});function ye(){return{setClassName:({element:p,classList:m=[]})=>{!p||p.classList.add(...m)},unsetClassName:({element:p,classList:m=[]})=>{!p||p.classList.remove(...m)}}}function Te(){const{setClassName:r,unsetClassName:b}=ye();return{beforeHook:f=>{var s,v;return r({element:_t(f.attachTo.element),classList:f.attachTo.classList}),(v=(s=f.on)==null?void 0:s.beforeStep)==null?void 0:v.call(s)},afterHook:f=>{var s,v;return b({element:_t(f.attachTo.element),classList:f.attachTo.classList}),(v=(s=f.on)==null?void 0:s.afterStep)==null?void 0:v.call(s)}}}const Se={key:0,"data-v-onboarding-wrapper":""};function we(r,b,p,m,f,s){const v=o.resolveComponent("VOnboardingStep");return r.isFinished?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Se,[o.renderSlot(r.$slots,"default",{key:r.index,step:r.activeStep,next:r.next,previous:r.previous,exit:r.exit,isFirst:r.isFirstStep,isLast:r.isLastStep,index:r.index},()=>[(o.openBlock(),o.createBlock(v,{key:r.index}))])]))}var xe=It(_e,[["render",we]]);function Oe(r){return{start:()=>{var s;return(s=r==null?void 0:r.value)==null?void 0:s.start()},finish:()=>{var s;return(s=r==null?void 0:r.value)==null?void 0:s.finish()},exit:()=>{var s;return(s=r==null?void 0:r.value)==null?void 0:s.exit()},goToStep:s=>{var v;return(v=r==null?void 0:r.value)==null?void 0:v.goToStep(s)}}}var Kn=(()=>`.v-onboarding-item{width:20rem;padding:1rem;background-color:#fff;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;border-radius:.375rem}.v-onboarding-item__header{display:flex;justify-content:space-between}.v-onboarding-item__header-title{font-size:1.25rem;font-weight:500;line-height:1.5}.v-onboarding-item__header-close{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;flex-shrink:0;border-radius:50%}.v-onboarding-item__header-close:hover{background:rgba(0,0,0,.1)}.v-onboarding-item__description{font-size:.875rem;color:#71717a;margin-top:.5rem}.v-onboarding-item__actions{display:flex;margin-top:1rem}.v-onboarding-item__actions>:not([hidden])~:not([hidden]){margin-left:.5rem}.v-onboarding-item__actions button{display:inline-flex;flex:1;align-items:center;justify-content:center;padding:.5rem 1.25rem;border-width:1px;border-style:solid;font-size:1rem;font-weight:500;box-shadow:0 1px 2px #0000000d;border-radius:9999px;background-color:transparent;background-image:none;cursor:pointer}.v-onboarding-item__actions button.v-onboarding-btn-primary{border-color:transparent;color:#fff;background-color:#4f46e5}.v-onboarding-item__actions button.v-onboarding-btn-primary:hover{background-color:#4338ca}.v-onboarding-item__actions button.v-onboarding-btn-secondary{border-color:#d4d4d8;color:#3f3f46}.v-onboarding-item__actions button.v-onboarding-btn-secondary:hover{background-color:#fafafa}[data-v-onboarding-wrapper] [data-popper-arrow]:before{content:"";background:var(--v-onboarding-step-arrow-background, white);top:0;left:0;transition:transform .2s ease-out,visibility .2s ease-out;visibility:visible;transform:translate(0) rotate(45deg);transform-origin:center;width:var(--v-onboarding-step-arrow-size, 10px);height:var(--v-onboarding-step-arrow-size, 10px);position:absolute;z-index:-1}[data-v-onboarding-wrapper] [data-popper-placement^=top]>[data-popper-arrow]{bottom:5px}[data-v-onboarding-wrapper] [data-popper-placement^=right]>[data-popper-arrow]{left:-4px}[data-v-onboarding-wrapper] [data-popper-placement^=bottom]>[data-popper-arrow]{top:-4px}[data-v-onboarding-wrapper] [data-popper-placement^=left]>[data-popper-arrow]{right:-4px}
|
|
12
|
-
`)();
|
|
11
|
+
`,v.value=g,h.value=s,d.value=a};return o.onMounted(()=>{window.addEventListener("scroll",_),window.addEventListener("resize",_)}),o.onUnmounted(()=>{window.removeEventListener("scroll",_),window.removeEventListener("resize",_)}),{path:r,updatePath:p}}var Dt=(r,v)=>{const h=r.__vccOpts||r;for(const[d,_]of v)h[d]=_;return h};const pe=o.defineComponent({name:"VOnboardingStep",setup(){const r=o.ref(!1),v=o.inject(Lt,{}),{step:h,isFirstStep:d,isLastStep:_,options:p,next:m,previous:E,exit:A,finish:C}=v.value,g=o.computed(()=>ut({},p==null?void 0:p.value,h.value.options)),S=o.computed(()=>{var s,a,l;return{previous:!((s=g.value.hideButtons)!=null&&s.previous),next:!((a=g.value.hideButtons)!=null&&a.next),exit:!((l=g.value.hideButtons)!=null&&l.exit)}}),B=o.computed(()=>{var s,a,l,N,j,f;return{previous:(a=(s=g.value)==null?void 0:s.labels)==null?void 0:a.previousButton,next:(N=(l=g.value)==null?void 0:l.labels)==null?void 0:N.nextButton,finish:(f=(j=g.value)==null?void 0:j.labels)==null?void 0:f.finishButton}}),{updatePath:$,path:D}=fe(),H=o.ref(),Q=async()=>{var a,l,N,j,f,F,k,z,P,V,M,R,U;await o.nextTick();const s=q((l=(a=h==null?void 0:h.value)==null?void 0:a.attachTo)==null?void 0:l.element);s&&H.value&&(r.value=!0,(j=(N=g.value)==null?void 0:N.scrollToStep)!=null&&j.enabled&&((k=s.scrollIntoView)==null||k.call(s,(F=(f=g.value)==null?void 0:f.scrollToStep)==null?void 0:F.options)),x.createPopper(s,H.value,g.value.popper),(P=(z=g.value)==null?void 0:z.overlay)!=null&&P.enabled&&$(s,{padding:(M=(V=g.value)==null?void 0:V.overlay)==null?void 0:M.padding,borderRadius:(U=(R=g.value)==null?void 0:R.overlay)==null?void 0:U.borderRadius}))};return o.watch(h,Q,{immediate:!0}),{stepElement:H,next:m,previous:E,path:D,show:r,step:h,isFirstStep:d,isLastStep:_,exit:()=>{var s;A(),(s=g.value)!=null&&s.autoFinishByExit&&C()},finish:C,isButtonVisible:S,buttonLabels:B}}}),he={style:{width:"100%",height:"100%",position:"fixed",top:"0",left:"0",fill:"var(--v-onboarding-overlay-fill, black)",opacity:"var(--v-onboarding-overlay-opacity, 0.5)","z-index":"var(--v-onboarding-overlay-z, 10)","pointer-events":"none"}},ge=["d"],be={ref:"stepElement",style:{position:"relative","z-index":"var(--v-onboarding-step-z, 20)"}},ve={class:"v-onboarding-item"},me={class:"v-onboarding-item__header"},ye={key:0,class:"v-onboarding-item__header-title"},_e=[o.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[o.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)],Se=["innerHTML"],Te={key:1,class:"v-onboarding-item__description"},we={class:"v-onboarding-item__actions"},Ee=o.createElementVNode("div",{"data-popper-arrow":""},null,-1);function Oe(r,v,h,d,_,p){return o.withDirectives((o.openBlock(),o.createElementBlock("div",null,[(o.openBlock(),o.createElementBlock("svg",he,[o.createElementVNode("path",{d:r.path},null,8,ge)])),o.createElementVNode("div",be,[r.step?o.renderSlot(r.$slots,"default",{key:0},()=>[o.createElementVNode("div",ve,[o.createElementVNode("div",me,[r.step.content.title?(o.openBlock(),o.createElementBlock("span",ye,o.toDisplayString(r.step.content.title),1)):o.createCommentVNode("",!0),r.isButtonVisible.exit?(o.openBlock(),o.createElementBlock("button",{key:1,onClick:v[0]||(v[0]=(...m)=>r.exit&&r.exit(...m)),"aria-label":"Close",class:"v-onboarding-item__header-close"},_e)):o.createCommentVNode("",!0)]),r.step.content.description&&r.step.content.html?(o.openBlock(),o.createElementBlock("p",{key:0,class:"v-onboarding-item__description",innerHTML:r.step.content.description},null,8,Se)):r.step.content.description?(o.openBlock(),o.createElementBlock("p",Te,o.toDisplayString(r.step.content.description),1)):o.createCommentVNode("",!0),o.createElementVNode("div",we,[!r.isFirstStep&&r.isButtonVisible.previous?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",onClick:v[1]||(v[1]=(...m)=>r.previous&&r.previous(...m)),class:"v-onboarding-btn-secondary"},o.toDisplayString(r.buttonLabels.previous),1)):o.createCommentVNode("",!0),r.isButtonVisible.next?(o.openBlock(),o.createElementBlock("button",{key:1,onClick:v[2]||(v[2]=()=>r.isLastStep?r.finish():r.next()),type:"button",class:"v-onboarding-btn-primary"},o.toDisplayString(r.isLastStep?r.buttonLabels.finish:r.buttonLabels.next),1)):o.createCommentVNode("",!0)])])]):o.createCommentVNode("",!0),Ee],512)],512)),[[o.vShow,r.show]])}var Ft=Dt(pe,[["render",Oe]]);const xe=o.defineComponent({name:"VOnboardingWrapper",components:{VOnboardingStep:Ft},props:{steps:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})}},emits:["finish","exit"],setup(r,{expose:v,emit:h}){const d=o.computed(()=>ut({},ft,r.options)),_=o.ref(!0),p=o.ref(rt.IDLE),m=o.ref(p.value),E=f=>{typeof f=="function"?p.value=f(p.value):p.value=f},A=o.computed(()=>{var f;return(f=r.steps)==null?void 0:f[m.value]}),C=o.computed(()=>A.value?ut({},d.value,A.value.options):d.value),g=f=>ut({},d.value,f.options),{beforeHook:S,afterHook:B}=Ce(C);o.watch(p,async(f,F)=>{var M,R,U,Z;const k=f<F?ct.BACKWARD:ct.FORWARD,z={direction:k,isForward:k===ct.FORWARD,isBackward:k===ct.BACKWARD},P=(M=r.steps)==null?void 0:M[F];if(P){const K=Pt(It({},z),{index:F,step:P});D(q(P.attachTo.element)),await B(P,K)}const V=(R=r.steps)==null?void 0:R[f];if(V){const K=Pt(It({},z),{index:f,step:V});D(q(V.attachTo.element)),(U=g(V))!=null&&U.hideNextStepDuringHook&&(_.value=!1),await S(V,K)}m.value=f,_.value=!0,D(q("body")),(Z=C.value.overlay)!=null&&Z.preventOverlayInteraction&&H()});const{addPointerEvents:$,removePointerEvents:D}=kt(),H=()=>{const f=q("body");!f||([rt.IDLE,rt.FINISHED].includes(m.value)?D(f):$(f,"none"))},Q=o.computed(()=>m.value===rt.FINISHED),tt=()=>E(0),s=()=>{E(rt.FINISHED),h("finish")},a=()=>h("exit");v({start:tt,finish:s,goToStep:E});const l=()=>{E(f=>f-1)},N=()=>{const f=m.value+1;if(f===r.steps.length){s();return}E(f)},j=o.computed(()=>({step:A,options:d,next:N,previous:l,finish:s,exit:a,isFirstStep:o.computed(()=>m.value===0),isLastStep:o.computed(()=>m.value===r.steps.length-1)}));return o.provide(Lt,j),{index:p,activeStep:A,next:N,previous:l,isFinished:Q,setIndex:E,isFirstStep:j.value.isFirstStep,isLastStep:j.value.isLastStep,finish:s,exit:a,showStep:_}}});function Be(){return{setClassName:({element:h,classList:d=[]})=>{!h||h.classList.add(...d)},unsetClassName:({element:h,classList:d=[]})=>{!h||h.classList.remove(...d)}}}function kt(){const r="data-v-onboarding-pointer-events";return{addPointerEvents:(d,_="auto")=>{if(!d)return;const p=d.style.pointerEvents;p&&d.setAttribute(r,p),d.style.setProperty("pointer-events",_)},removePointerEvents:d=>{if(!d)return;const _=d.getAttribute(r);_?(d.style.setProperty("pointer-events",_),d.removeAttribute(r)):d.style.removeProperty("pointer-events")}}}function Ce(r){const{setClassName:v,unsetClassName:h}=Be(),{addPointerEvents:d,removePointerEvents:_}=kt();return{beforeHook:(E,A)=>{var g,S,B,$;const C=q(E.attachTo.element);return(S=(g=r.value)==null?void 0:g.overlay)!=null&&S.preventOverlayInteraction&&d(C),v({element:C,classList:E.attachTo.classList}),($=(B=E.on)==null?void 0:B.beforeStep)==null?void 0:$.call(B,A)},afterHook:(E,A)=>{var g,S,B,$;const C=q(E.attachTo.element);return(S=(g=r.value)==null?void 0:g.overlay)!=null&&S.preventOverlayInteraction&&_(C),h({element:C,classList:E.attachTo.classList}),($=(B=E.on)==null?void 0:B.afterStep)==null?void 0:$.call(B,A)}}}const Ae={key:0,"data-v-onboarding-wrapper":"",style:{"pointer-events":"auto"}};function $e(r,v,h,d,_,p){const m=o.resolveComponent("VOnboardingStep");return r.isFinished?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Ae,[r.showStep?o.renderSlot(r.$slots,"default",{key:r.index,step:r.activeStep,next:r.next,previous:r.previous,exit:r.exit,isFirst:r.isFirstStep,isLast:r.isLastStep,index:r.index},()=>[(o.openBlock(),o.createBlock(m,{key:r.index}))]):o.createCommentVNode("",!0)]))}var Ne=Dt(xe,[["render",$e]]);function je(r){return{start:()=>{var p;return(p=r==null?void 0:r.value)==null?void 0:p.start()},finish:()=>{var p;return(p=r==null?void 0:r.value)==null?void 0:p.finish()},exit:()=>{var p;return(p=r==null?void 0:r.value)==null?void 0:p.exit()},goToStep:p=>{var m;return(m=r==null?void 0:r.value)==null?void 0:m.goToStep(p)}}}var ir=(()=>`.v-onboarding-item{width:20rem;padding:1rem;background-color:#fff;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;border-radius:.375rem}.v-onboarding-item__header{display:flex;justify-content:space-between}.v-onboarding-item__header-title{font-size:1.25rem;font-weight:500;line-height:1.5}.v-onboarding-item__header-close{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;flex-shrink:0;border-radius:50%}.v-onboarding-item__header-close:hover{background:rgba(0,0,0,.1)}.v-onboarding-item__description{font-size:.875rem;color:#71717a;margin-top:.5rem}.v-onboarding-item__actions{display:flex;margin-top:1rem}.v-onboarding-item__actions>:not([hidden])~:not([hidden]){margin-left:.5rem}.v-onboarding-item__actions button{display:inline-flex;flex:1;align-items:center;justify-content:center;padding:.5rem 1.25rem;border-width:1px;border-style:solid;font-size:1rem;font-weight:500;box-shadow:0 1px 2px #0000000d;border-radius:9999px;background-color:transparent;background-image:none;cursor:pointer}.v-onboarding-item__actions button.v-onboarding-btn-primary{border-color:transparent;color:#fff;background-color:#4f46e5}.v-onboarding-item__actions button.v-onboarding-btn-primary:hover{background-color:#4338ca}.v-onboarding-item__actions button.v-onboarding-btn-secondary{border-color:#d4d4d8;color:#3f3f46}.v-onboarding-item__actions button.v-onboarding-btn-secondary:hover{background-color:#fafafa}[data-v-onboarding-wrapper] [data-popper-arrow]:before{content:"";background:var(--v-onboarding-step-arrow-background, white);top:0;left:0;transition:transform .2s ease-out,visibility .2s ease-out;visibility:visible;transform:translate(0) rotate(45deg);transform-origin:center;width:var(--v-onboarding-step-arrow-size, 10px);height:var(--v-onboarding-step-arrow-size, 10px);position:absolute;z-index:-1}[data-v-onboarding-wrapper] [data-popper-placement^=top]>[data-popper-arrow]{bottom:5px}[data-v-onboarding-wrapper] [data-popper-placement^=right]>[data-popper-arrow]{left:-4px}[data-v-onboarding-wrapper] [data-popper-placement^=bottom]>[data-popper-arrow]{top:-4px}[data-v-onboarding-wrapper] [data-popper-placement^=left]>[data-popper-arrow]{right:-4px}
|
|
12
|
+
`)();O.VOnboardingStep=Ft,O.VOnboardingWrapper=Ne,O.useVOnboarding=je,Object.defineProperties(O,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -2,14 +2,29 @@ import { VOnboardingWrapperOptions } from "@/types/VOnboardingWrapper";
|
|
|
2
2
|
|
|
3
3
|
export type AttachableElement = string | (() => Element | null)
|
|
4
4
|
|
|
5
|
+
interface onGlobalOptions {
|
|
6
|
+
index: number
|
|
7
|
+
step: StepEntity
|
|
8
|
+
direction: 1 | -1 | number
|
|
9
|
+
isForward: boolean
|
|
10
|
+
isBackward: boolean
|
|
11
|
+
}
|
|
12
|
+
export type onBeforeStepOptions = onGlobalOptions & {
|
|
13
|
+
// custom options here
|
|
14
|
+
}
|
|
15
|
+
export type onAfterStepOptions = onGlobalOptions & {
|
|
16
|
+
// custom options here
|
|
17
|
+
}
|
|
18
|
+
|
|
5
19
|
export interface StepEntity {
|
|
6
|
-
content
|
|
20
|
+
content: {
|
|
7
21
|
title: string;
|
|
8
22
|
description?: string;
|
|
23
|
+
html?: boolean
|
|
9
24
|
}
|
|
10
25
|
on?: {
|
|
11
|
-
beforeStep?: () => void | Promise<void>
|
|
12
|
-
afterStep?: () => void | Promise<void>
|
|
26
|
+
beforeStep?: (options?: onBeforeStepOptions) => void | Promise<void>
|
|
27
|
+
afterStep?: (options?: onAfterStepOptions) => void | Promise<void>
|
|
13
28
|
},
|
|
14
29
|
attachTo: {
|
|
15
30
|
element: AttachableElement,
|
|
@@ -17,5 +32,3 @@ export interface StepEntity {
|
|
|
17
32
|
}
|
|
18
33
|
options?: VOnboardingWrapperOptions
|
|
19
34
|
}
|
|
20
|
-
|
|
21
|
-
|
|
@@ -14,6 +14,7 @@ export interface SvgOverlayOptions {
|
|
|
14
14
|
rightBottom?: number;
|
|
15
15
|
leftBottom?: number;
|
|
16
16
|
}
|
|
17
|
+
preventOverlayInteraction?: boolean
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export interface VOnboardingWrapperOptions {
|
|
@@ -34,6 +35,7 @@ export interface VOnboardingWrapperOptions {
|
|
|
34
35
|
nextButton?: string
|
|
35
36
|
finishButton?: string
|
|
36
37
|
}
|
|
38
|
+
hideNextStepDuringHook?: boolean
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
export const defaultVOnboardingWrapperOptions: VOnboardingWrapperOptions = {
|
|
@@ -42,6 +44,7 @@ export const defaultVOnboardingWrapperOptions: VOnboardingWrapperOptions = {
|
|
|
42
44
|
enabled: true,
|
|
43
45
|
padding: 0,
|
|
44
46
|
borderRadius: 0,
|
|
47
|
+
preventOverlayInteraction: true
|
|
45
48
|
},
|
|
46
49
|
scrollToStep: {
|
|
47
50
|
enabled: true,
|
|
@@ -61,5 +64,6 @@ export const defaultVOnboardingWrapperOptions: VOnboardingWrapperOptions = {
|
|
|
61
64
|
previous: false,
|
|
62
65
|
next: false,
|
|
63
66
|
exit: false
|
|
64
|
-
}
|
|
67
|
+
},
|
|
68
|
+
hideNextStepDuringHook: false
|
|
65
69
|
}
|