5 lines
86 KiB
JavaScript
5 lines
86 KiB
JavaScript
|
/*! UIkit 3.0.0-beta.22 | http://www.getuikit.com | (c) 2014 - 2017 YOOtheme | MIT License */
|
||
|
|
||
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define("uikit",["jquery"],e):t.UIkit=e(t.jQuery)}(this,function(t){"use strict";function e(){return"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll}function i(t){var i=function(){o(document,"DOMContentLoaded",i),o(window,"load",i),t()};e()?t():(n(document,"DOMContentLoaded",i),n(window,"load",i))}function n(t,e,i,n){A(t).addEventListener(e,i,n)}function o(t,e,i,n){A(t).removeEventListener(e,i,n)}function s(t,e,i,n){void 0===i&&(i=400),void 0===n&&(n="linear");var o=w(function(s,r){t=Vt(t);for(var a in e)t.css(a,t.css(a));var l=setTimeout(function(){return t.trigger(we||"transitionend")},i);t.one(we||"transitionend",function(e,i){e.promise=o,clearTimeout(l),t.removeClass("uk-transition").css("transition",""),i?r():s()}).addClass("uk-transition").css("transition","all "+i+"ms "+n).css(e)}).then(null,function(){});return o}function r(t,e,i,n,o){void 0===i&&(i=200);var s=w(function(r){function a(){t.css("animation-duration","").removeClass(l+" "+e)}var l=o?"uk-animation-leave":"uk-animation-enter";t=Vt(t),0===e.lastIndexOf("uk-animation-",0)&&(n&&(e+=" uk-animation-"+n),o&&(e+=" uk-animation-reverse")),a(),t.one(be||"animationend",function(t){t.promise=s,s.then(a),r()}).css("animation-duration",i+"ms").addClass(e).addClass(l),be||ae(function(){return Kt.cancel(t)})});return s}function a(t){return t instanceof Vt}function l(e,i){return e=Vt(e),e.is(i)||!!(k(i)?e.parents(i).length:t.contains(A(i),e[0]))}function h(t,e,i,n){return t=Vt(t),t.attr(e,function(t,e){return e?e.replace(i,n):e})}function c(t,e){return h(t,"class",new RegExp("(^|\\s)"+e+"(?!\\S)","g"),"")}function u(e,i,n,o){if(void 0===i&&(i=!0),void 0===n&&(n=!1),void 0===o&&(o=!1),k(e)){var s=document.createEvent("Event");s.initEvent(e,i,n),e=s}return o&&t.extend(e,o),e}function d(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var n=A(t).getBoundingClientRect();return n.bottom>=-1*e&&n.right>=-1*i&&n.top<=(window.innerHeight||document.documentElement.clientHeight)+e&&n.left<=(window.innerWidth||document.documentElement.clientWidth)+i}function f(t,e,i){void 0===i&&(i=0),e=Vt(e);var n=Vt(e).length;return t=(C(t)?t:"next"===t?i+1:"previous"===t?i-1:k(t)?parseInt(t,10):e.index(t))%n,t<0?t+n:t}function p(t){return te[A(t).tagName.toLowerCase()]}function g(t,e){var i=S(t);return i?i.reduce(function(t,e){return E(e,t)},e):E(t)}function m(t,e){return function(i){var n=arguments.length;return n?n>1?t.apply(e,arguments):t.call(e,i):t.call(e)}}function v(t,e){return ie.call(t,e)}function w(t){if(ce)return new Promise(t);var e=Vt.Deferred();return t(e.resolve,e.reject),e}function y(t){return t.replace(/(?:^|[-_\/])(\w)/g,function(t,e){return e?e.toUpperCase():""})}function b(t){return t.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase()}function $(t){return t.replace(ne,x)}function x(t,e){return e?e.toUpperCase():""}function k(t){return"string"==typeof t}function C(t){return"number"==typeof t}function T(t){return void 0===t}function _(t){return k(t)&&t.match(/^[!>+-]/)}function S(t){return _(t)&&t.split(/(?=\s[!>+-])/g).map(function(t){return t.trim()})}function E(t,e){if(!0===t)return null;try{if(e&&_(t)&&">"!==t[0]){var i=oe[t[0]],n=t.substr(1);e=Vt(e),"closest"===i&&(e=e.parent(),n=n||"*"),t=e[i](n)}else t=Vt(t,e)}catch(t){return null}return t.length?t:null}function A(t){return t&&(a(t)?t[0]:t)}function O(t){return"boolean"==typeof t?t:"true"===t||"1"===t||""===t||"false"!==t&&"0"!==t&&t}function D(t){var e=Number(t);return!isNaN(e)&&e}function I(e){return t.isArray(e)?e:k(e)?e.split(",").map(function(t){return O(t.trim())}):[e]}function N(t){if(k(t))if("@"===t[0]){var e="media-"+t.substr(1);t=se[e]||(se[e]=parseFloat(j(e)))}else if(t.match(/^\(min-width:/))return t;return!(!t||isNaN(t))&&"(min-width: "+t+"px)"}function B(t,e,i){return t===Boolean?O(e):t===Number?D(e):"jQuery"===t?g(e,i):"list"===t?I(e):"media"===t?N(e):t?t(e):e}function P(t){return t?"ms"===t.substr(-2)?parseFloat(t):1
|
||
|
transition:"easeOutExpo",offset:0},methods:{scrollToElement:function(t){var e=this;t=Vt(t);var i=G(t)-this.offset,n=document.documentElement.offsetHeight,o=window.innerHeight;i+o>n&&(i=n-o),Vt("html,body").stop().animate({scrollTop:Math.round(i)},this.duration,this.transition).promise().then(function(){return e.$el.trigger("scrolled",[e])})}},events:{click:function(t){t.isDefaultPrevented()||(t.preventDefault(),this.scrollToElement(Vt(this.$el[0].hash).length?this.$el[0].hash:"body"))}}}),Vt.easing.easeOutExpo||(Vt.easing.easeOutExpo=function(t,e,i,n,o){return e===o?i+n:n*(1-Math.pow(2,-10*e/o))+i})}function Nt(t){t.component("scrollspy",{args:"cls",props:{cls:"list",target:String,hidden:Boolean,offsetTop:Number,offsetLeft:Number,repeat:Boolean,delay:Number},defaults:{cls:["uk-scrollspy-inview"],target:!1,hidden:!0,offsetTop:0,offsetLeft:0,repeat:!1,delay:0,inViewClass:"uk-scrollspy-inview"},init:function(){this.$emitSync()},computed:{elements:function(){return this.target&&Vt(this.target,this.$el)||this.$el}},update:[{write:function(){this.hidden&&this.elements.filter(":not(."+this.inViewClass+")").css("visibility","hidden")}},{read:function(){var t=this;this.elements.each(function(e,i){if(!i._scrollspy){var n=Vt(i).attr("uk-scrollspy-class");i._scrollspy={toggles:n&&n.split(",")||t.cls}}i._scrollspy.show=d(i,t.offsetTop,t.offsetLeft)})},write:function(){var t=this,e=1===this.elements.length?1:0;this.elements.each(function(i,n){var o=Vt(n),s=n._scrollspy;s.show?s.inview||s.timer||(s.timer=setTimeout(function(){o.css("visibility","").addClass(t.inViewClass).toggleClass(s.toggles[0]).trigger("inview"),s.inview=!0,delete s.timer},t.delay*e++)):s.inview&&t.repeat&&(s.timer&&(clearTimeout(s.timer),delete s.timer),o.removeClass(t.inViewClass).toggleClass(s.toggles[0]).css("visibility",t.hidden?"hidden":"").trigger("outview"),s.inview=!1),s.toggles.reverse()})},events:["scroll","load","resize"]}]})}function Bt(t){t.component("scrollspy-nav",{props:{cls:String,closest:String,scroll:Boolean,overflow:Boolean,offset:Number},defaults:{cls:"uk-active",closest:!1,scroll:!1,overflow:!0,offset:0},computed:{links:function(){return this.$el.find('a[href^="#"]').filter(function(t,e){return e.hash})},elements:function(){return this.closest?this.links.closest(this.closest):this.links},targets:function(){return Vt(this.links.toArray().map(function(t){return t.hash}).join(","))}},update:[{read:function(){this.scroll&&t.scroll(this.links,{offset:this.offset||0})}},{read:function(){var t=this,e=window.pageYOffset+this.offset,i=document.documentElement.scrollHeight-window.innerHeight+this.offset;this.active=!1,this.targets.each(function(n,o){o=Vt(o);var s=G(o),r=n+1===t.targets.length;if(!t.overflow&&(0===n&&s>e||r&&s+o[0].offsetTop<e))return!1;if(r||!(G(t.targets.eq(n+1))<=e)){if(e>=i)for(var a=t.targets.length-1;a>n;a--)if(d(t.targets.eq(a))){o=t.targets.eq(a);break}return!(t.active=E(t.links.filter('[href="#'+o.attr("id")+'"]')))}})},write:function(){this.links.blur(),this.elements.removeClass(this.cls),this.active&&this.$el.trigger("active",[this.active,(this.closest?this.active.closest(this.closest):this.active).addClass(this.cls)])},events:["scroll","load","resize"]}]})}function Pt(e){e.component("sticky",{mixins:[He],attrs:!0,props:{top:null,bottom:Boolean,offset:Number,animation:String,clsActive:String,clsInactive:String,clsFixed:String,widthElement:"jQuery",showOnUp:Boolean,media:"media",target:Number},defaults:{top:0,bottom:!1,offset:0,animation:"",clsActive:"uk-active",clsInactive:"",clsFixed:"uk-sticky-fixed",widthElement:!1,showOnUp:!1,media:!1,target:!1},connected:function(){this.placeholder=Vt('<div class="uk-sticky-placeholder"></div>'),this.widthElement=this.$props.widthElement||this.placeholder,this.isActive||this.$el.addClass(this.clsInactive)},disconnected:function(){this.isActive&&(this.isActive=!1,this.hide(),this.$el.removeClass(this.clsInactive)),this.placeholder.remove(),this.placeholder=null,this.widthElement=null},ready:function(){var t=this;if(this.target&&location.hash&&window.pageYOffset>0){var e=g(location.hash);e
|
||
|
},inProgress:function(t){return Vt(t).hasClass("uk-animation-enter")||Vt(t).hasClass("uk-animation-leave")},cancel:function(e){var i=t.Event(be||"animationend");return Vt(e).triggerHandler(i),i.promise||w.resolve()}},te={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,menuitem:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ee={ratio:function(t,e,i){var n="width"===e?"height":"width";return o={},o[n]=Math.round(i*t[n]/t[e]),o[e]=i,o;var o},fit:function(e,i){var n=this;return e=t.extend({},e),t.each(e,function(t){return e=e[t]>i[t]?n.ratio(e,t,i[t]):e}),e},cover:function(e,i){var n=this;return e=this.fit(e,i),t.each(e,function(t){return e=e[t]<i[t]?n.ratio(e,t,i[t]):e}),e}},ie=Object.prototype.hasOwnProperty;w.resolve=function(t){return w(function(e){e(t)})},w.reject=function(t){return w(function(e,i){i(t)})},w.all=function(t){return ce?Promise.all(t):Vt.when.apply(Vt,t)};var ne=/-(\w)/g,oe={"!":"closest","+":"nextAll","-":"prevAll"},se={},re=window.MutationObserver||window.WebKitMutationObserver,ae=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},le="ontouchstart"in window,he=window.PointerEvent,ce="Promise"in window,ue=le||window.DocumentTouch&&document instanceof DocumentTouch||navigator.msPointerEnabled&&navigator.msMaxTouchPoints>0||navigator.pointerEnabled&&navigator.maxTouchPoints>0,de=ue?le?"touchstart":"pointerdown":"mousedown",fe=ue?le?"touchmove":"pointermove":"mousemove",pe=ue?le?"touchend":"pointerup":"mouseup",ge=ue&&he?"pointerenter":"mouseenter",me=ue&&he?"pointerleave":"mouseleave",ve=ue&&le?"touchcancel":"pointercancel",we=L("transition","transition-end"),ye=L("animation","animation-start"),be=L("animation","animation-end"),$e={reads:[],writes:[],measure:function(t){return this.reads.push(t),F(this),t},mutate:function(t){return this.writes.push(t),F(this),t},clear:function(t){return q(this.reads,t)||q(this.writes,t)}};Y.prototype={positions:[],position:null,init:function(){var t=this;this.positions=[],this.position=null;var e=!1;this.handler=function(i){e||setTimeout(function(){var n=Date.now(),o=t.positions.length;o&&n-t.positions[o-1].time>100&&t.positions.splice(0,o),t.positions.push({time:n,x:i.pageX,y:i.pageY}),t.positions.length>5&&t.positions.shift(),e=!1},5),e=!0},Gt.on("mousemove",this.handler)},cancel:function(){this.handler&&Gt.off("mousemove",this.handler)},movesTo:function(t){if(this.positions.length<2)return!1;var e=X(t),i=this.positions[this.positions.length-1],n=this.positions[0];if(e.left<=i.x&&i.x<=e.right&&e.top<=i.y&&i.y<=e.bottom)return!1;var o=[[{x:e.left,y:e.top},{x:e.right,y:e.bottom}],[{x:e.right,y:e.top},{x:e.left,y:e.bottom}]];return e.right<=i.x||(e.left>=i.x?(o[0].reverse(),o[1].reverse()):e.bottom<=i.y?o[0].reverse():e.top>=i.y&&o[1].reverse()),!!o.reduce(function(t,e){return t+(R(n,e[0])<R(i,e[0])&&R(n,e[1])>R(i,e[1]))},0)}};var xe={};xe.args=xe.created=xe.events=xe.init=xe.ready=xe.connected=xe.disconnected=xe.destroy=function(e,i){return e=e&&!t.isArray(e)?[e]:e,i?e?e.concat(i):t.isArray(i)?i:[i]:e},xe.update=function(e,i){return xe.args(e,t.isFunction(i)?{write:i}:i)},xe.props=function(e,i){return t.isArray(i)&&(i=i.reduce(function(t,e){return t[e]=String,t},{})),xe.methods(e,i)},xe.computed=xe.defaults=xe.methods=function(e,i){return i?e?t.extend(!0,{},e,i):i:e};var ke,Ce,Te,_e,Se,Ee=function(t,e){return T(e)?t:e},Ae={x:["width","left","right"],y:["height","top","bottom"]},Oe={};i(function(){var e,i,o,s=0,r=0;"MSGesture"in window&&(_e=new MSGesture,_e.target=document.body),n(document,"click",function(){return Se=!0},!0);var a=function(t){var e=t.velocityX>1?"Right":t.velocityX<-1?"Left":t.velocityY>1?"Down":t.velocityY<-1?"Up":null;e&&void 0!==Oe.el&&(Oe.el.trigger("swipe"),Oe.el.trigger("swipe"+e))};n(document,"MSGestureEnd",a),n(document,"gestureend",a),n(document,de,function(t){o=t.touches?t.touches[0]:t,e=Date.now(),i=e-(Oe.last||e),Oe.el=Vt("tagName"in o.target?o.target:o.target.parentNode),ke&&clearTimeout(ke),Oe.x1=o.pageX,Oe.y1=o.pageY,i>0&&i<=250&&(Oe.isDoubleTap=!0),Oe.last=e,!_e||"pointerdown"!==t.type&&"tou
|