44 */
55
66import {
7- AfterContentInit , Component , ContentChildren , ElementRef , EventEmitter , Input ,
8- OnDestroy , OnInit , Output , QueryList , Type , ViewChild , ViewContainerRef , reflectComponentType , ComponentRef
7+ AfterContentInit , Component , ContentChildren , ElementRef , EventEmitter , Input ,
8+ OnDestroy , OnInit , Output , QueryList , Type , ViewChild , ViewContainerRef , reflectComponentType , ComponentRef
99} from '@angular/core' ;
1010import { NgIf } from '@angular/common' ;
1111import { Subscription } from 'rxjs' ;
@@ -45,19 +45,19 @@ export interface GridCompHTMLElement extends GridHTMLElement {
4545 * Mapping of selector strings to Angular component types.
4646 * Used for dynamic component creation based on widget selectors.
4747 */
48- export type SelectorToType = { [ key : string ] : Type < Object > } ;
48+ export type SelectorToType = { [ key : string ] : Type < object > } ;
4949
5050/**
5151 * Angular component wrapper for GridStack.
52- *
52+ *
5353 * This component provides Angular integration for GridStack grids, handling:
5454 * - Grid initialization and lifecycle
5555 * - Dynamic component creation and management
5656 * - Event binding and emission
5757 * - Integration with Angular change detection
58- *
58+ *
5959 * Use in combination with GridstackItemComponent for individual grid items.
60- *
60+ *
6161 * @example
6262 * ```html
6363 * <gridstack [options]="gridOptions" (change)="onGridChange($event)">
@@ -99,7 +99,7 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
9999 /**
100100 * Grid configuration options.
101101 * Can be set before grid initialization or updated after grid is created.
102- *
102+ *
103103 * @example
104104 * ```typescript
105105 * gridOptions: GridStackOptions = {
@@ -122,7 +122,7 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
122122 /**
123123 * Controls whether empty content should be displayed.
124124 * Set to true to show ng-content with 'empty-content' selector when grid has no items.
125- *
125+ *
126126 * @example
127127 * ```html
128128 * <gridstack [isEmpty]="gridItems.length === 0">
@@ -134,52 +134,52 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
134134
135135 /**
136136 * GridStack event emitters for Angular integration.
137- *
137+ *
138138 * These provide Angular-style event handling for GridStack events.
139139 * Alternatively, use `this.grid.on('event1 event2', callback)` for multiple events.
140- *
140+ *
141141 * Note: 'CB' suffix prevents conflicts with native DOM events.
142- *
142+ *
143143 * @example
144144 * ```html
145145 * <gridstack (changeCB)="onGridChange($event)" (droppedCB)="onItemDropped($event)">
146146 * </gridstack>
147147 * ```
148148 */
149-
149+
150150 /** Emitted when widgets are added to the grid */
151151 @Output ( ) public addedCB = new EventEmitter < nodesCB > ( ) ;
152-
152+
153153 /** Emitted when grid layout changes */
154154 @Output ( ) public changeCB = new EventEmitter < nodesCB > ( ) ;
155-
155+
156156 /** Emitted when grid is disabled */
157157 @Output ( ) public disableCB = new EventEmitter < eventCB > ( ) ;
158-
158+
159159 /** Emitted during widget drag operations */
160160 @Output ( ) public dragCB = new EventEmitter < elementCB > ( ) ;
161-
161+
162162 /** Emitted when widget drag starts */
163163 @Output ( ) public dragStartCB = new EventEmitter < elementCB > ( ) ;
164-
164+
165165 /** Emitted when widget drag stops */
166166 @Output ( ) public dragStopCB = new EventEmitter < elementCB > ( ) ;
167-
167+
168168 /** Emitted when widget is dropped */
169169 @Output ( ) public droppedCB = new EventEmitter < droppedCB > ( ) ;
170-
170+
171171 /** Emitted when grid is enabled */
172172 @Output ( ) public enableCB = new EventEmitter < eventCB > ( ) ;
173-
173+
174174 /** Emitted when widgets are removed from the grid */
175175 @Output ( ) public removedCB = new EventEmitter < nodesCB > ( ) ;
176-
176+
177177 /** Emitted during widget resize operations */
178178 @Output ( ) public resizeCB = new EventEmitter < elementCB > ( ) ;
179-
179+
180180 /** Emitted when widget resize starts */
181181 @Output ( ) public resizeStartCB = new EventEmitter < elementCB > ( ) ;
182-
182+
183183 /** Emitted when widget resize stops */
184184 @Output ( ) public resizeStopCB = new EventEmitter < elementCB > ( ) ;
185185
@@ -192,7 +192,7 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
192192 /**
193193 * Get the underlying GridStack instance.
194194 * Use this to access GridStack API methods directly.
195- *
195+ *
196196 * @example
197197 * ```typescript
198198 * this.gridComponent.grid.addWidget({x: 0, y: 0, w: 2, h: 1});
@@ -208,10 +208,10 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
208208
209209 /**
210210 * Mapping of component selectors to their types for dynamic creation.
211- *
211+ *
212212 * This enables dynamic component instantiation from string selectors.
213213 * Angular doesn't provide public access to this mapping, so we maintain our own.
214- *
214+ *
215215 * @example
216216 * ```typescript
217217 * GridstackComponent.addComponentToSelectorType([MyWidgetComponent]);
@@ -220,9 +220,9 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
220220 public static selectorToType : SelectorToType = { } ;
221221 /**
222222 * Register a list of Angular components for dynamic creation.
223- *
223+ *
224224 * @param typeList Array of component types to register
225- *
225+ *
226226 * @example
227227 * ```typescript
228228 * GridstackComponent.addComponentToSelectorType([
@@ -231,16 +231,17 @@ export class GridstackComponent implements OnInit, AfterContentInit, OnDestroy {
231231 * ]);
232232 * ```
233233 */
234- public static addComponentToSelectorType ( typeList : Array < Type < Object > > ) {
234+ public static addComponentToSelectorType ( typeList : Array < Type < object > > ) {
235235 typeList . forEach ( type => GridstackComponent . selectorToType [ GridstackComponent . getSelector ( type ) ] = type ) ;
236236 }
237237 /**
238238 * Extract the selector string from an Angular component type.
239- *
239+ *
240240 * @param type The component type to get selector from
241241 * @returns The component's selector string
242242 */
243- public static getSelector ( type : Type < Object > ) : string {
243+ public static getSelector ( type : Type < object > ) : string {
244+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
244245 return reflectComponentType ( type ) ! . selector ;
245246 }
246247
@@ -367,6 +368,7 @@ export function gsCreateNgComponents(host: GridCompHTMLElement | HTMLElement, n:
367368 const gridItemComp = ( host . parentElement as GridItemCompHTMLElement ) ?. _gridItemComp ;
368369 if ( ! gridItemComp ) return ;
369370 // check if gridItem has a child component with 'container' exposed to create under..
371+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
370372 const container = ( gridItemComp . childWidget as any ) ?. container || gridItemComp . container ;
371373 const gridRef = container ?. createComponent ( GridstackComponent ) ;
372374 const grid = gridRef ?. instance ;
0 commit comments