feat(web): botón «Campos» que muestra el nombre del campo de SAP junto a cada etiqueta y en las cabeceras de tablas (ayuda del cursor siempre)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
GeorgeandClaude Sonnet 5.5 committed 2026-10-20 08:59:58 -05:00
1 parent 6887f9e474
commit 6ad824c6c1
19 files changed
+168 -37

No files matched your search

@@ -133,7 +133,7 @@
@switch (f.type) {
@case ('partner') {
<sbo-lookup-field
[label]="f.label"
[label]="f.label" [dbName]="f.key"
[required]="!!f.required"
[readonly]="readOnly() || !isNew() || locked(f)"
[value]="str(header()[f.key])"
@@ -145,7 +145,7 @@
}
@case ('checkbox') {
<sbo-checkbox-field
[label]="f.label"
[label]="f.label" [dbName]="f.key"
[readonly]="readOnly() || !!f.readonly || locked(f)"
[value]="header()[f.key] === 'tYES'"
(valueChange)="setHeader(f.key, $event ? 'tYES' : 'tNO')"
@@ -153,7 +153,7 @@
}
@case ('lookup') {
<sbo-lookup-field
[label]="f.label"
[label]="f.label" [dbName]="f.key"
[required]="!!f.required"
[readonly]="readOnly() || locked(f)"
[value]="str(header()[f.key])"
@@ -165,7 +165,7 @@
}
@case ('warehouse') {
<sbo-lookup-field
[label]="f.label"
[label]="f.label" [dbName]="f.key"
[required]="!!f.required"
[readonly]="readOnly() || locked(f)"
[value]="str(header()[f.key])"
@@ -176,7 +176,7 @@
}
@case ('date') {
<sbo-date-field
[label]="f.label"
[label]="f.label" [dbName]="f.key"
[required]="!!f.required"
[readonly]="readOnly() || locked(f)"
[value]="str(header()[f.key])"
@@ -185,7 +185,7 @@
}
@case ('select') {
<sbo-select-field
[label]="f.label"
[label]="f.label" [dbName]="f.key"
[required]="!!f.required"
[readonly]="readOnly() || locked(f)"
[options]="f.options"
@@ -196,7 +196,7 @@
}
@case ('number') {
<sbo-number-field
[label]="f.label"
[label]="f.label" [dbName]="f.key"
[decimals]="f.decimals"
[readonly]="readOnly() || locked(f)"
[value]="+str(header()[f.key])"
@@ -205,14 +205,14 @@
}
@case ('textarea') {
<sbo-textarea-field
[label]="f.label"
[label]="f.label" [dbName]="f.key"
[readonly]="readOnly() || locked(f)"
[value]="str(header()[f.key])"
(valueChange)="setHeader(f.key, $event)"
/>
}
@case ('folio') {
<sbo-field [label]="f.label">
<sbo-field [label]="f.label" [dbName]="f.key">
<sbo-input
width="90px"
[maxlength]="10"
@@ -229,7 +229,7 @@
</sbo-field>
}
@case ('group') {
<sbo-field [label]="f.label">
<sbo-field [label]="f.label" [dbName]="f.key">
@for (c of f.cells; track c.key) {
<sbo-input
[width]="c.width"
@@ -246,7 +246,7 @@
</sbo-field>
}
@case ('series') {
<sbo-field [label]="f.label">
<sbo-field [label]="f.label" [dbName]="f.key">
<sbo-select
width="170px"
ariaLabel="Serie de numeración"
@@ -277,7 +277,7 @@
}
@case ('contact') {
<sbo-select-field
[label]="f.label"
[label]="f.label" [dbName]="f.key"
[readonly]="readOnly() || locked(f)"
[options]="contactOptions()"
placeholder=""
@@ -287,7 +287,7 @@
}
@case ('address') {
<sbo-select-field
[label]="f.label"
[label]="f.label" [dbName]="f.key"
[readonly]="readOnly() || locked(f)"
[options]="f.side === 'ship' ? shipOptions() : billOptions()"
placeholder=""
@@ -302,7 +302,7 @@
</sbo-field>
}
@case ('currency') {
<sbo-field [label]="f.label">
<sbo-field [label]="f.label" [dbName]="f.key">
<sbo-select
width="170px"
ariaLabel="Moneda del documento"
@@ -322,7 +322,7 @@
}
@case ('rounding') {
@if (roundingEnabled()) {
<sbo-field [label]="f.label">
<sbo-field [label]="f.label" [dbName]="f.key">
<sbo-checkbox
ariaLabel="Redondear el total del documento"
[readonly]="readOnly() || locked(f)"
@@ -340,11 +340,11 @@
}
}
@case ('computed') {
<sbo-text-field [label]="f.label" readonly [value]="computedValue(f.source)" />
<sbo-text-field [label]="f.label" [dbName]="f.key" readonly [value]="computedValue(f.source)" />
}
@default {
<sbo-text-field
[label]="f.label"
[label]="f.label" [dbName]="f.key"
[readonly]="readOnly() || !!f.readonly || locked(f)"
[value]="str(header()[f.key])"
(valueChange)="setHeader(f.key, $event)"
@@ -18,7 +18,7 @@ const text = (v: unknown): string => (v === null || v === undefined ? '' : Strin
@switch (field().type) {
@case ('checkbox') {
<sbo-checkbox-field
[label]="field().label"
[label]="field().label" [dbName]="dbName()"
[readonly]="readOnly() || !!ro()"
[value]="value() === 'tYES'"
(valueChange)="changed.emit($event ? 'tYES' : 'tNO')"
@@ -26,7 +26,7 @@ const text = (v: unknown): string => (v === null || v === undefined ? '' : Strin
}
@case ('lookup') {
<sbo-lookup-field
[label]="field().label"
[label]="field().label" [dbName]="dbName()"
[required]="required()"
[readonly]="readOnly()"
[value]="str()"
@@ -37,7 +37,7 @@ const text = (v: unknown): string => (v === null || v === undefined ? '' : Strin
}
@case ('warehouse') {
<sbo-lookup-field
[label]="field().label"
[label]="field().label" [dbName]="dbName()"
[required]="required()"
[readonly]="readOnly()"
[value]="str()"
@@ -48,7 +48,7 @@ const text = (v: unknown): string => (v === null || v === undefined ? '' : Strin
}
@case ('select') {
<sbo-select-field
[label]="field().label"
[label]="field().label" [dbName]="dbName()"
[required]="required()"
[readonly]="readOnly()"
[options]="options()"
@@ -59,7 +59,7 @@ const text = (v: unknown): string => (v === null || v === undefined ? '' : Strin
}
@case ('number') {
<sbo-number-field
[label]="field().label"
[label]="field().label" [dbName]="dbName()"
[decimals]="decimals()"
[readonly]="readOnly() || !!ro()"
[value]="num()"
@@ -67,14 +67,14 @@ const text = (v: unknown): string => (v === null || v === undefined ? '' : Strin
/>
}
@case ('date') {
<sbo-date-field [label]="field().label" [required]="required()" [readonly]="readOnly()" [value]="str()" (valueChange)="changed.emit($event)" />
<sbo-date-field [label]="field().label" [dbName]="dbName()" [required]="required()" [readonly]="readOnly()" [value]="str()" (valueChange)="changed.emit($event)" />
}
@case ('textarea') {
<sbo-textarea-field [label]="field().label" [readonly]="readOnly()" [value]="str()" (valueChange)="changed.emit($event)" />
<sbo-textarea-field [label]="field().label" [dbName]="dbName()" [readonly]="readOnly()" [value]="str()" (valueChange)="changed.emit($event)" />
}
@default {
<sbo-text-field
[label]="field().label"
[label]="field().label" [dbName]="dbName()"
[required]="required()"
[readonly]="readOnly() || !!ro()"
[value]="str()"
@@ -102,6 +102,10 @@ export class MasterField {
return f.type === 'lookup' && f.lookup.valueType === 'number' && /^\d+$/.test(code.trim()) ? Number(code) : code;
}
/** El texto del campo; una fecha de SAP llega como `2031-10-31T00:00:00Z` y el selector de fecha pide `yyyy-MM-dd`. */
protected readonly dbName = computed(() => {
const f = this.field();
return 'key' in f ? f.key : undefined;
});
protected readonly str = computed(() => (this.field().type === 'date' ? text(this.value()).slice(0, 10) : text(this.value())));
protected readonly num = computed(() => (this.value() === '' || this.value() === null || this.value() === undefined ? null : Number(this.value())));
protected readonly required = computed(() => {