Skip to content

Commit

Permalink
feat(web-core): inverse the logic of border props in MenuList.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
CzechSebastian committed Jan 22, 2025
1 parent 42f205e commit 1794251
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<MenuList placement="bottom-end" border>
<MenuList placement="bottom-end">
<template #trigger="{ open, isOpen }">
<UiAccountMenuButton
v-tooltip="isOpen ? false : { content: $t('settings'), placement: 'left' }"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</TabItem>
<TabItem v-bind="tab(TAB.SLOTS, slotParams)">Slots</TabItem>
<TabItem v-bind="tab(TAB.SETTINGS, settingParams)">Settings</TabItem>
<MenuList placement="bottom" border>
<MenuList placement="bottom">
<template #trigger="{ open, isOpen }">
<TabItem :active="isOpen" :disabled="presets === undefined" class="preset-tab" @click="open">
<UiIcon :icon="faSliders" />
Expand Down
4 changes: 2 additions & 2 deletions @xen-orchestra/lite/src/components/vm/VmHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<TitleBar :icon="faDisplay">
{{ name }}
<template #actions>
<MenuList v-if="vm !== undefined" placement="bottom-end" border>
<MenuList v-if="vm !== undefined" placement="bottom-end">
<template #trigger="{ open, isOpen }">
<UiButton
size="medium"
Expand All @@ -18,7 +18,7 @@
</template>
<VmActionPowerStateItems :vm-refs="[vm.$ref]" />
</MenuList>
<MenuList v-if="vm !== undefined" placement="bottom-end" border>
<MenuList v-if="vm !== undefined" placement="bottom-end">
<template #trigger="{ open, isOpen }">
<UiButtonIcon
v-tooltip="{
Expand Down
2 changes: 1 addition & 1 deletion @xen-orchestra/lite/src/components/vm/VmsActionsBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<MenuList
:disabled="selectedRefs.length === 0"
:horizontal="!isMobile"
:border="isMobile"
:no-border="!isMobile"
class="vms-actions-bar"
placement="bottom-end"
>
Expand Down
2 changes: 1 addition & 1 deletion @xen-orchestra/web-core/lib/components/menu/MenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
<slot />
</MenuTrigger>
<MenuList v-else :disabled="isDisabled" border>
<MenuList v-else :disabled="isDisabled">
<template #trigger="{ open, isOpen }">
<MenuTrigger :active="isOpen" :busy="isBusy" :disabled="isDisabled" :icon @click="open">
<slot />
Expand Down
10 changes: 8 additions & 2 deletions @xen-orchestra/web-core/lib/components/menu/MenuList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
<template>
<slot :is-open="isOpen" :open="open" name="trigger" />
<Teleport :disabled="!shouldTeleport" to="body">
<ul v-if="!hasTrigger || isOpen" ref="menu" :class="{ horizontal, border }" class="menu-list" v-bind="$attrs">
<ul
v-if="!hasTrigger || isOpen"
ref="menu"
:class="{ horizontal, border: !noBorder }"
class="menu-list"
v-bind="$attrs"
>
<slot />
</ul>
</Teleport>
Expand All @@ -21,7 +27,7 @@ defineOptions({

const props = defineProps<{
horizontal?: boolean
border?: boolean
noBorder?: boolean
disabled?: boolean
placement?: Options['placement']
}>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- v1.0 -->
<template>
<MenuList :disabled placement="bottom-start" border>
<MenuList :disabled placement="bottom-start">
<template #trigger="{ open, isOpen }">
<th
:class="{ interactive, disabled, focus: isOpen }"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<MenuList border :disabled placement="bottom-end">
<MenuList :disabled placement="bottom-end">
<template #trigger="{ isOpen, open }">
<UiAccountMenuButton
v-tooltip="isOpen ? false : { content: $t('account-organization-more'), placement: 'bottom-end' }"
Expand Down

0 comments on commit 1794251

Please sign in to comment.