Skip to content

Commit

Permalink
feat: menu improvements (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWaldschmidt authored Jul 24, 2024
1 parent 048a990 commit 31524e6
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v2.0.86

- Adds `class` property to `MenuItem` type

## v2.0.85

- Improve `Overlay` interface
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lob/ui-components",
"version": "2.0.85",
"version": "2.0.86",
"engines": {
"node": ">=20.2.0",
"npm": ">=10.2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Menu/Menu.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const Primary: StoryObj<typeof Menu> = {
items: [
{
label: 'Create (External Link)',
to: 'https://google.com',
to: 'https://lob.com',
target: '_blank',
key: 'test1',
icon: IconName.PLUS
Expand Down
2 changes: 2 additions & 0 deletions src/components/Menu/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
:to="item.item.url"
:href="item.item.url"
:target="item.item.target"
:class="item.item.class"
>
<span
:class="[
Expand Down Expand Up @@ -104,6 +105,7 @@ const pvMenuItems = computed<PrimeVueMenuItem[]>(() =>
pvItem.disabled = item.disabled;
pvItem.visible = item.visible;
pvItem.target = item.target;
pvItem.class = item.class;
}
return pvItem;
Expand Down
1 change: 1 addition & 0 deletions src/components/Menu/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IconName } from '../Icon';

export interface MenuItem {
class?: string;
label: string;
to?: string;
disabled?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ConditionalWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<component :is="tag" v-if="tag" v-bind="$attrs">
<slot />
</component>
<slot v-else v-bind="$attrs" />
<slot v-else attrs="$attrs" />
</template>

<script setup lang="ts">
Expand Down

0 comments on commit 31524e6

Please sign in to comment.