Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Hide the footer of one of the modals #60

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/antd-lowcode-materials/lowcode/calendar/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,19 @@ export default {
events: [
{
name: 'onPanelChange',
description: '日期面板变化回调',
template:
"onPanelChange(date,mode,${extParams}){\n// 日期面板变化回调\nconsole.log('onPanelChange', date, mode);}",
},
{
name: 'onSelect',
description: '点击选择日期回调',
template:
"onSelect(date,${extParams}){\n// 点击选择日期回调\nconsole.log('onSelect', date);}",
"onSelect(date,info,${extParams}){\n// 选择日期回调,包含来源信息\nconsole.log('onSelect', date,info);}",
},
{
name: 'onChange',
description: '日期变化回调',
template:
"onChange(date,${extParams}){\n// 日期变化回调\nconsole.log('onChange', date);}",
},
Expand Down
59 changes: 26 additions & 33 deletions packages/antd-lowcode-materials/lowcode/list/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
{
name: 'rowKey',
title: {
label: '行Key',
label: '行 Key',
tip: 'rowKey | 当 renderItem 自定义渲染列表项有效时,自定义每一行的 key 的获取方式',
},
propType: {
Expand Down Expand Up @@ -60,11 +60,24 @@ export default {
{
name: 'itemLayout',
title: {
label: '尺寸',
tip: 'itemLayout | 设置 List.Item 布局, 设置成 vertical 则竖直样式显示, 默认横排',
label: '列表项布局',
tip: 'itemLayout | 设置 List.Item 布局设置成 vertical 则竖直样式显示默认横排',
},
propType: { type: 'oneOf', value: ['horizontal', 'vertical'] },
defaultValue: 'horizontal',
extraProps: {
setValue(target, value) {
const { node } = target;

if (value === 'vertical') {
node.setPropValue('grid', undefined);
node.setPropValue('gridEnable', true);
node.setPropValue('grid', undefined);
}else if (value === 'horizontal') {
node.setPropValue('grid', { column: 4, gutter: 0 });
}
},
},
setter: [
{
componentName: 'RadioGroupSetter',
Expand Down Expand Up @@ -132,6 +145,10 @@ export default {
title: '栅格',
display: 'block',
type: 'group',
condition: {
type: 'JSFunction',
value: 'target => target.getProps().getPropValue("itemLayout") !== "vertical"',
},
items: [
{
name: 'gridEnable',
Expand All @@ -140,9 +157,11 @@ export default {
setter: 'BoolSetter',
extraProps: {
setValue(target, value) {
if (value === false) {
const { node } = target;
node.setPropValue('grid', false);
const { node } = target;
if (value === true) {
node.setPropValue('grid', { column: 4, gutter: 0 });
}else if(value === false){
node.setPropValue('grid', undefined)
}
},
},
Expand All @@ -152,18 +171,16 @@ export default {
title: { label: '列数', tip: 'grid.column | 栅格的列数' },
propType: 'number',
setter: 'NumberSetter',
defaultValue: 4,
condition: {
type: 'JSFunction',
value: 'target => !!target.getProps().getPropValue("gridEnable")',
},
},
{
{
name: 'grid.gutter',
title: { label: '间隔', tip: 'grid.gutter | 栅格的间隔' },
propType: 'number',
setter: 'NumberSetter',
defaultValue: 0,
condition: {
type: 'JSFunction',
value: 'target => !!target.getProps().getPropValue("gridEnable")',
Expand Down Expand Up @@ -209,26 +226,6 @@ export default {
value: 'target => !!target.getProps().getPropValue("pagination")',
},
},
// {
// name: 'pagination.defaultCurrent',
// title: {
// label: '默认当前页',
// tip: 'pagination.defaultCurrent | 默认的当前页数',
// },
// setter: [
// {
// componentName: 'NumberSetter',
// props: {
// initialValue: 1,
// },
// },
// 'VariableSetter',
// ],
// condition: {
// type: 'JSFunction',
// value: 'target => !!target.getProps().getPropValue("pagination")',
// },
// },
{
name: 'pagination.current',
title: { label: '当前页数', tip: 'pagination.current | 当前页数' },
Expand Down Expand Up @@ -268,7 +265,6 @@ export default {
},
propType: 'bool',
setter: 'BoolSetter',
defaultValue: false,
condition: {
type: 'JSFunction',
value: 'target => !!target.getProps().getPropValue("pagination")',
Expand All @@ -282,7 +278,6 @@ export default {
},
propType: 'bool',
setter: 'BoolSetter',
defaultValue: false,
condition: {
type: 'JSFunction',
value: 'target => !!target.getProps().getPropValue("pagination")',
Expand All @@ -293,7 +288,6 @@ export default {
title: { label: '简单分页', tip: 'pagination.simple | 简单分页' },
propType: 'bool',
setter: 'BoolSetter',
defaultValue: false,
condition: {
type: 'JSFunction',
value: 'target => !!target.getProps().getPropValue("pagination")',
Expand Down Expand Up @@ -324,7 +318,6 @@ export default {
},
'VariableSetter',
],
defaultValue: 'default',
condition: {
type: 'JSFunction',
value: 'target => !!target.getProps().getPropValue("pagination")',
Expand Down
12 changes: 6 additions & 6 deletions packages/antd-lowcode-materials/lowcode/modal/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default {
},
{
name: 'confirmLoading',
title: { label: '确定按钮loading', tip: '确定按钮loading' },
title: { label: '确定按钮 loading', tip: '确定按钮 loading' },
propType: 'bool',
defaultValue: false,
setter: 'BoolSetter',
Expand All @@ -67,15 +67,15 @@ export default {
},
{
name: 'forceRender',
title: { label: '强制渲染Modal', tip: '强制渲染Modal' },
title: { label: '强制渲染 Modal', tip: '强制渲染 Modal' },
propType: 'bool',
defaultValue: false,
setter: 'BoolSetter',
supportVariable: true
},
{
name: 'keyboard',
title: { label: 'esc关闭', tip: '是否支持键盘 esc 关闭' },
title: { label: 'esc 关闭', tip: '是否支持键盘 esc 关闭' },
propType: 'bool',
defaultValue: true,
setter: 'BoolSetter',
Expand Down Expand Up @@ -155,7 +155,7 @@ export default {
},
{
name: 'okButtonProps',
title: { label: '确认按钮props', tip: '确认按钮props' },
title: { label: '确认按钮 props', tip: '确认按钮 props' },
propType: 'object',
setter: {
componentName: 'ObjectSetter',
Expand Down Expand Up @@ -183,7 +183,7 @@ export default {
},
{
name: 'bodyStyle',
title: { label: 'body样式', tip: 'Modal body 样式' },
title: { label: 'body 样式', tip: 'Modal body 样式' },
propType: 'object',
},
{
Expand All @@ -210,7 +210,7 @@ export default {
name: 'getContainer',
title: {
label: '指定挂载节点',
tip: '指定 Modal 挂载的 HTML 节点, false 为挂载在当前 dom',
tip: '指定 Modal 挂载的 HTML 节点false 为挂载在当前 dom',
},
propType: { type: 'oneOfType', value: ['node', 'func'] },
},
Expand Down
6 changes: 2 additions & 4 deletions packages/antd-lowcode-materials/lowcode/modal/snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ export default [
schema: {
componentName: 'Modal',
props: {
title: 'Basic Modal',
okText: '确认',
cancelText: '取消',
title: 'Hide Footer Modal',
open: true,
footer: null,
footer: ()=> null,
destroyOnClose: true,
},
children: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {
name: 'name',
title: {
label: 'name 属性',
tip: 'RadioGroup 下所有 input[type="radio"] 的 name 属性',
tip: 'RadioGroup 下所有 input[type="radio"] 的 name 属性。为组合内的 input 元素赋予相同的 name 属性,使浏览器把 Radio.Group 下的 Radio 真正看作是一组(例如可以通过方向键始终在同一组内更改选项)。',
},
propType: 'string',
setter: 'StringSetter',
Expand Down
1 change: 0 additions & 1 deletion packages/fusion-lowcode-materials/lowcode/button/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export default {
title: {
label: {
type: 'i18n',
zh_CN: '图标尺寸',
en_US: 'Icon Size',
},
tip: {
Expand Down