2020-02-16 18:30:00 +00:00
|
|
|
<template>
|
2020-03-01 03:37:02 +00:00
|
|
|
<div
|
|
|
|
class="ft-input-component"
|
2020-06-02 02:42:29 +00:00
|
|
|
:class="{
|
|
|
|
search: isSearch,
|
2021-09-06 10:09:11 +00:00
|
|
|
forceTextColor: forceTextColor,
|
2021-10-01 07:38:33 +00:00
|
|
|
showActionButton: showActionButton,
|
2021-09-06 10:09:11 +00:00
|
|
|
showClearTextButton: showClearTextButton
|
2020-06-02 02:42:29 +00:00
|
|
|
}"
|
2020-03-01 03:37:02 +00:00
|
|
|
>
|
2020-06-02 02:42:29 +00:00
|
|
|
<label
|
|
|
|
v-if="showLabel"
|
|
|
|
:for="id"
|
|
|
|
>
|
|
|
|
{{ placeholder }}
|
2020-10-19 15:32:53 +00:00
|
|
|
<ft-tooltip
|
|
|
|
v-if="tooltip !== ''"
|
|
|
|
class="selectTooltip"
|
2021-01-11 15:29:55 +00:00
|
|
|
position="bottom"
|
2020-10-19 15:32:53 +00:00
|
|
|
:tooltip="tooltip"
|
|
|
|
/>
|
2020-06-02 02:42:29 +00:00
|
|
|
</label>
|
2021-09-06 10:09:11 +00:00
|
|
|
<font-awesome-icon
|
2021-10-01 07:38:33 +00:00
|
|
|
v-if="showClearTextButton && clearTextButtonExisting"
|
2021-09-06 10:09:11 +00:00
|
|
|
icon="times-circle"
|
|
|
|
class="clearInputTextButton"
|
2021-09-23 06:45:14 +00:00
|
|
|
:class="{
|
2021-10-01 07:38:33 +00:00
|
|
|
visible: clearTextButtonVisible
|
2021-09-23 06:45:14 +00:00
|
|
|
}"
|
2021-09-06 10:09:11 +00:00
|
|
|
tabindex="0"
|
|
|
|
role="button"
|
2021-09-23 06:45:14 +00:00
|
|
|
:title="$t('Search Bar.Clear Input')"
|
2021-09-06 10:09:11 +00:00
|
|
|
@click="handleClearTextClick"
|
|
|
|
@keydown.space.prevent="handleClearTextClick"
|
|
|
|
@keydown.enter.prevent="handleClearTextClick"
|
|
|
|
/>
|
2020-02-16 18:30:00 +00:00
|
|
|
<input
|
|
|
|
:id="id"
|
2020-06-19 19:58:59 +00:00
|
|
|
v-model="inputData"
|
2020-06-19 20:20:06 +00:00
|
|
|
:list="idDataList"
|
2020-02-16 18:30:00 +00:00
|
|
|
class="ft-input"
|
|
|
|
type="text"
|
|
|
|
:placeholder="placeholder"
|
2020-08-24 02:56:33 +00:00
|
|
|
:disabled="disabled"
|
2021-06-15 14:42:37 +00:00
|
|
|
:spellcheck="spellcheck"
|
2020-09-02 03:25:06 +00:00
|
|
|
@input="e => handleInput(e.target.value)"
|
2021-04-15 19:30:26 +00:00
|
|
|
@focus="handleFocus"
|
2020-12-11 18:14:11 +00:00
|
|
|
@blur="handleInputBlur"
|
|
|
|
@keydown="e => handleKeyDown(e.keyCode)"
|
2020-02-16 18:30:00 +00:00
|
|
|
>
|
|
|
|
<font-awesome-icon
|
2021-10-01 07:38:33 +00:00
|
|
|
v-if="showActionButton"
|
|
|
|
:icon="actionButtonIconName"
|
2020-02-16 18:30:00 +00:00
|
|
|
class="inputAction"
|
2021-10-01 07:38:33 +00:00
|
|
|
:class="{
|
|
|
|
enabled: inputDataPresent
|
|
|
|
}"
|
2020-03-01 03:37:02 +00:00
|
|
|
@click="handleClick"
|
2020-02-16 18:30:00 +00:00
|
|
|
/>
|
2020-12-11 18:14:11 +00:00
|
|
|
|
|
|
|
<div class="options">
|
|
|
|
<ul
|
|
|
|
v-if="inputData !== '' && dataList.length > 0 && searchState.showOptions"
|
|
|
|
:id="idDataList"
|
2021-02-15 15:44:09 +00:00
|
|
|
class="list"
|
2020-12-11 18:14:11 +00:00
|
|
|
@mouseenter="searchState.isPointerInList = true"
|
|
|
|
@mouseleave="searchState.isPointerInList = false"
|
|
|
|
>
|
|
|
|
<li
|
|
|
|
v-for="(list, index) in dataList"
|
|
|
|
:key="index"
|
|
|
|
:class="searchState.selectedOption == index ? 'hover': ''"
|
|
|
|
@click="handleOptionClick(index)"
|
|
|
|
@mouseenter="searchState.selectedOption = index"
|
|
|
|
>
|
|
|
|
{{ list }}
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2020-02-16 18:30:00 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./ft-input.js" />
|
|
|
|
<style scoped src="./ft-input.css" />
|