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"
|
|
|
|
>
|
2023-01-27 02:21:12 +00:00
|
|
|
{{date-format this.startDate "MMM yyyy"}}
|
2022-01-11 18:05:38 +00:00
|
|
|
-
|
2023-01-27 02:21:12 +00:00
|
|
|
{{date-format this.endDate "MMM yyyy"}}
|
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-06-03 21:22:50 +00:00
|
|
|
<div class="calendar-title is-subtitle-gray">
|
|
|
|
DATE OPTIONS
|
|
|
|
</div>
|
2022-01-11 18:05:38 +00:00
|
|
|
<ul class="menu-list">
|
2023-01-27 02:21:12 +00:00
|
|
|
<li class="action">
|
|
|
|
<button
|
|
|
|
data-test-current-month
|
|
|
|
class="link link-plain has-text-weight-semibold is-ghost"
|
|
|
|
type="button"
|
|
|
|
name="currentMonth"
|
|
|
|
{{on "click" (fn this.handleDateShortcut D.actions)}}
|
|
|
|
>
|
|
|
|
Current month
|
|
|
|
</button>
|
|
|
|
</li>
|
2022-01-11 18:05:38 +00:00
|
|
|
<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"
|
2023-01-27 02:21:12 +00:00
|
|
|
name="reset"
|
|
|
|
{{on "click" (fn this.handleDateShortcut D.actions)}}
|
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">
|
2022-06-03 21:22:50 +00:00
|
|
|
<span class="level-left">
|
|
|
|
Custom end month
|
|
|
|
</span>
|
2022-01-11 18:05:38 +00:00
|
|
|
<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-06-03 21:22:50 +00:00
|
|
|
<p data-test-display-year>
|
|
|
|
{{this.displayYear}}
|
|
|
|
</p>
|
2022-01-11 18:05:38 +00:00
|
|
|
<button
|
2023-01-27 02:21:12 +00:00
|
|
|
data-test-next-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"}}>
|
2022-06-03 21:22:50 +00:00
|
|
|
<p>
|
|
|
|
{{this.tooltipText}}
|
|
|
|
</p>
|
2022-02-10 16:43:40 +00:00
|
|
|
</div>
|
|
|
|
<div class="chart-tooltip-arrow"></div>
|
|
|
|
{{/modal-dialog}}
|
|
|
|
{{/if}}
|
2022-01-11 18:05:38 +00:00
|
|
|
</div>
|
2022-06-03 21:22:50 +00:00
|
|
|
<div class="calendar-widget-grid calendar-widget">
|
2023-01-27 02:21:12 +00:00
|
|
|
{{#each this.widgetMonths as |month|}}
|
2022-01-11 18:05:38 +00:00
|
|
|
<button
|
2023-01-27 02:21:12 +00:00
|
|
|
data-test-calendar-month={{month.name}}
|
2022-01-11 18:05:38 +00:00
|
|
|
type="button"
|
2023-01-27 02:21:12 +00:00
|
|
|
class="is-month-list {{if month.readonly 'is-readOnly'}}"
|
|
|
|
id={{month.index}}
|
|
|
|
{{on "click" (fn this.selectMonth month D.actions)}}
|
2022-01-11 18:05:38 +00:00
|
|
|
>
|
2023-01-27 02:21:12 +00:00
|
|
|
{{month.name}}
|
2022-01-11 18:05:38 +00:00
|
|
|
</button>
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</D.Content>
|
|
|
|
</BasicDropdown>
|