Overview

DataRepeater

wuic-data-repeater is the archetype-driven renderer: it receives a datasource and draws list/edit/dialog/map/chart/tree/scheduler/carousel based on the action.

Description

  • Converts action into a runtime archetype (list, edit, detail, map, scheduler, spreadsheet, tree, chart, carousel).
  • Dynamically constructs the child component to render.
  • Propagates necessary inputs to the child (datasource, record, field, hideToolbar, ...).
  • Emits an event when the template is ready.

API

Selector:

  • wuic-data-repeater

Input:

  • datasource: BehaviorSubject<DataSourceComponent>
  • hardcodedDatasource: DataSourceComponent
  • action: BehaviorSubject<string>
  • hardcodedAction: string
  • field: MetadatiColonna
  • record: any
  • rowCustomSelect: (rowData, $event, dt) => void
  • hideToolbar: boolean
  • isEditForm: boolean
  • fillHeight: boolean (default false)

Output:

  • templateReady: EventEmitter<string>
  • archetypeInstanceReady: EventEmitter<{ archetype, instance }>
  • archetypeEvent: EventEmitter<{ archetype, eventName, payload, instance }>
  • archetypeDataBound: EventEmitter<{ archetype, eventName, payload, instance }>

Public properties:

  • renderedArchetypeInstance: IDataBoundHostComponent | null
  • renderedArchetypeViewChild: any (getter)
  • getRenderedArchetypeViewChild<T>(): T | null

Operational notes:

  • If hardcodedAction is set, it takes priority over action.
  • In edit route context, isEditForm is forced even when not explicitly passed.
  • The repeater exposes the logical viewchild of the child via renderedArchetypeViewChild and getRenderedArchetypeViewChild<T>().
  • fillHeight is an opt-in flag: when true, the repeater forces the flex/min-height chain to vertically fill the parent container (useful in custom pages with full-height layout).

Common Events + Archetype Instance Access

Added relay events:

  • archetypeInstanceReady: emitted when the archetype component instance is available after rendering.
  • archetypeEvent: generic relay of all child archetype @Outputs.
  • archetypeDataBound: common subset of archetypeEvent, emitted when the event name contains DataBound.

Host-side example:

Snippet 1ts
@ViewChild(DataRepeaterComponent) repeater?: DataRepeaterComponent;
private readonly subs = new Subscription();

ngAfterViewInit(): void {
  if (!this.repeater) return;

  this.subs.add(this.repeater.archetypeInstanceReady.subscribe((e) => {

fillHeight Examples

Standard usage (behavior unchanged):

Snippet 2HTML
<wuic-data-repeater
  [hardcodedDatasource]="citiesDs"
  [action]="action$">
</wuic-data-repeater>

Usage in custom full-height page (log/panels below the grid):

Snippet 3HTML
<div class="repeater-shell">
  <wuic-data-repeater
    [hardcodedDatasource]="citiesDs"
    [action]="action$"
    [fillHeight]="true">
  </wuic-data-repeater>
</div>
Snippet 4CSS
.repeater-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}