import { ElementRef, EventEmitter, OnInit, AfterViewInit, OnDestroy, Renderer2 } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; import { BaseEntity, RunViewParams, EntityFieldInfo, EntityInfo, CompositeKey } from '@memberjunction/core'; import { ViewColumnInfo, UserViewEntityExtended, ListEntity, EntityActionEntity } from '@memberjunction/core-entities'; import { CellClickEvent, GridDataResult, PageChangeEvent, GridComponent, CellCloseEvent, ColumnReorderEvent, ColumnResizeArgs, SelectionEvent, SelectableSettings } from "@progress/kendo-angular-grid"; import { ExcelExportComponent } from '@progress/kendo-angular-excel-export'; import { CompareRecordsComponent } from '@memberjunction/ng-compare-records'; import { TextAreaComponent } from '@progress/kendo-angular-inputs'; import { EntityFormDialogComponent } from '@memberjunction/ng-entity-form-dialog'; import { NavigationService } from '@memberjunction/ng-shared'; import { ListManagementDialogConfig, ListManagementResult } from '@memberjunction/ng-list-management'; import * as i0 from "@angular/core"; export type GridRowClickedEvent = { entityId: string; entityName: string; CompositeKey: CompositeKey; }; export type GridRowEditedEvent = { record: BaseEntity; row: number; saved: boolean; }; export type GridPendingRecordItem = { record: BaseEntity; row: number; dataItem: any; }; /** * @deprecated use @memberjunction/ng-entity-viewer package and the mj-entity-data-grid as a replacement */ export declare class UserViewGridComponent implements OnInit, AfterViewInit, OnDestroy { private elementRef; private formBuilder; private navigationService; private renderer; title: string; /** * Parameters for running the view. * When this changes, the grid will automatically refresh if AutoRefreshOnParamsChange is true. */ private _params; get Params(): RunViewParams | undefined; set Params(value: RunViewParams | undefined); /** * If set to true (default), the grid will automatically refresh when Params input changes. * Set to false if you want to manually control refresh timing. */ AutoRefreshOnParamsChange: boolean; BottomMargin: number; /** * Height of the grid. Can be: * - A number for fixed pixel height (e.g., 400) * - 'auto' to fill available viewport space (use for standalone views) * - undefined (default) uses 400px for backward compatibility */ Height: number | 'auto' | undefined; InEditMode: boolean; EditMode: "None" | "Save" | "Queue"; AutoNavigate: boolean; /** * If set to false, the component will not automatically refresh when Params are provided. * This is useful when the parent component wants to control when Refresh is called. */ AutoRefreshOnInit: boolean; /** * If you enable the ShowCreateNewRecordButton and the user has permission, when they click the New button, these values from this object will auto-populate the new record form */ NewRecordValues: any; /** * If set to true, the Create New Record button will be displayed if the user is allowed to create new records for the entity being shown. If set to false, the Create New Record button will be hidden. */ ShowCreateNewRecordButton: boolean; /** * If set to true, any Actions that are linked to the displayed entity via EntityActions that have an InvocationContext for Views will be shown. */ ShowEntityActionButtons: boolean; /** * If set to true, and if the entity being displayed supports communication, the communication button will be displayed. If set to false, the communication button will be hidden. */ ShowCommunicationButton: boolean; /** * When set to Dialog, the Create New Record button will open a dialog to create a new record. When set to Tab, the Create New Record button will open a new tab to create a new record. */ CreateRecordMode: "Dialog" | "Tab"; rowClicked: EventEmitter; rowEdited: EventEmitter; dataLoaded: EventEmitter<{ totalRowCount: number; loadTime: number; }>; kendoGridElement: GridComponent | null; kendoGridElementRef: ElementRef | null; kendoExcelExport: ExcelExportComponent | null; recordCompareComponent: CompareRecordsComponent | null; analysisQuestion: TextAreaComponent | null; analysisResults: ElementRef | null; private compareDialogContainer; private _pendingRecords; viewData: any[]; totalRowCount: number; formattedData: { [key: string]: any; }[]; viewColumns: ViewColumnInfo[]; visibleColumns: ViewColumnInfo[]; sortSettings: any[]; entityRecord: BaseEntity | null; skip: number; pageSize: number; isLoading: boolean; neverLoaded: boolean; gridView: GridDataResult; gridHeight: number; private resizeListener; _viewEntity: UserViewEntityExtended | undefined; _entityInfo: EntityInfo | undefined; private _newGridState; private editModeEnded; private searchDebounce$; recordsToCompare: any[]; compareMode: boolean; mergeMode: boolean; duplicateMode: boolean; addToListMode: boolean; get anyModeEnabled(): boolean; get EntityInfo(): EntityInfo | undefined; showNewRecordDialog: boolean; selectableSettings: SelectableSettings; selectedKeys: any[]; isCompareDialogOpened: boolean; isConfirmDialogOpen: boolean; showRefreshButton: boolean; viewExecutionTime: number; showAddToListDialog: boolean; showAddToListLoader: boolean; sourceListEntities: ListEntity[] | null; listEntities: ListEntity[]; selectedListEntities: ListEntity[]; listEntitySearch: string; showEnhancedListDialog: boolean; listManagementConfig: ListManagementDialogConfig | null; useEnhancedListDialog: boolean; EntityActions: EntityActionEntity[]; get PendingRecords(): GridPendingRecordItem[]; get ViewID(): string; /** * This property is true if the user has the ability to create a new record which is a combination of the user-level permission coupled with the * entity-level setting AllowCreateAPI being set to 1. */ get UserCanCreateNewRecord(): boolean; protected StartEditMode(): void; protected EndEditMode(): void; EditingComplete(): Promise; IsDynamicView(): boolean; pageChange(event: PageChangeEvent): void; data: { text: string; }[]; private virtualLoadData; constructor(elementRef: ElementRef, formBuilder: FormBuilder, navigationService: NavigationService, renderer: Renderer2); private _saveTimeout; private SaveView; get UserCanEdit(): boolean; get UserCanView(): boolean; private _viewDirty; innerSaveView(): Promise; protected CreateSimpleNotification(message: string, style: "none" | "success" | "error" | "warning" | "info", duration: number): void; columnReorder(args: ColumnReorderEvent): Promise; columnResize(args: ColumnResizeArgs[]): Promise; sortChanged(sort: any): Promise; cellClickHandler(args: CellClickEvent): Promise; createFormGroup(dataItem: any): FormGroup; getEditor(ef: EntityFieldInfo): "boolean" | "text" | "numeric" | "date"; cellCloseHandler(args: CellCloseEvent): Promise; RevertPendingChanges(): void; ngOnInit(): void; ngAfterViewInit(): Promise; private _movedToBody; moveDialogToBody(): void; private _deferLoadCount; private _allowLoad; get AllowLoad(): boolean; set AllowLoad(value: boolean); RefreshFromSavedParams(): Promise; Refresh(params: RunViewParams): Promise; /** * Check if params have meaningfully changed (compares key properties) */ private hasParamsChanged; /** * Load up the entity action metadata for the current entity the view is displaying */ protected LoadEntityActions(): void; GetColumnTitle(col: ViewColumnInfo): string; GetColumnCellStyle(col: ViewColumnInfo): { 'text-align': string; 'vertical-align': string; }; selectionChange(args: SelectionEvent): void; enableMergeOrCompare(cancel: boolean | undefined, type: 'merge' | 'compare'): void; enableCheckbox(cancel: boolean | undefined, type: 'merge' | 'compare' | 'duplicate' | 'addToList' | ''): void; closeConfirmMergeDialog(event: 'cancel' | 'yes' | 'no'): Promise; closeCompareDialog(event: 'close' | 'cancel' | 'merge' | 'duplicate' | 'addToList'): Promise; findDuplicateRecords(): Promise; exportColumns: ViewColumnInfo[]; exportData: any[]; doExcelExport(): Promise; protected getExportData(): Promise; showTemplatePreviewDialog: boolean; /** * Handles communication functionality for a given view, only available if the entity being displayed supports communication. */ doCommunication(): Promise; /** * This method will invoke the selected action * @param action */ doEntityAction(action: EntityActionEntity): Promise; get EntitySupportsCommunication(): boolean; entityFormDialog: EntityFormDialogComponent | null; /** * This method will create a new record of the given entity type. It will only work if the User has the ability to create records of * this entity type and also if the entity level setting AllowCreateAPI is set to 1. If either of these conditions are not met, then * this method will do nothing. */ doCreateNewRecord(): Promise; toggleAddToListDialog(show: boolean): Promise; loadListEntities(): Promise; addToList(listEntity: ListEntity): Promise; removeFromList(listEntity: ListEntity): Promise; addRecordsToSelectedLists(): Promise; /** * Opens the enhanced list management dialog with full membership visibility */ openEnhancedListDialog(): void; /** * Handles completion of the enhanced list management dialog */ onEnhancedListDialogComplete(result: ListManagementResult): void; /** * Handles cancellation of the enhanced list management dialog */ onEnhancedListDialogCancel(): void; onSearch(inputValue: string): void; private setupSearchDebounce; private search; /** * Calculates and sets the grid height based on the Height input property. * - If Height is a number, uses that exact pixel height * - If Height is 'auto', calculates height to fill available viewport space * - If Height is undefined, uses legacy default of 400px */ protected setGridHeight(): void; /** * Calculates the auto height based on viewport and grid position */ protected calculateAutoHeight(): void; /** * Sets up window resize listener to recalculate grid height dynamically */ protected setupResizeListener(): void; /** * Cleanup when component is destroyed */ ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } //# sourceMappingURL=ng-user-view-grid.component.d.ts.map