diff --git a/designer-demo/engine.config.js b/designer-demo/engine.config.js index fa308f9bc2..d598ff26a9 100644 --- a/designer-demo/engine.config.js +++ b/designer-demo/engine.config.js @@ -3,5 +3,7 @@ export default { theme: 'light', material: ['/mock/bundle.json'], scripts: [], - styles: [] + styles: [], + dslMode: 'vue', + selectMode: 'vue' } diff --git a/designer-demo/public/mock/bundle.json b/designer-demo/public/mock/bundle.json index 4b43435b8e..0a45d9bf49 100644 --- a/designer-demo/public/mock/bundle.json +++ b/designer-demo/public/mock/bundle.json @@ -279,6 +279,473 @@ } } }, + { + "id": 1, + "version": "2.4.2", + "name": { + "zh_CN": "日期选择器" + }, + "component": "ElDatePicker", + "icon": "datepick", + "description": "日期选择器", + "doc_url": "", + "screenshot": "", + "tags": "", + "keywords": "", + "dev_mode": "proCode", + "npm": { + "package": "element-plus", + "exportName": "ElDatePicker", + "destructuring": true + }, + "group": "表单组件", + "category": "element-plus", + "configure": { + "loop": true, + "condition": true, + "styles": true, + "isContainer": false, + "isModal": false, + "isPopper": false, + "nestingRule": { + "childWhitelist": "", + "parentWhitelist": "", + "descendantBlacklist": "", + "ancestorWhitelist": "" + }, + "isNullNode": false, + "isLayout": false, + "rootSelector": "", + "shortcuts": { + "properties": ["type", "size"] + }, + "contextMenu": { + "actions": ["copy", "remove", "insert", "updateAttr", "bindEevent", "createBlock"], + "disable": [] + }, + "invalidity": [""], + "clickCapture": true, + "framework": "Vue" + }, + "schema": { + "properties": [ + { + "name": "0", + "label": { + "zh_CN": "基础属性" + }, + "content": [ + { + "property": "modelValue", + "label": { + "text": { + "zh_CN": "绑定值" + } + }, + "description": { + "zh_CN": "绑定值" + }, + "required": false, + "readOnly": false, + "disabled": false, + "cols": 12, + "labelPosition": "left", + "type": "string", + "widget": { + "component": "InputConfigurator", + "props": {} + } + }, + { + "property": "readonly", + "label": { + "text": { + "zh_CN": "只读" + } + }, + "description": { + "zh_CN": "是否只读" + }, + "required": true, + "readOnly": false, + "disabled": false, + "cols": 12, + "labelPosition": "left", + "type": "boolean", + "defaultValue": false, + "widget": { + "component": "CheckBoxConfigurator", + "props": {} + } + }, + { + "property": "disabled", + "label": { + "text": { + "zh_CN": "禁用" + } + }, + "description": { + "zh_CN": "是否禁用" + }, + "required": true, + "readOnly": false, + "disabled": false, + "cols": 12, + "labelPosition": "left", + "type": "boolean", + "defaultValue": false, + "widget": { + "component": "CheckBoxConfigurator", + "props": {} + } + }, + { + "property": "size", + "label": { + "text": { + "zh_CN": "尺寸" + } + }, + "description": { + "zh_CN": "输入框尺寸" + }, + "required": true, + "readOnly": false, + "disabled": false, + "cols": 12, + "labelPosition": "left", + "type": "string", + "defaultValue": "", + "widget": { + "component": "SelectConfigurator", + "props": { + "allowClear": true, + "options": [ + { + "label": "large", + "value": "large" + }, + { + "label": "default", + "value": "default" + }, + { + "label": "small", + "value": "small" + } + ] + } + } + }, + { + "property": "editable", + "label": { + "text": { + "zh_CN": "是否可编辑" + } + }, + "description": { + "zh_CN": "文本框是否可编辑" + }, + "required": true, + "readOnly": false, + "disabled": false, + "cols": 12, + "labelPosition": "left", + "type": "boolean", + "defaultValue": true, + "widget": { + "component": "CheckBoxConfigurator", + "props": {} + }, + "device": [] + }, + { + "property": "clearable", + "label": { + "text": { + "zh_CN": "是否可清除" + } + }, + "description": { + "zh_CN": "是否显示清楚按钮" + }, + "required": true, + "readOnly": false, + "disabled": false, + "cols": 12, + "labelPosition": "left", + "type": "boolean", + "defaultValue": true, + "widget": { + "component": "CheckBoxConfigurator", + "props": {} + }, + "device": [] + }, + { + "property": "placeholder", + "label": { + "text": { + "zh_CN": "占位文本" + } + }, + "description": { + "zh_CN": "非范围选择时的占位内容" + }, + "required": true, + "readOnly": false, + "disabled": false, + "cols": 12, + "labelPosition": "left", + "defaultValue": "", + "type": "string", + "widget": { + "component": "InputConfigurator", + "props": {} + }, + "device": [] + }, + { + "property": "start-placeholder", + "label": { + "text": { + "zh_CN": "起始占位文本" + } + }, + "description": { + "zh_CN": "范围选择时开始日期的占位内容" + }, + "required": true, + "readOnly": false, + "disabled": false, + "cols": 12, + "labelPosition": "left", + "defaultValue": "", + "type": "string", + "widget": { + "component": "InputConfigurator", + "props": {} + }, + "device": [] + }, + { + "property": "end-placeholder", + "label": { + "text": { + "zh_CN": "结束占位文本" + } + }, + "description": { + "zh_CN": "范围选择时结束日期的占位内容" + }, + "required": true, + "readOnly": false, + "disabled": false, + "cols": 12, + "labelPosition": "left", + "defaultValue": "", + "type": "string", + "widget": { + "component": "InputConfigurator", + "props": {} + }, + "device": [] + }, + { + "property": "type", + "label": { + "text": { + "zh_CN": "类型" + } + }, + "description": { + "zh_CN": "显示类型" + }, + "required": true, + "readOnly": false, + "disabled": false, + "cols": 12, + "labelPosition": "left", + "defaultValue": "date", + "type": "string", + "widget": { + "component": "SelectConfigurator", + "props": { + "options": [ + { + "label": "year", + "value": "year" + }, + { + "label": "years", + "value": "years" + }, + { + "label": "month", + "value": "month" + }, + { + "label": "months", + "value": "months" + }, + { + "label": "date", + "value": "date" + }, + { + "label": "dates", + "value": "dates" + }, + { + "label": "datetime", + "value": "datetime" + }, + { + "label": "week", + "value": "week" + }, + { + "label": "datetimerange", + "value": "datetimerange" + }, + { + "label": "daterange", + "value": "daterange" + }, + { + "label": "monthrange", + "value": "monthrange" + }, + { + "label": "yearrange", + "value": "yearrange" + } + ] + } + }, + "device": [] + }, + { + "property": "popper-class", + "label": { + "text": { + "zh_CN": "下拉框类名" + } + }, + "description": { + "zh_CN": "DatePicker 下拉框的类名" + }, + "required": true, + "readOnly": false, + "disabled": false, + "cols": 12, + "labelPosition": "left", + "defaultValue": "", + "type": "string", + "widget": { + "component": "InputConfigurator", + "props": {} + }, + "device": [] + } + ], + "description": { + "zh_CN": "" + } + } + ], + "events": { + "onUpdate:modelValue": { + "label": { + "zh_CN": "双向绑定值改变时触发" + }, + "description": { + "zh_CN": "双向绑定值改变时触发" + } + }, + "onChange": { + "label": { + "zh_CN": "用户确认选定的值时触发" + }, + "description": { + "zh_CN": "用户确认选定的值时触发" + }, + "type": "event", + "defaultValue": "" + }, + "onBlur": { + "label": { + "zh_CN": "在组件 Input 失去焦点时触发" + }, + "description": { + "zh_CN": "在组件 Input 失去焦点时触发" + }, + "type": "event", + "defaultValue": "" + }, + "onFocus": { + "label": { + "zh_CN": "在组件 Input 获得焦点时触发" + }, + "description": { + "zh_CN": "在组件 Input 获得焦点时触发" + }, + "type": "event", + "defaultValue": "" + }, + "onCalendarChange": { + "label": { + "zh_CN": "在日历所选日期更改时触发" + }, + "description": { + "zh_CN": "在日历所选日期更改时触发" + }, + "type": "event", + "defaultValue": "" + }, + "onPanelChange": { + "label": { + "zh_CN": "当日期面板改变时触发。" + }, + "description": { + "zh_CN": "当日期面板改变时触发。" + }, + "type": "event", + "defaultValue": "" + }, + "onVisibleChange": { + "label": { + "zh_CN": "当 DatePicker 的下拉列表出现/消失时触发" + }, + "description": { + "zh_CN": "当 DatePicker 的下拉列表出现/消失时触发" + }, + "type": "event", + "defaultValue": "" + } + }, + "slots": { + "default": { + "label": { + "zh_CN": "自定义单元格内容" + }, + "description": { + "zh_CN": "自定义单元格内容" + } + }, + "range-separator": { + "label": { + "zh_CN": "自定义范围分割符内容" + }, + "description": { + "zh_CN": "自定义范围分割符内容" + } + } + } + } + }, { "id": 1, "version": "2.4.2", @@ -13944,6 +14411,15 @@ "zh_CN": "Element Plus组件" }, "children": [ + { + "name": { + "zh_CN": "日期选择器" + }, + "icon": "datepick", + "screenshot": "", + "snippetName": "ElDatePicker", + "schema": {} + }, { "name": { "zh_CN": "输入框" diff --git a/packages/canvas/container/index.ts b/packages/canvas/container/index.ts index 31c7dcd8f6..71e583e86b 100644 --- a/packages/canvas/container/index.ts +++ b/packages/canvas/container/index.ts @@ -1,10 +1,10 @@ import CanvasContainer from './src/CanvasContainer.vue' -import { useMultiSelect } from './src/composables/useMultiSelect' +import { useSelectNode } from './src/interactions' import { registerHotkeyEvent, removeHotkeyEvent } from './src/keyboard' import metaData from './meta' export default { ...metaData, entry: CanvasContainer, - api: { useMultiSelect, registerHotkeyEvent, removeHotkeyEvent } + api: { useSelectNode, registerHotkeyEvent, removeHotkeyEvent } } diff --git a/packages/canvas/container/src/CanvasContainer.vue b/packages/canvas/container/src/CanvasContainer.vue index e1f969b37b..498e90d3c9 100644 --- a/packages/canvas/container/src/CanvasContainer.vue +++ b/packages/canvas/container/src/CanvasContainer.vue @@ -1,10 +1,7 @@