@arcblock/ux 2.4.27 → 2.4.28

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.
@@ -58,11 +58,12 @@ const setLocaleParam = function setLocaleParam(locale) {
58
58
  }
59
59
  };
60
60
 
61
- const getLocale = languages => {
61
+ const getLocale = function getLocale() {
62
62
  var _languages$;
63
63
 
64
+ let languages = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
64
65
  const langParams = {
65
- languages: (languages || []).map(item => item.value),
66
+ languages: languages.map(item => item.value),
66
67
  // 取 languages 首个元素的 value 值, 如果不存在则取 'en'
67
68
  fallback: (languages === null || languages === void 0 ? void 0 : (_languages$ = languages[0]) === null || _languages$ === void 0 ? void 0 : _languages$.value) || 'en'
68
69
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.4.27",
3
+ "version": "2.4.28",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -47,10 +47,10 @@
47
47
  "react": ">=18.1.0",
48
48
  "react-ga": "^2.7.0"
49
49
  },
50
- "gitHead": "89ac06d01dc874b1248e553f3563d57c36ea6647",
50
+ "gitHead": "3133ed4e76d70eff05b08130fa7340dcc07611c4",
51
51
  "dependencies": {
52
- "@arcblock/icons": "^2.4.27",
53
- "@arcblock/react-hooks": "^2.4.27",
52
+ "@arcblock/icons": "^2.4.28",
53
+ "@arcblock/react-hooks": "^2.4.28",
54
54
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
55
55
  "@emotion/react": "^11.10.0",
56
56
  "@emotion/styled": "^11.10.0",
@@ -26,9 +26,9 @@ const setLocaleParam = (locale, url = window.location.href) => {
26
26
  }
27
27
  };
28
28
 
29
- const getLocale = (languages) => {
29
+ const getLocale = (languages = []) => {
30
30
  const langParams = {
31
- languages: (languages || []).map((item) => item.value),
31
+ languages: languages.map((item) => item.value),
32
32
  // 取 languages 首个元素的 value 值, 如果不存在则取 'en'
33
33
  fallback: languages?.[0]?.value || 'en',
34
34
  };