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
|
@@ -2,30 +2,27 @@ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/co
|
|
|
2
2
|
import _Empty from "antd/es/empty";
|
|
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
9
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
11
|
-
function
|
|
12
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
12
|
import React from 'react';
|
|
14
13
|
import { ModalWithDrag, Title } from '../index';
|
|
15
14
|
import variables from '../variables';
|
|
16
15
|
var ImageView = /*#__PURE__*/function (_React$Component) {
|
|
17
|
-
_inherits(ImageView, _React$Component);
|
|
18
|
-
var _super = _createSuper(ImageView);
|
|
19
16
|
function ImageView(_props) {
|
|
20
17
|
var _this;
|
|
21
18
|
_classCallCheck(this, ImageView);
|
|
22
|
-
_this =
|
|
23
|
-
_defineProperty(
|
|
19
|
+
_this = _callSuper(this, ImageView, [_props]);
|
|
20
|
+
_defineProperty(_this, "ClosePreview", function () {
|
|
24
21
|
_this.setState({
|
|
25
22
|
previewVisible: false
|
|
26
23
|
});
|
|
27
24
|
});
|
|
28
|
-
_defineProperty(
|
|
25
|
+
_defineProperty(_this, "showBigImg", function () {
|
|
29
26
|
var imgList = _this.props.imgList;
|
|
30
27
|
var _this$state = _this.state,
|
|
31
28
|
previewVisible = _this$state.previewVisible,
|
|
@@ -46,14 +43,14 @@ var ImageView = /*#__PURE__*/function (_React$Component) {
|
|
|
46
43
|
src: imgList[index].fileUrl
|
|
47
44
|
}));
|
|
48
45
|
});
|
|
49
|
-
_defineProperty(
|
|
46
|
+
_defineProperty(_this, "toSeeImg", function (e) {
|
|
50
47
|
if (_this.props.toSeeImg) {
|
|
51
48
|
_this.props.toSeeImg(e);
|
|
52
49
|
} else {
|
|
53
50
|
_this.myClick(e.index);
|
|
54
51
|
}
|
|
55
52
|
});
|
|
56
|
-
_defineProperty(
|
|
53
|
+
_defineProperty(_this, "myClick", function (index) {
|
|
57
54
|
_this.setState({
|
|
58
55
|
previewVisible: true,
|
|
59
56
|
index: index
|
|
@@ -65,7 +62,8 @@ var ImageView = /*#__PURE__*/function (_React$Component) {
|
|
|
65
62
|
};
|
|
66
63
|
return _this;
|
|
67
64
|
}
|
|
68
|
-
|
|
65
|
+
_inherits(ImageView, _React$Component);
|
|
66
|
+
return _createClass(ImageView, [{
|
|
69
67
|
key: "render",
|
|
70
68
|
value: function render() {
|
|
71
69
|
var _this2 = this;
|
|
@@ -95,6 +93,5 @@ var ImageView = /*#__PURE__*/function (_React$Component) {
|
|
|
95
93
|
}), toSeeImg ? null : this.showBigImg());
|
|
96
94
|
}
|
|
97
95
|
}]);
|
|
98
|
-
return ImageView;
|
|
99
96
|
}(React.Component);
|
|
100
97
|
export default ImageView;
|
|
@@ -9,15 +9,14 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
|
9
9
|
import _Cascader from "antd/es/cascader";
|
|
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 _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys(Object(t))).call(_context3, 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 _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
22
21
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
23
22
|
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
@@ -45,21 +44,19 @@ var PROPS = {
|
|
|
45
44
|
};
|
|
46
45
|
var PROPS_KEYS = _Object$keys(PROPS);
|
|
47
46
|
var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
48
|
-
_inherits(InputCascader, _React$Component);
|
|
49
|
-
var _super = _createSuper(InputCascader);
|
|
50
47
|
function InputCascader(_props) {
|
|
51
48
|
var _this;
|
|
52
49
|
_classCallCheck(this, InputCascader);
|
|
53
|
-
_this =
|
|
54
|
-
_defineProperty(
|
|
50
|
+
_this = _callSuper(this, InputCascader, [_props]);
|
|
51
|
+
_defineProperty(_this, "onChange", function (value) {
|
|
55
52
|
var onChange = _this.props.onChange;
|
|
56
53
|
onChange && onChange(value);
|
|
57
54
|
});
|
|
58
|
-
_defineProperty(
|
|
55
|
+
_defineProperty(_this, "loadData", function (selectedOptions) {
|
|
59
56
|
var onSearch = _this.props.onSearch;
|
|
60
57
|
onSearch && onSearch(selectedOptions[0]);
|
|
61
58
|
});
|
|
62
|
-
_defineProperty(
|
|
59
|
+
_defineProperty(_this, "getOptions", function (options) {
|
|
63
60
|
return _mapInstanceProperty(options).call(options, function (option) {
|
|
64
61
|
var obj = _objectSpread(_objectSpread({}, option), {}, {
|
|
65
62
|
label: option.title
|
|
@@ -70,13 +67,13 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
|
70
67
|
return obj;
|
|
71
68
|
});
|
|
72
69
|
});
|
|
73
|
-
_defineProperty(
|
|
70
|
+
_defineProperty(_this, "showSearch", function (inputValue, path) {
|
|
74
71
|
return _someInstanceProperty(path).call(path, function (option) {
|
|
75
72
|
var _context;
|
|
76
73
|
return _indexOfInstanceProperty(_context = option.label.toLowerCase()).call(_context, inputValue.toLowerCase()) > -1;
|
|
77
74
|
});
|
|
78
75
|
});
|
|
79
|
-
_defineProperty(
|
|
76
|
+
_defineProperty(_this, "getProps", function () {
|
|
80
77
|
var _this$props = _this.props,
|
|
81
78
|
_this$props$options = _this$props.options,
|
|
82
79
|
options = _this$props$options === void 0 ? [] : _this$props$options,
|
|
@@ -105,13 +102,13 @@ var InputCascader = /*#__PURE__*/function (_React$Component) {
|
|
|
105
102
|
});
|
|
106
103
|
return _this;
|
|
107
104
|
}
|
|
108
|
-
|
|
105
|
+
_inherits(InputCascader, _React$Component);
|
|
106
|
+
return _createClass(InputCascader, [{
|
|
109
107
|
key: "render",
|
|
110
108
|
value: function render() {
|
|
111
109
|
return /*#__PURE__*/React.createElement(_Cascader, this.getProps());
|
|
112
110
|
}
|
|
113
111
|
}]);
|
|
114
|
-
return InputCascader;
|
|
115
112
|
}(React.Component);
|
|
116
113
|
_defineProperty(InputCascader, "propTypes", PROPS);
|
|
117
114
|
export default InputCascader;
|
|
@@ -2,13 +2,13 @@ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/co
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
3
3
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
5
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
6
5
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
7
6
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
9
9
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
10
|
-
function
|
|
11
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import variables from '../variables';
|
|
14
14
|
import helper from "../helper";
|
|
@@ -47,13 +47,12 @@ var defaultMenus = ['head',
|
|
|
47
47
|
'video' // 插入视频
|
|
48
48
|
];
|
|
49
49
|
var InputEditor = /*#__PURE__*/function (_React$Component) {
|
|
50
|
-
_inherits(InputEditor, _React$Component);
|
|
51
|
-
var _super = _createSuper(InputEditor);
|
|
52
50
|
function InputEditor() {
|
|
53
51
|
_classCallCheck(this, InputEditor);
|
|
54
|
-
return
|
|
52
|
+
return _callSuper(this, InputEditor, arguments);
|
|
55
53
|
}
|
|
56
|
-
|
|
54
|
+
_inherits(InputEditor, _React$Component);
|
|
55
|
+
return _createClass(InputEditor, [{
|
|
57
56
|
key: "componentDidMount",
|
|
58
57
|
value: function componentDidMount() {
|
|
59
58
|
var _this$props = this.props,
|
|
@@ -91,38 +90,38 @@ var InputEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
91
90
|
// 自定义视频插入回调
|
|
92
91
|
this[inputKey].config.uploadVideoHooks = {
|
|
93
92
|
customInsert: function () {
|
|
94
|
-
var _customInsert = _asyncToGenerator(
|
|
93
|
+
var _customInsert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(insertVideo, results) {
|
|
95
94
|
var _context, _context2, URL_DOWNLOAD, _yield$helper$fetchJs, returnCode, result, returnMsg, currentOrigin, videoUrl;
|
|
96
|
-
return _regeneratorRuntime.wrap(function
|
|
95
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
97
96
|
while (1) switch (_context3.prev = _context3.next) {
|
|
98
97
|
case 0:
|
|
99
98
|
console.log(results);
|
|
100
99
|
if (!(results.returnCode === 0 && results.result)) {
|
|
101
|
-
_context3.next =
|
|
100
|
+
_context3.next = 3;
|
|
102
101
|
break;
|
|
103
102
|
}
|
|
104
103
|
URL_DOWNLOAD = '/api/standard/download'; // 点击下载
|
|
105
|
-
_context3.next =
|
|
104
|
+
_context3.next = 1;
|
|
106
105
|
return helper.fetchJson(_concatInstanceProperty(_context = "".concat(URL_DOWNLOAD, "/")).call(_context, results.result));
|
|
107
|
-
case
|
|
106
|
+
case 1:
|
|
108
107
|
_yield$helper$fetchJs = _context3.sent;
|
|
109
108
|
returnCode = _yield$helper$fetchJs.returnCode;
|
|
110
109
|
result = _yield$helper$fetchJs.result;
|
|
111
110
|
returnMsg = _yield$helper$fetchJs.returnMsg;
|
|
112
111
|
if (!(returnCode !== 0)) {
|
|
113
|
-
_context3.next =
|
|
112
|
+
_context3.next = 2;
|
|
114
113
|
break;
|
|
115
114
|
}
|
|
116
115
|
return _context3.abrupt("return", helper.showError(returnMsg));
|
|
117
|
-
case
|
|
116
|
+
case 2:
|
|
118
117
|
currentOrigin = window.location.origin; // 获取当前页面的协议+域名+端口
|
|
119
118
|
videoUrl = _concatInstanceProperty(_context2 = "".concat(currentOrigin, "/api/proxy/base-server-service/file/url/documents/open/")).call(_context2, results.result);
|
|
120
119
|
insertVideo(videoUrl);
|
|
121
|
-
_context3.next =
|
|
120
|
+
_context3.next = 4;
|
|
122
121
|
break;
|
|
123
|
-
case
|
|
122
|
+
case 3:
|
|
124
123
|
alert('视频上传失败: ' + (results.message || '未知错误'));
|
|
125
|
-
case
|
|
124
|
+
case 4:
|
|
126
125
|
case "end":
|
|
127
126
|
return _context3.stop();
|
|
128
127
|
}
|
|
@@ -168,6 +167,5 @@ var InputEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
168
167
|
}));
|
|
169
168
|
}
|
|
170
169
|
}]);
|
|
171
|
-
return InputEditor;
|
|
172
170
|
}(React.Component);
|
|
173
171
|
export default InputEditor;
|
|
@@ -3,15 +3,14 @@ import _Input from "antd/es/input";
|
|
|
3
3
|
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
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
|
import _Icon from "antd/es/icon";
|
|
12
11
|
import _AutoComplete from "antd/es/auto-complete";
|
|
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 _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
16
15
|
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
|
17
16
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
@@ -67,25 +66,23 @@ var PROPS = {
|
|
|
67
66
|
};
|
|
68
67
|
var PROPS_KEYS = _Object$keys(PROPS);
|
|
69
68
|
var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
70
|
-
_inherits(InputSearch, _React$Component);
|
|
71
|
-
var _super = _createSuper(InputSearch);
|
|
72
69
|
function InputSearch(_props) {
|
|
73
70
|
var _this;
|
|
74
71
|
_classCallCheck(this, InputSearch);
|
|
75
|
-
_this =
|
|
76
|
-
_defineProperty(
|
|
72
|
+
_this = _callSuper(this, InputSearch, [_props]);
|
|
73
|
+
_defineProperty(_this, "onSearch", function (value) {
|
|
77
74
|
// this.setState({value});
|
|
78
75
|
var _this$props = _this.props,
|
|
79
76
|
onSearch = _this$props.onSearch,
|
|
80
77
|
noSearchWhenTypo = _this$props.noSearchWhenTypo;
|
|
81
78
|
!noSearchWhenTypo && onSearch && onSearch(value);
|
|
82
79
|
});
|
|
83
|
-
_defineProperty(
|
|
80
|
+
_defineProperty(_this, "onChange", function (value) {
|
|
84
81
|
_this.setState({
|
|
85
82
|
value: value
|
|
86
83
|
});
|
|
87
84
|
});
|
|
88
|
-
_defineProperty(
|
|
85
|
+
_defineProperty(_this, "onBlur", function () {
|
|
89
86
|
var _this$props2 = _this.props,
|
|
90
87
|
_this$props2$autoAdd = _this$props2.autoAdd,
|
|
91
88
|
autoAdd = _this$props2$autoAdd === void 0 ? false : _this$props2$autoAdd,
|
|
@@ -121,7 +118,7 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
121
118
|
onBlur && onBlur(_this.props.value);
|
|
122
119
|
}
|
|
123
120
|
});
|
|
124
|
-
_defineProperty(
|
|
121
|
+
_defineProperty(_this, "onSelect", function (value) {
|
|
125
122
|
var _this$props3 = _this.props,
|
|
126
123
|
onChange = _this$props3.onChange,
|
|
127
124
|
_this$props3$options = _this$props3.options,
|
|
@@ -136,7 +133,7 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
136
133
|
onChange && onChange(options[index]);
|
|
137
134
|
}
|
|
138
135
|
});
|
|
139
|
-
_defineProperty(
|
|
136
|
+
_defineProperty(_this, "onClick", function (e) {
|
|
140
137
|
var _this$props4 = _this.props,
|
|
141
138
|
_this$props4$options = _this$props4.options,
|
|
142
139
|
options = _this$props4$options === void 0 ? [] : _this$props4$options,
|
|
@@ -147,20 +144,20 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
147
144
|
onSearch(e.target.value);
|
|
148
145
|
}
|
|
149
146
|
});
|
|
150
|
-
_defineProperty(
|
|
147
|
+
_defineProperty(_this, "makeValueValid", function (value) {
|
|
151
148
|
var _context;
|
|
152
149
|
return _includesInstanceProperty(_context = [NaN, undefined, null]).call(_context, value) ? '' : value;
|
|
153
150
|
});
|
|
154
|
-
_defineProperty(
|
|
151
|
+
_defineProperty(_this, "getValue", function () {
|
|
155
152
|
var value = _this.state.value;
|
|
156
153
|
return String(_this.makeValueValid(_typeof(value) === 'object' ? value.value : value));
|
|
157
154
|
});
|
|
158
|
-
_defineProperty(
|
|
155
|
+
_defineProperty(_this, "isMatch", function (inputValue, option) {
|
|
159
156
|
var _context2;
|
|
160
157
|
// return option.props.children && option.props.children.indexOf(inputValue) !== -1;
|
|
161
158
|
return option.props.children && _indexOfInstanceProperty(_context2 = option.props.children.toUpperCase()).call(_context2, inputValue.toUpperCase()) !== -1;
|
|
162
159
|
});
|
|
163
|
-
_defineProperty(
|
|
160
|
+
_defineProperty(_this, "isMatchRemark", function (inputValue, option) {
|
|
164
161
|
var _option$props = option.props,
|
|
165
162
|
_option$props$text = _option$props.text,
|
|
166
163
|
text = _option$props$text === void 0 ? '' : _option$props$text,
|
|
@@ -168,12 +165,12 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
168
165
|
remark = _option$props$remark === void 0 ? '' : _option$props$remark;
|
|
169
166
|
return _indexOfInstanceProperty(text).call(text, inputValue) > -1 || _indexOfInstanceProperty(remark).call(remark, inputValue) > -1;
|
|
170
167
|
});
|
|
171
|
-
_defineProperty(
|
|
168
|
+
_defineProperty(_this, "isValidValue", function (value) {
|
|
172
169
|
var _context3;
|
|
173
170
|
// value必须为对象,且有属性value的值不等''或undefined
|
|
174
171
|
return value && !_includesInstanceProperty(_context3 = ['', undefined]).call(_context3, value.value);
|
|
175
172
|
});
|
|
176
|
-
_defineProperty(
|
|
173
|
+
_defineProperty(_this, "getOptions", function () {
|
|
177
174
|
var value = _this.state.value;
|
|
178
175
|
var options = _this.props.options;
|
|
179
176
|
if (options && options.length) {
|
|
@@ -190,7 +187,7 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
190
187
|
return [];
|
|
191
188
|
}
|
|
192
189
|
});
|
|
193
|
-
_defineProperty(
|
|
190
|
+
_defineProperty(_this, "getDataSource", function () {
|
|
194
191
|
var _context4;
|
|
195
192
|
return _mapInstanceProperty(_context4 = _this.getOptions()).call(_context4, function (option) {
|
|
196
193
|
return {
|
|
@@ -199,7 +196,7 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
199
196
|
};
|
|
200
197
|
});
|
|
201
198
|
});
|
|
202
|
-
_defineProperty(
|
|
199
|
+
_defineProperty(_this, "getDataSourceRemark", function () {
|
|
203
200
|
var _context5;
|
|
204
201
|
return _mapInstanceProperty(_context5 = _this.getOptions()).call(_context5, function (option, index) {
|
|
205
202
|
return /*#__PURE__*/React.createElement(SelectOption, {
|
|
@@ -214,7 +211,7 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
214
211
|
}, option.description || ''));
|
|
215
212
|
});
|
|
216
213
|
});
|
|
217
|
-
_defineProperty(
|
|
214
|
+
_defineProperty(_this, "getProps", function () {
|
|
218
215
|
var _this$props5 = _this.props,
|
|
219
216
|
inputRef = _this$props5.inputRef,
|
|
220
217
|
_this$props5$filter = _filterInstanceProperty(_this$props5),
|
|
@@ -246,7 +243,8 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
246
243
|
};
|
|
247
244
|
return _this;
|
|
248
245
|
}
|
|
249
|
-
|
|
246
|
+
_inherits(InputSearch, _React$Component);
|
|
247
|
+
return _createClass(InputSearch, [{
|
|
250
248
|
key: "componentWillReceiveProps",
|
|
251
249
|
value: function componentWillReceiveProps(props) {
|
|
252
250
|
if (props.value !== this.props.value) {
|
|
@@ -261,11 +259,11 @@ var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
261
259
|
return /*#__PURE__*/React.createElement("div", {
|
|
262
260
|
onClick: this.onClick
|
|
263
261
|
}, /*#__PURE__*/React.createElement(_AutoComplete, this.getProps(), /*#__PURE__*/React.createElement(_Input, {
|
|
264
|
-
suffix: suffix
|
|
262
|
+
suffix: suffix,
|
|
263
|
+
placeholder: this.props.placeholder
|
|
265
264
|
})));
|
|
266
265
|
}
|
|
267
266
|
}]);
|
|
268
|
-
return InputSearch;
|
|
269
267
|
}(React.Component);
|
|
270
268
|
_defineProperty(InputSearch, "propTypes", PROPS);
|
|
271
269
|
export default InputSearch;
|
|
@@ -9,10 +9,9 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
|
9
9
|
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
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
|
import _Select from "antd/es/select";
|
|
18
17
|
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; }
|
|
@@ -24,8 +23,8 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
24
23
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
25
24
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
26
25
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
27
|
-
function
|
|
28
|
-
function _isNativeReflectConstruct() {
|
|
26
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
27
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
29
28
|
import React from 'react';
|
|
30
29
|
var SelectOption = _Select.Option;
|
|
31
30
|
var OPTION_STYLE = {
|
|
@@ -36,8 +35,6 @@ var OPTION_STYLE = {
|
|
|
36
35
|
whiteSpace: 'pre-wrap'
|
|
37
36
|
};
|
|
38
37
|
var InputSelect = /*#__PURE__*/function (_React$Component) {
|
|
39
|
-
_inherits(InputSelect, _React$Component);
|
|
40
|
-
var _super = _createSuper(InputSelect);
|
|
41
38
|
function InputSelect() {
|
|
42
39
|
var _context;
|
|
43
40
|
var _this;
|
|
@@ -45,8 +42,8 @@ var InputSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
45
42
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
46
43
|
args[_key] = arguments[_key];
|
|
47
44
|
}
|
|
48
|
-
_this =
|
|
49
|
-
_defineProperty(
|
|
45
|
+
_this = _callSuper(this, InputSelect, _concatInstanceProperty(_context = []).call(_context, args));
|
|
46
|
+
_defineProperty(_this, "onClick", function (e) {
|
|
50
47
|
var _this$props = _this.props,
|
|
51
48
|
_this$props$options = _this$props.options,
|
|
52
49
|
options = _this$props$options === void 0 ? [] : _this$props$options,
|
|
@@ -60,21 +57,21 @@ var InputSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
60
57
|
onSearch(e.target.value);
|
|
61
58
|
}
|
|
62
59
|
});
|
|
63
|
-
_defineProperty(
|
|
60
|
+
_defineProperty(_this, "onSearch", function (value) {
|
|
64
61
|
var onSearch = _this.props.onSearch;
|
|
65
62
|
onSearch && onSearch(value);
|
|
66
63
|
});
|
|
67
|
-
_defineProperty(
|
|
64
|
+
_defineProperty(_this, "isMatch", function (inputValue, option) {
|
|
68
65
|
var _context2;
|
|
69
66
|
return _indexOfInstanceProperty(_context2 = option.props.children).call(_context2, inputValue) !== -1;
|
|
70
67
|
});
|
|
71
|
-
_defineProperty(
|
|
68
|
+
_defineProperty(_this, "isMatchRemark", function (inputValue, option) {
|
|
72
69
|
var _option$props = option.props,
|
|
73
70
|
text = _option$props.text,
|
|
74
71
|
remark = _option$props.remark;
|
|
75
72
|
return _indexOfInstanceProperty(text).call(text, inputValue) > -1 || _indexOfInstanceProperty(remark).call(remark, inputValue) > -1;
|
|
76
73
|
});
|
|
77
|
-
_defineProperty(
|
|
74
|
+
_defineProperty(_this, "toRemarkOption", function (option, index) {
|
|
78
75
|
return /*#__PURE__*/React.createElement(SelectOption, {
|
|
79
76
|
key: index,
|
|
80
77
|
value: String(option.value),
|
|
@@ -85,14 +82,14 @@ var InputSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
85
82
|
style: OPTION_STYLE
|
|
86
83
|
}, option.remark || ''));
|
|
87
84
|
});
|
|
88
|
-
_defineProperty(
|
|
85
|
+
_defineProperty(_this, "toOption", function (option, index) {
|
|
89
86
|
return /*#__PURE__*/React.createElement(SelectOption, {
|
|
90
87
|
key: index,
|
|
91
88
|
value: String(option.value),
|
|
92
89
|
disabled: option.disabled || false
|
|
93
90
|
}, option.title);
|
|
94
91
|
});
|
|
95
|
-
_defineProperty(
|
|
92
|
+
_defineProperty(_this, "onChange", function (options, keyValue) {
|
|
96
93
|
var onChange = _this.props.onChange;
|
|
97
94
|
var objValue = keyValue.length > 0 ? _mapInstanceProperty(keyValue).call(keyValue, function (item) {
|
|
98
95
|
return _objectSpread(_objectSpread({}, _filterInstanceProperty(options).call(options, function (o) {
|
|
@@ -104,7 +101,7 @@ var InputSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
104
101
|
}) : [];
|
|
105
102
|
onChange && onChange(objValue);
|
|
106
103
|
});
|
|
107
|
-
_defineProperty(
|
|
104
|
+
_defineProperty(_this, "getValue", function () {
|
|
108
105
|
var value = _this.props.value;
|
|
109
106
|
if (_typeof(value) === 'object' && _Array$isArray(value)) {
|
|
110
107
|
return _mapInstanceProperty(value).call(value, function (item) {
|
|
@@ -119,7 +116,8 @@ var InputSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
119
116
|
});
|
|
120
117
|
return _this;
|
|
121
118
|
}
|
|
122
|
-
|
|
119
|
+
_inherits(InputSelect, _React$Component);
|
|
120
|
+
return _createClass(InputSelect, [{
|
|
123
121
|
key: "render",
|
|
124
122
|
value: function render() {
|
|
125
123
|
var _context3, _context4;
|
|
@@ -155,6 +153,5 @@ var InputSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
155
153
|
}, /*#__PURE__*/React.createElement(_Select, props, this.props.remark ? _mapInstanceProperty(allOptions).call(allOptions, this.toRemarkOption) : _mapInstanceProperty(allOptions).call(allOptions, this.toOption)));
|
|
156
154
|
}
|
|
157
155
|
}]);
|
|
158
|
-
return InputSelect;
|
|
159
156
|
}(React.Component);
|
|
160
157
|
export default InputSelect;
|
|
@@ -9,15 +9,14 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
|
9
9
|
import _TreeSelect from "antd/es/tree-select";
|
|
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 _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, 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 _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
22
21
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
23
22
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
@@ -48,21 +47,19 @@ var PROPS = {
|
|
|
48
47
|
};
|
|
49
48
|
var PROPS_KEYS = _Object$keys(PROPS);
|
|
50
49
|
var InputTreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
51
|
-
_inherits(InputTreeSelect, _React$Component);
|
|
52
|
-
var _super = _createSuper(InputTreeSelect);
|
|
53
50
|
function InputTreeSelect(_props) {
|
|
54
51
|
var _this;
|
|
55
52
|
_classCallCheck(this, InputTreeSelect);
|
|
56
|
-
_this =
|
|
57
|
-
_defineProperty(
|
|
53
|
+
_this = _callSuper(this, InputTreeSelect, [_props]);
|
|
54
|
+
_defineProperty(_this, "onChange", function (value) {
|
|
58
55
|
var onChange = _this.props.onChange;
|
|
59
56
|
onChange && onChange(value);
|
|
60
57
|
});
|
|
61
|
-
_defineProperty(
|
|
58
|
+
_defineProperty(_this, "loadData", function (selectedOptions) {
|
|
62
59
|
var onSearch = _this.props.onSearch;
|
|
63
60
|
onSearch && onSearch(selectedOptions[0]);
|
|
64
61
|
});
|
|
65
|
-
_defineProperty(
|
|
62
|
+
_defineProperty(_this, "getOptions", function (options) {
|
|
66
63
|
return _mapInstanceProperty(options).call(options, function (option) {
|
|
67
64
|
var obj = _objectSpread(_objectSpread({}, option), {}, {
|
|
68
65
|
label: option.title
|
|
@@ -73,7 +70,7 @@ var InputTreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
73
70
|
return obj;
|
|
74
71
|
});
|
|
75
72
|
});
|
|
76
|
-
_defineProperty(
|
|
73
|
+
_defineProperty(_this, "getProps", function () {
|
|
77
74
|
var _this$props = _this.props,
|
|
78
75
|
_this$props$options = _this$props.options,
|
|
79
76
|
options = _this$props$options === void 0 ? [] : _this$props$options,
|
|
@@ -109,13 +106,13 @@ var InputTreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
109
106
|
});
|
|
110
107
|
return _this;
|
|
111
108
|
}
|
|
112
|
-
|
|
109
|
+
_inherits(InputTreeSelect, _React$Component);
|
|
110
|
+
return _createClass(InputTreeSelect, [{
|
|
113
111
|
key: "render",
|
|
114
112
|
value: function render() {
|
|
115
113
|
return /*#__PURE__*/React.createElement(_TreeSelect, this.getProps());
|
|
116
114
|
}
|
|
117
115
|
}]);
|
|
118
|
-
return InputTreeSelect;
|
|
119
116
|
}(React.Component);
|
|
120
117
|
_defineProperty(InputTreeSelect, "propTypes", PROPS);
|
|
121
118
|
export default InputTreeSelect;
|