@luck-design-biz/luckda 0.0.22 → 0.0.23
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/LICENSE +21 -21
- package/README.md +40 -49
- package/es/components/Builder/index.js +4 -4
- package/es/components/LdAutoForm/index.js +7 -9
- package/es/components/LdCard/index.js +5 -6
- package/es/components/LdCard/model.js +1 -1
- package/es/components/LdCom/index.js +2 -2
- package/es/components/LdFormList/index.js +19 -17
- package/es/components/LdGrid/index.js +11 -12
- package/es/components/LdGrid/model.js +1 -1
- package/es/components/LdGridForm/index.js +10 -10
- package/es/components/LdGridForm/index.less +7 -7
- package/es/components/LdInfoPanel/index.js +2 -2
- package/es/components/LdRuntimeCom/index.js +42 -0
- package/es/components/LdTree/index.js +3 -4
- package/es/components/LdTree/index.less +36 -36
- package/es/helper/FromItems.js +1 -1
- package/es/helper/action.js +8 -8
- package/es/helper/form.js +16 -16
- package/es/helper/index.less +7 -7
- package/es/helper/ldBuilder.js +1 -1
- package/es/helper/ldComBuild.js +4 -4
- package/es/index.js +10 -9
- package/es/lowcode/constants/api-url.js +2 -0
- package/es/lowcode/constants/event-topics.js +23 -0
- package/es/lowcode/constants/index.js +12 -0
- package/es/lowcode/engine/factory/DataFactory.js +1 -0
- package/es/lowcode/engine/meta/button.props.default.json +8 -0
- package/es/lowcode/engine/meta/cardlist.props.default.json +10 -0
- package/es/lowcode/engine/meta/components/button.json +104 -0
- package/es/lowcode/engine/meta/components/card-list.json +143 -0
- package/es/lowcode/engine/meta/components/drawer.json +143 -0
- package/es/lowcode/engine/meta/components/form.json +116 -0
- package/es/lowcode/engine/meta/components/iframe.json +31 -0
- package/es/lowcode/engine/meta/components/image.json +113 -0
- package/es/lowcode/engine/meta/components/imex.json +81 -0
- package/es/lowcode/engine/meta/components/jsx.json +24 -0
- package/es/lowcode/engine/meta/components/layout.json +107 -0
- package/es/lowcode/engine/meta/components/link.json +111 -0
- package/es/lowcode/engine/meta/components/modal.json +120 -0
- package/es/lowcode/engine/meta/components/section.json +107 -0
- package/es/lowcode/engine/meta/components/split.json +71 -0
- package/es/lowcode/engine/meta/components/table.json +161 -0
- package/es/lowcode/engine/meta/components/tabs.json +140 -0
- package/es/lowcode/engine/meta/components/text.json +65 -0
- package/es/lowcode/engine/meta/components/tree.json +156 -0
- package/es/lowcode/engine/meta/components-list.json +122 -0
- package/es/lowcode/engine/meta/drawer.props.default.json +10 -0
- package/es/lowcode/engine/meta/form.props.default.json +5 -0
- package/es/lowcode/engine/meta/iframe.props.default.json +3 -0
- package/es/lowcode/engine/meta/image.props.default.json +8 -0
- package/es/lowcode/engine/meta/imex.props.default.json +4 -0
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -0
- package/es/lowcode/engine/meta/layout.props.default.json +5 -0
- package/es/lowcode/engine/meta/link.props.default.json +6 -0
- package/es/lowcode/engine/meta/modal.props.default.json +11 -0
- package/es/lowcode/engine/meta/section.props.default.json +9 -0
- package/es/lowcode/engine/meta/split.props.default.json +5 -0
- package/es/lowcode/engine/meta/table.props.default.json +10 -0
- package/es/lowcode/engine/meta/tabs.props.default.json +10 -0
- package/es/lowcode/engine/meta/text.props.default.json +4 -0
- package/es/lowcode/engine/meta/tree.props.default.json +9 -0
- package/es/lowcode/engine/provider/ContextProvider.js +164 -0
- package/es/lowcode/engine/provider/EventBusProvider.js +120 -0
- package/es/lowcode/engine/tools/dataProcess.js +188 -0
- package/es/lowcode/engine/tools/helper.js +4 -0
- package/es/lowcode/engine/tools/lcid.js +16 -0
- package/es/lowcode/index.js +3 -0
- package/es/lowcode/painter/Components.js +104 -0
- package/es/lowcode/painter/Design.js +97 -0
- package/es/lowcode/painter/I18n.js +5 -0
- package/es/lowcode/painter/Outline.js +202 -0
- package/es/lowcode/painter/Panel.js +8 -0
- package/es/lowcode/painter/Ribbon.js +136 -0
- package/es/lowcode/painter/components/PanelItem.js +20 -0
- package/es/lowcode/painter/components/RuleInput.js +105 -0
- package/es/lowcode/painter/index.js +19 -0
- package/es/lowcode/painter/panel-section/LayoutRatio.js +123 -0
- package/es/lowcode/painter/panel-section/Radio.js +58 -0
- package/es/lowcode/painter/style/components.less +90 -0
- package/es/lowcode/painter/style/design.less +38 -0
- package/es/lowcode/painter/style/index.less +7 -0
- package/es/lowcode/painter/style/layout-ratio.less +51 -0
- package/es/lowcode/painter/style/outline.less +26 -0
- package/es/lowcode/painter/style/panel-item.less +21 -0
- package/es/lowcode/painter/style/panel.less +5 -0
- package/es/lowcode/painter/style/radio.less +24 -0
- package/es/lowcode/painter/style/ribbon.less +4 -0
- package/es/lowcode/painter/style/rule-input.less +13 -0
- package/es/lowcode/view/Canvas.js +135 -0
- package/es/lowcode/view/Loading.js +23 -0
- package/es/lowcode/view/Page.js +55 -0
- package/es/lowcode/view/index.js +18 -0
- package/es/lowcode/view/lc-components/Box/index.js +21 -0
- package/es/lowcode/view/lc-components/Button/index.js +37 -0
- package/es/lowcode/view/lc-components/CardList/index.js +20 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +50 -0
- package/es/lowcode/view/lc-components/Dialog/index.less +3 -0
- package/es/lowcode/view/lc-components/Drawer/index.js +46 -0
- package/es/lowcode/view/lc-components/Form/index.js +20 -0
- package/es/lowcode/view/lc-components/Iframe/index.js +20 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +20 -0
- package/es/lowcode/view/lc-components/Image/index.js +20 -0
- package/es/lowcode/view/lc-components/JSX/index.js +20 -0
- package/es/lowcode/view/lc-components/Layout/index.js +24 -0
- package/es/lowcode/view/lc-components/Link/index.js +20 -0
- package/es/lowcode/view/lc-components/Section/index.js +34 -0
- package/es/lowcode/view/lc-components/Split/index.js +21 -0
- package/es/lowcode/view/lc-components/Table/index.js +23 -0
- package/es/lowcode/view/lc-components/Tabs/index.js +21 -0
- package/es/lowcode/view/lc-components/Text/index.js +23 -0
- package/es/lowcode/view/lc-components/Tree/index.js +20 -0
- package/es/lowcode/view/lc-components/Wrapper.js +45 -0
- package/es/lowcode/view/style/canvas.less +5 -0
- package/es/lowcode/view/style/loading.less +84 -0
- package/es/lowcode/view/style/page.less +6 -0
- package/es/services.js +1 -1
- package/es/upload/Form/gridForm.js +29 -7
- package/es/upload/Form/index.js +1 -1
- package/es/upload/Form/index.less +7 -7
- package/es/upload/FormItem/index.js +30 -18
- package/es/upload/index.js +3 -3
- package/es/utils/action.js +1 -1
- package/es/utils/form.js +26 -26
- package/es/utils/grid.js +22 -26
- package/es/utils/index.js +3 -3
- package/lib/components/Builder/index.js +3 -5
- package/lib/components/LdAutoForm/index.js +5 -8
- package/lib/components/LdCard/index.js +5 -7
- package/lib/components/LdCom/index.js +6 -11
- package/lib/components/LdFormList/index.js +15 -13
- package/lib/components/LdGrid/index.js +10 -12
- package/lib/components/LdGridForm/index.js +6 -7
- package/lib/components/LdGridForm/index.less +7 -7
- package/lib/components/LdInfoPanel/index.js +2 -3
- package/lib/components/LdPop/index.js +2 -4
- package/lib/components/LdRuntimeCom/index.js +49 -0
- package/lib/components/LdTree/index.js +2 -4
- package/lib/components/LdTree/index.less +36 -36
- package/lib/helper/FromItems.js +15 -29
- package/lib/helper/action.js +9 -11
- package/lib/helper/form.js +18 -20
- package/lib/helper/index.less +7 -7
- package/lib/helper/ldBuilder.js +1 -2
- package/lib/helper/ldComBuild.js +7 -11
- package/lib/index.js +9 -1
- package/lib/lowcode/constants/api-url.js +8 -0
- package/lib/lowcode/constants/event-topics.js +29 -0
- package/lib/lowcode/constants/index.js +18 -0
- package/lib/lowcode/engine/factory/DataFactory.js +3 -0
- package/lib/lowcode/engine/meta/button.props.default.json +8 -0
- package/lib/lowcode/engine/meta/cardlist.props.default.json +10 -0
- package/lib/lowcode/engine/meta/components/button.json +104 -0
- package/lib/lowcode/engine/meta/components/card-list.json +143 -0
- package/lib/lowcode/engine/meta/components/drawer.json +143 -0
- package/lib/lowcode/engine/meta/components/form.json +116 -0
- package/lib/lowcode/engine/meta/components/iframe.json +31 -0
- package/lib/lowcode/engine/meta/components/image.json +113 -0
- package/lib/lowcode/engine/meta/components/imex.json +81 -0
- package/lib/lowcode/engine/meta/components/jsx.json +24 -0
- package/lib/lowcode/engine/meta/components/layout.json +107 -0
- package/lib/lowcode/engine/meta/components/link.json +111 -0
- package/lib/lowcode/engine/meta/components/modal.json +120 -0
- package/lib/lowcode/engine/meta/components/section.json +107 -0
- package/lib/lowcode/engine/meta/components/split.json +71 -0
- package/lib/lowcode/engine/meta/components/table.json +161 -0
- package/lib/lowcode/engine/meta/components/tabs.json +140 -0
- package/lib/lowcode/engine/meta/components/text.json +65 -0
- package/lib/lowcode/engine/meta/components/tree.json +156 -0
- package/lib/lowcode/engine/meta/components-list.json +122 -0
- package/lib/lowcode/engine/meta/drawer.props.default.json +10 -0
- package/lib/lowcode/engine/meta/form.props.default.json +5 -0
- package/lib/lowcode/engine/meta/iframe.props.default.json +3 -0
- package/lib/lowcode/engine/meta/image.props.default.json +8 -0
- package/lib/lowcode/engine/meta/imex.props.default.json +4 -0
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -0
- package/lib/lowcode/engine/meta/layout.props.default.json +5 -0
- package/lib/lowcode/engine/meta/link.props.default.json +6 -0
- package/lib/lowcode/engine/meta/modal.props.default.json +11 -0
- package/lib/lowcode/engine/meta/section.props.default.json +9 -0
- package/lib/lowcode/engine/meta/split.props.default.json +5 -0
- package/lib/lowcode/engine/meta/table.props.default.json +10 -0
- package/lib/lowcode/engine/meta/tabs.props.default.json +10 -0
- package/lib/lowcode/engine/meta/text.props.default.json +4 -0
- package/lib/lowcode/engine/meta/tree.props.default.json +9 -0
- package/lib/lowcode/engine/provider/ContextProvider.js +172 -0
- package/lib/lowcode/engine/provider/EventBusProvider.js +128 -0
- package/lib/lowcode/engine/tools/dataProcess.js +201 -0
- package/lib/lowcode/engine/tools/helper.js +11 -0
- package/lib/lowcode/engine/tools/lcid.js +22 -0
- package/lib/lowcode/index.js +20 -0
- package/lib/lowcode/painter/Components.js +112 -0
- package/lib/lowcode/painter/Design.js +105 -0
- package/lib/lowcode/painter/I18n.js +12 -0
- package/lib/lowcode/painter/Outline.js +210 -0
- package/lib/lowcode/painter/Panel.js +16 -0
- package/lib/lowcode/painter/Ribbon.js +151 -0
- package/lib/lowcode/painter/components/PanelItem.js +26 -0
- package/lib/lowcode/painter/components/RuleInput.js +112 -0
- package/lib/lowcode/painter/index.js +26 -0
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +131 -0
- package/lib/lowcode/painter/panel-section/Radio.js +65 -0
- package/lib/lowcode/painter/style/components.less +90 -0
- package/lib/lowcode/painter/style/design.less +38 -0
- package/lib/lowcode/painter/style/index.less +7 -0
- package/lib/lowcode/painter/style/layout-ratio.less +51 -0
- package/lib/lowcode/painter/style/outline.less +26 -0
- package/lib/lowcode/painter/style/panel-item.less +21 -0
- package/lib/lowcode/painter/style/panel.less +5 -0
- package/lib/lowcode/painter/style/radio.less +24 -0
- package/lib/lowcode/painter/style/ribbon.less +4 -0
- package/lib/lowcode/painter/style/rule-input.less +13 -0
- package/lib/lowcode/view/Canvas.js +150 -0
- package/lib/lowcode/view/Loading.js +30 -0
- package/lib/lowcode/view/Page.js +63 -0
- package/lib/lowcode/view/index.js +25 -0
- package/lib/lowcode/view/lc-components/Box/index.js +29 -0
- package/lib/lowcode/view/lc-components/Button/index.js +45 -0
- package/lib/lowcode/view/lc-components/CardList/index.js +28 -0
- package/lib/lowcode/view/lc-components/Dialog/index.js +58 -0
- package/lib/lowcode/view/lc-components/Dialog/index.less +3 -0
- package/lib/lowcode/view/lc-components/Drawer/index.js +54 -0
- package/lib/lowcode/view/lc-components/Form/index.js +28 -0
- package/lib/lowcode/view/lc-components/Iframe/index.js +28 -0
- package/lib/lowcode/view/lc-components/ImEx/index.js +28 -0
- package/lib/lowcode/view/lc-components/Image/index.js +28 -0
- package/lib/lowcode/view/lc-components/JSX/index.js +28 -0
- package/lib/lowcode/view/lc-components/Layout/index.js +32 -0
- package/lib/lowcode/view/lc-components/Link/index.js +28 -0
- package/lib/lowcode/view/lc-components/Section/index.js +42 -0
- package/lib/lowcode/view/lc-components/Split/index.js +29 -0
- package/lib/lowcode/view/lc-components/Table/index.js +31 -0
- package/lib/lowcode/view/lc-components/Tabs/index.js +29 -0
- package/lib/lowcode/view/lc-components/Text/index.js +31 -0
- package/lib/lowcode/view/lc-components/Tree/index.js +28 -0
- package/lib/lowcode/view/lc-components/Wrapper.js +52 -0
- package/lib/lowcode/view/style/canvas.less +5 -0
- package/lib/lowcode/view/style/loading.less +84 -0
- package/lib/lowcode/view/style/page.less +6 -0
- package/lib/upload/Form/gridForm.js +27 -6
- package/lib/upload/Form/index.js +1 -2
- package/lib/upload/Form/index.less +7 -7
- package/lib/upload/FormItem/index.js +30 -19
- package/lib/upload/GridCell/index.js +1 -2
- package/lib/utils/form.js +26 -29
- package/lib/utils/grid.js +23 -28
- package/lowcode.js +1 -0
- package/package.json +157 -78
- package/upload.js +1 -1
- package/utils.js +1 -1
- package/README.zh-CN.md +0 -51
|
@@ -73,7 +73,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
73
73
|
var _defaultValues = {};
|
|
74
74
|
var _nodes = (0, _lodash.transform)(gridColumns, function (result, col) {
|
|
75
75
|
if (col.isShowInForm) {
|
|
76
|
-
var
|
|
76
|
+
var _customColumn;
|
|
77
77
|
var customColumn = columnsRewrite.find(function (column) {
|
|
78
78
|
return column.field === col.aliaName;
|
|
79
79
|
}) || {};
|
|
@@ -81,7 +81,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
81
81
|
editable: false,
|
|
82
82
|
mode: 'grid'
|
|
83
83
|
});
|
|
84
|
-
_defaultValues = (0, _objectSpread4.default)((0, _objectSpread4.default)({}, _defaultValues), {}, (
|
|
84
|
+
_defaultValues = (0, _objectSpread4.default)((0, _objectSpread4.default)({}, _defaultValues), {}, (0, _defineProperty2.default)((0, _defineProperty2.default)({}, col.aliaName, col['optDefaultValue']), "".concat(col.aliaName, "_virtual"), col['optDefaultValueCvt']));
|
|
85
85
|
result.push((0, _utils.getFormColumn)(type, col, (0, _objectSpread4.default)((0, _objectSpread4.default)({}, customColumn), {}, {
|
|
86
86
|
formItemRewrite: (0, _objectSpread4.default)((0, _objectSpread4.default)({}, (_customColumn = customColumn) === null || _customColumn === void 0 ? void 0 : _customColumn.formItemRewrite), {}, {
|
|
87
87
|
moduleCode: moduleCode,
|
|
@@ -133,7 +133,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
133
133
|
var _submitData = data.map(function (item) {
|
|
134
134
|
return behaviorKey === 'add' ? (0, _objectSpread4.default)((0, _objectSpread4.default)({}, (0, _utils.dataFormat)(gridColumns, item)), {}, (0, _defineProperty2.default)({}, window.appConfig.constraintKeys.PRIMARY, null)) : (0, _utils.dataFormat)(gridColumns, item);
|
|
135
135
|
});
|
|
136
|
-
if (_onOperate
|
|
136
|
+
if (_onOperate !== null && _onOperate !== void 0 && _onOperate.post) return _onOperate.post(_submitData); // 以预设为主
|
|
137
137
|
return (0, _defineProperty2.default)({}, dataSetKey, (0, _defineProperty2.default)({}, "".concat(behaviorKey, "List"), _submitData));
|
|
138
138
|
}
|
|
139
139
|
});
|
|
@@ -162,7 +162,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
162
162
|
var formItemData = data.map(function (item) {
|
|
163
163
|
return (0, _utils.formItemDataFormat)(gridColumns, item);
|
|
164
164
|
});
|
|
165
|
-
if (onQuery
|
|
165
|
+
if (onQuery !== null && onQuery !== void 0 && onQuery.format) return onQuery.format(data, formItemData); // 以预设为主
|
|
166
166
|
return formItemData;
|
|
167
167
|
}
|
|
168
168
|
}),
|
|
@@ -175,7 +175,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
175
175
|
indocno: item[window.appConfig.constraintKeys.PRIMARY]
|
|
176
176
|
};
|
|
177
177
|
});
|
|
178
|
-
if (onDelete
|
|
178
|
+
if (onDelete !== null && onDelete !== void 0 && onDelete.post) return onDelete.post(_submitData); // 以预设为主
|
|
179
179
|
return (0, _defineProperty2.default)({}, dataSetKey, {
|
|
180
180
|
deleteList: _submitData
|
|
181
181
|
});
|
|
@@ -189,5 +189,4 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
189
189
|
className: (0, _classnames.default)(_index.default.ldGridForm, (0, _defineProperty2.default)({}, className, !!className))
|
|
190
190
|
}));
|
|
191
191
|
};
|
|
192
|
-
var _default = (0, _ldBuilder.default)(buildLdGridForm);
|
|
193
|
-
exports.default = _default;
|
|
192
|
+
var _default = exports.default = (0, _ldBuilder.default)(buildLdGridForm);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.ldGridForm {
|
|
2
|
-
:global {
|
|
3
|
-
.ag-layout-auto-height {
|
|
4
|
-
height: 100% !important;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
.ldGridForm {
|
|
2
|
+
:global {
|
|
3
|
+
.ag-layout-auto-height {
|
|
4
|
+
height: 100% !important;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -119,9 +119,8 @@ Index.defaultProps = {
|
|
|
119
119
|
customColumns: null,
|
|
120
120
|
defaultParmas: {}
|
|
121
121
|
};
|
|
122
|
-
var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
122
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
123
123
|
return /*#__PURE__*/_react.default.createElement(Index, (0, _extends2.default)({
|
|
124
124
|
wrapperRef: ref
|
|
125
125
|
}, props));
|
|
126
|
-
});
|
|
127
|
-
exports.default = _default;
|
|
126
|
+
});
|
|
@@ -13,8 +13,7 @@ var _lodash = require("lodash");
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _base = require("@luck-design-biz/base");
|
|
15
15
|
var _excluded = ["component", "size"];
|
|
16
|
-
var LuckDaPopContext = /*#__PURE__*/(0, _react.createContext)();
|
|
17
|
-
exports.LuckDaPopContext = LuckDaPopContext;
|
|
16
|
+
var LuckDaPopContext = exports.LuckDaPopContext = /*#__PURE__*/(0, _react.createContext)();
|
|
18
17
|
var LdPop = function LdPop() {
|
|
19
18
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
20
19
|
ldId = _ref.ldId,
|
|
@@ -36,5 +35,4 @@ var LdPop = function LdPop() {
|
|
|
36
35
|
LdPop.propTypes = {
|
|
37
36
|
ldId: _propTypes.default.string.isRequired
|
|
38
37
|
};
|
|
39
|
-
var _default = LdPop;
|
|
40
|
-
exports.default = _default;
|
|
38
|
+
var _default = exports.default = LdPop;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var Babel = _interopRequireWildcard(require("@babel/standalone"));
|
|
12
|
+
var LuckAntd = _interopRequireWildcard(require("luck-design/antd"));
|
|
13
|
+
var LuckDesign = _interopRequireWildcard(require("luck-design"));
|
|
14
|
+
/**
|
|
15
|
+
* 实时代码渲染组件
|
|
16
|
+
* todo:沙箱上下文的集成
|
|
17
|
+
* todo:Loading效果的优化
|
|
18
|
+
*/
|
|
19
|
+
var LdRuntimeCom = function LdRuntimeCom(_ref) {
|
|
20
|
+
var children = _ref.children;
|
|
21
|
+
var _useState = (0, _react.useState)(null),
|
|
22
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
23
|
+
Component = _useState2[0],
|
|
24
|
+
setComponent = _useState2[1];
|
|
25
|
+
var code = _react.default.Children.toArray(children).join('').trim();
|
|
26
|
+
(0, _react.useEffect)(function () {
|
|
27
|
+
if (code) {
|
|
28
|
+
// 使用Babel转换代码
|
|
29
|
+
var transformedCode = Babel.transform(code, {
|
|
30
|
+
presets: ['react']
|
|
31
|
+
}).code;
|
|
32
|
+
|
|
33
|
+
// 输出编译后的代码用于排错
|
|
34
|
+
console.log('transformedCode', transformedCode);
|
|
35
|
+
|
|
36
|
+
// 自动
|
|
37
|
+
var functionNameMatch = transformedCode.match(/function\s+([^\s(]+)/);
|
|
38
|
+
if (functionNameMatch && functionNameMatch.length > 1) {
|
|
39
|
+
var functionName = functionNameMatch[1];
|
|
40
|
+
var execute = new Function('React', 'LuckAntd', 'LuckDesign', "".concat(transformedCode, "; return ").concat(functionName, ";"));
|
|
41
|
+
// 设置组件状态
|
|
42
|
+
var ReactComponent = execute(_react.default, LuckAntd, LuckDesign);
|
|
43
|
+
setComponent( /*#__PURE__*/_react.default.createElement(ReactComponent, null));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, [code]);
|
|
47
|
+
return Component ? Component : /*#__PURE__*/_react.default.createElement("div", null, "Loading...");
|
|
48
|
+
};
|
|
49
|
+
var _default = exports.default = LdRuntimeCom;
|
|
@@ -233,7 +233,6 @@ Index.propTypes = {
|
|
|
233
233
|
// 抑制初始化
|
|
234
234
|
afterInit: _propTypes.default.func // 初始化后
|
|
235
235
|
};
|
|
236
|
-
|
|
237
236
|
Index.defaultProps = {
|
|
238
237
|
readOnly: false,
|
|
239
238
|
title: false,
|
|
@@ -249,9 +248,8 @@ Index.defaultProps = {
|
|
|
249
248
|
suppressInit: false,
|
|
250
249
|
defaultParmas: {}
|
|
251
250
|
};
|
|
252
|
-
var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
251
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
253
252
|
return /*#__PURE__*/_react.default.createElement(Index, (0, _extends2.default)({
|
|
254
253
|
wrapperRef: ref
|
|
255
254
|
}, props));
|
|
256
|
-
});
|
|
257
|
-
exports.default = _default;
|
|
255
|
+
});
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
.tree {
|
|
2
|
-
.nodeTitle {
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
width: 100%;
|
|
6
|
-
|
|
7
|
-
div {
|
|
8
|
-
flex: 1;
|
|
9
|
-
overflow-x: hidden;
|
|
10
|
-
white-space: nowrap;
|
|
11
|
-
text-overflow: ellipsis;
|
|
12
|
-
}
|
|
13
|
-
div.nodeTitleDisabled {
|
|
14
|
-
color: var(--luck-text-color-disabled);
|
|
15
|
-
}
|
|
16
|
-
div.nodeTitleDisabled:hover {
|
|
17
|
-
cursor: not-allowed;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:global {
|
|
22
|
-
.ant-tree-title {
|
|
23
|
-
width: 100%;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
.classTreeOperates {
|
|
28
|
-
:global(.ant-popover-inner-content) {
|
|
29
|
-
padding: 0;
|
|
30
|
-
}
|
|
31
|
-
.rightMenu {
|
|
32
|
-
display: block;
|
|
33
|
-
padding: 4px 8px;
|
|
34
|
-
color: var(--luck-text-color-);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
.tree {
|
|
2
|
+
.nodeTitle {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
width: 100%;
|
|
6
|
+
|
|
7
|
+
div {
|
|
8
|
+
flex: 1;
|
|
9
|
+
overflow-x: hidden;
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
text-overflow: ellipsis;
|
|
12
|
+
}
|
|
13
|
+
div.nodeTitleDisabled {
|
|
14
|
+
color: var(--luck-text-color-disabled);
|
|
15
|
+
}
|
|
16
|
+
div.nodeTitleDisabled:hover {
|
|
17
|
+
cursor: not-allowed;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:global {
|
|
22
|
+
.ant-tree-title {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
.classTreeOperates {
|
|
28
|
+
:global(.ant-popover-inner-content) {
|
|
29
|
+
padding: 0;
|
|
30
|
+
}
|
|
31
|
+
.rightMenu {
|
|
32
|
+
display: block;
|
|
33
|
+
padding: 4px 8px;
|
|
34
|
+
color: var(--luck-text-color-);
|
|
35
|
+
}
|
|
36
|
+
}
|
package/lib/helper/FromItems.js
CHANGED
|
@@ -40,7 +40,7 @@ var _excluded = ["onBlur"],
|
|
|
40
40
|
_excluded22 = ["handleValueChange", "config"],
|
|
41
41
|
_excluded23 = ["onBlur"],
|
|
42
42
|
_excluded24 = ["handleValueChange", "config"];
|
|
43
|
-
var getNumberItem = function getNumberItem() {
|
|
43
|
+
var getNumberItem = exports.getNumberItem = function getNumberItem() {
|
|
44
44
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
45
45
|
handleValueChange = _ref.handleValueChange,
|
|
46
46
|
_ref$config = _ref.config,
|
|
@@ -59,8 +59,7 @@ var getNumberItem = function getNumberItem() {
|
|
|
59
59
|
})
|
|
60
60
|
}));
|
|
61
61
|
};
|
|
62
|
-
exports.
|
|
63
|
-
var getStringItem = function getStringItem(_ref2) {
|
|
62
|
+
var getStringItem = exports.getStringItem = function getStringItem(_ref2) {
|
|
64
63
|
var handleValueChange = _ref2.handleValueChange,
|
|
65
64
|
_ref2$config = _ref2.config,
|
|
66
65
|
_ref2$config2 = _ref2$config === void 0 ? {} : _ref2$config,
|
|
@@ -77,8 +76,7 @@ var getStringItem = function getStringItem(_ref2) {
|
|
|
77
76
|
type: "input"
|
|
78
77
|
}));
|
|
79
78
|
};
|
|
80
|
-
exports.
|
|
81
|
-
var getTextareaItem = function getTextareaItem() {
|
|
79
|
+
var getTextareaItem = exports.getTextareaItem = function getTextareaItem() {
|
|
82
80
|
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
83
81
|
handleValueChange = _ref3.handleValueChange,
|
|
84
82
|
_ref3$config = _ref3.config,
|
|
@@ -97,8 +95,7 @@ var getTextareaItem = function getTextareaItem() {
|
|
|
97
95
|
})
|
|
98
96
|
}));
|
|
99
97
|
};
|
|
100
|
-
exports.
|
|
101
|
-
var getDateItem = function getDateItem() {
|
|
98
|
+
var getDateItem = exports.getDateItem = function getDateItem() {
|
|
102
99
|
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
103
100
|
handleValueChange = _ref4.handleValueChange,
|
|
104
101
|
_ref4$config = _ref4.config,
|
|
@@ -117,8 +114,7 @@ var getDateItem = function getDateItem() {
|
|
|
117
114
|
})
|
|
118
115
|
}));
|
|
119
116
|
};
|
|
120
|
-
exports.
|
|
121
|
-
var getUserItem = function getUserItem(_ref5) {
|
|
117
|
+
var getUserItem = exports.getUserItem = function getUserItem(_ref5) {
|
|
122
118
|
var handleValueChange = _ref5.handleValueChange,
|
|
123
119
|
_onChange2 = _ref5.onChange,
|
|
124
120
|
props = (0, _objectWithoutProperties2.default)(_ref5, _excluded9);
|
|
@@ -129,8 +125,7 @@ var getUserItem = function getUserItem(_ref5) {
|
|
|
129
125
|
}
|
|
130
126
|
}));
|
|
131
127
|
};
|
|
132
|
-
exports.
|
|
133
|
-
var getSelectItem = function getSelectItem(_ref6) {
|
|
128
|
+
var getSelectItem = exports.getSelectItem = function getSelectItem(_ref6) {
|
|
134
129
|
var handleValueChange = _ref6.handleValueChange,
|
|
135
130
|
_ref6$config = _ref6.config,
|
|
136
131
|
_ref6$config2 = _ref6$config === void 0 ? {} : _ref6$config,
|
|
@@ -154,7 +149,6 @@ var getSelectItem = function getSelectItem(_ref6) {
|
|
|
154
149
|
config: config
|
|
155
150
|
}));
|
|
156
151
|
};
|
|
157
|
-
exports.getSelectItem = getSelectItem;
|
|
158
152
|
var DictRadioItem = function DictRadioItem(_ref7) {
|
|
159
153
|
var renderInfoMode = _ref7.renderInfoMode,
|
|
160
154
|
props = (0, _objectWithoutProperties2.default)(_ref7, _excluded12);
|
|
@@ -188,7 +182,7 @@ var DictRadioItem = function DictRadioItem(_ref7) {
|
|
|
188
182
|
}));
|
|
189
183
|
};
|
|
190
184
|
DictRadioItem.displayName = 'BasicFormItem';
|
|
191
|
-
var getRadioItem = function getRadioItem() {
|
|
185
|
+
var getRadioItem = exports.getRadioItem = function getRadioItem() {
|
|
192
186
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
193
187
|
if (props.alias) {
|
|
194
188
|
return /*#__PURE__*/_react.default.createElement(DictRadioItem, props);
|
|
@@ -197,8 +191,7 @@ var getRadioItem = function getRadioItem() {
|
|
|
197
191
|
type: "radio"
|
|
198
192
|
}));
|
|
199
193
|
};
|
|
200
|
-
exports.
|
|
201
|
-
var getGroupItem = function getGroupItem(_ref8) {
|
|
194
|
+
var getGroupItem = exports.getGroupItem = function getGroupItem(_ref8) {
|
|
202
195
|
var handleValueChange = _ref8.handleValueChange,
|
|
203
196
|
_ref8$config = _ref8.config,
|
|
204
197
|
_ref8$config2 = _ref8$config === void 0 ? {} : _ref8$config,
|
|
@@ -215,8 +208,7 @@ var getGroupItem = function getGroupItem(_ref8) {
|
|
|
215
208
|
})
|
|
216
209
|
}));
|
|
217
210
|
};
|
|
218
|
-
exports.
|
|
219
|
-
var getColorItem = function getColorItem(_ref9) {
|
|
211
|
+
var getColorItem = exports.getColorItem = function getColorItem(_ref9) {
|
|
220
212
|
var handleValueChange = _ref9.handleValueChange,
|
|
221
213
|
_ref9$config = _ref9.config,
|
|
222
214
|
_ref9$config2 = _ref9$config === void 0 ? {} : _ref9$config,
|
|
@@ -237,8 +229,7 @@ var getColorItem = function getColorItem(_ref9) {
|
|
|
237
229
|
})
|
|
238
230
|
}));
|
|
239
231
|
};
|
|
240
|
-
exports.
|
|
241
|
-
var getSwitchItem = function getSwitchItem(_ref10) {
|
|
232
|
+
var getSwitchItem = exports.getSwitchItem = function getSwitchItem(_ref10) {
|
|
242
233
|
var handleValueChange = _ref10.handleValueChange,
|
|
243
234
|
_ref10$config = _ref10.config,
|
|
244
235
|
_ref10$config2 = _ref10$config === void 0 ? {} : _ref10$config,
|
|
@@ -255,8 +246,7 @@ var getSwitchItem = function getSwitchItem(_ref10) {
|
|
|
255
246
|
})
|
|
256
247
|
}));
|
|
257
248
|
};
|
|
258
|
-
exports.
|
|
259
|
-
var getRegionItem = function getRegionItem(_ref11) {
|
|
249
|
+
var getRegionItem = exports.getRegionItem = function getRegionItem(_ref11) {
|
|
260
250
|
var handleValueChange = _ref11.handleValueChange,
|
|
261
251
|
props = (0, _objectWithoutProperties2.default)(_ref11, _excluded19);
|
|
262
252
|
return /*#__PURE__*/_react.default.createElement(_base.RegionFormItem, (0, _extends2.default)({}, props, {
|
|
@@ -271,8 +261,7 @@ var getRegionItem = function getRegionItem(_ref11) {
|
|
|
271
261
|
})
|
|
272
262
|
}));
|
|
273
263
|
};
|
|
274
|
-
exports.
|
|
275
|
-
var getYearItem = function getYearItem() {
|
|
264
|
+
var getYearItem = exports.getYearItem = function getYearItem() {
|
|
276
265
|
var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
277
266
|
handleValueChange = _ref12.handleValueChange,
|
|
278
267
|
_ref12$config = _ref12.config,
|
|
@@ -289,8 +278,7 @@ var getYearItem = function getYearItem() {
|
|
|
289
278
|
})
|
|
290
279
|
}));
|
|
291
280
|
};
|
|
292
|
-
exports.
|
|
293
|
-
var getEditorItem = function getEditorItem() {
|
|
281
|
+
var getEditorItem = exports.getEditorItem = function getEditorItem() {
|
|
294
282
|
var _ref13 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
295
283
|
handleValueChange = _ref13.handleValueChange,
|
|
296
284
|
_ref13$config = _ref13.config,
|
|
@@ -313,8 +301,7 @@ var getEditorItem = function getEditorItem() {
|
|
|
313
301
|
})
|
|
314
302
|
}));
|
|
315
303
|
};
|
|
316
|
-
exports.
|
|
317
|
-
var getUploadItem = function getUploadItem() {
|
|
304
|
+
var getUploadItem = exports.getUploadItem = function getUploadItem() {
|
|
318
305
|
var _ref14 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
319
306
|
handleValueChange = _ref14.handleValueChange,
|
|
320
307
|
_ref14$config = _ref14.config,
|
|
@@ -332,5 +319,4 @@ var getUploadItem = function getUploadItem() {
|
|
|
332
319
|
}
|
|
333
320
|
})
|
|
334
321
|
})));
|
|
335
|
-
};
|
|
336
|
-
exports.getUploadItem = getUploadItem;
|
|
322
|
+
};
|
package/lib/helper/action.js
CHANGED
|
@@ -14,14 +14,14 @@ var _utils2 = require("../utils");
|
|
|
14
14
|
var _form = require("./form");
|
|
15
15
|
// 通用方法
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
* 提交行为
|
|
19
|
-
* @param action 行为
|
|
20
|
-
* @param data 数据
|
|
21
|
-
* @param parmas 附件设置
|
|
22
|
-
* @param moduleData 当前模块信息
|
|
17
|
+
/**
|
|
18
|
+
* 提交行为
|
|
19
|
+
* @param action 行为
|
|
20
|
+
* @param data 数据
|
|
21
|
+
* @param parmas 附件设置
|
|
22
|
+
* @param moduleData 当前模块信息
|
|
23
23
|
*/
|
|
24
|
-
var doAction = function doAction(action) {
|
|
24
|
+
var doAction = exports.doAction = function doAction(action) {
|
|
25
25
|
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
26
26
|
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
27
27
|
_ref$showConfirm = _ref.showConfirm,
|
|
@@ -97,8 +97,7 @@ var doAction = function doAction(action) {
|
|
|
97
97
|
(0, _utils.showPop)(errorMsg);
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
exports.
|
|
101
|
-
var onBatchSubmitAction = function onBatchSubmitAction(_ref3, callback) {
|
|
100
|
+
var onBatchSubmitAction = exports.onBatchSubmitAction = function onBatchSubmitAction(_ref3, callback) {
|
|
102
101
|
var values = _ref3.values,
|
|
103
102
|
_ref3$formList = _ref3.formList,
|
|
104
103
|
formList = _ref3$formList === void 0 ? [] : _ref3$formList,
|
|
@@ -190,5 +189,4 @@ var onBatchSubmitAction = function onBatchSubmitAction(_ref3, callback) {
|
|
|
190
189
|
});
|
|
191
190
|
}
|
|
192
191
|
});
|
|
193
|
-
};
|
|
194
|
-
exports.onBatchSubmitAction = onBatchSubmitAction;
|
|
192
|
+
};
|
package/lib/helper/form.js
CHANGED
|
@@ -14,7 +14,7 @@ var _lodash = require("lodash");
|
|
|
14
14
|
var _utils = require("@luck-design-biz/base/utils");
|
|
15
15
|
var _excluded = ["extra"];
|
|
16
16
|
// 属性类型=》控件
|
|
17
|
-
var defaultComName = {
|
|
17
|
+
var defaultComName = exports.defaultComName = {
|
|
18
18
|
number: 'number',
|
|
19
19
|
money: 'number',
|
|
20
20
|
decimal: 'number',
|
|
@@ -34,14 +34,13 @@ var defaultComName = {
|
|
|
34
34
|
file: 'upload'
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* 动态表单配置项转译
|
|
39
|
-
* @param {key string} keyStr
|
|
40
|
-
* @param {label string} labelStr
|
|
41
|
-
* @returns [{key,label}]
|
|
37
|
+
/**
|
|
38
|
+
* 动态表单配置项转译
|
|
39
|
+
* @param {key string} keyStr
|
|
40
|
+
* @param {label string} labelStr
|
|
41
|
+
* @returns [{key,label}]
|
|
42
42
|
*/
|
|
43
|
-
exports.
|
|
44
|
-
var splitStrToObj = function splitStrToObj(keyStr, labelStr) {
|
|
43
|
+
var splitStrToObj = exports.splitStrToObj = function splitStrToObj(keyStr, labelStr) {
|
|
45
44
|
var keys = keyStr && keyStr.length > 0 ? keyStr.split(',') : undefined;
|
|
46
45
|
if (keys) {
|
|
47
46
|
var labels = labelStr && labelStr.length > 0 ? labelStr.split(',') : undefined;
|
|
@@ -56,13 +55,12 @@ var splitStrToObj = function splitStrToObj(keyStr, labelStr) {
|
|
|
56
55
|
return undefined;
|
|
57
56
|
};
|
|
58
57
|
|
|
59
|
-
/**
|
|
60
|
-
* 动态表单配置项转译
|
|
61
|
-
* @param {动态表单配置项} props
|
|
62
|
-
* @param {自定义动态表单配置项} customProps
|
|
63
|
-
* @returns {name: '',...}
|
|
58
|
+
/**
|
|
59
|
+
* 动态表单配置项转译
|
|
60
|
+
* @param {动态表单配置项} props
|
|
61
|
+
* @param {自定义动态表单配置项} customProps
|
|
62
|
+
* @returns {name: '',...}
|
|
64
63
|
*/
|
|
65
|
-
exports.splitStrToObj = splitStrToObj;
|
|
66
64
|
function translator() {
|
|
67
65
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
68
66
|
extra = _ref.extra,
|
|
@@ -101,15 +99,15 @@ function translator() {
|
|
|
101
99
|
return _props;
|
|
102
100
|
}
|
|
103
101
|
|
|
104
|
-
/**
|
|
105
|
-
* 删除自动移操作中的不可覆盖字段
|
|
106
|
-
* @param props
|
|
107
|
-
* @returns {{multiple}|*}
|
|
102
|
+
/**
|
|
103
|
+
* 删除自动移操作中的不可覆盖字段
|
|
104
|
+
* @param props
|
|
105
|
+
* @returns {{multiple}|*}
|
|
108
106
|
*/
|
|
109
107
|
function formatCustomProps(props) {
|
|
110
108
|
var _props$confiig;
|
|
111
|
-
if (props
|
|
112
|
-
if (props
|
|
109
|
+
if (props !== null && props !== void 0 && props.multiple) delete props.multiple;
|
|
110
|
+
if (props !== null && props !== void 0 && (_props$confiig = props.confiig) !== null && _props$confiig !== void 0 && _props$confiig.mode) delete props.confiig.mode;
|
|
113
111
|
// alias、sclassKey?
|
|
114
112
|
return props;
|
|
115
113
|
}
|
package/lib/helper/index.less
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.ldLabs{
|
|
2
|
-
:global{
|
|
3
|
-
.ant-tabs-bar{
|
|
4
|
-
margin: 0 0 4px 0;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
.ldLabs{
|
|
2
|
+
:global{
|
|
3
|
+
.ant-tabs-bar{
|
|
4
|
+
margin: 0 0 4px 0;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
}
|
package/lib/helper/ldBuilder.js
CHANGED
package/lib/helper/ldComBuild.js
CHANGED
|
@@ -16,32 +16,29 @@ var _Builder = require("../components/Builder");
|
|
|
16
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
17
|
var _index = _interopRequireDefault(require("./index.less"));
|
|
18
18
|
var _excluded = ["className"];
|
|
19
|
-
var getResources = function getResources() {
|
|
19
|
+
var getResources = exports.getResources = function getResources() {
|
|
20
20
|
var _ref = (0, _react.useContext)(_Builder.LuckDaContext) || {},
|
|
21
21
|
_ref$resources = _ref.resources,
|
|
22
22
|
resources = _ref$resources === void 0 ? [] : _ref$resources;
|
|
23
23
|
return resources;
|
|
24
24
|
};
|
|
25
|
-
exports.
|
|
26
|
-
var ldComBuilder = function ldComBuilder(Com) {
|
|
25
|
+
var ldComBuilder = exports.ldComBuilder = function ldComBuilder(Com) {
|
|
27
26
|
var Component = function Component(props) {
|
|
28
27
|
var _com$props;
|
|
29
28
|
var resources = getResources();
|
|
30
29
|
var com = /*#__PURE__*/_react.default.createElement(Com, props);
|
|
31
|
-
return !(com
|
|
30
|
+
return !(com !== null && com !== void 0 && (_com$props = com.props) !== null && _com$props !== void 0 && _com$props.resource) || (0, _lodash.includes)(resources, com.props.resource) ? com : _react.Fragment;
|
|
32
31
|
};
|
|
33
32
|
return Component;
|
|
34
33
|
};
|
|
35
|
-
exports.
|
|
36
|
-
var filterOptions = function filterOptions(options) {
|
|
34
|
+
var filterOptions = exports.filterOptions = function filterOptions(options) {
|
|
37
35
|
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'resource';
|
|
38
36
|
var resources = getResources();
|
|
39
37
|
return (0, _lodash.intersectionWith)(options, resources, function (arrVal, othVal) {
|
|
40
38
|
return !arrVal[key] || arrVal[key] === othVal;
|
|
41
39
|
});
|
|
42
40
|
};
|
|
43
|
-
exports.
|
|
44
|
-
var deepFilterCom = function deepFilterCom(Com, childMark) {
|
|
41
|
+
var deepFilterCom = exports.deepFilterCom = function deepFilterCom(Com, childMark) {
|
|
45
42
|
var Component = function Component(_ref2) {
|
|
46
43
|
var className = _ref2.className,
|
|
47
44
|
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
@@ -51,10 +48,9 @@ var deepFilterCom = function deepFilterCom(Com, childMark) {
|
|
|
51
48
|
}));
|
|
52
49
|
return _utils.ChildrenUtil.deepFilter(com, function (child) {
|
|
53
50
|
var _child$props;
|
|
54
|
-
var data = !childMark(child) || !(child
|
|
51
|
+
var data = !childMark(child) || !(child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.resource) || (0, _lodash.includes)(resources, child.props.resource);
|
|
55
52
|
return data;
|
|
56
53
|
});
|
|
57
54
|
};
|
|
58
55
|
return Component;
|
|
59
|
-
};
|
|
60
|
-
exports.deepFilterCom = deepFilterCom;
|
|
56
|
+
};
|
package/lib/index.js
CHANGED
|
@@ -12,7 +12,8 @@ var _exportNames = {
|
|
|
12
12
|
buildLdAutoForm: true,
|
|
13
13
|
buildLdGridForm: true,
|
|
14
14
|
LdInfoPanel: true,
|
|
15
|
-
LdCard: true
|
|
15
|
+
LdCard: true,
|
|
16
|
+
LdRuntimeCom: true
|
|
16
17
|
};
|
|
17
18
|
Object.defineProperty(exports, "LdCard", {
|
|
18
19
|
enumerable: true,
|
|
@@ -38,6 +39,12 @@ Object.defineProperty(exports, "LdInfoPanel", {
|
|
|
38
39
|
return _LdInfoPanel.default;
|
|
39
40
|
}
|
|
40
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "LdRuntimeCom", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _LdRuntimeCom.default;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
41
48
|
Object.defineProperty(exports, "LdTree", {
|
|
42
49
|
enumerable: true,
|
|
43
50
|
get: function get() {
|
|
@@ -70,6 +77,7 @@ var _LdAutoForm = _interopRequireDefault(require("./components/LdAutoForm"));
|
|
|
70
77
|
var _LdGridForm = _interopRequireDefault(require("./components/LdGridForm"));
|
|
71
78
|
var _LdInfoPanel = _interopRequireDefault(require("./components/LdInfoPanel"));
|
|
72
79
|
var _LdCard = _interopRequireDefault(require("./components/LdCard"));
|
|
80
|
+
var _LdRuntimeCom = _interopRequireDefault(require("./components/LdRuntimeCom"));
|
|
73
81
|
var _LdCom = require("./components/LdCom");
|
|
74
82
|
Object.keys(_LdCom).forEach(function (key) {
|
|
75
83
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.COMPONENT_UNMOUNT = exports.COMPONENT_SETTING_CLICK = exports.COMPONENT_MOUNT = exports.COMPONENT_HOVER = exports.COMPONENT_ACTIVE = void 0;
|
|
7
|
+
/******************************** 通用Topic开始 ********************************/
|
|
8
|
+
|
|
9
|
+
// 组件的加载完成事件
|
|
10
|
+
var COMPONENT_MOUNT = exports.COMPONENT_MOUNT = 'component-mount';
|
|
11
|
+
// 组件的卸载事件
|
|
12
|
+
var COMPONENT_UNMOUNT = exports.COMPONENT_UNMOUNT = 'component-unmount';
|
|
13
|
+
|
|
14
|
+
/******************************** 通用Topic结束 ********************************/
|
|
15
|
+
|
|
16
|
+
/******************************* Design Topic开始 *******************************/
|
|
17
|
+
|
|
18
|
+
// 组件的hover事件
|
|
19
|
+
var COMPONENT_HOVER = exports.COMPONENT_HOVER = 'component-hover';
|
|
20
|
+
// 组件的激活事件
|
|
21
|
+
var COMPONENT_ACTIVE = exports.COMPONENT_ACTIVE = 'component-active';
|
|
22
|
+
// 组件设置的click事件
|
|
23
|
+
var COMPONENT_SETTING_CLICK = exports.COMPONENT_SETTING_CLICK = 'component-setting-click';
|
|
24
|
+
|
|
25
|
+
/******************************* Design Topic结束 *******************************/
|
|
26
|
+
|
|
27
|
+
/******************************** Live Topic开始 ********************************/
|
|
28
|
+
|
|
29
|
+
/******************************** Live Topic结束 ********************************/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RUNTIME = exports.CELL_KEY = exports.CELL_CLASS_NAME = void 0;
|
|
7
|
+
var RUNTIME = exports.RUNTIME = {
|
|
8
|
+
LIVE: 'live',
|
|
9
|
+
DESIGN: 'design',
|
|
10
|
+
PREVIEW: 'preview'
|
|
11
|
+
};
|
|
12
|
+
var CELL_CLASS_NAME = exports.CELL_CLASS_NAME = 'ld-lc-cell';
|
|
13
|
+
var CELL_KEY = exports.CELL_KEY = {
|
|
14
|
+
PAGE_ROOT: 'page_root',
|
|
15
|
+
PAGE_HEADER: 'page_header',
|
|
16
|
+
PAGE_CONTENT: 'page_content',
|
|
17
|
+
PAGE_FOOTER: 'page_footer'
|
|
18
|
+
};
|