tntd 1.4.20 → 1.4.22
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/components/Handle/README.md +0 -20
- package/components/Handle/index.js +44 -7
- package/components/locale.js +8 -2
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24430 -24390
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +13 -8
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +108 -76
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +38 -31
- package/es/DevelopmentLogin/LoginModal.js +45 -32
- package/es/DevelopmentLogin/index.js +17 -13
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +69 -58
- package/es/Handle/README.md +0 -20
- package/es/Handle/index.js +100 -33
- package/es/Icon/fonts/iconfont.js +12 -7
- package/es/Icon/index.js +13 -10
- package/es/Img/Contain.js +29 -24
- package/es/Img/Cover.js +54 -40
- package/es/Img/index.js +45 -36
- package/es/Layout/ActionsContext.js +2 -3
- package/es/Layout/AppList.js +92 -37
- package/es/Layout/Application.js +72 -26
- package/es/Layout/Avatar.js +66 -29
- package/es/Layout/CompatibleLanguage.js +94 -39
- package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
- package/es/Layout/EnterpriseLayout/Language.js +32 -14
- package/es/Layout/EnterpriseLayout/Theme.js +34 -16
- package/es/Layout/EnterpriseLayout/index.js +16 -14
- package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
- package/es/Layout/GlobalNavigation/index.js +54 -20
- package/es/Layout/Header.js +46 -25
- package/es/Layout/HeaderActions.js +56 -42
- package/es/Layout/HeaderNavs.js +47 -20
- package/es/Layout/HeaderTabs.js +102 -49
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +32 -14
- package/es/Layout/Layout.js +108 -86
- package/es/Layout/Logo.js +32 -16
- package/es/Layout/OrgAppList.js +107 -62
- package/es/Layout/SideMenu.js +124 -63
- package/es/Layout/Theme.js +61 -23
- package/es/Layout/checkAuth.js +29 -0
- package/es/Layout/index.js +34 -26
- package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
- package/es/Layout/paaslayout/Header.js +45 -22
- package/es/Layout/paaslayout/Logo.js +13 -3
- package/es/Layout/paaslayout/SideMenu.js +78 -39
- package/es/Layout/paaslayout/index.js +102 -75
- package/es/Layout/storage.js +9 -10
- package/es/Layout/utils.js +136 -0
- package/es/LoadingButton/index.js +24 -15
- package/es/Modal/index.js +46 -38
- package/es/Page/Box.js +41 -34
- package/es/Page/index.js +67 -52
- package/es/Page/utils.js +5 -0
- package/es/QueryForm/Field/Checkbox.js +9 -5
- package/es/QueryForm/Field/Select.js +41 -31
- package/es/QueryForm/Field/SelectInput.js +41 -26
- package/es/QueryForm/Field/fieldsMap.js +1 -0
- package/es/QueryForm/Field/index.js +71 -41
- package/es/QueryForm/createActions.js +7 -6
- package/es/QueryForm/index.js +135 -76
- package/es/QueryListScene/List.js +128 -74
- package/es/QueryListScene/QueryForm.js +81 -46
- package/es/QueryListScene/QueryListScene.js +40 -25
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +12 -11
- package/es/Select/DropDownWrap.js +50 -29
- package/es/Select/index.js +231 -135
- package/es/Table/ResizableTable/index.js +40 -26
- package/es/Table/index.js +16 -18
- package/es/Title/index.js +23 -21
- package/es/locale.js +11 -3
- package/es/utils/checkAuth.js +5 -3
- package/es/utils/findMenuInfoByPath.js +4 -0
- package/es/utils/index.js +23 -12
- package/lib/ArrayInput/icon.js +6 -6
- package/lib/ArrayInput/index.js +127 -78
- package/lib/AuthContext.js +4 -1
- package/lib/Columns/index.js +47 -31
- package/lib/DevelopmentLogin/LoginModal.js +58 -32
- package/lib/DevelopmentLogin/index.js +27 -16
- package/lib/Ellipsis/Svg/CopySVG.js +15 -13
- package/lib/Ellipsis/Svg/TickSVG.js +10 -8
- package/lib/Ellipsis/index.js +80 -57
- package/lib/Handle/README.md +0 -20
- package/lib/Handle/index.js +119 -33
- package/lib/Icon/fonts/iconfont.js +12 -7
- package/lib/Icon/index.js +20 -11
- package/lib/Img/Contain.js +34 -24
- package/lib/Img/Cover.js +65 -42
- package/lib/Img/index.js +51 -36
- package/lib/Layout/ActionsContext.js +4 -1
- package/lib/Layout/AppList.js +118 -40
- package/lib/Layout/Application.js +86 -26
- package/lib/Layout/Avatar.js +86 -32
- package/lib/Layout/CompatibleLanguage.js +110 -39
- package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
- package/lib/Layout/EnterpriseLayout/Header.js +113 -0
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
- package/lib/Layout/EnterpriseLayout/Language.js +48 -17
- package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
- package/lib/Layout/EnterpriseLayout/index.js +23 -14
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
- package/lib/Layout/GlobalNavigation/index.js +74 -23
- package/lib/Layout/Header.js +63 -28
- package/lib/Layout/HeaderActions.js +74 -45
- package/lib/Layout/HeaderNavs.js +61 -23
- package/lib/Layout/HeaderTabs.js +118 -51
- package/lib/Layout/Iconfont.js +5 -1
- package/lib/Layout/Language.js +48 -17
- package/lib/Layout/Layout.js +128 -88
- package/lib/Layout/Logo.js +43 -19
- package/lib/Layout/OrgAppList.js +127 -64
- package/lib/Layout/SideMenu.js +143 -65
- package/lib/Layout/Theme.js +73 -23
- package/lib/Layout/checkAuth.js +39 -0
- package/lib/Layout/createActions.js +5 -0
- package/lib/Layout/images/index.js +28 -0
- package/lib/Layout/index.js +55 -30
- package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
- package/lib/Layout/paaslayout/Header.js +55 -22
- package/lib/Layout/paaslayout/Logo.js +19 -3
- package/lib/Layout/paaslayout/SideMenu.js +87 -39
- package/lib/Layout/paaslayout/index.js +122 -77
- package/lib/Layout/storage.js +40 -11
- package/lib/Layout/utils.js +166 -0
- package/lib/LoadingButton/index.js +29 -15
- package/lib/Modal/index.js +53 -38
- package/lib/Page/Box.js +45 -34
- package/lib/Page/index.js +77 -52
- package/lib/Page/utils.js +9 -1
- package/lib/QueryForm/Field/Checkbox.js +13 -5
- package/lib/QueryForm/Field/Select.js +53 -33
- package/lib/QueryForm/Field/SelectInput.js +56 -28
- package/lib/QueryForm/Field/fieldsMap.js +15 -1
- package/lib/QueryForm/Field/index.js +81 -43
- package/lib/QueryForm/createActions.js +12 -6
- package/lib/QueryForm/index.js +157 -78
- package/lib/QueryForm/useForm.js +5 -0
- package/lib/QueryListScene/List.js +140 -76
- package/lib/QueryListScene/QueryForm.js +86 -46
- package/lib/QueryListScene/QueryListScene.js +46 -25
- package/lib/QueryListScene/Title.js +7 -3
- package/lib/QueryListScene/Toolbar.js +16 -11
- package/lib/QueryListScene/createActions.js +5 -0
- package/lib/QueryListScene/index.js +10 -0
- package/lib/QueryListScene/useActions.js +5 -0
- package/lib/Select/DropDownWrap.js +56 -31
- package/lib/Select/index.js +241 -135
- package/lib/Table/ResizableTable/index.js +48 -26
- package/lib/Table/index.js +28 -17
- package/lib/Title/index.js +28 -21
- package/lib/index.js +56 -35
- package/lib/locale.js +19 -4
- package/lib/utils/checkAuth.js +9 -4
- package/lib/utils/findMenuInfoByPath.js +8 -1
- package/lib/utils/index.js +42 -15
- package/package.json +2 -2
package/lib/Select/index.js
CHANGED
|
@@ -4,38 +4,58 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
|
|
7
8
|
require("antd/lib/empty/style");
|
|
9
|
+
|
|
8
10
|
var _empty = _interopRequireDefault(require("antd/lib/empty"));
|
|
11
|
+
|
|
9
12
|
require("antd/lib/select/style");
|
|
13
|
+
|
|
10
14
|
var _select = _interopRequireDefault(require("antd/lib/select"));
|
|
15
|
+
|
|
11
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
12
18
|
var _DropDownWrap = _interopRequireDefault(require("./DropDownWrap"));
|
|
13
|
-
|
|
14
|
-
function _getRequireWildcardCache(
|
|
15
|
-
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
16
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
25
|
+
|
|
26
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
+
|
|
28
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
+
|
|
30
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
31
|
+
|
|
32
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
+
|
|
21
34
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
35
|
+
|
|
22
36
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
23
|
-
|
|
37
|
+
|
|
38
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
39
|
+
|
|
24
40
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
41
|
+
|
|
42
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
43
|
+
|
|
44
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
45
|
+
|
|
46
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
47
|
+
|
|
33
48
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
34
|
-
|
|
35
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf
|
|
49
|
+
|
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
|
+
|
|
52
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
53
|
+
|
|
54
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
55
|
+
|
|
36
56
|
// 页面实际渲染的下拉菜单数量,实际为 2 * ITEM_ELEMENT_NUMBER
|
|
37
|
-
var ITEM_ELEMENT_NUMBER = 30;
|
|
38
|
-
|
|
57
|
+
var ITEM_ELEMENT_NUMBER = 30; // Select size 配置
|
|
58
|
+
|
|
39
59
|
var ITEM_HEIGHT_CFG = {
|
|
40
60
|
small: 24,
|
|
41
61
|
large: 40,
|
|
@@ -47,16 +67,23 @@ var ARROW_CODE = {
|
|
|
47
67
|
};
|
|
48
68
|
var DROPDOWN_HEIGHT = 224;
|
|
49
69
|
var Option = _select["default"].Option;
|
|
50
|
-
|
|
70
|
+
|
|
71
|
+
var SuperSelect =
|
|
72
|
+
/*#__PURE__*/
|
|
73
|
+
function (_PureComponent) {
|
|
51
74
|
_inherits(SuperSelect, _PureComponent);
|
|
52
|
-
|
|
75
|
+
|
|
53
76
|
function SuperSelect(props) {
|
|
54
77
|
var _this;
|
|
78
|
+
|
|
55
79
|
_classCallCheck(this, SuperSelect);
|
|
56
|
-
|
|
80
|
+
|
|
81
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(SuperSelect).call(this, props));
|
|
82
|
+
|
|
57
83
|
_this.turnChildren = function (children) {
|
|
58
84
|
if (!children) return [];
|
|
59
85
|
var arr = [];
|
|
86
|
+
|
|
60
87
|
if (children && children.props) {
|
|
61
88
|
arr.push(children);
|
|
62
89
|
} else {
|
|
@@ -70,46 +97,61 @@ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
70
97
|
}
|
|
71
98
|
});
|
|
72
99
|
}
|
|
100
|
+
|
|
73
101
|
return arr;
|
|
74
102
|
};
|
|
103
|
+
|
|
75
104
|
_this.formulaWidth = function () {
|
|
76
105
|
// 获取dom设置宽度
|
|
77
106
|
var _this$props = _this.props,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
107
|
+
arr2 = _this$props.children,
|
|
108
|
+
_this$props$dropdownM = _this$props.dropdownMatchSelectWidth,
|
|
109
|
+
dropdownMatchSelectWidth = _this$props$dropdownM === void 0 ? true : _this$props$dropdownM,
|
|
110
|
+
maxWidth = _this$props.maxWidth;
|
|
82
111
|
var selectDom = document.getElementById(_this.id);
|
|
83
112
|
var selectWidth = selectDom.clientWidth || selectDom.offsetWidth;
|
|
84
113
|
var arr = [];
|
|
85
114
|
var formulaMaxWidth = 10;
|
|
115
|
+
|
|
86
116
|
if (!dropdownMatchSelectWidth) {
|
|
87
117
|
formulaMaxWidth = maxWidth || 10;
|
|
88
118
|
}
|
|
119
|
+
|
|
89
120
|
if (!dropdownMatchSelectWidth && !maxWidth) {
|
|
90
121
|
var children = _this.turnChildren(arr2);
|
|
122
|
+
|
|
91
123
|
for (var i = 0; i < children.length; i++) {
|
|
92
124
|
var val = children[i].props.children;
|
|
125
|
+
|
|
93
126
|
var textWidth = _this.getTextPixelWith(val);
|
|
127
|
+
|
|
94
128
|
arr.push(textWidth.toFixed(2));
|
|
95
129
|
}
|
|
130
|
+
|
|
96
131
|
if (arr.length > 0) {
|
|
97
132
|
formulaMaxWidth = Math.max.apply(Math, arr);
|
|
98
133
|
}
|
|
99
134
|
}
|
|
135
|
+
|
|
100
136
|
_this.setState({
|
|
101
137
|
selectWidth: selectWidth,
|
|
102
138
|
maxWidth: formulaMaxWidth
|
|
103
139
|
});
|
|
104
140
|
};
|
|
141
|
+
|
|
105
142
|
_this.getTextPixelWith = function (text) {
|
|
106
143
|
var fontStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '14px';
|
|
107
144
|
var canvas = document.createElement('canvas'); // 创建 canvas 画布
|
|
145
|
+
|
|
108
146
|
var context = canvas.getContext('2d'); // 获取 canvas 绘图上下文环境
|
|
147
|
+
|
|
109
148
|
context.font = fontStyle; // 设置字体样式,使用前设置好对应的 font 样式才能准确获取文字的像素长度
|
|
149
|
+
|
|
110
150
|
var dimension = context.measureText(text); // 测量文字
|
|
151
|
+
|
|
111
152
|
return dimension.width;
|
|
112
153
|
};
|
|
154
|
+
|
|
113
155
|
_this.getItemStyle = function (i) {
|
|
114
156
|
return {
|
|
115
157
|
position: 'absolute',
|
|
@@ -118,73 +160,91 @@ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
118
160
|
height: _this.ITEM_HEIGHT
|
|
119
161
|
};
|
|
120
162
|
};
|
|
163
|
+
|
|
121
164
|
_this.addEvent = function () {
|
|
122
|
-
_this.scrollEle = document.querySelector(".".concat(_this.dropdownClassName));
|
|
123
|
-
|
|
165
|
+
_this.scrollEle = document.querySelector(".".concat(_this.dropdownClassName)); // 下拉菜单未展开时元素不存在
|
|
166
|
+
|
|
124
167
|
if (!_this.scrollEle) return;
|
|
168
|
+
|
|
125
169
|
_this.scrollEle.addEventListener('scroll', _this.onScroll, false);
|
|
170
|
+
|
|
126
171
|
_this.inputEle = document.querySelector("#".concat(_this.id));
|
|
127
172
|
if (!_this.inputEle) return;
|
|
173
|
+
|
|
128
174
|
_this.inputEle.addEventListener('keydown', _this.onKeyDown, false);
|
|
129
175
|
};
|
|
176
|
+
|
|
130
177
|
_this.onKeyDown = function (e) {
|
|
131
178
|
var _ref = e || {},
|
|
132
|
-
|
|
179
|
+
keyCode = _ref.keyCode;
|
|
180
|
+
|
|
133
181
|
setTimeout(function () {
|
|
134
182
|
var activeItem = document.querySelector(".".concat(_this.dropdownClassName, " .ant-select-dropdown-menu-item-active"));
|
|
135
183
|
if (!activeItem) return;
|
|
136
184
|
var offsetTop = activeItem.offsetTop;
|
|
137
185
|
var isUp = ARROW_CODE[keyCode] === 'up';
|
|
138
|
-
var isDown = ARROW_CODE[keyCode] === 'down';
|
|
186
|
+
var isDown = ARROW_CODE[keyCode] === 'down'; // 在所有列表第一行按上键
|
|
139
187
|
|
|
140
|
-
// 在所有列表第一行按上键
|
|
141
188
|
if (offsetTop - _this.prevTop > DROPDOWN_HEIGHT && isUp) {
|
|
142
189
|
_this.scrollEle.scrollTo(0, _this.allHeight - DROPDOWN_HEIGHT);
|
|
190
|
+
|
|
143
191
|
_this.prevTop = _this.allHeight;
|
|
144
192
|
return;
|
|
145
|
-
}
|
|
193
|
+
} // 在所有列表中最后一行按下键
|
|
194
|
+
|
|
146
195
|
|
|
147
|
-
// 在所有列表中最后一行按下键
|
|
148
196
|
if (_this.prevTop > offsetTop + DROPDOWN_HEIGHT && isDown) {
|
|
149
197
|
_this.scrollEle.scrollTo(0, 0);
|
|
198
|
+
|
|
150
199
|
_this.prevTop = 0;
|
|
151
200
|
return;
|
|
152
201
|
}
|
|
153
|
-
|
|
154
|
-
// 向下滚动到下拉框最后一行时,向下滚动一行的高度
|
|
202
|
+
|
|
203
|
+
_this.prevTop = offsetTop; // 向下滚动到下拉框最后一行时,向下滚动一行的高度
|
|
204
|
+
|
|
155
205
|
if (offsetTop > _this.scrollEle.scrollTop + DROPDOWN_HEIGHT - _this.ITEM_HEIGHT + 10 && isDown) {
|
|
156
206
|
_this.scrollEle.scrollTo(0, _this.scrollTop + _this.ITEM_HEIGHT);
|
|
207
|
+
|
|
157
208
|
return;
|
|
158
|
-
}
|
|
159
|
-
|
|
209
|
+
} // 向上滚动到下拉框第一一行时,向上滚动一行的高度
|
|
210
|
+
|
|
211
|
+
|
|
160
212
|
if (offsetTop < _this.scrollEle.scrollTop && isUp) {
|
|
161
213
|
_this.scrollEle.scrollTo(0, _this.scrollTop - _this.ITEM_HEIGHT);
|
|
162
214
|
}
|
|
163
215
|
}, 100);
|
|
164
216
|
};
|
|
217
|
+
|
|
165
218
|
_this.onScroll = function () {
|
|
166
219
|
return _this.throttleByHeight(_this.onScrollReal);
|
|
167
220
|
};
|
|
221
|
+
|
|
168
222
|
_this.onScrollReal = function () {
|
|
169
223
|
_this.allList = _this.getUseChildrenList();
|
|
224
|
+
|
|
170
225
|
var _this$getStartAndEndI = _this.getStartAndEndIndex(),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
// 重新渲染列表组件 Wrap
|
|
226
|
+
startIndex = _this$getStartAndEndI.startIndex,
|
|
227
|
+
endIndex = _this$getStartAndEndI.endIndex;
|
|
228
|
+
|
|
229
|
+
_this.prevScrollTop = _this.scrollTop; // 重新渲染列表组件 Wrap
|
|
230
|
+
|
|
175
231
|
var allHeight = _this.allList.length * _this.ITEM_HEIGHT || 100;
|
|
232
|
+
|
|
176
233
|
_this.wrap.reactList(allHeight, startIndex, endIndex);
|
|
177
234
|
};
|
|
235
|
+
|
|
178
236
|
_this.throttleByHeight = function () {
|
|
179
|
-
_this.scrollTop = _this.scrollEle.scrollTop;
|
|
180
|
-
|
|
237
|
+
_this.scrollTop = _this.scrollEle.scrollTop; // 滚动的高度
|
|
238
|
+
|
|
181
239
|
var delta = _this.prevScrollTop - _this.scrollTop;
|
|
182
240
|
delta = delta < 0 ? 0 - delta : delta;
|
|
183
241
|
delta > _this.reactDelta && _this.onScrollReal();
|
|
184
242
|
};
|
|
243
|
+
|
|
185
244
|
_this.getUseChildrenList = function () {
|
|
186
245
|
return _this.state.filterChildren || _this.state.children;
|
|
187
246
|
};
|
|
247
|
+
|
|
188
248
|
_this.getStartAndEndIndex = function () {
|
|
189
249
|
// 滚动后显示在列表可视区中的第一个 item 的 index
|
|
190
250
|
var showIndex = Number((_this.scrollTop / _this.ITEM_HEIGHT).toFixed(0));
|
|
@@ -195,65 +255,74 @@ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
195
255
|
endIndex: endIndex
|
|
196
256
|
};
|
|
197
257
|
};
|
|
258
|
+
|
|
198
259
|
_this.setSuperDrowDownMenu = function (visible) {
|
|
199
260
|
if (!visible) return;
|
|
200
261
|
_this.allList = _this.getUseChildrenList();
|
|
262
|
+
|
|
201
263
|
if (!_this.eventTimer || !_this.scrollEle) {
|
|
202
264
|
_this.eventTimer = setTimeout(function () {
|
|
203
265
|
return _this.addEvent();
|
|
204
266
|
}, 0);
|
|
205
267
|
} else {
|
|
206
|
-
var allHeight = _this.allList.length * _this.ITEM_HEIGHT || 100;
|
|
207
|
-
|
|
268
|
+
var allHeight = _this.allList.length * _this.ITEM_HEIGHT || 100; // 下拉列表单独重新渲染
|
|
269
|
+
|
|
208
270
|
var _this$getStartAndEndI2 = _this.getStartAndEndIndex(),
|
|
209
|
-
|
|
210
|
-
|
|
271
|
+
startIndex = _this$getStartAndEndI2.startIndex,
|
|
272
|
+
endIndex = _this$getStartAndEndI2.endIndex;
|
|
273
|
+
|
|
211
274
|
setTimeout(function () {
|
|
212
275
|
_this.wrap && _this.wrap.reactList(allHeight, startIndex, endIndex);
|
|
213
276
|
}, 0);
|
|
214
277
|
}
|
|
215
278
|
};
|
|
279
|
+
|
|
216
280
|
_this.onDropdownVisibleChange = function (visible) {
|
|
217
281
|
var onDropdownVisibleChange = _this.props.onDropdownVisibleChange;
|
|
218
282
|
onDropdownVisibleChange && onDropdownVisibleChange(visible);
|
|
219
283
|
var _this$state = _this.state,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
284
|
+
value = _this$state.value,
|
|
285
|
+
children = _this$state.children; // 关闭下拉框前清空筛选条件,防止下次打开任然显示筛选后的 options
|
|
286
|
+
|
|
223
287
|
if (!visible) {
|
|
224
288
|
// 定时器确保关闭后再设置 filterChildren,防止列表刷新闪烁
|
|
225
289
|
setTimeout(function () {
|
|
226
290
|
_this.setState({
|
|
227
291
|
filterChildren: null
|
|
228
292
|
});
|
|
293
|
+
|
|
229
294
|
_this.setDefaultScrollTop(value);
|
|
230
|
-
}, 100);
|
|
231
|
-
// this.removeEvent();
|
|
295
|
+
}, 100); // this.removeEvent();
|
|
232
296
|
} else {
|
|
233
297
|
// this.addEvent();
|
|
234
298
|
if (value) {
|
|
235
299
|
// 如果已有 value, 设置默认滚动位置
|
|
236
|
-
_this.setDefaultScrollTop();
|
|
237
|
-
|
|
300
|
+
_this.setDefaultScrollTop(); // 设置下拉列表显示数据
|
|
301
|
+
|
|
302
|
+
|
|
238
303
|
_this.setSuperDrowDownMenu(visible);
|
|
239
304
|
} else if (!value && value !== 0 && children && children.length > 0) {
|
|
240
305
|
// 无数据时,下拉回归至第一个
|
|
241
306
|
var val = children[0].props.value;
|
|
307
|
+
|
|
242
308
|
_this.setDefaultScrollTop(val);
|
|
243
309
|
}
|
|
244
310
|
}
|
|
245
311
|
};
|
|
312
|
+
|
|
246
313
|
_this.onDeselect = function (value) {
|
|
247
314
|
var onDeselect = _this.props.onDeselect;
|
|
248
315
|
onDeselect && onDeselect(value);
|
|
249
316
|
};
|
|
317
|
+
|
|
250
318
|
_this.onChange = function (value, opt) {
|
|
251
319
|
var _this$props2 = _this.props,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
320
|
+
showSearch = _this$props2.showSearch,
|
|
321
|
+
onChange = _this$props2.onChange,
|
|
322
|
+
autoClearSearchValue = _this$props2.autoClearSearchValue,
|
|
323
|
+
maxCount = _this$props2.maxCount,
|
|
324
|
+
mode = _this$props2.mode;
|
|
325
|
+
|
|
257
326
|
if (showSearch || _this.isMultiple) {
|
|
258
327
|
// 搜索模式下选择后是否需要重置搜索状态
|
|
259
328
|
if (autoClearSearchValue !== false) {
|
|
@@ -265,6 +334,7 @@ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
265
334
|
});
|
|
266
335
|
}
|
|
267
336
|
}
|
|
337
|
+
|
|
268
338
|
if (mode === 'multiple') {
|
|
269
339
|
if (value.length <= maxCount) {
|
|
270
340
|
_this.setState({
|
|
@@ -276,21 +346,27 @@ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
276
346
|
value: value
|
|
277
347
|
});
|
|
278
348
|
}
|
|
349
|
+
|
|
279
350
|
onChange && onChange(value, opt);
|
|
351
|
+
|
|
280
352
|
if (mode !== 'multiple') {
|
|
281
353
|
_this.select && _this.select.blur();
|
|
282
354
|
}
|
|
283
355
|
};
|
|
356
|
+
|
|
284
357
|
_this.onSearch = function (v) {
|
|
285
358
|
var _this$props3 = _this.props,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
359
|
+
showSearch = _this$props3.showSearch,
|
|
360
|
+
onSearch = _this$props3.onSearch,
|
|
361
|
+
filterOption = _this$props3.filterOption,
|
|
362
|
+
arr = _this$props3.children;
|
|
363
|
+
|
|
290
364
|
var children = _this.turnChildren(arr);
|
|
365
|
+
|
|
291
366
|
if (showSearch && filterOption !== false) {
|
|
292
367
|
// 须根据 filterOption(如有该自定义函数)手动 filter 搜索匹配的列表
|
|
293
368
|
var filterChildren = null;
|
|
369
|
+
|
|
294
370
|
if (typeof filterOption === 'function') {
|
|
295
371
|
filterChildren = children.filter(function (item) {
|
|
296
372
|
return filterOption(v, item);
|
|
@@ -299,18 +375,17 @@ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
299
375
|
filterChildren = children.filter(function (item) {
|
|
300
376
|
return _this.filterOption(v, item);
|
|
301
377
|
});
|
|
302
|
-
}
|
|
378
|
+
} // 搜索框有值,去除disabled=true的children
|
|
379
|
+
|
|
303
380
|
|
|
304
|
-
// 搜索框有值,去除disabled=true的children
|
|
305
381
|
var newFilterChild = [];
|
|
306
382
|
filterChildren && filterChildren.forEach(function (item, index) {
|
|
307
383
|
if (!item.props.disabled) {
|
|
308
384
|
newFilterChild.push(item);
|
|
309
385
|
}
|
|
310
386
|
});
|
|
311
|
-
filterChildren = newFilterChild;
|
|
387
|
+
filterChildren = newFilterChild; // 设置下拉列表显示数据
|
|
312
388
|
|
|
313
|
-
// 设置下拉列表显示数据
|
|
314
389
|
_this.setState({
|
|
315
390
|
filterChildren: v === '' ? null : filterChildren
|
|
316
391
|
}, function () {
|
|
@@ -318,61 +393,77 @@ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
318
393
|
// 搜索后需要重置滚动位置到0,防止上次 scrollTop 位置无数据
|
|
319
394
|
if (filterChildren) {
|
|
320
395
|
_this.scrollTop = 0;
|
|
396
|
+
|
|
321
397
|
_this.scrollEle.scrollTo(0, 0);
|
|
322
|
-
}
|
|
323
|
-
|
|
398
|
+
} // 搜索成功后需要重新设置列表的总高度
|
|
399
|
+
|
|
400
|
+
|
|
324
401
|
_this.setSuperDrowDownMenu(true);
|
|
325
402
|
}, 0);
|
|
326
403
|
});
|
|
327
404
|
}
|
|
405
|
+
|
|
328
406
|
onSearch && onSearch(v);
|
|
329
407
|
};
|
|
408
|
+
|
|
330
409
|
_this.filterOption = function (v, option) {
|
|
331
410
|
// 自定义过滤对应的 option 属性配置
|
|
332
411
|
var filterProps = _this.props.optionFilterProp || 'value';
|
|
333
412
|
return "".concat(option.props[filterProps]).indexOf(v) >= 0;
|
|
334
413
|
};
|
|
414
|
+
|
|
335
415
|
_this.setDefaultScrollTop = function (data) {
|
|
336
416
|
var value = _this.state.value;
|
|
337
417
|
var arr = _this.props.children;
|
|
418
|
+
|
|
338
419
|
var children = _this.turnChildren(arr);
|
|
420
|
+
|
|
339
421
|
var val = data || data === 0 ? data : value;
|
|
340
|
-
|
|
422
|
+
|
|
423
|
+
for (var i = 0; i < children.length; i++) {
|
|
341
424
|
var item = children[i];
|
|
342
425
|
var itemValue = item.props.value;
|
|
426
|
+
|
|
343
427
|
if (itemValue === val || Array.isArray(val) && val.includes(itemValue)) {
|
|
344
|
-
var
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
_this.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
428
|
+
var _ret = function () {
|
|
429
|
+
var targetScrollTop = i * _this.ITEM_HEIGHT;
|
|
430
|
+
setTimeout(function () {
|
|
431
|
+
if (!_this.scrollEle) {
|
|
432
|
+
_this.addEvent();
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
_this.scrollEle && _this.scrollEle.scrollTo(0, targetScrollTop);
|
|
436
|
+
}, 100);
|
|
437
|
+
return {
|
|
438
|
+
v: void 0
|
|
439
|
+
};
|
|
440
|
+
}();
|
|
441
|
+
|
|
442
|
+
if (_typeof(_ret) === "object") return _ret.v;
|
|
354
443
|
}
|
|
355
|
-
};
|
|
356
|
-
for (var i = 0; i < children.length; i++) {
|
|
357
|
-
var _ret = _loop();
|
|
358
|
-
if (_typeof(_ret) === "object") return _ret.v;
|
|
359
444
|
}
|
|
360
445
|
};
|
|
446
|
+
|
|
361
447
|
_this.removeEvent = function () {
|
|
362
448
|
if (!_this.scrollEle) return;
|
|
449
|
+
|
|
363
450
|
_this.scrollEle.removeEventListener('scroll', _this.onScroll, false);
|
|
451
|
+
|
|
364
452
|
if (!_this.inputEle) return;
|
|
453
|
+
|
|
365
454
|
_this.inputEle.removeEventListener('keydown', _this.onKeyDown, false);
|
|
366
455
|
};
|
|
456
|
+
|
|
367
457
|
var _mode = props.mode,
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
458
|
+
defaultValue = props.defaultValue,
|
|
459
|
+
_value = props.value,
|
|
460
|
+
optionHeight = props.optionHeight,
|
|
461
|
+
_arr = props.children;
|
|
372
462
|
_this.isMultiple = ['tags', 'multiple'].includes(_mode);
|
|
373
|
-
var _children = _this.turnChildren(_arr);
|
|
374
463
|
|
|
375
|
-
// 设置默认 value
|
|
464
|
+
var _children = _this.turnChildren(_arr); // 设置默认 value
|
|
465
|
+
|
|
466
|
+
|
|
376
467
|
var defaultV = _this.isMultiple ? [] : '';
|
|
377
468
|
defaultV = _value || defaultValue || defaultV;
|
|
378
469
|
_this.state = {
|
|
@@ -382,59 +473,62 @@ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
382
473
|
value: defaultV,
|
|
383
474
|
maxWidth: null,
|
|
384
475
|
selectWidth: null
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
_this.ITEM_HEIGHT = optionHeight || ITEM_HEIGHT_CFG[props.size || 'default'];
|
|
388
|
-
|
|
389
|
-
_this.visibleDomHeight = _this.ITEM_HEIGHT * ITEM_ELEMENT_NUMBER;
|
|
390
|
-
|
|
391
|
-
_this.reactDelta = _this.visibleDomHeight / 3;
|
|
392
|
-
|
|
393
|
-
_this.isStopReact = false;
|
|
394
|
-
|
|
395
|
-
_this.prevScrollTop = 0;
|
|
396
|
-
|
|
476
|
+
}; // 下拉菜单项行高
|
|
477
|
+
|
|
478
|
+
_this.ITEM_HEIGHT = optionHeight || ITEM_HEIGHT_CFG[props.size || 'default']; // 可视区 dom 高度
|
|
479
|
+
|
|
480
|
+
_this.visibleDomHeight = _this.ITEM_HEIGHT * ITEM_ELEMENT_NUMBER; // 滚动时重新渲染的 scrollTop 判断值,大于 reactDelta 则刷新下拉列表
|
|
481
|
+
|
|
482
|
+
_this.reactDelta = _this.visibleDomHeight / 3; // 是否拖动滚动条快速滚动状态
|
|
483
|
+
|
|
484
|
+
_this.isStopReact = false; // 上一次滚动的 scrollTop 值
|
|
485
|
+
|
|
486
|
+
_this.prevScrollTop = 0; // 上一次按下方向键时 scrollTop 值
|
|
487
|
+
|
|
397
488
|
_this.prevTop = 0;
|
|
398
|
-
_this.scrollTop = 0;
|
|
489
|
+
_this.scrollTop = 0; // className
|
|
399
490
|
|
|
400
|
-
// className
|
|
401
491
|
_this.dropdownClassName = "dc".concat(+new Date());
|
|
402
492
|
_this.id = "sid".concat(+new Date());
|
|
403
493
|
return _this;
|
|
404
494
|
}
|
|
495
|
+
|
|
405
496
|
_createClass(SuperSelect, [{
|
|
406
497
|
key: "componentDidMount",
|
|
407
498
|
value: function componentDidMount() {
|
|
408
499
|
var _this2 = this;
|
|
500
|
+
|
|
409
501
|
// defaultOpens=true 时添加滚动事件
|
|
410
502
|
setTimeout(function () {
|
|
411
503
|
_this2.addEvent();
|
|
412
504
|
}, 500);
|
|
413
505
|
var arr = this.props.children;
|
|
414
|
-
var children = this.turnChildren(arr);
|
|
415
|
-
|
|
416
|
-
this.formulaWidth();
|
|
417
|
-
// }
|
|
506
|
+
var children = this.turnChildren(arr); // if (children && children.length > 0) {
|
|
507
|
+
|
|
508
|
+
this.formulaWidth(); // }
|
|
418
509
|
}
|
|
419
510
|
}, {
|
|
420
511
|
key: "componentDidUpdate",
|
|
421
512
|
value: function componentDidUpdate(prevProps) {
|
|
422
513
|
var _this$props4 = this.props,
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
514
|
+
mode = _this$props4.mode,
|
|
515
|
+
defaultValue = _this$props4.defaultValue,
|
|
516
|
+
value = _this$props4.value,
|
|
517
|
+
children = _this$props4.children;
|
|
427
518
|
var arr = this.turnChildren(children);
|
|
519
|
+
|
|
428
520
|
if (prevProps.children !== children) {
|
|
429
521
|
this.isMultiple = ['tags', 'multiple'].includes(mode);
|
|
430
522
|
this.setState({
|
|
431
523
|
children: arr || [],
|
|
432
524
|
filterChildren: null
|
|
433
525
|
});
|
|
526
|
+
|
|
434
527
|
if (arr && arr.length > 0) {
|
|
435
528
|
this.formulaWidth();
|
|
436
529
|
}
|
|
437
530
|
}
|
|
531
|
+
|
|
438
532
|
if (prevProps.value !== value) {
|
|
439
533
|
// 更新时设置默认 value
|
|
440
534
|
var defaultV = this.isMultiple ? [] : '';
|
|
@@ -453,44 +547,52 @@ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
453
547
|
key: "render",
|
|
454
548
|
value: function render() {
|
|
455
549
|
var _this3 = this;
|
|
550
|
+
|
|
456
551
|
var _this$state2 = this.state,
|
|
457
|
-
|
|
458
|
-
|
|
552
|
+
maxWidth = _this$state2.maxWidth,
|
|
553
|
+
selectWidth = _this$state2.selectWidth;
|
|
554
|
+
|
|
459
555
|
var _this$props5 = this.props,
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
556
|
+
dropdownStyle = _this$props5.dropdownStyle,
|
|
557
|
+
optionLabelProp = _this$props5.optionLabelProp,
|
|
558
|
+
dropdownClassName = _this$props5.dropdownClassName,
|
|
559
|
+
props = _objectWithoutProperties(_this$props5, ["dropdownStyle", "optionLabelProp", "dropdownClassName"]);
|
|
560
|
+
|
|
464
561
|
this.allList = this.getUseChildrenList();
|
|
465
562
|
this.allHeight = this.allList.length * this.ITEM_HEIGHT || 100;
|
|
563
|
+
|
|
466
564
|
var _this$getStartAndEndI3 = this.getStartAndEndIndex(),
|
|
467
|
-
|
|
468
|
-
|
|
565
|
+
startIndex = _this$getStartAndEndI3.startIndex,
|
|
566
|
+
endIndex = _this$getStartAndEndI3.endIndex;
|
|
567
|
+
|
|
469
568
|
var dynamicWidth = maxWidth;
|
|
569
|
+
|
|
470
570
|
if (this.allList.length === 0 || maxWidth < selectWidth) {
|
|
471
571
|
dynamicWidth = selectWidth;
|
|
472
572
|
}
|
|
473
|
-
|
|
573
|
+
|
|
574
|
+
dropdownStyle = _objectSpread({
|
|
474
575
|
maxHeight: "".concat(DROPDOWN_HEIGHT, "px")
|
|
475
|
-
}, dropdownStyle
|
|
576
|
+
}, dropdownStyle, {
|
|
476
577
|
overflow: 'auto',
|
|
477
578
|
position: 'relative',
|
|
478
579
|
maxWidth: dynamicWidth
|
|
479
580
|
});
|
|
480
|
-
var value = this.state.value;
|
|
481
|
-
|
|
482
|
-
var _props = _objectSpread({}, props);
|
|
483
|
-
|
|
484
|
-
|
|
581
|
+
var value = this.state.value; // 判断处于 antd Form 中时不自动设置 value
|
|
582
|
+
|
|
583
|
+
var _props = _objectSpread({}, props); // 先删除 value,再手动赋值,防止空 value 影响 placeholder
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
delete _props.value; // value 为空字符会隐藏 placeholder,改为 undefined
|
|
485
587
|
|
|
486
|
-
// value 为空字符会隐藏 placeholder,改为 undefined
|
|
487
588
|
if (typeof value === 'string' && !value) {
|
|
488
589
|
_props.value = undefined;
|
|
489
590
|
} else {
|
|
490
591
|
_props.value = value;
|
|
491
592
|
}
|
|
593
|
+
|
|
492
594
|
optionLabelProp = optionLabelProp || 'children';
|
|
493
|
-
return
|
|
595
|
+
return _react["default"].createElement(_select["default"], _extends({}, _props, {
|
|
494
596
|
id: this.id,
|
|
495
597
|
onSearch: this.onSearch,
|
|
496
598
|
onChange: this.onChange,
|
|
@@ -504,30 +606,34 @@ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
504
606
|
},
|
|
505
607
|
dropdownRender: function dropdownRender(menu, props) {
|
|
506
608
|
if (_this3.allList.length === 0) {
|
|
507
|
-
return
|
|
609
|
+
return _react["default"].createElement("div", {
|
|
508
610
|
style: {
|
|
509
611
|
padding: '5px 12px'
|
|
510
612
|
}
|
|
511
|
-
},
|
|
613
|
+
}, _react["default"].createElement(_empty["default"], {
|
|
512
614
|
image: _empty["default"].PRESENTED_IMAGE_SIMPLE
|
|
513
615
|
}));
|
|
514
616
|
}
|
|
515
|
-
|
|
617
|
+
|
|
618
|
+
return _react["default"].createElement(_DropDownWrap["default"], _extends({
|
|
516
619
|
startIndex: startIndex,
|
|
517
620
|
endIndex: endIndex,
|
|
518
621
|
allHeight: _this3.allHeight,
|
|
519
622
|
menu: menu,
|
|
520
|
-
itemHeight: _this3.ITEM_HEIGHT
|
|
623
|
+
itemHeight: _this3.ITEM_HEIGHT
|
|
624
|
+
}, {
|
|
521
625
|
ref: function ref(ele) {
|
|
522
626
|
_this3.wrap = ele;
|
|
523
627
|
}
|
|
524
|
-
});
|
|
628
|
+
}));
|
|
525
629
|
}
|
|
526
630
|
}), this.allList);
|
|
527
631
|
}
|
|
528
632
|
}]);
|
|
633
|
+
|
|
529
634
|
return SuperSelect;
|
|
530
635
|
}(_react.PureComponent);
|
|
636
|
+
|
|
531
637
|
SuperSelect.Option = Option;
|
|
532
638
|
var _default = SuperSelect;
|
|
533
639
|
exports["default"] = _default;
|