@jiaozhiye/qm-design-react 1.6.7 → 1.7.1
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/antd/DatePicker.d.ts +43 -6
- package/lib/antd/TimePicker.d.ts +2 -0
- package/lib/form/src/fields-filter.d.ts +1 -1
- package/lib/index.esm.js +1 -3
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -3
- package/lib/locale/index.js +0 -6
- package/lib/style/compact.css +497 -82
- package/lib/style/compact.min.css +1 -1
- package/lib/style/index.css +499 -980
- package/lib/style/index.min.css +1 -1
- package/lib/table/src/hooks/useImperativeMethod.d.ts +1 -0
- package/lib/table/src/hooks/useTableRef.d.ts +3 -0
- package/lib/tabs/src/tabs.d.ts +1 -0
- package/package.json +3 -3
package/lib/locale/index.js
CHANGED
|
@@ -12,25 +12,21 @@ let i18nHandler = null;
|
|
|
12
12
|
export const i18n = fn => {
|
|
13
13
|
i18nHandler = fn;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
15
|
function template(str, option) {
|
|
17
16
|
if (!str || !option) return str;
|
|
18
17
|
return str.replace(/\{(\w+)\}/g, (_, key) => {
|
|
19
18
|
return option[key];
|
|
20
19
|
});
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
export const t = function () {
|
|
24
22
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
23
|
args[_key] = arguments[_key];
|
|
26
24
|
}
|
|
27
|
-
|
|
28
25
|
if (i18nHandler) return i18nHandler(...args);
|
|
29
26
|
const [path, option] = args;
|
|
30
27
|
let value;
|
|
31
28
|
const array = path.split('.');
|
|
32
29
|
let current = lang;
|
|
33
|
-
|
|
34
30
|
for (let i = 0, j = array.length; i < j; i++) {
|
|
35
31
|
const property = array[i];
|
|
36
32
|
value = current[property];
|
|
@@ -38,12 +34,10 @@ export const t = function () {
|
|
|
38
34
|
if (!value) return '';
|
|
39
35
|
current = value;
|
|
40
36
|
}
|
|
41
|
-
|
|
42
37
|
return '';
|
|
43
38
|
};
|
|
44
39
|
export const setLocale = l => {
|
|
45
40
|
lang = l || lang;
|
|
46
|
-
|
|
47
41
|
if (lang.name) {
|
|
48
42
|
dayjs.locale(lang.name);
|
|
49
43
|
}
|