@luck-design-biz/luckda 1.0.2-9 → 1.0.3-13tl
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/LDActions/index.js +1 -0
- package/es/components/LdFormList/index.js +6 -4
- package/es/components/LdGrid/index.js +1 -4
- package/es/helper/action.js +2 -0
- package/es/locales/zh-CN.js +18 -1
- package/es/lowcode/constants/api-url.js +329 -187
- 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/button.api.json +0 -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/form.props.json +1 -1
- package/es/lowcode/engine/provider/ContextProvider/router.js +21 -1
- package/es/lowcode/painter/DesignOperator.js +4 -3
- package/es/lowcode/painter/History.js +300 -0
- package/es/lowcode/painter/Ribbon.js +37 -1
- package/es/lowcode/painter/components/AdvancePanel.js +1 -1
- 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 +0 -1
- package/es/lowcode/painter/panel-section/ConditionCheck.js +71 -0
- 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/JSEditor/ToolBar.js +61 -6
- package/es/lowcode/painter/panel-section/JSEditor/index.js +37 -5
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/es/lowcode/painter/style/action-bind-modal.less +1 -1
- package/es/lowcode/painter/style/history.less +46 -0
- package/es/lowcode/painter/style/outline.less +1 -1
- package/es/lowcode/view/lc-components/Box/meta.json +1 -1
- package/es/lowcode/view/lc-components/Dialog/index.js +12 -5
- package/es/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/es/lowcode/view/lc-components/Drawer/index.js +3 -3
- package/es/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/es/lowcode/view/lc-components/Form/index.js +12 -19
- package/es/lowcode/view/lc-components/Form/meta.json +1 -1
- package/es/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +33 -16
- package/es/lowcode/view/lc-components/Table/index.js +5 -4
- 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/form.js +4 -3
- package/es/utils/grid.js +10 -2
- package/lib/components/LDActions/index.js +1 -0
- package/lib/components/LdFormList/index.js +6 -4
- package/lib/components/LdGrid/index.js +1 -4
- package/lib/helper/action.js +2 -0
- package/lib/locales/zh-CN.js +18 -1
- package/lib/lowcode/constants/api-url.js +329 -188
- 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/button.api.json +0 -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/form.props.json +1 -1
- package/lib/lowcode/engine/provider/ContextProvider/router.js +22 -1
- package/lib/lowcode/painter/DesignOperator.js +4 -3
- package/lib/lowcode/painter/History.js +308 -0
- package/lib/lowcode/painter/Ribbon.js +37 -1
- package/lib/lowcode/painter/components/AdvancePanel.js +1 -1
- 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 +0 -1
- package/lib/lowcode/painter/panel-section/ConditionCheck.js +79 -0
- 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/JSEditor/ToolBar.js +61 -6
- package/lib/lowcode/painter/panel-section/JSEditor/index.js +36 -4
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/lib/lowcode/painter/style/action-bind-modal.less +1 -1
- package/lib/lowcode/painter/style/history.less +46 -0
- package/lib/lowcode/painter/style/outline.less +1 -1
- package/lib/lowcode/view/lc-components/Box/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Dialog/index.js +10 -3
- package/lib/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/lib/lowcode/view/lc-components/Drawer/index.js +1 -1
- package/lib/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Form/index.js +12 -19
- package/lib/lowcode/view/lc-components/Form/meta.json +1 -1
- package/lib/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +32 -15
- package/lib/lowcode/view/lc-components/Table/index.js +5 -4
- 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/form.js +3 -2
- package/lib/utils/grid.js +11 -3
- package/package.json +1 -2
- package/es/lowcode/engine/meta/fielddatadic.props.default.json +0 -16
- package/es/lowcode/engine/meta/fielddatadic.props.json +0 -73
- package/lib/lowcode/engine/meta/fielddatadic.props.default.json +0 -16
- package/lib/lowcode/engine/meta/fielddatadic.props.json +0 -73
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
showClear: true,
|
|
47
|
+
onClear: handleClear
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Badge, _extends({
|
|
49
|
+
dot: value.code
|
|
50
|
+
}, value.code ? {
|
|
51
|
+
color: "lime"
|
|
52
|
+
} : {}), /*#__PURE__*/React.createElement(Icon, {
|
|
53
|
+
type: "form",
|
|
54
|
+
style: {
|
|
55
|
+
fontSize: '14px',
|
|
56
|
+
paddingBottom: '1px'
|
|
57
|
+
}
|
|
58
|
+
}))), /*#__PURE__*/React.createElement(Checkbox, {
|
|
59
|
+
style: {
|
|
60
|
+
marginLeft: 8,
|
|
61
|
+
lineHeight: 1
|
|
62
|
+
},
|
|
63
|
+
checked: value.checked,
|
|
64
|
+
onChange: function onChange(e) {
|
|
65
|
+
return handleChange({
|
|
66
|
+
checked: e.target.checked
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
71
|
+
export default ConditionCheck;
|
|
@@ -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;
|
|
@@ -9,7 +9,7 @@ import { getModuleData } from "../../../engine/provider/ContextProvider/usePageD
|
|
|
9
9
|
var Wrapper = styled.div.withConfig({
|
|
10
10
|
displayName: "Wrapper",
|
|
11
11
|
componentId: "luckda-6530__sc-fxe9dl-0"
|
|
12
|
-
})(["width:300px;height:100%;padding-right:8px;overflow-y:auto;"]);
|
|
12
|
+
})(["width:300px;height:100%;padding-right:8px;overflow-y:auto;flex-shrink:0;"]);
|
|
13
13
|
var Collapse = styled(AntCollapse).withConfig({
|
|
14
14
|
displayName: "Collapse",
|
|
15
15
|
componentId: "luckda-6530__sc-fxe9dl-1"
|
|
@@ -22,7 +22,8 @@ var ToolBar = function ToolBar(_ref) {
|
|
|
22
22
|
var _onClick = _ref.onClick;
|
|
23
23
|
var ctx = useContext();
|
|
24
24
|
var _useRemoteSource = useRemoteSource(),
|
|
25
|
-
module = _useRemoteSource.module
|
|
25
|
+
module = _useRemoteSource.module,
|
|
26
|
+
dataset = _useRemoteSource.dataset;
|
|
26
27
|
var moduleData = getModuleData();
|
|
27
28
|
var meta = useCreation(function () {
|
|
28
29
|
return [{
|
|
@@ -49,13 +50,21 @@ var ToolBar = function ToolBar(_ref) {
|
|
|
49
50
|
label: 'service api前缀',
|
|
50
51
|
text: 'ctx.API_PREFIX'
|
|
51
52
|
}, {
|
|
52
|
-
key: '
|
|
53
|
+
key: 'primaryKey',
|
|
53
54
|
label: '主键key',
|
|
54
55
|
text: 'ctx.PRIMARY_KEY'
|
|
55
56
|
}, {
|
|
56
|
-
key: '
|
|
57
|
+
key: 'parentKey',
|
|
57
58
|
label: '树组件主键key',
|
|
58
59
|
text: 'ctx.PARENT_KEY'
|
|
60
|
+
}, {
|
|
61
|
+
key: 'publishEvent',
|
|
62
|
+
label: '发布事件',
|
|
63
|
+
text: "ctx.$publisher('\u8BDD\u9898', {arg: 1});"
|
|
64
|
+
}, {
|
|
65
|
+
key: 'subscribEvent',
|
|
66
|
+
label: '订阅事件',
|
|
67
|
+
text: "ctx.$subscriber('\u8BDD\u9898').on(()=>{}).watch();"
|
|
59
68
|
}]
|
|
60
69
|
}, {
|
|
61
70
|
key: 'tools',
|
|
@@ -63,7 +72,27 @@ var ToolBar = function ToolBar(_ref) {
|
|
|
63
72
|
children: [{
|
|
64
73
|
key: 'dialog',
|
|
65
74
|
label: '提示弹窗',
|
|
66
|
-
text:
|
|
75
|
+
text: "ctx.utils.dialog('confirm', { title: '\u63D0\u793A', content: 'Bla bla' });"
|
|
76
|
+
}, {
|
|
77
|
+
key: 'toast',
|
|
78
|
+
label: '提示信息',
|
|
79
|
+
text: "ctx.utils.toast('info', { content: 'Bla bla' });"
|
|
80
|
+
}, {
|
|
81
|
+
key: 'formatDate',
|
|
82
|
+
label: '格式化日期',
|
|
83
|
+
text: "const val = ctx.utils.formatter('date', new Date(), 'YYYY-MM-DD');"
|
|
84
|
+
}, {
|
|
85
|
+
key: 'formatCurrency',
|
|
86
|
+
label: '格式化金额',
|
|
87
|
+
text: "const val = ctx.utils.formatter('cnmobile', '10000.99', ',');"
|
|
88
|
+
}, {
|
|
89
|
+
key: 'formatPhoneNumber',
|
|
90
|
+
label: '格式化手机号',
|
|
91
|
+
text: "const val = ctx.utils.formatter('money', '+8615652988282');"
|
|
92
|
+
}, {
|
|
93
|
+
key: 'formatCardNumber',
|
|
94
|
+
label: '格式化银行卡号',
|
|
95
|
+
text: "const val = ctx.utils.formatter('card', '1565298828212233');"
|
|
67
96
|
}]
|
|
68
97
|
}, {
|
|
69
98
|
key: 'router',
|
|
@@ -71,7 +100,19 @@ var ToolBar = function ToolBar(_ref) {
|
|
|
71
100
|
children: [{
|
|
72
101
|
key: 'push',
|
|
73
102
|
label: '入栈',
|
|
74
|
-
text:
|
|
103
|
+
text: "ctx.router.push('\u8DEF\u5F84\u5730\u5740');"
|
|
104
|
+
}, {
|
|
105
|
+
key: 'pushLayer',
|
|
106
|
+
label: '打开覆层弹窗',
|
|
107
|
+
text: "ctx.router.push('\u8DEF\u5F84\u5730\u5740', {title: '\u6807\u9898', subTitle: '\u5B50\u6807\u9898', afterPop: ()=>{}}, 'layer');"
|
|
108
|
+
}, {
|
|
109
|
+
key: 'getQuery',
|
|
110
|
+
label: '获取链接参数',
|
|
111
|
+
text: "const argVal = ctx.router.getQuery('\u53C2\u6570\u952E');"
|
|
112
|
+
}, {
|
|
113
|
+
key: 'stringifyQuery',
|
|
114
|
+
label: '转换链接参数字符串',
|
|
115
|
+
text: "ctx.router.stringifyQuery({arg: 1});"
|
|
75
116
|
}]
|
|
76
117
|
}]
|
|
77
118
|
}, {
|
|
@@ -85,6 +126,20 @@ var ToolBar = function ToolBar(_ref) {
|
|
|
85
126
|
});
|
|
86
127
|
return ret;
|
|
87
128
|
}, [])
|
|
129
|
+
}, {
|
|
130
|
+
key: 'dataset',
|
|
131
|
+
label: '数据集',
|
|
132
|
+
children: reduce(module.dataSets, function (ret, _, dsCode) {
|
|
133
|
+
var ds = dataset.find(function (_ds) {
|
|
134
|
+
return _ds.code === dsCode;
|
|
135
|
+
});
|
|
136
|
+
ret.push({
|
|
137
|
+
key: ds.uid,
|
|
138
|
+
label: ds.name,
|
|
139
|
+
text: "'".concat(ds.code, "'")
|
|
140
|
+
});
|
|
141
|
+
return ret;
|
|
142
|
+
}, [])
|
|
88
143
|
}];
|
|
89
144
|
}, []);
|
|
90
145
|
var render = useMemoizedFn(function (_meta) {
|
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
2
2
|
import React, { useRef, useState, useImperativeHandle } from 'react';
|
|
3
3
|
import * as monaco from 'monaco-editor';
|
|
4
4
|
import { useBoolean, useDebounceFn, useMemoizedFn } from 'ahooks';
|
|
5
|
-
import { Button } from 'luck-design/antd';
|
|
5
|
+
import { Button, Modal } from 'luck-design/antd';
|
|
6
6
|
import { LuckModal, SplitPane } from 'luck-design';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { isNil } from 'lodash';
|
|
@@ -13,7 +13,11 @@ import JSEditor from "../../components/code-editor/JSEditor";
|
|
|
13
13
|
var Wrapper = styled.div.withConfig({
|
|
14
14
|
displayName: "Wrapper",
|
|
15
15
|
componentId: "luckda-6530__sc-pquf2n-0"
|
|
16
|
-
})(["width:100%;height:100%;display:flex;"]);
|
|
16
|
+
})(["width:100%;height:100%;display:flex;overflow:hidden;"]);
|
|
17
|
+
var PreviewWrapper = styled.div.withConfig({
|
|
18
|
+
displayName: "PreviewWrapper",
|
|
19
|
+
componentId: "luckda-6530__sc-pquf2n-1"
|
|
20
|
+
})(["width:100%;height:100%;overflow:auto;"]);
|
|
17
21
|
var _JSEditor = function _JSEditor(_ref) {
|
|
18
22
|
var defaultValue = _ref.defaultValue,
|
|
19
23
|
defaultCode = _ref.defaultCode,
|
|
@@ -21,7 +25,10 @@ var _JSEditor = function _JSEditor(_ref) {
|
|
|
21
25
|
children = _ref.children,
|
|
22
26
|
_ref$isjsx = _ref.isjsx,
|
|
23
27
|
isjsx = _ref$isjsx === void 0 ? false : _ref$isjsx,
|
|
24
|
-
trigger = _ref.trigger
|
|
28
|
+
trigger = _ref.trigger,
|
|
29
|
+
onClear = _ref.onClear,
|
|
30
|
+
_ref$showClear = _ref.showClear,
|
|
31
|
+
showClear = _ref$showClear === void 0 ? false : _ref$showClear;
|
|
25
32
|
var editorRef = useRef();
|
|
26
33
|
var _useState = useState(defaultValue || defaultCode),
|
|
27
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -72,12 +79,37 @@ var _JSEditor = function _JSEditor(_ref) {
|
|
|
72
79
|
onChange(editorRef.current.editor.getValue());
|
|
73
80
|
hidden();
|
|
74
81
|
});
|
|
82
|
+
var handleClear = useMemoizedFn(function () {
|
|
83
|
+
Modal.confirm({
|
|
84
|
+
title: formatMessage({
|
|
85
|
+
id: 'luckda.lowcode.painter.panel-section.jseditor.clear',
|
|
86
|
+
label: '确定执行操作吗?'
|
|
87
|
+
}),
|
|
88
|
+
okType: 'danger',
|
|
89
|
+
okText: formatMessage({
|
|
90
|
+
id: 'app.base.operate.ok'
|
|
91
|
+
}),
|
|
92
|
+
cancelText: formatMessage({
|
|
93
|
+
id: 'app.base.operate.cancel'
|
|
94
|
+
}),
|
|
95
|
+
onOk: function onOk() {
|
|
96
|
+
onClear();
|
|
97
|
+
hidden();
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
});
|
|
75
101
|
var renderFooter = useMemoizedFn(function () {
|
|
76
102
|
return /*#__PURE__*/React.createElement(React.Fragment, null, isjsx ? /*#__PURE__*/React.createElement(Button, {
|
|
77
103
|
disabled: hasError
|
|
78
104
|
}, formatMessage({
|
|
79
105
|
id: 'luckda.lowcode.painter.panel-section.jseditor.saveto',
|
|
80
106
|
label: '保存为'
|
|
107
|
+
})) : null, showClear ? /*#__PURE__*/React.createElement(Button, {
|
|
108
|
+
type: "danger",
|
|
109
|
+
onClick: handleClear
|
|
110
|
+
}, formatMessage({
|
|
111
|
+
id: 'app.base.operate.clear',
|
|
112
|
+
label: '清空'
|
|
81
113
|
})) : null, /*#__PURE__*/React.createElement(Button, {
|
|
82
114
|
type: "primary",
|
|
83
115
|
disabled: hasError,
|
|
@@ -129,9 +161,9 @@ var _JSEditor = function _JSEditor(_ref) {
|
|
|
129
161
|
onChange: run
|
|
130
162
|
}, defaultValue || defaultCode)), /*#__PURE__*/React.createElement(SplitPane.Pane, {
|
|
131
163
|
minSize: "400px"
|
|
132
|
-
}, /*#__PURE__*/React.createElement(RuntimeComp, {
|
|
164
|
+
}, /*#__PURE__*/React.createElement(PreviewWrapper, null, /*#__PURE__*/React.createElement(RuntimeComp, {
|
|
133
165
|
onErrorCatch: handleErrorCatch
|
|
134
|
-
}, code))) : /*#__PURE__*/React.createElement(JSEditor, {
|
|
166
|
+
}, code)))) : /*#__PURE__*/React.createElement(JSEditor, {
|
|
135
167
|
ref: editorRef,
|
|
136
168
|
onChange: run
|
|
137
169
|
}, defaultValue || defaultCode))));
|
|
@@ -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;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.lc-painter-history {
|
|
2
|
+
|
|
3
|
+
.historyToolbar {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: flex-end;
|
|
7
|
+
padding: 16px 8px 8px 8px;
|
|
8
|
+
margin-bottom: 8px;
|
|
9
|
+
position: sticky;
|
|
10
|
+
top: 0;
|
|
11
|
+
left: 0;
|
|
12
|
+
z-index: 10;
|
|
13
|
+
background-color: transparent;
|
|
14
|
+
backdrop-filter: blur(6px);
|
|
15
|
+
}
|
|
16
|
+
.timelineItem {
|
|
17
|
+
padding: 0 8px;
|
|
18
|
+
.timelineItemHeader {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
div {
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
}
|
|
25
|
+
.timelineItemActions {
|
|
26
|
+
display: none;
|
|
27
|
+
i {
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
&:hover {
|
|
33
|
+
.timelineItemHeader > .timelineItemActions {
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
.timelineItemUser {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
margin-top: 4px;
|
|
41
|
+
}
|
|
42
|
+
.timelineItemTime {
|
|
43
|
+
margin-top: 4px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
4
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
@@ -8,10 +9,10 @@ import { useMemoizedFn, useUpdateEffect, useCreation } from 'ahooks';
|
|
|
8
9
|
import { Modal, Button } from 'luck-design/antd';
|
|
9
10
|
import classNames from 'classnames';
|
|
10
11
|
import styled from 'styled-components';
|
|
11
|
-
import { isNil } from 'lodash';
|
|
12
|
+
import { isNil, isObject, isBoolean } from 'lodash';
|
|
12
13
|
import { LDActions } from "../../../../index";
|
|
13
14
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
14
|
-
import { omitBadProps } from "../../../engine/tools/helper";
|
|
15
|
+
import { omitBadProps, executeCode } from "../../../engine/tools/helper";
|
|
15
16
|
import defaultMeta from "../../../engine/meta/dialog.props.default.json";
|
|
16
17
|
import usePromiseState from "../../../engine/tools/usePromiseState";
|
|
17
18
|
import Wrapper from "../Wrapper";
|
|
@@ -40,6 +41,8 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
40
41
|
footer = _ref.footer,
|
|
41
42
|
btnGroup = _ref.btnGroup,
|
|
42
43
|
advance = _ref.advance,
|
|
44
|
+
size = _ref.size,
|
|
45
|
+
style = _ref.style,
|
|
43
46
|
$apiRef = _ref.$apiRef,
|
|
44
47
|
$designProps = _ref.$designProps;
|
|
45
48
|
var ctx = useContext();
|
|
@@ -69,6 +72,7 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
69
72
|
ctx.doAction(advance.events.onOpen);
|
|
70
73
|
} else {
|
|
71
74
|
ctx.doAction(advance.events.onClose);
|
|
75
|
+
setLoading(false);
|
|
72
76
|
}
|
|
73
77
|
}, [open]);
|
|
74
78
|
useUpdateEffect(function () {
|
|
@@ -93,7 +97,7 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
93
97
|
}, _callee, null, [[1,, 4, 7]]);
|
|
94
98
|
})));
|
|
95
99
|
var _footer = useCreation(function () {
|
|
96
|
-
if (!footer) return {
|
|
100
|
+
if (isBoolean(footer) && !footer || isObject(footer) && !footer.checked || isObject(footer) && footer.code && !executeCode(ctx, footer.code)) return {
|
|
97
101
|
footer: null
|
|
98
102
|
};
|
|
99
103
|
return {
|
|
@@ -114,7 +118,7 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
114
118
|
onClick: handleOk
|
|
115
119
|
}, okText))
|
|
116
120
|
};
|
|
117
|
-
}, [footer, btnGroup, loading, cancelText, okText]);
|
|
121
|
+
}, [footer, btnGroup, loading, cancelText, okText, open]);
|
|
118
122
|
var getTargetDom = useMemoizedFn(function () {
|
|
119
123
|
var _domRef$current;
|
|
120
124
|
return (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.closest('.ant-modal-content');
|
|
@@ -179,7 +183,10 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
179
183
|
onCancel: function onCancel() {
|
|
180
184
|
return setOpen(false);
|
|
181
185
|
},
|
|
182
|
-
destroyOnClose: destroyOnClose
|
|
186
|
+
destroyOnClose: destroyOnClose,
|
|
187
|
+
style: size === 'full' || height === '100vh' ? _objectSpread(_objectSpread({}, style), {}, {
|
|
188
|
+
top: '0px'
|
|
189
|
+
}) : style
|
|
183
190
|
}, $designProps), /*#__PURE__*/React.createElement("div", {
|
|
184
191
|
style: {
|
|
185
192
|
height: 0,
|
|
@@ -20,10 +20,16 @@
|
|
|
20
20
|
"type": "_I18nInput",
|
|
21
21
|
"default": "对话框"
|
|
22
22
|
},
|
|
23
|
+
{
|
|
24
|
+
"key": "size",
|
|
25
|
+
"name": "#展现尺寸",
|
|
26
|
+
"type": "_DialogSize",
|
|
27
|
+
"default": "custom"
|
|
28
|
+
},
|
|
23
29
|
{
|
|
24
30
|
"key": "width",
|
|
25
31
|
"name": "对话框宽度",
|
|
26
|
-
"type": "
|
|
32
|
+
"type": "_DialogWidthHeight",
|
|
27
33
|
"options": [
|
|
28
34
|
{
|
|
29
35
|
"label": "px",
|
|
@@ -42,12 +48,18 @@
|
|
|
42
48
|
"value": "auto"
|
|
43
49
|
}
|
|
44
50
|
],
|
|
51
|
+
"sizeOptions":{
|
|
52
|
+
"small": "540px",
|
|
53
|
+
"default": "700px",
|
|
54
|
+
"large": "1150px",
|
|
55
|
+
"full": "100vw"
|
|
56
|
+
},
|
|
45
57
|
"default": "700px"
|
|
46
58
|
},
|
|
47
59
|
{
|
|
48
60
|
"key": "height",
|
|
49
61
|
"name": "内容区高度",
|
|
50
|
-
"type": "
|
|
62
|
+
"type": "_DialogWidthHeight",
|
|
51
63
|
"options": [
|
|
52
64
|
{
|
|
53
65
|
"label": "px",
|
|
@@ -62,6 +74,12 @@
|
|
|
62
74
|
"value": "auto"
|
|
63
75
|
}
|
|
64
76
|
],
|
|
77
|
+
"sizeOptions":{
|
|
78
|
+
"small": "40vh",
|
|
79
|
+
"default": "60vh",
|
|
80
|
+
"large": "85vh",
|
|
81
|
+
"full": "100vh"
|
|
82
|
+
},
|
|
65
83
|
"default": "50vh"
|
|
66
84
|
},
|
|
67
85
|
{
|
|
@@ -140,8 +158,10 @@
|
|
|
140
158
|
"key": "footer",
|
|
141
159
|
"name": "显示footer",
|
|
142
160
|
"desc": "是否显示底部按钮区域",
|
|
143
|
-
"type": "
|
|
144
|
-
"default":
|
|
161
|
+
"type": "_ConditionCheck",
|
|
162
|
+
"default": {
|
|
163
|
+
"checked": true
|
|
164
|
+
}
|
|
145
165
|
},
|
|
146
166
|
{
|
|
147
167
|
"key": "okText",
|
|
@@ -9,12 +9,12 @@ import { useMemoizedFn, useUpdateEffect } from 'ahooks';
|
|
|
9
9
|
import { Drawer, Button } from 'luck-design/antd';
|
|
10
10
|
import classNames from 'classnames';
|
|
11
11
|
import styled from 'styled-components';
|
|
12
|
-
import { isNil } from 'lodash';
|
|
12
|
+
import { isNil, isObject, isBoolean } from 'lodash';
|
|
13
13
|
import Wrapper from "../Wrapper";
|
|
14
14
|
import { LDActions } from "../../../../index";
|
|
15
15
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
16
16
|
import usePromiseState from "../../../engine/tools/usePromiseState";
|
|
17
|
-
import { omitBadProps } from "../../../engine/tools/helper";
|
|
17
|
+
import { omitBadProps, executeCode } from "../../../engine/tools/helper";
|
|
18
18
|
import defaultMeta from "../../../engine/meta/drawer.props.default.json";
|
|
19
19
|
import styles from "./index.less";
|
|
20
20
|
var Footer = styled.div.withConfig({
|
|
@@ -171,7 +171,7 @@ var LCDrawer = function LCDrawer(_ref) {
|
|
|
171
171
|
visibility: 'hidden'
|
|
172
172
|
},
|
|
173
173
|
ref: domRef
|
|
174
|
-
}), children, footer ? /*#__PURE__*/React.createElement(Footer, {
|
|
174
|
+
}), children, isBoolean(footer) && footer || isObject(footer) && (footer.check || footer.code && executeCode(ctx, footer.code)) ? /*#__PURE__*/React.createElement(Footer, {
|
|
175
175
|
className: "ant-drawer-footer"
|
|
176
176
|
}, /*#__PURE__*/React.createElement(LDActions, _extends({}, btnGroup, {
|
|
177
177
|
doAction: function doAction(action) {
|