@luck-design-biz/luckda 1.0.1 → 1.0.2
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.less +3 -1
- package/es/components/LdAutoForm/index.js +2 -1
- package/es/components/LdCard/index.js +154 -67
- package/es/components/LdFormList/index.js +20 -6
- package/es/components/LdGridForm/index.js +40 -24
- package/es/components/LdTree/index.js +14 -8
- package/es/components/LdTree/index.less +4 -2
- package/es/helper/ldBuilder.js +1 -1
- package/es/locales/zh-CN.js +13 -4
- package/es/lowcode/constants/index.js +1 -1
- package/es/lowcode/engine/meta/cardlist.props.default.json +27 -6
- package/es/lowcode/engine/meta/cardlist.props.json +254 -72
- package/es/lowcode/engine/meta/components-list.json +6 -102
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/es/lowcode/engine/meta/dialog.props.json +74 -18
- package/es/lowcode/engine/meta/drawer.props.default.json +15 -4
- package/es/lowcode/engine/meta/drawer.props.json +144 -24
- package/es/lowcode/engine/meta/form.props.default.json +14 -3
- package/es/lowcode/engine/meta/form.props.json +49 -9
- package/es/lowcode/engine/meta/grouptree.props.default.json +16 -0
- package/es/lowcode/engine/meta/grouptree.props.json +83 -0
- package/es/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/es/lowcode/engine/meta/iframe.props.json +3 -4
- package/es/lowcode/engine/meta/image.props.default.json +3 -2
- package/es/lowcode/engine/meta/image.props.json +51 -16
- package/es/lowcode/engine/meta/imex.props.json +1 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +23 -5
- package/es/lowcode/engine/meta/link.props.default.json +1 -1
- package/es/lowcode/engine/meta/link.props.json +9 -9
- package/es/lowcode/engine/meta/table.props.json +1 -1
- package/es/lowcode/engine/meta/tabs.props.default.json +1 -1
- package/es/lowcode/engine/meta/tabs.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.json +2 -2
- package/es/lowcode/engine/provider/ContextProvider/index.js +6 -2
- package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +82 -2
- package/es/lowcode/engine/tools/helper.js +21 -0
- package/es/lowcode/engine/tools/useCanvasRender.js +13 -1
- package/es/lowcode/painter/Components.js +6 -1
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +25 -15
- package/es/lowcode/painter/DesignToolbar.js +78 -47
- package/es/lowcode/painter/Ribbon.js +14 -1
- package/es/lowcode/painter/components/ActionBindModal.js +3 -7
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +144 -37
- package/es/lowcode/painter/components/DragDrop/DragDropWrapper.js +29 -6
- package/es/lowcode/painter/components/DragDrop/Overlay.js +5 -2
- package/es/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +7 -4
- package/es/lowcode/painter/components/NumberInput.js +1 -1
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
- package/es/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/es/lowcode/painter/components/field-setting/SettingUI.js +30 -2
- package/es/lowcode/painter/components/field-setting/index.js +26 -12
- package/es/lowcode/painter/expect.js +27 -0
- package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +20 -2
- package/es/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
- package/es/lowcode/painter/panel-section/ComplexPop.js +1 -1
- package/es/lowcode/painter/panel-section/DataSetSelector.js +14 -3
- package/es/lowcode/painter/panel-section/FieldsSetting.js +2 -2
- package/es/lowcode/painter/panel-section/GroupClassSelector.js +55 -0
- package/es/lowcode/painter/panel-section/PageVars.js +1 -1
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
- package/es/lowcode/painter/panel-section/TabItems.js +1 -1
- package/es/lowcode/painter/panel-section/TableTopFilter.js +3 -3
- package/es/lowcode/painter/style/action-bind-modal.less +5 -3
- package/es/lowcode/painter/style/design.less +26 -7
- package/es/lowcode/painter/style/dragdrop.less +46 -0
- package/es/lowcode/painter/style/list-editor.less +5 -3
- package/es/lowcode/painter/style/number-input.less +3 -1
- package/es/lowcode/painter/style/outline.less +3 -1
- package/es/lowcode/painter/style/panel-attrs.less +7 -3
- package/es/lowcode/painter/style/panel.less +9 -7
- package/es/lowcode/painter/style/radio.less +1 -1
- package/es/lowcode/painter/style/ribbon.less +4 -2
- package/es/lowcode/painter/svg/code.svg +3 -0
- package/es/lowcode/painter/svg/expect.svg +9 -0
- package/es/lowcode/view/lc-components/CardList/index.js +481 -12
- package/es/lowcode/view/lc-components/CardList/meta.json +255 -73
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +14 -6
- package/es/lowcode/view/lc-components/Dialog/index.js +15 -5
- package/es/lowcode/view/lc-components/Dialog/index.less +4 -0
- package/es/lowcode/view/lc-components/Dialog/meta.json +72 -18
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +51 -8
- package/es/lowcode/view/lc-components/Drawer/index.js +139 -24
- package/es/lowcode/view/lc-components/Drawer/index.less +11 -8
- package/es/lowcode/view/lc-components/Drawer/meta.json +136 -25
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
- package/es/lowcode/view/lc-components/Form/index.js +45 -28
- package/es/lowcode/view/lc-components/Form/meta.json +44 -8
- package/es/lowcode/view/lc-components/GroupTree/FunctionDesign.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/index.js +212 -0
- package/es/lowcode/view/lc-components/GroupTree/index.less +12 -0
- package/es/lowcode/view/lc-components/GroupTree/meta.json +83 -0
- package/es/lowcode/view/lc-components/Iframe/index.js +57 -7
- package/es/lowcode/view/lc-components/Iframe/meta.json +3 -4
- package/es/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/es/lowcode/view/lc-components/Image/index.js +82 -6
- package/es/lowcode/view/lc-components/Image/index.less +27 -0
- package/es/lowcode/view/lc-components/Image/meta.json +51 -16
- package/es/lowcode/view/lc-components/Link/index.js +53 -5
- package/es/lowcode/view/lc-components/Link/index.less +15 -0
- package/es/lowcode/view/lc-components/Link/meta.json +9 -9
- package/es/lowcode/view/lc-components/Table/index.js +5 -6
- package/es/lowcode/view/lc-components/Table/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +40 -4
- package/es/lowcode/view/lc-components/Tabs/index.js +1 -1
- package/es/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/index.js +21 -19
- package/es/lowcode/view/lc-components/Tree/meta.json +2 -2
- package/es/utils/grid.js +3 -3
- package/lib/components/LDActions/index.less +3 -1
- package/lib/components/LdAutoForm/index.js +2 -1
- package/lib/components/LdCard/index.js +153 -66
- package/lib/components/LdFormList/index.js +19 -5
- package/lib/components/LdGridForm/index.js +40 -24
- package/lib/components/LdTree/index.js +14 -8
- package/lib/components/LdTree/index.less +4 -2
- package/lib/helper/ldBuilder.js +2 -2
- package/lib/locales/zh-CN.js +13 -4
- package/lib/lowcode/constants/index.js +1 -1
- package/lib/lowcode/engine/meta/cardlist.props.default.json +27 -6
- package/lib/lowcode/engine/meta/cardlist.props.json +254 -72
- package/lib/lowcode/engine/meta/components-list.json +6 -102
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/lib/lowcode/engine/meta/dialog.props.json +74 -18
- package/lib/lowcode/engine/meta/drawer.props.default.json +15 -4
- package/lib/lowcode/engine/meta/drawer.props.json +144 -24
- package/lib/lowcode/engine/meta/form.props.default.json +14 -3
- package/lib/lowcode/engine/meta/form.props.json +49 -9
- package/lib/lowcode/engine/meta/grouptree.props.default.json +16 -0
- package/lib/lowcode/engine/meta/grouptree.props.json +83 -0
- package/lib/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/lib/lowcode/engine/meta/iframe.props.json +3 -4
- package/lib/lowcode/engine/meta/image.props.default.json +3 -2
- package/lib/lowcode/engine/meta/image.props.json +51 -16
- package/lib/lowcode/engine/meta/imex.props.json +1 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +23 -5
- package/lib/lowcode/engine/meta/link.props.default.json +1 -1
- package/lib/lowcode/engine/meta/link.props.json +9 -9
- package/lib/lowcode/engine/meta/table.props.json +1 -1
- package/lib/lowcode/engine/meta/tabs.props.default.json +1 -1
- package/lib/lowcode/engine/meta/tabs.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.json +2 -2
- package/lib/lowcode/engine/provider/ContextProvider/index.js +6 -2
- package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +83 -3
- package/lib/lowcode/engine/tools/helper.js +22 -0
- package/lib/lowcode/engine/tools/useCanvasRender.js +13 -1
- package/lib/lowcode/painter/Components.js +6 -1
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +25 -15
- package/lib/lowcode/painter/DesignToolbar.js +78 -47
- package/lib/lowcode/painter/Ribbon.js +14 -1
- package/lib/lowcode/painter/components/ActionBindModal.js +3 -7
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +142 -35
- package/lib/lowcode/painter/components/DragDrop/DragDropWrapper.js +27 -4
- package/lib/lowcode/painter/components/DragDrop/Overlay.js +5 -2
- package/lib/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +7 -4
- package/lib/lowcode/painter/components/NumberInput.js +1 -1
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
- package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +29 -1
- package/lib/lowcode/painter/components/field-setting/index.js +26 -12
- package/lib/lowcode/painter/expect.js +34 -0
- package/lib/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +19 -1
- package/lib/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
- package/lib/lowcode/painter/panel-section/ComplexPop.js +1 -1
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +14 -3
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +2 -2
- package/lib/lowcode/painter/panel-section/GroupClassSelector.js +63 -0
- package/lib/lowcode/painter/panel-section/PageVars.js +1 -1
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
- package/lib/lowcode/painter/panel-section/TabItems.js +1 -1
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +3 -3
- package/lib/lowcode/painter/style/action-bind-modal.less +5 -3
- package/lib/lowcode/painter/style/design.less +26 -7
- package/lib/lowcode/painter/style/dragdrop.less +46 -0
- package/lib/lowcode/painter/style/list-editor.less +5 -3
- package/lib/lowcode/painter/style/number-input.less +3 -1
- package/lib/lowcode/painter/style/outline.less +3 -1
- package/lib/lowcode/painter/style/panel-attrs.less +7 -3
- package/lib/lowcode/painter/style/panel.less +9 -7
- package/lib/lowcode/painter/style/radio.less +1 -1
- package/lib/lowcode/painter/style/ribbon.less +4 -2
- package/lib/lowcode/painter/svg/code.svg +3 -0
- package/lib/lowcode/painter/svg/expect.svg +9 -0
- package/lib/lowcode/view/lc-components/CardList/index.js +480 -11
- package/lib/lowcode/view/lc-components/CardList/meta.json +255 -73
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +13 -5
- package/lib/lowcode/view/lc-components/Dialog/index.js +15 -5
- package/lib/lowcode/view/lc-components/Dialog/index.less +4 -0
- package/lib/lowcode/view/lc-components/Dialog/meta.json +72 -18
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +52 -8
- package/lib/lowcode/view/lc-components/Drawer/index.js +138 -23
- package/lib/lowcode/view/lc-components/Drawer/index.less +11 -8
- package/lib/lowcode/view/lc-components/Drawer/meta.json +136 -25
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Form/index.js +44 -27
- package/lib/lowcode/view/lc-components/Form/meta.json +44 -8
- package/lib/lowcode/view/lc-components/GroupTree/FunctionDesign.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/index.js +220 -0
- package/lib/lowcode/view/lc-components/GroupTree/index.less +12 -0
- package/lib/lowcode/view/lc-components/GroupTree/meta.json +83 -0
- package/lib/lowcode/view/lc-components/Iframe/index.js +55 -5
- package/lib/lowcode/view/lc-components/Iframe/meta.json +3 -4
- package/lib/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Image/index.js +80 -4
- package/lib/lowcode/view/lc-components/Image/index.less +27 -0
- package/lib/lowcode/view/lc-components/Image/meta.json +51 -16
- package/lib/lowcode/view/lc-components/Link/index.js +52 -4
- package/lib/lowcode/view/lc-components/Link/index.less +15 -0
- package/lib/lowcode/view/lc-components/Link/meta.json +9 -9
- package/lib/lowcode/view/lc-components/Table/index.js +5 -6
- package/lib/lowcode/view/lc-components/Table/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +38 -2
- package/lib/lowcode/view/lc-components/Tabs/index.js +1 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +20 -18
- package/lib/lowcode/view/lc-components/Tree/meta.json +2 -2
- package/lib/utils/grid.js +2 -2
- package/package.json +10 -9
- package/es/lowcode/painter/style/treedragdrop.less +0 -19
- package/es/lowcode/view/lc-components/Form/index.less +0 -5
- package/lib/lowcode/painter/style/treedragdrop.less +0 -19
- package/lib/lowcode/view/lc-components/Form/index.less +0 -5
|
@@ -26,7 +26,20 @@ var _constants = require("../constants");
|
|
|
26
26
|
var _design = _interopRequireDefault(require("./style/design.less"));
|
|
27
27
|
var _apiUrl = require("../constants/api-url");
|
|
28
28
|
var _helper = require("../engine/tools/helper");
|
|
29
|
+
var _TipIcon = _interopRequireDefault(require("./components/TipIcon"));
|
|
29
30
|
var _excluded = ["key", "label"];
|
|
31
|
+
var CodeSvg = function CodeSvg() {
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
33
|
+
width: "18",
|
|
34
|
+
height: "18",
|
|
35
|
+
viewBox: "0 0 18 18",
|
|
36
|
+
fill: "none",
|
|
37
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
39
|
+
d: "M2.4749 9.0916L5.45264 6.20703L5.45439 5.93457V4.69707L0.91748 9.0916L5.45439 13.4844V12.2469L5.45264 11.9744L2.4749 9.0916ZM15.2067 9.00723L12.229 6.12441L12.2272 5.85195V4.61445L16.7642 9.00723L12.2272 13.4018V12.1625L12.229 11.89L15.2067 9.00723ZM8.12451 15.0295H6.76045L9.55713 2.80566H10.9212L8.12451 15.0295Z",
|
|
40
|
+
fill: "currentColor"
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
30
43
|
var DesignToolbar = function DesignToolbar(_ref) {
|
|
31
44
|
var locale = _ref.locale,
|
|
32
45
|
onLangChange = _ref.onLangChange;
|
|
@@ -233,9 +246,16 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
233
246
|
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
234
247
|
type: "laptop"
|
|
235
248
|
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
236
|
-
className: (0, _classnames.default)(_design.default['toolbar-item'], (0, _defineProperty2.default)({}, _design.default.actived, activedTarget === 'mobile'))
|
|
249
|
+
className: (0, _classnames.default)(_design.default['toolbar-item'], (0, _defineProperty2.default)({}, _design.default.actived, activedTarget === 'mobile'))
|
|
250
|
+
// onClick={() => setActivedTarget('mobile')}
|
|
251
|
+
,
|
|
237
252
|
onClick: function onClick() {
|
|
238
|
-
|
|
253
|
+
_antd.Modal.info({
|
|
254
|
+
title: (0, _utils.formatMessage)({
|
|
255
|
+
id: 'luckda.lowcode.not.mobile',
|
|
256
|
+
label: '此功能暂未开放'
|
|
257
|
+
})
|
|
258
|
+
});
|
|
239
259
|
}
|
|
240
260
|
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
241
261
|
type: "mobile"
|
|
@@ -273,9 +293,10 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
273
293
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
274
294
|
style: {
|
|
275
295
|
width: 'auto',
|
|
276
|
-
fontSize: 12
|
|
296
|
+
fontSize: 12,
|
|
297
|
+
cursor: 'pointer'
|
|
277
298
|
},
|
|
278
|
-
className: _design.default
|
|
299
|
+
className: _design.default.hoverPrimary,
|
|
279
300
|
onClick: function onClick() {
|
|
280
301
|
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
281
302
|
target: _constants.LC_BUILDIN_UNIT_KEY.PAGE_ROOT
|
|
@@ -289,7 +310,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
289
310
|
}), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
290
311
|
size: "small",
|
|
291
312
|
style: {
|
|
292
|
-
fontSize:
|
|
313
|
+
fontSize: 14,
|
|
293
314
|
margin: '0 4px 0 2px'
|
|
294
315
|
},
|
|
295
316
|
disabled: clearCacheLoading,
|
|
@@ -297,65 +318,75 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
297
318
|
}, (0, _utils.formatMessage)({
|
|
298
319
|
id: 'luckda.lowcode.design.toolbar.clear',
|
|
299
320
|
label: '清除缓存'
|
|
300
|
-
})), /*#__PURE__*/_react.default.createElement(
|
|
301
|
-
|
|
321
|
+
})), /*#__PURE__*/_react.default.createElement(_TipIcon.default, {
|
|
322
|
+
title: (0, _utils.formatMessage)({
|
|
323
|
+
id: 'luckda.lowcode.design.toolbar.debug',
|
|
324
|
+
label: '调试'
|
|
325
|
+
}),
|
|
326
|
+
type: "bug",
|
|
302
327
|
style: {
|
|
303
328
|
fontSize: 12,
|
|
304
|
-
margin: '0
|
|
329
|
+
margin: '0 8px 0 6px'
|
|
305
330
|
},
|
|
306
|
-
|
|
331
|
+
className: _design.default.hoverPrimary,
|
|
307
332
|
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
|
308
333
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
|
309
334
|
while (1) switch (_context3.prev = _context3.next) {
|
|
310
335
|
case 0:
|
|
336
|
+
if (updatePageDataLoading) {
|
|
337
|
+
_context3.next = 6;
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
311
340
|
if (!(0, _ContextProvider.getNeedPrompt)()) {
|
|
312
|
-
_context3.next =
|
|
341
|
+
_context3.next = 4;
|
|
313
342
|
break;
|
|
314
343
|
}
|
|
315
|
-
_context3.next =
|
|
344
|
+
_context3.next = 4;
|
|
316
345
|
return handleSave();
|
|
317
|
-
case
|
|
346
|
+
case 4:
|
|
318
347
|
context.$publisher(context.topics.COMPONENT_ACTIVE, null);
|
|
319
348
|
setShowPreview(true);
|
|
320
|
-
case
|
|
349
|
+
case 6:
|
|
321
350
|
case "end":
|
|
322
351
|
return _context3.stop();
|
|
323
352
|
}
|
|
324
353
|
}, _callee3);
|
|
325
354
|
}))
|
|
326
|
-
}, (
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
type: "primary",
|
|
334
|
-
disabled: updatePageDataLoading,
|
|
335
|
-
style: {
|
|
336
|
-
fontSize: 12,
|
|
337
|
-
padding: '0 7px 0 0',
|
|
338
|
-
marginLeft: 2
|
|
339
|
-
}
|
|
340
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
355
|
+
}), /*#__PURE__*/_react.default.createElement(_TipIcon.default, {
|
|
356
|
+
title: (0, _utils.formatMessage)({
|
|
357
|
+
id: 'luckda.lowcode.design.toolbar.code',
|
|
358
|
+
label: 'Schema面板'
|
|
359
|
+
}),
|
|
360
|
+
component: CodeSvg,
|
|
361
|
+
className: _design.default.hoverPrimary,
|
|
341
362
|
style: {
|
|
342
|
-
|
|
343
|
-
|
|
363
|
+
fontSize: 14,
|
|
364
|
+
margin: '0 8px 0 6px'
|
|
344
365
|
},
|
|
345
|
-
onClick:
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
366
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {
|
|
367
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {
|
|
368
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
369
|
+
case 0:
|
|
370
|
+
if (!updatePageDataLoading) setShow(true);
|
|
371
|
+
case 1:
|
|
372
|
+
case "end":
|
|
373
|
+
return _context4.stop();
|
|
374
|
+
}
|
|
375
|
+
}, _callee4);
|
|
376
|
+
}))
|
|
377
|
+
}), /*#__PURE__*/_react.default.createElement(_TipIcon.default, {
|
|
378
|
+
title: (0, _utils.formatMessage)({
|
|
379
|
+
id: 'luckda.lowcode.design.toolbar.save',
|
|
380
|
+
label: '保存'
|
|
381
|
+
}),
|
|
382
|
+
type: "save",
|
|
383
|
+
className: _design.default.hoverPrimary,
|
|
350
384
|
style: {
|
|
351
|
-
|
|
385
|
+
fontSize: 14,
|
|
386
|
+
margin: '0 11px 0 5px'
|
|
352
387
|
},
|
|
353
|
-
onClick:
|
|
354
|
-
|
|
355
|
-
}
|
|
356
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
357
|
-
type: "eye"
|
|
358
|
-
})))), /*#__PURE__*/_react.default.createElement(_antd.Modal, {
|
|
388
|
+
onClick: handleSave
|
|
389
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Modal, {
|
|
359
390
|
visible: show,
|
|
360
391
|
width: 1024,
|
|
361
392
|
getContainer: function getContainer() {
|
|
@@ -409,10 +440,10 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
409
440
|
setUserId(void 0);
|
|
410
441
|
}
|
|
411
442
|
}
|
|
412
|
-
}, userOptions.map(function (
|
|
413
|
-
var key =
|
|
414
|
-
label =
|
|
415
|
-
rest = (0, _objectWithoutProperties2.default)(
|
|
443
|
+
}, userOptions.map(function (_ref7) {
|
|
444
|
+
var key = _ref7.key,
|
|
445
|
+
label = _ref7.label,
|
|
446
|
+
rest = (0, _objectWithoutProperties2.default)(_ref7, _excluded);
|
|
416
447
|
return /*#__PURE__*/_react.default.createElement(_antd.Select.Option, (0, _extends2.default)({
|
|
417
448
|
key: key,
|
|
418
449
|
value: key
|
|
@@ -426,7 +457,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
426
457
|
},
|
|
427
458
|
bodyStyle: {
|
|
428
459
|
height: 'calc(100% - 54px)',
|
|
429
|
-
backgroundColor: '
|
|
460
|
+
backgroundColor: 'var(--ant-component-background,#F0F2F5)'
|
|
430
461
|
},
|
|
431
462
|
visible: showPreview,
|
|
432
463
|
destroyOnClose: true,
|
|
@@ -16,6 +16,7 @@ var _Outline = _interopRequireDefault(require("./Outline"));
|
|
|
16
16
|
var _Components = _interopRequireDefault(require("./Components"));
|
|
17
17
|
var _I18n = _interopRequireDefault(require("./I18n"));
|
|
18
18
|
var _utils = require("@luck-design-biz/base/utils");
|
|
19
|
+
var _expect = _interopRequireDefault(require("./expect.jsx"));
|
|
19
20
|
var _ribbon = _interopRequireDefault(require("./style/ribbon.less"));
|
|
20
21
|
var _WIDTH_ = 48;
|
|
21
22
|
var _DRAWER_PROPS = {
|
|
@@ -76,6 +77,10 @@ var Ribbon = function Ribbon() {
|
|
|
76
77
|
})
|
|
77
78
|
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
78
79
|
type: "apartment",
|
|
80
|
+
style: {
|
|
81
|
+
color: (drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_OUTLINE_.key && '#1d79f2',
|
|
82
|
+
fontSize: 20
|
|
83
|
+
},
|
|
79
84
|
onClick: function onClick() {
|
|
80
85
|
return setDrawer((drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_OUTLINE_.key ? null : _DRAWER_OUTLINE_);
|
|
81
86
|
}
|
|
@@ -87,6 +92,10 @@ var Ribbon = function Ribbon() {
|
|
|
87
92
|
})
|
|
88
93
|
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
89
94
|
type: "appstore",
|
|
95
|
+
style: {
|
|
96
|
+
color: (drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_COMPONENTS_.key && '#1d79f2',
|
|
97
|
+
fontSize: 20
|
|
98
|
+
},
|
|
90
99
|
onClick: function onClick() {
|
|
91
100
|
return setDrawer((drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_COMPONENTS_.key ? null : _DRAWER_COMPONENTS_);
|
|
92
101
|
}
|
|
@@ -98,6 +107,10 @@ var Ribbon = function Ribbon() {
|
|
|
98
107
|
})
|
|
99
108
|
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
100
109
|
type: "global",
|
|
110
|
+
style: {
|
|
111
|
+
color: (drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_I18N_.key && '#1d79f2',
|
|
112
|
+
fontSize: 20
|
|
113
|
+
},
|
|
101
114
|
onClick: function onClick() {
|
|
102
115
|
return setDrawer((drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_I18N_.key ? null : _DRAWER_I18N_);
|
|
103
116
|
}
|
|
@@ -145,6 +158,6 @@ var Ribbon = function Ribbon() {
|
|
|
145
158
|
style: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _DRAWER_PROPS.style), {}, {
|
|
146
159
|
display: (drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_I18N_.key ? 'block' : 'none'
|
|
147
160
|
})
|
|
148
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
161
|
+
}), /*#__PURE__*/_react.default.createElement(_expect.default, null)));
|
|
149
162
|
};
|
|
150
163
|
var _default = exports.default = Ribbon;
|
|
@@ -25,13 +25,9 @@ var _ACTION_CATEGORY_ = [{
|
|
|
25
25
|
id: "".concat(_I18N_PREFIX_, ".pageActions"),
|
|
26
26
|
label: '页面行为'
|
|
27
27
|
})
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
id: "".concat(_I18N_PREFIX_, ".trigger"),
|
|
32
|
-
label: '触发器'
|
|
33
|
-
})
|
|
34
|
-
}, {
|
|
28
|
+
},
|
|
29
|
+
// { key: 'trigger', label: formatMessage({ id: `${_I18N_PREFIX_}.trigger`, label: '触发器' }) },
|
|
30
|
+
{
|
|
35
31
|
key: 'custom',
|
|
36
32
|
label: (0, _utils.formatMessage)({
|
|
37
33
|
id: "".concat(_I18N_PREFIX_, ".custom"),
|
|
@@ -17,6 +17,7 @@ var _Overlay = _interopRequireDefault(require("./Overlay"));
|
|
|
17
17
|
var _constants = require("../../../constants");
|
|
18
18
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
19
19
|
var _lodash = require("lodash");
|
|
20
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
20
21
|
var SIDE_DiSTANCE = 20;
|
|
21
22
|
var SIDE_DiSTANCE_TREENODE = 10;
|
|
22
23
|
var Action = exports.Action = /*#__PURE__*/(0, _createClass2.default)(function Action() {
|
|
@@ -35,15 +36,50 @@ function _default(_ref) {
|
|
|
35
36
|
var _active$component;
|
|
36
37
|
var children = _ref.children;
|
|
37
38
|
var ctx = (0, _ContextProvider.useContext)();
|
|
39
|
+
(0, _react.useEffect)(function () {
|
|
40
|
+
var event_drag = ctx.$subscriber(ctx.topics.COMPONENT_DRAG_END).on(function (_ref2) {
|
|
41
|
+
var id = _ref2.id,
|
|
42
|
+
fromId = _ref2.fromId,
|
|
43
|
+
fromComp = _ref2.fromComp,
|
|
44
|
+
action = _ref2.action,
|
|
45
|
+
actionSide = _ref2.actionSide,
|
|
46
|
+
vaild = _ref2.vaild;
|
|
47
|
+
// console.log('onDargEnd', id, fromId, fromComp, action, actionSide);
|
|
48
|
+
if (vaild) {
|
|
49
|
+
switch (action) {
|
|
50
|
+
case 'move':
|
|
51
|
+
{
|
|
52
|
+
(0, _ContextProvider.moveNode)(fromId, id, actionSide);
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
case 'add':
|
|
56
|
+
{
|
|
57
|
+
var compName = fromComp.component.toLowerCase();
|
|
58
|
+
var json = require("../../../engine/meta/".concat(compName, ".props.default.json"));
|
|
59
|
+
(0, _ContextProvider.moveNode)(null, id, actionSide, "".concat(compName, "_").concat((0, _utils.suid)()), json);
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}).watch();
|
|
65
|
+
return function () {
|
|
66
|
+
ctx.$unsubscriber(ctx.topics.COMPONENT_DRAG_END, event_drag);
|
|
67
|
+
};
|
|
68
|
+
}, []);
|
|
38
69
|
var _useState = (0, _react.useState)(null),
|
|
39
70
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
40
71
|
active = _useState2[0],
|
|
41
72
|
setActive = _useState2[1];
|
|
73
|
+
var _useState3 = (0, _react.useState)(null),
|
|
74
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
75
|
+
noDrag = _useState4[0],
|
|
76
|
+
setNoDrag = _useState4[1];
|
|
42
77
|
function handleDragStart(event) {
|
|
43
78
|
setActive(event.active.data.current);
|
|
44
79
|
}
|
|
45
80
|
function handleDragEnd(event) {
|
|
46
81
|
setActive(null);
|
|
82
|
+
setNoDrag(null);
|
|
47
83
|
pubEvent(event, ctx.topics.COMPONENT_DRAG_END, ctx);
|
|
48
84
|
}
|
|
49
85
|
function handleDragMove(event) {
|
|
@@ -56,34 +92,65 @@ function _default(_ref) {
|
|
|
56
92
|
}
|
|
57
93
|
});
|
|
58
94
|
var sensors = (0, _core.useSensors)(mouseSensor);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
95
|
+
var pubEvent = (0, _react.useCallback)(function (event, eventName, ctx) {
|
|
96
|
+
if (event.active && event.over && event.active.data.current.id !== event.over.data.current.id) {
|
|
97
|
+
var vaild = true;
|
|
98
|
+
var dropperId = event.over.data.current.id;
|
|
99
|
+
var dropNodeData = ctx.$(dropperId).api.getSelfAndParentData();
|
|
100
|
+
var dropNode = dropNodeData === null || dropNodeData === void 0 ? void 0 : dropNodeData.node;
|
|
101
|
+
var dropParentNode = dropNodeData === null || dropNodeData === void 0 ? void 0 : dropNodeData.parent;
|
|
102
|
+
|
|
103
|
+
// console.log('dropperId', dropperId)
|
|
104
|
+
|
|
105
|
+
var actionSide = getAction(event.over.data.current.type, event.over.data.current.component.component, event.active.rect.current.translated, event.over.rect, dropNode, dropParentNode);
|
|
106
|
+
|
|
107
|
+
// console.log('actionSide', actionSide)
|
|
108
|
+
|
|
109
|
+
if (event.active.data.current.action === 'move') {
|
|
110
|
+
var draggerId = event.active.data.current.id;
|
|
111
|
+
// console.log('draggerId', draggerId, event.active.data.current)
|
|
112
|
+
|
|
113
|
+
var dragNodeData = ctx.$(draggerId).api.getSelfAndParentData();
|
|
114
|
+
var dragNode = dragNodeData === null || dragNodeData === void 0 ? void 0 : dragNodeData.node;
|
|
115
|
+
var dragParentNode = dragNodeData === null || dragNodeData === void 0 ? void 0 : dragNodeData.parent;
|
|
116
|
+
|
|
117
|
+
// 如果是拖拽到父容器上则不进行处理
|
|
118
|
+
if (dragParentNode && dragParentNode.props.id === event.over.data.current.id) {
|
|
119
|
+
vaild = false;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// 父结构不容许拖入子结构
|
|
123
|
+
if (findParent(ctx, dropperId, draggerId)) {
|
|
124
|
+
vaild = false;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// 如果是build类型的组件,不容许跨节点拖拽
|
|
128
|
+
if (dragNode.props.buildIn == true && (dragNode.props.parentId != dropNode.props.parentId || actionSide == ActionSide.INSIDE)) {
|
|
129
|
+
vaild = false;
|
|
130
|
+
}
|
|
131
|
+
;
|
|
132
|
+
} else if (event.active.data.current.action === 'add') {
|
|
133
|
+
vaild = true;
|
|
134
|
+
}
|
|
135
|
+
if (!actionSide) {
|
|
136
|
+
vaild = false;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// console.log('vaild', vaild, actionSide)
|
|
140
|
+
|
|
141
|
+
setNoDrag(!vaild);
|
|
142
|
+
|
|
143
|
+
// console.log({
|
|
144
|
+
// eventName,
|
|
145
|
+
// id: event.over.data.current.id,
|
|
146
|
+
// fromId: event.active.data.current.id,
|
|
147
|
+
// fromComp: event.active.data.current.component,
|
|
148
|
+
// action: event.active.data.current.action,
|
|
149
|
+
// actionSide,
|
|
150
|
+
// });
|
|
151
|
+
|
|
86
152
|
ctx.$publisher(eventName, {
|
|
153
|
+
vaild: vaild,
|
|
87
154
|
id: event.over.data.current.id,
|
|
88
155
|
// 拖拽目标组件id
|
|
89
156
|
fromId: event.active.data.current.id,
|
|
@@ -94,18 +161,57 @@ function pubEvent(event, eventName, ctx) {
|
|
|
94
161
|
// 行为 add move delete
|
|
95
162
|
actionSide: actionSide // 目标位置 left inside right
|
|
96
163
|
});
|
|
164
|
+
} else {
|
|
165
|
+
setNoDrag(true);
|
|
166
|
+
ctx.$publisher(eventName, {
|
|
167
|
+
vaild: false
|
|
168
|
+
});
|
|
97
169
|
}
|
|
98
|
-
}
|
|
170
|
+
}, []);
|
|
171
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_core.DndContext, {
|
|
172
|
+
sensors: sensors,
|
|
173
|
+
onDragStart: handleDragStart,
|
|
174
|
+
onDragEnd: handleDragEnd,
|
|
175
|
+
onDragMove: handleDragMove
|
|
176
|
+
}, children, /*#__PURE__*/_react.default.createElement(_core.DragOverlay, {
|
|
177
|
+
style: {
|
|
178
|
+
zIndex: 21
|
|
179
|
+
},
|
|
180
|
+
dropAnimation: null
|
|
181
|
+
}, active && /*#__PURE__*/_react.default.createElement(_Overlay.default, {
|
|
182
|
+
noDrag: noDrag
|
|
183
|
+
}, active === null || active === void 0 || (_active$component = active.component) === null || _active$component === void 0 ? void 0 : _active$component.name))));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// 查找id是否属于parentid的子层级
|
|
187
|
+
function findParent(ctx, id, parentid) {
|
|
188
|
+
// 安全地获取节点数据
|
|
189
|
+
var nodeData = ctx.componentMap.get(id).api.getSelfAndParentData();
|
|
190
|
+
var node = nodeData === null || nodeData === void 0 ? void 0 : nodeData.node; // 确保这里是 'node' 而非 'nodel'
|
|
191
|
+
|
|
192
|
+
// 检查当前节点的parentId是否为目标parentid
|
|
193
|
+
if (node && node.props.parentId === parentid) return true;
|
|
194
|
+
|
|
195
|
+
// 检查是否已经到达页面根节点
|
|
196
|
+
if (!node.props.parentId || node.props.parentId === 'page_root') return false;
|
|
197
|
+
|
|
198
|
+
// 递归调用,检查上一级父节点
|
|
199
|
+
return findParent(ctx, node.props.parentId, parentid);
|
|
99
200
|
}
|
|
100
201
|
function isContainerUnit(node) {
|
|
101
202
|
if ((0, _lodash.isNil)(node)) return false;
|
|
102
203
|
return _constants.CONTAINER_UNITS.includes(node.props.component);
|
|
103
204
|
}
|
|
104
|
-
function getAction(type, overComponentName, activeRect, overRect,
|
|
205
|
+
function getAction(type, overComponentName, activeRect, overRect, dropNode, dropParentNode) {
|
|
105
206
|
var action = null;
|
|
106
|
-
var
|
|
207
|
+
var dropNodeParent = dropParentNode;
|
|
208
|
+
var parentIsContainer = isContainerUnit(dropNodeParent);
|
|
209
|
+
var buildIn = dropNode.props.buildIn;
|
|
210
|
+
// console.log('buildIn', buildIn, dropNode, dropNodeParent)
|
|
211
|
+
|
|
107
212
|
if (type == 'comp') {
|
|
108
213
|
if (_constants.CONTAINER_UNITS.includes(overComponentName)) {
|
|
214
|
+
// console.log('parentIsContainer', parentIsContainer, parentNode)
|
|
109
215
|
// 如果是最小单元容器
|
|
110
216
|
if (Math.abs(activeRect.left - overRect.left) <= SIDE_DiSTANCE) {
|
|
111
217
|
if (parentIsContainer) action = ActionSide.LEFT;
|
|
@@ -116,20 +222,21 @@ function getAction(type, overComponentName, activeRect, overRect, parentNode) {
|
|
|
116
222
|
}
|
|
117
223
|
} else {
|
|
118
224
|
// 独立组件
|
|
119
|
-
|
|
225
|
+
// console.log('pos:',activeRect.left, overRect.left)
|
|
226
|
+
if (activeRect.left <= overRect.left + overRect.width / 2) {
|
|
120
227
|
if (parentIsContainer) action = ActionSide.LEFT;
|
|
121
|
-
} else if (activeRect.left > overRect.left + overRect.width / 2
|
|
228
|
+
} else if (activeRect.left > overRect.left + overRect.width / 2) {
|
|
122
229
|
if (parentIsContainer) action = ActionSide.RIGHT;
|
|
123
230
|
}
|
|
124
231
|
}
|
|
125
232
|
} else {
|
|
126
|
-
//
|
|
233
|
+
// 大纲树处理
|
|
127
234
|
if (_constants.CONTAINER_UNITS.includes(overComponentName)) {
|
|
128
235
|
// 如果是最小单元容器
|
|
129
236
|
if (Math.abs(activeRect.top - overRect.top) <= SIDE_DiSTANCE_TREENODE) {
|
|
130
|
-
if (parentIsContainer) action = ActionSide.LEFT;
|
|
237
|
+
if (parentIsContainer || buildIn) action = ActionSide.LEFT;
|
|
131
238
|
} else if (Math.abs(activeRect.top - overRect.bottom) <= SIDE_DiSTANCE_TREENODE) {
|
|
132
|
-
if (parentIsContainer) action = ActionSide.RIGHT;
|
|
239
|
+
if (parentIsContainer || buildIn) action = ActionSide.RIGHT;
|
|
133
240
|
} else {
|
|
134
241
|
action = ActionSide.INSIDE;
|
|
135
242
|
}
|
|
@@ -45,13 +45,36 @@ function _default(_ref) {
|
|
|
45
45
|
}, []);
|
|
46
46
|
(0, _react.useEffect)(function () {
|
|
47
47
|
var dom = getTargetDom();
|
|
48
|
-
if (dom)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
48
|
+
if (!dom || !itemInfo.component) return;
|
|
49
|
+
if (!_constants.NO_DRAGABLE.includes(itemInfo.component)) setDragRef(dom);
|
|
50
|
+
if (!_constants.NO_DROPABLE.includes(itemInfo.component)) setDropRef(dom);
|
|
52
51
|
}, []);
|
|
53
52
|
var comp = (0, _ahooks.useCreation)(function () {
|
|
54
53
|
return /*#__PURE__*/(0, _react.cloneElement)(children, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, children.props), _memoListeners), attributes));
|
|
55
54
|
}, [id, children]);
|
|
55
|
+
(0, _react.useEffect)(function () {
|
|
56
|
+
var event_drag = ctx.$subscriber(ctx.topics.COMPONENT_DRAG_OVER).on(function (_ref2) {
|
|
57
|
+
var itemId = _ref2.id,
|
|
58
|
+
actionSide = _ref2.actionSide;
|
|
59
|
+
if (actionSide === _DragDropContext.ActionSide.INSIDE) {
|
|
60
|
+
ctx.$publisher(ctx.topics.COMPONENT_HOVER, {
|
|
61
|
+
target: itemId
|
|
62
|
+
});
|
|
63
|
+
} else if (actionSide === _DragDropContext.ActionSide.LEFT || actionSide === _DragDropContext.ActionSide.RIGHT) {
|
|
64
|
+
ctx.$publisher(ctx.topics.COMPONENT_HOVER, {
|
|
65
|
+
target: itemId,
|
|
66
|
+
side: actionSide
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}).watch();
|
|
70
|
+
return function () {
|
|
71
|
+
ctx.$unsubscriber(ctx.topics.COMPONENT_DRAG_OVER, event_drag);
|
|
72
|
+
};
|
|
73
|
+
}, []);
|
|
74
|
+
(0, _core.useDndMonitor)({
|
|
75
|
+
onDragEnd: function onDragEnd() {
|
|
76
|
+
ctx.$publisher(ctx.topics.COMPONENT_HOVER, null);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
56
79
|
return comp;
|
|
57
80
|
}
|
|
@@ -5,11 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = _default;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
11
|
var _dragdrop = _interopRequireDefault(require("../../style/dragdrop.less"));
|
|
10
12
|
function _default(_ref) {
|
|
11
|
-
var children = _ref.children
|
|
13
|
+
var children = _ref.children,
|
|
14
|
+
noDrag = _ref.noDrag;
|
|
12
15
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
13
|
-
className: _dragdrop.default['dragdrop-overlay']
|
|
16
|
+
className: (0, _classnames.default)([_dragdrop.default['dragdrop-overlay'], (0, _defineProperty2.default)({}, _dragdrop.default['no-drag'], noDrag)])
|
|
14
17
|
}, children);
|
|
15
18
|
}
|
|
@@ -7,12 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = _default;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
14
|
var _core = require("@dnd-kit/core");
|
|
13
15
|
var _DragDropContext = require("./DragDropContext");
|
|
14
16
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
15
|
-
var
|
|
17
|
+
var _dragdrop = _interopRequireDefault(require("../../style/dragdrop.less"));
|
|
16
18
|
var _constants = require("../../../constants");
|
|
17
19
|
function _default(_ref) {
|
|
18
20
|
var item = _ref.item,
|
|
@@ -27,8 +29,9 @@ function _default(_ref) {
|
|
|
27
29
|
var event_drag = context.$subscriber(context.topics.COMPONENT_DRAG_OVER).on(function (_ref2) {
|
|
28
30
|
var itemId = _ref2.id,
|
|
29
31
|
fromId = _ref2.fromId,
|
|
30
|
-
actionSide = _ref2.actionSide
|
|
31
|
-
|
|
32
|
+
actionSide = _ref2.actionSide,
|
|
33
|
+
vaild = _ref2.vaild;
|
|
34
|
+
if (vaild && itemId === id) {
|
|
32
35
|
setSide(actionSide);
|
|
33
36
|
} else {
|
|
34
37
|
setSide(null);
|
|
@@ -66,7 +69,7 @@ function _default(_ref) {
|
|
|
66
69
|
}),
|
|
67
70
|
setDropRef = _useDroppable.setNodeRef;
|
|
68
71
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
69
|
-
className:
|
|
72
|
+
className: (0, _classnames.default)([_dragdrop.default['lc-painter-components-treedragdrop'], (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _dragdrop.default["".concat(side, "-side")], side), _dragdrop.default['ondrag'], isDragging)]),
|
|
70
73
|
ref: function ref(node) {
|
|
71
74
|
if (!_constants.NO_DRAGABLE.includes(item.component)) setDragRef(node);
|
|
72
75
|
if (!_constants.NO_DROPABLE.includes(item.component)) setDropRef(node);
|
|
@@ -66,7 +66,7 @@ function _default(_ref) {
|
|
|
66
66
|
unit = _parseValue.unit;
|
|
67
67
|
var handleSelect = function handleSelect(item) {
|
|
68
68
|
var newValue;
|
|
69
|
-
if (item.key == 'auto') newValue = item.key;else if (isNaN(number)) {
|
|
69
|
+
if (item.key == 'auto') newValue = item.key;else if (!number || isNaN(number)) {
|
|
70
70
|
var defaultNumber = defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0;
|
|
71
71
|
if (isNaN(defaultNumber)) {
|
|
72
72
|
var match = defaultNumber.match(/[\d\.]+/);
|
|
@@ -83,7 +83,8 @@ var BaseEditor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
83
83
|
onDidChangeStorage: function onDidChangeStorage() {}
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
-
|
|
86
|
+
// 监听布局变化,重新赋值,解决编辑器全屏切换时,编辑器空白的问题
|
|
87
|
+
editorInstance.current.onDidLayoutChange(function (event) {
|
|
87
88
|
if (onChange) onChange(editorInstance.current.getValue(), event);
|
|
88
89
|
});
|
|
89
90
|
}
|
|
@@ -36,8 +36,8 @@ var LeftBox = _styledComponents.default.div.withConfig({
|
|
|
36
36
|
var Option = _styledComponents.default.div.withConfig({
|
|
37
37
|
displayName: "Option",
|
|
38
38
|
componentId: "luckda-6530__sc-rwt684-3"
|
|
39
|
-
})(["width:100%;height:32px;cursor:pointer;line-height:32px;padding:0 8px;display:flex;justify-content:space-between;align-items:center;", " &:hover{background-color
|
|
40
|
-
return props.actived ? 'background-color: #e8e8e8;' : void 0;
|
|
39
|
+
})(["width:100%;height:32px;cursor:pointer;line-height:32px;padding:0 8px;display:flex;justify-content:space-between;align-items:center;", " &:hover{background-color:var(--ant-border-color-base,#e8e8e8);}"], function (props) {
|
|
40
|
+
return props.actived ? 'background-color: var(--ant-border-color-base, #e8e8e8);' : void 0;
|
|
41
41
|
});
|
|
42
42
|
var RightBox = _styledComponents.default.div.withConfig({
|
|
43
43
|
displayName: "RightBox",
|