Merge pull request #41 from JurunenseDevInterno/feat-fixar-coluna-linha-sintectico

Feat fixar coluna linha sintectico
This commit is contained in:
Alessandro Gonçalves 2025-11-10 15:05:16 -03:00 committed by GitHub
commit 62fb73b142
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 54 additions and 23 deletions

View File

@ -2191,7 +2191,7 @@ export default function Teste() {
if (isSelected) {
style +=
" bg-gradient-to-r from-green-100 to-emerald-100 border-l-4 border-green-500 shadow-lg";
" bg-green-100 shadow-lg";
}
switch (row.type) {
@ -2822,19 +2822,41 @@ export default function Teste() {
}}
onScroll={() => syncScroll('descricao')}
>
{hierarchicalData.map((row, index) => (
{hierarchicalData.map((row, index) => {
const linhaId = `${row.type}-${row.grupo || ""}-${row.subgrupo || ""}-${row.centro_custo || ""}-${row.codigo_conta || ""}`;
const isSelected = linhaSelecionada === linhaId;
return (
<div
key={index}
className={`text-sm border-b border-gray-100 transition-all duration-200 ease-in-out ${getRowStyle(row)}`}
style={{ height: '40px', display: 'flex', alignItems: 'center', minWidth: 'max-content' }}
className={`text-sm border-b border-gray-100 transition-all duration-200 ease-in-out ${getRowStyle(row)} cursor-pointer`}
style={{
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',
}}
onClick={() => handleRowClick(row)}
>
<div
className="py-1 whitespace-nowrap flex items-center h-full w-full"
style={{
minWidth: 'max-content',
height: '100%',
paddingLeft: isSelected ? 'calc(1rem - 4px)' : '1rem',
paddingRight: '1rem',
}}
>
<div className="px-4 py-1 whitespace-nowrap flex items-center h-full" style={{ minWidth: 'max-content' }}>
<div style={getIndentStyle(row.level)} className="flex items-center h-full">
{renderCellContent(row)}
</div>
</div>
</div>
))}
);
})}
</div>
</div>
@ -2871,18 +2893,26 @@ export default function Teste() {
{/* Table Body */}
<tbody>
{hierarchicalData.map((row, index) => (
{hierarchicalData.map((row, index) => {
const linhaId = `${row.type}-${row.grupo || ""}-${row.subgrupo || ""}-${row.centro_custo || ""}-${row.codigo_conta || ""}`;
const isSelected = linhaSelecionada === linhaId;
return (
<tr
key={index}
className={`text-sm border-b border-gray-100 transition-all duration-200 ease-in-out ${getRowStyle(row)}`}
style={{ height: '40px' }}
style={{
height: '40px',
minHeight: '40px',
maxHeight: '40px',
boxSizing: 'border-box',
}}
>
{/* Colunas de valores por mês */}
{mesesDisponiveis.map((mes) => (
<React.Fragment key={mes}>
<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]"
style={{ height: '40px', verticalAlign: 'middle' }}
style={{ height: '40px', minHeight: '40px', maxHeight: '40px', verticalAlign: 'middle', boxSizing: 'border-box' }}
onClick={() => handleRowClick(row, mes)}
title={
row.valoresPorMes && row.valoresPorMes[mes]
@ -2910,7 +2940,7 @@ export default function Teste() {
</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]"
style={{ height: '40px', verticalAlign: 'middle' }}
style={{ height: '40px', minHeight: '40px', maxHeight: '40px', verticalAlign: 'middle', boxSizing: 'border-box' }}
onClick={() => handleRowClick(row, mes)}
title={
row.percentuaisPorMes &&
@ -2930,7 +2960,7 @@ export default function Teste() {
{/* Coluna Total */}
<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]"
style={{ height: '40px', verticalAlign: 'middle' }}
style={{ height: '40px', minHeight: '40px', maxHeight: '40px', verticalAlign: 'middle', boxSizing: 'border-box' }}
onClick={() => handleRowClick(row)}
title={row.total ? formatCurrency(row.total) : "-"}
>
@ -2953,7 +2983,7 @@ export default function Teste() {
{/* Coluna Percentual Total */}
<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]"
style={{ height: '40px', verticalAlign: 'middle' }}
style={{ height: '40px', minHeight: '40px', maxHeight: '40px', verticalAlign: 'middle', boxSizing: 'border-box' }}
onClick={() => handleRowClick(row)}
title={
row.percentualTotal !== undefined
@ -2966,7 +2996,8 @@ export default function Teste() {
: "-"}
</td>
</tr>
))}
);
})}
</tbody>
</table>
</div>