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
actioninto 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: DataSourceComponentaction: BehaviorSubject<string>hardcodedAction: stringfield: MetadatiColonnarecord: anyrowCustomSelect: (rowData, $event, dt) => voidhideToolbar: booleanisEditForm: booleanfillHeight: boolean(defaultfalse)
Output:
templateReady: EventEmitter<string>archetypeInstanceReady: EventEmitter<{ archetype, instance }>archetypeEvent: EventEmitter<{ archetype, eventName, payload, instance }>archetypeDataBound: EventEmitter<{ archetype, eventName, payload, instance }>
Public properties:
renderedArchetypeInstance: IDataBoundHostComponent | nullrenderedArchetypeViewChild: any(getter)getRenderedArchetypeViewChild<T>(): T | null
Operational notes:
- If
hardcodedActionis set, it takes priority overaction. - In edit route context,
isEditFormis forced even when not explicitly passed. - The repeater exposes the logical viewchild of the child via
renderedArchetypeViewChildandgetRenderedArchetypeViewChild<T>(). fillHeightis an opt-in flag: whentrue, 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 ofarchetypeEvent, emitted when the event name containsDataBound.
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;
}