2022-01-11 18:05:38 +00:00
|
|
|
<BasicDropdown @class="popup-menu" @horizontalPosition="auto-right" @verticalPosition="below" as |D|>
|
|
|
|
<D.Trigger
|
|
|
|
data-test-popup-menu-trigger="true"
|
|
|
|
class={{concat "toolbar-link" (if D.isOpen " is-active")}}
|
|
|
|
@htmlTag="button"
|
|
|
|
>
|
2022-01-18 20:17:24 +00:00
|
|
|
{{@startTimeDisplay}}
|
2022-01-11 18:05:38 +00:00
|
|
|
-
|
2022-01-18 20:17:24 +00:00
|
|
|
{{@endTimeDisplay}}
|
2022-01-11 18:05:38 +00:00
|
|
|
<Chevron @direction="down" @isButton={{true}} />
|
|
|
|
</D.Trigger>
|
2022-02-17 23:52:06 +00:00
|
|
|
<D.Content @defaultClass={{concat "popup-menu-content calendar-content" (if this.showCalendar " calendar-open")}}>
|
2022-01-11 18:05:38 +00:00
|
|
|
<nav class="box menu">
|
2022-02-02 19:46:59 +00:00
|
|
|
<div class="calendar-title is-subtitle-gray">DATE OPTIONS</div>
|
2022-01-11 18:05:38 +00:00
|
|
|
<ul class="menu-list">
|
|
|
|
<li class="action">
|
|
|
|
<button
|
2022-02-17 23:52:06 +00:00
|
|
|
data-test-current-billing-period
|
2022-01-11 18:05:38 +00:00
|
|
|
class="link link-plain has-text-weight-semibold is-ghost"
|
|
|
|
type="button"
|
2022-02-01 20:45:01 +00:00
|
|
|
{{on "click" (fn this.selectCurrentBillingPeriod D)}}
|
2022-01-11 18:05:38 +00:00
|
|
|
>
|
|
|
|
Current billing period
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
<li class="action">
|
|
|
|
<button
|
2022-02-17 23:52:06 +00:00
|
|
|
data-test-show-calendar
|
2022-01-18 20:17:24 +00:00
|
|
|
class={{concat "link link-plain has-text-weight-semibold is-ghost" (if this.showCalendar " is-active")}}
|
2022-01-11 18:05:38 +00:00
|
|
|
type="button"
|
|
|
|
{{on "click" this.toggleShowCalendar}}
|
|
|
|
>
|
|
|
|
<div class="level is-mobile">
|
|
|
|
<span class="level-left">Custom end month</span>
|
|
|
|
<Chevron class="has-text-grey-light level-right" />
|
|
|
|
</div>
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
{{#if this.showCalendar}}
|
2022-02-17 23:52:06 +00:00
|
|
|
<div class="calendar-widget-container" data-test-calendar-widget-container>
|
2022-01-11 18:05:38 +00:00
|
|
|
<div class="select-year">
|
2022-02-10 16:43:40 +00:00
|
|
|
<button
|
2022-02-17 23:52:06 +00:00
|
|
|
data-test-previous-year
|
2022-02-10 16:43:40 +00:00
|
|
|
id="previous-year"
|
|
|
|
type="button"
|
|
|
|
class="button is-transparent"
|
|
|
|
disabled={{this.disablePastYear}}
|
|
|
|
{{on "click" this.subYear}}
|
|
|
|
>
|
|
|
|
<Chevron
|
|
|
|
@direction="left"
|
|
|
|
@size="s"
|
|
|
|
class="has-text-grey"
|
|
|
|
{{on "mouseover" this.addTooltip}}
|
|
|
|
{{on "mouseleave" this.removeTooltip}}
|
|
|
|
/>
|
2022-01-11 18:05:38 +00:00
|
|
|
</button>
|
2022-02-17 23:52:06 +00:00
|
|
|
<p data-test-display-year>{{this.displayYear}}</p>
|
2022-01-11 18:05:38 +00:00
|
|
|
<button
|
2022-02-17 23:52:06 +00:00
|
|
|
data-test-future-year
|
2022-01-11 18:05:38 +00:00
|
|
|
type="button"
|
2022-02-10 16:43:40 +00:00
|
|
|
class={{concat "button is-transparent " (if (or this.tooltipTarget) "negative-margin" "padding-right")}}
|
2022-01-11 18:05:38 +00:00
|
|
|
disabled={{this.disableFutureYear}}
|
|
|
|
{{on "click" this.addYear}}
|
|
|
|
>
|
|
|
|
<Chevron @direction="right" @size="s" class="has-text-grey" />
|
|
|
|
</button>
|
2022-02-10 16:43:40 +00:00
|
|
|
{{#if this.tooltipTarget}}
|
|
|
|
{{! Component must be in curly bracket notation }}
|
|
|
|
{{! template-lint-disable no-curly-component-invocation }}
|
|
|
|
{{#modal-dialog
|
|
|
|
tagName="div"
|
|
|
|
tetherTarget=this.tooltipTarget
|
|
|
|
targetAttachment="top right"
|
|
|
|
attachment="top middle"
|
|
|
|
offset="150px 0"
|
|
|
|
}}
|
|
|
|
<div class={{"calendar-tooltip"}}>
|
|
|
|
<p>{{this.tooltipText}}</p>
|
|
|
|
</div>
|
|
|
|
<div class="chart-tooltip-arrow"></div>
|
|
|
|
{{/modal-dialog}}
|
|
|
|
{{/if}}
|
2022-01-11 18:05:38 +00:00
|
|
|
</div>
|
|
|
|
<div {{did-insert this.disableMonths}} class="calendar-widget-grid calendar-widget">
|
2022-02-01 20:45:01 +00:00
|
|
|
{{#each @arrayOfMonths as |month index|}}
|
2022-01-11 18:05:38 +00:00
|
|
|
<button
|
2022-02-17 23:52:06 +00:00
|
|
|
data-test-calendar-month={{month}}
|
2022-01-11 18:05:38 +00:00
|
|
|
type="button"
|
2022-02-01 20:45:01 +00:00
|
|
|
{{on "click" (fn this.selectEndMonth index this.displayYear D)}}
|
2022-01-11 18:05:38 +00:00
|
|
|
class="is-month-list"
|
|
|
|
id={{concat index "-" this.displayYear}}
|
|
|
|
>
|
|
|
|
{{month}}
|
|
|
|
</button>
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</D.Content>
|
|
|
|
</BasicDropdown>
|