v-onboarding 2.5.1 → 2.6.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 +50 -13
- package/dist/v-onboarding.umd.js +9 -9
- package/package.json +1 -1
- package/src/types/StepEntity.d.ts +17 -5
- package/src/types/index.ts +5 -0
package/dist/v-onboarding.es.js
CHANGED
|
@@ -1,10 +1,33 @@
|
|
|
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
|
-
import { ref, onMounted, onUnmounted, defineComponent, inject,
|
|
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");
|
|
4
23
|
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) {
|
|
@@ -796,7 +819,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
796
819
|
setup() {
|
|
797
820
|
const show = ref(false);
|
|
798
821
|
const state = inject(STATE_INJECT_KEY, {});
|
|
799
|
-
const { step, isFirstStep, isLastStep, options, next, previous, exit: stateExit, finish } =
|
|
822
|
+
const { step, isFirstStep, isLastStep, options, next, previous, exit: stateExit, finish } = state.value;
|
|
800
823
|
const mergedOptions = computed(() => merge({}, options == null ? void 0 : options.value, step.value.options));
|
|
801
824
|
const isButtonVisible = computed(() => {
|
|
802
825
|
var _a, _b, _c;
|
|
@@ -837,9 +860,9 @@ const _sfc_main$1 = defineComponent({
|
|
|
837
860
|
watch(step, attachElement, { immediate: true });
|
|
838
861
|
const exit = () => {
|
|
839
862
|
var _a;
|
|
840
|
-
stateExit
|
|
863
|
+
stateExit();
|
|
841
864
|
if ((_a = mergedOptions.value) == null ? void 0 : _a.autoFinishByExit) {
|
|
842
|
-
finish
|
|
865
|
+
finish();
|
|
843
866
|
}
|
|
844
867
|
};
|
|
845
868
|
return {
|
|
@@ -966,13 +989,27 @@ const _sfc_main = defineComponent({
|
|
|
966
989
|
});
|
|
967
990
|
watch(index, async (newIndex, oldIndex) => {
|
|
968
991
|
var _a, _b;
|
|
992
|
+
const direction = newIndex < oldIndex ? Direction.BACKWARD : Direction.FORWARD;
|
|
993
|
+
const globalHookOptions = {
|
|
994
|
+
direction,
|
|
995
|
+
isForward: direction === Direction.FORWARD,
|
|
996
|
+
isBackward: direction === Direction.BACKWARD
|
|
997
|
+
};
|
|
969
998
|
const oldStep = (_a = props.steps) == null ? void 0 : _a[oldIndex];
|
|
970
999
|
if (oldStep) {
|
|
971
|
-
|
|
1000
|
+
const afterHookOptions = __spreadProps(__spreadValues({}, globalHookOptions), {
|
|
1001
|
+
index: oldIndex,
|
|
1002
|
+
step: oldStep
|
|
1003
|
+
});
|
|
1004
|
+
await afterHook(oldStep, afterHookOptions);
|
|
972
1005
|
}
|
|
973
1006
|
const newStep = (_b = props.steps) == null ? void 0 : _b[newIndex];
|
|
974
1007
|
if (newStep) {
|
|
975
|
-
|
|
1008
|
+
const beforeHookOptions = __spreadProps(__spreadValues({}, globalHookOptions), {
|
|
1009
|
+
index: newIndex,
|
|
1010
|
+
step: newStep
|
|
1011
|
+
});
|
|
1012
|
+
await beforeHook(newStep, beforeHookOptions);
|
|
976
1013
|
}
|
|
977
1014
|
privateIndex.value = newIndex;
|
|
978
1015
|
});
|
|
@@ -1041,15 +1078,15 @@ function useSetElementClassName() {
|
|
|
1041
1078
|
}
|
|
1042
1079
|
function useStepHooks() {
|
|
1043
1080
|
const { setClassName, unsetClassName } = useSetElementClassName();
|
|
1044
|
-
const beforeHook = (step) => {
|
|
1081
|
+
const beforeHook = (step, options) => {
|
|
1045
1082
|
var _a, _b;
|
|
1046
1083
|
setClassName({ element: useGetElement(step.attachTo.element), classList: step.attachTo.classList });
|
|
1047
|
-
return (_b = (_a = step.on) == null ? void 0 : _a.beforeStep) == null ? void 0 : _b.call(_a);
|
|
1084
|
+
return (_b = (_a = step.on) == null ? void 0 : _a.beforeStep) == null ? void 0 : _b.call(_a, options);
|
|
1048
1085
|
};
|
|
1049
|
-
const afterHook = (step) => {
|
|
1086
|
+
const afterHook = (step, options) => {
|
|
1050
1087
|
var _a, _b;
|
|
1051
1088
|
unsetClassName({ element: useGetElement(step.attachTo.element), classList: step.attachTo.classList });
|
|
1052
|
-
return (_b = (_a = step.on) == null ? void 0 : _a.afterStep) == null ? void 0 : _b.call(_a);
|
|
1089
|
+
return (_b = (_a = step.on) == null ? void 0 : _a.afterStep) == null ? void 0 : _b.call(_a, options);
|
|
1053
1090
|
};
|
|
1054
1091
|
return { beforeHook, afterHook };
|
|
1055
1092
|
}
|
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(x,O){typeof exports=="object"&&typeof module!="undefined"?O(exports,require("@popperjs/core"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@popperjs/core","vue"],O):(x=typeof globalThis!="undefined"?globalThis:x||self,O(x["v-onboarding"]={},x.core,x.Vue))})(this,function(x,O,r){"use strict";var Jn=Object.defineProperty,Yn=Object.defineProperties;var Xn=Object.getOwnPropertyDescriptors;var ce=Object.getOwnPropertySymbols;var tr=Object.prototype.hasOwnProperty,er=Object.prototype.propertyIsEnumerable;var de=(x,O,r)=>O in x?Jn(x,O,{enumerable:!0,configurable:!0,writable:!0,value:r}):x[O]=r,Vt=(x,O)=>{for(var r in O||(O={}))tr.call(O,r)&&de(x,r,O[r]);if(ce)for(var r of ce(O))er.call(O,r)&&de(x,r,O[r]);return x},Lt=(x,O)=>Yn(x,Xn(O));const Ft=Symbol("onboardingState"),vt={IDLE:-1,FINISHED:-2},ot={BACKWARD:-1,FORWARD:1};var it=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},_t={exports:{}};(function(o,m){var h=200,v="__lodash_hash_undefined__",f=800,u=16,p=9007199254740991,C="[object Arguments]",F="[object Array]",I="[object AsyncFunction]",S="[object Boolean]",w="[object Date]",z="[object Error]",L="[object Function]",D="[object GeneratorFunction]",j="[object Map]",T="[object Number]",P="[object Null]",c="[object Object]",a="[object Proxy]",s="[object RegExp]",B="[object Set]",E="[object String]",A="[object Undefined]",V="[object WeakMap]",M="[object ArrayBuffer]",R="[object DataView]",U="[object Float32Array]",G="[object Float64Array]",W="[object Int8Array]",K="[object Int16Array]",st="[object Int32Array]",lt="[object Uint8Array]",ct="[object Uint8ClampedArray]",je="[object Uint16Array]",Ne="[object Uint32Array]",Ve=/[\\^$.*+?()[\]{}|]/g,Le=/^\[object .+?Constructor\]$/,Fe=/^(?:0|[1-9]\d*)$/,b={};b[U]=b[G]=b[W]=b[K]=b[st]=b[lt]=b[ct]=b[je]=b[Ne]=!0,b[C]=b[F]=b[M]=b[S]=b[R]=b[w]=b[z]=b[L]=b[j]=b[T]=b[c]=b[s]=b[B]=b[E]=b[V]=!1;var kt=typeof it=="object"&&it&&it.Object===Object&&it,Ie=typeof self=="object"&&self&&self.Object===Object&&self,X=kt||Ie||Function("return this")(),Ht=m&&!m.nodeType&&m,tt=Ht&&!0&&o&&!o.nodeType&&o,Pt=tt&&tt.exports===Ht,Tt=Pt&&kt.process,Mt=function(){try{var t=tt&&tt.require&&tt.require("util").types;return t||Tt&&Tt.binding&&Tt.binding("util")}catch{}}(),Rt=Mt&&Mt.isTypedArray;function ze(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 De(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function ke(t){return function(e){return t(e)}}function He(t,e){return t==null?void 0:t[e]}function Pe(t,e){return function(n){return t(e(n))}}var Me=Array.prototype,Re=Function.prototype,dt=Object.prototype,St=X["__core-js_shared__"],ut=Re.toString,k=dt.hasOwnProperty,Ut=function(){var t=/[^.]+$/.exec(St&&St.keys&&St.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Gt=dt.toString,Ue=ut.call(Object),Ge=RegExp("^"+ut.call(k).replace(Ve,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ft=Pt?X.Buffer:void 0,Wt=X.Symbol,Kt=X.Uint8Array,qt=ft?ft.allocUnsafe:void 0,Qt=Pe(Object.getPrototypeOf,Object),Zt=Object.create,We=dt.propertyIsEnumerable,Ke=Me.splice,q=Wt?Wt.toStringTag:void 0,pt=function(){try{var t=Ot(Object,"defineProperty");return t({},"",{}),t}catch{}}(),qe=ft?ft.isBuffer:void 0,Jt=Math.max,Qe=Date.now,Yt=Ot(X,"Map"),et=Ot(Object,"create"),Ze=function(){function t(){}return function(e){if(!Z(e))return{};if(Zt)return Zt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Q(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__=et?et(null):{},this.size=0}function Ye(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Xe(t){var e=this.__data__;if(et){var n=e[t];return n===v?void 0:n}return k.call(e,t)?e[t]:void 0}function tn(t){var e=this.__data__;return et?e[t]!==void 0:k.call(e,t)}function en(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=et&&e===void 0?v:e,this}Q.prototype.clear=Je,Q.prototype.delete=Ye,Q.prototype.get=Xe,Q.prototype.has=tn,Q.prototype.set=en;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 nn(){this.__data__=[],this.size=0}function rn(t){var e=this.__data__,n=ht(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():Ke.call(e,n,1),--this.size,!0}function on(t){var e=this.__data__,n=ht(e,t);return n<0?void 0:e[n][1]}function an(t){return ht(this.__data__,t)>-1}function sn(t,e){var n=this.__data__,i=ht(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}H.prototype.clear=nn,H.prototype.delete=rn,H.prototype.get=on,H.prototype.has=an,H.prototype.set=sn;function J(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 ln(){this.size=0,this.__data__={hash:new Q,map:new(Yt||H),string:new Q}}function cn(t){var e=bt(this,t).delete(t);return this.size-=e?1:0,e}function dn(t){return bt(this,t).get(t)}function un(t){return bt(this,t).has(t)}function fn(t,e){var n=bt(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}J.prototype.clear=ln,J.prototype.delete=cn,J.prototype.get=dn,J.prototype.has=un,J.prototype.set=fn;function Y(t){var e=this.__data__=new H(t);this.size=e.size}function pn(){this.__data__=new H,this.size=0}function hn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function gn(t){return this.__data__.get(t)}function bn(t){return this.__data__.has(t)}function mn(t,e){var n=this.__data__;if(n instanceof H){var i=n.__data__;if(!Yt||i.length<h-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new J(i)}return n.set(t,e),this.size=n.size,this}Y.prototype.clear=pn,Y.prototype.delete=hn,Y.prototype.get=gn,Y.prototype.has=bn,Y.prototype.set=mn;function vn(t,e){var n=Et(t),i=!n&&Ct(t),d=!n&&!i&&re(t),g=!n&&!i&&!d&&ie(t),_=n||i||d||g,l=_?De(t.length,String):[],y=l.length;for(var N in t)(e||k.call(t,N))&&!(_&&(N=="length"||d&&(N=="offset"||N=="parent")||g&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||ee(N,y)))&&l.push(N);return l}function wt(t,e,n){(n!==void 0&&!mt(t[e],n)||n===void 0&&!(e in t))&&xt(t,e,n)}function _n(t,e,n){var i=t[e];(!(k.call(t,e)&&mt(i,n))||n===void 0&&!(e in t))&&xt(t,e,n)}function ht(t,e){for(var n=t.length;n--;)if(mt(t[n][0],e))return n;return-1}function xt(t,e,n){e=="__proto__"&&pt?pt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var yn=Vn();function gt(t){return t==null?t===void 0?A:P:q&&q in Object(t)?Ln(t):Hn(t)}function Xt(t){return nt(t)&>(t)==C}function Tn(t){if(!Z(t)||Dn(t))return!1;var e=$t(t)?Ge:Le;return e.test(Un(t))}function Sn(t){return nt(t)&&oe(t.length)&&!!b[gt(t)]}function wn(t){if(!Z(t))return kn(t);var e=ne(t),n=[];for(var i in t)i=="constructor"&&(e||!k.call(t,i))||n.push(i);return n}function te(t,e,n,i,d){t!==e&&yn(e,function(g,_){if(d||(d=new Y),Z(g))xn(t,e,_,n,te,i,d);else{var l=i?i(Bt(t,_),g,_+"",t,e,d):void 0;l===void 0&&(l=g),wt(t,_,l)}},ae)}function xn(t,e,n,i,d,g,_){var l=Bt(t,n),y=Bt(e,n),N=_.get(y);if(N){wt(t,n,N);return}var $=g?g(l,y,n+"",t,e,_):void 0,rt=$===void 0;if(rt){var jt=Et(y),Nt=!jt&&re(y),le=!jt&&!Nt&&ie(y);$=y,jt||Nt||le?Et(l)?$=l:Gn(l)?$=$n(l):Nt?(rt=!1,$=Cn(y,!0)):le?(rt=!1,$=An(y,!0)):$=[]:Wn(y)||Ct(y)?($=l,Ct(l)?$=Kn(l):(!Z(l)||$t(l))&&($=Fn(y))):rt=!1}rt&&(_.set(y,$),d($,y,i,g,_),_.delete(y)),wt(t,n,$)}function On(t,e){return Mn(Pn(t,e,se),t+"")}var Bn=pt?function(t,e){return pt(t,"toString",{configurable:!0,enumerable:!1,value:Qn(e),writable:!0})}:se;function Cn(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 En(t){var e=new t.constructor(t.byteLength);return new Kt(e).set(new Kt(t)),e}function An(t,e){var n=e?En(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function $n(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function jn(t,e,n,i){var d=!n;n||(n={});for(var g=-1,_=e.length;++g<_;){var l=e[g],y=i?i(n[l],t[l],l,n,t):void 0;y===void 0&&(y=t[l]),d?xt(n,l,y):_n(n,l,y)}return n}function Nn(t){return On(function(e,n){var i=-1,d=n.length,g=d>1?n[d-1]:void 0,_=d>2?n[2]:void 0;for(g=t.length>3&&typeof g=="function"?(d--,g):void 0,_&&In(n[0],n[1],_)&&(g=d<3?void 0:g,d=1),e=Object(e);++i<d;){var l=n[i];l&&t(e,l,i,g)}return e})}function Vn(t){return function(e,n,i){for(var d=-1,g=Object(e),_=i(e),l=_.length;l--;){var y=_[t?l:++d];if(n(g[y],y,g)===!1)break}return e}}function bt(t,e){var n=t.__data__;return zn(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Ot(t,e){var n=He(t,e);return Tn(n)?n:void 0}function Ln(t){var e=k.call(t,q),n=t[q];try{t[q]=void 0;var i=!0}catch{}var d=Gt.call(t);return i&&(e?t[q]=n:delete t[q]),d}function Fn(t){return typeof t.constructor=="function"&&!ne(t)?Ze(Qt(t)):{}}function ee(t,e){var n=typeof t;return e=e==null?p:e,!!e&&(n=="number"||n!="symbol"&&Fe.test(t))&&t>-1&&t%1==0&&t<e}function In(t,e,n){if(!Z(n))return!1;var i=typeof e;return(i=="number"?At(n)&&ee(e,n.length):i=="string"&&e in n)?mt(n[e],t):!1}function zn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Dn(t){return!!Ut&&Ut in t}function ne(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||dt;return t===n}function kn(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Hn(t){return Gt.call(t)}function Pn(t,e,n){return e=Jt(e===void 0?t.length-1:e,0),function(){for(var i=arguments,d=-1,g=Jt(i.length-e,0),_=Array(g);++d<g;)_[d]=i[e+d];d=-1;for(var l=Array(e+1);++d<e;)l[d]=i[d];return l[e]=n(_),ze(t,this,l)}}function Bt(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Mn=Rn(Bn);function Rn(t){var e=0,n=0;return function(){var i=Qe(),d=u-(i-n);if(n=i,d>0){if(++e>=f)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Un(t){if(t!=null){try{return ut.call(t)}catch{}try{return t+""}catch{}}return""}function mt(t,e){return t===e||t!==t&&e!==e}var Ct=Xt(function(){return arguments}())?Xt:function(t){return nt(t)&&k.call(t,"callee")&&!We.call(t,"callee")},Et=Array.isArray;function At(t){return t!=null&&oe(t.length)&&!$t(t)}function Gn(t){return nt(t)&&At(t)}var re=qe||Zn;function $t(t){if(!Z(t))return!1;var e=gt(t);return e==L||e==D||e==I||e==a}function oe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=p}function Z(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function nt(t){return t!=null&&typeof t=="object"}function Wn(t){if(!nt(t)||gt(t)!=c)return!1;var e=Qt(t);if(e===null)return!0;var n=k.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ut.call(n)==Ue}var ie=Rt?ke(Rt):Sn;function Kn(t){return jn(t,ae(t))}function ae(t){return At(t)?vn(t,!0):wn(t)}var qn=Nn(function(t,e,n){te(t,e,n)});function Qn(t){return function(){return t}}function se(t){return t}function Zn(){return!1}o.exports=qn})(_t,_t.exports);var It=_t.exports;function yt(o){return typeof o=="string"?document.querySelector(o):typeof o=="function"?o():null}const at={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 ue(){var p,C,F,I;const o=r.ref(""),m=r.ref(null),h=r.ref((C=(p=at.overlay)==null?void 0:p.padding)!=null?C:0),v=r.ref((I=(F=at.overlay)==null?void 0:F.borderRadius)!=null?I:0),f=()=>{u(m.value,{padding:h.value,borderRadius:v.value})},u=async(S,w=at.overlay)=>{var E,A,V,M,R,U,G,W,K,st,lt,ct;if(!S)return;const{innerWidth:z,innerHeight:L}=window,{left:D,top:j,width:T,height:P}=S.getBoundingClientRect(),c=typeof w.padding=="number"?{top:w.padding,right:w.padding,bottom:w.padding,left:w.padding}:w.padding,a=typeof w.borderRadius=="number"?{leftTop:w.borderRadius,rightTop:w.borderRadius,rightBottom:w.borderRadius,leftBottom:w.borderRadius}:w.borderRadius,s={top:j-((E=c==null?void 0:c.top)!=null?E:0),right:D+T+((A=c==null?void 0:c.right)!=null?A:0),bottom:j+P+((V=c==null?void 0:c.bottom)!=null?V:0),left:D-((M=c==null?void 0:c.left)!=null?M:0)},B={leftTop:`M${s.left+((R=a==null?void 0:a.leftTop)!=null?R:0)},${s.top} Q${s.left},${s.top} ${s.left},${s.top+((U=a==null?void 0:a.leftTop)!=null?U:0)}`,rightTop:`V${s.top+((G=a==null?void 0:a.rightTop)!=null?G:0)} Q${s.right},${s.top} ${s.right-((W=a==null?void 0:a.rightTop)!=null?W:0)},${s.top}`,rightBottom:`H${s.right-((K=a==null?void 0:a.rightBottom)!=null?K:0)} Q${s.right},${s.bottom} ${s.right},${s.bottom-((st=a==null?void 0:a.rightBottom)!=null?st:0)}`,leftBottom:`V${s.bottom-((lt=a==null?void 0:a.leftBottom)!=null?lt:0)} Q${s.left},${s.bottom} ${s.left+((ct=a==null?void 0:a.leftBottom)!=null?ct:0)},${s.bottom}`};o.value=`
|
|
2
|
+
M${z},${L}
|
|
3
3
|
H0V0
|
|
4
|
-
H${
|
|
4
|
+
H${z}V${L}
|
|
5
5
|
Z
|
|
6
|
-
${
|
|
7
|
-
${
|
|
8
|
-
${
|
|
9
|
-
${
|
|
6
|
+
${B.leftTop}
|
|
7
|
+
${B.leftBottom}
|
|
8
|
+
${B.rightBottom}
|
|
9
|
+
${B.rightTop}
|
|
10
10
|
Z
|
|
11
|
-
`,
|
|
12
|
-
`)();
|
|
11
|
+
`,m.value=S,h.value=c,v.value=a};return r.onMounted(()=>{window.addEventListener("scroll",f),window.addEventListener("resize",f)}),r.onUnmounted(()=>{window.removeEventListener("scroll",f),window.removeEventListener("resize",f)}),{path:o,updatePath:u}}var zt=(o,m)=>{const h=o.__vccOpts||o;for(const[v,f]of m)h[v]=f;return h};const fe=r.defineComponent({name:"VOnboardingStep",setup(){const o=r.ref(!1),m=r.inject(Ft,{}),{step:h,isFirstStep:v,isLastStep:f,options:u,next:p,previous:C,exit:F,finish:I}=m.value,S=r.computed(()=>It({},u==null?void 0:u.value,h.value.options)),w=r.computed(()=>{var c,a,s;return{previous:!((c=S.value.hideButtons)!=null&&c.previous),next:!((a=S.value.hideButtons)!=null&&a.next),exit:!((s=S.value.hideButtons)!=null&&s.exit)}}),z=r.computed(()=>{var c,a,s,B,E,A;return{previous:(a=(c=S.value)==null?void 0:c.labels)==null?void 0:a.previousButton,next:(B=(s=S.value)==null?void 0:s.labels)==null?void 0:B.nextButton,finish:(A=(E=S.value)==null?void 0:E.labels)==null?void 0:A.finishButton}}),{updatePath:L,path:D}=ue(),j=r.ref(),T=async()=>{var a,s,B,E,A,V,M,R,U,G,W,K;await r.nextTick();const c=yt((s=(a=h==null?void 0:h.value)==null?void 0:a.attachTo)==null?void 0:s.element);c&&j.value&&(o.value=!0,(E=(B=S.value)==null?void 0:B.scrollToStep)!=null&&E.enabled&&c.scrollIntoView((V=(A=S.value)==null?void 0:A.scrollToStep)==null?void 0:V.options),O.createPopper(c,j.value,S.value.popper),(R=(M=S.value)==null?void 0:M.overlay)!=null&&R.enabled&&L(c,{padding:(G=(U=S.value)==null?void 0:U.overlay)==null?void 0:G.padding,borderRadius:(K=(W=S.value)==null?void 0:W.overlay)==null?void 0:K.borderRadius}))};return r.watch(h,T,{immediate:!0}),{stepElement:j,next:p,previous:C,path:D,show:o,step:h,isFirstStep:v,isLastStep:f,exit:()=>{var c;F(),(c=S.value)!=null&&c.autoFinishByExit&&I()},finish:I,isButtonVisible:w,buttonLabels:z}}}),pe={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"}},he=["d"],ge={ref:"stepElement",style:{position:"relative","z-index":"var(--v-onboarding-step-z, 20)"}},be={class:"v-onboarding-item"},me={class:"v-onboarding-item__header"},ve={key:0,class:"v-onboarding-item__header-title"},_e=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[r.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)],ye={key:0,class:"v-onboarding-item__description"},Te={class:"v-onboarding-item__actions"},Se=r.createElementVNode("div",{"data-popper-arrow":""},null,-1);function we(o,m,h,v,f,u){return r.withDirectives((r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createElementBlock("svg",pe,[r.createElementVNode("path",{d:o.path},null,8,he)])),r.createElementVNode("div",ge,[o.step?r.renderSlot(o.$slots,"default",{key:0},()=>[r.createElementVNode("div",be,[r.createElementVNode("div",me,[o.step.content.title?(r.openBlock(),r.createElementBlock("span",ve,r.toDisplayString(o.step.content.title),1)):r.createCommentVNode("",!0),o.isButtonVisible.exit?(r.openBlock(),r.createElementBlock("button",{key:1,onClick:m[0]||(m[0]=(...p)=>o.exit&&o.exit(...p)),class:"v-onboarding-item__header-close"},_e)):r.createCommentVNode("",!0)]),o.step.content.description?(r.openBlock(),r.createElementBlock("p",ye,r.toDisplayString(o.step.content.description),1)):r.createCommentVNode("",!0),r.createElementVNode("div",Te,[!o.isFirstStep&&o.isButtonVisible.previous?(r.openBlock(),r.createElementBlock("button",{key:0,type:"button",onClick:m[1]||(m[1]=(...p)=>o.previous&&o.previous(...p)),class:"v-onboarding-btn-secondary"},r.toDisplayString(o.buttonLabels.previous),1)):r.createCommentVNode("",!0),o.isButtonVisible.next?(r.openBlock(),r.createElementBlock("button",{key:1,onClick:m[2]||(m[2]=()=>o.isLastStep?o.finish():o.next()),type:"button",class:"v-onboarding-btn-primary"},r.toDisplayString(o.isLastStep?o.buttonLabels.finish:o.buttonLabels.next),1)):r.createCommentVNode("",!0)])])]):r.createCommentVNode("",!0),Se],512)],512)),[[r.vShow,o.show]])}var Dt=zt(fe,[["render",we]]);const xe=r.defineComponent({name:"VOnboardingWrapper",components:{VOnboardingStep:Dt},props:{steps:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})}},emits:["finish","exit"],setup(o,{expose:m,emit:h}){const v=r.ref(vt.IDLE),f=r.ref(v.value),u=T=>{typeof T=="function"?v.value=T(v.value):v.value=T},{beforeHook:p,afterHook:C}=Be(),F=r.computed(()=>{var T;return(T=o.steps)==null?void 0:T[f.value]});r.watch(v,async(T,P)=>{var E,A;const c=T<P?ot.BACKWARD:ot.FORWARD,a={direction:c,isForward:c===ot.FORWARD,isBackward:c===ot.BACKWARD},s=(E=o.steps)==null?void 0:E[P];if(s){const V=Lt(Vt({},a),{index:P,step:s});await C(s,V)}const B=(A=o.steps)==null?void 0:A[T];if(B){const V=Lt(Vt({},a),{index:T,step:B});await p(B,V)}f.value=T});const I=r.computed(()=>f.value===vt.FINISHED),S=()=>u(0),w=()=>{u(vt.FINISHED),h("finish")},z=()=>h("exit");m({start:S,finish:w,goToStep:u});const L=()=>{u(T=>T-1)},D=()=>{const T=f.value+1;if(T===o.steps.length){w();return}u(T)},j=r.computed(()=>({step:F,options:r.computed(()=>It({},at,o.options)),next:D,previous:L,finish:w,exit:z,isFirstStep:r.computed(()=>f.value===0),isLastStep:r.computed(()=>f.value===o.steps.length-1)}));return r.provide(Ft,j),{index:v,activeStep:F,next:D,previous:L,isFinished:I,setIndex:u,isFirstStep:j.value.isFirstStep,isLastStep:j.value.isLastStep,finish:w,exit:z}}});function Oe(){return{setClassName:({element:h,classList:v=[]})=>{!h||h.classList.add(...v)},unsetClassName:({element:h,classList:v=[]})=>{!h||h.classList.remove(...v)}}}function Be(){const{setClassName:o,unsetClassName:m}=Oe();return{beforeHook:(f,u)=>{var p,C;return o({element:yt(f.attachTo.element),classList:f.attachTo.classList}),(C=(p=f.on)==null?void 0:p.beforeStep)==null?void 0:C.call(p,u)},afterHook:(f,u)=>{var p,C;return m({element:yt(f.attachTo.element),classList:f.attachTo.classList}),(C=(p=f.on)==null?void 0:p.afterStep)==null?void 0:C.call(p,u)}}}const Ce={key:0,"data-v-onboarding-wrapper":""};function Ee(o,m,h,v,f,u){const p=r.resolveComponent("VOnboardingStep");return o.isFinished?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Ce,[r.renderSlot(o.$slots,"default",{key:o.index,step:o.activeStep,next:o.next,previous:o.previous,exit:o.exit,isFirst:o.isFirstStep,isLast:o.isLastStep,index:o.index},()=>[(r.openBlock(),r.createBlock(p,{key:o.index}))])]))}var Ae=zt(xe,[["render",Ee]]);function $e(o){return{start:()=>{var u;return(u=o==null?void 0:o.value)==null?void 0:u.start()},finish:()=>{var u;return(u=o==null?void 0:o.value)==null?void 0:u.finish()},exit:()=>{var u;return(u=o==null?void 0:o.value)==null?void 0:u.exit()},goToStep:u=>{var p;return(p=o==null?void 0:o.value)==null?void 0:p.goToStep(u)}}}var rr=(()=>`.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
|
+
`)();x.VOnboardingStep=Dt,x.VOnboardingWrapper=Ae,x.useVOnboarding=$e,Object.defineProperties(x,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -2,14 +2,28 @@ 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;
|
|
9
23
|
}
|
|
10
24
|
on?: {
|
|
11
|
-
beforeStep?: () => void | Promise<void>
|
|
12
|
-
afterStep?: () => void | Promise<void>
|
|
25
|
+
beforeStep?: (options?: onBeforeStepOptions) => void | Promise<void>
|
|
26
|
+
afterStep?: (options?: onAfterStepOptions) => void | Promise<void>
|
|
13
27
|
},
|
|
14
28
|
attachTo: {
|
|
15
29
|
element: AttachableElement,
|
|
@@ -17,5 +31,3 @@ export interface StepEntity {
|
|
|
17
31
|
}
|
|
18
32
|
options?: VOnboardingWrapperOptions
|
|
19
33
|
}
|
|
20
|
-
|
|
21
|
-
|