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/gridstack.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* GridStack 9.1.
|
|
2
|
+
* GridStack 9.1.1
|
|
3
3
|
* https://gridstackjs.com/
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021-2022 Alain Dumesny
|
|
@@ -674,7 +674,7 @@ class GridStack {
|
|
|
674
674
|
}
|
|
675
675
|
this.opts.cellHeightUnit = data.unit;
|
|
676
676
|
this.opts.cellHeight = data.h;
|
|
677
|
-
this.doContentResize(false);
|
|
677
|
+
this.doContentResize(false, true); // no anim wait, but use attributes since we only change row height
|
|
678
678
|
if (update) {
|
|
679
679
|
this._updateStyles(true); // true = force re-create for current # of rows
|
|
680
680
|
}
|
|
@@ -866,7 +866,7 @@ class GridStack {
|
|
|
866
866
|
this._prepareElement(el, true, options);
|
|
867
867
|
const node = el.gridstackNode;
|
|
868
868
|
this._updateContainerHeight();
|
|
869
|
-
this.doContentResize(false, node);
|
|
869
|
+
this.doContentResize(false, false, node);
|
|
870
870
|
// see if there is a sub-grid to create
|
|
871
871
|
if (node.subGridOpts) {
|
|
872
872
|
this.makeSubGrid(el, node.subGridOpts, undefined, false); // node.subGrid will be used as option in method, no need to pass
|
|
@@ -1114,71 +1114,69 @@ class GridStack {
|
|
|
1114
1114
|
this._triggerChangeEvent();
|
|
1115
1115
|
this.engine.endUpdate();
|
|
1116
1116
|
}
|
|
1117
|
-
/**
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
}
|
|
1174
|
-
});
|
|
1117
|
+
/**
|
|
1118
|
+
* Updates widget height to match the content height to avoid v-scrollbar or dead space.
|
|
1119
|
+
* 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.
|
|
1120
|
+
* 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
|
|
1121
|
+
**/
|
|
1122
|
+
resizeToContent(el, useAttrSize = false) {
|
|
1123
|
+
el?.classList.remove('size-to-content-max');
|
|
1124
|
+
if (!el?.clientHeight)
|
|
1125
|
+
return; // 0 when hidden, skip
|
|
1126
|
+
let n = el.gridstackNode;
|
|
1127
|
+
if (!n)
|
|
1128
|
+
return;
|
|
1129
|
+
const grid = n.grid;
|
|
1130
|
+
if (!grid)
|
|
1131
|
+
return;
|
|
1132
|
+
if (el.parentElement !== grid.el)
|
|
1133
|
+
return; // skip if we are not inside a grid
|
|
1134
|
+
const cell = grid.getCellHeight();
|
|
1135
|
+
if (!cell)
|
|
1136
|
+
return;
|
|
1137
|
+
let height = useAttrSize && n.h ? n.h * cell : el.clientHeight; // getBoundingClientRect().height seem to flicker back and forth
|
|
1138
|
+
let item;
|
|
1139
|
+
if (n.resizeToContentParent)
|
|
1140
|
+
item = el.querySelector(n.resizeToContentParent);
|
|
1141
|
+
if (!item)
|
|
1142
|
+
item = el.querySelector(GridStack.resizeToContentParent);
|
|
1143
|
+
if (!item)
|
|
1144
|
+
return;
|
|
1145
|
+
const child = item.firstElementChild;
|
|
1146
|
+
// NOTE: clientHeight & getBoundingClientRect() is undefined for text and other leaf nodes. use <div> container!
|
|
1147
|
+
if (!child) {
|
|
1148
|
+
console.log(`Error: resizeToContent() '${GridStack.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
1149
|
+
return;
|
|
1150
|
+
}
|
|
1151
|
+
const padding = el.clientHeight - item.clientHeight; // full - available height to our child (minus border, padding...)
|
|
1152
|
+
const 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)
|
|
1153
|
+
const wantedH = child.getBoundingClientRect().height || itemH;
|
|
1154
|
+
if (itemH === wantedH)
|
|
1155
|
+
return;
|
|
1156
|
+
height += wantedH - itemH;
|
|
1157
|
+
let h = Math.ceil(height / cell);
|
|
1158
|
+
// check for min/max and special sizing
|
|
1159
|
+
const softMax = Number.isInteger(n.sizeToContent) ? n.sizeToContent : 0;
|
|
1160
|
+
if (softMax && h > softMax) {
|
|
1161
|
+
h = softMax;
|
|
1162
|
+
el.classList.add('size-to-content-max'); // get v-scroll back
|
|
1163
|
+
}
|
|
1164
|
+
if (n.minH && h < n.minH)
|
|
1165
|
+
h = n.minH;
|
|
1166
|
+
else if (n.maxH && h > n.maxH)
|
|
1167
|
+
h = n.maxH;
|
|
1168
|
+
if (h !== n.h) {
|
|
1169
|
+
grid._ignoreLayoutsNodeChange = true;
|
|
1170
|
+
grid.moveNode(n, { h });
|
|
1171
|
+
delete grid._ignoreLayoutsNodeChange;
|
|
1172
|
+
}
|
|
1175
1173
|
}
|
|
1176
1174
|
/** call the user resize (so we can do extra work) else our build in version */
|
|
1177
|
-
resizeToContentCheck(el) {
|
|
1175
|
+
resizeToContentCheck(el, useAttr = false) {
|
|
1178
1176
|
if (GridStack.resizeToContentCB)
|
|
1179
1177
|
GridStack.resizeToContentCB(el);
|
|
1180
1178
|
else
|
|
1181
|
-
this.resizeToContent(el);
|
|
1179
|
+
this.resizeToContent(el, useAttr);
|
|
1182
1180
|
}
|
|
1183
1181
|
/**
|
|
1184
1182
|
* 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).
|
|
@@ -1507,24 +1505,24 @@ class GridStack {
|
|
|
1507
1505
|
if (n.subGrid)
|
|
1508
1506
|
n.subGrid.onResize();
|
|
1509
1507
|
});
|
|
1510
|
-
this.doContentResize(columnChanged);
|
|
1508
|
+
this.doContentResize(columnChanged); // wait for anim of column changed (DOM reflow before we can size correctly)
|
|
1511
1509
|
this.batchUpdate(false);
|
|
1512
1510
|
return this;
|
|
1513
1511
|
}
|
|
1514
|
-
doContentResize(delay = true, n = undefined) {
|
|
1512
|
+
doContentResize(delay = true, useAttr = false, n = undefined) {
|
|
1515
1513
|
// update any gridItem height with sizeToContent, but wait for DOM $animation_speed to settle if we changed column count
|
|
1516
1514
|
// 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 ?
|
|
1517
1515
|
setTimeout(() => {
|
|
1518
1516
|
if (n) {
|
|
1519
1517
|
if (Utils.shouldSizeToContent(n))
|
|
1520
|
-
this.resizeToContentCheck(n.el);
|
|
1518
|
+
this.resizeToContentCheck(n.el, useAttr);
|
|
1521
1519
|
}
|
|
1522
1520
|
else {
|
|
1523
1521
|
const nodes = [...this.engine.nodes]; // in case order changes while resizing one
|
|
1524
1522
|
this.batchUpdate();
|
|
1525
1523
|
nodes.forEach(n => {
|
|
1526
1524
|
if (Utils.shouldSizeToContent(n))
|
|
1527
|
-
this.resizeToContentCheck(n.el);
|
|
1525
|
+
this.resizeToContentCheck(n.el, useAttr);
|
|
1528
1526
|
});
|
|
1529
1527
|
this.batchUpdate(false);
|
|
1530
1528
|
}
|
|
@@ -2088,7 +2086,7 @@ class GridStack {
|
|
|
2088
2086
|
if (event.type === 'resizestop') {
|
|
2089
2087
|
if (Number.isInteger(node.sizeToContent))
|
|
2090
2088
|
node.sizeToContent = node.h; // new soft limit
|
|
2091
|
-
this.doContentResize(false, node);
|
|
2089
|
+
this.doContentResize(false, true, node); // no amin wait as will use the actual sized coordinate attr
|
|
2092
2090
|
}
|
|
2093
2091
|
};
|
|
2094
2092
|
dd.draggable(el, {
|
|
@@ -2265,6 +2263,6 @@ GridStack.resizeToContentParent = '.grid-stack-item-content';
|
|
|
2265
2263
|
GridStack.Utils = Utils;
|
|
2266
2264
|
/** scoping so users can call new GridStack.Engine(12) for example */
|
|
2267
2265
|
GridStack.Engine = GridStackEngine;
|
|
2268
|
-
GridStack.GDRev = '9.1.
|
|
2266
|
+
GridStack.GDRev = '9.1.1';
|
|
2269
2267
|
export { GridStack };
|
|
2270
2268
|
//# sourceMappingURL=gridstack.js.map
|