@hostlink/nuxt-light 0.0.72 → 0.0.74
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 +18 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.d.ts +3 -3
- package/dist/module.json +1 -1
- package/dist/runtime/components/l-app.vue +16 -3
- package/dist/runtime/components/l-item.vue +24 -4
- package/dist/runtime/components/l-login.vue +43 -1
- package/dist/runtime/components/l-table.vue +27 -4
- package/dist/runtime/pages/User/_user_id/view.vue +5 -2
- package/dist/types.d.mts +15 -0
- package/package.json +7 -8
package/README.md
CHANGED
|
@@ -104,3 +104,21 @@ npm run release
|
|
|
104
104
|
</l-app>
|
|
105
105
|
</template>
|
|
106
106
|
```
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## Google Sigin
|
|
111
|
+
nuxt.config.ts
|
|
112
|
+
```js
|
|
113
|
+
app: {
|
|
114
|
+
head: {
|
|
115
|
+
script: [
|
|
116
|
+
{
|
|
117
|
+
src: 'https://accounts.google.com/gsi/client',
|
|
118
|
+
async: true,
|
|
119
|
+
defer: true,
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
package/dist/module.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
|
|
3
|
-
interface ModuleOptions {
|
|
4
|
-
}
|
|
3
|
+
interface ModuleOptions {
|
|
4
|
+
}
|
|
5
5
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
6
6
|
|
|
7
|
-
export { ModuleOptions, _default as default };
|
|
7
|
+
export { type ModuleOptions, _default as default };
|
package/dist/module.json
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useRuntimeConfig } from 'nuxt/app'
|
|
3
3
|
import { setApiUrl } from '@hostlink/light'
|
|
4
|
-
import {
|
|
4
|
+
import { Dialog } from 'quasar'
|
|
5
5
|
import { q } from '../'
|
|
6
|
-
const route = useRoute()
|
|
7
6
|
const config = useRuntimeConfig();
|
|
8
7
|
setApiUrl(config?.public?.apiBase ?? '/api/');
|
|
9
8
|
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
let app = null
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
app = (await q({ app: ['company', 'companyLogo', 'logged', 'twoFactorAuthentication'] })).app;
|
|
14
|
+
} catch (e) {
|
|
15
|
+
Dialog.create({
|
|
16
|
+
title: 'Error',
|
|
17
|
+
message: 'Error loading api data. Please reload the page.',
|
|
18
|
+
ok: 'Reload',
|
|
19
|
+
}).onOk(() => {
|
|
20
|
+
window.location.reload();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
12
25
|
</script>
|
|
13
26
|
<template>
|
|
14
27
|
<q-layout v-if="!app.logged">
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
defineProps(
|
|
2
|
+
defineProps({
|
|
3
|
+
label: {
|
|
4
|
+
type: String,
|
|
5
|
+
required: true
|
|
6
|
+
},
|
|
7
|
+
type: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "text"
|
|
10
|
+
}
|
|
11
|
+
});
|
|
3
12
|
</script>
|
|
4
13
|
<template>
|
|
5
14
|
<q-item>
|
|
6
15
|
<q-item-section>
|
|
7
16
|
<q-item-label>{{ $t(label) }}</q-item-label>
|
|
17
|
+
|
|
18
|
+
<q-item-label caption v-if="type == 'caption'">
|
|
19
|
+
<div style="white-space: pre-wrap;">
|
|
20
|
+
<slot></slot>
|
|
21
|
+
</div>
|
|
22
|
+
</q-item-label>
|
|
8
23
|
</q-item-section>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
24
|
+
|
|
25
|
+
<template v-if="type == 'text'">
|
|
26
|
+
<q-item-section side>
|
|
27
|
+
<q-item-label>
|
|
28
|
+
<slot></slot>
|
|
29
|
+
</q-item-label>
|
|
30
|
+
</q-item-section>
|
|
31
|
+
</template>
|
|
12
32
|
</q-item>
|
|
13
33
|
</template>
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, reactive } from 'vue'
|
|
2
|
+
import { ref, reactive, onMounted } from 'vue'
|
|
3
3
|
import { useQuasar } from 'quasar';
|
|
4
4
|
import { useI18n } from 'vue-i18n';
|
|
5
5
|
import { m, notify } from '../';
|
|
6
6
|
|
|
7
|
+
import { useRuntimeConfig } from 'nuxt/app';
|
|
8
|
+
|
|
7
9
|
import { login, webauthnLogin } from '@hostlink/light';
|
|
8
10
|
|
|
11
|
+
const config = useRuntimeConfig();
|
|
12
|
+
|
|
9
13
|
|
|
10
14
|
defineProps({
|
|
11
15
|
company: String,
|
|
@@ -119,6 +123,36 @@ const bioLogin = async () => {
|
|
|
119
123
|
}
|
|
120
124
|
|
|
121
125
|
}
|
|
126
|
+
const googleResponse = () => {
|
|
127
|
+
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
onMounted(() => {
|
|
131
|
+
if (config.public.GOOGLE_CLIENT_ID) {
|
|
132
|
+
//google
|
|
133
|
+
google.accounts.id.initialize({
|
|
134
|
+
client_id: "829616239009-23sf7s3blsnab9a288sb4j15orqqamlp.apps.googleusercontent.com",
|
|
135
|
+
callback: googleResponse,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
google.accounts.id.renderButton(
|
|
139
|
+
document.getElementById('g_id_signin'),
|
|
140
|
+
{
|
|
141
|
+
type: 'profile',
|
|
142
|
+
shape: 'pill',
|
|
143
|
+
theme: 'outline',
|
|
144
|
+
text: 'signin_with',
|
|
145
|
+
size: 'large',
|
|
146
|
+
logo_alignment: 'left'
|
|
147
|
+
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
|
|
122
156
|
|
|
123
157
|
</script>
|
|
124
158
|
|
|
@@ -145,5 +179,13 @@ const bioLogin = async () => {
|
|
|
145
179
|
<l-btn v-if="hasBioLogin" outline rounded color="primary" icon="sym_o_fingerprint" @click="bioLogin" />
|
|
146
180
|
<l-btn label="Forget password" outline rounded color="primary" icon="sym_o_lock_reset" @click="forgetPassword" />
|
|
147
181
|
</q-card-actions>
|
|
182
|
+
<q-card-actions v-if="config.public.GOOGLE_CLIENT_ID">
|
|
183
|
+
|
|
184
|
+
<div>
|
|
185
|
+
|
|
186
|
+
<div id="g_id_signin"></div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
</q-card-actions>
|
|
148
190
|
</q-card>
|
|
149
191
|
</template>
|
|
@@ -63,6 +63,14 @@ const props = defineProps({
|
|
|
63
63
|
rowsPerPage: 10,
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
},
|
|
67
|
+
fullscreen: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false
|
|
70
|
+
},
|
|
71
|
+
searchable: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false
|
|
66
74
|
}
|
|
67
75
|
})
|
|
68
76
|
|
|
@@ -286,7 +294,7 @@ const onRequest = async (p: any) => {
|
|
|
286
294
|
pagination.value.sortBy = p.pagination.sortBy;
|
|
287
295
|
pagination.value.descending = p.pagination.descending;
|
|
288
296
|
pagination.value.rowsNumber = allData.meta.total;
|
|
289
|
-
|
|
297
|
+
|
|
290
298
|
loading.value = false;
|
|
291
299
|
validateData()
|
|
292
300
|
|
|
@@ -372,6 +380,7 @@ const attrs = {
|
|
|
372
380
|
...useAttrs()
|
|
373
381
|
}
|
|
374
382
|
|
|
383
|
+
const filter = ref('');
|
|
375
384
|
</script>
|
|
376
385
|
<template>
|
|
377
386
|
<template v-if="errors.length > 0">
|
|
@@ -398,7 +407,21 @@ const attrs = {
|
|
|
398
407
|
|
|
399
408
|
<q-table v-bind="attrs" :row-key="rowKey" :loading="loading" :rows="rows" ref="table" @request="onRequest"
|
|
400
409
|
:rows-per-page-label="$t(props.rowsPerPageLabel)" :columns="renderColumns"
|
|
401
|
-
:rows-per-page-options="rowsPerPageOptions" :selection="selection" v-model:pagination="pagination"
|
|
410
|
+
:rows-per-page-options="rowsPerPageOptions" :selection="selection" v-model:pagination="pagination"
|
|
411
|
+
:filter="filter">
|
|
412
|
+
|
|
413
|
+
<template #top-right="props" v-if="fullscreen || searchable">
|
|
414
|
+
<q-input v-if="searchable" outlined dense debounce="300" v-model="filter" placeholder="Search">
|
|
415
|
+
<template v-slot:append>
|
|
416
|
+
<q-icon name="search" />
|
|
417
|
+
</template>
|
|
418
|
+
</q-input>
|
|
419
|
+
|
|
420
|
+
<q-btn v-if="fullscreen" flat round dense :icon="props.inFullscreen ? 'fullscreen_exit' : 'fullscreen'"
|
|
421
|
+
@click="props.toggleFullscreen" class="q-ml-md" />
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
</template>
|
|
402
425
|
|
|
403
426
|
|
|
404
427
|
<template v-for="s in ss" v-slot:[s]="props">
|
|
@@ -413,8 +436,8 @@ const attrs = {
|
|
|
413
436
|
<l-view-btn v-if="actionView && props.row.canView"
|
|
414
437
|
:to="`/${modelName}/${props.row[primaryKey]}/view`" />
|
|
415
438
|
|
|
416
|
-
<l-edit-btn
|
|
417
|
-
|
|
439
|
+
<l-edit-btn v-if="activeEdit && props.row.canUpdate"
|
|
440
|
+
:to="`/${modelName}/${props.row[primaryKey]}/edit`" />
|
|
418
441
|
|
|
419
442
|
<l-delete-btn v-if="actionDelete && props.row.canDelete"
|
|
420
443
|
@submit="onDelete(props.row[primaryKey])"></l-delete-btn>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { getObject, loadObject } from '../../../';
|
|
3
|
-
const obj = await getObject(["user_id", "username", "first_name", "last_name", "email", "phone", "roles",'status']);
|
|
3
|
+
const obj = await getObject(["user_id", "username", "first_name", "last_name", "email", "phone", "roles", 'status', 'join_date']);
|
|
4
4
|
|
|
5
5
|
//await getObject(["user_id", { test: ["username"] }])
|
|
6
6
|
/* const test = async () => {
|
|
@@ -16,7 +16,7 @@ const obj = await getObject(["user_id", "username", "first_name", "last_name", "
|
|
|
16
16
|
<l-btn to="change-password" icon="sym_o_key" permission="user.changePassword" label="Change password"></l-btn>
|
|
17
17
|
<l-btn to="update-role" icon="sym_o_people" permission="user.role.add" label="Update role"></l-btn>
|
|
18
18
|
</template>
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
<l-card>
|
|
21
21
|
<l-list>
|
|
22
22
|
<l-item label="Username">{{ obj.username }}</l-item>
|
|
@@ -25,6 +25,9 @@ const obj = await getObject(["user_id", "username", "first_name", "last_name", "
|
|
|
25
25
|
<l-item label="Email">{{ obj.email }}</l-item>
|
|
26
26
|
<l-item label="Phone">{{ obj.phone }}</l-item>
|
|
27
27
|
<l-item label="Roles">{{ obj.roles.join(",") }}</l-item>
|
|
28
|
+
<l-item label="Status">{{ obj.status }}</l-item>
|
|
29
|
+
<l-item label="Join date">{{ obj.join_date }}</l-item>
|
|
30
|
+
|
|
28
31
|
</l-list>
|
|
29
32
|
</l-card>
|
|
30
33
|
</l-page>
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import { ModuleOptions } from './module'
|
|
3
|
+
|
|
4
|
+
declare module '@nuxt/schema' {
|
|
5
|
+
interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
|
|
6
|
+
interface NuxtOptions { ['light']?: ModuleOptions }
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare module 'nuxt/schema' {
|
|
10
|
+
interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
|
|
11
|
+
interface NuxtOptions { ['light']?: ModuleOptions }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export { ModuleOptions, default } from './module'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostlink/nuxt-light",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.74",
|
|
4
4
|
"description": "HostLink Nuxt Light Framework",
|
|
5
5
|
"repository": "@hostlink/nuxt-light",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
|
-
"prepack": "nuxt-module-build",
|
|
25
|
+
"prepack": "nuxt-module-build build",
|
|
26
26
|
"dev": "nuxi dev playground",
|
|
27
27
|
"dev:build": "nuxi build playground",
|
|
28
|
-
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
|
|
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",
|
|
30
30
|
"release": "npm run prepack && changelogen --release && npm publish --access=public && git push --follow-tags",
|
|
31
31
|
"lint": "eslint .",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@hostlink/light": "^0.0.24",
|
|
38
|
-
"@nuxt/kit": "^3.7.
|
|
38
|
+
"@nuxt/kit": "^3.7.4",
|
|
39
|
+
"@nuxt/module-builder": "^0.5.2",
|
|
39
40
|
"@quasar/extras": "^1.16.6",
|
|
40
41
|
"axios": "^1.5.0",
|
|
41
|
-
"gql-query-builder": "^3.8.0",
|
|
42
42
|
"json-to-graphql-query": "^2.2.5",
|
|
43
43
|
"quasar": "^2.12.5",
|
|
44
44
|
"unplugin-auto-import": "^0.16.6",
|
|
@@ -48,9 +48,8 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@nuxt/content": "^2.8.2",
|
|
50
50
|
"@nuxt/devtools": "latest",
|
|
51
|
-
"@nuxt/eslint-config": "^0.
|
|
52
|
-
"@nuxt/
|
|
53
|
-
"@nuxt/schema": "^3.7.0",
|
|
51
|
+
"@nuxt/eslint-config": "^0.2.0",
|
|
52
|
+
"@nuxt/schema": "^3.7.4",
|
|
54
53
|
"@nuxt/test-utils": "^3.7.0",
|
|
55
54
|
"@types/node": "^18.17.3",
|
|
56
55
|
"changelogen": "^0.5.4",
|