@hostlink/nuxt-light 0.0.53 → 0.0.55

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/README.md CHANGED
@@ -2,57 +2,57 @@
2
2
  Get your module up and running quickly.
3
3
 
4
4
  Find and replace all on all files (CMD+SHIFT+F):
5
- - Name: My Module
6
- - Package name: my-module
5
+ - Name: nuxt-light
6
+ - Package name: nuxt-light
7
7
  - Description: My new Nuxt module
8
8
  -->
9
9
 
10
- # My Module
10
+ # nuxt-light
11
11
 
12
12
  [![npm version][npm-version-src]][npm-version-href]
13
13
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
14
14
  [![License][license-src]][license-href]
15
15
  [![Nuxt][nuxt-src]][nuxt-href]
16
16
 
17
- My new Nuxt module for doing amazing things.
17
+ This is a Hostlink nuxt-light framework for Nuxt.
18
18
 
19
19
  - [✨  Release Notes](/CHANGELOG.md)
20
- <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
20
+ <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/nuxt-light?file=playground%2Fapp.vue) -->
21
21
  <!-- - [📖 &nbsp;Documentation](https://example.com) -->
22
22
 
23
23
  ## Features
24
24
 
25
25
  <!-- Highlight some of the features your module provide here -->
26
- - &nbsp;Foo
27
- - 🚠 &nbsp;Bar
28
- - 🌲 &nbsp;Baz
26
+ - HostLink nuxt-light framework
29
27
 
30
28
  ## Quick Setup
31
29
 
32
- 1. Add `my-module` dependency to your project
30
+ 1. Add `nuxt-light` dependency to your project
33
31
 
34
32
  ```bash
35
- # Using pnpm
36
- pnpm add -D my-module
37
-
38
- # Using yarn
39
- yarn add --dev my-module
40
-
41
33
  # Using npm
42
- npm install --save-dev my-module
34
+ npm install --save-dev nuxt-light
43
35
  ```
44
36
 
45
- 2. Add `my-module` to the `modules` section of `nuxt.config.ts`
37
+ 2. Add `@hostlink/nuxt-light` to the `modules` section of `nuxt.config.ts`
46
38
 
47
39
  ```js
40
+ import pkg from './package.json'
48
41
  export default defineNuxtConfig({
42
+ runtimeConfig: {
43
+ public: {
44
+ //apiBase: 'your-api-base-url'
45
+ appVersion: pkg.version
46
+ }
47
+ },
48
+ ssr:false,
49
49
  modules: [
50
- 'my-module'
50
+ '@hostlink/nuxt-light'
51
51
  ]
52
52
  })
53
53
  ```
54
54
 
55
- That's it! You can now use My Module in your Nuxt app ✨
55
+ That's it! You can now use nuxt-light in your Nuxt app ✨
56
56
 
57
57
  ## Development
58
58
 
@@ -81,14 +81,14 @@ npm run release
81
81
  ```
82
82
 
83
83
  <!-- Badges -->
84
- [npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
85
- [npm-version-href]: https://npmjs.com/package/my-module
84
+ [npm-version-src]: https://img.shields.io/npm/v/@hostlink/nuxt-light/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
85
+ [npm-version-href]: https://npmjs.com/package/@hostlink/nuxt-light
86
86
 
87
- [npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=18181B&colorB=28CF8D
88
- [npm-downloads-href]: https://npmjs.com/package/my-module
87
+ [npm-downloads-src]: https://img.shields.io/npm/dm/@hostlink/nuxt-light.svg?style=flat&colorA=18181B&colorB=28CF8D
88
+ [npm-downloads-href]: https://npmjs.com/package/@hostlink/nuxt-light
89
89
 
90
- [license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=18181B&colorB=28CF8D
91
- [license-href]: https://npmjs.com/package/my-module
90
+ [license-src]: https://img.shields.io/npm/l/@hostlink/nuxt-light.svg?style=flat&colorA=18181B&colorB=28CF8D
91
+ [license-href]: https://npmjs.com/package/@hostlink/nuxt-light
92
92
 
93
93
  [nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
94
94
  [nuxt-href]: https://nuxt.com
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "0.0.53"
4
+ "version": "0.0.55"
5
5
  }
@@ -3,6 +3,13 @@ import { useQuasar } from 'quasar';
3
3
  import { useI18n } from 'vue-i18n';
4
4
  import { useLight, q, getCurrentUser, m, f } from '../';
5
5
  import { ref, computed, reactive, provide, watch } from 'vue';
6
+ import { useRuntimeConfig } from 'nuxt/app';
7
+
8
+
9
+ const config = useRuntimeConfig();
10
+
11
+ const appVersion = config.public.appVersion ?? '0.0.1';
12
+
6
13
 
7
14
  const quasar = useQuasar();
8
15
  quasar.dark.set(false);
@@ -15,11 +22,10 @@ const props = defineProps({
15
22
  });
16
23
 
17
24
  const tt = await q({
18
- app: ["menus", "viewAsMode", "languages"],
25
+ app: ["menus", "viewAsMode", "languages", { i18nMessages: ["name", "value"] }],
19
26
  my: ["styles", "language", f('granted_storage:granted', { right: "system.storage" }, [])],
20
27
  })
21
28
 
22
- const allTranslate = ref(await q("allTranslate", []))
23
29
 
24
30
  let app = tt.app
25
31
  let my = tt.my
@@ -35,15 +41,14 @@ const menus = ref(app.menus)
35
41
  const i18n = useI18n();
36
42
  i18n.locale = my.language || 'en';
37
43
 
38
- const messages = i18n.messages.value[i18n.locale];
44
+ let messages = i18n.messages.value[i18n.locale];
39
45
 
40
- for (const translate of allTranslate.value) {
41
- messages[translate.name] = translate[my.language]
46
+ for (let t of app.i18nMessages) {
47
+ messages[t.name] = t.value;
42
48
  }
43
49
 
44
50
  i18n.setLocaleMessage(i18n.locale, messages);
45
51
 
46
-
47
52
  const user = ref(await getCurrentUser());
48
53
 
49
54
  const leftDrawerOpen = ref(false)
@@ -338,7 +343,7 @@ const storageUsagePercent = computed(() => {
338
343
  <q-footer class="bg-white text-grey" bordered>
339
344
  <q-item>
340
345
  <q-item-section>
341
- {{ company }} {{ light.getVersion() }} - Copyright 2023 HostLink(HK)
346
+ {{ company }} {{ appVersion }} - Copyright 2023 HostLink(HK). Build {{ light.getVersion() }}
342
347
  </q-item-section>
343
348
  </q-item>
344
349
  </q-footer>
@@ -20,7 +20,7 @@ if (typeof props.value === "number") {
20
20
 
21
21
  </script>
22
22
  <template>
23
- <div>
23
+ <div class="q-pa-sm">
24
24
  <div class="row">
25
25
  {{ title }}
26
26
  </div>
@@ -1,9 +1,7 @@
1
1
  import axios from "axios";
2
2
  import { jsonToGraphQLQuery } from "json-to-graphql-query";
3
- import { useRuntimeConfig } from "nuxt/app";
4
3
  import { getApiBase } from "./index.mjs";
5
4
  export default async function(operation, args, fields = []) {
6
- const config = useRuntimeConfig();
7
5
  const mutation = {
8
6
  mutation: {}
9
7
  };
@@ -1,7 +1,6 @@
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
4
  import { getApiBase } from "./index.mjs";
6
5
  const mapping = function(obj) {
7
6
  let q = {};
@@ -9,7 +8,13 @@ const mapping = function(obj) {
9
8
  if (value instanceof Array) {
10
9
  q[key] = {};
11
10
  value.forEach((subField) => {
12
- q[key][subField] = true;
11
+ if (subField instanceof Object) {
12
+ Object.entries(mapping(subField)).forEach(([subKey, subValue]) => {
13
+ q[key][subKey] = subValue;
14
+ });
15
+ } else {
16
+ q[key][subField] = true;
17
+ }
13
18
  });
14
19
  } else {
15
20
  q[key] = mapping(value);
@@ -18,7 +23,6 @@ const mapping = function(obj) {
18
23
  return q;
19
24
  };
20
25
  export default async function(operation, args, fields = []) {
21
- const config = useRuntimeConfig();
22
26
  const service = axios.create({
23
27
  withCredentials: true
24
28
  });
@@ -26,6 +26,13 @@ const onSave = async () => {
26
26
 
27
27
  }
28
28
  })
29
+
30
+ Notify.create({
31
+ message: "Save success",
32
+ color: "positive",
33
+ icon: "check"
34
+ })
35
+
29
36
  //reload
30
37
  all.value = await q("allTranslate", [])
31
38
  }
@@ -40,7 +47,8 @@ const columns = [
40
47
  label: "Name",
41
48
  name: "name",
42
49
  field: "name",
43
- align: "left"
50
+ align: "left",
51
+ sortable: true,
44
52
  }];
45
53
 
46
54
  for (const language of app.languages) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",