1818
1919 <tbody >
2020 <!-- table header -->
21- <tr class =" t-header sticky z-20 top-0 text-xs bg-lightListTableHeading dark:bg-darkListTableHeading dark:text-gray-400 " >
22- <td scope =" col" class =" list-table-header-cell p-4 sticky-column bg-lightListTableHeading dark:bg-darkListTableHeading" >
21+ <tr class =" t-header sticky z-20 top-0 text-xs text-lightListTableHeadingText bg-lightListTableHeading dark:bg-darkListTableHeading dark:text-darkListTableHeadingText " >
22+ <td scope =" col" class =" list-table-header-cell p-4 sticky-column bg-lightListTableHeading dark:bg-darkListTableHeading" >
2323 <Checkbox
2424 :modelValue =" allFromThisPageChecked"
2525 :disabled =" !rows || !rows.length"
2929 </Checkbox >
3030 </td >
3131
32- <td v-for =" c in columnsListed" ref =" headerRefs" scope =" col" class =" list-table-header-cell px-2 md:px-3 lg:px-6 py-3" :class =" {'sticky-column bg-lightListTableHeading dark:bg-darkListTableHeading': c.listSticky}" >
32+ <td v-for =" c in columnsListed" ref =" headerRefs" scope =" col" class =" list-table-header-cell px-2 md:px-3 lg:px-6 py-3" :class =" {'sticky-column bg-lightListTableHeading dark:bg-darkListTableHeading': c.listSticky}" >
3333
3434 <div @click =" (evt) => c.sortable && onSortButtonClick(evt, c.name)"
3535 class =" flex items-center " :class =" {'cursor-pointer':c.sortable}" >
6969 <SkeleteLoader
7070 v-if =" !rows"
7171 :columns =" resource?.columns.filter((c: AdminForthResourceColumnCommon) => c.showIn?.list).length + 2"
72- :rows =" rowHeights.length || 20 "
72+ :rows =" rowHeights.length || 3 "
7373 :row-heights =" rowHeights"
7474 :column-widths =" columnWidths"
7575 />
116116 >
117117 <span class =" sr-only" >{{ $t('checkbox') }}</span >
118118 </Checkbox >
119- </td >
119+ </td >
120120 <td v-for =" c in columnsListed" class =" px-2 md:px-3 lg:px-6 py-4" :class =" {'sticky-column bg-lightListTable dark:bg-darkListTable': c.listSticky}" >
121121 <!-- if c.name in listComponentsPerColumn, render it. If not, render ValueRenderer -->
122122 <component
177177 <template v-slot :tooltip >
178178 {{ $t('Delete item') }}
179179 </template >
180- </Tooltip >
180+ </Tooltip >
181181 <template v-if =" customActionsInjection " >
182182 <component
183183 v-for =" c in customActionsInjection"
191191 </template >
192192 <template v-if =" resource .options ?.actions " >
193193 <Tooltip
194- v-for =" action in resource.options.actions.filter(a => a.showIn?.list || a.showIn?.listQuickIcon )"
194+ v-for =" action in resource.options.actions.filter(a => a.showIn?.list)"
195195 :key =" action.id"
196196 >
197197 <CallActionWrapper
251251 <!-- pagination
252252 totalRows in v-if is used to not hide page input during loading when user puts cursor into it and edit directly (rows gets null there during edit)
253253 -->
254- <div class =" flex flex-row items-center mt-4 xs:flex-row xs:justify-between xs:items-center gap-3" >
254+ <div class =" af-pagination-container flex flex-row items-center mt-4 xs:flex-row xs:justify-between xs:items-center gap-3" >
255255
256- <div class =" inline-flex "
256+ <div class =" af-pagination-buttons-container inline-flex "
257257 v-if =" (rows || totalRows) && totalRows >= pageSize && totalRows > 0"
258258 >
259259 <!-- Buttons -->
279279 type =" text"
280280 v-model =" pageInput"
281281 :style =" { width: `${Math.max(1, pageInput.length+4)}ch` }"
282- class =" af-pagination-input min-w-10 outline-none inline-block w-auto py-1.5 px-3 text-sm text-center text-lightListTablePaginationCurrentPageText border border-lightListTablePaginationBorder dark:border-darkListTablePaginationBorder dark:text-darkListTablePaginationCurrentPageText dark:bg-darkListTablePaginationBackgoround z-10"
282+ class =" af-pagination-input min-w-10 outline-none inline-block py-1.5 px-3 text-sm text-center text-lightListTablePaginationCurrentPageText border border-lightListTablePaginationBorder dark:border-darkListTablePaginationBorder dark:text-darkListTablePaginationCurrentPageText dark:bg-darkListTablePaginationBackgoround z-10"
283283 @keydown =" onPageKeydown($event)"
284284 @blur =" validatePageInput()"
285- >
286- </input >
285+ />
287286
288287 <button
289288 class =" af-pagination-last-page-button flex items-center py-1 px-3 text-sm font-medium text-lightListTablePaginationText focus:outline-none bg-lightListTablePaginationBackgoround border-l-0 border border-lightListTablePaginationBorder hover:bg-lightListTablePaginationBackgoroundHover hover:text-lightListTablePaginationTextHover focus:z-10 focus:ring-4 focus:ring-lightListTablePaginationFocusRing dark:focus:ring-darkListTablePaginationFocusRing dark:bg-darkListTablePaginationBackgoround dark:text-darkListTablePaginationText dark:border-darkListTablePaginationBorder dark:hover:text-white dark:hover:bg-darkListTablePaginationBackgoroundHover disabled:opacity-50"
309308 <span v-if =" ((((page || 1) - 1) * pageSize + 1 > totalRows) && totalRows > 0)" >{{ $t('Wrong Page') }} </span >
310309 <template v-else-if =" resource && totalRows > 0 " >
311310
312- <span class =" hidden sm:inline" >
311+ <span class =" af-pagination-info hidden sm:inline" >
313312 <i18n-t keypath =" Showing {from} to {to} of {total} Entries" tag =" p" >
314313 <template v-slot :from >
315314 <strong >{{ from }}</strong >
343342<script setup lang="ts">
344343
345344
346- import { computed , onMounted , ref , watch , useTemplateRef , nextTick , type Ref , onUnmounted } from ' vue' ;
345+ import { computed , onMounted , ref , watch , useTemplateRef , nextTick , type Ref } from ' vue' ;
347346import { callAdminForthApi } from ' @/utils' ;
348347import { useI18n } from ' vue-i18n' ;
349348import ValueRenderer from ' @/components/ValueRenderer.vue' ;
@@ -352,18 +351,15 @@ import { useCoreStore } from '@/stores/core';
352351import { showSuccesTost , showErrorTost } from ' @/composables/useFrontendApi' ;
353352import SkeleteLoader from ' @/components/SkeleteLoader.vue' ;
354353import { getIcon } from ' @/utils' ;
355- import {
356- IconInboxOutline ,
357- } from ' @iconify-prerendered/vue-flowbite' ;
358-
359354import {
360355 IconEyeSolid ,
361356 IconPenSolid ,
362- IconTrashBinSolid
357+ IconTrashBinSolid ,
358+ IconInboxOutline
363359} from ' @iconify-prerendered/vue-flowbite' ;
364360import router from ' @/router' ;
365361import { Tooltip } from ' @/afcl' ;
366- import type { AdminForthResourceCommon , AdminForthResourceColumnCommon , AdminForthComponentDeclaration } from ' @/types/Common' ;
362+ import type { AdminForthResourceCommon , AdminForthResourceColumnCommon , AdminForthComponentDeclarationFull } from ' @/types/Common' ;
367363import { useAdminforth } from ' @/adminforth' ;
368364import Checkbox from ' @/afcl/Checkbox.vue' ;
369365import ListActionsThreeDots from ' @/components/ListActionsThreeDots.vue' ;
@@ -387,7 +383,7 @@ const props = defineProps<{
387383 itemHeight? : number ,
388384 bufferSize? : number ,
389385 customActionIconsThreeDotsMenuItems? : any []
390- tableRowReplaceInjection? : AdminForthComponentDeclaration
386+ tableRowReplaceInjection? : AdminForthComponentDeclarationFull
391387}>();
392388
393389// emits, update page
@@ -463,7 +459,7 @@ watch(() => props.rows, (newRows) => {
463459 columnWidths .value = newRows || ! headerRefs .value ? [] : [48 , ... headerRefs .value .map ((el : HTMLElement ) => el .offsetWidth )];
464460});
465461
466- function addToCheckedValues(id : any ) {
462+ function addToCheckedValues(id : string | number ) {
467463 if (checkboxesInternal .value .includes (id )) {
468464 checkboxesInternal .value = checkboxesInternal .value .filter ((item ) => item !== id );
469465 } else {
@@ -499,7 +495,7 @@ const ascArr = computed(() => sort.value.filter((s: any) => s.direction === 'asc
499495const descArr = computed (() => sort .value .filter ((s : any ) => s .direction === ' desc' ).map ((s : any ) => s .field ));
500496
501497
502- function onSortButtonClick(event : any , field : any ) {
498+ function onSortButtonClick(event : any , field : string ) {
503499 // if ctrl key is pressed, add to sort otherwise sort by this field
504500 // in any case if field is already in sort, toggle direction
505501
@@ -524,7 +520,7 @@ function onSortButtonClick(event: any, field: any) {
524520
525521const clickTarget = ref (null );
526522
527- async function onClick(e : any ,row : any ) {
523+ async function onClick(e : any , row : any ) {
528524 if (clickTarget .value === e .target ) return ;
529525 clickTarget .value = e .target ;
530526 await new Promise ((resolve ) => setTimeout (resolve , 100 ));
0 commit comments