tntd 1.3.56 → 1.3.60

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 (109) hide show
  1. package/babel.config.js +2 -2
  2. package/components/Layout/OrgAppList.js +1 -1
  3. package/components/QueryListScene/List.js +17 -13
  4. package/lib/0645cf743e4e44ca9da321d689897f07.png +0 -0
  5. package/lib/09db77de0c24fa0f45f8a5cf299a3d11.png +0 -0
  6. package/lib/1d0b52448de217857b270af807e9360d.png +0 -0
  7. package/lib/25d78d77c9c2f0d403e5d899ceb5b1ef.png +0 -0
  8. package/lib/27fa44ff0c98e1594d79b73045aabedf.png +0 -0
  9. package/lib/2c95075adb68d6131b59cae9fa554ec2.png +0 -0
  10. package/lib/377c871d922a25c773a9e7c2f42ed7c0.png +0 -0
  11. package/lib/3d901589b40bd56ff1fde2bbb700bfe1.png +0 -0
  12. package/lib/4abe481e130d7be0574e45573de8beb7.png +0 -0
  13. package/lib/95ee2260a509cd630d89c5367ed1973b.png +0 -0
  14. package/lib/ArrayInput/icon.js +31 -27
  15. package/lib/ArrayInput/index.js +298 -211
  16. package/lib/AuthContext.js +13 -2
  17. package/lib/BlockHeader/README.md +83 -0
  18. package/lib/BlockHeader/fonts/OswaldLight.ttf +0 -0
  19. package/lib/BlockHeader/index.js +42 -0
  20. package/lib/BlockHeader/index.less +141 -0
  21. package/lib/Columns/index.js +100 -71
  22. package/lib/DevelopmentLogin/LoginModal.js +141 -79
  23. package/lib/DevelopmentLogin/index.js +55 -28
  24. package/lib/Ellipsis/Svg/CopySVG.js +71 -23
  25. package/lib/Ellipsis/Svg/TickSVG.js +49 -17
  26. package/lib/Ellipsis/index.js +155 -149
  27. package/lib/Handle/index.js +109 -72
  28. package/lib/Icon/fonts/iconfont.js +43 -1
  29. package/lib/Icon/iconList.js +8 -119
  30. package/lib/Icon/index.js +45 -13
  31. package/lib/Img/Contain.js +81 -49
  32. package/lib/Img/Cover.js +136 -88
  33. package/lib/Img/index.js +89 -36
  34. package/lib/Layout/ActionsContext.js +11 -2
  35. package/lib/Layout/AppList.js +256 -262
  36. package/lib/Layout/Application.js +135 -119
  37. package/lib/Layout/Avatar.js +137 -137
  38. package/lib/Layout/CompatibleLanguage.js +195 -214
  39. package/lib/Layout/EnterpriseLayout/Avatar.js +168 -156
  40. package/lib/Layout/EnterpriseLayout/Language.js +100 -75
  41. package/lib/Layout/EnterpriseLayout/Theme.js +94 -96
  42. package/lib/Layout/EnterpriseLayout/index.js +45 -32
  43. package/lib/Layout/GlobalNavigation/NavigationPopup.js +407 -335
  44. package/lib/Layout/GlobalNavigation/index.js +158 -110
  45. package/lib/Layout/Header.js +116 -165
  46. package/lib/Layout/HeaderActions.js +129 -170
  47. package/lib/Layout/HeaderNavs.js +113 -90
  48. package/lib/Layout/HeaderTabs.js +278 -312
  49. package/lib/Layout/Iconfont.js +15 -2
  50. package/lib/Layout/Language.js +102 -63
  51. package/lib/Layout/Layout.js +261 -272
  52. package/lib/Layout/Logo.js +87 -132
  53. package/lib/Layout/OrgAppList.js +319 -440
  54. package/lib/Layout/SideMenu.js +343 -429
  55. package/lib/Layout/Theme.js +124 -95
  56. package/lib/Layout/checkAuth.js +35 -21
  57. package/lib/Layout/createActions.js +51 -38
  58. package/lib/Layout/images/index.js +41 -33
  59. package/lib/Layout/index.js +161 -110
  60. package/lib/Layout/locale.js +53 -0
  61. package/lib/Layout/paaslayout/CompactSideMenu.js +178 -200
  62. package/lib/Layout/paaslayout/Header.js +90 -84
  63. package/lib/Layout/paaslayout/Logo.js +32 -27
  64. package/lib/Layout/paaslayout/SideMenu.js +174 -161
  65. package/lib/Layout/paaslayout/index.js +261 -240
  66. package/lib/Layout/paaslayout/index.less +75 -0
  67. package/lib/Layout/storage.js +78 -20
  68. package/lib/Layout/utils.js +143 -93
  69. package/lib/LoadingButton/index.js +57 -29
  70. package/lib/Modal/index.js +108 -83
  71. package/lib/Page/Box.js +81 -56
  72. package/lib/Page/index.js +173 -151
  73. package/lib/Page/utils.js +30 -12
  74. package/lib/QueryForm/Field/Checkbox.js +33 -11
  75. package/lib/QueryForm/Field/Select.js +99 -63
  76. package/lib/QueryForm/Field/SelectInput.js +114 -69
  77. package/lib/QueryForm/Field/fieldsMap.js +52 -30
  78. package/lib/QueryForm/Field/index.js +156 -75
  79. package/lib/QueryForm/createActions.js +65 -50
  80. package/lib/QueryForm/index.js +382 -303
  81. package/lib/QueryForm/useForm.js +17 -6
  82. package/lib/QueryListScene/Field/SelectInput.js +115 -0
  83. package/lib/QueryListScene/Field/fieldsMap.js +52 -0
  84. package/lib/QueryListScene/Field/index.js +159 -0
  85. package/lib/QueryListScene/Field/select.js +100 -0
  86. package/lib/QueryListScene/List.js +362 -285
  87. package/lib/QueryListScene/QueryForm/index.js +423 -0
  88. package/lib/QueryListScene/QueryForm/index.less +141 -0
  89. package/lib/QueryListScene/QueryForm.js +159 -91
  90. package/lib/QueryListScene/QueryListScene.js +87 -33
  91. package/lib/QueryListScene/Title.js +20 -10
  92. package/lib/QueryListScene/Toolbar.js +31 -8
  93. package/lib/QueryListScene/createActions.js +79 -64
  94. package/lib/QueryListScene/index.js +40 -23
  95. package/lib/QueryListScene/useActions.js +17 -6
  96. package/lib/Select/DropDownWrap.js +124 -60
  97. package/lib/Select/index.js +563 -426
  98. package/lib/Table/ResizableTable/index.js +121 -77
  99. package/lib/Table/index.js +51 -19
  100. package/lib/Title/index.js +52 -34
  101. package/lib/b9dd5ff3622296fbee51ed68f4bca1bf.png +0 -0
  102. package/lib/bd2921989f9296089ba58efb7a76f3ef.png +0 -0
  103. package/lib/index.html +6 -0
  104. package/lib/index.js +159 -19
  105. package/lib/locale.js +63 -48
  106. package/lib/main.css +16420 -0
  107. package/lib/tntd.js +2 -0
  108. package/lib/tntd.js.LICENSE.txt +36 -0
  109. package/package.json +2 -2
@@ -1,222 +1,203 @@
1
- import { useState } from 'react';
2
- import styled from 'styled-components';
3
- import cn from 'classnames';
4
- import { Popover } from 'antd';
5
- import { get } from 'lodash';
6
- import Icon from '../Icon';
7
- import images from './images';
8
- import {
9
- setThemeStore, getThemeStore,
10
- setLanguageStore, getLanguageStore
11
- } from './storage';
12
-
13
- const languages = [
14
- { value: 'cn', name: '中文' },
15
- { value: 'en', name: ' EN ' }
16
- ];
17
- const languagesMap = languages.reduce((acc, cur) => {
18
- acc[cur.value] = cur;
19
- return acc;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ require("antd/es/popover/style");
9
+
10
+ var _popover = _interopRequireDefault(require("antd/es/popover"));
11
+
12
+ var _react = require("react");
13
+
14
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
15
+
16
+ var _classnames = _interopRequireDefault(require("classnames"));
17
+
18
+ var _lodash = require("lodash");
19
+
20
+ var _Icon = _interopRequireDefault(require("../Icon"));
21
+
22
+ var _images = _interopRequireDefault(require("./images"));
23
+
24
+ var _storage = require("./storage");
25
+
26
+ var _this = void 0;
27
+
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
+
30
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
31
+
32
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
33
+
34
+ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
35
+
36
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
37
+
38
+ function _templateObject4() {
39
+ var data = _taggedTemplateLiteral(["\n z-index: 1;\n background-color: #fff;\n border-radius: 4px;\n min-width: 203px;\n padding: 8px 4px 8px 8px;\n .line {\n background: #f0f0f0;\n height: 1px;\n margin: 20px 0;\n width: calc(100% + 44px);\n transform: translateX(-22px);\n }\n"]);
40
+
41
+ _templateObject4 = function _templateObject4() {
42
+ return data;
43
+ };
44
+
45
+ return data;
46
+ }
47
+
48
+ function _templateObject3() {
49
+ var data = _taggedTemplateLiteral(["\n margin-bottom: 20px;\n & > div {\n position: relative;\n display: inline-block;\n cursor: pointer;\n img {\n width: 48px;\n }\n &:first-child {\n margin-right: 10px;\n }\n &:last-child {\n margin-left: 10px;\n }\n & > i, & > .tnt-icon, & > .anticon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: #1890ff;\n }\n }\n"]);
50
+
51
+ _templateObject3 = function _templateObject3() {
52
+ return data;
53
+ };
54
+
55
+ return data;
56
+ }
57
+
58
+ function _templateObject2() {
59
+ var data = _taggedTemplateLiteral(["\n margin-left: 20px;\n font-size: 20px;\n .tnt-themeS1 & {\n color: rgba(255,255,255,.85);\n }\n .isInIframe & {\n display: none;\n }\n .tnt-icon {\n font-size: 30px;\n vertical-align: middle;\n opacity: .75;\n color: #2b5696;\n .tnt-themeS1 & {\n /* color: #fff; */\n }\n }\n"]);
60
+
61
+ _templateObject2 = function _templateObject2() {
62
+ return data;
63
+ };
64
+
65
+ return data;
66
+ }
67
+
68
+ function _templateObject() {
69
+ var data = _taggedTemplateLiteral(["\n margin-bottom: 10px;\n\n & > div {\n padding: 10px 13px 10px 17px;\n border-radius: 20px 0 0 20px;\n border-right: none;\n display: inline-block;\n color: #fff;\n width: 49%;\n text-align: center;\n font-size: 14px;\n letter-spacing: 0!important;\n color: #666;\n border: 1px solid #e5e5e5;\n vertical-align: middle;\n display: inline-block;\n letter-spacing: -4px;\n cursor: pointer;\n &:first-child {\n padding: 10px 13px 10px 17px;\n border-radius: 20px 0 0 20px;\n border-right: none;\n }\n &:last-child {\n padding: 10px 17px 10px 13px;\n border-radius: 0 20px 20px 0;\n border-left: none;\n }\n &.active {\n background-color: #4b93e5;\n border-color: #4b93e5;\n color: #fff;\n }\n }\n"]);
70
+
71
+ _templateObject = function _templateObject() {
72
+ return data;
73
+ };
74
+
75
+ return data;
76
+ }
77
+
78
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
79
+
80
+ var languages = [{
81
+ value: 'cn',
82
+ name: '中文'
83
+ }, {
84
+ value: 'en',
85
+ name: ' EN '
86
+ }];
87
+ var languagesMap = languages.reduce(function (acc, cur) {
88
+ acc[cur.value] = cur;
89
+ return acc;
20
90
  }, {});
21
91
 
22
- const LanguageSwitch = styled.div`
23
- margin-bottom: 10px;
24
-
25
- & > div {
26
- padding: 10px 13px 10px 17px;
27
- border-radius: 20px 0 0 20px;
28
- border-right: none;
29
- display: inline-block;
30
- color: #fff;
31
- width: 49%;
32
- text-align: center;
33
- font-size: 14px;
34
- letter-spacing: 0!important;
35
- color: #666;
36
- border: 1px solid #e5e5e5;
37
- vertical-align: middle;
38
- display: inline-block;
39
- letter-spacing: -4px;
40
- cursor: pointer;
41
- &:first-child {
42
- padding: 10px 13px 10px 17px;
43
- border-radius: 20px 0 0 20px;
44
- border-right: none;
45
- }
46
- &:last-child {
47
- padding: 10px 17px 10px 13px;
48
- border-radius: 0 20px 20px 0;
49
- border-left: none;
50
- }
51
- &.active {
52
- background-color: #4b93e5;
53
- border-color: #4b93e5;
54
- color: #fff;
55
- }
56
- }
57
- `;
92
+ var LanguageSwitch = _styledComponents["default"].div(_templateObject());
58
93
 
59
- const Theme = styled.li`
60
- margin-left: 20px;
61
- font-size: 20px;
62
- .tnt-themeS1 & {
63
- color: rgba(255,255,255,.85);
64
- }
65
- .isInIframe & {
66
- display: none;
67
- }
68
- .tnt-icon {
69
- font-size: 30px;
70
- vertical-align: middle;
71
- opacity: .75;
72
- color: #2b5696;
73
- .tnt-themeS1 & {
74
- /* color: #fff; */
75
- }
76
- }
77
- `;
78
-
79
- const ThemeSwitch = styled.div`
80
- margin-bottom: 20px;
81
- & > div {
82
- position: relative;
83
- display: inline-block;
84
- cursor: pointer;
85
- img {
86
- width: 48px;
87
- }
88
- &:first-child {
89
- margin-right: 10px;
90
- }
91
- &:last-child {
92
- margin-left: 10px;
93
- }
94
- & > i, & > .tnt-icon, & > .anticon {
95
- position: absolute;
96
- top: 50%;
97
- left: 50%;
98
- transform: translate(-50%, -50%);
99
- color: #1890ff;
100
- }
101
- }
102
- `;
103
-
104
- const ThemeContentWrapper = styled.div`
105
- z-index: 1;
106
- background-color: #fff;
107
- border-radius: 4px;
108
- min-width: 203px;
109
- padding: 8px 4px 8px 8px;
110
- .line {
111
- background: #f0f0f0;
112
- height: 1px;
113
- margin: 20px 0;
114
- width: calc(100% + 44px);
115
- transform: translateX(-22px);
94
+ var Theme = _styledComponents["default"].li(_templateObject2());
95
+
96
+ var ThemeSwitch = _styledComponents["default"].div(_templateObject3());
97
+
98
+ var ThemeContentWrapper = _styledComponents["default"].div(_templateObject4());
99
+
100
+ var themes = [{
101
+ value: 'themeS1',
102
+ img: _images["default"].themeSymbol1
103
+ }, {
104
+ value: 'themeS2',
105
+ img: _images["default"].themeSymbol2
106
+ }];
107
+
108
+ var ThemeContent = function ThemeContent(props) {
109
+ var config = props.config,
110
+ onLanguageChange = props.onLanguageChange,
111
+ onThemeChange = props.onThemeChange;
112
+
113
+ var _ref = config || {},
114
+ _ref$language = _ref.language,
115
+ languageVisible = _ref$language === void 0 ? true : _ref$language,
116
+ _ref$theme = _ref.theme,
117
+ themeVisible = _ref$theme === void 0 ? true : _ref$theme;
118
+
119
+ var getTheme = function getTheme() {
120
+ var theme = (0, _storage.getThemeStore)() || props.theme || 'themeS2';
121
+ return themes.some(function (_ref2) {
122
+ var value = _ref2.value;
123
+ return value === theme;
124
+ }) ? theme : 'themeS2';
125
+ };
126
+
127
+ var _useState = (0, _react.useState)(getTheme()),
128
+ _useState2 = _slicedToArray(_useState, 2),
129
+ theme = _useState2[0],
130
+ setTheme = _useState2[1];
131
+
132
+ var changeTheme = function changeTheme(theme) {
133
+ setTheme(theme);
134
+ (0, _storage.setThemeStore)(theme);
135
+ onThemeChange(theme);
136
+ };
137
+
138
+ var getLanguage = function getLanguage() {
139
+ var lang = (0, _storage.getLanguageStore)() || props.language;
140
+
141
+ if (!languagesMap[lang]) {
142
+ lang = (0, _lodash.get)(languages, '0.value');
116
143
  }
117
- `;
118
-
119
- const themes = [
120
- { value: 'themeS1', img: images.themeSymbol1 },
121
- { value: 'themeS2', img: images.themeSymbol2 }
122
- ];
123
-
124
- const ThemeContent = props => {
125
- const { config, onLanguageChange, onThemeChange } = props;
126
- const {
127
- language: languageVisible = true,
128
- theme: themeVisible = true
129
- } = config || {};
130
- const getTheme = () => {
131
- let theme = getThemeStore() || props.theme || 'themeS2';
132
-
133
- return themes.some(({ value }) => value === theme) ? theme : 'themeS2';
134
- };
135
- const [theme, setTheme] = useState(getTheme());
136
- const changeTheme = theme => {
137
- setTheme(theme);
138
- setThemeStore(theme);
139
- onThemeChange(theme);
140
- };
141
- const getLanguage = () => {
142
- let lang = getLanguageStore() || props.language;
143
-
144
- if (!languagesMap[lang]) {
145
- lang = get(languages, '0.value');
146
- }
147
-
148
- return lang;
149
- };
150
- const [language = 'cn', setLanguage] = useState(getLanguage());
151
- const changeLanguage = language => {
152
- setLanguage(language);
153
- setLanguageStore(language);
154
- onLanguageChange(language);
155
- };
156
-
157
- return (
158
- <ThemeContentWrapper>
159
- {
160
- themeVisible && (
161
- <ThemeSwitch>
162
- {
163
- themes.map(({ value, img }) => (
164
- <div key={value} onClick={changeTheme.bind(this, value)}>
165
- <img src={img} />
166
- {
167
- theme === value && (
168
- <Icon type="check1" />
169
- )
170
- }
171
- </div>
172
- ))
173
- }
174
- </ThemeSwitch>
175
- )
176
- }
177
- {
178
- themeVisible && languageVisible && (
179
- <div className="line"></div>
180
- )
181
- }
182
- {
183
- languageVisible && (
184
- <LanguageSwitch>
185
- {
186
- languages.map(({ value, name }) => (
187
- <div
188
- className={cn({ active: value === language })}
189
- key={value}
190
- onClick={changeLanguage.bind(this, value)}
191
- >
192
- {name}
193
- </div>
194
- ))
195
- }
196
- </LanguageSwitch>
197
- )
198
- }
199
- </ThemeContentWrapper>
200
- );
144
+
145
+ return lang;
146
+ };
147
+
148
+ var _useState3 = (0, _react.useState)(getLanguage()),
149
+ _useState4 = _slicedToArray(_useState3, 2),
150
+ _useState4$ = _useState4[0],
151
+ language = _useState4$ === void 0 ? 'cn' : _useState4$,
152
+ setLanguage = _useState4[1];
153
+
154
+ var changeLanguage = function changeLanguage(language) {
155
+ setLanguage(language);
156
+ (0, _storage.setLanguageStore)(language);
157
+ onLanguageChange(language);
158
+ };
159
+
160
+ return React.createElement(ThemeContentWrapper, null, themeVisible && React.createElement(ThemeSwitch, null, themes.map(function (_ref3) {
161
+ var value = _ref3.value,
162
+ img = _ref3.img;
163
+ return React.createElement("div", {
164
+ key: value,
165
+ onClick: changeTheme.bind(_this, value)
166
+ }, React.createElement("img", {
167
+ src: img
168
+ }), theme === value && React.createElement(_Icon["default"], {
169
+ type: "check1"
170
+ }));
171
+ })), themeVisible && languageVisible && React.createElement("div", {
172
+ className: "line"
173
+ }), languageVisible && React.createElement(LanguageSwitch, null, languages.map(function (_ref4) {
174
+ var value = _ref4.value,
175
+ name = _ref4.name;
176
+ return React.createElement("div", {
177
+ className: (0, _classnames["default"])({
178
+ active: value === language
179
+ }),
180
+ key: value,
181
+ onClick: changeLanguage.bind(_this, value)
182
+ }, name);
183
+ })));
201
184
  };
202
185
 
203
- export default props => {
204
- const { config } = props;
205
-
206
- if (config?.language === false && config?.theme === false) {
207
- return null;
208
- }
186
+ var _default = function _default(props) {
187
+ var config = props.config;
188
+
189
+ if ((config == null ? void 0 : config.language) === false && (config == null ? void 0 : config.theme) === false) {
190
+ return null;
191
+ }
209
192
 
210
- return (
211
- <Theme>
212
- <Popover
213
- placement="bottomRight"
214
- title={null}
215
- content={<ThemeContent {...props} />}
216
- trigger="click"
217
- >
218
- <Icon type="daxiaoxie" />
219
- </Popover>
220
- </Theme>
221
- );
193
+ return React.createElement(Theme, null, React.createElement(_popover["default"], {
194
+ placement: "bottomRight",
195
+ title: null,
196
+ content: React.createElement(ThemeContent, props),
197
+ trigger: "click"
198
+ }, React.createElement(_Icon["default"], {
199
+ type: "daxiaoxie"
200
+ })));
222
201
  };
202
+
203
+ exports["default"] = _default;