uikit 3.11.2-dev.7dd548556 → 3.11.2-dev.92f357b93
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 +32 -18
- package/dist/css/uikit-core-rtl.css +80 -186
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +80 -186
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +82 -192
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +82 -192
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +3 -3
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +6 -8
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +31 -60
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +34 -64
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +1 -1
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +110 -72
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +110 -72
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +75 -28
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +110 -72
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +57 -21
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +12 -14
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +2 -2
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +4 -4
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +271 -287
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +509 -458
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/component.js +2 -11
- package/src/js/api/hooks.js +1 -1
- package/src/js/api/state.js +3 -3
- package/src/js/components/countdown.js +2 -2
- package/src/js/components/filter.js +2 -3
- package/src/js/components/internal/lightbox-animations.js +4 -3
- package/src/js/components/internal/slider-preload.js +37 -0
- package/src/js/components/internal/slider-transitioner.js +2 -2
- package/src/js/components/internal/slideshow-animations.js +4 -3
- package/src/js/components/lightbox-panel.js +34 -58
- package/src/js/components/lightbox.js +3 -4
- package/src/js/components/slider.js +30 -11
- package/src/js/components/slideshow.js +8 -1
- package/src/js/components/sortable.js +8 -8
- package/src/js/components/upload.js +3 -3
- package/src/js/core/accordion.js +3 -3
- package/src/js/core/alert.js +1 -2
- package/src/js/core/height-match.js +3 -3
- package/src/js/core/img.js +132 -115
- package/src/js/core/modal.js +1 -2
- package/src/js/core/navbar.js +5 -5
- package/src/js/core/scrollspy.js +6 -6
- package/src/js/core/sticky.js +1 -1
- package/src/js/core/svg.js +10 -6
- package/src/js/core/toggle.js +4 -3
- package/src/js/mixin/internal/animate-slide.js +9 -12
- package/src/js/mixin/parallax.js +110 -72
- package/src/js/mixin/slider-drag.js +3 -3
- package/src/js/mixin/slider-nav.js +2 -2
- package/src/js/mixin/slider.js +8 -16
- package/src/js/mixin/slideshow.js +2 -2
- package/src/js/mixin/togglable.js +1 -2
- package/src/js/util/ajax.js +9 -12
- package/src/js/util/animation.js +7 -12
- package/src/js/util/attr.js +11 -9
- package/src/js/util/dom.js +27 -45
- package/src/js/util/lang.js +7 -6
- package/src/js/util/options.js +2 -11
- package/src/js/util/player.js +5 -4
- package/src/js/util/position.js +2 -2
- package/src/js/util/selector.js +12 -18
- package/src/js/util/style.js +4 -4
- package/src/less/components/base.less +10 -33
- package/src/less/components/form-range.less +52 -97
- package/src/less/components/form.less +0 -1
- package/src/less/components/leader.less +0 -1
- package/src/less/components/lightbox.less +0 -1
- package/src/less/components/modal.less +3 -7
- package/src/less/components/progress.less +14 -36
- package/src/less/components/slider.less +0 -3
- package/src/less/components/slideshow.less +0 -3
- package/src/less/components/text.less +16 -32
- package/src/scss/components/base.scss +10 -33
- package/src/scss/components/form-range.scss +52 -97
- package/src/scss/components/form.scss +0 -1
- package/src/scss/components/leader.scss +0 -1
- package/src/scss/components/lightbox.scss +0 -1
- package/src/scss/components/modal.scss +3 -7
- package/src/scss/components/progress.scss +14 -36
- package/src/scss/components/slider.scss +0 -3
- package/src/scss/components/slideshow.scss +0 -3
- package/src/scss/components/text.scss +16 -32
- package/src/scss/mixins-theme.scss +1 -1
- package/src/scss/mixins.scss +1 -1
- package/src/scss/variables-theme.scss +3 -3
- package/src/scss/variables.scss +3 -3
- package/tests/align.html +10 -10
- package/tests/animation.html +2 -2
- package/tests/article.html +2 -2
- package/tests/base.html +3 -3
- package/tests/card.html +10 -10
- package/tests/column.html +3 -3
- package/tests/comment.html +9 -9
- package/tests/dotnav.html +3 -3
- package/tests/image.html +296 -64
- package/tests/images/image-type.avif +0 -0
- package/tests/images/image-type.jpeg +0 -0
- package/tests/images/image-type.webp +0 -0
- package/tests/index.html +8 -8
- package/tests/lightbox.html +10 -10
- package/tests/marker.html +2 -2
- package/tests/modal.html +8 -9
- package/tests/navbar.html +2 -2
- package/tests/overlay.html +7 -7
- package/tests/parallax.html +14 -5
- package/tests/position.html +12 -12
- package/tests/slidenav.html +12 -12
- package/tests/slider.html +20 -20
- package/tests/sortable.html +1 -1
- package/tests/sticky-parallax.html +47 -62
- package/tests/svg.html +6 -6
- package/tests/table.html +11 -11
- package/tests/thumbnav.html +12 -12
- package/tests/transition.html +30 -30
- package/tests/utility.html +33 -33
- package/tests/video.html +1 -1
- package/tests/width.html +1 -1
- package/src/js/util/promise.js +0 -0
- package/tests/images/animated.gif +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.7dd548556 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(e,v){typeof exports=="object"&&typeof module<"u"?module.exports=v(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider",["uikit-util"],v):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkitSlider=v(e.UIkit.util))})(this,function(e){"use strict";var v={connected(){!e.hasClass(this.$el,this.$name)&&e.addClass(this.$el,this.$name)}},E={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){e.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||!e.$(":focus",this.$el))&&(!this.pauseOnHover||!e.matches(this.$el,":hover"))&&!this.stack.length&&this.show("next"),this.autoplayInterval)},stopAutoplay(){this.interval&&clearInterval(this.interval)}}},R={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){["start","move","end"].forEach(s=>{const t=this[s];this[s]=n=>{const i=e.getEventPos(n).x*(e.isRtl?-1:1);this.prevPos=i!==this.pos?this.pos:this.prevPos,this.pos=i,t(n)}})},events:[{name:e.pointerDown,delegate(){return this.selSlides},handler(s){!this.draggable||!e.isTouch(s)&&S(s.target)||e.closest(s.target,e.selInput)||s.button>0||this.length<2||this.start(s)}},{name:"dragstart",handler(s){s.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,e.on(document,e.pointerMove,this.move,{passive:!1}),e.on(document,e.pointerUp+" "+e.pointerCancel+" input",this.end,!0),e.css(this.list,"userSelect","none")},move(s){const t=this.pos-this.drag;if(t===0||this.prevPos===this.pos||!this.dragging&&Math.abs(t)<this.threshold)return;e.css(this.list,"pointerEvents","none"),s.cancelable&&s.preventDefault(),this.dragging=!0,this.dir=t<0?1:-1;const{slides:n}=this;let{prevIndex:i}=this,o=Math.abs(t),r=this.getIndex(i+this.dir,i),h=this._getDistance(i,r)||n[i].offsetWidth;for(;r!==i&&o>h;)this.drag-=h*this.dir,i=r,o-=h,r=this.getIndex(i+this.dir,i),h=this._getDistance(i,r)||n[i].offsetWidth;this.percent=o/h;const f=n[i],c=n[r],l=this.index!==r,a=i===r;let d;[this.index,this.prevIndex].filter(g=>!e.includes([r,i],g)).forEach(g=>{e.trigger(n[g],"itemhidden",[this]),a&&(d=!0,this.prevIndex=i)}),(this.index===i&&this.prevIndex!==i||d)&&e.trigger(n[this.index],"itemshown",[this]),l&&(this.prevIndex=i,this.index=r,!a&&e.trigger(f,"beforeitemhide",[this]),e.trigger(c,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),f,!a&&c),l&&(!a&&e.trigger(f,"itemhide",[this]),e.trigger(c,"itemshow",[this]))},end(){if(e.off(document,e.pointerMove,this.move,{passive:!1}),e.off(document,e.pointerUp+" "+e.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 s=(e.isRtl?this.dir*(e.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=s?this.index:this.prevIndex,s&&(this.percent=1-this.percent),this.show(this.dir>0&&!s||this.dir<0&&s?"next":"previous",!0)}e.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function S(s){return!s.children.length&&s.childNodes.length}var T={data:{selNav:!1},computed:{nav(s,t){let{selNav:n}=s;return e.$(n,t)},selNavItem(s){let{attrItem:t}=s;return"["+t+"],[data-"+t+"]"},navItems(s,t){return e.$$(this.selNavItem,t)}},update:{write(){this.nav&&this.length!==this.nav.children.length&&e.html(this.nav,this.slides.map((s,t)=>"<li "+this.attrItem+'="'+t+'"><a href></a></li>').join("")),this.navItems.concat(this.nav).forEach(s=>s&&(s.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]},events:[{name:"click",delegate(){return this.selNavItem},handler(s){s.preventDefault(),this.show(e.data(s.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav(){const s=this.getValidIndex();this.navItems.forEach(t=>{const n=e.data(t,this.attrItem);e.toggleClass(t,this.clsActive,e.toNumber(n)===s),e.toggleClass(t,"uk-invisible",this.finite&&(n==="previous"&&s===0||n==="next"&&s>=this.maxIndex))})}}},D={mixins:[E,R,T],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(){e.removeClass(this.slides,this.clsActive)},computed:{duration(s,t){let{velocity:n}=s;return b(t.offsetWidth/n)},list(s,t){let{selList:n}=s;return e.$(n,t)},maxIndex(){return this.length-1},selSlides(s){let{selList:t,selSlides:n}=s;return t+" "+(n||"> *")},slides:{get(){return e.$$(this.selSlides,this.$el)},watch(){this.$reset()}},length(){return this.slides.length}},events:{itemshown(){this.$update(this.list)}},methods:{show(s,t){if(t===void 0&&(t=!1),this.dragging||!this.length)return;const{stack:n}=this,i=t?0:n.length,o=()=>{n.splice(i,1),n.length&&this.show(n.shift(),!0)};if(n[t?"unshift":"push"](s),!t&&n.length>1){n.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}const r=this.getIndex(this.index),h=e.hasClass(this.slides,this.clsActive)&&this.slides[r],f=this.getIndex(s,this.index),c=this.slides[f];if(h===c){o();return}if(this.dir=W(s,r),this.prevIndex=r,this.index=f,h&&!e.trigger(h,"beforeitemhide",[this])||!e.trigger(c,"beforeitemshow",[this,h])){this.index=this.prevIndex,o();return}const l=this._show(h,c,t).then(()=>(h&&e.trigger(h,"itemhidden",[this]),e.trigger(c,"itemshown",[this]),new Promise(a=>{e.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,a()})})));return h&&e.trigger(h,"itemhide",[this]),e.trigger(c,"itemshow",[this]),l},getIndex(s,t){return s===void 0&&(s=this.index),t===void 0&&(t=this.index),e.clamp(e.getIndex(s,this.slides,t,this.finite),0,this.maxIndex)},getValidIndex(s,t){return s===void 0&&(s=this.index),t===void 0&&(t=this.prevIndex),this.getIndex(s,t)},_show(s,t,n){if(this._transitioner=this._getTransitioner(s,t,this.dir,e.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&&!s)return this._translate(1),Promise.resolve();const{length:i}=this.stack;return this._transitioner[i>1?"forward":"show"](i>1?Math.min(this.duration,75+75/(i-1)):this.duration,this.percent)},_getDistance(s,t){return this._getTransitioner(s,s!==t&&t).getDistance()},_translate(s,t,n){t===void 0&&(t=this.prevIndex),n===void 0&&(n=this.index);const i=this._getTransitioner(t!==n?t:!1,n);return i.translate(s),i},_getTransitioner(s,t,n,i){return s===void 0&&(s=this.prevIndex),t===void 0&&(t=this.index),n===void 0&&(n=this.dir||1),i===void 0&&(i=this.transitionOptions),new this.Transitioner(e.isNumber(s)?this.slides[s]:s,e.isNumber(t)?this.slides[t]:t,n*(e.isRtl?-1:1),i)}}};function W(s,t){return s==="next"?1:s==="previous"||s<t?-1:1}function b(s){return .5*s+300}var O={update:{write(){if(this.stack.length||this.dragging)return;const s=this.getValidIndex(this.index);(!~this.prevIndex||this.index!==s)&&this.show(s)},events:["resize"]}};function _(s,t){return s===void 0&&(s=0),t===void 0&&(t="%"),s+=s?t:"","translate3d("+s+", 0, 0)"}function B(s,t,n,i){let{center:o,easing:r,list:h}=i;const f=new e.Deferred,c=s?p(s,h,o):p(t,h,o)+e.dimensions(t).width*n,l=t?p(t,h,o):c+e.dimensions(s).width*n*(e.isRtl?-1:1);return{dir:n,show(a,d,g){d===void 0&&(d=0);const m=g?"linear":r;return a-=Math.round(a*e.clamp(d,-1,1)),this.translate(d),d=s?d:e.clamp(d,0,1),u(this.getItemIn(),"itemin",{percent:d,duration:a,timing:m,dir:n}),s&&u(this.getItemIn(!0),"itemout",{percent:1-d,duration:a,timing:m,dir:n}),e.Transition.start(h,{transform:_(-l*(e.isRtl?-1:1),"px")},a,m).then(f.resolve,e.noop),f.promise},cancel(){e.Transition.cancel(h)},reset(){e.css(h,"transform","")},forward(a,d){return d===void 0&&(d=this.percent()),e.Transition.cancel(h),this.show(a,d,!0)},translate(a){const d=this.getDistance()*n*(e.isRtl?-1:1);e.css(h,"transform",_(e.clamp(-l+(d-d*a),-I(h),e.dimensions(h).width)*(e.isRtl?-1:1),"px"));const g=this.getActives(),m=this.getItemIn(),L=this.getItemIn(!0);a=s?e.clamp(a,-1,1):0,e.children(h).forEach(x=>{const C=e.includes(g,x),M=x===m,N=x===L,z=M||!N&&(C||n*(e.isRtl?-1:1)===-1^w(x,h)>w(s||t));u(x,"itemtranslate"+(z?"in":"out"),{dir:n,percent:N?1-a:M?a:C?1:0})})},percent(){return Math.abs((e.css(h,"transform").split(",")[4]*(e.isRtl?-1:1)+c)/(l-c))},getDistance(){return Math.abs(l-c)},getItemIn(a){a===void 0&&(a=!1);let d=this.getActives(),g=A(h,p(t||s,h,o));if(a){const m=d;d=g,g=m}return g[e.findIndex(g,m=>!e.includes(d,m))]},getActives(){return A(h,p(s||t,h,o))}}}function p(s,t,n){const i=w(s,t);return n?i-P(s,t):Math.min(i,y(t))}function y(s){return Math.max(0,I(s)-e.dimensions(s).width)}function I(s){return e.children(s).reduce((t,n)=>e.dimensions(n).width+t,0)}function P(s,t){return e.dimensions(t).width/2-e.dimensions(s).width/2}function w(s,t){return s&&(e.position(s).left+(e.isRtl?e.dimensions(s).width-e.dimensions(t).width:0))*(e.isRtl?-1:1)||0}function A(s,t){t-=1;const n=e.dimensions(s).width,i=t+n+2;return e.children(s).filter(o=>{const r=w(o,s),h=r+Math.min(e.dimensions(o).width,n);return r>=t&&h<=i})}function u(s,t,n){e.trigger(s,e.createEvent(t,!1,!1,n))}var $={mixins:[v,D,O],props:{center:Boolean,sets:Boolean},data:{center:!1,sets:!1,attrItem:"uk-slider-item",selList:".uk-slider-items",selNav:".uk-slider-nav",clsContainer:"uk-slider-container",Transitioner:B},computed:{avgWidth(){return I(this.list)/this.length},finite(s){let{finite:t}=s;return t||Math.ceil(I(this.list))<Math.floor(e.dimensions(this.list).width+V(this.list)+this.center)},maxIndex(){if(!this.finite||this.center&&!this.sets)return this.length-1;if(this.center)return e.last(this.sets);let s=0;const t=y(this.list),n=e.findIndex(this.slides,i=>{if(s>=t)return!0;s+=e.dimensions(i).width});return~n?n:this.length-1},sets(s){let{sets:t}=s;if(!t)return;const n=e.dimensions(this.list).width/(this.center?2:1);let i=0,o=n,r=0;return t=e.sortBy(this.slides,"offsetLeft").reduce((h,f,c)=>{const l=e.dimensions(f).width;if(r+l>i&&(!this.center&&c>this.maxIndex&&(c=this.maxIndex),!e.includes(h,c))){const d=this.slides[c+1];this.center&&d&&l<o-e.dimensions(d).width/2?o-=l:(o=n,h.push(c),i=r+n+(this.center?l/2:0))}return r+=l,h},[]),!e.isEmpty(t)&&t},transitionOptions(){return{center:this.center,list:this.list}}},connected(){e.toggleClass(this.$el,this.clsContainer,!e.$("."+this.clsContainer,this.$el))},update:{write(){this.navItems.forEach(t=>{const n=e.toNumber(e.data(t,this.attrItem));n!==!1&&(t.hidden=!this.maxIndex||n>this.maxIndex||this.sets&&!e.includes(this.sets,n))}),this.length&&!this.dragging&&!this.stack.length&&(this.reorder(),this._translate(1));const s=this._getTransitioner(this.index).getActives();this.slides.forEach(t=>e.toggleClass(t,this.clsActive,e.includes(s,t))),this.clsActivated&&(!this.sets||e.includes(this.sets,e.toFloat(this.index)))&&this.slides.forEach(t=>e.toggleClass(t,this.clsActivated||"",e.includes(s,t)))},events:["resize"]},events:{beforeitemshow(s){!this.dragging&&this.sets&&this.stack.length<2&&!e.includes(this.sets,this.index)&&(this.index=this.getValidIndex());const t=Math.abs(this.index-this.prevIndex+(this.dir>0&&this.index<this.prevIndex||this.dir<0&&this.index>this.prevIndex?(this.maxIndex+1)*this.dir:0));if(!this.dragging&&t>1){for(let i=0;i<t;i++)this.stack.splice(1,0,this.dir>0?"next":"previous");s.preventDefault();return}const n=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex;this.duration=b(this.avgWidth/this.velocity)*(e.dimensions(this.slides[n]).width/this.avgWidth),this.reorder()},itemshow(){~this.prevIndex&&e.addClass(this._getTransitioner().getItemIn(),this.clsActive)}},methods:{reorder(){if(this.finite){e.css(this.slides,"order","");return}const s=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((o,r)=>e.css(o,"order",this.dir>0&&r<s?1:this.dir<0&&r>=this.index?-1:"")),!this.center)return;const t=this.slides[s];let n=e.dimensions(this.list).width/2-e.dimensions(t).width/2,i=0;for(;n>0;){const o=this.getIndex(--i+s,s),r=this.slides[o];e.css(r,"order",o>s?-2:-1),n-=e.dimensions(r).width}},getValidIndex(s,t){if(s===void 0&&(s=this.index),t===void 0&&(t=this.prevIndex),s=this.getIndex(s,t),!this.sets)return s;let n;do{if(e.includes(this.sets,s))return s;n=s,s=this.getIndex(s+this.dir,t)}while(s!==n);return s}}};function V(s){return Math.max(0,...e.children(s).map(t=>e.dimensions(t).width))}return typeof window<"u"&&window.UIkit&&window.UIkit.component("slider",$),$});
|
|
1
|
+
/*! UIkit 3.11.2-dev.92f357b93 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(s,v){typeof exports=="object"&&typeof module<"u"?module.exports=v(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider",["uikit-util"],v):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitSlider=v(s.UIkit.util))})(this,function(s){"use strict";var v={connected(){!s.hasClass(this.$el,this.$name)&&s.addClass(this.$el,this.$name)}},R={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)}}},T={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const e of["start","move","end"]){const t=this[e];this[e]=n=>{const i=s.getEventPos(n).x*(s.isRtl?-1:1);this.prevPos=i===this.pos?this.prevPos:this.pos,this.pos=i,t(n)}}},events:[{name:s.pointerDown,delegate(){return this.selSlides},handler(e){!this.draggable||!s.isTouch(e)&&D(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:i}=this,d=Math.abs(t),r=this.getIndex(i+this.dir,i),h=this._getDistance(i,r)||n[i].offsetWidth;for(;r!==i&&d>h;)this.drag-=h*this.dir,i=r,d-=h,r=this.getIndex(i+this.dir,i),h=this._getDistance(i,r)||n[i].offsetWidth;this.percent=d/h;const f=n[i],c=n[r],l=this.index!==r,a=i===r;let o;[this.index,this.prevIndex].filter(g=>!s.includes([r,i],g)).forEach(g=>{s.trigger(n[g],"itemhidden",[this]),a&&(o=!0,this.prevIndex=i)}),(this.index===i&&this.prevIndex!==i||o)&&s.trigger(n[this.index],"itemshown",[this]),l&&(this.prevIndex=i,this.index=r,!a&&s.trigger(f,"beforeitemhide",[this]),s.trigger(c,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),f,!a&&c),l&&(!a&&s.trigger(f,"itemhide",[this]),s.trigger(c,"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 D(e){return!e.children.length&&e.childNodes.length}var E={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:[R,T,E],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 b(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,i=t?0:n.length,d=()=>{n.splice(i,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),h=s.hasClass(this.slides,this.clsActive)&&this.slides[r],f=this.getIndex(e,this.index),c=this.slides[f];if(h===c){d();return}if(this.dir=W(e,r),this.prevIndex=r,this.index=f,h&&!s.trigger(h,"beforeitemhide",[this])||!s.trigger(c,"beforeitemshow",[this,h])){this.index=this.prevIndex,d();return}const l=this._show(h,c,t).then(()=>(h&&s.trigger(h,"itemhidden",[this]),s.trigger(c,"itemshown",[this]),new Promise(a=>{s.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,a()})})));return h&&s.trigger(h,"itemhide",[this]),s.trigger(c,"itemshow",[this]),l},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:i}=this.stack;return this._transitioner[i>1?"forward":"show"](i>1?Math.min(this.duration,75+75/(i-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 i=this._getTransitioner(t!==n?t:!1,n);return i.translate(e),i},_getTransitioner(e,t,n,i){return e===void 0&&(e=this.prevIndex),t===void 0&&(t=this.index),n===void 0&&(n=this.dir||1),i===void 0&&(i=this.transitionOptions),new this.Transitioner(s.isNumber(e)?this.slides[e]:e,s.isNumber(t)?this.slides[t]:t,n*(s.isRtl?-1:1),i)}}};function W(e,t){return e==="next"?1:e==="previous"||e<t?-1:1}function b(e){return .5*e+300}var L={update:{write(){if(this.stack.length||this.dragging)return;const e=this.getValidIndex(this.index);(!~this.prevIndex||this.index!==e)&&this.show(e)},events:["resize"]}},z={connected(){window.IntersectionObserver&&(this.observer=new IntersectionObserver(e=>{e.some(t=>t.isIntersecting)&&y(this.getAdjacentSlides())},{rootMargin:"50% 50%"}),this.observer.observe(this.$el))},disconnected(){this.observer&&this.observer.disconnect()},update:{read(){s.isVisible(this.$el)&&y(this.getAdjacentSlides())},events:["resize"]}};function y(e){e===void 0&&(e=[]);for(const t of e)t&&s.$$('img[loading="lazy"]',t).forEach(n=>s.removeAttr(n,"loading"))}function _(e,t){return e===void 0&&(e=0),t===void 0&&(t="%"),e+=e?t:"","translate3d("+e+", 0, 0)"}function B(e,t,n,i){let{center:d,easing:r,list:h}=i;const f=new s.Deferred,c=e?p(e,h,d):p(t,h,d)+s.dimensions(t).width*n,l=t?p(t,h,d):c+s.dimensions(e).width*n*(s.isRtl?-1:1);return{dir:n,show(a,o,g){o===void 0&&(o=0);const m=g?"linear":r;return a-=Math.round(a*s.clamp(o,-1,1)),this.translate(o),o=e?o:s.clamp(o,0,1),u(this.getItemIn(),"itemin",{percent:o,duration:a,timing:m,dir:n}),e&&u(this.getItemIn(!0),"itemout",{percent:1-o,duration:a,timing:m,dir:n}),s.Transition.start(h,{transform:_(-l*(s.isRtl?-1:1),"px")},a,m).then(f.resolve,s.noop),f.promise},cancel(){s.Transition.cancel(h)},reset(){s.css(h,"transform","")},forward(a,o){return o===void 0&&(o=this.percent()),s.Transition.cancel(h),this.show(a,o,!0)},translate(a){const o=this.getDistance()*n*(s.isRtl?-1:1);s.css(h,"transform",_(s.clamp(-l+(o-o*a),-I(h),s.dimensions(h).width)*(s.isRtl?-1:1),"px"));const g=this.getActives(),m=this.getItemIn(),j=this.getItemIn(!0);a=e?s.clamp(a,-1,1):0;for(const x of s.children(h)){const M=s.includes(g,x),C=x===m,N=x===j,H=C||!N&&(M||n*(s.isRtl?-1:1)===-1^w(x,h)>w(e||t));u(x,"itemtranslate"+(H?"in":"out"),{dir:n,percent:N?1-a:C?a:M?1:0})}},percent(){return Math.abs((s.css(h,"transform").split(",")[4]*(s.isRtl?-1:1)+c)/(l-c))},getDistance(){return Math.abs(l-c)},getItemIn(a){a===void 0&&(a=!1);let o=this.getActives(),g=$(h,p(t||e,h,d));if(a){const m=o;o=g,g=m}return g[s.findIndex(g,m=>!s.includes(o,m))]},getActives(){return $(h,p(e||t,h,d))}}}function p(e,t,n){const i=w(e,t);return n?i-P(e,t):Math.min(i,A(t))}function A(e){return Math.max(0,I(e)-s.dimensions(e).width)}function I(e){return s.children(e).reduce((t,n)=>s.dimensions(n).width+t,0)}function P(e,t){return s.dimensions(t).width/2-s.dimensions(e).width/2}function w(e,t){return e&&(s.position(e).left+(s.isRtl?s.dimensions(e).width-s.dimensions(t).width:0))*(s.isRtl?-1:1)||0}function $(e,t){t-=1;const n=s.dimensions(e).width,i=t+n+2;return s.children(e).filter(d=>{const r=w(d,e),h=r+Math.min(s.dimensions(d).width,n);return r>=t&&h<=i})}function u(e,t,n){s.trigger(e,s.createEvent(t,!1,!1,n))}var S={mixins:[v,O,L,z],props:{center:Boolean,sets:Boolean},data:{center:!1,sets:!1,attrItem:"uk-slider-item",selList:".uk-slider-items",selNav:".uk-slider-nav",clsContainer:"uk-slider-container",Transitioner:B},computed:{avgWidth(){return I(this.list)/this.length},finite(e){let{finite:t}=e;return t||Math.ceil(I(this.list))<Math.floor(s.dimensions(this.list).width+V(this.list)+this.center)},maxIndex(){if(!this.finite||this.center&&!this.sets)return this.length-1;if(this.center)return s.last(this.sets);let e=0;const t=A(this.list),n=s.findIndex(this.slides,i=>{if(e>=t)return!0;e+=s.dimensions(i).width});return~n?n:this.length-1},sets(e){let{sets:t}=e;if(!t)return;const n=s.dimensions(this.list).width/(this.center?2:1);let i=0,d=n,r=0;return t=s.sortBy(this.slides,"offsetLeft").reduce((h,f,c)=>{const l=s.dimensions(f).width;if(r+l>i&&(!this.center&&c>this.maxIndex&&(c=this.maxIndex),!s.includes(h,c))){const o=this.slides[c+1];this.center&&o&&l<d-s.dimensions(o).width/2?d-=l:(d=n,h.push(c),i=r+n+(this.center?l/2:0))}return r+=l,h},[]),!s.isEmpty(t)&&t},transitionOptions(){return{center:this.center,list:this.list}}},connected(){s.toggleClass(this.$el,this.clsContainer,!s.$("."+this.clsContainer,this.$el))},update:{write(){for(const n of this.navItems){const i=s.toNumber(s.data(n,this.attrItem));i!==!1&&(n.hidden=!this.maxIndex||i>this.maxIndex||this.sets&&!s.includes(this.sets,i))}this.length&&!this.dragging&&!this.stack.length&&(this.reorder(),this._translate(1));const e=this._getTransitioner(this.index).getActives(),t=[this.clsActive,(!this.sets||s.includes(this.sets,s.toFloat(this.index)))&&this.clsActivated||""];for(const n of this.slides)s.toggleClass(n,t,s.includes(e,n))},events:["resize"]},events:{beforeitemshow(e){!this.dragging&&this.sets&&this.stack.length<2&&!s.includes(this.sets,this.index)&&(this.index=this.getValidIndex());const t=Math.abs(this.index-this.prevIndex+(this.dir>0&&this.index<this.prevIndex||this.dir<0&&this.index>this.prevIndex?(this.maxIndex+1)*this.dir:0));if(!this.dragging&&t>1){for(let i=0;i<t;i++)this.stack.splice(1,0,this.dir>0?"next":"previous");e.preventDefault();return}const n=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex;this.duration=b(this.avgWidth/this.velocity)*(s.dimensions(this.slides[n]).width/this.avgWidth),this.reorder()},itemshow(){~this.prevIndex&&s.addClass(this._getTransitioner().getItemIn(),this.clsActive)}},methods:{reorder(){if(this.finite){s.css(this.slides,"order","");return}const e=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((d,r)=>s.css(d,"order",this.dir>0&&r<e?1:this.dir<0&&r>=this.index?-1:"")),!this.center)return;const t=this.slides[e];let n=s.dimensions(this.list).width/2-s.dimensions(t).width/2,i=0;for(;n>0;){const d=this.getIndex(--i+e,e),r=this.slides[d];s.css(r,"order",d>e?-2:-1),n-=s.dimensions(r).width}},getValidIndex(e,t){if(e===void 0&&(e=this.index),t===void 0&&(t=this.prevIndex),e=this.getIndex(e,t),!this.sets)return e;let n;do{if(s.includes(this.sets,e))return e;n=e,e=this.getIndex(e+this.dir,t)}while(e!==n);return e},getAdjacentSlides(){const{width:e}=s.dimensions(this.list),t=-e,n=e*2,i=s.dimensions(this.slides[this.index]).width,d=this.center?e/2-i/2:0,r=new Set;for(const h of[-1,1]){let f=d+(h>0?i:0),c=0;do{const l=this.slides[this.getIndex(this.index+h+c++*h)];f+=s.dimensions(l).width*h,r.add(l)}while(this.slides.length>c&&f>t&&f<n)}return Array.from(r)}}};function V(e){return Math.max(0,...s.children(e).map(t=>s.dimensions(t).width))}return typeof window<"u"&&window.UIkit&&window.UIkit.component("slider",S),S});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.92f357b93 | 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')) :
|
|
@@ -127,39 +127,35 @@
|
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
|
|
130
|
-
function transformFn(prop, el,
|
|
131
|
-
const unit = getUnit(
|
|
130
|
+
function transformFn(prop, el, stops) {
|
|
131
|
+
const unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
|
|
132
|
+
let transformFn;
|
|
132
133
|
|
|
133
134
|
if (prop === 'x' || prop === 'y') {
|
|
134
135
|
prop = "translate" + uikitUtil.ucfirst(prop);
|
|
136
|
+
transformFn = (stop) => uikitUtil.toFloat(uikitUtil.toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
|
|
135
137
|
}
|
|
136
138
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (steps.length === 1) {
|
|
140
|
-
steps.unshift(prop === 'scale' ? 1 : 0);
|
|
139
|
+
if (stops.length === 1) {
|
|
140
|
+
stops.unshift(prop === 'scale' ? 1 : 0);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
let value = getValue(steps, percent);
|
|
145
|
-
|
|
146
|
-
if (uikitUtil.startsWith(prop, 'translate')) {
|
|
147
|
-
value = uikitUtil.toFloat(value).toFixed(unit === 'px' ? 0 : 6);
|
|
148
|
-
}
|
|
143
|
+
stops = parseStops(stops, transformFn);
|
|
149
144
|
|
|
150
|
-
|
|
145
|
+
return (css, percent) => {
|
|
146
|
+
css.transform += " " + prop + "(" + getValue(stops, percent) + unit + ")";
|
|
151
147
|
};
|
|
152
148
|
}
|
|
153
149
|
|
|
154
|
-
function colorFn(prop, el,
|
|
155
|
-
if (
|
|
156
|
-
|
|
150
|
+
function colorFn(prop, el, stops) {
|
|
151
|
+
if (stops.length === 1) {
|
|
152
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
157
153
|
}
|
|
158
154
|
|
|
159
|
-
|
|
155
|
+
stops = parseStops(stops, (stop) => parseColor(el, stop));
|
|
160
156
|
|
|
161
157
|
return (css, percent) => {
|
|
162
|
-
const [start, end, p] =
|
|
158
|
+
const [start, end, p] = getStop(stops, percent);
|
|
163
159
|
const value = start.
|
|
164
160
|
map((value, i) => {
|
|
165
161
|
value += p * (end[i] - value);
|
|
@@ -179,85 +175,83 @@
|
|
|
179
175
|
map(uikitUtil.toFloat);
|
|
180
176
|
}
|
|
181
177
|
|
|
182
|
-
function filterFn(prop, el,
|
|
183
|
-
if (
|
|
184
|
-
|
|
178
|
+
function filterFn(prop, el, stops) {
|
|
179
|
+
if (stops.length === 1) {
|
|
180
|
+
stops.unshift(0);
|
|
185
181
|
}
|
|
186
182
|
|
|
187
|
-
const unit = getUnit(
|
|
183
|
+
const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
|
|
188
184
|
prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
|
|
189
|
-
|
|
185
|
+
stops = parseStops(stops);
|
|
190
186
|
|
|
191
187
|
return (css, percent) => {
|
|
192
|
-
const value = getValue(
|
|
188
|
+
const value = getValue(stops, percent);
|
|
193
189
|
css.filter += " " + prop + "(" + (value + unit) + ")";
|
|
194
190
|
};
|
|
195
191
|
}
|
|
196
192
|
|
|
197
|
-
function cssPropFn(prop, el,
|
|
198
|
-
if (
|
|
199
|
-
|
|
193
|
+
function cssPropFn(prop, el, stops) {
|
|
194
|
+
if (stops.length === 1) {
|
|
195
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
200
196
|
}
|
|
201
197
|
|
|
202
|
-
|
|
198
|
+
stops = parseStops(stops);
|
|
203
199
|
|
|
204
200
|
return (css, percent) => {
|
|
205
|
-
css[prop] = getValue(
|
|
201
|
+
css[prop] = getValue(stops, percent);
|
|
206
202
|
};
|
|
207
203
|
}
|
|
208
204
|
|
|
209
|
-
function strokeFn(prop, el,
|
|
210
|
-
if (
|
|
211
|
-
|
|
205
|
+
function strokeFn(prop, el, stops) {
|
|
206
|
+
if (stops.length === 1) {
|
|
207
|
+
stops.unshift(0);
|
|
212
208
|
}
|
|
213
209
|
|
|
214
|
-
const unit = getUnit(
|
|
215
|
-
|
|
210
|
+
const unit = getUnit(stops);
|
|
211
|
+
const length = getMaxPathLength(el);
|
|
212
|
+
stops = parseStops(stops.reverse(), (stop) => {
|
|
213
|
+
stop = uikitUtil.toFloat(stop);
|
|
214
|
+
return unit === '%' ? stop * length / 100 : stop;
|
|
215
|
+
});
|
|
216
216
|
|
|
217
|
-
if (!
|
|
217
|
+
if (!stops.some((_ref) => {let [value] = _ref;return value;})) {
|
|
218
218
|
return uikitUtil.noop;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
const length = getMaxPathLength(el);
|
|
222
221
|
uikitUtil.css(el, 'strokeDasharray', length);
|
|
223
222
|
|
|
224
|
-
if (unit === '%') {
|
|
225
|
-
steps = steps.map((step) => step * length / 100);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
steps = steps.reverse();
|
|
229
|
-
|
|
230
223
|
return (css, percent) => {
|
|
231
|
-
css.strokeDashoffset = getValue(
|
|
224
|
+
css.strokeDashoffset = getValue(stops, percent);
|
|
232
225
|
};
|
|
233
226
|
}
|
|
234
227
|
|
|
235
|
-
function backgroundFn(prop, el,
|
|
236
|
-
if (
|
|
237
|
-
|
|
228
|
+
function backgroundFn(prop, el, stops) {
|
|
229
|
+
if (stops.length === 1) {
|
|
230
|
+
stops.unshift(0);
|
|
238
231
|
}
|
|
239
232
|
|
|
240
233
|
prop = prop.substr(-1);
|
|
241
234
|
const attr = prop === 'y' ? 'height' : 'width';
|
|
242
|
-
|
|
235
|
+
stops = parseStops(stops, (stop) => uikitUtil.toPx(stop, attr, el));
|
|
243
236
|
|
|
244
237
|
const bgPos = getCssValue(el, "background-position-" + prop, '');
|
|
245
238
|
|
|
246
239
|
return getCssValue(el, 'backgroundSize', '') === 'cover' ?
|
|
247
|
-
backgroundCoverFn(prop, el,
|
|
248
|
-
setBackgroundPosFn(prop,
|
|
240
|
+
backgroundCoverFn(prop, el, stops, bgPos, attr) :
|
|
241
|
+
setBackgroundPosFn(prop, stops, bgPos);
|
|
249
242
|
}
|
|
250
243
|
|
|
251
|
-
function backgroundCoverFn(prop, el,
|
|
244
|
+
function backgroundCoverFn(prop, el, stops, bgPos, attr) {
|
|
252
245
|
const dimImage = getBackgroundImageDimensions(el);
|
|
253
246
|
|
|
254
247
|
if (!dimImage.width) {
|
|
255
248
|
return uikitUtil.noop;
|
|
256
249
|
}
|
|
257
250
|
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
const
|
|
251
|
+
const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
|
|
252
|
+
const min = Math.min(...values);
|
|
253
|
+
const max = Math.max(...values);
|
|
254
|
+
const down = values.indexOf(min) < values.indexOf(max);
|
|
261
255
|
|
|
262
256
|
const diff = max - min;
|
|
263
257
|
let pos = (down ? -diff : 0) - (down ? min : max);
|
|
@@ -282,7 +276,7 @@
|
|
|
282
276
|
|
|
283
277
|
const dim = uikitUtil.Dimensions.cover(dimImage, dimEl);
|
|
284
278
|
|
|
285
|
-
const fn = setBackgroundPosFn(prop,
|
|
279
|
+
const fn = setBackgroundPosFn(prop, stops, pos + "px");
|
|
286
280
|
return (css, percent) => {
|
|
287
281
|
fn(css, percent);
|
|
288
282
|
css.backgroundSize = dim.width + "px " + dim.height + "px";
|
|
@@ -290,9 +284,9 @@
|
|
|
290
284
|
};
|
|
291
285
|
}
|
|
292
286
|
|
|
293
|
-
function setBackgroundPosFn(prop,
|
|
287
|
+
function setBackgroundPosFn(prop, stops, pos) {
|
|
294
288
|
return function (css, percent) {
|
|
295
|
-
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(
|
|
289
|
+
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(stops, percent) + "px)";
|
|
296
290
|
};
|
|
297
291
|
}
|
|
298
292
|
|
|
@@ -326,27 +320,71 @@
|
|
|
326
320
|
|
|
327
321
|
}
|
|
328
322
|
|
|
329
|
-
function
|
|
330
|
-
const
|
|
331
|
-
const
|
|
323
|
+
function parseStops(stops, fn) {if (fn === void 0) {fn = uikitUtil.toFloat;}
|
|
324
|
+
const result = [];
|
|
325
|
+
const { length } = stops;
|
|
326
|
+
let nullIndex = 0;
|
|
327
|
+
for (let i = 0; i < length; i++) {
|
|
328
|
+
let [value, percent] = uikitUtil.isString(stops[i]) ? stops[i].trim().split(' ') : [stops[i]];
|
|
329
|
+
value = fn(value);
|
|
330
|
+
percent = percent ? uikitUtil.toFloat(percent) / 100 : null;
|
|
331
|
+
|
|
332
|
+
if (i === 0) {
|
|
333
|
+
if (percent === null) {
|
|
334
|
+
percent = 0;
|
|
335
|
+
} else if (percent) {
|
|
336
|
+
result.push([value, 0]);
|
|
337
|
+
}
|
|
338
|
+
} else if (i === length - 1) {
|
|
339
|
+
if (percent === null) {
|
|
340
|
+
percent = 1;
|
|
341
|
+
} else if (percent !== 1) {
|
|
342
|
+
result.push([value, percent]);
|
|
343
|
+
percent = 1;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
result.push([value, percent]);
|
|
348
|
+
|
|
349
|
+
if (percent === null) {
|
|
350
|
+
nullIndex++;
|
|
351
|
+
} else if (nullIndex) {
|
|
352
|
+
const leftPercent = result[i - nullIndex - 1][1];
|
|
353
|
+
const p = (percent - leftPercent) / (nullIndex + 1);
|
|
354
|
+
for (let j = nullIndex; j > 0; j--) {
|
|
355
|
+
result[i - j][1] = leftPercent + p * (nullIndex - j + 1);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
nullIndex = 0;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
return result;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function getStop(stops, percent) {
|
|
366
|
+
const index = uikitUtil.findIndex(stops.slice(1), (_ref3) => {let [, targetPercent] = _ref3;return percent <= targetPercent;}) + 1;
|
|
367
|
+
return [
|
|
368
|
+
stops[index - 1][0],
|
|
369
|
+
stops[index][0],
|
|
370
|
+
(percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])];
|
|
332
371
|
|
|
333
|
-
return steps.
|
|
334
|
-
slice(index, index + 2).
|
|
335
|
-
concat(percent === 1 ? 1 : percent % (1 / count) * count);
|
|
336
372
|
}
|
|
337
373
|
|
|
338
|
-
function getValue(
|
|
339
|
-
const [start, end, p] =
|
|
374
|
+
function getValue(stops, percent) {
|
|
375
|
+
const [start, end, p] = getStop(stops, percent);
|
|
340
376
|
return uikitUtil.isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
|
|
341
377
|
}
|
|
342
378
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
379
|
+
const unitRe = /^[\d-]+([^\s]+)/;
|
|
380
|
+
function getUnit(stops, defaultUnit) {
|
|
381
|
+
for (const stop of stops) {
|
|
382
|
+
const match = stop.match == null ? void 0 : stop.match(unitRe);
|
|
383
|
+
if (match) {
|
|
384
|
+
return match[1];
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return defaultUnit;
|
|
350
388
|
}
|
|
351
389
|
|
|
352
390
|
function getCssValue(el, prop, value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.92f357b93 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(r,g){typeof exports=="object"&&typeof module<"u"?module.exports=g(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslideshow_parallax",["uikit-util"],g):(r=typeof globalThis<"u"?globalThis:r||self,r.UIkitSlideshow_parallax=g(r.UIkit.util))})(this,function(r){"use strict";var g={props:{media:Boolean},data:{media:!1},computed:{matchMedia(){const e=_(this.media);return!e||window.matchMedia(e).matches}}};function _(e){if(r.isString(e)){if(e[0]==="@"){const t="breakpoint-"+e.substr(1);e=r.toFloat(r.getCssVar(t))}else if(isNaN(e))return e}return e&&!isNaN(e)?"(min-width: "+e+"px)":!1}r.memoize(async e=>e?r.startsWith(e,"data:")?decodeURIComponent(e.split(",")[1]):(await fetch(e)).text():Promise.reject());function q(e){return Math.ceil(Math.max(0,...r.$$("[stroke]",e).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const y={x:I,y:I,rotate:I,scale:I,color:v,backgroundColor:v,borderColor:v,blur:m,hue:m,fopacity:m,grayscale:m,invert:m,saturate:m,sepia:m,opacity:E,stroke:A,bgx:D,bgy:D},{keys:F}=Object;var H={mixins:[g],props:N(F(y),"list"),data:N(F(y),void 0),computed:{props(e,t){return F(y).reduce((n,o)=>(r.isUndefined(e[o])||(n[o]=y[o](o,t,e[o].slice())),n),{})}},events:{bgimageload(){this.$emit()}},methods:{reset(){r.each(this.getCss(0),(e,t)=>r.css(this.$el,t,""))},getCss(e){return F(this.props).reduce((t,n)=>(this.props[n](t,e),t),{transform:"",filter:""})}}};function I(e,t,n){const o=M(n)||{x:"px",y:"px",rotate:"deg"}[e]||"";let a;return(e==="x"||e==="y")&&(e="translate"+r.ucfirst(e),a=s=>r.toFloat(r.toFloat(s).toFixed(o==="px"?0:6))),n.length===1&&n.unshift(e==="scale"?1:0),n=l(n,a),(s,c)=>{s.transform+=" "+e+"("+x(n,c)+o+")"}}function v(e,t,n){return n.length===1&&n.unshift(b(t,e,"")),n=l(n,o=>L(t,o)),(o,a)=>{const[s,c,i]=T(n,a),u=s.map((d,f)=>(d+=i*(c[f]-d),f===3?r.toFloat(d):parseInt(d,10))).join(",");o[e]="rgba("+u+")"}}function L(e,t){return b(e,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(r.toFloat)}function m(e,t,n){n.length===1&&n.unshift(0);const o=M(n)||{blur:"px",hue:"deg"}[e]||"%";return e={fopacity:"opacity",hue:"hue-rotate"}[e]||e,n=l(n),(a,s)=>{const c=x(n,s);a.filter+=" "+e+"("+(c+o)+")"}}function E(e,t,n){return n.length===1&&n.unshift(b(t,e,"")),n=l(n),(o,a)=>{o[e]=x(n,a)}}function A(e,t,n){n.length===1&&n.unshift(0);const o=M(n),a=q(t);return n=l(n.reverse(),s=>(s=r.toFloat(s),o==="%"?s*a/100:s)),n.some(s=>{let[c]=s;return c})?(r.css(t,"strokeDasharray",a),(s,c)=>{s.strokeDashoffset=x(n,c)}):r.noop}function D(e,t,n){n.length===1&&n.unshift(0),e=e.substr(-1);const o=e==="y"?"height":"width";n=l(n,s=>r.toPx(s,o,t));const a=b(t,"background-position-"+e,"");return b(t,"backgroundSize","")==="cover"?G(e,t,n,a,o):S(e,n,a)}function G(e,t,n,o,a){const s=J(t);if(!s.width)return r.noop;const c=n.map(h=>{let[$]=h;return $}),i=Math.min(...c),u=Math.max(...c),d=c.indexOf(i)<c.indexOf(u),f=u-i;let B=(d?-f:0)-(d?i:u);const w={width:t.offsetWidth,height:t.offsetHeight},R=r.Dimensions.cover(s,w),P=R[a]-w[a];if(P<f)w[a]=R[a]+f-P;else if(P>f){const h=w[a]/r.toPx(o,a,t,!0);h&&(B-=(P-f)/h)}const V=r.Dimensions.cover(s,w),Q=S(e,n,B+"px");return(h,$)=>{Q(h,$),h.backgroundSize=V.width+"px "+V.height+"px",h.backgroundRepeat="no-repeat"}}function S(e,t,n){return function(o,a){o["background-position-"+e]="calc("+n+" + "+x(t,a)+"px)"}}const C={};function J(e){const t=r.css(e,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(C[t])return C[t];const n=new Image;return t&&(n.src=t,n.naturalWidth||(n.onload=()=>{C[t]=j(n),r.trigger(e,"bgimageload")})),C[t]=j(n)}function j(e){return{width:e.naturalWidth,height:e.naturalHeight}}function l(e,t){t===void 0&&(t=r.toFloat);const n=[],{length:o}=e;let a=0;for(let s=0;s<o;s++){let[c,i]=r.isString(e[s])?e[s].trim().split(" "):[e[s]];if(c=t(c),i=i?r.toFloat(i)/100:null,s===0?i===null?i=0:i&&n.push([c,0]):s===o-1&&(i===null?i=1:i!==1&&(n.push([c,i]),i=1)),n.push([c,i]),i===null)a++;else if(a){const u=n[s-a-1][1],d=(i-u)/(a+1);for(let f=a;f>0;f--)n[s-f][1]=u+d*(a-f+1);a=0}}return n}function T(e,t){const n=r.findIndex(e.slice(1),o=>{let[,a]=o;return t<=a})+1;return[e[n-1][0],e[n][0],(t-e[n-1][1])/(e[n][1]-e[n-1][1])]}function x(e,t){const[n,o,a]=T(e,t);return r.isNumber(n)?n+Math.abs(n-o)*a*(n<o?1:-1):+o}const K=/^[\d-]+([^\s]+)/;function M(e,t){for(const n of e){const o=n.match==null?void 0:n.match(K);if(o)return o[1]}return t}function b(e,t,n){const o=e.style[t],a=r.css(r.css(e,t,n),t);return e.style[t]=o,a}function N(e,t){return e.reduce((n,o)=>(n[o]=t,n),{})}var W={mixins:[H],data:{selItem:"!li"},computed:{item(e,t){let{selItem:n}=e;return r.query(n,t)}},events:[{name:"itemin itemout",self:!0,el(){return this.item},handler(e){let{type:t,detail:{percent:n,duration:o,timing:a,dir:s}}=e;r.fastdom.read(()=>{const c=this.getCss(z(t,s,n)),i=this.getCss(O(t)?.5:s>0?1:0);r.fastdom.write(()=>{r.css(this.$el,c),r.Transition.start(this.$el,i,o,a).catch(r.noop)})})}},{name:"transitioncanceled transitionend",self:!0,el(){return this.item},handler(){r.Transition.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el(){return this.item},handler(e){let{type:t,detail:{percent:n,dir:o}}=e;r.fastdom.read(()=>{const a=this.getCss(z(t,o,n));r.fastdom.write(()=>r.css(this.$el,a))})}}]};function O(e){return r.endsWith(e,"in")}function z(e,t,n){return n/=2,O(e)^t<0?n:1-n}return typeof window<"u"&&window.UIkit&&window.UIkit.component("slideshowParallax",W),W});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.92f357b93 | 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')) :
|
|
@@ -186,17 +186,17 @@
|
|
|
186
186
|
|
|
187
187
|
|
|
188
188
|
created() {
|
|
189
|
-
['start', 'move', 'end']
|
|
189
|
+
for (const key of ['start', 'move', 'end']) {
|
|
190
190
|
const fn = this[key];
|
|
191
191
|
this[key] = (e) => {
|
|
192
192
|
const pos = uikitUtil.getEventPos(e).x * (uikitUtil.isRtl ? -1 : 1);
|
|
193
193
|
|
|
194
|
-
this.prevPos = pos
|
|
194
|
+
this.prevPos = pos === this.pos ? this.prevPos : this.pos;
|
|
195
195
|
this.pos = pos;
|
|
196
196
|
|
|
197
197
|
fn(e);
|
|
198
198
|
};
|
|
199
|
-
}
|
|
199
|
+
}
|
|
200
200
|
},
|
|
201
201
|
|
|
202
202
|
events: [
|
|
@@ -434,7 +434,7 @@
|
|
|
434
434
|
methods: {
|
|
435
435
|
updateNav() {
|
|
436
436
|
const i = this.getValidIndex();
|
|
437
|
-
this.navItems
|
|
437
|
+
for (const el of this.navItems) {
|
|
438
438
|
const cmd = uikitUtil.data(el, this.attrItem);
|
|
439
439
|
|
|
440
440
|
uikitUtil.toggleClass(el, this.clsActive, uikitUtil.toNumber(cmd) === i);
|
|
@@ -444,7 +444,7 @@
|
|
|
444
444
|
this.finite && (
|
|
445
445
|
cmd === 'previous' && i === 0 || cmd === 'next' && i >= this.maxIndex));
|
|
446
446
|
|
|
447
|
-
}
|
|
447
|
+
}
|
|
448
448
|
} } };
|
|
449
449
|
|
|
450
450
|
var Slider = {
|
|
@@ -602,20 +602,13 @@
|
|
|
602
602
|
},
|
|
603
603
|
|
|
604
604
|
_show(prev, next, force) {
|
|
605
|
-
this._transitioner = this._getTransitioner(
|
|
606
|
-
prev,
|
|
607
|
-
next,
|
|
608
|
-
this.dir,
|
|
609
|
-
uikitUtil.assign(
|
|
610
|
-
{
|
|
605
|
+
this._transitioner = this._getTransitioner(prev, next, this.dir, {
|
|
611
606
|
easing: force ?
|
|
612
607
|
next.offsetWidth < 600 ?
|
|
613
608
|
'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */ :
|
|
614
609
|
'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */ :
|
|
615
|
-
this.easing
|
|
616
|
-
|
|
617
|
-
this.transitionOptions));
|
|
618
|
-
|
|
610
|
+
this.easing,
|
|
611
|
+
...this.transitionOptions });
|
|
619
612
|
|
|
620
613
|
|
|
621
614
|
if (!force && !prev) {
|
|
@@ -680,7 +673,7 @@
|
|
|
680
673
|
|
|
681
674
|
computed: {
|
|
682
675
|
animation(_ref) {let { animation, Animations } = _ref;
|
|
683
|
-
return
|
|
676
|
+
return { ...(Animations[animation] || Animations.slide), name: animation };
|
|
684
677
|
},
|
|
685
678
|
|
|
686
679
|
transitionOptions() {
|
|
@@ -705,7 +698,8 @@
|
|
|
705
698
|
uikitUtil.removeClass(target, this.clsActive, this.clsActivated);
|
|
706
699
|
} } };
|
|
707
700
|
|
|
708
|
-
var Animations =
|
|
701
|
+
var Animations = {
|
|
702
|
+
...Animations$1,
|
|
709
703
|
fade: {
|
|
710
704
|
show() {
|
|
711
705
|
return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
|
|
@@ -794,7 +788,7 @@
|
|
|
794
788
|
{ transform: translate(-30 * percent), zIndex: -1 },
|
|
795
789
|
{ transform: translate(100 * (1 - percent)), zIndex: 0 }];
|
|
796
790
|
|
|
797
|
-
} } }
|
|
791
|
+
} } };
|
|
798
792
|
|
|
799
793
|
var SliderReactive = {
|
|
800
794
|
update: {
|
|
@@ -812,8 +806,44 @@
|
|
|
812
806
|
|
|
813
807
|
events: ['resize'] } };
|
|
814
808
|
|
|
809
|
+
var SliderPreload = {
|
|
810
|
+
connected() {
|
|
811
|
+
if (window.IntersectionObserver) {
|
|
812
|
+
this.observer = new IntersectionObserver(
|
|
813
|
+
(entries) => {
|
|
814
|
+
if (entries.some((entry) => entry.isIntersecting)) {
|
|
815
|
+
removeLazyLoad(this.getAdjacentSlides());
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
{ rootMargin: '50% 50%' });
|
|
819
|
+
|
|
820
|
+
this.observer.observe(this.$el);
|
|
821
|
+
}
|
|
822
|
+
},
|
|
823
|
+
|
|
824
|
+
disconnected() {
|
|
825
|
+
this.observer && this.observer.disconnect();
|
|
826
|
+
},
|
|
827
|
+
|
|
828
|
+
update: {
|
|
829
|
+
read() {
|
|
830
|
+
if (uikitUtil.isVisible(this.$el)) {
|
|
831
|
+
removeLazyLoad(this.getAdjacentSlides());
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
|
|
835
|
+
events: ['resize'] } };
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
function removeLazyLoad(elements) {if (elements === void 0) {elements = [];}
|
|
840
|
+
for (const el of elements) {
|
|
841
|
+
el && uikitUtil.$$('img[loading="lazy"]', el).forEach((el) => uikitUtil.removeAttr(el, 'loading'));
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
|
|
815
845
|
var Component = {
|
|
816
|
-
mixins: [Class, Slideshow, SliderReactive],
|
|
846
|
+
mixins: [Class, Slideshow, SliderReactive, SliderPreload],
|
|
817
847
|
|
|
818
848
|
props: {
|
|
819
849
|
ratio: String,
|
|
@@ -856,7 +886,13 @@
|
|
|
856
886
|
height > 0 && uikitUtil.css(this.list, 'minHeight', height);
|
|
857
887
|
},
|
|
858
888
|
|
|
859
|
-
events: ['resize'] }
|
|
889
|
+
events: ['resize'] },
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
methods: {
|
|
893
|
+
getAdjacentSlides() {
|
|
894
|
+
return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);
|
|
895
|
+
} } };
|
|
860
896
|
|
|
861
897
|
if (typeof window !== 'undefined' && window.UIkit) {
|
|
862
898
|
window.UIkit.component('slideshow', Component);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.7dd548556 | 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("uikitslideshow",["uikit-util"],p):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitSlideshow=p(s.UIkit.util))})(this,function(s){"use strict";var p={connected(){!s.hasClass(this.$el,this.$name)&&s.addClass(this.$el,this.$name)}},I={slide:{show(t){return[{transform:r(t*-100)},{transform:r()}]},percent(t){return v(t)},translate(t,e){return[{transform:r(e*-100*t)},{transform:r(e*100*(1-t))}]}}};function v(t){return Math.abs(s.css(t,"transform").split(",")[4]/t.offsetWidth)||0}function r(t,e){return t===void 0&&(t=0),e===void 0&&(e="%"),t+=t?e:"","translate3d("+t+", 0, 0)"}function w(t){return"scale3d("+t+", "+t+", 1)"}function z(t,e,n,i){let{animation:m,easing:d}=i;const{percent:a,translate:g,show:l=s.noop}=m,f=l(n),c=new s.Deferred;return{dir:n,show(h,o,M){o===void 0&&(o=0);const x=M?"linear":d;return h-=Math.round(h*s.clamp(o,-1,1)),this.translate(o),u(e,"itemin",{percent:o,duration:h,timing:x,dir:n}),u(t,"itemout",{percent:1-o,duration:h,timing:x,dir:n}),Promise.all([s.Transition.start(e,f[1],h,x),s.Transition.start(t,f[0],h,x)]).then(()=>{this.reset(),c.resolve()},s.noop),c.promise},cancel(){s.Transition.cancel([e,t])},reset(){for(const h in f[0])s.css([e,t],h,"")},forward(h,o){return o===void 0&&(o=this.percent()),s.Transition.cancel([e,t]),this.show(h,o,!0)},translate(h){this.reset();const o=g(h,n);s.css(e,o[1]),s.css(t,o[0]),u(e,"itemtranslatein",{percent:h,dir:n}),u(t,"itemtranslateout",{percent:1-h,dir:n})},percent(){return a(t||e,e,n)},getDistance(){return t==null?void 0:t.offsetWidth}}}function u(t,e,n){s.trigger(t,s.createEvent(e,!1,!1,n))}var y={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)}}},_={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){["start","move","end"].forEach(t=>{const e=this[t];this[t]=n=>{const i=s.getEventPos(n).x*(s.isRtl?-1:1);this.prevPos=i!==this.pos?this.pos:this.prevPos,this.pos=i,e(n)}})},events:[{name:s.pointerDown,delegate(){return this.selSlides},handler(t){!this.draggable||!s.isTouch(t)&&A(t.target)||s.closest(t.target,s.selInput)||t.button>0||this.length<2||this.start(t)}},{name:"dragstart",handler(t){t.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(t){const e=this.pos-this.drag;if(e===0||this.prevPos===this.pos||!this.dragging&&Math.abs(e)<this.threshold)return;s.css(this.list,"pointerEvents","none"),t.cancelable&&t.preventDefault(),this.dragging=!0,this.dir=e<0?1:-1;const{slides:n}=this;let{prevIndex:i}=this,m=Math.abs(e),d=this.getIndex(i+this.dir,i),a=this._getDistance(i,d)||n[i].offsetWidth;for(;d!==i&&m>a;)this.drag-=a*this.dir,i=d,m-=a,d=this.getIndex(i+this.dir,i),a=this._getDistance(i,d)||n[i].offsetWidth;this.percent=m/a;const g=n[i],l=n[d],f=this.index!==d,c=i===d;let h;[this.index,this.prevIndex].filter(o=>!s.includes([d,i],o)).forEach(o=>{s.trigger(n[o],"itemhidden",[this]),c&&(h=!0,this.prevIndex=i)}),(this.index===i&&this.prevIndex!==i||h)&&s.trigger(n[this.index],"itemshown",[this]),f&&(this.prevIndex=i,this.index=d,!c&&s.trigger(g,"beforeitemhide",[this]),s.trigger(l,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),g,!c&&l),f&&(!c&&s.trigger(g,"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 t=(s.isRtl?this.dir*(s.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=t?this.index:this.prevIndex,t&&(this.percent=1-this.percent),this.show(this.dir>0&&!t||this.dir<0&&t?"next":"previous",!0)}s.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function A(t){return!t.children.length&&t.childNodes.length}var N={data:{selNav:!1},computed:{nav(t,e){let{selNav:n}=t;return s.$(n,e)},selNavItem(t){let{attrItem:e}=t;return"["+e+"],[data-"+e+"]"},navItems(t,e){return s.$$(this.selNavItem,e)}},update:{write(){this.nav&&this.length!==this.nav.children.length&&s.html(this.nav,this.slides.map((t,e)=>"<li "+this.attrItem+'="'+e+'"><a href></a></li>').join("")),this.navItems.concat(this.nav).forEach(t=>t&&(t.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]},events:[{name:"click",delegate(){return this.selNavItem},handler(t){t.preventDefault(),this.show(s.data(t.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav(){const t=this.getValidIndex();this.navItems.forEach(e=>{const n=s.data(e,this.attrItem);s.toggleClass(e,this.clsActive,s.toNumber(n)===t),s.toggleClass(e,"uk-invisible",this.finite&&(n==="previous"&&t===0||n==="next"&&t>=this.maxIndex))})}}},S={mixins:[y,_,N],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(t,e){let{velocity:n}=t;return T(e.offsetWidth/n)},list(t,e){let{selList:n}=t;return s.$(n,e)},maxIndex(){return this.length-1},selSlides(t){let{selList:e,selSlides:n}=t;return e+" "+(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(t,e){if(e===void 0&&(e=!1),this.dragging||!this.length)return;const{stack:n}=this,i=e?0:n.length,m=()=>{n.splice(i,1),n.length&&this.show(n.shift(),!0)};if(n[e?"unshift":"push"](t),!e&&n.length>1){n.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}const d=this.getIndex(this.index),a=s.hasClass(this.slides,this.clsActive)&&this.slides[d],g=this.getIndex(t,this.index),l=this.slides[g];if(a===l){m();return}if(this.dir=$(t,d),this.prevIndex=d,this.index=g,a&&!s.trigger(a,"beforeitemhide",[this])||!s.trigger(l,"beforeitemshow",[this,a])){this.index=this.prevIndex,m();return}const f=this._show(a,l,e).then(()=>(a&&s.trigger(a,"itemhidden",[this]),s.trigger(l,"itemshown",[this]),new Promise(c=>{s.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,c()})})));return a&&s.trigger(a,"itemhide",[this]),s.trigger(l,"itemshow",[this]),f},getIndex(t,e){return t===void 0&&(t=this.index),e===void 0&&(e=this.index),s.clamp(s.getIndex(t,this.slides,e,this.finite),0,this.maxIndex)},getValidIndex(t,e){return t===void 0&&(t=this.index),e===void 0&&(e=this.prevIndex),this.getIndex(t,e)},_show(t,e,n){if(this._transitioner=this._getTransitioner(t,e,this.dir,s.assign({easing:n?e.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&&!t)return this._translate(1),Promise.resolve();const{length:i}=this.stack;return this._transitioner[i>1?"forward":"show"](i>1?Math.min(this.duration,75+75/(i-1)):this.duration,this.percent)},_getDistance(t,e){return this._getTransitioner(t,t!==e&&e).getDistance()},_translate(t,e,n){e===void 0&&(e=this.prevIndex),n===void 0&&(n=this.index);const i=this._getTransitioner(e!==n?e:!1,n);return i.translate(t),i},_getTransitioner(t,e,n,i){return t===void 0&&(t=this.prevIndex),e===void 0&&(e=this.index),n===void 0&&(n=this.dir||1),i===void 0&&(i=this.transitionOptions),new this.Transitioner(s.isNumber(t)?this.slides[t]:t,s.isNumber(e)?this.slides[e]:e,n*(s.isRtl?-1:1),i)}}};function $(t,e){return t==="next"?1:t==="previous"||t<e?-1:1}function T(t){return .5*t+300}var C={mixins:[S],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:I,Transitioner:z},computed:{animation(t){let{animation:e,Animations:n}=t;return s.assign(n[e]||n.slide,{name:e})},transitionOptions(){return{animation:this.animation}}},events:{"itemshow itemhide itemshown itemhidden"(t){let{target:e}=t;this.$update(e)},beforeitemshow(t){let{target:e}=t;s.addClass(e,this.clsActive)},itemshown(t){let{target:e}=t;s.addClass(e,this.clsActivated)},itemhidden(t){let{target:e}=t;s.removeClass(e,this.clsActive,this.clsActivated)}}},D=s.assign({},I,{fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(t){return 1-s.css(t,"opacity")},translate(t){return[{opacity:1-t,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:w(1+.5),zIndex:0},{zIndex:-1}]},percent(t){return 1-s.css(t,"opacity")},translate(t){return[{opacity:1-t,transform:w(1+.5*t),zIndex:0},{zIndex:-1}]}},pull:{show(t){return t<0?[{transform:r(30),zIndex:-1},{transform:r(),zIndex:0}]:[{transform:r(-100),zIndex:0},{transform:r(),zIndex:-1}]},percent(t,e,n){return n<0?1-v(e):v(t)},translate(t,e){return e<0?[{transform:r(30*t),zIndex:-1},{transform:r(-100*(1-t)),zIndex:0}]:[{transform:r(-t*100),zIndex:0},{transform:r(30*(1-t)),zIndex:-1}]}},push:{show(t){return t<0?[{transform:r(100),zIndex:0},{transform:r(),zIndex:-1}]:[{transform:r(-30),zIndex:-1},{transform:r(),zIndex:0}]},percent(t,e,n){return n>0?1-v(e):v(t)},translate(t,e){return e<0?[{transform:r(t*100),zIndex:0},{transform:r(-30*(1-t)),zIndex:-1}]:[{transform:r(-30*t),zIndex:-1},{transform:r(100*(1-t)),zIndex:0}]}}}),H={update:{write(){if(this.stack.length||this.dragging)return;const t=this.getValidIndex(this.index);(!~this.prevIndex||this.index!==t)&&this.show(t)},events:["resize"]}},b={mixins:[p,C,H],props:{ratio:String,minHeight:Number,maxHeight:Number},data:{ratio:"16:9",minHeight:!1,maxHeight:!1,selList:".uk-slideshow-items",attrItem:"uk-slideshow-item",selNav:".uk-slideshow-nav",Animations:D},update:{read(){if(!this.list)return!1;let[t,e]=this.ratio.split(":").map(Number);return e=e*this.list.offsetWidth/t||0,this.minHeight&&(e=Math.max(this.minHeight,e)),this.maxHeight&&(e=Math.min(this.maxHeight,e)),{height:e-s.boxModelAdjust(this.list,"height","content-box")}},write(t){let{height:e}=t;e>0&&s.css(this.list,"minHeight",e)},events:["resize"]}};return typeof window<"u"&&window.UIkit&&window.UIkit.component("slideshow",b),b});
|
|
1
|
+
/*! UIkit 3.11.2-dev.92f357b93 | 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("uikitslideshow",["uikit-util"],p):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitSlideshow=p(s.UIkit.util))})(this,function(s){"use strict";var p={connected(){!s.hasClass(this.$el,this.$name)&&s.addClass(this.$el,this.$name)}},I={slide:{show(e){return[{transform:r(e*-100)},{transform:r()}]},percent(e){return v(e)},translate(e,t){return[{transform:r(t*-100*e)},{transform:r(t*100*(1-e))}]}}};function v(e){return Math.abs(s.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function r(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)"}function z(e,t,n,i){let{animation:f,easing:d}=i;const{percent:a,translate:g,show:l=s.noop}=f,m=l(n),c=new s.Deferred;return{dir:n,show(h,o,P){o===void 0&&(o=0);const x=P?"linear":d;return h-=Math.round(h*s.clamp(o,-1,1)),this.translate(o),u(t,"itemin",{percent:o,duration:h,timing:x,dir:n}),u(e,"itemout",{percent:1-o,duration:h,timing:x,dir:n}),Promise.all([s.Transition.start(t,m[1],h,x),s.Transition.start(e,m[0],h,x)]).then(()=>{this.reset(),c.resolve()},s.noop),c.promise},cancel(){s.Transition.cancel([t,e])},reset(){for(const h in m[0])s.css([t,e],h,"")},forward(h,o){return o===void 0&&(o=this.percent()),s.Transition.cancel([t,e]),this.show(h,o,!0)},translate(h){this.reset();const o=g(h,n);s.css(t,o[1]),s.css(e,o[0]),u(t,"itemtranslatein",{percent:h,dir:n}),u(e,"itemtranslateout",{percent:1-h,dir:n})},percent(){return a(e||t,t,n)},getDistance(){return e==null?void 0:e.offsetWidth}}}function u(e,t,n){s.trigger(e,s.createEvent(t,!1,!1,n))}var A={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)}}},_={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const e of["start","move","end"]){const t=this[e];this[e]=n=>{const i=s.getEventPos(n).x*(s.isRtl?-1:1);this.prevPos=i===this.pos?this.prevPos:this.pos,this.pos=i,t(n)}}},events:[{name:s.pointerDown,delegate(){return this.selSlides},handler(e){!this.draggable||!s.isTouch(e)&&S(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:i}=this,f=Math.abs(t),d=this.getIndex(i+this.dir,i),a=this._getDistance(i,d)||n[i].offsetWidth;for(;d!==i&&f>a;)this.drag-=a*this.dir,i=d,f-=a,d=this.getIndex(i+this.dir,i),a=this._getDistance(i,d)||n[i].offsetWidth;this.percent=f/a;const g=n[i],l=n[d],m=this.index!==d,c=i===d;let h;[this.index,this.prevIndex].filter(o=>!s.includes([d,i],o)).forEach(o=>{s.trigger(n[o],"itemhidden",[this]),c&&(h=!0,this.prevIndex=i)}),(this.index===i&&this.prevIndex!==i||h)&&s.trigger(n[this.index],"itemshown",[this]),m&&(this.prevIndex=i,this.index=d,!c&&s.trigger(g,"beforeitemhide",[this]),s.trigger(l,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),g,!c&&l),m&&(!c&&s.trigger(g,"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 S(e){return!e.children.length&&e.childNodes.length}var $={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))}}}},N={mixins:[A,_,$],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 C(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,i=t?0:n.length,f=()=>{n.splice(i,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 d=this.getIndex(this.index),a=s.hasClass(this.slides,this.clsActive)&&this.slides[d],g=this.getIndex(e,this.index),l=this.slides[g];if(a===l){f();return}if(this.dir=T(e,d),this.prevIndex=d,this.index=g,a&&!s.trigger(a,"beforeitemhide",[this])||!s.trigger(l,"beforeitemshow",[this,a])){this.index=this.prevIndex,f();return}const m=this._show(a,l,t).then(()=>(a&&s.trigger(a,"itemhidden",[this]),s.trigger(l,"itemshown",[this]),new Promise(c=>{s.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,c()})})));return a&&s.trigger(a,"itemhide",[this]),s.trigger(l,"itemshow",[this]),m},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:i}=this.stack;return this._transitioner[i>1?"forward":"show"](i>1?Math.min(this.duration,75+75/(i-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 i=this._getTransitioner(t!==n?t:!1,n);return i.translate(e),i},_getTransitioner(e,t,n,i){return e===void 0&&(e=this.prevIndex),t===void 0&&(t=this.index),n===void 0&&(n=this.dir||1),i===void 0&&(i=this.transitionOptions),new this.Transitioner(s.isNumber(e)?this.slides[e]:e,s.isNumber(t)?this.slides[t]:t,n*(s.isRtl?-1:1),i)}}};function T(e,t){return e==="next"?1:e==="previous"||e<t?-1:1}function C(e){return .5*e+300}var D={mixins:[N],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:I,Transitioner:z},computed:{animation(e){let{animation:t,Animations:n}=e;return{...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)}}},M={...I,fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:w(1+.5),zIndex:0},{zIndex:-1}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e,transform:w(1+.5*e),zIndex:0},{zIndex:-1}]}},pull:{show(e){return e<0?[{transform:r(30),zIndex:-1},{transform:r(),zIndex:0}]:[{transform:r(-100),zIndex:0},{transform:r(),zIndex:-1}]},percent(e,t,n){return n<0?1-v(t):v(e)},translate(e,t){return t<0?[{transform:r(30*e),zIndex:-1},{transform:r(-100*(1-e)),zIndex:0}]:[{transform:r(-e*100),zIndex:0},{transform:r(30*(1-e)),zIndex:-1}]}},push:{show(e){return e<0?[{transform:r(100),zIndex:0},{transform:r(),zIndex:-1}]:[{transform:r(-30),zIndex:-1},{transform:r(),zIndex:0}]},percent(e,t,n){return n>0?1-v(t):v(e)},translate(e,t){return t<0?[{transform:r(e*100),zIndex:0},{transform:r(-30*(1-e)),zIndex:-1}]:[{transform:r(-30*e),zIndex:-1},{transform:r(100*(1-e)),zIndex:0}]}}},H={update:{write(){if(this.stack.length||this.dragging)return;const e=this.getValidIndex(this.index);(!~this.prevIndex||this.index!==e)&&this.show(e)},events:["resize"]}},O={connected(){window.IntersectionObserver&&(this.observer=new IntersectionObserver(e=>{e.some(t=>t.isIntersecting)&&b(this.getAdjacentSlides())},{rootMargin:"50% 50%"}),this.observer.observe(this.$el))},disconnected(){this.observer&&this.observer.disconnect()},update:{read(){s.isVisible(this.$el)&&b(this.getAdjacentSlides())},events:["resize"]}};function b(e){e===void 0&&(e=[]);for(const t of e)t&&s.$$('img[loading="lazy"]',t).forEach(n=>s.removeAttr(n,"loading"))}var y={mixins:[p,D,H,O],props:{ratio:String,minHeight:Number,maxHeight:Number},data:{ratio:"16:9",minHeight:!1,maxHeight:!1,selList:".uk-slideshow-items",attrItem:"uk-slideshow-item",selNav:".uk-slideshow-nav",Animations:M},update:{read(){if(!this.list)return!1;let[e,t]=this.ratio.split(":").map(Number);return t=t*this.list.offsetWidth/e||0,this.minHeight&&(t=Math.max(this.minHeight,t)),this.maxHeight&&(t=Math.min(this.maxHeight,t)),{height:t-s.boxModelAdjust(this.list,"height","content-box")}},write(e){let{height:t}=e;t>0&&s.css(this.list,"minHeight",t)},events:["resize"]},methods:{getAdjacentSlides(){return[1,-1].map(e=>this.slides[this.getIndex(this.index+e)])}}};return typeof window<"u"&&window.UIkit&&window.UIkit.component("slideshow",y),y});
|