| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<templates id="template" xml:space="preserve"> |
| 3 |
<t t-name="point_of_sale.input"> |
| 4 |
<div t-attf-class="{{props.class}} {{ state.isOpen ? 'flex-grow-1' : '' }} d-flex"> |
| 5 |
<button t-if="props.isSmall" |
| 6 |
class="btn btn-light btn-lg lh-lg" |
| 7 |
t-on-click="() => { |
| 8 |
state.isOpen = !state.isOpen; |
| 9 |
props.isOpenCallback?.(state.isOpen); |
| 10 |
}"> |
| 11 |
<i t-if="state.isOpen" class="fa fa-arrow-right"/> |
| 12 |
<t t-else="props.iconOnLeftSide" t-call="point_of_sale.inputIcon" /> |
| 13 |
</button> |
| 14 |
<div t-if="!props.isSmall || state.isOpen" |
| 15 |
class="input-group"> |
| 16 |
<div class="form-control form-control-lg input-container d-flex align-items-center bg-view" |
| 17 |
t-att-class="{'is-invalid': !props.isValid(getValue())}"> |
| 18 |
<t t-if="props.iconOnLeftSide" t-call="point_of_sale.inputIcon" /> |
| 19 |
<input class="o_input border-0 mx-2 text-body" type="text" style="min-width: 60px;" |
| 20 |
t-on-focus="ev=>ev.target.select()" |
| 21 |
t-att-placeholder="props.placeholder" |
| 22 |
t-ref="input" |
| 23 |
t-att-value="getValue()" |
| 24 |
t-on-input="(event) => this.setValue(event.target.value)" |
| 25 |
t-att-readonly="props.readonly" /> |
| 26 |
<t t-if="!props.iconOnLeftSide" t-call="point_of_sale.inputIcon" /> |
| 27 |
<i t-att-class="{ 'invisible': !getValue() }" class="fa fa-times mx-2" t-on-click="() => this.setValue('')"/> |
| 28 |
</div> |
| 29 |
</div> |
| 30 |
</div> |
| 31 |
</t> |
| 32 |
<t t-name="point_of_sale.inputIcon"> |
| 33 |
<i t-if="props.icon.type === 'fa'" t-attf-class="fa {{props.icon.value}} {{margin}}"/> |
| 34 |
<span t-if="props.icon.type === 'string'" t-attf-class="{{margin}}" t-esc="props.icon.value"/> |
| 35 |
</t> |
| 36 |
|
| 37 |
</templates> |