docs(select/select-menu): apply width class on examples

Resolves #2297
This commit is contained in:
Benjamin Canac
2024-10-10 15:34:33 +02:00
parent c34a805e5f
commit 365bc0fc9a
10 changed files with 81 additions and 11 deletions

View File

@@ -10,5 +10,6 @@ const selected = ref('Backlog')
:ui="{ :ui="{
trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200' trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200'
}" }"
class="w-40"
/> />
</template> </template>

View File

@@ -29,7 +29,7 @@ const selected = ref(items.value[0])
</script> </script>
<template> <template>
<USelectMenu v-model="selected" :items="items" class="w-40"> <USelectMenu v-model="selected" :items="items" class="w-48">
<template #leading="{ modelValue, ui }"> <template #leading="{ modelValue, ui }">
<UAvatar <UAvatar
v-if="modelValue" v-if="modelValue"

View File

@@ -9,5 +9,5 @@ defineShortcuts({
</script> </script>
<template> <template>
<USelectMenu v-model="selected" v-model:open="open" :items="items" /> <USelectMenu v-model="selected" v-model:open="open" :items="items" class="w-40" />
</template> </template>

View File

@@ -5,5 +5,5 @@ const selected = ref('Backlog')
</script> </script>
<template> <template>
<USelectMenu v-model="selected" v-model:search-term="searchTerm" :items="items" /> <USelectMenu v-model="selected" v-model:search-term="searchTerm" :items="items" class="w-40" />
</template> </template>

View File

@@ -9,5 +9,6 @@ const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
:ui="{ :ui="{
trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200' trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200'
}" }"
class="w-40"
/> />
</template> </template>

View File

@@ -32,7 +32,7 @@ function getAvatar(value: string) {
</script> </script>
<template> <template>
<USelect default-value="benjamincanac" :items="items" class="w-40"> <USelect default-value="benjamincanac" :items="items" class="w-48">
<template #leading="{ modelValue, ui }"> <template #leading="{ modelValue, ui }">
<UAvatar <UAvatar
v-if="modelValue" v-if="modelValue"

View File

@@ -8,5 +8,5 @@ defineShortcuts({
</script> </script>
<template> <template>
<USelect v-model:open="open" default-value="Backlog" :items="items" /> <USelect v-model:open="open" default-value="Backlog" :items="items" class="w-40" />
</template> </template>

View File

@@ -48,7 +48,7 @@ props:
You can also pass an array of objects with the following properties: You can also pass an array of objects with the following properties:
- `label?: string`{lang="ts-type"} - `label?: string`{lang="ts-type"}
- [`type?: "label" | "separator" | "item"`{lang="ts-type"}](#with-typed-items) - [`type?: "label" | "separator" | "item"`{lang="ts-type"}](#with-items-type)
- [`icon?: string`{lang="ts-type"}](#with-icons-in-items) - [`icon?: string`{lang="ts-type"}](#with-icons-in-items)
- [`avatar?: AvatarProps`{lang="ts-type"}](#with-avatar-in-items) - [`avatar?: AvatarProps`{lang="ts-type"}](#with-avatar-in-items)
- [`chip?: ChipProps`{lang="ts-type"}](#with-chip-in-items) - [`chip?: ChipProps`{lang="ts-type"}](#with-chip-in-items)
@@ -492,7 +492,7 @@ props:
## Examples ## Examples
### With typed items ### With items type
You can use the `type` property with `separator` to display a separator between items or `label` to display a label. You can use the `type` property with `separator` to display a separator between items or `label` to display a label.

View File

@@ -32,6 +32,7 @@ prettier: true
ignore: ignore:
- modelValue - modelValue
- items - items
- class
external: external:
- items - items
- modelValue - modelValue
@@ -42,13 +43,14 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
You can also pass an array of objects with the following properties: You can also pass an array of objects with the following properties:
- `label?: string`{lang="ts-type"} - `label?: string`{lang="ts-type"}
- [`type?: "label" | "separator" | "item"`{lang="ts-type"}](#with-typed-items) - [`type?: "label" | "separator" | "item"`{lang="ts-type"}](#with-items-type)
- [`icon?: string`{lang="ts-type"}](#with-icons-in-items) - [`icon?: string`{lang="ts-type"}](#with-icons-in-items)
- [`avatar?: AvatarProps`{lang="ts-type"}](#with-avatar-in-items) - [`avatar?: AvatarProps`{lang="ts-type"}](#with-avatar-in-items)
- [`chip?: ChipProps`{lang="ts-type"}](#with-chip-in-items) - [`chip?: ChipProps`{lang="ts-type"}](#with-chip-in-items)
@@ -60,6 +62,7 @@ You can also pass an array of objects with the following properties:
ignore: ignore:
- modelValue.label - modelValue.label
- items - items
- class
external: external:
- items - items
- modelValue - modelValue
@@ -71,6 +74,7 @@ props:
- label: 'Todo' - label: 'Todo'
- label: 'In Progress' - label: 'In Progress'
- label: 'Done' - label: 'Done'
class: 'w-40'
--- ---
:: ::
@@ -86,6 +90,7 @@ prettier: true
ignore: ignore:
- modelValue - modelValue
- items - items
- class
external: external:
- items - items
- modelValue - modelValue
@@ -102,6 +107,7 @@ props:
- Carrot - Carrot
- Courgette - Courgette
- Leek - Leek
class: 'w-40'
--- ---
:: ::
@@ -116,6 +122,7 @@ ignore:
- modelValue - modelValue
- valueKey - valueKey
- items - items
- class
external: external:
- items - items
- modelValue - modelValue
@@ -131,6 +138,7 @@ props:
id: 'in_progress' id: 'in_progress'
- label: 'Done' - label: 'Done'
id: 'done' id: 'done'
class: 'w-40'
--- ---
:: ::
@@ -145,6 +153,7 @@ ignore:
- modelValue - modelValue
- items - items
- multiple - multiple
- class
external: external:
- items - items
- modelValue - modelValue
@@ -158,6 +167,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -174,6 +184,7 @@ Use the `placeholder` prop to set a placeholder text.
prettier: true prettier: true
ignore: ignore:
- items - items
- class
external: external:
- items - items
props: props:
@@ -183,6 +194,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -197,6 +209,7 @@ ignore:
- modelValue.label - modelValue.label
- modelValue.icon - modelValue.icon
- items - items
- class
external: external:
- items - items
- modelValue - modelValue
@@ -215,6 +228,7 @@ props:
icon: 'i-heroicons-arrow-up-circle' icon: 'i-heroicons-arrow-up-circle'
- label: Done - label: Done
icon: 'i-heroicons-check-circle' icon: 'i-heroicons-check-circle'
class: 'w-40'
--- ---
:: ::
@@ -232,6 +246,7 @@ prettier: true
ignore: ignore:
- items - items
- modelValue - modelValue
- class
external: external:
- items - items
- modelValue - modelValue
@@ -256,6 +271,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -269,6 +285,7 @@ prettier: true
ignore: ignore:
- items - items
- modelValue - modelValue
- class
external: external:
- items - items
- modelValue - modelValue
@@ -281,6 +298,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -298,6 +316,7 @@ prettier: true
ignore: ignore:
- items - items
- modelValue - modelValue
- class
external: external:
- items - items
- modelValue - modelValue
@@ -311,6 +330,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -324,6 +344,7 @@ prettier: true
ignore: ignore:
- items - items
- modelValue - modelValue
- class
external: external:
- items - items
- modelValue - modelValue
@@ -335,6 +356,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -348,6 +370,7 @@ prettier: true
ignore: ignore:
- items - items
- modelValue - modelValue
- class
external: external:
- items - items
- modelValue - modelValue
@@ -360,6 +383,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -373,6 +397,7 @@ prettier: true
ignore: ignore:
- items - items
- modelValue - modelValue
- class
external: external:
- items - items
- modelValue - modelValue
@@ -385,6 +410,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -402,6 +428,7 @@ prettier: true
ignore: ignore:
- items - items
- modelValue - modelValue
- class
external: external:
- items - items
- modelValue - modelValue
@@ -414,6 +441,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -431,6 +459,7 @@ prettier: true
ignore: ignore:
- items - items
- modelValue - modelValue
- class
external: external:
- items - items
- modelValue - modelValue
@@ -443,6 +472,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -456,6 +486,7 @@ prettier: true
ignore: ignore:
- items - items
- modelValue - modelValue
- class
external: external:
- items - items
- modelValue - modelValue
@@ -468,6 +499,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -485,6 +517,7 @@ prettier: true
ignore: ignore:
- items - items
- placeholder - placeholder
- class
external: external:
- items - items
props: props:
@@ -495,12 +528,13 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
## Examples ## Examples
### With typed items ### With items type
You can use the `type` property with `separator` to display a separator between items or `label` to display a label. You can use the `type` property with `separator` to display a separator between items or `label` to display a label.
@@ -510,6 +544,7 @@ collapse: true
ignore: ignore:
- modelValue - modelValue
- items - items
- class
external: external:
- items - items
- modelValue - modelValue
@@ -531,6 +566,7 @@ props:
- Carrot - Carrot
- Courgette - Courgette
- Leek - Leek
class: 'w-40'
--- ---
:: ::

View File

@@ -23,6 +23,7 @@ prettier: true
ignore: ignore:
- modelValue - modelValue
- items - items
- class
external: external:
- items - items
- modelValue - modelValue
@@ -33,6 +34,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -40,7 +42,7 @@ You can also pass an array of objects with the following properties:
- `label?: string`{lang="ts-type"} - `label?: string`{lang="ts-type"}
- [`value?: string`{lang="ts-type"}](#value-key) - [`value?: string`{lang="ts-type"}](#value-key)
- [`type?: "label" | "separator" | "item"`{lang="ts-type"}](#with-typed-items) - [`type?: "label" | "separator" | "item"`{lang="ts-type"}](#with-items-type)
- [`icon?: string`{lang="ts-type"}](#with-icons-in-items) - [`icon?: string`{lang="ts-type"}](#with-icons-in-items)
- [`avatar?: AvatarProps`{lang="ts-type"}](#with-avatar-in-items) - [`avatar?: AvatarProps`{lang="ts-type"}](#with-avatar-in-items)
- [`chip?: ChipProps`{lang="ts-type"}](#with-chip-in-items) - [`chip?: ChipProps`{lang="ts-type"}](#with-chip-in-items)
@@ -51,6 +53,7 @@ You can also pass an array of objects with the following properties:
ignore: ignore:
- modelValue - modelValue
- items - items
- class
external: external:
- items - items
- modelValue - modelValue
@@ -65,6 +68,7 @@ props:
value: 'in_progress' value: 'in_progress'
- label: 'Done' - label: 'Done'
value: 'done' value: 'done'
class: 'w-40'
--- ---
:: ::
@@ -80,6 +84,7 @@ prettier: true
ignore: ignore:
- modelValue - modelValue
- items - items
- class
external: external:
- items - items
- modelValue - modelValue
@@ -96,6 +101,7 @@ props:
- Carrot - Carrot
- Courgette - Courgette
- Leek - Leek
class: 'w-40'
--- ---
:: ::
@@ -109,6 +115,7 @@ ignore:
- modelValue - modelValue
- valueKey - valueKey
- items - items
- class
external: external:
- items - items
- modelValue - modelValue
@@ -124,6 +131,7 @@ props:
id: 'in_progress' id: 'in_progress'
- label: 'Done' - label: 'Done'
id: 'done' id: 'done'
class: 'w-40'
--- ---
:: ::
@@ -136,6 +144,7 @@ Use the `placeholder` prop to set a placeholder text.
prettier: true prettier: true
ignore: ignore:
- items - items
- class
external: external:
- items - items
props: props:
@@ -145,6 +154,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -162,6 +172,7 @@ prettier: true
ignore: ignore:
- items - items
- defaultValue - defaultValue
- class
external: external:
- items - items
items: items:
@@ -189,6 +200,7 @@ props:
- In Progress - In Progress
- Done - Done
defaultValue: 'Todo' defaultValue: 'Todo'
class: 'w-40'
--- ---
:: ::
@@ -206,6 +218,7 @@ prettier: true
ignore: ignore:
- items - items
- defaultValue - defaultValue
- class
external: external:
- items - items
props: props:
@@ -217,6 +230,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -234,6 +248,7 @@ prettier: true
ignore: ignore:
- items - items
- defaultValue - defaultValue
- class
external: external:
- items - items
props: props:
@@ -246,6 +261,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -259,6 +275,7 @@ prettier: true
ignore: ignore:
- items - items
- defaultValue - defaultValue
- class
external: external:
- items - items
props: props:
@@ -269,6 +286,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -282,6 +300,7 @@ prettier: true
ignore: ignore:
- items - items
- defaultValue - defaultValue
- class
external: external:
- items - items
props: props:
@@ -293,6 +312,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -306,6 +326,7 @@ prettier: true
ignore: ignore:
- items - items
- defaultValue - defaultValue
- class
external: external:
- items - items
props: props:
@@ -317,6 +338,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -334,6 +356,7 @@ prettier: true
ignore: ignore:
- items - items
- defaultValue - defaultValue
- class
external: external:
- items - items
props: props:
@@ -345,6 +368,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -362,6 +386,7 @@ prettier: true
ignore: ignore:
- items - items
- defaultValue - defaultValue
- class
external: external:
- items - items
props: props:
@@ -373,6 +398,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -386,6 +412,7 @@ prettier: true
ignore: ignore:
- items - items
- defaultValue - defaultValue
- class
external: external:
- items - items
props: props:
@@ -397,6 +424,7 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
@@ -414,6 +442,7 @@ prettier: true
ignore: ignore:
- items - items
- placeholder - placeholder
- class
external: external:
- items - items
props: props:
@@ -424,12 +453,13 @@ props:
- Todo - Todo
- In Progress - In Progress
- Done - Done
class: 'w-40'
--- ---
:: ::
## Examples ## Examples
### With typed items ### With items type
You can use the `type` property with `separator` to display a separator between items or `label` to display a label. You can use the `type` property with `separator` to display a separator between items or `label` to display a label.
@@ -439,6 +469,7 @@ collapse: true
ignore: ignore:
- modelValue - modelValue
- items - items
- class
external: external:
- items - items
- modelValue - modelValue
@@ -460,6 +491,7 @@ props:
- Carrot - Carrot
- Courgette - Courgette
- Leek - Leek
class: 'w-40'
--- ---
:: ::