TimeSelect Delivery time selection
A checkout-grade time picker: a date column on the start (N days from today, set by days) next to a time-slot grid. mode="express" (as soon as possible) picks the first available slot automatically; mode="schedule" lets users pick a date and a slot. The value contract is a JSON object { date, slot }.
Express (default)
In express mode the component picks the first available slot, so the host can read value directly. Slot data is injected through slots.
Default express mode
Scheduled delivery
mode="schedule" shows the date column and the slot grid. Clicking a date switches that day's slots; dates without any available slot are dimmed and skipped by keyboard navigation.
mode="schedule"
Closed and fully booked
The two unavailable meanings are visually distinct: closed (disabled) is dimmed and labelled "Closed"; fully booked (full) also gets a strikethrough label and a "Fully booked" badge. Both are native disabled buttons (also carrying aria-disabled), clicking them does not change the value, and keyboard navigation skips them.
Closed / fully booked
Disabled
disabled disables the whole control: mode buttons, dates and slots.
disabled
Keyboard and accessibility
- The date column is a
role="tablist"(vertical) ofrole="tab"buttons; the slot grid and the mode group arerole="radiogroup"ofrole="radio"buttons. Selection state is exposed througharia-selected/aria-checked. - All three regions use roving tabindex: exactly one Tab stop each. The mode group switches modes with left / right arrows (Home / End jump to the first / last mode); arrow keys move between available items (skipping closed, fully booked and unavailable dates), Home / End jump to the first / last available item, and left / right directions mirror under RTL.
- Date labels are formatted with
Intl.DateTimeFormat(locale aware), with relative labels for today / tomorrow; the grid's accessible name combines the group title with the active date.
Value contract
value is { date: 'YYYY-MM-DD', slot: 'key' }. Assigning an object property or writing JSON to the attribute both work and do not emit events; oas-change fires only when the user switches mode, date or slot. Express mode ignores a host-written value and always selects the first available slot.
Events and values
API
oas-time-select
Attributes
| Attribute | Description | Type | Default |
|---|---|---|---|
days | Number of days in the date column (N days from today; default 3, valid range 1–14; invalid values fall back and warn once) | number | string | — |
disabled | Disables the whole control: mode buttons, dates and slots | boolean | — |
mode | Delivery mode: express as soon as possible (default, auto-picks the first available slot) / schedule; invalid values fall back to express with a warning | string | express |
slots | Shared slot JSON array [{ key, label, disabled?, full? }]; string items collapse to key=label | string | — |
slots-override | Per-date slot overrides as a JSON object { "YYYY-MM-DD": [...] }; a matched date uses the override, and an empty array marks that date undeliverable | string | — |
start-date | First date as YYYY-MM-DD (defaults to today; lets hosts pin the dispatch day and tests pin a clock) | string | — |
value | Value JSON object { date, slot } where date is YYYY-MM-DD and slot is the slot key | TimeSelectValue | string | — |
Property (JS property; see each row for attribute reflection)
| Property | Description | Type | Default |
|---|---|---|---|
days | Number of days in the date column: get+set dual channel; assignment applies immediately without emitting events | number | string | — |
value | Current value: get+set dual channel (object or JSON string); assignment applies immediately without emitting events | TimeSelectValue | string | — |
Events
| Event | Description |
|---|---|
oas-change | Dispatched when the user switches mode, date or slot, with detail: { value, mode, date, slot } |