UNPKG

ng-hub-ui-board

Version:

An Angular-based Kanban board component with Trello-like drag-and-drop, customizable columns, and straightforward event handling.

54 lines (53 loc) 3.09 kB
import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { EventEmitter, TemplateRef } from '@angular/core'; import { Board } from '../board'; import { BoardCard } from '../board-card'; import { BoardColumn } from '../board-column'; import { BoardColumnFooterDirective } from '../board-column-footer.directive'; import { BoardColumnHeaderDirective } from '../board-column-header.directive'; import { CardTemplateDirective } from '../card-template.directive'; import { ReachedEndEvent } from '../reached-end-event'; import * as i0 from "@angular/core"; export declare class HubBoardComponent { board: Board; columnSortingDisabled: boolean; cardTpt: TemplateRef<CardTemplateDirective>; columnHeaderTpt: TemplateRef<BoardColumnHeaderDirective>; columnFooterTpt: TemplateRef<BoardColumnFooterDirective>; onCardClick: EventEmitter<BoardCard<any>>; onCardMoved: EventEmitter<CdkDragDrop<BoardColumn<any>, BoardColumn<any>, BoardCard<any>>>; onColumnMoved: EventEmitter<CdkDragDrop<BoardColumn<any>[], BoardColumn<any>[], any>>; reachedEnd: EventEmitter<ReachedEndEvent<any>>; defaultEnterPredicateFn: () => boolean; /** * Emits an event with the clicked item as a parameter. * * @param {any} item - Represents the item that was clicked on the card. */ cardClick(item: any): void; /** * Used to handle the event when a column is dropped in a drag and drop operation, and it moves the column in the array and * emits an event. * * @param event - represents the drag and drop event that occurred. */ dropColumn(event: CdkDragDrop<BoardColumn[]>): void; /** * Used to handle the dropping of a card in a drag and drop operation, either moving the card within the same container or * transferring it to a different container. * * @param event - a generic type that takes three arguments: */ dropCard(event: CdkDragDrop<BoardColumn, BoardColumn, BoardCard<any>>): void; /** * Checks if the user has scrolled to the end of a specific element and emits an event if so. * * @param {number} index - The index parameter is a number that represents the index of the column being scrolled. * @param {Event} event - The event parameter is an object that represents the scroll event. It contains information about the * scroll event, such as the source element that triggered the event, the amount of scrolling that has occurred, and the dimensions * of the scrollable area. */ onScroll(index: number, event: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration<HubBoardComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<HubBoardComponent, "hub-board, hub-ui-board", never, { "board": { "alias": "board"; "required": true; }; "columnSortingDisabled": { "alias": "columnSortingDisabled"; "required": false; }; }, { "onCardClick": "onCardClick"; "onCardMoved": "onCardMoved"; "onColumnMoved": "onColumnMoved"; "reachedEnd": "reachedEnd"; }, ["cardTpt", "columnHeaderTpt", "columnFooterTpt"], never, true, never>; }