John Cowen 0e730328bd
ui: Disclosure Component amends plus DisclosureMenu Component (#12304)
* ui: Disclosure amends plus DisclosureMenu

Co-authored-by: Jamie White <jamie@jgwhite.co.uk>
2022-02-11 14:11:16 +00:00

25 lines
658 B
Handlebars

<StateChart
@src={{state-chart 'boolean'}}
@initial={{if @expanded 'true' 'false'}}
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
) 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')
))
)) as |api|}}
{{yield api}}
{{/let}}
{{/let}}
</StateChart>