2020-06-23 09:12:04 +00:00
|
|
|
{{yield}}
|
2020-02-19 19:26:38 +00:00
|
|
|
<AriaMenu @keyboardAccess={{keyboardAccess}} as |change keypress ariaLabelledBy ariaControls ariaExpanded keypressClick|>
|
2020-03-24 10:55:45 +00:00
|
|
|
<ToggleButton
|
|
|
|
@checked={{if keyboardAccess ariaExpanded expanded}}
|
|
|
|
@onchange={{queue change (action "change")}}
|
|
|
|
as |api|>
|
|
|
|
<Ref @target={{this}} @name="toggle" @value={{api}} />
|
|
|
|
<button type="button" aria-haspopup="menu" onkeydown={{keypress}} onclick={{this.toggle.click}} id={{ariaLabelledBy}} aria-controls={{ariaControls}}>
|
2020-02-19 19:26:38 +00:00
|
|
|
<YieldSlot @name="trigger">
|
2020-06-23 09:12:04 +00:00
|
|
|
{{yield (hash
|
|
|
|
addSubmenu=(action 'addSubmenu')
|
|
|
|
removeSubmenu=(action 'removeSubmenu')
|
|
|
|
)}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</YieldSlot>
|
2019-12-17 18:47:37 +00:00
|
|
|
</button>
|
2020-02-19 19:26:38 +00:00
|
|
|
</ToggleButton>
|
2020-06-23 09:12:04 +00:00
|
|
|
<MenuPanel @position={{position}} id={{ariaControls}} aria-labelledby={{ariaLabelledBy}} aria-expanded={{ariaExpanded}} as |api|>
|
2020-06-09 10:10:14 +00:00
|
|
|
<BlockSlot @name="controls">
|
|
|
|
<input type="checkbox" id={{concat 'popover-menu-' guid '-'}} />
|
2020-06-23 09:12:04 +00:00
|
|
|
{{#each submenus as |sub|}}
|
|
|
|
<input type="checkbox" id={{concat 'popover-menu-' guid '-' sub}} onchange={{api.change}} />
|
|
|
|
{{/each}}
|
2020-06-09 10:10:14 +00:00
|
|
|
</BlockSlot>
|
|
|
|
{{#if hasHeader}}
|
|
|
|
<BlockSlot @name="header">
|
2020-06-23 09:12:04 +00:00
|
|
|
{{yield (hash
|
|
|
|
addSubmenu=(action 'addSubmenu')
|
|
|
|
removeSubmenu=(action 'removeSubmenu')
|
|
|
|
)}}
|
|
|
|
{{#yield-slot name="header"}}{{else}}{{/yield-slot}}
|
2020-06-09 10:10:14 +00:00
|
|
|
</BlockSlot>
|
|
|
|
{{/if}}
|
|
|
|
<BlockSlot @name="menu">
|
2020-03-24 10:55:45 +00:00
|
|
|
<YieldSlot @name="menu" @params={{block-params (concat "popover-menu-" guid "-") send keypressClick this.toggle.click}}>
|
2020-06-23 09:12:04 +00:00
|
|
|
{{yield (hash
|
|
|
|
addSubmenu=(action 'addSubmenu')
|
|
|
|
removeSubmenu=(action 'removeSubmenu')
|
|
|
|
)}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</YieldSlot>
|
2020-06-09 10:10:14 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</MenuPanel>
|
2020-02-19 19:26:38 +00:00
|
|
|
</AriaMenu>
|