|
|
@ -1,6 +1,10 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import { ChangePageInj, PaginationDataInj, computed, iconMap, inject } from '#imports' |
|
|
|
import { ChangePageInj, PaginationDataInj, computed, iconMap, inject } from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{ |
|
|
|
|
|
|
|
alignCountOnRight?: boolean |
|
|
|
|
|
|
|
}>() |
|
|
|
|
|
|
|
|
|
|
|
const paginatedData = inject(PaginationDataInj)! |
|
|
|
const paginatedData = inject(PaginationDataInj)! |
|
|
|
|
|
|
|
|
|
|
|
const changePage = inject(ChangePageInj)! |
|
|
|
const changePage = inject(ChangePageInj)! |
|
|
@ -19,11 +23,15 @@ const page = computed({ |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="flex items-center mb-1"> |
|
|
|
<div class="flex items-center mb-1"> |
|
|
|
<span v-if="count !== null && count !== Infinity" class="caption ml-5 text-gray-500" data-testid="grid-pagination"> |
|
|
|
<div class="flex-1"> |
|
|
|
|
|
|
|
<span |
|
|
|
|
|
|
|
v-if="!alignCountOnRight && count !== null && count !== Infinity" |
|
|
|
|
|
|
|
class="caption ml-5 text-gray-500" |
|
|
|
|
|
|
|
data-testid="grid-pagination" |
|
|
|
|
|
|
|
> |
|
|
|
{{ count }} {{ count !== 1 ? $t('objects.records') : $t('objects.record') }} |
|
|
|
{{ count }} {{ count !== 1 ? $t('objects.records') : $t('objects.record') }} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="flex-1" /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-pagination |
|
|
|
<a-pagination |
|
|
|
v-if="count !== Infinity" |
|
|
|
v-if="count !== Infinity" |
|
|
@ -44,7 +52,15 @@ const page = computed({ |
|
|
|
</a-input> |
|
|
|
</a-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex-1" /> |
|
|
|
<div class="flex-1 text-right pr-2"> |
|
|
|
|
|
|
|
<span |
|
|
|
|
|
|
|
v-if="alignCountOnRight && count !== null && count !== Infinity" |
|
|
|
|
|
|
|
class="caption mr-5 text-gray-500" |
|
|
|
|
|
|
|
data-testid="grid-pagination" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{{ count }} {{ count !== 1 ? $t('objects.records') : $t('objects.record') }} |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|