cloud-b2b 1.1.27 → 1.1.28
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 +16 -45
- package/es/Card/Card.js +3 -4
- package/es/CodeInput/CodeInput.js +30 -59
- package/es/Control/Control.js +47 -94
- package/es/Control/event.js +0 -14
- package/es/Enhance/Dialogs.js +0 -15
- package/es/Enhance/Loading.js +16 -36
- package/es/Enhance/index.js +0 -2
- package/es/Header/Header.js +3 -35
- package/es/Header/Vertical.js +1 -24
- package/es/ImageView/ImageView.js +5 -22
- package/es/Indent/Indent.js +3 -7
- package/es/InpurCascader/InputCascader.js +10 -36
- package/es/InputEditor/InputEditor.js +55 -55
- package/es/InputSearch/InputSearch.js +26 -71
- package/es/InputSelect/InputSelect.js +17 -48
- package/es/InputWriting/InputWriting.js +6 -28
- package/es/Layout/Layout.js +28 -59
- package/es/LayoutLink/LayoutLink.js +11 -20
- package/es/Link/Link.js +4 -27
- package/es/Loading/Loading.js +1 -3
- package/es/Loading2/Loading2.js +0 -2
- package/es/ModalWithDrag/ModalWithDrag.js +3 -8
- package/es/ModalWithDrag/drag.js +12 -29
- package/es/NumberInput/NumberInput.js +24 -63
- package/es/Search/Search.js +53 -149
- package/es/Sidebar/Sidebar.js +13 -34
- package/es/Sidebar2/Sidebar.js +3 -30
- package/es/SuperForm/SuperForm.js +27 -150
- package/es/SuperForm2/SuperForm.js +31 -165
- package/es/SuperIcon/SuperIcon.js +3 -6
- package/es/SuperPagination/SuperPagination.js +15 -32
- package/es/SuperTab/SuperTab.js +4 -27
- package/es/SuperTab2/SuperTab2.js +11 -33
- package/es/SuperTable/DragSortRow.js +6 -34
- package/es/SuperTable/FilterDropDown.js +10 -34
- package/es/SuperTable/SuperTable.js +91 -216
- package/es/SuperTable/fixed.js +1 -9
- package/es/SuperTable2/SuperTable2.js +95 -206
- package/es/SuperTable2/SuperTableCell.js +16 -55
- package/es/SuperTable3/FilterDropDown.js +10 -34
- package/es/SuperTable3/SuperTable.js +57 -175
- package/es/SuperTable3/fixed.js +1 -9
- package/es/SuperToolbar/SuperToolbar.js +21 -49
- package/es/SuperUpload/SuperUpload.js +73 -110
- package/es/Title/Title.js +12 -15
- package/es/Viewer/ImageViews.js +7 -60
- package/es/Viewer/Viewer.js +7 -34
- package/es/WingBlank/WingBlank.js +2 -6
- package/es/helper.js +7 -27
- package/es/history.js +3 -2
- package/lib/Area/Area.js +16 -64
- package/lib/Card/Card.js +3 -13
- package/lib/CodeInput/CodeInput.js +30 -77
- package/lib/Control/Control.js +47 -135
- package/lib/Control/event.js +0 -16
- package/lib/Enhance/Dialogs.js +0 -26
- package/lib/Enhance/Loading.js +16 -52
- package/lib/Enhance/index.js +0 -9
- package/lib/Header/Header.js +3 -48
- package/lib/Header/Vertical.js +1 -36
- package/lib/ImageView/ImageView.js +5 -30
- package/lib/Indent/Indent.js +3 -13
- package/lib/InpurCascader/InputCascader.js +11 -50
- package/lib/InputEditor/InputEditor.js +55 -64
- package/lib/InputSearch/InputSearch.js +26 -78
- package/lib/InputSelect/InputSelect.js +17 -62
- package/lib/InputWriting/InputWriting.js +6 -35
- package/lib/Layout/Layout.js +28 -76
- package/lib/LayoutLink/LayoutLink.js +11 -38
- package/lib/Link/Link.js +4 -40
- package/lib/Loading/Loading.js +1 -9
- package/lib/Loading2/Loading2.js +0 -8
- package/lib/ModalWithDrag/ModalWithDrag.js +3 -18
- package/lib/ModalWithDrag/drag.js +12 -34
- package/lib/NumberInput/NumberInput.js +24 -76
- package/lib/Search/Search.js +53 -157
- package/lib/Sidebar/Sidebar.js +13 -46
- package/lib/Sidebar2/Sidebar.js +3 -42
- package/lib/SuperForm/SuperForm.js +27 -149
- package/lib/SuperForm2/SuperForm.js +31 -160
- package/lib/SuperIcon/SuperIcon.js +3 -14
- package/lib/SuperPagination/SuperPagination.js +15 -42
- package/lib/SuperTab/SuperTab.js +4 -34
- package/lib/SuperTab2/SuperTab2.js +11 -48
- package/lib/SuperTable/DragSortRow.js +6 -42
- package/lib/SuperTable/FilterDropDown.js +10 -42
- package/lib/SuperTable/SuperTable.js +90 -210
- package/lib/SuperTable/fixed.js +1 -13
- package/lib/SuperTable2/SuperTable2.js +95 -222
- package/lib/SuperTable2/SuperTableCell.js +13 -62
- package/lib/SuperTable3/FilterDropDown.js +10 -42
- package/lib/SuperTable3/SuperTable.js +56 -169
- package/lib/SuperTable3/fixed.js +1 -13
- package/lib/SuperToolbar/SuperToolbar.js +20 -64
- package/lib/SuperUpload/SuperUpload.js +73 -140
- package/lib/Title/Title.js +12 -24
- package/lib/Viewer/ImageViews.js +7 -63
- package/lib/Viewer/Viewer.js +7 -43
- package/lib/WingBlank/WingBlank.js +2 -14
- package/lib/helper.js +6 -44
- package/lib/history.js +0 -5
- package/lib/index.js +0 -76
- package/lib/variables.js +0 -4
- package/package.json +1 -1
|
@@ -1,105 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _typeof3 = require("@babel/runtime-corejs3/helpers/typeof");
|
|
4
|
-
|
|
5
4
|
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
6
|
-
|
|
7
5
|
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
8
|
-
|
|
9
6
|
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
10
|
-
|
|
11
7
|
var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
12
|
-
|
|
13
8
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
14
|
-
|
|
15
9
|
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
16
|
-
|
|
17
10
|
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
18
|
-
|
|
19
11
|
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
20
|
-
|
|
21
12
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
22
|
-
|
|
23
13
|
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
24
|
-
|
|
25
14
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
26
|
-
|
|
27
15
|
_Object$defineProperty(exports, "__esModule", {
|
|
28
16
|
value: true
|
|
29
17
|
});
|
|
30
|
-
|
|
31
18
|
exports["default"] = void 0;
|
|
32
|
-
|
|
33
19
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
34
|
-
|
|
35
20
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
36
|
-
|
|
37
21
|
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
38
|
-
|
|
39
22
|
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
40
|
-
|
|
41
23
|
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
42
|
-
|
|
43
24
|
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
44
|
-
|
|
45
25
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
46
|
-
|
|
47
26
|
var _row = _interopRequireDefault(require("antd/lib/row"));
|
|
48
|
-
|
|
49
27
|
var _col = _interopRequireDefault(require("antd/lib/col"));
|
|
50
|
-
|
|
51
28
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
52
|
-
|
|
53
29
|
var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
54
|
-
|
|
55
30
|
var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
56
|
-
|
|
57
31
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
58
|
-
|
|
59
32
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
60
|
-
|
|
61
33
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
62
|
-
|
|
63
34
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
64
|
-
|
|
65
35
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
66
|
-
|
|
67
36
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
68
|
-
|
|
69
37
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
70
|
-
|
|
71
38
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
72
|
-
|
|
73
39
|
var _form = _interopRequireDefault(require("antd/lib/form"));
|
|
74
|
-
|
|
75
40
|
var _react = _interopRequireDefault(require("react"));
|
|
76
|
-
|
|
77
41
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
78
|
-
|
|
79
42
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
80
|
-
|
|
81
43
|
var _helper = _interopRequireDefault(require("../helper"));
|
|
82
|
-
|
|
83
44
|
var _Control = _interopRequireWildcard(require("../Control"));
|
|
84
|
-
|
|
85
45
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
86
|
-
|
|
87
46
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
88
|
-
|
|
89
47
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
90
|
-
|
|
91
48
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
92
|
-
|
|
93
49
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context17, _context18; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context17 = ownKeys(Object(source), !0)).call(_context17, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context18 = ownKeys(Object(source))).call(_context18, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
94
|
-
|
|
95
50
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
96
|
-
|
|
97
51
|
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; } }
|
|
98
|
-
|
|
99
52
|
var FormItem = _form["default"].Item;
|
|
100
53
|
var defaultSize = 'small';
|
|
101
54
|
var defaultColNum = 4;
|
|
102
55
|
var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'area', 'uploadImg', 'cascader'];
|
|
56
|
+
|
|
103
57
|
/**
|
|
104
58
|
* key:[必须],用于唯一标识该Form下的一个表单元素
|
|
105
59
|
* title:[必须],表单元素的标签
|
|
@@ -111,7 +65,6 @@ var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText',
|
|
|
111
65
|
* rule: [可选],用于设置校验规则
|
|
112
66
|
* highLightKeys: [可选],用于设置高亮样式,仅只读字段生效
|
|
113
67
|
*/
|
|
114
|
-
|
|
115
68
|
var ControlType = {
|
|
116
69
|
key: _propTypes["default"].string.isRequired,
|
|
117
70
|
title: _propTypes["default"].string,
|
|
@@ -124,24 +77,18 @@ var ControlType = {
|
|
|
124
77
|
rule: _propTypes["default"].object,
|
|
125
78
|
props: _propTypes["default"].object
|
|
126
79
|
};
|
|
127
|
-
|
|
128
80
|
var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
129
81
|
(0, _inherits2["default"])(Controlled, _React$Component);
|
|
130
|
-
|
|
131
82
|
var _super = _createSuper(Controlled);
|
|
132
|
-
|
|
133
83
|
function Controlled(props) {
|
|
134
84
|
var _this;
|
|
135
|
-
|
|
136
85
|
(0, _classCallCheck2["default"])(this, Controlled);
|
|
137
86
|
_this = _super.call(this, props);
|
|
138
87
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (value) {
|
|
139
88
|
var onChange = _this.props.onChange;
|
|
140
|
-
|
|
141
89
|
_this.setState({
|
|
142
90
|
value: value
|
|
143
91
|
});
|
|
144
|
-
|
|
145
92
|
onChange && onChange(value);
|
|
146
93
|
});
|
|
147
94
|
_this.state = {
|
|
@@ -149,7 +96,6 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
149
96
|
};
|
|
150
97
|
return _this;
|
|
151
98
|
}
|
|
152
|
-
|
|
153
99
|
(0, _createClass2["default"])(Controlled, [{
|
|
154
100
|
key: "componentWillReceiveProps",
|
|
155
101
|
value: function componentWillReceiveProps(nextProps) {
|
|
@@ -166,7 +112,6 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
166
112
|
value: this.state.value,
|
|
167
113
|
onChange: this.onChange
|
|
168
114
|
});
|
|
169
|
-
|
|
170
115
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
171
116
|
}
|
|
172
117
|
}]);
|
|
@@ -185,24 +130,16 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
185
130
|
* onAreaSearch:联级选择器触发,原型为func(key - 当前联级key, title - 输入值, parentKey - 主体联级key)
|
|
186
131
|
* OnFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
|
|
187
132
|
*/
|
|
188
|
-
|
|
189
|
-
|
|
190
133
|
var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
191
134
|
(0, _inherits2["default"])(SuperForm, _React$Component2);
|
|
192
|
-
|
|
193
135
|
var _super2 = _createSuper(SuperForm);
|
|
194
|
-
|
|
195
136
|
function SuperForm() {
|
|
196
137
|
var _context;
|
|
197
|
-
|
|
198
138
|
var _this2;
|
|
199
|
-
|
|
200
139
|
(0, _classCallCheck2["default"])(this, SuperForm);
|
|
201
|
-
|
|
202
140
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
203
141
|
args[_key] = arguments[_key];
|
|
204
142
|
}
|
|
205
|
-
|
|
206
143
|
_this2 = _super2.call.apply(_super2, (0, _concat["default"])(_context = [this]).call(_context, args));
|
|
207
144
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onAdd", function (key, title) {
|
|
208
145
|
var onAdd = _this2.props.onAdd;
|
|
@@ -210,44 +147,36 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
210
147
|
});
|
|
211
148
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onChange", function (key, value) {
|
|
212
149
|
var onChange = _this2.props.onChange;
|
|
213
|
-
|
|
214
150
|
if (onChange) {
|
|
215
151
|
_this2.onExitValid(key);
|
|
216
|
-
|
|
217
152
|
onChange(key, value);
|
|
218
153
|
}
|
|
219
154
|
});
|
|
220
155
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onBlur", function (key, value) {
|
|
221
156
|
var onChange = _this2.props.onChange;
|
|
222
|
-
|
|
223
157
|
if (onChange) {
|
|
224
158
|
_this2.onExitValid(key);
|
|
225
|
-
|
|
226
159
|
onChange(key, value);
|
|
227
160
|
}
|
|
228
161
|
});
|
|
229
162
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "onExitValid", function (key, value) {
|
|
230
163
|
if (key === _this2.validKey) {
|
|
231
164
|
_this2.validKey = '';
|
|
232
|
-
|
|
233
165
|
_this2.props.onExitValid();
|
|
234
166
|
}
|
|
235
|
-
|
|
236
167
|
_this2.props.onChangeOperate && _this2.props.onChangeOperate(key, value);
|
|
237
168
|
});
|
|
169
|
+
// 动态生成getValidState方法
|
|
238
170
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "initValidState", function () {
|
|
239
171
|
var _this2$props = _this2.props,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
172
|
+
value = _this2$props.value,
|
|
173
|
+
valid = _this2$props.valid;
|
|
243
174
|
var invalid = function invalid() {
|
|
244
175
|
return null;
|
|
245
176
|
};
|
|
246
|
-
|
|
247
177
|
var _valid = function _valid(_ref) {
|
|
248
178
|
var key = _ref.key,
|
|
249
|
-
|
|
250
|
-
|
|
179
|
+
required = _ref.required;
|
|
251
180
|
if (required) {
|
|
252
181
|
if (!value || _helper["default"].isEmpty2(value[key]) || !(0, _isArray["default"])(value[key]) && (0, _typeof2["default"])(value[key]) === 'object' && _helper["default"].isEmpty(value[key].value)) {
|
|
253
182
|
_this2.getValidState = invalid;
|
|
@@ -255,19 +184,16 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
255
184
|
return 'error';
|
|
256
185
|
}
|
|
257
186
|
}
|
|
258
|
-
|
|
259
187
|
return null;
|
|
260
188
|
};
|
|
261
|
-
|
|
262
189
|
_this2.getValidState = valid ? _valid : invalid;
|
|
263
190
|
});
|
|
264
191
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "validDate", function (_ref2) {
|
|
265
192
|
var key = _ref2.key,
|
|
266
|
-
|
|
193
|
+
type = _ref2.type;
|
|
267
194
|
return function (date) {
|
|
268
195
|
var _this2$props$value = _this2.props.value,
|
|
269
|
-
|
|
270
|
-
|
|
196
|
+
value = _this2$props$value === void 0 ? {} : _this2$props$value;
|
|
271
197
|
if (!date || !value[key]) {
|
|
272
198
|
return false;
|
|
273
199
|
} else {
|
|
@@ -283,7 +209,6 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
283
209
|
});
|
|
284
210
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getPopupContainer", function () {
|
|
285
211
|
var container = _this2.props.container;
|
|
286
|
-
|
|
287
212
|
if (typeof container === 'undefined') {
|
|
288
213
|
return _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this2));
|
|
289
214
|
} else if (typeof container === 'boolean') {
|
|
@@ -294,7 +219,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
294
219
|
});
|
|
295
220
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getMaxWidth", function () {
|
|
296
221
|
var _this2$props$colNum = _this2.props.colNum,
|
|
297
|
-
|
|
222
|
+
colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
|
|
298
223
|
return colNum * 250;
|
|
299
224
|
});
|
|
300
225
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getContainer", function () {
|
|
@@ -302,9 +227,8 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
302
227
|
});
|
|
303
228
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControls", function () {
|
|
304
229
|
var _this2$props2 = _this2.props,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
230
|
+
hideControls = _this2$props2.hideControls,
|
|
231
|
+
controls = _this2$props2.controls;
|
|
308
232
|
if (!hideControls) {
|
|
309
233
|
return controls;
|
|
310
234
|
} else {
|
|
@@ -317,11 +241,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
317
241
|
});
|
|
318
242
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getType", function (_ref3) {
|
|
319
243
|
var _context2;
|
|
320
|
-
|
|
321
244
|
var key = _ref3.key,
|
|
322
|
-
|
|
245
|
+
type = _ref3.type;
|
|
323
246
|
var readonly = _this2.props.readonly;
|
|
324
|
-
|
|
325
247
|
if ((0, _includes["default"])(_context2 = ['area', 'uploadImg']).call(_context2, type)) {
|
|
326
248
|
return type;
|
|
327
249
|
} else if (!readonly) {
|
|
@@ -338,23 +260,20 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
338
260
|
});
|
|
339
261
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "specialProps", function (type, _ref4) {
|
|
340
262
|
var key = _ref4.key,
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
263
|
+
_ref4$props = _ref4.props,
|
|
264
|
+
props = _ref4$props === void 0 ? {} : _ref4$props,
|
|
265
|
+
originType = _ref4.type;
|
|
345
266
|
if (type === 'readonly') {
|
|
346
267
|
var _this2$props$highLigh = _this2.props.highLightKeys,
|
|
347
|
-
|
|
268
|
+
highLightKeys = _this2$props$highLigh === void 0 ? [] : _this2$props$highLigh;
|
|
348
269
|
var style = (0, _includes["default"])(highLightKeys).call(highLightKeys, key) ? {
|
|
349
270
|
backgroundColor: 'red',
|
|
350
271
|
color: 'white'
|
|
351
272
|
} : {
|
|
352
273
|
backgroundColor: '#f0f0f0'
|
|
353
274
|
};
|
|
354
|
-
|
|
355
275
|
if (originType === 'textArea') {
|
|
356
276
|
var _context3;
|
|
357
|
-
|
|
358
277
|
return {
|
|
359
278
|
type: 'textArea',
|
|
360
279
|
readonly: true,
|
|
@@ -363,7 +282,6 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
363
282
|
};
|
|
364
283
|
} else {
|
|
365
284
|
var _context4;
|
|
366
|
-
|
|
367
285
|
return {
|
|
368
286
|
style: style,
|
|
369
287
|
onBlur: (0, _bind["default"])(_context4 = _this2.onExitValid).call(_context4, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
@@ -371,29 +289,23 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
371
289
|
}
|
|
372
290
|
} else if (type === 'text' || type === 'textArea') {
|
|
373
291
|
var _context5, _context6;
|
|
374
|
-
|
|
375
292
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
376
293
|
onChange: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
377
294
|
onBlur: (0, _bind["default"])(_context6 = _this2.onChange).call(_context6, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
378
295
|
});
|
|
379
296
|
} else if (type === 'date') {
|
|
380
297
|
var _context7, _context8;
|
|
381
|
-
|
|
382
298
|
var propsObj = _objectSpread(_objectSpread({}, props), {}, {
|
|
383
299
|
onChange: (0, _bind["default"])(_context7 = _this2.onBlur).call(_context7, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
384
300
|
onBlur: (0, _bind["default"])(_context8 = _this2.onExitValid).call(_context8, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
385
301
|
});
|
|
386
|
-
|
|
387
302
|
if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
|
|
388
303
|
var _context9;
|
|
389
|
-
|
|
390
304
|
propsObj.onOpenChange = (0, _bind["default"])(_context9 = _this2.props.onOpenChange).call(_context9, (0, _assertThisInitialized2["default"])(_this2), key);
|
|
391
305
|
}
|
|
392
|
-
|
|
393
306
|
return propsObj;
|
|
394
307
|
} else if (type === 'area') {
|
|
395
308
|
var _context10, _context11;
|
|
396
|
-
|
|
397
309
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
398
310
|
onChange: (0, _bind["default"])(_context10 = _this2.onBlur).call(_context10, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
399
311
|
onBlur: (0, _bind["default"])(_context11 = _this2.onExitValid).call(_context11, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
@@ -401,7 +313,6 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
401
313
|
});
|
|
402
314
|
} else {
|
|
403
315
|
var _context12, _context13;
|
|
404
|
-
|
|
405
316
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
406
317
|
onChange: (0, _bind["default"])(_context12 = _this2.onBlur).call(_context12, (0, _assertThisInitialized2["default"])(_this2), key),
|
|
407
318
|
onBlur: (0, _bind["default"])(_context13 = _this2.onExitValid).call(_context13, (0, _assertThisInitialized2["default"])(_this2), key)
|
|
@@ -410,12 +321,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
410
321
|
});
|
|
411
322
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControlProps", function (control, status) {
|
|
412
323
|
var _this2$props$value2 = _this2.props.value,
|
|
413
|
-
|
|
414
|
-
|
|
324
|
+
value = _this2$props$value2 === void 0 ? {} : _this2$props$value2;
|
|
415
325
|
var type = _this2.getType(control);
|
|
416
|
-
|
|
417
326
|
var props = _this2.specialProps(type, control);
|
|
418
|
-
|
|
419
327
|
return _objectSpread(_objectSpread({
|
|
420
328
|
autoFocus: !!status,
|
|
421
329
|
type: type
|
|
@@ -455,7 +363,6 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
455
363
|
maxRows: 5
|
|
456
364
|
};
|
|
457
365
|
}
|
|
458
|
-
|
|
459
366
|
return /*#__PURE__*/_react["default"].createElement(Controlled, props);
|
|
460
367
|
});
|
|
461
368
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toNumber", function (props) {
|
|
@@ -465,7 +372,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
465
372
|
});
|
|
466
373
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toSelect", function (props, _ref5) {
|
|
467
374
|
var options = _ref5.options,
|
|
468
|
-
|
|
375
|
+
key = _ref5.key;
|
|
469
376
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
470
377
|
props.options = _this2.getOptions(key, options);
|
|
471
378
|
props.dropdownMatchSelectWidth = false;
|
|
@@ -498,13 +405,13 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
498
405
|
});
|
|
499
406
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toRadioGroup", function (props, _ref7) {
|
|
500
407
|
var key = _ref7.key,
|
|
501
|
-
|
|
408
|
+
options = _ref7.options;
|
|
502
409
|
props.options = _this2.getOptions(key, options);
|
|
503
410
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
504
411
|
});
|
|
505
412
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toReadonly", function (props, _ref8) {
|
|
506
413
|
var options = _ref8.options,
|
|
507
|
-
|
|
414
|
+
key = _ref8.key;
|
|
508
415
|
props.value = (0, _Control.getTitle)(props.value, _this2.getOptions(key, options));
|
|
509
416
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
510
417
|
});
|
|
@@ -517,7 +424,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
517
424
|
});
|
|
518
425
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "area", function (props, _ref9) {
|
|
519
426
|
var key = _ref9.key,
|
|
520
|
-
|
|
427
|
+
options = _ref9.options;
|
|
521
428
|
var readonly = _this2.props.readonly;
|
|
522
429
|
props.parentKey = key;
|
|
523
430
|
props.options = _this2.getOptions(key, options);
|
|
@@ -529,7 +436,6 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
529
436
|
});
|
|
530
437
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "uploadImg", function (props, control) {
|
|
531
438
|
var _context14;
|
|
532
|
-
|
|
533
439
|
var readonly = _this2.props.readonly;
|
|
534
440
|
props.required = control.required || false;
|
|
535
441
|
props.onFileChange = (0, _bind["default"])(_context14 = _this2.onFileChange).call(_context14, (0, _assertThisInitialized2["default"])(_this2), control);
|
|
@@ -540,7 +446,6 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
540
446
|
});
|
|
541
447
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCascader", function (props, control) {
|
|
542
448
|
var container = _this2.getContainer();
|
|
543
|
-
|
|
544
449
|
container && (props.getPopupContainer = container);
|
|
545
450
|
props.options = control.options || [];
|
|
546
451
|
props.onSearch = _this2.createSearchEvent(control);
|
|
@@ -552,66 +457,48 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
552
457
|
switch (props.type) {
|
|
553
458
|
case 'readonly':
|
|
554
459
|
return _this2.toReadonly(props, control);
|
|
555
|
-
|
|
556
460
|
case 'text':
|
|
557
461
|
return _this2.toText(props, control);
|
|
558
|
-
|
|
559
462
|
case 'number':
|
|
560
463
|
return _this2.toNumber(props, control);
|
|
561
|
-
|
|
562
464
|
case 'select':
|
|
563
465
|
case 'selectText':
|
|
564
466
|
return _this2.toSelect(props, control);
|
|
565
|
-
|
|
566
467
|
case 'search':
|
|
567
468
|
case 'searchText':
|
|
568
469
|
return _this2.toSearch(props, control);
|
|
569
|
-
|
|
570
470
|
case 'date':
|
|
571
471
|
return _this2.toDate(props, control);
|
|
572
|
-
|
|
573
472
|
case 'radioGroup':
|
|
574
473
|
return _this2.toRadioGroup(props, control);
|
|
575
|
-
|
|
576
474
|
case 'textArea':
|
|
577
475
|
return _this2.toTextArea(props, control);
|
|
578
|
-
|
|
579
476
|
case 'password':
|
|
580
477
|
return _this2.toPassword(props, control);
|
|
581
|
-
|
|
582
478
|
case 'editor':
|
|
583
479
|
return _this2.toEditor(props, control);
|
|
584
|
-
|
|
585
480
|
case 'selectWriting':
|
|
586
481
|
return _this2.toSelectWriting(props, control);
|
|
587
|
-
|
|
588
482
|
case 'selectSearch':
|
|
589
483
|
return _this2.selectSearch(props, control);
|
|
590
|
-
|
|
591
484
|
case 'empty':
|
|
592
485
|
return _this2.toEmpty(props, control);
|
|
593
|
-
|
|
594
486
|
case 'area':
|
|
595
487
|
return _this2.area(props, control);
|
|
596
|
-
|
|
597
488
|
case 'uploadImg':
|
|
598
489
|
return _this2.uploadImg(props, control);
|
|
599
|
-
|
|
600
490
|
case 'cascader':
|
|
601
491
|
return _this2.toCascader(props, control);
|
|
602
|
-
|
|
603
492
|
default:
|
|
604
493
|
return 'type error';
|
|
605
494
|
}
|
|
606
495
|
});
|
|
607
496
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toLabel", function (_ref10, type) {
|
|
608
497
|
var title = _ref10.title,
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
498
|
+
showAdd = _ref10.showAdd,
|
|
499
|
+
key = _ref10.key;
|
|
612
500
|
if (showAdd && type !== 'readonly') {
|
|
613
501
|
var _context15;
|
|
614
|
-
|
|
615
502
|
var onClick = (0, _bind["default"])(_context15 = _this2.onAdd).call(_context15, (0, _assertThisInitialized2["default"])(_this2), key, title);
|
|
616
503
|
return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
617
504
|
role: "add",
|
|
@@ -624,19 +511,16 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
624
511
|
});
|
|
625
512
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCol", function (span, control) {
|
|
626
513
|
var factor = control.span || 1;
|
|
627
|
-
|
|
628
514
|
var status = _this2.getValidState(control);
|
|
629
|
-
|
|
630
515
|
var controlProps = _this2.getControlProps(control, status);
|
|
631
|
-
|
|
632
516
|
var itemProps = {
|
|
633
517
|
label: _this2.toLabel(control, controlProps.type),
|
|
634
518
|
required: control.required,
|
|
635
519
|
validateStatus: status
|
|
636
520
|
};
|
|
637
521
|
var _this2$props3 = _this2.props,
|
|
638
|
-
|
|
639
|
-
|
|
522
|
+
checkable = _this2$props3.checkable,
|
|
523
|
+
onCheckItem = _this2$props3.onCheckItem;
|
|
640
524
|
return control.type !== 'empty' ? /*#__PURE__*/_react["default"].createElement(_col["default"], {
|
|
641
525
|
span: span * factor,
|
|
642
526
|
key: control.key
|
|
@@ -656,28 +540,23 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
656
540
|
});
|
|
657
541
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCols", function () {
|
|
658
542
|
var _context16;
|
|
659
|
-
|
|
660
543
|
var _this2$props4 = _this2.props,
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
544
|
+
_this2$props4$colNum = _this2$props4.colNum,
|
|
545
|
+
colNum = _this2$props4$colNum === void 0 ? defaultColNum : _this2$props4$colNum,
|
|
546
|
+
allFullFather = _this2$props4.allFullFather;
|
|
665
547
|
if (allFullFather) {
|
|
666
548
|
colNum = 1;
|
|
667
549
|
}
|
|
668
|
-
|
|
669
550
|
var span = 24 / colNum;
|
|
670
551
|
return (0, _map["default"])(_context16 = _this2.getControls()).call(_context16, function (control) {
|
|
671
552
|
if (allFullFather) {
|
|
672
553
|
control.allFullFather = allFullFather;
|
|
673
554
|
}
|
|
674
|
-
|
|
675
555
|
return _this2.toCol(span, control);
|
|
676
556
|
});
|
|
677
557
|
});
|
|
678
558
|
return _this2;
|
|
679
559
|
}
|
|
680
|
-
|
|
681
560
|
(0, _createClass2["default"])(SuperForm, [{
|
|
682
561
|
key: "render",
|
|
683
562
|
value: function render() {
|
|
@@ -696,7 +575,6 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
696
575
|
}]);
|
|
697
576
|
return SuperForm;
|
|
698
577
|
}(_react["default"].Component);
|
|
699
|
-
|
|
700
578
|
(0, _defineProperty2["default"])(SuperForm, "propTypes", {
|
|
701
579
|
controls: _propTypes["default"].arrayOf(_propTypes["default"].shape(ControlType)).isRequired,
|
|
702
580
|
value: _propTypes["default"].object,
|