Skip to main content

select-event

Selects an event for editing, or clears the selection when id is null. The store looks up the stored event by public id, decodes occurrence context from rawId (falling back to id), and builds the structured editorData state that drives the editor. The editor opens automatically when an id resolves to an event.

Usage

type SelectEventPayload = {
id: EventID | null;
rawId?: EventID | null;
mode?: "series" | "single" | "following" | null;
};
type EventID = string | number;
FieldTypeDescription
idstring | number | nullPublic event id to select, or null to clear the selection.
rawIdstring | number | nullRendered identifier carrying occurrence context; falls back to id when omitted, as for programmatic calls.
mode"series" | "single" | "following" | nullEdit scope. Omitting it defaults to "single" for a stored exception (masterEventId present) and "series" otherwise.

Mode values:

  • "series" - edits the recurring master.
  • "single" - edits one occurrence with recurrence controls hidden.
  • "following" - edits the occurrence with recurrence controls shown.

Selection builds editorData, the state the editor reads:

type EditorData = {
id: EventID;
values: CalendarEvent;
rawId: EventID;
recurring: boolean;
recurringMode: "series" | "single" | "following";
recurringOriginalDate: string | null;
};

When the id does not resolve to an event, state is left unchanged.

Trigger

api.exec("select-event", { id: 42 });

Observe

api.on("select-event", p => console.log("selected:", p.id));

Intercept

api.intercept("select-event", p => p.id !== "locked");

Component handler

<Calendar onSelectEvent={p => console.log("selected:", p.id)} />
  • update-event — saves changes after the editor edits.
  • Editor — companion that listens for editorData.
  • eventPopup — overrides the default click-to-select path.
  • Editing — full editor wiring.