@arcblock/ux 2.1.68 → 2.1.69
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/lib/Locale/selector.js
CHANGED
@@ -31,17 +31,15 @@ var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
31
31
|
|
32
32
|
var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
|
33
33
|
|
34
|
+
var _Globe = _interopRequireDefault(require("@arcblock/icons/lib/Globe"));
|
35
|
+
|
34
36
|
var _Util = require("../Util");
|
35
37
|
|
36
38
|
var _context = require("./context");
|
37
39
|
|
38
|
-
var _globeDark = _interopRequireDefault(require("./images/globe-dark.png"));
|
39
|
-
|
40
|
-
var _globeLight = _interopRequireDefault(require("./images/globe-light.png"));
|
41
|
-
|
42
40
|
var _jsxRuntime = require("react/jsx-runtime");
|
43
41
|
|
44
|
-
const _excluded = ["
|
42
|
+
const _excluded = ["showText", "popperProps", "popperType", "icon"];
|
45
43
|
|
46
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
47
45
|
|
@@ -56,8 +54,9 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
56
54
|
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; }
|
57
55
|
|
58
56
|
function LocaleSelector(props) {
|
57
|
+
var _theme$palette, _theme$palette2, _theme$palette2$text;
|
58
|
+
|
59
59
|
const {
|
60
|
-
dark,
|
61
60
|
showText,
|
62
61
|
popperProps,
|
63
62
|
popperType,
|
@@ -72,6 +71,7 @@ function LocaleSelector(props) {
|
|
72
71
|
const anchorEl = (0, _react.useRef)(null);
|
73
72
|
const [open, setOpen] = (0, _react.useState)(false);
|
74
73
|
const theme = (0, _styles.useTheme)();
|
74
|
+
const dark = (theme === null || theme === void 0 ? void 0 : (_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.mode) === 'dark';
|
75
75
|
|
76
76
|
const onSelect = newLocale => {
|
77
77
|
changeLocale(newLocale);
|
@@ -107,12 +107,14 @@ function LocaleSelector(props) {
|
|
107
107
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {});
|
108
108
|
}
|
109
109
|
|
110
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
111
|
-
|
112
|
-
|
113
|
-
|
110
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Globe.default, {
|
111
|
+
style: {
|
112
|
+
width: 26,
|
113
|
+
height: 24.76,
|
114
|
+
color: theme.palette.text.secondary
|
115
|
+
}
|
114
116
|
});
|
115
|
-
}, [Icon,
|
117
|
+
}, [Icon, theme === null || theme === void 0 ? void 0 : (_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 ? void 0 : (_theme$palette2$text = _theme$palette2.text) === null || _theme$palette2$text === void 0 ? void 0 : _theme$palette2$text.secondary]);
|
116
118
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Div, _objectSpread(_objectSpread(_objectSpread({
|
117
119
|
component: "div",
|
118
120
|
dark: dark,
|
@@ -162,7 +164,6 @@ function LocaleSelector(props) {
|
|
162
164
|
}
|
163
165
|
|
164
166
|
LocaleSelector.propTypes = {
|
165
|
-
dark: _propTypes.default.bool,
|
166
167
|
size: _propTypes.default.number,
|
167
168
|
showText: _propTypes.default.bool,
|
168
169
|
popperProps: _propTypes.default.object,
|
@@ -171,7 +172,6 @@ LocaleSelector.propTypes = {
|
|
171
172
|
icon: _propTypes.default.any
|
172
173
|
};
|
173
174
|
LocaleSelector.defaultProps = {
|
174
|
-
dark: false,
|
175
175
|
showText: true,
|
176
176
|
size: 24,
|
177
177
|
popperProps: {},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.69",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -48,10 +48,10 @@
|
|
48
48
|
"react": ">=18.1.0",
|
49
49
|
"react-ga": "^2.7.0"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "84373c9197af46cc11f69940e31163e11d55fe6f",
|
52
52
|
"dependencies": {
|
53
|
-
"@arcblock/icons": "^2.1.
|
54
|
-
"@arcblock/react-hooks": "^2.1.
|
53
|
+
"@arcblock/icons": "^2.1.69",
|
54
|
+
"@arcblock/react-hooks": "^2.1.69",
|
55
55
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
56
56
|
"@emotion/react": "^11.9.0",
|
57
57
|
"@emotion/styled": "^11.8.1",
|
package/src/Locale/selector.js
CHANGED
@@ -13,20 +13,19 @@ import MenuItem from '@mui/material/MenuItem';
|
|
13
13
|
import MenuList from '@mui/material/MenuList';
|
14
14
|
import Box from '@mui/material/Box';
|
15
15
|
import CheckIcon from '@mui/icons-material/Check';
|
16
|
+
import GlobeIcon from '@arcblock/icons/lib/Globe';
|
16
17
|
|
17
18
|
import { getColor, getBackground } from '../Util';
|
18
19
|
|
19
20
|
import { LocaleContext, languages } from './context';
|
20
21
|
|
21
|
-
import globeDark from './images/globe-dark.png';
|
22
|
-
import globeLight from './images/globe-light.png';
|
23
|
-
|
24
22
|
function LocaleSelector(props) {
|
25
|
-
const {
|
23
|
+
const { showText, popperProps, popperType, icon: Icon, ...rest } = props;
|
26
24
|
const { locale, changeLocale } = useContext(LocaleContext);
|
27
25
|
const anchorEl = useRef(null);
|
28
26
|
const [open, setOpen] = useState(false);
|
29
27
|
const theme = useTheme();
|
28
|
+
const dark = theme?.palette?.mode === 'dark';
|
30
29
|
|
31
30
|
const onSelect = (newLocale) => {
|
32
31
|
changeLocale(newLocale);
|
@@ -64,8 +63,8 @@ function LocaleSelector(props) {
|
|
64
63
|
return <Icon />;
|
65
64
|
}
|
66
65
|
|
67
|
-
return <
|
68
|
-
}, [Icon,
|
66
|
+
return <GlobeIcon style={{ width: 26, height: 24.76, color: theme.palette.text.secondary }} />;
|
67
|
+
}, [Icon, theme?.palette?.text?.secondary]);
|
69
68
|
|
70
69
|
return (
|
71
70
|
<Div component="div" dark={dark} theme={theme} {...rest} {...handleEventProps}>
|
@@ -105,7 +104,6 @@ function LocaleSelector(props) {
|
|
105
104
|
}
|
106
105
|
|
107
106
|
LocaleSelector.propTypes = {
|
108
|
-
dark: PropTypes.bool,
|
109
107
|
size: PropTypes.number,
|
110
108
|
showText: PropTypes.bool,
|
111
109
|
popperProps: PropTypes.object,
|
@@ -115,7 +113,6 @@ LocaleSelector.propTypes = {
|
|
115
113
|
};
|
116
114
|
|
117
115
|
LocaleSelector.defaultProps = {
|
118
|
-
dark: false,
|
119
116
|
showText: true,
|
120
117
|
size: 24,
|
121
118
|
popperProps: {},
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|