v-onboarding 2.0.1 → 2.2.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
|
@@ -22,6 +22,15 @@ const defaultVOnboardingWrapperOptions = {
|
|
|
22
22
|
block: "center",
|
|
23
23
|
inline: "center"
|
|
24
24
|
}
|
|
25
|
+
},
|
|
26
|
+
labels: {
|
|
27
|
+
previousButton: "Previous",
|
|
28
|
+
nextButton: "Next",
|
|
29
|
+
finishButton: "Finish"
|
|
30
|
+
},
|
|
31
|
+
hideButtons: {
|
|
32
|
+
previous: false,
|
|
33
|
+
next: false
|
|
25
34
|
}
|
|
26
35
|
};
|
|
27
36
|
function useSvgOverlay() {
|
|
@@ -790,6 +799,21 @@ const _sfc_main$1 = defineComponent({
|
|
|
790
799
|
const isFirst = inject("is-first-step");
|
|
791
800
|
const isLast = inject("is-last-step");
|
|
792
801
|
const step = inject("step", {});
|
|
802
|
+
const isButtonVisible = computed(() => {
|
|
803
|
+
var _a, _b;
|
|
804
|
+
return {
|
|
805
|
+
previous: !((_a = mergedOptions.value.hideButtons) == null ? void 0 : _a.previous),
|
|
806
|
+
next: !((_b = mergedOptions.value.hideButtons) == null ? void 0 : _b.next)
|
|
807
|
+
};
|
|
808
|
+
});
|
|
809
|
+
const buttonLabels = computed(() => {
|
|
810
|
+
var _a, _b, _c, _d, _e, _f;
|
|
811
|
+
return {
|
|
812
|
+
previous: (_b = (_a = mergedOptions.value) == null ? void 0 : _a.labels) == null ? void 0 : _b.previousButton,
|
|
813
|
+
next: (_d = (_c = mergedOptions.value) == null ? void 0 : _c.labels) == null ? void 0 : _d.nextButton,
|
|
814
|
+
finish: (_f = (_e = mergedOptions.value) == null ? void 0 : _e.labels) == null ? void 0 : _f.finishButton
|
|
815
|
+
};
|
|
816
|
+
});
|
|
793
817
|
const onNext = () => {
|
|
794
818
|
beforeStepEnd();
|
|
795
819
|
nextStep();
|
|
@@ -832,7 +856,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
832
856
|
const beforeStepEnd = (stepObj = step.value) => {
|
|
833
857
|
var _a, _b, _c, _d;
|
|
834
858
|
(_b = (_a = stepObj == null ? void 0 : stepObj.on) == null ? void 0 : _a.afterStep) == null ? void 0 : _b.call(_a);
|
|
835
|
-
unsetTargetElementClassName(useGetElement((_c = stepObj == null ? void 0 : stepObj.attachTo) == null ? void 0 : _c.element), (_d = stepObj.attachTo) == null ? void 0 : _d.classList);
|
|
859
|
+
unsetTargetElementClassName(useGetElement((_c = stepObj == null ? void 0 : stepObj.attachTo) == null ? void 0 : _c.element), (_d = stepObj == null ? void 0 : stepObj.attachTo) == null ? void 0 : _d.classList);
|
|
836
860
|
};
|
|
837
861
|
const setTargetElementClassName = (element = useGetElement(step.value.attachTo.element)) => {
|
|
838
862
|
const classList = step.value.attachTo.classList;
|
|
@@ -855,7 +879,9 @@ const _sfc_main$1 = defineComponent({
|
|
|
855
879
|
step,
|
|
856
880
|
isFirst,
|
|
857
881
|
isLast,
|
|
858
|
-
exit
|
|
882
|
+
exit,
|
|
883
|
+
isButtonVisible,
|
|
884
|
+
buttonLabels
|
|
859
885
|
};
|
|
860
886
|
}
|
|
861
887
|
});
|
|
@@ -911,17 +937,18 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
911
937
|
]),
|
|
912
938
|
_ctx.step.content.description ? (openBlock(), createElementBlock("p", _hoisted_9, toDisplayString(_ctx.step.content.description), 1)) : createCommentVNode("", true),
|
|
913
939
|
createElementVNode("div", _hoisted_10, [
|
|
914
|
-
!_ctx.isFirst ? (openBlock(), createElementBlock("button", {
|
|
940
|
+
!_ctx.isFirst && _ctx.isButtonVisible.previous ? (openBlock(), createElementBlock("button", {
|
|
915
941
|
key: 0,
|
|
916
942
|
type: "button",
|
|
917
943
|
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onPrevious && _ctx.onPrevious(...args)),
|
|
918
944
|
class: "v-onboarding-btn-secondary"
|
|
919
|
-
},
|
|
920
|
-
|
|
945
|
+
}, toDisplayString(_ctx.buttonLabels.previous), 1)) : createCommentVNode("", true),
|
|
946
|
+
_ctx.isButtonVisible.next ? (openBlock(), createElementBlock("button", {
|
|
947
|
+
key: 1,
|
|
921
948
|
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onNext && _ctx.onNext(...args)),
|
|
922
949
|
type: "button",
|
|
923
950
|
class: "v-onboarding-btn-primary"
|
|
924
|
-
}, toDisplayString(_ctx.isLast ?
|
|
951
|
+
}, toDisplayString(_ctx.isLast ? _ctx.buttonLabels.finish : _ctx.buttonLabels.next), 1)) : createCommentVNode("", true)
|
|
925
952
|
])
|
|
926
953
|
])
|
|
927
954
|
]) : createCommentVNode("", true),
|
|
@@ -947,7 +974,8 @@ const _sfc_main = defineComponent({
|
|
|
947
974
|
default: () => ({})
|
|
948
975
|
}
|
|
949
976
|
},
|
|
950
|
-
|
|
977
|
+
emits: ["exit"],
|
|
978
|
+
setup(props, { expose, emit }) {
|
|
951
979
|
const index = ref(-1);
|
|
952
980
|
const setIndex = (value) => {
|
|
953
981
|
if (typeof value === "function") {
|
|
@@ -975,6 +1003,9 @@ const _sfc_main = defineComponent({
|
|
|
975
1003
|
const finish = () => {
|
|
976
1004
|
setIndex(-1);
|
|
977
1005
|
};
|
|
1006
|
+
const exit = () => {
|
|
1007
|
+
finish(), emit("exit");
|
|
1008
|
+
};
|
|
978
1009
|
expose({
|
|
979
1010
|
start,
|
|
980
1011
|
finish,
|
|
@@ -985,7 +1016,7 @@ const _sfc_main = defineComponent({
|
|
|
985
1016
|
provide("step", activeStep);
|
|
986
1017
|
provide("next-step", toNextStep);
|
|
987
1018
|
provide("previous-step", toPreviousStep);
|
|
988
|
-
provide("exit",
|
|
1019
|
+
provide("exit", exit);
|
|
989
1020
|
const isFirstStep = computed(() => index.value === 0);
|
|
990
1021
|
const isLastStep = computed(() => index.value === props.steps.length - 1);
|
|
991
1022
|
provide("is-first-step", isFirstStep);
|
|
@@ -1044,5 +1075,5 @@ function useVOnboarding(wrapperRef) {
|
|
|
1044
1075
|
goToStep
|
|
1045
1076
|
};
|
|
1046
1077
|
}
|
|
1047
|
-
var vOnboarding = "";
|
|
1078
|
+
var vOnboarding = /* @__PURE__ */ (() => '.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}\n')();
|
|
1048
1079
|
export { VOnboardingStep, VOnboardingWrapper, useVOnboarding };
|
package/dist/v-onboarding.umd.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
M${
|
|
1
|
+
(function(N,r){typeof exports=="object"&&typeof module!="undefined"?r(exports,require("vue"),require("@popperjs/core")):typeof define=="function"&&define.amd?define(["exports","vue","@popperjs/core"],r):(N=typeof globalThis!="undefined"?globalThis:N||self,r(N["v-onboarding"]={},N.Vue,N.core))})(this,function(N,r,ie){"use strict";function at(o){return typeof o=="string"?document.querySelector(o):typeof o=="function"?o():null}const st={popper:{},overlay:{enabled:!0,padding:0,borderRadius:0},scrollToStep:{enabled:!0,options:{behavior:"smooth",block:"center",inline:"center"}},labels:{previousButton:"Previous",nextButton:"Next",finishButton:"Finish"},hideButtons:{previous:!1,next:!1}};function ae(){var y,T,M,F;const o=r.ref(""),m=r.ref(null),B=r.ref((T=(y=st.overlay)==null?void 0:y.padding)!=null?T:0),_=r.ref((F=(M=st.overlay)==null?void 0:M.borderRadius)!=null?F:0),u=()=>{C(m.value,{padding:B.value,borderRadius:_.value})},C=async(v,x=st.overlay)=>{var Z,a,c,S,E,O,z,H,G,R,k,q;if(!v)return;const{innerWidth:D,innerHeight:j}=window,{left:P,top:w,width:Y,height:tt}=v.getBoundingClientRect(),$=typeof x.padding=="number"?{top:x.padding,right:x.padding,bottom:x.padding,left:x.padding}:x.padding,d=typeof x.borderRadius=="number"?{leftTop:x.borderRadius,rightTop:x.borderRadius,rightBottom:x.borderRadius,leftBottom:x.borderRadius}:x.borderRadius,f={top:w-((Z=$==null?void 0:$.top)!=null?Z:0),right:P+Y+((a=$==null?void 0:$.right)!=null?a:0),bottom:w+tt+((c=$==null?void 0:$.bottom)!=null?c:0),left:P-((S=$==null?void 0:$.left)!=null?S:0)},U={leftTop:`M${f.left+((E=d==null?void 0:d.leftTop)!=null?E:0)},${f.top} Q${f.left},${f.top} ${f.left},${f.top+((O=d==null?void 0:d.leftTop)!=null?O:0)}`,rightTop:`V${f.top+((z=d==null?void 0:d.rightTop)!=null?z:0)} Q${f.right},${f.top} ${f.right-((H=d==null?void 0:d.rightTop)!=null?H:0)},${f.top}`,rightBottom:`H${f.right-((G=d==null?void 0:d.rightBottom)!=null?G:0)} Q${f.right},${f.bottom} ${f.right},${f.bottom-((R=d==null?void 0:d.rightBottom)!=null?R:0)}`,leftBottom:`V${f.bottom-((k=d==null?void 0:d.leftBottom)!=null?k:0)} Q${f.left},${f.bottom} ${f.left+((q=d==null?void 0:d.leftBottom)!=null?q:0)},${f.bottom}`};o.value=`
|
|
2
|
+
M${D},${j}
|
|
3
3
|
H0V0
|
|
4
|
-
H${
|
|
4
|
+
H${D}V${j}
|
|
5
5
|
Z
|
|
6
|
-
${
|
|
7
|
-
${
|
|
8
|
-
${
|
|
9
|
-
${
|
|
6
|
+
${U.leftTop}
|
|
7
|
+
${U.leftBottom}
|
|
8
|
+
${U.rightBottom}
|
|
9
|
+
${U.rightTop}
|
|
10
10
|
Z
|
|
11
|
-
`,_.value=y,b.value=S,w.value=c};return r.onMounted(()=>{window.addEventListener("scroll",m),window.addEventListener("resize",m)}),r.onUnmounted(()=>{window.removeEventListener("scroll",m),window.removeEventListener("resize",m)}),{path:i,updatePath:O}}var lt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},bt={exports:{}};(function(i,_){var b=200,w="__lodash_hash_undefined__",m=800,O=16,v=9007199254740991,E="[object Arguments]",L="[object Array]",B="[object AsyncFunction]",y="[object Boolean]",$="[object Date]",P="[object Error]",T="[object Function]",Z="[object GeneratorFunction]",J="[object Map]",k="[object Number]",tt="[object Null]",S="[object Object]",c="[object Proxy]",u="[object RegExp]",l="[object Set]",d="[object String]",C="[object Undefined]",j="[object WeakMap]",x="[object ArrayBuffer]",M="[object DataView]",F="[object Float32Array]",D="[object Float64Array]",U="[object Int8Array]",H="[object Int16Array]",G="[object Int32Array]",R="[object Uint8Array]",q="[object Uint8ClampedArray]",Se="[object Uint16Array]",we="[object Uint32Array]",$e=/[\\^$.*+?()[\]{}|]/g,Ce=/^\[object .+?Constructor\]$/,Oe=/^(?:0|[1-9]\d*)$/,p={};p[F]=p[D]=p[U]=p[H]=p[G]=p[R]=p[q]=p[Se]=p[we]=!0,p[E]=p[L]=p[x]=p[y]=p[M]=p[$]=p[P]=p[T]=p[J]=p[k]=p[S]=p[u]=p[l]=p[d]=p[j]=!1;var xt=typeof lt=="object"&<&<.Object===Object&<,Ee=typeof self=="object"&&self&&self.Object===Object&&self,et=xt||Ee||Function("return this")(),Pt=_&&!_.nodeType&&_,nt=Pt&&!0&&i&&!i.nodeType&&i,It=nt&&nt.exports===Pt,mt=It&&xt.process,zt=function(){try{var t=nt&&nt.require&&nt.require("util").types;return t||mt&&mt.binding&&mt.binding("util")}catch{}}(),Lt=zt&&zt.isTypedArray;function Ae(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 Ne(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}function Ve(t){return function(e){return t(e)}}function Be(t,e){return t==null?void 0:t[e]}function je(t,e){return function(n){return t(e(n))}}var xe=Array.prototype,Pe=Function.prototype,ct=Object.prototype,yt=et["__core-js_shared__"],ft=Pe.toString,I=ct.hasOwnProperty,Mt=function(){var t=/[^.]+$/.exec(yt&&yt.keys&&yt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ft=ct.toString,Ie=ft.call(Object),ze=RegExp("^"+ft.call(I).replace($e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=It?et.Buffer:void 0,Dt=et.Symbol,Ut=et.Uint8Array,Ht=ut?ut.allocUnsafe:void 0,Gt=je(Object.getPrototypeOf,Object),Rt=Object.create,Le=ct.propertyIsEnumerable,Me=xe.splice,W=Dt?Dt.toStringTag:void 0,dt=function(){try{var t=St(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Fe=ut?ut.isBuffer:void 0,qt=Math.max,De=Date.now,Wt=St(et,"Map"),rt=St(Object,"create"),Ue=function(){function t(){}return function(e){if(!Q(e))return{};if(Rt)return Rt(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 o=t[e];this.set(o[0],o[1])}}function He(){this.__data__=rt?rt(null):{},this.size=0}function Ge(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Re(t){var e=this.__data__;if(rt){var n=e[t];return n===w?void 0:n}return I.call(e,t)?e[t]:void 0}function qe(t){var e=this.__data__;return rt?e[t]!==void 0:I.call(e,t)}function We(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=rt&&e===void 0?w:e,this}K.prototype.clear=He,K.prototype.delete=Ge,K.prototype.get=Re,K.prototype.has=qe,K.prototype.set=We;function z(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Ke(){this.__data__=[],this.size=0}function Qe(t){var e=this.__data__,n=pt(e,t);if(n<0)return!1;var o=e.length-1;return n==o?e.pop():Me.call(e,n,1),--this.size,!0}function Ze(t){var e=this.__data__,n=pt(e,t);return n<0?void 0:e[n][1]}function Je(t){return pt(this.__data__,t)>-1}function Xe(t,e){var n=this.__data__,o=pt(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}z.prototype.clear=Ke,z.prototype.delete=Qe,z.prototype.get=Ze,z.prototype.has=Je,z.prototype.set=Xe;function X(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Ye(){this.size=0,this.__data__={hash:new K,map:new(Wt||z),string:new K}}function ke(t){var e=gt(this,t).delete(t);return this.size-=e?1:0,e}function tn(t){return gt(this,t).get(t)}function en(t){return gt(this,t).has(t)}function nn(t,e){var n=gt(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}X.prototype.clear=Ye,X.prototype.delete=ke,X.prototype.get=tn,X.prototype.has=en,X.prototype.set=nn;function Y(t){var e=this.__data__=new z(t);this.size=e.size}function rn(){this.__data__=new z,this.size=0}function on(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function an(t){return this.__data__.get(t)}function sn(t){return this.__data__.has(t)}function ln(t,e){var n=this.__data__;if(n instanceof z){var o=n.__data__;if(!Wt||o.length<b-1)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new X(o)}return n.set(t,e),this.size=n.size,this}Y.prototype.clear=rn,Y.prototype.delete=on,Y.prototype.get=an,Y.prototype.has=sn,Y.prototype.set=ln;function cn(t,e){var n=Ct(t),o=!n&&$t(t),s=!n&&!o&&Xt(t),f=!n&&!o&&!s&&kt(t),h=n||o||s||f,a=h?Ne(t.length,String):[],g=a.length;for(var N in t)(e||I.call(t,N))&&!(h&&(N=="length"||s&&(N=="offset"||N=="parent")||f&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||Zt(N,g)))&&a.push(N);return a}function vt(t,e,n){(n!==void 0&&!_t(t[e],n)||n===void 0&&!(e in t))&&Tt(t,e,n)}function fn(t,e,n){var o=t[e];(!(I.call(t,e)&&_t(o,n))||n===void 0&&!(e in t))&&Tt(t,e,n)}function pt(t,e){for(var n=t.length;n--;)if(_t(t[n][0],e))return n;return-1}function Tt(t,e,n){e=="__proto__"&&dt?dt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var un=$n();function ht(t){return t==null?t===void 0?C:tt:W&&W in Object(t)?Cn(t):Bn(t)}function Kt(t){return ot(t)&&ht(t)==E}function dn(t){if(!Q(t)||Nn(t))return!1;var e=Et(t)?ze:Ce;return e.test(In(t))}function pn(t){return ot(t)&&Yt(t.length)&&!!p[ht(t)]}function hn(t){if(!Q(t))return Vn(t);var e=Jt(t),n=[];for(var o in t)o=="constructor"&&(e||!I.call(t,o))||n.push(o);return n}function Qt(t,e,n,o,s){t!==e&&un(e,function(f,h){if(s||(s=new Y),Q(f))gn(t,e,h,n,Qt,o,s);else{var a=o?o(wt(t,h),f,h+"",t,e,s):void 0;a===void 0&&(a=f),vt(t,h,a)}},te)}function gn(t,e,n,o,s,f,h){var a=wt(t,n),g=wt(e,n),N=h.get(g);if(N){vt(t,n,N);return}var A=f?f(a,g,n+"",t,e,h):void 0,it=A===void 0;if(it){var At=Ct(g),Nt=!At&&Xt(g),ne=!At&&!Nt&&kt(g);A=g,At||Nt||ne?Ct(a)?A=a:zn(a)?A=Tn(a):Nt?(it=!1,A=mn(g,!0)):ne?(it=!1,A=vn(g,!0)):A=[]:Ln(g)||$t(g)?(A=a,$t(a)?A=Mn(a):(!Q(a)||Et(a))&&(A=On(g))):it=!1}it&&(h.set(g,A),s(A,g,o,f,h),h.delete(g)),vt(t,n,A)}function _n(t,e){return xn(jn(t,e,ee),t+"")}var bn=dt?function(t,e){return dt(t,"toString",{configurable:!0,enumerable:!1,value:Dn(e),writable:!0})}:ee;function mn(t,e){if(e)return t.slice();var n=t.length,o=Ht?Ht(n):new t.constructor(n);return t.copy(o),o}function yn(t){var e=new t.constructor(t.byteLength);return new Ut(e).set(new Ut(t)),e}function vn(t,e){var n=e?yn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Tn(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}function Sn(t,e,n,o){var s=!n;n||(n={});for(var f=-1,h=e.length;++f<h;){var a=e[f],g=o?o(n[a],t[a],a,n,t):void 0;g===void 0&&(g=t[a]),s?Tt(n,a,g):fn(n,a,g)}return n}function wn(t){return _n(function(e,n){var o=-1,s=n.length,f=s>1?n[s-1]:void 0,h=s>2?n[2]:void 0;for(f=t.length>3&&typeof f=="function"?(s--,f):void 0,h&&En(n[0],n[1],h)&&(f=s<3?void 0:f,s=1),e=Object(e);++o<s;){var a=n[o];a&&t(e,a,o,f)}return e})}function $n(t){return function(e,n,o){for(var s=-1,f=Object(e),h=o(e),a=h.length;a--;){var g=h[t?a:++s];if(n(f[g],g,f)===!1)break}return e}}function gt(t,e){var n=t.__data__;return An(e)?n[typeof e=="string"?"string":"hash"]:n.map}function St(t,e){var n=Be(t,e);return dn(n)?n:void 0}function Cn(t){var e=I.call(t,W),n=t[W];try{t[W]=void 0;var o=!0}catch{}var s=Ft.call(t);return o&&(e?t[W]=n:delete t[W]),s}function On(t){return typeof t.constructor=="function"&&!Jt(t)?Ue(Gt(t)):{}}function Zt(t,e){var n=typeof t;return e=e==null?v:e,!!e&&(n=="number"||n!="symbol"&&Oe.test(t))&&t>-1&&t%1==0&&t<e}function En(t,e,n){if(!Q(n))return!1;var o=typeof e;return(o=="number"?Ot(n)&&Zt(e,n.length):o=="string"&&e in n)?_t(n[e],t):!1}function An(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Nn(t){return!!Mt&&Mt in t}function Jt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||ct;return t===n}function Vn(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Bn(t){return Ft.call(t)}function jn(t,e,n){return e=qt(e===void 0?t.length-1:e,0),function(){for(var o=arguments,s=-1,f=qt(o.length-e,0),h=Array(f);++s<f;)h[s]=o[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=o[s];return a[e]=n(h),Ae(t,this,a)}}function wt(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var xn=Pn(bn);function Pn(t){var e=0,n=0;return function(){var o=De(),s=O-(o-n);if(n=o,s>0){if(++e>=m)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function In(t){if(t!=null){try{return ft.call(t)}catch{}try{return t+""}catch{}}return""}function _t(t,e){return t===e||t!==t&&e!==e}var $t=Kt(function(){return arguments}())?Kt:function(t){return ot(t)&&I.call(t,"callee")&&!Le.call(t,"callee")},Ct=Array.isArray;function Ot(t){return t!=null&&Yt(t.length)&&!Et(t)}function zn(t){return ot(t)&&Ot(t)}var Xt=Fe||Un;function Et(t){if(!Q(t))return!1;var e=ht(t);return e==T||e==Z||e==B||e==c}function Yt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=v}function Q(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ot(t){return t!=null&&typeof t=="object"}function Ln(t){if(!ot(t)||ht(t)!=S)return!1;var e=Gt(t);if(e===null)return!0;var n=I.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ft.call(n)==Ie}var kt=Lt?Ve(Lt):pn;function Mn(t){return Sn(t,te(t))}function te(t){return Ot(t)?cn(t,!0):hn(t)}var Fn=wn(function(t,e,n){Qt(t,e,n)});function Dn(t){return function(){return t}}function ee(t){return t}function Un(){return!1}i.exports=Fn})(bt,bt.exports);var Vt=bt.exports,Bt=(i,_)=>{const b=i.__vccOpts||i;for(const[w,m]of _)b[w]=m;return b};const ie=r.defineComponent({name:"VOnboardingStep",setup(i,{slots:_}){const b=r.ref(!1),w=r.inject("next-step",()=>{}),m=r.inject("previous-step",()=>{}),O=r.inject("exit",()=>{}),v=r.inject("options"),E=r.computed(()=>Vt({},v==null?void 0:v.value,y.value.options)),L=r.inject("is-first-step"),B=r.inject("is-last-step"),y=r.inject("step",{}),$=()=>{S(),w()},P=()=>{S(),m()};r.watch(()=>y.value,(l,d)=>{var C;!((C=_.default)!=null&&C.call(_))||S(d)});const T=r.ref(null),{updatePath:Z,path:J}=oe(),k=()=>{var d,C,j,x,M,F,D,U,H,G,R,q;const l=at((C=(d=y==null?void 0:y.value)==null?void 0:d.attachTo)==null?void 0:C.element);l&&T.value&&(b.value=!0,(x=(j=E.value)==null?void 0:j.scrollToStep)!=null&&x.enabled&&l.scrollIntoView((F=(M=E.value)==null?void 0:M.scrollToStep)==null?void 0:F.options),re.createPopper(l,T.value,E.value.popper),(U=(D=E.value)==null?void 0:D.overlay)!=null&&U.enabled&&Z(l,{padding:(G=(H=E.value)==null?void 0:H.overlay)==null?void 0:G.padding,borderRadius:(q=(R=E.value)==null?void 0:R.overlay)==null?void 0:q.borderRadius}),c(l))},tt=async()=>{var l,d,C;await((C=(d=(l=y==null?void 0:y.value)==null?void 0:l.on)==null?void 0:d.beforeStep)==null?void 0:C.call(d)),k()},S=(l=y.value)=>{var d,C,j,x;(C=(d=l==null?void 0:l.on)==null?void 0:d.afterStep)==null||C.call(d),u(at((j=l==null?void 0:l.attachTo)==null?void 0:j.element),(x=l.attachTo)==null?void 0:x.classList)},c=(l=at(y.value.attachTo.element))=>{const d=y.value.attachTo.classList;!d||!l||l.classList.add(...d)},u=(l=at(y.value.attachTo.element),d)=>{!d||!l||l.classList.remove(...d)};return r.onMounted(tt),{stepElement:T,onNext:$,onPrevious:P,path:J,show:b,step:y,isFirst:L,isLast:B,exit:O}}}),ae={style:{width:"100%",height:"100%",position:"fixed",top:"0",left:"0",opacity:"0.5","z-index":"var(--v-onboarding-overlay-z, 10)","pointer-events":"none"}},se=["d"],le={ref:"stepElement",style:{position:"relative","z-index":"var(--v-onboarding-step-z, 20)"}},ce={class:"v-onboarding-item"},fe={class:"v-onboarding-item__header"},ue={key:0,class:"v-onboarding-item__header-title"},de=[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)],pe={key:0,class:"v-onboarding-item__description"},he={class:"v-onboarding-item__actions"},ge=r.createElementVNode("div",{"data-popper-arrow":""},null,-1);function _e(i,_,b,w,m,O){return r.withDirectives((r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createElementBlock("svg",ae,[r.createElementVNode("path",{d:i.path},null,8,se)])),r.createElementVNode("div",le,[i.step?r.renderSlot(i.$slots,"default",{key:0},()=>[r.createElementVNode("div",ce,[r.createElementVNode("div",fe,[i.step.content.title?(r.openBlock(),r.createElementBlock("span",ue,r.toDisplayString(i.step.content.title),1)):r.createCommentVNode("",!0),r.createElementVNode("button",{onClick:_[0]||(_[0]=(...v)=>i.exit&&i.exit(...v)),class:"v-onboarding-item__header-close"},de)]),i.step.content.description?(r.openBlock(),r.createElementBlock("p",pe,r.toDisplayString(i.step.content.description),1)):r.createCommentVNode("",!0),r.createElementVNode("div",he,[i.isFirst?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("button",{key:0,type:"button",onClick:_[1]||(_[1]=(...v)=>i.onPrevious&&i.onPrevious(...v)),class:"v-onboarding-btn-secondary"},"Previous")),r.createElementVNode("button",{onClick:_[2]||(_[2]=(...v)=>i.onNext&&i.onNext(...v)),type:"button",class:"v-onboarding-btn-primary"},r.toDisplayString(i.isLast?"Finish":"Next"),1)])])]):r.createCommentVNode("",!0),ge],512)],512)),[[r.vShow,i.show]])}var jt=Bt(ie,[["render",_e]]);const be=r.defineComponent({name:"VOnboardingWrapper",components:{VOnboardingStep:jt},props:{steps:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})}},setup(i,{expose:_}){const b=r.ref(-1),w=T=>{typeof T=="function"?b.value=T(b.value):b.value=T},m=r.computed(()=>{var T;return((T=i.steps)==null?void 0:T[b.value])||null}),O=()=>{w(T=>T-1)},v=()=>{w(T=>T+1)},E=r.computed(()=>b.value>=i.steps.length||b.value<0),L=()=>{w(0)},B=()=>{w(-1)};_({start:L,finish:B,goToStep:w});const y=r.computed(()=>Vt({},st,i.options));r.provide("options",y),r.provide("step",m),r.provide("next-step",v),r.provide("previous-step",O),r.provide("exit",()=>B());const $=r.computed(()=>b.value===0),P=r.computed(()=>b.value===i.steps.length-1);return r.provide("is-first-step",$),r.provide("is-last-step",P),{index:b,activeStep:m,toPreviousStep:O,toNextStep:v,isFinished:E,setIndex:w,isFirstStep:$,isLastStep:P,finish:B}}}),me={key:0,"data-v-onboarding-wrapper":""};function ye(i,_,b,w,m,O){const v=r.resolveComponent("VOnboardingStep");return i.isFinished?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",me,[r.renderSlot(i.$slots,"default",{key:i.index,step:i.activeStep,next:()=>i.toNextStep(),previous:()=>i.toPreviousStep(),exit:()=>i.finish(),isFirst:i.isFirstStep,isLast:i.isLastStep,index:i.index},()=>[(r.openBlock(),r.createBlock(v,{key:i.index}))])]))}var ve=Bt(be,[["render",ye]]);function Te(i){return{start:()=>{var m;return(m=i==null?void 0:i.value)==null?void 0:m.start()},finish:()=>{var m;return(m=i==null?void 0:i.value)==null?void 0:m.finish()},goToStep:m=>{var O;return(O=i==null?void 0:i.value)==null?void 0:O.goToStep(m)}}}var Gn="";V.VOnboardingStep=jt,V.VOnboardingWrapper=ve,V.useVOnboarding=Te,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
11
|
+
`,m.value=v,B.value=$,_.value=d};return r.onMounted(()=>{window.addEventListener("scroll",u),window.addEventListener("resize",u)}),r.onUnmounted(()=>{window.removeEventListener("scroll",u),window.removeEventListener("resize",u)}),{path:o,updatePath:C}}var lt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},_t={exports:{}};(function(o,m){var B=200,_="__lodash_hash_undefined__",u=800,C=16,y=9007199254740991,T="[object Arguments]",M="[object Array]",F="[object AsyncFunction]",v="[object Boolean]",x="[object Date]",D="[object Error]",j="[object Function]",P="[object GeneratorFunction]",w="[object Map]",Y="[object Number]",tt="[object Null]",$="[object Object]",d="[object Proxy]",f="[object RegExp]",U="[object Set]",Z="[object String]",a="[object Undefined]",c="[object WeakMap]",S="[object ArrayBuffer]",E="[object DataView]",O="[object Float32Array]",z="[object Float64Array]",H="[object Int8Array]",G="[object Int16Array]",R="[object Int32Array]",k="[object Uint8Array]",q="[object Uint8ClampedArray]",ct="[object Uint16Array]",dt="[object Uint32Array]",xe=/[\\^$.*+?()[\]{}|]/g,$e=/^\[object .+?Constructor\]$/,Be=/^(?:0|[1-9]\d*)$/,h={};h[O]=h[z]=h[H]=h[G]=h[R]=h[k]=h[q]=h[ct]=h[dt]=!0,h[T]=h[M]=h[S]=h[v]=h[E]=h[x]=h[D]=h[j]=h[w]=h[Y]=h[$]=h[f]=h[U]=h[Z]=h[c]=!1;var Pt=typeof lt=="object"&<&<.Object===Object&<,Ce=typeof self=="object"&&self&&self.Object===Object&&self,et=Pt||Ce||Function("return this")(),It=m&&!m.nodeType&&m,nt=It&&!0&&o&&!o.nodeType&&o,Lt=nt&&nt.exports===It,yt=Lt&&Pt.process,Mt=function(){try{var t=nt&&nt.require&&nt.require("util").types;return t||yt&&yt.binding&&yt.binding("util")}catch{}}(),Ft=Mt&&Mt.isTypedArray;function Ee(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 Oe(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function Ae(t){return function(e){return t(e)}}function Ve(t,e){return t==null?void 0:t[e]}function Ne(t,e){return function(n){return t(e(n))}}var je=Array.prototype,ze=Function.prototype,ut=Object.prototype,Tt=et["__core-js_shared__"],ft=ze.toString,I=ut.hasOwnProperty,Dt=function(){var t=/[^.]+$/.exec(Tt&&Tt.keys&&Tt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ut=ut.toString,Pe=ft.call(Object),Ie=RegExp("^"+ft.call(I).replace(xe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pt=Lt?et.Buffer:void 0,Ht=et.Symbol,Gt=et.Uint8Array,Rt=pt?pt.allocUnsafe:void 0,kt=Ne(Object.getPrototypeOf,Object),qt=Object.create,Le=ut.propertyIsEnumerable,Me=je.splice,W=Ht?Ht.toStringTag:void 0,ht=function(){try{var t=xt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Fe=pt?pt.isBuffer:void 0,Wt=Math.max,De=Date.now,Kt=xt(et,"Map"),rt=xt(Object,"create"),Ue=function(){function t(){}return function(e){if(!Q(e))return{};if(qt)return qt(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 He(){this.__data__=rt?rt(null):{},this.size=0}function Ge(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Re(t){var e=this.__data__;if(rt){var n=e[t];return n===_?void 0:n}return I.call(e,t)?e[t]:void 0}function ke(t){var e=this.__data__;return rt?e[t]!==void 0:I.call(e,t)}function qe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=rt&&e===void 0?_:e,this}K.prototype.clear=He,K.prototype.delete=Ge,K.prototype.get=Re,K.prototype.has=ke,K.prototype.set=qe;function L(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 We(){this.__data__=[],this.size=0}function Ke(t){var e=this.__data__,n=gt(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 Qe(t){var e=this.__data__,n=gt(e,t);return n<0?void 0:e[n][1]}function Ze(t){return gt(this.__data__,t)>-1}function Je(t,e){var n=this.__data__,i=gt(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}L.prototype.clear=We,L.prototype.delete=Ke,L.prototype.get=Qe,L.prototype.has=Ze,L.prototype.set=Je;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 Xe(){this.size=0,this.__data__={hash:new K,map:new(Kt||L),string:new K}}function Ye(t){var e=mt(this,t).delete(t);return this.size-=e?1:0,e}function tn(t){return mt(this,t).get(t)}function en(t){return mt(this,t).has(t)}function nn(t,e){var n=mt(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}J.prototype.clear=Xe,J.prototype.delete=Ye,J.prototype.get=tn,J.prototype.has=en,J.prototype.set=nn;function X(t){var e=this.__data__=new L(t);this.size=e.size}function rn(){this.__data__=new L,this.size=0}function on(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function an(t){return this.__data__.get(t)}function sn(t){return this.__data__.has(t)}function ln(t,e){var n=this.__data__;if(n instanceof L){var i=n.__data__;if(!Kt||i.length<B-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}X.prototype.clear=rn,X.prototype.delete=on,X.prototype.get=an,X.prototype.has=sn,X.prototype.set=ln;function cn(t,e){var n=Ct(t),i=!n&&Bt(t),l=!n&&!i&&Yt(t),p=!n&&!i&&!l&&ee(t),g=n||i||l||p,s=g?Oe(t.length,String):[],b=s.length;for(var V in t)(e||I.call(t,V))&&!(g&&(V=="length"||l&&(V=="offset"||V=="parent")||p&&(V=="buffer"||V=="byteLength"||V=="byteOffset")||Jt(V,b)))&&s.push(V);return s}function wt(t,e,n){(n!==void 0&&!vt(t[e],n)||n===void 0&&!(e in t))&&St(t,e,n)}function dn(t,e,n){var i=t[e];(!(I.call(t,e)&&vt(i,n))||n===void 0&&!(e in t))&&St(t,e,n)}function gt(t,e){for(var n=t.length;n--;)if(vt(t[n][0],e))return n;return-1}function St(t,e,n){e=="__proto__"&&ht?ht(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var un=xn();function bt(t){return t==null?t===void 0?a:tt:W&&W in Object(t)?$n(t):Vn(t)}function Qt(t){return ot(t)&&bt(t)==T}function fn(t){if(!Q(t)||On(t))return!1;var e=Ot(t)?Ie:$e;return e.test(Pn(t))}function pn(t){return ot(t)&&te(t.length)&&!!h[bt(t)]}function hn(t){if(!Q(t))return An(t);var e=Xt(t),n=[];for(var i in t)i=="constructor"&&(e||!I.call(t,i))||n.push(i);return n}function Zt(t,e,n,i,l){t!==e&&un(e,function(p,g){if(l||(l=new X),Q(p))gn(t,e,g,n,Zt,i,l);else{var s=i?i($t(t,g),p,g+"",t,e,l):void 0;s===void 0&&(s=p),wt(t,g,s)}},ne)}function gn(t,e,n,i,l,p,g){var s=$t(t,n),b=$t(e,n),V=g.get(b);if(V){wt(t,n,V);return}var A=p?p(s,b,n+"",t,e,g):void 0,it=A===void 0;if(it){var At=Ct(b),Vt=!At&&Yt(b),oe=!At&&!Vt&&ee(b);A=b,At||Vt||oe?Ct(s)?A=s:In(s)?A=Tn(s):Vt?(it=!1,A=vn(b,!0)):oe?(it=!1,A=yn(b,!0)):A=[]:Ln(b)||Bt(b)?(A=s,Bt(s)?A=Mn(s):(!Q(s)||Ot(s))&&(A=Bn(b))):it=!1}it&&(g.set(b,A),l(A,b,i,p,g),g.delete(b)),wt(t,n,A)}function bn(t,e){return jn(Nn(t,e,re),t+"")}var mn=ht?function(t,e){return ht(t,"toString",{configurable:!0,enumerable:!1,value:Dn(e),writable:!0})}:re;function vn(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 _n(t){var e=new t.constructor(t.byteLength);return new Gt(e).set(new Gt(t)),e}function yn(t,e){var n=e?_n(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Tn(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function wn(t,e,n,i){var l=!n;n||(n={});for(var p=-1,g=e.length;++p<g;){var s=e[p],b=i?i(n[s],t[s],s,n,t):void 0;b===void 0&&(b=t[s]),l?St(n,s,b):dn(n,s,b)}return n}function Sn(t){return bn(function(e,n){var i=-1,l=n.length,p=l>1?n[l-1]:void 0,g=l>2?n[2]:void 0;for(p=t.length>3&&typeof p=="function"?(l--,p):void 0,g&&Cn(n[0],n[1],g)&&(p=l<3?void 0:p,l=1),e=Object(e);++i<l;){var s=n[i];s&&t(e,s,i,p)}return e})}function xn(t){return function(e,n,i){for(var l=-1,p=Object(e),g=i(e),s=g.length;s--;){var b=g[t?s:++l];if(n(p[b],b,p)===!1)break}return e}}function mt(t,e){var n=t.__data__;return En(e)?n[typeof e=="string"?"string":"hash"]:n.map}function xt(t,e){var n=Ve(t,e);return fn(n)?n:void 0}function $n(t){var e=I.call(t,W),n=t[W];try{t[W]=void 0;var i=!0}catch{}var l=Ut.call(t);return i&&(e?t[W]=n:delete t[W]),l}function Bn(t){return typeof t.constructor=="function"&&!Xt(t)?Ue(kt(t)):{}}function Jt(t,e){var n=typeof t;return e=e==null?y:e,!!e&&(n=="number"||n!="symbol"&&Be.test(t))&&t>-1&&t%1==0&&t<e}function Cn(t,e,n){if(!Q(n))return!1;var i=typeof e;return(i=="number"?Et(n)&&Jt(e,n.length):i=="string"&&e in n)?vt(n[e],t):!1}function En(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function On(t){return!!Dt&&Dt in t}function Xt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||ut;return t===n}function An(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Vn(t){return Ut.call(t)}function Nn(t,e,n){return e=Wt(e===void 0?t.length-1:e,0),function(){for(var i=arguments,l=-1,p=Wt(i.length-e,0),g=Array(p);++l<p;)g[l]=i[e+l];l=-1;for(var s=Array(e+1);++l<e;)s[l]=i[l];return s[e]=n(g),Ee(t,this,s)}}function $t(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var jn=zn(mn);function zn(t){var e=0,n=0;return function(){var i=De(),l=C-(i-n);if(n=i,l>0){if(++e>=u)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Pn(t){if(t!=null){try{return ft.call(t)}catch{}try{return t+""}catch{}}return""}function vt(t,e){return t===e||t!==t&&e!==e}var Bt=Qt(function(){return arguments}())?Qt:function(t){return ot(t)&&I.call(t,"callee")&&!Le.call(t,"callee")},Ct=Array.isArray;function Et(t){return t!=null&&te(t.length)&&!Ot(t)}function In(t){return ot(t)&&Et(t)}var Yt=Fe||Un;function Ot(t){if(!Q(t))return!1;var e=bt(t);return e==j||e==P||e==F||e==d}function te(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=y}function Q(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ot(t){return t!=null&&typeof t=="object"}function Ln(t){if(!ot(t)||bt(t)!=$)return!1;var e=kt(t);if(e===null)return!0;var n=I.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ft.call(n)==Pe}var ee=Ft?Ae(Ft):pn;function Mn(t){return wn(t,ne(t))}function ne(t){return Et(t)?cn(t,!0):hn(t)}var Fn=Sn(function(t,e,n){Zt(t,e,n)});function Dn(t){return function(){return t}}function re(t){return t}function Un(){return!1}o.exports=Fn})(_t,_t.exports);var Nt=_t.exports,jt=(o,m)=>{const B=o.__vccOpts||o;for(const[_,u]of m)B[_]=u;return B};const se=r.defineComponent({name:"VOnboardingStep",setup(o,{slots:m}){const B=r.ref(!1),_=r.inject("next-step",()=>{}),u=r.inject("previous-step",()=>{}),C=r.inject("exit",()=>{}),y=r.inject("options"),T=r.computed(()=>Nt({},y==null?void 0:y.value,v.value.options)),M=r.inject("is-first-step"),F=r.inject("is-last-step"),v=r.inject("step",{}),x=r.computed(()=>{var a,c;return{previous:!((a=T.value.hideButtons)!=null&&a.previous),next:!((c=T.value.hideButtons)!=null&&c.next)}}),D=r.computed(()=>{var a,c,S,E,O,z;return{previous:(c=(a=T.value)==null?void 0:a.labels)==null?void 0:c.previousButton,next:(E=(S=T.value)==null?void 0:S.labels)==null?void 0:E.nextButton,finish:(z=(O=T.value)==null?void 0:O.labels)==null?void 0:z.finishButton}}),j=()=>{f(),_()},P=()=>{f(),u()};r.watch(()=>v.value,(a,c)=>{var S;!((S=m.default)!=null&&S.call(m))||f(c)});const w=r.ref(null),{updatePath:Y,path:tt}=ae(),$=()=>{var c,S,E,O,z,H,G,R,k,q,ct,dt;const a=at((S=(c=v==null?void 0:v.value)==null?void 0:c.attachTo)==null?void 0:S.element);a&&w.value&&(B.value=!0,(O=(E=T.value)==null?void 0:E.scrollToStep)!=null&&O.enabled&&a.scrollIntoView((H=(z=T.value)==null?void 0:z.scrollToStep)==null?void 0:H.options),ie.createPopper(a,w.value,T.value.popper),(R=(G=T.value)==null?void 0:G.overlay)!=null&&R.enabled&&Y(a,{padding:(q=(k=T.value)==null?void 0:k.overlay)==null?void 0:q.padding,borderRadius:(dt=(ct=T.value)==null?void 0:ct.overlay)==null?void 0:dt.borderRadius}),U(a))},d=async()=>{var a,c,S;await((S=(c=(a=v==null?void 0:v.value)==null?void 0:a.on)==null?void 0:c.beforeStep)==null?void 0:S.call(c)),$()},f=(a=v.value)=>{var c,S,E,O;(S=(c=a==null?void 0:a.on)==null?void 0:c.afterStep)==null||S.call(c),Z(at((E=a==null?void 0:a.attachTo)==null?void 0:E.element),(O=a==null?void 0:a.attachTo)==null?void 0:O.classList)},U=(a=at(v.value.attachTo.element))=>{const c=v.value.attachTo.classList;!c||!a||a.classList.add(...c)},Z=(a=at(v.value.attachTo.element),c)=>{!c||!a||a.classList.remove(...c)};return r.onMounted(d),{stepElement:w,onNext:j,onPrevious:P,path:tt,show:B,step:v,isFirst:M,isLast:F,exit:C,isButtonVisible:x,buttonLabels:D}}}),le={style:{width:"100%",height:"100%",position:"fixed",top:"0",left:"0",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=[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)],ge={key:0,class:"v-onboarding-item__description"},be={class:"v-onboarding-item__actions"},me=r.createElementVNode("div",{"data-popper-arrow":""},null,-1);function ve(o,m,B,_,u,C){return r.withDirectives((r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createElementBlock("svg",le,[r.createElementVNode("path",{d:o.path},null,8,ce)])),r.createElementVNode("div",de,[o.step?r.renderSlot(o.$slots,"default",{key:0},()=>[r.createElementVNode("div",ue,[r.createElementVNode("div",fe,[o.step.content.title?(r.openBlock(),r.createElementBlock("span",pe,r.toDisplayString(o.step.content.title),1)):r.createCommentVNode("",!0),r.createElementVNode("button",{onClick:m[0]||(m[0]=(...y)=>o.exit&&o.exit(...y)),class:"v-onboarding-item__header-close"},he)]),o.step.content.description?(r.openBlock(),r.createElementBlock("p",ge,r.toDisplayString(o.step.content.description),1)):r.createCommentVNode("",!0),r.createElementVNode("div",be,[!o.isFirst&&o.isButtonVisible.previous?(r.openBlock(),r.createElementBlock("button",{key:0,type:"button",onClick:m[1]||(m[1]=(...y)=>o.onPrevious&&o.onPrevious(...y)),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]=(...y)=>o.onNext&&o.onNext(...y)),type:"button",class:"v-onboarding-btn-primary"},r.toDisplayString(o.isLast?o.buttonLabels.finish:o.buttonLabels.next),1)):r.createCommentVNode("",!0)])])]):r.createCommentVNode("",!0),me],512)],512)),[[r.vShow,o.show]])}var zt=jt(se,[["render",ve]]);const _e=r.defineComponent({name:"VOnboardingWrapper",components:{VOnboardingStep:zt},props:{steps:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})}},emits:["exit"],setup(o,{expose:m,emit:B}){const _=r.ref(-1),u=w=>{typeof w=="function"?_.value=w(_.value):_.value=w},C=r.computed(()=>{var w;return((w=o.steps)==null?void 0:w[_.value])||null}),y=()=>{u(w=>w-1)},T=()=>{u(w=>w+1)},M=r.computed(()=>_.value>=o.steps.length||_.value<0),F=()=>{u(0)},v=()=>{u(-1)},x=()=>{v(),B("exit")};m({start:F,finish:v,goToStep:u});const D=r.computed(()=>Nt({},st,o.options));r.provide("options",D),r.provide("step",C),r.provide("next-step",T),r.provide("previous-step",y),r.provide("exit",x);const j=r.computed(()=>_.value===0),P=r.computed(()=>_.value===o.steps.length-1);return r.provide("is-first-step",j),r.provide("is-last-step",P),{index:_,activeStep:C,toPreviousStep:y,toNextStep:T,isFinished:M,setIndex:u,isFirstStep:j,isLastStep:P,finish:v}}}),ye={key:0,"data-v-onboarding-wrapper":""};function Te(o,m,B,_,u,C){const y=r.resolveComponent("VOnboardingStep");return o.isFinished?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",ye,[r.renderSlot(o.$slots,"default",{key:o.index,step:o.activeStep,next:()=>o.toNextStep(),previous:()=>o.toPreviousStep(),exit:()=>o.finish(),isFirst:o.isFirstStep,isLast:o.isLastStep,index:o.index},()=>[(r.openBlock(),r.createBlock(y,{key:o.index}))])]))}var we=jt(_e,[["render",Te]]);function Se(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()},goToStep:u=>{var C;return(C=o==null?void 0:o.value)==null?void 0:C.goToStep(u)}}}var Gn=(()=>`.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
|
+
`)();N.VOnboardingStep=zt,N.VOnboardingWrapper=we,N.useVOnboarding=Se,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -22,6 +22,15 @@ export interface VOnboardingWrapperOptions {
|
|
|
22
22
|
scrollToStep?: {
|
|
23
23
|
enabled?: boolean
|
|
24
24
|
options?: ScrollIntoViewOptions
|
|
25
|
+
},
|
|
26
|
+
hideButtons?: {
|
|
27
|
+
previous?: boolean
|
|
28
|
+
next?: boolean
|
|
29
|
+
},
|
|
30
|
+
labels?: {
|
|
31
|
+
previousButton?: string
|
|
32
|
+
nextButton?: string
|
|
33
|
+
finishButton?: string
|
|
25
34
|
}
|
|
26
35
|
}
|
|
27
36
|
|
|
@@ -39,5 +48,14 @@ export const defaultVOnboardingWrapperOptions: VOnboardingWrapperOptions = {
|
|
|
39
48
|
block: 'center',
|
|
40
49
|
inline: 'center'
|
|
41
50
|
}
|
|
51
|
+
},
|
|
52
|
+
labels: {
|
|
53
|
+
previousButton: 'Previous',
|
|
54
|
+
nextButton: 'Next',
|
|
55
|
+
finishButton: 'Finish'
|
|
56
|
+
},
|
|
57
|
+
hideButtons: {
|
|
58
|
+
previous: false,
|
|
59
|
+
next: false
|
|
42
60
|
}
|
|
43
61
|
}
|
package/src/typings.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue'
|
|
1
2
|
import { StepEntity } from '@/types/StepEntity'
|
|
2
3
|
import { VOnboardingWrapperOptions } from '@/types/VOnboardingWrapper'
|
|
3
|
-
import { DefineComponent } from 'vue'
|
|
4
4
|
|
|
5
5
|
declare const VOnboardingWrapper: DefineComponent<{
|
|
6
6
|
steps: StepEntity[]
|
|
@@ -15,4 +15,4 @@ declare const useVOnboarding: (wrapperRef: any) => {
|
|
|
15
15
|
goToStep: (newStepNumber: number | ((currentStepNumber: number) => number)) => void
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export { VOnboardingWrapper, VOnboardingStep, useVOnboarding }
|
|
18
|
+
export { VOnboardingWrapperOptions, VOnboardingWrapper, VOnboardingStep, useVOnboarding }
|