uikit 3.11.2-dev.c2430c233 → 3.11.2-dev.c7ed3c19b
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/.eslintrc.json +4 -49
- package/.prettierignore +14 -0
- package/.prettierrc.json +13 -0
- package/.webstorm.js +3 -3
- package/CHANGELOG.md +5 -0
- package/build/.eslintrc.json +1 -3
- package/build/build.js +26 -28
- package/build/icons.js +7 -11
- package/build/less.js +48 -36
- package/build/package.json +2 -2
- package/build/prefix.js +21 -18
- package/build/publishDev.js +6 -8
- package/build/release.js +20 -17
- package/build/scope.js +21 -11
- package/build/scss.js +72 -39
- package/build/util.js +71 -62
- package/build/wrapper/icons.js +0 -2
- 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 +88 -133
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +409 -438
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +1116 -1305
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1164 -1383
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +94 -114
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +294 -345
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +292 -344
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +727 -850
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +292 -344
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +615 -799
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +588 -619
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +324 -356
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +155 -167
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +5356 -6705
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +7 -9
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +8116 -9909
- package/dist/js/uikit.min.js +1 -1
- package/jsconfig.json +1 -1
- package/package.json +64 -60
- package/src/js/api/boot.js +25 -32
- package/src/js/api/component.js +23 -27
- package/src/js/api/global.js +6 -12
- package/src/js/api/hooks.js +13 -32
- package/src/js/api/instance.js +7 -15
- package/src/js/api/state.js +65 -82
- package/src/js/components/countdown.js +24 -50
- package/src/js/components/filter.js +71 -66
- package/src/js/components/index.js +13 -13
- package/src/js/components/internal/lightbox-animations.js +11 -23
- package/src/js/components/internal/slider-transitioner.js +66 -45
- package/src/js/components/internal/slideshow-animations.js +42 -61
- package/src/js/components/lightbox-panel.js +135 -109
- package/src/js/components/lightbox.js +18 -39
- package/src/js/components/notification.js +49 -43
- package/src/js/components/parallax.js +16 -30
- package/src/js/components/slider-parallax.js +13 -23
- package/src/js/components/slider.js +75 -64
- package/src/js/components/slideshow-parallax.js +1 -1
- package/src/js/components/slideshow.js +8 -13
- package/src/js/components/sortable.js +125 -106
- package/src/js/components/tooltip.js +41 -31
- package/src/js/components/upload.js +52 -63
- package/src/js/core/accordion.js +53 -48
- package/src/js/core/alert.js +10 -17
- package/src/js/core/core.js +74 -53
- package/src/js/core/cover.js +11 -15
- package/src/js/core/drop.js +106 -92
- package/src/js/core/form-custom.js +20 -25
- package/src/js/core/gif.js +3 -7
- package/src/js/core/grid.js +57 -58
- package/src/js/core/height-match.js +16 -29
- package/src/js/core/height-viewport.js +28 -35
- package/src/js/core/icon.js +38 -50
- package/src/js/core/img.js +59 -58
- package/src/js/core/index.js +39 -39
- package/src/js/core/leader.js +9 -18
- package/src/js/core/margin.js +21 -37
- package/src/js/core/modal.js +50 -36
- package/src/js/core/nav.js +2 -4
- package/src/js/core/navbar.js +112 -88
- package/src/js/core/offcanvas.js +49 -53
- package/src/js/core/overflow-auto.js +13 -17
- package/src/js/core/responsive.js +14 -12
- package/src/js/core/scroll.js +10 -20
- package/src/js/core/scrollspy-nav.js +34 -31
- package/src/js/core/scrollspy.js +37 -54
- package/src/js/core/sticky.js +130 -91
- package/src/js/core/svg.js +60 -79
- package/src/js/core/switcher.js +47 -46
- package/src/js/core/tab.js +7 -10
- package/src/js/core/toggle.js +64 -66
- package/src/js/core/video.js +11 -22
- package/src/js/mixin/animate.js +19 -20
- package/src/js/mixin/class.js +2 -4
- package/src/js/mixin/container.js +7 -11
- package/src/js/mixin/internal/animate-fade.js +73 -30
- package/src/js/mixin/internal/animate-slide.js +61 -41
- package/src/js/mixin/internal/slideshow-animations.js +7 -14
- package/src/js/mixin/internal/slideshow-transitioner.js +10 -17
- package/src/js/mixin/media.js +5 -10
- package/src/js/mixin/modal.js +89 -66
- package/src/js/mixin/parallax.js +53 -48
- package/src/js/mixin/position.js +26 -20
- package/src/js/mixin/slider-autoplay.js +12 -21
- package/src/js/mixin/slider-drag.js +64 -65
- package/src/js/mixin/slider-nav.js +26 -35
- package/src/js/mixin/slider-reactive.js +2 -8
- package/src/js/mixin/slider.js +51 -50
- package/src/js/mixin/slideshow.js +13 -19
- package/src/js/mixin/togglable.js +90 -63
- package/src/js/uikit-core.js +2 -4
- package/src/js/uikit.js +2 -4
- package/src/js/util/ajax.js +27 -43
- package/src/js/util/animation.js +82 -75
- package/src/js/util/attr.js +17 -21
- package/src/js/util/class.js +14 -52
- package/src/js/util/dimensions.js +56 -43
- package/src/js/util/dom.js +40 -73
- package/src/js/util/env.js +7 -12
- package/src/js/util/event.js +60 -59
- package/src/js/util/fastdom.js +1 -6
- package/src/js/util/filter.js +17 -34
- package/src/js/util/index.js +0 -1
- package/src/js/util/lang.js +79 -119
- package/src/js/util/mouse.js +19 -17
- package/src/js/util/options.js +44 -49
- package/src/js/util/player.js +40 -36
- package/src/js/util/position.js +54 -46
- package/src/js/util/selector.js +34 -49
- package/src/js/util/style.js +36 -46
- package/src/js/util/viewport.js +75 -64
- package/tests/js/index.js +114 -85
- package/src/js/mixin/flex-bug.js +0 -56
- package/src/js/util/promise.js +0 -191
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.c2430c233 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(t,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitlightbox_panel",["uikit-util"],p):(t=typeof globalThis<"u"?globalThis:t||self,t.UIkitLightbox_panel=p(t.UIkit.util))})(this,function(t){"use strict";var p={slide:{show:function(e){return[{transform:x(e*-100)},{transform:x()}]},percent:function(e){return P(e)},translate:function(e,n){return[{transform:x(n*-100*e)},{transform:x(n*100*(1-e))}]}}};function P(e){return Math.abs(t.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function x(e,n){return e===void 0&&(e=0),n===void 0&&(n="%"),e+=e?n:"",t.isIE?"translateX("+e+")":"translate3d("+e+", 0, 0)"}function $(e){return"scale3d("+e+", "+e+", 1)"}var y=t.assign({},p,{fade:{show:function(){return[{opacity:0},{opacity:1}]},percent:function(e){return 1-t.css(e,"opacity")},translate:function(e){return[{opacity:1-e},{opacity:e}]}},scale:{show:function(){return[{opacity:0,transform:$(1-.2)},{opacity:1,transform:$(1)}]},percent:function(e){return 1-t.css(e,"opacity")},translate:function(e){return[{opacity:1-e,transform:$(1-.2*e)},{opacity:e,transform:$(1-.2+.2*e)}]}}}),C={props:{container:Boolean},data:{container:!0},computed:{container:function(e){var n=e.container;return n===!0&&this.$container||n&&t.$(n)}}},E={connected:function(){!t.hasClass(this.$el,this.$name)&&t.addClass(this.$el,this.$name)}},T={props:{cls:Boolean,animation:"list",duration:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,origin:!1,transition:"linear",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave",initProps:{overflow:"",height:"",paddingTop:"",paddingBottom:"",marginTop:"",marginBottom:""},hideProps:{overflow:"hidden",height:0,paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0}},computed:{hasAnimation:function(e){var n=e.animation;return!!n[0]},hasTransition:function(e){var n=e.animation;return this.hasAnimation&&n[0]===!0}},methods:{toggleElement:function(e,n,s){var r=this;return new t.Promise(function(o){return t.Promise.all(t.toNodes(e).map(function(c){var h=t.isBoolean(n)?n:!r.isToggled(c);if(!t.trigger(c,"before"+(h?"show":"hide"),[r]))return t.Promise.reject();var a=(t.isFunction(s)?s:s===!1||!r.hasAnimation?r._toggle:r.hasTransition?S(r):N(r))(c,h),i=h?r.clsEnter:r.clsLeave;t.addClass(c,i),t.trigger(c,h?"show":"hide",[r]);var u=function(){t.removeClass(c,i),t.trigger(c,h?"shown":"hidden",[r]),r.$update(c)};return a?a.then(u,function(){return t.removeClass(c,i),t.Promise.reject()}):u()})).then(o,t.noop)})},isToggled:function(e){var n;return e===void 0&&(e=this.$el),n=t.toNodes(e),e=n[0],t.hasClass(e,this.clsEnter)?!0:t.hasClass(e,this.clsLeave)?!1:this.cls?t.hasClass(e,this.cls.split(" ")[0]):t.isVisible(e)},_toggle:function(e,n){if(!!e){n=Boolean(n);var s;this.cls?(s=t.includes(this.cls," ")||n!==t.hasClass(e,this.cls),s&&t.toggleClass(e,this.cls,t.includes(this.cls," ")?void 0:n)):(s=n===e.hidden,s&&(e.hidden=!n)),t.$$("[autofocus]",e).some(function(r){return t.isVisible(r)?r.focus()||!0:r.blur()}),s&&(t.trigger(e,"toggled",[n,this]),this.$update(e))}}}};function S(e){var n=e.isToggled,s=e.duration,r=e.initProps,o=e.hideProps,c=e.transition,h=e._toggle;return function(a,i){var u=t.Transition.inProgress(a),l=a.hasChildNodes?t.toFloat(t.css(a.firstElementChild,"marginTop"))+t.toFloat(t.css(a.lastElementChild,"marginBottom")):0,d=t.isVisible(a)?t.height(a)+(u?0:l):0;t.Transition.cancel(a),n(a)||h(a,!0),t.height(a,""),t.fastdom.flush();var f=t.height(a)+(u?0:l);return t.height(a,d),(i?t.Transition.start(a,t.assign({},r,{overflow:"hidden",height:f}),Math.round(s*(1-d/f)),c):t.Transition.start(a,o,Math.round(s*(d/f)),c).then(function(){return h(a,!1)})).then(function(){return t.css(a,r)})}}function N(e){return function(n,s){t.Animation.cancel(n);var r=e.animation,o=e.duration,c=e._toggle;return s?(c(n,!0),t.Animation.in(n,r[0],o,e.origin)):t.Animation.out(n,r[1]||r[0],o,e.origin).then(function(){return c(n,!1)})}}var g=[],D={mixins:[E,C,T],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:function(e,n){var s=e.selPanel;return t.$(s,n)},transitionElement:function(){return this.panel},bgClose:function(e){var n=e.bgClose;return n&&this.panel}},beforeDisconnect:function(){t.includes(g,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate:function(){return this.selClose},handler:function(e){e.preventDefault(),this.hide()}},{name:"toggle",self:!0,handler:function(e,n){e.defaultPrevented||(e.preventDefault(),this.isToggled()===t.includes(g,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler:function(e){if(t.includes(g,this))return!1;!this.stack&&g.length?(t.Promise.all(g.map(function(n){return n.hide()})).then(this.show),e.preventDefault()):g.push(this)}},{name:"show",self:!0,handler:function(){var e=this,n=document.documentElement;t.width(window)>n.clientWidth&&this.overlay&&t.css(document.body,"overflowY","scroll"),this.stack&&t.css(this.$el,"zIndex",t.toFloat(t.css(this.$el,"zIndex"))+g.length),t.addClass(n,this.clsPage),this.bgClose&&t.once(this.$el,"hide",t.on(document,t.pointerDown,function(s){var r=s.target;t.last(g)!==e||e.overlay&&!t.within(r,e.$el)||t.within(r,e.panel)||t.once(document,t.pointerUp+" "+t.pointerCancel+" scroll",function(o){var c=o.defaultPrevented,h=o.type,a=o.target;!c&&h===t.pointerUp&&r===a&&e.hide()},!0)}),{self:!0}),this.escClose&&t.once(this.$el,"hide",t.on(document,"keydown",function(s){s.keyCode===27&&t.last(g)===e&&e.hide()}),{self:!0})}},{name:"shown",self:!0,handler:function(){t.isFocusable(this.$el)||t.attr(this.$el,"tabindex","-1"),t.$(":focus",this.$el)||this.$el.focus()}},{name:"hidden",self:!0,handler:function(){var e=this;t.includes(g,this)&&g.splice(g.indexOf(this),1),g.length||t.css(document.body,"overflowY",""),t.css(this.$el,"zIndex",""),g.some(function(n){return n.clsPage===e.clsPage})||t.removeClass(document.documentElement,this.clsPage)}}],methods:{toggle:function(){return this.isToggled()?this.hide():this.show()},show:function(){var e=this;return this.container&&t.parent(this.$el)!==this.container?(t.append(this.container,this.$el),new t.Promise(function(n){return requestAnimationFrame(function(){return e.show().then(n)})})):this.toggleElement(this.$el,!0,_(this))},hide:function(){return this.toggleElement(this.$el,!1,_(this))}}};function _(e){var n=e.transitionElement,s=e._toggle;return function(r,o){return new t.Promise(function(c,h){return t.once(r,"show hide",function(){r._reject&&r._reject(),r._reject=h,s(r,o);var a=t.once(n,"transitionstart",function(){t.once(n,"transitionend transitioncancel",c,{self:!0}),clearTimeout(i)},{self:!0}),i=setTimeout(function(){a(),c()},t.toMs(t.css(n,"transitionDuration")))})}).then(function(){return delete r._reject})}}function B(e,n,s,r){var o=r.animation,c=r.easing,h=o.percent,a=o.translate,i=o.show;i===void 0&&(i=t.noop);var u=i(s),l=new t.Deferred;return{dir:s,show:function(d,f,v){var w=this;f===void 0&&(f=0);var m=v?"linear":c;return d-=Math.round(d*t.clamp(f,-1,1)),this.translate(f),I(n,"itemin",{percent:f,duration:d,timing:m,dir:s}),I(e,"itemout",{percent:1-f,duration:d,timing:m,dir:s}),t.Promise.all([t.Transition.start(n,u[1],d,m),t.Transition.start(e,u[0],d,m)]).then(function(){w.reset(),l.resolve()},t.noop),l.promise},cancel:function(){t.Transition.cancel([n,e])},reset:function(){for(var d in u[0])t.css([n,e],d,"")},forward:function(d,f){return f===void 0&&(f=this.percent()),t.Transition.cancel([n,e]),this.show(d,f,!0)},translate:function(d){this.reset();var f=a(d,s);t.css(n,f[1]),t.css(e,f[0]),I(n,"itemtranslatein",{percent:d,dir:s}),I(e,"itemtranslateout",{percent:1-d,dir:s})},percent:function(){return h(e||n,n,s)},getDistance:function(){return e&&e.offsetWidth}}}function I(e,n,s){t.trigger(e,t.createEvent(n,!1,!1,s))}var M={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected:function(){this.autoplay&&this.startAutoplay()},disconnected:function(){this.stopAutoplay()},update:function(){t.attr(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el:function(){return document},filter:function(){return this.autoplay},handler:function(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay:function(){var e=this;this.stopAutoplay(),this.interval=setInterval(function(){return(!e.draggable||!t.$(":focus",e.$el))&&(!e.pauseOnHover||!t.matches(e.$el,":hover"))&&!e.stack.length&&e.show("next")},this.autoplayInterval)},stopAutoplay:function(){this.interval&&clearInterval(this.interval)}}},O={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created:function(){var e=this;["start","move","end"].forEach(function(n){var s=e[n];e[n]=function(r){var o=t.getEventPos(r).x*(t.isRtl?-1:1);e.prevPos=o!==e.pos?e.pos:e.prevPos,e.pos=o,s(r)}})},events:[{name:t.pointerDown,delegate:function(){return this.selSlides},handler:function(e){!this.draggable||!t.isTouch(e)&&j(e.target)||t.closest(e.target,t.selInput)||e.button>0||this.length<2||this.start(e)}},{name:"dragstart",handler:function(e){e.preventDefault()}}],methods:{start:function(){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,t.on(document,t.pointerMove,this.move,{passive:!1}),t.on(document,t.pointerUp+" "+t.pointerCancel+" input",this.end,!0),t.css(this.list,"userSelect","none")},move:function(e){var n=this,s=this.pos-this.drag;if(!(s===0||this.prevPos===this.pos||!this.dragging&&Math.abs(s)<this.threshold)){t.css(this.list,"pointerEvents","none"),e.cancelable&&e.preventDefault(),this.dragging=!0,this.dir=s<0?1:-1;for(var r=this,o=r.slides,c=this,h=c.prevIndex,a=Math.abs(s),i=this.getIndex(h+this.dir,h),u=this._getDistance(h,i)||o[h].offsetWidth;i!==h&&a>u;)this.drag-=u*this.dir,h=i,a-=u,i=this.getIndex(h+this.dir,h),u=this._getDistance(h,i)||o[h].offsetWidth;this.percent=a/u;var l=o[h],d=o[i],f=this.index!==i,v=h===i,w;[this.index,this.prevIndex].filter(function(m){return!t.includes([i,h],m)}).forEach(function(m){t.trigger(o[m],"itemhidden",[n]),v&&(w=!0,n.prevIndex=h)}),(this.index===h&&this.prevIndex!==h||w)&&t.trigger(o[this.index],"itemshown",[this]),f&&(this.prevIndex=h,this.index=i,!v&&t.trigger(l,"beforeitemhide",[this]),t.trigger(d,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),l,!v&&d),f&&(!v&&t.trigger(l,"itemhide",[this]),t.trigger(d,"itemshow",[this]))}},end:function(){if(t.off(document,t.pointerMove,this.move,{passive:!1}),t.off(document,t.pointerUp+" "+t.pointerCancel+" input",this.end,!0),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{var e=(t.isRtl?this.dir*(t.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)}t.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function j(e){return!e.children.length&&e.childNodes.length}var L={data:{selNav:!1},computed:{nav:function(e,n){var s=e.selNav;return t.$(s,n)},selNavItem:function(e){var n=e.attrItem;return"["+n+"],[data-"+n+"]"},navItems:function(e,n){return t.$$(this.selNavItem,n)}},update:{write:function(){var e=this;this.nav&&this.length!==this.nav.children.length&&t.html(this.nav,this.slides.map(function(n,s){return"<li "+e.attrItem+'="'+s+'"><a href></a></li>'}).join("")),this.navItems.concat(this.nav).forEach(function(n){return n&&(n.hidden=!e.maxIndex)}),this.updateNav()},events:["resize"]},events:[{name:"click",delegate:function(){return this.selNavItem},handler:function(e){e.preventDefault(),this.show(t.data(e.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav:function(){var e=this,n=this.getValidIndex();this.navItems.forEach(function(s){var r=t.data(s,e.attrItem);t.toggleClass(s,e.clsActive,t.toNumber(r)===n),t.toggleClass(s,"uk-invisible",e.finite&&(r==="previous"&&n===0||r==="next"&&n>=e.maxIndex))})}}},z={mixins:[M,O,L],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number,selSlides:String},data:function(){return{easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}},connected:function(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected:function(){t.removeClass(this.slides,this.clsActive)},computed:{duration:function(e,n){var s=e.velocity;return W(n.offsetWidth/s)},list:function(e,n){var s=e.selList;return t.$(s,n)},maxIndex:function(){return this.length-1},selSlides:function(e){var n=e.selList,s=e.selSlides;return n+" "+(s||"> *")},slides:{get:function(){return t.$$(this.selSlides,this.$el)},watch:function(){this.$reset()}},length:function(){return this.slides.length}},events:{itemshown:function(){this.$update(this.list)}},methods:{show:function(e,n){var s=this;if(n===void 0&&(n=!1),!(this.dragging||!this.length)){var r=this,o=r.stack,c=n?0:o.length,h=function(){o.splice(c,1),o.length&&s.show(o.shift(),!0)};if(o[n?"unshift":"push"](e),!n&&o.length>1){o.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}var a=this.getIndex(this.index),i=t.hasClass(this.slides,this.clsActive)&&this.slides[a],u=this.getIndex(e,this.index),l=this.slides[u];if(i===l){h();return}if(this.dir=H(e,a),this.prevIndex=a,this.index=u,i&&!t.trigger(i,"beforeitemhide",[this])||!t.trigger(l,"beforeitemshow",[this,i])){this.index=this.prevIndex,h();return}var d=this._show(i,l,n).then(function(){return i&&t.trigger(i,"itemhidden",[s]),t.trigger(l,"itemshown",[s]),new t.Promise(function(f){t.fastdom.write(function(){o.shift(),o.length?s.show(o.shift(),!0):s._transitioner=null,f()})})});return i&&t.trigger(i,"itemhide",[this]),t.trigger(l,"itemshow",[this]),d}},getIndex:function(e,n){return e===void 0&&(e=this.index),n===void 0&&(n=this.index),t.clamp(t.getIndex(e,this.slides,n,this.finite),0,this.maxIndex)},getValidIndex:function(e,n){return e===void 0&&(e=this.index),n===void 0&&(n=this.prevIndex),this.getIndex(e,n)},_show:function(e,n,s){if(this._transitioner=this._getTransitioner(e,n,this.dir,t.assign({easing:s?n.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)),!s&&!e)return this._translate(1),t.Promise.resolve();var r=this.stack,o=r.length;return this._transitioner[o>1?"forward":"show"](o>1?Math.min(this.duration,75+75/(o-1)):this.duration,this.percent)},_getDistance:function(e,n){return this._getTransitioner(e,e!==n&&n).getDistance()},_translate:function(e,n,s){n===void 0&&(n=this.prevIndex),s===void 0&&(s=this.index);var r=this._getTransitioner(n!==s?n:!1,s);return r.translate(e),r},_getTransitioner:function(e,n,s,r){return e===void 0&&(e=this.prevIndex),n===void 0&&(n=this.index),s===void 0&&(s=this.dir||1),r===void 0&&(r=this.transitionOptions),new this.Transitioner(t.isNumber(e)?this.slides[e]:e,t.isNumber(n)?this.slides[n]:n,s*(t.isRtl?-1:1),r)}}};function H(e,n){return e==="next"?1:e==="previous"||e<n?-1:1}function W(e){return .5*e+300}var F={mixins:[z],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:p,Transitioner:B},computed:{animation:function(e){var n=e.animation,s=e.Animations;return t.assign(s[n]||s.slide,{name:n})},transitionOptions:function(){return{animation:this.animation}}},events:{"itemshow itemhide itemshown itemhidden":function(e){var n=e.target;this.$update(n)},beforeitemshow:function(e){var n=e.target;t.addClass(n,this.clsActive)},itemshown:function(e){var n=e.target;t.addClass(n,this.clsActivated)},itemhidden:function(e){var n=e.target;t.removeClass(n,this.clsActive,this.clsActivated)}}},A={mixins:[C,D,T,F],functional:!0,props:{delayControls:Number,preload:Number,videoAutoplay:Boolean,template:String},data:function(){return{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:y,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:function(){var e=t.$(this.template),n=t.$(this.selList,e);this.items.forEach(function(){return t.append(n,"<li>")}),this.$mount(t.append(this.container,e))},computed:{caption:function(e,n){var s=e.selCaption;return t.$(s,n)}},events:[{name:t.pointerMove+" "+t.pointerDown+" keydown",handler:"showControls"},{name:"click",self:!0,delegate:function(){return this.selSlides},handler:function(e){e.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler:function(){this.showControls()}},{name:"hide",self:!0,handler:function(){this.hideControls(),t.removeClass(this.slides,this.clsActive),t.Transition.stop(this.slides)}},{name:"hidden",self:!0,handler:function(){this.$destroy(!0)}},{name:"keyup",el:function(){return document},handler:function(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:function(e){this.isToggled()||(this.draggable=!1,e.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=y.scale,t.removeClass(e.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler:function(){t.html(this.caption,this.getItem().caption||"");for(var e=-this.preload;e<=this.preload;e++)this.loadItem(this.index+e)}},{name:"itemshown",handler:function(){this.draggable=this.$props.draggable}},{name:"itemload",handler:function(e,n){var s=this,r=n.source,o=n.type,c=n.alt;c===void 0&&(c="");var h=n.poster,a=n.attrs;if(a===void 0&&(a={}),this.setItem(n,"<span uk-spinner></span>"),!!r){var i,u={frameborder:"0",allow:"autoplay",allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":""+this.videoAutoplay};if(o==="image"||r.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i))t.getImage(r,a.srcset,a.size).then(function(d){var f=d.width,v=d.height;return s.setItem(n,b("img",t.assign({src:r,width:f,height:v,alt:c},a)))},function(){return s.setError(n)});else if(o==="video"||r.match(/\.(mp4|webm|ogv)($|\?)/i)){var l=b("video",t.assign({src:r,poster:h,controls:"",playsinline:"","uk-video":""+this.videoAutoplay},a));t.on(l,"loadedmetadata",function(){t.attr(l,{width:l.videoWidth,height:l.videoHeight}),s.setItem(n,l)}),t.on(l,"error",function(){return s.setError(n)})}else o==="iframe"||r.match(/\.(html|php)($|\?)/i)?this.setItem(n,b("iframe",t.assign({src:r,frameborder:"0",allowfullscreen:"",class:"uk-lightbox-iframe"},a))):(i=r.match(/\/\/(?:.*?youtube(-nocookie)?\..*?[?&]v=|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))?this.setItem(n,b("iframe",t.assign({src:"https://www.youtube"+(i[1]||"")+".com/embed/"+i[2]+(i[3]?"?"+i[3]:""),width:1920,height:1080},u,a))):(i=r.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))&&t.ajax("https://vimeo.com/api/oembed.json?maxwidth=1920&url="+encodeURI(r),{responseType:"json",withCredentials:!1}).then(function(d){var f=d.response,v=f.height,w=f.width;return s.setItem(n,b("iframe",t.assign({src:"https://player.vimeo.com/video/"+i[1]+(i[2]?"?"+i[2]:""),width:w,height:v},u,a)))},function(){return s.setError(n)})}}}],methods:{loadItem:function(e){e===void 0&&(e=this.index);var n=this.getItem(e);this.getSlide(n).childElementCount||t.trigger(this.$el,"itemload",[n])},getItem:function(e){return e===void 0&&(e=this.index),this.items[t.getIndex(e,this.slides)]},setItem:function(e,n){t.trigger(this.$el,"itemloaded",[this,t.html(this.getSlide(e),n)])},getSlide:function(e){return this.slides[this.items.indexOf(e)]},setError:function(e){this.setItem(e,'<span uk-icon="icon: bolt; ratio: 2"></span>')},showControls:function(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),t.addClass(this.$el,"uk-active","uk-transition-active")},hideControls:function(){t.removeClass(this.$el,"uk-active","uk-transition-active")}}};function b(e,n){var s=t.fragment("<"+e+">");return t.attr(s,n),s}return typeof window<"u"&&window.UIkit&&window.UIkit.component("lightboxPanel",A),A});
|
|
1
|
+
/*! UIkit 3.11.2-dev.c7ed3c19b | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(s,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitlightbox_panel",["uikit-util"],p):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitLightbox_panel=p(s.UIkit.util))})(this,function(s){"use strict";var p={slide:{show(e){return[{transform:v(e*-100)},{transform:v()}]},percent(e){return A(e)},translate(e,t){return[{transform:v(t*-100*e)},{transform:v(t*100*(1-e))}]}}};function A(e){return Math.abs(s.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function v(e,t){return e===void 0&&(e=0),t===void 0&&(t="%"),e+=e?t:"","translate3d("+e+", 0, 0)"}function w(e){return"scale3d("+e+", "+e+", 1)"}var I=s.assign({},p,{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:w(1-.2)},{opacity:1,transform:w(1)}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e,transform:w(1-.2*e)},{opacity:e,transform:w(1-.2+.2*e)}]}}}),y={props:{container:Boolean},data:{container:!0},computed:{container(e){let{container:t}=e;return t===!0&&this.$container||t&&s.$(t)}}},_={connected(){!s.hasClass(this.$el,this.$name)&&s.addClass(this.$el,this.$name)}},$={props:{cls:Boolean,animation:"list",duration:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,origin:!1,transition:"linear",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave",initProps:{overflow:"",height:"",paddingTop:"",paddingBottom:"",marginTop:"",marginBottom:""},hideProps:{overflow:"hidden",height:0,paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0}},computed:{hasAnimation(e){let{animation:t}=e;return!!t[0]},hasTransition(e){let{animation:t}=e;return this.hasAnimation&&t[0]===!0}},methods:{toggleElement(e,t,n){return new Promise(o=>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 i=(s.isFunction(n)?n:n===!1||!this.hasAnimation?this._toggle:this.hasTransition?P(this):E(this))(h,a),r=a?this.clsEnter:this.clsLeave;s.addClass(h,r),s.trigger(h,a?"show":"hide",[this]);const l=()=>{s.removeClass(h,r),s.trigger(h,a?"shown":"hidden",[this]),this.$update(h)};return i?i.then(l,()=>(s.removeClass(h,r),Promise.reject())):l()})).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]),this.$update(e))}}};function P(e){let{isToggled:t,duration:n,initProps:o,hideProps:h,transition:a,_toggle:i}=e;return(r,l)=>{const d=s.Transition.inProgress(r),m=r.hasChildNodes?s.toFloat(s.css(r.firstElementChild,"marginTop"))+s.toFloat(s.css(r.lastElementChild,"marginBottom")):0,c=s.isVisible(r)?s.height(r)+(d?0:m):0;s.Transition.cancel(r),t(r)||i(r,!0),s.height(r,""),s.fastdom.flush();const g=s.height(r)+(d?0:m);return s.height(r,c),(l?s.Transition.start(r,s.assign({},o,{overflow:"hidden",height:g}),Math.round(n*(1-c/g)),a):s.Transition.start(r,h,Math.round(n*(c/g)),a).then(()=>i(r,!1))).then(()=>s.css(r,o))}}function E(e){return(t,n)=>{s.Animation.cancel(t);const{animation:o,duration:h,_toggle:a}=e;return n?(a(t,!0),s.Animation.in(t,o[0],h,e.origin)):s.Animation.out(t,o[1]||o[0],h,e.origin).then(()=>a(t,!1))}}const f=[];var S={mixins:[_,y,$],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},handler(e){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(){const e=document.documentElement;s.width(window)>e.clientWidth&&this.overlay&&s.css(document.body,"overflowY","scroll"),this.stack&&s.css(this.$el,"zIndex",s.toFloat(s.css(this.$el,"zIndex"))+f.length),s.addClass(e,this.clsPage),this.bgClose&&s.once(this.$el,"hide",s.on(document,s.pointerDown,t=>{let{target:n}=t;s.last(f)!==this||this.overlay&&!s.within(n,this.$el)||s.within(n,this.panel)||s.once(document,s.pointerUp+" "+s.pointerCancel+" scroll",o=>{let{defaultPrevented:h,type:a,target:i}=o;!h&&a===s.pointerUp&&n===i&&this.hide()},!0)}),{self:!0}),this.escClose&&s.once(this.$el,"hide",s.on(document,"keydown",t=>{t.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),f.length||s.css(document.body,"overflowY",""),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,C(this))},hide(){return this.toggleElement(this.$el,!1,C(this))}}};function C(e){let{transitionElement:t,_toggle:n}=e;return(o,h)=>new Promise((a,i)=>s.once(o,"show hide",()=>{o._reject&&o._reject(),o._reject=i,n(o,h);const r=s.once(t,"transitionstart",()=>{s.once(t,"transitionend transitioncancel",a,{self:!0}),clearTimeout(l)},{self:!0}),l=setTimeout(()=>{r(),a()},s.toMs(s.css(t,"transitionDuration")))})).then(()=>delete o._reject)}function N(e,t,n,o){let{animation:h,easing:a}=o;const{percent:i,translate:r,show:l=s.noop}=h,d=l(n),m=new s.Deferred;return{dir:n,show(c,g,W){g===void 0&&(g=0);const x=W?"linear":a;return c-=Math.round(c*s.clamp(g,-1,1)),this.translate(g),b(t,"itemin",{percent:g,duration:c,timing:x,dir:n}),b(e,"itemout",{percent:1-g,duration:c,timing:x,dir:n}),Promise.all([s.Transition.start(t,d[1],c,x),s.Transition.start(e,d[0],c,x)]).then(()=>{this.reset(),m.resolve()},s.noop),m.promise},cancel(){s.Transition.cancel([t,e])},reset(){for(const c in d[0])s.css([t,e],c,"")},forward(c,g){return g===void 0&&(g=this.percent()),s.Transition.cancel([t,e]),this.show(c,g,!0)},translate(c){this.reset();const g=r(c,n);s.css(t,g[1]),s.css(e,g[0]),b(t,"itemtranslatein",{percent:c,dir:n}),b(e,"itemtranslateout",{percent:1-c,dir:n})},percent(){return i(e||t,t,n)},getDistance(){return e==null?void 0:e.offsetWidth}}}function b(e,t,n){s.trigger(e,s.createEvent(t,!1,!1,n))}var D={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)}}},B={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:s.pointerDown,delegate(){return this.selSlides},handler(e){!this.draggable||!s.isTouch(e)&&M(e.target)||s.closest(e.target,s.selInput)||e.button>0||this.length<2||this.start(e)}},{name:"dragstart",handler(e){e.preventDefault()}}],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,s.pointerMove,this.move,{passive:!1}),s.on(document,s.pointerUp+" "+s.pointerCancel+" input",this.end,!0),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,h=Math.abs(t),a=this.getIndex(o+this.dir,o),i=this._getDistance(o,a)||n[o].offsetWidth;for(;a!==o&&h>i;)this.drag-=i*this.dir,o=a,h-=i,a=this.getIndex(o+this.dir,o),i=this._getDistance(o,a)||n[o].offsetWidth;this.percent=h/i;const r=n[o],l=n[a],d=this.index!==a,m=o===a;let c;[this.index,this.prevIndex].filter(g=>!s.includes([a,o],g)).forEach(g=>{s.trigger(n[g],"itemhidden",[this]),m&&(c=!0,this.prevIndex=o)}),(this.index===o&&this.prevIndex!==o||c)&&s.trigger(n[this.index],"itemshown",[this]),d&&(this.prevIndex=o,this.index=a,!m&&s.trigger(r,"beforeitemhide",[this]),s.trigger(l,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),r,!m&&l),d&&(!m&&s.trigger(r,"itemhide",[this]),s.trigger(l,"itemshow",[this]))},end(){if(s.off(document,s.pointerMove,this.move,{passive:!1}),s.off(document,s.pointerUp+" "+s.pointerCancel+" input",this.end,!0),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 M(e){return!e.children.length&&e.childNodes.length}var j={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))}}}},O={mixins:[D,B,j],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 H(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.$reset()}},length(){return this.slides.length}},events:{itemshown(){this.$update(this.list)}},methods:{show(e,t){if(t===void 0&&(t=!1),this.dragging||!this.length)return;const{stack:n}=this,o=t?0:n.length,h=()=>{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 a=this.getIndex(this.index),i=s.hasClass(this.slides,this.clsActive)&&this.slides[a],r=this.getIndex(e,this.index),l=this.slides[r];if(i===l){h();return}if(this.dir=z(e,a),this.prevIndex=a,this.index=r,i&&!s.trigger(i,"beforeitemhide",[this])||!s.trigger(l,"beforeitemshow",[this,i])){this.index=this.prevIndex,h();return}const d=this._show(i,l,t).then(()=>(i&&s.trigger(i,"itemhidden",[this]),s.trigger(l,"itemshown",[this]),new Promise(m=>{s.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,m()})})));return i&&s.trigger(i,"itemhide",[this]),s.trigger(l,"itemshow",[this]),d},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,s.assign({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 z(e,t){return e==="next"?1:e==="previous"||e<t?-1:1}function H(e){return .5*e+300}var L={mixins:[O],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:p,Transitioner:N},computed:{animation(e){let{animation:t,Animations:n}=e;return s.assign(n[t]||n.slide,{name:t})},transitionOptions(){return{animation:this.animation}}},events:{"itemshow itemhide itemshown itemhidden"(e){let{target:t}=e;this.$update(t)},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)}}},T={mixins:[y,S,$,L],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:I,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=I.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:h="",poster:a,attrs:i={}}=t;if(this.setItem(t,"<span uk-spinner></span>"),!n)return;let r;const l={frameborder:"0",allow:"autoplay",allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":""+this.videoAutoplay};if(o==="image"||n.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i))try{const{width:d,height:m}=await s.getImage(n,i.srcset,i.size);this.setItem(t,u("img",s.assign({src:n,width:d,height:m,alt:h},i)))}catch{this.setError(t)}else if(o==="video"||n.match(/\.(mp4|webm|ogv)($|\?)/i)){const d=u("video",s.assign({src:n,poster:a,controls:"",playsinline:"","uk-video":""+this.videoAutoplay},i));s.on(d,"loadedmetadata",()=>{s.attr(d,{width:d.videoWidth,height:d.videoHeight}),this.setItem(t,d)}),s.on(d,"error",()=>this.setError(t))}else if(o==="iframe"||n.match(/\.(html|php)($|\?)/i))this.setItem(t,u("iframe",s.assign({src:n,frameborder:"0",allowfullscreen:"",class:"uk-lightbox-iframe"},i)));else if(r=n.match(/\/\/(?:.*?youtube(-nocookie)?\..*?[?&]v=|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(t,u("iframe",s.assign({src:"https://www.youtube"+(r[1]||"")+".com/embed/"+r[2]+(r[3]?"?"+r[3]:""),width:1920,height:1080},l,i)));else if(r=n.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{const{height:d,width:m}=await(await fetch("https://vimeo.com/api/oembed.json?maxwidth=1920&url="+encodeURI(n),{credentials:"omit"})).json();this.setItem(t,u("iframe",s.assign({src:"https://player.vimeo.com/video/"+r[1]+(r[2]?"?"+r[2]:""),width:m,height:d},l,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 u(e,t){const n=s.fragment("<"+e+">");return s.attr(n,t),n}return typeof window<"u"&&window.UIkit&&window.UIkit.component("lightboxPanel",T),T});
|