gridstack 12.3.1 → 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 +8 -7
- package/dist/gridstack-engine.js +20 -10
- package/dist/gridstack-engine.js.map +1 -1
- package/dist/gridstack.css +1 -1
- package/dist/gridstack.d.ts +5 -4
- package/dist/gridstack.js +9 -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 +5 -4
- package/dist/utils.js.map +1 -1
- package/doc/API.md +78 -78
- package/package.json +1 -1
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:3018](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.
|
|
@@ -1679,12 +1679,12 @@ save(
|
|
|
1679
1679
|
saveContent,
|
|
1680
1680
|
saveGridOpt,
|
|
1681
1681
|
saveCB,
|
|
1682
|
-
|
|
1682
|
+
column?):
|
|
1683
1683
|
| GridStackOptions
|
|
1684
1684
|
| GridStackWidget[];
|
|
1685
1685
|
```
|
|
1686
1686
|
|
|
1687
|
-
Defined in: [gridstack.ts:
|
|
1687
|
+
Defined in: [gridstack.ts:634](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L634)
|
|
1688
1688
|
|
|
1689
1689
|
saves the current layout returning a list of widgets for serialization which might include any nested grids.
|
|
1690
1690
|
|
|
@@ -1695,7 +1695,7 @@ saves the current layout returning a list of widgets for serialization which mig
|
|
|
1695
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. |
|
|
1696
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. |
|
|
1697
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
|
-
| `
|
|
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. |
|
|
1699
1699
|
|
|
1700
1700
|
###### Returns
|
|
1701
1701
|
|
|
@@ -1710,7 +1710,7 @@ list of widgets or full grid option, including .children list of widgets
|
|
|
1710
1710
|
setAnimation(doAnimate, delay?): GridStack;
|
|
1711
1711
|
```
|
|
1712
1712
|
|
|
1713
|
-
Defined in: [gridstack.ts:
|
|
1713
|
+
Defined in: [gridstack.ts:1445](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1445)
|
|
1714
1714
|
|
|
1715
1715
|
Toggle the grid animation state. Toggles the `grid-stack-animate` class.
|
|
1716
1716
|
|
|
@@ -1734,7 +1734,7 @@ setStatic(
|
|
|
1734
1734
|
recurse): GridStack;
|
|
1735
1735
|
```
|
|
1736
1736
|
|
|
1737
|
-
Defined in: [gridstack.ts:
|
|
1737
|
+
Defined in: [gridstack.ts:1468](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1468)
|
|
1738
1738
|
|
|
1739
1739
|
Toggle the grid static state, which permanently removes/add Drag&Drop support, unlike disable()/enable() that just turns it off/on.
|
|
1740
1740
|
Also toggle the grid-stack-static class.
|
|
@@ -1761,7 +1761,7 @@ static setupDragIn(
|
|
|
1761
1761
|
root?): void;
|
|
1762
1762
|
```
|
|
1763
1763
|
|
|
1764
|
-
Defined in: [gridstack.ts:
|
|
1764
|
+
Defined in: [gridstack.ts:2202](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2202)
|
|
1765
1765
|
|
|
1766
1766
|
call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
|
|
1767
1767
|
Called during GridStack.init() as options, but can also be called directly (last param are used) in case the toolbar
|
|
@@ -1786,7 +1786,7 @@ is dynamically create and needs to be set later.
|
|
|
1786
1786
|
protected triggerEvent(event, target): void;
|
|
1787
1787
|
```
|
|
1788
1788
|
|
|
1789
|
-
Defined in: [gridstack.ts:
|
|
1789
|
+
Defined in: [gridstack.ts:2970](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L2970)
|
|
1790
1790
|
|
|
1791
1791
|
call given event callback on our main top-most grid (if we're nested)
|
|
1792
1792
|
|
|
@@ -1807,7 +1807,7 @@ call given event callback on our main top-most grid (if we're nested)
|
|
|
1807
1807
|
update(els, opt): GridStack;
|
|
1808
1808
|
```
|
|
1809
1809
|
|
|
1810
|
-
Defined in: [gridstack.ts:
|
|
1810
|
+
Defined in: [gridstack.ts:1545](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1545)
|
|
1811
1811
|
|
|
1812
1812
|
Updates widget position/size and other info. This is used to change widget properties after creation.
|
|
1813
1813
|
Can update position, size, content, and other widget properties.
|
|
@@ -1852,7 +1852,7 @@ grid.update('#my-widget', {
|
|
|
1852
1852
|
updateOptions(o): GridStack;
|
|
1853
1853
|
```
|
|
1854
1854
|
|
|
1855
|
-
Defined in: [gridstack.ts:
|
|
1855
|
+
Defined in: [gridstack.ts:1486](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1486)
|
|
1856
1856
|
|
|
1857
1857
|
Updates the passed in options on the grid (similar to update(widget) for for the grid options).
|
|
1858
1858
|
|
|
@@ -1872,7 +1872,7 @@ Updates the passed in options on the grid (similar to update(widget) for for the
|
|
|
1872
1872
|
willItFit(node): boolean;
|
|
1873
1873
|
```
|
|
1874
1874
|
|
|
1875
|
-
Defined in: [gridstack.ts:
|
|
1875
|
+
Defined in: [gridstack.ts:1802](https://github.com/adumesny/gridstack.js/blob/master/src/gridstack.ts#L1802)
|
|
1876
1876
|
|
|
1877
1877
|
Returns true if the height of the grid will be less than the vertical
|
|
1878
1878
|
constraint. Always returns true if grid doesn't have height constraint.
|
|
@@ -2130,7 +2130,7 @@ cacheLayout(
|
|
|
2130
2130
|
clear): GridStackEngine;
|
|
2131
2131
|
```
|
|
2132
2132
|
|
|
2133
|
-
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)
|
|
2134
2134
|
|
|
2135
2135
|
call to cache the given layout internally to the given location so we can restore back when column changes size
|
|
2136
2136
|
|
|
@@ -2152,7 +2152,7 @@ call to cache the given layout internally to the given location so we can restor
|
|
|
2152
2152
|
cacheOneLayout(n, column): GridStackEngine;
|
|
2153
2153
|
```
|
|
2154
2154
|
|
|
2155
|
-
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)
|
|
2156
2156
|
|
|
2157
2157
|
call to cache the given node layout internally to the given location so we can restore back when column changes size
|
|
2158
2158
|
|
|
@@ -2194,7 +2194,7 @@ true if x,y or w,h are different after clamping to min/max
|
|
|
2194
2194
|
cleanupNode(node): GridStackEngine;
|
|
2195
2195
|
```
|
|
2196
2196
|
|
|
2197
|
-
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)
|
|
2198
2198
|
|
|
2199
2199
|
called to remove all internal values but the _id
|
|
2200
2200
|
|
|
@@ -2357,7 +2357,7 @@ Defined in: [gridstack-engine.ts:1002](https://github.com/adumesny/gridstack.js/
|
|
|
2357
2357
|
protected findCacheLayout(n, column): number;
|
|
2358
2358
|
```
|
|
2359
2359
|
|
|
2360
|
-
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)
|
|
2361
2361
|
|
|
2362
2362
|
###### Parameters
|
|
2363
2363
|
|
|
@@ -2680,7 +2680,7 @@ engine.removeNode(node, true, true);
|
|
|
2680
2680
|
removeNodeFromLayoutCache(n): void;
|
|
2681
2681
|
```
|
|
2682
2682
|
|
|
2683
|
-
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)
|
|
2684
2684
|
|
|
2685
2685
|
###### Parameters
|
|
2686
2686
|
|
|
@@ -2698,21 +2698,21 @@ Defined in: [gridstack-engine.ts:1226](https://github.com/adumesny/gridstack.js/
|
|
|
2698
2698
|
save(
|
|
2699
2699
|
saveElement,
|
|
2700
2700
|
saveCB?,
|
|
2701
|
-
|
|
2701
|
+
column?): GridStackNode[];
|
|
2702
2702
|
```
|
|
2703
2703
|
|
|
2704
|
-
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)
|
|
2705
2705
|
|
|
2706
|
-
saves a copy of the largest column layout (eg 12 even when rendering
|
|
2707
|
-
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
|
|
2708
2708
|
|
|
2709
2709
|
###### Parameters
|
|
2710
2710
|
|
|
2711
2711
|
| Parameter | Type | Default value | Description |
|
|
2712
2712
|
| ------ | ------ | ------ | ------ |
|
|
2713
|
-
| `saveElement` | `boolean` | `true` |
|
|
2714
|
-
| `saveCB?` | [`SaveFcn`](#savefcn) | `undefined` |
|
|
2715
|
-
| `
|
|
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. |
|
|
2716
2716
|
|
|
2717
2717
|
###### Returns
|
|
2718
2718
|
|
|
@@ -2845,7 +2845,7 @@ new Utils(): Utils;
|
|
|
2845
2845
|
static addElStyles(el, styles): void;
|
|
2846
2846
|
```
|
|
2847
2847
|
|
|
2848
|
-
Defined in: [utils.ts:
|
|
2848
|
+
Defined in: [utils.ts:690](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L690)
|
|
2849
2849
|
|
|
2850
2850
|
###### Parameters
|
|
2851
2851
|
|
|
@@ -2864,7 +2864,7 @@ Defined in: [utils.ts:691](https://github.com/adumesny/gridstack.js/blob/master/
|
|
|
2864
2864
|
static appendTo(el, parent): void;
|
|
2865
2865
|
```
|
|
2866
2866
|
|
|
2867
|
-
Defined in: [utils.ts:
|
|
2867
|
+
Defined in: [utils.ts:672](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L672)
|
|
2868
2868
|
|
|
2869
2869
|
###### Parameters
|
|
2870
2870
|
|
|
@@ -2943,7 +2943,7 @@ const overlap = Utils.areaIntercept(
|
|
|
2943
2943
|
static canBeRotated(n): boolean;
|
|
2944
2944
|
```
|
|
2945
2945
|
|
|
2946
|
-
Defined in: [utils.ts:
|
|
2946
|
+
Defined in: [utils.ts:793](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L793)
|
|
2947
2947
|
|
|
2948
2948
|
true if the item can be rotated (checking for prop, not space available)
|
|
2949
2949
|
|
|
@@ -2963,7 +2963,7 @@ true if the item can be rotated (checking for prop, not space available)
|
|
|
2963
2963
|
static clone<T>(obj): T;
|
|
2964
2964
|
```
|
|
2965
2965
|
|
|
2966
|
-
Defined in: [utils.ts:
|
|
2966
|
+
Defined in: [utils.ts:635](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L635)
|
|
2967
2967
|
|
|
2968
2968
|
single level clone, returning a new object with same top fields. This will share sub objects and arrays
|
|
2969
2969
|
|
|
@@ -2989,7 +2989,7 @@ single level clone, returning a new object with same top fields. This will share
|
|
|
2989
2989
|
static cloneDeep<T>(obj): T;
|
|
2990
2990
|
```
|
|
2991
2991
|
|
|
2992
|
-
Defined in: [utils.ts:
|
|
2992
|
+
Defined in: [utils.ts:651](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L651)
|
|
2993
2993
|
|
|
2994
2994
|
Recursive clone version that returns a full copy, checking for nested objects and arrays ONLY.
|
|
2995
2995
|
Note: this will use as-is any key starting with double __ (and not copy inside) some lib have circular dependencies.
|
|
@@ -3016,7 +3016,7 @@ Note: this will use as-is any key starting with double __ (and not copy inside)
|
|
|
3016
3016
|
static cloneNode(el): HTMLElement;
|
|
3017
3017
|
```
|
|
3018
3018
|
|
|
3019
|
-
Defined in: [utils.ts:
|
|
3019
|
+
Defined in: [utils.ts:666](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L666)
|
|
3020
3020
|
|
|
3021
3021
|
deep clone the given HTML node, removing teh unique id field
|
|
3022
3022
|
|
|
@@ -3226,7 +3226,7 @@ const fromShadow = Utils.getElements('.item', shadowRoot);
|
|
|
3226
3226
|
static getValuesFromTransformedElement(parent): DragTransform;
|
|
3227
3227
|
```
|
|
3228
3228
|
|
|
3229
|
-
Defined in: [utils.ts:
|
|
3229
|
+
Defined in: [utils.ts:750](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L750)
|
|
3230
3230
|
|
|
3231
3231
|
defines an element that is used to get the offset and scale from grid transforms
|
|
3232
3232
|
returns the scale and offsets from said element
|
|
@@ -3247,7 +3247,7 @@ returns the scale and offsets from said element
|
|
|
3247
3247
|
static initEvent<T>(e, info): T;
|
|
3248
3248
|
```
|
|
3249
3249
|
|
|
3250
|
-
Defined in: [utils.ts:
|
|
3250
|
+
Defined in: [utils.ts:707](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L707)
|
|
3251
3251
|
|
|
3252
3252
|
###### Type Parameters
|
|
3253
3253
|
|
|
@@ -3441,7 +3441,7 @@ removes internal fields '_' and default values for saving
|
|
|
3441
3441
|
static removePositioningStyles(el): void;
|
|
3442
3442
|
```
|
|
3443
3443
|
|
|
3444
|
-
Defined in: [utils.ts:
|
|
3444
|
+
Defined in: [utils.ts:542](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L542)
|
|
3445
3445
|
|
|
3446
3446
|
###### Parameters
|
|
3447
3447
|
|
|
@@ -3565,7 +3565,7 @@ static simulateMouseEvent(
|
|
|
3565
3565
|
target?): void;
|
|
3566
3566
|
```
|
|
3567
3567
|
|
|
3568
|
-
Defined in: [utils.ts:
|
|
3568
|
+
Defined in: [utils.ts:723](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L723)
|
|
3569
3569
|
|
|
3570
3570
|
copies the MouseEvent (or convert Touch) properties and sends it as another event to the given target
|
|
3571
3571
|
|
|
@@ -3620,7 +3620,7 @@ static swap(
|
|
|
3620
3620
|
b): void;
|
|
3621
3621
|
```
|
|
3622
3622
|
|
|
3623
|
-
Defined in: [utils.ts:
|
|
3623
|
+
Defined in: [utils.ts:774](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L774)
|
|
3624
3624
|
|
|
3625
3625
|
swap the given object 2 field values
|
|
3626
3626
|
|
|
@@ -3642,7 +3642,7 @@ swap the given object 2 field values
|
|
|
3642
3642
|
static throttle(func, delay): () => void;
|
|
3643
3643
|
```
|
|
3644
3644
|
|
|
3645
|
-
Defined in: [utils.ts:
|
|
3645
|
+
Defined in: [utils.ts:532](https://github.com/adumesny/gridstack.js/blob/master/src/utils.ts#L532)
|
|
3646
3646
|
|
|
3647
3647
|
delay calling the given function for given delay, preventing new calls from happening while waiting
|
|
3648
3648
|
|