uikit 3.16.16-dev.4d5c42e53 → 3.16.16-dev.7b3ba4436
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 +6 -0
- 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 +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +26 -25
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +26 -25
- 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 +2 -2
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +2 -2
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +26 -25
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +2 -2
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +26 -25
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +1 -1
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +21 -30
- 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 +61 -67
- package/dist/js/uikit.min.js +1 -1
- package/package.json +7 -7
- package/src/js/api/global.js +1 -1
- package/src/js/components/internal/slider-transitioner.js +15 -15
- package/src/js/components/slider.js +2 -1
- package/src/js/core/drop.js +2 -2
- package/src/js/core/modal.js +19 -21
- package/src/js/mixin/internal/slideshow-transitioner.js +16 -14
- package/src/js/mixin/parallax.js +2 -1
- package/src/js/mixin/slider-drag.js +12 -6
- package/src/js/mixin/slider-nav.js +1 -1
- package/src/js/mixin/slider.js +3 -17
- package/src/js/util/lang.js +0 -9
- package/tests/modal.html +16 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.16.16-dev.
|
|
1
|
+
/*! UIkit 3.16.16-dev.7b3ba4436 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */(function(i,b){typeof exports=="object"&&typeof module<"u"?module.exports=b(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitparallax",["uikit-util"],b):(i=typeof globalThis<"u"?globalThis:i||self,i.UIkitParallax=b(i.UIkit.util))})(this,function(i){"use strict";var b={props:{media:Boolean},data:{media:!1},connected(){const n=X(this.media,this.$el);if(this.matchMedia=!0,n){this.mediaObj=window.matchMedia(n);const t=()=>{this.matchMedia=this.mediaObj.matches,i.trigger(this.$el,i.createEvent("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=i.on(this.mediaObj,"change",()=>{t(),this.$emit("resize")}),t()}},disconnected(){var n;(n=this.offMediaObj)==null||n.call(this)}};function X(n,t){if(i.isString(n)){if(i.startsWith(n,"@"))n=i.toFloat(i.css(t,`--uk-breakpoint-${n.substr(1)}`));else if(isNaN(n))return n}return n&&i.isNumeric(n)?`(min-width: ${n}px)`:""}function E(n,t){var e;return(e=n==null?void 0:n.startsWith)==null?void 0:e.call(n,t)}const{isArray:zn,from:Y}=Array;function Z(n){return typeof n=="function"}function M(n){return n!==null&&typeof n=="object"}function k(n){return M(n)&&n===n.window}function I(n){return z(n)>=1}function U(n){return z(n)===1}function z(n){return!k(n)&&M(n)&&n.nodeType}function O(n){return typeof n=="string"}function nn(n){return n===void 0}function x(n){return u(n)[0]}function u(n){return I(n)?[n]:Array.from(n||[]).filter(I)}function j(n){const t=Object.create(null);return e=>t[e]||(t[e]=n(e))}function N(n,t,e){var o;if(M(t)){for(const r in t)N(n,r,t[r]);return}if(nn(e))return(o=x(n))==null?void 0:o.getAttribute(t);for(const r of u(n))Z(e)&&(e=e.call(r,N(r,t))),e===null?tn(r,t):r.setAttribute(t,e)}function tn(n,t){u(n).forEach(e=>e.removeAttribute(t))}function T(n){var t;return(t=x(n))==null?void 0:t.parentElement}function en(n,t){return u(n).filter(e=>R(e,t))}function R(n,t){return u(n).some(e=>e.matches(t))}function W(n,t){return U(n)?n.closest(E(t,">")?t.slice(1):t):u(n).map(e=>W(e,t)).filter(Boolean)}function rn(n,t){n=x(n);const e=n?Y(n.children):[];return t?en(e,t):e}function on(n,t){return t?u(n).indexOf(x(t)):rn(T(n)).indexOf(n)}function sn(n,t){return u(dn(n,x(t),"querySelectorAll"))}const cn=/(^|[^\\],)\s*[!>+~-]/,an=j(n=>n.match(cn)),fn=/([!>+~-])(?=\s+[!>+~-]|\s*$)/g,un=j(n=>n.replace(fn,"$1 *"));function dn(n,t=document,e){if(!n||!O(n))return n;if(n=un(n),an(n)){const o=ln(n);n="";for(let r of o){let s=t;if(r[0]==="!"){const a=r.substr(1).trim().split(" ");if(s=W(T(t),a[0]),r=a.slice(1).join(" ").trim(),!r.length&&o.length===1)return s}if(r[0]==="-"){const a=r.substr(1).trim().split(" "),c=(s||t).previousElementSibling;s=R(c,r.substr(1))?c:null,r=a.slice(1).join(" ")}s&&(n+=`${n?",":""}${gn(s)} ${r}`)}t=document}try{return t[e](n)}catch{return null}}const hn=/.*?[^\\](?:,|$)/g,ln=j(n=>n.match(hn).map(t=>t.replace(/,$/,"").trim()));function gn(n){const t=[];for(;n.parentNode;){const e=N(n,"id");if(e){t.unshift(`#${mn(e)}`);break}else{let{tagName:o}=n;o!=="HTML"&&(o+=`:nth-child(${on(n)+1})`),t.unshift(o),n=n.parentNode}}return t.join(" > ")}function mn(n){return O(n)?CSS.escape(n):""}const bn=/^\s*<(\w+|!)[^>]*>/,xn=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;function $n(n){const t=xn.exec(n);if(t)return document.createElement(t[1]);const e=document.createElement("div");return bn.test(n)?e.insertAdjacentHTML("beforeend",n.trim()):e.textContent=n,yn(e.childNodes)}function yn(n){return n.length>1?n:n[0]}function pn(n,t){return wn(n)?u($n(n)):sn(n,t)}function wn(n){return O(n)&&E(n.trim(),"<")}function vn(n){return Math.ceil(Math.max(0,...pn("[stroke]",n).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const w={x:v,y:v,rotate:v,scale:v,color:P,backgroundColor:P,borderColor:P,blur:g,hue:g,fopacity:g,grayscale:g,invert:g,saturate:g,sepia:g,opacity:Mn,stroke:On,bgx:B,bgy:B},{keys:_}=Object;var Sn={mixins:[b],props:L(_(w),"list"),data:L(_(w),void 0),computed:{props(n,t){const e={};for(const r in n)r in w&&!i.isUndefined(n[r])&&(e[r]=n[r].slice());const o={};for(const r in e)o[r]=w[r](r,t,e[r],e);return o}},events:{load(){this.$emit()}},methods:{reset(){for(const n in this.getCss(0))i.css(this.$el,n,"")},getCss(n){const t={transform:"",filter:""};for(const e in this.props)this.props[e](t,i.clamp(n));return t.willChange=Object.keys(t).filter(e=>t[e]!=="").map(i.propName).join(","),t}}};function v(n,t,e){let o=F(e)||{x:"px",y:"px",rotate:"deg"}[n]||"",r;return n==="x"||n==="y"?(n=`translate${i.ucfirst(n)}`,r=s=>i.toFloat(i.toFloat(s).toFixed(o==="px"?0:6))):n==="scale"&&(o="",r=s=>F([s])?i.toPx(s,"width",t,!0)/t.offsetWidth:s),e.length===1&&e.unshift(n==="scale"?1:0),e=m(e,r),(s,a)=>{s.transform+=` ${n}(${$(e,a)}${o})`}}function P(n,t,e){return e.length===1&&e.unshift(y(t,n,"")),e=m(e,o=>Fn(t,o)),(o,r)=>{const[s,a,c]=q(e,r),h=s.map((l,f)=>(l+=c*(a[f]-l),f===3?i.toFloat(l):parseInt(l,10))).join(",");o[n]=`rgba(${h})`}}function Fn(n,t){return y(n,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(i.toFloat)}function g(n,t,e){e.length===1&&e.unshift(0);const o=F(e)||{blur:"px",hue:"deg"}[n]||"%";return n={fopacity:"opacity",hue:"hue-rotate"}[n]||n,e=m(e),(r,s)=>{const a=$(e,s);r.filter+=` ${n}(${a+o})`}}function Mn(n,t,e){return e.length===1&&e.unshift(y(t,n,"")),e=m(e),(o,r)=>{o[n]=$(e,r)}}function On(n,t,e){e.length===1&&e.unshift(0);const o=F(e),r=vn(t);return e=m(e.reverse(),s=>(s=i.toFloat(s),o==="%"?s*r/100:s)),e.some(([s])=>s)?(i.css(t,"strokeDasharray",r),(s,a)=>{s.strokeDashoffset=$(e,a)}):i.noop}function B(n,t,e,o){e.length===1&&e.unshift(0);const r=n==="bgy"?"height":"width";o[n]=m(e,c=>i.toPx(c,r,t));const s=["bgx","bgy"].filter(c=>c in o);if(s.length===2&&n==="bgx")return i.noop;if(y(t,"backgroundSize","")==="cover")return jn(n,t,e,o);const a={};for(const c of s)a[c]=D(t,c);return H(s,a,o)}function jn(n,t,e,o){const r=Nn(t);if(!r.width)return i.noop;const s={width:t.offsetWidth,height:t.offsetHeight},a=["bgx","bgy"].filter(f=>f in o),c={};for(const f of a){const d=o[f].map(([In])=>In),p=Math.min(...d),A=Math.max(...d),K=d.indexOf(p)<d.indexOf(A),Q=A-p;c[f]=`${(K?-Q:0)-(K?p:A)}px`,s[f==="bgy"?"height":"width"]+=Q}const h=i.Dimensions.cover(r,s);for(const f of a){const d=f==="bgy"?"height":"width",p=h[d]-s[d];c[f]=`max(${D(t,f)},-${p}px) + ${c[f]}`}const l=H(a,c,o);return(f,d)=>{l(f,d),f.backgroundSize=`${h.width}px ${h.height}px`,f.backgroundRepeat="no-repeat"}}function D(n,t){return y(n,`background-position-${t.substr(-1)}`,"")}function H(n,t,e){return function(o,r){for(const s of n){const a=$(e[s],r);o[`background-position-${s.substr(-1)}`]=`calc(${t[s]} + ${a}px)`}}}const S={};function Nn(n){const t=i.css(n,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(S[t])return S[t];const e=new Image;return t&&(e.src=t,!e.naturalWidth)?(e.onload=()=>{S[t]=C(e),i.trigger(n,i.createEvent("load",!1))},C(e)):S[t]=C(e)}function C(n){return{width:n.naturalWidth,height:n.naturalHeight}}function m(n,t=i.toFloat){const e=[],{length:o}=n;let r=0;for(let s=0;s<o;s++){let[a,c]=i.isString(n[s])?n[s].trim().split(/ (?![^(]*\))/):[n[s]];if(a=t(a),c=c?i.toFloat(c)/100:null,s===0?c===null?c=0:c&&e.push([a,0]):s===o-1&&(c===null?c=1:c!==1&&(e.push([a,c]),c=1)),e.push([a,c]),c===null)r++;else if(r){const h=e[s-r-1][1],l=(c-h)/(r+1);for(let f=r;f>0;f--)e[s-f][1]=h+l*(r-f+1);r=0}}return e}function q(n,t){const e=i.findIndex(n.slice(1),([,o])=>t<=o)+1;return[n[e-1][0],n[e][0],(t-n[e-1][1])/(n[e][1]-n[e-1][1])]}function $(n,t){const[e,o,r]=q(n,t);return i.isNumber(e)?e+Math.abs(e-o)*r*(e<o?1:-1):+o}const Pn=/^-?\d+(\S+)?/;function F(n,t){var e;for(const o of n){const r=(e=o.match)==null?void 0:e.call(o,Pn);if(r)return r[1]}return t}function y(n,t,e){const o=n.style[t],r=i.css(i.css(n,t,e),t);return n.style[t]=o,r}function L(n,t){return n.reduce((e,o)=>(e[o]=t,e),{})}function Cn(n){return V(i.observeResize,n,"resize")}function An(n){return V(function(t,e){return{disconnect:i.on(t,"scroll",e,{passive:!0,capture:!0})}},{target:()=>window,...n},"scroll")}function V(n,t,e){return{observe:n,handler(){this.$emit(e)},...t}}var G={mixins:[Sn],props:{target:String,viewport:Number,easing:Number,start:String,end:String},data:{target:!1,viewport:1,easing:1,start:0,end:0},computed:{target({target:n},t){return J(n&&i.query(n,t)||t)},start({start:n}){return i.toPx(n,"height",this.target,!0)},end({end:n,viewport:t}){return i.toPx(n||(t=(1-t)*100)&&`${t}vh+${t}%`,"height",this.target,!0)}},observe:[Cn({target:({$el:n,target:t})=>[n,t]}),An()],update:{read({percent:n},t){if(t.has("scroll")||(n=!1),!i.isVisible(this.$el))return!1;if(!this.matchMedia)return;const e=n;return n=En(i.scrolledOver(this.target,this.start,this.end),this.easing),{percent:n,style:e===n?!1:this.getCss(n)}},write({style:n}){if(!this.matchMedia){this.reset();return}n&&i.css(this.$el,n)},events:["scroll","resize"]}};function En(n,t){return t>=0?Math.pow(n,t+1):1-Math.pow(1-n,1-t)}function J(n){return n?"offsetTop"in n?n:J(i.parent(n)):document.documentElement}return typeof window<"u"&&window.UIkit&&window.UIkit.component("parallax",G),G});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.16.16-dev.
|
|
1
|
+
/*! UIkit 3.16.16-dev.7b3ba4436 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
|
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
getCss(percent) {
|
|
298
298
|
const css2 = { transform: "", filter: "" };
|
|
299
299
|
for (const prop in this.props) {
|
|
300
|
-
this.props[prop](css2, percent);
|
|
300
|
+
this.props[prop](css2, uikitUtil.clamp(percent));
|
|
301
301
|
}
|
|
302
302
|
css2.willChange = Object.keys(css2).filter((key) => css2[key] !== "").map(uikitUtil.propName).join(",");
|
|
303
303
|
return css2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.16.16-dev.
|
|
1
|
+
/*! UIkit 3.16.16-dev.7b3ba4436 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */(function(i,b){typeof exports=="object"&&typeof module<"u"?module.exports=b(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider_parallax",["uikit-util"],b):(i=typeof globalThis<"u"?globalThis:i||self,i.UIkitSlider_parallax=b(i.UIkit.util))})(this,function(i){"use strict";var b={props:{media:Boolean},data:{media:!1},connected(){const n=X(this.media,this.$el);if(this.matchMedia=!0,n){this.mediaObj=window.matchMedia(n);const e=()=>{this.matchMedia=this.mediaObj.matches,i.trigger(this.$el,i.createEvent("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=i.on(this.mediaObj,"change",()=>{e(),this.$emit("resize")}),e()}},disconnected(){var n;(n=this.offMediaObj)==null||n.call(this)}};function X(n,e){if(i.isString(n)){if(i.startsWith(n,"@"))n=i.toFloat(i.css(e,`--uk-breakpoint-${n.substr(1)}`));else if(isNaN(n))return n}return n&&i.isNumeric(n)?`(min-width: ${n}px)`:""}function A(n,e){var t;return(t=n==null?void 0:n.startsWith)==null?void 0:t.call(n,e)}const{isArray:Nn,from:Y}=Array;function Z(n){return typeof n=="function"}function C(n){return n!==null&&typeof n=="object"}function k(n){return C(n)&&n===n.window}function T(n){return E(n)>=1}function U(n){return E(n)===1}function E(n){return!k(n)&&C(n)&&n.nodeType}function M(n){return typeof n=="string"}function nn(n){return n===void 0}function x(n){return u(n)[0]}function u(n){return T(n)?[n]:Array.from(n||[]).filter(T)}function j(n){const e=Object.create(null);return t=>e[t]||(e[t]=n(t))}function O(n,e,t){var o;if(C(e)){for(const r in e)O(n,r,e[r]);return}if(nn(t))return(o=x(n))==null?void 0:o.getAttribute(e);for(const r of u(n))Z(t)&&(t=t.call(r,O(r,e))),t===null?tn(r,e):r.setAttribute(e,t)}function tn(n,e){u(n).forEach(t=>t.removeAttribute(e))}function W(n){var e;return(e=x(n))==null?void 0:e.parentElement}function en(n,e){return u(n).filter(t=>_(t,e))}function _(n,e){return u(n).some(t=>t.matches(e))}function R(n,e){return U(n)?n.closest(A(e,">")?e.slice(1):e):u(n).map(t=>R(t,e)).filter(Boolean)}function rn(n,e){n=x(n);const t=n?Y(n.children):[];return e?en(t,e):t}function on(n,e){return e?u(n).indexOf(x(e)):rn(W(n)).indexOf(n)}function sn(n,e){return u(dn(n,x(e),"querySelectorAll"))}const cn=/(^|[^\\],)\s*[!>+~-]/,an=j(n=>n.match(cn)),fn=/([!>+~-])(?=\s+[!>+~-]|\s*$)/g,un=j(n=>n.replace(fn,"$1 *"));function dn(n,e=document,t){if(!n||!M(n))return n;if(n=un(n),an(n)){const o=ln(n);n="";for(let r of o){let s=e;if(r[0]==="!"){const a=r.substr(1).trim().split(" ");if(s=R(W(e),a[0]),r=a.slice(1).join(" ").trim(),!r.length&&o.length===1)return s}if(r[0]==="-"){const a=r.substr(1).trim().split(" "),c=(s||e).previousElementSibling;s=_(c,r.substr(1))?c:null,r=a.slice(1).join(" ")}s&&(n+=`${n?",":""}${mn(s)} ${r}`)}e=document}try{return e[t](n)}catch{return null}}const hn=/.*?[^\\](?:,|$)/g,ln=j(n=>n.match(hn).map(e=>e.replace(/,$/,"").trim()));function mn(n){const e=[];for(;n.parentNode;){const t=O(n,"id");if(t){e.unshift(`#${gn(t)}`);break}else{let{tagName:o}=n;o!=="HTML"&&(o+=`:nth-child(${on(n)+1})`),e.unshift(o),n=n.parentNode}}return e.join(" > ")}function gn(n){return M(n)?CSS.escape(n):""}const bn=/^\s*<(\w+|!)[^>]*>/,xn=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;function $n(n){const e=xn.exec(n);if(e)return document.createElement(e[1]);const t=document.createElement("div");return bn.test(n)?t.insertAdjacentHTML("beforeend",n.trim()):t.textContent=n,yn(t.childNodes)}function yn(n){return n.length>1?n:n[0]}function pn(n,e){return wn(n)?u($n(n)):sn(n,e)}function wn(n){return M(n)&&A(n.trim(),"<")}function vn(n){return Math.ceil(Math.max(0,...pn("[stroke]",n).map(e=>{try{return e.getTotalLength()}catch{return 0}})))}const w={x:v,y:v,rotate:v,scale:v,color:I,backgroundColor:I,borderColor:I,blur:m,hue:m,fopacity:m,grayscale:m,invert:m,saturate:m,sepia:m,opacity:Cn,stroke:Mn,bgx:B,bgy:B},{keys:z}=Object;var Fn={mixins:[b],props:L(z(w),"list"),data:L(z(w),void 0),computed:{props(n,e){const t={};for(const r in n)r in w&&!i.isUndefined(n[r])&&(t[r]=n[r].slice());const o={};for(const r in t)o[r]=w[r](r,e,t[r],t);return o}},events:{load(){this.$emit()}},methods:{reset(){for(const n in this.getCss(0))i.css(this.$el,n,"")},getCss(n){const e={transform:"",filter:""};for(const t in this.props)this.props[t](e,i.clamp(n));return e.willChange=Object.keys(e).filter(t=>e[t]!=="").map(i.propName).join(","),e}}};function v(n,e,t){let o=S(t)||{x:"px",y:"px",rotate:"deg"}[n]||"",r;return n==="x"||n==="y"?(n=`translate${i.ucfirst(n)}`,r=s=>i.toFloat(i.toFloat(s).toFixed(o==="px"?0:6))):n==="scale"&&(o="",r=s=>S([s])?i.toPx(s,"width",e,!0)/e.offsetWidth:s),t.length===1&&t.unshift(n==="scale"?1:0),t=g(t,r),(s,a)=>{s.transform+=` ${n}(${$(t,a)}${o})`}}function I(n,e,t){return t.length===1&&t.unshift(y(e,n,"")),t=g(t,o=>Sn(e,o)),(o,r)=>{const[s,a,c]=q(t,r),h=s.map((l,f)=>(l+=c*(a[f]-l),f===3?i.toFloat(l):parseInt(l,10))).join(",");o[n]=`rgba(${h})`}}function Sn(n,e){return y(n,"color",e).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(i.toFloat)}function m(n,e,t){t.length===1&&t.unshift(0);const o=S(t)||{blur:"px",hue:"deg"}[n]||"%";return n={fopacity:"opacity",hue:"hue-rotate"}[n]||n,t=g(t),(r,s)=>{const a=$(t,s);r.filter+=` ${n}(${a+o})`}}function Cn(n,e,t){return t.length===1&&t.unshift(y(e,n,"")),t=g(t),(o,r)=>{o[n]=$(t,r)}}function Mn(n,e,t){t.length===1&&t.unshift(0);const o=S(t),r=vn(e);return t=g(t.reverse(),s=>(s=i.toFloat(s),o==="%"?s*r/100:s)),t.some(([s])=>s)?(i.css(e,"strokeDasharray",r),(s,a)=>{s.strokeDashoffset=$(t,a)}):i.noop}function B(n,e,t,o){t.length===1&&t.unshift(0);const r=n==="bgy"?"height":"width";o[n]=g(t,c=>i.toPx(c,r,e));const s=["bgx","bgy"].filter(c=>c in o);if(s.length===2&&n==="bgx")return i.noop;if(y(e,"backgroundSize","")==="cover")return jn(n,e,t,o);const a={};for(const c of s)a[c]=D(e,c);return H(s,a,o)}function jn(n,e,t,o){const r=On(e);if(!r.width)return i.noop;const s={width:e.offsetWidth,height:e.offsetHeight},a=["bgx","bgy"].filter(f=>f in o),c={};for(const f of a){const d=o[f].map(([Pn])=>Pn),p=Math.min(...d),N=Math.max(...d),K=d.indexOf(p)<d.indexOf(N),Q=N-p;c[f]=`${(K?-Q:0)-(K?p:N)}px`,s[f==="bgy"?"height":"width"]+=Q}const h=i.Dimensions.cover(r,s);for(const f of a){const d=f==="bgy"?"height":"width",p=h[d]-s[d];c[f]=`max(${D(e,f)},-${p}px) + ${c[f]}`}const l=H(a,c,o);return(f,d)=>{l(f,d),f.backgroundSize=`${h.width}px ${h.height}px`,f.backgroundRepeat="no-repeat"}}function D(n,e){return y(n,`background-position-${e.substr(-1)}`,"")}function H(n,e,t){return function(o,r){for(const s of n){const a=$(t[s],r);o[`background-position-${s.substr(-1)}`]=`calc(${e[s]} + ${a}px)`}}}const F={};function On(n){const e=i.css(n,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(F[e])return F[e];const t=new Image;return e&&(t.src=e,!t.naturalWidth)?(t.onload=()=>{F[e]=P(t),i.trigger(n,i.createEvent("load",!1))},P(t)):F[e]=P(t)}function P(n){return{width:n.naturalWidth,height:n.naturalHeight}}function g(n,e=i.toFloat){const t=[],{length:o}=n;let r=0;for(let s=0;s<o;s++){let[a,c]=i.isString(n[s])?n[s].trim().split(/ (?![^(]*\))/):[n[s]];if(a=e(a),c=c?i.toFloat(c)/100:null,s===0?c===null?c=0:c&&t.push([a,0]):s===o-1&&(c===null?c=1:c!==1&&(t.push([a,c]),c=1)),t.push([a,c]),c===null)r++;else if(r){const h=t[s-r-1][1],l=(c-h)/(r+1);for(let f=r;f>0;f--)t[s-f][1]=h+l*(r-f+1);r=0}}return t}function q(n,e){const t=i.findIndex(n.slice(1),([,o])=>e<=o)+1;return[n[t-1][0],n[t][0],(e-n[t-1][1])/(n[t][1]-n[t-1][1])]}function $(n,e){const[t,o,r]=q(n,e);return i.isNumber(t)?t+Math.abs(t-o)*r*(t<o?1:-1):+o}const In=/^-?\d+(\S+)?/;function S(n,e){var t;for(const o of n){const r=(t=o.match)==null?void 0:t.call(o,In);if(r)return r[1]}return e}function y(n,e,t){const o=n.style[e],r=i.css(i.css(n,e,t),e);return n.style[e]=o,r}function L(n,e){return n.reduce((t,o)=>(t[o]=e,t),{})}var V={mixins:[Fn],data:{selItem:"!li"},beforeConnect(){this.item=i.query(this.selItem,this.$el)},disconnected(){this.item=null},events:[{name:"itemin itemout",self:!0,el(){return this.item},handler({type:n,detail:{percent:e,duration:t,timing:o,dir:r}}){i.fastdom.read(()=>{if(!this.matchMedia)return;const s=this.getCss(J(n,r,e)),a=this.getCss(G(n)?.5:r>0?1:0);i.fastdom.write(()=>{i.css(this.$el,s),i.Transition.start(this.$el,a,t,o).catch(i.noop)})})}},{name:"transitioncanceled transitionend",self:!0,el(){return this.item},handler(){i.Transition.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el(){return this.item},handler({type:n,detail:{percent:e,dir:t}}){i.fastdom.read(()=>{if(!this.matchMedia){this.reset();return}const o=this.getCss(J(n,t,e));i.fastdom.write(()=>i.css(this.$el,o))})}}]};function G(n){return i.endsWith(n,"in")}function J(n,e,t){return t/=2,G(n)^e<0?t:1-t}return typeof window<"u"&&window.UIkit&&window.UIkit.component("sliderParallax",V),V});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.16.16-dev.
|
|
1
|
+
/*! UIkit 3.16.16-dev.7b3ba4436 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
if (active) {
|
|
245
245
|
focusEl = button;
|
|
246
246
|
}
|
|
247
|
-
focus
|
|
247
|
+
focus || (focus = util.matches(button, ":focus"));
|
|
248
248
|
} else {
|
|
249
249
|
util.toggleClass(
|
|
250
250
|
el,
|
|
@@ -340,17 +340,16 @@
|
|
|
340
340
|
e.cancelable && e.preventDefault();
|
|
341
341
|
this.dragging = true;
|
|
342
342
|
this.dir = distance < 0 ? 1 : -1;
|
|
343
|
-
|
|
344
|
-
let { prevIndex } = this;
|
|
343
|
+
let { slides, prevIndex } = this;
|
|
345
344
|
let dis = Math.abs(distance);
|
|
346
|
-
let nextIndex = this.getIndex(prevIndex + this.dir
|
|
347
|
-
let width = this._getDistance(prevIndex, nextIndex)
|
|
345
|
+
let nextIndex = this.getIndex(prevIndex + this.dir);
|
|
346
|
+
let width = this._getDistance(prevIndex, nextIndex);
|
|
348
347
|
while (nextIndex !== prevIndex && dis > width) {
|
|
349
348
|
this.drag -= width * this.dir;
|
|
350
349
|
prevIndex = nextIndex;
|
|
351
350
|
dis -= width;
|
|
352
|
-
nextIndex = this.getIndex(prevIndex + this.dir
|
|
353
|
-
width = this._getDistance(prevIndex, nextIndex)
|
|
351
|
+
nextIndex = this.getIndex(prevIndex + this.dir);
|
|
352
|
+
width = this._getDistance(prevIndex, nextIndex);
|
|
354
353
|
}
|
|
355
354
|
this.percent = dis / width;
|
|
356
355
|
const prev = slides[prevIndex];
|
|
@@ -406,6 +405,9 @@
|
|
|
406
405
|
}
|
|
407
406
|
util.css(this.list, { userSelect: "", pointerEvents: "" });
|
|
408
407
|
this.drag = this.percent = null;
|
|
408
|
+
},
|
|
409
|
+
_getDistance(prev, next) {
|
|
410
|
+
return this._getTransitioner(prev, prev !== next && next).getDistance() || this.slides[prev].offsetWidth;
|
|
409
411
|
}
|
|
410
412
|
}
|
|
411
413
|
};
|
|
@@ -595,9 +597,6 @@
|
|
|
595
597
|
this.percent
|
|
596
598
|
);
|
|
597
599
|
},
|
|
598
|
-
_getDistance(prev, next) {
|
|
599
|
-
return this._getTransitioner(prev, prev !== next && next).getDistance();
|
|
600
|
-
},
|
|
601
600
|
_translate(percent, prev = this.prevIndex, next = this.index) {
|
|
602
601
|
const transitioner = this._getTransitioner(prev === next ? false : prev, next);
|
|
603
602
|
transitioner.translate(percent);
|
|
@@ -605,8 +604,8 @@
|
|
|
605
604
|
},
|
|
606
605
|
_getTransitioner(prev = this.prevIndex, next = this.index, dir = this.dir || 1, options = this.transitionOptions) {
|
|
607
606
|
return new this.Transitioner(
|
|
608
|
-
|
|
609
|
-
|
|
607
|
+
this.slides[prev] || prev,
|
|
608
|
+
this.slides[next] || next,
|
|
610
609
|
dir * (util.isRtl ? -1 : 1),
|
|
611
610
|
options
|
|
612
611
|
);
|
|
@@ -650,9 +649,9 @@
|
|
|
650
649
|
}
|
|
651
650
|
|
|
652
651
|
function Transitioner(prev, next, dir, { center, easing, list }) {
|
|
653
|
-
const deferred = new util.Deferred();
|
|
654
652
|
const from = prev ? getLeft(prev, list, center) : getLeft(next, list, center) + util.dimensions(next).width * dir;
|
|
655
653
|
const to = next ? getLeft(next, list, center) : from + util.dimensions(prev).width * dir * (util.isRtl ? -1 : 1);
|
|
654
|
+
let resolve;
|
|
656
655
|
return {
|
|
657
656
|
dir,
|
|
658
657
|
show(duration, percent = 0, linear) {
|
|
@@ -667,22 +666,24 @@
|
|
|
667
666
|
timing,
|
|
668
667
|
dir
|
|
669
668
|
});
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
669
|
+
return new Promise((res) => {
|
|
670
|
+
resolve || (resolve = res);
|
|
671
|
+
util.Transition.start(
|
|
672
|
+
list,
|
|
673
|
+
{ transform: translate(-to * (util.isRtl ? -1 : 1), "px") },
|
|
674
|
+
duration,
|
|
675
|
+
timing
|
|
676
|
+
).then(resolve, util.noop);
|
|
677
|
+
});
|
|
677
678
|
},
|
|
678
679
|
cancel() {
|
|
679
|
-
util.Transition.cancel(list);
|
|
680
|
+
return util.Transition.cancel(list);
|
|
680
681
|
},
|
|
681
682
|
reset() {
|
|
682
683
|
util.css(list, "transform", "");
|
|
683
684
|
},
|
|
684
|
-
forward(duration, percent = this.percent()) {
|
|
685
|
-
|
|
685
|
+
async forward(duration, percent = this.percent()) {
|
|
686
|
+
await this.cancel();
|
|
686
687
|
return this.show(duration, percent, true);
|
|
687
688
|
},
|
|
688
689
|
translate(percent) {
|
|
@@ -819,7 +820,7 @@
|
|
|
819
820
|
left = 0;
|
|
820
821
|
}
|
|
821
822
|
if (this.center) {
|
|
822
|
-
if (left < width / 2 && left + slideWidth + util.dimensions(
|
|
823
|
+
if (left < width / 2 && left + slideWidth + util.dimensions(util.getIndex(+i + 1, this.slides)).width / 2 > width / 2) {
|
|
823
824
|
sets.push(+i);
|
|
824
825
|
left = width / 2 - slideWidth / 2;
|
|
825
826
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.16.16-dev.4d5c42e53 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */(function(e,m){typeof exports=="object"&&typeof module<"u"?module.exports=m(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider",["uikit-util"],m):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkitSlider=m(e.UIkit.util))})(this,function(e){"use strict";var m={connected(){e.addClass(this.$el,this.$options.id)}};function A(t){return k(e.observeResize,t,"resize")}function L(t){return k(e.observeIntersection,t)}function P(t={}){return L({handler:function(s,n){const{targets:i=this.$el,preload:h=5}=t;for(const r of e.toNodes(e.isFunction(i)?i(this):i))e.$$('[loading="lazy"]',r).slice(0,h-1).forEach(a=>e.removeAttr(a,"loading"));for(const r of s.filter(({isIntersecting:a})=>a).map(({target:a})=>a))n.unobserve(r)},...t})}function k(t,s,n){return{observe:t,handler(){this.$emit(n)},...s}}var z={props:{i18n:Object},data:{i18n:null},methods:{t(t,...s){var n,i,h;let r=0;return((h=((n=this.i18n)==null?void 0:n[t])||((i=this.$options.i18n)==null?void 0:i[t]))==null?void 0:h.replace(/%s/g,()=>s[r++]||""))||""}}};const p={TAB:9,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};function b(t,s=t.$el,n=""){if(s.id)return s.id;let i=`${t.$options.id}-${t._uid}${n}`;return e.$(`#${i}`)&&(i=b(t,s,`${n}-2`)),i}var B={i18n:{next:"Next slide",previous:"Previous slide",slideX:"Slide %s",slideLabel:"%s of %s",role:"String"},data:{selNav:!1,role:"region"},computed:{nav({selNav:t},s){return e.$(t,s)},navChildren(){return e.children(this.nav)},selNavItem({attrItem:t}){return`[${t}],[data-${t}]`},navItems(t,s){return e.$$(this.selNavItem,s)}},watch:{nav(t,s){e.attr(t,"role","tablist"),s&&this.$emit()},list(t){e.attr(t,"role","presentation")},navChildren(t){e.attr(t,"role","presentation")},navItems(t){for(const s of t){const n=e.data(s,this.attrItem),i=e.$("a,button",s)||s;let h,r=null;if(e.isNumeric(n)){const a=e.toNumber(n),o=this.slides[a];o&&(o.id||(o.id=b(this,o,`-item-${n}`)),r=o.id),h=this.t("slideX",e.toFloat(n)+1),e.attr(i,"role","tab")}else this.list&&(this.list.id||(this.list.id=b(this,this.list,"-items")),r=this.list.id),h=this.t(n);e.attr(i,{"aria-controls":r,"aria-label":e.attr(i,"aria-label")||h})}},slides(t){t.forEach((s,n)=>e.attr(s,{role:this.nav?"tabpanel":"group","aria-label":this.t("slideLabel",n+1,this.length),"aria-roledescription":this.nav?null:"slide"}))},length(t){const s=this.navChildren.length;if(this.nav&&t!==s){e.empty(this.nav);for(let n=0;n<t;n++)e.append(this.nav,`<li ${this.attrItem}="${n}"><a href></a></li>`)}}},connected(){e.attr(this.$el,{role:this.role,ariaRoleDescription:"carousel"})},update:[{write(){this.navItems.concat(this.nav).forEach(t=>t&&(t.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]}],events:[{name:"click keydown",delegate(){return this.selNavItem},handler(t){e.closest(t.target,"a,button")&&(t.type==="click"||t.keyCode===p.SPACE)&&(t.preventDefault(),this.show(e.data(t.current,this.attrItem)))}},{name:"itemshow",handler:"updateNav"},{name:"keydown",delegate(){return this.selNavItem},handler(t){const{current:s,keyCode:n}=t,i=e.data(s,this.attrItem);if(!e.isNumeric(i))return;let h=n===p.HOME?0:n===p.END?"last":n===p.LEFT?"previous":n===p.RIGHT?"next":-1;~h&&(t.preventDefault(),this.show(h))}}],methods:{updateNav(){const t=this.getValidIndex();let s,n;for(const i of this.navItems){const h=e.data(i,this.attrItem),r=e.$("a,button",i)||i;if(e.isNumeric(h)){const o=e.toNumber(h)===t;e.toggleClass(i,this.clsActive,o),e.attr(r,{"aria-selected":o,tabindex:o?null:-1}),o&&(n=r),s=s||e.matches(r,":focus")}else e.toggleClass(i,"uk-invisible",this.finite&&(h==="previous"&&t===0||h==="next"&&t>=this.maxIndex));s&&n&&n.focus()}}}};const $={passive:!1,capture:!0},C={passive:!0,capture:!0},U="touchstart mousedown",y="touchmove mousemove",N="touchend touchcancel mouseup click input scroll";var V={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const t of["start","move","end"]){const s=this[t];this[t]=n=>{const i=e.getEventPos(n).x*(e.isRtl?-1:1);this.prevPos=i===this.pos?this.prevPos:this.pos,this.pos=i,s(n)}}},events:[{name:U,passive:!0,delegate(){return`${this.selList} > *`},handler(t){!this.draggable||!e.isTouch(t)&&F(t.target)||e.closest(t.target,e.selInput)||t.button>0||this.length<2||this.start(t)}},{name:"dragstart",handler(t){t.preventDefault()}},{name:y,el(){return this.list},handler:e.noop,...$}],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,y,this.move,$),e.on(document,N,this.end,C),e.css(this.list,"userSelect","none")},move(t){const s=this.pos-this.drag;if(s===0||this.prevPos===this.pos||!this.dragging&&Math.abs(s)<this.threshold)return;e.css(this.list,"pointerEvents","none"),t.cancelable&&t.preventDefault(),this.dragging=!0,this.dir=s<0?1:-1;const{slides:n}=this;let{prevIndex:i}=this,h=Math.abs(s),r=this.getIndex(i+this.dir,i),a=this._getDistance(i,r)||n[i].offsetWidth;for(;r!==i&&h>a;)this.drag-=a*this.dir,i=r,h-=a,r=this.getIndex(i+this.dir,i),a=this._getDistance(i,r)||n[i].offsetWidth;this.percent=h/a;const o=n[i],l=n[r],d=this.index!==r,c=i===r;let f;for(const g of[this.index,this.prevIndex])e.includes([r,i],g)||(e.trigger(n[g],"itemhidden",[this]),c&&(f=!0,this.prevIndex=i));(this.index===i&&this.prevIndex!==i||f)&&e.trigger(n[this.index],"itemshown",[this]),d&&(this.prevIndex=i,this.index=r,!c&&e.trigger(o,"beforeitemhide",[this]),e.trigger(l,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),o,!c&&l),d&&(!c&&e.trigger(o,"itemhide",[this]),e.trigger(l,"itemshow",[this]))},end(){if(e.off(document,y,this.move,$),e.off(document,N,this.end,C),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=(e.isRtl?this.dir*(e.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)}e.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function F(t){return e.css(t,"userSelect")!=="none"&&e.toArray(t.childNodes).some(s=>s.nodeType===3&&s.textContent.trim())}var H={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){e.attr(this.list,"aria-live",this.autoplay?"off":"polite"),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.stack.length||this.draggable&&e.matches(this.$el,":focus-within")||this.pauseOnHover&&e.matches(this.$el,":hover")||this.show("next")},this.autoplayInterval)},stopAutoplay(){clearInterval(this.interval)}}},j={mixins:[H,V,B,z],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){e.removeClass(this.slides,this.clsActive)},computed:{duration({velocity:t},s){return M(s.offsetWidth/t)},list({selList:t},s){return e.$(t,s)},maxIndex(){return this.length-1},slides(){return e.children(this.list)},length(){return this.slides.length}},watch:{slides(t,s){s&&this.$emit()}},observe:A(),methods:{show(t,s=!1){var n;if(this.dragging||!this.length)return;const{stack:i}=this,h=s?0:i.length,r=()=>{i.splice(h,1),i.length&&this.show(i.shift(),!0)};if(i[s?"unshift":"push"](t),!s&&i.length>1){i.length===2&&((n=this._transitioner)==null||n.forward(Math.min(this.duration,200)));return}const a=this.getIndex(this.index),o=e.hasClass(this.slides,this.clsActive)&&this.slides[a],l=this.getIndex(t,this.index),d=this.slides[l];if(o===d){r();return}if(this.dir=q(t,a),this.prevIndex=a,this.index=l,o&&!e.trigger(o,"beforeitemhide",[this])||!e.trigger(d,"beforeitemshow",[this,o])){this.index=this.prevIndex,r();return}const c=this._show(o,d,s).then(()=>{o&&e.trigger(o,"itemhidden",[this]),e.trigger(d,"itemshown",[this]),i.shift(),this._transitioner=null,requestAnimationFrame(()=>i.length&&this.show(i.shift(),!0))});return o&&e.trigger(o,"itemhide",[this]),e.trigger(d,"itemshow",[this]),c},getIndex(t=this.index,s=this.index){return e.clamp(e.getIndex(t,this.slides,s,this.finite),0,Math.max(0,this.maxIndex))},getValidIndex(t=this.index,s=this.prevIndex){return this.getIndex(t,s)},_show(t,s,n){if(this._transitioner=this._getTransitioner(t,s,this.dir,{easing:n?s.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,s){return this._getTransitioner(t,t!==s&&s).getDistance()},_translate(t,s=this.prevIndex,n=this.index){const i=this._getTransitioner(s===n?!1:s,n);return i.translate(t),i},_getTransitioner(t=this.prevIndex,s=this.index,n=this.dir||1,i=this.transitionOptions){return new this.Transitioner(e.isNumber(t)?this.slides[t]:t,e.isNumber(s)?this.slides[s]:s,n*(e.isRtl?-1:1),i)}}};function q(t,s){return t==="next"?1:t==="previous"||t<s?-1:1}function M(t){return .5*t+300}var G={update:{write(){if(this.stack.length||this.dragging)return;const t=this.getValidIndex(this.index);!~this.prevIndex||this.index!==t?this.show(t):this._translate(1,this.prevIndex,this.index)},events:["resize"]}},X={observe:P({target:({slides:t})=>t,targets:t=>t.getAdjacentSlides()})};function S(t=0,s="%"){return t+=t?s:"",`translate3d(${t}, 0, 0)`}function J(t,s,n,{center:i,easing:h,list:r}){const a=new e.Deferred,o=t?v(t,r,i):v(s,r,i)+e.dimensions(s).width*n,l=s?v(s,r,i):o+e.dimensions(t).width*n*(e.isRtl?-1:1);return{dir:n,show(d,c=0,f){const g=f?"linear":h;return d-=Math.round(d*e.clamp(c,-1,1)),this.translate(c),c=t?c:e.clamp(c,0,1),_(this.getItemIn(),"itemin",{percent:c,duration:d,timing:g,dir:n}),t&&_(this.getItemIn(!0),"itemout",{percent:1-c,duration:d,timing:g,dir:n}),e.Transition.start(r,{transform:S(-l*(e.isRtl?-1:1),"px")},d,g).then(a.resolve,e.noop),a.promise},cancel(){e.Transition.cancel(r)},reset(){e.css(r,"transform","")},forward(d,c=this.percent()){return e.Transition.cancel(r),this.show(d,c,!0)},translate(d){const c=this.getDistance()*n*(e.isRtl?-1:1);e.css(r,"transform",S(e.clamp(-l+(c-c*d),-I(r),e.dimensions(r).width)*(e.isRtl?-1:1),"px"));const f=this.getActives(),g=this.getItemIn(),x=this.getItemIn(!0);d=t?e.clamp(d,-1,1):0;for(const u of e.children(r)){const R=e.includes(f,u),O=u===g,W=u===x,Z=O||!W&&(R||n*(e.isRtl?-1:1)===-1^w(u,r)>w(t||s));_(u,`itemtranslate${Z?"in":"out"}`,{dir:n,percent:W?1-d:O?d:R?1:0})}},percent(){return Math.abs((e.css(r,"transform").split(",")[4]*(e.isRtl?-1:1)+o)/(l-o))},getDistance(){return Math.abs(l-o)},getItemIn(d=!1){let c=this.getActives(),f=E(r,v(s||t,r,i));if(d){const g=c;c=f,f=g}return f[e.findIndex(f,g=>!e.includes(c,g))]},getActives(){return E(r,v(t||s,r,i))}}}function v(t,s,n){const i=w(t,s);return n?i-K(t,s):Math.min(i,T(s))}function T(t){return Math.max(0,I(t)-e.dimensions(t).width)}function I(t){return e.sumBy(e.children(t),s=>e.dimensions(s).width)}function K(t,s){return e.dimensions(s).width/2-e.dimensions(t).width/2}function w(t,s){return t&&(e.position(t).left+(e.isRtl?e.dimensions(t).width-e.dimensions(s).width:0))*(e.isRtl?-1:1)||0}function E(t,s){s-=1;const n=e.dimensions(t).width,i=s+n+2;return e.children(t).filter(h=>{const r=w(h,t),a=r+Math.min(e.dimensions(h).width,n);return r>=s&&a<=i})}function _(t,s,n){e.trigger(t,e.createEvent(s,!1,!1,n))}var D={mixins:[m,j,G,X],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:J},computed:{avgWidth(){return I(this.list)/this.length},finite({finite:t}){return t||Q(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 t=0;const s=T(this.list),n=e.findIndex(this.slides,i=>{if(t>=s)return!0;t+=e.dimensions(i).width});return~n?n:this.length-1},sets({sets:t}){if(!t)return;let s=0;const n=[],i=e.dimensions(this.list).width;for(let h=0;h<this.length;h++){const r=e.dimensions(this.slides[h]).width;s+r>i&&(s=0),this.center?s<i/2&&s+r+e.dimensions(this.slides[+h+1]).width/2>i/2&&(n.push(+h),s=i/2-r/2):s===0&&n.push(Math.min(+h,this.maxIndex)),s+=r}if(n.length)return n},transitionOptions(){return{center:this.center,list:this.list}},slides(){return e.children(this.list).filter(e.isVisible)}},connected(){e.toggleClass(this.$el,this.clsContainer,!e.$(`.${this.clsContainer}`,this.$el))},observe:A({target:({slides:t})=>t}),update:{write(){for(const t of this.navItems){const s=e.toNumber(e.data(t,this.attrItem));s!==!1&&(t.hidden=!this.maxIndex||s>this.maxIndex||this.sets&&!e.includes(this.sets,s))}this.length&&!this.dragging&&!this.stack.length&&(this.reorder(),this._translate(1)),this.updateActiveClasses()},events:["resize"]},events:{beforeitemshow(t){!this.dragging&&this.sets&&this.stack.length<2&&!e.includes(this.sets,this.index)&&(this.index=this.getValidIndex());const s=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&&s>1){for(let i=0;i<s;i++)this.stack.splice(1,0,this.dir>0?"next":"previous");t.preventDefault();return}const n=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex;this.duration=M(this.avgWidth/this.velocity)*(e.dimensions(this.slides[n]).width/this.avgWidth),this.reorder()},itemshow(){~this.prevIndex&&e.addClass(this._getTransitioner().getItemIn(),this.clsActive)},itemshown(){this.updateActiveClasses()}},methods:{reorder(){if(this.finite){e.css(this.slides,"order","");return}const t=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((h,r)=>e.css(h,"order",this.dir>0&&r<t?1:this.dir<0&&r>=this.index?-1:"")),!this.center)return;const s=this.slides[t];let n=e.dimensions(this.list).width/2-e.dimensions(s).width/2,i=0;for(;n>0;){const h=this.getIndex(--i+t,t),r=this.slides[h];e.css(r,"order",h>t?-2:-1),n-=e.dimensions(r).width}},updateActiveClasses(){const t=this._getTransitioner(this.index).getActives(),s=[this.clsActive,(!this.sets||e.includes(this.sets,e.toFloat(this.index)))&&this.clsActivated||""];for(const n of this.slides){const i=e.includes(t,n);e.toggleClass(n,s,i),e.attr(n,"aria-hidden",!i);for(const h of e.$$(e.selFocusable,n))e.hasOwn(h,"_tabindex")||(h._tabindex=e.attr(h,"tabindex")),e.attr(h,"tabindex",i?h._tabindex:-1)}},getValidIndex(t=this.index,s=this.prevIndex){if(t=this.getIndex(t,s),!this.sets)return t;let n;do{if(e.includes(this.sets,t))return t;n=t,t=this.getIndex(t+this.dir,s)}while(t!==n);return t},getAdjacentSlides(){const{width:t}=e.dimensions(this.list),s=-t,n=t*2,i=e.dimensions(this.slides[this.index]).width,h=this.center?t/2-i/2:0,r=new Set;for(const a of[-1,1]){let o=h+(a>0?i:0),l=0;do{const d=this.slides[this.getIndex(this.index+a+l++*a)];o+=e.dimensions(d).width*a,r.add(d)}while(this.length>l&&o>s&&o<n)}return Array.from(r)}}};function Q(t,s){if(!t||t.length<2)return!0;const{width:n}=e.dimensions(t);if(!s)return Math.ceil(I(t))<Math.trunc(n+Y(t));const i=e.children(t),h=Math.trunc(n/2);for(const r in i){const a=i[r],o=e.dimensions(a).width,l=new Set([a]);let d=0;for(const c of[-1,1]){let f=o/2,g=0;for(;f<h;){const x=i[e.getIndex(+r+c+g++*c,i)];if(l.has(x))return!0;f+=e.dimensions(x).width,l.add(x)}d=Math.max(d,o/2+e.dimensions(i[e.getIndex(+r+c,i)]).width/2-(f-h))}if(d>e.sumBy(i.filter(c=>!l.has(c)),c=>e.dimensions(c).width))return!0}return!1}function Y(t){return Math.max(0,...e.children(t).map(s=>e.dimensions(s).width))}return typeof window<"u"&&window.UIkit&&window.UIkit.component("slider",D),D});
|
|
1
|
+
/*! UIkit 3.16.16-dev.7b3ba4436 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */(function(e,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider",["uikit-util"],p):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkitSlider=p(e.UIkit.util))})(this,function(e){"use strict";var p={connected(){e.addClass(this.$el,this.$options.id)}};function A(t){return k(e.observeResize,t,"resize")}function P(t){return k(e.observeIntersection,t)}function L(t={}){return P({handler:function(s,n){const{targets:i=this.$el,preload:h=5}=t;for(const r of e.toNodes(e.isFunction(i)?i(this):i))e.$$('[loading="lazy"]',r).slice(0,h-1).forEach(a=>e.removeAttr(a,"loading"));for(const r of s.filter(({isIntersecting:a})=>a).map(({target:a})=>a))n.unobserve(r)},...t})}function k(t,s,n){return{observe:t,handler(){this.$emit(n)},...s}}var z={props:{i18n:Object},data:{i18n:null},methods:{t(t,...s){var n,i,h;let r=0;return((h=((n=this.i18n)==null?void 0:n[t])||((i=this.$options.i18n)==null?void 0:i[t]))==null?void 0:h.replace(/%s/g,()=>s[r++]||""))||""}}};const v={TAB:9,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};function b(t,s=t.$el,n=""){if(s.id)return s.id;let i=`${t.$options.id}-${t._uid}${n}`;return e.$(`#${i}`)&&(i=b(t,s,`${n}-2`)),i}var B={i18n:{next:"Next slide",previous:"Previous slide",slideX:"Slide %s",slideLabel:"%s of %s",role:"String"},data:{selNav:!1,role:"region"},computed:{nav({selNav:t},s){return e.$(t,s)},navChildren(){return e.children(this.nav)},selNavItem({attrItem:t}){return`[${t}],[data-${t}]`},navItems(t,s){return e.$$(this.selNavItem,s)}},watch:{nav(t,s){e.attr(t,"role","tablist"),s&&this.$emit()},list(t){e.attr(t,"role","presentation")},navChildren(t){e.attr(t,"role","presentation")},navItems(t){for(const s of t){const n=e.data(s,this.attrItem),i=e.$("a,button",s)||s;let h,r=null;if(e.isNumeric(n)){const a=e.toNumber(n),o=this.slides[a];o&&(o.id||(o.id=b(this,o,`-item-${n}`)),r=o.id),h=this.t("slideX",e.toFloat(n)+1),e.attr(i,"role","tab")}else this.list&&(this.list.id||(this.list.id=b(this,this.list,"-items")),r=this.list.id),h=this.t(n);e.attr(i,{"aria-controls":r,"aria-label":e.attr(i,"aria-label")||h})}},slides(t){t.forEach((s,n)=>e.attr(s,{role:this.nav?"tabpanel":"group","aria-label":this.t("slideLabel",n+1,this.length),"aria-roledescription":this.nav?null:"slide"}))},length(t){const s=this.navChildren.length;if(this.nav&&t!==s){e.empty(this.nav);for(let n=0;n<t;n++)e.append(this.nav,`<li ${this.attrItem}="${n}"><a href></a></li>`)}}},connected(){e.attr(this.$el,{role:this.role,ariaRoleDescription:"carousel"})},update:[{write(){this.navItems.concat(this.nav).forEach(t=>t&&(t.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]}],events:[{name:"click keydown",delegate(){return this.selNavItem},handler(t){e.closest(t.target,"a,button")&&(t.type==="click"||t.keyCode===v.SPACE)&&(t.preventDefault(),this.show(e.data(t.current,this.attrItem)))}},{name:"itemshow",handler:"updateNav"},{name:"keydown",delegate(){return this.selNavItem},handler(t){const{current:s,keyCode:n}=t,i=e.data(s,this.attrItem);if(!e.isNumeric(i))return;let h=n===v.HOME?0:n===v.END?"last":n===v.LEFT?"previous":n===v.RIGHT?"next":-1;~h&&(t.preventDefault(),this.show(h))}}],methods:{updateNav(){const t=this.getValidIndex();let s,n;for(const i of this.navItems){const h=e.data(i,this.attrItem),r=e.$("a,button",i)||i;if(e.isNumeric(h)){const o=e.toNumber(h)===t;e.toggleClass(i,this.clsActive,o),e.attr(r,{"aria-selected":o,tabindex:o?null:-1}),o&&(n=r),s||(s=e.matches(r,":focus"))}else e.toggleClass(i,"uk-invisible",this.finite&&(h==="previous"&&t===0||h==="next"&&t>=this.maxIndex));s&&n&&n.focus()}}}};const $={passive:!1,capture:!0},C={passive:!0,capture:!0},U="touchstart mousedown",y="touchmove mousemove",M="touchend touchcancel mouseup click input scroll";var V={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const t of["start","move","end"]){const s=this[t];this[t]=n=>{const i=e.getEventPos(n).x*(e.isRtl?-1:1);this.prevPos=i===this.pos?this.prevPos:this.pos,this.pos=i,s(n)}}},events:[{name:U,passive:!0,delegate(){return`${this.selList} > *`},handler(t){!this.draggable||!e.isTouch(t)&&F(t.target)||e.closest(t.target,e.selInput)||t.button>0||this.length<2||this.start(t)}},{name:"dragstart",handler(t){t.preventDefault()}},{name:y,el(){return this.list},handler:e.noop,...$}],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,y,this.move,$),e.on(document,M,this.end,C),e.css(this.list,"userSelect","none")},move(t){const s=this.pos-this.drag;if(s===0||this.prevPos===this.pos||!this.dragging&&Math.abs(s)<this.threshold)return;e.css(this.list,"pointerEvents","none"),t.cancelable&&t.preventDefault(),this.dragging=!0,this.dir=s<0?1:-1;let{slides:n,prevIndex:i}=this,h=Math.abs(s),r=this.getIndex(i+this.dir),a=this._getDistance(i,r);for(;r!==i&&h>a;)this.drag-=a*this.dir,i=r,h-=a,r=this.getIndex(i+this.dir),a=this._getDistance(i,r);this.percent=h/a;const o=n[i],l=n[r],d=this.index!==r,c=i===r;let f;for(const g of[this.index,this.prevIndex])e.includes([r,i],g)||(e.trigger(n[g],"itemhidden",[this]),c&&(f=!0,this.prevIndex=i));(this.index===i&&this.prevIndex!==i||f)&&e.trigger(n[this.index],"itemshown",[this]),d&&(this.prevIndex=i,this.index=r,!c&&e.trigger(o,"beforeitemhide",[this]),e.trigger(l,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),o,!c&&l),d&&(!c&&e.trigger(o,"itemhide",[this]),e.trigger(l,"itemshow",[this]))},end(){if(e.off(document,y,this.move,$),e.off(document,M,this.end,C),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=(e.isRtl?this.dir*(e.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)}e.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null},_getDistance(t,s){return this._getTransitioner(t,t!==s&&s).getDistance()||this.slides[t].offsetWidth}}};function F(t){return e.css(t,"userSelect")!=="none"&&e.toArray(t.childNodes).some(s=>s.nodeType===3&&s.textContent.trim())}var H={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){e.attr(this.list,"aria-live",this.autoplay?"off":"polite"),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.stack.length||this.draggable&&e.matches(this.$el,":focus-within")||this.pauseOnHover&&e.matches(this.$el,":hover")||this.show("next")},this.autoplayInterval)},stopAutoplay(){clearInterval(this.interval)}}},j={mixins:[H,V,B,z],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){e.removeClass(this.slides,this.clsActive)},computed:{duration({velocity:t},s){return N(s.offsetWidth/t)},list({selList:t},s){return e.$(t,s)},maxIndex(){return this.length-1},slides(){return e.children(this.list)},length(){return this.slides.length}},watch:{slides(t,s){s&&this.$emit()}},observe:A(),methods:{show(t,s=!1){var n;if(this.dragging||!this.length)return;const{stack:i}=this,h=s?0:i.length,r=()=>{i.splice(h,1),i.length&&this.show(i.shift(),!0)};if(i[s?"unshift":"push"](t),!s&&i.length>1){i.length===2&&((n=this._transitioner)==null||n.forward(Math.min(this.duration,200)));return}const a=this.getIndex(this.index),o=e.hasClass(this.slides,this.clsActive)&&this.slides[a],l=this.getIndex(t,this.index),d=this.slides[l];if(o===d){r();return}if(this.dir=q(t,a),this.prevIndex=a,this.index=l,o&&!e.trigger(o,"beforeitemhide",[this])||!e.trigger(d,"beforeitemshow",[this,o])){this.index=this.prevIndex,r();return}const c=this._show(o,d,s).then(()=>{o&&e.trigger(o,"itemhidden",[this]),e.trigger(d,"itemshown",[this]),i.shift(),this._transitioner=null,requestAnimationFrame(()=>i.length&&this.show(i.shift(),!0))});return o&&e.trigger(o,"itemhide",[this]),e.trigger(d,"itemshow",[this]),c},getIndex(t=this.index,s=this.index){return e.clamp(e.getIndex(t,this.slides,s,this.finite),0,Math.max(0,this.maxIndex))},getValidIndex(t=this.index,s=this.prevIndex){return this.getIndex(t,s)},_show(t,s,n){if(this._transitioner=this._getTransitioner(t,s,this.dir,{easing:n?s.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)},_translate(t,s=this.prevIndex,n=this.index){const i=this._getTransitioner(s===n?!1:s,n);return i.translate(t),i},_getTransitioner(t=this.prevIndex,s=this.index,n=this.dir||1,i=this.transitionOptions){return new this.Transitioner(this.slides[t]||t,this.slides[s]||s,n*(e.isRtl?-1:1),i)}}};function q(t,s){return t==="next"?1:t==="previous"||t<s?-1:1}function N(t){return .5*t+300}var G={update:{write(){if(this.stack.length||this.dragging)return;const t=this.getValidIndex(this.index);!~this.prevIndex||this.index!==t?this.show(t):this._translate(1,this.prevIndex,this.index)},events:["resize"]}},X={observe:L({target:({slides:t})=>t,targets:t=>t.getAdjacentSlides()})};function S(t=0,s="%"){return t+=t?s:"",`translate3d(${t}, 0, 0)`}function J(t,s,n,{center:i,easing:h,list:r}){const a=t?x(t,r,i):x(s,r,i)+e.dimensions(s).width*n,o=s?x(s,r,i):a+e.dimensions(t).width*n*(e.isRtl?-1:1);let l;return{dir:n,show(d,c=0,f){const g=f?"linear":h;return d-=Math.round(d*e.clamp(c,-1,1)),this.translate(c),c=t?c:e.clamp(c,0,1),_(this.getItemIn(),"itemin",{percent:c,duration:d,timing:g,dir:n}),t&&_(this.getItemIn(!0),"itemout",{percent:1-c,duration:d,timing:g,dir:n}),new Promise(m=>{l||(l=m),e.Transition.start(r,{transform:S(-o*(e.isRtl?-1:1),"px")},d,g).then(l,e.noop)})},cancel(){return e.Transition.cancel(r)},reset(){e.css(r,"transform","")},async forward(d,c=this.percent()){return await this.cancel(),this.show(d,c,!0)},translate(d){const c=this.getDistance()*n*(e.isRtl?-1:1);e.css(r,"transform",S(e.clamp(-o+(c-c*d),-I(r),e.dimensions(r).width)*(e.isRtl?-1:1),"px"));const f=this.getActives(),g=this.getItemIn(),m=this.getItemIn(!0);d=t?e.clamp(d,-1,1):0;for(const u of e.children(r)){const R=e.includes(f,u),O=u===g,W=u===m,Z=O||!W&&(R||n*(e.isRtl?-1:1)===-1^w(u,r)>w(t||s));_(u,`itemtranslate${Z?"in":"out"}`,{dir:n,percent:W?1-d:O?d:R?1:0})}},percent(){return Math.abs((e.css(r,"transform").split(",")[4]*(e.isRtl?-1:1)+a)/(o-a))},getDistance(){return Math.abs(o-a)},getItemIn(d=!1){let c=this.getActives(),f=T(r,x(s||t,r,i));if(d){const g=c;c=f,f=g}return f[e.findIndex(f,g=>!e.includes(c,g))]},getActives(){return T(r,x(t||s,r,i))}}}function x(t,s,n){const i=w(t,s);return n?i-K(t,s):Math.min(i,E(s))}function E(t){return Math.max(0,I(t)-e.dimensions(t).width)}function I(t){return e.sumBy(e.children(t),s=>e.dimensions(s).width)}function K(t,s){return e.dimensions(s).width/2-e.dimensions(t).width/2}function w(t,s){return t&&(e.position(t).left+(e.isRtl?e.dimensions(t).width-e.dimensions(s).width:0))*(e.isRtl?-1:1)||0}function T(t,s){s-=1;const n=e.dimensions(t).width,i=s+n+2;return e.children(t).filter(h=>{const r=w(h,t),a=r+Math.min(e.dimensions(h).width,n);return r>=s&&a<=i})}function _(t,s,n){e.trigger(t,e.createEvent(s,!1,!1,n))}var D={mixins:[p,j,G,X],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:J},computed:{avgWidth(){return I(this.list)/this.length},finite({finite:t}){return t||Q(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 t=0;const s=E(this.list),n=e.findIndex(this.slides,i=>{if(t>=s)return!0;t+=e.dimensions(i).width});return~n?n:this.length-1},sets({sets:t}){if(!t)return;let s=0;const n=[],i=e.dimensions(this.list).width;for(let h=0;h<this.length;h++){const r=e.dimensions(this.slides[h]).width;s+r>i&&(s=0),this.center?s<i/2&&s+r+e.dimensions(e.getIndex(+h+1,this.slides)).width/2>i/2&&(n.push(+h),s=i/2-r/2):s===0&&n.push(Math.min(+h,this.maxIndex)),s+=r}if(n.length)return n},transitionOptions(){return{center:this.center,list:this.list}},slides(){return e.children(this.list).filter(e.isVisible)}},connected(){e.toggleClass(this.$el,this.clsContainer,!e.$(`.${this.clsContainer}`,this.$el))},observe:A({target:({slides:t})=>t}),update:{write(){for(const t of this.navItems){const s=e.toNumber(e.data(t,this.attrItem));s!==!1&&(t.hidden=!this.maxIndex||s>this.maxIndex||this.sets&&!e.includes(this.sets,s))}this.length&&!this.dragging&&!this.stack.length&&(this.reorder(),this._translate(1)),this.updateActiveClasses()},events:["resize"]},events:{beforeitemshow(t){!this.dragging&&this.sets&&this.stack.length<2&&!e.includes(this.sets,this.index)&&(this.index=this.getValidIndex());const s=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&&s>1){for(let i=0;i<s;i++)this.stack.splice(1,0,this.dir>0?"next":"previous");t.preventDefault();return}const n=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex;this.duration=N(this.avgWidth/this.velocity)*(e.dimensions(this.slides[n]).width/this.avgWidth),this.reorder()},itemshow(){~this.prevIndex&&e.addClass(this._getTransitioner().getItemIn(),this.clsActive)},itemshown(){this.updateActiveClasses()}},methods:{reorder(){if(this.finite){e.css(this.slides,"order","");return}const t=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((h,r)=>e.css(h,"order",this.dir>0&&r<t?1:this.dir<0&&r>=this.index?-1:"")),!this.center)return;const s=this.slides[t];let n=e.dimensions(this.list).width/2-e.dimensions(s).width/2,i=0;for(;n>0;){const h=this.getIndex(--i+t,t),r=this.slides[h];e.css(r,"order",h>t?-2:-1),n-=e.dimensions(r).width}},updateActiveClasses(){const t=this._getTransitioner(this.index).getActives(),s=[this.clsActive,(!this.sets||e.includes(this.sets,e.toFloat(this.index)))&&this.clsActivated||""];for(const n of this.slides){const i=e.includes(t,n);e.toggleClass(n,s,i),e.attr(n,"aria-hidden",!i);for(const h of e.$$(e.selFocusable,n))e.hasOwn(h,"_tabindex")||(h._tabindex=e.attr(h,"tabindex")),e.attr(h,"tabindex",i?h._tabindex:-1)}},getValidIndex(t=this.index,s=this.prevIndex){if(t=this.getIndex(t,s),!this.sets)return t;let n;do{if(e.includes(this.sets,t))return t;n=t,t=this.getIndex(t+this.dir,s)}while(t!==n);return t},getAdjacentSlides(){const{width:t}=e.dimensions(this.list),s=-t,n=t*2,i=e.dimensions(this.slides[this.index]).width,h=this.center?t/2-i/2:0,r=new Set;for(const a of[-1,1]){let o=h+(a>0?i:0),l=0;do{const d=this.slides[this.getIndex(this.index+a+l++*a)];o+=e.dimensions(d).width*a,r.add(d)}while(this.length>l&&o>s&&o<n)}return Array.from(r)}}};function Q(t,s){if(!t||t.length<2)return!0;const{width:n}=e.dimensions(t);if(!s)return Math.ceil(I(t))<Math.trunc(n+Y(t));const i=e.children(t),h=Math.trunc(n/2);for(const r in i){const a=i[r],o=e.dimensions(a).width,l=new Set([a]);let d=0;for(const c of[-1,1]){let f=o/2,g=0;for(;f<h;){const m=i[e.getIndex(+r+c+g++*c,i)];if(l.has(m))return!0;f+=e.dimensions(m).width,l.add(m)}d=Math.max(d,o/2+e.dimensions(i[e.getIndex(+r+c,i)]).width/2-(f-h))}if(d>e.sumBy(i.filter(c=>!l.has(c)),c=>e.dimensions(c).width))return!0}return!1}function Y(t){return Math.max(0,...e.children(t).map(s=>e.dimensions(s).width))}return typeof window<"u"&&window.UIkit&&window.UIkit.component("slider",D),D});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.16.16-dev.
|
|
1
|
+
/*! UIkit 3.16.16-dev.7b3ba4436 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
|
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
getCss(percent) {
|
|
298
298
|
const css2 = { transform: "", filter: "" };
|
|
299
299
|
for (const prop in this.props) {
|
|
300
|
-
this.props[prop](css2, percent);
|
|
300
|
+
this.props[prop](css2, uikitUtil.clamp(percent));
|
|
301
301
|
}
|
|
302
302
|
css2.willChange = Object.keys(css2).filter((key) => css2[key] !== "").map(uikitUtil.propName).join(",");
|
|
303
303
|
return css2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.16.16-dev.
|
|
1
|
+
/*! UIkit 3.16.16-dev.7b3ba4436 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */(function(i,b){typeof exports=="object"&&typeof module<"u"?module.exports=b(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslideshow_parallax",["uikit-util"],b):(i=typeof globalThis<"u"?globalThis:i||self,i.UIkitSlideshow_parallax=b(i.UIkit.util))})(this,function(i){"use strict";var b={props:{media:Boolean},data:{media:!1},connected(){const n=X(this.media,this.$el);if(this.matchMedia=!0,n){this.mediaObj=window.matchMedia(n);const e=()=>{this.matchMedia=this.mediaObj.matches,i.trigger(this.$el,i.createEvent("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=i.on(this.mediaObj,"change",()=>{e(),this.$emit("resize")}),e()}},disconnected(){var n;(n=this.offMediaObj)==null||n.call(this)}};function X(n,e){if(i.isString(n)){if(i.startsWith(n,"@"))n=i.toFloat(i.css(e,`--uk-breakpoint-${n.substr(1)}`));else if(isNaN(n))return n}return n&&i.isNumeric(n)?`(min-width: ${n}px)`:""}function A(n,e){var t;return(t=n==null?void 0:n.startsWith)==null?void 0:t.call(n,e)}const{isArray:Nn,from:Y}=Array;function Z(n){return typeof n=="function"}function C(n){return n!==null&&typeof n=="object"}function k(n){return C(n)&&n===n.window}function T(n){return E(n)>=1}function U(n){return E(n)===1}function E(n){return!k(n)&&C(n)&&n.nodeType}function M(n){return typeof n=="string"}function nn(n){return n===void 0}function x(n){return u(n)[0]}function u(n){return T(n)?[n]:Array.from(n||[]).filter(T)}function j(n){const e=Object.create(null);return t=>e[t]||(e[t]=n(t))}function O(n,e,t){var o;if(C(e)){for(const r in e)O(n,r,e[r]);return}if(nn(t))return(o=x(n))==null?void 0:o.getAttribute(e);for(const r of u(n))Z(t)&&(t=t.call(r,O(r,e))),t===null?tn(r,e):r.setAttribute(e,t)}function tn(n,e){u(n).forEach(t=>t.removeAttribute(e))}function W(n){var e;return(e=x(n))==null?void 0:e.parentElement}function en(n,e){return u(n).filter(t=>_(t,e))}function _(n,e){return u(n).some(t=>t.matches(e))}function R(n,e){return U(n)?n.closest(A(e,">")?e.slice(1):e):u(n).map(t=>R(t,e)).filter(Boolean)}function rn(n,e){n=x(n);const t=n?Y(n.children):[];return e?en(t,e):t}function on(n,e){return e?u(n).indexOf(x(e)):rn(W(n)).indexOf(n)}function sn(n,e){return u(dn(n,x(e),"querySelectorAll"))}const cn=/(^|[^\\],)\s*[!>+~-]/,an=j(n=>n.match(cn)),fn=/([!>+~-])(?=\s+[!>+~-]|\s*$)/g,un=j(n=>n.replace(fn,"$1 *"));function dn(n,e=document,t){if(!n||!M(n))return n;if(n=un(n),an(n)){const o=ln(n);n="";for(let r of o){let s=e;if(r[0]==="!"){const a=r.substr(1).trim().split(" ");if(s=R(W(e),a[0]),r=a.slice(1).join(" ").trim(),!r.length&&o.length===1)return s}if(r[0]==="-"){const a=r.substr(1).trim().split(" "),c=(s||e).previousElementSibling;s=_(c,r.substr(1))?c:null,r=a.slice(1).join(" ")}s&&(n+=`${n?",":""}${mn(s)} ${r}`)}e=document}try{return e[t](n)}catch{return null}}const hn=/.*?[^\\](?:,|$)/g,ln=j(n=>n.match(hn).map(e=>e.replace(/,$/,"").trim()));function mn(n){const e=[];for(;n.parentNode;){const t=O(n,"id");if(t){e.unshift(`#${gn(t)}`);break}else{let{tagName:o}=n;o!=="HTML"&&(o+=`:nth-child(${on(n)+1})`),e.unshift(o),n=n.parentNode}}return e.join(" > ")}function gn(n){return M(n)?CSS.escape(n):""}const bn=/^\s*<(\w+|!)[^>]*>/,xn=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;function $n(n){const e=xn.exec(n);if(e)return document.createElement(e[1]);const t=document.createElement("div");return bn.test(n)?t.insertAdjacentHTML("beforeend",n.trim()):t.textContent=n,yn(t.childNodes)}function yn(n){return n.length>1?n:n[0]}function wn(n,e){return pn(n)?u($n(n)):sn(n,e)}function pn(n){return M(n)&&A(n.trim(),"<")}function vn(n){return Math.ceil(Math.max(0,...wn("[stroke]",n).map(e=>{try{return e.getTotalLength()}catch{return 0}})))}const p={x:v,y:v,rotate:v,scale:v,color:I,backgroundColor:I,borderColor:I,blur:m,hue:m,fopacity:m,grayscale:m,invert:m,saturate:m,sepia:m,opacity:Cn,stroke:Mn,bgx:B,bgy:B},{keys:z}=Object;var Fn={mixins:[b],props:L(z(p),"list"),data:L(z(p),void 0),computed:{props(n,e){const t={};for(const r in n)r in p&&!i.isUndefined(n[r])&&(t[r]=n[r].slice());const o={};for(const r in t)o[r]=p[r](r,e,t[r],t);return o}},events:{load(){this.$emit()}},methods:{reset(){for(const n in this.getCss(0))i.css(this.$el,n,"")},getCss(n){const e={transform:"",filter:""};for(const t in this.props)this.props[t](e,i.clamp(n));return e.willChange=Object.keys(e).filter(t=>e[t]!=="").map(i.propName).join(","),e}}};function v(n,e,t){let o=S(t)||{x:"px",y:"px",rotate:"deg"}[n]||"",r;return n==="x"||n==="y"?(n=`translate${i.ucfirst(n)}`,r=s=>i.toFloat(i.toFloat(s).toFixed(o==="px"?0:6))):n==="scale"&&(o="",r=s=>S([s])?i.toPx(s,"width",e,!0)/e.offsetWidth:s),t.length===1&&t.unshift(n==="scale"?1:0),t=g(t,r),(s,a)=>{s.transform+=` ${n}(${$(t,a)}${o})`}}function I(n,e,t){return t.length===1&&t.unshift(y(e,n,"")),t=g(t,o=>Sn(e,o)),(o,r)=>{const[s,a,c]=q(t,r),h=s.map((l,f)=>(l+=c*(a[f]-l),f===3?i.toFloat(l):parseInt(l,10))).join(",");o[n]=`rgba(${h})`}}function Sn(n,e){return y(n,"color",e).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(i.toFloat)}function m(n,e,t){t.length===1&&t.unshift(0);const o=S(t)||{blur:"px",hue:"deg"}[n]||"%";return n={fopacity:"opacity",hue:"hue-rotate"}[n]||n,t=g(t),(r,s)=>{const a=$(t,s);r.filter+=` ${n}(${a+o})`}}function Cn(n,e,t){return t.length===1&&t.unshift(y(e,n,"")),t=g(t),(o,r)=>{o[n]=$(t,r)}}function Mn(n,e,t){t.length===1&&t.unshift(0);const o=S(t),r=vn(e);return t=g(t.reverse(),s=>(s=i.toFloat(s),o==="%"?s*r/100:s)),t.some(([s])=>s)?(i.css(e,"strokeDasharray",r),(s,a)=>{s.strokeDashoffset=$(t,a)}):i.noop}function B(n,e,t,o){t.length===1&&t.unshift(0);const r=n==="bgy"?"height":"width";o[n]=g(t,c=>i.toPx(c,r,e));const s=["bgx","bgy"].filter(c=>c in o);if(s.length===2&&n==="bgx")return i.noop;if(y(e,"backgroundSize","")==="cover")return jn(n,e,t,o);const a={};for(const c of s)a[c]=D(e,c);return H(s,a,o)}function jn(n,e,t,o){const r=On(e);if(!r.width)return i.noop;const s={width:e.offsetWidth,height:e.offsetHeight},a=["bgx","bgy"].filter(f=>f in o),c={};for(const f of a){const d=o[f].map(([Pn])=>Pn),w=Math.min(...d),N=Math.max(...d),K=d.indexOf(w)<d.indexOf(N),Q=N-w;c[f]=`${(K?-Q:0)-(K?w:N)}px`,s[f==="bgy"?"height":"width"]+=Q}const h=i.Dimensions.cover(r,s);for(const f of a){const d=f==="bgy"?"height":"width",w=h[d]-s[d];c[f]=`max(${D(e,f)},-${w}px) + ${c[f]}`}const l=H(a,c,o);return(f,d)=>{l(f,d),f.backgroundSize=`${h.width}px ${h.height}px`,f.backgroundRepeat="no-repeat"}}function D(n,e){return y(n,`background-position-${e.substr(-1)}`,"")}function H(n,e,t){return function(o,r){for(const s of n){const a=$(t[s],r);o[`background-position-${s.substr(-1)}`]=`calc(${e[s]} + ${a}px)`}}}const F={};function On(n){const e=i.css(n,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(F[e])return F[e];const t=new Image;return e&&(t.src=e,!t.naturalWidth)?(t.onload=()=>{F[e]=P(t),i.trigger(n,i.createEvent("load",!1))},P(t)):F[e]=P(t)}function P(n){return{width:n.naturalWidth,height:n.naturalHeight}}function g(n,e=i.toFloat){const t=[],{length:o}=n;let r=0;for(let s=0;s<o;s++){let[a,c]=i.isString(n[s])?n[s].trim().split(/ (?![^(]*\))/):[n[s]];if(a=e(a),c=c?i.toFloat(c)/100:null,s===0?c===null?c=0:c&&t.push([a,0]):s===o-1&&(c===null?c=1:c!==1&&(t.push([a,c]),c=1)),t.push([a,c]),c===null)r++;else if(r){const h=t[s-r-1][1],l=(c-h)/(r+1);for(let f=r;f>0;f--)t[s-f][1]=h+l*(r-f+1);r=0}}return t}function q(n,e){const t=i.findIndex(n.slice(1),([,o])=>e<=o)+1;return[n[t-1][0],n[t][0],(e-n[t-1][1])/(n[t][1]-n[t-1][1])]}function $(n,e){const[t,o,r]=q(n,e);return i.isNumber(t)?t+Math.abs(t-o)*r*(t<o?1:-1):+o}const In=/^-?\d+(\S+)?/;function S(n,e){var t;for(const o of n){const r=(t=o.match)==null?void 0:t.call(o,In);if(r)return r[1]}return e}function y(n,e,t){const o=n.style[e],r=i.css(i.css(n,e,t),e);return n.style[e]=o,r}function L(n,e){return n.reduce((t,o)=>(t[o]=e,t),{})}var V={mixins:[Fn],data:{selItem:"!li"},beforeConnect(){this.item=i.query(this.selItem,this.$el)},disconnected(){this.item=null},events:[{name:"itemin itemout",self:!0,el(){return this.item},handler({type:n,detail:{percent:e,duration:t,timing:o,dir:r}}){i.fastdom.read(()=>{if(!this.matchMedia)return;const s=this.getCss(J(n,r,e)),a=this.getCss(G(n)?.5:r>0?1:0);i.fastdom.write(()=>{i.css(this.$el,s),i.Transition.start(this.$el,a,t,o).catch(i.noop)})})}},{name:"transitioncanceled transitionend",self:!0,el(){return this.item},handler(){i.Transition.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el(){return this.item},handler({type:n,detail:{percent:e,dir:t}}){i.fastdom.read(()=>{if(!this.matchMedia){this.reset();return}const o=this.getCss(J(n,t,e));i.fastdom.write(()=>i.css(this.$el,o))})}}]};function G(n){return i.endsWith(n,"in")}function J(n,e,t){return t/=2,G(n)^e<0?t:1-t}return typeof window<"u"&&window.UIkit&&window.UIkit.component("slideshowParallax",V),V});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.16.16-dev.
|
|
1
|
+
/*! UIkit 3.16.16-dev.7b3ba4436 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
function Transitioner(prev, next, dir, { animation, easing }) {
|
|
43
43
|
const { percent, translate, show = util.noop } = animation;
|
|
44
44
|
const props = show(dir);
|
|
45
|
-
|
|
45
|
+
let resolve;
|
|
46
46
|
return {
|
|
47
47
|
dir,
|
|
48
48
|
show(duration, percent2 = 0, linear) {
|
|
@@ -51,25 +51,27 @@
|
|
|
51
51
|
this.translate(percent2);
|
|
52
52
|
triggerUpdate(next, "itemin", { percent: percent2, duration, timing, dir });
|
|
53
53
|
triggerUpdate(prev, "itemout", { percent: 1 - percent2, duration, timing, dir });
|
|
54
|
-
Promise
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
return new Promise((res) => {
|
|
55
|
+
resolve || (resolve = res);
|
|
56
|
+
Promise.all([
|
|
57
|
+
util.Transition.start(next, props[1], duration, timing),
|
|
58
|
+
util.Transition.start(prev, props[0], duration, timing)
|
|
59
|
+
]).then(() => {
|
|
60
|
+
this.reset();
|
|
61
|
+
resolve();
|
|
62
|
+
}, util.noop);
|
|
63
|
+
});
|
|
62
64
|
},
|
|
63
65
|
cancel() {
|
|
64
|
-
util.Transition.cancel([next, prev]);
|
|
66
|
+
return util.Transition.cancel([next, prev]);
|
|
65
67
|
},
|
|
66
68
|
reset() {
|
|
67
69
|
for (const prop in props[0]) {
|
|
68
70
|
util.css([next, prev], prop, "");
|
|
69
71
|
}
|
|
70
72
|
},
|
|
71
|
-
forward(duration, percent2 = this.percent()) {
|
|
72
|
-
|
|
73
|
+
async forward(duration, percent2 = this.percent()) {
|
|
74
|
+
await this.cancel();
|
|
73
75
|
return this.show(duration, percent2, true);
|
|
74
76
|
},
|
|
75
77
|
translate(percent2) {
|
|
@@ -294,7 +296,7 @@
|
|
|
294
296
|
if (active) {
|
|
295
297
|
focusEl = button;
|
|
296
298
|
}
|
|
297
|
-
focus
|
|
299
|
+
focus || (focus = util.matches(button, ":focus"));
|
|
298
300
|
} else {
|
|
299
301
|
util.toggleClass(
|
|
300
302
|
el,
|
|
@@ -390,17 +392,16 @@
|
|
|
390
392
|
e.cancelable && e.preventDefault();
|
|
391
393
|
this.dragging = true;
|
|
392
394
|
this.dir = distance < 0 ? 1 : -1;
|
|
393
|
-
|
|
394
|
-
let { prevIndex } = this;
|
|
395
|
+
let { slides, prevIndex } = this;
|
|
395
396
|
let dis = Math.abs(distance);
|
|
396
|
-
let nextIndex = this.getIndex(prevIndex + this.dir
|
|
397
|
-
let width = this._getDistance(prevIndex, nextIndex)
|
|
397
|
+
let nextIndex = this.getIndex(prevIndex + this.dir);
|
|
398
|
+
let width = this._getDistance(prevIndex, nextIndex);
|
|
398
399
|
while (nextIndex !== prevIndex && dis > width) {
|
|
399
400
|
this.drag -= width * this.dir;
|
|
400
401
|
prevIndex = nextIndex;
|
|
401
402
|
dis -= width;
|
|
402
|
-
nextIndex = this.getIndex(prevIndex + this.dir
|
|
403
|
-
width = this._getDistance(prevIndex, nextIndex)
|
|
403
|
+
nextIndex = this.getIndex(prevIndex + this.dir);
|
|
404
|
+
width = this._getDistance(prevIndex, nextIndex);
|
|
404
405
|
}
|
|
405
406
|
this.percent = dis / width;
|
|
406
407
|
const prev = slides[prevIndex];
|
|
@@ -456,6 +457,9 @@
|
|
|
456
457
|
}
|
|
457
458
|
util.css(this.list, { userSelect: "", pointerEvents: "" });
|
|
458
459
|
this.drag = this.percent = null;
|
|
460
|
+
},
|
|
461
|
+
_getDistance(prev, next) {
|
|
462
|
+
return this._getTransitioner(prev, prev !== next && next).getDistance() || this.slides[prev].offsetWidth;
|
|
459
463
|
}
|
|
460
464
|
}
|
|
461
465
|
};
|
|
@@ -675,9 +679,6 @@
|
|
|
675
679
|
this.percent
|
|
676
680
|
);
|
|
677
681
|
},
|
|
678
|
-
_getDistance(prev, next) {
|
|
679
|
-
return this._getTransitioner(prev, prev !== next && next).getDistance();
|
|
680
|
-
},
|
|
681
682
|
_translate(percent, prev = this.prevIndex, next = this.index) {
|
|
682
683
|
const transitioner = this._getTransitioner(prev === next ? false : prev, next);
|
|
683
684
|
transitioner.translate(percent);
|
|
@@ -685,8 +686,8 @@
|
|
|
685
686
|
},
|
|
686
687
|
_getTransitioner(prev = this.prevIndex, next = this.index, dir = this.dir || 1, options = this.transitionOptions) {
|
|
687
688
|
return new this.Transitioner(
|
|
688
|
-
|
|
689
|
-
|
|
689
|
+
this.slides[prev] || prev,
|
|
690
|
+
this.slides[next] || next,
|
|
690
691
|
dir * (util.isRtl ? -1 : 1),
|
|
691
692
|
options
|
|
692
693
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.16.16-dev.4d5c42e53 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */(function(e,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslideshow",["uikit-util"],p):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkitSlideshow=p(e.UIkit.util))})(this,function(e){"use strict";var p={connected(){e.addClass(this.$el,this.$options.id)}},$={slide:{show(t){return[{transform:d(t*-100)},{transform:d()}]},percent(t){return g(t)},translate(t,s){return[{transform:d(s*-100*t)},{transform:d(s*100*(1-t))}]}}};function g(t){return Math.abs(e.css(t,"transform").split(",")[4]/t.offsetWidth)||0}function d(t=0,s="%"){return t+=t?s:"",`translate3d(${t}, 0, 0)`}function z(t){return`scale3d(${t}, ${t}, 1)`}function S(t,s,i,{animation:n,easing:o}){const{percent:r,translate:c,show:a=e.noop}=n,m=a(i),f=new e.Deferred;return{dir:i,show(h,l=0,x){const I=x?"linear":o;return h-=Math.round(h*e.clamp(l,-1,1)),this.translate(l),v(s,"itemin",{percent:l,duration:h,timing:I,dir:i}),v(t,"itemout",{percent:1-l,duration:h,timing:I,dir:i}),Promise.all([e.Transition.start(s,m[1],h,I),e.Transition.start(t,m[0],h,I)]).then(()=>{this.reset(),f.resolve()},e.noop),f.promise},cancel(){e.Transition.cancel([s,t])},reset(){for(const h in m[0])e.css([s,t],h,"")},forward(h,l=this.percent()){return e.Transition.cancel([s,t]),this.show(h,l,!0)},translate(h){this.reset();const l=c(h,i);e.css(s,l[1]),e.css(t,l[0]),v(s,"itemtranslatein",{percent:h,dir:i}),v(t,"itemtranslateout",{percent:1-h,dir:i})},percent(){return r(t||s,s,i)},getDistance(){return t==null?void 0:t.offsetWidth}}}function v(t,s,i){e.trigger(t,e.createEvent(s,!1,!1,i))}var C={props:{i18n:Object},data:{i18n:null},methods:{t(t,...s){var i,n,o;let r=0;return((o=((i=this.i18n)==null?void 0:i[t])||((n=this.$options.i18n)==null?void 0:n[t]))==null?void 0:o.replace(/%s/g,()=>s[r++]||""))||""}}};const u={TAB:9,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};function w(t,s=t.$el,i=""){if(s.id)return s.id;let n=`${t.$options.id}-${t._uid}${i}`;return e.$(`#${n}`)&&(n=w(t,s,`${i}-2`)),n}var T={i18n:{next:"Next slide",previous:"Previous slide",slideX:"Slide %s",slideLabel:"%s of %s",role:"String"},data:{selNav:!1,role:"region"},computed:{nav({selNav:t},s){return e.$(t,s)},navChildren(){return e.children(this.nav)},selNavItem({attrItem:t}){return`[${t}],[data-${t}]`},navItems(t,s){return e.$$(this.selNavItem,s)}},watch:{nav(t,s){e.attr(t,"role","tablist"),s&&this.$emit()},list(t){e.attr(t,"role","presentation")},navChildren(t){e.attr(t,"role","presentation")},navItems(t){for(const s of t){const i=e.data(s,this.attrItem),n=e.$("a,button",s)||s;let o,r=null;if(e.isNumeric(i)){const c=e.toNumber(i),a=this.slides[c];a&&(a.id||(a.id=w(this,a,`-item-${i}`)),r=a.id),o=this.t("slideX",e.toFloat(i)+1),e.attr(n,"role","tab")}else this.list&&(this.list.id||(this.list.id=w(this,this.list,"-items")),r=this.list.id),o=this.t(i);e.attr(n,{"aria-controls":r,"aria-label":e.attr(n,"aria-label")||o})}},slides(t){t.forEach((s,i)=>e.attr(s,{role:this.nav?"tabpanel":"group","aria-label":this.t("slideLabel",i+1,this.length),"aria-roledescription":this.nav?null:"slide"}))},length(t){const s=this.navChildren.length;if(this.nav&&t!==s){e.empty(this.nav);for(let i=0;i<t;i++)e.append(this.nav,`<li ${this.attrItem}="${i}"><a href></a></li>`)}}},connected(){e.attr(this.$el,{role:this.role,ariaRoleDescription:"carousel"})},update:[{write(){this.navItems.concat(this.nav).forEach(t=>t&&(t.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]}],events:[{name:"click keydown",delegate(){return this.selNavItem},handler(t){e.closest(t.target,"a,button")&&(t.type==="click"||t.keyCode===u.SPACE)&&(t.preventDefault(),this.show(e.data(t.current,this.attrItem)))}},{name:"itemshow",handler:"updateNav"},{name:"keydown",delegate(){return this.selNavItem},handler(t){const{current:s,keyCode:i}=t,n=e.data(s,this.attrItem);if(!e.isNumeric(n))return;let o=i===u.HOME?0:i===u.END?"last":i===u.LEFT?"previous":i===u.RIGHT?"next":-1;~o&&(t.preventDefault(),this.show(o))}}],methods:{updateNav(){const t=this.getValidIndex();let s,i;for(const n of this.navItems){const o=e.data(n,this.attrItem),r=e.$("a,button",n)||n;if(e.isNumeric(o)){const a=e.toNumber(o)===t;e.toggleClass(n,this.clsActive,a),e.attr(r,{"aria-selected":a,tabindex:a?null:-1}),a&&(i=r),s=s||e.matches(r,":focus")}else e.toggleClass(n,"uk-invisible",this.finite&&(o==="previous"&&t===0||o==="next"&&t>=this.maxIndex));s&&i&&i.focus()}}}};const b={passive:!1,capture:!0},A={passive:!0,capture:!0},D="touchstart mousedown",y="touchmove mousemove",_="touchend touchcancel mouseup click input scroll";var E={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const t of["start","move","end"]){const s=this[t];this[t]=i=>{const n=e.getEventPos(i).x*(e.isRtl?-1:1);this.prevPos=n===this.pos?this.prevPos:this.pos,this.pos=n,s(i)}}},events:[{name:D,passive:!0,delegate(){return`${this.selList} > *`},handler(t){!this.draggable||!e.isTouch(t)&&H(t.target)||e.closest(t.target,e.selInput)||t.button>0||this.length<2||this.start(t)}},{name:"dragstart",handler(t){t.preventDefault()}},{name:y,el(){return this.list},handler:e.noop,...b}],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,y,this.move,b),e.on(document,_,this.end,A),e.css(this.list,"userSelect","none")},move(t){const s=this.pos-this.drag;if(s===0||this.prevPos===this.pos||!this.dragging&&Math.abs(s)<this.threshold)return;e.css(this.list,"pointerEvents","none"),t.cancelable&&t.preventDefault(),this.dragging=!0,this.dir=s<0?1:-1;const{slides:i}=this;let{prevIndex:n}=this,o=Math.abs(s),r=this.getIndex(n+this.dir,n),c=this._getDistance(n,r)||i[n].offsetWidth;for(;r!==n&&o>c;)this.drag-=c*this.dir,n=r,o-=c,r=this.getIndex(n+this.dir,n),c=this._getDistance(n,r)||i[n].offsetWidth;this.percent=o/c;const a=i[n],m=i[r],f=this.index!==r,h=n===r;let l;for(const x of[this.index,this.prevIndex])e.includes([r,n],x)||(e.trigger(i[x],"itemhidden",[this]),h&&(l=!0,this.prevIndex=n));(this.index===n&&this.prevIndex!==n||l)&&e.trigger(i[this.index],"itemshown",[this]),f&&(this.prevIndex=n,this.index=r,!h&&e.trigger(a,"beforeitemhide",[this]),e.trigger(m,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),a,!h&&m),f&&(!h&&e.trigger(a,"itemhide",[this]),e.trigger(m,"itemshow",[this]))},end(){if(e.off(document,y,this.move,b),e.off(document,_,this.end,A),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=(e.isRtl?this.dir*(e.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)}e.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function H(t){return e.css(t,"userSelect")!=="none"&&e.toArray(t.childNodes).some(s=>s.nodeType===3&&s.textContent.trim())}var M={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){e.attr(this.list,"aria-live",this.autoplay?"off":"polite"),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.stack.length||this.draggable&&e.matches(this.$el,":focus-within")||this.pauseOnHover&&e.matches(this.$el,":hover")||this.show("next")},this.autoplayInterval)},stopAutoplay(){clearInterval(this.interval)}}};function O(t){return N(e.observeResize,t,"resize")}function P(t){return N(e.observeIntersection,t)}function R(t={}){return P({handler:function(s,i){const{targets:n=this.$el,preload:o=5}=t;for(const r of e.toNodes(e.isFunction(n)?n(this):n))e.$$('[loading="lazy"]',r).slice(0,o-1).forEach(c=>e.removeAttr(c,"loading"));for(const r of s.filter(({isIntersecting:c})=>c).map(({target:c})=>c))i.unobserve(r)},...t})}function N(t,s,i){return{observe:t,handler(){this.$emit(i)},...s}}var U={mixins:[M,E,T,C],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){e.removeClass(this.slides,this.clsActive)},computed:{duration({velocity:t},s){return W(s.offsetWidth/t)},list({selList:t},s){return e.$(t,s)},maxIndex(){return this.length-1},slides(){return e.children(this.list)},length(){return this.slides.length}},watch:{slides(t,s){s&&this.$emit()}},observe:O(),methods:{show(t,s=!1){var i;if(this.dragging||!this.length)return;const{stack:n}=this,o=s?0:n.length,r=()=>{n.splice(o,1),n.length&&this.show(n.shift(),!0)};if(n[s?"unshift":"push"](t),!s&&n.length>1){n.length===2&&((i=this._transitioner)==null||i.forward(Math.min(this.duration,200)));return}const c=this.getIndex(this.index),a=e.hasClass(this.slides,this.clsActive)&&this.slides[c],m=this.getIndex(t,this.index),f=this.slides[m];if(a===f){r();return}if(this.dir=L(t,c),this.prevIndex=c,this.index=m,a&&!e.trigger(a,"beforeitemhide",[this])||!e.trigger(f,"beforeitemshow",[this,a])){this.index=this.prevIndex,r();return}const h=this._show(a,f,s).then(()=>{a&&e.trigger(a,"itemhidden",[this]),e.trigger(f,"itemshown",[this]),n.shift(),this._transitioner=null,requestAnimationFrame(()=>n.length&&this.show(n.shift(),!0))});return a&&e.trigger(a,"itemhide",[this]),e.trigger(f,"itemshow",[this]),h},getIndex(t=this.index,s=this.index){return e.clamp(e.getIndex(t,this.slides,s,this.finite),0,Math.max(0,this.maxIndex))},getValidIndex(t=this.index,s=this.prevIndex){return this.getIndex(t,s)},_show(t,s,i){if(this._transitioner=this._getTransitioner(t,s,this.dir,{easing:i?s.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}),!i&&!t)return this._translate(1),Promise.resolve();const{length:n}=this.stack;return this._transitioner[n>1?"forward":"show"](n>1?Math.min(this.duration,75+75/(n-1)):this.duration,this.percent)},_getDistance(t,s){return this._getTransitioner(t,t!==s&&s).getDistance()},_translate(t,s=this.prevIndex,i=this.index){const n=this._getTransitioner(s===i?!1:s,i);return n.translate(t),n},_getTransitioner(t=this.prevIndex,s=this.index,i=this.dir||1,n=this.transitionOptions){return new this.Transitioner(e.isNumber(t)?this.slides[t]:t,e.isNumber(s)?this.slides[s]:s,i*(e.isRtl?-1:1),n)}}};function L(t,s){return t==="next"?1:t==="previous"||t<s?-1:1}function W(t){return .5*t+300}var B={mixins:[U],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:$,Transitioner:S},computed:{animation({animation:t,Animations:s}){return{...s[t]||s.slide,name:t}},transitionOptions(){return{animation:this.animation}}},events:{beforeitemshow({target:t}){e.addClass(t,this.clsActive)},itemshown({target:t}){e.addClass(t,this.clsActivated)},itemhidden({target:t}){e.removeClass(t,this.clsActive,this.clsActivated)}}},j={...$,fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(t){return 1-e.css(t,"opacity")},translate(t){return[{opacity:1-t,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:z(1+.5),zIndex:0},{zIndex:-1}]},percent(t){return 1-e.css(t,"opacity")},translate(t){return[{opacity:1-t,transform:z(1+.5*t),zIndex:0},{zIndex:-1}]}},pull:{show(t){return t<0?[{transform:d(30),zIndex:-1},{transform:d(),zIndex:0}]:[{transform:d(-100),zIndex:0},{transform:d(),zIndex:-1}]},percent(t,s,i){return i<0?1-g(s):g(t)},translate(t,s){return s<0?[{transform:d(30*t),zIndex:-1},{transform:d(-100*(1-t)),zIndex:0}]:[{transform:d(-t*100),zIndex:0},{transform:d(30*(1-t)),zIndex:-1}]}},push:{show(t){return t<0?[{transform:d(100),zIndex:0},{transform:d(),zIndex:-1}]:[{transform:d(-30),zIndex:-1},{transform:d(),zIndex:0}]},percent(t,s,i){return i>0?1-g(s):g(t)},translate(t,s){return s<0?[{transform:d(t*100),zIndex:0},{transform:d(-30*(1-t)),zIndex:-1}]:[{transform:d(-30*t),zIndex:-1},{transform:d(100*(1-t)),zIndex:0}]}}},F={update:{write(){if(this.stack.length||this.dragging)return;const t=this.getValidIndex(this.index);!~this.prevIndex||this.index!==t?this.show(t):this._translate(1,this.prevIndex,this.index)},events:["resize"]}},V={observe:R({target:({slides:t})=>t,targets:t=>t.getAdjacentSlides()})},k={mixins:[p,B,F,V],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:j},update:{read(){if(!this.list)return!1;let[t,s]=this.ratio.split(":").map(Number);return s=s*this.list.offsetWidth/t||0,this.minHeight&&(s=Math.max(this.minHeight,s)),this.maxHeight&&(s=Math.min(this.maxHeight,s)),{height:s-e.boxModelAdjust(this.list,"height","content-box")}},write({height:t}){t>0&&e.css(this.list,"minHeight",t)},events:["resize"]},methods:{getAdjacentSlides(){return[1,-1].map(t=>this.slides[this.getIndex(this.index+t)])}}};return typeof window<"u"&&window.UIkit&&window.UIkit.component("slideshow",k),k});
|
|
1
|
+
/*! UIkit 3.16.16-dev.7b3ba4436 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */(function(e,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslideshow",["uikit-util"],p):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkitSlideshow=p(e.UIkit.util))})(this,function(e){"use strict";var p={connected(){e.addClass(this.$el,this.$options.id)}},$={slide:{show(t){return[{transform:d(t*-100)},{transform:d()}]},percent(t){return g(t)},translate(t,s){return[{transform:d(s*-100*t)},{transform:d(s*100*(1-t))}]}}};function g(t){return Math.abs(e.css(t,"transform").split(",")[4]/t.offsetWidth)||0}function d(t=0,s="%"){return t+=t?s:"",`translate3d(${t}, 0, 0)`}function z(t){return`scale3d(${t}, ${t}, 1)`}function S(t,s,i,{animation:n,easing:o}){const{percent:r,translate:l,show:a=e.noop}=n,m=a(i);let c;return{dir:i,show(h,f=0,x){const I=x?"linear":o;return h-=Math.round(h*e.clamp(f,-1,1)),this.translate(f),v(s,"itemin",{percent:f,duration:h,timing:I,dir:i}),v(t,"itemout",{percent:1-f,duration:h,timing:I,dir:i}),new Promise(q=>{c||(c=q),Promise.all([e.Transition.start(s,m[1],h,I),e.Transition.start(t,m[0],h,I)]).then(()=>{this.reset(),c()},e.noop)})},cancel(){return e.Transition.cancel([s,t])},reset(){for(const h in m[0])e.css([s,t],h,"")},async forward(h,f=this.percent()){return await this.cancel(),this.show(h,f,!0)},translate(h){this.reset();const f=l(h,i);e.css(s,f[1]),e.css(t,f[0]),v(s,"itemtranslatein",{percent:h,dir:i}),v(t,"itemtranslateout",{percent:1-h,dir:i})},percent(){return r(t||s,s,i)},getDistance(){return t==null?void 0:t.offsetWidth}}}function v(t,s,i){e.trigger(t,e.createEvent(s,!1,!1,i))}var C={props:{i18n:Object},data:{i18n:null},methods:{t(t,...s){var i,n,o;let r=0;return((o=((i=this.i18n)==null?void 0:i[t])||((n=this.$options.i18n)==null?void 0:n[t]))==null?void 0:o.replace(/%s/g,()=>s[r++]||""))||""}}};const u={TAB:9,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};function w(t,s=t.$el,i=""){if(s.id)return s.id;let n=`${t.$options.id}-${t._uid}${i}`;return e.$(`#${n}`)&&(n=w(t,s,`${i}-2`)),n}var T={i18n:{next:"Next slide",previous:"Previous slide",slideX:"Slide %s",slideLabel:"%s of %s",role:"String"},data:{selNav:!1,role:"region"},computed:{nav({selNav:t},s){return e.$(t,s)},navChildren(){return e.children(this.nav)},selNavItem({attrItem:t}){return`[${t}],[data-${t}]`},navItems(t,s){return e.$$(this.selNavItem,s)}},watch:{nav(t,s){e.attr(t,"role","tablist"),s&&this.$emit()},list(t){e.attr(t,"role","presentation")},navChildren(t){e.attr(t,"role","presentation")},navItems(t){for(const s of t){const i=e.data(s,this.attrItem),n=e.$("a,button",s)||s;let o,r=null;if(e.isNumeric(i)){const l=e.toNumber(i),a=this.slides[l];a&&(a.id||(a.id=w(this,a,`-item-${i}`)),r=a.id),o=this.t("slideX",e.toFloat(i)+1),e.attr(n,"role","tab")}else this.list&&(this.list.id||(this.list.id=w(this,this.list,"-items")),r=this.list.id),o=this.t(i);e.attr(n,{"aria-controls":r,"aria-label":e.attr(n,"aria-label")||o})}},slides(t){t.forEach((s,i)=>e.attr(s,{role:this.nav?"tabpanel":"group","aria-label":this.t("slideLabel",i+1,this.length),"aria-roledescription":this.nav?null:"slide"}))},length(t){const s=this.navChildren.length;if(this.nav&&t!==s){e.empty(this.nav);for(let i=0;i<t;i++)e.append(this.nav,`<li ${this.attrItem}="${i}"><a href></a></li>`)}}},connected(){e.attr(this.$el,{role:this.role,ariaRoleDescription:"carousel"})},update:[{write(){this.navItems.concat(this.nav).forEach(t=>t&&(t.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]}],events:[{name:"click keydown",delegate(){return this.selNavItem},handler(t){e.closest(t.target,"a,button")&&(t.type==="click"||t.keyCode===u.SPACE)&&(t.preventDefault(),this.show(e.data(t.current,this.attrItem)))}},{name:"itemshow",handler:"updateNav"},{name:"keydown",delegate(){return this.selNavItem},handler(t){const{current:s,keyCode:i}=t,n=e.data(s,this.attrItem);if(!e.isNumeric(n))return;let o=i===u.HOME?0:i===u.END?"last":i===u.LEFT?"previous":i===u.RIGHT?"next":-1;~o&&(t.preventDefault(),this.show(o))}}],methods:{updateNav(){const t=this.getValidIndex();let s,i;for(const n of this.navItems){const o=e.data(n,this.attrItem),r=e.$("a,button",n)||n;if(e.isNumeric(o)){const a=e.toNumber(o)===t;e.toggleClass(n,this.clsActive,a),e.attr(r,{"aria-selected":a,tabindex:a?null:-1}),a&&(i=r),s||(s=e.matches(r,":focus"))}else e.toggleClass(n,"uk-invisible",this.finite&&(o==="previous"&&t===0||o==="next"&&t>=this.maxIndex));s&&i&&i.focus()}}}};const b={passive:!1,capture:!0},A={passive:!0,capture:!0},D="touchstart mousedown",y="touchmove mousemove",_="touchend touchcancel mouseup click input scroll";var E={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const t of["start","move","end"]){const s=this[t];this[t]=i=>{const n=e.getEventPos(i).x*(e.isRtl?-1:1);this.prevPos=n===this.pos?this.prevPos:this.pos,this.pos=n,s(i)}}},events:[{name:D,passive:!0,delegate(){return`${this.selList} > *`},handler(t){!this.draggable||!e.isTouch(t)&&H(t.target)||e.closest(t.target,e.selInput)||t.button>0||this.length<2||this.start(t)}},{name:"dragstart",handler(t){t.preventDefault()}},{name:y,el(){return this.list},handler:e.noop,...b}],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,y,this.move,b),e.on(document,_,this.end,A),e.css(this.list,"userSelect","none")},move(t){const s=this.pos-this.drag;if(s===0||this.prevPos===this.pos||!this.dragging&&Math.abs(s)<this.threshold)return;e.css(this.list,"pointerEvents","none"),t.cancelable&&t.preventDefault(),this.dragging=!0,this.dir=s<0?1:-1;let{slides:i,prevIndex:n}=this,o=Math.abs(s),r=this.getIndex(n+this.dir),l=this._getDistance(n,r);for(;r!==n&&o>l;)this.drag-=l*this.dir,n=r,o-=l,r=this.getIndex(n+this.dir),l=this._getDistance(n,r);this.percent=o/l;const a=i[n],m=i[r],c=this.index!==r,h=n===r;let f;for(const x of[this.index,this.prevIndex])e.includes([r,n],x)||(e.trigger(i[x],"itemhidden",[this]),h&&(f=!0,this.prevIndex=n));(this.index===n&&this.prevIndex!==n||f)&&e.trigger(i[this.index],"itemshown",[this]),c&&(this.prevIndex=n,this.index=r,!h&&e.trigger(a,"beforeitemhide",[this]),e.trigger(m,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),a,!h&&m),c&&(!h&&e.trigger(a,"itemhide",[this]),e.trigger(m,"itemshow",[this]))},end(){if(e.off(document,y,this.move,b),e.off(document,_,this.end,A),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=(e.isRtl?this.dir*(e.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)}e.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null},_getDistance(t,s){return this._getTransitioner(t,t!==s&&s).getDistance()||this.slides[t].offsetWidth}}};function H(t){return e.css(t,"userSelect")!=="none"&&e.toArray(t.childNodes).some(s=>s.nodeType===3&&s.textContent.trim())}var M={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){e.attr(this.list,"aria-live",this.autoplay?"off":"polite"),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.stack.length||this.draggable&&e.matches(this.$el,":focus-within")||this.pauseOnHover&&e.matches(this.$el,":hover")||this.show("next")},this.autoplayInterval)},stopAutoplay(){clearInterval(this.interval)}}};function O(t){return k(e.observeResize,t,"resize")}function P(t){return k(e.observeIntersection,t)}function R(t={}){return P({handler:function(s,i){const{targets:n=this.$el,preload:o=5}=t;for(const r of e.toNodes(e.isFunction(n)?n(this):n))e.$$('[loading="lazy"]',r).slice(0,o-1).forEach(l=>e.removeAttr(l,"loading"));for(const r of s.filter(({isIntersecting:l})=>l).map(({target:l})=>l))i.unobserve(r)},...t})}function k(t,s,i){return{observe:t,handler(){this.$emit(i)},...s}}var U={mixins:[M,E,T,C],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){e.removeClass(this.slides,this.clsActive)},computed:{duration({velocity:t},s){return W(s.offsetWidth/t)},list({selList:t},s){return e.$(t,s)},maxIndex(){return this.length-1},slides(){return e.children(this.list)},length(){return this.slides.length}},watch:{slides(t,s){s&&this.$emit()}},observe:O(),methods:{show(t,s=!1){var i;if(this.dragging||!this.length)return;const{stack:n}=this,o=s?0:n.length,r=()=>{n.splice(o,1),n.length&&this.show(n.shift(),!0)};if(n[s?"unshift":"push"](t),!s&&n.length>1){n.length===2&&((i=this._transitioner)==null||i.forward(Math.min(this.duration,200)));return}const l=this.getIndex(this.index),a=e.hasClass(this.slides,this.clsActive)&&this.slides[l],m=this.getIndex(t,this.index),c=this.slides[m];if(a===c){r();return}if(this.dir=L(t,l),this.prevIndex=l,this.index=m,a&&!e.trigger(a,"beforeitemhide",[this])||!e.trigger(c,"beforeitemshow",[this,a])){this.index=this.prevIndex,r();return}const h=this._show(a,c,s).then(()=>{a&&e.trigger(a,"itemhidden",[this]),e.trigger(c,"itemshown",[this]),n.shift(),this._transitioner=null,requestAnimationFrame(()=>n.length&&this.show(n.shift(),!0))});return a&&e.trigger(a,"itemhide",[this]),e.trigger(c,"itemshow",[this]),h},getIndex(t=this.index,s=this.index){return e.clamp(e.getIndex(t,this.slides,s,this.finite),0,Math.max(0,this.maxIndex))},getValidIndex(t=this.index,s=this.prevIndex){return this.getIndex(t,s)},_show(t,s,i){if(this._transitioner=this._getTransitioner(t,s,this.dir,{easing:i?s.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}),!i&&!t)return this._translate(1),Promise.resolve();const{length:n}=this.stack;return this._transitioner[n>1?"forward":"show"](n>1?Math.min(this.duration,75+75/(n-1)):this.duration,this.percent)},_translate(t,s=this.prevIndex,i=this.index){const n=this._getTransitioner(s===i?!1:s,i);return n.translate(t),n},_getTransitioner(t=this.prevIndex,s=this.index,i=this.dir||1,n=this.transitionOptions){return new this.Transitioner(this.slides[t]||t,this.slides[s]||s,i*(e.isRtl?-1:1),n)}}};function L(t,s){return t==="next"?1:t==="previous"||t<s?-1:1}function W(t){return .5*t+300}var B={mixins:[U],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:$,Transitioner:S},computed:{animation({animation:t,Animations:s}){return{...s[t]||s.slide,name:t}},transitionOptions(){return{animation:this.animation}}},events:{beforeitemshow({target:t}){e.addClass(t,this.clsActive)},itemshown({target:t}){e.addClass(t,this.clsActivated)},itemhidden({target:t}){e.removeClass(t,this.clsActive,this.clsActivated)}}},j={...$,fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(t){return 1-e.css(t,"opacity")},translate(t){return[{opacity:1-t,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:z(1+.5),zIndex:0},{zIndex:-1}]},percent(t){return 1-e.css(t,"opacity")},translate(t){return[{opacity:1-t,transform:z(1+.5*t),zIndex:0},{zIndex:-1}]}},pull:{show(t){return t<0?[{transform:d(30),zIndex:-1},{transform:d(),zIndex:0}]:[{transform:d(-100),zIndex:0},{transform:d(),zIndex:-1}]},percent(t,s,i){return i<0?1-g(s):g(t)},translate(t,s){return s<0?[{transform:d(30*t),zIndex:-1},{transform:d(-100*(1-t)),zIndex:0}]:[{transform:d(-t*100),zIndex:0},{transform:d(30*(1-t)),zIndex:-1}]}},push:{show(t){return t<0?[{transform:d(100),zIndex:0},{transform:d(),zIndex:-1}]:[{transform:d(-30),zIndex:-1},{transform:d(),zIndex:0}]},percent(t,s,i){return i>0?1-g(s):g(t)},translate(t,s){return s<0?[{transform:d(t*100),zIndex:0},{transform:d(-30*(1-t)),zIndex:-1}]:[{transform:d(-30*t),zIndex:-1},{transform:d(100*(1-t)),zIndex:0}]}}},F={update:{write(){if(this.stack.length||this.dragging)return;const t=this.getValidIndex(this.index);!~this.prevIndex||this.index!==t?this.show(t):this._translate(1,this.prevIndex,this.index)},events:["resize"]}},V={observe:R({target:({slides:t})=>t,targets:t=>t.getAdjacentSlides()})},N={mixins:[p,B,F,V],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:j},update:{read(){if(!this.list)return!1;let[t,s]=this.ratio.split(":").map(Number);return s=s*this.list.offsetWidth/t||0,this.minHeight&&(s=Math.max(this.minHeight,s)),this.maxHeight&&(s=Math.min(this.maxHeight,s)),{height:s-e.boxModelAdjust(this.list,"height","content-box")}},write({height:t}){t>0&&e.css(this.list,"minHeight",t)},events:["resize"]},methods:{getAdjacentSlides(){return[1,-1].map(t=>this.slides[this.getIndex(this.index+t)])}}};return typeof window<"u"&&window.UIkit&&window.UIkit.component("slideshow",N),N});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.16.16-dev.
|
|
1
|
+
/*! UIkit 3.16.16-dev.7b3ba4436 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
|