@hostlink/nuxt-light 0.0.10 → 0.0.12

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.10"
4
+ "version": "0.0.12"
5
5
  }
@@ -1,8 +1,9 @@
1
1
  <script setup>
2
2
  import { VariableType } from "json-to-graphql-query";
3
3
  import { useI18n } from "vue-i18n";
4
- import { ref } from 'vue';
4
+ import { ref, watch, computed } from 'vue';
5
5
  import { useQuasar } from 'quasar';
6
+ import { q } from "../light";
6
7
 
7
8
  const quasar = useQuasar();
8
9
  const emit = defineEmits(["input", "close"]);
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
+ import { t } from "../light";
3
4
 
4
5
  const props = defineProps({
5
6
  modelValue: {
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
2
  import { computed, ref } from "vue";
3
+ import { t } from "../light"
3
4
  const props = defineProps({
4
5
 
5
6
  rules: {
@@ -28,10 +29,10 @@ const props = defineProps({
28
29
 
29
30
  if (props.required) {
30
31
  props.rules.push((val) => {
31
- if(isNumber(val)){
32
+ if (isNumber(val)) {
32
33
  return;
33
34
  }
34
-
35
+
35
36
  return !!val || 'Required.'
36
37
  });
37
38
  }
@@ -1,7 +1,8 @@
1
1
  <script setup>
2
2
  import { useQuasar } from 'quasar';
3
3
  import { useRoute } from 'vue-router';
4
- import { ref, computed, onMounted } from "vue";
4
+ import { ref, computed, onMounted,useSlots } from "vue";
5
+ import { t } from '../light';
5
6
 
6
7
  const route = useRoute();
7
8
  const module = route.path.split("/")[1];
@@ -4,9 +4,4 @@ interface Light {
4
4
  removeError: (error: String) => void;
5
5
  }
6
6
  export declare function useLight(): Light;
7
- import q from "./lib/q";
8
- import m from "./lib/m";
9
- import f from "./lib/f";
10
- import getCurrentUser from "./lib/getCurrentUser";
11
- import login from "./lib/login";
12
- export { q, getCurrentUser, login, m, f };
7
+ export { addObject, f, getApiUrl, getCurrentUser, getObject, id, list, listData, login, m, mutation, q, removeObject, t, updateObject, viewAs } from "./lib";
@@ -15,9 +15,21 @@ export function useLight() {
15
15
  }
16
16
  };
17
17
  }
18
- import q from "./lib/q.mjs";
19
- import m from "./lib/m.mjs";
20
- import f from "./lib/f.mjs";
21
- import getCurrentUser from "./lib/getCurrentUser.mjs";
22
- import login from "./lib/login.mjs";
23
- export { q, getCurrentUser, login, m, f };
18
+ export {
19
+ addObject,
20
+ f,
21
+ getApiUrl,
22
+ getCurrentUser,
23
+ getObject,
24
+ id,
25
+ list,
26
+ listData,
27
+ login,
28
+ m,
29
+ mutation,
30
+ q,
31
+ removeObject,
32
+ t,
33
+ updateObject,
34
+ viewAs
35
+ } from "./lib/index.mjs";
@@ -1,7 +1,6 @@
1
1
  <script setup>
2
+ import { getObject } from "../../light"
2
3
  const obj = await getObject(["eventlog_id", "class", "id", "action", "created_time", "username"]);
3
-
4
-
5
4
  </script>
6
5
  <template>
7
6
  <l-page>
@@ -1,4 +1,6 @@
1
1
  <script setup>
2
+ import { listData } from "../../light"
3
+
2
4
  const onRequest = async (params) => {
3
5
  listData("EventLog", params, ["canRead"]);
4
6
  };
@@ -50,7 +52,7 @@ const columns = [
50
52
  <template>
51
53
  <l-page>
52
54
  <l-table @request="onRequest" :columns="columns" sort-by="eventlog_id:desc" :show-actions="['view']">
53
-
55
+
54
56
  </l-table>
55
57
  </l-page>
56
58
  </template>
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { listData } from "../../light"
2
3
  const onRequest = async (params) => {
3
4
  listData("MailLog", params, ["body"]);
4
5
  };
@@ -1,4 +1,7 @@
1
1
  <script setup>
2
+ import { reactive } from 'vue'
3
+ import { q } from "../../light"
4
+ import { useRouter } from "vue-router"
2
5
  const obj = reactive({
3
6
  roles: []
4
7
  });
@@ -1,4 +1,6 @@
1
1
  <script setup>
2
+ import { reactive } from 'vue'
3
+ import { q, m } from "../../light"
2
4
  const app = await q("app", ["permissions"])
3
5
 
4
6
  const roles = await q("listRole", ["name", "permissions"])
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { listData } from "../../light";
2
3
  const onRequest = async (params) => {
3
4
  listData("Permission", params, ["permission_id"]);
4
5
  };
@@ -1,4 +1,6 @@
1
1
  <script setup>
2
+ import { reactive } from 'vue'
3
+ import { q } from "../../light"
2
4
  const obj = reactive({
3
5
  childs: ["Users"],
4
6
  })
@@ -1,4 +1,7 @@
1
1
  <script setup>
2
+ import { useQuasar } from 'quasar'
3
+ import { q, m } from "../../light"
4
+ import { ref } from "vue"
2
5
 
3
6
  const qua = useQuasar();
4
7
 
@@ -1,15 +1,16 @@
1
1
  <script setup>
2
+ import { q } from "../../../light"
2
3
  const { database } = await q("system", [f("database", ["table"])])
3
4
  </script>
4
5
  <template>
5
6
  <l-page>
6
7
  <q-card flat bordered>
7
- <q-list bordered class="rounded-borders" separator >
8
+ <q-list bordered class="rounded-borders" separator>
8
9
  <q-expansion-item :label="table.name" v-for="table in database.table" expand-separator>
9
10
  <div class=" q-ma-sm">
10
11
  <q-table :rows="table.columns" :rows-per-page-options="[0]" hide-pagination flat bordered></q-table>
11
12
  </div>
12
-
13
+
13
14
  </q-expansion-item>
14
15
  </q-list>
15
16
  </q-card>
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { q } from "../../light"
2
3
  const system = await q("system", ["server"])
3
4
  </script>
4
5
  <template>
@@ -1,4 +1,7 @@
1
1
  <script setup>
2
+ import { q } from "../../../light"
3
+ import { useRouter, useRoute } from "vue-router"
4
+ import { reactive } from "vue"
2
5
  const system = await q("system", ["passwordPolicy"]);
3
6
  const rules = system.passwordPolicy.map((rule) => {
4
7
  let s = rule.split(":");
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { reacttive } from 'vue'
2
3
  const obj = reactive(await getObject(["first_name", "last_name", "email", "phone",
3
4
  "addr1", "addr2", "addr3", "join_date", "expiry_date", "status", "language", "default_page"
4
5
  ]))
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { getObject } from "../../../light";
2
3
  const obj = await getObject(["username", "first_name", "last_name", "email", "phone"]);
3
4
 
4
5
  </script>
@@ -6,7 +7,7 @@ const obj = await getObject(["username", "first_name", "last_name", "email", "ph
6
7
  <template>
7
8
  <l-page>
8
9
  <template #header>
9
- <l-btn to="change-password" icon="sym_o_key" permission="user.changePassword">Change password</l-btn>
10
+ <l-btn to="change-password" icon="sym_o_key" permission="user.changePassword" label="Change password"></l-btn>
10
11
  </template>
11
12
  <l-card>
12
13
  <l-list>
@@ -1,4 +1,6 @@
1
1
  <script setup>
2
+ import { reactive } from "vue"
3
+ import { q } from "../../light"
2
4
  const obj = reactive({
3
5
  roles: ['Users'],
4
6
  status: 'Active',
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { listData } from "../../light"
2
3
 
3
4
 
4
5
  const onRequest = async (params) => {
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { q } from "../../light"
2
3
  const my = await q("my", ["username", "first_name", "last_name", "email", "phone", "roles", "addr1", "addr2", "addr3", "join_date"])
3
4
 
4
5
  </script>
@@ -1,4 +1,7 @@
1
1
  <script setup>
2
+ import { useQuasar } from 'quasar';
3
+ import { useRouter } from 'vue-router';
4
+ import { router } from "vue-router"
2
5
 
3
6
  const obj = reactive({
4
7
  old_password: "",
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { listData } from "../../light";
2
3
  const onRequest = async (params) => {
3
4
  listData("UserLog", params);
4
5
  };
@@ -1,9 +1,6 @@
1
1
  <script setup>
2
-
3
- await mutation({
4
- operation: "logout"
5
- });
6
-
2
+ import { m } from "../light";
3
+ await m("logout");
7
4
  window.self.location = "/";
8
5
 
9
6
  </script>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "0.0.10",
4
- "description": "My new Nuxt module",
3
+ "version": "0.0.12",
4
+ "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",
7
7
  "type": "module",