View as Markdown

API reference: @salmonui/scheduler

SchedulerResourceinterface

import type { SchedulerResource } from '@salmonui/scheduler';
interface SchedulerResource<Item = Record<string, unknown>> {
    readonly field: string;
    readonly name: string;
    readonly label?: string;
    readonly data: readonly Item[];
    readonly idField?: string;
    readonly textField?: string;
    readonly colorField?: string;
    readonly parentIdField?: string;
    readonly workDaysField?: string;
    readonly startHourField?: string;
    readonly endHourField?: string;
    readonly classNameField?: string;
    readonly expandedField?: string;
    readonly multiple?: boolean;
}

A resource definition: the items an event field refers to. Field options name the item properties.

SchedulerResource members (14)
NameSignatureDescription
fieldreadonly field: string;

The event property that holds the item id (or ids with multiple).

namereadonly name: string;

Name used by grouping.resources.

labeloptionalreadonly label?: string;

Editor field label (default name).

datareadonly data: readonly Item[];
idFieldoptionalreadonly idField?: string;

Item properties (defaults id, text, color, parentId, workDays, startHour, endHour, className, expanded).

textFieldoptionalreadonly textField?: string;
colorFieldoptionalreadonly colorField?: string;
parentIdFieldoptionalreadonly parentIdField?: string;
workDaysFieldoptionalreadonly workDaysField?: string;
startHourFieldoptionalreadonly startHourField?: string;
endHourFieldoptionalreadonly endHourField?: string;
classNameFieldoptionalreadonly classNameField?: string;
expandedFieldoptionalreadonly expandedField?: string;
multipleoptionalreadonly multiple?: boolean;

An event may refer to several items (the field holds an array).