@hostlink/nuxt-light 1.10.13 → 1.10.15

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.13"
4
+ "version": "1.10.15"
5
5
  }
package/dist/module.mjs CHANGED
@@ -79,18 +79,13 @@ const module = defineNuxtModule({
79
79
  src: resolver.resolve("./runtime/plugin"),
80
80
  mode: "client"
81
81
  });
82
- nuxt.hook("vite:extendConfig", (config) => {
83
- config.plugins ??= [];
84
- config.plugins.push(
85
- virtualQuasarEntryPlugin({
86
- resolveQuasar,
87
- dev: nuxt.options.dev,
88
- imports: {
89
- raw: importMap
90
- }
91
- })
92
- );
93
- });
82
+ addVitePlugin(virtualQuasarEntryPlugin({
83
+ resolveQuasar,
84
+ dev: nuxt.options.dev,
85
+ imports: {
86
+ raw: importMap
87
+ }
88
+ }));
94
89
  }
95
90
  });
96
91
  function virtualQuasarEntryPlugin(context) {
@@ -5,18 +5,20 @@ import { useRuntimeConfig } from 'nuxt/app'
5
5
  import { setApiUrl } from '@hostlink/light'
6
6
  import { useQuasar, Dialog } from 'quasar'
7
7
  import { q } from '#imports'
8
- import { useRoute } from "#vue-router";
8
+ import { useRoute } from "vue-router";
9
9
  const config = useRuntimeConfig();
10
10
  setApiUrl(config?.public?.apiBase ?? '/api/');
11
11
 
12
12
  const route = useRoute();
13
13
  const light = useLight()
14
+ const quasar = useQuasar()
14
15
 
15
16
  light.setCurrentRoute(route);
16
17
  watch(route, (to, from) => {
17
18
  light.setCurrentRoute(to);
18
19
  });
19
20
 
21
+
20
22
  let app = null
21
23
  try {
22
24
  app = (await q({ app: ['company', 'companyLogo', 'logged', 'twoFactorAuthentication', 'googleClientId'] })).app;
@@ -24,7 +26,7 @@ try {
24
26
  light.setCompanyLogo(app.companyLogo);
25
27
  } catch (e) {
26
28
 
27
- Dialog.create({
29
+ quasar.dialog({
28
30
  title: 'Error',
29
31
  message: 'Error loading api data. Please reload the page.',
30
32
  ok: 'Reload',
@@ -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();
@@ -337,8 +337,18 @@ const onRequest = async (p: any) => {
337
337
  }
338
338
  }
339
339
  loading.value = true;
340
- const allData = await getData(operation, localFilters, sort, this.offset, this.limit, builder.get());
341
- this.setData(allData);
340
+ try {
341
+ const allData = await getData(operation, localFilters, sort, this.offset, this.limit, builder.get());
342
+ this.setData(allData);
343
+ } catch (e: any) {
344
+ quasar.dialog({
345
+ message: e,
346
+ color: "negative"
347
+ })
348
+ this.setData({ data: [], meta: { total: 0, key: "", name: "" } });
349
+ }
350
+
351
+
342
352
 
343
353
  }
344
354
  }
@@ -399,14 +409,14 @@ const ss = Object.entries(slots).map(([key, value]) => {
399
409
  return key;
400
410
  });
401
411
 
402
- const qua = useQuasar();
412
+ const quasar = useQuasar();
403
413
  const onDelete = async (id: any) => {
404
414
  if (modelName.value == null) return;
405
415
 
406
416
  try {
407
417
  await model(modelName.value).delete(id);
408
418
  } catch (e: any) {
409
- qua.notify({
419
+ quasar.notify({
410
420
  message: e.message,
411
421
  color: "negative"
412
422
  })
@@ -518,8 +528,8 @@ const localSelected = computed({
518
528
  </div>
519
529
  </template>
520
530
 
521
- <q-table v-bind="attrs" :loading="loading" :rows="rows??[]" ref="table" @request="onRequest" :columns="columns"
522
- v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected">
531
+ <q-table v-bind="attrs" :loading="loading" :rows="rows ?? []" ref="table" @request="onRequest"
532
+ :columns="columns" v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected">
523
533
 
524
534
  <template #header="props">
525
535
  <q-tr :props="props">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.10.13",
3
+ "version": "1.10.15",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",