mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
@@ -782,6 +782,14 @@ name: 'input-menu-countries-example'
|
|||||||
|
|
||||||
:component-emits
|
:component-emits
|
||||||
|
|
||||||
|
### Expose
|
||||||
|
|
||||||
|
When accessing the component via a template ref, you can use the following:
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| ---- | ---- |
|
||||||
|
| `inputRef`{lang="ts-type"} | `Ref<InstanceType<typeof ComboboxTrigger> \| null>`{lang="ts-type"} |
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
|
|
||||||
:component-theme
|
:component-theme
|
||||||
|
|||||||
@@ -287,8 +287,8 @@ name: 'input-number-slots-example'
|
|||||||
When accessing the component via a template ref, you can use the following:
|
When accessing the component via a template ref, you can use the following:
|
||||||
|
|
||||||
| Name | Type |
|
| Name | Type |
|
||||||
|----------------------------|-------------------------------------------------|
|
| -------------------------- | ----------------------------------------------- |
|
||||||
| `inputRef`{lang="ts-type"} | `Ref<HTMLInputElement \| null>`{lang="ts-type"} |
|
| `inputRef`{lang="ts-type"} | `Ref<InstanceType<typeof NumberFieldInput> \| null>`{lang="ts-type"} |
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
|
|
||||||
|
|||||||
@@ -276,8 +276,8 @@ name: 'input-tags-form-field-example'
|
|||||||
When accessing the component via a template ref, you can use the following:
|
When accessing the component via a template ref, you can use the following:
|
||||||
|
|
||||||
| Name | Type |
|
| Name | Type |
|
||||||
|----------------------------|-------------------------------------------------|
|
| -------------------------- | ----------------------------------------------- |
|
||||||
| `inputRef`{lang="ts-type"} | `Ref<HTMLInputElement \| null>`{lang="ts-type"} |
|
| `inputRef`{lang="ts-type"} | `Ref<InstanceType<typeof TagsInputInput> \| null>`{lang="ts-type"} |
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
|
|
||||||
|
|||||||
@@ -180,6 +180,8 @@ props:
|
|||||||
|
|
||||||
:component-emits
|
:component-emits
|
||||||
|
|
||||||
|
### Expose
|
||||||
|
|
||||||
When accessing the component via a template ref, you can use the following:
|
When accessing the component via a template ref, you can use the following:
|
||||||
|
|
||||||
| Name | Type |
|
| Name | Type |
|
||||||
|
|||||||
@@ -815,6 +815,14 @@ name: 'select-menu-countries-example'
|
|||||||
|
|
||||||
:component-emits
|
:component-emits
|
||||||
|
|
||||||
|
### Expose
|
||||||
|
|
||||||
|
When accessing the component via a template ref, you can use the following:
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| ---- | ---- |
|
||||||
|
| `triggerRef`{lang="ts-type"} | `Ref<InstanceType<typeof ComboboxTrigger> \| null>`{lang="ts-type"} |
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
|
|
||||||
:component-theme
|
:component-theme
|
||||||
|
|||||||
@@ -709,6 +709,14 @@ collapse: true
|
|||||||
|
|
||||||
:component-emits
|
:component-emits
|
||||||
|
|
||||||
|
### Expose
|
||||||
|
|
||||||
|
When accessing the component via a template ref, you can use the following:
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| ---- | ---- |
|
||||||
|
| `triggerRef`{lang="ts-type"} | `Ref<InstanceType<typeof SelectTrigger> \| null>`{lang="ts-type"} |
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
|
|
||||||
:component-theme
|
:component-theme
|
||||||
|
|||||||
@@ -242,6 +242,14 @@ You will have access to the following slots:
|
|||||||
|
|
||||||
:component-emits
|
:component-emits
|
||||||
|
|
||||||
|
### Expose
|
||||||
|
|
||||||
|
When accessing the component via a template ref, you can use the following:
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| ---- | ---- |
|
||||||
|
| `triggersRef`{lang="ts-type"} | `Ref<ComponentPublicInstance[]>`{lang="ts-type"} |
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
|
|
||||||
:component-theme
|
:component-theme
|
||||||
|
|||||||
@@ -245,6 +245,10 @@ function onUpdateOpen(value: boolean) {
|
|||||||
function isSelectItem(item: SelectItem): item is SelectItemBase {
|
function isSelectItem(item: SelectItem): item is SelectItemBase {
|
||||||
return typeof item === 'object' && item !== null
|
return typeof item === 'object' && item !== null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
triggerRef
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- eslint-disable vue/no-template-shadow -->
|
<!-- eslint-disable vue/no-template-shadow -->
|
||||||
|
|||||||
@@ -363,6 +363,10 @@ function onSelect(e: Event, item: SelectMenuItem) {
|
|||||||
function isSelectItem(item: SelectMenuItem): item is _SelectMenuItem {
|
function isSelectItem(item: SelectMenuItem): item is _SelectMenuItem {
|
||||||
return typeof item === 'object' && item !== null
|
return typeof item === 'object' && item !== null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
triggerRef
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- eslint-disable vue/no-template-shadow -->
|
<!-- eslint-disable vue/no-template-shadow -->
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ const groupingState = defineModel<GroupingState>('grouping', { default: [] })
|
|||||||
const expandedState = defineModel<ExpandedState>('expanded', { default: {} })
|
const expandedState = defineModel<ExpandedState>('expanded', { default: {} })
|
||||||
const paginationState = defineModel<PaginationState>('pagination', { default: {} })
|
const paginationState = defineModel<PaginationState>('pagination', { default: {} })
|
||||||
|
|
||||||
const tableRef = ref<HTMLTableElement>()
|
const tableRef = ref<HTMLTableElement | null>(null)
|
||||||
|
|
||||||
const tableApi = useVueTable({
|
const tableApi = useVueTable({
|
||||||
...reactiveOmit(props, 'as', 'data', 'columns', 'caption', 'sticky', 'loading', 'loadingColor', 'loadingAnimation', 'class', 'ui'),
|
...reactiveOmit(props, 'as', 'data', 'columns', 'caption', 'sticky', 'loading', 'loadingColor', 'loadingAnimation', 'class', 'ui'),
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ export type TabsSlots<T extends TabsItem = TabsItem> = {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script setup lang="ts" generic="T extends TabsItem">
|
<script setup lang="ts" generic="T extends TabsItem">
|
||||||
import { computed } from 'vue'
|
import type { ComponentPublicInstance } from 'vue'
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
import { TabsRoot, TabsList, TabsIndicator, TabsTrigger, TabsContent, useForwardPropsEmits } from 'reka-ui'
|
import { TabsRoot, TabsList, TabsIndicator, TabsTrigger, TabsContent, useForwardPropsEmits } from 'reka-ui'
|
||||||
import { reactivePick } from '@vueuse/core'
|
import { reactivePick } from '@vueuse/core'
|
||||||
import { useAppConfig } from '#imports'
|
import { useAppConfig } from '#imports'
|
||||||
@@ -108,6 +109,12 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.tabs || {})
|
|||||||
size: props.size,
|
size: props.size,
|
||||||
orientation: props.orientation
|
orientation: props.orientation
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
const triggersRef = ref<ComponentPublicInstance[]>([])
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
triggersRef
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -117,7 +124,14 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.tabs || {})
|
|||||||
|
|
||||||
<slot name="list-leading" />
|
<slot name="list-leading" />
|
||||||
|
|
||||||
<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] })">
|
<TabsTrigger
|
||||||
|
v-for="(item, index) of items"
|
||||||
|
:key="index"
|
||||||
|
:ref="el => (triggersRef[index] = el as ComponentPublicInstance)"
|
||||||
|
:value="item.value || String(index)"
|
||||||
|
:disabled="item.disabled"
|
||||||
|
:class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger] })"
|
||||||
|
>
|
||||||
<slot name="leading" :item="item" :index="index">
|
<slot name="leading" :item="item" :index="index">
|
||||||
<UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })" />
|
<UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })" />
|
||||||
<UAvatar v-else-if="item.avatar" :size="((props.ui?.leadingAvatarSize || ui.leadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })" />
|
<UAvatar v-else-if="item.avatar" :size="((props.ui?.leadingAvatarSize || ui.leadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })" />
|
||||||
|
|||||||
Reference in New Issue
Block a user