2022-09-06 12:03:37 +00:00
|
|
|
<template>
|
2024-04-18 14:28:41 +00:00
|
|
|
<RPPSelect
|
2023-05-30 13:39:08 +00:00
|
|
|
:modelValue="rows"
|
|
|
|
:options="rowsOptions"
|
|
|
|
optionLabel="label"
|
|
|
|
optionValue="value"
|
|
|
|
@update:modelValue="onChange($event)"
|
2023-06-20 10:03:34 +00:00
|
|
|
:class="cx('rowPerPageDropdown')"
|
2023-05-30 13:39:08 +00:00
|
|
|
:disabled="disabled"
|
2023-06-05 08:10:25 +00:00
|
|
|
:unstyled="unstyled"
|
2023-06-20 10:03:34 +00:00
|
|
|
:pt="ptm('rowPerPageDropdown')"
|
2023-08-28 09:20:55 +00:00
|
|
|
data-pc-group-section="pagedropdown"
|
2023-09-06 08:50:14 +00:00
|
|
|
>
|
|
|
|
<template v-if="templates['rowsperpagedropdownicon']" #dropdownicon="slotProps">
|
|
|
|
<component :is="templates['rowsperpagedropdownicon']" :class="slotProps.class" />
|
|
|
|
</template>
|
2024-04-18 14:28:41 +00:00
|
|
|
</RPPSelect>
|
2022-09-06 12:03:37 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-05-08 09:35:25 +00:00
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
2024-04-18 14:28:41 +00:00
|
|
|
import Select from 'primevue/select';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'RowsPerPageDropdown',
|
2023-07-04 06:29:36 +00:00
|
|
|
hostName: 'Paginator',
|
2023-05-08 09:35:25 +00:00
|
|
|
extends: BaseComponent,
|
2022-09-06 12:03:37 +00:00
|
|
|
emits: ['rows-change'],
|
|
|
|
props: {
|
|
|
|
options: Array,
|
|
|
|
rows: Number,
|
2023-09-06 08:50:14 +00:00
|
|
|
disabled: Boolean,
|
|
|
|
templates: null
|
2022-09-06 12:03:37 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onChange(value) {
|
|
|
|
this.$emit('rows-change', value);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
rowsOptions() {
|
|
|
|
let opts = [];
|
2022-09-14 11:26:01 +00:00
|
|
|
|
2022-09-06 12:03:37 +00:00
|
|
|
if (this.options) {
|
2022-09-14 11:26:01 +00:00
|
|
|
for (let i = 0; i < this.options.length; i++) {
|
|
|
|
opts.push({ label: String(this.options[i]), value: this.options[i] });
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
2022-09-14 11:26:01 +00:00
|
|
|
|
2022-09-06 12:03:37 +00:00
|
|
|
return opts;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
2024-04-18 14:28:41 +00:00
|
|
|
RPPSelect: Select
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
2022-09-14 11:26:01 +00:00
|
|
|
};
|
2022-09-06 12:03:37 +00:00
|
|
|
</script>
|