Skip to content

Commit

Permalink
fix(AnalyticalTable): update column header icons to align with latest…
Browse files Browse the repository at this point in the history
… specs (#6593)
  • Loading branch information
Lukas742 authored Nov 18, 2024
1 parent 06a88f5 commit b5859ed
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@
display: flex;
justify-content: center;
}

.icon {
height: 0.8125rem;
width: 0.8125rem;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { VirtualItem, Virtualizer } from '@tanstack/react-virtual';
import IconDesign from '@ui5/webcomponents/dist/types/IconDesign.js';
import iconFilter from '@ui5/webcomponents-icons/dist/filter.js';
import iconGroup from '@ui5/webcomponents-icons/dist/group-2.js';
import iconSortAscending from '@ui5/webcomponents-icons/dist/sort-ascending.js';
Expand Down Expand Up @@ -108,16 +109,16 @@ export const ColumnHeader = (props: ColumnHeaderProps) => {
style.textAlign = column.hAlign.toLowerCase();
}

if (column.isSorted) margin++;
if (column.isGrouped) margin++;
if (isFiltered) margin++;
if (column.isSorted) margin += 0.8125;
if (column.isGrouped) margin += 0.8125;
if (isFiltered) margin += 0.8125;

if (margin === 0) {
return style;
}

if (margin > 0) {
margin += 0.625;
margin += 0.75;
}

style.marginInlineEnd = `${margin}rem`;
Expand Down Expand Up @@ -234,11 +235,20 @@ export const ColumnHeader = (props: ColumnHeaderProps) => {
className={classNames.iconContainer}
data-component-name={`AnalyticalTableHeaderIconsContainer-${columnId}`}
>
{isFiltered && <Icon name={iconFilter} aria-hidden />}
{isFiltered && (
<Icon design={IconDesign.NonInteractive} name={iconFilter} aria-hidden className={classNames.icon} />
)}
{column.isSorted && (
<Icon name={column.isSortedDesc ? iconSortDescending : iconSortAscending} aria-hidden />
<Icon
design={IconDesign.NonInteractive}
name={column.isSortedDesc ? iconSortDescending : iconSortAscending}
aria-hidden
className={classNames.icon}
/>
)}
{column.isGrouped && (
<Icon design={IconDesign.NonInteractive} name={iconGroup} aria-hidden className={classNames.icon} />
)}
{column.isGrouped && <Icon name={iconGroup} aria-hidden />}
</div>
</div>
{hasPopover &&
Expand Down

0 comments on commit b5859ed

Please sign in to comment.