You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7 lines
215 KiB

3 years ago
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueGridLayout=e():t.VueGridLayout=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=8)}([function(t,e,n){"use strict";function r(t){for(var e=0,n=void 0,r=0,i=t.length;r<i;r++)(n=t[r].y+t[r].h)>e&&(e=n);return e}function i(t){for(var e=Array(t.length),n=0,r=t.length;n<r;n++)e[n]=o(t[n]);return e}function o(t){return JSON.parse(JSON.stringify(t))}function a(t,e){return t!==e&&(!(t.x+t.w<=e.x)&&(!(t.x>=e.x+e.w)&&(!(t.y+t.h<=e.y)&&!(t.y>=e.y+e.h))))}function s(t,e){for(var n=f(t),r=w(t),i=Array(t.length),o=0,a=r.length;o<a;o++){var s=r[o];s.static||(s=l(n,s,e),n.push(s)),i[t.indexOf(s)]=s,s.moved=!1}return i}function l(t,e,n){if(n)for(;e.y>0&&!d(t,e);)e.y--;for(var r=void 0;r=d(t,e);)e.y=r.y+r.h;return e}function c(t,e){for(var n=f(t),r=0,i=t.length;r<i;r++){var o=t[r];if(o.x+o.w>e.cols&&(o.x=e.cols-o.w),o.x<0&&(o.x=0,o.w=e.cols),o.static)for(;d(n,o);)o.y++;else n.push(o)}return t}function u(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n].i===e)return t[n]}function d(t,e){for(var n=0,r=t.length;n<r;n++)if(a(t[n],e))return t[n]}function p(t,e){return t.filter(function(t){return a(t,e)})}function f(t){return t.filter(function(t){return t.static})}function h(t,e,n,r,i){if(e.static)return t;var o=r&&e.y>r;"number"==typeof n&&(e.x=n),"number"==typeof r&&(e.y=r),e.moved=!0;var a=w(t);o&&(a=a.reverse());for(var s=p(a,e),l=0,c=s.length;l<c;l++){var u=s[l];u.moved||(e.y>u.y&&e.y-u.y>u.h/4||(t=u.static?v(t,u,e,i):v(t,e,u,i)))}return t}function v(t,e,n,r){if(r){var i={x:n.x,y:n.y,w:n.w,h:n.h,i:"-1"};if(i.y=Math.max(e.y-n.h,0),!d(t,i))return h(t,n,void 0,i.y)}return h(t,n,void 0,n.y+1)}function g(t){return 100*t+"%"}function m(t,e,n,r){var i="translate3d("+e+"px,"+t+"px, 0)";return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:n+"px",height:r+"px",position:"absolute"}}function y(t,e,n,r){var i="translate3d("+-1*e+"px,"+t+"px, 0)";return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:n+"px",height:r+"px",position:"absolute"}}function b(t,e,n,r){return{top:t+"px",left:e+"px",width:n+"px",height:r+"px",position:"absolute"}}function x(t,e,n,r){return{top:t+"px",right:e+"px",width:n+"px",height:r+"px",position:"absolute"}}function w(t){return[].concat(t).sort(function(t,e){return t.y>e.y||t.y===e.y&&t.x>e.x?1:-1})}function C(t,e){e=e||"Layout";var n=["x","y","w","h"];if(!Array.isArray(t))throw new Error(e+" must be an array!");for(var r=0,i=t.length;r<i;r++){for(var o=t[r],a=0;a<n.length;a++)if("number"!=typeof o[n[a]])throw new Error("VueGridLayout: "+e+"["+r+"]."+n[a]+" must be a number!");if(o.i&&"string"!=typeof o.i)throw new Error("VueGridLayout: "+e+"["+r+"].i must be a string!");if(void 0!==o.static&&"boolean"!=typeof o.static)throw new Error("VueGridLayout: "+e+"["+r+"].static must be a boolean!")}}function _(t,e){e.forEach(function(e){return t[e]=t[e].bind(t)})}function E(t){var e=Object.keys(t);if(!e.length)return"";var n,r=e.length,i="";for(n=0;n<r;n++){var o=e[n],a=t[o];i+=A(o)+":"+S(o,a)+";"}return i}function S(t,e){return"number"!=typeof e||I[t]?e:e+"px"}function A(t){return t.replace(O,"$1-$2").toLowerCase()}function T(t,e,n){for(var r=0;r<t.length;r++)if(t[r][e]==n)return!0;return!1}function k(t,e,n){t.forEach(function(r,i){r[e]===n&&t.splice(i,1)})}Object.defineProperty(e,"__esModule",{value:!0}),e.bottom=r,e.cloneLayout=i,e.cloneLayoutItem=o,e.collides=a,e.compact=s,e.compactItem=l,e.correctBounds=c,e.getLayoutItem=u,e.getFirstCollision=d,e.getAllCollisions=p,e.getSta
* Vue.js v2.4.2
* (c) 2014-2017 Evan You
* Released under the MIT License.
*/
function n(t){return void 0===t||null===t}function r(t){return void 0!==t&&null!==t}function i(t){return!0===t}function o(t){return!1===t}function a(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t}function s(t){return null!==t&&"object"==typeof t}function l(t){return"[object Object]"===Ni.call(t)}function c(t){return"[object RegExp]"===Ni.call(t)}function u(t){var e=parseFloat(t);return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function p(t){var e=parseFloat(t);return isNaN(e)?t:e}function f(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}function h(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function v(t,e){return Hi.call(t,e)}function g(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function m(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function y(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function b(t,e){for(var n in e)t[n]=e[n];return t}function x(t){for(var e={},n=0;n<t.length;n++)t[n]&&b(e,t[n]);return e}function w(t,e,n){}function C(t,e){if(t===e)return!0;var n=s(t),r=s(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var i=Array.isArray(t),o=Array.isArray(e);if(i&&o)return t.length===e.length&&t.every(function(t,n){return C(t,e[n])});if(i||o)return!1;var a=Object.keys(t),l=Object.keys(e);return a.length===l.length&&a.every(function(n){return C(t[n],e[n])})}catch(t){return!1}}function _(t,e){for(var n=0;n<t.length;n++)if(C(t[n],e))return n;return-1}function E(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function S(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function A(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function T(t){if(!Qi.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}function k(t,e,n){if(Ji.errorHandler)Ji.errorHandler.call(null,t,e,n);else{if(!no||"undefined"==typeof console)throw t;console.error(t)}}function I(t){return"function"==typeof t&&/native code/.test(t.toString())}function O(t){wo.target&&Co.push(wo.target),wo.target=t}function D(){wo.target=Co.pop()}function $(t,e,n){t.__proto__=e}function z(t,e,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];A(t,o,e[o])}}function M(t,e){if(s(t)){var n;return v(t,"__ob__")&&t.__ob__ instanceof To?n=t.__ob__:Ao.shouldConvert&&!go()&&(Array.isArray(t)||l(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new To(t)),e&&n&&n.vmCount++,n}}function R(t,e,n,r,i){var o=new wo,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var s=a&&a.get,l=a&&a.set,c=!i&&M(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=s?s.call(t):n;return wo.target&&(o.depend(),c&&c.dep.depend(),Array.isArray(e)&&L(e)),e},set:function(e){var r=s?s.call(t):n;e===r||e!==e&&r!==r||(l?l.call(t,e):n=e,c=!i&&M(e),o.notify())}})}}function P(t,e,n){if(Array.isArray(t)&&u(e))return t.length=Math.max(t.length,e),t.splice(e,1,n),n;if(v(t,e))return t[e]=n,n;var r=t.__ob__;return t._isVue||r&&r.vmCount?n:r?(R(r.value,e,n),r.dep.notify(),n):(t[e]=n,n)}function N(t,e){if(Array.isArray(t)&&u(e))return void t.splice(e,1);var n=t.__ob__;t._isVue||n&&n.vmCount||v(t,e)&&(delete t[e],n&&n.dep.notify())}function L(t){for(var e=void 0,n=0,r=t.length;n<r;n++)e=t[n],e&&e.__ob__&&e.__ob__.dep.depend(),Array.isArray(e)&&L(e)}function j(t,e){if(!e)return t;for(var n,r,i,o=Object.keys(e),a=0;a<o.length;a++)n=o[a],r=t[n],i=e[n],v(t,n)?l(r)&&l(i)&&j(r,i):P(t,n,i);return t}function H(t,e,n){return n?t||e?function(){var r="function"==typeof e?e.call(n):e,i="function"==typeof t?t.call(n):void 0;return r?j(r,i):i}:void 0:e?t?function(){return j("function"==typeof e?e.call(this):e,"function"==typeof t?t.call(this):t)}:e:t}function B(t,e){return e?t?t.concat(e):Array.isArray(e)?e:[e]:t}fu