@luck-design-biz/luckda 0.0.25-7 → 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 +8 -6
- package/es/components/LdFormList/index.js +12 -4
- package/es/components/LdGrid/index.js +11 -5
- package/es/components/LdGridForm/index.js +4 -2
- package/es/components/LdTree/index.js +30 -13
- package/es/helper/form.js +9 -5
- package/es/locales/zh-CN.js +15 -10
- package/es/lowcode/constants/api-url.js +112 -26
- package/es/lowcode/constants/event-topics.js +2 -0
- 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.json +5 -5
- package/es/lowcode/engine/meta/drawer.props.json +8 -20
- package/es/lowcode/engine/meta/form.props.json +13 -7
- 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 +15 -9
- package/es/lowcode/engine/meta/tabs.props.json +3 -3
- package/es/lowcode/engine/meta/tree.props.default.json +1 -0
- package/es/lowcode/engine/meta/tree.props.json +55 -6
- package/es/lowcode/engine/provider/ContextProvider/index.js +12 -3
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +55 -6
- package/es/lowcode/engine/tools/dataProcess.js +4 -0
- package/es/lowcode/engine/tools/usePageDataStore.js +4 -2
- package/es/lowcode/painter/DesignOperator.js +1 -1
- package/es/lowcode/painter/DesignToolbar.js +2 -1
- package/es/lowcode/painter/Panel.js +3 -3
- package/es/lowcode/painter/components/ActionBindModal.js +25 -13
- package/es/lowcode/painter/components/AdvancePanel.js +6 -1
- package/es/lowcode/painter/components/AttrsPanel.js +13 -11
- 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 +156 -24
- 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 +6 -9
- package/es/lowcode/painter/panel-section/FieldsSetting.js +53 -12
- 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/SplitDisplay.js +25 -110
- package/es/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/es/lowcode/painter/style/action-bind-modal.less +3 -3
- package/es/lowcode/painter/style/page-layout-display.less +28 -0
- package/es/lowcode/painter/style/split-display.less +0 -9
- package/es/lowcode/preview/index.js +4 -2
- 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/index.js +27 -2
- package/es/lowcode/view/lc-components/Dialog/meta.json +5 -5
- package/es/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/es/lowcode/view/lc-components/Form/index.js +99 -21
- package/es/lowcode/view/lc-components/Form/meta.json +13 -7
- 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/meta.json +2 -2
- package/es/lowcode/view/lc-components/Page/meta.json +2 -2
- 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/Section/meta.json +2 -2
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +11 -5
- 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 +60 -17
- package/es/lowcode/view/lc-components/Table/meta.json +15 -9
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +1 -0
- 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 +60 -18
- package/es/lowcode/view/lc-components/Tree/meta.json +55 -7
- package/es/upload/FormItem/index.js +1 -4
- package/lib/components/LDActions/index.js +7 -9
- package/lib/components/LDActions/index.less +7 -4
- package/lib/components/LdAutoForm/index.js +7 -5
- package/lib/components/LdFormList/index.js +11 -3
- package/lib/components/LdGrid/index.js +11 -5
- package/lib/components/LdGridForm/index.js +4 -2
- package/lib/components/LdTree/index.js +30 -13
- package/lib/helper/form.js +8 -4
- package/lib/locales/zh-CN.js +15 -10
- package/lib/lowcode/constants/api-url.js +113 -26
- package/lib/lowcode/constants/event-topics.js +3 -1
- 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.json +5 -5
- package/lib/lowcode/engine/meta/drawer.props.json +8 -20
- package/lib/lowcode/engine/meta/form.props.json +13 -7
- 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 +15 -9
- package/lib/lowcode/engine/meta/tabs.props.json +3 -3
- package/lib/lowcode/engine/meta/tree.props.default.json +1 -0
- package/lib/lowcode/engine/meta/tree.props.json +55 -6
- package/lib/lowcode/engine/provider/ContextProvider/index.js +11 -2
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +54 -5
- package/lib/lowcode/engine/tools/dataProcess.js +4 -0
- package/lib/lowcode/engine/tools/usePageDataStore.js +4 -2
- package/lib/lowcode/painter/DesignOperator.js +1 -1
- package/lib/lowcode/painter/DesignToolbar.js +2 -1
- package/lib/lowcode/painter/Panel.js +3 -3
- package/lib/lowcode/painter/components/ActionBindModal.js +23 -11
- package/lib/lowcode/painter/components/AdvancePanel.js +6 -1
- package/lib/lowcode/painter/components/AttrsPanel.js +12 -10
- 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 +153 -21
- 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 +6 -9
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +53 -12
- 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/SplitDisplay.js +24 -109
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/lib/lowcode/painter/style/action-bind-modal.less +3 -3
- package/lib/lowcode/painter/style/page-layout-display.less +28 -0
- package/lib/lowcode/painter/style/split-display.less +0 -9
- package/lib/lowcode/preview/index.js +4 -2
- 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/index.js +29 -4
- package/lib/lowcode/view/lc-components/Dialog/meta.json +5 -5
- package/lib/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/lib/lowcode/view/lc-components/Form/index.js +96 -18
- package/lib/lowcode/view/lc-components/Form/meta.json +13 -7
- 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/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Page/meta.json +2 -2
- 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/Section/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +12 -6
- 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 +59 -16
- package/lib/lowcode/view/lc-components/Table/meta.json +15 -9
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +3 -2
- 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 +58 -16
- package/lib/lowcode/view/lc-components/Tree/meta.json +55 -7
- package/lib/upload/FormItem/index.js +1 -4
- package/package.json +2 -2
|
@@ -5,14 +5,12 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
5
5
|
import React, { useRef, useState } from 'react';
|
|
6
6
|
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import classNames from 'classnames';
|
|
9
8
|
import { isString, drop } from 'lodash';
|
|
10
|
-
import {
|
|
9
|
+
import { Segmented, Icon } from 'luck-design/antd';
|
|
11
10
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
12
11
|
import RuleInput from "../components/RuleInput";
|
|
13
12
|
import PanelItem from "../components/PanelItem";
|
|
14
13
|
import styles from "../style/split-display.less";
|
|
15
|
-
var _TYPES_ = ['normal', 'lr', 'lmr', 'ltb'];
|
|
16
14
|
var _OPTIONS_ = [{
|
|
17
15
|
label: formatMessage({
|
|
18
16
|
id: 'luckda.lowcode.painter.panel-section.splitdisplay.splitVertical',
|
|
@@ -53,47 +51,27 @@ var SplitDisplay = function SplitDisplay(_ref) {
|
|
|
53
51
|
var defaultValue = _ref.defaultValue,
|
|
54
52
|
onChange = _ref.onChange;
|
|
55
53
|
var valueRef = useRef(defaultValue);
|
|
56
|
-
var _useState = useState(defaultValue.
|
|
54
|
+
var _useState = useState(defaultValue.split || 'vertical'),
|
|
57
55
|
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var _useState3 = useState(defaultValue.
|
|
56
|
+
split = _useState2[0],
|
|
57
|
+
setSplit = _useState2[1];
|
|
58
|
+
var _useState3 = useState(defaultValue.ratio || '1:1'),
|
|
61
59
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
var _useState5 = useState(defaultValue.ratio || '1:1'),
|
|
65
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
66
|
-
ratio = _useState6[0],
|
|
67
|
-
setRatio = _useState6[1];
|
|
60
|
+
ratio = _useState4[0],
|
|
61
|
+
setRatio = _useState4[1];
|
|
68
62
|
var ratioArr = useCreation(function () {
|
|
69
63
|
return ratio.split(':').map(function (r) {
|
|
70
64
|
return parseInt(r);
|
|
71
65
|
});
|
|
72
66
|
}, [ratio]);
|
|
73
|
-
var
|
|
67
|
+
var _useState5 = useState(function () {
|
|
74
68
|
return drop(ratioArr).map(function () {
|
|
75
69
|
return split === 'vertical' ? 'right' : 'down';
|
|
76
70
|
});
|
|
77
71
|
}),
|
|
78
|
-
|
|
79
|
-
fastTo =
|
|
80
|
-
setFastTo =
|
|
81
|
-
var handleTypeChange = useMemoizedFn(function (value) {
|
|
82
|
-
setActiveType(value);
|
|
83
|
-
if (value === 'normal') {
|
|
84
|
-
valueRef.current = {
|
|
85
|
-
type: value,
|
|
86
|
-
fastTo: fastTo,
|
|
87
|
-
split: split,
|
|
88
|
-
ratio: ratio
|
|
89
|
-
};
|
|
90
|
-
} else {
|
|
91
|
-
valueRef.current = {
|
|
92
|
-
type: value
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
onChange(valueRef.current);
|
|
96
|
-
});
|
|
72
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
73
|
+
fastTo = _useState6[0],
|
|
74
|
+
setFastTo = _useState6[1];
|
|
97
75
|
var handleFastToItemClick = useMemoizedFn(function (d, i) {
|
|
98
76
|
var _fastTo = _toConsumableArray(fastTo);
|
|
99
77
|
_fastTo[i] = _FAST_TO_MAPPING_[d];
|
|
@@ -125,84 +103,20 @@ var SplitDisplay = function SplitDisplay(_ref) {
|
|
|
125
103
|
className: styles['lc-painter-panel-section-splitdisplay']
|
|
126
104
|
}, /*#__PURE__*/React.createElement("div", {
|
|
127
105
|
className: styles['display-type-box']
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
}, _type === 'normal' && ratioArr.map(function (r, i) {
|
|
141
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
142
|
-
key: i,
|
|
143
|
-
style: _defineProperty({
|
|
144
|
-
flex: r
|
|
145
|
-
}, split === 'horizontal' ? 'borderBottom' : 'borderRight', i < ratioArr.length - 1 ? '1px solid #eee' : 'none'),
|
|
146
|
-
className: styles['item-block']
|
|
147
|
-
});
|
|
148
|
-
}), _type === 'lr' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
149
|
-
style: {
|
|
150
|
-
flex: 1,
|
|
151
|
-
marginRight: 4
|
|
152
|
-
},
|
|
153
|
-
className: styles['item-block']
|
|
154
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
155
|
-
style: {
|
|
156
|
-
flex: 3
|
|
157
|
-
},
|
|
158
|
-
className: styles['item-block']
|
|
159
|
-
})), _type === 'lmr' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
160
|
-
style: {
|
|
161
|
-
flex: 1,
|
|
162
|
-
marginRight: 4
|
|
163
|
-
},
|
|
164
|
-
className: styles['item-block']
|
|
165
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
166
|
-
style: {
|
|
167
|
-
flex: 3,
|
|
168
|
-
display: 'flex'
|
|
169
|
-
}
|
|
170
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
171
|
-
style: {
|
|
172
|
-
width: '50%',
|
|
173
|
-
borderRight: '1px solid #eee'
|
|
174
|
-
},
|
|
175
|
-
className: styles['item-block']
|
|
176
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
177
|
-
style: {
|
|
178
|
-
width: '50%'
|
|
179
|
-
},
|
|
180
|
-
className: styles['item-block']
|
|
181
|
-
}))), _type === 'ltb' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
182
|
-
style: {
|
|
183
|
-
flex: 1,
|
|
184
|
-
marginRight: 4
|
|
185
|
-
},
|
|
186
|
-
className: styles['item-block']
|
|
187
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
188
|
-
style: {
|
|
189
|
-
flex: 3,
|
|
190
|
-
display: 'flex',
|
|
191
|
-
flexDirection: 'column'
|
|
192
|
-
}
|
|
193
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
194
|
-
style: {
|
|
195
|
-
height: '50%',
|
|
196
|
-
borderBottom: '1px solid #eee'
|
|
197
|
-
},
|
|
198
|
-
className: styles['item-block']
|
|
199
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
200
|
-
style: {
|
|
201
|
-
height: '50%'
|
|
202
|
-
},
|
|
106
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
className: styles['display-type-item'],
|
|
108
|
+
style: {
|
|
109
|
+
flexDirection: split === 'horizontal' ? 'column' : 'row'
|
|
110
|
+
}
|
|
111
|
+
}, ratioArr.map(function (r, i) {
|
|
112
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
key: i,
|
|
114
|
+
style: _defineProperty({
|
|
115
|
+
flex: r
|
|
116
|
+
}, split === 'horizontal' ? 'borderBottom' : 'borderRight', i < ratioArr.length - 1 ? '1px solid #eee' : 'none'),
|
|
203
117
|
className: styles['item-block']
|
|
204
|
-
})
|
|
205
|
-
})),
|
|
118
|
+
});
|
|
119
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
206
120
|
style: {
|
|
207
121
|
marginTop: 8
|
|
208
122
|
}
|
|
@@ -214,6 +128,7 @@ var SplitDisplay = function SplitDisplay(_ref) {
|
|
|
214
128
|
suppressPadding: true
|
|
215
129
|
}, /*#__PURE__*/React.createElement(FastToBox, null, fastTo.map(function (d, i) {
|
|
216
130
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
131
|
+
key: i,
|
|
217
132
|
type: "arrow-".concat(d),
|
|
218
133
|
onClick: function onClick() {
|
|
219
134
|
return handleFastToItemClick(d, i);
|
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useGet } from "../../../engine/provider/ContextProvider";
|
|
2
3
|
import { StyleProvider } from "./StyleContext";
|
|
3
4
|
import MainPanel from "./MainPanel";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* StylePanel 组件是一个 React 组件,用于提供样式设置主面板。
|
|
7
8
|
* 该组件通过 StyleProvider 将样式变更和当前样式值传递给其子组件。
|
|
8
|
-
*
|
|
9
|
+
*
|
|
9
10
|
* @component
|
|
10
11
|
* @example
|
|
11
12
|
* const handleChange = (newValue) => console.log(newValue);
|
|
12
13
|
* const initialValue = "dark";
|
|
13
14
|
* <StylePanel onChange={handleChange} value={initialValue} />
|
|
14
|
-
*
|
|
15
|
+
*
|
|
15
16
|
* @param {Object} props - 组件的属性。
|
|
16
17
|
* @param {Function} props.onChange - 当样式变更时调用的函数,该函数接受新的样式值作为参数。
|
|
17
18
|
* @param {any} props.value - 样式字符串
|
|
18
|
-
*
|
|
19
|
+
*
|
|
19
20
|
* @returns {ReactElement} 返回一个 React 元素,其中包含了 StyleProvider 和 MainPanel 组件。
|
|
20
21
|
*/
|
|
21
22
|
var StylePanel = function StylePanel(_ref) {
|
|
22
23
|
var onChange = _ref.onChange,
|
|
24
|
+
nodeId = _ref.nodeId,
|
|
23
25
|
value = _ref.value;
|
|
26
|
+
var _value = useGet({
|
|
27
|
+
id: nodeId,
|
|
28
|
+
path: 'props.css'
|
|
29
|
+
});
|
|
24
30
|
return /*#__PURE__*/React.createElement(StyleProvider, {
|
|
25
31
|
onChange: onChange,
|
|
26
|
-
value: value
|
|
32
|
+
value: value || _value
|
|
27
33
|
}, /*#__PURE__*/React.createElement(MainPanel, null));
|
|
28
34
|
};
|
|
29
35
|
export default StylePanel;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.lc-painter-panel-action-bind-modal {
|
|
2
2
|
&-body {
|
|
3
3
|
width: 100%;
|
|
4
|
-
height:
|
|
4
|
+
height: 660px;
|
|
5
5
|
display: flex;
|
|
6
6
|
font-size: 12px;
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
.selector-box {
|
|
12
12
|
width: 100%;
|
|
13
|
-
height:
|
|
13
|
+
height: 620px;
|
|
14
14
|
border: 1px solid #e8e8e8;
|
|
15
15
|
border-radius: 6px;
|
|
16
16
|
display: flex;
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
|
|
69
69
|
.code-box {
|
|
70
70
|
width: 100%;
|
|
71
|
-
height:
|
|
71
|
+
height: 620px;
|
|
72
72
|
border: 1px solid #e8e8e8;
|
|
73
73
|
border-radius: 6px;
|
|
74
74
|
overflow: hidden;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.lc-painter-panel-section-pagelayoutdisplay {
|
|
2
|
+
.display-type-box {
|
|
3
|
+
display: grid;
|
|
4
|
+
grid-template-columns: repeat(3, 1fr);
|
|
5
|
+
grid-column-gap: 4px;
|
|
6
|
+
|
|
7
|
+
.display-type-item {
|
|
8
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
padding: 3px;
|
|
11
|
+
height: 42px;
|
|
12
|
+
display: flex;
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
border-color: var(--ant-primary-color);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.active {
|
|
20
|
+
border-color: var(--ant-primary-color);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.item-block {
|
|
24
|
+
background-color: rgb(192, 194, 196);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -11,15 +11,6 @@
|
|
|
11
11
|
height: 42px;
|
|
12
12
|
display: flex;
|
|
13
13
|
|
|
14
|
-
&:hover {
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
border-color: var(--ant-primary-color);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&.active {
|
|
20
|
-
border-color: var(--ant-primary-color);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
14
|
.item-block {
|
|
24
15
|
background-color: rgb(192, 194, 196);
|
|
25
16
|
}
|
|
@@ -7,7 +7,8 @@ import Page from "../view/Page";
|
|
|
7
7
|
import { RUNTIME } from "../constants/index";
|
|
8
8
|
var Preview = function Preview(_ref) {
|
|
9
9
|
var code = _ref.code,
|
|
10
|
-
userId = _ref.userId
|
|
10
|
+
userId = _ref.userId,
|
|
11
|
+
debug = _ref.debug;
|
|
11
12
|
var _useState = useState(userId),
|
|
12
13
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13
14
|
currentKey = _useState2[0],
|
|
@@ -21,7 +22,8 @@ var Preview = function Preview(_ref) {
|
|
|
21
22
|
return code && currentKey ? /*#__PURE__*/React.createElement(EventBusProvider, {
|
|
22
23
|
runtime: RUNTIME.PREVIEW
|
|
23
24
|
}, /*#__PURE__*/React.createElement(ContextProvider, {
|
|
24
|
-
code: code
|
|
25
|
+
code: code,
|
|
26
|
+
debug: debug
|
|
25
27
|
}, /*#__PURE__*/React.createElement(Page, null))) : null;
|
|
26
28
|
};
|
|
27
29
|
export default Preview;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children"];
|
|
4
|
+
var _excluded = ["children", "className"];
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { useCreation } from 'ahooks';
|
|
7
7
|
import classNames from 'classnames';
|
|
@@ -9,12 +9,13 @@ import Index from "./index";
|
|
|
9
9
|
import styles from "./index.less";
|
|
10
10
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
11
11
|
var children = _ref.children,
|
|
12
|
+
className = _ref.className,
|
|
12
13
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
14
|
var isEmpty = useCreation(function () {
|
|
14
15
|
return !children || React.Children.count(children) === 0;
|
|
15
16
|
}, [children]);
|
|
16
17
|
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
17
|
-
className: classNames(styles['lc-component-box-design'], _defineProperty({}, styles.placeholder, isEmpty))
|
|
18
|
+
className: classNames(styles['lc-component-box-design'], _defineProperty(_defineProperty({}, styles.placeholder, isEmpty), "className", !!className))
|
|
18
19
|
}, props), isEmpty ? '点击组件库的组件或拖拽组件到这里' : children);
|
|
19
20
|
};
|
|
20
21
|
export default FunctionDesign;
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
"key": "onMount",
|
|
22
22
|
"name": "组件首次渲染时",
|
|
23
23
|
"desc": "在组件首次渲染时,执行方法",
|
|
24
|
-
"func": "(params)
|
|
24
|
+
"func": "function onMount(params) {\n\t\n}"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"key": "onUnmount",
|
|
28
28
|
"name": "组件卸载时",
|
|
29
29
|
"desc": "在组件卸载时,执行方法。",
|
|
30
|
-
"func": "(params)
|
|
30
|
+
"func": "function onUnmount(params) {\n\t\n}"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"key": "onClick",
|
|
34
34
|
"name": "点击事件",
|
|
35
35
|
"desc": "点击文本时,执行方法",
|
|
36
|
-
"func": "(e)
|
|
36
|
+
"func": "function onClick(e) {\n\t\n}"
|
|
37
37
|
}
|
|
38
38
|
]
|
|
39
39
|
}
|
|
@@ -33,14 +33,10 @@ var LCButton = function LCButton(_ref) {
|
|
|
33
33
|
var ref = useRef();
|
|
34
34
|
var ctx = useContext();
|
|
35
35
|
useMount(function () {
|
|
36
|
-
ctx.doAction(advance.events.onMount
|
|
37
|
-
instance: ref.current
|
|
38
|
-
});
|
|
36
|
+
ctx.doAction(advance.events.onMount);
|
|
39
37
|
});
|
|
40
38
|
useUnmount(function () {
|
|
41
|
-
ctx.doAction(advance.events.onUnmount
|
|
42
|
-
instance: ref.current
|
|
43
|
-
});
|
|
39
|
+
ctx.doAction(advance.events.onUnmount);
|
|
44
40
|
});
|
|
45
41
|
var handleClick = useMemoizedFn(function (e) {
|
|
46
42
|
if (onClick) {
|
|
@@ -108,19 +108,19 @@
|
|
|
108
108
|
"key": "onMount",
|
|
109
109
|
"name": "组件首次渲染时",
|
|
110
110
|
"desc": "在组件首次渲染时,执行方法",
|
|
111
|
-
"func": "(
|
|
111
|
+
"func": "function onMount() {\n\t\n}"
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
"key": "onUnmount",
|
|
115
115
|
"name": "组件卸载时",
|
|
116
116
|
"desc": "在组件卸载时,执行方法。",
|
|
117
|
-
"func": "(
|
|
117
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"key": "onClick",
|
|
121
121
|
"name": "点击事件",
|
|
122
122
|
"desc": "点击文本时,执行方法",
|
|
123
|
-
"func": "(e)
|
|
123
|
+
"func": "function onClick(e) {\n\t\n}"
|
|
124
124
|
}
|
|
125
125
|
]
|
|
126
126
|
}
|
|
@@ -38,10 +38,15 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
38
38
|
_usePromiseState2 = _slicedToArray(_usePromiseState, 2),
|
|
39
39
|
open = _usePromiseState2[0],
|
|
40
40
|
setOpen = _usePromiseState2[1];
|
|
41
|
+
var _usePromiseState3 = usePromiseState(title),
|
|
42
|
+
_usePromiseState4 = _slicedToArray(_usePromiseState3, 2),
|
|
43
|
+
_title = _usePromiseState4[0],
|
|
44
|
+
_setTitle = _usePromiseState4[1];
|
|
41
45
|
useEffect(function () {
|
|
42
46
|
ctx.doAction(advance.events.onMount);
|
|
43
47
|
return function () {
|
|
44
|
-
|
|
48
|
+
_setTitle(title);
|
|
49
|
+
ctx.doAction(advance.events.onUnmount);
|
|
45
50
|
};
|
|
46
51
|
}, []);
|
|
47
52
|
useUpdateEffect(function () {
|
|
@@ -84,12 +89,32 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
84
89
|
});
|
|
85
90
|
useImperativeHandle(apiRef, function () {
|
|
86
91
|
return {
|
|
92
|
+
/**
|
|
93
|
+
* 弹窗打开状态
|
|
94
|
+
* @property
|
|
95
|
+
*/
|
|
87
96
|
open: open,
|
|
97
|
+
/**
|
|
98
|
+
* 打开弹窗
|
|
99
|
+
* @method
|
|
100
|
+
*/
|
|
88
101
|
doOpen: function doOpen() {
|
|
89
102
|
return setOpen(true);
|
|
90
103
|
},
|
|
104
|
+
/**
|
|
105
|
+
* 关闭弹窗
|
|
106
|
+
* @method
|
|
107
|
+
*/
|
|
91
108
|
doClose: function doClose() {
|
|
92
109
|
return setOpen(false);
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* 设置弹窗标题
|
|
113
|
+
* @method
|
|
114
|
+
* @param {stirng} title -标题
|
|
115
|
+
*/
|
|
116
|
+
setTitle: function setTitle(_title) {
|
|
117
|
+
return _setTitle(_title);
|
|
93
118
|
}
|
|
94
119
|
};
|
|
95
120
|
}, []);
|
|
@@ -99,7 +124,7 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
99
124
|
getTargetDom: getTargetDom,
|
|
100
125
|
api: apiRef
|
|
101
126
|
}, /*#__PURE__*/React.createElement(Modal, _extends({
|
|
102
|
-
title:
|
|
127
|
+
title: _title,
|
|
103
128
|
visible: open,
|
|
104
129
|
getContainer: getContainer,
|
|
105
130
|
width: width,
|
|
@@ -112,31 +112,31 @@
|
|
|
112
112
|
"key": "onMount",
|
|
113
113
|
"name": "组件首次渲染时",
|
|
114
114
|
"desc": "在组件首次渲染时,执行方法",
|
|
115
|
-
"func": "()
|
|
115
|
+
"func": "function onMount() {\n\t\n}"
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
"key": "onUnmount",
|
|
119
119
|
"name": "组件卸载时",
|
|
120
120
|
"desc": "在组件卸载时,执行方法。",
|
|
121
|
-
"func": "()
|
|
121
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
"key": "onOpen",
|
|
125
125
|
"name": "对话框打开时",
|
|
126
126
|
"desc": "在对话框打开时,执行方法",
|
|
127
|
-
"func": "()
|
|
127
|
+
"func": "function onOpen() {\n\t\n}"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
"key": "onClose",
|
|
131
131
|
"name": "对话框关闭时",
|
|
132
132
|
"desc": "在对话框打开时,执行方法,promise反馈false无法截断关闭",
|
|
133
|
-
"func": "()
|
|
133
|
+
"func": "function onClose() {\n\t\n}"
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
136
|
"key": "onOk",
|
|
137
137
|
"name": "确定按钮点击",
|
|
138
138
|
"desc": "点击确定按钮时,执行方法",
|
|
139
|
-
"func": "()
|
|
139
|
+
"func": "function onOk() {\n\t\n}"
|
|
140
140
|
}
|
|
141
141
|
]
|
|
142
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
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
4
|
var _excluded = ["children"];
|
|
3
5
|
import React from 'react';
|
|
@@ -5,6 +7,11 @@ import Index from "./index";
|
|
|
5
7
|
var FunctionPreview = function FunctionPreview(_ref) {
|
|
6
8
|
var children = _ref.children,
|
|
7
9
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
8
|
-
return /*#__PURE__*/React.createElement(Index, props,
|
|
10
|
+
return /*#__PURE__*/React.createElement(Index, _extends({}, props, {
|
|
11
|
+
initData: {
|
|
12
|
+
formMode: 'update',
|
|
13
|
+
ticketData: _defineProperty({}, window.appConfig.constraintKeys.PRIMARY, 'test')
|
|
14
|
+
}
|
|
15
|
+
}), children);
|
|
9
16
|
};
|
|
10
17
|
export default FunctionPreview;
|