mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 08:13:34 +03:00
aa229973ec
closes https://github.com/TryGhost/Ghost/issues/9386 - remove usage of `{{one-way-checkbox}}` in favour of direct HTML+handlebars - add `{{gh-text-input}}` that inherits from Ember's built-in `TextInput` component along with our custom `TextInput` mixin - swap all uses of `{{gh-input}}` for `{{gh-text-input}} - remove `{{gh-input}}` component - update `{{gh-textarea}}` to inherit from Ember's `TextArea` component instead of `OneWayTextarea` and update all component uses accordingly - update `{{gh-trim-focus-input}}` to inherit from `{{gh-text-input}}` and update all component uses accordingly - standardize on using the `focus-out` action naming rather than `focusOut` for all text inputs, this is because the text input components (especially `{{gh-trim-focus-input}}`) have their own `focusOut` handler which gets overridden if consumers supply their own `focusOut` attr - drop `ember-one-way-controls` package - add `ember-one-way-select` package
35 lines
1.3 KiB
Handlebars
35 lines
1.3 KiB
Handlebars
<div class="gh-date-time-picker">
|
|
{{#power-datepicker
|
|
selected=_date
|
|
center=_date
|
|
onSelect=(action "setDate" value="date")
|
|
renderInPlace=true
|
|
disabled=disabled as |dp|
|
|
}}
|
|
{{#dp.trigger tabindex="-1" data-test-date-time-picker-datepicker=true}}
|
|
<div class="gh-date-time-picker-date {{if dateError "error"}}">
|
|
<input type="text" readonly value={{moment-format _date "MM/DD/YYYY"}} disabled={{disabled}} data-test-date-time-picker-date-input>
|
|
{{inline-svg "calendar"}}
|
|
</div>
|
|
{{/dp.trigger}}
|
|
{{#dp.content class="dropdown-menu"}}
|
|
{{dp.nav}}
|
|
{{dp.days minDate=_minDate maxDate=_maxDate weekdayFormat="min"}}
|
|
{{/dp.content}}
|
|
{{/power-datepicker}}
|
|
|
|
<div class="gh-date-time-picker-time {{if hasError "error"}}">
|
|
{{gh-text-input
|
|
value=(readonly _time)
|
|
input=(action (mut _time) value="target.value")
|
|
focus-out=(action "setTime" _time)
|
|
disabled=disabled
|
|
data-test-date-time-picker-time-input=true
|
|
}}
|
|
<small class="gh-date-time-picker-timezone">({{timezone}})</small>
|
|
</div>
|
|
</div>
|
|
{{#if hasError}}
|
|
<div class="gh-date-time-picker-error" data-test-date-time-picker-error>{{dateError}}{{timeError}}</div>
|
|
{{/if}}
|