@@ -65,6 +69,12 @@ let nextId = 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
}
+ .db {
+ display: block;
+ margin-top: -2px;
+ font: 10.5px/1.2 var(--mono, monospace);
+ color: var(--quiet);
+ }
label.link {
cursor: pointer;
}
@@ -83,7 +93,10 @@ let nextId = 0;
`,
})
export class SboField {
+ protected readonly names = inject(FieldNames);
readonly label = input.required
();
+ /** Nombre del campo de SAP; sale como ayuda del cursor y, con «Ver campos», debajo de la etiqueta. */
+ readonly dbName = input();
readonly required = input(false, { transform: booleanAttribute });
readonly action = input(false, { transform: booleanAttribute });
/** La etiqueta es un enlace (ej. abrir el socio de negocio). */
diff --git a/apps/web/src/app/shared/grid/lines-grid.css b/apps/web/src/app/shared/grid/lines-grid.css
index c1b93b5..e080afe 100644
--- a/apps/web/src/app/shared/grid/lines-grid.css
+++ b/apps/web/src/app/shared/grid/lines-grid.css
@@ -151,3 +151,10 @@ tr.none td {
position: absolute;
left: -9999px;
}
+
+th .db {
+ display: block;
+ font: 10.5px/1.2 var(--mono, monospace);
+ font-weight: 400;
+ color: var(--quiet);
+}
diff --git a/apps/web/src/app/shared/grid/lines-grid.html b/apps/web/src/app/shared/grid/lines-grid.html
index 7e41d0e..e2e1b81 100644
--- a/apps/web/src/app/shared/grid/lines-grid.html
+++ b/apps/web/src/app/shared/grid/lines-grid.html
@@ -15,7 +15,9 @@
| # |
@for (c of columns(); track c.key; let j = $index) {
- {{ c.title }} |
+ {{ c.title }}@if (names.show()) {
+ {{ c.key }}
+ } |
@if (hasDetails() && j === detailAt()) {
Lotes / Series |
}
diff --git a/apps/web/src/app/shared/grid/lines-grid.ts b/apps/web/src/app/shared/grid/lines-grid.ts
index 8b3d60d..f5cd035 100644
--- a/apps/web/src/app/shared/grid/lines-grid.ts
+++ b/apps/web/src/app/shared/grid/lines-grid.ts
@@ -12,6 +12,7 @@ import {
output,
signal,
} from '@angular/core';
+import { FieldNames } from '../../core/field-names';
import { formatNumber, parseDecimal } from '../../core/format';
import { SlLookupApi } from '../../core/sl/sl-lookup';
import type { ListRow } from '../list/list.types';
@@ -57,6 +58,7 @@ export class LinesGrid {
private readonly host = inject>(ElementRef);
private readonly injector = inject(Injector);
+ protected readonly names = inject(FieldNames);
constructor() {
// las celdas de código con texto propio (la cuenta con su formato) piden los textos de las líneas que se cargan
diff --git a/apps/web/src/app/shared/grid/rows-table.ts b/apps/web/src/app/shared/grid/rows-table.ts
index 81b2396..af0b95b 100644
--- a/apps/web/src/app/shared/grid/rows-table.ts
+++ b/apps/web/src/app/shared/grid/rows-table.ts
@@ -1,6 +1,7 @@
import { HttpClient, HttpParams } from '@angular/common/http';
import { ChangeDetectionStrategy, Component, computed, effect, inject, input, model, signal } from '@angular/core';
import { API_URL } from '../../core/api';
+import { FieldNames } from '../../core/field-names';
import { formatNumber, parseDecimal } from '../../core/format';
import { SlLookupApi } from '../../core/sl/sl-lookup';
import type { ListRow } from '../list/list.types';
@@ -31,7 +32,9 @@ const dateOnly = (v: unknown): string => (typeof v === 'string' ? v.slice(0, 10)
| # |
@for (c of columns(); track c.key) {
- {{ c.title }} |
+ {{ c.title }}@if (fieldNames.show()) {
+ {{ c.key }}
+ } |
}
@if (canRemove()) {
|
@@ -145,6 +148,7 @@ const dateOnly = (v: unknown): string => (typeof v === 'string' ? v.slice(0, 10)
.menu button:hover { background: var(--btn-h); }
table { width: 100%; min-width: max-content; border-collapse: collapse; }
th { padding: 4px 6px; background: var(--grid-head); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; text-align: left; white-space: nowrap; }
+ th .db { display: block; font: 10.5px/1.2 var(--mono, monospace); font-weight: 400; color: var(--quiet); }
th.req::after { content: ' *'; color: var(--err); }
td { padding: 0 2px; height: 27px; border: 1px solid var(--line-soft); white-space: nowrap; }
td.ro { background: var(--field-ro); }
@@ -181,6 +185,7 @@ export class RowsTable {
return rows.filter((r) => keys.some((k) => Number(r[k]) !== 0 && Number.isFinite(Number(r[k]))));
});
+ protected readonly fieldNames = inject(FieldNames);
private readonly lookupApi = inject(SlLookupApi);
private readonly http = inject(HttpClient);
/** Nombres de los catálogos de las columnas `nameOf`, por recurso. */
diff --git a/apps/web/src/app/shared/list/data-table.css b/apps/web/src/app/shared/list/data-table.css
index e07aabd..50d7c9f 100644
--- a/apps/web/src/app/shared/list/data-table.css
+++ b/apps/web/src/app/shared/list/data-table.css
@@ -75,3 +75,10 @@ tr.none td {
width: 30px;
text-align: center;
}
+
+th .db {
+ display: block;
+ font: 10.5px/1.2 var(--mono, monospace);
+ font-weight: 400;
+ color: var(--quiet);
+}
diff --git a/apps/web/src/app/shared/list/data-table.html b/apps/web/src/app/shared/list/data-table.html
index 6ff8dcc..85423c0 100644
--- a/apps/web/src/app/shared/list/data-table.html
+++ b/apps/web/src/app/shared/list/data-table.html
@@ -19,10 +19,13 @@
[style.text-align]="align(c)"
[class.pick]="searchable(c)"
[class.active]="c.key === activeColumnKey()"
- [attr.title]="searchable(c) ? 'Buscar en esta columna' : null"
+ [attr.title]="(searchable(c) ? 'Buscar en esta columna · ' : '') + c.key"
(click)="columnPicked.emit(c)"
>
{{ c.title }}
+ @if (names.show()) {
+ {{ c.key }}
+ }
}
diff --git a/apps/web/src/app/shared/list/data-table.ts b/apps/web/src/app/shared/list/data-table.ts
index a2fc458..6dbfa78 100644
--- a/apps/web/src/app/shared/list/data-table.ts
+++ b/apps/web/src/app/shared/list/data-table.ts
@@ -1,4 +1,5 @@
-import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';
+import { ChangeDetectionStrategy, Component, computed, inject, input, output } from '@angular/core';
+import { FieldNames } from '../../core/field-names';
import { ColResize } from '../table/col-resize';
import { Badge } from '../window/badge';
import { type ListColumn, type ListRow, alignOf, cellText, isSearchable, type Tone } from './list.types';
@@ -15,6 +16,8 @@ import { type ListColumn, type ListRow, alignOf, cellText, isSearchable, type To
styleUrl: './data-table.css',
})
export class DataTable {
+ protected readonly names = inject(FieldNames);
+
readonly columns = input.required();
readonly rows = input.required();
/** Campo único de cada fila. */