@hostlink/nuxt-light 1.10.14 → 1.10.16

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
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.10.14"
4
+ "version": "1.10.16"
5
5
  }
@@ -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 } from "vue";
5
5
  import { t, q, useLight, GQLFieldBuilder, model } from '../';
6
6
  import { toQuery } from '@hostlink/light';
7
7
 
@@ -54,7 +54,7 @@ const props = withDefaults(defineProps<LTableProps>(), {
54
54
  minimizable: false,
55
55
  selected: () => [],
56
56
  loadingLabel: "Loading...",
57
- noDataLabel: "No data available",
57
+ noDataLabel: "No data available",
58
58
  });
59
59
 
60
60
  const light = useLight();
@@ -152,8 +152,11 @@ onMounted(() => {
152
152
  if (table.value) {
153
153
  table.value.requestServerInteraction();
154
154
  }
155
+
155
156
  })
156
157
 
158
+
159
+
157
160
  const isServerSide = computed(() => {
158
161
  return props.rows == undefined;
159
162
  })
@@ -337,8 +340,18 @@ const onRequest = async (p: any) => {
337
340
  }
338
341
  }
339
342
  loading.value = true;
340
- const allData = await getData(operation, localFilters, sort, this.offset, this.limit, builder.get());
341
- this.setData(allData);
343
+ try {
344
+ const allData = await getData(operation, localFilters, sort, this.offset, this.limit, builder.get());
345
+ this.setData(allData);
346
+ } catch (e: any) {
347
+ quasar.dialog({
348
+ message: e,
349
+ color: "negative"
350
+ })
351
+ this.setData({ data: [], meta: { total: 0, key: "", name: "" } });
352
+ }
353
+
354
+
342
355
 
343
356
  }
344
357
  }
@@ -399,14 +412,14 @@ const ss = Object.entries(slots).map(([key, value]) => {
399
412
  return key;
400
413
  });
401
414
 
402
- const qua = useQuasar();
415
+ const quasar = useQuasar();
403
416
  const onDelete = async (id: any) => {
404
417
  if (modelName.value == null) return;
405
418
 
406
419
  try {
407
420
  await model(modelName.value).delete(id);
408
421
  } catch (e: any) {
409
- qua.notify({
422
+ quasar.notify({
410
423
  message: e.message,
411
424
  color: "negative"
412
425
  })
@@ -501,7 +514,9 @@ const localSelected = computed({
501
514
  }
502
515
  });
503
516
 
504
-
517
+ watch(() => props.rows, (val) => {
518
+ rows.value = val;
519
+ });
505
520
  </script>
506
521
 
507
522
 
@@ -518,7 +533,7 @@ const localSelected = computed({
518
533
  </div>
519
534
  </template>
520
535
 
521
- <q-table v-bind="attrs" :loading="loading" :rows="rows??[]" ref="table" @request="onRequest" :columns="columns"
536
+ <q-table v-bind="attrs" :loading="loading" :rows="rows" ref="table" @request="onRequest" :columns="columns"
522
537
  v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected">
523
538
 
524
539
  <template #header="props">
@@ -6,7 +6,7 @@ declare const app: {
6
6
  isAdmin: boolean;
7
7
  permissions: string[];
8
8
  myFavorites: any[];
9
- getColorValue: () => any;
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: String) => any;
22
+ getStyle: (name: string) => any;
23
23
  setStyles: (s: Object) => void;
24
24
  getStyles: () => {
25
25
  [key: string]: any;
26
26
  };
27
- setStyle: (name: String, value: any) => Promise<void>;
28
- setCurrentRoute: (to: any, from: any) => void;
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: () => any;
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: String) => any;
62
+ getStyle: (name: string) => any;
63
63
  setStyles: (s: Object) => void;
64
64
  getStyles: () => {
65
65
  [key: string]: any;
66
66
  };
67
- setStyle: (name: String, value: any) => Promise<void>;
68
- setCurrentRoute: (to: any, from: any) => void;
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;
@@ -121,7 +121,7 @@ const app = reactive({
121
121
  });
122
122
  styles[name] = value;
123
123
  },
124
- setCurrentRoute(to, from) {
124
+ setCurrentRoute(to) {
125
125
  currentRoute = to;
126
126
  },
127
127
  getID() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.10.14",
3
+ "version": "1.10.16",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",