From f244d15b96d97cd8ba34ba9c18f23965e17e3cef Mon Sep 17 00:00:00 2001 From: Malik <48517781+malik-jouda@users.noreply.github.com> Date: Fri, 9 May 2025 20:27:00 +0300 Subject: [PATCH 01/44] fix(Badge/Button): handle zero value in label correctly (#4108) --- src/runtime/components/Badge.vue | 2 +- src/runtime/components/Button.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/components/Badge.vue b/src/runtime/components/Badge.vue index 08a5ad9c..16f28b3f 100644 --- a/src/runtime/components/Badge.vue +++ b/src/runtime/components/Badge.vue @@ -72,7 +72,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.badge || {}) - + {{ label }} diff --git a/src/runtime/components/Button.vue b/src/runtime/components/Button.vue index 3e14bb68..e4a9efa9 100644 --- a/src/runtime/components/Button.vue +++ b/src/runtime/components/Button.vue @@ -143,7 +143,7 @@ const ui = computed(() => tv({ - + {{ label }} From 46c2987ebfd30b2b071a96a745b7270e852e96de Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Sat, 10 May 2025 13:09:17 +0200 Subject: [PATCH 02/44] feat(NavigationMenu): handle `tooltip` in items Resolves #4050 --- src/runtime/components/NavigationMenu.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/runtime/components/NavigationMenu.vue b/src/runtime/components/NavigationMenu.vue index ed46489a..f7fb0c43 100644 --- a/src/runtime/components/NavigationMenu.vue +++ b/src/runtime/components/NavigationMenu.vue @@ -3,7 +3,7 @@ import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuContentProps, NavigationMenuContentEmits, CollapsibleRootProps } from 'reka-ui' import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/navigation-menu' -import type { AvatarProps, BadgeProps, LinkProps } from '../types' +import type { AvatarProps, BadgeProps, LinkProps, TooltipProps } from '../types' import type { ArrayOrNested, DynamicSlots, MergeTypes, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils' type NavigationMenu = ComponentConfig @@ -26,6 +26,12 @@ export interface NavigationMenuItem extends Omit>(), { orientation: 'horizontal', @@ -256,7 +263,12 @@ const lists = computed(() => :disabled="item.disabled" @select="item.onSelect" > - + + + + + + From 09b4699aeadaa195ea081509f8e237bb2c346238 Mon Sep 17 00:00:00 2001 From: Norbiros Date: Sat, 10 May 2025 15:06:20 +0200 Subject: [PATCH 03/44] fix(Select): support more primitive types in `value` field (#4105) --- src/runtime/components/Select.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/components/Select.vue b/src/runtime/components/Select.vue index ffee3d9c..57cf358c 100644 --- a/src/runtime/components/Select.vue +++ b/src/runtime/components/Select.vue @@ -21,7 +21,7 @@ interface SelectItemBase { * @defaultValue 'item' */ type?: 'label' | 'separator' | 'item' - value?: string | number + value?: AcceptableValue | boolean disabled?: boolean onSelect?(e?: Event): void [key: string]: any From 2be60cddfe10fd1e2466900fd53e21ee0c877227 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Sat, 10 May 2025 17:51:46 +0200 Subject: [PATCH 04/44] feat(NavigationMenu): add `collapsible` field in items Resolves #3353, resolves #3911 Reverts https://github.com/nuxt/ui/commit/07e1b4f1f44efe90ac16138de5dbd78faf66e974 --- docs/content/3.components/navigation-menu.md | 6 +++++- src/runtime/components/NavigationMenu.vue | 17 ++++++++++++----- .../NavigationMenu-vue.spec.ts.snap | 10 ++++++++-- .../__snapshots__/NavigationMenu.spec.ts.snap | 10 ++++++++-- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/docs/content/3.components/navigation-menu.md b/docs/content/3.components/navigation-menu.md index 87a09a0a..73220521 100644 --- a/docs/content/3.components/navigation-menu.md +++ b/docs/content/3.components/navigation-menu.md @@ -21,8 +21,12 @@ Use the `items` prop as an array of objects with the following properties: - `icon?: string`{lang="ts-type"} - `avatar?: AvatarProps`{lang="ts-type"} - `badge?: string | number | BadgeProps`{lang="ts-type"} +- `tooltip?: TooltipProps`{lang="ts-type"} - `trailingIcon?: string`{lang="ts-type"} - `type?: 'label' | 'link'`{lang="ts-type"} +- `collapsible?: boolean`{lang="ts-type"} +- `defaultOpen?: boolean`{lang="ts-type"} +- `open?: boolean`{lang="ts-type"} - `value?: string`{lang="ts-type"} - `disabled?: boolean`{lang="ts-type"} - `class?: any`{lang="ts-type"} @@ -140,7 +144,7 @@ Each item can take a `children` array of objects with the following properties t Use the `orientation` prop to change the orientation of the NavigationMenu. ::note -When orientation is `vertical`, a [Collapsible](/components/collapsible) component is used to display children. You can control the open state of each item using the `open` and `defaultOpen` properties. +When orientation is `vertical`, a [Collapsible](/components/collapsible) component is used to display children. You can control the open state of each item using the `open` and `defaultOpen` properties. You can also use the `collapsible` property to control if the item is collapsible. :: ::component-code diff --git a/src/runtime/components/NavigationMenu.vue b/src/runtime/components/NavigationMenu.vue index f7fb0c43..24251cc9 100644 --- a/src/runtime/components/NavigationMenu.vue +++ b/src/runtime/components/NavigationMenu.vue @@ -44,6 +44,12 @@ export interface NavigationMenuItem extends Omit(() => :class="ui.linkTrailingBadge({ class: props.ui?.linkTrailingBadge })" /> - + @@ -245,17 +251,18 @@ const lists = computed(() =>
- + (() => -