gridstack 8.4.0 → 9.0.0
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.
- package/README.md +9 -2
- package/angular/projects/lib/package.json +1 -1
- package/angular/projects/lib/src/lib/base-widget.ts +1 -1
- package/angular/projects/lib/src/lib/gridstack-item.component.ts +1 -1
- package/angular/projects/lib/src/lib/gridstack.component.ts +1 -1
- package/angular/projects/lib/src/lib/gridstack.module.ts +1 -1
- package/dist/angular/esm2020/lib/base-widget.mjs +2 -2
- package/dist/angular/esm2020/lib/gridstack-item.component.mjs +2 -2
- package/dist/angular/esm2020/lib/gridstack.component.mjs +2 -2
- package/dist/angular/esm2020/lib/gridstack.module.mjs +2 -2
- package/dist/angular/fesm2015/gridstack-angular.mjs +4 -4
- package/dist/angular/fesm2015/gridstack-angular.mjs.map +1 -1
- package/dist/angular/fesm2020/gridstack-angular.mjs +4 -4
- package/dist/angular/fesm2020/gridstack-angular.mjs.map +1 -1
- package/dist/angular/lib/gridstack-item.component.d.ts +1 -1
- package/dist/angular/lib/gridstack.component.d.ts +1 -1
- package/dist/angular/package.json +1 -1
- package/dist/angular/src/base-widget.ts +1 -1
- package/dist/angular/src/gridstack-item.component.ts +1 -1
- package/dist/angular/src/gridstack.component.ts +1 -1
- package/dist/angular/src/gridstack.module.ts +1 -1
- package/dist/dd-base-impl.d.ts +1 -1
- package/dist/dd-base-impl.js +1 -1
- package/dist/dd-base-impl.js.map +1 -1
- package/dist/dd-draggable.d.ts +1 -1
- package/dist/dd-draggable.js +1 -1
- package/dist/dd-draggable.js.map +1 -1
- package/dist/dd-droppable.d.ts +1 -1
- package/dist/dd-droppable.js +1 -1
- package/dist/dd-droppable.js.map +1 -1
- package/dist/dd-element.d.ts +1 -1
- package/dist/dd-element.js +1 -1
- package/dist/dd-element.js.map +1 -1
- package/dist/dd-gridstack.d.ts +1 -1
- package/dist/dd-gridstack.js +1 -1
- package/dist/dd-gridstack.js.map +1 -1
- package/dist/dd-manager.d.ts +1 -1
- package/dist/dd-manager.js +1 -1
- package/dist/dd-manager.js.map +1 -1
- package/dist/dd-resizable-handle.d.ts +1 -1
- package/dist/dd-resizable-handle.js +1 -1
- package/dist/dd-resizable-handle.js.map +1 -1
- package/dist/dd-resizable.d.ts +1 -1
- package/dist/dd-resizable.js +1 -1
- package/dist/dd-resizable.js.map +1 -1
- package/dist/dd-touch.d.ts +1 -1
- package/dist/dd-touch.js +1 -1
- package/dist/dd-touch.js.map +1 -1
- package/dist/es5/dd-base-impl.d.ts +1 -1
- package/dist/es5/dd-base-impl.js +1 -1
- package/dist/es5/dd-base-impl.js.map +1 -1
- package/dist/es5/dd-draggable.d.ts +1 -1
- package/dist/es5/dd-draggable.js +1 -1
- package/dist/es5/dd-draggable.js.map +1 -1
- package/dist/es5/dd-droppable.d.ts +1 -1
- package/dist/es5/dd-droppable.js +1 -1
- package/dist/es5/dd-droppable.js.map +1 -1
- package/dist/es5/dd-element.d.ts +1 -1
- package/dist/es5/dd-element.js +1 -1
- package/dist/es5/dd-element.js.map +1 -1
- package/dist/es5/dd-gridstack.d.ts +1 -1
- package/dist/es5/dd-gridstack.js +1 -1
- package/dist/es5/dd-gridstack.js.map +1 -1
- package/dist/es5/dd-manager.d.ts +1 -1
- package/dist/es5/dd-manager.js +1 -1
- package/dist/es5/dd-manager.js.map +1 -1
- package/dist/es5/dd-resizable-handle.d.ts +1 -1
- package/dist/es5/dd-resizable-handle.js +1 -1
- package/dist/es5/dd-resizable-handle.js.map +1 -1
- package/dist/es5/dd-resizable.d.ts +1 -1
- package/dist/es5/dd-resizable.js +1 -1
- package/dist/es5/dd-resizable.js.map +1 -1
- package/dist/es5/dd-touch.d.ts +1 -1
- package/dist/es5/dd-touch.js +1 -1
- package/dist/es5/dd-touch.js.map +1 -1
- package/dist/es5/gridstack-all.js +1 -1
- package/dist/es5/gridstack-all.js.LICENSE.txt +1 -1
- package/dist/es5/gridstack-all.js.map +1 -1
- package/dist/es5/gridstack-engine.d.ts +1 -1
- package/dist/es5/gridstack-engine.js +19 -13
- package/dist/es5/gridstack-engine.js.map +1 -1
- package/dist/es5/gridstack-poly.js +1 -1
- package/dist/es5/gridstack.d.ts +21 -8
- package/dist/es5/gridstack.js +128 -55
- package/dist/es5/gridstack.js.map +1 -1
- package/dist/es5/types.d.ts +7 -1
- package/dist/es5/types.js +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/es5/utils.d.ts +3 -1
- package/dist/es5/utils.js +5 -1
- package/dist/es5/utils.js.map +1 -1
- package/dist/gridstack-all.js +1 -1
- package/dist/gridstack-all.js.LICENSE.txt +1 -1
- package/dist/gridstack-all.js.map +1 -1
- package/dist/gridstack-engine.d.ts +1 -1
- package/dist/gridstack-engine.js +17 -13
- package/dist/gridstack-engine.js.map +1 -1
- package/dist/gridstack.css +4 -1
- package/dist/gridstack.d.ts +21 -8
- package/dist/gridstack.js +121 -54
- package/dist/gridstack.js.map +1 -1
- package/dist/gridstack.min.css +1 -1
- package/dist/src/gridstack.scss +4 -1
- package/dist/types.d.ts +7 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +3 -1
- package/dist/utils.js +5 -1
- package/dist/utils.js.map +1 -1
- package/doc/CHANGES.md +6 -0
- package/doc/README.md +2 -0
- package/package.json +1 -1
package/dist/es5/gridstack.js
CHANGED
|
@@ -36,7 +36,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.GridStack = void 0;
|
|
38
38
|
/*!
|
|
39
|
-
* GridStack
|
|
39
|
+
* GridStack 9.0.0
|
|
40
40
|
* https://gridstackjs.com/
|
|
41
41
|
*
|
|
42
42
|
* Copyright (c) 2021-2022 Alain Dumesny
|
|
@@ -202,7 +202,7 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
202
202
|
dd_manager_1.DDManager.pauseDrag = this.opts.draggable.pause;
|
|
203
203
|
this._setupRemoveDrop();
|
|
204
204
|
this._setupAcceptWidget();
|
|
205
|
-
this.
|
|
205
|
+
this._updateResizeEvent();
|
|
206
206
|
}
|
|
207
207
|
/**
|
|
208
208
|
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
|
|
@@ -666,6 +666,7 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
666
666
|
if (flag === void 0) { flag = true; }
|
|
667
667
|
this.engine.batchUpdate(flag);
|
|
668
668
|
if (!flag) {
|
|
669
|
+
this._updateContainerHeight();
|
|
669
670
|
this._triggerRemoveEvent();
|
|
670
671
|
this._triggerAddEvent();
|
|
671
672
|
this._triggerChangeEvent();
|
|
@@ -711,7 +712,7 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
711
712
|
if (update && val !== undefined) {
|
|
712
713
|
if (this._isAutoCellHeight !== (val === 'auto')) {
|
|
713
714
|
this._isAutoCellHeight = (val === 'auto');
|
|
714
|
-
this.
|
|
715
|
+
this._updateResizeEvent();
|
|
715
716
|
}
|
|
716
717
|
}
|
|
717
718
|
if (val === 'initial' || val === 'auto') {
|
|
@@ -769,7 +770,7 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
769
770
|
*/
|
|
770
771
|
GridStack.prototype.column = function (column, layout) {
|
|
771
772
|
if (layout === void 0) { layout = 'moveScale'; }
|
|
772
|
-
if (column < 1 || this.opts.column === column)
|
|
773
|
+
if (!column || column < 1 || this.opts.column === column)
|
|
773
774
|
return this;
|
|
774
775
|
var oldColumn = this.getColumn();
|
|
775
776
|
// if we go into 1 column mode (which happens if we're sized less than minW unless disableOneColumnMode is on)
|
|
@@ -799,6 +800,7 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
799
800
|
this.engine.columnChanged(oldColumn, column, domNodes, layout);
|
|
800
801
|
if (this._isAutoCellHeight)
|
|
801
802
|
this.cellHeight();
|
|
803
|
+
this.doContentResize();
|
|
802
804
|
// and trigger our event last...
|
|
803
805
|
this._ignoreLayoutsNodeChange = true; // skip layout update
|
|
804
806
|
this._triggerChangeEvent();
|
|
@@ -826,7 +828,7 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
826
828
|
if (!this.el)
|
|
827
829
|
return; // prevent multiple calls
|
|
828
830
|
this.offAll();
|
|
829
|
-
this.
|
|
831
|
+
this._updateResizeEvent(true);
|
|
830
832
|
this.setStatic(true, false); // permanently removes DD but don't set CSS class (we're going away)
|
|
831
833
|
this.setAnimation(false);
|
|
832
834
|
if (!removeDOM) {
|
|
@@ -974,7 +976,8 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
974
976
|
}
|
|
975
977
|
this.el.addEventListener(name, this._gsEventHandler[name]);
|
|
976
978
|
}
|
|
977
|
-
else if (name === 'drag' || name === 'dragstart' || name === 'dragstop' || name === 'resizestart' || name === 'resize'
|
|
979
|
+
else if (name === 'drag' || name === 'dragstart' || name === 'dragstop' || name === 'resizestart' || name === 'resize'
|
|
980
|
+
|| name === 'resizestop' || name === 'dropped' || name === 'resizecontent') {
|
|
978
981
|
// drag&drop stop events NEED to be call them AFTER we update node attributes so handle them ourself.
|
|
979
982
|
// do same for start event to make it easier...
|
|
980
983
|
this._gsEventHandler[name] = callback;
|
|
@@ -1165,14 +1168,8 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
1165
1168
|
}
|
|
1166
1169
|
utils_1.Utils.sanitizeMinMax(n);
|
|
1167
1170
|
// finally move the widget
|
|
1168
|
-
if (m)
|
|
1169
|
-
_this.
|
|
1170
|
-
.beginUpdate(n)
|
|
1171
|
-
.moveNode(n, m);
|
|
1172
|
-
_this._updateContainerHeight();
|
|
1173
|
-
_this._triggerChangeEvent();
|
|
1174
|
-
_this.engine.endUpdate();
|
|
1175
|
-
}
|
|
1171
|
+
if (m)
|
|
1172
|
+
_this.moveNode(n, m);
|
|
1176
1173
|
if (changed) { // move will only update x,y,w,h so update the rest too
|
|
1177
1174
|
_this._writeAttr(el, n);
|
|
1178
1175
|
}
|
|
@@ -1182,6 +1179,56 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
1182
1179
|
});
|
|
1183
1180
|
return this;
|
|
1184
1181
|
};
|
|
1182
|
+
GridStack.prototype.moveNode = function (n, m) {
|
|
1183
|
+
this.engine.cleanNodes()
|
|
1184
|
+
.beginUpdate(n)
|
|
1185
|
+
.moveNode(n, m);
|
|
1186
|
+
this._updateContainerHeight();
|
|
1187
|
+
this._triggerChangeEvent();
|
|
1188
|
+
this.engine.endUpdate();
|
|
1189
|
+
};
|
|
1190
|
+
/** Updates widget height to match the content height to avoid v-scrollbar or dead space.
|
|
1191
|
+
Note: this assumes only 1 child under '.grid-stack-item-content' (sized to gridItem minus padding) that is at the entire content size wanted */
|
|
1192
|
+
GridStack.prototype.resizeToContent = function (els) {
|
|
1193
|
+
var _this = this;
|
|
1194
|
+
GridStack.getElements(els).forEach(function (el) {
|
|
1195
|
+
var _a;
|
|
1196
|
+
var n = el === null || el === void 0 ? void 0 : el.gridstackNode;
|
|
1197
|
+
if (!n)
|
|
1198
|
+
return;
|
|
1199
|
+
if (el.parentElement !== n.grid.el)
|
|
1200
|
+
return; // skip if we are not inside a grid
|
|
1201
|
+
var height = el.clientHeight; // getBoundingClientRect().height seem to flicker back and forth
|
|
1202
|
+
if (!height)
|
|
1203
|
+
return; // 0 when hidden, skip
|
|
1204
|
+
var item = el.querySelector(GridStack.resizeToContentParent);
|
|
1205
|
+
if (!item)
|
|
1206
|
+
return;
|
|
1207
|
+
var itemH = item.clientHeight; // available height to our child (minus border, padding...)
|
|
1208
|
+
var wantedH = ((_a = item.firstChild) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height) || itemH; // NOTE: clientHeight & getBoundingClientRect() is undefined for text and other leaf nodes. use <div> container!
|
|
1209
|
+
if (itemH === wantedH)
|
|
1210
|
+
return;
|
|
1211
|
+
height += wantedH - itemH;
|
|
1212
|
+
var cell = _this.getCellHeight();
|
|
1213
|
+
if (!cell)
|
|
1214
|
+
return;
|
|
1215
|
+
var h = Math.ceil(height / cell);
|
|
1216
|
+
if (n.maxH && h > n.maxH)
|
|
1217
|
+
h = n.maxH;
|
|
1218
|
+
if (h !== n.h) {
|
|
1219
|
+
_this._ignoreLayoutsNodeChange = true;
|
|
1220
|
+
_this.moveNode(n, { h: h });
|
|
1221
|
+
delete _this._ignoreLayoutsNodeChange;
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
};
|
|
1225
|
+
/** call the user resize (so we can do extra work) else our build in version */
|
|
1226
|
+
GridStack.prototype.resizeToContentCheck = function (el) {
|
|
1227
|
+
if (GridStack.resizeToContentCB)
|
|
1228
|
+
GridStack.resizeToContentCB(el);
|
|
1229
|
+
else
|
|
1230
|
+
this.resizeToContent(el);
|
|
1231
|
+
};
|
|
1185
1232
|
/**
|
|
1186
1233
|
* Updates the margins which will set all 4 sides at once - see `GridStackOptions.margin` for format options (CSS string format of 1,2,4 values or single number).
|
|
1187
1234
|
* @param value margin value
|
|
@@ -1379,6 +1426,8 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
1379
1426
|
if (!utils_1.Utils.same(node, copy)) {
|
|
1380
1427
|
this._writeAttr(el, node);
|
|
1381
1428
|
}
|
|
1429
|
+
if (utils_1.Utils.shouldFitToContent(node))
|
|
1430
|
+
el.classList.add('fit-to-content');
|
|
1382
1431
|
this._prepareDragDropByNode(node);
|
|
1383
1432
|
return this;
|
|
1384
1433
|
};
|
|
@@ -1474,67 +1523,87 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
1474
1523
|
return this;
|
|
1475
1524
|
};
|
|
1476
1525
|
/**
|
|
1477
|
-
* called when we are being resized
|
|
1478
|
-
* and remember the prev columns we used, or get our count from parent, as well as check for auto
|
|
1526
|
+
* called when we are being resized - check if the one Column Mode needs to be turned on/off
|
|
1527
|
+
* and remember the prev columns we used, or get our count from parent, as well as check for cellHeight==='auto' (square)
|
|
1528
|
+
* or `fitToContent` gridItem options.
|
|
1479
1529
|
*/
|
|
1480
|
-
GridStack.prototype.
|
|
1481
|
-
var
|
|
1482
|
-
if (!this.el ||
|
|
1530
|
+
GridStack.prototype.onResize = function () {
|
|
1531
|
+
var _a;
|
|
1532
|
+
if (!((_a = this.el) === null || _a === void 0 ? void 0 : _a.clientWidth))
|
|
1483
1533
|
return; // return if we're gone or no size yet (will get called again)
|
|
1484
|
-
|
|
1534
|
+
if (this.prevWidth === this.el.clientWidth)
|
|
1535
|
+
return; // no-op
|
|
1536
|
+
this.prevWidth = this.el.clientWidth;
|
|
1537
|
+
// console.log('onResize ', this.el.clientWidth);
|
|
1538
|
+
this.batchUpdate();
|
|
1485
1539
|
// see if we're nested and take our column count from our parent....
|
|
1540
|
+
var columnChanged = false;
|
|
1486
1541
|
if (this._autoColumn && this.parentGridItem) {
|
|
1487
1542
|
if (this.opts.column !== this.parentGridItem.w) {
|
|
1488
|
-
changedColumn = true;
|
|
1489
1543
|
this.column(this.parentGridItem.w, 'none');
|
|
1544
|
+
columnChanged = true;
|
|
1490
1545
|
}
|
|
1491
1546
|
}
|
|
1492
1547
|
else {
|
|
1493
1548
|
// else check for 1 column in/out behavior
|
|
1494
|
-
var oneColumn = !this.opts.disableOneColumnMode && this.el.clientWidth <= this.opts.oneColumnSize
|
|
1549
|
+
var oneColumn = !this.opts.disableOneColumnMode && this.el.clientWidth <= this.opts.oneColumnSize ||
|
|
1550
|
+
(this.opts.column === 1 && !this._prevColumn);
|
|
1495
1551
|
if ((this.opts.column === 1) !== oneColumn) {
|
|
1496
|
-
|
|
1497
|
-
if (this.opts.animate) {
|
|
1498
|
-
this.setAnimation(false);
|
|
1499
|
-
} // 1 <-> 12 is too radical, turn off animation
|
|
1552
|
+
// if (this.opts.animate) this.setAnimation(false); // 1 <-> 12 is too radical, turn off animation and we need it for fitToContent
|
|
1500
1553
|
this.column(oneColumn ? 1 : this._prevColumn);
|
|
1501
|
-
if (this.opts.animate)
|
|
1502
|
-
|
|
1503
|
-
}
|
|
1554
|
+
// if (this.opts.animate) setTimeout(() => this.setAnimation(true));
|
|
1555
|
+
columnChanged = true;
|
|
1504
1556
|
}
|
|
1505
1557
|
}
|
|
1506
1558
|
// make the cells content square again
|
|
1507
|
-
if (this._isAutoCellHeight)
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
this._cellHeightThrottle = utils_1.Utils.throttle(function () { return _this.cellHeight(); }, this.opts.cellHeightThrottle);
|
|
1511
|
-
}
|
|
1512
|
-
this._cellHeightThrottle();
|
|
1513
|
-
}
|
|
1514
|
-
else {
|
|
1515
|
-
// immediate update if we've changed column count or have no threshold
|
|
1516
|
-
this.cellHeight();
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
// finally update any nested grids
|
|
1559
|
+
if (this._isAutoCellHeight)
|
|
1560
|
+
this.cellHeight();
|
|
1561
|
+
// update any nested grids, or items size
|
|
1520
1562
|
this.engine.nodes.forEach(function (n) {
|
|
1521
1563
|
if (n.subGrid)
|
|
1522
|
-
n.subGrid.
|
|
1564
|
+
n.subGrid.onResize();
|
|
1523
1565
|
});
|
|
1566
|
+
this.doContentResize(columnChanged);
|
|
1567
|
+
this.batchUpdate(false);
|
|
1524
1568
|
return this;
|
|
1525
1569
|
};
|
|
1526
|
-
|
|
1527
|
-
|
|
1570
|
+
GridStack.prototype.doContentResize = function (delay, n) {
|
|
1571
|
+
var _this = this;
|
|
1572
|
+
if (delay === void 0) { delay = true; }
|
|
1573
|
+
if (n === void 0) { n = undefined; }
|
|
1574
|
+
// update any gridItem height with fitToContent, but wait for DOM $animation_speed to settle if we changed column count
|
|
1575
|
+
// TODO: is there a way to know what the final (post animation) size of the content will be so we can animate the column width and height together rather than sequentially ?
|
|
1576
|
+
setTimeout(function () {
|
|
1577
|
+
if (n) {
|
|
1578
|
+
if (utils_1.Utils.shouldFitToContent(n))
|
|
1579
|
+
_this.resizeToContentCheck(n.el);
|
|
1580
|
+
}
|
|
1581
|
+
else {
|
|
1582
|
+
_this.engine.nodes.forEach(function (n) {
|
|
1583
|
+
if (utils_1.Utils.shouldFitToContent(n))
|
|
1584
|
+
_this.resizeToContentCheck(n.el);
|
|
1585
|
+
});
|
|
1586
|
+
}
|
|
1587
|
+
if (_this._gsEventHandler['resizeContent'])
|
|
1588
|
+
_this._gsEventHandler['resizeContent'](null, n ? [n] : _this.engine.nodes);
|
|
1589
|
+
}, delay ? 300 + 10 : 0);
|
|
1590
|
+
};
|
|
1591
|
+
/** add or remove the grid element size event handler */
|
|
1592
|
+
GridStack.prototype._updateResizeEvent = function (forceRemove) {
|
|
1593
|
+
var _this = this;
|
|
1528
1594
|
if (forceRemove === void 0) { forceRemove = false; }
|
|
1529
1595
|
// only add event if we're not nested (parent will call us) and we're auto sizing cells or supporting oneColumn (i.e. doing work)
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1596
|
+
// or supporting new fitToContent option.
|
|
1597
|
+
var trackSize = !this.parentGridItem && (this._isAutoCellHeight || this.opts.fitToContent || !this.opts.disableOneColumnMode || this.engine.nodes.find(function (n) { return n.fitToContent; }));
|
|
1598
|
+
if (!forceRemove && trackSize && !this.resizeObserver) {
|
|
1599
|
+
this._sizeThrottle = utils_1.Utils.throttle(function () { return _this.onResize(); }, this.opts.cellHeightThrottle);
|
|
1600
|
+
this.resizeObserver = new ResizeObserver(function (entries) { return _this._sizeThrottle(); });
|
|
1601
|
+
this.resizeObserver.observe(this.el);
|
|
1602
|
+
}
|
|
1603
|
+
else if ((forceRemove || !trackSize) && this.resizeObserver) {
|
|
1604
|
+
this.resizeObserver.disconnect();
|
|
1605
|
+
delete this.resizeObserver;
|
|
1606
|
+
delete this._sizeThrottle;
|
|
1538
1607
|
}
|
|
1539
1608
|
return this;
|
|
1540
1609
|
};
|
|
@@ -2094,6 +2163,8 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
2094
2163
|
_this._updateContainerHeight(); // @ts-ignore
|
|
2095
2164
|
_this._triggerChangeEvent();
|
|
2096
2165
|
_this.engine.endUpdate();
|
|
2166
|
+
if (event.type === 'resizestop')
|
|
2167
|
+
_this.doContentResize(false, node);
|
|
2097
2168
|
};
|
|
2098
2169
|
dd.draggable(el, {
|
|
2099
2170
|
start: onStartMoving,
|
|
@@ -2217,7 +2288,7 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
2217
2288
|
this.engine.cacheRects(cellWidth, cellHeight, mTop, mRight, mBottom, mLeft);
|
|
2218
2289
|
delete node._skipDown;
|
|
2219
2290
|
if (resizing && node.subGrid)
|
|
2220
|
-
node.subGrid.
|
|
2291
|
+
node.subGrid.onResize();
|
|
2221
2292
|
this._extraDragRow = 0; // @ts-ignore
|
|
2222
2293
|
this._updateContainerHeight();
|
|
2223
2294
|
var target = event.target; // @ts-ignore
|
|
@@ -2262,11 +2333,13 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
2262
2333
|
};
|
|
2263
2334
|
// legacy method removed
|
|
2264
2335
|
GridStack.prototype.commit = function () { (0, utils_1.obsolete)(this, this.batchUpdate(false), 'commit', 'batchUpdate', '5.2'); return this; };
|
|
2336
|
+
/** parent class for sizing content. defaults to '.grid-stack-item-content' */
|
|
2337
|
+
GridStack.resizeToContentParent = '.grid-stack-item-content';
|
|
2265
2338
|
/** scoping so users can call GridStack.Utils.sort() for example */
|
|
2266
2339
|
GridStack.Utils = utils_1.Utils;
|
|
2267
2340
|
/** scoping so users can call new GridStack.Engine(12) for example */
|
|
2268
2341
|
GridStack.Engine = gridstack_engine_1.GridStackEngine;
|
|
2269
|
-
GridStack.GDRev = '
|
|
2342
|
+
GridStack.GDRev = '9.0.0';
|
|
2270
2343
|
return GridStack;
|
|
2271
2344
|
}());
|
|
2272
2345
|
//# sourceMappingURL=gridstack.js.map
|