mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:28:37 +08:00
amis-saas-10220 tpl外观
Change-Id: Idafaa5c9894a5559ed7fcbdc2038efaf34fb72d4
This commit is contained in:
parent
aeeef05c12
commit
c77aa20e1e
@ -312,9 +312,7 @@ export class FlexPluginBase extends BasePlugin {
|
||||
{
|
||||
title: '外观',
|
||||
className: 'p-none',
|
||||
body: getSchemaTpl('collapseGroup', [
|
||||
...getSchemaTpl('theme:common', [])
|
||||
])
|
||||
body: getSchemaTpl('collapseGroup', [...getSchemaTpl('theme:common')])
|
||||
}
|
||||
])
|
||||
];
|
||||
|
@ -216,10 +216,7 @@ export class TplPlugin extends BasePlugin {
|
||||
{
|
||||
title: '外观',
|
||||
body: getSchemaTpl('collapseGroup', [
|
||||
...getSchemaTpl('style:common', ['layout']),
|
||||
getSchemaTpl('style:classNames', {
|
||||
isFormItem: false
|
||||
})
|
||||
...getSchemaTpl('theme:common', ['layout'], ['font'])
|
||||
])
|
||||
},
|
||||
{
|
||||
|
@ -567,30 +567,19 @@ setSchemaTpl('theme:shadow', (option: any = {}) => {
|
||||
|
||||
setSchemaTpl(
|
||||
'theme:common',
|
||||
(exclude: string[] | string, include: string[] | string) => {
|
||||
(exclude: string[] | string, include: string[]) => {
|
||||
// key统一转换成Kebab case,eg: boxShadow => bos-shadow
|
||||
exclude = (
|
||||
exclude ? (Array.isArray(exclude) ? exclude : [exclude]) : []
|
||||
).map((key: string) => kebabCase(key));
|
||||
|
||||
include = (
|
||||
include ? (Array.isArray(include) ? include : [include]) : []
|
||||
).map((key: string) => kebabCase(key));
|
||||
return [
|
||||
{
|
||||
header: '布局',
|
||||
key: 'layout',
|
||||
body: [
|
||||
{
|
||||
type: 'style-display',
|
||||
label: false,
|
||||
const moreStyle =
|
||||
include?.map(key =>
|
||||
getSchemaTpl(`theme:${key}`, {
|
||||
name: 'style'
|
||||
}
|
||||
].filter(comp => !~exclude.indexOf(comp.type.replace(/^style-/i, '')))
|
||||
},
|
||||
{
|
||||
title: '自定义样式',
|
||||
body: [
|
||||
})
|
||||
) || [];
|
||||
const styles = moreStyle.concat([
|
||||
getSchemaTpl('theme:border', {
|
||||
name: 'style'
|
||||
}),
|
||||
@ -610,7 +599,22 @@ setSchemaTpl(
|
||||
getSchemaTpl('theme:shadow', {
|
||||
name: 'style.boxShadow'
|
||||
})
|
||||
]
|
||||
]);
|
||||
return [
|
||||
{
|
||||
header: '布局',
|
||||
key: 'layout',
|
||||
body: [
|
||||
{
|
||||
type: 'style-display',
|
||||
label: false,
|
||||
name: 'style'
|
||||
}
|
||||
].filter(comp => !~exclude.indexOf(comp.type.replace(/^style-/i, '')))
|
||||
},
|
||||
{
|
||||
title: '自定义样式',
|
||||
body: styles
|
||||
},
|
||||
{
|
||||
title: '样式源码',
|
||||
@ -622,8 +626,6 @@ setSchemaTpl(
|
||||
}
|
||||
]
|
||||
}
|
||||
].filter(item =>
|
||||
include.length ? ~include.indexOf(item.key) : !~exclude.indexOf(item.key)
|
||||
);
|
||||
].filter(item => !~exclude.indexOf(item.key || ''));
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user