@hostlink/nuxt-light 0.0.3 → 0.0.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.
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -4
- package/dist/runtime/components/l-add-btn.vue +2 -0
- package/dist/runtime/components/l-app-main.vue +6 -3
- package/dist/runtime/components/l-app.vue +1 -0
- package/dist/runtime/components/l-btn.vue +2 -0
- package/dist/runtime/components/l-date-picker.vue +1 -0
- package/dist/runtime/components/l-file-manager-move.vue +2 -0
- package/dist/runtime/components/l-file-manager-preview.vue +1 -0
- package/dist/runtime/components/l-file-manager.vue +5 -3
- package/dist/runtime/components/l-file.vue +1 -0
- package/dist/runtime/components/l-form.vue +3 -0
- package/dist/runtime/components/l-input.vue +1 -0
- package/dist/runtime/components/l-login.vue +3 -1
- package/dist/runtime/components/l-page.vue +2 -1
- package/dist/runtime/components/l-select.vue +1 -3
- package/dist/runtime/components/l-table.vue +3 -2
- package/dist/runtime/components/l-time-picker.vue +2 -1
- package/dist/runtime/composables/addObject.mjs +1 -0
- package/dist/runtime/composables/getCurrentUser.mjs +1 -0
- package/dist/runtime/composables/getObject.mjs +2 -0
- package/dist/runtime/composables/id.mjs +1 -0
- package/dist/runtime/composables/list.mjs +2 -0
- package/dist/runtime/composables/listData.mjs +2 -0
- package/dist/runtime/composables/login.mjs +4 -13
- package/dist/runtime/composables/q.mjs +1 -0
- package/dist/runtime/composables/removeObject.mjs +1 -1
- package/dist/runtime/composables/updateObject.mjs +1 -0
- package/dist/runtime/light.d.ts +12 -0
- package/dist/runtime/{composables/useLight.mjs → light.mjs} +6 -0
- package/dist/runtime/pages/User/profile.vue +1 -1
- package/dist/runtime/plugin.mjs +2 -1
- package/package.json +1 -1
- package/dist/runtime/composables/useLight.d.ts +0 -7
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addComponentsDir, addPlugin } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir, addPlugin } from '@nuxt/kit';
|
|
2
2
|
import AutoImport from 'unplugin-auto-import/vite';
|
|
3
3
|
|
|
4
4
|
const module = defineNuxtModule({
|
|
@@ -36,14 +36,14 @@ const module = defineNuxtModule({
|
|
|
36
36
|
"useI18n"
|
|
37
37
|
]
|
|
38
38
|
}
|
|
39
|
-
],
|
|
40
|
-
dirs: [
|
|
41
|
-
resolver.resolve("./runtime/composables")
|
|
42
39
|
]
|
|
43
40
|
}));
|
|
44
41
|
addComponentsDir({
|
|
45
42
|
path: resolver.resolve("./runtime/components")
|
|
46
43
|
});
|
|
44
|
+
addImportsDir(resolver.resolve("./runtime/composables"), {
|
|
45
|
+
prepend: true
|
|
46
|
+
});
|
|
47
47
|
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
48
48
|
}
|
|
49
49
|
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useI18n } from 'vue-i18n';
|
|
3
|
-
import
|
|
3
|
+
import { useLight, q, getCurrentUser } from '../light';
|
|
4
|
+
import { ref, computed, reactive } from 'vue';
|
|
5
|
+
|
|
4
6
|
|
|
5
7
|
const light = useLight();
|
|
6
8
|
const props = defineProps({
|
|
@@ -195,7 +197,8 @@ const errors = computed(() => {
|
|
|
195
197
|
|
|
196
198
|
<q-card v-for="error in errors" flat class="q-ma-md" bordered style="border-color: var(--q-negative)">
|
|
197
199
|
<q-card-section>
|
|
198
|
-
<q-btn dense flat round icon="close" class="q-mr-sm" @click="light.removeError(error)"></q-btn>{{
|
|
200
|
+
<q-btn dense flat round icon="close" class="q-mr-sm" @click="light.removeError(error)"></q-btn>{{
|
|
201
|
+
error }}
|
|
199
202
|
</q-card-section>
|
|
200
203
|
</q-card>
|
|
201
204
|
<slot />
|
|
@@ -205,7 +208,7 @@ const errors = computed(() => {
|
|
|
205
208
|
<q-footer class="bg-white text-grey" bordered>
|
|
206
209
|
<q-item>
|
|
207
210
|
<q-item-section>
|
|
208
|
-
{{ company }}
|
|
211
|
+
{{ company }} 0.0.1 - Copyright 2023 HostLink(HK)
|
|
209
212
|
</q-item-section>
|
|
210
213
|
</q-item>
|
|
211
214
|
</q-footer>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { VariableType } from "json-to-graphql-query";
|
|
3
3
|
import { useI18n } from "vue-i18n";
|
|
4
|
-
|
|
4
|
+
import { ref } from 'vue';
|
|
5
|
+
import { useQuasar } from 'quasar';
|
|
5
6
|
|
|
7
|
+
const quasar = useQuasar();
|
|
6
8
|
const emit = defineEmits(["input", "close"]);
|
|
7
9
|
|
|
8
10
|
defineProps({
|
|
@@ -307,7 +309,7 @@ const onRenameRow = (row) => {
|
|
|
307
309
|
title: "Error",
|
|
308
310
|
message: e.message,
|
|
309
311
|
});
|
|
310
|
-
|
|
312
|
+
|
|
311
313
|
return;
|
|
312
314
|
}
|
|
313
315
|
|
|
@@ -485,7 +487,7 @@ const reloadStorage = async () => {
|
|
|
485
487
|
|
|
486
488
|
<q-drawer side="right" show-if-above bordered>
|
|
487
489
|
|
|
488
|
-
<l-file-manager-preview v-model="preview" v-if="preview" :key="preview.path"/>
|
|
490
|
+
<l-file-manager-preview v-model="preview" v-if="preview" :key="preview.path" />
|
|
489
491
|
</q-drawer>
|
|
490
492
|
|
|
491
493
|
<q-page-container :style="{ height }">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useRouter, useRoute } from "vue-router"
|
|
2
3
|
const router = useRouter();
|
|
3
4
|
const route = useRoute();
|
|
4
5
|
|
|
@@ -61,7 +62,7 @@ if (props.deleteBtn) {
|
|
|
61
62
|
showDeleteBtn = true
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
if(props.addBtn){
|
|
65
|
+
if (props.addBtn) {
|
|
65
66
|
showToolbar = true
|
|
66
67
|
showAddBtn = true
|
|
67
68
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useQuasar } from 'quasar';
|
|
3
|
+
import { useRoute } from 'vue-router';
|
|
4
|
+
import { ref, computed, onMounted } from "vue";
|
|
5
|
+
|
|
3
6
|
const route = useRoute();
|
|
4
7
|
const module = route.path.split("/")[1];
|
|
5
8
|
const errors = ref([]);
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
9
10
|
const props = defineProps({
|
|
10
11
|
columns: {
|
|
11
12
|
type: Array,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { computed, ref } from "vue";
|
|
2
3
|
const props = defineProps(["modelValue"]);
|
|
3
4
|
const emit = defineEmits(["update:modelValue"]);
|
|
4
5
|
const popup = ref(null);
|
|
5
6
|
const localValue = computed({
|
|
6
7
|
get: () => props.modelValue,
|
|
7
8
|
set: (value) => {
|
|
8
|
-
|
|
9
|
+
// popup.value.hide();
|
|
9
10
|
emit('update:modelValue', value)
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import m from "./m.mjs";
|
|
2
2
|
export default async (username, password) => {
|
|
3
|
-
await
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
username: {
|
|
7
|
-
value: username,
|
|
8
|
-
required: true
|
|
9
|
-
},
|
|
10
|
-
password: {
|
|
11
|
-
value: password,
|
|
12
|
-
required: true
|
|
13
|
-
}
|
|
14
|
-
}
|
|
3
|
+
await m("login", {
|
|
4
|
+
username,
|
|
5
|
+
password
|
|
15
6
|
});
|
|
16
7
|
return true;
|
|
17
8
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useQuasar } from "quasar";
|
|
2
|
+
import m from "./m.mjs";
|
|
2
3
|
const qua = useQuasar();
|
|
3
4
|
export default async function removeObject(name, id) {
|
|
4
5
|
let { data } = await m(`remove${name}`, { id });
|
|
5
6
|
let result = data[`remove${name}`];
|
|
6
|
-
console.log(result);
|
|
7
7
|
if (result.errors) {
|
|
8
8
|
qua.dialog({
|
|
9
9
|
title: "Error",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface Light {
|
|
2
|
+
addError: (error: String) => void;
|
|
3
|
+
getErrors: () => String[];
|
|
4
|
+
removeError: (error: String) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function useLight(): Light;
|
|
7
|
+
import q from "./composables/q";
|
|
8
|
+
import m from "./composables/m";
|
|
9
|
+
import f from "./composables/f";
|
|
10
|
+
import getCurrentUser from "./composables/getCurrentUser";
|
|
11
|
+
import login from "./composables/login";
|
|
12
|
+
export { q, getCurrentUser, login, m, f };
|
|
@@ -15,3 +15,9 @@ export function useLight() {
|
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
+
import q from "./composables/q.mjs";
|
|
19
|
+
import m from "./composables/m.mjs";
|
|
20
|
+
import f from "./composables/f.mjs";
|
|
21
|
+
import getCurrentUser from "./composables/getCurrentUser.mjs";
|
|
22
|
+
import login from "./composables/login.mjs";
|
|
23
|
+
export { q, getCurrentUser, login, m, f };
|
|
@@ -5,7 +5,7 @@ const my = await q("my", ["username", "first_name", "last_name", "email", "phone
|
|
|
5
5
|
<template>
|
|
6
6
|
<l-page title="User profile">
|
|
7
7
|
<template #header>
|
|
8
|
-
<q-btn rounded icon="sym_o_key" to="update-password" outline color="primary"
|
|
8
|
+
<q-btn rounded icon="sym_o_key" to="update-password" outline color="primary" label="Update password"></q-btn>
|
|
9
9
|
</template>
|
|
10
10
|
<l-card>
|
|
11
11
|
<l-list>
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { Quasar, Dialog, Notify, Loading } from "quasar";
|
|
|
2
2
|
import ElementPlus from "element-plus";
|
|
3
3
|
import { createI18n } from "vue-i18n";
|
|
4
4
|
import { defineNuxtPlugin } from "#app";
|
|
5
|
+
import { useRouter } from "vue-router";
|
|
5
6
|
import "./assets/main.css";
|
|
6
7
|
import "./assets/element.css";
|
|
7
8
|
import zhTW from "element-plus/es/locale/lang/zh-tw";
|
|
@@ -10,7 +11,7 @@ import message_en from "./locales/en.json";
|
|
|
10
11
|
import message_zh from "./locales/zh-hk.json";
|
|
11
12
|
import routes from "./routes.mjs";
|
|
12
13
|
localStorage.getItem("locale") || localStorage.setItem("locale", "en");
|
|
13
|
-
import { useLight } from "./
|
|
14
|
+
import { useLight } from "./light.mjs";
|
|
14
15
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
15
16
|
let locale = localStorage.getItem("locale") || "en";
|
|
16
17
|
nuxtApp.vueApp.config.errorHandler = (error) => {
|
package/package.json
CHANGED