2023-05-23 09:13:26 +00:00
|
|
|
<script>
|
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
2024-04-18 14:17:41 +00:00
|
|
|
import SelectStyle from 'primevue/select/style';
|
2023-05-23 09:13:26 +00:00
|
|
|
|
|
|
|
export default {
|
2024-04-18 14:17:41 +00:00
|
|
|
name: 'BaseSelect',
|
2023-05-23 09:13:26 +00:00
|
|
|
extends: BaseComponent,
|
|
|
|
props: {
|
|
|
|
modelValue: null,
|
|
|
|
options: Array,
|
2023-08-01 05:29:19 +00:00
|
|
|
optionLabel: [String, Function],
|
|
|
|
optionValue: [String, Function],
|
|
|
|
optionDisabled: [String, Function],
|
|
|
|
optionGroupLabel: [String, Function],
|
|
|
|
optionGroupChildren: [String, Function],
|
2023-05-23 09:13:26 +00:00
|
|
|
scrollHeight: {
|
|
|
|
type: String,
|
2024-03-26 14:21:39 +00:00
|
|
|
default: '14rem'
|
2023-05-23 09:13:26 +00:00
|
|
|
},
|
|
|
|
filter: Boolean,
|
|
|
|
filterPlaceholder: String,
|
|
|
|
filterLocale: String,
|
|
|
|
filterMatchMode: {
|
|
|
|
type: String,
|
|
|
|
default: 'contains'
|
|
|
|
},
|
|
|
|
filterFields: {
|
|
|
|
type: Array,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
editable: Boolean,
|
|
|
|
placeholder: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
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 09:13:26 +00:00
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
dataKey: null,
|
|
|
|
showClear: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
inputId: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputClass: {
|
|
|
|
type: [String, Object],
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputStyle: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
2024-05-03 20:53:04 +00:00
|
|
|
labelId: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
labelClass: {
|
|
|
|
type: [String, Object],
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
labelStyle: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
2023-05-23 09:13:26 +00:00
|
|
|
panelClass: {
|
|
|
|
type: [String, Object],
|
|
|
|
default: null
|
|
|
|
},
|
2024-05-03 20:53:04 +00:00
|
|
|
overlayStyle: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
overlayClass: {
|
|
|
|
type: [String, Object],
|
|
|
|
default: null
|
|
|
|
},
|
2023-05-23 09:13:26 +00:00
|
|
|
panelStyle: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
appendTo: {
|
2024-01-08 09:33:05 +00:00
|
|
|
type: [String, Object],
|
2023-05-23 09:13:26 +00:00
|
|
|
default: 'body'
|
|
|
|
},
|
|
|
|
loading: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
clearIcon: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
dropdownIcon: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
filterIcon: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
loadingIcon: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
resetFilterOnHide: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2024-01-16 11:15:32 +00:00
|
|
|
resetFilterOnClear: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2023-05-23 09:13:26 +00:00
|
|
|
virtualScrollerOptions: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
autoOptionFocus: {
|
|
|
|
type: Boolean,
|
2024-01-17 09:44:08 +00:00
|
|
|
default: false
|
2023-05-23 09:13:26 +00:00
|
|
|
},
|
|
|
|
autoFilterFocus: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
selectOnFocus: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2024-01-23 13:08:06 +00:00
|
|
|
focusOnHover: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
},
|
2024-01-24 10:44:00 +00:00
|
|
|
highlightOnSelect: {
|
|
|
|
type: Boolean,
|
2024-01-24 11:26:29 +00:00
|
|
|
default: true
|
2024-01-24 10:44:00 +00:00
|
|
|
},
|
2024-01-24 12:30:47 +00:00
|
|
|
checkmark: {
|
2024-01-24 10:44:00 +00:00
|
|
|
type: Boolean,
|
2024-01-24 11:26:29 +00:00
|
|
|
default: false
|
2024-01-24 10:44:00 +00:00
|
|
|
},
|
2023-05-23 09:13:26 +00:00
|
|
|
filterMessage: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
selectionMessage: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
emptySelectionMessage: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
emptyFilterMessage: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
emptyMessage: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
tabindex: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
},
|
2023-11-24 12:15:40 +00:00
|
|
|
ariaLabel: {
|
2023-05-23 09:13:26 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
2023-11-24 12:15:40 +00:00
|
|
|
ariaLabelledby: {
|
2023-05-23 09:13:26 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
2024-04-18 14:17:41 +00:00
|
|
|
style: SelectStyle,
|
2023-05-30 11:03:42 +00:00
|
|
|
provide() {
|
|
|
|
return {
|
2024-04-25 01:26:06 +00:00
|
|
|
$pcSelect: this,
|
2023-05-30 11:03:42 +00:00
|
|
|
$parentInstance: this
|
|
|
|
};
|
2023-05-23 09:13:26 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|