pimelon-ui 0.1.50 → 0.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import Tooltip from './Tooltip.vue'
|
|
|
4
4
|
import Button from '../Button.vue'
|
|
5
5
|
|
|
6
6
|
const placement = ref('top')
|
|
7
|
+
const disabled = ref(true)
|
|
7
8
|
</script>
|
|
8
9
|
<template>
|
|
9
10
|
<Story :layout="{ type: 'grid', width: '300px' }">
|
|
@@ -16,6 +17,16 @@ const placement = ref('top')
|
|
|
16
17
|
<Button theme="red">Delete</Button>
|
|
17
18
|
</Tooltip>
|
|
18
19
|
</Variant>
|
|
20
|
+
<Variant title="disabled">
|
|
21
|
+
<Tooltip
|
|
22
|
+
text="disabled tooltip"
|
|
23
|
+
:disabled="disabled"
|
|
24
|
+
:hover-delay="1"
|
|
25
|
+
:placement="placement"
|
|
26
|
+
>
|
|
27
|
+
<Button theme="red">Delete</Button>
|
|
28
|
+
</Tooltip>
|
|
29
|
+
</Variant>
|
|
19
30
|
<Variant title="with slot">
|
|
20
31
|
<Tooltip arrow-class="fill-white" :placement="placement">
|
|
21
32
|
<template #body>
|
|
@@ -21,12 +21,14 @@ const props = withDefaults(
|
|
|
21
21
|
hoverDelay?: number
|
|
22
22
|
placement?: TooltipContentProps['side']
|
|
23
23
|
arrowClass?: HTMLAttributes['class']
|
|
24
|
+
disabled?: boolean
|
|
24
25
|
}>(),
|
|
25
26
|
{
|
|
26
27
|
text: '',
|
|
27
28
|
placement: 'top',
|
|
28
29
|
hoverDelay: 0.5,
|
|
29
30
|
arrowClass: 'fill-gray-900',
|
|
31
|
+
disabled: false,
|
|
30
32
|
}
|
|
31
33
|
)
|
|
32
34
|
|
|
@@ -34,7 +36,8 @@ const delayDuration = computed(() => props.hoverDelay * 1000)
|
|
|
34
36
|
</script>
|
|
35
37
|
|
|
36
38
|
<template>
|
|
37
|
-
<
|
|
39
|
+
<slot v-if="disabled" />
|
|
40
|
+
<TooltipProvider v-else :delayDuration="delayDuration">
|
|
38
41
|
<TooltipRoot>
|
|
39
42
|
<TooltipTrigger as-child>
|
|
40
43
|
<slot />
|
|
@@ -44,6 +47,7 @@ const delayDuration = computed(() => props.hoverDelay * 1000)
|
|
|
44
47
|
v-if="props.text || $slots.body"
|
|
45
48
|
:side="props.placement"
|
|
46
49
|
:side-offset="4"
|
|
50
|
+
class="z-10"
|
|
47
51
|
>
|
|
48
52
|
<slot name="body">
|
|
49
53
|
<div
|