gridstack 12.3.0 → 12.3.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.
- 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/esm2020/lib/types.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 +5 -5
- 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/lib/types.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/angular/src/types.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/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 +9 -4
- package/dist/gridstack-engine.js +21 -6
- package/dist/gridstack-engine.js.map +1 -1
- package/dist/gridstack.css +1 -1
- package/dist/gridstack.d.ts +6 -2
- package/dist/gridstack.js +12 -7
- package/dist/gridstack.js.map +1 -1
- package/dist/src/gridstack.scss +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/doc/API.md +72 -66
- package/package.json +2 -6
package/doc/API.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# gridstack
|
|
1
|
+
# gridstack v12.3.2
|
|
2
2
|
|
|
3
3
|
## Classes
|
|
4
4
|
|
|
@@ -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:
|
|
116
|
+
Defined in: [gridstack.ts:2091](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2091)
|
|
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:
|
|
136
|
+
Defined in: [gridstack.ts:954](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L954)
|
|
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:
|
|
210
|
+
Defined in: [gridstack.ts:833](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L833)
|
|
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:
|
|
231
|
+
Defined in: [gridstack.ts:904](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L904)
|
|
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:
|
|
263
|
+
Defined in: [gridstack.ts:950](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L950)
|
|
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:
|
|
289
|
+
Defined in: [gridstack.ts:960](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L960)
|
|
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:
|
|
303
|
+
Defined in: [gridstack.ts:1039](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1039)
|
|
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:
|
|
344
|
+
Defined in: [gridstack.ts:3020](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L3020)
|
|
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:
|
|
356
|
+
Defined in: [gridstack.ts:1005](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1005)
|
|
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:
|
|
422
|
+
Defined in: [gridstack.ts:1113](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1113)
|
|
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:
|
|
442
|
+
Defined in: [gridstack.ts:2292](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2292)
|
|
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:
|
|
483
|
+
Defined in: [gridstack.ts:2319](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2319)
|
|
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:
|
|
522
|
+
Defined in: [gridstack.ts:2345](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2345)
|
|
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:
|
|
559
|
+
Defined in: [gridstack.ts:2373](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2373)
|
|
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:
|
|
596
|
+
Defined in: [gridstack.ts:1147](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1147)
|
|
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:
|
|
626
|
+
Defined in: [gridstack.ts:1177](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1177)
|
|
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:
|
|
647
|
+
Defined in: [gridstack.ts:857](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L857)
|
|
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:
|
|
679
|
+
Defined in: [gridstack.ts:1076](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1076)
|
|
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:
|
|
701
|
+
Defined in: [gridstack.ts:2189](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2189)
|
|
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:
|
|
725
|
+
Defined in: [gridstack.ts:1164](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1164)
|
|
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:
|
|
748
|
+
Defined in: [gridstack.ts:1090](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1090)
|
|
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:
|
|
774
|
+
Defined in: [gridstack.ts:1788](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1788)
|
|
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:
|
|
802
|
+
Defined in: [gridstack.ts:1207](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1207)
|
|
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:
|
|
890
|
+
Defined in: [gridstack.ts:1226](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1226)
|
|
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:
|
|
924
|
+
Defined in: [gridstack.ts:1107](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1107)
|
|
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:
|
|
950
|
+
Defined in: [gridstack.ts:722](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L722)
|
|
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:
|
|
1035
|
+
Defined in: [gridstack.ts:1254](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1254)
|
|
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:
|
|
1078
|
+
Defined in: [gridstack.ts:1759](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1759)
|
|
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:
|
|
1109
|
+
Defined in: [gridstack.ts:2233](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2233)
|
|
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:
|
|
1146
|
+
Defined in: [gridstack.ts:1350](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1350)
|
|
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:
|
|
1166
|
+
Defined in: [gridstack.ts:1377](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1377)
|
|
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:
|
|
1190
|
+
Defined in: [gridstack.ts:1313](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1313)
|
|
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:
|
|
1241
|
+
Defined in: [gridstack.ts:1314](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1314)
|
|
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:
|
|
1292
|
+
Defined in: [gridstack.ts:1315](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1315)
|
|
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:
|
|
1343
|
+
Defined in: [gridstack.ts:1316](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1316)
|
|
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:
|
|
1394
|
+
Defined in: [gridstack.ts:1317](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1317)
|
|
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:
|
|
1445
|
+
Defined in: [gridstack.ts:2030](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2030)
|
|
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:
|
|
1467
|
+
Defined in: [gridstack.ts:2716](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2716)
|
|
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:
|
|
1510
|
+
Defined in: [gridstack.ts:1426](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1426)
|
|
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:
|
|
1555
|
+
Defined in: [gridstack.ts:1388](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1388)
|
|
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:
|
|
1577
|
+
Defined in: [gridstack.ts:2259](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2259)
|
|
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:
|
|
1611
|
+
Defined in: [gridstack.ts:1649](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1649)
|
|
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:
|
|
1647
|
+
Defined in: [gridstack.ts:1724](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1724)
|
|
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
|
+
column?):
|
|
1682
1683
|
| GridStackOptions
|
|
1683
1684
|
| GridStackWidget[];
|
|
1684
1685
|
```
|
|
1685
1686
|
|
|
1686
|
-
Defined in: [gridstack.ts:
|
|
1687
|
+
Defined in: [gridstack.ts:634](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L634)
|
|
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
|
+
| `column?` | `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: if you want to save to currently display layout, pass this.getColumn() as column. NOTE2: nested grids will ALWAYS save to the container size to be in sync with parent. |
|
|
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:
|
|
1713
|
+
Defined in: [gridstack.ts:1445](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1445)
|
|
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:
|
|
1737
|
+
Defined in: [gridstack.ts:1468](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1468)
|
|
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:
|
|
1764
|
+
Defined in: [gridstack.ts:2202](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2202)
|
|
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:
|
|
1789
|
+
Defined in: [gridstack.ts:2970](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2970)
|
|
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:
|
|
1810
|
+
Defined in: [gridstack.ts:1545](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1545)
|
|
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:
|
|
1855
|
+
Defined in: [gridstack.ts:1486](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1486)
|
|
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:
|
|
1875
|
+
Defined in: [gridstack.ts:1802](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1802)
|
|
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:
|
|
2133
|
+
Defined in: [gridstack-engine.ts:1196](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1196)
|
|
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:
|
|
2155
|
+
Defined in: [gridstack-engine.ts:1216](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1216)
|
|
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:
|
|
2197
|
+
Defined in: [gridstack-engine.ts:1247](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1247)
|
|
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:
|
|
2360
|
+
Defined in: [gridstack-engine.ts:1230](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1230)
|
|
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:
|
|
2683
|
+
Defined in: [gridstack-engine.ts:1234](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1234)
|
|
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(
|
|
2698
|
+
save(
|
|
2699
|
+
saveElement,
|
|
2700
|
+
saveCB?,
|
|
2701
|
+
column?): GridStackNode[];
|
|
2697
2702
|
```
|
|
2698
2703
|
|
|
2699
|
-
Defined in: [gridstack-engine.ts:
|
|
2704
|
+
Defined in: [gridstack-engine.ts:1018](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack-engine.ts#L1018)
|
|
2700
2705
|
|
|
2701
|
-
saves a copy of the largest column layout (eg 12 even when rendering
|
|
2702
|
-
returning a list of widgets for serialization
|
|
2706
|
+
saves a copy of the largest column layout (eg 12 even when rendering 1 column) so we don't loose orig layout, unless explicity column
|
|
2707
|
+
count to use is given. 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` | if true (default), the element will be saved to GridStackWidget.el field, else it will be removed. |
|
|
2714
|
+
| `saveCB?` | [`SaveFcn`](#savefcn) | `undefined` | callback for each node -> widget, so application can insert additional data to be saved into the widget data structure. |
|
|
2715
|
+
| `column?` | `number` | `undefined` | if provided, the grid will be saved for the given column count (IFF we have matching internal saved layout, or current layout). Note: nested grids will ALWAYS save the container w to match overall layouts (parent + child) to be consistent. |
|
|
2710
2716
|
|
|
2711
2717
|
###### Returns
|
|
2712
2718
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gridstack",
|
|
3
|
-
"version": "12.3.
|
|
3
|
+
"version": "12.3.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Alain Dumesny <alaind831+github@gmail.com> (https://github.com/adumesny)",
|
|
6
6
|
"contributors": [
|
|
@@ -29,13 +29,9 @@
|
|
|
29
29
|
"build:ng": "cd angular && yarn --no-progress && yarn build lib",
|
|
30
30
|
"w": "webpack",
|
|
31
31
|
"t": "rm -rf dist/* && grunt && tsc --stripInternal",
|
|
32
|
-
"doc": "doctoc ./README.md && doctoc ./doc/CHANGES.md &&
|
|
33
|
-
"doc:api": "typedoc && node scripts/reorder-docs.js",
|
|
34
|
-
"doc:api:html": "typedoc --options typedoc.html.json && node scripts/reorder-html-docs.js",
|
|
35
|
-
"doc:all": "node scripts/generate-docs.js",
|
|
32
|
+
"doc": "doctoc ./README.md && doctoc ./doc/CHANGES.md && node scripts/generate-docs.js",
|
|
36
33
|
"doc:main": "node scripts/generate-docs.js --main-only",
|
|
37
34
|
"doc:angular": "node scripts/generate-docs.js --angular-only",
|
|
38
|
-
"doc:clean": "node scripts/generate-docs.js --no-cleanup",
|
|
39
35
|
"test": "yarn lint && karma start karma.conf.js",
|
|
40
36
|
"lint": "tsc --noEmit && eslint src/*.ts",
|
|
41
37
|
"reset": "rm -rf dist node_modules",
|