@nuxt/ui 3.0.0-beta.2 → 3.0.0-beta.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/.nuxt/ui/button.ts +8 -0
- package/.nuxt/ui/pagination.ts +6 -1
- package/.nuxt/ui/table.ts +2 -1
- package/dist/module.cjs +2 -2
- package/dist/module.json +2 -2
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Accordion.vue +7 -0
- package/dist/runtime/components/Alert.vue +14 -0
- package/dist/runtime/components/App.vue +6 -6
- package/dist/runtime/components/Avatar.vue +8 -1
- package/dist/runtime/components/AvatarGroup.vue +3 -0
- package/dist/runtime/components/Badge.vue +9 -0
- package/dist/runtime/components/Breadcrumb.vue +4 -0
- package/dist/runtime/components/Button.vue +57 -18
- package/dist/runtime/components/ButtonGroup.vue +3 -0
- package/dist/runtime/components/Calendar.vue +10 -0
- package/dist/runtime/components/Card.vue +3 -0
- package/dist/runtime/components/Carousel.vue +6 -0
- package/dist/runtime/components/Checkbox.vue +8 -0
- package/dist/runtime/components/Chip.vue +10 -0
- package/dist/runtime/components/ColorPicker.vue +3 -0
- package/dist/runtime/components/CommandPalette.vue +10 -1
- package/dist/runtime/components/ContextMenu.vue +9 -0
- package/dist/runtime/components/ContextMenuContent.vue +9 -0
- package/dist/runtime/components/DropdownMenu.vue +9 -0
- package/dist/runtime/components/DropdownMenuContent.vue +9 -0
- package/dist/runtime/components/Form.vue +6 -6
- package/dist/runtime/components/FormField.vue +4 -1
- package/dist/runtime/components/Input.vue +16 -3
- package/dist/runtime/components/InputMenu.vue +18 -3
- package/dist/runtime/components/InputNumber.vue +2 -0
- package/dist/runtime/components/Kbd.vue +6 -0
- package/dist/runtime/components/Link.vue +8 -4
- package/dist/runtime/components/LinkBase.vue +4 -2
- package/dist/runtime/components/Modal.vue +1 -0
- package/dist/runtime/components/NavigationMenu.vue +17 -0
- package/dist/runtime/components/Pagination.vue +16 -11
- package/dist/runtime/components/PinInput.vue +13 -0
- package/dist/runtime/components/Progress.vue +10 -0
- package/dist/runtime/components/RadioGroup.vue +6 -0
- package/dist/runtime/components/Select.vue +14 -0
- package/dist/runtime/components/SelectMenu.vue +16 -1
- package/dist/runtime/components/Separator.vue +13 -1
- package/dist/runtime/components/Slideover.vue +5 -0
- package/dist/runtime/components/Slider.vue +6 -0
- package/dist/runtime/components/Stepper.vue +13 -0
- package/dist/runtime/components/Switch.vue +15 -2
- package/dist/runtime/components/Table.vue +15 -2
- package/dist/runtime/components/Tabs.vue +12 -0
- package/dist/runtime/components/Textarea.vue +16 -3
- package/dist/runtime/components/Toast.vue +11 -0
- package/dist/runtime/components/Toaster.vue +4 -0
- package/dist/runtime/components/Tree.vue +15 -0
- package/dist/runtime/composables/defineLocale.d.ts +4 -4
- package/dist/runtime/composables/useComponentIcons.d.ts +13 -3
- package/dist/runtime/composables/useLocale.d.ts +3 -3
- package/dist/runtime/composables/useLocale.js +3 -3
- package/dist/runtime/locale/ar.d.ts +2 -1
- package/dist/runtime/locale/az.d.ts +2 -1
- package/dist/runtime/locale/bn.d.ts +2 -1
- package/dist/runtime/locale/cs.d.ts +2 -1
- package/dist/runtime/locale/da.d.ts +2 -1
- package/dist/runtime/locale/de.d.ts +2 -1
- package/dist/runtime/locale/el.d.ts +2 -1
- package/dist/runtime/locale/en.d.ts +2 -1
- package/dist/runtime/locale/es.d.ts +2 -1
- package/dist/runtime/locale/et.d.ts +2 -1
- package/dist/runtime/locale/fa_ir.d.ts +2 -1
- package/dist/runtime/locale/fi.d.ts +2 -1
- package/dist/runtime/locale/fr.d.ts +2 -1
- package/dist/runtime/locale/he.d.ts +2 -1
- package/dist/runtime/locale/hi.d.ts +2 -1
- package/dist/runtime/locale/hu.d.ts +2 -1
- package/dist/runtime/locale/id.d.ts +2 -1
- package/dist/runtime/locale/index.d.ts +3 -2
- package/dist/runtime/locale/index.js +3 -2
- package/dist/runtime/locale/it.d.ts +2 -1
- package/dist/runtime/locale/ja.d.ts +2 -1
- package/dist/runtime/locale/km.d.ts +2 -1
- package/dist/runtime/locale/ko.d.ts +2 -1
- package/dist/runtime/locale/nb_no.d.ts +2 -1
- package/dist/runtime/locale/nl.d.ts +2 -1
- package/dist/runtime/locale/pl.d.ts +2 -1
- package/dist/runtime/locale/pt.d.ts +2 -1
- package/dist/runtime/locale/pt_br.d.ts +2 -1
- package/dist/runtime/locale/ru.d.ts +2 -1
- package/dist/runtime/locale/sk.d.ts +2 -1
- package/dist/runtime/locale/sv.d.ts +2 -1
- package/dist/runtime/locale/th.d.ts +2 -1
- package/dist/runtime/locale/tr.d.ts +2 -1
- package/dist/runtime/locale/uk.d.ts +2 -1
- package/dist/runtime/locale/vi.d.ts +2 -1
- package/dist/runtime/locale/zh_cn.d.ts +2 -1
- package/dist/runtime/locale/zh_tw.d.ts +2 -1
- package/dist/runtime/plugins/colors.js +3 -1
- package/dist/runtime/types/form.d.ts +1 -1
- package/dist/runtime/types/locale.d.ts +2 -2
- package/dist/runtime/utils/index.js +1 -1
- package/dist/runtime/utils/locale.d.ts +5 -5
- package/dist/runtime/utils/tv.d.ts +1 -1
- package/dist/runtime/vue/components/Link.vue +8 -4
- package/dist/runtime/vue/plugins/head.d.ts +1 -1
- package/dist/runtime/vue/plugins/head.js +4 -3
- package/dist/runtime/vue/stubs.d.ts +2 -0
- package/dist/runtime/vue/stubs.js +2 -0
- package/dist/shared/{ui.DfK2RX6G.cjs → ui.COBs1u5H.cjs} +23 -5
- package/dist/shared/{ui.DSPu6Y8j.mjs → ui.yjbGE7Dx.mjs} +23 -5
- package/dist/unplugin.cjs +1 -1
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +25 -26
|
@@ -18,6 +18,9 @@ export interface StepperItem {
|
|
|
18
18
|
value?: string | number
|
|
19
19
|
title?: string
|
|
20
20
|
description?: string
|
|
21
|
+
/**
|
|
22
|
+
* @IconifyIcon
|
|
23
|
+
*/
|
|
21
24
|
icon?: string
|
|
22
25
|
content?: string
|
|
23
26
|
disabled?: boolean
|
|
@@ -30,8 +33,18 @@ export interface StepperProps<T extends StepperItem> extends Pick<StepperRootPro
|
|
|
30
33
|
*/
|
|
31
34
|
as?: any
|
|
32
35
|
items: T[]
|
|
36
|
+
/**
|
|
37
|
+
* @defaultValue 'md'
|
|
38
|
+
*/
|
|
33
39
|
size?: StepperVariants['size']
|
|
40
|
+
/**
|
|
41
|
+
* @defaultValue 'primary'
|
|
42
|
+
*/
|
|
34
43
|
color?: StepperVariants['color']
|
|
44
|
+
/**
|
|
45
|
+
* The orientation of the stepper.
|
|
46
|
+
* @defaultValue 'horizontal'
|
|
47
|
+
*/
|
|
35
48
|
orientation?: StepperVariants['orientation']
|
|
36
49
|
/**
|
|
37
50
|
* The value of the step that should be active when initially rendered. Use when you do not need to control the state of the steps.
|
|
@@ -19,18 +19,31 @@ export interface SwitchProps extends Pick<SwitchRootProps, 'disabled' | 'id' | '
|
|
|
19
19
|
* @defaultValue 'div'
|
|
20
20
|
*/
|
|
21
21
|
as?: any
|
|
22
|
+
/**
|
|
23
|
+
* @defaultValue 'primary'
|
|
24
|
+
*/
|
|
22
25
|
color?: SwitchVariants['color']
|
|
26
|
+
/**
|
|
27
|
+
* @defaultValue 'md'
|
|
28
|
+
*/
|
|
23
29
|
size?: SwitchVariants['size']
|
|
24
30
|
/** When `true`, the loading icon will be displayed. */
|
|
25
31
|
loading?: boolean
|
|
26
32
|
/**
|
|
27
33
|
* The icon when the `loading` prop is `true`.
|
|
28
34
|
* @defaultValue appConfig.ui.icons.loading
|
|
35
|
+
* @IconifyIcon
|
|
29
36
|
*/
|
|
30
37
|
loadingIcon?: string
|
|
31
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Display an icon when the switch is checked.
|
|
40
|
+
* @IconifyIcon
|
|
41
|
+
*/
|
|
32
42
|
checkedIcon?: string
|
|
33
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Display an icon when the switch is unchecked.
|
|
45
|
+
* @IconifyIcon
|
|
46
|
+
*/
|
|
34
47
|
uncheckedIcon?: string
|
|
35
48
|
label?: string
|
|
36
49
|
description?: string
|
|
@@ -82,7 +82,13 @@ export interface TableProps<T extends TableData> extends TableOptions<T> {
|
|
|
82
82
|
sticky?: boolean
|
|
83
83
|
/** Whether the table should be in loading state. */
|
|
84
84
|
loading?: boolean
|
|
85
|
+
/**
|
|
86
|
+
* @defaultValue 'primary'
|
|
87
|
+
*/
|
|
85
88
|
loadingColor?: TableVariants['loadingColor']
|
|
89
|
+
/**
|
|
90
|
+
* @defaultValue 'carousel'
|
|
91
|
+
*/
|
|
86
92
|
loadingAnimation?: TableVariants['loadingAnimation']
|
|
87
93
|
/**
|
|
88
94
|
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/global-filtering#table-options)
|
|
@@ -155,6 +161,7 @@ type DynamicCellSlots<T, K = keyof T> = Record<string, (props: CellContext<T, un
|
|
|
155
161
|
export type TableSlots<T> = {
|
|
156
162
|
expanded: (props: { row: Row<T> }) => any
|
|
157
163
|
empty: (props?: {}) => any
|
|
164
|
+
loading: (props?: {}) => any
|
|
158
165
|
caption: (props?: {}) => any
|
|
159
166
|
} & DynamicHeaderSlots<T> & DynamicCellSlots<T>
|
|
160
167
|
|
|
@@ -169,7 +176,7 @@ import { reactiveOmit } from '@vueuse/core'
|
|
|
169
176
|
import { useLocale } from '../composables/useLocale'
|
|
170
177
|
|
|
171
178
|
const props = defineProps<TableProps<T>>()
|
|
172
|
-
defineSlots<TableSlots<T>>()
|
|
179
|
+
const slots = defineSlots<TableSlots<T>>()
|
|
173
180
|
|
|
174
181
|
const { t } = useLocale()
|
|
175
182
|
|
|
@@ -353,7 +360,13 @@ defineExpose({
|
|
|
353
360
|
</template>
|
|
354
361
|
</template>
|
|
355
362
|
|
|
356
|
-
<tr v-else
|
|
363
|
+
<tr v-else-if="loading && !!slots['loading']">
|
|
364
|
+
<td :colspan="columns?.length" :class="ui.loading({ class: props.ui?.loading })">
|
|
365
|
+
<slot name="loading" />
|
|
366
|
+
</td>
|
|
367
|
+
</tr>
|
|
368
|
+
|
|
369
|
+
<tr v-else>
|
|
357
370
|
<td :colspan="columns?.length" :class="ui.empty({ class: props.ui?.empty })">
|
|
358
371
|
<slot name="empty">
|
|
359
372
|
{{ t('table.noData') }}
|
|
@@ -14,6 +14,9 @@ const tabs = tv({ extend: tv(theme), ...(appConfigTabs.ui?.tabs || {}) })
|
|
|
14
14
|
|
|
15
15
|
export interface TabsItem {
|
|
16
16
|
label?: string
|
|
17
|
+
/**
|
|
18
|
+
* @IconifyIcon
|
|
19
|
+
*/
|
|
17
20
|
icon?: string
|
|
18
21
|
avatar?: AvatarProps
|
|
19
22
|
slot?: string
|
|
@@ -32,8 +35,17 @@ export interface TabsProps<T> extends Pick<TabsRootProps<string | number>, 'defa
|
|
|
32
35
|
*/
|
|
33
36
|
as?: any
|
|
34
37
|
items?: T[]
|
|
38
|
+
/**
|
|
39
|
+
* @defaultValue 'primary'
|
|
40
|
+
*/
|
|
35
41
|
color?: TabsVariants['color']
|
|
42
|
+
/**
|
|
43
|
+
* @defaultValue 'pill'
|
|
44
|
+
*/
|
|
36
45
|
variant?: TabsVariants['variant']
|
|
46
|
+
/**
|
|
47
|
+
* @defaultValue 'md'
|
|
48
|
+
*/
|
|
37
49
|
size?: TabsVariants['size']
|
|
38
50
|
/**
|
|
39
51
|
* The orientation of the tabs.
|
|
@@ -22,8 +22,17 @@ export interface TextareaProps {
|
|
|
22
22
|
name?: string
|
|
23
23
|
/** The placeholder text when the textarea is empty. */
|
|
24
24
|
placeholder?: string
|
|
25
|
+
/**
|
|
26
|
+
* @defaultValue 'primary'
|
|
27
|
+
*/
|
|
25
28
|
color?: TextareaVariants['color']
|
|
29
|
+
/**
|
|
30
|
+
* @defaultValue 'outline'
|
|
31
|
+
*/
|
|
26
32
|
variant?: TextareaVariants['variant']
|
|
33
|
+
/**
|
|
34
|
+
* @defaultValue 'md'
|
|
35
|
+
*/
|
|
27
36
|
size?: TextareaVariants['size']
|
|
28
37
|
required?: boolean
|
|
29
38
|
autofocus?: boolean
|
|
@@ -65,7 +74,7 @@ const props = withDefaults(defineProps<TextareaProps>(), {
|
|
|
65
74
|
defineSlots<TextareaSlots>()
|
|
66
75
|
const emits = defineEmits<TextareaEmits>()
|
|
67
76
|
|
|
68
|
-
const [modelValue, modelModifiers] = defineModel<string | number>()
|
|
77
|
+
const [modelValue, modelModifiers] = defineModel<string | number | null>()
|
|
69
78
|
|
|
70
79
|
const { emitFormFocus, emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField<TextareaProps>(props, { deferInputValidation: true })
|
|
71
80
|
|
|
@@ -85,15 +94,19 @@ function autoFocus() {
|
|
|
85
94
|
}
|
|
86
95
|
|
|
87
96
|
// Custom function to handle the v-model properties
|
|
88
|
-
function updateInput(value: string) {
|
|
97
|
+
function updateInput(value: string | null) {
|
|
89
98
|
if (modelModifiers.trim) {
|
|
90
|
-
value = value
|
|
99
|
+
value = value?.trim() ?? null
|
|
91
100
|
}
|
|
92
101
|
|
|
93
102
|
if (modelModifiers.number) {
|
|
94
103
|
value = looseToNumber(value)
|
|
95
104
|
}
|
|
96
105
|
|
|
106
|
+
if (modelModifiers.nullify) {
|
|
107
|
+
value ||= null
|
|
108
|
+
}
|
|
109
|
+
|
|
97
110
|
modelValue.value = value
|
|
98
111
|
emitFormInput()
|
|
99
112
|
}
|
|
@@ -22,9 +22,19 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
|
|
|
22
22
|
as?: any
|
|
23
23
|
title?: StringOrVNode
|
|
24
24
|
description?: StringOrVNode
|
|
25
|
+
/**
|
|
26
|
+
* @IconifyIcon
|
|
27
|
+
*/
|
|
25
28
|
icon?: string
|
|
26
29
|
avatar?: AvatarProps
|
|
30
|
+
/**
|
|
31
|
+
* @defaultValue 'primary'
|
|
32
|
+
*/
|
|
27
33
|
color?: ToastVariants['color']
|
|
34
|
+
/**
|
|
35
|
+
* The orientation between the content and the actions.
|
|
36
|
+
* @defaultValue 'vertical'
|
|
37
|
+
*/
|
|
28
38
|
orientation?: ToastVariants['orientation']
|
|
29
39
|
/**
|
|
30
40
|
* Display a list of actions:
|
|
@@ -42,6 +52,7 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
|
|
|
42
52
|
/**
|
|
43
53
|
* The icon displayed in the close button.
|
|
44
54
|
* @defaultValue appConfig.ui.icons.close
|
|
55
|
+
* @IconifyIcon
|
|
45
56
|
*/
|
|
46
57
|
closeIcon?: string
|
|
47
58
|
class?: any
|
|
@@ -13,6 +13,10 @@ const toaster = tv({ extend: tv(theme), ...(appConfigToaster.ui?.toaster || {})
|
|
|
13
13
|
type ToasterVariants = VariantProps<typeof toaster>
|
|
14
14
|
|
|
15
15
|
export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'> {
|
|
16
|
+
/**
|
|
17
|
+
* The position on the screen to display the toasts.
|
|
18
|
+
* @defaultValue 'bottom-right'
|
|
19
|
+
*/
|
|
16
20
|
position?: ToasterVariants['position']
|
|
17
21
|
/**
|
|
18
22
|
* Expand the toasts to show multiple toasts at once.
|
|
@@ -14,8 +14,14 @@ const tree = tv({ extend: tv(theme), ...(appConfig.ui?.tree || {}) })
|
|
|
14
14
|
type TreeVariants = VariantProps<typeof tree>
|
|
15
15
|
|
|
16
16
|
export type TreeItem = {
|
|
17
|
+
/**
|
|
18
|
+
* @IconifyIcon
|
|
19
|
+
*/
|
|
17
20
|
icon?: string
|
|
18
21
|
label?: string
|
|
22
|
+
/**
|
|
23
|
+
* @IconifyIcon
|
|
24
|
+
*/
|
|
19
25
|
trailingIcon?: string
|
|
20
26
|
defaultExpanded?: boolean
|
|
21
27
|
disabled?: boolean
|
|
@@ -32,7 +38,13 @@ export interface TreeProps<T extends TreeItem, M extends boolean = false, K exte
|
|
|
32
38
|
* @defaultValue 'ul'
|
|
33
39
|
*/
|
|
34
40
|
as?: any
|
|
41
|
+
/**
|
|
42
|
+
* @defaultValue 'primary'
|
|
43
|
+
*/
|
|
35
44
|
color?: TreeVariants['color']
|
|
45
|
+
/**
|
|
46
|
+
* @defaultValue 'md'
|
|
47
|
+
*/
|
|
36
48
|
size?: TreeVariants['size']
|
|
37
49
|
/**
|
|
38
50
|
* The key used to get the value from the item.
|
|
@@ -47,16 +59,19 @@ export interface TreeProps<T extends TreeItem, M extends boolean = false, K exte
|
|
|
47
59
|
/**
|
|
48
60
|
* The icon displayed on the right side of a parent node.
|
|
49
61
|
* @defaultValue appConfig.ui.icons.chevronDown
|
|
62
|
+
* @IconifyIcon
|
|
50
63
|
*/
|
|
51
64
|
trailingIcon?: string
|
|
52
65
|
/**
|
|
53
66
|
* The icon displayed when a parent node is expanded.
|
|
54
67
|
* @defaultValue appConfig.ui.icons.folderOpen
|
|
68
|
+
* @IconifyIcon
|
|
55
69
|
*/
|
|
56
70
|
expandedIcon?: string
|
|
57
71
|
/**
|
|
58
72
|
* The icon displayed when a parent node is collapsed.
|
|
59
73
|
* @defaultValue appConfig.ui.icons.folder
|
|
74
|
+
* @IconifyIcon
|
|
60
75
|
*/
|
|
61
76
|
collapsedIcon?: string
|
|
62
77
|
items?: T[]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Locale, Direction
|
|
2
|
-
interface DefineLocaleOptions {
|
|
1
|
+
import type { Locale, Direction } from '../types/locale';
|
|
2
|
+
interface DefineLocaleOptions<M> {
|
|
3
3
|
name: string;
|
|
4
4
|
code: string;
|
|
5
5
|
dir?: Direction;
|
|
6
|
-
messages:
|
|
6
|
+
messages: M;
|
|
7
7
|
}
|
|
8
|
-
export declare function defineLocale(options: DefineLocaleOptions): Locale
|
|
8
|
+
export declare function defineLocale<M>(options: DefineLocaleOptions<M>): Locale<M>;
|
|
9
9
|
export {};
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
import { type MaybeRefOrGetter } from 'vue';
|
|
2
2
|
import type { AvatarProps } from '../types';
|
|
3
3
|
export interface UseComponentIconsProps {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Display an icon based on the `leading` and `trailing` props.
|
|
6
|
+
* @IconifyIcon
|
|
7
|
+
*/
|
|
5
8
|
icon?: string;
|
|
6
9
|
/** Display an avatar on the left side. */
|
|
7
10
|
avatar?: AvatarProps;
|
|
8
11
|
/** When `true`, the icon will be displayed on the left side. */
|
|
9
12
|
leading?: boolean;
|
|
10
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Display an icon on the left side.
|
|
15
|
+
* @IconifyIcon
|
|
16
|
+
*/
|
|
11
17
|
leadingIcon?: string;
|
|
12
18
|
/** When `true`, the icon will be displayed on the right side. */
|
|
13
19
|
trailing?: boolean;
|
|
14
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Display an icon on the right side.
|
|
22
|
+
* @IconifyIcon
|
|
23
|
+
*/
|
|
15
24
|
trailingIcon?: string;
|
|
16
25
|
/** When `true`, the loading icon will be displayed. */
|
|
17
26
|
loading?: boolean;
|
|
18
27
|
/**
|
|
19
28
|
* The icon when the `loading` prop is `true`.
|
|
20
29
|
* @defaultValue appConfig.ui.icons.loading
|
|
30
|
+
* @IconifyIcon
|
|
21
31
|
*/
|
|
22
32
|
loadingIcon?: string;
|
|
23
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
-
import type { Locale } from '../types/locale';
|
|
3
|
-
export declare const localeContextInjectionKey: InjectionKey<Ref<Locale | undefined>>;
|
|
4
|
-
export declare const useLocale: (localeOverrides?: Ref<Locale | undefined>) => import("../utils/locale").LocaleContext
|
|
2
|
+
import type { Locale, Messages } from '../types/locale';
|
|
3
|
+
export declare const localeContextInjectionKey: InjectionKey<Ref<Locale<unknown> | undefined>>;
|
|
4
|
+
export declare const useLocale: (localeOverrides?: Ref<Locale<Messages> | undefined>) => import("../utils/locale").LocaleContext<Messages>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { computed, inject,
|
|
1
|
+
import { computed, inject, toRef } from "vue";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
2
3
|
import { buildLocaleContext } from "../utils/locale.js";
|
|
3
4
|
import en from "../locale/en.js";
|
|
4
|
-
import { createSharedComposable } from "@vueuse/core";
|
|
5
5
|
export const localeContextInjectionKey = Symbol("nuxt-ui.locale-context");
|
|
6
6
|
const _useLocale = (localeOverrides) => {
|
|
7
|
-
const locale = localeOverrides || inject(localeContextInjectionKey
|
|
7
|
+
const locale = localeOverrides || toRef(inject(localeContextInjectionKey));
|
|
8
8
|
return buildLocaleContext(computed(() => locale.value || en));
|
|
9
9
|
};
|
|
10
10
|
export const useLocale = createSharedComposable(_useLocale);
|
|
@@ -5,13 +5,15 @@ export { default as cs } from './cs';
|
|
|
5
5
|
export { default as da } from './da';
|
|
6
6
|
export { default as de } from './de';
|
|
7
7
|
export { default as el } from './el';
|
|
8
|
-
export { default as et } from './et';
|
|
9
8
|
export { default as en } from './en';
|
|
10
9
|
export { default as es } from './es';
|
|
10
|
+
export { default as et } from './et';
|
|
11
11
|
export { default as fa_ir } from './fa_ir';
|
|
12
12
|
export { default as fi } from './fi';
|
|
13
13
|
export { default as fr } from './fr';
|
|
14
|
+
export { default as he } from './he';
|
|
14
15
|
export { default as hi } from './hi';
|
|
16
|
+
export { default as hu } from './hu';
|
|
15
17
|
export { default as id } from './id';
|
|
16
18
|
export { default as it } from './it';
|
|
17
19
|
export { default as ja } from './ja';
|
|
@@ -31,4 +33,3 @@ export { default as uk } from './uk';
|
|
|
31
33
|
export { default as vi } from './vi';
|
|
32
34
|
export { default as zh_cn } from './zh_cn';
|
|
33
35
|
export { default as zh_tw } from './zh_tw';
|
|
34
|
-
export { default as he } from './he';
|
|
@@ -5,13 +5,15 @@ export { default as cs } from "./cs.js";
|
|
|
5
5
|
export { default as da } from "./da.js";
|
|
6
6
|
export { default as de } from "./de.js";
|
|
7
7
|
export { default as el } from "./el.js";
|
|
8
|
-
export { default as et } from "./et.js";
|
|
9
8
|
export { default as en } from "./en.js";
|
|
10
9
|
export { default as es } from "./es.js";
|
|
10
|
+
export { default as et } from "./et.js";
|
|
11
11
|
export { default as fa_ir } from "./fa_ir.js";
|
|
12
12
|
export { default as fi } from "./fi.js";
|
|
13
13
|
export { default as fr } from "./fr.js";
|
|
14
|
+
export { default as he } from "./he.js";
|
|
14
15
|
export { default as hi } from "./hi.js";
|
|
16
|
+
export { default as hu } from "./hu.js";
|
|
15
17
|
export { default as id } from "./id.js";
|
|
16
18
|
export { default as it } from "./it.js";
|
|
17
19
|
export { default as ja } from "./ja.js";
|
|
@@ -31,4 +33,3 @@ export { default as uk } from "./uk.js";
|
|
|
31
33
|
export { default as vi } from "./vi.js";
|
|
32
34
|
export { default as zh_cn } from "./zh_cn.js";
|
|
33
35
|
export { default as zh_tw } from "./zh_tw.js";
|
|
34
|
-
export { default as he } from "./he.js";
|