Skip to content

Kanban Card Editor Dialog

HTMLRevoGridElement (Extended from global)

Section titled “HTMLRevoGridElement (Extended from global)”
interface HTMLRevoGridElement {
kanbanCardEditorDialog?: KanbanCardEditorDialogOptions | false;
'kanban-card-editor-dialog'?: KanbanCardEditorDialogOptions | false
}

HTMLRevoGridElementEventMap (Extended from global)

Section titled “HTMLRevoGridElementEventMap (Extended from global)”
interface HTMLRevoGridElementEventMap {
[BEFORE_KANBAN_CARD_EDITOR_VALIDATE_EVENT]: KanbanCardEditorValidationStartDetail;
[BEFORE_KANBAN_CARD_EDITOR_FIELD_VALIDATE_EVENT]: KanbanCardEditorBeforeFieldValidationDetail;
[KANBAN_CARD_EDITOR_FIELD_VALIDATE_EVENT]: KanbanCardEditorFieldValidationDetail;
[KANBAN_CARD_EDITOR_VALIDATE_EVENT]: KanbanCardEditorValidationCompleteDetail;
[KANBAN_CARD_EDITOR_INVALID_EVENT]: KanbanCardEditorValidationCompleteDetail
}
  • Required KanbanPlugin: Uses Kanban canonical data, permissions, rules, events, and history-backed CRUD methods.
kanbanCardEditorDialogDependencies: PluginDependency[];

class KanbanCardEditorDialogPlugin {
open(request: KanbanCardEditorOpenRequest<T>): void;
close(): void;
async validate(): Promise<KanbanCardEditorValidationResult>;
}

export type KanbanCardEditorMode = 'create' | 'edit';

export type KanbanCardEditorFieldKind =
| 'text' | 'textarea' | 'number' | 'select' | 'multiselect' | 'tags'
| 'checkbox' | 'date' | 'datetime' | 'color' | 'assignees' | 'custom';

interface KanbanCardEditorOption {
readonly value: string | number;
readonly label: string;
readonly avatar?: unknown;
readonly disabled?: boolean
}

interface KanbanCardEditorFieldContext {
readonly grid: HTMLRevoGridElement;
readonly mode: KanbanCardEditorMode;
readonly card: T | null;
readonly draft: T;
readonly field: KanbanCardEditorField<T>
}

interface KanbanCardEditorFieldRendererLifecycle {
update?(context: KanbanCardEditorFieldRendererContext<T>): void;
destroy?(): void
}

KanbanCardEditorFieldRendererContext (Extended from index.tsx)

Section titled “KanbanCardEditorFieldRendererContext (Extended from index.tsx)”
interface KanbanCardEditorFieldRendererContext {
readonly value: unknown;
readonly error?: string;
readonly disabled: boolean;
readonly setValue: (value: unknown) => void
}

interface KanbanCardEditorDomRenderer {
mount(container: HTMLElement, context: KanbanCardEditorRendererContext<T>): void | KanbanCardEditorRendererLifecycle<T>
}

interface KanbanCardEditorRendererLifecycle {
update?(context: KanbanCardEditorRendererContext<T>): void;
destroy?(): void
}

interface KanbanCardEditorFieldDomRenderer {
mount(container: HTMLElement, context: KanbanCardEditorFieldRendererContext<T>): void | KanbanCardEditorFieldRendererLifecycle<T>
}

interface KanbanCardEditorField {
readonly id: string;
readonly label?: string;
readonly kind?: KanbanCardEditorFieldKind;
readonly field?: ColumnProp;
readonly icon?: string;
readonly order?: number;
readonly hidden?: boolean | ((context: KanbanCardEditorFieldContext<T>) => boolean);
readonly fullWidth?: boolean;
readonly defaultValue?: unknown | ((context: Omit<KanbanCardEditorFieldContext<T>, 'field'>) => unknown);
readonly options?: readonly KanbanCardEditorOption[] | ((context: KanbanCardEditorFieldContext<T>) => readonly KanbanCardEditorOption[]);
readonly placeholder?: string;
readonly readonly?: boolean | ((context: KanbanCardEditorFieldContext<T>) => boolean);
readonly required?: boolean;
readonly read?: (card: T, context: KanbanCardEditorFieldContext<T>) => unknown;
readonly write?: (value: unknown, card: T, context: KanbanCardEditorFieldContext<T>) => Partial<T>;
readonly format?: (value: unknown, context: KanbanCardEditorFieldContext<T>) => unknown;
readonly parse?: (value: unknown, context: KanbanCardEditorFieldContext<T>) => unknown;
readonly validate?: (value: unknown, context: KanbanCardEditorFieldContext<T>) => string | void | Promise<string | void>;
readonly renderer?: KanbanCardEditorFieldDomRenderer<T>
}

export type KanbanCardEditorValidationReason = 'submit' | 'manual';

export type KanbanCardEditorValidationErrors = Readonly<Record<string, string>>;

export type KanbanCardEditorFieldValidationStatus =
| 'valid'
| 'invalid'
| 'skipped'
| 'cancelled';

interface KanbanCardEditorValidationContext {
readonly grid: HTMLRevoGridElement;
readonly mode: KanbanCardEditorMode;
readonly card: T | null;
readonly draft: T;
readonly fields: readonly KanbanCardEditorField<T>[];
readonly reason: KanbanCardEditorValidationReason
}

interface KanbanCardEditorValidationResult {
readonly valid: boolean;
readonly cancelled: boolean;
readonly errors: KanbanCardEditorValidationErrors
}

KanbanCardEditorValidationStartDetail (Extended from index.tsx)

Section titled “KanbanCardEditorValidationStartDetail (Extended from index.tsx)”
interface KanbanCardEditorValidationStartDetail {
readonly errors: Record<string, string>;
readonly setError: (fieldId: string, error?: string) => void
}

KanbanCardEditorBeforeFieldValidationDetail (Extended from index.tsx)

Section titled “KanbanCardEditorBeforeFieldValidationDetail (Extended from index.tsx)”
interface KanbanCardEditorBeforeFieldValidationDetail {
readonly field: KanbanCardEditorField<T>;
readonly value: unknown;
error?: string;
readonly setError: (error?: string) => void
}

KanbanCardEditorFieldValidationDetail (Extended from index.tsx)

Section titled “KanbanCardEditorFieldValidationDetail (Extended from index.tsx)”
interface KanbanCardEditorFieldValidationDetail {
readonly field: KanbanCardEditorField<T>;
readonly value: unknown;
readonly error?: string;
readonly status: KanbanCardEditorFieldValidationStatus
}

KanbanCardEditorValidationCompleteDetail (Extended from index.tsx)

Section titled “KanbanCardEditorValidationCompleteDetail (Extended from index.tsx)”
interface KanbanCardEditorValidationCompleteDetail {
readonly result: KanbanCardEditorValidationResult
}

export type KanbanCardEditorFormValidationResult =
| string
| KanbanCardEditorValidationErrors
| void;

export type KanbanCardEditorFormValidator<T extends DataType = DataType> = (
context: KanbanCardEditorValidationContext<T>,
) => KanbanCardEditorFormValidationResult | Promise<KanbanCardEditorFormValidationResult>;

interface KanbanCardEditorDraftState {
readonly mode: KanbanCardEditorMode;
readonly card: T | null;
readonly draft: T;
readonly dirty: boolean;
readonly pending: boolean;
readonly errors: Readonly<Record<string, string>>
}

interface KanbanCardEditorDraftController {
getState(): KanbanCardEditorDraftState<T>;
setValue(fieldId: string, value: unknown): void;
setDraft(patch: Partial<T>): void;
setErrors(errors: Readonly<Record<string, string>>): void;
reset(): void;
close(): void;
validate(): Promise<KanbanCardEditorValidationResult>;
submit(): void;
delete(): void
}

interface KanbanCardEditorRendererContext {
readonly grid: HTMLRevoGridElement;
readonly open: boolean;
readonly fields: readonly KanbanCardEditorField<T>[];
readonly state: KanbanCardEditorDraftState<T>;
readonly controller: KanbanCardEditorDraftController<T>
}

interface KanbanCardEditorSubmitContext {
readonly grid: HTMLRevoGridElement;
readonly mode: KanbanCardEditorMode;
readonly card: T | null;
readonly draft: T;
readonly result?: KanbanMutationResult<T>
}

interface KanbanCardEditorDeleteContext {
readonly grid: HTMLRevoGridElement;
readonly cards: readonly T[];
readonly cardIds: readonly KanbanCardId[]
}

interface KanbanCardEditorDialogOptions {
readonly fields?: readonly KanbanCardEditorField<T>[];
readonly hiddenFields?: readonly string[];
readonly fieldOrder?: readonly string[];
readonly createDraft?: (context: { readonly grid: HTMLRevoGridElement; readonly request: KanbanCardRequestDetail<T> }) => Partial<T> | Promise<Partial<T>>;
readonly createCardId?: (context: { readonly grid: HTMLRevoGridElement; readonly cards: readonly T[] }) => KanbanCardId | Promise<KanbanCardId>;
readonly validate?: KanbanCardEditorFormValidator<T>;
readonly onSubmit?: (context: KanbanCardEditorSubmitContext<T>) => boolean | void | Promise<boolean | void>;
readonly onDelete?: (context: KanbanCardEditorDeleteContext<T>) => boolean | void | Promise<boolean | void>;
readonly confirmDelete?: boolean | ((context: KanbanCardEditorDeleteContext<T>) => boolean | Promise<boolean>);
readonly confirmDiscard?: boolean | ((state: KanbanCardEditorDraftState<T>) => boolean | Promise<boolean>);
readonly customization?: { readonly editor?: KanbanCardEditorDomRenderer<T> };
readonly labels?: Partial<KanbanCardEditorLabels>
}

interface KanbanCardEditorLabels {
readonly newCard: string;
readonly untitledCard: string;
readonly cancel: string;
readonly save: string;
readonly delete: string;
readonly close: string;
readonly deleteConfirm: string;
readonly discardConfirm: string;
readonly required: string;
readonly validationSummary: string
}

interface KanbanCardEditorOpenRequest {
readonly mode: KanbanCardEditorMode;
readonly card?: T;
readonly cardId?: KanbanCardId;
readonly cardIds?: readonly KanbanCardId[];
readonly columnProp?: KanbanColumnProp;
readonly swimlaneId?: KanbanSwimlaneId;
readonly request?: KanbanCardRequestDetail<T>
}

export function resolveKanbanCardEditorFields<T extends DataType>(
config: ResolvedKanbanConfig<T>,
options: KanbanCardEditorDialogOptions<T> = {},
): readonly KanbanCardEditorField<T>[];

export function createKanbanCardId<T extends DataType>(cards: readonly T[], idField: ColumnProp): string;

export function KanbanCardEditorDialog<T extends DataType>(props: KanbanCardEditorDialogProps<T>);

interface KanbanCardEditorDialogProps {
readonly grid: HTMLRevoGridElement;
readonly fields: readonly KanbanCardEditorField<T>[];
readonly state: KanbanCardEditorDraftState<T>;
readonly labels: KanbanCardEditorLabels;
readonly onValue: (field: KanbanCardEditorField<T>, value: unknown) => void;
readonly onClose: () => void;
readonly onSubmit: () => void;
readonly onDelete: () => void
}

Runs the shared packaged/replacement-editor validation and event pipeline.

export async function validateKanbanCardEditor<T extends DataType>(
options: ValidateKanbanCardEditorOptions<T>,
): Promise<KanbanCardEditorValidationResult>;

BEFORE_KANBAN_CARD_EDITOR_VALIDATE_EVENT: string;

BEFORE_KANBAN_CARD_EDITOR_FIELD_VALIDATE_EVENT

Section titled “BEFORE_KANBAN_CARD_EDITOR_FIELD_VALIDATE_EVENT”
BEFORE_KANBAN_CARD_EDITOR_FIELD_VALIDATE_EVENT: string;

KANBAN_CARD_EDITOR_FIELD_VALIDATE_EVENT: string;

KANBAN_CARD_EDITOR_VALIDATE_EVENT: string;

KANBAN_CARD_EDITOR_INVALID_EVENT: string;

interface KanbanCardEditorValidationEvent {
readonly defaultPrevented: boolean
}

interface ValidateKanbanCardEditorOptions {
readonly grid: HTMLRevoGridElement;
readonly mode: KanbanCardEditorValidationContext<T>['mode'];
readonly card: T | null;
readonly draft: T;
readonly fields: readonly KanbanCardEditorField<T>[];
readonly reason: KanbanCardEditorValidationReason;
readonly requiredMessage: string;
readonly validateForm?: KanbanCardEditorFormValidator<T>;
readonly emit: (eventName: string, detail: unknown) => KanbanCardEditorValidationEvent
}

Adds board-backed options only when an assignee field has no explicit source.

export function withKanbanCardEditorAssigneeOptions<T extends DataType>({
cards,
config,
fields,
}: KanbanCardEditorAssigneeFieldOptions<T>): readonly KanbanCardEditorField<T>[];

Builds a stable, de-duplicated resource catalog from canonical Kanban cards.

export function resolveKanbanCardEditorAssigneeOptions<T extends DataType>({
cards,
config,
}: KanbanCardEditorAssigneeCatalogOptions<T>): readonly KanbanCardEditorOption[];

Keeps selected mapped values visible even before an application supplies a catalog.

export function resolveKanbanCardEditorAssigneeResources(
options: readonly KanbanCardEditorOption[],
value: unknown,
): readonly KanbanCardEditorOption[];

export function KanbanCardEditorCustomField<T extends DataType>(
props: KanbanCardEditorCustomFieldProps<T>,
);

KanbanCardEditorCustomFieldProps (Extended from kanban-card-editor-custom-field.tsx)

Section titled “KanbanCardEditorCustomFieldProps (Extended from kanban-card-editor-custom-field.tsx)”
interface KanbanCardEditorCustomFieldProps {
readonly value: unknown;
readonly disabled: boolean
}

export function KanbanCardEditorDialogHeader<T extends DataType>(
props: KanbanCardEditorDialogHeaderProps<T>,
);

export function KanbanCardEditorValidationMessage<T extends DataType>(
props: KanbanCardEditorDialogProps<T>,
);

export function KanbanCardEditorDialogBody<T extends DataType>(
props: KanbanCardEditorDialogProps<T>,
);

export function KanbanCardEditorDialogFooter<T extends DataType>(
props: KanbanCardEditorDialogProps<T>,
);

KanbanCardEditorFieldProps (Extended from kanban-card-editor-dialog.props.ts)

Section titled “KanbanCardEditorFieldProps (Extended from kanban-card-editor-dialog.props.ts)”
interface KanbanCardEditorFieldProps {
readonly field: KanbanCardEditorField<T>
}

export function createKanbanEditorFieldContext<T extends DataType>(
field: KanbanCardEditorField<T>,
props: KanbanCardEditorDialogProps<T>,
): KanbanCardEditorFieldContext<T>;

export function readKanbanEditorFieldValue<T extends DataType>(
field: KanbanCardEditorField<T>,
props: KanbanCardEditorDialogProps<T>,
): unknown;

export function isKanbanEditorFieldReadonly<T extends DataType>(
field: KanbanCardEditorField<T>,
props: KanbanCardEditorDialogProps<T>,
): boolean;

export function isKanbanEditorFieldVisible<T extends DataType>(
field: KanbanCardEditorField<T>,
props: KanbanCardEditorDialogProps<T>,
): boolean;

export function displayKanbanEditorFieldValue<T extends DataType>(
value: unknown,
field: KanbanCardEditorField<T>,
): string;

export function kanbanEditorInputType(kind: KanbanCardEditorField['kind']): string;

export function toKanbanEditorValueArray(value: unknown): readonly unknown[];

export function resolveKanbanEditorOptionValue(
options: readonly { readonly value: string | number }[],
value: string,
): string | number;

export function KanbanCardEditorFieldControl<T extends DataType>(
props: KanbanCardEditorFieldControlProps<T>,
);

KanbanCardEditorFieldControlProps (Extended from kanban-card-editor-field-control.tsx)

Section titled “KanbanCardEditorFieldControlProps (Extended from kanban-card-editor-field-control.tsx)”
interface KanbanCardEditorFieldControlProps {
readonly value: unknown;
readonly disabled: boolean;
readonly options: readonly KanbanCardEditorOption[];
readonly error?: string;
readonly errorId?: string;
readonly labelId: string
}

export function KanbanCardEditorFieldRow<T extends DataType>(
props: KanbanCardEditorFieldProps<T>,
);