cloud-b2b 1.1.74 → 1.1.76
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 +67 -9
- package/es/Control/Control.js +41 -8
- package/es/InpurCascader/InputCascader.js +6 -1
- package/es/InputSearch/InputSearch.js +4 -4
- package/es/InputSelect/InputSelect.js +6 -1
- package/es/InputWriting/InputWriting.js +6 -1
- package/es/NumberInput/NumberInput.js +6 -1
- package/es/SuperForm2/SuperForm.js +30 -11
- package/es/SuperForm2/SuperForm.less +5 -3
- package/es/SuperTable/SuperTable.js +7 -1
- package/es/adjust.less +7 -2
- package/lib/Area/Area.js +71 -13
- package/lib/Control/Control.js +41 -8
- package/lib/InpurCascader/InputCascader.js +6 -1
- package/lib/InputSearch/InputSearch.js +4 -4
- package/lib/InputSelect/InputSelect.js +6 -1
- package/lib/InputWriting/InputWriting.js +6 -1
- package/lib/NumberInput/NumberInput.js +6 -1
- package/lib/SuperForm2/SuperForm.js +30 -11
- package/lib/SuperForm2/SuperForm.less +5 -3
- package/lib/SuperTable/SuperTable.js +7 -1
- package/lib/adjust.less +7 -2
- package/package.json +1 -1
package/es/Area/Area.js
CHANGED
|
@@ -8,14 +8,20 @@ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/obje
|
|
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
9
|
import _Row from "antd/es/row";
|
|
10
10
|
import _Col from "antd/es/col";
|
|
11
|
+
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
12
|
+
import _Icon from "antd/es/icon";
|
|
11
13
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
12
14
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
13
15
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
14
16
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
15
17
|
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
16
18
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
19
|
+
import _Button from "antd/es/button";
|
|
20
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
21
|
+
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
|
|
22
|
+
var _excluded = ["type", "children"];
|
|
17
23
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
24
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
25
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
20
26
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
27
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
@@ -26,6 +32,7 @@ import React from 'react';
|
|
|
26
32
|
import PropTypes from 'prop-types';
|
|
27
33
|
import helper from '../helper';
|
|
28
34
|
import Control from '../Control';
|
|
35
|
+
var defaultSize = 'small';
|
|
29
36
|
var PROPS = {
|
|
30
37
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]),
|
|
31
38
|
onChange: PropTypes.func,
|
|
@@ -33,12 +40,23 @@ var PROPS = {
|
|
|
33
40
|
onParentChange: PropTypes.func,
|
|
34
41
|
child: PropTypes.Array
|
|
35
42
|
};
|
|
43
|
+
var ButtonEx = function ButtonEx(_ref) {
|
|
44
|
+
var type = _ref.type,
|
|
45
|
+
children = _ref.children,
|
|
46
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
47
|
+
props[type === 'primary-o' ? 'data-btn-type' : 'type'] = type;
|
|
48
|
+
return /*#__PURE__*/React.createElement(_Button, _extends({
|
|
49
|
+
style: {
|
|
50
|
+
marginLeft: 2
|
|
51
|
+
}
|
|
52
|
+
}, props), children);
|
|
53
|
+
};
|
|
36
54
|
var PROPS_KEYS = _Object$keys(PROPS);
|
|
37
55
|
var Area = /*#__PURE__*/function (_React$Component) {
|
|
38
|
-
function Area(
|
|
56
|
+
function Area(_props) {
|
|
39
57
|
var _this;
|
|
40
58
|
_classCallCheck(this, Area);
|
|
41
|
-
_this = _callSuper(this, Area, [
|
|
59
|
+
_this = _callSuper(this, Area, [_props]);
|
|
42
60
|
_defineProperty(_this, "onChange", function (key, keyValue) {
|
|
43
61
|
var _this$props = _this.props,
|
|
44
62
|
onParentChange = _this$props.onParentChange,
|
|
@@ -79,9 +97,41 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
79
97
|
});
|
|
80
98
|
return flag ? onAreaSearch && onAreaSearch(key, KeyValue, parentKey) : helper.showError('请输入上级选择器');
|
|
81
99
|
});
|
|
100
|
+
_defineProperty(_this, "toControl", function (item, props) {
|
|
101
|
+
if (item.type === 'button') {
|
|
102
|
+
var key = item.key,
|
|
103
|
+
title = item.title,
|
|
104
|
+
type = item.bsStyle,
|
|
105
|
+
_item$size = item.size,
|
|
106
|
+
size = _item$size === void 0 ? 'small' : _item$size;
|
|
107
|
+
var onClick = props.onClick;
|
|
108
|
+
return /*#__PURE__*/React.createElement(ButtonEx, {
|
|
109
|
+
key: key,
|
|
110
|
+
size: size,
|
|
111
|
+
type: type,
|
|
112
|
+
onClick: onClick
|
|
113
|
+
}, title);
|
|
114
|
+
} else if (item.type === 'icon') {
|
|
115
|
+
var _onClick = props.onClick;
|
|
116
|
+
var _key = item.key,
|
|
117
|
+
icon = item.icon;
|
|
118
|
+
return /*#__PURE__*/React.createElement(_Icon, {
|
|
119
|
+
type: icon,
|
|
120
|
+
key: _key,
|
|
121
|
+
onClick: _onClick
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
return /*#__PURE__*/React.createElement(Control, props);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
_defineProperty(_this, "onClick", function (e) {
|
|
128
|
+
var onClick = _this.props.onClick;
|
|
129
|
+
var key = _typeof(e) === 'object' ? e.key : e;
|
|
130
|
+
onClick && onClick(key);
|
|
131
|
+
});
|
|
82
132
|
_this.state = {
|
|
83
|
-
value:
|
|
84
|
-
options:
|
|
133
|
+
value: _props.value || {},
|
|
134
|
+
options: _props.options || {}
|
|
85
135
|
};
|
|
86
136
|
return _this;
|
|
87
137
|
}
|
|
@@ -107,9 +157,13 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
107
157
|
_this$props3$readonly = _this$props3.readonly,
|
|
108
158
|
readonly = _this$props3$readonly === void 0 ? false : _this$props3$readonly,
|
|
109
159
|
_this$props3$value = _this$props3.value,
|
|
110
|
-
value = _this$props3$value === void 0 ? {} : _this$props3$value
|
|
160
|
+
value = _this$props3$value === void 0 ? {} : _this$props3$value,
|
|
161
|
+
_this$props3$size = _this$props3.size,
|
|
162
|
+
size = _this$props3$size === void 0 ? defaultSize : _this$props3$size,
|
|
163
|
+
_this$props3$required = _this$props3.requiredColor,
|
|
164
|
+
requiredColor = _this$props3$required === void 0 ? false : _this$props3$required;
|
|
111
165
|
return /*#__PURE__*/React.createElement(_Row, null, _mapInstanceProperty(child).call(child, function (item, index) {
|
|
112
|
-
var _context, _context2, _context3;
|
|
166
|
+
var _context, _context2, _context3, _context4;
|
|
113
167
|
var childOptions = [];
|
|
114
168
|
if (_includesInstanceProperty(_context = _Object$keys(options)).call(_context, item.key)) {
|
|
115
169
|
if (index === 0) {
|
|
@@ -120,17 +174,21 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
120
174
|
}
|
|
121
175
|
}
|
|
122
176
|
var props = _objectSpread(_objectSpread({}, item), {}, {
|
|
177
|
+
size: size,
|
|
178
|
+
isBgColor: item.required && requiredColor,
|
|
123
179
|
onSearch: _bindInstanceProperty(_context2 = _this2.onSearch).call(_context2, _this2, item.key, item, parentKey),
|
|
124
180
|
onChange: _bindInstanceProperty(_context3 = _this2.onChange).call(_context3, _this2, item.key),
|
|
181
|
+
onClick: _bindInstanceProperty(_context4 = _this2.onClick).call(_context4, _this2, item.key),
|
|
125
182
|
options: childOptions,
|
|
126
183
|
value: value[item.key] && value[item.key].title ? value[item.key].title : value[item.key],
|
|
127
184
|
type: readonly ? 'readonly' : item.type,
|
|
128
185
|
searchWhenClick: true
|
|
129
186
|
});
|
|
187
|
+
var factor = item.span || 24 / child.length;
|
|
130
188
|
return /*#__PURE__*/React.createElement(_Col, {
|
|
131
|
-
span:
|
|
189
|
+
span: factor,
|
|
132
190
|
key: item.key
|
|
133
|
-
},
|
|
191
|
+
}, _this2.toControl(item, props));
|
|
134
192
|
}));
|
|
135
193
|
}
|
|
136
194
|
}]);
|
package/es/Control/Control.js
CHANGED
|
@@ -105,7 +105,11 @@ var text = function text(props) {
|
|
|
105
105
|
if (props.value || props.defaultValue) {
|
|
106
106
|
props.title = props.value || props.defaultValue;
|
|
107
107
|
}
|
|
108
|
-
return /*#__PURE__*/React.createElement(_Input, props
|
|
108
|
+
return /*#__PURE__*/React.createElement(_Input, _extends({}, props, {
|
|
109
|
+
style: {
|
|
110
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
111
|
+
}
|
|
112
|
+
}));
|
|
109
113
|
};
|
|
110
114
|
|
|
111
115
|
// 密码输入框
|
|
@@ -123,7 +127,11 @@ var textArea = function textArea(props) {
|
|
|
123
127
|
backgroundColor: '#f0f0f0'
|
|
124
128
|
});
|
|
125
129
|
}
|
|
126
|
-
return /*#__PURE__*/React.createElement(TextArea, props
|
|
130
|
+
return /*#__PURE__*/React.createElement(TextArea, _extends({}, props, {
|
|
131
|
+
style: {
|
|
132
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
133
|
+
}
|
|
134
|
+
}));
|
|
127
135
|
};
|
|
128
136
|
|
|
129
137
|
//双选输入框
|
|
@@ -195,7 +203,11 @@ var select = function select(props) {
|
|
|
195
203
|
props.value = String(props.value);
|
|
196
204
|
}
|
|
197
205
|
}
|
|
198
|
-
return /*#__PURE__*/React.createElement(_Select,
|
|
206
|
+
return /*#__PURE__*/React.createElement(_Select, _extends({}, props, {
|
|
207
|
+
style: {
|
|
208
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
209
|
+
}
|
|
210
|
+
}), _mapInstanceProperty(options).call(options, toOption));
|
|
199
211
|
};
|
|
200
212
|
var area = function area(props) {
|
|
201
213
|
var areaProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -218,7 +230,11 @@ var selectText = function selectText(props) {
|
|
|
218
230
|
props.value && _typeof(props.value) === 'object' && (props.value = _JSON$stringify(props.value));
|
|
219
231
|
props.defaultValue && _typeof(props.defaultValue) === 'object' && (props.defaultValue = _JSON$stringify(props.defaultValue));
|
|
220
232
|
}
|
|
221
|
-
return /*#__PURE__*/React.createElement(_Select,
|
|
233
|
+
return /*#__PURE__*/React.createElement(_Select, _extends({}, props, {
|
|
234
|
+
style: {
|
|
235
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
236
|
+
}
|
|
237
|
+
}), _mapInstanceProperty(options).call(options, toOption));
|
|
222
238
|
};
|
|
223
239
|
|
|
224
240
|
// 搜索框
|
|
@@ -286,11 +302,19 @@ var date = function date(props) {
|
|
|
286
302
|
props.placeholder = '请选择日期';
|
|
287
303
|
return /*#__PURE__*/React.createElement("div", {
|
|
288
304
|
onBlur: props.onBlur
|
|
289
|
-
}, /*#__PURE__*/React.createElement(MonthPicker, props
|
|
305
|
+
}, /*#__PURE__*/React.createElement(MonthPicker, _extends({}, props, {
|
|
306
|
+
style: {
|
|
307
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
308
|
+
}
|
|
309
|
+
})));
|
|
290
310
|
}
|
|
291
311
|
return /*#__PURE__*/React.createElement("div", {
|
|
292
312
|
onBlur: props.onBlur
|
|
293
|
-
}, /*#__PURE__*/React.createElement(_DatePicker, props
|
|
313
|
+
}, /*#__PURE__*/React.createElement(_DatePicker, _extends({}, props, {
|
|
314
|
+
style: {
|
|
315
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
316
|
+
}
|
|
317
|
+
})));
|
|
294
318
|
};
|
|
295
319
|
var rangePicker = function rangePicker(props) {
|
|
296
320
|
var origin = props.onChange;
|
|
@@ -304,7 +328,11 @@ var rangePicker = function rangePicker(props) {
|
|
|
304
328
|
}
|
|
305
329
|
return /*#__PURE__*/React.createElement("div", {
|
|
306
330
|
onBlur: props.onBlur
|
|
307
|
-
}, " ", /*#__PURE__*/React.createElement(RangePicker, props
|
|
331
|
+
}, " ", /*#__PURE__*/React.createElement(RangePicker, _extends({}, props, {
|
|
332
|
+
style: {
|
|
333
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
334
|
+
}
|
|
335
|
+
})));
|
|
308
336
|
};
|
|
309
337
|
// 单选按钮组
|
|
310
338
|
var radioGroup = function radioGroup(_ref3) {
|
|
@@ -322,7 +350,12 @@ var radioGroup = function radioGroup(_ref3) {
|
|
|
322
350
|
return origin(e.target.value);
|
|
323
351
|
};
|
|
324
352
|
}
|
|
325
|
-
return /*#__PURE__*/React.createElement(RadioGroup,
|
|
353
|
+
return /*#__PURE__*/React.createElement(RadioGroup, _extends({}, props, {
|
|
354
|
+
style: {
|
|
355
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : '',
|
|
356
|
+
padding: '2px'
|
|
357
|
+
}
|
|
358
|
+
}), _mapInstanceProperty(options).call(options, toRadio));
|
|
326
359
|
};
|
|
327
360
|
|
|
328
361
|
// 富文本编辑器
|
|
@@ -7,6 +7,7 @@ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-st
|
|
|
7
7
|
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
9
|
import _Cascader from "antd/es/cascader";
|
|
10
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
10
11
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
11
12
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
12
13
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
@@ -106,7 +107,11 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
|
106
107
|
return _createClass(InputCascader, [{
|
|
107
108
|
key: "render",
|
|
108
109
|
value: function render() {
|
|
109
|
-
return /*#__PURE__*/React.createElement(_Cascader, this.getProps()
|
|
110
|
+
return /*#__PURE__*/React.createElement(_Cascader, _extends({}, this.getProps(), {
|
|
111
|
+
style: {
|
|
112
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
113
|
+
}
|
|
114
|
+
}));
|
|
110
115
|
}
|
|
111
116
|
}]);
|
|
112
117
|
}(React.Component);
|
|
@@ -236,9 +236,6 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
236
236
|
props.dataSource = _this.getDataSource();
|
|
237
237
|
props.filterOption = filter ? _this.isMatch : false;
|
|
238
238
|
}
|
|
239
|
-
if (_this.props.placeholder) {
|
|
240
|
-
props.placeholder = _this.props.placeholder;
|
|
241
|
-
}
|
|
242
239
|
return props;
|
|
243
240
|
});
|
|
244
241
|
_this.state = {
|
|
@@ -262,7 +259,10 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
262
259
|
return /*#__PURE__*/React.createElement("div", {
|
|
263
260
|
onClick: this.onClick
|
|
264
261
|
}, /*#__PURE__*/React.createElement(_AutoComplete, this.getProps(), /*#__PURE__*/React.createElement(_Input, {
|
|
265
|
-
suffix: suffix
|
|
262
|
+
suffix: suffix,
|
|
263
|
+
style: {
|
|
264
|
+
backgroundColor: this.props.isBgColor ? '#f6ffc1' : ''
|
|
265
|
+
}
|
|
266
266
|
})));
|
|
267
267
|
}
|
|
268
268
|
}]);
|
|
@@ -6,6 +6,7 @@ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
|
|
|
6
6
|
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
7
7
|
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
9
10
|
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
10
11
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
11
12
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
@@ -150,7 +151,11 @@ var InputSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
150
151
|
};
|
|
151
152
|
return /*#__PURE__*/React.createElement("div", {
|
|
152
153
|
onClick: this.onClick
|
|
153
|
-
}, /*#__PURE__*/React.createElement(_Select,
|
|
154
|
+
}, /*#__PURE__*/React.createElement(_Select, _extends({}, props, {
|
|
155
|
+
style: {
|
|
156
|
+
backgroundColor: this.props.isBgColor ? '#f6ffc1' : ''
|
|
157
|
+
}
|
|
158
|
+
}), this.props.remark ? _mapInstanceProperty(allOptions).call(allOptions, this.toRemarkOption) : _mapInstanceProperty(allOptions).call(allOptions, this.toOption)));
|
|
154
159
|
}
|
|
155
160
|
}]);
|
|
156
161
|
}(React.Component);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
3
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
4
5
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
@@ -75,7 +76,11 @@ var InputWriting = /*#__PURE__*/function (_React$Component) {
|
|
|
75
76
|
};
|
|
76
77
|
return /*#__PURE__*/React.createElement("div", {
|
|
77
78
|
onClick: this.onClick
|
|
78
|
-
}, /*#__PURE__*/React.createElement(_Select, props
|
|
79
|
+
}, /*#__PURE__*/React.createElement(_Select, _extends({}, props, {
|
|
80
|
+
style: {
|
|
81
|
+
backgroundColor: this.props.isBgColor ? '#f6ffc1' : ''
|
|
82
|
+
}
|
|
83
|
+
})));
|
|
79
84
|
}
|
|
80
85
|
}]);
|
|
81
86
|
}(React.Component);
|
|
@@ -7,6 +7,7 @@ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-st
|
|
|
7
7
|
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
9
|
import _Input from "antd/es/input";
|
|
10
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
10
11
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
11
12
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
12
13
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
@@ -189,7 +190,11 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
|
189
190
|
return _createClass(NumberInput, [{
|
|
190
191
|
key: "render",
|
|
191
192
|
value: function render() {
|
|
192
|
-
return /*#__PURE__*/React.createElement(_Input, this.getProps()
|
|
193
|
+
return /*#__PURE__*/React.createElement(_Input, _extends({}, this.getProps(), {
|
|
194
|
+
style: {
|
|
195
|
+
backgroundColor: this.props.isBgColor ? '#f6ffc1' : ''
|
|
196
|
+
}
|
|
197
|
+
}));
|
|
193
198
|
}
|
|
194
199
|
}]);
|
|
195
200
|
}(React.Component);
|
|
@@ -28,7 +28,7 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/ins
|
|
|
28
28
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
29
29
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
30
30
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
31
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context25, _context26; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context25 = ownKeys(Object(t), !0)).call(_context25, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context26 = ownKeys(Object(t))).call(_context26, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32
32
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
33
33
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
34
34
|
import React from 'react';
|
|
@@ -38,7 +38,7 @@ import helper from '../helper';
|
|
|
38
38
|
import Control, { getTitle, makeString } from '../Control';
|
|
39
39
|
import variables from '../variables';
|
|
40
40
|
var FormItem = _Form.Item;
|
|
41
|
-
var defaultSize = '
|
|
41
|
+
var defaultSize = 'default';
|
|
42
42
|
var defaultColNum = 4;
|
|
43
43
|
var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'rangePicker', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader', 'checkbox', 'treeSelect'];
|
|
44
44
|
|
|
@@ -95,7 +95,6 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
95
95
|
key: "render",
|
|
96
96
|
value: function render() {
|
|
97
97
|
var props = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
98
|
-
size: 'large',
|
|
99
98
|
value: this.state.value,
|
|
100
99
|
onChange: this.onChange
|
|
101
100
|
});
|
|
@@ -329,15 +328,21 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
329
328
|
var _this2$props3 = _this2.props,
|
|
330
329
|
_this2$props3$value = _this2$props3.value,
|
|
331
330
|
value = _this2$props3$value === void 0 ? {} : _this2$props3$value,
|
|
332
|
-
readonly = _this2$props3.readonly
|
|
331
|
+
readonly = _this2$props3.readonly,
|
|
332
|
+
_this2$props3$require = _this2$props3.requiredColor,
|
|
333
|
+
requiredColor = _this2$props3$require === void 0 ? false : _this2$props3$require,
|
|
334
|
+
_this2$props3$size = _this2$props3.size,
|
|
335
|
+
size = _this2$props3$size === void 0 ? defaultSize : _this2$props3$size;
|
|
333
336
|
var type = _this2.getType(control);
|
|
334
337
|
var props = _this2.specialProps(type, control);
|
|
335
338
|
return _objectSpread(_objectSpread({
|
|
336
339
|
autoFocus: !!status,
|
|
337
340
|
type: type
|
|
338
341
|
}, props), {}, {
|
|
339
|
-
size:
|
|
340
|
-
value: makeString(value[control.key])
|
|
342
|
+
size: size,
|
|
343
|
+
value: makeString(value[control.key]),
|
|
344
|
+
isBgColor: control.required && requiredColor,
|
|
345
|
+
requiredColor: requiredColor
|
|
341
346
|
});
|
|
342
347
|
});
|
|
343
348
|
_defineProperty(_this2, "getOptions", function (key, options) {
|
|
@@ -562,6 +567,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
562
567
|
_defineProperty(_this2, "toLabel", function (_ref10, type) {
|
|
563
568
|
var title = _ref10.title,
|
|
564
569
|
showAdd = _ref10.showAdd,
|
|
570
|
+
showQuery = _ref10.showQuery,
|
|
565
571
|
key = _ref10.key,
|
|
566
572
|
showInfo = _ref10.showInfo,
|
|
567
573
|
showInfoTitle = _ref10.showInfoTitle;
|
|
@@ -573,6 +579,14 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
573
579
|
type: "plus-circle-o",
|
|
574
580
|
onClick: onClick
|
|
575
581
|
}));
|
|
582
|
+
} else if (showQuery && type !== 'readonly') {
|
|
583
|
+
var _context23;
|
|
584
|
+
var _onClick = _bindInstanceProperty(_context23 = _this2.onAdd).call(_context23, _this2, key, title);
|
|
585
|
+
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
586
|
+
role: "add",
|
|
587
|
+
type: "search",
|
|
588
|
+
onClick: _onClick
|
|
589
|
+
}));
|
|
576
590
|
} else if (showInfo) {
|
|
577
591
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
578
592
|
title: showInfoTitle
|
|
@@ -594,7 +608,11 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
594
608
|
};
|
|
595
609
|
var _this2$props4 = _this2.props,
|
|
596
610
|
checkable = _this2$props4.checkable,
|
|
597
|
-
onCheckItem = _this2$props4.onCheckItem
|
|
611
|
+
onCheckItem = _this2$props4.onCheckItem,
|
|
612
|
+
_this2$props4$isGridF = _this2$props4.isGridForm,
|
|
613
|
+
isGridForm = _this2$props4$isGridF === void 0 ? false : _this2$props4$isGridF;
|
|
614
|
+
var labelSpan = factor === 3 ? 3 : factor === 2 ? 4 : 8;
|
|
615
|
+
var smSpan = control.title ? factor === 3 ? 21 : factor === 2 ? 20 : 16 : 24;
|
|
598
616
|
return control.type !== 'empty' ? /*#__PURE__*/React.createElement(_Col, {
|
|
599
617
|
span: span * factor,
|
|
600
618
|
key: control.key
|
|
@@ -609,7 +627,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
609
627
|
span: 24
|
|
610
628
|
},
|
|
611
629
|
sm: {
|
|
612
|
-
span:
|
|
630
|
+
span: labelSpan
|
|
613
631
|
}
|
|
614
632
|
},
|
|
615
633
|
wrapperCol: {
|
|
@@ -617,7 +635,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
617
635
|
span: 24
|
|
618
636
|
},
|
|
619
637
|
sm: {
|
|
620
|
-
span:
|
|
638
|
+
span: smSpan
|
|
621
639
|
}
|
|
622
640
|
}
|
|
623
641
|
}), _this2.toControl(controlProps, control))) : /*#__PURE__*/React.createElement(_Col, {
|
|
@@ -629,7 +647,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
629
647
|
});
|
|
630
648
|
});
|
|
631
649
|
_defineProperty(_this2, "toCols", function () {
|
|
632
|
-
var
|
|
650
|
+
var _context24;
|
|
633
651
|
var _this2$props5 = _this2.props,
|
|
634
652
|
_this2$props5$colNum = _this2$props5.colNum,
|
|
635
653
|
colNum = _this2$props5$colNum === void 0 ? defaultColNum : _this2$props5$colNum,
|
|
@@ -638,7 +656,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
638
656
|
colNum = 1;
|
|
639
657
|
}
|
|
640
658
|
var span = 24 / colNum;
|
|
641
|
-
return _mapInstanceProperty(
|
|
659
|
+
return _mapInstanceProperty(_context24 = _this2.getControls()).call(_context24, function (control) {
|
|
642
660
|
if (allFullFather) {
|
|
643
661
|
control.allFullFather = allFullFather;
|
|
644
662
|
}
|
|
@@ -671,6 +689,7 @@ _defineProperty(SuperForm2, "propTypes", {
|
|
|
671
689
|
controls: PropTypes.arrayOf(PropTypes.shape(ControlType)).isRequired,
|
|
672
690
|
value: PropTypes.object,
|
|
673
691
|
colNum: PropTypes.number,
|
|
692
|
+
requiredColor: PropTypes.bool,
|
|
674
693
|
valid: PropTypes.bool,
|
|
675
694
|
readonly: PropTypes.oneOfType([PropTypes.bool, PropTypes.array]),
|
|
676
695
|
hideControls: PropTypes.array,
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
:global(.ant-form-item-label) {
|
|
20
20
|
line-height: 16px;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
:global(.ant-col-sm-24) {
|
|
23
|
+
text-align: center;
|
|
24
|
+
}
|
|
23
25
|
:global(.ant-form-item-control) > span > textArea {
|
|
24
26
|
min-height: 22px !important;
|
|
25
27
|
margin-bottom: 0 !important;
|
|
@@ -51,8 +53,8 @@
|
|
|
51
53
|
position: absolute;
|
|
52
54
|
top:15px;
|
|
53
55
|
}
|
|
54
|
-
|
|
55
|
-
.formItemWithCheckbox{
|
|
56
|
+
// ========== 修复后的自定义样式 ==========
|
|
57
|
+
& :global(.formItemWithCheckbox).ant-form-item {
|
|
56
58
|
margin-left: 20px;
|
|
57
59
|
}
|
|
58
60
|
}
|
|
@@ -80,6 +80,7 @@ var ItemType = {
|
|
|
80
80
|
* onLink: 点击超链接时触发,原型为func(key, rowIndex, item)
|
|
81
81
|
* onTableChange: 排序信息改变时触发,原型为func(sortInfo, filterInfo)
|
|
82
82
|
* onMoveRow:行拖曳排序时触发,原型为func(dragIndex, targetIndex)
|
|
83
|
+
* onRenderCustom:(废弃)用于渲染type为custom类型的单元格,原型为function(rowIndex, keyName, value,item)
|
|
83
84
|
*/
|
|
84
85
|
var CallbackType = {
|
|
85
86
|
onCheck: PropTypes.func,
|
|
@@ -87,7 +88,8 @@ var CallbackType = {
|
|
|
87
88
|
onDoubleClick: PropTypes.func,
|
|
88
89
|
onLink: PropTypes.func,
|
|
89
90
|
onTableChange: PropTypes.func,
|
|
90
|
-
onMoveRow: PropTypes.func
|
|
91
|
+
onMoveRow: PropTypes.func,
|
|
92
|
+
onRenderCustom: PropTypes.func
|
|
91
93
|
};
|
|
92
94
|
|
|
93
95
|
/**
|
|
@@ -445,6 +447,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
445
447
|
col.render = function (text, record, index) {
|
|
446
448
|
return _this.tags(col.key, index, items[index], col);
|
|
447
449
|
};
|
|
450
|
+
} else if (col.type === 'custom') {
|
|
451
|
+
col.render = function (text, record, index) {
|
|
452
|
+
return _this.props.callback.onRenderCustom(index, col.key, record[col.key], record);
|
|
453
|
+
};
|
|
448
454
|
}
|
|
449
455
|
return col;
|
|
450
456
|
});
|
package/es/adjust.less
CHANGED
|
@@ -43,11 +43,16 @@
|
|
|
43
43
|
height: @input-height-sm !important;
|
|
44
44
|
overflow: hidden;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
.ant-select .ant-select-selection {
|
|
47
|
+
background-color: inherit !important;
|
|
48
|
+
}
|
|
47
49
|
.ant-form-vertical .ant-form-item {
|
|
48
50
|
padding-bottom: 0;
|
|
49
51
|
}
|
|
50
|
-
|
|
52
|
+
.ant-calendar-picker-input,
|
|
53
|
+
.ant-range-picker .ant-calendar-picker-input {
|
|
54
|
+
background-color: inherit !important;
|
|
55
|
+
}
|
|
51
56
|
.ant-form-item-control {
|
|
52
57
|
line-height: @input-height-sm;
|
|
53
58
|
|
package/lib/Area/Area.js
CHANGED
|
@@ -14,26 +14,33 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
14
14
|
value: true
|
|
15
15
|
});
|
|
16
16
|
exports["default"] = void 0;
|
|
17
|
+
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
18
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
19
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
20
|
+
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
17
21
|
var _row = _interopRequireDefault(require("antd/lib/row"));
|
|
18
22
|
var _col = _interopRequireDefault(require("antd/lib/col"));
|
|
23
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
24
|
+
var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
19
25
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
20
26
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
21
27
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
22
28
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
23
29
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
24
30
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
31
|
+
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
32
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
33
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
29
34
|
var _react = _interopRequireDefault(require("react"));
|
|
30
35
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
31
36
|
var _helper = _interopRequireDefault(require("../helper"));
|
|
32
37
|
var _Control = _interopRequireDefault(require("../Control"));
|
|
38
|
+
var _excluded = ["type", "children"];
|
|
33
39
|
function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
34
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
40
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
35
41
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
36
42
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
43
|
+
var defaultSize = 'small';
|
|
37
44
|
var PROPS = {
|
|
38
45
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number, _propTypes["default"].object]),
|
|
39
46
|
onChange: _propTypes["default"].func,
|
|
@@ -41,12 +48,23 @@ var PROPS = {
|
|
|
41
48
|
onParentChange: _propTypes["default"].func,
|
|
42
49
|
child: _propTypes["default"].Array
|
|
43
50
|
};
|
|
51
|
+
var ButtonEx = function ButtonEx(_ref) {
|
|
52
|
+
var type = _ref.type,
|
|
53
|
+
children = _ref.children,
|
|
54
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
55
|
+
props[type === 'primary-o' ? 'data-btn-type' : 'type'] = type;
|
|
56
|
+
return /*#__PURE__*/_react["default"].createElement(_button["default"], (0, _extends2["default"])({
|
|
57
|
+
style: {
|
|
58
|
+
marginLeft: 2
|
|
59
|
+
}
|
|
60
|
+
}, props), children);
|
|
61
|
+
};
|
|
44
62
|
var PROPS_KEYS = (0, _keys["default"])(PROPS);
|
|
45
63
|
var Area = /*#__PURE__*/function (_React$Component) {
|
|
46
|
-
function Area(
|
|
64
|
+
function Area(_props) {
|
|
47
65
|
var _this;
|
|
48
66
|
(0, _classCallCheck2["default"])(this, Area);
|
|
49
|
-
_this = _callSuper(this, Area, [
|
|
67
|
+
_this = _callSuper(this, Area, [_props]);
|
|
50
68
|
(0, _defineProperty2["default"])(_this, "onChange", function (key, keyValue) {
|
|
51
69
|
var _this$props = _this.props,
|
|
52
70
|
onParentChange = _this$props.onParentChange,
|
|
@@ -87,9 +105,41 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
87
105
|
});
|
|
88
106
|
return flag ? onAreaSearch && onAreaSearch(key, KeyValue, parentKey) : _helper["default"].showError('请输入上级选择器');
|
|
89
107
|
});
|
|
108
|
+
(0, _defineProperty2["default"])(_this, "toControl", function (item, props) {
|
|
109
|
+
if (item.type === 'button') {
|
|
110
|
+
var key = item.key,
|
|
111
|
+
title = item.title,
|
|
112
|
+
type = item.bsStyle,
|
|
113
|
+
_item$size = item.size,
|
|
114
|
+
size = _item$size === void 0 ? 'small' : _item$size;
|
|
115
|
+
var onClick = props.onClick;
|
|
116
|
+
return /*#__PURE__*/_react["default"].createElement(ButtonEx, {
|
|
117
|
+
key: key,
|
|
118
|
+
size: size,
|
|
119
|
+
type: type,
|
|
120
|
+
onClick: onClick
|
|
121
|
+
}, title);
|
|
122
|
+
} else if (item.type === 'icon') {
|
|
123
|
+
var _onClick = props.onClick;
|
|
124
|
+
var _key = item.key,
|
|
125
|
+
icon = item.icon;
|
|
126
|
+
return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
127
|
+
type: icon,
|
|
128
|
+
key: _key,
|
|
129
|
+
onClick: _onClick
|
|
130
|
+
});
|
|
131
|
+
} else {
|
|
132
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
(0, _defineProperty2["default"])(_this, "onClick", function (e) {
|
|
136
|
+
var onClick = _this.props.onClick;
|
|
137
|
+
var key = (0, _typeof2["default"])(e) === 'object' ? e.key : e;
|
|
138
|
+
onClick && onClick(key);
|
|
139
|
+
});
|
|
90
140
|
_this.state = {
|
|
91
|
-
value:
|
|
92
|
-
options:
|
|
141
|
+
value: _props.value || {},
|
|
142
|
+
options: _props.options || {}
|
|
93
143
|
};
|
|
94
144
|
return _this;
|
|
95
145
|
}
|
|
@@ -115,9 +165,13 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
115
165
|
_this$props3$readonly = _this$props3.readonly,
|
|
116
166
|
readonly = _this$props3$readonly === void 0 ? false : _this$props3$readonly,
|
|
117
167
|
_this$props3$value = _this$props3.value,
|
|
118
|
-
value = _this$props3$value === void 0 ? {} : _this$props3$value
|
|
168
|
+
value = _this$props3$value === void 0 ? {} : _this$props3$value,
|
|
169
|
+
_this$props3$size = _this$props3.size,
|
|
170
|
+
size = _this$props3$size === void 0 ? defaultSize : _this$props3$size,
|
|
171
|
+
_this$props3$required = _this$props3.requiredColor,
|
|
172
|
+
requiredColor = _this$props3$required === void 0 ? false : _this$props3$required;
|
|
119
173
|
return /*#__PURE__*/_react["default"].createElement(_row["default"], null, (0, _map["default"])(child).call(child, function (item, index) {
|
|
120
|
-
var _context, _context2, _context3;
|
|
174
|
+
var _context, _context2, _context3, _context4;
|
|
121
175
|
var childOptions = [];
|
|
122
176
|
if ((0, _includes["default"])(_context = (0, _keys["default"])(options)).call(_context, item.key)) {
|
|
123
177
|
if (index === 0) {
|
|
@@ -128,17 +182,21 @@ var Area = /*#__PURE__*/function (_React$Component) {
|
|
|
128
182
|
}
|
|
129
183
|
}
|
|
130
184
|
var props = _objectSpread(_objectSpread({}, item), {}, {
|
|
185
|
+
size: size,
|
|
186
|
+
isBgColor: item.required && requiredColor,
|
|
131
187
|
onSearch: (0, _bind["default"])(_context2 = _this2.onSearch).call(_context2, _this2, item.key, item, parentKey),
|
|
132
188
|
onChange: (0, _bind["default"])(_context3 = _this2.onChange).call(_context3, _this2, item.key),
|
|
189
|
+
onClick: (0, _bind["default"])(_context4 = _this2.onClick).call(_context4, _this2, item.key),
|
|
133
190
|
options: childOptions,
|
|
134
191
|
value: value[item.key] && value[item.key].title ? value[item.key].title : value[item.key],
|
|
135
192
|
type: readonly ? 'readonly' : item.type,
|
|
136
193
|
searchWhenClick: true
|
|
137
194
|
});
|
|
195
|
+
var factor = item.span || 24 / child.length;
|
|
138
196
|
return /*#__PURE__*/_react["default"].createElement(_col["default"], {
|
|
139
|
-
span:
|
|
197
|
+
span: factor,
|
|
140
198
|
key: item.key
|
|
141
|
-
},
|
|
199
|
+
}, _this2.toControl(item, props));
|
|
142
200
|
}));
|
|
143
201
|
}
|
|
144
202
|
}]);
|
package/lib/Control/Control.js
CHANGED
|
@@ -112,7 +112,11 @@ var text = function text(props) {
|
|
|
112
112
|
if (props.value || props.defaultValue) {
|
|
113
113
|
props.title = props.value || props.defaultValue;
|
|
114
114
|
}
|
|
115
|
-
return /*#__PURE__*/_react["default"].createElement(_input["default"], props
|
|
115
|
+
return /*#__PURE__*/_react["default"].createElement(_input["default"], (0, _extends2["default"])({}, props, {
|
|
116
|
+
style: {
|
|
117
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
118
|
+
}
|
|
119
|
+
}));
|
|
116
120
|
};
|
|
117
121
|
|
|
118
122
|
// 密码输入框
|
|
@@ -130,7 +134,11 @@ var textArea = function textArea(props) {
|
|
|
130
134
|
backgroundColor: '#f0f0f0'
|
|
131
135
|
});
|
|
132
136
|
}
|
|
133
|
-
return /*#__PURE__*/_react["default"].createElement(TextArea, props
|
|
137
|
+
return /*#__PURE__*/_react["default"].createElement(TextArea, (0, _extends2["default"])({}, props, {
|
|
138
|
+
style: {
|
|
139
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
140
|
+
}
|
|
141
|
+
}));
|
|
134
142
|
};
|
|
135
143
|
|
|
136
144
|
//双选输入框
|
|
@@ -202,7 +210,11 @@ var select = function select(props) {
|
|
|
202
210
|
props.value = String(props.value);
|
|
203
211
|
}
|
|
204
212
|
}
|
|
205
|
-
return /*#__PURE__*/_react["default"].createElement(_select["default"],
|
|
213
|
+
return /*#__PURE__*/_react["default"].createElement(_select["default"], (0, _extends2["default"])({}, props, {
|
|
214
|
+
style: {
|
|
215
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
216
|
+
}
|
|
217
|
+
}), (0, _map["default"])(options).call(options, toOption));
|
|
206
218
|
};
|
|
207
219
|
var area = function area(props) {
|
|
208
220
|
var areaProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -225,7 +237,11 @@ var selectText = function selectText(props) {
|
|
|
225
237
|
props.value && (0, _typeof2["default"])(props.value) === 'object' && (props.value = (0, _stringify["default"])(props.value));
|
|
226
238
|
props.defaultValue && (0, _typeof2["default"])(props.defaultValue) === 'object' && (props.defaultValue = (0, _stringify["default"])(props.defaultValue));
|
|
227
239
|
}
|
|
228
|
-
return /*#__PURE__*/_react["default"].createElement(_select["default"],
|
|
240
|
+
return /*#__PURE__*/_react["default"].createElement(_select["default"], (0, _extends2["default"])({}, props, {
|
|
241
|
+
style: {
|
|
242
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
243
|
+
}
|
|
244
|
+
}), (0, _map["default"])(options).call(options, toOption));
|
|
229
245
|
};
|
|
230
246
|
|
|
231
247
|
// 搜索框
|
|
@@ -293,11 +309,19 @@ var date = function date(props) {
|
|
|
293
309
|
props.placeholder = '请选择日期';
|
|
294
310
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
295
311
|
onBlur: props.onBlur
|
|
296
|
-
}, /*#__PURE__*/_react["default"].createElement(MonthPicker, props
|
|
312
|
+
}, /*#__PURE__*/_react["default"].createElement(MonthPicker, (0, _extends2["default"])({}, props, {
|
|
313
|
+
style: {
|
|
314
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
315
|
+
}
|
|
316
|
+
})));
|
|
297
317
|
}
|
|
298
318
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
299
319
|
onBlur: props.onBlur
|
|
300
|
-
}, /*#__PURE__*/_react["default"].createElement(_datePicker["default"], props
|
|
320
|
+
}, /*#__PURE__*/_react["default"].createElement(_datePicker["default"], (0, _extends2["default"])({}, props, {
|
|
321
|
+
style: {
|
|
322
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
323
|
+
}
|
|
324
|
+
})));
|
|
301
325
|
};
|
|
302
326
|
var rangePicker = function rangePicker(props) {
|
|
303
327
|
var origin = props.onChange;
|
|
@@ -311,7 +335,11 @@ var rangePicker = function rangePicker(props) {
|
|
|
311
335
|
}
|
|
312
336
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
313
337
|
onBlur: props.onBlur
|
|
314
|
-
}, " ", /*#__PURE__*/_react["default"].createElement(RangePicker, props
|
|
338
|
+
}, " ", /*#__PURE__*/_react["default"].createElement(RangePicker, (0, _extends2["default"])({}, props, {
|
|
339
|
+
style: {
|
|
340
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
341
|
+
}
|
|
342
|
+
})));
|
|
315
343
|
};
|
|
316
344
|
// 单选按钮组
|
|
317
345
|
var radioGroup = function radioGroup(_ref3) {
|
|
@@ -329,7 +357,12 @@ var radioGroup = function radioGroup(_ref3) {
|
|
|
329
357
|
return origin(e.target.value);
|
|
330
358
|
};
|
|
331
359
|
}
|
|
332
|
-
return /*#__PURE__*/_react["default"].createElement(RadioGroup,
|
|
360
|
+
return /*#__PURE__*/_react["default"].createElement(RadioGroup, (0, _extends2["default"])({}, props, {
|
|
361
|
+
style: {
|
|
362
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : '',
|
|
363
|
+
padding: '2px'
|
|
364
|
+
}
|
|
365
|
+
}), (0, _map["default"])(options).call(options, toRadio));
|
|
333
366
|
};
|
|
334
367
|
|
|
335
368
|
// 富文本编辑器
|
|
@@ -15,6 +15,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
15
15
|
});
|
|
16
16
|
exports["default"] = void 0;
|
|
17
17
|
var _cascader = _interopRequireDefault(require("antd/lib/cascader"));
|
|
18
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
18
19
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
19
20
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
20
21
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
@@ -113,7 +114,11 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
|
113
114
|
return (0, _createClass2["default"])(InputCascader, [{
|
|
114
115
|
key: "render",
|
|
115
116
|
value: function render() {
|
|
116
|
-
return /*#__PURE__*/_react["default"].createElement(_cascader["default"], this.getProps()
|
|
117
|
+
return /*#__PURE__*/_react["default"].createElement(_cascader["default"], (0, _extends2["default"])({}, this.getProps(), {
|
|
118
|
+
style: {
|
|
119
|
+
backgroundColor: props.isBgColor ? '#f6ffc1' : ''
|
|
120
|
+
}
|
|
121
|
+
}));
|
|
117
122
|
}
|
|
118
123
|
}]);
|
|
119
124
|
}(_react["default"].Component);
|
|
@@ -244,9 +244,6 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
244
244
|
props.dataSource = _this.getDataSource();
|
|
245
245
|
props.filterOption = filter ? _this.isMatch : false;
|
|
246
246
|
}
|
|
247
|
-
if (_this.props.placeholder) {
|
|
248
|
-
props.placeholder = _this.props.placeholder;
|
|
249
|
-
}
|
|
250
247
|
return props;
|
|
251
248
|
});
|
|
252
249
|
_this.state = {
|
|
@@ -270,7 +267,10 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
270
267
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
271
268
|
onClick: this.onClick
|
|
272
269
|
}, /*#__PURE__*/_react["default"].createElement(_autoComplete["default"], this.getProps(), /*#__PURE__*/_react["default"].createElement(_input["default"], {
|
|
273
|
-
suffix: suffix
|
|
270
|
+
suffix: suffix,
|
|
271
|
+
style: {
|
|
272
|
+
backgroundColor: this.props.isBgColor ? '#f6ffc1' : ''
|
|
273
|
+
}
|
|
274
274
|
})));
|
|
275
275
|
}
|
|
276
276
|
}]);
|
|
@@ -21,6 +21,7 @@ var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta
|
|
|
21
21
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
22
22
|
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
23
23
|
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
24
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
24
25
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
25
26
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
26
27
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
@@ -158,7 +159,11 @@ var InputSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
158
159
|
};
|
|
159
160
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
160
161
|
onClick: this.onClick
|
|
161
|
-
}, /*#__PURE__*/_react["default"].createElement(_select["default"],
|
|
162
|
+
}, /*#__PURE__*/_react["default"].createElement(_select["default"], (0, _extends2["default"])({}, props, {
|
|
163
|
+
style: {
|
|
164
|
+
backgroundColor: this.props.isBgColor ? '#f6ffc1' : ''
|
|
165
|
+
}
|
|
166
|
+
}), this.props.remark ? (0, _map["default"])(allOptions).call(allOptions, this.toRemarkOption) : (0, _map["default"])(allOptions).call(allOptions, this.toOption)));
|
|
162
167
|
}
|
|
163
168
|
}]);
|
|
164
169
|
}(_react["default"].Component);
|
|
@@ -9,6 +9,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports["default"] = void 0;
|
|
10
10
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
11
11
|
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
12
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
13
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
14
15
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
@@ -83,7 +84,11 @@ var InputWriting = /*#__PURE__*/function (_React$Component) {
|
|
|
83
84
|
};
|
|
84
85
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
85
86
|
onClick: this.onClick
|
|
86
|
-
}, /*#__PURE__*/_react["default"].createElement(_select["default"], props
|
|
87
|
+
}, /*#__PURE__*/_react["default"].createElement(_select["default"], (0, _extends2["default"])({}, props, {
|
|
88
|
+
style: {
|
|
89
|
+
backgroundColor: this.props.isBgColor ? '#f6ffc1' : ''
|
|
90
|
+
}
|
|
91
|
+
})));
|
|
87
92
|
}
|
|
88
93
|
}]);
|
|
89
94
|
}(_react["default"].Component);
|
|
@@ -15,6 +15,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
15
15
|
});
|
|
16
16
|
exports["default"] = void 0;
|
|
17
17
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
18
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
18
19
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
19
20
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
20
21
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
@@ -197,7 +198,11 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
|
197
198
|
return (0, _createClass2["default"])(NumberInput, [{
|
|
198
199
|
key: "render",
|
|
199
200
|
value: function render() {
|
|
200
|
-
return /*#__PURE__*/_react["default"].createElement(_input["default"], this.getProps()
|
|
201
|
+
return /*#__PURE__*/_react["default"].createElement(_input["default"], (0, _extends2["default"])({}, this.getProps(), {
|
|
202
|
+
style: {
|
|
203
|
+
backgroundColor: this.props.isBgColor ? '#f6ffc1' : ''
|
|
204
|
+
}
|
|
205
|
+
}));
|
|
201
206
|
}
|
|
202
207
|
}]);
|
|
203
208
|
}(_react["default"].Component);
|
|
@@ -45,11 +45,11 @@ var _Control = _interopRequireWildcard(require("../Control"));
|
|
|
45
45
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
46
46
|
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
47
47
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
48
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
48
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context25, _context26; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context25 = ownKeys(Object(t), !0)).call(_context25, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context26 = ownKeys(Object(t))).call(_context26, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
49
49
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
50
50
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
51
51
|
var FormItem = _form["default"].Item;
|
|
52
|
-
var defaultSize = '
|
|
52
|
+
var defaultSize = 'default';
|
|
53
53
|
var defaultColNum = 4;
|
|
54
54
|
var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'rangePicker', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader', 'checkbox', 'treeSelect'];
|
|
55
55
|
|
|
@@ -106,7 +106,6 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
106
106
|
key: "render",
|
|
107
107
|
value: function render() {
|
|
108
108
|
var props = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
109
|
-
size: 'large',
|
|
110
109
|
value: this.state.value,
|
|
111
110
|
onChange: this.onChange
|
|
112
111
|
});
|
|
@@ -340,15 +339,21 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
340
339
|
var _this2$props3 = _this2.props,
|
|
341
340
|
_this2$props3$value = _this2$props3.value,
|
|
342
341
|
value = _this2$props3$value === void 0 ? {} : _this2$props3$value,
|
|
343
|
-
readonly = _this2$props3.readonly
|
|
342
|
+
readonly = _this2$props3.readonly,
|
|
343
|
+
_this2$props3$require = _this2$props3.requiredColor,
|
|
344
|
+
requiredColor = _this2$props3$require === void 0 ? false : _this2$props3$require,
|
|
345
|
+
_this2$props3$size = _this2$props3.size,
|
|
346
|
+
size = _this2$props3$size === void 0 ? defaultSize : _this2$props3$size;
|
|
344
347
|
var type = _this2.getType(control);
|
|
345
348
|
var props = _this2.specialProps(type, control);
|
|
346
349
|
return _objectSpread(_objectSpread({
|
|
347
350
|
autoFocus: !!status,
|
|
348
351
|
type: type
|
|
349
352
|
}, props), {}, {
|
|
350
|
-
size:
|
|
351
|
-
value: (0, _Control.makeString)(value[control.key])
|
|
353
|
+
size: size,
|
|
354
|
+
value: (0, _Control.makeString)(value[control.key]),
|
|
355
|
+
isBgColor: control.required && requiredColor,
|
|
356
|
+
requiredColor: requiredColor
|
|
352
357
|
});
|
|
353
358
|
});
|
|
354
359
|
(0, _defineProperty2["default"])(_this2, "getOptions", function (key, options) {
|
|
@@ -573,6 +578,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
573
578
|
(0, _defineProperty2["default"])(_this2, "toLabel", function (_ref10, type) {
|
|
574
579
|
var title = _ref10.title,
|
|
575
580
|
showAdd = _ref10.showAdd,
|
|
581
|
+
showQuery = _ref10.showQuery,
|
|
576
582
|
key = _ref10.key,
|
|
577
583
|
showInfo = _ref10.showInfo,
|
|
578
584
|
showInfoTitle = _ref10.showInfoTitle;
|
|
@@ -584,6 +590,14 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
584
590
|
type: "plus-circle-o",
|
|
585
591
|
onClick: onClick
|
|
586
592
|
}));
|
|
593
|
+
} else if (showQuery && type !== 'readonly') {
|
|
594
|
+
var _context23;
|
|
595
|
+
var _onClick = (0, _bind["default"])(_context23 = _this2.onAdd).call(_context23, _this2, key, title);
|
|
596
|
+
return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
597
|
+
role: "add",
|
|
598
|
+
type: "search",
|
|
599
|
+
onClick: _onClick
|
|
600
|
+
}));
|
|
587
601
|
} else if (showInfo) {
|
|
588
602
|
return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
589
603
|
title: showInfoTitle
|
|
@@ -605,7 +619,11 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
605
619
|
};
|
|
606
620
|
var _this2$props4 = _this2.props,
|
|
607
621
|
checkable = _this2$props4.checkable,
|
|
608
|
-
onCheckItem = _this2$props4.onCheckItem
|
|
622
|
+
onCheckItem = _this2$props4.onCheckItem,
|
|
623
|
+
_this2$props4$isGridF = _this2$props4.isGridForm,
|
|
624
|
+
isGridForm = _this2$props4$isGridF === void 0 ? false : _this2$props4$isGridF;
|
|
625
|
+
var labelSpan = factor === 3 ? 3 : factor === 2 ? 4 : 8;
|
|
626
|
+
var smSpan = control.title ? factor === 3 ? 21 : factor === 2 ? 20 : 16 : 24;
|
|
609
627
|
return control.type !== 'empty' ? /*#__PURE__*/_react["default"].createElement(_col["default"], {
|
|
610
628
|
span: span * factor,
|
|
611
629
|
key: control.key
|
|
@@ -620,7 +638,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
620
638
|
span: 24
|
|
621
639
|
},
|
|
622
640
|
sm: {
|
|
623
|
-
span:
|
|
641
|
+
span: labelSpan
|
|
624
642
|
}
|
|
625
643
|
},
|
|
626
644
|
wrapperCol: {
|
|
@@ -628,7 +646,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
628
646
|
span: 24
|
|
629
647
|
},
|
|
630
648
|
sm: {
|
|
631
|
-
span:
|
|
649
|
+
span: smSpan
|
|
632
650
|
}
|
|
633
651
|
}
|
|
634
652
|
}), _this2.toControl(controlProps, control))) : /*#__PURE__*/_react["default"].createElement(_col["default"], {
|
|
@@ -640,7 +658,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
640
658
|
});
|
|
641
659
|
});
|
|
642
660
|
(0, _defineProperty2["default"])(_this2, "toCols", function () {
|
|
643
|
-
var
|
|
661
|
+
var _context24;
|
|
644
662
|
var _this2$props5 = _this2.props,
|
|
645
663
|
_this2$props5$colNum = _this2$props5.colNum,
|
|
646
664
|
colNum = _this2$props5$colNum === void 0 ? defaultColNum : _this2$props5$colNum,
|
|
@@ -649,7 +667,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
649
667
|
colNum = 1;
|
|
650
668
|
}
|
|
651
669
|
var span = 24 / colNum;
|
|
652
|
-
return (0, _map["default"])(
|
|
670
|
+
return (0, _map["default"])(_context24 = _this2.getControls()).call(_context24, function (control) {
|
|
653
671
|
if (allFullFather) {
|
|
654
672
|
control.allFullFather = allFullFather;
|
|
655
673
|
}
|
|
@@ -682,6 +700,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
|
|
|
682
700
|
controls: _propTypes["default"].arrayOf(_propTypes["default"].shape(ControlType)).isRequired,
|
|
683
701
|
value: _propTypes["default"].object,
|
|
684
702
|
colNum: _propTypes["default"].number,
|
|
703
|
+
requiredColor: _propTypes["default"].bool,
|
|
685
704
|
valid: _propTypes["default"].bool,
|
|
686
705
|
readonly: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].array]),
|
|
687
706
|
hideControls: _propTypes["default"].array,
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
:global(.ant-form-item-label) {
|
|
20
20
|
line-height: 16px;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
:global(.ant-col-sm-24) {
|
|
23
|
+
text-align: center;
|
|
24
|
+
}
|
|
23
25
|
:global(.ant-form-item-control) > span > textArea {
|
|
24
26
|
min-height: 22px !important;
|
|
25
27
|
margin-bottom: 0 !important;
|
|
@@ -51,8 +53,8 @@
|
|
|
51
53
|
position: absolute;
|
|
52
54
|
top:15px;
|
|
53
55
|
}
|
|
54
|
-
|
|
55
|
-
.formItemWithCheckbox{
|
|
56
|
+
// ========== 修复后的自定义样式 ==========
|
|
57
|
+
& :global(.formItemWithCheckbox).ant-form-item {
|
|
56
58
|
margin-left: 20px;
|
|
57
59
|
}
|
|
58
60
|
}
|
|
@@ -88,6 +88,7 @@ var ItemType = {
|
|
|
88
88
|
* onLink: 点击超链接时触发,原型为func(key, rowIndex, item)
|
|
89
89
|
* onTableChange: 排序信息改变时触发,原型为func(sortInfo, filterInfo)
|
|
90
90
|
* onMoveRow:行拖曳排序时触发,原型为func(dragIndex, targetIndex)
|
|
91
|
+
* onRenderCustom:(废弃)用于渲染type为custom类型的单元格,原型为function(rowIndex, keyName, value,item)
|
|
91
92
|
*/
|
|
92
93
|
var CallbackType = {
|
|
93
94
|
onCheck: _propTypes["default"].func,
|
|
@@ -95,7 +96,8 @@ var CallbackType = {
|
|
|
95
96
|
onDoubleClick: _propTypes["default"].func,
|
|
96
97
|
onLink: _propTypes["default"].func,
|
|
97
98
|
onTableChange: _propTypes["default"].func,
|
|
98
|
-
onMoveRow: _propTypes["default"].func
|
|
99
|
+
onMoveRow: _propTypes["default"].func,
|
|
100
|
+
onRenderCustom: _propTypes["default"].func
|
|
99
101
|
};
|
|
100
102
|
|
|
101
103
|
/**
|
|
@@ -453,6 +455,10 @@ var SuperTable = /*#__PURE__*/function (_React$Component) {
|
|
|
453
455
|
col.render = function (text, record, index) {
|
|
454
456
|
return _this.tags(col.key, index, items[index], col);
|
|
455
457
|
};
|
|
458
|
+
} else if (col.type === 'custom') {
|
|
459
|
+
col.render = function (text, record, index) {
|
|
460
|
+
return _this.props.callback.onRenderCustom(index, col.key, record[col.key], record);
|
|
461
|
+
};
|
|
456
462
|
}
|
|
457
463
|
return col;
|
|
458
464
|
});
|
package/lib/adjust.less
CHANGED
|
@@ -43,11 +43,16 @@
|
|
|
43
43
|
height: @input-height-sm !important;
|
|
44
44
|
overflow: hidden;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
.ant-select .ant-select-selection {
|
|
47
|
+
background-color: inherit !important;
|
|
48
|
+
}
|
|
47
49
|
.ant-form-vertical .ant-form-item {
|
|
48
50
|
padding-bottom: 0;
|
|
49
51
|
}
|
|
50
|
-
|
|
52
|
+
.ant-calendar-picker-input,
|
|
53
|
+
.ant-range-picker .ant-calendar-picker-input {
|
|
54
|
+
background-color: inherit !important;
|
|
55
|
+
}
|
|
51
56
|
.ant-form-item-control {
|
|
52
57
|
line-height: @input-height-sm;
|
|
53
58
|
|