packages/components/eui-card/services/ui-state.service.ts
Service for managing UI state of card components including collapse, urgency, and expander positioning. Provides reactive state management through RxJS observables for card component behavior. Injected at component level to maintain isolated state per card instance. Manages collapsible state, collapsed state, urgent styling, and left expander positioning.
Methods |
|
Accessors |
| setState | ||||||
setState(nextState: UIState)
|
||||||
|
Updates the UI state with provided properties. Merges the next state with current state, preserving unchanged properties.
Parameters :
Returns :
void
|
| Public toggleCollapsed |
toggleCollapsed()
|
|
Toggles the collapsed state of the card. Switches between collapsed and expanded states.
Returns :
void
|
| state$ |
getstate$()
|
|
Observable stream of UI state changes. Emits whenever any state property is updated via setState or setters.
Returns :
Observable<UIState>
|
| state |
getstate()
|
|
Current UI state snapshot. Returns the current state value without subscribing to changes.
Returns :
UIState
|
| isCollapsed | ||||||
setisCollapsed(isActive: boolean)
|
||||||
|
Sets the collapsed state of the card. When true, card content is hidden; when false, content is visible.
Parameters :
Returns :
void
|
| isCollapsible | ||||||
setisCollapsible(isActive: boolean)
|
||||||
|
Sets whether the card is collapsible. When true, enables collapse/expand functionality; when false, card remains static.
Parameters :
Returns :
void
|