tntd 1.4.27 → 1.4.29

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 (113) hide show
  1. package/babel.config.js +20 -20
  2. package/components/Handle/index.js +12 -5
  3. package/dist/stats.json +5278 -5260
  4. package/dist/tntd.js +1 -1
  5. package/es/ArrayInput/icon.js +3 -11
  6. package/es/ArrayInput/index.js +57 -67
  7. package/es/AuthContext.js +3 -13
  8. package/es/Columns/index.js +12 -24
  9. package/es/DevelopmentLogin/LoginModal.js +22 -29
  10. package/es/DevelopmentLogin/index.js +13 -29
  11. package/es/Ellipsis/Svg/CopySVG.js +2 -11
  12. package/es/Ellipsis/Svg/TickSVG.js +2 -11
  13. package/es/Ellipsis/index.js +25 -33
  14. package/es/Handle/index.js +41 -51
  15. package/es/Icon/fonts/iconfont.js +0 -2
  16. package/es/Icon/iconList.js +1 -8
  17. package/es/Icon/index.js +5 -25
  18. package/es/Img/Contain.js +8 -21
  19. package/es/Img/Cover.js +11 -29
  20. package/es/Img/index.js +8 -22
  21. package/es/Layout/ActionsContext.js +2 -12
  22. package/es/Layout/AppList.js +42 -58
  23. package/es/Layout/Application.js +24 -44
  24. package/es/Layout/Avatar.js +23 -45
  25. package/es/Layout/CompatibleLanguage.js +29 -51
  26. package/es/Layout/EnterpriseLayout/Avatar.js +32 -54
  27. package/es/Layout/EnterpriseLayout/Language.js +15 -39
  28. package/es/Layout/EnterpriseLayout/Theme.js +15 -31
  29. package/es/Layout/EnterpriseLayout/index.js +9 -24
  30. package/es/Layout/GlobalNavigation/NavigationPopup.js +29 -53
  31. package/es/Layout/GlobalNavigation/index.js +23 -51
  32. package/es/Layout/Header.js +19 -40
  33. package/es/Layout/HeaderActions.js +19 -43
  34. package/es/Layout/HeaderNavs.js +12 -35
  35. package/es/Layout/HeaderTabs.js +25 -50
  36. package/es/Layout/Iconfont.js +4 -16
  37. package/es/Layout/Language.js +14 -38
  38. package/es/Layout/Layout.js +32 -58
  39. package/es/Layout/Logo.js +12 -26
  40. package/es/Layout/OrgAppList.js +36 -52
  41. package/es/Layout/SideMenu.js +32 -57
  42. package/es/Layout/Theme.js +21 -39
  43. package/es/Layout/createActions.js +6 -19
  44. package/es/Layout/images/index.js +58 -95
  45. package/es/Layout/index.js +28 -70
  46. package/es/Layout/paaslayout/CompactSideMenu.js +17 -35
  47. package/es/Layout/paaslayout/Header.js +17 -31
  48. package/es/Layout/paaslayout/Logo.js +9 -19
  49. package/es/Layout/paaslayout/SideMenu.js +12 -29
  50. package/es/Layout/paaslayout/index.js +32 -58
  51. package/es/Layout/storage.js +21 -71
  52. package/es/LoadingButton/index.js +8 -17
  53. package/es/Modal/index.js +16 -29
  54. package/es/Page/Box.js +8 -18
  55. package/es/Page/index.js +29 -47
  56. package/es/Page/utils.js +1 -12
  57. package/es/QueryForm/Field/Checkbox.js +5 -13
  58. package/es/QueryForm/Field/Select.js +12 -28
  59. package/es/QueryForm/Field/SelectInput.js +18 -33
  60. package/es/QueryForm/Field/fieldsMap.js +23 -36
  61. package/es/QueryForm/Field/index.js +12 -25
  62. package/es/QueryForm/createActions.js +7 -20
  63. package/es/QueryForm/index.js +50 -66
  64. package/es/QueryForm/useForm.js +4 -16
  65. package/es/QueryListScene/List.js +30 -43
  66. package/es/QueryListScene/QueryForm.js +9 -21
  67. package/es/QueryListScene/QueryListScene.js +16 -29
  68. package/es/QueryListScene/Title.js +5 -17
  69. package/es/QueryListScene/Toolbar.js +4 -16
  70. package/es/QueryListScene/createActions.js +13 -26
  71. package/es/QueryListScene/index.js +19 -40
  72. package/es/QueryListScene/useActions.js +4 -16
  73. package/es/Select/DropDownWrap.js +6 -18
  74. package/es/Select/index.js +15 -28
  75. package/es/Table/ResizableTable/index.js +18 -32
  76. package/es/Table/index.js +11 -30
  77. package/es/Title/index.js +5 -18
  78. package/es/index.js +20 -193
  79. package/es/locale.js +8 -27
  80. package/es/utils/checkAuth.js +4 -15
  81. package/es/utils/findMenuInfoByPath.js +5 -16
  82. package/es/utils/index.js +10 -70
  83. package/lib/ArrayInput/index.js +28 -12
  84. package/lib/Columns/index.js +10 -4
  85. package/lib/DevelopmentLogin/LoginModal.js +23 -9
  86. package/lib/Ellipsis/index.js +10 -4
  87. package/lib/Handle/index.js +32 -15
  88. package/lib/Layout/AppList.js +30 -12
  89. package/lib/Layout/Application.js +5 -3
  90. package/lib/Layout/Avatar.js +12 -6
  91. package/lib/Layout/CompatibleLanguage.js +5 -3
  92. package/lib/Layout/EnterpriseLayout/Avatar.js +18 -8
  93. package/lib/Layout/EnterpriseLayout/Theme.js +5 -3
  94. package/lib/Layout/HeaderActions.js +7 -5
  95. package/lib/Layout/Layout.js +9 -7
  96. package/lib/Layout/OrgAppList.js +19 -7
  97. package/lib/Layout/SideMenu.js +9 -7
  98. package/lib/Layout/Theme.js +5 -3
  99. package/lib/Layout/paaslayout/index.js +10 -8
  100. package/lib/LoadingButton/index.js +6 -2
  101. package/lib/Modal/index.js +5 -3
  102. package/lib/Page/Box.js +5 -3
  103. package/lib/QueryForm/Field/Checkbox.js +6 -2
  104. package/lib/QueryForm/Field/Select.js +8 -4
  105. package/lib/QueryForm/Field/SelectInput.js +13 -5
  106. package/lib/QueryForm/Field/fieldsMap.js +18 -8
  107. package/lib/QueryForm/Field/index.js +7 -3
  108. package/lib/QueryForm/index.js +27 -13
  109. package/lib/QueryListScene/List.js +7 -5
  110. package/lib/Select/index.js +14 -8
  111. package/lib/Table/ResizableTable/index.js +5 -3
  112. package/lib/Table/index.js +7 -5
  113. package/package.json +1 -1
package/babel.config.js CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  const presets = [
7
- "@babel/preset-env",
7
+ "@babel/env",
8
8
  "@babel/preset-react"
9
9
 
10
10
  ];
@@ -31,26 +31,26 @@ const plugins = [
31
31
  // ['babel-plugin-styless']
32
32
  ];
33
33
 
34
- // const isES = process.env.BUILD_ENV === 'es';
34
+ const isES = process.env.BUILD_ENV === 'es';
35
35
 
36
- // if (isES) {
37
- // presets[0] = [
38
- // presets[0],
39
- // {
40
- // modules: false
41
- // }
42
- // ];
43
- // }
36
+ if (isES) {
37
+ presets[0] = [
38
+ presets[0],
39
+ {
40
+ modules: false
41
+ }
42
+ ];
43
+ }
44
44
 
45
- // if (process.env.BUILD_ENV !== 'umd' && !process.env.WEBPACK_DEV_SERVER) {
46
- // plugins.push([
47
- // 'import',
48
- // {
49
- // libraryName: 'antd',
50
- // // libraryDirectory: isES ? 'es' : 'lib',
51
- // style: true,
52
- // }
53
- // ]);
54
- // }
45
+ if (process.env.BUILD_ENV !== 'umd' && !process.env.WEBPACK_DEV_SERVER) {
46
+ plugins.push([
47
+ 'import',
48
+ {
49
+ libraryName: 'antd',
50
+ // libraryDirectory: isES ? 'es' : 'lib',
51
+ style: true,
52
+ }
53
+ ]);
54
+ }
55
55
 
56
56
  module.exports = { presets, plugins };
@@ -1,4 +1,4 @@
1
- import React, { Fragment } from 'react';
1
+ import React, { Fragment, useRef } from 'react';
2
2
  import { Dropdown, Menu, Divider } from 'antd';
3
3
  import { getText, getLanguage } from '../locale';
4
4
  import Icon from '../Icon';
@@ -8,10 +8,10 @@ const clsPrefix = 'tnt-more-menus';
8
8
 
9
9
  export default props => {
10
10
  const { children = [], type, num = 3, divider = true, lessOneMoreFit, popConfirmHandle, ...rest } = props || {};
11
- let { lang } = props||{};
12
- if(!lang){
13
- lang = getLanguage();
14
- }
11
+ let { lang:propsLang } = props||{};
12
+ const langRef = useRef(propsLang || getLanguage());
13
+ const lang = langRef?.current;
14
+
15
15
  let newChildren = [];
16
16
  if(Array.isArray(children)){
17
17
  newChildren = children?.filter(item => !!item) || [];
@@ -23,10 +23,17 @@ export default props => {
23
23
  newChildren?.forEach((v,i)=>{
24
24
  const { type, props } = v;
25
25
  if(type?.name === 'Popconfirm' || (props.hasOwnProperty('onConfirm') && typeof props?.onConfirm === 'function')){
26
+ let placement ={};
27
+ if(lang === 'en' || (num && !isNaN(num) && (i+1) > num && !(lessOneMoreFit && newChildren.length - num === 1))){
28
+ placement = {
29
+ placement:'left'
30
+ };
31
+ }
26
32
  newChildren[i]= React.cloneElement(v, {
27
33
  overlayStyle: { width: 180 },
28
34
  ...(v?.props || {}),
29
35
  onClick:(e) => e.stopPropagation(),
36
+ ...placement,
30
37
  trigger:'hover',
31
38
  getPopupContainer:(trigger) => trigger.parentNode,
32
39
  });