diff --git a/apps/web/src/app/features/masters/articulos/articulos.screens.ts b/apps/web/src/app/features/masters/articulos/articulos.screens.ts index d295792..1fc6e3a 100644 --- a/apps/web/src/app/features/masters/articulos/articulos.screens.ts +++ b/apps/web/src/app/features/masters/articulos/articulos.screens.ts @@ -148,6 +148,8 @@ export const ARTICULOS_SCREENS: readonly MasterScreen[] = [ key: 'ItemWarehouseInfoCollection', mode: 'replace', readonly: true, + hideEmptyBy: ['InStock', 'Committed', 'Ordered'], + hideEmptyLabel: 'Solo almacenes con stock, comprometido o pedido', identity: ['WarehouseCode'], columns: [ { key: 'WarehouseCode', title: 'Almacén', type: 'text', width: '110px' }, diff --git a/apps/web/src/app/features/masters/master-form.page.html b/apps/web/src/app/features/masters/master-form.page.html index 43767e6..dff1d05 100644 --- a/apps/web/src/app/features/masters/master-form.page.html +++ b/apps/web/src/app/features/masters/master-form.page.html @@ -45,6 +45,8 @@ [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.'" /> diff --git a/apps/web/src/app/features/masters/master-types.ts b/apps/web/src/app/features/masters/master-types.ts index 43c7a6f..b382edd 100644 --- a/apps/web/src/app/features/masters/master-types.ts +++ b/apps/web/src/app/features/masters/master-types.ts @@ -20,6 +20,9 @@ export interface MasterCollection { mode: 'replace' | 'merge'; /** Campo que identifica una fila en `merge` (`PriceList`). */ rowKey?: string; + /** Columnas numéricas por las que se ocultan las filas en 0, con una casilla marcada por defecto (solo con `readonly`). */ + hideEmptyBy?: readonly string[]; + hideEmptyLabel?: string; /** Solo se muestra (el stock por almacén). */ readonly?: boolean; /** Se pueden añadir y quitar filas (por defecto sí; no en `merge` ni en solo lectura). */ diff --git a/apps/web/src/app/shared/grid/rows-table.ts b/apps/web/src/app/shared/grid/rows-table.ts index 8ce887f..81b2396 100644 --- a/apps/web/src/app/shared/grid/rows-table.ts +++ b/apps/web/src/app/shared/grid/rows-table.ts @@ -22,6 +22,9 @@ const dateOnly = (v: unknown): string => (typeof v === 'string' ? v.slice(0, 10) changeDetection: ChangeDetectionStrategy.OnPush, imports: [ValueHelp], template: ` + @if (hideEmptyBy()) { + + }
| {{ i + 1 }} | @for (c of columns(); track c.key) { @@ -99,7 +102,7 @@ const dateOnly = (v: unknown): string => (typeof v === 'string' ? v.slice(0, 10)|
| {{ emptyText() }} | +{{ rows().length ? 'Ninguna fila cumple el filtro.' : emptyText() }} |