Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gridstack

Package Overview
Dependencies
Maintainers
3
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gridstack - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

dist/src/gridstack-extra.scss

18

dist/gridstack-poly.js

@@ -1,2 +0,2 @@

/** gridstack.js 1.1.0 - IE and older browsers Polyfills for this library @preserve*/
/** gridstack.js 1.1.1 - IE and older browsers Polyfills for this library @preserve*/
/**

@@ -8,2 +8,18 @@ * https://gridstackjs.com/

// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
(function () {
if (typeof window.CustomEvent === "function") {
return false;
}
function CustomEvent (event, params) {
params = params || {bubbles: false, cancelable: false, detail: null};
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
}
window.CustomEvent = CustomEvent;
})();
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN

@@ -10,0 +26,0 @@ Number.isNaN = Number.isNaN || function isNaN(input) {

4

dist/gridstack-poly.min.js

@@ -1,3 +0,3 @@

/** gridstack.js 1.1.0 - IE and older browsers Polyfills for this library @preserve*/
Number.isNaN=Number.isNaN||function(r){return"number"==typeof r&&r!=r},Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(r){if(null==this)throw TypeError('"this" is null or not defined');var e=Object(this),t=e.length>>>0;if("function"!=typeof r)throw TypeError("predicate must be a function");for(var n=arguments[1],i=0;i<t;){var o=e[i];if(r.call(n,o,i,e))return o;i++}},configurable:!0,writable:!0}),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(r){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),t=e.length>>>0;if("function"!=typeof r)throw new TypeError("predicate must be a function");for(var n=arguments[1],i=0;i<t;){var o=e[i];if(r.call(n,o,i,e))return i;i++}return-1},configurable:!0,writable:!0});
/** gridstack.js 1.1.1 - IE and older browsers Polyfills for this library @preserve*/
"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r}),Number.isNaN=Number.isNaN||function(e){return"number"==typeof e&&e!=e},Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<r;){var i=t[o];if(e.call(n,i,o,t))return i;o++}},configurable:!0,writable:!0}),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<r;){var i=t[o];if(e.call(n,i,o,t))return o;o++}return-1},configurable:!0,writable:!0});
//# sourceMappingURL=gridstack.min.map

@@ -1,2 +0,2 @@

// Type definitions for Gridstack 1.1.0
// Type definitions for Gridstack 1.1.1
// Project: https://gridstackjs.com/

@@ -572,2 +572,8 @@ // Definitions by: Pascal Senn <https://github.com/PascalSenn>

/**
* minimum rows amount. Default is `0`. You can also do this with `min-height` CSS attribute
* on the grid div in pixels, which will round to the closest row.
*/
minRow?: number;
/**

@@ -610,2 +616,8 @@ * minimal width. If window width is less, grid will be shown in one column mode (default?: 768)

/**
* fix grid number of rows. This is a shortcut of writing `minRow:N, maxRow:N`.
* (default `0` no constrain)
*/
row?: number;
/**
* if true turns grid to RTL. Possible values are true, false, 'auto' (default?: 'auto')

@@ -612,0 +624,0 @@ * See [example](http://gridstack.github.io/gridstack.js/demo/rtl.html)

@@ -1,2 +0,2 @@

/** gridstack.js 1.1.0 - JQuery UI Drag&Drop plugin @preserve */
/** gridstack.js 1.1.1 - JQuery UI Drag&Drop plugin @preserve */
/**

@@ -34,3 +34,3 @@ * https://gridstackjs.com/

el = $(el);
if (opts === 'disable' || opts === 'enable') {
if (opts === 'disable' || opts === 'enable' || opts === 'destroy') {
el.resizable(opts);

@@ -57,3 +57,3 @@ } else if (opts === 'option') {

el = $(el);
if (opts === 'disable' || opts === 'enable') {
if (opts === 'disable' || opts === 'enable' || opts === 'destroy') {
el.draggable(opts);

@@ -60,0 +60,0 @@ } else {

@@ -1,3 +0,3 @@

/** gridstack.js 1.1.0 - JQuery UI Drag&Drop plugin @preserve */
!function(){function t(t){e.DragDropPlugin.call(this,t)}var a,e,r;a=jQuery,e=GridStack,r=window,e.DragDropPlugin.registerPlugin(t),((t.prototype=Object.create(e.DragDropPlugin.prototype)).constructor=t).prototype.resizable=function(t,e){if(t=a(t),"disable"===e||"enable"===e)t.resizable(e);else if("option"===e){var r=arguments[2],i=arguments[3];t.resizable(e,r,i)}else{var n=t.data("gs-resize-handles")?t.data("gs-resize-handles"):this.grid.opts.resizable.handles;t.resizable(a.extend({},this.grid.opts.resizable,{handles:n},{start:e.start||function(){},stop:e.stop||function(){},resize:e.resize||function(){}}))}return this},t.prototype.draggable=function(t,e){return t=a(t),"disable"===e||"enable"===e?t.draggable(e):t.draggable(a.extend({},this.grid.opts.draggable,{containment:this.grid.opts.isNested&&!this.grid.opts.dragOut?this.grid.$el.parent():this.grid.opts.draggable.containment||null,start:e.start||function(){},stop:e.stop||function(){},drag:e.drag||function(){}})),this},t.prototype.droppable=function(t,e){return(t=a(t)).droppable(e),this},t.prototype.isDroppable=function(t,e){return t=a(t),Boolean(t.data("droppable"))},t.prototype.on=function(t,e,r){return a(t).on(e,r),this},r.JQueryUIGridStackDragDropPlugin=t}();
/** gridstack.js 1.1.1 - JQuery UI Drag&Drop plugin @preserve */
!function(){function t(t){e.DragDropPlugin.call(this,t)}var o,e,r;o=jQuery,e=GridStack,r=window,e.DragDropPlugin.registerPlugin(t),((t.prototype=Object.create(e.DragDropPlugin.prototype)).constructor=t).prototype.resizable=function(t,e){if(t=o(t),"disable"===e||"enable"===e||"destroy"===e)t.resizable(e);else if("option"===e){var r=arguments[2],i=arguments[3];t.resizable(e,r,i)}else{var n=t.data("gs-resize-handles")?t.data("gs-resize-handles"):this.grid.opts.resizable.handles;t.resizable(o.extend({},this.grid.opts.resizable,{handles:n},{start:e.start||function(){},stop:e.stop||function(){},resize:e.resize||function(){}}))}return this},t.prototype.draggable=function(t,e){return t=o(t),"disable"===e||"enable"===e||"destroy"===e?t.draggable(e):t.draggable(o.extend({},this.grid.opts.draggable,{containment:this.grid.opts.isNested&&!this.grid.opts.dragOut?this.grid.$el.parent():this.grid.opts.draggable.containment||null,start:e.start||function(){},stop:e.stop||function(){},drag:e.drag||function(){}})),this},t.prototype.droppable=function(t,e){return(t=o(t)).droppable(e),this},t.prototype.isDroppable=function(t,e){return t=o(t),Boolean(t.data("droppable"))},t.prototype.on=function(t,e,r){return o(t).on(e,r),this},r.JQueryUIGridStackDragDropPlugin=t}();
//# sourceMappingURL=gridstack.min.map
/**
* gridstack.js 1.1.0
* gridstack.js 1.1.1
* https://gridstackjs.com/

@@ -8,3 +8,3 @@ * (c) 2014-2020 Alain Dumesny, Dylan Weiss, Pavel Reznikov

*/
!function(f,t){var e=function(t,e,i,o){var n=function(){console.warn("gridstack.js: Function `"+e+"` is deprecated in "+o+" and has been replaced "+"with `"+i+"`. It will be **completely** removed in v1.0");return t.apply(this,arguments)};n.prototype=t.prototype;return n},l=function(t,e,i,o){if(t[e]!==undefined){t[i]=t[e];console.warn("gridstack.js: Option `"+e+"` is deprecated in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}},g=function(t,e,i,o){if(t[e]!==undefined){console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+o)}},m=function(t,e,i,o){var n=t.attr(e);if(n!==undefined){t.attr(i,n);console.warn("gridstack.js: attribute `"+e+"`="+n+" is deprecated on this object in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}},v={isIntercepted:function(t,e){return!(t.x+t.width<=e.x||e.x+e.width<=t.x||t.y+t.height<=e.y||e.y+e.height<=t.y)},sort:function(t,e,i){if(!i){var o=t.map(function(t){return t.x+t.width});i=Math.max.apply(Math,o)}if(e===-1)return v.sortBy(t,function(t){return-(t.x+t.y*i)});else return v.sortBy(t,function(t){return t.x+t.y*i})},createStylesheet:function(t,e){var i=document.createElement("style");i.setAttribute("type","text/css");i.setAttribute("data-gs-style-id",t);if(i.styleSheet){i.styleSheet.cssText=""}else{i.appendChild(document.createTextNode(""))}if(!e){e=document.getElementsByTagName("head")[0]}e.insertBefore(i,e.firstChild);return i.sheet},removeStylesheet:function(t){f("STYLE[data-gs-style-id="+t+"]").remove()},insertCSSRule:function(t,e,i,o){if(typeof t.insertRule==="function"){t.insertRule(e+"{"+i+"}",o)}else if(typeof t.addRule==="function"){t.addRule(e,i,o)}},toBool:function(t){if(typeof t==="boolean"){return t}if(typeof t==="string"){t=t.toLowerCase();return!(t===""||t==="no"||t==="false"||t==="0")}return Boolean(t)},_collisionNodeCheck:function(t){return t!==this.node&&v.isIntercepted(t,this.nn)},_didCollide:function(t){return v.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},t)},_isAddNodeIntercepted:function(t){return v.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},t)},parseHeight:function(t){var e=t;var i="px";if(e&&typeof e==="string"){var o=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!o){throw new Error("Invalid height")}i=o[2]||"px";e=parseFloat(o[1])}return{height:e,unit:i}},without:function(t,e){var i=t.indexOf(e);if(i!==-1){t=t.slice(0);t.splice(i,1)}return t},sortBy:function(t,n){return t.slice(0).sort(function(t,e){var i=n(t);var o=n(e);if(o===i){return 0}return i>o?1:-1})},defaults:function(i){var t=Array.prototype.slice.call(arguments,1);t.forEach(function(t){for(var e in t){if(t.hasOwnProperty(e)&&(!i.hasOwnProperty(e)||i[e]===undefined)){i[e]=t[e]}}});return i},clone:function(t){return f.extend({},t)},throttle:function(t,e){var i=false;return function(){if(!i){t.apply(this,arguments);i=true;setTimeout(function(){i=false},e)}}},removePositioningStyles:function(t){var e=t[0].style;if(e.position){e.removeProperty("position")}if(e.left){e.removeProperty("left")}if(e.top){e.removeProperty("top")}if(e.width){e.removeProperty("width")}if(e.height){e.removeProperty("height")}},getScrollParent:function(t){var e;if(t===null){e=null}else if(t.scrollHeight>t.clientHeight){e=t}else{e=v.getScrollParent(t.parentNode)}return e},updateScrollPosition:function(t,e,i){var o=t.getBoundingClientRect();var n=window.innerHeight||document.documentElement.clientHeight;if(o.top<0||o.bottom>n){var a=o.bottom-n;var s=o.top;var r=v.getScrollParent(t);if(r!==null){var d=r.scrollTop;if(o.top<0&&i<0){if(t.offsetHeight>n){r.scrollTop+=i}else{r.scrollTop+=Math.abs(s)>Math.abs(i)?i:s}}else if(i>0){if(t.offsetHeight>n){r.scrollTop+=i}else{r.scrollTop+=a>i?i:a}}e.position.top+=r.scrollTop-d}}}};function _(t){this.grid=t}_.registeredPlugins=[],_.registerPlugin=function(t){_.registeredPlugins.push(t)},_.prototype.resizable=function(t,e){return this},_.prototype.draggable=function(t,e){return this},_.prototype.droppable=function(t,e){return this},_.prototype.isDroppable=function(t){return false},_.prototype.on=function(t,e,i){return this};var a=0,y=function(t,e,i,o,n){this.column=t||12;this.float=i||false;this.maxRow=o||0;this.nodes=n||[];this.onchange=e||function(){};this._addedNodes=[];this._removedNodes=[];this._batchMode=false};y.prototype.batchUpdate=function(){if(this._batchMode)return;this._batchMode=true;this._prevFloat=this.float;this.float=true},y.prototype.commit=function(){if(!this._batchMode)return;this._batchMode=false;this.float=this._prevFloat;delete this._prevFloat;this._packNodes();this._notify()},y.prototype.getNodeDataByDOMEl=function(e){return this.nodes.find(function(t){return e===t.el})},y.prototype._fixCollisions=function(t){var e=this;this._sortNodes(-1);var i=t;var o=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.float&&!o){i={x:0,y:t.y,width:this.column,height:t.height}}while(true){var n=this.nodes.find(v._collisionNodeCheck,{node:t,nn:i});if(!n){return}var a=this.moveNode(n,n.x,t.y+t.height,n.width,n.height,true);if(!a){return}}},y.prototype.isAreaEmpty=function(t,e,i,o){var n={x:t||0,y:e||0,width:i||1,height:o||1};var a=this.nodes.find(function(t){return v.isIntercepted(t,n)});return!a},y.prototype._sortNodes=function(t){this.nodes=v.sort(this.nodes,t,this.column)},y.prototype._packNodes=function(){this._sortNodes();if(this.float){this.nodes.forEach(function(t,e){if(t._updating||t._packY===undefined||t.y===t._packY){return}var i=t.y;while(i>=t._packY){var o=this.nodes.slice(0,e).find(v._didCollide,{n:t,newY:i});if(!o){t._dirty=true;t.y=i}--i}},this)}else{this.nodes.forEach(function(t,e){if(t.locked){return}while(t.y>0){var i=t.y-1;var o=e===0;if(e>0){var n=this.nodes.slice(0,e).find(v._didCollide,{n:t,newY:i});o=n===undefined}if(!o){break}t._dirty=t.y!==i;t.y=i}},this)}},y.prototype._prepareNode=function(t,e){t=t||{};if(t.x===undefined||t.y===undefined||t.x===null||t.y===null){t.autoPosition=true}var i={width:1,height:1,x:0,y:0};t=v.defaults(t,i);t.x=parseInt(t.x);t.y=parseInt(t.y);t.width=parseInt(t.width);t.height=parseInt(t.height);t.autoPosition=t.autoPosition||false;t.noResize=t.noResize||false;t.noMove=t.noMove||false;if(Number.isNaN(t.x)){t.x=i.x;t.autoPosition=true}if(Number.isNaN(t.y)){t.y=i.y;t.autoPosition=true}if(Number.isNaN(t.width)){t.width=i.width}if(Number.isNaN(t.height)){t.height=i.height}if(t.maxWidth!==undefined){t.width=Math.min(t.width,t.maxWidth)}if(t.maxHeight!==undefined){t.height=Math.min(t.height,t.maxHeight)}if(t.minWidth!==undefined){t.width=Math.max(t.width,t.minWidth)}if(t.minHeight!==undefined){t.height=Math.max(t.height,t.minHeight)}if(t.width>this.column){t.width=this.column}else if(t.width<1){t.width=1}if(this.maxRow&&t.height>this.maxRow){t.height=this.maxRow}else if(t.height<1){t.height=1}if(t.x<0){t.x=0}if(t.y<0){t.y=0}if(t.x+t.width>this.column){if(e){t.width=this.column-t.x}else{t.x=this.column-t.width}}if(this.maxRow&&t.y+t.height>this.maxRow){if(e){t.height=this.maxRow-t.y}else{t.y=this.maxRow-t.height}}return t},y.prototype._notify=function(){if(this._batchMode){return}var t=Array.prototype.slice.call(arguments,0);t[0]=t[0]===undefined?[]:Array.isArray(t[0])?t[0]:[t[0]];t[1]=t[1]===undefined?true:t[1];var e=t[0].concat(this.getDirtyNodes());this.onchange(e,t[1])},y.prototype.cleanNodes=function(){if(this._batchMode){return}this.nodes.forEach(function(t){delete t._dirty})},y.prototype.getDirtyNodes=function(t){if(t){var e=[];this.nodes.forEach(function(t){if(t._dirty){if(t.y===t._origY&&t.x===t._origX&&t.width===t._origW&&t.height===t._origH){delete t._dirty}else{e.push(t)}}});return e}return this.nodes.filter(function(t){return t._dirty})},y.prototype.addNode=function(t,e){t=this._prepareNode(t);t._id=t._id||++a;if(t.autoPosition){this._sortNodes();for(var i=0;;++i){var o=i%this.column;var n=Math.floor(i/this.column);if(o+t.width>this.column){continue}if(!this.nodes.find(v._isAddNodeIntercepted,{x:o,y:n,node:t})){t.x=o;t.y=n;delete t.autoPosition;break}}}this.nodes.push(t);if(e){this._addedNodes.push(t)}this._fixCollisions(t);this._packNodes();this._notify();return t},y.prototype.removeNode=function(t,e){e=e===undefined?true:e;this._removedNodes.push(t);t._id=null;this.nodes=v.without(this.nodes,t);this._packNodes();this._notify(t,e)},y.prototype.removeAll=function(t){delete this._layouts;if(this.nodes.length===0){return}t=t===undefined?true:t;this.nodes.forEach(function(t){t._id=null});this._removedNodes=this.nodes;this.nodes=[];this._notify(this._removedNodes,t)},y.prototype.canMoveNode=function(e,t,i,o,n){if(!this.isNodeChangedPosition(e,t,i,o,n)){return false}var a=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.maxRow&&!a){return true}var s;var r=new y(this.column,null,this.float,0,this.nodes.map(function(t){if(t===e){s=f.extend({},t);return s}return f.extend({},t)}));if(!s){return true}r.moveNode(s,t,i,o,n);var d=true;if(a){d&=!Boolean(r.nodes.find(function(t){return t!==s&&Boolean(t.locked)&&Boolean(t._dirty)}))}if(this.maxRow){d&=r.getRow()<=this.maxRow}return d},y.prototype.canBePlacedWithRespectToHeight=function(t){if(!this.maxRow){return true}var e=new y(this.column,null,this.float,0,this.nodes.map(function(t){return f.extend({},t)}));e.addNode(t);return e.getRow()<=this.maxRow},y.prototype.isNodeChangedPosition=function(t,e,i,o,n){if(typeof e!=="number"){e=t.x}if(typeof i!=="number"){i=t.y}if(typeof o!=="number"){o=t.width}if(typeof n!=="number"){n=t.height}if(t.maxWidth!==undefined){o=Math.min(o,t.maxWidth)}if(t.maxHeight!==undefined){n=Math.min(n,t.maxHeight)}if(t.minWidth!==undefined){o=Math.max(o,t.minWidth)}if(t.minHeight!==undefined){n=Math.max(n,t.minHeight)}if(t.x===e&&t.y===i&&t.width===o&&t.height===n){return false}return true},y.prototype.moveNode=function(t,e,i,o,n,a){if(typeof e!=="number"){e=t.x}if(typeof i!=="number"){i=t.y}if(typeof o!=="number"){o=t.width}if(typeof n!=="number"){n=t.height}var s=t.width!==o||t.height!==n;var r={x:e,y:i,width:o,height:n,maxWidth:t.maxWidth,maxHeight:NodeIterator.maxHeight,minWidth:t.minWidth,minHeight:t.minHeight};r=this._prepareNode(r,s);if(t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height){return null}t._dirty=true;t.x=t.lastTriedX=r.x;t.y=t.lastTriedY=r.y;t.width=t.lastTriedWidth=r.width;t.height=t.lastTriedHeight=r.height;this._fixCollisions(t);if(!a){this._packNodes();this._notify()}return t},y.prototype.getRow=function(){return this.nodes.reduce(function(t,e){return Math.max(t,e.y+e.height)},0)},y.prototype.beginUpdate=function(t){if(t._updating)return;t._updating=true;this.nodes.forEach(function(t){t._packY=t.y})},y.prototype.endUpdate=function(){var t=this.nodes.find(function(t){return t._updating});if(t){t._updating=false;this.nodes.forEach(function(t){delete t._packY})}};var n=function(t,e){var u=this;var i,o,n;e=e||{};this.$el=f(t);this.el=this.$el.get(0);l(e,"width","column","v0.5.3");l(e,"height","maxRow","v0.5.3");g(e,"oneColumnModeClass","v0.6.3",". Use class `.grid-stack-1` instead");m(this.$el,"data-gs-width","data-gs-column","v0.5.3");m(this.$el,"data-gs-height","data-gs-max-row","v0.5.3");m(this.$el,"data-gs-current-height","data-gs-current-row","v1.0.0");e.itemClass=e.itemClass||"grid-stack-item";var a=this.$el.closest("."+e.itemClass).length>0;if(e.row){e.minRow=e.maxRow=e.row;delete e.row}var s=parseInt(this.$el.attr("data-gs-row"));this.opts=v.defaults(e,{column:parseInt(this.$el.attr("data-gs-column"))||12,minRow:s?s:parseInt(this.$el.attr("data-gs-min-row"))||0,maxRow:s?s:parseInt(this.$el.attr("data-gs-max-row"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,cellHeight:60,verticalMargin:20,auto:true,minWidth:768,float:false,staticGrid:false,_class:"grid-stack-instance-"+(Math.random()*1e4).toFixed(0),animate:Boolean(this.$el.attr("data-gs-animate"))||false,alwaysShowResizeHandle:e.alwaysShowResizeHandle||false,resizable:v.defaults(e.resizable||{},{autoHide:!(e.alwaysShowResizeHandle||false),handles:"se"}),draggable:v.defaults(e.draggable||{},{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:false,appendTo:"body"}),disableDrag:e.disableDrag||false,disableResize:e.disableResize||false,rtl:"auto",removable:false,removableOptions:v.defaults(e.removableOptions||{},{accept:"."+e.itemClass}),removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:e.disableOneColumnMode||false,oneColumnModeDomSort:e.oneColumnModeDomSort,ddPlugin:null});if(this.opts.ddPlugin===false){this.opts.ddPlugin=_}else if(this.opts.ddPlugin===null){this.opts.ddPlugin=_.registeredPlugins[0]||_}this.dd=new this.opts.ddPlugin(this);if(this.opts.rtl==="auto"){this.opts.rtl=this.$el.css("direction")==="rtl"}if(this.opts.rtl){this.$el.addClass("grid-stack-rtl")}this.opts.isNested=a;n=this.opts.cellHeight==="auto";if(n){u.cellHeight(u.cellWidth(),true)}else{this.cellHeight(this.opts.cellHeight,true)}this.verticalMargin(this.opts.verticalMargin,true);this.$el.addClass(this.opts._class);this._setStaticClass();if(a){this.$el.addClass("grid-stack-nested")}this._initStyles();this.engine=new y(this.opts.column,function(t,e){e=e===undefined?true:e;var i=0;this.nodes.forEach(function(t){i=Math.max(i,t.y+t.height)});t.forEach(function(t){if(e&&t._id===null){if(t.el){f(t.el).remove()}}else{f(t.el).attr("data-gs-x",t.x).attr("data-gs-y",t.y).attr("data-gs-width",t.width).attr("data-gs-height",t.height)}});u._updateStyles(i+10)},this.opts.float,this.opts.maxRow);if(this.opts.auto){var r=[];var d=this;this.$el.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(t,e){e=f(e);var i=parseInt(e.attr("data-gs-x"));var o=parseInt(e.attr("data-gs-y"));r.push({el:e.get(0),i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(o)?1e3:o)*d.opts.column})});v.sortBy(r,function(t){return t.i}).forEach(function(t){this._prepareElement(t.el)},this)}this.engine._saveInitial();this.setAnimation(this.opts.animate);this.placeholder=f('<div class="'+this.opts.placeholderClass+" "+this.opts.itemClass+'">'+'<div class="placeholder-content">'+this.opts.placeholderText+"</div></div>").hide();this._updateContainerHeight();this._updateHeightsOnResize=v.throttle(function(){u.cellHeight(u.cellWidth(),false)},100);this.onResizeHandler=function(){if(n){u._updateHeightsOnResize()}if(u.opts.staticGrid){return}if(!u.opts.disableOneColumnMode&&(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=u.opts.minWidth){if(u.oneColumnMode){return}u.oneColumnMode=true;u.column(1)}else{if(!u.oneColumnMode){return}u.oneColumnMode=false;u.column(u._prevColumn)}};f(window).resize(this.onResizeHandler);this.onResizeHandler();if(!u.opts.staticGrid&&typeof u.opts.removable==="string"){var h=f(u.opts.removable);if(!this.dd.isDroppable(h)){this.dd.droppable(h,u.opts.removableOptions)}this.dd.on(h,"dropover",function(t,e){var i=f(e.draggable);var o=i.data("_gridstack_node");if(!o||o._grid!==u){return}i.data("inTrashZone",true);u._setupRemovingTimeout(i)}).on(h,"dropout",function(t,e){var i=f(e.draggable);var o=i.data("_gridstack_node");if(!o||o._grid!==u){return}i.data("inTrashZone",false);u._clearRemovingTimeout(i)})}if(!u.opts.staticGrid&&u.opts.acceptWidgets){var c=null;var p=function(t,e){var i=c;var o=i.data("_gridstack_node");var n=u.getCellFromPixel({left:t.pageX,top:t.pageY},true);var a=Math.max(0,n.x);var s=Math.max(0,n.y);if(!o._added){o._added=true;o.el=i.get(0);o.autoPosition=true;o.x=a;o.y=s;u.engine.cleanNodes();u.engine.beginUpdate(o);u.engine.addNode(o);u.$el.append(u.placeholder);u.placeholder.attr("data-gs-x",o.x).attr("data-gs-y",o.y).attr("data-gs-width",o.width).attr("data-gs-height",o.height).show();o.el=u.placeholder.get(0);o._beforeDragX=o.x;o._beforeDragY=o.y;u._updateContainerHeight()}if(!u.engine.canMoveNode(o,a,s)){return}u.engine.moveNode(o,a,s);u._updateContainerHeight()};this.dd.droppable(u.$el,{accept:function(t){t=f(t);var e=t.data("_gridstack_node");if(e&&e._grid===u){return false}return t.is(u.opts.acceptWidgets===true?".grid-stack-item":u.opts.acceptWidgets)}}).on(u.$el,"dropover",function(t,e){var i=f(e.draggable);var o,n;var a=i.data("_gridstack_node");if(!a||!a.width||!a.height){var s=parseInt(i.attr("data-gs-width"));if(s>0){a=a||{};a.width=s}var r=parseInt(i.attr("data-gs-height"));if(r>0){a=a||{};a.height=r}}var d=u.cellWidth();var h=u.cellHeight();var l=u.opts.verticalMargin;o=a&&a.width?a.width:Math.ceil(i.outerWidth()/d);n=a&&a.height?a.height:Math.round((i.outerHeight()+l)/(h+l));c=i;var g=u.engine._prepareNode({width:o,height:n,_added:false,_temporary:true});g.isOutOfGrid=true;i.data("_gridstack_node",g);i.data("_gridstack_node_orig",a);i.on("drag",p);return false}).on(u.$el,"dropout",function(t,e){var i=f(e.draggable);if(!i.data("_gridstack_node")){return}var o=i.data("_gridstack_node");if(!o.isOutOfGrid){return}i.unbind("drag",p);o.el=null;u.engine.removeNode(o);u.placeholder.detach();u._updateContainerHeight();i.data("_gridstack_node",i.data("_gridstack_node_orig"));return false}).on(u.$el,"drop",function(t,e){u.placeholder.detach();var i=f(e.draggable).data("_gridstack_node");i.isOutOfGrid=false;i._grid=u;var o=f(e.draggable).clone(false);o.data("_gridstack_node",i);var n=f(e.draggable).data("_gridstack_node_orig");if(n!==undefined&&n._grid!==undefined){n._grid._triggerRemoveEvent()}f(e.helper).remove();i.el=o.get(0);u.placeholder.hide();v.removePositioningStyles(o);o.find("div.ui-resizable-handle").remove();o.attr("data-gs-x",i.x).attr("data-gs-y",i.y).attr("data-gs-width",i.width).attr("data-gs-height",i.height).addClass(u.opts.itemClass).enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",p);u.$el.append(o);u._prepareElementsByNode(o,i);u._updateContainerHeight();u.engine._addedNodes.push(i);u._triggerAddEvent();u._triggerChangeEvent();u.engine.endUpdate();f(e.draggable).unbind("drag",p);f(e.draggable).removeData("_gridstack_node");f(e.draggable).removeData("_gridstack_node_orig");u.$el.trigger("dropped",[n,i]);return false})}};n.prototype._triggerChangeEvent=function(){if(!this.engine._batchMode){var t=this.engine.getDirtyNodes(!0);t&&t.length&&(this.engine._layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine._saveInitial()}},n.prototype._triggerAddEvent=function(){this.engine._batchMode||this.engine._addedNodes&&0<this.engine._addedNodes.length&&(this.engine._layoutsNodesChange(this.engine._addedNodes),this.engine._addedNodes.forEach(function(t){delete t._dirty}),this._triggerEvent("added",this.engine._addedNodes),this.engine._addedNodes=[])},n.prototype._triggerRemoveEvent=function(){this.engine._batchMode||this.engine._removedNodes&&0<this.engine._removedNodes.length&&(this._triggerEvent("removed",this.engine._removedNodes),this.engine._removedNodes=[])},n.prototype._triggerEvent=function(t,e){var i=new CustomEvent(t,{detail:e});this.el.dispatchEvent(i)},n.prototype._initStyles=function(){this._stylesId&&v.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=v.createStylesheet(this._stylesId,this.el.parentNode),null!==this._styles&&(this._styles._max=0)},n.prototype._updateStyles=function(t){if(null!==this._styles&&void 0!==this._styles){var e,i="."+this.opts._class+" ."+this.opts.itemClass,o=this;if(void 0===t&&(t=this._styles._max),this._initStyles(),this._updateContainerHeight(),this.opts.cellHeight&&!(0!==this._styles._max&&t<=this._styles._max)&&(e=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(t,e){return t&&e?"calc("+(o.opts.cellHeight*t+o.opts.cellHeightUnit)+" + "+(o.opts.verticalMargin*e+o.opts.verticalMarginUnit)+")":o.opts.cellHeight*t+o.opts.verticalMargin*e+o.opts.cellHeightUnit}:function(t,e){return o.opts.cellHeight*t+o.opts.verticalMargin*e+o.opts.cellHeightUnit},0===this._styles._max&&v.insertCSSRule(this._styles,i,"min-height: "+e(1,0)+";",0),t>this._styles._max)){for(var n=this._styles._max;n<t;++n)v.insertCSSRule(this._styles,i+'[data-gs-height="'+(n+1)+'"]',"height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-min-height="'+(n+1)+'"]',"min-height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-max-height="'+(n+1)+'"]',"max-height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-y="'+n+'"]',"top: "+e(n,n)+";",n);this._styles._max=t}}},n.prototype._updateContainerHeight=function(){if(!this.engine._batchMode){var t=this.engine.getRow();t<this.opts.minRow&&(t=this.opts.minRow);var e=parseInt(this.$el.css("min-height"));if(0<e){var i=this.opts.verticalMargin,o=Math.round((e+i)/(this.cellHeight()+i));t<o&&(t=o)}this.$el.attr("data-gs-current-row",t),this.opts.cellHeight&&(this.opts.verticalMargin?this.opts.cellHeightUnit===this.opts.verticalMarginUnit?this.$el.css("height",t*(this.opts.cellHeight+this.opts.verticalMargin)-this.opts.verticalMargin+this.opts.cellHeightUnit):this.$el.css("height","calc("+(t*this.opts.cellHeight+this.opts.cellHeightUnit)+" + "+(t*(this.opts.verticalMargin-1)+this.opts.verticalMarginUnit)+")"):this.$el.css("height",t*this.opts.cellHeight+this.opts.cellHeightUnit))}},n.prototype._setupRemovingTimeout=function(t){var e=f(t).data("_gridstack_node");!e._removeTimeout&&this.opts.removable&&(e._removeTimeout=setTimeout(function(){t.addClass("grid-stack-item-removing"),e._isAboutToRemove=!0},this.opts.removeTimeout))},n.prototype._clearRemovingTimeout=function(t){var e=f(t).data("_gridstack_node");e._removeTimeout&&(clearTimeout(e._removeTimeout),e._removeTimeout=null,t.removeClass("grid-stack-item-removing"),e._isAboutToRemove=!1)},n.prototype._prepareElementsByNode=function(h,l){function t(t,e){var i,o,n=Math.round(e.position.left/g),a=Math.floor((e.position.top+u/2)/u);if("drag"===t.type){var s=e.position.top-l._prevYPix;if(l._prevYPix=e.position.top,v.updateScrollPosition(h[0],e,s),h.data("inTrashZone")||n<0||n>=c.engine.column||a<0||!c.engine.float&&a>c.engine.getRow()){if(l._temporaryRemoved)return;!0===c.opts.removable&&c._setupRemovingTimeout(h),n=l._beforeDragX,a=l._beforeDragY,c.placeholder.detach(),c.placeholder.hide(),c.engine.removeNode(l),c._updateContainerHeight(),l._temporaryRemoved=!0}else c._clearRemovingTimeout(h),l._temporaryRemoved&&(c.engine.addNode(l),c.placeholder.attr("data-gs-x",n).attr("data-gs-y",a).attr("data-gs-width",i).attr("data-gs-height",o).show(),c.$el.append(c.placeholder),l.el=c.placeholder.get(0),l._temporaryRemoved=!1)}else if("resize"===t.type){if(n<0)return;i=Math.round(e.size.width/g),o=Math.round((e.size.height+c.verticalMargin())/u)}var r=void 0!==i?i:l.lastTriedWidth,d=void 0!==o?o:l.lastTriedHeight;!c.engine.canMoveNode(l,n,a,i,o)||l.lastTriedX===n&&l.lastTriedY===a&&l.lastTriedWidth===r&&l.lastTriedHeight===d||(l.lastTriedX=n,l.lastTriedY=a,l.lastTriedWidth=i,l.lastTriedHeight=o,c.engine.moveNode(l,n,a,i,o),c._updateContainerHeight(),"resize"===t.type&&f(t.target).trigger("gsresize",l))}function e(t,e){c.$el.append(c.placeholder);var i=f(this);c.engine.cleanNodes(),c.engine.beginUpdate(l),g=c.cellWidth();var o=c.cellHeight();u=(c.$el.height()+c.verticalMargin())/parseInt(c.$el.attr("data-gs-current-row")),c.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),l.el=c.placeholder.get(0),l._beforeDragX=l.x,l._beforeDragY=l.y,l._prevYPix=e.position.top;var n=l.minHeight||1,a=c.opts.verticalMargin;c.dd.resizable(h,"option","minWidth",g*(l.minWidth||1)),c.dd.resizable(h,"option","minHeight",o*n+(n-1)*a),"resizestart"===t.type&&i.find(".grid-stack-item").trigger("resizestart")}function i(t,e){var i=f(this);if(i.data("_gridstack_node")){if(c.placeholder.detach(),l.el=i.get(0),c.placeholder.hide(),l._isAboutToRemove)h.data("_gridstack_node")._grid._triggerRemoveEvent(),h.removeData("_gridstack_node"),h.remove();else c._clearRemovingTimeout(h),l._temporaryRemoved?(v.removePositioningStyles(i),i.attr("data-gs-x",l._beforeDragX).attr("data-gs-y",l._beforeDragY).attr("data-gs-width",l.width).attr("data-gs-height",l.height),l.x=l._beforeDragX,l.y=l._beforeDragY,l._temporaryRemoved=!1,c.engine.addNode(l)):(v.removePositioningStyles(i),i.attr("data-gs-x",l.x).attr("data-gs-y",l.y).attr("data-gs-width",l.width).attr("data-gs-height",l.height));c._updateContainerHeight(),c._triggerChangeEvent(),c.engine.endUpdate();var o=i.find(".grid-stack");o.length&&"resizestop"===t.type&&(o.each(function(t,e){e.gridstack.onResizeHandler()}),i.find(".grid-stack-item").trigger("resizestop"),i.find(".grid-stack-item").trigger("gsresizestop")),"resizestop"===t.type&&c.$el.trigger("gsresizestop",i)}}var g,u,c=this;this.dd.draggable(h,{start:e,stop:i,drag:t}).resizable(h,{start:e,stop:i,resize:t}),(l.noMove||this.opts.disableDrag||this.opts.staticGrid)&&this.dd.draggable(h,"disable"),(l.noResize||this.opts.disableResize||this.opts.staticGrid)&&this.dd.resizable(h,"disable"),this._writeAttr(h,l)},n.prototype._prepareElement=function(t,e){e=void 0!==e&&e;(t=f(t)).addClass(this.opts.itemClass);var i=this._readAttr(t,{el:t.get(0),_grid:this});i=this.engine.addNode(i,e),t.data("_gridstack_node",i),this._prepareElementsByNode(t,i)},n.prototype._writeAttr=function(t,e){t=f(t),void 0!==(e=e||{}).x&&t.attr("data-gs-x",e.x),void 0!==e.y&&t.attr("data-gs-y",e.y),void 0!==e.width&&t.attr("data-gs-width",e.width),void 0!==e.height&&t.attr("data-gs-height",e.height),void 0!==e.autoPosition&&t.attr("data-gs-auto-position",!!e.autoPosition||null),void 0!==e.minWidth&&t.attr("data-gs-min-width",e.minWidth),void 0!==e.maxWidth&&t.attr("data-gs-max-width",e.maxWidth),void 0!==e.minHeight&&t.attr("data-gs-min-height",e.minHeight),void 0!==e.maxHeight&&t.attr("data-gs-max-height",e.maxHeight),void 0!==e.noResize&&t.attr("data-gs-no-resize",!!e.noResize||null),void 0!==e.noMove&&t.attr("data-gs-no-move",!!e.noMove||null),void 0!==e.locked&&t.attr("data-gs-locked",!!e.locked||null),void 0!==e.resizeHandles&&t.attr("data-gs-resize-handles",e.resizeHandles),void 0!==e.id&&t.attr("data-gs-id",e.id)},n.prototype._readAttr=function(t,e){return t=f(t),(e=e||{}).x=t.attr("data-gs-x"),e.y=t.attr("data-gs-y"),e.width=t.attr("data-gs-width"),e.height=t.attr("data-gs-height"),e.autoPosition=v.toBool(t.attr("data-gs-auto-position")),e.maxWidth=t.attr("data-gs-max-width"),e.minWidth=t.attr("data-gs-min-width"),e.maxHeight=t.attr("data-gs-max-height"),e.minHeight=t.attr("data-gs-min-height"),e.noResize=v.toBool(t.attr("data-gs-no-resize")),e.noMove=v.toBool(t.attr("data-gs-no-move")),e.locked=v.toBool(t.attr("data-gs-locked")),e.resizeHandles=t.attr("data-gs-resize-handles"),e.id=t.attr("data-gs-id"),e},n.prototype.setAnimation=function(t){t?this.$el.addClass("grid-stack-animate"):this.$el.removeClass("grid-stack-animate")},n.prototype.addWidget=function(t,e,i,o,n,a,s,r,d,h,l){return void 0!==e&&"object"!=typeof e?this.addWidget(t,{x:e,y:i,width:o,height:n,autoPosition:a,minWidth:s,maxWidth:r,minHeight:d,maxHeight:h,id:l}):(t=f(t),e&&this.engine._prepareNode(e),this._writeAttr(t,e),this.$el.append(t),this.makeWidget(t))},n.prototype.makeWidget=function(t){return t=f(t),this._prepareElement(t,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(!0),t.get(0)},n.prototype.willItFit=function(t,e,i,o,n){var a={x:t,y:e,width:i,height:o,autoPosition:n};return this.engine.canBePlacedWithRespectToHeight(a)},n.prototype.removeWidget=function(t,e){e=void 0===e||e;var i=(t=f(t)).data("_gridstack_node");i=i||this.engine.getNodeDataByDOMEl(t.get(0)),t.removeData("_gridstack_node"),this.engine.removeNode(i,e),this._triggerRemoveEvent(),this._triggerChangeEvent(!0)},n.prototype.removeAll=function(t){!1!==t&&this.engine.nodes.forEach(function(t){f(t.el).removeData("_gridstack_node")}),this.engine.removeAll(t),this._triggerRemoveEvent()},n.prototype.destroy=function(t){f(window).off("resize",this.onResizeHandler),this.disable(),void 0===t||t?this.$el.remove():(this.removeAll(!1),delete this.$el.get(0).gridstack),v.removeStylesheet(this._stylesId),this.engine&&(this.engine=null)},n.prototype.resizable=function(t,o){var n=this;return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.noResize=!o,i.noResize?n.dd.resizable(e,"disable"):n.dd.resizable(e,"enable"))}),this},n.prototype.movable=function(t,o){var n=this;return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.noMove=!o,i.noMove?(n.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(n.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},n.prototype.enableMove=function(t,e){this.movable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableDrag=!t)},n.prototype.enableResize=function(t,e){this.resizable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableResize=!t)},n.prototype.disable=function(){this.movable(this.$el.children("."+this.opts.itemClass),!1),this.resizable(this.$el.children("."+this.opts.itemClass),!1),this.$el.trigger("disable")},n.prototype.enable=function(){this.movable(this.$el.children("."+this.opts.itemClass),!0),this.resizable(this.$el.children("."+this.opts.itemClass),!0),this.$el.trigger("enable")},n.prototype.locked=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.locked=o||!1,e.attr("data-gs-locked",i.locked?"yes":null))}),this},n.prototype.maxHeight=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxHeight=o||!1,e.attr("data-gs-max-height",o)))}),this},n.prototype.minHeight=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minHeight=o||!1,e.attr("data-gs-min-height",o)))}),this},n.prototype.maxWidth=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxWidth=o||!1,e.attr("data-gs-max-width",o)))}),this},n.prototype.minWidth=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minWidth=o||!1,e.attr("data-gs-min-width",o)))}),this},n.prototype._updateElement=function(t,e){var i=(t=f(t).first()).data("_gridstack_node");if(i){var o=this;o.engine.cleanNodes(),o.engine.beginUpdate(i),e.call(this,t,i),o._updateContainerHeight(),o._triggerChangeEvent(),o.engine.endUpdate()}},n.prototype.resize=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.width,o=null!=o?o:e.height,this.engine.moveNode(e,e.x,e.y,i,o)})},n.prototype.move=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,this.engine.moveNode(e,i,o,e.width,e.height)})},n.prototype.update=function(t,i,o,n,a){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,n=null!=n?n:e.width,a=null!=a?a:e.height,this.engine.moveNode(e,i,o,n,a)})},n.prototype.compact=function(){if(0!==this.engine.nodes.length){this.batchUpdate(),this.engine._sortNodes();var t=this.engine.nodes;this.engine.nodes=[],t.forEach(function(t){t.noMove||t.locked||(t.autoPosition=!0),this.engine.addNode(t,!1),t._dirty=!0},this),this.commit()}},n.prototype.verticalMargin=function(t,e){if(void 0===t)return this.opts.verticalMargin;var i=v.parseHeight(t);this.opts.verticalMarginUnit===i.unit&&this.opts.maxRow===i.height||(this.opts.verticalMarginUnit=i.unit,this.opts.verticalMargin=i.height,e||this._updateStyles())},n.prototype.cellHeight=function(t,e){if(void 0===t){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight)return this.opts.cellHeight;var i=this.$el.children("."+this.opts.itemClass).first(),o=i.attr("data-gs-height"),n=this.opts.verticalMargin;return Math.round((i.outerHeight()-(o-1)*n)/o)}var a=v.parseHeight(t);this.opts.cellHeightUnit===a.unit&&this.opts.cellHeight===a.height||(this.opts.cellHeightUnit=a.unit,this.opts.cellHeight=a.height,e||this._updateStyles())},n.prototype.cellWidth=function(){return Math.round(this.$el.outerWidth()/this.opts.column)},n.prototype.getCellFromPixel=function(t,e){var i=void 0!==e&&e?this.$el.offset():this.$el.position(),o=t.left-i.left,n=t.top-i.top,a=Math.floor(this.$el.width()/this.opts.column),s=Math.floor(this.$el.height()/parseInt(this.$el.attr("data-gs-current-row")));return{x:Math.floor(o/a),y:Math.floor(n/s)}},n.prototype.batchUpdate=function(){this.engine.batchUpdate()},n.prototype.commit=function(){this.engine.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()},n.prototype.isAreaEmpty=function(t,e,i,o){return this.engine.isAreaEmpty(t,e,i,o)},n.prototype.setStatic=function(t){this.opts.staticGrid=!0===t,this.enableMove(!t),this.enableResize(!t),this._setStaticClass()},n.prototype._setStaticClass=function(){var t="grid-stack-static";!0===this.opts.staticGrid?this.$el.addClass(t):this.$el.removeClass(t)},y.prototype._layoutsNodesChange=function(t){this._layouts&&!this._ignoreLayoutsNodeChange&&this._layouts.forEach(function(o,n){o&&n!==this.column&&(n<this.column?this._layouts[n]=void 0:t.forEach(function(e){var t=o.find(function(t){return t._id===e._id});if(t){var i=n/this.column;e.y!==e._origY&&(t.y+=e.y-e._origY),e.x!==e._origX&&(t.x=Math.round(e.x*i)),e.width!==e._origW&&(t.width=Math.round(e.width*i))}},this))},this)},y.prototype._updateNodeWidths=function(e,i,o){if(this.nodes.length&&e!==i){var n=[this.nodes.length];if(this.nodes.forEach(function(t,e){n[e]={x:t.x,y:t.y,width:t.width,_id:t._id}}),this._layouts=this._layouts||[],this._layouts[e]=n,1===i&&o&&o.length){var a=0;o.forEach(function(t){t.x=0,t.width=1,t.y=Math.max(t.y,a),a=t.y+t.height})}else o=v.sort(this.nodes,-1,e);var t=this._layouts[i]||[],s=this._layouts.length-1;0===t.length&&e<i&&i<s&&(t=this._layouts[s]||[]).length&&(e=s,t.forEach(function(e){var t=o.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(o[t].x=e.x,o[t].y=e.y,o[t].width=e.width)}),t=[]);var r=[];t.forEach(function(e){var t=o.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(o[t].x=e.x,o[t].y=e.y,o[t].width=e.width,r.push(o[t]),o[t]=null)});var d=i/e;o.forEach(function(t){t&&(t.x=1===i?0:Math.round(t.x*d),t.width=1!==i&&1!==e&&Math.round(t.width*d)||1,r.push(t))}),r=v.sort(r,-1,i),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(),this.nodes=[],r.forEach(function(t){this.addNode(t,!1),t._dirty=!0},this),this.commit(),delete this._ignoreLayoutsNodeChange}},y.prototype._saveInitial=function(){this.nodes.forEach(function(t){t._origX=t.x,t._origY=t.y,t._origW=t.width,t._origH=t.height,delete t._dirty})},n.prototype.column=function(t,e){if(void 0===t)return this.opts.column;if(this.opts.column!==t){var o,i=this.opts.column;if(1===t?this._prevColumn=i:delete this._prevColumn,this.$el.removeClass("grid-stack-"+i),this.$el.addClass("grid-stack-"+t),this.opts.column=this.engine.column=t,!0!==e)this.opts.oneColumnModeDomSort&&1===t&&(o=[],this.$el.children("."+this.opts.itemClass).each(function(t,e){var i=f(e).data("_gridstack_node");i&&o.push(i)}),o.length||(o=void 0)),this.engine._updateNodeWidths(i,t,o),this.engine._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this.engine._ignoreLayoutsNodeChange}},n.prototype.float=function(t){if(void 0===t)return this.opts.float||!1;this.opts.float!==t&&(this.opts.float=this.engine.float=t||!1,t||(this.engine._packNodes(),this.engine._notify(),this._triggerChangeEvent()))},n.prototype.getRow=function(){return this.engine.getRow()},n.prototype.on=function(t,e){-1===t.indexOf(" ")?"change"===t||"added"===t||"removed"===t?(this._gsEventHandler=this._gsEventHandler||{},this._gsEventHandler[t]=function(t){e(t,t.detail)},this.el.addEventListener(t,this._gsEventHandler[t])):this.$el.on(t,e):t.split(" ").forEach(function(t){this.on(t,e)},this)},n.prototype.off=function(t){-1===t.indexOf(" ")?"change"===t||"added"===t||"removed"===t?this._gsEventHandler&&this._gsEventHandler[t]&&(this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t]):this.$el.off(t):t.split(" ").forEach(function(t){this.off(t,callback)},this)},n.prototype.setGridWidth=e(n.prototype.column,"setGridWidth","column","v0.5.3"),n.prototype.setColumn=e(n.prototype.column,"setColumn","column","v0.6.4"),y.prototype.getGridHeight=e(y.prototype.getRow,"getGridHeight","getRow","v1.0.0"),t.GridStack=n,t.GridStack.Utils=v,t.GridStack.Engine=y,t.GridStack.DragDropPlugin=_,n.init=function(t,e){var i=f(e=e||".grid-stack").get(0);if(i)return i.gridstack||(i.gridstack=new n(i,t)),i.gridstack},n.initAll=function(i,t){var o=[];return f(t=t||".grid-stack").each(function(t,e){e.gridstack||(e.gridstack=new n(e,i)),o.push(e.gridstack)}),o},t.GridStack}(window.jQuery,window);
!function(f,t){var e=function(t,e,i,o){var n=function(){console.warn("gridstack.js: Function `"+e+"` is deprecated in "+o+" and has been replaced "+"with `"+i+"`. It will be **completely** removed in v1.0");return t.apply(this,arguments)};n.prototype=t.prototype;return n},l=function(t,e,i,o){if(t[e]!==undefined){t[i]=t[e];console.warn("gridstack.js: Option `"+e+"` is deprecated in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}},g=function(t,e,i,o){if(t[e]!==undefined){console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+o)}},m=function(t,e,i,o){var n=t.attr(e);if(n!==undefined){t.attr(i,n);console.warn("gridstack.js: attribute `"+e+"`="+n+" is deprecated on this object in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}},v={isIntercepted:function(t,e){return!(t.x+t.width<=e.x||e.x+e.width<=t.x||t.y+t.height<=e.y||e.y+e.height<=t.y)},sort:function(t,e,i){if(!i){var o=t.map(function(t){return t.x+t.width});i=Math.max.apply(Math,o)}if(e===-1)return v.sortBy(t,function(t){return-(t.x+t.y*i)});else return v.sortBy(t,function(t){return t.x+t.y*i})},createStylesheet:function(t,e){var i=document.createElement("style");i.setAttribute("type","text/css");i.setAttribute("data-gs-style-id",t);if(i.styleSheet){i.styleSheet.cssText=""}else{i.appendChild(document.createTextNode(""))}if(!e){e=document.getElementsByTagName("head")[0]}e.insertBefore(i,e.firstChild);return i.sheet},removeStylesheet:function(t){f("STYLE[data-gs-style-id="+t+"]").remove()},insertCSSRule:function(t,e,i,o){if(typeof t.insertRule==="function"){t.insertRule(e+"{"+i+"}",o)}else if(typeof t.addRule==="function"){t.addRule(e,i,o)}},toBool:function(t){if(typeof t==="boolean"){return t}if(typeof t==="string"){t=t.toLowerCase();return!(t===""||t==="no"||t==="false"||t==="0")}return Boolean(t)},_collisionNodeCheck:function(t){return t!==this.node&&v.isIntercepted(t,this.nn)},_didCollide:function(t){return v.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},t)},_isAddNodeIntercepted:function(t){return v.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},t)},parseHeight:function(t){var e=t;var i="px";if(e&&typeof e==="string"){var o=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!o){throw new Error("Invalid height")}i=o[2]||"px";e=parseFloat(o[1])}return{height:e,unit:i}},without:function(t,e){var i=t.indexOf(e);if(i!==-1){t=t.slice(0);t.splice(i,1)}return t},sortBy:function(t,n){return t.slice(0).sort(function(t,e){var i=n(t);var o=n(e);if(o===i){return 0}return i>o?1:-1})},defaults:function(i){var t=Array.prototype.slice.call(arguments,1);t.forEach(function(t){for(var e in t){if(t.hasOwnProperty(e)&&(!i.hasOwnProperty(e)||i[e]===undefined)){i[e]=t[e]}}});return i},clone:function(t){return f.extend({},t)},throttle:function(t,e){var i=false;return function(){if(!i){t.apply(this,arguments);i=true;setTimeout(function(){i=false},e)}}},removePositioningStyles:function(t){var e=t[0].style;if(e.position){e.removeProperty("position")}if(e.left){e.removeProperty("left")}if(e.top){e.removeProperty("top")}if(e.width){e.removeProperty("width")}if(e.height){e.removeProperty("height")}},getScrollParent:function(t){var e;if(t===null){e=null}else if(t.scrollHeight>t.clientHeight){e=t}else{e=v.getScrollParent(t.parentNode)}return e},updateScrollPosition:function(t,e,i){var o=t.getBoundingClientRect();var n=window.innerHeight||document.documentElement.clientHeight;if(o.top<0||o.bottom>n){var s=o.bottom-n;var a=o.top;var r=v.getScrollParent(t);if(r!==null){var d=r.scrollTop;if(o.top<0&&i<0){if(t.offsetHeight>n){r.scrollTop+=i}else{r.scrollTop+=Math.abs(a)>Math.abs(i)?i:a}}else if(i>0){if(t.offsetHeight>n){r.scrollTop+=i}else{r.scrollTop+=s>i?i:s}}e.position.top+=r.scrollTop-d}}}};function _(t){this.grid=t}_.registeredPlugins=[],_.registerPlugin=function(t){_.registeredPlugins.push(t)},_.prototype.resizable=function(t,e){return this},_.prototype.draggable=function(t,e){return this},_.prototype.droppable=function(t,e){return this},_.prototype.isDroppable=function(t){return false},_.prototype.on=function(t,e,i){return this};var s=0,y=function(t,e,i,o,n){this.column=t||12;this.float=i||false;this.maxRow=o||0;this.nodes=n||[];this.onchange=e||function(){};this._addedNodes=[];this._removedNodes=[];this._batchMode=false};y.prototype.batchUpdate=function(){if(this._batchMode)return;this._batchMode=true;this._prevFloat=this.float;this.float=true},y.prototype.commit=function(){if(!this._batchMode)return;this._batchMode=false;this.float=this._prevFloat;delete this._prevFloat;this._packNodes();this._notify()},y.prototype.getNodeDataByDOMEl=function(e){return this.nodes.find(function(t){return e===t.el})},y.prototype._fixCollisions=function(t){var e=this;this._sortNodes(-1);var i=t;var o=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.float&&!o){i={x:0,y:t.y,width:this.column,height:t.height}}while(true){var n=this.nodes.find(v._collisionNodeCheck,{node:t,nn:i});if(!n){return}var s;if(n.locked){s=this.moveNode(t,t.x,n.y+n.height,t.width,t.height,true)}else{s=this.moveNode(n,n.x,t.y+t.height,n.width,n.height,true)}if(!s){return}}},y.prototype.isAreaEmpty=function(t,e,i,o){var n={x:t||0,y:e||0,width:i||1,height:o||1};var s=this.nodes.find(function(t){return v.isIntercepted(t,n)});return!s},y.prototype._sortNodes=function(t){this.nodes=v.sort(this.nodes,t,this.column)},y.prototype._packNodes=function(){this._sortNodes();if(this.float){this.nodes.forEach(function(t,e){if(t._updating||t._packY===undefined||t.y===t._packY){return}var i=t.y;while(i>=t._packY){var o=this.nodes.slice(0,e).find(v._didCollide,{n:t,newY:i});if(!o){t._dirty=true;t.y=i}--i}},this)}else{this.nodes.forEach(function(t,e){if(t.locked){return}while(t.y>0){var i=t.y-1;var o=e===0;if(e>0){var n=this.nodes.slice(0,e).find(v._didCollide,{n:t,newY:i});o=n===undefined}if(!o){break}t._dirty=t.y!==i;t.y=i}},this)}},y.prototype._prepareNode=function(t,e){t=t||{};if(t.x===undefined||t.y===undefined||t.x===null||t.y===null){t.autoPosition=true}var i={width:1,height:1,x:0,y:0};t=v.defaults(t,i);t.x=parseInt(t.x);t.y=parseInt(t.y);t.width=parseInt(t.width);t.height=parseInt(t.height);t.autoPosition=t.autoPosition||false;t.noResize=t.noResize||false;t.noMove=t.noMove||false;if(Number.isNaN(t.x)){t.x=i.x;t.autoPosition=true}if(Number.isNaN(t.y)){t.y=i.y;t.autoPosition=true}if(Number.isNaN(t.width)){t.width=i.width}if(Number.isNaN(t.height)){t.height=i.height}if(t.maxWidth!==undefined){t.width=Math.min(t.width,t.maxWidth)}if(t.maxHeight!==undefined){t.height=Math.min(t.height,t.maxHeight)}if(t.minWidth!==undefined){t.width=Math.max(t.width,t.minWidth)}if(t.minHeight!==undefined){t.height=Math.max(t.height,t.minHeight)}if(t.width>this.column){t.width=this.column}else if(t.width<1){t.width=1}if(this.maxRow&&t.height>this.maxRow){t.height=this.maxRow}else if(t.height<1){t.height=1}if(t.x<0){t.x=0}if(t.y<0){t.y=0}if(t.x+t.width>this.column){if(e){t.width=this.column-t.x}else{t.x=this.column-t.width}}if(this.maxRow&&t.y+t.height>this.maxRow){if(e){t.height=this.maxRow-t.y}else{t.y=this.maxRow-t.height}}return t},y.prototype._notify=function(){if(this._batchMode){return}var t=Array.prototype.slice.call(arguments,0);t[0]=t[0]===undefined?[]:Array.isArray(t[0])?t[0]:[t[0]];t[1]=t[1]===undefined?true:t[1];var e=t[0].concat(this.getDirtyNodes());this.onchange(e,t[1])},y.prototype.cleanNodes=function(){if(this._batchMode){return}this.nodes.forEach(function(t){delete t._dirty})},y.prototype.getDirtyNodes=function(t){if(t){var e=[];this.nodes.forEach(function(t){if(t._dirty){if(t.y===t._origY&&t.x===t._origX&&t.width===t._origW&&t.height===t._origH){delete t._dirty}else{e.push(t)}}});return e}return this.nodes.filter(function(t){return t._dirty})},y.prototype.addNode=function(t,e){t=this._prepareNode(t);t._id=t._id||++s;if(t.autoPosition){this._sortNodes();for(var i=0;;++i){var o=i%this.column;var n=Math.floor(i/this.column);if(o+t.width>this.column){continue}if(!this.nodes.find(v._isAddNodeIntercepted,{x:o,y:n,node:t})){t.x=o;t.y=n;delete t.autoPosition;break}}}this.nodes.push(t);if(e){this._addedNodes.push(t)}this._fixCollisions(t);this._packNodes();this._notify();return t},y.prototype.removeNode=function(t,e){e=e===undefined?true:e;this._removedNodes.push(t);t._id=null;this.nodes=v.without(this.nodes,t);this._packNodes();this._notify(t,e)},y.prototype.removeAll=function(t){delete this._layouts;if(this.nodes.length===0){return}t=t===undefined?true:t;this.nodes.forEach(function(t){t._id=null});this._removedNodes=this.nodes;this.nodes=[];this._notify(this._removedNodes,t)},y.prototype.canMoveNode=function(e,t,i,o,n){if(!this.isNodeChangedPosition(e,t,i,o,n)){return false}var s=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.maxRow&&!s){return true}var a;var r=new y(this.column,null,this.float,0,this.nodes.map(function(t){if(t===e){a=f.extend({},t);return a}return f.extend({},t)}));if(!a){return true}r.moveNode(a,t,i,o,n);var d=true;if(s){d&=!Boolean(r.nodes.find(function(t){return t!==a&&Boolean(t.locked)&&Boolean(t._dirty)}))}if(this.maxRow){d&=r.getRow()<=this.maxRow}return d},y.prototype.canBePlacedWithRespectToHeight=function(t){if(!this.maxRow){return true}var e=new y(this.column,null,this.float,0,this.nodes.map(function(t){return f.extend({},t)}));e.addNode(t);return e.getRow()<=this.maxRow},y.prototype.isNodeChangedPosition=function(t,e,i,o,n){if(typeof e!=="number"){e=t.x}if(typeof i!=="number"){i=t.y}if(typeof o!=="number"){o=t.width}if(typeof n!=="number"){n=t.height}if(t.maxWidth!==undefined){o=Math.min(o,t.maxWidth)}if(t.maxHeight!==undefined){n=Math.min(n,t.maxHeight)}if(t.minWidth!==undefined){o=Math.max(o,t.minWidth)}if(t.minHeight!==undefined){n=Math.max(n,t.minHeight)}if(t.x===e&&t.y===i&&t.width===o&&t.height===n){return false}return true},y.prototype.moveNode=function(t,e,i,o,n,s){if(t.locked){return null}if(typeof e!=="number"){e=t.x}if(typeof i!=="number"){i=t.y}if(typeof o!=="number"){o=t.width}if(typeof n!=="number"){n=t.height}var a=t.width!==o||t.height!==n;var r={x:e,y:i,width:o,height:n,maxWidth:t.maxWidth,maxHeight:t.maxHeight,minWidth:t.minWidth,minHeight:t.minHeight};r=this._prepareNode(r,a);if(t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height){return null}t._dirty=true;t.x=t.lastTriedX=r.x;t.y=t.lastTriedY=r.y;t.width=t.lastTriedWidth=r.width;t.height=t.lastTriedHeight=r.height;this._fixCollisions(t);if(!s){this._packNodes();this._notify()}return t},y.prototype.getRow=function(){return this.nodes.reduce(function(t,e){return Math.max(t,e.y+e.height)},0)},y.prototype.beginUpdate=function(t){if(t._updating)return;t._updating=true;this.nodes.forEach(function(t){t._packY=t.y})},y.prototype.endUpdate=function(){var t=this.nodes.find(function(t){return t._updating});if(t){t._updating=false;this.nodes.forEach(function(t){delete t._packY})}};var n=function(t,e){var u=this;var i,o,n;e=e||{};this.$el=f(t);this.el=this.$el.get(0);l(e,"width","column","v0.5.3");l(e,"height","maxRow","v0.5.3");g(e,"oneColumnModeClass","v0.6.3",". Use class `.grid-stack-1` instead");m(this.$el,"data-gs-width","data-gs-column","v0.5.3");m(this.$el,"data-gs-height","data-gs-max-row","v0.5.3");m(this.$el,"data-gs-current-height","data-gs-current-row","v1.0.0");e.itemClass=e.itemClass||"grid-stack-item";var s=this.$el.closest("."+e.itemClass).length>0;if(e.row){e.minRow=e.maxRow=e.row;delete e.row}var a=parseInt(this.$el.attr("data-gs-row"));this.opts=v.defaults(e,{column:parseInt(this.$el.attr("data-gs-column"))||12,minRow:a?a:parseInt(this.$el.attr("data-gs-min-row"))||0,maxRow:a?a:parseInt(this.$el.attr("data-gs-max-row"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,cellHeight:60,verticalMargin:20,auto:true,minWidth:768,float:false,staticGrid:false,_class:"grid-stack-instance-"+(Math.random()*1e4).toFixed(0),animate:Boolean(this.$el.attr("data-gs-animate"))||false,alwaysShowResizeHandle:e.alwaysShowResizeHandle||false,resizable:v.defaults(e.resizable||{},{autoHide:!(e.alwaysShowResizeHandle||false),handles:"se"}),draggable:v.defaults(e.draggable||{},{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:false,appendTo:"body"}),disableDrag:e.disableDrag||false,disableResize:e.disableResize||false,rtl:"auto",removable:false,removableOptions:v.defaults(e.removableOptions||{},{accept:"."+e.itemClass}),removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:e.disableOneColumnMode||false,oneColumnModeDomSort:e.oneColumnModeDomSort,ddPlugin:null});if(this.opts.ddPlugin===false){this.opts.ddPlugin=_}else if(this.opts.ddPlugin===null){this.opts.ddPlugin=_.registeredPlugins[0]||_}this.dd=new this.opts.ddPlugin(this);if(this.opts.rtl==="auto"){this.opts.rtl=this.$el.css("direction")==="rtl"}if(this.opts.rtl){this.$el.addClass("grid-stack-rtl")}this.opts.isNested=s;n=this.opts.cellHeight==="auto";if(n){u.cellHeight(u.cellWidth(),true)}else{this.cellHeight(this.opts.cellHeight,true)}this.verticalMargin(this.opts.verticalMargin,true);this.$el.addClass(this.opts._class);this._setStaticClass();if(s){this.$el.addClass("grid-stack-nested")}this._initStyles();this.engine=new y(this.opts.column,function(t,e){e=e===undefined?true:e;var i=0;this.nodes.forEach(function(t){i=Math.max(i,t.y+t.height)});t.forEach(function(t){if(e&&t._id===null){if(t.el){f(t.el).remove()}}else{f(t.el).attr("data-gs-x",t.x).attr("data-gs-y",t.y).attr("data-gs-width",t.width).attr("data-gs-height",t.height)}});u._updateStyles(i+10)},this.opts.float,this.opts.maxRow);if(this.opts.auto){var r=[];var d=this;this.$el.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(t,e){e=f(e);var i=parseInt(e.attr("data-gs-x"));var o=parseInt(e.attr("data-gs-y"));r.push({el:e.get(0),i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(o)?1e3:o)*d.opts.column})});v.sortBy(r,function(t){return t.i}).forEach(function(t){this._prepareElement(t.el)},this)}this.engine._saveInitial();this.setAnimation(this.opts.animate);this.placeholder=f('<div class="'+this.opts.placeholderClass+" "+this.opts.itemClass+'">'+'<div class="placeholder-content">'+this.opts.placeholderText+"</div></div>").hide();this._updateContainerHeight();this._updateHeightsOnResize=v.throttle(function(){u.cellHeight(u.cellWidth(),false)},100);this.onResizeHandler=function(){if(n){u._updateHeightsOnResize()}if(u.opts.staticGrid){return}if(!u.opts.disableOneColumnMode&&(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=u.opts.minWidth){if(u.oneColumnMode){return}u.oneColumnMode=true;u.column(1)}else{if(!u.oneColumnMode){return}u.oneColumnMode=false;u.column(u._prevColumn)}};f(window).resize(this.onResizeHandler);this.onResizeHandler();if(!u.opts.staticGrid&&typeof u.opts.removable==="string"){var h=f(u.opts.removable);if(!this.dd.isDroppable(h)){this.dd.droppable(h,u.opts.removableOptions)}this.dd.on(h,"dropover",function(t,e){var i=f(e.draggable);var o=i.data("_gridstack_node");if(!o||o._grid!==u){return}i.data("inTrashZone",true);u._setupRemovingTimeout(i)}).on(h,"dropout",function(t,e){var i=f(e.draggable);var o=i.data("_gridstack_node");if(!o||o._grid!==u){return}i.data("inTrashZone",false);u._clearRemovingTimeout(i)})}if(!u.opts.staticGrid&&u.opts.acceptWidgets){var c=null;var p=function(t,e){var i=c;var o=i.data("_gridstack_node");var n=u.getCellFromPixel({left:t.pageX,top:t.pageY},true);var s=Math.max(0,n.x);var a=Math.max(0,n.y);if(!o._added){o._added=true;o.el=i.get(0);o.autoPosition=true;o.x=s;o.y=a;u.engine.cleanNodes();u.engine.beginUpdate(o);u.engine.addNode(o);u.$el.append(u.placeholder);u.placeholder.attr("data-gs-x",o.x).attr("data-gs-y",o.y).attr("data-gs-width",o.width).attr("data-gs-height",o.height).show();o.el=u.placeholder.get(0);o._beforeDragX=o.x;o._beforeDragY=o.y;u._updateContainerHeight()}if(!u.engine.canMoveNode(o,s,a)){return}u.engine.moveNode(o,s,a);u._updateContainerHeight()};this.dd.droppable(u.$el,{accept:function(t){t=f(t);var e=t.data("_gridstack_node");if(e&&e._grid===u){return false}return t.is(u.opts.acceptWidgets===true?".grid-stack-item":u.opts.acceptWidgets)}}).on(u.$el,"dropover",function(t,e){var i=f(e.draggable);var o,n;var s=i.data("_gridstack_node");if(!s||!s.width||!s.height){var a=parseInt(i.attr("data-gs-width"));if(a>0){s=s||{};s.width=a}var r=parseInt(i.attr("data-gs-height"));if(r>0){s=s||{};s.height=r}}var d=u.cellWidth();var h=u.cellHeight();var l=u.opts.verticalMargin;o=s&&s.width?s.width:Math.ceil(i.outerWidth()/d);n=s&&s.height?s.height:Math.round((i.outerHeight()+l)/(h+l));c=i;var g=u.engine._prepareNode({width:o,height:n,_added:false,_temporary:true});g.isOutOfGrid=true;i.data("_gridstack_node",g);i.data("_gridstack_node_orig",s);i.on("drag",p);return false}).on(u.$el,"dropout",function(t,e){var i=f(e.draggable);if(!i.data("_gridstack_node")){return}var o=i.data("_gridstack_node");if(!o.isOutOfGrid){return}i.unbind("drag",p);o.el=null;u.engine.removeNode(o);u.placeholder.detach();u._updateContainerHeight();i.data("_gridstack_node",i.data("_gridstack_node_orig"));return false}).on(u.$el,"drop",function(t,e){u.placeholder.detach();var i=f(e.draggable).data("_gridstack_node");i.isOutOfGrid=false;i._grid=u;var o=f(e.draggable).clone(false);o.data("_gridstack_node",i);var n=f(e.draggable).data("_gridstack_node_orig");if(n!==undefined&&n._grid!==undefined){n._grid._triggerRemoveEvent()}f(e.helper).remove();i.el=o.get(0);u.placeholder.hide();v.removePositioningStyles(o);o.find("div.ui-resizable-handle").remove();o.attr("data-gs-x",i.x).attr("data-gs-y",i.y).attr("data-gs-width",i.width).attr("data-gs-height",i.height).addClass(u.opts.itemClass).enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",p);u.$el.append(o);u._prepareElementsByNode(o,i);u._updateContainerHeight();u.engine._addedNodes.push(i);u._triggerAddEvent();u._triggerChangeEvent();u.engine.endUpdate();f(e.draggable).unbind("drag",p);f(e.draggable).removeData("_gridstack_node");f(e.draggable).removeData("_gridstack_node_orig");u.$el.trigger("dropped",[n,i]);return false})}};n.prototype._triggerChangeEvent=function(){if(!this.engine._batchMode){var t=this.engine.getDirtyNodes(!0);t&&t.length&&(this.engine._layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine._saveInitial()}},n.prototype._triggerAddEvent=function(){this.engine._batchMode||this.engine._addedNodes&&0<this.engine._addedNodes.length&&(this.engine._layoutsNodesChange(this.engine._addedNodes),this.engine._addedNodes.forEach(function(t){delete t._dirty}),this._triggerEvent("added",this.engine._addedNodes),this.engine._addedNodes=[])},n.prototype._triggerRemoveEvent=function(){this.engine._batchMode||this.engine._removedNodes&&0<this.engine._removedNodes.length&&(this._triggerEvent("removed",this.engine._removedNodes),this.engine._removedNodes=[])},n.prototype._triggerEvent=function(t,e){var i=new CustomEvent(t,{detail:e});this.el.dispatchEvent(i)},n.prototype._initStyles=function(){this._stylesId&&v.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=v.createStylesheet(this._stylesId,this.el.parentNode),null!==this._styles&&(this._styles._max=0)},n.prototype._updateStyles=function(t){if(null!==this._styles&&void 0!==this._styles){var e,i="."+this.opts._class+" ."+this.opts.itemClass,o=this;if(void 0===t&&(t=this._styles._max),this._initStyles(),this._updateContainerHeight(),this.opts.cellHeight&&!(0!==this._styles._max&&t<=this._styles._max)&&(e=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(t,e){return t&&e?"calc("+(o.opts.cellHeight*t+o.opts.cellHeightUnit)+" + "+(o.opts.verticalMargin*e+o.opts.verticalMarginUnit)+")":o.opts.cellHeight*t+o.opts.verticalMargin*e+o.opts.cellHeightUnit}:function(t,e){return o.opts.cellHeight*t+o.opts.verticalMargin*e+o.opts.cellHeightUnit},0===this._styles._max&&v.insertCSSRule(this._styles,i,"min-height: "+e(1,0)+";",0),t>this._styles._max)){for(var n=this._styles._max;n<t;++n)v.insertCSSRule(this._styles,i+'[data-gs-height="'+(n+1)+'"]',"height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-min-height="'+(n+1)+'"]',"min-height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-max-height="'+(n+1)+'"]',"max-height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-y="'+n+'"]',"top: "+e(n,n)+";",n);this._styles._max=t}}},n.prototype._updateContainerHeight=function(){if(!this.engine._batchMode){var t=this.engine.getRow();t<this.opts.minRow&&(t=this.opts.minRow);var e=parseInt(this.$el.css("min-height"));if(0<e){var i=this.opts.verticalMargin,o=Math.round((e+i)/(this.cellHeight()+i));t<o&&(t=o)}this.$el.attr("data-gs-current-row",t),this.opts.cellHeight&&(this.opts.verticalMargin?this.opts.cellHeightUnit===this.opts.verticalMarginUnit?this.$el.css("height",t*(this.opts.cellHeight+this.opts.verticalMargin)-this.opts.verticalMargin+this.opts.cellHeightUnit):this.$el.css("height","calc("+(t*this.opts.cellHeight+this.opts.cellHeightUnit)+" + "+(t*(this.opts.verticalMargin-1)+this.opts.verticalMarginUnit)+")"):this.$el.css("height",t*this.opts.cellHeight+this.opts.cellHeightUnit))}},n.prototype._setupRemovingTimeout=function(t){var e=f(t).data("_gridstack_node");!e._removeTimeout&&this.opts.removable&&(e._removeTimeout=setTimeout(function(){t.addClass("grid-stack-item-removing"),e._isAboutToRemove=!0},this.opts.removeTimeout))},n.prototype._clearRemovingTimeout=function(t){var e=f(t).data("_gridstack_node");e._removeTimeout&&(clearTimeout(e._removeTimeout),e._removeTimeout=null,t.removeClass("grid-stack-item-removing"),e._isAboutToRemove=!1)},n.prototype._prepareElementsByNode=function(h,l){function t(t,e){var i,o,n=Math.round(e.position.left/g),s=Math.floor((e.position.top+u/2)/u);if("drag"===t.type){var a=e.position.top-l._prevYPix;if(l._prevYPix=e.position.top,v.updateScrollPosition(h[0],e,a),h.data("inTrashZone")||n<0||n>=c.engine.column||s<0||!c.engine.float&&s>c.engine.getRow()){if(l._temporaryRemoved)return;!0===c.opts.removable&&c._setupRemovingTimeout(h),n=l._beforeDragX,s=l._beforeDragY,c.placeholder.detach(),c.placeholder.hide(),c.engine.removeNode(l),c._updateContainerHeight(),l._temporaryRemoved=!0}else c._clearRemovingTimeout(h),l._temporaryRemoved&&(c.engine.addNode(l),c.placeholder.attr("data-gs-x",n).attr("data-gs-y",s).attr("data-gs-width",i).attr("data-gs-height",o).show(),c.$el.append(c.placeholder),l.el=c.placeholder.get(0),l._temporaryRemoved=!1)}else if("resize"===t.type){if(n<0)return;i=Math.round(e.size.width/g),o=Math.round((e.size.height+c.verticalMargin())/u)}var r=void 0!==i?i:l.lastTriedWidth,d=void 0!==o?o:l.lastTriedHeight;!c.engine.canMoveNode(l,n,s,i,o)||l.lastTriedX===n&&l.lastTriedY===s&&l.lastTriedWidth===r&&l.lastTriedHeight===d||(l.lastTriedX=n,l.lastTriedY=s,l.lastTriedWidth=i,l.lastTriedHeight=o,c.engine.moveNode(l,n,s,i,o),c._updateContainerHeight(),"resize"===t.type&&f(t.target).trigger("gsresize",l))}function e(t,e){c.$el.append(c.placeholder);var i=f(this);c.engine.cleanNodes(),c.engine.beginUpdate(l),g=c.cellWidth();var o=c.cellHeight();u=(c.$el.height()+c.verticalMargin())/parseInt(c.$el.attr("data-gs-current-row")),c.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),l.el=c.placeholder.get(0),l._beforeDragX=l.x,l._beforeDragY=l.y,l._prevYPix=e.position.top;var n=l.minHeight||1,s=c.opts.verticalMargin;c.dd.resizable(h,"option","minWidth",g*(l.minWidth||1)),c.dd.resizable(h,"option","minHeight",o*n+(n-1)*s),"resizestart"===t.type&&i.find(".grid-stack-item").trigger("resizestart")}function i(t,e){var i=f(this);if(i.data("_gridstack_node")){if(c.placeholder.detach(),l.el=i.get(0),c.placeholder.hide(),l._isAboutToRemove)h.data("_gridstack_node")._grid._triggerRemoveEvent(),h.removeData("_gridstack_node"),h.remove();else c._clearRemovingTimeout(h),l._temporaryRemoved?(v.removePositioningStyles(i),i.attr("data-gs-x",l._beforeDragX).attr("data-gs-y",l._beforeDragY).attr("data-gs-width",l.width).attr("data-gs-height",l.height),l.x=l._beforeDragX,l.y=l._beforeDragY,l._temporaryRemoved=!1,c.engine.addNode(l)):(v.removePositioningStyles(i),i.attr("data-gs-x",l.x).attr("data-gs-y",l.y).attr("data-gs-width",l.width).attr("data-gs-height",l.height));c._updateContainerHeight(),c._triggerChangeEvent(),c.engine.endUpdate();var o=i.find(".grid-stack");o.length&&"resizestop"===t.type&&(o.each(function(t,e){e.gridstack.onResizeHandler()}),i.find(".grid-stack-item").trigger("resizestop"),i.find(".grid-stack-item").trigger("gsresizestop")),"resizestop"===t.type&&c.$el.trigger("gsresizestop",i)}}var g,u,c=this;this.dd.draggable(h,{start:e,stop:i,drag:t}).resizable(h,{start:e,stop:i,resize:t}),(l.noMove||this.opts.disableDrag||this.opts.staticGrid)&&this.dd.draggable(h,"disable"),(l.noResize||this.opts.disableResize||this.opts.staticGrid)&&this.dd.resizable(h,"disable"),this._writeAttr(h,l)},n.prototype._prepareElement=function(t,e){e=void 0!==e&&e;(t=f(t)).addClass(this.opts.itemClass);var i=this._readAttr(t,{el:t.get(0),_grid:this});i=this.engine.addNode(i,e),t.data("_gridstack_node",i),this._prepareElementsByNode(t,i)},n.prototype._writeAttr=function(t,e){t=f(t),void 0!==(e=e||{}).x&&t.attr("data-gs-x",e.x),void 0!==e.y&&t.attr("data-gs-y",e.y),void 0!==e.width&&t.attr("data-gs-width",e.width),void 0!==e.height&&t.attr("data-gs-height",e.height),void 0!==e.autoPosition&&t.attr("data-gs-auto-position",!!e.autoPosition||null),void 0!==e.minWidth&&t.attr("data-gs-min-width",e.minWidth),void 0!==e.maxWidth&&t.attr("data-gs-max-width",e.maxWidth),void 0!==e.minHeight&&t.attr("data-gs-min-height",e.minHeight),void 0!==e.maxHeight&&t.attr("data-gs-max-height",e.maxHeight),void 0!==e.noResize&&t.attr("data-gs-no-resize",!!e.noResize||null),void 0!==e.noMove&&t.attr("data-gs-no-move",!!e.noMove||null),void 0!==e.locked&&t.attr("data-gs-locked",!!e.locked||null),void 0!==e.resizeHandles&&t.attr("data-gs-resize-handles",e.resizeHandles),void 0!==e.id&&t.attr("data-gs-id",e.id)},n.prototype._readAttr=function(t,e){return t=f(t),(e=e||{}).x=t.attr("data-gs-x"),e.y=t.attr("data-gs-y"),e.width=t.attr("data-gs-width"),e.height=t.attr("data-gs-height"),e.autoPosition=v.toBool(t.attr("data-gs-auto-position")),e.maxWidth=t.attr("data-gs-max-width"),e.minWidth=t.attr("data-gs-min-width"),e.maxHeight=t.attr("data-gs-max-height"),e.minHeight=t.attr("data-gs-min-height"),e.noResize=v.toBool(t.attr("data-gs-no-resize")),e.noMove=v.toBool(t.attr("data-gs-no-move")),e.locked=v.toBool(t.attr("data-gs-locked")),e.resizeHandles=t.attr("data-gs-resize-handles"),e.id=t.attr("data-gs-id"),e},n.prototype.setAnimation=function(t){t?this.$el.addClass("grid-stack-animate"):this.$el.removeClass("grid-stack-animate")},n.prototype.addWidget=function(t,e,i,o,n,s,a,r,d,h,l){return void 0!==e&&"object"!=typeof e?this.addWidget(t,{x:e,y:i,width:o,height:n,autoPosition:s,minWidth:a,maxWidth:r,minHeight:d,maxHeight:h,id:l}):(t=f(t),e&&this.engine._prepareNode(e),this._writeAttr(t,e),this.$el.append(t),this.makeWidget(t))},n.prototype.makeWidget=function(t){return t=f(t),this._prepareElement(t,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(!0),t.get(0)},n.prototype.willItFit=function(t,e,i,o,n){var s={x:t,y:e,width:i,height:o,autoPosition:n};return this.engine.canBePlacedWithRespectToHeight(s)},n.prototype.removeWidget=function(t,e){var i=(t=f(t)).data("_gridstack_node");i=i||this.engine.getNodeDataByDOMEl(t.get(0)),t.removeData("_gridstack_node"),this.dd.draggable(t,"destroy").resizable(t,"destroy"),this.engine.removeNode(i,e),this._triggerRemoveEvent(),this._triggerChangeEvent(!0)},n.prototype.removeAll=function(t){this.engine.nodes.forEach(function(t){var e=f(t.el);e.removeData("_gridstack_node"),this.dd.draggable(e,"destroy").resizable(e,"destroy")},this),this.engine.removeAll(t),this._triggerRemoveEvent()},n.prototype.destroy=function(t){f(window).off("resize",this.onResizeHandler),!1===t?(this.removeAll(!1),this.$el.removeClass(this.opts._class),delete this.$el.get(0).gridstack):this.$el.remove(),v.removeStylesheet(this._stylesId),this.engine&&(this.engine=null)},n.prototype.resizable=function(t,o){var n=this;return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.noResize=!o,i.noResize?n.dd.resizable(e,"disable"):n.dd.resizable(e,"enable"))}),this},n.prototype.movable=function(t,o){var n=this;return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.noMove=!o,i.noMove?(n.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(n.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},n.prototype.enableMove=function(t,e){this.movable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableDrag=!t)},n.prototype.enableResize=function(t,e){this.resizable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableResize=!t)},n.prototype.disable=function(){this.movable(this.$el.children("."+this.opts.itemClass),!1),this.resizable(this.$el.children("."+this.opts.itemClass),!1),this.$el.trigger("disable")},n.prototype.enable=function(){this.movable(this.$el.children("."+this.opts.itemClass),!0),this.resizable(this.$el.children("."+this.opts.itemClass),!0),this.$el.trigger("enable")},n.prototype.locked=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.locked=o||!1,e.attr("data-gs-locked",i.locked?"yes":null))}),this},n.prototype.maxHeight=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxHeight=o||!1,e.attr("data-gs-max-height",o)))}),this},n.prototype.minHeight=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minHeight=o||!1,e.attr("data-gs-min-height",o)))}),this},n.prototype.maxWidth=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxWidth=o||!1,e.attr("data-gs-max-width",o)))}),this},n.prototype.minWidth=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minWidth=o||!1,e.attr("data-gs-min-width",o)))}),this},n.prototype._updateElement=function(t,e){var i=(t=f(t).first()).data("_gridstack_node");if(i){var o=this;o.engine.cleanNodes(),o.engine.beginUpdate(i),e.call(this,t,i),o._updateContainerHeight(),o._triggerChangeEvent(),o.engine.endUpdate()}},n.prototype.resize=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.width,o=null!=o?o:e.height,this.engine.moveNode(e,e.x,e.y,i,o)})},n.prototype.move=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,this.engine.moveNode(e,i,o,e.width,e.height)})},n.prototype.update=function(t,i,o,n,s){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,n=null!=n?n:e.width,s=null!=s?s:e.height,this.engine.moveNode(e,i,o,n,s)})},n.prototype.compact=function(){if(0!==this.engine.nodes.length){this.batchUpdate(),this.engine._sortNodes();var t=this.engine.nodes;this.engine.nodes=[],t.forEach(function(t){t.noMove||t.locked||(t.autoPosition=!0),this.engine.addNode(t,!1),t._dirty=!0},this),this.commit()}},n.prototype.verticalMargin=function(t,e){if(void 0===t)return this.opts.verticalMargin;var i=v.parseHeight(t);this.opts.verticalMarginUnit===i.unit&&this.opts.maxRow===i.height||(this.opts.verticalMarginUnit=i.unit,this.opts.verticalMargin=i.height,e||this._updateStyles())},n.prototype.cellHeight=function(t,e){if(void 0===t){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight)return this.opts.cellHeight;var i=this.$el.children("."+this.opts.itemClass).first(),o=i.attr("data-gs-height"),n=this.opts.verticalMargin;return Math.round((i.outerHeight()-(o-1)*n)/o)}var s=v.parseHeight(t);this.opts.cellHeightUnit===s.unit&&this.opts.cellHeight===s.height||(this.opts.cellHeightUnit=s.unit,this.opts.cellHeight=s.height,e||this._updateStyles())},n.prototype.cellWidth=function(){return Math.round(this.$el.outerWidth()/this.opts.column)},n.prototype.getCellFromPixel=function(t,e){var i=void 0!==e&&e?this.$el.offset():this.$el.position(),o=t.left-i.left,n=t.top-i.top,s=Math.floor(this.$el.width()/this.opts.column),a=Math.floor(this.$el.height()/parseInt(this.$el.attr("data-gs-current-row")));return{x:Math.floor(o/s),y:Math.floor(n/a)}},n.prototype.batchUpdate=function(){this.engine.batchUpdate()},n.prototype.commit=function(){this.engine.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()},n.prototype.isAreaEmpty=function(t,e,i,o){return this.engine.isAreaEmpty(t,e,i,o)},n.prototype.setStatic=function(t){this.opts.staticGrid=!0===t,this.enableMove(!t),this.enableResize(!t),this._setStaticClass()},n.prototype._setStaticClass=function(){var t="grid-stack-static";!0===this.opts.staticGrid?this.$el.addClass(t):this.$el.removeClass(t)},y.prototype._layoutsNodesChange=function(t){this._layouts&&!this._ignoreLayoutsNodeChange&&this._layouts.forEach(function(o,n){o&&n!==this.column&&(n<this.column?this._layouts[n]=void 0:t.forEach(function(e){var t=o.find(function(t){return t._id===e._id});if(t){var i=n/this.column;e.y!==e._origY&&(t.y+=e.y-e._origY),e.x!==e._origX&&(t.x=Math.round(e.x*i)),e.width!==e._origW&&(t.width=Math.round(e.width*i))}},this))},this)},y.prototype._updateNodeWidths=function(e,i,o){if(this.nodes.length&&e!==i){var n=[this.nodes.length];if(this.nodes.forEach(function(t,e){n[e]={x:t.x,y:t.y,width:t.width,_id:t._id}}),this._layouts=this._layouts||[],this._layouts[e]=n,1===i&&o&&o.length){var s=0;o.forEach(function(t){t.x=0,t.width=1,t.y=Math.max(t.y,s),s=t.y+t.height})}else o=v.sort(this.nodes,-1,e);var t=this._layouts[i]||[],a=this._layouts.length-1;0===t.length&&e<i&&i<a&&(t=this._layouts[a]||[]).length&&(e=a,t.forEach(function(e){var t=o.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(o[t].x=e.x,o[t].y=e.y,o[t].width=e.width)}),t=[]);var r=[];t.forEach(function(e){var t=o.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(o[t].x=e.x,o[t].y=e.y,o[t].width=e.width,r.push(o[t]),o[t]=null)});var d=i/e;o.forEach(function(t){t&&(t.x=1===i?0:Math.round(t.x*d),t.width=1!==i&&1!==e&&Math.round(t.width*d)||1,r.push(t))}),r=v.sort(r,-1,i),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(),this.nodes=[],r.forEach(function(t){this.addNode(t,!1),t._dirty=!0},this),this.commit(),delete this._ignoreLayoutsNodeChange}},y.prototype._saveInitial=function(){this.nodes.forEach(function(t){t._origX=t.x,t._origY=t.y,t._origW=t.width,t._origH=t.height,delete t._dirty})},n.prototype.column=function(t,e){if(void 0===t)return this.opts.column;if(this.opts.column!==t){var o,i=this.opts.column;if(1===t?this._prevColumn=i:delete this._prevColumn,this.$el.removeClass("grid-stack-"+i),this.$el.addClass("grid-stack-"+t),this.opts.column=this.engine.column=t,!0!==e)this.opts.oneColumnModeDomSort&&1===t&&(o=[],this.$el.children("."+this.opts.itemClass).each(function(t,e){var i=f(e).data("_gridstack_node");i&&o.push(i)}),o.length||(o=void 0)),this.engine._updateNodeWidths(i,t,o),this.engine._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this.engine._ignoreLayoutsNodeChange}},n.prototype.float=function(t){if(void 0===t)return this.opts.float||!1;this.opts.float!==t&&(this.opts.float=this.engine.float=t||!1,t||(this.engine._packNodes(),this.engine._notify(),this._triggerChangeEvent()))},n.prototype.getRow=function(){return this.engine.getRow()},n.prototype.on=function(t,e){-1===t.indexOf(" ")?"change"===t||"added"===t||"removed"===t?(this._gsEventHandler=this._gsEventHandler||{},this._gsEventHandler[t]=function(t){e(t,t.detail)},this.el.addEventListener(t,this._gsEventHandler[t])):this.$el.on(t,e):t.split(" ").forEach(function(t){this.on(t,e)},this)},n.prototype.off=function(t){-1===t.indexOf(" ")?"change"===t||"added"===t||"removed"===t?this._gsEventHandler&&this._gsEventHandler[t]&&(this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t]):this.$el.off(t):t.split(" ").forEach(function(t){this.off(t,callback)},this)},n.prototype.setGridWidth=e(n.prototype.column,"setGridWidth","column","v0.5.3"),n.prototype.setColumn=e(n.prototype.column,"setColumn","column","v0.6.4"),y.prototype.getGridHeight=e(y.prototype.getRow,"getGridHeight","getRow","v1.0.0"),t.GridStack=n,t.GridStack.Utils=v,t.GridStack.Engine=y,t.GridStack.DragDropPlugin=_,n.init=function(t,e){var i=f(e=e||".grid-stack").get(0);if(i)return i.gridstack||(i.gridstack=new n(i,t)),i.gridstack},n.initAll=function(i,t){var o=[];return f(t=t||".grid-stack").each(function(t,e){e.gridstack||(e.gridstack=new n(e,v.clone(i))),o.push(e.gridstack)}),o},t.GridStack}(window.jQuery,window);
//# sourceMappingURL=gridstack.min.map

@@ -8,3 +8,4 @@ Change log

- [1.1.0-dev (upcoming)](#110-dev-upcoming)
- [1.1.1-dev (upcoming)](#111-dev-upcoming)
- [1.1.1 (2020-03-17)](#111-2020-03-17)
- [1.1.0 (2020-02-29)](#110-2020-02-29)

@@ -36,6 +37,14 @@ - [v1.0.0 (2020-02-23)](#v100-2020-02-23)

## 1.1.0-dev (upcoming)
## 1.1.1-dev (upcoming)
- TBD
## 1.1.1 (2020-03-17)
- fix [1187](https://github.com/gridstack/gridstack.js/issues/1187) IE support for `CustomEvent` polyfill - thanks [@phil-blais](https://github.com/phil-blais)
- fix [1204](https://github.com/gridstack/gridstack.js/issues/1204) destroy drag&drop when removing node(s) instead of just disabling it.
- fix [1181](https://github.com/gridstack/gridstack.js/issues/1181) Locked widgets are still moveable by other widgets.
- fix [1217](https://github.com/gridstack/gridstack.js/issues/1217) If I set cellHeight to some vh, only first grid will take vh, rest will use px
- include SASS source files to npm package again [1193](https://github.com/gridstack/gridstack.js/pull/1193)
## 1.1.0 (2020-02-29)

@@ -42,0 +51,0 @@

@@ -8,4 +8,5 @@ gridstack.js API

- [Options](#options)
- [Grid Options](#grid-options)
- [Grid attributes](#grid-attributes)
- [Item Options](#item-options)
- [Item attributes](#item-attributes)

@@ -64,3 +65,3 @@ - [Events](#events)

## Options
## Grid Options

@@ -70,5 +71,8 @@ - `acceptWidgets` - accept widgets dragged from other grids or from outside (default: `false`). Can be:

* string for explicit class name
* function (i: number, element: Element) returning a boolean. See [example](http://gridstack.github.io/gridstack.js/demo/two.html)
- `alwaysShowResizeHandle` - if `true` the resizing handles are shown even if the user is not hovering over the widget
(default: `false`)
* `function (i: number, element: Element): boolean` See [example](http://gridstack.github.io/gridstack.js/demo/two.html)
- `alwaysShowResizeHandle` - possible values (default: `false` only show on hover)
* `true` the resizing handles are always shown even if the user is not hovering over the widget
* advance condition such as this mobile browser agent check:
`alwaysShowResizeHandle: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( navigator.userAgent )`
See [example](http://gridstack.github.io/gridstack.js/demo/advance.html)
- `animate` - turns animation on (default: `false`)

@@ -80,5 +84,5 @@ - `auto` - if `false` gridstack will not initialize existing items (default: `true`)

* 0 or null, in which case the library will not generate styles for rows. Everything must be defined in CSS files.
* `'auto'` - height will be calculated to match cell width (initial square grid).
* `'auto'` - height will be calculated cell square initially.
- `column` - number of columns (default: `12`) which can change on the fly with `column(N)` as well. See [example](http://gridstackjs.com/demo/column.html)
- `ddPlugin` - class that implement drag'n'drop functionallity for gridstack. If `false` grid will be static. (default: `null` - first available plugin will be used)
- `ddPlugin` - class that implement drag'n'drop functionality for gridstack. If `false` grid will be static. (default: `null` - first available plugin will be used)
- `disableDrag` - disallows dragging of widgets (default: `false`).

@@ -94,3 +98,3 @@ - `disableOneColumnMode` - disables the onColumnMode when the window width is less than minWidth (default: 'false')

- `maxRow` - maximum rows amount. Default is `0` which means no max.
- `minRow` - minimum rows amount. Default is `0`. You can also do this with `min-height` CSS attribute on the grid div in pixels, which will round to the closest row.
- `minRow` - minimum rows amount which is handy to prevent grid from collapsing when empty. Default is `0`. You can also do this with `min-height` CSS attribute on the grid div in pixels, which will round to the closest row.
- `minWidth` - minimal width. If window width is less than or equal to, grid will be shown in one-column mode (default: `768`)

@@ -112,22 +116,26 @@ - `oneColumnModeDomSort` - set to `true` if you want oneColumnMode to use the DOM order and ignore x,y from normal multi column layouts during sorting. This enables you to have custom 1 column layout that differ from the rest. (default?: `false`)

- `data-gs-animate` - turns animation on
- `data-gs-column` - amount of columns. Setting non-default value must be supported by equivalent change in CSS, [see docs here](https://github.com/gridstack/gridstack.js#change-grid-columns).
most of the above options are also available as HTML attributes using the `data-gs-` name prefix with standard dash lower case naming convention (ex: `data-gs-column`, `data-gs-min-row`, etc..).
Extras:
- `data-gs-current-row` - (internal) current rows amount. Set by the library only. Can be used by the CSS rules.
- `data-gs-max-row` - maximum rows amount. Default is `0` which means no max.
- `data-gs-min-row` - minimum rows amount. Default is `0`. You can also do this with `min-height` CSS attribute on the grid div in pixels, which will round to the closest row.
- `data-gs-row` - fix grid number of rows. This is a shortcut of writing `data-gs-min-row="N" data-gs-max-row="N"`. (default `0` no constrain)
## Item Options
options you can pass when calling `addWidget()`
- `autoPosition` - tells to ignore `x` and `y` attributes and to place element to the first available position. Having either one missing will also do that.
- `x`, `y` - (number) element position in row/column. Note: if one is missing this will `autoPosition` the item
- `width`, `height` - (number) element size in row/column (default 1x1)
- `maxWidth`, `minWidth`, `maxHeight`, `minHeight` - element constraints in row/column (default none)
- `locked` - means another widget wouldn't be able to move it during dragging or resizing.
The widget can still be dragged or resized by the user.
You need to add `noResize` and `noMove` attributes to completely lock the widget.
- `noResize` - disable element resizing
- `noMove` - disable element moving
- `resizeHandles` - sets resize handles for a specific widget.
- `id`- (number | string) good for quick identification (for example in change event)
## Item attributes
- `data-gs-x`, `data-gs-y` - (number) element position in row/column. Note: if one is missing this will `autoPosition` the item
- `data-gs-width`, `data-gs-height` - (number) element size in row/column
- `data-gs-id`- (number | string) good for quick identification (for example in change event)
- `data-gs-max-width`, `data-gs-min-width`, `data-gs-max-height`, `data-gs-min-height` - element constraints in row/column
- `data-gs-no-resize` - disable element resizing
- `data-gs-no-move` - disable element moving
- `data-gs-auto-position` - tells to ignore `data-gs-x` and `data-gs-y` attributes and to place element to the first available position. Having either one missing will also do that.
- `data-gs-locked` - the widget will be locked. It means another widget wouldn't be able to move it during dragging or resizing.
The widget can still be dragged or resized. You need to add `data-gs-no-resize` and `data-gs-no-move` attributes
to completely lock the widget.
- `data-gs-resize-handles` - sets resize handles for a specific widget.
all item options are also available as HTML attributes using the `data-gs-` name prefix with standard dash lower case naming convention (ex: `data-gs-x`, `data-gs-min-width`, etc..).

@@ -272,3 +280,3 @@ ## Events

relayout grid items to reclaim any empty space.
re-layout grid items to reclaim any empty space.

@@ -275,0 +283,0 @@ ### cellHeight()

{
"name": "gridstack",
"version": "1.1.0",
"version": "1.1.1",
"description": "JavaScript / TypeScript for dashboard layout and creation, no external dependencies, with many wrappers (React, Angular, Ember, knockout...)",

@@ -11,3 +11,3 @@ "main": "dist/gridstack",

"scripts": {
"build": "grunt && doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md",
"build": "rm -rf dist/* && grunt && doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md",
"test": "grunt lint && karma start karma.conf.js",

@@ -14,0 +14,0 @@ "lint": "grunt lint",

@@ -40,2 +40,3 @@ gridstack.js

- [Touch devices support](#touch-devices-support)
- [Migrating to v0.6.x](#migrating-to-v06x)
- [Migrating to v1.0.0](#migrating-to-v100)

@@ -81,4 +82,4 @@ - [Changes](#changes)

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@1.0.0/dist/gridstack.min.css" />
<script src="https://cdn.jsdelivr.net/npm/gridstack@1.0.0/dist/gridstack.all.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@1.1.1/dist/gridstack.min.css" />
<script src="https://cdn.jsdelivr.net/npm/gridstack@1.1.1/dist/gridstack.all.js"></script>
```

@@ -166,3 +167,3 @@

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@0.6.4/dist/gridstack-extra.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@1.1.1/dist/gridstack-extra.css"/>

@@ -224,5 +225,14 @@ <div class="grid-stack grid-stack-N">...</div>

you can also look at the SASS [src/gridstack-extra.scss](https://github.com/gridstack/gridstack.js/blob/develop/src/gridstack-extra.scss) and modify to add more columns
you can also use the SASS [src/gridstack-extra.scss](https://github.com/gridstack/gridstack.js/blob/develop/src/gridstack-extra.scss) included in NPM package and modify to add more columns
and also have the `.grid-stack-N` prefix to support letting the user change columns dynamically.
Sample gulp command for 30 columns:
```js
gulp.src('node_modules/gridstack/dist/src/gridstack-extra.scss')
.pipe(replace('$gridstack-columns: 11 !default;','$gridstack-columns: 30;'))
.pipe(sass({outputStyle: 'compressed'}))
.pipe(rename({extname: '.min.css'}))
.pipe(gulp.dest('dist/css'))
```
## Override resizable/draggable options

@@ -265,2 +275,6 @@

## Migrating to v0.6.x
starting in 0.6.x `change` event are no longer sent (for pretty much most nodes!) when an item is just added/deleted unless it also changes other nodes (was incorrect and causing inefficiencies). You may need to track `added|removed` [events](https://github.com/gridstack/gridstack.js/tree/develop/doc#events) if you didn't and relied on the old broken behavior.
## Migrating to v1.0.0

@@ -270,14 +284,15 @@

1. your code only needs to include `gridstack.all.js` and `gristack.css` (don't include other) and is recommended you do that as internal dependencies will change. Right now jquery+jquery-ui (trimmed versions) are still being used internally for a short while.
1. see [Migrating to v0.6.x](#migrating-to-v06x) if you didn't already
2. code change:
2. your code only needs to include `gridstack.all.js` and `gristack.css` (don't include other JS) and is recommended you do that as internal dependencies will change over time. If you are jquery based, also see note below.
3. code change:
**OLD** initializing code + adding a widget + adding an event:
```js
// initialization returned Jquery element, requiring second call to get GridStack var
$('.grid-stack').gridstack(opts?);
var grid = $('.grid-stack').data('gridstack');
var grid = $('.grid-stack').gridstack(opts?).data('gridstack');
// returned Jquery element
grid.addWidget($('<div><div class="grid-stack-item-content"> test </div></div>'), {width: 2});
grid.addWidget($('<div><div class="grid-stack-item-content"> test </div></div>'), undefined, undefined, 2, undefined, true);

@@ -287,2 +302,4 @@ // jquery event handler

// grid access after init
var grid = $('.grid-stack').data('gridstack');
```

@@ -301,5 +318,6 @@ **NEW**

// grid access after init
var grid = el.gridstack; // where el = document.querySelector('.grid-stack') or other ways...
```
Other vars/global changes
Other vars/global changes
```

@@ -315,4 +333,6 @@ `GridStackUI` --> `GridStack`

We're working on implementing support for other drag'n'drop libraries through the plugin system. Right now it is still jquery-ui based (but minimal build content)
**NOTE: jQuery Applications**
We're working on implementing HTML5 drag'n'drop through the plugin system. Right now it is still jquery-ui based. Because of that we are still bundling `jquery` (3.4.1) + `jquery-ui` (1.12.1 minimal drag|drop|resize) internally in `gridstack.all.js`. IFF your app needs to bring it's own version instead, you should **instead** include `gridstack-poly.min.js` (optional IE support) + `gridstack.min.js` + `gridstack.jQueryUI.min.js` + after you import your libs.
Changes

@@ -319,0 +339,0 @@ =====

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc