gridstack 8.0.0 → 8.1.0

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 (193) hide show
  1. package/README.md +14 -11
  2. package/dist/dd-base-impl.d.ts +1 -1
  3. package/dist/dd-base-impl.js +1 -1
  4. package/dist/dd-base-impl.js.map +1 -1
  5. package/dist/dd-draggable.d.ts +3 -2
  6. package/dist/dd-draggable.js +10 -9
  7. package/dist/dd-draggable.js.map +1 -1
  8. package/dist/dd-droppable.d.ts +1 -1
  9. package/dist/dd-droppable.js +1 -1
  10. package/dist/dd-droppable.js.map +1 -1
  11. package/dist/dd-element.d.ts +1 -1
  12. package/dist/dd-element.js +1 -1
  13. package/dist/dd-element.js.map +1 -1
  14. package/dist/dd-gridstack.d.ts +1 -1
  15. package/dist/dd-gridstack.js +1 -1
  16. package/dist/dd-gridstack.js.map +1 -1
  17. package/dist/dd-manager.d.ts +1 -1
  18. package/dist/dd-manager.js +1 -1
  19. package/dist/dd-manager.js.map +1 -1
  20. package/dist/dd-resizable-handle.d.ts +1 -1
  21. package/dist/dd-resizable-handle.js +1 -1
  22. package/dist/dd-resizable-handle.js.map +1 -1
  23. package/dist/dd-resizable.d.ts +1 -1
  24. package/dist/dd-resizable.js +1 -1
  25. package/dist/dd-resizable.js.map +1 -1
  26. package/dist/dd-touch.d.ts +1 -1
  27. package/dist/dd-touch.js +1 -1
  28. package/dist/dd-touch.js.map +1 -1
  29. package/dist/es5/dd-base-impl.d.ts +1 -1
  30. package/dist/es5/dd-base-impl.js +1 -1
  31. package/dist/es5/dd-base-impl.js.map +1 -1
  32. package/dist/es5/dd-draggable.d.ts +3 -2
  33. package/dist/es5/dd-draggable.js +10 -9
  34. package/dist/es5/dd-draggable.js.map +1 -1
  35. package/dist/es5/dd-droppable.d.ts +1 -1
  36. package/dist/es5/dd-droppable.js +1 -1
  37. package/dist/es5/dd-droppable.js.map +1 -1
  38. package/dist/es5/dd-element.d.ts +1 -1
  39. package/dist/es5/dd-element.js +1 -1
  40. package/dist/es5/dd-element.js.map +1 -1
  41. package/dist/es5/dd-gridstack.d.ts +1 -1
  42. package/dist/es5/dd-gridstack.js +1 -1
  43. package/dist/es5/dd-gridstack.js.map +1 -1
  44. package/dist/es5/dd-manager.d.ts +1 -1
  45. package/dist/es5/dd-manager.js +1 -1
  46. package/dist/es5/dd-manager.js.map +1 -1
  47. package/dist/es5/dd-resizable-handle.d.ts +1 -1
  48. package/dist/es5/dd-resizable-handle.js +1 -1
  49. package/dist/es5/dd-resizable-handle.js.map +1 -1
  50. package/dist/es5/dd-resizable.d.ts +1 -1
  51. package/dist/es5/dd-resizable.js +1 -1
  52. package/dist/es5/dd-resizable.js.map +1 -1
  53. package/dist/es5/dd-touch.d.ts +1 -1
  54. package/dist/es5/dd-touch.js +1 -1
  55. package/dist/es5/dd-touch.js.map +1 -1
  56. package/dist/es5/gridstack-all.js +1 -1
  57. package/dist/es5/gridstack-all.js.LICENSE.txt +1 -1
  58. package/dist/es5/gridstack-all.js.map +1 -1
  59. package/dist/es5/gridstack-engine.d.ts +1 -1
  60. package/dist/es5/gridstack-engine.js +1 -1
  61. package/dist/es5/gridstack-engine.js.map +1 -1
  62. package/dist/es5/gridstack-poly.js +1 -1
  63. package/dist/es5/gridstack.d.ts +6 -3
  64. package/dist/es5/gridstack.js +18 -25
  65. package/dist/es5/gridstack.js.map +1 -1
  66. package/dist/es5/types.d.ts +5 -3
  67. package/dist/es5/types.js +1 -1
  68. package/dist/es5/types.js.map +1 -1
  69. package/dist/es5/utils.d.ts +6 -6
  70. package/dist/es5/utils.js +31 -20
  71. package/dist/es5/utils.js.map +1 -1
  72. package/dist/gridstack-all.js +1 -1
  73. package/dist/gridstack-all.js.LICENSE.txt +1 -1
  74. package/dist/gridstack-all.js.map +1 -1
  75. package/dist/gridstack-engine.d.ts +1 -1
  76. package/dist/gridstack-engine.js +1 -1
  77. package/dist/gridstack-engine.js.map +1 -1
  78. package/dist/gridstack-extra.css +180 -240
  79. package/dist/gridstack-extra.min.css +1 -1
  80. package/dist/gridstack.css +99 -106
  81. package/dist/gridstack.d.ts +6 -3
  82. package/dist/gridstack.js +16 -25
  83. package/dist/gridstack.js.map +1 -1
  84. package/dist/gridstack.min.css +1 -1
  85. package/dist/ng/gridstack-item.component.d.ts +1 -1
  86. package/dist/ng/gridstack-item.component.js +1 -1
  87. package/dist/ng/gridstack.component.d.ts +1 -1
  88. package/dist/ng/gridstack.component.js +1 -1
  89. package/dist/src/gridstack-extra.scss +9 -11
  90. package/dist/src/gridstack.scss +108 -89
  91. package/dist/types.d.ts +5 -3
  92. package/dist/types.js +1 -1
  93. package/dist/types.js.map +1 -1
  94. package/dist/utils.d.ts +6 -6
  95. package/dist/utils.js +29 -20
  96. package/dist/utils.js.map +1 -1
  97. package/doc/CHANGES.md +15 -0
  98. package/doc/README.md +8 -14
  99. package/package.json +1 -1
  100. package/dist_save/angular/README.md +0 -94
  101. package/dist_save/angular/gridstack-item.component.ts +0 -72
  102. package/dist_save/angular/gridstack.component.ts +0 -199
  103. package/dist_save/dd-base-impl.d.ts +0 -20
  104. package/dist_save/dd-base-impl.js +0 -36
  105. package/dist_save/dd-base-impl.js.map +0 -1
  106. package/dist_save/dd-draggable.d.ts +0 -28
  107. package/dist_save/dd-draggable.js +0 -343
  108. package/dist_save/dd-draggable.js.map +0 -1
  109. package/dist_save/dd-droppable.d.ts +0 -26
  110. package/dist_save/dd-droppable.js +0 -149
  111. package/dist_save/dd-droppable.js.map +0 -1
  112. package/dist_save/dd-element.d.ts +0 -27
  113. package/dist_save/dd-element.js +0 -95
  114. package/dist_save/dd-element.js.map +0 -1
  115. package/dist_save/dd-gridstack.d.ts +0 -34
  116. package/dist_save/dd-gridstack.js +0 -125
  117. package/dist_save/dd-gridstack.js.map +0 -1
  118. package/dist_save/dd-manager.d.ts +0 -22
  119. package/dist_save/dd-manager.js +0 -14
  120. package/dist_save/dd-manager.js.map +0 -1
  121. package/dist_save/dd-resizable-handle.d.ts +0 -14
  122. package/dist_save/dd-resizable-handle.js +0 -106
  123. package/dist_save/dd-resizable-handle.js.map +0 -1
  124. package/dist_save/dd-resizable.d.ts +0 -28
  125. package/dist_save/dd-resizable.js +0 -294
  126. package/dist_save/dd-resizable.js.map +0 -1
  127. package/dist_save/dd-touch.d.ts +0 -33
  128. package/dist_save/dd-touch.js +0 -183
  129. package/dist_save/dd-touch.js.map +0 -1
  130. package/dist_save/es5/dd-base-impl.d.ts +0 -20
  131. package/dist_save/es5/dd-base-impl.js +0 -41
  132. package/dist_save/es5/dd-base-impl.js.map +0 -1
  133. package/dist_save/es5/dd-draggable.d.ts +0 -28
  134. package/dist_save/es5/dd-draggable.js +0 -366
  135. package/dist_save/es5/dd-draggable.js.map +0 -1
  136. package/dist_save/es5/dd-droppable.d.ts +0 -26
  137. package/dist_save/es5/dd-droppable.js +0 -180
  138. package/dist_save/es5/dd-droppable.js.map +0 -1
  139. package/dist_save/es5/dd-element.d.ts +0 -27
  140. package/dist_save/es5/dd-element.js +0 -96
  141. package/dist_save/es5/dd-element.js.map +0 -1
  142. package/dist_save/es5/dd-gridstack.d.ts +0 -34
  143. package/dist_save/es5/dd-gridstack.js +0 -145
  144. package/dist_save/es5/dd-gridstack.js.map +0 -1
  145. package/dist_save/es5/dd-manager.d.ts +0 -22
  146. package/dist_save/es5/dd-manager.js +0 -17
  147. package/dist_save/es5/dd-manager.js.map +0 -1
  148. package/dist_save/es5/dd-resizable-handle.d.ts +0 -14
  149. package/dist_save/es5/dd-resizable-handle.js +0 -107
  150. package/dist_save/es5/dd-resizable-handle.js.map +0 -1
  151. package/dist_save/es5/dd-resizable.d.ts +0 -28
  152. package/dist_save/es5/dd-resizable.js +0 -316
  153. package/dist_save/es5/dd-resizable.js.map +0 -1
  154. package/dist_save/es5/dd-touch.d.ts +0 -33
  155. package/dist_save/es5/dd-touch.js +0 -186
  156. package/dist_save/es5/dd-touch.js.map +0 -1
  157. package/dist_save/es5/gridstack-all.js +0 -3
  158. package/dist_save/es5/gridstack-all.js.LICENSE.txt +0 -7
  159. package/dist_save/es5/gridstack-all.js.map +0 -1
  160. package/dist_save/es5/gridstack-engine.d.ts +0 -102
  161. package/dist_save/es5/gridstack-engine.js +0 -997
  162. package/dist_save/es5/gridstack-engine.js.map +0 -1
  163. package/dist_save/es5/gridstack-poly.js +0 -356
  164. package/dist_save/es5/gridstack.d.ts +0 -376
  165. package/dist_save/es5/gridstack.js +0 -2238
  166. package/dist_save/es5/gridstack.js.map +0 -1
  167. package/dist_save/es5/types.d.ts +0 -284
  168. package/dist_save/es5/types.js +0 -36
  169. package/dist_save/es5/types.js.map +0 -1
  170. package/dist_save/es5/utils.d.ts +0 -95
  171. package/dist_save/es5/utils.js +0 -590
  172. package/dist_save/es5/utils.js.map +0 -1
  173. package/dist_save/gridstack-all.js +0 -3
  174. package/dist_save/gridstack-all.js.LICENSE.txt +0 -7
  175. package/dist_save/gridstack-all.js.map +0 -1
  176. package/dist_save/gridstack-engine.d.ts +0 -102
  177. package/dist_save/gridstack-engine.js +0 -956
  178. package/dist_save/gridstack-engine.js.map +0 -1
  179. package/dist_save/gridstack-extra.css +0 -433
  180. package/dist_save/gridstack-extra.min.css +0 -1
  181. package/dist_save/gridstack.css +0 -226
  182. package/dist_save/gridstack.d.ts +0 -376
  183. package/dist_save/gridstack.js +0 -2162
  184. package/dist_save/gridstack.js.map +0 -1
  185. package/dist_save/gridstack.min.css +0 -1
  186. package/dist_save/src/gridstack-extra.scss +0 -27
  187. package/dist_save/src/gridstack.scss +0 -131
  188. package/dist_save/types.d.ts +0 -284
  189. package/dist_save/types.js +0 -36
  190. package/dist_save/types.js.map +0 -1
  191. package/dist_save/utils.d.ts +0 -95
  192. package/dist_save/utils.js +0 -548
  193. package/dist_save/utils.js.map +0 -1
@@ -1,376 +0,0 @@
1
- /*!
2
- * GridStack 7.3.0-dev
3
- * https://gridstackjs.com/
4
- *
5
- * Copyright (c) 2021-2022 Alain Dumesny
6
- * see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
7
- */
8
- import { GridStackEngine } from './gridstack-engine';
9
- import { Utils } from './utils';
10
- import { ColumnOptions, GridItemHTMLElement, GridStackElement, GridStackEventHandlerCallback, GridStackNode, GridStackWidget, numberOrString, DDDragInOpt, GridStackOptions, AddRemoveFcn } from './types';
11
- import { DDGridStack } from './dd-gridstack';
12
- export * from './types';
13
- export * from './utils';
14
- export * from './gridstack-engine';
15
- export * from './dd-gridstack';
16
- export interface GridHTMLElement extends HTMLElement {
17
- gridstack?: GridStack;
18
- }
19
- /** list of possible events, or space separated list of them */
20
- export declare type GridStackEvent = 'added' | 'change' | 'disable' | 'drag' | 'dragstart' | 'dragstop' | 'dropped' | 'enable' | 'removed' | 'resize' | 'resizestart' | 'resizestop' | string;
21
- /** Defines the coordinates of an object */
22
- export interface MousePosition {
23
- top: number;
24
- left: number;
25
- }
26
- /** Defines the position of a cell inside the grid*/
27
- export interface CellPosition {
28
- x: number;
29
- y: number;
30
- }
31
- /**
32
- * Main gridstack class - you will need to call `GridStack.init()` first to initialize your grid.
33
- * Note: your grid elements MUST have the following classes for the CSS layout to work:
34
- * @example
35
- * <div class="grid-stack">
36
- * <div class="grid-stack-item">
37
- * <div class="grid-stack-item-content">Item 1</div>
38
- * </div>
39
- * </div>
40
- */
41
- export declare class GridStack {
42
- /**
43
- * initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
44
- * simply return the existing instance (ignore any passed options). There is also an initAll() version that support
45
- * multiple grids initialization at once. Or you can use addGrid() to create the entire grid from JSON.
46
- * @param options grid options (optional)
47
- * @param elOrString element or CSS selector (first one used) to convert to a grid (default to '.grid-stack' class selector)
48
- *
49
- * @example
50
- * let grid = GridStack.init();
51
- *
52
- * Note: the HTMLElement (of type GridHTMLElement) will store a `gridstack: GridStack` value that can be retrieve later
53
- * let grid = document.querySelector('.grid-stack').gridstack;
54
- */
55
- static init(options?: GridStackOptions, elOrString?: GridStackElement): GridStack;
56
- /**
57
- * Will initialize a list of elements (given a selector) and return an array of grids.
58
- * @param options grid options (optional)
59
- * @param selector elements selector to convert to grids (default to '.grid-stack' class selector)
60
- *
61
- * @example
62
- * let grids = GridStack.initAll();
63
- * grids.forEach(...)
64
- */
65
- static initAll(options?: GridStackOptions, selector?: string): GridStack[];
66
- /**
67
- * call to create a grid with the given options, including loading any children from JSON structure. This will call GridStack.init(), then
68
- * grid.load() on any passed children (recursively). Great alternative to calling init() if you want entire grid to come from
69
- * JSON serialized data, including options.
70
- * @param parent HTML element parent to the grid
71
- * @param opt grids options used to initialize the grid, and list of children
72
- */
73
- static addGrid(parent: HTMLElement, opt?: GridStackOptions): GridStack;
74
- /** call this method to register your engine instead of the default one.
75
- * See instead `GridStackOptions.engineClass` if you only need to
76
- * replace just one instance.
77
- */
78
- static registerEngine(engineClass: typeof GridStackEngine): void;
79
- /** scoping so users can call GridStack.Utils.sort() for example */
80
- static Utils: typeof Utils;
81
- /** scoping so users can call new GridStack.Engine(12) for example */
82
- static Engine: typeof GridStackEngine;
83
- /** the HTML element tied to this grid after it's been initialized */
84
- el: GridHTMLElement;
85
- /** engine used to implement non DOM grid functionality */
86
- engine: GridStackEngine;
87
- /** grid options - public for classes to access, but use methods to modify! */
88
- opts: GridStackOptions;
89
- /** point to a parent grid item if we're nested (inside a grid-item in between 2 Grids) */
90
- parentGridItem?: GridStackNode;
91
- protected static engineClass: typeof GridStackEngine;
92
- /**
93
- * Construct a grid item from the given element and options
94
- * @param el
95
- * @param opts
96
- */
97
- constructor(el: GridHTMLElement, opts?: GridStackOptions);
98
- /**
99
- * add a new widget and returns it.
100
- *
101
- * Widget will be always placed even if result height is more than actual grid height.
102
- * You need to use `willItFit()` before calling addWidget for additional check.
103
- * See also `makeWidget()`.
104
- *
105
- * @example
106
- * let grid = GridStack.init();
107
- * grid.addWidget({w: 3, content: 'hello'});
108
- * grid.addWidget('<div class="grid-stack-item"><div class="grid-stack-item-content">hello</div></div>', {w: 3});
109
- *
110
- * @param el GridStackWidget (which can have content string as well), html element, or string definition to add
111
- * @param options widget position/size options (optional, and ignore if first param is already option) - see GridStackWidget
112
- */
113
- addWidget(els?: GridStackWidget | GridStackElement, options?: GridStackWidget): GridItemHTMLElement;
114
- /**
115
- * Convert an existing gridItem element into a sub-grid with the given (optional) options, else inherit them
116
- * from the parent's subGrid options.
117
- * @param el gridItem element to convert
118
- * @param ops (optional) sub-grid options, else default to node, then parent settings, else defaults
119
- * @param nodeToAdd (optional) node to add to the newly created sub grid (used when dragging over existing regular item)
120
- * @returns newly created grid
121
- */
122
- makeSubGrid(el: GridItemHTMLElement, ops?: GridStackOptions, nodeToAdd?: GridStackNode, saveContent?: boolean): GridStack;
123
- /**
124
- * called when an item was converted into a nested grid to accommodate a dragged over item, but then item leaves - return back
125
- * to the original grid-item. Also called to remove empty sub-grids when last item is dragged out (since re-creating is simple)
126
- */
127
- removeAsSubGrid(nodeThatRemoved?: GridStackNode): void;
128
- /**
129
- /**
130
- * saves the current layout returning a list of widgets for serialization which might include any nested grids.
131
- * @param saveContent if true (default) the latest html inside .grid-stack-content will be saved to GridStackWidget.content field, else it will
132
- * be removed.
133
- * @param saveGridOpt if true (default false), save the grid options itself, so you can call the new GridStack.addGrid()
134
- * to recreate everything from scratch. GridStackOptions.children would then contain the widget list instead.
135
- * @returns list of widgets or full grid option, including .children list of widgets
136
- */
137
- save(saveContent?: boolean, saveGridOpt?: boolean): GridStackWidget[] | GridStackOptions;
138
- /**
139
- * load the widgets from a list. This will call update() on each (matching by id) or add/remove widgets that are not there.
140
- *
141
- * @param layout list of widgets definition to update/create
142
- * @param addAndRemove boolean (default true) or callback method can be passed to control if and how missing widgets can be added/removed, giving
143
- * the user control of insertion.
144
- *
145
- * @example
146
- * see http://gridstackjs.com/demo/serialization.html
147
- **/
148
- load(layout: GridStackWidget[], addRemove?: boolean | AddRemoveFcn): GridStack;
149
- /**
150
- * use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
151
- * and get a single event callback. You will see no changes until `batchUpdate(false)` is called.
152
- */
153
- batchUpdate(flag?: boolean): GridStack;
154
- /**
155
- * Gets current cell height.
156
- */
157
- getCellHeight(forcePixel?: boolean): number;
158
- /**
159
- * Update current cell height - see `GridStackOptions.cellHeight` for format.
160
- * This method rebuilds an internal CSS style sheet.
161
- * Note: You can expect performance issues if call this method too often.
162
- *
163
- * @param val the cell height. If not passed (undefined), cells content will be made square (match width minus margin),
164
- * if pass 0 the CSS will be generated by the application instead.
165
- * @param update (Optional) if false, styles will not be updated
166
- *
167
- * @example
168
- * grid.cellHeight(100); // same as 100px
169
- * grid.cellHeight('70px');
170
- * grid.cellHeight(grid.cellWidth() * 1.2);
171
- */
172
- cellHeight(val?: numberOrString, update?: boolean): GridStack;
173
- /** Gets current cell width. */
174
- cellWidth(): number;
175
- /** return our expected width (or parent) for 1 column check */
176
- protected _widthOrContainer(): number;
177
- /** re-layout grid items to reclaim any empty space */
178
- compact(): GridStack;
179
- /**
180
- * set the number of columns in the grid. Will update existing widgets to conform to new number of columns,
181
- * as well as cache the original layout so you can revert back to previous positions without loss.
182
- * Requires `gridstack-extra.css` or `gridstack-extra.min.css` for [2-11],
183
- * else you will need to generate correct CSS (see https://github.com/gridstack/gridstack.js#change-grid-columns)
184
- * @param column - Integer > 0 (default 12).
185
- * @param layout specify the type of re-layout that will happen (position, size, etc...).
186
- * Note: items will never be outside of the current column boundaries. default (moveScale). Ignored for 1 column
187
- */
188
- column(column: number, layout?: ColumnOptions): GridStack;
189
- /**
190
- * get the number of columns in the grid (default 12)
191
- */
192
- getColumn(): number;
193
- /** returns an array of grid HTML elements (no placeholder) - used to iterate through our children in DOM order */
194
- getGridItems(): GridItemHTMLElement[];
195
- /**
196
- * Destroys a grid instance. DO NOT CALL any methods or access any vars after this as it will free up members.
197
- * @param removeDOM if `false` grid and items HTML elements will not be removed from the DOM (Optional. Default `true`).
198
- */
199
- destroy(removeDOM?: boolean): GridStack;
200
- /**
201
- * enable/disable floating widgets (default: `false`) See [example](http://gridstackjs.com/demo/float.html)
202
- */
203
- float(val: boolean): GridStack;
204
- /**
205
- * get the current float mode
206
- */
207
- getFloat(): boolean;
208
- /**
209
- * Get the position of the cell under a pixel on screen.
210
- * @param position the position of the pixel to resolve in
211
- * absolute coordinates, as an object with top and left properties
212
- * @param useDocRelative if true, value will be based on document position vs parent position (Optional. Default false).
213
- * Useful when grid is within `position: relative` element
214
- *
215
- * Returns an object with properties `x` and `y` i.e. the column and row in the grid.
216
- */
217
- getCellFromPixel(position: MousePosition, useDocRelative?: boolean): CellPosition;
218
- /** returns the current number of rows, which will be at least `minRow` if set */
219
- getRow(): number;
220
- /**
221
- * Checks if specified area is empty.
222
- * @param x the position x.
223
- * @param y the position y.
224
- * @param w the width of to check
225
- * @param h the height of to check
226
- */
227
- isAreaEmpty(x: number, y: number, w: number, h: number): boolean;
228
- /**
229
- * If you add elements to your grid by hand, you have to tell gridstack afterwards to make them widgets.
230
- * If you want gridstack to add the elements for you, use `addWidget()` instead.
231
- * Makes the given element a widget and returns it.
232
- * @param els widget or single selector to convert.
233
- *
234
- * @example
235
- * let grid = GridStack.init();
236
- * grid.el.appendChild('<div id="gsi-1" gs-w="3"></div>');
237
- * grid.makeWidget('#gsi-1');
238
- */
239
- makeWidget(els: GridStackElement): GridItemHTMLElement;
240
- /**
241
- * Event handler that extracts our CustomEvent data out automatically for receiving custom
242
- * notifications (see doc for supported events)
243
- * @param name of the event (see possible values) or list of names space separated
244
- * @param callback function called with event and optional second/third param
245
- * (see README documentation for each signature).
246
- *
247
- * @example
248
- * grid.on('added', function(e, items) { log('added ', items)} );
249
- * or
250
- * grid.on('added removed change', function(e, items) { log(e.type, items)} );
251
- *
252
- * Note: in some cases it is the same as calling native handler and parsing the event.
253
- * grid.el.addEventListener('added', function(event) { log('added ', event.detail)} );
254
- *
255
- */
256
- on(name: GridStackEvent, callback: GridStackEventHandlerCallback): GridStack;
257
- /**
258
- * unsubscribe from the 'on' event below
259
- * @param name of the event (see possible values)
260
- */
261
- off(name: GridStackEvent): GridStack;
262
- /**
263
- * Removes widget from the grid.
264
- * @param el widget or selector to modify
265
- * @param removeDOM if `false` DOM element won't be removed from the tree (Default? true).
266
- * @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
267
- */
268
- removeWidget(els: GridStackElement, removeDOM?: boolean, triggerEvent?: boolean): GridStack;
269
- /**
270
- * Removes all widgets from the grid.
271
- * @param removeDOM if `false` DOM elements won't be removed from the tree (Default? `true`).
272
- */
273
- removeAll(removeDOM?: boolean): GridStack;
274
- /**
275
- * Toggle the grid animation state. Toggles the `grid-stack-animate` class.
276
- * @param doAnimate if true the grid will animate.
277
- */
278
- setAnimation(doAnimate: boolean): GridStack;
279
- /**
280
- * Toggle the grid static state, which permanently removes/add Drag&Drop support, unlike disable()/enable() that just turns it off/on.
281
- * Also toggle the grid-stack-static class.
282
- * @param val if true the grid become static.
283
- * @param updateClass true (default) if css class gets updated
284
- * @param recurse true (default) if sub-grids also get updated
285
- */
286
- setStatic(val: boolean, updateClass?: boolean, recurse?: boolean): GridStack;
287
- /**
288
- * Updates widget position/size and other info. Note: if you need to call this on all nodes, use load() instead which will update what changed.
289
- * @param els widget or selector of objects to modify (note: setting the same x,y for multiple items will be indeterministic and likely unwanted)
290
- * @param opt new widget options (x,y,w,h, etc..). Only those set will be updated.
291
- */
292
- update(els: GridStackElement, opt: GridStackWidget): GridStack;
293
- /**
294
- * Updates the margins which will set all 4 sides at once - see `GridStackOptions.margin` for format options (CSS string format of 1,2,4 values or single number).
295
- * @param value margin value
296
- */
297
- margin(value: numberOrString): GridStack;
298
- /** returns current margin number value (undefined if 4 sides don't match) */
299
- getMargin(): number;
300
- /**
301
- * Returns true if the height of the grid will be less than the vertical
302
- * constraint. Always returns true if grid doesn't have height constraint.
303
- * @param node contains x,y,w,h,auto-position options
304
- *
305
- * @example
306
- * if (grid.willItFit(newWidget)) {
307
- * grid.addWidget(newWidget);
308
- * } else {
309
- * alert('Not enough free space to place the widget');
310
- * }
311
- */
312
- willItFit(node: GridStackWidget): boolean;
313
- /**
314
- * called when we are being resized by the window - check if the one Column Mode needs to be turned on/off
315
- * and remember the prev columns we used, or get our count from parent, as well as check for auto cell height (square)
316
- */
317
- onParentResize(): GridStack;
318
- /** add or remove the window size event handler */
319
- protected _updateWindowResizeEvent(forceRemove?: boolean): GridStack;
320
- static GDRev: string;
321
- /** get the global (but static to this code) DD implementation */
322
- static getDD(): DDGridStack;
323
- /**
324
- * call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
325
- * Called during GridStack.init() as options, but can also be called directly (last param are used) in case the toolbar
326
- * is dynamically create and needs to be set later.
327
- * @param dragIn string selector (ex: '.sidebar .grid-stack-item')
328
- * @param dragInOptions options - see DDDragInOpt. (default: {handle: '.grid-stack-item-content', appendTo: 'body'}
329
- **/
330
- static setupDragIn(dragIn?: string, dragInOptions?: DDDragInOpt): void;
331
- /**
332
- * Enables/Disables dragging by the user of specific grid element. If you want all items, and have it affect future items, use enableMove() instead. No-op for static grids.
333
- * IF you are looking to prevent an item from moving (due to being pushed around by another during collision) use locked property instead.
334
- * @param els widget or selector to modify.
335
- * @param val if true widget will be draggable.
336
- */
337
- movable(els: GridStackElement, val: boolean): GridStack;
338
- /**
339
- * Enables/Disables user resizing of specific grid element. If you want all items, and have it affect future items, use enableResize() instead. No-op for static grids.
340
- * @param els widget or selector to modify
341
- * @param val if true widget will be resizable.
342
- */
343
- resizable(els: GridStackElement, val: boolean): GridStack;
344
- /**
345
- * Temporarily disables widgets moving/resizing.
346
- * If you want a more permanent way (which freezes up resources) use `setStatic(true)` instead.
347
- * Note: no-op for static grid
348
- * This is a shortcut for:
349
- * @example
350
- * grid.enableMove(false);
351
- * grid.enableResize(false);
352
- * @param recurse true (default) if sub-grids also get updated
353
- */
354
- disable(recurse?: boolean): GridStack;
355
- /**
356
- * Re-enables widgets moving/resizing - see disable().
357
- * Note: no-op for static grid.
358
- * This is a shortcut for:
359
- * @example
360
- * grid.enableMove(true);
361
- * grid.enableResize(true);
362
- * @param recurse true (default) if sub-grids also get updated
363
- */
364
- enable(recurse?: boolean): GridStack;
365
- /**
366
- * Enables/disables widget moving. No-op for static grids.
367
- * @param recurse true (default) if sub-grids also get updated
368
- */
369
- enableMove(doEnable: boolean, recurse?: boolean): GridStack;
370
- /**
371
- * Enables/disables widget resizing. No-op for static grids.
372
- * @param recurse true (default) if sub-grids also get updated
373
- */
374
- enableResize(doEnable: boolean, recurse?: boolean): GridStack;
375
- commit(): GridStack;
376
- }