cloud-b2b 1.1.79 → 1.1.80
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 +10 -13
- package/es/CodeInput/CodeInput.js +16 -19
- package/es/Enhance/Dialogs.js +11 -14
- package/es/Enhance/Loading.js +15 -18
- package/es/Header/Header.js +17 -20
- package/es/Header/Vertical.js +11 -14
- package/es/ImageView/ImageView.js +10 -13
- package/es/InpurCascader/InputCascader.js +11 -14
- package/es/InputEditor/InputEditor.js +16 -18
- package/es/InputSearch/InputSearch.js +20 -23
- package/es/InputSelect/InputSelect.js +14 -17
- package/es/InputTreeSelect/InputTreeSelect.js +10 -13
- package/es/InputWriting/InputWriting.js +12 -15
- package/es/Layout/Layout.js +14 -17
- package/es/Link/Link.js +7 -10
- package/es/NumberInput/NumberInput.js +13 -16
- package/es/Search/Search.js +52 -55
- package/es/Search2/Search.js +83 -86
- package/es/Search2/Search.less +64 -64
- package/es/Search2/package.json +6 -6
- package/es/Sidebar/Sidebar.js +11 -14
- package/es/Sidebar2/Sidebar.js +13 -16
- package/es/SuperForm/SuperForm.js +74 -79
- package/es/SuperForm2/SuperForm.js +107 -112
- package/es/SuperPagination/SuperPagination.js +8 -11
- package/es/SuperTab/SuperTab.js +12 -15
- package/es/SuperTab2/SuperTab2.js +13 -16
- package/es/SuperTable/DragSortRow.js +12 -15
- package/es/SuperTable/FilterDropDown.js +11 -14
- package/es/SuperTable/SuperTable.js +70 -73
- package/es/SuperTable2/SuperTable2.js +89 -92
- package/es/SuperTable2/SuperTable2.less +3 -1
- package/es/SuperTable2/SuperTableCell.js +27 -30
- package/es/SuperTable3/FilterDropDown.js +11 -14
- package/es/SuperTable3/SuperTable.js +58 -61
- package/es/SuperToolbar/SuperToolbar.js +12 -15
- package/es/SuperUpload/SuperUpload.js +38 -38
- package/es/Viewer/ImageViews.js +16 -19
- package/es/Viewer/Viewer.js +11 -14
- package/es/helper.js +18 -17
- package/lib/Area/Area.js +10 -13
- package/lib/CodeInput/CodeInput.js +16 -19
- package/lib/Enhance/Dialogs.js +11 -14
- package/lib/Enhance/Loading.js +15 -18
- package/lib/Header/Header.js +17 -20
- package/lib/Header/Vertical.js +11 -14
- package/lib/ImageView/ImageView.js +10 -13
- package/lib/InpurCascader/InputCascader.js +11 -14
- package/lib/InputEditor/InputEditor.js +16 -18
- package/lib/InputSearch/InputSearch.js +20 -23
- package/lib/InputSelect/InputSelect.js +14 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
- package/lib/InputWriting/InputWriting.js +12 -15
- package/lib/Layout/Layout.js +14 -17
- package/lib/LayoutLink/LayoutLink.js +1 -2
- package/lib/Link/Link.js +7 -10
- package/lib/NumberInput/NumberInput.js +13 -16
- package/lib/Search/Search.js +53 -57
- package/lib/Search2/Search.js +84 -88
- package/lib/Search2/Search.less +64 -64
- package/lib/Search2/package.json +6 -6
- package/lib/Sidebar/Sidebar.js +11 -14
- package/lib/Sidebar2/Sidebar.js +13 -16
- package/lib/SuperForm/SuperForm.js +75 -81
- package/lib/SuperForm2/SuperForm.js +108 -114
- package/lib/SuperPagination/SuperPagination.js +8 -11
- package/lib/SuperTab/SuperTab.js +12 -15
- package/lib/SuperTab2/SuperTab2.js +13 -16
- package/lib/SuperTable/DragSortRow.js +12 -15
- package/lib/SuperTable/FilterDropDown.js +11 -14
- package/lib/SuperTable/SuperTable.js +70 -73
- package/lib/SuperTable2/SuperTable2.js +90 -94
- package/lib/SuperTable2/SuperTable2.less +3 -1
- package/lib/SuperTable2/SuperTableCell.js +27 -30
- package/lib/SuperTable3/FilterDropDown.js +11 -14
- package/lib/SuperTable3/SuperTable.js +58 -61
- package/lib/SuperToolbar/SuperToolbar.js +12 -15
- package/lib/SuperUpload/SuperUpload.js +39 -40
- package/lib/Viewer/ImageViews.js +16 -19
- package/lib/Viewer/Viewer.js +11 -14
- package/lib/helper.js +18 -17
- package/package.json +1 -1
package/es/Sidebar/Sidebar.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
2
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
6
4
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
7
5
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
8
7
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
9
8
|
import _Menu from "antd/es/menu";
|
|
10
9
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
11
10
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
12
|
-
function
|
|
13
|
-
function _isNativeReflectConstruct() {
|
|
11
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
13
|
import React from 'react';
|
|
15
14
|
import PropTypes from 'prop-types';
|
|
16
15
|
import Link from '../Link';
|
|
@@ -53,8 +52,6 @@ var ItemType = {
|
|
|
53
52
|
* style: 样式
|
|
54
53
|
*/
|
|
55
54
|
var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
56
|
-
_inherits(Sidebar, _React$Component);
|
|
57
|
-
var _super = _createSuper(Sidebar);
|
|
58
55
|
function Sidebar() {
|
|
59
56
|
var _context;
|
|
60
57
|
var _this;
|
|
@@ -62,14 +59,14 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
62
59
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
63
60
|
args[_key] = arguments[_key];
|
|
64
61
|
}
|
|
65
|
-
_this =
|
|
66
|
-
_defineProperty(
|
|
62
|
+
_this = _callSuper(this, Sidebar, _concatInstanceProperty(_context = []).call(_context, args));
|
|
63
|
+
_defineProperty(_this, "onOpenChange", function (openKeys) {
|
|
67
64
|
var onOpenChange = _this.props.onOpenChange;
|
|
68
65
|
if (onOpenChange) {
|
|
69
66
|
onOpenChange(openKeys);
|
|
70
67
|
}
|
|
71
68
|
});
|
|
72
|
-
_defineProperty(
|
|
69
|
+
_defineProperty(_this, "toIcon", function (type) {
|
|
73
70
|
if (type) {
|
|
74
71
|
return /*#__PURE__*/React.createElement(SuperIcon, {
|
|
75
72
|
type: type,
|
|
@@ -82,7 +79,7 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
82
79
|
return null;
|
|
83
80
|
}
|
|
84
81
|
});
|
|
85
|
-
_defineProperty(
|
|
82
|
+
_defineProperty(_this, "toItem", function (_ref) {
|
|
86
83
|
var key = _ref.key,
|
|
87
84
|
title = _ref.title,
|
|
88
85
|
isFolder = _ref.isFolder,
|
|
@@ -108,10 +105,10 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
108
105
|
}, unreadTotal)));
|
|
109
106
|
}
|
|
110
107
|
});
|
|
111
|
-
_defineProperty(
|
|
108
|
+
_defineProperty(_this, "toItems", function (items) {
|
|
112
109
|
return _mapInstanceProperty(items).call(items, _this.toItem);
|
|
113
110
|
});
|
|
114
|
-
_defineProperty(
|
|
111
|
+
_defineProperty(_this, "getProps", function () {
|
|
115
112
|
var _this$props = _this.props,
|
|
116
113
|
style = _this$props.style,
|
|
117
114
|
activeKey = _this$props.activeKey,
|
|
@@ -128,13 +125,13 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
128
125
|
});
|
|
129
126
|
return _this;
|
|
130
127
|
}
|
|
131
|
-
|
|
128
|
+
_inherits(Sidebar, _React$Component);
|
|
129
|
+
return _createClass(Sidebar, [{
|
|
132
130
|
key: "render",
|
|
133
131
|
value: function render() {
|
|
134
132
|
return /*#__PURE__*/React.createElement(_Menu, this.getProps(), this.toItems(this.props.items));
|
|
135
133
|
}
|
|
136
134
|
}]);
|
|
137
|
-
return Sidebar;
|
|
138
135
|
}(React.Component);
|
|
139
136
|
_defineProperty(Sidebar, "propTypes", {
|
|
140
137
|
activeKey: PropTypes.string.isRequired,
|
package/es/Sidebar2/Sidebar.js
CHANGED
|
@@ -4,17 +4,16 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
4
4
|
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
5
5
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
6
6
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
7
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
8
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
9
7
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
10
8
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
9
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
11
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
12
11
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
13
12
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
14
13
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
15
14
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
16
|
-
function
|
|
17
|
-
function _isNativeReflectConstruct() {
|
|
15
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
17
|
import React from 'react';
|
|
19
18
|
import PropTypes from 'prop-types';
|
|
20
19
|
import Link from '../Link';
|
|
@@ -58,8 +57,6 @@ var ItemType = {
|
|
|
58
57
|
* onModeChange: 模式改变时触发,原型为func(mode)
|
|
59
58
|
*/
|
|
60
59
|
var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
61
|
-
_inherits(Sidebar, _React$Component);
|
|
62
|
-
var _super = _createSuper(Sidebar);
|
|
63
60
|
function Sidebar() {
|
|
64
61
|
var _context;
|
|
65
62
|
var _this;
|
|
@@ -67,26 +64,26 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
67
64
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
68
65
|
args[_key] = arguments[_key];
|
|
69
66
|
}
|
|
70
|
-
_this =
|
|
71
|
-
_defineProperty(
|
|
67
|
+
_this = _callSuper(this, Sidebar, _concatInstanceProperty(_context = []).call(_context, args));
|
|
68
|
+
_defineProperty(_this, "onModeChange", function () {
|
|
72
69
|
var mode = _this.props.mode || 'expand';
|
|
73
70
|
_this.props.onModeChange(mode === 'expand' ? 'collapse' : 'expand');
|
|
74
71
|
});
|
|
75
|
-
_defineProperty(
|
|
72
|
+
_defineProperty(_this, "isSelect", function (item) {
|
|
76
73
|
return _this.props.activeKey === item.key;
|
|
77
74
|
});
|
|
78
|
-
_defineProperty(
|
|
75
|
+
_defineProperty(_this, "isOpen", function (item) {
|
|
79
76
|
var _context2;
|
|
80
77
|
return _includesInstanceProperty(_context2 = _this.props.openKeys).call(_context2, item.key);
|
|
81
78
|
});
|
|
82
|
-
_defineProperty(
|
|
79
|
+
_defineProperty(_this, "getHeight", function (item) {
|
|
83
80
|
if (item.isFolder && _this.isOpen(item)) {
|
|
84
81
|
return (item.children.length + 1) * ITEM_HEIGHT;
|
|
85
82
|
} else {
|
|
86
83
|
return ITEM_HEIGHT;
|
|
87
84
|
}
|
|
88
85
|
});
|
|
89
|
-
_defineProperty(
|
|
86
|
+
_defineProperty(_this, "linkProps", function (item) {
|
|
90
87
|
if (item.isFolder) {
|
|
91
88
|
return {
|
|
92
89
|
title: item.title,
|
|
@@ -110,7 +107,7 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
110
107
|
};
|
|
111
108
|
}
|
|
112
109
|
});
|
|
113
|
-
_defineProperty(
|
|
110
|
+
_defineProperty(_this, "renderChild", function (item, index) {
|
|
114
111
|
return /*#__PURE__*/React.createElement("li", {
|
|
115
112
|
key: index
|
|
116
113
|
}, /*#__PURE__*/React.createElement(Link, _extends({}, _this.linkProps(item), {
|
|
@@ -119,7 +116,7 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
119
116
|
className: variables('Sidebar2').unreadTotal
|
|
120
117
|
}, item.unreadTotal)));
|
|
121
118
|
});
|
|
122
|
-
_defineProperty(
|
|
119
|
+
_defineProperty(_this, "renderItem", function (item, index) {
|
|
123
120
|
var _context5;
|
|
124
121
|
return /*#__PURE__*/React.createElement("li", {
|
|
125
122
|
key: index,
|
|
@@ -135,7 +132,8 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
135
132
|
});
|
|
136
133
|
return _this;
|
|
137
134
|
}
|
|
138
|
-
|
|
135
|
+
_inherits(Sidebar, _React$Component);
|
|
136
|
+
return _createClass(Sidebar, [{
|
|
139
137
|
key: "render",
|
|
140
138
|
value: function render() {
|
|
141
139
|
var _context6;
|
|
@@ -150,7 +148,6 @@ var Sidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
150
148
|
})))));
|
|
151
149
|
}
|
|
152
150
|
}]);
|
|
153
|
-
return Sidebar;
|
|
154
151
|
}(React.Component);
|
|
155
152
|
_defineProperty(Sidebar, "propTypes", {
|
|
156
153
|
title: PropTypes.string,
|
|
@@ -14,10 +14,9 @@ import _Icon from "antd/es/icon";
|
|
|
14
14
|
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
15
15
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
16
16
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
17
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
18
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
19
17
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
20
18
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
19
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
21
20
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
22
21
|
import _Form from "antd/es/form";
|
|
23
22
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
@@ -28,9 +27,9 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/ins
|
|
|
28
27
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
29
28
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
30
29
|
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
|
|
32
|
-
function
|
|
33
|
-
function _isNativeReflectConstruct() {
|
|
30
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context15, _context16; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context15 = ownKeys(Object(t), !0)).call(_context15, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context16 = ownKeys(Object(t))).call(_context16, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
32
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
34
33
|
import React from 'react';
|
|
35
34
|
import PropTypes from 'prop-types';
|
|
36
35
|
import ReactDOM from 'react-dom';
|
|
@@ -66,13 +65,11 @@ var ControlType = {
|
|
|
66
65
|
props: PropTypes.object
|
|
67
66
|
};
|
|
68
67
|
var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
69
|
-
_inherits(Controlled, _React$Component);
|
|
70
|
-
var _super = _createSuper(Controlled);
|
|
71
68
|
function Controlled(props) {
|
|
72
69
|
var _this;
|
|
73
70
|
_classCallCheck(this, Controlled);
|
|
74
|
-
_this =
|
|
75
|
-
_defineProperty(
|
|
71
|
+
_this = _callSuper(this, Controlled, [props]);
|
|
72
|
+
_defineProperty(_this, "onChange", function (value) {
|
|
76
73
|
var onChange = _this.props.onChange;
|
|
77
74
|
_this.setState({
|
|
78
75
|
value: value
|
|
@@ -84,7 +81,8 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
84
81
|
};
|
|
85
82
|
return _this;
|
|
86
83
|
}
|
|
87
|
-
|
|
84
|
+
_inherits(Controlled, _React$Component);
|
|
85
|
+
return _createClass(Controlled, [{
|
|
88
86
|
key: "componentWillReceiveProps",
|
|
89
87
|
value: function componentWillReceiveProps(nextProps) {
|
|
90
88
|
if (this.props.value !== nextProps.value) {
|
|
@@ -103,7 +101,6 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
103
101
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
104
102
|
}
|
|
105
103
|
}]);
|
|
106
|
-
return Controlled;
|
|
107
104
|
}(React.Component);
|
|
108
105
|
/**
|
|
109
106
|
* colNum:[可选],表单的列数,默认为4
|
|
@@ -119,8 +116,6 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
|
|
|
119
116
|
* OnFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
|
|
120
117
|
*/
|
|
121
118
|
var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
122
|
-
_inherits(SuperForm, _React$Component2);
|
|
123
|
-
var _super2 = _createSuper(SuperForm);
|
|
124
119
|
function SuperForm() {
|
|
125
120
|
var _context;
|
|
126
121
|
var _this2;
|
|
@@ -128,31 +123,31 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
128
123
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
129
124
|
args[_key] = arguments[_key];
|
|
130
125
|
}
|
|
131
|
-
_this2 =
|
|
132
|
-
_defineProperty(
|
|
126
|
+
_this2 = _callSuper(this, SuperForm, _concatInstanceProperty(_context = []).call(_context, args));
|
|
127
|
+
_defineProperty(_this2, "onAdd", function (key, title) {
|
|
133
128
|
var onAdd = _this2.props.onAdd;
|
|
134
129
|
onAdd && onAdd(key, title);
|
|
135
130
|
});
|
|
136
|
-
_defineProperty(
|
|
131
|
+
_defineProperty(_this2, "onChange", function (key, value) {
|
|
137
132
|
var onChange = _this2.props.onChange;
|
|
138
133
|
if (onChange) {
|
|
139
134
|
_this2.onExitValid(key);
|
|
140
135
|
onChange(key, value);
|
|
141
136
|
}
|
|
142
137
|
});
|
|
143
|
-
_defineProperty(
|
|
138
|
+
_defineProperty(_this2, "onBlur", function (key, value) {
|
|
144
139
|
var onChange = _this2.props.onChange;
|
|
145
140
|
if (onChange) {
|
|
146
141
|
_this2.onExitValid(key);
|
|
147
142
|
onChange(key, value);
|
|
148
143
|
}
|
|
149
144
|
});
|
|
150
|
-
_defineProperty(
|
|
145
|
+
_defineProperty(_this2, "onFileChange", function (_ref, file) {
|
|
151
146
|
var key = _ref.key;
|
|
152
147
|
var onFileChange = _this2.props.onFileChange;
|
|
153
148
|
onFileChange && onFileChange(key, file);
|
|
154
149
|
});
|
|
155
|
-
_defineProperty(
|
|
150
|
+
_defineProperty(_this2, "onExitValid", function (key, value) {
|
|
156
151
|
if (key === _this2.validKey) {
|
|
157
152
|
_this2.validKey = '';
|
|
158
153
|
_this2.props.onExitValid();
|
|
@@ -160,7 +155,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
160
155
|
_this2.props.onChangeOperate && _this2.props.onChangeOperate(key, value);
|
|
161
156
|
});
|
|
162
157
|
// 动态生成getValidState方法
|
|
163
|
-
_defineProperty(
|
|
158
|
+
_defineProperty(_this2, "initValidState", function () {
|
|
164
159
|
var _this2$props = _this2.props,
|
|
165
160
|
value = _this2$props.value,
|
|
166
161
|
valid = _this2$props.valid;
|
|
@@ -181,7 +176,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
181
176
|
};
|
|
182
177
|
_this2.getValidState = valid ? _valid : invalid;
|
|
183
178
|
});
|
|
184
|
-
_defineProperty(
|
|
179
|
+
_defineProperty(_this2, "validDate", function (_ref3) {
|
|
185
180
|
var key = _ref3.key,
|
|
186
181
|
type = _ref3.type;
|
|
187
182
|
return function (date) {
|
|
@@ -200,25 +195,25 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
200
195
|
}
|
|
201
196
|
};
|
|
202
197
|
});
|
|
203
|
-
_defineProperty(
|
|
198
|
+
_defineProperty(_this2, "getPopupContainer", function () {
|
|
204
199
|
var container = _this2.props.container;
|
|
205
200
|
if (typeof container === 'undefined') {
|
|
206
|
-
return ReactDOM.findDOMNode(
|
|
201
|
+
return ReactDOM.findDOMNode(_this2);
|
|
207
202
|
} else if (typeof container === 'boolean') {
|
|
208
203
|
return document.body;
|
|
209
204
|
} else {
|
|
210
205
|
return ReactDOM.findDOMNode(container);
|
|
211
206
|
}
|
|
212
207
|
});
|
|
213
|
-
_defineProperty(
|
|
208
|
+
_defineProperty(_this2, "getMaxWidth", function () {
|
|
214
209
|
var _this2$props$colNum = _this2.props.colNum,
|
|
215
210
|
colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
|
|
216
211
|
return colNum * 250;
|
|
217
212
|
});
|
|
218
|
-
_defineProperty(
|
|
213
|
+
_defineProperty(_this2, "getContainer", function () {
|
|
219
214
|
return _this2.props.getContainer;
|
|
220
215
|
});
|
|
221
|
-
_defineProperty(
|
|
216
|
+
_defineProperty(_this2, "getControls", function () {
|
|
222
217
|
var _this2$props2 = _this2.props,
|
|
223
218
|
hideControls = _this2$props2.hideControls,
|
|
224
219
|
controls = _this2$props2.controls;
|
|
@@ -232,7 +227,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
232
227
|
});
|
|
233
228
|
}
|
|
234
229
|
});
|
|
235
|
-
_defineProperty(
|
|
230
|
+
_defineProperty(_this2, "getType", function (_ref4) {
|
|
236
231
|
var _context2;
|
|
237
232
|
var key = _ref4.key,
|
|
238
233
|
type = _ref4.type;
|
|
@@ -251,7 +246,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
251
246
|
return type;
|
|
252
247
|
}
|
|
253
248
|
});
|
|
254
|
-
_defineProperty(
|
|
249
|
+
_defineProperty(_this2, "specialProps", function (type, _ref5) {
|
|
255
250
|
var key = _ref5.key,
|
|
256
251
|
_ref5$props = _ref5.props,
|
|
257
252
|
props = _ref5$props === void 0 ? {} : _ref5$props,
|
|
@@ -271,48 +266,48 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
271
266
|
type: 'textArea',
|
|
272
267
|
readonly: true,
|
|
273
268
|
style: style,
|
|
274
|
-
onBlur: _bindInstanceProperty(_context3 = _this2.onExitValid).call(_context3,
|
|
269
|
+
onBlur: _bindInstanceProperty(_context3 = _this2.onExitValid).call(_context3, _this2, key)
|
|
275
270
|
};
|
|
276
271
|
} else {
|
|
277
272
|
var _context4;
|
|
278
273
|
return {
|
|
279
274
|
style: style,
|
|
280
|
-
onBlur: _bindInstanceProperty(_context4 = _this2.onExitValid).call(_context4,
|
|
275
|
+
onBlur: _bindInstanceProperty(_context4 = _this2.onExitValid).call(_context4, _this2, key)
|
|
281
276
|
};
|
|
282
277
|
}
|
|
283
278
|
} else if (type === 'text' || type === 'textArea') {
|
|
284
279
|
var _context5, _context6;
|
|
285
280
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
286
|
-
onChange: _bindInstanceProperty(_context5 = _this2.onExitValid).call(_context5,
|
|
287
|
-
onBlur: _bindInstanceProperty(_context6 = _this2.onChange).call(_context6,
|
|
281
|
+
onChange: _bindInstanceProperty(_context5 = _this2.onExitValid).call(_context5, _this2, key),
|
|
282
|
+
onBlur: _bindInstanceProperty(_context6 = _this2.onChange).call(_context6, _this2, key)
|
|
288
283
|
});
|
|
289
284
|
} else if (type === 'date') {
|
|
290
285
|
var _context7, _context8;
|
|
291
286
|
var propsObj = _objectSpread(_objectSpread({}, props), {}, {
|
|
292
|
-
onChange: _bindInstanceProperty(_context7 = _this2.onBlur).call(_context7,
|
|
293
|
-
onBlur: _bindInstanceProperty(_context8 = _this2.onExitValid).call(_context8,
|
|
287
|
+
onChange: _bindInstanceProperty(_context7 = _this2.onBlur).call(_context7, _this2, key),
|
|
288
|
+
onBlur: _bindInstanceProperty(_context8 = _this2.onExitValid).call(_context8, _this2, key)
|
|
294
289
|
});
|
|
295
290
|
if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
|
|
296
291
|
var _context9;
|
|
297
|
-
propsObj.onOpenChange = _bindInstanceProperty(_context9 = _this2.props.onOpenChange).call(_context9,
|
|
292
|
+
propsObj.onOpenChange = _bindInstanceProperty(_context9 = _this2.props.onOpenChange).call(_context9, _this2, key);
|
|
298
293
|
}
|
|
299
294
|
return propsObj;
|
|
300
295
|
} else if (type === 'area') {
|
|
301
|
-
var
|
|
296
|
+
var _context0, _context1;
|
|
302
297
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
303
|
-
onChange: _bindInstanceProperty(
|
|
304
|
-
onBlur: _bindInstanceProperty(
|
|
298
|
+
onChange: _bindInstanceProperty(_context0 = _this2.onBlur).call(_context0, _this2, key),
|
|
299
|
+
onBlur: _bindInstanceProperty(_context1 = _this2.onExitValid).call(_context1, _this2, key),
|
|
305
300
|
onAreaSearch: _this2.props.onAreaSearch
|
|
306
301
|
});
|
|
307
302
|
} else {
|
|
308
|
-
var
|
|
303
|
+
var _context10, _context11;
|
|
309
304
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
310
|
-
onChange: _bindInstanceProperty(
|
|
311
|
-
onBlur: _bindInstanceProperty(
|
|
305
|
+
onChange: _bindInstanceProperty(_context10 = _this2.onBlur).call(_context10, _this2, key),
|
|
306
|
+
onBlur: _bindInstanceProperty(_context11 = _this2.onExitValid).call(_context11, _this2, key)
|
|
312
307
|
});
|
|
313
308
|
}
|
|
314
309
|
});
|
|
315
|
-
_defineProperty(
|
|
310
|
+
_defineProperty(_this2, "getControlProps", function (control, status) {
|
|
316
311
|
var _this2$props$value2 = _this2.props.value,
|
|
317
312
|
value = _this2$props$value2 === void 0 ? {} : _this2$props$value2;
|
|
318
313
|
var type = _this2.getType(control);
|
|
@@ -325,25 +320,25 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
325
320
|
value: makeString(value[control.key])
|
|
326
321
|
});
|
|
327
322
|
});
|
|
328
|
-
_defineProperty(
|
|
323
|
+
_defineProperty(_this2, "getOptions", function (key, options) {
|
|
329
324
|
var higher = _this2.props.options || {};
|
|
330
325
|
return higher[key] || options;
|
|
331
326
|
});
|
|
332
|
-
_defineProperty(
|
|
333
|
-
_defineProperty(
|
|
327
|
+
_defineProperty(_this2, "toEmpty", function (props) {});
|
|
328
|
+
_defineProperty(_this2, "toText", function (props) {
|
|
334
329
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
335
330
|
});
|
|
336
|
-
_defineProperty(
|
|
331
|
+
_defineProperty(_this2, "toPassword", function (props) {
|
|
337
332
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
338
333
|
});
|
|
339
|
-
_defineProperty(
|
|
334
|
+
_defineProperty(_this2, "toEditor", function (props, control) {
|
|
340
335
|
props.inputKey = control.key;
|
|
341
336
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
342
337
|
});
|
|
343
|
-
_defineProperty(
|
|
338
|
+
_defineProperty(_this2, "toSelectWriting", function (props, control) {
|
|
344
339
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
345
340
|
});
|
|
346
|
-
_defineProperty(
|
|
341
|
+
_defineProperty(_this2, "toTextArea", function (props, control) {
|
|
347
342
|
if (control.allFullFather) {
|
|
348
343
|
props.rows = control.rows;
|
|
349
344
|
props.maxLength = control.maxLength;
|
|
@@ -358,12 +353,12 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
358
353
|
}
|
|
359
354
|
return /*#__PURE__*/React.createElement(Controlled, props);
|
|
360
355
|
});
|
|
361
|
-
_defineProperty(
|
|
356
|
+
_defineProperty(_this2, "toNumber", function (props) {
|
|
362
357
|
props.defaultValue = props.value;
|
|
363
358
|
delete props.value;
|
|
364
359
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
365
360
|
});
|
|
366
|
-
_defineProperty(
|
|
361
|
+
_defineProperty(_this2, "toSelect", function (props, _ref6) {
|
|
367
362
|
var options = _ref6.options,
|
|
368
363
|
key = _ref6.key;
|
|
369
364
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
@@ -371,7 +366,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
371
366
|
props.dropdownMatchSelectWidth = false;
|
|
372
367
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
373
368
|
});
|
|
374
|
-
_defineProperty(
|
|
369
|
+
_defineProperty(_this2, "createSearchEvent", function (control) {
|
|
375
370
|
if (_this2.props.onSearch) {
|
|
376
371
|
return function (value) {
|
|
377
372
|
return _this2.props.onSearch(control.key, value, control);
|
|
@@ -380,14 +375,14 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
380
375
|
return null;
|
|
381
376
|
}
|
|
382
377
|
});
|
|
383
|
-
_defineProperty(
|
|
378
|
+
_defineProperty(_this2, "toSearch", function (props, control) {
|
|
384
379
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
385
380
|
props.options = _this2.getOptions(control.key, control.options);
|
|
386
381
|
props.onSearch = _this2.createSearchEvent(control);
|
|
387
382
|
props.dropdownMatchSelectWidth = false;
|
|
388
383
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
389
384
|
});
|
|
390
|
-
_defineProperty(
|
|
385
|
+
_defineProperty(_this2, "toDate", function (props, _ref7) {
|
|
391
386
|
var rule = _ref7.rule;
|
|
392
387
|
props.getCalendarContainer = _this2.getPopupContainer;
|
|
393
388
|
props.style = {
|
|
@@ -396,28 +391,28 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
396
391
|
rule && (props.disabledDate = _this2.validDate(rule));
|
|
397
392
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
398
393
|
});
|
|
399
|
-
_defineProperty(
|
|
394
|
+
_defineProperty(_this2, "toRadioGroup", function (props, _ref8) {
|
|
400
395
|
var key = _ref8.key,
|
|
401
396
|
options = _ref8.options;
|
|
402
397
|
props.options = _this2.getOptions(key, options);
|
|
403
398
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
404
399
|
});
|
|
405
|
-
_defineProperty(
|
|
400
|
+
_defineProperty(_this2, "toReadonly", function (props, _ref9) {
|
|
406
401
|
var options = _ref9.options,
|
|
407
402
|
key = _ref9.key;
|
|
408
403
|
props.value = getTitle(props.value, _this2.getOptions(key, options));
|
|
409
404
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
410
405
|
});
|
|
411
|
-
_defineProperty(
|
|
406
|
+
_defineProperty(_this2, "selectSearch", function (props, control) {
|
|
412
407
|
props.getPopupContainer = _this2.getPopupContainer;
|
|
413
408
|
props.options = _this2.getOptions(control.key, control.options);
|
|
414
409
|
props.onSearch = _this2.createSearchEvent(control);
|
|
415
410
|
props.dropdownMatchSelectWidth = false;
|
|
416
411
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
417
412
|
});
|
|
418
|
-
_defineProperty(
|
|
419
|
-
var key =
|
|
420
|
-
options =
|
|
413
|
+
_defineProperty(_this2, "area", function (props, _ref0) {
|
|
414
|
+
var key = _ref0.key,
|
|
415
|
+
options = _ref0.options;
|
|
421
416
|
var readonly = _this2.props.readonly;
|
|
422
417
|
props.parentKey = key;
|
|
423
418
|
props.options = _this2.getOptions(key, options);
|
|
@@ -427,17 +422,17 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
427
422
|
}) ? true : false;
|
|
428
423
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
429
424
|
});
|
|
430
|
-
_defineProperty(
|
|
431
|
-
var
|
|
425
|
+
_defineProperty(_this2, "uploadImg", function (props, control) {
|
|
426
|
+
var _context12;
|
|
432
427
|
var readonly = _this2.props.readonly;
|
|
433
428
|
props.required = control.required || false;
|
|
434
|
-
props.onFileChange = _bindInstanceProperty(
|
|
429
|
+
props.onFileChange = _bindInstanceProperty(_context12 = _this2.onFileChange).call(_context12, _this2, control);
|
|
435
430
|
props.readonly = readonly === true || _Array$isArray(readonly) && _someInstanceProperty(readonly).call(readonly, function (readonlyKey) {
|
|
436
431
|
return readonlyKey === control.key;
|
|
437
432
|
}) ? true : false;
|
|
438
433
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
439
434
|
});
|
|
440
|
-
_defineProperty(
|
|
435
|
+
_defineProperty(_this2, "toCascader", function (props, control) {
|
|
441
436
|
var container = _this2.getContainer();
|
|
442
437
|
container && (props.getPopupContainer = container);
|
|
443
438
|
props.options = control.options || [];
|
|
@@ -446,7 +441,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
446
441
|
props.loadData = _this2.createSearchEvent(control);
|
|
447
442
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
448
443
|
});
|
|
449
|
-
_defineProperty(
|
|
444
|
+
_defineProperty(_this2, "toTreeSelect", function (props, filter) {
|
|
450
445
|
var container = _this2.getContainer();
|
|
451
446
|
container && (props.getPopupContainer = container);
|
|
452
447
|
props.options = _this2.getOptions(filter);
|
|
@@ -454,7 +449,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
454
449
|
props.placeholder = filter.placeholder || '';
|
|
455
450
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
456
451
|
});
|
|
457
|
-
_defineProperty(
|
|
452
|
+
_defineProperty(_this2, "toControl", function (props, control) {
|
|
458
453
|
switch (props.type) {
|
|
459
454
|
case 'readonly':
|
|
460
455
|
return _this2.toReadonly(props, control);
|
|
@@ -496,13 +491,13 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
496
491
|
return 'type error';
|
|
497
492
|
}
|
|
498
493
|
});
|
|
499
|
-
_defineProperty(
|
|
500
|
-
var title =
|
|
501
|
-
showAdd =
|
|
502
|
-
key =
|
|
494
|
+
_defineProperty(_this2, "toLabel", function (_ref1, type) {
|
|
495
|
+
var title = _ref1.title,
|
|
496
|
+
showAdd = _ref1.showAdd,
|
|
497
|
+
key = _ref1.key;
|
|
503
498
|
if (showAdd && type !== 'readonly') {
|
|
504
|
-
var
|
|
505
|
-
var onClick = _bindInstanceProperty(
|
|
499
|
+
var _context13;
|
|
500
|
+
var onClick = _bindInstanceProperty(_context13 = _this2.onAdd).call(_context13, _this2, key, title);
|
|
506
501
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
507
502
|
role: "add",
|
|
508
503
|
type: "plus-circle-o",
|
|
@@ -512,7 +507,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
512
507
|
return title;
|
|
513
508
|
}
|
|
514
509
|
});
|
|
515
|
-
_defineProperty(
|
|
510
|
+
_defineProperty(_this2, "toCol", function (span, control) {
|
|
516
511
|
var factor = control.span || 1;
|
|
517
512
|
var status = _this2.getValidState(control);
|
|
518
513
|
var controlProps = _this2.getControlProps(control, status);
|
|
@@ -529,7 +524,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
529
524
|
key: control.key
|
|
530
525
|
}, checkable && /*#__PURE__*/React.createElement(_Checkbox, {
|
|
531
526
|
className: variables('SuperForm').checkbox,
|
|
532
|
-
onChange: _bindInstanceProperty(onCheckItem).call(onCheckItem,
|
|
527
|
+
onChange: _bindInstanceProperty(onCheckItem).call(onCheckItem, _this2, control),
|
|
533
528
|
checked: control.checked
|
|
534
529
|
}), /*#__PURE__*/React.createElement(FormItem, _extends({}, itemProps, {
|
|
535
530
|
className: checkable ? variables('SuperForm').formItemWithCheckbox : ''
|
|
@@ -541,8 +536,8 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
541
536
|
}
|
|
542
537
|
});
|
|
543
538
|
});
|
|
544
|
-
_defineProperty(
|
|
545
|
-
var
|
|
539
|
+
_defineProperty(_this2, "toCols", function () {
|
|
540
|
+
var _context14;
|
|
546
541
|
var _this2$props4 = _this2.props,
|
|
547
542
|
_this2$props4$colNum = _this2$props4.colNum,
|
|
548
543
|
colNum = _this2$props4$colNum === void 0 ? defaultColNum : _this2$props4$colNum,
|
|
@@ -551,7 +546,7 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
551
546
|
colNum = 1;
|
|
552
547
|
}
|
|
553
548
|
var span = 24 / colNum;
|
|
554
|
-
return _mapInstanceProperty(
|
|
549
|
+
return _mapInstanceProperty(_context14 = _this2.getControls()).call(_context14, function (control) {
|
|
555
550
|
if (allFullFather) {
|
|
556
551
|
control.allFullFather = allFullFather;
|
|
557
552
|
}
|
|
@@ -560,7 +555,8 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
560
555
|
});
|
|
561
556
|
return _this2;
|
|
562
557
|
}
|
|
563
|
-
|
|
558
|
+
_inherits(SuperForm, _React$Component2);
|
|
559
|
+
return _createClass(SuperForm, [{
|
|
564
560
|
key: "render",
|
|
565
561
|
value: function render() {
|
|
566
562
|
this.initValidState();
|
|
@@ -576,7 +572,6 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
|
|
|
576
572
|
}, this.toCols())));
|
|
577
573
|
}
|
|
578
574
|
}]);
|
|
579
|
-
return SuperForm;
|
|
580
575
|
}(React.Component);
|
|
581
576
|
_defineProperty(SuperForm, "propTypes", {
|
|
582
577
|
controls: PropTypes.arrayOf(PropTypes.shape(ControlType)).isRequired,
|