@nuxt/ui 3.1.1 → 3.1.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/alert.ts +0 -5
- package/.nuxt/ui/badge.ts +30 -7
- package/.nuxt/ui/button-group.ts +0 -13
- package/.nuxt/ui/button.ts +2 -7
- package/.nuxt/ui/calendar.ts +1 -1
- package/.nuxt/ui/carousel.ts +0 -5
- package/.nuxt/ui/checkbox-group.ts +144 -1
- package/.nuxt/ui/color-picker.ts +2 -2
- package/.nuxt/ui/context-menu.ts +2 -1
- package/.nuxt/ui/dropdown-menu.ts +2 -1
- package/.nuxt/ui/input-menu.ts +4 -13
- package/.nuxt/ui/input-number.ts +10 -0
- package/.nuxt/ui/input.ts +2 -11
- package/.nuxt/ui/link.ts +12 -5
- package/.nuxt/ui/navigation-menu.ts +43 -34
- package/.nuxt/ui/radio-group.ts +1 -1
- package/.nuxt/ui/select-menu.ts +4 -13
- package/.nuxt/ui/select.ts +4 -13
- package/.nuxt/ui/tabs.ts +4 -3
- package/.nuxt/ui/textarea.ts +2 -11
- package/.nuxt/ui/toast.ts +0 -5
- package/.nuxt/ui/tooltip.ts +1 -1
- package/.nuxt/ui.css +4 -1
- package/cli/templates.mjs +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +14 -5
- package/dist/runtime/components/Accordion.vue +9 -9
- package/dist/runtime/components/Accordion.vue.d.ts +2 -0
- package/dist/runtime/components/Alert.vue +1 -1
- package/dist/runtime/components/Avatar.vue +2 -2
- package/dist/runtime/components/AvatarGroup.vue +1 -1
- package/dist/runtime/components/Badge.vue +5 -3
- package/dist/runtime/components/Badge.vue.d.ts +2 -0
- package/dist/runtime/components/Breadcrumb.vue +8 -8
- package/dist/runtime/components/Breadcrumb.vue.d.ts +2 -0
- package/dist/runtime/components/Button.vue +2 -3
- package/dist/runtime/components/Button.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.vue +2 -1
- package/dist/runtime/components/Card.vue +1 -1
- package/dist/runtime/components/Carousel.vue +5 -2
- package/dist/runtime/components/Carousel.vue.d.ts +6 -1
- package/dist/runtime/components/Checkbox.vue +2 -2
- package/dist/runtime/components/CheckboxGroup.vue +8 -5
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +7 -1
- package/dist/runtime/components/Chip.vue +1 -1
- package/dist/runtime/components/Collapsible.vue +1 -1
- package/dist/runtime/components/ColorPicker.vue +1 -1
- package/dist/runtime/components/CommandPalette.vue +18 -18
- package/dist/runtime/components/CommandPalette.vue.d.ts +2 -0
- package/dist/runtime/components/ContextMenu.vue.d.ts +2 -0
- package/dist/runtime/components/ContextMenuContent.vue +69 -67
- package/dist/runtime/components/Drawer.vue +15 -1
- package/dist/runtime/components/DropdownMenu.vue.d.ts +2 -0
- package/dist/runtime/components/DropdownMenuContent.vue +71 -69
- package/dist/runtime/components/FormField.vue +5 -5
- package/dist/runtime/components/Input.vue +3 -2
- package/dist/runtime/components/Input.vue.d.ts +30 -29
- package/dist/runtime/components/InputMenu.vue +20 -20
- package/dist/runtime/components/InputMenu.vue.d.ts +210 -0
- package/dist/runtime/components/InputNumber.vue +13 -7
- package/dist/runtime/components/InputNumber.vue.d.ts +78 -0
- package/dist/runtime/components/Link.vue +5 -14
- package/dist/runtime/components/Modal.vue +2 -2
- package/dist/runtime/components/Modal.vue.d.ts +3 -0
- package/dist/runtime/components/NavigationMenu.vue +106 -41
- package/dist/runtime/components/NavigationMenu.vue.d.ts +38 -7
- package/dist/runtime/components/Pagination.vue +1 -1
- package/dist/runtime/components/PinInput.vue +1 -1
- package/dist/runtime/components/Popover.vue +4 -0
- package/dist/runtime/components/Popover.vue.d.ts +1 -0
- package/dist/runtime/components/Progress.vue +1 -1
- package/dist/runtime/components/RadioGroup.vue +8 -8
- package/dist/runtime/components/RadioGroup.vue.d.ts +2 -0
- package/dist/runtime/components/Select.vue +15 -15
- package/dist/runtime/components/Select.vue.d.ts +3 -1
- package/dist/runtime/components/SelectMenu.vue +16 -16
- package/dist/runtime/components/SelectMenu.vue.d.ts +2 -0
- package/dist/runtime/components/Separator.vue +1 -1
- package/dist/runtime/components/Slideover.vue +9 -2
- package/dist/runtime/components/Slideover.vue.d.ts +3 -0
- package/dist/runtime/components/Slider.vue +16 -4
- package/dist/runtime/components/Slider.vue.d.ts +26 -20
- package/dist/runtime/components/Stepper.vue +10 -10
- package/dist/runtime/components/Stepper.vue.d.ts +2 -0
- package/dist/runtime/components/Switch.vue +1 -1
- package/dist/runtime/components/Table.vue +2 -2
- package/dist/runtime/components/Tabs.vue +6 -6
- package/dist/runtime/components/Tabs.vue.d.ts +2 -0
- package/dist/runtime/components/Textarea.vue +7 -4
- package/dist/runtime/components/Textarea.vue.d.ts +30 -31
- package/dist/runtime/components/Toast.vue +3 -2
- package/dist/runtime/components/Toast.vue.d.ts +6 -0
- package/dist/runtime/components/Toaster.vue +4 -4
- package/dist/runtime/components/Toaster.vue.d.ts +6 -0
- package/dist/runtime/components/Tree.vue +10 -10
- package/dist/runtime/components/Tree.vue.d.ts +2 -0
- package/dist/runtime/composables/useFormField.d.ts +1 -1
- package/dist/runtime/composables/useFormField.js +2 -1
- package/dist/runtime/inertia/components/Link.vue +46 -60
- package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
- package/dist/runtime/inertia/components/LinkBase.vue +68 -0
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
- package/dist/runtime/inertia/stubs.d.ts +1 -1
- package/dist/runtime/inertia/stubs.js +1 -1
- package/dist/runtime/locale/index.d.ts +7 -2
- package/dist/runtime/locale/index.js +7 -2
- package/dist/runtime/locale/ky.d.ts +3 -0
- package/dist/runtime/locale/ky.js +54 -0
- package/dist/runtime/locale/lt.d.ts +3 -0
- package/dist/runtime/locale/lt.js +54 -0
- package/dist/runtime/locale/mn.d.ts +3 -0
- package/dist/runtime/locale/mn.js +54 -0
- package/dist/runtime/locale/ms.d.ts +3 -0
- package/dist/runtime/locale/ms.js +54 -0
- package/dist/runtime/locale/sl.d.ts +3 -0
- package/dist/runtime/locale/sl.js +54 -0
- package/dist/runtime/utils/link.d.ts +1 -0
- package/dist/runtime/utils/link.js +12 -0
- package/dist/runtime/vue/components/Link.vue +27 -40
- package/dist/runtime/vue/composables/useAppConfig.js +3 -1
- package/dist/runtime/vue/stubs.d.ts +1 -1
- package/dist/runtime/vue/stubs.js +1 -1
- package/dist/shared/{ui.CbtTMMzt.mjs → ui.Bix4DSU4.mjs} +153 -52
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +28 -28
|
@@ -4,7 +4,7 @@ import theme from "#build/ui/select";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
|
-
import { SelectRoot, SelectArrow, SelectTrigger, SelectPortal, SelectContent,
|
|
7
|
+
import { SelectRoot, SelectArrow, SelectTrigger, SelectPortal, SelectContent, SelectLabel, SelectGroup, SelectItem, SelectItemIndicator, SelectItemText, SelectSeparator, useForwardPropsEmits } from "reka-ui";
|
|
8
8
|
import { defu } from "defu";
|
|
9
9
|
import { reactivePick } from "@vueuse/core";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
@@ -118,7 +118,7 @@ function isSelectItem(item) {
|
|
|
118
118
|
@update:model-value="onUpdate"
|
|
119
119
|
@update:open="onUpdateOpen"
|
|
120
120
|
>
|
|
121
|
-
<SelectTrigger :id="id" :class="ui.base({ class: [props.
|
|
121
|
+
<SelectTrigger :id="id" :class="ui.base({ class: [props.ui?.base, props.class] })" v-bind="{ ...$attrs, ...ariaAttrs }">
|
|
122
122
|
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
123
123
|
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
124
124
|
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
@@ -132,7 +132,7 @@ function isSelectItem(item) {
|
|
|
132
132
|
{{ displayedModelValue }}
|
|
133
133
|
</span>
|
|
134
134
|
<span v-else :class="ui.placeholder({ class: props.ui?.placeholder })">
|
|
135
|
-
{{ placeholder ??
|
|
135
|
+
{{ placeholder ?? "\xA0" }}
|
|
136
136
|
</span>
|
|
137
137
|
</template>
|
|
138
138
|
</slot>
|
|
@@ -148,54 +148,54 @@ function isSelectItem(item) {
|
|
|
148
148
|
<SelectContent :class="ui.content({ class: props.ui?.content })" v-bind="contentProps">
|
|
149
149
|
<slot name="content-top" />
|
|
150
150
|
|
|
151
|
-
<
|
|
151
|
+
<div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
152
152
|
<SelectGroup v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
|
|
153
153
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
154
|
-
<SelectLabel v-if="isSelectItem(item) && item.type === 'label'" :class="ui.label({ class: props.ui?.label })">
|
|
154
|
+
<SelectLabel v-if="isSelectItem(item) && item.type === 'label'" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
|
|
155
155
|
{{ get(item, props.labelKey) }}
|
|
156
156
|
</SelectLabel>
|
|
157
157
|
|
|
158
|
-
<SelectSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" :class="ui.separator({ class: props.ui?.separator })" />
|
|
158
|
+
<SelectSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator, item.class] })" />
|
|
159
159
|
|
|
160
160
|
<SelectItem
|
|
161
161
|
v-else
|
|
162
|
-
:class="ui.item({ class: props.ui?.item })"
|
|
162
|
+
:class="ui.item({ class: [props.ui?.item, isSelectItem(item) && item.ui?.item, isSelectItem(item) && item.class] })"
|
|
163
163
|
:disabled="isSelectItem(item) && item.disabled"
|
|
164
164
|
:value="isSelectItem(item) ? get(item, props.valueKey) : item"
|
|
165
165
|
@select="isSelectItem(item) && item.onSelect?.($event)"
|
|
166
166
|
>
|
|
167
167
|
<slot name="item" :item="item" :index="index">
|
|
168
168
|
<slot name="item-leading" :item="item" :index="index">
|
|
169
|
-
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: props.ui?.itemLeadingIcon })" />
|
|
170
|
-
<UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: props.ui?.itemLeadingAvatar })" />
|
|
169
|
+
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon] })" />
|
|
170
|
+
<UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [props.ui?.itemLeadingAvatar, item.ui?.itemLeadingAvatar] })" />
|
|
171
171
|
<UChip
|
|
172
172
|
v-else-if="isSelectItem(item) && item.chip"
|
|
173
|
-
:size="props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
173
|
+
:size="item.ui?.itemLeadingChipSize || props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
174
174
|
inset
|
|
175
175
|
standalone
|
|
176
176
|
v-bind="item.chip"
|
|
177
|
-
:class="ui.itemLeadingChip({ class: props.ui?.itemLeadingChip })"
|
|
177
|
+
:class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip] })"
|
|
178
178
|
/>
|
|
179
179
|
</slot>
|
|
180
180
|
|
|
181
|
-
<SelectItemText :class="ui.itemLabel({ class: props.ui?.itemLabel })">
|
|
181
|
+
<SelectItemText :class="ui.itemLabel({ class: [props.ui?.itemLabel, isSelectItem(item) && item.ui?.itemLabel] })">
|
|
182
182
|
<slot name="item-label" :item="item" :index="index">
|
|
183
183
|
{{ isSelectItem(item) ? get(item, props.labelKey) : item }}
|
|
184
184
|
</slot>
|
|
185
185
|
</SelectItemText>
|
|
186
186
|
|
|
187
|
-
<span :class="ui.itemTrailing({ class: props.ui?.itemTrailing })">
|
|
187
|
+
<span :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, isSelectItem(item) && item.ui?.itemTrailing] })">
|
|
188
188
|
<slot name="item-trailing" :item="item" :index="index" />
|
|
189
189
|
|
|
190
190
|
<SelectItemIndicator as-child>
|
|
191
|
-
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: props.ui?.itemTrailingIcon })" />
|
|
191
|
+
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, isSelectItem(item) && item.ui?.itemTrailingIcon] })" />
|
|
192
192
|
</SelectItemIndicator>
|
|
193
193
|
</span>
|
|
194
194
|
</slot>
|
|
195
195
|
</SelectItem>
|
|
196
196
|
</template>
|
|
197
197
|
</SelectGroup>
|
|
198
|
-
</
|
|
198
|
+
</div>
|
|
199
199
|
|
|
200
200
|
<slot name="content-bottom" />
|
|
201
201
|
|
|
@@ -18,9 +18,11 @@ interface SelectItemBase {
|
|
|
18
18
|
* @defaultValue 'item'
|
|
19
19
|
*/
|
|
20
20
|
type?: 'label' | 'separator' | 'item';
|
|
21
|
-
value?:
|
|
21
|
+
value?: AcceptableValue | boolean;
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
onSelect?(e?: Event): void;
|
|
24
|
+
class?: any;
|
|
25
|
+
ui?: Pick<Select['slots'], 'label' | 'separator' | 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChipSize' | 'itemLeadingChip' | 'itemLabel' | 'itemTrailing' | 'itemTrailingIcon'>;
|
|
24
26
|
[key: string]: any;
|
|
25
27
|
}
|
|
26
28
|
export type SelectItem = SelectItemBase | AcceptableValue | boolean;
|
|
@@ -4,7 +4,7 @@ import theme from "#build/ui/select-menu";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef, toRaw } from "vue";
|
|
7
|
-
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent,
|
|
7
|
+
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, FocusScope, useForwardPropsEmits, useFilter } from "reka-ui";
|
|
8
8
|
import { defu } from "defu";
|
|
9
9
|
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
@@ -185,7 +185,7 @@ function isSelectItem(item) {
|
|
|
185
185
|
>
|
|
186
186
|
<span :class="ui.itemLabel({ class: props.ui?.itemLabel })">
|
|
187
187
|
<slot name="create-item-label" :item="searchTerm">
|
|
188
|
-
{{ t(
|
|
188
|
+
{{ t("selectMenu.create", { label: searchTerm }) }}
|
|
189
189
|
</slot>
|
|
190
190
|
</span>
|
|
191
191
|
</ComboboxItem>
|
|
@@ -204,7 +204,7 @@ function isSelectItem(item) {
|
|
|
204
204
|
@update:open="onUpdateOpen"
|
|
205
205
|
>
|
|
206
206
|
<ComboboxAnchor as-child>
|
|
207
|
-
<ComboboxTrigger :class="ui.base({ class: [props.
|
|
207
|
+
<ComboboxTrigger :class="ui.base({ class: [props.ui?.base, props.class] })" tabindex="0">
|
|
208
208
|
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
209
209
|
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
210
210
|
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
@@ -218,7 +218,7 @@ function isSelectItem(item) {
|
|
|
218
218
|
{{ displayedModelValue }}
|
|
219
219
|
</span>
|
|
220
220
|
<span v-else :class="ui.placeholder({ class: props.ui?.placeholder })">
|
|
221
|
-
{{ placeholder ??
|
|
221
|
+
{{ placeholder ?? "\xA0" }}
|
|
222
222
|
</span>
|
|
223
223
|
</template>
|
|
224
224
|
</slot>
|
|
@@ -242,53 +242,53 @@ function isSelectItem(item) {
|
|
|
242
242
|
|
|
243
243
|
<ComboboxEmpty :class="ui.empty({ class: props.ui?.empty })">
|
|
244
244
|
<slot name="empty" :search-term="searchTerm">
|
|
245
|
-
{{ searchTerm ? t(
|
|
245
|
+
{{ searchTerm ? t("selectMenu.noMatch", { searchTerm }) : t("selectMenu.noData") }}
|
|
246
246
|
</slot>
|
|
247
247
|
</ComboboxEmpty>
|
|
248
248
|
|
|
249
|
-
<
|
|
249
|
+
<div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
250
250
|
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'top'" />
|
|
251
251
|
|
|
252
252
|
<ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
|
|
253
253
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
254
|
-
<ComboboxLabel v-if="isSelectItem(item) && item.type === 'label'" :class="ui.label({ class: props.ui?.label })">
|
|
254
|
+
<ComboboxLabel v-if="isSelectItem(item) && item.type === 'label'" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
|
|
255
255
|
{{ get(item, props.labelKey) }}
|
|
256
256
|
</ComboboxLabel>
|
|
257
257
|
|
|
258
|
-
<ComboboxSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" :class="ui.separator({ class: props.ui?.separator })" />
|
|
258
|
+
<ComboboxSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator, item.class] })" />
|
|
259
259
|
|
|
260
260
|
<ComboboxItem
|
|
261
261
|
v-else
|
|
262
|
-
:class="ui.item({ class: props.ui?.item })"
|
|
262
|
+
:class="ui.item({ class: [props.ui?.item, isSelectItem(item) && item.ui?.item, isSelectItem(item) && item.class] })"
|
|
263
263
|
:disabled="isSelectItem(item) && item.disabled"
|
|
264
264
|
:value="props.valueKey && isSelectItem(item) ? get(item, props.valueKey) : item"
|
|
265
265
|
@select="onSelect($event, item)"
|
|
266
266
|
>
|
|
267
267
|
<slot name="item" :item="item" :index="index">
|
|
268
268
|
<slot name="item-leading" :item="item" :index="index">
|
|
269
|
-
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: props.ui?.itemLeadingIcon })" />
|
|
270
|
-
<UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: props.ui?.itemLeadingAvatar })" />
|
|
269
|
+
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon] })" />
|
|
270
|
+
<UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [props.ui?.itemLeadingAvatar, item.ui?.itemLeadingAvatar] })" />
|
|
271
271
|
<UChip
|
|
272
272
|
v-else-if="isSelectItem(item) && item.chip"
|
|
273
273
|
:size="props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
274
274
|
inset
|
|
275
275
|
standalone
|
|
276
276
|
v-bind="item.chip"
|
|
277
|
-
:class="ui.itemLeadingChip({ class: props.ui?.itemLeadingChip })"
|
|
277
|
+
:class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip] })"
|
|
278
278
|
/>
|
|
279
279
|
</slot>
|
|
280
280
|
|
|
281
|
-
<span :class="ui.itemLabel({ class: props.ui?.itemLabel })">
|
|
281
|
+
<span :class="ui.itemLabel({ class: [props.ui?.itemLabel, isSelectItem(item) && item.ui?.itemLabel] })">
|
|
282
282
|
<slot name="item-label" :item="item" :index="index">
|
|
283
283
|
{{ isSelectItem(item) ? get(item, props.labelKey) : item }}
|
|
284
284
|
</slot>
|
|
285
285
|
</span>
|
|
286
286
|
|
|
287
|
-
<span :class="ui.itemTrailing({ class: props.ui?.itemTrailing })">
|
|
287
|
+
<span :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, isSelectItem(item) && item.ui?.itemTrailing] })">
|
|
288
288
|
<slot name="item-trailing" :item="item" :index="index" />
|
|
289
289
|
|
|
290
290
|
<ComboboxItemIndicator as-child>
|
|
291
|
-
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: props.ui?.itemTrailingIcon })" />
|
|
291
|
+
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, isSelectItem(item) && item.ui?.itemTrailingIcon] })" />
|
|
292
292
|
</ComboboxItemIndicator>
|
|
293
293
|
</span>
|
|
294
294
|
</slot>
|
|
@@ -297,7 +297,7 @@ function isSelectItem(item) {
|
|
|
297
297
|
</ComboboxGroup>
|
|
298
298
|
|
|
299
299
|
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'bottom'" />
|
|
300
|
-
</
|
|
300
|
+
</div>
|
|
301
301
|
|
|
302
302
|
<slot name="content-bottom" />
|
|
303
303
|
</FocusScope>
|
|
@@ -20,6 +20,8 @@ interface _SelectMenuItem {
|
|
|
20
20
|
type?: 'label' | 'separator' | 'item';
|
|
21
21
|
disabled?: boolean;
|
|
22
22
|
onSelect?(e?: Event): void;
|
|
23
|
+
class?: any;
|
|
24
|
+
ui?: Pick<SelectMenu['slots'], 'label' | 'separator' | 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChipSize' | 'itemLeadingChip' | 'itemLabel' | 'itemTrailing' | 'itemTrailingIcon'>;
|
|
23
25
|
[key: string]: any;
|
|
24
26
|
}
|
|
25
27
|
export type SelectMenuItem = _SelectMenuItem | AcceptableValue | boolean;
|
|
@@ -35,7 +35,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.separator ||
|
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
37
|
<template>
|
|
38
|
-
<Separator v-bind="rootProps" :class="ui.root({ class: [props.
|
|
38
|
+
<Separator v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
39
39
|
<div :class="ui.border({ class: props.ui?.border })" />
|
|
40
40
|
|
|
41
41
|
<template v-if="label || icon || avatar || !!slots.default">
|
|
@@ -28,7 +28,7 @@ const props = defineProps({
|
|
|
28
28
|
defaultOpen: { type: Boolean, required: false },
|
|
29
29
|
modal: { type: Boolean, required: false, default: true }
|
|
30
30
|
});
|
|
31
|
-
const emits = defineEmits(["after:leave", "close:prevent", "update:open"]);
|
|
31
|
+
const emits = defineEmits(["after:leave", "after:enter", "close:prevent", "update:open"]);
|
|
32
32
|
const slots = defineSlots();
|
|
33
33
|
const { t } = useLocale();
|
|
34
34
|
const appConfig = useAppConfig();
|
|
@@ -66,7 +66,14 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.slideover ||
|
|
|
66
66
|
<DialogPortal v-bind="portalProps">
|
|
67
67
|
<DialogOverlay v-if="overlay" :class="ui.overlay({ class: props.ui?.overlay })" />
|
|
68
68
|
|
|
69
|
-
<DialogContent
|
|
69
|
+
<DialogContent
|
|
70
|
+
:data-side="side"
|
|
71
|
+
:class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })"
|
|
72
|
+
v-bind="contentProps"
|
|
73
|
+
@after-enter="emits('after:enter')"
|
|
74
|
+
@after-leave="emits('after:leave')"
|
|
75
|
+
v-on="contentEvents"
|
|
76
|
+
>
|
|
70
77
|
<VisuallyHidden v-if="!!slots.content && (title || !!slots.title || (description || !!slots.description))">
|
|
71
78
|
<DialogTitle v-if="title || !!slots.title">
|
|
72
79
|
<slot name="title">
|
|
@@ -51,6 +51,7 @@ export interface SlideoverProps extends DialogRootProps {
|
|
|
51
51
|
}
|
|
52
52
|
export interface SlideoverEmits extends DialogRootEmits {
|
|
53
53
|
'after:leave': [];
|
|
54
|
+
'after:enter': [];
|
|
54
55
|
'close:prevent': [];
|
|
55
56
|
}
|
|
56
57
|
export interface SlideoverSlots {
|
|
@@ -72,10 +73,12 @@ export interface SlideoverSlots {
|
|
|
72
73
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
73
74
|
"update:open": (value: boolean) => any;
|
|
74
75
|
"after:leave": () => any;
|
|
76
|
+
"after:enter": () => any;
|
|
75
77
|
"close:prevent": () => any;
|
|
76
78
|
}, string, import("vue").PublicProps, Readonly<SlideoverProps> & Readonly<{
|
|
77
79
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
78
80
|
"onAfter:leave"?: (() => any) | undefined;
|
|
81
|
+
"onAfter:enter"?: (() => any) | undefined;
|
|
79
82
|
"onClose:prevent"?: (() => any) | undefined;
|
|
80
83
|
}>, {
|
|
81
84
|
close: boolean | Partial<ButtonProps>;
|
|
@@ -9,11 +9,13 @@ import { reactivePick } from "@vueuse/core";
|
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useFormField } from "../composables/useFormField";
|
|
11
11
|
import { tv } from "../utils/tv";
|
|
12
|
+
import UTooltip from "./Tooltip.vue";
|
|
12
13
|
const props = defineProps({
|
|
13
14
|
as: { type: null, required: false },
|
|
14
15
|
size: { type: null, required: false },
|
|
15
16
|
color: { type: null, required: false },
|
|
16
17
|
orientation: { type: null, required: false, default: "horizontal" },
|
|
18
|
+
tooltip: { type: [Boolean, Object], required: false },
|
|
17
19
|
defaultValue: { type: [Number, Array], required: false },
|
|
18
20
|
class: { type: null, required: false },
|
|
19
21
|
ui: { type: null, required: false },
|
|
@@ -26,7 +28,7 @@ const props = defineProps({
|
|
|
26
28
|
minStepsBetweenThumbs: { type: Number, required: false }
|
|
27
29
|
});
|
|
28
30
|
const emits = defineEmits(["update:modelValue", "change"]);
|
|
29
|
-
const modelValue = defineModel({ type:
|
|
31
|
+
const modelValue = defineModel({ type: null });
|
|
30
32
|
const appConfig = useAppConfig();
|
|
31
33
|
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "orientation", "min", "max", "step", "minStepsBetweenThumbs", "inverted"), emits);
|
|
32
34
|
const { id, emitFormChange, emitFormInput, size, color, name, disabled, ariaAttrs } = useFormField(props);
|
|
@@ -47,7 +49,7 @@ const sliderValue = computed({
|
|
|
47
49
|
modelValue.value = value?.length !== 1 ? value : value[0];
|
|
48
50
|
}
|
|
49
51
|
});
|
|
50
|
-
const
|
|
52
|
+
const thumbs = computed(() => sliderValue.value?.length ?? 1);
|
|
51
53
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.slider || {} })({
|
|
52
54
|
disabled: disabled.value,
|
|
53
55
|
size: size.value,
|
|
@@ -68,7 +70,7 @@ function onChange(value) {
|
|
|
68
70
|
v-model="sliderValue"
|
|
69
71
|
:name="name"
|
|
70
72
|
:disabled="disabled"
|
|
71
|
-
:class="ui.root({ class: [props.
|
|
73
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
72
74
|
:default-value="defaultSliderValue"
|
|
73
75
|
@update:model-value="emitFormInput()"
|
|
74
76
|
@value-commit="onChange"
|
|
@@ -77,6 +79,16 @@ function onChange(value) {
|
|
|
77
79
|
<SliderRange :class="ui.range({ class: props.ui?.range })" />
|
|
78
80
|
</SliderTrack>
|
|
79
81
|
|
|
80
|
-
<
|
|
82
|
+
<template v-for="thumb in thumbs" :key="thumb">
|
|
83
|
+
<UTooltip
|
|
84
|
+
v-if="!!tooltip"
|
|
85
|
+
:text="thumbs > 1 ? String(sliderValue?.[thumb - 1]) : String(sliderValue)"
|
|
86
|
+
disable-closing-trigger
|
|
87
|
+
v-bind="typeof tooltip === 'object' ? tooltip : {}"
|
|
88
|
+
>
|
|
89
|
+
<SliderThumb :class="ui.thumb({ class: props.ui?.thumb })" />
|
|
90
|
+
</UTooltip>
|
|
91
|
+
<SliderThumb v-else :class="ui.thumb({ class: props.ui?.thumb })" />
|
|
92
|
+
</template>
|
|
81
93
|
</SliderRoot>
|
|
82
94
|
</template>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SliderRootProps } from 'reka-ui';
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
3
|
import theme from '#build/ui/slider';
|
|
4
|
+
import type { TooltipProps } from '../types';
|
|
4
5
|
import type { ComponentConfig } from '../types/utils';
|
|
5
6
|
type Slider = ComponentConfig<typeof theme, AppConfig, 'slider'>;
|
|
6
7
|
export interface SliderProps extends Pick<SliderRootProps, 'name' | 'disabled' | 'inverted' | 'min' | 'max' | 'step' | 'minStepsBetweenThumbs'> {
|
|
@@ -22,31 +23,36 @@ export interface SliderProps extends Pick<SliderRootProps, 'name' | 'disabled' |
|
|
|
22
23
|
* @defaultValue 'horizontal'
|
|
23
24
|
*/
|
|
24
25
|
orientation?: SliderRootProps['orientation'];
|
|
26
|
+
/**
|
|
27
|
+
* Display a tooltip around the slider thumbs with the current value.
|
|
28
|
+
* `{ disableClosingTrigger: true }`{lang="ts-type"}
|
|
29
|
+
* @defaultValue false
|
|
30
|
+
*/
|
|
31
|
+
tooltip?: boolean | TooltipProps;
|
|
25
32
|
/** The value of the slider when initially rendered. Use when you do not need to control the state of the slider. */
|
|
26
33
|
defaultValue?: number | number[];
|
|
27
34
|
class?: any;
|
|
28
35
|
ui?: Slider['slots'];
|
|
29
36
|
}
|
|
30
|
-
export interface SliderEmits {
|
|
31
|
-
(e: 'update:modelValue', payload:
|
|
37
|
+
export interface SliderEmits<T extends number | number[] = number | number[]> {
|
|
38
|
+
(e: 'update:modelValue', payload: T): void;
|
|
32
39
|
(e: 'change', payload: Event): void;
|
|
33
40
|
}
|
|
34
|
-
declare const _default:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} & {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
step: number;
|
|
49
|
-
max: number;
|
|
50
|
-
min: number;
|
|
51
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const _default: <T extends number | number[]>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
42
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
43
|
+
readonly onChange?: ((payload: Event) => any) | undefined;
|
|
44
|
+
readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
|
|
45
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue"> & (SliderProps & {
|
|
46
|
+
modelValue?: T;
|
|
47
|
+
}) & Partial<{}>> & import("vue").PublicProps;
|
|
48
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
49
|
+
attrs: any;
|
|
50
|
+
slots: {};
|
|
51
|
+
emit: SliderEmits<T> & ((evt: "update:modelValue", value: T | undefined) => void);
|
|
52
|
+
}>) => import("vue").VNode & {
|
|
53
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
54
|
+
};
|
|
52
55
|
export default _default;
|
|
56
|
+
type __VLS_PrettifyLocal<T> = {
|
|
57
|
+
[K in keyof T]: T[K];
|
|
58
|
+
} & {};
|
|
@@ -62,20 +62,20 @@ defineExpose({
|
|
|
62
62
|
</script>
|
|
63
63
|
|
|
64
64
|
<template>
|
|
65
|
-
<StepperRoot v-bind="rootProps" v-model="currentStepIndex" :class="ui.root({ class: [props.
|
|
65
|
+
<StepperRoot v-bind="rootProps" v-model="currentStepIndex" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
66
66
|
<div :class="ui.header({ class: props.ui?.header })">
|
|
67
67
|
<StepperItem
|
|
68
68
|
v-for="(item, count) in items"
|
|
69
69
|
:key="item.value ?? count"
|
|
70
70
|
:step="count"
|
|
71
71
|
:disabled="item.disabled || props.disabled"
|
|
72
|
-
:class="ui.item({ class: props.ui?.item })"
|
|
72
|
+
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
73
73
|
>
|
|
74
|
-
<div :class="ui.container({ class: props.ui?.container })">
|
|
75
|
-
<StepperTrigger :class="ui.trigger({ class: props.ui?.trigger })">
|
|
76
|
-
<StepperIndicator :class="ui.indicator({ class: props.ui?.indicator })">
|
|
74
|
+
<div :class="ui.container({ class: [props.ui?.container, item.ui?.container] })">
|
|
75
|
+
<StepperTrigger :class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger] })">
|
|
76
|
+
<StepperIndicator :class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })">
|
|
77
77
|
<slot name="indicator" :item="item">
|
|
78
|
-
<UIcon v-if="item.icon" :name="item.icon" :class="ui.icon({ class: props.ui?.icon })" />
|
|
78
|
+
<UIcon v-if="item.icon" :name="item.icon" :class="ui.icon({ class: [props.ui?.icon, item.ui?.icon] })" />
|
|
79
79
|
<template v-else>
|
|
80
80
|
{{ count + 1 }}
|
|
81
81
|
</template>
|
|
@@ -85,17 +85,17 @@ defineExpose({
|
|
|
85
85
|
|
|
86
86
|
<StepperSeparator
|
|
87
87
|
v-if="count < items.length - 1"
|
|
88
|
-
:class="ui.separator({ class: props.ui?.separator })"
|
|
88
|
+
:class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })"
|
|
89
89
|
/>
|
|
90
90
|
</div>
|
|
91
91
|
|
|
92
|
-
<div :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
93
|
-
<StepperTitle :class="ui.title({ class: props.ui?.title })">
|
|
92
|
+
<div :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })">
|
|
93
|
+
<StepperTitle as="div" :class="ui.title({ class: [props.ui?.title, item.ui?.title] })">
|
|
94
94
|
<slot name="title" :item="item">
|
|
95
95
|
{{ item.title }}
|
|
96
96
|
</slot>
|
|
97
97
|
</StepperTitle>
|
|
98
|
-
<StepperDescription :class="ui.description({ class: props.ui?.description })">
|
|
98
|
+
<StepperDescription as="div" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })">
|
|
99
99
|
<slot name="description" :item="item">
|
|
100
100
|
{{ item.description }}
|
|
101
101
|
</slot>
|
|
@@ -14,6 +14,8 @@ export interface StepperItem {
|
|
|
14
14
|
icon?: string;
|
|
15
15
|
content?: string;
|
|
16
16
|
disabled?: boolean;
|
|
17
|
+
class?: any;
|
|
18
|
+
ui?: Pick<Stepper['slots'], 'item' | 'container' | 'trigger' | 'indicator' | 'icon' | 'separator' | 'wrapper' | 'title' | 'description'>;
|
|
17
19
|
[key: string]: any;
|
|
18
20
|
}
|
|
19
21
|
export interface StepperProps<T extends StepperItem = StepperItem> extends Pick<StepperRootProps, 'linear'> {
|
|
@@ -53,7 +53,7 @@ function onUpdate(value) {
|
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
55
|
<template>
|
|
56
|
-
<Primitive :as="as" :class="ui.root({ class: [props.
|
|
56
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
57
57
|
<div :class="ui.container({ class: props.ui?.container })">
|
|
58
58
|
<SwitchRoot
|
|
59
59
|
:id="id"
|
|
@@ -189,7 +189,7 @@ defineExpose({
|
|
|
189
189
|
</script>
|
|
190
190
|
|
|
191
191
|
<template>
|
|
192
|
-
<Primitive :as="as" :class="ui.root({ class: [props.
|
|
192
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
193
193
|
<table ref="tableRef" :class="ui.base({ class: [props.ui?.base] })">
|
|
194
194
|
<caption v-if="caption || !!slots.caption" :class="ui.caption({ class: [props.ui?.caption] })">
|
|
195
195
|
<slot name="caption">
|
|
@@ -270,7 +270,7 @@ defineExpose({
|
|
|
270
270
|
<tr v-else>
|
|
271
271
|
<td :colspan="columns?.length" :class="ui.empty({ class: props.ui?.empty })">
|
|
272
272
|
<slot name="empty">
|
|
273
|
-
{{ empty || t(
|
|
273
|
+
{{ empty || t("table.noData") }}
|
|
274
274
|
</slot>
|
|
275
275
|
</td>
|
|
276
276
|
</tr>
|
|
@@ -40,19 +40,19 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.tabs || {} })
|
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
<template>
|
|
43
|
-
<TabsRoot v-bind="rootProps" :class="ui.root({ class: [props.
|
|
43
|
+
<TabsRoot v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
44
44
|
<TabsList :class="ui.list({ class: props.ui?.list })">
|
|
45
45
|
<TabsIndicator :class="ui.indicator({ class: props.ui?.indicator })" />
|
|
46
46
|
|
|
47
47
|
<slot name="list-leading" />
|
|
48
48
|
|
|
49
|
-
<TabsTrigger v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :disabled="item.disabled" :class="ui.trigger({ class: props.ui?.trigger })">
|
|
49
|
+
<TabsTrigger v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :disabled="item.disabled" :class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger] })">
|
|
50
50
|
<slot name="leading" :item="item" :index="index">
|
|
51
|
-
<UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
52
|
-
<UAvatar v-else-if="item.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="item.avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
|
|
51
|
+
<UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })" />
|
|
52
|
+
<UAvatar v-else-if="item.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="item.avatar" :class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })" />
|
|
53
53
|
</slot>
|
|
54
54
|
|
|
55
|
-
<span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: props.ui?.label })">
|
|
55
|
+
<span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
|
|
56
56
|
<slot :item="item" :index="index">{{ get(item, props.labelKey) }}</slot>
|
|
57
57
|
</span>
|
|
58
58
|
|
|
@@ -63,7 +63,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.tabs || {} })
|
|
|
63
63
|
</TabsList>
|
|
64
64
|
|
|
65
65
|
<template v-if="!!content">
|
|
66
|
-
<TabsContent v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :class="ui.content({ class: props.ui?.content })">
|
|
66
|
+
<TabsContent v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :class="ui.content({ class: [props.ui?.content, item.ui?.content, item.class] })">
|
|
67
67
|
<slot :name="item.slot || 'content'" :item="item" :index="index">
|
|
68
68
|
{{ item.content }}
|
|
69
69
|
</slot>
|
|
@@ -16,6 +16,8 @@ export interface TabsItem {
|
|
|
16
16
|
/** A unique value for the tab item. Defaults to the index. */
|
|
17
17
|
value?: string | number;
|
|
18
18
|
disabled?: boolean;
|
|
19
|
+
class?: any;
|
|
20
|
+
ui?: Pick<Tabs['slots'], 'trigger' | 'leadingIcon' | 'leadingAvatar' | 'label' | 'content'>;
|
|
19
21
|
[key: string]: any;
|
|
20
22
|
}
|
|
21
23
|
export interface TabsProps<T extends TabsItem = TabsItem> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode' | 'unmountOnHide'> {
|
|
@@ -10,6 +10,8 @@ import { useComponentIcons } from "../composables/useComponentIcons";
|
|
|
10
10
|
import { useFormField } from "../composables/useFormField";
|
|
11
11
|
import { looseToNumber } from "../utils";
|
|
12
12
|
import { tv } from "../utils/tv";
|
|
13
|
+
import UIcon from "./Icon.vue";
|
|
14
|
+
import UAvatar from "./Avatar.vue";
|
|
13
15
|
defineOptions({ inheritAttrs: false });
|
|
14
16
|
const props = defineProps({
|
|
15
17
|
as: { type: null, required: false },
|
|
@@ -25,10 +27,11 @@ const props = defineProps({
|
|
|
25
27
|
autoresize: { type: Boolean, required: false },
|
|
26
28
|
autoresizeDelay: { type: Number, required: false, default: 0 },
|
|
27
29
|
disabled: { type: Boolean, required: false },
|
|
28
|
-
class: { type: null, required: false },
|
|
29
30
|
rows: { type: Number, required: false, default: 3 },
|
|
30
31
|
maxrows: { type: Number, required: false, default: 0 },
|
|
31
32
|
highlight: { type: Boolean, required: false },
|
|
33
|
+
modelModifiers: { type: Object, required: false },
|
|
34
|
+
class: { type: null, required: false },
|
|
32
35
|
ui: { type: null, required: false },
|
|
33
36
|
icon: { type: String, required: false },
|
|
34
37
|
avatar: { type: Object, required: false },
|
|
@@ -39,9 +42,9 @@ const props = defineProps({
|
|
|
39
42
|
loading: { type: Boolean, required: false },
|
|
40
43
|
loadingIcon: { type: String, required: false }
|
|
41
44
|
});
|
|
42
|
-
const slots = defineSlots();
|
|
43
45
|
const emits = defineEmits(["update:modelValue", "blur", "change"]);
|
|
44
|
-
const
|
|
46
|
+
const slots = defineSlots();
|
|
47
|
+
const [modelValue, modelModifiers] = defineModel({ type: null });
|
|
45
48
|
const appConfig = useAppConfig();
|
|
46
49
|
const { emitFormFocus, emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props, { deferInputValidation: true });
|
|
47
50
|
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
|
|
@@ -130,7 +133,7 @@ defineExpose({
|
|
|
130
133
|
</script>
|
|
131
134
|
|
|
132
135
|
<template>
|
|
133
|
-
<Primitive :as="as" :class="ui.root({ class: [props.
|
|
136
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
134
137
|
<textarea
|
|
135
138
|
:id="id"
|
|
136
139
|
ref="textareaRef"
|