@hostlink/nuxt-light 0.0.101 → 0.0.102
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,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useQuasar, QTable } from 'quasar';
|
|
2
|
+
import { useQuasar, QTable, is } from 'quasar';
|
|
3
3
|
import { ref, computed, onMounted, useSlots, useAttrs } from "vue";
|
|
4
4
|
import { t, deleteObject, q, useLight, GQLFieldBuilder } from '../';
|
|
5
5
|
import { toQuery } from '@hostlink/light';
|
|
@@ -77,6 +77,7 @@ const props = defineProps({
|
|
|
77
77
|
}
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
+
|
|
80
81
|
const pagination = ref(props.pagination);
|
|
81
82
|
|
|
82
83
|
if (props.rowsPerPageOptions[0] == 0) {
|
|
@@ -189,6 +190,10 @@ onMounted(() => {
|
|
|
189
190
|
}
|
|
190
191
|
})
|
|
191
192
|
|
|
193
|
+
const isServerSide = computed(() => {
|
|
194
|
+
return props.rows == undefined;
|
|
195
|
+
})
|
|
196
|
+
|
|
192
197
|
let primaryKey = ref(props.rowKey);
|
|
193
198
|
const modelName = ref(props.modelName);
|
|
194
199
|
|
|
@@ -272,6 +277,8 @@ const getData = async (
|
|
|
272
277
|
}
|
|
273
278
|
|
|
274
279
|
const onRequest = async (p: any) => {
|
|
280
|
+
if (!isServerSide.value) return;
|
|
281
|
+
|
|
275
282
|
|
|
276
283
|
let sort = "";
|
|
277
284
|
if (p.pagination.sortBy) {
|
|
@@ -289,6 +296,7 @@ const onRequest = async (p: any) => {
|
|
|
289
296
|
builder.add(col.gqlField);
|
|
290
297
|
}
|
|
291
298
|
|
|
299
|
+
if (!col.name) return;
|
|
292
300
|
if (col.name.startsWith("_")) {
|
|
293
301
|
return;
|
|
294
302
|
}
|
|
@@ -497,6 +505,7 @@ const isDark = computed(() => {
|
|
|
497
505
|
rows:{{ props.rows }}
|
|
498
506
|
</template>
|
|
499
507
|
|
|
508
|
+
|
|
500
509
|
<q-table v-bind="attrs" :row-key="rowKey" :loading="loading" :rows="rows" ref="table" @request="onRequest"
|
|
501
510
|
:rows-per-page-label="$t(props.rowsPerPageLabel)" :columns="renderColumns"
|
|
502
511
|
:rows-per-page-options="rowsPerPageOptions" :selection="selection" v-model:pagination="pagination" :filter="filter"
|
|
@@ -546,7 +555,7 @@ const isDark = computed(() => {
|
|
|
546
555
|
|
|
547
556
|
|
|
548
557
|
|
|
549
|
-
<template #top-row="props" v-if="hasSearch">
|
|
558
|
+
<template #top-row="props" v-if="hasSearch && isServerSide">
|
|
550
559
|
<q-tr>
|
|
551
560
|
<q-td v-if="selection != 'none'" auto-width>
|
|
552
561
|
|