UNPKG

@progress/kendo-react-taskboard

Version:
936 lines (899 loc) 27 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { CardHandle } from '@progress/kendo-react-layout'; import { CardProps } from '@progress/kendo-react-layout'; import { DropDownListChangeEvent } from '@progress/kendo-react-dropdowns'; import { InputChangeEvent } from '@progress/kendo-react-inputs'; import { MenuSelectEvent } from '@progress/kendo-react-layout'; import { PopupHandle } from '@progress/kendo-react-popup'; import * as React_2 from 'react'; /** * Represent the item model. */ declare interface ItemModel { /** * Sets the `id` of an ItemModel. */ id: string | number | undefined; /** * Determines the title of an ItemModel. */ title: string; /** * Determines the status of an ItemModel. */ status: string; /** * Determines of an ItemModel is going to edited. */ edit?: boolean; /** * @hidden */ isPlaceholder?: boolean; } /** * Represents the [KendoReact TaskBoard component]({% slug overview_taskboard %}). * * Accepts properties of type [TaskBoardProps]({% slug api_taskboard_taskboardprops %}). * * @remarks * Supported children components are: {@link TaskBoardToolbar}. */ export declare const TaskBoard: React_2.ForwardRefExoticComponent<TaskBoardProps & React_2.RefAttributes<TaskBoardHandle | null>>; /** * Represents the TaskBoardAddCard component. */ export declare const TaskBoardAddCard: React_2.FunctionComponent<TaskBoardAddCardProps>; /** * Represents the props of the TaskBoardAddCard component */ export declare interface TaskBoardAddCardProps { /** * Represent the priorities of the task board card. */ priorities: TaskBoardPriority[]; /** * Triggered on `onClose` event of the TaskBoardAddCard. */ onClose: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Triggered on `onSave` event of the TaskBoardAddCard. */ onSave: (task: TaskBoardTaskModel, prevTask: TaskBoardTaskModel) => void; /** * Specifies the TaskBoardTaskEditPane component. */ editPane: React_2.ComponentType<TaskBoardTaskEditPaneProps>; } /** * Represents the TaskBoardCard component. */ export declare const TaskBoardCard: React_2.FunctionComponent<TaskBoardCardProps>; /** * Represents the TaskBoardCardBody component. */ export declare const TaskBoardCardBody: React_2.FunctionComponent<TaskBoardCardBodyProps>; /** * Represents the props of the TaskBoardCardBody component. */ export declare interface TaskBoardCardBodyProps { /** * Determines the children nodes. */ children: React_2.ReactNode; /** * Determines the TaskBoardTask. */ task: TaskBoardTaskModel; } /** * Represents the TaskBoardCardHeader component. */ export declare const TaskBoardCardHeader: React_2.FunctionComponent<TaskBoardCardHeaderProps>; /** * Represents the props of the TaskBoardCardHeader component. */ export declare interface TaskBoardCardHeaderProps { /** * Determines the visibility of the show menu. */ showMenu: boolean; /** * Represents the menu items. */ menuItems: any[]; /** * Specifies the popup reference. */ popupRef: React_2.RefObject<PopupHandle | null>; /** * The rendered title. */ title: React_2.ReactNode; /** * The rendered task. */ task: TaskBoardTaskModel; /** * Fires when the preview pane needs to be shown. */ onShowPreviewPane: (event: React_2.MouseEvent<HTMLElement>) => void; /** * Fires when the menu needs to be shown. */ onShowMenu: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires when the menu needs to be hidden. */ onHideMenu: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires on blur of the menu button. */ onMenuButtonBlur: (event: React_2.FocusEvent<HTMLButtonElement>) => void; /** * Fires when menu item is selected. */ onMenuItemSelect: (event: MenuSelectEvent) => void; } /** * Represents the props of the TaskBoardCard component. */ export declare interface TaskBoardCardProps { /** * The rendered task. */ task: TaskBoardTaskModel; /** * The applied styles. */ style?: React_2.CSSProperties; /** * Specifies the `tabIndex` that will be added to the TaskBoard Card element. */ tabIndex?: number; /** * The disabled state. */ disabled?: boolean; /** * Specifies the CardHandle reference. */ elementRef?: React_2.RefObject<CardHandle | null>; /** * Determines the menu visibility. */ showMenu: boolean; /** * Determines the visibility of the task's delete confirmation dialog. */ showDeleteConfirm: boolean; /** * Determines the visibility of the task's preview pane. */ showTaskPreviewPane: boolean; /** * Represents the menu items. */ menuItems: any[]; /** * Represents the popup reference. */ popupRef: React_2.RefObject<PopupHandle | null>; /** * Represents the content of the TaskBoardConfirmDialog component. */ confirmDialogMessage: React_2.ReactNode; /** * Represents the title of the TaskBoardConfirmDialog component. */ confirmDialogTitle: string; /** * Represents the content of the confirm button of the TaskBoardConfirmDialog component. */ confirmDialogConfirmButton: React_2.ReactNode; /** * Represents the content of the cancel button of the TaskBoardConfirmDialog component. */ confirmDialogCancelButton: React_2.ReactNode; /** * Represents the priority label in the preview dialog. */ previewDialogPriorityLabel: string; /** * Represents the preview dialog delete node. */ previewDialogDelete: React_2.ReactNode; /** * Represents the preview dialog edit node. */ previewDialogEdit: React_2.ReactNode; /** * Fires when the preview pane needs to be shown. */ onShowPreviewPane: (event: React_2.MouseEvent<HTMLElement>) => void; /** * Fires when the preview pane needs to be closed. */ onClosePreviewPane: (event: React_2.MouseEvent<HTMLElement>) => void; /** * Fires on menu item selection. */ onMenuItemSelect: (event: MenuSelectEvent) => void; /** * Fires when the menu needs to be shown. */ onShowMenu: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires when the menu needs to be hidden. */ onHideMenu: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires on blur of the menu button. */ onMenuButtonBlur: (event: React_2.FocusEvent<HTMLButtonElement>) => void; /** * Fires when task's delete button is clicked. */ onTaskDelete: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires when task's edit button is clicked. */ onTaskEdit: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * The Close Button click event handler of the TaskBoardConfirmDialog component. */ onCloseConfirmDialog: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Represents the Card component. */ card: React_2.ForwardRefExoticComponent<CardProps & React_2.RefAttributes<CardHandle | null>>; /** * Represents the TaskBoardCardHeader component. */ cardHeader: React_2.ComponentType<TaskBoardCardHeaderProps>; /** * Represents the TaskBoardCardBody component. */ cardBody: React_2.ComponentType<TaskBoardCardBodyProps>; /** * Represents the TaskBoardConfirmDialog component. */ confirmDialog: React_2.ComponentType<TaskBoardConfirmDialogProps>; /** * Represents the TaskBoardPreviewDialog component. */ previewDialog: React_2.ComponentType<TaskBoardPreviewDialogProps>; } /** * Represents the return type of TaskBoardChangeEvent. */ export declare interface TaskBoardChangeEvent { /** * Determines the returned data. */ data: {}[] | TaskBoardTaskModel[]; /** * Determines the returned type. */ type: string; /** * Represents the previous item. */ previousItem: TaskBoardColumnModel | TaskBoardTaskModel | null; /** * Represents the current item. */ item: TaskBoardColumnModel | TaskBoardTaskModel | null; } /** * Represents the TaskBoardColumn component. */ export declare const TaskBoardColumn: React_2.FunctionComponent<TaskBoardColumnProps>; /** * Represents the TaskBoardColumnBody component. */ export declare const TaskBoardColumnBody: React_2.FunctionComponent<TaskBoardColumnBodyProps>; /** * Represents the props of the TaskBoardColumnBody component */ export declare interface TaskBoardColumnBodyProps { /** * Determines the children nodes. */ children: React_2.ReactNode; } /** * Represents the TaskBoardColumnHeader component. */ export declare const TaskBoardColumnHeader: React_2.FunctionComponent<TaskBoardColumnHeaderProps>; /** * Represents the props of the TaskBoardColumnHeader component. */ export declare interface TaskBoardColumnHeaderProps { /** * The rendered column. */ column: TaskBoardColumnModel; /** * The rendered tasks. */ tasks: TaskBoardTaskModel[]; /** * The title of the editButton. */ editButtonTitle: string; /** * The title of the addButton. */ addButtonTitle: string; /** * The title of the closeButton. */ closeButtonTitle: string; /** * The event that is fired when the title is changed. */ onTitleChange?: (event: InputChangeEvent) => void; /** * The event that is fired when a column enters edit mode. */ onColumnEnterEdit: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * The event that is fired when a column exits edit mode. */ onColumnExitEdit: (event: React_2.FocusEvent<HTMLInputElement>) => void; /** * The event that is fired when a add card dialog is shown. */ onShowAddCardDialog: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * The event that is fired when a column is deleted. */ onColumnDelete: (event: React_2.MouseEvent<HTMLButtonElement>) => void; } /** * Represents the task board column model. */ export declare interface TaskBoardColumnModel extends ItemModel { /** * Determined the index of the TaskBoardTaskModel. */ index?: number; } /** * Represents the props of the TaskBoardColumn component */ export declare interface TaskBoardColumnProps { /** * The column of the TaskBoard. */ column: TaskBoardColumnModel; /** * The tasks of the TaskBoard. */ tasks: TaskBoardTaskModel[]; /** * The priorities that are set in the TaskBoard. */ priorities: TaskBoardPriority[]; /** * The styles for the TaskBoard. */ style?: React_2.CSSProperties; /** * Specifies the `tabIndex` that will be added to the TaskBoard Column element. */ tabIndex?: number; /** * Represents the reference of the element. */ elementRef?: React_2.RefObject<HTMLDivElement | null>; /** * Determines the visibility of the add card. */ showAddCard: boolean; /** * Determines the visibility of the edit card. */ showEditCard: boolean; /** * Determines the visibility of the column confirm/delete. */ showColumnConfirmDelete: boolean; /** * Specifies the edited task. */ editedTask?: TaskBoardTaskModel; /** * Specifies the confirm dialog message */ confirmDialogMessage: React_2.ReactNode; /** * Specifies the confirm dialog confirm button node. */ confirmDialogConfirmButton: React_2.ReactNode; /** * Specifies the cancel dialog confirm button node. */ confirmDialogCancelButton: React_2.ReactNode; /** * Specifies the confirm dialog title. */ confirmDialogTitle: string; /** * Specifies the edit button title. */ editButtonTitle: string; /** * Specifies the add button title. */ addButtonTitle: string; /** * Specifies the close button title. */ closeButtonTitle: string; /** * Determines the children nodes. */ children: React_2.ReactNode; /** * Fire on task creation. */ onTaskCreate: (task: TaskBoardTaskModel) => void; /** * Fires when task is edited. */ onTaskEdit: (task: TaskBoardTaskModel, prevTask: TaskBoardTaskModel) => void; /** * Fires when task is deleted. */ onTaskDelete: (task: TaskBoardTaskModel) => void; /** * Fires when title is changed. */ onTitleChange?: (event: InputChangeEvent) => void; /** * Fires when column enters edit. */ onColumnEnterEdit: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires when column exits edit. */ onColumnExitEdit: (event: React_2.FocusEvent<HTMLInputElement>) => void; /** * Fires on confirmation of column deletion. */ onColumnConfirmDelete: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires when the add card dialog is shown. */ onShowAddCardDialog: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires when the edit card pane is shown. */ onShowEditCardPane: (task: TaskBoardTaskModel) => void; /** * Fires on column deletion. */ onColumnDelete: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * The Close Button click event handler of the TaskBoardConfirmDialog component. */ onCloseDialog: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Represents the TaskBoardCard component. */ card: React_2.ComponentType<TaskBoardCardProps>; /** * Represents the TaskBoardColumnHeader component. */ header: React_2.ComponentType<TaskBoardColumnHeaderProps>; /** * Represents the TaskBoardColumnBody component. */ body: React_2.ComponentType<TaskBoardColumnBodyProps>; /** * Represents the TaskBoardConfirmDialog component. */ confirmDialog: React_2.ComponentType<TaskBoardConfirmDialogProps>; /** * Represents the TaskBoardEditCard component. */ editCardDialog: React_2.ComponentType<TaskBoardEditCardProps>; /** * Represents the TaskBoardAddCard component. */ addCardDialog: React_2.ComponentType<TaskBoardAddCardProps>; } /** * Represents the TaskBoardConfirmDialog component. */ export declare const TaskBoardConfirmDialog: React_2.FunctionComponent<TaskBoardConfirmDialogProps>; /** * Represents the props of the TaskBoardConfirmDialog component */ export declare interface TaskBoardConfirmDialogProps { /** * The dialog message. */ dialogMessage: React_2.ReactNode; /** * The dialog title. */ dialogTitle: string; /** * The dialog confirm button. */ dialogConfirmButton: React_2.ReactNode; /** * The dialog cancel button. */ dialogCancelButton: React_2.ReactNode; /** * The Close Button click event handler of the TaskBoardConfirmDialog component. */ onClose: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * The Confirm Button click event handler of the TaskBoardConfirmDialog component. */ onConfirm: (event: React_2.MouseEvent<HTMLButtonElement>) => void; } /** * Represents the TaskBoardEditCard component. */ export declare const TaskBoardEditCard: React_2.FunctionComponent<TaskBoardEditCardProps>; /** * Represents the props of the TaskBoardEditCard component */ export declare interface TaskBoardEditCardProps extends TaskBoardAddCardProps { /** * Determines the task of the TaskBoardEditCard component. */ task: TaskBoardTaskModel; } /** * Represent the target(props) of the TaskBoardHandle. */ export declare interface TaskBoardHandle { /** * The props values of the TackBoard. */ props: TaskBoardProps; } /** * Represents the TaskBoardPreviewDialog component. */ export declare const TaskBoardPreviewDialog: React_2.FunctionComponent<TaskBoardPreviewDialogProps>; /** * Represents the props of the TaskBoardPreviewDialog component. */ export declare interface TaskBoardPreviewDialogProps { /** * The rendered title. */ title: React_2.ReactNode; /** * The rendered description. */ description: React_2.ReactNode; /** * Represents the priority label of the TaskBoardPreviewDialog. */ priorityLabel: React_2.ReactNode; /** * Determines the content of the delete button. */ delete: React_2.ReactNode; /** * Determines the content of the edit button. */ edit: React_2.ReactNode; /** * Represents the priority of the current task. */ priority: TaskBoardPriority; /** * Fires when the preview pane needs to be shown. */ onClosePreviewPane: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires when task is deleted. */ onTaskDelete: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires when task is edited. */ onTaskEdit: (event: React_2.MouseEvent<HTMLButtonElement>) => void; } /** * Represents the target of the TaskBoardPriority. */ export declare interface TaskBoardPriority { /** * Represents the priority of a TaskBoard. */ priority: string; /** * Represents the color of a TaskBoard. */ color: string; } /** * Represents the props of the TaskBoard component */ export declare interface TaskBoardProps { /** * Specifies the column data from type TaskBoardColumnModel. * Example: * ```jsx * <TaskBoard columnData={[ * { id: 1, title: 'To Do', status: 'todo' }, * { id: 2, title: 'In Progress', status: 'inProgress' } * ]} /> * ``` */ columnData: TaskBoardColumnModel[]; /** * Represents the task data from type TaskBoardTaskModel. * Example: * ```jsx * <TaskBoard taskData={[ * { id: 1, title: 'Task 1', status: 'todo', description: 'Description 1', priority: { priority: 'High', color: 'red' } }, * { id: 2, title: 'Task 2', status: 'inProgress', description: 'Description 2', priority: { priority: 'Low', color: 'green' } } * ]} /> * ``` */ taskData: TaskBoardTaskModel[]; /** * Specifies the priorities of the task board. * Example: * ```jsx * <TaskBoard priorities={[ * { priority: 'High', color: 'red' }, * { priority: 'Low', color: 'green' } * ]} /> * ``` */ priorities: TaskBoardPriority[]; /** * Specifies a list of CSS classes that will be added to the TaskBoard element. * Example: * ```jsx * <TaskBoard className="custom-taskboard" /> * ``` */ className?: string | Array<string>; /** * Specifies the id that will be added to the TaskBoard element. * Example: * ```jsx * <TaskBoard id="taskboard-1" /> * ``` */ id?: string; /** * Specifies the `tabIndex` that will be added to the TaskBoard Column and Card elements. * Example: * ```jsx * <TaskBoard tabIndex={0} /> * ``` */ tabIndex?: number; /** * Represents the styles that are applied to the TaskBoard. * Example: * ```jsx * <TaskBoard style={{ backgroundColor: 'lightgray' }} /> * ``` */ style?: React_2.CSSProperties; /** * The React elements that will be rendered inside the toolbar of the TaskBoard. * Example: * ```jsx * <TaskBoard> * <Button>Add Task</Button> * </TaskBoard> * ``` */ children?: React_2.ReactNode; /** * Represents the `onChange` event. Triggered after tasks or columns are changed. * Example: * ```jsx * <TaskBoard onChange={(event) => console.log(event.data)} /> * ``` */ onChange: (event: TaskBoardChangeEvent) => void; /** * Represents the TaskBoardCard component. * Example: * ```jsx * <TaskBoard card={(props) => <div>{props.title}</div>} /> * ``` */ card?: React_2.ComponentType<TaskBoardCardProps>; /** * Represents the TaskBoardColumn component. * Example: * ```jsx * <TaskBoard column={(props) => <div>{props.title}</div>} /> * ``` */ column?: React_2.ComponentType<TaskBoardColumnProps>; } /** * Represents the TaskBoardTaskEditPane component. */ export declare const TaskBoardTaskEditPane: React_2.FunctionComponent<TaskBoardTaskEditPaneProps>; /** * Represents the props of the TaskBoardTaskEditPane component */ export declare interface TaskBoardTaskEditPaneProps { /** * Represents the rendered header of the TaskBoardTaskEditPane. */ header: string; /** * Represents the save button of the TaskBoardTaskEditPane. */ saveButton: React_2.ReactNode; /** * Represents the cancel button of the TaskBoardTaskEditPane. */ cancelButton: React_2.ReactNode; /** * Represents the titleInput title of the TaskBoardTaskEditPane. */ titleInputTitle: string; /** * Represents the descriptionInput title of the TaskBoardTaskEditPane. */ descriptionInputTitle: string; /** * Represents the priorityDropDownTitle title of the TaskBoardTaskEditPane. */ priorityDropDownTitle: string; /** * Represents the title label of the TaskBoardTaskEditPane. */ titleLabel: React_2.ReactNode; /** * Represents the description label of the TaskBoardTaskEditPane. */ descriptionLabel: React_2.ReactNode; /** * Represents the priority label of the TaskBoardTaskEditPane. */ priorityLabel: React_2.ReactNode; /** * Represents the rendered task of the TaskBoardTaskEditPane. */ task?: TaskBoardTaskModel; /** * Determines the priority. */ priority: TaskBoardPriority; /** * Determines the rendered priorities. */ priorities: TaskBoardPriority[]; /** * Represents the title of the TaskBoardTaskEditPane. */ title: string; /** * The rendered description. */ description: string; /** * Fires when Save button is clicked. */ onSave: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires when Cancel button is clicked. */ onClose: (event: React_2.MouseEvent<HTMLButtonElement>) => void; /** * Fires when a title is changed. */ onTitleChange: (event: InputChangeEvent) => void; /** * Fires when a description is changed. */ onDescriptionChange: (event: InputChangeEvent) => void; /** * Fires when a priority has been changed. */ onPriorityChange: (event: DropDownListChangeEvent) => void; } /** * Represents the task board task model. */ export declare interface TaskBoardTaskModel extends ItemModel { /** * Determined the description of the TaskBoardTaskModel. */ description: string; /** * Determined the priority of the TaskBoardTaskModel. */ priority: TaskBoardPriority; /** * Determined the index of the TaskBoardTaskModel. */ index?: number; } /** * Represents the TaskBoardToolbar component. */ export declare const TaskBoardToolbar: React_2.FunctionComponent<TaskBoardToolbarProps>; /** * Represents the props of the TaskBoardToolbar component */ export declare interface TaskBoardToolbarProps { /** * The React elements that will be rendered inside the toolbar of the TaskBoard. */ children?: any; /** * Specifies a list of CSS classes that will be added to the TaskBoardToolbar element. */ className?: string | Array<string>; /** * Represents the styles that are applied to the TaskBoardToolbar. */ style?: React_2.CSSProperties; } export declare interface TaskEditingProps { /** * The task to be edited. If not provided, creates a new task. */ task?: TaskBoardTaskModel; /** * Array of available priority options for the task. */ priorities: TaskBoardPriority[]; /** * Callback function called when the task is saved. */ onSave: (task: TaskBoardTaskModel, prevTask: TaskBoardTaskModel) => void; } export declare interface TaskEditingResult { /** * Handles changes to the task title input field. */ onTitleChange: (event: InputChangeEvent) => void; /** * The current title value of the task being edited. */ title: string; /** * Handles changes to the task description input field. */ onDescriptionChange: (event: InputChangeEvent) => void; /** * The current description value of the task being edited. */ description: string; /** * Handles changes to the task priority dropdown selection. */ onPriorityChange: (event: DropDownListChangeEvent) => void; /** * The current priority value of the task being edited. */ priority: TaskBoardPriority; /** * Saves the current task changes and calls the parent save handler. */ onSave: (event: React_2.MouseEvent<HTMLButtonElement>) => void; } export declare const useTaskEditing: ({ onSave, task, priorities }: TaskEditingProps) => TaskEditingResult; export { }