srcdev-nuxt-components 6.1.12 → 6.1.14
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,7 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="expanding-panel" :class="[elementClasses]">
|
|
3
3
|
<details class="expanding-panel-details" :name :open>
|
|
4
|
-
<summary
|
|
4
|
+
<summary
|
|
5
|
+
@click.prevent="handleToggle"
|
|
6
|
+
@keydown.enter.prevent="handleToggle"
|
|
7
|
+
@keydown.space.prevent="handleToggle"
|
|
8
|
+
class="expanding-panel-summary"
|
|
9
|
+
:id="`id-${name}-trigger`"
|
|
10
|
+
:aria-controls="`id-${name}-content`"
|
|
11
|
+
>
|
|
5
12
|
<span class="label-wrapper">
|
|
6
13
|
<slot name="summary"></slot>
|
|
7
14
|
</span>
|
|
@@ -12,7 +19,12 @@
|
|
|
12
19
|
</span>
|
|
13
20
|
</summary>
|
|
14
21
|
</details>
|
|
15
|
-
<div
|
|
22
|
+
<div
|
|
23
|
+
class="expanding-panel-content"
|
|
24
|
+
:aria-labelledby="`id-${name}-trigger`"
|
|
25
|
+
:id="`id-${name}-content`"
|
|
26
|
+
role="region"
|
|
27
|
+
>
|
|
16
28
|
<div class="inner">
|
|
17
29
|
<slot name="content"></slot>
|
|
18
30
|
</div>
|
|
@@ -45,11 +57,11 @@ const props = defineProps({
|
|
|
45
57
|
})
|
|
46
58
|
|
|
47
59
|
const name = computed(() => props.name || useId())
|
|
48
|
-
|
|
49
|
-
const triggerId = computed(() => `id-${name.value}-trigger`)
|
|
50
|
-
const contentId = computed(() => `id-${name.value}-content`)
|
|
60
|
+
const isPanelOpen = defineModel({ default: false }) as Ref<boolean>
|
|
51
61
|
const animationDurationStr = computed(() => `${props.animationDuration}ms`)
|
|
52
|
-
const open = computed(() =>
|
|
62
|
+
const open = computed(() => {
|
|
63
|
+
return props.forceOpened ? true : isPanelOpen.value
|
|
64
|
+
})
|
|
53
65
|
|
|
54
66
|
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
55
67
|
|
|
@@ -57,6 +69,7 @@ const handleToggle = (event: Event) => {
|
|
|
57
69
|
if (props.forceOpened) {
|
|
58
70
|
event.preventDefault()
|
|
59
71
|
}
|
|
72
|
+
isPanelOpen.value = !isPanelOpen.value
|
|
60
73
|
}
|
|
61
74
|
</script>
|
|
62
75
|
|
|
@@ -81,6 +94,7 @@ const handleToggle = (event: Event) => {
|
|
|
81
94
|
overflow: hidden;
|
|
82
95
|
|
|
83
96
|
.label-wrapper {
|
|
97
|
+
display: inline-block;
|
|
84
98
|
}
|
|
85
99
|
.icon-wrapper {
|
|
86
100
|
display: flex;
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
|
|
58
58
|
{{ link.childLinksTitle }}
|
|
59
59
|
</summary>
|
|
60
|
-
<div class="main-navigation-sub-nav" role="menu"
|
|
60
|
+
<div class="main-navigation-sub-nav" role="menu">
|
|
61
61
|
<ul class="main-navigation-sub-nav-list">
|
|
62
62
|
<li class="main-navigation-sub-nav-item" v-for="childLink in link.childLinks" :key="childLink.name">
|
|
63
63
|
<NuxtLink :to="childLink.path" class="main-navigation-sub-nav-link" role="menuitem">
|
package/package.json
CHANGED