uikit 3.15.17-dev.fa9261722 → 3.15.18-dev.014d8e608
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/CHANGELOG.md +9 -0
- package/build/util.js +2 -3
- package/dist/css/uikit-core-rtl.css +1 -1
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +1 -1
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +1 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +1 -1
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +2 -2
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +15 -15
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +77 -84
- package/dist/js/components/lightbox-panel.min.js +9 -1
- package/dist/js/components/lightbox.js +80 -87
- package/dist/js/components/lightbox.min.js +9 -1
- package/dist/js/components/notification.js +14 -14
- package/dist/js/components/notification.min.js +4 -1
- package/dist/js/components/parallax.js +22 -22
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +18 -18
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +93 -45
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +18 -18
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +33 -38
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +7 -7
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +24 -24
- package/dist/js/components/tooltip.min.js +3 -1
- package/dist/js/components/upload.js +7 -7
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +303 -282
- package/dist/js/uikit-core.min.js +21 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +499 -432
- package/dist/js/uikit.min.js +34 -1
- package/package.json +1 -1
- package/src/js/components/lightbox-panel.js +3 -5
- package/src/js/components/slider.js +62 -7
- package/src/js/core/sticky.js +26 -9
- package/src/js/mixin/slider-drag.js +1 -1
- package/src/js/mixin/slider.js +2 -7
- package/src/js/util/viewport.js +4 -0
- package/tests/tooltip.html +1 -1
|
@@ -1 +1,9 @@
|
|
|
1
|
-
/*! UIkit 3.15.17-dev.fa9261722 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(s,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitlightbox_panel",["uikit-util"],u):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitLightbox_panel=u(s.UIkit.util))})(this,function(s){"use strict";var u={slide:{show(e){return[{transform:y(e*-100)},{transform:y()}]},percent(e){return q(e)},translate(e,t){return[{transform:y(t*-100*e)},{transform:y(t*100*(1-e))}]}}};function q(e){return Math.abs(s.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function y(e,t){return e===void 0&&(e=0),t===void 0&&(t="%"),e+=e?t:"","translate3d("+e+", 0, 0)"}function $(e){return"scale3d("+e+", "+e+", 1)"}var B={...u,fade:{show(){return[{opacity:0},{opacity:1}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e},{opacity:e}]}},scale:{show(){return[{opacity:0,transform:$(1-.2)},{opacity:1,transform:$(1)}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e,transform:$(1-.2*e)},{opacity:e,transform:$(1-.2+.2*e)}]}}},z={props:{container:Boolean},data:{container:!0},computed:{container(e){let{container:t}=e;return t===!0&&this.$container||t&&s.$(t)}}},V={connected(){s.addClass(this.$el,this.$options.id)}},O={props:{cls:Boolean,animation:"list",duration:Number,velocity:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,velocity:.2,origin:!1,transition:"ease",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave"},computed:{hasAnimation(e){let{animation:t}=e;return!!t[0]},hasTransition(e){let{animation:t}=e;return["slide","reveal"].some(n=>s.startsWith(t[0],n))}},methods:{toggleElement(e,t,n){return new Promise(o=>Promise.all(s.toNodes(e).map(a=>{const r=s.isBoolean(t)?t:!this.isToggled(a);if(!s.trigger(a,"before"+(r?"show":"hide"),[this]))return Promise.reject();const i=(s.isFunction(n)?n:n===!1||!this.hasAnimation?X:this.hasTransition?G:J)(a,r,this),h=r?this.clsEnter:this.clsLeave;s.addClass(a,h),s.trigger(a,r?"show":"hide",[this]);const d=()=>{s.removeClass(a,h),s.trigger(a,r?"shown":"hidden",[this])};return i?i.then(d,()=>(s.removeClass(a,h),Promise.reject())):d()})).then(o,s.noop))},isToggled(e){return e===void 0&&(e=this.$el),[e]=s.toNodes(e),s.hasClass(e,this.clsEnter)?!0:s.hasClass(e,this.clsLeave)?!1:this.cls?s.hasClass(e,this.cls.split(" ")[0]):s.isVisible(e)},_toggle(e,t){if(!e)return;t=Boolean(t);let n;this.cls?(n=s.includes(this.cls," ")||t!==s.hasClass(e,this.cls),n&&s.toggleClass(e,this.cls,s.includes(this.cls," ")?void 0:t)):(n=t===e.hidden,n&&(e.hidden=!t)),s.$$("[autofocus]",e).some(o=>s.isVisible(o)?o.focus()||!0:o.blur()),n&&s.trigger(e,"toggled",[t,this])}}};function X(e,t,n){let{_toggle:o}=n;return s.Animation.cancel(e),s.Transition.cancel(e),o(e,t)}async function G(e,t,n){var o;let{animation:a,duration:r,velocity:i,transition:h,_toggle:d}=n;const[c="reveal",g="top"]=((o=a[0])==null?void 0:o.split("-"))||[],l=[["left","right"],["top","bottom"]],m=l[s.includes(l[0],g)?0:1],T=m[1]===g,A=["width","height"][l.indexOf(m)],v="margin-"+m[0],_="margin-"+g;let x=s.dimensions(e)[A];const me=s.Transition.inProgress(e);await s.Transition.cancel(e),t&&d(e,!0);const ge=Object.fromEntries(["padding","border","width","height","minWidth","minHeight","overflowY","overflowX",v,_].map(Y=>[Y,e.style[Y]])),I=s.dimensions(e),N=s.toFloat(s.css(e,v)),F=s.toFloat(s.css(e,_)),p=I[A]+F;!me&&!t&&(x+=F);const[P]=s.wrapInner(e,"<div>");s.css(P,{boxSizing:"border-box",height:I.height,width:I.width,...s.css(e,["overflow","padding","borderTop","borderRight","borderBottom","borderLeft","borderImage",_])}),s.css(e,{padding:0,border:0,minWidth:0,minHeight:0,[_]:0,width:I.width,height:I.height,overflow:"hidden",[A]:x});const H=x/p;r=(i*p+r)*(t?1-H:H);const L={[A]:t?p:0};T&&(s.css(e,v,p-x+N),L[v]=t?N:p+N),!T^c==="reveal"&&(s.css(P,v,-p+x),s.Transition.start(P,{[v]:t?0:-p},r,h));try{await s.Transition.start(e,L,r,h)}finally{s.css(e,ge),s.unwrap(P.firstChild),t||d(e,!1)}}function J(e,t,n){s.Animation.cancel(e);const{animation:o,duration:a,_toggle:r}=n;return t?(r(e,!0),s.Animation.in(e,o[0],a,n.origin)):s.Animation.out(e,o[1]||o[0],a,n.origin).then(()=>r(e,!1))}const f=[];var K={mixins:[V,z,O],props:{selPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean},data:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1},computed:{panel(e,t){let{selPanel:n}=e;return s.$(n,t)},transitionElement(){return this.panel},bgClose(e){let{bgClose:t}=e;return t&&this.panel}},beforeDisconnect(){s.includes(f,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate(){return this.selClose+',a[href*="#"]'},handler(e){const{current:t,defaultPrevented:n}=e,{hash:o}=t;!n&&o&&ee(t)&&!s.within(o,this.$el)&&s.$(o,document.body)?this.hide():s.matches(t,this.selClose)&&(e.preventDefault(),this.hide())}},{name:"toggle",self:!0,handler(e){e.defaultPrevented||(e.preventDefault(),this.isToggled()===s.includes(f,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(e){if(s.includes(f,this))return!1;!this.stack&&f.length?(Promise.all(f.map(t=>t.hide())).then(this.show),e.preventDefault()):f.push(this)}},{name:"show",self:!0,handler(){s.once(this.$el,"hide",s.on(document,"focusin",e=>{s.last(f)===this&&!s.within(e.target,this.$el)&&this.$el.focus()})),this.overlay&&(s.once(this.$el,"hidden",Z(this.$el),{self:!0}),s.once(this.$el,"hidden",k(),{self:!0})),this.stack&&s.css(this.$el,"zIndex",s.toFloat(s.css(this.$el,"zIndex"))+f.length),s.addClass(document.documentElement,this.clsPage),this.bgClose&&s.once(this.$el,"hide",s.on(document,s.pointerDown,e=>{let{target:t}=e;s.last(f)!==this||this.overlay&&!s.within(t,this.$el)||s.within(t,this.panel)||s.once(document,s.pointerUp+" "+s.pointerCancel+" scroll",n=>{let{defaultPrevented:o,type:a,target:r}=n;!o&&a===s.pointerUp&&t===r&&this.hide()},!0)}),{self:!0}),this.escClose&&s.once(this.$el,"hide",s.on(document,"keydown",e=>{e.keyCode===27&&s.last(f)===this&&this.hide()}),{self:!0})}},{name:"shown",self:!0,handler(){s.isFocusable(this.$el)||s.attr(this.$el,"tabindex","-1"),s.$(":focus",this.$el)||this.$el.focus()}},{name:"hidden",self:!0,handler(){s.includes(f,this)&&f.splice(f.indexOf(this),1),s.css(this.$el,"zIndex",""),f.some(e=>e.clsPage===this.clsPage)||s.removeClass(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&s.parent(this.$el)!==this.container?(s.append(this.container,this.$el),new Promise(e=>requestAnimationFrame(()=>this.show().then(e)))):this.toggleElement(this.$el,!0,j)},hide(){return this.toggleElement(this.$el,!1,j)}}};function j(e,t,n){let{transitionElement:o,_toggle:a}=n;return new Promise((r,i)=>s.once(e,"show hide",()=>{e._reject==null||e._reject(),e._reject=i,a(e,t);const h=s.once(o,"transitionstart",()=>{s.once(o,"transitionend transitioncancel",r,{self:!0}),clearTimeout(d)},{self:!0}),d=setTimeout(()=>{h(),r()},Q(s.css(o,"transitionDuration")))})).then(()=>delete e._reject)}function Q(e){return e?s.endsWith(e,"ms")?s.toFloat(e):s.toFloat(e)*1e3:0}function Z(e){if(CSS.supports("overscroll-behavior","contain")){const o=[e,...U(e,a=>/auto|scroll/.test(s.css(a,"overflow")))];return s.css(o,"overscrollBehavior","contain"),()=>s.css(o,"overscrollBehavior","")}let t;const n=[s.on(e,"touchstart",o=>{let{targetTouches:a}=o;a.length===1&&(t=a[0].clientY)},{passive:!0}),s.on(e,"touchmove",o=>{if(o.targetTouches.length!==1)return;let[a]=s.scrollParents(o.target,/auto|scroll/);s.within(a,e)||(a=e);const r=o.targetTouches[0].clientY-t,{scrollTop:i,scrollHeight:h,clientHeight:d}=a;(d>=h||i===0&&r>0||h-i<=d&&r<0)&&o.cancelable&&o.preventDefault()},{passive:!1})];return()=>n.forEach(o=>o())}let S;function k(){if(S)return s.noop;S=!0;const{scrollingElement:e}=document;return s.css(e,{overflowY:"hidden",touchAction:"none",paddingRight:s.width(window)-e.clientWidth}),()=>{S=!1,s.css(e,{overflowY:"",touchAction:"",paddingRight:""})}}function U(e,t){const n=[];return s.apply(e,o=>{t(o)&&n.push(o)}),n}function ee(e){return["origin","pathname","search"].every(t=>e[t]===location[t])}function se(e,t,n,o){let{animation:a,easing:r}=o;const{percent:i,translate:h,show:d=s.noop}=a,c=d(n),g=new s.Deferred;return{dir:n,show(l,m,T){m===void 0&&(m=0);const b=T?"linear":r;return l-=Math.round(l*s.clamp(m,-1,1)),this.translate(m),C(t,"itemin",{percent:m,duration:l,timing:b,dir:n}),C(e,"itemout",{percent:1-m,duration:l,timing:b,dir:n}),Promise.all([s.Transition.start(t,c[1],l,b),s.Transition.start(e,c[0],l,b)]).then(()=>{this.reset(),g.resolve()},s.noop),g.promise},cancel(){s.Transition.cancel([t,e])},reset(){for(const l in c[0])s.css([t,e],l,"")},forward(l,m){return m===void 0&&(m=this.percent()),s.Transition.cancel([t,e]),this.show(l,m,!0)},translate(l){this.reset();const m=h(l,n);s.css(t,m[1]),s.css(e,m[0]),C(t,"itemtranslatein",{percent:l,dir:n}),C(e,"itemtranslateout",{percent:1-l,dir:n})},percent(){return i(e||t,t,n)},getDistance(){return e==null?void 0:e.offsetWidth}}}function C(e,t,n){s.trigger(e,s.createEvent(t,!1,!1,n))}var te={connected(){var e;this.registerObserver(s.observeResize(((e=this.$options.resizeTargets)==null?void 0:e.call(this))||this.$el,()=>this.$emit("resize")))}},ne={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){s.attr(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el(){return document},filter(){return this.autoplay},handler(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay(){this.stopAutoplay(),this.interval=setInterval(()=>(!this.draggable||!s.$(":focus",this.$el))&&(!this.pauseOnHover||!s.matches(this.$el,":hover"))&&!this.stack.length&&this.show("next"),this.autoplayInterval)},stopAutoplay(){this.interval&&clearInterval(this.interval)}}};const E={passive:!1,capture:!0},M={passive:!0,capture:!0},oe="touchstart mousedown",D="touchmove mousemove",W="touchend touchcancel mouseup click input scroll";var re={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const e of["start","move","end"]){const t=this[e];this[e]=n=>{const o=s.getEventPos(n).x*(s.isRtl?-1:1);this.prevPos=o===this.pos?this.prevPos:this.pos,this.pos=o,t(n)}}},events:[{name:oe,passive:!0,delegate(){return this.selSlides},handler(e){!this.draggable||!s.isTouch(e)&&ae(e.target)||s.closest(e.target,s.selInput)||e.button>0||this.length<2||this.start(e)}},{name:"dragstart",handler(e){e.preventDefault()}},{name:D,el(){return this.list},handler:s.noop,...E}],methods:{start(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,s.on(document,D,this.move,E),s.on(document,W,this.end,M),s.css(this.list,"userSelect","none")},move(e){const t=this.pos-this.drag;if(t===0||this.prevPos===this.pos||!this.dragging&&Math.abs(t)<this.threshold)return;s.css(this.list,"pointerEvents","none"),e.cancelable&&e.preventDefault(),this.dragging=!0,this.dir=t<0?1:-1;const{slides:n}=this;let{prevIndex:o}=this,a=Math.abs(t),r=this.getIndex(o+this.dir,o),i=this._getDistance(o,r)||n[o].offsetWidth;for(;r!==o&&a>i;)this.drag-=i*this.dir,o=r,a-=i,r=this.getIndex(o+this.dir,o),i=this._getDistance(o,r)||n[o].offsetWidth;this.percent=a/i;const h=n[o],d=n[r],c=this.index!==r,g=o===r;let l;[this.index,this.prevIndex].filter(m=>!s.includes([r,o],m)).forEach(m=>{s.trigger(n[m],"itemhidden",[this]),g&&(l=!0,this.prevIndex=o)}),(this.index===o&&this.prevIndex!==o||l)&&s.trigger(n[this.index],"itemshown",[this]),c&&(this.prevIndex=o,this.index=r,!g&&s.trigger(h,"beforeitemhide",[this]),s.trigger(d,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),h,!g&&d),c&&(!g&&s.trigger(h,"itemhide",[this]),s.trigger(d,"itemshow",[this]))},end(){if(s.off(document,D,this.move,E),s.off(document,W,this.end,M),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{const e=(s.isRtl?this.dir*(s.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=e?this.index:this.prevIndex,e&&(this.percent=1-this.percent),this.show(this.dir>0&&!e||this.dir<0&&e?"next":"previous",!0)}s.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function ae(e){return s.css(e,"userSelect")!=="none"&&s.toNodes(e.childNodes).some(t=>t.nodeType===3&&t.textContent.trim())}var ie={data:{selNav:!1},computed:{nav(e,t){let{selNav:n}=e;return s.$(n,t)},selNavItem(e){let{attrItem:t}=e;return"["+t+"],[data-"+t+"]"},navItems(e,t){return s.$$(this.selNavItem,t)}},update:{write(){this.nav&&this.length!==this.nav.children.length&&s.html(this.nav,this.slides.map((e,t)=>"<li "+this.attrItem+'="'+t+'"><a href></a></li>').join("")),this.navItems.concat(this.nav).forEach(e=>e&&(e.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]},events:[{name:"click",delegate(){return this.selNavItem},handler(e){e.preventDefault(),this.show(s.data(e.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav(){const e=this.getValidIndex();for(const t of this.navItems){const n=s.data(t,this.attrItem);s.toggleClass(t,this.clsActive,s.toNumber(n)===e),s.toggleClass(t,"uk-invisible",this.finite&&(n==="previous"&&e===0||n==="next"&&e>=this.maxIndex))}}}},he={mixins:[ne,re,ie,te],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number,selSlides:String},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){s.removeClass(this.slides,this.clsActive)},computed:{duration(e,t){let{velocity:n}=e;return ce(t.offsetWidth/n)},list(e,t){let{selList:n}=e;return s.$(n,t)},maxIndex(){return this.length-1},selSlides(e){let{selList:t,selSlides:n}=e;return t+" "+(n||"> *")},slides:{get(){return s.$$(this.selSlides,this.$el)},watch(){this.$emit("resize")}},length(){return this.slides.length}},methods:{show(e,t){if(t===void 0&&(t=!1),this.dragging||!this.length)return;const{stack:n}=this,o=t?0:n.length,a=()=>{n.splice(o,1),n.length&&this.show(n.shift(),!0)};if(n[t?"unshift":"push"](e),!t&&n.length>1){n.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}const r=this.getIndex(this.index),i=s.hasClass(this.slides,this.clsActive)&&this.slides[r],h=this.getIndex(e,this.index),d=this.slides[h];if(i===d){a();return}if(this.dir=de(e,r),this.prevIndex=r,this.index=h,i&&!s.trigger(i,"beforeitemhide",[this])||!s.trigger(d,"beforeitemshow",[this,i])){this.index=this.prevIndex,a();return}const c=this._show(i,d,t).then(()=>(i&&s.trigger(i,"itemhidden",[this]),s.trigger(d,"itemshown",[this]),new Promise(g=>{requestAnimationFrame(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,g()})})));return i&&s.trigger(i,"itemhide",[this]),s.trigger(d,"itemshow",[this]),c},getIndex(e,t){return e===void 0&&(e=this.index),t===void 0&&(t=this.index),s.clamp(s.getIndex(e,this.slides,t,this.finite),0,this.maxIndex)},getValidIndex(e,t){return e===void 0&&(e=this.index),t===void 0&&(t=this.prevIndex),this.getIndex(e,t)},_show(e,t,n){if(this._transitioner=this._getTransitioner(e,t,this.dir,{easing:n?t.offsetWidth<600?"cubic-bezier(0.25, 0.46, 0.45, 0.94)":"cubic-bezier(0.165, 0.84, 0.44, 1)":this.easing,...this.transitionOptions}),!n&&!e)return this._translate(1),Promise.resolve();const{length:o}=this.stack;return this._transitioner[o>1?"forward":"show"](o>1?Math.min(this.duration,75+75/(o-1)):this.duration,this.percent)},_getDistance(e,t){return this._getTransitioner(e,e!==t&&t).getDistance()},_translate(e,t,n){t===void 0&&(t=this.prevIndex),n===void 0&&(n=this.index);const o=this._getTransitioner(t!==n?t:!1,n);return o.translate(e),o},_getTransitioner(e,t,n,o){return e===void 0&&(e=this.prevIndex),t===void 0&&(t=this.index),n===void 0&&(n=this.dir||1),o===void 0&&(o=this.transitionOptions),new this.Transitioner(s.isNumber(e)?this.slides[e]:e,s.isNumber(t)?this.slides[t]:t,n*(s.isRtl?-1:1),o)}}};function de(e,t){return e==="next"?1:e==="previous"||e<t?-1:1}function ce(e){return .5*e+300}var le={mixins:[he],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:u,Transitioner:se},computed:{animation(e){let{animation:t,Animations:n}=e;return{...n[t]||n.slide,name:t}},transitionOptions(){return{animation:this.animation}}},events:{beforeitemshow(e){let{target:t}=e;s.addClass(t,this.clsActive)},itemshown(e){let{target:t}=e;s.addClass(t,this.clsActivated)},itemhidden(e){let{target:t}=e;s.removeClass(t,this.clsActive,this.clsActivated)}}},R={mixins:[z,K,O,le],functional:!0,props:{delayControls:Number,preload:Number,videoAutoplay:Boolean,template:String},data:()=>({preload:1,videoAutoplay:!1,delayControls:3e3,items:[],cls:"uk-open",clsPage:"uk-lightbox-page",selList:".uk-lightbox-items",attrItem:"uk-lightbox-item",selClose:".uk-close-large",selCaption:".uk-lightbox-caption",pauseOnHover:!1,velocity:2,Animations:B,template:'<div class="uk-lightbox uk-overflow-hidden"> <ul class="uk-lightbox-items"></ul> <div class="uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque"> <button class="uk-lightbox-toolbar-icon uk-close-large" type="button" uk-close></button> </div> <a class="uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade" href uk-slidenav-previous uk-lightbox-item="previous"></a> <a class="uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade" href uk-slidenav-next uk-lightbox-item="next"></a> <div class="uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div> </div>'}),created(){const e=s.$(this.template),t=s.$(this.selList,e);this.items.forEach(()=>s.append(t,"<li>")),this.$mount(s.append(this.container,e))},computed:{caption(e,t){let{selCaption:n}=e;return s.$(n,t)}},events:[{name:s.pointerMove+" "+s.pointerDown+" keydown",handler:"showControls"},{name:"click",self:!0,delegate(){return this.selSlides},handler(e){e.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler(){this.showControls()}},{name:"hide",self:!0,handler(){this.hideControls(),s.removeClass(this.slides,this.clsActive),s.Transition.stop(this.slides)}},{name:"hidden",self:!0,handler(){this.$destroy(!0)}},{name:"keyup",el(){return document},handler(e){if(!(!this.isToggled(this.$el)||!this.draggable))switch(e.keyCode){case 37:this.show("previous");break;case 39:this.show("next");break}}},{name:"beforeitemshow",handler(e){this.isToggled()||(this.draggable=!1,e.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=B.scale,s.removeClass(e.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){s.html(this.caption,this.getItem().caption||"");for(let e=-this.preload;e<=this.preload;e++)this.loadItem(this.index+e)}},{name:"itemshown",handler(){this.draggable=this.$props.draggable}},{name:"itemload",async handler(e,t){const{source:n,type:o,alt:a="",poster:r,attrs:i={}}=t;if(this.setItem(t,"<span uk-spinner></span>"),!n)return;let h;const d={allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":""+this.videoAutoplay};if(o==="image"||n.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i))try{const{width:c,height:g}=await s.getImage(n,i.srcset,i.size);this.setItem(t,w("img",{src:n,width:c,height:g,alt:a,...i}))}catch{this.setError(t)}else if(o==="video"||n.match(/\.(mp4|webm|ogv)($|\?)/i)){const c=w("video",{src:n,poster:r,controls:"",playsinline:"","uk-video":""+this.videoAutoplay});s.on(c,"loadedmetadata",()=>{s.attr(c,{width:c.videoWidth,height:c.videoHeight,...i}),this.setItem(t,c)}),s.on(c,"error",()=>this.setError(t))}else if(o==="iframe"||n.match(/\.(html|php)($|\?)/i))this.setItem(t,w("iframe",{src:n,allowfullscreen:"",class:"uk-lightbox-iframe",...i}));else if(h=n.match(/\/\/(?:.*?youtube(-nocookie)?\..*?[?&]v=|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(t,w("iframe",{src:"https://www.youtube"+(h[1]||"")+".com/embed/"+h[2]+(h[3]?"?"+h[3]:""),width:1920,height:1080,...d,...i}));else if(h=n.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{const{height:c,width:g}=await(await fetch("https://vimeo.com/api/oembed.json?maxwidth=1920&url="+encodeURI(n),{credentials:"omit"})).json();this.setItem(t,w("iframe",{src:"https://player.vimeo.com/video/"+h[1]+(h[2]?"?"+h[2]:""),width:g,height:c,...d,...i}))}catch{this.setError(t)}}}],methods:{loadItem(e){e===void 0&&(e=this.index);const t=this.getItem(e);this.getSlide(t).childElementCount||s.trigger(this.$el,"itemload",[t])},getItem(e){return e===void 0&&(e=this.index),this.items[s.getIndex(e,this.slides)]},setItem(e,t){s.trigger(this.$el,"itemloaded",[this,s.html(this.getSlide(e),t)])},getSlide(e){return this.slides[this.items.indexOf(e)]},setError(e){this.setItem(e,'<span uk-icon="icon: bolt; ratio: 2"></span>')},showControls(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),s.addClass(this.$el,"uk-active","uk-transition-active")},hideControls(){s.removeClass(this.$el,"uk-active","uk-transition-active")}}};function w(e,t){const n=s.fragment("<"+e+">");return s.attr(n,t),n}return typeof window<"u"&&window.UIkit&&window.UIkit.component("lightboxPanel",R),R});
|
|
1
|
+
/*! UIkit 3.15.18-dev.014d8e608 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(s,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitlightbox_panel",["uikit-util"],u):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitLightbox_panel=u(s.UIkit.util))})(this,function(s){"use strict";var u={slide:{show(e){return[{transform:I(e*-100)},{transform:I()}]},percent(e){return Y(e)},translate(e,t){return[{transform:I(t*-100*e)},{transform:I(t*100*(1-e))}]}}};function Y(e){return Math.abs(s.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function I(e=0,t="%"){return e+=e?t:"",`translate3d(${e}, 0, 0)`}function y(e){return`scale3d(${e}, ${e}, 1)`}var N={...u,fade:{show(){return[{opacity:0},{opacity:1}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e},{opacity:e}]}},scale:{show(){return[{opacity:0,transform:y(1-.2)},{opacity:1,transform:y(1)}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e,transform:y(1-.2*e)},{opacity:e,transform:y(1-.2+.2*e)}]}}},B={props:{container:Boolean},data:{container:!0},computed:{container({container:e}){return e===!0&&this.$container||e&&s.$(e)}}},q={connected(){s.addClass(this.$el,this.$options.id)}},z={props:{cls:Boolean,animation:"list",duration:Number,velocity:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,velocity:.2,origin:!1,transition:"ease",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave"},computed:{hasAnimation({animation:e}){return!!e[0]},hasTransition({animation:e}){return["slide","reveal"].some(t=>s.startsWith(e[0],t))}},methods:{toggleElement(e,t,n){return new Promise(r=>Promise.all(s.toNodes(e).map(h=>{const a=s.isBoolean(t)?t:!this.isToggled(h);if(!s.trigger(h,`before${a?"show":"hide"}`,[this]))return Promise.reject();const o=(s.isFunction(n)?n:n===!1||!this.hasAnimation?V:this.hasTransition?X:G)(h,a,this),i=a?this.clsEnter:this.clsLeave;s.addClass(h,i),s.trigger(h,a?"show":"hide",[this]);const d=()=>{s.removeClass(h,i),s.trigger(h,a?"shown":"hidden",[this])};return o?o.then(d,()=>(s.removeClass(h,i),Promise.reject())):d()})).then(r,s.noop))},isToggled(e=this.$el){return[e]=s.toNodes(e),s.hasClass(e,this.clsEnter)?!0:s.hasClass(e,this.clsLeave)?!1:this.cls?s.hasClass(e,this.cls.split(" ")[0]):s.isVisible(e)},_toggle(e,t){if(!e)return;t=Boolean(t);let n;this.cls?(n=s.includes(this.cls," ")||t!==s.hasClass(e,this.cls),n&&s.toggleClass(e,this.cls,s.includes(this.cls," ")?void 0:t)):(n=t===e.hidden,n&&(e.hidden=!t)),s.$$("[autofocus]",e).some(r=>s.isVisible(r)?r.focus()||!0:r.blur()),n&&s.trigger(e,"toggled",[t,this])}}};function V(e,t,{_toggle:n}){return s.Animation.cancel(e),s.Transition.cancel(e),n(e,t)}async function X(e,t,{animation:n,duration:r,velocity:h,transition:a,_toggle:o}){var i;const[d="reveal",l="top"]=((i=n[0])==null?void 0:i.split("-"))||[],c=[["left","right"],["top","bottom"]],m=c[s.includes(c[0],l)?0:1],g=m[1]===l,T=["width","height"][c.indexOf(m)],v=`margin-${m[0]}`,A=`margin-${l}`;let x=s.dimensions(e)[T];const le=s.Transition.inProgress(e);await s.Transition.cancel(e),t&&o(e,!0);const me=Object.fromEntries(["padding","border","width","height","minWidth","minHeight","overflowY","overflowX",v,A].map(L=>[L,e.style[L]])),$=s.dimensions(e),D=s.toFloat(s.css(e,v)),R=s.toFloat(s.css(e,A)),f=$[T]+R;!le&&!t&&(x+=R);const[_]=s.wrapInner(e,"<div>");s.css(_,{boxSizing:"border-box",height:$.height,width:$.width,...s.css(e,["overflow","padding","borderTop","borderRight","borderBottom","borderLeft","borderImage",A])}),s.css(e,{padding:0,border:0,minWidth:0,minHeight:0,[A]:0,width:$.width,height:$.height,overflow:"hidden",[T]:x});const F=x/f;r=(h*f+r)*(t?1-F:F);const H={[T]:t?f:0};g&&(s.css(e,v,f-x+D),H[v]=t?D:f+D),!g^d==="reveal"&&(s.css(_,v,-f+x),s.Transition.start(_,{[v]:t?0:-f},r,a));try{await s.Transition.start(e,H,r,a)}finally{s.css(e,me),s.unwrap(_.firstChild),t||o(e,!1)}}function G(e,t,n){s.Animation.cancel(e);const{animation:r,duration:h,_toggle:a}=n;return t?(a(e,!0),s.Animation.in(e,r[0],h,n.origin)):s.Animation.out(e,r[1]||r[0],h,n.origin).then(()=>a(e,!1))}const p=[];var J={mixins:[q,B,z],props:{selPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean},data:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1},computed:{panel({selPanel:e},t){return s.$(e,t)},transitionElement(){return this.panel},bgClose({bgClose:e}){return e&&this.panel}},beforeDisconnect(){s.includes(p,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate(){return`${this.selClose},a[href*="#"]`},handler(e){const{current:t,defaultPrevented:n}=e,{hash:r}=t;!n&&r&&U(t)&&!s.within(r,this.$el)&&s.$(r,document.body)?this.hide():s.matches(t,this.selClose)&&(e.preventDefault(),this.hide())}},{name:"toggle",self:!0,handler(e){e.defaultPrevented||(e.preventDefault(),this.isToggled()===s.includes(p,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(e){if(s.includes(p,this))return!1;!this.stack&&p.length?(Promise.all(p.map(t=>t.hide())).then(this.show),e.preventDefault()):p.push(this)}},{name:"show",self:!0,handler(){s.once(this.$el,"hide",s.on(document,"focusin",e=>{s.last(p)===this&&!s.within(e.target,this.$el)&&this.$el.focus()})),this.overlay&&(s.once(this.$el,"hidden",Q(this.$el),{self:!0}),s.once(this.$el,"hidden",Z(),{self:!0})),this.stack&&s.css(this.$el,"zIndex",s.toFloat(s.css(this.$el,"zIndex"))+p.length),s.addClass(document.documentElement,this.clsPage),this.bgClose&&s.once(this.$el,"hide",s.on(document,s.pointerDown,({target:e})=>{s.last(p)!==this||this.overlay&&!s.within(e,this.$el)||s.within(e,this.panel)||s.once(document,`${s.pointerUp} ${s.pointerCancel} scroll`,({defaultPrevented:t,type:n,target:r})=>{!t&&n===s.pointerUp&&e===r&&this.hide()},!0)}),{self:!0}),this.escClose&&s.once(this.$el,"hide",s.on(document,"keydown",e=>{e.keyCode===27&&s.last(p)===this&&this.hide()}),{self:!0})}},{name:"shown",self:!0,handler(){s.isFocusable(this.$el)||s.attr(this.$el,"tabindex","-1"),s.$(":focus",this.$el)||this.$el.focus()}},{name:"hidden",self:!0,handler(){s.includes(p,this)&&p.splice(p.indexOf(this),1),s.css(this.$el,"zIndex",""),p.some(e=>e.clsPage===this.clsPage)||s.removeClass(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&s.parent(this.$el)!==this.container?(s.append(this.container,this.$el),new Promise(e=>requestAnimationFrame(()=>this.show().then(e)))):this.toggleElement(this.$el,!0,O)},hide(){return this.toggleElement(this.$el,!1,O)}}};function O(e,t,{transitionElement:n,_toggle:r}){return new Promise((h,a)=>s.once(e,"show hide",()=>{e._reject==null||e._reject(),e._reject=a,r(e,t);const o=s.once(n,"transitionstart",()=>{s.once(n,"transitionend transitioncancel",h,{self:!0}),clearTimeout(i)},{self:!0}),i=setTimeout(()=>{o(),h()},K(s.css(n,"transitionDuration")))})).then(()=>delete e._reject)}function K(e){return e?s.endsWith(e,"ms")?s.toFloat(e):s.toFloat(e)*1e3:0}function Q(e){if(CSS.supports("overscroll-behavior","contain")){const r=[e,...k(e,h=>/auto|scroll/.test(s.css(h,"overflow")))];return s.css(r,"overscrollBehavior","contain"),()=>s.css(r,"overscrollBehavior","")}let t;const n=[s.on(e,"touchstart",({targetTouches:r})=>{r.length===1&&(t=r[0].clientY)},{passive:!0}),s.on(e,"touchmove",r=>{if(r.targetTouches.length!==1)return;let[h]=s.scrollParents(r.target,/auto|scroll/);s.within(h,e)||(h=e);const a=r.targetTouches[0].clientY-t,{scrollTop:o,scrollHeight:i,clientHeight:d}=h;(d>=i||o===0&&a>0||i-o<=d&&a<0)&&r.cancelable&&r.preventDefault()},{passive:!1})];return()=>n.forEach(r=>r())}let P;function Z(){if(P)return s.noop;P=!0;const{scrollingElement:e}=document;return s.css(e,{overflowY:"hidden",touchAction:"none",paddingRight:s.width(window)-e.clientWidth}),()=>{P=!1,s.css(e,{overflowY:"",touchAction:"",paddingRight:""})}}function k(e,t){const n=[];return s.apply(e,r=>{t(r)&&n.push(r)}),n}function U(e){return["origin","pathname","search"].every(t=>e[t]===location[t])}function ee(e,t,n,{animation:r,easing:h}){const{percent:a,translate:o,show:i=s.noop}=r,d=i(n),l=new s.Deferred;return{dir:n,show(c,m=0,g){const b=g?"linear":h;return c-=Math.round(c*s.clamp(m,-1,1)),this.translate(m),C(t,"itemin",{percent:m,duration:c,timing:b,dir:n}),C(e,"itemout",{percent:1-m,duration:c,timing:b,dir:n}),Promise.all([s.Transition.start(t,d[1],c,b),s.Transition.start(e,d[0],c,b)]).then(()=>{this.reset(),l.resolve()},s.noop),l.promise},cancel(){s.Transition.cancel([t,e])},reset(){for(const c in d[0])s.css([t,e],c,"")},forward(c,m=this.percent()){return s.Transition.cancel([t,e]),this.show(c,m,!0)},translate(c){this.reset();const m=o(c,n);s.css(t,m[1]),s.css(e,m[0]),C(t,"itemtranslatein",{percent:c,dir:n}),C(e,"itemtranslateout",{percent:1-c,dir:n})},percent(){return a(e||t,t,n)},getDistance(){return e==null?void 0:e.offsetWidth}}}function C(e,t,n){s.trigger(e,s.createEvent(t,!1,!1,n))}var se={connected(){var e;this.registerObserver(s.observeResize(((e=this.$options.resizeTargets)==null?void 0:e.call(this))||this.$el,()=>this.$emit("resize")))}},te={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){s.attr(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el(){return document},filter(){return this.autoplay},handler(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay(){this.stopAutoplay(),this.interval=setInterval(()=>(!this.draggable||!s.$(":focus",this.$el))&&(!this.pauseOnHover||!s.matches(this.$el,":hover"))&&!this.stack.length&&this.show("next"),this.autoplayInterval)},stopAutoplay(){this.interval&&clearInterval(this.interval)}}};const S={passive:!1,capture:!0},j={passive:!0,capture:!0},ne="touchstart mousedown",E="touchmove mousemove",M="touchend touchcancel mouseup click input scroll";var re={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const e of["start","move","end"]){const t=this[e];this[e]=n=>{const r=s.getEventPos(n).x*(s.isRtl?-1:1);this.prevPos=r===this.pos?this.prevPos:this.pos,this.pos=r,t(n)}}},events:[{name:ne,passive:!0,delegate(){return`${this.selList} > *`},handler(e){!this.draggable||!s.isTouch(e)&&oe(e.target)||s.closest(e.target,s.selInput)||e.button>0||this.length<2||this.start(e)}},{name:"dragstart",handler(e){e.preventDefault()}},{name:E,el(){return this.list},handler:s.noop,...S}],methods:{start(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,s.on(document,E,this.move,S),s.on(document,M,this.end,j),s.css(this.list,"userSelect","none")},move(e){const t=this.pos-this.drag;if(t===0||this.prevPos===this.pos||!this.dragging&&Math.abs(t)<this.threshold)return;s.css(this.list,"pointerEvents","none"),e.cancelable&&e.preventDefault(),this.dragging=!0,this.dir=t<0?1:-1;const{slides:n}=this;let{prevIndex:r}=this,h=Math.abs(t),a=this.getIndex(r+this.dir,r),o=this._getDistance(r,a)||n[r].offsetWidth;for(;a!==r&&h>o;)this.drag-=o*this.dir,r=a,h-=o,a=this.getIndex(r+this.dir,r),o=this._getDistance(r,a)||n[r].offsetWidth;this.percent=h/o;const i=n[r],d=n[a],l=this.index!==a,c=r===a;let m;[this.index,this.prevIndex].filter(g=>!s.includes([a,r],g)).forEach(g=>{s.trigger(n[g],"itemhidden",[this]),c&&(m=!0,this.prevIndex=r)}),(this.index===r&&this.prevIndex!==r||m)&&s.trigger(n[this.index],"itemshown",[this]),l&&(this.prevIndex=r,this.index=a,!c&&s.trigger(i,"beforeitemhide",[this]),s.trigger(d,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),i,!c&&d),l&&(!c&&s.trigger(i,"itemhide",[this]),s.trigger(d,"itemshow",[this]))},end(){if(s.off(document,E,this.move,S),s.off(document,M,this.end,j),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{const e=(s.isRtl?this.dir*(s.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=e?this.index:this.prevIndex,e&&(this.percent=1-this.percent),this.show(this.dir>0&&!e||this.dir<0&&e?"next":"previous",!0)}s.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function oe(e){return s.css(e,"userSelect")!=="none"&&s.toNodes(e.childNodes).some(t=>t.nodeType===3&&t.textContent.trim())}var ae={data:{selNav:!1},computed:{nav({selNav:e},t){return s.$(e,t)},selNavItem({attrItem:e}){return`[${e}],[data-${e}]`},navItems(e,t){return s.$$(this.selNavItem,t)}},update:{write(){this.nav&&this.length!==this.nav.children.length&&s.html(this.nav,this.slides.map((e,t)=>`<li ${this.attrItem}="${t}"><a href></a></li>`).join("")),this.navItems.concat(this.nav).forEach(e=>e&&(e.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]},events:[{name:"click",delegate(){return this.selNavItem},handler(e){e.preventDefault(),this.show(s.data(e.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav(){const e=this.getValidIndex();for(const t of this.navItems){const n=s.data(t,this.attrItem);s.toggleClass(t,this.clsActive,s.toNumber(n)===e),s.toggleClass(t,"uk-invisible",this.finite&&(n==="previous"&&e===0||n==="next"&&e>=this.maxIndex))}}}},he={mixins:[te,re,ae,se],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){s.removeClass(this.slides,this.clsActive)},computed:{duration({velocity:e},t){return ce(t.offsetWidth/e)},list({selList:e},t){return s.$(e,t)},maxIndex(){return this.length-1},slides:{get(){return s.children(this.list)},watch(){this.$emit("resize")}},length(){return this.slides.length}},methods:{show(e,t=!1){if(this.dragging||!this.length)return;const{stack:n}=this,r=t?0:n.length,h=()=>{n.splice(r,1),n.length&&this.show(n.shift(),!0)};if(n[t?"unshift":"push"](e),!t&&n.length>1){n.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}const a=this.getIndex(this.index),o=s.hasClass(this.slides,this.clsActive)&&this.slides[a],i=this.getIndex(e,this.index),d=this.slides[i];if(o===d){h();return}if(this.dir=ie(e,a),this.prevIndex=a,this.index=i,o&&!s.trigger(o,"beforeitemhide",[this])||!s.trigger(d,"beforeitemshow",[this,o])){this.index=this.prevIndex,h();return}const l=this._show(o,d,t).then(()=>(o&&s.trigger(o,"itemhidden",[this]),s.trigger(d,"itemshown",[this]),new Promise(c=>{requestAnimationFrame(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,c()})})));return o&&s.trigger(o,"itemhide",[this]),s.trigger(d,"itemshow",[this]),l},getIndex(e=this.index,t=this.index){return s.clamp(s.getIndex(e,this.slides,t,this.finite),0,this.maxIndex)},getValidIndex(e=this.index,t=this.prevIndex){return this.getIndex(e,t)},_show(e,t,n){if(this._transitioner=this._getTransitioner(e,t,this.dir,{easing:n?t.offsetWidth<600?"cubic-bezier(0.25, 0.46, 0.45, 0.94)":"cubic-bezier(0.165, 0.84, 0.44, 1)":this.easing,...this.transitionOptions}),!n&&!e)return this._translate(1),Promise.resolve();const{length:r}=this.stack;return this._transitioner[r>1?"forward":"show"](r>1?Math.min(this.duration,75+75/(r-1)):this.duration,this.percent)},_getDistance(e,t){return this._getTransitioner(e,e!==t&&t).getDistance()},_translate(e,t=this.prevIndex,n=this.index){const r=this._getTransitioner(t!==n?t:!1,n);return r.translate(e),r},_getTransitioner(e=this.prevIndex,t=this.index,n=this.dir||1,r=this.transitionOptions){return new this.Transitioner(s.isNumber(e)?this.slides[e]:e,s.isNumber(t)?this.slides[t]:t,n*(s.isRtl?-1:1),r)}}};function ie(e,t){return e==="next"?1:e==="previous"||e<t?-1:1}function ce(e){return .5*e+300}var de={mixins:[he],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:u,Transitioner:ee},computed:{animation({animation:e,Animations:t}){return{...t[e]||t.slide,name:e}},transitionOptions(){return{animation:this.animation}}},events:{beforeitemshow({target:e}){s.addClass(e,this.clsActive)},itemshown({target:e}){s.addClass(e,this.clsActivated)},itemhidden({target:e}){s.removeClass(e,this.clsActive,this.clsActivated)}}},W={mixins:[B,J,z,de],functional:!0,props:{delayControls:Number,preload:Number,videoAutoplay:Boolean,template:String},data:()=>({preload:1,videoAutoplay:!1,delayControls:3e3,items:[],cls:"uk-open",clsPage:"uk-lightbox-page",selList:".uk-lightbox-items",attrItem:"uk-lightbox-item",selClose:".uk-close-large",selCaption:".uk-lightbox-caption",pauseOnHover:!1,velocity:2,Animations:N,template:`<div class="uk-lightbox uk-overflow-hidden">
|
|
2
|
+
<ul class="uk-lightbox-items"></ul>
|
|
3
|
+
<div class="uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque">
|
|
4
|
+
<button class="uk-lightbox-toolbar-icon uk-close-large" type="button" uk-close></button>
|
|
5
|
+
</div>
|
|
6
|
+
<a class="uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade" href uk-slidenav-previous uk-lightbox-item="previous"></a>
|
|
7
|
+
<a class="uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade" href uk-slidenav-next uk-lightbox-item="next"></a>
|
|
8
|
+
<div class="uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div>
|
|
9
|
+
</div>`}),created(){const e=s.$(this.template),t=s.$(this.selList,e);this.items.forEach(()=>s.append(t,"<li>")),this.$mount(s.append(this.container,e))},computed:{caption({selCaption:e},t){return s.$(e,t)}},events:[{name:`${s.pointerMove} ${s.pointerDown} keydown`,handler:"showControls"},{name:"click",self:!0,delegate(){return`${this.selList} > *`},handler(e){e.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler(){this.showControls()}},{name:"hide",self:!0,handler(){this.hideControls(),s.removeClass(this.slides,this.clsActive),s.Transition.stop(this.slides)}},{name:"hidden",self:!0,handler(){this.$destroy(!0)}},{name:"keyup",el(){return document},handler(e){if(!(!this.isToggled(this.$el)||!this.draggable))switch(e.keyCode){case 37:this.show("previous");break;case 39:this.show("next");break}}},{name:"beforeitemshow",handler(e){this.isToggled()||(this.draggable=!1,e.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=N.scale,s.removeClass(e.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){s.html(this.caption,this.getItem().caption||"");for(let e=-this.preload;e<=this.preload;e++)this.loadItem(this.index+e)}},{name:"itemshown",handler(){this.draggable=this.$props.draggable}},{name:"itemload",async handler(e,t){const{source:n,type:r,alt:h="",poster:a,attrs:o={}}=t;if(this.setItem(t,"<span uk-spinner></span>"),!n)return;let i;const d={allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":`${this.videoAutoplay}`};if(r==="image"||n.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i))try{const{width:l,height:c}=await s.getImage(n,o.srcset,o.size);this.setItem(t,w("img",{src:n,width:l,height:c,alt:h,...o}))}catch{this.setError(t)}else if(r==="video"||n.match(/\.(mp4|webm|ogv)($|\?)/i)){const l=w("video",{src:n,poster:a,controls:"",playsinline:"","uk-video":`${this.videoAutoplay}`});s.on(l,"loadedmetadata",()=>{s.attr(l,{width:l.videoWidth,height:l.videoHeight,...o}),this.setItem(t,l)}),s.on(l,"error",()=>this.setError(t))}else if(r==="iframe"||n.match(/\.(html|php)($|\?)/i))this.setItem(t,w("iframe",{src:n,allowfullscreen:"",class:"uk-lightbox-iframe",...o}));else if(i=n.match(/\/\/(?:.*?youtube(-nocookie)?\..*?[?&]v=|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(t,w("iframe",{src:`https://www.youtube${i[1]||""}.com/embed/${i[2]}${i[3]?`?${i[3]}`:""}`,width:1920,height:1080,...d,...o}));else if(i=n.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{const{height:l,width:c}=await(await fetch(`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(n)}`,{credentials:"omit"})).json();this.setItem(t,w("iframe",{src:`https://player.vimeo.com/video/${i[1]}${i[2]?`?${i[2]}`:""}`,width:c,height:l,...d,...o}))}catch{this.setError(t)}}}],methods:{loadItem(e=this.index){const t=this.getItem(e);this.getSlide(t).childElementCount||s.trigger(this.$el,"itemload",[t])},getItem(e=this.index){return this.items[s.getIndex(e,this.slides)]},setItem(e,t){s.trigger(this.$el,"itemloaded",[this,s.html(this.getSlide(e),t)])},getSlide(e){return this.slides[this.items.indexOf(e)]},setError(e){this.setItem(e,'<span uk-icon="icon: bolt; ratio: 2"></span>')},showControls(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),s.addClass(this.$el,"uk-active","uk-transition-active")},hideControls(){s.removeClass(this.$el,"uk-active","uk-transition-active")}}};function w(e,t){const n=s.fragment(`<${e}>`);return s.attr(n,t),n}return typeof window<"u"&&window.UIkit&&window.UIkit.component("lightboxPanel",W),W});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.15.
|
|
1
|
+
/*! UIkit 3.15.18-dev.014d8e608 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
return Math.abs(uikitUtil.css(el, 'transform').split(',')[4] / el.offsetWidth) || 0;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function translate(value
|
|
32
|
+
function translate(value = 0, unit = '%') {
|
|
33
33
|
value += value ? unit : '';
|
|
34
|
-
return
|
|
34
|
+
return `translate3d(${value}, 0, 0)`;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
function scale3d(value) {
|
|
38
|
-
return
|
|
38
|
+
return `scale3d(${value}, ${value}, 1)`;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
var Animations = {
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
|
|
87
87
|
computed: {
|
|
88
|
-
container(
|
|
88
|
+
container({ container }) {
|
|
89
89
|
return container === true && this.$container || container && uikitUtil.$(container);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -119,11 +119,11 @@
|
|
|
119
119
|
},
|
|
120
120
|
|
|
121
121
|
computed: {
|
|
122
|
-
hasAnimation(
|
|
122
|
+
hasAnimation({ animation }) {
|
|
123
123
|
return !!animation[0];
|
|
124
124
|
},
|
|
125
125
|
|
|
126
|
-
hasTransition(
|
|
126
|
+
hasTransition({ animation }) {
|
|
127
127
|
return ['slide', 'reveal'].some((transition) => uikitUtil.startsWith(animation[0], transition));
|
|
128
128
|
}
|
|
129
129
|
},
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
uikitUtil.toNodes(targets).map((el) => {
|
|
136
136
|
const show = uikitUtil.isBoolean(toggle) ? toggle : !this.isToggled(el);
|
|
137
137
|
|
|
138
|
-
if (!uikitUtil.trigger(el,
|
|
138
|
+
if (!uikitUtil.trigger(el, `before${show ? 'show' : 'hide'}`, [this])) {
|
|
139
139
|
return Promise.reject();
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
|
|
172
172
|
},
|
|
173
173
|
|
|
174
|
-
isToggled(el
|
|
174
|
+
isToggled(el = this.$el) {
|
|
175
175
|
[el] = uikitUtil.toNodes(el);
|
|
176
176
|
return uikitUtil.hasClass(el, this.clsEnter) ?
|
|
177
177
|
true :
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
209
|
|
|
210
|
-
function toggleInstant(el, show,
|
|
210
|
+
function toggleInstant(el, show, { _toggle }) {
|
|
211
211
|
uikitUtil.Animation.cancel(el);
|
|
212
212
|
uikitUtil.Transition.cancel(el);
|
|
213
213
|
return _toggle(el, show);
|
|
@@ -215,9 +215,9 @@
|
|
|
215
215
|
|
|
216
216
|
async function toggleTransition(
|
|
217
217
|
el,
|
|
218
|
-
show,
|
|
219
|
-
|
|
220
|
-
{var _animation$;
|
|
218
|
+
show,
|
|
219
|
+
{ animation, duration, velocity, transition, _toggle })
|
|
220
|
+
{var _animation$;
|
|
221
221
|
const [mode = 'reveal', startProp = 'top'] = ((_animation$ = animation[0]) == null ? void 0 : _animation$.split('-')) || [];
|
|
222
222
|
|
|
223
223
|
const dirs = [
|
|
@@ -228,8 +228,8 @@
|
|
|
228
228
|
const end = dir[1] === startProp;
|
|
229
229
|
const props = ['width', 'height'];
|
|
230
230
|
const dimProp = props[dirs.indexOf(dir)];
|
|
231
|
-
const marginProp =
|
|
232
|
-
const marginStartProp =
|
|
231
|
+
const marginProp = `margin-${dir[0]}`;
|
|
232
|
+
const marginStartProp = `margin-${startProp}`;
|
|
233
233
|
|
|
234
234
|
let currentDim = uikitUtil.dimensions(el)[dimProp];
|
|
235
235
|
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
},
|
|
357
357
|
|
|
358
358
|
computed: {
|
|
359
|
-
panel(
|
|
359
|
+
panel({ selPanel }, $el) {
|
|
360
360
|
return uikitUtil.$(selPanel, $el);
|
|
361
361
|
},
|
|
362
362
|
|
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
return this.panel;
|
|
365
365
|
},
|
|
366
366
|
|
|
367
|
-
bgClose(
|
|
367
|
+
bgClose({ bgClose }) {
|
|
368
368
|
return bgClose && this.panel;
|
|
369
369
|
}
|
|
370
370
|
},
|
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
name: 'click',
|
|
381
381
|
|
|
382
382
|
delegate() {
|
|
383
|
-
return this.selClose
|
|
383
|
+
return `${this.selClose},a[href*="#"]`;
|
|
384
384
|
},
|
|
385
385
|
|
|
386
386
|
handler(e) {
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
uikitUtil.once(
|
|
470
470
|
this.$el,
|
|
471
471
|
'hide',
|
|
472
|
-
uikitUtil.on(document, uikitUtil.pointerDown, (
|
|
472
|
+
uikitUtil.on(document, uikitUtil.pointerDown, ({ target }) => {
|
|
473
473
|
if (
|
|
474
474
|
uikitUtil.last(active) !== this ||
|
|
475
475
|
this.overlay && !uikitUtil.within(target, this.$el) ||
|
|
@@ -480,8 +480,8 @@
|
|
|
480
480
|
|
|
481
481
|
uikitUtil.once(
|
|
482
482
|
document,
|
|
483
|
-
uikitUtil.pointerUp
|
|
484
|
-
(
|
|
483
|
+
`${uikitUtil.pointerUp} ${uikitUtil.pointerCancel} scroll`,
|
|
484
|
+
({ defaultPrevented, type, target: newTarget }) => {
|
|
485
485
|
if (
|
|
486
486
|
!defaultPrevented &&
|
|
487
487
|
type === uikitUtil.pointerUp &&
|
|
@@ -569,7 +569,7 @@
|
|
|
569
569
|
}
|
|
570
570
|
};
|
|
571
571
|
|
|
572
|
-
function animate(el, show,
|
|
572
|
+
function animate(el, show, { transitionElement, _toggle }) {
|
|
573
573
|
return new Promise((resolve, reject) =>
|
|
574
574
|
uikitUtil.once(el, 'show hide', () => {
|
|
575
575
|
el._reject == null ? void 0 : el._reject();
|
|
@@ -617,7 +617,7 @@
|
|
|
617
617
|
uikitUtil.on(
|
|
618
618
|
el,
|
|
619
619
|
'touchstart',
|
|
620
|
-
(
|
|
620
|
+
({ targetTouches }) => {
|
|
621
621
|
if (targetTouches.length === 1) {
|
|
622
622
|
startClientY = targetTouches[0].clientY;
|
|
623
623
|
}
|
|
@@ -689,7 +689,7 @@
|
|
|
689
689
|
return ['origin', 'pathname', 'search'].every((part) => a[part] === location[part]);
|
|
690
690
|
}
|
|
691
691
|
|
|
692
|
-
function Transitioner(prev, next, dir,
|
|
692
|
+
function Transitioner(prev, next, dir, { animation, easing }) {
|
|
693
693
|
const { percent, translate, show = uikitUtil.noop } = animation;
|
|
694
694
|
const props = show(dir);
|
|
695
695
|
const deferred = new uikitUtil.Deferred();
|
|
@@ -697,7 +697,7 @@
|
|
|
697
697
|
return {
|
|
698
698
|
dir,
|
|
699
699
|
|
|
700
|
-
show(duration, percent, linear) {
|
|
700
|
+
show(duration, percent = 0, linear) {
|
|
701
701
|
const timing = linear ? 'linear' : easing;
|
|
702
702
|
duration -= Math.round(duration * uikitUtil.clamp(percent, -1, 1));
|
|
703
703
|
|
|
@@ -727,7 +727,7 @@
|
|
|
727
727
|
}
|
|
728
728
|
},
|
|
729
729
|
|
|
730
|
-
forward(duration, percent
|
|
730
|
+
forward(duration, percent = this.percent()) {
|
|
731
731
|
uikitUtil.Transition.cancel([next, prev]);
|
|
732
732
|
return this.show(duration, percent, true);
|
|
733
733
|
},
|
|
@@ -870,7 +870,7 @@
|
|
|
870
870
|
passive: true,
|
|
871
871
|
|
|
872
872
|
delegate() {
|
|
873
|
-
return this.
|
|
873
|
+
return `${this.selList} > *`;
|
|
874
874
|
},
|
|
875
875
|
|
|
876
876
|
handler(e) {
|
|
@@ -1058,12 +1058,12 @@
|
|
|
1058
1058
|
},
|
|
1059
1059
|
|
|
1060
1060
|
computed: {
|
|
1061
|
-
nav(
|
|
1061
|
+
nav({ selNav }, $el) {
|
|
1062
1062
|
return uikitUtil.$(selNav, $el);
|
|
1063
1063
|
},
|
|
1064
1064
|
|
|
1065
|
-
selNavItem(
|
|
1066
|
-
return
|
|
1065
|
+
selNavItem({ attrItem }) {
|
|
1066
|
+
return `[${attrItem}],[data-${attrItem}]`;
|
|
1067
1067
|
},
|
|
1068
1068
|
|
|
1069
1069
|
navItems(_, $el) {
|
|
@@ -1077,7 +1077,7 @@
|
|
|
1077
1077
|
uikitUtil.html(
|
|
1078
1078
|
this.nav,
|
|
1079
1079
|
this.slides.
|
|
1080
|
-
map((_, i) =>
|
|
1080
|
+
map((_, i) => `<li ${this.attrItem}="${i}"><a href></a></li>`).
|
|
1081
1081
|
join(''));
|
|
1082
1082
|
|
|
1083
1083
|
}
|
|
@@ -1136,8 +1136,7 @@
|
|
|
1136
1136
|
easing: String,
|
|
1137
1137
|
index: Number,
|
|
1138
1138
|
finite: Boolean,
|
|
1139
|
-
velocity: Number
|
|
1140
|
-
selSlides: String
|
|
1139
|
+
velocity: Number
|
|
1141
1140
|
},
|
|
1142
1141
|
|
|
1143
1142
|
data: () => ({
|
|
@@ -1165,11 +1164,11 @@
|
|
|
1165
1164
|
},
|
|
1166
1165
|
|
|
1167
1166
|
computed: {
|
|
1168
|
-
duration(
|
|
1167
|
+
duration({ velocity }, $el) {
|
|
1169
1168
|
return speedUp($el.offsetWidth / velocity);
|
|
1170
1169
|
},
|
|
1171
1170
|
|
|
1172
|
-
list(
|
|
1171
|
+
list({ selList }, $el) {
|
|
1173
1172
|
return uikitUtil.$(selList, $el);
|
|
1174
1173
|
},
|
|
1175
1174
|
|
|
@@ -1177,13 +1176,9 @@
|
|
|
1177
1176
|
return this.length - 1;
|
|
1178
1177
|
},
|
|
1179
1178
|
|
|
1180
|
-
selSlides(_ref3) {let { selList, selSlides } = _ref3;
|
|
1181
|
-
return selList + " " + (selSlides || '> *');
|
|
1182
|
-
},
|
|
1183
|
-
|
|
1184
1179
|
slides: {
|
|
1185
1180
|
get() {
|
|
1186
|
-
return uikitUtil
|
|
1181
|
+
return uikitUtil.children(this.list);
|
|
1187
1182
|
},
|
|
1188
1183
|
|
|
1189
1184
|
watch() {
|
|
@@ -1197,7 +1192,7 @@
|
|
|
1197
1192
|
},
|
|
1198
1193
|
|
|
1199
1194
|
methods: {
|
|
1200
|
-
show(index, force
|
|
1195
|
+
show(index, force = false) {
|
|
1201
1196
|
if (this.dragging || !this.length) {
|
|
1202
1197
|
return;
|
|
1203
1198
|
}
|
|
@@ -1268,11 +1263,11 @@
|
|
|
1268
1263
|
return promise;
|
|
1269
1264
|
},
|
|
1270
1265
|
|
|
1271
|
-
getIndex(index
|
|
1266
|
+
getIndex(index = this.index, prev = this.index) {
|
|
1272
1267
|
return uikitUtil.clamp(uikitUtil.getIndex(index, this.slides, prev, this.finite), 0, this.maxIndex);
|
|
1273
1268
|
},
|
|
1274
1269
|
|
|
1275
|
-
getValidIndex(index
|
|
1270
|
+
getValidIndex(index = this.index, prevIndex = this.prevIndex) {
|
|
1276
1271
|
return this.getIndex(index, prevIndex);
|
|
1277
1272
|
},
|
|
1278
1273
|
|
|
@@ -1302,18 +1297,18 @@
|
|
|
1302
1297
|
return this._getTransitioner(prev, prev !== next && next).getDistance();
|
|
1303
1298
|
},
|
|
1304
1299
|
|
|
1305
|
-
_translate(percent, prev
|
|
1300
|
+
_translate(percent, prev = this.prevIndex, next = this.index) {
|
|
1306
1301
|
const transitioner = this._getTransitioner(prev !== next ? prev : false, next);
|
|
1307
1302
|
transitioner.translate(percent);
|
|
1308
1303
|
return transitioner;
|
|
1309
1304
|
},
|
|
1310
1305
|
|
|
1311
1306
|
_getTransitioner(
|
|
1312
|
-
prev,
|
|
1313
|
-
next,
|
|
1314
|
-
dir,
|
|
1315
|
-
options)
|
|
1316
|
-
{
|
|
1307
|
+
prev = this.prevIndex,
|
|
1308
|
+
next = this.index,
|
|
1309
|
+
dir = this.dir || 1,
|
|
1310
|
+
options = this.transitionOptions)
|
|
1311
|
+
{
|
|
1317
1312
|
return new this.Transitioner(
|
|
1318
1313
|
uikitUtil.isNumber(prev) ? this.slides[prev] : prev,
|
|
1319
1314
|
uikitUtil.isNumber(next) ? this.slides[next] : next,
|
|
@@ -1347,7 +1342,7 @@
|
|
|
1347
1342
|
},
|
|
1348
1343
|
|
|
1349
1344
|
computed: {
|
|
1350
|
-
animation(
|
|
1345
|
+
animation({ animation, Animations }) {
|
|
1351
1346
|
return { ...(Animations[animation] || Animations.slide), name: animation };
|
|
1352
1347
|
},
|
|
1353
1348
|
|
|
@@ -1357,15 +1352,15 @@
|
|
|
1357
1352
|
},
|
|
1358
1353
|
|
|
1359
1354
|
events: {
|
|
1360
|
-
beforeitemshow(
|
|
1355
|
+
beforeitemshow({ target }) {
|
|
1361
1356
|
uikitUtil.addClass(target, this.clsActive);
|
|
1362
1357
|
},
|
|
1363
1358
|
|
|
1364
|
-
itemshown(
|
|
1359
|
+
itemshown({ target }) {
|
|
1365
1360
|
uikitUtil.addClass(target, this.clsActivated);
|
|
1366
1361
|
},
|
|
1367
1362
|
|
|
1368
|
-
itemhidden(
|
|
1363
|
+
itemhidden({ target }) {
|
|
1369
1364
|
uikitUtil.removeClass(target, this.clsActive, this.clsActivated);
|
|
1370
1365
|
}
|
|
1371
1366
|
}
|
|
@@ -1397,15 +1392,15 @@
|
|
|
1397
1392
|
pauseOnHover: false,
|
|
1398
1393
|
velocity: 2,
|
|
1399
1394
|
Animations,
|
|
1400
|
-
template:
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1395
|
+
template: `<div class="uk-lightbox uk-overflow-hidden">
|
|
1396
|
+
<ul class="uk-lightbox-items"></ul>
|
|
1397
|
+
<div class="uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque">
|
|
1398
|
+
<button class="uk-lightbox-toolbar-icon uk-close-large" type="button" uk-close></button>
|
|
1399
|
+
</div>
|
|
1400
|
+
<a class="uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade" href uk-slidenav-previous uk-lightbox-item="previous"></a>
|
|
1401
|
+
<a class="uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade" href uk-slidenav-next uk-lightbox-item="next"></a>
|
|
1402
|
+
<div class="uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div>
|
|
1403
|
+
</div>`
|
|
1409
1404
|
}),
|
|
1410
1405
|
|
|
1411
1406
|
created() {
|
|
@@ -1417,14 +1412,14 @@
|
|
|
1417
1412
|
},
|
|
1418
1413
|
|
|
1419
1414
|
computed: {
|
|
1420
|
-
caption(
|
|
1415
|
+
caption({ selCaption }, $el) {
|
|
1421
1416
|
return uikitUtil.$(selCaption, $el);
|
|
1422
1417
|
}
|
|
1423
1418
|
},
|
|
1424
1419
|
|
|
1425
1420
|
events: [
|
|
1426
1421
|
{
|
|
1427
|
-
name: uikitUtil.pointerMove
|
|
1422
|
+
name: `${uikitUtil.pointerMove} ${uikitUtil.pointerDown} keydown`,
|
|
1428
1423
|
|
|
1429
1424
|
handler: 'showControls'
|
|
1430
1425
|
},
|
|
@@ -1435,15 +1430,13 @@
|
|
|
1435
1430
|
self: true,
|
|
1436
1431
|
|
|
1437
1432
|
delegate() {
|
|
1438
|
-
return this.
|
|
1433
|
+
return `${this.selList} > *`;
|
|
1439
1434
|
},
|
|
1440
1435
|
|
|
1441
1436
|
handler(e) {
|
|
1442
|
-
if (e.defaultPrevented) {
|
|
1443
|
-
|
|
1437
|
+
if (!e.defaultPrevented) {
|
|
1438
|
+
this.hide();
|
|
1444
1439
|
}
|
|
1445
|
-
|
|
1446
|
-
this.hide();
|
|
1447
1440
|
}
|
|
1448
1441
|
},
|
|
1449
1442
|
|
|
@@ -1560,7 +1553,7 @@
|
|
|
1560
1553
|
allowfullscreen: '',
|
|
1561
1554
|
style: 'max-width: 100%; box-sizing: border-box;',
|
|
1562
1555
|
'uk-responsive': '',
|
|
1563
|
-
'uk-video':
|
|
1556
|
+
'uk-video': `${this.videoAutoplay}`
|
|
1564
1557
|
};
|
|
1565
1558
|
|
|
1566
1559
|
// Image
|
|
@@ -1582,7 +1575,7 @@
|
|
|
1582
1575
|
poster,
|
|
1583
1576
|
controls: '',
|
|
1584
1577
|
playsinline: '',
|
|
1585
|
-
'uk-video':
|
|
1578
|
+
'uk-video': `${this.videoAutoplay}`
|
|
1586
1579
|
});
|
|
1587
1580
|
|
|
1588
1581
|
uikitUtil.on(video, 'loadedmetadata', () => {
|
|
@@ -1616,9 +1609,9 @@
|
|
|
1616
1609
|
this.setItem(
|
|
1617
1610
|
item,
|
|
1618
1611
|
createEl('iframe', {
|
|
1619
|
-
src:
|
|
1620
|
-
|
|
1621
|
-
|
|
1612
|
+
src: `https://www.youtube${matches[1] || ''}.com/embed/${matches[2]}${
|
|
1613
|
+
matches[3] ? `?${matches[3]}` : ''
|
|
1614
|
+
}`,
|
|
1622
1615
|
width: 1920,
|
|
1623
1616
|
height: 1080,
|
|
1624
1617
|
...iframeAttrs,
|
|
@@ -1630,10 +1623,10 @@
|
|
|
1630
1623
|
} else if (matches = src.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/)) {
|
|
1631
1624
|
try {
|
|
1632
1625
|
const { height, width } = await (
|
|
1633
|
-
await fetch(
|
|
1634
|
-
encodeURI(
|
|
1635
|
-
|
|
1636
|
-
|
|
1626
|
+
await fetch(
|
|
1627
|
+
`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(
|
|
1628
|
+
src)
|
|
1629
|
+
}`,
|
|
1637
1630
|
{
|
|
1638
1631
|
credentials: 'omit'
|
|
1639
1632
|
})).
|
|
@@ -1643,9 +1636,9 @@
|
|
|
1643
1636
|
this.setItem(
|
|
1644
1637
|
item,
|
|
1645
1638
|
createEl('iframe', {
|
|
1646
|
-
src:
|
|
1647
|
-
|
|
1648
|
-
|
|
1639
|
+
src: `https://player.vimeo.com/video/${matches[1]}${
|
|
1640
|
+
matches[2] ? `?${matches[2]}` : ''
|
|
1641
|
+
}`,
|
|
1649
1642
|
width,
|
|
1650
1643
|
height,
|
|
1651
1644
|
...iframeAttrs,
|
|
@@ -1661,7 +1654,7 @@
|
|
|
1661
1654
|
|
|
1662
1655
|
|
|
1663
1656
|
methods: {
|
|
1664
|
-
loadItem(index
|
|
1657
|
+
loadItem(index = this.index) {
|
|
1665
1658
|
const item = this.getItem(index);
|
|
1666
1659
|
|
|
1667
1660
|
if (!this.getSlide(item).childElementCount) {
|
|
@@ -1669,7 +1662,7 @@
|
|
|
1669
1662
|
}
|
|
1670
1663
|
},
|
|
1671
1664
|
|
|
1672
|
-
getItem(index
|
|
1665
|
+
getItem(index = this.index) {
|
|
1673
1666
|
return this.items[uikitUtil.getIndex(index, this.slides)];
|
|
1674
1667
|
},
|
|
1675
1668
|
|
|
@@ -1699,7 +1692,7 @@
|
|
|
1699
1692
|
};
|
|
1700
1693
|
|
|
1701
1694
|
function createEl(tag, attrs) {
|
|
1702
|
-
const el = uikitUtil.fragment(
|
|
1695
|
+
const el = uikitUtil.fragment(`<${tag}>`);
|
|
1703
1696
|
uikitUtil.attr(el, attrs);
|
|
1704
1697
|
return el;
|
|
1705
1698
|
}
|
|
@@ -1713,7 +1706,7 @@
|
|
|
1713
1706
|
|
|
1714
1707
|
computed: {
|
|
1715
1708
|
toggles: {
|
|
1716
|
-
get(
|
|
1709
|
+
get({ toggle }, $el) {
|
|
1717
1710
|
return uikitUtil.$$(toggle, $el);
|
|
1718
1711
|
},
|
|
1719
1712
|
|
|
@@ -1732,7 +1725,7 @@
|
|
|
1732
1725
|
name: 'click',
|
|
1733
1726
|
|
|
1734
1727
|
delegate() {
|
|
1735
|
-
return this.toggle
|
|
1728
|
+
return `${this.toggle}:not(.uk-disabled)`;
|
|
1736
1729
|
},
|
|
1737
1730
|
|
|
1738
1731
|
handler(e) {
|
|
@@ -1748,7 +1741,7 @@
|
|
|
1748
1741
|
|
|
1749
1742
|
if (uikitUtil.isElement(index)) {
|
|
1750
1743
|
const { source } = toItem(index);
|
|
1751
|
-
index = uikitUtil.findIndex(items, (
|
|
1744
|
+
index = uikitUtil.findIndex(items, ({ source: src }) => source === src);
|
|
1752
1745
|
}
|
|
1753
1746
|
|
|
1754
1747
|
this.panel = this.panel || this.$create('lightboxPanel', { ...this.$props, items });
|