5 lines
93 KiB
JavaScript
5 lines
93 KiB
JavaScript
![]() |
/*! UIkit 3.0.0-beta.24 | 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&&!ne.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){e.split(" ").forEach(function(e){return P(t).addEventListener(e,i,n)})}function o(t,e,i,n){e.split(" ").forEach(function(e){return P(t).removeEventListener(e,i,n)})}function s(t,e,i,n){void 0===i&&(i=400),void 0===n&&(n="linear");var o=$(function(s,r){t=ie(t);for(var a in e)t.css(a,t.css(a));var l=setTimeout(function(){return t.trigger(Ee||"transitionend")},i);t.one(Ee||"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=$(function(r){function a(){t.css("animation-duration","").removeClass(l+" "+e)}var l=o?"uk-animation-leave":"uk-animation-enter";t=ie(t),0===e.lastIndexOf("uk-animation-",0)&&(n&&(e+=" uk-animation-"+n),o&&(e+=" uk-animation-reverse")),a(),t.one(Ae||"animationend",function(t){t.promise=s,s.then(a),r()}).css("animation-duration",i+"ms").addClass(e).addClass(l),Ae||be(function(){return he.cancel(t)})});return s}function a(t){return t instanceof ie}function l(t,e){return t=ie(t),!!t.is(e)||(O(e)?t.parents(e).length:P(e).contains(t[0]))}function h(t,e,i,n){return t=ie(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(t,e,i,n){if(void 0===e&&(e=!0),void 0===i&&(i=!1),void 0===n&&(n=!1),O(t)){var o=document.createEvent("Event");o.initEvent(t,e,i),t=o}return n&&ve(t,n),t}function d(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var n=P(t).getBoundingClientRect();return n.bottom>=-1*e&&n.right>=-1*i&&n.top<=window.innerHeight+e&&n.left<=window.innerWidth+i}function f(t){var e=P(t).getBoundingClientRect(),i=e.top,n=e.height,o=et(t),s=window.innerHeight,r=s+Math.min(0,o-s),a=Math.max(0,s-(g()-(o+n)));return p((r-i)/((r+(n-(a<s?a:0)))/100)/100)}function p(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=1),Math.min(Math.max(t,e),i)}function g(){return Math.max(ne.offsetHeight,ne.scrollHeight)}function m(t,e,i){void 0===i&&(i=0),e=ie(e);var n=ie(e).length;return t=(A(t)?t:"next"===t?i+1:"previous"===t?i-1:O(t)?parseInt(t,10):e.index(t))%n,t<0?t+n:t}function v(t){return ce[P(t).tagName.toLowerCase()]}function w(t,e){var i=N(t);return i?i.reduce(function(t,e){return B(e,t)},e):B(t)}function b(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 y(t,e){return de.call(t,e)}function $(t){if($e)return new Promise(t);var e=ie.Deferred();return t(e.resolve,e.reject),e}function x(t){return t.replace(/(?:^|[-_\/])(\w)/g,function(t,e){return e?e.toUpperCase():""})}function k(t){return t.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase()}function C(t){return t.replace(fe,T)}function T(t,e){return e?e.toUpperCase():""}function _(t){return"function"==typeof t}function S(t){return null!==t&&"object"==typeof t}function E(t){return S(t)&&Object.getPrototypeOf(t)===Object.prototype}function O(t){return"string"==typeof t}function A(t){return"number"==typeof t}function D(t){return void 0===t}function I(t){return O(t)&&t.match(/^[!>+-]/)}function N(t){return I(t)&&t.split(/(?=\s[!>+-])/g).map(function(t){return t.trim()})}function B(t,e){if(t===!0)return null;try{if(e&&I(t)&&">"!==t[0]){var i=ge[t[0]],n=t.substr(1);e=ie(e),"closest"===i&&(e=e.parent(),n=n||"*"),t=e[i](n)}else t=ie(t,e)}catch(t){return null}return t.length?t:null}function P(t){return t&&(a(t)?t[0]:t)}function H(t){return"boolean"==typeof t?t:"true"===t||"1"===t||""===t||"false"!==t&&"0"!==t&&t}function M(t){var e=Number(t);retur
|
||
|
},events:["resize"]},events:[{name:"beforeshow",self:!0,handler:function(){this.$el.css("display","block").height()}},{name:"hidden",self:!0,handler:function(){this.$el.css("display","").removeClass("uk-flex uk-flex-center uk-flex-middle")}}]}),t.component("overflow-auto",{mixins:[Xe],computed:{panel:function(){return this.$el.closest(".uk-modal-dialog")}},connected:function(){this.$el.css("min-height",150)},update:{write:function(){var t=this.$el.css("max-height");this.$el.css("max-height",150).css("max-height",Math.max(150,150-(this.panel.outerHeight(!0)-window.innerHeight))),t!==this.$el.css("max-height")&&this.$el.trigger("resize")},events:["load","resize"]}}),t.modal.dialog=function(e,i){var n=t.modal('<div class="uk-modal">\n <div class="uk-modal-dialog">'+e+"</div>\n </div>",i);return n.$el.on("hidden",function(t){t.target===t.currentTarget&&n.$destroy(!0)}),n.show(),n},t.modal.alert=function(e,i){return i=ve({bgClose:!1,escClose:!1,labels:t.modal.labels},i),$(function(n){return t.modal.dialog('\n <div class="uk-modal-body">'+(O(e)?e:ie(e).html())+'</div>\n <div class="uk-modal-footer uk-text-right">\n <button class="uk-button uk-button-primary uk-modal-close" autofocus>'+i.labels.ok+"</button>\n </div>\n ",i).$el.on("hide",n)})},t.modal.confirm=function(e,i){return i=ve({bgClose:!1,escClose:!1,labels:t.modal.labels},i),$(function(n,o){return t.modal.dialog('\n <div class="uk-modal-body">'+(O(e)?e:ie(e).html())+'</div>\n <div class="uk-modal-footer uk-text-right">\n <button class="uk-button uk-button-default uk-modal-close">'+i.labels.cancel+'</button>\n <button class="uk-button uk-button-primary uk-modal-close" autofocus>'+i.labels.ok+"</button>\n </div>\n ",i).$el.on("click",".uk-modal-footer button",function(t){return 0===ie(t.target).index()?o():n()})})},t.modal.prompt=function(e,i,n){return n=ve({bgClose:!1,escClose:!1,labels:t.modal.labels},n),$(function(o){var s=!1,r=t.modal.dialog('\n <form class="uk-form-stacked">\n <div class="uk-modal-body">\n <label>'+(O(e)?e:ie(e).html())+'</label>\n <input class="uk-input" type="text" autofocus>\n </div>\n <div class="uk-modal-footer uk-text-right">\n <button class="uk-button uk-button-default uk-modal-close" type="button">'+n.labels.cancel+'</button>\n <button class="uk-button uk-button-primary" type="submit">'+n.labels.ok+"</button>\n </div>\n </form>\n ",n),a=r.$el.find("input").val(i);r.$el.on("submit","form",function(t){t.preventDefault(),o(a.val()),s=!0,r.hide()}).on("hide",function(){s||o(null)})})},t.modal.labels={ok:"Ok",cancel:"Cancel"}}function Bt(t){t.component("nav",t.components.accordion.extend({name:"nav",defaults:{targets:"> .uk-parent",toggle:"> a",content:"ul:first"}}))}function Pt(t){t.component("navbar",{mixins:[Xe],props:{dropdown:String,mode:"list",align:String,offset:Number,boundary:Boolean,boundaryAlign:Boolean,clsDrop:String,delayShow:Number,delayHide:Number,dropbar:Boolean,dropbarMode:String,dropbarAnchor:"jQuery",duration:Number},defaults:{dropdown:".uk-navbar-nav > li",align:ae?"right":"left",clsDrop:"uk-navbar-dropdown",mode:void 0,offset:void 0,delayShow:void 0,delayHide:void 0,boundaryAlign:void 0,flip:"x",boundary:!0,dropbar:!1,dropbarMode:"slide",dropbarAnchor:!1,duration:200},computed:{boundary:function(){return this.$props.boundary===!0||this.boundaryAlign?this.$el:this.$props.boundary},pos:function(){return"bottom-"+this.align}},ready:function(){this.dropbar&&t.navbarDropbar(w(this.dropbar,this.$el)||ie("<div></div>").insertAfter(this.dropbarAnchor||this.$el),{clsDrop:this.clsDrop,mode:this.dropbarMode,duration:this.duration,navbar:this})},update:function(){t.drop(ie(this.dropdown+" ."+this.clsDrop,this.$el),ve({},this.$props,{bounda
|
||
|
threshold:Number,clsItem:String,clsPlaceholder:String,clsDrag:String,clsDragState:String,clsBase:String,clsNoDrag:String,clsEmpty:String,clsCustom:String,handle:String},defaults:{group:!1,animation:150,threshold:5,clsItem:"uk-sortable-item",clsPlaceholder:"uk-sortable-placeholder",clsDrag:"uk-sortable-drag",clsDragState:"uk-drag",clsBase:"uk-sortable",clsNoDrag:"uk-sortable-nodrag",clsEmpty:"uk-sortable-empty",clsCustom:"",handle:!1},init:function(){var t=this;["init","start","move","end"].forEach(function(e){var i=t[e];t[e]=function(e){e=e.originalEvent||e,t.scrollY=window.scrollY;var n=e.touches&&e.touches[0]||e,o=n.pageX,s=n.pageY;t.pos={x:o,y:s},i(e)}})},events:(b={},b[p]="init",b),update:{write:function(){var t=this;if(this.clsEmpty&&this.$toggleClass(this.clsEmpty,!this.$el.children().length),this.drag){this.drag.offset({top:this.pos.y+this.origin.top,left:this.pos.x+this.origin.left});var e=f(this.drag),i=e+this.drag[0].offsetHeight;e>0&&e<this.scrollY?setTimeout(function(){return w.scrollTop(t.scrollY-5)},5):i<l()&&i>window.innerHeight+this.scrollY&&setTimeout(function(){return w.scrollTop(t.scrollY+5)},5)}}},methods:{init:function(t){var e=s(t.target),i=this.$el.children().filter(function(e,i){return c(t.target,i)});!i.length||e.is(":input")||this.handle&&!c(e,this.handle)||t.button&&0!==t.button||c(e,"."+this.clsNoDrag)||(t.preventDefault(),t.stopPropagation(),this.touched=[this],this.placeholder=i,this.origin=r({target:e,index:this.placeholder.index()},this.pos),a.on(g,this.move),a.on(m,this.end),w.on("scroll",this.scroll),this.threshold||this.start(t))},start:function(e){this.drag=s(this.placeholder[0].outerHTML.replace(/^<li/i,"<div").replace(/li>$/i,"div>")).attr("uk-no-boot","").addClass(this.clsDrag+" "+this.clsCustom).css({boxSizing:"border-box",width:this.placeholder.outerWidth(),height:this.placeholder.outerHeight()}).css(this.placeholder.css(["paddingLeft","paddingRight","paddingTop","paddingBottom"])).appendTo(t.container),this.drag.children().first().height(this.placeholder.children().height());var i=h(this.placeholder),n=i.left,o=i.top;r(this.origin,{left:n-this.pos.x,top:o-this.pos.y}),this.placeholder.addClass(this.clsPlaceholder),this.$el.children().addClass(this.clsItem),a.addClass(this.clsDragState),this.$el.trigger("start",[this,this.placeholder,this.drag]),this.move(e)},move:function t(i){if(!this.drag)return void((Math.abs(this.pos.x-this.origin.x)>this.threshold||Math.abs(this.pos.y-this.origin.y)>this.threshold)&&this.start(i));this.$emit();var n="mousemove"===i.type?i.target:document.elementFromPoint(this.pos.x-document.body.scrollLeft,this.pos.y-document.body.scrollTop),o=e(n),r=e(this.placeholder[0]),t=o!==r;if(o&&!c(n,this.placeholder)&&(!t||o.group&&o.group===r.group)){if(n=o.$el.is(n.parentNode)&&s(n)||o.$el.children().has(n),t)r.remove(this.placeholder);else if(!n.length)return;o.insert(this.placeholder,n),~this.touched.indexOf(o)||this.touched.push(o)}},scroll:function t(){var t=window.scrollY;t!==this.scrollY&&(this.pos.y+=t-this.scrollY,this.scrollY=t,this.$emit())},end:function(t){if(a.off(g,this.move),a.off(m,this.end),w.off("scroll",this.scroll),!this.drag)return void("mouseup"!==t.type&&c(t.target,"a[href]")&&(location.href=s(t.target).closest("a[href]").attr("href")));i();var n=e(this.placeholder[0]);this===n?this.origin.index!==this.placeholder.index()&&this.$el.trigger("change",[this,this.placeholder,"moved"]):(n.$el.trigger("change",[n,this.placeholder,"added"]),this.$el.trigger("change",[this,this.placeholder,"removed"])),this.$el.trigger("stop",[this]),this.drag.remove(),this.drag=null;var o=this.touched.map(function(t){return t.clsPlaceholder+" "+t.clsItem}).join(" ");this.touched.forEach(function(t){return t.$el.children().removeClass(o)}),a.removeClass(this.clsDragState)},insert:function t(e,i){var n=this;this.$el.children().addClass(this.clsItem);var t=function(){i.length?!n.$el.has(e).length||e.prevAll().filter(i).length?e.insertBefore(i):e.insertAfter(i):n.$el.append(e)};this.animation?this.animate(t):t()},remove:function(t){this.$el.has(t).length&&(this.animati
|