@hostlink/nuxt-light 1.6.1 → 1.6.3
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/runtime/components/l-app-main.vue +3 -1
- package/dist/runtime/components/l-fav-menu.vue +3 -1
- package/dist/runtime/components/l-file-manager.vue +0 -1
- package/dist/runtime/components/l-login.vue +16 -10
- package/dist/runtime/components/l-menu.vue +29 -47
- package/dist/runtime/components/l-table.vue +5 -6
- package/dist/runtime/formkit/Select.vue +0 -2
- package/dist/runtime/pages/System/menu/index.vue +7 -5
- package/dist/runtime/pages/User/add.vue +0 -2
- package/dist/runtime/pages/User/setting/open_id.vue +28 -20
- package/dist/runtime/plugin.mjs +3 -2
- package/package.json +2 -2
package/dist/module.json
CHANGED
|
@@ -34,6 +34,8 @@ const light = useLight({
|
|
|
34
34
|
});
|
|
35
35
|
light.init(my.styles);
|
|
36
36
|
|
|
37
|
+
quasar.addressbarColor.set(light.color);
|
|
38
|
+
|
|
37
39
|
//set permission
|
|
38
40
|
light.setPermissions(my.permissions);
|
|
39
41
|
|
|
@@ -396,7 +398,7 @@ const c1 = computed(() => {
|
|
|
396
398
|
|
|
397
399
|
<div class="q-mx-sm">
|
|
398
400
|
<l-fav-menu :value="myFavorites" :dense="style.dense" v-if="myFavoritesCount > 0" />
|
|
399
|
-
<l-menu
|
|
401
|
+
<l-menu :value="menus" :dense="style.dense" />
|
|
400
402
|
|
|
401
403
|
</div>
|
|
402
404
|
|
|
@@ -16,13 +16,14 @@ const color2 = computed(() => {
|
|
|
16
16
|
return c;
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
</script>
|
|
20
21
|
|
|
21
22
|
<style scoped>
|
|
22
23
|
.menu-list .q-item{border-radius:12px 12px 12px 12px}.menu-list .q-router-link--exact-active{background:linear-gradient(118deg,v-bind(color1),v-bind(color2));color:#fff}
|
|
23
24
|
</style>
|
|
24
25
|
<template>
|
|
25
|
-
<q-expansion-item :label="$t('My favorite')" :dense="dense"
|
|
26
|
+
<q-expansion-item :label="$t('My favorite')" :dense="dense" icon="sym_o_favorite">
|
|
26
27
|
<q-list class="q-pl-md menu-list">
|
|
27
28
|
<q-item v-ripple :to="item.path" v-for="item in value">
|
|
28
29
|
<q-item-section avatar>
|
|
@@ -31,6 +32,7 @@ const color2 = computed(() => {
|
|
|
31
32
|
<q-item-section>
|
|
32
33
|
<q-item-label v-text="$t(item.label)"></q-item-label>
|
|
33
34
|
</q-item-section>
|
|
35
|
+
|
|
34
36
|
</q-item>
|
|
35
37
|
</q-list>
|
|
36
38
|
</q-expansion-item>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useLight } from "#imports";
|
|
3
|
-
import { ref, reactive, onMounted
|
|
3
|
+
import { ref, reactive, onMounted } from 'vue'
|
|
4
4
|
import { useQuasar, Notify, Dialog } from 'quasar';
|
|
5
5
|
import { useI18n } from 'vue-i18n';
|
|
6
6
|
import { m, notify } from '#imports';
|
|
@@ -170,13 +170,8 @@ onMounted(() => {
|
|
|
170
170
|
logo_alignment: 'left'
|
|
171
171
|
}
|
|
172
172
|
);
|
|
173
|
-
|
|
174
173
|
}
|
|
175
|
-
|
|
176
174
|
})
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
175
|
</script>
|
|
181
176
|
|
|
182
177
|
<template>
|
|
@@ -187,18 +182,29 @@ onMounted(() => {
|
|
|
187
182
|
<q-img src="https://raw.githubusercontent.com/HostLink/.github/master/profile/logo.webp" class="full-width" />
|
|
188
183
|
</template>
|
|
189
184
|
</q-img>
|
|
190
|
-
|
|
191
185
|
<div class="text-h6">
|
|
192
186
|
{{ light.getCompany() }}
|
|
193
187
|
</div>
|
|
194
188
|
<q-form ref="form1">
|
|
195
189
|
<div class="q-gutter-sm">
|
|
196
190
|
<l-input v-model.trim="data.username" label="Username" :rules="[v => !!v || $t('Username is required')]"
|
|
197
|
-
clearable :outlined="false" stackLabel autocomplete="username"
|
|
191
|
+
clearable :outlined="false" stackLabel autocomplete="username">
|
|
192
|
+
<template v-slot:prepend>
|
|
193
|
+
<q-icon name="sym_o_person" />
|
|
194
|
+
</template>
|
|
195
|
+
</l-input>
|
|
198
196
|
<l-input v-model="data.password" label="Password" type="password" clearable show-password stackLabel
|
|
199
197
|
:rules="[v => !!v || $t('Password is required')]" @keydown.enter.prevent="submit" :outlined="false"
|
|
200
|
-
autocomplete="current-password"
|
|
201
|
-
|
|
198
|
+
autocomplete="current-password">
|
|
199
|
+
<template v-slot:prepend>
|
|
200
|
+
<q-icon name="sym_o_lock" />
|
|
201
|
+
</template>
|
|
202
|
+
</l-input>
|
|
203
|
+
<l-input v-if="twoFactorAuthentication" v-model="data.code" label="2FA code"
|
|
204
|
+
:rules="[v => !!v || $t('2FA code is required')]" type="text" clearable stackLabel :outlined="false">
|
|
205
|
+
<template v-slot:prepend>
|
|
206
|
+
<q-icon name="sym_o_key" />
|
|
207
|
+
</template>
|
|
202
208
|
</l-input>
|
|
203
209
|
</div>
|
|
204
210
|
</q-form>
|
|
@@ -2,40 +2,14 @@
|
|
|
2
2
|
import { ref, computed } from 'vue'
|
|
3
3
|
import { useLight } from '#imports'
|
|
4
4
|
const props = defineProps(["value", "dense"])
|
|
5
|
-
const menus = ref(null);
|
|
6
5
|
const light = useLight();
|
|
7
6
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
menus.value.forEach((m) => {
|
|
12
|
-
if (m.value() !== menu) {
|
|
13
|
-
m.hide()
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
defineExpose({
|
|
19
|
-
hide: () => {
|
|
20
|
-
if (expansion.value) {
|
|
21
|
-
expansion.value.hide();
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
value: () => {
|
|
25
|
-
return props.value;
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
const isShowExpansionItem = computed(() => {
|
|
30
|
-
if (props.value.children) {
|
|
31
|
-
if (props.value.children.length > 0) {
|
|
32
|
-
return true;
|
|
33
|
-
|
|
34
|
-
}
|
|
7
|
+
const isShowExpansionItem = (menu) => {
|
|
8
|
+
if (menu.children && menu.children.length > 0) {
|
|
9
|
+
return true;
|
|
35
10
|
}
|
|
36
11
|
return false;
|
|
37
|
-
|
|
38
|
-
});
|
|
12
|
+
};
|
|
39
13
|
|
|
40
14
|
const color1 = computed(() => {
|
|
41
15
|
return light.getColorValue()
|
|
@@ -48,28 +22,36 @@ const color2 = computed(() => {
|
|
|
48
22
|
return c;
|
|
49
23
|
});
|
|
50
24
|
|
|
25
|
+
//generate a random group name
|
|
26
|
+
const group = Math.random().toString(36).substring(7);
|
|
51
27
|
</script>
|
|
52
28
|
|
|
53
29
|
<style scoped>
|
|
54
30
|
.menu-list .q-item{border-radius:12px 12px 12px 12px}.menu-list .q-router-link--exact-active{background:linear-gradient(118deg,v-bind(color1),v-bind(color2));color:#fff}
|
|
55
31
|
</style>
|
|
56
32
|
<template>
|
|
57
|
-
<q-
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
33
|
+
<q-list class="menu-list" :dense="dense">
|
|
34
|
+
<template v-for="menu in value">
|
|
35
|
+
|
|
36
|
+
<q-expansion-item :label="$t(menu.label)" :icon="menu.icon" :dense="dense" v-if="isShowExpansionItem(menu)"
|
|
37
|
+
:group="group">
|
|
38
|
+
<l-menu class="q-pl-md" :value="menu.children" :dense="dense"></l-menu>
|
|
39
|
+
</q-expansion-item>
|
|
40
|
+
|
|
41
|
+
<template v-else>
|
|
42
|
+
<q-separator v-if="menu.type == 'separator'" :spaced="menu.spaced" />
|
|
43
|
+
<q-item-label header v-if="menu.type == 'header'">{{ menu.label }}</q-item-label>
|
|
44
|
+
|
|
45
|
+
<q-item v-ripple :to="menu.to" v-if="!value.type">
|
|
46
|
+
<q-item-section avatar>
|
|
47
|
+
<q-icon :name="menu.icon" />
|
|
48
|
+
</q-item-section>
|
|
49
|
+
<q-item-section>
|
|
50
|
+
<q-item-label v-text="$t(menu.label)"></q-item-label>
|
|
51
|
+
</q-item-section>
|
|
52
|
+
</q-item>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
</template>
|
|
74
56
|
</q-list>
|
|
75
57
|
</template>
|
|
@@ -375,8 +375,7 @@ const getFilterValue = () => {
|
|
|
375
375
|
|
|
376
376
|
|
|
377
377
|
const onFilters = () => {
|
|
378
|
-
|
|
379
|
-
|
|
378
|
+
|
|
380
379
|
//clone the filters
|
|
381
380
|
onRequest({
|
|
382
381
|
pagination: {
|
|
@@ -493,7 +492,6 @@ const localSelected = computed({
|
|
|
493
492
|
return props.selected;
|
|
494
493
|
},
|
|
495
494
|
set(val) {
|
|
496
|
-
console.log(val)
|
|
497
495
|
emits("update:selected", val);
|
|
498
496
|
}
|
|
499
497
|
});
|
|
@@ -604,13 +602,13 @@ const localSelected = computed({
|
|
|
604
602
|
<template v-if="col.searchType == 'number'">
|
|
605
603
|
<q-input style="min-width: 80px;" dense clearable filled square
|
|
606
604
|
v-model.number="filters[col.name]" @keydown.enter.prevent="onFilters" @clear="onFilters"
|
|
607
|
-
mask="##########"></q-input>
|
|
605
|
+
mask="##########" enterkeyhint="search"></q-input>
|
|
608
606
|
</template>
|
|
609
607
|
|
|
610
608
|
<template v-if="col.searchType == 'select'">
|
|
611
609
|
<q-select dense clearable filled square v-model="filters[col.name]"
|
|
612
610
|
@update:model-value="onFilters" options-dense :options="col.searchOptions" emit-value
|
|
613
|
-
map-options :multiple="col.searchMultiple" />
|
|
611
|
+
map-options :multiple="col.searchMultiple" :color="$light.color" />
|
|
614
612
|
|
|
615
613
|
</template>
|
|
616
614
|
|
|
@@ -622,7 +620,8 @@ const localSelected = computed({
|
|
|
622
620
|
|
|
623
621
|
<template v-if="!col.searchType">
|
|
624
622
|
<q-input style="min-width: 80px;" dense clearable filled square v-model="filters[col.name]"
|
|
625
|
-
@keydown.enter.prevent="onFilters" @clear="onFilters" enterkeyhint="search"
|
|
623
|
+
@keydown.enter.prevent="onFilters" @clear="onFilters" enterkeyhint="search"
|
|
624
|
+
:color="$light.color"></q-input>
|
|
626
625
|
|
|
627
626
|
</template>
|
|
628
627
|
|
|
@@ -14,8 +14,6 @@ const value = computed({
|
|
|
14
14
|
set: (val) => props.context.node.input(val)
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
//console.log(props.context.node.props.parsedRules);
|
|
18
|
-
|
|
19
17
|
//check required in parsedRules
|
|
20
18
|
let required = false;
|
|
21
19
|
for (let rule of props.context.node.props.parsedRules ?? []) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, computed, inject } from 'vue';
|
|
3
3
|
import { m, q } from '#imports'
|
|
4
|
-
import { useQuasar } from 'quasar';
|
|
4
|
+
import { useQuasar, Dialog } from 'quasar';
|
|
5
|
+
import { useI18n } from 'vue-i18n'
|
|
5
6
|
|
|
7
|
+
const { t } = useI18n()
|
|
6
8
|
const quasar = useQuasar();
|
|
7
9
|
const appMenus = await q("appMenus", [])
|
|
8
10
|
|
|
@@ -38,14 +40,14 @@ const onReload = async () => {
|
|
|
38
40
|
|
|
39
41
|
const onAddChild = (node) => {
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
title: 'Add
|
|
43
|
-
message: 'Enter menu label',
|
|
43
|
+
Dialog.create({
|
|
44
|
+
title: t('Add child menu'),
|
|
45
|
+
message: t('Enter menu label'),
|
|
44
46
|
prompt: {
|
|
45
47
|
model: '',
|
|
46
48
|
},
|
|
47
49
|
cancel: true,
|
|
48
|
-
persistent: true
|
|
50
|
+
persistent: true
|
|
49
51
|
}).onOk((data) => {
|
|
50
52
|
if (data === '') return;
|
|
51
53
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { reactive, onMounted } from "vue"
|
|
2
|
+
import { reactive, onMounted, nextTick } from "vue"
|
|
3
3
|
import { Notify } from "quasar";
|
|
4
|
-
import { q, m } from '
|
|
4
|
+
import { q, m } from '#imports'
|
|
5
5
|
let { app, my } = await q({ app: ['googleClientId'], my: ["gmail"] })
|
|
6
6
|
|
|
7
7
|
my = reactive(my);
|
|
@@ -25,6 +25,7 @@ const handleGoogleCredentialResponse = async (response) => {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
onMounted(() => {
|
|
28
|
+
|
|
28
29
|
if (app.googleClientId) {
|
|
29
30
|
if (!window.google) {
|
|
30
31
|
Notify.create({
|
|
@@ -38,23 +39,30 @@ onMounted(() => {
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
//nextTick
|
|
43
|
+
|
|
44
|
+
nextTick(() => {
|
|
45
|
+
|
|
46
|
+
//google
|
|
47
|
+
google.accounts.id.initialize({
|
|
48
|
+
client_id: app.googleClientId,
|
|
49
|
+
callback: handleGoogleCredentialResponse,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
google.accounts.id.renderButton(
|
|
53
|
+
document.getElementById('g_id_signin'),
|
|
54
|
+
{
|
|
55
|
+
type: 'profile',
|
|
56
|
+
shape: 'pill',
|
|
57
|
+
theme: 'outline',
|
|
58
|
+
text: 'signin_with',
|
|
59
|
+
size: 'large',
|
|
60
|
+
logo_alignment: 'left'
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
})
|
|
65
|
+
|
|
58
66
|
|
|
59
67
|
});
|
|
60
68
|
|
|
@@ -79,7 +87,7 @@ const unlink = async () => {
|
|
|
79
87
|
<div>
|
|
80
88
|
<l-btn label="Unlink" @click="unlink" icon="sym_o_delete"></l-btn>
|
|
81
89
|
</div>
|
|
82
|
-
|
|
90
|
+
|
|
83
91
|
</q-card-section>
|
|
84
92
|
|
|
85
93
|
<q-card-section v-else>
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Quasar, Dialog, Notify, Loading, AppFullscreen } from "quasar";
|
|
1
|
+
import { Quasar, Dialog, Notify, Loading, AppFullscreen, AddressbarColor } from "quasar";
|
|
2
2
|
import { createI18n } from "vue-i18n";
|
|
3
3
|
import { defineNuxtPlugin } from "#app";
|
|
4
4
|
import { useRouter } from "vue-router";
|
|
@@ -60,7 +60,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
60
60
|
Dialog,
|
|
61
61
|
Notify,
|
|
62
62
|
Loading,
|
|
63
|
-
AppFullscreen
|
|
63
|
+
AppFullscreen,
|
|
64
|
+
AddressbarColor
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
67
|
let locale = localStorage.getItem("locale") || "en";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostlink/nuxt-light",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "HostLink Nuxt Light Framework",
|
|
5
5
|
"repository": "@hostlink/nuxt-light",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
25
|
"prepack": "nuxt-module-build build",
|
|
26
|
-
"dev": "nuxi dev playground",
|
|
26
|
+
"dev": "nuxi dev playground --host",
|
|
27
27
|
"dev:build": "nuxi build playground",
|
|
28
28
|
"dev:prepare": "nuxt-module-build build --stub && nuxi prepare playground",
|
|
29
29
|
"release:org": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|