2023-06-06 11:38:49 +00:00
|
|
|
<script>
|
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
2023-10-02 10:46:09 +00:00
|
|
|
import VirtualScrollerStyle from 'primevue/virtualscroller/style';
|
2023-06-06 11:38:49 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'BaseVirtualScroller',
|
|
|
|
extends: BaseComponent,
|
|
|
|
props: {
|
|
|
|
id: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
style: null,
|
|
|
|
class: null,
|
|
|
|
items: {
|
|
|
|
type: Array,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
itemSize: {
|
|
|
|
type: [Number, Array],
|
|
|
|
default: 0
|
|
|
|
},
|
|
|
|
scrollHeight: null,
|
|
|
|
scrollWidth: null,
|
|
|
|
orientation: {
|
|
|
|
type: String,
|
|
|
|
default: 'vertical'
|
|
|
|
},
|
|
|
|
numToleratedItems: {
|
|
|
|
type: Number,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
delay: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
},
|
|
|
|
resizeDelay: {
|
|
|
|
type: Number,
|
|
|
|
default: 10
|
|
|
|
},
|
|
|
|
lazy: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
loaderDisabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
columns: {
|
|
|
|
type: Array,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
loading: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
showSpacer: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
},
|
|
|
|
showLoader: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
tabindex: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
},
|
|
|
|
inline: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
step: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
},
|
|
|
|
appendOnly: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
autoSize: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
}
|
|
|
|
},
|
2023-10-02 10:46:09 +00:00
|
|
|
style: VirtualScrollerStyle,
|
2023-06-06 11:38:49 +00:00
|
|
|
provide() {
|
|
|
|
return {
|
|
|
|
$parentInstance: this
|
|
|
|
};
|
2023-08-30 09:49:17 +00:00
|
|
|
},
|
|
|
|
beforeMount() {
|
2024-06-17 09:52:12 +00:00
|
|
|
VirtualScrollerStyle.loadStyle({ nonce: this.$primevueConfig?.csp?.nonce });
|
2023-06-06 11:38:49 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|