From 349e34a46af1ee82f5738d95d0ad78d3a413d0a9 Mon Sep 17 00:00:00 2001 From: andylili21 <925820633@qq.com> Date: Thu, 16 Nov 2023 21:30:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?#=E9=9A=90=E8=97=8F=E5=BA=95=E9=83=A8?= =?UTF-8?q?=E7=9A=84modal=EF=BC=8C=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../antd-lowcode-materials/lowcode/modal/meta.ts | 12 ++++++------ .../antd-lowcode-materials/lowcode/modal/snippets.ts | 6 ++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/antd-lowcode-materials/lowcode/modal/meta.ts b/packages/antd-lowcode-materials/lowcode/modal/meta.ts index f67b7a4b..f56b4378 100644 --- a/packages/antd-lowcode-materials/lowcode/modal/meta.ts +++ b/packages/antd-lowcode-materials/lowcode/modal/meta.ts @@ -51,7 +51,7 @@ export default { }, { name: 'confirmLoading', - title: { label: '确定按钮loading', tip: '确定按钮loading' }, + title: { label: '确定按钮 loading', tip: '确定按钮 loading' }, propType: 'bool', defaultValue: false, setter: 'BoolSetter', @@ -67,7 +67,7 @@ export default { }, { name: 'forceRender', - title: { label: '强制渲染Modal', tip: '强制渲染Modal' }, + title: { label: '强制渲染 Modal', tip: '强制渲染 Modal' }, propType: 'bool', defaultValue: false, setter: 'BoolSetter', @@ -75,7 +75,7 @@ export default { }, { name: 'keyboard', - title: { label: 'esc关闭', tip: '是否支持键盘 esc 关闭' }, + title: { label: 'esc 关闭', tip: '是否支持键盘 esc 关闭' }, propType: 'bool', defaultValue: true, setter: 'BoolSetter', @@ -155,7 +155,7 @@ export default { }, { name: 'okButtonProps', - title: { label: '确认按钮props', tip: '确认按钮props' }, + title: { label: '确认按钮 props', tip: '确认按钮 props' }, propType: 'object', setter: { componentName: 'ObjectSetter', @@ -183,7 +183,7 @@ export default { }, { name: 'bodyStyle', - title: { label: 'body样式', tip: 'Modal body 样式' }, + title: { label: 'body 样式', tip: 'Modal body 样式' }, propType: 'object', }, { @@ -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'] }, }, diff --git a/packages/antd-lowcode-materials/lowcode/modal/snippets.ts b/packages/antd-lowcode-materials/lowcode/modal/snippets.ts index 1e219a0a..4667e071 100644 --- a/packages/antd-lowcode-materials/lowcode/modal/snippets.ts +++ b/packages/antd-lowcode-materials/lowcode/modal/snippets.ts @@ -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: [], From cc6f9bba2ba588b51f1883c4f68a54b80024e31c Mon Sep 17 00:00:00 2001 From: andylili21 <925820633@qq.com> Date: Fri, 26 Jan 2024 12:07:18 +0800 Subject: [PATCH 2/4] fix: The list component has horizontal and vertical logic --- .../lowcode/list/meta.ts | 59 ++++++++----------- .../lowcode/button/meta.ts | 1 - 2 files changed, 26 insertions(+), 34 deletions(-) diff --git a/packages/antd-lowcode-materials/lowcode/list/meta.ts b/packages/antd-lowcode-materials/lowcode/list/meta.ts index c816e052..41df1236 100644 --- a/packages/antd-lowcode-materials/lowcode/list/meta.ts +++ b/packages/antd-lowcode-materials/lowcode/list/meta.ts @@ -30,7 +30,7 @@ export default { { name: 'rowKey', title: { - label: '行Key', + label: '行 Key', tip: 'rowKey | 当 renderItem 自定义渲染列表项有效时,自定义每一行的 key 的获取方式', }, propType: { @@ -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', @@ -132,6 +145,10 @@ export default { title: '栅格', display: 'block', type: 'group', + condition: { + type: 'JSFunction', + value: 'target => target.getProps().getPropValue("itemLayout") !== "vertical"', + }, items: [ { name: 'gridEnable', @@ -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) } }, }, @@ -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")', @@ -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 | 当前页数' }, @@ -268,7 +265,6 @@ export default { }, propType: 'bool', setter: 'BoolSetter', - defaultValue: false, condition: { type: 'JSFunction', value: 'target => !!target.getProps().getPropValue("pagination")', @@ -282,7 +278,6 @@ export default { }, propType: 'bool', setter: 'BoolSetter', - defaultValue: false, condition: { type: 'JSFunction', value: 'target => !!target.getProps().getPropValue("pagination")', @@ -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")', @@ -324,7 +318,6 @@ export default { }, 'VariableSetter', ], - defaultValue: 'default', condition: { type: 'JSFunction', value: 'target => !!target.getProps().getPropValue("pagination")', diff --git a/packages/fusion-lowcode-materials/lowcode/button/meta.ts b/packages/fusion-lowcode-materials/lowcode/button/meta.ts index ed7d1382..50cc36d4 100644 --- a/packages/fusion-lowcode-materials/lowcode/button/meta.ts +++ b/packages/fusion-lowcode-materials/lowcode/button/meta.ts @@ -73,7 +73,6 @@ export default { title: { label: { type: 'i18n', - zh_CN: '图标尺寸', en_US: 'Icon Size', }, tip: { From b4025127ff3efcbd5dd25b27f090a0250e76cd2f Mon Sep 17 00:00:00 2001 From: andylili21 <925820633@qq.com> Date: Mon, 1 Apr 2024 09:39:40 +0800 Subject: [PATCH 3/4] =?UTF-8?q?#radio.group=E7=9A=84tip=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=20antd=20=E5=AE=98=E7=BD=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/antd-lowcode-materials/lowcode/radio.group/meta.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/antd-lowcode-materials/lowcode/radio.group/meta.ts b/packages/antd-lowcode-materials/lowcode/radio.group/meta.ts index 6d5dce60..eff07fcc 100644 --- a/packages/antd-lowcode-materials/lowcode/radio.group/meta.ts +++ b/packages/antd-lowcode-materials/lowcode/radio.group/meta.ts @@ -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', From 91955fda50df7e79070c84a89ccdcc46dd771b94 Mon Sep 17 00:00:00 2001 From: andylili21 <925820633@qq.com> Date: Mon, 24 Jun 2024 09:47:13 +0800 Subject: [PATCH 4/4] #improve Callback function &add calendar description --- packages/antd-lowcode-materials/lowcode/calendar/meta.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/antd-lowcode-materials/lowcode/calendar/meta.ts b/packages/antd-lowcode-materials/lowcode/calendar/meta.ts index 3bfec4eb..aee8bfb6 100644 --- a/packages/antd-lowcode-materials/lowcode/calendar/meta.ts +++ b/packages/antd-lowcode-materials/lowcode/calendar/meta.ts @@ -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);}", },