@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,60 +1,155 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _ahooks = require("ahooks");
|
|
14
14
|
var _antd = require("luck-design/antd");
|
|
15
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
+
var _index = require("../../../../index");
|
|
18
|
+
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
19
|
+
var _usePromiseState5 = _interopRequireDefault(require("../../../engine/tools/usePromiseState"));
|
|
16
20
|
var _Wrapper = _interopRequireDefault(require("../Wrapper"));
|
|
17
|
-
var
|
|
18
|
-
var
|
|
21
|
+
var _index2 = _interopRequireDefault(require("./index.less"));
|
|
22
|
+
var Footer = _styledComponents.default.div.withConfig({
|
|
23
|
+
displayName: "Footer",
|
|
24
|
+
componentId: "luckda-6530__sc-1aeozvd-0"
|
|
25
|
+
})(["width:100%;display:flex;justify-content:flex-end;"]);
|
|
19
26
|
var LCDialog = function LCDialog(_ref) {
|
|
20
27
|
var id = _ref.id,
|
|
21
28
|
children = _ref.children,
|
|
29
|
+
title = _ref.title,
|
|
30
|
+
width = _ref.width,
|
|
31
|
+
height = _ref.height,
|
|
22
32
|
getContainer = _ref.getContainer,
|
|
23
33
|
wrapClassName = _ref.wrapClassName,
|
|
24
34
|
maskStyle = _ref.maskStyle,
|
|
25
|
-
|
|
35
|
+
defaultOpen = _ref.defaultOpen,
|
|
36
|
+
mask = _ref.mask,
|
|
37
|
+
okText = _ref.okText,
|
|
38
|
+
cancelText = _ref.cancelText,
|
|
39
|
+
footer = _ref.footer,
|
|
40
|
+
btnGroup = _ref.btnGroup,
|
|
41
|
+
advance = _ref.advance;
|
|
42
|
+
var ctx = (0, _ContextProvider.useContext)();
|
|
26
43
|
var apiRef = (0, _react.useRef)();
|
|
27
44
|
var domRef = (0, _react.useRef)();
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
open =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
var _usePromiseState = (0, _usePromiseState5.default)(defaultOpen),
|
|
46
|
+
_usePromiseState2 = (0, _slicedToArray2.default)(_usePromiseState, 2),
|
|
47
|
+
open = _usePromiseState2[0],
|
|
48
|
+
setOpen = _usePromiseState2[1];
|
|
49
|
+
var _usePromiseState3 = (0, _usePromiseState5.default)(title),
|
|
50
|
+
_usePromiseState4 = (0, _slicedToArray2.default)(_usePromiseState3, 2),
|
|
51
|
+
_title = _usePromiseState4[0],
|
|
52
|
+
_setTitle = _usePromiseState4[1];
|
|
53
|
+
(0, _react.useEffect)(function () {
|
|
54
|
+
ctx.doAction(advance.events.onMount);
|
|
55
|
+
return function () {
|
|
56
|
+
_setTitle(title);
|
|
57
|
+
ctx.doAction(advance.events.onUnmount);
|
|
58
|
+
};
|
|
59
|
+
}, []);
|
|
60
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
61
|
+
if (open) {
|
|
62
|
+
ctx.doAction(advance.events.onOpen);
|
|
63
|
+
} else {
|
|
64
|
+
ctx.doAction(advance.events.onClose);
|
|
65
|
+
}
|
|
66
|
+
}, [open]);
|
|
67
|
+
var handleOk = (0, _ahooks.useMemoizedFn)(function () {
|
|
68
|
+
ctx.doAction(advance.events.onOk);
|
|
69
|
+
});
|
|
70
|
+
var _footer = (0, _ahooks.useCreation)(function () {
|
|
71
|
+
var _btnGroup$todoList;
|
|
72
|
+
if (!footer) return {
|
|
73
|
+
footer: null
|
|
74
|
+
};
|
|
75
|
+
if (!(btnGroup !== null && btnGroup !== void 0 && (_btnGroup$todoList = btnGroup.todoList) !== null && _btnGroup$todoList !== void 0 && _btnGroup$todoList.length)) return {};
|
|
76
|
+
return {
|
|
77
|
+
footer: /*#__PURE__*/_react.default.createElement(Footer, null, /*#__PURE__*/_react.default.createElement(_index.LDActions, (0, _extends2.default)({}, btnGroup, {
|
|
78
|
+
doAction: function doAction(action) {
|
|
79
|
+
return ctx.doAction(action);
|
|
80
|
+
}
|
|
81
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
82
|
+
onClick: function onClick() {
|
|
83
|
+
return setOpen(false);
|
|
84
|
+
},
|
|
85
|
+
style: {
|
|
86
|
+
marginLeft: 8
|
|
87
|
+
}
|
|
88
|
+
}, cancelText), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
89
|
+
type: "primary",
|
|
90
|
+
onClick: handleOk
|
|
91
|
+
}, okText))
|
|
92
|
+
};
|
|
93
|
+
}, [footer, btnGroup]);
|
|
35
94
|
var getTargetDom = (0, _ahooks.useMemoizedFn)(function () {
|
|
36
95
|
var _domRef$current;
|
|
37
96
|
return (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.closest('.ant-modal-content');
|
|
38
97
|
});
|
|
39
98
|
(0, _react.useImperativeHandle)(apiRef, function () {
|
|
40
99
|
return {
|
|
100
|
+
/**
|
|
101
|
+
* 弹窗打开状态
|
|
102
|
+
* @property
|
|
103
|
+
*/
|
|
41
104
|
open: open,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
105
|
+
/**
|
|
106
|
+
* 打开弹窗
|
|
107
|
+
* @method
|
|
108
|
+
*/
|
|
109
|
+
doOpen: function doOpen() {
|
|
110
|
+
return setOpen(true);
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* 关闭弹窗
|
|
114
|
+
* @method
|
|
115
|
+
*/
|
|
116
|
+
doClose: function doClose() {
|
|
117
|
+
return setOpen(false);
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* 设置弹窗标题
|
|
121
|
+
* @method
|
|
122
|
+
* @param {stirng} title -标题
|
|
123
|
+
*/
|
|
124
|
+
setTitle: function setTitle(_title) {
|
|
125
|
+
return _setTitle(_title);
|
|
126
|
+
}
|
|
45
127
|
};
|
|
46
|
-
});
|
|
128
|
+
}, []);
|
|
47
129
|
return /*#__PURE__*/_react.default.createElement(_Wrapper.default, {
|
|
48
130
|
id: id,
|
|
49
131
|
displayName: "Dialog",
|
|
50
132
|
getTargetDom: getTargetDom,
|
|
51
133
|
api: apiRef
|
|
52
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Modal, {
|
|
134
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Modal, (0, _extends2.default)({
|
|
135
|
+
title: _title,
|
|
53
136
|
visible: open,
|
|
54
137
|
getContainer: getContainer,
|
|
138
|
+
width: width,
|
|
139
|
+
mask: mask,
|
|
55
140
|
maskStyle: maskStyle,
|
|
56
|
-
|
|
57
|
-
|
|
141
|
+
bodyStyle: {
|
|
142
|
+
height: height,
|
|
143
|
+
overflowY: 'auto',
|
|
144
|
+
marginTop: 0
|
|
145
|
+
},
|
|
146
|
+
wrapClassName: (0, _classnames.default)(_index2.default['lc-component-dialog-wrapper'], (0, _defineProperty2.default)({}, wrapClassName, !!wrapClassName))
|
|
147
|
+
}, _footer, {
|
|
148
|
+
onOk: handleOk,
|
|
149
|
+
onCancel: function onCancel() {
|
|
150
|
+
return setOpen(false);
|
|
151
|
+
}
|
|
152
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
58
153
|
style: {
|
|
59
154
|
height: 0,
|
|
60
155
|
width: 0,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"props": [
|
|
10
10
|
{
|
|
11
11
|
"key": "id",
|
|
12
|
-
"
|
|
12
|
+
"name": "唯一标识",
|
|
13
13
|
"type": "string",
|
|
14
14
|
"disabled": true
|
|
15
15
|
},
|
|
@@ -22,65 +22,88 @@
|
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"key": "width",
|
|
25
|
-
"name": "
|
|
26
|
-
"
|
|
27
|
-
"
|
|
25
|
+
"name": "对话框宽度",
|
|
26
|
+
"type": "_WidthHeight",
|
|
27
|
+
"options": [
|
|
28
|
+
{
|
|
29
|
+
"label": "px",
|
|
30
|
+
"value": "px"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"label": "%",
|
|
34
|
+
"value": "%"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"label": "vw",
|
|
38
|
+
"value": "vw"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "A",
|
|
42
|
+
"value": "auto"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
28
45
|
"default": "700px"
|
|
29
46
|
},
|
|
30
47
|
{
|
|
31
48
|
"key": "height",
|
|
32
|
-
"name": "
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"default": true
|
|
49
|
+
"name": "内容区高度",
|
|
50
|
+
"type": "_WidthHeight",
|
|
51
|
+
"options": [
|
|
52
|
+
{
|
|
53
|
+
"label": "px",
|
|
54
|
+
"value": "px"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"label": "vh",
|
|
58
|
+
"value": "vh"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"label": "A",
|
|
62
|
+
"value": "auto"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"default": "50vh"
|
|
50
66
|
},
|
|
51
67
|
{
|
|
52
68
|
"key": "defaultOpen",
|
|
53
69
|
"name": "默认显示",
|
|
54
70
|
"desc": "默认是否显示",
|
|
55
|
-
"type": "
|
|
71
|
+
"type": "switch",
|
|
56
72
|
"default": false
|
|
57
73
|
},
|
|
58
74
|
{
|
|
59
75
|
"key": "mask",
|
|
60
76
|
"name": "显示遮罩",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"default": false
|
|
77
|
+
"type": "switch",
|
|
78
|
+
"default": true
|
|
64
79
|
},
|
|
65
80
|
{
|
|
66
|
-
"key": "
|
|
67
|
-
"name": "
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
|
|
81
|
+
"key": "okText",
|
|
82
|
+
"name": "确认文字",
|
|
83
|
+
"type": "_I18nInput",
|
|
84
|
+
"default": "确定"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"key": "cancelText",
|
|
88
|
+
"name": "取消文字",
|
|
89
|
+
"type": "_I18nInput",
|
|
90
|
+
"default": "取消"
|
|
71
91
|
},
|
|
72
92
|
{
|
|
73
93
|
"key": "footer",
|
|
74
|
-
"name": "
|
|
94
|
+
"name": "显示footer",
|
|
75
95
|
"desc": "是否显示底部按钮区域",
|
|
76
|
-
"type": "
|
|
96
|
+
"type": "switch",
|
|
77
97
|
"default": true
|
|
78
98
|
},
|
|
79
99
|
{
|
|
80
100
|
"key": "btnGroup",
|
|
81
101
|
"name": "按钮组",
|
|
82
102
|
"desc": "底部按钮区域的按钮组(参考按钮配置)",
|
|
83
|
-
"type": "
|
|
103
|
+
"type": "_ActionsEditor",
|
|
104
|
+
"default": { "display": "button", "max": 2, "moreText": "操作", "todoList": [] },
|
|
105
|
+
"wrapper": "collapse",
|
|
106
|
+
"wrapperProps": { "suppressIcon": true }
|
|
84
107
|
}
|
|
85
108
|
],
|
|
86
109
|
"advance": {
|
|
@@ -89,31 +112,31 @@
|
|
|
89
112
|
"key": "onMount",
|
|
90
113
|
"name": "组件首次渲染时",
|
|
91
114
|
"desc": "在组件首次渲染时,执行方法",
|
|
92
|
-
"func": "(
|
|
115
|
+
"func": "function onMount() {\n\t\n}"
|
|
93
116
|
},
|
|
94
117
|
{
|
|
95
118
|
"key": "onUnmount",
|
|
96
119
|
"name": "组件卸载时",
|
|
97
120
|
"desc": "在组件卸载时,执行方法。",
|
|
98
|
-
"func": "(
|
|
121
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
99
122
|
},
|
|
100
123
|
{
|
|
101
124
|
"key": "onOpen",
|
|
102
125
|
"name": "对话框打开时",
|
|
103
126
|
"desc": "在对话框打开时,执行方法",
|
|
104
|
-
"func": "(
|
|
127
|
+
"func": "function onOpen() {\n\t\n}"
|
|
105
128
|
},
|
|
106
129
|
{
|
|
107
130
|
"key": "onClose",
|
|
108
131
|
"name": "对话框关闭时",
|
|
109
132
|
"desc": "在对话框打开时,执行方法,promise反馈false无法截断关闭",
|
|
110
|
-
"func": "(
|
|
133
|
+
"func": "function onClose() {\n\t\n}"
|
|
111
134
|
},
|
|
112
135
|
{
|
|
113
|
-
"key": "
|
|
114
|
-
"name": "
|
|
115
|
-
"desc": "
|
|
116
|
-
"func": "(
|
|
136
|
+
"key": "onOk",
|
|
137
|
+
"name": "确定按钮点击",
|
|
138
|
+
"desc": "点击确定按钮时,执行方法",
|
|
139
|
+
"func": "function onOk() {\n\t\n}"
|
|
117
140
|
}
|
|
118
141
|
]
|
|
119
142
|
}
|
|
@@ -100,43 +100,31 @@
|
|
|
100
100
|
"key": "onMount",
|
|
101
101
|
"name": "组件首次渲染时",
|
|
102
102
|
"desc": "在组件首次渲染时,执行方法",
|
|
103
|
-
"func": "(
|
|
103
|
+
"func": "function onMount() {\n\t\n}"
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
"key": "onUnmount",
|
|
107
107
|
"name": "组件卸载时",
|
|
108
108
|
"desc": "在组件卸载时,执行方法。",
|
|
109
|
-
"func": "(
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"key": "onMount",
|
|
113
|
-
"name": "组件首次渲染时",
|
|
114
|
-
"desc": "在组件首次渲染时,执行方法",
|
|
115
|
-
"func": "(params)=>{\n\t\n}"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"key": "onUnmount",
|
|
119
|
-
"name": "组件卸载时",
|
|
120
|
-
"desc": "在组件卸载时,执行方法。",
|
|
121
|
-
"func": "(params)=>{\n\t\n}"
|
|
109
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
122
110
|
},
|
|
123
111
|
{
|
|
124
112
|
"key": "onOpen",
|
|
125
113
|
"name": "抽屉打开时",
|
|
126
114
|
"desc": "在抽屉打开时,执行方法",
|
|
127
|
-
"func": "(
|
|
115
|
+
"func": "function onOpen() {\n\t\n}"
|
|
128
116
|
},
|
|
129
117
|
{
|
|
130
118
|
"key": "onClose",
|
|
131
119
|
"name": "抽屉关闭时",
|
|
132
120
|
"desc": "在抽屉打开时,执行方法,promise反馈false无法截断关闭",
|
|
133
|
-
"func": "(
|
|
121
|
+
"func": "function onClose() {\n\t\n}"
|
|
134
122
|
},
|
|
135
123
|
{
|
|
136
|
-
"key": "
|
|
137
|
-
"name": "
|
|
138
|
-
"desc": "
|
|
139
|
-
"func": "(
|
|
124
|
+
"key": "onOk",
|
|
125
|
+
"name": "确定按钮点击",
|
|
126
|
+
"desc": "点击确定按钮时,执行方法",
|
|
127
|
+
"func": "function onOk() {\n\t\n}"
|
|
140
128
|
}
|
|
141
129
|
]
|
|
142
130
|
}
|
|
@@ -16,7 +16,6 @@ var _ahooks = require("ahooks");
|
|
|
16
16
|
var _lodash = require("lodash");
|
|
17
17
|
var _utils = require("@luck-design-biz/base/utils");
|
|
18
18
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
19
|
-
var _dataProcess = require("../../../engine/tools/dataProcess");
|
|
20
19
|
var _boxPropsDefault = _interopRequireDefault(require("../../../engine/meta/box.props.default.json"));
|
|
21
20
|
var _index = _interopRequireDefault(require("./index"));
|
|
22
21
|
var _excluded = ["children", "blocks", "id"];
|
|
@@ -27,38 +26,32 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
27
26
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
28
27
|
var ref = (0, _react.useRef)(null);
|
|
29
28
|
var ctx = (0, _ContextProvider.useContext)();
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
var current = (0, _ContextProvider.useGet)({
|
|
30
|
+
id: id
|
|
31
|
+
});
|
|
33
32
|
var previousBlocks = (0, _ahooks.usePrevious)((0, _lodash.cloneDeep)(blocks), function (prev, next) {
|
|
34
33
|
return !(0, _lodash.isEqual)(prev, next);
|
|
35
34
|
});
|
|
36
35
|
(0, _ahooks.useUpdateLayoutEffect)(function () {
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
gridApi = _ctx$componentMap$get.gridApi;
|
|
52
|
-
gridApi.api.refreshCells({
|
|
53
|
-
columns: ['luck-actions'],
|
|
54
|
-
force: true
|
|
55
|
-
});
|
|
36
|
+
var blocksObj = (0, _lodash.keyBy)(blocks, 'id');
|
|
37
|
+
var previousBlocksObj = (0, _lodash.keyBy)(previousBlocks, 'id');
|
|
38
|
+
(0, _lodash.forEach)(blocksObj, function (value, key) {
|
|
39
|
+
var _value$dataset, _previousBlocksObj$ke, _value$dataset2, _previousBlocksObj$ke2;
|
|
40
|
+
if (((_value$dataset = value.dataset) === null || _value$dataset === void 0 ? void 0 : _value$dataset.code) !== ((_previousBlocksObj$ke = previousBlocksObj[key]) === null || _previousBlocksObj$ke === void 0 || (_previousBlocksObj$ke = _previousBlocksObj$ke.dataset) === null || _previousBlocksObj$ke === void 0 ? void 0 : _previousBlocksObj$ke.code)) ((_value$dataset2 = value.dataset) === null || _value$dataset2 === void 0 ? void 0 : _value$dataset2.code) && ref.current.doQueryOne(key);
|
|
41
|
+
if (value.actionsColumnReset !== ((_previousBlocksObj$ke2 = previousBlocksObj[key]) === null || _previousBlocksObj$ke2 === void 0 ? void 0 : _previousBlocksObj$ke2.actionsColumnReset)) {
|
|
42
|
+
var _ctx$componentMap$get2;
|
|
43
|
+
var _ctx$componentMap$get = (_ctx$componentMap$get2 = ctx.componentMap.get(id)) === null || _ctx$componentMap$get2 === void 0 ? void 0 : _ctx$componentMap$get2.api.getForm().getFormRef(key).formRef.current,
|
|
44
|
+
gridApi = _ctx$componentMap$get.gridApi;
|
|
45
|
+
gridApi.api.refreshCells({
|
|
46
|
+
columns: ['luck-actions'],
|
|
47
|
+
force: true
|
|
48
|
+
});
|
|
49
|
+
}
|
|
56
50
|
});
|
|
57
51
|
}, [JSON.stringify(blocks)]);
|
|
58
52
|
(0, _react.useEffect)(function () {
|
|
59
53
|
var cmid = ctx.$subscriber(ctx.topics.COMPONENT_MODIFY).on(function (_ref2) {
|
|
60
54
|
var compId = _ref2.id,
|
|
61
|
-
pageData = _ref2.pageData,
|
|
62
55
|
newValue = _ref2.newValue,
|
|
63
56
|
oldValue = _ref2.oldValue;
|
|
64
57
|
if (compId !== id || !newValue.hasOwnProperty('blocks')) return;
|
|
@@ -68,25 +61,21 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
68
61
|
newItem = _differenceBy2[0];
|
|
69
62
|
if (newItem.type === 'blank') {
|
|
70
63
|
var boxId = "box_".concat((0, _utils.suid)());
|
|
71
|
-
(0,
|
|
64
|
+
(0, _ContextProvider.addNode)(id, boxId, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _boxPropsDefault.default), {}, {
|
|
72
65
|
buildIn: true,
|
|
73
66
|
formBoxId: newItem.id
|
|
74
67
|
}));
|
|
75
|
-
setPageData(pageData);
|
|
76
68
|
}
|
|
77
69
|
} else if (newValue.blocks.length < oldValue.blocks.length) {
|
|
78
70
|
var _differenceBy3 = (0, _lodash.differenceBy)(oldValue.blocks, newValue.blocks, 'id'),
|
|
79
71
|
_differenceBy4 = (0, _slicedToArray2.default)(_differenceBy3, 1),
|
|
80
72
|
removeItem = _differenceBy4[0];
|
|
81
73
|
if (removeItem.type === 'blank') {
|
|
82
|
-
var _findNodeAndParent = (0, _dataProcess.findNodeAndParent)(id, pageData),
|
|
83
|
-
current = _findNodeAndParent.node;
|
|
84
74
|
var _boxId = current.children.find(function (childId) {
|
|
85
|
-
return current[childId].props.
|
|
75
|
+
return current[childId].props.formBoxId === removeItem.id;
|
|
86
76
|
});
|
|
87
77
|
ctx.$publisher(ctx.topics.COMPONENT_DELETE, {
|
|
88
|
-
id: _boxId
|
|
89
|
-
pageData: pageData
|
|
78
|
+
id: _boxId
|
|
90
79
|
});
|
|
91
80
|
}
|
|
92
81
|
}
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
11
|
var _react = _interopRequireDefault(require("react"));
|
|
10
12
|
var _index = _interopRequireDefault(require("./index"));
|
|
@@ -12,6 +14,11 @@ var _excluded = ["children"];
|
|
|
12
14
|
var FunctionPreview = function FunctionPreview(_ref) {
|
|
13
15
|
var children = _ref.children,
|
|
14
16
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
15
|
-
return /*#__PURE__*/_react.default.createElement(_index.default, props,
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({}, props, {
|
|
18
|
+
initData: {
|
|
19
|
+
formMode: 'update',
|
|
20
|
+
ticketData: (0, _defineProperty2.default)({}, window.appConfig.constraintKeys.PRIMARY, 'test')
|
|
21
|
+
}
|
|
22
|
+
}), children);
|
|
16
23
|
};
|
|
17
24
|
var _default = exports.default = FunctionPreview;
|