tntd 1.4.32 → 1.4.33-beta.1

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 (157) hide show
  1. package/components/Ellipsis/index.js +47 -15
  2. package/components/QueryListScene/QueryForm.js +4 -4
  3. package/components/QueryListScene/createActions.js +4 -4
  4. package/dist/1.tntd.js +1 -1
  5. package/dist/stats.json +24089 -23289
  6. package/dist/tntd.css +1 -1
  7. package/dist/tntd.js +7 -10
  8. package/es/ArrayInput/icon.js +5 -5
  9. package/es/ArrayInput/index.js +79 -111
  10. package/es/AuthContext.js +1 -1
  11. package/es/Columns/index.js +33 -40
  12. package/es/DevelopmentLogin/LoginModal.js +33 -46
  13. package/es/DevelopmentLogin/index.js +14 -18
  14. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  15. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  16. package/es/Ellipsis/index.js +100 -79
  17. package/es/Handle/index.js +46 -64
  18. package/es/Icon/fonts/iconfont.js +7 -12
  19. package/es/Icon/index.js +12 -15
  20. package/es/Img/Contain.js +26 -31
  21. package/es/Img/Cover.js +43 -57
  22. package/es/Img/index.js +39 -48
  23. package/es/Layout/ActionsContext.js +3 -2
  24. package/es/Layout/AppList.js +39 -94
  25. package/es/Layout/Application.js +28 -74
  26. package/es/Layout/Avatar.js +30 -67
  27. package/es/Layout/CompatibleLanguage.js +41 -96
  28. package/es/Layout/EnterpriseLayout/Avatar.js +39 -77
  29. package/es/Layout/EnterpriseLayout/Language.js +16 -34
  30. package/es/Layout/EnterpriseLayout/Theme.js +18 -36
  31. package/es/Layout/EnterpriseLayout/index.js +14 -16
  32. package/es/Layout/GlobalNavigation/NavigationPopup.js +61 -172
  33. package/es/Layout/GlobalNavigation/index.js +22 -56
  34. package/es/Layout/Header.js +26 -47
  35. package/es/Layout/HeaderActions.js +45 -59
  36. package/es/Layout/HeaderNavs.js +24 -51
  37. package/es/Layout/HeaderTabs.js +53 -106
  38. package/es/Layout/Iconfont.js +1 -1
  39. package/es/Layout/Language.js +16 -34
  40. package/es/Layout/Layout.js +88 -110
  41. package/es/Layout/Logo.js +17 -33
  42. package/es/Layout/OrgAppList.js +64 -109
  43. package/es/Layout/SideMenu.js +67 -128
  44. package/es/Layout/Theme.js +25 -63
  45. package/es/Layout/index.js +28 -37
  46. package/es/Layout/paaslayout/CompactSideMenu.js +37 -76
  47. package/es/Layout/paaslayout/Header.js +23 -46
  48. package/es/Layout/paaslayout/Logo.js +4 -14
  49. package/es/Layout/paaslayout/SideMenu.js +41 -80
  50. package/es/Layout/paaslayout/index.js +77 -104
  51. package/es/Layout/storage.js +10 -9
  52. package/es/LoadingButton/index.js +18 -27
  53. package/es/Modal/index.js +42 -51
  54. package/es/Page/Box.js +36 -43
  55. package/es/Page/index.js +56 -71
  56. package/es/Page/utils.js +0 -5
  57. package/es/QueryForm/Field/Checkbox.js +7 -11
  58. package/es/QueryForm/Field/Select.js +34 -44
  59. package/es/QueryForm/Field/SelectInput.js +31 -46
  60. package/es/QueryForm/Field/fieldsMap.js +0 -1
  61. package/es/QueryForm/Field/index.js +46 -78
  62. package/es/QueryForm/createActions.js +6 -7
  63. package/es/QueryForm/index.js +79 -140
  64. package/es/QueryListScene/List.js +83 -139
  65. package/es/QueryListScene/QueryForm.js +54 -91
  66. package/es/QueryListScene/QueryListScene.js +29 -47
  67. package/es/QueryListScene/Title.js +3 -3
  68. package/es/QueryListScene/Toolbar.js +13 -14
  69. package/es/QueryListScene/createActions.js +4 -4
  70. package/es/Select/DropDownWrap.js +32 -55
  71. package/es/Select/index.js +140 -232
  72. package/es/Table/ResizableTable/index.js +29 -43
  73. package/es/Table/index.js +20 -19
  74. package/es/Title/index.js +23 -25
  75. package/es/locale.js +1 -5
  76. package/es/utils/checkAuth.js +6 -8
  77. package/es/utils/findMenuInfoByPath.js +0 -4
  78. package/es/utils/index.js +17 -27
  79. package/lib/ArrayInput/icon.js +7 -9
  80. package/lib/ArrayInput/index.js +82 -131
  81. package/lib/AuthContext.js +2 -6
  82. package/lib/Columns/index.js +36 -54
  83. package/lib/DevelopmentLogin/LoginModal.js +36 -63
  84. package/lib/DevelopmentLogin/index.js +21 -31
  85. package/lib/Ellipsis/Svg/CopySVG.js +15 -18
  86. package/lib/Ellipsis/Svg/TickSVG.js +10 -13
  87. package/lib/Ellipsis/index.js +105 -93
  88. package/lib/Handle/index.js +51 -87
  89. package/lib/Icon/fonts/iconfont.js +7 -12
  90. package/lib/Icon/iconList.js +1 -2
  91. package/lib/Icon/index.js +16 -26
  92. package/lib/Img/Contain.js +29 -40
  93. package/lib/Img/Cover.js +48 -72
  94. package/lib/Img/index.js +42 -58
  95. package/lib/Layout/ActionsContext.js +1 -5
  96. package/lib/Layout/AppList.js +45 -124
  97. package/lib/Layout/Application.js +31 -92
  98. package/lib/Layout/Avatar.js +36 -91
  99. package/lib/Layout/CompatibleLanguage.js +44 -116
  100. package/lib/Layout/EnterpriseLayout/Avatar.js +45 -105
  101. package/lib/Layout/EnterpriseLayout/Language.js +22 -54
  102. package/lib/Layout/EnterpriseLayout/Theme.js +21 -50
  103. package/lib/Layout/EnterpriseLayout/index.js +17 -27
  104. package/lib/Layout/GlobalNavigation/NavigationPopup.js +64 -192
  105. package/lib/Layout/GlobalNavigation/index.js +28 -80
  106. package/lib/Layout/Header.js +36 -68
  107. package/lib/Layout/HeaderActions.js +51 -81
  108. package/lib/Layout/HeaderNavs.js +30 -70
  109. package/lib/Layout/HeaderTabs.js +58 -127
  110. package/lib/Layout/Iconfont.js +4 -9
  111. package/lib/Layout/Language.js +22 -54
  112. package/lib/Layout/Layout.js +93 -134
  113. package/lib/Layout/Logo.js +26 -47
  114. package/lib/Layout/OrgAppList.js +69 -133
  115. package/lib/Layout/SideMenu.js +72 -151
  116. package/lib/Layout/Theme.js +28 -79
  117. package/lib/Layout/createActions.js +3 -9
  118. package/lib/Layout/images/index.js +5 -36
  119. package/lib/Layout/index.js +35 -63
  120. package/lib/Layout/paaslayout/CompactSideMenu.js +40 -90
  121. package/lib/Layout/paaslayout/Header.js +30 -60
  122. package/lib/Layout/paaslayout/Logo.js +11 -24
  123. package/lib/Layout/paaslayout/SideMenu.js +44 -93
  124. package/lib/Layout/paaslayout/index.js +82 -128
  125. package/lib/Layout/storage.js +26 -68
  126. package/lib/LoadingButton/index.js +21 -36
  127. package/lib/Modal/index.js +45 -62
  128. package/lib/Page/Box.js +38 -50
  129. package/lib/Page/index.js +58 -84
  130. package/lib/Page/utils.js +5 -16
  131. package/lib/QueryForm/Field/Checkbox.js +10 -19
  132. package/lib/QueryForm/Field/Select.js +39 -60
  133. package/lib/QueryForm/Field/SelectInput.js +36 -65
  134. package/lib/QueryForm/Field/fieldsMap.js +6 -23
  135. package/lib/QueryForm/Field/index.js +50 -91
  136. package/lib/QueryForm/createActions.js +9 -16
  137. package/lib/QueryForm/index.js +83 -165
  138. package/lib/QueryForm/useForm.js +1 -6
  139. package/lib/QueryListScene/List.js +89 -153
  140. package/lib/QueryListScene/QueryForm.js +58 -101
  141. package/lib/QueryListScene/QueryListScene.js +31 -56
  142. package/lib/QueryListScene/Title.js +6 -11
  143. package/lib/QueryListScene/Toolbar.js +16 -22
  144. package/lib/QueryListScene/createActions.js +7 -13
  145. package/lib/QueryListScene/index.js +5 -19
  146. package/lib/QueryListScene/useActions.js +1 -6
  147. package/lib/Select/DropDownWrap.js +35 -63
  148. package/lib/Select/index.js +142 -245
  149. package/lib/Table/ResizableTable/index.js +31 -54
  150. package/lib/Table/index.js +21 -34
  151. package/lib/Title/index.js +26 -34
  152. package/lib/index.js +36 -57
  153. package/lib/locale.js +9 -25
  154. package/lib/utils/checkAuth.js +9 -16
  155. package/lib/utils/findMenuInfoByPath.js +3 -12
  156. package/lib/utils/index.js +26 -60
  157. package/package.json +3 -2
@@ -1,22 +1,19 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1
2
  import "antd/lib/dropdown/style";
2
3
  import _Dropdown from "antd/lib/dropdown";
3
4
  import "antd/lib/menu/style";
4
5
  import _Menu from "antd/lib/menu";
5
6
  import "antd/lib/divider/style";
6
7
  import _Divider from "antd/lib/divider";
7
-
8
- 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); }
9
-
10
- 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; }
11
-
12
- 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; }
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
-
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
-
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
-
8
+ var _excluded = ["children", "type", "num", "divider", "lessOneMoreFit", "popConfirmHandle", "isIconBtn"];
9
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
10
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
16
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
20
17
  import React, { Fragment, useRef } from 'react';
21
18
  import { getText, getLanguage } from '../locale';
22
19
  import Icon from '../Icon';
@@ -24,63 +21,54 @@ import './index.less';
24
21
  var clsPrefix = 'tnt-more-menus';
25
22
  export default (function (props) {
26
23
  var _newChildren, _lastChildPart2;
27
-
28
24
  var _ref = props || {},
29
- _ref$children = _ref.children,
30
- children = _ref$children === void 0 ? [] : _ref$children,
31
- type = _ref.type,
32
- _ref$num = _ref.num,
33
- num = _ref$num === void 0 ? 3 : _ref$num,
34
- _ref$divider = _ref.divider,
35
- divider = _ref$divider === void 0 ? true : _ref$divider,
36
- lessOneMoreFit = _ref.lessOneMoreFit,
37
- popConfirmHandle = _ref.popConfirmHandle,
38
- isIconBtn = _ref.isIconBtn,
39
- rest = _objectWithoutProperties(_ref, ["children", "type", "num", "divider", "lessOneMoreFit", "popConfirmHandle", "isIconBtn"]);
40
-
25
+ _ref$children = _ref.children,
26
+ children = _ref$children === void 0 ? [] : _ref$children,
27
+ type = _ref.type,
28
+ _ref$num = _ref.num,
29
+ num = _ref$num === void 0 ? 3 : _ref$num,
30
+ _ref$divider = _ref.divider,
31
+ divider = _ref$divider === void 0 ? true : _ref$divider,
32
+ lessOneMoreFit = _ref.lessOneMoreFit,
33
+ popConfirmHandle = _ref.popConfirmHandle,
34
+ isIconBtn = _ref.isIconBtn,
35
+ rest = _objectWithoutProperties(_ref, _excluded);
41
36
  var _ref2 = props || {},
42
- propsLang = _ref2.lang;
43
-
37
+ propsLang = _ref2.lang;
44
38
  var langRef = useRef(propsLang || getLanguage());
45
39
  var lang = langRef == null ? void 0 : langRef.current;
46
40
  var newChildren = [];
47
-
48
41
  if (Array.isArray(children)) {
49
42
  newChildren = (children == null ? void 0 : children.filter(function (item) {
50
43
  return !!item;
51
44
  })) || [];
52
45
  } else if (children) {
53
46
  newChildren.push(children);
54
- } // 子元素大于1个,且不是 icon元素
55
-
47
+ }
56
48
 
49
+ // 子元素大于1个,且不是 icon元素
57
50
  var specialSceneDefaultShow = ((_newChildren = newChildren) == null ? void 0 : _newChildren.length) > 1 && !isIconBtn;
58
-
59
51
  if (specialSceneDefaultShow && (lang === 'en' || popConfirmHandle)) {
60
52
  var _newChildren2;
61
-
62
53
  (_newChildren2 = newChildren) == null ? void 0 : _newChildren2.forEach(function (v, i) {
63
54
  var type = v.type,
64
- props = v.props;
65
-
55
+ props = v.props;
66
56
  if ((type == null ? void 0 : type.name) === 'Popconfirm' || props.hasOwnProperty('onConfirm') && typeof (props == null ? void 0 : props.onConfirm) === 'function') {
67
57
  var placement = {};
68
-
69
58
  if (lang === 'en' || num && !isNaN(num) && i + 1 > num && !(lessOneMoreFit && newChildren.length - num === 1)) {
70
59
  placement = {
71
60
  placement: 'left'
72
61
  };
73
62
  }
74
-
75
- newChildren[i] = React.cloneElement(v, _objectSpread({
63
+ newChildren[i] = /*#__PURE__*/React.cloneElement(v, _objectSpread(_objectSpread(_objectSpread({
76
64
  overlayStyle: {
77
65
  width: 180
78
66
  }
79
- }, (v == null ? void 0 : v.props) || {}, {
67
+ }, (v == null ? void 0 : v.props) || {}), {}, {
80
68
  onClick: function onClick(e) {
81
69
  return e.stopPropagation();
82
70
  }
83
- }, placement, {
71
+ }, placement), {}, {
84
72
  trigger: 'hover',
85
73
  getPopupContainer: function getPopupContainer(trigger) {
86
74
  return trigger.parentNode;
@@ -89,72 +77,66 @@ export default (function (props) {
89
77
  }
90
78
  });
91
79
  }
92
-
93
80
  var preChildPart = newChildren,
94
- lastChildPart = null; // 只有1个时不适配
81
+ lastChildPart = null;
95
82
 
83
+ // 只有1个时不适配
96
84
  if (lessOneMoreFit && newChildren.length - num === 1) {
97
85
  preChildPart = newChildren;
98
86
  } else if (newChildren && num && !isNaN(num) && newChildren.length > num) {
99
87
  preChildPart = newChildren.slice(0, num);
100
88
  lastChildPart = newChildren.slice(num);
101
89
  }
102
-
103
90
  ;
104
-
105
91
  if (divider && preChildPart) {
106
92
  var preChildLen = preChildPart.length;
107
93
  preChildPart = preChildPart.map(function (dom, i) {
108
94
  var _lastChildPart;
109
-
110
- return React.createElement(Fragment, {
95
+ return /*#__PURE__*/React.createElement(Fragment, {
111
96
  key: i
112
- }, dom, !(i === preChildLen - 1 && !((_lastChildPart = lastChildPart) == null ? void 0 : _lastChildPart.length) // 没有更多 且 是最后一个时 不显示 Divider
113
- ) && React.createElement(_Divider, {
97
+ }, dom, !(i === preChildLen - 1 && !((_lastChildPart = lastChildPart) != null && _lastChildPart.length) // 没有更多 且 是最后一个时 不显示 Divider
98
+ ) && /*#__PURE__*/React.createElement(_Divider, {
114
99
  type: "vertical"
115
100
  }));
116
101
  });
117
102
  }
118
-
119
103
  var menu = function menu(childArr) {
120
- return React.createElement(_Menu, {
104
+ return /*#__PURE__*/React.createElement(_Menu, {
121
105
  className: "org-pop-opera-btn"
122
106
  }, childArr == null ? void 0 : childArr.map(function (child, i) {
123
- return React.createElement(_Menu.Item, {
107
+ return /*#__PURE__*/React.createElement(_Menu.Item, {
124
108
  key: i
125
109
  }, child);
126
110
  }));
127
111
  };
128
-
129
112
  if (lang === 'en' && specialSceneDefaultShow) {
130
- return React.createElement(_Dropdown, {
113
+ return /*#__PURE__*/React.createElement(_Dropdown, {
131
114
  overlay: menu(newChildren || []),
132
115
  arrow: true
133
- }, type === 'icon' ? React.createElement(Icon, {
116
+ }, type === 'icon' ? /*#__PURE__*/React.createElement(Icon, {
134
117
  type: "more"
135
- }) : React.createElement("a", {
118
+ }) : /*#__PURE__*/React.createElement("a", {
136
119
  className: "ant-dropdown-more"
137
- }, getText('handleMore', lang), React.createElement("i", {
120
+ }, getText('handleMore', lang), /*#__PURE__*/React.createElement("i", {
138
121
  className: "".concat(clsPrefix, "-dropdown-icon")
139
- }, React.createElement(Icon, {
122
+ }, /*#__PURE__*/React.createElement(Icon, {
140
123
  type: "down"
141
124
  }))));
142
125
  }
143
-
144
- return React.createElement("div", _extends({
126
+ return /*#__PURE__*/React.createElement("div", _extends({
145
127
  onClick: function onClick(e) {
146
128
  e.stopPropagation();
147
129
  }
148
- }, rest), preChildPart, !!((_lastChildPart2 = lastChildPart) == null ? void 0 : _lastChildPart2.length) && React.createElement(_Dropdown, {
130
+ }, rest), preChildPart, !!((_lastChildPart2 = lastChildPart) != null && _lastChildPart2.length) && /*#__PURE__*/React.createElement(_Dropdown, {
149
131
  overlay: menu(lastChildPart || []),
150
132
  arrow: true
151
- }, type === 'icon' ? React.createElement(Icon, {
133
+ }, type === 'icon' ? /*#__PURE__*/React.createElement(Icon, {
152
134
  type: "more"
153
- }) : React.createElement("a", {
135
+ }) : /*#__PURE__*/React.createElement("a", {
154
136
  className: "ant-dropdown-more"
155
- }, getText('handleMore', lang), React.createElement("i", {
137
+ }, getText('handleMore', lang), /*#__PURE__*/React.createElement("i", {
156
138
  className: "".concat(clsPrefix, "-dropdown-icon")
157
- }, React.createElement(Icon, {
139
+ }, /*#__PURE__*/React.createElement(Icon, {
158
140
  type: "down"
159
141
  })))));
160
142
  });