@hostlink/nuxt-light 1.13.2 → 1.13.5

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.
Files changed (70) hide show
  1. package/dist/module.d.mts +1 -1
  2. package/dist/module.d.ts +1 -1
  3. package/dist/module.json +1 -5
  4. package/dist/runtime/components/l-app.vue +2 -1
  5. package/dist/runtime/components/l-banner.vue +1 -1
  6. package/dist/runtime/components/l-btn.vue +1 -1
  7. package/dist/runtime/components/l-card.vue +1 -1
  8. package/dist/runtime/components/l-checkbox.vue +1 -1
  9. package/dist/runtime/components/l-editor.vue +1 -1
  10. package/dist/runtime/components/l-file-manager.vue +9 -10
  11. package/dist/runtime/components/l-input.vue +1 -1
  12. package/dist/runtime/components/l-item.vue +1 -1
  13. package/dist/runtime/components/l-list.vue +1 -1
  14. package/dist/runtime/components/l-login.vue +22 -21
  15. package/dist/runtime/components/l-page.vue +1 -1
  16. package/dist/runtime/components/l-select.vue +1 -1
  17. package/dist/runtime/components/l-table.vue +2 -2
  18. package/dist/runtime/components/l-tabs.vue +1 -1
  19. package/dist/runtime/formkit/Form.vue +1 -1
  20. package/dist/runtime/index.d.ts +3 -3
  21. package/dist/runtime/{index.js → index.mjs} +2 -2
  22. package/dist/runtime/lib/{SystemValue.js → SystemValue.mjs} +2 -2
  23. package/dist/runtime/lib/defineLightModel.d.ts +1 -1
  24. package/dist/runtime/lib/{defineLightModel.js → defineLightModel.mjs} +1 -1
  25. package/dist/runtime/lib/{f.js → f.mjs} +1 -1
  26. package/dist/runtime/lib/{getApiUrl.js → getApiUrl.mjs} +1 -1
  27. package/dist/runtime/lib/{getCurrentUser.js → getCurrentUser.mjs} +1 -1
  28. package/dist/runtime/lib/{getGQLFields.js → getGQLFields.mjs} +2 -2
  29. package/dist/runtime/lib/{getID.js → getID.mjs} +1 -1
  30. package/dist/runtime/lib/{getModelColumns.js → getModelColumns.mjs} +1 -1
  31. package/dist/runtime/lib/{getModelField.js → getModelField.mjs} +1 -1
  32. package/dist/runtime/lib/{getModelFields.js → getModelFields.mjs} +1 -1
  33. package/dist/runtime/lib/{getObject.js → getObject.mjs} +2 -2
  34. package/dist/runtime/lib/index.d.ts +22 -22
  35. package/dist/runtime/lib/index.mjs +39 -0
  36. package/dist/runtime/lib/{list.js → list.mjs} +1 -1
  37. package/dist/runtime/lib/listObject.d.ts +1 -1
  38. package/dist/runtime/lib/{listObject.js → listObject.mjs} +1 -1
  39. package/dist/runtime/lib/{loadObject.js → loadObject.mjs} +1 -1
  40. package/dist/runtime/lib/{m.js → m.mjs} +1 -1
  41. package/dist/runtime/lib/model.d.ts +1 -1
  42. package/dist/runtime/lib/{model.js → model.mjs} +1 -1
  43. package/dist/runtime/lib/{q.js → q.mjs} +2 -2
  44. package/dist/runtime/lib/{sv.js → sv.mjs} +2 -2
  45. package/dist/runtime/lib/{updateObject.js → updateObject.mjs} +1 -1
  46. package/dist/runtime/pages/Permission/all.vue +2 -2
  47. package/dist/runtime/pages/Permission/export.vue +2 -2
  48. package/dist/runtime/pages/System/database/table.vue +4 -4
  49. package/dist/runtime/pages/User/_user_id/view.vue +0 -6
  50. package/dist/runtime/pages/User/index.vue +0 -2
  51. package/dist/runtime/pages/User/setting/bio-auth.vue +6 -5
  52. package/dist/runtime/pages/User/setting/password.vue +0 -1
  53. package/dist/runtime/pages/User/setting/two-factor-auth.vue +1 -1
  54. package/dist/runtime/plugin.d.ts +2 -2
  55. package/dist/runtime/{plugin.js → plugin.mjs} +8 -8
  56. package/dist/types.d.mts +16 -1
  57. package/dist/types.d.ts +16 -1
  58. package/package.json +12 -8
  59. package/dist/runtime/lib/index.js +0 -39
  60. /package/dist/runtime/formkit/{index.js → index.mjs} +0 -0
  61. /package/dist/runtime/lib/{GQLFieldBuilder.js → GQLFieldBuilder.mjs} +0 -0
  62. /package/dist/runtime/lib/{isGranted.js → isGranted.mjs} +0 -0
  63. /package/dist/runtime/lib/{t.js → t.mjs} +0 -0
  64. /package/dist/runtime/lib/{tc2sc.js → tc2sc.mjs} +0 -0
  65. /package/dist/runtime/lib/{toJson.js → toJson.mjs} +0 -0
  66. /package/dist/runtime/types/{EventLog.js → EventLog.mjs} +0 -0
  67. /package/dist/runtime/types/{MailLog.js → MailLog.mjs} +0 -0
  68. /package/dist/runtime/types/{SystemValue.js → SystemValue.mjs} +0 -0
  69. /package/dist/runtime/types/{User.js → User.mjs} +0 -0
  70. /package/dist/runtime/types/{UserLog.js → UserLog.mjs} +0 -0
package/dist/module.d.mts CHANGED
@@ -2,6 +2,6 @@ import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
3
  interface ModuleOptions {
4
4
  }
5
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
5
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
6
6
 
7
7
  export { type ModuleOptions, _default as default };
package/dist/module.d.ts CHANGED
@@ -2,6 +2,6 @@ import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
3
  interface ModuleOptions {
4
4
  }
5
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
5
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
6
6
 
7
7
  export { type ModuleOptions, _default as default };
package/dist/module.json CHANGED
@@ -1,9 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.13.2",
5
- "builder": {
6
- "@nuxt/module-builder": "0.8.3",
7
- "unbuild": "2.0.0"
8
- }
4
+ "version": "1.13.5"
9
5
  }
@@ -1,7 +1,8 @@
1
1
  <script setup>
2
2
  import { provide, ref } from 'vue'
3
3
  import { useLight, watch } from "#imports";
4
- //import { useRuntimeConfig } from 'nuxt/app'
4
+ import { useRuntimeConfig } from 'nuxt/app'
5
+
5
6
  import { useQuasar } from 'quasar'
6
7
  import { q } from '#imports'
7
8
  import { useRoute } from "vue-router";
@@ -2,7 +2,7 @@
2
2
  import { type QBannerProps } from 'quasar'
3
3
  import { computed, useSlots } from 'vue'
4
4
 
5
- export interface LBannerProps extends /* @vue-ignore */ QBannerProps {
5
+ export interface LBannerProps extends QBannerProps {
6
6
  icon?: string
7
7
  type?: 'primary' | 'secondary' | 'accent' | 'dark' | 'positive' | 'negative' | 'info' | 'warning'
8
8
  }
@@ -4,7 +4,7 @@ import { computed, inject, unref, toRaw } from "vue";
4
4
  import { useLight } from '#imports';
5
5
  import { useI18n } from "vue-i18n";
6
6
 
7
- export interface LBtnProps extends /* @vue-ignore */ QBtnProps {
7
+ export interface LBtnProps extends QBtnProps {
8
8
  permission?: string;
9
9
  }
10
10
 
@@ -8,7 +8,7 @@ const emit = defineEmits(["close"]);
8
8
  const minimized = defineModel<boolean>("minimized", { default: false })
9
9
  const maximized = defineModel<boolean>("maximized", { default: false })
10
10
 
11
- export interface LCardProps extends /* @vue-ignore */ QCardProps {
11
+ export interface LCardProps extends QCardProps {
12
12
  loading?: boolean;
13
13
  title?: string;
14
14
  /**
@@ -2,7 +2,7 @@
2
2
  import { computed } from "vue"
3
3
  import { type QCheckboxProps } from "quasar"
4
4
 
5
- export interface LCheckboxProps extends /* @vue-ignore */ QCheckboxProps {
5
+ export interface LCheckboxProps extends QCheckboxProps {
6
6
  }
7
7
 
8
8
  const emit = defineEmits(["update:modelValue"]);
@@ -27,7 +27,7 @@ const TextHightlightCMD = ((cmd, name) => {
27
27
  edit.focus()
28
28
  })
29
29
 
30
- export interface LEditorProps extends /* @vue-ignore */ QEditorProps {
30
+ export interface LEditorProps extends QEditorProps {
31
31
  }
32
32
 
33
33
  const emit = defineEmits(["update:modelValue"]);
@@ -2,8 +2,7 @@
2
2
  import { useI18n } from "vue-i18n";
3
3
  import { ref, watch, computed } from 'vue';
4
4
  import { useQuasar, format } from 'quasar';
5
- import { q, m, useLight } from '#imports';
6
- import { api } from "../lib";
5
+ import { q, m, useLight, api } from '#imports';
7
6
  const { humanStorageSize } = format
8
7
 
9
8
  const light = useLight();
@@ -255,9 +254,9 @@ const onDeleteSelected = () => {
255
254
  }).onOk(async () => {
256
255
  for (let row of selected.value) {
257
256
  if (row.type == "folder") {
258
- await fsDeleteFolder(row.path)
257
+ await api.fs.folders.delete(row.path)
259
258
  } else {
260
- await fsDeleteFile(row.path);
259
+ await api.fs.files.delete(row.path)
261
260
  }
262
261
  }
263
262
  selected.value = [];
@@ -275,7 +274,7 @@ const onNewFolder = () => {
275
274
  },
276
275
  cancel: true,
277
276
  }).onOk(async (name) => {
278
- await api.fs.folders.create(path.value + "/" + name)
277
+ await api.fs.folders.create(path.value + "/" + name);
279
278
  const items = await loadItems();
280
279
  reloadTreeFolder(path.value, items.folders);
281
280
  });
@@ -288,7 +287,7 @@ const onDeleteRow = (row) => {
288
287
  message: "Are you sure you want to delete this file?",
289
288
  cancel: true,
290
289
  }).onOk(async () => {
291
- await fsDeleteFile(row.path);
290
+ await api.fs.files.delete(row.path);
292
291
  const items = await loadItems();
293
292
  reloadTreeFolder(path.value, items.folders);
294
293
  });
@@ -298,7 +297,7 @@ const onDeleteRow = (row) => {
298
297
  message: "Are you sure you want to delete this folder?",
299
298
  cancel: true,
300
299
  }).onOk(async () => {
301
- await fsDeleteFolder(row.path);
300
+ await api.fs.folders.delete(row.path);
302
301
  const items = await loadItems();
303
302
  reloadTreeFolder(path.value, items.folders);
304
303
  });
@@ -316,9 +315,9 @@ const onRenameRow = (row) => {
316
315
  }).onOk(async (name) => {
317
316
  try {
318
317
  if (row.type == "file") {
319
- await fsRenameFile(row.path, name)
318
+ await api.fs.files.rename(row.path, name)
320
319
  } else {
321
- await fsRenameFolder(row.path, name);
320
+ await api.fs.folders.rename(row.path, name)
322
321
  }
323
322
  } catch (e) {
324
323
  quasar.dialog({
@@ -420,7 +419,7 @@ const onDownloadRow = async (row) => {
420
419
  const search = ref(null);
421
420
 
422
421
  const reloadStorage = async () => {
423
- ath.value = props.base;
422
+ path.value = props.base;
424
423
 
425
424
  search.value = "";
426
425
  localSearch.value = "";
@@ -5,7 +5,7 @@ import tc2sc from "../lib/tc2sc";
5
5
  import { useLight } from '#imports';
6
6
 
7
7
  import type { QInputProps } from "quasar";
8
- export interface LInputProps extends /* @vue-ignore */ QInputProps {
8
+ export interface LInputProps extends QInputProps {
9
9
  showPassword?: boolean;
10
10
  translate?: boolean;
11
11
  required?: boolean;
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import type { QItemProps } from 'quasar';
3
3
 
4
- export interface LItemProps extends /* @vue-ignore */ QItemProps {
4
+ export interface LItemProps extends QItemProps {
5
5
  label?: string;
6
6
  type?: 'text' | 'caption';
7
7
  name?: string;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import type { QListProps } from 'quasar';
4
4
 
5
- export interface LListProps extends /* @vue-ignore */ QListProps {
5
+ export interface LListProps extends QListProps {
6
6
  fields?: any[];
7
7
  modelValue?: any;
8
8
  }
@@ -1,8 +1,11 @@
1
1
  <script setup>
2
+ import { useLight } from "#imports";
2
3
  import { ref, reactive, onMounted } from 'vue'
3
- import { useQuasar } from 'quasar';
4
+ import { useQuasar, Dialog } from 'quasar';
4
5
  import { useI18n } from 'vue-i18n';
5
- import { useLight, m, notify, api } from '#imports';
6
+ import { m, notify, api } from '#imports';
7
+
8
+
6
9
 
7
10
  const light = useLight();
8
11
 
@@ -17,13 +20,12 @@ const data = reactive({
17
20
  username: "", password: "", code: ""
18
21
  });
19
22
 
20
- const quasar = useQuasar()
23
+ const qua = useQuasar()
21
24
 
22
25
  const submit = async () => {
23
26
  if (await form1.value.validate()) {
24
27
 
25
28
  try {
26
-
27
29
  await api.auth.login(data.username, data.password, data.code)
28
30
  window.self.location.reload();
29
31
  } catch (e) {
@@ -34,9 +36,9 @@ const submit = async () => {
34
36
  }
35
37
 
36
38
  const forgetPassword = async () => {
37
- quasar.dialog({
39
+ Dialog.create({
38
40
  title: i18n.t("Forget password"),
39
- message: i18n.t("Please enter your email address, we will send you a code to reset your password"),
41
+ message: "Please enter your email address, we will send you a code to reset your password",
40
42
  prompt: {
41
43
  model: "",
42
44
  type: "email",
@@ -47,12 +49,11 @@ const forgetPassword = async () => {
47
49
  return;
48
50
  }
49
51
 
50
-
51
52
  try {
52
- await api.auth.forgetPassword(email);
53
- quasar.dialog({
54
- title: i18n.t("Enter your code"),
55
- message: i18n.t("Please enter the code sent to your email, your code will expire in 10 minutes"),
53
+ await m("forgetPassword", { email: email });
54
+ qua.dialog({
55
+ title: "Enter your code",
56
+ message: "Please enter the code sent to your email, your code will expire in 10 minutes",
56
57
  prompt: {
57
58
  model: "",
58
59
  type: "text"
@@ -65,9 +66,9 @@ const forgetPassword = async () => {
65
66
  }
66
67
 
67
68
  if (await m("verifyCode", { code: code, email: email })) {
68
- quasar.dialog({
69
- title: i18n.t("Reset password"),
70
- message: i18n.t("Please enter your new password"),
69
+ qua.dialog({
70
+ title: "Reset password",
71
+ message: "Please enter your new password",
71
72
  prompt: {
72
73
  model: "",
73
74
  type: "password"
@@ -77,9 +78,9 @@ const forgetPassword = async () => {
77
78
  return;
78
79
  }
79
80
 
80
- if (api.auth.resetPassword(email, password, code)) {
81
- quasar.notify({
82
- message: i18n.t("Your password has been reset successfully"),
81
+ if (await m("resetPassword", { password: password, email: email, code: code })) {
82
+ qua.notify({
83
+ message: "Your password has been reset successfully",
83
84
  color: "positive",
84
85
  icon: "sym_o_check",
85
86
  position: "top",
@@ -88,8 +89,8 @@ const forgetPassword = async () => {
88
89
  }
89
90
  });
90
91
  } else {
91
- quasar.notify({
92
- message: i18n.t("Your code is invalid"),
92
+ qua.notify({
93
+ message: "Your code is invalid",
93
94
  color: "negative",
94
95
  icon: "sym_o_error",
95
96
  position: "top",
@@ -101,7 +102,7 @@ const forgetPassword = async () => {
101
102
 
102
103
  });
103
104
  } catch (e) {
104
- quasar.notify({
105
+ qua.notify({
105
106
  message: e.message,
106
107
  color: "negative",
107
108
  icon: "sym_o_error",
@@ -142,7 +143,7 @@ onMounted(() => {
142
143
 
143
144
 
144
145
  if (!window.google) {
145
- quasar.notify({
146
+ qua.notify({
146
147
  message: "Google login is not available", //set script https://accounts.google.com/gsi/client in nuuxt.config.js
147
148
  color: "negative",
148
149
  icon: "sym_o_error",
@@ -9,7 +9,7 @@ const router = useRouter();
9
9
  const route = useRoute();
10
10
  const light = useLight();
11
11
 
12
- export interface LPageProps extends /* @vue-ignore */ QPageProps {
12
+ export interface LPageProps extends QPageProps {
13
13
  title?: string;
14
14
  backBtn?: boolean;
15
15
  editBtn?: boolean;
@@ -8,7 +8,7 @@ const emits = defineEmits(["update:modelValue"]);
8
8
 
9
9
  const { t } = useI18n();
10
10
  const light = useLight();
11
- interface LSelectProps extends /* @vue-ignore */ QSelectProps {
11
+ interface LSelectProps extends QSelectProps {
12
12
  required?: boolean,
13
13
  }
14
14
 
@@ -11,7 +11,7 @@ const maximized = defineModel<boolean>("maximized", { default: false })
11
11
 
12
12
 
13
13
  // extends QTableColumn
14
- export interface LTableColumn extends /* @vue-ignore */ QTableColumn {
14
+ export interface LTableColumn extends QTableColumn {
15
15
  searchable?: boolean,
16
16
  searchType?: string,
17
17
  searchOptions?: Array<any> | Function,
@@ -23,7 +23,7 @@ export interface LTableColumn extends /* @vue-ignore */ QTableColumn {
23
23
  const errors = ref<InstanceType<any>>([
24
24
  ]);
25
25
 
26
- export interface LTableProps extends /* @vue-ignore */ QTableProps {
26
+ export interface LTableProps extends QTableProps {
27
27
  columns?: Array<LTableColumn>,
28
28
  actions?: Array<string>,
29
29
  sortBy?: string | null | undefined,
@@ -2,7 +2,7 @@
2
2
  import type { QTabsProps } from 'quasar';
3
3
  import { onMounted, useSlots } from '#imports';
4
4
  const model = defineModel<string | number | null | undefined>()
5
- export interface LTabsProps extends /* @vue-ignore */ QTabsProps {
5
+ export interface LTabsProps extends QTabsProps {
6
6
  }
7
7
  defineProps<LTabsProps>();
8
8
  const slots = useSlots()
@@ -2,7 +2,7 @@
2
2
  import { ref } from 'vue'
3
3
  import { useRouter, useRoute } from "vue-router";
4
4
  import { useQuasar } from "quasar";
5
- import { model } from "#imports";
5
+ import { model } from "#imports"
6
6
 
7
7
  const route = useRoute();
8
8
  const router = useRouter();
@@ -33,7 +33,7 @@ declare const app: {
33
33
  getCompany: () => string;
34
34
  setCompanyLogo: (logo: string) => void;
35
35
  getCompanyLogo: () => string;
36
- getVersion: () => string;
36
+ getVersion: () => any;
37
37
  addError: (error: String) => void;
38
38
  getErrors: () => String[];
39
39
  removeError: (error: String) => void;
@@ -82,7 +82,7 @@ export declare const useLight: (options?: {
82
82
  getCompany: () => string;
83
83
  setCompanyLogo: (logo: string) => void;
84
84
  getCompanyLogo: () => string;
85
- getVersion: () => string;
85
+ getVersion: () => any;
86
86
  addError: (error: String) => void;
87
87
  getErrors: () => String[];
88
88
  removeError: (error: String) => void;
@@ -98,4 +98,4 @@ export declare const useLight: (options?: {
98
98
  isGranted: (right?: string) => boolean;
99
99
  setPermissions: (permissions: Array<string>) => void;
100
100
  };
101
- export * from "./lib.js";
101
+ export * from "./lib";
@@ -1,6 +1,6 @@
1
1
  import packageJson from "../../package.json";
2
2
  import { watch, reactive, toRaw } from "vue";
3
- import { m, q } from "./lib/index.js";
3
+ import { m, q } from "./lib/index.mjs";
4
4
  const errors = [];
5
5
  let styles = {};
6
6
  const COLOR_CODE = {
@@ -207,4 +207,4 @@ export const useLight = (options = {}) => {
207
207
  }
208
208
  return app;
209
209
  };
210
- export * from "./lib/index.js";
210
+ export * from "./lib/index.mjs";
@@ -1,5 +1,5 @@
1
- import sv from "./sv.js";
2
- import { cache } from "./sv.js";
1
+ import sv from "./sv.mjs";
2
+ import { cache } from "./sv.mjs";
3
3
  export const loadSV = (name) => {
4
4
  return () => sv(name);
5
5
  };
@@ -19,5 +19,5 @@ export interface LightModel {
19
19
  name: string;
20
20
  fields: LightModelFields;
21
21
  }
22
- declare const _default: (model: LightModel) => import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
22
+ declare const _default: (model: LightModel) => any;
23
23
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { defineNuxtPlugin } from "#app";
2
- import { api } from "./index.js";
2
+ import { api } from "./index.mjs";
3
3
  export default (model) => {
4
4
  return defineNuxtPlugin(() => {
5
5
  api.models.create(model.name, model.fields);
@@ -1,5 +1,5 @@
1
1
  import { jsonToGraphQLQuery } from "json-to-graphql-query";
2
- import toJson from "./toJson.js";
2
+ import toJson from "./toJson.mjs";
3
3
  export default function(operation, args, fields = []) {
4
4
  if (arguments.length === 2) {
5
5
  fields = args;
@@ -1,4 +1,4 @@
1
- import { getApiBase } from "./index.js";
1
+ import { getApiBase } from "./index.mjs";
2
2
  export default function getApiUrl(url, params) {
3
3
  const urlParams = new URLSearchParams(params).toString();
4
4
  return getApiBase() + `${url}?${urlParams}`;
@@ -1,4 +1,4 @@
1
- import q from "./q.js";
1
+ import q from "./q.mjs";
2
2
  export default async () => {
3
3
  try {
4
4
  return await q("my", ["username", "first_name", "last_name", "roles"]);
@@ -1,5 +1,5 @@
1
- import GQLFieldBuilder from "./GQLFieldBuilder.js";
2
- import { api } from "./index.js";
1
+ import GQLFieldBuilder from "./GQLFieldBuilder.mjs";
2
+ import { api } from "./index.mjs";
3
3
  export default (name, fields) => {
4
4
  const builder = GQLFieldBuilder();
5
5
  fields.forEach((field) => {
@@ -1,4 +1,4 @@
1
- import { useLight } from "../index.js";
1
+ import { useLight } from "../index.mjs";
2
2
  export default () => {
3
3
  return useLight().getID();
4
4
  };
@@ -1,4 +1,4 @@
1
- import { getModelField } from "./index.js";
1
+ import { getModelField } from "./index.mjs";
2
2
  export default (model, names) => {
3
3
  let columns = [];
4
4
  for (let name of names) {
@@ -1,4 +1,4 @@
1
- import { api } from "./index.js";
1
+ import { api } from "./index.mjs";
2
2
  export default (name, field) => {
3
3
  return api.model(name).field(field);
4
4
  };
@@ -1,4 +1,4 @@
1
- import { getModelField } from "./index.js";
1
+ import { getModelField } from "./index.mjs";
2
2
  export default (model, names) => {
3
3
  let fields = [];
4
4
  for (let name of names) {
@@ -1,6 +1,6 @@
1
1
  import { useRoute } from "vue-router";
2
- import loadObject from "./loadObject.js";
3
- import { getModelField } from "./index.js";
2
+ import loadObject from "./loadObject.mjs";
3
+ import { getModelField } from "./index.mjs";
4
4
  export default async function(fields = []) {
5
5
  let route = useRoute();
6
6
  if (!route.name) {
@@ -1,27 +1,27 @@
1
1
  import type { LightClient } from '@hostlink/light';
2
- export { default as f } from "./f.js";
3
- export { default as getApiUrl } from "./getApiUrl.js";
4
- export { default as getCurrentUser } from "./getCurrentUser.js";
5
- export { default as getObject } from "./getObject.js";
6
- export { default as list } from "./list.js";
7
- export { default as m } from "./m.js";
8
- export { default as q } from "./q.js";
9
- export { default as t } from "./t.js";
10
- export { default as updateObject } from "./updateObject.js";
11
- export { default as listObject } from "./listObject.js";
12
- export { default as loadObject } from "./loadObject.js";
13
- export { default as isGranted } from "./isGranted.js";
14
- export { default as GQLFieldBuilder } from "./GQLFieldBuilder.js";
15
- export { default as getModelField } from "./getModelField.js";
16
- export { default as getModelFields } from "./getModelFields.js";
17
- export { default as getModelColumns } from "./getModelColumns.js";
18
- export { default as sv } from "./sv.js";
19
- export { default as model } from "./model.js";
20
- export { default as defineLightModel } from "./defineLightModel.js";
21
- export { type LightModelField, type LightModel } from "./defineLightModel.js";
2
+ export { default as f } from "./f";
3
+ export { default as getApiUrl } from "./getApiUrl";
4
+ export { default as getCurrentUser } from "./getCurrentUser";
5
+ export { default as getObject } from "./getObject";
6
+ export { default as list } from "./list";
7
+ export { default as m } from "./m";
8
+ export { default as q } from "./q";
9
+ export { default as t } from "./t";
10
+ export { default as updateObject } from "./updateObject";
11
+ export { default as listObject } from "./listObject";
12
+ export { default as loadObject } from "./loadObject";
13
+ export { default as isGranted } from "./isGranted";
14
+ export { default as GQLFieldBuilder } from "./GQLFieldBuilder";
15
+ export { default as getModelField } from "./getModelField";
16
+ export { default as getModelFields } from "./getModelFields";
17
+ export { default as getModelColumns } from "./getModelColumns";
18
+ export { default as sv } from "./sv";
19
+ export { default as model } from "./model";
20
+ export { default as defineLightModel } from "./defineLightModel";
21
+ export { type LightModelField, type LightModel } from "./defineLightModel";
22
22
  export declare const notify: (message: string, color?: string) => void;
23
- export { default as getID } from "./getID.js";
24
- export { default as id } from "./getID.js";
23
+ export { default as getID } from "./getID";
24
+ export { default as id } from "./getID";
25
25
  export declare const getApiBase: () => {};
26
26
  export declare const api: LightClient;
27
27
  export declare const getGQLFields: (name: string, fields: string[]) => any[];
@@ -0,0 +1,39 @@
1
+ import { useRuntimeConfig } from "nuxt/app";
2
+ import { Notify } from "quasar";
3
+ import { createClient } from "@hostlink/light";
4
+ export { default as f } from "./f.mjs";
5
+ export { default as getApiUrl } from "./getApiUrl.mjs";
6
+ export { default as getCurrentUser } from "./getCurrentUser.mjs";
7
+ export { default as getObject } from "./getObject.mjs";
8
+ export { default as list } from "./list.mjs";
9
+ export { default as m } from "./m.mjs";
10
+ export { default as q } from "./q.mjs";
11
+ export { default as t } from "./t.mjs";
12
+ export { default as updateObject } from "./updateObject.mjs";
13
+ export { default as listObject } from "./listObject.mjs";
14
+ export { default as loadObject } from "./loadObject.mjs";
15
+ export { default as isGranted } from "./isGranted.mjs";
16
+ export { default as GQLFieldBuilder } from "./GQLFieldBuilder.mjs";
17
+ export { default as getModelField } from "./getModelField.mjs";
18
+ export { default as getModelFields } from "./getModelFields.mjs";
19
+ export { default as getModelColumns } from "./getModelColumns.mjs";
20
+ export { default as sv } from "./sv.mjs";
21
+ export { default as model } from "./model.mjs";
22
+ export { default as defineLightModel } from "./defineLightModel.mjs";
23
+ export const notify = function(message, color = "positive") {
24
+ Notify.create({
25
+ message,
26
+ color,
27
+ position: "top"
28
+ });
29
+ };
30
+ export { default as getID } from "./getID.mjs";
31
+ export { default as id } from "./getID.mjs";
32
+ export const getApiBase = () => {
33
+ const config = useRuntimeConfig();
34
+ return config?.public?.apiBase ?? "/api/";
35
+ };
36
+ export const api = createClient("");
37
+ export const getGQLFields = (name, fields) => {
38
+ return api.model(name).gqlFields(fields);
39
+ };
@@ -1,5 +1,5 @@
1
1
  import { toQuery } from "@hostlink/light";
2
- import { api } from "./index.js";
2
+ import { api } from "./index.mjs";
3
3
  export default async function list(name, props = null, fields = []) {
4
4
  let q = {};
5
5
  if (props) {
@@ -1,2 +1,2 @@
1
- import { Fields } from "@hostlink/light";
1
+ import { type Fields } from "@hostlink/light";
2
2
  export default function listObject(name: string, filters: {} | undefined, sort: string, offset: number, limit: number, fields?: Fields): Promise<any>;
@@ -1,4 +1,4 @@
1
- import list from "./list.js";
1
+ import list from "./list.mjs";
2
2
  export default async function listObject(name, filters = {}, sort, offset, limit, fields = []) {
3
3
  const resp = await list(name, {
4
4
  filters,
@@ -1,4 +1,4 @@
1
- import list from "./list.js";
1
+ import list from "./list.mjs";
2
2
  export default async function(module, filters, fields = []) {
3
3
  let { data } = await list(module, {
4
4
  filters
@@ -1,4 +1,4 @@
1
- import { api } from "./index.js";
1
+ import { api } from "./index.mjs";
2
2
  export default function(operation, args, fields = []) {
3
3
  return api.mutation(operation, args, fields);
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import { api } from ".";
2
- import type { LTableColumn } from "../components/l-table.vue.js";
2
+ import type { LTableColumn } from "../components/l-table.vue";
3
3
  interface LModel extends ReturnType<typeof api.model> {
4
4
  columns(fields: string[]): Array<LTableColumn>;
5
5
  }
@@ -1,4 +1,4 @@
1
- import { api } from "./index.js";
1
+ import { api } from "./index.mjs";
2
2
  export default (name) => {
3
3
  const m = api.model(name);
4
4
  return Object.assign(m, {
@@ -1,7 +1,7 @@
1
- import f from "./f.js";
1
+ import f from "./f.mjs";
2
2
  import { jsonToGraphQLQuery } from "json-to-graphql-query";
3
3
  import { toQuery } from "@hostlink/light";
4
- import { api } from "./index.js";
4
+ import { api } from "./index.mjs";
5
5
  export default async function(operation, args = null, fields = []) {
6
6
  let query;
7
7
  if (operation instanceof Object) {
@@ -1,11 +1,11 @@
1
- import { q } from "#imports";
1
+ import { api } from "./index.mjs";
2
2
  export const cache = {};
3
3
  export default (name) => {
4
4
  if (cache[name]) {
5
5
  return cache[name];
6
6
  }
7
7
  const p = new Promise(async (resolve, reject) => {
8
- const resp = await q({
8
+ const resp = await api.query({
9
9
  systemValue: {
10
10
  __args: {
11
11
  name
@@ -1,4 +1,4 @@
1
- import m from "./m.js";
1
+ import m from "./m.mjs";
2
2
  import { Dialog } from "quasar";
3
3
  export default async (name, id, data) => {
4
4
  try {
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
2
  import { reactive } from 'vue'
3
- import { m, q } from '#imports'
3
+ import { m, api } from '#imports'
4
4
  import { useI18n } from 'vue-i18n';
5
5
  const { t } = useI18n();
6
6
 
7
- const { app, listRole: roles } = await q({
7
+ const { app, listRole: roles } = await api.query({
8
8
  app: {
9
9
  permissions: true
10
10
  },
@@ -1,12 +1,12 @@
1
1
  <script setup>
2
2
  import { reactive } from 'vue'
3
3
  import { utils, writeFileXLSX } from 'xlsx';
4
- import { q } from '#imports';
4
+ import { api } from '#imports';
5
5
  const obj = reactive({
6
6
  roles: []
7
7
  });
8
8
 
9
- const { app, listRole } = await q({
9
+ const { app, listRole } = await api.query({
10
10
  app: {
11
11
  permissions: true
12
12
  },
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
- import { q } from '#imports';
2
+ import { api } from '#imports';
3
3
 
4
- const { system: { database } } = await q({
4
+ const { system: { database } } = await api.query({
5
5
  system: {
6
6
  database: {
7
7
  table: true
@@ -17,8 +17,8 @@ const { system: { database } } = await q({
17
17
  <q-list class="rounded-borders" separator bordered>
18
18
  <q-expansion-item :label="table.name" v-for="table in database.table" dense>
19
19
  <div class="q-ma-sm">
20
- <q-table separator="cell" dense :rows="table.columns" :rows-per-page-options="[0]" hide-pagination
21
- flat bordered></q-table>
20
+ <q-table separator="cell" dense :rows="table.columns" :rows-per-page-options="[0]"
21
+ hide-pagination flat bordered></q-table>
22
22
  </div>
23
23
 
24
24
  </q-expansion-item>
@@ -4,12 +4,6 @@ import { useRoute } from "vue-router"
4
4
  import { ref } from 'vue';
5
5
  const route = useRoute();
6
6
 
7
-
8
- console.log(route);
9
-
10
-
11
-
12
-
13
7
  const obj = await getObject(["canUpdate"]);
14
8
 
15
9
  const light = useLight();
@@ -16,8 +16,6 @@ const columns = model("User").columns({
16
16
  has2FA: true,
17
17
  })
18
18
 
19
- console.log(columns);
20
-
21
19
  const status = ref("0");
22
20
 
23
21
  </script>
@@ -1,10 +1,11 @@
1
1
  <script setup>
2
- import { Dialog } from "quasar";
2
+ import { useQuasar } from "quasar";
3
3
  import { ref } from "vue"
4
- import { q, m, getCurrentUser } from '#imports'
4
+ import { q, m, getCurrentUser, api } from '#imports'
5
5
  const app = await q("app", ["hasBioAuth"]);
6
6
 
7
- import { api } from "#imports"
7
+
8
+ const quasar = useQuasar();
8
9
 
9
10
  const data = ref(await q("listWebAuthn", ["uuid", "ip", "user_agent", "createdTime"]));
10
11
 
@@ -15,7 +16,7 @@ const register = async () => {
15
16
  const user = await getCurrentUser();
16
17
  localStorage.setItem("username", user.username);
17
18
  } catch (e) {
18
- Dialog.create({
19
+ quasar.dialog({
19
20
  title: "Error",
20
21
  message: e.message,
21
22
  ok: "OK"
@@ -49,7 +50,7 @@ const columns = [
49
50
 
50
51
  const deleteItem = async (uuid) => {
51
52
  //confirm
52
- Dialog.create({
53
+ quasar.dialog({
53
54
  title: "Delete",
54
55
  color: "negative",
55
56
  message: "Are you sure you want to delete this item?",
@@ -2,7 +2,6 @@
2
2
  import { useI18n } from 'vue-i18n'
3
3
  import { Dialog } from 'quasar'
4
4
  import { reset } from "@formkit/core"
5
-
6
5
  import { computed } from 'vue'
7
6
  import { q, api } from "#imports"
8
7
 
@@ -28,7 +28,7 @@ if (my.twoFactorEnabled) {
28
28
 
29
29
  </script>
30
30
  <template>
31
- <l-form @save="save" :bordered="false" v-if="show">
31
+ <l-form @submit="save" :bordered="false" v-if="show">
32
32
  <div>
33
33
  <p>
34
34
  Now download the app and scan the qrcode. Input the code to the
@@ -1,3 +1,3 @@
1
- import "./assets/main.css.js";
2
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
1
+ import "./assets/main.css";
2
+ declare const _default: any;
3
3
  export default _default;
@@ -4,17 +4,17 @@ import { defineNuxtPlugin } from "#app";
4
4
  import "./assets/main.css";
5
5
  import message_en from "./locales/en.json";
6
6
  import message_zh from "./locales/zh-hk.json";
7
- import { api } from "./lib/index.js";
7
+ import { api } from "./lib/index.mjs";
8
8
  localStorage.getItem("locale") || localStorage.setItem("locale", "en");
9
9
  import { createQuasarPlugin } from "formkit-quasar";
10
- import { createLightPlugin } from "./formkit/index.js";
10
+ import { createLightPlugin } from "./formkit/index.mjs";
11
11
  import { plugin, defaultConfig } from "@formkit/vue";
12
- import { getApiBase, useLight } from "./index.js";
13
- import TypeUser from "./types/User.js";
14
- import TypeUserLog from "./types/UserLog.js";
15
- import TypeSystemValue from "./types/SystemValue.js";
16
- import TypeMailLog from "./types/MailLog.js";
17
- import TypeEventLog from "./types/EventLog.js";
12
+ import { getApiBase, useLight } from "./index.mjs";
13
+ import TypeUser from "./types/User.mjs";
14
+ import TypeUserLog from "./types/UserLog.mjs";
15
+ import TypeSystemValue from "./types/SystemValue.mjs";
16
+ import TypeMailLog from "./types/MailLog.mjs";
17
+ import TypeEventLog from "./types/EventLog.mjs";
18
18
  import { zhTW } from "@formkit/i18n";
19
19
  export default defineNuxtPlugin((nuxtApp) => {
20
20
  api.axios.defaults.baseURL = getApiBase();
package/dist/types.d.mts CHANGED
@@ -1 +1,16 @@
1
- export { type ModuleOptions, default } from './module.js'
1
+
2
+ import type { ModuleOptions } from './module.js'
3
+
4
+
5
+ declare module '@nuxt/schema' {
6
+ interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
7
+ interface NuxtOptions { ['light']?: ModuleOptions }
8
+ }
9
+
10
+ declare module 'nuxt/schema' {
11
+ interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
12
+ interface NuxtOptions { ['light']?: ModuleOptions }
13
+ }
14
+
15
+
16
+ export type { ModuleOptions, default } from './module.js'
package/dist/types.d.ts CHANGED
@@ -1 +1,16 @@
1
- export { type ModuleOptions, default } from './module'
1
+
2
+ import type { ModuleOptions } from './module'
3
+
4
+
5
+ declare module '@nuxt/schema' {
6
+ interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
7
+ interface NuxtOptions { ['light']?: ModuleOptions }
8
+ }
9
+
10
+ declare module 'nuxt/schema' {
11
+ interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
12
+ interface NuxtOptions { ['light']?: ModuleOptions }
13
+ }
14
+
15
+
16
+ export type { ModuleOptions, default } from './module'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.13.2",
3
+ "version": "1.13.5",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",
@@ -10,6 +10,10 @@
10
10
  "types": "./dist/types.d.ts",
11
11
  "import": "./dist/module.mjs",
12
12
  "require": "./dist/module.cjs"
13
+ },
14
+ "./dist": {
15
+ "types": "./dist/runtime/index.d.ts",
16
+ "import": "./dist/runtime/index.mjs"
13
17
  }
14
18
  },
15
19
  "main": "./dist/module.cjs",
@@ -21,7 +25,7 @@
21
25
  "prepack": "nuxt-module-build build",
22
26
  "dev": "nuxi dev playground --host",
23
27
  "dev:build": "nuxi build playground",
24
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
28
+ "dev:prepare": "nuxt-module-build build --stub && nuxi prepare playground",
25
29
  "release:org": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
26
30
  "release": "npm run prepack && changelogen --release && npm publish --access=public && git push --follow-tags",
27
31
  "lint": "eslint .",
@@ -29,26 +33,26 @@
29
33
  "test:watch": "vitest watch"
30
34
  },
31
35
  "dependencies": {
32
- "@formkit/drag-and-drop": "^0.1.6",
36
+ "@formkit/drag-and-drop": "^0.0.36",
33
37
  "@hostlink/light": "^2.0.1",
34
- "@nuxt/kit": "^3.13.0",
38
+ "@nuxt/kit": "^3.7.4",
39
+ "@nuxt/module-builder": "^0.5.2",
35
40
  "@quasar/extras": "^1.16.11",
36
41
  "@quasar/vite-plugin": "^1.7.0",
37
- "axios": "^1.7.7",
42
+ "axios": "^1.5.0",
38
43
  "diff2html": "^3.4.47",
39
44
  "formkit-quasar": "^0.0.15",
40
45
  "json-to-graphql-query": "^2.2.5",
41
- "quasar": "^2.16.9",
46
+ "quasar": "^2.15.4",
42
47
  "vue-i18n": "^9.2.2",
43
48
  "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
44
49
  },
45
50
  "devDependencies": {
46
51
  "@nuxt/devtools": "latest",
47
52
  "@nuxt/eslint-config": "^0.2.0",
48
- "@nuxt/module-builder": "^0.8.3",
49
53
  "@nuxt/schema": "^3.7.4",
50
54
  "@nuxt/test-utils": "^3.7.0",
51
- "@types/node": "^22.5.0",
55
+ "@types/node": "^18.17.3",
52
56
  "changelogen": "^0.5.4",
53
57
  "eslint": "^8.46.0",
54
58
  "nuxt": "^3.7.0"
@@ -1,39 +0,0 @@
1
- import { useRuntimeConfig } from "nuxt/app";
2
- import { Notify } from "quasar";
3
- import { createClient } from "@hostlink/light";
4
- export { default as f } from "./f.js";
5
- export { default as getApiUrl } from "./getApiUrl.js";
6
- export { default as getCurrentUser } from "./getCurrentUser.js";
7
- export { default as getObject } from "./getObject.js";
8
- export { default as list } from "./list.js";
9
- export { default as m } from "./m.js";
10
- export { default as q } from "./q.js";
11
- export { default as t } from "./t.js";
12
- export { default as updateObject } from "./updateObject.js";
13
- export { default as listObject } from "./listObject.js";
14
- export { default as loadObject } from "./loadObject.js";
15
- export { default as isGranted } from "./isGranted.js";
16
- export { default as GQLFieldBuilder } from "./GQLFieldBuilder.js";
17
- export { default as getModelField } from "./getModelField.js";
18
- export { default as getModelFields } from "./getModelFields.js";
19
- export { default as getModelColumns } from "./getModelColumns.js";
20
- export { default as sv } from "./sv.js";
21
- export { default as model } from "./model.js";
22
- export { default as defineLightModel } from "./defineLightModel.js";
23
- export const notify = function(message, color = "positive") {
24
- Notify.create({
25
- message,
26
- color,
27
- position: "top"
28
- });
29
- };
30
- export { default as getID } from "./getID.js";
31
- export { default as id } from "./getID.js";
32
- export const getApiBase = () => {
33
- const config = useRuntimeConfig();
34
- return config?.public?.apiBase ?? "/api/";
35
- };
36
- export const api = createClient("");
37
- export const getGQLFields = (name, fields) => {
38
- return api.model(name).gqlFields(fields);
39
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes