Compare commits

..

4 Commits

Author SHA1 Message Date
Benjamin Canac
275fa1831d chore(release): 0.1.22 2022-12-19 18:27:36 +01:00
Benjamin Canac
8b5e08f6f2 chore(Tooltip): add prevent prop 2022-12-19 18:27:19 +01:00
Benjamin Canac
1635f57de6 chore(release): 0.1.21 2022-12-19 16:22:41 +01:00
Sylvain Marroufin
b3e0122001 chore(SelectCustom): add emit on open/close (#125) 2022-12-19 16:22:15 +01:00
4 changed files with 20 additions and 4 deletions

View File

@@ -2,6 +2,10 @@
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.22](https://github.com/nuxtlabs/ui/compare/v0.1.21...v0.1.22) (2022-12-19)
### [0.1.21](https://github.com/nuxtlabs/ui/compare/v0.1.20...v0.1.21) (2022-12-19)
### [0.1.20](https://github.com/nuxtlabs/ui/compare/v0.1.19...v0.1.20) (2022-12-19) ### [0.1.20](https://github.com/nuxtlabs/ui/compare/v0.1.19...v0.1.20) (2022-12-19)

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nuxthq/ui", "name": "@nuxthq/ui",
"version": "0.1.20", "version": "0.1.22",
"repository": "https://github.com/nuxtlabs/ui", "repository": "https://github.com/nuxtlabs/ui",
"license": "MIT", "license": "MIT",
"exports": { "exports": {

View File

@@ -84,7 +84,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed } from 'vue' import { ref, computed, watch } from 'vue'
import type { PropType, ComponentPublicInstance } from 'vue' import type { PropType, ComponentPublicInstance } from 'vue'
import { defu } from 'defu' import { defu } from 'defu'
import { import {
@@ -261,7 +261,7 @@ const props = defineProps({
} }
}) })
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue', 'open', 'close'])
const popperOptions = computed<PopperOptions>(() => defu({}, props.popperOptions, $ui.selectCustom.popperOptions)) const popperOptions = computed<PopperOptions>(() => defu({}, props.popperOptions, $ui.selectCustom.popperOptions))
@@ -307,6 +307,14 @@ const iconWrapperClass = classNames(
$ui.selectCustom.icon.trailing.wrapper $ui.selectCustom.icon.trailing.wrapper
) )
watch(container, (value) => {
if (value) {
emit('open')
} else {
emit('close')
}
})
function resolveOptionClass ({ active, selected, disabled }: { active: boolean, selected: boolean, disabled?: boolean }) { function resolveOptionClass ({ active, selected, disabled }: { active: boolean, selected: boolean, disabled?: boolean }) {
return classNames( return classNames(
props.listOptionBaseClass, props.listOptionBaseClass,

View File

@@ -4,7 +4,7 @@
Hover me Hover me
</slot> </slot>
<div v-if="open" ref="container" :class="[containerClass, widthClass]"> <div v-if="open && !prevent" ref="container" :class="[containerClass, widthClass]">
<transition appear v-bind="transitionClass"> <transition appear v-bind="transitionClass">
<div :class="[baseClass, backgroundClass, roundedClass, shadowClass, ringClass]"> <div :class="[baseClass, backgroundClass, roundedClass, shadowClass, ringClass]">
<slot name="text"> <slot name="text">
@@ -36,6 +36,10 @@ const props = defineProps({
type: String, type: String,
default: null default: null
}, },
prevent: {
type: Boolean,
default: false
},
shortcuts: { shortcuts: {
type: Array as PropType<string[]>, type: Array as PropType<string[]>,
default: () => [] default: () => []