seach text development when options select

This commit is contained in:
Burak Civan 2022-06-21 15:55:06 +03:00
parent 752090e832
commit ae55e4eb06
3 changed files with 34 additions and 7 deletions

View File

@ -31,9 +31,9 @@
<input <input
v-if="!show_date" v-if="!show_date"
type="text" type="text"
class="w-full bg-transparent text-black text-sm border-0 px-10 pb-0 focus:outline-none focus:ring-transparent focus:border-purple-100" class="w-full bg-transparent text-black text-sm border-0 pb-0 focus:outline-none focus:ring-transparent focus:border-purple-100"
:class="[{'px-4' : !show_icon}]" :class="!show_icon ? 'px-4' : 'px-10'"
:placeholder="placeholder" :placeholder="dynamicPlaceholder"
:ref="'input-search-field-' + _uid" :ref="'input-search-field-' + _uid"
v-model="search" v-model="search"
@focus="onInputFocus" @focus="onInputFocus"
@ -47,8 +47,9 @@
@on-open="onInputFocus" @on-open="onInputFocus"
@blur="onBlur" @blur="onBlur"
:config="dateConfig" :config="dateConfig"
class="w-full bg-transparent text-black text-sm border-0 px-10 pb-0 focus:outline-none focus:ring-transparent focus:border-purple-100 datepicker" class="w-full bg-transparent text-black text-sm border-0 pb-0 focus:outline-none focus:ring-transparent focus:border-purple-100 datepicker"
:placeholder="placeholder" :class="!show_icon ? 'px-4' : 'px-10'"
:placeholder="dynamicPlaceholder"
:ref="'input-search-date-field-' + _uid" :ref="'input-search-date-field-' + _uid"
value="" value=""
@focus="onInputFocus" @focus="onInputFocus"
@ -56,7 +57,13 @@
@keyup.enter="onInputConfirm" @keyup.enter="onInputConfirm"
> >
</flat-picker> </flat-picker>
<span class="material-icons absolute bottom-1 ltr:left-3 rtl:right-3 text-lg text-black" style="z-index:-1;">search</span> <span
v-if="show_icon"
class="material-icons absolute bottom-1 ltr:left-3 rtl:right-3 text-lg text-black"
style="z-index:-1;"
>
search
</span>
<button type="button" class="absolute ltr:right-0 rtl:left-0 top-2 clear" v-if="show_close_icon" @click="onSearchAndFilterClear"> <button type="button" class="absolute ltr:right-0 rtl:left-0 top-2 clear" v-if="show_close_icon" @click="onSearchAndFilterClear">
<span class="material-icons text-sm">close</span> <span class="material-icons text-sm">close</span>
@ -126,6 +133,12 @@ export default {
default: 'Search or filter results...', default: 'Search or filter results...',
description: 'Input placeholder' description: 'Input placeholder'
}, },
selectPlaceholder: {
type: String,
},
enterPlaceholder: {
type: String,
},
searchText: { searchText: {
type: String, type: String,
default: 'Search for this text', default: 'Search for this text',
@ -200,7 +213,9 @@ export default {
show_close_icon: false, show_close_icon: false,
show_icon: true, show_icon: true,
equal_image: app_url + "/public/img/tailwind_icons/not-equal.svg", equal_image: app_url + "/public/img/tailwind_icons/not-equal.svg",
input_focus: false input_focus: false,
defaultPlaceholder: this.placeholder,
dynamicPlaceholder: this.placeholder,
}; };
}, },
@ -374,6 +389,8 @@ export default {
this.current_value = value; this.current_value = value;
this.range = false; this.range = false;
this.dynamicPlaceholder = this.selectPlaceholder;
let option = false; let option = false;
let option_url = false; let option_url = false;
@ -505,6 +522,8 @@ export default {
this.show_close_icon = true; this.show_close_icon = true;
let select_value = false; let select_value = false;
this.dynamicPlaceholder = this.enterPlaceholder;
for (let i = 0; i < this.values.length; i++) { for (let i = 0; i < this.values.length; i++) {
if (this.values[i].key == value) { if (this.values[i].key == value) {
select_value = this.values[i].value; select_value = this.values[i].value;
@ -562,6 +581,10 @@ export default {
this.show_date = false; this.show_date = false;
if (this.filter_index == 0) {
this.dynamicPlaceholder = this.defaultPlaceholder;
}
this.filter_last_step = 'options'; this.filter_last_step = 'options';
}, },

View File

@ -270,6 +270,8 @@ return [
'placeholder' => [ 'placeholder' => [
'search' => 'Type to search..', 'search' => 'Type to search..',
'search_and_filter' => 'Search or filter results..', 'search_and_filter' => 'Search or filter results..',
'select_and_filter' => 'Select one of the available options below',
'enter_and_filter' => 'Hit enter to filter the results, or set a new filter',
'contact_search' => 'Type a :type name', 'contact_search' => 'Type a :type name',
'item_search' => 'Type an item name', 'item_search' => 'Type an item name',
], ],

View File

@ -1,5 +1,7 @@
<akaunting-search <akaunting-search
placeholder="{{ (!empty($filters)) ? trans('general.placeholder.search_and_filter') : trans('general.search_placeholder')}}" placeholder="{{ (!empty($filters)) ? trans('general.placeholder.search_and_filter') : trans('general.search_placeholder')}}"
select-placeholder="{{ trans('general.placeholder.select_and_filter') }}"
enter-placeholder="{{ trans('general.placeholder.enter_and_filter') }}"
search-text="{{ trans('general.search_text') }}" search-text="{{ trans('general.search_text') }}"
operator-is-text="{{ trans('general.is') }}" operator-is-text="{{ trans('general.is') }}"
operator-is-not-text="{{ trans('general.isnot') }}" operator-is-not-text="{{ trans('general.isnot') }}"