diff --git a/lib/basic/i18n.ts b/lib/basic/i18n.ts new file mode 100644 index 0000000..ad3b4d4 --- /dev/null +++ b/lib/basic/i18n.ts @@ -0,0 +1,5 @@ +import { inject } from 'vue' + +export function t(s: string, ...args: any): string { + return (inject('t') ?? ((s: string) => String(s))) as any +} diff --git a/lib/basic/index.ts b/lib/basic/index.ts index f2ad780..6598f82 100644 --- a/lib/basic/index.ts +++ b/lib/basic/index.ts @@ -1,6 +1,7 @@ export * from './_types' export * from './directives' export * from './formatters' +export * from './i18n' export * from './lazy-data' export * from './log' export { default as OuiButton } from './oui-button.vue' @@ -14,13 +15,13 @@ export { default as OuiDemo } from './oui-demo.vue' export { default as OuiDraggable } from './oui-draggable.vue' export { default as OuiFile } from './oui-file.vue' export { default as OuiFormItem } from './oui-form-item.vue' -export { default as OuiInput } from './oui-input.vue' export { default as OuiInputGroup } from './oui-input-group.vue' export { default as OuiInputNumber } from './oui-input-number.vue' +export { default as OuiInput } from './oui-input.vue' export { default as OuiLog } from './oui-log.vue' export { default as OuiNotice } from './oui-notice.vue' -export { default as OuiPassword } from './oui-password.vue' export { default as OuiPasswordMeter } from './oui-password-meter.vue' +export { default as OuiPassword } from './oui-password.vue' export { default as OuiQrcode } from './oui-qrcode.vue' export { default as OuiResizeable } from './oui-resizeable.vue' export { default as OuiSelect } from './oui-select.vue' diff --git a/lib/basic/signal.demo.vue b/lib/basic/signal.demo.vue index 99e7889..f59779e 100644 --- a/lib/basic/signal.demo.vue +++ b/lib/basic/signal.demo.vue @@ -12,7 +12,7 @@ function useSignalRef(signal: Signal, readwrite = true): Ref> onUnmounted(signal.on(v => signalVue.value = v as any)) if (readwrite) watch(signalVue, v => signal.set(v as any)) - return signalVue + return signalVue as Ref> } // Connect diff --git a/package.json b/package.json index 5e942f4..8622df7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "oui-kit", "type": "module", - "version": "0.25.1", + "version": "0.25.2", "author": { "email": "dirk.holtwick@gmail.com", "name": "Dirk Holtwick", @@ -76,7 +76,7 @@ "@floating-ui/vue": "^1.1.5", "@vueuse/core": "^12.0.0", "vue": "^3.5.13", - "zeed": "^0.26.2" + "zeed": "^0.26.3" }, "devDependencies": { "@antfu/eslint-config": "^3.11", @@ -91,7 +91,7 @@ "vite": "^6.0.3", "vite-plugin-dts": "^4.3.0", "vite-plugin-qrcode": "^0.2.3", - "vite-plugin-vue-devtools": "^7.6.7", + "vite-plugin-vue-devtools": "^7.6.8", "vitest": "^2.1.8" } }