diff --git a/frontend/src/components/BlankCardsCounter.jsx b/frontend/src/components/BlankCardsCounter.jsx index b35b7ed..3292eea 100644 --- a/frontend/src/components/BlankCardsCounter.jsx +++ b/frontend/src/components/BlankCardsCounter.jsx @@ -1,3 +1,5 @@ +import React from 'react'; + export default function BlankCardsCounter({ index, blankCardsCount, handleBlankCardChange }) { const maxCardsPerRow = 7; @@ -7,35 +9,29 @@ export default function BlankCardsCounter({ index, blankCardsCount, handleBlankC } return ( -
+
-
+ {/* Bloque de botones */} +
+ - {/* Línea conectora horizontal */} -
- - {/* Botones - y + */} -
- - -
- Blancas - {blankCardsCount} -
- - +
+ Blancas + {blankCardsCount}
+ +
{/* Cartas blancas */} {blankCardsCount > 0 && ( -
+
{rows.map((row, rowIndex) => (
{row.map((_, colIndex) => ( diff --git a/frontend/src/components/CardEditor.jsx b/frontend/src/components/CardEditor.jsx index c5e887f..4783869 100644 --- a/frontend/src/components/CardEditor.jsx +++ b/frontend/src/components/CardEditor.jsx @@ -10,9 +10,9 @@ export default function CardEditor({ index, level, handleLevelChange, handleRemo )} {index + 1} {index + 1} - handleLevelChange(index, e.target.value)} className={`w-10/12 text-center text-lg font-bold text-slate-700 bg-transparent border-b-2 border-dashed outline-none pb-1 ${error ? 'border-red-300 focus:border-red-500 placeholder:text-red-200' : 'border-slate-300 focus:border-blue-500'}`} /> + handleLevelChange(index, e.target.value)} className={`w-10/12 text-center text-lg font-bold text-slate-700 bg-transparent border-b-2 border-dashed outline-none pb-1 ${error ? 'border-red-300 focus:border-red-500 placeholder:text-red-200' : 'border-slate-300 focus:border-blue-500'}`} />
-
{error &&

Escribe una etiqueta

}
+
{error &&

Escribe un término

}
); } \ No newline at end of file diff --git a/frontend/src/components/editor/Step1BaseScale.jsx b/frontend/src/components/editor/Step1BaseScale.jsx index 115b450..2ee5755 100644 --- a/frontend/src/components/editor/Step1BaseScale.jsx +++ b/frontend/src/components/editor/Step1BaseScale.jsx @@ -59,30 +59,48 @@ export default function Step1BaseScale({ -
+
{levels.map((level, index) => ( -
+ + {/* CARTA DE NIVEL */} +
3} />
+ + {/* HUECO ENTRE CARTAS Y CONTADOR */} {index < levels.length - 1 && ( - +
+
+ +
+ +
+
)} ))} -
-
+ + {/* LÍNEA HACIA EL BOTÓN DE AÑADIR */} +
+
- + + {/* BOTÓN AÑADIR NIVEL */} +
+ +
+
-
+ {/* Generar Gráfica Continua */} +
diff --git a/frontend/src/components/editor/Step2FuzzyModeling.jsx b/frontend/src/components/editor/Step2FuzzyModeling.jsx index dcc3d18..2369c54 100644 --- a/frontend/src/components/editor/Step2FuzzyModeling.jsx +++ b/frontend/src/components/editor/Step2FuzzyModeling.jsx @@ -79,7 +79,7 @@ export default function Step2FuzzyModeling({
diff --git a/frontend/src/components/editor/SubscaleModal.jsx b/frontend/src/components/editor/SubscaleModal.jsx index 3a751f1..6f70c3a 100644 --- a/frontend/src/components/editor/SubscaleModal.jsx +++ b/frontend/src/components/editor/SubscaleModal.jsx @@ -3,10 +3,19 @@ import BlankCardsCounter from '../BlankCardsCounter'; export default function SubscaleModal({ onClose, onSave, targetInfo }) { - const [cardsCount, setCardsCount] = useState(targetInfo?.initialData?.cardsCount || 2); + const initialCount = Math.max(3, targetInfo?.initialData?.cardsCount || 3); + const [cardsCount, setCardsCount] = useState(initialCount); const [blankCards, setBlankCards] = useState(() => { - const initialBlanks = targetInfo?.initialData?.blankCards || [0]; + let initialBlanks = targetInfo?.initialData?.blankCards; + + if (!initialBlanks || initialBlanks.length === 0) { + initialBlanks = [0, 0]; + } else if (initialBlanks.length < initialCount - 1) { + const padding = Array(initialCount - 1 - initialBlanks.length).fill(0); + initialBlanks = [...initialBlanks, ...padding]; + } + return initialBlanks.map(b => { if (Array.isArray(b)) { return { min: b[0], max: b[1], isRange: true }; @@ -21,7 +30,7 @@ export default function SubscaleModal({ onClose, onSave, targetInfo }) { }; const handleRemoveCard = () => { - if (cardsCount <= 2) return; + if (cardsCount <= 3) return; setCardsCount(prev => prev - 1); setBlankCards(blankCards.slice(0, -1)); }; @@ -73,10 +82,10 @@ export default function SubscaleModal({ onClose, onSave, targetInfo }) { }; return ( -
-
+
+
-
+

Diseñar Subescala

@@ -86,16 +95,15 @@ export default function SubscaleModal({ onClose, onSave, targetInfo }) {

- {/* Tablero de Cartas */} -
+
{Array.from({ length: cardsCount }).map((_, index) => ( {/* CARTA DE REFERENCIA */} -
+
- {cardsCount > 2 && index === cardsCount - 1 && ( + {cardsCount > 3 && index === cardsCount - 1 && ( )} {index + 1} @@ -104,58 +112,57 @@ export default function SubscaleModal({ onClose, onSave, targetInfo }) { {/* HUECO ENTRE CARTAS */} {index < cardsCount - 1 && ( -
- - {/* Controles de números */} - {blankCards[index].isRange ? ( - // MODO RANGO -
-
- MÍN - handleMinChange(idx, delta)} - /> +
+
+ +
+ {blankCards[index].isRange ? ( +
+
+ MÍN + handleMinChange(idx, delta)} + /> +
+ +
-
+ +
+ MÁX + handleMaxChange(idx, delta)} + /> +
- {/* Guión separador para unificar visualmente el rango */} - - -
- MÁX - handleMaxChange(idx, delta)} - /> + ) : ( +
+ CARTAS + handleExactChange(idx, delta)} + />
-
- ) : ( - // MODO EXACTO -
- CARTAS - handleExactChange(idx, delta)} - /> -
- )} - - {/* Botón Toggle */} - + )} + +
)} ))} {/* Botón Añadir Carta */} -
+
@@ -165,7 +172,7 @@ export default function SubscaleModal({ onClose, onSave, targetInfo }) {
{/* Botones de Acción */} -
+