2023-05-23 12:44:11 +00:00
|
|
|
<script>
|
2023-10-02 10:46:09 +00:00
|
|
|
import AutoCompleteStyle from 'primevue/autocomplete/style';
|
2023-05-23 12:44:11 +00:00
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'BaseAutoComplete',
|
|
|
|
extends: BaseComponent,
|
|
|
|
props: {
|
|
|
|
modelValue: null,
|
|
|
|
suggestions: {
|
|
|
|
type: Array,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
optionLabel: null,
|
|
|
|
optionDisabled: null,
|
|
|
|
optionGroupLabel: null,
|
|
|
|
optionGroupChildren: null,
|
|
|
|
scrollHeight: {
|
|
|
|
type: String,
|
2024-03-26 14:21:39 +00:00
|
|
|
default: '14rem'
|
2023-05-23 12:44:11 +00:00
|
|
|
},
|
|
|
|
dropdown: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
dropdownMode: {
|
|
|
|
type: String,
|
|
|
|
default: 'blank'
|
|
|
|
},
|
|
|
|
multiple: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2023-08-10 08:38:09 +00:00
|
|
|
loading: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2024-01-31 08:02:53 +00:00
|
|
|
variant: {
|
|
|
|
type: String,
|
2024-02-02 11:46:26 +00:00
|
|
|
default: null
|
2024-01-31 08:02:53 +00:00
|
|
|
},
|
2024-01-30 11:27:56 +00:00
|
|
|
invalid: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2023-05-23 12:44:11 +00:00
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
placeholder: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
dataKey: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
minLength: {
|
|
|
|
type: Number,
|
|
|
|
default: 1
|
|
|
|
},
|
|
|
|
delay: {
|
|
|
|
type: Number,
|
|
|
|
default: 300
|
|
|
|
},
|
|
|
|
appendTo: {
|
2024-01-08 09:33:05 +00:00
|
|
|
type: [String, Object],
|
2023-05-23 12:44:11 +00:00
|
|
|
default: 'body'
|
|
|
|
},
|
|
|
|
forceSelection: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
completeOnFocus: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
inputId: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputStyle: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputClass: {
|
|
|
|
type: [String, Object],
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
panelStyle: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
panelClass: {
|
|
|
|
type: [String, Object],
|
|
|
|
default: null
|
|
|
|
},
|
2024-05-10 11:24:01 +00:00
|
|
|
overlayStyle: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
overlayClass: {
|
|
|
|
type: [String, Object],
|
|
|
|
default: null
|
|
|
|
},
|
2023-05-23 12:44:11 +00:00
|
|
|
dropdownIcon: {
|
|
|
|
type: String,
|
2024-05-03 11:46:02 +00:00
|
|
|
default: null
|
2023-05-23 12:44:11 +00:00
|
|
|
},
|
|
|
|
dropdownClass: {
|
|
|
|
type: [String, Object],
|
|
|
|
default: null
|
|
|
|
},
|
2024-05-15 10:47:01 +00:00
|
|
|
loader: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
2023-05-23 12:44:11 +00:00
|
|
|
loadingIcon: {
|
|
|
|
type: String,
|
2024-05-03 11:46:02 +00:00
|
|
|
default: null
|
2023-05-23 12:44:11 +00:00
|
|
|
},
|
|
|
|
removeTokenIcon: {
|
|
|
|
type: String,
|
2024-05-03 11:46:02 +00:00
|
|
|
default: null
|
|
|
|
},
|
|
|
|
chipIcon: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
2023-05-23 12:44:11 +00:00
|
|
|
},
|
|
|
|
virtualScrollerOptions: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
autoOptionFocus: {
|
|
|
|
type: Boolean,
|
2024-01-17 09:44:08 +00:00
|
|
|
default: false
|
2023-05-23 12:44:11 +00:00
|
|
|
},
|
|
|
|
selectOnFocus: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2024-01-23 13:08:06 +00:00
|
|
|
focusOnHover: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
},
|
2023-05-23 12:44:11 +00:00
|
|
|
searchLocale: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
searchMessage: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
selectionMessage: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
emptySelectionMessage: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
emptySearchMessage: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
tabindex: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
},
|
2024-05-15 10:47:01 +00:00
|
|
|
typeahead: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
},
|
2023-11-24 12:21:54 +00:00
|
|
|
ariaLabel: {
|
2023-05-23 12:44:11 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
2023-11-24 12:21:54 +00:00
|
|
|
ariaLabelledby: {
|
2023-05-23 12:44:11 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
2023-10-02 10:46:09 +00:00
|
|
|
style: AutoCompleteStyle,
|
2023-05-30 11:03:42 +00:00
|
|
|
provide() {
|
|
|
|
return {
|
2024-04-25 01:26:06 +00:00
|
|
|
$pcAutoComplete: this,
|
2023-05-30 11:03:42 +00:00
|
|
|
$parentInstance: this
|
|
|
|
};
|
2023-05-23 12:44:11 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|