fix: correção de alinhamento
This commit is contained in:
parent
b17b4390d0
commit
35f1038317
|
|
@ -2191,7 +2191,7 @@ export default function Teste() {
|
||||||
|
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
style +=
|
style +=
|
||||||
" bg-gradient-to-r from-green-100 to-emerald-100 border-l-4 border-green-500 shadow-lg";
|
" bg-gradient-to-r from-green-100 to-emerald-100 shadow-lg";
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (row.type) {
|
switch (row.type) {
|
||||||
|
|
@ -2822,19 +2822,40 @@ export default function Teste() {
|
||||||
}}
|
}}
|
||||||
onScroll={() => syncScroll('descricao')}
|
onScroll={() => syncScroll('descricao')}
|
||||||
>
|
>
|
||||||
{hierarchicalData.map((row, index) => (
|
{hierarchicalData.map((row, index) => {
|
||||||
<div
|
const linhaId = `${row.type}-${row.grupo || ""}-${row.subgrupo || ""}-${row.centro_custo || ""}-${row.codigo_conta || ""}`;
|
||||||
key={index}
|
const isSelected = linhaSelecionada === linhaId;
|
||||||
className={`text-sm border-b border-gray-100 transition-all duration-200 ease-in-out ${getRowStyle(row)}`}
|
return (
|
||||||
style={{ height: '40px', display: 'flex', alignItems: 'center', minWidth: 'max-content' }}
|
<div
|
||||||
>
|
key={index}
|
||||||
<div className="px-4 py-1 whitespace-nowrap flex items-center h-full" style={{ minWidth: 'max-content' }}>
|
className={`text-sm border-b border-gray-100 transition-all duration-200 ease-in-out ${getRowStyle(row)}`}
|
||||||
<div style={getIndentStyle(row.level)} className="flex items-center h-full">
|
style={{
|
||||||
{renderCellContent(row)}
|
height: '40px',
|
||||||
|
minHeight: '40px',
|
||||||
|
maxHeight: '40px',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
minWidth: 'max-content',
|
||||||
|
boxSizing: 'border-box',
|
||||||
|
borderLeft: isSelected ? '4px solid rgb(34 197 94)' : 'none',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="py-1 whitespace-nowrap flex items-center h-full"
|
||||||
|
style={{
|
||||||
|
minWidth: 'max-content',
|
||||||
|
height: '100%',
|
||||||
|
paddingLeft: isSelected ? 'calc(1rem - 4px)' : '1rem',
|
||||||
|
paddingRight: '1rem',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div style={getIndentStyle(row.level)} className="flex items-center h-full">
|
||||||
|
{renderCellContent(row)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
);
|
||||||
))}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -2871,18 +2892,26 @@ export default function Teste() {
|
||||||
|
|
||||||
{/* Table Body */}
|
{/* Table Body */}
|
||||||
<tbody>
|
<tbody>
|
||||||
{hierarchicalData.map((row, index) => (
|
{hierarchicalData.map((row, index) => {
|
||||||
<tr
|
const linhaId = `${row.type}-${row.grupo || ""}-${row.subgrupo || ""}-${row.centro_custo || ""}-${row.codigo_conta || ""}`;
|
||||||
key={index}
|
const isSelected = linhaSelecionada === linhaId;
|
||||||
className={`text-sm border-b border-gray-100 transition-all duration-200 ease-in-out ${getRowStyle(row)}`}
|
return (
|
||||||
style={{ height: '40px' }}
|
<tr
|
||||||
>
|
key={index}
|
||||||
|
className={`text-sm border-b border-gray-100 transition-all duration-200 ease-in-out ${getRowStyle(row)}`}
|
||||||
|
style={{
|
||||||
|
height: '40px',
|
||||||
|
minHeight: '40px',
|
||||||
|
maxHeight: '40px',
|
||||||
|
boxSizing: 'border-box',
|
||||||
|
}}
|
||||||
|
>
|
||||||
{/* Colunas de valores por mês */}
|
{/* Colunas de valores por mês */}
|
||||||
{mesesDisponiveis.map((mes) => (
|
{mesesDisponiveis.map((mes) => (
|
||||||
<React.Fragment key={mes}>
|
<React.Fragment key={mes}>
|
||||||
<td
|
<td
|
||||||
className="px-2 py-1 text-right font-semibold cursor-pointer hover:bg-blue-50/50 transition-colors duration-200 whitespace-nowrap overflow-hidden w-[120px] min-w-[120px]"
|
className="px-2 py-1 text-right font-semibold cursor-pointer hover:bg-blue-50/50 transition-colors duration-200 whitespace-nowrap overflow-hidden w-[120px] min-w-[120px]"
|
||||||
style={{ height: '40px', verticalAlign: 'middle' }}
|
style={{ height: '40px', minHeight: '40px', maxHeight: '40px', verticalAlign: 'middle', boxSizing: 'border-box' }}
|
||||||
onClick={() => handleRowClick(row, mes)}
|
onClick={() => handleRowClick(row, mes)}
|
||||||
title={
|
title={
|
||||||
row.valoresPorMes && row.valoresPorMes[mes]
|
row.valoresPorMes && row.valoresPorMes[mes]
|
||||||
|
|
@ -2910,7 +2939,7 @@ export default function Teste() {
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
className="px-2 py-1 text-center font-medium cursor-pointer hover:bg-blue-50/50 transition-colors duration-200 whitespace-nowrap overflow-hidden w-[100px] min-w-[100px]"
|
className="px-2 py-1 text-center font-medium cursor-pointer hover:bg-blue-50/50 transition-colors duration-200 whitespace-nowrap overflow-hidden w-[100px] min-w-[100px]"
|
||||||
style={{ height: '40px', verticalAlign: 'middle' }}
|
style={{ height: '40px', minHeight: '40px', maxHeight: '40px', verticalAlign: 'middle', boxSizing: 'border-box' }}
|
||||||
onClick={() => handleRowClick(row, mes)}
|
onClick={() => handleRowClick(row, mes)}
|
||||||
title={
|
title={
|
||||||
row.percentuaisPorMes &&
|
row.percentuaisPorMes &&
|
||||||
|
|
@ -2930,7 +2959,7 @@ export default function Teste() {
|
||||||
{/* Coluna Total */}
|
{/* Coluna Total */}
|
||||||
<td
|
<td
|
||||||
className="px-4 py-1 text-right font-semibold cursor-pointer hover:bg-blue-50/50 transition-colors duration-200 whitespace-nowrap overflow-hidden w-[120px] min-w-[120px]"
|
className="px-4 py-1 text-right font-semibold cursor-pointer hover:bg-blue-50/50 transition-colors duration-200 whitespace-nowrap overflow-hidden w-[120px] min-w-[120px]"
|
||||||
style={{ height: '40px', verticalAlign: 'middle' }}
|
style={{ height: '40px', minHeight: '40px', maxHeight: '40px', verticalAlign: 'middle', boxSizing: 'border-box' }}
|
||||||
onClick={() => handleRowClick(row)}
|
onClick={() => handleRowClick(row)}
|
||||||
title={row.total ? formatCurrency(row.total) : "-"}
|
title={row.total ? formatCurrency(row.total) : "-"}
|
||||||
>
|
>
|
||||||
|
|
@ -2953,7 +2982,7 @@ export default function Teste() {
|
||||||
{/* Coluna Percentual Total */}
|
{/* Coluna Percentual Total */}
|
||||||
<td
|
<td
|
||||||
className="px-2 py-1 text-center font-medium cursor-pointer hover:bg-blue-50/50 transition-colors duration-200 whitespace-nowrap overflow-hidden w-[100px] min-w-[100px]"
|
className="px-2 py-1 text-center font-medium cursor-pointer hover:bg-blue-50/50 transition-colors duration-200 whitespace-nowrap overflow-hidden w-[100px] min-w-[100px]"
|
||||||
style={{ height: '40px', verticalAlign: 'middle' }}
|
style={{ height: '40px', minHeight: '40px', maxHeight: '40px', verticalAlign: 'middle', boxSizing: 'border-box' }}
|
||||||
onClick={() => handleRowClick(row)}
|
onClick={() => handleRowClick(row)}
|
||||||
title={
|
title={
|
||||||
row.percentualTotal !== undefined
|
row.percentualTotal !== undefined
|
||||||
|
|
@ -2966,7 +2995,8 @@ export default function Teste() {
|
||||||
: "-"}
|
: "-"}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue