gridstack 9.1.0 → 9.1.1
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/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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +3 -2
- package/dist/es5/gridstack-engine.js.map +1 -1
- package/dist/es5/gridstack-poly.js +1 -1
- package/dist/es5/gridstack.d.ts +8 -5
- package/dist/es5/gridstack.js +70 -70
- package/dist/es5/gridstack.js.map +1 -1
- package/dist/es5/types.d.ts +4 -4
- package/dist/es5/types.js +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/es5/utils.d.ts +1 -1
- package/dist/es5/utils.js +2 -2
- 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 +3 -2
- package/dist/gridstack-engine.js.map +1 -1
- package/dist/gridstack.css +2 -2
- package/dist/gridstack.d.ts +8 -5
- package/dist/gridstack.js +67 -69
- package/dist/gridstack.js.map +1 -1
- package/dist/gridstack.min.css +1 -1
- package/dist/src/gridstack.scss +2 -2
- package/dist/types.d.ts +4 -4
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/dist/utils.js.map +1 -1
- package/doc/CHANGES.md +5 -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 9.1.
|
|
39
|
+
* GridStack 9.1.1
|
|
40
40
|
* https://gridstackjs.com/
|
|
41
41
|
*
|
|
42
42
|
* Copyright (c) 2021-2022 Alain Dumesny
|
|
@@ -730,7 +730,7 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
730
730
|
}
|
|
731
731
|
this.opts.cellHeightUnit = data.unit;
|
|
732
732
|
this.opts.cellHeight = data.h;
|
|
733
|
-
this.doContentResize(false);
|
|
733
|
+
this.doContentResize(false, true); // no anim wait, but use attributes since we only change row height
|
|
734
734
|
if (update) {
|
|
735
735
|
this._updateStyles(true); // true = force re-create for current # of rows
|
|
736
736
|
}
|
|
@@ -928,7 +928,7 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
928
928
|
this._prepareElement(el, true, options);
|
|
929
929
|
var node = el.gridstackNode;
|
|
930
930
|
this._updateContainerHeight();
|
|
931
|
-
this.doContentResize(false, node);
|
|
931
|
+
this.doContentResize(false, false, node);
|
|
932
932
|
// see if there is a sub-grid to create
|
|
933
933
|
if (node.subGridOpts) {
|
|
934
934
|
this.makeSubGrid(el, node.subGridOpts, undefined, false); // node.subGrid will be used as option in method, no need to pass
|
|
@@ -1189,72 +1189,71 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
1189
1189
|
this._triggerChangeEvent();
|
|
1190
1190
|
this.engine.endUpdate();
|
|
1191
1191
|
};
|
|
1192
|
-
/**
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
}
|
|
1250
|
-
});
|
|
1192
|
+
/**
|
|
1193
|
+
* Updates widget height to match the content height to avoid v-scrollbar or dead space.
|
|
1194
|
+
* Note: this assumes only 1 child under resizeToContentParent='.grid-stack-item-content' (sized to gridItem minus padding) that is at the entire content size wanted.
|
|
1195
|
+
* useAttrSize set to true if GridStackNode.h should be used instead of actual container height when we don't need to wait for animation to finish to get actual DOM heights
|
|
1196
|
+
**/
|
|
1197
|
+
GridStack.prototype.resizeToContent = function (el, useAttrSize) {
|
|
1198
|
+
if (useAttrSize === void 0) { useAttrSize = false; }
|
|
1199
|
+
el === null || el === void 0 ? void 0 : el.classList.remove('size-to-content-max');
|
|
1200
|
+
if (!(el === null || el === void 0 ? void 0 : el.clientHeight))
|
|
1201
|
+
return; // 0 when hidden, skip
|
|
1202
|
+
var n = el.gridstackNode;
|
|
1203
|
+
if (!n)
|
|
1204
|
+
return;
|
|
1205
|
+
var grid = n.grid;
|
|
1206
|
+
if (!grid)
|
|
1207
|
+
return;
|
|
1208
|
+
if (el.parentElement !== grid.el)
|
|
1209
|
+
return; // skip if we are not inside a grid
|
|
1210
|
+
var cell = grid.getCellHeight();
|
|
1211
|
+
if (!cell)
|
|
1212
|
+
return;
|
|
1213
|
+
var height = useAttrSize && n.h ? n.h * cell : el.clientHeight; // getBoundingClientRect().height seem to flicker back and forth
|
|
1214
|
+
var item;
|
|
1215
|
+
if (n.resizeToContentParent)
|
|
1216
|
+
item = el.querySelector(n.resizeToContentParent);
|
|
1217
|
+
if (!item)
|
|
1218
|
+
item = el.querySelector(GridStack.resizeToContentParent);
|
|
1219
|
+
if (!item)
|
|
1220
|
+
return;
|
|
1221
|
+
var child = item.firstElementChild;
|
|
1222
|
+
// NOTE: clientHeight & getBoundingClientRect() is undefined for text and other leaf nodes. use <div> container!
|
|
1223
|
+
if (!child) {
|
|
1224
|
+
console.log("Error: resizeToContent() '".concat(GridStack.resizeToContentParent, "'.firstElementChild is null, make sure to have a div like container. Skipping sizing."));
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1227
|
+
var padding = el.clientHeight - item.clientHeight; // full - available height to our child (minus border, padding...)
|
|
1228
|
+
var itemH = useAttrSize && n.h ? n.h * cell - padding : item.clientHeight; // calculated to what cellHeight is or will become (rather than actual to prevent waiting for animation to finish)
|
|
1229
|
+
var wantedH = child.getBoundingClientRect().height || itemH;
|
|
1230
|
+
if (itemH === wantedH)
|
|
1231
|
+
return;
|
|
1232
|
+
height += wantedH - itemH;
|
|
1233
|
+
var h = Math.ceil(height / cell);
|
|
1234
|
+
// check for min/max and special sizing
|
|
1235
|
+
var softMax = Number.isInteger(n.sizeToContent) ? n.sizeToContent : 0;
|
|
1236
|
+
if (softMax && h > softMax) {
|
|
1237
|
+
h = softMax;
|
|
1238
|
+
el.classList.add('size-to-content-max'); // get v-scroll back
|
|
1239
|
+
}
|
|
1240
|
+
if (n.minH && h < n.minH)
|
|
1241
|
+
h = n.minH;
|
|
1242
|
+
else if (n.maxH && h > n.maxH)
|
|
1243
|
+
h = n.maxH;
|
|
1244
|
+
if (h !== n.h) {
|
|
1245
|
+
grid._ignoreLayoutsNodeChange = true;
|
|
1246
|
+
grid.moveNode(n, { h: h });
|
|
1247
|
+
delete grid._ignoreLayoutsNodeChange;
|
|
1248
|
+
}
|
|
1251
1249
|
};
|
|
1252
1250
|
/** call the user resize (so we can do extra work) else our build in version */
|
|
1253
|
-
GridStack.prototype.resizeToContentCheck = function (el) {
|
|
1251
|
+
GridStack.prototype.resizeToContentCheck = function (el, useAttr) {
|
|
1252
|
+
if (useAttr === void 0) { useAttr = false; }
|
|
1254
1253
|
if (GridStack.resizeToContentCB)
|
|
1255
1254
|
GridStack.resizeToContentCB(el);
|
|
1256
1255
|
else
|
|
1257
|
-
this.resizeToContent(el);
|
|
1256
|
+
this.resizeToContent(el, useAttr);
|
|
1258
1257
|
};
|
|
1259
1258
|
/**
|
|
1260
1259
|
* 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).
|
|
@@ -1590,27 +1589,28 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
1590
1589
|
if (n.subGrid)
|
|
1591
1590
|
n.subGrid.onResize();
|
|
1592
1591
|
});
|
|
1593
|
-
this.doContentResize(columnChanged);
|
|
1592
|
+
this.doContentResize(columnChanged); // wait for anim of column changed (DOM reflow before we can size correctly)
|
|
1594
1593
|
this.batchUpdate(false);
|
|
1595
1594
|
return this;
|
|
1596
1595
|
};
|
|
1597
|
-
GridStack.prototype.doContentResize = function (delay, n) {
|
|
1596
|
+
GridStack.prototype.doContentResize = function (delay, useAttr, n) {
|
|
1598
1597
|
var _this = this;
|
|
1599
1598
|
if (delay === void 0) { delay = true; }
|
|
1599
|
+
if (useAttr === void 0) { useAttr = false; }
|
|
1600
1600
|
if (n === void 0) { n = undefined; }
|
|
1601
1601
|
// update any gridItem height with sizeToContent, but wait for DOM $animation_speed to settle if we changed column count
|
|
1602
1602
|
// 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 ?
|
|
1603
1603
|
setTimeout(function () {
|
|
1604
1604
|
if (n) {
|
|
1605
1605
|
if (utils_1.Utils.shouldSizeToContent(n))
|
|
1606
|
-
_this.resizeToContentCheck(n.el);
|
|
1606
|
+
_this.resizeToContentCheck(n.el, useAttr);
|
|
1607
1607
|
}
|
|
1608
1608
|
else {
|
|
1609
1609
|
var nodes = __spreadArray([], _this.engine.nodes, true); // in case order changes while resizing one
|
|
1610
1610
|
_this.batchUpdate();
|
|
1611
1611
|
nodes.forEach(function (n) {
|
|
1612
1612
|
if (utils_1.Utils.shouldSizeToContent(n))
|
|
1613
|
-
_this.resizeToContentCheck(n.el);
|
|
1613
|
+
_this.resizeToContentCheck(n.el, useAttr);
|
|
1614
1614
|
});
|
|
1615
1615
|
_this.batchUpdate(false);
|
|
1616
1616
|
}
|
|
@@ -2196,7 +2196,7 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
2196
2196
|
if (event.type === 'resizestop') {
|
|
2197
2197
|
if (Number.isInteger(node.sizeToContent))
|
|
2198
2198
|
node.sizeToContent = node.h; // new soft limit
|
|
2199
|
-
_this.doContentResize(false, node);
|
|
2199
|
+
_this.doContentResize(false, true, node); // no amin wait as will use the actual sized coordinate attr
|
|
2200
2200
|
}
|
|
2201
2201
|
};
|
|
2202
2202
|
dd.draggable(el, {
|
|
@@ -2372,7 +2372,7 @@ var GridStack = exports.GridStack = /** @class */ (function () {
|
|
|
2372
2372
|
GridStack.Utils = utils_1.Utils;
|
|
2373
2373
|
/** scoping so users can call new GridStack.Engine(12) for example */
|
|
2374
2374
|
GridStack.Engine = gridstack_engine_1.GridStackEngine;
|
|
2375
|
-
GridStack.GDRev = '9.1.
|
|
2375
|
+
GridStack.GDRev = '9.1.1';
|
|
2376
2376
|
return GridStack;
|
|
2377
2377
|
}());
|
|
2378
2378
|
//# sourceMappingURL=gridstack.js.map
|