gridstack 5.1.1 → 6.0.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.
- package/README.md +49 -38
- package/dist/{h5/dd-base-impl.d.ts → dd-base-impl.d.ts} +1 -1
- package/dist/{h5/dd-base-impl.js → dd-base-impl.js} +1 -3
- package/dist/dd-base-impl.js.map +1 -0
- package/dist/{es5/h5/dd-draggable.d.ts → dd-draggable.d.ts} +6 -7
- package/dist/dd-draggable.js +313 -0
- package/dist/dd-draggable.js.map +1 -0
- package/dist/{h5/dd-droppable.d.ts → dd-droppable.d.ts} +3 -2
- package/dist/dd-droppable.js +149 -0
- package/dist/dd-droppable.js.map +1 -0
- package/dist/{h5/dd-element.d.ts → dd-element.d.ts} +2 -2
- package/dist/{h5/dd-element.js → dd-element.js} +1 -1
- package/dist/dd-element.js.map +1 -0
- package/dist/dd-gridstack.d.ts +36 -0
- package/dist/{gridstack-dd.js → dd-gridstack.js} +154 -52
- package/dist/dd-gridstack.js.map +1 -0
- package/dist/dd-manager.d.ts +17 -0
- package/dist/{h5/dd-manager.js → dd-manager.js} +4 -1
- package/dist/dd-manager.js.map +1 -0
- package/dist/{es5/h5/dd-resizable-handle.d.ts → dd-resizable-handle.d.ts} +1 -1
- package/dist/{h5/dd-resizable-handle.js → dd-resizable-handle.js} +32 -8
- package/dist/dd-resizable-handle.js.map +1 -0
- package/dist/{es5/h5/dd-resizable.d.ts → dd-resizable.d.ts} +2 -2
- package/dist/{h5/dd-resizable.js → dd-resizable.js} +28 -27
- package/dist/dd-resizable.js.map +1 -0
- package/dist/dd-touch.d.ts +33 -0
- package/dist/dd-touch.js +179 -0
- package/dist/dd-touch.js.map +1 -0
- package/dist/es5/{h5/dd-base-impl.d.ts → dd-base-impl.d.ts} +1 -1
- package/dist/es5/{h5/dd-base-impl.js → dd-base-impl.js} +1 -3
- package/dist/es5/dd-base-impl.js.map +1 -0
- package/dist/{h5 → es5}/dd-draggable.d.ts +6 -7
- package/dist/es5/dd-draggable.js +335 -0
- package/dist/es5/dd-draggable.js.map +1 -0
- package/dist/es5/{h5/dd-droppable.d.ts → dd-droppable.d.ts} +3 -2
- package/dist/es5/dd-droppable.js +180 -0
- package/dist/es5/dd-droppable.js.map +1 -0
- package/dist/es5/{h5/dd-element.d.ts → dd-element.d.ts} +2 -2
- package/dist/es5/{h5/dd-element.js → dd-element.js} +1 -1
- package/dist/es5/dd-element.js.map +1 -0
- package/dist/es5/dd-gridstack.d.ts +36 -0
- package/dist/es5/{gridstack-dd.js → dd-gridstack.js} +164 -71
- package/dist/es5/dd-gridstack.js.map +1 -0
- package/dist/es5/dd-manager.d.ts +17 -0
- package/dist/es5/{h5/dd-manager.js → dd-manager.js} +4 -1
- package/dist/es5/dd-manager.js.map +1 -0
- package/dist/{h5 → es5}/dd-resizable-handle.d.ts +1 -1
- package/dist/es5/{h5/dd-resizable-handle.js → dd-resizable-handle.js} +32 -8
- package/dist/es5/dd-resizable-handle.js.map +1 -0
- package/dist/{h5 → es5}/dd-resizable.d.ts +2 -2
- package/dist/es5/{h5/dd-resizable.js → dd-resizable.js} +28 -27
- package/dist/es5/dd-resizable.js.map +1 -0
- package/dist/es5/dd-touch.d.ts +33 -0
- package/dist/es5/dd-touch.js +182 -0
- package/dist/es5/dd-touch.js.map +1 -0
- package/dist/es5/gridstack-all.js +3 -0
- package/dist/{gridstack-static.js.LICENSE.txt → es5/gridstack-all.js.LICENSE.txt} +1 -1
- package/dist/es5/gridstack-all.js.map +1 -0
- package/dist/es5/gridstack-engine.d.ts +2 -3
- package/dist/es5/gridstack-engine.js +18 -18
- package/dist/es5/gridstack-engine.js.map +1 -1
- package/dist/es5/gridstack-poly.js +1 -1
- package/dist/es5/gridstack.d.ts +8 -9
- package/dist/es5/gridstack.js +47 -35
- package/dist/es5/gridstack.js.map +1 -1
- package/dist/es5/types.d.ts +12 -16
- package/dist/es5/types.js +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/es5/utils.d.ts +11 -1
- package/dist/es5/utils.js +67 -6
- package/dist/es5/utils.js.map +1 -1
- package/dist/gridstack-all.js +3 -0
- package/dist/{es5/gridstack-h5.js.LICENSE.txt → gridstack-all.js.LICENSE.txt} +1 -1
- package/dist/gridstack-all.js.map +1 -0
- package/dist/gridstack-engine.d.ts +2 -3
- package/dist/gridstack-engine.js +17 -18
- package/dist/gridstack-engine.js.map +1 -1
- package/dist/gridstack.css +21 -9
- package/dist/gridstack.d.ts +8 -9
- package/dist/gridstack.js +45 -35
- package/dist/gridstack.js.map +1 -1
- package/dist/gridstack.min.css +1 -1
- package/dist/src/gridstack.scss +19 -12
- package/dist/types.d.ts +12 -16
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +11 -1
- package/dist/utils.js +64 -6
- package/dist/utils.js.map +1 -1
- package/doc/CHANGES.md +7 -0
- package/doc/README.md +17 -18
- package/package.json +2 -2
- package/dist/es5/gridstack-dd.d.ts +0 -35
- package/dist/es5/gridstack-dd.js.map +0 -1
- package/dist/es5/gridstack-ddi.d.ts +0 -17
- package/dist/es5/gridstack-ddi.js +0 -31
- package/dist/es5/gridstack-ddi.js.map +0 -1
- package/dist/es5/gridstack-h5.d.ts +0 -10
- package/dist/es5/gridstack-h5.js +0 -3
- package/dist/es5/gridstack-h5.js.map +0 -1
- package/dist/es5/gridstack-jq.d.ts +0 -10
- package/dist/es5/gridstack-jq.js +0 -3
- package/dist/es5/gridstack-jq.js.LICENSE.txt +0 -99
- package/dist/es5/gridstack-jq.js.map +0 -1
- package/dist/es5/gridstack-static.d.ts +0 -9
- package/dist/es5/gridstack-static.js +0 -3
- package/dist/es5/gridstack-static.js.LICENSE.txt +0 -7
- package/dist/es5/gridstack-static.js.map +0 -1
- package/dist/es5/h5/dd-base-impl.js.map +0 -1
- package/dist/es5/h5/dd-draggable.js +0 -326
- package/dist/es5/h5/dd-draggable.js.map +0 -1
- package/dist/es5/h5/dd-droppable.js +0 -199
- package/dist/es5/h5/dd-droppable.js.map +0 -1
- package/dist/es5/h5/dd-element.js.map +0 -1
- package/dist/es5/h5/dd-manager.d.ts +0 -8
- package/dist/es5/h5/dd-manager.js.map +0 -1
- package/dist/es5/h5/dd-resizable-handle.js.map +0 -1
- package/dist/es5/h5/dd-resizable.js.map +0 -1
- package/dist/es5/h5/dd-utils.d.ts +0 -19
- package/dist/es5/h5/dd-utils.js +0 -111
- package/dist/es5/h5/dd-utils.js.map +0 -1
- package/dist/es5/h5/gridstack-dd-native.d.ts +0 -26
- package/dist/es5/h5/gridstack-dd-native.js +0 -175
- package/dist/es5/h5/gridstack-dd-native.js.map +0 -1
- package/dist/es5/jq/gridstack-dd-jqueryui.d.ts +0 -22
- package/dist/es5/jq/gridstack-dd-jqueryui.js +0 -162
- package/dist/es5/jq/gridstack-dd-jqueryui.js.map +0 -1
- package/dist/gridstack-dd.d.ts +0 -35
- package/dist/gridstack-dd.js.map +0 -1
- package/dist/gridstack-ddi.d.ts +0 -17
- package/dist/gridstack-ddi.js +0 -28
- package/dist/gridstack-ddi.js.map +0 -1
- package/dist/gridstack-h5.d.ts +0 -10
- package/dist/gridstack-h5.js +0 -3
- package/dist/gridstack-h5.js.LICENSE.txt +0 -7
- package/dist/gridstack-h5.js.map +0 -1
- package/dist/gridstack-jq.d.ts +0 -10
- package/dist/gridstack-jq.js +0 -3
- package/dist/gridstack-jq.js.LICENSE.txt +0 -99
- package/dist/gridstack-jq.js.map +0 -1
- package/dist/gridstack-static.d.ts +0 -9
- package/dist/gridstack-static.js +0 -3
- package/dist/gridstack-static.js.map +0 -1
- package/dist/h5/dd-base-impl.js.map +0 -1
- package/dist/h5/dd-draggable.js +0 -302
- package/dist/h5/dd-draggable.js.map +0 -1
- package/dist/h5/dd-droppable.js +0 -168
- package/dist/h5/dd-droppable.js.map +0 -1
- package/dist/h5/dd-element.js.map +0 -1
- package/dist/h5/dd-manager.d.ts +0 -8
- package/dist/h5/dd-manager.js.map +0 -1
- package/dist/h5/dd-resizable-handle.js.map +0 -1
- package/dist/h5/dd-resizable.js.map +0 -1
- package/dist/h5/dd-utils.d.ts +0 -19
- package/dist/h5/dd-utils.js +0 -94
- package/dist/h5/dd-utils.js.map +0 -1
- package/dist/h5/gridstack-dd-native.d.ts +0 -26
- package/dist/h5/gridstack-dd-native.js +0 -140
- package/dist/h5/gridstack-dd-native.js.map +0 -1
- package/dist/jq/gridstack-dd-jqueryui.d.ts +0 -22
- package/dist/jq/gridstack-dd-jqueryui.js +0 -133
- package/dist/jq/gridstack-dd-jqueryui.js.map +0 -1
- package/dist/jq/jquery-ui.js +0 -2
- package/dist/jq/jquery-ui.js.map +0 -1
- package/dist/jq/jquery.js +0 -2
- package/dist/jq/jquery.js.map +0 -1
- package/dist/jq/jquery.ui.touch-punch.js +0 -2
- package/dist/jq/jquery.ui.touch-punch.js.map +0 -1
package/doc/README.md
CHANGED
|
@@ -30,11 +30,10 @@ gridstack.js API
|
|
|
30
30
|
- [`GridStack.registerEngine(engineClass: typeof GridStackEngine)`](#gridstackregisterengineengineclass-typeof-gridstackengine)
|
|
31
31
|
- [API](#api)
|
|
32
32
|
- [`addWidget(el?: GridStackWidget | GridStackElement, options?: GridStackWidget)`](#addwidgetel-gridstackwidget--gridstackelement-options-gridstackwidget)
|
|
33
|
-
- [`batchUpdate()`](#
|
|
33
|
+
- [`batchUpdate(flag = true)`](#batchupdateflag--true)
|
|
34
34
|
- [`compact()`](#compact)
|
|
35
35
|
- [`cellHeight(val: number, update = true)`](#cellheightval-number-update--true)
|
|
36
36
|
- [`cellWidth()`](#cellwidth)
|
|
37
|
-
- [`commit()`](#commit)
|
|
38
37
|
- [`column(column: number, layout: ColumnOptions = 'moveScale')`](#columncolumn-number-layout-columnoptions--movescale)
|
|
39
38
|
- [`destroy([removeDOM])`](#destroyremovedom)
|
|
40
39
|
- [`disable()`](#disable)
|
|
@@ -71,16 +70,20 @@ gridstack.js API
|
|
|
71
70
|
* `true` (uses `'.grid-stack-item'` class filter) or `false`
|
|
72
71
|
* string for explicit class name
|
|
73
72
|
* `function (i: number, element: Element): boolean` See [example](http://gridstack.github.io/gridstack.js/demo/two.html)
|
|
74
|
-
- `alwaysShowResizeHandle` - possible values (default: `
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
- `alwaysShowResizeHandle` - possible values (default: `mobile`) - does not apply to non-resizable widgets
|
|
74
|
+
* `false` the resizing handles are only shown while hovering over a widget
|
|
75
|
+
* `true` the resizing handles are always shown
|
|
76
|
+
* `'mobile'` if running on a mobile device, default to `true` (since there is no hovering per say), else `false`.
|
|
77
|
+
this uses this condition on browser agent check:
|
|
78
|
+
`alwaysShowResizeHandle: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( navigator.userAgent )`
|
|
79
|
+
See [mobile](http://gridstack.github.io/gridstack.js/demo/mobile.html)
|
|
80
|
+
|
|
81
|
+
|
|
79
82
|
- `animate` - turns animation on to smooth transitions (default: `true`)
|
|
80
83
|
- `auto` - if `false` gridstack will not initialize existing items (default: `true`)
|
|
81
84
|
- `cellHeight`- one cell height (default?: 'auto'). Can be:
|
|
82
85
|
* an integer (px)
|
|
83
|
-
* a string (ex: '100px', '10em', '10rem'). Note: % doesn't right - see demo/cell-height.html
|
|
86
|
+
* a string (ex: '100px', '10em', '10rem'). Note: % doesn't right - see [CellHeight](http://gridstackjs.com/demo/cell-height.html)
|
|
84
87
|
* 0, in which case the library will not generate styles for rows. Everything must be defined in your own CSS files.
|
|
85
88
|
* `auto` - height will be calculated for square cells (width / column) and updated live as you resize the window - also see `cellHeightThrottle`
|
|
86
89
|
* `initial` - similar to 'auto' (start at square cells) but stay that size during window resizing.
|
|
@@ -96,10 +99,10 @@ gridstack.js API
|
|
|
96
99
|
* example: `dragIn: '.newWidget'`.
|
|
97
100
|
* **Note**: if you have multiple grids, it's best to call `GridStack.setupDragIn()` with same params as it only need to be done once.
|
|
98
101
|
- `dragInOptions` - options for items that can be dragged into grids
|
|
99
|
-
* example `dragInOptions: {
|
|
102
|
+
* example `dragInOptions: { appendTo: 'body', helper: 'clone', handle: '.grid-stack-item-content' }`
|
|
100
103
|
* **Note**: if you have multiple grids, it's best to call `GridStack.setupDragIn()` with same params as it only need to be done once.
|
|
101
104
|
* **Note2**: instead of 'clone' you can also pass your own function (get passed the event).
|
|
102
|
-
- `draggable` - allows to override draggable options. (default: `{handle: '.grid-stack-item-content',
|
|
105
|
+
- `draggable` - allows to override draggable options. (default: `{handle: '.grid-stack-item-content', appendTo: 'body'}`)
|
|
103
106
|
- `dragOut` to let user drag nested grid items out of a parent or not (default false) See [example](http://gridstackjs.com/demo/nested.html)
|
|
104
107
|
- `engineClass` - the type of engine to create (so you can subclass) default to GridStackEngine
|
|
105
108
|
- `float` - enable floating widgets (default: `false`) See [example](http://gridstackjs.com/demo/float.html)
|
|
@@ -119,7 +122,7 @@ gridstack.js API
|
|
|
119
122
|
- `oneColumnModeDomSort` - set to `true` if you want oneColumnMode to use the DOM order and ignore x,y from normal multi column layouts during sorting. This enables you to have custom 1 column layout that differ from the rest. (default?: `false`)
|
|
120
123
|
- `placeholderClass` - class for placeholder (default: `'grid-stack-placeholder'`)
|
|
121
124
|
- `placeholderText` - placeholder default content (default: `''`)
|
|
122
|
-
- `resizable` - allows to override resizable options. (default: `{
|
|
125
|
+
- `resizable` - allows to override resizable options. (default: `{handles: 'se'}`). `handles` can be any combo of `n,ne,e,se,s,sw,w,nw` or `all`.
|
|
123
126
|
- `removable` - if `true` widgets could be removed by dragging outside of the grid. It could also be a selector string, in this case widgets will be removed by dropping them there (default: `false`) See [example](http://gridstackjs.com/demo/two.html)
|
|
124
127
|
- `removeTimeout` - time in milliseconds before widget is being removed while dragging outside of the grid. (default: `2000`)
|
|
125
128
|
- `row` - fix grid number of rows. This is a shortcut of writing `minRow:N, maxRow:N`. (default `0` no constrain)
|
|
@@ -320,7 +323,7 @@ grids.forEach(...)
|
|
|
320
323
|
* call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
|
|
321
324
|
Called during `GridStack.init()` as options, but can also be called directly (last param are cached) in case the toolbar is dynamically create and needs to change later.
|
|
322
325
|
* @param dragIn string selector (ex: `'.sidebar .grid-stack-item'`)
|
|
323
|
-
* @param dragInOptions options - see `DDDragInOpt`. (default: `{
|
|
326
|
+
* @param dragInOptions options - see `DDDragInOpt`. (default: `{handle: '.grid-stack-item-content', appendTo: 'body'}`
|
|
324
327
|
but you will probably also want `helper: 'clone'` or your own callback function).
|
|
325
328
|
|
|
326
329
|
|
|
@@ -348,9 +351,9 @@ grid.addWidget({w: 3, content: 'hello'});
|
|
|
348
351
|
grid.addWidget('<div class="grid-stack-item"><div class="grid-stack-item-content">hello</div></div>', {w: 3});
|
|
349
352
|
```
|
|
350
353
|
|
|
351
|
-
### `batchUpdate()`
|
|
354
|
+
### `batchUpdate(flag = true)`
|
|
352
355
|
|
|
353
|
-
|
|
356
|
+
use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient) and get a single event callback. You will see no changes until `batchUpdate(false)` is called.
|
|
354
357
|
|
|
355
358
|
### `compact()`
|
|
356
359
|
|
|
@@ -368,10 +371,6 @@ grid.cellHeight(grid.cellWidth() * 1.2);
|
|
|
368
371
|
|
|
369
372
|
Gets current cell width (grid width / # of columns).
|
|
370
373
|
|
|
371
|
-
### `commit()`
|
|
372
|
-
|
|
373
|
-
Ends batch updates. Updates DOM nodes. You must call it after `batchUpdate()`.
|
|
374
|
-
|
|
375
374
|
### `column(column: number, layout: ColumnOptions = 'moveScale')`
|
|
376
375
|
|
|
377
376
|
set the number of columns in the grid. Will update existing widgets to conform to new number of columns,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gridstack",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "TypeScript/JS lib for dashboard layout and creation, no external dependencies, with many wrappers (React, Angular, Vue, Ember, knockout...)",
|
|
5
5
|
"main": "./dist/gridstack.js",
|
|
6
6
|
"types": "./dist/gridstack.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "yarn --no-progress && rm -rf dist/* && grunt && yarn build:es6 && yarn build:es5 && yarn doc",
|
|
23
23
|
"build:es6": "webpack && tsc --stripInternal",
|
|
24
24
|
"build:es5": "webpack --config es5/webpack.config.js && tsc --stripInternal --project es5/tsconfig.json",
|
|
25
|
-
"w": "
|
|
25
|
+
"w": "webpack",
|
|
26
26
|
"t": "rm -rf dist/* && grunt && tsc --stripInternal",
|
|
27
27
|
"doc": "doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md",
|
|
28
28
|
"test": "yarn lint && karma start karma.conf.js",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* gridstack-dd.ts 5.1.1
|
|
3
|
-
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
|
|
4
|
-
*/
|
|
5
|
-
import { GridStackDDI } from './gridstack-ddi';
|
|
6
|
-
import { GridItemHTMLElement, GridStackElement, DDDragInOpt } from './types';
|
|
7
|
-
/** Drag&Drop drop options */
|
|
8
|
-
export declare type DDDropOpt = {
|
|
9
|
-
/** function or class type that this grid will accept as dropped items (see GridStackOptions.acceptWidgets) */
|
|
10
|
-
accept?: (el: GridItemHTMLElement) => boolean;
|
|
11
|
-
};
|
|
12
|
-
/** drag&drop options currently called from the main code, but others can be passed in grid options */
|
|
13
|
-
export declare type DDOpts = 'enable' | 'disable' | 'destroy' | 'option' | string | any;
|
|
14
|
-
export declare type DDKey = 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight';
|
|
15
|
-
export declare type DDValue = number | string;
|
|
16
|
-
/** drag&drop events callbacks */
|
|
17
|
-
export declare type DDCallback = (event: Event, arg2: GridItemHTMLElement, helper?: GridItemHTMLElement) => void;
|
|
18
|
-
/**
|
|
19
|
-
* Base class implementing common Grid drag'n'drop functionality, with domain specific subclass (h5 vs jq subclasses)
|
|
20
|
-
*/
|
|
21
|
-
export declare abstract class GridStackDD extends GridStackDDI {
|
|
22
|
-
/** override to cast to correct type */
|
|
23
|
-
static get(): GridStackDD;
|
|
24
|
-
/** removes any drag&drop present (called during destroy) */
|
|
25
|
-
remove(el: GridItemHTMLElement): GridStackDD;
|
|
26
|
-
abstract resizable(el: GridItemHTMLElement, opts: DDOpts, key?: DDKey, value?: DDValue): GridStackDD;
|
|
27
|
-
abstract isResizable(el: HTMLElement): boolean;
|
|
28
|
-
abstract draggable(el: GridItemHTMLElement, opts: DDOpts, key?: DDKey, value?: DDValue): GridStackDD;
|
|
29
|
-
abstract dragIn(el: GridStackElement, opts: DDDragInOpt): GridStackDD;
|
|
30
|
-
abstract isDraggable(el: HTMLElement): boolean;
|
|
31
|
-
abstract droppable(el: GridItemHTMLElement, opts: DDOpts | DDDropOpt, key?: DDKey, value?: DDValue): GridStackDD;
|
|
32
|
-
abstract isDroppable(el: HTMLElement): boolean;
|
|
33
|
-
abstract on(el: GridItemHTMLElement, eventName: string, callback: DDCallback): GridStackDD;
|
|
34
|
-
abstract off(el: GridItemHTMLElement, eventName: string): GridStackDD;
|
|
35
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gridstack-dd.js","sourceRoot":"","sources":["../../src/gridstack-dd.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,sDAAsD;AACtD,iDAA+C;AAE/C,yCAAuD;AACvD,iCAAgC;AAiBhC,sBAAsB;AAEtB;;GAEG;AACH;IAA0C,+BAAY;IAAtD;;IAmCA,CAAC;IAjCC,uCAAuC;IAChC,eAAG,GAAV;QACE,OAAO,4BAAY,CAAC,GAAG,EAAiB,CAAC;IAC3C,CAAC;IAED,4DAA4D;IACrD,4BAAM,GAAb,UAAc,EAAuB;QACnC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,C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AiB;IAA3C,iBAKhC;IAJC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC,CAAC,4BAA4B;IACnE,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,QAAQ,CAAC,CAAC,0DAA0D;IAC7F,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,KAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,CAAC,EAA5B,CAA4B,CAAC,CAAC;IAC7D,OAAO,IAAI,CAAC;AACd,CAAC,CAAA;AAED,gEAAgE;AAChE,qBAAS,CAAC,SAAS,CAAC,YAAY,GAAG,UAA0B,QAAiB;IAA3C,iBAKlC;IAJC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC,CAAC,4BAA4B;IACnE,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,QAAQ,CAAC,CAAC,0DAA0D;IAC/F,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,KAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,CAAC,EAA9B,CAA8B,CAAC,CAAC;IAC/D,OAAO,IAAI,CAAC;AACd,CAAC,CAAA","sourcesContent":["/**\r\n * gridstack-dd.ts 5.1.1\r\n * Copyright (c) 2021 Alain Dumesny - see GridStack root license\r\n */\r\n\r\n/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { GridStackDDI } from './gridstack-ddi';\r\nimport { GridItemHTMLElement, GridStackNode, GridStackElement, DDUIData, DDDragInOpt, GridStackPosition } from './types';\r\nimport { GridStack, MousePosition } from './gridstack';\r\nimport { Utils } from './utils';\r\n\r\n/** Drag&Drop drop options */\r\nexport type DDDropOpt = {\r\n /** function or class type that this grid will accept as dropped items (see GridStackOptions.acceptWidgets) */\r\n accept?: (el: GridItemHTMLElement) => boolean;\r\n}\r\n\r\n/** drag&drop options currently called from the main code, but others can be passed in grid options */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nexport type DDOpts = 'enable' | 'disable' | 'destroy' | 'option' | string | any;\r\nexport type DDKey = 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight';\r\nexport type DDValue = number | string;\r\n\r\n/** drag&drop events callbacks */\r\nexport type DDCallback = (event: Event, arg2: GridItemHTMLElement, helper?: GridItemHTMLElement) => void;\r\n\r\n// TEST let count = 0;\r\n\r\n/**\r\n * Base class implementing common Grid drag'n'drop functionality, with domain specific subclass (h5 vs jq subclasses)\r\n */\r\nexport abstract class GridStackDD extends GridStackDDI {\r\n\r\n /** override to cast to correct type */\r\n static get(): GridStackDD {\r\n return GridStackDDI.get() as GridStackDD;\r\n }\r\n\r\n /** removes any drag&drop present (called during destroy) */\r\n public remove(el: GridItemHTMLElement): GridStackDD {\r\n this.draggable(el, 'destroy').resizable(el, 'destroy');\r\n if (el.gridstackNode) {\r\n delete el.gridstackNode._initDD; // reset our DD init flag\r\n }\r\n return this;\r\n }\r\n\r\n // APIs that must be implemented by subclasses to do actual darg/drop/resize called by GridStack code below\r\n\r\n public abstract resizable(el: GridItemHTMLElement, opts: DDOpts, key?: DDKey, value?: DDValue): GridStackDD;\r\n\r\n public abstract isResizable(el: HTMLElement): boolean;\r\n\r\n public abstract draggable(el: GridItemHTMLElement, opts: DDOpts, key?: DDKey, value?: DDValue): GridStackDD;\r\n\r\n public abstract dragIn(el: GridStackElement, opts: DDDragInOpt): GridStackDD;\r\n\r\n public abstract isDraggable(el: HTMLElement): boolean;\r\n\r\n public abstract droppable(el: GridItemHTMLElement, opts: DDOpts | DDDropOpt, key?: DDKey, value?: DDValue): GridStackDD;\r\n\r\n public abstract isDroppable(el: HTMLElement): boolean;\r\n\r\n public abstract on(el: GridItemHTMLElement, eventName: string, callback: DDCallback): GridStackDD;\r\n\r\n public abstract off(el: GridItemHTMLElement, eventName: string): GridStackDD;\r\n}\r\n\r\n/********************************************************************************\r\n * GridStack code that is doing drag&drop extracted here so main class is smaller\r\n * for static grid that don't do any of this work anyway. Saves about 10k.\r\n * https://www.typescriptlang.org/docs/handbook/declaration-merging.html\r\n * https://www.typescriptlang.org/docs/handbook/mixins.html\r\n ********************************************************************************/\r\n\r\n/** @internal called to add drag over to support widgets being added externally */\r\nGridStack.prototype._setupAcceptWidget = function(this: GridStack): GridStack {\r\n\r\n // check if we need to disable things\r\n if (this.opts.staticGrid || (!this.opts.acceptWidgets && !this.opts.removable)) {\r\n GridStackDD.get().droppable(this.el, 'destroy');\r\n return this;\r\n }\r\n\r\n // vars shared across all methods\r\n let cellHeight: number, cellWidth: number;\r\n\r\n let onDrag = (event: DragEvent, el: GridItemHTMLElement, helper: GridItemHTMLElement) => {\r\n let node = el.gridstackNode;\r\n if (!node) return;\r\n\r\n helper = helper || el;\r\n let parent = this.el.getBoundingClientRect();\r\n let {top, left} = helper.getBoundingClientRect();\r\n left -= parent.left;\r\n top -= parent.top;\r\n let ui: DDUIData = {position: {top, left}};\r\n\r\n if (node._temporaryRemoved) {\r\n node.x = Math.max(0, Math.round(left / cellWidth));\r\n node.y = Math.max(0, Math.round(top / cellHeight));\r\n delete node.autoPosition;\r\n this.engine.nodeBoundFix(node);\r\n\r\n // don't accept *initial* location if doesn't fit #1419 (locked drop region, or can't grow), but maybe try if it will go somewhere\r\n if (!this.engine.willItFit(node)) {\r\n node.autoPosition = true; // ignore x,y and try for any slot...\r\n if (!this.engine.willItFit(node)) {\r\n GridStackDD.get().off(el, 'drag'); // stop calling us\r\n return; // full grid or can't grow\r\n }\r\n if (node._willFitPos) {\r\n // use the auto position instead #1687\r\n Utils.copyPos(node, node._willFitPos);\r\n delete node._willFitPos;\r\n }\r\n }\r\n\r\n // re-use the existing node dragging method\r\n this._onStartMoving(helper, event, ui, node, cellWidth, cellHeight);\r\n } else {\r\n // re-use the existing node dragging that does so much of the collision detection\r\n this._dragOrResize(helper, event, ui, node, cellWidth, cellHeight);\r\n }\r\n }\r\n\r\n GridStackDD.get()\r\n .droppable(this.el, {\r\n accept: (el: GridItemHTMLElement) => {\r\n let node: GridStackNode = el.gridstackNode;\r\n // set accept drop to true on ourself (which we ignore) so we don't get \"can't drop\" icon in HTML5 mode while moving\r\n if (node?.grid === this) return true;\r\n if (!this.opts.acceptWidgets) return false;\r\n // prevent deeper nesting until rest of 992 can be fixed\r\n if (node?.subGrid) return false;\r\n // check for accept method or class matching\r\n let canAccept = true;\r\n if (typeof this.opts.acceptWidgets === 'function') {\r\n canAccept = this.opts.acceptWidgets(el);\r\n } else {\r\n let selector = (this.opts.acceptWidgets === true ? '.grid-stack-item' : this.opts.acceptWidgets as string);\r\n canAccept = el.matches(selector);\r\n }\r\n // finally check to make sure we actually have space left #1571\r\n if (canAccept && node && this.opts.maxRow) {\r\n let n = {w: node.w, h: node.h, minW: node.minW, minH: node.minH}; // only width/height matters and autoPosition\r\n canAccept = this.engine.willItFit(n);\r\n }\r\n return canAccept;\r\n }\r\n })\r\n /**\r\n * entering our grid area\r\n */\r\n .on(this.el, 'dropover', (event: Event, el: GridItemHTMLElement, helper: GridItemHTMLElement) => {\r\n // TEST console.log(`over ${this.el.gridstack.opts.id} ${count++}`);\r\n let node = el.gridstackNode;\r\n // ignore drop enter on ourself (unless we temporarily removed) which happens on a simple drag of our item\r\n if (node?.grid === this && !node._temporaryRemoved) {\r\n // delete node._added; // reset this to track placeholder again in case we were over other grid #1484 (dropout doesn't always clear)\r\n return false; // prevent parent from receiving msg (which may be a grid as well)\r\n }\r\n\r\n // fix #1578 when dragging fast, we may not get a leave on the previous grid so force one now\r\n if (node?.grid && node.grid !== this && !node._temporaryRemoved) {\r\n // TEST console.log('dropover without leave');\r\n let otherGrid = node.grid;\r\n otherGrid._leave(el, helper);\r\n }\r\n\r\n // cache cell dimensions (which don't change), position can animate if we removed an item in otherGrid that affects us...\r\n cellWidth = this.cellWidth();\r\n cellHeight = this.getCellHeight(true);\r\n\r\n // load any element attributes if we don't have a node\r\n if (!node) {// @ts-ignore private read only on ourself\r\n node = this._readAttr(el);\r\n }\r\n if (!node.grid) {\r\n node._isExternal = true;\r\n el.gridstackNode = node;\r\n }\r\n\r\n // calculate the grid size based on element outer size\r\n helper = helper || el;\r\n let w = node.w || Math.round(helper.offsetWidth / cellWidth) || 1;\r\n let h = node.h || Math.round(helper.offsetHeight / cellHeight) || 1;\r\n\r\n // if the item came from another grid, make a copy and save the original info in case we go back there\r\n if (node.grid && node.grid !== this) {\r\n // copy the node original values (min/max/id/etc...) but override width/height/other flags which are this grid specific\r\n // TEST console.log('dropover cloning node');\r\n if (!el._gridstackNodeOrig) el._gridstackNodeOrig = node; // shouldn't have multiple nested!\r\n el.gridstackNode = node = {...node, w, h, grid: this};\r\n this.engine.cleanupNode(node)\r\n .nodeBoundFix(node);\r\n // restore some internal fields we need after clearing them all\r\n node._initDD =\r\n node._isExternal = // DOM needs to be re-parented on a drop\r\n node._temporaryRemoved = true; // so it can be inserted onDrag below\r\n } else {\r\n node.w = w; node.h = h;\r\n node._temporaryRemoved = true; // so we can insert it\r\n }\r\n\r\n // clear any marked for complete removal (Note: don't check _isAboutToRemove as that is cleared above - just do it)\r\n _itemRemoving(node.el, false);\r\n\r\n GridStackDD.get().on(el, 'drag', onDrag);\r\n // make sure this is called at least once when going fast #1578\r\n onDrag(event as DragEvent, el, helper);\r\n return false; // prevent parent from receiving msg (which may be a grid as well)\r\n })\r\n /**\r\n * Leaving our grid area...\r\n */\r\n .on(this.el, 'dropout', (event, el: GridItemHTMLElement, helper: GridItemHTMLElement) => {\r\n // TEST console.log(`out ${this.el.gridstack.opts.id} ${count++}`);\r\n let node = el.gridstackNode;\r\n if (!node) return false;\r\n // fix #1578 when dragging fast, we might get leave after other grid gets enter (which calls us to clean)\r\n // so skip this one if we're not the active grid really..\r\n if (!node.grid || node.grid === this) {\r\n this._leave(el, helper);\r\n }\r\n return false; // prevent parent from receiving msg (which may be grid as well)\r\n })\r\n /**\r\n * end - releasing the mouse\r\n */\r\n .on(this.el, 'drop', (event, el: GridItemHTMLElement, helper: GridItemHTMLElement) => {\r\n let node = el.gridstackNode;\r\n // ignore drop on ourself from ourself that didn't come from the outside - dragend will handle the simple move instead\r\n if (node?.grid === this && !node._isExternal) return false;\r\n\r\n let wasAdded = !!this.placeholder.parentElement; // skip items not actually added to us because of constrains, but do cleanup #1419\r\n this.placeholder.remove();\r\n\r\n // notify previous grid of removal\r\n // TEST console.log('drop delete _gridstackNodeOrig')\r\n let origNode = el._gridstackNodeOrig;\r\n delete el._gridstackNodeOrig;\r\n if (wasAdded && origNode && origNode.grid && origNode.grid !== this) {\r\n let oGrid = origNode.grid;\r\n oGrid.engine.removedNodes.push(origNode);\r\n oGrid._triggerRemoveEvent();\r\n }\r\n\r\n if (!node) return false;\r\n\r\n // use existing placeholder node as it's already in our list with drop location\r\n if (wasAdded) {\r\n this.engine.cleanupNode(node); // removes all internal _xyz values\r\n node.grid = this;\r\n }\r\n GridStackDD.get().off(el, 'drag');\r\n // if we made a copy ('helper' which is temp) of the original node then insert a copy, else we move the original node (#1102)\r\n // as the helper will be nuked by jquery-ui otherwise\r\n if (helper !== el) {\r\n helper.remove();\r\n el.gridstackNode = origNode; // original item (left behind) is re-stored to pre dragging as the node now has drop info\r\n if (wasAdded) {\r\n el = el.cloneNode(true) as GridItemHTMLElement;\r\n }\r\n } else {\r\n el.remove(); // reduce flicker as we change depth here, and size further down\r\n GridStackDD.get().remove(el);\r\n }\r\n if (!wasAdded) return false;\r\n el.gridstackNode = node;\r\n node.el = el;\r\n // @ts-ignore\r\n Utils.copyPos(node, this._readAttr(this.placeholder)); // placeholder values as moving VERY fast can throw things off #1578\r\n Utils.removePositioningStyles(el);// @ts-ignore\r\n this._writeAttr(el, node);\r\n this.el.appendChild(el);// @ts-ignore\r\n this._updateContainerHeight();\r\n this.engine.addedNodes.push(node);// @ts-ignore\r\n this._triggerAddEvent();// @ts-ignore\r\n this._triggerChangeEvent();\r\n\r\n this.engine.endUpdate();\r\n if (this._gsEventHandler['dropped']) {\r\n this._gsEventHandler['dropped']({...event, type: 'dropped'}, origNode && origNode.grid ? origNode : undefined, node);\r\n }\r\n\r\n // wait till we return out of the drag callback to set the new drag&resize handler or they may get messed up\r\n window.setTimeout(() => {\r\n // IFF we are still there (some application will use as placeholder and insert their real widget instead and better call makeWidget())\r\n if (node.el && node.el.parentElement) {\r\n this._prepareDragDropByNode(node);\r\n } else {\r\n this.engine.removeNode(node);\r\n }\r\n });\r\n\r\n return false; // prevent parent from receiving msg (which may be grid as well)\r\n });\r\n return this;\r\n}\r\n\r\n/** @internal mark item for removal */\r\nfunction _itemRemoving(el: GridItemHTMLElement, remove: boolean) {\r\n let node = el ? el.gridstackNode : undefined;\r\n if (!node || !node.grid) return;\r\n remove ? node._isAboutToRemove = true : delete node._isAboutToRemove;\r\n remove ? el.classList.add('grid-stack-item-removing') : el.classList.remove('grid-stack-item-removing');\r\n}\r\n\r\n/** @internal called to setup a trash drop zone if the user specifies it */\r\nGridStack.prototype._setupRemoveDrop = function(this: GridStack): GridStack {\r\n if (!this.opts.staticGrid && typeof this.opts.removable === 'string') {\r\n let trashEl = document.querySelector(this.opts.removable) as HTMLElement;\r\n if (!trashEl) return this;\r\n // only register ONE drop-over/dropout callback for the 'trash', and it will\r\n // update the passed in item and parent grid because the 'trash' is a shared resource anyway,\r\n // and Native DD only has 1 event CB (having a list and technically a per grid removableOptions complicates things greatly)\r\n if (!GridStackDD.get().isDroppable(trashEl)) {\r\n GridStackDD.get().droppable(trashEl, this.opts.removableOptions)\r\n .on(trashEl, 'dropover', (event, el) => _itemRemoving(el, true))\r\n .on(trashEl, 'dropout', (event, el) => _itemRemoving(el, false));\r\n }\r\n }\r\n return this;\r\n}\r\n\r\n/**\r\n * call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.\r\n * Called during GridStack.init() as options, but can also be called directly (last param are cached) in case the toolbar\r\n * is dynamically create and needs to change later.\r\n **/\r\nGridStack.setupDragIn = function(this: GridStack, _dragIn?: string, _dragInOptions?: DDDragInOpt) {\r\n let dragIn: string;\r\n let dragInOptions: DDDragInOpt;\r\n const dragInDefaultOptions: DDDragInOpt = {\r\n revert: 'invalid',\r\n handle: '.grid-stack-item-content',\r\n scroll: false,\r\n appendTo: 'body'\r\n };\r\n\r\n // cache in the passed in values (form grid init?) so they don't have to resend them each time\r\n if (_dragIn) {\r\n dragIn = _dragIn;\r\n dragInOptions = {...dragInDefaultOptions, ...(_dragInOptions || {})};\r\n }\r\n if (typeof dragIn !== 'string') return;\r\n let dd = GridStackDD.get();\r\n Utils.getElements(dragIn).forEach(el => {\r\n if (!dd.isDraggable(el)) dd.dragIn(el, dragInOptions);\r\n });\r\n}\r\n\r\n/** @internal prepares the element for drag&drop **/\r\nGridStack.prototype._prepareDragDropByNode = function(this: GridStack, node: GridStackNode): GridStack {\r\n let el = node.el;\r\n let dd = GridStackDD.get();\r\n\r\n // check for disabled grid first\r\n if (this.opts.staticGrid || ((node.noMove || this.opts.disableDrag) && (node.noResize || this.opts.disableResize))) {\r\n if (node._initDD) {\r\n dd.remove(el); // nukes everything instead of just disable, will add some styles back next\r\n delete node._initDD;\r\n }\r\n el.classList.add('ui-draggable-disabled', 'ui-resizable-disabled'); // add styles one might depend on #1435\r\n return this;\r\n }\r\n\r\n if (!node._initDD) {\r\n // variables used/cashed between the 3 start/move/end methods, in addition to node passed above\r\n let cellWidth: number;\r\n let cellHeight: number;\r\n\r\n /** called when item starts moving/resizing */\r\n let onStartMoving = (event: Event, ui: DDUIData) => {\r\n // trigger any 'dragstart' / 'resizestart' manually\r\n if (this._gsEventHandler[event.type]) {\r\n this._gsEventHandler[event.type](event, event.target);\r\n }\r\n cellWidth = this.cellWidth();\r\n cellHeight = this.getCellHeight(true); // force pixels for calculations\r\n\r\n this._onStartMoving(el, event, ui, node, cellWidth, cellHeight);\r\n }\r\n\r\n /** called when item is being dragged/resized */\r\n let dragOrResize = (event: Event, ui: DDUIData) => {\r\n this._dragOrResize(el, event, ui, node, cellWidth, cellHeight);\r\n }\r\n\r\n /** called when the item stops moving/resizing */\r\n let onEndMoving = (event: Event) => {\r\n this.placeholder.remove();\r\n delete node._moving;\r\n delete node._lastTried;\r\n\r\n // if the item has moved to another grid, we're done here\r\n let target: GridItemHTMLElement = event.target as GridItemHTMLElement;\r\n if (!target.gridstackNode || target.gridstackNode.grid !== this) return;\r\n\r\n node.el = target;\r\n\r\n if (node._isAboutToRemove) {\r\n let gridToNotify = el.gridstackNode.grid;\r\n if (gridToNotify._gsEventHandler[event.type]) {\r\n gridToNotify._gsEventHandler[event.type](event, target);\r\n }\r\n dd.remove(el);\r\n gridToNotify.engine.removedNodes.push(node);\r\n gridToNotify._triggerRemoveEvent();\r\n // break circular links and remove DOM\r\n delete el.gridstackNode;\r\n delete node.el;\r\n el.remove();\r\n } else {\r\n if (!node._temporaryRemoved) {\r\n // move to new placeholder location\r\n Utils.removePositioningStyles(target);// @ts-ignore\r\n this._writePosAttr(target, node);\r\n } else {\r\n // got removed - restore item back to before dragging position\r\n Utils.removePositioningStyles(target);\r\n Utils.copyPos(node, node._orig);// @ts-ignore\r\n this._writePosAttr(target, node);\r\n this.engine.addNode(node);\r\n }\r\n if (this._gsEventHandler[event.type]) {\r\n this._gsEventHandler[event.type](event, target);\r\n }\r\n }\r\n // @ts-ignore\r\n this._extraDragRow = 0;// @ts-ignore\r\n this._updateContainerHeight();// @ts-ignore\r\n this._triggerChangeEvent();\r\n\r\n this.engine.endUpdate();\r\n }\r\n\r\n dd.draggable(el, {\r\n start: onStartMoving,\r\n stop: onEndMoving,\r\n drag: dragOrResize\r\n }).resizable(el, {\r\n start: onStartMoving,\r\n stop: onEndMoving,\r\n resize: dragOrResize\r\n });\r\n node._initDD = true; // we've set DD support now\r\n }\r\n\r\n // finally fine tune move vs resize by disabling any part...\r\n if (node.noMove || this.opts.disableDrag) {\r\n dd.draggable(el, 'disable');\r\n el.classList.add('ui-draggable-disabled');\r\n } else {\r\n dd.draggable(el, 'enable');\r\n el.classList.remove('ui-draggable-disabled');\r\n }\r\n if (node.noResize || this.opts.disableResize) {\r\n dd.resizable(el, 'disable');\r\n el.classList.add('ui-resizable-disabled');\r\n } else {\r\n dd.resizable(el, 'enable');\r\n el.classList.remove('ui-resizable-disabled');\r\n }\r\n\r\n return this;\r\n}\r\n\r\n/** @internal called when item is starting a drag/resize */\r\nGridStack.prototype._onStartMoving = function(this: GridStack, el: GridItemHTMLElement, event: Event, ui: DDUIData, node: GridStackNode, cellWidth: number, cellHeight: number) {\r\n this.engine.cleanNodes()\r\n .beginUpdate(node);\r\n // @ts-ignore\r\n this._writePosAttr(this.placeholder, node)\r\n this.el.appendChild(this.placeholder);\r\n // TEST console.log('_onStartMoving placeholder')\r\n\r\n node.el = this.placeholder;\r\n node._lastUiPosition = ui.position;\r\n node._prevYPix = ui.position.top;\r\n node._moving = (event.type === 'dragstart'); // 'dropover' are not initially moving so they can go exactly where they enter (will push stuff out of the way)\r\n delete node._lastTried;\r\n\r\n if (event.type === 'dropover' && node._temporaryRemoved) {\r\n // TEST console.log('engine.addNode x=' + node.x);\r\n this.engine.addNode(node); // will add, fix collisions, update attr and clear _temporaryRemoved\r\n node._moving = true; // AFTER, mark as moving object (wanted fix location before)\r\n }\r\n\r\n // set the min/max resize info\r\n this.engine.cacheRects(cellWidth, cellHeight, this.opts.marginTop as number, this.opts.marginRight as number, this.opts.marginBottom as number, this.opts.marginLeft as number);\r\n if (event.type === 'resizestart') {\r\n let dd = GridStackDD.get()\r\n .resizable(el, 'option', 'minWidth', cellWidth * (node.minW || 1))\r\n .resizable(el, 'option', 'minHeight', cellHeight * (node.minH || 1));\r\n if (node.maxW) { dd.resizable(el, 'option', 'maxWidth', cellWidth * node.maxW); }\r\n if (node.maxH) { dd.resizable(el, 'option', 'maxHeight', cellHeight * node.maxH); }\r\n }\r\n}\r\n\r\n/** @internal called when item leaving our area by either cursor dropout event\r\n * or shape is outside our boundaries. remove it from us, and mark temporary if this was\r\n * our item to start with else restore prev node values from prev grid it came from.\r\n **/\r\nGridStack.prototype._leave = function(this: GridStack, el: GridItemHTMLElement, helper?: GridItemHTMLElement) {\r\n let node = el.gridstackNode;\r\n if (!node) return;\r\n\r\n GridStackDD.get().off(el, 'drag'); // no need to track while being outside\r\n\r\n // this gets called when cursor leaves and shape is outside, so only do this once\r\n if (node._temporaryRemoved) return;\r\n node._temporaryRemoved = true;\r\n\r\n this.engine.removeNode(node); // remove placeholder as well, otherwise it's a sign node is not in our list, which is a bigger issue\r\n node.el = node._isExternal && helper ? helper : el; // point back to real item being dragged\r\n\r\n if (this.opts.removable === true) { // boolean vs a class string\r\n // item leaving us and we are supposed to remove on leave (no need to drag onto trash) mark it so\r\n _itemRemoving(el, true);\r\n }\r\n\r\n // finally if item originally came from another grid, but left us, restore things back to prev info\r\n if (el._gridstackNodeOrig) {\r\n // TEST console.log('leave delete _gridstackNodeOrig')\r\n el.gridstackNode = el._gridstackNodeOrig;\r\n delete el._gridstackNodeOrig;\r\n } else if (node._isExternal) {\r\n // item came from outside (like a toolbar) so nuke any node info\r\n delete node.el;\r\n delete el.gridstackNode;\r\n // and restore all nodes back to original\r\n this.engine.restoreInitial();\r\n }\r\n}\r\n\r\n/** @internal called when item is being dragged/resized */\r\nGridStack.prototype._dragOrResize = function(this: GridStack, el: GridItemHTMLElement, event: Event, ui: DDUIData, node: GridStackNode, cellWidth: number, cellHeight: number) {\r\n let p = {...node._orig}; // could be undefined (_isExternal) which is ok (drag only set x,y and w,h will default to node value)\r\n let resizing: boolean;\r\n let mLeft = this.opts.marginLeft as number,\r\n mRight = this.opts.marginRight as number,\r\n mTop = this.opts.marginTop as number,\r\n mBottom = this.opts.marginBottom as number;\r\n\r\n // if margins (which are used to pass mid point by) are large relative to cell height/width, reduce them down #1855\r\n let mHeight = Math.round(cellHeight * 0.1),\r\n mWidth = Math.round(cellWidth * 0.1);\r\n mLeft = Math.min(mLeft, mWidth);\r\n mRight = Math.min(mRight, mWidth);\r\n mTop = Math.min(mTop, mHeight);\r\n mBottom = Math.min(mBottom, mHeight);\r\n\r\n if (event.type === 'drag') {\r\n if (node._temporaryRemoved) return; // handled by dropover\r\n let distance = ui.position.top - node._prevYPix;\r\n node._prevYPix = ui.position.top;\r\n Utils.updateScrollPosition(el, ui.position, distance);\r\n\r\n // get new position taking into account the margin in the direction we are moving! (need to pass mid point by margin)\r\n let left = ui.position.left + (ui.position.left > node._lastUiPosition.left ? -mRight : mLeft);\r\n let top = ui.position.top + (ui.position.top > node._lastUiPosition.top ? -mBottom : mTop);\r\n p.x = Math.round(left / cellWidth);\r\n p.y = Math.round(top / cellHeight);\r\n\r\n // @ts-ignore// if we're at the bottom hitting something else, grow the grid so cursor doesn't leave when trying to place below others\r\n let prev = this._extraDragRow;\r\n if (this.engine.collide(node, p)) {\r\n let row = this.getRow();\r\n let extra = Math.max(0, (p.y + node.h) - row);\r\n if (this.opts.maxRow && row + extra > this.opts.maxRow) {\r\n extra = Math.max(0, this.opts.maxRow - row);\r\n }// @ts-ignore\r\n this._extraDragRow = extra;// @ts-ignore\r\n } else this._extraDragRow = 0;// @ts-ignore\r\n if (this._extraDragRow !== prev) this._updateContainerHeight();\r\n\r\n if (node.x === p.x && node.y === p.y) return; // skip same\r\n // DON'T skip one we tried as we might have failed because of coverage <50% before\r\n // if (node._lastTried && node._lastTried.x === x && node._lastTried.y === y) return;\r\n } else if (event.type === 'resize') {\r\n if (p.x < 0) return;\r\n // Scrolling page if needed\r\n Utils.updateScrollResize(event as MouseEvent, el, cellHeight);\r\n\r\n // get new size\r\n p.w = Math.round((ui.size.width - mLeft) / cellWidth);\r\n p.h = Math.round((ui.size.height - mTop) / cellHeight);\r\n if (node.w === p.w && node.h === p.h) return;\r\n if (node._lastTried && node._lastTried.w === p.w && node._lastTried.h === p.h) return; // skip one we tried (but failed)\r\n\r\n // if we size on left/top side this might move us, so get possible new position as well\r\n let left = ui.position.left + mLeft;\r\n let top = ui.position.top + mTop;\r\n p.x = Math.round(left / cellWidth);\r\n p.y = Math.round(top / cellHeight);\r\n\r\n resizing = true;\r\n }\r\n\r\n node._lastTried = p; // set as last tried (will nuke if we go there)\r\n let rect: GridStackPosition = { // screen pix of the dragged box\r\n x: ui.position.left + mLeft,\r\n y: ui.position.top + mTop,\r\n w: (ui.size ? ui.size.width : node.w * cellWidth) - mLeft - mRight,\r\n h: (ui.size ? ui.size.height : node.h * cellHeight) - mTop - mBottom\r\n };\r\n if (this.engine.moveNodeCheck(node, {...p, cellWidth, cellHeight, rect, resizing})) {\r\n node._lastUiPosition = ui.position;\r\n this.engine.cacheRects(cellWidth, cellHeight, mTop, mRight, mBottom, mLeft);\r\n delete node._skipDown;\r\n if (resizing && node.subGrid) { (node.subGrid as GridStack).onParentResize(); }// @ts-ignore\r\n this._extraDragRow = 0;// @ts-ignore\r\n this._updateContainerHeight();\r\n\r\n let target = event.target as GridItemHTMLElement;// @ts-ignore\r\n this._writePosAttr(target, node);\r\n if (this._gsEventHandler[event.type]) {\r\n this._gsEventHandler[event.type](event, target);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Enables/Disables moving.\r\n * @param els widget or selector to modify.\r\n * @param val if true widget will be draggable.\r\n */\r\nGridStack.prototype.movable = function(this: GridStack, els: GridStackElement, val: boolean): GridStack {\r\n if (this.opts.staticGrid) return this; // can't move a static grid!\r\n GridStack.getElements(els).forEach(el => {\r\n let node = el.gridstackNode;\r\n if (!node) return;\r\n if (val) delete node.noMove; else node.noMove = true;\r\n this._prepareDragDropByNode(node); // init DD if need be, and adjust\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * Enables/Disables resizing.\r\n * @param els widget or selector to modify\r\n * @param val if true widget will be resizable.\r\n */\r\nGridStack.prototype.resizable = function(this: GridStack, els: GridStackElement, val: boolean): GridStack {\r\n if (this.opts.staticGrid) return this; // can't resize a static grid!\r\n GridStack.getElements(els).forEach(el => {\r\n let node = el.gridstackNode;\r\n if (!node) return;\r\n if (val) delete node.noResize; else node.noResize = true;\r\n this._prepareDragDropByNode(node); // init DD if need be, and adjust\r\n });\r\n return this;\r\n}\r\n\r\n\r\n/**\r\n * Temporarily disables widgets moving/resizing.\r\n * If you want a more permanent way (which freezes up resources) use `setStatic(true)` instead.\r\n * Note: no-op for static grid\r\n * This is a shortcut for:\r\n * @example\r\n * grid.enableMove(false);\r\n * grid.enableResize(false);\r\n */\r\nGridStack.prototype.disable = function(this: GridStack): GridStack {\r\n if (this.opts.staticGrid) return;\r\n this.enableMove(false);\r\n this.enableResize(false);// @ts-ignore\r\n this._triggerEvent('disable');\r\n return this;\r\n}\r\n\r\n/**\r\n * Re-enables widgets moving/resizing - see disable().\r\n * Note: no-op for static grid.\r\n * This is a shortcut for:\r\n * @example\r\n * grid.enableMove(true);\r\n * grid.enableResize(true);\r\n */\r\nGridStack.prototype.enable = function(this: GridStack): GridStack {\r\n if (this.opts.staticGrid) return;\r\n this.enableMove(true);\r\n this.enableResize(true);// @ts-ignore\r\n this._triggerEvent('enable');\r\n return this;\r\n}\r\n\r\n/** Enables/disables widget moving. No-op for static grids. */\r\nGridStack.prototype.enableMove = function(this: GridStack, doEnable: boolean): GridStack {\r\n if (this.opts.staticGrid) return this; // can't move a static grid!\r\n this.opts.disableDrag = !doEnable; // FIRST before we update children as grid overrides #1658\r\n this.engine.nodes.forEach(n => this.movable(n.el, doEnable));\r\n return this;\r\n}\r\n\r\n/** Enables/disables widget resizing. No-op for static grids. */\r\nGridStack.prototype.enableResize = function(this: GridStack, doEnable: boolean): GridStack {\r\n if (this.opts.staticGrid) return this; // can't size a static grid!\r\n this.opts.disableResize = !doEnable; // FIRST before we update children as grid overrides #1658\r\n this.engine.nodes.forEach(n => this.resizable(n.el, doEnable));\r\n return this;\r\n}\r\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* gridstack-ddi.ts 5.1.1
|
|
3
|
-
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
|
|
4
|
-
*/
|
|
5
|
-
import { GridItemHTMLElement } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* Abstract Partial Interface API for drag'n'drop plugin - look at GridStackDD and HTML5 / Jquery implementation versions
|
|
8
|
-
*/
|
|
9
|
-
export declare class GridStackDDI {
|
|
10
|
-
protected static ddi: GridStackDDI;
|
|
11
|
-
/** call this method to register your plugin instead of the default no-op one */
|
|
12
|
-
static registerPlugin(pluginClass: typeof GridStackDDI): GridStackDDI;
|
|
13
|
-
/** get the current registered plugin to use */
|
|
14
|
-
static get(): GridStackDDI;
|
|
15
|
-
/** removes any drag&drop present (called during destroy) */
|
|
16
|
-
remove(el: GridItemHTMLElement): GridStackDDI;
|
|
17
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* gridstack-ddi.ts 5.1.1
|
|
4
|
-
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.GridStackDDI = void 0;
|
|
8
|
-
/**
|
|
9
|
-
* Abstract Partial Interface API for drag'n'drop plugin - look at GridStackDD and HTML5 / Jquery implementation versions
|
|
10
|
-
*/
|
|
11
|
-
var GridStackDDI = /** @class */ (function () {
|
|
12
|
-
function GridStackDDI() {
|
|
13
|
-
}
|
|
14
|
-
/** call this method to register your plugin instead of the default no-op one */
|
|
15
|
-
GridStackDDI.registerPlugin = function (pluginClass) {
|
|
16
|
-
GridStackDDI.ddi = new pluginClass();
|
|
17
|
-
return GridStackDDI.ddi;
|
|
18
|
-
};
|
|
19
|
-
/** get the current registered plugin to use */
|
|
20
|
-
GridStackDDI.get = function () {
|
|
21
|
-
return GridStackDDI.ddi || GridStackDDI.registerPlugin(GridStackDDI);
|
|
22
|
-
};
|
|
23
|
-
/** removes any drag&drop present (called during destroy) */
|
|
24
|
-
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
25
|
-
GridStackDDI.prototype.remove = function (el) {
|
|
26
|
-
return this; // no-op for static grids
|
|
27
|
-
};
|
|
28
|
-
return GridStackDDI;
|
|
29
|
-
}());
|
|
30
|
-
exports.GridStackDDI = GridStackDDI;
|
|
31
|
-
//# sourceMappingURL=gridstack-ddi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gridstack-ddi.js","sourceRoot":"","sources":["../../src/gridstack-ddi.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACH;IAAA;IAoBA,CAAC;IAhBC,gFAAgF;IACzE,2BAAc,GAArB,UAAsB,WAAgC;QACpD,YAAY,CAAC,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;QACrC,OAAO,YAAY,CAAC,GAAG,CAAC;IAC1B,CAAC;IAED,+CAA+C;IACxC,gBAAG,GAAV;QACE,OAAO,YAAY,CAAC,GAAG,IAAI,YAAY,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IACvE,CAAC;IAED,4DAA4D;IAC5D,gEAAgE;IACzD,6BAAM,GAAb,UAAc,EAAuB;QACnC,OAAO,IAAI,CAAC,CAAC,yBAAyB;IACxC,CAAC;IACH,mBAAC;AAAD,CAAC,AApBD,IAoBC;AApBY,oCAAY","sourcesContent":["/**\r\n * gridstack-ddi.ts 5.1.1\r\n * Copyright (c) 2021 Alain Dumesny - see GridStack root license\r\n */\r\n\r\nimport { GridItemHTMLElement } from './types';\r\n\r\n/**\r\n * Abstract Partial Interface API for drag'n'drop plugin - look at GridStackDD and HTML5 / Jquery implementation versions\r\n */\r\nexport class GridStackDDI {\r\n\r\n protected static ddi: GridStackDDI;\r\n\r\n /** call this method to register your plugin instead of the default no-op one */\r\n static registerPlugin(pluginClass: typeof GridStackDDI): GridStackDDI {\r\n GridStackDDI.ddi = new pluginClass();\r\n return GridStackDDI.ddi;\r\n }\r\n\r\n /** get the current registered plugin to use */\r\n static get(): GridStackDDI {\r\n return GridStackDDI.ddi || GridStackDDI.registerPlugin(GridStackDDI);\r\n }\r\n\r\n /** removes any drag&drop present (called during destroy) */\r\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\r\n public remove(el: GridItemHTMLElement): GridStackDDI {\r\n return this; // no-op for static grids\r\n }\r\n}\r\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* index-h5.ts 5.1.1 - everything you need for a Grid that uses HTML5 native drag&drop
|
|
3
|
-
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
|
|
4
|
-
*/
|
|
5
|
-
export * from './types';
|
|
6
|
-
export * from './utils';
|
|
7
|
-
export * from './gridstack-engine';
|
|
8
|
-
export * from './gridstack-ddi';
|
|
9
|
-
export * from './gridstack';
|
|
10
|
-
export * from './h5/gridstack-dd-native';
|
package/dist/es5/gridstack-h5.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see gridstack-h5.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.GridStack=e():t.GridStack=e()}(self,(function(){return function(){"use strict";var t={852:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.GridStackDD=void 0;var s=i(620),a=i(324),l=i(867),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.get=function(){return s.GridStackDDI.get()},e.prototype.remove=function(t){return this.draggable(t,"destroy").resizable(t,"destroy"),t.gridstackNode&&delete t.gridstackNode._initDD,this},e}(s.GridStackDDI);function h(t,e){var i=t?t.gridstackNode:void 0;i&&i.grid&&(e?i._isAboutToRemove=!0:delete i._isAboutToRemove,e?t.classList.add("grid-stack-item-removing"):t.classList.remove("grid-stack-item-removing"))}e.GridStackDD=d,a.GridStack.prototype._setupAcceptWidget=function(){var t,e,i=this;if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return d.get().droppable(this.el,"destroy"),this;var o=function(o,n,r){var s=n.gridstackNode;if(s){r=r||n;var a=i.el.getBoundingClientRect(),h=r.getBoundingClientRect(),p=h.top,u=h.left;u-=a.left;var c={position:{top:p-=a.top,left:u}};if(s._temporaryRemoved){if(s.x=Math.max(0,Math.round(u/e)),s.y=Math.max(0,Math.round(p/t)),delete s.autoPosition,i.engine.nodeBoundFix(s),!i.engine.willItFit(s)){if(s.autoPosition=!0,!i.engine.willItFit(s))return void d.get().off(n,"drag");s._willFitPos&&(l.Utils.copyPos(s,s._willFitPos),delete s._willFitPos)}i._onStartMoving(r,o,c,s,e,t)}else i._dragOrResize(r,o,c,s,e,t)}};return d.get().droppable(this.el,{accept:function(t){var e=t.gridstackNode;if((null==e?void 0:e.grid)===i)return!0;if(!i.opts.acceptWidgets)return!1;if(null==e?void 0:e.subGrid)return!1;var o=!0;if("function"==typeof i.opts.acceptWidgets)o=i.opts.acceptWidgets(t);else{var n=!0===i.opts.acceptWidgets?".grid-stack-item":i.opts.acceptWidgets;o=t.matches(n)}if(o&&e&&i.opts.maxRow){var r={w:e.w,h:e.h,minW:e.minW,minH:e.minH};o=i.engine.willItFit(r)}return o}}).on(this.el,"dropover",(function(n,s,a){var l=s.gridstackNode;if((null==l?void 0:l.grid)===i&&!l._temporaryRemoved)return!1;(null==l?void 0:l.grid)&&l.grid!==i&&!l._temporaryRemoved&&l.grid._leave(s,a),e=i.cellWidth(),t=i.getCellHeight(!0),l||(l=i._readAttr(s)),l.grid||(l._isExternal=!0,s.gridstackNode=l),a=a||s;var p=l.w||Math.round(a.offsetWidth/e)||1,u=l.h||Math.round(a.offsetHeight/t)||1;return l.grid&&l.grid!==i?(s._gridstackNodeOrig||(s._gridstackNodeOrig=l),s.gridstackNode=l=r(r({},l),{w:p,h:u,grid:i}),i.engine.cleanupNode(l).nodeBoundFix(l),l._initDD=l._isExternal=l._temporaryRemoved=!0):(l.w=p,l.h=u,l._temporaryRemoved=!0),h(l.el,!1),d.get().on(s,"drag",o),o(n,s,a),!1})).on(this.el,"dropout",(function(t,e,o){var n=e.gridstackNode;return!!n&&(n.grid&&n.grid!==i||i._leave(e,o),!1)})).on(this.el,"drop",(function(t,e,o){var n=e.gridstackNode;if((null==n?void 0:n.grid)===i&&!n._isExternal)return!1;var s=!!i.placeholder.parentElement;i.placeholder.remove();var a=e._gridstackNodeOrig;if(delete e._gridstackNodeOrig,s&&a&&a.grid&&a.grid!==i){var h=a.grid;h.engine.removedNodes.push(a),h._triggerRemoveEvent()}return!!n&&(s&&(i.engine.cleanupNode(n),n.grid=i),d.get().off(e,"drag"),o!==e?(o.remove(),e.gridstackNode=a,s&&(e=e.cloneNode(!0))):(e.remove(),d.get().remove(e)),!!s&&(e.gridstackNode=n,n.el=e,l.Utils.copyPos(n,i._readAttr(i.placeholder)),l.Utils.removePositioningStyles(e),i._writeAttr(e,n),i.el.appendChild(e),i._updateContainerHeight(),i.engine.addedNodes.push(n),i._triggerAddEvent(),i._triggerChangeEvent(),i.engine.endUpdate(),i._gsEventHandler.dropped&&i._gsEventHandler.dropped(r(r({},t),{type:"dropped"}),a&&a.grid?a:void 0,n),window.setTimeout((function(){n.el&&n.el.parentElement?i._prepareDragDropByNode(n):i.engine.removeNode(n)})),!1))})),this},a.GridStack.prototype._setupRemoveDrop=function(){if(!this.opts.staticGrid&&"string"==typeof this.opts.removable){var t=document.querySelector(this.opts.removable);if(!t)return this;d.get().isDroppable(t)||d.get().droppable(t,this.opts.removableOptions).on(t,"dropover",(function(t,e){return h(e,!0)})).on(t,"dropout",(function(t,e){return h(e,!1)}))}return this},a.GridStack.setupDragIn=function(t,e){var i,o;if(t&&(i=t,o=r(r({},{revert:"invalid",handle:".grid-stack-item-content",scroll:!1,appendTo:"body"}),e||{})),"string"==typeof i){var n=d.get();l.Utils.getElements(i).forEach((function(t){n.isDraggable(t)||n.dragIn(t,o)}))}},a.GridStack.prototype._prepareDragDropByNode=function(t){var e=this,i=t.el,o=d.get();if(this.opts.staticGrid||(t.noMove||this.opts.disableDrag)&&(t.noResize||this.opts.disableResize))return t._initDD&&(o.remove(i),delete t._initDD),i.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!t._initDD){var n,r,s=function(o,s){e._gsEventHandler[o.type]&&e._gsEventHandler[o.type](o,o.target),n=e.cellWidth(),r=e.getCellHeight(!0),e._onStartMoving(i,o,s,t,n,r)},a=function(o,s){e._dragOrResize(i,o,s,t,n,r)},h=function(n){e.placeholder.remove(),delete t._moving,delete t._lastTried;var r=n.target;if(r.gridstackNode&&r.gridstackNode.grid===e){if(t.el=r,t._isAboutToRemove){var s=i.gridstackNode.grid;s._gsEventHandler[n.type]&&s._gsEventHandler[n.type](n,r),o.remove(i),s.engine.removedNodes.push(t),s._triggerRemoveEvent(),delete i.gridstackNode,delete t.el,i.remove()}else t._temporaryRemoved?(l.Utils.removePositioningStyles(r),l.Utils.copyPos(t,t._orig),e._writePosAttr(r,t),e.engine.addNode(t)):(l.Utils.removePositioningStyles(r),e._writePosAttr(r,t)),e._gsEventHandler[n.type]&&e._gsEventHandler[n.type](n,r);e._extraDragRow=0,e._updateContainerHeight(),e._triggerChangeEvent(),e.engine.endUpdate()}};o.draggable(i,{start:s,stop:h,drag:a}).resizable(i,{start:s,stop:h,resize:a}),t._initDD=!0}return t.noMove||this.opts.disableDrag?(o.draggable(i,"disable"),i.classList.add("ui-draggable-disabled")):(o.draggable(i,"enable"),i.classList.remove("ui-draggable-disabled")),t.noResize||this.opts.disableResize?(o.resizable(i,"disable"),i.classList.add("ui-resizable-disabled")):(o.resizable(i,"enable"),i.classList.remove("ui-resizable-disabled")),this},a.GridStack.prototype._onStartMoving=function(t,e,i,o,n,r){if(this.engine.cleanNodes().beginUpdate(o),this._writePosAttr(this.placeholder,o),this.el.appendChild(this.placeholder),o.el=this.placeholder,o._lastUiPosition=i.position,o._prevYPix=i.position.top,o._moving="dragstart"===e.type,delete o._lastTried,"dropover"===e.type&&o._temporaryRemoved&&(this.engine.addNode(o),o._moving=!0),this.engine.cacheRects(n,r,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),"resizestart"===e.type){var s=d.get().resizable(t,"option","minWidth",n*(o.minW||1)).resizable(t,"option","minHeight",r*(o.minH||1));o.maxW&&s.resizable(t,"option","maxWidth",n*o.maxW),o.maxH&&s.resizable(t,"option","maxHeight",r*o.maxH)}},a.GridStack.prototype._leave=function(t,e){var i=t.gridstackNode;i&&(d.get().off(t,"drag"),i._temporaryRemoved||(i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&e?e:t,!0===this.opts.removable&&h(t,!0),t._gridstackNodeOrig?(t.gridstackNode=t._gridstackNodeOrig,delete t._gridstackNodeOrig):i._isExternal&&(delete i.el,delete t.gridstackNode,this.engine.restoreInitial())))},a.GridStack.prototype._dragOrResize=function(t,e,i,o,n,s){var a,d=r({},o._orig),h=this.opts.marginLeft,p=this.opts.marginRight,u=this.opts.marginTop,c=this.opts.marginBottom,g=Math.round(.1*s),f=Math.round(.1*n);if(h=Math.min(h,f),p=Math.min(p,f),u=Math.min(u,g),c=Math.min(c,g),"drag"===e.type){if(o._temporaryRemoved)return;var m=i.position.top-o._prevYPix;o._prevYPix=i.position.top,l.Utils.updateScrollPosition(t,i.position,m);var v=i.position.left+(i.position.left>o._lastUiPosition.left?-p:h),y=i.position.top+(i.position.top>o._lastUiPosition.top?-c:u);d.x=Math.round(v/n),d.y=Math.round(y/s);var _=this._extraDragRow;if(this.engine.collide(o,d)){var b=this.getRow(),w=Math.max(0,d.y+o.h-b);this.opts.maxRow&&b+w>this.opts.maxRow&&(w=Math.max(0,this.opts.maxRow-b)),this._extraDragRow=w}else this._extraDragRow=0;if(this._extraDragRow!==_&&this._updateContainerHeight(),o.x===d.x&&o.y===d.y)return}else if("resize"===e.type){if(d.x<0)return;if(l.Utils.updateScrollResize(e,t,s),d.w=Math.round((i.size.width-h)/n),d.h=Math.round((i.size.height-u)/s),o.w===d.w&&o.h===d.h)return;if(o._lastTried&&o._lastTried.w===d.w&&o._lastTried.h===d.h)return;v=i.position.left+h;var E=i.position.top+u;d.x=Math.round(v/n),d.y=Math.round(E/s),a=!0}o._lastTried=d;var x={x:i.position.left+h,y:i.position.top+u,w:(i.size?i.size.width:o.w*n)-h-p,h:(i.size?i.size.height:o.h*s)-u-c};if(this.engine.moveNodeCheck(o,r(r({},d),{cellWidth:n,cellHeight:s,rect:x,resizing:a}))){o._lastUiPosition=i.position,this.engine.cacheRects(n,s,u,p,c,h),delete o._skipDown,a&&o.subGrid&&o.subGrid.onParentResize(),this._extraDragRow=0,this._updateContainerHeight();var D=e.target;this._writePosAttr(D,o),this._gsEventHandler[e.type]&&this._gsEventHandler[e.type](e,D)}},a.GridStack.prototype.movable=function(t,e){var i=this;return this.opts.staticGrid||a.GridStack.getElements(t).forEach((function(t){var o=t.gridstackNode;o&&(e?delete o.noMove:o.noMove=!0,i._prepareDragDropByNode(o))})),this},a.GridStack.prototype.resizable=function(t,e){var i=this;return this.opts.staticGrid||a.GridStack.getElements(t).forEach((function(t){var o=t.gridstackNode;o&&(e?delete o.noResize:o.noResize=!0,i._prepareDragDropByNode(o))})),this},a.GridStack.prototype.disable=function(){if(!this.opts.staticGrid)return this.enableMove(!1),this.enableResize(!1),this._triggerEvent("disable"),this},a.GridStack.prototype.enable=function(){if(!this.opts.staticGrid)return this.enableMove(!0),this.enableResize(!0),this._triggerEvent("enable"),this},a.GridStack.prototype.enableMove=function(t){var e=this;return this.opts.staticGrid||(this.opts.disableDrag=!t,this.engine.nodes.forEach((function(i){return e.movable(i.el,t)}))),this},a.GridStack.prototype.enableResize=function(t){var e=this;return this.opts.staticGrid||(this.opts.disableResize=!t,this.engine.nodes.forEach((function(i){return e.resizable(i.el,t)}))),this}},620:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.GridStackDDI=void 0;var i=function(){function t(){}return t.registerPlugin=function(e){return t.ddi=new e,t.ddi},t.get=function(){return t.ddi||t.registerPlugin(t)},t.prototype.remove=function(t){return this},t}();e.GridStackDDI=i},506:function(t,e,i){var o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.GridStackEngine=void 0;var n=i(867),r=function(){function t(t){void 0===t&&(t={}),this.addedNodes=[],this.removedNodes=[],this.column=t.column||12,this.maxRow=t.maxRow,this._float=t.float,this.nodes=t.nodes||[],this.onChange=t.onChange}return t.prototype.batchUpdate=function(){return this.batchMode?this:(this.batchMode=!0,this._prevFloat=this._float,this._float=!0,this.saveInitial())},t.prototype.commit=function(){return this.batchMode?(this.batchMode=!1,this._float=this._prevFloat,delete this._prevFloat,this._packNodes()._notify()):this},t.prototype._useEntireRowArea=function(t,e){return!this.float&&!this._hasLocked&&(!t._moving||t._skipDown||e.y<=t.y)},t.prototype._fixCollisions=function(t,e,i,r){if(void 0===e&&(e=t),void 0===r&&(r={}),this.sortNodes(-1),!(i=i||this.collide(t,e)))return!1;if(t._moving&&!r.nested&&!this.float&&this.swap(t,i))return!0;var s=e;this._useEntireRowArea(t,e)&&(s={x:0,w:this.column,y:e.y,h:e.h},i=this.collide(t,s,r.skip));for(var a=!1,l={nested:!0,pack:!1};i=i||this.collide(t,s,r.skip);){var d=void 0;if(i.locked||t._moving&&!t._skipDown&&e.y>t.y&&!this.float&&(!this.collide(i,o(o({},i),{y:t.y}),t)||!this.collide(i,o(o({},i),{y:e.y-i.h}),t))?(t._skipDown=t._skipDown||e.y>t.y,d=this.moveNode(t,o(o(o({},e),{y:i.y+i.h}),l)),i.locked&&d?n.Utils.copyPos(e,t):!i.locked&&d&&r.pack&&(this._packNodes(),e.y=i.y+i.h,n.Utils.copyPos(t,e)),a=a||d):d=this.moveNode(i,o(o(o({},i),{y:e.y+e.h,skip:t}),l)),!d)return a;i=void 0}return a},t.prototype.collide=function(t,e,i){return void 0===e&&(e=t),this.nodes.find((function(o){return o!==t&&o!==i&&n.Utils.isIntercepted(o,e)}))},t.prototype.collideAll=function(t,e,i){return void 0===e&&(e=t),this.nodes.filter((function(o){return o!==t&&o!==i&&n.Utils.isIntercepted(o,e)}))},t.prototype.collideCoverage=function(t,e,i){if(e.rect&&t._rect){var n,r=t._rect,s=o({},e.rect);return s.y>r.y?(s.h+=s.y-r.y,s.y=r.y):s.h+=r.y-s.y,s.x>r.x?(s.w+=s.x-r.x,s.x=r.x):s.w+=r.x-s.x,i.forEach((function(t){if(!t.locked&&t._rect){var e=t._rect,i=Number.MAX_VALUE,o=Number.MAX_VALUE,a=.5;r.y<e.y?i=(s.y+s.h-e.y)/e.h:r.y+r.h>e.y+e.h&&(i=(e.y+e.h-s.y)/e.h),r.x<e.x?o=(s.x+s.w-e.x)/e.w:r.x+r.w>e.x+e.w&&(o=(e.x+e.w-s.x)/e.w);var l=Math.min(o,i);l>a&&(a=l,n=t)}})),n}},t.prototype.cacheRects=function(t,e,i,o,n,r){return this.nodes.forEach((function(s){return s._rect={y:s.y*e+i,x:s.x*t+r,w:s.w*t-r-o,h:s.h*e-i-n}})),this},t.prototype.swap=function(t,e){if(!e||e.locked||!t||t.locked)return!1;function i(){var i=e.x,o=e.y;return e.x=t.x,e.y=t.y,t.h!=e.h?(t.x=i,t.y=e.y+e.h):t.w!=e.w?(t.x=e.x+e.w,t.y=o):(t.x=i,t.y=o),t._dirty=e._dirty=!0,!0}var o;if(t.w===e.w&&t.h===e.h&&(t.x===e.x||t.y===e.y)&&(o=n.Utils.isTouching(t,e)))return i();if(!1!==o){if(t.w===e.w&&t.x===e.x&&(o||(o=n.Utils.isTouching(t,e)))){if(e.y<t.y){var r=t;t=e,e=r}return i()}if(!1!==o)return!(t.h!==e.h||t.y!==e.y||!o&&!(o=n.Utils.isTouching(t,e)))&&(e.x<t.x&&(r=t,t=e,e=r),i())}},t.prototype.isAreaEmpty=function(t,e,i,o){var n={x:t||0,y:e||0,w:i||1,h:o||1};return!this.collide(n)},t.prototype.compact=function(){var t=this;if(0===this.nodes.length)return this;this.batchUpdate().sortNodes();var e=this.nodes;return this.nodes=[],e.forEach((function(e){e.locked||(e.autoPosition=!0),t.addNode(e,!1),e._dirty=!0})),this.commit()},Object.defineProperty(t.prototype,"float",{get:function(){return this._float||!1},set:function(t){this._float!==t&&(this._float=t||!1,t||this._packNodes()._notify())},enumerable:!1,configurable:!0}),t.prototype.sortNodes=function(t){return this.nodes=n.Utils.sort(this.nodes,t,this.column),this},t.prototype._packNodes=function(){var t=this;return this.batchMode||(this.sortNodes(),this.float?this.nodes.forEach((function(e){if(!e._updating&&void 0!==e._orig&&e.y!==e._orig.y)for(var i=e.y;i>e._orig.y;)--i,t.collide(e,{x:e.x,y:i,w:e.w,h:e.h})||(e._dirty=!0,e.y=i)})):this.nodes.forEach((function(e,i){if(!e.locked)for(;e.y>0;){var o=0===i?0:e.y-1;if(0!==i&&t.collide(e,{x:e.x,y:o,w:e.w,h:e.h}))break;e._dirty=e.y!==o,e.y=o}}))),this},t.prototype.prepareNode=function(e,i){(e=e||{})._id=e._id||t._idSeq++,void 0!==e.x&&void 0!==e.y&&null!==e.x&&null!==e.y||(e.autoPosition=!0);var o={x:0,y:0,w:1,h:1};return n.Utils.defaults(e,o),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,"string"==typeof e.x&&(e.x=Number(e.x)),"string"==typeof e.y&&(e.y=Number(e.y)),"string"==typeof e.w&&(e.w=Number(e.w)),"string"==typeof e.h&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=o.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=o.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=o.w),isNaN(e.h)&&(e.h=o.h),this.nodeBoundFix(e,i)},t.prototype.nodeBoundFix=function(t,e){var i=t._orig||n.Utils.copyPos({},t);return t.maxW&&(t.w=Math.min(t.w,t.maxW)),t.maxH&&(t.h=Math.min(t.h,t.maxH)),t.minW&&t.minW<=this.column&&(t.w=Math.max(t.w,t.minW)),t.minH&&(t.h=Math.max(t.h,t.minH)),t.w>this.column?(this.column<12&&!this._inColumnResize&&(t.w=Math.min(12,t.w),this.cacheOneLayout(t,12)),t.w=this.column):t.w<1&&(t.w=1),this.maxRow&&t.h>this.maxRow?t.h=this.maxRow:t.h<1&&(t.h=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.w>this.column&&(e?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(e?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),n.Utils.samePos(t,i)||(t._dirty=!0),t},t.prototype.getDirtyNodes=function(t){return t?this.nodes.filter((function(t){return t._dirty&&!n.Utils.samePos(t,t._orig)})):this.nodes.filter((function(t){return t._dirty}))},t.prototype._notify=function(t){if(this.batchMode||!this.onChange)return this;var e=(t||[]).concat(this.getDirtyNodes());return this.onChange(e),this},t.prototype.cleanNodes=function(){return this.batchMode||this.nodes.forEach((function(t){delete t._dirty,delete t._lastTried})),this},t.prototype.saveInitial=function(){return this.nodes.forEach((function(t){t._orig=n.Utils.copyPos({},t),delete t._dirty})),this._hasLocked=this.nodes.some((function(t){return t.locked})),this},t.prototype.restoreInitial=function(){return this.nodes.forEach((function(t){n.Utils.samePos(t,t._orig)||(n.Utils.copyPos(t,t._orig),t._dirty=!0)})),this._notify(),this},t.prototype.addNode=function(t,e){void 0===e&&(e=!1);var i=this.nodes.find((function(e){return e._id===t._id}));if(i)return i;if(delete(t=this._inColumnResize?this.nodeBoundFix(t):this.prepareNode(t))._temporaryRemoved,delete t._removeDOM,t.autoPosition){this.sortNodes();for(var o=function(e){var i=e%r.column,o=Math.floor(e/r.column);if(i+t.w>r.column)return"continue";var s={x:i,y:o,w:t.w,h:t.h};return r.nodes.find((function(t){return n.Utils.isIntercepted(s,t)}))?void 0:(t.x=i,t.y=o,delete t.autoPosition,"break")},r=this,s=0;"break"!==o(s);++s);}return this.nodes.push(t),e&&this.addedNodes.push(t),this._fixCollisions(t),this.batchMode||this._packNodes()._notify(),t},t.prototype.removeNode=function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!1),this.nodes.find((function(e){return e===t}))?(i&&this.removedNodes.push(t),e&&(t._removeDOM=!0),this.nodes=this.nodes.filter((function(e){return e!==t})),this._packNodes()._notify([t])):this},t.prototype.removeAll=function(t){return void 0===t&&(t=!0),delete this._layouts,0===this.nodes.length?this:(t&&this.nodes.forEach((function(t){return t._removeDOM=!0})),this.removedNodes=this.nodes,this.nodes=[],this._notify(this.removedNodes))},t.prototype.moveNodeCheck=function(e,i){var r,s=this;if(!this.changedPosConstrain(e,i))return!1;if(i.pack=!0,!this.maxRow)return this.moveNode(e,i);var a=new t({column:this.column,float:this.float,nodes:this.nodes.map((function(t){return t===e?r=o({},t):o({},t)}))});if(!r)return!1;var l=a.moveNode(r,i)&&a.getRow()<=this.maxRow;if(!l&&!i.resizing){var d=this.collide(e,i);if(d&&this.swap(e,d))return this._notify(),!0}return!!l&&(a.nodes.filter((function(t){return t._dirty})).forEach((function(t){var e=s.nodes.find((function(e){return e._id===t._id}));e&&(n.Utils.copyPos(e,t),e._dirty=!0)})),this._notify(),!0)},t.prototype.willItFit=function(e){if(delete e._willFitPos,!this.maxRow)return!0;var i=new t({column:this.column,float:this.float,nodes:this.nodes.map((function(t){return o({},t)}))}),r=o({},e);return this.cleanupNode(r),delete r.el,delete r._id,delete r.content,delete r.grid,i.addNode(r),i.getRow()<=this.maxRow&&(e._willFitPos=n.Utils.copyPos({},r),!0)},t.prototype.changedPosConstrain=function(t,e){return e.w=e.w||t.w,e.h=e.h||t.h,t.x!==e.x||t.y!==e.y||(t.maxW&&(e.w=Math.min(e.w,t.maxW)),t.maxH&&(e.h=Math.min(e.h,t.maxH)),t.minW&&(e.w=Math.max(e.w,t.minW)),t.minH&&(e.h=Math.max(e.h,t.minH)),t.w!==e.w||t.h!==e.h)},t.prototype.moveNode=function(t,e){if(!t||!e)return!1;void 0===e.pack&&(e.pack=!0),"number"!=typeof e.x&&(e.x=t.x),"number"!=typeof e.y&&(e.y=t.y),"number"!=typeof e.w&&(e.w=t.w),"number"!=typeof e.h&&(e.h=t.h);var i=t.w!==e.w||t.h!==e.h,o=n.Utils.copyPos({},t,!0);if(n.Utils.copyPos(o,e),o=this.nodeBoundFix(o,i),n.Utils.copyPos(e,o),n.Utils.samePos(t,e))return!1;var r=n.Utils.copyPos({},t),s=this.collideAll(t,o,e.skip),a=!0;if(s.length){var l=t._moving&&!e.nested?this.collideCoverage(t,e,s):s[0];a=!!l&&!this._fixCollisions(t,o,l,e)}return a&&(t._dirty=!0,n.Utils.copyPos(t,o)),e.pack&&this._packNodes()._notify(),!n.Utils.samePos(t,r)},t.prototype.getRow=function(){return this.nodes.reduce((function(t,e){return Math.max(t,e.y+e.h)}),0)},t.prototype.beginUpdate=function(t){return t._updating||(t._updating=!0,delete t._skipDown,this.batchMode||this.saveInitial()),this},t.prototype.endUpdate=function(){var t=this.nodes.find((function(t){return t._updating}));return t&&(delete t._updating,delete t._skipDown),this},t.prototype.save=function(t){var e;void 0===t&&(t=!0);var i=null===(e=this._layouts)||void 0===e?void 0:e.length,n=i&&this.column!==i-1?this._layouts[i-1]:null,r=[];return this.sortNodes(),this.nodes.forEach((function(e){var i=null==n?void 0:n.find((function(t){return t._id===e._id})),s=o({},e);for(var a in i&&(s.x=i.x,s.y=i.y,s.w=i.w),s)"_"!==a[0]&&null!==s[a]&&void 0!==s[a]||delete s[a];delete s.grid,t||delete s.el,s.autoPosition||delete s.autoPosition,s.noResize||delete s.noResize,s.noMove||delete s.noMove,s.locked||delete s.locked,r.push(s)})),r},t.prototype.layoutsNodesChange=function(t){var e=this;return!this._layouts||this._inColumnResize||this._layouts.forEach((function(i,o){if(!i||o===e.column)return e;if(o<e.column)e._layouts[o]=void 0;else{var n=o/e.column;t.forEach((function(t){if(t._orig){var e=i.find((function(e){return e._id===t._id}));e&&(t.y!==t._orig.y&&(e.y+=t.y-t._orig.y),t.x!==t._orig.x&&(e.x=Math.round(t.x*n)),t.w!==t._orig.w&&(e.w=Math.round(t.w*n)))}}))}})),this},t.prototype.updateNodeWidths=function(t,e,i,o){var r,s=this;if(void 0===o&&(o="moveScale"),!this.nodes.length||!e||t===e)return this;this.cacheLayout(this.nodes,t),this.batchUpdate();var a=[],l=!1;if(1===e&&(null==i?void 0:i.length)){l=!0;var d=0;i.forEach((function(t){t.x=0,t.w=1,t.y=Math.max(t.y,d),d=t.y+t.h})),a=i,i=[]}else i=n.Utils.sort(this.nodes,-1,t);var h=[];if(e>t){h=this._layouts[e]||[];var p=this._layouts.length-1;!h.length&&t!==p&&(null===(r=this._layouts[p])||void 0===r?void 0:r.length)&&(t=p,this._layouts[p].forEach((function(t){var e=i.find((function(e){return e._id===t._id}));e&&(e.x=t.x,e.y=t.y,e.w=t.w)})))}if(h.forEach((function(t){var e=i.findIndex((function(e){return e._id===t._id}));-1!==e&&(i[e].x=t.x,i[e].y=t.y,i[e].w=t.w,a.push(i[e]),i.splice(e,1))})),i.length)if("function"==typeof o)o(e,t,a,i);else if(!l){var u=e/t,c="move"===o||"moveScale"===o,g="scale"===o||"moveScale"===o;i.forEach((function(i){i.x=1===e?0:c?Math.round(i.x*u):Math.min(i.x,e-1),i.w=1===e||1===t?1:g?Math.round(i.w*u)||1:Math.min(i.w,e),a.push(i)})),i=[]}return a=n.Utils.sort(a,-1,e),this._inColumnResize=!0,this.nodes=[],a.forEach((function(t){s.addNode(t,!1),delete t._orig})),this.commit(),delete this._inColumnResize,this},t.prototype.cacheLayout=function(e,i,o){void 0===o&&(o=!1);var n=[];return e.forEach((function(e,i){e._id=e._id||t._idSeq++,n[i]={x:e.x,y:e.y,w:e.w,_id:e._id}})),this._layouts=o?[]:this._layouts||[],this._layouts[i]=n,this},t.prototype.cacheOneLayout=function(e,i){e._id=e._id||t._idSeq++;var o={x:e.x,y:e.y,w:e.w,_id:e._id};this._layouts=this._layouts||[],this._layouts[i]=this._layouts[i]||[];var n=this._layouts[i].findIndex((function(t){return t._id===e._id}));return-1===n?this._layouts[i].push(o):this._layouts[i][n]=o,this},t.prototype.cleanupNode=function(t){for(var e in t)"_"===e[0]&&"_id"!==e&&delete t[e];return this},t._idSeq=1,t}();e.GridStackEngine=r},315:function(t,e,i){var o=this&&this.__createBinding||(Object.create?function(t,e,i,o){void 0===o&&(o=i),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,o){void 0===o&&(o=i),t[o]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||o(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(855),e),n(i(867),e),n(i(506),e),n(i(620),e),n(i(324),e),n(i(484),e)},324:function(t,e,i){var o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(t,e,i,o){void 0===o&&(o=i),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,o){void 0===o&&(o=i),t[o]=e[i]}),r=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)},s=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var o=Array(t),n=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,n++)o[n]=r[s];return o};Object.defineProperty(e,"__esModule",{value:!0}),e.GridStack=void 0;var a=i(506),l=i(867),d=i(620);r(i(855),e),r(i(867),e),r(i(506),e),r(i(620),e);var h={column:12,minRow:0,maxRow:0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,styleInHead:!1,cellHeight:"auto",cellHeightThrottle:100,margin:10,auto:!0,oneColumnSize:768,float:!1,staticGrid:!1,animate:!0,alwaysShowResizeHandle:!1,resizable:{autoHide:!0,handles:"se"},draggable:{handle:".grid-stack-item-content",scroll:!1,appendTo:"body"},disableDrag:!1,disableResize:!1,rtl:"auto",removable:!1,removableOptions:{accept:".grid-stack-item"},marginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:!1,oneColumnModeDomSort:!1},p=function(){function t(e,i){var n=this;void 0===i&&(i={}),this._gsEventHandler={},this._extraDragRow=0,this.el=e,(i=i||{}).row&&(i.minRow=i.maxRow=i.row,delete i.row);var r=l.Utils.toNumber(e.getAttribute("gs-row"));"auto"===i.column&&delete i.column;var s=i;void 0!==s.minWidth&&(i.oneColumnSize=i.oneColumnSize||s.minWidth,delete s.minWidth);var d=o(o({},l.Utils.cloneDeep(h)),{column:l.Utils.toNumber(e.getAttribute("gs-column"))||12,minRow:r||l.Utils.toNumber(e.getAttribute("gs-min-row"))||0,maxRow:r||l.Utils.toNumber(e.getAttribute("gs-max-row"))||0,staticGrid:l.Utils.toBool(e.getAttribute("gs-static"))||!1,_styleSheetClass:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),alwaysShowResizeHandle:i.alwaysShowResizeHandle||!1,resizable:{autoHide:!i.alwaysShowResizeHandle,handles:"se"},draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"},removableOptions:{accept:"."+(i.itemClass||"grid-stack-item")}});e.getAttribute("gs-animate")&&(d.animate=l.Utils.toBool(e.getAttribute("gs-animate"))),this.opts=l.Utils.defaults(i,d),i=null,this._initMargin(),1!==this.opts.column&&!this.opts.disableOneColumnMode&&this._widthOrContainer()<=this.opts.oneColumnSize&&(this._prevColumn=this.getColumn(),this.opts.column=1),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===e.style.direction),this.opts.rtl&&this.el.classList.add("grid-stack-rtl");var p=l.Utils.closestByClass(this.el,h.itemClass);p&&p.gridstackNode&&(this.opts._isNested=p.gridstackNode,this.opts._isNested.subGrid=this,p.classList.add("grid-stack-nested"),this.el.classList.add("grid-stack-nested")),this._isAutoCellHeight="auto"===this.opts.cellHeight,this._isAutoCellHeight||"initial"===this.opts.cellHeight?this.cellHeight(void 0,!1):("number"==typeof this.opts.cellHeight&&this.opts.cellHeightUnit&&this.opts.cellHeightUnit!==h.cellHeightUnit&&(this.opts.cellHeight=this.opts.cellHeight+this.opts.cellHeightUnit,delete this.opts.cellHeightUnit),this.cellHeight(this.opts.cellHeight,!1)),this.el.classList.add(this.opts._styleSheetClass),this._setStaticClass();var u=this.opts.engineClass||t.engineClass||a.GridStackEngine;if(this.engine=new u({column:this.getColumn(),float:this.opts.float,maxRow:this.opts.maxRow,onChange:function(t){var e=0;n.engine.nodes.forEach((function(t){e=Math.max(e,t.y+t.h)})),t.forEach((function(t){var e=t.el;e&&(t._removeDOM?(e&&e.remove(),delete t._removeDOM):n._writePosAttr(e,t))})),n._updateStyles(!1,e)}}),this.opts.auto){this.batchUpdate();var c=[];this.getGridItems().forEach((function(t){var e=parseInt(t.getAttribute("gs-x")),i=parseInt(t.getAttribute("gs-y"));c.push({el:t,i:(Number.isNaN(e)?1e3:e)+(Number.isNaN(i)?1e3:i)*n.getColumn()})})),c.sort((function(t,e){return t.i-e.i})).forEach((function(t){return n._prepareElement(t.el)})),this.commit()}this.setAnimation(this.opts.animate),this._updateStyles(),12!=this.opts.column&&this.el.classList.add("grid-stack-"+this.opts.column),this.opts.dragIn&&t.setupDragIn(this.opts.dragIn,this.opts.dragInOptions),delete this.opts.dragIn,delete this.opts.dragInOptions,this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateWindowResizeEvent()}return t.init=function(e,i){void 0===e&&(e={}),void 0===i&&(i=".grid-stack");var o=t.getGridElement(i);return o?(o.gridstack||(o.gridstack=new t(o,l.Utils.cloneDeep(e))),o.gridstack):("string"==typeof i?console.error('GridStack.initAll() no grid was found with selector "'+i+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'):console.error("GridStack.init() no grid element was passed."),null)},t.initAll=function(e,i){void 0===e&&(e={}),void 0===i&&(i=".grid-stack");var o=[];return t.getGridElements(i).forEach((function(i){i.gridstack||(i.gridstack=new t(i,l.Utils.cloneDeep(e)),delete e.dragIn,delete e.dragInOptions),o.push(i.gridstack)})),0===o.length&&console.error('GridStack.initAll() no grid was found with selector "'+i+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'),o},t.addGrid=function(e,i){if(void 0===i&&(i={}),!e)return null;var o=e;if(!e.classList.contains("grid-stack")){var n=document.implementation.createHTMLDocument("");n.body.innerHTML='<div class="grid-stack '+(i.class||"")+'"></div>',o=n.body.children[0],e.appendChild(o)}var r=t.init(i,o);if(r.opts.children){var s=r.opts.children;delete r.opts.children,r.load(s)}return r},t.registerEngine=function(e){t.engineClass=e},Object.defineProperty(t.prototype,"placeholder",{get:function(){if(!this._placeholder){var t=document.createElement("div");t.className="placeholder-content",this.opts.placeholderText&&(t.innerHTML=this.opts.placeholderText),this._placeholder=document.createElement("div"),this._placeholder.classList.add(this.opts.placeholderClass,h.itemClass,this.opts.itemClass),this.placeholder.appendChild(t)}return this._placeholder},enumerable:!1,configurable:!0}),t.prototype.addWidget=function(e,i){if(arguments.length>2){console.warn("gridstack.ts: `addWidget(el, x, y, width...)` is deprecated. Use `addWidget({x, y, w, content, ...})`. It will be removed soon");var o=arguments,n=1,r={x:o[n++],y:o[n++],w:o[n++],h:o[n++],autoPosition:o[n++],minW:o[n++],maxW:o[n++],minH:o[n++],maxH:o[n++],id:o[n++]};return this.addWidget(e,r)}function s(t){return void 0!==t.x||void 0!==t.y||void 0!==t.w||void 0!==t.h||void 0!==t.content}var a;if("string"==typeof e)(d=document.implementation.createHTMLDocument("")).body.innerHTML=e,a=d.body.children[0];else if(0===arguments.length||1===arguments.length&&s(e)){var d,h=e&&e.content||"";i=e,(d=document.implementation.createHTMLDocument("")).body.innerHTML='<div class="grid-stack-item '+(this.opts.itemClass||"")+'"><div class="grid-stack-item-content">'+h+"</div></div>",a=d.body.children[0]}else a=e;var p=this._readAttr(a);i=l.Utils.cloneDeep(i)||{},l.Utils.defaults(i,p);var u=this.engine.prepareNode(i);if(this._writeAttr(a,i),this._insertNotAppend?this.el.prepend(a):this.el.appendChild(a),this._prepareElement(a,!0,i),this._updateContainerHeight(),u.subGrid&&!u.subGrid.el){var c=void 0,g=u.subGrid;"auto"===g.column&&(g.column=u.w,g.disableOneColumnMode=!0,c=!0),h=u.el.querySelector(".grid-stack-item-content"),u.subGrid=t.addGrid(h,u.subGrid),c&&(u.subGrid._autoColumn=!0)}return this._triggerAddEvent(),this._triggerChangeEvent(),a},t.prototype.save=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1);var i=this.engine.save(t);if(i.forEach((function(e){if(t&&e.el&&!e.subGrid){var i=e.el.querySelector(".grid-stack-item-content");e.content=i?i.innerHTML:void 0,e.content||delete e.content}else t||delete e.content,e.subGrid&&(e.subGrid=e.subGrid.save(t,!0));delete e.el})),e){var o=l.Utils.cloneDeep(this.opts);return o.marginBottom===o.marginTop&&o.marginRight===o.marginLeft&&o.marginTop===o.marginRight&&(o.margin=o.marginTop,delete o.marginTop,delete o.marginRight,delete o.marginBottom,delete o.marginLeft),o.rtl===("rtl"===this.el.style.direction)&&(o.rtl="auto"),this._isAutoCellHeight&&(o.cellHeight="auto"),this._autoColumn&&(o.column="auto",delete o.disableOneColumnMode),l.Utils.removeInternalAndSame(o,h),o.children=i,o}return i},t.prototype.load=function(e,i){var o=this;void 0===i&&(i=!0);var n=t.Utils.sort(s(e),-1,this._prevColumn||this.getColumn());this._insertNotAppend=!0,this._prevColumn&&this._prevColumn!==this.opts.column&&n.some((function(t){return t.x+t.w>o.opts.column}))&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(n,this._prevColumn,!0));var r=[];return this.batchUpdate(),i&&s(this.engine.nodes).forEach((function(t){n.find((function(e){return t.id===e.id}))||("function"==typeof i?i(o,t,!1):(r.push(t),o.removeWidget(t.el,!0,!1)))})),n.forEach((function(t){var e=t.id||0===t.id?o.engine.nodes.find((function(e){return e.id===t.id})):void 0;if(e){if(o.update(e.el,t),t.subGrid&&t.subGrid.children){var n=e.el.querySelector(".grid-stack");n&&n.gridstack&&(n.gridstack.load(t.subGrid.children),o._insertNotAppend=!0)}}else i&&(t="function"==typeof i?i(o,t,!0).gridstackNode:o.addWidget(t).gridstackNode)})),this.engine.removedNodes=r,this.commit(),delete this._ignoreLayoutsNodeChange,delete this._insertNotAppend,this},t.prototype.batchUpdate=function(){return this.engine.batchUpdate(),this},t.prototype.getCellHeight=function(t){if(void 0===t&&(t=!1),this.opts.cellHeight&&"auto"!==this.opts.cellHeight&&(!t||!this.opts.cellHeightUnit||"px"===this.opts.cellHeightUnit))return this.opts.cellHeight;var e=this.el.querySelector("."+this.opts.itemClass);if(e){var i=l.Utils.toNumber(e.getAttribute("gs-h"));return Math.round(e.offsetHeight/i)}var o=parseInt(this.el.getAttribute("gs-current-row"));return o?Math.round(this.el.getBoundingClientRect().height/o):this.opts.cellHeight},t.prototype.cellHeight=function(t,e){if(void 0===e&&(e=!0),e&&void 0!==t&&this._isAutoCellHeight!==("auto"===t)&&(this._isAutoCellHeight="auto"===t,this._updateWindowResizeEvent()),"initial"!==t&&"auto"!==t||(t=void 0),void 0===t){var i=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;t=this.cellWidth()+i}var o=l.Utils.parseHeight(t);return this.opts.cellHeightUnit===o.unit&&this.opts.cellHeight===o.h||(this.opts.cellHeightUnit=o.unit,this.opts.cellHeight=o.h,e&&this._updateStyles(!0,this.getRow())),this},t.prototype.cellWidth=function(){return this._widthOrContainer()/this.getColumn()},t.prototype._widthOrContainer=function(){return this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth},t.prototype.commit=function(){return this.engine.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent(),this},t.prototype.compact=function(){return this.engine.compact(),this._triggerChangeEvent(),this},t.prototype.column=function(t,e){if(void 0===e&&(e="moveScale"),t<1||this.opts.column===t)return this;var i,o=this.getColumn();return 1===t?this._prevColumn=o:delete this._prevColumn,this.el.classList.remove("grid-stack-"+o),this.el.classList.add("grid-stack-"+t),this.opts.column=this.engine.column=t,1===t&&this.opts.oneColumnModeDomSort&&(i=[],this.getGridItems().forEach((function(t){t.gridstackNode&&i.push(t.gridstackNode)})),i.length||(i=void 0)),this.engine.updateNodeWidths(o,t,i,e),this._isAutoCellHeight&&this.cellHeight(),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this},t.prototype.getColumn=function(){return this.opts.column},t.prototype.getGridItems=function(){var t=this;return Array.from(this.el.children).filter((function(e){return e.matches("."+t.opts.itemClass)&&!e.matches("."+t.opts.placeholderClass)}))},t.prototype.destroy=function(t){if(void 0===t&&(t=!0),this.el)return this._updateWindowResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.classList.remove(this.opts._styleSheetClass)),this._removeStylesheet(),this.el.removeAttribute("gs-current-row"),delete this.opts._isNested,delete this.opts,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this},t.prototype.float=function(t){return this.engine.float=t,this._triggerChangeEvent(),this},t.prototype.getFloat=function(){return this.engine.float},t.prototype.getCellFromPixel=function(t,e){void 0===e&&(e=!1);var i,o=this.el.getBoundingClientRect();i=e?{top:o.top+document.documentElement.scrollTop,left:o.left}:{top:this.el.offsetTop,left:this.el.offsetLeft};var n=t.left-i.left,r=t.top-i.top,s=o.width/this.getColumn(),a=o.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(n/s),y:Math.floor(r/a)}},t.prototype.getRow=function(){return Math.max(this.engine.getRow(),this.opts.minRow)},t.prototype.isAreaEmpty=function(t,e,i,o){return this.engine.isAreaEmpty(t,e,i,o)},t.prototype.makeWidget=function(e){var i=t.getElement(e);return this._prepareElement(i,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),i},t.prototype.on=function(t,e){var i=this;if(-1!==t.indexOf(" "))return t.split(" ").forEach((function(t){return i.on(t,e)})),this;if("change"===t||"added"===t||"removed"===t||"enable"===t||"disable"===t){var o="enable"===t||"disable"===t;this._gsEventHandler[t]=o?function(t){return e(t)}:function(t){return e(t,t.detail)},this.el.addEventListener(t,this._gsEventHandler[t])}else"drag"===t||"dragstart"===t||"dragstop"===t||"resizestart"===t||"resize"===t||"resizestop"===t||"dropped"===t?this._gsEventHandler[t]=e:console.log("GridStack.on("+t+') event not supported, but you can still use $(".grid-stack").on(...) while jquery-ui is still used internally.');return this},t.prototype.off=function(t){var e=this;return-1!==t.indexOf(" ")?(t.split(" ").forEach((function(t){return e.off(t)})),this):("change"!==t&&"added"!==t&&"removed"!==t&&"enable"!==t&&"disable"!==t||this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)},t.prototype.removeWidget=function(e,i,o){var n=this;return void 0===i&&(i=!0),void 0===o&&(o=!0),t.getElements(e).forEach((function(t){if(t.parentElement===n.el){var e=t.gridstackNode;e||(e=n.engine.nodes.find((function(e){return t===e.el}))),e&&(delete t.gridstackNode,d.GridStackDDI.get().remove(t),n.engine.removeNode(e,i,o),i&&t.parentElement&&t.remove())}})),o&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this},t.prototype.removeAll=function(t){return void 0===t&&(t=!0),this.engine.nodes.forEach((function(t){delete t.el.gridstackNode,d.GridStackDDI.get().remove(t.el)})),this.engine.removeAll(t),this._triggerRemoveEvent(),this},t.prototype.setAnimation=function(t){return t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this},t.prototype.setStatic=function(t,e){var i=this;return void 0===e&&(e=!0),this.opts.staticGrid===t||(this.opts.staticGrid=t,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach((function(t){return i._prepareDragDropByNode(t)})),e&&this._setStaticClass()),this},t.prototype.update=function(e,i){var o=this;if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update(el, {x, w, content, ...})`. It will be removed soon");var n=arguments,r=1;return i={x:n[r++],y:n[r++],w:n[r++],h:n[r++]},this.update(e,i)}return t.getElements(e).forEach((function(t){if(t&&t.gridstackNode){var e=t.gridstackNode,n=l.Utils.cloneDeep(i);delete n.autoPosition;var r,s=["x","y","w","h"];if(s.some((function(t){return void 0!==n[t]&&n[t]!==e[t]}))&&(r={},s.forEach((function(t){r[t]=void 0!==n[t]?n[t]:e[t],delete n[t]}))),!r&&(n.minW||n.minH||n.maxW||n.maxH)&&(r={}),n.content){var a=t.querySelector(".grid-stack-item-content");a&&a.innerHTML!==n.content&&(a.innerHTML=n.content),delete n.content}var d=!1,h=!1;for(var p in n)"_"!==p[0]&&e[p]!==n[p]&&(e[p]=n[p],d=!0,h=h||!o.opts.staticGrid&&("noResize"===p||"noMove"===p||"locked"===p));r&&(o.engine.cleanNodes().beginUpdate(e).moveNode(e,r),o._updateContainerHeight(),o._triggerChangeEvent(),o.engine.endUpdate()),d&&o._writeAttr(t,e),h&&o._prepareDragDropByNode(e)}})),this},t.prototype.margin=function(t){if(!("string"==typeof t&&t.split(" ").length>1)){var e=l.Utils.parseHeight(t);if(this.opts.marginUnit===e.unit&&this.opts.margin===e.h)return}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this._updateStyles(!0),this},t.prototype.getMargin=function(){return this.opts.margin},t.prototype.willItFit=function(t){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");var e=arguments,i=0,o={x:e[i++],y:e[i++],w:e[i++],h:e[i++],autoPosition:e[i++]};return this.willItFit(o)}return this.engine.willItFit(t)},t.prototype._triggerChangeEvent=function(){if(this.engine.batchMode)return this;var t=this.engine.getDirtyNodes(!0);return t&&t.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine.saveInitial(),this},t.prototype._triggerAddEvent=function(){return this.engine.batchMode||this.engine.addedNodes&&this.engine.addedNodes.length>0&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach((function(t){delete t._dirty})),this._triggerEvent("added",this.engine.addedNodes),this.engine.addedNodes=[]),this},t.prototype._triggerRemoveEvent=function(){return this.engine.batchMode||this.engine.removedNodes&&this.engine.removedNodes.length>0&&(this._triggerEvent("removed",this.engine.removedNodes),this.engine.removedNodes=[]),this},t.prototype._triggerEvent=function(t,e){var i=e?new CustomEvent(t,{bubbles:!1,detail:e}):new Event(t);return this.el.dispatchEvent(i),this},t.prototype._removeStylesheet=function(){return this._styles&&(l.Utils.removeStylesheet(this._styles._id),delete this._styles),this},t.prototype._updateStyles=function(t,e){if(void 0===t&&(t=!1),t&&this._removeStylesheet(),this._updateContainerHeight(),0===this.opts.cellHeight)return this;var i=this.opts.cellHeight,o=this.opts.cellHeightUnit,n="."+this.opts._styleSheetClass+" > ."+this.opts.itemClass;if(!this._styles){var r="gridstack-style-"+(1e5*Math.random()).toFixed(),s=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=l.Utils.createStylesheet(r,s),!this._styles)return this;this._styles._id=r,this._styles._max=0,l.Utils.addCSSRule(this._styles,n,"min-height: "+i+o);var a=this.opts.marginTop+this.opts.marginUnit,d=this.opts.marginBottom+this.opts.marginUnit,h=this.opts.marginRight+this.opts.marginUnit,p=this.opts.marginLeft+this.opts.marginUnit,u=n+" > .grid-stack-item-content",c="."+this.opts._styleSheetClass+" > .grid-stack-placeholder > .placeholder-content";l.Utils.addCSSRule(this._styles,u,"top: "+a+"; right: "+h+"; bottom: "+d+"; left: "+p+";"),l.Utils.addCSSRule(this._styles,c,"top: "+a+"; right: "+h+"; bottom: "+d+"; left: "+p+";"),l.Utils.addCSSRule(this._styles,n+" > .ui-resizable-ne","right: "+h),l.Utils.addCSSRule(this._styles,n+" > .ui-resizable-e","right: "+h),l.Utils.addCSSRule(this._styles,n+" > .ui-resizable-se","right: "+h+"; bottom: "+d),l.Utils.addCSSRule(this._styles,n+" > .ui-resizable-nw","left: "+p),l.Utils.addCSSRule(this._styles,n+" > .ui-resizable-w","left: "+p),l.Utils.addCSSRule(this._styles,n+" > .ui-resizable-sw","left: "+p+"; bottom: "+d)}if((e=e||this._styles._max)>this._styles._max){for(var g=function(t){return i*t+o},f=this._styles._max+1;f<=e;f++){var m=g(f);l.Utils.addCSSRule(this._styles,n+'[gs-y="'+(f-1)+'"]',"top: "+g(f-1)),l.Utils.addCSSRule(this._styles,n+'[gs-h="'+f+'"]',"height: "+m),l.Utils.addCSSRule(this._styles,n+'[gs-min-h="'+f+'"]',"min-height: "+m),l.Utils.addCSSRule(this._styles,n+'[gs-max-h="'+f+'"]',"max-height: "+m)}this._styles._max=e}return this},t.prototype._updateContainerHeight=function(){if(!this.engine||this.engine.batchMode)return this;var t=this.getRow()+this._extraDragRow;if(this.el.setAttribute("gs-current-row",String(t)),0===t)return this.el.style.removeProperty("height"),this;var e=this.opts.cellHeight,i=this.opts.cellHeightUnit;return e?(this.el.style.height=t*e+i,this):this},t.prototype._prepareElement=function(t,e,i){void 0===e&&(e=!1),i||(t.classList.add(this.opts.itemClass),i=this._readAttr(t)),t.gridstackNode=i,i.el=t,i.grid=this;var n=o({},i);return i=this.engine.addNode(i,e),l.Utils.same(i,n)||this._writeAttr(t,i),this._prepareDragDropByNode(i),this},t.prototype._writePosAttr=function(t,e){return void 0!==e.x&&null!==e.x&&t.setAttribute("gs-x",String(e.x)),void 0!==e.y&&null!==e.y&&t.setAttribute("gs-y",String(e.y)),e.w&&t.setAttribute("gs-w",String(e.w)),e.h&&t.setAttribute("gs-h",String(e.h)),this},t.prototype._writeAttr=function(t,e){if(!e)return this;this._writePosAttr(t,e);var i={autoPosition:"gs-auto-position",minW:"gs-min-w",minH:"gs-min-h",maxW:"gs-max-w",maxH:"gs-max-h",noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",resizeHandles:"gs-resize-handles"};for(var o in i)e[o]?t.setAttribute(i[o],String(e[o])):t.removeAttribute(i[o]);return this},t.prototype._readAttr=function(t){var e={};for(var i in e.x=l.Utils.toNumber(t.getAttribute("gs-x")),e.y=l.Utils.toNumber(t.getAttribute("gs-y")),e.w=l.Utils.toNumber(t.getAttribute("gs-w")),e.h=l.Utils.toNumber(t.getAttribute("gs-h")),e.maxW=l.Utils.toNumber(t.getAttribute("gs-max-w")),e.minW=l.Utils.toNumber(t.getAttribute("gs-min-w")),e.maxH=l.Utils.toNumber(t.getAttribute("gs-max-h")),e.minH=l.Utils.toNumber(t.getAttribute("gs-min-h")),e.autoPosition=l.Utils.toBool(t.getAttribute("gs-auto-position")),e.noResize=l.Utils.toBool(t.getAttribute("gs-no-resize")),e.noMove=l.Utils.toBool(t.getAttribute("gs-no-move")),e.locked=l.Utils.toBool(t.getAttribute("gs-locked")),e.resizeHandles=t.getAttribute("gs-resize-handles"),e.id=t.getAttribute("gs-id"),e){if(!e.hasOwnProperty(i))return;e[i]||0===e[i]||delete e[i]}return e},t.prototype._setStaticClass=function(){var t,e,i=["grid-stack-static"];return this.opts.staticGrid?((t=this.el.classList).add.apply(t,i),this.el.setAttribute("gs-static","true")):((e=this.el.classList).remove.apply(e,i),this.el.removeAttribute("gs-static")),this},t.prototype.onParentResize=function(){var t=this;if(this.el&&this.el.clientWidth){var e=!1;if(this._autoColumn&&this.opts._isNested)this.opts.column!==this.opts._isNested.w&&(e=!0,this.column(this.opts._isNested.w,"none"));else{var i=!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.oneColumnSize;1===this.opts.column!==i&&(e=!0,this.opts.animate&&this.setAnimation(!1),this.column(i?1:this._prevColumn),this.opts.animate&&this.setAnimation(!0))}return this._isAutoCellHeight&&(!e&&this.opts.cellHeightThrottle?(this._cellHeightThrottle||(this._cellHeightThrottle=l.Utils.throttle((function(){return t.cellHeight()}),this.opts.cellHeightThrottle)),this._cellHeightThrottle()):this.cellHeight()),this.engine.nodes.forEach((function(t){t.subGrid&&t.subGrid.onParentResize()})),this}},t.prototype._updateWindowResizeEvent=function(t){void 0===t&&(t=!1);var e=(this._isAutoCellHeight||!this.opts.disableOneColumnMode)&&!this.opts._isNested;return t||!e||this._windowResizeBind?!t&&e||!this._windowResizeBind||(window.removeEventListener("resize",this._windowResizeBind),delete this._windowResizeBind):(this._windowResizeBind=this.onParentResize.bind(this),window.addEventListener("resize",this._windowResizeBind)),this},t.getElement=function(t){return void 0===t&&(t=".grid-stack-item"),l.Utils.getElement(t)},t.getElements=function(t){return void 0===t&&(t=".grid-stack-item"),l.Utils.getElements(t)},t.getGridElement=function(e){return t.getElement(e)},t.getGridElements=function(t){return l.Utils.getElements(t)},t.prototype._initMargin=function(){var t,e=0,i=[];return"string"==typeof this.opts.margin&&(i=this.opts.margin.split(" ")),2===i.length?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):4===i.length?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(t=l.Utils.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,e=this.opts.margin=t.h),void 0===this.opts.marginTop?this.opts.marginTop=e:(t=l.Utils.parseHeight(this.opts.marginTop),this.opts.marginTop=t.h,delete this.opts.margin),void 0===this.opts.marginBottom?this.opts.marginBottom=e:(t=l.Utils.parseHeight(this.opts.marginBottom),this.opts.marginBottom=t.h,delete this.opts.margin),void 0===this.opts.marginRight?this.opts.marginRight=e:(t=l.Utils.parseHeight(this.opts.marginRight),this.opts.marginRight=t.h,delete this.opts.margin),void 0===this.opts.marginLeft?this.opts.marginLeft=e:(t=l.Utils.parseHeight(this.opts.marginLeft),this.opts.marginLeft=t.h,delete this.opts.margin),this.opts.marginUnit=t.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this},t.setupDragIn=function(t,e){},t.prototype.movable=function(t,e){return this},t.prototype.resizable=function(t,e){return this},t.prototype.disable=function(){return this},t.prototype.enable=function(){return this},t.prototype.enableMove=function(t){return this},t.prototype.enableResize=function(t){return this},t.prototype._setupAcceptWidget=function(){return this},t.prototype._setupRemoveDrop=function(){return this},t.prototype._prepareDragDropByNode=function(t){return this},t.prototype._onStartMoving=function(t,e,i,o,n,r){},t.prototype._dragOrResize=function(t,e,i,o,n,r){},t.prototype._leave=function(t,e){},t.Utils=l.Utils,t.Engine=a.GridStackEngine,t}();e.GridStack=p},404:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DDBaseImplement=void 0;var i=function(){function t(){this._disabled=!1,this._eventRegister={}}return Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},enumerable:!1,configurable:!0}),t.prototype.on=function(t,e){this._eventRegister[t]=e},t.prototype.off=function(t){delete this._eventRegister[t]},t.prototype.enable=function(){this._disabled=!1},t.prototype.disable=function(){this._disabled=!0},t.prototype.destroy=function(){delete this._eventRegister},t.prototype.triggerEvent=function(t,e){if(!this.disabled&&this._eventRegister&&this._eventRegister[t])return this._eventRegister[t](e)},t}();e.DDBaseImplement=i},70:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0}),e.DDDraggable=void 0;var r=i(805),s=i(234),a=function(t){function e(e,i){void 0===i&&(i={});var o=t.call(this)||this;o.dragging=!1,o.ui=function(){var t=o.el.parentElement.getBoundingClientRect(),e=o.helper.getBoundingClientRect();return{position:{top:e.top-t.top,left:e.left-t.left}}},o.el=e,o.option=i;var n=i.handle.substring(1);return o.dragEl=e.classList.contains(n)?e:e.querySelector(i.handle)||e,o._dragStart=o._dragStart.bind(o),o._drag=o._drag.bind(o),o._dragEnd=o._dragEnd.bind(o),o.enable(),o}return n(e,t),e.prototype.on=function(e,i){t.prototype.on.call(this,e,i)},e.prototype.off=function(e){t.prototype.off.call(this,e)},e.prototype.enable=function(){t.prototype.enable.call(this),this.dragEl.draggable=!0,this.dragEl.addEventListener("dragstart",this._dragStart),this.el.classList.remove("ui-draggable-disabled"),this.el.classList.add("ui-draggable")},e.prototype.disable=function(e){void 0===e&&(e=!1),t.prototype.disable.call(this),this.dragEl.removeAttribute("draggable"),this.dragEl.removeEventListener("dragstart",this._dragStart),this.el.classList.remove("ui-draggable"),e||this.el.classList.add("ui-draggable-disabled")},e.prototype.destroy=function(){this.dragging&&this._dragEnd({}),this.disable(!0),delete this.el,delete this.helper,delete this.option,t.prototype.destroy.call(this)},e.prototype.updateOption=function(t){var e=this;return Object.keys(t).forEach((function(i){return e.option[i]=t[i]})),this},e.prototype._dragStart=function(t){var e=this;r.DDManager.dragElement=this,this.helper=this._createHelper(t),this._setupHelperContainmentStyle(),this.dragOffset=this._getDragOffset(t,this.el,this.helperContainment);var i=s.DDUtils.initEvent(t,{target:this.el,type:"dragstart"});this.helper!==this.el?(this._setupDragFollowNodeNotifyStart(i),this._dragFollow(t)):this.dragFollowTimer=window.setTimeout((function(){delete e.dragFollowTimer,e._setupDragFollowNodeNotifyStart(i)}),0),this._cancelDragGhost(t)},e.prototype._setupDragFollowNodeNotifyStart=function(t){return this._setupHelperStyle(),document.addEventListener("dragover",this._drag,e.dragEventListenerOption),this.dragEl.addEventListener("dragend",this._dragEnd),this.option.start&&this.option.start(t,this.ui()),this.dragging=!0,this.helper.classList.add("ui-draggable-dragging"),this.triggerEvent("dragstart",t),this},e.prototype._drag=function(t){t.preventDefault(),this._dragFollow(t);var e=s.DDUtils.initEvent(t,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(e,this.ui()),this.triggerEvent("drag",e)},e.prototype._dragEnd=function(t){if(this.dragFollowTimer)return clearTimeout(this.dragFollowTimer),void delete this.dragFollowTimer;this.paintTimer&&cancelAnimationFrame(this.paintTimer),document.removeEventListener("dragover",this._drag,e.dragEventListenerOption),this.dragEl.removeEventListener("dragend",this._dragEnd),this.dragging=!1,this.helper.classList.remove("ui-draggable-dragging"),this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper===this.el?this._removeHelperStyle():this.helper.remove();var i=s.DDUtils.initEvent(t,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(i),this.triggerEvent("dragstop",i),delete r.DDManager.dragElement,delete this.helper},e.prototype._createHelper=function(t){var i=this,o=this.el;return"function"==typeof this.option.helper?o=this.option.helper(t):"clone"===this.option.helper&&(o=s.DDUtils.clone(this.el)),document.body.contains(o)||s.DDUtils.appendTo(o,"parent"===this.option.appendTo?this.el.parentNode:this.option.appendTo),o===this.el&&(this.dragElementOriginStyle=e.originStyleProp.map((function(t){return i.el.style[t]}))),o},e.prototype._setupHelperStyle=function(){var t=this,e=this.helper.getBoundingClientRect(),i=this.helper.style;return i.pointerEvents="none",i["min-width"]=0,i.width=this.dragOffset.width+"px",i.height=this.dragOffset.height+"px",i.willChange="left, top",i.position="fixed",i.left=e.left+"px",i.top=e.top+"px",i.transition="none",setTimeout((function(){t.helper&&(i.transition=null)}),0),this},e.prototype._removeHelperStyle=function(){var t,i=this,o=null===(t=this.helper)||void 0===t?void 0:t.gridstackNode;if(this.dragElementOriginStyle&&(!o||!o._isAboutToRemove)){var n=this.helper,r=this.dragElementOriginStyle.transition||null;n.style.transition=this.dragElementOriginStyle.transition="none",e.originStyleProp.forEach((function(t){return n.style[t]=i.dragElementOriginStyle[t]||null})),setTimeout((function(){return n.style.transition=r}),50)}return delete this.dragElementOriginStyle,this},e.prototype._dragFollow=function(t){var e=this;this.paintTimer&&cancelAnimationFrame(this.paintTimer),this.paintTimer=requestAnimationFrame((function(){delete e.paintTimer;var i=e.dragOffset,o={left:0,top:0};if("absolute"===e.helper.style.position){var n=e.helperContainment.getBoundingClientRect();o={left:n.left,top:n.top}}e.helper.style.left=t.clientX+i.offsetLeft-o.left+"px",e.helper.style.top=t.clientY+i.offsetTop-o.top+"px"}))},e.prototype._setupHelperContainmentStyle=function(){return this.helperContainment=this.helper.parentElement,"fixed"!==this.helper.style.position&&(this.parentOriginStylePosition=this.helperContainment.style.position,window.getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this},e.prototype._cancelDragGhost=function(t){var e=document.createElement("div");return e.style.width="1px",e.style.height="1px",e.style.position="fixed",document.body.appendChild(e),t.dataTransfer.setDragImage(e,0,0),setTimeout((function(){return document.body.removeChild(e)})),t.stopPropagation(),this},e.prototype._getDragOffset=function(t,e,i){var o=0,n=0;if(i){var r=document.createElement("div");s.DDUtils.addElStyles(r,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),i.appendChild(r);var a=r.getBoundingClientRect();i.removeChild(r),o=a.left,n=a.top}var l=e.getBoundingClientRect();return{left:l.left,top:l.top,offsetLeft:-t.clientX+l.left-o,offsetTop:-t.clientY+l.top-n,width:l.width,height:l.height}},e.dragEventListenerOption=!0,e.originStyleProp=["transition","pointerEvents","position","left","top","opacity","zIndex","width","height","willChange","min-width"],e}(i(404).DDBaseImplement);e.DDDraggable=a},523:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.DDDroppable=void 0;var s=i(805),a=i(404),l=i(234),d=function(t){function e(e,i){void 0===i&&(i={});var o=t.call(this)||this;return o.el=e,o.option=i,o._dragEnter=o._dragEnter.bind(o),o._dragOver=o._dragOver.bind(o),o._dragLeave=o._dragLeave.bind(o),o._drop=o._drop.bind(o),o.el.classList.add("ui-droppable"),o.el.addEventListener("dragenter",o._dragEnter),o._setupAccept(),o}return n(e,t),e.prototype.on=function(e,i){t.prototype.on.call(this,e,i)},e.prototype.off=function(e){t.prototype.off.call(this,e)},e.prototype.enable=function(){this.disabled&&(t.prototype.enable.call(this),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("dragenter",this._dragEnter))},e.prototype.disable=function(e){void 0===e&&(e=!1),this.disabled||(t.prototype.disable.call(this),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("dragenter",this._dragEnter))},e.prototype.destroy=function(){this._removeLeaveCallbacks(),this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),t.prototype.destroy.call(this)},e.prototype.updateOption=function(t){var e=this;return Object.keys(t).forEach((function(i){return e.option[i]=t[i]})),this._setupAccept(),this},e.prototype._dragEnter=function(t){if(this._canDrop()&&(t.preventDefault(),t.stopPropagation(),!this.moving)){this.moving=!0;var i=l.DDUtils.initEvent(t,{target:this.el,type:"dropover"});this.option.over&&this.option.over(i,this._ui(s.DDManager.dragElement)),this.triggerEvent("dropover",i),this.el.addEventListener("dragover",this._dragOver),this.el.addEventListener("drop",this._drop),this.el.addEventListener("dragleave",this._dragLeave),e.lastActive&&e.lastActive!==this&&e.lastActive._dragLeave(t,!0),e.lastActive=this}},e.prototype._dragOver=function(t){t.preventDefault(),t.stopPropagation()},e.prototype._dragLeave=function(t,i){var o;if(t.preventDefault(),t.stopPropagation(),!i){var n=l.DDUtils.inside(t,this.el),r=s.DDManager.dragElement.el;if(n&&!(null===(o=r.gridstackNode)||void 0===o?void 0:o.subGrid)&&(n=!this.el.gridstack.engine.nodes.filter((function(t){return t.subGrid})).map((function(t){return t.subGrid.el})).some((function(e){return l.DDUtils.inside(t,e)}))),n)return}if(this.moving){var a=l.DDUtils.initEvent(t,{target:this.el,type:"dropout"});this.option.out&&this.option.out(a,this._ui(s.DDManager.dragElement)),this.triggerEvent("dropout",a)}this._removeLeaveCallbacks(),e.lastActive===this&&delete e.lastActive},e.prototype._drop=function(t){if(this.moving){t.preventDefault();var e=l.DDUtils.initEvent(t,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(e,this._ui(s.DDManager.dragElement)),this.triggerEvent("drop",e),this._removeLeaveCallbacks()}},e.prototype._removeLeaveCallbacks=function(){this.moving&&(delete this.moving,this.el.removeEventListener("dragover",this._dragOver),this.el.removeEventListener("drop",this._drop),this.el.removeEventListener("dragleave",this._dragLeave))},e.prototype._canDrop=function(){return s.DDManager.dragElement&&(!this.accept||this.accept(s.DDManager.dragElement.el))},e.prototype._setupAccept=function(){var t=this;return this.option.accept&&"string"==typeof this.option.accept?this.accept=function(e){return e.matches(t.option.accept)}:this.accept=this.option.accept,this},e.prototype._ui=function(t){return r({draggable:t.el},t.ui())},e}(a.DDBaseImplement);e.DDDroppable=d},733:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.DDElement=void 0;var o=i(184),n=i(70),r=i(523),s=function(){function t(t){this.el=t}return t.init=function(e){return e.ddElement||(e.ddElement=new t(e)),e.ddElement},t.prototype.on=function(t,e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(t)>-1?this.ddDraggable.on(t,e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(t)>-1?this.ddDroppable.on(t,e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(t)>-1&&this.ddResizable.on(t,e),this},t.prototype.off=function(t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(t)>-1?this.ddDraggable.off(t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(t)>-1?this.ddDroppable.off(t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(t)>-1&&this.ddResizable.off(t),this},t.prototype.setupDraggable=function(t){return this.ddDraggable?this.ddDraggable.updateOption(t):this.ddDraggable=new n.DDDraggable(this.el,t),this},t.prototype.cleanDraggable=function(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this},t.prototype.setupResizable=function(t){return this.ddResizable?this.ddResizable.updateOption(t):this.ddResizable=new o.DDResizable(this.el,t),this},t.prototype.cleanResizable=function(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this},t.prototype.setupDroppable=function(t){return this.ddDroppable?this.ddDroppable.updateOption(t):this.ddDroppable=new r.DDDroppable(this.el,t),this},t.prototype.cleanDroppable=function(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this},t}();e.DDElement=s},805:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DDManager=void 0;e.DDManager=function(){}},789:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DDResizableHandle=void 0;var i=function(){function t(t,e,i){this.moving=!1,this.host=t,this.dir=e,this.option=i,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._init()}return t.prototype._init=function(){var e=document.createElement("div");return e.classList.add("ui-resizable-handle"),e.classList.add(""+t.prefix+this.dir),e.style.zIndex="100",e.style.userSelect="none",this.el=e,this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),this},t.prototype.destroy=function(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),this.host.removeChild(this.el),delete this.el,delete this.host,this},t.prototype._mouseDown=function(t){t.preventDefault(),this.mouseDownEvent=t,document.addEventListener("mousemove",this._mouseMove,!0),document.addEventListener("mouseup",this._mouseUp)},t.prototype._mouseMove=function(t){var e=this.mouseDownEvent;!this.moving&&Math.abs(t.x-e.x)+Math.abs(t.y-e.y)>2?(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent)):this.moving&&this._triggerEvent("move",t)},t.prototype._mouseUp=function(t){this.moving&&this._triggerEvent("stop",t),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp),delete this.moving,delete this.mouseDownEvent},t.prototype._triggerEvent=function(t,e){return this.option[t]&&this.option[t](e),this},t.prefix="ui-resizable-",t}();e.DDResizableHandle=i},184:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0}),e.DDResizable=void 0;var r=i(789),s=i(404),a=i(234),l=i(867),d=function(t){function e(e,i){void 0===i&&(i={});var o=t.call(this)||this;return o._showHandlers=function(){o.el.classList.remove("ui-resizable-autohide")},o._hideHandlers=function(){o.el.classList.add("ui-resizable-autohide")},o._ui=function(){var t=o.el.parentElement.getBoundingClientRect(),e={width:o.originalRect.width,height:o.originalRect.height+o.scrolled,left:o.originalRect.left,top:o.originalRect.top-o.scrolled},i=o.temporalRect||e;return{position:{left:i.left-t.left,top:i.top-t.top},size:{width:i.width,height:i.height}}},o.el=e,o.option=i,o.enable(),o._setupAutoHide(),o._setupHandlers(),o}return n(e,t),e.prototype.on=function(e,i){t.prototype.on.call(this,e,i)},e.prototype.off=function(e){t.prototype.off.call(this,e)},e.prototype.enable=function(){t.prototype.enable.call(this),this.el.classList.add("ui-resizable"),this.el.classList.remove("ui-resizable-disabled")},e.prototype.disable=function(){t.prototype.disable.call(this),this.el.classList.add("ui-resizable-disabled"),this.el.classList.remove("ui-resizable")},e.prototype.destroy=function(){this._removeHandlers(),this.option.autoHide&&(this.el.removeEventListener("mouseover",this._showHandlers),this.el.removeEventListener("mouseout",this._hideHandlers)),this.el.classList.remove("ui-resizable"),delete this.el,t.prototype.destroy.call(this)},e.prototype.updateOption=function(t){var e=this,i=t.handles&&t.handles!==this.option.handles,o=t.autoHide&&t.autoHide!==this.option.autoHide;return Object.keys(t).forEach((function(i){return e.option[i]=t[i]})),i&&(this._removeHandlers(),this._setupHandlers()),o&&this._setupAutoHide(),this},e.prototype._setupAutoHide=function(){return this.option.autoHide?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._showHandlers),this.el.addEventListener("mouseout",this._hideHandlers)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._showHandlers),this.el.removeEventListener("mouseout",this._hideHandlers)),this},e.prototype._setupHandlers=function(){var t=this,e=this.option.handles||"e,s,se";return"all"===e&&(e="n,e,s,w,se,sw,ne,nw"),this.handlers=e.split(",").map((function(t){return t.trim()})).map((function(e){return new r.DDResizableHandle(t.el,e,{start:function(e){t._resizeStart(e)},stop:function(e){t._resizeStop(e)},move:function(i){t._resizing(i,e)}})})),this},e.prototype._resizeStart=function(t){this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=l.Utils.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=t,this._setupHelper(),this._applyChange();var e=a.DDUtils.initEvent(t,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(e,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",e),this},e.prototype._resizing=function(t,e){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(t,e),this._applyChange();var i=a.DDUtils.initEvent(t,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this},e.prototype._resizeStop=function(t){var e=a.DDUtils.initEvent(t,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(e),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",e),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this},e.prototype._setupHelper=function(){var t=this;return this.elOriginStyleVal=e._originStyleProp.map((function(e){return t.el.style[e]})),this.parentOriginStylePosition=this.el.parentElement.style.position,window.getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this},e.prototype._cleanHelper=function(){var t=this;return e._originStyleProp.forEach((function(e,i){t.el.style[e]=t.elOriginStyleVal[i]||null})),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this},e.prototype._getChange=function(t,e){var i=this.startEvent,o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},n=t.clientX-i.clientX,r=t.clientY-i.clientY;e.indexOf("e")>-1?o.width+=n:e.indexOf("w")>-1&&(o.width-=n,o.left+=n),e.indexOf("s")>-1?o.height+=r:e.indexOf("n")>-1&&(o.height-=r,o.top+=r);var s=this._constrainSize(o.width,o.height);return Math.round(o.width)!==Math.round(s.width)&&(e.indexOf("w")>-1&&(o.left+=o.width-s.width),o.width=s.width),Math.round(o.height)!==Math.round(s.height)&&(e.indexOf("n")>-1&&(o.top+=o.height-s.height),o.height=s.height),o},e.prototype._constrainSize=function(t,e){var i=this.option.maxWidth||Number.MAX_SAFE_INTEGER,o=this.option.minWidth||t,n=this.option.maxHeight||Number.MAX_SAFE_INTEGER,r=this.option.minHeight||e;return{width:Math.min(i,Math.max(o,t)),height:Math.min(n,Math.max(r,e))}},e.prototype._applyChange=function(){var t=this,e={left:0,top:0,width:0,height:0};if("absolute"===this.el.style.position){var i=this.el.parentElement.getBoundingClientRect(),o=i.left,n=i.top;e={left:o,top:n,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach((function(i){var o=t.temporalRect[i];t.el.style[i]=o-e[i]+"px"})),this):this},e.prototype._removeHandlers=function(){return this.handlers.forEach((function(t){return t.destroy()})),delete this.handlers,this},e._originStyleProp=["width","height","position","left","top","opacity","zIndex"],e}(s.DDBaseImplement);e.DDResizable=d},234:function(t,e){var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.DDUtils=void 0;var o=function(){function t(){}var e,o;return t.clone=function(t){var e=t.cloneNode(!0);return e.removeAttribute("id"),e},t.appendTo=function(t,e){var i;(i="string"==typeof e?document.querySelector(e):e)&&i.appendChild(t)},t.setPositionRelative=function(t){/^(?:r|a|f)/.test(window.getComputedStyle(t).position)||(t.style.position="relative")},t.addElStyles=function(t,e){if(e instanceof Object){var i=function(i){e.hasOwnProperty(i)&&(Array.isArray(e[i])?e[i].forEach((function(e){t.style[i]=e})):t.style[i]=e[i])};for(var o in e)i(o)}},t.initEvent=function(t,e){var o={type:e.type},n={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:e.target?e.target:t.target};return t.dataTransfer&&(o.dataTransfer=t.dataTransfer),["altKey","ctrlKey","metaKey","shiftKey"].forEach((function(e){return o[e]=t[e]})),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach((function(e){return o[e]=t[e]})),i(i({},o),n)},t.inside=function(t,e){var i=t.relatedTarget||t.fromElement;if(!i){var o=e.getBoundingClientRect(),n=o.bottom,r=o.left,s=o.right,a=o.top;return t.x<s&&t.x>r&&t.y<n&&t.y>a}return e.contains(i)},t.isEventSupportPassiveOption=(e=!1,o=function(){},document.addEventListener("test",o,{get passive(){return e=!0,!0}}),document.removeEventListener("test",o),e),t}();e.DDUtils=o},484:function(t,e,i){var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},s=this&&this.__createBinding||(Object.create?function(t,e,i,o){void 0===o&&(o=i),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,o){void 0===o&&(o=i),t[o]=e[i]}),a=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||s(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),e.GridStackDDNative=void 0;var l=i(805),d=i(733),h=i(852),p=i(867);a(i(852),e);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.resizable=function(t,e,i,o){return this._getDDElements(t).forEach((function(t){var n;if("disable"===e||"enable"===e)t.ddResizable&&t.ddResizable[e]();else if("destroy"===e)t.ddResizable&&t.cleanResizable();else if("option"===e)t.setupResizable(((n={})[i]=o,n));else{var s=t.el.gridstackNode.grid,a=t.el.getAttribute("gs-resize-handles")?t.el.getAttribute("gs-resize-handles"):s.opts.resizable.handles;t.setupResizable(r(r(r({},s.opts.resizable),{handles:a}),{start:e.start,stop:e.stop,resize:e.resize}))}})),this},e.prototype.draggable=function(t,e,i,o){return this._getDDElements(t).forEach((function(t){var n;if("disable"===e||"enable"===e)t.ddDraggable&&t.ddDraggable[e]();else if("destroy"===e)t.ddDraggable&&t.cleanDraggable();else if("option"===e)t.setupDraggable(((n={})[i]=o,n));else{var s=t.el.gridstackNode.grid;t.setupDraggable(r(r({},s.opts.draggable),{containment:s.opts._isNested&&!s.opts.dragOut?s.el.parentElement:s.opts.draggable.containment||null,start:e.start,stop:e.stop,drag:e.drag}))}})),this},e.prototype.dragIn=function(t,e){return this._getDDElements(t).forEach((function(t){return t.setupDraggable(e)})),this},e.prototype.droppable=function(t,e,i,o){return"function"!=typeof e.accept||e._accept||(e._accept=e.accept,e.accept=function(t){return e._accept(t)}),this._getDDElements(t).forEach((function(t){var n;"disable"===e||"enable"===e?t.ddDroppable&&t.ddDroppable[e]():"destroy"===e?t.ddDroppable&&t.cleanDroppable():"option"===e?t.setupDroppable(((n={})[i]=o,n)):t.setupDroppable(e)})),this},e.prototype.isDroppable=function(t){return!(!(t&&t.ddElement&&t.ddElement.ddDroppable)||t.ddElement.ddDroppable.disabled)},e.prototype.isDraggable=function(t){return!(!(t&&t.ddElement&&t.ddElement.ddDraggable)||t.ddElement.ddDraggable.disabled)},e.prototype.isResizable=function(t){return!(!(t&&t.ddElement&&t.ddElement.ddResizable)||t.ddElement.ddResizable.disabled)},e.prototype.on=function(t,e,i){return this._getDDElements(t).forEach((function(t){return t.on(e,(function(t){i(t,l.DDManager.dragElement?l.DDManager.dragElement.el:t.target,l.DDManager.dragElement?l.DDManager.dragElement.helper:null)}))})),this},e.prototype.off=function(t,e){return this._getDDElements(t).forEach((function(t){return t.off(e)})),this},e.prototype._getDDElements=function(t,e){void 0===e&&(e=!0);var i=p.Utils.getElements(t);if(!i.length)return[];var o=i.map((function(t){return t.ddElement||(e?d.DDElement.init(t):null)}));return e||o.filter((function(t){return t})),o},e}(h.GridStackDD);e.GridStackDDNative=u,h.GridStackDD.registerPlugin(u)},855:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},867:function(t,e){var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},o=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var o=Array(t),n=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,n++)o[n]=r[s];return o};Object.defineProperty(e,"__esModule",{value:!0}),e.Utils=e.obsoleteAttr=e.obsoleteOptsDel=e.obsoleteOpts=e.obsolete=void 0,e.obsolete=function(t,e,i,o,n){var r=function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];return console.warn("gridstack.js: Function `"+i+"` is deprecated in "+n+" and has been replaced with `"+o+"`. It will be **completely** removed in v1.0"),e.apply(t,r)};return r.prototype=e.prototype,r},e.obsoleteOpts=function(t,e,i,o){void 0!==t[e]&&(t[i]=t[e],console.warn("gridstack.js: Option `"+e+"` is deprecated in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))},e.obsoleteOptsDel=function(t,e,i,o){void 0!==t[e]&&console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+o)},e.obsoleteAttr=function(t,e,i,o){var n=t.getAttribute(e);null!==n&&(t.setAttribute(i,n),console.warn("gridstack.js: attribute `"+e+"`="+n+" is deprecated on this object in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))};var n=function(){function t(){}return t.getElements=function(t){if("string"==typeof t){var e=document.querySelectorAll(t);return e.length||"."===t[0]||"#"===t[0]||(e=document.querySelectorAll("."+t)).length||(e=document.querySelectorAll("#"+t)),Array.from(e)}return[t]},t.getElement=function(t){if("string"==typeof t){if(!t.length)return null;if("#"===t[0])return document.getElementById(t.substring(1));if("."===t[0]||"["===t[0])return document.querySelector(t);if(!isNaN(+t[0]))return document.getElementById(t);var e=document.querySelector(t);return e||(e=document.getElementById(t)),e||(e=document.querySelector("."+t)),e}return t},t.isIntercepted=function(t,e){return!(t.y>=e.y+e.h||t.y+t.h<=e.y||t.x+t.w<=e.x||t.x>=e.x+e.w)},t.isTouching=function(e,i){return t.isIntercepted(e,{x:i.x-.5,y:i.y-.5,w:i.w+1,h:i.h+1})},t.sort=function(t,e,i){return i=i||t.reduce((function(t,e){return Math.max(e.x+e.w,t)}),0)||12,-1===e?t.sort((function(t,e){return e.x+e.y*i-(t.x+t.y*i)})):t.sort((function(t,e){return t.x+t.y*i-(e.x+e.y*i)}))},t.createStylesheet=function(t,e){var i=document.createElement("style");return i.setAttribute("type","text/css"),i.setAttribute("gs-style-id",t),i.styleSheet?i.styleSheet.cssText="":i.appendChild(document.createTextNode("")),e?e.insertBefore(i,e.firstChild):(e=document.getElementsByTagName("head")[0]).appendChild(i),i.sheet},t.removeStylesheet=function(t){var e=document.querySelector("STYLE[gs-style-id="+t+"]");e&&e.parentNode&&e.remove()},t.addCSSRule=function(t,e,i){"function"==typeof t.addRule?t.addRule(e,i):"function"==typeof t.insertRule&&t.insertRule(e+"{"+i+"}")},t.toBool=function(t){return"boolean"==typeof t?t:"string"==typeof t?!(""===(t=t.toLowerCase())||"no"===t||"false"===t||"0"===t):Boolean(t)},t.toNumber=function(t){return null===t||0===t.length?void 0:Number(t)},t.parseHeight=function(t){var e,i="px";if("string"==typeof t){var o=t.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!o)throw new Error("Invalid height");i=o[2]||"px",e=parseFloat(o[1])}else e=t;return{h:e,unit:i}},t.defaults=function(t){for(var e=this,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return i.forEach((function(i){for(var o in i){if(!i.hasOwnProperty(o))return;null===t[o]||void 0===t[o]?t[o]=i[o]:"object"==typeof i[o]&&"object"==typeof t[o]&&e.defaults(t[o],i[o])}})),t},t.same=function(t,e){if("object"!=typeof t)return t==e;if(typeof t!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var i in t)if(t[i]!==e[i])return!1;return!0},t.copyPos=function(t,e,i){return void 0===i&&(i=!1),t.x=e.x,t.y=e.y,t.w=e.w,t.h=e.h,i&&(e.minW&&(t.minW=e.minW),e.minH&&(t.minH=e.minH),e.maxW&&(t.maxW=e.maxW),e.maxH&&(t.maxH=e.maxH)),t},t.samePos=function(t,e){return t&&e&&t.x===e.x&&t.y===e.y&&t.w===e.w&&t.h===e.h},t.removeInternalAndSame=function(t,e){if("object"==typeof t&&"object"==typeof e)for(var i in t){var o=t[i];if("_"===i[0]||o===e[i])delete t[i];else if(o&&"object"==typeof o&&void 0!==e[i]){for(var n in o)o[n]!==e[i][n]&&"_"!==n[0]||delete o[n];Object.keys(o).length||delete t[i]}}},t.closestByClass=function(t,e){for(;t;){if(t.classList.contains(e))return t;t=t.parentElement}return null},t.throttle=function(t,e){var i=!1;return function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];i||(i=!0,setTimeout((function(){t.apply(void 0,o),i=!1}),e))}},t.removePositioningStyles=function(t){var e=t.style;e.position&&e.removeProperty("position"),e.left&&e.removeProperty("left"),e.top&&e.removeProperty("top"),e.width&&e.removeProperty("width"),e.height&&e.removeProperty("height")},t.getScrollElement=function(t){if(!t)return document.scrollingElement||document.documentElement;var e=getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowY)?t:this.getScrollElement(t.parentElement)},t.updateScrollPosition=function(t,e,i){var o=t.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight;if(o.top<0||o.bottom>n){var r=o.bottom-n,s=o.top,a=this.getScrollElement(t);if(null!==a){var l=a.scrollTop;o.top<0&&i<0?t.offsetHeight>n?a.scrollTop+=i:a.scrollTop+=Math.abs(s)>Math.abs(i)?i:s:i>0&&(t.offsetHeight>n?a.scrollTop+=i:a.scrollTop+=r>i?i:r),e.top+=a.scrollTop-l}}},t.updateScrollResize=function(t,e,i){var o=this.getScrollElement(e),n=o.clientHeight,r=o===this.getScrollElement()?0:o.getBoundingClientRect().top,s=t.clientY-r,a=s>n-i;s<i?o.scrollBy({behavior:"smooth",top:s-i}):a&&o.scrollBy({behavior:"smooth",top:i-(n-s)})},t.clone=function(t){return null==t||"object"!=typeof t?t:t instanceof Array?o(t):i({},t)},t.cloneDeep=function(e){var i=t.clone(e),o=function(o){i.hasOwnProperty(o)&&"object"==typeof i[o]&&"__"!==o.substring(0,2)&&!r.find((function(t){return t===o}))&&(i[o]=t.cloneDeep(e[o]))};for(var n in i)o(n);return i},t}();e.Utils=n;var r=["_isNested","el","grid","subGrid","engine"]}},e={},i=function i(o){var n=e[o];if(void 0!==n)return n.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,i),r.exports}(315);return i.GridStack}()}));
|
|
3
|
-
//# sourceMappingURL=gridstack-h5.js.map
|