dmencu 1.0.21 → 1.0.23

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.
@@ -413,12 +413,18 @@ function OpcionMultipleDespliegue(props:{opcionM:OpcionMultiple, forPk:ForPk}){
413
413
  const {opcionM} = props;
414
414
  var id = `opcionM-${opcionM.id_casillero}`;
415
415
  //@ts-ignore altunos casilleros no tienen especial, no importa, es solo para poner los metadatos
416
- var styles = opcionM.especial?.flexDirection?{flexDirection:opcionM.especial.flexDirection}:{};
416
+ var styles: React.CSSProperties = opcionM.especial?.flexDirection?{flexDirection:opcionM.especial.flexDirection}:{flexWrap:'wrap'};
417
417
  registrarElemento({
418
418
  id,
419
419
  direct:true,
420
420
  fun: registradorDeVariable(opcionM)
421
421
  })
422
+ const updateWindowWidth = function(){
423
+ setWindowWidth(window.innerWidth);
424
+ }
425
+
426
+ const [windowWidth, setWindowWidth] = useState(window.innerWidth);
427
+ window.addEventListener('resize', updateWindowWidth);
422
428
  return <DesplegarCasillero
423
429
  id={id}
424
430
  casillero={opcionM}
@@ -430,6 +436,7 @@ function OpcionMultipleDespliegue(props:{opcionM:OpcionMultiple, forPk:ForPk}){
430
436
  verIdGuion={true}
431
437
  leer={opcionM.leer!==false}
432
438
  forPk={props.forPk}
439
+ style={{maxWidth:windowWidth-400}} //TODO MEJORAR
433
440
  />
434
441
  <SiNoDespliegue
435
442
  casilleroConOpciones={opcionM}
@@ -458,7 +465,13 @@ const getLosMetadatos = (casillero: CasilleroEncabezable): React.JSX.Element =>
458
465
  }
459
466
  </div>
460
467
 
461
- function EncabezadoDespliegue(props:{casillero:CasilleroEncabezable, verIdGuion?:boolean, leer?:boolean, forPk:ForPk}){
468
+ function EncabezadoDespliegue(props:{
469
+ style?:React.CSSProperties,
470
+ casillero:CasilleroEncabezable,
471
+ verIdGuion?:boolean,
472
+ leer?:boolean,
473
+ forPk:ForPk
474
+ }){
462
475
  var {casillero, forPk} = props;
463
476
  var conCampoOpciones = useSelector((state:CasoState)=>state.opciones.conCampoOpciones)
464
477
  var handleClickBorrar=()=>{
@@ -471,7 +484,8 @@ function EncabezadoDespliegue(props:{casillero:CasilleroEncabezable, verIdGuion?
471
484
  var idAcciones = "acciones-"+id;
472
485
  return <div
473
486
  className="encabezado"
474
- debe-leer={props.leer?'SI':'NO'}
487
+ debe-leer={props.leer?'SI':'NO'}
488
+ style={props.style}
475
489
  >
476
490
  <div id={id} className="id-div" title={`${casillero.casillero} - ${casillero.var_name}`}
477
491
  onClick={()=>{
@@ -677,7 +691,7 @@ function OpcionesDespliegue(
677
691
  ){
678
692
  const desplegarOtros = (opcion:Opcion, soloParaDespliegue:'vertical'|'horizontal'|null) => opcion.casilleros.map((subPregunta:Pregunta)=>(
679
693
  soloParaDespliegue == null || soloParaDespliegue == subPregunta.despliegueContenido ?
680
- <div className="otros-especificar" key={subPregunta.id_casillero}>
694
+ <div className="otros-especificar" style={{width:'100%'}} key={subPregunta.id_casillero}>
681
695
  <PreguntaDespliegue
682
696
  pregunta={subPregunta}
683
697
  forPk={forPk}
@@ -685,8 +699,8 @@ function OpcionesDespliegue(
685
699
  />
686
700
  </div>:null
687
701
  ))
688
- return <div className="contenido">
689
- <div className="opciones" despliegue-contenido={despliegueContenido??'vertical'}>
702
+ return <><div className="contenido">
703
+ <div className="opciones" despliegue-contenido={despliegueContenido??'vertical'}>
690
704
  {casilleroConOpciones.casilleros.map((opcion:Opcion, i:number)=>
691
705
  <Grid key={opcion.id_casillero} item
692
706
  ocultar-salteada={opcion.despliegueOculta?(opcion.expresion_habilitar_js?'INHABILITAR':'SI'):'NO'}
@@ -703,10 +717,10 @@ function OpcionesDespliegue(
703
717
  </Grid>
704
718
  )}
705
719
  </div>
706
- {despliegueContenido=='horizontal'?casilleroConOpciones.casilleros.map((opcion:Opcion)=>
707
- desplegarOtros(opcion,null)
708
- ):null}
709
720
  </div>
721
+ {despliegueContenido=='horizontal'?casilleroConOpciones.casilleros.map((opcion:Opcion)=>
722
+ desplegarOtros(opcion,null)
723
+ ):null}</>
710
724
  }
711
725
 
712
726
  const nombreCasillero={
@@ -834,7 +848,7 @@ function PreguntaDespliegue(props:{
834
848
  ):""}
835
849
  />
836
850
  </div>
837
- </DesplegarCasillero>}
851
+ </DesplegarCasillero>
838
852
  }
839
853
 
840
854
  function PMatrizDespliegue(props:{