open-consul/ui/packages/consul-ui/app/components/disclosure/index.hbs

25 lines
658 B
Handlebars
Raw Normal View History

2022-02-08 19:24:50 +00:00
<StateChart
@src={{state-chart 'boolean'}}
@initial={{if @expanded 'true' 'false'}}
2022-02-08 19:24:50 +00:00
as |State Guard Action dispatch state|>
{{#let (hash
toggle=(fn dispatch 'TOGGLE')
close=(fn dispatch 'FALSE')
open=(fn dispatch 'TRUE')
expanded=(state-matches state 'true')
event=state.context
button=(unique-id)
controls=this.ids
2022-02-08 19:24:50 +00:00
) as |_api|}}
{{#let (assign _api (hash
Action=(component 'disclosure/action' disclosure=_api)
Details=(component 'disclosure/details' disclosure=(hash
add=this.add
remove=this.remove
expanded=(state-matches state 'true')
))
2022-02-08 19:24:50 +00:00
)) as |api|}}
{{yield api}}
2022-02-08 19:24:50 +00:00
{{/let}}
{{/let}}
</StateChart>