Merge pull request #42 from JurunenseDevInterno/dev

Dev
This commit is contained in:
Alessandro Gonçalves 2025-11-10 15:05:46 -03:00 committed by GitHub
commit 73a3ff2981
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) { if (isSelected) {
style += 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) { switch (row.type) {
@ -2822,19 +2822,41 @@ 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)} cursor-pointer`}
<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',
}}
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 style={getIndentStyle(row.level)} className="flex items-center h-full">
{renderCellContent(row)}
</div>
</div> </div>
</div> </div>
</div> );
))} })}
</div> </div>
</div> </div>
@ -2871,18 +2893,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 +2940,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 +2960,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 +2983,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 +2996,8 @@ export default function Teste() {
: "-"} : "-"}
</td> </td>
</tr> </tr>
))} );
})}
</tbody> </tbody>
</table> </table>
</div> </div>