cloud-b2b 1.0.2 → 1.0.5
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 +166 -0
- package/es/Area/package.json +6 -0
- package/es/Control/Control.js +27 -1
- package/es/Header/Header.js +1 -1
- package/es/Header/Header.less +12 -11
- package/es/HomeHeader/Header.less +1 -1
- package/es/LayoutLink/LayoutLink.js +2 -2
- package/es/Sidebar/Sidebar.js +2 -2
- package/es/Sidebar/Sidebar.less +10 -9
- package/es/Sidebar2/Sidebar.js +1 -1
- package/es/SuperForm/SuperForm.js +76 -29
- package/es/SuperTable/DragSortRow.js +125 -0
- package/es/SuperTable/DragSortRow.less +17 -0
- package/es/SuperTable/FilterDropDown.js +188 -0
- package/es/SuperTable/FilterDropDown.less +30 -0
- package/es/SuperTable/SuperTable.js +933 -0
- package/es/SuperTable/SuperTable.less +132 -0
- package/es/SuperTable/fixed.js +42 -0
- package/es/SuperTable/package.json +6 -0
- package/es/SuperTable2/SuperTable2.js +700 -0
- package/es/SuperTable2/SuperTable2.less +100 -0
- package/es/SuperTable2/SuperTableCell.js +215 -0
- package/es/SuperTable2/package.json +6 -0
- package/es/Title/Title.less +35 -35
- package/es/Title/package.json +6 -6
- package/es/Viewer/Viewer.js +1 -1
- package/es/adjust.less +89 -0
- package/es/index.js +4 -1
- package/es/style.less +20 -1
- package/lib/Area/Area.js +194 -0
- package/lib/Area/package.json +6 -0
- package/lib/Control/Control.js +29 -1
- package/lib/Header/Header.js +1 -1
- package/lib/Header/Header.less +12 -11
- package/lib/HomeHeader/Header.less +1 -1
- package/lib/LayoutLink/LayoutLink.js +2 -2
- package/lib/Sidebar/Sidebar.js +2 -2
- package/lib/Sidebar/Sidebar.less +10 -9
- package/lib/Sidebar2/Sidebar.js +1 -1
- package/lib/SuperForm/SuperForm.js +74 -29
- package/lib/SuperTable/DragSortRow.js +142 -0
- package/lib/SuperTable/DragSortRow.less +17 -0
- package/lib/SuperTable/FilterDropDown.js +205 -0
- package/lib/SuperTable/FilterDropDown.less +30 -0
- package/lib/SuperTable/SuperTable.js +937 -0
- package/lib/SuperTable/SuperTable.less +132 -0
- package/lib/SuperTable/fixed.js +55 -0
- package/lib/SuperTable/package.json +6 -0
- package/lib/SuperTable2/SuperTable2.js +725 -0
- package/lib/SuperTable2/SuperTable2.less +100 -0
- package/lib/SuperTable2/SuperTableCell.js +231 -0
- package/lib/SuperTable2/package.json +6 -0
- package/lib/Title/Title.less +35 -35
- package/lib/Title/package.json +6 -6
- package/lib/Viewer/Viewer.js +1 -1
- package/lib/adjust.less +89 -0
- package/lib/index.js +28 -1
- package/lib/index.less +5 -0
- package/lib/style.less +20 -1
- package/package.json +1 -1
package/es/Area/Area.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
|
+
import _Row from "antd/es/row";
|
|
10
|
+
import _Col from "antd/es/col";
|
|
11
|
+
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
12
|
+
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
13
|
+
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
14
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
15
|
+
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
16
|
+
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
17
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
18
|
+
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
+
|
|
23
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
24
|
+
|
|
25
|
+
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; } }
|
|
26
|
+
|
|
27
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
28
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
29
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
30
|
+
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
31
|
+
import React from 'react';
|
|
32
|
+
import PropTypes from 'prop-types';
|
|
33
|
+
import helper from '../helper';
|
|
34
|
+
import Control from '../Control';
|
|
35
|
+
var PROPS = {
|
|
36
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]),
|
|
37
|
+
onChange: PropTypes.func,
|
|
38
|
+
onBlur: PropTypes.func,
|
|
39
|
+
onParentChange: PropTypes.func,
|
|
40
|
+
child: PropTypes.Array
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var PROPS_KEYS = _Object$keys(PROPS);
|
|
44
|
+
|
|
45
|
+
var Area = /*#__PURE__*/function (_React$Component) {
|
|
46
|
+
_inherits(Area, _React$Component);
|
|
47
|
+
|
|
48
|
+
var _super = _createSuper(Area);
|
|
49
|
+
|
|
50
|
+
function Area(props) {
|
|
51
|
+
var _this;
|
|
52
|
+
|
|
53
|
+
_classCallCheck(this, Area);
|
|
54
|
+
|
|
55
|
+
_this = _super.call(this, props);
|
|
56
|
+
|
|
57
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (key, keyValue) {
|
|
58
|
+
var _this$props = _this.props,
|
|
59
|
+
onParentChange = _this$props.onParentChange,
|
|
60
|
+
child = _this$props.child,
|
|
61
|
+
value = _this$props.value;
|
|
62
|
+
var newValue = {};
|
|
63
|
+
newValue[key] = keyValue;
|
|
64
|
+
var CheckValue, checkIndex;
|
|
65
|
+
|
|
66
|
+
_mapInstanceProperty(child).call(child, function (item, index) {
|
|
67
|
+
if (item.key === key) {
|
|
68
|
+
checkIndex = index;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
CheckValue = index > checkIndex ? '' : value[item.key];
|
|
72
|
+
newValue[item.key] = item.key === key ? keyValue : CheckValue;
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
_this.setState({
|
|
76
|
+
value: _objectSpread(_objectSpread({}, _this.state.value), newValue)
|
|
77
|
+
}, function () {
|
|
78
|
+
return onParentChange && onParentChange(_this.state.value);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
_defineProperty(_assertThisInitialized(_this), "onSearch", function (key, control, parentKey, KeyValue) {
|
|
83
|
+
var _this$props2 = _this.props,
|
|
84
|
+
onAreaSearch = _this$props2.onAreaSearch,
|
|
85
|
+
child = _this$props2.child,
|
|
86
|
+
value = _this$props2.value;
|
|
87
|
+
var flag = true;
|
|
88
|
+
|
|
89
|
+
_mapInstanceProperty(child).call(child, function (item, index) {
|
|
90
|
+
if (item.key === key && index !== 0) {
|
|
91
|
+
var upKey = child[index - 1].key;
|
|
92
|
+
|
|
93
|
+
if (index !== 0 && (helper.isEmpty2(value[upKey]) || _Object$keys(value[upKey]).length === 0)) {
|
|
94
|
+
flag = false;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
return flag ? onAreaSearch && onAreaSearch(key, KeyValue, parentKey) : helper.showError('请输入上级选择器');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
_this.state = {
|
|
105
|
+
value: props.value || {},
|
|
106
|
+
options: props.options || {}
|
|
107
|
+
};
|
|
108
|
+
return _this;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
_createClass(Area, [{
|
|
112
|
+
key: "componentWillReceiveProps",
|
|
113
|
+
value: function componentWillReceiveProps(props) {
|
|
114
|
+
if (props.value !== this.props.value) {
|
|
115
|
+
this.setState({
|
|
116
|
+
value: props.value
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
121
|
+
key: "render",
|
|
122
|
+
value: function render() {
|
|
123
|
+
var _this2 = this;
|
|
124
|
+
|
|
125
|
+
var _this$props3 = this.props,
|
|
126
|
+
child = _this$props3.child,
|
|
127
|
+
parentKey = _this$props3.parentKey,
|
|
128
|
+
_this$props3$options = _this$props3.options,
|
|
129
|
+
options = _this$props3$options === void 0 ? {} : _this$props3$options,
|
|
130
|
+
_this$props3$readonly = _this$props3.readonly,
|
|
131
|
+
readonly = _this$props3$readonly === void 0 ? false : _this$props3$readonly,
|
|
132
|
+
value = _this$props3.value;
|
|
133
|
+
return /*#__PURE__*/React.createElement(_Row, null, _mapInstanceProperty(child).call(child, function (item, index) {
|
|
134
|
+
var _context, _context2, _context3;
|
|
135
|
+
|
|
136
|
+
var childOptions = [];
|
|
137
|
+
|
|
138
|
+
if (_includesInstanceProperty(_context = _Object$keys(options)).call(_context, item.key)) {
|
|
139
|
+
if (index === 0) {
|
|
140
|
+
childOptions = options[item.key];
|
|
141
|
+
} else {
|
|
142
|
+
var upKey = child[index - 1].key;
|
|
143
|
+
childOptions = helper.isEmpty2(value[upKey]) || _Object$keys(value[upKey]).length === 0 ? [] : options[item.key];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
var props = _objectSpread(_objectSpread({}, item), {}, {
|
|
148
|
+
onSearch: _bindInstanceProperty(_context2 = _this2.onSearch).call(_context2, _this2, item.key, item, parentKey),
|
|
149
|
+
onChange: _bindInstanceProperty(_context3 = _this2.onChange).call(_context3, _this2, item.key),
|
|
150
|
+
options: childOptions,
|
|
151
|
+
value: _this2.props.value[item.key].title ? _this2.props.value[item.key].title : _this2.props.value[item.key],
|
|
152
|
+
type: readonly ? 'readonly' : item.type
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
return /*#__PURE__*/React.createElement(_Col, {
|
|
156
|
+
span: 24 / child.length,
|
|
157
|
+
key: item.key
|
|
158
|
+
}, /*#__PURE__*/React.createElement(Control, props));
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
}]);
|
|
162
|
+
|
|
163
|
+
return Area;
|
|
164
|
+
}(React.Component);
|
|
165
|
+
|
|
166
|
+
export default Area;
|
package/es/Control/Control.js
CHANGED
|
@@ -39,6 +39,8 @@ import InputEditor from '../InputEditor';
|
|
|
39
39
|
import InputSelect from '../InputSelect';
|
|
40
40
|
import InputWriting from '../InputWriting';
|
|
41
41
|
import InpurCascader from '../InpurCascader';
|
|
42
|
+
import SuperUpload from '../SuperUpload';
|
|
43
|
+
import Area from '../Area';
|
|
42
44
|
import moment from 'moment';
|
|
43
45
|
import eventWrapper from './event';
|
|
44
46
|
var SelectOption = _Select.Option;
|
|
@@ -308,6 +310,28 @@ var editor = function editor(props) {
|
|
|
308
310
|
var cascader = function cascader(props) {
|
|
309
311
|
!props.value && typeof props.value !== 'undefined' && (props.value = []);
|
|
310
312
|
return /*#__PURE__*/React.createElement(InpurCascader, props);
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
var area = function area(props) {
|
|
316
|
+
var areaProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
317
|
+
onParentChange: props.onChange
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
return /*#__PURE__*/React.createElement(Area, areaProps);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
var uploadImg = function uploadImg(props) {
|
|
324
|
+
var uploadProps = {
|
|
325
|
+
fileList: props.value || [],
|
|
326
|
+
required: props.require,
|
|
327
|
+
multiple: false,
|
|
328
|
+
limitNumber: props.limitNumber || 10,
|
|
329
|
+
onFileChange: props.onFileChange,
|
|
330
|
+
needText: props.needText,
|
|
331
|
+
remark: props.remark,
|
|
332
|
+
readonly: props.readonly || false
|
|
333
|
+
};
|
|
334
|
+
return /*#__PURE__*/React.createElement(SuperUpload, uploadProps);
|
|
311
335
|
}; // 支持的控件类型
|
|
312
336
|
|
|
313
337
|
|
|
@@ -326,7 +350,9 @@ var controls = {
|
|
|
326
350
|
editor: editor,
|
|
327
351
|
selectSearch: selectSearch,
|
|
328
352
|
selectWriting: selectWriting,
|
|
329
|
-
cascader: cascader
|
|
353
|
+
cascader: cascader,
|
|
354
|
+
area: area,
|
|
355
|
+
uploadImg: uploadImg
|
|
330
356
|
};
|
|
331
357
|
|
|
332
358
|
var Control = function Control(_ref4) {
|
package/es/Header/Header.js
CHANGED
|
@@ -116,7 +116,7 @@ var Header = /*#__PURE__*/function (_React$Component) {
|
|
|
116
116
|
|
|
117
117
|
_defineProperty(_assertThisInitialized(_this), "menu", function (hasImport) {
|
|
118
118
|
return /*#__PURE__*/React.createElement(_Menu, {
|
|
119
|
-
className:
|
|
119
|
+
className: variables('Header').menu,
|
|
120
120
|
onClick: _this.onMenuItemClick
|
|
121
121
|
}, /*#__PURE__*/React.createElement(MenuItem, {
|
|
122
122
|
key: "person"
|
package/es/Header/Header.less
CHANGED
|
@@ -78,17 +78,18 @@
|
|
|
78
78
|
top: -2px;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
.menu {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
color: #333;
|
|
81
|
+
.menu {
|
|
82
|
+
:global {
|
|
83
|
+
.ant-dropdown-menu-item {
|
|
84
|
+
padding: 8px 20px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ant-dropdown-menu-item-group-title {
|
|
88
|
+
padding: 6px 20px;
|
|
89
|
+
color: #333;
|
|
90
|
+
}
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
}
|
|
94
|
+
|
|
95
|
+
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
height: @header-height;
|
|
9
9
|
line-height: @header-height - @one-pixel * 6;
|
|
10
10
|
text-align: center;
|
|
11
|
-
background: url('/platformHome/head_bg.png') no-repeat;
|
|
11
|
+
//background: url('/platformHome/head_bg.png') no-repeat;
|
|
12
12
|
background-size: 100% 100%;
|
|
13
13
|
color: #33EDFC;
|
|
14
14
|
font-size: @one-pixel * 32;
|
|
@@ -37,7 +37,7 @@ function Search(_ref) {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
return /*#__PURE__*/React.createElement(Card, {
|
|
40
|
-
className:
|
|
40
|
+
className: variables('LayoutLink').search
|
|
41
41
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormItem, {
|
|
42
42
|
validateStatus: status
|
|
43
43
|
}, /*#__PURE__*/React.createElement(_Input, {
|
|
@@ -52,7 +52,7 @@ function Search(_ref) {
|
|
|
52
52
|
function Title(_ref2) {
|
|
53
53
|
var title = _ref2.title;
|
|
54
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
55
|
-
className:
|
|
55
|
+
className: variables('LayoutLink').title
|
|
56
56
|
}, /*#__PURE__*/React.createElement("div", null, title), /*#__PURE__*/React.createElement("div", null));
|
|
57
57
|
}
|
|
58
58
|
|
package/es/Sidebar/Sidebar.js
CHANGED
|
@@ -116,9 +116,9 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
116
116
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
117
117
|
to: href,
|
|
118
118
|
title: title,
|
|
119
|
-
className:
|
|
119
|
+
className: variables('Sidebar').unreadTotalLink
|
|
120
120
|
}, _this.toIcon(icon), title, unreadTotal && unreadTotal > 0 && /*#__PURE__*/React.createElement("span", {
|
|
121
|
-
className:
|
|
121
|
+
className: variables('Sidebar').unreadTotalLink.unreadTotal
|
|
122
122
|
}, unreadTotal)));
|
|
123
123
|
}
|
|
124
124
|
});
|
package/es/Sidebar/Sidebar.less
CHANGED
|
@@ -62,16 +62,17 @@
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
+
.unreadTotalLink {
|
|
66
|
+
position: relative;
|
|
67
|
+
|
|
68
|
+
.unreadTotal{
|
|
69
|
+
color: orangered;
|
|
70
|
+
float: right;
|
|
71
|
+
position: absolute;
|
|
72
|
+
right: 5px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
65
75
|
}
|
|
66
76
|
|
|
67
77
|
|
|
68
|
-
.unreadTotalLink {
|
|
69
|
-
position: relative;
|
|
70
78
|
|
|
71
|
-
.unreadTotal{
|
|
72
|
-
color: orangered;
|
|
73
|
-
float: right;
|
|
74
|
-
position: absolute;
|
|
75
|
-
right: 5px;
|
|
76
|
-
}
|
|
77
|
-
}
|
package/es/Sidebar2/Sidebar.js
CHANGED
|
@@ -135,7 +135,7 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
135
135
|
}, /*#__PURE__*/React.createElement(Link, _extends({}, _this.linkProps(item), {
|
|
136
136
|
"data-role": "child-item"
|
|
137
137
|
}), /*#__PURE__*/React.createElement("span", null, item.title), item.unreadTotal && item.unreadTotal > 0 && /*#__PURE__*/React.createElement("span", {
|
|
138
|
-
className:
|
|
138
|
+
className: variables('Sidebar2').unreadTotal
|
|
139
139
|
}, item.unreadTotal)));
|
|
140
140
|
});
|
|
141
141
|
|
|
@@ -30,7 +30,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
|
30
30
|
|
|
31
31
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
32
32
|
|
|
33
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
33
|
+
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) { _defineProperty(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; }
|
|
34
34
|
|
|
35
35
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
36
36
|
|
|
@@ -45,7 +45,7 @@ import variables from '../variables';
|
|
|
45
45
|
var FormItem = _Form.Item;
|
|
46
46
|
var defaultSize = 'small';
|
|
47
47
|
var defaultColNum = 4;
|
|
48
|
-
var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty'];
|
|
48
|
+
var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'area', 'uploadImg'];
|
|
49
49
|
/**
|
|
50
50
|
* key:[必须],用于唯一标识该Form下的一个表单元素
|
|
51
51
|
* title:[必须],表单元素的标签
|
|
@@ -132,6 +132,8 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
132
132
|
* onAdd: 点击+号时触发,原型为func(key)
|
|
133
133
|
* checkable:是否显示checkbox选择框
|
|
134
134
|
* onOpenChange:控制日期框显示隐藏回调func(key, open)
|
|
135
|
+
* onAreaSearch:联级选择器触发,原型为func(key - 当前联级key, title - 输入值, parentKey - 主体联级key)
|
|
136
|
+
* OnFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
|
|
135
137
|
*/
|
|
136
138
|
|
|
137
139
|
|
|
@@ -271,11 +273,15 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
271
273
|
});
|
|
272
274
|
|
|
273
275
|
_defineProperty(_assertThisInitialized(_this2), "getType", function (_ref3) {
|
|
276
|
+
var _context2;
|
|
277
|
+
|
|
274
278
|
var key = _ref3.key,
|
|
275
279
|
type = _ref3.type;
|
|
276
280
|
var readonly = _this2.props.readonly;
|
|
277
281
|
|
|
278
|
-
if (
|
|
282
|
+
if (_includesInstanceProperty(_context2 = ['area', 'uploadImg']).call(_context2, type)) {
|
|
283
|
+
return type;
|
|
284
|
+
} else if (!readonly) {
|
|
279
285
|
return type;
|
|
280
286
|
} else if (readonly === true) {
|
|
281
287
|
return 'readonly';
|
|
@@ -305,50 +311,58 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
305
311
|
};
|
|
306
312
|
|
|
307
313
|
if (originType === 'textArea') {
|
|
308
|
-
var
|
|
314
|
+
var _context3;
|
|
309
315
|
|
|
310
316
|
return {
|
|
311
317
|
type: 'textArea',
|
|
312
318
|
readonly: true,
|
|
313
319
|
style: style,
|
|
314
|
-
onBlur: _bindInstanceProperty(
|
|
320
|
+
onBlur: _bindInstanceProperty(_context3 = _this2.onExitValid).call(_context3, _assertThisInitialized(_this2), key)
|
|
315
321
|
};
|
|
316
322
|
} else {
|
|
317
|
-
var
|
|
323
|
+
var _context4;
|
|
318
324
|
|
|
319
325
|
return {
|
|
320
326
|
style: style,
|
|
321
|
-
onBlur: _bindInstanceProperty(
|
|
327
|
+
onBlur: _bindInstanceProperty(_context4 = _this2.onExitValid).call(_context4, _assertThisInitialized(_this2), key)
|
|
322
328
|
};
|
|
323
329
|
}
|
|
324
330
|
} else if (type === 'text' || type === 'textArea') {
|
|
325
|
-
var
|
|
331
|
+
var _context5, _context6;
|
|
326
332
|
|
|
327
333
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
328
|
-
onChange: _bindInstanceProperty(
|
|
329
|
-
onBlur: _bindInstanceProperty(
|
|
334
|
+
onChange: _bindInstanceProperty(_context5 = _this2.onExitValid).call(_context5, _assertThisInitialized(_this2), key),
|
|
335
|
+
onBlur: _bindInstanceProperty(_context6 = _this2.onChange).call(_context6, _assertThisInitialized(_this2), key)
|
|
330
336
|
});
|
|
331
337
|
} else if (type === 'date') {
|
|
332
|
-
var
|
|
338
|
+
var _context7, _context8;
|
|
333
339
|
|
|
334
340
|
var propsObj = _objectSpread(_objectSpread({}, props), {}, {
|
|
335
|
-
onChange: _bindInstanceProperty(
|
|
336
|
-
onBlur: _bindInstanceProperty(
|
|
341
|
+
onChange: _bindInstanceProperty(_context7 = _this2.onBlur).call(_context7, _assertThisInitialized(_this2), key),
|
|
342
|
+
onBlur: _bindInstanceProperty(_context8 = _this2.onExitValid).call(_context8, _assertThisInitialized(_this2), key)
|
|
337
343
|
});
|
|
338
344
|
|
|
339
345
|
if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
|
|
340
|
-
var
|
|
346
|
+
var _context9;
|
|
341
347
|
|
|
342
|
-
propsObj.onOpenChange = _bindInstanceProperty(
|
|
348
|
+
propsObj.onOpenChange = _bindInstanceProperty(_context9 = _this2.props.onOpenChange).call(_context9, _assertThisInitialized(_this2), key);
|
|
343
349
|
}
|
|
344
350
|
|
|
345
351
|
return propsObj;
|
|
352
|
+
} else if (type === 'area') {
|
|
353
|
+
var _context10, _context11;
|
|
354
|
+
|
|
355
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
|
356
|
+
onChange: _bindInstanceProperty(_context10 = _this2.onBlur).call(_context10, _assertThisInitialized(_this2), key),
|
|
357
|
+
onBlur: _bindInstanceProperty(_context11 = _this2.onExitValid).call(_context11, _assertThisInitialized(_this2), key),
|
|
358
|
+
onAreaSearch: _this2.props.onAreaSearch
|
|
359
|
+
});
|
|
346
360
|
} else {
|
|
347
|
-
var
|
|
361
|
+
var _context12, _context13;
|
|
348
362
|
|
|
349
363
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
350
|
-
onChange: _bindInstanceProperty(
|
|
351
|
-
onBlur: _bindInstanceProperty(
|
|
364
|
+
onChange: _bindInstanceProperty(_context12 = _this2.onBlur).call(_context12, _assertThisInitialized(_this2), key),
|
|
365
|
+
onBlur: _bindInstanceProperty(_context13 = _this2.onExitValid).call(_context13, _assertThisInitialized(_this2), key)
|
|
352
366
|
});
|
|
353
367
|
}
|
|
354
368
|
});
|
|
@@ -476,6 +490,31 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
476
490
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
477
491
|
});
|
|
478
492
|
|
|
493
|
+
_defineProperty(_assertThisInitialized(_this2), "area", function (props, _ref9) {
|
|
494
|
+
var key = _ref9.key,
|
|
495
|
+
options = _ref9.options;
|
|
496
|
+
var readonly = _this2.props.readonly;
|
|
497
|
+
props.parentKey = key;
|
|
498
|
+
props.options = _this2.getOptions(key, options);
|
|
499
|
+
props.dropdownMatchSelectWidth = false;
|
|
500
|
+
props.readonly = readonly === true || _Array$isArray(readonly) && _someInstanceProperty(readonly).call(readonly, function (readonlyKey) {
|
|
501
|
+
return readonlyKey === key;
|
|
502
|
+
}) ? true : false;
|
|
503
|
+
return /*#__PURE__*/React.createElement(Control, props);
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
_defineProperty(_assertThisInitialized(_this2), "uploadImg", function (props, control) {
|
|
507
|
+
var _context14;
|
|
508
|
+
|
|
509
|
+
var readonly = _this2.props.readonly;
|
|
510
|
+
props.required = control.required || false;
|
|
511
|
+
props.onFileChange = _bindInstanceProperty(_context14 = _this2.onFileChange).call(_context14, _assertThisInitialized(_this2), control);
|
|
512
|
+
props.readonly = readonly === true || _Array$isArray(readonly) && _someInstanceProperty(readonly).call(readonly, function (readonlyKey) {
|
|
513
|
+
return readonlyKey === control.key;
|
|
514
|
+
}) ? true : false;
|
|
515
|
+
return /*#__PURE__*/React.createElement(Control, props);
|
|
516
|
+
});
|
|
517
|
+
|
|
479
518
|
_defineProperty(_assertThisInitialized(_this2), "toControl", function (props, control) {
|
|
480
519
|
switch (props.type) {
|
|
481
520
|
case 'readonly':
|
|
@@ -519,20 +558,26 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
519
558
|
case 'empty':
|
|
520
559
|
return _this2.toEmpty(props, control);
|
|
521
560
|
|
|
561
|
+
case 'area':
|
|
562
|
+
return _this2.area(props, control);
|
|
563
|
+
|
|
564
|
+
case 'uploadImg':
|
|
565
|
+
return _this2.uploadImg(props, control);
|
|
566
|
+
|
|
522
567
|
default:
|
|
523
568
|
return 'type error';
|
|
524
569
|
}
|
|
525
570
|
});
|
|
526
571
|
|
|
527
|
-
_defineProperty(_assertThisInitialized(_this2), "toLabel", function (
|
|
528
|
-
var title =
|
|
529
|
-
showAdd =
|
|
530
|
-
key =
|
|
572
|
+
_defineProperty(_assertThisInitialized(_this2), "toLabel", function (_ref10, type) {
|
|
573
|
+
var title = _ref10.title,
|
|
574
|
+
showAdd = _ref10.showAdd,
|
|
575
|
+
key = _ref10.key;
|
|
531
576
|
|
|
532
577
|
if (showAdd && type !== 'readonly') {
|
|
533
|
-
var
|
|
578
|
+
var _context15;
|
|
534
579
|
|
|
535
|
-
var onClick = _bindInstanceProperty(
|
|
580
|
+
var onClick = _bindInstanceProperty(_context15 = _this2.onAdd).call(_context15, _assertThisInitialized(_this2), key, title);
|
|
536
581
|
|
|
537
582
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
538
583
|
role: "add",
|
|
@@ -563,11 +608,11 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
563
608
|
span: span * factor,
|
|
564
609
|
key: control.key
|
|
565
610
|
}, checkable && /*#__PURE__*/React.createElement(_Checkbox, {
|
|
566
|
-
className:
|
|
611
|
+
className: variables('SuperForm').checkbox,
|
|
567
612
|
onChange: _bindInstanceProperty(onCheckItem).call(onCheckItem, _assertThisInitialized(_this2), control),
|
|
568
613
|
checked: control.checked
|
|
569
614
|
}), /*#__PURE__*/React.createElement(FormItem, _extends({}, itemProps, {
|
|
570
|
-
className: checkable ?
|
|
615
|
+
className: checkable ? variables('SuperForm').formItemWithCheckbox : ''
|
|
571
616
|
}), _this2.toControl(controlProps, control))) : /*#__PURE__*/React.createElement(_Col, {
|
|
572
617
|
span: span * factor,
|
|
573
618
|
key: control.key,
|
|
@@ -578,7 +623,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
578
623
|
});
|
|
579
624
|
|
|
580
625
|
_defineProperty(_assertThisInitialized(_this2), "toCols", function () {
|
|
581
|
-
var
|
|
626
|
+
var _context16;
|
|
582
627
|
|
|
583
628
|
var _this2$props4 = _this2.props,
|
|
584
629
|
_this2$props4$colNum = _this2$props4.colNum,
|
|
@@ -590,7 +635,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
590
635
|
}
|
|
591
636
|
|
|
592
637
|
var span = 24 / colNum;
|
|
593
|
-
return _mapInstanceProperty(
|
|
638
|
+
return _mapInstanceProperty(_context16 = _this2.getControls()).call(_context16, function (control) {
|
|
594
639
|
if (allFullFather) {
|
|
595
640
|
control.allFullFather = allFullFather;
|
|
596
641
|
}
|
|
@@ -635,7 +680,9 @@ _defineProperty(SuperForm, "propTypes", {
|
|
|
635
680
|
onExitValid: PropTypes.func,
|
|
636
681
|
onAdd: PropTypes.func,
|
|
637
682
|
checkable: PropTypes.bool,
|
|
638
|
-
onOpenChange: PropTypes.func
|
|
683
|
+
onOpenChange: PropTypes.func,
|
|
684
|
+
onAreaSearch: PropTypes.func,
|
|
685
|
+
OnFileChange: PropTypes.func
|
|
639
686
|
});
|
|
640
687
|
|
|
641
688
|
export default SuperForm;
|