cloud-b2b 1.1.46 → 1.1.50
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/Area/Area.js +45 -16
- package/es/Card/Card.js +4 -3
- package/es/CodeInput/CodeInput.js +59 -30
- package/es/Control/Control.js +117 -58
- package/es/Control/event.js +14 -0
- package/es/Enhance/Dialogs.js +21 -6
- package/es/Enhance/Loading.js +46 -26
- package/es/Enhance/index.js +2 -0
- package/es/Header/Header.js +35 -3
- package/es/Header/Vertical.js +24 -1
- package/es/ImageView/ImageView.js +22 -5
- package/es/Indent/Indent.js +7 -3
- package/es/InpurCascader/InputCascader.js +36 -10
- package/es/InputEditor/InputEditor.js +52 -53
- package/es/InputSearch/InputSearch.js +71 -26
- package/es/InputSelect/InputSelect.js +48 -17
- package/es/InputTreeSelect/InputTreeSelect.js +147 -0
- package/es/InputTreeSelect/package.json +6 -0
- package/es/InputWriting/InputWriting.js +28 -6
- package/es/Layout/Layout.js +59 -28
- package/es/LayoutLink/LayoutLink.js +20 -11
- package/es/Link/Link.js +27 -4
- package/es/Loading/Loading.js +3 -1
- package/es/Loading2/Loading2.js +2 -0
- package/es/ModalWithDrag/ModalWithDrag.js +8 -3
- package/es/ModalWithDrag/drag.js +29 -12
- package/es/NumberInput/NumberInput.js +64 -24
- package/es/Search/Search.js +164 -54
- package/es/Sidebar/Sidebar.js +34 -13
- package/es/Sidebar2/Sidebar.js +30 -3
- package/es/SuperForm/SuperForm.js +164 -27
- package/es/SuperForm2/SuperForm.js +182 -31
- package/es/SuperIcon/SuperIcon.js +6 -3
- package/es/SuperPagination/SuperPagination.js +32 -15
- package/es/SuperTab/SuperTab.js +27 -4
- package/es/SuperTab2/SuperTab2.js +33 -11
- package/es/SuperTable/DragSortRow.js +34 -6
- package/es/SuperTable/FilterDropDown.js +34 -10
- package/es/SuperTable/SuperTable.js +216 -84
- package/es/SuperTable/fixed.js +9 -1
- package/es/SuperTable2/SuperTable2.js +226 -101
- package/es/SuperTable2/SuperTableCell.js +60 -16
- package/es/SuperTable3/FilterDropDown.js +34 -10
- package/es/SuperTable3/SuperTable.js +175 -50
- package/es/SuperTable3/fixed.js +9 -1
- package/es/SuperToolbar/SuperToolbar.js +49 -21
- package/es/SuperUpload/SuperUpload.js +233 -156
- package/es/Title/Title.js +15 -12
- package/es/Viewer/ImageViews.js +60 -7
- package/es/Viewer/Viewer.js +32 -5
- package/es/WingBlank/WingBlank.js +6 -2
- package/es/helper.js +29 -7
- package/es/history.js +2 -3
- package/lib/Area/Area.js +64 -16
- package/lib/Card/Card.js +13 -3
- package/lib/CodeInput/CodeInput.js +77 -30
- package/lib/Control/Control.js +160 -58
- package/lib/Control/event.js +16 -0
- package/lib/Enhance/Dialogs.js +32 -6
- package/lib/Enhance/Loading.js +62 -26
- package/lib/Enhance/index.js +9 -0
- package/lib/Header/Header.js +48 -3
- package/lib/Header/Vertical.js +36 -1
- package/lib/ImageView/ImageView.js +30 -5
- package/lib/Indent/Indent.js +13 -3
- package/lib/InpurCascader/InputCascader.js +50 -11
- package/lib/InputEditor/InputEditor.js +61 -53
- package/lib/InputSearch/InputSearch.js +78 -26
- package/lib/InputSelect/InputSelect.js +62 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +169 -0
- package/lib/InputTreeSelect/package.json +6 -0
- package/lib/InputWriting/InputWriting.js +35 -6
- package/lib/Layout/Layout.js +76 -28
- package/lib/LayoutLink/LayoutLink.js +38 -11
- package/lib/Link/Link.js +40 -4
- package/lib/Loading/Loading.js +9 -1
- package/lib/Loading2/Loading2.js +8 -0
- package/lib/ModalWithDrag/ModalWithDrag.js +18 -3
- package/lib/ModalWithDrag/drag.js +34 -12
- package/lib/NumberInput/NumberInput.js +77 -24
- package/lib/Search/Search.js +171 -54
- package/lib/Sidebar/Sidebar.js +46 -13
- package/lib/Sidebar2/Sidebar.js +42 -3
- package/lib/SuperForm/SuperForm.js +162 -27
- package/lib/SuperForm2/SuperForm.js +175 -31
- package/lib/SuperIcon/SuperIcon.js +14 -3
- package/lib/SuperPagination/SuperPagination.js +42 -15
- package/lib/SuperTab/SuperTab.js +34 -4
- package/lib/SuperTab2/SuperTab2.js +48 -11
- package/lib/SuperTable/DragSortRow.js +42 -6
- package/lib/SuperTable/FilterDropDown.js +42 -10
- package/lib/SuperTable/SuperTable.js +211 -83
- package/lib/SuperTable/fixed.js +13 -1
- package/lib/SuperTable2/SuperTable2.js +240 -101
- package/lib/SuperTable2/SuperTableCell.js +67 -13
- package/lib/SuperTable3/FilterDropDown.js +42 -10
- package/lib/SuperTable3/SuperTable.js +170 -49
- package/lib/SuperTable3/fixed.js +13 -1
- package/lib/SuperToolbar/SuperToolbar.js +64 -20
- package/lib/SuperUpload/SuperUpload.js +267 -156
- package/lib/Title/Title.js +24 -12
- package/lib/Viewer/ImageViews.js +63 -7
- package/lib/Viewer/Viewer.js +41 -5
- package/lib/WingBlank/WingBlank.js +14 -2
- package/lib/helper.js +47 -6
- package/lib/history.js +5 -0
- package/lib/index.js +76 -0
- package/lib/variables.js +4 -0
- package/package.json +2 -2
package/es/Control/Control.js
CHANGED
|
@@ -15,9 +15,12 @@ import _Radio from "antd/es/radio";
|
|
|
15
15
|
import _Input from "antd/es/input";
|
|
16
16
|
import _Select from "antd/es/select";
|
|
17
17
|
var _excluded = ["options"],
|
|
18
|
-
|
|
18
|
+
_excluded2 = ["type", "autoFocus"];
|
|
19
|
+
|
|
19
20
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
20
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
+
|
|
21
24
|
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
22
25
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
23
26
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
@@ -37,6 +40,7 @@ import InputEditor from '../InputEditor';
|
|
|
37
40
|
import InputSelect from '../InputSelect';
|
|
38
41
|
import InputWriting from '../InputWriting';
|
|
39
42
|
import InpurCascader from '../InpurCascader';
|
|
43
|
+
import InputTreeSelect from '../InputTreeSelect';
|
|
40
44
|
import moment from 'moment';
|
|
41
45
|
import eventWrapper from './event';
|
|
42
46
|
import CodeInput from '../CodeInput';
|
|
@@ -46,8 +50,10 @@ var SelectOption = _Select.Option;
|
|
|
46
50
|
var TextArea = _Input.TextArea;
|
|
47
51
|
var RadioGroup = _Radio.Group;
|
|
48
52
|
moment.locale('zh-cn');
|
|
53
|
+
|
|
49
54
|
var getTitleOptions = function getTitleOptions(options) {
|
|
50
55
|
var existTitles = [];
|
|
56
|
+
|
|
51
57
|
if (options) {
|
|
52
58
|
return _reduceInstanceProperty(options).call(options, function (result, option) {
|
|
53
59
|
if (_includesInstanceProperty(existTitles).call(existTitles, option.title)) {
|
|
@@ -64,9 +70,9 @@ var getTitleOptions = function getTitleOptions(options) {
|
|
|
64
70
|
} else {
|
|
65
71
|
return options;
|
|
66
72
|
}
|
|
67
|
-
};
|
|
73
|
+
}; // 设置组件焦点
|
|
74
|
+
|
|
68
75
|
|
|
69
|
-
// 设置组件焦点
|
|
70
76
|
var setFocus = function setFocus(element, type) {
|
|
71
77
|
if (element) {
|
|
72
78
|
if (element.focus) {
|
|
@@ -78,41 +84,44 @@ var setFocus = function setFocus(element, type) {
|
|
|
78
84
|
}
|
|
79
85
|
}
|
|
80
86
|
};
|
|
87
|
+
|
|
81
88
|
var toOption = function toOption(_ref, index) {
|
|
82
89
|
var value = _ref.value,
|
|
83
|
-
|
|
90
|
+
title = _ref.title;
|
|
84
91
|
return /*#__PURE__*/React.createElement(SelectOption, {
|
|
85
92
|
key: index,
|
|
86
93
|
value: String(value)
|
|
87
94
|
}, title);
|
|
88
95
|
};
|
|
96
|
+
|
|
89
97
|
var toRadio = function toRadio(_ref2, index) {
|
|
90
98
|
var value = _ref2.value,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
99
|
+
title = _ref2.title,
|
|
100
|
+
_ref2$disabled = _ref2.disabled,
|
|
101
|
+
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled;
|
|
94
102
|
return /*#__PURE__*/React.createElement(_Radio, {
|
|
95
103
|
key: index,
|
|
96
104
|
value: String(value),
|
|
97
105
|
disabled: disabled
|
|
98
106
|
}, title);
|
|
99
|
-
};
|
|
107
|
+
}; // 文本输入框
|
|
108
|
+
|
|
100
109
|
|
|
101
|
-
// 文本输入框
|
|
102
110
|
var text = function text(props) {
|
|
103
111
|
if (props.value || props.defaultValue) {
|
|
104
112
|
props.title = props.value || props.defaultValue;
|
|
105
113
|
}
|
|
114
|
+
|
|
106
115
|
return /*#__PURE__*/React.createElement(_Input, props);
|
|
107
|
-
};
|
|
116
|
+
}; // 密码输入框
|
|
117
|
+
|
|
108
118
|
|
|
109
|
-
// 密码输入框
|
|
110
119
|
var password = function password(props) {
|
|
111
120
|
props.type = 'password';
|
|
112
121
|
return /*#__PURE__*/React.createElement(_Input, props);
|
|
113
|
-
};
|
|
122
|
+
}; // 多行文本输入框
|
|
123
|
+
|
|
114
124
|
|
|
115
|
-
// 多行文本输入框
|
|
116
125
|
var textArea = function textArea(props) {
|
|
117
126
|
if (props.readonly) {
|
|
118
127
|
delete props.readonly;
|
|
@@ -121,25 +130,30 @@ var textArea = function textArea(props) {
|
|
|
121
130
|
backgroundColor: '#f0f0f0'
|
|
122
131
|
});
|
|
123
132
|
}
|
|
133
|
+
|
|
124
134
|
return /*#__PURE__*/React.createElement(TextArea, props);
|
|
125
|
-
};
|
|
135
|
+
}; //双选输入框
|
|
136
|
+
|
|
126
137
|
|
|
127
|
-
//双选输入框
|
|
128
138
|
var _double = function _double(props) {
|
|
129
139
|
if (props.ref) {
|
|
130
140
|
props.inputRef = props.ref;
|
|
131
141
|
delete props.ref;
|
|
132
142
|
}
|
|
143
|
+
|
|
133
144
|
var doubleKey = props.doubleKey,
|
|
134
|
-
|
|
145
|
+
onChange = props.onChange;
|
|
146
|
+
|
|
135
147
|
var props1 = _objectSpread(_objectSpread({}, props), {}, {
|
|
136
148
|
defaultValue: props.doubleValue[props.doubleKey[0]],
|
|
137
149
|
onChange: props.onChangeKey1
|
|
138
150
|
});
|
|
151
|
+
|
|
139
152
|
var props2 = _objectSpread(_objectSpread({}, props), {}, {
|
|
140
153
|
defaultValue: props.doubleValue[props.doubleKey[1]],
|
|
141
154
|
onChange: props.onChangeKey2
|
|
142
155
|
});
|
|
156
|
+
|
|
143
157
|
return /*#__PURE__*/React.createElement("div", {
|
|
144
158
|
style: {
|
|
145
159
|
display: 'flex'
|
|
@@ -149,66 +163,77 @@ var _double = function _double(props) {
|
|
|
149
163
|
}, props1)), "~", /*#__PURE__*/React.createElement(NumberInput, _extends({
|
|
150
164
|
key: doubleKey[1]
|
|
151
165
|
}, props2)));
|
|
152
|
-
};
|
|
166
|
+
}; // 只读框
|
|
167
|
+
|
|
153
168
|
|
|
154
|
-
// 只读框
|
|
155
169
|
var readonly = function readonly(props) {
|
|
156
170
|
props.readOnly = true;
|
|
157
171
|
props.style = _Object$assign(props.style || {}, {
|
|
158
172
|
backgroundColor: '#f0f0f0'
|
|
159
173
|
});
|
|
174
|
+
|
|
160
175
|
if (props.value || props.defaultValue) {
|
|
161
176
|
props.title = props.value || props.defaultValue;
|
|
162
177
|
}
|
|
178
|
+
|
|
163
179
|
return /*#__PURE__*/React.createElement(_Input, props);
|
|
164
|
-
};
|
|
180
|
+
}; // 数字输入框
|
|
181
|
+
|
|
165
182
|
|
|
166
|
-
// 数字输入框
|
|
167
183
|
var number = function number(props) {
|
|
168
184
|
if (props.ref) {
|
|
169
185
|
props.inputRef = props.ref;
|
|
170
186
|
delete props.ref;
|
|
171
187
|
}
|
|
188
|
+
|
|
172
189
|
return /*#__PURE__*/React.createElement(NumberInput, props);
|
|
173
190
|
};
|
|
191
|
+
|
|
174
192
|
var isMatch = function isMatch(inputValue, option) {
|
|
175
193
|
var _context;
|
|
194
|
+
|
|
176
195
|
return _indexOfInstanceProperty(_context = option.props.children).call(_context, inputValue) !== -1;
|
|
177
|
-
};
|
|
196
|
+
}; // 下拉选择框
|
|
197
|
+
|
|
178
198
|
|
|
179
|
-
// 下拉选择框
|
|
180
199
|
var select = function select(props) {
|
|
181
200
|
var options = props.options || [];
|
|
182
201
|
delete props.options;
|
|
183
202
|
props.showSearch = true;
|
|
184
203
|
props.filterOption = isMatch;
|
|
185
204
|
props.allowClear !== false && (props.allowClear = true);
|
|
205
|
+
|
|
186
206
|
if (props.mode === 'multiple') {
|
|
187
207
|
!props.value && typeof props.value !== 'undefined' && (props.value = []);
|
|
188
208
|
!props.defaultValue && typeof props.defaultValue !== 'undefined' && (props.defaultValue = []);
|
|
189
209
|
} else {
|
|
190
210
|
props.value && _typeof(props.value) === 'object' && (props.value = _JSON$stringify(props.value));
|
|
191
211
|
props.defaultValue && _typeof(props.defaultValue) === 'object' && (props.defaultValue = _JSON$stringify(props.defaultValue));
|
|
212
|
+
|
|
192
213
|
if (props.value !== true && props.value !== false && props.value !== '' && props.value !== undefined) {
|
|
193
214
|
props.value = String(props.value);
|
|
194
215
|
}
|
|
195
216
|
}
|
|
217
|
+
|
|
196
218
|
return /*#__PURE__*/React.createElement(_Select, props, _mapInstanceProperty(options).call(options, toOption));
|
|
197
219
|
};
|
|
220
|
+
|
|
198
221
|
var area = function area(props) {
|
|
199
222
|
var areaProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
200
223
|
onParentChange: props.onChange
|
|
201
224
|
});
|
|
225
|
+
|
|
202
226
|
return /*#__PURE__*/React.createElement(Area, areaProps);
|
|
203
|
-
};
|
|
227
|
+
}; // 下拉选择框-取title作为值
|
|
228
|
+
|
|
204
229
|
|
|
205
|
-
// 下拉选择框-取title作为值
|
|
206
230
|
var selectText = function selectText(props) {
|
|
207
231
|
var options = getTitleOptions(props.options) || [];
|
|
208
232
|
delete props.options;
|
|
209
233
|
props.showSearch = true;
|
|
210
234
|
props.filterOption = isMatch;
|
|
211
235
|
props.allowClear !== false && (props.allowClear = true);
|
|
236
|
+
|
|
212
237
|
if (props.mode === 'multiple') {
|
|
213
238
|
!props.value && typeof props.value !== 'undefined' && (props.value = []);
|
|
214
239
|
!props.defaultValue && typeof props.defaultValue !== 'undefined' && (props.defaultValue = []);
|
|
@@ -216,56 +241,64 @@ var selectText = function selectText(props) {
|
|
|
216
241
|
props.value && _typeof(props.value) === 'object' && (props.value = _JSON$stringify(props.value));
|
|
217
242
|
props.defaultValue && _typeof(props.defaultValue) === 'object' && (props.defaultValue = _JSON$stringify(props.defaultValue));
|
|
218
243
|
}
|
|
244
|
+
|
|
219
245
|
return /*#__PURE__*/React.createElement(_Select, props, _mapInstanceProperty(options).call(options, toOption));
|
|
220
|
-
};
|
|
246
|
+
}; // 搜索框
|
|
247
|
+
|
|
221
248
|
|
|
222
|
-
// 搜索框
|
|
223
249
|
var search = function search(props) {
|
|
224
250
|
if (props.ref) {
|
|
225
251
|
props.inputRef = props.ref;
|
|
226
252
|
delete props.ref;
|
|
227
253
|
}
|
|
254
|
+
|
|
228
255
|
return /*#__PURE__*/React.createElement(InputSearch, props);
|
|
229
|
-
};
|
|
256
|
+
}; // 搜索框-值取title
|
|
257
|
+
|
|
230
258
|
|
|
231
|
-
// 搜索框-值取title
|
|
232
259
|
var searchText = function searchText(props) {
|
|
233
260
|
if (props.ref) {
|
|
234
261
|
props.inputRef = props.ref;
|
|
235
262
|
delete props.ref;
|
|
236
263
|
}
|
|
264
|
+
|
|
237
265
|
props.options = getTitleOptions(props.options);
|
|
238
266
|
return /*#__PURE__*/React.createElement(InputSearch, props);
|
|
239
|
-
};
|
|
267
|
+
}; // 多选下拉搜索
|
|
268
|
+
|
|
240
269
|
|
|
241
|
-
// 多选下拉搜索
|
|
242
270
|
var selectSearch = function selectSearch(props) {
|
|
243
271
|
!props.value && typeof props.value !== 'undefined' && (props.value = []);
|
|
244
272
|
return /*#__PURE__*/React.createElement(InputSelect, props);
|
|
245
|
-
};
|
|
273
|
+
}; // 多选手写下拉 不支持title,value形式
|
|
274
|
+
|
|
246
275
|
|
|
247
|
-
// 多选手写下拉 不支持title,value形式
|
|
248
276
|
var selectWriting = function selectWriting(props) {
|
|
249
277
|
!props.value && typeof props.value !== 'undefined' && (props.value = []);
|
|
250
278
|
return /*#__PURE__*/React.createElement(InputWriting, props);
|
|
251
|
-
};
|
|
279
|
+
}; // 日期选择框
|
|
280
|
+
|
|
252
281
|
|
|
253
|
-
// 日期选择框
|
|
254
282
|
var date = function date(props) {
|
|
255
283
|
var origin = props.onChange;
|
|
256
284
|
var MonthPicker = _DatePicker.MonthPicker;
|
|
285
|
+
|
|
257
286
|
if (typeof props.value !== 'undefined') {
|
|
258
287
|
props.value = !props.value ? undefined : moment(props.value);
|
|
259
288
|
}
|
|
289
|
+
|
|
260
290
|
if (typeof props.defaultValue !== 'undefined') {
|
|
261
291
|
props.defaultValue = !props.defaultValue ? undefined : moment(props.defaultValue);
|
|
262
292
|
}
|
|
293
|
+
|
|
263
294
|
if (props.showTime) {
|
|
264
295
|
props.format = 'YYYY-MM-DD HH:mm:ss';
|
|
265
296
|
props.placeholder = '请选择时间';
|
|
297
|
+
|
|
266
298
|
if (typeof props.showTime === 'boolean') {
|
|
267
299
|
props.showTime = '00:00:00';
|
|
268
300
|
}
|
|
301
|
+
|
|
269
302
|
if (props.showTime !== 'current') {
|
|
270
303
|
props.showTime = {
|
|
271
304
|
defaultValue: moment(props.showTime, 'HH:mm:ss')
|
|
@@ -274,11 +307,13 @@ var date = function date(props) {
|
|
|
274
307
|
props.showTime = true;
|
|
275
308
|
}
|
|
276
309
|
}
|
|
310
|
+
|
|
277
311
|
if (props.onChange) {
|
|
278
312
|
props.onChange = function (date, str) {
|
|
279
313
|
return origin(str);
|
|
280
314
|
};
|
|
281
315
|
}
|
|
316
|
+
|
|
282
317
|
if (props.month) {
|
|
283
318
|
props.format = 'YYYY-MM';
|
|
284
319
|
props.placeholder = '请选择日期';
|
|
@@ -286,56 +321,70 @@ var date = function date(props) {
|
|
|
286
321
|
onBlur: props.onBlur
|
|
287
322
|
}, /*#__PURE__*/React.createElement(MonthPicker, props));
|
|
288
323
|
}
|
|
324
|
+
|
|
289
325
|
return /*#__PURE__*/React.createElement("div", {
|
|
290
326
|
onBlur: props.onBlur
|
|
291
327
|
}, /*#__PURE__*/React.createElement(_DatePicker, props));
|
|
292
|
-
};
|
|
328
|
+
}; // 单选按钮组
|
|
329
|
+
|
|
293
330
|
|
|
294
|
-
// 单选按钮组
|
|
295
331
|
var radioGroup = function radioGroup(_ref3) {
|
|
296
332
|
var _ref3$options = _ref3.options,
|
|
297
|
-
|
|
298
|
-
|
|
333
|
+
options = _ref3$options === void 0 ? [] : _ref3$options,
|
|
334
|
+
props = _objectWithoutProperties(_ref3, _excluded);
|
|
335
|
+
|
|
299
336
|
var origin = props.onChange;
|
|
300
337
|
props.style = {
|
|
301
338
|
borderSpacing: 0
|
|
302
339
|
};
|
|
303
340
|
typeof props.value === 'number' && (props.value = String(props.value));
|
|
304
341
|
typeof props.defaultValue === 'number' && (props.defaultValue = String(props.defaultValue));
|
|
342
|
+
|
|
305
343
|
if (props.onChange) {
|
|
306
344
|
props.onChange = function (e) {
|
|
307
345
|
return origin(e.target.value);
|
|
308
346
|
};
|
|
309
347
|
}
|
|
348
|
+
|
|
310
349
|
return /*#__PURE__*/React.createElement(RadioGroup, props, _mapInstanceProperty(options).call(options, toRadio));
|
|
311
|
-
};
|
|
350
|
+
}; // 富文本编辑器
|
|
351
|
+
|
|
312
352
|
|
|
313
|
-
// 富文本编辑器
|
|
314
353
|
var editor = function editor(props) {
|
|
315
354
|
return /*#__PURE__*/React.createElement(InputEditor, props);
|
|
316
|
-
};
|
|
355
|
+
}; //级联选择下拉
|
|
356
|
+
|
|
317
357
|
|
|
318
|
-
//级联选择下拉
|
|
319
358
|
var cascader = function cascader(props) {
|
|
320
359
|
!props.value && typeof props.value !== 'undefined' && (props.value = []);
|
|
321
360
|
return /*#__PURE__*/React.createElement(InpurCascader, props);
|
|
361
|
+
}; //树型结构
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
var treeSelect = function treeSelect(props) {
|
|
365
|
+
!props.value && typeof props.value !== 'undefined' && (props.value = []);
|
|
366
|
+
return /*#__PURE__*/React.createElement(InputTreeSelect, props);
|
|
322
367
|
};
|
|
368
|
+
|
|
323
369
|
var captcha = function captcha(props) {
|
|
324
370
|
if (props.ref) {
|
|
325
371
|
props.inputRef = props.ref;
|
|
326
372
|
delete props.ref;
|
|
327
373
|
}
|
|
374
|
+
|
|
328
375
|
return /*#__PURE__*/React.createElement(CodeInput, props);
|
|
329
376
|
};
|
|
377
|
+
|
|
330
378
|
var uploadImg = function uploadImg(props) {
|
|
331
379
|
var uploadProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
332
380
|
fileList: props.value || [],
|
|
333
381
|
readonly: props.readonly || false
|
|
334
382
|
});
|
|
383
|
+
|
|
335
384
|
return /*#__PURE__*/React.createElement(SuperUpload, uploadProps);
|
|
336
|
-
};
|
|
385
|
+
}; // 支持的控件类型
|
|
386
|
+
|
|
337
387
|
|
|
338
|
-
// 支持的控件类型
|
|
339
388
|
var controls = {
|
|
340
389
|
text: text,
|
|
341
390
|
textArea: textArea,
|
|
@@ -355,23 +404,26 @@ var controls = {
|
|
|
355
404
|
captcha: captcha,
|
|
356
405
|
area: area,
|
|
357
406
|
uploadImg: uploadImg,
|
|
358
|
-
"double": _double
|
|
407
|
+
"double": _double,
|
|
408
|
+
treeSelect: treeSelect
|
|
359
409
|
};
|
|
410
|
+
|
|
360
411
|
var Control = function Control(_ref4) {
|
|
361
412
|
var type = _ref4.type,
|
|
362
|
-
|
|
363
|
-
|
|
413
|
+
autoFocus = _ref4.autoFocus,
|
|
414
|
+
props = _objectWithoutProperties(_ref4, _excluded2);
|
|
415
|
+
|
|
364
416
|
var ref = autoFocus ? function (e) {
|
|
365
417
|
return setFocus(e, type);
|
|
366
418
|
} : null;
|
|
367
419
|
var _props$doubleKey = props.doubleKey,
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
420
|
+
doubleKey = _props$doubleKey === void 0 ? undefined : _props$doubleKey,
|
|
421
|
+
_props$onChangeKey = props.onChangeKey1,
|
|
422
|
+
onChangeKey1 = _props$onChangeKey === void 0 ? undefined : _props$onChangeKey,
|
|
423
|
+
_props$onChangeKey2 = props.onChangeKey2,
|
|
424
|
+
onChangeKey2 = _props$onChangeKey2 === void 0 ? undefined : _props$onChangeKey2,
|
|
425
|
+
_props$doubleValue = props.doubleValue,
|
|
426
|
+
doubleValue = _props$doubleValue === void 0 ? {} : _props$doubleValue;
|
|
375
427
|
return controls[type](_Object$assign(eventWrapper(props), type === 'double' ? {
|
|
376
428
|
ref: ref,
|
|
377
429
|
doubleKey: doubleKey,
|
|
@@ -382,6 +434,7 @@ var Control = function Control(_ref4) {
|
|
|
382
434
|
ref: ref
|
|
383
435
|
}));
|
|
384
436
|
};
|
|
437
|
+
|
|
385
438
|
Control.propTypes = {
|
|
386
439
|
type: PropTypes.string.isRequired,
|
|
387
440
|
autoFocus: PropTypes.bool,
|
|
@@ -389,28 +442,32 @@ Control.propTypes = {
|
|
|
389
442
|
onSearch: PropTypes.func,
|
|
390
443
|
onBlur: PropTypes.func,
|
|
391
444
|
onGetCode: PropTypes.func
|
|
392
|
-
};
|
|
445
|
+
}; // 依据value查找对应的标题
|
|
393
446
|
|
|
394
|
-
// 依据value查找对应的标题
|
|
395
447
|
var getTitle = function getTitle(value) {
|
|
396
448
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
449
|
+
|
|
397
450
|
if (typeof value === 'undefined') {
|
|
398
451
|
return '';
|
|
399
452
|
} else if (_typeof(value) === 'object') {
|
|
400
453
|
if (_Array$isArray(value)) {
|
|
401
454
|
if (options && options.length > 0) {
|
|
402
455
|
var _context2;
|
|
456
|
+
|
|
403
457
|
// 处理多选字典下拉变成只读的情况:
|
|
404
458
|
return _trimInstanceProperty(_context2 = _reduceInstanceProperty(value).call(value, function (val, it) {
|
|
405
459
|
var item = _findInstanceProperty(options).call(options, function (o) {
|
|
406
460
|
return o.value === it;
|
|
407
461
|
});
|
|
462
|
+
|
|
408
463
|
if (item) {
|
|
409
464
|
val += " ".concat(item.title);
|
|
410
465
|
}
|
|
466
|
+
|
|
411
467
|
return val;
|
|
412
468
|
}, '')).call(_context2);
|
|
413
469
|
}
|
|
470
|
+
|
|
414
471
|
return value;
|
|
415
472
|
} else {
|
|
416
473
|
return value ? value.title : '';
|
|
@@ -419,11 +476,12 @@ var getTitle = function getTitle(value) {
|
|
|
419
476
|
var index = _findIndexInstanceProperty(options).call(options, function (obj) {
|
|
420
477
|
return String(obj.value) === String(value);
|
|
421
478
|
});
|
|
479
|
+
|
|
422
480
|
return index === -1 ? value : options[index].title;
|
|
423
481
|
}
|
|
424
|
-
};
|
|
482
|
+
}; // 确保value的值为字符串(包含value和title的对象除外)
|
|
483
|
+
|
|
425
484
|
|
|
426
|
-
// 确保value的值为字符串(包含value和title的对象除外)
|
|
427
485
|
var makeString = function makeString(value) {
|
|
428
486
|
if (value === null || typeof value === 'undefined') {
|
|
429
487
|
return '';
|
|
@@ -433,5 +491,6 @@ var makeString = function makeString(value) {
|
|
|
433
491
|
return value;
|
|
434
492
|
}
|
|
435
493
|
};
|
|
494
|
+
|
|
436
495
|
export default Control;
|
|
437
496
|
export { getTitle, makeString };
|
package/es/Control/event.js
CHANGED
|
@@ -4,40 +4,54 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
|
4
4
|
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
5
5
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
6
6
|
import { getObjectExclude } from '../helper';
|
|
7
|
+
|
|
7
8
|
var EventHandler = /*#__PURE__*/_createClass(function EventHandler(props) {
|
|
8
9
|
var _this = this;
|
|
10
|
+
|
|
9
11
|
_classCallCheck(this, EventHandler);
|
|
12
|
+
|
|
10
13
|
_defineProperty(this, "toValue", function () {
|
|
11
14
|
var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
15
|
+
|
|
12
16
|
if (event === null) {
|
|
13
17
|
return '';
|
|
14
18
|
} else {
|
|
15
19
|
return event.nativeEvent ? event.target.value : event;
|
|
16
20
|
}
|
|
17
21
|
});
|
|
22
|
+
|
|
18
23
|
_defineProperty(this, "onChange", function (event) {
|
|
19
24
|
_this.props.onChange(_this.toValue(event));
|
|
20
25
|
});
|
|
26
|
+
|
|
21
27
|
_defineProperty(this, "onBlur", function (event) {
|
|
22
28
|
_this.props.onBlur(_this.toValue(event), event);
|
|
23
29
|
});
|
|
30
|
+
|
|
24
31
|
_defineProperty(this, "onSearch", function (event) {
|
|
25
32
|
_this.props.onSearch(_this.toValue(event));
|
|
26
33
|
});
|
|
34
|
+
|
|
27
35
|
this.props = props;
|
|
28
36
|
});
|
|
37
|
+
|
|
29
38
|
var replaceEvent = function replaceEvent(props, handler) {
|
|
30
39
|
var events = ['onChange', 'onBlur', 'onSearch'];
|
|
40
|
+
|
|
31
41
|
var callback = _reduceInstanceProperty(events).call(events, function (result, event) {
|
|
32
42
|
if (props[event]) {
|
|
33
43
|
result[event] = handler[event];
|
|
34
44
|
}
|
|
45
|
+
|
|
35
46
|
return result;
|
|
36
47
|
}, {});
|
|
48
|
+
|
|
37
49
|
return _Object$assign({}, getObjectExclude(props, events), callback);
|
|
38
50
|
};
|
|
51
|
+
|
|
39
52
|
var eventWrapper = function eventWrapper(props) {
|
|
40
53
|
var handler = new EventHandler(props);
|
|
41
54
|
return replaceEvent(props, handler);
|
|
42
55
|
};
|
|
56
|
+
|
|
43
57
|
export default eventWrapper;
|
package/es/Enhance/Dialogs.js
CHANGED
|
@@ -8,23 +8,34 @@ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
9
9
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
10
10
|
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
11
|
+
|
|
11
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
|
+
|
|
12
14
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
|
+
|
|
13
16
|
import React from 'react';
|
|
14
17
|
import { getObjectExclude } from '../helper';
|
|
18
|
+
|
|
15
19
|
var Enhance = function Enhance(Container, keys, Dialogs) {
|
|
16
20
|
var noContainer = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
17
21
|
return /*#__PURE__*/function (_React$Component) {
|
|
18
|
-
_inherits(
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
_inherits(_class, _React$Component);
|
|
23
|
+
|
|
24
|
+
var _super = _createSuper(_class);
|
|
25
|
+
|
|
26
|
+
function _class() {
|
|
21
27
|
var _context;
|
|
28
|
+
|
|
22
29
|
var _this;
|
|
23
|
-
|
|
30
|
+
|
|
31
|
+
_classCallCheck(this, _class);
|
|
32
|
+
|
|
24
33
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
34
|
args[_key] = arguments[_key];
|
|
26
35
|
}
|
|
36
|
+
|
|
27
37
|
_this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
38
|
+
|
|
28
39
|
_defineProperty(_assertThisInitialized(_this), "toDialogs", function () {
|
|
29
40
|
return _reduceInstanceProperty(keys).call(keys, function (result, key, index) {
|
|
30
41
|
var Dialog = Dialogs[index];
|
|
@@ -35,9 +46,11 @@ var Enhance = function Enhance(Container, keys, Dialogs) {
|
|
|
35
46
|
return result;
|
|
36
47
|
}, []);
|
|
37
48
|
});
|
|
49
|
+
|
|
38
50
|
return _this;
|
|
39
51
|
}
|
|
40
|
-
|
|
52
|
+
|
|
53
|
+
_createClass(_class, [{
|
|
41
54
|
key: "render",
|
|
42
55
|
value: function render() {
|
|
43
56
|
var props = getObjectExclude(this.props, keys);
|
|
@@ -46,7 +59,9 @@ var Enhance = function Enhance(Container, keys, Dialogs) {
|
|
|
46
59
|
}, /*#__PURE__*/React.createElement(Container, props), this.toDialogs());
|
|
47
60
|
}
|
|
48
61
|
}]);
|
|
49
|
-
|
|
62
|
+
|
|
63
|
+
return _class;
|
|
50
64
|
}(React.Component);
|
|
51
65
|
};
|
|
66
|
+
|
|
52
67
|
export default Enhance;
|