tntd 1.4.19 → 1.4.20

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.
Files changed (170) hide show
  1. package/components/Layout/Avatar.js +4 -4
  2. package/components/Layout/EnterpriseLayout/Avatar.js +10 -7
  3. package/components/Layout/EnterpriseLayout/Language.js +5 -3
  4. package/components/Layout/EnterpriseLayout/Theme.js +6 -7
  5. package/components/Layout/EnterpriseLayout/index.js +1 -1
  6. package/components/Layout/HeaderActions.js +13 -10
  7. package/components/Layout/HeaderTabs.js +13 -14
  8. package/components/Layout/Layout.js +2 -0
  9. package/components/Layout/index.js +2 -1
  10. package/components/Layout/storage.js +12 -2
  11. package/components/Page/index.js +2 -2
  12. package/components/locale.js +7 -2
  13. package/dist/1.tntd.js +1 -12
  14. package/dist/stats.json +28424 -27998
  15. package/dist/tntd.css +1 -1
  16. package/dist/tntd.js +13 -7
  17. package/es/ArrayInput/icon.js +5 -5
  18. package/es/ArrayInput/index.js +76 -108
  19. package/es/AuthContext.js +1 -1
  20. package/es/Columns/index.js +31 -38
  21. package/es/DevelopmentLogin/LoginModal.js +32 -45
  22. package/es/DevelopmentLogin/index.js +13 -17
  23. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  24. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  25. package/es/Ellipsis/index.js +58 -69
  26. package/es/Handle/index.js +25 -35
  27. package/es/Icon/fonts/iconfont.js +7 -12
  28. package/es/Icon/index.js +10 -13
  29. package/es/Img/Contain.js +24 -29
  30. package/es/Img/Cover.js +40 -54
  31. package/es/Img/index.js +36 -45
  32. package/es/Layout/ActionsContext.js +3 -2
  33. package/es/Layout/AppList.js +37 -92
  34. package/es/Layout/Application.js +26 -72
  35. package/es/Layout/Avatar.js +32 -69
  36. package/es/Layout/CompatibleLanguage.js +39 -94
  37. package/es/Layout/EnterpriseLayout/Avatar.js +49 -79
  38. package/es/Layout/EnterpriseLayout/Language.js +19 -34
  39. package/es/Layout/EnterpriseLayout/Theme.js +23 -37
  40. package/es/Layout/EnterpriseLayout/index.js +14 -16
  41. package/es/Layout/GlobalNavigation/NavigationPopup.js +59 -170
  42. package/es/Layout/GlobalNavigation/index.js +20 -54
  43. package/es/Layout/Header.js +25 -46
  44. package/es/Layout/HeaderActions.js +52 -63
  45. package/es/Layout/HeaderNavs.js +20 -47
  46. package/es/Layout/HeaderTabs.js +61 -115
  47. package/es/Layout/Iconfont.js +1 -1
  48. package/es/Layout/Language.js +14 -32
  49. package/es/Layout/Layout.js +88 -108
  50. package/es/Layout/Logo.js +16 -32
  51. package/es/Layout/OrgAppList.js +62 -107
  52. package/es/Layout/SideMenu.js +63 -124
  53. package/es/Layout/Theme.js +23 -61
  54. package/es/Layout/index.js +29 -36
  55. package/es/Layout/paaslayout/CompactSideMenu.js +35 -74
  56. package/es/Layout/paaslayout/Header.js +22 -45
  57. package/es/Layout/paaslayout/Logo.js +3 -13
  58. package/es/Layout/paaslayout/SideMenu.js +39 -78
  59. package/es/Layout/paaslayout/index.js +75 -102
  60. package/es/Layout/storage.js +26 -9
  61. package/es/LoadingButton/index.js +15 -24
  62. package/es/Modal/index.js +38 -46
  63. package/es/Page/Box.js +34 -41
  64. package/es/Page/index.js +54 -68
  65. package/es/Page/utils.js +0 -5
  66. package/es/QueryForm/Field/Checkbox.js +5 -9
  67. package/es/QueryForm/Field/Select.js +31 -41
  68. package/es/QueryForm/Field/SelectInput.js +26 -41
  69. package/es/QueryForm/Field/fieldsMap.js +0 -1
  70. package/es/QueryForm/Field/index.js +41 -71
  71. package/es/QueryForm/createActions.js +6 -7
  72. package/es/QueryForm/index.js +76 -135
  73. package/es/QueryListScene/List.js +74 -128
  74. package/es/QueryListScene/QueryForm.js +46 -81
  75. package/es/QueryListScene/QueryListScene.js +25 -40
  76. package/es/QueryListScene/Title.js +3 -3
  77. package/es/QueryListScene/Toolbar.js +11 -12
  78. package/es/Select/DropDownWrap.js +29 -50
  79. package/es/Select/index.js +135 -231
  80. package/es/Table/ResizableTable/index.js +26 -40
  81. package/es/Table/index.js +18 -16
  82. package/es/Title/index.js +21 -23
  83. package/es/locale.js +9 -7
  84. package/es/utils/checkAuth.js +3 -5
  85. package/es/utils/findMenuInfoByPath.js +0 -4
  86. package/es/utils/index.js +12 -23
  87. package/lib/ArrayInput/icon.js +6 -6
  88. package/lib/ArrayInput/index.js +78 -127
  89. package/lib/AuthContext.js +1 -4
  90. package/lib/Columns/index.js +31 -47
  91. package/lib/DevelopmentLogin/LoginModal.js +32 -58
  92. package/lib/DevelopmentLogin/index.js +16 -27
  93. package/lib/Ellipsis/Svg/CopySVG.js +13 -15
  94. package/lib/Ellipsis/Svg/TickSVG.js +8 -10
  95. package/lib/Ellipsis/index.js +57 -80
  96. package/lib/Handle/index.js +25 -47
  97. package/lib/Icon/fonts/iconfont.js +7 -12
  98. package/lib/Icon/index.js +11 -20
  99. package/lib/Img/Contain.js +24 -34
  100. package/lib/Img/Cover.js +42 -65
  101. package/lib/Img/index.js +36 -51
  102. package/lib/Layout/ActionsContext.js +1 -4
  103. package/lib/Layout/AppList.js +40 -118
  104. package/lib/Layout/Application.js +26 -86
  105. package/lib/Layout/Avatar.js +35 -89
  106. package/lib/Layout/CompatibleLanguage.js +39 -110
  107. package/lib/Layout/EnterpriseLayout/Avatar.js +52 -101
  108. package/lib/Layout/EnterpriseLayout/Language.js +21 -49
  109. package/lib/Layout/EnterpriseLayout/Theme.js +22 -46
  110. package/lib/Layout/EnterpriseLayout/index.js +14 -23
  111. package/lib/Layout/GlobalNavigation/NavigationPopup.js +59 -186
  112. package/lib/Layout/GlobalNavigation/index.js +23 -74
  113. package/lib/Layout/Header.js +28 -63
  114. package/lib/Layout/HeaderActions.js +48 -74
  115. package/lib/Layout/HeaderNavs.js +23 -61
  116. package/lib/Layout/HeaderTabs.js +58 -126
  117. package/lib/Layout/Iconfont.js +1 -5
  118. package/lib/Layout/Language.js +17 -48
  119. package/lib/Layout/Layout.js +90 -128
  120. package/lib/Layout/Logo.js +19 -43
  121. package/lib/Layout/OrgAppList.js +64 -127
  122. package/lib/Layout/SideMenu.js +65 -143
  123. package/lib/Layout/Theme.js +23 -73
  124. package/lib/Layout/createActions.js +0 -5
  125. package/lib/Layout/images/index.js +0 -28
  126. package/lib/Layout/index.js +33 -57
  127. package/lib/Layout/paaslayout/CompactSideMenu.js +35 -84
  128. package/lib/Layout/paaslayout/Header.js +22 -55
  129. package/lib/Layout/paaslayout/Logo.js +3 -19
  130. package/lib/Layout/paaslayout/SideMenu.js +39 -87
  131. package/lib/Layout/paaslayout/index.js +77 -122
  132. package/lib/Layout/storage.js +29 -35
  133. package/lib/LoadingButton/index.js +15 -29
  134. package/lib/Modal/index.js +38 -53
  135. package/lib/Page/Box.js +34 -45
  136. package/lib/Page/index.js +54 -78
  137. package/lib/Page/utils.js +1 -9
  138. package/lib/QueryForm/Field/Checkbox.js +5 -13
  139. package/lib/QueryForm/Field/Select.js +33 -53
  140. package/lib/QueryForm/Field/SelectInput.js +28 -56
  141. package/lib/QueryForm/Field/fieldsMap.js +1 -15
  142. package/lib/QueryForm/Field/index.js +43 -81
  143. package/lib/QueryForm/createActions.js +6 -12
  144. package/lib/QueryForm/index.js +78 -157
  145. package/lib/QueryForm/useForm.js +0 -5
  146. package/lib/QueryListScene/List.js +76 -140
  147. package/lib/QueryListScene/QueryForm.js +46 -86
  148. package/lib/QueryListScene/QueryListScene.js +25 -46
  149. package/lib/QueryListScene/Title.js +3 -7
  150. package/lib/QueryListScene/Toolbar.js +11 -16
  151. package/lib/QueryListScene/createActions.js +0 -5
  152. package/lib/QueryListScene/index.js +0 -10
  153. package/lib/QueryListScene/useActions.js +0 -5
  154. package/lib/Select/DropDownWrap.js +31 -56
  155. package/lib/Select/index.js +135 -241
  156. package/lib/Table/ResizableTable/index.js +26 -48
  157. package/lib/Table/index.js +17 -28
  158. package/lib/Title/index.js +21 -28
  159. package/lib/index.js +35 -56
  160. package/lib/locale.js +11 -12
  161. package/lib/utils/checkAuth.js +4 -9
  162. package/lib/utils/findMenuInfoByPath.js +1 -8
  163. package/lib/utils/index.js +15 -42
  164. package/package.json +2 -2
  165. package/es/Layout/checkAuth.js +0 -29
  166. package/es/Layout/utils.js +0 -136
  167. package/lib/Layout/EnterpriseLayout/Header.js +0 -113
  168. package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
  169. package/lib/Layout/checkAuth.js +0 -39
  170. package/lib/Layout/utils.js +0 -166
@@ -1,76 +1,61 @@
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
-
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
-
4
+ 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, _toPropertyKey(descriptor.key), descriptor); } }
5
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ 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); }
8
+ 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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
10
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
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); }
13
12
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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
-
13
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
15
  import React from 'react';
22
16
  import cn from 'classnames';
23
17
  import Title from './Title';
24
18
  import Toolbar from './Toolbar';
25
19
  import createActions from './createActions';
26
-
27
- var QueryListScene =
28
- /*#__PURE__*/
29
- function (_React$Component) {
20
+ var QueryListScene = /*#__PURE__*/function (_React$Component) {
30
21
  _inherits(QueryListScene, _React$Component);
31
-
22
+ var _super = _createSuper(QueryListScene);
32
23
  function QueryListScene(props) {
33
24
  var _this;
34
-
35
25
  _classCallCheck(this, QueryListScene);
36
-
37
- _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryListScene).call(this, props));
26
+ _this = _super.call(this, props);
38
27
  _this.actions = props.actions || createActions();
39
28
  return _this;
40
29
  }
41
-
42
30
  _createClass(QueryListScene, [{
43
31
  key: "render",
44
32
  value: function render() {
45
33
  var _cn,
46
- _this2 = this;
47
-
34
+ _this2 = this;
48
35
  var _this$props = this.props,
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;
36
+ title = _this$props.title,
37
+ children = _this$props.children,
38
+ size = _this$props.size,
39
+ _this$props$className = _this$props.className,
40
+ className = _this$props$className === void 0 ? '' : _this$props$className;
54
41
  var hasToolbar = [].some.call(children || [], function (child) {
55
42
  return (child == null ? void 0 : child.type) === Toolbar;
56
43
  });
57
- return React.createElement("div", {
44
+ return /*#__PURE__*/React.createElement("div", {
58
45
  className: cn('tnt-querylistscene', (_cn = {}, _defineProperty(_cn, className, className), _defineProperty(_cn, 'large-size', size === 'large'), _defineProperty(_cn, "hasToolbar", hasToolbar), _cn))
59
- }, title && React.createElement(Title, {
46
+ }, title && /*#__PURE__*/React.createElement(Title, {
60
47
  title: title,
61
48
  size: size
62
- }), React.createElement("div", {
49
+ }), /*#__PURE__*/React.createElement("div", {
63
50
  className: "tnt-querylistscene-content"
64
51
  }, React.Children.map(children, function (child) {
65
- return child && React.cloneElement(child, {
52
+ return child && /*#__PURE__*/React.cloneElement(child, {
66
53
  qlsProps: _this2.props,
67
54
  actions: _this2.actions
68
55
  });
69
56
  })));
70
57
  }
71
58
  }]);
72
-
73
59
  return QueryListScene;
74
60
  }(React.Component);
75
-
76
61
  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
- children = _ref.children;
9
- return React.createElement("div", {
8
+ children = _ref.children;
9
+ return /*#__PURE__*/React.createElement("div", {
10
10
  className: "tnt-querylistscene-title"
11
- }, React.createElement("span", null, title), React.createElement("span", null, children));
11
+ }, /*#__PURE__*/React.createElement("span", null, title), /*#__PURE__*/React.createElement("span", null, children));
12
12
  });
@@ -1,20 +1,19 @@
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
-
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _excluded = ["className", "children", "actions", "qslProps"];
3
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
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); }
5
7
  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
-
7
8
  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
- 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, {
12
+ children = _ref.children,
13
+ actions = _ref.actions,
14
+ qslProps = _ref.qslProps,
15
+ rest = _objectWithoutProperties(_ref, _excluded);
16
+ return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
18
17
  className: cn('tnt-querylistscene-toolbar', _defineProperty({}, className, className))
19
18
  }), children);
20
19
  });
@@ -1,41 +1,27 @@
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
-
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
5
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
-
6
+ 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, _toPropertyKey(descriptor.key), descriptor); } }
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
+ 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); }
10
+ 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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
11
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
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); }
17
14
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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
-
15
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
16
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
25
17
  import React, { PureComponent } from 'react';
26
-
27
- var DropDownWrap =
28
- /*#__PURE__*/
29
- function (_PureComponent) {
18
+ var DropDownWrap = /*#__PURE__*/function (_PureComponent) {
30
19
  _inherits(DropDownWrap, _PureComponent);
31
-
20
+ var _super = _createSuper(DropDownWrap);
32
21
  function DropDownWrap(props) {
33
22
  var _this;
34
-
35
23
  _classCallCheck(this, DropDownWrap);
36
-
37
- _this = _possibleConstructorReturn(this, _getPrototypeOf(DropDownWrap).call(this, props));
38
-
24
+ _this = _super.call(this, props);
39
25
  _this.getItemStyle = function (i) {
40
26
  var itemHeight = _this.props.itemHeight;
41
27
  return {
@@ -45,7 +31,6 @@ function (_PureComponent) {
45
31
  width: '100%'
46
32
  };
47
33
  };
48
-
49
34
  _this.reactList = function (allHeight, startIndex, endIndex) {
50
35
  return _this.setState({
51
36
  allHeight: allHeight,
@@ -53,10 +38,9 @@ function (_PureComponent) {
53
38
  endIndex: endIndex
54
39
  });
55
40
  };
56
-
57
41
  var _allHeight = props.allHeight,
58
- _startIndex = props.startIndex,
59
- _endIndex = props.endIndex;
42
+ _startIndex = props.startIndex,
43
+ _endIndex = props.endIndex;
60
44
  _this.state = {
61
45
  allHeight: _allHeight,
62
46
  startIndex: _startIndex,
@@ -64,7 +48,6 @@ function (_PureComponent) {
64
48
  };
65
49
  return _this;
66
50
  }
67
-
68
51
  _createClass(DropDownWrap, [{
69
52
  key: "componentDidUpdate",
70
53
  value: function componentDidUpdate(prevProps) {
@@ -78,29 +61,27 @@ function (_PureComponent) {
78
61
  key: "render",
79
62
  value: function render() {
80
63
  var _this2 = this;
81
-
82
64
  var menu = this.props.menu;
83
65
  var _this$state = this.state,
84
- startIndex = _this$state.startIndex,
85
- endIndex = _this$state.endIndex,
86
- allHeight = _this$state.allHeight; // 截取 Select 下拉列表中需要显示的部分
66
+ startIndex = _this$state.startIndex,
67
+ endIndex = _this$state.endIndex,
68
+ allHeight = _this$state.allHeight;
87
69
 
88
- var cloneMenu = React.cloneElement(menu, {
70
+ // 截取 Select 下拉列表中需要显示的部分
71
+ var cloneMenu = /*#__PURE__*/React.cloneElement(menu, {
89
72
  menuItems: menu.props.menuItems.slice(startIndex, endIndex).map(function (item, i) {
90
73
  var realIndex = (startIndex || 0) + Number(i);
74
+ var style = _this2.getItemStyle(realIndex);
91
75
 
92
- var style = _this2.getItemStyle(realIndex); // 未搜到数据提示高度使用默认高度
93
-
94
-
76
+ // 未搜到数据提示高度使用默认高度
95
77
  if (item.key === 'NOT_FOUND') {
96
78
  delete style.height;
97
79
  }
98
-
99
- return React.cloneElement(item, {
100
- style: _objectSpread({}, item.props.style, {}, style)
80
+ return /*#__PURE__*/React.cloneElement(item, {
81
+ style: _objectSpread(_objectSpread({}, item.props.style), style)
101
82
  });
102
83
  }),
103
- dropdownMenuStyle: _objectSpread({}, menu.props.dropdownMenuStyle, {
84
+ dropdownMenuStyle: _objectSpread(_objectSpread({}, menu.props.dropdownMenuStyle), {}, {
104
85
  height: allHeight,
105
86
  maxHeight: allHeight,
106
87
  overflow: 'hidden'
@@ -109,8 +90,6 @@ function (_PureComponent) {
109
90
  return cloneMenu;
110
91
  }
111
92
  }]);
112
-
113
93
  return DropDownWrap;
114
94
  }(PureComponent);
115
-
116
95
  export { DropDownWrap as default };