Browse Source

Merge pull request #6039 from gitstart/NCDBOSS-57

NCDBOSS-57 - 🐛 Bug: the position of "next" and "previous" buttons in forms is confusing for RTL languages
pull/6065/head
Pranav C 1 year ago committed by GitHub
parent
commit
caa5772cde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      packages/nc-gui/components/smartsheet/Pagination.vue

13
packages/nc-gui/components/smartsheet/Pagination.vue

@ -1,10 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import { ChangePageInj, PaginationDataInj, computed, iconMap, inject } from '#imports' import { ChangePageInj, PaginationDataInj, computed, iconMap, inject, isRtlLang, useI18n } from '#imports'
import type { Language } from '~/lib'
const props = defineProps<{ const props = defineProps<{
alignCountOnRight?: boolean alignCountOnRight?: boolean
}>() }>()
const { locale } = useI18n()
const paginatedData = inject(PaginationDataInj)! const paginatedData = inject(PaginationDataInj)!
const changePage = inject(ChangePageInj)! const changePage = inject(ChangePageInj)!
@ -19,6 +22,8 @@ const page = computed({
changePage?.(p) changePage?.(p)
}, },
}) })
const isRTLLanguage = computed(() => isRtlLang(locale.value as keyof typeof Language))
</script> </script>
<template> <template>
@ -39,6 +44,7 @@ const page = computed({
v-model:page-size="size" v-model:page-size="size"
size="small" size="small"
class="!text-xs !m-1 nc-pagination" class="!text-xs !m-1 nc-pagination"
:class="{ 'rtl-pagination': isRTLLanguage }"
:total="count" :total="count"
show-less-items show-less-items
:show-size-changer="false" :show-size-changer="false"
@ -77,4 +83,9 @@ const page = computed({
:deep(.ant-pagination-item-link) { :deep(.ant-pagination-item-link) {
@apply text-gray-500 flex items-center justify-center; @apply text-gray-500 flex items-center justify-center;
} }
:deep(.rtl-pagination .ant-pagination-prev .ant-pagination-item-link),
:deep(.rtl-pagination .ant-pagination-next .ant-pagination-item-link) {
@apply transform rotate-180;
}
</style> </style>

Loading…
Cancel
Save