gridstack
Advanced tools
Comparing version 3.0.0 to 3.1.0
"use strict"; | ||
// gridstack-GridStackDD.get().ts 3.0.0 @preserve | ||
// gridstack-GridStackDD.get().ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GridStackDD = void 0; | ||
/** | ||
@@ -443,3 +442,3 @@ * https://gridstackjs.com/ | ||
gridstack_1.GridStack.prototype.movable = function (els, val) { | ||
if (val && this.opts.staticGrid) { | ||
if (this.opts.staticGrid) { | ||
return this; | ||
@@ -449,3 +448,3 @@ } // can't move a static grid! | ||
let node = el.gridstackNode; | ||
if (!node) { | ||
if (!node || node.locked) { | ||
return; | ||
@@ -472,3 +471,3 @@ } | ||
gridstack_1.GridStack.prototype.resizable = function (els, val) { | ||
if (val && this.opts.staticGrid) { | ||
if (this.opts.staticGrid) { | ||
return this; | ||
@@ -478,3 +477,3 @@ } // can't resize a static grid! | ||
let node = el.gridstackNode; | ||
if (!node) { | ||
if (!node || node.locked) { | ||
return; | ||
@@ -481,0 +480,0 @@ } |
"use strict"; | ||
// gridstack-ddi.ts 3.0.0 @preserve | ||
// gridstack-ddi.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GridStackDDI = void 0; | ||
/** | ||
@@ -6,0 +5,0 @@ * Abstract Partial Interface API for drag'n'drop plugin - look at GridStackDD and HTML5 / Jquery implementation versions |
@@ -24,5 +24,4 @@ import { GridStackNode } from './types'; | ||
/** enable/disable floating widgets (default: `false`) See [example](http://gridstackjs.com/demo/float.html) */ | ||
set float(val: boolean); | ||
/** float getter method */ | ||
get float(): boolean; | ||
float: boolean; | ||
/** | ||
@@ -29,0 +28,0 @@ * given a random node, makes sure it's coordinates/values are valid in the current grid |
"use strict"; | ||
// gridstack-engine.ts 3.0.0 @preserve | ||
// gridstack-engine.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GridStackEngine = void 0; | ||
/** | ||
@@ -369,6 +368,6 @@ * https://gridstackjs.com/ | ||
if (n === node) { | ||
clonedNode = utils_1.Utils.clone(n); | ||
clonedNode = Object.assign({}, n); | ||
return clonedNode; | ||
} | ||
return utils_1.Utils.clone(n); | ||
return Object.assign({}, n); | ||
})); | ||
@@ -394,3 +393,3 @@ if (!clonedNode) { | ||
} | ||
let clone = new GridStackEngine(this.column, null, this.float, 0, this.nodes.map(n => utils_1.Utils.clone(n))); | ||
let clone = new GridStackEngine(this.column, null, this.float, 0, this.nodes.map(n => { return Object.assign({}, n); })); | ||
clone.addNode(node); | ||
@@ -397,0 +396,0 @@ return clone.getRow() <= this.maxRow; |
@@ -1,31 +0,29 @@ | ||
// dd-base-impl.ts 3.0.0 @preserve | ||
// dd-base-impl.ts 3.1.0 @preserve | ||
// dd-draggable.ts 3.0.0 @preserve | ||
// dd-draggable.ts 3.1.0 @preserve | ||
// dd-droppable.ts 3.0.0 @preserve | ||
// dd-droppable.ts 3.1.0 @preserve | ||
// dd-elements.ts 3.0.0 @preserve | ||
// dd-elements.ts 3.1.0 @preserve | ||
// dd-manager.ts 3.0.0 @preserve | ||
// dd-manager.ts 3.1.0 @preserve | ||
// dd-resizable-handle.ts 3.0.0 @preserve | ||
// dd-resizable-handle.ts 3.1.0 @preserve | ||
// dd-resizable.ts 3.0.0 @preserve | ||
// dd-resizable.ts 3.1.0 @preserve | ||
// dd-utils.ts 3.0.0 @preserve | ||
// dd-utils.ts 3.1.0 @preserve | ||
// gridstack-GridStackDD.get().ts 3.0.0 @preserve | ||
// gridstack-GridStackDD.get().ts 3.1.0 @preserve | ||
// gridstack-dd-native.ts 3.0.0 @preserve | ||
// gridstack-dd-native.ts 3.1.0 @preserve | ||
// gridstack-ddi.ts 3.0.0 @preserve | ||
// gridstack-ddi.ts 3.1.0 @preserve | ||
// gridstack-engine.ts 3.0.0 @preserve | ||
// gridstack-engine.ts 3.1.0 @preserve | ||
// gridstack.ts 3.0.0 @preserve | ||
// gridstack.ts 3.1.0 @preserve | ||
// index.html5.ts 3.0.0 - everything you need for a Grid that uses HTML5 native drag&drop (work in progress) @preserve | ||
// index.html5.ts 3.1.0 - everything you need for a Grid that uses HTML5 native drag&drop (work in progress) @preserve | ||
// types.ts 3.0.0 @preserve | ||
// utils.ts 3.0.0 @preserve | ||
// utils.ts 3.1.0 @preserve |
@@ -32,16 +32,14 @@ /*! | ||
// gridstack-GridStackDD.get().ts 3.0.0 @preserve | ||
// gridstack-GridStackDD.get().ts 3.1.0 @preserve | ||
// gridstack-dd-jqueryui.ts 3.0.0 @preserve | ||
// gridstack-dd-jqueryui.ts 3.1.0 @preserve | ||
// gridstack-ddi.ts 3.0.0 @preserve | ||
// gridstack-ddi.ts 3.1.0 @preserve | ||
// gridstack-engine.ts 3.0.0 @preserve | ||
// gridstack-engine.ts 3.1.0 @preserve | ||
// gridstack.ts 3.0.0 @preserve | ||
// gridstack.ts 3.1.0 @preserve | ||
// index.jq.ts 3.0.0 - everything you need for a Grid that uses Jquery-ui drag&drop (original, full feature) @preserve | ||
// index.jq.ts 3.1.0 - everything you need for a Grid that uses Jquery-ui drag&drop (original, full feature) @preserve | ||
// types.ts 3.0.0 @preserve | ||
// utils.ts 3.0.0 @preserve | ||
// utils.ts 3.1.0 @preserve |
/*! For license information please see gridstack-static.js.LICENSE.txt */ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.GridStack=e():t.GridStack=e()}(self,(function(){return(()=>{"use strict";var t={334:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GridStackDDI=void 0;class i{static registerPlugin(t){i.ddi=new t}static get(){return i.ddi||i.registerPlugin(i),i.ddi}remove(t){return this}}e.GridStackDDI=i},62:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GridStackEngine=void 0;const s=i(593);class o{constructor(t=12,e,i=!1,n=0,r=[]){this.addedNodes=[],this.removedNodes=[],this.getGridHeight=s.obsolete(this,o.prototype.getRow,"getGridHeight","getRow","v1.0.0"),this.column=t,this.onchange=e,this._float=i,this.maxRow=n,this.nodes=r}batchUpdate(){return this.batchMode||(this.batchMode=!0,this._prevFloat=this._float,this._float=!0),this}commit(){return this.batchMode?(this.batchMode=!1,this._float=this._prevFloat,delete this._prevFloat,this._packNodes(),this._notify(),this):this}_fixCollisions(t){this._sortNodes(-1);let e=t,i=Boolean(this.nodes.find((t=>t.locked)));for(this.float||i||(e={x:0,y:t.y,w:this.column,h:t.h});;){let i,o=this.nodes.find((i=>i!==t&&s.Utils.isIntercepted(i,e)),{node:t,nn:e});if(!o)return this;if(i=o.locked?this.moveNode(t,t.x,o.y+o.h,t.w,t.h,!0):this.moveNode(o,o.x,t.y+t.h,o.w,o.h,!0),!i)return this}}isAreaEmpty(t,e,i,o){let n={x:t||0,y:e||0,w:i||1,h:o||1};return!this.nodes.find((t=>s.Utils.isIntercepted(t,n)))}compact(){if(0===this.nodes.length)return this;this.batchUpdate(),this._sortNodes();let t=this.nodes;return this.nodes=[],t.forEach((t=>{t.noMove||t.locked||(t.autoPosition=!0),this.addNode(t,!1),t._dirty=!0})),this.commit(),this}set float(t){this._float!==t&&(this._float=t||!1,t||(this._packNodes(),this._notify()))}get float(){return this._float||!1}_sortNodes(t){return this.nodes=s.Utils.sort(this.nodes,t,this.column),this}_packNodes(){return this._sortNodes(),this.float?this.nodes.forEach(((t,e)=>{if(t._updating||void 0===t._packY||t.y===t._packY)return this;let i=t.y;for(;i>=t._packY;){let o={x:t.x,y:i,w:t.w,h:t.h};this.nodes.slice(0,e).find((t=>s.Utils.isIntercepted(o,t)),{n:t,newY:i})||(t._dirty=!0,t.y=i),--i}})):this.nodes.forEach(((t,e)=>{if(t.locked)return this;for(;t.y>0;){let i=t.y-1,o=0===e,n={x:t.x,y:i,w:t.w,h:t.h};if(e>0&&(o=void 0===this.nodes.slice(0,e).find((t=>s.Utils.isIntercepted(n,t)),{n:t,newY:i})),!o)break;t._dirty=t.y!==i,t.y=i}})),this}prepareNode(t,e){(t=t||{})._id=t._id||o._idSeq++,void 0!==t.x&&void 0!==t.y&&null!==t.x&&null!==t.y||(t.autoPosition=!0);let i={x:0,y:0,w:1,h:1};return s.Utils.defaults(t,i),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,"string"==typeof t.x&&(t.x=Number(t.x)),"string"==typeof t.y&&(t.y=Number(t.y)),"string"==typeof t.w&&(t.w=Number(t.w)),"string"==typeof t.h&&(t.h=Number(t.h)),isNaN(t.x)&&(t.x=i.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=i.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=i.w),isNaN(t.h)&&(t.h=i.h),t.maxW&&(t.w=Math.min(t.w,t.maxW)),t.maxH&&(t.h=Math.min(t.h,t.maxH)),t.minW&&(t.w=Math.max(t.w,t.minW)),t.minH&&(t.h=Math.max(t.h,t.minH)),t.w>this.column?t.w=this.column:t.w<1&&(t.w=1),this.maxRow&&t.h>this.maxRow?t.h=this.maxRow:t.h<1&&(t.h=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.w>this.column&&(e?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(e?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),t}getDirtyNodes(t){if(t){let t=[];return this.nodes.forEach((e=>{e._dirty&&(e.y===e._origY&&e.x===e._origX&&e.w===e._origW&&e.h===e._origH?delete e._dirty:t.push(e))})),t}return this.nodes.filter((t=>t._dirty))}_notify(t,e=!0){if(this.batchMode)return this;let i=(t=void 0===t?[]:Array.isArray(t)?t:[t]).concat(this.getDirtyNodes());return this.onchange&&this.onchange(i,e),this}cleanNodes(){return this.batchMode||this.nodes.forEach((t=>{delete t._dirty})),this}addNode(t,e=!1){if((t=this.prepareNode(t)).autoPosition){this._sortNodes();for(let e=0;;++e){let i=e%this.column,o=Math.floor(e/this.column);if(i+t.w>this.column)continue;let n={x:i,y:o,w:t.w,h:t.h};if(!this.nodes.find((t=>s.Utils.isIntercepted(n,t)),{x:i,y:o,node:t})){t.x=i,t.y=o,delete t.autoPosition;break}}}return this.nodes.push(t),e&&this.addedNodes.push(t),this._fixCollisions(t),this._packNodes(),this._notify(),t}removeNode(t,e=!0,i=!1){return i&&this.removedNodes.push(t),t._id=null,this.nodes.splice(this.nodes.findIndex((e=>e===t)),1),this.float||this._packNodes(),this._notify(t,e),this}removeAll(t=!0){return delete this._layouts,0===this.nodes.length||(t&&this.nodes.forEach((t=>{t._id=null})),this.removedNodes=this.nodes,this.nodes=[],this._notify(this.removedNodes,t)),this}canMoveNode(t,e,i,n,r){if(!this.isNodeChangedPosition(t,e,i,n,r))return!1;let h,l=Boolean(this.nodes.find((t=>t.locked)));if(!this.maxRow&&!l)return!0;let a=new o(this.column,null,this.float,0,this.nodes.map((e=>e===t?(h=s.Utils.clone(e),h):s.Utils.clone(e))));if(!h)return!0;a.moveNode(h,e,i,n,r);let d=!0;return l&&(d=d&&!Boolean(a.nodes.find((t=>t!==h&&Boolean(t.locked)&&Boolean(t._dirty))))),this.maxRow&&(d=d&&a.getRow()<=this.maxRow),d}canBePlacedWithRespectToHeight(t){if(!this.maxRow)return!0;let e=new o(this.column,null,this.float,0,this.nodes.map((t=>s.Utils.clone(t))));return e.addNode(t),e.getRow()<=this.maxRow}isNodeChangedPosition(t,e,i,s,o){return"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof s&&(s=t.w),"number"!=typeof o&&(o=t.h),t.maxW&&(s=Math.min(s,t.maxW)),t.maxH&&(o=Math.min(o,t.maxH)),t.minW&&(s=Math.max(s,t.minW)),t.minH&&(o=Math.max(o,t.minH)),t.x!==e||t.y!==i||t.w!==s||t.h!==o}moveNode(t,e,i,s,o,n){if(t.locked)return null;"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof s&&(s=t.w),"number"!=typeof o&&(o=t.h);let r=t.w!==s||t.h!==o,h={x:e,y:i,w:s,h:o,maxW:t.maxW,maxH:t.maxH,minW:t.minW,minH:t.minH};return h=this.prepareNode(h,r),t.x===h.x&&t.y===h.y&&t.w===h.w&&t.h===h.h?null:(t._dirty=!0,t.x=t._lastTriedX=h.x,t.y=t._lastTriedY=h.y,t.w=t._lastTriedW=h.w,t.h=t._lastTriedH=h.h,this._fixCollisions(t),n||(this._packNodes(),this._notify()),t)}getRow(){return this.nodes.reduce(((t,e)=>Math.max(t,e.y+e.h)),0)}beginUpdate(t){return t._updating||(t._updating=!0,this.nodes.forEach((t=>{t._packY=t.y}))),this}endUpdate(){let t=this.nodes.find((t=>t._updating));return t&&(delete t._updating,this.nodes.forEach((t=>{delete t._packY}))),this}save(t=!0){let e=[];return s.Utils.sort(this.nodes),this.nodes.forEach((i=>{let s={};for(let t in i)"_"!==t[0]&&null!==i[t]&&void 0!==i[t]&&(s[t]=i[t]);t||delete s.el,delete s.grid,s.autoPosition||delete s.autoPosition,s.noResize||delete s.noResize,s.noMove||delete s.noMove,s.locked||delete s.locked,e.push(s)})),e}layoutsNodesChange(t){return!this._layouts||this._ignoreLayoutsNodeChange||this._layouts.forEach(((e,i)=>{if(!e||i===this.column)return this;i<this.column?this._layouts[i]=void 0:t.forEach((t=>{let s=e.find((e=>e._id===t._id));if(!s)return this;let o=i/this.column;t.y!==t._origY&&(s.y+=t.y-t._origY),t.x!==t._origX&&(s.x=Math.round(t.x*o)),t.w!==t._origW&&(s.w=Math.round(t.w*o))}))})),this}updateNodeWidths(t,e,i,o="moveScale"){if(!this.nodes.length||t===e)return this;if(this.cacheLayout(this.nodes,t),1===e&&i&&i.length){let t=0;i.forEach((e=>{e.x=0,e.w=1,e.y=Math.max(e.y,t),t=e.y+e.h}))}else i=s.Utils.sort(this.nodes,-1,t);let n=this._layouts[e]||[],r=this._layouts.length-1;0===n.length&&e>t&&e<r&&(n=this._layouts[r]||[],n.length&&(t=r,n.forEach((t=>{let e=i.findIndex((e=>e._id===t._id));-1!==e&&(i[e].x=t.x,i[e].y=t.y,i[e].w=t.w)})),n=[]));let h=[];if(n.forEach((t=>{let e=i.findIndex((e=>e._id===t._id));-1!==e&&(i[e].x=t.x,i[e].y=t.y,i[e].w=t.w,h.push(i[e]),i.splice(e,1))})),i.length)if("function"==typeof o)o(e,t,h,i);else{let s=e/t,n="move"===o||"moveScale"===o,r="scale"===o||"moveScale"===o;i.forEach((i=>{i.x=1===e?0:n?Math.round(i.x*s):Math.min(i.x,e-1),i.w=1===e||1===t?1:r?Math.round(i.w*s)||1:Math.min(i.w,e),h.push(i)})),i=[]}return h=s.Utils.sort(h,-1,e),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(),this.nodes=[],h.forEach((t=>{this.addNode(t,!1),t._dirty=!0}),this),this.commit(),delete this._ignoreLayoutsNodeChange,this}saveInitial(){return this.nodes.forEach((t=>{t._origX=t.x,t._origY=t.y,t._origW=t.w,t._origH=t.h,delete t._dirty})),this}cacheLayout(t,e,i=!1){let s=[];return t.forEach(((t,e)=>{t._id=t._id||o._idSeq++,s[e]={x:t.x,y:t.y,w:t.w,_id:t._id}})),this._layouts=i?[]:this._layouts||[],this._layouts[e]=s,this}cleanupNode(t){for(let e in t)"_"===e[0]&&delete t[e];return this}}e.GridStackEngine=o,o._idSeq=1},270:function(t,e,i){var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),o=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),e.GridStack=void 0;const n=i(62),r=i(593),h=i(334);o(i(699),e),o(i(593),e),o(i(62),e),o(i(334),e);class l{constructor(t,e={}){this._gsEventHandler={},this.el=t,e=e||{},r.obsoleteOpts(e,"verticalMargin","margin","v2.0"),r.obsoleteAttr(this.el,"data-gs-current-height","gs-current-row","v1.0.0"),e.row&&(e.minRow=e.maxRow=e.row,delete e.row);let i=r.Utils.toNumber(t.getAttribute("gs-row")),s={column:r.Utils.toNumber(t.getAttribute("gs-column"))||12,minRow:i||r.Utils.toNumber(t.getAttribute("gs-min-row"))||0,maxRow:i||r.Utils.toNumber(t.getAttribute("gs-max-row"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,styleInHead:!1,cellHeight:"auto",margin:10,auto:!0,minWidth:768,float:!1,staticGrid:r.Utils.toBool(t.getAttribute("gs-static"))||!1,_class:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),animate:!0,alwaysShowResizeHandle:e.alwaysShowResizeHandle||!1,resizable:{autoHide:!e.alwaysShowResizeHandle,handles:"se"},draggable:{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"},dragIn:void 0,dragInOptions:{revert:"invalid",handle:".grid-stack-item-content",scroll:!1,appendTo:"body"},disableDrag:!1,disableResize:!1,rtl:"auto",removable:!1,removableOptions:{accept:"."+(e.itemClass||"grid-stack-item")},removeTimeout:2e3,marginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:!1,oneColumnModeDomSort:!1};if(t.getAttribute("gs-animate")&&(s.animate=r.Utils.toBool(t.getAttribute("gs-animate"))),this.opts=r.Utils.defaults(e,s),e=null,this.initMargin(),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===t.style.direction),this.opts.rtl&&this.el.classList.add("grid-stack-rtl"),this.opts._isNested=null!==r.Utils.closestByClass(this.el,this.opts.itemClass),this.opts._isNested&&this.el.classList.add("grid-stack-nested"),this._isAutoCellHeight="auto"===this.opts.cellHeight,this._isAutoCellHeight){let t=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;this.cellHeight(this.cellWidth()+t,!1)}else this.cellHeight(this.opts.cellHeight,!1);if(this.el.classList.add(this.opts._class),this._setStaticClass(),this._updateStyles(),this.engine=new n.GridStackEngine(this.opts.column,((t,e=!0)=>{let i=0;this.engine.nodes.forEach((t=>{i=Math.max(i,t.y+t.h)})),t.forEach((t=>{let i=t.el;e&&null===t._id?i&&i.parentNode&&i.parentNode.removeChild(i):this._writeAttrs(i,t.x,t.y,t.w,t.h)})),this._updateStyles(!1,i)}),this.opts.float,this.opts.maxRow),this.opts.auto){let t=[];this.getGridItems().forEach((e=>{let i=parseInt(e.getAttribute("gs-x")),s=parseInt(e.getAttribute("gs-y"));t.push({el:e,i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(s)?1e3:s)*this.opts.column})})),t.sort((t=>t.i)).forEach((t=>{this._prepareElement(t.el)}))}this.engine.saveInitial(),this.setAnimation(this.opts.animate);let o=document.createElement("div");o.className="placeholder-content",o.innerHTML=this.opts.placeholderText,this.placeholder=document.createElement("div"),this.placeholder.classList.add(this.opts.placeholderClass,s.itemClass,this.opts.itemClass),this.placeholder.appendChild(o),this._updateContainerHeight(),this._setupDragIn(),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateWindowResizeEvent()}static init(t={},e=".grid-stack"){let i=l.getGridElement(e);return i?(i.gridstack||(i.gridstack=new l(i,r.Utils.clone(t))),i.gridstack):("string"==typeof e?console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'):console.error("GridStack.init() no grid element was passed."),null)}static initAll(t={},e=".grid-stack"){let i=[];return l.getGridElements(e).forEach((e=>{e.gridstack||(e.gridstack=new l(e,r.Utils.clone(t))),i.push(e.gridstack)})),0===i.length&&console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'),i}addWidget(t,e){if(arguments.length>2){console.warn("gridstack.ts: `addWidget(el, x, y, width...)` is deprecated. Use `addWidget({x, y, w, content, ...})`. It will be removed soon");let e=arguments,i=1,s={x:e[i++],y:e[i++],w:e[i++],h:e[i++],autoPosition:e[i++],minW:e[i++],maxW:e[i++],minH:e[i++],maxH:e[i++],id:e[i++]};return this.addWidget(t,s)}let i;if("string"==typeof t){let e=document.implementation.createHTMLDocument();e.body.innerHTML=t,i=e.body.children[0]}else if(0===arguments.length||1===arguments.length&&(void 0!==(s=t).x||void 0!==s.y||void 0!==s.w||void 0!==s.h||void 0!==s.content)){let s=t&&t.content||"";e=t;let o=document.implementation.createHTMLDocument();o.body.innerHTML=`<div class="grid-stack-item"><div class="grid-stack-item-content">${s}</div></div>`,i=o.body.children[0]}else i=t;var s;let o=this._readAttr(i);return e=Object.assign({},e||{}),r.Utils.defaults(e,o),this.engine.prepareNode(e),this._writeAttr(i,e),this.el.appendChild(i),this._prepareElement(i,!0,e),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),i}save(t=!0){let e=this.engine.save(t);return t&&e.forEach((t=>{if(t.el){let e=t.el.querySelector(".grid-stack-item-content");t.content=e?e.innerHTML:void 0,t.content||delete t.content,delete t.el}})),e}load(t,e=!0){let i=l.Utils.sort(t,-1,this._prevColumn||this.opts.column);this._prevColumn&&this._prevColumn!==this.opts.column&&i.some((t=>t.x+t.w>this.opts.column))&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(i,this._prevColumn,!0));let s=[];return this.batchUpdate(),e&&[...this.engine.nodes].forEach((t=>{i.find((e=>t.id===e.id))||("function"==typeof e?e(t,!1):(s.push(t),this.removeWidget(t.el,!0,!1)))})),i.forEach((t=>{let i=t.id||0===t.id?this.engine.nodes.find((e=>e.id===t.id)):void 0;i?this.update(i.el,t):e&&("function"==typeof e?e(t,!0):this.addWidget(t))})),this.engine.removedNodes=s,this.commit(),delete this._ignoreLayoutsNodeChange,this}batchUpdate(){return this.engine.batchUpdate(),this}getCellHeight(t=!1){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight&&(!t||!this.opts.cellHeightUnit||"px"===this.opts.cellHeightUnit))return this.opts.cellHeight;let e=this.el.querySelector("."+this.opts.itemClass),i=r.Utils.toNumber(e.getAttribute("gs-h"));return Math.round(e.offsetHeight/i)}cellHeight(t,e=!0){let i=r.Utils.parseHeight(t);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h||(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,e&&this._updateStyles(!0),this._resizeNestedGrids(this.el)),this}cellWidth(){return this.el.offsetWidth/this.opts.column}commit(){return this.engine.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent(),this}compact(){return this.engine.compact(),this._triggerChangeEvent(),this}column(t,e="moveScale"){if(this.opts.column===t)return this;let i,s=this.opts.column;return 1===t?this._prevColumn=s:delete this._prevColumn,this.el.classList.remove("grid-stack-"+s),this.el.classList.add("grid-stack-"+t),this.opts.column=this.engine.column=t,1===t&&this.opts.oneColumnModeDomSort&&(i=[],this.getGridItems().forEach((t=>{t.gridstackNode&&i.push(t.gridstackNode)})),i.length||(i=void 0)),this.engine.updateNodeWidths(s,t,i,e),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter((t=>t.matches("."+this.opts.itemClass)&&!t.matches("."+this.opts.placeholderClass)))}destroy(t=!0){return this._updateWindowResizeEvent(!0),this.setStatic(!0),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.classList.remove(this.opts._class),delete this.el.gridstack),this._removeStylesheet(),delete this.placeholder,delete this.engine,this}disable(){return this.enableMove(!1),this.enableResize(!1),this._triggerEvent("disable"),this}enable(){return this.enableMove(!0),this.enableResize(!0),this._triggerEvent("enable"),this}enableMove(t,e=!0){return t&&this.opts.staticGrid||(this.getGridItems().forEach((e=>this.movable(e,t))),e&&(this.opts.disableDrag=!t)),this}enableResize(t,e=!0){return t&&this.opts.staticGrid||(this.getGridItems().forEach((e=>this.resizable(e,t))),e&&(this.opts.disableResize=!t)),this}float(t){return this.engine.float=t,this._triggerChangeEvent(),this}getFloat(){return this.engine.float}getCellFromPixel(t,e=!1){let i,s=this.el.getBoundingClientRect();i=e?{top:s.top+document.documentElement.scrollTop,left:s.left}:{top:this.el.offsetTop,left:this.el.offsetLeft};let o=t.left-i.left,n=t.top-i.top,r=s.width/this.opts.column,h=s.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/r),y:Math.floor(n/h)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(t,e,i,s){return this.engine.isAreaEmpty(t,e,i,s)}makeWidget(t){let e=l.getElement(t);return this._prepareElement(e,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),e}on(t,e){if(-1!==t.indexOf(" "))return t.split(" ").forEach((t=>this.on(t,e))),this;if("change"===t||"added"===t||"removed"===t||"enable"===t||"disable"===t){let i="enable"===t||"disable"===t;this._gsEventHandler[t]=i?t=>e(t):t=>e(t,t.detail),this.el.addEventListener(t,this._gsEventHandler[t])}else"dragstart"===t||"dragstop"===t||"resizestart"===t||"resizestop"===t||"dropped"===t?this._gsEventHandler[t]=e:console.log("GridStack.on("+t+') event not supported, but you can still use $(".grid-stack").on(...) while jquery-ui is still used internally.');return this}off(t){return-1!==t.indexOf(" ")?(t.split(" ").forEach((t=>this.off(t))),this):("change"!==t&&"added"!==t&&"removed"!==t&&"enable"!==t&&"disable"!==t||this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}removeWidget(t,e=!0,i=!0){return l.getElements(t).forEach((t=>{if(t.parentElement!==this.el)return;let s=t.gridstackNode;s||(s=this.engine.nodes.find((e=>t===e.el))),s&&(delete t.gridstackNode,h.GridStackDDI.get().remove(t),this.engine.removeNode(s,e,i),e&&t.parentElement&&t.remove())})),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this}removeAll(t=!0){return this.engine.nodes.forEach((t=>{delete t.el.gridstackNode,h.GridStackDDI.get().remove(t.el)})),this.engine.removeAll(t),this._triggerRemoveEvent(),this}setAnimation(t){return t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}setStatic(t){return this.opts.staticGrid===t||(this.opts.staticGrid=t,this.engine.nodes.forEach((t=>this._prepareDragDropByNode(t))),this._setStaticClass()),this}update(t,e){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update({x, w, content, ...})`. It will be removed soon");let i=arguments,s=1;return e={x:i[s++],y:i[s++],w:i[s++],h:i[s++]},this.update(t,e)}return l.getElements(t).forEach((t=>{if(!t||!t.gridstackNode)return;let i=t.gridstackNode,s=Object.assign({},e);delete s.autoPosition;let o,n=["x","y","w","h"];if(n.some((t=>void 0!==s[t]&&s[t]!==i[t]))&&(o={},n.forEach((t=>{o[t]=void 0!==s[t]?s[t]:i[t],delete s[t]}))),!o&&(s.minW||s.minH||s.maxW||s.maxH)&&(o={}),s.content){let e=t.querySelector(".grid-stack-item-content");e&&e.innerHTML!==s.content&&(e.innerHTML=s.content),delete s.content}let r=!1,h=!1;for(const t in s)"_"!==t[0]&&i[t]!==s[t]&&(i[t]=s[t],r=!0,h=h||!this.opts.staticGrid&&("noResize"===t||"noMove"===t||"locked"===t));o&&(this.engine.cleanNodes(),this.engine.beginUpdate(i),this.engine.moveNode(i,o.x,o.y,o.w,o.h),this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()),r&&this._writeAttr(t,i),h&&this._prepareDragDropByNode(i)})),this}margin(t){if(!("string"==typeof t&&t.split(" ").length>1)){let e=r.Utils.parseHeight(t);if(this.opts.marginUnit===e.unit&&this.opts.margin===e.h)return}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this.initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(t,e,i,s,o){return this.engine.canBePlacedWithRespectToHeight({x:t,y:e,w:i,h:s,autoPosition:o})}_triggerChangeEvent(){if(this.engine.batchMode)return this;let t=this.engine.getDirtyNodes(!0);return t&&t.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine.saveInitial(),this}_triggerAddEvent(){return this.engine.batchMode||this.engine.addedNodes&&this.engine.addedNodes.length>0&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach((t=>{delete t._dirty})),this._triggerEvent("added",this.engine.addedNodes),this.engine.addedNodes=[]),this}_triggerRemoveEvent(){return this.engine.batchMode||this.engine.removedNodes&&this.engine.removedNodes.length>0&&(this._triggerEvent("removed",this.engine.removedNodes),this.engine.removedNodes=[]),this}_triggerEvent(t,e){let i=e?new CustomEvent(t,{bubbles:!1,detail:e}):new Event(t);return this.el.dispatchEvent(i),this}_removeStylesheet(){return this._styles&&(r.Utils.removeStylesheet(this._styles._id),delete this._styles),this}_updateStyles(t=!1,e){if(t&&this._removeStylesheet(),this._updateContainerHeight(),!this.opts.cellHeight)return this;let i=this.opts.cellHeight,s=this.opts.cellHeightUnit,o=`.${this.opts._class} > .${this.opts.itemClass}`;if(!this._styles){let t="gridstack-style-"+(1e5*Math.random()).toFixed(),e=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=r.Utils.createStylesheet(t,e),!this._styles)return this;this._styles._id=t,this._styles._max=0,r.Utils.addCSSRule(this._styles,o,`min-height: ${i}${s}`);let n=this.opts.marginTop+this.opts.marginUnit,h=this.opts.marginBottom+this.opts.marginUnit,l=this.opts.marginRight+this.opts.marginUnit,a=this.opts.marginLeft+this.opts.marginUnit,d=`${o} > .grid-stack-item-content`,g=`.${this.opts._class} > .grid-stack-placeholder > .placeholder-content`;r.Utils.addCSSRule(this._styles,d,`top: ${n}; right: ${l}; bottom: ${h}; left: ${a};`),r.Utils.addCSSRule(this._styles,g,`top: ${n}; right: ${l}; bottom: ${h}; left: ${a};`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-ne`,`right: ${l}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-e`,`right: ${l}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-se`,`right: ${l}; bottom: ${h}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-nw`,`left: ${a}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-w`,`left: ${a}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-sw`,`left: ${a}; bottom: ${h}`)}if((e=e||this._styles._max)>this._styles._max){let t=t=>i*t+s;for(let i=this._styles._max+1;i<=e;i++){let e=t(i);r.Utils.addCSSRule(this._styles,`${o}[gs-y="${i-1}"]`,`top: ${t(i-1)}`),r.Utils.addCSSRule(this._styles,`${o}[gs-h="${i}"]`,`height: ${e}`),r.Utils.addCSSRule(this._styles,`${o}[gs-min-h="${i}"]`,`min-height: ${e}`),r.Utils.addCSSRule(this._styles,`${o}[gs-max-h="${i}"]`,`max-height: ${e}`)}this._styles._max=e}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.getRow(),e=parseInt(getComputedStyle(this.el)["min-height"]);if(e>0){let i=Math.round(e/this.getCellHeight(!0));t<i&&(t=i)}if(this.el.setAttribute("gs-current-row",String(t)),0===t)return this.el.style.removeProperty("height"),this;let i=this.opts.cellHeight,s=this.opts.cellHeightUnit;return i?(this.el.style.height=t*i+s,this):this}_resizeNestedGrids(t){return t.querySelectorAll(".grid-stack").forEach((t=>{t.gridstack&&t.gridstack.onParentResize()})),this}_prepareElement(t,e=!1,i){i||(t.classList.add(this.opts.itemClass),i=this._readAttr(t)),t.gridstackNode=i,i.el=t,i.grid=this;let s=Object.assign({},i);return i=this.engine.addNode(i,e),r.Utils.same(i,s)||this._writeAttr(t,i),this._prepareDragDropByNode(i),this}_writeAttrs(t,e,i,s,o){return null!=e&&t.setAttribute("gs-x",String(e)),null!=i&&t.setAttribute("gs-y",String(i)),s&&t.setAttribute("gs-w",String(s)),o&&t.setAttribute("gs-h",String(o)),this}_writeAttr(t,e){if(!e)return this;this._writeAttrs(t,e.x,e.y,e.w,e.h);let i={autoPosition:"gs-auto-position",minW:"gs-min-w",minH:"gs-min-h",maxW:"gs-max-w",maxH:"gs-max-h",noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",resizeHandles:"gs-resize-handles"};for(const s in i)e[s]?t.setAttribute(i[s],String(e[s])):t.removeAttribute(i[s]);return this}_readAttr(t,e={}){e.x=r.Utils.toNumber(t.getAttribute("gs-x")),e.y=r.Utils.toNumber(t.getAttribute("gs-y")),e.w=r.Utils.toNumber(t.getAttribute("gs-w")),e.h=r.Utils.toNumber(t.getAttribute("gs-h")),e.maxW=r.Utils.toNumber(t.getAttribute("gs-max-w")),e.minW=r.Utils.toNumber(t.getAttribute("gs-min-w")),e.maxH=r.Utils.toNumber(t.getAttribute("gs-max-h")),e.minH=r.Utils.toNumber(t.getAttribute("gs-min-h")),e.autoPosition=r.Utils.toBool(t.getAttribute("gs-auto-position")),e.noResize=r.Utils.toBool(t.getAttribute("gs-no-resize")),e.noMove=r.Utils.toBool(t.getAttribute("gs-no-move")),e.locked=r.Utils.toBool(t.getAttribute("gs-locked")),e.resizeHandles=t.getAttribute("gs-resize-handles"),e.id=t.getAttribute("gs-id");for(const t in e){if(!e.hasOwnProperty(t))return;e[t]||0===e[t]||delete e[t]}return e}_setStaticClass(){let t=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...t),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...t),this.el.removeAttribute("gs-static")),this}onParentResize(){if(this._isAutoCellHeight&&r.Utils.throttle((()=>{let t=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;this.cellHeight(this.cellWidth()+t)}),100),!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.minWidth){if(this._oneColumnMode)return this;this._oneColumnMode=!0,this.column(1),this._resizeNestedGrids(this.el)}else{if(!this._oneColumnMode)return this;delete this._oneColumnMode,this.column(this._prevColumn),this._resizeNestedGrids(this.el)}return this}_updateWindowResizeEvent(t=!1){const e=this._isAutoCellHeight||!this.opts.disableOneColumnMode;return!e||t||this.opts._isNested||this._windowResizeBind?!t&&e||!this._windowResizeBind||(window.removeEventListener("resize",this._windowResizeBind),delete this._windowResizeBind):(this._windowResizeBind=this.onParentResize.bind(this),window.addEventListener("resize",this._windowResizeBind),this.onParentResize()),this}static getElement(t=".grid-stack-item"){return r.Utils.getElement(t)}static getElements(t=".grid-stack-item"){return r.Utils.getElements(t)}static getGridElement(t){return l.getElement(t)}static getGridElements(t){return r.Utils.getElements(t)}initMargin(){let t,e=0,i=[];return"string"==typeof this.opts.margin&&(i=this.opts.margin.split(" ")),2===i.length?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):4===i.length?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(t=r.Utils.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,e=this.opts.margin=t.h),void 0===this.opts.marginTop?this.opts.marginTop=e:(t=r.Utils.parseHeight(this.opts.marginTop),this.opts.marginTop=t.h,delete this.opts.margin),void 0===this.opts.marginBottom?this.opts.marginBottom=e:(t=r.Utils.parseHeight(this.opts.marginBottom),this.opts.marginBottom=t.h,delete this.opts.margin),void 0===this.opts.marginRight?this.opts.marginRight=e:(t=r.Utils.parseHeight(this.opts.marginRight),this.opts.marginRight=t.h,delete this.opts.margin),void 0===this.opts.marginLeft?this.opts.marginLeft=e:(t=r.Utils.parseHeight(this.opts.marginLeft),this.opts.marginLeft=t.h,delete this.opts.margin),this.opts.marginUnit=t.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}movable(t,e){return this}resizable(t,e){return this}_setupAcceptWidget(){return this}_setupRemoveDrop(){return this}_setupRemovingTimeout(t){return this}_clearRemovingTimeout(t){return this}_setupDragIn(){return this}_prepareDragDropByNode(t){return this}locked(t,e){return this.update(t,{locked:e})}maxWidth(t,e){return this.update(t,{maxW:e})}minWidth(t,e){return this.update(t,{minW:e})}maxHeight(t,e){return this.update(t,{maxH:e})}minHeight(t,e){return this.update(t,{minH:e})}move(t,e,i){return this.update(t,{x:e,y:i})}resize(t,e,i){return this.update(t,{w:e,h:i})}}e.GridStack=l,l.Utils=r.Utils,l.Engine=n.GridStackEngine},822:function(t,e,i){var s=this&&this.__createBinding||(Object.create?function(t,e,i,s){void 0===s&&(s=i),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,s){void 0===s&&(s=i),t[s]=e[i]}),o=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),o(i(699),e),o(i(593),e),o(i(62),e),o(i(334),e),o(i(270),e)},699:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},593:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Utils=e.obsoleteAttr=e.obsoleteOptsDel=e.obsoleteOpts=e.obsolete=void 0,e.obsolete=function(t,e,i,s,o){let n=(...n)=>(console.warn("gridstack.js: Function `"+i+"` is deprecated in "+o+" and has been replaced with `"+s+"`. It will be **completely** removed in v1.0"),e.apply(t,n));return n.prototype=e.prototype,n},e.obsoleteOpts=function(t,e,i,s){void 0!==t[e]&&(t[i]=t[e],console.warn("gridstack.js: Option `"+e+"` is deprecated in "+s+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))},e.obsoleteOptsDel=function(t,e,i,s){void 0!==t[e]&&console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+s)},e.obsoleteAttr=function(t,e,i,s){let o=t.getAttribute(e);null!==o&&(t.setAttribute(i,o),console.warn("gridstack.js: attribute `"+e+"`="+o+" is deprecated on this object in "+s+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))};class i{static getElements(t){if("string"==typeof t){let e=document.querySelectorAll(t);return e.length||"."===t[0]||"#"===t[0]||(e=document.querySelectorAll("."+t),e.length||(e=document.querySelectorAll("#"+t))),Array.from(e)}return[t]}static getElement(t){if("string"==typeof t){if(!t.length)return null;if("#"===t[0])return document.getElementById(t.substring(1));if("."===t[0]||"["===t[0])return document.querySelector(t);if(!isNaN(+t[0]))return document.getElementById(t);let e=document.querySelector(t);return e||(e=document.getElementById(t)),e||(e=document.querySelector("."+t)),e}return t}static isIntercepted(t,e){return!(t.x+t.w<=e.x||e.x+e.w<=t.x||t.y+t.h<=e.y||e.y+e.h<=t.y)}static sort(t,e,i){if(!i){let e=t.map((t=>t.x+t.w));i=Math.max(...e)}return-1===e?t.sort(((t,e)=>e.x+e.y*i-(t.x+t.y*i))):t.sort(((t,e)=>t.x+t.y*i-(e.x+e.y*i)))}static createStylesheet(t,e){let i=document.createElement("style");return i.setAttribute("type","text/css"),i.setAttribute("gs-style-id",t),i.styleSheet?i.styleSheet.cssText="":i.appendChild(document.createTextNode("")),e?e.insertBefore(i,e.firstChild):(e=document.getElementsByTagName("head")[0]).appendChild(i),i.sheet}static removeStylesheet(t){let e=document.querySelector("STYLE[gs-style-id="+t+"]");e&&e.parentNode&&e.parentNode.removeChild(e)}static addCSSRule(t,e,i){"function"==typeof t.addRule?t.addRule(e,i):"function"==typeof t.insertRule&&t.insertRule(`${e}{${i}}`)}static toBool(t){return"boolean"==typeof t?t:"string"==typeof t?!(""===(t=t.toLowerCase())||"no"===t||"false"===t||"0"===t):Boolean(t)}static toNumber(t){return null===t||0===t.length?void 0:Number(t)}static parseHeight(t){let e,i="px";if("string"==typeof t){let s=t.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!s)throw new Error("Invalid height");i=s[2]||"px",e=parseFloat(s[1])}else e=t;return{h:e,unit:i}}static defaults(t,...e){return e.forEach((e=>{for(const i in e){if(!e.hasOwnProperty(i))return;null===t[i]||void 0===t[i]?t[i]=e[i]:"object"==typeof e[i]&&"object"==typeof t[i]&&this.defaults(t[i],e[i])}})),t}static same(t,e){if("object"!=typeof t)return t==e;if(typeof t!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(t[i]!==e[i])return!1;return!0}static clone(t){return Object.assign({},t)}static closestByClass(t,e){return(t=t.parentElement)?t.classList.contains(e)?t:i.closestByClass(t,e):null}static throttle(t,e){let i=!1;return(...s)=>{i||(t.apply(this,s),i=!0,setTimeout((()=>i=!1),e))}}static removePositioningStyles(t){let e=t.style;e.position&&e.removeProperty("position"),e.left&&e.removeProperty("left"),e.top&&e.removeProperty("top"),e.width&&e.removeProperty("width"),e.height&&e.removeProperty("height")}static getScrollParent(t){let e;return e=null===t?null:t.scrollHeight>t.clientHeight?t:this.getScrollParent(t.parentElement),e}static updateScrollPosition(t,e,i){let s=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight;if(s.top<0||s.bottom>o){let n=s.bottom-o,r=s.top,h=this.getScrollParent(t);if(null!==h){let l=h.scrollTop;s.top<0&&i<0?t.offsetHeight>o?h.scrollTop+=i:h.scrollTop+=Math.abs(r)>Math.abs(i)?i:r:i>0&&(t.offsetHeight>o?h.scrollTop+=i:h.scrollTop+=n>i?i:n),e.top+=h.scrollTop-l}}}}e.Utils=i}},e={};return function i(s){if(e[s])return e[s].exports;var o=e[s]={exports:{}};return t[s].call(o.exports,o,o.exports,i),o.exports}(822)})().GridStack})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.GridStack=e():t.GridStack=e()}(self,(function(){return(()=>{"use strict";var t={334:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});class i{static registerPlugin(t){i.ddi=new t}static get(){return i.ddi||i.registerPlugin(i),i.ddi}remove(t){return this}}e.GridStackDDI=i},62:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const s=i(593);class o{constructor(t=12,e,i=!1,r=0,n=[]){this.addedNodes=[],this.removedNodes=[],this.getGridHeight=s.obsolete(this,o.prototype.getRow,"getGridHeight","getRow","v1.0.0"),this.column=t,this.onchange=e,this._float=i,this.maxRow=r,this.nodes=n}batchUpdate(){return this.batchMode||(this.batchMode=!0,this._prevFloat=this._float,this._float=!0),this}commit(){return this.batchMode?(this.batchMode=!1,this._float=this._prevFloat,delete this._prevFloat,this._packNodes(),this._notify(),this):this}_fixCollisions(t){this._sortNodes(-1);let e=t,i=Boolean(this.nodes.find((t=>t.locked)));for(this.float||i||(e={x:0,y:t.y,w:this.column,h:t.h});;){let i,o=this.nodes.find((i=>i!==t&&s.Utils.isIntercepted(i,e)),{node:t,nn:e});if(!o)return this;if(i=o.locked?this.moveNode(t,t.x,o.y+o.h,t.w,t.h,!0):this.moveNode(o,o.x,t.y+t.h,o.w,o.h,!0),!i)return this}}isAreaEmpty(t,e,i,o){let r={x:t||0,y:e||0,w:i||1,h:o||1};return!this.nodes.find((t=>s.Utils.isIntercepted(t,r)))}compact(){if(0===this.nodes.length)return this;this.batchUpdate(),this._sortNodes();let t=this.nodes;return this.nodes=[],t.forEach((t=>{t.noMove||t.locked||(t.autoPosition=!0),this.addNode(t,!1),t._dirty=!0})),this.commit(),this}set float(t){this._float!==t&&(this._float=t||!1,t||(this._packNodes(),this._notify()))}get float(){return this._float||!1}_sortNodes(t){return this.nodes=s.Utils.sort(this.nodes,t,this.column),this}_packNodes(){return this._sortNodes(),this.float?this.nodes.forEach(((t,e)=>{if(t._updating||void 0===t._packY||t.y===t._packY)return this;let i=t.y;for(;i>=t._packY;){let o={x:t.x,y:i,w:t.w,h:t.h};this.nodes.slice(0,e).find((t=>s.Utils.isIntercepted(o,t)),{n:t,newY:i})||(t._dirty=!0,t.y=i),--i}})):this.nodes.forEach(((t,e)=>{if(t.locked)return this;for(;t.y>0;){let i=t.y-1,o=0===e,r={x:t.x,y:i,w:t.w,h:t.h};if(e>0&&(o=void 0===this.nodes.slice(0,e).find((t=>s.Utils.isIntercepted(r,t)),{n:t,newY:i})),!o)break;t._dirty=t.y!==i,t.y=i}})),this}prepareNode(t,e){(t=t||{})._id=t._id||o._idSeq++,void 0!==t.x&&void 0!==t.y&&null!==t.x&&null!==t.y||(t.autoPosition=!0);let i={x:0,y:0,w:1,h:1};return s.Utils.defaults(t,i),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,"string"==typeof t.x&&(t.x=Number(t.x)),"string"==typeof t.y&&(t.y=Number(t.y)),"string"==typeof t.w&&(t.w=Number(t.w)),"string"==typeof t.h&&(t.h=Number(t.h)),isNaN(t.x)&&(t.x=i.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=i.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=i.w),isNaN(t.h)&&(t.h=i.h),t.maxW&&(t.w=Math.min(t.w,t.maxW)),t.maxH&&(t.h=Math.min(t.h,t.maxH)),t.minW&&(t.w=Math.max(t.w,t.minW)),t.minH&&(t.h=Math.max(t.h,t.minH)),t.w>this.column?t.w=this.column:t.w<1&&(t.w=1),this.maxRow&&t.h>this.maxRow?t.h=this.maxRow:t.h<1&&(t.h=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.w>this.column&&(e?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(e?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),t}getDirtyNodes(t){if(t){let t=[];return this.nodes.forEach((e=>{e._dirty&&(e.y===e._origY&&e.x===e._origX&&e.w===e._origW&&e.h===e._origH?delete e._dirty:t.push(e))})),t}return this.nodes.filter((t=>t._dirty))}_notify(t,e=!0){if(this.batchMode)return this;let i=(t=void 0===t?[]:Array.isArray(t)?t:[t]).concat(this.getDirtyNodes());return this.onchange&&this.onchange(i,e),this}cleanNodes(){return this.batchMode||this.nodes.forEach((t=>{delete t._dirty})),this}addNode(t,e=!1){if((t=this.prepareNode(t)).autoPosition){this._sortNodes();for(let e=0;;++e){let i=e%this.column,o=Math.floor(e/this.column);if(i+t.w>this.column)continue;let r={x:i,y:o,w:t.w,h:t.h};if(!this.nodes.find((t=>s.Utils.isIntercepted(r,t)),{x:i,y:o,node:t})){t.x=i,t.y=o,delete t.autoPosition;break}}}return this.nodes.push(t),e&&this.addedNodes.push(t),this._fixCollisions(t),this._packNodes(),this._notify(),t}removeNode(t,e=!0,i=!1){return i&&this.removedNodes.push(t),t._id=null,this.nodes.splice(this.nodes.findIndex((e=>e===t)),1),this.float||this._packNodes(),this._notify(t,e),this}removeAll(t=!0){return delete this._layouts,0===this.nodes.length||(t&&this.nodes.forEach((t=>{t._id=null})),this.removedNodes=this.nodes,this.nodes=[],this._notify(this.removedNodes,t)),this}canMoveNode(t,e,i,s,r){if(!this.isNodeChangedPosition(t,e,i,s,r))return!1;let n,h=Boolean(this.nodes.find((t=>t.locked)));if(!this.maxRow&&!h)return!0;let l=new o(this.column,null,this.float,0,this.nodes.map((e=>e===t?(n=Object.assign({},e),n):Object.assign({},e))));if(!n)return!0;l.moveNode(n,e,i,s,r);let a=!0;return h&&(a=a&&!Boolean(l.nodes.find((t=>t!==n&&Boolean(t.locked)&&Boolean(t._dirty))))),this.maxRow&&(a=a&&l.getRow()<=this.maxRow),a}canBePlacedWithRespectToHeight(t){if(!this.maxRow)return!0;let e=new o(this.column,null,this.float,0,this.nodes.map((t=>Object.assign({},t))));return e.addNode(t),e.getRow()<=this.maxRow}isNodeChangedPosition(t,e,i,s,o){return"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof s&&(s=t.w),"number"!=typeof o&&(o=t.h),t.maxW&&(s=Math.min(s,t.maxW)),t.maxH&&(o=Math.min(o,t.maxH)),t.minW&&(s=Math.max(s,t.minW)),t.minH&&(o=Math.max(o,t.minH)),t.x!==e||t.y!==i||t.w!==s||t.h!==o}moveNode(t,e,i,s,o,r){if(t.locked)return null;"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof s&&(s=t.w),"number"!=typeof o&&(o=t.h);let n=t.w!==s||t.h!==o,h={x:e,y:i,w:s,h:o,maxW:t.maxW,maxH:t.maxH,minW:t.minW,minH:t.minH};return h=this.prepareNode(h,n),t.x===h.x&&t.y===h.y&&t.w===h.w&&t.h===h.h?null:(t._dirty=!0,t.x=t._lastTriedX=h.x,t.y=t._lastTriedY=h.y,t.w=t._lastTriedW=h.w,t.h=t._lastTriedH=h.h,this._fixCollisions(t),r||(this._packNodes(),this._notify()),t)}getRow(){return this.nodes.reduce(((t,e)=>Math.max(t,e.y+e.h)),0)}beginUpdate(t){return t._updating||(t._updating=!0,this.nodes.forEach((t=>{t._packY=t.y}))),this}endUpdate(){let t=this.nodes.find((t=>t._updating));return t&&(delete t._updating,this.nodes.forEach((t=>{delete t._packY}))),this}save(t=!0){let e=[];return s.Utils.sort(this.nodes),this.nodes.forEach((i=>{let s={};for(let t in i)"_"!==t[0]&&null!==i[t]&&void 0!==i[t]&&(s[t]=i[t]);t||delete s.el,delete s.grid,s.autoPosition||delete s.autoPosition,s.noResize||delete s.noResize,s.noMove||delete s.noMove,s.locked||delete s.locked,e.push(s)})),e}layoutsNodesChange(t){return!this._layouts||this._ignoreLayoutsNodeChange||this._layouts.forEach(((e,i)=>{if(!e||i===this.column)return this;i<this.column?this._layouts[i]=void 0:t.forEach((t=>{let s=e.find((e=>e._id===t._id));if(!s)return this;let o=i/this.column;t.y!==t._origY&&(s.y+=t.y-t._origY),t.x!==t._origX&&(s.x=Math.round(t.x*o)),t.w!==t._origW&&(s.w=Math.round(t.w*o))}))})),this}updateNodeWidths(t,e,i,o="moveScale"){if(!this.nodes.length||t===e)return this;if(this.cacheLayout(this.nodes,t),1===e&&i&&i.length){let t=0;i.forEach((e=>{e.x=0,e.w=1,e.y=Math.max(e.y,t),t=e.y+e.h}))}else i=s.Utils.sort(this.nodes,-1,t);let r=this._layouts[e]||[],n=this._layouts.length-1;0===r.length&&e>t&&e<n&&(r=this._layouts[n]||[],r.length&&(t=n,r.forEach((t=>{let e=i.findIndex((e=>e._id===t._id));-1!==e&&(i[e].x=t.x,i[e].y=t.y,i[e].w=t.w)})),r=[]));let h=[];if(r.forEach((t=>{let e=i.findIndex((e=>e._id===t._id));-1!==e&&(i[e].x=t.x,i[e].y=t.y,i[e].w=t.w,h.push(i[e]),i.splice(e,1))})),i.length)if("function"==typeof o)o(e,t,h,i);else{let s=e/t,r="move"===o||"moveScale"===o,n="scale"===o||"moveScale"===o;i.forEach((i=>{i.x=1===e?0:r?Math.round(i.x*s):Math.min(i.x,e-1),i.w=1===e||1===t?1:n?Math.round(i.w*s)||1:Math.min(i.w,e),h.push(i)})),i=[]}return h=s.Utils.sort(h,-1,e),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(),this.nodes=[],h.forEach((t=>{this.addNode(t,!1),t._dirty=!0}),this),this.commit(),delete this._ignoreLayoutsNodeChange,this}saveInitial(){return this.nodes.forEach((t=>{t._origX=t.x,t._origY=t.y,t._origW=t.w,t._origH=t.h,delete t._dirty})),this}cacheLayout(t,e,i=!1){let s=[];return t.forEach(((t,e)=>{t._id=t._id||o._idSeq++,s[e]={x:t.x,y:t.y,w:t.w,_id:t._id}})),this._layouts=i?[]:this._layouts||[],this._layouts[e]=s,this}cleanupNode(t){for(let e in t)"_"===e[0]&&delete t[e];return this}}e.GridStackEngine=o,o._idSeq=1},270:(t,e,i)=>{function s(t){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])}Object.defineProperty(e,"__esModule",{value:!0});const o=i(62),r=i(593),n=i(334);s(i(593)),s(i(62)),s(i(334));const h={column:12,minRow:0,maxRow:0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,styleInHead:!1,cellHeight:"auto",margin:10,auto:!0,minWidth:768,float:!1,staticGrid:!1,animate:!0,alwaysShowResizeHandle:!1,resizable:{autoHide:!0,handles:"se"},draggable:{handle:".grid-stack-item-content",scroll:!1,appendTo:"body"},dragIn:void 0,dragInOptions:{revert:"invalid",handle:".grid-stack-item-content",scroll:!1,appendTo:"body"},disableDrag:!1,disableResize:!1,rtl:"auto",removable:!1,removableOptions:{accept:".grid-stack-item"},removeTimeout:2e3,marginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:!1,oneColumnModeDomSort:!1};class l{constructor(t,e={}){this._gsEventHandler={},this.el=t,e=e||{},r.obsoleteOpts(e,"verticalMargin","margin","v2.0"),r.obsoleteAttr(this.el,"data-gs-current-height","gs-current-row","v1.0.0"),e.row&&(e.minRow=e.maxRow=e.row,delete e.row);let i=r.Utils.toNumber(t.getAttribute("gs-row")),s=Object.assign(Object.assign({},h),{column:r.Utils.toNumber(t.getAttribute("gs-column"))||12,minRow:i||r.Utils.toNumber(t.getAttribute("gs-min-row"))||0,maxRow:i||r.Utils.toNumber(t.getAttribute("gs-max-row"))||0,staticGrid:r.Utils.toBool(t.getAttribute("gs-static"))||!1,_styleSheetClass:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),alwaysShowResizeHandle:e.alwaysShowResizeHandle||!1,resizable:{autoHide:!e.alwaysShowResizeHandle,handles:"se"},draggable:{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"},removableOptions:{accept:"."+(e.itemClass||"grid-stack-item")}});t.getAttribute("gs-animate")&&(s.animate=r.Utils.toBool(t.getAttribute("gs-animate"))),this.opts=r.Utils.defaults(e,s),e=null,this.initMargin(),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===t.style.direction),this.opts.rtl&&this.el.classList.add("grid-stack-rtl");let n=r.Utils.closestByClass(this.el,h.itemClass);if(n&&n.gridstackNode&&(this.opts._isNested=n.gridstackNode,this.opts._isNested.subGrid=this,this.el.classList.add("grid-stack-nested")),this._isAutoCellHeight="auto"===this.opts.cellHeight,this._isAutoCellHeight){let t=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;this.cellHeight(this.cellWidth()+t,!1)}else this.cellHeight(this.opts.cellHeight,!1);if(this.el.classList.add(this.opts._styleSheetClass),this._setStaticClass(),this._updateStyles(),this.engine=new o.GridStackEngine(this.opts.column,((t,e=!0)=>{let i=0;this.engine.nodes.forEach((t=>{i=Math.max(i,t.y+t.h)})),t.forEach((t=>{let i=t.el;e&&null===t._id?i&&i.parentNode&&i.parentNode.removeChild(i):this._writeAttrs(i,t.x,t.y,t.w,t.h)})),this._updateStyles(!1,i)}),this.opts.float,this.opts.maxRow),this.opts.auto){let t=[];this.getGridItems().forEach((e=>{let i=parseInt(e.getAttribute("gs-x")),s=parseInt(e.getAttribute("gs-y"));t.push({el:e,i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(s)?1e3:s)*this.opts.column})})),t.sort((t=>t.i)).forEach((t=>{this._prepareElement(t.el)}))}this.engine.saveInitial(),this.setAnimation(this.opts.animate);let l=document.createElement("div");l.className="placeholder-content",l.innerHTML=this.opts.placeholderText,this.placeholder=document.createElement("div"),this.placeholder.classList.add(this.opts.placeholderClass,s.itemClass,this.opts.itemClass),this.placeholder.appendChild(l),this._updateContainerHeight(),this._setupDragIn(),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateWindowResizeEvent()}static init(t={},e=".grid-stack"){let i=l.getGridElement(e);return i?(i.gridstack||(i.gridstack=new l(i,Object.assign({},t))),i.gridstack):("string"==typeof e?console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'):console.error("GridStack.init() no grid element was passed."),null)}static initAll(t={},e=".grid-stack"){let i=[];return l.getGridElements(e).forEach((e=>{e.gridstack||(e.gridstack=new l(e,Object.assign({},t))),i.push(e.gridstack)})),0===i.length&&console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'),i}static addGrid(t,e={}){if(!t)return null;let i=document.implementation.createHTMLDocument();i.body.innerHTML=`<div class="grid-stack ${e.class||""}"></div>`;let s=i.body.children[0];t.append(s);let o=l.init(e,s);return e.children&&o.load(e.children),o}addWidget(t,e){if(arguments.length>2){console.warn("gridstack.ts: `addWidget(el, x, y, width...)` is deprecated. Use `addWidget({x, y, w, content, ...})`. It will be removed soon");let e=arguments,i=1,s={x:e[i++],y:e[i++],w:e[i++],h:e[i++],autoPosition:e[i++],minW:e[i++],maxW:e[i++],minH:e[i++],maxH:e[i++],id:e[i++]};return this.addWidget(t,s)}let i;if("string"==typeof t){let e=document.implementation.createHTMLDocument();e.body.innerHTML=t,i=e.body.children[0]}else if(0===arguments.length||1===arguments.length&&(void 0!==(s=t).x||void 0!==s.y||void 0!==s.w||void 0!==s.h||void 0!==s.content)){let s=t&&t.content||"";e=t;let o=document.implementation.createHTMLDocument();o.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${s}</div></div>`,i=o.body.children[0]}else i=t;var s;let o=this._readAttr(i);return e=Object.assign({},e||{}),r.Utils.defaults(e,o),this.engine.prepareNode(e),this._writeAttr(i,e),this.el.appendChild(i),this._prepareElement(i,!0,e),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),i}save(t=!0,e=!1){let i=this.engine.save(t);if(t&&i.forEach((t=>{if(t.el){let e=t.el.querySelector(".grid-stack-item-content");t.content=e?e.innerHTML:void 0,t.content||delete t.content,delete t.el}})),e){i.forEach((e=>{e.subGrid&&(e.subGrid=e.subGrid.save(t,!0))}));let e=Object.assign({},this.opts);return e.marginBottom===e.marginTop&&e.marginRight===e.marginLeft&&e.marginTop===e.marginRight&&(e.margin=e.marginTop,delete e.marginTop,delete e.marginRight,delete e.marginBottom,delete e.marginLeft),e.rtl===("rtl"===this.el.style.direction)&&(e.rtl="auto"),this._isAutoCellHeight&&(e.cellHeight="auto"),r.Utils.removeInternalAndSame(e,h),e.children=i,e}return i}load(t,e=!0){let i=l.Utils.sort(t,-1,this._prevColumn||this.opts.column);this._prevColumn&&this._prevColumn!==this.opts.column&&i.some((t=>t.x+t.w>this.opts.column))&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(i,this._prevColumn,!0));let s=[];return this.batchUpdate(),e&&[...this.engine.nodes].forEach((t=>{i.find((e=>t.id===e.id))||("function"==typeof e?e(this,t,!1):(s.push(t),this.removeWidget(t.el,!0,!1)))})),i.forEach((t=>{let i=t.id||0===t.id?this.engine.nodes.find((e=>e.id===t.id)):void 0;if(i){if(this.update(i.el,t),t.subGrid&&t.subGrid.children){let e=i.el.querySelector(".grid-stack");e&&e.gridstack&&e.gridstack.load(t.subGrid.children)}}else if(e&&(t="function"==typeof e?e(this,t,!0).gridstackNode:this.addWidget(t).gridstackNode).subGrid){let e=t.el.querySelector(".grid-stack-item-content");t.subGrid=l.addGrid(e,t.subGrid)}})),this.engine.removedNodes=s,this.commit(),delete this._ignoreLayoutsNodeChange,this}batchUpdate(){return this.engine.batchUpdate(),this}getCellHeight(t=!1){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight&&(!t||!this.opts.cellHeightUnit||"px"===this.opts.cellHeightUnit))return this.opts.cellHeight;let e=this.el.querySelector("."+this.opts.itemClass),i=r.Utils.toNumber(e.getAttribute("gs-h"));return Math.round(e.offsetHeight/i)}cellHeight(t,e=!0){let i=r.Utils.parseHeight(t);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h||(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,e&&this._updateStyles(!0),this._resizeNestedGrids(this.el)),this}cellWidth(){return this.el.offsetWidth/this.opts.column}commit(){return this.engine.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent(),this}compact(){return this.engine.compact(),this._triggerChangeEvent(),this}column(t,e="moveScale"){if(this.opts.column===t)return this;let i,s=this.opts.column;return 1===t?this._prevColumn=s:delete this._prevColumn,this.el.classList.remove("grid-stack-"+s),this.el.classList.add("grid-stack-"+t),this.opts.column=this.engine.column=t,1===t&&this.opts.oneColumnModeDomSort&&(i=[],this.getGridItems().forEach((t=>{t.gridstackNode&&i.push(t.gridstackNode)})),i.length||(i=void 0)),this.engine.updateNodeWidths(s,t,i,e),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter((t=>t.matches("."+this.opts.itemClass)&&!t.matches("."+this.opts.placeholderClass)))}destroy(t=!0){if(this.el)return this._updateWindowResizeEvent(!0),this.setStatic(!0),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.classList.remove(this.opts._styleSheetClass)),this._removeStylesheet(),delete this.opts._isNested,delete this.opts,delete this.placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}disable(){if(!this.opts.staticGrid)return this.enableMove(!1),this.enableResize(!1),this._triggerEvent("disable"),this}enable(){if(!this.opts.staticGrid)return this.enableMove(!0),this.enableResize(!0),this._triggerEvent("enable"),this}enableMove(t,e=!0){return this.opts.staticGrid||(this.getGridItems().forEach((e=>this.movable(e,t))),e&&(this.opts.disableDrag=!t)),this}enableResize(t,e=!0){return this.opts.staticGrid||(this.getGridItems().forEach((e=>this.resizable(e,t))),e&&(this.opts.disableResize=!t)),this}float(t){return this.engine.float=t,this._triggerChangeEvent(),this}getFloat(){return this.engine.float}getCellFromPixel(t,e=!1){let i,s=this.el.getBoundingClientRect();i=e?{top:s.top+document.documentElement.scrollTop,left:s.left}:{top:this.el.offsetTop,left:this.el.offsetLeft};let o=t.left-i.left,r=t.top-i.top,n=s.width/this.opts.column,h=s.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/n),y:Math.floor(r/h)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(t,e,i,s){return this.engine.isAreaEmpty(t,e,i,s)}makeWidget(t){let e=l.getElement(t);return this._prepareElement(e,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),e}on(t,e){if(-1!==t.indexOf(" "))return t.split(" ").forEach((t=>this.on(t,e))),this;if("change"===t||"added"===t||"removed"===t||"enable"===t||"disable"===t){let i="enable"===t||"disable"===t;this._gsEventHandler[t]=i?t=>e(t):t=>e(t,t.detail),this.el.addEventListener(t,this._gsEventHandler[t])}else"dragstart"===t||"dragstop"===t||"resizestart"===t||"resizestop"===t||"dropped"===t?this._gsEventHandler[t]=e:console.log("GridStack.on("+t+') event not supported, but you can still use $(".grid-stack").on(...) while jquery-ui is still used internally.');return this}off(t){return-1!==t.indexOf(" ")?(t.split(" ").forEach((t=>this.off(t))),this):("change"!==t&&"added"!==t&&"removed"!==t&&"enable"!==t&&"disable"!==t||this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}removeWidget(t,e=!0,i=!0){return l.getElements(t).forEach((t=>{if(t.parentElement!==this.el)return;let s=t.gridstackNode;s||(s=this.engine.nodes.find((e=>t===e.el))),s&&(delete t.gridstackNode,n.GridStackDDI.get().remove(t),this.engine.removeNode(s,e,i),e&&t.parentElement&&t.remove())})),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this}removeAll(t=!0){return this.engine.nodes.forEach((t=>{delete t.el.gridstackNode,n.GridStackDDI.get().remove(t.el)})),this.engine.removeAll(t),this._triggerRemoveEvent(),this}setAnimation(t){return t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}setStatic(t){return this.opts.staticGrid===t||(this.opts.staticGrid=t,this.engine.nodes.forEach((t=>this._prepareDragDropByNode(t))),this._setStaticClass()),this}update(t,e){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update({x, w, content, ...})`. It will be removed soon");let i=arguments,s=1;return e={x:i[s++],y:i[s++],w:i[s++],h:i[s++]},this.update(t,e)}return l.getElements(t).forEach((t=>{if(!t||!t.gridstackNode)return;let i=t.gridstackNode,s=Object.assign({},e);delete s.autoPosition;let o,r=["x","y","w","h"];if(r.some((t=>void 0!==s[t]&&s[t]!==i[t]))&&(o={},r.forEach((t=>{o[t]=void 0!==s[t]?s[t]:i[t],delete s[t]}))),!o&&(s.minW||s.minH||s.maxW||s.maxH)&&(o={}),s.content){let e=t.querySelector(".grid-stack-item-content");e&&e.innerHTML!==s.content&&(e.innerHTML=s.content),delete s.content}let n=!1,h=!1;for(const t in s)"_"!==t[0]&&i[t]!==s[t]&&(i[t]=s[t],n=!0,h=h||!this.opts.staticGrid&&("noResize"===t||"noMove"===t||"locked"===t));o&&(this.engine.cleanNodes(),this.engine.beginUpdate(i),this.engine.moveNode(i,o.x,o.y,o.w,o.h),this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()),n&&this._writeAttr(t,i),h&&this._prepareDragDropByNode(i)})),this}margin(t){if(!("string"==typeof t&&t.split(" ").length>1)){let e=r.Utils.parseHeight(t);if(this.opts.marginUnit===e.unit&&this.opts.margin===e.h)return}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this.initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(t,e,i,s,o){return this.engine.canBePlacedWithRespectToHeight({x:t,y:e,w:i,h:s,autoPosition:o})}_triggerChangeEvent(){if(this.engine.batchMode)return this;let t=this.engine.getDirtyNodes(!0);return t&&t.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine.saveInitial(),this}_triggerAddEvent(){return this.engine.batchMode||this.engine.addedNodes&&this.engine.addedNodes.length>0&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach((t=>{delete t._dirty})),this._triggerEvent("added",this.engine.addedNodes),this.engine.addedNodes=[]),this}_triggerRemoveEvent(){return this.engine.batchMode||this.engine.removedNodes&&this.engine.removedNodes.length>0&&(this._triggerEvent("removed",this.engine.removedNodes),this.engine.removedNodes=[]),this}_triggerEvent(t,e){let i=e?new CustomEvent(t,{bubbles:!1,detail:e}):new Event(t);return this.el.dispatchEvent(i),this}_removeStylesheet(){return this._styles&&(r.Utils.removeStylesheet(this._styles._id),delete this._styles),this}_updateStyles(t=!1,e){if(t&&this._removeStylesheet(),this._updateContainerHeight(),!this.opts.cellHeight)return this;let i=this.opts.cellHeight,s=this.opts.cellHeightUnit,o=`.${this.opts._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let t="gridstack-style-"+(1e5*Math.random()).toFixed(),e=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=r.Utils.createStylesheet(t,e),!this._styles)return this;this._styles._id=t,this._styles._max=0,r.Utils.addCSSRule(this._styles,o,`min-height: ${i}${s}`);let n=this.opts.marginTop+this.opts.marginUnit,h=this.opts.marginBottom+this.opts.marginUnit,l=this.opts.marginRight+this.opts.marginUnit,a=this.opts.marginLeft+this.opts.marginUnit,d=`${o} > .grid-stack-item-content`,g=`.${this.opts._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;r.Utils.addCSSRule(this._styles,d,`top: ${n}; right: ${l}; bottom: ${h}; left: ${a};`),r.Utils.addCSSRule(this._styles,g,`top: ${n}; right: ${l}; bottom: ${h}; left: ${a};`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-ne`,`right: ${l}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-e`,`right: ${l}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-se`,`right: ${l}; bottom: ${h}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-nw`,`left: ${a}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-w`,`left: ${a}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-sw`,`left: ${a}; bottom: ${h}`)}if((e=e||this._styles._max)>this._styles._max){let t=t=>i*t+s;for(let i=this._styles._max+1;i<=e;i++){let e=t(i);r.Utils.addCSSRule(this._styles,`${o}[gs-y="${i-1}"]`,`top: ${t(i-1)}`),r.Utils.addCSSRule(this._styles,`${o}[gs-h="${i}"]`,`height: ${e}`),r.Utils.addCSSRule(this._styles,`${o}[gs-min-h="${i}"]`,`min-height: ${e}`),r.Utils.addCSSRule(this._styles,`${o}[gs-max-h="${i}"]`,`max-height: ${e}`)}this._styles._max=e}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.getRow(),e=parseInt(getComputedStyle(this.el)["min-height"]);if(e>0){let i=Math.round(e/this.getCellHeight(!0));t<i&&(t=i)}if(this.el.setAttribute("gs-current-row",String(t)),0===t)return this.el.style.removeProperty("height"),this;let i=this.opts.cellHeight,s=this.opts.cellHeightUnit;return i?(this.el.style.height=t*i+s,this):this}_resizeNestedGrids(t){return t.querySelectorAll(".grid-stack").forEach((t=>{t.gridstack&&t.gridstack.onParentResize()})),this}_prepareElement(t,e=!1,i){i||(t.classList.add(this.opts.itemClass),i=this._readAttr(t)),t.gridstackNode=i,i.el=t,i.grid=this;let s=Object.assign({},i);return i=this.engine.addNode(i,e),r.Utils.same(i,s)||this._writeAttr(t,i),this._prepareDragDropByNode(i),this}_writeAttrs(t,e,i,s,o){return null!=e&&t.setAttribute("gs-x",String(e)),null!=i&&t.setAttribute("gs-y",String(i)),s&&t.setAttribute("gs-w",String(s)),o&&t.setAttribute("gs-h",String(o)),this}_writeAttr(t,e){if(!e)return this;this._writeAttrs(t,e.x,e.y,e.w,e.h);let i={autoPosition:"gs-auto-position",minW:"gs-min-w",minH:"gs-min-h",maxW:"gs-max-w",maxH:"gs-max-h",noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",resizeHandles:"gs-resize-handles"};for(const s in i)e[s]?t.setAttribute(i[s],String(e[s])):t.removeAttribute(i[s]);return this}_readAttr(t,e={}){e.x=r.Utils.toNumber(t.getAttribute("gs-x")),e.y=r.Utils.toNumber(t.getAttribute("gs-y")),e.w=r.Utils.toNumber(t.getAttribute("gs-w")),e.h=r.Utils.toNumber(t.getAttribute("gs-h")),e.maxW=r.Utils.toNumber(t.getAttribute("gs-max-w")),e.minW=r.Utils.toNumber(t.getAttribute("gs-min-w")),e.maxH=r.Utils.toNumber(t.getAttribute("gs-max-h")),e.minH=r.Utils.toNumber(t.getAttribute("gs-min-h")),e.autoPosition=r.Utils.toBool(t.getAttribute("gs-auto-position")),e.noResize=r.Utils.toBool(t.getAttribute("gs-no-resize")),e.noMove=r.Utils.toBool(t.getAttribute("gs-no-move")),e.locked=r.Utils.toBool(t.getAttribute("gs-locked")),e.resizeHandles=t.getAttribute("gs-resize-handles"),e.id=t.getAttribute("gs-id");for(const t in e){if(!e.hasOwnProperty(t))return;e[t]||0===e[t]||delete e[t]}return e}_setStaticClass(){let t=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...t),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...t),this.el.removeAttribute("gs-static")),this}onParentResize(){if(this.el){if(this._isAutoCellHeight&&r.Utils.throttle((()=>{let t=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;this.cellHeight(this.cellWidth()+t)}),100),!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.minWidth){if(this._oneColumnMode)return this;this._oneColumnMode=!0,this.column(1),this._resizeNestedGrids(this.el)}else{if(!this._oneColumnMode)return this;delete this._oneColumnMode,this.column(this._prevColumn),this._resizeNestedGrids(this.el)}return this}}_updateWindowResizeEvent(t=!1){const e=this._isAutoCellHeight||!this.opts.disableOneColumnMode;return!e||t||this.opts._isNested||this._windowResizeBind?!t&&e||!this._windowResizeBind||(window.removeEventListener("resize",this._windowResizeBind),delete this._windowResizeBind):(this._windowResizeBind=this.onParentResize.bind(this),window.addEventListener("resize",this._windowResizeBind),this.onParentResize()),this}static getElement(t=".grid-stack-item"){return r.Utils.getElement(t)}static getElements(t=".grid-stack-item"){return r.Utils.getElements(t)}static getGridElement(t){return l.getElement(t)}static getGridElements(t){return r.Utils.getElements(t)}initMargin(){let t,e=0,i=[];return"string"==typeof this.opts.margin&&(i=this.opts.margin.split(" ")),2===i.length?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):4===i.length?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(t=r.Utils.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,e=this.opts.margin=t.h),void 0===this.opts.marginTop?this.opts.marginTop=e:(t=r.Utils.parseHeight(this.opts.marginTop),this.opts.marginTop=t.h,delete this.opts.margin),void 0===this.opts.marginBottom?this.opts.marginBottom=e:(t=r.Utils.parseHeight(this.opts.marginBottom),this.opts.marginBottom=t.h,delete this.opts.margin),void 0===this.opts.marginRight?this.opts.marginRight=e:(t=r.Utils.parseHeight(this.opts.marginRight),this.opts.marginRight=t.h,delete this.opts.margin),void 0===this.opts.marginLeft?this.opts.marginLeft=e:(t=r.Utils.parseHeight(this.opts.marginLeft),this.opts.marginLeft=t.h,delete this.opts.margin),this.opts.marginUnit=t.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}movable(t,e){return this}resizable(t,e){return this}_setupAcceptWidget(){return this}_setupRemoveDrop(){return this}_setupRemovingTimeout(t){return this}_clearRemovingTimeout(t){return this}_setupDragIn(){return this}_prepareDragDropByNode(t){return this}locked(t,e){return this.update(t,{locked:e})}maxWidth(t,e){return this.update(t,{maxW:e})}minWidth(t,e){return this.update(t,{minW:e})}maxHeight(t,e){return this.update(t,{maxH:e})}minHeight(t,e){return this.update(t,{minH:e})}move(t,e,i){return this.update(t,{x:e,y:i})}resize(t,e,i){return this.update(t,{w:e,h:i})}}e.GridStack=l,l.Utils=r.Utils,l.Engine=o.GridStackEngine},822:(t,e,i)=>{function s(t){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])}Object.defineProperty(e,"__esModule",{value:!0}),s(i(593)),s(i(62)),s(i(334)),s(i(270))},593:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.obsolete=function(t,e,i,s,o){let r=(...r)=>(console.warn("gridstack.js: Function `"+i+"` is deprecated in "+o+" and has been replaced with `"+s+"`. It will be **completely** removed in v1.0"),e.apply(t,r));return r.prototype=e.prototype,r},e.obsoleteOpts=function(t,e,i,s){void 0!==t[e]&&(t[i]=t[e],console.warn("gridstack.js: Option `"+e+"` is deprecated in "+s+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))},e.obsoleteOptsDel=function(t,e,i,s){void 0!==t[e]&&console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+s)},e.obsoleteAttr=function(t,e,i,s){let o=t.getAttribute(e);null!==o&&(t.setAttribute(i,o),console.warn("gridstack.js: attribute `"+e+"`="+o+" is deprecated on this object in "+s+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))},e.Utils=class{static getElements(t){if("string"==typeof t){let e=document.querySelectorAll(t);return e.length||"."===t[0]||"#"===t[0]||(e=document.querySelectorAll("."+t),e.length||(e=document.querySelectorAll("#"+t))),Array.from(e)}return[t]}static getElement(t){if("string"==typeof t){if(!t.length)return null;if("#"===t[0])return document.getElementById(t.substring(1));if("."===t[0]||"["===t[0])return document.querySelector(t);if(!isNaN(+t[0]))return document.getElementById(t);let e=document.querySelector(t);return e||(e=document.getElementById(t)),e||(e=document.querySelector("."+t)),e}return t}static isIntercepted(t,e){return!(t.x+t.w<=e.x||e.x+e.w<=t.x||t.y+t.h<=e.y||e.y+e.h<=t.y)}static sort(t,e,i){if(!i){let e=t.map((t=>t.x+t.w));i=Math.max(...e)}return-1===e?t.sort(((t,e)=>e.x+e.y*i-(t.x+t.y*i))):t.sort(((t,e)=>t.x+t.y*i-(e.x+e.y*i)))}static createStylesheet(t,e){let i=document.createElement("style");return i.setAttribute("type","text/css"),i.setAttribute("gs-style-id",t),i.styleSheet?i.styleSheet.cssText="":i.appendChild(document.createTextNode("")),e?e.insertBefore(i,e.firstChild):(e=document.getElementsByTagName("head")[0]).appendChild(i),i.sheet}static removeStylesheet(t){let e=document.querySelector("STYLE[gs-style-id="+t+"]");e&&e.parentNode&&e.parentNode.removeChild(e)}static addCSSRule(t,e,i){"function"==typeof t.addRule?t.addRule(e,i):"function"==typeof t.insertRule&&t.insertRule(`${e}{${i}}`)}static toBool(t){return"boolean"==typeof t?t:"string"==typeof t?!(""===(t=t.toLowerCase())||"no"===t||"false"===t||"0"===t):Boolean(t)}static toNumber(t){return null===t||0===t.length?void 0:Number(t)}static parseHeight(t){let e,i="px";if("string"==typeof t){let s=t.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!s)throw new Error("Invalid height");i=s[2]||"px",e=parseFloat(s[1])}else e=t;return{h:e,unit:i}}static defaults(t,...e){return e.forEach((e=>{for(const i in e){if(!e.hasOwnProperty(i))return;null===t[i]||void 0===t[i]?t[i]=e[i]:"object"==typeof e[i]&&"object"==typeof t[i]&&this.defaults(t[i],e[i])}})),t}static same(t,e){if("object"!=typeof t)return t==e;if(typeof t!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(t[i]!==e[i])return!1;return!0}static removeInternalAndSame(t,e){if("object"==typeof t&&"object"==typeof e)for(let i in t){let s=t[i];if(s&&"object"==typeof s){for(let t in s)s[t]!==e[i][t]&&"_"!==t[0]||delete s[t];Object.keys(s).length||delete t[i]}else s!==e[i]&&"_"!==i[0]||delete t[i]}}static closestByClass(t,e){for(;t=t.parentElement;)if(t.classList.contains(e))return t;return null}static throttle(t,e){let i=!1;return(...s)=>{i||(t.apply(this,s),i=!0,setTimeout((()=>i=!1),e))}}static removePositioningStyles(t){let e=t.style;e.position&&e.removeProperty("position"),e.left&&e.removeProperty("left"),e.top&&e.removeProperty("top"),e.width&&e.removeProperty("width"),e.height&&e.removeProperty("height")}static getScrollParent(t){let e;return e=null===t?null:t.scrollHeight>t.clientHeight?t:this.getScrollParent(t.parentElement),e}static updateScrollPosition(t,e,i){let s=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight;if(s.top<0||s.bottom>o){let r=s.bottom-o,n=s.top,h=this.getScrollParent(t);if(null!==h){let l=h.scrollTop;s.top<0&&i<0?t.offsetHeight>o?h.scrollTop+=i:h.scrollTop+=Math.abs(n)>Math.abs(i)?i:n:i>0&&(t.offsetHeight>o?h.scrollTop+=i:h.scrollTop+=r>i?i:r),e.top+=h.scrollTop-l}}}}}},e={};return function i(s){if(e[s])return e[s].exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}(822)})().GridStack})); | ||
//# sourceMappingURL=gridstack-static.js.map |
@@ -1,11 +0,9 @@ | ||
// gridstack-ddi.ts 3.0.0 @preserve | ||
// gridstack-ddi.ts 3.1.0 @preserve | ||
// gridstack-engine.ts 3.0.0 @preserve | ||
// gridstack-engine.ts 3.1.0 @preserve | ||
// gridstack.ts 3.0.0 @preserve | ||
// gridstack.ts 3.1.0 @preserve | ||
// index.static.ts 3.0.0 - everything you need for a static Grid (non draggable) @preserve | ||
// index.static.ts 3.1.0 - everything you need for a static Grid (non draggable) @preserve | ||
// types.ts 3.0.0 @preserve | ||
// utils.ts 3.0.0 @preserve | ||
// utils.ts 3.1.0 @preserve |
@@ -41,3 +41,3 @@ /** | ||
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support | ||
* multiple grids initialization at once. | ||
* multiple grids initialization at once. Or you can use addGrid() to create the entire grid from JSON. | ||
* @param options grid options (optional) | ||
@@ -63,2 +63,10 @@ * @param elOrString element or CSS selector (first one used) to convert to a grid (default to '.grid-stack' class selector) | ||
static initAll(options?: GridStackOptions, selector?: string): GridStack[]; | ||
/** | ||
* call to create a grid with the given options, including loading any children from JSON structure. This will call GridStack.init(), then | ||
* grid.load() on any passed children (recursively). Great alternative to calling init() if you want entire grid to come from | ||
* JSON serialized data, including options. | ||
* @param parent HTML element parent to the grid | ||
* @param opt grids options used to initialize the grid, and list of children | ||
*/ | ||
static addGrid(parent: HTMLElement, opt?: GridStackOptions): GridStack; | ||
/** scoping so users can call GridStack.Utils.sort() for example */ | ||
@@ -96,5 +104,9 @@ static Utils: typeof Utils; | ||
addWidget(els?: GridStackWidget | GridStackElement, options?: GridStackWidget): GridItemHTMLElement; | ||
/** saves the current layout returning a list of widgets for serialization */ | ||
save(saveContent?: boolean): GridStackWidget[]; | ||
/** | ||
* saves the current layout returning a list of widgets for serialization (with default to save content), which might include any nested grids. | ||
* Optionally you can also save the grid with options itself, so you can call the new GridStack.addGrid() | ||
* to recreate everything from scratch. GridStackOptions.children would then contain the widget list. | ||
*/ | ||
save(saveContent?: boolean, saveGridOpt?: boolean): GridStackWidget[] | GridStackOptions; | ||
/** | ||
* load the widgets from a list. This will call update() on each (matching by id) or add/remove widgets that are not there. | ||
@@ -109,3 +121,3 @@ * | ||
**/ | ||
load(layout: GridStackWidget[], addAndRemove?: boolean | ((w: GridStackWidget, add: boolean) => void)): GridStack; | ||
load(layout: GridStackWidget[], addAndRemove?: boolean | ((g: GridStack, w: GridStackWidget, add: boolean) => GridItemHTMLElement)): GridStack; | ||
/** | ||
@@ -158,8 +170,11 @@ * Initializes batch updates. You will see no changes until `commit()` method is called. | ||
/** | ||
* Destroys a grid instance. | ||
* @param removeDOM if `false` grid and items elements will not be removed from the DOM (Optional. Default `true`). | ||
* Destroys a grid instance. DO NOT CALL any methods or access any vars after this as it will free up members. | ||
* @param removeDOM if `false` grid and items HTML elements will not be removed from the DOM (Optional. Default `true`). | ||
*/ | ||
destroy(removeDOM?: boolean): GridStack; | ||
/** | ||
* Disables widgets moving/resizing. This is a shortcut for: | ||
* Temporarily disables widgets moving/resizing. | ||
* If you want a more permanent way (which freezes up resources) use `setStatic(true)` instead. | ||
* Note: no-op for static grid | ||
* This is a shortcut for: | ||
* @example | ||
@@ -171,3 +186,5 @@ * grid.enableMove(false); | ||
/** | ||
* Enables widgets moving/resizing. This is a shortcut for: | ||
* Re-enables widgets moving/resizing - see disable(). | ||
* Note: no-op for static grid. | ||
* This is a shortcut for: | ||
* @example | ||
@@ -179,3 +196,3 @@ * grid.enableMove(true); | ||
/** | ||
* Enables/disables widget moving. | ||
* Enables/disables widget moving. No-op for static grids. | ||
* | ||
@@ -188,3 +205,3 @@ * @param doEnable | ||
/** | ||
* Enables/disables widget resizing | ||
* Enables/disables widget resizing. No-op for static grids. | ||
* @param doEnable | ||
@@ -321,3 +338,3 @@ * @param includeNewWidgets will force new widgets to be draggable as per | ||
/** | ||
* Enables/Disables moving. | ||
* Enables/Disables moving. No-op for static grids. | ||
* @param els widget or selector to modify. | ||
@@ -328,3 +345,3 @@ * @param val if true widget will be draggable. | ||
/** | ||
* Enables/Disables resizing. | ||
* Enables/Disables resizing. No-op for static grids. | ||
* @param els widget or selector to modify | ||
@@ -331,0 +348,0 @@ * @param val if true widget will be resizable. |
"use strict"; | ||
// gridstack.ts 3.0.0 @preserve | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
// gridstack.ts 3.1.0 @preserve | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GridStack = void 0; | ||
/** | ||
@@ -23,7 +15,53 @@ * https://gridstackjs.com/ | ||
const gridstack_ddi_1 = require("./gridstack-ddi"); | ||
// export all dependent file as well to make it easier for users to just import the main file | ||
__exportStar(require("./types"), exports); | ||
__exportStar(require("./utils"), exports); | ||
__exportStar(require("./gridstack-engine"), exports); | ||
__exportStar(require("./gridstack-ddi"), exports); | ||
__export(require("./utils")); | ||
__export(require("./gridstack-engine")); | ||
__export(require("./gridstack-ddi")); | ||
// default values for grid options - used during init and when saving out | ||
const GridDefaults = { | ||
column: 12, | ||
minRow: 0, | ||
maxRow: 0, | ||
itemClass: 'grid-stack-item', | ||
placeholderClass: 'grid-stack-placeholder', | ||
placeholderText: '', | ||
handle: '.grid-stack-item-content', | ||
handleClass: null, | ||
styleInHead: false, | ||
cellHeight: 'auto', | ||
margin: 10, | ||
auto: true, | ||
minWidth: 768, | ||
float: false, | ||
staticGrid: false, | ||
animate: true, | ||
alwaysShowResizeHandle: false, | ||
resizable: { | ||
autoHide: true, | ||
handles: 'se' | ||
}, | ||
draggable: { | ||
handle: '.grid-stack-item-content', | ||
scroll: false, | ||
appendTo: 'body' | ||
}, | ||
dragIn: undefined, | ||
dragInOptions: { | ||
revert: 'invalid', | ||
handle: '.grid-stack-item-content', | ||
scroll: false, | ||
appendTo: 'body' | ||
}, | ||
disableDrag: false, | ||
disableResize: false, | ||
rtl: 'auto', | ||
removable: false, | ||
removableOptions: { | ||
accept: '.grid-stack-item' | ||
}, | ||
removeTimeout: 2000, | ||
marginUnit: 'px', | ||
cellHeightUnit: 'px', | ||
disableOneColumnMode: false, | ||
oneColumnModeDomSort: false | ||
}; | ||
/** | ||
@@ -59,51 +97,13 @@ * Main gridstack class - you will need to call `GridStack.init()` first to initialize your grid. | ||
// elements attributes override any passed options (like CSS style) - merge the two together | ||
let defaults = { | ||
column: utils_1.Utils.toNumber(el.getAttribute('gs-column')) || 12, | ||
minRow: rowAttr ? rowAttr : utils_1.Utils.toNumber(el.getAttribute('gs-min-row')) || 0, | ||
maxRow: rowAttr ? rowAttr : utils_1.Utils.toNumber(el.getAttribute('gs-max-row')) || 0, | ||
itemClass: 'grid-stack-item', | ||
placeholderClass: 'grid-stack-placeholder', | ||
placeholderText: '', | ||
handle: '.grid-stack-item-content', | ||
handleClass: null, | ||
styleInHead: false, | ||
cellHeight: 'auto', | ||
margin: 10, | ||
auto: true, | ||
minWidth: 768, | ||
float: false, | ||
staticGrid: utils_1.Utils.toBool(el.getAttribute('gs-static')) || false, | ||
_class: 'grid-stack-instance-' + (Math.random() * 10000).toFixed(0), | ||
animate: true, | ||
alwaysShowResizeHandle: opts.alwaysShowResizeHandle || false, | ||
resizable: { | ||
let defaults = Object.assign(Object.assign({}, GridDefaults), { column: utils_1.Utils.toNumber(el.getAttribute('gs-column')) || 12, minRow: rowAttr ? rowAttr : utils_1.Utils.toNumber(el.getAttribute('gs-min-row')) || 0, maxRow: rowAttr ? rowAttr : utils_1.Utils.toNumber(el.getAttribute('gs-max-row')) || 0, staticGrid: utils_1.Utils.toBool(el.getAttribute('gs-static')) || false, _styleSheetClass: 'grid-stack-instance-' + (Math.random() * 10000).toFixed(0), alwaysShowResizeHandle: opts.alwaysShowResizeHandle || false, resizable: { | ||
autoHide: !(opts.alwaysShowResizeHandle || false), | ||
handles: 'se' | ||
}, | ||
draggable: { | ||
}, draggable: { | ||
handle: (opts.handleClass ? '.' + opts.handleClass : (opts.handle ? opts.handle : '')) || '.grid-stack-item-content', | ||
scroll: false, | ||
appendTo: 'body' | ||
}, | ||
dragIn: undefined, | ||
dragInOptions: { | ||
revert: 'invalid', | ||
handle: '.grid-stack-item-content', | ||
scroll: false, | ||
appendTo: 'body' | ||
}, | ||
disableDrag: false, | ||
disableResize: false, | ||
rtl: 'auto', | ||
removable: false, | ||
removableOptions: { | ||
}, removableOptions: { | ||
accept: '.' + (opts.itemClass || 'grid-stack-item') | ||
}, | ||
removeTimeout: 2000, | ||
marginUnit: 'px', | ||
cellHeightUnit: 'px', | ||
disableOneColumnMode: false, | ||
oneColumnModeDomSort: false | ||
}; | ||
if (el.getAttribute('gs-animate')) { | ||
} }); | ||
if (el.getAttribute('gs-animate')) { // default to true, but if set to false use that instead | ||
defaults.animate = utils_1.Utils.toBool(el.getAttribute('gs-animate')); | ||
@@ -120,4 +120,7 @@ } | ||
} | ||
this.opts._isNested = utils_1.Utils.closestByClass(this.el, this.opts.itemClass) !== null; | ||
if (this.opts._isNested) { | ||
// check if we're been nested, and if so update our style and keep pointer around (used during save) | ||
let parentGridItemEl = utils_1.Utils.closestByClass(this.el, GridDefaults.itemClass); | ||
if (parentGridItemEl && parentGridItemEl.gridstackNode) { | ||
this.opts._isNested = parentGridItemEl.gridstackNode; | ||
this.opts._isNested.subGrid = this; | ||
this.el.classList.add('grid-stack-nested'); | ||
@@ -135,3 +138,3 @@ } | ||
} | ||
this.el.classList.add(this.opts._class); | ||
this.el.classList.add(this.opts._styleSheetClass); | ||
this._setStaticClass(); | ||
@@ -185,3 +188,3 @@ this._updateStyles(); | ||
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support | ||
* multiple grids initialization at once. | ||
* multiple grids initialization at once. Or you can use addGrid() to create the entire grid from JSON. | ||
* @param options grid options (optional) | ||
@@ -209,3 +212,3 @@ * @param elOrString element or CSS selector (first one used) to convert to a grid (default to '.grid-stack' class selector) | ||
if (!el.gridstack) { | ||
el.gridstack = new GridStack(el, utils_1.Utils.clone(options)); | ||
el.gridstack = new GridStack(el, Object.assign({}, options)); | ||
} | ||
@@ -227,3 +230,3 @@ return el.gridstack; | ||
if (!el.gridstack) { | ||
el.gridstack = new GridStack(el, utils_1.Utils.clone(options)); | ||
el.gridstack = new GridStack(el, Object.assign({}, options)); | ||
} | ||
@@ -239,2 +242,25 @@ grids.push(el.gridstack); | ||
/** | ||
* call to create a grid with the given options, including loading any children from JSON structure. This will call GridStack.init(), then | ||
* grid.load() on any passed children (recursively). Great alternative to calling init() if you want entire grid to come from | ||
* JSON serialized data, including options. | ||
* @param parent HTML element parent to the grid | ||
* @param opt grids options used to initialize the grid, and list of children | ||
*/ | ||
static addGrid(parent, opt = {}) { | ||
if (!parent) { | ||
return null; | ||
} | ||
// create the grid element | ||
let doc = document.implementation.createHTMLDocument(); | ||
doc.body.innerHTML = `<div class="grid-stack ${opt.class || ''}"></div>`; | ||
let el = doc.body.children[0]; | ||
parent.append(el); | ||
// create grid class and load any children | ||
let grid = GridStack.init(opt, el); | ||
if (opt.children) { | ||
grid.load(opt.children); | ||
} | ||
return grid; | ||
} | ||
/** | ||
* add a new widget and returns it. | ||
@@ -276,3 +302,3 @@ * | ||
let doc = document.implementation.createHTMLDocument(); | ||
doc.body.innerHTML = `<div class="grid-stack-item"><div class="grid-stack-item-content">${content}</div></div>`; | ||
doc.body.innerHTML = `<div class="grid-stack-item ${this.opts.itemClass || ''}"><div class="grid-stack-item-content">${content}</div></div>`; | ||
el = doc.body.children[0]; | ||
@@ -299,4 +325,9 @@ } | ||
} | ||
/** saves the current layout returning a list of widgets for serialization */ | ||
save(saveContent = true) { | ||
/** | ||
* saves the current layout returning a list of widgets for serialization (with default to save content), which might include any nested grids. | ||
* Optionally you can also save the grid with options itself, so you can call the new GridStack.addGrid() | ||
* to recreate everything from scratch. GridStackOptions.children would then contain the widget list. | ||
*/ | ||
save(saveContent = true, saveGridOpt = false) { | ||
// return copied nodes we can modify at will... | ||
let list = this.engine.save(saveContent); | ||
@@ -315,2 +346,29 @@ // check for HTML content as well | ||
} | ||
// check if save entire grid options (needed for recursive) + children... | ||
if (saveGridOpt) { | ||
// check for nested grid | ||
list.forEach(n => { | ||
if (n.subGrid) { | ||
n.subGrid = n.subGrid.save(saveContent, true); | ||
} | ||
}); | ||
let o = Object.assign({}, this.opts); | ||
// delete default values that will be recreated on launch | ||
if (o.marginBottom === o.marginTop && o.marginRight === o.marginLeft && o.marginTop === o.marginRight) { | ||
o.margin = o.marginTop; | ||
delete o.marginTop; | ||
delete o.marginRight; | ||
delete o.marginBottom; | ||
delete o.marginLeft; | ||
} | ||
if (o.rtl === (this.el.style.direction === 'rtl')) { | ||
o.rtl = 'auto'; | ||
} | ||
if (this._isAutoCellHeight) { | ||
o.cellHeight = 'auto'; | ||
} | ||
utils_1.Utils.removeInternalAndSame(o, GridDefaults); | ||
o.children = list; | ||
return o; | ||
} | ||
return list; | ||
@@ -345,3 +403,3 @@ } | ||
if (typeof (addAndRemove) === 'function') { | ||
addAndRemove(n, false); | ||
addAndRemove(this, n, false); | ||
} | ||
@@ -360,10 +418,20 @@ else { | ||
this.update(item.el, w); | ||
if (w.subGrid && w.subGrid.children) { // update any sub grid as well | ||
let sub = item.el.querySelector('.grid-stack'); | ||
if (sub && sub.gridstack) { | ||
sub.gridstack.load(w.subGrid.children); // TODO: support updating grid options ? | ||
} | ||
} | ||
} | ||
else if (addAndRemove) { | ||
if (typeof (addAndRemove) === 'function') { | ||
addAndRemove(w, true); | ||
w = addAndRemove(this, w, true).gridstackNode; | ||
} | ||
else { | ||
this.addWidget(w); | ||
w = this.addWidget(w).gridstackNode; | ||
} | ||
if (w.subGrid) { // see if there is a sub-grid to create too | ||
let content = w.el.querySelector('.grid-stack-item-content'); | ||
w.subGrid = GridStack.addGrid(content, w.subGrid); | ||
} | ||
} | ||
@@ -501,6 +569,9 @@ }); | ||
/** | ||
* Destroys a grid instance. | ||
* @param removeDOM if `false` grid and items elements will not be removed from the DOM (Optional. Default `true`). | ||
* Destroys a grid instance. DO NOT CALL any methods or access any vars after this as it will free up members. | ||
* @param removeDOM if `false` grid and items HTML elements will not be removed from the DOM (Optional. Default `true`). | ||
*/ | ||
destroy(removeDOM = true) { | ||
if (!this.el) { | ||
return; | ||
} // prevent multiple calls | ||
this._updateWindowResizeEvent(true); | ||
@@ -510,4 +581,3 @@ this.setStatic(true); // permanently removes DD | ||
this.removeAll(removeDOM); | ||
this.el.classList.remove(this.opts._class); | ||
delete this.el.gridstack; | ||
this.el.classList.remove(this.opts._styleSheetClass); | ||
} | ||
@@ -518,8 +588,15 @@ else { | ||
this._removeStylesheet(); | ||
delete this.opts._isNested; | ||
delete this.opts; | ||
delete this.placeholder; | ||
delete this.engine; | ||
delete this.el.gridstack; // remove circular dependency that would prevent a freeing | ||
delete this.el; | ||
return this; | ||
} | ||
/** | ||
* Disables widgets moving/resizing. This is a shortcut for: | ||
* Temporarily disables widgets moving/resizing. | ||
* If you want a more permanent way (which freezes up resources) use `setStatic(true)` instead. | ||
* Note: no-op for static grid | ||
* This is a shortcut for: | ||
* @example | ||
@@ -530,2 +607,5 @@ * grid.enableMove(false); | ||
disable() { | ||
if (this.opts.staticGrid) { | ||
return; | ||
} | ||
this.enableMove(false); | ||
@@ -537,3 +617,5 @@ this.enableResize(false); | ||
/** | ||
* Enables widgets moving/resizing. This is a shortcut for: | ||
* Re-enables widgets moving/resizing - see disable(). | ||
* Note: no-op for static grid. | ||
* This is a shortcut for: | ||
* @example | ||
@@ -544,2 +626,5 @@ * grid.enableMove(true); | ||
enable() { | ||
if (this.opts.staticGrid) { | ||
return; | ||
} | ||
this.enableMove(true); | ||
@@ -551,3 +636,3 @@ this.enableResize(true); | ||
/** | ||
* Enables/disables widget moving. | ||
* Enables/disables widget moving. No-op for static grids. | ||
* | ||
@@ -559,3 +644,3 @@ * @param doEnable | ||
enableMove(doEnable, includeNewWidgets = true) { | ||
if (doEnable && this.opts.staticGrid) { | ||
if (this.opts.staticGrid) { | ||
return this; | ||
@@ -570,3 +655,3 @@ } // can't move a static grid! | ||
/** | ||
* Enables/disables widget resizing | ||
* Enables/disables widget resizing. No-op for static grids. | ||
* @param doEnable | ||
@@ -577,3 +662,3 @@ * @param includeNewWidgets will force new widgets to be draggable as per | ||
enableResize(doEnable, includeNewWidgets = true) { | ||
if (doEnable && this.opts.staticGrid) { | ||
if (this.opts.staticGrid) { | ||
return this; | ||
@@ -985,3 +1070,3 @@ } // can't size a static grid! | ||
let cellHeightUnit = this.opts.cellHeightUnit; | ||
let prefix = `.${this.opts._class} > .${this.opts.itemClass}`; | ||
let prefix = `.${this.opts._styleSheetClass} > .${this.opts.itemClass}`; | ||
// create one as needed | ||
@@ -1006,3 +1091,3 @@ if (!this._styles) { | ||
let content = `${prefix} > .grid-stack-item-content`; | ||
let placeholder = `.${this.opts._class} > .grid-stack-placeholder > .placeholder-content`; | ||
let placeholder = `.${this.opts._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`; | ||
utils_1.Utils.addCSSRule(this._styles, content, `top: ${top}; right: ${right}; bottom: ${bottom}; left: ${left};`); | ||
@@ -1175,2 +1260,5 @@ utils_1.Utils.addCSSRule(this._styles, placeholder, `top: ${top}; right: ${right}; bottom: ${bottom}; left: ${left};`); | ||
onParentResize() { | ||
if (!this.el) { | ||
return; | ||
} // return if we're gone | ||
// make the cells content (minus margin) square again | ||
@@ -1297,3 +1385,3 @@ if (this._isAutoCellHeight) { | ||
/** | ||
* Enables/Disables moving. | ||
* Enables/Disables moving. No-op for static grids. | ||
* @param els widget or selector to modify. | ||
@@ -1304,3 +1392,3 @@ * @param val if true widget will be draggable. | ||
/** | ||
* Enables/Disables resizing. | ||
* Enables/Disables resizing. No-op for static grids. | ||
* @param els widget or selector to modify | ||
@@ -1307,0 +1395,0 @@ * @param val if true widget will be resizable. |
@@ -9,3 +9,3 @@ /** | ||
/** returns the enable state, but you have to call enable()/disable() to change (as other things need to happen) */ | ||
get disabled(): boolean; | ||
readonly disabled: boolean; | ||
on(event: string, callback: EventCallback): void; | ||
@@ -12,0 +12,0 @@ off(event: string): void; |
"use strict"; | ||
// dd-base-impl.ts 3.0.0 @preserve | ||
// dd-base-impl.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DDBaseImplement = void 0; | ||
class DDBaseImplement { | ||
@@ -6,0 +5,0 @@ constructor() { |
"use strict"; | ||
// dd-draggable.ts 3.0.0 @preserve | ||
// dd-draggable.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DDDraggable = void 0; | ||
/** | ||
@@ -198,5 +197,5 @@ * https://gridstackjs.com/ | ||
_removeHelperStyle() { | ||
var _a, _b; | ||
// don't bother restoring styles if we're gonna remove anyway... | ||
if (!((_b = (_a = this.helper) === null || _a === void 0 ? void 0 : _a.gridstackNode) === null || _b === void 0 ? void 0 : _b._isAboutToRemove)) { | ||
let node = this.helper ? this.helper.gridstackNode : undefined; | ||
if (!node || !node._isAboutToRemove) { | ||
DDDraggable.originStyleProp.forEach(prop => { | ||
@@ -203,0 +202,0 @@ this.helper.style[prop] = this.dragElementOriginStyle[prop] || null; |
"use strict"; | ||
// dd-droppable.ts 3.0.0 @preserve | ||
// dd-droppable.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DDDroppable = void 0; | ||
const dd_manager_1 = require("./dd-manager"); | ||
@@ -6,0 +5,0 @@ const dd_base_impl_1 = require("./dd-base-impl"); |
"use strict"; | ||
// dd-elements.ts 3.0.0 @preserve | ||
// dd-elements.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DDElement = void 0; | ||
/** | ||
@@ -6,0 +5,0 @@ * https://gridstackjs.com/ |
"use strict"; | ||
// dd-manager.ts 3.0.0 @preserve | ||
// dd-manager.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DDManager = void 0; | ||
class DDManager { | ||
@@ -6,0 +5,0 @@ } |
"use strict"; | ||
// dd-resizable-handle.ts 3.0.0 @preserve | ||
// dd-resizable-handle.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DDResizableHandle = void 0; | ||
class DDResizableHandle { | ||
@@ -6,0 +5,0 @@ constructor(host, direction, option) { |
"use strict"; | ||
// dd-resizable.ts 3.0.0 @preserve | ||
// dd-resizable.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DDResizable = void 0; | ||
/** | ||
@@ -6,0 +5,0 @@ * https://gridstackjs.com/ |
"use strict"; | ||
// dd-utils.ts 3.0.0 @preserve | ||
// dd-utils.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DDUtils = void 0; | ||
/** | ||
@@ -6,0 +5,0 @@ * https://gridstackjs.com/ |
"use strict"; | ||
// gridstack-dd-native.ts 3.0.0 @preserve | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
// gridstack-dd-native.ts 3.1.0 @preserve | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GridStackDDNative = void 0; | ||
/** | ||
@@ -25,3 +17,3 @@ * https://gridstackjs.com/ | ||
// export our base class (what user should use) and all associated types | ||
__exportStar(require("../gridstack-dd"), exports); | ||
__export(require("../gridstack-dd")); | ||
/** | ||
@@ -34,8 +26,6 @@ * HTML 5 Native DragDrop based drag'n'drop plugin. | ||
if (opts === 'disable' || opts === 'enable') { | ||
dEl.ddResizable[opts](); | ||
dEl.ddResizable && dEl.ddResizable[opts](); // can't create DD as it requires options for setupResizable() | ||
} | ||
else if (opts === 'destroy') { | ||
if (dEl.ddResizable) { | ||
dEl.cleanResizable(); | ||
} | ||
dEl.ddResizable && dEl.cleanResizable(); | ||
} | ||
@@ -60,8 +50,6 @@ else if (opts === 'option') { | ||
if (opts === 'disable' || opts === 'enable') { | ||
dEl.ddDraggable && dEl.ddDraggable[opts](); | ||
dEl.ddDraggable && dEl.ddDraggable[opts](); // can't create DD as it requires options for setupDraggable() | ||
} | ||
else if (opts === 'destroy') { | ||
if (dEl.ddDraggable) { // error to call destroy if not there | ||
dEl.cleanDraggable(); | ||
} | ||
dEl.ddDraggable && dEl.cleanDraggable(); | ||
} | ||
@@ -68,0 +56,0 @@ else if (opts === 'option') { |
"use strict"; | ||
// gridstack-dd-jqueryui.ts 3.0.0 @preserve | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
// gridstack-dd-jqueryui.ts 3.1.0 @preserve | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GridStackDDJQueryUI = exports.$ = void 0; | ||
const gridstack_dd_1 = require("../gridstack-dd"); | ||
@@ -24,3 +16,3 @@ // export jq symbols see | ||
// export our base class (what user should use) and all associated types | ||
__exportStar(require("../gridstack-dd"), exports); | ||
__export(require("../gridstack-dd")); | ||
/** | ||
@@ -27,0 +19,0 @@ * legacy Jquery-ui based drag'n'drop plugin. |
@@ -1,2 +0,2 @@ | ||
!function(b){b.ui=b.ui||{};var t=b.ui.version="1.12.1",i=0,a=Array.prototype.slice;b.cleanData=function(o){return function(t){var e,i,s;for(s=0;(i=t[s])!=null;s++)try{e=b._data(i,"events");if(e&&e.remove)b(i).triggerHandler("remove")}catch(t){}o(t)}}(b.cleanData),b.widget=function(t,i,e){var s,o,n;var r={};var a=t.split(".")[0];t=t.split(".")[1];var l=a+"-"+t;if(!e){e=i;i=b.Widget}if(b.isArray(e))e=b.extend.apply(null,[{}].concat(e));b.expr[":"][l.toLowerCase()]=function(t){return!!b.data(t,l)};b[a]=b[a]||{};s=b[a][t];o=b[a][t]=function(t,e){if(!this._createWidget)return new o(t,e);if(arguments.length)this._createWidget(t,e)};b.extend(o,s,{version:e.version,_proto:b.extend({},e),_childConstructors:[]});n=new i;n.options=b.widget.extend({},n.options);b.each(e,function(e,n){if(!b.isFunction(n)){r[e]=n;return}r[e]=function(){function s(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}return function(){var t=this._super;var e=this._superApply;var i;this._super=s;this._superApply=o;i=n.apply(this,arguments);this._super=t;this._superApply=e;return i}}()});o.prototype=b.widget.extend(n,{widgetEventPrefix:s?n.widgetEventPrefix||t:t},r,{constructor:o,namespace:a,widgetName:t,widgetFullName:l});if(s){b.each(s._childConstructors,function(t,e){var i=e.prototype;b.widget(i.namespace+"."+i.widgetName,o,e._proto)});delete s._childConstructors}else i._childConstructors.push(o);b.widget.bridge(t,o);return o},b.widget.extend=function(t){var e=a.call(arguments,1);var i=0;var s=e.length;var o;var n;for(;i<s;i++)for(o in e[i]){n=e[i][o];if(e[i].hasOwnProperty(o)&&n!==undefined)if(b.isPlainObject(n))t[o]=b.isPlainObject(t[o])?b.widget.extend({},t[o],n):b.widget.extend({},n);else t[o]=n}return t},b.widget.bridge=function(n,e){var r=e.prototype.widgetFullName||n;b.fn[n]=function(i){var t=typeof i==="string";var s=a.call(arguments,1);var o=this;if(t)if(!this.length&&i==="instance")o=undefined;else this.each(function(){var t;var e=b.data(this,r);if(i==="instance"){o=e;return false}if(!e)return b.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+i+"'");if(!b.isFunction(e[i])||i.charAt(0)==="_")return b.error("no such method '"+i+"' for "+n+" widget instance");t=e[i].apply(e,s);if(t!==e&&t!==undefined){o=t&&t.jquery?o.pushStack(t.get()):t;return false}});else{if(s.length)i=b.widget.extend.apply(null,[i].concat(s));this.each(function(){var t=b.data(this,r);if(t){t.option(i||{});if(t._init)t._init()}else b.data(this,r,new e(i,this))})}return o}},b.Widget=function(){},b.Widget._childConstructors=[],b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:false,create:null},_createWidget:function(t,e){e=b(e||this.defaultElement||this)[0];this.element=b(e);this.uuid=i++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=b();this.hoverable=b();this.focusable=b();this.classesElementLookup={};if(e!==this){b.data(e,this.widgetFullName,this);this._on(true,this.element,{remove:function(t){if(t.target===e)this.destroy()}});this.document=b(e.style?e.ownerDocument:e.document||e);this.window=b(this.document[0].defaultView||this.document[0].parentWindow)}this.options=b.widget.extend({},this.options,this._getCreateOptions(),t);this._create();if(this.options.disabled)this._setOptionDisabled(this.options.disabled);this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:b.noop,_create:b.noop,_init:b.noop,destroy:function(){var i=this;this._destroy();b.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:b.noop,widget:function(){return this.element},option:function(t,e){var i=t;var s;var o;var n;if(arguments.length===0)return b.widget.extend({},this.options);if(typeof t==="string"){i={};s=t.split(".");t=s.shift();if(s.length){o=i[t]=b.widget.extend({},this.options[t]);for(n=0;n<s.length-1;n++){o[s[n]]=o[s[n]]||{};o=o[s[n]]}t=s.pop();if(arguments.length===1)return o[t]===undefined?null:o[t];o[t]=e}else{if(arguments.length===1)return this.options[t]===undefined?null:this.options[t];i[t]=e}}this._setOptions(i);return this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){if(t==="classes")this._setOptionClasses(e);this.options[t]=e;if(t==="disabled")this._setOptionDisabled(e);return this},_setOptionClasses:function(t){var e,i,s;for(e in t){s=this.classesElementLookup[e];if(t[e]===this.options.classes[e]||!s||!s.length)continue;i=b(s.get());this._removeClass(s,e);i.addClass(this._classes({element:i,keys:e,classes:t,add:true}))}},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t);if(t){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},enable:function(){return this._setOptions({disabled:false})},disable:function(){return this._setOptions({disabled:true})},_classes:function(o){var n=[];var r=this;o=b.extend({element:this.element,classes:this.options.classes||{}},o);function t(t,e){var i,s;for(s=0;s<t.length;s++){i=r.classesElementLookup[t[s]]||b();if(o.add)i=b(b.unique(i.get().concat(o.element.get())));else i=b(i.not(o.element).get());r.classesElementLookup[t[s]]=i;n.push(t[s]);if(e&&o.classes[t[s]])n.push(o.classes[t[s]])}}this._on(o.element,{remove:"_untrackClassesElement"});if(o.keys)t(o.keys.match(/\S+/g)||[],true);if(o.extra)t(o.extra.match(/\S+/g)||[]);return n.join(" ")},_untrackClassesElement:function(i){var s=this;b.each(s.classesElementLookup,function(t,e){if(b.inArray(i.target,e)!==-1)s.classesElementLookup[t]=b(e.not(i.target).get())})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,false)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,true)},_toggleClass:function(t,e,i,s){s=typeof s==="boolean"?s:i;var o=typeof t==="string"||t===null,n={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:s};n.element.toggleClass(this._classes(n),s);return this},_on:function(r,a,t){var l;var h=this;if(typeof r!=="boolean"){t=a;a=r;r=false}if(!t){t=a;a=this.element;l=this.widget()}else{a=l=b(a);this.bindings=this.bindings.add(a)}b.each(t,function(t,e){function i(){if(!r&&(h.options.disabled===true||b(this).hasClass("ui-state-disabled")))return;return(typeof e==="string"?h[e]:e).apply(h,arguments)}if(typeof e!=="string")i.guid=e.guid=e.guid||i.guid||b.guid++;var s=t.match(/^([\w:-]*)\s*(.*)$/);var o=s[1]+h.eventNamespace;var n=s[2];if(n)l.on(o,n,i);else a.on(o,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;t.off(e).off(e);this.bindings=b(this.bindings.not(t).get());this.focusable=b(this.focusable.not(t).get());this.hoverable=b(this.hoverable.not(t).get())},_delay:function(t,e){function i(){return(typeof t==="string"?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t);this._on(t,{mouseenter:function(t){this._addClass(b(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(b(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t);this._on(t,{focusin:function(t){this._addClass(b(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(b(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,o;var n=this.options[t];i=i||{};e=b.Event(e);e.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase();e.target=this.element[0];o=e.originalEvent;if(o)for(s in o)if(!(s in e))e[s]=o[s];this.element.trigger(e,i);return!(b.isFunction(n)&&n.apply(this.element[0],[e].concat(i))===false||e.isDefaultPrevented())}},b.each({show:"fadeIn",hide:"fadeOut"},function(n,r){b.Widget.prototype["_"+n]=function(e,t,i){if(typeof t==="string")t={effect:t};var s;var o=!t?n:t===true||typeof t==="number"?r:t.effect||r;t=t||{};if(typeof t==="number")t={duration:t};s=!b.isEmptyObject(t);t.complete=i;if(t.delay)e.delay(t.delay);if(s&&b.effects&&b.effects.effect[o])e[n](t);else if(o!==n&&e[o])e[o](t.duration,t.easing,i);else e.queue(function(t){b(this)[n]();if(i)i.call(e[0]);t()})}});var e=b.widget,s=b.extend(b.expr[":"],{data:b.expr.createPseudo?b.expr.createPseudo(function(e){return function(t){return!!b.data(t,e)}}):function(t,e,i){return!!b.data(t,i[3])}}),o=b.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),n=b.fn.scrollParent=function(t){var e=this.css("position"),i=e==="absolute",s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var t=b(this);if(i&&t.css("position")==="static")return false;return s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return e==="fixed"||!o.length?b(this[0].ownerDocument||document):o},r=b.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),l=false;b(document).on("mouseup",function(){l=false});var h=b.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(true===b.data(t.target,e.widgetName+".preventClickEvent")){b.removeData(t.target,e.widgetName+".preventClickEvent");t.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate)this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(l)return;this._mouseMoved=false;this._mouseStarted&&this._mouseUp(t);this._mouseDownEvent=t;var e=this,i=t.which===1,s=typeof this.options.cancel==="string"&&t.target.nodeName?b(t.target).closest(this.options.cancel).length:false;if(!i||s||!this._mouseCapture(t))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==false;if(!this._mouseStarted){t.preventDefault();return true}}if(true===b.data(t.target,this.widgetName+".preventClickEvent"))b.removeData(t.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(t){return e._mouseMove(t)};this._mouseUpDelegate=function(t){return e._mouseUp(t)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);t.preventDefault();l=true;return true},_mouseMove:function(t){if(this._mouseMoved)if(b.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);else if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=true;else if(!this.ignoreMissingWhich)return this._mouseUp(t);if(t.which||t.button)this._mouseMoved=true;if(this._mouseStarted){this._mouseDrag(t);return t.preventDefault()}if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==false;this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)}return!this._mouseStarted},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(t.target===this._mouseDownEvent.target)b.data(t.target,this.widgetName+".preventClickEvent",true);this._mouseStop(t)}if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer}this.ignoreMissingWhich=false;l=false;t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}}),f=b.ui.plugin={add:function(t,e,i){var s,o=b.ui[t].prototype;for(s in i){o.plugins[s]=o.plugins[s]||[];o.plugins[s].push([e,i[s]])}},call:function(t,e,i,s){var o,n=t.plugins[e];if(!n)return;if(!s&&(!t.element[0].parentNode||t.element[0].parentNode.nodeType===11))return;for(o=0;o<n.length;o++)if(t.options[n[o][0]])n[o][1].apply(t.element,i)}},p=b.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}if(!i)i=e.body;if(!i.nodeName)i=e.body;return i},u=b.ui.safeBlur=function(t){if(t&&t.nodeName.toLowerCase()!=="body")b(t).trigger("blur")};b.widget("ui.draggable",b.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original")this._setPositionRelative();if(this.options.addClasses)this._addClass("ui-draggable");this._setHandleClassName();this._mouseInit()},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return}this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(t){var e=this.options;if(this.helper||e.disabled||b(t.target).closest(".ui-resizable-handle").length>0)return false;this.handle=this._getHandle(t);if(!this.handle)return false;this._blurActiveElement(t);this._blockFrames(e.iframeFix===true?"iframe":e.iframeFix);return true},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=b(this);return b("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(t){var e=b.ui.safeActiveElement(this.document[0]),i=b(t.target);if(i.closest(e).length)return;b.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;this.helper=this._createHelper(t);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if(b.ui.ddmanager)b.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return b(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(t);this.originalPosition=this.position=this._generatePosition(t,false);this.originalPageX=t.pageX;this.originalPageY=t.pageY;e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt);this._setContainment();if(this._trigger("start",t)===false){this._clear();return false}this._cacheHelperProportions();if(b.ui.ddmanager&&!e.dropBehaviour)b.ui.ddmanager.prepareOffsets(this,t);this._mouseDrag(t,true);if(b.ui.ddmanager)b.ui.ddmanager.dragStart(this,t);return true},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor)this.offset.parent=this._getParentOffset();this.position=this._generatePosition(t,true);this.positionAbs=this._convertPositionTo("absolute");if(!e){var i=this._uiHash();if(this._trigger("drag",t,i)===false){this._mouseUp(new b.Event("mouseup",t));return false}this.position=i.position}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(b.ui.ddmanager)b.ui.ddmanager.drag(this,t);return false},_mouseStop:function(t){var e=this,i=false;if(b.ui.ddmanager&&!this.options.dropBehaviour)i=b.ui.ddmanager.drop(this,t);if(this.dropped){i=this.dropped;this.dropped=false}if(this.options.revert==="invalid"&&!i||this.options.revert==="valid"&&i||this.options.revert===true||b.isFunction(this.options.revert)&&this.options.revert.call(this.element,i))b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(e._trigger("stop",t)!==false)e._clear()});else if(this._trigger("stop",t)!==false)this._clear();return false},_mouseUp:function(t){this._unblockFrames();if(b.ui.ddmanager)b.ui.ddmanager.dragStop(this,t);if(this.handleElement.is(t.target))this.element.trigger("focus");return b.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){if(this.helper.is(".ui-draggable-dragging"))this._mouseUp(new b.Event("mouseup",{target:this.element[0]}));else this._clear();return this},_getHandle:function(t){return this.options.handle?!!b(t.target).closest(this.element.find(this.options.handle)).length:true},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i=b.isFunction(e.helper),s=i?b(e.helper.apply(this.element[0],[t])):e.helper==="clone"?this.element.clone().removeAttr("id"):this.element;if(!s.parents("body").length)s.appendTo(e.appendTo==="parent"?this.element[0].parentNode:e.appendTo);if(i&&s[0]===this.element[0])this._setPositionRelative();if(s[0]!==this.element[0]&&!/(fixed|absolute)/.test(s.css("position")))s.css("position","absolute");return s},_setPositionRelative:function(){if(!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative"},_adjustOffsetFromHelper:function(t){if(typeof t==="string")t=t.split(" ");if(b.isArray(t))t={left:+t[0],top:+t[1]||0};if("left"in t)this.offset.click.left=t.left+this.margins.left;if("right"in t)this.offset.click.left=this.helperProportions.width-t.right+this.margins.left;if("top"in t)this.offset.click.top=t.top+this.margins.top;if("bottom"in t)this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==e&&b.contains(this.scrollParent[0],this.offsetParent[0])){t.left+=this.scrollParent.scrollLeft();t.top+=this.scrollParent.scrollTop()}if(this._isRootNode(this.offsetParent[0]))t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative")return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(!e?this.scrollParent.scrollTop():0),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(!e?this.scrollParent.scrollLeft():0)}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i,s=this.options,o=this.document[0];this.relativeContainer=null;if(!s.containment){this.containment=null;return}if(s.containment==="window"){this.containment=[b(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,b(window).scrollLeft()+b(window).width()-this.helperProportions.width-this.margins.left,b(window).scrollTop()+(b(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(s.containment==="document"){this.containment=[0,0,b(o).width()-this.helperProportions.width-this.margins.left,(b(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(s.containment.constructor===Array){this.containment=s.containment;return}if(s.containment==="parent")s.containment=this.helper[0].parentNode;e=b(s.containment);i=e[0];if(!i)return;t=/(scroll|auto)/.test(e.css("overflow"));this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=e},_convertPositionTo:function(t,e){if(!e)e=this.position;var i=t==="absolute"?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-(this.cssPosition==="fixed"?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-(this.cssPosition==="fixed"?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,o,n,r=this.options,a=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;if(!a||!this.offset.scroll)this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()};if(e){if(this.containment){if(this.relativeContainer){s=this.relativeContainer.offset();i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]}else i=this.containment;if(t.pageX-this.offset.click.left<i[0])l=i[0]+this.offset.click.left;if(t.pageY-this.offset.click.top<i[1])h=i[1]+this.offset.click.top;if(t.pageX-this.offset.click.left>i[2])l=i[2]+this.offset.click.left;if(t.pageY-this.offset.click.top>i[3])h=i[3]+this.offset.click.top}if(r.grid){o=r.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY;h=i?o-this.offset.click.top>=i[1]||o-this.offset.click.top>i[3]?o:o-this.offset.click.top>=i[1]?o-r.grid[1]:o+r.grid[1]:o;n=r.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX;l=i?n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2]?n:n-this.offset.click.left>=i[0]?n-r.grid[0]:n+r.grid[0]:n}if(r.axis==="y")l=this.originalPageX;if(r.axis==="x")h=this.originalPageY}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval)this.helper.remove();this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear)this.destroy()},_trigger:function(t,e,i){i=i||this._uiHash();b.ui.plugin.call(this,t,[e,i,this],true);if(/^(drag|start|stop)/.test(t)){this.positionAbs=this._convertPositionTo("absolute");i.offset=this.positionAbs}return b.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),b.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=b.extend({},t,{item:i.element});i.sortables=[];b(i.options.connectToSortable).each(function(){var t=b(this).sortable("instance");if(t&&!t.options.disabled){i.sortables.push(t);t.refreshPositions();t._trigger("activate",e,s)}})},stop:function(e,t,i){var s=b.extend({},t,{item:i.element});i.cancelHelperRemoval=false;b.each(i.sortables,function(){var t=this;if(t.isOver){t.isOver=0;i.cancelHelperRemoval=true;t.cancelHelperRemoval=false;t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")};t._mouseStop(e);t.options.helper=t.options._helper}else{t.cancelHelperRemoval=true;t._trigger("deactivate",e,s)}})},drag:function(i,s,o){b.each(o.sortables,function(){var t=false,e=this;e.positionAbs=o.positionAbs;e.helperProportions=o.helperProportions;e.offset.click=o.offset.click;if(e._intersectsWith(e.containerCache)){t=true;b.each(o.sortables,function(){this.positionAbs=o.positionAbs;this.helperProportions=o.helperProportions;this.offset.click=o.offset.click;if(this!==e&&this._intersectsWith(this.containerCache)&&b.contains(e.element[0],this.element[0]))t=false;return t})}if(t){if(!e.isOver){e.isOver=1;o._parent=s.helper.parent();e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",true);e.options._helper=e.options.helper;e.options.helper=function(){return s.helper[0]};i.target=e.currentItem[0];e._mouseCapture(i,true);e._mouseStart(i,true,true);e.offset.click.top=o.offset.click.top;e.offset.click.left=o.offset.click.left;e.offset.parent.left-=o.offset.parent.left-e.offset.parent.left;e.offset.parent.top-=o.offset.parent.top-e.offset.parent.top;o._trigger("toSortable",i);o.dropped=e.element;b.each(o.sortables,function(){this.refreshPositions()});o.currentItem=o.element;e.fromOutside=o}if(e.currentItem){e._mouseDrag(i);s.position=e.position}}else if(e.isOver){e.isOver=0;e.cancelHelperRemoval=true;e.options._revert=e.options.revert;e.options.revert=false;e._trigger("out",i,e._uiHash(e));e._mouseStop(i,true);e.options.revert=e.options._revert;e.options.helper=e.options._helper;if(e.placeholder)e.placeholder.remove();s.helper.appendTo(o._parent);o._refreshOffsets(i);s.position=o._generatePosition(i,true);o._trigger("fromSortable",i);o.dropped=false;b.each(o.sortables,function(){this.refreshPositions()})}})}}),b.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=b("body"),o=i.options;if(s.css("cursor"))o._cursor=s.css("cursor");s.css("cursor",o.cursor)},stop:function(t,e,i){var s=i.options;if(s._cursor)b("body").css("cursor",s._cursor)}}),b.ui.plugin.add("draggable","opacity",{start:function(t,e,i){var s=b(e.helper),o=i.options;if(s.css("opacity"))o._opacity=s.css("opacity");s.css("opacity",o.opacity)},stop:function(t,e,i){var s=i.options;if(s._opacity)b(e.helper).css("opacity",s._opacity)}}),b.ui.plugin.add("draggable","scroll",{start:function(t,e,i){if(!i.scrollParentNotHidden)i.scrollParentNotHidden=i.helper.scrollParent(false);if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML")i.overflowOffset=i.scrollParentNotHidden.offset()},drag:function(t,e,i){var s=i.options,o=false,n=i.scrollParentNotHidden[0],r=i.document[0];if(n!==r&&n.tagName!=="HTML"){if(!s.axis||s.axis!=="x")if(i.overflowOffset.top+n.offsetHeight-t.pageY<s.scrollSensitivity)n.scrollTop=o=n.scrollTop+s.scrollSpeed;else if(t.pageY-i.overflowOffset.top<s.scrollSensitivity)n.scrollTop=o=n.scrollTop-s.scrollSpeed;if(!s.axis||s.axis!=="y")if(i.overflowOffset.left+n.offsetWidth-t.pageX<s.scrollSensitivity)n.scrollLeft=o=n.scrollLeft+s.scrollSpeed;else if(t.pageX-i.overflowOffset.left<s.scrollSensitivity)n.scrollLeft=o=n.scrollLeft-s.scrollSpeed}else{if(!s.axis||s.axis!=="x")if(t.pageY-b(r).scrollTop()<s.scrollSensitivity)o=b(r).scrollTop(b(r).scrollTop()-s.scrollSpeed);else if(b(window).height()-(t.pageY-b(r).scrollTop())<s.scrollSensitivity)o=b(r).scrollTop(b(r).scrollTop()+s.scrollSpeed);if(!s.axis||s.axis!=="y")if(t.pageX-b(r).scrollLeft()<s.scrollSensitivity)o=b(r).scrollLeft(b(r).scrollLeft()-s.scrollSpeed);else if(b(window).width()-(t.pageX-b(r).scrollLeft())<s.scrollSensitivity)o=b(r).scrollLeft(b(r).scrollLeft()+s.scrollSpeed)}if(o!==false&&b.ui.ddmanager&&!s.dropBehaviour)b.ui.ddmanager.prepareOffsets(i,t)}}),b.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[];b(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=b(this),e=t.offset();if(this!==i.element[0])i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){var s,o,n,r,a,l,h,f,p,u,c=i.options,d=c.snapTolerance,g=e.offset.left,m=g+i.helperProportions.width,v=e.offset.top,_=v+i.helperProportions.height;for(p=i.snapElements.length-1;p>=0;p--){a=i.snapElements[p].left-i.margins.left;l=a+i.snapElements[p].width;h=i.snapElements[p].top-i.margins.top;f=h+i.snapElements[p].height;if(m<a-d||g>l+d||_<h-d||v>f+d||!b.contains(i.snapElements[p].item.ownerDocument,i.snapElements[p].item)){if(i.snapElements[p].snapping)i.options.snap.release&&i.options.snap.release.call(i.element,t,b.extend(i._uiHash(),{snapItem:i.snapElements[p].item}));i.snapElements[p].snapping=false;continue}if(c.snapMode!=="inner"){s=Math.abs(h-_)<=d;o=Math.abs(f-v)<=d;n=Math.abs(a-m)<=d;r=Math.abs(l-g)<=d;if(s)e.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top;if(o)e.position.top=i._convertPositionTo("relative",{top:f,left:0}).top;if(n)e.position.left=i._convertPositionTo("relative",{top:0,left:a-i.helperProportions.width}).left;if(r)e.position.left=i._convertPositionTo("relative",{top:0,left:l}).left}u=s||o||n||r;if(c.snapMode!=="outer"){s=Math.abs(h-v)<=d;o=Math.abs(f-_)<=d;n=Math.abs(a-g)<=d;r=Math.abs(l-m)<=d;if(s)e.position.top=i._convertPositionTo("relative",{top:h,left:0}).top;if(o)e.position.top=i._convertPositionTo("relative",{top:f-i.helperProportions.height,left:0}).top;if(n)e.position.left=i._convertPositionTo("relative",{top:0,left:a}).left;if(r)e.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left}if(!i.snapElements[p].snapping&&(s||o||n||r||u))i.options.snap.snap&&i.options.snap.snap.call(i.element,t,b.extend(i._uiHash(),{snapItem:i.snapElements[p].item}));i.snapElements[p].snapping=s||o||n||r||u}}}),b.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,o=i.options,n=b.makeArray(b(o.stack)).sort(function(t,e){return(parseInt(b(t).css("zIndex"),10)||0)-(parseInt(b(e).css("zIndex"),10)||0)});if(!n.length)return;s=parseInt(b(n[0]).css("zIndex"),10)||0;b(n).each(function(t){b(this).css("zIndex",s+t)});this.css("zIndex",s+n.length)}}),b.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){var s=b(e.helper),o=i.options;if(s.css("zIndex"))o._zIndex=s.css("zIndex");s.css("zIndex",o.zIndex)},stop:function(t,e,i){var s=i.options;if(s._zIndex)b(e.helper).css("zIndex",s._zIndex)}});var c=b.ui.draggable;b.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:true,greedy:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=false;this.isout=true;this.accept=b.isFunction(i)?i:function(t){return t.is(i)};this.proportions=function(){if(arguments.length)t=arguments[0];else return t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}};this._addToManager(e.scope);e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){b.ui.ddmanager.droppables[t]=b.ui.ddmanager.droppables[t]||[];b.ui.ddmanager.droppables[t].push(this)},_splice:function(t){var e=0;for(;e<t.length;e++)if(t[e]===this)t.splice(e,1)},_destroy:function(){var t=b.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){if(t==="accept")this.accept=b.isFunction(e)?e:function(t){return t.is(e)};else if(t==="scope"){var i=b.ui.ddmanager.droppables[this.options.scope];this._splice(i);this._addToManager(e)}this._super(t,e)},_activate:function(t){var e=b.ui.ddmanager.current;this._addActiveClass();if(e)this._trigger("activate",t,this.ui(e))},_deactivate:function(t){var e=b.ui.ddmanager.current;this._removeActiveClass();if(e)this._trigger("deactivate",t,this.ui(e))},_over:function(t){var e=b.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]===this.element[0])return;if(this.accept.call(this.element[0],e.currentItem||e.element)){this._addHoverClass();this._trigger("over",t,this.ui(e))}},_out:function(t){var e=b.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]===this.element[0])return;if(this.accept.call(this.element[0],e.currentItem||e.element)){this._removeHoverClass();this._trigger("out",t,this.ui(e))}},_drop:function(e,t){var i=t||b.ui.ddmanager.current,s=false;if(!i||(i.currentItem||i.element)[0]===this.element[0])return false;this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=b(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&d(i,b.extend(t,{offset:t.element.offset()}),t.options.tolerance,e)){s=true;return false}});if(s)return false;if(this.accept.call(this.element[0],i.currentItem||i.element)){this._removeActiveClass();this._removeHoverClass();this._trigger("drop",e,this.ui(i));return this.element}return false},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var d=b.ui.intersect=function(){function u(t,e,i){return t>=e&&t<e+i}return function(t,e,i,s){if(!e.offset)return false;var o=(t.positionAbs||t.position.absolute).left+t.margins.left,n=(t.positionAbs||t.position.absolute).top+t.margins.top,r=o+t.helperProportions.width,a=n+t.helperProportions.height,l=e.offset.left,h=e.offset.top,f=l+e.proportions().width,p=h+e.proportions().height;switch(i){case"fit":return l<=o&&r<=f&&h<=n&&a<=p;case"intersect":return l<o+t.helperProportions.width/2&&r-t.helperProportions.width/2<f&&h<n+t.helperProportions.height/2&&a-t.helperProportions.height/2<p;case"pointer":return u(s.pageY,h,e.proportions().height)&&u(s.pageX,l,e.proportions().width);case"touch":return(n>=h&&n<=p||a>=h&&a<=p||n<h&&a>p)&&(o>=l&&o<=f||r>=l&&r<=f||o<l&&r>f);default:return false}}}();if(b.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,o=b.ui.ddmanager.droppables[t.options.scope]||[],n=e?e.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<o.length;i++){if(o[i].options.disabled||t&&!o[i].accept.call(o[i].element[0],t.currentItem||t.element))continue;for(s=0;s<r.length;s++)if(r[s]===o[i].element[0]){o[i].proportions().height=0;continue t}o[i].visible=o[i].element.css("display")!=="none";if(!o[i].visible)continue;if(n==="mousedown")o[i]._activate.call(o[i],e);o[i].offset=o[i].element.offset();o[i].proportions({width:o[i].element[0].offsetWidth,height:o[i].element[0].offsetHeight})}},drop:function(t,e){var i=false;b.each((b.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){if(!this.options)return;if(!this.options.disabled&&this.visible&&d(t,this,this.options.tolerance,e))i=this._drop.call(this,e)||i;if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)){this.isout=true;this.isover=false;this._deactivate.call(this,e)}});return i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){if(!t.options.refreshPositions)b.ui.ddmanager.prepareOffsets(t,e)})},drag:function(n,r){if(n.options.refreshPositions)b.ui.ddmanager.prepareOffsets(n,r);b.each(b.ui.ddmanager.droppables[n.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var t,e,i,s=d(n,this,this.options.tolerance,r),o=!s&&this.isover?"isout":s&&!this.isover?"isover":null;if(!o)return;if(this.options.greedy){e=this.options.scope;i=this.element.parents(":data(ui-droppable)").filter(function(){return b(this).droppable("instance").options.scope===e});if(i.length){t=b(i[0]).droppable("instance");t.greedyChild=o==="isover"}}if(t&&o==="isover"){t.isover=false;t.isout=true;t._out.call(t,r)}this[o]=true;this[o==="isout"?"isover":"isout"]=false;this[o==="isover"?"_over":"_out"].call(this,r);if(t&&o==="isout"){t.isout=false;t.isover=true;t._over.call(t,r)}})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable");if(!t.options.refreshPositions)b.ui.ddmanager.prepareOffsets(t,e)}},b.uiBackCompat!==false)b.widget("ui.droppable",b.ui.droppable,{options:{hoverClass:false,activeClass:false},_addActiveClass:function(){this._super();if(this.options.activeClass)this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super();if(this.options.activeClass)this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super();if(this.options.hoverClass)this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super();if(this.options.hoverClass)this.element.removeClass(this.options.hoverClass)}});var g=b.ui.droppable;b.widget("ui.resizable",b.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if(b(t).css("overflow")==="hidden")return false;var i=e&&e==="left"?"scrollLeft":"scrollTop",s=false;if(t[i]>0)return true;t[i]=1;s=t[i]>0;t[i]=0;return s},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable");b.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap(b("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=true;t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")};this.element.css(t);this.originalElement.css("margin",0);this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css(t);this._proportionallyResize()}this._setupHandles();if(e.autoHide)b(this.element).on("mouseenter",function(){if(e.disabled)return;i._removeClass("ui-resizable-autohide");i._handles.show()}).on("mouseleave",function(){if(e.disabled)return;if(!i.resizing){i._addClass("ui-resizable-autohide");i._handles.hide()}});this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,e=function(t){b(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);t=this.element;this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t);t.remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_setOption:function(t,e){this._super(t,e);switch(t){case"handles":this._removeHandles();this._setupHandles();break;default:break}},_setupHandles:function(){var t=this.options,e,i,s,o,n,r=this;this.handles=t.handles||(!b(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});this._handles=b();if(this.handles.constructor===String){if(this.handles==="all")this.handles="n,e,s,w,se,sw,ne,nw";s=this.handles.split(",");this.handles={};for(i=0;i<s.length;i++){e=b.trim(s[i]);o="ui-resizable-"+e;n=b("<div>");this._addClass(n,"ui-resizable-handle "+o);n.css({zIndex:t.zIndex});this.handles[e]=".ui-resizable-"+e;this.element.append(n)}}this._renderAxis=function(t){var e,i,s,o;t=t||this.element;for(e in this.handles){if(this.handles[e].constructor===String)this.handles[e]=this.element.children(this.handles[e]).first().show();else if(this.handles[e].jquery||this.handles[e].nodeType){this.handles[e]=b(this.handles[e]);this._on(this.handles[e],{mousedown:r._mouseDown})}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){i=b(this.handles[e],this.element);o=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth();s=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join("");t.css(s,o);this._proportionallyResize()}this._handles=this._handles.add(this.handles[e])}};this._renderAxis(this.element);this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));this._handles.disableSelection();this._handles.on("mouseover",function(){if(!r.resizing){if(this.className)n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);r.axis=n&&n[1]?n[1]:"se"}});if(t.autoHide){this._handles.hide();this._addClass("ui-resizable-autohide")}},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var e,i,s=false;for(e in this.handles){i=b(this.handles[e])[0];if(i===t.target||b.contains(i,t.target))s=true}return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s,o=this.options,n=this.element;this.resizing=true;this._renderProxy();e=this._num(this.helper.css("left"));i=this._num(this.helper.css("top"));if(o.containment){e+=b(o.containment).scrollLeft()||0;i+=b(o.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:e,top:i};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()};this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()};this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()};this.originalPosition={left:e,top:i};this.originalMousePosition={left:t.pageX,top:t.pageY};this.aspectRatio=typeof o.aspectRatio==="number"?o.aspectRatio:this.originalSize.width/this.originalSize.height||1;s=b(".ui-resizable-"+this.axis).css("cursor");b("body").css("cursor",s==="auto"?this.axis+"-resize":s);this._addClass("ui-resizable-resizing");this._propagate("start",t);return true},_mouseDrag:function(t){var e,i,s=this.originalMousePosition,o=this.axis,n=t.pageX-s.left||0,r=t.pageY-s.top||0,a=this._change[o];this._updatePrevProperties();if(!a)return false;e=a.apply(this,[t,n,r]);this._updateVirtualBoundaries(t.shiftKey);if(this._aspectRatio||t.shiftKey)e=this._updateRatio(e,t);e=this._respectSize(e,t);this._updateCache(e);this._propagate("resize",t);i=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length)this._proportionallyResize();if(!b.isEmptyObject(i)){this._updatePrevProperties();this._trigger("resize",t,this.ui());this._applyChanges()}return false},_mouseStop:function(t){this.resizing=false;var e,i,s,o,n,r,a,l=this.options,h=this;if(this._helper){e=this._proportionallyResizeElements;i=e.length&&/textarea/i.test(e[0].nodeName);s=i&&this._hasScroll(e[0],"left")?0:h.sizeDiff.height;o=i?0:h.sizeDiff.width;n={width:h.helper.width()-o,height:h.helper.height()-s};r=parseFloat(h.element.css("left"))+(h.position.left-h.originalPosition.left)||null;a=parseFloat(h.element.css("top"))+(h.position.top-h.originalPosition.top)||null;if(!l.animate)this.element.css(b.extend(n,{top:a,left:r}));h.helper.height(h.size.height);h.helper.width(h.size.width);if(this._helper&&!l.animate)this._proportionallyResize()}b("body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",t);if(this._helper)this.helper.remove();return false},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};if(this.position.top!==this.prevPosition.top)t.top=this.position.top+"px";if(this.position.left!==this.prevPosition.left)t.left=this.position.left+"px";if(this.size.width!==this.prevSize.width)t.width=this.size.width+"px";if(this.size.height!==this.prevSize.height)t.height=this.size.height+"px";this.helper.css(t);return t},_updateVirtualBoundaries:function(t){var e,i,s,o,n,r=this.options;n={minWidth:this._isNumber(r.minWidth)?r.minWidth:0,maxWidth:this._isNumber(r.maxWidth)?r.maxWidth:Infinity,minHeight:this._isNumber(r.minHeight)?r.minHeight:0,maxHeight:this._isNumber(r.maxHeight)?r.maxHeight:Infinity};if(this._aspectRatio||t){e=n.minHeight*this.aspectRatio;s=n.minWidth/this.aspectRatio;i=n.maxHeight*this.aspectRatio;o=n.maxWidth/this.aspectRatio;if(e>n.minWidth)n.minWidth=e;if(s>n.minHeight)n.minHeight=s;if(i<n.maxWidth)n.maxWidth=i;if(o<n.maxHeight)n.maxHeight=o}this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset();if(this._isNumber(t.left))this.position.left=t.left;if(this._isNumber(t.top))this.position.top=t.top;if(this._isNumber(t.height))this.size.height=t.height;if(this._isNumber(t.width))this.size.width=t.width},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;if(this._isNumber(t.height))t.width=t.height*this.aspectRatio;else if(this._isNumber(t.width))t.height=t.width/this.aspectRatio;if(s==="sw"){t.left=e.left+(i.width-t.width);t.top=null}if(s==="nw"){t.top=e.top+(i.height-t.height);t.left=e.left+(i.width-t.width)}return t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,o=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,n=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,r=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),f=/nw|ne|n/.test(i);if(n)t.width=e.minWidth;if(r)t.height=e.minHeight;if(s)t.width=e.maxWidth;if(o)t.height=e.maxHeight;if(n&&h)t.left=a-e.minWidth;if(s&&h)t.left=a-e.maxWidth;if(r&&f)t.top=l-e.minHeight;if(o&&f)t.top=l-e.maxHeight;if(!t.width&&!t.height&&!t.left&&t.top)t.top=null;else if(!t.width&&!t.height&&!t.top&&t.left)t.left=null;return t},_getPaddingPlusBorderDimensions:function(t){var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],o=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];for(;e<4;e++){i[e]=parseFloat(s[e])||0;i[e]+=parseFloat(o[e])||0}return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length)return;var t,e=0,i=this.helper||this.element;for(;e<this._proportionallyResizeElements.length;e++){t=this._proportionallyResizeElements[e];if(!this.outerDimensions)this.outerDimensions=this._getPaddingPlusBorderDimensions(t);t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})}},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||b("<div style='overflow:hidden;'></div>");this._addClass(this.helper,this._helper);this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,o=this.originalPosition;return{top:o.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){b.ui.plugin.call(this,t,[e,this.ui()]);t!=="resize"&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),b.ui.plugin.add("resizable","animate",{stop:function(e){var i=b(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),n=o&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,a={width:i.size.width-r,height:i.size.height-n},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,h=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(b.extend(a,h&&l?{top:h,left:l}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};if(s&&s.length)b(s[0]).css({width:t.width,height:t.height});i._updateCache(t);i._propagate("resize",e)}})}}),b.ui.plugin.add("resizable","containment",{start:function(){var i,s,t,e,o,n,r,a=b(this).resizable("instance"),l=a.options,h=a.element,f=l.containment,p=f instanceof b?f.get(0):/parent/.test(f)?h.parent().get(0):f;if(!p)return;a.containerElement=b(p);if(/document/.test(f)||f===document){a.containerOffset={left:0,top:0};a.containerPosition={left:0,top:0};a.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}}else{i=b(p);s=[];b(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=a._num(i.css("padding"+e))});a.containerOffset=i.offset();a.containerPosition=i.position();a.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]};t=a.containerOffset;e=a.containerSize.height;o=a.containerSize.width;n=a._hasScroll(p,"left")?p.scrollWidth:o;r=a._hasScroll(p)?p.scrollHeight:e;a.parentData={element:p,left:t.left,top:t.top,width:n,height:r}}},resize:function(t){var e,i,s,o,n=b(this).resizable("instance"),r=n.options,a=n.containerOffset,l=n.position,h=n._aspectRatio||t.shiftKey,f={top:0,left:0},p=n.containerElement,u=true;if(p[0]!==document&&/static/.test(p.css("position")))f=a;if(l.left<(n._helper?a.left:0)){n.size.width=n.size.width+(n._helper?n.position.left-a.left:n.position.left-f.left);if(h){n.size.height=n.size.width/n.aspectRatio;u=false}n.position.left=r.helper?a.left:0}if(l.top<(n._helper?a.top:0)){n.size.height=n.size.height+(n._helper?n.position.top-a.top:n.position.top);if(h){n.size.width=n.size.height*n.aspectRatio;u=false}n.position.top=n._helper?a.top:0}s=n.containerElement.get(0)===n.element.parent().get(0);o=/relative|absolute/.test(n.containerElement.css("position"));if(s&&o){n.offset.left=n.parentData.left+n.position.left;n.offset.top=n.parentData.top+n.position.top}else{n.offset.left=n.element.offset().left;n.offset.top=n.element.offset().top}e=Math.abs(n.sizeDiff.width+(n._helper?n.offset.left-f.left:n.offset.left-a.left));i=Math.abs(n.sizeDiff.height+(n._helper?n.offset.top-f.top:n.offset.top-a.top));if(e+n.size.width>=n.parentData.width){n.size.width=n.parentData.width-e;if(h){n.size.height=n.size.width/n.aspectRatio;u=false}}if(i+n.size.height>=n.parentData.height){n.size.height=n.parentData.height-i;if(h){n.size.width=n.size.height*n.aspectRatio;u=false}}if(!u){n.position.left=n.prevPosition.left;n.position.top=n.prevPosition.top;n.size.width=n.prevSize.width;n.size.height=n.prevSize.height}},stop:function(){var t=b(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,o=t.containerElement,n=b(t.helper),r=n.offset(),a=n.outerWidth()-t.sizeDiff.width,l=n.outerHeight()-t.sizeDiff.height;if(t._helper&&!e.animate&&/relative/.test(o.css("position")))b(this).css({left:r.left-s.left-i.left,width:a,height:l});if(t._helper&&!e.animate&&/static/.test(o.css("position")))b(this).css({left:r.left-s.left-i.left,width:a,height:l})}}),b.ui.plugin.add("resizable","alsoResize",{start:function(){var t=b(this).resizable("instance"),e=t.options;b(e.alsoResize).each(function(){var t=b(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=b(this).resizable("instance"),s=e.options,o=e.originalSize,n=e.originalPosition,r={height:e.size.height-o.height||0,width:e.size.width-o.width||0,top:e.position.top-n.top||0,left:e.position.left-n.left||0};b(s.alsoResize).each(function(){var t=b(this),s=b(this).data("ui-resizable-alsoresize"),o={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];b.each(e,function(t,e){var i=(s[e]||0)+(r[e]||0);if(i&&i>=0)o[e]=i||null});t.css(o)})},stop:function(){b(this).removeData("ui-resizable-alsoresize")}}),b.ui.plugin.add("resizable","ghost",{start:function(){var t=b(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone();t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0});t._addClass(t.ghost,"ui-resizable-ghost");if(b.uiBackCompat!==false&&typeof t.options.ghost==="string")t.ghost.addClass(this.options.ghost);t.ghost.appendTo(t.helper)},resize:function(){var t=b(this).resizable("instance");if(t.ghost)t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=b(this).resizable("instance");if(t.ghost&&t.helper)t.helper.get(0).removeChild(t.ghost.get(0))}}),b.ui.plugin.add("resizable","grid",{resize:function(){var t,e=b(this).resizable("instance"),i=e.options,s=e.size,o=e.originalSize,n=e.originalPosition,r=e.axis,a=typeof i.grid==="number"?[i.grid,i.grid]:i.grid,l=a[0]||1,h=a[1]||1,f=Math.round((s.width-o.width)/l)*l,p=Math.round((s.height-o.height)/h)*h,u=o.width+f,c=o.height+p,d=i.maxWidth&&i.maxWidth<u,g=i.maxHeight&&i.maxHeight<c,m=i.minWidth&&i.minWidth>u,v=i.minHeight&&i.minHeight>c;i.grid=a;if(m)u+=l;if(v)c+=h;if(d)u-=l;if(g)c-=h;if(/^(se|s|e)$/.test(r)){e.size.width=u;e.size.height=c}else if(/^(ne)$/.test(r)){e.size.width=u;e.size.height=c;e.position.top=n.top-p}else if(/^(sw)$/.test(r)){e.size.width=u;e.size.height=c;e.position.left=n.left-f}else{if(c-h<=0||u-l<=0)t=e._getPaddingPlusBorderDimensions(this);if(c-h>0){e.size.height=c;e.position.top=n.top-p}else{c=h-t.height;e.size.height=c;e.position.top=n.top+o.height-c}if(u-l>0){e.size.width=u;e.position.left=n.left-f}else{u=l-t.width;e.size.width=u;e.position.left=n.left+o.width-u}}}});var m=b.ui.resizable}(jQuery); | ||
!function(b){b.ui=b.ui||{},b.ui.version="1.12.1";var i=0,a=Array.prototype.slice;b.cleanData=function(o){return function(t){for(var e,i,s=0;null!=(i=t[s]);s++)try{(e=b._data(i,"events"))&&e.remove&&b(i).triggerHandler("remove")}catch(t){}o(t)}}(b.cleanData),b.widget=function(t,i,e){var s,o,n,r={},a=t.split(".")[0],h=a+"-"+(t=t.split(".")[1]);return e||(e=i,i=b.Widget),b.isArray(e)&&(e=b.extend.apply(null,[{}].concat(e))),b.expr[":"][h.toLowerCase()]=function(t){return!!b.data(t,h)},b[a]=b[a]||{},s=b[a][t],o=b[a][t]=function(t,e){if(!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},b.extend(o,s,{version:e.version,_proto:b.extend({},e),_childConstructors:[]}),(n=new i).options=b.widget.extend({},n.options),b.each(e,function(e,s){function o(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}b.isFunction(s)?r[e]=function(){var t,e=this._super,i=this._superApply;return this._super=o,this._superApply=n,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:r[e]=s}),o.prototype=b.widget.extend(n,{widgetEventPrefix:s&&n.widgetEventPrefix||t},r,{constructor:o,namespace:a,widgetName:t,widgetFullName:h}),s?(b.each(s._childConstructors,function(t,e){var i=e.prototype;b.widget(i.namespace+"."+i.widgetName,o,e._proto)}),delete s._childConstructors):i._childConstructors.push(o),b.widget.bridge(t,o),o},b.widget.extend=function(t){for(var e,i,s=a.call(arguments,1),o=0,n=s.length;o<n;o++)for(e in s[o])i=s[o][e],s[o].hasOwnProperty(e)&&void 0!==i&&(b.isPlainObject(i)?t[e]=b.isPlainObject(t[e])?b.widget.extend({},t[e],i):b.widget.extend({},i):t[e]=i);return t},b.widget.bridge=function(n,e){var r=e.prototype.widgetFullName||n;b.fn[n]=function(i){var t="string"==typeof i,s=a.call(arguments,1),o=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=b.data(this,r);return"instance"===i?(o=e,!1):e?b.isFunction(e[i])&&"_"!==i.charAt(0)?(t=e[i].apply(e,s))!==e&&void 0!==t?(o=t&&t.jquery?o.pushStack(t.get()):t,!1):void 0:b.error("no such method '"+i+"' for "+n+" widget instance"):b.error("cannot call methods on "+n+" prior to initialization; attempted to call method '"+i+"'")}):o=void 0:(s.length&&(i=b.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=b.data(this,r);t?(t.option(i||{}),t._init&&t._init()):b.data(this,r,new e(i,this))})),o}},b.Widget=function(){},b.Widget._childConstructors=[],b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=b(e||this.defaultElement||this)[0],this.element=b(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=b(),this.hoverable=b(),this.focusable=b(),this.classesElementLookup={},e!==this&&(b.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=b(e.style?e.ownerDocument:e.document||e),this.window=b(this.document[0].defaultView||this.document[0].parentWindow)),this.options=b.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:b.noop,_create:b.noop,_init:b.noop,destroy:function(){var i=this;this._destroy(),b.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:b.noop,widget:function(){return this.element},option:function(t,e){var i,s,o,n=t;if(0===arguments.length)return b.widget.extend({},this.options);if("string"==typeof t)if(n={},t=(i=t.split(".")).shift(),i.length){for(s=n[t]=b.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)s[i[o]]=s[i[o]]||{},s=s[i[o]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];n[t]=e}return this._setOptions(n),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=b(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(o){var n=[],r=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=r.classesElementLookup[t[s]]||b(),i=o.add?b(b.unique(i.get().concat(o.element.get()))):b(i.not(o.element).get()),r.classesElementLookup[t[s]]=i,n.push(t[s]),e&&o.classes[t[s]]&&n.push(o.classes[t[s]])}return o=b.extend({element:this.element,classes:this.options.classes||{}},o),this._on(o.element,{remove:"_untrackClassesElement"}),o.keys&&t(o.keys.match(/\S+/g)||[],!0),o.extra&&t(o.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(i){var s=this;b.each(s.classesElementLookup,function(t,e){-1!==b.inArray(i.target,e)&&(s.classesElementLookup[t]=b(e.not(i.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var o="string"==typeof t||null===t,t={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:s};return t.element.toggleClass(this._classes(t),s),this},_on:function(o,n,t){var r,a=this;"boolean"!=typeof o&&(t=n,n=o,o=!1),t?(n=r=b(n),this.bindings=this.bindings.add(n)):(t=n,n=this.element,r=this.widget()),b.each(t,function(t,e){function i(){if(o||!0!==a.options.disabled&&!b(this).hasClass("ui-state-disabled"))return("string"==typeof e?a[e]:e).apply(a,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||b.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),t=s[1]+a.eventNamespace,s=s[2];s?r.on(t,s,i):n.on(t,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e).off(e),this.bindings=b(this.bindings.not(t).get()),this.focusable=b(this.focusable.not(t).get()),this.hoverable=b(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(b(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(b(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(b(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(b(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,o,n=this.options[t];if(i=i||{},(e=b.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],o=e.originalEvent)for(s in o)s in e||(e[s]=o[s]);return this.element.trigger(e,i),!(b.isFunction(n)&&!1===n.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},b.each({show:"fadeIn",hide:"fadeOut"},function(n,r){b.Widget.prototype["_"+n]=function(e,t,i){var s;"string"==typeof t&&(t={effect:t});var o=t?!0!==t&&"number"!=typeof t&&t.effect||r:n;"number"==typeof(t=t||{})&&(t={duration:t}),s=!b.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&b.effects&&b.effects.effect[o]?e[n](t):o!==n&&e[o]?e[o](t.duration,t.easing,i):e.queue(function(t){b(this)[n](),i&&i.call(e[0]),t()})}}),b.widget,b.extend(b.expr[":"],{data:b.expr.createPseudo?b.expr.createPseudo(function(e){return function(t){return!!b.data(t,e)}}):function(t,e,i){return!!b.data(t,i[3])}}),b.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),b.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=b(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:b(this[0].ownerDocument||document)},b.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var o=!1;b(document).on("mouseup",function(){o=!1}),b.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===b.data(t.target,e.widgetName+".preventClickEvent"))return b.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!o){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&b(t.target).closest(this.options.cancel).length;return i&&!s&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===b.data(t.target,this.widgetName+".preventClickEvent")&&b.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),o=!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(b.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&b.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,o=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),b.ui.plugin={add:function(t,e,i){var s,o=b.ui[t].prototype;for(s in i)o.plugins[s]=o.plugins[s]||[],o.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var o,n=t.plugins[e];if(n&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o<n.length;o++)t.options[n[o][0]]&&n[o][1].apply(t.element,i)}},b.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return(i=i||e.body).nodeName||(i=e.body),i},b.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&b(t).trigger("blur")},b.widget("ui.draggable",b.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<b(t.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=b(this);return b("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=b.ui.safeActiveElement(this.document[0]);b(t.target).closest(e).length||b.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),b.ui.ddmanager&&(b.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===b(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),b.ui.ddmanager&&!e.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),b.ui.ddmanager&&b.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){e=this._uiHash();if(!1===this._trigger("drag",t,e))return this._mouseUp(new b.Event("mouseup",t)),!1;this.position=e.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",b.ui.ddmanager&&b.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,i=!1;return b.ui.ddmanager&&!this.options.dropBehaviour&&(i=b.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||b.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),b.ui.ddmanager&&b.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),b.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new b.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!b(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i=b.isFunction(e.helper),t=i?b(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return t.parents("body").length||t.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),i&&t[0]===this.element[0]&&this._setPositionRelative(),t[0]===this.element[0]||/(fixed|absolute)/.test(t.css("position"))||t.css("position","absolute"),t},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),b.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&b.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i,s=this.options,o=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(i=(e=b(s.containment))[0])&&(t=/(scroll|auto)/.test(e.css("overflow")),this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=e)):this.containment=s.containment:this.containment=[0,0,b(o).width()-this.helperProportions.width-this.margins.left,(b(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[b(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,b(window).scrollLeft()+b(window).width()-this.helperProportions.width-this.margins.left,b(window).scrollTop()+(b(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,t=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:t?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:t?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s=this.options,o=this._isRootNode(this.scrollParent[0]),n=t.pageX,r=t.pageY;return o&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(i=this.relativeContainer?(i=this.relativeContainer.offset(),[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):this.containment,t.pageX-this.offset.click.left<i[0]&&(n=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(r=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(n=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(r=i[3]+this.offset.click.top)),s.grid&&(t=s.grid[1]?this.originalPageY+Math.round((r-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,r=!i||t-this.offset.click.top>=i[1]||t-this.offset.click.top>i[3]?t:t-this.offset.click.top>=i[1]?t-s.grid[1]:t+s.grid[1],t=s.grid[0]?this.originalPageX+Math.round((n-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,n=!i||t-this.offset.click.left>=i[0]||t-this.offset.click.left>i[2]?t:t-this.offset.click.left>=i[0]?t-s.grid[0]:t+s.grid[0]),"y"===s.axis&&(n=this.originalPageX),"x"===s.axis&&(r=this.originalPageY)),{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:o?0:this.offset.scroll.top),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:o?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),b.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),b.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),b.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=b.extend({},t,{item:i.element});i.sortables=[],b(i.options.connectToSortable).each(function(){var t=b(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=b.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,b.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,o){b.each(o.sortables,function(){var t=!1,e=this;e.positionAbs=o.positionAbs,e.helperProportions=o.helperProportions,e.offset.click=o.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,b.each(o.sortables,function(){return this.positionAbs=o.positionAbs,this.helperProportions=o.helperProportions,this.offset.click=o.offset.click,this!==e&&this._intersectsWith(this.containerCache)&&b.contains(e.element[0],this.element[0])&&(t=!1),t})),t?(e.isOver||(e.isOver=1,o._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=o.offset.click.top,e.offset.click.left=o.offset.click.left,e.offset.parent.left-=o.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=o.offset.parent.top-e.offset.parent.top,o._trigger("toSortable",i),o.dropped=e.element,b.each(o.sortables,function(){this.refreshPositions()}),o.currentItem=o.element,e.fromOutside=o),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(o._parent),o._refreshOffsets(i),s.position=o._generatePosition(i,!0),o._trigger("fromSortable",i),o.dropped=!1,b.each(o.sortables,function(){this.refreshPositions()}))})}}),b.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=b("body"),i=i.options;s.css("cursor")&&(i._cursor=s.css("cursor")),s.css("cursor",i.cursor)},stop:function(t,e,i){i=i.options;i._cursor&&b("body").css("cursor",i._cursor)}}),b.ui.plugin.add("draggable","opacity",{start:function(t,e,i){e=b(e.helper),i=i.options;e.css("opacity")&&(i._opacity=e.css("opacity")),e.css("opacity",i.opacity)},stop:function(t,e,i){i=i.options;i._opacity&&b(e.helper).css("opacity",i._opacity)}}),b.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,o=!1,n=i.scrollParentNotHidden[0],r=i.document[0];n!==r&&"HTML"!==n.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+n.offsetHeight-t.pageY<s.scrollSensitivity?n.scrollTop=o=n.scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(n.scrollTop=o=n.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+n.offsetWidth-t.pageX<s.scrollSensitivity?n.scrollLeft=o=n.scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(n.scrollLeft=o=n.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-b(r).scrollTop()<s.scrollSensitivity?o=b(r).scrollTop(b(r).scrollTop()-s.scrollSpeed):b(window).height()-(t.pageY-b(r).scrollTop())<s.scrollSensitivity&&(o=b(r).scrollTop(b(r).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-b(r).scrollLeft()<s.scrollSensitivity?o=b(r).scrollLeft(b(r).scrollLeft()-s.scrollSpeed):b(window).width()-(t.pageX-b(r).scrollLeft())<s.scrollSensitivity&&(o=b(r).scrollLeft(b(r).scrollLeft()+s.scrollSpeed)))),!1!==o&&b.ui.ddmanager&&!s.dropBehaviour&&b.ui.ddmanager.prepareOffsets(i,t)}}),b.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[],b(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=b(this),e=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){for(var s,o,n,r,a,h,l,p,c,d=i.options,u=d.snapTolerance,f=e.offset.left,g=f+i.helperProportions.width,m=e.offset.top,_=m+i.helperProportions.height,v=i.snapElements.length-1;0<=v;v--)h=(a=i.snapElements[v].left-i.margins.left)+i.snapElements[v].width,p=(l=i.snapElements[v].top-i.margins.top)+i.snapElements[v].height,g<a-u||h+u<f||_<l-u||p+u<m||!b.contains(i.snapElements[v].item.ownerDocument,i.snapElements[v].item)?(i.snapElements[v].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,b.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=!1):("inner"!==d.snapMode&&(s=Math.abs(l-_)<=u,o=Math.abs(p-m)<=u,n=Math.abs(a-g)<=u,r=Math.abs(h-f)<=u,s&&(e.position.top=i._convertPositionTo("relative",{top:l-i.helperProportions.height,left:0}).top),o&&(e.position.top=i._convertPositionTo("relative",{top:p,left:0}).top),n&&(e.position.left=i._convertPositionTo("relative",{top:0,left:a-i.helperProportions.width}).left),r&&(e.position.left=i._convertPositionTo("relative",{top:0,left:h}).left)),c=s||o||n||r,"outer"!==d.snapMode&&(s=Math.abs(l-m)<=u,o=Math.abs(p-_)<=u,n=Math.abs(a-f)<=u,r=Math.abs(h-g)<=u,s&&(e.position.top=i._convertPositionTo("relative",{top:l,left:0}).top),o&&(e.position.top=i._convertPositionTo("relative",{top:p-i.helperProportions.height,left:0}).top),n&&(e.position.left=i._convertPositionTo("relative",{top:0,left:a}).left),r&&(e.position.left=i._convertPositionTo("relative",{top:0,left:h-i.helperProportions.width}).left)),!i.snapElements[v].snapping&&(s||o||n||r||c)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,b.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=s||o||n||r||c)}}),b.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,i=i.options,i=b.makeArray(b(i.stack)).sort(function(t,e){return(parseInt(b(t).css("zIndex"),10)||0)-(parseInt(b(e).css("zIndex"),10)||0)});i.length&&(s=parseInt(b(i[0]).css("zIndex"),10)||0,b(i).each(function(t){b(this).css("zIndex",s+t)}),this.css("zIndex",s+i.length))}}),b.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){e=b(e.helper),i=i.options;e.css("zIndex")&&(i._zIndex=e.css("zIndex")),e.css("zIndex",i.zIndex)},stop:function(t,e,i){i=i.options;i._zIndex&&b(e.helper).css("zIndex",i._zIndex)}}),b.ui.draggable,b.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept=b.isFunction(i)?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return t=t||{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};t=arguments[0]},this._addToManager(e.scope),e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){b.ui.ddmanager.droppables[t]=b.ui.ddmanager.droppables[t]||[],b.ui.ddmanager.droppables[t].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var t=b.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){var i;"accept"===t?this.accept=b.isFunction(e)?e:function(t){return t.is(e)}:"scope"===t&&(i=b.ui.ddmanager.droppables[this.options.scope],this._splice(i),this._addToManager(e)),this._super(t,e)},_activate:function(t){var e=b.ui.ddmanager.current;this._addActiveClass(),e&&this._trigger("activate",t,this.ui(e))},_deactivate:function(t){var e=b.ui.ddmanager.current;this._removeActiveClass(),e&&this._trigger("deactivate",t,this.ui(e))},_over:function(t){var e=b.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(e)))},_out:function(t){var e=b.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(e)))},_drop:function(e,t){var i=t||b.ui.ddmanager.current,s=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=b(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&r(i,b.extend(t,{offset:t.element.offset()}),t.options.tolerance,e))return!(s=!0)}),!s&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(i)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var r=b.ui.intersect=function(){function d(t,e,i){return e<=t&&t<e+i}return function(t,e,i,s){if(!e.offset)return!1;var o=(t.positionAbs||t.position.absolute).left+t.margins.left,n=(t.positionAbs||t.position.absolute).top+t.margins.top,r=o+t.helperProportions.width,a=n+t.helperProportions.height,h=e.offset.left,l=e.offset.top,p=h+e.proportions().width,c=l+e.proportions().height;switch(i){case"fit":return h<=o&&r<=p&&l<=n&&a<=c;case"intersect":return h<o+t.helperProportions.width/2&&r-t.helperProportions.width/2<p&&l<n+t.helperProportions.height/2&&a-t.helperProportions.height/2<c;case"pointer":return d(s.pageY,l,e.proportions().height)&&d(s.pageX,h,e.proportions().width);case"touch":return(l<=n&&n<=c||l<=a&&a<=c||n<l&&c<a)&&(h<=o&&o<=p||h<=r&&r<=p||o<h&&p<r);default:return!1}}}();!(b.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,o=b.ui.ddmanager.droppables[t.options.scope]||[],n=e?e.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<o.length;i++)if(!(o[i].options.disabled||t&&!o[i].accept.call(o[i].element[0],t.currentItem||t.element))){for(s=0;s<r.length;s++)if(r[s]===o[i].element[0]){o[i].proportions().height=0;continue t}o[i].visible="none"!==o[i].element.css("display"),o[i].visible&&("mousedown"===n&&o[i]._activate.call(o[i],e),o[i].offset=o[i].element.offset(),o[i].proportions({width:o[i].element[0].offsetWidth,height:o[i].element[0].offsetHeight}))}},drop:function(t,e){var i=!1;return b.each((b.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&r(t,this,this.options.tolerance,e)&&(i=this._drop.call(this,e)||i),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,e)))}),i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||b.ui.ddmanager.prepareOffsets(t,e)})},drag:function(o,n){o.options.refreshPositions&&b.ui.ddmanager.prepareOffsets(o,n),b.each(b.ui.ddmanager.droppables[o.options.scope]||[],function(){var t,e,i,s;this.options.disabled||this.greedyChild||!this.visible||(s=!(i=r(o,this,this.options.tolerance,n))&&this.isover?"isout":i&&!this.isover?"isover":null)&&(this.options.greedy&&(e=this.options.scope,(i=this.element.parents(":data(ui-droppable)").filter(function(){return b(this).droppable("instance").options.scope===e})).length&&((t=b(i[0]).droppable("instance")).greedyChild="isover"===s)),t&&"isover"===s&&(t.isover=!1,t.isout=!0,t._out.call(t,n)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,n),t&&"isout"===s&&(t.isout=!1,t.isover=!0,t._over.call(t,n)))})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||b.ui.ddmanager.prepareOffsets(t,e)}})!==b.uiBackCompat&&b.widget("ui.droppable",b.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),b.ui.droppable,b.widget("ui.resizable",b.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if("hidden"===b(t).css("overflow"))return!1;var i=e&&"left"===e?"scrollLeft":"scrollTop",e=!1;return 0<t[i]||(t[i]=1,e=0<t[i],t[i]=0,e)},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable"),b.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(b("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&b(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();function t(t){b(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){this._super(t,e),"handles"===t&&(this._removeHandles(),this._setupHandles())},_setupHandles:function(){var t,e,i,s,o,n=this.options,r=this;if(this.handles=n.handles||(b(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=b(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e<i.length;e++)s="ui-resizable-"+(t=b.trim(i[e])),o=b("<div>"),this._addClass(o,"ui-resizable-handle "+s),o.css({zIndex:n.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.append(o);this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=b(this.handles[e]),this._on(this.handles[e],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=b(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),n.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=b(this.handles[e])[0])!==t.target&&!b.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=b(s.containment).scrollLeft()||0,i+=b(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=b(".ui-resizable-"+this.axis).css("cursor"),b("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),b.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,o=this.options,n=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:n.sizeDiff.height,i=e?0:n.sizeDiff.width,e={width:n.helper.width()-i,height:n.helper.height()-s},i=parseFloat(n.element.css("left"))+(n.position.left-n.originalPosition.left)||null,s=parseFloat(n.element.css("top"))+(n.position.top-n.originalPosition.top)||null,o.animate||this.element.css(b.extend(e,{top:s,left:i})),n.helper.height(n.size.height),n.helper.width(n.size.width),this._helper&&!o.animate&&this._proportionallyResize()),b("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,o={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,i=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,t=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),i>o.minHeight&&(o.minHeight=i),s<o.maxWidth&&(o.maxWidth=s),t<o.maxHeight&&(o.maxHeight=t)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,o=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,n=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,r=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return n&&(t.width=e.minWidth),r&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),o&&(t.height=e.maxHeight),n&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),r&&i&&(t.top=h-e.minHeight),o&&i&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],o=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(o[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||b("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){b.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),b.ui.plugin.add("resizable","animate",{stop:function(e){var i=b(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),n=o&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,o={width:i.size.width-r,height:i.size.height-n},r=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,n=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(b.extend(o,n&&r?{top:n,left:r}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&b(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),b.ui.plugin.add("resizable","containment",{start:function(){var i,s,o=b(this).resizable("instance"),t=o.options,e=o.element,n=t.containment,r=n instanceof b?n.get(0):/parent/.test(n)?e.parent().get(0):n;r&&(o.containerElement=b(r),/document/.test(n)||n===document?(o.containerOffset={left:0,top:0},o.containerPosition={left:0,top:0},o.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}):(i=b(r),s=[],b(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=o._num(i.css("padding"+e))}),o.containerOffset=i.offset(),o.containerPosition=i.position(),o.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=o.containerOffset,e=o.containerSize.height,n=o.containerSize.width,n=o._hasScroll(r,"left")?r.scrollWidth:n,e=o._hasScroll(r)?r.scrollHeight:e,o.parentData={element:r,left:t.left,top:t.top,width:n,height:e}))},resize:function(t){var e=b(this).resizable("instance"),i=e.options,s=e.containerOffset,o=e.position,n=e._aspectRatio||t.shiftKey,r={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(r=s),o.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-r.left),n&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),o.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),n&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),o=/relative|absolute/.test(e.containerElement.css("position")),i&&o?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),o=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-r.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-r.top:e.offset.top-s.top)),o+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-o,n&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,n&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=b(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,o=t.containerElement,n=b(t.helper),r=n.offset(),a=n.outerWidth()-t.sizeDiff.width,n=n.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(o.css("position"))&&b(this).css({left:r.left-s.left-i.left,width:a,height:n}),t._helper&&!e.animate&&/static/.test(o.css("position"))&&b(this).css({left:r.left-s.left-i.left,width:a,height:n})}}),b.ui.plugin.add("resizable","alsoResize",{start:function(){var t=b(this).resizable("instance").options;b(t.alsoResize).each(function(){var t=b(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=b(this).resizable("instance"),s=e.options,o=e.originalSize,n=e.originalPosition,r={height:e.size.height-o.height||0,width:e.size.width-o.width||0,top:e.position.top-n.top||0,left:e.position.left-n.left||0};b(s.alsoResize).each(function(){var t=b(this),s=b(this).data("ui-resizable-alsoresize"),o={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];b.each(e,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&0<=i&&(o[e]=i||null)}),t.css(o)})},stop:function(){b(this).removeData("ui-resizable-alsoresize")}}),b.ui.plugin.add("resizable","ghost",{start:function(){var t=b(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==b.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=b(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=b(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),b.ui.plugin.add("resizable","grid",{resize:function(){var t,e=b(this).resizable("instance"),i=e.options,s=e.size,o=e.originalSize,n=e.originalPosition,r=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=a[0]||1,l=a[1]||1,p=Math.round((s.width-o.width)/h)*h,c=Math.round((s.height-o.height)/l)*l,d=o.width+p,u=o.height+c,f=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<u,m=i.minWidth&&i.minWidth>d,s=i.minHeight&&i.minHeight>u;i.grid=a,m&&(d+=h),s&&(u+=l),f&&(d-=h),g&&(u-=l),/^(se|s|e)$/.test(r)?(e.size.width=d,e.size.height=u):/^(ne)$/.test(r)?(e.size.width=d,e.size.height=u,e.position.top=n.top-c):/^(sw)$/.test(r)?(e.size.width=d,e.size.height=u,e.position.left=n.left-p):((u-l<=0||d-h<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0<u-l?(e.size.height=u,e.position.top=n.top-c):(u=l-t.height,e.size.height=u,e.position.top=n.top+o.height-u),0<d-h?(e.size.width=d,e.position.left=n.left-p):(d=h-t.width,e.size.width=d,e.position.left=n.left+o.width-d))}}),b.ui.resizable}(jQuery); | ||
//# sourceMappingURL=jquery-ui.js.map |
@@ -45,4 +45,8 @@ /** | ||
cellHeightUnit?: string; | ||
/** list of children item to create when calling load() or addGrid() */ | ||
children?: GridStackWidget[]; | ||
/** number of columns (default?: 12). Note: IF you change this, CSS also have to change. See https://github.com/gridstack/gridstack.js#change-grid-columns */ | ||
column?: number; | ||
/** additional class on top of '.grid-stack' (which is required for our CSS) to differentiate this instance */ | ||
class?: string; | ||
/** disallows dragging of widgets (default?: false) */ | ||
@@ -164,2 +168,4 @@ disableDrag?: boolean; | ||
content?: string; | ||
/** optional nested grid options and list of children, which then turns into actual instance at runtime */ | ||
subGrid?: GridStackOptions | GridStack; | ||
} | ||
@@ -166,0 +172,0 @@ /** Drag&Drop resize options */ |
"use strict"; | ||
// types.ts 3.0.0 @preserve | ||
// types.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=types.js.map |
@@ -54,4 +54,4 @@ /** | ||
static same(a: unknown, b: unknown): boolean; | ||
/** makes a shallow copy of the passed json struct */ | ||
static clone(target: {}): {}; | ||
/** removes field from the first object if same as the second objects (like diffing) and internal '_' for saving */ | ||
static removeInternalAndSame(a: unknown, b: unknown): void; | ||
/** return the closest parent matching the given class */ | ||
@@ -58,0 +58,0 @@ static closestByClass(el: HTMLElement, name: string): HTMLElement; |
"use strict"; | ||
// utils.ts 3.0.0 @preserve | ||
// utils.ts 3.1.0 @preserve | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Utils = exports.obsoleteAttr = exports.obsoleteOptsDel = exports.obsoleteOpts = exports.obsolete = void 0; | ||
/** checks for obsolete method names */ | ||
@@ -221,15 +220,30 @@ // eslint-disable-next-line | ||
} | ||
/** makes a shallow copy of the passed json struct */ | ||
// eslint-disable-next-line | ||
static clone(target) { | ||
return Object.assign({}, target); | ||
/** removes field from the first object if same as the second objects (like diffing) and internal '_' for saving */ | ||
static removeInternalAndSame(a, b) { | ||
if (typeof a !== 'object' || typeof b !== 'object') | ||
return; | ||
for (let key in a) { | ||
let val = a[key]; | ||
if (val && typeof val === 'object') { | ||
for (let i in val) { | ||
if (val[i] === b[key][i] || i[0] === '_') { | ||
delete val[i]; | ||
} | ||
} | ||
if (!Object.keys(val).length) { | ||
delete a[key]; | ||
} | ||
} | ||
else if (val === b[key] || key[0] === '_') { | ||
delete a[key]; | ||
} | ||
} | ||
} | ||
/** return the closest parent matching the given class */ | ||
static closestByClass(el, name) { | ||
el = el.parentElement; | ||
if (!el) | ||
return null; | ||
if (el.classList.contains(name)) | ||
return el; | ||
return Utils.closestByClass(el, name); | ||
while (el = el.parentElement) { | ||
if (el.classList.contains(name)) | ||
return el; | ||
} | ||
return null; | ||
} | ||
@@ -236,0 +250,0 @@ /** delay calling the given function by certain amount of time */ |
@@ -8,3 +8,4 @@ Change log | ||
- [3.3.0 (2020-11-29)](#330-2020-11-29) | ||
- [3.1.0](#310) | ||
- [3.0.0 (2020-11-29)](#300-2020-11-29) | ||
- [2.2.0 (2020-11-7)](#220-2020-11-7) | ||
@@ -45,4 +46,13 @@ - [2.1.0 (2020-10-28)](#210-2020-10-28) | ||
## 3.3.0 (2020-11-29) | ||
## 3.1.0 | ||
- add new `addGrid(parent, opts)` to create a grid and load children instead of `init() + load()`, which is used by `load()` to supports nested grids creation. | ||
see [nested.html](https://github.com/gridstack/gridstack.js/blob/develop/demo/nested.html) demo. | ||
- `save()` will now work on nested grids, recursively saving info. added flag to also allow saving the current grid options + children | ||
(needed for nested grids) so you can now call new `adddGrid()` to re-create everything from JSON. | ||
- fix [1505](https://github.com/gridstack/gridstack.js/issues/1505) don't call `movable()`/`resizable()` on locked items error. thanks [@infime](https://github.com/infime) | ||
- fix [1517](https://github.com/gridstack/gridstack.js/pull/1517) force typescript 3.6 as 3.7 has breaking change | ||
## 3.0.0 (2020-11-29) | ||
- the big news is we finally have a native HTML5 drag&drop plugin (zero jquery)! Huge thanks to [@rhlin](https://github.com/rhlin) for creating this in stealth mode. Read all about it in main doc. | ||
@@ -56,3 +66,4 @@ - we now have a React example, in addition to Vue - Angular is next!. thanks [@eloparco](https://github.com/eloparco) | ||
- del `ddPlugin` grid option as we only have one drag&drop plugin at runtime, which is defined by the include you use (HTML5 vs jquery vs none) | ||
- change attribute like `data-gs-min-width` is now `gs-min-w`. We removed 'data-' from all attributes, and shorten 'width|height' to just 'w|h' to require typing and more efficient [1491](https://github.com/gridstack/gridstack.js/pull/1491) | ||
- change attribute `data-gs-min-width` is now `gs-min-w`. We removed 'data-' from all attributes, and shorten 'width|height' to just 'w|h' to require less typing and more efficient (2k saved in .js alone!) [1491](https://github.com/gridstack/gridstack.js/pull/1491) [1492](https://github.com/gridstack/gridstack.js/pull/1492) | ||
- also `GridStackWidget` used in most API `width|height|minWidth|minHeight|maxWidth|maxHeight` are now shorter `w|h|minW|minH|maxW|maxH` as well [1493](https://github.com/gridstack/gridstack.js/pull/1493) | ||
- **** see [migrating to v3](https://github.com/gridstack/gridstack.js#migrating-to-v3) **** | ||
@@ -59,0 +70,0 @@ |
@@ -24,2 +24,3 @@ gridstack.js API | ||
- [API](#api) | ||
- [addGrid(parent: HTMLElement, opt: GridStackOptions)](#addgridparent-htmlelement-opt-gridstackoptions) | ||
- [addWidget(el?: GridStackWidget | GridStackElement, options?: GridStackWidget)](#addwidgetel-gridstackwidget--gridstackelement-options-gridstackwidget) | ||
@@ -78,3 +79,5 @@ - [batchUpdate()](#batchupdate) | ||
* `'auto'` - height will be square cells initially. | ||
- `children`?: GridStackWidget[] - list of children item to create when calling load() or addGrid() | ||
- `column` - number of columns (default: `12`) which can change on the fly with `column(N)` as well. See [example](http://gridstackjs.com/demo/column.html) | ||
- `class`?: string - additional class on top of '.grid-stack' (which is required for our CSS) to differentiate this instance | ||
- `disableDrag` - disallows dragging of widgets (default: `false`). | ||
@@ -135,2 +138,3 @@ - `disableOneColumnMode` - disables the onColumnMode when the grid width is less than minW (default: 'false') | ||
- `content` - (string) html content to be added when calling `grid.load()/addWidget()` as content inside the item | ||
- `subGrid`: GridStackOptions - optional nested grid options and list of children | ||
@@ -252,2 +256,7 @@ ## Item attributes | ||
### addGrid(parent: HTMLElement, opt: GridStackOptions) | ||
create a grid under given parent, with given options and loading children recursively (for nested grids), instead of `init() + load()`. Used by `load()` to supports nested grids creation. | ||
see [nested.html](https://github.com/gridstack/gridstack.js/blob/develop/demo/nested.html) demo | ||
### addWidget(el?: GridStackWidget | GridStackElement, options?: GridStackWidget) | ||
@@ -254,0 +263,0 @@ |
{ | ||
"name": "gridstack", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "TypeScript/Javascript lib for dashboard layout and creation, no external dependencies, with many wrappers (React, Angular, Ember, knockout...)", | ||
@@ -57,3 +57,3 @@ "main": "./dist/gridstack.js", | ||
"doctoc": "^1.4.0", | ||
"eslint": "^7.12.1", | ||
"eslint": "^7.14", | ||
"grunt": "^1.0.4", | ||
@@ -71,3 +71,3 @@ "grunt-cli": "^1.3.2", | ||
"jasmine-core": "^3.5.0", | ||
"karma": "^5.2.3", | ||
"karma": "^4", | ||
"karma-chrome-launcher": "^3.1.0", | ||
@@ -78,6 +78,7 @@ "karma-cli": "^2.0.0", | ||
"node-sass": "^5.0.0", | ||
"protractor": "^7.0.0", | ||
"puppeteer": "^5.4.1", | ||
"serve-static": "^1.14.1", | ||
"ts-loader": "^8.0.7", | ||
"typescript": "4.0.5", | ||
"typescript": "3.6.5", | ||
"webpack": "^5.3.2", | ||
@@ -84,0 +85,0 @@ "webpack-cli": "^4.1.0" |
@@ -286,8 +286,9 @@ # gridstack.js | ||
- Vue.js: see [demo](https://gridstackjs.com/demo/vue3js.html) with [v3 src](https://github.com/gridstack/gridstack.js/blob/develop/demo/vue3js.html) or [v2 src](https://github.com/gridstack/gridstack.js/blob/develop/demo/vue2js.html) | ||
- React: see [demo](https://gridstackjs.com/demo/react.html) with [src](https://github.com/gridstack/gridstack.js/blob/develop/demo/react.html), or [react-gridstack-example](https://github.com/Inder2108/react-gridstack-example/blob/master/src/App.js), or read on what [hooks to use](https://github.com/gridstack/gridstack.js/issues/735#issuecomment-329888796) | ||
- Ember: [ember-gridstack](https://github.com/yahoo/ember-gridstack) | ||
- Angular9: [lb-gridstack](https://github.com/pfms84/lb-gridstack) Note: very old v0.3 gridstack instance so recommend for concept ONLY. You can do component or directive. Working on exposing the Angular component wrapper we use internally. | ||
- AngularJS: [gridstack-angular](https://github.com/kdietrich/gridstack-angular) | ||
- Rails: [gridstack-js-rails](https://github.com/randoum/gridstack-js-rails) | ||
- **Angular9**: [lb-gridstack](https://github.com/pfms84/lb-gridstack) Note: very old v0.3 gridstack instance so recommend for concept ONLY. You can do component or directive. Working on exposing the Angular component wrapper we use internally. | ||
- **AngularJS**: [gridstack-angular](https://github.com/kdietrich/gridstack-angular) | ||
- **Ember**: [ember-gridstack](https://github.com/yahoo/ember-gridstack) | ||
- **knockout**: see [demo](https://gridstackjs.com/demo/knockout.html) using component, but check [custom bindings ticket](https://github.com/gridstack/gridstack.js/issues/465) which is likely better approach. | ||
- **Rails**: [gridstack-js-rails](https://github.com/randoum/gridstack-js-rails) | ||
- **React**: see [demo](https://gridstackjs.com/demo/react.html) with [src](https://github.com/gridstack/gridstack.js/blob/develop/demo/react.html), or [react-gridstack-example](https://github.com/Inder2108/react-gridstack-example/blob/master/src/App.js), or read on what [hooks to use](https://github.com/gridstack/gridstack.js/issues/735#issuecomment-329888796) | ||
- **Vue**: see [demo](https://gridstackjs.com/demo/vue3js.html) with [v3 src](https://github.com/gridstack/gridstack.js/blob/develop/demo/vue3js.html) or [v2 src](https://github.com/gridstack/gridstack.js/blob/develop/demo/vue2js.html) | ||
@@ -330,3 +331,5 @@ # Migrating | ||
// returns DOM element | ||
grid.addWidget('<div><div class="grid-stack-item-content"> test </div></div>', {w: 2}); | ||
grid.addWidget('<div><div class="grid-stack-item-content"> test </div></div>', {width: 2}); | ||
// Note: in 3.x it's ever simpler | ||
// grid.addWidget({w:2, content: 'test'}) | ||
@@ -333,0 +336,0 @@ // event handler |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2577757
7801
411
35