Merge pull request #2615 from tugcekucukoglu/loadiang-icon

Refactor #2542
pull/2616/head
Tuğçe Küçükoğlu 2022-06-02 11:52:30 +03:00 committed by GitHub
commit 1f9f87c804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -14,7 +14,7 @@
role="searchbox" aria-autocomplete="list" :aria-controls="listId"> role="searchbox" aria-autocomplete="list" :aria-controls="listId">
</li> </li>
</ul> </ul>
<i :class="computedIconClasses" v-if="searching"></i> <i :class="loadingIconClass" v-if="searching"></i>
<Button ref="dropdownButton" type="button" icon="pi pi-chevron-down" class="p-autocomplete-dropdown" :disabled="$attrs.disabled" @click="onDropdownClick" v-if="dropdown"/> <Button ref="dropdownButton" type="button" icon="pi pi-chevron-down" class="p-autocomplete-dropdown" :disabled="$attrs.disabled" @click="onDropdownClick" v-if="dropdown"/>
<Portal :appendTo="appendTo"> <Portal :appendTo="appendTo">
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave"> <transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave">
@ -575,9 +575,6 @@ export default {
} }
}, },
computed: { computed: {
loadingIconClass() {
return ['p-autocomplete-loader', 'pi-spin', this.loadingIcon];
},
containerClass() { containerClass() {
return ['p-autocomplete p-component p-inputwrapper', this.class, { return ['p-autocomplete p-component p-inputwrapper', this.class, {
'p-autocomplete-dd': this.dropdown, 'p-autocomplete-dd': this.dropdown,
@ -605,6 +602,9 @@ export default {
'p-ripple-disabled': this.$primevue.config.ripple === false 'p-ripple-disabled': this.$primevue.config.ripple === false
}]; }];
}, },
loadingIconClass() {
return ['p-autocomplete-loader pi-spin', this.loadingIcon];
},
inputValue() { inputValue() {
if (this.modelValue) { if (this.modelValue) {
if (this.field && typeof this.modelValue === 'object') { if (this.field && typeof this.modelValue === 'object') {

View File

@ -24,7 +24,7 @@
</AutoComplete> </AutoComplete>
<h5>Dropdown, Templating and Force Selection</h5> <h5>Dropdown, Templating and Force Selection</h5>
<AutoComplete v-model="selectedCountry2" :suggestions="filteredCountries" @complete="searchCountry($event)" :dropdown="true" field="name" forceSelection> <AutoComplete v-model="selectedCountry2" loadingIcon="pi pi-discord" :suggestions="filteredCountries" @complete="searchCountry($event)" :dropdown="true" field="name" forceSelection>
<template #item="slotProps"> <template #item="slotProps">
<div class="country-item"> <div class="country-item">
<img src="../../assets/images/flag_placeholder.png" :class="'flag flag-' + slotProps.item.code.toLowerCase()" /> <img src="../../assets/images/flag_placeholder.png" :class="'flag flag-' + slotProps.item.code.toLowerCase()" />

View File

@ -268,17 +268,17 @@ export default {
<td>null</td> <td>null</td>
<td>Style class of the overlay panel.</td> <td>Style class of the overlay panel.</td>
</tr> </tr>
<tr>
<td>virtualScrollerOptions</td>
<td>object</td>
<td>null</td>
<td>Whether to use the virtualScroller feature. The properties of <router-link to="/virtualscroller">VirtualScroller</router-link> component can be used like an object in it.</td>
</tr>
<tr> <tr>
<td>loadingIcon</td> <td>loadingIcon</td>
<td>string</td> <td>string</td>
<td>pi pi-spinner</td> <td>pi pi-spinner</td>
<td>Icon class used when loading</td> <td>Icon class used when loading</td>
</tr>
<tr>
<td>virtualScrollerOptions</td>
<td>object</td>
<td>null</td>
<td>Whether to use the virtualScroller feature. The properties of <router-link to="/virtualscroller">VirtualScroller</router-link> component can be used like an object in it.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>