slickgrid-react
Version:
Slickgrid components made available in React
83 lines (82 loc) • 4.05 kB
TypeScript
import { SlickEventData, type EventSubscription, type OnBeforeRowDetailToggleArgs, type OnRowBackOrOutOfViewportRangeArgs, type SelectionModel, type SlickGrid } 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 type { Root } from 'react-dom/client';
import type { GridOption, RowDetailView } from '../models/index.js';
export interface CreatedView {
id: string | number;
dataContext: any;
root: Root | null;
rendered?: boolean;
}
export declare class SlickRowDetailView extends UniversalSlickRowDetailView {
private readonly eventPubSubService;
protected _component?: any;
protected _preloadComponent?: any;
protected _preloadRoot?: Root;
protected _views: CreatedView[];
protected _subscriptions: EventSubscription[];
protected _userProcessFn?: (item: any) => Promise<any>;
protected gridContainerElement: HTMLElement;
_root?: Root;
constructor(eventPubSubService: EventPubSubService);
get addonOptions(): import("@slickgrid-universal/common").RowDetailViewOption;
protected get datasetIdPropName(): string;
get gridOptions(): GridOption;
get rowDetailViewOptions(): RowDetailView | undefined;
/** Dispose of the RowDetailView Extension */
dispose(): void;
/** Dispose of all the opened Row Detail Panels 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?: SelectionModel): this;
/** Redraw (re-render) all the expanded row detail View Components */
redrawAllViewComponents(forceRedraw?: boolean): Promise<void>;
/** Render all the expanded row detail View Components */
renderAllViewModels(): Promise<void>;
/** Redraw the necessary View Component */
redrawViewComponent(view: CreatedView): void;
/** Render (or re-render) the View Component (Row Detail) */
renderPreloadView(item: any): void;
/** Render (or re-render) the View Component (Row Detail) */
renderViewModel(item: any): void;
protected upsertViewRefs(item: any, root: Root | null): void;
protected disposeViewByItem(item: any, removeFromArray?: boolean): void;
protected disposeViewComponent(expandedView: CreatedView): CreatedView | 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<OnRowBackOrOutOfViewportRangeArgs>, args: {
item: any;
rowId: string | number;
rowIndex: number;
expandedRows: (string | number)[];
rowIdsOutOfViewport: (string | number)[];
grid: SlickGrid;
}): Promise<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>;
}