76 lines
3.3 KiB
HTML
76 lines
3.3 KiB
HTML
<sbo-toolbar bleed aria-label="Acciones del registro">
|
|
<a class="tb" routerLink=".." title="Volver a la lista"><sbo-icon name="find" />Lista</a>
|
|
@if (creatable) {
|
|
<a class="tb" [routerLink]="isNew() ? '.' : '../nuevo'" title="Registro nuevo"><sbo-icon name="new" />Nuevo</a>
|
|
}
|
|
<span class="tb-sep"></span>
|
|
<button class="tb" type="button" aria-label="Primero" (click)="go('first')"><sbo-icon name="first" /></button>
|
|
<button class="tb" type="button" aria-label="Anterior" (click)="go('prev')"><sbo-icon name="prev" /></button>
|
|
<button class="tb" type="button" aria-label="Siguiente" (click)="go('next')"><sbo-icon name="next" /></button>
|
|
<button class="tb" type="button" aria-label="Último" (click)="go('last')"><sbo-icon name="last" /></button>
|
|
</sbo-toolbar>
|
|
|
|
<sbo-window [title]="windowTitle()" [badge]="badge()" [status]="status()">
|
|
<div class="split" [class.two]="layout.chartTree">
|
|
<div class="left">
|
|
<div class="sbo-hdr">
|
|
<div class="sbo-col">
|
|
@for (f of layout.header.left; track $index) {
|
|
<sbo-master-field [field]="f" [value]="value(keyOf(f))" [saved]="!isNew()" [readOnly]="locked(keyOf(f))" (changed)="setValue(keyOf(f), $event)" />
|
|
}
|
|
</div>
|
|
<div class="sbo-col">
|
|
@for (f of layout.header.right; track $index) {
|
|
<sbo-master-field [field]="f" [value]="value(keyOf(f))" [saved]="!isNew()" [readOnly]="locked(keyOf(f))" (changed)="setValue(keyOf(f), $event)" />
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
<sbo-tabs ariaLabel="Datos del registro">
|
|
@for (tab of layout.tabs; track tab.id) {
|
|
<sbo-tab [label]="tab.label">
|
|
<div class="sbo-hdr">
|
|
<div class="sbo-col">
|
|
@for (f of tab.left; track $index) {
|
|
<sbo-master-field [field]="f" [value]="value(keyOf(f))" [saved]="!isNew()" [readOnly]="locked(keyOf(f))" (changed)="setValue(keyOf(f), $event)" />
|
|
}
|
|
</div>
|
|
<div class="sbo-col">
|
|
@for (f of tab.right; track $index) {
|
|
<sbo-master-field [field]="f" [value]="value(keyOf(f))" [saved]="!isNew()" [readOnly]="locked(keyOf(f))" (changed)="setValue(keyOf(f), $event)" />
|
|
}
|
|
</div>
|
|
</div>
|
|
@if (tab.collection; as c) {
|
|
<sbo-rows-table
|
|
[columns]="c.columns"
|
|
[rows]="rowsOf(c)"
|
|
(rowsChange)="setRows(c, $event)"
|
|
[readonly]="!!c.readonly"
|
|
[hideEmptyBy]="c.readonly ? (c.hideEmptyBy ?? null) : null"
|
|
[hideEmptyLabel]="c.hideEmptyLabel ?? 'Ocultar las filas en 0'"
|
|
[removable]="growable(c)"
|
|
[emptyText]="c.readonly ? 'Sin datos.' : 'Sin filas.'"
|
|
/>
|
|
@if (growable(c)) {
|
|
<p class="addrow"><button type="button" class="btn" (click)="addRow(c)">{{ c.addLabel ?? '+ Añadir fila' }}</button></p>
|
|
}
|
|
}
|
|
</sbo-tab>
|
|
}
|
|
</sbo-tabs>
|
|
</div>
|
|
@if (layout.chartTree) {
|
|
<sbo-chart-tree-panel [selected]="groupCode()" />
|
|
}
|
|
</div>
|
|
|
|
<button sboActions class="btn main" type="button" [disabled]="saving() || loading()" (click)="save()">
|
|
{{ isNew() ? 'Crear' : 'Actualizar' }}
|
|
</button>
|
|
@if (conflict()) {
|
|
<button sboActions class="btn" type="button" (click)="reload()">Recargar</button>
|
|
}
|
|
<a sboActions class="btn" routerLink="..">Cancelar</a>
|
|
</sbo-window>
|