@nuxt/ui 3.0.1 → 3.0.2
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 +36 -36
- package/.nuxt/ui/container.ts +1 -1
- package/.nuxt/ui/navigation-menu.ts +2 -2
- package/.nuxt/ui/switch.ts +1 -1
- package/.nuxt/ui/tabs.ts +1 -1
- package/dist/module.cjs +1 -1
- package/dist/module.d.cts +2 -1
- package/dist/module.d.mts +2 -1
- package/dist/module.d.ts +2 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Accordion.vue +9 -8
- package/dist/runtime/components/Alert.vue +1 -1
- package/dist/runtime/components/App.vue +1 -1
- package/dist/runtime/components/Avatar.vue +7 -5
- package/dist/runtime/components/Breadcrumb.vue +11 -10
- package/dist/runtime/components/Button.vue +1 -1
- package/dist/runtime/components/Calendar.vue +40 -11
- package/dist/runtime/components/Carousel.vue +7 -3
- package/dist/runtime/components/CommandPalette.vue +12 -11
- package/dist/runtime/components/ContextMenu.vue +24 -12
- package/dist/runtime/components/ContextMenuContent.vue +22 -15
- package/dist/runtime/components/Drawer.vue +1 -5
- package/dist/runtime/components/DropdownMenu.vue +23 -12
- package/dist/runtime/components/DropdownMenuContent.vue +22 -15
- package/dist/runtime/components/Form.vue +1 -0
- package/dist/runtime/components/FormField.vue +1 -0
- package/dist/runtime/components/InputMenu.vue +92 -54
- package/dist/runtime/components/Link.vue +3 -0
- package/dist/runtime/components/LinkBase.vue +1 -0
- package/dist/runtime/components/Modal.vue +1 -1
- package/dist/runtime/components/NavigationMenu.vue +49 -25
- package/dist/runtime/components/RadioGroup.vue +23 -12
- package/dist/runtime/components/Select.vue +69 -42
- package/dist/runtime/components/SelectMenu.vue +83 -48
- package/dist/runtime/components/Slideover.vue +1 -1
- package/dist/runtime/components/Stepper.vue +11 -10
- package/dist/runtime/components/Table.vue +7 -2
- package/dist/runtime/components/Tabs.vue +6 -5
- package/dist/runtime/components/Toast.vue +1 -1
- package/dist/runtime/components/Tree.vue +46 -32
- package/dist/runtime/composables/defineShortcuts.js +0 -1
- package/dist/runtime/composables/useFormField.js +1 -1
- package/dist/runtime/composables/useOverlay.d.ts +3 -2
- package/dist/runtime/locale/hy.d.ts +3 -0
- package/dist/runtime/locale/hy.js +54 -0
- package/dist/runtime/locale/index.d.ts +1 -0
- package/dist/runtime/locale/index.js +1 -0
- package/dist/runtime/types/form.d.ts +1 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/utils.d.ts +28 -8
- package/dist/runtime/utils/index.d.ts +1 -0
- package/dist/runtime/utils/index.js +3 -0
- package/dist/runtime/utils/link.d.ts +2 -25
- package/dist/runtime/utils/link.js +31 -1
- package/dist/runtime/vue/components/Link.vue +3 -0
- package/dist/runtime/vue/stubs.d.ts +7 -2
- package/dist/runtime/vue/stubs.js +11 -2
- package/dist/shared/{ui.C6uTSFTI.cjs → ui.BL-XB3u1.cjs} +16 -16
- package/dist/shared/{ui.BCaWD5Ek.mjs → ui.BkNUP964.mjs} +16 -16
- package/dist/types.d.mts +7 -1
- package/dist/types.d.ts +7 -1
- package/dist/unplugin.cjs +1 -1
- package/dist/unplugin.d.cts +2 -1
- package/dist/unplugin.d.mts +2 -1
- package/dist/unplugin.d.ts +2 -1
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +39 -22
|
@@ -6,7 +6,14 @@ import type { AppConfig } from '@nuxt/schema'
|
|
|
6
6
|
import _appConfig from '#build/app.config'
|
|
7
7
|
import theme from '#build/ui/tree'
|
|
8
8
|
import { tv } from '../utils/tv'
|
|
9
|
-
import type {
|
|
9
|
+
import type {
|
|
10
|
+
DynamicSlots,
|
|
11
|
+
GetItemKeys,
|
|
12
|
+
GetModelValue,
|
|
13
|
+
GetModelValueEmits,
|
|
14
|
+
NestedItem,
|
|
15
|
+
PartialString
|
|
16
|
+
} from '../types/utils'
|
|
10
17
|
|
|
11
18
|
const appConfig = _appConfig as AppConfig & { ui: { tree: Partial<typeof theme> } }
|
|
12
19
|
|
|
@@ -31,9 +38,10 @@ export type TreeItem = {
|
|
|
31
38
|
children?: TreeItem[]
|
|
32
39
|
onToggle?(e: Event): void
|
|
33
40
|
onSelect?(e?: Event): void
|
|
41
|
+
[key: string]: any
|
|
34
42
|
}
|
|
35
43
|
|
|
36
|
-
export interface TreeProps<T extends TreeItem,
|
|
44
|
+
export interface TreeProps<T extends TreeItem[] = TreeItem[], VK extends GetItemKeys<T> = 'value', M extends boolean = false> extends Pick<TreeRootProps<T>, 'expanded' | 'defaultExpanded' | 'selectionBehavior' | 'propagateSelect' | 'disabled'> {
|
|
37
45
|
/**
|
|
38
46
|
* The element or component this component should render as.
|
|
39
47
|
* @defaultValue 'ul'
|
|
@@ -51,12 +59,12 @@ export interface TreeProps<T extends TreeItem, M extends boolean = false, K exte
|
|
|
51
59
|
* The key used to get the value from the item.
|
|
52
60
|
* @defaultValue 'value'
|
|
53
61
|
*/
|
|
54
|
-
valueKey?:
|
|
62
|
+
valueKey?: VK
|
|
55
63
|
/**
|
|
56
64
|
* The key used to get the label from the item.
|
|
57
65
|
* @defaultValue 'label'
|
|
58
66
|
*/
|
|
59
|
-
labelKey?:
|
|
67
|
+
labelKey?: keyof NestedItem<T>
|
|
60
68
|
/**
|
|
61
69
|
* The icon displayed on the right side of a parent node.
|
|
62
70
|
* @defaultValue appConfig.ui.icons.chevronDown
|
|
@@ -75,33 +83,34 @@ export interface TreeProps<T extends TreeItem, M extends boolean = false, K exte
|
|
|
75
83
|
* @IconifyIcon
|
|
76
84
|
*/
|
|
77
85
|
collapsedIcon?: string
|
|
78
|
-
items?: T
|
|
86
|
+
items?: T
|
|
79
87
|
/** The controlled value of the Tree. Can be bind as `v-model`. */
|
|
80
|
-
modelValue?:
|
|
88
|
+
modelValue?: GetModelValue<T, VK, M>
|
|
81
89
|
/** The value of the Tree when initially rendered. Use when you do not need to control the state of the Tree. */
|
|
82
|
-
defaultValue?:
|
|
90
|
+
defaultValue?: GetModelValue<T, VK, M>
|
|
83
91
|
/** Whether multiple options can be selected or not. */
|
|
84
92
|
multiple?: M & boolean
|
|
85
93
|
class?: any
|
|
86
94
|
ui?: PartialString<typeof tree.slots>
|
|
87
95
|
}
|
|
88
96
|
|
|
89
|
-
export type TreeEmits<
|
|
90
|
-
'update:modelValue': [payload: MaybeMultipleModelValue<T, M>]
|
|
91
|
-
}
|
|
97
|
+
export type TreeEmits<A extends TreeItem[], VK extends GetItemKeys<A> | undefined, M extends boolean> = Omit<TreeRootEmits, 'update:modelValue'> & GetModelValueEmits<A, VK, M>
|
|
92
98
|
|
|
93
|
-
type SlotProps<T> = (props: { item: T, index: number, level: number, expanded: boolean, selected: boolean }) => any
|
|
99
|
+
type SlotProps<T extends TreeItem> = (props: { item: T, index: number, level: number, expanded: boolean, selected: boolean }) => any
|
|
94
100
|
|
|
95
|
-
export type TreeSlots<
|
|
101
|
+
export type TreeSlots<
|
|
102
|
+
A extends TreeItem[] = TreeItem[],
|
|
103
|
+
T extends NestedItem<A> = NestedItem<A>
|
|
104
|
+
> = {
|
|
96
105
|
'item': SlotProps<T>
|
|
97
106
|
'item-leading': SlotProps<T>
|
|
98
107
|
'item-label': SlotProps<T>
|
|
99
108
|
'item-trailing': SlotProps<T>
|
|
100
|
-
} & DynamicSlots<T,
|
|
109
|
+
} & DynamicSlots<T, undefined, { index: number, level: number, expanded: boolean, selected: boolean }>
|
|
101
110
|
|
|
102
111
|
</script>
|
|
103
112
|
|
|
104
|
-
<script setup lang="ts" generic="T extends TreeItem,
|
|
113
|
+
<script setup lang="ts" generic="T extends TreeItem[], VK extends GetItemKeys<T> = 'value', M extends boolean = false">
|
|
105
114
|
import { computed } from 'vue'
|
|
106
115
|
import type { PropType } from 'vue'
|
|
107
116
|
import { TreeRoot, TreeItem, useForwardPropsEmits } from 'reka-ui'
|
|
@@ -109,18 +118,21 @@ import { reactivePick, createReusableTemplate } from '@vueuse/core'
|
|
|
109
118
|
import { get } from '../utils'
|
|
110
119
|
import UIcon from './Icon.vue'
|
|
111
120
|
|
|
112
|
-
const props = withDefaults(defineProps<TreeProps<T,
|
|
121
|
+
const props = withDefaults(defineProps<TreeProps<T, VK, M>>(), {
|
|
113
122
|
labelKey: 'label' as never,
|
|
114
123
|
valueKey: 'value' as never
|
|
115
124
|
})
|
|
116
|
-
const emits = defineEmits<TreeEmits<T, M>>()
|
|
125
|
+
const emits = defineEmits<TreeEmits<T, VK, M>>()
|
|
117
126
|
const slots = defineSlots<TreeSlots<T>>()
|
|
118
127
|
|
|
119
128
|
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'items', 'multiple', 'expanded', 'disabled', 'propagateSelect'), emits)
|
|
120
129
|
|
|
121
|
-
const [DefineTreeTemplate, ReuseTreeTemplate] = createReusableTemplate<
|
|
130
|
+
const [DefineTreeTemplate, ReuseTreeTemplate] = createReusableTemplate<
|
|
131
|
+
{ items?: NestedItem<T>[], level: number },
|
|
132
|
+
TreeSlots<T>
|
|
133
|
+
>({
|
|
122
134
|
props: {
|
|
123
|
-
items: Array as PropType<T[]>,
|
|
135
|
+
items: Array as PropType<NestedItem<T>[]>,
|
|
124
136
|
level: Number
|
|
125
137
|
}
|
|
126
138
|
})
|
|
@@ -130,22 +142,24 @@ const ui = computed(() => tree({
|
|
|
130
142
|
size: props.size
|
|
131
143
|
}))
|
|
132
144
|
|
|
133
|
-
function getItemLabel(item: T) {
|
|
145
|
+
function getItemLabel(item: NestedItem<T>): string {
|
|
134
146
|
return get(item, props.labelKey as string)
|
|
135
147
|
}
|
|
136
148
|
|
|
137
|
-
function getItemValue(item
|
|
149
|
+
function getItemValue(item: NestedItem<T>): string {
|
|
138
150
|
return get(item, props.valueKey as string) ?? get(item, props.labelKey as string)
|
|
139
151
|
}
|
|
140
152
|
|
|
141
|
-
function getDefaultOpenedItems(item: T): string[] {
|
|
153
|
+
function getDefaultOpenedItems(item: NestedItem<T>): string[] {
|
|
142
154
|
const currentItem = item.defaultExpanded ? getItemValue(item) : null
|
|
143
|
-
const childItems = item.children?.flatMap(child => getDefaultOpenedItems(child as T)) ?? []
|
|
155
|
+
const childItems = item.children?.flatMap((child: TreeItem) => getDefaultOpenedItems(child as NestedItem<T>)) ?? []
|
|
144
156
|
|
|
145
157
|
return [currentItem, ...childItems].filter(Boolean) as string[]
|
|
146
158
|
}
|
|
147
159
|
|
|
148
|
-
const defaultExpanded = computed(() =>
|
|
160
|
+
const defaultExpanded = computed(() =>
|
|
161
|
+
props.defaultExpanded ?? props.items?.flatMap(item => getDefaultOpenedItems(item as NestedItem<T>))
|
|
162
|
+
)
|
|
149
163
|
</script>
|
|
150
164
|
|
|
151
165
|
<!-- eslint-disable vue/no-template-shadow -->
|
|
@@ -165,8 +179,8 @@ const defaultExpanded = computed(() => props.defaultExpanded ?? props.items?.fla
|
|
|
165
179
|
@select="item.onSelect"
|
|
166
180
|
>
|
|
167
181
|
<button :disabled="item.disabled || disabled" :class="ui.link({ class: props.ui?.link, selected: isSelected, disabled: item.disabled || disabled })">
|
|
168
|
-
<slot :name="item.slot || 'item'" v-bind="{
|
|
169
|
-
<slot :name="item.slot ? `${item.slot}-leading`: 'item-leading'" v-bind="{
|
|
182
|
+
<slot :name="((item.slot || 'item') as keyof TreeSlots<T>)" v-bind="{ index, level, expanded: isExpanded, selected: isSelected }" :item="(item as Extract<NestedItem<T>, { slot: string; }>)">
|
|
183
|
+
<slot :name="((item.slot ? `${item.slot}-leading`: 'item-leading') as keyof TreeSlots<T>)" v-bind="{ index, level, expanded: isExpanded, selected: isSelected }" :item="(item as Extract<NestedItem<T>, { slot: string; }>)">
|
|
170
184
|
<UIcon
|
|
171
185
|
v-if="item.icon"
|
|
172
186
|
:name="item.icon"
|
|
@@ -179,14 +193,14 @@ const defaultExpanded = computed(() => props.defaultExpanded ?? props.items?.fla
|
|
|
179
193
|
/>
|
|
180
194
|
</slot>
|
|
181
195
|
|
|
182
|
-
<span v-if="getItemLabel(item) || !!slots[item.slot ? `${item.slot}-label`: 'item-label']" :class="ui.linkLabel({ class: props.ui?.linkLabel })">
|
|
183
|
-
<slot :name="item.slot ? `${item.slot}-label`: 'item-label'" v-bind="{ item, index, level, expanded: isExpanded, selected: isSelected }">
|
|
196
|
+
<span v-if="getItemLabel(item) || !!slots[(item.slot ? `${item.slot}-label`: 'item-label') as keyof TreeSlots<T>]" :class="ui.linkLabel({ class: props.ui?.linkLabel })">
|
|
197
|
+
<slot :name="((item.slot ? `${item.slot}-label`: 'item-label') as keyof TreeSlots<T>)" v-bind="{ item, index, level, expanded: isExpanded, selected: isSelected }" :item="(item as Extract<NestedItem<T>, { slot: string; }>)">
|
|
184
198
|
{{ getItemLabel(item) }}
|
|
185
199
|
</slot>
|
|
186
200
|
</span>
|
|
187
201
|
|
|
188
|
-
<span v-if="item.trailingIcon || item.children?.length || !!slots[item.slot ? `${item.slot}-trailing`: 'item-trailing']" :class="ui.linkTrailing({ class: props.ui?.linkTrailing })">
|
|
189
|
-
<slot :name="item.slot ? `${item.slot}-trailing`: 'item-trailing'" v-bind="{ item, index, level, expanded: isExpanded, selected: isSelected }">
|
|
202
|
+
<span v-if="item.trailingIcon || item.children?.length || !!slots[(item.slot ? `${item.slot}-trailing`: 'item-trailing') as keyof TreeSlots<T>]" :class="ui.linkTrailing({ class: props.ui?.linkTrailing })">
|
|
203
|
+
<slot :name="((item.slot ? `${item.slot}-trailing`: 'item-trailing') as keyof TreeSlots<T>)" v-bind="{ item, index, level, expanded: isExpanded, selected: isSelected }" :item="(item as Extract<NestedItem<T>, { slot: string; }>)">
|
|
190
204
|
<UIcon v-if="item.trailingIcon" :name="item.trailingIcon" :class="ui.linkTrailingIcon({ class: props.ui?.linkTrailingIcon })" />
|
|
191
205
|
<UIcon v-else-if="item.children?.length" :name="trailingIcon ?? appConfig.ui.icons.chevronDown" :class="ui.linkTrailingIcon({ class: props.ui?.linkTrailingIcon })" />
|
|
192
206
|
</slot>
|
|
@@ -195,19 +209,19 @@ const defaultExpanded = computed(() => props.defaultExpanded ?? props.items?.fla
|
|
|
195
209
|
</button>
|
|
196
210
|
|
|
197
211
|
<ul v-if="item.children?.length && isExpanded" :class="ui.listWithChildren({ class: props.ui?.listWithChildren })">
|
|
198
|
-
<ReuseTreeTemplate :items="(item.children as T[])" :level="level + 1" />
|
|
212
|
+
<ReuseTreeTemplate :items="(item.children as NestedItem<T>[])" :level="level + 1" />
|
|
199
213
|
</ul>
|
|
200
214
|
</TreeItem>
|
|
201
215
|
</li>
|
|
202
216
|
</DefineTreeTemplate>
|
|
203
217
|
|
|
204
218
|
<TreeRoot
|
|
205
|
-
v-bind="rootProps"
|
|
219
|
+
v-bind="(rootProps as unknown as TreeRootProps<NestedItem<T>>)"
|
|
206
220
|
:class="ui.root({ class: [props.class, props.ui?.root] })"
|
|
207
221
|
:get-key="getItemValue"
|
|
208
222
|
:default-expanded="defaultExpanded"
|
|
209
223
|
:selection-behavior="selectionBehavior"
|
|
210
224
|
>
|
|
211
|
-
<ReuseTreeTemplate :items="items" :level="0" />
|
|
225
|
+
<ReuseTreeTemplate :items="(items as NestedItem<T>[] | undefined)" :level="0" />
|
|
212
226
|
</TreeRoot>
|
|
213
227
|
</template>
|
|
@@ -55,7 +55,7 @@ export function useFormField(props, opts) {
|
|
|
55
55
|
emitFormFocus,
|
|
56
56
|
ariaAttrs: computed(() => {
|
|
57
57
|
if (!formField?.value) return;
|
|
58
|
-
const descriptiveAttrs = ["error", "hint", "description"].filter((type) => formField?.value?.[type]).map((type) => `${formField?.value.ariaId}-${type}`) || [];
|
|
58
|
+
const descriptiveAttrs = ["error", "hint", "description", "help"].filter((type) => formField?.value?.[type]).map((type) => `${formField?.value.ariaId}-${type}`) || [];
|
|
59
59
|
return {
|
|
60
60
|
"aria-describedby": descriptiveAttrs.join(" "),
|
|
61
61
|
"aria-invalid": !!formField?.value.error
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
|
-
import type { ComponentProps } from 'vue-component-type-helpers';
|
|
2
|
+
import type { ComponentProps, ComponentEmit } from 'vue-component-type-helpers';
|
|
3
|
+
type CloseEventArgType<T> = T extends (event: 'close', args_0: infer R) => void ? R : never;
|
|
3
4
|
export type OverlayOptions<OverlayAttrs = Record<string, any>> = {
|
|
4
5
|
defaultOpen?: boolean;
|
|
5
6
|
props?: OverlayAttrs;
|
|
@@ -14,7 +15,7 @@ type ManagedOverlayOptionsPrivate<T extends Component> = {
|
|
|
14
15
|
};
|
|
15
16
|
export type Overlay = OverlayOptions<Component> & ManagedOverlayOptionsPrivate<Component>;
|
|
16
17
|
interface OverlayInstance<T> {
|
|
17
|
-
open: (props?: ComponentProps<T>) => Promise<
|
|
18
|
+
open: (props?: ComponentProps<T>) => Promise<CloseEventArgType<ComponentEmit<T>>>;
|
|
18
19
|
close: (value?: any) => void;
|
|
19
20
|
patch: (props: Partial<ComponentProps<T>>) => void;
|
|
20
21
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineLocale } from "../composables/defineLocale.js";
|
|
2
|
+
export default defineLocale({
|
|
3
|
+
name: "\u0540\u0561\u0575\u0565\u0580\u0565\u0576",
|
|
4
|
+
code: "hy",
|
|
5
|
+
messages: {
|
|
6
|
+
inputMenu: {
|
|
7
|
+
noMatch: "\u0540\u0561\u0574\u0568\u0576\u056F\u0576\u0578\u0582\u0574\u0576\u0565\u0580 \u0579\u0565\u0576 \u0563\u057F\u0576\u057E\u0565\u056C",
|
|
8
|
+
noData: "\u054F\u057E\u0575\u0561\u056C\u0576\u0565\u0580 \u0579\u056F\u0561\u0576",
|
|
9
|
+
create: '\u054D\u057F\u0565\u0572\u056E\u0565\u056C "{label}"'
|
|
10
|
+
},
|
|
11
|
+
calendar: {
|
|
12
|
+
prevYear: "\u0546\u0561\u056D\u0578\u0580\u0564 \u057F\u0561\u0580\u056B",
|
|
13
|
+
nextYear: "\u0540\u0561\u057B\u0578\u0580\u0564 \u057F\u0561\u0580\u056B",
|
|
14
|
+
prevMonth: "\u0546\u0561\u056D\u0578\u0580\u0564 \u0561\u0574\u056B\u057D",
|
|
15
|
+
nextMonth: "\u0540\u0561\u057B\u0578\u0580\u0564 \u0561\u0574\u056B\u057D"
|
|
16
|
+
},
|
|
17
|
+
inputNumber: {
|
|
18
|
+
increment: "\u0531\u057E\u0565\u056C\u0561\u0581\u0576\u0565\u056C",
|
|
19
|
+
decrement: "\u054A\u0561\u056F\u0561\u057D\u0565\u0581\u0576\u0565\u056C"
|
|
20
|
+
},
|
|
21
|
+
commandPalette: {
|
|
22
|
+
placeholder: "\u0544\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0565\u0584 \u0570\u0580\u0561\u0574\u0561\u0576 \u056F\u0561\u0574 \u0578\u0580\u0578\u0576\u0565\u0584...",
|
|
23
|
+
noMatch: "\u0540\u0561\u0574\u0568\u0576\u056F\u0576\u0578\u0582\u0574\u0576\u0565\u0580 \u0579\u0565\u0576 \u0563\u057F\u0576\u057E\u0565\u056C",
|
|
24
|
+
noData: "\u054F\u057E\u0575\u0561\u056C\u0576\u0565\u0580 \u0579\u056F\u0561\u0576",
|
|
25
|
+
close: "\u0553\u0561\u056F\u0565\u056C"
|
|
26
|
+
},
|
|
27
|
+
selectMenu: {
|
|
28
|
+
noMatch: "\u0540\u0561\u0574\u0568\u0576\u056F\u0576\u0578\u0582\u0574\u0576\u0565\u0580 \u0579\u0565\u0576 \u0563\u057F\u0576\u057E\u0565\u056C",
|
|
29
|
+
noData: "\u054F\u057E\u0575\u0561\u056C\u0576\u0565\u0580 \u0579\u056F\u0561\u0576",
|
|
30
|
+
create: '\u054D\u057F\u0565\u0572\u056E\u0565\u056C "{label}"',
|
|
31
|
+
search: "\u0548\u0580\u0578\u0576\u0578\u0582\u0574..."
|
|
32
|
+
},
|
|
33
|
+
toast: {
|
|
34
|
+
close: "\u0553\u0561\u056F\u0565\u056C"
|
|
35
|
+
},
|
|
36
|
+
carousel: {
|
|
37
|
+
prev: "\u0540\u0565\u057F",
|
|
38
|
+
next: "\u0531\u057C\u0561\u057B",
|
|
39
|
+
goto: "\u0531\u0576\u0581\u0576\u0565\u056C {slide}-\u056B\u0576"
|
|
40
|
+
},
|
|
41
|
+
modal: {
|
|
42
|
+
close: "\u0553\u0561\u056F\u0565\u056C"
|
|
43
|
+
},
|
|
44
|
+
slideover: {
|
|
45
|
+
close: "\u0553\u0561\u056F\u0565\u056C"
|
|
46
|
+
},
|
|
47
|
+
alert: {
|
|
48
|
+
close: "\u0553\u0561\u056F\u0565\u056C"
|
|
49
|
+
},
|
|
50
|
+
table: {
|
|
51
|
+
noData: "\u054F\u057E\u0575\u0561\u056C\u0576\u0565\u0580 \u0579\u056F\u0561\u0576"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
@@ -16,6 +16,7 @@ export { default as fr } from './fr';
|
|
|
16
16
|
export { default as he } from './he';
|
|
17
17
|
export { default as hi } from './hi';
|
|
18
18
|
export { default as hu } from './hu';
|
|
19
|
+
export { default as hy } from './hy';
|
|
19
20
|
export { default as id } from './id';
|
|
20
21
|
export { default as it } from './it';
|
|
21
22
|
export { default as ja } from './ja';
|
|
@@ -16,6 +16,7 @@ export { default as fr } from "./fr.js";
|
|
|
16
16
|
export { default as he } from "./he.js";
|
|
17
17
|
export { default as hi } from "./hi.js";
|
|
18
18
|
export { default as hu } from "./hu.js";
|
|
19
|
+
export { default as hy } from "./hy.js";
|
|
19
20
|
export { default as id } from "./id.js";
|
|
20
21
|
export { default as it } from "./it.js";
|
|
21
22
|
export { default as ja } from "./ja.js";
|
|
@@ -6,6 +6,7 @@ export * from '../components/AvatarGroup.vue';
|
|
|
6
6
|
export * from '../components/Badge.vue';
|
|
7
7
|
export * from '../components/Breadcrumb.vue';
|
|
8
8
|
export * from '../components/Button.vue';
|
|
9
|
+
export * from '../components/ButtonGroup.vue';
|
|
9
10
|
export * from '../components/Calendar.vue';
|
|
10
11
|
export * from '../components/Card.vue';
|
|
11
12
|
export * from '../components/Carousel.vue';
|
|
@@ -6,6 +6,7 @@ export * from "../components/AvatarGroup.vue";
|
|
|
6
6
|
export * from "../components/Badge.vue";
|
|
7
7
|
export * from "../components/Breadcrumb.vue";
|
|
8
8
|
export * from "../components/Button.vue";
|
|
9
|
+
export * from "../components/ButtonGroup.vue";
|
|
9
10
|
export * from "../components/Calendar.vue";
|
|
10
11
|
export * from "../components/Card.vue";
|
|
11
12
|
export * from "../components/Carousel.vue";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AcceptableValue as _AcceptableValue } from 'reka-ui';
|
|
1
2
|
import type { VNode } from 'vue';
|
|
2
3
|
export interface TightMap<O = any> {
|
|
3
4
|
[key: string]: TightMap | O;
|
|
@@ -9,20 +10,39 @@ export type DeepPartial<T, O = any> = {
|
|
|
9
10
|
};
|
|
10
11
|
export type DynamicSlots<T extends {
|
|
11
12
|
slot?: string;
|
|
12
|
-
},
|
|
13
|
+
}, S extends string | undefined = undefined, D extends object = {}> = {
|
|
14
|
+
[K in T['slot'] as K extends string ? S extends string ? (K | `${K}-${S}`) : K : never]?: (props: {
|
|
15
|
+
item: Extract<T, {
|
|
16
|
+
slot: K extends `${infer Base}-${S}` ? Base : K;
|
|
17
|
+
}>;
|
|
18
|
+
} & D) => any;
|
|
19
|
+
};
|
|
13
20
|
export type GetObjectField<MaybeObject, Key extends string> = MaybeObject extends Record<string, any> ? MaybeObject[Key] : never;
|
|
14
21
|
export type PartialString<T> = {
|
|
15
22
|
[K in keyof T]?: string;
|
|
16
23
|
};
|
|
17
|
-
export type
|
|
18
|
-
export type
|
|
19
|
-
export type
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
export type AcceptableValue = Exclude<_AcceptableValue, Record<string, any>>;
|
|
25
|
+
export type ArrayOrNested<T> = T[] | T[][];
|
|
26
|
+
export type NestedItem<T> = T extends Array<infer I> ? NestedItem<I> : T;
|
|
27
|
+
type AllKeys<T> = T extends any ? keyof T : never;
|
|
28
|
+
type NonCommonKeys<T extends object> = Exclude<AllKeys<T>, keyof T>;
|
|
29
|
+
type PickTypeOf<T, K extends string | number | symbol> = K extends AllKeys<T> ? T extends {
|
|
30
|
+
[k in K]?: any;
|
|
31
|
+
} ? T[K] : undefined : never;
|
|
32
|
+
export type MergeTypes<T extends object> = {
|
|
33
|
+
[k in keyof T]: PickTypeOf<T, k>;
|
|
34
|
+
} & {
|
|
35
|
+
[k in NonCommonKeys<T>]?: PickTypeOf<T, k>;
|
|
36
|
+
};
|
|
37
|
+
export type GetItemKeys<I> = keyof Extract<NestedItem<I>, object>;
|
|
38
|
+
export type GetItemValue<I, VK extends GetItemKeys<I> | undefined, T extends NestedItem<I> = NestedItem<I>> = T extends object ? VK extends undefined ? T : VK extends keyof T ? T[VK] : never : T;
|
|
39
|
+
export type GetModelValue<T, VK extends GetItemKeys<T> | undefined, M extends boolean> = M extends true ? GetItemValue<T, VK>[] : GetItemValue<T, VK>;
|
|
40
|
+
export type GetModelValueEmits<T, VK extends GetItemKeys<T> | undefined, M extends boolean> = {
|
|
41
|
+
/** Event handler called when the value changes. */
|
|
42
|
+
'update:modelValue': [payload: GetModelValue<T, VK, M>];
|
|
23
43
|
};
|
|
24
|
-
export type MaybeMultipleModelValue<T, M extends boolean = false> = (T extends infer U ? M extends true ? U[] : U : never);
|
|
25
44
|
export type StringOrVNode = string | VNode | (() => VNode);
|
|
26
45
|
export type EmitsToProps<T> = {
|
|
27
46
|
[K in keyof T as `on${Capitalize<string & K>}`]: T[K] extends [...args: infer Args] ? (...args: Args) => void : never;
|
|
28
47
|
};
|
|
48
|
+
export {};
|
|
@@ -4,3 +4,4 @@ export declare function get(object: Record<string, any> | undefined, path: (stri
|
|
|
4
4
|
export declare function set(object: Record<string, any>, path: (string | number)[] | string, value: any): void;
|
|
5
5
|
export declare function looseToNumber(val: any): any;
|
|
6
6
|
export declare function compare<T>(value?: T, currentValue?: T, comparator?: string | ((a: T, b: T) => boolean)): boolean;
|
|
7
|
+
export declare function isArrayOfArray<A>(item: A[] | A[][]): item is A[][];
|
|
@@ -1,29 +1,6 @@
|
|
|
1
1
|
import type { LinkProps } from '../types';
|
|
2
2
|
export declare function pickLinkProps(link: LinkProps & {
|
|
3
|
-
|
|
4
|
-
title?: string;
|
|
3
|
+
[key: string]: any;
|
|
5
4
|
}): {
|
|
6
|
-
|
|
7
|
-
type: any;
|
|
8
|
-
title: any;
|
|
9
|
-
active: any;
|
|
10
|
-
activeClass: any;
|
|
11
|
-
ariaCurrentValue: any;
|
|
12
|
-
ariaLabel: any;
|
|
13
|
-
as: any;
|
|
14
|
-
disabled: any;
|
|
15
|
-
exact: any;
|
|
16
|
-
exactActiveClass: any;
|
|
17
|
-
exactHash: any;
|
|
18
|
-
exactQuery: any;
|
|
19
|
-
external: any;
|
|
20
|
-
href: any;
|
|
21
|
-
inactiveClass: any;
|
|
22
|
-
noPrefetch: any;
|
|
23
|
-
noRel: any;
|
|
24
|
-
prefetch: any;
|
|
25
|
-
prefetchedClass: any;
|
|
26
|
-
rel: any;
|
|
27
|
-
target: any;
|
|
28
|
-
to: any;
|
|
5
|
+
[x: string]: any;
|
|
29
6
|
};
|
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
import { reactivePick } from "@vueuse/core";
|
|
2
2
|
export function pickLinkProps(link) {
|
|
3
|
-
|
|
3
|
+
const keys = Object.keys(link);
|
|
4
|
+
const ariaKeys = keys.filter((key) => key.startsWith("aria-"));
|
|
5
|
+
const dataKeys = keys.filter((key) => key.startsWith("data-"));
|
|
6
|
+
const propsToInclude = [
|
|
7
|
+
"active",
|
|
8
|
+
"activeClass",
|
|
9
|
+
"ariaCurrentValue",
|
|
10
|
+
"as",
|
|
11
|
+
"disabled",
|
|
12
|
+
"exact",
|
|
13
|
+
"exactActiveClass",
|
|
14
|
+
"exactHash",
|
|
15
|
+
"exactQuery",
|
|
16
|
+
"external",
|
|
17
|
+
"href",
|
|
18
|
+
"inactiveClass",
|
|
19
|
+
"noPrefetch",
|
|
20
|
+
"noRel",
|
|
21
|
+
"prefetch",
|
|
22
|
+
"prefetchedClass",
|
|
23
|
+
"rel",
|
|
24
|
+
"replace",
|
|
25
|
+
"target",
|
|
26
|
+
"to",
|
|
27
|
+
"type",
|
|
28
|
+
"title",
|
|
29
|
+
"onClick",
|
|
30
|
+
...ariaKeys,
|
|
31
|
+
...dataKeys
|
|
32
|
+
];
|
|
33
|
+
return reactivePick(link, ...propsToInclude);
|
|
4
34
|
}
|
|
@@ -103,6 +103,7 @@ defineOptions({ inheritAttrs: false })
|
|
|
103
103
|
const props = withDefaults(defineProps<LinkProps>(), {
|
|
104
104
|
as: 'button',
|
|
105
105
|
type: 'button',
|
|
106
|
+
ariaCurrentValue: 'page',
|
|
106
107
|
active: undefined,
|
|
107
108
|
activeClass: '',
|
|
108
109
|
inactiveClass: ''
|
|
@@ -204,6 +205,7 @@ function resolveLinkClass({ route, isActive, isExactActive }: any = {}) {
|
|
|
204
205
|
<slot
|
|
205
206
|
v-bind="{
|
|
206
207
|
...$attrs,
|
|
208
|
+
...(exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {}),
|
|
207
209
|
as,
|
|
208
210
|
type,
|
|
209
211
|
disabled,
|
|
@@ -217,6 +219,7 @@ function resolveLinkClass({ route, isActive, isExactActive }: any = {}) {
|
|
|
217
219
|
v-else
|
|
218
220
|
v-bind="{
|
|
219
221
|
...$attrs,
|
|
222
|
+
...(exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {}),
|
|
220
223
|
as,
|
|
221
224
|
type,
|
|
222
225
|
disabled,
|
|
@@ -7,8 +7,8 @@ export { defineLocale } from '../composables/defineLocale';
|
|
|
7
7
|
export { useLocale } from '../composables/useLocale';
|
|
8
8
|
export declare const useColorMode: () => {
|
|
9
9
|
forced: boolean;
|
|
10
|
-
preference?:
|
|
11
|
-
readonly value?:
|
|
10
|
+
preference?: "system" | "light" | "dark";
|
|
11
|
+
readonly value?: import("@vueuse/core").BasicColorMode;
|
|
12
12
|
} | {
|
|
13
13
|
preference: "system" | "light" | "dark";
|
|
14
14
|
readonly value: import("@vueuse/core").BasicColorMode;
|
|
@@ -29,7 +29,12 @@ export declare function useNuxtApp(): {
|
|
|
29
29
|
payload: {
|
|
30
30
|
serverRendered: boolean;
|
|
31
31
|
};
|
|
32
|
+
hooks: import("hookable").Hookable<Record<string, any>, string>;
|
|
33
|
+
hook: <NameT extends string>(name: NameT, function_: any, options?: {
|
|
34
|
+
allowDeprecated?: boolean;
|
|
35
|
+
}) => () => void;
|
|
32
36
|
};
|
|
37
|
+
export declare function useRuntimeHook(name: string, fn: (...args: any[]) => void): void;
|
|
33
38
|
export declare function defineNuxtPlugin(plugin: (nuxtApp: NuxtApp) => void): {
|
|
34
39
|
install(app: import("vue").App<any>): void;
|
|
35
40
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { ref, onScopeDispose } from "vue";
|
|
2
|
+
import { createHooks } from "hookable";
|
|
2
3
|
import appConfig from "#build/app.config";
|
|
3
4
|
import { useColorMode as useColorModeVueUse } from "@vueuse/core";
|
|
4
5
|
export { useHead } from "@unhead/vue";
|
|
@@ -50,12 +51,20 @@ export const useState = (key, init) => {
|
|
|
50
51
|
state[key] = value;
|
|
51
52
|
return value;
|
|
52
53
|
};
|
|
54
|
+
const hooks = createHooks();
|
|
53
55
|
export function useNuxtApp() {
|
|
54
56
|
return {
|
|
55
57
|
isHydrating: true,
|
|
56
|
-
payload: { serverRendered: false }
|
|
58
|
+
payload: { serverRendered: false },
|
|
59
|
+
hooks,
|
|
60
|
+
hook: hooks.hook
|
|
57
61
|
};
|
|
58
62
|
}
|
|
63
|
+
export function useRuntimeHook(name, fn) {
|
|
64
|
+
const nuxtApp = useNuxtApp();
|
|
65
|
+
const unregister = nuxtApp.hook(name, fn);
|
|
66
|
+
onScopeDispose(unregister);
|
|
67
|
+
}
|
|
59
68
|
export function defineNuxtPlugin(plugin) {
|
|
60
69
|
return {
|
|
61
70
|
install(app) {
|