mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-17 04:37:53 +00:00
1 line
135 KiB
JavaScript
1 line
135 KiB
JavaScript
|
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("uikit",e):t.UIkit=e()}(this,function(){"use strict";function p(i,n){return function(t){var e=arguments.length;return e?1<e?i.apply(n,arguments):i.call(n,t):i.call(n)}}var i=Object.prototype.hasOwnProperty;function l(t,e){return i.call(t,e)}var e=/([a-z\d])([A-Z])/g;function g(t){return t.replace(e,"$1-$2").toLowerCase()}var n=/-(\w)/g;function m(t){return t.replace(n,o)}function o(t,e){return e?e.toUpperCase():""}function r(t){return t.length?o(0,t.charAt(0))+t.slice(1):""}var t=String.prototype,s=t.startsWith||function(t){return 0===this.lastIndexOf(t,0)};function v(t,e){return s.call(t,e)}var a=t.endsWith||function(t){return this.substr(-t.length)===t};function u(t,e){return a.call(t,e)}var c=function(t){return~this.indexOf(t)},h=t.includes||c,d=Array.prototype.includes||c;function b(t,e){return t&&(E(t)?h:d).call(t,e)}var w=Array.isArray;function y(t){return"function"==typeof t}function f(t){return null!==t&&"object"==typeof t}function x(t){return f(t)&&Object.getPrototypeOf(t)===Object.prototype}function k(t){return f(t)&&t===t.window}function $(t){return f(t)&&9===t.nodeType}function C(t){return f(t)&&!!t.jquery}function I(t){return t instanceof Node||f(t)&&1===t.nodeType}function T(t){return t instanceof NodeList||t instanceof HTMLCollection}function S(t){return"boolean"==typeof t}function E(t){return"string"==typeof t}function A(t){return"number"==typeof t}function N(t){return A(t)||E(t)&&!isNaN(t-parseFloat(t))}function _(t){return void 0===t}function B(t){return S(t)?t:"true"===t||"1"===t||""===t||"false"!==t&&"0"!==t&&t}function D(t){var e=Number(t);return!isNaN(e)&&e}function O(t){return parseFloat(t)||0}function M(t){return I(t)||k(t)||$(t)?t:T(t)||C(t)?t[0]:w(t)?M(t[0]):null}var H=Array.prototype;function P(t){return I(t)?[t]:T(t)?H.slice.call(t):w(t)?t.map(M).filter(Boolean):C(t)?t.toArray():[]}function z(t){return w(t)?t:E(t)?t.split(/,(?![^(]*\))/).map(function(t){return N(t)?D(t):B(t.trim())}):[t]}function L(t){return t?u(t,"ms")?O(t):1e3*O(t):0}function V(t,e,i){return t.replace(new RegExp(e+"|"+i,"mg"),function(t){return t===e?i:e})}var j=Object.assign||function(t){for(var e=[],i=arguments.length-1;0<i--;)e[i]=arguments[i+1];t=Object(t);for(var n=0;n<e.length;n++){var o=e[n];if(null!==o)for(var s in o)l(o,s)&&(t[s]=o[s])}return t};function W(t,e){for(var i in t)if(!1===e.call(t[i],t[i],i))break}function F(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=1),Math.min(Math.max(t,e),i)}function R(){}function q(t,e){return t.left<=e.right&&e.left<=t.right&&t.top<=e.bottom&&e.top<=t.bottom}function Y(t,e){return q({top:t.y,bottom:t.y,left:t.x,right:t.x},e)}var U={ratio:function(t,e,i){var n,o="width"===e?"height":"width";return(n={})[o]=Math.round(i*t[o]/t[e]),n[e]=i,n},contain:function(i,n){var o=this;return W(i=j({},i),function(t,e){return i=i[e]>n[e]?o.ratio(i,e,n[e]):i}),i},cover:function(i,n){var o=this;return W(i=this.contain(i,n),function(t,e){return i=i[e]<n[e]?o.ratio(i,e,n[e]):i}),i}};function Q(t,e,i){if(f(e))for(var n in e)Q(t,n,e[n]);else{if(_(i))return(t=M(t))&&t.getAttribute(e);P(t).forEach(function(t){y(i)&&(i=i.call(t,Q(t,e))),null===i?G(t,e):t.setAttribute(e,i)})}}function X(t,e){return P(t).some(function(t){return t.hasAttribute(e)})}function G(t,e){t=P(t),e.split(" ").forEach(function(e){return t.forEach(function(t){return t.removeAttribute(e)})})}function J(t,e,i,n){Q(t,e,function(t){return t?t.replace(i,n):t})}function K(t,e){for(var i=0,n=[e,"data-"+e];i<n.length;i++)if(X(t,n[i]))return Q(t,n[i])}function Z(t,e){return M(t)||et(t,rt(t)?e:document)}function tt(t,e){var i=P(t);return i.length&&i||it(t,rt(t)?e:document)}function et(t,e){return M(nt(t,e,"querySelector"))}function it(t,e){return P(nt(t,e,"querySelectorAll"))}function nt(t,o,e){if(void 0===o&&(o=document),!t||!E(t))return null;var s;rt(t=t.replace(st,"$1 *"))&&(s=[],t=t.split(",").map(function(t,e){var i=o;if("!"===(t=t.trim())[0]){var n=t.substr(1).trim().split(" ");i=ht(o.parentNode,n[0]),t=n.
|