cloud-b2b 1.1.69 → 1.1.71
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 +8 -11
- package/es/CodeInput/CodeInput.js +16 -19
- package/es/Control/Control.js +21 -3
- 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 +22 -24
- 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 +114 -105
- package/es/SuperForm2/SuperForm.less +7 -0
- 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/SuperTableCell.js +27 -30
- package/es/SuperTable3/FilterDropDown.js +11 -14
- package/es/SuperTable3/SuperTable.js +58 -61
- package/es/SuperToolbar/SuperToolbar.js +11 -14
- package/es/SuperUpload/SuperUpload.js +74 -74
- 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 +8 -11
- package/lib/CodeInput/CodeInput.js +16 -19
- package/lib/Control/Control.js +21 -3
- 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 +22 -24
- 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 +115 -107
- package/lib/SuperForm2/SuperForm.less +7 -0
- 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/SuperTableCell.js +27 -30
- package/lib/SuperTable3/FilterDropDown.js +11 -14
- package/lib/SuperTable3/SuperTable.js +58 -61
- package/lib/SuperToolbar/SuperToolbar.js +11 -14
- package/lib/SuperUpload/SuperUpload.js +75 -76
- 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
|
@@ -1,21 +1,18 @@
|
|
|
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 _Select from "antd/es/select";
|
|
10
9
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
11
10
|
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
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
|
var Option = _Select.Option;
|
|
16
15
|
var InputWriting = /*#__PURE__*/function (_React$Component) {
|
|
17
|
-
_inherits(InputWriting, _React$Component);
|
|
18
|
-
var _super = _createSuper(InputWriting);
|
|
19
16
|
function InputWriting() {
|
|
20
17
|
var _context;
|
|
21
18
|
var _this;
|
|
@@ -23,13 +20,13 @@ var InputWriting = /*#__PURE__*/function (_React$Component) {
|
|
|
23
20
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24
21
|
args[_key] = arguments[_key];
|
|
25
22
|
}
|
|
26
|
-
_this =
|
|
27
|
-
_defineProperty(
|
|
23
|
+
_this = _callSuper(this, InputWriting, _concatInstanceProperty(_context = []).call(_context, args));
|
|
24
|
+
_defineProperty(_this, "state", {
|
|
28
25
|
options: [],
|
|
29
26
|
value: [],
|
|
30
27
|
fetching: false
|
|
31
28
|
});
|
|
32
|
-
_defineProperty(
|
|
29
|
+
_defineProperty(_this, "onClick", function (e) {
|
|
33
30
|
var _this$props = _this.props,
|
|
34
31
|
_this$props$options = _this$props.options,
|
|
35
32
|
options = _this$props$options === void 0 ? [] : _this$props$options,
|
|
@@ -39,21 +36,21 @@ var InputWriting = /*#__PURE__*/function (_React$Component) {
|
|
|
39
36
|
onSearch(e.target.value);
|
|
40
37
|
}
|
|
41
38
|
});
|
|
42
|
-
_defineProperty(
|
|
39
|
+
_defineProperty(_this, "onSearch", function (value) {
|
|
43
40
|
var onSearch = _this.props.onSearch;
|
|
44
41
|
onSearch && onSearch(value);
|
|
45
42
|
});
|
|
46
|
-
_defineProperty(
|
|
43
|
+
_defineProperty(_this, "isMatch", function (inputValue, option) {
|
|
47
44
|
var _context2;
|
|
48
45
|
return _indexOfInstanceProperty(_context2 = option.props.children).call(_context2, inputValue) !== -1;
|
|
49
46
|
});
|
|
50
|
-
_defineProperty(
|
|
47
|
+
_defineProperty(_this, "toOption", function (option, index) {
|
|
51
48
|
return /*#__PURE__*/React.createElement(SelectOption, {
|
|
52
49
|
key: index,
|
|
53
50
|
value: String(option.value)
|
|
54
51
|
}, option.title);
|
|
55
52
|
});
|
|
56
|
-
_defineProperty(
|
|
53
|
+
_defineProperty(_this, "onChange", function (keyValue) {
|
|
57
54
|
var _this$props2 = _this.props,
|
|
58
55
|
onChange = _this$props2.onChange,
|
|
59
56
|
value = _this$props2.value;
|
|
@@ -61,7 +58,8 @@ var InputWriting = /*#__PURE__*/function (_React$Component) {
|
|
|
61
58
|
});
|
|
62
59
|
return _this;
|
|
63
60
|
}
|
|
64
|
-
|
|
61
|
+
_inherits(InputWriting, _React$Component);
|
|
62
|
+
return _createClass(InputWriting, [{
|
|
65
63
|
key: "render",
|
|
66
64
|
value: function render() {
|
|
67
65
|
var value = this.props.value;
|
|
@@ -80,6 +78,5 @@ var InputWriting = /*#__PURE__*/function (_React$Component) {
|
|
|
80
78
|
}, /*#__PURE__*/React.createElement(_Select, props));
|
|
81
79
|
}
|
|
82
80
|
}]);
|
|
83
|
-
return InputWriting;
|
|
84
81
|
}(React.Component);
|
|
85
82
|
export default InputWriting;
|
package/es/Layout/Layout.js
CHANGED
|
@@ -2,13 +2,12 @@ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/co
|
|
|
2
2
|
import _Button from "antd/es/button";
|
|
3
3
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
7
5
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
8
6
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
9
8
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
10
|
-
function
|
|
11
|
-
function _isNativeReflectConstruct() {
|
|
9
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
11
|
import _Object$keys2 from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
13
12
|
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
14
13
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
@@ -42,19 +41,17 @@ var getCurrentSideKey = function getCurrentSideKey() {
|
|
|
42
41
|
}
|
|
43
42
|
};
|
|
44
43
|
var Layout = /*#__PURE__*/function (_React$Component) {
|
|
45
|
-
_inherits(Layout, _React$Component);
|
|
46
|
-
var _super = _createSuper(Layout);
|
|
47
44
|
function Layout(props) {
|
|
48
45
|
var _this;
|
|
49
46
|
_classCallCheck(this, Layout);
|
|
50
|
-
_this =
|
|
51
|
-
_defineProperty(
|
|
47
|
+
_this = _callSuper(this, Layout, [props]);
|
|
48
|
+
_defineProperty(_this, "onOpenChange", function (sideKey, openKeys) {
|
|
52
49
|
var onOpenChange = _this.props.onOpenChange;
|
|
53
50
|
if (onOpenChange) {
|
|
54
51
|
onOpenChange(sideKey, openKeys);
|
|
55
52
|
}
|
|
56
53
|
});
|
|
57
|
-
_defineProperty(
|
|
54
|
+
_defineProperty(_this, "getSidebarProps", function (sideKey) {
|
|
58
55
|
var _context3;
|
|
59
56
|
var _this$props = _this.props,
|
|
60
57
|
sidebars = _this$props.sidebars,
|
|
@@ -71,7 +68,7 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
71
68
|
activeKey: nav2,
|
|
72
69
|
items: sides,
|
|
73
70
|
openKeys: openKeys[sideKey] || [],
|
|
74
|
-
onOpenChange: _bindInstanceProperty(_context3 = _this.onOpenChange).call(_context3,
|
|
71
|
+
onOpenChange: _bindInstanceProperty(_context3 = _this.onOpenChange).call(_context3, _this, sideKey),
|
|
75
72
|
onModeChange: function onModeChange(mode) {
|
|
76
73
|
return _this.setState({
|
|
77
74
|
mode: mode
|
|
@@ -79,7 +76,7 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
79
76
|
}
|
|
80
77
|
};
|
|
81
78
|
});
|
|
82
|
-
_defineProperty(
|
|
79
|
+
_defineProperty(_this, "toSidebar", function (sideKey) {
|
|
83
80
|
var hasHeaderV = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
84
81
|
if (!sideKey) {
|
|
85
82
|
return null;
|
|
@@ -91,7 +88,7 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
91
88
|
}, /*#__PURE__*/React.createElement(Sidebar, _this.getSidebarProps(sideKey)));
|
|
92
89
|
}
|
|
93
90
|
});
|
|
94
|
-
_defineProperty(
|
|
91
|
+
_defineProperty(_this, "toHeader", function () {
|
|
95
92
|
var _context4, _context5;
|
|
96
93
|
var _this$props2 = _this.props,
|
|
97
94
|
loading = _this$props2.loading,
|
|
@@ -123,7 +120,7 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
123
120
|
onLogout: onLogout
|
|
124
121
|
});
|
|
125
122
|
});
|
|
126
|
-
_defineProperty(
|
|
123
|
+
_defineProperty(_this, "headerVProps", function (selectKey) {
|
|
127
124
|
var _context6;
|
|
128
125
|
var keys = ['setting', 'message'];
|
|
129
126
|
return {
|
|
@@ -140,7 +137,8 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
140
137
|
};
|
|
141
138
|
return _this;
|
|
142
139
|
}
|
|
143
|
-
|
|
140
|
+
_inherits(Layout, _React$Component);
|
|
141
|
+
return _createClass(Layout, [{
|
|
144
142
|
key: "componentWillReceiveProps",
|
|
145
143
|
value: function componentWillReceiveProps(props) {
|
|
146
144
|
if (!props.loading) {
|
|
@@ -153,7 +151,7 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
153
151
|
}, {
|
|
154
152
|
key: "render",
|
|
155
153
|
value: function render() {
|
|
156
|
-
var
|
|
154
|
+
var _context0;
|
|
157
155
|
var _this$props3 = this.props,
|
|
158
156
|
loading = _this$props3.loading,
|
|
159
157
|
sidebars = _this$props3.sidebars,
|
|
@@ -169,7 +167,7 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
169
167
|
var _context9;
|
|
170
168
|
return !_includesInstanceProperty(_context9 = ['setting', 'message']).call(_context9, item.key);
|
|
171
169
|
}).length > 1;
|
|
172
|
-
var sideKey = loading || !nav2 ? '' : getCurrentSideKey(sidebars, _concatInstanceProperty(
|
|
170
|
+
var sideKey = loading || !nav2 ? '' : getCurrentSideKey(sidebars, _concatInstanceProperty(_context0 = "/".concat(nav1, "/")).call(_context0, nav2));
|
|
173
171
|
return noPrivilege ? /*#__PURE__*/React.createElement("div", {
|
|
174
172
|
style: {
|
|
175
173
|
textAlign: 'center'
|
|
@@ -188,7 +186,6 @@ var Layout = /*#__PURE__*/function (_React$Component) {
|
|
|
188
186
|
}, this.toHeader(sideKey), loading ? /*#__PURE__*/React.createElement(Loading, null) : /*#__PURE__*/React.createElement("div", null, hasV ? /*#__PURE__*/React.createElement(HeaderV, this.headerVProps(sideKey)) : null, this.toSidebar(sideKey, hasV), /*#__PURE__*/React.createElement("section", null, children)));
|
|
189
187
|
}
|
|
190
188
|
}]);
|
|
191
|
-
return Layout;
|
|
192
189
|
}(React.Component);
|
|
193
190
|
_defineProperty(Layout, "propTypes", {
|
|
194
191
|
children: PropTypes.node.isRequired,
|
package/es/Link/Link.js
CHANGED
|
@@ -3,15 +3,14 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
|
|
4
4
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
5
5
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
6
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
7
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
8
6
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
9
7
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
8
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
10
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
11
10
|
var _excluded = ["to", "children", "disabled"];
|
|
12
11
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
13
|
-
function
|
|
14
|
-
function _isNativeReflectConstruct() {
|
|
12
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
15
14
|
import React from 'react';
|
|
16
15
|
import PropTypes from 'prop-types';
|
|
17
16
|
import history from '../history';
|
|
@@ -29,8 +28,6 @@ function jump(url) {
|
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
var Link = /*#__PURE__*/function (_React$Component) {
|
|
32
|
-
_inherits(Link, _React$Component);
|
|
33
|
-
var _super = _createSuper(Link);
|
|
34
31
|
function Link() {
|
|
35
32
|
var _context;
|
|
36
33
|
var _this;
|
|
@@ -38,8 +35,8 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
38
35
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
39
36
|
args[_key] = arguments[_key];
|
|
40
37
|
}
|
|
41
|
-
_this =
|
|
42
|
-
_defineProperty(
|
|
38
|
+
_this = _callSuper(this, Link, _concatInstanceProperty(_context = []).call(_context, args));
|
|
39
|
+
_defineProperty(_this, "handleClick", function (event) {
|
|
43
40
|
if (_this.props.onClick) {
|
|
44
41
|
_this.props.onClick(event);
|
|
45
42
|
}
|
|
@@ -54,7 +51,8 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
54
51
|
});
|
|
55
52
|
return _this;
|
|
56
53
|
}
|
|
57
|
-
|
|
54
|
+
_inherits(Link, _React$Component);
|
|
55
|
+
return _createClass(Link, [{
|
|
58
56
|
key: "render",
|
|
59
57
|
value: function render() {
|
|
60
58
|
var _this$props = this.props,
|
|
@@ -73,7 +71,6 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
73
71
|
}
|
|
74
72
|
}
|
|
75
73
|
}]);
|
|
76
|
-
return Link;
|
|
77
74
|
}(React.Component);
|
|
78
75
|
_defineProperty(Link, "propTypes", {
|
|
79
76
|
to: PropTypes.string,
|
|
@@ -9,15 +9,14 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
|
9
9
|
import _Input from "antd/es/input";
|
|
10
10
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
11
11
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
12
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
13
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
14
12
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
15
13
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
14
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
16
15
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
17
16
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
-
function
|
|
20
|
-
function _isNativeReflectConstruct() {
|
|
18
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
19
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
20
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
22
21
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
23
22
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
@@ -100,8 +99,6 @@ var PROPS = {
|
|
|
100
99
|
};
|
|
101
100
|
var PROPS_KEYS = _Object$keys(PROPS);
|
|
102
101
|
var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
103
|
-
_inherits(NumberInput, _React$Component);
|
|
104
|
-
var _super = _createSuper(NumberInput);
|
|
105
102
|
function NumberInput() {
|
|
106
103
|
var _context2;
|
|
107
104
|
var _this;
|
|
@@ -109,12 +106,12 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
|
109
106
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
110
107
|
args[_key] = arguments[_key];
|
|
111
108
|
}
|
|
112
|
-
_this =
|
|
113
|
-
_defineProperty(
|
|
109
|
+
_this = _callSuper(this, NumberInput, _concatInstanceProperty(_context2 = []).call(_context2, args));
|
|
110
|
+
_defineProperty(_this, "state", {
|
|
114
111
|
typo: false,
|
|
115
112
|
value: ''
|
|
116
113
|
});
|
|
117
|
-
_defineProperty(
|
|
114
|
+
_defineProperty(_this, "onChange", function (event) {
|
|
118
115
|
var value = event.target.value;
|
|
119
116
|
if (!_this.hasSpecialChar(value)) {
|
|
120
117
|
_this.setState({
|
|
@@ -123,7 +120,7 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
|
123
120
|
});
|
|
124
121
|
}
|
|
125
122
|
});
|
|
126
|
-
_defineProperty(
|
|
123
|
+
_defineProperty(_this, "onBlur", function (event) {
|
|
127
124
|
var _this$props = _this.props,
|
|
128
125
|
onBlur = _this$props.onBlur,
|
|
129
126
|
onChange = _this$props.onChange,
|
|
@@ -142,7 +139,7 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
|
142
139
|
onBlur && onBlur(event); //有输入才触发外部失去焦点事件,避免非必要请求
|
|
143
140
|
}
|
|
144
141
|
});
|
|
145
|
-
_defineProperty(
|
|
142
|
+
_defineProperty(_this, "hasSpecialChar", function (value) {
|
|
146
143
|
if (_includesInstanceProperty(value).call(value, '+')) {
|
|
147
144
|
return true;
|
|
148
145
|
} else if (!_this.props.sign && _includesInstanceProperty(value).call(value, '-')) {
|
|
@@ -151,7 +148,7 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
|
151
148
|
return !_this.props.real && _includesInstanceProperty(value).call(value, '.');
|
|
152
149
|
}
|
|
153
150
|
});
|
|
154
|
-
_defineProperty(
|
|
151
|
+
_defineProperty(_this, "format", function (value, fixed) {
|
|
155
152
|
var _this$props2 = _this.props,
|
|
156
153
|
real = _this$props2.real,
|
|
157
154
|
sign = _this$props2.sign,
|
|
@@ -167,7 +164,7 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
|
167
164
|
big: big
|
|
168
165
|
});
|
|
169
166
|
});
|
|
170
|
-
_defineProperty(
|
|
167
|
+
_defineProperty(_this, "getShowValue", function () {
|
|
171
168
|
if (_this.state.typo) {
|
|
172
169
|
// 处于输入状态从state中取值
|
|
173
170
|
return _this.state.value;
|
|
@@ -176,7 +173,7 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
|
176
173
|
return _this.format(_this.props.defaultValue, _this.props.fixed).value;
|
|
177
174
|
}
|
|
178
175
|
});
|
|
179
|
-
_defineProperty(
|
|
176
|
+
_defineProperty(_this, "getProps", function () {
|
|
180
177
|
var props = getObjectExclude(_this.props, PROPS_KEYS);
|
|
181
178
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
182
179
|
type: 'text',
|
|
@@ -188,13 +185,13 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
|
|
|
188
185
|
});
|
|
189
186
|
return _this;
|
|
190
187
|
}
|
|
191
|
-
|
|
188
|
+
_inherits(NumberInput, _React$Component);
|
|
189
|
+
return _createClass(NumberInput, [{
|
|
192
190
|
key: "render",
|
|
193
191
|
value: function render() {
|
|
194
192
|
return /*#__PURE__*/React.createElement(_Input, this.getProps());
|
|
195
193
|
}
|
|
196
194
|
}]);
|
|
197
|
-
return NumberInput;
|
|
198
195
|
}(React.Component);
|
|
199
196
|
_defineProperty(NumberInput, "propTypes", PROPS);
|
|
200
197
|
export default NumberInput;
|