cloud-b2b 1.1.57 → 1.1.59
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/package.json +44 -22
- package/src/Area/Area.js +94 -0
- package/src/Card/Card.js +16 -0
- package/src/CodeInput/CodeInput.js +76 -0
- package/src/Control/Control.js +338 -0
- package/src/Control/event.js +45 -0
- package/src/Enhance/Dialogs.js +24 -0
- package/src/Enhance/Loading.js +83 -0
- package/{es → src}/Enhance/index.js +8 -6
- package/src/Header/Header.js +149 -0
- package/src/Header/Vertical.js +74 -0
- package/src/ImageView/ImageView.js +62 -0
- package/src/Indent/Indent.js +12 -0
- package/src/InpurCascader/InputCascader.js +83 -0
- package/src/InputEditor/InputEditor.js +93 -0
- package/src/InputSearch/InputSearch.js +186 -0
- package/src/InputSelect/InputSelect.js +103 -0
- package/src/InputTreeSelect/InputTreeSelect.js +87 -0
- package/src/InputWriting/InputWriting.js +65 -0
- package/src/Layout/Layout.js +121 -0
- package/src/LayoutLink/LayoutLink.js +59 -0
- package/src/Link/Link.js +57 -0
- package/src/Loading/Loading.js +15 -0
- package/src/Loading2/Loading2.js +15 -0
- package/src/ModalWithDrag/ModalWithDrag.js +17 -0
- package/{es → src}/ModalWithDrag/drag.js +128 -116
- package/src/NumberInput/NumberInput.js +137 -0
- package/src/Search/Search.js +368 -0
- package/src/Search2/Search.js +436 -0
- package/{lib/Search → src/Search2}/Search.less +65 -63
- package/{lib/Search → src/Search2}/package.json +6 -6
- package/src/Sidebar/Sidebar.js +111 -0
- package/src/Sidebar2/Sidebar.js +143 -0
- package/src/SuperForm/SuperForm.js +519 -0
- package/src/SuperForm2/SuperForm.js +588 -0
- package/src/SuperIcon/SuperIcon.js +14 -0
- package/src/SuperPagination/SuperPagination.js +65 -0
- package/src/SuperTab/SuperTab.js +84 -0
- package/src/SuperTab2/SuperTab2.js +94 -0
- package/src/SuperTable/DragSortRow.js +62 -0
- package/src/SuperTable/FilterDropDown.js +111 -0
- package/src/SuperTable/SuperTable.js +590 -0
- package/src/SuperTable/fixed.js +34 -0
- package/src/SuperTable2/SuperTable2.js +624 -0
- package/src/SuperTable2/SuperTableCell.js +175 -0
- package/src/SuperTable3/FilterDropDown.js +111 -0
- package/src/SuperTable3/SuperTable.js +498 -0
- package/src/SuperTable3/fixed.js +34 -0
- package/src/SuperToolbar/SuperToolbar.js +128 -0
- package/src/SuperUpload/SuperUpload.js +137 -0
- package/src/Title/Title.js +18 -0
- package/src/Viewer/ImageViews.js +220 -0
- package/src/Viewer/Viewer.js +97 -0
- package/src/WingBlank/WingBlank.js +14 -0
- package/src/helper.js +185 -0
- package/{es → src}/history.js +6 -6
- package/src/index.js +39 -0
- package/src/variables.js +5 -0
- package/test/index.html +10 -0
- package/test/test.js +16 -0
- package/test/test.less +12 -0
- package/test/webpack.config.js +71 -0
- package/tools/babel.config.js +14 -0
- package/tools/build.js +70 -0
- package/tools/publish.js +9 -0
- package/tools/util.js +53 -0
- package/es/Area/Area.js +0 -138
- package/es/Card/Card.js +0 -19
- package/es/CodeInput/CodeInput.js +0 -120
- package/es/Control/Control.js +0 -444
- package/es/Control/event.js +0 -43
- package/es/Enhance/Dialogs.js +0 -49
- package/es/Enhance/Loading.js +0 -128
- package/es/Header/Header.js +0 -159
- package/es/Header/Vertical.js +0 -103
- package/es/ImageView/ImageView.js +0 -97
- package/es/Indent/Indent.js +0 -19
- package/es/InpurCascader/InputCascader.js +0 -114
- package/es/InputEditor/InputEditor.js +0 -171
- package/es/InputSearch/InputSearch.js +0 -263
- package/es/InputSelect/InputSelect.js +0 -157
- package/es/InputTreeSelect/InputTreeSelect.js +0 -118
- package/es/InputWriting/InputWriting.js +0 -82
- package/es/Layout/Layout.js +0 -198
- package/es/LayoutLink/LayoutLink.js +0 -73
- package/es/Link/Link.js +0 -82
- package/es/Loading/Loading.js +0 -13
- package/es/Loading2/Loading2.js +0 -9
- package/es/ModalWithDrag/ModalWithDrag.js +0 -29
- package/es/NumberInput/NumberInput.js +0 -197
- package/es/Search/Search.js +0 -494
- package/es/Sidebar/Sidebar.js +0 -141
- package/es/Sidebar2/Sidebar.js +0 -162
- package/es/SuperForm/SuperForm.js +0 -593
- package/es/SuperForm2/SuperForm.js +0 -682
- package/es/SuperIcon/SuperIcon.js +0 -27
- package/es/SuperPagination/SuperPagination.js +0 -106
- package/es/SuperTab/SuperTab.js +0 -104
- package/es/SuperTab2/SuperTab2.js +0 -142
- package/es/SuperTable/DragSortRow.js +0 -94
- package/es/SuperTable/FilterDropDown.js +0 -161
- package/es/SuperTable/SuperTable.js +0 -805
- package/es/SuperTable/fixed.js +0 -34
- package/es/SuperTable2/SuperTable2.js +0 -923
- package/es/SuperTable2/SuperTableCell.js +0 -215
- package/es/SuperTable3/FilterDropDown.js +0 -161
- package/es/SuperTable3/SuperTable.js +0 -662
- package/es/SuperTable3/fixed.js +0 -34
- package/es/SuperToolbar/SuperToolbar.js +0 -192
- package/es/SuperUpload/SuperUpload.js +0 -356
- package/es/Title/Title.js +0 -33
- package/es/Viewer/ImageViews.js +0 -255
- package/es/Viewer/Viewer.js +0 -119
- package/es/WingBlank/WingBlank.js +0 -16
- package/es/helper.js +0 -241
- package/es/index.js +0 -37
- package/es/variables.js +0 -6
- package/lib/Area/Area.js +0 -146
- package/lib/Area/package.json +0 -6
- package/lib/Card/Card.js +0 -27
- package/lib/Card/package.json +0 -6
- package/lib/CodeInput/CodeInput.js +0 -128
- package/lib/CodeInput/package.json +0 -6
- package/lib/Control/Control.js +0 -450
- package/lib/Control/event.js +0 -51
- package/lib/Control/package.json +0 -6
- package/lib/Enhance/Dialogs.js +0 -57
- package/lib/Enhance/Loading.js +0 -135
- package/lib/Enhance/index.js +0 -25
- package/lib/Enhance/package.json +0 -6
- package/lib/Header/Header.js +0 -166
- package/lib/Header/Header.less +0 -95
- package/lib/Header/Vertical.js +0 -111
- package/lib/Header/Vertical.less +0 -60
- package/lib/Header/package.json +0 -6
- package/lib/ImageView/ImageView.js +0 -105
- package/lib/ImageView/ImageView.less +0 -14
- package/lib/ImageView/package.json +0 -6
- package/lib/Indent/Indent.js +0 -27
- package/lib/Indent/package.json +0 -6
- package/lib/InpurCascader/InputCascader.js +0 -121
- package/lib/InpurCascader/package.json +0 -6
- package/lib/InputEditor/InputEditor.js +0 -179
- package/lib/InputEditor/inputEditor.less +0 -8
- package/lib/InputEditor/package.json +0 -6
- package/lib/InputSearch/InputSearch.js +0 -271
- package/lib/InputSearch/package.json +0 -6
- package/lib/InputSelect/InputSelect.js +0 -165
- package/lib/InputSelect/package.json +0 -6
- package/lib/InputTreeSelect/InputTreeSelect.js +0 -125
- package/lib/InputTreeSelect/package.json +0 -6
- package/lib/InputWriting/InputWriting.js +0 -90
- package/lib/InputWriting/package.json +0 -6
- package/lib/Layout/Layout.js +0 -206
- package/lib/Layout/Layout.less +0 -28
- package/lib/Layout/package.json +0 -6
- package/lib/LayoutLink/LayoutLink.js +0 -85
- package/lib/LayoutLink/LayoutLink.less +0 -53
- package/lib/LayoutLink/package.json +0 -6
- package/lib/Link/Link.js +0 -90
- package/lib/Link/package.json +0 -6
- package/lib/Loading/Loading.js +0 -21
- package/lib/Loading/Loading.less +0 -13
- package/lib/Loading/package.json +0 -6
- package/lib/Loading2/Loading2.js +0 -17
- package/lib/Loading2/Loading2.less +0 -19
- package/lib/Loading2/package.json +0 -6
- package/lib/ModalWithDrag/ModalWithDrag.js +0 -37
- package/lib/ModalWithDrag/ModalWithDrag.less +0 -6
- package/lib/ModalWithDrag/drag.js +0 -124
- package/lib/ModalWithDrag/package.json +0 -6
- package/lib/NumberInput/NumberInput.js +0 -205
- package/lib/NumberInput/package.json +0 -6
- package/lib/Search/Search.js +0 -506
- package/lib/Sidebar/Sidebar.js +0 -149
- package/lib/Sidebar/Sidebar.less +0 -78
- package/lib/Sidebar/package.json +0 -6
- package/lib/Sidebar2/Sidebar.js +0 -170
- package/lib/Sidebar2/Sidebar.less +0 -153
- package/lib/Sidebar2/package.json +0 -6
- package/lib/SuperForm/SuperForm.js +0 -604
- package/lib/SuperForm/SuperForm.less +0 -52
- package/lib/SuperForm/package.json +0 -6
- package/lib/SuperForm2/SuperForm.js +0 -693
- package/lib/SuperForm2/SuperForm.less +0 -52
- package/lib/SuperForm2/package.json +0 -6
- package/lib/SuperIcon/SuperIcon.js +0 -35
- package/lib/SuperIcon/package.json +0 -6
- package/lib/SuperPagination/SuperPagination.js +0 -114
- package/lib/SuperPagination/package.json +0 -6
- package/lib/SuperTab/SuperTab.js +0 -112
- package/lib/SuperTab/SuperTab.less +0 -43
- package/lib/SuperTab/package.json +0 -6
- package/lib/SuperTab2/SuperTab2.js +0 -150
- package/lib/SuperTab2/SuperTab2.less +0 -18
- package/lib/SuperTab2/package.json +0 -6
- package/lib/SuperTable/DragSortRow.js +0 -102
- package/lib/SuperTable/DragSortRow.less +0 -17
- package/lib/SuperTable/FilterDropDown.js +0 -169
- package/lib/SuperTable/FilterDropDown.less +0 -30
- package/lib/SuperTable/SuperTable.js +0 -813
- package/lib/SuperTable/SuperTable.less +0 -132
- package/lib/SuperTable/fixed.js +0 -42
- package/lib/SuperTable/package.json +0 -6
- package/lib/SuperTable2/SuperTable2.js +0 -935
- package/lib/SuperTable2/SuperTable2.less +0 -118
- package/lib/SuperTable2/SuperTableCell.js +0 -220
- package/lib/SuperTable2/package.json +0 -6
- package/lib/SuperTable3/FilterDropDown.js +0 -169
- package/lib/SuperTable3/FilterDropDown.less +0 -29
- package/lib/SuperTable3/SuperTable.js +0 -670
- package/lib/SuperTable3/SuperTable.less +0 -99
- package/lib/SuperTable3/fixed.js +0 -42
- package/lib/SuperTable3/package.json +0 -6
- package/lib/SuperToolbar/SuperToolbar.js +0 -200
- package/lib/SuperToolbar/SuperToolbar.less +0 -17
- package/lib/SuperToolbar/package.json +0 -6
- package/lib/SuperUpload/SuperUpload.js +0 -367
- package/lib/SuperUpload/SuperUpload.less +0 -28
- package/lib/SuperUpload/package.json +0 -6
- package/lib/Title/Title.js +0 -41
- package/lib/Title/Title.less +0 -35
- package/lib/Title/package.json +0 -6
- package/lib/Viewer/ImageViews.js +0 -263
- package/lib/Viewer/Viewer.js +0 -127
- package/lib/Viewer/Viewer.less +0 -67
- package/lib/Viewer/imgView.less +0 -59
- package/lib/Viewer/package.json +0 -7
- package/lib/WingBlank/WingBlank.js +0 -24
- package/lib/WingBlank/WingBlank.less +0 -12
- package/lib/WingBlank/package.json +0 -6
- package/lib/adjust.less +0 -89
- package/lib/helper.js +0 -247
- package/lib/history.js +0 -12
- package/lib/index.js +0 -271
- package/lib/index.less +0 -31
- package/lib/style.less +0 -30
- package/lib/variables.js +0 -14
- package/lib/variables.less +0 -73
- /package/{es → src}/Area/package.json +0 -0
- /package/{es → src}/Card/package.json +0 -0
- /package/{es → src}/CodeInput/package.json +0 -0
- /package/{es → src}/Control/package.json +0 -0
- /package/{es → src}/Enhance/package.json +0 -0
- /package/{es → src}/Header/Header.less +0 -0
- /package/{es → src}/Header/Vertical.less +0 -0
- /package/{es → src}/Header/package.json +0 -0
- /package/{es → src}/ImageView/ImageView.less +0 -0
- /package/{es → src}/ImageView/package.json +0 -0
- /package/{es → src}/Indent/package.json +0 -0
- /package/{es → src}/InpurCascader/package.json +0 -0
- /package/{es → src}/InputEditor/inputEditor.less +0 -0
- /package/{es → src}/InputEditor/package.json +0 -0
- /package/{es → src}/InputSearch/package.json +0 -0
- /package/{es → src}/InputSelect/package.json +0 -0
- /package/{es → src}/InputTreeSelect/package.json +0 -0
- /package/{es → src}/InputWriting/package.json +0 -0
- /package/{es → src}/Layout/Layout.less +0 -0
- /package/{es → src}/Layout/package.json +0 -0
- /package/{es → src}/LayoutLink/LayoutLink.less +0 -0
- /package/{es → src}/LayoutLink/package.json +0 -0
- /package/{es → src}/Link/package.json +0 -0
- /package/{es → src}/Loading/Loading.less +0 -0
- /package/{es → src}/Loading/package.json +0 -0
- /package/{es → src}/Loading2/Loading2.less +0 -0
- /package/{es → src}/Loading2/package.json +0 -0
- /package/{es → src}/ModalWithDrag/ModalWithDrag.less +0 -0
- /package/{es → src}/ModalWithDrag/package.json +0 -0
- /package/{es → src}/NumberInput/package.json +0 -0
- /package/{es → src}/Search/Search.less +0 -0
- /package/{es → src}/Search/package.json +0 -0
- /package/{es → src}/Sidebar/Sidebar.less +0 -0
- /package/{es → src}/Sidebar/package.json +0 -0
- /package/{es → src}/Sidebar2/Sidebar.less +0 -0
- /package/{es → src}/Sidebar2/package.json +0 -0
- /package/{es → src}/SuperForm/SuperForm.less +0 -0
- /package/{es → src}/SuperForm/package.json +0 -0
- /package/{es → src}/SuperForm2/SuperForm.less +0 -0
- /package/{es → src}/SuperForm2/package.json +0 -0
- /package/{es → src}/SuperIcon/package.json +0 -0
- /package/{es → src}/SuperPagination/package.json +0 -0
- /package/{es → src}/SuperTab/SuperTab.less +0 -0
- /package/{es → src}/SuperTab/package.json +0 -0
- /package/{es → src}/SuperTab2/SuperTab2.less +0 -0
- /package/{es → src}/SuperTab2/package.json +0 -0
- /package/{es → src}/SuperTable/DragSortRow.less +0 -0
- /package/{es → src}/SuperTable/FilterDropDown.less +0 -0
- /package/{es → src}/SuperTable/SuperTable.less +0 -0
- /package/{es → src}/SuperTable/package.json +0 -0
- /package/{es → src}/SuperTable2/SuperTable2.less +0 -0
- /package/{es → src}/SuperTable2/package.json +0 -0
- /package/{es → src}/SuperTable3/FilterDropDown.less +0 -0
- /package/{es → src}/SuperTable3/SuperTable.less +0 -0
- /package/{es → src}/SuperTable3/package.json +0 -0
- /package/{es → src}/SuperToolbar/SuperToolbar.less +0 -0
- /package/{es → src}/SuperToolbar/package.json +0 -0
- /package/{es → src}/SuperUpload/SuperUpload.less +0 -0
- /package/{es → src}/SuperUpload/package.json +0 -0
- /package/{es → src}/Title/Title.less +0 -0
- /package/{es → src}/Title/package.json +0 -0
- /package/{es → src}/Viewer/Viewer.less +0 -0
- /package/{es → src}/Viewer/imgView.less +0 -0
- /package/{es → src}/Viewer/package.json +0 -0
- /package/{es → src}/WingBlank/WingBlank.less +0 -0
- /package/{es → src}/WingBlank/package.json +0 -0
- /package/{es → src}/adjust.less +0 -0
- /package/{es → src}/style.less +0 -0
- /package/{es → src}/variables.less +0 -0
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
-
import _Input from "antd/es/input";
|
|
3
|
-
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
4
|
-
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
5
|
-
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
8
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
9
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
10
|
-
import _Icon from "antd/es/icon";
|
|
11
|
-
import _AutoComplete from "antd/es/auto-complete";
|
|
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; })(); }
|
|
14
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
15
|
-
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
|
16
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
17
|
-
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
18
|
-
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
|
19
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
20
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
21
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
22
|
-
import React from 'react';
|
|
23
|
-
import PropTypes from 'prop-types';
|
|
24
|
-
import { getObjectExclude } from '../helper';
|
|
25
|
-
var SelectOption = _AutoComplete.Option;
|
|
26
|
-
|
|
27
|
-
// 如果写在局部,每次渲染时生成的suffix引用值不同,会使antd的Input认为suffix动态变化了,从而导致Input报出警告 (antd的BUG)
|
|
28
|
-
var suffix = /*#__PURE__*/React.createElement(_Icon, {
|
|
29
|
-
type: "search",
|
|
30
|
-
style: {
|
|
31
|
-
color: 'black',
|
|
32
|
-
opacity: 0.25,
|
|
33
|
-
marginRight: -4
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
var OPTION_STYLE = {
|
|
37
|
-
"float": 'right',
|
|
38
|
-
marginLeft: '1rem',
|
|
39
|
-
color: '#aaa',
|
|
40
|
-
whiteSpace: 'pre-wrap'
|
|
41
|
-
};
|
|
42
|
-
var OPTION_STYLE2 = {
|
|
43
|
-
display: 'block',
|
|
44
|
-
color: '#aaa',
|
|
45
|
-
whiteSpace: 'pre-wrap'
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* filter: 为true表示下拉列表会依据输入的值进行前端过滤,默认为true; 如果不想过滤,则设为false
|
|
50
|
-
* remark: 为true表示options的option中含有remark字段,并需要用remark值进行过滤下拉,默认为false
|
|
51
|
-
* searchWhenClick: 每次点击时,触发onSearch事件,默认为false
|
|
52
|
-
* noSearchWhenTypo: 当输入时,不触发onSearch事件,默认为false
|
|
53
|
-
*/
|
|
54
|
-
var PROPS = {
|
|
55
|
-
filter: PropTypes.bool,
|
|
56
|
-
remark: PropTypes.bool,
|
|
57
|
-
searchWhenClick: PropTypes.bool,
|
|
58
|
-
noSearchWhenTypo: PropTypes.bool,
|
|
59
|
-
options: PropTypes.array,
|
|
60
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]),
|
|
61
|
-
inputRef: PropTypes.func,
|
|
62
|
-
onChange: PropTypes.func,
|
|
63
|
-
onBlur: PropTypes.func,
|
|
64
|
-
onSelect: PropTypes.func,
|
|
65
|
-
onSearch: PropTypes.func
|
|
66
|
-
};
|
|
67
|
-
var PROPS_KEYS = _Object$keys(PROPS);
|
|
68
|
-
var InputSearch = /*#__PURE__*/function (_React$Component) {
|
|
69
|
-
function InputSearch(_props) {
|
|
70
|
-
var _this;
|
|
71
|
-
_classCallCheck(this, InputSearch);
|
|
72
|
-
_this = _callSuper(this, InputSearch, [_props]);
|
|
73
|
-
_defineProperty(_this, "onSearch", function (value) {
|
|
74
|
-
_this.setState({
|
|
75
|
-
value: value
|
|
76
|
-
});
|
|
77
|
-
var _this$props = _this.props,
|
|
78
|
-
onSearch = _this$props.onSearch,
|
|
79
|
-
noSearchWhenTypo = _this$props.noSearchWhenTypo;
|
|
80
|
-
!noSearchWhenTypo && onSearch && onSearch(value);
|
|
81
|
-
});
|
|
82
|
-
_defineProperty(_this, "onBlur", function () {
|
|
83
|
-
var _this$props2 = _this.props,
|
|
84
|
-
_this$props2$autoAdd = _this$props2.autoAdd,
|
|
85
|
-
autoAdd = _this$props2$autoAdd === void 0 ? false : _this$props2$autoAdd,
|
|
86
|
-
_this$props2$options = _this$props2.options,
|
|
87
|
-
options = _this$props2$options === void 0 ? [] : _this$props2$options,
|
|
88
|
-
onChange = _this$props2.onChange,
|
|
89
|
-
onBlur = _this$props2.onBlur;
|
|
90
|
-
if (_this.props.value !== _this.state.value) {
|
|
91
|
-
var index = _findIndexInstanceProperty(options).call(options, function (option) {
|
|
92
|
-
return option.title === _this.state.value;
|
|
93
|
-
});
|
|
94
|
-
var value = '';
|
|
95
|
-
if (index === -1) {
|
|
96
|
-
if (autoAdd && _this.state.value) {
|
|
97
|
-
if (typeof _this.state.value === 'string') {
|
|
98
|
-
value = {
|
|
99
|
-
value: -1,
|
|
100
|
-
title: _this.state.value
|
|
101
|
-
};
|
|
102
|
-
} else if (_typeof(_this.state.value) === 'object' && _this.state.value.title && _this.state.value.value) {
|
|
103
|
-
value = _this.state.value;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
} else {
|
|
107
|
-
value = options[index];
|
|
108
|
-
}
|
|
109
|
-
_this.setState({
|
|
110
|
-
value: value
|
|
111
|
-
});
|
|
112
|
-
onChange && onChange(value);
|
|
113
|
-
onBlur && onBlur(value);
|
|
114
|
-
} else {
|
|
115
|
-
onBlur && onBlur(_this.props.value);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
_defineProperty(_this, "onSelect", function (value) {
|
|
119
|
-
var _this$props3 = _this.props,
|
|
120
|
-
onChange = _this$props3.onChange,
|
|
121
|
-
_this$props3$options = _this$props3.options,
|
|
122
|
-
options = _this$props3$options === void 0 ? [] : _this$props3$options;
|
|
123
|
-
var index = _findIndexInstanceProperty(options).call(options, function (option) {
|
|
124
|
-
return String(option.value) === value;
|
|
125
|
-
});
|
|
126
|
-
if (index > -1) {
|
|
127
|
-
_this.setState({
|
|
128
|
-
value: options[index]
|
|
129
|
-
});
|
|
130
|
-
onChange && onChange(options[index]);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
_defineProperty(_this, "onClick", function (e) {
|
|
134
|
-
var _this$props4 = _this.props,
|
|
135
|
-
_this$props4$options = _this$props4.options,
|
|
136
|
-
options = _this$props4$options === void 0 ? [] : _this$props4$options,
|
|
137
|
-
onSearch = _this$props4.onSearch,
|
|
138
|
-
searchWhenClick = _this$props4.searchWhenClick,
|
|
139
|
-
value = _this$props4.value;
|
|
140
|
-
if (onSearch && (!options.length || !value && searchWhenClick)) {
|
|
141
|
-
onSearch(e.target.value);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
_defineProperty(_this, "makeValueValid", function (value) {
|
|
145
|
-
var _context;
|
|
146
|
-
return _includesInstanceProperty(_context = [NaN, undefined, null]).call(_context, value) ? '' : value;
|
|
147
|
-
});
|
|
148
|
-
_defineProperty(_this, "getValue", function () {
|
|
149
|
-
var value = _this.state.value;
|
|
150
|
-
return String(_this.makeValueValid(_typeof(value) === 'object' ? value.value : value));
|
|
151
|
-
});
|
|
152
|
-
_defineProperty(_this, "isMatch", function (inputValue, option) {
|
|
153
|
-
var _context2;
|
|
154
|
-
return option.props.children && _indexOfInstanceProperty(_context2 = option.props.children).call(_context2, inputValue) !== -1;
|
|
155
|
-
});
|
|
156
|
-
_defineProperty(_this, "isMatchRemark", function (inputValue, option) {
|
|
157
|
-
var _option$props = option.props,
|
|
158
|
-
_option$props$text = _option$props.text,
|
|
159
|
-
text = _option$props$text === void 0 ? '' : _option$props$text,
|
|
160
|
-
_option$props$remark = _option$props.remark,
|
|
161
|
-
remark = _option$props$remark === void 0 ? '' : _option$props$remark;
|
|
162
|
-
return _indexOfInstanceProperty(text).call(text, inputValue) > -1 || _indexOfInstanceProperty(remark).call(remark, inputValue) > -1;
|
|
163
|
-
});
|
|
164
|
-
_defineProperty(_this, "isValidValue", function (value) {
|
|
165
|
-
var _context3;
|
|
166
|
-
// value必须为对象,且有属性value的值不等''或undefined
|
|
167
|
-
return value && !_includesInstanceProperty(_context3 = ['', undefined]).call(_context3, value.value);
|
|
168
|
-
});
|
|
169
|
-
_defineProperty(_this, "getOptions", function () {
|
|
170
|
-
var value = _this.state.value;
|
|
171
|
-
var options = _this.props.options;
|
|
172
|
-
if (options && options.length) {
|
|
173
|
-
if (_this.isValidValue(value) && !_findInstanceProperty(options).call(options, function (option) {
|
|
174
|
-
return option.value === value.value;
|
|
175
|
-
})) {
|
|
176
|
-
return [value];
|
|
177
|
-
} else {
|
|
178
|
-
return options;
|
|
179
|
-
}
|
|
180
|
-
} else if (_this.isValidValue(value)) {
|
|
181
|
-
return [value];
|
|
182
|
-
} else {
|
|
183
|
-
return [];
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
_defineProperty(_this, "getDataSource", function () {
|
|
187
|
-
var _context4;
|
|
188
|
-
return _mapInstanceProperty(_context4 = _this.getOptions()).call(_context4, function (option) {
|
|
189
|
-
return {
|
|
190
|
-
value: String(option.value),
|
|
191
|
-
text: option.title
|
|
192
|
-
};
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
_defineProperty(_this, "getDataSourceRemark", function () {
|
|
196
|
-
var _context5;
|
|
197
|
-
return _mapInstanceProperty(_context5 = _this.getOptions()).call(_context5, function (option, index) {
|
|
198
|
-
return /*#__PURE__*/React.createElement(SelectOption, {
|
|
199
|
-
key: index,
|
|
200
|
-
value: String(option.value),
|
|
201
|
-
text: option.title,
|
|
202
|
-
remark: option.remark || ''
|
|
203
|
-
}, /*#__PURE__*/React.createElement("span", null, option.title), /*#__PURE__*/React.createElement("span", {
|
|
204
|
-
style: OPTION_STYLE
|
|
205
|
-
}, option.remark || ''), /*#__PURE__*/React.createElement("span", {
|
|
206
|
-
style: OPTION_STYLE2
|
|
207
|
-
}, option.description || ''));
|
|
208
|
-
});
|
|
209
|
-
});
|
|
210
|
-
_defineProperty(_this, "getProps", function () {
|
|
211
|
-
var _this$props5 = _this.props,
|
|
212
|
-
inputRef = _this$props5.inputRef,
|
|
213
|
-
_this$props5$filter = _filterInstanceProperty(_this$props5),
|
|
214
|
-
filter = _this$props5$filter === void 0 ? true : _this$props5$filter;
|
|
215
|
-
var props = _Object$assign(getObjectExclude(_this.props, PROPS_KEYS), {
|
|
216
|
-
value: _this.getValue(),
|
|
217
|
-
allowClear: true,
|
|
218
|
-
ref: inputRef,
|
|
219
|
-
onChange: _this.onSearch,
|
|
220
|
-
filterOption: function filterOption(e, option) {
|
|
221
|
-
return option;
|
|
222
|
-
},
|
|
223
|
-
onSelect: _this.onSelect,
|
|
224
|
-
onBlur: _this.onBlur
|
|
225
|
-
});
|
|
226
|
-
if (_this.props.remark) {
|
|
227
|
-
props.dataSource = _this.getDataSourceRemark();
|
|
228
|
-
props.filterOption = filter ? _this.isMatchRemark : false;
|
|
229
|
-
props.optionLabelProp = 'text';
|
|
230
|
-
} else {
|
|
231
|
-
props.dataSource = _this.getDataSource();
|
|
232
|
-
props.filterOption = filter ? _this.isMatch : false;
|
|
233
|
-
}
|
|
234
|
-
return props;
|
|
235
|
-
});
|
|
236
|
-
_this.state = {
|
|
237
|
-
value: _props.value
|
|
238
|
-
};
|
|
239
|
-
return _this;
|
|
240
|
-
}
|
|
241
|
-
_inherits(InputSearch, _React$Component);
|
|
242
|
-
return _createClass(InputSearch, [{
|
|
243
|
-
key: "componentWillReceiveProps",
|
|
244
|
-
value: function componentWillReceiveProps(props) {
|
|
245
|
-
if (props.value !== this.props.value) {
|
|
246
|
-
this.setState({
|
|
247
|
-
value: props.value
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}, {
|
|
252
|
-
key: "render",
|
|
253
|
-
value: function render() {
|
|
254
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
255
|
-
onClick: this.onClick
|
|
256
|
-
}, /*#__PURE__*/React.createElement(_AutoComplete, this.getProps(), /*#__PURE__*/React.createElement(_Input, {
|
|
257
|
-
suffix: suffix
|
|
258
|
-
})));
|
|
259
|
-
}
|
|
260
|
-
}]);
|
|
261
|
-
}(React.Component);
|
|
262
|
-
_defineProperty(InputSearch, "propTypes", PROPS);
|
|
263
|
-
export default InputSearch;
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
3
|
-
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
4
|
-
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
5
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
6
|
-
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
7
|
-
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
8
|
-
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
|
-
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
10
|
-
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
11
|
-
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
12
|
-
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
13
|
-
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
14
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
15
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
16
|
-
import _Select from "antd/es/select";
|
|
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; }
|
|
18
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
20
|
-
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
21
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
22
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
23
|
-
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
24
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
25
|
-
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
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; })(); }
|
|
28
|
-
import React from 'react';
|
|
29
|
-
var SelectOption = _Select.Option;
|
|
30
|
-
var OPTION_STYLE = {
|
|
31
|
-
"float": 'right',
|
|
32
|
-
marginLeft: '1rem',
|
|
33
|
-
marginRight: '1rem',
|
|
34
|
-
color: '#aaa',
|
|
35
|
-
whiteSpace: 'pre-wrap'
|
|
36
|
-
};
|
|
37
|
-
var InputSelect = /*#__PURE__*/function (_React$Component) {
|
|
38
|
-
function InputSelect() {
|
|
39
|
-
var _context;
|
|
40
|
-
var _this;
|
|
41
|
-
_classCallCheck(this, InputSelect);
|
|
42
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
|
-
args[_key] = arguments[_key];
|
|
44
|
-
}
|
|
45
|
-
_this = _callSuper(this, InputSelect, _concatInstanceProperty(_context = []).call(_context, args));
|
|
46
|
-
_defineProperty(_this, "onClick", function (e) {
|
|
47
|
-
var _this$props = _this.props,
|
|
48
|
-
_this$props$options = _this$props.options,
|
|
49
|
-
options = _this$props$options === void 0 ? [] : _this$props$options,
|
|
50
|
-
onSearch = _this$props.onSearch,
|
|
51
|
-
_this$props$value = _this$props.value,
|
|
52
|
-
value = _this$props$value === void 0 ? [] : _this$props$value,
|
|
53
|
-
_this$props$searchWhe = _this$props.searchWhenClick,
|
|
54
|
-
searchWhenClick = _this$props$searchWhe === void 0 ? false : _this$props$searchWhe;
|
|
55
|
-
// if (onSearch && (options.length <= value.length)) {
|
|
56
|
-
if (onSearch && searchWhenClick) {
|
|
57
|
-
onSearch(e.target.value);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
_defineProperty(_this, "onSearch", function (value) {
|
|
61
|
-
var onSearch = _this.props.onSearch;
|
|
62
|
-
onSearch && onSearch(value);
|
|
63
|
-
});
|
|
64
|
-
_defineProperty(_this, "isMatch", function (inputValue, option) {
|
|
65
|
-
var _context2;
|
|
66
|
-
return _indexOfInstanceProperty(_context2 = option.props.children).call(_context2, inputValue) !== -1;
|
|
67
|
-
});
|
|
68
|
-
_defineProperty(_this, "isMatchRemark", function (inputValue, option) {
|
|
69
|
-
var _option$props = option.props,
|
|
70
|
-
text = _option$props.text,
|
|
71
|
-
remark = _option$props.remark;
|
|
72
|
-
return _indexOfInstanceProperty(text).call(text, inputValue) > -1 || _indexOfInstanceProperty(remark).call(remark, inputValue) > -1;
|
|
73
|
-
});
|
|
74
|
-
_defineProperty(_this, "toRemarkOption", function (option, index) {
|
|
75
|
-
return /*#__PURE__*/React.createElement(SelectOption, {
|
|
76
|
-
key: index,
|
|
77
|
-
value: String(option.value),
|
|
78
|
-
text: option.title,
|
|
79
|
-
remark: option.remark || '',
|
|
80
|
-
disabled: option.disabled || false
|
|
81
|
-
}, /*#__PURE__*/React.createElement("span", null, option.title), /*#__PURE__*/React.createElement("span", {
|
|
82
|
-
style: OPTION_STYLE
|
|
83
|
-
}, option.remark || ''));
|
|
84
|
-
});
|
|
85
|
-
_defineProperty(_this, "toOption", function (option, index) {
|
|
86
|
-
return /*#__PURE__*/React.createElement(SelectOption, {
|
|
87
|
-
key: index,
|
|
88
|
-
value: String(option.value),
|
|
89
|
-
disabled: option.disabled || false
|
|
90
|
-
}, option.title);
|
|
91
|
-
});
|
|
92
|
-
_defineProperty(_this, "onChange", function (options, keyValue) {
|
|
93
|
-
var onChange = _this.props.onChange;
|
|
94
|
-
var objValue = keyValue.length > 0 ? _mapInstanceProperty(keyValue).call(keyValue, function (item) {
|
|
95
|
-
return _objectSpread(_objectSpread({}, _filterInstanceProperty(options).call(options, function (o) {
|
|
96
|
-
return o.value === item.key;
|
|
97
|
-
})[0]), {}, {
|
|
98
|
-
value: item.key,
|
|
99
|
-
title: item.label
|
|
100
|
-
});
|
|
101
|
-
}) : [];
|
|
102
|
-
onChange && onChange(objValue);
|
|
103
|
-
});
|
|
104
|
-
_defineProperty(_this, "getValue", function () {
|
|
105
|
-
var value = _this.props.value;
|
|
106
|
-
if (_typeof(value) === 'object' && _Array$isArray(value)) {
|
|
107
|
-
return _mapInstanceProperty(value).call(value, function (item) {
|
|
108
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
109
|
-
key: item.value,
|
|
110
|
-
label: item.title
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
} else {
|
|
114
|
-
return [];
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
return _this;
|
|
118
|
-
}
|
|
119
|
-
_inherits(InputSelect, _React$Component);
|
|
120
|
-
return _createClass(InputSelect, [{
|
|
121
|
-
key: "render",
|
|
122
|
-
value: function render() {
|
|
123
|
-
var _context3, _context4;
|
|
124
|
-
var _this$props2 = this.props,
|
|
125
|
-
_this$props2$options = _this$props2.options,
|
|
126
|
-
options = _this$props2$options === void 0 ? [] : _this$props2$options,
|
|
127
|
-
size = _this$props2.size,
|
|
128
|
-
_this$props2$value = _this$props2.value,
|
|
129
|
-
value = _this$props2$value === void 0 ? [] : _this$props2$value,
|
|
130
|
-
_this$props2$allowCle = _this$props2.allowClear,
|
|
131
|
-
allowClear = _this$props2$allowCle === void 0 ? true : _this$props2$allowCle;
|
|
132
|
-
var values = _mapInstanceProperty(value).call(value, function (o) {
|
|
133
|
-
return o.value;
|
|
134
|
-
});
|
|
135
|
-
var allOptions = _concatInstanceProperty(_context3 = _filterInstanceProperty(options).call(options, function (o) {
|
|
136
|
-
return !_includesInstanceProperty(values).call(values, o.value);
|
|
137
|
-
})).call(_context3, value);
|
|
138
|
-
var props = {
|
|
139
|
-
value: this.getValue(),
|
|
140
|
-
style: this.props.style || {},
|
|
141
|
-
mode: 'multiple',
|
|
142
|
-
optionLabelProp: this.props.remark ? 'text' : 'children',
|
|
143
|
-
dropdownMatchSelectWidth: false,
|
|
144
|
-
filterOption: this.props.remark ? this.isMatchRemark : this.isMatch,
|
|
145
|
-
onSearch: this.onSearch,
|
|
146
|
-
onChange: _bindInstanceProperty(_context4 = this.onChange).call(_context4, this, allOptions),
|
|
147
|
-
labelInValue: true,
|
|
148
|
-
allowClear: allowClear,
|
|
149
|
-
size: size
|
|
150
|
-
};
|
|
151
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
152
|
-
onClick: this.onClick
|
|
153
|
-
}, /*#__PURE__*/React.createElement(_Select, props, this.props.remark ? _mapInstanceProperty(allOptions).call(allOptions, this.toRemarkOption) : _mapInstanceProperty(allOptions).call(allOptions, this.toOption)));
|
|
154
|
-
}
|
|
155
|
-
}]);
|
|
156
|
-
}(React.Component);
|
|
157
|
-
export default InputSelect;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
-
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
3
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
4
|
-
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
5
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
6
|
-
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
7
|
-
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
8
|
-
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
|
-
import _TreeSelect from "antd/es/tree-select";
|
|
10
|
-
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
11
|
-
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
12
|
-
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
13
|
-
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
14
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
15
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
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; }
|
|
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; }
|
|
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; })(); }
|
|
20
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
21
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
22
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
23
|
-
//级联选择input
|
|
24
|
-
import React from 'react';
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { getObjectExclude } from '../helper';
|
|
27
|
-
var optionsType = {
|
|
28
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
29
|
-
key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
30
|
-
disabled: PropTypes.bool,
|
|
31
|
-
children: PropTypes.array,
|
|
32
|
-
title: PropTypes.string,
|
|
33
|
-
isLeaf: PropTypes.bool //false 就会触发 loadData 方法,从而在loadData方法中请求下一级数据,
|
|
34
|
-
};
|
|
35
|
-
var PROPS = {
|
|
36
|
-
options: PropTypes.arrayOf(PropTypes.shape(optionsType)).isRequired,
|
|
37
|
-
value: PropTypes.array.isRequired,
|
|
38
|
-
placeholder: PropTypes.string,
|
|
39
|
-
onChange: PropTypes.func,
|
|
40
|
-
loadData: PropTypes.func,
|
|
41
|
-
//动态加载 ps:loadData 与 showSearch 无法一起使用
|
|
42
|
-
showSearch: PropTypes.bool,
|
|
43
|
-
onTreeExpand: PropTypes.func,
|
|
44
|
-
treeDefaultExpandAll: PropTypes.bool,
|
|
45
|
-
treeDataSimpleMode: PropTypes.bool,
|
|
46
|
-
multiple: PropTypes.bool
|
|
47
|
-
};
|
|
48
|
-
var PROPS_KEYS = _Object$keys(PROPS);
|
|
49
|
-
var InputTreeSelect = /*#__PURE__*/function (_React$Component) {
|
|
50
|
-
function InputTreeSelect(_props) {
|
|
51
|
-
var _this;
|
|
52
|
-
_classCallCheck(this, InputTreeSelect);
|
|
53
|
-
_this = _callSuper(this, InputTreeSelect, [_props]);
|
|
54
|
-
_defineProperty(_this, "onChange", function (value) {
|
|
55
|
-
var onChange = _this.props.onChange;
|
|
56
|
-
onChange && onChange(value);
|
|
57
|
-
});
|
|
58
|
-
_defineProperty(_this, "loadData", function (selectedOptions) {
|
|
59
|
-
var onSearch = _this.props.onSearch;
|
|
60
|
-
onSearch && onSearch(selectedOptions[0]);
|
|
61
|
-
});
|
|
62
|
-
_defineProperty(_this, "getOptions", function (options) {
|
|
63
|
-
return _mapInstanceProperty(options).call(options, function (option) {
|
|
64
|
-
var obj = _objectSpread(_objectSpread({}, option), {}, {
|
|
65
|
-
label: option.title
|
|
66
|
-
});
|
|
67
|
-
if (option.children && option.children.length > 0) {
|
|
68
|
-
obj.children = _this.getOptions(option.children);
|
|
69
|
-
}
|
|
70
|
-
return obj;
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
_defineProperty(_this, "getProps", function () {
|
|
74
|
-
var _this$props = _this.props,
|
|
75
|
-
_this$props$options = _this$props.options,
|
|
76
|
-
options = _this$props$options === void 0 ? [] : _this$props$options,
|
|
77
|
-
placeholder = _this$props.placeholder,
|
|
78
|
-
size = _this$props.size,
|
|
79
|
-
value = _this$props.value,
|
|
80
|
-
loadData = _this$props.loadData,
|
|
81
|
-
_this$props$treeDefau = _this$props.treeDefaultExpandAll,
|
|
82
|
-
treeDefaultExpandAll = _this$props$treeDefau === void 0 ? false : _this$props$treeDefau,
|
|
83
|
-
_this$props$showSearc = _this$props.showSearch,
|
|
84
|
-
showSearch = _this$props$showSearc === void 0 ? false : _this$props$showSearc,
|
|
85
|
-
_this$props$treeDataS = _this$props.treeDataSimpleMode,
|
|
86
|
-
treeDataSimpleMode = _this$props$treeDataS === void 0 ? false : _this$props$treeDataS,
|
|
87
|
-
_this$props$multiple = _this$props.multiple,
|
|
88
|
-
multiple = _this$props$multiple === void 0 ? false : _this$props$multiple;
|
|
89
|
-
var props = _Object$assign(getObjectExclude({}, PROPS_KEYS), {
|
|
90
|
-
onChange: _this.onChange,
|
|
91
|
-
value: value,
|
|
92
|
-
treeData: options,
|
|
93
|
-
treeDataSimpleMode: treeDataSimpleMode,
|
|
94
|
-
placeholder: placeholder,
|
|
95
|
-
treeDefaultExpandAll: treeDefaultExpandAll,
|
|
96
|
-
multiple: multiple,
|
|
97
|
-
size: size
|
|
98
|
-
});
|
|
99
|
-
//动态加载 ps:loadData 与 showSearch 无法一起使用
|
|
100
|
-
if (loadData) {
|
|
101
|
-
props.loadData = _this.loadData;
|
|
102
|
-
} else if (showSearch) {
|
|
103
|
-
props.showSearch = showSearch;
|
|
104
|
-
}
|
|
105
|
-
return props;
|
|
106
|
-
});
|
|
107
|
-
return _this;
|
|
108
|
-
}
|
|
109
|
-
_inherits(InputTreeSelect, _React$Component);
|
|
110
|
-
return _createClass(InputTreeSelect, [{
|
|
111
|
-
key: "render",
|
|
112
|
-
value: function render() {
|
|
113
|
-
return /*#__PURE__*/React.createElement(_TreeSelect, this.getProps());
|
|
114
|
-
}
|
|
115
|
-
}]);
|
|
116
|
-
}(React.Component);
|
|
117
|
-
_defineProperty(InputTreeSelect, "propTypes", PROPS);
|
|
118
|
-
export default InputTreeSelect;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
-
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
4
|
-
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
5
|
-
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
6
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
7
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
8
|
-
import _Select from "antd/es/select";
|
|
9
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
10
|
-
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
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; })(); }
|
|
13
|
-
import React from 'react';
|
|
14
|
-
var Option = _Select.Option;
|
|
15
|
-
var InputWriting = /*#__PURE__*/function (_React$Component) {
|
|
16
|
-
function InputWriting() {
|
|
17
|
-
var _context;
|
|
18
|
-
var _this;
|
|
19
|
-
_classCallCheck(this, InputWriting);
|
|
20
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
|
-
args[_key] = arguments[_key];
|
|
22
|
-
}
|
|
23
|
-
_this = _callSuper(this, InputWriting, _concatInstanceProperty(_context = []).call(_context, args));
|
|
24
|
-
_defineProperty(_this, "state", {
|
|
25
|
-
options: [],
|
|
26
|
-
value: [],
|
|
27
|
-
fetching: false
|
|
28
|
-
});
|
|
29
|
-
_defineProperty(_this, "onClick", function (e) {
|
|
30
|
-
var _this$props = _this.props,
|
|
31
|
-
_this$props$options = _this$props.options,
|
|
32
|
-
options = _this$props$options === void 0 ? [] : _this$props$options,
|
|
33
|
-
onSearch = _this$props.onSearch,
|
|
34
|
-
value = _this$props.value;
|
|
35
|
-
if (onSearch && !options.length) {
|
|
36
|
-
onSearch(e.target.value);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
_defineProperty(_this, "onSearch", function (value) {
|
|
40
|
-
var onSearch = _this.props.onSearch;
|
|
41
|
-
onSearch && onSearch(value);
|
|
42
|
-
});
|
|
43
|
-
_defineProperty(_this, "isMatch", function (inputValue, option) {
|
|
44
|
-
var _context2;
|
|
45
|
-
return _indexOfInstanceProperty(_context2 = option.props.children).call(_context2, inputValue) !== -1;
|
|
46
|
-
});
|
|
47
|
-
_defineProperty(_this, "toOption", function (option, index) {
|
|
48
|
-
return /*#__PURE__*/React.createElement(SelectOption, {
|
|
49
|
-
key: index,
|
|
50
|
-
value: String(option.value)
|
|
51
|
-
}, option.title);
|
|
52
|
-
});
|
|
53
|
-
_defineProperty(_this, "onChange", function (keyValue) {
|
|
54
|
-
var _this$props2 = _this.props,
|
|
55
|
-
onChange = _this$props2.onChange,
|
|
56
|
-
value = _this$props2.value;
|
|
57
|
-
onChange && onChange(keyValue);
|
|
58
|
-
});
|
|
59
|
-
return _this;
|
|
60
|
-
}
|
|
61
|
-
_inherits(InputWriting, _React$Component);
|
|
62
|
-
return _createClass(InputWriting, [{
|
|
63
|
-
key: "render",
|
|
64
|
-
value: function render() {
|
|
65
|
-
var value = this.props.value;
|
|
66
|
-
var props = {
|
|
67
|
-
value: value,
|
|
68
|
-
size: 'small',
|
|
69
|
-
mode: 'tags',
|
|
70
|
-
allowClear: true,
|
|
71
|
-
onSelect: this.onSelect,
|
|
72
|
-
filterOption: this.isMatch,
|
|
73
|
-
dropdownMatchSelectWidth: false,
|
|
74
|
-
onChange: this.onChange
|
|
75
|
-
};
|
|
76
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
77
|
-
onClick: this.onClick
|
|
78
|
-
}, /*#__PURE__*/React.createElement(_Select, props));
|
|
79
|
-
}
|
|
80
|
-
}]);
|
|
81
|
-
}(React.Component);
|
|
82
|
-
export default InputWriting;
|