From 85c7254c4eedff59d72c77f16371182c01cbddfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E7=A6=85?= Date: Thu, 30 Jul 2020 20:30:41 +0800 Subject: [PATCH] =?UTF-8?q?1.=20dialog=20=E6=B7=BB=E5=8A=A0=20rootSelector?= =?UTF-8?q?=EF=BC=9B=202.=20dialog=20=20visible=20prop=20=E7=9A=84=20sette?= =?UTF-8?q?r=20=E6=94=B9=E4=B8=BA=20JSEXpression=EF=BC=9B=203.=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=BB=84=E4=BB=B6=20icon=20=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/demo/public/assets.json | 35 +++++++++++-------- .../editor-core/src/widgets/title/title.less | 5 +++ .../src/transducers/parse-props.ts | 8 +++++ .../plugin-outline-pane/src/views/style.less | 7 ++++ 4 files changed, 40 insertions(+), 15 deletions(-) diff --git a/packages/demo/public/assets.json b/packages/demo/public/assets.json index 0aaf570e0..656c7b890 100644 --- a/packages/demo/public/assets.json +++ b/packages/demo/public/assets.json @@ -1364,6 +1364,7 @@ { "componentName": "Button", "title": "Button", + "icon": "https://img.alicdn.com/tfs/TB1rT0gPQL0gK0jSZFAXXcA9pXa-200-200.svg", "docUrl": "", "screenshot": "", "npm": { @@ -1386,6 +1387,7 @@ }, { "name": "type", + "title": "类型", "propType": { "type": "oneOf", "value": [ @@ -1399,6 +1401,7 @@ }, { "name": "size", + "title": "尺寸", "propType": { "type": "oneOf", "value": [ @@ -1412,6 +1415,7 @@ }, { "name": "iconSize", + "title": "Icon 尺寸", "propType": { "type": "oneOf", "value": [ @@ -1425,10 +1429,12 @@ "xxxl" ] }, + "defaultValue": "small", "description": "按钮中 Icon 的尺寸,用于替代 Icon 的默认大小" }, { "name": "htmlType", + "title": "htmlType", "propType": { "type": "oneOf", "value": [ @@ -1456,6 +1462,7 @@ }, { "name": "loading", + "title": "是否 loading", "propType": "bool", "description": "设置按钮的载入状态", "defaultValue": false @@ -1494,6 +1501,7 @@ }, { "name": "onClick", + "title": "onClick", "propType": "func", "description": "点击按钮的回调\n@param {Object} e Event Object" }, @@ -4375,7 +4383,7 @@ }, { "name": "visible", - "propType": "oneOfType", + "propType": "JSExpression", "description": "是否显示", "defaultValue": false }, @@ -4562,7 +4570,8 @@ "configure": { "component": { "isContainer": true, - "isModel": true + "isModel": true, + "rootSelector": "div.next-dialog" } } }, @@ -5018,11 +5027,8 @@ }, { "name": "label", - "propType": { - "type": "instanceOf", - "value": "node" - }, - "description": "label 标签的文本" + "propType": "string", + "description": "标签" }, { "name": "labelCol", @@ -13152,9 +13158,9 @@ "type": "normal", "size": "medium", "htmlType": "button", - "component": "button" - }, - "children": "取消" + "component": "button", + "children": ["取消"] + } } }, { @@ -13416,8 +13422,7 @@ "props": { "prefix": "next-", "children": [ - "222", - "222111" + "一级" ] } } @@ -13639,9 +13644,9 @@ "componentName": "Form.Item", "props": { "style":{ - "margin-bottom": "0", - "min-width": "200px", - "min-height": "28px" + "marginBottom": "0", + "minWidth": "200px", + "minHeight": "28px" } } } diff --git a/packages/editor-core/src/widgets/title/title.less b/packages/editor-core/src/widgets/title/title.less index a093b26e0..3ab4c1515 100644 --- a/packages/editor-core/src/widgets/title/title.less +++ b/packages/editor-core/src/widgets/title/title.less @@ -6,6 +6,11 @@ display: flex; align-items: center; margin-right: 4px; + img { + width: 16px; + height: 16px; + filter: brightness(0) invert(1) + } } &.only-icon { .lc-title-icon { diff --git a/packages/editor-skeleton/src/transducers/parse-props.ts b/packages/editor-skeleton/src/transducers/parse-props.ts index 2d2d69f99..a47e8e74a 100644 --- a/packages/editor-skeleton/src/transducers/parse-props.ts +++ b/packages/editor-skeleton/src/transducers/parse-props.ts @@ -60,6 +60,14 @@ function propTypeToSetter(propType: PropType): SetterType { isRequired, initialValue: false, }; + case 'JSExpression': + return { + componentName: 'ExpressionSetter', + initialValue: { + type: 'JSExpression', + value: '', + }, + }; case 'oneOf': const dataSource = ((propType as OneOf).value || []).map((value, index) => { const t = typeof value; diff --git a/packages/plugin-outline-pane/src/views/style.less b/packages/plugin-outline-pane/src/views/style.less index c7c571174..7f1585ecd 100644 --- a/packages/plugin-outline-pane/src/views/style.less +++ b/packages/plugin-outline-pane/src/views/style.less @@ -159,6 +159,13 @@ fill: var(--color-icon-normal, rgba(31, 56, 88, 0.4)); } } + & > img { + width: 16px; + height: 16px; + * { + fill: var(--color-icon-normal, rgba(31, 56, 88, 0.4)); + } + } } .tree-node-title {