uikit 3.14.1-dev.eeb4cd6ae → 3.14.2-dev.35b3deec9
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 +45 -3
- package/build/util.js +8 -2
- package/dist/css/uikit-core-rtl.css +93 -21
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +93 -21
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +99 -33
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +99 -33
- 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 +2 -2
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +111 -15
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +111 -15
- 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 +18 -3
- 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 +1 -1
- 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 +1 -1
- 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 +147 -34
- 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 +280 -132
- 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 +298 -135
- package/dist/js/uikit.min.js +1 -1
- package/package.json +11 -11
- package/src/js/api/hooks.js +1 -1
- package/src/js/components/filter.js +1 -1
- package/src/js/components/parallax.js +16 -1
- package/src/js/core/accordion.js +3 -3
- package/src/js/core/alert.js +1 -1
- package/src/js/core/drop.js +47 -18
- package/src/js/core/height-viewport.js +15 -11
- package/src/js/core/margin.js +1 -1
- package/src/js/core/navbar.js +19 -18
- package/src/js/core/scrollspy.js +6 -1
- package/src/js/core/toggle.js +9 -8
- package/src/js/mixin/parallax.js +1 -1
- package/src/js/mixin/position.js +36 -20
- package/src/js/mixin/togglable.js +116 -18
- package/src/js/util/animation.js +1 -0
- package/src/js/util/position.js +24 -22
- package/src/js/util/viewport.js +7 -14
- package/src/less/components/drop.less +19 -4
- package/src/less/components/dropdown.less +21 -4
- package/src/less/components/margin.less +13 -14
- package/src/less/components/modal.less +19 -4
- package/src/less/components/nav.less +1 -1
- package/src/less/components/navbar.less +60 -19
- package/src/less/components/offcanvas.less +21 -21
- package/src/less/components/position.less +1 -1
- package/src/less/components/sticky.less +7 -0
- package/src/less/components/tooltip.less +1 -0
- package/src/less/components/utility.less +1 -2
- package/src/less/theme/dropdown.less +11 -0
- package/src/less/theme/navbar.less +10 -10
- package/src/scss/components/drop.scss +19 -4
- package/src/scss/components/dropdown.scss +21 -4
- package/src/scss/components/margin.scss +13 -14
- package/src/scss/components/modal.scss +19 -4
- package/src/scss/components/nav.scss +1 -1
- package/src/scss/components/navbar.scss +49 -8
- package/src/scss/components/offcanvas.scss +21 -21
- package/src/scss/components/position.scss +1 -1
- package/src/scss/components/sticky.scss +7 -0
- package/src/scss/components/tooltip.scss +1 -0
- package/src/scss/components/utility.scss +1 -2
- package/src/scss/mixins-theme.scss +8 -10
- package/src/scss/mixins.scss +2 -0
- package/src/scss/theme/dropdown.scss +8 -0
- package/src/scss/theme/navbar.scss +7 -0
- package/src/scss/variables-theme.scss +26 -11
- package/src/scss/variables.scss +24 -11
- package/tests/drop.html +165 -4
- package/tests/dropdown.html +234 -13
- package/tests/height-viewport.html +62 -0
- package/tests/navbar.html +333 -64
- package/tests/notification.html +1 -1
- package/tests/offcanvas.html +8 -8
- package/tests/sticky-navbar.html +132 -0
- package/tests/sticky-parallax.html +2 -1
- package/tests/sticky.html +5 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.14.
|
|
1
|
+
/*! UIkit 3.14.2-dev.35b3deec9 | 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')) :
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.14.
|
|
1
|
+
/*! UIkit 3.14.2-dev.35b3deec9 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitcountdown",["uikit-util"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkitCountdown=i(e.UIkit.util))})(this,function(e){"use strict";var i={connected(){!e.hasClass(this.$el,this.$name)&&e.addClass(this.$el,this.$name)}};const a=["days","hours","minutes","seconds"];var d={mixins:[i],props:{date:String,clsWrapper:String},data:{date:"",clsWrapper:".uk-countdown-%unit%"},connected(){this.date=Date.parse(this.$props.date),this.start()},disconnected(){this.stop()},events:[{name:"visibilitychange",el(){return document},handler(){document.hidden?this.stop():this.start()}}],methods:{start(){this.stop(),this.update(),this.timer=setInterval(this.update,1e3)},stop(){clearInterval(this.timer)},update(){const n=r(this.date);(!this.date||n.total<=0)&&(this.stop(),n.days=n.hours=n.minutes=n.seconds=0);for(const s of a){const o=e.$(this.clsWrapper.replace("%unit%",s),this.$el);if(!o)continue;let t=String(Math.trunc(n[s]));t=t.length<2?"0"+t:t,o.textContent!==t&&(t=t.split(""),t.length!==o.children.length&&e.html(o,t.map(()=>"<span></span>").join("")),t.forEach((h,u)=>o.children[u].textContent=h))}}}};function r(n){const s=n-Date.now();return{total:s,seconds:s/1e3%60,minutes:s/1e3/60%60,hours:s/1e3/60/60%24,days:s/1e3/60/60/24}}return typeof window<"u"&&window.UIkit&&window.UIkit.component("countdown",d),d});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.14.
|
|
1
|
+
/*! UIkit 3.14.2-dev.35b3deec9 | 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')) :
|
|
@@ -540,7 +540,7 @@
|
|
|
540
540
|
}
|
|
541
541
|
|
|
542
542
|
function isEqualList(listA, listB) {
|
|
543
|
-
return listA.length === listB.length && listA.every((el) =>
|
|
543
|
+
return listA.length === listB.length && listA.every((el) => listB.includes(el));
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
function getSelector(_ref4) {let { filter } = _ref4;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.14.
|
|
1
|
+
/*! UIkit 3.14.2-dev.35b3deec9 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(n,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitfilter",["uikit-util"],l):(n=typeof globalThis<"u"?globalThis:n||self,n.UIkitFilter=l(n.UIkit.util))})(this,function(n){"use strict";function l(s){return A(s,"top","bottom")}function A(s,e,o){const r=[[]];for(const t of s){if(!n.isVisible(t))continue;let c=u(t);for(let a=r.length-1;a>=0;a--){const f=r[a];if(!f[0]){f.push(t);break}let d;if(f[0].offsetParent===t.offsetParent?d=u(f[0]):(c=u(t,!0),d=u(f[0],!0)),c[e]>=d[o]-1&&c[e]!==d[e]){r.push([t]);break}if(c[o]-1>d[e]||c[e]===d[e]){f.push(t);break}if(a===0){r.unshift([t]);break}}}return r}function u(s,e){e===void 0&&(e=!1);let{offsetTop:o,offsetLeft:r,offsetHeight:t,offsetWidth:c}=s;return e&&([o,r]=n.offsetPosition(s)),{top:o,left:r,bottom:o+t,right:r+c}}const g="uk-transition-leave",v="uk-transition-enter";function w(s,e,o,r){r===void 0&&(r=0);const t=y(e,!0),c={opacity:1},a={opacity:0},f=i=>()=>t===y(e)?i():Promise.reject(),d=f(()=>(n.addClass(e,g),Promise.all(I(e).map((i,h)=>new Promise(m=>setTimeout(()=>n.Transition.start(i,a,o/2,"ease").then(m),h*r)))).then(()=>n.removeClass(e,g)))),p=f(()=>{const i=n.height(e);return n.addClass(e,v),s(),n.css(n.children(e),{opacity:0}),new Promise(h=>requestAnimationFrame(()=>{const m=n.children(e),C=n.height(e);n.css(e,"alignContent","flex-start"),n.height(e,i);const x=I(e);n.css(m,a);const q=x.map((W,M)=>new Promise(R=>setTimeout(()=>n.Transition.start(W,c,o/2,"ease").then(R),M*r)));i!==C&&q.push(n.Transition.start(e,{height:C},o/2+x.length*r,"ease")),Promise.all(q).then(()=>{n.removeClass(e,v),t===y(e)&&(n.css(e,{height:"",alignContent:""}),n.css(m,{opacity:""}),delete e.dataset.transition),h()})}))});return n.hasClass(e,g)?T(e).then(p):n.hasClass(e,v)?T(e).then(d).then(p):d().then(p)}function y(s,e){return e&&(s.dataset.transition=1+y(s)),n.toNumber(s.dataset.transition)||0}function T(s){return Promise.all(n.children(s).filter(n.Transition.inProgress).map(e=>new Promise(o=>n.once(e,"transitionend transitioncanceled",o))))}function I(s){return l(n.children(s)).reduce((e,o)=>e.concat(n.sortBy(o.filter(r=>n.isInView(r)),"offsetLeft")),[])}function L(s,e,o){return new Promise(r=>requestAnimationFrame(()=>{let t=n.children(e);const c=t.map(f=>F(f,!0)),a=n.css(e,["height","padding"]);n.Transition.cancel(e),t.forEach(n.Transition.cancel),S(e),s(),t=t.concat(n.children(e).filter(f=>!n.includes(t,f))),Promise.resolve().then(()=>{n.fastdom.flush();const f=n.css(e,["height","padding"]),[d,p]=z(e,t,c);t.forEach((i,h)=>p[h]&&n.css(i,p[h])),n.css(e,{display:"block",...a}),requestAnimationFrame(()=>{const i=t.map((h,m)=>n.parent(h)===e&&n.Transition.start(h,d[m],o,"ease")).concat(n.Transition.start(e,f,o,"ease"));Promise.all(i).then(()=>{t.forEach((h,m)=>n.parent(h)===e&&n.css(h,"display",d[m].opacity===0?"none":"")),S(e)},n.noop).then(r)})})}))}function F(s,e){const o=n.css(s,"zIndex");return n.isVisible(s)?{display:"",opacity:e?n.css(s,"opacity"):"0",pointerEvents:"none",position:"absolute",zIndex:o==="auto"?n.index(s):o,...$(s)}:!1}function z(s,e,o){const r=e.map((c,a)=>n.parent(c)&&a in o?o[a]?n.isVisible(c)?$(c):{opacity:0}:{opacity:n.isVisible(c)?1:0}:!1),t=r.map((c,a)=>{const f=n.parent(e[a])===s&&(o[a]||F(e[a]));if(!f)return!1;if(!c)delete f.opacity;else if(!("opacity"in c)){const{opacity:d}=f;d%1?c.opacity=1:delete f.opacity}return f});return[r,t]}function S(s){n.css(s.children,{height:"",left:"",opacity:"",pointerEvents:"",position:"",top:"",marginTop:"",marginLeft:"",transform:"",width:"",zIndex:""}),n.css(s,{height:"",display:"",padding:""})}function $(s){const{height:e,width:o}=n.offset(s),{top:r,left:t}=n.position(s),{marginLeft:c,marginTop:a}=n.css(s,["marginTop","marginLeft"]);return{top:r,left:t,height:e,width:o,marginLeft:c,marginTop:a,transform:""}}var B={props:{duration:Number,animation:Boolean},data:{duration:150,animation:"slide"},methods:{animate(s,e){e===void 0&&(e=this.$el);const o=this.animation;return(o==="fade"?w:o==="delayed-fade"?function(){for(var t=arguments.length,c=new Array(t),a=0;a<t;a++)c[a]=arguments[a];return w(...c,40)}:o?L:()=>(s(),Promise.resolve()))(s,e,this.duration).then(()=>this.$update(e,"resize"),n.noop)}}},b={mixins:[B],args:"target",props:{target:Boolean,selActive:Boolean},data:{target:null,selActive:!1,attrItem:"uk-filter-control",cls:"uk-active",duration:250},computed:{toggles:{get(s,e){let{attrItem:o}=s;return n.$$("["+o+"],[data-"+o+"]",e)},watch(){if(this.updateState(),this.selActive!==!1){const s=n.$$(this.selActive,this.$el);this.toggles.forEach(e=>n.toggleClass(e,this.cls,n.includes(s,e)))}},immediate:!0},children:{get(s,e){let{target:o}=s;return n.$$(o+" > *",e)},watch(s,e){e&&!H(s,e)&&this.updateState()},immediate:!0}},events:[{name:"click",delegate(){return"["+this.attrItem+"],[data-"+this.attrItem+"]"},handler(s){s.preventDefault(),this.apply(s.current)}}],methods:{apply(s){const e=this.getState(),o=E(s,this.attrItem,this.getState());V(e,o)||this.setState(o)},getState(){return this.toggles.filter(s=>n.hasClass(s,this.cls)).reduce((s,e)=>E(e,this.attrItem,s),{filter:{"":""},sort:[]})},setState(s,e){e===void 0&&(e=!0),s={filter:{"":""},sort:[],...s},n.trigger(this.$el,"beforeFilter",[this,s]),this.toggles.forEach(o=>n.toggleClass(o,this.cls,!!O(o,this.attrItem,s))),Promise.all(n.$$(this.target,this.$el).map(o=>{const r=()=>{N(s,o,n.children(o)),this.$update(this.$el)};return e?this.animate(r,o):r()})).then(()=>n.trigger(this.$el,"afterFilter",[this]))},updateState(){n.fastdom.write(()=>this.setState(this.getState(),!1))}}};function P(s,e){return n.parseOptions(n.data(s,e),["filter"])}function V(s,e){return["filter","sort"].every(o=>n.isEqual(s[o],e[o]))}function N(s,e,o){const r=j(s);o.forEach(a=>n.css(a,"display",r&&!n.matches(a,r)?"none":""));const[t,c]=s.sort;if(t){const a=D(o,t,c);n.isEqual(a,o)||n.append(e,a)}}function E(s,e,o){const r=P(s,e),{filter:t,group:c,sort:a,order:f="asc"}=r;return(t||n.isUndefined(a))&&(c?t?(delete o.filter[""],o.filter[c]=t):(delete o.filter[c],(n.isEmpty(o.filter)||""in o.filter)&&(o.filter={"":t||""})):o.filter={"":t||""}),n.isUndefined(a)||(o.sort=[a,f]),o}function O(s,e,o){let{filter:r={"":""},sort:[t,c]}=o;const{filter:a="",group:f="",sort:d,order:p="asc"}=P(s,e);return n.isUndefined(d)?f in r&&a===r[f]||!a&&f&&!(f in r)&&!r[""]:t===d&&c===p}function H(s,e){return s.length===e.length&&s.every(o=>e.includes(o))}function j(s){let{filter:e}=s,o="";return n.each(e,r=>o+=r||""),o}function D(s,e,o){return[...s].sort((r,t)=>n.data(r,e).localeCompare(n.data(t,e),void 0,{numeric:!0})*(o==="asc"||-1))}return typeof window<"u"&&window.UIkit&&window.UIkit.component("filter",b),b});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.14.
|
|
1
|
+
/*! UIkit 3.14.2-dev.35b3deec9 | 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')) :
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
cls: Boolean,
|
|
98
98
|
animation: 'list',
|
|
99
99
|
duration: Number,
|
|
100
|
+
velocity: Number,
|
|
100
101
|
origin: String,
|
|
101
102
|
transition: String },
|
|
102
103
|
|
|
@@ -105,6 +106,7 @@
|
|
|
105
106
|
cls: false,
|
|
106
107
|
animation: [false],
|
|
107
108
|
duration: 200,
|
|
109
|
+
velocity: 0.2,
|
|
108
110
|
origin: false,
|
|
109
111
|
transition: 'ease',
|
|
110
112
|
clsEnter: 'uk-togglabe-enter',
|
|
@@ -112,7 +114,7 @@
|
|
|
112
114
|
|
|
113
115
|
initProps: {
|
|
114
116
|
overflow: '',
|
|
115
|
-
|
|
117
|
+
maxHeight: '',
|
|
116
118
|
paddingTop: '',
|
|
117
119
|
paddingBottom: '',
|
|
118
120
|
marginTop: '',
|
|
@@ -122,7 +124,7 @@
|
|
|
122
124
|
|
|
123
125
|
hideProps: {
|
|
124
126
|
overflow: 'hidden',
|
|
125
|
-
|
|
127
|
+
maxHeight: 0,
|
|
126
128
|
paddingTop: 0,
|
|
127
129
|
paddingBottom: 0,
|
|
128
130
|
marginTop: 0,
|
|
@@ -137,7 +139,7 @@
|
|
|
137
139
|
},
|
|
138
140
|
|
|
139
141
|
hasTransition(_ref2) {let { animation } = _ref2;
|
|
140
|
-
return
|
|
142
|
+
return uikitUtil.startsWith(animation[0], 'slide');
|
|
141
143
|
} },
|
|
142
144
|
|
|
143
145
|
|
|
@@ -156,9 +158,9 @@
|
|
|
156
158
|
uikitUtil.isFunction(animate) ?
|
|
157
159
|
animate :
|
|
158
160
|
animate === false || !this.hasAnimation ?
|
|
159
|
-
this
|
|
161
|
+
toggleInstant(this) :
|
|
160
162
|
this.hasTransition ?
|
|
161
|
-
|
|
163
|
+
toggleTransition(this) :
|
|
162
164
|
toggleAnimation(this))(
|
|
163
165
|
el, show);
|
|
164
166
|
|
|
@@ -222,14 +224,43 @@
|
|
|
222
224
|
|
|
223
225
|
|
|
224
226
|
|
|
225
|
-
function
|
|
227
|
+
function toggleInstant(_ref3) {let { _toggle } = _ref3;
|
|
228
|
+
return (el, show) => {
|
|
229
|
+
uikitUtil.Animation.cancel(el);
|
|
230
|
+
uikitUtil.Transition.cancel(el);
|
|
231
|
+
return _toggle(el, show);
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function toggleTransition(cmp) {
|
|
236
|
+
switch (cmp.animation[0]) {
|
|
237
|
+
case 'slide-left':
|
|
238
|
+
return slideHorizontal(cmp);
|
|
239
|
+
case 'slide-right':
|
|
240
|
+
return slideHorizontal(cmp, true);}
|
|
241
|
+
|
|
242
|
+
return slide(cmp);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function slide(_ref4)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
{let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
|
|
226
254
|
return (el, show) => {
|
|
227
255
|
const inProgress = uikitUtil.Transition.inProgress(el);
|
|
228
|
-
const inner =
|
|
256
|
+
const inner =
|
|
257
|
+
!inProgress && el.hasChildNodes() ?
|
|
229
258
|
uikitUtil.toFloat(uikitUtil.css(el.firstElementChild, 'marginTop')) +
|
|
230
259
|
uikitUtil.toFloat(uikitUtil.css(el.lastElementChild, 'marginBottom')) :
|
|
231
260
|
0;
|
|
232
|
-
const currentHeight = uikitUtil.isVisible(el) ? uikitUtil.
|
|
261
|
+
const currentHeight = uikitUtil.isVisible(el) ? uikitUtil.toFloat(uikitUtil.css(el, 'height')) + inner : 0;
|
|
262
|
+
|
|
263
|
+
const props = inProgress ? uikitUtil.css(el, Object.keys(initProps)) : show ? hideProps : initProps;
|
|
233
264
|
|
|
234
265
|
uikitUtil.Transition.cancel(el);
|
|
235
266
|
|
|
@@ -237,32 +268,97 @@
|
|
|
237
268
|
_toggle(el, true);
|
|
238
269
|
}
|
|
239
270
|
|
|
240
|
-
uikitUtil.
|
|
271
|
+
uikitUtil.css(el, 'maxHeight', '');
|
|
241
272
|
|
|
242
273
|
// Update child components first
|
|
243
274
|
uikitUtil.fastdom.flush();
|
|
244
275
|
|
|
245
|
-
const endHeight = uikitUtil.
|
|
246
|
-
|
|
276
|
+
const endHeight = uikitUtil.toFloat(uikitUtil.css(el, 'height')) + inner;
|
|
277
|
+
duration = velocity * endHeight + duration;
|
|
278
|
+
|
|
279
|
+
uikitUtil.css(el, { ...props, maxHeight: currentHeight });
|
|
247
280
|
|
|
248
281
|
return (
|
|
249
282
|
show ?
|
|
250
283
|
uikitUtil.Transition.start(
|
|
251
284
|
el,
|
|
252
|
-
{ ...initProps, overflow: 'hidden',
|
|
253
|
-
|
|
285
|
+
{ ...initProps, overflow: 'hidden', maxHeight: endHeight },
|
|
286
|
+
duration * (1 - currentHeight / endHeight),
|
|
254
287
|
transition) :
|
|
255
288
|
|
|
256
289
|
uikitUtil.Transition.start(
|
|
257
290
|
el,
|
|
258
291
|
hideProps,
|
|
259
|
-
|
|
292
|
+
duration * (currentHeight / endHeight),
|
|
260
293
|
transition).
|
|
261
294
|
then(() => _toggle(el, false))).
|
|
262
295
|
then(() => uikitUtil.css(el, initProps));
|
|
263
296
|
};
|
|
264
297
|
}
|
|
265
298
|
|
|
299
|
+
function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
|
|
300
|
+
return (el, show) => {
|
|
301
|
+
const visible = uikitUtil.isVisible(el);
|
|
302
|
+
const marginLeft = uikitUtil.toFloat(uikitUtil.css(el, 'marginLeft'));
|
|
303
|
+
|
|
304
|
+
uikitUtil.Transition.cancel(el);
|
|
305
|
+
|
|
306
|
+
const [scrollElement] = uikitUtil.scrollParents(el);
|
|
307
|
+
uikitUtil.css(scrollElement, 'overflowX', 'hidden');
|
|
308
|
+
|
|
309
|
+
if (!isToggled(el)) {
|
|
310
|
+
_toggle(el, true);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const width = uikitUtil.toFloat(uikitUtil.css(el, 'width'));
|
|
314
|
+
duration = velocity * width + duration;
|
|
315
|
+
|
|
316
|
+
const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
|
|
317
|
+
const offsetEl = uikitUtil.offset(el);
|
|
318
|
+
const useClipPath = right ?
|
|
319
|
+
offsetEl.right < scrollElement.clientWidth :
|
|
320
|
+
Math.round(offsetEl.left) > 0;
|
|
321
|
+
|
|
322
|
+
uikitUtil.css(el, {
|
|
323
|
+
clipPath: useClipPath ?
|
|
324
|
+
right ? "polygon(0 0," +
|
|
325
|
+
percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
|
|
326
|
+
100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)" :
|
|
327
|
+
'',
|
|
328
|
+
marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
return (
|
|
332
|
+
show ?
|
|
333
|
+
uikitUtil.Transition.start(
|
|
334
|
+
el,
|
|
335
|
+
{
|
|
336
|
+
clipPath: useClipPath ? "polygon(0 0,100% 0,100% 100%,0 100%)" : '',
|
|
337
|
+
marginLeft: 0 },
|
|
338
|
+
|
|
339
|
+
duration * (1 - percent / 100),
|
|
340
|
+
transition) :
|
|
341
|
+
|
|
342
|
+
uikitUtil.Transition.start(
|
|
343
|
+
el,
|
|
344
|
+
{
|
|
345
|
+
clipPath: useClipPath ?
|
|
346
|
+
right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)" :
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
'',
|
|
350
|
+
marginLeft: (right ? 1 : -1) * width },
|
|
351
|
+
|
|
352
|
+
duration * (percent / 100),
|
|
353
|
+
transition).
|
|
354
|
+
then(() => _toggle(el, false))).
|
|
355
|
+
then(() => {
|
|
356
|
+
uikitUtil.css(scrollElement, 'overflowX', '');
|
|
357
|
+
uikitUtil.css(el, { clipPath: '', marginLeft: '' });
|
|
358
|
+
});
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
|
|
266
362
|
function toggleAnimation(cmp) {
|
|
267
363
|
return (el, show) => {
|
|
268
364
|
uikitUtil.Animation.cancel(el);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.14.1-dev.eeb4cd6ae | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(s,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitlightbox_panel",["uikit-util"],p):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitLightbox_panel=p(s.UIkit.util))})(this,function(s){"use strict";var p={slide:{show(e){return[{transform:v(e*-100)},{transform:v()}]},percent(e){return _(e)},translate(e,t){return[{transform:v(t*-100*e)},{transform:v(t*100*(1-e))}]}}};function _(e){return Math.abs(s.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function v(e,t){return e===void 0&&(e=0),t===void 0&&(t="%"),e+=e?t:"","translate3d("+e+", 0, 0)"}function w(e){return"scale3d("+e+", "+e+", 1)"}var I={...p,fade:{show(){return[{opacity:0},{opacity:1}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e},{opacity:e}]}},scale:{show(){return[{opacity:0,transform:w(1-.2)},{opacity:1,transform:w(1)}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e,transform:w(1-.2*e)},{opacity:e,transform:w(1-.2+.2*e)}]}}},y={props:{container:Boolean},data:{container:!0},computed:{container(e){let{container:t}=e;return t===!0&&this.$container||t&&s.$(t)}}},A={connected(){!s.hasClass(this.$el,this.$name)&&s.addClass(this.$el,this.$name)}},$={props:{cls:Boolean,animation:"list",duration:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,origin:!1,transition:"ease",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave",initProps:{overflow:"",height:"",paddingTop:"",paddingBottom:"",marginTop:"",marginBottom:"",boxShadow:""},hideProps:{overflow:"hidden",height:0,paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0,boxShadow:"none"}},computed:{hasAnimation(e){let{animation:t}=e;return!!t[0]},hasTransition(e){let{animation:t}=e;return this.hasAnimation&&t[0]===!0}},methods:{toggleElement(e,t,n){return new Promise(o=>Promise.all(s.toNodes(e).map(h=>{const a=s.isBoolean(t)?t:!this.isToggled(h);if(!s.trigger(h,"before"+(a?"show":"hide"),[this]))return Promise.reject();const i=(s.isFunction(n)?n:n===!1||!this.hasAnimation?this._toggle:this.hasTransition?P(this):E(this))(h,a),r=a?this.clsEnter:this.clsLeave;s.addClass(h,r),s.trigger(h,a?"show":"hide",[this]);const l=()=>{s.removeClass(h,r),s.trigger(h,a?"shown":"hidden",[this]),this.$update(h)};return i?i.then(l,()=>(s.removeClass(h,r),Promise.reject())):l()})).then(o,s.noop))},isToggled(e){return e===void 0&&(e=this.$el),[e]=s.toNodes(e),s.hasClass(e,this.clsEnter)?!0:s.hasClass(e,this.clsLeave)?!1:this.cls?s.hasClass(e,this.cls.split(" ")[0]):s.isVisible(e)},_toggle(e,t){if(!e)return;t=Boolean(t);let n;this.cls?(n=s.includes(this.cls," ")||t!==s.hasClass(e,this.cls),n&&s.toggleClass(e,this.cls,s.includes(this.cls," ")?void 0:t)):(n=t===e.hidden,n&&(e.hidden=!t)),s.$$("[autofocus]",e).some(o=>s.isVisible(o)?o.focus()||!0:o.blur()),n&&(s.trigger(e,"toggled",[t,this]),this.$update(e))}}};function P(e){let{isToggled:t,duration:n,initProps:o,hideProps:h,transition:a,_toggle:i}=e;return(r,l)=>{const d=s.Transition.inProgress(r),m=r.hasChildNodes()?s.toFloat(s.css(r.firstElementChild,"marginTop"))+s.toFloat(s.css(r.lastElementChild,"marginBottom")):0,c=s.isVisible(r)?s.height(r)+(d?0:m):0;s.Transition.cancel(r),t(r)||i(r,!0),s.height(r,""),s.fastdom.flush();const g=s.height(r)+(d?0:m);return s.height(r,c),(l?s.Transition.start(r,{...o,overflow:"hidden",height:g},Math.round(n*(1-c/g)),a):s.Transition.start(r,h,Math.round(n*(c/g)),a).then(()=>i(r,!1))).then(()=>s.css(r,o))}}function E(e){return(t,n)=>{s.Animation.cancel(t);const{animation:o,duration:h,_toggle:a}=e;return n?(a(t,!0),s.Animation.in(t,o[0],h,e.origin)):s.Animation.out(t,o[1]||o[0],h,e.origin).then(()=>a(t,!1))}}const f=[];var S={mixins:[A,y,$],props:{selPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean},data:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1},computed:{panel(e,t){let{selPanel:n}=e;return s.$(n,t)},transitionElement(){return this.panel},bgClose(e){let{bgClose:t}=e;return t&&this.panel}},beforeDisconnect(){s.includes(f,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate(){return this.selClose},handler(e){e.preventDefault(),this.hide()}},{name:"toggle",self:!0,handler(e){e.defaultPrevented||(e.preventDefault(),this.isToggled()===s.includes(f,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(e){if(s.includes(f,this))return!1;!this.stack&&f.length?(Promise.all(f.map(t=>t.hide())).then(this.show),e.preventDefault()):f.push(this)}},{name:"show",self:!0,handler(){const e=document.documentElement;s.width(window)>e.clientWidth&&this.overlay&&s.css(document.body,"overflowY","scroll"),this.stack&&s.css(this.$el,"zIndex",s.toFloat(s.css(this.$el,"zIndex"))+f.length),s.addClass(e,this.clsPage),this.bgClose&&s.once(this.$el,"hide",s.on(document,s.pointerDown,t=>{let{target:n}=t;s.last(f)!==this||this.overlay&&!s.within(n,this.$el)||s.within(n,this.panel)||s.once(document,s.pointerUp+" "+s.pointerCancel+" scroll",o=>{let{defaultPrevented:h,type:a,target:i}=o;!h&&a===s.pointerUp&&n===i&&this.hide()},!0)}),{self:!0}),this.escClose&&s.once(this.$el,"hide",s.on(document,"keydown",t=>{t.keyCode===27&&s.last(f)===this&&this.hide()}),{self:!0})}},{name:"shown",self:!0,handler(){s.isFocusable(this.$el)||s.attr(this.$el,"tabindex","-1"),s.$(":focus",this.$el)||this.$el.focus()}},{name:"hidden",self:!0,handler(){s.includes(f,this)&&f.splice(f.indexOf(this),1),f.length||s.css(document.body,"overflowY",""),s.css(this.$el,"zIndex",""),f.some(e=>e.clsPage===this.clsPage)||s.removeClass(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&s.parent(this.$el)!==this.container?(s.append(this.container,this.$el),new Promise(e=>requestAnimationFrame(()=>this.show().then(e)))):this.toggleElement(this.$el,!0,C(this))},hide(){return this.toggleElement(this.$el,!1,C(this))}}};function C(e){let{transitionElement:t,_toggle:n}=e;return(o,h)=>new Promise((a,i)=>s.once(o,"show hide",()=>{o._reject==null||o._reject(),o._reject=i,n(o,h);const r=s.once(t,"transitionstart",()=>{s.once(t,"transitionend transitioncancel",a,{self:!0}),clearTimeout(l)},{self:!0}),l=setTimeout(()=>{r(),a()},N(s.css(t,"transitionDuration")))})).then(()=>delete o._reject)}function N(e){return e?s.endsWith(e,"ms")?s.toFloat(e):s.toFloat(e)*1e3:0}function D(e,t,n,o){let{animation:h,easing:a}=o;const{percent:i,translate:r,show:l=s.noop}=h,d=l(n),m=new s.Deferred;return{dir:n,show(c,g,R){g===void 0&&(g=0);const x=R?"linear":a;return c-=Math.round(c*s.clamp(g,-1,1)),this.translate(g),b(t,"itemin",{percent:g,duration:c,timing:x,dir:n}),b(e,"itemout",{percent:1-g,duration:c,timing:x,dir:n}),Promise.all([s.Transition.start(t,d[1],c,x),s.Transition.start(e,d[0],c,x)]).then(()=>{this.reset(),m.resolve()},s.noop),m.promise},cancel(){s.Transition.cancel([t,e])},reset(){for(const c in d[0])s.css([t,e],c,"")},forward(c,g){return g===void 0&&(g=this.percent()),s.Transition.cancel([t,e]),this.show(c,g,!0)},translate(c){this.reset();const g=r(c,n);s.css(t,g[1]),s.css(e,g[0]),b(t,"itemtranslatein",{percent:c,dir:n}),b(e,"itemtranslateout",{percent:1-c,dir:n})},percent(){return i(e||t,t,n)},getDistance(){return e?.offsetWidth}}}function b(e,t,n){s.trigger(e,s.createEvent(t,!1,!1,n))}var B={connected(){var e;this.registerObserver(s.observeResize(((e=this.$options.resizeTargets)==null?void 0:e.call(this))||this.$el,()=>this.$emit("resize")))}},z={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){s.attr(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el(){return document},filter(){return this.autoplay},handler(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay(){this.stopAutoplay(),this.interval=setInterval(()=>(!this.draggable||!s.$(":focus",this.$el))&&(!this.pauseOnHover||!s.matches(this.$el,":hover"))&&!this.stack.length&&this.show("next"),this.autoplayInterval)},stopAutoplay(){this.interval&&clearInterval(this.interval)}}},M={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const e of["start","move","end"]){const t=this[e];this[e]=n=>{const o=s.getEventPos(n).x*(s.isRtl?-1:1);this.prevPos=o===this.pos?this.prevPos:this.pos,this.pos=o,t(n)}}},events:[{name:s.pointerDown,delegate(){return this.selSlides},handler(e){!this.draggable||!s.isTouch(e)&&j(e.target)||s.closest(e.target,s.selInput)||e.button>0||this.length<2||this.start(e)}},{name:"dragstart",handler(e){e.preventDefault()}}],methods:{start(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,s.on(document,s.pointerMove,this.move,{passive:!1}),s.on(document,s.pointerUp+" "+s.pointerCancel+" input",this.end,!0),s.css(this.list,"userSelect","none")},move(e){const t=this.pos-this.drag;if(t===0||this.prevPos===this.pos||!this.dragging&&Math.abs(t)<this.threshold)return;s.css(this.list,"pointerEvents","none"),e.cancelable&&e.preventDefault(),this.dragging=!0,this.dir=t<0?1:-1;const{slides:n}=this;let{prevIndex:o}=this,h=Math.abs(t),a=this.getIndex(o+this.dir,o),i=this._getDistance(o,a)||n[o].offsetWidth;for(;a!==o&&h>i;)this.drag-=i*this.dir,o=a,h-=i,a=this.getIndex(o+this.dir,o),i=this._getDistance(o,a)||n[o].offsetWidth;this.percent=h/i;const r=n[o],l=n[a],d=this.index!==a,m=o===a;let c;[this.index,this.prevIndex].filter(g=>!s.includes([a,o],g)).forEach(g=>{s.trigger(n[g],"itemhidden",[this]),m&&(c=!0,this.prevIndex=o)}),(this.index===o&&this.prevIndex!==o||c)&&s.trigger(n[this.index],"itemshown",[this]),d&&(this.prevIndex=o,this.index=a,!m&&s.trigger(r,"beforeitemhide",[this]),s.trigger(l,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),r,!m&&l),d&&(!m&&s.trigger(r,"itemhide",[this]),s.trigger(l,"itemshow",[this]))},end(){if(s.off(document,s.pointerMove,this.move,{passive:!1}),s.off(document,s.pointerUp+" "+s.pointerCancel+" input",this.end,!0),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{const e=(s.isRtl?this.dir*(s.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=e?this.index:this.prevIndex,e&&(this.percent=1-this.percent),this.show(this.dir>0&&!e||this.dir<0&&e?"next":"previous",!0)}s.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function j(e){return!e.children.length&&e.childNodes.length}var O={data:{selNav:!1},computed:{nav(e,t){let{selNav:n}=e;return s.$(n,t)},selNavItem(e){let{attrItem:t}=e;return"["+t+"],[data-"+t+"]"},navItems(e,t){return s.$$(this.selNavItem,t)}},update:{write(){this.nav&&this.length!==this.nav.children.length&&s.html(this.nav,this.slides.map((e,t)=>"<li "+this.attrItem+'="'+t+'"><a href></a></li>').join("")),this.navItems.concat(this.nav).forEach(e=>e&&(e.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]},events:[{name:"click",delegate(){return this.selNavItem},handler(e){e.preventDefault(),this.show(s.data(e.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav(){const e=this.getValidIndex();for(const t of this.navItems){const n=s.data(t,this.attrItem);s.toggleClass(t,this.clsActive,s.toNumber(n)===e),s.toggleClass(t,"uk-invisible",this.finite&&(n==="previous"&&e===0||n==="next"&&e>=this.maxIndex))}}}},W={mixins:[z,M,O,B],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number,selSlides:String},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){s.removeClass(this.slides,this.clsActive)},computed:{duration(e,t){let{velocity:n}=e;return H(t.offsetWidth/n)},list(e,t){let{selList:n}=e;return s.$(n,t)},maxIndex(){return this.length-1},selSlides(e){let{selList:t,selSlides:n}=e;return t+" "+(n||"> *")},slides:{get(){return s.$$(this.selSlides,this.$el)},watch(){this.$reset()}},length(){return this.slides.length}},methods:{show(e,t){if(t===void 0&&(t=!1),this.dragging||!this.length)return;const{stack:n}=this,o=t?0:n.length,h=()=>{n.splice(o,1),n.length&&this.show(n.shift(),!0)};if(n[t?"unshift":"push"](e),!t&&n.length>1){n.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}const a=this.getIndex(this.index),i=s.hasClass(this.slides,this.clsActive)&&this.slides[a],r=this.getIndex(e,this.index),l=this.slides[r];if(i===l){h();return}if(this.dir=F(e,a),this.prevIndex=a,this.index=r,i&&!s.trigger(i,"beforeitemhide",[this])||!s.trigger(l,"beforeitemshow",[this,i])){this.index=this.prevIndex,h();return}const d=this._show(i,l,t).then(()=>(i&&s.trigger(i,"itemhidden",[this]),s.trigger(l,"itemshown",[this]),new Promise(m=>{s.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,m()})})));return i&&s.trigger(i,"itemhide",[this]),s.trigger(l,"itemshow",[this]),d},getIndex(e,t){return e===void 0&&(e=this.index),t===void 0&&(t=this.index),s.clamp(s.getIndex(e,this.slides,t,this.finite),0,this.maxIndex)},getValidIndex(e,t){return e===void 0&&(e=this.index),t===void 0&&(t=this.prevIndex),this.getIndex(e,t)},_show(e,t,n){if(this._transitioner=this._getTransitioner(e,t,this.dir,{easing:n?t.offsetWidth<600?"cubic-bezier(0.25, 0.46, 0.45, 0.94)":"cubic-bezier(0.165, 0.84, 0.44, 1)":this.easing,...this.transitionOptions}),!n&&!e)return this._translate(1),Promise.resolve();const{length:o}=this.stack;return this._transitioner[o>1?"forward":"show"](o>1?Math.min(this.duration,75+75/(o-1)):this.duration,this.percent)},_getDistance(e,t){return this._getTransitioner(e,e!==t&&t).getDistance()},_translate(e,t,n){t===void 0&&(t=this.prevIndex),n===void 0&&(n=this.index);const o=this._getTransitioner(t!==n?t:!1,n);return o.translate(e),o},_getTransitioner(e,t,n,o){return e===void 0&&(e=this.prevIndex),t===void 0&&(t=this.index),n===void 0&&(n=this.dir||1),o===void 0&&(o=this.transitionOptions),new this.Transitioner(s.isNumber(e)?this.slides[e]:e,s.isNumber(t)?this.slides[t]:t,n*(s.isRtl?-1:1),o)}}};function F(e,t){return e==="next"?1:e==="previous"||e<t?-1:1}function H(e){return .5*e+300}var L={mixins:[W],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:p,Transitioner:D},computed:{animation(e){let{animation:t,Animations:n}=e;return{...n[t]||n.slide,name:t}},transitionOptions(){return{animation:this.animation}}},events:{beforeitemshow(e){let{target:t}=e;s.addClass(t,this.clsActive)},itemshown(e){let{target:t}=e;s.addClass(t,this.clsActivated)},itemhidden(e){let{target:t}=e;s.removeClass(t,this.clsActive,this.clsActivated)}}},T={mixins:[y,S,$,L],functional:!0,props:{delayControls:Number,preload:Number,videoAutoplay:Boolean,template:String},data:()=>({preload:1,videoAutoplay:!1,delayControls:3e3,items:[],cls:"uk-open",clsPage:"uk-lightbox-page",selList:".uk-lightbox-items",attrItem:"uk-lightbox-item",selClose:".uk-close-large",selCaption:".uk-lightbox-caption",pauseOnHover:!1,velocity:2,Animations:I,template:'<div class="uk-lightbox uk-overflow-hidden"> <ul class="uk-lightbox-items"></ul> <div class="uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque"> <button class="uk-lightbox-toolbar-icon uk-close-large" type="button" uk-close></button> </div> <a class="uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade" href uk-slidenav-previous uk-lightbox-item="previous"></a> <a class="uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade" href uk-slidenav-next uk-lightbox-item="next"></a> <div class="uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div> </div>'}),created(){const e=s.$(this.template),t=s.$(this.selList,e);this.items.forEach(()=>s.append(t,"<li>")),this.$mount(s.append(this.container,e))},computed:{caption(e,t){let{selCaption:n}=e;return s.$(n,t)}},events:[{name:s.pointerMove+" "+s.pointerDown+" keydown",handler:"showControls"},{name:"click",self:!0,delegate(){return this.selSlides},handler(e){e.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler(){this.showControls()}},{name:"hide",self:!0,handler(){this.hideControls(),s.removeClass(this.slides,this.clsActive),s.Transition.stop(this.slides)}},{name:"hidden",self:!0,handler(){this.$destroy(!0)}},{name:"keyup",el(){return document},handler(e){if(!(!this.isToggled(this.$el)||!this.draggable))switch(e.keyCode){case 37:this.show("previous");break;case 39:this.show("next");break}}},{name:"beforeitemshow",handler(e){this.isToggled()||(this.draggable=!1,e.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=I.scale,s.removeClass(e.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){s.html(this.caption,this.getItem().caption||"");for(let e=-this.preload;e<=this.preload;e++)this.loadItem(this.index+e)}},{name:"itemshown",handler(){this.draggable=this.$props.draggable}},{name:"itemload",async handler(e,t){const{source:n,type:o,alt:h="",poster:a,attrs:i={}}=t;if(this.setItem(t,"<span uk-spinner></span>"),!n)return;let r;const l={frameborder:"0",allow:"autoplay",allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":""+this.videoAutoplay};if(o==="image"||n.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i))try{const{width:d,height:m}=await s.getImage(n,i.srcset,i.size);this.setItem(t,u("img",{src:n,width:d,height:m,alt:h,...i}))}catch{this.setError(t)}else if(o==="video"||n.match(/\.(mp4|webm|ogv)($|\?)/i)){const d=u("video",{src:n,poster:a,controls:"",playsinline:"","uk-video":""+this.videoAutoplay,...i});s.on(d,"loadedmetadata",()=>{s.attr(d,{width:d.videoWidth,height:d.videoHeight}),this.setItem(t,d)}),s.on(d,"error",()=>this.setError(t))}else if(o==="iframe"||n.match(/\.(html|php)($|\?)/i))this.setItem(t,u("iframe",{src:n,frameborder:"0",allowfullscreen:"",class:"uk-lightbox-iframe",...i}));else if(r=n.match(/\/\/(?:.*?youtube(-nocookie)?\..*?[?&]v=|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(t,u("iframe",{src:"https://www.youtube"+(r[1]||"")+".com/embed/"+r[2]+(r[3]?"?"+r[3]:""),width:1920,height:1080,...l,...i}));else if(r=n.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{const{height:d,width:m}=await(await fetch("https://vimeo.com/api/oembed.json?maxwidth=1920&url="+encodeURI(n),{credentials:"omit"})).json();this.setItem(t,u("iframe",{src:"https://player.vimeo.com/video/"+r[1]+(r[2]?"?"+r[2]:""),width:m,height:d,...l,...i}))}catch{this.setError(t)}}}],methods:{loadItem(e){e===void 0&&(e=this.index);const t=this.getItem(e);this.getSlide(t).childElementCount||s.trigger(this.$el,"itemload",[t])},getItem(e){return e===void 0&&(e=this.index),this.items[s.getIndex(e,this.slides)]},setItem(e,t){s.trigger(this.$el,"itemloaded",[this,s.html(this.getSlide(e),t)])},getSlide(e){return this.slides[this.items.indexOf(e)]},setError(e){this.setItem(e,'<span uk-icon="icon: bolt; ratio: 2"></span>')},showControls(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),s.addClass(this.$el,"uk-active","uk-transition-active")},hideControls(){s.removeClass(this.$el,"uk-active","uk-transition-active")}}};function u(e,t){const n=s.fragment("<"+e+">");return s.attr(n,t),n}return typeof window<"u"&&window.UIkit&&window.UIkit.component("lightboxPanel",T),T});
|
|
1
|
+
/*! UIkit 3.14.2-dev.35b3deec9 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(s,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitlightbox_panel",["uikit-util"],u):(s=typeof globalThis<"u"?globalThis:s||self,s.UIkitLightbox_panel=u(s.UIkit.util))})(this,function(s){"use strict";var u={slide:{show(e){return[{transform:b(e*-100)},{transform:b()}]},percent(e){return E(e)},translate(e,t){return[{transform:b(t*-100*e)},{transform:b(t*100*(1-e))}]}}};function E(e){return Math.abs(s.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function b(e,t){return e===void 0&&(e=0),t===void 0&&(t="%"),e+=e?t:"","translate3d("+e+", 0, 0)"}function x(e){return"scale3d("+e+", "+e+", 1)"}var $={...u,fade:{show(){return[{opacity:0},{opacity:1}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e},{opacity:e}]}},scale:{show(){return[{opacity:0,transform:x(1-.2)},{opacity:1,transform:x(1)}]},percent(e){return 1-s.css(e,"opacity")},translate(e){return[{opacity:1-e,transform:x(1-.2*e)},{opacity:e,transform:x(1-.2+.2*e)}]}}},C={props:{container:Boolean},data:{container:!0},computed:{container(e){let{container:t}=e;return t===!0&&this.$container||t&&s.$(t)}}},S={connected(){!s.hasClass(this.$el,this.$name)&&s.addClass(this.$el,this.$name)}},T={props:{cls:Boolean,animation:"list",duration:Number,velocity:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,velocity:.2,origin:!1,transition:"ease",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave",initProps:{overflow:"",maxHeight:"",paddingTop:"",paddingBottom:"",marginTop:"",marginBottom:"",boxShadow:""},hideProps:{overflow:"hidden",maxHeight:0,paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0,boxShadow:"none"}},computed:{hasAnimation(e){let{animation:t}=e;return!!t[0]},hasTransition(e){let{animation:t}=e;return s.startsWith(t[0],"slide")}},methods:{toggleElement(e,t,n){return new Promise(o=>Promise.all(s.toNodes(e).map(d=>{const i=s.isBoolean(t)?t:!this.isToggled(d);if(!s.trigger(d,"before"+(i?"show":"hide"),[this]))return Promise.reject();const h=(s.isFunction(n)?n:n===!1||!this.hasAnimation?N(this):this.hasTransition?D(this):z(this))(d,i),r=i?this.clsEnter:this.clsLeave;s.addClass(d,r),s.trigger(d,i?"show":"hide",[this]);const a=()=>{s.removeClass(d,r),s.trigger(d,i?"shown":"hidden",[this]),this.$update(d)};return h?h.then(a,()=>(s.removeClass(d,r),Promise.reject())):a()})).then(o,s.noop))},isToggled(e){return e===void 0&&(e=this.$el),[e]=s.toNodes(e),s.hasClass(e,this.clsEnter)?!0:s.hasClass(e,this.clsLeave)?!1:this.cls?s.hasClass(e,this.cls.split(" ")[0]):s.isVisible(e)},_toggle(e,t){if(!e)return;t=Boolean(t);let n;this.cls?(n=s.includes(this.cls," ")||t!==s.hasClass(e,this.cls),n&&s.toggleClass(e,this.cls,s.includes(this.cls," ")?void 0:t)):(n=t===e.hidden,n&&(e.hidden=!t)),s.$$("[autofocus]",e).some(o=>s.isVisible(o)?o.focus()||!0:o.blur()),n&&(s.trigger(e,"toggled",[t,this]),this.$update(e))}}};function N(e){let{_toggle:t}=e;return(n,o)=>(s.Animation.cancel(n),s.Transition.cancel(n),t(n,o))}function D(e){switch(e.animation[0]){case"slide-left":return _(e);case"slide-right":return _(e,!0)}return B(e)}function B(e){let{isToggled:t,duration:n,velocity:o,initProps:d,hideProps:i,transition:h,_toggle:r}=e;return(a,l)=>{const m=s.Transition.inProgress(a),g=!m&&a.hasChildNodes()?s.toFloat(s.css(a.firstElementChild,"marginTop"))+s.toFloat(s.css(a.lastElementChild,"marginBottom")):0,c=s.isVisible(a)?s.toFloat(s.css(a,"height"))+g:0,v=m?s.css(a,Object.keys(d)):l?i:d;s.Transition.cancel(a),t(a)||r(a,!0),s.css(a,"maxHeight",""),s.fastdom.flush();const p=s.toFloat(s.css(a,"height"))+g;return n=o*p+n,s.css(a,{...v,maxHeight:c}),(l?s.Transition.start(a,{...d,overflow:"hidden",maxHeight:p},n*(1-c/p),h):s.Transition.start(a,i,n*(c/p),h).then(()=>r(a,!1))).then(()=>s.css(a,d))}}function _(e,t){let{isToggled:n,duration:o,velocity:d,transition:i,_toggle:h}=e;return(r,a)=>{const l=s.isVisible(r),m=s.toFloat(s.css(r,"marginLeft"));s.Transition.cancel(r);const[g]=s.scrollParents(r);s.css(g,"overflowX","hidden"),n(r)||h(r,!0);const c=s.toFloat(s.css(r,"width"));o=d*c+o;const v=l?(c+m*(t?-1:1))/c*100:0,p=s.offset(r),I=t?p.right<g.clientWidth:Math.round(p.left)>0;return s.css(r,{clipPath:I?t?"polygon(0 0,"+v+"% 0,"+v+"% 100%,0 100%)":"polygon("+(100-v)+"% 0,100% 0,100% 100%,"+(100-v)+"% 100%)":"",marginLeft:(100-v)*(t?1:-1)/100*c}),(a?s.Transition.start(r,{clipPath:I?"polygon(0 0,100% 0,100% 100%,0 100%)":"",marginLeft:0},o*(1-v/100),i):s.Transition.start(r,{clipPath:I?t?"polygon(0 0,0 0,0 100%,0 100%)":"polygon(100% 0,100% 0,100% 100%,100% 100%)":"",marginLeft:(t?1:-1)*c},o*(v/100),i).then(()=>h(r,!1))).then(()=>{s.css(g,"overflowX",""),s.css(r,{clipPath:"",marginLeft:""})})}}function z(e){return(t,n)=>{s.Animation.cancel(t);const{animation:o,duration:d,_toggle:i}=e;return n?(i(t,!0),s.Animation.in(t,o[0],d,e.origin)):s.Animation.out(t,o[1]||o[0],d,e.origin).then(()=>i(t,!1))}}const f=[];var j={mixins:[S,C,T],props:{selPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean},data:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1},computed:{panel(e,t){let{selPanel:n}=e;return s.$(n,t)},transitionElement(){return this.panel},bgClose(e){let{bgClose:t}=e;return t&&this.panel}},beforeDisconnect(){s.includes(f,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate(){return this.selClose},handler(e){e.preventDefault(),this.hide()}},{name:"toggle",self:!0,handler(e){e.defaultPrevented||(e.preventDefault(),this.isToggled()===s.includes(f,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(e){if(s.includes(f,this))return!1;!this.stack&&f.length?(Promise.all(f.map(t=>t.hide())).then(this.show),e.preventDefault()):f.push(this)}},{name:"show",self:!0,handler(){const e=document.documentElement;s.width(window)>e.clientWidth&&this.overlay&&s.css(document.body,"overflowY","scroll"),this.stack&&s.css(this.$el,"zIndex",s.toFloat(s.css(this.$el,"zIndex"))+f.length),s.addClass(e,this.clsPage),this.bgClose&&s.once(this.$el,"hide",s.on(document,s.pointerDown,t=>{let{target:n}=t;s.last(f)!==this||this.overlay&&!s.within(n,this.$el)||s.within(n,this.panel)||s.once(document,s.pointerUp+" "+s.pointerCancel+" scroll",o=>{let{defaultPrevented:d,type:i,target:h}=o;!d&&i===s.pointerUp&&n===h&&this.hide()},!0)}),{self:!0}),this.escClose&&s.once(this.$el,"hide",s.on(document,"keydown",t=>{t.keyCode===27&&s.last(f)===this&&this.hide()}),{self:!0})}},{name:"shown",self:!0,handler(){s.isFocusable(this.$el)||s.attr(this.$el,"tabindex","-1"),s.$(":focus",this.$el)||this.$el.focus()}},{name:"hidden",self:!0,handler(){s.includes(f,this)&&f.splice(f.indexOf(this),1),f.length||s.css(document.body,"overflowY",""),s.css(this.$el,"zIndex",""),f.some(e=>e.clsPage===this.clsPage)||s.removeClass(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&s.parent(this.$el)!==this.container?(s.append(this.container,this.$el),new Promise(e=>requestAnimationFrame(()=>this.show().then(e)))):this.toggleElement(this.$el,!0,A(this))},hide(){return this.toggleElement(this.$el,!1,A(this))}}};function A(e){let{transitionElement:t,_toggle:n}=e;return(o,d)=>new Promise((i,h)=>s.once(o,"show hide",()=>{o._reject==null||o._reject(),o._reject=h,n(o,d);const r=s.once(t,"transitionstart",()=>{s.once(t,"transitionend transitioncancel",i,{self:!0}),clearTimeout(a)},{self:!0}),a=setTimeout(()=>{r(),i()},L(s.css(t,"transitionDuration")))})).then(()=>delete o._reject)}function L(e){return e?s.endsWith(e,"ms")?s.toFloat(e):s.toFloat(e)*1e3:0}function H(e,t,n,o){let{animation:d,easing:i}=o;const{percent:h,translate:r,show:a=s.noop}=d,l=a(n),m=new s.Deferred;return{dir:n,show(g,c,v){c===void 0&&(c=0);const p=v?"linear":i;return g-=Math.round(g*s.clamp(c,-1,1)),this.translate(c),y(t,"itemin",{percent:c,duration:g,timing:p,dir:n}),y(e,"itemout",{percent:1-c,duration:g,timing:p,dir:n}),Promise.all([s.Transition.start(t,l[1],g,p),s.Transition.start(e,l[0],g,p)]).then(()=>{this.reset(),m.resolve()},s.noop),m.promise},cancel(){s.Transition.cancel([t,e])},reset(){for(const g in l[0])s.css([t,e],g,"")},forward(g,c){return c===void 0&&(c=this.percent()),s.Transition.cancel([t,e]),this.show(g,c,!0)},translate(g){this.reset();const c=r(g,n);s.css(t,c[1]),s.css(e,c[0]),y(t,"itemtranslatein",{percent:g,dir:n}),y(e,"itemtranslateout",{percent:1-g,dir:n})},percent(){return h(e||t,t,n)},getDistance(){return e==null?void 0:e.offsetWidth}}}function y(e,t,n){s.trigger(e,s.createEvent(t,!1,!1,n))}var M={connected(){var e;this.registerObserver(s.observeResize(((e=this.$options.resizeTargets)==null?void 0:e.call(this))||this.$el,()=>this.$emit("resize")))}},O={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){s.attr(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el(){return document},filter(){return this.autoplay},handler(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay(){this.stopAutoplay(),this.interval=setInterval(()=>(!this.draggable||!s.$(":focus",this.$el))&&(!this.pauseOnHover||!s.matches(this.$el,":hover"))&&!this.stack.length&&this.show("next"),this.autoplayInterval)},stopAutoplay(){this.interval&&clearInterval(this.interval)}}},F={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const e of["start","move","end"]){const t=this[e];this[e]=n=>{const o=s.getEventPos(n).x*(s.isRtl?-1:1);this.prevPos=o===this.pos?this.prevPos:this.pos,this.pos=o,t(n)}}},events:[{name:s.pointerDown,delegate(){return this.selSlides},handler(e){!this.draggable||!s.isTouch(e)&&W(e.target)||s.closest(e.target,s.selInput)||e.button>0||this.length<2||this.start(e)}},{name:"dragstart",handler(e){e.preventDefault()}}],methods:{start(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,s.on(document,s.pointerMove,this.move,{passive:!1}),s.on(document,s.pointerUp+" "+s.pointerCancel+" input",this.end,!0),s.css(this.list,"userSelect","none")},move(e){const t=this.pos-this.drag;if(t===0||this.prevPos===this.pos||!this.dragging&&Math.abs(t)<this.threshold)return;s.css(this.list,"pointerEvents","none"),e.cancelable&&e.preventDefault(),this.dragging=!0,this.dir=t<0?1:-1;const{slides:n}=this;let{prevIndex:o}=this,d=Math.abs(t),i=this.getIndex(o+this.dir,o),h=this._getDistance(o,i)||n[o].offsetWidth;for(;i!==o&&d>h;)this.drag-=h*this.dir,o=i,d-=h,i=this.getIndex(o+this.dir,o),h=this._getDistance(o,i)||n[o].offsetWidth;this.percent=d/h;const r=n[o],a=n[i],l=this.index!==i,m=o===i;let g;[this.index,this.prevIndex].filter(c=>!s.includes([i,o],c)).forEach(c=>{s.trigger(n[c],"itemhidden",[this]),m&&(g=!0,this.prevIndex=o)}),(this.index===o&&this.prevIndex!==o||g)&&s.trigger(n[this.index],"itemshown",[this]),l&&(this.prevIndex=o,this.index=i,!m&&s.trigger(r,"beforeitemhide",[this]),s.trigger(a,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),r,!m&&a),l&&(!m&&s.trigger(r,"itemhide",[this]),s.trigger(a,"itemshow",[this]))},end(){if(s.off(document,s.pointerMove,this.move,{passive:!1}),s.off(document,s.pointerUp+" "+s.pointerCancel+" input",this.end,!0),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{const e=(s.isRtl?this.dir*(s.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=e?this.index:this.prevIndex,e&&(this.percent=1-this.percent),this.show(this.dir>0&&!e||this.dir<0&&e?"next":"previous",!0)}s.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function W(e){return!e.children.length&&e.childNodes.length}var R={data:{selNav:!1},computed:{nav(e,t){let{selNav:n}=e;return s.$(n,t)},selNavItem(e){let{attrItem:t}=e;return"["+t+"],[data-"+t+"]"},navItems(e,t){return s.$$(this.selNavItem,t)}},update:{write(){this.nav&&this.length!==this.nav.children.length&&s.html(this.nav,this.slides.map((e,t)=>"<li "+this.attrItem+'="'+t+'"><a href></a></li>').join("")),this.navItems.concat(this.nav).forEach(e=>e&&(e.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]},events:[{name:"click",delegate(){return this.selNavItem},handler(e){e.preventDefault(),this.show(s.data(e.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav(){const e=this.getValidIndex();for(const t of this.navItems){const n=s.data(t,this.attrItem);s.toggleClass(t,this.clsActive,s.toNumber(n)===e),s.toggleClass(t,"uk-invisible",this.finite&&(n==="previous"&&e===0||n==="next"&&e>=this.maxIndex))}}}},V={mixins:[O,F,R,M],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number,selSlides:String},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){s.removeClass(this.slides,this.clsActive)},computed:{duration(e,t){let{velocity:n}=e;return X(t.offsetWidth/n)},list(e,t){let{selList:n}=e;return s.$(n,t)},maxIndex(){return this.length-1},selSlides(e){let{selList:t,selSlides:n}=e;return t+" "+(n||"> *")},slides:{get(){return s.$$(this.selSlides,this.$el)},watch(){this.$reset()}},length(){return this.slides.length}},methods:{show(e,t){if(t===void 0&&(t=!1),this.dragging||!this.length)return;const{stack:n}=this,o=t?0:n.length,d=()=>{n.splice(o,1),n.length&&this.show(n.shift(),!0)};if(n[t?"unshift":"push"](e),!t&&n.length>1){n.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}const i=this.getIndex(this.index),h=s.hasClass(this.slides,this.clsActive)&&this.slides[i],r=this.getIndex(e,this.index),a=this.slides[r];if(h===a){d();return}if(this.dir=q(e,i),this.prevIndex=i,this.index=r,h&&!s.trigger(h,"beforeitemhide",[this])||!s.trigger(a,"beforeitemshow",[this,h])){this.index=this.prevIndex,d();return}const l=this._show(h,a,t).then(()=>(h&&s.trigger(h,"itemhidden",[this]),s.trigger(a,"itemshown",[this]),new Promise(m=>{s.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,m()})})));return h&&s.trigger(h,"itemhide",[this]),s.trigger(a,"itemshow",[this]),l},getIndex(e,t){return e===void 0&&(e=this.index),t===void 0&&(t=this.index),s.clamp(s.getIndex(e,this.slides,t,this.finite),0,this.maxIndex)},getValidIndex(e,t){return e===void 0&&(e=this.index),t===void 0&&(t=this.prevIndex),this.getIndex(e,t)},_show(e,t,n){if(this._transitioner=this._getTransitioner(e,t,this.dir,{easing:n?t.offsetWidth<600?"cubic-bezier(0.25, 0.46, 0.45, 0.94)":"cubic-bezier(0.165, 0.84, 0.44, 1)":this.easing,...this.transitionOptions}),!n&&!e)return this._translate(1),Promise.resolve();const{length:o}=this.stack;return this._transitioner[o>1?"forward":"show"](o>1?Math.min(this.duration,75+75/(o-1)):this.duration,this.percent)},_getDistance(e,t){return this._getTransitioner(e,e!==t&&t).getDistance()},_translate(e,t,n){t===void 0&&(t=this.prevIndex),n===void 0&&(n=this.index);const o=this._getTransitioner(t!==n?t:!1,n);return o.translate(e),o},_getTransitioner(e,t,n,o){return e===void 0&&(e=this.prevIndex),t===void 0&&(t=this.index),n===void 0&&(n=this.dir||1),o===void 0&&(o=this.transitionOptions),new this.Transitioner(s.isNumber(e)?this.slides[e]:e,s.isNumber(t)?this.slides[t]:t,n*(s.isRtl?-1:1),o)}}};function q(e,t){return e==="next"?1:e==="previous"||e<t?-1:1}function X(e){return .5*e+300}var Y={mixins:[V],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:u,Transitioner:H},computed:{animation(e){let{animation:t,Animations:n}=e;return{...n[t]||n.slide,name:t}},transitionOptions(){return{animation:this.animation}}},events:{beforeitemshow(e){let{target:t}=e;s.addClass(t,this.clsActive)},itemshown(e){let{target:t}=e;s.addClass(t,this.clsActivated)},itemhidden(e){let{target:t}=e;s.removeClass(t,this.clsActive,this.clsActivated)}}},P={mixins:[C,j,T,Y],functional:!0,props:{delayControls:Number,preload:Number,videoAutoplay:Boolean,template:String},data:()=>({preload:1,videoAutoplay:!1,delayControls:3e3,items:[],cls:"uk-open",clsPage:"uk-lightbox-page",selList:".uk-lightbox-items",attrItem:"uk-lightbox-item",selClose:".uk-close-large",selCaption:".uk-lightbox-caption",pauseOnHover:!1,velocity:2,Animations:$,template:'<div class="uk-lightbox uk-overflow-hidden"> <ul class="uk-lightbox-items"></ul> <div class="uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque"> <button class="uk-lightbox-toolbar-icon uk-close-large" type="button" uk-close></button> </div> <a class="uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade" href uk-slidenav-previous uk-lightbox-item="previous"></a> <a class="uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade" href uk-slidenav-next uk-lightbox-item="next"></a> <div class="uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div> </div>'}),created(){const e=s.$(this.template),t=s.$(this.selList,e);this.items.forEach(()=>s.append(t,"<li>")),this.$mount(s.append(this.container,e))},computed:{caption(e,t){let{selCaption:n}=e;return s.$(n,t)}},events:[{name:s.pointerMove+" "+s.pointerDown+" keydown",handler:"showControls"},{name:"click",self:!0,delegate(){return this.selSlides},handler(e){e.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler(){this.showControls()}},{name:"hide",self:!0,handler(){this.hideControls(),s.removeClass(this.slides,this.clsActive),s.Transition.stop(this.slides)}},{name:"hidden",self:!0,handler(){this.$destroy(!0)}},{name:"keyup",el(){return document},handler(e){if(!(!this.isToggled(this.$el)||!this.draggable))switch(e.keyCode){case 37:this.show("previous");break;case 39:this.show("next");break}}},{name:"beforeitemshow",handler(e){this.isToggled()||(this.draggable=!1,e.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=$.scale,s.removeClass(e.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){s.html(this.caption,this.getItem().caption||"");for(let e=-this.preload;e<=this.preload;e++)this.loadItem(this.index+e)}},{name:"itemshown",handler(){this.draggable=this.$props.draggable}},{name:"itemload",async handler(e,t){const{source:n,type:o,alt:d="",poster:i,attrs:h={}}=t;if(this.setItem(t,"<span uk-spinner></span>"),!n)return;let r;const a={frameborder:"0",allow:"autoplay",allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":""+this.videoAutoplay};if(o==="image"||n.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i))try{const{width:l,height:m}=await s.getImage(n,h.srcset,h.size);this.setItem(t,w("img",{src:n,width:l,height:m,alt:d,...h}))}catch{this.setError(t)}else if(o==="video"||n.match(/\.(mp4|webm|ogv)($|\?)/i)){const l=w("video",{src:n,poster:i,controls:"",playsinline:"","uk-video":""+this.videoAutoplay,...h});s.on(l,"loadedmetadata",()=>{s.attr(l,{width:l.videoWidth,height:l.videoHeight}),this.setItem(t,l)}),s.on(l,"error",()=>this.setError(t))}else if(o==="iframe"||n.match(/\.(html|php)($|\?)/i))this.setItem(t,w("iframe",{src:n,frameborder:"0",allowfullscreen:"",class:"uk-lightbox-iframe",...h}));else if(r=n.match(/\/\/(?:.*?youtube(-nocookie)?\..*?[?&]v=|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(t,w("iframe",{src:"https://www.youtube"+(r[1]||"")+".com/embed/"+r[2]+(r[3]?"?"+r[3]:""),width:1920,height:1080,...a,...h}));else if(r=n.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{const{height:l,width:m}=await(await fetch("https://vimeo.com/api/oembed.json?maxwidth=1920&url="+encodeURI(n),{credentials:"omit"})).json();this.setItem(t,w("iframe",{src:"https://player.vimeo.com/video/"+r[1]+(r[2]?"?"+r[2]:""),width:m,height:l,...a,...h}))}catch{this.setError(t)}}}],methods:{loadItem(e){e===void 0&&(e=this.index);const t=this.getItem(e);this.getSlide(t).childElementCount||s.trigger(this.$el,"itemload",[t])},getItem(e){return e===void 0&&(e=this.index),this.items[s.getIndex(e,this.slides)]},setItem(e,t){s.trigger(this.$el,"itemloaded",[this,s.html(this.getSlide(e),t)])},getSlide(e){return this.slides[this.items.indexOf(e)]},setError(e){this.setItem(e,'<span uk-icon="icon: bolt; ratio: 2"></span>')},showControls(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),s.addClass(this.$el,"uk-active","uk-transition-active")},hideControls(){s.removeClass(this.$el,"uk-active","uk-transition-active")}}};function w(e,t){const n=s.fragment("<"+e+">");return s.attr(n,t),n}return typeof window<"u"&&window.UIkit&&window.UIkit.component("lightboxPanel",P),P});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.14.
|
|
1
|
+
/*! UIkit 3.14.2-dev.35b3deec9 | 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')) :
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
cls: Boolean,
|
|
98
98
|
animation: 'list',
|
|
99
99
|
duration: Number,
|
|
100
|
+
velocity: Number,
|
|
100
101
|
origin: String,
|
|
101
102
|
transition: String },
|
|
102
103
|
|
|
@@ -105,6 +106,7 @@
|
|
|
105
106
|
cls: false,
|
|
106
107
|
animation: [false],
|
|
107
108
|
duration: 200,
|
|
109
|
+
velocity: 0.2,
|
|
108
110
|
origin: false,
|
|
109
111
|
transition: 'ease',
|
|
110
112
|
clsEnter: 'uk-togglabe-enter',
|
|
@@ -112,7 +114,7 @@
|
|
|
112
114
|
|
|
113
115
|
initProps: {
|
|
114
116
|
overflow: '',
|
|
115
|
-
|
|
117
|
+
maxHeight: '',
|
|
116
118
|
paddingTop: '',
|
|
117
119
|
paddingBottom: '',
|
|
118
120
|
marginTop: '',
|
|
@@ -122,7 +124,7 @@
|
|
|
122
124
|
|
|
123
125
|
hideProps: {
|
|
124
126
|
overflow: 'hidden',
|
|
125
|
-
|
|
127
|
+
maxHeight: 0,
|
|
126
128
|
paddingTop: 0,
|
|
127
129
|
paddingBottom: 0,
|
|
128
130
|
marginTop: 0,
|
|
@@ -137,7 +139,7 @@
|
|
|
137
139
|
},
|
|
138
140
|
|
|
139
141
|
hasTransition(_ref2) {let { animation } = _ref2;
|
|
140
|
-
return
|
|
142
|
+
return uikitUtil.startsWith(animation[0], 'slide');
|
|
141
143
|
} },
|
|
142
144
|
|
|
143
145
|
|
|
@@ -156,9 +158,9 @@
|
|
|
156
158
|
uikitUtil.isFunction(animate) ?
|
|
157
159
|
animate :
|
|
158
160
|
animate === false || !this.hasAnimation ?
|
|
159
|
-
this
|
|
161
|
+
toggleInstant(this) :
|
|
160
162
|
this.hasTransition ?
|
|
161
|
-
|
|
163
|
+
toggleTransition(this) :
|
|
162
164
|
toggleAnimation(this))(
|
|
163
165
|
el, show);
|
|
164
166
|
|
|
@@ -222,14 +224,43 @@
|
|
|
222
224
|
|
|
223
225
|
|
|
224
226
|
|
|
225
|
-
function
|
|
227
|
+
function toggleInstant(_ref3) {let { _toggle } = _ref3;
|
|
228
|
+
return (el, show) => {
|
|
229
|
+
uikitUtil.Animation.cancel(el);
|
|
230
|
+
uikitUtil.Transition.cancel(el);
|
|
231
|
+
return _toggle(el, show);
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function toggleTransition(cmp) {
|
|
236
|
+
switch (cmp.animation[0]) {
|
|
237
|
+
case 'slide-left':
|
|
238
|
+
return slideHorizontal(cmp);
|
|
239
|
+
case 'slide-right':
|
|
240
|
+
return slideHorizontal(cmp, true);}
|
|
241
|
+
|
|
242
|
+
return slide(cmp);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function slide(_ref4)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
{let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
|
|
226
254
|
return (el, show) => {
|
|
227
255
|
const inProgress = uikitUtil.Transition.inProgress(el);
|
|
228
|
-
const inner =
|
|
256
|
+
const inner =
|
|
257
|
+
!inProgress && el.hasChildNodes() ?
|
|
229
258
|
uikitUtil.toFloat(uikitUtil.css(el.firstElementChild, 'marginTop')) +
|
|
230
259
|
uikitUtil.toFloat(uikitUtil.css(el.lastElementChild, 'marginBottom')) :
|
|
231
260
|
0;
|
|
232
|
-
const currentHeight = uikitUtil.isVisible(el) ? uikitUtil.
|
|
261
|
+
const currentHeight = uikitUtil.isVisible(el) ? uikitUtil.toFloat(uikitUtil.css(el, 'height')) + inner : 0;
|
|
262
|
+
|
|
263
|
+
const props = inProgress ? uikitUtil.css(el, Object.keys(initProps)) : show ? hideProps : initProps;
|
|
233
264
|
|
|
234
265
|
uikitUtil.Transition.cancel(el);
|
|
235
266
|
|
|
@@ -237,32 +268,97 @@
|
|
|
237
268
|
_toggle(el, true);
|
|
238
269
|
}
|
|
239
270
|
|
|
240
|
-
uikitUtil.
|
|
271
|
+
uikitUtil.css(el, 'maxHeight', '');
|
|
241
272
|
|
|
242
273
|
// Update child components first
|
|
243
274
|
uikitUtil.fastdom.flush();
|
|
244
275
|
|
|
245
|
-
const endHeight = uikitUtil.
|
|
246
|
-
|
|
276
|
+
const endHeight = uikitUtil.toFloat(uikitUtil.css(el, 'height')) + inner;
|
|
277
|
+
duration = velocity * endHeight + duration;
|
|
278
|
+
|
|
279
|
+
uikitUtil.css(el, { ...props, maxHeight: currentHeight });
|
|
247
280
|
|
|
248
281
|
return (
|
|
249
282
|
show ?
|
|
250
283
|
uikitUtil.Transition.start(
|
|
251
284
|
el,
|
|
252
|
-
{ ...initProps, overflow: 'hidden',
|
|
253
|
-
|
|
285
|
+
{ ...initProps, overflow: 'hidden', maxHeight: endHeight },
|
|
286
|
+
duration * (1 - currentHeight / endHeight),
|
|
254
287
|
transition) :
|
|
255
288
|
|
|
256
289
|
uikitUtil.Transition.start(
|
|
257
290
|
el,
|
|
258
291
|
hideProps,
|
|
259
|
-
|
|
292
|
+
duration * (currentHeight / endHeight),
|
|
260
293
|
transition).
|
|
261
294
|
then(() => _toggle(el, false))).
|
|
262
295
|
then(() => uikitUtil.css(el, initProps));
|
|
263
296
|
};
|
|
264
297
|
}
|
|
265
298
|
|
|
299
|
+
function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
|
|
300
|
+
return (el, show) => {
|
|
301
|
+
const visible = uikitUtil.isVisible(el);
|
|
302
|
+
const marginLeft = uikitUtil.toFloat(uikitUtil.css(el, 'marginLeft'));
|
|
303
|
+
|
|
304
|
+
uikitUtil.Transition.cancel(el);
|
|
305
|
+
|
|
306
|
+
const [scrollElement] = uikitUtil.scrollParents(el);
|
|
307
|
+
uikitUtil.css(scrollElement, 'overflowX', 'hidden');
|
|
308
|
+
|
|
309
|
+
if (!isToggled(el)) {
|
|
310
|
+
_toggle(el, true);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const width = uikitUtil.toFloat(uikitUtil.css(el, 'width'));
|
|
314
|
+
duration = velocity * width + duration;
|
|
315
|
+
|
|
316
|
+
const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
|
|
317
|
+
const offsetEl = uikitUtil.offset(el);
|
|
318
|
+
const useClipPath = right ?
|
|
319
|
+
offsetEl.right < scrollElement.clientWidth :
|
|
320
|
+
Math.round(offsetEl.left) > 0;
|
|
321
|
+
|
|
322
|
+
uikitUtil.css(el, {
|
|
323
|
+
clipPath: useClipPath ?
|
|
324
|
+
right ? "polygon(0 0," +
|
|
325
|
+
percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
|
|
326
|
+
100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)" :
|
|
327
|
+
'',
|
|
328
|
+
marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
return (
|
|
332
|
+
show ?
|
|
333
|
+
uikitUtil.Transition.start(
|
|
334
|
+
el,
|
|
335
|
+
{
|
|
336
|
+
clipPath: useClipPath ? "polygon(0 0,100% 0,100% 100%,0 100%)" : '',
|
|
337
|
+
marginLeft: 0 },
|
|
338
|
+
|
|
339
|
+
duration * (1 - percent / 100),
|
|
340
|
+
transition) :
|
|
341
|
+
|
|
342
|
+
uikitUtil.Transition.start(
|
|
343
|
+
el,
|
|
344
|
+
{
|
|
345
|
+
clipPath: useClipPath ?
|
|
346
|
+
right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)" :
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
'',
|
|
350
|
+
marginLeft: (right ? 1 : -1) * width },
|
|
351
|
+
|
|
352
|
+
duration * (percent / 100),
|
|
353
|
+
transition).
|
|
354
|
+
then(() => _toggle(el, false))).
|
|
355
|
+
then(() => {
|
|
356
|
+
uikitUtil.css(scrollElement, 'overflowX', '');
|
|
357
|
+
uikitUtil.css(el, { clipPath: '', marginLeft: '' });
|
|
358
|
+
});
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
|
|
266
362
|
function toggleAnimation(cmp) {
|
|
267
363
|
return (el, show) => {
|
|
268
364
|
uikitUtil.Animation.cancel(el);
|