uikit 3.11.2-dev.9433cd5fd → 3.11.2-dev.a87448e52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +4 -49
- package/.prettierignore +14 -0
- package/.prettierrc.json +13 -0
- package/.webstorm.js +3 -3
- package/CHANGELOG.md +37 -28
- package/build/.eslintrc.json +1 -3
- package/build/build.js +26 -28
- package/build/icons.js +7 -11
- package/build/less.js +48 -36
- package/build/package.json +2 -2
- package/build/prefix.js +21 -18
- package/build/publishDev.js +6 -8
- package/build/release.js +20 -17
- package/build/scope.js +21 -11
- package/build/scss.js +72 -39
- package/build/util.js +71 -62
- package/build/wrapper/icons.js +0 -2
- package/dist/css/uikit-core-rtl.css +118 -201
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +118 -201
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +120 -207
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +120 -207
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +88 -133
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +408 -439
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +1098 -1316
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1144 -1393
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +94 -114
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +345 -358
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +343 -357
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +768 -843
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +343 -357
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +645 -793
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +587 -620
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +324 -356
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +155 -167
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +5412 -6733
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +7 -9
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +8008 -9705
- package/dist/js/uikit.min.js +1 -1
- package/jsconfig.json +1 -1
- package/package.json +64 -60
- package/src/js/api/boot.js +25 -32
- package/src/js/api/component.js +15 -28
- package/src/js/api/global.js +6 -12
- package/src/js/api/hooks.js +14 -33
- package/src/js/api/instance.js +7 -15
- package/src/js/api/state.js +79 -100
- package/src/js/components/countdown.js +24 -50
- package/src/js/components/filter.js +70 -66
- package/src/js/components/index.js +13 -13
- package/src/js/components/internal/lightbox-animations.js +14 -25
- package/src/js/components/internal/slider-preload.js +37 -0
- package/src/js/components/internal/slider-transitioner.js +66 -45
- package/src/js/components/internal/slideshow-animations.js +46 -64
- package/src/js/components/lightbox-panel.js +107 -105
- package/src/js/components/lightbox.js +17 -39
- package/src/js/components/notification.js +49 -43
- package/src/js/components/parallax.js +16 -30
- package/src/js/components/slider-parallax.js +13 -23
- package/src/js/components/slider.js +95 -64
- package/src/js/components/slideshow-parallax.js +1 -1
- package/src/js/components/slideshow.js +15 -13
- package/src/js/components/sortable.js +125 -106
- package/src/js/components/tooltip.js +41 -31
- package/src/js/components/upload.js +52 -63
- package/src/js/core/accordion.js +53 -48
- package/src/js/core/alert.js +9 -17
- package/src/js/core/core.js +74 -53
- package/src/js/core/cover.js +11 -15
- package/src/js/core/drop.js +106 -92
- package/src/js/core/form-custom.js +20 -25
- package/src/js/core/gif.js +3 -7
- package/src/js/core/grid.js +57 -58
- package/src/js/core/height-match.js +16 -29
- package/src/js/core/height-viewport.js +28 -35
- package/src/js/core/icon.js +47 -52
- package/src/js/core/img.js +96 -77
- package/src/js/core/index.js +39 -39
- package/src/js/core/leader.js +9 -18
- package/src/js/core/margin.js +21 -37
- package/src/js/core/modal.js +49 -36
- package/src/js/core/nav.js +2 -4
- package/src/js/core/navbar.js +112 -88
- package/src/js/core/offcanvas.js +49 -53
- package/src/js/core/overflow-auto.js +13 -17
- package/src/js/core/responsive.js +14 -12
- package/src/js/core/scroll.js +10 -20
- package/src/js/core/scrollspy-nav.js +34 -31
- package/src/js/core/scrollspy.js +37 -54
- package/src/js/core/sticky.js +130 -91
- package/src/js/core/svg.js +68 -83
- package/src/js/core/switcher.js +47 -46
- package/src/js/core/tab.js +7 -10
- package/src/js/core/toggle.js +66 -67
- package/src/js/core/video.js +11 -22
- package/src/js/mixin/animate.js +19 -20
- package/src/js/mixin/class.js +2 -4
- package/src/js/mixin/container.js +7 -11
- package/src/js/mixin/internal/animate-fade.js +73 -30
- package/src/js/mixin/internal/animate-slide.js +58 -41
- package/src/js/mixin/internal/slideshow-animations.js +7 -14
- package/src/js/mixin/internal/slideshow-transitioner.js +10 -17
- package/src/js/mixin/media.js +5 -10
- package/src/js/mixin/modal.js +89 -66
- package/src/js/mixin/parallax.js +149 -106
- package/src/js/mixin/position.js +26 -20
- package/src/js/mixin/slider-autoplay.js +12 -21
- package/src/js/mixin/slider-drag.js +64 -65
- package/src/js/mixin/slider-nav.js +26 -35
- package/src/js/mixin/slider-reactive.js +2 -8
- package/src/js/mixin/slider.js +48 -55
- package/src/js/mixin/slideshow.js +13 -19
- package/src/js/mixin/togglable.js +89 -63
- package/src/js/uikit-core.js +2 -4
- package/src/js/uikit.js +2 -4
- package/src/js/util/ajax.js +20 -39
- package/src/js/util/animation.js +77 -75
- package/src/js/util/attr.js +17 -21
- package/src/js/util/class.js +14 -52
- package/src/js/util/dimensions.js +56 -43
- package/src/js/util/dom.js +44 -80
- package/src/js/util/env.js +7 -12
- package/src/js/util/event.js +60 -59
- package/src/js/util/fastdom.js +1 -6
- package/src/js/util/filter.js +17 -34
- package/src/js/util/index.js +0 -1
- package/src/js/util/lang.js +82 -121
- package/src/js/util/mouse.js +19 -17
- package/src/js/util/options.js +32 -46
- package/src/js/util/player.js +41 -36
- package/src/js/util/position.js +54 -46
- package/src/js/util/selector.js +43 -58
- package/src/js/util/style.js +39 -49
- package/src/js/util/viewport.js +75 -64
- package/src/less/components/base.less +10 -33
- package/src/less/components/flex.less +0 -9
- package/src/less/components/form-range.less +48 -95
- package/src/less/components/form.less +0 -1
- package/src/less/components/leader.less +0 -1
- package/src/less/components/lightbox.less +0 -1
- package/src/less/components/modal.less +3 -7
- package/src/less/components/navbar.less +0 -7
- package/src/less/components/progress.less +14 -36
- package/src/less/components/slider.less +0 -3
- package/src/less/components/slideshow.less +0 -3
- package/src/less/components/text.less +16 -32
- package/src/less/components/utility.less +22 -0
- package/src/scss/components/base.scss +10 -33
- package/src/scss/components/flex.scss +0 -9
- package/src/scss/components/form-range.scss +48 -95
- package/src/scss/components/form.scss +3 -4
- package/src/scss/components/icon.scss +2 -2
- package/src/scss/components/leader.scss +0 -1
- package/src/scss/components/lightbox.scss +0 -1
- package/src/scss/components/modal.scss +3 -7
- package/src/scss/components/navbar.scss +0 -7
- package/src/scss/components/progress.scss +14 -36
- package/src/scss/components/search.scss +1 -1
- package/src/scss/components/slider.scss +0 -3
- package/src/scss/components/slideshow.scss +0 -3
- package/src/scss/components/text.scss +16 -32
- package/src/scss/components/utility.scss +22 -0
- package/src/scss/mixins-theme.scss +1 -1
- package/src/scss/mixins.scss +1 -1
- package/src/scss/variables-theme.scss +9 -9
- package/src/scss/variables.scss +9 -9
- package/tests/align.html +10 -10
- package/tests/animation.html +2 -2
- package/tests/article.html +2 -2
- package/tests/base.html +3 -3
- package/tests/card.html +10 -10
- package/tests/column.html +3 -3
- package/tests/comment.html +9 -9
- package/tests/dotnav.html +3 -3
- package/tests/image.html +296 -48
- package/tests/images/image-type.avif +0 -0
- package/tests/images/image-type.jpeg +0 -0
- package/tests/images/image-type.webp +0 -0
- package/tests/index.html +8 -8
- package/tests/js/index.js +114 -85
- package/tests/lightbox.html +10 -10
- package/tests/marker.html +2 -2
- package/tests/modal.html +8 -9
- package/tests/navbar.html +2 -2
- package/tests/overlay.html +7 -7
- package/tests/parallax.html +14 -5
- package/tests/position.html +12 -12
- package/tests/slidenav.html +12 -12
- package/tests/slider.html +20 -20
- package/tests/sortable.html +1 -1
- package/tests/sticky-parallax.html +47 -62
- package/tests/svg.html +6 -6
- package/tests/table.html +11 -11
- package/tests/thumbnav.html +12 -12
- package/tests/transition.html +30 -30
- package/tests/utility.html +33 -33
- package/tests/video.html +1 -1
- package/tests/width.html +1 -1
- package/src/js/mixin/flex-bug.js +0 -56
- package/src/js/util/promise.js +0 -191
- package/tests/images/animated.gif +0 -0
- package/tests/images/test.avif +0 -0
- package/tests/images/test.webp +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.9433cd5fd | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(t,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitlightbox",["uikit-util"],p):(t=typeof globalThis<"u"?globalThis:t||self,t.UIkitLightbox=p(t.UIkit.util))})(this,function(t){"use strict";var p={slide:{show:function(e){return[{transform:$(e*-100)},{transform:$()}]},percent:function(e){return E(e)},translate:function(e,n){return[{transform:$(n*-100*e)},{transform:$(n*100*(1-e))}]}}};function E(e){return Math.abs(t.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function $(e,n){return e===void 0&&(e=0),n===void 0&&(n="%"),e+=e?n:"",t.isIE?"translateX("+e+")":"translate3d("+e+", 0, 0)"}function x(e){return"scale3d("+e+", "+e+", 1)"}var y=t.assign({},p,{fade:{show:function(){return[{opacity:0},{opacity:1}]},percent:function(e){return 1-t.css(e,"opacity")},translate:function(e){return[{opacity:1-e},{opacity:e}]}},scale:{show:function(){return[{opacity:0,transform:x(1-.2)},{opacity:1,transform:x(1)}]},percent:function(e){return 1-t.css(e,"opacity")},translate:function(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:function(e){var n=e.container;return n===!0&&this.$container||n&&t.$(n)}}},S={connected:function(){!t.hasClass(this.$el,this.$name)&&t.addClass(this.$el,this.$name)}},T={props:{cls:Boolean,animation:"list",duration:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,origin:!1,transition:"linear",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave",initProps:{overflow:"",height:"",paddingTop:"",paddingBottom:"",marginTop:"",marginBottom:""},hideProps:{overflow:"hidden",height:0,paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0}},computed:{hasAnimation:function(e){var n=e.animation;return!!n[0]},hasTransition:function(e){var n=e.animation;return this.hasAnimation&&n[0]===!0}},methods:{toggleElement:function(e,n,s){var r=this;return new t.Promise(function(o){return t.Promise.all(t.toNodes(e).map(function(c){var h=t.isBoolean(n)?n:!r.isToggled(c);if(!t.trigger(c,"before"+(h?"show":"hide"),[r]))return t.Promise.reject();var a=(t.isFunction(s)?s:s===!1||!r.hasAnimation?r._toggle:r.hasTransition?N(r):D(r))(c,h),i=h?r.clsEnter:r.clsLeave;t.addClass(c,i),t.trigger(c,h?"show":"hide",[r]);var u=function(){t.removeClass(c,i),t.trigger(c,h?"shown":"hidden",[r]),r.$update(c)};return a?a.then(u,function(){return t.removeClass(c,i),t.Promise.reject()}):u()})).then(o,t.noop)})},isToggled:function(e){var n;return e===void 0&&(e=this.$el),n=t.toNodes(e),e=n[0],t.hasClass(e,this.clsEnter)?!0:t.hasClass(e,this.clsLeave)?!1:this.cls?t.hasClass(e,this.cls.split(" ")[0]):t.isVisible(e)},_toggle:function(e,n){if(!!e){n=Boolean(n);var s;this.cls?(s=t.includes(this.cls," ")||n!==t.hasClass(e,this.cls),s&&t.toggleClass(e,this.cls,t.includes(this.cls," ")?void 0:n)):(s=n===e.hidden,s&&(e.hidden=!n)),t.$$("[autofocus]",e).some(function(r){return t.isVisible(r)?r.focus()||!0:r.blur()}),s&&(t.trigger(e,"toggled",[n,this]),this.$update(e))}}}};function N(e){var n=e.isToggled,s=e.duration,r=e.initProps,o=e.hideProps,c=e.transition,h=e._toggle;return function(a,i){var u=t.Transition.inProgress(a),l=a.hasChildNodes?t.toFloat(t.css(a.firstElementChild,"marginTop"))+t.toFloat(t.css(a.lastElementChild,"marginBottom")):0,d=t.isVisible(a)?t.height(a)+(u?0:l):0;t.Transition.cancel(a),n(a)||h(a,!0),t.height(a,""),t.fastdom.flush();var f=t.height(a)+(u?0:l);return t.height(a,d),(i?t.Transition.start(a,t.assign({},r,{overflow:"hidden",height:f}),Math.round(s*(1-d/f)),c):t.Transition.start(a,o,Math.round(s*(d/f)),c).then(function(){return h(a,!1)})).then(function(){return t.css(a,r)})}}function D(e){return function(n,s){t.Animation.cancel(n);var r=e.animation,o=e.duration,c=e._toggle;return s?(c(n,!0),t.Animation.in(n,r[0],o,e.origin)):t.Animation.out(n,r[1]||r[0],o,e.origin).then(function(){return c(n,!1)})}}var g=[],B={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:function(e,n){var s=e.selPanel;return t.$(s,n)},transitionElement:function(){return this.panel},bgClose:function(e){var n=e.bgClose;return n&&this.panel}},beforeDisconnect:function(){t.includes(g,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate:function(){return this.selClose},handler:function(e){e.preventDefault(),this.hide()}},{name:"toggle",self:!0,handler:function(e,n){e.defaultPrevented||(e.preventDefault(),this.isToggled()===t.includes(g,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler:function(e){if(t.includes(g,this))return!1;!this.stack&&g.length?(t.Promise.all(g.map(function(n){return n.hide()})).then(this.show),e.preventDefault()):g.push(this)}},{name:"show",self:!0,handler:function(){var e=this,n=document.documentElement;t.width(window)>n.clientWidth&&this.overlay&&t.css(document.body,"overflowY","scroll"),this.stack&&t.css(this.$el,"zIndex",t.toFloat(t.css(this.$el,"zIndex"))+g.length),t.addClass(n,this.clsPage),this.bgClose&&t.once(this.$el,"hide",t.on(document,t.pointerDown,function(s){var r=s.target;t.last(g)!==e||e.overlay&&!t.within(r,e.$el)||t.within(r,e.panel)||t.once(document,t.pointerUp+" "+t.pointerCancel+" scroll",function(o){var c=o.defaultPrevented,h=o.type,a=o.target;!c&&h===t.pointerUp&&r===a&&e.hide()},!0)}),{self:!0}),this.escClose&&t.once(this.$el,"hide",t.on(document,"keydown",function(s){s.keyCode===27&&t.last(g)===e&&e.hide()}),{self:!0})}},{name:"shown",self:!0,handler:function(){t.isFocusable(this.$el)||t.attr(this.$el,"tabindex","-1"),t.$(":focus",this.$el)||this.$el.focus()}},{name:"hidden",self:!0,handler:function(){var e=this;t.includes(g,this)&&g.splice(g.indexOf(this),1),g.length||t.css(document.body,"overflowY",""),t.css(this.$el,"zIndex",""),g.some(function(n){return n.clsPage===e.clsPage})||t.removeClass(document.documentElement,this.clsPage)}}],methods:{toggle:function(){return this.isToggled()?this.hide():this.show()},show:function(){var e=this;return this.container&&t.parent(this.$el)!==this.container?(t.append(this.container,this.$el),new t.Promise(function(n){return requestAnimationFrame(function(){return e.show().then(n)})})):this.toggleElement(this.$el,!0,A(this))},hide:function(){return this.toggleElement(this.$el,!1,A(this))}}};function A(e){var n=e.transitionElement,s=e._toggle;return function(r,o){return new t.Promise(function(c,h){return t.once(r,"show hide",function(){r._reject&&r._reject(),r._reject=h,s(r,o);var a=t.once(n,"transitionstart",function(){t.once(n,"transitionend transitioncancel",c,{self:!0}),clearTimeout(i)},{self:!0}),i=setTimeout(function(){a(),c()},t.toMs(t.css(n,"transitionDuration")))})}).then(function(){return delete r._reject})}}function M(e,n,s,r){var o=r.animation,c=r.easing,h=o.percent,a=o.translate,i=o.show;i===void 0&&(i=t.noop);var u=i(s),l=new t.Deferred;return{dir:s,show:function(d,f,m){var w=this;f===void 0&&(f=0);var v=m?"linear":c;return d-=Math.round(d*t.clamp(f,-1,1)),this.translate(f),I(n,"itemin",{percent:f,duration:d,timing:v,dir:s}),I(e,"itemout",{percent:1-f,duration:d,timing:v,dir:s}),t.Promise.all([t.Transition.start(n,u[1],d,v),t.Transition.start(e,u[0],d,v)]).then(function(){w.reset(),l.resolve()},t.noop),l.promise},cancel:function(){t.Transition.cancel([n,e])},reset:function(){for(var d in u[0])t.css([n,e],d,"")},forward:function(d,f){return f===void 0&&(f=this.percent()),t.Transition.cancel([n,e]),this.show(d,f,!0)},translate:function(d){this.reset();var f=a(d,s);t.css(n,f[1]),t.css(e,f[0]),I(n,"itemtranslatein",{percent:d,dir:s}),I(e,"itemtranslateout",{percent:1-d,dir:s})},percent:function(){return h(e||n,n,s)},getDistance:function(){return e&&e.offsetWidth}}}function I(e,n,s){t.trigger(e,t.createEvent(n,!1,!1,s))}var O={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected:function(){this.autoplay&&this.startAutoplay()},disconnected:function(){this.stopAutoplay()},update:function(){t.attr(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el:function(){return document},filter:function(){return this.autoplay},handler:function(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay:function(){var e=this;this.stopAutoplay(),this.interval=setInterval(function(){return(!e.draggable||!t.$(":focus",e.$el))&&(!e.pauseOnHover||!t.matches(e.$el,":hover"))&&!e.stack.length&&e.show("next")},this.autoplayInterval)},stopAutoplay:function(){this.interval&&clearInterval(this.interval)}}},L={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created:function(){var e=this;["start","move","end"].forEach(function(n){var s=e[n];e[n]=function(r){var o=t.getEventPos(r).x*(t.isRtl?-1:1);e.prevPos=o!==e.pos?e.pos:e.prevPos,e.pos=o,s(r)}})},events:[{name:t.pointerDown,delegate:function(){return this.selSlides},handler:function(e){!this.draggable||!t.isTouch(e)&&j(e.target)||t.closest(e.target,t.selInput)||e.button>0||this.length<2||this.start(e)}},{name:"dragstart",handler:function(e){e.preventDefault()}}],methods:{start:function(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,t.on(document,t.pointerMove,this.move,{passive:!1}),t.on(document,t.pointerUp+" "+t.pointerCancel+" input",this.end,!0),t.css(this.list,"userSelect","none")},move:function(e){var n=this,s=this.pos-this.drag;if(!(s===0||this.prevPos===this.pos||!this.dragging&&Math.abs(s)<this.threshold)){t.css(this.list,"pointerEvents","none"),e.cancelable&&e.preventDefault(),this.dragging=!0,this.dir=s<0?1:-1;for(var r=this,o=r.slides,c=this,h=c.prevIndex,a=Math.abs(s),i=this.getIndex(h+this.dir,h),u=this._getDistance(h,i)||o[h].offsetWidth;i!==h&&a>u;)this.drag-=u*this.dir,h=i,a-=u,i=this.getIndex(h+this.dir,h),u=this._getDistance(h,i)||o[h].offsetWidth;this.percent=a/u;var l=o[h],d=o[i],f=this.index!==i,m=h===i,w;[this.index,this.prevIndex].filter(function(v){return!t.includes([i,h],v)}).forEach(function(v){t.trigger(o[v],"itemhidden",[n]),m&&(w=!0,n.prevIndex=h)}),(this.index===h&&this.prevIndex!==h||w)&&t.trigger(o[this.index],"itemshown",[this]),f&&(this.prevIndex=h,this.index=i,!m&&t.trigger(l,"beforeitemhide",[this]),t.trigger(d,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),l,!m&&d),f&&(!m&&t.trigger(l,"itemhide",[this]),t.trigger(d,"itemshow",[this]))}},end:function(){if(t.off(document,t.pointerMove,this.move,{passive:!1}),t.off(document,t.pointerUp+" "+t.pointerCancel+" input",this.end,!0),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{var e=(t.isRtl?this.dir*(t.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=e?this.index:this.prevIndex,e&&(this.percent=1-this.percent),this.show(this.dir>0&&!e||this.dir<0&&e?"next":"previous",!0)}t.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function j(e){return!e.children.length&&e.childNodes.length}var z={data:{selNav:!1},computed:{nav:function(e,n){var s=e.selNav;return t.$(s,n)},selNavItem:function(e){var n=e.attrItem;return"["+n+"],[data-"+n+"]"},navItems:function(e,n){return t.$$(this.selNavItem,n)}},update:{write:function(){var e=this;this.nav&&this.length!==this.nav.children.length&&t.html(this.nav,this.slides.map(function(n,s){return"<li "+e.attrItem+'="'+s+'"><a href></a></li>'}).join("")),this.navItems.concat(this.nav).forEach(function(n){return n&&(n.hidden=!e.maxIndex)}),this.updateNav()},events:["resize"]},events:[{name:"click",delegate:function(){return this.selNavItem},handler:function(e){e.preventDefault(),this.show(t.data(e.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav:function(){var e=this,n=this.getValidIndex();this.navItems.forEach(function(s){var r=t.data(s,e.attrItem);t.toggleClass(s,e.clsActive,t.toNumber(r)===n),t.toggleClass(s,"uk-invisible",e.finite&&(r==="previous"&&n===0||r==="next"&&n>=e.maxIndex))})}}},H={mixins:[O,L,z],props:{clsActivated:Boolean,easing:String,index:Number,finite:Boolean,velocity:Number,selSlides:String},data:function(){return{easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:!1,Transitioner:!1,transitionOptions:{}}},connected:function(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected:function(){t.removeClass(this.slides,this.clsActive)},computed:{duration:function(e,n){var s=e.velocity;return q(n.offsetWidth/s)},list:function(e,n){var s=e.selList;return t.$(s,n)},maxIndex:function(){return this.length-1},selSlides:function(e){var n=e.selList,s=e.selSlides;return n+" "+(s||"> *")},slides:{get:function(){return t.$$(this.selSlides,this.$el)},watch:function(){this.$reset()}},length:function(){return this.slides.length}},events:{itemshown:function(){this.$update(this.list)}},methods:{show:function(e,n){var s=this;if(n===void 0&&(n=!1),!(this.dragging||!this.length)){var r=this,o=r.stack,c=n?0:o.length,h=function(){o.splice(c,1),o.length&&s.show(o.shift(),!0)};if(o[n?"unshift":"push"](e),!n&&o.length>1){o.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}var a=this.getIndex(this.index),i=t.hasClass(this.slides,this.clsActive)&&this.slides[a],u=this.getIndex(e,this.index),l=this.slides[u];if(i===l){h();return}if(this.dir=W(e,a),this.prevIndex=a,this.index=u,i&&!t.trigger(i,"beforeitemhide",[this])||!t.trigger(l,"beforeitemshow",[this,i])){this.index=this.prevIndex,h();return}var d=this._show(i,l,n).then(function(){return i&&t.trigger(i,"itemhidden",[s]),t.trigger(l,"itemshown",[s]),new t.Promise(function(f){t.fastdom.write(function(){o.shift(),o.length?s.show(o.shift(),!0):s._transitioner=null,f()})})});return i&&t.trigger(i,"itemhide",[this]),t.trigger(l,"itemshow",[this]),d}},getIndex:function(e,n){return e===void 0&&(e=this.index),n===void 0&&(n=this.index),t.clamp(t.getIndex(e,this.slides,n,this.finite),0,this.maxIndex)},getValidIndex:function(e,n){return e===void 0&&(e=this.index),n===void 0&&(n=this.prevIndex),this.getIndex(e,n)},_show:function(e,n,s){if(this._transitioner=this._getTransitioner(e,n,this.dir,t.assign({easing:s?n.offsetWidth<600?"cubic-bezier(0.25, 0.46, 0.45, 0.94)":"cubic-bezier(0.165, 0.84, 0.44, 1)":this.easing},this.transitionOptions)),!s&&!e)return this._translate(1),t.Promise.resolve();var r=this.stack,o=r.length;return this._transitioner[o>1?"forward":"show"](o>1?Math.min(this.duration,75+75/(o-1)):this.duration,this.percent)},_getDistance:function(e,n){return this._getTransitioner(e,e!==n&&n).getDistance()},_translate:function(e,n,s){n===void 0&&(n=this.prevIndex),s===void 0&&(s=this.index);var r=this._getTransitioner(n!==s?n:!1,s);return r.translate(e),r},_getTransitioner:function(e,n,s,r){return e===void 0&&(e=this.prevIndex),n===void 0&&(n=this.index),s===void 0&&(s=this.dir||1),r===void 0&&(r=this.transitionOptions),new this.Transitioner(t.isNumber(e)?this.slides[e]:e,t.isNumber(n)?this.slides[n]:n,s*(t.isRtl?-1:1),r)}}};function W(e,n){return e==="next"?1:e==="previous"||e<n?-1:1}function q(e){return .5*e+300}var F={mixins:[H],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:p,Transitioner:M},computed:{animation:function(e){var n=e.animation,s=e.Animations;return t.assign(s[n]||s.slide,{name:n})},transitionOptions:function(){return{animation:this.animation}}},events:{"itemshow itemhide itemshown itemhidden":function(e){var n=e.target;this.$update(n)},beforeitemshow:function(e){var n=e.target;t.addClass(n,this.clsActive)},itemshown:function(e){var n=e.target;t.addClass(n,this.clsActivated)},itemhidden:function(e){var n=e.target;t.removeClass(n,this.clsActive,this.clsActivated)}}},V={mixins:[C,B,T,F],functional:!0,props:{delayControls:Number,preload:Number,videoAutoplay:Boolean,template:String},data:function(){return{preload:1,videoAutoplay:!1,delayControls:3e3,items:[],cls:"uk-open",clsPage:"uk-lightbox-page",selList:".uk-lightbox-items",attrItem:"uk-lightbox-item",selClose:".uk-close-large",selCaption:".uk-lightbox-caption",pauseOnHover:!1,velocity:2,Animations:y,template:'<div class="uk-lightbox uk-overflow-hidden"> <ul class="uk-lightbox-items"></ul> <div class="uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque"> <button class="uk-lightbox-toolbar-icon uk-close-large" type="button" uk-close></button> </div> <a class="uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade" href uk-slidenav-previous uk-lightbox-item="previous"></a> <a class="uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade" href uk-slidenav-next uk-lightbox-item="next"></a> <div class="uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div> </div>'}},created:function(){var e=t.$(this.template),n=t.$(this.selList,e);this.items.forEach(function(){return t.append(n,"<li>")}),this.$mount(t.append(this.container,e))},computed:{caption:function(e,n){var s=e.selCaption;return t.$(s,n)}},events:[{name:t.pointerMove+" "+t.pointerDown+" keydown",handler:"showControls"},{name:"click",self:!0,delegate:function(){return this.selSlides},handler:function(e){e.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler:function(){this.showControls()}},{name:"hide",self:!0,handler:function(){this.hideControls(),t.removeClass(this.slides,this.clsActive),t.Transition.stop(this.slides)}},{name:"hidden",self:!0,handler:function(){this.$destroy(!0)}},{name:"keyup",el:function(){return document},handler:function(e){if(!(!this.isToggled(this.$el)||!this.draggable))switch(e.keyCode){case 37:this.show("previous");break;case 39:this.show("next");break}}},{name:"beforeitemshow",handler:function(e){this.isToggled()||(this.draggable=!1,e.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=y.scale,t.removeClass(e.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler:function(){t.html(this.caption,this.getItem().caption||"");for(var e=-this.preload;e<=this.preload;e++)this.loadItem(this.index+e)}},{name:"itemshown",handler:function(){this.draggable=this.$props.draggable}},{name:"itemload",handler:function(e,n){var s=this,r=n.source,o=n.type,c=n.alt;c===void 0&&(c="");var h=n.poster,a=n.attrs;if(a===void 0&&(a={}),this.setItem(n,"<span uk-spinner></span>"),!!r){var i,u={frameborder:"0",allow:"autoplay",allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":""+this.videoAutoplay};if(o==="image"||r.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i))t.getImage(r,a.srcset,a.size).then(function(d){var f=d.width,m=d.height;return s.setItem(n,b("img",t.assign({src:r,width:f,height:m,alt:c},a)))},function(){return s.setError(n)});else if(o==="video"||r.match(/\.(mp4|webm|ogv)($|\?)/i)){var l=b("video",t.assign({src:r,poster:h,controls:"",playsinline:"","uk-video":""+this.videoAutoplay},a));t.on(l,"loadedmetadata",function(){t.attr(l,{width:l.videoWidth,height:l.videoHeight}),s.setItem(n,l)}),t.on(l,"error",function(){return s.setError(n)})}else o==="iframe"||r.match(/\.(html|php)($|\?)/i)?this.setItem(n,b("iframe",t.assign({src:r,frameborder:"0",allowfullscreen:"",class:"uk-lightbox-iframe"},a))):(i=r.match(/\/\/(?:.*?youtube(-nocookie)?\..*?[?&]v=|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))?this.setItem(n,b("iframe",t.assign({src:"https://www.youtube"+(i[1]||"")+".com/embed/"+i[2]+(i[3]?"?"+i[3]:""),width:1920,height:1080},u,a))):(i=r.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))&&t.ajax("https://vimeo.com/api/oembed.json?maxwidth=1920&url="+encodeURI(r),{responseType:"json",withCredentials:!1}).then(function(d){var f=d.response,m=f.height,w=f.width;return s.setItem(n,b("iframe",t.assign({src:"https://player.vimeo.com/video/"+i[1]+(i[2]?"?"+i[2]:""),width:w,height:m},u,a)))},function(){return s.setError(n)})}}}],methods:{loadItem:function(e){e===void 0&&(e=this.index);var n=this.getItem(e);this.getSlide(n).childElementCount||t.trigger(this.$el,"itemload",[n])},getItem:function(e){return e===void 0&&(e=this.index),this.items[t.getIndex(e,this.slides)]},setItem:function(e,n){t.trigger(this.$el,"itemloaded",[this,t.html(this.getSlide(e),n)])},getSlide:function(e){return this.slides[this.items.indexOf(e)]},setError:function(e){this.setItem(e,'<span uk-icon="icon: bolt; ratio: 2"></span>')},showControls:function(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),t.addClass(this.$el,"uk-active","uk-transition-active")},hideControls:function(){t.removeClass(this.$el,"uk-active","uk-transition-active")}}};function b(e,n){var s=t.fragment("<"+e+">");return t.attr(s,n),s}var P={install:R,props:{toggle:String},data:{toggle:"a"},computed:{toggles:{get:function(e,n){var s=e.toggle;return t.$$(s,n)},watch:function(){this.hide()}}},disconnected:function(){this.hide()},events:[{name:"click",delegate:function(){return this.toggle+":not(.uk-disabled)"},handler:function(e){e.preventDefault(),this.show(e.current)}}],methods:{show:function(e){var n=this,s=t.uniqueBy(this.toggles.map(_),"source");if(t.isElement(e)){var r=_(e),o=r.source;e=t.findIndex(s,function(c){var h=c.source;return o===h})}return this.panel=this.panel||this.$create("lightboxPanel",t.assign({},this.$props,{items:s})),t.on(this.panel.$el,"hidden",function(){return n.panel=!1}),this.panel.show(e)},hide:function(){return this.panel&&this.panel.hide()}}};function R(e,n){e.lightboxPanel||e.component("lightboxPanel",V),t.assign(n.props,e.component("lightboxPanel").options.props)}function _(e){var n={};return["href","caption","type","poster","alt","attrs"].forEach(function(s){n[s==="href"?"source":s]=t.data(e,s)}),n.attrs=t.parseOptions(n.attrs),n}return typeof window<"u"&&window.UIkit&&window.UIkit.component("lightbox",P),P});
|
|
1
|
+
/*! UIkit 3.11.2-dev.a87448e52 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(t,f){typeof exports=="object"&&typeof module<"u"?module.exports=f(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitlightbox",["uikit-util"],f):(t=typeof globalThis<"u"?globalThis:t||self,t.UIkitLightbox=f(t.UIkit.util))})(this,function(t){"use strict";var f={slide:{show(e){return[{transform:v(e*-100)},{transform:v()}]},percent(e){return P(e)},translate(e,s){return[{transform:v(s*-100*e)},{transform:v(s*100*(1-e))}]}}};function P(e){return Math.abs(t.css(e,"transform").split(",")[4]/e.offsetWidth)||0}function v(e,s){return e===void 0&&(e=0),s===void 0&&(s="%"),e+=e?s:"","translate3d("+e+", 0, 0)"}function w(e){return"scale3d("+e+", "+e+", 1)"}var I={...f,fade:{show(){return[{opacity:0},{opacity:1}]},percent(e){return 1-t.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-t.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:s}=e;return s===!0&&this.$container||s&&t.$(s)}}},_={connected(){!t.hasClass(this.$el,this.$name)&&t.addClass(this.$el,this.$name)}},$={props:{cls:Boolean,animation:"list",duration:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,origin:!1,transition:"linear",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave",initProps:{overflow:"",height:"",paddingTop:"",paddingBottom:"",marginTop:"",marginBottom:""},hideProps:{overflow:"hidden",height:0,paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0}},computed:{hasAnimation(e){let{animation:s}=e;return!!s[0]},hasTransition(e){let{animation:s}=e;return this.hasAnimation&&s[0]===!0}},methods:{toggleElement(e,s,n){return new Promise(o=>Promise.all(t.toNodes(e).map(h=>{const a=t.isBoolean(s)?s:!this.isToggled(h);if(!t.trigger(h,"before"+(a?"show":"hide"),[this]))return Promise.reject();const i=(t.isFunction(n)?n:n===!1||!this.hasAnimation?this._toggle:this.hasTransition?E(this):S(this))(h,a),r=a?this.clsEnter:this.clsLeave;t.addClass(h,r),t.trigger(h,a?"show":"hide",[this]);const l=()=>{t.removeClass(h,r),t.trigger(h,a?"shown":"hidden",[this]),this.$update(h)};return i?i.then(l,()=>(t.removeClass(h,r),Promise.reject())):l()})).then(o,t.noop))},isToggled(e){return e===void 0&&(e=this.$el),[e]=t.toNodes(e),t.hasClass(e,this.clsEnter)?!0:t.hasClass(e,this.clsLeave)?!1:this.cls?t.hasClass(e,this.cls.split(" ")[0]):t.isVisible(e)},_toggle(e,s){if(!e)return;s=Boolean(s);let n;this.cls?(n=t.includes(this.cls," ")||s!==t.hasClass(e,this.cls),n&&t.toggleClass(e,this.cls,t.includes(this.cls," ")?void 0:s)):(n=s===e.hidden,n&&(e.hidden=!s)),t.$$("[autofocus]",e).some(o=>t.isVisible(o)?o.focus()||!0:o.blur()),n&&(t.trigger(e,"toggled",[s,this]),this.$update(e))}}};function E(e){let{isToggled:s,duration:n,initProps:o,hideProps:h,transition:a,_toggle:i}=e;return(r,l)=>{const d=t.Transition.inProgress(r),m=r.hasChildNodes?t.toFloat(t.css(r.firstElementChild,"marginTop"))+t.toFloat(t.css(r.lastElementChild,"marginBottom")):0,c=t.isVisible(r)?t.height(r)+(d?0:m):0;t.Transition.cancel(r),s(r)||i(r,!0),t.height(r,""),t.fastdom.flush();const g=t.height(r)+(d?0:m);return t.height(r,c),(l?t.Transition.start(r,{...o,overflow:"hidden",height:g},Math.round(n*(1-c/g)),a):t.Transition.start(r,h,Math.round(n*(c/g)),a).then(()=>i(r,!1))).then(()=>t.css(r,o))}}function S(e){return(s,n)=>{t.Animation.cancel(s);const{animation:o,duration:h,_toggle:a}=e;return n?(a(s,!0),t.Animation.in(s,o[0],h,e.origin)):t.Animation.out(s,o[1]||o[0],h,e.origin).then(()=>a(s,!1))}}const p=[];var N={mixins:[_,y,$],props:{selPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean},data:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1},computed:{panel(e,s){let{selPanel:n}=e;return t.$(n,s)},transitionElement(){return this.panel},bgClose(e){let{bgClose:s}=e;return s&&this.panel}},beforeDisconnect(){t.includes(p,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()===t.includes(p,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(e){if(t.includes(p,this))return!1;!this.stack&&p.length?(Promise.all(p.map(s=>s.hide())).then(this.show),e.preventDefault()):p.push(this)}},{name:"show",self:!0,handler(){const e=document.documentElement;t.width(window)>e.clientWidth&&this.overlay&&t.css(document.body,"overflowY","scroll"),this.stack&&t.css(this.$el,"zIndex",t.toFloat(t.css(this.$el,"zIndex"))+p.length),t.addClass(e,this.clsPage),this.bgClose&&t.once(this.$el,"hide",t.on(document,t.pointerDown,s=>{let{target:n}=s;t.last(p)!==this||this.overlay&&!t.within(n,this.$el)||t.within(n,this.panel)||t.once(document,t.pointerUp+" "+t.pointerCancel+" scroll",o=>{let{defaultPrevented:h,type:a,target:i}=o;!h&&a===t.pointerUp&&n===i&&this.hide()},!0)}),{self:!0}),this.escClose&&t.once(this.$el,"hide",t.on(document,"keydown",s=>{s.keyCode===27&&t.last(p)===this&&this.hide()}),{self:!0})}},{name:"shown",self:!0,handler(){t.isFocusable(this.$el)||t.attr(this.$el,"tabindex","-1"),t.$(":focus",this.$el)||this.$el.focus()}},{name:"hidden",self:!0,handler(){t.includes(p,this)&&p.splice(p.indexOf(this),1),p.length||t.css(document.body,"overflowY",""),t.css(this.$el,"zIndex",""),p.some(e=>e.clsPage===this.clsPage)||t.removeClass(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&t.parent(this.$el)!==this.container?(t.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:s,_toggle:n}=e;return(o,h)=>new Promise((a,i)=>t.once(o,"show hide",()=>{o._reject&&o._reject(),o._reject=i,n(o,h);const r=t.once(s,"transitionstart",()=>{t.once(s,"transitionend transitioncancel",a,{self:!0}),clearTimeout(l)},{self:!0}),l=setTimeout(()=>{r(),a()},t.toMs(t.css(s,"transitionDuration")))})).then(()=>delete o._reject)}function D(e,s,n,o){let{animation:h,easing:a}=o;const{percent:i,translate:r,show:l=t.noop}=h,d=l(n),m=new t.Deferred;return{dir:n,show(c,g,V){g===void 0&&(g=0);const x=V?"linear":a;return c-=Math.round(c*t.clamp(g,-1,1)),this.translate(g),b(s,"itemin",{percent:g,duration:c,timing:x,dir:n}),b(e,"itemout",{percent:1-g,duration:c,timing:x,dir:n}),Promise.all([t.Transition.start(s,d[1],c,x),t.Transition.start(e,d[0],c,x)]).then(()=>{this.reset(),m.resolve()},t.noop),m.promise},cancel(){t.Transition.cancel([s,e])},reset(){for(const c in d[0])t.css([s,e],c,"")},forward(c,g){return g===void 0&&(g=this.percent()),t.Transition.cancel([s,e]),this.show(c,g,!0)},translate(c){this.reset();const g=r(c,n);t.css(s,g[1]),t.css(e,g[0]),b(s,"itemtranslatein",{percent:c,dir:n}),b(e,"itemtranslateout",{percent:1-c,dir:n})},percent(){return i(e||s,s,n)},getDistance(){return e==null?void 0:e.offsetWidth}}}function b(e,s,n){t.trigger(e,t.createEvent(s,!1,!1,n))}var B={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){t.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||!t.$(":focus",this.$el))&&(!this.pauseOnHover||!t.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 s=this[e];this[e]=n=>{const o=t.getEventPos(n).x*(t.isRtl?-1:1);this.prevPos=o===this.pos?this.prevPos:this.pos,this.pos=o,s(n)}}},events:[{name:t.pointerDown,delegate(){return this.selSlides},handler(e){!this.draggable||!t.isTouch(e)&&j(e.target)||t.closest(e.target,t.selInput)||e.button>0||this.length<2||this.start(e)}},{name:"dragstart",handler(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,t.on(document,t.pointerMove,this.move,{passive:!1}),t.on(document,t.pointerUp+" "+t.pointerCancel+" input",this.end,!0),t.css(this.list,"userSelect","none")},move(e){const s=this.pos-this.drag;if(s===0||this.prevPos===this.pos||!this.dragging&&Math.abs(s)<this.threshold)return;t.css(this.list,"pointerEvents","none"),e.cancelable&&e.preventDefault(),this.dragging=!0,this.dir=s<0?1:-1;const{slides:n}=this;let{prevIndex:o}=this,h=Math.abs(s),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=>!t.includes([a,o],g)).forEach(g=>{t.trigger(n[g],"itemhidden",[this]),m&&(c=!0,this.prevIndex=o)}),(this.index===o&&this.prevIndex!==o||c)&&t.trigger(n[this.index],"itemshown",[this]),d&&(this.prevIndex=o,this.index=a,!m&&t.trigger(r,"beforeitemhide",[this]),t.trigger(l,"beforeitemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),r,!m&&l),d&&(!m&&t.trigger(r,"itemhide",[this]),t.trigger(l,"itemshow",[this]))},end(){if(t.off(document,t.pointerMove,this.move,{passive:!1}),t.off(document,t.pointerUp+" "+t.pointerCancel+" input",this.end,!0),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{const e=(t.isRtl?this.dir*(t.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=e?this.index:this.prevIndex,e&&(this.percent=1-this.percent),this.show(this.dir>0&&!e||this.dir<0&&e?"next":"previous",!0)}t.css(this.list,{userSelect:"",pointerEvents:""}),this.drag=this.percent=null}}};function j(e){return!e.children.length&&e.childNodes.length}var O={data:{selNav:!1},computed:{nav(e,s){let{selNav:n}=e;return t.$(n,s)},selNavItem(e){let{attrItem:s}=e;return"["+s+"],[data-"+s+"]"},navItems(e,s){return t.$$(this.selNavItem,s)}},update:{write(){this.nav&&this.length!==this.nav.children.length&&t.html(this.nav,this.slides.map((e,s)=>"<li "+this.attrItem+'="'+s+'"><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(t.data(e.current,this.attrItem))}},{name:"itemshow",handler:"updateNav"}],methods:{updateNav(){const e=this.getValidIndex();for(const s of this.navItems){const n=t.data(s,this.attrItem);t.toggleClass(s,this.clsActive,t.toNumber(n)===e),t.toggleClass(s,"uk-invisible",this.finite&&(n==="previous"&&e===0||n==="next"&&e>=this.maxIndex))}}}},z={mixins:[B,M,O],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(){t.removeClass(this.slides,this.clsActive)},computed:{duration(e,s){let{velocity:n}=e;return H(s.offsetWidth/n)},list(e,s){let{selList:n}=e;return t.$(n,s)},maxIndex(){return this.length-1},selSlides(e){let{selList:s,selSlides:n}=e;return s+" "+(n||"> *")},slides:{get(){return t.$$(this.selSlides,this.$el)},watch(){this.$reset()}},length(){return this.slides.length}},events:{itemshown(){this.$update(this.list)}},methods:{show(e,s){if(s===void 0&&(s=!1),this.dragging||!this.length)return;const{stack:n}=this,o=s?0:n.length,h=()=>{n.splice(o,1),n.length&&this.show(n.shift(),!0)};if(n[s?"unshift":"push"](e),!s&&n.length>1){n.length===2&&this._transitioner.forward(Math.min(this.duration,200));return}const a=this.getIndex(this.index),i=t.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=L(e,a),this.prevIndex=a,this.index=r,i&&!t.trigger(i,"beforeitemhide",[this])||!t.trigger(l,"beforeitemshow",[this,i])){this.index=this.prevIndex,h();return}const d=this._show(i,l,s).then(()=>(i&&t.trigger(i,"itemhidden",[this]),t.trigger(l,"itemshown",[this]),new Promise(m=>{t.fastdom.write(()=>{n.shift(),n.length?this.show(n.shift(),!0):this._transitioner=null,m()})})));return i&&t.trigger(i,"itemhide",[this]),t.trigger(l,"itemshow",[this]),d},getIndex(e,s){return e===void 0&&(e=this.index),s===void 0&&(s=this.index),t.clamp(t.getIndex(e,this.slides,s,this.finite),0,this.maxIndex)},getValidIndex(e,s){return e===void 0&&(e=this.index),s===void 0&&(s=this.prevIndex),this.getIndex(e,s)},_show(e,s,n){if(this._transitioner=this._getTransitioner(e,s,this.dir,{easing:n?s.offsetWidth<600?"cubic-bezier(0.25, 0.46, 0.45, 0.94)":"cubic-bezier(0.165, 0.84, 0.44, 1)":this.easing,...this.transitionOptions}),!n&&!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,s){return this._getTransitioner(e,e!==s&&s).getDistance()},_translate(e,s,n){s===void 0&&(s=this.prevIndex),n===void 0&&(n=this.index);const o=this._getTransitioner(s!==n?s:!1,n);return o.translate(e),o},_getTransitioner(e,s,n,o){return e===void 0&&(e=this.prevIndex),s===void 0&&(s=this.index),n===void 0&&(n=this.dir||1),o===void 0&&(o=this.transitionOptions),new this.Transitioner(t.isNumber(e)?this.slides[e]:e,t.isNumber(s)?this.slides[s]:s,n*(t.isRtl?-1:1),o)}}};function L(e,s){return e==="next"?1:e==="previous"||e<s?-1:1}function H(e){return .5*e+300}var W={mixins:[z],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:f,Transitioner:D},computed:{animation(e){let{animation:s,Animations:n}=e;return{...n[s]||n.slide,name:s}},transitionOptions(){return{animation:this.animation}}},events:{"itemshow itemhide itemshown itemhidden"(e){let{target:s}=e;this.$update(s)},beforeitemshow(e){let{target:s}=e;t.addClass(s,this.clsActive)},itemshown(e){let{target:s}=e;t.addClass(s,this.clsActivated)},itemhidden(e){let{target:s}=e;t.removeClass(s,this.clsActive,this.clsActivated)}}},q={mixins:[y,N,$,W],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=t.$(this.template),s=t.$(this.selList,e);this.items.forEach(()=>t.append(s,"<li>")),this.$mount(t.append(this.container,e))},computed:{caption(e,s){let{selCaption:n}=e;return t.$(n,s)}},events:[{name:t.pointerMove+" "+t.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(),t.removeClass(this.slides,this.clsActive),t.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,t.removeClass(e.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){t.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,s){const{source:n,type:o,alt:h="",poster:a,attrs:i={}}=s;if(this.setItem(s,"<span uk-spinner></span>"),!n)return;let r;const l={frameborder:"0",allow:"autoplay",allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":""+this.videoAutoplay};if(o==="image"||n.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i))try{const{width:d,height:m}=await t.getImage(n,i.srcset,i.size);this.setItem(s,u("img",{src:n,width:d,height:m,alt:h,...i}))}catch{this.setError(s)}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});t.on(d,"loadedmetadata",()=>{t.attr(d,{width:d.videoWidth,height:d.videoHeight}),this.setItem(s,d)}),t.on(d,"error",()=>this.setError(s))}else if(o==="iframe"||n.match(/\.(html|php)($|\?)/i))this.setItem(s,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(s,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(s,u("iframe",{src:"https://player.vimeo.com/video/"+r[1]+(r[2]?"?"+r[2]:""),width:m,height:d,...l,...i}))}catch{this.setError(s)}}}],methods:{loadItem(e){e===void 0&&(e=this.index);const s=this.getItem(e);this.getSlide(s).childElementCount||t.trigger(this.$el,"itemload",[s])},getItem(e){return e===void 0&&(e=this.index),this.items[t.getIndex(e,this.slides)]},setItem(e,s){t.trigger(this.$el,"itemloaded",[this,t.html(this.getSlide(e),s)])},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),t.addClass(this.$el,"uk-active","uk-transition-active")},hideControls(){t.removeClass(this.$el,"uk-active","uk-transition-active")}}};function u(e,s){const n=t.fragment("<"+e+">");return t.attr(n,s),n}var T={install:F,props:{toggle:String},data:{toggle:"a"},computed:{toggles:{get(e,s){let{toggle:n}=e;return t.$$(n,s)},watch(){this.hide()}}},disconnected(){this.hide()},events:[{name:"click",delegate(){return this.toggle+":not(.uk-disabled)"},handler(e){e.preventDefault(),this.show(e.current)}}],methods:{show(e){const s=t.uniqueBy(this.toggles.map(A),"source");if(t.isElement(e)){const{source:n}=A(e);e=t.findIndex(s,o=>{let{source:h}=o;return n===h})}return this.panel=this.panel||this.$create("lightboxPanel",{...this.$props,items:s}),t.on(this.panel.$el,"hidden",()=>this.panel=!1),this.panel.show(e)},hide(){return this.panel&&this.panel.hide()}}};function F(e,s){e.lightboxPanel||e.component("lightboxPanel",q),t.assign(s.props,e.component("lightboxPanel").options.props)}function A(e){const s={};for(const n of["href","caption","type","poster","alt","attrs"])s[n==="href"?"source":n]=t.data(e,n);return s.attrs=t.parseOptions(s.attrs),s}return typeof window<"u"&&window.UIkit&&window.UIkit.component("lightbox",T),T});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.a87448e52 | 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')) :
|
|
@@ -7,160 +7,140 @@
|
|
|
7
7
|
})(this, (function (uikitUtil) { 'use strict';
|
|
8
8
|
|
|
9
9
|
var Container = {
|
|
10
|
+
props: {
|
|
11
|
+
container: Boolean },
|
|
10
12
|
|
|
11
|
-
props: {
|
|
12
|
-
container: Boolean
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
data: {
|
|
16
|
-
container: true
|
|
17
|
-
},
|
|
18
13
|
|
|
19
|
-
|
|
14
|
+
data: {
|
|
15
|
+
container: true },
|
|
20
16
|
|
|
21
|
-
container: function(ref) {
|
|
22
|
-
var container = ref.container;
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
18
|
+
computed: {
|
|
19
|
+
container(_ref) {let { container } = _ref;
|
|
20
|
+
return container === true && this.$container || container && uikitUtil.$(container);
|
|
21
|
+
} } };
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
var Component = {
|
|
24
|
+
mixins: [Container],
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
functional: true,
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
args: ['message', 'status'],
|
|
34
29
|
|
|
35
|
-
|
|
30
|
+
data: {
|
|
31
|
+
message: '',
|
|
32
|
+
status: '',
|
|
33
|
+
timeout: 5000,
|
|
34
|
+
group: null,
|
|
35
|
+
pos: 'top-center',
|
|
36
|
+
clsContainer: 'uk-notification',
|
|
37
|
+
clsClose: 'uk-notification-close',
|
|
38
|
+
clsMsg: 'uk-notification-message' },
|
|
36
39
|
|
|
37
|
-
functional: true,
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
install,
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
timeout: 5000,
|
|
45
|
-
group: null,
|
|
46
|
-
pos: 'top-center',
|
|
47
|
-
clsContainer: 'uk-notification',
|
|
48
|
-
clsClose: 'uk-notification-close',
|
|
49
|
-
clsMsg: 'uk-notification-message'
|
|
43
|
+
computed: {
|
|
44
|
+
marginProp(_ref) {let { pos } = _ref;
|
|
45
|
+
return "margin" + (uikitUtil.startsWith(pos, 'top') ? 'Top' : 'Bottom');
|
|
50
46
|
},
|
|
51
47
|
|
|
52
|
-
|
|
48
|
+
startProps() {
|
|
49
|
+
return { opacity: 0, [this.marginProp]: -this.$el.offsetHeight };
|
|
50
|
+
} },
|
|
53
51
|
|
|
54
|
-
computed: {
|
|
55
52
|
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
created() {
|
|
54
|
+
const container =
|
|
55
|
+
uikitUtil.$("." + this.clsContainer + "-" + this.pos, this.container) ||
|
|
56
|
+
uikitUtil.append(
|
|
57
|
+
this.container, "<div class=\"" +
|
|
58
|
+
this.clsContainer + " " + this.clsContainer + "-" + this.pos + "\" style=\"display: block\"></div>");
|
|
58
59
|
|
|
59
|
-
return ("margin" + (uikitUtil.startsWith(pos, 'top') ? 'Top' : 'Bottom'));
|
|
60
|
-
},
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
this.$mount(
|
|
62
|
+
uikitUtil.append(
|
|
63
|
+
container, "<div class=\"" +
|
|
64
|
+
this.clsMsg + (this.status ? " " + this.clsMsg + "-" + this.status : '') + "\"> <a href class=\"" +
|
|
65
|
+
this.clsClose + "\" data-uk-close></a> <div>" +
|
|
66
|
+
this.message + "</div> </div>"));
|
|
64
67
|
|
|
65
|
-
return ( obj = {opacity: 0}, obj[this.marginProp] = -this.$el.offsetHeight, obj );
|
|
66
|
-
}
|
|
67
68
|
|
|
68
|
-
},
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
},
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
async connected() {
|
|
73
|
+
const margin = uikitUtil.toFloat(uikitUtil.css(this.$el, this.marginProp));
|
|
74
|
+
await uikitUtil.Transition.start(uikitUtil.css(this.$el, this.startProps), {
|
|
75
|
+
opacity: 1,
|
|
76
|
+
[this.marginProp]: margin });
|
|
74
77
|
|
|
75
|
-
this.$mount(uikitUtil.append(container,
|
|
76
|
-
("<div class=\"" + (this.clsMsg) + (this.status ? (" " + (this.clsMsg) + "-" + (this.status)) : '') + "\"> <a href class=\"" + (this.clsClose) + "\" data-uk-close></a> <div>" + (this.message) + "</div> </div>")
|
|
77
|
-
));
|
|
78
78
|
|
|
79
|
+
if (this.timeout) {
|
|
80
|
+
this.timer = setTimeout(this.close, this.timeout);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
events: {
|
|
85
|
+
click(e) {
|
|
86
|
+
if (uikitUtil.closest(e.target, 'a[href="#"],a[href=""]')) {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
}
|
|
89
|
+
this.close();
|
|
79
90
|
},
|
|
80
91
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
var margin = uikitUtil.toFloat(uikitUtil.css(this.$el, this.marginProp));
|
|
87
|
-
uikitUtil.Transition.start(
|
|
88
|
-
uikitUtil.css(this.$el, this.startProps),
|
|
89
|
-
( obj = {opacity: 1}, obj[this.marginProp] = margin, obj )
|
|
90
|
-
).then(function () {
|
|
91
|
-
if (this$1$1.timeout) {
|
|
92
|
-
this$1$1.timer = setTimeout(this$1$1.close, this$1$1.timeout);
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
|
|
92
|
+
[uikitUtil.pointerEnter]() {
|
|
93
|
+
if (this.timer) {
|
|
94
|
+
clearTimeout(this.timer);
|
|
95
|
+
}
|
|
96
96
|
},
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
this.close();
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
}, obj[uikitUtil.pointerEnter] = function () {
|
|
108
|
-
if (this.timer) {
|
|
109
|
-
clearTimeout(this.timer);
|
|
110
|
-
}
|
|
111
|
-
}, obj[uikitUtil.pointerLeave] = function () {
|
|
112
|
-
if (this.timeout) {
|
|
113
|
-
this.timer = setTimeout(this.close, this.timeout);
|
|
114
|
-
}
|
|
115
|
-
}, obj ),
|
|
116
|
-
|
|
117
|
-
methods: {
|
|
98
|
+
[uikitUtil.pointerLeave]() {
|
|
99
|
+
if (this.timeout) {
|
|
100
|
+
this.timer = setTimeout(this.close, this.timeout);
|
|
101
|
+
}
|
|
102
|
+
} },
|
|
118
103
|
|
|
119
|
-
close: function(immediate) {
|
|
120
|
-
var this$1$1 = this;
|
|
121
104
|
|
|
105
|
+
methods: {
|
|
106
|
+
async close(immediate) {
|
|
107
|
+
const removeFn = (el) => {
|
|
108
|
+
const container = uikitUtil.parent(el);
|
|
122
109
|
|
|
123
|
-
|
|
110
|
+
uikitUtil.trigger(el, 'close', [this]);
|
|
111
|
+
uikitUtil.remove(el);
|
|
124
112
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
113
|
+
if (!(container != null && container.hasChildNodes())) {
|
|
114
|
+
uikitUtil.remove(container);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
129
117
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
118
|
+
if (this.timer) {
|
|
119
|
+
clearTimeout(this.timer);
|
|
120
|
+
}
|
|
133
121
|
|
|
134
|
-
|
|
122
|
+
if (!immediate) {
|
|
123
|
+
await uikitUtil.Transition.start(this.$el, this.startProps);
|
|
124
|
+
}
|
|
135
125
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
126
|
+
removeFn(this.$el);
|
|
127
|
+
} } };
|
|
139
128
|
|
|
140
|
-
if (immediate) {
|
|
141
|
-
removeFn(this.$el);
|
|
142
|
-
} else {
|
|
143
|
-
uikitUtil.Transition.start(this.$el, this.startProps).then(removeFn);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
}
|
|
148
129
|
|
|
149
|
-
};
|
|
150
130
|
|
|
151
131
|
function install(UIkit) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
132
|
+
UIkit.notification.closeAll = function (group, immediate) {
|
|
133
|
+
uikitUtil.apply(document.body, (el) => {
|
|
134
|
+
const notification = UIkit.getComponent(el, 'notification');
|
|
135
|
+
if (notification && (!group || group === notification.group)) {
|
|
136
|
+
notification.close(immediate);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
};
|
|
160
140
|
}
|
|
161
141
|
|
|
162
142
|
if (typeof window !== 'undefined' && window.UIkit) {
|
|
163
|
-
|
|
143
|
+
window.UIkit.component('notification', Component);
|
|
164
144
|
}
|
|
165
145
|
|
|
166
146
|
return Component;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.a87448e52 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(t,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitnotification",["uikit-util"],o):(t=typeof globalThis<"u"?globalThis:t||self,t.UIkitNotification=o(t.UIkit.util))})(this,function(t){"use strict";var o={props:{container:Boolean},data:{container:!0},computed:{container(s){let{container:e}=s;return e===!0&&this.$container||e&&t.$(e)}}},r={mixins:[o],functional:!0,args:["message","status"],data:{message:"",status:"",timeout:5e3,group:null,pos:"top-center",clsContainer:"uk-notification",clsClose:"uk-notification-close",clsMsg:"uk-notification-message"},install:c,computed:{marginProp(s){let{pos:e}=s;return"margin"+(t.startsWith(e,"top")?"Top":"Bottom")},startProps(){return{opacity:0,[this.marginProp]:-this.$el.offsetHeight}}},created(){const s=t.$("."+this.clsContainer+"-"+this.pos,this.container)||t.append(this.container,'<div class="'+this.clsContainer+" "+this.clsContainer+"-"+this.pos+'" style="display: block"></div>');this.$mount(t.append(s,'<div class="'+this.clsMsg+(this.status?" "+this.clsMsg+"-"+this.status:"")+'"> <a href class="'+this.clsClose+'" data-uk-close></a> <div>'+this.message+"</div> </div>"))},async connected(){const s=t.toFloat(t.css(this.$el,this.marginProp));await t.Transition.start(t.css(this.$el,this.startProps),{opacity:1,[this.marginProp]:s}),this.timeout&&(this.timer=setTimeout(this.close,this.timeout))},events:{click(s){t.closest(s.target,'a[href="#"],a[href=""]')&&s.preventDefault(),this.close()},[t.pointerEnter](){this.timer&&clearTimeout(this.timer)},[t.pointerLeave](){this.timeout&&(this.timer=setTimeout(this.close,this.timeout))}},methods:{async close(s){const e=i=>{const n=t.parent(i);t.trigger(i,"close",[this]),t.remove(i),n!=null&&n.hasChildNodes()||t.remove(n)};this.timer&&clearTimeout(this.timer),s||await t.Transition.start(this.$el,this.startProps),e(this.$el)}}};function c(s){s.notification.closeAll=function(e,i){t.apply(document.body,n=>{const a=s.getComponent(n,"notification");a&&(!e||e===a.group)&&a.close(i)})}}return typeof window<"u"&&window.UIkit&&window.UIkit.component("notification",r),r});
|