@luck-design-biz/luckda 0.0.25-6 → 0.0.25-8
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 +8 -10
- package/es/components/LDActions/index.less +7 -4
- package/es/components/LdAutoForm/index.js +26 -8
- package/es/components/LdFormList/index.js +37 -22
- package/es/components/LdGrid/index.js +14 -7
- package/es/components/LdGridForm/index.js +18 -6
- package/es/components/LdTree/index.js +33 -15
- package/es/helper/form.js +15 -8
- package/es/locales/zh-CN.js +16 -10
- package/es/lowcode/constants/api-url.js +120 -32
- package/es/lowcode/constants/event-topics.js +2 -0
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -2
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +4 -2
- package/es/lowcode/engine/meta/box.props.json +3 -3
- package/es/lowcode/engine/meta/button.props.json +3 -3
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/dialog.props.default.json +10 -5
- package/es/lowcode/engine/meta/dialog.props.json +72 -42
- package/es/lowcode/engine/meta/drawer.props.json +8 -20
- package/es/lowcode/engine/meta/form.props.json +16 -10
- package/es/lowcode/engine/meta/imex.props.default.json +8 -1
- package/es/lowcode/engine/meta/imex.props.json +54 -22
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/es/lowcode/engine/meta/layout.props.json +2 -2
- package/es/lowcode/engine/meta/page.props.json +2 -2
- package/es/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/es/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/es/lowcode/engine/meta/section.props.json +2 -2
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +4 -4
- package/es/lowcode/engine/meta/table.props.json +17 -11
- package/es/lowcode/engine/meta/tabs.props.json +3 -3
- package/es/lowcode/engine/meta/tree.props.default.json +2 -0
- package/es/lowcode/engine/meta/tree.props.json +62 -6
- package/es/lowcode/engine/provider/ContextProvider/index.js +20 -43
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +69 -24
- package/es/lowcode/engine/tools/dataProcess.js +4 -0
- package/es/lowcode/engine/tools/helper.js +2 -3
- package/es/lowcode/engine/tools/useCanvasRender.js +3 -2
- package/es/lowcode/engine/tools/usePageDataStore.js +176 -0
- package/es/lowcode/engine/tools/usePromiseState.js +12 -23
- package/es/lowcode/engine/tools/useTodo.js +20 -10
- package/es/lowcode/painter/DesignOperator.js +12 -23
- package/es/lowcode/painter/DesignToolbar.js +10 -45
- package/es/lowcode/painter/Outline.js +2 -4
- package/es/lowcode/painter/Panel.js +29 -28
- package/es/lowcode/painter/components/ActionBindModal.js +30 -24
- package/es/lowcode/painter/components/AdvancePanel.js +6 -1
- package/es/lowcode/painter/components/AttrsPanel.js +38 -29
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
- package/es/lowcode/painter/components/field-setting/CheckFrontRules.js +108 -0
- package/es/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +33 -13
- package/es/lowcode/painter/components/field-setting/SettingUI.js +162 -30
- package/es/lowcode/painter/components/field-setting/index.js +32 -63
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +53 -0
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +14 -17
- package/es/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/es/lowcode/painter/panel-section/DataSetSelector.js +4 -1
- package/es/lowcode/painter/panel-section/FieldsSetting.js +53 -8
- package/es/lowcode/painter/panel-section/ImpExp.js +93 -6
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +109 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +95 -0
- package/es/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/es/lowcode/painter/panel-section/SplitDisplay.js +25 -110
- package/es/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/es/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/es/lowcode/painter/style/action-bind-modal.less +3 -3
- package/es/lowcode/painter/style/design.less +1 -1
- package/es/lowcode/painter/style/page-layout-display.less +28 -0
- package/es/lowcode/painter/style/panel-item.less +1 -1
- package/es/lowcode/painter/style/split-display.less +0 -9
- package/es/lowcode/preview/index.js +4 -2
- package/es/lowcode/view/Canvas.js +6 -7
- package/es/lowcode/view/Page.js +2 -3
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/es/lowcode/view/lc-components/Box/meta.json +3 -3
- package/es/lowcode/view/lc-components/Button/index.js +2 -6
- package/es/lowcode/view/lc-components/Button/meta.json +3 -3
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +3 -10
- package/es/lowcode/view/lc-components/Dialog/index.js +114 -19
- package/es/lowcode/view/lc-components/Dialog/meta.json +65 -42
- package/es/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +23 -33
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/es/lowcode/view/lc-components/Form/index.js +113 -21
- package/es/lowcode/view/lc-components/Form/meta.json +16 -10
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
- package/es/lowcode/view/lc-components/ImEx/index.js +260 -10
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +12 -19
- package/es/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/es/lowcode/view/lc-components/Page/meta.json +2 -2
- package/es/lowcode/view/lc-components/PageContent/index.js +8 -9
- package/es/lowcode/view/lc-components/PageFooter/index.js +2 -5
- package/es/lowcode/view/lc-components/PageHeader/index.js +5 -6
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +63 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/index.js +32 -0
- package/es/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/es/lowcode/view/lc-components/PageModal/index.js +12 -15
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +3 -9
- package/es/lowcode/view/lc-components/Section/meta.json +2 -2
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
- package/es/lowcode/view/lc-components/Split/index.js +5 -9
- package/es/lowcode/view/lc-components/Split/meta.json +4 -4
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +138 -0
- package/es/lowcode/view/lc-components/Table/index.js +124 -39
- package/es/lowcode/view/lc-components/Table/meta.json +17 -11
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +10 -17
- package/es/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/es/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
- package/es/lowcode/view/lc-components/Tree/index.js +67 -18
- package/es/lowcode/view/lc-components/Tree/meta.json +62 -7
- package/es/lowcode/view/lc-components/Wrapper.js +9 -11
- package/es/services.js +0 -24
- package/es/upload/FilesWall/file.png +0 -0
- package/es/upload/FilesWall/index.js +422 -0
- package/es/upload/FilesWall/index.less +74 -0
- package/es/upload/Form/index.js +2 -1
- package/es/upload/FormItem/index.js +3 -5
- package/es/upload/index.js +2 -1
- package/es/utils/action.js +2 -2
- package/lib/components/LDActions/index.js +7 -9
- package/lib/components/LDActions/index.less +7 -4
- package/lib/components/LdAutoForm/index.js +25 -7
- package/lib/components/LdFormList/index.js +36 -21
- package/lib/components/LdGrid/index.js +14 -7
- package/lib/components/LdGridForm/index.js +16 -4
- package/lib/components/LdTree/index.js +33 -15
- package/lib/helper/form.js +14 -7
- package/lib/locales/zh-CN.js +16 -10
- package/lib/lowcode/constants/api-url.js +123 -32
- package/lib/lowcode/constants/event-topics.js +3 -1
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -2
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +4 -2
- package/lib/lowcode/engine/meta/box.props.json +3 -3
- package/lib/lowcode/engine/meta/button.props.json +3 -3
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/dialog.props.default.json +10 -5
- package/lib/lowcode/engine/meta/dialog.props.json +72 -42
- package/lib/lowcode/engine/meta/drawer.props.json +8 -20
- package/lib/lowcode/engine/meta/form.props.json +16 -10
- package/lib/lowcode/engine/meta/imex.props.default.json +8 -1
- package/lib/lowcode/engine/meta/imex.props.json +54 -22
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/lib/lowcode/engine/meta/layout.props.json +2 -2
- package/lib/lowcode/engine/meta/page.props.json +2 -2
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/lib/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/lib/lowcode/engine/meta/section.props.json +2 -2
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +4 -4
- package/lib/lowcode/engine/meta/table.props.json +17 -11
- package/lib/lowcode/engine/meta/tabs.props.json +3 -3
- package/lib/lowcode/engine/meta/tree.props.default.json +2 -0
- package/lib/lowcode/engine/meta/tree.props.json +62 -6
- package/lib/lowcode/engine/provider/ContextProvider/index.js +36 -43
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +68 -23
- package/lib/lowcode/engine/tools/dataProcess.js +4 -0
- package/lib/lowcode/engine/tools/helper.js +2 -3
- package/lib/lowcode/engine/tools/useCanvasRender.js +3 -2
- package/lib/lowcode/engine/tools/usePageDataStore.js +183 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +11 -21
- package/lib/lowcode/engine/tools/useTodo.js +19 -9
- package/lib/lowcode/painter/DesignOperator.js +11 -22
- package/lib/lowcode/painter/DesignToolbar.js +9 -44
- package/lib/lowcode/painter/Outline.js +1 -3
- package/lib/lowcode/painter/Panel.js +28 -27
- package/lib/lowcode/painter/components/ActionBindModal.js +28 -22
- package/lib/lowcode/painter/components/AdvancePanel.js +6 -1
- package/lib/lowcode/painter/components/AttrsPanel.js +37 -28
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
- package/lib/lowcode/painter/components/field-setting/CheckFrontRules.js +116 -0
- package/lib/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +34 -13
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +159 -27
- package/lib/lowcode/painter/components/field-setting/index.js +32 -63
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +59 -0
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +13 -16
- package/lib/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +4 -1
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +53 -8
- package/lib/lowcode/painter/panel-section/ImpExp.js +92 -5
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +115 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +103 -0
- package/lib/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/lib/lowcode/painter/panel-section/SplitDisplay.js +24 -109
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/lib/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/lib/lowcode/painter/style/action-bind-modal.less +3 -3
- package/lib/lowcode/painter/style/design.less +1 -1
- package/lib/lowcode/painter/style/page-layout-display.less +28 -0
- package/lib/lowcode/painter/style/panel-item.less +1 -1
- package/lib/lowcode/painter/style/split-display.less +0 -9
- package/lib/lowcode/preview/index.js +4 -2
- package/lib/lowcode/view/Canvas.js +5 -6
- package/lib/lowcode/view/Page.js +2 -3
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/lib/lowcode/view/lc-components/Box/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Button/index.js +2 -6
- package/lib/lowcode/view/lc-components/Button/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -9
- package/lib/lowcode/view/lc-components/Dialog/index.js +114 -19
- package/lib/lowcode/view/lc-components/Dialog/meta.json +65 -42
- package/lib/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +20 -31
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/lib/lowcode/view/lc-components/Form/index.js +110 -18
- package/lib/lowcode/view/lc-components/Form/meta.json +16 -10
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
- package/lib/lowcode/view/lc-components/ImEx/index.js +257 -8
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +11 -18
- package/lib/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Page/meta.json +2 -2
- package/lib/lowcode/view/lc-components/PageContent/index.js +7 -8
- package/lib/lowcode/view/lc-components/PageFooter/index.js +2 -5
- package/lib/lowcode/view/lc-components/PageHeader/index.js +4 -5
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +71 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/index.js +40 -0
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/lib/lowcode/view/lc-components/PageModal/index.js +11 -14
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +2 -8
- package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
- package/lib/lowcode/view/lc-components/Split/index.js +2 -6
- package/lib/lowcode/view/lc-components/Split/meta.json +4 -4
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +145 -0
- package/lib/lowcode/view/lc-components/Table/index.js +123 -38
- package/lib/lowcode/view/lc-components/Table/meta.json +17 -11
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +11 -18
- package/lib/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +65 -16
- package/lib/lowcode/view/lc-components/Tree/meta.json +62 -7
- package/lib/lowcode/view/lc-components/Wrapper.js +8 -10
- package/lib/services.js +0 -25
- package/lib/upload/FilesWall/file.png +0 -0
- package/lib/upload/FilesWall/index.js +429 -0
- package/lib/upload/FilesWall/index.less +74 -0
- package/lib/upload/Form/index.js +2 -1
- package/lib/upload/FormItem/index.js +3 -5
- package/lib/upload/index.js +8 -1
- package/lib/utils/action.js +2 -2
- package/package.json +5 -4
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["id", "wrapperRef", "className", "dataset", "width", "height", "showLine", "defaultExpandDeep", "actions", "editable", "showRootAdd", "rootAddSetting", "doubleClickExpand", "onDoubleClick", "treeNodeCheckable", "treeNodeDisableCheckbox", "treeNodeDisable", "onTreeNodeRender", "treeNodeIcon", "advance"];
|
|
5
|
-
import React, { useRef, useImperativeHandle, forwardRef } from 'react';
|
|
5
|
+
var _excluded = ["id", "wrapperRef", "className", "dataset", "width", "height", "showLine", "defaultExpandDeep", "actions", "editable", "showRootAdd", "onlyRoot", "rootAddSetting", "doubleClickExpand", "onDoubleClick", "treeNodeCheckable", "treeNodeDisableCheckbox", "treeNodeDisable", "onTreeNodeRender", "treeNodeIcon", "advance", "cancelSelect", "defaultSelect"];
|
|
6
|
+
import React, { useRef, useImperativeHandle, forwardRef, useState, useEffect } from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
8
9
|
import classNames from 'classnames';
|
|
9
|
-
import { isNil } from 'lodash';
|
|
10
|
+
import { isNil, keyBy } from 'lodash';
|
|
10
11
|
import { IconFont } from '@luck-design-biz/base';
|
|
11
12
|
import { suid } from '@luck-design-biz/base/utils';
|
|
12
13
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
@@ -15,6 +16,7 @@ import { LdTree } from "../../../../index";
|
|
|
15
16
|
import { omitBadProps, executeCode } from "../../../engine/tools/helper";
|
|
16
17
|
import defaultMeta from "../../../engine/meta/tree.props.default.json";
|
|
17
18
|
import styles from "./index.less";
|
|
19
|
+
var PRIMARY = window.appConfig.constraintKeys.PRIMARY;
|
|
18
20
|
var LCTree = function LCTree(_ref) {
|
|
19
21
|
var id = _ref.id,
|
|
20
22
|
wrapperRef = _ref.wrapperRef,
|
|
@@ -27,6 +29,7 @@ var LCTree = function LCTree(_ref) {
|
|
|
27
29
|
actions = _ref.actions,
|
|
28
30
|
editable = _ref.editable,
|
|
29
31
|
showRootAdd = _ref.showRootAdd,
|
|
32
|
+
onlyRoot = _ref.onlyRoot,
|
|
30
33
|
rootAddSetting = _ref.rootAddSetting,
|
|
31
34
|
doubleClickExpand = _ref.doubleClickExpand,
|
|
32
35
|
onDoubleClick = _ref.onDoubleClick,
|
|
@@ -36,16 +39,36 @@ var LCTree = function LCTree(_ref) {
|
|
|
36
39
|
onTreeNodeRender = _ref.onTreeNodeRender,
|
|
37
40
|
_treeNodeIcon = _ref.treeNodeIcon,
|
|
38
41
|
advance = _ref.advance,
|
|
42
|
+
cancelSelect = _ref.cancelSelect,
|
|
43
|
+
defaultSelect = _ref.defaultSelect,
|
|
39
44
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
40
45
|
var ctx = useContext();
|
|
41
46
|
var boxRef = useRef();
|
|
42
47
|
var treeRef = useRef();
|
|
48
|
+
var _useState = useState([]),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
selectedKeys = _useState2[0],
|
|
51
|
+
setSelectedKeys = _useState2[1];
|
|
43
52
|
var getTargetDom = useMemoizedFn(function () {
|
|
44
53
|
return boxRef.current;
|
|
45
54
|
});
|
|
46
55
|
useImperativeHandle(wrapperRef, function () {
|
|
47
56
|
return treeRef.current;
|
|
48
57
|
});
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (_ref2) {
|
|
60
|
+
var resource = _ref2.resource,
|
|
61
|
+
prevResource = _ref2.prevResource;
|
|
62
|
+
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
63
|
+
resource: resource,
|
|
64
|
+
prevResource: prevResource,
|
|
65
|
+
instance: treeRef.current
|
|
66
|
+
});
|
|
67
|
+
}).watch();
|
|
68
|
+
return function () {
|
|
69
|
+
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
70
|
+
};
|
|
71
|
+
}, []);
|
|
49
72
|
var handleMount = useMemoizedFn(function (params) {
|
|
50
73
|
ctx.doAction(advance.events.onMount, {
|
|
51
74
|
params: params
|
|
@@ -71,6 +94,12 @@ var LCTree = function LCTree(_ref) {
|
|
|
71
94
|
e: e
|
|
72
95
|
});
|
|
73
96
|
});
|
|
97
|
+
var handleDrop = useMemoizedFn(function (info, dragInfo) {
|
|
98
|
+
ctx.doAction(advance.events.onCheck, {
|
|
99
|
+
info: info,
|
|
100
|
+
dragInfo: dragInfo
|
|
101
|
+
});
|
|
102
|
+
});
|
|
74
103
|
var events = useCreation(function () {
|
|
75
104
|
if (advance !== null && advance !== void 0 && advance.events) {
|
|
76
105
|
var _events = {};
|
|
@@ -79,24 +108,31 @@ var LCTree = function LCTree(_ref) {
|
|
|
79
108
|
if (advance.events.processDataSource) _events.dataToTreeFormat = handleProcessDataSource;
|
|
80
109
|
if (advance.events.onDoubleClick) _events.onNodeDoubleClick = handleNodeDoubleClick;
|
|
81
110
|
if (advance.events.onCheck) _events.onCheck = handleCheck;
|
|
111
|
+
if (advance.events.onDrop) _events.onDrop = handleDrop;
|
|
82
112
|
return _events;
|
|
83
113
|
}
|
|
84
114
|
return {};
|
|
85
115
|
}, [advance === null || advance === void 0 ? void 0 : advance.events]);
|
|
86
|
-
var
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
// fromId: info.dragNode.props.dataRef[PRIMARY],
|
|
93
|
-
// toId: info.node.props.dataRef[PRIMARY],
|
|
94
|
-
// }
|
|
95
|
-
// }, {
|
|
96
|
-
// showConfirm: false,
|
|
97
|
-
// callback: (success) => success && onLdQuery()
|
|
98
|
-
// });
|
|
116
|
+
var handleSelect = useMemoizedFn(function (_selectedKeys, e) {
|
|
117
|
+
if (cancelSelect || e.selected) {
|
|
118
|
+
setSelectedKeys(_selectedKeys);
|
|
119
|
+
ctx.setPagePublicResource(_defineProperty({}, id, {
|
|
120
|
+
selectedNodes: e.selectedNodes
|
|
121
|
+
}));
|
|
99
122
|
}
|
|
123
|
+
ctx.doAction(advance.events.onSelect, {
|
|
124
|
+
checkedKeys: _selectedKeys,
|
|
125
|
+
e: e
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
var afterInit = useMemoizedFn(function (treeData, data) {
|
|
129
|
+
var selected = !isNil(defaultSelect) ? executeCode(ctx, defaultSelect, ['treeData'], treeData) : null;
|
|
130
|
+
selected && handleSelect(selected, {
|
|
131
|
+
selected: true,
|
|
132
|
+
selectedNodes: selected.map(function (key) {
|
|
133
|
+
return keyBy(data, PRIMARY)[key];
|
|
134
|
+
})
|
|
135
|
+
});
|
|
100
136
|
});
|
|
101
137
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
102
138
|
id: id,
|
|
@@ -125,6 +161,7 @@ var LCTree = function LCTree(_ref) {
|
|
|
125
161
|
return ctx.doAction(rootAddSetting.actionPool);
|
|
126
162
|
}
|
|
127
163
|
} : null,
|
|
164
|
+
onlyRoot: onlyRoot,
|
|
128
165
|
rightMenus: function rightMenus() {
|
|
129
166
|
return actions.todoList.map(function (action) {
|
|
130
167
|
return {
|
|
@@ -173,7 +210,9 @@ var LCTree = function LCTree(_ref) {
|
|
|
173
210
|
onTreeNodeRender: onTreeNodeRender ? function (title, i) {
|
|
174
211
|
return executeCode(ctx, onTreeNodeRender, ['title', 'item'], title, i);
|
|
175
212
|
} : null,
|
|
176
|
-
|
|
213
|
+
selectedKeys: selectedKeys,
|
|
214
|
+
onSelect: handleSelect,
|
|
215
|
+
afterInit: afterInit
|
|
177
216
|
}, events, props))));
|
|
178
217
|
};
|
|
179
218
|
LCTree.propTypes = {
|
|
@@ -257,6 +296,11 @@ LCTree.propTypes = {
|
|
|
257
296
|
* @type bool
|
|
258
297
|
*/
|
|
259
298
|
showRootAdd: PropTypes.bool,
|
|
299
|
+
/**
|
|
300
|
+
* @name 是否只有唯一一个根节点
|
|
301
|
+
* @type bool
|
|
302
|
+
*/
|
|
303
|
+
onlyRoot: PropTypes.bool,
|
|
260
304
|
/**
|
|
261
305
|
* @name 根节点配置
|
|
262
306
|
* @type object
|
|
@@ -325,7 +369,12 @@ LCTree.propTypes = {
|
|
|
325
369
|
* @name 复选框选择事件
|
|
326
370
|
* @type _JSEditor
|
|
327
371
|
*/
|
|
328
|
-
onCheck: PropTypes.string
|
|
372
|
+
onCheck: PropTypes.string,
|
|
373
|
+
/**
|
|
374
|
+
* @name 选中事件
|
|
375
|
+
* @type _JSEditor
|
|
376
|
+
*/
|
|
377
|
+
onSelect: PropTypes.string
|
|
329
378
|
};
|
|
330
379
|
LCTree.defaultProps = omitBadProps(defaultMeta);
|
|
331
380
|
export default /*#__PURE__*/forwardRef(function (props, ref) {
|
|
@@ -17,7 +17,18 @@
|
|
|
17
17
|
"key": "dataset",
|
|
18
18
|
"name": "数据集",
|
|
19
19
|
"desc": "选择系统中的可用树形数据集",
|
|
20
|
-
"type": "_DataSetSelector"
|
|
20
|
+
"type": "_DataSetSelector",
|
|
21
|
+
"next": {
|
|
22
|
+
"name": "字段配置",
|
|
23
|
+
"props": [
|
|
24
|
+
{
|
|
25
|
+
"key": "fields",
|
|
26
|
+
"name": "#字段配置器",
|
|
27
|
+
"type": "_FieldsSetting",
|
|
28
|
+
"component": "tree"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
21
32
|
},
|
|
22
33
|
{
|
|
23
34
|
"key": "title",
|
|
@@ -118,6 +129,31 @@
|
|
|
118
129
|
"default": "0"
|
|
119
130
|
}
|
|
120
131
|
]
|
|
132
|
+
}, {
|
|
133
|
+
"key": "selectSetting",
|
|
134
|
+
"name": "选中设置",
|
|
135
|
+
"type": "group",
|
|
136
|
+
"props": [
|
|
137
|
+
{
|
|
138
|
+
"key": "cancelSelect",
|
|
139
|
+
"name": "取消选中",
|
|
140
|
+
"desc": "是否可以取消选中",
|
|
141
|
+
"type": "switch",
|
|
142
|
+
"default": true
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"key": "defaultSelect",
|
|
146
|
+
"name": "默认选中",
|
|
147
|
+
"desc": "返回默认选中的数据主键",
|
|
148
|
+
"type": "_JSEditor",
|
|
149
|
+
"defaultCode": "function defaultSelect(treeData) { \n return []; \n}",
|
|
150
|
+
"mustConfirm": true,
|
|
151
|
+
"wrapper": "collapse",
|
|
152
|
+
"wrapperProps": {
|
|
153
|
+
"suppressIcon": true
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
]
|
|
121
157
|
},
|
|
122
158
|
{
|
|
123
159
|
"key": "IconSetting",
|
|
@@ -168,6 +204,13 @@
|
|
|
168
204
|
"type": "switch",
|
|
169
205
|
"default": true
|
|
170
206
|
},
|
|
207
|
+
{
|
|
208
|
+
"key": "onlyRoot",
|
|
209
|
+
"name": "根节点唯一",
|
|
210
|
+
"desc": "树组件仅一个根节点,如数据根节点数大于0,则不允许根节点新增",
|
|
211
|
+
"type": "switch",
|
|
212
|
+
"default": false
|
|
213
|
+
},
|
|
171
214
|
{
|
|
172
215
|
"key": "rootAddSetting",
|
|
173
216
|
"name": "根节点配置",
|
|
@@ -270,32 +313,44 @@
|
|
|
270
313
|
"key": "onMount",
|
|
271
314
|
"name": "组件首次渲染时",
|
|
272
315
|
"desc": "在组件首次渲染时,执行方法",
|
|
273
|
-
"func": "(params)
|
|
316
|
+
"func": "function onMount(params) {\n\t\n}"
|
|
274
317
|
},
|
|
275
318
|
{
|
|
276
319
|
"key": "onUnmount",
|
|
277
320
|
"name": "组件卸载时",
|
|
278
321
|
"desc": "在组件卸载时,执行方法。",
|
|
279
|
-
"func": "()
|
|
322
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
280
323
|
},
|
|
281
324
|
{
|
|
282
325
|
"key": "processDataSource",
|
|
283
326
|
"name": "数据预处理",
|
|
284
327
|
"desc": "数据渲染前预处理",
|
|
285
|
-
"func": "(data)
|
|
328
|
+
"func": "function processDataSource(data) {\n\t\n}"
|
|
286
329
|
},
|
|
287
330
|
{
|
|
288
331
|
"key": "onDoubleClick",
|
|
289
332
|
"name": "双击事件",
|
|
290
333
|
"desc": "树节点双击事件",
|
|
291
|
-
"func": "(e, rowData)
|
|
334
|
+
"func": "function onDoubleClick(e, rowData) {\n\t\n}"
|
|
292
335
|
},
|
|
293
336
|
{
|
|
294
337
|
"key": "onCheck",
|
|
295
338
|
"name": "复选框选择事件",
|
|
296
339
|
"desc": "点击复选框触发",
|
|
297
|
-
"func": "(checkedKeys, e)
|
|
340
|
+
"func": "function onCheck(checkedKeys, e) {\n\t\n}"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"key": "onSelect",
|
|
344
|
+
"name": "选中事件",
|
|
345
|
+
"desc": "节点选中事件",
|
|
346
|
+
"func": "function onSelect(checkedKeys, e) {\n\t\n}"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"key": "onDrop",
|
|
350
|
+
"name": "拖拽事件",
|
|
351
|
+
"desc": "节点拖拽事件",
|
|
352
|
+
"func": "function onDrop(info, dragInfo) {\n\t\n}"
|
|
298
353
|
}
|
|
299
354
|
]
|
|
300
355
|
}
|
|
301
|
-
}
|
|
356
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
2
|
import React, { useEffect } from 'react';
|
|
4
3
|
import { useLatest, useCreation } from 'ahooks';
|
|
5
4
|
import { omit } from 'lodash';
|
|
6
|
-
import { useContext,
|
|
7
|
-
import { findNodeAndParent, getPathNodesById } from "../../engine/tools/dataProcess";
|
|
5
|
+
import { useContext, useGet, getLevelNodes as _getLevelNodes, getSelfAndParent } from "../../engine/provider/ContextProvider";
|
|
8
6
|
import { LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT, RUNTIME } from "../../constants";
|
|
9
7
|
import DragDropWrapper from "../../painter/components/DragDrop/DragDropWrapper";
|
|
10
8
|
var LCWrapper = function LCWrapper(_ref) {
|
|
@@ -14,23 +12,23 @@ var LCWrapper = function LCWrapper(_ref) {
|
|
|
14
12
|
getTargetDom = _ref.getTargetDom,
|
|
15
13
|
api = _ref.api;
|
|
16
14
|
var ctx = useContext();
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
15
|
+
var selfData = useGet({
|
|
16
|
+
id: id
|
|
17
|
+
});
|
|
18
|
+
var _selfData = useLatest(selfData);
|
|
21
19
|
useCreation(function () {
|
|
22
20
|
var meta = displayName ? require("../../engine/meta/".concat(displayName.toLowerCase(), ".props.json")) : {};
|
|
23
21
|
var _api = {
|
|
24
22
|
self: children,
|
|
25
23
|
getSelfData: function getSelfData() {
|
|
26
|
-
return
|
|
24
|
+
return _selfData.current;
|
|
27
25
|
},
|
|
28
26
|
getSelfDom: getTargetDom,
|
|
29
|
-
|
|
30
|
-
return
|
|
27
|
+
getSelfAndParentData: function getSelfAndParentData() {
|
|
28
|
+
return getSelfAndParent(id);
|
|
31
29
|
},
|
|
32
30
|
getLevelNodes: function getLevelNodes() {
|
|
33
|
-
return
|
|
31
|
+
return _getLevelNodes(id);
|
|
34
32
|
}
|
|
35
33
|
};
|
|
36
34
|
ctx._register(id, new Proxy({
|
package/es/services.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import { stringify } from 'querystring';
|
|
4
3
|
import { request } from '@luck-design-biz/base/utils';
|
|
5
4
|
import api from "@/services/ApiConfig";
|
|
6
5
|
export function readModlue(_x) {
|
|
@@ -21,27 +20,4 @@ function _readModlue() {
|
|
|
21
20
|
}, _callee);
|
|
22
21
|
}));
|
|
23
22
|
return _readModlue.apply(this, arguments);
|
|
24
|
-
}
|
|
25
|
-
export function readBehaviorCall(_x2, _x3) {
|
|
26
|
-
return _readBehaviorCall.apply(this, arguments);
|
|
27
|
-
}
|
|
28
|
-
function _readBehaviorCall() {
|
|
29
|
-
_readBehaviorCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(get, post) {
|
|
30
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
31
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
32
|
-
case 0:
|
|
33
|
-
return _context2.abrupt("return", request("".concat(api.API_HOST, "/lowcode/to/behavior/call?").concat(stringify(get)), {
|
|
34
|
-
method: 'POST',
|
|
35
|
-
body: post,
|
|
36
|
-
headers: {
|
|
37
|
-
'Content-Type': 'application/json;charset=UTF-8'
|
|
38
|
-
}
|
|
39
|
-
}));
|
|
40
|
-
case 1:
|
|
41
|
-
case "end":
|
|
42
|
-
return _context2.stop();
|
|
43
|
-
}
|
|
44
|
-
}, _callee2);
|
|
45
|
-
}));
|
|
46
|
-
return _readBehaviorCall.apply(this, arguments);
|
|
47
23
|
}
|
|
Binary file
|