gridstack 9.5.1 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/angular/package.json +1 -1
- package/angular/projects/demo/src/app/app.component.ts +0 -2
- package/angular/projects/lib/package.json +1 -1
- package/angular/projects/lib/src/lib/base-widget.ts +1 -1
- package/angular/projects/lib/src/lib/gridstack-item.component.ts +1 -1
- package/angular/projects/lib/src/lib/gridstack.component.ts +1 -1
- package/angular/projects/lib/src/lib/gridstack.module.ts +1 -1
- package/dist/angular/esm2020/lib/base-widget.mjs +2 -2
- package/dist/angular/esm2020/lib/gridstack-item.component.mjs +2 -2
- package/dist/angular/esm2020/lib/gridstack.component.mjs +2 -2
- package/dist/angular/esm2020/lib/gridstack.module.mjs +2 -2
- package/dist/angular/fesm2015/gridstack-angular.mjs +4 -4
- package/dist/angular/fesm2015/gridstack-angular.mjs.map +1 -1
- package/dist/angular/fesm2020/gridstack-angular.mjs +4 -4
- package/dist/angular/fesm2020/gridstack-angular.mjs.map +1 -1
- package/dist/angular/lib/gridstack-item.component.d.ts +1 -1
- package/dist/angular/lib/gridstack.component.d.ts +1 -1
- package/dist/angular/package.json +1 -1
- package/dist/angular/src/base-widget.ts +1 -1
- package/dist/angular/src/gridstack-item.component.ts +1 -1
- package/dist/angular/src/gridstack.component.ts +1 -1
- package/dist/angular/src/gridstack.module.ts +1 -1
- package/dist/dd-base-impl.d.ts +1 -1
- package/dist/dd-base-impl.js +1 -1
- package/dist/dd-base-impl.js.map +1 -1
- package/dist/dd-draggable.d.ts +1 -1
- package/dist/dd-draggable.js +1 -1
- package/dist/dd-draggable.js.map +1 -1
- package/dist/dd-droppable.d.ts +1 -1
- package/dist/dd-droppable.js +1 -1
- package/dist/dd-droppable.js.map +1 -1
- package/dist/dd-element.d.ts +1 -1
- package/dist/dd-element.js +1 -1
- package/dist/dd-element.js.map +1 -1
- package/dist/dd-gridstack.d.ts +1 -1
- package/dist/dd-gridstack.js +1 -1
- package/dist/dd-gridstack.js.map +1 -1
- package/dist/dd-manager.d.ts +1 -1
- package/dist/dd-manager.js +1 -1
- package/dist/dd-manager.js.map +1 -1
- package/dist/dd-resizable-handle.d.ts +1 -1
- package/dist/dd-resizable-handle.js +1 -1
- package/dist/dd-resizable-handle.js.map +1 -1
- package/dist/dd-resizable.d.ts +1 -1
- package/dist/dd-resizable.js +1 -1
- package/dist/dd-resizable.js.map +1 -1
- package/dist/dd-touch.d.ts +1 -1
- package/dist/dd-touch.js +1 -1
- package/dist/dd-touch.js.map +1 -1
- package/dist/es5/dd-base-impl.d.ts +1 -1
- package/dist/es5/dd-base-impl.js +1 -1
- package/dist/es5/dd-base-impl.js.map +1 -1
- package/dist/es5/dd-draggable.d.ts +1 -1
- package/dist/es5/dd-draggable.js +1 -1
- package/dist/es5/dd-draggable.js.map +1 -1
- package/dist/es5/dd-droppable.d.ts +1 -1
- package/dist/es5/dd-droppable.js +1 -1
- package/dist/es5/dd-droppable.js.map +1 -1
- package/dist/es5/dd-element.d.ts +1 -1
- package/dist/es5/dd-element.js +1 -1
- package/dist/es5/dd-element.js.map +1 -1
- package/dist/es5/dd-gridstack.d.ts +1 -1
- package/dist/es5/dd-gridstack.js +1 -1
- package/dist/es5/dd-gridstack.js.map +1 -1
- package/dist/es5/dd-manager.d.ts +1 -1
- package/dist/es5/dd-manager.js +1 -1
- package/dist/es5/dd-manager.js.map +1 -1
- package/dist/es5/dd-resizable-handle.d.ts +1 -1
- package/dist/es5/dd-resizable-handle.js +1 -1
- package/dist/es5/dd-resizable-handle.js.map +1 -1
- package/dist/es5/dd-resizable.d.ts +1 -1
- package/dist/es5/dd-resizable.js +1 -1
- package/dist/es5/dd-resizable.js.map +1 -1
- package/dist/es5/dd-touch.d.ts +1 -1
- package/dist/es5/dd-touch.js +1 -1
- package/dist/es5/dd-touch.js.map +1 -1
- package/dist/es5/gridstack-all.js +1 -1
- package/dist/es5/gridstack-all.js.LICENSE.txt +1 -1
- package/dist/es5/gridstack-all.js.map +1 -1
- package/dist/es5/gridstack-engine.d.ts +1 -1
- package/dist/es5/gridstack-engine.js +1 -1
- package/dist/es5/gridstack-engine.js.map +1 -1
- package/dist/es5/gridstack-poly.js +1 -1
- package/dist/es5/gridstack.d.ts +11 -7
- package/dist/es5/gridstack.js +183 -127
- package/dist/es5/gridstack.js.map +1 -1
- package/dist/es5/types.d.ts +27 -13
- package/dist/es5/types.js +1 -4
- package/dist/es5/types.js.map +1 -1
- package/dist/es5/utils.d.ts +2 -2
- package/dist/es5/utils.js +4 -3
- package/dist/es5/utils.js.map +1 -1
- package/dist/gridstack-all.js +1 -1
- package/dist/gridstack-all.js.LICENSE.txt +1 -1
- package/dist/gridstack-all.js.map +1 -1
- package/dist/gridstack-engine.d.ts +1 -1
- package/dist/gridstack-engine.js +1 -1
- package/dist/gridstack-engine.js.map +1 -1
- package/dist/gridstack.css +2 -2
- package/dist/gridstack.d.ts +11 -7
- package/dist/gridstack.js +180 -124
- package/dist/gridstack.js.map +1 -1
- package/dist/gridstack.min.css +1 -1
- package/dist/src/gridstack.scss +2 -2
- package/dist/types.d.ts +27 -13
- package/dist/types.js +1 -4
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +4 -3
- package/dist/utils.js.map +1 -1
- package/doc/CHANGES.md +15 -1
- package/doc/README.md +23 -10
- package/package.json +2 -2
package/doc/README.md
CHANGED
|
@@ -6,6 +6,8 @@ gridstack.js API
|
|
|
6
6
|
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
|
|
7
7
|
|
|
8
8
|
- [Grid Options](#grid-options)
|
|
9
|
+
- [Responsive](#responsive)
|
|
10
|
+
- [Breakpoint](#breakpoint)
|
|
9
11
|
- [DDDragOpt](#dddragopt)
|
|
10
12
|
- [DDDragInOpt extends DDDragOpt](#dddraginopt-extends-dddragopt)
|
|
11
13
|
- [Grid attributes](#grid-attributes)
|
|
@@ -51,7 +53,7 @@ gridstack.js API
|
|
|
51
53
|
- [`isAreaEmpty(x, y, width, height)`](#isareaemptyx-y-width-height)
|
|
52
54
|
- [`load(layout: GridStackWidget[], boolean | ((w: GridStackWidget, add: boolean) => void) = true)`](#loadlayout-gridstackwidget-boolean--w-gridstackwidget-add-boolean--void---true)
|
|
53
55
|
- [`makeWidget(el)`](#makewidgetel)
|
|
54
|
-
- [`
|
|
56
|
+
- [`makeSubGrid(el)`](#makesubgridel)
|
|
55
57
|
- [`margin(value: numberOrString)`](#marginvalue-numberorstring)
|
|
56
58
|
- [`movable(el, val)`](#movableel-val)
|
|
57
59
|
- [`removeWidget(el, removeDOM = true, triggerEvent = true)`](#removewidgetel-removedom--true-triggerevent--true)
|
|
@@ -93,9 +95,9 @@ gridstack.js API
|
|
|
93
95
|
* A value of 0 will make it instant at a cost of re-creating the CSS file at ever window resize event!
|
|
94
96
|
- `children`?: GridStackWidget[] - list of children item to create when calling load() or addGrid()
|
|
95
97
|
- `column` - Integer > 0 (default 12) which can change on the fly with `column(N)` API, or `'auto'` for nested grids to size themselves to the parent grid container (to make sub-items are the same size). See [column](http://gridstackjs.com/demo/column.html) and [nested](http://gridstackjs.com/demo/nested.html)
|
|
98
|
+
- `columnOpts`?:Responsive - describes the responsive nature of the column grid. see `Responsive` interface.
|
|
96
99
|
- `class`?: string - additional class on top of '.grid-stack' (which is required for our CSS) to differentiate this instance
|
|
97
100
|
- `disableDrag` - disallows dragging of widgets (default: `false`).
|
|
98
|
-
- `disableOneColumnMode` - Prevents the grid container from being displayed in "one column mode", even when the container's width is smaller than the value of oneColumnSize (default value of oneColumnSize is 768px). By default, this option is set to "false".
|
|
99
101
|
- `disableResize` - disallows resizing of widgets (default: `false`).
|
|
100
102
|
- `draggable` - allows to override draggable options - see `DDDragOpt`. (default: `{handle: '.grid-stack-item-content', appendTo: 'body', scroll: true}`)
|
|
101
103
|
- `dragOut` to let user drag nested grid items out of a parent or not (default false) See [example](http://gridstackjs.com/demo/nested.html)
|
|
@@ -115,9 +117,7 @@ gridstack.js API
|
|
|
115
117
|
- `maxRow` - maximum rows amount. Default is `0` which means no max.
|
|
116
118
|
- `minRow` - minimum rows amount which is handy to prevent grid from collapsing when empty. Default is `0`. You can also do this with `min-height` CSS attribute on the grid div in pixels, which will round to the closest row.
|
|
117
119
|
- `nonce` - If you are using a nonce-based Content Security Policy, pass your nonce here and
|
|
118
|
-
GridStack will add it to the
|
|
119
|
-
- `oneColumnSize` - When the width of the grid is equal to or less than the value set in oneColumnSize, the grid will be displayed in one-column mode. By default, the value of this option is set to "768".
|
|
120
|
-
- `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
|
+
GridStack will add it to the `<style>` elements it creates.
|
|
121
121
|
- `placeholderClass` - class for placeholder (default: `'grid-stack-placeholder'`)
|
|
122
122
|
- `placeholderText` - placeholder default content (default: `''`)
|
|
123
123
|
- `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`.
|
|
@@ -128,6 +128,19 @@ GridStack will add it to the <style> elements it creates.
|
|
|
128
128
|
- `staticGrid` - removes drag|drop|resize (default `false`). If `true` widgets are not movable/resizable by the user, but code can still move and oneColumnMode will still work. You can use the smaller gridstack-static.js lib. A CSS class `grid-stack-static` is also added to the container.
|
|
129
129
|
- `styleInHead` - if `true` will add style element to `<head>` otherwise will add it to element's parent node (default `false`).
|
|
130
130
|
|
|
131
|
+
### Responsive
|
|
132
|
+
v10.x supports a much richer responsive behavior, you can have breakpoints of width:column, or auto column sizing, where no code is longer needed.
|
|
133
|
+
- `columnWidth`?: number - wanted width to maintain (+-50%) to dynamically pick a column count
|
|
134
|
+
- `columnMax`?: number - maximum number of columns allowed (default: 12). Note: make sure to have correct CSS to support this.
|
|
135
|
+
- `layout`?: ColumnOptions - global re-layout mode when changing columns
|
|
136
|
+
- `breakpointForWindow`?: boolean - specify if breakpoints are for window size or grid size (default:false = grid)
|
|
137
|
+
- `breakpoints`?: Breakpoint[] - explicit width:column breakpoints instead of automatic 'columnWidth'. Note: make sure to have correct CSS to support this.
|
|
138
|
+
|
|
139
|
+
#### Breakpoint
|
|
140
|
+
- `w`?: number - width
|
|
141
|
+
- `c`: number - column
|
|
142
|
+
- `layout`?: ColumnOptions - re-layout mode if different from global one
|
|
143
|
+
|
|
131
144
|
### DDDragOpt
|
|
132
145
|
- `handle`?: string - class selector of items that can be dragged. default to '.grid-stack-item-content'
|
|
133
146
|
- `appendTo`?: string - default to 'body' (TODO: is this even used anymore ?)
|
|
@@ -136,7 +149,7 @@ GridStack will add it to the <style> elements it creates.
|
|
|
136
149
|
- `cancel`?: string - prevents dragging from starting on specified elements, listed as comma separated selectors (eg: '.no-drag'). default built in is 'input,textarea,button,select,option'
|
|
137
150
|
|
|
138
151
|
### DDDragInOpt extends DDDragOpt
|
|
139
|
-
- `helper`?: 'clone' | ((event: Event) => HTMLElement) - helper function when dropping (ex: 'clone' or your own method)
|
|
152
|
+
- `helper`?: 'clone' | ((event: Event) => HTMLElement) - helper function when dropping (ex: 'clone' or your own method)
|
|
140
153
|
|
|
141
154
|
## Grid attributes
|
|
142
155
|
|
|
@@ -321,7 +334,7 @@ let grids = GridStack.initAll();
|
|
|
321
334
|
grids.forEach(...)
|
|
322
335
|
```
|
|
323
336
|
|
|
324
|
-
### `addGrid(parent: HTMLElement, opt: GridStackOptions = {}): GridStack `
|
|
337
|
+
### `addGrid(parent: HTMLElement, opt: GridStackOptions = {}): GridStack `
|
|
325
338
|
|
|
326
339
|
* call to create a grid with the given options, including loading any children from JSON structure. This will call `GridStack.init()`, then `grid.load()` on any passed children (recursively). Great alternative to calling `init()` if you want entire grid to come from JSON serialized data, including options.
|
|
327
340
|
* @param parent HTML element parent to the grid
|
|
@@ -372,7 +385,7 @@ re-layout grid items to reclaim any empty space. Options are:
|
|
|
372
385
|
- `'compact'` might re-order items to fill any empty space
|
|
373
386
|
|
|
374
387
|
- `doSort` - `false` to let you do your own sorting ahead in case you need to control a different order. (default to sort)
|
|
375
|
-
|
|
388
|
+
|
|
376
389
|
|
|
377
390
|
### `cellHeight(val: number, update = true)`
|
|
378
391
|
|
|
@@ -509,7 +522,7 @@ let grid = GridStack.init();
|
|
|
509
522
|
grid.el.appendChild('<div id="gsi-1" gs-x="0" gs-y="0" gs-w="3" gs-h="2" gs-auto-position="true"></div>')
|
|
510
523
|
grid.makeWidget('#gsi-1');
|
|
511
524
|
```
|
|
512
|
-
### `
|
|
525
|
+
### `makeSubGrid(el)`
|
|
513
526
|
Used to add a subgrid into an existing grid.
|
|
514
527
|
```js
|
|
515
528
|
const grid = Gridstack.init()
|
|
@@ -520,7 +533,7 @@ grid.el.appendChild(`
|
|
|
520
533
|
</div>
|
|
521
534
|
</div>
|
|
522
535
|
</div>`)
|
|
523
|
-
grid.
|
|
536
|
+
grid.makeSubGrid(grid.el.getElementById('nested-grid'))
|
|
524
537
|
```
|
|
525
538
|
Make sure that the subgrid is inside of a grid item. It is important to remember that subgrids are themselves grid items capable of containing other grid items.
|
|
526
539
|
### `margin(value: numberOrString)`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gridstack",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Alain Dumesny <alaind831+github@gmail.com> (https://github.com/adumesny)",
|
|
6
6
|
"contributors": [
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"karma-chrome-launcher": "^3.1.1",
|
|
84
84
|
"karma-cli": "^2.0.0",
|
|
85
85
|
"karma-jasmine": "^5.1.0",
|
|
86
|
-
"karma-typescript": "5.5.
|
|
86
|
+
"karma-typescript": "5.5.4",
|
|
87
87
|
"protractor": "^7.0.0",
|
|
88
88
|
"sass": "^1.62.0",
|
|
89
89
|
"serve-static": "^1.15.0",
|