1
0
mirror of https://github.com/TryGhost/Ghost.git synced 2024-12-21 18:01:36 +03:00
Ghost/ghost/admin/app/components/gh-date-picker.hbs
Kevin Ansfield ea9c8c03fe
Update dependency ember-template-lint to v5.3.0 ()
refs https://github.com/TryGhost/Ghost/pull/15550

Pulled out of the rolled up node+ember-js+ember-template rollup linter update PR as it required fairly extensive changes.

- bumped package
- renamed `no-down-event-binding` to `no-pointer-down-event-binding`
- disabled `no-pointer-down-event-binding` rule
- disabled `no-triple-curlies` rule
- ran `yarn lint:hbs --fix`
- updated integration tests to match Octane syntax
- fixed various one-off errors
- updated .lint-todo
2023-01-04 09:39:32 +00:00

51 lines
1.9 KiB
Handlebars

<div class="gh-date-picker" ...attributes>
<PowerDatepicker
@selected={{@value}}
@center={{@value}}
@onSelect={{this.onDateSelected}}
@renderInPlace={{true}}
@disabled={{@disabled}}
as |dp|
>
<dp.Trigger @tabindex="-1" data-test-date-picker-trigger>
<div class="{{if this.error "error"}}">
<input
type="text"
placeholder={{this.dateFormat}}
value={{moment-format @value this.dateFormat}}
disabled={{@disabled}}
aria-label="Selected date"
class="gh-input gh-datepicker-input"
{{on "input" (fn this.onDateInput dp)}}
{{on "blur" this.onDateBlur}}
{{on "keydown" (fn this.onDateKeydown dp)}}
{{did-update this.resetInputValue @value}}
data-test-date-picker-input
/>
{{svg-jar "calendar" class="gh-date-picker-cal-icon"}}
</div>
</dp.Trigger>
<dp.Content class="dropdown-menu">
{{#if (has-block)}}
{{yield (assign
dp
(hash
select=this.onDateSelected
Triger=null
Content=null
Nav=dp.Nav
Days=(component dp.Days minDate=this.minDate maxDate=this.maxDate weekdayFormat="min")
)
)}}
{{else}}
<dp.Nav />
<dp.Days @minDate={{this.minDate}} @maxDate={{this.maxDate}} @weekdayFormat="min" />
{{/if}}
</dp.Content>
</PowerDatepicker>
{{#if this.error}}
<div class="gh-date-time-picker-error" data-test-date-picker-error>{{this.error}}</div>
{{/if}}
</div>