AbstractDashboardComponent
Shared mount/handle plumbing for the dashboard primitive family (shell, topbar, sidebar, panel, grid, metric card, data table, …): concrete subclasses only implement {@see contract()} and, optionally, {@see initialData()} / {@see meta()} to describe their own props — this base class owns wiring {@see \Milpa\Live\Events\LiveEventEmitter}'s mounting/handling emit points and the default "no actions" `handle()`.
AbstractDashboardComponent::__construct()
public function __construct(?Milpa\Interfaces\Event\MilpaEventDispatcherInterface $dispatcher = null):Parameters
| Name | Type | Description |
|---|---|---|
| $dispatcher | ?Milpa\Interfaces\Event\MilpaEventDispatcherInterface |
AbstractDashboardComponent::contract()
abstract public static function contract(): Milpa\Live\ValueObjects\ComponentContractThe subclass's runtime contract (name, props/state schema, actions).
AbstractDashboardComponent::mount()
public function mount(array $props, Milpa\Live\ValueObjects\ComponentContext $context): Milpa\Live\ValueObjects\StateSnapshotBuilds the initial state from {@see initialData()} (the `data` half) and {@see meta()} merged with common `id`/`title`/`route`/`principal` meta (the `meta` half).
Parameters
| Name | Type | Description |
|---|---|---|
| $props | array<string, mixed> | |
| $context | Milpa\Live\ValueObjects\ComponentContext |
AbstractDashboardComponent::handle()
public function handle(Milpa\Live\ValueObjects\InteractionRequest $request): Milpa\Live\ValueObjects\InteractionResultThe default dashboard primitive `handle()`: none of these primitives declare actions, so every call reports an unrecognized-action error via {@see InteractionResult::$errors}. A subclass that does need actions (e.g. {@see DataTableComponent}) overrides this method entirely.
Parameters
| Name | Type | Description |
|---|---|---|
| $request | Milpa\Live\ValueObjects\InteractionRequest |