gridstack 12.3.0 → 12.3.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.
Files changed (64) hide show
  1. package/dist/angular/esm2020/lib/base-widget.mjs +2 -2
  2. package/dist/angular/esm2020/lib/gridstack-item.component.mjs +2 -2
  3. package/dist/angular/esm2020/lib/gridstack.component.mjs +2 -2
  4. package/dist/angular/esm2020/lib/gridstack.module.mjs +2 -2
  5. package/dist/angular/esm2020/lib/types.mjs +2 -2
  6. package/dist/angular/fesm2015/gridstack-angular.mjs +4 -4
  7. package/dist/angular/fesm2015/gridstack-angular.mjs.map +1 -1
  8. package/dist/angular/fesm2020/gridstack-angular.mjs +5 -5
  9. package/dist/angular/fesm2020/gridstack-angular.mjs.map +1 -1
  10. package/dist/angular/lib/gridstack-item.component.d.ts +1 -1
  11. package/dist/angular/lib/gridstack.component.d.ts +1 -1
  12. package/dist/angular/lib/types.d.ts +1 -1
  13. package/dist/angular/package.json +1 -1
  14. package/dist/angular/src/base-widget.ts +1 -1
  15. package/dist/angular/src/gridstack-item.component.ts +1 -1
  16. package/dist/angular/src/gridstack.component.ts +1 -1
  17. package/dist/angular/src/gridstack.module.ts +1 -1
  18. package/dist/angular/src/types.ts +1 -1
  19. package/dist/dd-base-impl.d.ts +1 -1
  20. package/dist/dd-base-impl.js +1 -1
  21. package/dist/dd-base-impl.js.map +1 -1
  22. package/dist/dd-draggable.d.ts +1 -1
  23. package/dist/dd-draggable.js +1 -1
  24. package/dist/dd-draggable.js.map +1 -1
  25. package/dist/dd-droppable.d.ts +1 -1
  26. package/dist/dd-droppable.js +1 -1
  27. package/dist/dd-droppable.js.map +1 -1
  28. package/dist/dd-element.d.ts +1 -1
  29. package/dist/dd-element.js +1 -1
  30. package/dist/dd-element.js.map +1 -1
  31. package/dist/dd-gridstack.d.ts +1 -1
  32. package/dist/dd-gridstack.js +1 -1
  33. package/dist/dd-gridstack.js.map +1 -1
  34. package/dist/dd-manager.d.ts +1 -1
  35. package/dist/dd-manager.js +1 -1
  36. package/dist/dd-manager.js.map +1 -1
  37. package/dist/dd-resizable-handle.d.ts +1 -1
  38. package/dist/dd-resizable-handle.js +1 -1
  39. package/dist/dd-resizable-handle.js.map +1 -1
  40. package/dist/dd-resizable.d.ts +1 -1
  41. package/dist/dd-resizable.js +1 -1
  42. package/dist/dd-resizable.js.map +1 -1
  43. package/dist/dd-touch.d.ts +1 -1
  44. package/dist/dd-touch.js +1 -1
  45. package/dist/dd-touch.js.map +1 -1
  46. package/dist/gridstack-all.js +1 -1
  47. package/dist/gridstack-all.js.LICENSE.txt +1 -1
  48. package/dist/gridstack-all.js.map +1 -1
  49. package/dist/gridstack-engine.d.ts +7 -3
  50. package/dist/gridstack-engine.js +9 -4
  51. package/dist/gridstack-engine.js.map +1 -1
  52. package/dist/gridstack.css +1 -1
  53. package/dist/gridstack.d.ts +5 -2
  54. package/dist/gridstack.js +10 -7
  55. package/dist/gridstack.js.map +1 -1
  56. package/dist/src/gridstack.scss +1 -1
  57. package/dist/types.d.ts +1 -1
  58. package/dist/types.js +1 -1
  59. package/dist/types.js.map +1 -1
  60. package/dist/utils.d.ts +1 -1
  61. package/dist/utils.js +4 -5
  62. package/dist/utils.js.map +1 -1
  63. package/doc/API.md +81 -75
  64. package/package.json +2 -6
package/doc/API.md CHANGED
@@ -113,7 +113,7 @@ Construct a grid item from the given element and options
113
113
  protected _updateResizeEvent(forceRemove): GridStack;
114
114
  ```
115
115
 
116
- Defined in: [gridstack.ts:2086](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2086)
116
+ Defined in: [gridstack.ts:2089](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2089)
117
117
 
118
118
  add or remove the grid element size event handler
119
119
 
@@ -133,7 +133,7 @@ add or remove the grid element size event handler
133
133
  protected _widthOrContainer(forBreakpoint): number;
134
134
  ```
135
135
 
136
- Defined in: [gridstack.ts:949](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L949)
136
+ Defined in: [gridstack.ts:952](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L952)
137
137
 
138
138
  return our expected width (or parent) , and optionally of window for dynamic column check
139
139
 
@@ -207,7 +207,7 @@ grid.addWidget({w: 3, content: 'hello'});
207
207
  batchUpdate(flag): GridStack;
208
208
  ```
209
209
 
210
- Defined in: [gridstack.ts:828](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L828)
210
+ Defined in: [gridstack.ts:831](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L831)
211
211
 
212
212
  use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
213
213
  and get a single event callback. You will see no changes until `batchUpdate(false)` is called.
@@ -228,7 +228,7 @@ and get a single event callback. You will see no changes until `batchUpdate(fals
228
228
  cellHeight(val?): GridStack;
229
229
  ```
230
230
 
231
- Defined in: [gridstack.ts:899](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L899)
231
+ Defined in: [gridstack.ts:902](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L902)
232
232
 
233
233
  Update current cell height - see `GridStackOptions.cellHeight` for format by updating eh Browser CSS variable.
234
234
 
@@ -260,7 +260,7 @@ grid.cellHeight('auto'); // auto-size based on content
260
260
  cellWidth(): number;
261
261
  ```
262
262
 
263
- Defined in: [gridstack.ts:945](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L945)
263
+ Defined in: [gridstack.ts:948](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L948)
264
264
 
265
265
  Gets the current cell width in pixels. This is calculated based on the grid container width divided by the number of columns.
266
266
 
@@ -286,7 +286,7 @@ const widgetWidth = width * 3; // For a 3-column wide widget
286
286
  protected checkDynamicColumn(): boolean;
287
287
  ```
288
288
 
289
- Defined in: [gridstack.ts:955](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L955)
289
+ Defined in: [gridstack.ts:958](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L958)
290
290
 
291
291
  checks for dynamic column count for our current size, returning true if changed
292
292
 
@@ -300,7 +300,7 @@ checks for dynamic column count for our current size, returning true if changed
300
300
  column(column, layout): GridStack;
301
301
  ```
302
302
 
303
- Defined in: [gridstack.ts:1034](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1034)
303
+ Defined in: [gridstack.ts:1037](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1037)
304
304
 
305
305
  Set the number of columns in the grid. Will update existing widgets to conform to new number of columns,
306
306
  as well as cache the original layout so you can revert back to previous positions without loss.
@@ -341,7 +341,7 @@ grid.column(1);
341
341
  commit(): GridStack;
342
342
  ```
343
343
 
344
- Defined in: [gridstack.ts:3015](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L3015)
344
+ Defined in: [gridstack.ts:3018](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L3018)
345
345
 
346
346
  ###### Returns
347
347
 
@@ -353,7 +353,7 @@ Defined in: [gridstack.ts:3015](https://github.com/adumesny/gridstack.js/blob/ma
353
353
  compact(layout, doSort): GridStack;
354
354
  ```
355
355
 
356
- Defined in: [gridstack.ts:1000](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1000)
356
+ Defined in: [gridstack.ts:1003](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1003)
357
357
 
358
358
  Re-layout grid items to reclaim any empty space. This is useful after removing widgets
359
359
  or when you want to optimize the layout.
@@ -419,7 +419,7 @@ const element = grid.createWidgetDivs({ w: 2, h: 1, content: 'Hello World' });
419
419
  destroy(removeDOM): GridStack;
420
420
  ```
421
421
 
422
- Defined in: [gridstack.ts:1108](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1108)
422
+ Defined in: [gridstack.ts:1111](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1111)
423
423
 
424
424
  Destroys a grid instance. DO NOT CALL any methods or access any vars after this as it will free up members.
425
425
 
@@ -439,7 +439,7 @@ Destroys a grid instance. DO NOT CALL any methods or access any vars after this
439
439
  disable(recurse): GridStack;
440
440
  ```
441
441
 
442
- Defined in: [gridstack.ts:2287](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2287)
442
+ Defined in: [gridstack.ts:2290](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2290)
443
443
 
444
444
  Temporarily disables widgets moving/resizing.
445
445
  If you want a more permanent way (which freezes up resources) use `setStatic(true)` instead.
@@ -480,7 +480,7 @@ grid.disable(false);
480
480
  enable(recurse): GridStack;
481
481
  ```
482
482
 
483
- Defined in: [gridstack.ts:2314](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2314)
483
+ Defined in: [gridstack.ts:2317](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2317)
484
484
 
485
485
  Re-enables widgets moving/resizing - see disable().
486
486
  Note: This is a no-op for static grids.
@@ -519,7 +519,7 @@ grid.enable(false);
519
519
  enableMove(doEnable, recurse): GridStack;
520
520
  ```
521
521
 
522
- Defined in: [gridstack.ts:2340](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2340)
522
+ Defined in: [gridstack.ts:2343](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2343)
523
523
 
524
524
  Enables/disables widget moving for all widgets. No-op for static grids.
525
525
  Note: locally defined items (with noMove property) still override this setting.
@@ -556,7 +556,7 @@ grid.enableMove(true, false);
556
556
  enableResize(doEnable, recurse): GridStack;
557
557
  ```
558
558
 
559
- Defined in: [gridstack.ts:2368](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2368)
559
+ Defined in: [gridstack.ts:2371](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2371)
560
560
 
561
561
  Enables/disables widget resizing for all widgets. No-op for static grids.
562
562
  Note: locally defined items (with noResize property) still override this setting.
@@ -593,7 +593,7 @@ grid.enableResize(true, false);
593
593
  float(val): GridStack;
594
594
  ```
595
595
 
596
- Defined in: [gridstack.ts:1142](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1142)
596
+ Defined in: [gridstack.ts:1145](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1145)
597
597
 
598
598
  Enable/disable floating widgets (default: `false`). When enabled, widgets can float up to fill empty spaces.
599
599
  See [example](http://gridstackjs.com/demo/float.html)
@@ -623,7 +623,7 @@ grid.float(false); // Disable floating (default)
623
623
  getCellFromPixel(position, useDocRelative): CellPosition;
624
624
  ```
625
625
 
626
- Defined in: [gridstack.ts:1172](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1172)
626
+ Defined in: [gridstack.ts:1175](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1175)
627
627
 
628
628
  Get the position of the cell under a pixel on screen.
629
629
 
@@ -644,7 +644,7 @@ Get the position of the cell under a pixel on screen.
644
644
  getCellHeight(forcePixel): number;
645
645
  ```
646
646
 
647
- Defined in: [gridstack.ts:852](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L852)
647
+ Defined in: [gridstack.ts:855](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L855)
648
648
 
649
649
  Gets the current cell height in pixels. This takes into account the unit type and converts to pixels if necessary.
650
650
 
@@ -676,7 +676,7 @@ const pixelHeight = grid.getCellHeight(true);
676
676
  getColumn(): number;
677
677
  ```
678
678
 
679
- Defined in: [gridstack.ts:1071](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1071)
679
+ Defined in: [gridstack.ts:1074](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1074)
680
680
 
681
681
  Get the number of columns in the grid (default 12).
682
682
 
@@ -698,7 +698,7 @@ const columnCount = grid.getColumn(); // returns 12 by default
698
698
  static getDD(): DDGridStack;
699
699
  ```
700
700
 
701
- Defined in: [gridstack.ts:2184](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2184)
701
+ Defined in: [gridstack.ts:2187](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2187)
702
702
 
703
703
  Get the global drag & drop implementation instance.
704
704
  This provides access to the underlying drag & drop functionality.
@@ -722,7 +722,7 @@ const dd = GridStack.getDD();
722
722
  getFloat(): boolean;
723
723
  ```
724
724
 
725
- Defined in: [gridstack.ts:1159](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1159)
725
+ Defined in: [gridstack.ts:1162](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1162)
726
726
 
727
727
  Get the current float mode setting.
728
728
 
@@ -745,7 +745,7 @@ console.log('Floating enabled:', isFloating);
745
745
  getGridItems(): GridItemHTMLElement[];
746
746
  ```
747
747
 
748
- Defined in: [gridstack.ts:1085](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1085)
748
+ Defined in: [gridstack.ts:1088](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1088)
749
749
 
750
750
  Returns an array of grid HTML elements (no placeholder) - used to iterate through our children in DOM order.
751
751
  This method excludes placeholder elements and returns only actual grid items.
@@ -771,7 +771,7 @@ items.forEach(item => {
771
771
  getMargin(): number;
772
772
  ```
773
773
 
774
- Defined in: [gridstack.ts:1783](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1783)
774
+ Defined in: [gridstack.ts:1786](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1786)
775
775
 
776
776
  Returns the current margin value as a number (undefined if the 4 sides don't match).
777
777
  This only returns a number if all sides have the same margin value.
@@ -799,7 +799,7 @@ if (margin !== undefined) {
799
799
  getRow(): number;
800
800
  ```
801
801
 
802
- Defined in: [gridstack.ts:1202](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1202)
802
+ Defined in: [gridstack.ts:1205](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1205)
803
803
 
804
804
  Returns the current number of rows, which will be at least `minRow` if set.
805
805
  The row count is based on the highest positioned widget in the grid.
@@ -887,7 +887,7 @@ isAreaEmpty(
887
887
  h): boolean;
888
888
  ```
889
889
 
890
- Defined in: [gridstack.ts:1221](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1221)
890
+ Defined in: [gridstack.ts:1224](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1224)
891
891
 
892
892
  Checks if the specified rectangular area is empty (no widgets occupy any part of it).
893
893
 
@@ -921,7 +921,7 @@ if (grid.isAreaEmpty(1, 1, 2, 2)) {
921
921
  isIgnoreChangeCB(): boolean;
922
922
  ```
923
923
 
924
- Defined in: [gridstack.ts:1102](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1102)
924
+ Defined in: [gridstack.ts:1105](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1105)
925
925
 
926
926
  Returns true if change callbacks should be ignored due to column change, sizeToContent, loading, etc.
927
927
  This is useful for callers who want to implement dirty flag functionality.
@@ -947,7 +947,7 @@ if (!grid.isIgnoreChangeCB()) {
947
947
  load(items, addRemove): GridStack;
948
948
  ```
949
949
 
950
- Defined in: [gridstack.ts:717](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L717)
950
+ Defined in: [gridstack.ts:720](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L720)
951
951
 
952
952
  Load widgets from a list. This will call update() on each (matching by id) or add/remove widgets that are not there.
953
953
  Used to restore a grid layout for a saved layout list (see `save()`).
@@ -1032,7 +1032,7 @@ newly created grid
1032
1032
  makeWidget(els, options?): GridItemHTMLElement;
1033
1033
  ```
1034
1034
 
1035
- Defined in: [gridstack.ts:1249](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1249)
1035
+ Defined in: [gridstack.ts:1252](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1252)
1036
1036
 
1037
1037
  If you add elements to your grid by hand (or have some framework creating DOM), you have to tell gridstack afterwards to make them widgets.
1038
1038
  If you want gridstack to add the elements for you, use `addWidget()` instead.
@@ -1075,7 +1075,7 @@ grid.makeWidget(element, {x: 0, y: 1, w: 4, h: 2});
1075
1075
  margin(value): GridStack;
1076
1076
  ```
1077
1077
 
1078
- Defined in: [gridstack.ts:1754](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1754)
1078
+ Defined in: [gridstack.ts:1757](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1757)
1079
1079
 
1080
1080
  Updates the margins which will set all 4 sides at once - see `GridStackOptions.margin` for format options.
1081
1081
  Supports CSS string format of 1, 2, or 4 values or a single number.
@@ -1106,7 +1106,7 @@ grid.margin('5px 10px 15px 20px'); // Different for each side
1106
1106
  movable(els, val): GridStack;
1107
1107
  ```
1108
1108
 
1109
- Defined in: [gridstack.ts:2228](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2228)
1109
+ Defined in: [gridstack.ts:2231](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2231)
1110
1110
 
1111
1111
  Enables/Disables dragging by the user for specific grid elements.
1112
1112
  For all items and future items, use enableMove() instead. No-op for static grids.
@@ -1143,7 +1143,7 @@ grid.movable('#fixed-widget', false);
1143
1143
  off(name): GridStack;
1144
1144
  ```
1145
1145
 
1146
- Defined in: [gridstack.ts:1345](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1345)
1146
+ Defined in: [gridstack.ts:1348](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1348)
1147
1147
 
1148
1148
  unsubscribe from the 'on' event GridStackEvent
1149
1149
 
@@ -1163,7 +1163,7 @@ unsubscribe from the 'on' event GridStackEvent
1163
1163
  offAll(): GridStack;
1164
1164
  ```
1165
1165
 
1166
- Defined in: [gridstack.ts:1372](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1372)
1166
+ Defined in: [gridstack.ts:1375](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1375)
1167
1167
 
1168
1168
  Remove all event handlers from the grid. This is useful for cleanup when destroying a grid.
1169
1169
 
@@ -1187,7 +1187,7 @@ grid.offAll(); // Remove all event listeners
1187
1187
  on(name, callback): GridStack;
1188
1188
  ```
1189
1189
 
1190
- Defined in: [gridstack.ts:1308](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1308)
1190
+ Defined in: [gridstack.ts:1311](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1311)
1191
1191
 
1192
1192
  Register event handler for grid events. You can call this on a single event name, or space separated list.
1193
1193
 
@@ -1238,7 +1238,7 @@ grid.on('added', (event, items) => {
1238
1238
  on(name, callback): GridStack;
1239
1239
  ```
1240
1240
 
1241
- Defined in: [gridstack.ts:1309](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1309)
1241
+ Defined in: [gridstack.ts:1312](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1312)
1242
1242
 
1243
1243
  Register event handler for grid events. You can call this on a single event name, or space separated list.
1244
1244
 
@@ -1289,7 +1289,7 @@ grid.on('added', (event, items) => {
1289
1289
  on(name, callback): GridStack;
1290
1290
  ```
1291
1291
 
1292
- Defined in: [gridstack.ts:1310](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1310)
1292
+ Defined in: [gridstack.ts:1313](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1313)
1293
1293
 
1294
1294
  Register event handler for grid events. You can call this on a single event name, or space separated list.
1295
1295
 
@@ -1340,7 +1340,7 @@ grid.on('added', (event, items) => {
1340
1340
  on(name, callback): GridStack;
1341
1341
  ```
1342
1342
 
1343
- Defined in: [gridstack.ts:1311](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1311)
1343
+ Defined in: [gridstack.ts:1314](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1314)
1344
1344
 
1345
1345
  Register event handler for grid events. You can call this on a single event name, or space separated list.
1346
1346
 
@@ -1391,7 +1391,7 @@ grid.on('added', (event, items) => {
1391
1391
  on(name, callback): GridStack;
1392
1392
  ```
1393
1393
 
1394
- Defined in: [gridstack.ts:1312](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1312)
1394
+ Defined in: [gridstack.ts:1315](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1315)
1395
1395
 
1396
1396
  Register event handler for grid events. You can call this on a single event name, or space separated list.
1397
1397
 
@@ -1442,7 +1442,7 @@ grid.on('added', (event, items) => {
1442
1442
  onResize(clientWidth): GridStack;
1443
1443
  ```
1444
1444
 
1445
- Defined in: [gridstack.ts:2025](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2025)
1445
+ Defined in: [gridstack.ts:2028](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2028)
1446
1446
 
1447
1447
  called when we are being resized - check if the one Column Mode needs to be turned on/off
1448
1448
  and remember the prev columns we used, or get our count from parent, as well as check for cellHeight==='auto' (square)
@@ -1464,7 +1464,7 @@ or `sizeToContent` gridItem options.
1464
1464
  prepareDragDrop(el, force?): GridStack;
1465
1465
  ```
1466
1466
 
1467
- Defined in: [gridstack.ts:2711](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2711)
1467
+ Defined in: [gridstack.ts:2714](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2714)
1468
1468
 
1469
1469
  prepares the element for drag&drop - this is normally called by makeWidget() unless are are delay loading
1470
1470
 
@@ -1507,7 +1507,7 @@ replace just one instance.
1507
1507
  removeAll(removeDOM, triggerEvent): GridStack;
1508
1508
  ```
1509
1509
 
1510
- Defined in: [gridstack.ts:1421](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1421)
1510
+ Defined in: [gridstack.ts:1424](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1424)
1511
1511
 
1512
1512
  Removes all widgets from the grid.
1513
1513
 
@@ -1552,7 +1552,7 @@ removeWidget(
1552
1552
  triggerEvent): GridStack;
1553
1553
  ```
1554
1554
 
1555
- Defined in: [gridstack.ts:1383](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1383)
1555
+ Defined in: [gridstack.ts:1386](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1386)
1556
1556
 
1557
1557
  Removes widget from the grid.
1558
1558
 
@@ -1574,7 +1574,7 @@ Removes widget from the grid.
1574
1574
  resizable(els, val): GridStack;
1575
1575
  ```
1576
1576
 
1577
- Defined in: [gridstack.ts:2254](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2254)
1577
+ Defined in: [gridstack.ts:2257](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2257)
1578
1578
 
1579
1579
  Enables/Disables user resizing for specific grid elements.
1580
1580
  For all items and future items, use enableResize() instead. No-op for static grids.
@@ -1608,7 +1608,7 @@ grid.resizable('#fixed-size-widget', false);
1608
1608
  resizeToContent(el): void;
1609
1609
  ```
1610
1610
 
1611
- Defined in: [gridstack.ts:1644](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1644)
1611
+ Defined in: [gridstack.ts:1647](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1647)
1612
1612
 
1613
1613
  Updates widget height to match the content height to avoid vertical scrollbars or dead space.
1614
1614
  This automatically adjusts the widget height based on its content size.
@@ -1644,7 +1644,7 @@ grid.resizeToContent(widget);
1644
1644
  rotate(els, relative?): GridStack;
1645
1645
  ```
1646
1646
 
1647
- Defined in: [gridstack.ts:1719](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1719)
1647
+ Defined in: [gridstack.ts:1722](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1722)
1648
1648
 
1649
1649
  Rotate widgets by swapping their width and height. This is typically called when the user presses 'r' during dragging.
1650
1650
  The rotation swaps the w/h dimensions and adjusts min/max constraints accordingly.
@@ -1678,12 +1678,13 @@ grid.rotate(widget, { left: 50, top: 30 });
1678
1678
  save(
1679
1679
  saveContent,
1680
1680
  saveGridOpt,
1681
- saveCB):
1681
+ saveCB,
1682
+ columnSize?):
1682
1683
  | GridStackOptions
1683
1684
  | GridStackWidget[];
1684
1685
  ```
1685
1686
 
1686
- Defined in: [gridstack.ts:630](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L630)
1687
+ Defined in: [gridstack.ts:633](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L633)
1687
1688
 
1688
1689
  saves the current layout returning a list of widgets for serialization which might include any nested grids.
1689
1690
 
@@ -1694,6 +1695,7 @@ saves the current layout returning a list of widgets for serialization which mig
1694
1695
  | `saveContent` | `boolean` | `true` | if true (default) the latest html inside .grid-stack-content will be saved to GridStackWidget.content field, else it will be removed. |
1695
1696
  | `saveGridOpt` | `boolean` | `false` | if true (default false), save the grid options itself, so you can call the new GridStack.addGrid() to recreate everything from scratch. GridStackOptions.children would then contain the widget list instead. |
1696
1697
  | `saveCB` | [`SaveFcn`](#savefcn) | `GridStack.saveCB` | callback for each node -> widget, so application can insert additional data to be saved into the widget data structure. |
1698
+ | `columnSize?` | `number` | `undefined` | if provided, the grid will be saved for the given column size (IFF we have matching internal saved layout, or current layout). Otherwise it will use the largest possible layout (say 12 even if rendering at 1 column) so we can restore to all layouts. Note: nested grids will ALWAYS save the container size to match overall layouts (parent + child) to be consistent. |
1697
1699
 
1698
1700
  ###### Returns
1699
1701
 
@@ -1708,7 +1710,7 @@ list of widgets or full grid option, including .children list of widgets
1708
1710
  setAnimation(doAnimate, delay?): GridStack;
1709
1711
  ```
1710
1712
 
1711
- Defined in: [gridstack.ts:1440](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1440)
1713
+ Defined in: [gridstack.ts:1443](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1443)
1712
1714
 
1713
1715
  Toggle the grid animation state. Toggles the `grid-stack-animate` class.
1714
1716
 
@@ -1732,7 +1734,7 @@ setStatic(
1732
1734
  recurse): GridStack;
1733
1735
  ```
1734
1736
 
1735
- Defined in: [gridstack.ts:1463](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1463)
1737
+ Defined in: [gridstack.ts:1466](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1466)
1736
1738
 
1737
1739
  Toggle the grid static state, which permanently removes/add Drag&Drop support, unlike disable()/enable() that just turns it off/on.
1738
1740
  Also toggle the grid-stack-static class.
@@ -1759,7 +1761,7 @@ static setupDragIn(
1759
1761
  root?): void;
1760
1762
  ```
1761
1763
 
1762
- Defined in: [gridstack.ts:2197](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2197)
1764
+ Defined in: [gridstack.ts:2200](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2200)
1763
1765
 
1764
1766
  call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
1765
1767
  Called during GridStack.init() as options, but can also be called directly (last param are used) in case the toolbar
@@ -1784,7 +1786,7 @@ is dynamically create and needs to be set later.
1784
1786
  protected triggerEvent(event, target): void;
1785
1787
  ```
1786
1788
 
1787
- Defined in: [gridstack.ts:2965](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2965)
1789
+ Defined in: [gridstack.ts:2968](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2968)
1788
1790
 
1789
1791
  call given event callback on our main top-most grid (if we're nested)
1790
1792
 
@@ -1805,7 +1807,7 @@ call given event callback on our main top-most grid (if we're nested)
1805
1807
  update(els, opt): GridStack;
1806
1808
  ```
1807
1809
 
1808
- Defined in: [gridstack.ts:1540](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1540)
1810
+ Defined in: [gridstack.ts:1543](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1543)
1809
1811
 
1810
1812
  Updates widget position/size and other info. This is used to change widget properties after creation.
1811
1813
  Can update position, size, content, and other widget properties.
@@ -1850,7 +1852,7 @@ grid.update('#my-widget', {
1850
1852
  updateOptions(o): GridStack;
1851
1853
  ```
1852
1854
 
1853
- Defined in: [gridstack.ts:1481](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1481)
1855
+ Defined in: [gridstack.ts:1484](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1484)
1854
1856
 
1855
1857
  Updates the passed in options on the grid (similar to update(widget) for for the grid options).
1856
1858
 
@@ -1870,7 +1872,7 @@ Updates the passed in options on the grid (similar to update(widget) for for the
1870
1872
  willItFit(node): boolean;
1871
1873
  ```
1872
1874
 
1873
- Defined in: [gridstack.ts:1797](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1797)
1875
+ Defined in: [gridstack.ts:1800](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1800)
1874
1876
 
1875
1877
  Returns true if the height of the grid will be less than the vertical
1876
1878
  constraint. Always returns true if grid doesn't have height constraint.
@@ -2128,7 +2130,7 @@ cacheLayout(
2128
2130
  clear): GridStackEngine;
2129
2131
  ```
2130
2132
 
2131
- Defined in: [gridstack-engine.ts:1183](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1183)
2133
+ Defined in: [gridstack-engine.ts:1188](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1188)
2132
2134
 
2133
2135
  call to cache the given layout internally to the given location so we can restore back when column changes size
2134
2136
 
@@ -2150,7 +2152,7 @@ call to cache the given layout internally to the given location so we can restor
2150
2152
  cacheOneLayout(n, column): GridStackEngine;
2151
2153
  ```
2152
2154
 
2153
- Defined in: [gridstack-engine.ts:1203](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1203)
2155
+ Defined in: [gridstack-engine.ts:1208](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1208)
2154
2156
 
2155
2157
  call to cache the given node layout internally to the given location so we can restore back when column changes size
2156
2158
 
@@ -2192,7 +2194,7 @@ true if x,y or w,h are different after clamping to min/max
2192
2194
  cleanupNode(node): GridStackEngine;
2193
2195
  ```
2194
2196
 
2195
- Defined in: [gridstack-engine.ts:1234](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1234)
2197
+ Defined in: [gridstack-engine.ts:1239](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1239)
2196
2198
 
2197
2199
  called to remove all internal values but the _id
2198
2200
 
@@ -2355,7 +2357,7 @@ Defined in: [gridstack-engine.ts:1002](https://github.com/adumesny/gridstack.js/
2355
2357
  protected findCacheLayout(n, column): number;
2356
2358
  ```
2357
2359
 
2358
- Defined in: [gridstack-engine.ts:1217](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1217)
2360
+ Defined in: [gridstack-engine.ts:1222](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1222)
2359
2361
 
2360
2362
  ###### Parameters
2361
2363
 
@@ -2678,7 +2680,7 @@ engine.removeNode(node, true, true);
2678
2680
  removeNodeFromLayoutCache(n): void;
2679
2681
  ```
2680
2682
 
2681
- Defined in: [gridstack-engine.ts:1221](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1221)
2683
+ Defined in: [gridstack-engine.ts:1226](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1226)
2682
2684
 
2683
2685
  ###### Parameters
2684
2686
 
@@ -2693,20 +2695,24 @@ Defined in: [gridstack-engine.ts:1221](https://github.com/adumesny/gridstack.js/
2693
2695
  ##### save()
2694
2696
 
2695
2697
  ```ts
2696
- save(saveElement, saveCB?): GridStackNode[];
2698
+ save(
2699
+ saveElement,
2700
+ saveCB?,
2701
+ columnSize?): GridStackNode[];
2697
2702
  ```
2698
2703
 
2699
- Defined in: [gridstack-engine.ts:1013](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1013)
2704
+ Defined in: [gridstack-engine.ts:1017](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1017)
2700
2705
 
2701
2706
  saves a copy of the largest column layout (eg 12 even when rendering oneColumnMode) so we don't loose orig layout,
2702
2707
  returning a list of widgets for serialization
2703
2708
 
2704
2709
  ###### Parameters
2705
2710
 
2706
- | Parameter | Type | Default value |
2707
- | ------ | ------ | ------ |
2708
- | `saveElement` | `boolean` | `true` |
2709
- | `saveCB?` | [`SaveFcn`](#savefcn) | `undefined` |
2711
+ | Parameter | Type | Default value | Description |
2712
+ | ------ | ------ | ------ | ------ |
2713
+ | `saveElement` | `boolean` | `true` | - |
2714
+ | `saveCB?` | [`SaveFcn`](#savefcn) | `undefined` | - |
2715
+ | `columnSize?` | `number` | `undefined` | if provided, the grid will be saved for the given column size (IFF we have matching internal saved layout, or current layout). Otherwise it will use the largest possible layout (say 12 even if rendering at 1 column) so we can restore to all layouts. Note: nested grids will ALWAYS save the container size to match overall layouts (parent + child) to be consistent. |
2710
2716
 
2711
2717
  ###### Returns
2712
2718
 
@@ -2839,7 +2845,7 @@ new Utils(): Utils;
2839
2845
  static addElStyles(el, styles): void;
2840
2846
  ```
2841
2847
 
2842
- Defined in: [utils.ts:690](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L690)
2848
+ Defined in: [utils.ts:691](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L691)
2843
2849
 
2844
2850
  ###### Parameters
2845
2851
 
@@ -2858,7 +2864,7 @@ Defined in: [utils.ts:690](https://github.com/adumesny/gridstack.js/blob/master/
2858
2864
  static appendTo(el, parent): void;
2859
2865
  ```
2860
2866
 
2861
- Defined in: [utils.ts:672](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L672)
2867
+ Defined in: [utils.ts:673](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L673)
2862
2868
 
2863
2869
  ###### Parameters
2864
2870
 
@@ -2937,7 +2943,7 @@ const overlap = Utils.areaIntercept(
2937
2943
  static canBeRotated(n): boolean;
2938
2944
  ```
2939
2945
 
2940
- Defined in: [utils.ts:793](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L793)
2946
+ Defined in: [utils.ts:794](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L794)
2941
2947
 
2942
2948
  true if the item can be rotated (checking for prop, not space available)
2943
2949
 
@@ -2957,7 +2963,7 @@ true if the item can be rotated (checking for prop, not space available)
2957
2963
  static clone<T>(obj): T;
2958
2964
  ```
2959
2965
 
2960
- Defined in: [utils.ts:635](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L635)
2966
+ Defined in: [utils.ts:636](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L636)
2961
2967
 
2962
2968
  single level clone, returning a new object with same top fields. This will share sub objects and arrays
2963
2969
 
@@ -2983,7 +2989,7 @@ single level clone, returning a new object with same top fields. This will share
2983
2989
  static cloneDeep<T>(obj): T;
2984
2990
  ```
2985
2991
 
2986
- Defined in: [utils.ts:651](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L651)
2992
+ Defined in: [utils.ts:652](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L652)
2987
2993
 
2988
2994
  Recursive clone version that returns a full copy, checking for nested objects and arrays ONLY.
2989
2995
  Note: this will use as-is any key starting with double __ (and not copy inside) some lib have circular dependencies.
@@ -3010,7 +3016,7 @@ Note: this will use as-is any key starting with double __ (and not copy inside)
3010
3016
  static cloneNode(el): HTMLElement;
3011
3017
  ```
3012
3018
 
3013
- Defined in: [utils.ts:666](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L666)
3019
+ Defined in: [utils.ts:667](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L667)
3014
3020
 
3015
3021
  deep clone the given HTML node, removing teh unique id field
3016
3022
 
@@ -3220,7 +3226,7 @@ const fromShadow = Utils.getElements('.item', shadowRoot);
3220
3226
  static getValuesFromTransformedElement(parent): DragTransform;
3221
3227
  ```
3222
3228
 
3223
- Defined in: [utils.ts:750](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L750)
3229
+ Defined in: [utils.ts:751](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L751)
3224
3230
 
3225
3231
  defines an element that is used to get the offset and scale from grid transforms
3226
3232
  returns the scale and offsets from said element
@@ -3241,7 +3247,7 @@ returns the scale and offsets from said element
3241
3247
  static initEvent<T>(e, info): T;
3242
3248
  ```
3243
3249
 
3244
- Defined in: [utils.ts:707](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L707)
3250
+ Defined in: [utils.ts:708](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L708)
3245
3251
 
3246
3252
  ###### Type Parameters
3247
3253
 
@@ -3435,7 +3441,7 @@ removes internal fields '_' and default values for saving
3435
3441
  static removePositioningStyles(el): void;
3436
3442
  ```
3437
3443
 
3438
- Defined in: [utils.ts:542](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L542)
3444
+ Defined in: [utils.ts:543](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L543)
3439
3445
 
3440
3446
  ###### Parameters
3441
3447
 
@@ -3559,7 +3565,7 @@ static simulateMouseEvent(
3559
3565
  target?): void;
3560
3566
  ```
3561
3567
 
3562
- Defined in: [utils.ts:723](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L723)
3568
+ Defined in: [utils.ts:724](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L724)
3563
3569
 
3564
3570
  copies the MouseEvent (or convert Touch) properties and sends it as another event to the given target
3565
3571
 
@@ -3614,7 +3620,7 @@ static swap(
3614
3620
  b): void;
3615
3621
  ```
3616
3622
 
3617
- Defined in: [utils.ts:774](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L774)
3623
+ Defined in: [utils.ts:775](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L775)
3618
3624
 
3619
3625
  swap the given object 2 field values
3620
3626
 
@@ -3636,7 +3642,7 @@ swap the given object 2 field values
3636
3642
  static throttle(func, delay): () => void;
3637
3643
  ```
3638
3644
 
3639
- Defined in: [utils.ts:532](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L532)
3645
+ Defined in: [utils.ts:533](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L533)
3640
3646
 
3641
3647
  delay calling the given function for given delay, preventing new calls from happening while waiting
3642
3648