UNPKG

ngx-dynamic-dashboard

Version:
82 lines (81 loc) 3.16 kB
import { EventEmitter } from '@angular/core'; import { GadgetInstanceService } from './grid.service'; import { ConfigurationService } from '../services/configuration.service'; import { AddGadgetService } from '../add-gadget/service'; import { ToastService } from '../toast/toast.service'; import { MenuEventService } from '../menu/menu-service'; import { Board } from './Board'; export declare class GridComponent { private _gadgetInstanceService; private _configurationService; private _gadgetLibraryService; private _toastService; private _menuEventService; boardUpdateEvent: EventEmitter<any>; model: Board; noGadgets: boolean; dashedStyle: {}; dropZone1: any; dropZone2: any; dropZone3: any; gadgetLibrary: any[]; private boards; /** todo * Temporary objects for experimenting with AI * @type */ gridInsertionPosition: { x: number; y: number; }; /** * Todo - split model and board operations. This class should really focus on an individual board model's operations * within the grid. The board specific operations should be moved to the board component. * @param _gadgetInstanceService * @param _procmonConfigurationService */ constructor(_gadgetInstanceService: GadgetInstanceService, _configurationService: ConfigurationService, _gadgetLibraryService: AddGadgetService, _toastService: ToastService, _menuEventService: MenuEventService); /** * todo - This is a temporary attempt to avoid emitting events from stale listeners. * Most severe symptom is when you drill down and then change the layout. * Multiple events are triggered per action due to the services not * getting destroyed when coming into the main board from a child route. The end result is multiple gadget instances * appearing. The following code improves the condition but there still are issues with multiple gadgets appearing * when changing the layout. * */ removeOldListeners(): void; setupEventListeners(): void; /** * * This is experimental code that deals with AI */ getGadgetLibrary(): void; getGadgetFromLibrary(gadgetType: string): any; addGadgetUsingArtificialIntelligence(aiObject: any): void; /** * This is the end of the experimental AI code. */ updateGadgetPositionInBoard($event: any, columnNumber: any, rowNumber: any, type: any): void; createBoard(name: string): void; editBoard(name: string): void; deleteBoard(name: string): void; addGadget(gadget: any): void; updateBoardLayout(structure: any): void; enableConfigMode(): void; setModel(model: Board): void; getModel(): Board; onDrop(data: any): void; private updateGridState; private readColumnsFromOriginalModel; private fillGridStructure; private copyGadgets; private initializeBoard; private loadBoard; private loadDefaultBoard; private loadNewBoard; private updateServicesAndGridWithModel; private saveBoard; private clearGridModelAndGadgetInstanceStructures; private setGadgetInsertPosition; }