gridstack 10.1.0 → 10.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +1 -1
  2. package/angular/package.json +1 -1
  3. package/angular/projects/demo/src/app/app.component.ts +4 -2
  4. package/angular/projects/demo/src/app/dummy.component.ts +3 -4
  5. package/angular/projects/lib/src/lib/base-widget.ts +1 -1
  6. package/angular/projects/lib/src/lib/gridstack-item.component.ts +1 -1
  7. package/angular/projects/lib/src/lib/gridstack.component.ts +1 -1
  8. package/angular/projects/lib/src/lib/gridstack.module.ts +1 -1
  9. package/dist/angular/esm2020/lib/base-widget.mjs +2 -2
  10. package/dist/angular/esm2020/lib/gridstack-item.component.mjs +2 -2
  11. package/dist/angular/esm2020/lib/gridstack.component.mjs +2 -2
  12. package/dist/angular/esm2020/lib/gridstack.module.mjs +2 -2
  13. package/dist/angular/fesm2015/gridstack-angular.mjs +4 -4
  14. package/dist/angular/fesm2015/gridstack-angular.mjs.map +1 -1
  15. package/dist/angular/fesm2020/gridstack-angular.mjs +4 -4
  16. package/dist/angular/fesm2020/gridstack-angular.mjs.map +1 -1
  17. package/dist/angular/lib/gridstack-item.component.d.ts +1 -1
  18. package/dist/angular/lib/gridstack.component.d.ts +1 -1
  19. package/dist/angular/src/base-widget.ts +1 -1
  20. package/dist/angular/src/gridstack-item.component.ts +1 -1
  21. package/dist/angular/src/gridstack.component.ts +1 -1
  22. package/dist/angular/src/gridstack.module.ts +1 -1
  23. package/dist/dd-base-impl.d.ts +1 -1
  24. package/dist/dd-base-impl.js +1 -1
  25. package/dist/dd-base-impl.js.map +1 -1
  26. package/dist/dd-draggable.d.ts +1 -1
  27. package/dist/dd-draggable.js +3 -3
  28. package/dist/dd-draggable.js.map +1 -1
  29. package/dist/dd-droppable.d.ts +3 -3
  30. package/dist/dd-droppable.js +3 -3
  31. package/dist/dd-droppable.js.map +1 -1
  32. package/dist/dd-element.d.ts +2 -2
  33. package/dist/dd-element.js +1 -1
  34. package/dist/dd-element.js.map +1 -1
  35. package/dist/dd-gridstack.d.ts +1 -1
  36. package/dist/dd-gridstack.js +2 -2
  37. package/dist/dd-gridstack.js.map +1 -1
  38. package/dist/dd-manager.d.ts +1 -1
  39. package/dist/dd-manager.js +1 -1
  40. package/dist/dd-manager.js.map +1 -1
  41. package/dist/dd-resizable-handle.d.ts +5 -2
  42. package/dist/dd-resizable-handle.js +6 -7
  43. package/dist/dd-resizable-handle.js.map +1 -1
  44. package/dist/dd-resizable.d.ts +2 -2
  45. package/dist/dd-resizable.js +6 -5
  46. package/dist/dd-resizable.js.map +1 -1
  47. package/dist/dd-touch.d.ts +1 -1
  48. package/dist/dd-touch.js +1 -1
  49. package/dist/dd-touch.js.map +1 -1
  50. package/dist/es5/dd-base-impl.d.ts +1 -1
  51. package/dist/es5/dd-base-impl.js +1 -1
  52. package/dist/es5/dd-base-impl.js.map +1 -1
  53. package/dist/es5/dd-draggable.d.ts +1 -1
  54. package/dist/es5/dd-draggable.js +3 -3
  55. package/dist/es5/dd-draggable.js.map +1 -1
  56. package/dist/es5/dd-droppable.d.ts +3 -3
  57. package/dist/es5/dd-droppable.js +4 -4
  58. package/dist/es5/dd-droppable.js.map +1 -1
  59. package/dist/es5/dd-element.d.ts +2 -2
  60. package/dist/es5/dd-element.js +1 -1
  61. package/dist/es5/dd-element.js.map +1 -1
  62. package/dist/es5/dd-gridstack.d.ts +1 -1
  63. package/dist/es5/dd-gridstack.js +2 -2
  64. package/dist/es5/dd-gridstack.js.map +1 -1
  65. package/dist/es5/dd-manager.d.ts +1 -1
  66. package/dist/es5/dd-manager.js +1 -1
  67. package/dist/es5/dd-manager.js.map +1 -1
  68. package/dist/es5/dd-resizable-handle.d.ts +5 -2
  69. package/dist/es5/dd-resizable-handle.js +6 -7
  70. package/dist/es5/dd-resizable-handle.js.map +1 -1
  71. package/dist/es5/dd-resizable.d.ts +2 -2
  72. package/dist/es5/dd-resizable.js +7 -6
  73. package/dist/es5/dd-resizable.js.map +1 -1
  74. package/dist/es5/dd-touch.d.ts +1 -1
  75. package/dist/es5/dd-touch.js +1 -1
  76. package/dist/es5/dd-touch.js.map +1 -1
  77. package/dist/es5/gridstack-all.js +1 -1
  78. package/dist/es5/gridstack-all.js.LICENSE.txt +1 -1
  79. package/dist/es5/gridstack-all.js.map +1 -1
  80. package/dist/es5/gridstack-engine.d.ts +3 -3
  81. package/dist/es5/gridstack-engine.js +17 -14
  82. package/dist/es5/gridstack-engine.js.map +1 -1
  83. package/dist/es5/gridstack-poly.js +1 -1
  84. package/dist/es5/gridstack.d.ts +7 -8
  85. package/dist/es5/gridstack.js +84 -62
  86. package/dist/es5/gridstack.js.map +1 -1
  87. package/dist/es5/types.d.ts +1 -1
  88. package/dist/es5/types.js +1 -1
  89. package/dist/es5/types.js.map +1 -1
  90. package/dist/es5/utils.d.ts +5 -6
  91. package/dist/es5/utils.js +17 -12
  92. package/dist/es5/utils.js.map +1 -1
  93. package/dist/gridstack-all.js +1 -1
  94. package/dist/gridstack-all.js.LICENSE.txt +1 -1
  95. package/dist/gridstack-all.js.map +1 -1
  96. package/dist/gridstack-engine.d.ts +3 -3
  97. package/dist/gridstack-engine.js +15 -13
  98. package/dist/gridstack-engine.js.map +1 -1
  99. package/dist/gridstack.css +1 -1
  100. package/dist/gridstack.d.ts +7 -8
  101. package/dist/gridstack.js +85 -63
  102. package/dist/gridstack.js.map +1 -1
  103. package/dist/src/gridstack.scss +1 -1
  104. package/dist/types.d.ts +1 -1
  105. package/dist/types.js +1 -1
  106. package/dist/types.js.map +1 -1
  107. package/dist/utils.d.ts +5 -6
  108. package/dist/utils.js +15 -12
  109. package/dist/utils.js.map +1 -1
  110. package/doc/CHANGES.md +13 -0
  111. package/doc/README.md +3 -4
  112. package/package.json +1 -1
package/dist/gridstack.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * GridStack 10.1.0
2
+ * GridStack 10.1.2
3
3
  * https://gridstackjs.com/
4
4
  *
5
5
  * Copyright (c) 2021-2022 Alain Dumesny
@@ -151,10 +151,12 @@ class GridStack {
151
151
  }
152
152
  /**
153
153
  * Construct a grid item from the given element and options
154
- * @param el
155
- * @param opts
154
+ * @param el the HTML element tied to this grid after it's been initialized
155
+ * @param opts grid options - public for classes to access, but use methods to modify!
156
156
  */
157
157
  constructor(el, opts = {}) {
158
+ this.el = el;
159
+ this.opts = opts;
158
160
  /** @internal */
159
161
  this._gsEventHandler = {};
160
162
  /** @internal extra row added when dragging at the bottom of the grid */
@@ -162,7 +164,6 @@ class GridStack {
162
164
  /** @internal meant to store the scale of the active grid */
163
165
  this.dragTransform = { xScale: 1, yScale: 1, xOffset: 0, yOffset: 0 };
164
166
  el.gridstack = this;
165
- this.el = el; // exposed HTML element to the user
166
167
  opts = opts || {}; // handles null/undefined/0
167
168
  if (!el.classList.contains('grid-stack')) {
168
169
  this.el.classList.add('grid-stack');
@@ -217,7 +218,8 @@ class GridStack {
217
218
  if (bk?.length > 1)
218
219
  bk.sort((a, b) => (b.w || 0) - (a.w || 0));
219
220
  // elements DOM attributes override any passed options (like CSS style) - merge the two together
220
- let defaults = { ...Utils.cloneDeep(gridDefaults),
221
+ let defaults = {
222
+ ...Utils.cloneDeep(gridDefaults),
221
223
  column: Utils.toNumber(el.getAttribute('gs-column')) || gridDefaults.column,
222
224
  minRow: rowAttr ? rowAttr : Utils.toNumber(el.getAttribute('gs-min-row')) || gridDefaults.minRow,
223
225
  maxRow: rowAttr ? rowAttr : Utils.toNumber(el.getAttribute('gs-max-row')) || gridDefaults.maxRow,
@@ -233,16 +235,15 @@ class GridStack {
233
235
  if (el.getAttribute('gs-animate')) { // default to true, but if set to false use that instead
234
236
  defaults.animate = Utils.toBool(el.getAttribute('gs-animate'));
235
237
  }
236
- this.opts = Utils.defaults(opts, defaults);
237
- opts = null; // make sure we use this.opts instead
238
+ opts = Utils.defaults(opts, defaults);
238
239
  this._initMargin(); // part of settings defaults...
239
240
  // Now check if we're loading into 1 column mode FIRST so we don't do un-necessary work (like cellHeight = width / 12 then go 1 column)
240
241
  this.checkDynamicColumn();
241
- this.el.classList.add('gs-' + this.opts.column);
242
- if (this.opts.rtl === 'auto') {
243
- this.opts.rtl = (el.style.direction === 'rtl');
242
+ this.el.classList.add('gs-' + opts.column);
243
+ if (opts.rtl === 'auto') {
244
+ opts.rtl = (el.style.direction === 'rtl');
244
245
  }
245
- if (this.opts.rtl) {
246
+ if (opts.rtl) {
246
247
  this.el.classList.add('grid-stack-rtl');
247
248
  }
248
249
  // check if we're been nested, and if so update our style and keep pointer around (used during save)
@@ -254,31 +255,31 @@ class GridStack {
254
255
  this.el.classList.add('grid-stack-nested');
255
256
  parentGridItem.el.classList.add('grid-stack-sub-grid');
256
257
  }
257
- this._isAutoCellHeight = (this.opts.cellHeight === 'auto');
258
- if (this._isAutoCellHeight || this.opts.cellHeight === 'initial') {
258
+ this._isAutoCellHeight = (opts.cellHeight === 'auto');
259
+ if (this._isAutoCellHeight || opts.cellHeight === 'initial') {
259
260
  // make the cell content square initially (will use resize/column event to keep it square)
260
261
  this.cellHeight(undefined, false);
261
262
  }
262
263
  else {
263
264
  // append unit if any are set
264
- if (typeof this.opts.cellHeight == 'number' && this.opts.cellHeightUnit && this.opts.cellHeightUnit !== gridDefaults.cellHeightUnit) {
265
- this.opts.cellHeight = this.opts.cellHeight + this.opts.cellHeightUnit;
266
- delete this.opts.cellHeightUnit;
265
+ if (typeof opts.cellHeight == 'number' && opts.cellHeightUnit && opts.cellHeightUnit !== gridDefaults.cellHeightUnit) {
266
+ opts.cellHeight = opts.cellHeight + opts.cellHeightUnit;
267
+ delete opts.cellHeightUnit;
267
268
  }
268
- this.cellHeight(this.opts.cellHeight, false);
269
+ this.cellHeight(opts.cellHeight, false);
269
270
  }
270
271
  // see if we need to adjust auto-hide
271
- if (this.opts.alwaysShowResizeHandle === 'mobile') {
272
- this.opts.alwaysShowResizeHandle = isTouch;
272
+ if (opts.alwaysShowResizeHandle === 'mobile') {
273
+ opts.alwaysShowResizeHandle = isTouch;
273
274
  }
274
275
  this._styleSheetClass = 'gs-id-' + GridStackEngine._idSeq++;
275
276
  this.el.classList.add(this._styleSheetClass);
276
277
  this._setStaticClass();
277
- let engineClass = this.opts.engineClass || GridStack.engineClass || GridStackEngine;
278
+ let engineClass = opts.engineClass || GridStack.engineClass || GridStackEngine;
278
279
  this.engine = new engineClass({
279
280
  column: this.getColumn(),
280
- float: this.opts.float,
281
- maxRow: this.opts.maxRow,
281
+ float: opts.float,
282
+ maxRow: opts.maxRow,
282
283
  onChange: (cbNodes) => {
283
284
  let maxH = 0;
284
285
  this.engine.nodes.forEach(n => { maxH = Math.max(maxH, n.y + n.h); });
@@ -300,25 +301,25 @@ class GridStack {
300
301
  });
301
302
  // create initial global styles BEFORE loading children so resizeToContent margin can be calculated correctly
302
303
  this._updateStyles(false, 0);
303
- if (this.opts.auto) {
304
+ if (opts.auto) {
304
305
  this.batchUpdate(); // prevent in between re-layout #1535 TODO: this only set float=true, need to prevent collision check...
305
306
  this.getGridItems().forEach(el => this._prepareElement(el));
306
307
  this.batchUpdate(false);
307
308
  }
308
309
  // load any passed in children as well, which overrides any DOM layout done above
309
- if (this.opts.children) {
310
- let children = this.opts.children;
311
- delete this.opts.children;
310
+ if (opts.children) {
311
+ let children = opts.children;
312
+ delete opts.children;
312
313
  if (children.length)
313
314
  this.load(children); // don't load empty
314
315
  }
315
316
  // if (this.engine.nodes.length) this._updateStyles(); // update based on # of children. done in engine onChange CB
316
- this.setAnimation(this.opts.animate);
317
+ this.setAnimation(opts.animate);
317
318
  // dynamic grids require pausing during drag to detect over to nest vs push
318
- if (this.opts.subGridDynamic && !DDManager.pauseDrag)
319
+ if (opts.subGridDynamic && !DDManager.pauseDrag)
319
320
  DDManager.pauseDrag = true;
320
- if (this.opts.draggable?.pause !== undefined)
321
- DDManager.pauseDrag = this.opts.draggable.pause;
321
+ if (opts.draggable?.pause !== undefined)
322
+ DDManager.pauseDrag = opts.draggable.pause;
322
323
  this._setupRemoveDrop();
323
324
  this._setupAcceptWidget();
324
325
  this._updateResizeEvent();
@@ -585,10 +586,17 @@ class GridStack {
585
586
  load(items, addRemove = GridStack.addRemoveCB || true) {
586
587
  items = Utils.cloneDeep(items); // so we can mod
587
588
  const column = this.getColumn();
589
+ // if we have a mix of new items without coordinates and existing items, separate them out so they can be added after #2639
590
+ let addAfter = items.filter(n => (n.x === undefined || n.y === undefined) && !Utils.find(this.engine.nodes, n.id));
591
+ if (addAfter.length && addAfter.length !== items.length) {
592
+ items = items.filter(n => !Utils.find(addAfter, n.id));
593
+ }
594
+ else
595
+ addAfter = [];
588
596
  // if passed list has coordinates, use them (insert from end to beginning for conflict resolution) else keep widget order
589
597
  const haveCoord = items.some(w => w.x !== undefined || w.y !== undefined);
590
598
  if (haveCoord)
591
- items = Utils.sort(items, -1, column);
599
+ items = Utils.sort(items, -1);
592
600
  this._insertNotAppend = haveCoord; // if we create in reverse order...
593
601
  // if we're loading a layout into for example 1 column and items don't fit, make sure to save
594
602
  // the original wanted layout so we can scale back up correctly #1471
@@ -662,15 +670,20 @@ class GridStack {
662
670
  this.addWidget(w);
663
671
  }
664
672
  });
673
+ // finally append any separate ones that didn't have explicit coordinates last so they can find next empty spot
674
+ if (addRemove) {
675
+ addAfter.forEach(w => this.addWidget(w));
676
+ }
665
677
  this.engine.removedNodes = removed;
666
678
  this.batchUpdate(false);
667
679
  // after commit, clear that flag
668
680
  delete this._ignoreLayoutsNodeChange;
669
681
  delete this._insertNotAppend;
670
682
  prevCB ? GridStack.addRemoveCB = prevCB : delete GridStack.addRemoveCB;
671
- // delay adding animation back
672
- if (noAnim && this.opts.animate)
673
- setTimeout(() => this.setAnimation(this.opts.animate));
683
+ // delay adding animation back, but check to make sure grid (opt) is still around
684
+ if (noAnim && this.opts?.animate)
685
+ setTimeout(() => { if (this.opts)
686
+ this.setAnimation(this.opts.animate); });
674
687
  return this;
675
688
  }
676
689
  /**
@@ -1042,7 +1055,7 @@ class GridStack {
1042
1055
  }
1043
1056
  if (!node)
1044
1057
  return;
1045
- if (GridStack.addRemoveCB) {
1058
+ if (removeDOM && GridStack.addRemoveCB) {
1046
1059
  GridStack.addRemoveCB(this.el, node, false, false);
1047
1060
  }
1048
1061
  // remove our DOM data (circular link) and drag&drop permanently
@@ -1062,15 +1075,21 @@ class GridStack {
1062
1075
  /**
1063
1076
  * Removes all widgets from the grid.
1064
1077
  * @param removeDOM if `false` DOM elements won't be removed from the tree (Default? `true`).
1078
+ * @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
1065
1079
  */
1066
- removeAll(removeDOM = true) {
1080
+ removeAll(removeDOM = true, triggerEvent = true) {
1067
1081
  // always remove our DOM data (circular link) before list gets emptied and drag&drop permanently
1068
1082
  this.engine.nodes.forEach(n => {
1083
+ if (removeDOM && GridStack.addRemoveCB) {
1084
+ GridStack.addRemoveCB(this.el, n, false, false);
1085
+ }
1069
1086
  delete n.el.gridstackNode;
1070
- this._removeDD(n.el);
1087
+ if (!this.opts.staticGrid)
1088
+ this._removeDD(n.el);
1071
1089
  });
1072
- this.engine.removeAll(removeDOM);
1073
- this._triggerRemoveEvent();
1090
+ this.engine.removeAll(removeDOM, triggerEvent);
1091
+ if (triggerEvent)
1092
+ this._triggerRemoveEvent();
1074
1093
  return this;
1075
1094
  }
1076
1095
  /**
@@ -1334,8 +1353,9 @@ class GridStack {
1334
1353
  }
1335
1354
  // prevent added nodes from also triggering 'change' event (which is called next)
1336
1355
  this.engine.addedNodes.forEach(n => { delete n._dirty; });
1337
- this._triggerEvent('added', this.engine.addedNodes);
1356
+ const addedNodes = [...this.engine.addedNodes];
1338
1357
  this.engine.addedNodes = [];
1358
+ this._triggerEvent('added', addedNodes);
1339
1359
  }
1340
1360
  return this;
1341
1361
  }
@@ -1344,8 +1364,9 @@ class GridStack {
1344
1364
  if (this.engine.batchMode)
1345
1365
  return this;
1346
1366
  if (this.engine.removedNodes?.length) {
1347
- this._triggerEvent('removed', this.engine.removedNodes);
1367
+ const removedNodes = [...this.engine.removedNodes];
1348
1368
  this.engine.removedNodes = [];
1369
+ this._triggerEvent('removed', removedNodes);
1349
1370
  }
1350
1371
  return this;
1351
1372
  }
@@ -1917,7 +1938,7 @@ class GridStack {
1917
1938
  };
1918
1939
  dd.droppable(this.el, {
1919
1940
  accept: (el) => {
1920
- let node = el.gridstackNode;
1941
+ let node = el.gridstackNode || this._readAttr(el, false);
1921
1942
  // set accept drop to true on ourself (which we ignore) so we don't get "can't drop" icon in HTML5 mode while moving
1922
1943
  if (node?.grid === this)
1923
1944
  return true;
@@ -1932,7 +1953,7 @@ class GridStack {
1932
1953
  let selector = (this.opts.acceptWidgets === true ? '.grid-stack-item' : this.opts.acceptWidgets);
1933
1954
  canAccept = el.matches(selector);
1934
1955
  }
1935
- // finally check to make sure we actually have space left #1571
1956
+ // finally check to make sure we actually have space left #1571 #2633
1936
1957
  if (canAccept && node && this.opts.maxRow) {
1937
1958
  let n = { w: node.w, h: node.h, minW: node.minW, minH: node.minH }; // only width/height matters and autoPosition
1938
1959
  canAccept = this.engine.willItFit(n);
@@ -1994,7 +2015,7 @@ class GridStack {
1994
2015
  node._temporaryRemoved = true; // so we can insert it
1995
2016
  }
1996
2017
  // clear any marked for complete removal (Note: don't check _isAboutToRemove as that is cleared above - just do it)
1997
- this._itemRemoving(node.el, false);
2018
+ GridStack._itemRemoving(node.el, false);
1998
2019
  dd.on(el, 'drag', onDrag);
1999
2020
  // make sure this is called at least once when going fast #1578
2000
2021
  onDrag(event, el, helper);
@@ -2092,35 +2113,36 @@ class GridStack {
2092
2113
  if (this._gsEventHandler['dropped']) {
2093
2114
  this._gsEventHandler['dropped']({ ...event, type: 'dropped' }, origNode && origNode.grid ? origNode : undefined, node);
2094
2115
  }
2095
- // delay adding animation back
2116
+ // delay adding animation back, but check to make sure grid (opt) is still around
2096
2117
  if (noAnim)
2097
- setTimeout(() => this.setAnimation(this.opts.animate));
2118
+ setTimeout(() => { if (this.opts)
2119
+ this.setAnimation(this.opts.animate); });
2098
2120
  return false; // prevent parent from receiving msg (which may be grid as well)
2099
2121
  });
2100
2122
  return this;
2101
2123
  }
2102
2124
  /** @internal mark item for removal */
2103
- _itemRemoving(el, remove) {
2104
- let node = el ? el.gridstackNode : undefined;
2105
- if (!node || !node.grid || el.classList.contains(this.opts.removableOptions.decline))
2125
+ static _itemRemoving(el, remove) {
2126
+ const node = el ? el.gridstackNode : undefined;
2127
+ if (!node?.grid || el.classList.contains(node.grid.opts.removableOptions.decline))
2106
2128
  return;
2107
2129
  remove ? node._isAboutToRemove = true : delete node._isAboutToRemove;
2108
2130
  remove ? el.classList.add('grid-stack-item-removing') : el.classList.remove('grid-stack-item-removing');
2109
2131
  }
2110
2132
  /** @internal called to setup a trash drop zone if the user specifies it */
2111
2133
  _setupRemoveDrop() {
2112
- if (!this.opts.staticGrid && typeof this.opts.removable === 'string') {
2113
- let trashEl = document.querySelector(this.opts.removable);
2114
- if (!trashEl)
2115
- return this;
2116
- // only register ONE drop-over/dropout callback for the 'trash', and it will
2117
- // update the passed in item and parent grid because the 'trash' is a shared resource anyway,
2118
- // and Native DD only has 1 event CB (having a list and technically a per grid removableOptions complicates things greatly)
2119
- if (!dd.isDroppable(trashEl)) {
2120
- dd.droppable(trashEl, this.opts.removableOptions)
2121
- .on(trashEl, 'dropover', (event, el) => this._itemRemoving(el, true))
2122
- .on(trashEl, 'dropout', (event, el) => this._itemRemoving(el, false));
2123
- }
2134
+ if (typeof this.opts.removable !== 'string')
2135
+ return this;
2136
+ let trashEl = document.querySelector(this.opts.removable);
2137
+ if (!trashEl)
2138
+ return this;
2139
+ // only register ONE static drop-over/dropout callback for the 'trash', and it will
2140
+ // update the passed in item and parent grid because the '.trash' is a shared resource anyway,
2141
+ // and Native DD only has 1 event CB (having a list and technically a per grid removableOptions complicates things greatly)
2142
+ if (!this.opts.staticGrid && !dd.isDroppable(trashEl)) {
2143
+ dd.droppable(trashEl, this.opts.removableOptions)
2144
+ .on(trashEl, 'dropover', (event, el) => GridStack._itemRemoving(el, true))
2145
+ .on(trashEl, 'dropout', (event, el) => GridStack._itemRemoving(el, false));
2124
2146
  }
2125
2147
  return this;
2126
2148
  }
@@ -2375,7 +2397,7 @@ class GridStack {
2375
2397
  node.el = node._isExternal && helper ? helper : el; // point back to real item being dragged
2376
2398
  if (this.opts.removable === true) { // boolean vs a class string
2377
2399
  // item leaving us and we are supposed to remove on leave (no need to drag onto trash) mark it so
2378
- this._itemRemoving(el, true);
2400
+ GridStack._itemRemoving(el, true);
2379
2401
  }
2380
2402
  // finally if item originally came from another grid, but left us, restore things back to prev info
2381
2403
  if (el._gridstackNodeOrig) {
@@ -2400,6 +2422,6 @@ GridStack.resizeToContentParent = '.grid-stack-item-content';
2400
2422
  GridStack.Utils = Utils;
2401
2423
  /** scoping so users can call new GridStack.Engine(12) for example */
2402
2424
  GridStack.Engine = GridStackEngine;
2403
- GridStack.GDRev = '10.1.0';
2425
+ GridStack.GDRev = '10.1.2';
2404
2426
  export { GridStack };
2405
2427
  //# sourceMappingURL=gridstack.js.map