Skip to content

Commit

Permalink
Refactor #6683 - For DataView
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Oct 30, 2024
1 parent 0bc96d5 commit 8b2ab6d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/primevue/src/dataview/DataView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ export interface DataViewSlots {
*/
layout?: string | undefined;
}): VNode[];
/**
* Custom paginator container template.
*/
paginatorcontainer(): VNode[];
/**
* Custom paginator start template.
*/
Expand Down
34 changes: 33 additions & 1 deletion packages/primevue/src/dataview/DataView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@
:unstyled="unstyled"
:pt="ptm('pcPaginator')"
>
<template v-if="$slots.paginatorcontainer" #container="slotProps">
<slot
name="paginatorcontainer"
:first="slotProps.first"
:last="slotProps.last"
:rows="slotProps.rows"
:page="slotProps.page"
:pageCount="slotProps.pageCount"
:totalRecords="slotProps.totalRecords"
:firstPageCallback="slotProps.firstPageCallback"
:lastPageCallback="slotProps.lastPageCallback"
:prevPageCallback="slotProps.prevPageCallback"
:nextPageCallback="slotProps.nextPageCallback"
:rowChangeCallback="slotProps.rowChangeCallback"
></slot>
</template>
<template v-if="$slots.paginatorstart" #start>
<slot name="paginatorstart"></slot>
</template>
Expand Down Expand Up @@ -51,6 +67,22 @@
:unstyled="unstyled"
:pt="ptm('pcPaginator')"
>
<template v-if="$slots.paginatorcontainer" #container="slotProps">
<slot
name="paginatorcontainer"
:first="slotProps.first"
:last="slotProps.last"
:rows="slotProps.rows"
:page="slotProps.page"
:pageCount="slotProps.pageCount"
:totalRecords="slotProps.totalRecords"
:firstPageCallback="slotProps.firstPageCallback"
:lastPageCallback="slotProps.lastPageCallback"
:prevPageCallback="slotProps.prevPageCallback"
:nextPageCallback="slotProps.nextPageCallback"
:rowChangeCallback="slotProps.rowChangeCallback"
></slot>
</template>
<template v-if="$slots.paginatorstart" #start>
<slot name="paginatorstart"></slot>
</template>
Expand All @@ -65,7 +97,7 @@
</template>

<script>
import { resolveFieldData, localeComparator, sort } from '@primeuix/utils/object';
import { localeComparator, resolveFieldData, sort } from '@primeuix/utils/object';
import Paginator from 'primevue/paginator';
import BaseDataView from './BaseDataView.vue';
Expand Down

0 comments on commit 8b2ab6d

Please sign in to comment.