Interface IBuiltComponent
- Namespace
- BlazOrbit.Components
- Assembly
- BlazOrbit.Core.dll
Opt-in contract for components that contribute extra data-attributes and CSS custom properties
to the root <bob-component> element. Implementing this interface signals two things
to BOBComponentAttributesBuilder:
- The component participates in the
BuildComponent*hooks; the builder will call them on everyBuildStylesand on the volatile re-patch path. - The component opts out of the style-fingerprint cache. Hooks may read state opaque to the fingerprint (timers, derived counters, etc.), so the builder rebuilds on every parameter set instead of attempting to reuse a cached attribute set.
Invocation order: hooks are called before the framework writes its own
data-bob-* attributes and --bob-inline-* variables, so any key a component sets
that collides with a framework-owned key will be overwritten. The framework owns the contract
exposed by FeatureDefinitions; components may only contribute additional keys.
Default no-op virtuals live on BOBComponentBase and BOBInputComponentBase<TValue>;
declaring IBuiltComponent on a derived component is sufficient to opt in — the inherited
virtuals satisfy the interface contract until the component overrides one of them.
public interface IBuiltComponent
Methods
BuildComponentCssVariables(Dictionary<string, string>)
Contributes additional CSS custom properties to the inline style attribute. Keys
that collide with framework-owned --bob-inline-* variables will be overwritten.
void BuildComponentCssVariables(Dictionary<string, string> cssVariables)
Parameters
cssVariablesDictionary<string, string>
BuildComponentDataAttributes(Dictionary<string, object>)
Contributes additional data- attributes to the root element. Keys that collide
with framework-owned data-bob- attributes will be overwritten.
void BuildComponentDataAttributes(Dictionary<string, object> dataAttributes)
Parameters
dataAttributesDictionary<string, object>