mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 11:07:52 +08:00
fix(布局能力提升amis-saas-7790): 最大最小宽高增加关联
Change-Id: I918c6f53cddbbb97fb23425bab3a97147eeb0ac3
This commit is contained in:
parent
e8549dc2f9
commit
26b56c0070
@ -13,13 +13,6 @@ import type {
|
||||
|
||||
// 默认的列容器Schema
|
||||
const defaultFlexColumnSchema = (title: string) => {
|
||||
/*
|
||||
{
|
||||
type: 'tpl',
|
||||
tpl: title || '新的一列',
|
||||
inline: false
|
||||
}
|
||||
*/
|
||||
return {
|
||||
type: 'wrapper',
|
||||
body: [],
|
||||
|
@ -633,31 +633,6 @@ setSchemaTpl(
|
||||
};
|
||||
});
|
||||
|
||||
// 最大宽度设置
|
||||
setSchemaTpl(
|
||||
'layout:max-width',
|
||||
(config?: {
|
||||
label?: string;
|
||||
name?: string;
|
||||
value?: string,
|
||||
visibleOn?: string;
|
||||
unitOptions?: Array<string>;
|
||||
pipeIn?: (value: any, data: any) => void;
|
||||
pipeOut?: (value: any, data: any) => void;
|
||||
}) => {
|
||||
return {
|
||||
type: 'input-number',
|
||||
label: config?.label || tipedLabel('最大宽度', '最大宽度即当前元素最大的水平展示区域'),
|
||||
name: config?.name || 'style.maxWidth',
|
||||
value: config?.value,
|
||||
visibleOn: config?.visibleOn ?? '!data.isFixedWidth',
|
||||
clearable: true,
|
||||
unitOptions: config?.unitOptions ?? LayoutUnitOptions,
|
||||
pipeIn: config?.pipeIn,
|
||||
pipeOut: config?.pipeOut,
|
||||
};
|
||||
});
|
||||
|
||||
// x轴(水平轴)滚动模式
|
||||
setSchemaTpl(
|
||||
'layout:overflow-x',
|
||||
@ -698,6 +673,32 @@ setSchemaTpl(
|
||||
};
|
||||
});
|
||||
|
||||
// 最大宽度设置
|
||||
setSchemaTpl(
|
||||
'layout:max-width',
|
||||
(config?: {
|
||||
label?: string;
|
||||
name?: string;
|
||||
value?: string,
|
||||
visibleOn?: string;
|
||||
unitOptions?: Array<string>;
|
||||
pipeIn?: (value: any, data: any) => void;
|
||||
pipeOut?: (value: any, data: any) => void;
|
||||
}) => {
|
||||
return {
|
||||
type: 'input-number',
|
||||
label: config?.label || tipedLabel('最大宽度', '最大宽度即当前元素最大的水平展示区域'),
|
||||
name: config?.name || 'style.maxWidth',
|
||||
value: config?.value,
|
||||
min: '${style.minWidth | toInt}',
|
||||
visibleOn: config?.visibleOn ?? '!data.isFixedWidth',
|
||||
clearable: true,
|
||||
unitOptions: config?.unitOptions ?? LayoutUnitOptions,
|
||||
pipeIn: config?.pipeIn,
|
||||
pipeOut: config?.pipeOut,
|
||||
};
|
||||
});
|
||||
|
||||
// 最小宽度设置
|
||||
setSchemaTpl(
|
||||
'layout:min-width',
|
||||
@ -715,6 +716,7 @@ setSchemaTpl(
|
||||
label: config?.label || tipedLabel('最小宽度', '最小宽度即当前元素最小的水平展示区域'),
|
||||
name: config?.name || 'style.minWidth',
|
||||
value: config?.value,
|
||||
max: '${style.maxWidth | toInt}',
|
||||
visibleOn: config?.visibleOn ?? '!data.isFixedWidth',
|
||||
clearable: true,
|
||||
unitOptions: config?.unitOptions ?? LayoutUnitOptions,
|
||||
@ -798,6 +800,7 @@ setSchemaTpl(
|
||||
label: config?.label || tipedLabel('最大高度', '最大高度即当前元素最多的展示高度'),
|
||||
name: config?.name || 'style.maxHeight',
|
||||
value: config?.value,
|
||||
min: '${style.minHeight | toInt}',
|
||||
visibleOn: config?.visibleOn ?? '!data.isFixedHeight',
|
||||
clearable: true,
|
||||
unitOptions: config?.unitOptions ?? LayoutUnitOptions,
|
||||
@ -823,6 +826,7 @@ setSchemaTpl(
|
||||
label: config?.label || tipedLabel('最小高度', '最小宽度即当前元素最小的垂直展示区域'),
|
||||
name: config?.name || 'style.minHeight',
|
||||
value: config?.value,
|
||||
max: '${style.maxHeight | toInt}',
|
||||
visibleOn: config?.visibleOn ?? '!data.isFixedHeight',
|
||||
clearable: true,
|
||||
unitOptions: config?.unitOptions ?? LayoutUnitOptions,
|
||||
|
Loading…
Reference in New Issue
Block a user