@luck-design-biz/luckda 0.0.24-2 → 0.0.25
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 +130 -0
- package/es/components/LDActions/index.less +48 -0
- package/es/components/LdFormList/index.js +1 -1
- package/es/components/LdGrid/index.js +9 -3
- package/es/components/LdTree/index.js +32 -5
- package/es/components/LdTree/index.less +6 -1
- package/es/index.js +1 -0
- package/es/locales/zh-CN.js +151 -0
- package/es/lowcode/constants/api-url.js +71 -12
- package/es/lowcode/constants/index.js +3 -1
- package/es/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/es/lowcode/engine/meta/box.props.default.json +1 -3
- package/es/lowcode/engine/meta/box.props.json +1 -3
- package/es/lowcode/engine/meta/button.props.default.json +1 -1
- package/es/lowcode/engine/meta/button.props.json +1 -1
- package/es/lowcode/engine/meta/cardlist.props.default.json +0 -1
- package/es/lowcode/engine/meta/cardlist.props.json +1 -2
- package/es/lowcode/engine/meta/dialog.props.default.json +0 -1
- package/es/lowcode/engine/meta/dialog.props.json +0 -1
- package/es/lowcode/engine/meta/drawer.props.default.json +0 -1
- package/es/lowcode/engine/meta/drawer.props.json +0 -1
- package/es/lowcode/engine/meta/form.props.default.json +0 -1
- package/es/lowcode/engine/meta/form.props.json +1 -2
- package/es/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/es/lowcode/engine/meta/iframe.props.json +1 -1
- package/es/lowcode/engine/meta/image.props.default.json +1 -1
- package/es/lowcode/engine/meta/image.props.json +1 -1
- package/es/lowcode/engine/meta/imex.props.default.json +1 -1
- package/es/lowcode/engine/meta/imex.props.json +1 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +132 -26
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/es/lowcode/engine/meta/jsx.props.json +1 -1
- 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/link.props.default.json +1 -1
- package/es/lowcode/engine/meta/link.props.json +1 -1
- package/es/lowcode/engine/meta/local/local.zh-cn.js +97 -0
- package/es/lowcode/engine/meta/section.props.default.json +1 -1
- package/es/lowcode/engine/meta/section.props.json +1 -1
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +1 -1
- package/es/lowcode/engine/meta/table.props.default.json +18 -2
- package/es/lowcode/engine/meta/table.props.json +207 -32
- package/es/lowcode/engine/meta/tabs.props.default.json +0 -1
- package/es/lowcode/engine/meta/tabs.props.json +0 -1
- package/es/lowcode/engine/meta/text.props.default.json +1 -1
- package/es/lowcode/engine/meta/text.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.default.json +9 -4
- package/es/lowcode/engine/meta/tree.props.json +101 -55
- package/es/lowcode/engine/provider/{ContextProvider.js → ContextProvider/index.js} +71 -41
- package/es/lowcode/engine/tools/helper.js +29 -1
- package/es/lowcode/engine/tools/usePromiseState.js +7 -6
- package/es/lowcode/painter/Panel.js +50 -133
- package/es/lowcode/painter/Ribbon.js +1 -1
- package/es/lowcode/painter/components/ActionBindModal.js +180 -0
- package/es/lowcode/painter/components/AdvancePanel.js +68 -0
- package/es/lowcode/painter/components/AttrsPanel.js +134 -0
- package/es/lowcode/painter/components/Collapse.js +12 -7
- package/es/lowcode/painter/components/FieldSelector.js +44 -0
- package/es/lowcode/painter/components/ListEditor.js +4 -2
- package/es/lowcode/painter/components/PopConfirm.js +10 -3
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +14 -2
- package/es/lowcode/painter/components/code-editor/JSEditor.js +25 -14
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +41 -0
- package/es/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/ActionEditor.js +10 -3
- package/es/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/index.js +36 -8
- package/es/lowcode/painter/panel-section/ImpExp.js +91 -0
- package/es/lowcode/painter/panel-section/JSEditor.js +48 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +1 -1
- package/es/lowcode/painter/panel-section/TableTopFilter.js +306 -0
- package/es/lowcode/painter/style/action-bind-modal.less +99 -0
- package/es/lowcode/painter/style/design.less +1 -1
- package/es/lowcode/painter/style/impexp.less +7 -0
- package/es/lowcode/painter/style/panel-attrs.less +43 -0
- package/es/lowcode/painter/style/panel.less +6 -37
- package/es/lowcode/painter/style/pop-confirm.less +9 -2
- package/es/lowcode/view/lc-components/Box/index.js +20 -4
- package/es/lowcode/view/lc-components/Box/index.less +0 -1
- package/es/lowcode/view/lc-components/Box/meta.json +1 -3
- package/es/lowcode/view/lc-components/Button/meta.json +1 -1
- package/es/lowcode/view/lc-components/CardList/meta.json +1 -2
- package/es/lowcode/view/lc-components/Dialog/meta.json +0 -1
- package/es/lowcode/view/lc-components/Drawer/index.js +16 -0
- package/es/lowcode/view/lc-components/Drawer/meta.json +0 -1
- package/es/lowcode/view/lc-components/Form/meta.json +1 -2
- package/es/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/es/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/es/lowcode/view/lc-components/Image/meta.json +1 -1
- package/es/lowcode/view/lc-components/JSX/meta.json +1 -1
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +6 -9
- package/es/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/es/lowcode/view/lc-components/Link/meta.json +1 -1
- package/es/lowcode/view/lc-components/Section/meta.json +1 -1
- package/es/lowcode/view/lc-components/Split/meta.json +1 -1
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +35 -2
- package/es/lowcode/view/lc-components/Table/components/TopFilter.js +96 -0
- package/es/lowcode/view/lc-components/Table/index.js +255 -35
- package/es/lowcode/view/lc-components/Table/meta.json +179 -32
- package/es/lowcode/view/lc-components/Tabs/meta.json +0 -1
- package/es/lowcode/view/lc-components/Text/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +48 -3
- package/es/lowcode/view/lc-components/Tree/index.js +77 -6
- package/es/lowcode/view/lc-components/Tree/index.less +2 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +97 -55
- package/es/lowcode/view/lc-components/Wrapper.js +2 -2
- package/lib/components/LDActions/index.js +138 -0
- package/lib/components/LDActions/index.less +48 -0
- package/lib/components/LdFormList/index.js +1 -1
- package/lib/components/LdGrid/index.js +8 -2
- package/lib/components/LdTree/index.js +31 -4
- package/lib/components/LdTree/index.less +6 -1
- package/lib/index.js +8 -0
- package/lib/locales/zh-CN.js +157 -0
- package/lib/lowcode/constants/api-url.js +71 -12
- package/lib/lowcode/constants/index.js +4 -2
- package/lib/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/lib/lowcode/engine/meta/box.props.default.json +1 -3
- package/lib/lowcode/engine/meta/box.props.json +1 -3
- package/lib/lowcode/engine/meta/button.props.default.json +1 -1
- package/lib/lowcode/engine/meta/button.props.json +1 -1
- package/lib/lowcode/engine/meta/cardlist.props.default.json +0 -1
- package/lib/lowcode/engine/meta/cardlist.props.json +1 -2
- package/lib/lowcode/engine/meta/dialog.props.default.json +0 -1
- package/lib/lowcode/engine/meta/dialog.props.json +0 -1
- package/lib/lowcode/engine/meta/drawer.props.default.json +0 -1
- package/lib/lowcode/engine/meta/drawer.props.json +0 -1
- package/lib/lowcode/engine/meta/form.props.default.json +0 -1
- package/lib/lowcode/engine/meta/form.props.json +1 -2
- package/lib/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/lib/lowcode/engine/meta/iframe.props.json +1 -1
- package/lib/lowcode/engine/meta/image.props.default.json +1 -1
- package/lib/lowcode/engine/meta/image.props.json +1 -1
- package/lib/lowcode/engine/meta/imex.props.default.json +1 -1
- package/lib/lowcode/engine/meta/imex.props.json +1 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +132 -26
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/lib/lowcode/engine/meta/jsx.props.json +1 -1
- 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/link.props.default.json +1 -1
- package/lib/lowcode/engine/meta/link.props.json +1 -1
- package/lib/lowcode/engine/meta/local/local.zh-cn.js +103 -0
- package/lib/lowcode/engine/meta/section.props.default.json +1 -1
- package/lib/lowcode/engine/meta/section.props.json +1 -1
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +1 -1
- package/lib/lowcode/engine/meta/table.props.default.json +18 -2
- package/lib/lowcode/engine/meta/table.props.json +207 -32
- package/lib/lowcode/engine/meta/tabs.props.default.json +0 -1
- package/lib/lowcode/engine/meta/tabs.props.json +0 -1
- package/lib/lowcode/engine/meta/text.props.default.json +1 -1
- package/lib/lowcode/engine/meta/text.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.default.json +9 -4
- package/lib/lowcode/engine/meta/tree.props.json +101 -55
- package/lib/lowcode/engine/provider/{ContextProvider.js → ContextProvider/index.js} +70 -40
- package/lib/lowcode/engine/tools/helper.js +31 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +6 -5
- package/lib/lowcode/painter/Panel.js +48 -131
- package/lib/lowcode/painter/Ribbon.js +1 -1
- package/lib/lowcode/painter/components/ActionBindModal.js +188 -0
- package/lib/lowcode/painter/components/AdvancePanel.js +76 -0
- package/lib/lowcode/painter/components/AttrsPanel.js +142 -0
- package/lib/lowcode/painter/components/Collapse.js +12 -7
- package/lib/lowcode/painter/components/FieldSelector.js +52 -0
- package/lib/lowcode/painter/components/ListEditor.js +4 -2
- package/lib/lowcode/painter/components/PopConfirm.js +10 -3
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +14 -2
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +25 -14
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +48 -0
- package/lib/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/ActionEditor.js +10 -3
- package/lib/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/index.js +35 -7
- package/lib/lowcode/painter/panel-section/ImpExp.js +98 -0
- package/lib/lowcode/painter/panel-section/JSEditor.js +56 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +1 -1
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +314 -0
- package/lib/lowcode/painter/style/action-bind-modal.less +99 -0
- package/lib/lowcode/painter/style/design.less +1 -1
- package/lib/lowcode/painter/style/impexp.less +7 -0
- package/lib/lowcode/painter/style/panel-attrs.less +43 -0
- package/lib/lowcode/painter/style/panel.less +6 -37
- package/lib/lowcode/painter/style/pop-confirm.less +9 -2
- package/lib/lowcode/view/lc-components/Box/index.js +17 -2
- package/lib/lowcode/view/lc-components/Box/index.less +0 -1
- package/lib/lowcode/view/lc-components/Box/meta.json +1 -3
- package/lib/lowcode/view/lc-components/Button/meta.json +1 -1
- package/lib/lowcode/view/lc-components/CardList/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Dialog/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Drawer/index.js +16 -0
- package/lib/lowcode/view/lc-components/Drawer/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Form/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/lib/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Image/meta.json +1 -1
- package/lib/lowcode/view/lc-components/JSX/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +6 -9
- package/lib/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Link/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Section/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Split/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +37 -3
- package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +104 -0
- package/lib/lowcode/view/lc-components/Table/index.js +255 -35
- package/lib/lowcode/view/lc-components/Table/meta.json +179 -32
- package/lib/lowcode/view/lc-components/Tabs/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Text/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +49 -3
- package/lib/lowcode/view/lc-components/Tree/index.js +77 -6
- package/lib/lowcode/view/lc-components/Tree/index.less +2 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +97 -55
- package/lib/lowcode/view/lc-components/Wrapper.js +2 -2
- package/package.json +10 -5
- package/es/lowcode/painter/panel-section/TableActions.js +0 -19
- package/lib/lowcode/painter/panel-section/TableActions.js +0 -26
|
@@ -4,13 +4,13 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
4
4
|
var _excluded = ["source"];
|
|
5
5
|
import React, { createContext, useContext, useRef, useEffect } from 'react';
|
|
6
6
|
import { history } from 'umi';
|
|
7
|
-
import { useRequest, useMemoizedFn } from 'ahooks';
|
|
8
|
-
import { useLDEventBus } from "
|
|
9
|
-
import usePromiseState from "
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import { fetchPageData } from "
|
|
7
|
+
import { useRequest, useMemoizedFn, useSetState } from 'ahooks';
|
|
8
|
+
import { useLDEventBus } from "../EventBusProvider";
|
|
9
|
+
import usePromiseState from "../../tools/usePromiseState";
|
|
10
|
+
import * as topics from "../../../constants/event-topics";
|
|
11
|
+
import { decompress } from "../../tools/dataProcess";
|
|
12
|
+
import { executeCode } from "../../tools/helper";
|
|
13
|
+
import { fetchPageData } from "../../../constants/api-url";
|
|
14
14
|
export var Context = /*#__PURE__*/createContext(null);
|
|
15
15
|
export var useLDContext = function useLDContext() {
|
|
16
16
|
return useContext(Context);
|
|
@@ -34,6 +34,14 @@ export default (function (_ref) {
|
|
|
34
34
|
*/
|
|
35
35
|
var _pageinfo = useRef(null);
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* 页面公共资源
|
|
39
|
+
*/
|
|
40
|
+
var _useSetState = useSetState(null),
|
|
41
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
42
|
+
pagePublicResource = _useSetState2[0],
|
|
43
|
+
_setPagePublicResource = _useSetState2[1];
|
|
44
|
+
|
|
37
45
|
/**
|
|
38
46
|
* 组件列表
|
|
39
47
|
*/
|
|
@@ -55,7 +63,7 @@ export default (function (_ref) {
|
|
|
55
63
|
* id:string 组件id
|
|
56
64
|
* component:ReactNode 组件
|
|
57
65
|
*/
|
|
58
|
-
var
|
|
66
|
+
var _register = useMemoizedFn(function (id, component) {
|
|
59
67
|
_componentList.current.push([id, component]);
|
|
60
68
|
});
|
|
61
69
|
|
|
@@ -63,7 +71,7 @@ export default (function (_ref) {
|
|
|
63
71
|
* 注销组件
|
|
64
72
|
* id:string 组件id
|
|
65
73
|
*/
|
|
66
|
-
var
|
|
74
|
+
var _unregister = useMemoizedFn(function (id) {
|
|
67
75
|
_componentList.current = _componentList.current.filter(function (_ref2) {
|
|
68
76
|
var _ref3 = _slicedToArray(_ref2, 1),
|
|
69
77
|
_id = _ref3[0];
|
|
@@ -110,6 +118,17 @@ export default (function (_ref) {
|
|
|
110
118
|
* return:object
|
|
111
119
|
*/
|
|
112
120
|
var getUrlParams = useMemoizedFn(function () {});
|
|
121
|
+
var doAction = useMemoizedFn(function (action) {
|
|
122
|
+
executeCode(ctx, action.actionCode);
|
|
123
|
+
Promise.all(action.actionPool.map(function (actionKey) {
|
|
124
|
+
return new Promise(function (resolve) {
|
|
125
|
+
setTimeout(function () {
|
|
126
|
+
console.log("doAction:".concat(actionKey));
|
|
127
|
+
resolve(actionKey);
|
|
128
|
+
}, 400);
|
|
129
|
+
});
|
|
130
|
+
})).then();
|
|
131
|
+
});
|
|
113
132
|
var _useRequest = useRequest(fetchPageData, {
|
|
114
133
|
manual: true
|
|
115
134
|
}),
|
|
@@ -132,38 +151,49 @@ export default (function (_ref) {
|
|
|
132
151
|
}
|
|
133
152
|
});
|
|
134
153
|
}, [code]);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
154
|
+
var ctx = new Proxy(_objectSpread({
|
|
155
|
+
_setPageData: _setPageData,
|
|
156
|
+
_register: _register,
|
|
157
|
+
_unregister: _unregister,
|
|
158
|
+
loading: loading,
|
|
159
|
+
pageData: pageData,
|
|
160
|
+
pagePublicResource: pagePublicResource,
|
|
161
|
+
history: history,
|
|
162
|
+
topics: topics,
|
|
163
|
+
getElementById: getElementById,
|
|
164
|
+
/**
|
|
165
|
+
* @method
|
|
166
|
+
* @param {string} id - 组件id
|
|
167
|
+
* @return {object}
|
|
168
|
+
*/
|
|
169
|
+
getParentElement: getParentElement,
|
|
170
|
+
getElementPathById: getElementPathById,
|
|
171
|
+
getModule: getModule,
|
|
172
|
+
getDataSetById: getDataSetById,
|
|
173
|
+
doAction: doAction,
|
|
174
|
+
/**
|
|
175
|
+
* @method
|
|
176
|
+
* @return {object}
|
|
177
|
+
*/
|
|
178
|
+
getUrlParams: getUrlParams
|
|
179
|
+
}, eventBus), {
|
|
180
|
+
get: function get(target, property, receiver) {
|
|
181
|
+
if (PRIVATE_KEYS.includes(property)) {
|
|
182
|
+
var _privateGetter$curren;
|
|
183
|
+
return (_privateGetter$curren = _privateGetter.current) === null || _privateGetter$curren === void 0 ? void 0 : _privateGetter$curren[property]();
|
|
166
184
|
}
|
|
167
|
-
|
|
185
|
+
return Reflect.get(target, property, receiver);
|
|
186
|
+
},
|
|
187
|
+
set: function set(target, property, receiver) {
|
|
188
|
+
console.log('set', target, property, receiver);
|
|
189
|
+
if (PRIVATE_KEYS.includes(property)) {
|
|
190
|
+
throw new Error("\u5C5E\u6027 \"".concat(property, "\" \u662F\u53EA\u8BFB\u7684"));
|
|
191
|
+
} else {
|
|
192
|
+
return Reflect.set(target, property, receiver);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
197
|
+
value: ctx
|
|
168
198
|
}, children);
|
|
169
199
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import _construct from "@babel/runtime/helpers/esm/construct";
|
|
1
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
4
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
4
|
-
import { omit } from 'lodash';
|
|
5
|
+
import { omit, omitBy, startsWith, isNil, isString, isArray } from 'lodash';
|
|
5
6
|
export function isPromise(value) {
|
|
6
7
|
return !!value && _typeof(value) === 'object' && typeof value.then === 'function';
|
|
7
8
|
}
|
|
@@ -69,4 +70,31 @@ export function listReducer(state, action) {
|
|
|
69
70
|
default:
|
|
70
71
|
throw new Error();
|
|
71
72
|
}
|
|
73
|
+
}
|
|
74
|
+
export function getCtx(context) {
|
|
75
|
+
return omitBy(context, function (_, key) {
|
|
76
|
+
return startsWith(key, '_');
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
export function getFuncBody(funcCode) {
|
|
80
|
+
var regex = /{([\s\S]*?)}(?![\s\S]*})/;
|
|
81
|
+
var matches = funcCode.match(regex);
|
|
82
|
+
if (matches) {
|
|
83
|
+
return matches[1].replace(/\s*\n\s*/g, ' ').trim();
|
|
84
|
+
}
|
|
85
|
+
return '';
|
|
86
|
+
}
|
|
87
|
+
export function executeCode(context, code, argsName) {
|
|
88
|
+
if (!isString(code)) {
|
|
89
|
+
throw new Error('executeCode编码参数无效');
|
|
90
|
+
}
|
|
91
|
+
for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
92
|
+
args[_key - 3] = arguments[_key];
|
|
93
|
+
}
|
|
94
|
+
if (isNil(argsName) && args.length > 0 || !isNil(argsName) && !isArray(argsName) || isArray(argsName) && argsName.length !== (args === null || args === void 0 ? void 0 : args.length)) {
|
|
95
|
+
throw new Error('executeCode参数不匹配');
|
|
96
|
+
}
|
|
97
|
+
var ctx = getCtx(context);
|
|
98
|
+
var func = _construct(Function, _toConsumableArray(argsName || []).concat(['ctx', getFuncBody(code)]));
|
|
99
|
+
return func.apply(void 0, args.concat([ctx]));
|
|
72
100
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import { useRef, useCallback } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { useResetState, useDeepCompareEffect } from 'ahooks';
|
|
4
4
|
var usePromiseState = function usePromiseState(initialState) {
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
state =
|
|
8
|
-
setState =
|
|
5
|
+
var _useResetState = useResetState(initialState),
|
|
6
|
+
_useResetState2 = _slicedToArray(_useResetState, 3),
|
|
7
|
+
state = _useResetState2[0],
|
|
8
|
+
setState = _useResetState2[1],
|
|
9
|
+
resetState = _useResetState2[2];
|
|
9
10
|
var promiseRef = useRef(null);
|
|
10
11
|
var setStatePromise = useCallback(function (_state) {
|
|
11
12
|
return new Promise(function (resolve) {
|
|
@@ -19,6 +20,6 @@ var usePromiseState = function usePromiseState(initialState) {
|
|
|
19
20
|
promiseRef.current = null;
|
|
20
21
|
}
|
|
21
22
|
}, [state]);
|
|
22
|
-
return [state, setStatePromise];
|
|
23
|
+
return [state, setStatePromise, resetState];
|
|
23
24
|
};
|
|
24
25
|
export default usePromiseState;
|
|
@@ -1,36 +1,41 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
-
var _excluded = ["type", "key", "name", "desc", "default", "props", "panelItem", "next", "repositioning"];
|
|
7
4
|
import React, { useRef, useState, useEffect, useLayoutEffect } from 'react';
|
|
8
|
-
import {
|
|
9
|
-
import { Breadcrumb
|
|
5
|
+
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
6
|
+
import { Breadcrumb } from 'luck-design/antd';
|
|
10
7
|
import classNames from 'classnames';
|
|
11
|
-
import {
|
|
8
|
+
import { takeRight, cloneDeep, isNil } from 'lodash';
|
|
9
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
12
10
|
import { useLDContext } from "../engine/provider/ContextProvider";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
11
|
+
import AttrsPanel from "./components/AttrsPanel";
|
|
12
|
+
import StylePanel from "./panel-section/StylePanel";
|
|
13
|
+
import AdvancePanel from "./components/AdvancePanel";
|
|
15
14
|
import { modifyById } from "../engine/tools/dataProcess";
|
|
16
15
|
import styles from "./style/panel.less";
|
|
17
|
-
|
|
16
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel';
|
|
18
17
|
var _TAB_LIST_ = [{
|
|
19
|
-
title:
|
|
18
|
+
title: formatMessage({
|
|
19
|
+
id: "".concat(_I18N_PREFIX_, ".attrs"),
|
|
20
|
+
label: '属性'
|
|
21
|
+
}),
|
|
20
22
|
key: 'attrs'
|
|
21
23
|
}, {
|
|
22
|
-
title:
|
|
24
|
+
title: formatMessage({
|
|
25
|
+
id: "".concat(_I18N_PREFIX_, ".styles"),
|
|
26
|
+
label: '样式'
|
|
27
|
+
}),
|
|
23
28
|
key: 'styles'
|
|
24
29
|
}, {
|
|
25
|
-
title:
|
|
30
|
+
title: formatMessage({
|
|
31
|
+
id: "".concat(_I18N_PREFIX_, ".advance"),
|
|
32
|
+
label: '高级'
|
|
33
|
+
}),
|
|
26
34
|
key: 'advance'
|
|
27
35
|
}];
|
|
28
36
|
var Panel = function Panel() {
|
|
29
|
-
var _nextRef$current, _nextRef$current2;
|
|
30
37
|
var activeTabRef = useRef(null);
|
|
31
38
|
var underLineRef = useRef(null);
|
|
32
|
-
var nextRef = useRef(null);
|
|
33
|
-
var factory = useRef(new PanelItemFactory());
|
|
34
39
|
var _useState = useState(null),
|
|
35
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
41
|
activeNode = _useState2[0],
|
|
@@ -39,13 +44,10 @@ var Panel = function Panel() {
|
|
|
39
44
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
40
45
|
activeTabKey = _useState4[0],
|
|
41
46
|
setActiveTabKey = _useState4[1];
|
|
42
|
-
var _useBoolean = useBoolean(false),
|
|
43
|
-
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
44
|
-
open = _useBoolean2[0],
|
|
45
|
-
_useBoolean2$ = _useBoolean2[1],
|
|
46
|
-
setTrue = _useBoolean2$.setTrue,
|
|
47
|
-
setFalse = _useBoolean2$.setFalse;
|
|
48
47
|
var context = useLDContext();
|
|
48
|
+
var meta = useCreation(function () {
|
|
49
|
+
return isNil(activeNode) ? null : require("../engine/meta/".concat(activeNode.node.component.toLowerCase(), ".props.json"));
|
|
50
|
+
}, [activeNode]);
|
|
49
51
|
var handleChange = useMemoizedFn(function (field, value, repositioning) {
|
|
50
52
|
var component = context.componentMap.get(activeNode.node.id);
|
|
51
53
|
var _component$api$getSel = component.api.getSelfAndParentLCData(),
|
|
@@ -61,85 +63,10 @@ var Panel = function Panel() {
|
|
|
61
63
|
id: activeNode.node.id
|
|
62
64
|
});
|
|
63
65
|
});
|
|
64
|
-
if (nextRef.current.autoClose) {
|
|
65
|
-
setFalse();
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
var handleStyleChange = useMemoizedFn(function (newStyle, newCss) {
|
|
69
|
-
console.log('style', newStyle, newCss);
|
|
70
|
-
// setCss(newCss);
|
|
71
|
-
});
|
|
72
|
-
var goNext = useMemoizedFn(function (_next) {
|
|
73
|
-
if (!_next) return;
|
|
74
|
-
nextRef.current = {
|
|
75
|
-
name: _next.name,
|
|
76
|
-
autoClose: _next.autoClose,
|
|
77
|
-
NextComp: renderPanelItems(_next.props)
|
|
78
|
-
};
|
|
79
|
-
setTrue();
|
|
80
|
-
});
|
|
81
|
-
var renderPanelItems = useMemoizedFn(function (items) {
|
|
82
|
-
return items.map(function (_ref) {
|
|
83
|
-
var type = _ref.type,
|
|
84
|
-
key = _ref.key,
|
|
85
|
-
name = _ref.name,
|
|
86
|
-
desc = _ref.desc,
|
|
87
|
-
defaultValue = _ref.default,
|
|
88
|
-
props = _ref.props,
|
|
89
|
-
panelItem = _ref.panelItem,
|
|
90
|
-
_next2 = _ref.next,
|
|
91
|
-
repositioning = _ref.repositioning,
|
|
92
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
93
|
-
var Comp = factory.current.getPanelItemFor(startsWith(type, '_') ? 'dynamic' : type, type);
|
|
94
|
-
if (type === 'group') {
|
|
95
|
-
return /*#__PURE__*/React.createElement(Comp, {
|
|
96
|
-
key: key,
|
|
97
|
-
field: key,
|
|
98
|
-
label: name,
|
|
99
|
-
next: _next2 ? function () {
|
|
100
|
-
return goNext(_next2);
|
|
101
|
-
} : null,
|
|
102
|
-
defaultCollapsed: defaultValue,
|
|
103
|
-
desc: desc
|
|
104
|
-
}, renderPanelItems(props || []));
|
|
105
|
-
}
|
|
106
|
-
var _context$componentMap = context.componentMap.get(activeNode.node.id).api.getSelfAndParentLCData(),
|
|
107
|
-
node = _context$componentMap.node;
|
|
108
|
-
return /*#__PURE__*/React.createElement(PanelItem, _extends({
|
|
109
|
-
key: key,
|
|
110
|
-
field: key,
|
|
111
|
-
label: name,
|
|
112
|
-
desc: desc
|
|
113
|
-
}, panelItem), Comp && /*#__PURE__*/React.createElement(Comp, _extends({
|
|
114
|
-
defaultValue: isNil(node.props[key]) ? defaultValue : node.props[key],
|
|
115
|
-
next: function next() {
|
|
116
|
-
return goNext(_next2);
|
|
117
|
-
},
|
|
118
|
-
onChange: function onChange(value) {
|
|
119
|
-
return handleChange(key, value, repositioning);
|
|
120
|
-
},
|
|
121
|
-
size: "small"
|
|
122
|
-
}, rest)));
|
|
123
|
-
});
|
|
124
66
|
});
|
|
125
|
-
var PropsComps = useCreation(function () {
|
|
126
|
-
setActiveTabKey('attrs');
|
|
127
|
-
var _meta;
|
|
128
|
-
try {
|
|
129
|
-
_meta = require("../engine/meta/".concat(activeNode.node.component.toLowerCase(), ".props.json"));
|
|
130
|
-
} catch (e) {
|
|
131
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
132
|
-
}
|
|
133
|
-
return renderPanelItems(_meta.props);
|
|
134
|
-
}, [activeNode]);
|
|
135
|
-
useEffect(function () {
|
|
136
|
-
if (!open) {
|
|
137
|
-
nextRef.current = null;
|
|
138
|
-
}
|
|
139
|
-
}, [open]);
|
|
140
67
|
useEffect(function () {
|
|
141
68
|
var _id = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
142
|
-
|
|
69
|
+
setActiveTabKey('attrs');
|
|
143
70
|
if (!payload.id) {
|
|
144
71
|
setActiveNode(null);
|
|
145
72
|
return;
|
|
@@ -154,7 +81,7 @@ var Panel = function Panel() {
|
|
|
154
81
|
});
|
|
155
82
|
}).watch();
|
|
156
83
|
return function () {
|
|
157
|
-
context.$unsubscriber(context.topics.COMPONENT_ACTIVE, _id);
|
|
84
|
+
return context.$unsubscriber(context.topics.COMPONENT_ACTIVE, _id);
|
|
158
85
|
};
|
|
159
86
|
}, []);
|
|
160
87
|
useLayoutEffect(function () {
|
|
@@ -169,9 +96,9 @@ var Panel = function Panel() {
|
|
|
169
96
|
style: {
|
|
170
97
|
fontSize: 12
|
|
171
98
|
}
|
|
172
|
-
}, activeNode === null || activeNode === void 0 ? void 0 : activeNode.level.map(function (
|
|
173
|
-
var id =
|
|
174
|
-
name =
|
|
99
|
+
}, activeNode === null || activeNode === void 0 ? void 0 : activeNode.level.map(function (_ref) {
|
|
100
|
+
var id = _ref.id,
|
|
101
|
+
name = _ref.name;
|
|
175
102
|
return /*#__PURE__*/React.createElement(Breadcrumb.Item, {
|
|
176
103
|
key: id,
|
|
177
104
|
className: classNames(_defineProperty({}, styles['active-node-level'], id !== activeNode.node.id)),
|
|
@@ -196,7 +123,7 @@ var Panel = function Panel() {
|
|
|
196
123
|
className: classNames(styles['lc-painter-panel-tabbar'], _defineProperty({}, styles.hidden, !activeNode))
|
|
197
124
|
}, /*#__PURE__*/React.createElement("ul", {
|
|
198
125
|
className: styles.headerList
|
|
199
|
-
}, (activeNode !== null && activeNode !== void 0 && activeNode.node.
|
|
126
|
+
}, (activeNode !== null && activeNode !== void 0 && activeNode.node.css ? _TAB_LIST_ : [_TAB_LIST_[0], _TAB_LIST_[2]]).map(function (_item) {
|
|
200
127
|
return /*#__PURE__*/React.createElement("li", {
|
|
201
128
|
key: _item.key,
|
|
202
129
|
ref: activeTabKey === _item.key ? activeTabRef : null,
|
|
@@ -208,38 +135,28 @@ var Panel = function Panel() {
|
|
|
208
135
|
})), /*#__PURE__*/React.createElement("div", {
|
|
209
136
|
ref: underLineRef,
|
|
210
137
|
className: styles.underline
|
|
211
|
-
})), activeTabKey === _TAB_LIST_[0].key && /*#__PURE__*/React.createElement(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
mask: false,
|
|
217
|
-
closable: false,
|
|
218
|
-
getContainer: false,
|
|
219
|
-
destroyOnClose: true,
|
|
220
|
-
style: {
|
|
221
|
-
position: 'absolute'
|
|
222
|
-
},
|
|
223
|
-
bodyStyle: {
|
|
224
|
-
padding: 0,
|
|
225
|
-
height: '100%'
|
|
138
|
+
})), activeTabKey === _TAB_LIST_[0].key && /*#__PURE__*/React.createElement(AttrsPanel, {
|
|
139
|
+
meta: meta,
|
|
140
|
+
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node,
|
|
141
|
+
onChange: function onChange(field, value, repositioning) {
|
|
142
|
+
return handleChange(field, value, repositioning);
|
|
226
143
|
}
|
|
227
|
-
}, /*#__PURE__*/React.createElement(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}, /*#__PURE__*/React.createElement(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
onChange: handleStyleChange,
|
|
240
|
-
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.style
|
|
241
|
-
}), activeTabKey === _TAB_LIST_[2].key && /*#__PURE__*/React.createElement("div", null, "\u9AD8\u7EA7\u9762\u677F"), /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
}), activeTabKey === _TAB_LIST_[1].key && /*#__PURE__*/React.createElement(StylePanel, {
|
|
145
|
+
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.css,
|
|
146
|
+
onChange: function onChange(_, newCss) {
|
|
147
|
+
return handleChange('css', newCss);
|
|
148
|
+
}
|
|
149
|
+
}), activeTabKey === _TAB_LIST_[2].key && /*#__PURE__*/React.createElement(AdvancePanel, {
|
|
150
|
+
meta: meta,
|
|
151
|
+
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node,
|
|
152
|
+
onChange: function onChange(val) {
|
|
153
|
+
return handleChange('advance', val);
|
|
154
|
+
}
|
|
155
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
242
156
|
className: classNames(styles['lc-painter-panel-empty'], _defineProperty({}, styles.hidden, !!activeNode))
|
|
243
|
-
},
|
|
157
|
+
}, formatMessage({
|
|
158
|
+
id: "".concat(_I18N_PREFIX_, ".empty"),
|
|
159
|
+
label: '请在左侧画布选中节点'
|
|
160
|
+
})));
|
|
244
161
|
};
|
|
245
162
|
export default Panel;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React, { useState, forwardRef, useImperativeHandle } from 'react';
|
|
4
|
+
import { useMemoizedFn, useCreation, useMap } from 'ahooks';
|
|
5
|
+
import { Modal, Icon, Input, Checkbox } from 'luck-design/antd';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import { reduce } from 'lodash';
|
|
8
|
+
import { useLDContext } from "../../engine/provider/ContextProvider";
|
|
9
|
+
import JSEditor from "./code-editor/JSEditor";
|
|
10
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
11
|
+
import styles from "../style/action-bind-modal.less";
|
|
12
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.actionBindModal';
|
|
13
|
+
var _ACTION_CATEGORY_ = [{
|
|
14
|
+
key: 'actions',
|
|
15
|
+
label: formatMessage({
|
|
16
|
+
id: "".concat(_I18N_PREFIX_, ".actions"),
|
|
17
|
+
label: '页面行为'
|
|
18
|
+
})
|
|
19
|
+
}, {
|
|
20
|
+
key: 'trigger',
|
|
21
|
+
label: formatMessage({
|
|
22
|
+
id: "".concat(_I18N_PREFIX_, ".trigger"),
|
|
23
|
+
label: '触发器'
|
|
24
|
+
})
|
|
25
|
+
}, {
|
|
26
|
+
key: 'code',
|
|
27
|
+
label: formatMessage({
|
|
28
|
+
id: "".concat(_I18N_PREFIX_, ".code"),
|
|
29
|
+
label: '自定义动作'
|
|
30
|
+
})
|
|
31
|
+
}];
|
|
32
|
+
var _CATEGORY_CODE_ITEMS = [{
|
|
33
|
+
key: 'coding',
|
|
34
|
+
label: formatMessage({
|
|
35
|
+
id: "".concat(_I18N_PREFIX_, ".coding"),
|
|
36
|
+
label: '动作编写'
|
|
37
|
+
})
|
|
38
|
+
}];
|
|
39
|
+
var ActionBindModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
40
|
+
var activeNode = _ref.activeNode,
|
|
41
|
+
onComfirm = _ref.onComfirm;
|
|
42
|
+
var context = useLDContext();
|
|
43
|
+
var _useState = useState(void 0),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
title = _useState2[0],
|
|
46
|
+
setTitle = _useState2[1];
|
|
47
|
+
var _useState3 = useState('actions'),
|
|
48
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
+
category = _useState4[0],
|
|
50
|
+
setCategory = _useState4[1];
|
|
51
|
+
var _useMap = useMap([]),
|
|
52
|
+
_useMap2 = _slicedToArray(_useMap, 2),
|
|
53
|
+
actionPool = _useMap2[0],
|
|
54
|
+
_useMap2$ = _useMap2[1],
|
|
55
|
+
set = _useMap2$.set,
|
|
56
|
+
remove = _useMap2$.remove,
|
|
57
|
+
reset = _useMap2$.reset,
|
|
58
|
+
get = _useMap2$.get;
|
|
59
|
+
var selectItems = useCreation(function () {
|
|
60
|
+
if (category === 'actions') {
|
|
61
|
+
return [];
|
|
62
|
+
} else if (category === 'trigger') {
|
|
63
|
+
return reduce(context.componentList, function (ret, _ref2) {
|
|
64
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
65
|
+
key = _ref3[0],
|
|
66
|
+
target = _ref3[1];
|
|
67
|
+
if (key !== activeNode.id) {
|
|
68
|
+
ret.push({
|
|
69
|
+
key: key,
|
|
70
|
+
label: "".concat(target.api.getSelfAndParentLCData().node.props.name, "(").concat(key, ")")
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return ret;
|
|
74
|
+
}, []);
|
|
75
|
+
} else if (category === 'code') {
|
|
76
|
+
return _CATEGORY_CODE_ITEMS;
|
|
77
|
+
}
|
|
78
|
+
return [];
|
|
79
|
+
}, [category]);
|
|
80
|
+
var handleClose = useMemoizedFn(function () {
|
|
81
|
+
setTitle(void 0);
|
|
82
|
+
});
|
|
83
|
+
var handleComfirm = useMemoizedFn(function () {
|
|
84
|
+
handleClose();
|
|
85
|
+
});
|
|
86
|
+
var handleSearch = useMemoizedFn(function (val) {});
|
|
87
|
+
useImperativeHandle(ref, function () {
|
|
88
|
+
return {
|
|
89
|
+
doOpen: function doOpen(title) {
|
|
90
|
+
setTitle(title);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}, []);
|
|
94
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
95
|
+
className: styles['lc-painter-panel-action-bind-modal'],
|
|
96
|
+
bodyStyle: {
|
|
97
|
+
marginTop: 0,
|
|
98
|
+
padding: '4px 24px'
|
|
99
|
+
},
|
|
100
|
+
title: title,
|
|
101
|
+
visible: !!title,
|
|
102
|
+
width: 960,
|
|
103
|
+
closable: false,
|
|
104
|
+
maskClosable: false,
|
|
105
|
+
getContainer: function getContainer() {
|
|
106
|
+
return document.getElementById('lc-design-workspace');
|
|
107
|
+
},
|
|
108
|
+
zIndex: 3000,
|
|
109
|
+
onCancel: handleClose,
|
|
110
|
+
onOk: handleComfirm
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: styles['lc-painter-panel-action-bind-modal-body']
|
|
113
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
className: styles['lc-painter-panel-action-bind-modal-body-left']
|
|
115
|
+
}, /*#__PURE__*/React.createElement("p", null, formatMessage({
|
|
116
|
+
id: "".concat(_I18N_PREFIX_, ".bind"),
|
|
117
|
+
label: '绑定动作'
|
|
118
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
className: styles['selector-box']
|
|
120
|
+
}, /*#__PURE__*/React.createElement("ul", {
|
|
121
|
+
className: classNames(styles['selector-box-ul'], styles['action-category'])
|
|
122
|
+
}, _ACTION_CATEGORY_.map(function (_ref4) {
|
|
123
|
+
var key = _ref4.key,
|
|
124
|
+
label = _ref4.label;
|
|
125
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
126
|
+
key: key,
|
|
127
|
+
className: classNames(_defineProperty({}, styles.active, key === category)),
|
|
128
|
+
onClick: function onClick() {
|
|
129
|
+
return setCategory(key);
|
|
130
|
+
}
|
|
131
|
+
}, label, key === category && /*#__PURE__*/React.createElement(Icon, {
|
|
132
|
+
type: "check",
|
|
133
|
+
className: styles['check-icon']
|
|
134
|
+
}));
|
|
135
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
className: styles['selecter-items-box']
|
|
137
|
+
}, category !== 'code' && /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
style: {
|
|
139
|
+
height: 42,
|
|
140
|
+
display: 'flex',
|
|
141
|
+
justifyContent: 'center'
|
|
142
|
+
}
|
|
143
|
+
}, /*#__PURE__*/React.createElement(Input.Search, {
|
|
144
|
+
placeholder: formatMessage({
|
|
145
|
+
id: "".concat(_I18N_PREFIX_, ".search"),
|
|
146
|
+
label: '搜索'
|
|
147
|
+
}),
|
|
148
|
+
size: "small",
|
|
149
|
+
onSearch: handleSearch,
|
|
150
|
+
style: {
|
|
151
|
+
width: 170,
|
|
152
|
+
alignSelf: 'center'
|
|
153
|
+
}
|
|
154
|
+
})), /*#__PURE__*/React.createElement("ul", {
|
|
155
|
+
className: classNames(styles['selector-box-ul'], styles['selecter-items'])
|
|
156
|
+
}, selectItems.map(function (_ref5) {
|
|
157
|
+
var key = _ref5.key,
|
|
158
|
+
label = _ref5.label;
|
|
159
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
160
|
+
key: key,
|
|
161
|
+
className: classNames(_defineProperty({}, styles.active, actionPool.has(key))),
|
|
162
|
+
onClick: function onClick() {
|
|
163
|
+
return set(key, label);
|
|
164
|
+
}
|
|
165
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
166
|
+
checked: actionPool.has(key),
|
|
167
|
+
style: {
|
|
168
|
+
marginRight: 4
|
|
169
|
+
}
|
|
170
|
+
}), label);
|
|
171
|
+
}))))), /*#__PURE__*/React.createElement("div", {
|
|
172
|
+
className: styles['lc-painter-panel-action-bind-modal-body-right']
|
|
173
|
+
}, category === 'code' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, formatMessage({
|
|
174
|
+
id: "".concat(_I18N_PREFIX_, ".coding"),
|
|
175
|
+
label: '动作编写'
|
|
176
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
177
|
+
className: styles['code-box']
|
|
178
|
+
}, /*#__PURE__*/React.createElement(JSEditor, null))))));
|
|
179
|
+
});
|
|
180
|
+
export default ActionBindModal;
|