@hostlink/nuxt-light 0.0.50 → 0.0.52

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": "0.0.50"
4
+ "version": "0.0.52"
5
5
  }
@@ -382,7 +382,10 @@ const attrs = {
382
382
  <q-table v-bind="$attrs" :flat="attrs.flat" :dense="attrs.dense" :bordered="attrs.bordered" :row-key="rowKey"
383
383
  :loading="loading" :hide-bottom="hideBottom" v-model:pagination="pagination" ref="table" @request="onRequest"
384
384
  :rows="rows" :rows-per-page-label="t(props.rowsPerPageLabel)" :columns="renderColumns"
385
- :rows-per-page-options="rowsPerPageOptions">
385
+ :rows-per-page-options="rowsPerPageOptions"
386
+ :selection="selection"
387
+
388
+ >
386
389
 
387
390
  <template v-for="s in ss" v-slot:[s]="props">
388
391
  <slot :name="s" v-bind="props"></slot>
@@ -7,4 +7,4 @@ interface Light {
7
7
  getVersion(): string;
8
8
  }
9
9
  export declare function useLight(): Light;
10
- export { notify, addObject, f, getApiUrl, getCurrentUser, getObject, id, list, listData, login, m, mutation, q, removeObject, t, updateObject, getID, deleteObject, listObject } from "./lib";
10
+ export { notify, addObject, f, getApiUrl, getCurrentUser, getObject, id, list, listData, login, m, mutation, q, removeObject, t, updateObject, getID, deleteObject, listObject, getApiBase } from "./lib";
@@ -48,5 +48,6 @@ export {
48
48
  updateObject,
49
49
  getID,
50
50
  deleteObject,
51
- listObject
51
+ listObject,
52
+ getApiBase
52
53
  } from "./lib/index.mjs";
@@ -1,4 +1,5 @@
1
+ import { getApiBase } from "./index.mjs";
1
2
  export default function getApiUrl(url, params) {
2
3
  const urlParams = new URLSearchParams(params).toString();
3
- return `/api/${url}?${urlParams}`;
4
+ return getApiBase() + `${url}?${urlParams}`;
4
5
  }
@@ -18,4 +18,5 @@ import listObject from "./listObject";
18
18
  import isGranted from "./isGranted";
19
19
  declare const notify: (message: string, color?: string) => void;
20
20
  import getID from "./getID";
21
- export { addObject, f, getApiUrl, getCurrentUser, getObject, id, list, listData, login, m, mutation, q, removeObject, t, updateObject, notify, getID, deleteObject, listObject, isGranted };
21
+ declare const getApiBase: () => {};
22
+ export { addObject, f, getApiUrl, getCurrentUser, getObject, id, list, listData, login, m, mutation, q, removeObject, t, updateObject, notify, getID, deleteObject, listObject, isGranted, getApiBase };
@@ -1,3 +1,4 @@
1
+ import { useRuntimeConfig } from "nuxt/app";
1
2
  import { Notify } from "quasar";
2
3
  import addObject from "./addObject.mjs";
3
4
  import f from "./f.mjs";
@@ -25,6 +26,10 @@ const notify = function(message, color = "green") {
25
26
  });
26
27
  };
27
28
  import getID from "./getID.mjs";
29
+ const getApiBase = () => {
30
+ const config = useRuntimeConfig();
31
+ return config?.public?.apiBase ?? "/api/";
32
+ };
28
33
  export {
29
34
  addObject,
30
35
  f,
@@ -45,5 +50,6 @@ export {
45
50
  getID,
46
51
  deleteObject,
47
52
  listObject,
48
- isGranted
53
+ isGranted,
54
+ getApiBase
49
55
  };
@@ -1,6 +1,9 @@
1
1
  import axios from "axios";
2
2
  import { jsonToGraphQLQuery } from "json-to-graphql-query";
3
+ import { useRuntimeConfig } from "nuxt/app";
4
+ import { getApiBase } from "./index.mjs";
3
5
  export default async function(operation, args, fields = []) {
6
+ const config = useRuntimeConfig();
4
7
  const mutation = {
5
8
  mutation: {}
6
9
  };
@@ -42,9 +45,9 @@ export default async function(operation, args, fields = []) {
42
45
  for (let i = 0; i < map_values.length; i++) {
43
46
  fd.append(i.toString(), map_values[i]);
44
47
  }
45
- data = (await service.post("/api/", fd)).data;
48
+ data = (await service.post(getApiBase(), fd)).data;
46
49
  } else {
47
- data = (await service.post("/api/", {
50
+ data = (await service.post(getApiBase(), {
48
51
  query: graphql_query
49
52
  })).data;
50
53
  }
@@ -1,6 +1,8 @@
1
1
  import axios from "axios";
2
2
  import f from "./f.mjs";
3
3
  import { jsonToGraphQLQuery } from "json-to-graphql-query";
4
+ import { useRuntimeConfig } from "nuxt/app";
5
+ import { getApiBase } from "./index.mjs";
4
6
  const mapping = function(obj) {
5
7
  let q = {};
6
8
  Object.entries(obj).forEach(([key, value]) => {
@@ -16,6 +18,7 @@ const mapping = function(obj) {
16
18
  return q;
17
19
  };
18
20
  export default async function(operation, args, fields = []) {
21
+ const config = useRuntimeConfig();
19
22
  const service = axios.create({
20
23
  withCredentials: true
21
24
  });
@@ -29,7 +32,7 @@ export default async function(operation, args, fields = []) {
29
32
  }
30
33
  query = f(operation, args, fields);
31
34
  }
32
- const resp = (await service.post("/api/", {
35
+ const resp = (await service.post(getApiBase(), {
33
36
  query: `{ ${query} }`
34
37
  })).data;
35
38
  if (resp.errors) {
@@ -52,7 +52,9 @@ const status = ref("0");
52
52
 
53
53
  <l-tabs v-model="status">
54
54
  <l-tab label="Active" name="0">
55
- <l-table @request="onRequest" :columns="columns" :actions="['view', 'edit', 'delete']">
55
+ <l-table
56
+
57
+ @request="onRequest" :columns="columns" :actions="['view', 'edit', 'delete']">
56
58
  </l-table>
57
59
  </l-tab>
58
60
  <l-tab label="Inactive" name="1">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "0.0.50",
3
+ "version": "0.0.52",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",