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.2 to 1.2.0

2

dist/gridstack-poly.js

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

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

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

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

/** gridstack.js 1.1.2 - IE and older browsers Polyfills for this library @preserve*/
/** gridstack.js 1.2.0 - 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.2
// Type definitions for Gridstack 1.2.0
// Project: https://gridstackjs.com/

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

/** if `true` will add style element to `<head>` otherwise will add it to element's parent node (default `false`). */
styleInHead?: boolean;
/**

@@ -636,0 +639,0 @@ * vertical gap size (default?: 20). Can be:

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

/** gridstack.js 1.1.2 - JQuery UI Drag&Drop plugin @preserve */
/** gridstack.js 1.2.0 - JQuery UI Drag&Drop plugin @preserve */
/**

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

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

/** gridstack.js 1.1.2 - JQuery UI Drag&Drop plugin @preserve */
/** gridstack.js 1.2.0 - 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.2
* gridstack.js 1.2.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,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(Object.prototype.hasOwnProperty.call(t,e)&&(!Object.prototype.hasOwnProperty.call(i,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 c=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){c.cellHeight(c.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)}});c._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(){c.cellHeight(c.cellWidth(),false)},100);this.onResizeHandler=function(){if(n){c._updateHeightsOnResize()}if(!c.opts.disableOneColumnMode&&(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=c.opts.minWidth){if(c.oneColumnMode){return}c.oneColumnMode=true;c.column(1)}else{if(!c.oneColumnMode){return}c.oneColumnMode=false;c.column(c._prevColumn)}};f(window).resize(this.onResizeHandler);this.onResizeHandler();if(!c.opts.staticGrid&&typeof c.opts.removable==="string"){var h=f(c.opts.removable);if(!this.dd.isDroppable(h)){this.dd.droppable(h,c.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!==c){return}i.data("inTrashZone",true);c._setupRemovingTimeout(i)}).on(h,"dropout",function(t,e){var i=f(e.draggable);var o=i.data("_gridstack_node");if(!o||o._grid!==c){return}i.data("inTrashZone",false);c._clearRemovingTimeout(i)})}if(!c.opts.staticGrid&&c.opts.acceptWidgets){var u=null;var p=function(t,e){var i=u;var o=i.data("_gridstack_node");var n=c.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;c.engine.cleanNodes();c.engine.beginUpdate(o);c.engine.addNode(o);c.$el.append(c.placeholder);c.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=c.placeholder.get(0);o._beforeDragX=o.x;o._beforeDragY=o.y;c._updateContainerHeight()}if(!c.engine.canMoveNode(o,s,a)){return}c.engine.moveNode(o,s,a);c._updateContainerHeight()};this.dd.droppable(c.$el,{accept:function(t){t=f(t);var e=t.data("_gridstack_node");if(e&&e._grid===c){return false}return t.is(c.opts.acceptWidgets===true?".grid-stack-item":c.opts.acceptWidgets)}}).on(c.$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=c.cellWidth();var h=c.cellHeight();var l=c.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));u=i;var g=c.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(c.$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;c.engine.removeNode(o);c.placeholder.detach();c._updateContainerHeight();i.data("_gridstack_node",i.data("_gridstack_node_orig"));return false}).on(c.$el,"drop",function(t,e){c.placeholder.detach();var i=f(e.draggable).data("_gridstack_node");i.isOutOfGrid=false;i._grid=c;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);c.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(c.opts.itemClass).enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",p);c.$el.append(o);c._prepareElementsByNode(o,i);c._updateContainerHeight();c.engine._addedNodes.push(i);c._triggerAddEvent();c._triggerChangeEvent();c.engine.endUpdate();f(e.draggable).unbind("drag",p);f(e.draggable).removeData("_gridstack_node");f(e.draggable).removeData("_gridstack_node_orig");c.$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+c/2)/c);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>=u.engine.column||s<0||!u.engine.float&&s>u.engine.getRow()){if(l._temporaryRemoved)return;!0===u.opts.removable&&u._setupRemovingTimeout(h),n=l._beforeDragX,s=l._beforeDragY,u.placeholder.detach(),u.placeholder.hide(),u.engine.removeNode(l),u._updateContainerHeight(),l._temporaryRemoved=!0}else u._clearRemovingTimeout(h),l._temporaryRemoved&&(u.engine.addNode(l),u.placeholder.attr("data-gs-x",n).attr("data-gs-y",s).attr("data-gs-width",i).attr("data-gs-height",o).show(),u.$el.append(u.placeholder),l.el=u.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+u.verticalMargin())/c)}var r=void 0!==i?i:l.lastTriedWidth,d=void 0!==o?o:l.lastTriedHeight;!u.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,u.engine.moveNode(l,n,s,i,o),u._updateContainerHeight(),"resize"===t.type&&f(t.target).trigger("gsresize",l))}function e(t,e){u.$el.append(u.placeholder);var i=f(this);u.engine.cleanNodes(),u.engine.beginUpdate(l),g=u.cellWidth();var o=u.cellHeight();c=(u.$el.height()+u.verticalMargin())/parseInt(u.$el.attr("data-gs-current-row")),u.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=u.placeholder.get(0),l._beforeDragX=l.x,l._beforeDragY=l.y,l._prevYPix=e.position.top;var n=l.minHeight||1,s=u.opts.verticalMargin;u.dd.resizable(h,"option","minWidth",g*(l.minWidth||1)),u.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(u.placeholder.detach(),l.el=i.get(0),u.placeholder.hide(),l._isAboutToRemove)h.data("_gridstack_node")._grid._triggerRemoveEvent(),h.removeData("_gridstack_node"),h.remove();else u._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,u.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));u._updateContainerHeight(),u._triggerChangeEvent(),u.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&&u.$el.trigger("gsresizestop",i)}}var g,c,u=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){e&&(t=f(t),void 0!==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&&(domAttr=this._readAttr(t),v.defaults(e,domAttr),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)))&&i.el.parentElement===this.el&&(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,v.clone(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);
!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(Object.prototype.hasOwnProperty.call(t,e)&&(!Object.prototype.hasOwnProperty.call(i,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,styleInHead:false,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.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();var t=this.opts.styleInHead?void 0:this.el.parentNode;this._styles=v.createStylesheet(this._stylesId,t),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){e&&(t=f(t),void 0!==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){if(void 0!==e&&"object"!=typeof e)return this.addWidget(t,{x:e,y:i,width:o,height:n,autoPosition:s,minWidth:a,maxWidth:r,minHeight:d,maxHeight:h,id:l});if(t=f(t),e){var g=this._readAttr(t);v.defaults(e,g),this.engine._prepareNode(e)}return 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)))&&i.el.parentElement===this.el&&(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,v.clone(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,3 @@ Change log

- [1.1.2-dev (upcoming)](#112-dev-upcoming)
- [1.2.0 (2020-08-01)](#120-2020-08-01)
- [1.1.2 (2020-05-17)](#112-2020-05-17)

@@ -38,5 +38,7 @@ - [1.1.1 (2020-03-17)](#111-2020-03-17)

## 1.1.2-dev (upcoming)
## 1.2.0 (2020-08-01)
TBD
- fix [1311](https://github.com/gridstack/gridstack.js/issues/1311) domAttr is not defined
- adds `styleInHead` option to allow for selecting older behavior (adding STYLE element to HEAD element instead of parentNode)
- update jquery to v3.5.1

@@ -43,0 +45,0 @@ ## 1.1.2 (2020-05-17)

@@ -105,2 +105,3 @@ gridstack.js API

- `staticGrid` - removes drag&drop&resize (default `false`). If `true` widgets are not movable/resizable by the user, but code can still move and oneColumnMode will still work. You don't even need jQueryUI draggable/resizable. A CSS class `grid-stack-static` is also added to the container.
- `styleInHead` - if `true` will add style element to `<head>` otherwise will add it to element's parent node (default `false`).
- `verticalMargin` - vertical gap size (default: `20`). Can be:

@@ -107,0 +108,0 @@ * an integer (px)

{
"name": "gridstack",
"version": "1.1.2",
"version": "1.2.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",

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

```bash
yarn install gridstack
yarn add gridstack
or

@@ -75,14 +75,20 @@ npm install --save gridstack

* local:
after you install:
```js
import 'gridstack/dist/gridstack.all.js';
import 'gridstack/dist/gridstack.css';
```
* alternatively in html
```html
<link rel="stylesheet" href="gridstack.min.css" />
<script src="gridstack.all.js"></script>
<link rel="stylesheet" href="node_modules/gridstack/dist/gridstack.min.css" />
<script src="node_modules/gridstack/dist/gridstack.all.js"></script>
```
* Using CDN (minimized):
* or using CDN (minimized):
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@1.1.2/dist/gridstack.min.css" />
<script src="https://cdn.jsdelivr.net/npm/gridstack@1.1.2/dist/gridstack.all.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@1.2.0/dist/gridstack.min.css" />
<script src="https://cdn.jsdelivr.net/npm/gridstack@1.2.0/dist/gridstack.all.js"></script>
```

@@ -97,2 +103,7 @@

```html
<style type="text/css">
.grid-stack { background: #FAFAD2; }
.grid-stack-item-content { background-color: #18bc9c; }
</style>
<div class="grid-stack"></div>

@@ -109,2 +120,7 @@

```html
<style type="text/css">
.grid-stack { background: #FAFAD2; }
.grid-stack-item-content { background-color: #18bc9c; }
</style>
<div class="grid-stack">

@@ -172,3 +188,3 @@ <div class="grid-stack-item">

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

@@ -335,3 +351,3 @@ <div class="grid-stack grid-stack-N">...</div>

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.
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.5.1) + `jquery-ui` (1.12.1 minimal drag|drop|resize) internally in `gridstack.all.js`. IFF your app needs to bring your 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 JQ libs. But note that there are issue with jQuery and ES6 import (see [1306](https://github.com/gridstack/gridstack.js/issues/1306))

@@ -338,0 +354,0 @@ Changes

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

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

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