import { EventEmitter } from '@angular/core'; import { CardData } from '../card-data'; import * as i0 from "@angular/core"; /** One button shown by . */ export interface CardHoverAction { /** Emitted through (action) when clicked. */ id: string; /** Tooltip and aria-label (and the button text when there is no icon). */ label: string; /** * Icon name for : the library's icons, then the app's * assets/icons/.svg. Omit to show `label` as text. */ icon?: string; /** Icon width and height in px (default 14). */ iconSize?: number; /** * Recolour the icon, e.g. 'currentColor' to follow the button's colour * (--card-action-color, dark mode). Default: the icon's own colours * (e.g. the red delete icon stays red). */ iconColor?: string; disabled?: boolean; /** Extra classes for this button, e.g. 'danger'. */ class?: string; /** Show this button for the given card. Omit to always show it. */ canView?: (item: CardData) => boolean; /** Runs when clicked. (action) is emitted as well, so either can be used. */ onSelect?: (item: CardData) => void; } export type CardHoverActionsPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; /** * Wraps a card and reveals a row of small action buttons while it is hovered * or has keyboard focus inside (always shown on touch screens, which can't * hover). Clicks on the buttons don't bubble to the card, whose own click * usually selects it. * * ```html * * * * ``` * * ```ts * readonly actions: CardHoverAction[] = [ * { id: 'delete', label: 'Delete', icon: 'delete', * canView: (item) => item.data.DataState === 'New', * onSelect: (item) => this.facade.removeUnsavedItem(item.data) }, * ]; * ``` * * Inside you don't need to wrap anything: pass * [cardActions]="actions" and each card is wrapped for you. * * Look: `buttonClass` / per-action `class` (the built-in 'danger' turns red on * hover), the `--card-action-*` CSS variables, or fully custom buttons in the * `[hoverActions]` slot. */ export declare class CardHoverActionsComponent { /** The card being wrapped; passed to each action's canView / onSelect. */ item: CardData; actions: CardHoverAction[]; position: CardHoverActionsPosition; /** Keep the buttons visible without hovering. */ alwaysVisible: boolean; /** Disable all buttons, e.g. while a save is in flight. */ disabled: boolean; /** Classes applied to every button. */ buttonClass: string; action: EventEmitter<{ id: string; item: CardData; }>; isVisible(action: CardHoverAction): boolean; onClick(action: CardHoverAction, event: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_alwaysVisible: unknown; static ngAcceptInputType_disabled: unknown; }