Fast follow on draggable column re-order (#1667)
This commit is contained in:
@ -28,6 +28,7 @@ export const MenuItemLeftContent = ({
|
|||||||
<IconGripVertical
|
<IconGripVertical
|
||||||
size={theme.icon.size.md}
|
size={theme.icon.size.md}
|
||||||
stroke={theme.icon.stroke.sm}
|
stroke={theme.icon.stroke.sm}
|
||||||
|
color={theme.font.color.extraLight}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{LeftIcon && (
|
{LeftIcon && (
|
||||||
|
|||||||
@ -57,26 +57,44 @@ export const ViewFieldsVisibilityDropdownSection = <
|
|||||||
draggableId={field.key}
|
draggableId={field.key}
|
||||||
index={index}
|
index={index}
|
||||||
>
|
>
|
||||||
{(provided) => (
|
{(draggableProvided) => {
|
||||||
<div
|
const draggableStyle =
|
||||||
ref={provided.innerRef}
|
draggableProvided.draggableProps.style;
|
||||||
{...provided.draggableProps}
|
|
||||||
{...provided.dragHandleProps}
|
return (
|
||||||
>
|
<div
|
||||||
<MenuItem
|
ref={draggableProvided.innerRef}
|
||||||
isDraggable={isDraggable}
|
{...{
|
||||||
key={field.key}
|
...draggableProvided.draggableProps,
|
||||||
LeftIcon={field.Icon}
|
style: {
|
||||||
iconButtons={[
|
...draggableStyle,
|
||||||
{
|
left: 'auto',
|
||||||
Icon: field.isVisible ? IconMinus : IconPlus,
|
top: 'auto',
|
||||||
onClick: () => onVisibilityChange(field),
|
transform: draggableStyle?.transform?.replace(
|
||||||
|
/\(-?\d+px,/,
|
||||||
|
'(0,',
|
||||||
|
),
|
||||||
},
|
},
|
||||||
]}
|
}}
|
||||||
text={field.name}
|
{...draggableProvided.dragHandleProps}
|
||||||
/>
|
>
|
||||||
</div>
|
<MenuItem
|
||||||
)}
|
isDraggable={isDraggable}
|
||||||
|
key={field.key}
|
||||||
|
LeftIcon={field.Icon}
|
||||||
|
iconButtons={[
|
||||||
|
{
|
||||||
|
Icon: field.isVisible
|
||||||
|
? IconMinus
|
||||||
|
: IconPlus,
|
||||||
|
onClick: () => onVisibilityChange(field),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
text={field.name}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}}
|
||||||
</Draggable>
|
</Draggable>
|
||||||
))}
|
))}
|
||||||
{provided.placeholder}
|
{provided.placeholder}
|
||||||
|
|||||||
Reference in New Issue
Block a user