uikit 3.11.2-dev.7dd548556 → 3.11.2-dev.93483bd3e

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.
Files changed (141) hide show
  1. package/CHANGELOG.md +32 -18
  2. package/dist/css/uikit-core-rtl.css +80 -186
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +80 -186
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +82 -192
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +82 -192
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +3 -3
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +6 -8
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +31 -60
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +34 -64
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +108 -72
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +108 -72
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +75 -28
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +108 -72
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +57 -21
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +12 -14
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +2 -2
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +4 -4
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +271 -287
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +507 -458
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/component.js +2 -11
  44. package/src/js/api/hooks.js +1 -1
  45. package/src/js/api/state.js +3 -3
  46. package/src/js/components/countdown.js +2 -2
  47. package/src/js/components/filter.js +2 -3
  48. package/src/js/components/internal/lightbox-animations.js +4 -3
  49. package/src/js/components/internal/slider-preload.js +37 -0
  50. package/src/js/components/internal/slider-transitioner.js +2 -2
  51. package/src/js/components/internal/slideshow-animations.js +4 -3
  52. package/src/js/components/lightbox-panel.js +34 -58
  53. package/src/js/components/lightbox.js +3 -4
  54. package/src/js/components/slider.js +30 -11
  55. package/src/js/components/slideshow.js +8 -1
  56. package/src/js/components/sortable.js +8 -8
  57. package/src/js/components/upload.js +3 -3
  58. package/src/js/core/accordion.js +3 -3
  59. package/src/js/core/alert.js +1 -2
  60. package/src/js/core/height-match.js +3 -3
  61. package/src/js/core/img.js +132 -115
  62. package/src/js/core/modal.js +1 -2
  63. package/src/js/core/navbar.js +5 -5
  64. package/src/js/core/scrollspy.js +6 -6
  65. package/src/js/core/sticky.js +1 -1
  66. package/src/js/core/svg.js +10 -6
  67. package/src/js/core/toggle.js +4 -3
  68. package/src/js/mixin/internal/animate-slide.js +9 -12
  69. package/src/js/mixin/parallax.js +108 -72
  70. package/src/js/mixin/slider-drag.js +3 -3
  71. package/src/js/mixin/slider-nav.js +2 -2
  72. package/src/js/mixin/slider.js +8 -16
  73. package/src/js/mixin/slideshow.js +2 -2
  74. package/src/js/mixin/togglable.js +1 -2
  75. package/src/js/util/ajax.js +9 -12
  76. package/src/js/util/animation.js +7 -12
  77. package/src/js/util/attr.js +11 -9
  78. package/src/js/util/dom.js +27 -45
  79. package/src/js/util/lang.js +7 -6
  80. package/src/js/util/options.js +2 -11
  81. package/src/js/util/player.js +5 -4
  82. package/src/js/util/position.js +2 -2
  83. package/src/js/util/selector.js +12 -18
  84. package/src/js/util/style.js +4 -4
  85. package/src/less/components/base.less +10 -33
  86. package/src/less/components/form-range.less +52 -97
  87. package/src/less/components/form.less +0 -1
  88. package/src/less/components/leader.less +0 -1
  89. package/src/less/components/lightbox.less +0 -1
  90. package/src/less/components/modal.less +3 -7
  91. package/src/less/components/progress.less +14 -36
  92. package/src/less/components/slider.less +0 -3
  93. package/src/less/components/slideshow.less +0 -3
  94. package/src/less/components/text.less +16 -32
  95. package/src/scss/components/base.scss +10 -33
  96. package/src/scss/components/form-range.scss +52 -97
  97. package/src/scss/components/form.scss +0 -1
  98. package/src/scss/components/leader.scss +0 -1
  99. package/src/scss/components/lightbox.scss +0 -1
  100. package/src/scss/components/modal.scss +3 -7
  101. package/src/scss/components/progress.scss +14 -36
  102. package/src/scss/components/slider.scss +0 -3
  103. package/src/scss/components/slideshow.scss +0 -3
  104. package/src/scss/components/text.scss +16 -32
  105. package/src/scss/mixins-theme.scss +1 -1
  106. package/src/scss/mixins.scss +1 -1
  107. package/src/scss/variables-theme.scss +3 -3
  108. package/src/scss/variables.scss +3 -3
  109. package/tests/align.html +10 -10
  110. package/tests/animation.html +2 -2
  111. package/tests/article.html +2 -2
  112. package/tests/base.html +3 -3
  113. package/tests/card.html +10 -10
  114. package/tests/column.html +3 -3
  115. package/tests/comment.html +9 -9
  116. package/tests/dotnav.html +3 -3
  117. package/tests/image.html +296 -64
  118. package/tests/images/image-type.avif +0 -0
  119. package/tests/images/image-type.jpeg +0 -0
  120. package/tests/images/image-type.webp +0 -0
  121. package/tests/index.html +8 -8
  122. package/tests/lightbox.html +10 -10
  123. package/tests/marker.html +2 -2
  124. package/tests/modal.html +8 -9
  125. package/tests/navbar.html +2 -2
  126. package/tests/overlay.html +7 -7
  127. package/tests/parallax.html +14 -5
  128. package/tests/position.html +12 -12
  129. package/tests/slidenav.html +12 -12
  130. package/tests/slider.html +20 -20
  131. package/tests/sortable.html +1 -1
  132. package/tests/sticky-parallax.html +47 -62
  133. package/tests/svg.html +6 -6
  134. package/tests/table.html +11 -11
  135. package/tests/thumbnav.html +12 -12
  136. package/tests/transition.html +30 -30
  137. package/tests/utility.html +33 -33
  138. package/tests/video.html +1 -1
  139. package/tests/width.html +1 -1
  140. package/src/js/util/promise.js +0 -0
  141. package/tests/images/animated.gif +0 -0
@@ -1 +1 @@
1
- /*! UIkit 3.11.2-dev.7dd548556 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(r,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitparallax",["uikit-util"],u):(r=typeof globalThis<"u"?globalThis:r||self,r.UIkitParallax=u(r.UIkit.util))})(this,function(r){"use strict";var u={props:{media:Boolean},data:{media:!1},computed:{matchMedia(){const n=T(this.media);return!n||window.matchMedia(n).matches}}};function T(n){if(r.isString(n)){if(n[0]==="@"){const e="breakpoint-"+n.substr(1);n=r.toFloat(r.getCssVar(e))}else if(isNaN(n))return n}return n&&!isNaN(n)?"(min-width: "+n+"px)":!1}r.memoize(async n=>n?r.startsWith(n,"data:")?decodeURIComponent(n.split(",")[1]):(await fetch(n)).text():Promise.reject());function B(n){return Math.ceil(Math.max(0,...r.$$("[stroke]",n).map(e=>{try{return e.getTotalLength()}catch{return 0}})))}const b={x:y,y,rotate:y,scale:y,color:v,backgroundColor:v,borderColor:v,blur:f,hue:f,fopacity:f,grayscale:f,invert:f,saturate:f,sepia:f,opacity:q,stroke:H,bgx:I,bgy:I},{keys:w}=Object;var E={mixins:[u],props:O(w(b),"list"),data:O(w(b),void 0),computed:{props(n,e){return w(b).reduce((t,o)=>(r.isUndefined(n[o])||(t[o]=b[o](o,e,n[o].slice())),t),{})}},events:{bgimageload(){this.$emit()}},methods:{reset(){r.each(this.getCss(0),(n,e)=>r.css(this.$el,e,""))},getCss(n){return w(this.props).reduce((e,t)=>(this.props[t](e,n),e),{transform:"",filter:""})}}};function y(n,e,t){const o=C(t)||{x:"px",y:"px",rotate:"deg"}[n]||"";return(n==="x"||n==="y")&&(n="translate"+r.ucfirst(n)),t=t.map(r.toFloat),t.length===1&&t.unshift(n==="scale"?1:0),(a,c)=>{let s=h(t,c);r.startsWith(n,"translate")&&(s=r.toFloat(s).toFixed(o==="px"?0:6)),a.transform+=" "+n+"("+s+o+")"}}function v(n,e,t){return t.length===1&&t.unshift(g(e,n,"")),t=t.map(o=>V(e,o)),(o,a)=>{const[c,s,m]=N(t,a),M=c.map((i,l)=>(i+=m*(s[l]-i),l===3?r.toFloat(i):parseInt(i,10))).join(",");o[n]="rgba("+M+")"}}function V(n,e){return g(n,"color",e).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(r.toFloat)}function f(n,e,t){t.length===1&&t.unshift(0);const o=C(t)||{blur:"px",hue:"deg"}[n]||"%";return n={fopacity:"opacity",hue:"hue-rotate"}[n]||n,t=t.map(r.toFloat),(a,c)=>{const s=h(t,c);a.filter+=" "+n+"("+(s+o)+")"}}function q(n,e,t){return t.length===1&&t.unshift(g(e,n,"")),t=t.map(r.toFloat),(o,a)=>{o[n]=h(t,a)}}function H(n,e,t){t.length===1&&t.unshift(0);const o=C(t);if(t=t.map(r.toFloat),!t.some(c=>c))return r.noop;const a=B(e);return r.css(e,"strokeDasharray",a),o==="%"&&(t=t.map(c=>c*a/100)),t=t.reverse(),(c,s)=>{c.strokeDashoffset=h(t,s)}}function I(n,e,t){t.length===1&&t.unshift(0),n=n.substr(-1);const o=n==="y"?"height":"width";t=t.map(c=>r.toPx(c,o,e));const a=g(e,"background-position-"+n,"");return g(e,"backgroundSize","")==="cover"?L(n,e,t,a,o):S(n,t,a)}function L(n,e,t,o,a){const c=R(e);if(!c.width)return r.noop;const s=Math.min(...t),m=Math.max(...t),M=t.indexOf(s)<t.indexOf(m),i=m-s;let l=(M?-i:0)-(M?s:m);const x={width:e.offsetWidth,height:e.offsetHeight},W=r.Dimensions.cover(c,x),P=W[a]-x[a];if(P<i)x[a]=W[a]+i-P;else if(P>i){const d=x[a]/r.toPx(o,a,e,!0);d&&(l-=(P-i)/d)}const z=r.Dimensions.cover(c,x),A=S(n,t,l+"px");return(d,G)=>{A(d,G),d.backgroundSize=z.width+"px "+z.height+"px",d.backgroundRepeat="no-repeat"}}function S(n,e,t){return function(o,a){o["background-position-"+n]="calc("+t+" + "+h(e,a)+"px)"}}const F={};function R(n){const e=r.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]=D(t),r.trigger(n,"bgimageload")})),F[e]=D(t)}function D(n){return{width:n.naturalWidth,height:n.naturalHeight}}function N(n,e){const t=n.length-1,o=Math.min(Math.floor(t*e),t-1);return n.slice(o,o+2).concat(e===1?1:e%(1/t)*t)}function h(n,e){const[t,o,a]=N(n,e);return r.isNumber(t)?t+Math.abs(t-o)*a*(t<o?1:-1):+o}function C(n,e){return n.reduce((t,o)=>t||r.isString(o)&&o.replace(/[\d-]/g,"").trim(),"")||e}function g(n,e,t){const o=n.style[e],a=r.css(r.css(n,e,t),e);return n.style[e]=o,a}function O(n,e){return n.reduce((t,o)=>(t[o]=e,t),{})}var $={mixins:[E],props:{target:String,viewport:Number,easing:Number,start:String,end:String},data:{target:!1,viewport:1,easing:1,start:0,end:0},computed:{target(n,e){let{target:t}=n;return j(t&&r.query(t,e)||e)},start(n){let{start:e}=n;return r.toPx(e,"height",this.target,!0)},end(n){let{end:e,viewport:t}=n;return r.toPx(e||(t=(1-t)*100)&&t+"vh+"+t+"%","height",this.target,!0)}},update:{read(n,e){let{percent:t}=n;if(e.has("scroll")||(t=!1),!this.matchMedia)return;const o=t;return t=_(r.scrolledOver(this.target,this.start,this.end),this.easing),{percent:t,style:o===t?!1:this.getCss(t)}},write(n){let{style:e}=n;if(!this.matchMedia){this.reset();return}e&&r.css(this.$el,e)},events:["scroll","resize"]}};function _(n,e){return e>=0?Math.pow(n,e+1):1-Math.pow(1-n,-e+1)}function j(n){return n?"offsetTop"in n?n:j(r.parent(n)):document.documentElement}return typeof window<"u"&&window.UIkit&&window.UIkit.component("parallax",$),$});
1
+ /*! UIkit 3.11.2-dev.93483bd3e | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(a,m){typeof exports=="object"&&typeof module<"u"?module.exports=m(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitparallax",["uikit-util"],m):(a=typeof globalThis<"u"?globalThis:a||self,a.UIkitParallax=m(a.UIkit.util))})(this,function(a){"use strict";var m={props:{media:Boolean},data:{media:!1},computed:{matchMedia(){const e=R(this.media);return!e||window.matchMedia(e).matches}}};function R(e){if(a.isString(e)){if(e[0]==="@"){const t="breakpoint-"+e.substr(1);e=a.toFloat(a.getCssVar(t))}else if(isNaN(e))return e}return e&&!isNaN(e)?"(min-width: "+e+"px)":!1}a.memoize(async e=>e?a.startsWith(e,"data:")?decodeURIComponent(e.split(",")[1]):(await fetch(e)).text():Promise.reject());function V(e){return Math.ceil(Math.max(0,...a.$$("[stroke]",e).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const y={x:v,y:v,rotate:v,scale:v,color:P,backgroundColor:P,borderColor:P,blur:d,hue:d,fopacity:d,grayscale:d,invert:d,saturate:d,sepia:d,opacity:L,stroke:_,bgx:D,bgy:D},{keys:F}=Object;var q={mixins:[m],props:$(F(y),"list"),data:$(F(y),void 0),computed:{props(e,t){return F(y).reduce((n,o)=>(a.isUndefined(e[o])||(n[o]=y[o](o,t,e[o].slice())),n),{})}},events:{bgimageload(){this.$emit()}},methods:{reset(){a.each(this.getCss(0),(e,t)=>a.css(this.$el,t,""))},getCss(e){return F(this.props).reduce((t,n)=>(this.props[n](t,e),t),{transform:"",filter:""})}}};function v(e,t,n){const o=C(n)||{x:"px",y:"px",rotate:"deg"}[e]||"";let r;return(e==="x"||e==="y")&&(e="translate"+a.ucfirst(e),r=c=>a.toFloat(a.toFloat(c).toFixed(o==="px"?0:6))),n.length===1&&n.unshift(e==="scale"?1:0),n=l(n,r),(c,s)=>{c.transform+=" "+e+"("+x(n,s)+o+")"}}function P(e,t,n){return n.length===1&&n.unshift(b(t,e,"")),n=l(n,o=>H(t,o)),(o,r)=>{const[c,s,i]=O(n,r),h=c.map((g,f)=>(g+=i*(s[f]-g),f===3?a.toFloat(g):parseInt(g,10))).join(",");o[e]="rgba("+h+")"}}function H(e,t){return b(e,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(a.toFloat)}function d(e,t,n){n.length===1&&n.unshift(0);const o=C(n)||{blur:"px",hue:"deg"}[e]||"%";return e={fopacity:"opacity",hue:"hue-rotate"}[e]||e,n=l(n),(r,c)=>{const s=x(n,c);r.filter+=" "+e+"("+(s+o)+")"}}function L(e,t,n){return n.length===1&&n.unshift(b(t,e,"")),n=l(n),(o,r)=>{o[e]=x(n,r)}}function _(e,t,n){n.length===1&&n.unshift(0);const o=C(n),r=V(t);return n=l(n.reverse(),c=>(c=a.toFloat(c),o==="%"?c*r/100:c)),n.some(c=>{let[s]=c;return s})?(a.css(t,"strokeDasharray",r),(c,s)=>{c.strokeDashoffset=x(n,s)}):a.noop}function D(e,t,n){n.length===1&&n.unshift(0),e=e.substr(-1);const o=e==="y"?"height":"width";n=l(n,c=>a.toPx(c,o,t));const r=b(t,"background-position-"+e,"");return b(t,"backgroundSize","")==="cover"?A(e,t,n,r,o):N(e,n,r)}function A(e,t,n,o,r){const c=G(t);if(!c.width)return a.noop;const s=n.map(u=>{let[S]=u;return S}),i=Math.min(...s),h=Math.max(...s),g=s.indexOf(i)<s.indexOf(h),f=h-i;let W=(g?-f:0)-(g?i:h);const w={width:t.offsetWidth,height:t.offsetHeight},B=a.Dimensions.cover(c,w),I=B[r]-w[r];if(I<f)w[r]=B[r]+f-I;else if(I>f){const u=w[r]/a.toPx(o,r,t,!0);u&&(W-=(I-f)/u)}const E=a.Dimensions.cover(c,w),Q=N(e,n,W+"px");return(u,S)=>{Q(u,S),u.backgroundSize=E.width+"px "+E.height+"px",u.backgroundRepeat="no-repeat"}}function N(e,t,n){return function(o,r){o["background-position-"+e]="calc("+n+" + "+x(t,r)+"px)"}}const M={};function G(e){const t=a.css(e,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(M[t])return M[t];const n=new Image;return t&&(n.src=t,n.naturalWidth||(n.onload=()=>{M[t]=j(n),a.trigger(e,"bgimageload")})),M[t]=j(n)}function j(e){return{width:e.naturalWidth,height:e.naturalHeight}}function l(e,t){t===void 0&&(t=a.toFloat);const n=[],{length:o}=e;for(let r=0;r<o;r++){let[c,s]=a.isString(e[r])?e[r].trim().split(" "):[e[r]];c=t(c),s=s?a.toFloat(s)/100:null,r===0?s===null?s=0:s&&n.push([c,0]):r===o-1&&(s===null?s=1:s!==1&&(n.push([c,s]),s=1)),n.push([c,s])}for(let r=1;r<n.length-1;r++)if(n[r][1]===null){const c=a.findIndex(n.slice(r+1),i=>{let[,h]=i;return h!==null})+1,s=(n[r+c][1]-n[r-1][1])/(c+1);for(let i=0;i<c;i++)n[r+i][1]=n[r-1][1]+s*(i+1);r+=c}return n}function O(e,t){const n=a.findIndex(e.slice(1),o=>{let[,r]=o;return t<=r})+1;return[e[n-1][0],e[n][0],(t-e[n-1][1])/(e[n][1]-e[n-1][1])]}function x(e,t){const[n,o,r]=O(e,t);return a.isNumber(n)?n+Math.abs(n-o)*r*(n<o?1:-1):+o}const J=/^[\d-]+([^\s]+)/;function C(e,t){for(const n of e){const o=n.match==null?void 0:n.match(J);if(o)return o[1]}return t}function b(e,t,n){const o=e.style[t],r=a.css(a.css(e,t,n),t);return e.style[t]=o,r}function $(e,t){return e.reduce((n,o)=>(n[o]=t,n),{})}var z={mixins:[q],props:{target:String,viewport:Number,easing:Number,start:String,end:String},data:{target:!1,viewport:1,easing:1,start:0,end:0},computed:{target(e,t){let{target:n}=e;return T(n&&a.query(n,t)||t)},start(e){let{start:t}=e;return a.toPx(t,"height",this.target,!0)},end(e){let{end:t,viewport:n}=e;return a.toPx(t||(n=(1-n)*100)&&n+"vh+"+n+"%","height",this.target,!0)}},update:{read(e,t){let{percent:n}=e;if(t.has("scroll")||(n=!1),!this.matchMedia)return;const o=n;return n=K(a.scrolledOver(this.target,this.start,this.end),this.easing),{percent:n,style:o===n?!1:this.getCss(n)}},write(e){let{style:t}=e;if(!this.matchMedia){this.reset();return}t&&a.css(this.$el,t)},events:["scroll","resize"]}};function K(e,t){return t>=0?Math.pow(e,t+1):1-Math.pow(1-e,-t+1)}function T(e){return e?"offsetTop"in e?e:T(a.parent(e)):document.documentElement}return typeof window<"u"&&window.UIkit&&window.UIkit.component("parallax",z),z});
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.11.2-dev.7dd548556 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.11.2-dev.93483bd3e | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
@@ -127,39 +127,35 @@
127
127
 
128
128
 
129
129
 
130
- function transformFn(prop, el, steps) {
131
- const unit = getUnit(steps) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
130
+ function transformFn(prop, el, stops) {
131
+ const unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
132
+ let transformFn;
132
133
 
133
134
  if (prop === 'x' || prop === 'y') {
134
135
  prop = "translate" + uikitUtil.ucfirst(prop);
136
+ transformFn = (stop) => uikitUtil.toFloat(uikitUtil.toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
135
137
  }
136
138
 
137
- steps = steps.map(uikitUtil.toFloat);
138
-
139
- if (steps.length === 1) {
140
- steps.unshift(prop === 'scale' ? 1 : 0);
139
+ if (stops.length === 1) {
140
+ stops.unshift(prop === 'scale' ? 1 : 0);
141
141
  }
142
142
 
143
- return (css, percent) => {
144
- let value = getValue(steps, percent);
145
-
146
- if (uikitUtil.startsWith(prop, 'translate')) {
147
- value = uikitUtil.toFloat(value).toFixed(unit === 'px' ? 0 : 6);
148
- }
143
+ stops = parseStops(stops, transformFn);
149
144
 
150
- css.transform += " " + prop + "(" + value + unit + ")";
145
+ return (css, percent) => {
146
+ css.transform += " " + prop + "(" + getValue(stops, percent) + unit + ")";
151
147
  };
152
148
  }
153
149
 
154
- function colorFn(prop, el, steps) {
155
- if (steps.length === 1) {
156
- steps.unshift(getCssValue(el, prop, ''));
150
+ function colorFn(prop, el, stops) {
151
+ if (stops.length === 1) {
152
+ stops.unshift(getCssValue(el, prop, ''));
157
153
  }
158
154
 
159
- steps = steps.map((step) => parseColor(el, step));
155
+ stops = parseStops(stops, (stop) => parseColor(el, stop));
160
156
 
161
157
  return (css, percent) => {
162
- const [start, end, p] = getStep(steps, percent);
158
+ const [start, end, p] = getStop(stops, percent);
163
159
  const value = start.
164
160
  map((value, i) => {
165
161
  value += p * (end[i] - value);
@@ -179,85 +175,83 @@
179
175
  map(uikitUtil.toFloat);
180
176
  }
181
177
 
182
- function filterFn(prop, el, steps) {
183
- if (steps.length === 1) {
184
- steps.unshift(0);
178
+ function filterFn(prop, el, stops) {
179
+ if (stops.length === 1) {
180
+ stops.unshift(0);
185
181
  }
186
182
 
187
- const unit = getUnit(steps) || { blur: 'px', hue: 'deg' }[prop] || '%';
183
+ const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
188
184
  prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
189
- steps = steps.map(uikitUtil.toFloat);
185
+ stops = parseStops(stops);
190
186
 
191
187
  return (css, percent) => {
192
- const value = getValue(steps, percent);
188
+ const value = getValue(stops, percent);
193
189
  css.filter += " " + prop + "(" + (value + unit) + ")";
194
190
  };
195
191
  }
196
192
 
197
- function cssPropFn(prop, el, steps) {
198
- if (steps.length === 1) {
199
- steps.unshift(getCssValue(el, prop, ''));
193
+ function cssPropFn(prop, el, stops) {
194
+ if (stops.length === 1) {
195
+ stops.unshift(getCssValue(el, prop, ''));
200
196
  }
201
197
 
202
- steps = steps.map(uikitUtil.toFloat);
198
+ stops = parseStops(stops);
203
199
 
204
200
  return (css, percent) => {
205
- css[prop] = getValue(steps, percent);
201
+ css[prop] = getValue(stops, percent);
206
202
  };
207
203
  }
208
204
 
209
- function strokeFn(prop, el, steps) {
210
- if (steps.length === 1) {
211
- steps.unshift(0);
205
+ function strokeFn(prop, el, stops) {
206
+ if (stops.length === 1) {
207
+ stops.unshift(0);
212
208
  }
213
209
 
214
- const unit = getUnit(steps);
215
- steps = steps.map(uikitUtil.toFloat);
210
+ const unit = getUnit(stops);
211
+ const length = getMaxPathLength(el);
212
+ stops = parseStops(stops.reverse(), (stop) => {
213
+ stop = uikitUtil.toFloat(stop);
214
+ return unit === '%' ? stop * length / 100 : stop;
215
+ });
216
216
 
217
- if (!steps.some((step) => step)) {
217
+ if (!stops.some((_ref) => {let [value] = _ref;return value;})) {
218
218
  return uikitUtil.noop;
219
219
  }
220
220
 
221
- const length = getMaxPathLength(el);
222
221
  uikitUtil.css(el, 'strokeDasharray', length);
223
222
 
224
- if (unit === '%') {
225
- steps = steps.map((step) => step * length / 100);
226
- }
227
-
228
- steps = steps.reverse();
229
-
230
223
  return (css, percent) => {
231
- css.strokeDashoffset = getValue(steps, percent);
224
+ css.strokeDashoffset = getValue(stops, percent);
232
225
  };
233
226
  }
234
227
 
235
- function backgroundFn(prop, el, steps) {
236
- if (steps.length === 1) {
237
- steps.unshift(0);
228
+ function backgroundFn(prop, el, stops) {
229
+ if (stops.length === 1) {
230
+ stops.unshift(0);
238
231
  }
239
232
 
240
233
  prop = prop.substr(-1);
241
234
  const attr = prop === 'y' ? 'height' : 'width';
242
- steps = steps.map((step) => uikitUtil.toPx(step, attr, el));
235
+ stops = parseStops(stops, (stop) => uikitUtil.toPx(stop, attr, el));
243
236
 
244
237
  const bgPos = getCssValue(el, "background-position-" + prop, '');
245
238
 
246
239
  return getCssValue(el, 'backgroundSize', '') === 'cover' ?
247
- backgroundCoverFn(prop, el, steps, bgPos, attr) :
248
- setBackgroundPosFn(prop, steps, bgPos);
240
+ backgroundCoverFn(prop, el, stops, bgPos, attr) :
241
+ setBackgroundPosFn(prop, stops, bgPos);
249
242
  }
250
243
 
251
- function backgroundCoverFn(prop, el, steps, bgPos, attr) {
244
+ function backgroundCoverFn(prop, el, stops, bgPos, attr) {
252
245
  const dimImage = getBackgroundImageDimensions(el);
253
246
 
254
247
  if (!dimImage.width) {
255
248
  return uikitUtil.noop;
256
249
  }
257
250
 
258
- const min = Math.min(...steps);
259
- const max = Math.max(...steps);
260
- const down = steps.indexOf(min) < steps.indexOf(max);
251
+ const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
252
+ const min = Math.min(...values);
253
+ const max = Math.max(...values);
254
+ const down = values.indexOf(min) < values.indexOf(max);
261
255
 
262
256
  const diff = max - min;
263
257
  let pos = (down ? -diff : 0) - (down ? min : max);
@@ -282,7 +276,7 @@
282
276
 
283
277
  const dim = uikitUtil.Dimensions.cover(dimImage, dimEl);
284
278
 
285
- const fn = setBackgroundPosFn(prop, steps, pos + "px");
279
+ const fn = setBackgroundPosFn(prop, stops, pos + "px");
286
280
  return (css, percent) => {
287
281
  fn(css, percent);
288
282
  css.backgroundSize = dim.width + "px " + dim.height + "px";
@@ -290,9 +284,9 @@
290
284
  };
291
285
  }
292
286
 
293
- function setBackgroundPosFn(prop, steps, pos) {
287
+ function setBackgroundPosFn(prop, stops, pos) {
294
288
  return function (css, percent) {
295
- css["background-position-" + prop] = "calc(" + pos + " + " + getValue(steps, percent) + "px)";
289
+ css["background-position-" + prop] = "calc(" + pos + " + " + getValue(stops, percent) + "px)";
296
290
  };
297
291
  }
298
292
 
@@ -326,27 +320,69 @@
326
320
 
327
321
  }
328
322
 
329
- function getStep(steps, percent) {
330
- const count = steps.length - 1;
331
- const index = Math.min(Math.floor(count * percent), count - 1);
323
+ function parseStops(stops, fn) {if (fn === void 0) {fn = uikitUtil.toFloat;}
324
+ const result = [];
325
+ const { length } = stops;
326
+ for (let i = 0; i < length; i++) {
327
+ let [value, percent] = uikitUtil.isString(stops[i]) ? stops[i].trim().split(' ') : [stops[i]];
328
+ value = fn(value);
329
+ percent = percent ? uikitUtil.toFloat(percent) / 100 : null;
330
+
331
+ if (i === 0) {
332
+ if (percent === null) {
333
+ percent = 0;
334
+ } else if (percent) {
335
+ result.push([value, 0]);
336
+ }
337
+ } else if (i === length - 1) {
338
+ if (percent === null) {
339
+ percent = 1;
340
+ } else if (percent !== 1) {
341
+ result.push([value, percent]);
342
+ percent = 1;
343
+ }
344
+ }
345
+
346
+ result.push([value, percent]);
347
+ }
348
+
349
+ for (let i = 1; i < result.length - 1; i++) {
350
+ if (result[i][1] === null) {
351
+ const nextIndex = uikitUtil.findIndex(result.slice(i + 1), (_ref3) => {let [, percent] = _ref3;return percent !== null;}) + 1;
352
+ const percent = (result[i + nextIndex][1] - result[i - 1][1]) / (nextIndex + 1);
353
+ for (let j = 0; j < nextIndex; j++) {
354
+ result[i + j][1] = result[i - 1][1] + percent * (j + 1);
355
+ }
356
+ i += nextIndex;
357
+ }
358
+ }
359
+
360
+ return result;
361
+ }
362
+
363
+ function getStop(stops, percent) {
364
+ const index = uikitUtil.findIndex(stops.slice(1), (_ref4) => {let [, targetPercent] = _ref4;return percent <= targetPercent;}) + 1;
365
+ return [
366
+ stops[index - 1][0],
367
+ stops[index][0],
368
+ (percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])];
332
369
 
333
- return steps.
334
- slice(index, index + 2).
335
- concat(percent === 1 ? 1 : percent % (1 / count) * count);
336
370
  }
337
371
 
338
- function getValue(steps, percent) {
339
- const [start, end, p] = getStep(steps, percent);
372
+ function getValue(stops, percent) {
373
+ const [start, end, p] = getStop(stops, percent);
340
374
  return uikitUtil.isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
341
375
  }
342
376
 
343
- function getUnit(steps, defaultUnit) {
344
- return (
345
- steps.reduce(
346
- (unit, step) => unit || uikitUtil.isString(step) && step.replace(/[\d-]/g, '').trim(),
347
- '') ||
348
- defaultUnit);
349
-
377
+ const unitRe = /^[\d-]+([^\s]+)/;
378
+ function getUnit(stops, defaultUnit) {
379
+ for (const stop of stops) {
380
+ const match = stop.match == null ? void 0 : stop.match(unitRe);
381
+ if (match) {
382
+ return match[1];
383
+ }
384
+ }
385
+ return defaultUnit;
350
386
  }
351
387
 
352
388
  function getCssValue(el, prop, value) {
@@ -1 +1 @@
1
- /*! UIkit 3.11.2-dev.7dd548556 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(o,h){typeof exports=="object"&&typeof module<"u"?module.exports=h(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider_parallax",["uikit-util"],h):(o=typeof globalThis<"u"?globalThis:o||self,o.UIkitSlider_parallax=h(o.UIkit.util))})(this,function(o){"use strict";var h={props:{media:Boolean},data:{media:!1},computed:{matchMedia(){const e=B(this.media);return!e||window.matchMedia(e).matches}}};function B(e){if(o.isString(e)){if(e[0]==="@"){const t="breakpoint-"+e.substr(1);e=o.toFloat(o.getCssVar(t))}else if(isNaN(e))return e}return e&&!isNaN(e)?"(min-width: "+e+"px)":!1}o.memoize(async e=>e?o.startsWith(e,"data:")?decodeURIComponent(e.split(",")[1]):(await fetch(e)).text():Promise.reject());function V(e){return Math.ceil(Math.max(0,...o.$$("[stroke]",e).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const b={x:w,y:w,rotate:w,scale:w,color:M,backgroundColor:M,borderColor:M,blur:d,hue:d,fopacity:d,grayscale:d,invert:d,saturate:d,sepia:d,opacity:H,stroke:L,bgx:$,bgy:$},{keys:y}=Object;var _={mixins:[h],props:W(y(b),"list"),data:W(y(b),void 0),computed:{props(e,t){return y(b).reduce((n,r)=>(o.isUndefined(e[r])||(n[r]=b[r](r,t,e[r].slice())),n),{})}},events:{bgimageload(){this.$emit()}},methods:{reset(){o.each(this.getCss(0),(e,t)=>o.css(this.$el,t,""))},getCss(e){return y(this.props).reduce((t,n)=>(this.props[n](t,e),t),{transform:"",filter:""})}}};function w(e,t,n){const r=P(n)||{x:"px",y:"px",rotate:"deg"}[e]||"";return(e==="x"||e==="y")&&(e="translate"+o.ucfirst(e)),n=n.map(o.toFloat),n.length===1&&n.unshift(e==="scale"?1:0),(a,c)=>{let s=m(n,c);o.startsWith(e,"translate")&&(s=o.toFloat(s).toFixed(r==="px"?0:6)),a.transform+=" "+e+"("+s+r+")"}}function M(e,t,n){return n.length===1&&n.unshift(g(t,e,"")),n=n.map(r=>q(t,r)),(r,a)=>{const[c,s,f]=T(n,a),C=c.map((i,l)=>(i+=f*(s[l]-i),l===3?o.toFloat(i):parseInt(i,10))).join(",");r[e]="rgba("+C+")"}}function q(e,t){return g(e,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(o.toFloat)}function d(e,t,n){n.length===1&&n.unshift(0);const r=P(n)||{blur:"px",hue:"deg"}[e]||"%";return e={fopacity:"opacity",hue:"hue-rotate"}[e]||e,n=n.map(o.toFloat),(a,c)=>{const s=m(n,c);a.filter+=" "+e+"("+(s+r)+")"}}function H(e,t,n){return n.length===1&&n.unshift(g(t,e,"")),n=n.map(o.toFloat),(r,a)=>{r[e]=m(n,a)}}function L(e,t,n){n.length===1&&n.unshift(0);const r=P(n);if(n=n.map(o.toFloat),!n.some(c=>c))return o.noop;const a=V(t);return o.css(t,"strokeDasharray",a),r==="%"&&(n=n.map(c=>c*a/100)),n=n.reverse(),(c,s)=>{c.strokeDashoffset=m(n,s)}}function $(e,t,n){n.length===1&&n.unshift(0),e=e.substr(-1);const r=e==="y"?"height":"width";n=n.map(c=>o.toPx(c,r,t));const a=g(t,"background-position-"+e,"");return g(t,"backgroundSize","")==="cover"?R(e,t,n,a,r):D(e,n,a)}function R(e,t,n,r,a){const c=E(t);if(!c.width)return o.noop;const s=Math.min(...n),f=Math.max(...n),C=n.indexOf(s)<n.indexOf(f),i=f-s;let l=(C?-i:0)-(C?s:f);const x={width:t.offsetWidth,height:t.offsetHeight},O=o.Dimensions.cover(c,x),I=O[a]-x[a];if(I<i)x[a]=O[a]+i-I;else if(I>i){const u=x[a]/o.toPx(r,a,t,!0);u&&(l-=(I-i)/u)}const z=o.Dimensions.cover(c,x),A=D(e,n,l+"px");return(u,G)=>{A(u,G),u.backgroundSize=z.width+"px "+z.height+"px",u.backgroundRepeat="no-repeat"}}function D(e,t,n){return function(r,a){r["background-position-"+e]="calc("+n+" + "+m(t,a)+"px)"}}const F={};function E(e){const t=o.css(e,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(F[t])return F[t];const n=new Image;return t&&(n.src=t,n.naturalWidth||(n.onload=()=>{F[t]=S(n),o.trigger(e,"bgimageload")})),F[t]=S(n)}function S(e){return{width:e.naturalWidth,height:e.naturalHeight}}function T(e,t){const n=e.length-1,r=Math.min(Math.floor(n*t),n-1);return e.slice(r,r+2).concat(t===1?1:t%(1/n)*n)}function m(e,t){const[n,r,a]=T(e,t);return o.isNumber(n)?n+Math.abs(n-r)*a*(n<r?1:-1):+r}function P(e,t){return e.reduce((n,r)=>n||o.isString(r)&&r.replace(/[\d-]/g,"").trim(),"")||t}function g(e,t,n){const r=e.style[t],a=o.css(o.css(e,t,n),t);return e.style[t]=r,a}function W(e,t){return e.reduce((n,r)=>(n[r]=t,n),{})}var j={mixins:[_],data:{selItem:"!li"},computed:{item(e,t){let{selItem:n}=e;return o.query(n,t)}},events:[{name:"itemin itemout",self:!0,el(){return this.item},handler(e){let{type:t,detail:{percent:n,duration:r,timing:a,dir:c}}=e;o.fastdom.read(()=>{const s=this.getCss(N(t,c,n)),f=this.getCss(v(t)?.5:c>0?1:0);o.fastdom.write(()=>{o.css(this.$el,s),o.Transition.start(this.$el,f,r,a).catch(o.noop)})})}},{name:"transitioncanceled transitionend",self:!0,el(){return this.item},handler(){o.Transition.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el(){return this.item},handler(e){let{type:t,detail:{percent:n,dir:r}}=e;o.fastdom.read(()=>{const a=this.getCss(N(t,r,n));o.fastdom.write(()=>o.css(this.$el,a))})}}]};function v(e){return o.endsWith(e,"in")}function N(e,t,n){return n/=2,v(e)^t<0?n:1-n}return typeof window<"u"&&window.UIkit&&window.UIkit.component("sliderParallax",j),j});
1
+ /*! UIkit 3.11.2-dev.93483bd3e | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(o,g){typeof exports=="object"&&typeof module<"u"?module.exports=g(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider_parallax",["uikit-util"],g):(o=typeof globalThis<"u"?globalThis:o||self,o.UIkitSlider_parallax=g(o.UIkit.util))})(this,function(o){"use strict";var g={props:{media:Boolean},data:{media:!1},computed:{matchMedia(){const n=_(this.media);return!n||window.matchMedia(n).matches}}};function _(n){if(o.isString(n)){if(n[0]==="@"){const t="breakpoint-"+n.substr(1);n=o.toFloat(o.getCssVar(t))}else if(isNaN(n))return n}return n&&!isNaN(n)?"(min-width: "+n+"px)":!1}o.memoize(async n=>n?o.startsWith(n,"data:")?decodeURIComponent(n.split(",")[1]):(await fetch(n)).text():Promise.reject());function q(n){return Math.ceil(Math.max(0,...o.$$("[stroke]",n).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const w={x:I,y:I,rotate:I,scale:I,color:v,backgroundColor:v,borderColor:v,blur:u,hue:u,fopacity:u,grayscale:u,invert:u,saturate:u,sepia:u,opacity:E,stroke:A,bgx:D,bgy:D},{keys:F}=Object;var H={mixins:[g],props:N(F(w),"list"),data:N(F(w),void 0),computed:{props(n,t){return F(w).reduce((e,a)=>(o.isUndefined(n[a])||(e[a]=w[a](a,t,n[a].slice())),e),{})}},events:{bgimageload(){this.$emit()}},methods:{reset(){o.each(this.getCss(0),(n,t)=>o.css(this.$el,t,""))},getCss(n){return F(this.props).reduce((t,e)=>(this.props[e](t,n),t),{transform:"",filter:""})}}};function I(n,t,e){const a=M(e)||{x:"px",y:"px",rotate:"deg"}[n]||"";let r;return(n==="x"||n==="y")&&(n="translate"+o.ucfirst(n),r=s=>o.toFloat(o.toFloat(s).toFixed(a==="px"?0:6))),e.length===1&&e.unshift(n==="scale"?1:0),e=l(e,r),(s,c)=>{s.transform+=" "+n+"("+x(e,c)+a+")"}}function v(n,t,e){return e.length===1&&e.unshift(b(t,n,"")),e=l(e,a=>L(t,a)),(a,r)=>{const[s,c,i]=T(e,r),h=s.map((m,f)=>(m+=i*(c[f]-m),f===3?o.toFloat(m):parseInt(m,10))).join(",");a[n]="rgba("+h+")"}}function L(n,t){return b(n,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(o.toFloat)}function u(n,t,e){e.length===1&&e.unshift(0);const a=M(e)||{blur:"px",hue:"deg"}[n]||"%";return n={fopacity:"opacity",hue:"hue-rotate"}[n]||n,e=l(e),(r,s)=>{const c=x(e,s);r.filter+=" "+n+"("+(c+a)+")"}}function E(n,t,e){return e.length===1&&e.unshift(b(t,n,"")),e=l(e),(a,r)=>{a[n]=x(e,r)}}function A(n,t,e){e.length===1&&e.unshift(0);const a=M(e),r=q(t);return e=l(e.reverse(),s=>(s=o.toFloat(s),a==="%"?s*r/100:s)),e.some(s=>{let[c]=s;return c})?(o.css(t,"strokeDasharray",r),(s,c)=>{s.strokeDashoffset=x(e,c)}):o.noop}function D(n,t,e){e.length===1&&e.unshift(0),n=n.substr(-1);const a=n==="y"?"height":"width";e=l(e,s=>o.toPx(s,a,t));const r=b(t,"background-position-"+n,"");return b(t,"backgroundSize","")==="cover"?G(n,t,e,r,a):S(n,e,r)}function G(n,t,e,a,r){const s=J(t);if(!s.width)return o.noop;const c=e.map(d=>{let[$]=d;return $}),i=Math.min(...c),h=Math.max(...c),m=c.indexOf(i)<c.indexOf(h),f=h-i;let B=(m?-f:0)-(m?i:h);const y={width:t.offsetWidth,height:t.offsetHeight},R=o.Dimensions.cover(s,y),P=R[r]-y[r];if(P<f)y[r]=R[r]+f-P;else if(P>f){const d=y[r]/o.toPx(a,r,t,!0);d&&(B-=(P-f)/d)}const V=o.Dimensions.cover(s,y),Q=S(n,e,B+"px");return(d,$)=>{Q(d,$),d.backgroundSize=V.width+"px "+V.height+"px",d.backgroundRepeat="no-repeat"}}function S(n,t,e){return function(a,r){a["background-position-"+n]="calc("+e+" + "+x(t,r)+"px)"}}const C={};function J(n){const t=o.css(n,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(C[t])return C[t];const e=new Image;return t&&(e.src=t,e.naturalWidth||(e.onload=()=>{C[t]=j(e),o.trigger(n,"bgimageload")})),C[t]=j(e)}function j(n){return{width:n.naturalWidth,height:n.naturalHeight}}function l(n,t){t===void 0&&(t=o.toFloat);const e=[],{length:a}=n;for(let r=0;r<a;r++){let[s,c]=o.isString(n[r])?n[r].trim().split(" "):[n[r]];s=t(s),c=c?o.toFloat(c)/100:null,r===0?c===null?c=0:c&&e.push([s,0]):r===a-1&&(c===null?c=1:c!==1&&(e.push([s,c]),c=1)),e.push([s,c])}for(let r=1;r<e.length-1;r++)if(e[r][1]===null){const s=o.findIndex(e.slice(r+1),i=>{let[,h]=i;return h!==null})+1,c=(e[r+s][1]-e[r-1][1])/(s+1);for(let i=0;i<s;i++)e[r+i][1]=e[r-1][1]+c*(i+1);r+=s}return e}function T(n,t){const e=o.findIndex(n.slice(1),a=>{let[,r]=a;return t<=r})+1;return[n[e-1][0],n[e][0],(t-n[e-1][1])/(n[e][1]-n[e-1][1])]}function x(n,t){const[e,a,r]=T(n,t);return o.isNumber(e)?e+Math.abs(e-a)*r*(e<a?1:-1):+a}const K=/^[\d-]+([^\s]+)/;function M(n,t){for(const e of n){const a=e.match==null?void 0:e.match(K);if(a)return a[1]}return t}function b(n,t,e){const a=n.style[t],r=o.css(o.css(n,t,e),t);return n.style[t]=a,r}function N(n,t){return n.reduce((e,a)=>(e[a]=t,e),{})}var W={mixins:[H],data:{selItem:"!li"},computed:{item(n,t){let{selItem:e}=n;return o.query(e,t)}},events:[{name:"itemin itemout",self:!0,el(){return this.item},handler(n){let{type:t,detail:{percent:e,duration:a,timing:r,dir:s}}=n;o.fastdom.read(()=>{const c=this.getCss(z(t,s,e)),i=this.getCss(O(t)?.5:s>0?1:0);o.fastdom.write(()=>{o.css(this.$el,c),o.Transition.start(this.$el,i,a,r).catch(o.noop)})})}},{name:"transitioncanceled transitionend",self:!0,el(){return this.item},handler(){o.Transition.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el(){return this.item},handler(n){let{type:t,detail:{percent:e,dir:a}}=n;o.fastdom.read(()=>{const r=this.getCss(z(t,a,e));o.fastdom.write(()=>o.css(this.$el,r))})}}]};function O(n){return o.endsWith(n,"in")}function z(n,t,e){return e/=2,O(n)^t<0?e:1-e}return typeof window<"u"&&window.UIkit&&window.UIkit.component("sliderParallax",W),W});
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.11.2-dev.7dd548556 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.11.2-dev.93483bd3e | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
@@ -87,17 +87,17 @@
87
87
 
88
88
 
89
89
  created() {
90
- ['start', 'move', 'end'].forEach((key) => {
90
+ for (const key of ['start', 'move', 'end']) {
91
91
  const fn = this[key];
92
92
  this[key] = (e) => {
93
93
  const pos = uikitUtil.getEventPos(e).x * (uikitUtil.isRtl ? -1 : 1);
94
94
 
95
- this.prevPos = pos !== this.pos ? this.pos : this.prevPos;
95
+ this.prevPos = pos === this.pos ? this.prevPos : this.pos;
96
96
  this.pos = pos;
97
97
 
98
98
  fn(e);
99
99
  };
100
- });
100
+ }
101
101
  },
102
102
 
103
103
  events: [
@@ -335,7 +335,7 @@
335
335
  methods: {
336
336
  updateNav() {
337
337
  const i = this.getValidIndex();
338
- this.navItems.forEach((el) => {
338
+ for (const el of this.navItems) {
339
339
  const cmd = uikitUtil.data(el, this.attrItem);
340
340
 
341
341
  uikitUtil.toggleClass(el, this.clsActive, uikitUtil.toNumber(cmd) === i);
@@ -345,7 +345,7 @@
345
345
  this.finite && (
346
346
  cmd === 'previous' && i === 0 || cmd === 'next' && i >= this.maxIndex));
347
347
 
348
- });
348
+ }
349
349
  } } };
350
350
 
351
351
  var Slider = {
@@ -503,20 +503,13 @@
503
503
  },
504
504
 
505
505
  _show(prev, next, force) {
506
- this._transitioner = this._getTransitioner(
507
- prev,
508
- next,
509
- this.dir,
510
- uikitUtil.assign(
511
- {
506
+ this._transitioner = this._getTransitioner(prev, next, this.dir, {
512
507
  easing: force ?
513
508
  next.offsetWidth < 600 ?
514
509
  'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */ :
515
510
  'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */ :
516
- this.easing },
517
-
518
- this.transitionOptions));
519
-
511
+ this.easing,
512
+ ...this.transitionOptions });
520
513
 
521
514
 
522
515
  if (!force && !prev) {
@@ -581,6 +574,42 @@
581
574
 
582
575
  events: ['resize'] } };
583
576
 
577
+ var SliderPreload = {
578
+ connected() {
579
+ if (window.IntersectionObserver) {
580
+ this.observer = new IntersectionObserver(
581
+ (entries) => {
582
+ if (entries.some((entry) => entry.isIntersecting)) {
583
+ removeLazyLoad(this.getAdjacentSlides());
584
+ }
585
+ },
586
+ { rootMargin: '50% 50%' });
587
+
588
+ this.observer.observe(this.$el);
589
+ }
590
+ },
591
+
592
+ disconnected() {
593
+ this.observer && this.observer.disconnect();
594
+ },
595
+
596
+ update: {
597
+ read() {
598
+ if (uikitUtil.isVisible(this.$el)) {
599
+ removeLazyLoad(this.getAdjacentSlides());
600
+ }
601
+ },
602
+
603
+ events: ['resize'] } };
604
+
605
+
606
+
607
+ function removeLazyLoad(elements) {if (elements === void 0) {elements = [];}
608
+ for (const el of elements) {
609
+ el && uikitUtil.$$('img[loading="lazy"]', el).forEach((el) => uikitUtil.removeAttr(el, 'loading'));
610
+ }
611
+ }
612
+
584
613
  function translate(value, unit) {if (value === void 0) {value = 0;}if (unit === void 0) {unit = '%';}
585
614
  value += value ? unit : '';
586
615
  return "translate3d(" + value + ", 0, 0)";
@@ -660,7 +689,7 @@
660
689
 
661
690
  percent = prev ? uikitUtil.clamp(percent, -1, 1) : 0;
662
691
 
663
- uikitUtil.children(list).forEach((slide) => {
692
+ for (const slide of uikitUtil.children(list)) {
664
693
  const isActive = uikitUtil.includes(actives, slide);
665
694
  const isIn = slide === itemIn;
666
695
  const isOut = slide === itemOut;
@@ -675,7 +704,7 @@
675
704
  dir,
676
705
  percent: isOut ? 1 - percent : isIn ? percent : isActive ? 1 : 0 });
677
706
 
678
- });
707
+ }
679
708
  },
680
709
 
681
710
  percent() {
@@ -752,7 +781,7 @@
752
781
  }
753
782
 
754
783
  var Component = {
755
- mixins: [Class, Slider, SliderReactive],
784
+ mixins: [Class, Slider, SliderReactive, SliderPreload],
756
785
 
757
786
  props: {
758
787
  center: Boolean,
@@ -862,7 +891,7 @@
862
891
 
863
892
  update: {
864
893
  write() {
865
- this.navItems.forEach((el) => {
894
+ for (const el of this.navItems) {
866
895
  const index = uikitUtil.toNumber(uikitUtil.data(el, this.attrItem));
867
896
  if (index !== false) {
868
897
  el.hidden =
@@ -870,7 +899,7 @@
870
899
  index > this.maxIndex ||
871
900
  this.sets && !uikitUtil.includes(this.sets, index);
872
901
  }
873
- });
902
+ }
874
903
 
875
904
  if (this.length && !this.dragging && !this.stack.length) {
876
905
  this.reorder();
@@ -878,14 +907,13 @@
878
907
  }
879
908
 
880
909
  const actives = this._getTransitioner(this.index).getActives();
881
- this.slides.forEach((slide) =>
882
- uikitUtil.toggleClass(slide, this.clsActive, uikitUtil.includes(actives, slide)));
883
-
884
-
885
- if (this.clsActivated && (!this.sets || uikitUtil.includes(this.sets, uikitUtil.toFloat(this.index)))) {
886
- this.slides.forEach((slide) =>
887
- uikitUtil.toggleClass(slide, this.clsActivated || '', uikitUtil.includes(actives, slide)));
910
+ const activeClasses = [
911
+ this.clsActive,
912
+ (!this.sets || uikitUtil.includes(this.sets, uikitUtil.toFloat(this.index))) && this.clsActivated ||
913
+ ''];
888
914
 
915
+ for (const slide of this.slides) {
916
+ uikitUtil.toggleClass(slide, activeClasses, uikitUtil.includes(actives, slide));
889
917
  }
890
918
  },
891
919
 
@@ -990,6 +1018,25 @@
990
1018
  } while (index !== prev);
991
1019
 
992
1020
  return index;
1021
+ },
1022
+
1023
+ getAdjacentSlides() {
1024
+ const { width } = uikitUtil.dimensions(this.list);
1025
+ const left = -width;
1026
+ const right = width * 2;
1027
+ const slideWidth = uikitUtil.dimensions(this.slides[this.index]).width;
1028
+ const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;
1029
+ const slides = new Set();
1030
+ for (const i of [-1, 1]) {
1031
+ let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);
1032
+ let j = 0;
1033
+ do {
1034
+ const slide = this.slides[this.getIndex(this.index + i + j++ * i)];
1035
+ currentLeft += uikitUtil.dimensions(slide).width * i;
1036
+ slides.add(slide);
1037
+ } while (this.slides.length > j && currentLeft > left && currentLeft < right);
1038
+ }
1039
+ return Array.from(slides);
993
1040
  } } };
994
1041
 
995
1042