UNPKG

angular-slickgrid

Version:

Slickgrid components made available in Angular

81 lines (80 loc) 4.48 kB
import type { ApplicationRef, ComponentRef, Type, ViewContainerRef } from '@angular/core'; import type { EventSubscription, OnBeforeRowDetailToggleArgs, OnRowBackToViewportRangeArgs, RxJsFacade, SlickGrid } from '@slickgrid-universal/common'; import { SlickEventData, SlickRowSelectionModel } from '@slickgrid-universal/common'; import type { EventPubSubService } from '@slickgrid-universal/event-pub-sub'; import { SlickRowDetailView as UniversalSlickRowDetailView } from '@slickgrid-universal/row-detail-view-plugin'; import { Observable, type Subject } from 'rxjs'; import type { GridOption, RowDetailView } from '../models/index'; import type { AngularUtilService } from '../services/angularUtil.service'; export interface CreatedView { id: string | number; dataContext: any; componentRef?: ComponentRef<any>; rendered?: boolean; } export declare class SlickRowDetailView extends UniversalSlickRowDetailView { protected readonly angularUtilService: AngularUtilService; protected readonly appRef: ApplicationRef; protected readonly eventPubSubService: EventPubSubService; protected readonly gridContainerElement: HTMLDivElement; protected rxjs?: RxJsFacade | undefined; rowDetailContainer: ViewContainerRef; protected _preloadComponent: Type<object> | undefined; protected _preloadCompRef?: ComponentRef<any>; protected _views: CreatedView[]; protected _viewComponent: Type<object>; protected _subscriptions: EventSubscription[]; protected _userProcessFn: (item: any) => Promise<any> | Observable<any> | Subject<any>; constructor(angularUtilService: AngularUtilService, appRef: ApplicationRef, eventPubSubService: EventPubSubService, gridContainerElement: HTMLDivElement, rxjs?: RxJsFacade | undefined); get addonOptions(): import("@slickgrid-universal/common").RowDetailViewOption; protected get datasetIdPropName(): string; /** Getter for the Grid Options pulled through the Grid Object */ get gridOptions(): GridOption; get rowDetailViewOptions(): RowDetailView | undefined; addRxJsResource(rxjs: RxJsFacade): void; /** Dispose of the RowDetailView Extension */ dispose(): void; /** Dispose of all the opened Row Detail Panels Angular View Components */ disposeAllViewComponents(): void; /** Get the instance of the SlickGrid addon (control or plugin). */ getAddonInstance(): SlickRowDetailView | null; init(grid: SlickGrid): void; /** * Create the plugin before the Grid creation, else it will behave oddly. * Mostly because the column definitions might change after the grid creation */ register(rowSelectionPlugin?: SlickRowSelectionModel): this; /** Redraw (re-render) all the expanded row detail View Components */ redrawAllViewComponents(forceRedraw?: boolean): void; /** Redraw the necessary View Component */ redrawViewComponent(createdView: CreatedView): void; /** Render (or re-render) the View Component (Row Detail) */ renderPreloadView(): void; /** Render (or re-render) the View Component (Row Detail) */ renderViewModel(item: any): CreatedView | undefined; protected disposeViewByItem(item: any, removeFromArray?: boolean): void; protected disposeView(expandedView: CreatedView): CreatedView | void; /** * notify the onAsyncResponse with the "args.item" (required property) * the plugin will then use item to populate the row detail panel with the "postTemplate" * @param item */ protected notifyTemplate(item: any): void; /** * On Processing, we will notify the plugin with the new item detail once backend server call completes * @param item */ protected onProcessing(item: any): Promise<void>; /** * Just before the row get expanded or collapsed we will do the following * First determine if the row is expanding or collapsing, * if it's expanding we will add it to our View Components reference array if we don't already have it * or if it's collapsing we will remove it from our View Components reference array */ protected handleOnBeforeRowDetailToggle(_e: SlickEventData<OnBeforeRowDetailToggleArgs>, args: { grid: SlickGrid; item: any; }): void; /** When Row comes back to Viewport Range, we need to redraw the View */ protected handleOnRowBackToViewportRange(_e: SlickEventData<OnRowBackToViewportRangeArgs>, args: OnRowBackToViewportRangeArgs): void; }