@memberjunction/ng-action-gallery
Version:
MemberJunction Action Gallery - A beautiful, filterable gallery component for browsing and selecting actions
74 lines • 3.25 kB
TypeScript
import { EventEmitter, OnInit, OnDestroy, ElementRef } from '@angular/core';
import { FormControl } from '@angular/forms';
import { BehaviorSubject } from 'rxjs';
import { MJActionEntity, MJActionCategoryEntity, MJActionParamEntity, MJActionResultCodeEntity } from '@memberjunction/core-entities';
import * as i0 from "@angular/core";
export interface ActionGalleryConfig {
selectionMode?: boolean;
multiSelect?: boolean;
showCategories?: boolean;
showSearch?: boolean;
defaultView?: 'grid' | 'list';
gridColumns?: number;
enableQuickTest?: boolean;
theme?: 'light' | 'dark';
}
export interface CategoryNode {
id: string;
name: string;
parent?: string;
children?: CategoryNode[];
count?: number;
icon?: string;
}
export interface ActionWithDetails extends MJActionEntity {
parameters?: MJActionParamEntity[];
resultCodes?: MJActionResultCodeEntity[];
expanded?: boolean;
selected?: boolean;
}
export declare class ActionGalleryComponent implements OnInit, OnDestroy {
config: ActionGalleryConfig;
preSelectedActions: string[];
actionSelected: EventEmitter<MJActionEntity>;
actionsSelected: EventEmitter<MJActionEntity[]>;
actionTestRequested: EventEmitter<MJActionEntity>;
searchInput: ElementRef<HTMLInputElement>;
private destroy$;
actions$: BehaviorSubject<ActionWithDetails[]>;
categories$: BehaviorSubject<MJActionCategoryEntity[]>;
filteredActions$: BehaviorSubject<ActionWithDetails[]>;
categoryTree$: BehaviorSubject<CategoryNode[]>;
selectedCategory$: BehaviorSubject<string>;
viewMode$: BehaviorSubject<"grid" | "list">;
isLoading$: BehaviorSubject<boolean>;
selectedActions$: BehaviorSubject<Set<string>>;
searchControl: FormControl<string | null>;
expandedCategories: Set<string>;
hoveredAction: string | null;
animateCards: boolean;
totalActions: number;
categoryCounts: Map<string, number>;
constructor();
ngOnInit(): void;
ngOnDestroy(): void;
loadData(): Promise<void>;
private buildCategoryTree;
private getCategoryIcon;
getCategoryIconClass(category: CategoryNode): string;
private filterActions;
private getCategoryName;
selectCategory(categoryId: string): void;
toggleCategoryExpanded(categoryId: string): void;
toggleViewMode(): void;
toggleActionExpanded(action: ActionWithDetails): Promise<void>;
loadActionDetails(action: ActionWithDetails): Promise<void>;
toggleActionSelection(action: ActionWithDetails): void;
testAction(action: MJActionEntity, event: Event): void;
clearSearch(): void;
getSelectedActions(): MJActionEntity[];
getActionIcon(action: MJActionEntity): string;
static ɵfac: i0.ɵɵFactoryDeclaration<ActionGalleryComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ActionGalleryComponent, "mj-action-gallery", never, { "config": { "alias": "config"; "required": false; }; "preSelectedActions": { "alias": "preSelectedActions"; "required": false; }; }, { "actionSelected": "actionSelected"; "actionsSelected": "actionsSelected"; "actionTestRequested": "actionTestRequested"; }, never, never, false, never>;
}
//# sourceMappingURL=action-gallery.component.d.ts.map