2023-05-25 13:53:42 +00:00
|
|
|
<script>
|
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
2023-10-02 10:46:09 +00:00
|
|
|
import ListboxStyle from 'primevue/listbox/style';
|
2023-05-25 13:53:42 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'BaseListbox',
|
|
|
|
extends: BaseComponent,
|
|
|
|
props: {
|
|
|
|
modelValue: null,
|
|
|
|
options: Array,
|
|
|
|
optionLabel: null,
|
|
|
|
optionValue: null,
|
|
|
|
optionDisabled: null,
|
|
|
|
optionGroupLabel: null,
|
|
|
|
optionGroupChildren: null,
|
|
|
|
listStyle: null,
|
2024-03-26 14:21:39 +00:00
|
|
|
scrollHeight: {
|
|
|
|
type: String,
|
|
|
|
default: '14rem'
|
|
|
|
},
|
2024-01-30 11:27:56 +00:00
|
|
|
invalid: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2023-11-22 13:09:26 +00:00
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2023-05-25 13:53:42 +00:00
|
|
|
dataKey: null,
|
2023-11-22 13:09:26 +00:00
|
|
|
multiple: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
metaKeySelection: {
|
|
|
|
type: Boolean,
|
2023-12-20 10:28:13 +00:00
|
|
|
default: false
|
2023-11-22 13:09:26 +00:00
|
|
|
},
|
2023-05-25 13:53:42 +00:00
|
|
|
filter: Boolean,
|
|
|
|
filterPlaceholder: String,
|
|
|
|
filterLocale: String,
|
|
|
|
filterMatchMode: {
|
|
|
|
type: String,
|
|
|
|
default: 'contains'
|
|
|
|
},
|
|
|
|
filterFields: {
|
|
|
|
type: Array,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
virtualScrollerOptions: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
autoOptionFocus: {
|
|
|
|
type: Boolean,
|
2024-01-23 14:16:20 +00:00
|
|
|
default: true
|
2023-05-25 13:53:42 +00:00
|
|
|
},
|
|
|
|
selectOnFocus: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2024-01-23 13:08:06 +00:00
|
|
|
focusOnHover: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
},
|
2024-05-09 10:02:54 +00:00
|
|
|
highlightOnSelect: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
},
|
|
|
|
checkmark: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2023-05-25 13:53:42 +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
|
|
|
|
},
|
|
|
|
filterIcon: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
2024-05-27 06:39:11 +00:00
|
|
|
striped: {
|
2024-03-21 13:52:26 +00:00
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
2023-05-25 13:53:42 +00:00
|
|
|
tabindex: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
},
|
2023-11-24 12:15:40 +00:00
|
|
|
ariaLabel: {
|
2023-05-25 13:53:42 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
2023-11-24 12:15:40 +00:00
|
|
|
ariaLabelledby: {
|
2023-05-25 13:53:42 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
2023-10-02 10:46:09 +00:00
|
|
|
style: ListboxStyle,
|
2023-05-30 11:06:57 +00:00
|
|
|
provide() {
|
|
|
|
return {
|
2024-04-25 01:26:06 +00:00
|
|
|
$pcListbox: this,
|
2023-05-30 11:06:57 +00:00
|
|
|
$parentInstance: this
|
|
|
|
};
|
2023-05-25 13:53:42 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|