gridstack 10.3.1 → 11.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 +37 -3
- package/dist/angular/README.md +47 -25
- package/dist/angular/{esm2020 → esm2022}/gridstack-angular.mjs +5 -5
- package/dist/angular/esm2022/index.mjs +8 -0
- package/dist/angular/esm2022/lib/base-widget.mjs +34 -0
- package/dist/angular/esm2022/lib/gridstack-item.component.mjs +72 -0
- package/dist/angular/esm2022/lib/gridstack.component.mjs +300 -0
- package/dist/angular/esm2022/lib/gridstack.module.mjs +39 -0
- package/dist/angular/{fesm2020 → fesm2022}/gridstack-angular.mjs +400 -369
- package/dist/angular/fesm2022/gridstack-angular.mjs.map +1 -0
- package/dist/angular/index.d.ts +4 -5
- package/dist/angular/lib/base-widget.d.ts +18 -16
- package/dist/angular/lib/gridstack-item.component.d.ts +37 -37
- package/dist/angular/lib/gridstack.component.d.ts +135 -129
- package/dist/angular/lib/gridstack.module.d.ts +10 -10
- package/dist/angular/src/base-widget.ts +10 -2
- package/dist/angular/src/gridstack-item.component.ts +11 -7
- package/dist/angular/src/gridstack.component.ts +67 -44
- package/dist/angular/src/gridstack.module.ts +2 -2
- package/dist/dd-base-impl.d.ts +2 -2
- package/dist/dd-base-impl.js +2 -2
- package/dist/dd-base-impl.js.map +1 -1
- package/dist/dd-draggable.d.ts +7 -16
- package/dist/dd-draggable.js +22 -34
- package/dist/dd-draggable.js.map +1 -1
- package/dist/dd-droppable.d.ts +2 -2
- package/dist/dd-droppable.js +2 -2
- package/dist/dd-droppable.js.map +1 -1
- package/dist/dd-element.d.ts +5 -5
- package/dist/dd-element.js +2 -2
- package/dist/dd-element.js.map +1 -1
- package/dist/dd-gridstack.d.ts +4 -4
- package/dist/dd-gridstack.js +8 -8
- package/dist/dd-gridstack.js.map +1 -1
- package/dist/dd-manager.d.ts +2 -2
- package/dist/dd-manager.js +2 -2
- package/dist/dd-manager.js.map +1 -1
- package/dist/dd-resizable-handle.d.ts +2 -2
- package/dist/dd-resizable-handle.js +3 -3
- package/dist/dd-resizable-handle.js.map +1 -1
- package/dist/dd-resizable.d.ts +2 -2
- package/dist/dd-resizable.js +4 -4
- package/dist/dd-resizable.js.map +1 -1
- package/dist/dd-touch.d.ts +2 -2
- package/dist/dd-touch.js +2 -2
- package/dist/dd-touch.js.map +1 -1
- package/dist/es5/dd-base-impl.d.ts +2 -2
- package/dist/es5/dd-base-impl.js +2 -2
- package/dist/es5/dd-base-impl.js.map +1 -1
- package/dist/es5/dd-draggable.d.ts +7 -16
- package/dist/es5/dd-draggable.js +19 -29
- package/dist/es5/dd-draggable.js.map +1 -1
- package/dist/es5/dd-droppable.d.ts +2 -2
- package/dist/es5/dd-droppable.js +2 -2
- package/dist/es5/dd-droppable.js.map +1 -1
- package/dist/es5/dd-element.d.ts +5 -5
- package/dist/es5/dd-element.js +2 -2
- package/dist/es5/dd-element.js.map +1 -1
- package/dist/es5/dd-gridstack.d.ts +4 -4
- package/dist/es5/dd-gridstack.js +9 -6
- package/dist/es5/dd-gridstack.js.map +1 -1
- package/dist/es5/dd-manager.d.ts +2 -2
- package/dist/es5/dd-manager.js +2 -2
- package/dist/es5/dd-manager.js.map +1 -1
- package/dist/es5/dd-resizable-handle.d.ts +2 -2
- package/dist/es5/dd-resizable-handle.js +2 -2
- package/dist/es5/dd-resizable-handle.js.map +1 -1
- package/dist/es5/dd-resizable.d.ts +2 -2
- package/dist/es5/dd-resizable.js +2 -2
- package/dist/es5/dd-resizable.js.map +1 -1
- package/dist/es5/dd-touch.d.ts +2 -2
- package/dist/es5/dd-touch.js +2 -2
- 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 +2 -2
- package/dist/es5/gridstack-all.js.map +1 -1
- package/dist/es5/gridstack-engine.d.ts +2 -2
- package/dist/es5/gridstack-engine.js +5 -5
- package/dist/es5/gridstack-engine.js.map +1 -1
- package/dist/es5/gridstack-poly.js +2 -2
- package/dist/es5/gridstack.d.ts +22 -17
- package/dist/es5/gridstack.js +158 -141
- package/dist/es5/gridstack.js.map +1 -1
- package/dist/es5/types.d.ts +16 -8
- package/dist/es5/types.js +3 -10
- package/dist/es5/types.js.map +1 -1
- package/dist/es5/utils.d.ts +6 -2
- package/dist/es5/utils.js +36 -3
- package/dist/es5/utils.js.map +1 -1
- package/dist/gridstack-all.js +1 -1
- package/dist/gridstack-all.js.LICENSE.txt +2 -2
- package/dist/gridstack-all.js.map +1 -1
- package/dist/gridstack-engine.d.ts +2 -2
- package/dist/gridstack-engine.js +61 -61
- package/dist/gridstack-engine.js.map +1 -1
- package/dist/gridstack-extra.css +1 -1
- package/dist/gridstack.css +2 -2
- package/dist/gridstack.d.ts +22 -17
- package/dist/gridstack.js +244 -226
- package/dist/gridstack.js.map +1 -1
- package/dist/src/gridstack-extra.scss +1 -1
- package/dist/src/gridstack.scss +2 -2
- package/dist/types.d.ts +16 -8
- package/dist/types.js +2 -9
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +6 -2
- package/dist/utils.js +50 -20
- package/dist/utils.js.map +1 -1
- package/doc/CHANGES.md +8 -0
- package/doc/README.md +18 -23
- package/package.json +1 -1
- package/dist/angular/esm2020/lib/base-widget.mjs +0 -30
- package/dist/angular/esm2020/lib/gridstack-item.component.mjs +0 -68
- package/dist/angular/esm2020/lib/gridstack.component.mjs +0 -280
- package/dist/angular/esm2020/lib/gridstack.module.mjs +0 -39
- package/dist/angular/esm2020/public-api.mjs +0 -8
- package/dist/angular/fesm2015/gridstack-angular.mjs +0 -420
- package/dist/angular/fesm2015/gridstack-angular.mjs.map +0 -1
- package/dist/angular/fesm2020/gridstack-angular.mjs.map +0 -1
- package/dist/angular/package.json +0 -31
- package/dist/angular/public-api.d.ts +0 -4
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ If you find this lib useful, please donate [PayPal](https://www.paypal.me/alaind
|
|
|
15
15
|
[](https://www.paypal.me/alaind831)
|
|
16
16
|
[](https://www.venmo.com/adumesny)
|
|
17
17
|
|
|
18
|
-
Join us on Slack: [https://gridstackjs.slack.com](https://join.slack.com/t/gridstackjs/shared_invite/zt-
|
|
18
|
+
Join us on Slack: [https://gridstackjs.slack.com](https://join.slack.com/t/gridstackjs/shared_invite/zt-2qa21lnxz-vw29RdTFet3N6~ABqT9kwA)
|
|
19
19
|
|
|
20
20
|
<!-- [](https://gridstackjs.slack.com) -->
|
|
21
21
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
@@ -47,8 +47,10 @@ Join us on Slack: [https://gridstackjs.slack.com](https://join.slack.com/t/grids
|
|
|
47
47
|
- [Migrating to v8](#migrating-to-v8)
|
|
48
48
|
- [Migrating to v9](#migrating-to-v9)
|
|
49
49
|
- [Migrating to v10](#migrating-to-v10)
|
|
50
|
+
- [Migrating to v11](#migrating-to-v11)
|
|
50
51
|
- [jQuery Application](#jquery-application)
|
|
51
52
|
- [Changes](#changes)
|
|
53
|
+
- [Usage Trend](#usage-trend)
|
|
52
54
|
- [The Team](#the-team)
|
|
53
55
|
|
|
54
56
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
@@ -149,13 +151,13 @@ GridStack no longer requires external dependencies as of v1 (lodash was removed
|
|
|
149
151
|
|
|
150
152
|
search for ['gridstack' under NPM](https://www.npmjs.com/search?q=gridstack&ranking=popularity) for latest, more to come...
|
|
151
153
|
|
|
152
|
-
- **Angular**: we
|
|
154
|
+
- **Angular**: we ship out of the box an Angular wrapper - see <a href="https://github.com/gridstack/gridstack.js/tree/master/angular" target="_blank">Angular Component</a>.
|
|
153
155
|
- **Angular9**: [lb-gridstack](https://github.com/pfms84/lb-gridstack) Note: very old v0.3 gridstack instance so recommend for **concept ONLY if you wish to use directive instead**. Code has **not been vented** at as I use components.
|
|
154
156
|
- **AngularJS**: [gridstack-angular](https://github.com/kdietrich/gridstack-angular)
|
|
155
157
|
- **Ember**: [ember-gridstack](https://github.com/yahoo/ember-gridstack)
|
|
156
158
|
- **knockout**: see [demo](https://gridstackjs.com/demo/knockout.html) using component, but check [custom bindings ticket](https://github.com/gridstack/gridstack.js/issues/465) which is likely better approach.
|
|
157
159
|
- **Rails**: [gridstack-js-rails](https://github.com/randoum/gridstack-js-rails)
|
|
158
|
-
- **React**: see [demo](https://gridstackjs.com/demo/react.html) with [src](https://github.com/gridstack/gridstack.js/tree/master/demo/react.html), or [react-gridstack-example](https://github.com/Inder2108/react-gridstack-example/tree/master/src/App.js), or read on what [hooks to use](https://github.com/gridstack/gridstack.js/issues/735#issuecomment-329888796)
|
|
160
|
+
- **React**: work in progress to have wrapper code: see <a href="https://github.com/gridstack/gridstack.js/tree/master/react" target="_blank">React Component</a>. But also see [demo](https://gridstackjs.com/demo/react.html) with [src](https://github.com/gridstack/gridstack.js/tree/master/demo/react.html), or [react-gridstack-example](https://github.com/Inder2108/react-gridstack-example/tree/master/src/App.js), or read on what [hooks to use](https://github.com/gridstack/gridstack.js/issues/735#issuecomment-329888796)
|
|
159
161
|
- **Vue**: see [demo](https://gridstackjs.com/demo/vue3js.html) with [v3 src](https://github.com/gridstack/gridstack.js/tree/master/demo/vue3js.html) or [v2 src](https://github.com/gridstack/gridstack.js/tree/master/demo/vue2js.html)
|
|
160
162
|
- **Aurelia**: [aurelia-gridstack](https://github.com/aurelia-ui-toolkits/aurelia-gridstack), see [demo](https://aurelia-ui-toolkits.github.io/aurelia-gridstack/)
|
|
161
163
|
|
|
@@ -460,6 +462,35 @@ breaking change:
|
|
|
460
462
|
* 1 column mode switch is no longer by default (`columnOpts` is not defined) as too many new users had issues. Instead set it explicitly (see above).
|
|
461
463
|
* `oneColumnModeDomSort` has been removed. Planning to support per column layouts at some future times. TBD
|
|
462
464
|
|
|
465
|
+
## Migrating to v11
|
|
466
|
+
|
|
467
|
+
* All instances of `el.innerHTML = 'some content'` have been removed for security reason as it opens up some potential for accidental XSS.
|
|
468
|
+
|
|
469
|
+
* Side panel drag&drop complete rewrite.
|
|
470
|
+
|
|
471
|
+
* new lazy loading option
|
|
472
|
+
|
|
473
|
+
**Breaking change:**
|
|
474
|
+
|
|
475
|
+
* if you code relies on `GridStackWidget.content` with real HTML (like a few demos) it is up to you to do this:
|
|
476
|
+
```ts
|
|
477
|
+
// NOTE: REAL apps would sanitize-html or DOMPurify before blinding setting innerHTML. see #2736
|
|
478
|
+
GridStack.renderCB = function(el, w) {
|
|
479
|
+
el.innerHTML = w.content;
|
|
480
|
+
};
|
|
481
|
+
```
|
|
482
|
+
* V11 add new `GridStack.renderCB` that is called for you to create the widget content (entire GridStackWidget is passed so you can use id or some other field as logic) while GS creates the 2 needed parent divs + classes, unlike `GridStack.addRemoveCB` which doesn't create anything for you. Both can be handy for Angular/React/Vue frameworks.
|
|
483
|
+
* `addWidget(w: GridStackWidget)` is now the only supported format, no more string content passing. You will need to create content yourself (`Util.createWidgetDivs()` can be used to create parent divs) then call `makeWidget(el)` instead.
|
|
484
|
+
|
|
485
|
+
**Potential breaking change:**
|
|
486
|
+
|
|
487
|
+
* BIG overall to how sidepanel helper drag&drop is done:
|
|
488
|
+
1. `clone()` helper is now passed full HTML element dragged, not an event on `grid-stack-item-content` so can clone or set attr at the top.
|
|
489
|
+
2. use any class/structure you want for side panel items (see two.html)
|
|
490
|
+
3. `GridStack.setupDragIn()` now support associating a `GridStackWidget` for each sidepanel that will be used to define what to create on drop!
|
|
491
|
+
4. if no `GridStackWidget` is defined, the helper will now be inserted as is, and NOT original sidepanel item.
|
|
492
|
+
5. support DOM gs- attr as well as gridstacknode JSON (see two.html) alternatives.
|
|
493
|
+
|
|
463
494
|
# jQuery Application
|
|
464
495
|
|
|
465
496
|
This is **old and no longer apply to v6+**. You'll need to use v5.1.1 and before
|
|
@@ -503,6 +534,9 @@ As for events, you can still use `$(".grid-stack").on(...)` for the version that
|
|
|
503
534
|
|
|
504
535
|
View our change log [here](https://github.com/gridstack/gridstack.js/tree/master/doc/CHANGES.md).
|
|
505
536
|
|
|
537
|
+
# Usage Trend
|
|
538
|
+
|
|
539
|
+
<img src="https://npm-compare.com/img/npm-trend/THREE_YEARS/gridstack.png" width="70%" alt="NPM Usage Trend of gridstack" />
|
|
506
540
|
|
|
507
541
|
# The Team
|
|
508
542
|
|
package/dist/angular/README.md
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
# Angular wrapper
|
|
2
2
|
|
|
3
|
-
The Angular [wrapper component](projects/lib/src/lib/gridstack.component.ts) <gridstack> is a better way to use Gridstack
|
|
3
|
+
The Angular [wrapper component](projects/lib/src/lib/gridstack.component.ts) <gridstack> is a <b>better way to use Gridstack</b>, but alternative raw [ngFor](projects/demo/src/app/ngFor.ts) or [simple](projects/demo/src/app/simple.ts) demos are also given.
|
|
4
4
|
|
|
5
5
|
# Dynamic grid items
|
|
6
|
+
|
|
6
7
|
this is the recommended way if you are going to have multiple grids (alow drag&drop between) or drag from toolbar to create items, or drag to remove items, etc...
|
|
7
8
|
|
|
8
9
|
I.E. don't use Angular templating to create grid items as that is harder to sync when gridstack will also add/remove items.
|
|
9
10
|
|
|
10
|
-
HTML
|
|
11
|
+
HTML
|
|
12
|
+
|
|
11
13
|
```html
|
|
12
|
-
<gridstack [options]="gridOptions">
|
|
13
|
-
</gridstack>
|
|
14
|
+
<gridstack [options]="gridOptions"></gridstack>
|
|
14
15
|
```
|
|
15
16
|
|
|
16
17
|
CSS
|
|
18
|
+
|
|
17
19
|
```css
|
|
18
20
|
@import "gridstack/dist/gridstack.min.css";
|
|
21
|
+
@import "gridstack/dist/gridstack-extra.min.css"; // if you use 2-11 column
|
|
19
22
|
|
|
20
23
|
.grid-stack {
|
|
21
|
-
background: #
|
|
24
|
+
background: #fafad2;
|
|
22
25
|
}
|
|
23
26
|
.grid-stack-item-content {
|
|
24
27
|
text-align: center;
|
|
@@ -27,6 +30,7 @@ CSS
|
|
|
27
30
|
```
|
|
28
31
|
|
|
29
32
|
in your module Code
|
|
33
|
+
|
|
30
34
|
```ts
|
|
31
35
|
import { GridstackModule } from 'gridstack/dist/angular';
|
|
32
36
|
|
|
@@ -39,6 +43,7 @@ export class AppModule { }
|
|
|
39
43
|
```
|
|
40
44
|
|
|
41
45
|
Component Code
|
|
46
|
+
|
|
42
47
|
```ts
|
|
43
48
|
import { GridStackOptions } from 'gridstack';
|
|
44
49
|
|
|
@@ -54,9 +59,11 @@ public gridOptions: GridStackOptions = {
|
|
|
54
59
|
```
|
|
55
60
|
|
|
56
61
|
# More Complete example
|
|
62
|
+
|
|
57
63
|
In this example (build on previous one) will use your actual custom angular components inside each grid item (instead of dummy html content) and have per component saved settings as well (using BaseWidget).
|
|
58
64
|
|
|
59
|
-
HTML
|
|
65
|
+
HTML
|
|
66
|
+
|
|
60
67
|
```html
|
|
61
68
|
<gridstack [options]="gridOptions" (changeCB)="onChange($event)">
|
|
62
69
|
<div empty-content>message when grid is empty</div>
|
|
@@ -64,6 +71,7 @@ HTML
|
|
|
64
71
|
```
|
|
65
72
|
|
|
66
73
|
Code
|
|
74
|
+
|
|
67
75
|
```ts
|
|
68
76
|
import { Component } from '@angular/core';
|
|
69
77
|
import { GridStack, GridStackOptions } from 'gridstack';
|
|
@@ -101,8 +109,9 @@ public gridOptions: NgGridStackOptions = {
|
|
|
101
109
|
minRow: 1, // make space for empty message
|
|
102
110
|
children: [ // or call load()/addWidget() with same data
|
|
103
111
|
{x:0, y:0, minW:2, selector:'app-a'},
|
|
104
|
-
{x:1, y:0, selector:'app-
|
|
105
|
-
{x:
|
|
112
|
+
{x:1, y:0, minW:2, selector:'app-a', input: { text: 'bar' }}, // custom input that works using BaseWidget.deserialize() Object.assign(this, w.input)
|
|
113
|
+
{x:2, y:0, selector:'app-b'},
|
|
114
|
+
{x:3, y:0, content:'plain html'},
|
|
106
115
|
]
|
|
107
116
|
}
|
|
108
117
|
|
|
@@ -113,18 +122,19 @@ public onChange(data: nodesCB) {
|
|
|
113
122
|
```
|
|
114
123
|
|
|
115
124
|
# ngFor with wrapper
|
|
125
|
+
|
|
116
126
|
For simple case where you control the children creation (gridstack doesn't do create or re-parenting)
|
|
117
127
|
|
|
118
|
-
HTML
|
|
128
|
+
HTML
|
|
129
|
+
|
|
119
130
|
```html
|
|
120
131
|
<gridstack [options]="gridOptions" (changeCB)="onChange($event)">
|
|
121
|
-
<gridstack-item *ngFor="let n of items; trackBy: identify" [options]="n">
|
|
122
|
-
Item {{n.id}}
|
|
123
|
-
</gridstack-item>
|
|
132
|
+
<gridstack-item *ngFor="let n of items; trackBy: identify" [options]="n"> Item {{n.id}} </gridstack-item>
|
|
124
133
|
</gridstack>
|
|
125
134
|
```
|
|
126
135
|
|
|
127
136
|
Code
|
|
137
|
+
|
|
128
138
|
```javascript
|
|
129
139
|
import { GridStackOptions, GridStackWidget } from 'gridstack';
|
|
130
140
|
import { nodesCB } from 'gridstack/dist/angular';
|
|
@@ -149,22 +159,34 @@ public identify(index: number, w: GridStackWidget) {
|
|
|
149
159
|
```
|
|
150
160
|
|
|
151
161
|
## Demo
|
|
162
|
+
|
|
152
163
|
You can see a fuller example at [app.component.ts](projects/demo/src/app/app.component.ts)
|
|
153
164
|
|
|
154
|
-
to build the demo, go to [angular/projects/demo](projects/demo/) and run `yarn` + `yarn start` and navigate to `http://localhost:4200/`
|
|
165
|
+
to build the demo, go to [angular/projects/demo](projects/demo/) and run `yarn` + `yarn upgrade` (ng18 seem to have introduced some conflicts) + `yarn start` and navigate to `http://localhost:4200/`
|
|
166
|
+
|
|
167
|
+
Code started shipping with v8.1.2+ in `dist/angular` for people to use directly and is an angular module! (source code under `dist/angular/src`)
|
|
168
|
+
|
|
169
|
+
## Caveats
|
|
170
|
+
|
|
171
|
+
- This wrapper needs:
|
|
172
|
+
- gridstack v8 to run as it needs the latest changes (use older version that matches GS versions)
|
|
173
|
+
- Angular 14+ for dynamic `createComponent()` API
|
|
174
|
+
|
|
175
|
+
NOTE: if you are on Angular 13 or below: copy the wrapper code over (or patch it - see main page example) and change `createComponent()` calls to use old API instead:
|
|
176
|
+
```ts
|
|
177
|
+
protected resolver: ComponentFactoryResolver,
|
|
178
|
+
...
|
|
179
|
+
const factory = this.resolver.resolveComponentFactory(GridItemComponent);
|
|
180
|
+
const gridItemRef = grid.container.createComponent(factory) as ComponentRef<GridItemComponent>;
|
|
181
|
+
// ...do the same for widget selector...
|
|
182
|
+
```
|
|
155
183
|
|
|
156
|
-
|
|
157
|
-
## Caveats
|
|
184
|
+
## ngFor Caveats
|
|
158
185
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
186
|
+
- This wrapper handles well ngFor loops, but if you're using a trackBy function (as I would recommend) and no element id change after an update,
|
|
187
|
+
you must manually update the `GridstackItemComponent.option` directly - see [modifyNgFor()](./projects/demo/src/app/app.component.ts#L202) example.
|
|
188
|
+
- The original client list of items is not updated to match **content** changes made by gridstack (TBD later), but adding new item or removing (as shown in demo) will update those new items. Client could use change/added/removed events to sync that list if they wish to do so.
|
|
162
189
|
|
|
163
|
-
|
|
164
|
-
- This wrapper handles well ngFor loops, but if you're using a trackBy function (as I would recommend) and no element id change after an update,
|
|
165
|
-
you must manually update the `GridstackItemComponent.option` directly - see [modifyNgFor()](src/app/app.component.ts#L174) example.
|
|
166
|
-
- The original client list of items is not updated to match **content** changes made by gridstack (TBD later), but adding new item or removing (as shown in demo) will update those new items. Client could use change/added/removed events to sync that list if they wish to do so.
|
|
190
|
+
Would appreciate getting help doing the same for React and Vue (2 other popular frameworks)
|
|
167
191
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
-Alain
|
|
192
|
+
-Alain
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './index';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZHN0YWNrLWFuZ3VsYXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9hbmd1bGFyL3Byb2plY3RzL2xpYi9zcmMvZ3JpZHN0YWNrLWFuZ3VsYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0=
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of gridstack-angular
|
|
3
|
+
*/
|
|
4
|
+
export * from './lib/gridstack-item.component';
|
|
5
|
+
export * from './lib/gridstack.component';
|
|
6
|
+
export * from './lib/base-widget';
|
|
7
|
+
export * from './lib/gridstack.module';
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9hbmd1bGFyL3Byb2plY3RzL2xpYi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGdDQUFnQyxDQUFDO0FBQy9DLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLHdCQUF3QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBncmlkc3RhY2stYW5ndWxhclxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL2dyaWRzdGFjay1pdGVtLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9ncmlkc3RhY2suY29tcG9uZW50JztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2Jhc2Utd2lkZ2V0JztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2dyaWRzdGFjay5tb2R1bGUnO1xuIl19
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gridstack-item.component.ts 11.0.0
|
|
3
|
+
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Base interface that all widgets need to implement in order for GridstackItemComponent to correctly save/load/delete/..
|
|
7
|
+
*/
|
|
8
|
+
import { Injectable } from '@angular/core';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export class BaseWidget {
|
|
11
|
+
/**
|
|
12
|
+
* REDEFINE to return an object representing the data needed to re-create yourself, other than `selector` already handled.
|
|
13
|
+
* This should map directly to the @Input() fields of this objects on create, so a simple apply can be used on read
|
|
14
|
+
*/
|
|
15
|
+
serialize() { return; }
|
|
16
|
+
/**
|
|
17
|
+
* REDEFINE this if your widget needs to read from saved data and transform it to create itself - you do this for
|
|
18
|
+
* things that are not mapped directly into @Input() fields for example.
|
|
19
|
+
*/
|
|
20
|
+
deserialize(w) {
|
|
21
|
+
// save full description for meta data
|
|
22
|
+
this.widgetItem = w;
|
|
23
|
+
if (!w)
|
|
24
|
+
return;
|
|
25
|
+
if (w.input)
|
|
26
|
+
Object.assign(this, w.input);
|
|
27
|
+
}
|
|
28
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BaseWidget, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
29
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BaseWidget }); }
|
|
30
|
+
}
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BaseWidget, decorators: [{
|
|
32
|
+
type: Injectable
|
|
33
|
+
}] });
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS13aWRnZXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9hbmd1bGFyL3Byb2plY3RzL2xpYi9zcmMvbGliL2Jhc2Utd2lkZ2V0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUVIOztHQUVHO0FBRUgsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7QUFJMUMsTUFBTSxPQUFnQixVQUFVO0lBSy9COzs7T0FHRztJQUNJLFNBQVMsS0FBZ0MsT0FBTyxDQUFDLENBQUM7SUFFekQ7OztPQUdHO0lBQ0ksV0FBVyxDQUFDLENBQW9CO1FBQ3JDLHNDQUFzQztRQUN0QyxJQUFJLENBQUMsVUFBVSxHQUFHLENBQUMsQ0FBQztRQUNwQixJQUFJLENBQUMsQ0FBQztZQUFFLE9BQU87UUFFZixJQUFJLENBQUMsQ0FBQyxLQUFLO1lBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDO0lBQzdDLENBQUM7OEdBckJvQixVQUFVO2tIQUFWLFVBQVU7OzJGQUFWLFVBQVU7a0JBRC9CLFVBQVUiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcclxuICogZ3JpZHN0YWNrLWl0ZW0uY29tcG9uZW50LnRzIDExLjAuMFxyXG4gKiBDb3B5cmlnaHQgKGMpIDIwMjItMjAyNCBBbGFpbiBEdW1lc255IC0gc2VlIEdyaWRTdGFjayByb290IGxpY2Vuc2VcclxuICovXHJcblxyXG4vKipcclxuICogQmFzZSBpbnRlcmZhY2UgdGhhdCBhbGwgd2lkZ2V0cyBuZWVkIHRvIGlt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gc2F2ZWQgZGF0YSBhbmQgdHJhbnNmb3JtIGl0IHRvIGNyZWF0ZSBpdHNlbGYgLSB5b3UgZG8gdGhpcyBmb3JcclxuICAgKiB0aGluZ3MgdGhhdCBhcmUgbm90IG1hcHBlZCBkaXJlY3RseSBpbnRvIEBJbnB1dCgpIGZpZWxkcyBmb3IgZXhhbXBsZS5cclxuICAgKi9cclxuICBwdWJsaWMgZGVzZXJpYWxpemUodzogTmdHcmlkU3RhY2tXaWRnZXQpICB7XHJcbiAgICAvLyBzYXZlIGZ1bGwgZGVzY3JpcHRpb24gZm9yIG1ldGEgZGF0YVxyXG4gICAgdGhpcy53aWRnZXRJdGVtID0gdztcclxuICAgIGlmICghdykgcmV0dXJuO1xyXG5cclxuICAgIGlmICh3LmlucHV0KSAgT2JqZWN0LmFzc2lnbih0aGlzLCB3LmlucHV0KTtcclxuICB9XHJcbiB9XHJcbiJdfQ==
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gridstack-item.component.ts 11.0.0
|
|
3
|
+
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
|
|
4
|
+
*/
|
|
5
|
+
import { Component, Input, ViewChild, ViewContainerRef } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* HTML Component Wrapper for gridstack items, in combination with GridstackComponent for parent grid
|
|
9
|
+
*/
|
|
10
|
+
export class GridstackItemComponent {
|
|
11
|
+
/** list of options for creating/updating this item */
|
|
12
|
+
set options(val) {
|
|
13
|
+
const grid = this.el.gridstackNode?.grid;
|
|
14
|
+
if (grid) {
|
|
15
|
+
// already built, do an update...
|
|
16
|
+
grid.update(this.el, val);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
// store our custom element in options so we can update it and not re-create a generic div!
|
|
20
|
+
this._options = { ...val, el: this.el };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** return the latest grid options (from GS once built, otherwise initial values) */
|
|
24
|
+
get options() {
|
|
25
|
+
return this.el.gridstackNode || this._options || { el: this.el };
|
|
26
|
+
}
|
|
27
|
+
/** return the native element that contains grid specific fields as well */
|
|
28
|
+
get el() { return this.elementRef.nativeElement; }
|
|
29
|
+
/** clears the initial options now that we've built */
|
|
30
|
+
clearOptions() {
|
|
31
|
+
delete this._options;
|
|
32
|
+
}
|
|
33
|
+
constructor(elementRef) {
|
|
34
|
+
this.elementRef = elementRef;
|
|
35
|
+
this.el._gridItemComp = this;
|
|
36
|
+
}
|
|
37
|
+
ngOnDestroy() {
|
|
38
|
+
this.clearOptions();
|
|
39
|
+
delete this.childWidget;
|
|
40
|
+
delete this.el._gridItemComp;
|
|
41
|
+
delete this.container;
|
|
42
|
+
delete this.ref;
|
|
43
|
+
}
|
|
44
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: GridstackItemComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
45
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: GridstackItemComponent, selector: "gridstack-item", inputs: { options: "options" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: `
|
|
46
|
+
<div class="grid-stack-item-content">
|
|
47
|
+
<!-- where dynamic items go based on component types, or sub-grids, etc...) -->
|
|
48
|
+
<ng-template #container></ng-template>
|
|
49
|
+
<!-- any static (defined in dom) content goes here -->
|
|
50
|
+
<ng-content></ng-content>
|
|
51
|
+
<!-- fallback HTML content from GridStackWidget content field if used instead -->
|
|
52
|
+
{{options.content}}
|
|
53
|
+
</div>`, isInline: true, styles: [":host{display:block}\n"] }); }
|
|
54
|
+
}
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: GridstackItemComponent, decorators: [{
|
|
56
|
+
type: Component,
|
|
57
|
+
args: [{ selector: 'gridstack-item', template: `
|
|
58
|
+
<div class="grid-stack-item-content">
|
|
59
|
+
<!-- where dynamic items go based on component types, or sub-grids, etc...) -->
|
|
60
|
+
<ng-template #container></ng-template>
|
|
61
|
+
<!-- any static (defined in dom) content goes here -->
|
|
62
|
+
<ng-content></ng-content>
|
|
63
|
+
<!-- fallback HTML content from GridStackWidget content field if used instead -->
|
|
64
|
+
{{options.content}}
|
|
65
|
+
</div>`, styles: [":host{display:block}\n"] }]
|
|
66
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { container: [{
|
|
67
|
+
type: ViewChild,
|
|
68
|
+
args: ['container', { read: ViewContainerRef, static: true }]
|
|
69
|
+
}], options: [{
|
|
70
|
+
type: Input
|
|
71
|
+
}] } });
|
|
72
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZHN0YWNrLWl0ZW0uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vYW5ndWxhci9wcm9qZWN0cy9saWIvc3JjL2xpYi9ncmlkc3RhY2staXRlbS5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7OztHQUdHO0FBRUgsT0FBTyxFQUFFLFNBQVMsRUFBYyxLQUFLLEVBQUUsU0FBUyxFQUFFLGdCQUFnQixFQUEyQixNQUFNLGVBQWUsQ0FBQzs7QUFTbkg7O0dBRUc7QUFpQkgsTUFBTSxPQUFPLHNCQUFzQjtJQVdqQyxzREFBc0Q7SUFDdEQsSUFBb0IsT0FBTyxDQUFDLEdBQWtCO1FBQzVDLE1BQU0sSUFBSSxHQUFHLElBQUksQ0FBQyxFQUFFLENBQUMsYUFBYSxFQUFFLElBQUksQ0FBQztRQUN6QyxJQUFJLElBQUksRUFBRSxDQUFDO1lBQ1QsaUNBQWlDO1lBQ2pDLElBQUksQ0FBQyxN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