/** * 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. * * @example * ```html * * * * * * ``` */ export default class KUBARenderElement extends HTMLElement { /** * Layout used for the host's slotted content: `'list'` stacks it in a * single flex column, `'grid'` arranges it in a two-column grid. * Reflects the `layout` attribute. * @default 'list' */ layout: 'list' | 'grid' /** * Id reference to a `