Files
iTop/node_modules/gridstack/dist/angular/lib/base-widget.d.ts
Stephen Abello a713e1b56e N°8641 - Dashboard editor front-end first commit for Form SDK integration.
* No dashlet edition
* Dashboard are not persisted
* Unable to load a dashboard from an endpoint (refresh)
* Grid library need proper npm integration
2026-01-08 10:17:30 +01:00

56 lines
1.8 KiB
TypeScript

import { NgCompInputs, NgGridStackWidget } from './types';
import * as i0 from "@angular/core";
/**
* Base widget class for GridStack Angular integration.
*/
export declare abstract class BaseWidget {
/**
* Complete widget definition including position, size, and Angular-specific data.
* Populated automatically when the widget is loaded or saved.
*/
widgetItem?: NgGridStackWidget;
/**
* Override this method to return serializable data for this widget.
*
* Return an object with properties that map to your component's @Input() fields.
* The selector is handled automatically, so only include component-specific data.
*
* @returns Object containing serializable component data
*
* @example
* ```typescript
* serialize() {
* return {
* title: this.title,
* value: this.value,
* settings: this.settings
* };
* }
* ```
*/
serialize(): NgCompInputs | undefined;
/**
* Override this method to handle widget restoration from saved data.
*
* Use this for complex initialization that goes beyond simple @Input() mapping.
* The default implementation automatically assigns input data to component properties.
*
* @param w The saved widget data including input properties
*
* @example
* ```typescript
* deserialize(w: NgGridStackWidget) {
* super.deserialize(w); // Call parent for basic setup
*
* // Custom initialization logic
* if (w.input?.complexData) {
* this.processComplexData(w.input.complexData);
* }
* }
* ```
*/
deserialize(w: NgGridStackWidget): void;
static ɵfac: i0.ɵɵFactoryDeclaration<BaseWidget, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<BaseWidget>;
}