gridstack 12.3.3 → 12.4.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/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 +4 -2
- package/dist/angular/esm2020/lib/gridstack.module.mjs +2 -2
- package/dist/angular/esm2020/lib/types.mjs +2 -2
- package/dist/angular/fesm2015/gridstack-angular.mjs +6 -4
- package/dist/angular/fesm2015/gridstack-angular.mjs.map +1 -1
- package/dist/angular/fesm2020/gridstack-angular.mjs +7 -5
- package/dist/angular/fesm2020/gridstack-angular.mjs.map +1 -1
- package/dist/angular/lib/gridstack-item.component.d.ts +1 -1
- package/dist/angular/lib/gridstack.component.d.ts +4 -4
- package/dist/angular/lib/types.d.ts +1 -1
- package/dist/angular/package.json +1 -1
- package/dist/angular/projects/lib/src/index.d.ts +5 -0
- package/dist/angular/projects/lib/src/index.js +9 -0
- package/dist/angular/projects/lib/src/index.js.map +1 -0
- package/dist/angular/projects/lib/src/lib/base-widget.d.ts +56 -0
- package/dist/angular/projects/lib/src/lib/base-widget.js +94 -0
- package/dist/angular/projects/lib/src/lib/base-widget.js.map +1 -0
- package/dist/angular/projects/lib/src/lib/gridstack-item.component.d.ts +76 -0
- package/dist/angular/projects/lib/src/lib/gridstack-item.component.js +112 -0
- package/dist/angular/projects/lib/src/lib/gridstack-item.component.js.map +1 -0
- package/dist/angular/projects/lib/src/lib/gridstack.component.d.ts +233 -0
- package/dist/angular/projects/lib/src/lib/gridstack.component.js +457 -0
- package/dist/angular/projects/lib/src/lib/gridstack.component.js.map +1 -0
- package/dist/angular/projects/lib/src/lib/gridstack.module.d.ts +29 -0
- package/dist/angular/projects/lib/src/lib/gridstack.module.js +52 -0
- package/dist/angular/projects/lib/src/lib/gridstack.module.js.map +1 -0
- package/dist/angular/projects/lib/src/lib/types.d.ts +51 -0
- package/dist/angular/projects/lib/src/lib/types.js +6 -0
- package/dist/angular/projects/lib/src/lib/types.js.map +1 -0
- package/dist/angular/src/base-widget.ts +13 -13
- package/dist/angular/src/gridstack-item.component.ts +5 -5
- package/dist/angular/src/gridstack.component.ts +34 -32
- package/dist/angular/src/gridstack.module.ts +4 -4
- package/dist/angular/src/types.ts +3 -2
- 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.css +1 -1
- package/dist/src/dd-base-impl.d.ts +1 -1
- package/dist/src/dd-base-impl.js +1 -1
- package/dist/src/dd-base-impl.js.map +1 -1
- package/dist/src/dd-draggable.d.ts +1 -1
- package/dist/src/dd-draggable.js +1 -1
- package/dist/src/dd-draggable.js.map +1 -1
- package/dist/src/dd-droppable.d.ts +1 -1
- package/dist/src/dd-droppable.js +7 -1
- package/dist/src/dd-droppable.js.map +1 -1
- package/dist/src/dd-element.d.ts +1 -1
- package/dist/src/dd-element.js +1 -1
- package/dist/src/dd-element.js.map +1 -1
- package/dist/src/dd-gridstack.d.ts +1 -1
- package/dist/src/dd-gridstack.js +1 -1
- package/dist/src/dd-gridstack.js.map +1 -1
- package/dist/src/dd-manager.d.ts +1 -1
- package/dist/src/dd-manager.js +1 -1
- package/dist/src/dd-manager.js.map +1 -1
- package/dist/src/dd-resizable-handle.d.ts +5 -4
- package/dist/src/dd-resizable-handle.js +23 -8
- package/dist/src/dd-resizable-handle.js.map +1 -1
- package/dist/src/dd-resizable.d.ts +3 -5
- package/dist/src/dd-resizable.js +5 -10
- package/dist/src/dd-resizable.js.map +1 -1
- package/dist/src/dd-touch.d.ts +1 -1
- package/dist/src/dd-touch.js +1 -1
- package/dist/src/dd-touch.js.map +1 -1
- package/dist/src/gridstack-engine.d.ts +1 -1
- package/dist/src/gridstack-engine.js +7 -1
- package/dist/src/gridstack-engine.js.map +1 -1
- package/dist/src/gridstack.d.ts +1 -2
- package/dist/src/gridstack.js +9 -18
- package/dist/src/gridstack.js.map +1 -1
- package/dist/src/gridstack.scss +1 -1
- package/dist/src/types.d.ts +11 -6
- package/dist/src/types.js +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils.d.ts +1 -270
- package/dist/src/utils.js +37 -31
- package/dist/src/utils.js.map +1 -1
- package/doc/API.md +166 -165
- package/package.json +5 -5
- package/dist/dd-base-impl.d.ts +0 -69
- package/dist/dd-base-impl.js +0 -70
- package/dist/dd-base-impl.js.map +0 -1
- package/dist/dd-draggable.d.ts +0 -20
- package/dist/dd-draggable.js +0 -364
- package/dist/dd-draggable.js.map +0 -1
- package/dist/dd-droppable.d.ts +0 -26
- package/dist/dd-droppable.js +0 -149
- package/dist/dd-droppable.js.map +0 -1
- package/dist/dd-element.d.ts +0 -27
- package/dist/dd-element.js +0 -91
- package/dist/dd-element.js.map +0 -1
- package/dist/dd-gridstack.d.ts +0 -82
- package/dist/dd-gridstack.js +0 -165
- package/dist/dd-gridstack.js.map +0 -1
- package/dist/dd-manager.d.ts +0 -43
- package/dist/dd-manager.js +0 -14
- package/dist/dd-manager.js.map +0 -1
- package/dist/dd-resizable-handle.d.ts +0 -18
- package/dist/dd-resizable-handle.js +0 -113
- package/dist/dd-resizable-handle.js.map +0 -1
- package/dist/dd-resizable.d.ts +0 -30
- package/dist/dd-resizable.js +0 -304
- package/dist/dd-resizable.js.map +0 -1
- package/dist/dd-touch.d.ts +0 -33
- package/dist/dd-touch.js +0 -145
- package/dist/dd-touch.js.map +0 -1
- package/dist/gridstack-engine.d.ts +0 -321
- package/dist/gridstack-engine.js +0 -1272
- package/dist/gridstack-engine.js.map +0 -1
- package/dist/gridstack.d.ts +0 -802
- package/dist/gridstack.js +0 -2872
- package/dist/gridstack.js.map +0 -1
- package/dist/spec/gridstack-engine-spec.d.ts +0 -1
- package/dist/spec/gridstack-engine-spec.js +0 -358
- package/dist/spec/gridstack-engine-spec.js.map +0 -1
- package/dist/spec/gridstack-spec.d.ts +0 -1
- package/dist/spec/gridstack-spec.js +0 -1780
- package/dist/spec/gridstack-spec.js.map +0 -1
- package/dist/spec/integration/gridstack-integration.spec.d.ts +0 -1
- package/dist/spec/integration/gridstack-integration.spec.js +0 -171
- package/dist/spec/integration/gridstack-integration.spec.js.map +0 -1
- package/dist/spec/regression-spec.d.ts +0 -1
- package/dist/spec/regression-spec.js +0 -100
- package/dist/spec/regression-spec.js.map +0 -1
- package/dist/spec/utils-spec.d.ts +0 -1
- package/dist/spec/utils-spec.js +0 -243
- package/dist/spec/utils-spec.js.map +0 -1
- package/dist/types.d.ts +0 -427
- package/dist/types.js +0 -38
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -283
- package/dist/utils.js +0 -787
- package/dist/utils.js.map +0 -1
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.config.js +0 -74
- package/dist/vitest.config.js.map +0 -1
- package/dist/vitest.setup.d.ts +0 -1
- package/dist/vitest.setup.js +0 -90
- package/dist/vitest.setup.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../angular/projects/lib/src/lib/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\r\n * gridstack-item.component.ts 12.4.0\r\n * Copyright (c) 2025 Alain Dumesny - see GridStack root license\r\n */\r\n\r\nimport { GridStackNode, GridStackOptions, GridStackWidget } from \"gridstack\";\r\n\r\n/**\r\n * Extended GridStackWidget interface for Angular integration.\r\n * Adds Angular-specific properties for dynamic component creation.\r\n */\r\nexport interface NgGridStackWidget extends GridStackWidget {\r\n /** Angular component selector for dynamic creation (e.g., 'my-widget') */\r\n selector?: string;\r\n /** Serialized data for component @Input() properties */\r\n input?: NgCompInputs;\r\n /** Configuration for nested sub-grids */\r\n subGridOpts?: NgGridStackOptions;\r\n}\r\n\r\n/**\r\n * Extended GridStackNode interface for Angular integration.\r\n * Adds component selector for dynamic content creation.\r\n */\r\nexport interface NgGridStackNode extends GridStackNode {\r\n /** Angular component selector for this node's content */\r\n selector?: string;\r\n}\r\n\r\n/**\r\n * Extended GridStackOptions interface for Angular integration.\r\n * Supports Angular-specific widget definitions and nested grids.\r\n */\r\nexport interface NgGridStackOptions extends GridStackOptions {\r\n /** Array of Angular widget definitions for initial grid setup */\r\n children?: NgGridStackWidget[];\r\n /** Configuration for nested sub-grids (Angular-aware) */\r\n subGridOpts?: NgGridStackOptions;\r\n}\r\n\r\n/**\r\n * Type for component input data serialization.\r\n * Maps @Input() property names to their values for widget persistence.\r\n *\r\n * @example\r\n * ```typescript\r\n * const inputs: NgCompInputs = {\r\n * title: 'My Widget',\r\n * value: 42,\r\n * config: { enabled: true }\r\n * };\r\n * ```\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nexport type NgCompInputs = {[key: string]: any};\r\n"]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* gridstack-item.component.ts 12.
|
|
2
|
+
* gridstack-item.component.ts 12.4.0
|
|
3
3
|
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Abstract base class that all custom widgets should extend.
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* This class provides the interface needed for GridstackItemComponent to:
|
|
10
10
|
* - Serialize/deserialize widget data
|
|
11
11
|
* - Save/restore widget state
|
|
12
12
|
* - Integrate with Angular lifecycle
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
14
|
* Extend this class when creating custom widgets for dynamic grids.
|
|
15
|
-
*
|
|
15
|
+
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```typescript
|
|
18
18
|
* @Component({
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* })
|
|
22
22
|
* export class MyCustomWidget extends BaseWidget {
|
|
23
23
|
* @Input() data: string = '';
|
|
24
|
-
*
|
|
24
|
+
*
|
|
25
25
|
* serialize() {
|
|
26
26
|
* return { data: this.data };
|
|
27
27
|
* }
|
|
@@ -46,12 +46,12 @@ export abstract class BaseWidget {
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Override this method to return serializable data for this widget.
|
|
49
|
-
*
|
|
49
|
+
*
|
|
50
50
|
* Return an object with properties that map to your component's @Input() fields.
|
|
51
51
|
* The selector is handled automatically, so only include component-specific data.
|
|
52
|
-
*
|
|
52
|
+
*
|
|
53
53
|
* @returns Object containing serializable component data
|
|
54
|
-
*
|
|
54
|
+
*
|
|
55
55
|
* @example
|
|
56
56
|
* ```typescript
|
|
57
57
|
* serialize() {
|
|
@@ -67,17 +67,17 @@ export abstract class BaseWidget {
|
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Override this method to handle widget restoration from saved data.
|
|
70
|
-
*
|
|
70
|
+
*
|
|
71
71
|
* Use this for complex initialization that goes beyond simple @Input() mapping.
|
|
72
72
|
* The default implementation automatically assigns input data to component properties.
|
|
73
|
-
*
|
|
73
|
+
*
|
|
74
74
|
* @param w The saved widget data including input properties
|
|
75
|
-
*
|
|
75
|
+
*
|
|
76
76
|
* @example
|
|
77
77
|
* ```typescript
|
|
78
78
|
* deserialize(w: NgGridStackWidget) {
|
|
79
79
|
* super.deserialize(w); // Call parent for basic setup
|
|
80
|
-
*
|
|
80
|
+
*
|
|
81
81
|
* // Custom initialization logic
|
|
82
82
|
* if (w.input?.complexData) {
|
|
83
83
|
* this.processComplexData(w.input.complexData);
|
|
@@ -92,4 +92,4 @@ export abstract class BaseWidget {
|
|
|
92
92
|
|
|
93
93
|
if (w.input) Object.assign(this, w.input);
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* gridstack-item.component.ts 12.
|
|
2
|
+
* gridstack-item.component.ts 12.4.0
|
|
3
3
|
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -18,15 +18,15 @@ export interface GridItemCompHTMLElement extends GridItemHTMLElement {
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Angular component wrapper for individual GridStack items.
|
|
21
|
-
*
|
|
21
|
+
*
|
|
22
22
|
* This component represents a single grid item and handles:
|
|
23
23
|
* - Dynamic content creation and management
|
|
24
24
|
* - Integration with parent GridStack component
|
|
25
25
|
* - Component lifecycle and cleanup
|
|
26
26
|
* - Widget options and configuration
|
|
27
|
-
*
|
|
27
|
+
*
|
|
28
28
|
* Use in combination with GridstackComponent for the parent grid.
|
|
29
|
-
*
|
|
29
|
+
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```html
|
|
32
32
|
* <gridstack>
|
|
@@ -76,7 +76,7 @@ export class GridstackItemComponent implements OnDestroy {
|
|
|
76
76
|
/**
|
|
77
77
|
* Grid item configuration options.
|
|
78
78
|
* Defines position, size, and behavior of this grid item.
|
|
79
|
-
*
|
|
79
|
+
*
|
|
80
80
|
* @example
|
|
81
81
|
* ```typescript
|
|
82
82
|
* itemOptions: GridStackNode = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* gridstack.component.ts 12.
|
|
2
|
+
* gridstack.component.ts 12.4.0
|
|
3
3
|
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
AfterContentInit, Component, ContentChildren, ElementRef, EventEmitter, Input,
|
|
8
|
+
OnDestroy, OnInit, Output, QueryList, Type, ViewChild, ViewContainerRef, reflectComponentType, ComponentRef
|
|
9
9
|
} from '@angular/core';
|
|
10
10
|
import { NgIf } from '@angular/common';
|
|
11
11
|
import { Subscription } from 'rxjs';
|
|
@@ -45,19 +45,19 @@ export interface GridCompHTMLElement extends GridHTMLElement {
|
|
|
45
45
|
* Mapping of selector strings to Angular component types.
|
|
46
46
|
* Used for dynamic component creation based on widget selectors.
|
|
47
47
|
*/
|
|
48
|
-
export type SelectorToType = {[key: string]: Type<
|
|
48
|
+
export type SelectorToType = {[key: string]: Type<object>};
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Angular component wrapper for GridStack.
|
|
52
|
-
*
|
|
52
|
+
*
|
|
53
53
|
* This component provides Angular integration for GridStack grids, handling:
|
|
54
54
|
* - Grid initialization and lifecycle
|
|
55
55
|
* - Dynamic component creation and management
|
|
56
56
|
* - Event binding and emission
|
|
57
57
|
* - Integration with Angular change detection
|
|
58
|
-
*
|
|
58
|
+
*
|
|
59
59
|
* Use in combination with GridstackItemComponent for individual grid items.
|
|
60
|
-
*
|
|
60
|
+
*
|
|
61
61
|
* @example
|
|
62
62
|
* ```html
|
|
63
63
|
* <gridstack [options]="gridOptions" (change)="onGridChange($event)">
|
|
@@ -99,7 +99,7 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
99
99
|
/**
|
|
100
100
|
* Grid configuration options.
|
|
101
101
|
* Can be set before grid initialization or updated after grid is created.
|
|
102
|
-
*
|
|
102
|
+
*
|
|
103
103
|
* @example
|
|
104
104
|
* ```typescript
|
|
105
105
|
* gridOptions: GridStackOptions = {
|
|
@@ -122,7 +122,7 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
122
122
|
/**
|
|
123
123
|
* Controls whether empty content should be displayed.
|
|
124
124
|
* Set to true to show ng-content with 'empty-content' selector when grid has no items.
|
|
125
|
-
*
|
|
125
|
+
*
|
|
126
126
|
* @example
|
|
127
127
|
* ```html
|
|
128
128
|
* <gridstack [isEmpty]="gridItems.length === 0">
|
|
@@ -134,52 +134,52 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
136
|
* GridStack event emitters for Angular integration.
|
|
137
|
-
*
|
|
137
|
+
*
|
|
138
138
|
* These provide Angular-style event handling for GridStack events.
|
|
139
139
|
* Alternatively, use `this.grid.on('event1 event2', callback)` for multiple events.
|
|
140
|
-
*
|
|
140
|
+
*
|
|
141
141
|
* Note: 'CB' suffix prevents conflicts with native DOM events.
|
|
142
|
-
*
|
|
142
|
+
*
|
|
143
143
|
* @example
|
|
144
144
|
* ```html
|
|
145
145
|
* <gridstack (changeCB)="onGridChange($event)" (droppedCB)="onItemDropped($event)">
|
|
146
146
|
* </gridstack>
|
|
147
147
|
* ```
|
|
148
148
|
*/
|
|
149
|
-
|
|
149
|
+
|
|
150
150
|
/** Emitted when widgets are added to the grid */
|
|
151
151
|
@Output() public addedCB = new EventEmitter<nodesCB>();
|
|
152
|
-
|
|
152
|
+
|
|
153
153
|
/** Emitted when grid layout changes */
|
|
154
154
|
@Output() public changeCB = new EventEmitter<nodesCB>();
|
|
155
|
-
|
|
155
|
+
|
|
156
156
|
/** Emitted when grid is disabled */
|
|
157
157
|
@Output() public disableCB = new EventEmitter<eventCB>();
|
|
158
|
-
|
|
158
|
+
|
|
159
159
|
/** Emitted during widget drag operations */
|
|
160
160
|
@Output() public dragCB = new EventEmitter<elementCB>();
|
|
161
|
-
|
|
161
|
+
|
|
162
162
|
/** Emitted when widget drag starts */
|
|
163
163
|
@Output() public dragStartCB = new EventEmitter<elementCB>();
|
|
164
|
-
|
|
164
|
+
|
|
165
165
|
/** Emitted when widget drag stops */
|
|
166
166
|
@Output() public dragStopCB = new EventEmitter<elementCB>();
|
|
167
|
-
|
|
167
|
+
|
|
168
168
|
/** Emitted when widget is dropped */
|
|
169
169
|
@Output() public droppedCB = new EventEmitter<droppedCB>();
|
|
170
|
-
|
|
170
|
+
|
|
171
171
|
/** Emitted when grid is enabled */
|
|
172
172
|
@Output() public enableCB = new EventEmitter<eventCB>();
|
|
173
|
-
|
|
173
|
+
|
|
174
174
|
/** Emitted when widgets are removed from the grid */
|
|
175
175
|
@Output() public removedCB = new EventEmitter<nodesCB>();
|
|
176
|
-
|
|
176
|
+
|
|
177
177
|
/** Emitted during widget resize operations */
|
|
178
178
|
@Output() public resizeCB = new EventEmitter<elementCB>();
|
|
179
|
-
|
|
179
|
+
|
|
180
180
|
/** Emitted when widget resize starts */
|
|
181
181
|
@Output() public resizeStartCB = new EventEmitter<elementCB>();
|
|
182
|
-
|
|
182
|
+
|
|
183
183
|
/** Emitted when widget resize stops */
|
|
184
184
|
@Output() public resizeStopCB = new EventEmitter<elementCB>();
|
|
185
185
|
|
|
@@ -192,7 +192,7 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
192
192
|
/**
|
|
193
193
|
* Get the underlying GridStack instance.
|
|
194
194
|
* Use this to access GridStack API methods directly.
|
|
195
|
-
*
|
|
195
|
+
*
|
|
196
196
|
* @example
|
|
197
197
|
* ```typescript
|
|
198
198
|
* this.gridComponent.grid.addWidget({x: 0, y: 0, w: 2, h: 1});
|
|
@@ -208,10 +208,10 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* Mapping of component selectors to their types for dynamic creation.
|
|
211
|
-
*
|
|
211
|
+
*
|
|
212
212
|
* This enables dynamic component instantiation from string selectors.
|
|
213
213
|
* Angular doesn't provide public access to this mapping, so we maintain our own.
|
|
214
|
-
*
|
|
214
|
+
*
|
|
215
215
|
* @example
|
|
216
216
|
* ```typescript
|
|
217
217
|
* GridstackComponent.addComponentToSelectorType([MyWidgetComponent]);
|
|
@@ -220,9 +220,9 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
220
220
|
public static selectorToType: SelectorToType = {};
|
|
221
221
|
/**
|
|
222
222
|
* Register a list of Angular components for dynamic creation.
|
|
223
|
-
*
|
|
223
|
+
*
|
|
224
224
|
* @param typeList Array of component types to register
|
|
225
|
-
*
|
|
225
|
+
*
|
|
226
226
|
* @example
|
|
227
227
|
* ```typescript
|
|
228
228
|
* GridstackComponent.addComponentToSelectorType([
|
|
@@ -231,16 +231,17 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
|
|
|
231
231
|
* ]);
|
|
232
232
|
* ```
|
|
233
233
|
*/
|
|
234
|
-
public static addComponentToSelectorType(typeList: Array<Type<
|
|
234
|
+
public static addComponentToSelectorType(typeList: Array<Type<object>>) {
|
|
235
235
|
typeList.forEach(type => GridstackComponent.selectorToType[ GridstackComponent.getSelector(type) ] = type);
|
|
236
236
|
}
|
|
237
237
|
/**
|
|
238
238
|
* Extract the selector string from an Angular component type.
|
|
239
|
-
*
|
|
239
|
+
*
|
|
240
240
|
* @param type The component type to get selector from
|
|
241
241
|
* @returns The component's selector string
|
|
242
242
|
*/
|
|
243
|
-
public static getSelector(type: Type<
|
|
243
|
+
public static getSelector(type: Type<object>): string {
|
|
244
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
244
245
|
return reflectComponentType(type)!.selector;
|
|
245
246
|
}
|
|
246
247
|
|
|
@@ -367,6 +368,7 @@ export function gsCreateNgComponents(host: GridCompHTMLElement | HTMLElement, n:
|
|
|
367
368
|
const gridItemComp = (host.parentElement as GridItemCompHTMLElement)?._gridItemComp;
|
|
368
369
|
if (!gridItemComp) return;
|
|
369
370
|
// check if gridItem has a child component with 'container' exposed to create under..
|
|
371
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
370
372
|
const container = (gridItemComp.childWidget as any)?.container || gridItemComp.container;
|
|
371
373
|
const gridRef = container?.createComponent(GridstackComponent);
|
|
372
374
|
const grid = gridRef?.instance;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* gridstack.component.ts 12.
|
|
2
|
+
* gridstack.component.ts 12.4.0
|
|
3
3
|
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -10,10 +10,10 @@ import { GridstackComponent } from "./gridstack.component";
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @deprecated Use GridstackComponent and GridstackItemComponent as standalone components instead.
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
14
|
* This NgModule is provided for backward compatibility but is no longer the recommended approach.
|
|
15
15
|
* Import components directly in your standalone components or use the new Angular module structure.
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```typescript
|
|
19
19
|
* // Preferred approach - standalone components
|
|
@@ -23,7 +23,7 @@ import { GridstackComponent } from "./gridstack.component";
|
|
|
23
23
|
* template: '<gridstack></gridstack>'
|
|
24
24
|
* })
|
|
25
25
|
* export class AppComponent {}
|
|
26
|
-
*
|
|
26
|
+
*
|
|
27
27
|
* // Legacy approach (deprecated)
|
|
28
28
|
* @NgModule({
|
|
29
29
|
* imports: [GridstackModule]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* gridstack-item.component.ts 12.
|
|
2
|
+
* gridstack-item.component.ts 12.4.0
|
|
3
3
|
* Copyright (c) 2025 Alain Dumesny - see GridStack root license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -41,7 +41,7 @@ export interface NgGridStackOptions extends GridStackOptions {
|
|
|
41
41
|
/**
|
|
42
42
|
* Type for component input data serialization.
|
|
43
43
|
* Maps @Input() property names to their values for widget persistence.
|
|
44
|
-
*
|
|
44
|
+
*
|
|
45
45
|
* @example
|
|
46
46
|
* ```typescript
|
|
47
47
|
* const inputs: NgCompInputs = {
|
|
@@ -51,4 +51,5 @@ export interface NgGridStackOptions extends GridStackOptions {
|
|
|
51
51
|
* };
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
55
|
export type NgCompInputs = {[key: string]: any};
|