Fixed #1447 - Set Paginator Page from InputNumber

pull/1533/head
Cagatay Civici 2021-08-31 16:11:04 +03:00
parent 0ce958ddf3
commit df559cb1e1
39 changed files with 271 additions and 1 deletions

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.286em;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.286em;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.286em;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.286em;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2995,6 +2995,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 1px solid #3f4b5b;

View File

@ -2995,6 +2995,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 1px solid #3f4b5b;

View File

@ -2995,6 +2995,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: #ffffff;
border: 1px solid #dee2e6;

View File

@ -2995,6 +2995,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: #ffffff;
border: 1px solid #dee2e6;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2995,6 +2995,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2995,6 +2995,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2995,6 +2995,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2995,6 +2995,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -3007,6 +3007,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 3rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -3007,6 +3007,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 3rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -3007,6 +3007,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 3rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -3007,6 +3007,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 3rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -3007,6 +3007,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 3rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -3007,6 +3007,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 3rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -3007,6 +3007,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 3rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -3007,6 +3007,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 3rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2995,6 +2995,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2995,6 +2995,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2995,6 +2995,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.357rem;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.286em;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.286em;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.286em;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -2983,6 +2983,13 @@
.p-paginator .p-dropdown .p-dropdown-label {
padding-right: 0;
}
.p-paginator .p-paginator-page-input {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.p-paginator .p-paginator-page-input .p-inputtext {
max-width: 2.286em;
}
.p-paginator .p-paginator-current {
background-color: transparent;
border: 0 none;

View File

@ -25,6 +25,7 @@ let globalDependencies = {
'primevue/progressbar': 'primevue.progressbar',
'primevue/message': 'primevue.message',
'primevue/dropdown': 'primevue.dropdown',
'primevue/inputnumber': 'primevue.inputnumber',
'primevue/menu': 'primevue.menu',
'primevue/tieredmenu': 'primevue.tieredmenu',
'primevue/tree': 'primevue.tree',

View File

@ -0,0 +1,26 @@
<template>
<JTPInput :modelValue="page" @update:modelValue="onChange($event)" class="p-paginator-page-input" :disabled="disabled"></JTPInput>
</template>
<script>
import InputNumber from 'primevue/inputnumber';
export default {
name: 'JumpToPageInput',
inheritAttrs: false,
emits: ['page-change'],
props: {
page: Number,
pageCount: Number,
disabled: Boolean
},
methods: {
onChange(value) {
this.$emit('page-change', value);
}
},
components: {
'JTPInput': InputNumber
}
}
</script>

View File

@ -15,6 +15,7 @@
:options="rowsPerPageOptions" @rows-change="onRowChange($event)" :disabled="empty"/>
<JumpToPageDropdown v-else-if="item === 'JumpToPageDropdown'" :page="page" :pageCount="pageCount"
@page-change="changePage($event)" :disabled="empty"/>
<JumpToPageInput v-else-if="item === 'JumpToPageInput'" :page="page" @page-change="changePage($event)" :disabled="empty"/>
</template>
<div class="p-paginator-right-content" v-if="$slots.right">
<slot name="right" :state="currentState"></slot>
@ -31,6 +32,7 @@ import PageLinks from './PageLinks.vue';
import PrevPageLink from './PrevPageLink.vue';
import RowsPerPageDropdown from './RowsPerPageDropdown.vue';
import JumpToPageDropdown from './JumpToPageDropdown.vue';
import JumpToPageInput from './JumpToPageInput.vue';
export default {
name: 'Paginator',
@ -202,7 +204,8 @@ export default {
'PageLinks': PageLinks,
'PrevPageLink': PrevPageLink,
'RowsPerPageDropdown': RowsPerPageDropdown,
'JumpToPageDropdown': JumpToPageDropdown
'JumpToPageDropdown': JumpToPageDropdown,
'JumpToPageInput': JumpToPageInput
}
}
</script>

View File

@ -54,6 +54,7 @@ import Paginator from 'primevue/paginator';
<li>LastPageLink</li>
<li>RowsPerPageDropdown</li>
<li>JumpToPageDropdown</li>
<li>JumpToPageInput</li>
<li>CurrentPageReport</li>
</ul>

View File

@ -17,6 +17,7 @@ module.exports = {
'primevue/menu': path.resolve(__dirname, 'src/components/menu/Menu.vue'),
'primevue/tieredmenu': path.resolve(__dirname, 'src/components/tieredmenu/TieredMenu.vue'),
'primevue/dropdown': path.resolve(__dirname, 'src/components/dropdown/Dropdown.vue'),
'primevue/inputnumber': path.resolve(__dirname, 'src/components/inputnumber/InputNumber.vue'),
'primevue/paginator': path.resolve(__dirname, 'src/components/paginator/Paginator.vue'),
'primevue/progressbar': path.resolve(__dirname, 'src/components/progressbar/ProgressBar.vue'),
'primevue/message': path.resolve(__dirname, 'src/components/message/Message.vue'),