IGroupProvide
interface
Group & Selection
Runtime injection provided by a group component to all its item descendants — exposes registration, selection control, navigation and the full item list.
TypeScript
Definition
The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.
API
Properties
Every property declared by this interface, with its type, optionality and default.
- registerrequired(item: IGroupItem, cmp: ComponentInternalInstance) => void
- Registers a new item in the group; called by each item on mount.
- unregisterrequired(id: number) => void
- Removes an item from the group by its numeric id; called on unmount.
- selectrequired(id: number, value: boolean) => void
- Sets the selected state of a specific item by id.
- selectedrequiredRef<Readonly<Array<number>>>
- Reactive list of currently selected item ids.
- isSelectedrequired(id: number) => boolean
- Returns true if the item with the given id is currently selected.
- prevrequired() => number | undefined
- Selects the previous item in registration order (wraps around).
- nextrequired() => number | undefined
- Selects the next item in registration order (wraps around).
- selectedClassrequiredRef<string | undefined>
- CSS class applied to selected items, reactive to the group-level prop.
- itemsrequiredComputedRef<Array<{ id: number value: unknown disabled: boolean | undefined domId?: string }>>
- Computed list of all registered items with their id, value and disabled state.
- disabledrequiredRef<boolean | undefined>
- Whether the entire group is disabled.
- getItemIndexrequired(value: unknown) => number
- Returns the registration index of the item whose value matches the argument, or -1.
Usage
Examples
Ready-to-paste code snippets using this interface.
Injecting the group provide in an item component