tntd 1.4.4 → 1.4.7

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 (88) hide show
  1. package/components/Layout/HeaderActions.js +90 -128
  2. package/components/LoadingButton/index.js +11 -15
  3. package/components/QueryListScene/QueryForm.js +7 -4
  4. package/dist/stats.json +4990 -4990
  5. package/dist/tntd.js +1 -1
  6. package/es/Layout/HeaderActions.js +10 -10
  7. package/es/LoadingButton/index.js +20 -10
  8. package/es/QueryListScene/QueryForm.js +6 -3
  9. package/lib/ArrayInput/icon.js +27 -31
  10. package/lib/ArrayInput/index.js +211 -298
  11. package/lib/AuthContext.js +2 -13
  12. package/lib/Columns/index.js +71 -100
  13. package/lib/DevelopmentLogin/LoginModal.js +79 -141
  14. package/lib/DevelopmentLogin/index.js +28 -55
  15. package/lib/Ellipsis/Svg/CopySVG.js +23 -71
  16. package/lib/Ellipsis/Svg/TickSVG.js +17 -49
  17. package/lib/Ellipsis/index.js +148 -154
  18. package/lib/Handle/index.js +72 -109
  19. package/lib/Icon/fonts/iconfont.js +1 -43
  20. package/lib/Icon/iconList.js +119 -8
  21. package/lib/Icon/index.js +13 -45
  22. package/lib/Img/Contain.js +49 -81
  23. package/lib/Img/Cover.js +88 -136
  24. package/lib/Img/index.js +36 -89
  25. package/lib/Layout/ActionsContext.js +2 -11
  26. package/lib/Layout/AppList.js +262 -256
  27. package/lib/Layout/Application.js +119 -135
  28. package/lib/Layout/Avatar.js +137 -137
  29. package/lib/Layout/CompatibleLanguage.js +214 -195
  30. package/lib/Layout/EnterpriseLayout/Avatar.js +156 -168
  31. package/lib/Layout/EnterpriseLayout/Language.js +75 -100
  32. package/lib/Layout/EnterpriseLayout/Theme.js +96 -94
  33. package/lib/Layout/EnterpriseLayout/index.js +32 -45
  34. package/lib/Layout/GlobalNavigation/NavigationPopup.js +335 -407
  35. package/lib/Layout/GlobalNavigation/index.js +110 -158
  36. package/lib/Layout/Header.js +165 -116
  37. package/lib/Layout/HeaderActions.js +132 -129
  38. package/lib/Layout/HeaderNavs.js +90 -113
  39. package/lib/Layout/HeaderTabs.js +312 -278
  40. package/lib/Layout/Iconfont.js +2 -15
  41. package/lib/Layout/Language.js +63 -102
  42. package/lib/Layout/Layout.js +272 -261
  43. package/lib/Layout/Logo.js +132 -87
  44. package/lib/Layout/OrgAppList.js +440 -319
  45. package/lib/Layout/SideMenu.js +429 -343
  46. package/lib/Layout/Theme.js +95 -124
  47. package/lib/Layout/checkAuth.js +21 -35
  48. package/lib/Layout/createActions.js +38 -51
  49. package/lib/Layout/images/index.js +33 -41
  50. package/lib/Layout/index.js +110 -161
  51. package/lib/Layout/paaslayout/CompactSideMenu.js +200 -178
  52. package/lib/Layout/paaslayout/Header.js +84 -90
  53. package/lib/Layout/paaslayout/Logo.js +27 -32
  54. package/lib/Layout/paaslayout/SideMenu.js +161 -174
  55. package/lib/Layout/paaslayout/index.js +240 -261
  56. package/lib/Layout/storage.js +20 -78
  57. package/lib/Layout/utils.js +93 -143
  58. package/lib/LoadingButton/index.js +25 -57
  59. package/lib/Modal/index.js +83 -108
  60. package/lib/Page/Box.js +56 -81
  61. package/lib/Page/index.js +151 -173
  62. package/lib/Page/utils.js +12 -30
  63. package/lib/QueryForm/Field/Checkbox.js +11 -33
  64. package/lib/QueryForm/Field/Select.js +63 -99
  65. package/lib/QueryForm/Field/SelectInput.js +69 -114
  66. package/lib/QueryForm/Field/fieldsMap.js +30 -52
  67. package/lib/QueryForm/Field/index.js +76 -158
  68. package/lib/QueryForm/createActions.js +50 -65
  69. package/lib/QueryForm/index.js +304 -383
  70. package/lib/QueryForm/useForm.js +6 -17
  71. package/lib/QueryListScene/List.js +290 -366
  72. package/lib/QueryListScene/QueryForm.js +93 -158
  73. package/lib/QueryListScene/QueryListScene.js +33 -87
  74. package/lib/QueryListScene/Title.js +10 -20
  75. package/lib/QueryListScene/Toolbar.js +8 -31
  76. package/lib/QueryListScene/createActions.js +64 -79
  77. package/lib/QueryListScene/index.js +23 -40
  78. package/lib/QueryListScene/useActions.js +6 -17
  79. package/lib/Select/DropDownWrap.js +60 -124
  80. package/lib/Select/index.js +425 -561
  81. package/lib/Table/ResizableTable/index.js +77 -121
  82. package/lib/Table/index.js +19 -51
  83. package/lib/Title/index.js +34 -52
  84. package/lib/index.js +19 -159
  85. package/lib/locale.js +48 -63
  86. package/package.json +1 -1
  87. package/lib/Layout/EnterpriseLayout/Header.js +0 -113
  88. package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
@@ -1,16 +1,16 @@
1
- import styled, { withTheme } from 'styled-components';
2
- import { Divider } from 'antd';
3
- import GlobalNavigation from './GlobalNavigation';
4
- import Language from './Language';
5
- import Theme from './Theme';
6
- import LanguageTheme from './CompatibleLanguage';
7
- import Application from './Application';
8
- import Avatar from './Avatar';
1
+ import styled, { withTheme } from "styled-components";
2
+ import { Divider } from "antd";
3
+ import GlobalNavigation from "./GlobalNavigation";
4
+ import Language from "./Language";
5
+ import Theme from "./Theme";
6
+ import LanguageTheme from "./CompatibleLanguage";
7
+ import Application from "./Application";
8
+ import Avatar from "./Avatar";
9
9
 
10
10
  const Actions = styled.ul`
11
11
  list-style: none;
12
12
  display: inline-block;
13
- line-height: ${props => `${props.theme.headerHeight}px`};
13
+ line-height: ${(props) => `${props.theme.headerHeight}px`};
14
14
  margin: 0 0 0 20px;
15
15
  .hasHeaderTabs & {
16
16
  margin: 0;
@@ -29,7 +29,7 @@ const Actions = styled.ul`
29
29
  cursor: pointer;
30
30
  font-size: 20px;
31
31
  margin: 0 7.5px;
32
- color: ${props => `${props.theme.headerActionsColor}`};
32
+ color: ${(props) => `${props.theme.headerActionsColor}`};
33
33
  .large-size & {
34
34
  margin: 0 10px;
35
35
  }
@@ -39,7 +39,7 @@ const Actions = styled.ul`
39
39
  &:last-of-type {
40
40
  margin-right: 0;
41
41
  }
42
- .hasHeaderTabs &{
42
+ .hasHeaderTabs & {
43
43
  color: #455064;
44
44
  }
45
45
  // 删除色系区分 统一色调
@@ -52,123 +52,85 @@ const Actions = styled.ul`
52
52
  }
53
53
  `;
54
54
 
55
- export default withTheme(
56
- props => {
57
- const {
58
- config: {
59
- theme = true,
60
- avatar = true,
61
- language = true,
62
- application = false,
63
- globalNavigation = false
64
- } = {},
65
- theme: {
66
- compatible
67
- },
68
- userInfo = {},
69
- menus,
70
- apps,
71
- extraActions,
72
- headerRef,
73
- onLanguageChange,
74
- onThemeChange,
75
- onApplicationChange,
76
- onAppChange,
77
- onCollapseChange,
78
- onPersonalSetting,
79
- onChangePassword,
80
- onLogout,
81
- onLogoClick,
82
- AvatarCustom,
83
- ...rest
84
- } = props;
55
+ export default withTheme((props) => {
56
+ const {
57
+ config: {
58
+ theme = true,
59
+ avatar = true,
60
+ language = true,
61
+ application = false,
62
+ globalNavigation = false,
63
+ } = {},
64
+ theme: { compatible },
65
+ userInfo = {},
66
+ menus,
67
+ apps,
68
+ extraActions,
69
+ headerRef,
70
+ onLanguageChange,
71
+ onThemeChange,
72
+ onApplicationChange,
73
+ onAppChange,
74
+ onCollapseChange,
75
+ onPersonalSetting,
76
+ onChangePassword,
77
+ onLogout,
78
+ onLogoClick,
79
+ AvatarCustom,
80
+ ...rest
81
+ } = props;
85
82
 
86
- return (
87
- <Actions {...rest}>
88
- {extraActions}
89
- {
90
- globalNavigation && (
91
- <GlobalNavigation
92
- headerRef={headerRef}
93
- menus={menus}
83
+ return (
84
+ <Actions {...rest}>
85
+ {extraActions}
86
+ {globalNavigation && <GlobalNavigation headerRef={headerRef} menus={menus} />}
87
+ {!compatible ? (
88
+ <>
89
+ {language && <Language language={userInfo.lang} onChange={onLanguageChange} />}
90
+ {theme && <Theme theme={userInfo.theme} onChange={onThemeChange} />}
91
+ </>
92
+ ) : (
93
+ <LanguageTheme
94
+ config={props.config}
95
+ language={userInfo.lang}
96
+ theme={userInfo.theme}
97
+ onLanguageChange={onLanguageChange}
98
+ onThemeChange={onThemeChange}
99
+ />
100
+ )}
101
+ {application && (
102
+ <Application language={userInfo.lang} apps={apps} onChange={onApplicationChange} />
103
+ )}
104
+ {avatar && (
105
+ <>
106
+ <Divider type="vertical" />
107
+ {AvatarCustom ? (
108
+ <AvatarCustom
109
+ userInfo={userInfo}
110
+ onPersonalSetting={onPersonalSetting}
111
+ onChangePassword={onChangePassword}
112
+ onLogout={onLogout}
113
+ onThemeChange={onThemeChange}
114
+ config={{
115
+ theme,
116
+ language,
117
+ }}
94
118
  />
95
- )
96
- }
97
- {
98
- !AvatarCustom &&
99
- (
100
- !compatible ? (
101
- <>
102
- {
103
- language && (
104
- <Language
105
- language={userInfo.lang}
106
- onChange={onLanguageChange}
107
- />
108
- )
109
- }
110
- {
111
- theme && (
112
- <Theme
113
- theme={userInfo.theme}
114
- onChange={onThemeChange}
115
- />
116
- )
117
- }
118
- </>
119
- ) : (
120
- <LanguageTheme
121
- config={props.config}
122
- language={userInfo.lang}
123
- theme={userInfo.theme}
124
- onLanguageChange={onLanguageChange}
125
- onThemeChange={onThemeChange}
126
- />
127
- )
128
- )
129
- }
130
- {
131
- application && (
132
- <Application
133
- language={userInfo.lang}
134
- apps={apps}
135
- onChange={onApplicationChange}
119
+ ) : (
120
+ <Avatar
121
+ userInfo={userInfo}
122
+ onPersonalSetting={onPersonalSetting}
123
+ onChangePassword={onChangePassword}
124
+ onLogout={onLogout}
125
+ onThemeChange={onThemeChange}
126
+ config={{
127
+ theme,
128
+ language,
129
+ }}
136
130
  />
137
- )
138
- }
139
- {
140
- avatar && (
141
- <>
142
- <Divider type="vertical" />
143
- {
144
- AvatarCustom ?
145
- <AvatarCustom
146
- userInfo={userInfo}
147
- onPersonalSetting={onPersonalSetting}
148
- onChangePassword={onChangePassword}
149
- onLogout={onLogout}
150
- onThemeChange={onThemeChange}
151
- config={{
152
- theme,
153
- language
154
- }}
155
- /> :
156
- <Avatar
157
- userInfo={userInfo}
158
- onPersonalSetting={onPersonalSetting}
159
- onChangePassword={onChangePassword}
160
- onLogout={onLogout}
161
- onThemeChange={onThemeChange}
162
- config={{
163
- theme,
164
- language
165
- }}
166
- />
167
- }
168
- </>
169
- )
170
- }
171
- </Actions>
172
- );
173
- }
174
- );
131
+ )}
132
+ </>
133
+ )}
134
+ </Actions>
135
+ );
136
+ });
@@ -1,30 +1,26 @@
1
- import { useState, useEffect } from 'react';
2
- import { Button } from 'antd';
1
+ import { useState, useEffect } from "react";
2
+ import { Button } from "antd";
3
3
 
4
- export default props => {
5
- const [loading, setLoading] = useState(props.loading);
6
- const onClick = evt => {
4
+ export default ({ loadingText, loading: pLoading, onClick, children, ...otherProps }) => {
5
+ const [loading, setLoading] = useState(pLoading);
6
+ const doClick = (evt) => {
7
7
  if (!loading) {
8
8
  setLoading(true);
9
- const returnVal = props.onClick && props.onClick(evt, () => setLoading(false));
9
+ const returnVal = onClick && onClick(evt, () => setLoading(false));
10
10
 
11
11
  if (returnVal instanceof Promise) {
12
- returnVal.then(
13
- () => setLoading(false)
14
- ).catch(
15
- () => setLoading(false)
16
- );
12
+ returnVal.then(() => setLoading(false)).catch(() => setLoading(false));
17
13
  }
18
14
  }
19
15
  };
20
16
 
21
17
  useEffect(() => {
22
- setLoading(props.loading);
23
- }, [props.loading]);
18
+ setLoading(pLoading);
19
+ }, [pLoading]);
24
20
 
25
21
  return (
26
- <Button {...props} loading={loading} onClick={onClick}>
27
- {loading ? (props.loadingText || props.children) : props.children}
22
+ <Button {...otherProps} loading={loading} onClick={doClick}>
23
+ {loading ? loadingText || children : children}
28
24
  </Button>
29
25
  );
30
26
  };
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import classnames from 'classnames';
3
- import Form from '../QueryForm';
3
+ import Form from '../QueryForm';
4
4
 
5
5
  const clsPrefix = 'tnt-querylistscene-queryform';
6
-
6
+
7
7
  export default class QueryForm extends React.PureComponent {
8
8
  constructor(props) {
9
9
  super(props);
@@ -60,9 +60,12 @@ export default class QueryForm extends React.PureComponent {
60
60
  const values = actions.getFormData();
61
61
  const params = { ...values, current: 1 };
62
62
 
63
+ // memory 与 url解析setForm时 监听事件异步
63
64
  actions.setData('formData', values);
64
- onSearch && onSearch(params);
65
- actions.emit('search', params);
65
+ Promise.resolve().then(()=>{
66
+ onSearch && onSearch(params);
67
+ actions.emit('search', params);
68
+ });
66
69
  };
67
70
 
68
71
  onReset = () => {