srcdev-nuxt-components 0.0.31 → 0.0.32
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.
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ClientOnly>
|
|
3
|
-
<button
|
|
3
|
+
<button :popovertarget popovertargetaction="toggle" class="popover-trigger" :class="[elementClasses]">
|
|
4
4
|
<slot name="trigger"></slot>
|
|
5
5
|
</button>
|
|
6
6
|
|
|
7
|
-
<dialog
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
<button @click.prevent="closePopover()">x</button>
|
|
11
|
-
<slot name="popoverCotent"></slot>
|
|
12
|
-
</div>
|
|
13
|
-
</focus-trap>
|
|
7
|
+
<dialog popover role="tooltip" :id="popovertarget" :class="[elementClasses]">
|
|
8
|
+
<button :popovertarget popovertargetaction="hide">x</button>
|
|
9
|
+
<slot name="popoverCotent"></slot>
|
|
14
10
|
</dialog>
|
|
15
11
|
</ClientOnly>
|
|
16
12
|
</template>
|
|
17
13
|
|
|
18
14
|
<script setup lang="ts">
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const { popovertarget, styleClassPassthrough } = defineProps({
|
|
15
|
+
const props = defineProps({
|
|
22
16
|
popovertarget: {
|
|
23
17
|
type: String,
|
|
24
18
|
required: true,
|
|
@@ -31,74 +25,44 @@ const { popovertarget, styleClassPassthrough } = defineProps({
|
|
|
31
25
|
|
|
32
26
|
const anchorName = `--anchor-${useId()}`;
|
|
33
27
|
|
|
34
|
-
const { elementClasses } = useStyleClassPassthrough(styleClassPassthrough);
|
|
35
|
-
|
|
36
|
-
const open = ref<boolean>(false);
|
|
37
|
-
|
|
38
|
-
const showPopover = () => {
|
|
39
|
-
console.log('showPopover()');
|
|
40
|
-
open.value = true;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const closePopover = () => {
|
|
44
|
-
console.log('closePopover()');
|
|
45
|
-
open.value = false;
|
|
46
|
-
};
|
|
28
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
47
29
|
</script>
|
|
48
30
|
|
|
49
|
-
<style lang="css">
|
|
50
|
-
@
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@position-try --top {
|
|
57
|
-
inset: auto;
|
|
58
|
-
bottom: anchor(top);
|
|
59
|
-
right: anchor(right);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/* @layer popover-setup { */
|
|
63
|
-
.popover-trigger {
|
|
64
|
-
anchor-name: v-bind(anchorName);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.dialog-popover {
|
|
68
|
-
/* backdrop-filter: blur(5px);
|
|
69
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
70
|
-
border: 0;
|
|
71
|
-
padding: 0; */
|
|
72
|
-
|
|
73
|
-
display: none;
|
|
74
|
-
position: absolute;
|
|
75
|
-
position-anchor: v-bind(anchorName);
|
|
76
|
-
margin: 0;
|
|
77
|
-
inset: auto;
|
|
78
|
-
bottom: anchor(bottom);
|
|
79
|
-
left: anchor(right);
|
|
80
|
-
opacity: 0;
|
|
81
|
-
transition: opacity 200ms, display 200ms, overlay 200ms;
|
|
82
|
-
transition-behavior: allow-discrete;
|
|
31
|
+
<style scoped lang="css">
|
|
32
|
+
@layer popover-setup {
|
|
33
|
+
.popover-trigger {
|
|
34
|
+
anchor-name: v-bind(anchorName);
|
|
35
|
+
}
|
|
83
36
|
|
|
84
|
-
|
|
85
|
-
|
|
37
|
+
dialog {
|
|
38
|
+
display: none;
|
|
39
|
+
position: absolute;
|
|
40
|
+
position-anchor: v-bind(anchorName);
|
|
41
|
+
margin: 0;
|
|
42
|
+
inset: auto;
|
|
43
|
+
bottom: anchor(bottom);
|
|
44
|
+
left: anchor(right);
|
|
45
|
+
opacity: 0;
|
|
46
|
+
transition: opacity 200ms, display 200ms, overlay 200ms;
|
|
47
|
+
transition-behavior: allow-discrete;
|
|
86
48
|
|
|
87
|
-
|
|
88
|
-
display: block;
|
|
89
|
-
opacity: 1;
|
|
49
|
+
position-try-fallbacks: --left;
|
|
90
50
|
|
|
91
|
-
|
|
51
|
+
&:popover-open {
|
|
92
52
|
display: block;
|
|
93
|
-
opacity:
|
|
53
|
+
opacity: 1;
|
|
54
|
+
|
|
55
|
+
@starting-style {
|
|
56
|
+
display: block;
|
|
57
|
+
opacity: 0;
|
|
58
|
+
}
|
|
94
59
|
}
|
|
95
60
|
}
|
|
96
|
-
}
|
|
97
61
|
|
|
98
|
-
|
|
62
|
+
@position-try --left {
|
|
99
63
|
inset: auto;
|
|
100
64
|
top: anchor(bottom);
|
|
101
65
|
right: anchor(right);
|
|
102
|
-
}
|
|
103
|
-
|
|
66
|
+
}
|
|
67
|
+
}
|
|
104
68
|
</style>
|
package/package.json
CHANGED