View as Markdown

API reference: @salmonui/kanban

KanbanEditorFieldinterface

import type { KanbanEditorField } from '@salmonui/kanban';
interface KanbanEditorField<T> {
    readonly field: string;
    readonly label: string;
    readonly kind?: 'text' | 'select' | 'number' | 'textarea' | undefined;
    readonly options?: readonly {
        readonly value: KanbanKey;
        readonly label: string;
    }[] | undefined;
    readonly required?: boolean | undefined;
    readonly validate?: ((value: unknown, draft: T) => string | null | undefined) | undefined;
}

A field of the built-in editor.

KanbanEditorField members (6)
NameSignatureDescription
fieldreadonly field: string;
labelreadonly label: string;
kindoptionalreadonly kind?: 'text' | 'select' | 'number' | 'textarea' | undefined;
optionsoptionalreadonly options?: readonly { readonly value: KanbanKey; readonly label: string; }[] | undefined;

Options of a select field (default for the column and swimlane fields: the columns and lanes).

requiredoptionalreadonly required?: boolean | undefined;
validateoptionalreadonly validate?: ((value: unknown, draft: T) => string | null | undefined) | undefined;

Returns an error message, or nothing when the value is valid.