@una-ui/nuxt 0.13.0-beta.2 → 0.14.0-beta.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/dist/module.json +1 -1
- package/dist/module.mjs +31 -11
- package/dist/runtime/components/elements/Button.vue +2 -1
- package/dist/runtime/components/elements/Separator.vue +2 -6
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenu.vue +186 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuContent.vue +42 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuGroup.vue +20 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuItem.vue +57 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuLabel.vue +32 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuRoot.vue +15 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSeparator.vue +34 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuShortcut.vue +22 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSub.vue +24 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubContent.vue +34 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubTrigger.vue +49 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuTrigger.vue +35 -0
- package/dist/runtime/types/button.d.ts +1 -0
- package/dist/runtime/types/dropdown-menu.d.ts +154 -0
- package/dist/runtime/types/dropdown-menu.js +0 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/package.json +3 -3
- package/playground/.nuxt/components.d.ts +4 -4
- package/playground/node_modules/.vue-global-types/vue_3.4_false.d.ts +112 -0
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import '@una-ui/preset/prefixes';
|
|
|
7
7
|
import '@una-ui/extractor-vue-script';
|
|
8
8
|
|
|
9
9
|
const name = "@una-ui/nuxt";
|
|
10
|
-
const version = "0.
|
|
10
|
+
const version = "0.14.0-beta.1";
|
|
11
11
|
|
|
12
12
|
const module = defineNuxtModule({
|
|
13
13
|
meta: {
|
|
@@ -38,55 +38,71 @@ const module = defineNuxtModule({
|
|
|
38
38
|
path: resolve(runtimeDir, "components", "elements"),
|
|
39
39
|
prefix: options.prefix,
|
|
40
40
|
global: options.global,
|
|
41
|
-
watch: nuxt.options.dev
|
|
41
|
+
watch: nuxt.options.dev,
|
|
42
|
+
priority: 10
|
|
42
43
|
});
|
|
43
44
|
addComponentsDir({
|
|
44
45
|
path: resolve(runtimeDir, "components/elements", "tabs"),
|
|
45
46
|
prefix: options.prefix,
|
|
46
47
|
global: options.global,
|
|
47
|
-
watch: nuxt.options.dev
|
|
48
|
+
watch: nuxt.options.dev,
|
|
49
|
+
priority: 10
|
|
48
50
|
});
|
|
49
51
|
addComponentsDir({
|
|
50
52
|
path: resolve(runtimeDir, "components/elements", "card"),
|
|
51
53
|
prefix: options.prefix,
|
|
52
54
|
global: options.global,
|
|
53
|
-
watch: nuxt.options.dev
|
|
55
|
+
watch: nuxt.options.dev,
|
|
56
|
+
priority: 10
|
|
57
|
+
});
|
|
58
|
+
addComponentsDir({
|
|
59
|
+
path: resolve(runtimeDir, "components/elements", "dropdown-menu"),
|
|
60
|
+
prefix: options.prefix,
|
|
61
|
+
global: options.global,
|
|
62
|
+
watch: nuxt.options.dev,
|
|
63
|
+
priority: 10
|
|
54
64
|
});
|
|
55
65
|
addComponentsDir({
|
|
56
66
|
path: resolve(runtimeDir, "components", "forms"),
|
|
57
67
|
prefix: options.prefix,
|
|
58
68
|
global: options.global,
|
|
59
|
-
watch: nuxt.options.dev
|
|
69
|
+
watch: nuxt.options.dev,
|
|
70
|
+
priority: 10
|
|
60
71
|
});
|
|
61
72
|
addComponentsDir({
|
|
62
73
|
path: resolve(runtimeDir, "components/forms", "select"),
|
|
63
74
|
prefix: options.prefix,
|
|
64
75
|
global: options.global,
|
|
65
|
-
watch: nuxt.options.dev
|
|
76
|
+
watch: nuxt.options.dev,
|
|
77
|
+
priority: 10
|
|
66
78
|
});
|
|
67
79
|
addComponentsDir({
|
|
68
80
|
path: resolve(runtimeDir, "components", "misc"),
|
|
69
81
|
prefix: options.prefix,
|
|
70
82
|
global: options.global,
|
|
71
|
-
watch: nuxt.options.dev
|
|
83
|
+
watch: nuxt.options.dev,
|
|
84
|
+
priority: 10
|
|
72
85
|
});
|
|
73
86
|
addComponentsDir({
|
|
74
87
|
path: resolve(runtimeDir, "components", "navigation"),
|
|
75
88
|
prefix: options.prefix,
|
|
76
89
|
global: options.global,
|
|
77
|
-
watch: nuxt.options.dev
|
|
90
|
+
watch: nuxt.options.dev,
|
|
91
|
+
priority: 10
|
|
78
92
|
});
|
|
79
93
|
addComponentsDir({
|
|
80
94
|
path: resolve(runtimeDir, "components/data", "table"),
|
|
81
95
|
prefix: options.prefix,
|
|
82
96
|
global: options.global,
|
|
83
|
-
watch: nuxt.options.dev
|
|
97
|
+
watch: nuxt.options.dev,
|
|
98
|
+
priority: 10
|
|
84
99
|
});
|
|
85
100
|
addComponentsDir({
|
|
86
101
|
path: resolve(runtimeDir, "components/navigation", "breadcrumb"),
|
|
87
102
|
prefix: options.prefix,
|
|
88
103
|
global: options.global,
|
|
89
|
-
watch: nuxt.options.dev
|
|
104
|
+
watch: nuxt.options.dev,
|
|
105
|
+
priority: 10
|
|
90
106
|
});
|
|
91
107
|
if (options.themeable) {
|
|
92
108
|
addPlugin(resolve(runtimeDir, "plugins", "theme.client"));
|
|
@@ -95,12 +111,16 @@ const module = defineNuxtModule({
|
|
|
95
111
|
if (!options.dev)
|
|
96
112
|
nuxt.options.unocss = extendUnocssOptions(nuxt.options.unocss);
|
|
97
113
|
addImportsDir(resolve(runtimeDir, "utils", "cn"));
|
|
98
|
-
await installModule("radix-vue/nuxt");
|
|
99
114
|
await installModule("@unocss/nuxt");
|
|
100
115
|
await installModule("@nuxtjs/color-mode", {
|
|
101
116
|
classSuffix: ""
|
|
102
117
|
});
|
|
103
118
|
await installModule("@vueuse/nuxt");
|
|
119
|
+
await installModule("radix-vue/nuxt", {
|
|
120
|
+
prefix: options.prefix,
|
|
121
|
+
priority: 100
|
|
122
|
+
// Set to the lowest priority
|
|
123
|
+
});
|
|
104
124
|
addImportsDir(resolve(runtimeDir, "composables"));
|
|
105
125
|
}
|
|
106
126
|
});
|
|
@@ -19,6 +19,7 @@ const mergeVariants = computed(() => {
|
|
|
19
19
|
'btn': props.btn,
|
|
20
20
|
'breadcrumb-active': props.breadcrumbActive,
|
|
21
21
|
'breadcrumb-inactive': props.breadcrumbInactive,
|
|
22
|
+
'dropdown-menu': props.dropdownMenu,
|
|
22
23
|
}
|
|
23
24
|
})
|
|
24
25
|
|
|
@@ -53,8 +54,8 @@ const [DefineTemplate, ReuseTemplate] = createReusableTemplate()
|
|
|
53
54
|
)"
|
|
54
55
|
:disabled="to ? null : disabled || loading"
|
|
55
56
|
:aria-label="icon ? label : null"
|
|
56
|
-
v-bind="mergeVariants"
|
|
57
57
|
:size="size"
|
|
58
|
+
v-bind="mergeVariants"
|
|
58
59
|
>
|
|
59
60
|
<DefineTemplate v-if="loading">
|
|
60
61
|
<slot name="loading">
|
|
@@ -6,10 +6,6 @@ import type { NSeparatorProps } from '../../types'
|
|
|
6
6
|
|
|
7
7
|
const props = withDefaults(defineProps<NSeparatorProps>(), {
|
|
8
8
|
orientation: 'horizontal',
|
|
9
|
-
label: '',
|
|
10
|
-
una: () => ({
|
|
11
|
-
separatorDefaultVariant: 'separator-default-variant',
|
|
12
|
-
}),
|
|
13
9
|
})
|
|
14
10
|
|
|
15
11
|
const delegatedProps = computed(() => {
|
|
@@ -25,10 +21,10 @@ const delegatedProps = computed(() => {
|
|
|
25
21
|
:class="
|
|
26
22
|
cn(
|
|
27
23
|
'separator',
|
|
28
|
-
props.una?.separatorDefaultVariant,
|
|
24
|
+
props.una?.separatorDefaultVariant || 'separator-default-variant',
|
|
25
|
+
props.class,
|
|
29
26
|
props.una?.separator,
|
|
30
27
|
props.orientation === 'vertical' ? 'separator-vertical' : 'separator-horizontal',
|
|
31
|
-
props.class,
|
|
32
28
|
)
|
|
33
29
|
"
|
|
34
30
|
>
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuContentEmits, DropdownMenuRootEmits } from 'radix-vue'
|
|
3
|
+
import { DropdownMenuPortal, useForwardPropsEmits } from 'radix-vue'
|
|
4
|
+
import { createReusableTemplate } from '@vueuse/core'
|
|
5
|
+
import { omitProps, pickProps } from '../../../utils'
|
|
6
|
+
import type { NDropdownMenuProps } from '../../../types'
|
|
7
|
+
import DropdownMenuContent from './DropdownMenuContent.vue'
|
|
8
|
+
import DropdownMenuRoot from './DropdownMenuRoot.vue'
|
|
9
|
+
import DropdownMenuTrigger from './DropdownMenuTrigger.vue'
|
|
10
|
+
import DropdownMenuLabel from './DropdownMenuLabel.vue'
|
|
11
|
+
import DropdownMenuSeparator from './DropdownMenuSeparator.vue'
|
|
12
|
+
import DropdownMenuItem from './DropdownMenuItem.vue'
|
|
13
|
+
import DropdownMenuGroup from './DropdownMenuGroup.vue'
|
|
14
|
+
import DropdownMenuSub from './DropdownMenuSub.vue'
|
|
15
|
+
import DropdownMenuSubTrigger from './DropdownMenuSubTrigger.vue'
|
|
16
|
+
import DropdownMenuSubContent from './DropdownMenuSubContent.vue'
|
|
17
|
+
|
|
18
|
+
const props = defineProps<NDropdownMenuProps>()
|
|
19
|
+
const emits = defineEmits<DropdownMenuRootEmits & DropdownMenuContentEmits>()
|
|
20
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
21
|
+
|
|
22
|
+
const [DefineMenuSub, ReuseMenuSub] = createReusableTemplate<NDropdownMenuProps>()
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<DropdownMenuRoot
|
|
27
|
+
v-bind="pickProps(forwarded, ['defaultOpen', 'open', 'modal', 'dir'])"
|
|
28
|
+
>
|
|
29
|
+
<slot>
|
|
30
|
+
<slot name="trigger">
|
|
31
|
+
<DropdownMenuTrigger
|
|
32
|
+
v-bind="omitProps({ ...forwarded, ...forwarded._dropdownMenuTrigger }, [
|
|
33
|
+
'dropdownMenuItem',
|
|
34
|
+
'items',
|
|
35
|
+
'menuLabel',
|
|
36
|
+
|
|
37
|
+
'_dropdownMenuItem',
|
|
38
|
+
'_dropdownMenuContent',
|
|
39
|
+
'_dropdownMenuLabel',
|
|
40
|
+
'_dropdownMenuSeparator',
|
|
41
|
+
'_dropdownMenuGroup',
|
|
42
|
+
'_dropdownMenuSubTrigger',
|
|
43
|
+
'_dropdownMenuSubContent',
|
|
44
|
+
])"
|
|
45
|
+
/>
|
|
46
|
+
</slot>
|
|
47
|
+
|
|
48
|
+
<DropdownMenuContent
|
|
49
|
+
v-bind="forwarded._dropdownMenuContent"
|
|
50
|
+
>
|
|
51
|
+
<slot name="content">
|
|
52
|
+
<template
|
|
53
|
+
v-if="menuLabel || $slots['menu-label']"
|
|
54
|
+
>
|
|
55
|
+
<DropdownMenuLabel
|
|
56
|
+
:size
|
|
57
|
+
:inset
|
|
58
|
+
:una="forwarded.una?.dropdownMenuLabel"
|
|
59
|
+
v-bind="forwarded._dropdownMenuLabel"
|
|
60
|
+
>
|
|
61
|
+
<slot name="menu-label">
|
|
62
|
+
{{ menuLabel }}
|
|
63
|
+
</slot>
|
|
64
|
+
</DropdownMenuLabel>
|
|
65
|
+
<DropdownMenuSeparator
|
|
66
|
+
:una="forwarded.una?.dropdownMenuSeparator"
|
|
67
|
+
v-bind="forwarded._dropdownMenuSeparator"
|
|
68
|
+
/>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<slot name="items" :items>
|
|
72
|
+
<DropdownMenuGroup
|
|
73
|
+
:una="forwarded.una?.dropdownMenuGroup"
|
|
74
|
+
v-bind="forwarded._dropdownMenuGroup"
|
|
75
|
+
>
|
|
76
|
+
<template
|
|
77
|
+
v-for="item in items"
|
|
78
|
+
:key="item.label"
|
|
79
|
+
>
|
|
80
|
+
<slot
|
|
81
|
+
v-if="!item.items && item.label"
|
|
82
|
+
:name="`item-${item.label}`"
|
|
83
|
+
>
|
|
84
|
+
<DropdownMenuItem
|
|
85
|
+
:size
|
|
86
|
+
:inset
|
|
87
|
+
:dropdown-menu-item
|
|
88
|
+
:una="forwarded.una?.dropdownMenuItem"
|
|
89
|
+
v-bind="{ ...item, ...forwarded._dropdownMenuItem, ...item._dropdownMenuItem }"
|
|
90
|
+
/>
|
|
91
|
+
</slot>
|
|
92
|
+
|
|
93
|
+
<DropdownMenuSeparator
|
|
94
|
+
v-else-if="!item.label && !item.items"
|
|
95
|
+
:una="forwarded.una?.dropdownMenuSeparator"
|
|
96
|
+
v-bind="{ ...forwarded._dropdownMenuSeparator, ...item._dropdownMenuSeparator }"
|
|
97
|
+
/>
|
|
98
|
+
|
|
99
|
+
<ReuseMenuSub
|
|
100
|
+
v-else
|
|
101
|
+
v-bind="item"
|
|
102
|
+
/>
|
|
103
|
+
</template>
|
|
104
|
+
</DropdownMenuGroup>
|
|
105
|
+
</slot>
|
|
106
|
+
</slot>
|
|
107
|
+
</DropdownMenuContent>
|
|
108
|
+
</slot>
|
|
109
|
+
</DropdownMenuRoot>
|
|
110
|
+
|
|
111
|
+
<DefineMenuSub
|
|
112
|
+
v-slot="subProps"
|
|
113
|
+
>
|
|
114
|
+
<!-- <template
|
|
115
|
+
v-if="subProps.menuLabel"
|
|
116
|
+
>
|
|
117
|
+
<DropdownMenuLabel
|
|
118
|
+
:size
|
|
119
|
+
:inset
|
|
120
|
+
:una="forwarded.una?.dropdownMenuLabel"
|
|
121
|
+
v-bind="{ ...forwarded._dropdownMenuLabel, ...subProps._dropdownMenuLabel }"
|
|
122
|
+
>
|
|
123
|
+
{{ subProps.menuLabel }}
|
|
124
|
+
</DropdownMenuLabel>
|
|
125
|
+
<DropdownMenuSeparator
|
|
126
|
+
:una="forwarded.una?.dropdownMenuSeparator"
|
|
127
|
+
v-bind="{ ...forwarded._dropdownMenuSeparator, ...subProps._dropdownMenuSeparator }"
|
|
128
|
+
/>
|
|
129
|
+
</template> -->
|
|
130
|
+
|
|
131
|
+
<!-- <DropdownMenuGroup
|
|
132
|
+
:una="forwarded.una?.dropdownMenuGroup"
|
|
133
|
+
v-bind="{ ...forwarded._dropdownMenuGroup, ...subProps._dropdownMenuGroup }"
|
|
134
|
+
> -->
|
|
135
|
+
<DropdownMenuSub>
|
|
136
|
+
<DropdownMenuSubTrigger
|
|
137
|
+
:size
|
|
138
|
+
:inset
|
|
139
|
+
:una="forwarded.una?.dropdownMenuSubTrigger"
|
|
140
|
+
:dropdown-menu-item
|
|
141
|
+
v-bind="omitProps({
|
|
142
|
+
...subProps,
|
|
143
|
+
...forwarded._dropdownMenuSubTrigger,
|
|
144
|
+
...subProps._dropdownMenuSubTrigger,
|
|
145
|
+
}, ['$slots'])"
|
|
146
|
+
>
|
|
147
|
+
<slot name="sub-trigger" :label="subProps.label" />
|
|
148
|
+
</DropdownMenuSubTrigger>
|
|
149
|
+
|
|
150
|
+
<DropdownMenuPortal>
|
|
151
|
+
<DropdownMenuSubContent
|
|
152
|
+
v-bind="subProps._dropdownMenuSubContent"
|
|
153
|
+
:una="forwarded.una?.dropdownMenuSubContent"
|
|
154
|
+
>
|
|
155
|
+
<template
|
|
156
|
+
v-for="subItem in subProps.items"
|
|
157
|
+
:key="subItem.label"
|
|
158
|
+
>
|
|
159
|
+
<DropdownMenuItem
|
|
160
|
+
v-if="!subItem.items && subItem.label"
|
|
161
|
+
:size
|
|
162
|
+
:inset
|
|
163
|
+
:dropdown-menu-item
|
|
164
|
+
:una="forwarded.una?.dropdownMenuItem"
|
|
165
|
+
v-bind="{ ...subItem, ...forwarded._dropdownMenuItem, ...subItem._dropdownMenuItem }"
|
|
166
|
+
>
|
|
167
|
+
{{ subItem.label }}
|
|
168
|
+
</DropdownMenuItem>
|
|
169
|
+
|
|
170
|
+
<DropdownMenuSeparator
|
|
171
|
+
v-else-if="!subItem.label && !subItem.items"
|
|
172
|
+
:una="forwarded.una?.dropdownMenuSeparator"
|
|
173
|
+
v-bind="{ ...forwarded._dropdownMenuSeparator, ...subItem._dropdownMenuSeparator }"
|
|
174
|
+
/>
|
|
175
|
+
|
|
176
|
+
<ReuseMenuSub
|
|
177
|
+
v-else
|
|
178
|
+
v-bind="subItem"
|
|
179
|
+
/>
|
|
180
|
+
</template>
|
|
181
|
+
</DropdownMenuSubContent>
|
|
182
|
+
</DropdownMenuPortal>
|
|
183
|
+
</DropdownMenuSub>
|
|
184
|
+
<!-- </DropdownMenuGroup> -->
|
|
185
|
+
</DefineMenuSub>
|
|
186
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuContent,
|
|
5
|
+
type DropdownMenuContentEmits,
|
|
6
|
+
DropdownMenuPortal,
|
|
7
|
+
useForwardPropsEmits,
|
|
8
|
+
} from 'radix-vue'
|
|
9
|
+
import type { NDropdownMenuContentProps } from '../../../types'
|
|
10
|
+
import { cn } from '../../../utils'
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(
|
|
13
|
+
defineProps<NDropdownMenuContentProps>(),
|
|
14
|
+
{
|
|
15
|
+
sideOffset: 4,
|
|
16
|
+
},
|
|
17
|
+
)
|
|
18
|
+
const emits = defineEmits<DropdownMenuContentEmits>()
|
|
19
|
+
|
|
20
|
+
const delegatedProps = computed(() => {
|
|
21
|
+
const { class: _, ...delegated } = props
|
|
22
|
+
|
|
23
|
+
return delegated
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<DropdownMenuPortal>
|
|
31
|
+
<DropdownMenuContent
|
|
32
|
+
v-bind="forwarded"
|
|
33
|
+
:class="cn(
|
|
34
|
+
'dropdown-menu-content',
|
|
35
|
+
props.class,
|
|
36
|
+
props.una?.dropdownMenuContent,
|
|
37
|
+
)"
|
|
38
|
+
>
|
|
39
|
+
<slot />
|
|
40
|
+
</DropdownMenuContent>
|
|
41
|
+
</DropdownMenuPortal>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { DropdownMenuGroup } from 'radix-vue'
|
|
3
|
+
import type { NDropdownMenuGroupProps } from '../../../types'
|
|
4
|
+
import { cn } from '../../../utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<NDropdownMenuGroupProps>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<DropdownMenuGroup
|
|
11
|
+
v-bind="props"
|
|
12
|
+
:class="cn(
|
|
13
|
+
'dropdown-menu-group',
|
|
14
|
+
props.una?.dropdownMenuGroup,
|
|
15
|
+
props.class,
|
|
16
|
+
)"
|
|
17
|
+
>
|
|
18
|
+
<slot />
|
|
19
|
+
</DropdownMenuGroup>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { DropdownMenuItem, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../../../utils'
|
|
5
|
+
import type { NDropdownMenuItemProps } from '../../../types'
|
|
6
|
+
import Button from '../Button.vue'
|
|
7
|
+
import DropdownMenuShortcut from './DropdownMenuShortcut.vue'
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<NDropdownMenuItemProps>(), {
|
|
10
|
+
dropdownMenuItem: '~',
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const delegatedProps = computed(() => {
|
|
14
|
+
const { class: _, ...delegated } = props
|
|
15
|
+
|
|
16
|
+
return delegated
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div>
|
|
24
|
+
<DropdownMenuItem
|
|
25
|
+
as-child
|
|
26
|
+
>
|
|
27
|
+
<Button
|
|
28
|
+
v-bind="forwardedProps"
|
|
29
|
+
:dropdown-menu-item
|
|
30
|
+
:class="cn(
|
|
31
|
+
'dropdown-menu-item-base w-full justify-start font-normal rounded-sm px-2',
|
|
32
|
+
forwardedProps.inset && !(forwardedProps.leading || $slots.leading) && 'pl-8',
|
|
33
|
+
props.class,
|
|
34
|
+
)"
|
|
35
|
+
btn="~"
|
|
36
|
+
:una="{
|
|
37
|
+
btnLeading: cn('dropdown-menu-item-leading', forwardedProps.una?.btnLeading),
|
|
38
|
+
btnTrailing: cn('dropdown-menu-item-trailing', forwardedProps.una?.btnTrailing),
|
|
39
|
+
...forwardedProps.una,
|
|
40
|
+
}"
|
|
41
|
+
>
|
|
42
|
+
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
43
|
+
<slot :name="name" v-bind="slotData" />
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<template
|
|
47
|
+
v-if="forwardedProps.shortcut"
|
|
48
|
+
#trailing
|
|
49
|
+
>
|
|
50
|
+
<DropdownMenuShortcut>
|
|
51
|
+
{{ forwardedProps.shortcut }}
|
|
52
|
+
</DropdownMenuShortcut>
|
|
53
|
+
</template>
|
|
54
|
+
</Button>
|
|
55
|
+
</DropdownMenuItem>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { DropdownMenuLabel, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../../../utils'
|
|
5
|
+
import type { NDropdownMenuLabelProps } from '../../../types'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<NDropdownMenuLabelProps>(), {
|
|
8
|
+
size: 'sm',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const delegatedProps = computed(() => {
|
|
12
|
+
const { class: _, ...delegated } = props
|
|
13
|
+
|
|
14
|
+
return delegated
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<DropdownMenuLabel
|
|
22
|
+
v-bind="forwardedProps"
|
|
23
|
+
:class="cn(
|
|
24
|
+
'dropdown-menu-label',
|
|
25
|
+
forwardedProps.inset && 'pl-8',
|
|
26
|
+
props.class,
|
|
27
|
+
props.una?.dropdownMenuLabel,
|
|
28
|
+
)"
|
|
29
|
+
>
|
|
30
|
+
<slot />
|
|
31
|
+
</DropdownMenuLabel>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { DropdownMenuRoot, type DropdownMenuRootEmits, useForwardPropsEmits } from 'radix-vue'
|
|
3
|
+
import type { NDropdownMenuRootProps } from '../../../types'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<NDropdownMenuRootProps>()
|
|
6
|
+
const emits = defineEmits<DropdownMenuRootEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DropdownMenuRoot v-bind="forwarded">
|
|
13
|
+
<slot />
|
|
14
|
+
</DropdownMenuRoot>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuSeparator,
|
|
5
|
+
} from 'radix-vue'
|
|
6
|
+
import { cn } from '../../../utils'
|
|
7
|
+
import type { NDropdownMenuSeparatorProps } from '../../../types'
|
|
8
|
+
import Separator from '../Separator.vue'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<NDropdownMenuSeparatorProps>()
|
|
11
|
+
|
|
12
|
+
const delegatedProps = computed(() => {
|
|
13
|
+
const { class: _, ...delegated } = props
|
|
14
|
+
|
|
15
|
+
return delegated
|
|
16
|
+
})
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<DropdownMenuSeparator
|
|
21
|
+
as-child
|
|
22
|
+
>
|
|
23
|
+
<div class="dropdown-menu-separator-root">
|
|
24
|
+
<Separator
|
|
25
|
+
v-bind="delegatedProps"
|
|
26
|
+
:class="cn(
|
|
27
|
+
'dropdown-menu-separator my-1',
|
|
28
|
+
props.class,
|
|
29
|
+
props.una?.dropdownMenuSeparator,
|
|
30
|
+
)"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
</DropdownMenuSeparator>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '../../../utils'
|
|
3
|
+
import type { NDropdownMenuShortcutProps } from '../../../types/dropdown-menu'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<NDropdownMenuShortcutProps>(), {
|
|
6
|
+
size: 'sm',
|
|
7
|
+
})
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<span
|
|
12
|
+
:class="cn(
|
|
13
|
+
'dropdown-menu-shortcut',
|
|
14
|
+
props.class,
|
|
15
|
+
props.una?.dropdownMenuShortcut,
|
|
16
|
+
)"
|
|
17
|
+
>
|
|
18
|
+
<slot>
|
|
19
|
+
{{ props.value }}
|
|
20
|
+
</slot>
|
|
21
|
+
</span>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
DropdownMenuSub,
|
|
4
|
+
useForwardPropsEmits,
|
|
5
|
+
} from 'radix-vue'
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
DropdownMenuSubEmits,
|
|
9
|
+
DropdownMenuSubProps,
|
|
10
|
+
} from 'radix-vue'
|
|
11
|
+
|
|
12
|
+
const props = defineProps<DropdownMenuSubProps>()
|
|
13
|
+
const emits = defineEmits<DropdownMenuSubEmits>()
|
|
14
|
+
|
|
15
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<DropdownMenuSub
|
|
20
|
+
v-bind="forwarded"
|
|
21
|
+
>
|
|
22
|
+
<slot />
|
|
23
|
+
</DropdownMenuSub>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuSubContent,
|
|
5
|
+
type DropdownMenuSubContentEmits,
|
|
6
|
+
useForwardPropsEmits,
|
|
7
|
+
} from 'radix-vue'
|
|
8
|
+
import { cn } from '../../../utils'
|
|
9
|
+
import type { NDropdownMenuSubContentProps } from '../../../types'
|
|
10
|
+
|
|
11
|
+
const props = defineProps<NDropdownMenuSubContentProps>()
|
|
12
|
+
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
|
13
|
+
|
|
14
|
+
const delegatedProps = computed(() => {
|
|
15
|
+
const { class: _, ...delegated } = props
|
|
16
|
+
|
|
17
|
+
return delegated
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<DropdownMenuSubContent
|
|
25
|
+
v-bind="forwarded"
|
|
26
|
+
:class="cn(
|
|
27
|
+
'dropdown-menu-sub-content',
|
|
28
|
+
props.class,
|
|
29
|
+
forwarded.una?.dropdownMenuSubContent,
|
|
30
|
+
)"
|
|
31
|
+
>
|
|
32
|
+
<slot />
|
|
33
|
+
</DropdownMenuSubContent>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuSubTrigger,
|
|
5
|
+
useForwardProps,
|
|
6
|
+
} from 'radix-vue'
|
|
7
|
+
import { cn } from '../../../utils'
|
|
8
|
+
import Button from '../Button.vue'
|
|
9
|
+
import type { NDropdownMenuSubTriggerProps } from '../../../types'
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<NDropdownMenuSubTriggerProps>(), {
|
|
12
|
+
dropdownMenuItem: '~',
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const delegatedProps = computed(() => {
|
|
16
|
+
const { class: _, ...delegated } = props
|
|
17
|
+
|
|
18
|
+
return delegated
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<DropdownMenuSubTrigger
|
|
26
|
+
as-child
|
|
27
|
+
>
|
|
28
|
+
<Button
|
|
29
|
+
v-bind="forwardedProps"
|
|
30
|
+
:dropdown-menu-item
|
|
31
|
+
:class="cn(
|
|
32
|
+
'dropdown-menu-sub-trigger w-full justify-start font-normal rounded-sm px-2',
|
|
33
|
+
forwardedProps.inset && !(forwardedProps.leading || $slots.leading) && 'pl-8',
|
|
34
|
+
props.class,
|
|
35
|
+
)"
|
|
36
|
+
btn="~"
|
|
37
|
+
:una="{
|
|
38
|
+
btnLeading: cn('dropdown-menu-sub-trigger-leading', forwardedProps.una?.btnLeading),
|
|
39
|
+
btnTrailing: cn('dropdown-menu-sub-trigger-trailing', forwardedProps.una?.btnTrailing),
|
|
40
|
+
...forwardedProps.una,
|
|
41
|
+
}"
|
|
42
|
+
trailing="i-radix-icons-chevron-right"
|
|
43
|
+
>
|
|
44
|
+
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
45
|
+
<slot :name="name" v-bind="slotData" />
|
|
46
|
+
</template>
|
|
47
|
+
</Button>
|
|
48
|
+
</dropdownmenusubtrigger>
|
|
49
|
+
</template>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { DropdownMenuTrigger, useForwardProps } from 'radix-vue'
|
|
3
|
+
import Button from '../Button.vue'
|
|
4
|
+
import { cn } from '../../../utils'
|
|
5
|
+
import type { NDropdownMenuTriggerProps } from '../../../types'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<NDropdownMenuTriggerProps>(), {
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const forwardedProps = useForwardProps(props)
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<DropdownMenuTrigger
|
|
15
|
+
as-child
|
|
16
|
+
>
|
|
17
|
+
<Button
|
|
18
|
+
v-bind="forwardedProps"
|
|
19
|
+
:class="cn(
|
|
20
|
+
'dropdown-menu-trigger justify-start font-normal',
|
|
21
|
+
props.class,
|
|
22
|
+
)"
|
|
23
|
+
:una="{
|
|
24
|
+
btnDefaultVariant: 'dropdown-menu-default-variant',
|
|
25
|
+
btnLeading: cn('dropdown-menu-trigger-leading', forwardedProps.una?.btnLeading),
|
|
26
|
+
btnTrailing: cn('dropdown-menu-trigger-trailing', forwardedProps.una?.btnTrailing),
|
|
27
|
+
...forwardedProps.una,
|
|
28
|
+
}"
|
|
29
|
+
>
|
|
30
|
+
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
31
|
+
<slot :name="name" v-bind="slotData" />
|
|
32
|
+
</template>
|
|
33
|
+
</Button>
|
|
34
|
+
</DropdownMenuTrigger>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
import type { DropdownMenuContentProps, DropdownMenuGroupProps, DropdownMenuLabelProps, DropdownMenuRootProps, DropdownMenuSeparatorProps, DropdownMenuSubContentProps, DropdownMenuSubTriggerProps, DropdownMenuTriggerProps } from 'radix-vue';
|
|
3
|
+
import type { NButtonProps } from './button.js';
|
|
4
|
+
import type { NSeparatorProps } from './separator.js';
|
|
5
|
+
/**
|
|
6
|
+
* Base extensions for dropdown menu components.
|
|
7
|
+
*/
|
|
8
|
+
interface BaseExtensions {
|
|
9
|
+
/** CSS class for the component */
|
|
10
|
+
class?: HTMLAttributes['class'];
|
|
11
|
+
/** Size of the component */
|
|
12
|
+
size?: HTMLAttributes['class'];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Props for the NDropdownMenu component.
|
|
16
|
+
*/
|
|
17
|
+
export interface NDropdownMenuProps extends Omit<NDropdownMenuRootProps, 'class' | 'size'>, Omit<NDropdownMenuTriggerProps, 'una'>, Pick<NDropdownMenuItemProps, 'shortcut' | 'dropdownMenuItem'> {
|
|
18
|
+
/** Label for the menu */
|
|
19
|
+
menuLabel?: string;
|
|
20
|
+
/** Items in the dropdown menu */
|
|
21
|
+
items?: NDropdownMenuProps[];
|
|
22
|
+
/** Whether the menu is inset */
|
|
23
|
+
inset?: boolean;
|
|
24
|
+
/** Props for the dropdown menu root */
|
|
25
|
+
_dropdownMenuRoot?: Partial<NDropdownMenuRootProps>;
|
|
26
|
+
/** Props for the dropdown menu item */
|
|
27
|
+
_dropdownMenuItem?: Partial<NDropdownMenuItemProps>;
|
|
28
|
+
/** Props for the dropdown menu trigger */
|
|
29
|
+
_dropdownMenuTrigger?: Partial<NDropdownMenuTriggerProps>;
|
|
30
|
+
/** Props for the dropdown menu content */
|
|
31
|
+
_dropdownMenuContent?: Partial<NDropdownMenuContentProps>;
|
|
32
|
+
/** Props for the dropdown menu sub-content */
|
|
33
|
+
_dropdownMenuSubContent?: Partial<NDropdownMenuSubContentProps>;
|
|
34
|
+
/** Props for the dropdown menu label */
|
|
35
|
+
_dropdownMenuLabel?: Partial<NDropdownMenuLabelProps>;
|
|
36
|
+
/** Props for the dropdown menu separator */
|
|
37
|
+
_dropdownMenuSeparator?: Partial<NDropdownMenuSeparatorProps>;
|
|
38
|
+
/** Props for the dropdown menu group */
|
|
39
|
+
_dropdownMenuGroup?: Partial<NDropdownMenuGroupProps>;
|
|
40
|
+
/** Props for the dropdown menu sub-trigger */
|
|
41
|
+
_dropdownMenuSubTrigger?: Partial<NDropdownMenuSubTriggerProps>;
|
|
42
|
+
/** Additional properties for the una component */
|
|
43
|
+
una?: NDropdownMenuUnaProps & NButtonProps['una'];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Props for the NDropdownMenuRoot component.
|
|
47
|
+
*/
|
|
48
|
+
export interface NDropdownMenuRootProps extends BaseExtensions, DropdownMenuRootProps {
|
|
49
|
+
/** Additional properties for the una component */
|
|
50
|
+
una?: NDropdownMenuUnaProps['dropdownMenuRoot'];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Props for the NDropdownMenuTrigger component.
|
|
54
|
+
*/
|
|
55
|
+
export interface NDropdownMenuTriggerProps extends NButtonProps, DropdownMenuTriggerProps {
|
|
56
|
+
/** Additional properties for the una component */
|
|
57
|
+
una?: NDropdownMenuUnaProps['dropdownMenuTrigger'] & NButtonProps['una'];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Props for the NDropdownMenuContent component.
|
|
61
|
+
*/
|
|
62
|
+
export interface NDropdownMenuContentProps extends BaseExtensions, DropdownMenuContentProps {
|
|
63
|
+
/** Additional properties for the una component */
|
|
64
|
+
una?: NDropdownMenuUnaProps['dropdownMenuContent'];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Props for the NDropdownMenuLabel component.
|
|
68
|
+
*/
|
|
69
|
+
export interface NDropdownMenuLabelProps extends BaseExtensions, DropdownMenuLabelProps {
|
|
70
|
+
/** Whether the label is inset */
|
|
71
|
+
inset?: boolean;
|
|
72
|
+
/** Size of the label */
|
|
73
|
+
size?: HTMLAttributes['class'];
|
|
74
|
+
/** Additional properties for the una component */
|
|
75
|
+
una?: NDropdownMenuUnaProps['dropdownMenuLabel'];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Props for the NDropdownMenuSeparator component.
|
|
79
|
+
*/
|
|
80
|
+
export interface NDropdownMenuSeparatorProps extends DropdownMenuSeparatorProps, NSeparatorProps {
|
|
81
|
+
/** Additional properties for the una component */
|
|
82
|
+
una?: NDropdownMenuUnaProps['dropdownMenuSeparator'] & NSeparatorProps['una'];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Props for the NDropdownMenuGroup component.
|
|
86
|
+
*/
|
|
87
|
+
export interface NDropdownMenuGroupProps extends BaseExtensions, DropdownMenuGroupProps {
|
|
88
|
+
/** Additional properties for the una component */
|
|
89
|
+
una?: NDropdownMenuUnaProps['dropdownMenuGroup'];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Props for the NDropdownMenuSubContent component.
|
|
93
|
+
*/
|
|
94
|
+
export interface NDropdownMenuSubContentProps extends BaseExtensions, DropdownMenuSubContentProps {
|
|
95
|
+
/** Additional properties for the una component */
|
|
96
|
+
una?: NDropdownMenuUnaProps['dropdownMenuSubContent'];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Props for the NDropdownMenuItem component.
|
|
100
|
+
*/
|
|
101
|
+
export interface NDropdownMenuItemProps extends NButtonProps {
|
|
102
|
+
/** Dropdown menu item */
|
|
103
|
+
dropdownMenuItem?: HTMLAttributes['class'];
|
|
104
|
+
/** Whether the item is inset */
|
|
105
|
+
inset?: boolean;
|
|
106
|
+
/** Shortcut key for the item */
|
|
107
|
+
shortcut?: string;
|
|
108
|
+
/** Additional properties for the una component */
|
|
109
|
+
una?: NDropdownMenuUnaProps['dropdownMenuItem'] & NButtonProps['una'];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Props for the NDropdownMenuSubTrigger component.
|
|
113
|
+
*/
|
|
114
|
+
export interface NDropdownMenuSubTriggerProps extends NButtonProps, DropdownMenuSubTriggerProps {
|
|
115
|
+
/** Dropdown menu item */
|
|
116
|
+
dropdownMenuItem?: HTMLAttributes['class'];
|
|
117
|
+
/** Whether the sub-trigger is inset */
|
|
118
|
+
inset?: boolean;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Props for the NDropdownMenuShortcut component.
|
|
122
|
+
*/
|
|
123
|
+
export interface NDropdownMenuShortcutProps extends BaseExtensions {
|
|
124
|
+
/** Shortcut key for the item */
|
|
125
|
+
value?: string;
|
|
126
|
+
/** Additional properties for the una component */
|
|
127
|
+
una?: NDropdownMenuUnaProps['dropdownMenuShortcut'];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Props for the NDropdownMenuUna component.
|
|
131
|
+
*/
|
|
132
|
+
interface NDropdownMenuUnaProps {
|
|
133
|
+
/** CSS class for the dropdown menu content */
|
|
134
|
+
dropdownMenuContent?: HTMLAttributes['class'];
|
|
135
|
+
/** CSS class for the dropdown menu sub-content */
|
|
136
|
+
dropdownMenuSubContent?: HTMLAttributes['class'];
|
|
137
|
+
/** CSS class for the dropdown menu sub-trigger */
|
|
138
|
+
dropdownMenuSubTrigger?: HTMLAttributes['class'];
|
|
139
|
+
/** CSS class for the dropdown menu trigger */
|
|
140
|
+
dropdownMenuTrigger?: HTMLAttributes['class'];
|
|
141
|
+
/** CSS class for the dropdown menu label */
|
|
142
|
+
dropdownMenuLabel?: HTMLAttributes['class'];
|
|
143
|
+
/** CSS class for the dropdown menu separator */
|
|
144
|
+
dropdownMenuSeparator?: HTMLAttributes['class'];
|
|
145
|
+
/** CSS class for the dropdown menu group */
|
|
146
|
+
dropdownMenuGroup?: HTMLAttributes['class'];
|
|
147
|
+
/** CSS class for the dropdown menu item */
|
|
148
|
+
dropdownMenuItem?: HTMLAttributes['class'];
|
|
149
|
+
/** CSS class for the dropdown menu root */
|
|
150
|
+
dropdownMenuRoot?: HTMLAttributes['class'];
|
|
151
|
+
/** CSS class for the dropdown menu shortcut */
|
|
152
|
+
dropdownMenuShortcut?: HTMLAttributes['class'];
|
|
153
|
+
}
|
|
154
|
+
export {};
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@una-ui/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.0-beta.1",
|
|
5
5
|
"description": "Nuxt module for @una-ui",
|
|
6
6
|
"author": "Phojie Rengel <phojrengel@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"typescript": "^5.5.4",
|
|
50
50
|
"unocss": "^0.62.2",
|
|
51
51
|
"unocss-preset-animations": "^1.1.0",
|
|
52
|
-
"@una-ui/extractor-vue-script": "^0.
|
|
53
|
-
"@una-ui/preset": "^0.
|
|
52
|
+
"@una-ui/extractor-vue-script": "^0.14.0-beta.1",
|
|
53
|
+
"@una-ui/preset": "^0.14.0-beta.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@nuxt/module-builder": "^0.8.1",
|
|
@@ -6,7 +6,7 @@ interface _GlobalComponents {
|
|
|
6
6
|
'Breadcrumb': typeof import("../components/Breadcrumb.vue")['default']
|
|
7
7
|
'Card': typeof import("../components/Card.vue")['default']
|
|
8
8
|
'ColorMode': typeof import("../components/ColorMode.vue")['default']
|
|
9
|
-
'Dropdown': typeof import("../components/
|
|
9
|
+
'Dropdown': typeof import("../components/DropdownMenu.vue")['default']
|
|
10
10
|
'Extractor': typeof import("../components/Extractor.vue")['default']
|
|
11
11
|
'Form': typeof import("../components/Form.vue")['default']
|
|
12
12
|
'Progress': typeof import("../components/Progress.vue")['default']
|
|
@@ -425,7 +425,7 @@ interface _GlobalComponents {
|
|
|
425
425
|
'LazyBreadcrumb': typeof import("../components/Breadcrumb.vue")['default']
|
|
426
426
|
'LazyCard': typeof import("../components/Card.vue")['default']
|
|
427
427
|
'LazyColorMode': typeof import("../components/ColorMode.vue")['default']
|
|
428
|
-
'LazyDropdown': typeof import("../components/
|
|
428
|
+
'LazyDropdown': typeof import("../components/DropdownMenu.vue")['default']
|
|
429
429
|
'LazyExtractor': typeof import("../components/Extractor.vue")['default']
|
|
430
430
|
'LazyForm': typeof import("../components/Form.vue")['default']
|
|
431
431
|
'LazyProgress': typeof import("../components/Progress.vue")['default']
|
|
@@ -858,7 +858,7 @@ export const Accordion: typeof import("../components/Accordion.vue")['default']
|
|
|
858
858
|
export const Breadcrumb: typeof import("../components/Breadcrumb.vue")['default']
|
|
859
859
|
export const Card: typeof import("../components/Card.vue")['default']
|
|
860
860
|
export const ColorMode: typeof import("../components/ColorMode.vue")['default']
|
|
861
|
-
export const Dropdown: typeof import("../components/
|
|
861
|
+
export const Dropdown: typeof import("../components/DropdownMenu.vue")['default']
|
|
862
862
|
export const Extractor: typeof import("../components/Extractor.vue")['default']
|
|
863
863
|
export const Form: typeof import("../components/Form.vue")['default']
|
|
864
864
|
export const Progress: typeof import("../components/Progress.vue")['default']
|
|
@@ -1277,7 +1277,7 @@ export const LazyAccordion: typeof import("../components/Accordion.vue")['defaul
|
|
|
1277
1277
|
export const LazyBreadcrumb: typeof import("../components/Breadcrumb.vue")['default']
|
|
1278
1278
|
export const LazyCard: typeof import("../components/Card.vue")['default']
|
|
1279
1279
|
export const LazyColorMode: typeof import("../components/ColorMode.vue")['default']
|
|
1280
|
-
export const LazyDropdown: typeof import("../components/
|
|
1280
|
+
export const LazyDropdown: typeof import("../components/DropdownMenu.vue")['default']
|
|
1281
1281
|
export const LazyExtractor: typeof import("../components/Extractor.vue")['default']
|
|
1282
1282
|
export const LazyForm: typeof import("../components/Form.vue")['default']
|
|
1283
1283
|
export const LazyProgress: typeof import("../components/Progress.vue")['default']
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
export {};
|
|
3
|
+
declare module 'vue' {
|
|
4
|
+
export interface GlobalComponents { }
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
|
|
8
|
+
const __VLS_intrinsicElements: __VLS_IntrinsicElements;
|
|
9
|
+
const __VLS_directiveBindingRestFields = { instance: null, oldValue: null, modifiers: null as any, dir: null as any };
|
|
10
|
+
|
|
11
|
+
type __VLS_IntrinsicElements = import('vue/jsx-runtime').JSX.IntrinsicElements;
|
|
12
|
+
type __VLS_Element = import('vue/jsx-runtime').JSX.Element;
|
|
13
|
+
type __VLS_GlobalComponents = (import('vue').GlobalComponents) & Pick<typeof import('vue'), 'Transition' | 'TransitionGroup' | 'KeepAlive' | 'Suspense' | 'Teleport'>;
|
|
14
|
+
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
|
|
15
|
+
type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
|
|
16
|
+
type __VLS_unknownDirective = (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
|
|
17
|
+
type __VLS_WithComponent<N0 extends string, LocalComponents, N1 extends string, N2 extends string, N3 extends string> =
|
|
18
|
+
N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N1] } :
|
|
19
|
+
N2 extends keyof LocalComponents ? N2 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N2] } :
|
|
20
|
+
N3 extends keyof LocalComponents ? N3 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N3] } :
|
|
21
|
+
N1 extends keyof __VLS_GlobalComponents ? N1 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N1] } :
|
|
22
|
+
N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N2] } :
|
|
23
|
+
N3 extends keyof __VLS_GlobalComponents ? N3 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N3] } :
|
|
24
|
+
{ [K in N0]: unknown }
|
|
25
|
+
type __VLS_FunctionalComponentProps<T, K> =
|
|
26
|
+
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
|
|
27
|
+
: T extends (props: infer P, ...args: any) => any ? P :
|
|
28
|
+
{};
|
|
29
|
+
type __VLS_IsFunction<T, K> = K extends keyof T
|
|
30
|
+
? __VLS_IsAny<T[K]> extends false
|
|
31
|
+
? unknown extends T[K]
|
|
32
|
+
? false
|
|
33
|
+
: true
|
|
34
|
+
: false
|
|
35
|
+
: false;
|
|
36
|
+
// fix https://github.com/vuejs/language-tools/issues/926
|
|
37
|
+
type __VLS_UnionToIntersection<U> = (U extends unknown ? (arg: U) => unknown : never) extends ((arg: infer P) => unknown) ? P : never;
|
|
38
|
+
type __VLS_OverloadUnionInner<T, U = unknown> = U & T extends (...args: infer A) => infer R
|
|
39
|
+
? U extends T
|
|
40
|
+
? never
|
|
41
|
+
: __VLS_OverloadUnionInner<T, Pick<T, keyof T> & U & ((...args: A) => R)> | ((...args: A) => R)
|
|
42
|
+
: never;
|
|
43
|
+
type __VLS_OverloadUnion<T> = Exclude<
|
|
44
|
+
__VLS_OverloadUnionInner<(() => never) & T>,
|
|
45
|
+
T extends () => never ? never : () => never
|
|
46
|
+
>;
|
|
47
|
+
type __VLS_ConstructorOverloads<T> = __VLS_OverloadUnion<T> extends infer F
|
|
48
|
+
? F extends (event: infer E, ...args: infer A) => any
|
|
49
|
+
? { [K in E & string]: (...args: A) => void; }
|
|
50
|
+
: never
|
|
51
|
+
: never;
|
|
52
|
+
type __VLS_NormalizeEmits<T> = __VLS_PrettifyGlobal<
|
|
53
|
+
__VLS_UnionToIntersection<
|
|
54
|
+
__VLS_ConstructorOverloads<T> & {
|
|
55
|
+
[K in keyof T]: T[K] extends any[] ? { (...args: T[K]): void } : never
|
|
56
|
+
}
|
|
57
|
+
>
|
|
58
|
+
>;
|
|
59
|
+
type __VLS_PrettifyGlobal<T> = { [K in keyof T]: T[K]; } & {};
|
|
60
|
+
|
|
61
|
+
function __VLS_getVForSourceType(source: number): [number, number, number][];
|
|
62
|
+
function __VLS_getVForSourceType(source: string): [string, number, number][];
|
|
63
|
+
function __VLS_getVForSourceType<T extends any[]>(source: T): [
|
|
64
|
+
item: T[number],
|
|
65
|
+
key: number,
|
|
66
|
+
index: number,
|
|
67
|
+
][];
|
|
68
|
+
function __VLS_getVForSourceType<T extends { [Symbol.iterator](): Iterator<any> }>(source: T): [
|
|
69
|
+
item: T extends { [Symbol.iterator](): Iterator<infer T1> } ? T1 : never,
|
|
70
|
+
key: number,
|
|
71
|
+
index: undefined,
|
|
72
|
+
][];
|
|
73
|
+
// #3845
|
|
74
|
+
function __VLS_getVForSourceType<T extends number | { [Symbol.iterator](): Iterator<any> }>(source: T): [
|
|
75
|
+
item: number | (Exclude<T, number> extends { [Symbol.iterator](): Iterator<infer T1> } ? T1 : never),
|
|
76
|
+
key: number,
|
|
77
|
+
index: undefined,
|
|
78
|
+
][];
|
|
79
|
+
function __VLS_getVForSourceType<T>(source: T): [
|
|
80
|
+
item: T[keyof T],
|
|
81
|
+
key: keyof T,
|
|
82
|
+
index: number,
|
|
83
|
+
][];
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
function __VLS_getSlotParams<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>;
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
function __VLS_getSlotParam<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>[0];
|
|
88
|
+
function __VLS_directiveAsFunction<T extends import('vue').Directive>(dir: T): T extends (...args: any) => any
|
|
89
|
+
? T | __VLS_unknownDirective
|
|
90
|
+
: NonNullable<(T & Record<string, __VLS_unknownDirective>)['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']>;
|
|
91
|
+
function __VLS_withScope<T, K>(ctx: T, scope: K): ctx is T & K;
|
|
92
|
+
function __VLS_makeOptional<T>(t: T): { [K in keyof T]?: T[K] };
|
|
93
|
+
function __VLS_nonNullable<T>(t: T): T extends null | undefined ? never : T;
|
|
94
|
+
function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K):
|
|
95
|
+
T extends new (...args: any) => any
|
|
96
|
+
? (props: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & { __ctx?: {
|
|
97
|
+
attrs?: any,
|
|
98
|
+
slots?: K extends { $slots: infer Slots } ? Slots : any,
|
|
99
|
+
emit?: K extends { $emit: infer Emit } ? Emit : any
|
|
100
|
+
} & { props?: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>; expose?(exposed: K): void; } }
|
|
101
|
+
: T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
|
|
102
|
+
: T extends (...args: any) => any ? T
|
|
103
|
+
: (_: {} & Record<string, unknown>, ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {} & Record<string, unknown> } };
|
|
104
|
+
function __VLS_elementAsFunction<T>(tag: T, endTag?: T): (_: T & Record<string, unknown>) => void;
|
|
105
|
+
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
|
|
106
|
+
function __VLS_pickFunctionalComponentCtx<T, K>(comp: T, compInstance: K): NonNullable<__VLS_PickNotAny<
|
|
107
|
+
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: infer Ctx } ? Ctx : never : any
|
|
108
|
+
, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
|
|
109
|
+
>>;
|
|
110
|
+
function __VLS_normalizeSlot<S>(s: S): S extends () => infer R ? (props: {}) => R : S;
|
|
111
|
+
function __VLS_tryAsConstant<const T>(t: T): T;
|
|
112
|
+
}
|