tntd 1.4.20 → 1.4.21

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 (163) hide show
  1. package/components/Handle/README.md +0 -20
  2. package/components/Handle/index.js +27 -6
  3. package/components/locale.js +8 -2
  4. package/dist/1.tntd.js +1 -1
  5. package/dist/stats.json +23819 -24067
  6. package/dist/tntd.css +1 -1
  7. package/dist/tntd.js +13 -8
  8. package/es/ArrayInput/icon.js +5 -5
  9. package/es/ArrayInput/index.js +108 -76
  10. package/es/AuthContext.js +1 -1
  11. package/es/Columns/index.js +38 -31
  12. package/es/DevelopmentLogin/LoginModal.js +45 -32
  13. package/es/DevelopmentLogin/index.js +17 -13
  14. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  15. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  16. package/es/Ellipsis/index.js +69 -58
  17. package/es/Handle/README.md +0 -20
  18. package/es/Handle/index.js +67 -32
  19. package/es/Icon/fonts/iconfont.js +12 -7
  20. package/es/Icon/index.js +13 -10
  21. package/es/Img/Contain.js +29 -24
  22. package/es/Img/Cover.js +54 -40
  23. package/es/Img/index.js +45 -36
  24. package/es/Layout/ActionsContext.js +2 -3
  25. package/es/Layout/AppList.js +92 -37
  26. package/es/Layout/Application.js +72 -26
  27. package/es/Layout/Avatar.js +66 -29
  28. package/es/Layout/CompatibleLanguage.js +94 -39
  29. package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
  30. package/es/Layout/EnterpriseLayout/Language.js +32 -14
  31. package/es/Layout/EnterpriseLayout/Theme.js +34 -16
  32. package/es/Layout/EnterpriseLayout/index.js +16 -14
  33. package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
  34. package/es/Layout/GlobalNavigation/index.js +54 -20
  35. package/es/Layout/Header.js +46 -25
  36. package/es/Layout/HeaderActions.js +56 -42
  37. package/es/Layout/HeaderNavs.js +47 -20
  38. package/es/Layout/HeaderTabs.js +102 -49
  39. package/es/Layout/Iconfont.js +1 -1
  40. package/es/Layout/Language.js +32 -14
  41. package/es/Layout/Layout.js +108 -86
  42. package/es/Layout/Logo.js +32 -16
  43. package/es/Layout/OrgAppList.js +107 -62
  44. package/es/Layout/SideMenu.js +124 -63
  45. package/es/Layout/Theme.js +61 -23
  46. package/es/Layout/checkAuth.js +29 -0
  47. package/es/Layout/index.js +34 -26
  48. package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
  49. package/es/Layout/paaslayout/Header.js +45 -22
  50. package/es/Layout/paaslayout/Logo.js +13 -3
  51. package/es/Layout/paaslayout/SideMenu.js +78 -39
  52. package/es/Layout/paaslayout/index.js +102 -75
  53. package/es/Layout/storage.js +9 -10
  54. package/es/Layout/utils.js +136 -0
  55. package/es/LoadingButton/index.js +24 -15
  56. package/es/Modal/index.js +46 -38
  57. package/es/Page/Box.js +41 -34
  58. package/es/Page/index.js +67 -52
  59. package/es/Page/utils.js +5 -0
  60. package/es/QueryForm/Field/Checkbox.js +9 -5
  61. package/es/QueryForm/Field/Select.js +41 -31
  62. package/es/QueryForm/Field/SelectInput.js +41 -26
  63. package/es/QueryForm/Field/fieldsMap.js +1 -0
  64. package/es/QueryForm/Field/index.js +71 -41
  65. package/es/QueryForm/createActions.js +7 -6
  66. package/es/QueryForm/index.js +135 -76
  67. package/es/QueryListScene/List.js +128 -74
  68. package/es/QueryListScene/QueryForm.js +81 -46
  69. package/es/QueryListScene/QueryListScene.js +40 -25
  70. package/es/QueryListScene/Title.js +3 -3
  71. package/es/QueryListScene/Toolbar.js +12 -11
  72. package/es/Select/DropDownWrap.js +50 -29
  73. package/es/Select/index.js +231 -135
  74. package/es/Table/ResizableTable/index.js +40 -26
  75. package/es/Table/index.js +16 -18
  76. package/es/Title/index.js +23 -21
  77. package/es/locale.js +11 -3
  78. package/es/utils/checkAuth.js +5 -3
  79. package/es/utils/findMenuInfoByPath.js +4 -0
  80. package/es/utils/index.js +23 -12
  81. package/lib/ArrayInput/icon.js +6 -6
  82. package/lib/ArrayInput/index.js +127 -78
  83. package/lib/AuthContext.js +4 -1
  84. package/lib/Columns/index.js +47 -31
  85. package/lib/DevelopmentLogin/LoginModal.js +58 -32
  86. package/lib/DevelopmentLogin/index.js +27 -16
  87. package/lib/Ellipsis/Svg/CopySVG.js +15 -13
  88. package/lib/Ellipsis/Svg/TickSVG.js +10 -8
  89. package/lib/Ellipsis/index.js +80 -57
  90. package/lib/Handle/README.md +0 -20
  91. package/lib/Handle/index.js +80 -32
  92. package/lib/Icon/fonts/iconfont.js +12 -7
  93. package/lib/Icon/index.js +20 -11
  94. package/lib/Img/Contain.js +34 -24
  95. package/lib/Img/Cover.js +65 -42
  96. package/lib/Img/index.js +51 -36
  97. package/lib/Layout/ActionsContext.js +4 -1
  98. package/lib/Layout/AppList.js +118 -40
  99. package/lib/Layout/Application.js +86 -26
  100. package/lib/Layout/Avatar.js +86 -32
  101. package/lib/Layout/CompatibleLanguage.js +110 -39
  102. package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
  103. package/lib/Layout/EnterpriseLayout/Header.js +113 -0
  104. package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
  105. package/lib/Layout/EnterpriseLayout/Language.js +48 -17
  106. package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
  107. package/lib/Layout/EnterpriseLayout/index.js +23 -14
  108. package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
  109. package/lib/Layout/GlobalNavigation/index.js +74 -23
  110. package/lib/Layout/Header.js +63 -28
  111. package/lib/Layout/HeaderActions.js +74 -45
  112. package/lib/Layout/HeaderNavs.js +61 -23
  113. package/lib/Layout/HeaderTabs.js +118 -51
  114. package/lib/Layout/Iconfont.js +5 -1
  115. package/lib/Layout/Language.js +48 -17
  116. package/lib/Layout/Layout.js +128 -88
  117. package/lib/Layout/Logo.js +43 -19
  118. package/lib/Layout/OrgAppList.js +127 -64
  119. package/lib/Layout/SideMenu.js +143 -65
  120. package/lib/Layout/Theme.js +73 -23
  121. package/lib/Layout/checkAuth.js +39 -0
  122. package/lib/Layout/createActions.js +5 -0
  123. package/lib/Layout/images/index.js +28 -0
  124. package/lib/Layout/index.js +55 -30
  125. package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
  126. package/lib/Layout/paaslayout/Header.js +55 -22
  127. package/lib/Layout/paaslayout/Logo.js +19 -3
  128. package/lib/Layout/paaslayout/SideMenu.js +87 -39
  129. package/lib/Layout/paaslayout/index.js +122 -77
  130. package/lib/Layout/storage.js +40 -11
  131. package/lib/Layout/utils.js +166 -0
  132. package/lib/LoadingButton/index.js +29 -15
  133. package/lib/Modal/index.js +53 -38
  134. package/lib/Page/Box.js +45 -34
  135. package/lib/Page/index.js +77 -52
  136. package/lib/Page/utils.js +9 -1
  137. package/lib/QueryForm/Field/Checkbox.js +13 -5
  138. package/lib/QueryForm/Field/Select.js +53 -33
  139. package/lib/QueryForm/Field/SelectInput.js +56 -28
  140. package/lib/QueryForm/Field/fieldsMap.js +15 -1
  141. package/lib/QueryForm/Field/index.js +81 -43
  142. package/lib/QueryForm/createActions.js +12 -6
  143. package/lib/QueryForm/index.js +157 -78
  144. package/lib/QueryForm/useForm.js +5 -0
  145. package/lib/QueryListScene/List.js +140 -76
  146. package/lib/QueryListScene/QueryForm.js +86 -46
  147. package/lib/QueryListScene/QueryListScene.js +46 -25
  148. package/lib/QueryListScene/Title.js +7 -3
  149. package/lib/QueryListScene/Toolbar.js +16 -11
  150. package/lib/QueryListScene/createActions.js +5 -0
  151. package/lib/QueryListScene/index.js +10 -0
  152. package/lib/QueryListScene/useActions.js +5 -0
  153. package/lib/Select/DropDownWrap.js +56 -31
  154. package/lib/Select/index.js +241 -135
  155. package/lib/Table/ResizableTable/index.js +48 -26
  156. package/lib/Table/index.js +28 -17
  157. package/lib/Title/index.js +28 -21
  158. package/lib/index.js +56 -35
  159. package/lib/locale.js +19 -4
  160. package/lib/utils/checkAuth.js +9 -4
  161. package/lib/utils/findMenuInfoByPath.js +8 -1
  162. package/lib/utils/index.js +42 -15
  163. package/package.json +2 -2
@@ -54,26 +54,6 @@ const Demo = props => {
54
54
  <a>查看</a>
55
55
  <a>编辑</a>
56
56
  <a>测试</a>
57
- {
58
- false &&
59
- <a>导入</a>
60
- }
61
- <a>导出</a>
62
- <Popconfirm
63
- title="Are you sure delete this task?"
64
- onConfirm={void 0}
65
- onCancel={void 0}
66
- okText="Yes"
67
- cancelText="No"
68
- onClick={e => e.stopPropagation()}
69
- getPopupContainer={trigger => trigger.parentNode}
70
- trigger="hover"
71
- overlayStyle={{
72
- width: 300
73
- }}
74
- >
75
- <a>Delete</a>
76
- </Popconfirm>
77
57
  </Handle>
78
58
  )
79
59
  }
@@ -1,12 +1,17 @@
1
1
  import { Fragment } from 'react';
2
2
  import { Dropdown, Menu, Divider } from 'antd';
3
+ import { getText, getLanguage } from '../locale';
3
4
  import Icon from '../Icon';
4
5
  import './index.less';
5
6
 
6
7
  const clsPrefix = 'tnt-more-menus';
7
8
 
8
9
  export default props => {
9
- const { children = [], type, num = 3, lang, divider = true, lessOneMoreFit, ...rest } = props || {};
10
+ const { children = [], type, num = 3, divider = true, lessOneMoreFit, ...rest } = props || {};
11
+ let { lang } = props||{};
12
+ if(!lang){
13
+ lang = getLanguage();
14
+ }
10
15
  let newChildren = [];
11
16
  if(Array.isArray(children)){
12
17
  newChildren = children?.filter(item => !!item) || [];
@@ -39,16 +44,32 @@ export default props => {
39
44
  </Fragment>
40
45
  ));
41
46
  }
42
- const menu = (
47
+ const menu = (childArr)=>(
43
48
  <Menu className="org-pop-opera-btn">
44
49
  {
45
- lastChildPart?.map(
50
+ childArr?.map(
46
51
  (child,i) => <Menu.Item key={i}>{child}</Menu.Item>
47
52
  )
48
53
  }
49
54
  </Menu>
50
55
  );
51
56
 
57
+ if(lang === 'en'){
58
+ return (
59
+ <Dropdown overlay={menu(newChildren||[])} arrow>
60
+ {
61
+ type === 'icon' ?
62
+ <Icon type="more" /> :
63
+ <a className="ant-dropdown-more">
64
+ {getText('handleMore',lang)}
65
+ <i className={`${clsPrefix}-dropdown-icon`}>
66
+ <Icon type="down" />
67
+ </i>
68
+ </a>
69
+ }
70
+ </Dropdown>
71
+ );
72
+ }
52
73
  return (
53
74
  <div
54
75
  onClick={(e) => { e.stopPropagation(); }}
@@ -56,13 +77,13 @@ export default props => {
56
77
  >
57
78
  {preChildPart}
58
79
  {
59
- lastChildPart?.length > 0 &&
60
- <Dropdown overlay={menu} arrow>
80
+ !!lastChildPart?.length &&
81
+ <Dropdown overlay={menu(lastChildPart||[])} arrow>
61
82
  {
62
83
  type === 'icon' ?
63
84
  <Icon type="more" /> :
64
85
  <a className="ant-dropdown-more">
65
- {lang === 'en' ? 'More' : '更多'}
86
+ {getText('handleMore',lang)}
66
87
  <i className={`${clsPrefix}-dropdown-icon`}>
67
88
  <Icon type="down" />
68
89
  </i>
@@ -20,7 +20,10 @@ export const zh_CN = {
20
20
  nameNull: '暂无昵称',
21
21
  personalSettings: '个人设置',
22
22
  changePwd: '修改密码',
23
- signOut: '退出'
23
+ signOut: '退出',
24
+
25
+ // Handle
26
+ handleMore:'更多'
24
27
  };
25
28
 
26
29
  export const en_US = {
@@ -42,7 +45,10 @@ export const en_US = {
42
45
  nameNull: 'No nickname yet',
43
46
  personalSettings: 'Setting',
44
47
  changePwd: 'Change password',
45
- signOut: 'Sign out'
48
+ signOut: 'Sign out',
49
+
50
+ // Handle
51
+ handleMore:'More'
46
52
  };
47
53
 
48
54
  export const getText = (key, language = 'cn', ...params) => {
package/dist/1.tntd.js CHANGED
@@ -1 +1 @@
1
- (window.webpackJsonptntd=window.webpackJsonptntd||[]).push([[1],{51:function(t,e,r){"use strict";r.r(e);var f=r(0),s=r(1);function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){b(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function b(t,e,r){return(e=function(t){t=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"===n(t)?t:String(t)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,c,i=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(i.push(n.value),i.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(l)throw o}}return i}}(t,e)||function(t,e){var r;if(t)return"string"==typeof t?a(t,e):"Map"===(r="Object"===(r=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var m=new(r(10).a),d={account:void 0,password:void 0};e.default=function(t){var e=t.visible,n=t.close,r=t.signIn,t=y(Object(f.useState)(!1),2),o=t[0],a=t[1],t=localStorage.getItem("accountInfo");if(t)try{d=JSON.parse(t)}catch(t){}function c(t,e){u(p(p({},i),{},b({},t,e.target.value)))}var t=y(Object(f.useState)(d),2),i=t[0],u=t[1],t=i.account,l=i.password;return React.createElement(s.Modal,{title:"开发者模拟登陆",visible:e,maskClosable:!1,onOk:function(){a(!0);var t=r&&r(i);t&&t.then&&t.then(function(r){s.message.success("模拟登陆成功"),localStorage.setItem("accountInfo",JSON.stringify(i)),a(!1),setTimeout(function(){var t=r||{},e=t.tdToken,t=t.userId;m.set("_td_token_",e,{path:"/"}),m.set("_uid_",t,{path:"/"}),n()},500)}).catch(function(t){throw a(!1),t})},onCancel:n,confirmLoading:o},React.createElement(s.Form,{labelCol:{span:5},wrapperCol:{span:18}},React.createElement(s.Form.Item,{label:"用户名:"},React.createElement(s.Input,{type:"text",placeholder:"请输入用户名",value:t||void 0,onChange:function(t){return c("account",t)}})),React.createElement(s.Form.Item,{label:"密码:"},React.createElement(s.Input,{type:"text",placeholder:"请输入用户名",value:l||void 0,onChange:function(t){return c("password",t)}}))))}}}]);
1
+ (window.webpackJsonptntd=window.webpackJsonptntd||[]).push([[1],{76:function(e,t,n){"use strict";n.r(t);var s=n(0),p=n(1);function f(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw a}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var y=new(n(10).a),m={account:void 0,password:void 0};t.default=function(e){var t=e.visible,r=e.close,n=e.signIn,o=d(Object(s.useState)(!1),2),a=o[0],c=o[1],e=localStorage.getItem("accountInfo");if(e)try{m=JSON.parse(e)}catch(e){}function i(e,t){l(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach(function(e){b(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},u,b({},e,t.target.value)))}var o=d(Object(s.useState)(m),2),u=o[0],l=o[1],e=u.account,o=u.password;return React.createElement(p.Modal,{title:"开发者模拟登陆",visible:t,maskClosable:!1,onOk:function(){c(!0);var e=n&&n(u);e&&e.then&&e.then(function(n){p.message.success("模拟登陆成功"),localStorage.setItem("accountInfo",JSON.stringify(u)),c(!1),setTimeout(function(){var e=n||{},t=e.tdToken,e=e.userId;y.set("_td_token_",t,{path:"/"}),y.set("_uid_",e,{path:"/"}),r()},500)}).catch(function(e){throw c(!1),e})},onCancel:r,confirmLoading:a},React.createElement(p.Form,{labelCol:{span:5},wrapperCol:{span:18}},React.createElement(p.Form.Item,{label:"用户名:"},React.createElement(p.Input,{type:"text",placeholder:"请输入用户名",value:e||void 0,onChange:function(e){return i("account",e)}})),React.createElement(p.Form.Item,{label:"密码:"},React.createElement(p.Input,{type:"text",placeholder:"请输入用户名",value:o||void 0,onChange:function(e){return i("password",e)}}))))}}}]);