@nuxt/ui 3.0.0-beta.1 → 3.0.0-beta.3
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 +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Accordion.vue +7 -0
- package/dist/runtime/components/Alert.vue +14 -0
- 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 +56 -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/FormField.vue +3 -0
- package/dist/runtime/components/Input.vue +9 -0
- 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/Modal.vue +1 -0
- package/dist/runtime/components/NavigationMenu.vue +17 -0
- package/dist/runtime/components/OverlayProvider.vue +1 -0
- package/dist/runtime/components/Pagination.vue +15 -9
- 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 +9 -0
- 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/useComponentIcons.d.ts +13 -3
- package/dist/runtime/composables/useOverlay.d.ts +1 -1
- package/dist/runtime/composables/useOverlay.js +1 -0
- package/dist/runtime/utils/index.js +1 -1
- package/dist/runtime/vue/components/Link.vue +8 -4
- package/dist/shared/{ui.DfK2RX6G.cjs → ui.DG2iA__L.cjs} +17 -3
- package/dist/shared/{ui.DSPu6Y8j.mjs → ui.S-Be5Oao.mjs} +17 -3
- 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 +10 -10
|
@@ -16,6 +16,9 @@ const inputMenu = tv({ extend: tv(theme), ...(appConfigInputMenu.ui?.inputMenu |
|
|
|
16
16
|
|
|
17
17
|
export interface InputMenuItem {
|
|
18
18
|
label?: string
|
|
19
|
+
/**
|
|
20
|
+
* @IconifyIcon
|
|
21
|
+
*/
|
|
19
22
|
icon?: string
|
|
20
23
|
avatar?: AvatarProps
|
|
21
24
|
chip?: ChipProps
|
|
@@ -40,8 +43,17 @@ export interface InputMenuProps<T extends MaybeArrayOfArrayItem<I>, I extends Ma
|
|
|
40
43
|
type?: InputHTMLAttributes['type']
|
|
41
44
|
/** The placeholder text when the input is empty. */
|
|
42
45
|
placeholder?: string
|
|
46
|
+
/**
|
|
47
|
+
* @defaultValue 'primary'
|
|
48
|
+
*/
|
|
43
49
|
color?: InputMenuVariants['color']
|
|
50
|
+
/**
|
|
51
|
+
* @defaultValue 'outline'
|
|
52
|
+
*/
|
|
44
53
|
variant?: InputMenuVariants['variant']
|
|
54
|
+
/**
|
|
55
|
+
* @defaultValue 'md'
|
|
56
|
+
*/
|
|
45
57
|
size?: InputMenuVariants['size']
|
|
46
58
|
required?: boolean
|
|
47
59
|
autofocus?: boolean
|
|
@@ -49,17 +61,20 @@ export interface InputMenuProps<T extends MaybeArrayOfArrayItem<I>, I extends Ma
|
|
|
49
61
|
/**
|
|
50
62
|
* The icon displayed to open the menu.
|
|
51
63
|
* @defaultValue appConfig.ui.icons.chevronDown
|
|
64
|
+
* @IconifyIcon
|
|
52
65
|
*/
|
|
53
66
|
trailingIcon?: string
|
|
54
67
|
/**
|
|
55
68
|
* The icon displayed when an item is selected.
|
|
56
69
|
* @defaultValue appConfig.ui.icons.check
|
|
70
|
+
* @IconifyIcon
|
|
57
71
|
*/
|
|
58
72
|
selectedIcon?: string
|
|
59
73
|
/**
|
|
60
74
|
* The icon displayed to delete a tag.
|
|
61
75
|
* Works only when `multiple` is `true`.
|
|
62
76
|
* @defaultValue appConfig.ui.icons.close
|
|
77
|
+
* @IconifyIcon
|
|
63
78
|
*/
|
|
64
79
|
deleteIcon?: string
|
|
65
80
|
/**
|
|
@@ -142,7 +157,7 @@ export interface InputMenuSlots<T, M extends boolean> {
|
|
|
142
157
|
import { computed, ref, toRef, onMounted, toRaw } from 'vue'
|
|
143
158
|
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxViewport, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits, useFilter } from 'reka-ui'
|
|
144
159
|
import { defu } from 'defu'
|
|
145
|
-
import { isEqual } from 'ohash'
|
|
160
|
+
import { isEqual } from 'ohash/utils'
|
|
146
161
|
import { reactivePick, createReusableTemplate } from '@vueuse/core'
|
|
147
162
|
import { useAppConfig } from '#imports'
|
|
148
163
|
import { useButtonGroup } from '../composables/useButtonGroup'
|
|
@@ -171,7 +186,7 @@ const { t } = useLocale()
|
|
|
171
186
|
const appConfig = useAppConfig()
|
|
172
187
|
const { contains } = useFilter({ sensitivity: 'base' })
|
|
173
188
|
|
|
174
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'open', 'defaultOpen', 'multiple', 'resetSearchTermOnBlur', 'highlightOnHover', 'ignoreFilter'), emits)
|
|
189
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'open', 'defaultOpen', 'required', 'multiple', 'resetSearchTermOnBlur', 'highlightOnHover', 'ignoreFilter'), emits)
|
|
175
190
|
const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }) as ComboboxContentProps)
|
|
176
191
|
const arrowProps = toRef(() => props.arrow as ComboboxArrowProps)
|
|
177
192
|
|
|
@@ -340,6 +355,7 @@ defineExpose({
|
|
|
340
355
|
v-slot="{ modelValue: tags }"
|
|
341
356
|
:model-value="(modelValue as string[])"
|
|
342
357
|
:disabled="disabled"
|
|
358
|
+
:required="required"
|
|
343
359
|
delimiter=""
|
|
344
360
|
as-child
|
|
345
361
|
@blur="onBlur"
|
|
@@ -365,7 +381,6 @@ defineExpose({
|
|
|
365
381
|
ref="inputRef"
|
|
366
382
|
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
367
383
|
:placeholder="placeholder"
|
|
368
|
-
:required="required"
|
|
369
384
|
:class="ui.tagsInput({ class: props.ui?.tagsInput })"
|
|
370
385
|
@keydown.enter.prevent
|
|
371
386
|
/>
|
|
@@ -40,6 +40,7 @@ export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue
|
|
|
40
40
|
/**
|
|
41
41
|
* The icon displayed to increment the value.
|
|
42
42
|
* @defaultValue appConfig.ui.icons.plus
|
|
43
|
+
* @IconifyIcon
|
|
43
44
|
*/
|
|
44
45
|
incrementIcon?: string
|
|
45
46
|
/**
|
|
@@ -50,6 +51,7 @@ export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue
|
|
|
50
51
|
/**
|
|
51
52
|
* The icon displayed to decrement the value.
|
|
52
53
|
* @defaultValue appConfig.ui.icons.minus
|
|
54
|
+
* @IconifyIcon
|
|
53
55
|
*/
|
|
54
56
|
decrementIcon?: string
|
|
55
57
|
autofocus?: boolean
|
|
@@ -91,7 +91,7 @@ export interface LinkSlots {
|
|
|
91
91
|
|
|
92
92
|
<script setup lang="ts">
|
|
93
93
|
import { computed } from 'vue'
|
|
94
|
-
import { isEqual, diff } from 'ohash'
|
|
94
|
+
import { isEqual, diff } from 'ohash/utils'
|
|
95
95
|
import { useForwardProps } from 'reka-ui'
|
|
96
96
|
import { reactiveOmit } from '@vueuse/core'
|
|
97
97
|
import { useRoute } from '#imports'
|
|
@@ -124,11 +124,15 @@ const ui = computed(() => tv({
|
|
|
124
124
|
function isPartiallyEqual(item1: any, item2: any) {
|
|
125
125
|
const diffedKeys = diff(item1, item2).reduce((filtered, q) => {
|
|
126
126
|
if (q.type === 'added') {
|
|
127
|
-
filtered.
|
|
127
|
+
filtered.add(q.key)
|
|
128
128
|
}
|
|
129
129
|
return filtered
|
|
130
|
-
},
|
|
131
|
-
|
|
130
|
+
}, new Set<string>())
|
|
131
|
+
|
|
132
|
+
const item1Filtered = Object.fromEntries(Object.entries(item1).filter(([key]) => !diffedKeys.has(key)))
|
|
133
|
+
const item2Filtered = Object.fromEntries(Object.entries(item2).filter(([key]) => !diffedKeys.has(key)))
|
|
134
|
+
|
|
135
|
+
return isEqual(item1Filtered, item2Filtered)
|
|
132
136
|
}
|
|
133
137
|
|
|
134
138
|
function isLinkActive({ route: linkRoute, isActive, isExactActive }: any) {
|
|
@@ -19,6 +19,9 @@ export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'child
|
|
|
19
19
|
|
|
20
20
|
export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'>, Pick<CollapsibleRootProps, 'defaultOpen' | 'open'> {
|
|
21
21
|
label?: string
|
|
22
|
+
/**
|
|
23
|
+
* @IconifyIcon
|
|
24
|
+
*/
|
|
22
25
|
icon?: string
|
|
23
26
|
avatar?: AvatarProps
|
|
24
27
|
/**
|
|
@@ -26,6 +29,9 @@ export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cu
|
|
|
26
29
|
* `{ size: 'sm', color: 'neutral', variant: 'outline' }`{lang="ts-type"}
|
|
27
30
|
*/
|
|
28
31
|
badge?: string | number | BadgeProps
|
|
32
|
+
/**
|
|
33
|
+
* @IconifyIcon
|
|
34
|
+
*/
|
|
29
35
|
trailingIcon?: string
|
|
30
36
|
/**
|
|
31
37
|
* The type of the item.
|
|
@@ -50,16 +56,24 @@ export interface NavigationMenuProps<T> extends Pick<NavigationMenuRootProps, 'm
|
|
|
50
56
|
/**
|
|
51
57
|
* The icon displayed to open the menu.
|
|
52
58
|
* @defaultValue appConfig.ui.icons.chevronDown
|
|
59
|
+
* @IconifyIcon
|
|
53
60
|
*/
|
|
54
61
|
trailingIcon?: string
|
|
55
62
|
/**
|
|
56
63
|
* The icon displayed when the item is an external link.
|
|
57
64
|
* Set to `false` to hide the external icon.
|
|
58
65
|
* @defaultValue appConfig.ui.icons.external
|
|
66
|
+
* @IconifyIcon
|
|
59
67
|
*/
|
|
60
68
|
externalIcon?: boolean | string
|
|
61
69
|
items?: T
|
|
70
|
+
/**
|
|
71
|
+
* @defaultValue 'primary'
|
|
72
|
+
*/
|
|
62
73
|
color?: NavigationMenuVariants['color']
|
|
74
|
+
/**
|
|
75
|
+
* @defaultValue 'pill'
|
|
76
|
+
*/
|
|
63
77
|
variant?: NavigationMenuVariants['variant']
|
|
64
78
|
/**
|
|
65
79
|
* The orientation of the menu.
|
|
@@ -74,6 +88,9 @@ export interface NavigationMenuProps<T> extends Pick<NavigationMenuRootProps, 'm
|
|
|
74
88
|
collapsed?: boolean
|
|
75
89
|
/** Display a line next to the active item. */
|
|
76
90
|
highlight?: boolean
|
|
91
|
+
/**
|
|
92
|
+
* @defaultValue 'primary'
|
|
93
|
+
*/
|
|
77
94
|
highlightColor?: NavigationMenuVariants['highlightColor']
|
|
78
95
|
/** The content of the menu. */
|
|
79
96
|
content?: Omit<NavigationMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
@@ -20,31 +20,37 @@ export interface PaginationProps extends Partial<Pick<PaginationRootProps, 'defa
|
|
|
20
20
|
/**
|
|
21
21
|
* The icon to use for the first page control.
|
|
22
22
|
* @defaultValue appConfig.ui.icons.chevronDoubleLeft
|
|
23
|
+
* @IconifyIcon
|
|
23
24
|
*/
|
|
24
25
|
firstIcon?: string
|
|
25
26
|
/**
|
|
26
27
|
* The icon to use for the previous page control.
|
|
27
28
|
* @defaultValue appConfig.ui.icons.chevronLeft
|
|
29
|
+
* @IconifyIcon
|
|
28
30
|
*/
|
|
29
31
|
prevIcon?: string
|
|
30
32
|
/**
|
|
31
33
|
* The icon to use for the next page control.
|
|
32
34
|
* @defaultValue appConfig.ui.icons.chevronRight
|
|
35
|
+
* @IconifyIcon
|
|
33
36
|
*/
|
|
34
37
|
nextIcon?: string
|
|
35
38
|
/**
|
|
36
39
|
* The icon to use for the last page control.
|
|
37
40
|
* @defaultValue appConfig.ui.icons.chevronDoubleRight
|
|
41
|
+
* @IconifyIcon
|
|
38
42
|
*/
|
|
39
43
|
lastIcon?: string
|
|
40
44
|
/**
|
|
41
45
|
* The icon to use for the ellipsis control.
|
|
42
46
|
* @defaultValue appConfig.ui.icons.ellipsis
|
|
47
|
+
* @IconifyIcon
|
|
43
48
|
*/
|
|
44
49
|
ellipsisIcon?: string
|
|
45
50
|
/**
|
|
46
51
|
* The color of the pagination controls.
|
|
47
52
|
* @defaultValue 'neutral'
|
|
53
|
+
* @IconifyIcon
|
|
48
54
|
*/
|
|
49
55
|
color?: ButtonProps['color']
|
|
50
56
|
/**
|
|
@@ -138,19 +144,19 @@ const ui = pagination()
|
|
|
138
144
|
<template>
|
|
139
145
|
<PaginationRoot v-slot="{ page, pageCount }" v-bind="rootProps" :class="ui.root({ class: [props.class, props.ui?.root] })">
|
|
140
146
|
<PaginationList v-slot="{ items }" :class="ui.list({ class: props.ui?.list })">
|
|
141
|
-
<PaginationFirst v-if="showControls || !!slots.first" as-child>
|
|
147
|
+
<PaginationFirst v-if="showControls || !!slots.first" as-child :class="ui.first({ class: props.ui?.first })">
|
|
142
148
|
<slot name="first">
|
|
143
149
|
<UButton :color="color" :variant="variant" :size="size" :icon="firstIcon" :to="to?.(1)" />
|
|
144
150
|
</slot>
|
|
145
151
|
</PaginationFirst>
|
|
146
|
-
<PaginationPrev v-if="showControls || !!slots.prev" as-child>
|
|
152
|
+
<PaginationPrev v-if="showControls || !!slots.prev" as-child :class="ui.prev({ class: props.ui?.prev })">
|
|
147
153
|
<slot name="prev">
|
|
148
154
|
<UButton :color="color" :variant="variant" :size="size" :icon="prevIcon" :to="page > 1 ? to?.(page - 1) : undefined" />
|
|
149
155
|
</slot>
|
|
150
156
|
</PaginationPrev>
|
|
151
157
|
|
|
152
158
|
<template v-for="(item, index) in items">
|
|
153
|
-
<PaginationListItem v-if="item.type === 'page'" :key="index" as-child :value="item.value">
|
|
159
|
+
<PaginationListItem v-if="item.type === 'page'" :key="index" as-child :value="item.value" :class="ui.item({ class: props.ui?.item })">
|
|
154
160
|
<slot name="item" v-bind="{ item, index, page, pageCount }">
|
|
155
161
|
<UButton
|
|
156
162
|
:color="page === item.value ? activeColor : color"
|
|
@@ -164,21 +170,21 @@ const ui = pagination()
|
|
|
164
170
|
</slot>
|
|
165
171
|
</PaginationListItem>
|
|
166
172
|
|
|
167
|
-
<PaginationEllipsis v-else :key="item.type" :index="index" as-child>
|
|
173
|
+
<PaginationEllipsis v-else :key="item.type" :index="index" as-child :class="ui.ellipsis({ class: props.ui?.ellipsis })">
|
|
168
174
|
<slot name="ellipsis">
|
|
169
|
-
<UButton :color="color" :variant="variant" :size="size" :icon="ellipsisIcon || appConfig.ui.icons.ellipsis"
|
|
175
|
+
<UButton :color="color" :variant="variant" :size="size" :icon="ellipsisIcon || appConfig.ui.icons.ellipsis" />
|
|
170
176
|
</slot>
|
|
171
177
|
</PaginationEllipsis>
|
|
172
178
|
</template>
|
|
173
179
|
|
|
174
|
-
<PaginationNext v-if="showControls || !!slots.next" as-child>
|
|
180
|
+
<PaginationNext v-if="showControls || !!slots.next" as-child :class="ui.next({ class: props.ui?.next })">
|
|
175
181
|
<slot name="next">
|
|
176
|
-
<UButton :color="color" :variant="variant" :size="size" :icon="nextIcon" :to="page < pageCount ? to?.(
|
|
182
|
+
<UButton :color="color" :variant="variant" :size="size" :icon="nextIcon" :to="page < pageCount ? to?.(page + 1) : undefined" />
|
|
177
183
|
</slot>
|
|
178
184
|
</PaginationNext>
|
|
179
|
-
<PaginationLast v-if="showControls || !!slots.last" as-child>
|
|
185
|
+
<PaginationLast v-if="showControls || !!slots.last" as-child :class="ui.last({ class: props.ui?.last })">
|
|
180
186
|
<slot name="last">
|
|
181
|
-
<UButton :color="color" :variant="variant" :size="size" :icon="lastIcon" :to="
|
|
187
|
+
<UButton :color="color" :variant="variant" :size="size" :icon="lastIcon" :to="to?.(pageCount)" />
|
|
182
188
|
</slot>
|
|
183
189
|
</PaginationLast>
|
|
184
190
|
</PaginationList>
|
|
@@ -19,9 +19,22 @@ export interface PinInputProps extends Pick<PinInputRootProps, 'defaultValue' |
|
|
|
19
19
|
* @defaultValue 'div'
|
|
20
20
|
*/
|
|
21
21
|
as?: any
|
|
22
|
+
/**
|
|
23
|
+
* @defaultValue 'primary'
|
|
24
|
+
*/
|
|
22
25
|
color?: PinInputVariants['color']
|
|
26
|
+
/**
|
|
27
|
+
* @defaultValue 'outline'
|
|
28
|
+
*/
|
|
23
29
|
variant?: PinInputVariants['variant']
|
|
30
|
+
/**
|
|
31
|
+
* @defaultValue 'md'
|
|
32
|
+
*/
|
|
24
33
|
size?: PinInputVariants['size']
|
|
34
|
+
/**
|
|
35
|
+
* The number of input fields.
|
|
36
|
+
* @defaultValue 5
|
|
37
|
+
*/
|
|
25
38
|
length?: number | string
|
|
26
39
|
highlight?: boolean
|
|
27
40
|
class?: any
|
|
@@ -25,13 +25,23 @@ export interface ProgressProps extends Pick<ProgressRootProps, 'getValueLabel' |
|
|
|
25
25
|
status?: boolean
|
|
26
26
|
/** Whether the progress is visually inverted. */
|
|
27
27
|
inverted?: boolean
|
|
28
|
+
/**
|
|
29
|
+
* @defaultValue 'md'
|
|
30
|
+
*/
|
|
28
31
|
size?: ProgressVariants['size']
|
|
32
|
+
/**
|
|
33
|
+
* @defaultValue 'primary'
|
|
34
|
+
*/
|
|
29
35
|
color?: ProgressVariants['color']
|
|
30
36
|
/**
|
|
31
37
|
* The orientation of the progress bar.
|
|
32
38
|
* @defaultValue 'horizontal'
|
|
33
39
|
*/
|
|
34
40
|
orientation?: ProgressVariants['orientation']
|
|
41
|
+
/**
|
|
42
|
+
* The animation of the progress bar.
|
|
43
|
+
* @defaultValue 'carousel'
|
|
44
|
+
*/
|
|
35
45
|
animation?: ProgressVariants['animation']
|
|
36
46
|
class?: any
|
|
37
47
|
ui?: Partial<typeof progress.slots>
|
|
@@ -42,7 +42,13 @@ export interface RadioGroupProps<T> extends Pick<RadioGroupRootProps, 'defaultVa
|
|
|
42
42
|
*/
|
|
43
43
|
descriptionKey?: string
|
|
44
44
|
items?: T[]
|
|
45
|
+
/**
|
|
46
|
+
* @defaultValue 'md'
|
|
47
|
+
*/
|
|
45
48
|
size?: RadioGroupVariants['size']
|
|
49
|
+
/**
|
|
50
|
+
* @defaultValue 'primary'
|
|
51
|
+
*/
|
|
46
52
|
color?: RadioGroupVariants['color']
|
|
47
53
|
/**
|
|
48
54
|
* The orientation the radio buttons are laid out.
|
|
@@ -15,6 +15,9 @@ const select = tv({ extend: tv(theme), ...(appConfigSelect.ui?.select || {}) })
|
|
|
15
15
|
|
|
16
16
|
export interface SelectItem {
|
|
17
17
|
label?: string
|
|
18
|
+
/**
|
|
19
|
+
* @IconifyIcon
|
|
20
|
+
*/
|
|
18
21
|
icon?: string
|
|
19
22
|
avatar?: AvatarProps
|
|
20
23
|
chip?: ChipProps
|
|
@@ -33,17 +36,28 @@ export interface SelectProps<T extends MaybeArrayOfArrayItem<I>, I extends Maybe
|
|
|
33
36
|
id?: string
|
|
34
37
|
/** The placeholder text when the select is empty. */
|
|
35
38
|
placeholder?: string
|
|
39
|
+
/**
|
|
40
|
+
* @defaultValue 'primary'
|
|
41
|
+
*/
|
|
36
42
|
color?: SelectVariants['color']
|
|
43
|
+
/**
|
|
44
|
+
* @defaultValue 'outline'
|
|
45
|
+
*/
|
|
37
46
|
variant?: SelectVariants['variant']
|
|
47
|
+
/**
|
|
48
|
+
* @defaultValue 'md'
|
|
49
|
+
*/
|
|
38
50
|
size?: SelectVariants['size']
|
|
39
51
|
/**
|
|
40
52
|
* The icon displayed to open the menu.
|
|
41
53
|
* @defaultValue appConfig.ui.icons.chevronDown
|
|
54
|
+
* @IconifyIcon
|
|
42
55
|
*/
|
|
43
56
|
trailingIcon?: string
|
|
44
57
|
/**
|
|
45
58
|
* The icon displayed when an item is selected.
|
|
46
59
|
* @defaultValue appConfig.ui.icons.check
|
|
60
|
+
* @IconifyIcon
|
|
47
61
|
*/
|
|
48
62
|
selectedIcon?: string
|
|
49
63
|
/**
|
|
@@ -15,6 +15,9 @@ const selectMenu = tv({ extend: tv(theme), ...(appConfigSelectMenu.ui?.selectMen
|
|
|
15
15
|
|
|
16
16
|
export interface SelectMenuItem {
|
|
17
17
|
label?: string
|
|
18
|
+
/**
|
|
19
|
+
* @IconifyIcon
|
|
20
|
+
*/
|
|
18
21
|
icon?: string
|
|
19
22
|
avatar?: AvatarProps
|
|
20
23
|
chip?: ChipProps
|
|
@@ -40,18 +43,29 @@ export interface SelectMenuProps<T extends MaybeArrayOfArrayItem<I>, I extends M
|
|
|
40
43
|
* @defaultValue true
|
|
41
44
|
*/
|
|
42
45
|
searchInput?: boolean | InputProps
|
|
46
|
+
/**
|
|
47
|
+
* @defaultValue 'primary'
|
|
48
|
+
*/
|
|
43
49
|
color?: SelectMenuVariants['color']
|
|
50
|
+
/**
|
|
51
|
+
* @defaultValue 'outline'
|
|
52
|
+
*/
|
|
44
53
|
variant?: SelectMenuVariants['variant']
|
|
54
|
+
/**
|
|
55
|
+
* @defaultValue 'md'
|
|
56
|
+
*/
|
|
45
57
|
size?: SelectMenuVariants['size']
|
|
46
58
|
required?: boolean
|
|
47
59
|
/**
|
|
48
60
|
* The icon displayed to open the menu.
|
|
49
61
|
* @defaultValue appConfig.ui.icons.chevronDown
|
|
62
|
+
* @IconifyIcon
|
|
50
63
|
*/
|
|
51
64
|
trailingIcon?: string
|
|
52
65
|
/**
|
|
53
66
|
* The icon displayed when an item is selected.
|
|
54
67
|
* @defaultValue appConfig.ui.icons.check
|
|
68
|
+
* @IconifyIcon
|
|
55
69
|
*/
|
|
56
70
|
selectedIcon?: string
|
|
57
71
|
/**
|
|
@@ -62,6 +76,7 @@ export interface SelectMenuProps<T extends MaybeArrayOfArrayItem<I>, I extends M
|
|
|
62
76
|
/**
|
|
63
77
|
* Display an arrow alongside the menu.
|
|
64
78
|
* @defaultValue false
|
|
79
|
+
* @IconifyIcon
|
|
65
80
|
*/
|
|
66
81
|
arrow?: boolean | Omit<ComboboxArrowProps, 'as' | 'asChild'>
|
|
67
82
|
/**
|
|
@@ -162,7 +177,7 @@ const { t } = useLocale()
|
|
|
162
177
|
const appConfig = useAppConfig()
|
|
163
178
|
const { contains } = useFilter({ sensitivity: 'base' })
|
|
164
179
|
|
|
165
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, 'modelValue', 'defaultValue', 'open', 'defaultOpen', 'multiple', 'resetSearchTermOnBlur', 'highlightOnHover'), emits)
|
|
180
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'modelValue', 'defaultValue', 'open', 'defaultOpen', 'required', 'multiple', 'resetSearchTermOnBlur', 'highlightOnHover'), emits)
|
|
166
181
|
const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }) as ComboboxContentProps)
|
|
167
182
|
const arrowProps = toRef(() => props.arrow as ComboboxArrowProps)
|
|
168
183
|
const searchInputProps = toRef(() => defu(props.searchInput, { placeholder: t('selectMenu.search'), variant: 'none' }) as InputProps)
|
|
@@ -21,12 +21,24 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
|
|
|
21
21
|
as?: any
|
|
22
22
|
/** Display a label in the middle. */
|
|
23
23
|
label?: string
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Display an icon in the middle.
|
|
26
|
+
* @IconifyIcon
|
|
27
|
+
*/
|
|
25
28
|
icon?: string
|
|
26
29
|
/** Display an avatar in the middle. */
|
|
27
30
|
avatar?: AvatarProps
|
|
31
|
+
/**
|
|
32
|
+
* @defaultValue 'neutral'
|
|
33
|
+
*/
|
|
28
34
|
color?: SeparatorVariants['color']
|
|
35
|
+
/**
|
|
36
|
+
* @defaultValue 'xs'
|
|
37
|
+
*/
|
|
29
38
|
size?: SeparatorVariants['size']
|
|
39
|
+
/**
|
|
40
|
+
* @defaultValue 'solid'
|
|
41
|
+
*/
|
|
30
42
|
type?: SeparatorVariants['type']
|
|
31
43
|
/**
|
|
32
44
|
* The orientation of the separator.
|
|
@@ -28,6 +28,10 @@ export interface SlideoverProps extends DialogRootProps {
|
|
|
28
28
|
* @defaultValue true
|
|
29
29
|
*/
|
|
30
30
|
transition?: boolean
|
|
31
|
+
/**
|
|
32
|
+
* The side of the slideover.
|
|
33
|
+
* @defaultValue 'right'
|
|
34
|
+
*/
|
|
31
35
|
side?: SlideoverVariants['side']
|
|
32
36
|
/**
|
|
33
37
|
* Render the slideover in a portal.
|
|
@@ -43,6 +47,7 @@ export interface SlideoverProps extends DialogRootProps {
|
|
|
43
47
|
/**
|
|
44
48
|
* The icon displayed in the close button.
|
|
45
49
|
* @defaultValue appConfig.ui.icons.close
|
|
50
|
+
* @IconifyIcon
|
|
46
51
|
*/
|
|
47
52
|
closeIcon?: string
|
|
48
53
|
/**
|
|
@@ -18,7 +18,13 @@ export interface SliderProps extends Pick<SliderRootProps, 'name' | 'disabled' |
|
|
|
18
18
|
* @defaultValue 'div'
|
|
19
19
|
*/
|
|
20
20
|
as?: any
|
|
21
|
+
/**
|
|
22
|
+
* @defaultValue 'md'
|
|
23
|
+
*/
|
|
21
24
|
size?: SliderVariants['size']
|
|
25
|
+
/**
|
|
26
|
+
* @defaultValue 'primary'
|
|
27
|
+
*/
|
|
22
28
|
color?: SliderVariants['color']
|
|
23
29
|
/**
|
|
24
30
|
* The orientation of the slider.
|
|
@@ -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.
|