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
|
@@ -1,61 +1,76 @@
|
|
|
1
|
-
function _typeof(obj) {
|
|
2
|
-
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
3
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
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); }
|
|
6
|
+
|
|
7
|
+
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); } }
|
|
8
|
+
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
10
|
+
|
|
11
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
12
|
+
|
|
12
13
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
13
|
-
|
|
14
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf
|
|
14
|
+
|
|
15
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
|
+
|
|
17
|
+
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); }
|
|
18
|
+
|
|
19
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
|
+
|
|
15
21
|
import React from 'react';
|
|
16
22
|
import cn from 'classnames';
|
|
17
23
|
import Title from './Title';
|
|
18
24
|
import Toolbar from './Toolbar';
|
|
19
25
|
import createActions from './createActions';
|
|
20
|
-
|
|
26
|
+
|
|
27
|
+
var QueryListScene =
|
|
28
|
+
/*#__PURE__*/
|
|
29
|
+
function (_React$Component) {
|
|
21
30
|
_inherits(QueryListScene, _React$Component);
|
|
22
|
-
|
|
31
|
+
|
|
23
32
|
function QueryListScene(props) {
|
|
24
33
|
var _this;
|
|
34
|
+
|
|
25
35
|
_classCallCheck(this, QueryListScene);
|
|
26
|
-
|
|
36
|
+
|
|
37
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(QueryListScene).call(this, props));
|
|
27
38
|
_this.actions = props.actions || createActions();
|
|
28
39
|
return _this;
|
|
29
40
|
}
|
|
41
|
+
|
|
30
42
|
_createClass(QueryListScene, [{
|
|
31
43
|
key: "render",
|
|
32
44
|
value: function render() {
|
|
33
45
|
var _cn,
|
|
34
|
-
|
|
46
|
+
_this2 = this;
|
|
47
|
+
|
|
35
48
|
var _this$props = this.props,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
title = _this$props.title,
|
|
50
|
+
children = _this$props.children,
|
|
51
|
+
size = _this$props.size,
|
|
52
|
+
_this$props$className = _this$props.className,
|
|
53
|
+
className = _this$props$className === void 0 ? '' : _this$props$className;
|
|
41
54
|
var hasToolbar = [].some.call(children || [], function (child) {
|
|
42
55
|
return (child == null ? void 0 : child.type) === Toolbar;
|
|
43
56
|
});
|
|
44
|
-
return
|
|
57
|
+
return React.createElement("div", {
|
|
45
58
|
className: cn('tnt-querylistscene', (_cn = {}, _defineProperty(_cn, className, className), _defineProperty(_cn, 'large-size', size === 'large'), _defineProperty(_cn, "hasToolbar", hasToolbar), _cn))
|
|
46
|
-
}, title &&
|
|
59
|
+
}, title && React.createElement(Title, {
|
|
47
60
|
title: title,
|
|
48
61
|
size: size
|
|
49
|
-
}),
|
|
62
|
+
}), React.createElement("div", {
|
|
50
63
|
className: "tnt-querylistscene-content"
|
|
51
64
|
}, React.Children.map(children, function (child) {
|
|
52
|
-
return child &&
|
|
65
|
+
return child && React.cloneElement(child, {
|
|
53
66
|
qlsProps: _this2.props,
|
|
54
67
|
actions: _this2.actions
|
|
55
68
|
});
|
|
56
69
|
})));
|
|
57
70
|
}
|
|
58
71
|
}]);
|
|
72
|
+
|
|
59
73
|
return QueryListScene;
|
|
60
74
|
}(React.Component);
|
|
75
|
+
|
|
61
76
|
export { QueryListScene as default };
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
export default (function (_ref) {
|
|
7
7
|
var title = _ref.title,
|
|
8
|
-
|
|
9
|
-
return
|
|
8
|
+
children = _ref.children;
|
|
9
|
+
return React.createElement("div", {
|
|
10
10
|
className: "tnt-querylistscene-title"
|
|
11
|
-
},
|
|
11
|
+
}, React.createElement("span", null, title), React.createElement("span", null, children));
|
|
12
12
|
});
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
7
5
|
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; }
|
|
6
|
+
|
|
8
7
|
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; }
|
|
8
|
+
|
|
9
9
|
import cn from 'classnames';
|
|
10
10
|
export default (function (_ref) {
|
|
11
11
|
var className = _ref.className,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
children = _ref.children,
|
|
13
|
+
actions = _ref.actions,
|
|
14
|
+
qslProps = _ref.qslProps,
|
|
15
|
+
rest = _objectWithoutProperties(_ref, ["className", "children", "actions", "qslProps"]);
|
|
16
|
+
|
|
17
|
+
return React.createElement("div", _extends({}, rest, {
|
|
17
18
|
className: cn('tnt-querylistscene-toolbar', _defineProperty({}, className, className))
|
|
18
19
|
}), children);
|
|
19
20
|
});
|
|
@@ -1,27 +1,41 @@
|
|
|
1
|
-
function _typeof(obj) {
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
5
9
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
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); }
|
|
10
|
+
|
|
11
|
+
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); } }
|
|
12
|
+
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
14
|
+
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
16
|
+
|
|
14
17
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
15
|
-
|
|
16
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf
|
|
18
|
+
|
|
19
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20
|
+
|
|
21
|
+
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); }
|
|
22
|
+
|
|
23
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
24
|
+
|
|
17
25
|
import React, { PureComponent } from 'react';
|
|
18
|
-
|
|
26
|
+
|
|
27
|
+
var DropDownWrap =
|
|
28
|
+
/*#__PURE__*/
|
|
29
|
+
function (_PureComponent) {
|
|
19
30
|
_inherits(DropDownWrap, _PureComponent);
|
|
20
|
-
|
|
31
|
+
|
|
21
32
|
function DropDownWrap(props) {
|
|
22
33
|
var _this;
|
|
34
|
+
|
|
23
35
|
_classCallCheck(this, DropDownWrap);
|
|
24
|
-
|
|
36
|
+
|
|
37
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(DropDownWrap).call(this, props));
|
|
38
|
+
|
|
25
39
|
_this.getItemStyle = function (i) {
|
|
26
40
|
var itemHeight = _this.props.itemHeight;
|
|
27
41
|
return {
|
|
@@ -31,6 +45,7 @@ var DropDownWrap = /*#__PURE__*/function (_PureComponent) {
|
|
|
31
45
|
width: '100%'
|
|
32
46
|
};
|
|
33
47
|
};
|
|
48
|
+
|
|
34
49
|
_this.reactList = function (allHeight, startIndex, endIndex) {
|
|
35
50
|
return _this.setState({
|
|
36
51
|
allHeight: allHeight,
|
|
@@ -38,9 +53,10 @@ var DropDownWrap = /*#__PURE__*/function (_PureComponent) {
|
|
|
38
53
|
endIndex: endIndex
|
|
39
54
|
});
|
|
40
55
|
};
|
|
56
|
+
|
|
41
57
|
var _allHeight = props.allHeight,
|
|
42
|
-
|
|
43
|
-
|
|
58
|
+
_startIndex = props.startIndex,
|
|
59
|
+
_endIndex = props.endIndex;
|
|
44
60
|
_this.state = {
|
|
45
61
|
allHeight: _allHeight,
|
|
46
62
|
startIndex: _startIndex,
|
|
@@ -48,6 +64,7 @@ var DropDownWrap = /*#__PURE__*/function (_PureComponent) {
|
|
|
48
64
|
};
|
|
49
65
|
return _this;
|
|
50
66
|
}
|
|
67
|
+
|
|
51
68
|
_createClass(DropDownWrap, [{
|
|
52
69
|
key: "componentDidUpdate",
|
|
53
70
|
value: function componentDidUpdate(prevProps) {
|
|
@@ -61,27 +78,29 @@ var DropDownWrap = /*#__PURE__*/function (_PureComponent) {
|
|
|
61
78
|
key: "render",
|
|
62
79
|
value: function render() {
|
|
63
80
|
var _this2 = this;
|
|
81
|
+
|
|
64
82
|
var menu = this.props.menu;
|
|
65
83
|
var _this$state = this.state,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
84
|
+
startIndex = _this$state.startIndex,
|
|
85
|
+
endIndex = _this$state.endIndex,
|
|
86
|
+
allHeight = _this$state.allHeight; // 截取 Select 下拉列表中需要显示的部分
|
|
69
87
|
|
|
70
|
-
|
|
71
|
-
var cloneMenu = /*#__PURE__*/React.cloneElement(menu, {
|
|
88
|
+
var cloneMenu = React.cloneElement(menu, {
|
|
72
89
|
menuItems: menu.props.menuItems.slice(startIndex, endIndex).map(function (item, i) {
|
|
73
90
|
var realIndex = (startIndex || 0) + Number(i);
|
|
74
|
-
var style = _this2.getItemStyle(realIndex);
|
|
75
91
|
|
|
76
|
-
// 未搜到数据提示高度使用默认高度
|
|
92
|
+
var style = _this2.getItemStyle(realIndex); // 未搜到数据提示高度使用默认高度
|
|
93
|
+
|
|
94
|
+
|
|
77
95
|
if (item.key === 'NOT_FOUND') {
|
|
78
96
|
delete style.height;
|
|
79
97
|
}
|
|
80
|
-
|
|
81
|
-
|
|
98
|
+
|
|
99
|
+
return React.cloneElement(item, {
|
|
100
|
+
style: _objectSpread({}, item.props.style, {}, style)
|
|
82
101
|
});
|
|
83
102
|
}),
|
|
84
|
-
dropdownMenuStyle: _objectSpread(
|
|
103
|
+
dropdownMenuStyle: _objectSpread({}, menu.props.dropdownMenuStyle, {
|
|
85
104
|
height: allHeight,
|
|
86
105
|
maxHeight: allHeight,
|
|
87
106
|
overflow: 'hidden'
|
|
@@ -90,6 +109,8 @@ var DropDownWrap = /*#__PURE__*/function (_PureComponent) {
|
|
|
90
109
|
return cloneMenu;
|
|
91
110
|
}
|
|
92
111
|
}]);
|
|
112
|
+
|
|
93
113
|
return DropDownWrap;
|
|
94
114
|
}(PureComponent);
|
|
115
|
+
|
|
95
116
|
export { DropDownWrap as default };
|