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