diff --git a/versions/1.0.md b/versions/1.0.md index d10146a..9a487be 100644 --- a/versions/1.0.md +++ b/versions/1.0.md @@ -744,7 +744,7 @@ widgets: ### view — calendar, range, slots -`view:` (with a `calendar:` / `slots:` descriptor) renders an entity as a time-based page instead of a table: +`view:` (with a `calendar:` / `slots:` descriptor) places an entity's records on a time surface: ```yaml - name: DayAllocation @@ -760,6 +760,36 @@ widgets: `view: calendar` is also expressible as the role alias `function: Calendar`. +#### A view adds a page + +`view: calendar`, `view: range` and `view: slots` **add** a page; they never take one away. The entity keeps the page family its structure already implies — a list, a master-detail, or a document editor — and the view joins it: + +| Route | Page | +| --- | --- | +| `/` | the calendar, or the slot picker | +| `//list` | the entity's own browse page (list / master / document list) | +| `//create`, `///edit` | the entity's own editor | + +Both browse pages offer a switch to the other, and choosing a day, an event or a free slot opens the entity's own editor. So a document master may be browsed on a calendar — or booked from a slot picker — and still be edited as a document, with its line items, printing and workflow tasks intact: declaring a view never costs an entity its editing surface. A picker is how a record is *created*; the list or document page is how it is worked with afterwards, and an author needs both. + +#### A document's line items on a calendar + +When the entity declaring `view: calendar` is a document's **line-items** child, the document's items pane *is* the calendar instead of the row grid — the shape for a day-grained line, such as a booked day or an allocated hour: + +```yaml +- name: Roster + function: Document +- name: RosterItem + function: DocumentItem + view: calendar + calendar: { start: day, title: Person } + fields: + - { name: day, type: date, required: true } + - { name: hours, type: decimal, precision: 18, scale: 2 } +``` + +The document keeps its header, totals and printing; only the items pane changes. Clicking an event edits that line, clicking an empty day adds one with that date filled in. A line-items child cannot be both a calendar and a chat thread (`documentItemsLayout: chat`) — the two claim the same pane, and declaring both is an error. + ### documentItemsLayout: chat — conversation threads A document master can render its line-items child as a chat thread (message bubbles + a composer) instead of an editable items table — support cases, tickets, comment threads. The header, status pill, workflow tasks and print stay as in a normal document: @@ -1148,7 +1178,7 @@ One line per construct, linking into the chapters above. | [`function: Attachment` / `Snapshot`](#attachments-and-snapshots) | a Files panel / immutable versioned printed copies | | [`forms`](#forms) | task data-entry pages | | [`actions`](#actions--custom-buttons) | developer-defined buttons opening custom pages | -| [`view`](#view--calendar-range-slots) | calendar / range / slot-booking pages | +| [`view`](#view--calendar-range-slots) | an additional calendar / range page, or a slot-booking page | | [`documentItemsLayout: chat`](#documentitemslayout-chat--conversation-threads) | render a document's items as a chat thread | | [`reports`](#reports) | aggregations, charts, dashboard KPI tiles, balance reports | | [`widgets`](#widgets--custom-dashboard-tiles) | custom KPI / embedded-page dashboard tiles |