dmencu 3.2.16 → 3.2.17
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/bypass-formulario.d.ts +10 -0
- package/dist/client/unlogged/bypass-formulario.js +77 -41
- package/dist/client/unlogged/render-formulario.d.ts +8 -0
- package/dist/client/unlogged/render-formulario.js +60 -36
- package/dist/client/unlogged/render-formulario.tsx +67 -35
- package/dist/unlogged/unlogged/bypass-formulario.d.ts +10 -0
- package/dist/unlogged/unlogged/bypass-formulario.js +77 -41
- package/dist/unlogged/unlogged/render-formulario.d.ts +8 -0
- package/dist/unlogged/unlogged/render-formulario.js +60 -36
- package/dist/unlogged/unlogged/render-formulario.tsx +67 -35
- package/package.json +1 -1
|
@@ -87,6 +87,7 @@ import {
|
|
|
87
87
|
numberOrStringIncIfArray,
|
|
88
88
|
calcularElementoEnfocado,
|
|
89
89
|
accion_registrar_respuesta,
|
|
90
|
+
accion_registrar_respuestas,
|
|
90
91
|
accion_id_pregunta,
|
|
91
92
|
accion_agregar_formulario,
|
|
92
93
|
NO_CAMBIAR__VERIFICAR_SI_ES_NECESARIO,
|
|
@@ -352,6 +353,32 @@ export function getBFVarNames(salto: string | null) {
|
|
|
352
353
|
};
|
|
353
354
|
}
|
|
354
355
|
|
|
356
|
+
export function registrarRespuestasBotonFormulario(opts: {
|
|
357
|
+
forPkPadre: ForPk,
|
|
358
|
+
salto: string | null,
|
|
359
|
+
expresionHabilitar?: string,
|
|
360
|
+
listoValor?: Valor,
|
|
361
|
+
agregarValor?: Valor,
|
|
362
|
+
habilitarValor?: Valor
|
|
363
|
+
}) {
|
|
364
|
+
var respuestasABypasear: { variable: IdVariable, respuesta: Valor }[] = [];
|
|
365
|
+
if (opts.salto) {
|
|
366
|
+
const { listo, agregar } = getBFVarNames(opts.salto);
|
|
367
|
+
if (opts.listoValor !== undefined) {
|
|
368
|
+
respuestasABypasear.push({ variable: listo, respuesta: opts.listoValor });
|
|
369
|
+
}
|
|
370
|
+
if (opts.agregarValor !== undefined) {
|
|
371
|
+
respuestasABypasear.push({ variable: agregar, respuesta: opts.agregarValor });
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (opts.expresionHabilitar && opts.habilitarValor !== undefined) {
|
|
375
|
+
respuestasABypasear.push({ variable: opts.expresionHabilitar as IdVariable, respuesta: opts.habilitarValor });
|
|
376
|
+
}
|
|
377
|
+
if (respuestasABypasear.length > 0) {
|
|
378
|
+
dispatchByPass(accion_registrar_respuestas, { forPk: opts.forPkPadre, respuestas: respuestasABypasear });
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
355
382
|
const VER_DOMINIO = false; // el encuestador no necesita ver el dominio en cada encuesta porque el dominio depende del área y se deduce del primer dígito del número de encuesta
|
|
356
383
|
// no poner VER_DOMINIO en true, cambiar por una variable que se fije si el DM está en modo prueba o en modo "diseño conceptual"
|
|
357
384
|
|
|
@@ -1465,14 +1492,14 @@ var botonFormularioConResumen = (
|
|
|
1465
1492
|
onClick: () => {
|
|
1466
1493
|
if (defBoton.esConfirmar) {
|
|
1467
1494
|
if (defBoton.num != null) {
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
}
|
|
1495
|
+
registrarRespuestasBotonFormulario({
|
|
1496
|
+
forPkPadre,
|
|
1497
|
+
salto: casillero.salto,
|
|
1498
|
+
expresionHabilitar: casillero.expresion_habilitar,
|
|
1499
|
+
listoValor: defBoton.num as Valor,
|
|
1500
|
+
agregarValor: 1 as Valor,
|
|
1501
|
+
habilitarValor: defBoton.num as Valor
|
|
1502
|
+
});
|
|
1476
1503
|
}
|
|
1477
1504
|
} else {
|
|
1478
1505
|
var button = document.getElementById(idButton)! as HTMLButtonElement;
|
|
@@ -1503,14 +1530,14 @@ var botonFormularioConResumen = (
|
|
|
1503
1530
|
onClick: () => {
|
|
1504
1531
|
if (defBoton.permiteBorrar) {
|
|
1505
1532
|
accion_borrar_formulario({ forPk, forPkPadre });
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
}
|
|
1533
|
+
registrarRespuestasBotonFormulario({
|
|
1534
|
+
forPkPadre,
|
|
1535
|
+
salto: casillero.salto,
|
|
1536
|
+
expresionHabilitar: casillero.expresion_habilitar,
|
|
1537
|
+
listoValor: null as unknown as Valor,
|
|
1538
|
+
agregarValor: defBoton.num === 1 ? (null as unknown as Valor) : undefined,
|
|
1539
|
+
habilitarValor: null as unknown as Valor
|
|
1540
|
+
});
|
|
1514
1541
|
} else if (defBoton.permiteBorrarGabinete && pedirConfirmacionBorrado) {
|
|
1515
1542
|
pedirConfirmacionBorrado(defBoton, forPkPadre);
|
|
1516
1543
|
}
|
|
@@ -1530,12 +1557,14 @@ var botonFormularioConResumen = (
|
|
|
1530
1557
|
]),
|
|
1531
1558
|
],
|
|
1532
1559
|
onClick: () => {
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1560
|
+
registrarRespuestasBotonFormulario({
|
|
1561
|
+
forPkPadre,
|
|
1562
|
+
salto: casillero.salto,
|
|
1563
|
+
expresionHabilitar: casillero.expresion_habilitar,
|
|
1564
|
+
listoValor: null as unknown as Valor,
|
|
1565
|
+
agregarValor: null as unknown as Valor,
|
|
1566
|
+
habilitarValor: null as unknown as Valor
|
|
1567
|
+
});
|
|
1539
1568
|
}
|
|
1540
1569
|
})
|
|
1541
1570
|
: null)
|
|
@@ -1751,11 +1780,14 @@ function BotonFormularioDespliegue(props: { casillero: BotonFormulario, formular
|
|
|
1751
1780
|
(nuevaForPk as any)[nuevoCampoPk] = defBoton.num
|
|
1752
1781
|
if (defBoton.esAgregar) {
|
|
1753
1782
|
dispatchByPass(accion_agregar_formulario, { forPk: nuevaForPk });
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1783
|
+
registrarRespuestasBotonFormulario({
|
|
1784
|
+
forPkPadre: props.forPk,
|
|
1785
|
+
salto: casillero.salto,
|
|
1786
|
+
expresionHabilitar: casillero.expresion_habilitar,
|
|
1787
|
+
listoValor: null as unknown as Valor,
|
|
1788
|
+
agregarValor: 1 as Valor,
|
|
1789
|
+
habilitarValor: null as unknown as Valor
|
|
1790
|
+
});
|
|
1759
1791
|
} else {
|
|
1760
1792
|
dispatchByPass(accion_abrir_formulario, { forPk: nuevaForPk });
|
|
1761
1793
|
// Si abro uno existente, también reseteo el listo para forzar que vuelvan a apretarlo si cambian algo
|
|
@@ -1856,14 +1888,14 @@ function BotonFormularioDespliegue(props: { casillero: BotonFormulario, formular
|
|
|
1856
1888
|
const {defBoton, forPkPadre} = confirmacionBorrado;
|
|
1857
1889
|
const forPk = defBoton.forPk;
|
|
1858
1890
|
accion_borrar_formulario({ forPk, forPkPadre });
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
}
|
|
1891
|
+
registrarRespuestasBotonFormulario({
|
|
1892
|
+
forPkPadre,
|
|
1893
|
+
salto: casillero.salto,
|
|
1894
|
+
expresionHabilitar: casillero.expresion_habilitar,
|
|
1895
|
+
listoValor: null as unknown as Valor,
|
|
1896
|
+
agregarValor: defBoton.num === 1 ? (null as unknown as Valor) : undefined,
|
|
1897
|
+
habilitarValor: null as unknown as Valor
|
|
1898
|
+
});
|
|
1867
1899
|
setConfirmacionBorrado(null);
|
|
1868
1900
|
setFraseBorrado('');
|
|
1869
1901
|
setErrorFraseBorrado(false);
|
package/package.json
CHANGED