@@ -22,23 +22,17 @@ const effectiveMode = computed<PaginationMode>(() =>
2222 shouldShowControls .value ? ' paginated' : ' infinite' ,
2323)
2424
25- // When 'all' is selected, there's only 1 page with everything
26- const isShowingAll = computed (() => pageSize .value === ' all' )
27- const totalPages = computed (() =>
28- isShowingAll .value ? 1 : Math .ceil (props .totalItems / (pageSize .value as number )),
29- )
25+ const totalPages = computed (() => Math .ceil (props .totalItems / (pageSize .value as number )))
3026
3127// Whether to show the mode toggle (hidden in table view since table always uses pagination)
3228const showModeToggle = computed (() => props .viewMode !== ' table' )
3329
3430const startItem = computed (() => {
3531 if (props .totalItems === 0 ) return 0
36- if (isShowingAll .value ) return 1
3732 return (currentPage .value - 1 ) * (pageSize .value as number ) + 1
3833})
3934
4035const endItem = computed (() => {
41- if (isShowingAll .value ) return props .totalItems
4236 return Math .min (currentPage .value * (pageSize .value as number ), props .totalItems )
4337})
4438
@@ -106,8 +100,8 @@ const visiblePages = computed(() => {
106100function handlePageSizeChange(event : Event ) {
107101 const target = event .target as HTMLSelectElement
108102 const value = target .value
109- // Handle 'all' as a special string value, otherwise parse as number
110- const newSize = ( value === ' all ' ? ' all ' : Number (value ) ) as PageSize
103+
104+ const newSize = Number (value ) as PageSize
111105 pageSize .value = newSize
112106 // Reset to page 1 when changing page size
113107 currentPage .value = 1
@@ -159,10 +153,7 @@ function handlePageSizeChange(event: Event) {
159153 @change =" handlePageSizeChange"
160154 :items ="
161155 PAGE_SIZE_OPTIONS.map(size => ({
162- label:
163- size === 'all'
164- ? $t('filters.pagination.all_yolo')
165- : $t('filters.pagination.per_page', { count: size }),
156+ label: $t('filters.pagination.per_page', { count: size }),
166157 value: String(size),
167158 }))
168159 "
0 commit comments