@hi-ui/hiui 5.0.0-canary.41 → 5.0.0-canary.43
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/CHANGELOG.md +35 -0
- package/lib/cjs/ui/locale-context/lib/esm/LocaleProvider.js +61 -4
- package/lib/cjs/ui/locale-context/lib/esm/locale/en-US.js +1 -10
- package/lib/cjs/ui/locale-context/lib/esm/locale/index.js +3 -12
- package/lib/cjs/ui/locale-context/lib/esm/locale/zh-CN.js +0 -10
- package/lib/cjs/ui/locale-context/lib/esm/locale/zh-HK.js +0 -10
- package/lib/cjs/ui/locale-context/lib/esm/locale/zh-TW.js +0 -10
- package/lib/cjs/ui/locale-context/lib/esm/types.js +30 -11
- package/lib/esm/ui/locale-context/lib/esm/LocaleProvider.js +62 -5
- package/lib/esm/ui/locale-context/lib/esm/locale/en-US.js +1 -9
- package/lib/esm/ui/locale-context/lib/esm/locale/index.js +2 -12
- package/lib/esm/ui/locale-context/lib/esm/locale/zh-CN.js +0 -9
- package/lib/esm/ui/locale-context/lib/esm/locale/zh-HK.js +0 -9
- package/lib/esm/ui/locale-context/lib/esm/locale/zh-TW.js +0 -9
- package/lib/esm/ui/locale-context/lib/esm/types.js +30 -10
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @hi-ui/hiui
|
|
2
2
|
|
|
3
|
+
## 5.0.0-canary.43
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 68614f4f1: <br>
|
|
8
|
+
- feat(preview): title 参数支持传入函数返回自定义内容 (5.0)
|
|
9
|
+
- fix(preview): 修复禁止下载时下载按钮没有隐藏问题 (5.0)
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 7fd475d45: fix(check-cascader): 修复非平铺展示搜索结果时显示出层级问题 (5.0)
|
|
14
|
+
- 305b4dd37: style: fix ui bug (5.0)
|
|
15
|
+
- d5092f349: refactor(table): stretchHeight 模式不再使用双表格结构,使用 sticky 实现 (5.0)
|
|
16
|
+
- Updated dependencies [7fd475d45]
|
|
17
|
+
- Updated dependencies [305b4dd37]
|
|
18
|
+
- Updated dependencies [d5092f349]
|
|
19
|
+
- Updated dependencies [68614f4f1]
|
|
20
|
+
- @hi-ui/check-cascader@5.0.0-canary.24
|
|
21
|
+
- @hi-ui/collapse@5.0.0-canary.10
|
|
22
|
+
- @hi-ui/layout@5.0.0-canary.15
|
|
23
|
+
- @hi-ui/menu@5.0.0-canary.17
|
|
24
|
+
- @hi-ui/tooltip@5.0.0-canary.9
|
|
25
|
+
- @hi-ui/upload@5.0.0-canary.13
|
|
26
|
+
- @hi-ui/table@5.0.0-canary.25
|
|
27
|
+
- @hi-ui/preview@5.0.0-canary.10
|
|
28
|
+
|
|
29
|
+
## 5.0.0-canary.42
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- 732decb61: perf(table): 优化表格列宽更新逻辑,当内容宽度没有超出时再更新列宽 (5.0)
|
|
34
|
+
- Updated dependencies [732decb61]
|
|
35
|
+
- @hi-ui/empty-state@5.0.0-canary.9
|
|
36
|
+
- @hi-ui/table@5.0.0-canary.24
|
|
37
|
+
|
|
3
38
|
## 5.0.0-canary.41
|
|
4
39
|
|
|
5
40
|
### Minor Changes
|
|
@@ -34,15 +34,16 @@ var LocaleProvider = function LocaleProvider(_ref) {
|
|
|
34
34
|
locale = _ref$locale === void 0 ? DEFAULT_LOCALE : _ref$locale,
|
|
35
35
|
languages = _ref.languages;
|
|
36
36
|
var get = React.useMemo(function () {
|
|
37
|
-
var languageData = _typeof__default["default"](languages) === 'object' ? languages : USER_LANGUAGES_TABLES[locale] || index[
|
|
37
|
+
var languageData = _typeof__default["default"](languages) === 'object' ? languages : USER_LANGUAGES_TABLES[locale] || index.BUILT_IN_LOCALES[locale];
|
|
38
38
|
if (!languageData) {
|
|
39
|
-
index$1.invariant(false, "
|
|
40
|
-
languageData = index[
|
|
39
|
+
index$1.invariant(false, "Language package for \"" + locale + "\" is missing. Please import and pass it via the \"languages\" prop. Falling back to " + DEFAULT_LOCALE + ".");
|
|
40
|
+
languageData = index.BUILT_IN_LOCALES[DEFAULT_LOCALE];
|
|
41
41
|
}
|
|
42
42
|
return LocaleContext.getLanguage(languageData);
|
|
43
43
|
}, [locale, languages]);
|
|
44
44
|
var providedValue = React.useMemo(function () {
|
|
45
|
-
|
|
45
|
+
var localeData = USER_LANGUAGES_TABLES[locale] || index.BUILT_IN_LOCALES[locale] || {};
|
|
46
|
+
return Object.assign(Object.assign({}, localeData), {
|
|
46
47
|
get: get,
|
|
47
48
|
locale: locale
|
|
48
49
|
});
|
|
@@ -54,6 +55,19 @@ var LocaleProvider = function LocaleProvider(_ref) {
|
|
|
54
55
|
if (index$1.__DEV__) {
|
|
55
56
|
LocaleProvider.displayName = 'LocaleProvider';
|
|
56
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* 使用完整的自定义语言包扩展国际化
|
|
60
|
+
* @param locale - 地区标识
|
|
61
|
+
* @param languages - 完整的语言包对象
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* LocaleProvider.extends('pt-BR', {
|
|
66
|
+
* timePicker: { ok: 'OK', to: '-', now: 'Agora' },
|
|
67
|
+
* // ... 其他翻译
|
|
68
|
+
* })
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
57
71
|
var extendsLanguage = function extendsLanguage(locale, languages) {
|
|
58
72
|
if (!languages) {
|
|
59
73
|
delete USER_LANGUAGES_TABLES[locale];
|
|
@@ -61,5 +75,48 @@ var extendsLanguage = function extendsLanguage(locale, languages) {
|
|
|
61
75
|
USER_LANGUAGES_TABLES[locale] = languages;
|
|
62
76
|
}
|
|
63
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* 合并默认语言包和自定义翻译
|
|
80
|
+
* 支持基于现有的内置语言包进行部分覆盖
|
|
81
|
+
* @param baseLocale - 基础语言(如 'en-US')
|
|
82
|
+
* @param customLocale - 自定义地区标识
|
|
83
|
+
* @param overrides - 要覆盖的翻译对象(支持深度覆盖)
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* LocaleProvider.merge('en-US', 'en-GB', {
|
|
88
|
+
* modal: { confirmText: 'Confirm', cancelText: 'Cancel' }
|
|
89
|
+
* })
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
var mergeLanguage = function mergeLanguage(baseLocale, customLocale, overrides) {
|
|
93
|
+
var baseLanguage = USER_LANGUAGES_TABLES[baseLocale] || index.BUILT_IN_LOCALES[baseLocale] || index.BUILT_IN_LOCALES[DEFAULT_LOCALE];
|
|
94
|
+
if (!baseLanguage) {
|
|
95
|
+
index$1.invariant(false, "Base locale \"" + baseLocale + "\" is not found. Please use LocaleProvider.extends() to add it first.");
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
// 深度合并
|
|
99
|
+
var merged = deepMerge(baseLanguage, overrides);
|
|
100
|
+
USER_LANGUAGES_TABLES[customLocale] = merged;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* 深度合并对象
|
|
104
|
+
*/
|
|
105
|
+
function deepMerge(target, source) {
|
|
106
|
+
var result = Object.assign({}, target);
|
|
107
|
+
for (var key in source) {
|
|
108
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
109
|
+
var sourceValue = source[key];
|
|
110
|
+
var targetValue = result[key];
|
|
111
|
+
if (sourceValue !== null && _typeof__default["default"](sourceValue) === 'object' && !Array.isArray(sourceValue) && targetValue !== null && _typeof__default["default"](targetValue) === 'object' && !Array.isArray(targetValue)) {
|
|
112
|
+
result[key] = deepMerge(targetValue, sourceValue);
|
|
113
|
+
} else {
|
|
114
|
+
result[key] = sourceValue;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
64
120
|
LocaleProvider["extends"] = extendsLanguage;
|
|
121
|
+
LocaleProvider.merge = mergeLanguage;
|
|
65
122
|
exports.LocaleProvider = LocaleProvider;
|
|
@@ -12,16 +12,6 @@
|
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
|
13
13
|
value: true
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
/** @LICENSE
|
|
17
|
-
* @hi-ui/locale-context
|
|
18
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
15
|
var enUS = {
|
|
26
16
|
timePicker: {
|
|
27
17
|
ok: 'OK',
|
|
@@ -58,6 +48,7 @@ var enUS = {
|
|
|
58
48
|
timeperiod: ['Select Start Date Time', 'Select Start End Time'],
|
|
59
49
|
timerange: ['Select Start Date Time', 'Select Start End Time']
|
|
60
50
|
},
|
|
51
|
+
year: 'year',
|
|
61
52
|
timePeriod: 'Period',
|
|
62
53
|
hours: 'H',
|
|
63
54
|
minutes: 'M',
|
|
@@ -16,21 +16,12 @@ var zhCN = require('./zh-CN.js');
|
|
|
16
16
|
var enUS = require('./en-US.js');
|
|
17
17
|
var zhHK = require('./zh-HK.js');
|
|
18
18
|
var zhTW = require('./zh-TW.js');
|
|
19
|
-
|
|
20
|
-
/** @LICENSE
|
|
21
|
-
* @hi-ui/locale-context
|
|
22
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
23
|
-
*
|
|
24
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
25
|
-
*
|
|
26
|
-
* This source code is licensed under the MIT license found in the
|
|
27
|
-
* LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/
|
|
29
|
-
var localeMap = {
|
|
19
|
+
var BUILT_IN_LOCALES = {
|
|
30
20
|
'zh-CN': zhCN["default"],
|
|
31
21
|
'zh-Hans': zhCN["default"],
|
|
32
22
|
'en-US': enUS["default"],
|
|
33
23
|
'zh-HK': zhHK["default"],
|
|
34
24
|
'zh-TW': zhTW["default"]
|
|
35
25
|
};
|
|
36
|
-
exports
|
|
26
|
+
exports.BUILT_IN_LOCALES = BUILT_IN_LOCALES;
|
|
27
|
+
exports["default"] = BUILT_IN_LOCALES;
|
|
@@ -12,16 +12,6 @@
|
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
|
13
13
|
value: true
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
/** @LICENSE
|
|
17
|
-
* @hi-ui/locale-context
|
|
18
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
15
|
var zhCN = {
|
|
26
16
|
timePicker: {
|
|
27
17
|
ok: '确认',
|
|
@@ -12,16 +12,6 @@
|
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
|
13
13
|
value: true
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
/** @LICENSE
|
|
17
|
-
* @hi-ui/locale-context
|
|
18
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
15
|
var zhHK = {
|
|
26
16
|
timePicker: {
|
|
27
17
|
ok: '確認',
|
|
@@ -12,16 +12,6 @@
|
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
|
13
13
|
value: true
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
/** @LICENSE
|
|
17
|
-
* @hi-ui/locale-context
|
|
18
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
15
|
var zhTW = {
|
|
26
16
|
timePicker: {
|
|
27
17
|
ok: '確認',
|
|
@@ -12,21 +12,40 @@
|
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
|
13
13
|
value: true
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
/** @LICENSE
|
|
17
|
-
* @hi-ui/locale-context
|
|
18
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
15
|
var LocaleEnum = {
|
|
26
16
|
ZH_CN: 'zh-CN',
|
|
27
17
|
ZH_HANS: 'zh-Hans',
|
|
28
18
|
EN_US: 'en-US',
|
|
29
19
|
ZH_HK: 'zh-HK',
|
|
30
|
-
ZH_TW: 'zh-TW'
|
|
20
|
+
ZH_TW: 'zh-TW',
|
|
21
|
+
TH_TH: 'th-TH',
|
|
22
|
+
// European languages
|
|
23
|
+
PT_PT: 'pt-PT',
|
|
24
|
+
PT_BR: 'pt-BR',
|
|
25
|
+
FR_FR: 'fr-FR',
|
|
26
|
+
DE_DE: 'de-DE',
|
|
27
|
+
ES_ES: 'es-ES',
|
|
28
|
+
IT_IT: 'it-IT',
|
|
29
|
+
NL_NL: 'nl-NL',
|
|
30
|
+
EL_GR: 'el-GR',
|
|
31
|
+
CS_CZ: 'cs-CZ',
|
|
32
|
+
DA_DK: 'da-DK',
|
|
33
|
+
FI_FI: 'fi-FI',
|
|
34
|
+
TR_TR: 'tr-TR',
|
|
35
|
+
// Asian languages
|
|
36
|
+
JA_JP: 'ja-JP',
|
|
37
|
+
KO_KR: 'ko-KR',
|
|
38
|
+
VI_VN: 'vi-VN',
|
|
39
|
+
// Caucasian & Central Asian languages
|
|
40
|
+
HY_AM: 'hy-AM',
|
|
41
|
+
AZ_AZ: 'az-AZ',
|
|
42
|
+
RU_RU: 'ru-RU',
|
|
43
|
+
KA_GE: 'ka-GE',
|
|
44
|
+
UZ_UZ: 'uz-UZ',
|
|
45
|
+
// Balkan languages
|
|
46
|
+
BS_BA: 'bs-BA',
|
|
47
|
+
BG_BG: 'bg-BG',
|
|
48
|
+
// South Asian languages
|
|
49
|
+
UR_PK: 'ur-PK'
|
|
31
50
|
};
|
|
32
51
|
exports.LocaleEnum = LocaleEnum;
|
|
@@ -11,7 +11,7 @@ import _typeof from '@babel/runtime/helpers/esm/typeof';
|
|
|
11
11
|
import React, { useMemo } from 'react';
|
|
12
12
|
import { invariant, __DEV__ } from '../../../../utils/env/lib/esm/index.js';
|
|
13
13
|
import { getLanguage, LocaleContext } from './LocaleContext.js';
|
|
14
|
-
import
|
|
14
|
+
import { BUILT_IN_LOCALES } from './locale/index.js';
|
|
15
15
|
var DEFAULT_LOCALE = 'zh-CN';
|
|
16
16
|
// 自定义语言包注册表
|
|
17
17
|
var USER_LANGUAGES_TABLES = {};
|
|
@@ -21,15 +21,16 @@ var LocaleProvider = function LocaleProvider(_ref) {
|
|
|
21
21
|
locale = _ref$locale === void 0 ? DEFAULT_LOCALE : _ref$locale,
|
|
22
22
|
languages = _ref.languages;
|
|
23
23
|
var get = useMemo(function () {
|
|
24
|
-
var languageData = _typeof(languages) === 'object' ? languages : USER_LANGUAGES_TABLES[locale] ||
|
|
24
|
+
var languageData = _typeof(languages) === 'object' ? languages : USER_LANGUAGES_TABLES[locale] || BUILT_IN_LOCALES[locale];
|
|
25
25
|
if (!languageData) {
|
|
26
|
-
invariant(false, "
|
|
27
|
-
languageData =
|
|
26
|
+
invariant(false, "Language package for \"" + locale + "\" is missing. Please import and pass it via the \"languages\" prop. Falling back to " + DEFAULT_LOCALE + ".");
|
|
27
|
+
languageData = BUILT_IN_LOCALES[DEFAULT_LOCALE];
|
|
28
28
|
}
|
|
29
29
|
return getLanguage(languageData);
|
|
30
30
|
}, [locale, languages]);
|
|
31
31
|
var providedValue = useMemo(function () {
|
|
32
|
-
|
|
32
|
+
var localeData = USER_LANGUAGES_TABLES[locale] || BUILT_IN_LOCALES[locale] || {};
|
|
33
|
+
return Object.assign(Object.assign({}, localeData), {
|
|
33
34
|
get: get,
|
|
34
35
|
locale: locale
|
|
35
36
|
});
|
|
@@ -41,6 +42,19 @@ var LocaleProvider = function LocaleProvider(_ref) {
|
|
|
41
42
|
if (__DEV__) {
|
|
42
43
|
LocaleProvider.displayName = 'LocaleProvider';
|
|
43
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* 使用完整的自定义语言包扩展国际化
|
|
47
|
+
* @param locale - 地区标识
|
|
48
|
+
* @param languages - 完整的语言包对象
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* LocaleProvider.extends('pt-BR', {
|
|
53
|
+
* timePicker: { ok: 'OK', to: '-', now: 'Agora' },
|
|
54
|
+
* // ... 其他翻译
|
|
55
|
+
* })
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
44
58
|
var extendsLanguage = function extendsLanguage(locale, languages) {
|
|
45
59
|
if (!languages) {
|
|
46
60
|
delete USER_LANGUAGES_TABLES[locale];
|
|
@@ -48,5 +62,48 @@ var extendsLanguage = function extendsLanguage(locale, languages) {
|
|
|
48
62
|
USER_LANGUAGES_TABLES[locale] = languages;
|
|
49
63
|
}
|
|
50
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* 合并默认语言包和自定义翻译
|
|
67
|
+
* 支持基于现有的内置语言包进行部分覆盖
|
|
68
|
+
* @param baseLocale - 基础语言(如 'en-US')
|
|
69
|
+
* @param customLocale - 自定义地区标识
|
|
70
|
+
* @param overrides - 要覆盖的翻译对象(支持深度覆盖)
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* LocaleProvider.merge('en-US', 'en-GB', {
|
|
75
|
+
* modal: { confirmText: 'Confirm', cancelText: 'Cancel' }
|
|
76
|
+
* })
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
var mergeLanguage = function mergeLanguage(baseLocale, customLocale, overrides) {
|
|
80
|
+
var baseLanguage = USER_LANGUAGES_TABLES[baseLocale] || BUILT_IN_LOCALES[baseLocale] || BUILT_IN_LOCALES[DEFAULT_LOCALE];
|
|
81
|
+
if (!baseLanguage) {
|
|
82
|
+
invariant(false, "Base locale \"" + baseLocale + "\" is not found. Please use LocaleProvider.extends() to add it first.");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
// 深度合并
|
|
86
|
+
var merged = deepMerge(baseLanguage, overrides);
|
|
87
|
+
USER_LANGUAGES_TABLES[customLocale] = merged;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* 深度合并对象
|
|
91
|
+
*/
|
|
92
|
+
function deepMerge(target, source) {
|
|
93
|
+
var result = Object.assign({}, target);
|
|
94
|
+
for (var key in source) {
|
|
95
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
96
|
+
var sourceValue = source[key];
|
|
97
|
+
var targetValue = result[key];
|
|
98
|
+
if (sourceValue !== null && _typeof(sourceValue) === 'object' && !Array.isArray(sourceValue) && targetValue !== null && _typeof(targetValue) === 'object' && !Array.isArray(targetValue)) {
|
|
99
|
+
result[key] = deepMerge(targetValue, sourceValue);
|
|
100
|
+
} else {
|
|
101
|
+
result[key] = sourceValue;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
51
107
|
LocaleProvider["extends"] = extendsLanguage;
|
|
108
|
+
LocaleProvider.merge = mergeLanguage;
|
|
52
109
|
export { LocaleProvider };
|
|
@@ -7,15 +7,6 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
/** @LICENSE
|
|
11
|
-
* @hi-ui/locale-context
|
|
12
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/
|
|
19
10
|
var enUS = {
|
|
20
11
|
timePicker: {
|
|
21
12
|
ok: 'OK',
|
|
@@ -52,6 +43,7 @@ var enUS = {
|
|
|
52
43
|
timeperiod: ['Select Start Date Time', 'Select Start End Time'],
|
|
53
44
|
timerange: ['Select Start Date Time', 'Select Start End Time']
|
|
54
45
|
},
|
|
46
|
+
year: 'year',
|
|
55
47
|
timePeriod: 'Period',
|
|
56
48
|
hours: 'H',
|
|
57
49
|
minutes: 'M',
|
|
@@ -11,21 +11,11 @@ import zhCN from './zh-CN.js';
|
|
|
11
11
|
import enUS from './en-US.js';
|
|
12
12
|
import zhHK from './zh-HK.js';
|
|
13
13
|
import zhTW from './zh-TW.js';
|
|
14
|
-
|
|
15
|
-
/** @LICENSE
|
|
16
|
-
* @hi-ui/locale-context
|
|
17
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
18
|
-
*
|
|
19
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
20
|
-
*
|
|
21
|
-
* This source code is licensed under the MIT license found in the
|
|
22
|
-
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/
|
|
24
|
-
var localeMap = {
|
|
14
|
+
var BUILT_IN_LOCALES = {
|
|
25
15
|
'zh-CN': zhCN,
|
|
26
16
|
'zh-Hans': zhCN,
|
|
27
17
|
'en-US': enUS,
|
|
28
18
|
'zh-HK': zhHK,
|
|
29
19
|
'zh-TW': zhTW
|
|
30
20
|
};
|
|
31
|
-
export {
|
|
21
|
+
export { BUILT_IN_LOCALES, BUILT_IN_LOCALES as default };
|
|
@@ -7,15 +7,6 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
/** @LICENSE
|
|
11
|
-
* @hi-ui/locale-context
|
|
12
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/
|
|
19
10
|
var zhCN = {
|
|
20
11
|
timePicker: {
|
|
21
12
|
ok: '确认',
|
|
@@ -7,15 +7,6 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
/** @LICENSE
|
|
11
|
-
* @hi-ui/locale-context
|
|
12
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/
|
|
19
10
|
var zhHK = {
|
|
20
11
|
timePicker: {
|
|
21
12
|
ok: '確認',
|
|
@@ -7,15 +7,6 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
/** @LICENSE
|
|
11
|
-
* @hi-ui/locale-context
|
|
12
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/
|
|
19
10
|
var zhTW = {
|
|
20
11
|
timePicker: {
|
|
21
12
|
ok: '確認',
|
|
@@ -7,20 +7,40 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
/** @LICENSE
|
|
11
|
-
* @hi-ui/locale-context
|
|
12
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/locale-context#readme
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/
|
|
19
10
|
var LocaleEnum = {
|
|
20
11
|
ZH_CN: 'zh-CN',
|
|
21
12
|
ZH_HANS: 'zh-Hans',
|
|
22
13
|
EN_US: 'en-US',
|
|
23
14
|
ZH_HK: 'zh-HK',
|
|
24
|
-
ZH_TW: 'zh-TW'
|
|
15
|
+
ZH_TW: 'zh-TW',
|
|
16
|
+
TH_TH: 'th-TH',
|
|
17
|
+
// European languages
|
|
18
|
+
PT_PT: 'pt-PT',
|
|
19
|
+
PT_BR: 'pt-BR',
|
|
20
|
+
FR_FR: 'fr-FR',
|
|
21
|
+
DE_DE: 'de-DE',
|
|
22
|
+
ES_ES: 'es-ES',
|
|
23
|
+
IT_IT: 'it-IT',
|
|
24
|
+
NL_NL: 'nl-NL',
|
|
25
|
+
EL_GR: 'el-GR',
|
|
26
|
+
CS_CZ: 'cs-CZ',
|
|
27
|
+
DA_DK: 'da-DK',
|
|
28
|
+
FI_FI: 'fi-FI',
|
|
29
|
+
TR_TR: 'tr-TR',
|
|
30
|
+
// Asian languages
|
|
31
|
+
JA_JP: 'ja-JP',
|
|
32
|
+
KO_KR: 'ko-KR',
|
|
33
|
+
VI_VN: 'vi-VN',
|
|
34
|
+
// Caucasian & Central Asian languages
|
|
35
|
+
HY_AM: 'hy-AM',
|
|
36
|
+
AZ_AZ: 'az-AZ',
|
|
37
|
+
RU_RU: 'ru-RU',
|
|
38
|
+
KA_GE: 'ka-GE',
|
|
39
|
+
UZ_UZ: 'uz-UZ',
|
|
40
|
+
// Balkan languages
|
|
41
|
+
BS_BA: 'bs-BA',
|
|
42
|
+
BG_BG: 'bg-BG',
|
|
43
|
+
// South Asian languages
|
|
44
|
+
UR_PK: 'ur-PK'
|
|
25
45
|
};
|
|
26
46
|
export { LocaleEnum };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hi-ui/hiui",
|
|
3
|
-
"version": "5.0.0-canary.
|
|
3
|
+
"version": "5.0.0-canary.43",
|
|
4
4
|
"description": "The root-package for @hi-ui/hiui.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "HiUI <mi-hiui@xiaomi.com>",
|
|
@@ -54,18 +54,18 @@
|
|
|
54
54
|
"@hi-ui/card": "^5.0.0-canary.8",
|
|
55
55
|
"@hi-ui/carousel": "^5.0.0-canary.7",
|
|
56
56
|
"@hi-ui/cascader": "^5.0.0-canary.21",
|
|
57
|
-
"@hi-ui/check-cascader": "^5.0.0-canary.
|
|
57
|
+
"@hi-ui/check-cascader": "^5.0.0-canary.24",
|
|
58
58
|
"@hi-ui/check-select": "^5.0.0-canary.18",
|
|
59
59
|
"@hi-ui/check-tree-select": "^5.0.0-canary.18",
|
|
60
60
|
"@hi-ui/checkbox": "^5.0.0-canary.7",
|
|
61
|
-
"@hi-ui/collapse": "^5.0.0-canary.
|
|
61
|
+
"@hi-ui/collapse": "^5.0.0-canary.10",
|
|
62
62
|
"@hi-ui/counter": "^5.0.0-canary.7",
|
|
63
63
|
"@hi-ui/date-picker": "^5.0.0-canary.26",
|
|
64
64
|
"@hi-ui/descriptions": "^5.0.0-canary.8",
|
|
65
65
|
"@hi-ui/drawer": "^5.0.0-canary.9",
|
|
66
66
|
"@hi-ui/dropdown": "^5.0.0-canary.10",
|
|
67
67
|
"@hi-ui/ellipsis-tooltip": "^5.0.0-canary.6",
|
|
68
|
-
"@hi-ui/empty-state": "^5.0.0-canary.
|
|
68
|
+
"@hi-ui/empty-state": "^5.0.0-canary.9",
|
|
69
69
|
"@hi-ui/filter": "^5.0.0-canary.6",
|
|
70
70
|
"@hi-ui/form": "^5.0.0-canary.12",
|
|
71
71
|
"@hi-ui/grid": "^5.0.0-canary.6",
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"@hi-ui/icon-button": "^5.0.0-canary.8",
|
|
74
74
|
"@hi-ui/input": "^5.0.0-canary.17",
|
|
75
75
|
"@hi-ui/input-group": "^5.0.0-canary.5",
|
|
76
|
-
"@hi-ui/layout": "^5.0.0-canary.
|
|
76
|
+
"@hi-ui/layout": "^5.0.0-canary.15",
|
|
77
77
|
"@hi-ui/list": "^5.0.0-canary.8",
|
|
78
78
|
"@hi-ui/loading": "^5.0.0-canary.9",
|
|
79
|
-
"@hi-ui/menu": "^5.0.0-canary.
|
|
79
|
+
"@hi-ui/menu": "^5.0.0-canary.17",
|
|
80
80
|
"@hi-ui/message": "^5.0.0-canary.11",
|
|
81
81
|
"@hi-ui/modal": "^5.0.0-canary.12",
|
|
82
82
|
"@hi-ui/notification": "^5.0.0-canary.10",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@hi-ui/popper": "^5.0.0-canary.12",
|
|
89
89
|
"@hi-ui/popover": "^5.0.0-canary.10",
|
|
90
90
|
"@hi-ui/portal": "^5.0.0-canary.4",
|
|
91
|
-
"@hi-ui/preview": "^5.0.0-canary.
|
|
91
|
+
"@hi-ui/preview": "^5.0.0-canary.10",
|
|
92
92
|
"@hi-ui/progress": "^5.0.0-canary.7",
|
|
93
93
|
"@hi-ui/provider": "^5.0.0-canary.7",
|
|
94
94
|
"@hi-ui/query-filter": "^5.0.0-canary.4",
|
|
@@ -105,18 +105,18 @@
|
|
|
105
105
|
"@hi-ui/stepper": "^5.0.0-canary.9",
|
|
106
106
|
"@hi-ui/svg-icon": "^5.0.0-canary.4",
|
|
107
107
|
"@hi-ui/switch": "^5.0.0-canary.8",
|
|
108
|
-
"@hi-ui/table": "^5.0.0-canary.
|
|
108
|
+
"@hi-ui/table": "^5.0.0-canary.25",
|
|
109
109
|
"@hi-ui/tabs": "^5.0.0-canary.14",
|
|
110
110
|
"@hi-ui/tag": "^5.0.0-canary.12",
|
|
111
111
|
"@hi-ui/tag-input": "^5.0.0-canary.20",
|
|
112
112
|
"@hi-ui/textarea": "^5.0.0-canary.13",
|
|
113
113
|
"@hi-ui/time-picker": "^5.0.0-canary.17",
|
|
114
114
|
"@hi-ui/timeline": "^5.0.0-canary.7",
|
|
115
|
-
"@hi-ui/tooltip": "^5.0.0-canary.
|
|
115
|
+
"@hi-ui/tooltip": "^5.0.0-canary.9",
|
|
116
116
|
"@hi-ui/transfer": "^5.0.0-canary.9",
|
|
117
117
|
"@hi-ui/tree": "^5.0.0-canary.9",
|
|
118
118
|
"@hi-ui/tree-select": "^5.0.0-canary.13",
|
|
119
|
-
"@hi-ui/upload": "^5.0.0-canary.
|
|
119
|
+
"@hi-ui/upload": "^5.0.0-canary.13",
|
|
120
120
|
"@hi-ui/watermark": "^5.0.0-canary.4",
|
|
121
121
|
"@hi-ui/zen-mode": "^5.0.0-canary.5"
|
|
122
122
|
},
|