@memberjunction/ng-shared
Version:
MemberJunction: MJ Explorer Angular Shared Package - utility functions and other reusable elements used across other MJ Angular packages within the MJ Explorer App - do not use outside of MJ Explorer.
67 lines • 3.04 kB
TypeScript
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
import { CompositeKey } from '@memberjunction/core';
import { DashboardEntityExtended, ResourceData } from '@memberjunction/core-entities';
import { BaseResourceComponent } from './base-resource-component';
import * as i0 from "@angular/core";
export interface DashboardConfig {
dashboard: DashboardEntityExtended;
userState?: any;
}
/**
* Make the base class a directive so we can use Angular functionality and sub-classes can be @Component
*/
export declare abstract class BaseDashboard extends BaseResourceComponent implements OnInit, OnDestroy {
/**
* Set or change the dashboard configuration. Changing this property will NOT cause the dashboard to reload. Call Refresh() to do that.
*/
set Config(value: DashboardConfig);
get Config(): DashboardConfig | null;
/**
* Subclasses can emit anytime an error occurs.
*/
Error: EventEmitter<Error>;
/**
* Subclasses should emit this event anytime their internal state changes in a way that they'd like to persist.
*/
UserStateChanged: EventEmitter<any>;
/**
* Subclasses can emit this event anytime they want to communicate with the container to let it know that something has happened of significance.
*/
Interaction: EventEmitter<any>;
/**
* Subclasses can emit this event anytime they want to open a record within a particular entity. The container should handle this event and open the record.
*/
OpenEntityRecord: EventEmitter<{
EntityName: string;
RecordPKey: CompositeKey;
}>;
protected _config: DashboardConfig | null;
ngOnInit(): Promise<void>;
ngOnDestroy(): void;
/**
* This method will result in the dashboard being reloaded.
*/
Refresh(): void;
private _visible;
/**
* This method can be used by a container to let the dashboard know that it is being opened/closed. Base class just sets a flag.
*/
SetVisible(visible: boolean): void;
/**
* Subclasses can override this method to perform any initialization they need. This method only runs once when the dashboard is created.
*/
protected abstract initDashboard(): void;
/**
* Subclasses should override this method to load their data. This method is called when the dashboard is created and when Refresh() is called.
*/
protected abstract loadData(): void;
/**
* Sub-classes can override this to provide a custom icon class
* @param data
* @returns
*/
GetResourceIconClass(data: ResourceData): Promise<string>;
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDashboard, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseDashboard, never, never, { "Config": { "alias": "Config"; "required": false; }; }, { "Error": "Error"; "UserStateChanged": "UserStateChanged"; "Interaction": "Interaction"; "OpenEntityRecord": "OpenEntityRecord"; }, never, never, true, never>;
}
//# sourceMappingURL=base-dashboard.d.ts.map