mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 17:00:36 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb1fd55801 | ||
|
|
16fd1c0ca3 | ||
|
|
84ac92ed7a | ||
|
|
0ade69de26 | ||
|
|
d9193abf55 | ||
|
|
44a78d7f67 | ||
|
|
3ce600f89a |
23
CHANGELOG.md
23
CHANGELOG.md
@@ -2,6 +2,29 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [0.1.17](https://github.com/nuxtlabs/ui/compare/v0.1.16...v0.1.17) (2022-12-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* remove stop propagation on mode hover ([16fd1c0](https://github.com/nuxtlabs/ui/commit/16fd1c0ca38f1438e791c0d44399f590d9f20d02))
|
||||||
|
|
||||||
|
### [0.1.16](https://github.com/nuxtlabs/ui/compare/v0.1.15...v0.1.16) (2022-12-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Popover:** preset from tooltip ([0ade69d](https://github.com/nuxtlabs/ui/commit/0ade69de2689b094b11a2dead8f71e3d2dccd552))
|
||||||
|
|
||||||
|
### [0.1.15](https://github.com/nuxtlabs/ui/compare/v0.1.14...v0.1.15) (2022-12-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Dropdown:** better handle item click to preventDefault ([#119](https://github.com/nuxtlabs/ui/issues/119)) ([44a78d7](https://github.com/nuxtlabs/ui/commit/44a78d7f679812c59d4410d0bbc01f09abaa78dd))
|
||||||
|
|
||||||
|
### [0.1.14](https://github.com/nuxtlabs/ui/compare/v0.1.13...v0.1.14) (2022-12-02)
|
||||||
|
|
||||||
### [0.1.13](https://github.com/nuxtlabs/ui/compare/v0.1.12...v0.1.13) (2022-12-01)
|
### [0.1.13](https://github.com/nuxtlabs/ui/compare/v0.1.12...v0.1.13) (2022-12-01)
|
||||||
|
|
||||||
### [0.1.12](https://github.com/nuxtlabs/ui/compare/v0.1.11...v0.1.12) (2022-11-29)
|
### [0.1.12](https://github.com/nuxtlabs/ui/compare/v0.1.11...v0.1.12) (2022-11-29)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nuxthq/ui",
|
"name": "@nuxthq/ui",
|
||||||
"version": "0.1.13",
|
"version": "0.1.17",
|
||||||
"repository": "https://github.com/nuxtlabs/ui",
|
"repository": "https://github.com/nuxtlabs/ui",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -10,8 +10,13 @@
|
|||||||
<transition appear v-bind="transitionClass">
|
<transition appear v-bind="transitionClass">
|
||||||
<MenuItems :class="baseClass" static>
|
<MenuItems :class="baseClass" static>
|
||||||
<div v-for="(subItems, index) of items" :key="index" :class="groupClass">
|
<div v-for="(subItems, index) of items" :key="index" :class="groupClass">
|
||||||
<MenuItem v-for="(item, subIndex) of subItems" :key="subIndex" v-slot="{ active, disabled }" :disabled="item.disabled" @click="e => item.click?.(e)">
|
<MenuItem v-for="(item, subIndex) of subItems" :key="subIndex" v-slot="{ active, disabled }" :disabled="item.disabled">
|
||||||
<Component v-bind="item" :is="(item.to && NuxtLink) || (item.click && 'button') || 'div'" :class="resolveItemClass({ active, disabled })">
|
<Component
|
||||||
|
v-bind="omit(item, ['click'])"
|
||||||
|
:is="(item.to && NuxtLink) || (item.click && 'button') || 'div'"
|
||||||
|
:class="resolveItemClass({ active, disabled })"
|
||||||
|
@click="item.click"
|
||||||
|
>
|
||||||
<slot :name="item.slot" :item="item">
|
<slot :name="item.slot" :item="item">
|
||||||
<Icon v-if="item.icon" :name="item.icon" :class="[itemIconClass, item.iconClass]" />
|
<Icon v-if="item.icon" :name="item.icon" :class="[itemIconClass, item.iconClass]" />
|
||||||
<Avatar v-if="item.avatar" v-bind="{ size: 'xxs', ...item.avatar }" :class="itemAvatarClass" />
|
<Avatar v-if="item.avatar" v-bind="{ size: 'xxs', ...item.avatar }" :class="itemAvatarClass" />
|
||||||
@@ -45,7 +50,7 @@ import { defu } from 'defu'
|
|||||||
import NuxtLink from '#app/components/nuxt-link'
|
import NuxtLink from '#app/components/nuxt-link'
|
||||||
import Icon from '../elements/Icon.vue'
|
import Icon from '../elements/Icon.vue'
|
||||||
import Avatar from '../elements/Avatar.vue'
|
import Avatar from '../elements/Avatar.vue'
|
||||||
import { classNames } from '../../utils'
|
import { classNames, omit } from '../../utils'
|
||||||
import { usePopper } from '../../composables/usePopper'
|
import { usePopper } from '../../composables/usePopper'
|
||||||
import type { Avatar as AvatarType } from '../../types/avatar'
|
import type { Avatar as AvatarType } from '../../types/avatar'
|
||||||
import type { PopperOptions } from '../../types'
|
import type { PopperOptions } from '../../types'
|
||||||
@@ -167,12 +172,6 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
const menuProvidesSymbols = Object.getOwnPropertySymbols(menuProvides)
|
const menuProvidesSymbols = Object.getOwnPropertySymbols(menuProvides)
|
||||||
menuApi.value = menuProvidesSymbols.length && menuProvides[menuProvidesSymbols[0]]
|
menuApi.value = menuProvidesSymbols.length && menuProvides[menuProvidesSymbols[0]]
|
||||||
// stop trigger click propagation on hover
|
|
||||||
menuApi.value?.buttonRef?.addEventListener('click', (e: Event) => {
|
|
||||||
if (props.mode === 'hover') {
|
|
||||||
e.stopPropagation()
|
|
||||||
}
|
|
||||||
}, true)
|
|
||||||
}, 200)
|
}, 200)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
widthClass: {
|
widthClass: {
|
||||||
type: String,
|
type: String,
|
||||||
default: () => $ui.tooltip.width
|
default: () => $ui.popover.width
|
||||||
},
|
},
|
||||||
baseClass: {
|
baseClass: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -86,12 +86,6 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
const popoverProvidesSymbols = Object.getOwnPropertySymbols(popoverProvides)
|
const popoverProvidesSymbols = Object.getOwnPropertySymbols(popoverProvides)
|
||||||
popoverApi.value = popoverProvidesSymbols.length && popoverProvides[popoverProvidesSymbols[0]]
|
popoverApi.value = popoverProvidesSymbols.length && popoverProvides[popoverProvidesSymbols[0]]
|
||||||
// stop trigger click propagation on hover
|
|
||||||
popoverApi.value?.button?.addEventListener('click', (e: Event) => {
|
|
||||||
if (props.mode === 'hover') {
|
|
||||||
e.stopPropagation()
|
|
||||||
}
|
|
||||||
}, true)
|
|
||||||
}, 200)
|
}, 200)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user