@hostlink/nuxt-light 1.10.15 → 1.10.17
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.
package/dist/module.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useQuasar, QTable, type QTableColumn, type QTableProps } from 'quasar';
|
|
3
3
|
|
|
4
|
-
import { ref, computed, onMounted, useSlots, useAttrs } from "vue";
|
|
4
|
+
import { ref, computed, onMounted, useSlots, useAttrs, watch, defineComponent, h } from "vue";
|
|
5
5
|
import { t, q, useLight, GQLFieldBuilder, model } from '../';
|
|
6
6
|
import { toQuery } from '@hostlink/light';
|
|
7
7
|
|
|
@@ -57,6 +57,9 @@ const props = withDefaults(defineProps<LTableProps>(), {
|
|
|
57
57
|
noDataLabel: "No data available",
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
+
const isServerSide = (props.rows == undefined);
|
|
61
|
+
|
|
62
|
+
|
|
60
63
|
const light = useLight();
|
|
61
64
|
|
|
62
65
|
const pagination = ref(props.pagination);
|
|
@@ -147,15 +150,12 @@ const table = ref<InstanceType<typeof QTable>>();
|
|
|
147
150
|
|
|
148
151
|
const filters = ref<InstanceType<any>>({});
|
|
149
152
|
const rows = ref<InstanceType<any>>(props.rows);
|
|
153
|
+
if (rows.value == undefined) {
|
|
154
|
+
rows.value = [];
|
|
155
|
+
}
|
|
150
156
|
|
|
151
157
|
onMounted(() => {
|
|
152
|
-
|
|
153
|
-
table.value.requestServerInteraction();
|
|
154
|
-
}
|
|
155
|
-
})
|
|
156
|
-
|
|
157
|
-
const isServerSide = computed(() => {
|
|
158
|
-
return props.rows == undefined;
|
|
158
|
+
table.value && table.value.requestServerInteraction();
|
|
159
159
|
})
|
|
160
160
|
|
|
161
161
|
let primaryKey = ref(props.rowKey);
|
|
@@ -243,7 +243,7 @@ const getData = async (
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
const onRequest = async (p: any) => {
|
|
246
|
-
if (!isServerSide
|
|
246
|
+
if (!isServerSide) return;
|
|
247
247
|
|
|
248
248
|
|
|
249
249
|
let sort = "";
|
|
@@ -511,6 +511,15 @@ const localSelected = computed({
|
|
|
511
511
|
}
|
|
512
512
|
});
|
|
513
513
|
|
|
514
|
+
watch(() => props.rows, (val) => {
|
|
515
|
+
rows.value = val;
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
const computedColumns = computed(() => {
|
|
519
|
+
return props.columns;
|
|
520
|
+
})
|
|
521
|
+
|
|
522
|
+
|
|
514
523
|
|
|
515
524
|
</script>
|
|
516
525
|
|
|
@@ -528,8 +537,8 @@ const localSelected = computed({
|
|
|
528
537
|
</div>
|
|
529
538
|
</template>
|
|
530
539
|
|
|
531
|
-
<q-table v-bind="attrs" :loading="loading" :rows="rows
|
|
532
|
-
|
|
540
|
+
<q-table v-bind="attrs" :loading="loading" :rows="rows" ref="table" @request="onRequest" :columns="columns"
|
|
541
|
+
v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected">
|
|
533
542
|
|
|
534
543
|
<template #header="props">
|
|
535
544
|
<q-tr :props="props">
|
|
@@ -542,6 +551,8 @@ const localSelected = computed({
|
|
|
542
551
|
</q-tr>
|
|
543
552
|
</template>
|
|
544
553
|
|
|
554
|
+
|
|
555
|
+
|
|
545
556
|
<template #body="props">
|
|
546
557
|
<q-tr :props="props">
|
|
547
558
|
<q-td v-if="selection != 'none'" auto-width>
|
|
@@ -570,6 +581,8 @@ const localSelected = computed({
|
|
|
570
581
|
|
|
571
582
|
</q-td>
|
|
572
583
|
|
|
584
|
+
|
|
585
|
+
|
|
573
586
|
<template v-for="col in props.cols">
|
|
574
587
|
<template v-if="ss.indexOf('body-cell-' + col.name) >= 0">
|
|
575
588
|
<slot :name="'body-cell-' + col.name" v-bind="props"></slot>
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare const app: {
|
|
|
6
6
|
isAdmin: boolean;
|
|
7
7
|
permissions: string[];
|
|
8
8
|
myFavorites: any[];
|
|
9
|
-
getColorValue: () =>
|
|
9
|
+
getColorValue: () => string;
|
|
10
10
|
setMyFavorites: (favorites: any[]) => void;
|
|
11
11
|
reloadMyFavorites: () => Promise<void>;
|
|
12
12
|
getMyFavorites: () => any[];
|
|
@@ -19,13 +19,13 @@ declare const app: {
|
|
|
19
19
|
addError: (error: String) => void;
|
|
20
20
|
getErrors: () => String[];
|
|
21
21
|
removeError: (error: String) => void;
|
|
22
|
-
getStyle: (name:
|
|
22
|
+
getStyle: (name: string) => any;
|
|
23
23
|
setStyles: (s: Object) => void;
|
|
24
24
|
getStyles: () => {
|
|
25
25
|
[key: string]: any;
|
|
26
26
|
};
|
|
27
|
-
setStyle: (name:
|
|
28
|
-
setCurrentRoute: (to: any
|
|
27
|
+
setStyle: (name: string, value: any) => Promise<void>;
|
|
28
|
+
setCurrentRoute: (to: any) => void;
|
|
29
29
|
getID: () => number | null;
|
|
30
30
|
init: (styles: any) => void;
|
|
31
31
|
isGranted: (right?: string | undefined) => boolean;
|
|
@@ -46,7 +46,7 @@ export declare const useLight: (options?: {
|
|
|
46
46
|
isAdmin: boolean;
|
|
47
47
|
permissions: string[];
|
|
48
48
|
myFavorites: any[];
|
|
49
|
-
getColorValue: () =>
|
|
49
|
+
getColorValue: () => string;
|
|
50
50
|
setMyFavorites: (favorites: Array<any>) => void;
|
|
51
51
|
reloadMyFavorites: () => Promise<void>;
|
|
52
52
|
getMyFavorites: () => any[];
|
|
@@ -59,13 +59,13 @@ export declare const useLight: (options?: {
|
|
|
59
59
|
addError: (error: String) => void;
|
|
60
60
|
getErrors: () => String[];
|
|
61
61
|
removeError: (error: String) => void;
|
|
62
|
-
getStyle: (name:
|
|
62
|
+
getStyle: (name: string) => any;
|
|
63
63
|
setStyles: (s: Object) => void;
|
|
64
64
|
getStyles: () => {
|
|
65
65
|
[key: string]: any;
|
|
66
66
|
};
|
|
67
|
-
setStyle: (name:
|
|
68
|
-
setCurrentRoute: (to: any
|
|
67
|
+
setStyle: (name: string, value: any) => Promise<void>;
|
|
68
|
+
setCurrentRoute: (to: any) => void;
|
|
69
69
|
getID: () => number | null;
|
|
70
70
|
init: (styles: any) => void;
|
|
71
71
|
isGranted: (right?: string) => boolean;
|
package/dist/runtime/index.mjs
CHANGED