@luck-design-biz/luckda 1.0.2-2 → 1.0.2-20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/Builder/index.js +13 -10
- package/es/components/ComplexItem/index.js +5 -3
- package/es/components/ComplexItem/service.js +6 -3
- package/es/components/LDActions/index.js +1 -0
- package/es/components/LdAutoForm/index.js +5 -4
- package/es/components/LdCard/index.js +10 -8
- package/es/components/LdCom/index.js +3 -2
- package/es/components/LdFormList/index.js +10 -7
- package/es/components/LdGrid/index.js +11 -12
- package/es/components/LdGridForm/index.js +5 -4
- package/es/helper/FromItems.js +64 -5
- package/es/helper/action.js +2 -0
- package/es/helper/ldBuilder.js +5 -4
- package/es/helper/ldComBuild.js +16 -11
- package/es/locales/zh-CN.js +61 -6
- package/es/lowcode/constants/api-url.js +359 -190
- package/es/lowcode/constants/event-topics.js +4 -0
- package/es/lowcode/constants/index.js +5 -4
- package/es/lowcode/engine/meta/box.props.default.json +1 -1
- package/es/lowcode/engine/meta/box.props.json +1 -1
- package/es/lowcode/engine/meta/cardlist.props.json +3 -5
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -1
- package/es/lowcode/engine/meta/dialog.props.json +24 -4
- package/es/lowcode/engine/meta/drawer.props.json +1 -1
- package/es/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/es/lowcode/engine/meta/fielddate.props.json +48 -1
- package/es/lowcode/engine/meta/fieldeditor.props.json +0 -1
- package/es/lowcode/engine/meta/fieldgroup.props.json +0 -1
- package/es/lowcode/engine/meta/fieldyear.props.json +0 -1
- package/es/lowcode/engine/meta/form.props.json +3 -19
- package/es/lowcode/engine/meta/grouptree.props.json +0 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -2
- package/es/lowcode/engine/meta/jsx.props.json +4 -3
- package/es/lowcode/engine/meta/layout.props.default.json +1 -1
- package/es/lowcode/engine/meta/layout.props.json +1 -1
- package/es/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/es/lowcode/engine/meta/proxy.props.json +66 -0
- package/es/lowcode/engine/meta/section.props.json +2 -2
- package/es/lowcode/engine/meta/table.props.json +0 -7
- package/es/lowcode/engine/meta/tabs.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.json +1 -5
- package/es/lowcode/engine/provider/ContextProvider/index.js +45 -9
- package/es/lowcode/engine/provider/ContextProvider/router.js +21 -1
- package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +36 -30
- package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +11 -5
- package/es/lowcode/engine/provider/ContextProvider/useTodo.js +2 -4
- package/es/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/es/lowcode/engine/provider/PageProxyProvider.js +95 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/es/lowcode/engine/tools/helper.js +25 -1
- package/es/lowcode/engine/tools/initDS.js +4 -4
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +135 -27
- package/es/lowcode/painter/DesignToolbar.js +102 -188
- package/es/lowcode/painter/History.js +300 -0
- package/es/lowcode/painter/Panel.js +1 -1
- package/es/lowcode/painter/Ribbon.js +37 -1
- package/es/lowcode/painter/components/AdvancePanel.js +55 -51
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
- package/es/lowcode/painter/components/TipIcon.js +12 -4
- package/es/lowcode/painter/components/TreeEditor.js +76 -8
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
- package/es/lowcode/painter/components/code-editor/DiffEditor.js +41 -0
- package/es/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/es/lowcode/painter/components/field-setting/SettingUI.js +56 -5
- package/es/lowcode/painter/components/field-setting/index.js +24 -1
- package/es/lowcode/painter/components/shortcut-modal/KeyIcon.js +11 -0
- package/es/lowcode/painter/components/shortcut-modal/index.js +208 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +10 -19
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/es/lowcode/painter/panel-section/ConditionCheck.js +70 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/es/lowcode/painter/panel-section/DialogSize.js +76 -0
- package/es/lowcode/painter/panel-section/DialogWidthHeight.js +60 -0
- package/es/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
- package/es/lowcode/painter/panel-section/JSEditor/ToolBar.js +174 -0
- package/es/lowcode/painter/panel-section/JSEditor/index.js +181 -0
- package/es/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/es/lowcode/painter/panel-section/ProxyLinker.js +137 -0
- package/es/lowcode/painter/panel-section/ProxyParams.js +28 -0
- package/es/lowcode/painter/panel-section/ProxyParamsSetter.js +240 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
- package/es/lowcode/painter/style/action-bind-modal.less +1 -1
- package/es/lowcode/painter/style/components.less +1 -1
- package/es/lowcode/painter/style/history.less +46 -0
- package/es/lowcode/painter/style/outline.less +1 -1
- package/es/lowcode/painter/style/panel-item.less +1 -0
- package/es/lowcode/preview/DebugTool.js +78 -0
- package/es/lowcode/preview/DebugToolDetail.js +103 -0
- package/es/lowcode/preview/index.js +10 -17
- package/es/lowcode/preview/useDebugSettings.js +62 -0
- package/es/lowcode/view/Canvas.js +5 -1
- package/es/lowcode/view/ErrorBoundary.js +80 -0
- package/es/lowcode/view/Page.js +11 -6
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
- package/es/lowcode/view/lc-components/Box/index.less +2 -2
- package/es/lowcode/view/lc-components/Box/meta.json +1 -1
- package/es/lowcode/view/lc-components/CardList/index.js +3 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +3 -5
- package/es/lowcode/view/lc-components/Dialog/index.js +13 -5
- package/es/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/es/lowcode/view/lc-components/Drawer/index.js +5 -3
- package/es/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/es/lowcode/view/lc-components/FieldDate/meta.json +48 -1
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
- package/es/lowcode/view/lc-components/FieldYear/meta.json +0 -1
- package/es/lowcode/view/lc-components/Form/index.js +15 -19
- package/es/lowcode/view/lc-components/Form/meta.json +3 -19
- package/es/lowcode/view/lc-components/GroupTree/meta.json +0 -1
- package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +32 -16
- package/es/lowcode/view/lc-components/JSX/meta.json +4 -3
- package/es/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/es/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/es/lowcode/view/lc-components/Proxy/FunctionDesign.js +17 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionLive.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionPreview.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/index.js +42 -0
- package/es/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/es/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/es/lowcode/view/lc-components/Section/meta.json +2 -2
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
- package/es/lowcode/view/lc-components/Table/index.js +11 -3
- package/es/lowcode/view/lc-components/Table/meta.json +0 -7
- package/es/lowcode/view/lc-components/Tabs/index.js +6 -2
- package/es/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/index.js +3 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +1 -5
- package/es/lowcode/view/lc-components/Wrapper.js +9 -1
- package/es/upload/FilesWall/index.js +16 -6
- package/es/upload/Form/gridForm.js +16 -6
- package/es/upload/FormItem/index.js +16 -4
- package/es/utils/action.js +3 -2
- package/es/utils/form.js +4 -3
- package/es/utils/grid.js +10 -2
- package/lib/components/Builder/index.js +13 -10
- package/lib/components/ComplexItem/index.js +5 -3
- package/lib/components/ComplexItem/service.js +6 -3
- package/lib/components/LDActions/index.js +1 -0
- package/lib/components/LdAutoForm/index.js +3 -2
- package/lib/components/LdCard/index.js +10 -8
- package/lib/components/LdCom/index.js +3 -2
- package/lib/components/LdFormList/index.js +9 -6
- package/lib/components/LdGrid/index.js +11 -12
- package/lib/components/LdGridForm/index.js +3 -2
- package/lib/helper/FromItems.js +64 -5
- package/lib/helper/action.js +2 -0
- package/lib/helper/ldBuilder.js +4 -4
- package/lib/helper/ldComBuild.js +14 -9
- package/lib/locales/zh-CN.js +61 -6
- package/lib/lowcode/constants/api-url.js +360 -190
- package/lib/lowcode/constants/event-topics.js +5 -1
- package/lib/lowcode/constants/index.js +6 -5
- package/lib/lowcode/engine/meta/box.props.default.json +1 -1
- package/lib/lowcode/engine/meta/box.props.json +1 -1
- package/lib/lowcode/engine/meta/cardlist.props.json +3 -5
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -1
- package/lib/lowcode/engine/meta/dialog.props.json +24 -4
- package/lib/lowcode/engine/meta/drawer.props.json +1 -1
- package/lib/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +48 -1
- package/lib/lowcode/engine/meta/fieldeditor.props.json +0 -1
- package/lib/lowcode/engine/meta/fieldgroup.props.json +0 -1
- package/lib/lowcode/engine/meta/fieldyear.props.json +0 -1
- package/lib/lowcode/engine/meta/form.props.json +3 -19
- package/lib/lowcode/engine/meta/grouptree.props.json +0 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -2
- package/lib/lowcode/engine/meta/jsx.props.json +4 -3
- package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.json +1 -1
- package/lib/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/lib/lowcode/engine/meta/proxy.props.json +66 -0
- package/lib/lowcode/engine/meta/section.props.json +2 -2
- package/lib/lowcode/engine/meta/table.props.json +0 -7
- package/lib/lowcode/engine/meta/tabs.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.json +1 -5
- package/lib/lowcode/engine/provider/ContextProvider/index.js +50 -13
- package/lib/lowcode/engine/provider/ContextProvider/router.js +22 -1
- package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +37 -31
- package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +10 -4
- package/lib/lowcode/engine/provider/ContextProvider/useTodo.js +1 -3
- package/lib/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/lib/lowcode/engine/provider/PageProxyProvider.js +103 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/lib/lowcode/engine/tools/helper.js +25 -0
- package/lib/lowcode/engine/tools/initDS.js +4 -4
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +132 -24
- package/lib/lowcode/painter/DesignToolbar.js +98 -184
- package/lib/lowcode/painter/History.js +308 -0
- package/lib/lowcode/painter/Panel.js +1 -1
- package/lib/lowcode/painter/Ribbon.js +37 -1
- package/lib/lowcode/painter/components/AdvancePanel.js +53 -49
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
- package/lib/lowcode/painter/components/TipIcon.js +12 -4
- package/lib/lowcode/painter/components/TreeEditor.js +76 -8
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
- package/lib/lowcode/painter/components/code-editor/DiffEditor.js +49 -0
- package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +55 -4
- package/lib/lowcode/painter/components/field-setting/index.js +24 -1
- package/lib/lowcode/painter/components/shortcut-modal/KeyIcon.js +18 -0
- package/lib/lowcode/painter/components/shortcut-modal/index.js +215 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +9 -18
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/lib/lowcode/painter/panel-section/ConditionCheck.js +78 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/lib/lowcode/painter/panel-section/DialogSize.js +83 -0
- package/lib/lowcode/painter/panel-section/DialogWidthHeight.js +67 -0
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/JSEditor/ToolBar.js +181 -0
- package/lib/lowcode/painter/panel-section/JSEditor/index.js +189 -0
- package/lib/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/lib/lowcode/painter/panel-section/ProxyLinker.js +145 -0
- package/lib/lowcode/painter/panel-section/ProxyParams.js +35 -0
- package/lib/lowcode/painter/panel-section/ProxyParamsSetter.js +248 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
- package/lib/lowcode/painter/style/action-bind-modal.less +1 -1
- package/lib/lowcode/painter/style/components.less +1 -1
- package/lib/lowcode/painter/style/history.less +46 -0
- package/lib/lowcode/painter/style/outline.less +1 -1
- package/lib/lowcode/painter/style/panel-item.less +1 -0
- package/lib/lowcode/preview/DebugTool.js +86 -0
- package/lib/lowcode/preview/DebugToolDetail.js +111 -0
- package/lib/lowcode/preview/index.js +10 -18
- package/lib/lowcode/preview/useDebugSettings.js +69 -0
- package/lib/lowcode/view/Canvas.js +5 -1
- package/lib/lowcode/view/ErrorBoundary.js +88 -0
- package/lib/lowcode/view/Page.js +12 -7
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
- package/lib/lowcode/view/lc-components/Box/index.less +2 -2
- package/lib/lowcode/view/lc-components/Box/meta.json +1 -1
- package/lib/lowcode/view/lc-components/CardList/index.js +3 -0
- package/lib/lowcode/view/lc-components/CardList/meta.json +3 -5
- package/lib/lowcode/view/lc-components/Dialog/index.js +11 -3
- package/lib/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/lib/lowcode/view/lc-components/Drawer/index.js +3 -1
- package/lib/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +48 -1
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Form/index.js +15 -19
- package/lib/lowcode/view/lc-components/Form/meta.json +3 -19
- package/lib/lowcode/view/lc-components/GroupTree/meta.json +0 -1
- package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +33 -16
- package/lib/lowcode/view/lc-components/JSX/meta.json +4 -3
- package/lib/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/lib/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/lib/lowcode/view/lc-components/Proxy/FunctionDesign.js +24 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionLive.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionPreview.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/index.js +50 -0
- package/lib/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/lib/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
- package/lib/lowcode/view/lc-components/Table/index.js +11 -3
- package/lib/lowcode/view/lc-components/Table/meta.json +0 -7
- package/lib/lowcode/view/lc-components/Tabs/index.js +5 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +3 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +1 -5
- package/lib/lowcode/view/lc-components/Wrapper.js +8 -0
- package/lib/upload/FilesWall/index.js +13 -3
- package/lib/upload/Form/gridForm.js +13 -3
- package/lib/upload/FormItem/index.js +15 -3
- package/lib/utils/action.js +6 -0
- package/lib/utils/form.js +3 -2
- package/lib/utils/grid.js +11 -3
- package/package.json +1 -2
- package/es/lowcode/painter/panel-section/JSEditor.js +0 -49
- package/es/lowcode/view/errorBoundary.js +0 -61
- package/lib/lowcode/painter/panel-section/JSEditor.js +0 -57
- package/lib/lowcode/view/errorBoundary.js +0 -69
|
@@ -1,13 +1,81 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState, useCallback, useEffect, useRef } from 'react';
|
|
2
3
|
import TreeDragDropWrapper from "./DragDrop/TreeDragDropWrapper";
|
|
4
|
+
import { Input } from 'luck-design/antd';
|
|
5
|
+
import { modifyNode } from "../../engine/provider/ContextProvider";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 树节点组件
|
|
9
|
+
* @param {Object} props - 组件属性
|
|
10
|
+
* @param {Object} props.item - 代表树节点的对象
|
|
11
|
+
* @returns {React.Component} 返回包裹在拖拽功能中的节点编辑组件
|
|
12
|
+
*/
|
|
3
13
|
export default function (_ref) {
|
|
4
14
|
var item = _ref.item;
|
|
5
|
-
var EditorNode = function EditorNode() {
|
|
6
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
className: "item"
|
|
8
|
-
}, item.name);
|
|
9
|
-
};
|
|
10
15
|
return /*#__PURE__*/React.createElement(TreeDragDropWrapper, {
|
|
11
16
|
item: item
|
|
12
|
-
}, /*#__PURE__*/React.createElement(EditorNode,
|
|
13
|
-
|
|
17
|
+
}, /*#__PURE__*/React.createElement(EditorNode, {
|
|
18
|
+
item: item
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 编辑节点组件,提供查看和编辑树节点名称的功能
|
|
24
|
+
* @param {Object} props - 组件属性
|
|
25
|
+
* @param {Object} props.item - 代表树节点的对象
|
|
26
|
+
* @returns {React.Component} 根据编辑状态渲染输入框或仅文本
|
|
27
|
+
*/
|
|
28
|
+
var EditorNode = function EditorNode(_ref2) {
|
|
29
|
+
var item = _ref2.item;
|
|
30
|
+
// console.log('item', item)
|
|
31
|
+
var _useState = useState(false),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
edited = _useState2[0],
|
|
34
|
+
setEdited = _useState2[1];
|
|
35
|
+
var _useState3 = useState(item.name),
|
|
36
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
|
+
editedValue = _useState4[0],
|
|
38
|
+
setEditedValue = _useState4[1];
|
|
39
|
+
var inputRef = useRef(null); // 创建一个 ref 来引用输入框
|
|
40
|
+
|
|
41
|
+
var handleDoubleClick = useCallback(function () {
|
|
42
|
+
if (!item.buildIn) setEdited(true);
|
|
43
|
+
}, []);
|
|
44
|
+
var handleBlur = useCallback(function () {
|
|
45
|
+
setEdited(false);
|
|
46
|
+
}, []);
|
|
47
|
+
var handPressEnter = useCallback(function (e) {
|
|
48
|
+
modifyNode(item.id, {
|
|
49
|
+
name: e.target.value
|
|
50
|
+
});
|
|
51
|
+
setEdited(false);
|
|
52
|
+
});
|
|
53
|
+
var handleInputChange = useCallback(function (e) {
|
|
54
|
+
setEditedValue(e.target.value);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// 使用 useEffect 钩子来处理聚焦逻辑
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
if (edited) {
|
|
60
|
+
// 如果 edited 为 true,聚焦到输入框
|
|
61
|
+
inputRef.current && inputRef.current.focus();
|
|
62
|
+
}
|
|
63
|
+
}, [edited]); // 依赖 edited 状态变化
|
|
64
|
+
|
|
65
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: "item",
|
|
67
|
+
onDoubleClick: handleDoubleClick
|
|
68
|
+
}, edited ? /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: "treenode-editor"
|
|
70
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
71
|
+
ref: inputRef // 将 ref 应用到 Input 组件
|
|
72
|
+
,
|
|
73
|
+
onChange: handleInputChange,
|
|
74
|
+
value: editedValue,
|
|
75
|
+
size: "small",
|
|
76
|
+
onBlur: handleBlur,
|
|
77
|
+
onPressEnter: handPressEnter
|
|
78
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: "treenode-info"
|
|
80
|
+
}, item.name));
|
|
81
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["onChange", "
|
|
4
|
+
var _excluded = ["onChange", "isFullscreen", "style", "onLoad"],
|
|
5
5
|
_excluded2 = ["children", "language", "options"];
|
|
6
6
|
import React, { useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
|
|
7
7
|
import * as monaco from 'monaco-editor';
|
|
@@ -41,9 +41,9 @@ import * as monaco from 'monaco-editor';
|
|
|
41
41
|
*/
|
|
42
42
|
var BaseEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
43
43
|
var onChange = _ref.onChange,
|
|
44
|
-
onLayoutChange = _ref.onLayoutChange,
|
|
45
44
|
isFullscreen = _ref.isFullscreen,
|
|
46
45
|
style = _ref.style,
|
|
46
|
+
onLoad = _ref.onLoad,
|
|
47
47
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
48
48
|
var children = props.children,
|
|
49
49
|
_props$language = props.language,
|
|
@@ -53,6 +53,9 @@ var BaseEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
53
53
|
rest = _objectWithoutProperties(props, _excluded2);
|
|
54
54
|
var editorRef = useRef(null);
|
|
55
55
|
var editorInstance = useRef(null);
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
if (onLoad) onLoad();
|
|
58
|
+
}, []);
|
|
56
59
|
|
|
57
60
|
// 初始化编辑器实例
|
|
58
61
|
useEffect(function () {
|
|
@@ -80,10 +83,11 @@ var BaseEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
80
83
|
editorInstance.current.onDidChangeModelContent(function (event) {
|
|
81
84
|
if (onChange) onChange(editorInstance.current.getValue(), event);
|
|
82
85
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
|
|
87
|
+
// 监听布局变化,重新赋值,解决编辑器全屏切换时,编辑器空白的问题
|
|
88
|
+
// editorInstance.current.onDidLayoutChange((event) => {
|
|
89
|
+
// if (onChange) onChange(editorInstance.current.getValue(), event);
|
|
90
|
+
// });
|
|
87
91
|
}
|
|
88
92
|
return function () {
|
|
89
93
|
var _editorInstance$curre;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import React, { forwardRef, useEffect, useRef, useImperativeHandle, memo } from 'react';
|
|
3
|
+
import * as monaco from 'monaco-editor';
|
|
4
|
+
import useCombinedRef from "../../../engine/tools/useCombinedRefs";
|
|
5
|
+
var DiffEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
6
|
+
var originalCode = _ref.originalCode,
|
|
7
|
+
modifiedCode = _ref.modifiedCode,
|
|
8
|
+
_ref$language = _ref.language,
|
|
9
|
+
language = _ref$language === void 0 ? 'javascript' : _ref$language,
|
|
10
|
+
_ref$options = _ref.options,
|
|
11
|
+
options = _ref$options === void 0 ? {} : _ref$options;
|
|
12
|
+
var containerRef = useRef(null);
|
|
13
|
+
var editorRef = useCombinedRef(ref);
|
|
14
|
+
useEffect(function () {
|
|
15
|
+
if (containerRef.current) {
|
|
16
|
+
editorRef.current = monaco.editor.createDiffEditor(containerRef.current, _objectSpread({
|
|
17
|
+
language: language,
|
|
18
|
+
automaticLayout: true,
|
|
19
|
+
autoIndent: true,
|
|
20
|
+
tabSize: 2
|
|
21
|
+
}, options));
|
|
22
|
+
editorRef.current.setModel({
|
|
23
|
+
original: monaco.editor.createModel(originalCode, language),
|
|
24
|
+
modified: monaco.editor.createModel(modifiedCode, language)
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return function () {
|
|
28
|
+
if (editorRef.current) {
|
|
29
|
+
editorRef.current.dispose();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
ref: containerRef,
|
|
35
|
+
style: {
|
|
36
|
+
width: '100%',
|
|
37
|
+
height: '100%'
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
export default /*#__PURE__*/memo(DiffEditor);
|
|
@@ -20,11 +20,11 @@ var Wrapper = styled.div.withConfig({
|
|
|
20
20
|
var Title = styled.p.withConfig({
|
|
21
21
|
displayName: "Title",
|
|
22
22
|
componentId: "luckda-6530__sc-rwt684-1"
|
|
23
|
-
})(["font-weight:700;margin-bottom:8px;color:
|
|
23
|
+
})(["font-weight:700;margin-bottom:8px;color:var(--ant-text-color);display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;justify-content:space-between;"]);
|
|
24
24
|
var LeftBox = styled.div.withConfig({
|
|
25
25
|
displayName: "LeftBox",
|
|
26
26
|
componentId: "luckda-6530__sc-rwt684-2"
|
|
27
|
-
})(["width:100%;flex:1;border:1px solid #e5e6e8;border-radius:6px;"]);
|
|
27
|
+
})(["width:100%;flex:1;border:1px solid #e5e6e8;border-radius:6px;overflow:hidden;"]);
|
|
28
28
|
var Option = styled.div.withConfig({
|
|
29
29
|
displayName: "Option",
|
|
30
30
|
componentId: "luckda-6530__sc-rwt684-3"
|
|
@@ -5,7 +5,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
import { useRequest, useMemoizedFn, useCreation } from 'ahooks';
|
|
8
|
-
import { Spin, Input, Segmented, Switch, Checkbox, Tooltip, Icon, Radio, Modal } from 'luck-design/antd';
|
|
8
|
+
import { Spin, Input, Segmented, Switch, Checkbox, Tooltip, Icon, Radio, Modal, Select } from 'luck-design/antd';
|
|
9
9
|
import styled from 'styled-components';
|
|
10
10
|
import { isArray, keyBy, isNil, groupBy } from 'lodash';
|
|
11
11
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
@@ -20,6 +20,37 @@ import { fetchFieldCondition, fetchAttrs } from "../../../constants/api-url";
|
|
|
20
20
|
import { getFrontRules } from "./meta/frontRules";
|
|
21
21
|
import { FIELD_SCOPES } from "../../../constants";
|
|
22
22
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.fieldsSetting';
|
|
23
|
+
var _DATA_FORMAT_OPTIONS = [{
|
|
24
|
+
value: 'YYYY-MM-DD HH:mm:ss',
|
|
25
|
+
label: '年-月-日 时:分:秒'
|
|
26
|
+
}, {
|
|
27
|
+
value: 'YYYY-MM-DD HH:mm',
|
|
28
|
+
label: '年-月-日 时:分'
|
|
29
|
+
}, {
|
|
30
|
+
value: 'YYYY-MM-DD HH',
|
|
31
|
+
label: '年-月-日 时'
|
|
32
|
+
}, {
|
|
33
|
+
value: 'YYYY-MM-DD',
|
|
34
|
+
label: '年-月-日'
|
|
35
|
+
}, {
|
|
36
|
+
value: 'YYYY-MM',
|
|
37
|
+
label: '年-月'
|
|
38
|
+
}, {
|
|
39
|
+
value: 'YYYY',
|
|
40
|
+
label: '年'
|
|
41
|
+
}, {
|
|
42
|
+
value: 'HH:mm:ss',
|
|
43
|
+
label: '时:分:秒'
|
|
44
|
+
}, {
|
|
45
|
+
value: 'HH:mm',
|
|
46
|
+
label: '时:分'
|
|
47
|
+
}, {
|
|
48
|
+
value: 'mm:ss',
|
|
49
|
+
label: '分:秒'
|
|
50
|
+
}, {
|
|
51
|
+
value: 'YYYY-wo',
|
|
52
|
+
label: '年-周'
|
|
53
|
+
}];
|
|
23
54
|
var _ALIGN_OPTIONS_ = [{
|
|
24
55
|
label: formatMessage({
|
|
25
56
|
id: "".concat(_I18N_PREFIX_, ".align.left"),
|
|
@@ -399,7 +430,25 @@ var SettingUI = function SettingUI(_ref) {
|
|
|
399
430
|
id: "".concat(_I18N_PREFIX_, ".readonly"),
|
|
400
431
|
label: '是否只读'
|
|
401
432
|
})
|
|
402
|
-
}, renderCodeIcon(fieldReadonly, FIELD_SCOPES.FIELD_READONLY)), !isBatch ? /*#__PURE__*/React.createElement(React.Fragment, null, ['table', 'tableForm'].includes(component) ? /*#__PURE__*/React.createElement(
|
|
433
|
+
}, renderCodeIcon(fieldReadonly, FIELD_SCOPES.FIELD_READONLY)), !isBatch ? /*#__PURE__*/React.createElement(React.Fragment, null, ['table', 'tableForm'].includes(component) ? /*#__PURE__*/React.createElement(React.Fragment, null, fieldData.property === 'date' && /*#__PURE__*/React.createElement(PanelItem, {
|
|
434
|
+
label: formatMessage({
|
|
435
|
+
id: "".concat(_I18N_PREFIX_, ".dateFormat"),
|
|
436
|
+
label: '日期格式'
|
|
437
|
+
})
|
|
438
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
439
|
+
size: "small",
|
|
440
|
+
onChange: function onChange(val) {
|
|
441
|
+
return run('dateFormat', val);
|
|
442
|
+
},
|
|
443
|
+
defaultValue: fieldData.dateFormat || 'YYYY-MM-DD HH:mm:ss'
|
|
444
|
+
}, _DATA_FORMAT_OPTIONS.map(function (opt) {
|
|
445
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
446
|
+
key: opt.value,
|
|
447
|
+
value: opt.value
|
|
448
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
449
|
+
title: opt.label
|
|
450
|
+
}, opt.label));
|
|
451
|
+
}))), /*#__PURE__*/React.createElement(Collapse, {
|
|
403
452
|
label: formatMessage({
|
|
404
453
|
id: "".concat(_I18N_PREFIX_, ".render"),
|
|
405
454
|
label: '内容定制渲染'
|
|
@@ -409,9 +458,11 @@ var SettingUI = function SettingUI(_ref) {
|
|
|
409
458
|
onChange: function onChange(val) {
|
|
410
459
|
return run('render', val);
|
|
411
460
|
},
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
461
|
+
defaultCode: _DEFAULT_RENDER_CODE,
|
|
462
|
+
onClear: function onClear() {
|
|
463
|
+
return run('render');
|
|
464
|
+
}
|
|
465
|
+
}))) : null, /*#__PURE__*/React.createElement(Collapse, {
|
|
415
466
|
label: formatMessage({
|
|
416
467
|
id: "".concat(_I18N_PREFIX_, ".defaultValue"),
|
|
417
468
|
label: '默认值'
|
|
@@ -5,9 +5,11 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { useRequest, useSetState, useDebounceFn, useMemoizedFn } from 'ahooks';
|
|
7
7
|
import { dropWhile, startsWith } from 'lodash';
|
|
8
|
+
import moment from 'moment';
|
|
8
9
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
9
10
|
import SettingUI from "./SettingUI";
|
|
10
11
|
import { fetchUpdateUniqueField, fetchAttrs, fetchAddFieldAttrs, fetchUpdateFieldAttrs, fetchDelAttrs } from "../../../constants/api-url";
|
|
12
|
+
import RuntimeComp from "../../../view/lc-components/JSX/RuntimeComp";
|
|
11
13
|
import { FIELD_SCOPES } from "../../../constants";
|
|
12
14
|
var _TRUE_FALSE_ = ['__TRUE__', '__FALSE__'];
|
|
13
15
|
var FieldSetting = function FieldSetting(_ref) {
|
|
@@ -192,6 +194,27 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
192
194
|
columns: [fieldData.field],
|
|
193
195
|
force: true
|
|
194
196
|
});
|
|
197
|
+
} else if ('dateFormat' === key && !fieldData.render) {
|
|
198
|
+
col.colDef.cellRendererFramework = function (params) {
|
|
199
|
+
return params.value ? moment(params.value).format(val) : '';
|
|
200
|
+
};
|
|
201
|
+
gridApi.api.refreshCells({
|
|
202
|
+
columns: [fieldData.field],
|
|
203
|
+
force: true
|
|
204
|
+
});
|
|
205
|
+
} else if ('render' === key) {
|
|
206
|
+
col.colDef.cellRendererFramework = function (params) {
|
|
207
|
+
return /*#__PURE__*/React.createElement(RuntimeComp, {
|
|
208
|
+
value: params.value,
|
|
209
|
+
data: params.data,
|
|
210
|
+
rowIndex: params.rowIndex,
|
|
211
|
+
params: params
|
|
212
|
+
}, val.replace(/(function\s*\w*\s*)\([^)]*\)(\s*{)/, '$1()$2'));
|
|
213
|
+
};
|
|
214
|
+
gridApi.api.refreshCells({
|
|
215
|
+
columns: [fieldData.field],
|
|
216
|
+
force: true
|
|
217
|
+
});
|
|
195
218
|
}
|
|
196
219
|
}
|
|
197
220
|
onChange(newFields);
|
|
@@ -227,7 +250,7 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
227
250
|
_context.next = 38;
|
|
228
251
|
break;
|
|
229
252
|
case 5:
|
|
230
|
-
if (!(key === 'align' || key === 'headerAlign' || key === 'pinned' || key === 'tip' || key === 'render')) {
|
|
253
|
+
if (!(key === 'align' || key === 'headerAlign' || key === 'pinned' || key === 'tip' || key === 'render' || key === 'dateFormat')) {
|
|
231
254
|
_context.next = 9;
|
|
232
255
|
break;
|
|
233
256
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
var Wrapper = styled.div.withConfig({
|
|
4
|
+
displayName: "Wrapper",
|
|
5
|
+
componentId: "luckda-6530__sc-o36flt-0"
|
|
6
|
+
})(["min-width:12px;height:22px;line-height:22px;text-align:center;border:1px solid var(--ant-border-color-base,#d9d9d9);border-radius:3px;padding:0 7px;color:var(--ant-text-color,rgba(0,0,0,0.65));margin:0 2px;"]);
|
|
7
|
+
var KeyIcon = function KeyIcon(_ref) {
|
|
8
|
+
var children = _ref.children;
|
|
9
|
+
return /*#__PURE__*/React.createElement(Wrapper, null, children);
|
|
10
|
+
};
|
|
11
|
+
export default KeyIcon;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useCreation, useKeyPress } from 'ahooks';
|
|
4
|
+
import { Modal, Row, Col } from 'luck-design/antd';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
7
|
+
import KeyIcon from "./KeyIcon";
|
|
8
|
+
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
9
|
+
var Title = styled.div.withConfig({
|
|
10
|
+
displayName: "Title",
|
|
11
|
+
componentId: "luckda-6530__sc-hk09ii-0"
|
|
12
|
+
})(["display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--ant-border-color-base,#d9d9d9);margin-bottom:6px;height:32px;font-size:14px;color:var(--ant-text-color,rgba(0,0,0,0.65));"]);
|
|
13
|
+
var Item = styled.div.withConfig({
|
|
14
|
+
displayName: "Item",
|
|
15
|
+
componentId: "luckda-6530__sc-hk09ii-1"
|
|
16
|
+
})(["display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;color:var(--ant-text-color,rgba(0,0,0,0.65));font-size:12px;min-height:24px;"]);
|
|
17
|
+
var ItemLeft = styled.div.withConfig({
|
|
18
|
+
displayName: "ItemLeft",
|
|
19
|
+
componentId: "luckda-6530__sc-hk09ii-2"
|
|
20
|
+
})(["display:flex;align-items:center;height:34px;padding:0 6px;line-height:22px;white-space:nowrap;"]);
|
|
21
|
+
var ItemRight = styled.div.withConfig({
|
|
22
|
+
displayName: "ItemRight",
|
|
23
|
+
componentId: "luckda-6530__sc-hk09ii-3"
|
|
24
|
+
})(["display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;padding:5px 0;"]);
|
|
25
|
+
var ShortcutModal = function ShortcutModal(_ref) {
|
|
26
|
+
var target = _ref.target,
|
|
27
|
+
show = _ref.show,
|
|
28
|
+
onClose = _ref.onClose;
|
|
29
|
+
var ctx = useContext();
|
|
30
|
+
var _useCreation = useCreation(function () {
|
|
31
|
+
var isMac = /macintosh|mac os x/i.test(navigator.userAgent);
|
|
32
|
+
var cKey = isMac ? '⌘' : 'Ctrl';
|
|
33
|
+
var cKeyAlias = isMac ? 'meta' : 'ctrl';
|
|
34
|
+
var aKey = isMac ? '⌥' : 'Alt';
|
|
35
|
+
return {
|
|
36
|
+
general: [{
|
|
37
|
+
key: 'save',
|
|
38
|
+
buttons: [cKey, 'S'],
|
|
39
|
+
buttonKeys: [cKeyAlias, 's'],
|
|
40
|
+
label: formatMessage({
|
|
41
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.save',
|
|
42
|
+
label: '保存'
|
|
43
|
+
})
|
|
44
|
+
}, {
|
|
45
|
+
key: 'preview',
|
|
46
|
+
buttons: [cKey, 'P'],
|
|
47
|
+
buttonKeys: [cKeyAlias, 'p'],
|
|
48
|
+
label: formatMessage({
|
|
49
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.preview',
|
|
50
|
+
label: '预览调试'
|
|
51
|
+
})
|
|
52
|
+
}, {
|
|
53
|
+
key: 'undo',
|
|
54
|
+
buttons: [cKey, 'Z'],
|
|
55
|
+
buttonKeys: [cKeyAlias, 'z'],
|
|
56
|
+
label: formatMessage({
|
|
57
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.undo',
|
|
58
|
+
label: '撤销'
|
|
59
|
+
})
|
|
60
|
+
}, {
|
|
61
|
+
key: 'redo',
|
|
62
|
+
buttons: [cKey, 'Shift', 'Z'],
|
|
63
|
+
buttonKeys: [cKeyAlias, 'shift', 'z'],
|
|
64
|
+
label: formatMessage({
|
|
65
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.redo',
|
|
66
|
+
label: '重做'
|
|
67
|
+
})
|
|
68
|
+
}, {
|
|
69
|
+
key: 'clone',
|
|
70
|
+
buttons: [cKey, 'C'],
|
|
71
|
+
buttonKeys: [cKeyAlias, 'c'],
|
|
72
|
+
label: formatMessage({
|
|
73
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.copy',
|
|
74
|
+
label: '克隆组件'
|
|
75
|
+
})
|
|
76
|
+
}, {
|
|
77
|
+
key: 'delete',
|
|
78
|
+
buttons: ['Backspace'],
|
|
79
|
+
buttonKeys: ['backspace'],
|
|
80
|
+
label: formatMessage({
|
|
81
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.delete',
|
|
82
|
+
label: '删除组件'
|
|
83
|
+
})
|
|
84
|
+
}],
|
|
85
|
+
others: [{
|
|
86
|
+
key: 'selectParent',
|
|
87
|
+
buttons: ['↑'],
|
|
88
|
+
buttonKeys: ['uparrow'],
|
|
89
|
+
label: formatMessage({
|
|
90
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.selectParent',
|
|
91
|
+
label: '选择父级组件'
|
|
92
|
+
})
|
|
93
|
+
}, {
|
|
94
|
+
key: 'selectChildren',
|
|
95
|
+
buttons: ['↓'],
|
|
96
|
+
buttonKeys: ['downarrow'],
|
|
97
|
+
label: formatMessage({
|
|
98
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.selectChildren',
|
|
99
|
+
label: '选择子级组件'
|
|
100
|
+
})
|
|
101
|
+
}, {
|
|
102
|
+
key: 'selectLeftBrother',
|
|
103
|
+
buttons: ['←'],
|
|
104
|
+
buttonKeys: ['leftarrow'],
|
|
105
|
+
label: formatMessage({
|
|
106
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.selectLeftBrother',
|
|
107
|
+
label: '向左选择兄弟组件'
|
|
108
|
+
})
|
|
109
|
+
}, {
|
|
110
|
+
key: 'selectRightBrother',
|
|
111
|
+
buttons: ['→'],
|
|
112
|
+
buttonKeys: ['rightarrow'],
|
|
113
|
+
label: formatMessage({
|
|
114
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.selectRightBrother',
|
|
115
|
+
label: '向右选择兄弟组件'
|
|
116
|
+
})
|
|
117
|
+
}, {
|
|
118
|
+
key: 'moveLeft',
|
|
119
|
+
buttons: [aKey, '←'],
|
|
120
|
+
buttonKeys: ['alt', 'leftarrow'],
|
|
121
|
+
label: formatMessage({
|
|
122
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.moveLeft',
|
|
123
|
+
label: '向左移动组件'
|
|
124
|
+
})
|
|
125
|
+
}, {
|
|
126
|
+
key: 'moveRight',
|
|
127
|
+
buttons: [aKey, '→'],
|
|
128
|
+
buttonKeys: ['alt', 'rightarrow'],
|
|
129
|
+
label: formatMessage({
|
|
130
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.moveRight',
|
|
131
|
+
label: '向右移动组件'
|
|
132
|
+
})
|
|
133
|
+
}]
|
|
134
|
+
};
|
|
135
|
+
}, []),
|
|
136
|
+
general = _useCreation.general,
|
|
137
|
+
others = _useCreation.others;
|
|
138
|
+
useKeyPress([].concat(_toConsumableArray(general), _toConsumableArray(others)).map(function (_ref2) {
|
|
139
|
+
var buttonKeys = _ref2.buttonKeys;
|
|
140
|
+
return buttonKeys.join('.');
|
|
141
|
+
}), function (event, key) {
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
event.stopPropagation();
|
|
144
|
+
ctx.$publisher(ctx.topics.DESIGN_SHORTCUT_EMIT, {
|
|
145
|
+
event: event,
|
|
146
|
+
key: key
|
|
147
|
+
});
|
|
148
|
+
}, {
|
|
149
|
+
exactMatch: true,
|
|
150
|
+
useCapture: true,
|
|
151
|
+
target: target
|
|
152
|
+
});
|
|
153
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
154
|
+
title: formatMessage({
|
|
155
|
+
id: 'luckda.lowcode.design.toolbar.shortcut',
|
|
156
|
+
label: '快捷键'
|
|
157
|
+
}),
|
|
158
|
+
visible: show,
|
|
159
|
+
onCancel: onClose,
|
|
160
|
+
width: 860,
|
|
161
|
+
footer: null,
|
|
162
|
+
getContainer: function getContainer() {
|
|
163
|
+
return document.getElementById('lc-design-workspace');
|
|
164
|
+
},
|
|
165
|
+
bodyStyle: {
|
|
166
|
+
marginTop: 0,
|
|
167
|
+
maxHeight: '60vh',
|
|
168
|
+
overflowY: 'auto'
|
|
169
|
+
}
|
|
170
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
171
|
+
gutter: 16
|
|
172
|
+
}, /*#__PURE__*/React.createElement(Col, {
|
|
173
|
+
className: "gutter-row",
|
|
174
|
+
span: 12
|
|
175
|
+
}, /*#__PURE__*/React.createElement(Title, null, formatMessage({
|
|
176
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.general',
|
|
177
|
+
label: '常规操作'
|
|
178
|
+
})), general.map(function (_ref3) {
|
|
179
|
+
var key = _ref3.key,
|
|
180
|
+
buttons = _ref3.buttons,
|
|
181
|
+
label = _ref3.label;
|
|
182
|
+
return /*#__PURE__*/React.createElement(Item, {
|
|
183
|
+
key: key
|
|
184
|
+
}, /*#__PURE__*/React.createElement(ItemLeft, null, label), /*#__PURE__*/React.createElement(ItemRight, null, buttons.map(function (b) {
|
|
185
|
+
return /*#__PURE__*/React.createElement(KeyIcon, {
|
|
186
|
+
key: b
|
|
187
|
+
}, b);
|
|
188
|
+
})));
|
|
189
|
+
})), /*#__PURE__*/React.createElement(Col, {
|
|
190
|
+
className: "gutter-row",
|
|
191
|
+
span: 12
|
|
192
|
+
}, /*#__PURE__*/React.createElement(Title, null, formatMessage({
|
|
193
|
+
id: 'luckda.lowcode.design.toolbar.shortcut.others',
|
|
194
|
+
label: '组件选择和移动'
|
|
195
|
+
})), others.map(function (_ref4) {
|
|
196
|
+
var key = _ref4.key,
|
|
197
|
+
buttons = _ref4.buttons,
|
|
198
|
+
label = _ref4.label;
|
|
199
|
+
return /*#__PURE__*/React.createElement(Item, {
|
|
200
|
+
key: key
|
|
201
|
+
}, /*#__PURE__*/React.createElement(ItemLeft, null, label), /*#__PURE__*/React.createElement(ItemRight, null, buttons.map(function (b) {
|
|
202
|
+
return /*#__PURE__*/React.createElement(KeyIcon, {
|
|
203
|
+
key: b
|
|
204
|
+
}, b);
|
|
205
|
+
})));
|
|
206
|
+
}))));
|
|
207
|
+
};
|
|
208
|
+
export default ShortcutModal;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useMemoizedFn } from 'ahooks';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
var Paragraph = Typography.Paragraph;
|
|
6
|
-
var BlockIdSpan = styled(Paragraph).withConfig({
|
|
7
|
-
displayName: "BlockIdSpan",
|
|
8
|
-
componentId: "luckda-6530__sc-gbohir-0"
|
|
9
|
-
})(["display:inline-block;margin:0;color:#595959;text-decoration:var(--ant-primary-color) wavy underline;cursor:copy;padding:0 4px;"]);
|
|
3
|
+
import { Icon } from 'luck-design/antd';
|
|
4
|
+
import { copyToClipboard } from '@luck-design-biz/base/utils';
|
|
10
5
|
var BlockEditor = function BlockEditor(_ref) {
|
|
11
6
|
var blockName = _ref.blockName,
|
|
12
7
|
blockId = _ref.blockId,
|
|
@@ -17,25 +12,21 @@ var BlockEditor = function BlockEditor(_ref) {
|
|
|
17
12
|
blockId: blockId
|
|
18
13
|
});
|
|
19
14
|
});
|
|
20
|
-
var handleCopyBlockId = useMemoizedFn(function (e) {
|
|
21
|
-
e.stopPropagation();
|
|
22
|
-
});
|
|
23
15
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
24
16
|
onClick: handleClick,
|
|
25
17
|
style: next ? {
|
|
26
18
|
color: 'var(--ant-primary-color)',
|
|
27
19
|
cursor: 'pointer'
|
|
28
20
|
} : {}
|
|
29
|
-
}, blockName, /*#__PURE__*/React.createElement(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
margin: 0
|
|
21
|
+
}, blockName, /*#__PURE__*/React.createElement(Icon, {
|
|
22
|
+
type: "copy",
|
|
23
|
+
onClick: function onClick(e) {
|
|
24
|
+
e.stopPropagation();
|
|
25
|
+
copyToClipboard(blockId);
|
|
35
26
|
},
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
style: {
|
|
28
|
+
margin: '0 8px'
|
|
38
29
|
}
|
|
39
|
-
}
|
|
30
|
+
})));
|
|
40
31
|
};
|
|
41
32
|
export default BlockEditor;
|
|
@@ -56,7 +56,10 @@ var BlocksEditor = function BlocksEditor(_ref) {
|
|
|
56
56
|
var _id = "block_".concat(suid());
|
|
57
57
|
var newData = concat(blocks, _objectSpread(_objectSpread({
|
|
58
58
|
id: _id,
|
|
59
|
-
name:
|
|
59
|
+
name: formatMessage({
|
|
60
|
+
id: "".concat(_I18N_PREFIX_, ".defaultBlock"),
|
|
61
|
+
label: '默认区块'
|
|
62
|
+
}),
|
|
60
63
|
type: type,
|
|
61
64
|
serialEffect: 'hidden',
|
|
62
65
|
mode: ['add', 'update', 'edit', 'info']
|