adminforth 4.6.1 → 4.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script setup lang="ts">
|
|
15
|
-
import
|
|
15
|
+
import Spinner from './Spinner.vue';
|
|
16
16
|
import { computed, useAttrs } from 'vue';
|
|
17
17
|
import { type ClassNameValue } from 'tailwind-merge';
|
|
18
18
|
import { getButtonClasses, type ButtonVariant, type ButtonSize } from './buttonStyles';
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
import Button from "./Button.vue";
|
|
69
69
|
import { IconX } from '@iconify-prerendered/vue-lucide';
|
|
70
70
|
import { ref, computed, useId, type Ref } from 'vue';
|
|
71
|
-
import
|
|
71
|
+
import Modal from './Modal.vue';
|
|
72
72
|
import { dialogFooterClasses } from './dialogStyles';
|
|
73
73
|
import { useI18n } from "vue-i18n";
|
|
74
74
|
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
>
|
|
68
68
|
</slot>
|
|
69
69
|
<span v-else-if="!isLoading || props.isLoading" >
|
|
70
|
-
{{ item
|
|
70
|
+
{{ getByPath(item, column.fieldName) }}
|
|
71
71
|
</span>
|
|
72
72
|
<div v-else>
|
|
73
73
|
<div class=" w-full">
|
|
@@ -338,10 +338,13 @@ function getAriaSort(col:{fieldName:string; sortable?:boolean}) {
|
|
|
338
338
|
|
|
339
339
|
const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' });
|
|
340
340
|
|
|
341
|
+
// fieldName may be a dot path into nested objects, e.g. 'user.address.city'
|
|
342
|
+
function getByPath(o:any, p:string) {
|
|
343
|
+
return p.split('.').reduce((a:any,k)=>a?.[k], o);
|
|
344
|
+
}
|
|
345
|
+
|
|
341
346
|
function sortArrayData(data:any[], sortField?:string, dir:'asc'|'desc'='asc') {
|
|
342
347
|
if (!sortField) return data;
|
|
343
|
-
// Helper function to get nested properties by path
|
|
344
|
-
const getByPath = (o:any, p:string) => p.split('.').reduce((a:any,k)=>a?.[k], o);
|
|
345
348
|
return [...data].sort((a,b) => {
|
|
346
349
|
const av = getByPath(a, sortField), bv = getByPath(b, sortField);
|
|
347
350
|
// Handle null/undefined values
|