mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:48:55 +08:00
Merge pull request #8205 from wibetter/master
fix(amis-editor): theme:common补充hidePaddingAndMargin,支持隐藏内外边距配置项
This commit is contained in:
commit
fdeb1cfa96
@ -371,7 +371,6 @@ setSchemaTpl(
|
|||||||
key: item.title,
|
key: item.title,
|
||||||
body: flatten(item.body)
|
body: flatten(item.body)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: 'collapse-group',
|
type: 'collapse-group',
|
||||||
activeKey: collapseGroupBody
|
activeKey: collapseGroupBody
|
||||||
|
@ -579,14 +579,17 @@ setSchemaTpl(
|
|||||||
classname?: string;
|
classname?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
hiddenOn?: string;
|
hiddenOn?: string;
|
||||||
|
hidePaddingAndMargin?: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const {
|
const {
|
||||||
collapsed = false,
|
collapsed = false,
|
||||||
extra = [],
|
extra = [],
|
||||||
classname = 'baseControlClassName',
|
classname = 'baseControlClassName',
|
||||||
title = '基本样式',
|
title = '基本样式',
|
||||||
hiddenOn
|
hiddenOn,
|
||||||
|
hidePaddingAndMargin
|
||||||
} = option;
|
} = option;
|
||||||
|
const curHidePaddingAndMargin = hidePaddingAndMargin ?? false;
|
||||||
const styleStateFunc = (visibleOn: string, state: string) => {
|
const styleStateFunc = (visibleOn: string, state: string) => {
|
||||||
return [
|
return [
|
||||||
getSchemaTpl('theme:border', {
|
getSchemaTpl('theme:border', {
|
||||||
@ -597,10 +600,12 @@ setSchemaTpl(
|
|||||||
visibleOn: visibleOn,
|
visibleOn: visibleOn,
|
||||||
name: `themeCss.${classname}.radius:${state}`
|
name: `themeCss.${classname}.radius:${state}`
|
||||||
}),
|
}),
|
||||||
getSchemaTpl('theme:paddingAndMargin', {
|
!curHidePaddingAndMargin
|
||||||
visibleOn: visibleOn,
|
? getSchemaTpl('theme:paddingAndMargin', {
|
||||||
name: `themeCss.${classname}.padding-and-margin:${state}`
|
visibleOn: visibleOn,
|
||||||
}),
|
name: `themeCss.${classname}.padding-and-margin:${state}`
|
||||||
|
})
|
||||||
|
: null,
|
||||||
getSchemaTpl('theme:colorPicker', {
|
getSchemaTpl('theme:colorPicker', {
|
||||||
visibleOn: visibleOn,
|
visibleOn: visibleOn,
|
||||||
name: `themeCss.${classname}.background:${state}`,
|
name: `themeCss.${classname}.background:${state}`,
|
||||||
@ -614,15 +619,17 @@ setSchemaTpl(
|
|||||||
visibleOn: visibleOn,
|
visibleOn: visibleOn,
|
||||||
name: `themeCss.${classname}.boxShadow:${state}`
|
name: `themeCss.${classname}.boxShadow:${state}`
|
||||||
})
|
})
|
||||||
].concat(
|
]
|
||||||
extra.map(item => {
|
.filter(item => item)
|
||||||
return {
|
.concat(
|
||||||
...item,
|
extra.map(item => {
|
||||||
visibleOn: visibleOn,
|
return {
|
||||||
name: `${item.name}:${state}`
|
...item,
|
||||||
};
|
visibleOn: visibleOn,
|
||||||
})
|
name: `${item.name}:${state}`
|
||||||
);
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
};
|
};
|
||||||
const styles = [
|
const styles = [
|
||||||
{
|
{
|
||||||
@ -672,6 +679,7 @@ setSchemaTpl(
|
|||||||
layoutExtra?: any[];
|
layoutExtra?: any[];
|
||||||
classname?: string;
|
classname?: string;
|
||||||
baseTitle?: string;
|
baseTitle?: string;
|
||||||
|
hidePaddingAndMargin?: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
let {
|
let {
|
||||||
exclude,
|
exclude,
|
||||||
@ -680,7 +688,8 @@ setSchemaTpl(
|
|||||||
baseExtra,
|
baseExtra,
|
||||||
layoutExtra,
|
layoutExtra,
|
||||||
classname,
|
classname,
|
||||||
baseTitle
|
baseTitle,
|
||||||
|
hidePaddingAndMargin
|
||||||
} = option || {};
|
} = option || {};
|
||||||
|
|
||||||
const curCollapsed = collapsed ?? false; // 默认都展开
|
const curCollapsed = collapsed ?? false; // 默认都展开
|
||||||
@ -708,7 +717,8 @@ setSchemaTpl(
|
|||||||
collapsed: curCollapsed,
|
collapsed: curCollapsed,
|
||||||
extra: baseExtra,
|
extra: baseExtra,
|
||||||
classname,
|
classname,
|
||||||
title: baseTitle
|
title: baseTitle,
|
||||||
|
hidePaddingAndMargin
|
||||||
}),
|
}),
|
||||||
...extra,
|
...extra,
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user