Skip to content

Commit

Permalink
Merge pull request #5754 from matuzalemsteles/dropdown-columns-visibi…
Browse files Browse the repository at this point in the history
…lity

chore(@clayui/core): visual adjustments to columns visibility DropDown
  • Loading branch information
matuzalemsteles authored Jan 22, 2024
2 parents 3c9d655 + 364dfe2 commit ab4b2df
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/clay-core/src/drop-down/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ type Props<T> = {
trigger: React.ReactElement & {
ref?: (node: HTMLButtonElement | null) => void;
};

style?: React.CSSProperties;
} & Omit<Partial<ICollectionProps<T, unknown>>, 'virtualize'>;

function MenuInner<T extends Record<string, unknown> | string | number>(
Expand All @@ -101,6 +103,7 @@ function MenuInner<T extends Record<string, unknown> | string | number>(
items,
onActiveChange,
role = 'menu',
style,
trigger,
...otherProps
}: Props<T>,
Expand Down Expand Up @@ -266,6 +269,7 @@ function MenuInner<T extends Record<string, unknown> | string | number>(
)}
ref={menuRef}
role="presentation"
style={style}
>
<Collection<T>
{...otherProps}
Expand Down
14 changes: 12 additions & 2 deletions packages/clay-core/src/table/Head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ function HeadInner<T extends Record<string, any>>(
},
...collection.getItems(),
]}
style={{
maxWidth: '210px',
minWidth: '210px',
}}
trigger={
<Button
aria-label={
Expand Down Expand Up @@ -120,15 +124,20 @@ function HeadInner<T extends Record<string, any>>(
collection.getItem(item).value
}
>
<Layout.ContentRow>
<Layout.ContentRow verticalAlign="center">
<Layout.ContentCol expand>
{
collection.getItem(item)
.value
}
</Layout.ContentCol>
<Layout.ContentCol>
<Layout.ContentCol float="end">
<Toggle
containerProps={{
style: {
marginBottom: 0,
},
}}
disabled={
!hiddenColumns.has(
item
Expand All @@ -145,6 +154,7 @@ function HeadInner<T extends Record<string, any>>(
).index
)
}
sizing="sm"
toggled={hiddenColumns.has(
item
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ $cadmin-toggle-switch-sizes: map-deep-merge(
),
toggle-switch-handle: (
min-width: 30px,
max-width: 30px,
after: (
margin-left: 38px,
),
Expand Down
1 change: 1 addition & 0 deletions packages/clay-css/src/scss/variables/_toggle-switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ $toggle-switch-sizes: map-deep-merge(
),
toggle-switch-handle: (
min-width: 30px,
max-width: 30px,
after: (
margin-left: 38px,
),
Expand Down

0 comments on commit ab4b2df

Please # to comment.