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

gridstack

Package Overview
Dependencies
Maintainers
3
Versions
112
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.0.0 to 1.1.0

2

dist/gridstack-poly.js

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

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

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

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

/** gridstack.js 1.0.0 - IE and older browsers Polyfills for this library @preserve*/
/** 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});
//# sourceMappingURL=gridstack.min.map

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

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

@@ -27,3 +27,3 @@ // Definitions by: Pascal Senn <https://github.com/PascalSenn>

type GridStackEvent = 'added' | 'change' | 'disable' | 'dragstart' | 'dragstop' | 'dropped' |
'enable' | 'removed' | 'resize' | 'resizestart' | 'gsresizestop';
'enable' | 'removed' | 'resize' | 'resizestart' | 'gsresizestop' | string;

@@ -300,3 +300,3 @@ interface GridStack {

* notifications (see doc for supported events)
* @param name of the event (see possible values)
* @param name of the event (see possible values) or list of names space separated
* @param callback function called with event and optional second/third param

@@ -307,2 +307,4 @@ * (see README documentation for each signature).

* grid.on('added', function(e, items) { log('added ', items)} );
* or
* grid.on('added removed change', function(e, items) { log(e.type, items)} );
*

@@ -309,0 +311,0 @@ * Note: in some cases it is the same as calling native handler and parsing the event.

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

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

@@ -27,3 +27,3 @@ // Definitions by: Pascal Senn <https://github.com/PascalSenn>

type GridStackEvent = 'added' | 'change' | 'disable' | 'dragstart' | 'dragstop' | 'dropped' |
'enable' | 'removed' | 'resize' | 'resizestart' | 'gsresizestop';
'enable' | 'removed' | 'resize' | 'resizestart' | 'gsresizestop' | string;

@@ -300,3 +300,3 @@ interface GridStack {

* notifications (see doc for supported events)
* @param name of the event (see possible values)
* @param name of the event (see possible values) or list of names space separated
* @param callback function called with event and optional second/third param

@@ -307,2 +307,4 @@ * (see README documentation for each signature).

* grid.on('added', function(e, items) { log('added ', items)} );
* or
* grid.on('added removed change', function(e, items) { log(e.type, items)} );
*

@@ -309,0 +311,0 @@ * Note: in some cases it is the same as calling native handler and parsing the event.

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

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

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

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

/** gridstack.js 1.0.0 - JQuery UI Drag&Drop plugin @preserve */
/** 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}();
//# sourceMappingURL=gridstack.min.map
/**
* gridstack.js 1.0.0
* gridstack.js 1.1.0
* 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,n){var o=function(){console.warn("gridstack.js: Function `"+e+"` is deprecated in "+n+" and has been replaced "+"with `"+i+"`. It will be **completely** removed in v1.0");return t.apply(this,arguments)};o.prototype=t.prototype;return o},h=function(t,e,i,n){if(t[e]!==undefined){t[i]=t[e];console.warn("gridstack.js: Option `"+e+"` is deprecated in "+n+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}},l=function(t,e,i,n){if(t[e]!==undefined){console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+n)}},g=function(t,e,i,n){var o=t.attr(e);if(o!==undefined){t.attr(i,o);console.warn("gridstack.js: attribute `"+e+"`="+o+" is deprecated on this object in "+n+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}},m={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 n=t.map(function(t){return t.x+t.width});i=Math.max.apply(Math,n)}if(e===-1)return m.sortBy(t,function(t){return-(t.x+t.y*i)});else return m.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,n){if(typeof t.insertRule==="function"){t.insertRule(e+"{"+i+"}",n)}else if(typeof t.addRule==="function"){t.addRule(e,i,n)}},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&&m.isIntercepted(t,this.nn)},_didCollide:function(t){return m.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},t)},_isAddNodeIntercepted:function(t){return m.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 n=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!n){throw new Error("Invalid height")}i=n[2]||"px";e=parseFloat(n[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,o){return t.slice(0).sort(function(t,e){var i=o(t);var n=o(e);if(n===i){return 0}return i>n?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=m.getScrollParent(t.parentNode)}return e},updateScrollPosition:function(t,e,i){var n=t.getBoundingClientRect();var o=window.innerHeight||document.documentElement.clientHeight;if(n.top<0||n.bottom>o){var a=n.bottom-o;var s=n.top;var r=m.getScrollParent(t);if(r!==null){var d=r.scrollTop;if(n.top<0&&i<0){if(t.offsetHeight>o){r.scrollTop+=i}else{r.scrollTop+=Math.abs(s)>Math.abs(i)?i:s}}else if(i>0){if(t.offsetHeight>o){r.scrollTop+=i}else{r.scrollTop+=a>i?i:a}}e.position.top+=r.scrollTop-d}}}};function v(t){this.grid=t}v.registeredPlugins=[],v.registerPlugin=function(t){v.registeredPlugins.push(t)},v.prototype.resizable=function(t,e){return this},v.prototype.draggable=function(t,e){return this},v.prototype.droppable=function(t,e){return this},v.prototype.isDroppable=function(t){return false},v.prototype.on=function(t,e,i){return this};var a=0,_=function(t,e,i,n,o){this.column=t||12;this.float=i||false;this.maxRow=n||0;this.nodes=o||[];this.onchange=e||function(){};this._addedNodes=[];this._removedNodes=[];this._batchMode=false};_.prototype.batchUpdate=function(){if(this._batchMode)return;this._batchMode=true;this._prevFloat=this.float;this.float=true},_.prototype.commit=function(){if(!this._batchMode)return;this._batchMode=false;this.float=this._prevFloat;delete this._prevFloat;this._packNodes();this._notify()},_.prototype.getNodeDataByDOMEl=function(e){return this.nodes.find(function(t){return e===t.el})},_.prototype._fixCollisions=function(t){var e=this;this._sortNodes(-1);var i=t;var n=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.float&&!n){i={x:0,y:t.y,width:this.column,height:t.height}}while(true){var o=this.nodes.find(m._collisionNodeCheck,{node:t,nn:i});if(!o){return}this.moveNode(o,o.x,t.y+t.height,o.width,o.height,true)}},_.prototype.isAreaEmpty=function(t,e,i,n){var o={x:t||0,y:e||0,width:i||1,height:n||1};var a=this.nodes.find(function(t){return m.isIntercepted(t,o)});return!a},_.prototype._sortNodes=function(t){this.nodes=m.sort(this.nodes,t,this.column)},_.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 n=this.nodes.slice(0,e).find(m._didCollide,{n:t,newY:i});if(!n){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 n=e===0;if(e>0){var o=this.nodes.slice(0,e).find(m._didCollide,{n:t,newY:i});n=o===undefined}if(!n){break}t._dirty=t.y!==i;t.y=i}},this)}},_.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=m.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.width>this.column){t.width=this.column}else if(t.width<1){t.width=1}if(t.height<1){t.height=1}if(t.x<0){t.x=0}if(t.x+t.width>this.column){if(e){t.width=this.column-t.x}else{t.x=this.column-t.width}}if(t.y<0){t.y=0}return t},_.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])},_.prototype.cleanNodes=function(){if(this._batchMode){return}this.nodes.forEach(function(t){delete t._dirty})},_.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})},_.prototype.addNode=function(t,e){t=this._prepareNode(t);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)}t._id=t._id||++a;if(t.autoPosition){this._sortNodes();for(var i=0;;++i){var n=i%this.column;var o=Math.floor(i/this.column);if(n+t.width>this.column){continue}if(!this.nodes.find(m._isAddNodeIntercepted,{x:n,y:o,node:t})){t.x=n;t.y=o;delete t.autoPosition;break}}}this.nodes.push(t);if(e){this._addedNodes.push(t)}this._fixCollisions(t);this._packNodes();this._notify();return t},_.prototype.removeNode=function(t,e){e=e===undefined?true:e;this._removedNodes.push(t);t._id=null;this.nodes=m.without(this.nodes,t);this._packNodes();this._notify(t,e)},_.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)},_.prototype.canMoveNode=function(e,t,i,n,o){if(!this.isNodeChangedPosition(e,t,i,n,o)){return false}var a=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.maxRow&&!a){return true}var s;var r=new _(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,n,o);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},_.prototype.canBePlacedWithRespectToHeight=function(t){if(!this.maxRow){return true}var e=new _(this.column,null,this.float,0,this.nodes.map(function(t){return f.extend({},t)}));e.addNode(t);return e.getRow()<=this.maxRow},_.prototype.isNodeChangedPosition=function(t,e,i,n,o){if(typeof e!=="number"){e=t.x}if(typeof i!=="number"){i=t.y}if(typeof n!=="number"){n=t.width}if(typeof o!=="number"){o=t.height}if(t.maxWidth!==undefined){n=Math.min(n,t.maxWidth)}if(t.maxHeight!==undefined){o=Math.min(o,t.maxHeight)}if(t.minWidth!==undefined){n=Math.max(n,t.minWidth)}if(t.minHeight!==undefined){o=Math.max(o,t.minHeight)}if(t.x===e&&t.y===i&&t.width===n&&t.height===o){return false}return true},_.prototype.moveNode=function(t,e,i,n,o,a){if(typeof e!=="number"){e=t.x}if(typeof i!=="number"){i=t.y}if(typeof n!=="number"){n=t.width}if(typeof o!=="number"){o=t.height}if(t.maxWidth!==undefined){n=Math.min(n,t.maxWidth)}if(t.maxHeight!==undefined){o=Math.min(o,t.maxHeight)}if(t.minWidth!==undefined){n=Math.max(n,t.minWidth)}if(t.minHeight!==undefined){o=Math.max(o,t.minHeight)}if(t.x===e&&t.y===i&&t.width===n&&t.height===o){return t}var s=t.width!==n;t._dirty=true;t.x=e;t.y=i;t.width=n;t.height=o;t.lastTriedX=e;t.lastTriedY=i;t.lastTriedWidth=n;t.lastTriedHeight=o;t=this._prepareNode(t,s);this._fixCollisions(t);if(!a){this._packNodes();this._notify()}return t},_.prototype.getRow=function(){return this.nodes.reduce(function(t,e){return Math.max(t,e.y+e.height)},0)},_.prototype.beginUpdate=function(t){if(t._updating)return;t._updating=true;this.nodes.forEach(function(t){t._packY=t.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 o=function(t,e){var u=this;var i,n,o;e=e||{};this.$el=f(t);this.el=this.$el.get(0);h(e,"width","column","v0.5.3");h(e,"height","maxRow","v0.5.3");l(e,"oneColumnModeClass","v0.6.3",". Use class `.grid-stack-1` instead");g(this.$el,"data-gs-width","data-gs-column","v0.5.3");g(this.$el,"data-gs-height","data-gs-max-row","v0.5.3");g(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;this.opts=m.defaults(e,{column:parseInt(this.$el.attr("data-gs-column"))||12,maxRow: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:m.defaults(e.resizable||{},{autoHide:!(e.alwaysShowResizeHandle||false),handles:"se"}),draggable:m.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:m.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=v}else if(this.opts.ddPlugin===null){this.opts.ddPlugin=v.registeredPlugins[0]||v}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;o=this.opts.cellHeight==="auto";if(o){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 _(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 s=[];var r=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 n=parseInt(e.attr("data-gs-y"));s.push({el:e.get(0),i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(n)?1e3:n)*r.opts.column})});m.sortBy(s,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=m.throttle(function(){u.cellHeight(u.cellWidth(),false)},100);this.onResizeHandler=function(){if(o){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 d=f(u.opts.removable);if(!this.dd.isDroppable(d)){this.dd.droppable(d,u.opts.removableOptions)}this.dd.on(d,"dropover",function(t,e){var i=f(e.draggable);var n=i.data("_gridstack_node");if(!n||n._grid!==u){return}i.data("inTrashZone",true);u._setupRemovingTimeout(i)}).on(d,"dropout",function(t,e){var i=f(e.draggable);var n=i.data("_gridstack_node");if(!n||n._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 n=i.data("_gridstack_node");var o=u.getCellFromPixel({left:t.pageX,top:t.pageY},true);var a=Math.max(0,o.x);var s=Math.max(0,o.y);if(!n._added){n._added=true;n.el=i.get(0);n.autoPosition=true;n.x=a;n.y=s;u.engine.cleanNodes();u.engine.beginUpdate(n);u.engine.addNode(n);u.$el.append(u.placeholder);u.placeholder.attr("data-gs-x",n.x).attr("data-gs-y",n.y).attr("data-gs-width",n.width).attr("data-gs-height",n.height).show();n.el=u.placeholder.get(0);n._beforeDragX=n.x;n._beforeDragY=n.y;u._updateContainerHeight()}if(!u.engine.canMoveNode(n,a,s)){return}u.engine.moveNode(n,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 n,o;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;n=a&&a.width?a.width:Math.ceil(i.outerWidth()/d);o=a&&a.height?a.height:Math.round((i.outerHeight()+l)/(h+l));c=i;var g=u.engine._prepareNode({width:n,height:o,_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 n=i.data("_gridstack_node");if(!n.isOutOfGrid){return}i.unbind("drag",p);n.el=null;u.engine.removeNode(n);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 n=f(e.draggable).clone(false);n.data("_gridstack_node",i);var o=f(e.draggable).data("_gridstack_node_orig");if(o!==undefined&&o._grid!==undefined){o._grid._triggerRemoveEvent()}f(e.helper).remove();i.el=n.get(0);u.placeholder.hide();m.removePositioningStyles(n);n.find("div.ui-resizable-handle").remove();n.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(n);u._prepareElementsByNode(n,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",[o,i]);return false})}};o.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()}},o.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=[])},o.prototype._triggerRemoveEvent=function(){this.engine._batchMode||this.engine._removedNodes&&0<this.engine._removedNodes.length&&(this._triggerEvent("removed",this.engine._removedNodes),this.engine._removedNodes=[])},o.prototype._triggerEvent=function(t,e){var i=new CustomEvent(t,{detail:e});this.el.dispatchEvent(i)},o.prototype._initStyles=function(){this._stylesId&&m.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=m.createStylesheet(this._stylesId,this.el.parentNode),null!==this._styles&&(this._styles._max=0)},o.prototype._updateStyles=function(t){if(null!==this._styles&&void 0!==this._styles){var e,i="."+this.opts._class+" ."+this.opts.itemClass,n=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("+(n.opts.cellHeight*t+n.opts.cellHeightUnit)+" + "+(n.opts.verticalMargin*e+n.opts.verticalMarginUnit)+")":n.opts.cellHeight*t+n.opts.verticalMargin*e+n.opts.cellHeightUnit}:function(t,e){return n.opts.cellHeight*t+n.opts.verticalMargin*e+n.opts.cellHeightUnit},0===this._styles._max&&m.insertCSSRule(this._styles,i,"min-height: "+e(1,0)+";",0),t>this._styles._max)){for(var o=this._styles._max;o<t;++o)m.insertCSSRule(this._styles,i+'[data-gs-height="'+(o+1)+'"]',"height: "+e(o+1,o)+";",o),m.insertCSSRule(this._styles,i+'[data-gs-min-height="'+(o+1)+'"]',"min-height: "+e(o+1,o)+";",o),m.insertCSSRule(this._styles,i+'[data-gs-max-height="'+(o+1)+'"]',"max-height: "+e(o+1,o)+";",o),m.insertCSSRule(this._styles,i+'[data-gs-y="'+o+'"]',"top: "+e(o,o)+";",o);this._styles._max=t}}},o.prototype._updateContainerHeight=function(){if(!this.engine._batchMode){var t=this.engine.getRow(),e=parseInt(this.$el.css("min-height"));if(0<e){var i=this.opts.verticalMargin,n=Math.round((e+i)/(this.cellHeight()+i));t<n&&(t=n)}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))}},o.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))},o.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)},o.prototype._prepareElementsByNode=function(h,l){function t(t,e){var i,n,o=Math.round(e.position.left/g),a=Math.floor((e.position.top+u/2)/u);if("drag"!==t.type&&(i=Math.round(e.size.width/g),n=Math.round(e.size.height/u)),"drag"===t.type){var s=e.position.top-l._prevYPix;if(l._prevYPix=e.position.top,m.updateScrollPosition(h[0],e,s),h.data("inTrashZone")||o<0||o>=c.engine.column||a<0||!c.engine.float&&a>c.engine.getRow()){if(l._temporaryRemoved)return;!0===c.opts.removable&&c._setupRemovingTimeout(h),o=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",o).attr("data-gs-y",a).attr("data-gs-width",i).attr("data-gs-height",n).show(),c.$el.append(c.placeholder),l.el=c.placeholder.get(0),l._temporaryRemoved=!1)}else if("resize"===t.type&&o<0)return;var r=void 0!==i?i:l.lastTriedWidth,d=void 0!==n?n:l.lastTriedHeight;!c.engine.canMoveNode(l,o,a,i,n)||l.lastTriedX===o&&l.lastTriedY===a&&l.lastTriedWidth===r&&l.lastTriedHeight===d||(l.lastTriedX=o,l.lastTriedY=a,l.lastTriedWidth=i,l.lastTriedHeight=n,c.engine.moveNode(l,o,a,i,n),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 n=c.cellHeight();u=c.$el.height()/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 o=l.minHeight||1,a=c.opts.verticalMargin;c.dd.resizable(h,"option","minWidth",g*(l.minWidth||1)),c.dd.resizable(h,"option","minHeight",n*o+(o-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?(m.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)):(m.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 n=i.find(".grid-stack");n.length&&"resizestop"===t.type&&(n.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)},o.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)},o.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)},o.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=m.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=m.toBool(t.attr("data-gs-no-resize")),e.noMove=m.toBool(t.attr("data-gs-no-move")),e.locked=m.toBool(t.attr("data-gs-locked")),e.resizeHandles=t.attr("data-gs-resize-handles"),e.id=t.attr("data-gs-id"),e},o.prototype.setAnimation=function(t){t?this.$el.addClass("grid-stack-animate"):this.$el.removeClass("grid-stack-animate")},o.prototype.addWidget=function(t,e,i,n,o,a,s,r,d,h,l){return void 0!==e&&"object"!=typeof e?this.addWidget(t,{x:e,y:i,width:n,height:o,autoPosition:a,minWidth:s,maxWidth:r,minHeight:d,maxHeight:h,id:l}):(e=e||{},t=f(t),this._writeAttr(t,e),this.$el.append(t),this.makeWidget(t))},o.prototype.makeWidget=function(t){return t=f(t),this._prepareElement(t,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(!0),t.get(0)},o.prototype.willItFit=function(t,e,i,n,o){var a={x:t,y:e,width:i,height:n,autoPosition:o};return this.engine.canBePlacedWithRespectToHeight(a)},o.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)},o.prototype.removeAll=function(t){!1!==t&&this.engine.nodes.forEach(function(t){f(t.el).removeData("_gridstack_node")}),this.engine.removeAll(t),this._triggerRemoveEvent()},o.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),m.removeStylesheet(this._stylesId),this.engine&&(this.engine=null)},o.prototype.resizable=function(t,n){var o=this;return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.noResize=!n,i.noResize?o.dd.resizable(e,"disable"):o.dd.resizable(e,"enable"))}),this},o.prototype.movable=function(t,n){var o=this;return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.noMove=!n,i.noMove?(o.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(o.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},o.prototype.enableMove=function(t,e){this.movable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableDrag=!t)},o.prototype.enableResize=function(t,e){this.resizable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableResize=!t)},o.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")},o.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")},o.prototype.locked=function(t,n){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.locked=n||!1,e.attr("data-gs-locked",i.locked?"yes":null))}),this},o.prototype.maxHeight=function(t,n){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(n)||(i.maxHeight=n||!1,e.attr("data-gs-max-height",n)))}),this},o.prototype.minHeight=function(t,n){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(n)||(i.minHeight=n||!1,e.attr("data-gs-min-height",n)))}),this},o.prototype.maxWidth=function(t,n){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(n)||(i.maxWidth=n||!1,e.attr("data-gs-max-width",n)))}),this},o.prototype.minWidth=function(t,n){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(n)||(i.minWidth=n||!1,e.attr("data-gs-min-width",n)))}),this},o.prototype._updateElement=function(t,e){var i=(t=f(t).first()).data("_gridstack_node");if(i){var n=this;n.engine.cleanNodes(),n.engine.beginUpdate(i),e.call(this,t,i),n._updateContainerHeight(),n._triggerChangeEvent(),n.engine.endUpdate()}},o.prototype.resize=function(t,i,n){this._updateElement(t,function(t,e){i=null!=i?i:e.width,n=null!=n?n:e.height,this.engine.moveNode(e,e.x,e.y,i,n)})},o.prototype.move=function(t,i,n){this._updateElement(t,function(t,e){i=null!=i?i:e.x,n=null!=n?n:e.y,this.engine.moveNode(e,i,n,e.width,e.height)})},o.prototype.update=function(t,i,n,o,a){this._updateElement(t,function(t,e){i=null!=i?i:e.x,n=null!=n?n:e.y,o=null!=o?o:e.width,a=null!=a?a:e.height,this.engine.moveNode(e,i,n,o,a)})},o.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()}},o.prototype.verticalMargin=function(t,e){if(void 0===t)return this.opts.verticalMargin;var i=m.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())},o.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(),n=i.attr("data-gs-height"),o=this.opts.verticalMargin;return Math.round((i.outerHeight()-(n-1)*o)/n)}var a=m.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())},o.prototype.cellWidth=function(){return Math.round(this.$el.outerWidth()/this.opts.column)},o.prototype.getCellFromPixel=function(t,e){var i=void 0!==e&&e?this.$el.offset():this.$el.position(),n=t.left-i.left,o=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(n/a),y:Math.floor(o/s)}},o.prototype.batchUpdate=function(){this.engine.batchUpdate()},o.prototype.commit=function(){this.engine.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()},o.prototype.isAreaEmpty=function(t,e,i,n){return this.engine.isAreaEmpty(t,e,i,n)},o.prototype.setStatic=function(t){this.opts.staticGrid=!0===t,this.enableMove(!t),this.enableResize(!t),this._setStaticClass()},o.prototype._setStaticClass=function(){var t="grid-stack-static";!0===this.opts.staticGrid?this.$el.addClass(t):this.$el.removeClass(t)},_.prototype._layoutsNodesChange=function(t){this._layouts&&!this._ignoreLayoutsNodeChange&&this._layouts.forEach(function(n,o){n&&o!==this.column&&(o<this.column?this._layouts[o]=void 0:t.forEach(function(e){var t=n.find(function(t){return t._id===e._id});if(t){var i=o/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)},_.prototype._updateNodeWidths=function(e,i,n){if(this.nodes.length&&e!==i){var o=[this.nodes.length];if(this.nodes.forEach(function(t,e){o[e]={x:t.x,y:t.y,width:t.width,_id:t._id}}),this._layouts=this._layouts||[],this._layouts[e]=o,1===i&&n&&n.length){var a=0;n.forEach(function(t){t.x=0,t.width=1,t.y=Math.max(t.y,a),a=t.y+t.height})}else n=m.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=n.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(n[t].x=e.x,n[t].y=e.y,n[t].width=e.width)}),t=[]);var r=[];t.forEach(function(e){var t=n.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(n[t].x=e.x,n[t].y=e.y,n[t].width=e.width,r.push(n[t]),n[t]=null)});var d=i/e;n.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=m.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}},_.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})},o.prototype.column=function(t,e){if(void 0===t)return this.opts.column;if(this.opts.column!==t){var n,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&&(n=[],this.$el.children("."+this.opts.itemClass).each(function(t,e){var i=f(e).data("_gridstack_node");i&&n.push(i)}),n.length||(n=void 0)),this.engine._updateNodeWidths(i,t,n),this.engine._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this.engine._ignoreLayoutsNodeChange}},o.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()))},o.prototype.getRow=function(){return this.engine.getRow()},o.prototype.on=function(t,e){"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)},o.prototype.off=function(t){"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)},o.prototype.setGridWidth=e(o.prototype.column,"setGridWidth","column","v0.5.3"),o.prototype.setColumn=e(o.prototype.column,"setColumn","column","v0.6.4"),_.prototype.getGridHeight=e(_.prototype.getRow,"getGridHeight","getRow","v1.0.0"),t.GridStack=o,t.GridStack.Utils=m,t.GridStack.Engine=_,t.GridStack.DragDropPlugin=v,o.init=function(t,e){var i=f(e=e||".grid-stack").get(0);if(i)return i.gridstack||(i.gridstack=new o(i,t)),i.gridstack},o.initAll=function(i,t){var n=[];return f(t=t||".grid-stack").each(function(t,e){e.gridstack||(e.gridstack=new o(e,i)),n.push(e.gridstack)}),n},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 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);
//# sourceMappingURL=gridstack.min.map

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

- [1.1.0-dev (upcoming)](#110-dev-upcoming)
- [1.1.0 (2020-02-29)](#110-2020-02-29)
- [v1.0.0 (2020-02-23)](#v100-2020-02-23)

@@ -34,2 +36,13 @@ - [v0.6.4 (2020-02-17)](#v064-2020-02-17)

## 1.1.0-dev (upcoming)
- TBD
## 1.1.0 (2020-02-29)
- add `minRow` and `row` grid options (which set minRow=maxRow=N) [1172](https://github.com/gridstack/gridstack.js/issues/1172) - thanks [@RadoiAndrei](https://github.com/RadoiAndrei)
- fix [1166](https://github.com/gridstack/gridstack.js/issues/1166) resize not taking margin height into account - thanks [@awjae](https://github.com/awjae)
- fix [1155](https://github.com/gridstack/gridstack.js/issues/1155) `maxRow` now limit initial item placement if out of bound, preventing broken drag behavior
- fix [1171](https://github.com/gridstack/gridstack.js/issues/1171) added event support to call `grid.on('added removed change', callback)` again even with native events.
## v1.0.0 (2020-02-23)

@@ -36,0 +49,0 @@

@@ -89,3 +89,4 @@ gridstack.js API

- `itemClass` - widget class (default: `'grid-stack-item'`)
- `maxRow` - maximum rows amount. Default is `0` which means no maximum rows
- `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.
- `minWidth` - minimal width. If window width is less than or equal to, grid will be shown in one-column mode (default: `768`)

@@ -98,2 +99,3 @@ - `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`)

- `removeTimeout` - time in milliseconds before widget is being removed while dragging outside of the grid. (default: `2000`)
- `row` - fix grid number of rows. This is a shortcut of writing `minRow:N, maxRow:N`. (default `0` no constrain)
- `rtl` - if `true` turns grid to RTL. Possible values are `true`, `false`, `'auto'` (default: `'auto'`) See [example](http://gridstackjs.com/demo/rtl.html)

@@ -109,4 +111,6 @@ - `staticGrid` - makes grid static (default `false`). If true widgets are not movable/resizable. You don't even need jQueryUI draggable/resizable. A CSS class `grid-stack-static` is also added to the container.

- `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).
- `data-gs-max-row` - maximum rows amount. Default is `0` which means no maximum rows.
- `data-gs-current-row` - current rows amount. Set by the library only. Can be used by the CSS rules.
- `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)

@@ -129,5 +133,8 @@ ## Item attributes

Those are the events set by the grid when items are added/removed or changed - they use standard JS calls with a CustomElement that stores the list
of nodes that changed (id, x, y, width, height, etc...)
Those are the events set by the grid when items are added/removed or changed - they use standard JS calls with a CustomElement `detail` that stores the list
of nodes that changed (id, x, y, width, height, etc...).
You can call it on a single event name, or space separated list:
`grid.on('added removed change', ...)`
### added(event, items)

@@ -134,0 +141,0 @@

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

@@ -5,0 +5,0 @@ "main": "dist/gridstack",

@@ -147,3 +147,3 @@ gridstack.js

- ember: [gridstack-ember](https://github.com/yahoo/ember-gridstack)
- ember: [ember-gridstack](https://github.com/yahoo/ember-gridstack)
- AngularJS: [gridstack-angular](https://github.com/kdietrich/gridstack-angular)

@@ -274,3 +274,3 @@ - Angular8: [lb-gridstack](https://github.com/pfms84/lb-gridstack)

$('.grid-stack').gridstack(opts?);
var grid = $('.grid-stack').data('grid-stack');
var grid = $('.grid-stack').data('gridstack');

@@ -287,3 +287,3 @@ // returned Jquery element

// element identifier defaults to '.grid-stack', returns the grid
// for Typescript use window.GridStack.init()
// Note: for Typescript use window.GridStack.init() until next native TS version
var grid = GridStack.init(opts?, element?);

@@ -308,3 +308,3 @@

Recommend looking at the [many samples](../demo) for more code examples.
Recommend looking at the [many samples](./demo) for more code examples.

@@ -311,0 +311,0 @@ 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)

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