2020-01-22 12:08:29 +00:00
|
|
|
{{yield (concat 'popover-menu-' guid)}}
|
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">
|
2019-12-17 18:47:37 +00:00
|
|
|
{{yield}}
|
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-10 16:40:22 +00:00
|
|
|
<MenuPanel @position={{position}} id={{ariaControls}} aria-labelledby={{ariaLabelledBy}} aria-expanded={{ariaExpanded}}>
|
|
|
|
<BlockSlot @name="controls">
|
|
|
|
<input type="checkbox" id={{concat 'popover-menu-' guid '-'}} />
|
|
|
|
{{#each submenus as |sub|}}
|
|
|
|
<input type="checkbox" id={{concat 'popover-menu-' guid '-' sub}} />
|
|
|
|
{{/each}}
|
|
|
|
</BlockSlot>
|
|
|
|
{{#if hasHeader}}
|
|
|
|
<BlockSlot @name="header">
|
|
|
|
{{#yield-slot name="header"}}{{yield}}{{else}}{{/yield-slot}}
|
|
|
|
</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}}>
|
2019-12-17 18:47:37 +00:00
|
|
|
{{yield}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</YieldSlot>
|
2020-06-10 16:40:22 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</MenuPanel>
|
2020-02-19 19:26:38 +00:00
|
|
|
</AriaMenu>
|