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-02-18 16:44:15 +00:00
|
|
|
<div class={{position}}>
|
2020-01-22 12:08:29 +00:00
|
|
|
<input type="checkbox" id={{concat 'popover-menu-' guid '-'}} />
|
|
|
|
{{#each submenus as |sub|}}
|
|
|
|
<input type="checkbox" id={{concat 'popover-menu-' guid '-' sub}} />
|
|
|
|
{{/each}}
|
2019-12-17 18:47:37 +00:00
|
|
|
{{#yield-slot name='header'}}
|
|
|
|
<div>
|
|
|
|
{{yield}}
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
{{/yield-slot}}
|
2020-01-22 12:08:29 +00:00
|
|
|
<ul role="menu" id={{ariaControls}} aria-labelledby={{ariaLabelledBy}} aria-expanded={{ariaExpanded}}>
|
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>
|
2019-12-17 18:47:37 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
2020-02-19 19:26:38 +00:00
|
|
|
</AriaMenu>
|