cosey 0.10.2 → 0.10.4
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/icon/icon.js +2 -2
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/layout/layout-locale/layout-locale.vue.js +3 -3
- package/locale/index.d.ts +1 -0
- package/locale/index.js +5 -2
- package/package.json +1 -1
package/components/icon/icon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, computed, createVNode, Fragment, mergeProps
|
|
1
|
+
import { defineComponent, ref, watch, computed, createVNode, Fragment, mergeProps } from 'vue';
|
|
2
2
|
import { SvgIcon as _SvgIcon } from '../svg-icon/index.js';
|
|
3
3
|
import { IconifyIcon as _IconifyIcon } from '../iconify-icon/index.js';
|
|
4
4
|
import { iconProps } from './icon.api.js';
|
|
@@ -50,7 +50,7 @@ var stdin_default = defineComponent({
|
|
|
50
50
|
};
|
|
51
51
|
});
|
|
52
52
|
return () => {
|
|
53
|
-
return createVNode(Fragment, null, [slots.default ? createVNode("span", mergeProps(attrs, mergedProps.value), [
|
|
53
|
+
return createVNode(Fragment, null, [slots.default ? createVNode("span", mergeProps(attrs, mergedProps.value), [slots.default()]) : prefix.value === "svg" ? createVNode(_SvgIcon, mergeProps(attrs, mergedProps.value), null) : createVNode(_IconifyIcon, mergeProps(attrs, mergedProps.value, {
|
|
54
54
|
"prefix": prefix.value
|
|
55
55
|
}), null)]);
|
|
56
56
|
};
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type CoseyOptions } from './config';
|
|
|
3
3
|
export * from './request';
|
|
4
4
|
export * from './layout';
|
|
5
5
|
export * from './router';
|
|
6
|
+
export { i18n } from './locale';
|
|
6
7
|
export { useUserStore, useAppearanceStore, useLayoutStore } from './store';
|
|
7
8
|
export * from './config';
|
|
8
9
|
export * from './config/root-config-provider.api';
|
package/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { provideGlobalConfig } from './config/index.js';
|
|
|
5
5
|
export { useGlobalConfig } from './config/index.js';
|
|
6
6
|
import { registerGlobalComponents } from './layout/index.js';
|
|
7
7
|
import { createPiniaStore } from './store/index.js';
|
|
8
|
+
export { i18n } from './locale/index.js';
|
|
8
9
|
export { getAlgorithm, rootConfigProviderProps } from './config/root-config-provider.api.js';
|
|
9
10
|
export { default as RootConfigProvider } from './config/root-config-provider.js';
|
|
10
11
|
export { useAppearanceStore } from './store/appearance.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, resolveComponent, createBlock, createCommentVNode, unref, openBlock, withCtx, createVNode, createElementBlock, Fragment, renderList, createElementVNode, createTextVNode, toDisplayString } from 'vue';
|
|
2
|
-
import { Icon } from 'cosey/components';
|
|
3
2
|
import { useLocaleMessages } from '../../locale/index.js';
|
|
4
3
|
import { useI18n } from 'vue-i18n';
|
|
4
|
+
import { Icon as _Icon } from '../../components/icon/index.js';
|
|
5
5
|
|
|
6
6
|
const _hoisted_1 = {
|
|
7
7
|
style: {
|
|
@@ -38,7 +38,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
38
38
|
key: option.value,
|
|
39
39
|
command: option.value
|
|
40
40
|
}, {
|
|
41
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_1, [option.value === unref(locale) ? (openBlock(), createBlock(unref(
|
|
41
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1, [option.value === unref(locale) ? (openBlock(), createBlock(unref(_Icon), {
|
|
42
42
|
key: 0,
|
|
43
43
|
name: "co:checkmark",
|
|
44
44
|
size: "lg"
|
|
@@ -56,7 +56,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
56
56
|
link: "",
|
|
57
57
|
size: "large"
|
|
58
58
|
}, {
|
|
59
|
-
default: withCtx(() => [createVNode(unref(
|
|
59
|
+
default: withCtx(() => [createVNode(unref(_Icon), {
|
|
60
60
|
name: "co:ibm-watson-language-translator",
|
|
61
61
|
size: "lg"
|
|
62
62
|
})]),
|
package/locale/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type Language = {
|
|
|
9
9
|
el: TranslatePair;
|
|
10
10
|
co: TranslatePair;
|
|
11
11
|
};
|
|
12
|
+
export declare let i18n: import("vue-i18n").I18n<{}, {}, {}, string, false>;
|
|
12
13
|
export declare function setupLocale(app: App, config: I18nConfig | undefined, persist: Persist): void;
|
|
13
14
|
export declare function useCoseyLocale(): Record<string, any>;
|
|
14
15
|
export declare function useLocaleMessages(): {
|
package/locale/index.js
CHANGED
|
@@ -15,6 +15,9 @@ function getMessages(config, type) {
|
|
|
15
15
|
}
|
|
16
16
|
const coseyLocaleKey = Symbol("coseyLocale");
|
|
17
17
|
const localeMessagesKey = Symbol("localeMessages");
|
|
18
|
+
let i18n = createI18n({
|
|
19
|
+
legacy: false
|
|
20
|
+
});
|
|
18
21
|
function setupLocale(app, config = {}, persist) {
|
|
19
22
|
const mergedConfig = defaultsDeep(config, defaultI18nConfig);
|
|
20
23
|
const appMessages = getMessages(mergedConfig, "app");
|
|
@@ -22,7 +25,7 @@ function setupLocale(app, config = {}, persist) {
|
|
|
22
25
|
const dayjsMessages = getMessages(mergedConfig, "dayjs");
|
|
23
26
|
const locale = persist.get(langKey) || mergedConfig.locale;
|
|
24
27
|
const coseyLocale = shallowRef({});
|
|
25
|
-
|
|
28
|
+
i18n = createI18n({
|
|
26
29
|
legacy: false,
|
|
27
30
|
locale,
|
|
28
31
|
fallbackLocale: locale,
|
|
@@ -55,4 +58,4 @@ function useLocaleMessages() {
|
|
|
55
58
|
return inject(localeMessagesKey, []);
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
export { setupLocale, useCoseyLocale, useLocaleMessages };
|
|
61
|
+
export { i18n, setupLocale, useCoseyLocale, useLocaleMessages };
|