dmencu 3.2.14 → 3.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/unlogged/render-formulario.d.ts +1 -0
- package/dist/client/unlogged/render-formulario.js +15 -7
- package/dist/client/unlogged/render-formulario.tsx +20 -14
- package/dist/unlogged/unlogged/render-formulario.d.ts +1 -0
- package/dist/unlogged/unlogged/render-formulario.js +15 -7
- package/dist/unlogged/unlogged/render-formulario.tsx +20 -14
- package/package.json +1 -1
|
@@ -142,6 +142,9 @@ function obtenerPorPath<T = unknown>(objeto: Record<string, any>, path: string):
|
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
const NO_CARGADO_AUN = '........';
|
|
146
|
+
const SIN_VALOR_EN_OBJETO_TEM = '';
|
|
147
|
+
|
|
145
148
|
function breakeableText(text: string | null): string | null;
|
|
146
149
|
function breakeableText(text: string | null, diccionario?: { [clave: string]: React.ReactNode }) {
|
|
147
150
|
if (typeof text != "string") return null;
|
|
@@ -153,6 +156,10 @@ function breakeableText(text: string | null, diccionario?: { [clave: string]: Re
|
|
|
153
156
|
*/
|
|
154
157
|
}
|
|
155
158
|
|
|
159
|
+
export function formatearResultadoComodin(valor: string): string {
|
|
160
|
+
return `[${valor}]`;
|
|
161
|
+
}
|
|
162
|
+
|
|
156
163
|
// ==========================================
|
|
157
164
|
// 1. HELPERS PUROS Y EXPRESIONES REGULARES
|
|
158
165
|
// ==========================================
|
|
@@ -238,7 +245,7 @@ function useVariablesEscuchadas(text: string, forPk: ForPk) {
|
|
|
238
245
|
|
|
239
246
|
// Getter expuesto para mantener tu sintaxis
|
|
240
247
|
return (nombreVar: string): string => {
|
|
241
|
-
return mapaVariables[nombreVar] ??
|
|
248
|
+
return mapaVariables[nombreVar] ?? NO_CARGADO_AUN;
|
|
242
249
|
};
|
|
243
250
|
}
|
|
244
251
|
|
|
@@ -248,7 +255,7 @@ function obtenerValoresActuales(variables: string[], forPk: ForPk): Record<strin
|
|
|
248
255
|
const { respuestasAumentadas } = respuestasForPk(forPk, true);
|
|
249
256
|
for (const v of variables) {
|
|
250
257
|
const val = respuestasAumentadas?.[v as IdVariable];
|
|
251
|
-
mapa[v] = String(val ??
|
|
258
|
+
mapa[v] = String(val ?? NO_CARGADO_AUN);
|
|
252
259
|
}
|
|
253
260
|
return mapa;
|
|
254
261
|
}
|
|
@@ -303,17 +310,16 @@ export const BreakeableText = React.memo(function BreakeableText(props: {
|
|
|
303
310
|
const path = matchTem[1];
|
|
304
311
|
const {encontrado, valor} = obtenerPorPath(infoHdr[idEnc], path)
|
|
305
312
|
|
|
306
|
-
return encontrado ? String(valor):
|
|
313
|
+
return encontrado ? formatearResultadoComodin(String(valor ?? SIN_VALOR_EN_OBJETO_TEM)):
|
|
307
314
|
<span key={index} style={{ color: 'red' }}>
|
|
308
315
|
{`No se encontró ${parte}`}
|
|
309
|
-
</span>
|
|
310
|
-
);
|
|
316
|
+
</span>
|
|
311
317
|
}
|
|
312
318
|
|
|
313
319
|
// CASO 2: Variable dinámica con Hash (@#variable@)
|
|
314
320
|
const matchVarHash = parte.match(IS_VARIABLE_HASH_PATTERN);
|
|
315
321
|
if (matchVarHash) {
|
|
316
|
-
return obtenerValorVariable(matchVarHash[1]);
|
|
322
|
+
return formatearResultadoComodin(obtenerValorVariable(matchVarHash[1]));
|
|
317
323
|
}
|
|
318
324
|
|
|
319
325
|
// CASO 3: Comodín global de Redux (@comodin@)
|
|
@@ -324,7 +330,7 @@ export const BreakeableText = React.memo(function BreakeableText(props: {
|
|
|
324
330
|
? comodinesValores[nombreComodin]
|
|
325
331
|
: comodinesIniciales[nombreComodin as IdComodin];
|
|
326
332
|
|
|
327
|
-
return valor ??
|
|
333
|
+
return formatearResultadoComodin(valor) ??
|
|
328
334
|
<span key={index} style={{ color: 'red' }}>
|
|
329
335
|
{`No se encontró ${parte}`}
|
|
330
336
|
</span>
|
|
@@ -3309,13 +3315,13 @@ function calcularComodines(forPk: ForPk) {
|
|
|
3309
3315
|
const fRealiz = respuestasAumentadas?.['f_realiz_o' as IdVariable];
|
|
3310
3316
|
const comodinesCalculados: Record<IdComodin, string> = {
|
|
3311
3317
|
...comodinesIniciales,
|
|
3312
|
-
canti_hogares: totalH != null ? String(totalH) :
|
|
3313
|
-
frealiz: fRealiz != null ? String(fRealiz) :
|
|
3314
|
-
resps1: (esEntrea && nombrer) ? String(nombrer) :
|
|
3315
|
-
parents1: (esEntrea && parentResp) ? parentResp :
|
|
3316
|
-
respi1: (esEntrea && personaRespi?.nombre) ? String(personaRespi.nombre) :
|
|
3317
|
-
parenti1: (esEntrea && parentRespi) ? parentRespi :
|
|
3318
|
-
njefe: (esEntrea && jefe?.nombre) ? String(jefe.nombre) :
|
|
3318
|
+
canti_hogares: totalH != null ? String(totalH) : NO_CARGADO_AUN,
|
|
3319
|
+
frealiz: fRealiz != null ? String(fRealiz) : NO_CARGADO_AUN,
|
|
3320
|
+
resps1: (esEntrea && nombrer) ? String(nombrer) : NO_CARGADO_AUN,
|
|
3321
|
+
parents1: (esEntrea && parentResp) ? parentResp : NO_CARGADO_AUN,
|
|
3322
|
+
respi1: (esEntrea && personaRespi?.nombre) ? String(personaRespi.nombre) : NO_CARGADO_AUN,
|
|
3323
|
+
parenti1: (esEntrea && parentRespi) ? parentRespi : NO_CARGADO_AUN,
|
|
3324
|
+
njefe: (esEntrea && jefe?.nombre) ? String(jefe.nombre) : NO_CARGADO_AUN,
|
|
3319
3325
|
...(semRef && { SEM_REF: semRef }),
|
|
3320
3326
|
...(d30Ref && { D30_REF: d30Ref }),
|
|
3321
3327
|
...(semanaObj?.mes_referencia && { MES_REF: mesReferencia(semanaObj.mes_referencia) }),
|
package/package.json
CHANGED