mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:56:29 +00:00
feat: improve styling
This commit is contained in:
parent
8bd5a83947
commit
8048482247
@ -76,7 +76,7 @@ export function Droppable(props: DroppableProps) {
|
||||
return (
|
||||
<Component
|
||||
{...others}
|
||||
className={cls(className, `droppable-${id}`, {
|
||||
className={cls(className, `droppable droppable-${id}`, {
|
||||
isOver,
|
||||
})}
|
||||
ref={(el: HTMLElement) => {
|
||||
@ -138,7 +138,7 @@ export function SortableItem(props: SortableItemProps) {
|
||||
<Component
|
||||
{...others}
|
||||
// {...attributes}
|
||||
className={cls(className, `droppable-${id}`, {
|
||||
className={cls(className, `droppable droppable-${id}`, {
|
||||
isOver,
|
||||
isDragging,
|
||||
})}
|
||||
|
@ -398,11 +398,27 @@ Menu.SubMenu = observer((props: any) => {
|
||||
) : (
|
||||
<AntdMenu.SubMenu
|
||||
{...props}
|
||||
icon={<IconPicker type={icon} />}
|
||||
icon={null}
|
||||
// icon={<IconPicker type={icon} />}
|
||||
title={
|
||||
<>
|
||||
{schema.title} <DesignableBar />
|
||||
</>
|
||||
<SortableItem
|
||||
id={schema.name}
|
||||
data={{
|
||||
title: schema.title,
|
||||
path: getSchemaPath(schema),
|
||||
}}
|
||||
>
|
||||
{icon && (
|
||||
<span style={{ marginRight: 10 }}>
|
||||
<IconPicker type={icon} />
|
||||
</span>
|
||||
)}
|
||||
{schema.title}
|
||||
<DesignableBar />
|
||||
</SortableItem>
|
||||
// <>
|
||||
// {schema.title} <DesignableBar />
|
||||
// </>
|
||||
}
|
||||
eventKey={schema.name}
|
||||
key={schema.name}
|
||||
@ -734,16 +750,13 @@ Menu.DesignableBar = (props) => {
|
||||
_.set(initialValues, name, get(schema, name));
|
||||
},
|
||||
);
|
||||
const values = await FormDialog(
|
||||
`编辑菜单项`,
|
||||
() => {
|
||||
return (
|
||||
<FormLayout layout={'vertical'}>
|
||||
<SchemaField schema={formConfig.schema} />
|
||||
</FormLayout>
|
||||
);
|
||||
},
|
||||
).open({
|
||||
const values = await FormDialog(`编辑菜单项`, () => {
|
||||
return (
|
||||
<FormLayout layout={'vertical'}>
|
||||
<SchemaField schema={formConfig.schema} />
|
||||
</FormLayout>
|
||||
);
|
||||
}).open({
|
||||
initialValues,
|
||||
});
|
||||
if (values.title) {
|
||||
|
@ -6,6 +6,10 @@
|
||||
|
||||
.ant-menu-horizontal {
|
||||
width: 100%;
|
||||
.ant-menu-item:active,
|
||||
.ant-menu-submenu-title:active {
|
||||
background-color: inherit !important;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-menu-item-active .designable-bar {
|
||||
@ -110,3 +114,39 @@
|
||||
.nb-add-new-menu-item.menu-mode-inline {
|
||||
margin: 0 14px;
|
||||
}
|
||||
|
||||
.ant-menu-horizontal {
|
||||
.ant-menu-submenu,
|
||||
.ant-menu-item {
|
||||
.droppable.isDragging {
|
||||
opacity: .2;
|
||||
}
|
||||
.droppable:not(.isDragging).isOver::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 100%;
|
||||
width: 2px;
|
||||
background-color: #f18b62;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-menu-inline {
|
||||
.ant-menu-submenu,
|
||||
.ant-menu-item {
|
||||
.droppable.isDragging {
|
||||
opacity: .2;
|
||||
}
|
||||
.droppable:not(.isDragging).isOver::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 2px;
|
||||
width: 100%;
|
||||
background-color: #f18b62;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -173,7 +173,13 @@ export function SortableHeaderRow(props) {
|
||||
}}
|
||||
>
|
||||
{createPortal(
|
||||
<DragOverlay style={{ pointerEvents: 'none', whiteSpace: 'nowrap' }}>
|
||||
<DragOverlay
|
||||
dropAnimation={{
|
||||
duration: 10,
|
||||
easing: 'cubic-bezier(0.18, 0.67, 0.6, 1.22)',
|
||||
}}
|
||||
style={{ pointerEvents: 'none', whiteSpace: 'nowrap' }}
|
||||
>
|
||||
{dragOverlayContent}
|
||||
</DragOverlay>,
|
||||
document.body,
|
||||
|
@ -242,4 +242,20 @@ td.nb-table-operation {
|
||||
.field-interface-attachment {
|
||||
margin-top: -13px;
|
||||
margin-bottom: -13px;
|
||||
}
|
||||
|
||||
.ant-table-cell {
|
||||
&.droppable.isDragging {
|
||||
opacity: .5;
|
||||
background-color: rgba(241, 139, 98, 0.06) !important;
|
||||
}
|
||||
&.droppable:not(.isDragging).isOver::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 100%;
|
||||
width: 2px;
|
||||
background-color: #f18b62;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user