Overview
DataRepeater
wuic-data-repeater e il renderer archetype-driven: riceve un datasource e disegna list/edit/dialog/map/chart/tree/scheduler/carousel in base all'action.
Descrizione
- Converte
actionin archetype runtime (list,edit,detail,map,scheduler,spreadsheet,tree,chart,carousel). - Costruisce dinamicamente il componente figlio da renderizzare.
- Propaga al figlio gli input necessari (
datasource,record,field,hideToolbar, ...). - Emette evento quando il template e pronto.
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 }>
Proprieta pubbliche:
renderedArchetypeInstance: IDataBoundHostComponent | nullrenderedArchetypeViewChild: any(getter)getRenderedArchetypeViewChild<T>(): T | null
Note operative:
- Se
hardcodedActione valorizzato, ha priorita rispetto aaction. - In contesto edit route,
isEditFormviene forzato anche quando non passato esplicitamente. - Il repeater espone il viewchild logico del figlio via
renderedArchetypeViewChildegetRenderedArchetypeViewChild<T>(). fillHeighte un flag opt-in: quandotrue, il repeater forza la catena flex/min-height per riempire verticalmente il contenitore padre (utile nelle pagine custom con layout full-height).
Eventi comuni + accesso all'istanza archetype
Eventi relay aggiunti:
archetypeInstanceReady: emesso quando l'istanza del componente archetype e disponibile dopo il render.archetypeEvent: relay generico di tutti gli@Outputdell'archetype figlio.archetypeDataBound: sottoinsieme comune diarchetypeEvent, emesso quando il nome evento contieneDataBound.
Esempio host-side:
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) => {Esempi fillHeight
Uso standard (comportamento invariato):
Snippet 2HTML
<wuic-data-repeater
[hardcodedDatasource]="citiesDs"
[action]="action$">
</wuic-data-repeater>Uso in pagina custom full-height (log/pannelli sotto la 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;
}