File tree 2 files changed +16
-1
lines changed
packages/app-frontend/src/features/components 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ export default defineComponent({
41
41
isExpandedUndefined,
42
42
isComponentOpen,
43
43
toggleExpand : toggle,
44
+ forceToggleExpandAll : forceToggleAll,
44
45
subscribeToComponentTree,
45
46
} = useComponent (instance )
46
47
@@ -149,6 +150,7 @@ export default defineComponent({
149
150
select ,
150
151
expanded ,
151
152
toggle ,
153
+ forceToggleAll ,
152
154
highlight ,
153
155
unhighlight ,
154
156
selectNextSibling ,
@@ -180,7 +182,8 @@ export default defineComponent({
180
182
:class =" {
181
183
'invisible': !instance.hasChildren
182
184
}"
183
- @click.stop =" toggle()"
185
+ @click.exact.stop =" toggle()"
186
+ @click.alt.exact.stop =" forceToggleAll(instance, !expanded)"
184
187
>
185
188
<span
186
189
:class =" {
Original file line number Diff line number Diff line change @@ -144,6 +144,17 @@ export function useComponent (instance: Ref<ComponentTreeNode>) {
144
144
}
145
145
}
146
146
147
+ function forceToggleExpandAll ( instance , isOpen ) {
148
+ if ( ! instance . hasChildren ) return
149
+ setComponentOpen ( instance . id , isOpen )
150
+ if ( isComponentOpen ( instance . id ) ) {
151
+ requestComponentTree ( instance . id )
152
+ }
153
+ instance . children . forEach ( child => {
154
+ forceToggleExpandAll ( child , isOpen )
155
+ } )
156
+ }
157
+
147
158
const isSelected = computed ( ( ) => selectedComponentId . value === instance . value . id )
148
159
149
160
function select ( id = instance . value . id ) {
@@ -179,6 +190,7 @@ export function useComponent (instance: Ref<ComponentTreeNode>) {
179
190
isExpandedUndefined,
180
191
isComponentOpen,
181
192
toggleExpand,
193
+ forceToggleExpandAll,
182
194
isSelected,
183
195
select,
184
196
subscribeToComponentTree,
You can’t perform that action at this time.
0 commit comments