@luck-design-biz/luckda 1.0.2-2 → 1.0.2-20temp
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 +37 -27
- 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 +18 -8
- 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 +24 -16
- package/es/components/LdGridForm/index.js +16 -7
- package/es/helper/FromItems.js +64 -5
- package/es/helper/action.js +2 -0
- package/es/helper/form.js +7 -1
- package/es/helper/ldBuilder.js +9 -5
- 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/services.js +24 -7
- 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 +40 -6
- package/es/utils/grid.js +12 -3
- package/lib/components/Builder/index.js +36 -26
- 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 +15 -5
- 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 +24 -16
- package/lib/components/LdGridForm/index.js +13 -4
- package/lib/helper/FromItems.js +64 -5
- package/lib/helper/action.js +2 -0
- package/lib/helper/form.js +7 -1
- package/lib/helper/ldBuilder.js +8 -5
- 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/services.js +25 -7
- 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 +40 -5
- package/lib/utils/grid.js +13 -4
- 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
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
import { Checkbox, Icon, Badge } from 'luck-design/antd';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
import { isBoolean, cloneDeep } from 'lodash';
|
|
8
|
+
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
9
|
+
import JSEditor from "../panel-section/JSEditor";
|
|
10
|
+
var _DEFAULT_FUNC_ = 'function isTrue() {\n return true; \n}';
|
|
11
|
+
export var Wrapper = styled.div.withConfig({
|
|
12
|
+
displayName: "Wrapper",
|
|
13
|
+
componentId: "luckda-6530__sc-167zb23-0"
|
|
14
|
+
})(["display:flex;width:100%;justify-content:flex-end;align-items:center;"]);
|
|
15
|
+
var ConditionCheck = function ConditionCheck(_ref) {
|
|
16
|
+
var defaultValue = _ref.defaultValue,
|
|
17
|
+
onChange = _ref.onChange;
|
|
18
|
+
var dValue = useCreation(function () {
|
|
19
|
+
return isBoolean(defaultValue) ? {
|
|
20
|
+
checked: defaultValue
|
|
21
|
+
} : defaultValue;
|
|
22
|
+
}, []);
|
|
23
|
+
var _useState = useState(dValue),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
value = _useState2[0],
|
|
26
|
+
setValue = _useState2[1];
|
|
27
|
+
var handleChange = useMemoizedFn(function (val) {
|
|
28
|
+
var data = _objectSpread(_objectSpread({}, value), val);
|
|
29
|
+
setValue(data);
|
|
30
|
+
onChange(data);
|
|
31
|
+
});
|
|
32
|
+
var handleClear = useMemoizedFn(function () {
|
|
33
|
+
var data = cloneDeep(value);
|
|
34
|
+
delete data.code;
|
|
35
|
+
setValue(data);
|
|
36
|
+
onChange(data);
|
|
37
|
+
});
|
|
38
|
+
return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(JSEditor, {
|
|
39
|
+
defaultCode: (value === null || value === void 0 ? void 0 : value.code) || _DEFAULT_FUNC_,
|
|
40
|
+
onChange: function onChange(code) {
|
|
41
|
+
return handleChange({
|
|
42
|
+
code: code,
|
|
43
|
+
checked: true
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
onClear: handleClear
|
|
47
|
+
}, /*#__PURE__*/React.createElement(Badge, _extends({
|
|
48
|
+
dot: value.code
|
|
49
|
+
}, value.code ? {
|
|
50
|
+
color: "lime"
|
|
51
|
+
} : {}), /*#__PURE__*/React.createElement(Icon, {
|
|
52
|
+
type: "form",
|
|
53
|
+
style: {
|
|
54
|
+
fontSize: '14px',
|
|
55
|
+
paddingBottom: '1px'
|
|
56
|
+
}
|
|
57
|
+
}))), /*#__PURE__*/React.createElement(Checkbox, {
|
|
58
|
+
style: {
|
|
59
|
+
marginLeft: 8,
|
|
60
|
+
lineHeight: 1
|
|
61
|
+
},
|
|
62
|
+
checked: value.checked,
|
|
63
|
+
onChange: function onChange(e) {
|
|
64
|
+
return handleChange({
|
|
65
|
+
checked: e.target.checked
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
69
|
+
};
|
|
70
|
+
export default ConditionCheck;
|
|
@@ -132,13 +132,16 @@ var DataSetSelector = function DataSetSelector(_ref) {
|
|
|
132
132
|
style: {
|
|
133
133
|
width: 145
|
|
134
134
|
},
|
|
135
|
-
loading: loading
|
|
135
|
+
loading: loading,
|
|
136
|
+
showSearch: true,
|
|
137
|
+
optionFilterProp: "title"
|
|
136
138
|
}, options.map(function (opt) {
|
|
137
139
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
138
140
|
key: opt.uid,
|
|
139
|
-
value: opt.code
|
|
141
|
+
value: opt.code,
|
|
142
|
+
title: "".concat(opt.name, "|").concat(opt.code)
|
|
140
143
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
141
|
-
title: opt.name
|
|
144
|
+
title: "".concat(opt.name, "(").concat(opt.code, ")")
|
|
142
145
|
}, opt.name));
|
|
143
146
|
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
144
147
|
title: formatMessage({
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { Segmented } from 'luck-design/antd';
|
|
4
|
+
import { useMemoizedFn } from 'ahooks';
|
|
5
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
6
|
+
import { useGet } from "../../engine/provider/ContextProvider";
|
|
7
|
+
import PanelItem from "../components/PanelItem";
|
|
8
|
+
import { useEffect } from 'react';
|
|
9
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.dialogSize';
|
|
10
|
+
var _DIALOG_OPTIONS_ = [{
|
|
11
|
+
label: formatMessage({
|
|
12
|
+
id: "".concat(_I18N_PREFIX_, ".size.small"),
|
|
13
|
+
label: '小'
|
|
14
|
+
}),
|
|
15
|
+
value: 'small'
|
|
16
|
+
}, {
|
|
17
|
+
label: formatMessage({
|
|
18
|
+
id: "".concat(_I18N_PREFIX_, ".size.default"),
|
|
19
|
+
label: '中'
|
|
20
|
+
}),
|
|
21
|
+
value: 'default'
|
|
22
|
+
}, {
|
|
23
|
+
label: formatMessage({
|
|
24
|
+
id: "".concat(_I18N_PREFIX_, ".size.large"),
|
|
25
|
+
label: '大'
|
|
26
|
+
}),
|
|
27
|
+
value: 'large'
|
|
28
|
+
}, {
|
|
29
|
+
label: formatMessage({
|
|
30
|
+
id: "".concat(_I18N_PREFIX_, ".size.full"),
|
|
31
|
+
label: '全屏'
|
|
32
|
+
}),
|
|
33
|
+
value: 'full'
|
|
34
|
+
}, {
|
|
35
|
+
label: formatMessage({
|
|
36
|
+
id: "".concat(_I18N_PREFIX_, ".size.custom"),
|
|
37
|
+
label: '定制'
|
|
38
|
+
}),
|
|
39
|
+
value: 'custom'
|
|
40
|
+
}];
|
|
41
|
+
var DialogSize = function DialogSize(_ref) {
|
|
42
|
+
var nodeId = _ref.nodeId,
|
|
43
|
+
onChange = _ref.onChange;
|
|
44
|
+
var _useState = useState('custom'),
|
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
+
size = _useState2[0],
|
|
47
|
+
setSize = _useState2[1];
|
|
48
|
+
var width = useGet({
|
|
49
|
+
id: nodeId,
|
|
50
|
+
path: 'props.width'
|
|
51
|
+
});
|
|
52
|
+
var height = useGet({
|
|
53
|
+
id: nodeId,
|
|
54
|
+
path: 'props.height'
|
|
55
|
+
});
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
var findOption = _DIALOG_OPTIONS_.find(function (op) {
|
|
58
|
+
return op.height === height && op.width === width;
|
|
59
|
+
});
|
|
60
|
+
if (findOption && findOption.value !== 'custom') handleChange(findOption.value);else handleChange('custom');
|
|
61
|
+
}, [width, height]);
|
|
62
|
+
var handleChange = useMemoizedFn(function (v) {
|
|
63
|
+
setSize(v);
|
|
64
|
+
onChange(v);
|
|
65
|
+
});
|
|
66
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(PanelItem, {
|
|
67
|
+
label: "\u5C3A\u5BF8",
|
|
68
|
+
suppressPadding: true
|
|
69
|
+
}, /*#__PURE__*/React.createElement(Segmented, {
|
|
70
|
+
options: _DIALOG_OPTIONS_,
|
|
71
|
+
value: size,
|
|
72
|
+
size: "small",
|
|
73
|
+
onChange: handleChange
|
|
74
|
+
})));
|
|
75
|
+
};
|
|
76
|
+
export default DialogSize;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { useMemoizedFn } from 'ahooks';
|
|
4
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
5
|
+
import { useGet } from "../../engine/provider/ContextProvider";
|
|
6
|
+
import NumberInput from "../components/NumberInput";
|
|
7
|
+
import { useEffect } from 'react';
|
|
8
|
+
var units = [{
|
|
9
|
+
label: 'px',
|
|
10
|
+
value: 'px'
|
|
11
|
+
}, {
|
|
12
|
+
label: '%',
|
|
13
|
+
value: '%'
|
|
14
|
+
}, {
|
|
15
|
+
label: 'A',
|
|
16
|
+
value: 'auto'
|
|
17
|
+
}];
|
|
18
|
+
var DialogWidthHeight = function DialogWidthHeight(_ref) {
|
|
19
|
+
var defaultValue = _ref.defaultValue,
|
|
20
|
+
size = _ref.size,
|
|
21
|
+
onChange = _ref.onChange,
|
|
22
|
+
_ref$options = _ref.options,
|
|
23
|
+
options = _ref$options === void 0 ? units : _ref$options,
|
|
24
|
+
convertInt = _ref.convertInt,
|
|
25
|
+
_ref$min = _ref.min,
|
|
26
|
+
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
27
|
+
_ref$max = _ref.max,
|
|
28
|
+
max = _ref$max === void 0 ? 10000 : _ref$max,
|
|
29
|
+
nodeId = _ref.nodeId,
|
|
30
|
+
sizeOptions = _ref.sizeOptions;
|
|
31
|
+
var _useState = useState(defaultValue),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
val = _useState2[0],
|
|
34
|
+
setVal = _useState2[1];
|
|
35
|
+
var _size = useGet({
|
|
36
|
+
id: nodeId,
|
|
37
|
+
path: 'props.size'
|
|
38
|
+
});
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
if (_size !== 'custom') handleChange(sizeOptions[_size]);
|
|
41
|
+
}, [_size]);
|
|
42
|
+
var handleChange = useMemoizedFn(function (v) {
|
|
43
|
+
setVal(v);
|
|
44
|
+
onChange(v);
|
|
45
|
+
});
|
|
46
|
+
return /*#__PURE__*/React.createElement(NumberInput, {
|
|
47
|
+
options: options,
|
|
48
|
+
value: val,
|
|
49
|
+
size: size,
|
|
50
|
+
min: min,
|
|
51
|
+
max: max,
|
|
52
|
+
convertInt: convertInt,
|
|
53
|
+
onChange: handleChange,
|
|
54
|
+
placeholder: formatMessage({
|
|
55
|
+
id: 'luckda.lowcode.painter.panel-section.width-height',
|
|
56
|
+
label: '请输入数值'
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
export default DialogWidthHeight;
|
|
@@ -16,7 +16,7 @@ import { fetchFieldsByDataset } from "../../constants/api-url";
|
|
|
16
16
|
import { listReducer, getLDMetaAttr } from "../../engine/tools/helper";
|
|
17
17
|
import styles from "../style/fields-setting.less";
|
|
18
18
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.fieldsSetting';
|
|
19
|
-
var _PICK_KEYS_ = ['id', 'uid', 'field', 'width', 'align', 'headerAlign', 'pinned', 'tip', 'render', 'col', 'row', 'note', 'placeholder', 'fieldAliasName', 'complexConfig', 'formMode'];
|
|
19
|
+
var _PICK_KEYS_ = ['id', 'uid', 'field', 'width', 'align', 'headerAlign', 'pinned', 'tip', 'render', 'col', 'row', 'note', 'placeholder', 'fieldAliasName', 'complexConfig', 'formMode', 'dateFormat'];
|
|
20
20
|
var Header = styled.div.withConfig({
|
|
21
21
|
displayName: "Header",
|
|
22
22
|
componentId: "luckda-6530__sc-gcwvp1-0"
|
|
@@ -47,11 +47,11 @@ var IconConditionSelector = function IconConditionSelector(_ref) {
|
|
|
47
47
|
label: '绑定条件'
|
|
48
48
|
})
|
|
49
49
|
}, /*#__PURE__*/React.createElement(JSEditor, {
|
|
50
|
-
mustConfirm: true,
|
|
51
50
|
defaultCode: defaultCode,
|
|
52
51
|
onChange: function onChange(value) {
|
|
53
52
|
return handleChange('code', index, value);
|
|
54
|
-
}
|
|
53
|
+
},
|
|
54
|
+
showClear: false
|
|
55
55
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
56
56
|
type: "paper-clip",
|
|
57
57
|
style: {
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Collapse as AntCollapse, List } from 'luck-design/antd';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
6
|
+
import { reduce } from 'lodash';
|
|
7
|
+
import { useContext, useRemoteSource } from "../../../engine/provider/ContextProvider";
|
|
8
|
+
import { getLDMetaAttr } from "../../../engine/tools/helper";
|
|
9
|
+
var Wrapper = styled.div.withConfig({
|
|
10
|
+
displayName: "Wrapper",
|
|
11
|
+
componentId: "luckda-6530__sc-fxe9dl-0"
|
|
12
|
+
})(["width:300px;height:100%;padding-right:8px;overflow-y:auto;flex-shrink:0;"]);
|
|
13
|
+
var Collapse = styled(AntCollapse).withConfig({
|
|
14
|
+
displayName: "Collapse",
|
|
15
|
+
componentId: "luckda-6530__sc-fxe9dl-1"
|
|
16
|
+
})([".ant-collapse-content-box{padding:4px 6px;}"]);
|
|
17
|
+
var ListItem = styled(List.Item).withConfig({
|
|
18
|
+
displayName: "ListItem",
|
|
19
|
+
componentId: "luckda-6530__sc-fxe9dl-2"
|
|
20
|
+
})(["cursor:pointer;border-radius:4px;padding:8px 4px;&:hover{background:var(--ant-select-selection-color);}"]);
|
|
21
|
+
var ToolBar = function ToolBar(_ref) {
|
|
22
|
+
var _onClick = _ref.onClick;
|
|
23
|
+
var ctx = useContext();
|
|
24
|
+
var _useRemoteSource = useRemoteSource(),
|
|
25
|
+
module = _useRemoteSource.module,
|
|
26
|
+
dataset = _useRemoteSource.dataset;
|
|
27
|
+
var meta = useCreation(function () {
|
|
28
|
+
return [{
|
|
29
|
+
key: 'instance',
|
|
30
|
+
label: '组件实例',
|
|
31
|
+
children: ctx.componentList.map(function (_ref2) {
|
|
32
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
33
|
+
_id = _ref3[0],
|
|
34
|
+
_comp = _ref3[1];
|
|
35
|
+
return {
|
|
36
|
+
key: _id,
|
|
37
|
+
label: "".concat(_comp.name, "(").concat(_id, ")"),
|
|
38
|
+
text: "ctx.$('".concat(_id, "')")
|
|
39
|
+
};
|
|
40
|
+
})
|
|
41
|
+
}, {
|
|
42
|
+
key: 'ctx',
|
|
43
|
+
label: '上下文',
|
|
44
|
+
group: [{
|
|
45
|
+
key: 'common',
|
|
46
|
+
label: '通用',
|
|
47
|
+
children: [{
|
|
48
|
+
key: 'apiprefix',
|
|
49
|
+
label: 'service api前缀',
|
|
50
|
+
text: 'ctx.API_PREFIX'
|
|
51
|
+
}, {
|
|
52
|
+
key: 'primaryKey',
|
|
53
|
+
label: '主键key',
|
|
54
|
+
text: 'ctx.PRIMARY_KEY'
|
|
55
|
+
}, {
|
|
56
|
+
key: 'parentKey',
|
|
57
|
+
label: '树组件主键key',
|
|
58
|
+
text: 'ctx.PARENT_KEY'
|
|
59
|
+
}, {
|
|
60
|
+
key: 'publishEvent',
|
|
61
|
+
label: '发布事件',
|
|
62
|
+
text: "ctx.$publisher('\u8BDD\u9898', {foo: 1, bar: 2});"
|
|
63
|
+
}, {
|
|
64
|
+
key: 'subscribEvent',
|
|
65
|
+
label: '订阅事件',
|
|
66
|
+
text: "ctx.$subscriber('\u8BDD\u9898').on(()=>{}).watch();"
|
|
67
|
+
}, {
|
|
68
|
+
key: 'unsubscriber',
|
|
69
|
+
label: '卸载事件',
|
|
70
|
+
text: "ctx.$unsubscriber('\u8BDD\u9898', '\u8BA2\u9605\u8005ID');"
|
|
71
|
+
}]
|
|
72
|
+
}, {
|
|
73
|
+
key: 'tools',
|
|
74
|
+
label: '工具',
|
|
75
|
+
children: [{
|
|
76
|
+
key: 'dialog',
|
|
77
|
+
label: '提示弹窗',
|
|
78
|
+
text: "ctx.utils.dialog('confirm', { title: '\u63D0\u793A', content: 'Bla bla' });"
|
|
79
|
+
}, {
|
|
80
|
+
key: 'toast',
|
|
81
|
+
label: '提示信息',
|
|
82
|
+
text: "ctx.utils.toast('info', { content: 'Bla bla' });"
|
|
83
|
+
}, {
|
|
84
|
+
key: 'formatDate',
|
|
85
|
+
label: '格式化日期',
|
|
86
|
+
text: "const val = ctx.utils.formatter('date', new Date(), 'YYYY-MM-DD');"
|
|
87
|
+
}, {
|
|
88
|
+
key: 'formatCurrency',
|
|
89
|
+
label: '格式化金额',
|
|
90
|
+
text: "const val = ctx.utils.formatter('cnmobile', '10000.99', ',');"
|
|
91
|
+
}, {
|
|
92
|
+
key: 'formatPhoneNumber',
|
|
93
|
+
label: '格式化手机号',
|
|
94
|
+
text: "const val = ctx.utils.formatter('money', '+8615652988282');"
|
|
95
|
+
}, {
|
|
96
|
+
key: 'formatCardNumber',
|
|
97
|
+
label: '格式化银行卡号',
|
|
98
|
+
text: "const val = ctx.utils.formatter('card', '1565298828212233');"
|
|
99
|
+
}]
|
|
100
|
+
}, {
|
|
101
|
+
key: 'router',
|
|
102
|
+
label: '路由',
|
|
103
|
+
children: [{
|
|
104
|
+
key: 'push',
|
|
105
|
+
label: '入栈',
|
|
106
|
+
text: "ctx.router.push('\u8DEF\u5F84\u5730\u5740');"
|
|
107
|
+
}, {
|
|
108
|
+
key: 'pushLayer',
|
|
109
|
+
label: '打开覆层弹窗',
|
|
110
|
+
text: "ctx.router.push('\u8DEF\u5F84\u5730\u5740', {title: '\u6807\u9898', subTitle: '\u5B50\u6807\u9898', afterPop: ()=>{}}, 'layer');"
|
|
111
|
+
}, {
|
|
112
|
+
key: 'getQuery',
|
|
113
|
+
label: '获取链接参数',
|
|
114
|
+
text: "const argVal = ctx.router.getQuery('\u53C2\u6570\u952E');"
|
|
115
|
+
}, {
|
|
116
|
+
key: 'stringifyQuery',
|
|
117
|
+
label: '转换链接参数字符串',
|
|
118
|
+
text: "ctx.router.stringifyQuery({arg: 1});"
|
|
119
|
+
}]
|
|
120
|
+
}]
|
|
121
|
+
}, {
|
|
122
|
+
key: 'behavior',
|
|
123
|
+
label: '执行行为',
|
|
124
|
+
children: reduce(module.actions, function (ret, actionName, actionKey) {
|
|
125
|
+
ret.push({
|
|
126
|
+
key: actionKey,
|
|
127
|
+
label: "".concat(actionName, "(").concat(actionKey, ")"),
|
|
128
|
+
text: "ctx.utils.callBehavior({ moduleCode: '".concat(getLDMetaAttr('moduleCode'), "', datasetCode: '\u6570\u636E\u96C6\u7F16\u7801', behaviorKey:'").concat(actionKey, "' }, {}, {});")
|
|
129
|
+
});
|
|
130
|
+
return ret;
|
|
131
|
+
}, [])
|
|
132
|
+
}, {
|
|
133
|
+
key: 'dataset',
|
|
134
|
+
label: '数据集',
|
|
135
|
+
children: reduce(module.dataSets, function (ret, _, dsCode) {
|
|
136
|
+
var ds = dataset.find(function (_ds) {
|
|
137
|
+
return _ds.code === dsCode;
|
|
138
|
+
});
|
|
139
|
+
ret.push({
|
|
140
|
+
key: ds.uid,
|
|
141
|
+
label: ds.name,
|
|
142
|
+
text: "'".concat(ds.code, "'")
|
|
143
|
+
});
|
|
144
|
+
return ret;
|
|
145
|
+
}, [])
|
|
146
|
+
}];
|
|
147
|
+
}, []);
|
|
148
|
+
var render = useMemoizedFn(function (_meta) {
|
|
149
|
+
return _meta.map(function (data) {
|
|
150
|
+
return /*#__PURE__*/React.createElement(Collapse.Panel, {
|
|
151
|
+
header: data.label,
|
|
152
|
+
key: data.key
|
|
153
|
+
}, data.group && /*#__PURE__*/React.createElement(Collapse, {
|
|
154
|
+
expandIconPosition: "right"
|
|
155
|
+
}, render(data.group)), data.children && /*#__PURE__*/React.createElement(List, {
|
|
156
|
+
split: false,
|
|
157
|
+
dataSource: data.children,
|
|
158
|
+
renderItem: function renderItem(item) {
|
|
159
|
+
return /*#__PURE__*/React.createElement(ListItem, {
|
|
160
|
+
key: item.key,
|
|
161
|
+
onClick: function onClick() {
|
|
162
|
+
return _onClick(item);
|
|
163
|
+
}
|
|
164
|
+
}, item.label);
|
|
165
|
+
}
|
|
166
|
+
}));
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(Collapse, {
|
|
170
|
+
accordion: true,
|
|
171
|
+
defaultActiveKey: ['instance']
|
|
172
|
+
}, render(meta)));
|
|
173
|
+
};
|
|
174
|
+
export default ToolBar;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React, { useRef, useState, useImperativeHandle } from 'react';
|
|
4
|
+
import * as monaco from 'monaco-editor';
|
|
5
|
+
import { useBoolean, useDebounceFn, useMemoizedFn } from 'ahooks';
|
|
6
|
+
import { Button, Modal, Badge } from 'luck-design/antd';
|
|
7
|
+
import { LuckModal, SplitPane } from 'luck-design';
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
import { isNil } from 'lodash';
|
|
10
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
11
|
+
import ToolBar from "./ToolBar";
|
|
12
|
+
import RuntimeComp from "../../../view/lc-components/JSX/RuntimeComp";
|
|
13
|
+
import JSEditor from "../../components/code-editor/JSEditor";
|
|
14
|
+
import styles from "./index.less";
|
|
15
|
+
var Wrapper = styled.div.withConfig({
|
|
16
|
+
displayName: "Wrapper",
|
|
17
|
+
componentId: "luckda-6530__sc-pquf2n-0"
|
|
18
|
+
})(["width:100%;height:100%;display:flex;overflow:hidden;"]);
|
|
19
|
+
var PreviewWrapper = styled.div.withConfig({
|
|
20
|
+
displayName: "PreviewWrapper",
|
|
21
|
+
componentId: "luckda-6530__sc-pquf2n-1"
|
|
22
|
+
})(["width:100%;height:100%;overflow:auto;"]);
|
|
23
|
+
var BlockBadge = function BlockBadge(props) {
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: styles.blockBadge
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Badge, props));
|
|
27
|
+
};
|
|
28
|
+
var _JSEditor = function _JSEditor(_ref) {
|
|
29
|
+
var defaultValue = _ref.defaultValue,
|
|
30
|
+
defaultCode = _ref.defaultCode,
|
|
31
|
+
onChange = _ref.onChange,
|
|
32
|
+
children = _ref.children,
|
|
33
|
+
_ref$isjsx = _ref.isjsx,
|
|
34
|
+
isjsx = _ref$isjsx === void 0 ? false : _ref$isjsx,
|
|
35
|
+
trigger = _ref.trigger,
|
|
36
|
+
onClear = _ref.onClear,
|
|
37
|
+
_ref$showClear = _ref.showClear,
|
|
38
|
+
showClear = _ref$showClear === void 0 ? true : _ref$showClear;
|
|
39
|
+
var editorRef = useRef();
|
|
40
|
+
var _useState = useState(defaultValue || defaultCode),
|
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
+
code = _useState2[0],
|
|
43
|
+
setCode = _useState2[1];
|
|
44
|
+
var _useDebounceFn = useDebounceFn(function (_code) {
|
|
45
|
+
setCode(_code);
|
|
46
|
+
}, {
|
|
47
|
+
wait: 500
|
|
48
|
+
}),
|
|
49
|
+
run = _useDebounceFn.run;
|
|
50
|
+
var _useBoolean = useBoolean(false),
|
|
51
|
+
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
52
|
+
visible = _useBoolean2[0],
|
|
53
|
+
_useBoolean2$ = _useBoolean2[1],
|
|
54
|
+
show = _useBoolean2$.setTrue,
|
|
55
|
+
hidden = _useBoolean2$.setFalse;
|
|
56
|
+
var _useBoolean3 = useBoolean(false),
|
|
57
|
+
_useBoolean4 = _slicedToArray(_useBoolean3, 2),
|
|
58
|
+
hasError = _useBoolean4[0],
|
|
59
|
+
_useBoolean4$ = _useBoolean4[1],
|
|
60
|
+
hasErrorOn = _useBoolean4$.setTrue,
|
|
61
|
+
hasErrorOff = _useBoolean4$.setFalse;
|
|
62
|
+
useImperativeHandle(trigger, function () {
|
|
63
|
+
return {
|
|
64
|
+
show: show,
|
|
65
|
+
hidden: hidden
|
|
66
|
+
};
|
|
67
|
+
}, []);
|
|
68
|
+
var handleErrorCatch = useMemoizedFn(function (error) {
|
|
69
|
+
if (isNil(error)) {
|
|
70
|
+
hasErrorOff();
|
|
71
|
+
} else {
|
|
72
|
+
hasErrorOn();
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
var handleToolItemClick = useMemoizedFn(function (item) {
|
|
76
|
+
var _editorRef$current$ed = editorRef.current.editor.getPosition(),
|
|
77
|
+
lineNumber = _editorRef$current$ed.lineNumber,
|
|
78
|
+
column = _editorRef$current$ed.column;
|
|
79
|
+
var range = new monaco.Range(lineNumber, column, lineNumber, column);
|
|
80
|
+
editorRef.current.editor.executeEdits('', [{
|
|
81
|
+
range: range,
|
|
82
|
+
text: item.text
|
|
83
|
+
}]);
|
|
84
|
+
});
|
|
85
|
+
var handleOk = useMemoizedFn(function () {
|
|
86
|
+
onChange(editorRef.current.editor.getValue());
|
|
87
|
+
hidden();
|
|
88
|
+
});
|
|
89
|
+
var handleClear = useMemoizedFn(function () {
|
|
90
|
+
Modal.confirm({
|
|
91
|
+
title: formatMessage({
|
|
92
|
+
id: 'luckda.lowcode.painter.panel-section.jseditor.clear',
|
|
93
|
+
label: '确定执行操作吗?'
|
|
94
|
+
}),
|
|
95
|
+
okType: 'danger',
|
|
96
|
+
okText: formatMessage({
|
|
97
|
+
id: 'app.base.operate.ok'
|
|
98
|
+
}),
|
|
99
|
+
cancelText: formatMessage({
|
|
100
|
+
id: 'app.base.operate.cancel'
|
|
101
|
+
}),
|
|
102
|
+
onOk: function onOk() {
|
|
103
|
+
onClear();
|
|
104
|
+
hidden();
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
var renderFooter = useMemoizedFn(function () {
|
|
109
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isjsx ? /*#__PURE__*/React.createElement(Button, {
|
|
110
|
+
disabled: hasError
|
|
111
|
+
}, formatMessage({
|
|
112
|
+
id: 'luckda.lowcode.painter.panel-section.jseditor.saveto',
|
|
113
|
+
label: '保存为'
|
|
114
|
+
})) : null, showClear ? /*#__PURE__*/React.createElement(Button, {
|
|
115
|
+
type: "danger",
|
|
116
|
+
onClick: handleClear
|
|
117
|
+
}, formatMessage({
|
|
118
|
+
id: 'app.base.operate.clear',
|
|
119
|
+
label: '清空'
|
|
120
|
+
})) : null, /*#__PURE__*/React.createElement(Button, {
|
|
121
|
+
type: "primary",
|
|
122
|
+
disabled: hasError,
|
|
123
|
+
onClick: handleOk
|
|
124
|
+
}, formatMessage({
|
|
125
|
+
id: 'app.base.operate.ok',
|
|
126
|
+
label: '确定'
|
|
127
|
+
})));
|
|
128
|
+
});
|
|
129
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !trigger && /*#__PURE__*/React.createElement(BlockBadge, _extends({
|
|
130
|
+
dot: !!defaultValue
|
|
131
|
+
}, !!defaultValue ? {
|
|
132
|
+
color: "lime"
|
|
133
|
+
} : {}), children ? /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
onClick: show
|
|
135
|
+
}, children) : /*#__PURE__*/React.createElement(Button, {
|
|
136
|
+
block: true,
|
|
137
|
+
size: "small",
|
|
138
|
+
onClick: show,
|
|
139
|
+
style: {
|
|
140
|
+
width: '100%'
|
|
141
|
+
}
|
|
142
|
+
}, formatMessage({
|
|
143
|
+
id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',
|
|
144
|
+
label: '源码编辑'
|
|
145
|
+
}))), /*#__PURE__*/React.createElement(LuckModal, {
|
|
146
|
+
title: formatMessage({
|
|
147
|
+
id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',
|
|
148
|
+
label: '源码编辑'
|
|
149
|
+
}),
|
|
150
|
+
width: "80vw",
|
|
151
|
+
height: "80vh",
|
|
152
|
+
fullScreen: true,
|
|
153
|
+
mask: false,
|
|
154
|
+
maskClosable: false,
|
|
155
|
+
visible: visible,
|
|
156
|
+
getContainer: function getContainer() {
|
|
157
|
+
return document.getElementById('lc-design-workspace');
|
|
158
|
+
},
|
|
159
|
+
footer: renderFooter(),
|
|
160
|
+
onClose: hidden
|
|
161
|
+
}, /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(ToolBar, {
|
|
162
|
+
onClick: handleToolItemClick
|
|
163
|
+
}), isjsx ? /*#__PURE__*/React.createElement(SplitPane, {
|
|
164
|
+
split: "vertical"
|
|
165
|
+
}, /*#__PURE__*/React.createElement(SplitPane.Pane, {
|
|
166
|
+
style: {
|
|
167
|
+
overflow: 'hidden'
|
|
168
|
+
}
|
|
169
|
+
}, /*#__PURE__*/React.createElement(JSEditor, {
|
|
170
|
+
ref: editorRef,
|
|
171
|
+
onChange: run
|
|
172
|
+
}, defaultValue || defaultCode)), /*#__PURE__*/React.createElement(SplitPane.Pane, {
|
|
173
|
+
minSize: "400px"
|
|
174
|
+
}, /*#__PURE__*/React.createElement(PreviewWrapper, null, /*#__PURE__*/React.createElement(RuntimeComp, {
|
|
175
|
+
onErrorCatch: handleErrorCatch
|
|
176
|
+
}, code)))) : /*#__PURE__*/React.createElement(JSEditor, {
|
|
177
|
+
ref: editorRef,
|
|
178
|
+
onChange: run
|
|
179
|
+
}, defaultValue || defaultCode))));
|
|
180
|
+
};
|
|
181
|
+
export default _JSEditor;
|
|
@@ -5,7 +5,7 @@ import { useMemoizedFn } from 'ahooks';
|
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { Tooltip } from 'luck-design/antd';
|
|
7
7
|
import styles from "../style/page-layout-display.less";
|
|
8
|
-
var _TYPES_ = ['lr', 'tb', 'lmr', 'ltb'];
|
|
8
|
+
var _TYPES_ = ['lr', 'tb', 'lmr', 'ltb', 's'];
|
|
9
9
|
var PageLayoutDisplay = function PageLayoutDisplay(_ref) {
|
|
10
10
|
var defaultValue = _ref.defaultValue,
|
|
11
11
|
onChange = _ref.onChange;
|
|
@@ -106,7 +106,12 @@ var PageLayoutDisplay = function PageLayoutDisplay(_ref) {
|
|
|
106
106
|
height: '50%'
|
|
107
107
|
},
|
|
108
108
|
className: styles['item-block']
|
|
109
|
-
})))
|
|
109
|
+
}))), _type === 's' && /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
style: {
|
|
111
|
+
flex: 4
|
|
112
|
+
},
|
|
113
|
+
className: styles['item-block']
|
|
114
|
+
})));
|
|
110
115
|
})));
|
|
111
116
|
};
|
|
112
117
|
export default PageLayoutDisplay;
|