import { EventEmitter, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core'; import { MJDashboardEntity, MJDashboardCategoryEntity, DashboardUserPermissions } from '@memberjunction/core-entities'; import * as i0 from "@angular/core"; /** * View mode for the dashboard browser */ export type DashboardBrowserViewMode = 'cards' | 'list'; /** * Event emitted when a dashboard is selected for viewing */ export interface DashboardOpenEvent { Dashboard: MJDashboardEntity; OpenInNewTab: boolean; } /** * Event emitted when a dashboard is selected for editing */ export interface DashboardEditEvent { Dashboard: MJDashboardEntity; } /** * Event emitted when dashboards are requested for deletion */ export interface DashboardDeleteEvent { Dashboards: MJDashboardEntity[]; } /** * Event emitted when dashboards are requested to be moved to a folder */ export interface DashboardMoveEvent { Dashboards: MJDashboardEntity[]; TargetCategoryId: string | null; } /** * Event emitted when the category filter changes */ export interface CategoryChangeEvent { CategoryId: string | null; Category: MJDashboardCategoryEntity | null; } /** * Event emitted when view mode changes */ export interface ViewModeChangeEvent { Mode: DashboardBrowserViewMode; } /** * Event emitted when a new dashboard should be created */ export interface DashboardCreateEvent { CategoryId: string | null; } /** * Event emitted when a new category should be created */ export interface CategoryCreateEvent { ParentCategoryId: string | null; Name: string; Description: string | null; } /** * Event emitted when a category should be deleted */ export interface CategoryDeleteEvent { Category: MJDashboardCategoryEntity; IncludeContents: boolean; } /** * Event emitted when view preference should be persisted */ export interface ViewPreferenceChangeEvent { ViewMode: DashboardBrowserViewMode; } /** * Generic dashboard browser component. * Displays dashboards in card or list view with multi-select, filtering, and bulk actions. * * This component is GENERIC and has no routing dependencies. * All navigation and persistence events are bubbled up for the parent to handle. */ export declare class DashboardBrowserComponent implements OnInit, OnDestroy { private cdr; /** All dashboards to display */ private _dashboards; set Dashboards(value: MJDashboardEntity[]); get Dashboards(): MJDashboardEntity[]; /** All categories for filtering */ private _categories; set Categories(value: MJDashboardCategoryEntity[]); get Categories(): MJDashboardCategoryEntity[]; /** Currently selected category ID (for deep linking) */ private _selectedCategoryId; set SelectedCategoryId(value: string | null); get SelectedCategoryId(): string | null; /** Initial view mode */ private _viewMode; set ViewMode(value: DashboardBrowserViewMode); get ViewMode(): DashboardBrowserViewMode; /** Whether the browser is in loading state */ IsLoading: boolean; /** Whether to show the create button */ ShowCreateButton: boolean; /** Whether to allow multi-select (enables selection mode toggle) */ AllowMultiSelect: boolean; /** Whether to allow drag and drop */ AllowDragDrop: boolean; /** Whether currently in selection mode (checkboxes visible) */ IsSelectionMode: boolean; /** Title to display in the header */ Title: string; /** Icon class for the header */ IconClass: string; /** * Map of dashboard ID to user permissions. * Used to show shared indicators and control edit/delete button visibility. */ private _dashboardPermissions; set DashboardPermissions(value: Map | null); get DashboardPermissions(): Map; /** * Map of dashboard ID to effective category ID for display. * Used to show shared dashboards in the user's chosen category instead of owner's category. * If a dashboard ID is not in this map, its actual CategoryID is used. * Use empty string '' to indicate root/uncategorized. */ private _effectiveCategoryMap; set EffectiveCategoryMap(value: Map | null); get EffectiveCategoryMap(): Map; /** Emitted when a dashboard is opened for viewing */ DashboardOpen: EventEmitter; /** Emitted when a dashboard is opened for editing */ DashboardEdit: EventEmitter; /** Emitted when dashboards are requested for deletion */ DashboardDelete: EventEmitter; /** Emitted when dashboards are requested to move to a folder */ DashboardMove: EventEmitter; /** Emitted when a new dashboard should be created */ DashboardCreate: EventEmitter; /** Emitted when a new category should be created */ CategoryCreate: EventEmitter; /** Emitted when a category should be deleted */ CategoryDelete: EventEmitter; /** Emitted when the category filter changes */ CategoryChange: EventEmitter; /** Emitted when view mode changes (for persistence) */ ViewModeChange: EventEmitter; /** Emitted when view preference should be persisted */ ViewPreferenceChange: EventEmitter; /** Filtered dashboards based on search and category */ FilteredDashboards: MJDashboardEntity[]; /** Current search text */ SearchText: string; /** Set of selected dashboard IDs */ SelectedIds: Set; /** Last clicked dashboard ID (for shift-click range selection) */ private lastClickedId; /** Whether delete confirmation dialog is visible */ ShowDeleteConfirm: boolean; /** Whether move-to-folder dialog is visible */ ShowMoveDialog: boolean; /** Dashboards pending deletion (for confirm dialog) */ DashboardsPendingDelete: MJDashboardEntity[]; /** Currently dragging dashboard ID */ DraggingId: string | null; /** Drop target category ID */ DropTargetCategoryId: string | null; /** Whether the "New" dropdown menu is open */ ShowNewMenu: boolean; /** Whether the create category dialog is visible */ ShowCreateCategoryDialog: boolean; /** New category form values */ NewCategoryName: string; NewCategoryDescription: string; /** Child categories of the current folder */ ChildCategories: MJDashboardCategoryEntity[]; /** Filtered child categories (based on search) */ FilteredChildCategories: MJDashboardCategoryEntity[]; /** Breadcrumb trail from root to current category */ Breadcrumbs: MJDashboardCategoryEntity[]; /** Whether the delete category dialog is visible */ ShowDeleteCategoryConfirm: boolean; /** Category pending deletion */ CategoryPendingDelete: MJDashboardCategoryEntity | null; /** Whether to include contents when deleting category */ DeleteCategoryIncludeContents: boolean; /** Drop target category ID for drag-over highlighting on category cards */ DragOverChildCategoryId: string | null; private readonly destroy$; constructor(cdr: ChangeDetectorRef); ngOnInit(): void; ngOnDestroy(): void; /** * Toggle between card and list view */ ToggleViewMode(): void; /** * Set view mode explicitly */ SetViewMode(mode: DashboardBrowserViewMode): void; /** * Handle search text change */ OnSearchChange(): void; /** * Clear search text */ ClearSearch(): void; /** * Message shown in the search no-results empty state, echoing the search term. */ get NoResultsMessage(): string; /** * Handle category filter change */ OnCategoryChange(categoryId: string | null): void; /** * Clear all filters */ ClearFilters(): void; /** * Navigate into a category folder */ NavigateToCategory(categoryId: string | null): void; /** * Navigate up to parent category */ NavigateUp(): void; /** * Check if we're at the root level */ get IsAtRoot(): boolean; /** * Get the current category (for display) */ get CurrentCategory(): MJDashboardCategoryEntity | null; /** * Handle dashboard click with multi-select support */ OnDashboardClick(dashboard: MJDashboardEntity, event: MouseEvent): void; /** * Handle double-click to edit */ OnDashboardDoubleClick(dashboard: MJDashboardEntity, event: MouseEvent): void; /** * Check if a dashboard is selected */ IsSelected(dashboardId: string): boolean; /** * Select all visible dashboards */ SelectAll(): void; /** * Clear all selections */ ClearSelection(): void; /** * Enter selection mode (show checkboxes) */ EnterSelectionMode(): void; /** * Exit selection mode (hide checkboxes and clear selections) */ ExitSelectionMode(): void; /** * Toggle selection mode */ ToggleSelectionMode(): void; /** * Get count of selected dashboards */ get SelectedCount(): number; /** * Get selected dashboards */ GetSelectedDashboards(): MJDashboardEntity[]; /** * Toggle the "New" dropdown menu */ ToggleNewMenu(): void; /** * Close the "New" dropdown menu */ CloseNewMenu(): void; /** * Request to create a new dashboard */ OnCreateDashboard(): void; /** * Open the create category dialog */ OpenCreateCategoryDialog(): void; /** * Close the create category dialog */ CloseCreateCategoryDialog(): void; /** * Confirm category creation */ ConfirmCreateCategory(): void; /** * Open edit dialog for single dashboard via context menu */ OnEditDashboard(dashboard: MJDashboardEntity, event: Event): void; /** * Request to delete a single dashboard */ OnDeleteDashboard(dashboard: MJDashboardEntity, event: Event): void; /** * Request to delete selected dashboards. * Only includes dashboards the user has permission to delete. */ OnDeleteSelected(): void; /** * Confirm deletion */ ConfirmDelete(): void; /** * Cancel deletion */ CloseDeleteConfirm(): void; /** * Open move-to-folder dialog for selected dashboards */ OnMoveSelected(): void; /** * Confirm move to folder */ ConfirmMove(targetCategoryId: string | null): void; /** * Cancel move */ CloseMoveDialog(): void; /** * Request to delete a category */ OnDeleteCategory(category: MJDashboardCategoryEntity, event: Event): void; /** * Confirm category deletion */ ConfirmDeleteCategory(): void; /** * Cancel category deletion */ CloseDeleteCategoryConfirm(): void; /** * Get count of dashboards and sub-categories in a category */ GetCategoryContentCount(category: MJDashboardCategoryEntity): { dashboards: number; categories: number; }; /** * Handle drag start */ OnDragStart(dashboard: MJDashboardEntity, event: DragEvent): void; /** * Create a compact drag preview element */ private createDragPreview; /** * Handle drag end */ OnDragEnd(): void; /** * Handle drag over category */ OnDragOverCategory(categoryId: string | null, event: DragEvent): void; /** * Handle drag leave category */ OnDragLeaveCategory(): void; /** * Handle drop on category */ OnDropOnCategory(categoryId: string | null, event: DragEvent): void; /** * Get category name for a dashboard */ GetCategoryName(categoryId: string | null): string; /** * Format date for display */ FormatDate(date: Date): string; /** * Track by function for ngFor */ TrackByDashboard(_index: number, dashboard: MJDashboardEntity): string; /** * Track by function for categories */ TrackByCategory(_index: number, category: MJDashboardCategoryEntity): string; /** * Gets the effective category ID for a dashboard for display purposes. * For shared dashboards, this may differ from the actual CategoryID * based on the user's DashboardCategoryLink. */ GetEffectiveCategoryId(dashboard: MJDashboardEntity): string | null; /** * Check if a dashboard is shared with the current user (not owned) */ IsShared(dashboardId: string): boolean; /** * Check if user can edit a dashboard */ CanEdit(dashboardId: string): boolean; /** * Check if user can delete a dashboard */ CanDelete(dashboardId: string): boolean; /** * Check if any of the currently selected dashboards can be deleted. * Returns true only if at least one selected dashboard can be deleted. * Used to enable/disable the bulk delete button in selection mode. */ get CanDeleteAnySelected(): boolean; /** * Gets the list of selected dashboards that can be deleted. * Filters out dashboards the user doesn't have permission to delete. */ GetDeletableSelectedDashboards(): MJDashboardEntity[]; /** * Highlight matching search text in a string * Returns HTML with tags around matches */ HighlightMatch(text: string): string; /** * Handle drag over a category card */ OnDragOverChildCategory(categoryId: string, event: DragEvent): void; /** * Handle drag leave from a category card */ OnDragLeaveChildCategory(): void; /** * Handle drop on a category card */ OnDropOnChildCategory(categoryId: string, event: DragEvent): void; /** * Handle drop from breadcrumb component */ OnBreadcrumbDrop(event: { TargetCategoryId: string | null; DashboardIds: string[]; }): void; private applyFilters; /** * Update the list of child categories for the current folder */ private updateChildCategories; /** * Update breadcrumb trail from root to current category */ private updateBreadcrumbs; /** * Toggle selection for a single dashboard */ ToggleSelection(dashboardId: string): void; private selectRange; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } //# sourceMappingURL=dashboard-browser.component.d.ts.map