tntd 1.4.6 → 1.4.9
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.
- package/components/DevelopmentLogin/LoginModal.js +2 -2
- package/components/Layout/HeaderActions.js +90 -128
- package/components/LoadingButton/index.js +11 -15
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +103 -103
- package/dist/tntd.js +1 -1
- package/es/DevelopmentLogin/LoginModal.js +2 -2
- package/es/Layout/HeaderActions.js +10 -10
- package/es/LoadingButton/index.js +20 -10
- package/lib/DevelopmentLogin/LoginModal.js +2 -2
- package/lib/Layout/HeaderActions.js +3 -3
- package/lib/LoadingButton/index.js +19 -9
- package/package.json +1 -1
|
@@ -26,8 +26,8 @@ import Cookies from 'universal-cookie';
|
|
|
26
26
|
var cookies = new Cookies(); // 默认
|
|
27
27
|
|
|
28
28
|
var accountInfoDefault = {
|
|
29
|
-
account:
|
|
30
|
-
password:
|
|
29
|
+
account: undefined,
|
|
30
|
+
password: undefined
|
|
31
31
|
};
|
|
32
32
|
export default (function (_ref) {
|
|
33
33
|
var visible = _ref.visible,
|
|
@@ -6,7 +6,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
6
6
|
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; }
|
|
7
7
|
|
|
8
8
|
function _templateObject() {
|
|
9
|
-
var data = _taggedTemplateLiteral(["\n list-style: none;\n display: inline-block;\n line-height: ", ";\n margin: 0 0 0 20px;\n .hasHeaderTabs & {\n margin: 0;\n }\n padding: 0;\n white-space: nowrap;\n\n .isInIframe & {\n display: none;\n }\n\n & > li {\n height: 100%;\n display: inline-block;\n vertical-align: top;\n cursor: pointer;\n font-size: 20px;\n margin: 0 7.5px;\n color: ", ";\n .large-size & {\n margin: 0 10px;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n &:last-of-type {\n margin-right: 0;\n }\n .hasHeaderTabs &{\n color: #455064;\n }\n // \u5220\u9664\u8272\u7CFB\u533A\u5206 \u7EDF\u4E00\u8272\u8C03\n // .hasHeaderTabs:not(.tnt-themeS1) & {\n // color: rgba(255,255,255,.8);\n // }\n .hasHeaderTabs:not(.tnt-themeS1) & {\n color: #455064 !important;\n }\n }\n"]);
|
|
9
|
+
var data = _taggedTemplateLiteral(["\n list-style: none;\n display: inline-block;\n line-height: ", ";\n margin: 0 0 0 20px;\n .hasHeaderTabs & {\n margin: 0;\n }\n padding: 0;\n white-space: nowrap;\n\n .isInIframe & {\n display: none;\n }\n\n & > li {\n height: 100%;\n display: inline-block;\n vertical-align: top;\n cursor: pointer;\n font-size: 20px;\n margin: 0 7.5px;\n color: ", ";\n .large-size & {\n margin: 0 10px;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n &:last-of-type {\n margin-right: 0;\n }\n .hasHeaderTabs & {\n color: #455064;\n }\n // \u5220\u9664\u8272\u7CFB\u533A\u5206 \u7EDF\u4E00\u8272\u8C03\n // .hasHeaderTabs:not(.tnt-themeS1) & {\n // color: rgba(255,255,255,.8);\n // }\n .hasHeaderTabs:not(.tnt-themeS1) & {\n color: #455064 !important;\n }\n }\n"]);
|
|
10
10
|
|
|
11
11
|
_templateObject = function _templateObject() {
|
|
12
12
|
return data;
|
|
@@ -17,13 +17,13 @@ function _templateObject() {
|
|
|
17
17
|
|
|
18
18
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
19
|
|
|
20
|
-
import styled, { withTheme } from
|
|
21
|
-
import GlobalNavigation from
|
|
22
|
-
import Language from
|
|
23
|
-
import Theme from
|
|
24
|
-
import LanguageTheme from
|
|
25
|
-
import Application from
|
|
26
|
-
import Avatar from
|
|
20
|
+
import styled, { withTheme } from "styled-components";
|
|
21
|
+
import GlobalNavigation from "./GlobalNavigation";
|
|
22
|
+
import Language from "./Language";
|
|
23
|
+
import Theme from "./Theme";
|
|
24
|
+
import LanguageTheme from "./CompatibleLanguage";
|
|
25
|
+
import Application from "./Application";
|
|
26
|
+
import Avatar from "./Avatar";
|
|
27
27
|
var Actions = styled.ul(_templateObject(), function (props) {
|
|
28
28
|
return "".concat(props.theme.headerHeight, "px");
|
|
29
29
|
}, function (props) {
|
|
@@ -65,7 +65,7 @@ export default withTheme(function (props) {
|
|
|
65
65
|
return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(GlobalNavigation, {
|
|
66
66
|
headerRef: headerRef,
|
|
67
67
|
menus: menus
|
|
68
|
-
}), !
|
|
68
|
+
}), !compatible ? React.createElement(React.Fragment, null, language && React.createElement(Language, {
|
|
69
69
|
language: userInfo.lang,
|
|
70
70
|
onChange: onLanguageChange
|
|
71
71
|
}), theme && React.createElement(Theme, {
|
|
@@ -77,7 +77,7 @@ export default withTheme(function (props) {
|
|
|
77
77
|
theme: userInfo.theme,
|
|
78
78
|
onLanguageChange: onLanguageChange,
|
|
79
79
|
onThemeChange: onThemeChange
|
|
80
|
-
})
|
|
80
|
+
}), application && React.createElement(Application, {
|
|
81
81
|
language: userInfo.lang,
|
|
82
82
|
apps: apps,
|
|
83
83
|
onChange: onApplicationChange
|
|
@@ -11,17 +11,27 @@ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) ||
|
|
|
11
11
|
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
import { useState, useEffect } from "react";
|
|
19
|
+
export default (function (_ref) {
|
|
20
|
+
var loadingText = _ref.loadingText,
|
|
21
|
+
pLoading = _ref.loading,
|
|
22
|
+
onClick = _ref.onClick,
|
|
23
|
+
children = _ref.children,
|
|
24
|
+
otherProps = _objectWithoutProperties(_ref, ["loadingText", "loading", "onClick", "children"]);
|
|
25
|
+
|
|
26
|
+
var _useState = useState(pLoading),
|
|
17
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18
28
|
loading = _useState2[0],
|
|
19
29
|
setLoading = _useState2[1];
|
|
20
30
|
|
|
21
|
-
var
|
|
31
|
+
var doClick = function doClick(evt) {
|
|
22
32
|
if (!loading) {
|
|
23
33
|
setLoading(true);
|
|
24
|
-
var returnVal =
|
|
34
|
+
var returnVal = onClick && onClick(evt, function () {
|
|
25
35
|
return setLoading(false);
|
|
26
36
|
});
|
|
27
37
|
|
|
@@ -36,10 +46,10 @@ export default (function (props) {
|
|
|
36
46
|
};
|
|
37
47
|
|
|
38
48
|
useEffect(function () {
|
|
39
|
-
setLoading(
|
|
40
|
-
}, [
|
|
41
|
-
return React.createElement(_Button, _extends({},
|
|
49
|
+
setLoading(pLoading);
|
|
50
|
+
}, [pLoading]);
|
|
51
|
+
return React.createElement(_Button, _extends({}, otherProps, {
|
|
42
52
|
loading: loading,
|
|
43
|
-
onClick:
|
|
44
|
-
}), loading ?
|
|
53
|
+
onClick: doClick
|
|
54
|
+
}), loading ? loadingText || children : children);
|
|
45
55
|
});
|
|
@@ -44,8 +44,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
44
44
|
var cookies = new _universalCookie["default"](); // 默认
|
|
45
45
|
|
|
46
46
|
var accountInfoDefault = {
|
|
47
|
-
account:
|
|
48
|
-
password:
|
|
47
|
+
account: undefined,
|
|
48
|
+
password: undefined
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
var _default = function _default(_ref) {
|
|
@@ -36,7 +36,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
36
36
|
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; }
|
|
37
37
|
|
|
38
38
|
function _templateObject() {
|
|
39
|
-
var data = _taggedTemplateLiteral(["\n list-style: none;\n display: inline-block;\n line-height: ", ";\n margin: 0 0 0 20px;\n .hasHeaderTabs & {\n margin: 0;\n }\n padding: 0;\n white-space: nowrap;\n\n .isInIframe & {\n display: none;\n }\n\n & > li {\n height: 100%;\n display: inline-block;\n vertical-align: top;\n cursor: pointer;\n font-size: 20px;\n margin: 0 7.5px;\n color: ", ";\n .large-size & {\n margin: 0 10px;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n &:last-of-type {\n margin-right: 0;\n }\n .hasHeaderTabs &{\n color: #455064;\n }\n // \u5220\u9664\u8272\u7CFB\u533A\u5206 \u7EDF\u4E00\u8272\u8C03\n // .hasHeaderTabs:not(.tnt-themeS1) & {\n // color: rgba(255,255,255,.8);\n // }\n .hasHeaderTabs:not(.tnt-themeS1) & {\n color: #455064 !important;\n }\n }\n"]);
|
|
39
|
+
var data = _taggedTemplateLiteral(["\n list-style: none;\n display: inline-block;\n line-height: ", ";\n margin: 0 0 0 20px;\n .hasHeaderTabs & {\n margin: 0;\n }\n padding: 0;\n white-space: nowrap;\n\n .isInIframe & {\n display: none;\n }\n\n & > li {\n height: 100%;\n display: inline-block;\n vertical-align: top;\n cursor: pointer;\n font-size: 20px;\n margin: 0 7.5px;\n color: ", ";\n .large-size & {\n margin: 0 10px;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n &:last-of-type {\n margin-right: 0;\n }\n .hasHeaderTabs & {\n color: #455064;\n }\n // \u5220\u9664\u8272\u7CFB\u533A\u5206 \u7EDF\u4E00\u8272\u8C03\n // .hasHeaderTabs:not(.tnt-themeS1) & {\n // color: rgba(255,255,255,.8);\n // }\n .hasHeaderTabs:not(.tnt-themeS1) & {\n color: #455064 !important;\n }\n }\n"]);
|
|
40
40
|
|
|
41
41
|
_templateObject = function _templateObject() {
|
|
42
42
|
return data;
|
|
@@ -89,7 +89,7 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
89
89
|
return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(_GlobalNavigation["default"], {
|
|
90
90
|
headerRef: headerRef,
|
|
91
91
|
menus: menus
|
|
92
|
-
}), !
|
|
92
|
+
}), !compatible ? React.createElement(React.Fragment, null, language && React.createElement(_Language["default"], {
|
|
93
93
|
language: userInfo.lang,
|
|
94
94
|
onChange: onLanguageChange
|
|
95
95
|
}), theme && React.createElement(_Theme["default"], {
|
|
@@ -101,7 +101,7 @@ var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
|
101
101
|
theme: userInfo.theme,
|
|
102
102
|
onLanguageChange: onLanguageChange,
|
|
103
103
|
onThemeChange: onThemeChange
|
|
104
|
-
})
|
|
104
|
+
}), application && React.createElement(_Application["default"], {
|
|
105
105
|
language: userInfo.lang,
|
|
106
106
|
apps: apps,
|
|
107
107
|
onChange: onApplicationChange
|
|
@@ -23,16 +23,26 @@ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) ||
|
|
|
23
23
|
|
|
24
24
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
25
|
|
|
26
|
-
var
|
|
27
|
-
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
var _default = function _default(_ref) {
|
|
31
|
+
var loadingText = _ref.loadingText,
|
|
32
|
+
pLoading = _ref.loading,
|
|
33
|
+
onClick = _ref.onClick,
|
|
34
|
+
children = _ref.children,
|
|
35
|
+
otherProps = _objectWithoutProperties(_ref, ["loadingText", "loading", "onClick", "children"]);
|
|
36
|
+
|
|
37
|
+
var _useState = (0, _react.useState)(pLoading),
|
|
28
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
39
|
loading = _useState2[0],
|
|
30
40
|
setLoading = _useState2[1];
|
|
31
41
|
|
|
32
|
-
var
|
|
42
|
+
var doClick = function doClick(evt) {
|
|
33
43
|
if (!loading) {
|
|
34
44
|
setLoading(true);
|
|
35
|
-
var returnVal =
|
|
45
|
+
var returnVal = onClick && onClick(evt, function () {
|
|
36
46
|
return setLoading(false);
|
|
37
47
|
});
|
|
38
48
|
|
|
@@ -47,12 +57,12 @@ var _default = function _default(props) {
|
|
|
47
57
|
};
|
|
48
58
|
|
|
49
59
|
(0, _react.useEffect)(function () {
|
|
50
|
-
setLoading(
|
|
51
|
-
}, [
|
|
52
|
-
return React.createElement(_button["default"], _extends({},
|
|
60
|
+
setLoading(pLoading);
|
|
61
|
+
}, [pLoading]);
|
|
62
|
+
return React.createElement(_button["default"], _extends({}, otherProps, {
|
|
53
63
|
loading: loading,
|
|
54
|
-
onClick:
|
|
55
|
-
}), loading ?
|
|
64
|
+
onClick: doClick
|
|
65
|
+
}), loading ? loadingText || children : children);
|
|
56
66
|
};
|
|
57
67
|
|
|
58
68
|
exports["default"] = _default;
|