/** * How `sink` is applied on {@link KUBARenderElement}, within its `on` * attribute. */ type KUBARenderOnAttributeSink = 'method' | 'attribute' | 'setter' /** * Shape of the `on` attribute of {@link KUBARenderElement} — an arc string * in the form `source/event:type/sink`, optionally followed by one or more * `|filter=value` pairs. Inherited from the `Echo` mixin. * * This only constrains the shape (the four `/`/`:`-separated segments and * the `type` segment); `source`, `event`, `sink`, and filter contents remain * free-form strings, since TypeScript cannot validate the full grammar (e.g. * arbitrary characters, filter repetition) through a template literal type. * The check only applies to string literals — a value assigned from a plain * `string` variable falls back to unchecked `string`. */ type KUBARenderOnAttribute = `${string}/${string}:${KUBARenderOnAttributeSink}/${string}${'' | `|${string}`}` /** * Custom element (``) that renders its shadow DOM content by * interpolating a template against arbitrary data, supplied via * `render()`. Also an Echo host: its `on` attribute can wire `render()` to * another element's event (e.g. re-rendering whenever a data source * dispatches a `change` event), so updates happen declaratively without a * manual event listener. * * @remarks * The `layout` attribute (`'list'` | `'grid'`) is purely a styling hook — * `'list'` stacks the host's slotted content in a single flex column, * `'grid'` arranges it in a two-column grid — read only via CSS * (`:host([layout="grid"])` in `style.js`). No mixin in the chain reflects * it to a JS property, so it has no corresponding member on this class. * * @example * ```html * * * * * * ``` */ export default class KUBARenderElement extends HTMLElement { /** * Accessible name, published as the default `aria-label` through * `ElementInternals` (reflects the `alt` attribute). Inherited from the * `Identity` mixin. Rarely needed here: the host carries `role="none"`, * so the rendered items — not the box — are what a screen reader * announces. * @default '' */ alt: string /** * Whether the host is hidden (reflects the `hidden` attribute). * Inherited from the `Hidden` mixin. The attribute value `"false"` or * `"0"` (or the attribute being absent) reads as `false`; any other * value — including `""`, as in `