glib-web 4.36.2 → 4.36.3
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/.claude/settings.local.json +9 -0
- package/nav/drawer.vue +14 -3
- package/package.json +1 -1
package/nav/drawer.vue
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
<glib-component v-if="spec.body" :spec="spec.body" />
|
|
14
14
|
|
|
15
|
-
<v-list :dense="true">
|
|
15
|
+
<v-list :dense="true" v-model:opened="openedGroups">
|
|
16
16
|
<div v-for="(item, index) in spec.rows" :key="index" class="nav-item">
|
|
17
17
|
<div v-if="item.type == 'button' && !item.childButtons" class="indicator"></div>
|
|
18
18
|
<v-divider v-if="item.type == 'divider'" />
|
|
19
19
|
<nav-drawerLabel v-else-if="item.type == 'label'" :spec="rowSpec(item)" />
|
|
20
20
|
<template v-else-if="item.childButtons && item.childButtons.length > 0">
|
|
21
|
-
<v-list-group>
|
|
21
|
+
<v-list-group :value="index">
|
|
22
22
|
<template v-slot:activator="{ props }">
|
|
23
23
|
<v-list-item v-bind="props">
|
|
24
24
|
<div class="parent-item">
|
|
@@ -71,11 +71,22 @@ export default {
|
|
|
71
71
|
return { mdAndUp };
|
|
72
72
|
},
|
|
73
73
|
data: function () {
|
|
74
|
+
// Initialize opened groups based on item.expanded
|
|
75
|
+
const openedGroups = [];
|
|
76
|
+
if (this.spec && this.spec.rows) {
|
|
77
|
+
this.spec.rows.forEach((item, index) => {
|
|
78
|
+
if (item.childButtons && item.childButtons.length > 0 && item.expanded) {
|
|
79
|
+
openedGroups.push(index);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
74
84
|
return {
|
|
75
85
|
// Using null as the starting value for its v-model will initialize the drawer as closed on mobile and as open on desktop.
|
|
76
86
|
// See https://vuetifyjs.com/en/components/navigation-drawers
|
|
77
87
|
state: null,
|
|
78
|
-
isExpand: false
|
|
88
|
+
isExpand: false,
|
|
89
|
+
openedGroups: openedGroups
|
|
79
90
|
};
|
|
80
91
|
},
|
|
81
92
|
computed: {
|