@hostlink/nuxt-light 0.0.113 → 0.0.115
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/assets/main.css +1 -30
- package/dist/runtime/components/l-date-picker.vue +7 -7
- package/dist/runtime/components/l-field.vue +10 -1
- package/dist/runtime/components/l-file-manager.vue +2 -4
- package/dist/runtime/components/l-file.vue +19 -2
- package/dist/runtime/components/l-input.vue +17 -9
- package/dist/runtime/components/l-login.vue +2 -2
- package/dist/runtime/components/l-menu.vue +2 -11
- package/dist/runtime/components/l-select.vue +7 -7
- package/dist/runtime/components/l-table.vue +17 -19
- package/dist/runtime/components/l-time-picker.vue +17 -2
- package/dist/runtime/formkit/Checkbox.vue +27 -0
- package/dist/runtime/formkit/DatePicker.vue +25 -0
- package/dist/runtime/formkit/FilePicker.vue +33 -0
- package/dist/runtime/formkit/Form.vue +72 -0
- package/dist/runtime/formkit/Input.vue +35 -0
- package/dist/runtime/formkit/OptionGroup.vue +22 -0
- package/dist/runtime/formkit/Radio.vue +22 -0
- package/dist/runtime/formkit/Repeater.vue +107 -0
- package/dist/runtime/formkit/Select.vue +25 -0
- package/dist/runtime/formkit/TimePicker.vue +25 -0
- package/dist/runtime/formkit/index.d.ts +2 -0
- package/dist/runtime/formkit/index.mjs +79 -0
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.mjs +12 -2
- package/dist/runtime/pages/Role/add.vue +8 -12
- package/dist/runtime/pages/User/_user_id/change-password.vue +9 -17
- package/dist/runtime/pages/User/_user_id/update-role.vue +7 -8
- package/dist/runtime/pages/User/add.vue +66 -43
- package/dist/runtime/pages/User/setting/index.vue +19 -9
- package/dist/runtime/pages/User/setting/information.vue +19 -18
- package/dist/runtime/pages/User/setting/open_id.vue +4 -1
- package/dist/runtime/pages/User/setting/password.vue +26 -23
- package/dist/runtime/pages/User/setting/style.vue +2 -2
- package/dist/runtime/plugin.mjs +15 -0
- package/dist/types.d.mts +3 -2
- package/dist/types.d.ts +3 -2
- package/package.json +2 -1
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
|
|
3
|
+
import { Dialog } from 'quasar';
|
|
4
|
+
import { reset } from "@formkit/core"
|
|
4
5
|
import { updatePassword } from "@hostlink/light"
|
|
5
6
|
|
|
6
7
|
import { q } from "#imports"
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
-
old_password
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const onSubmit = async (data, form) => {
|
|
10
|
+
if (await updatePassword(data.old_password, data.new_password)) {
|
|
11
|
+
reset(form);
|
|
12
|
+
await Dialog.create({
|
|
13
|
+
title: "Password updated",
|
|
14
|
+
message: "Your password has been updated",
|
|
15
|
+
ok: "OK"
|
|
16
|
+
})
|
|
13
17
|
|
|
14
|
-
const onSave = async () => {
|
|
15
|
-
if (await updatePassword(obj.old_password, obj.new_password)) {
|
|
16
|
-
notify("Your password has been updated")
|
|
17
18
|
} else {
|
|
18
|
-
|
|
19
|
+
await Dialog.create({
|
|
20
|
+
title: "Error",
|
|
21
|
+
message: "Old password is incorrect",
|
|
22
|
+
ok: "OK"
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
|
|
19
26
|
}
|
|
20
27
|
}
|
|
21
28
|
|
|
@@ -23,20 +30,16 @@ const system = await q("system", ["passwordPolicy"])
|
|
|
23
30
|
|
|
24
31
|
</script>
|
|
25
32
|
<template>
|
|
26
|
-
<l-form
|
|
27
|
-
<l-input label="Old password"
|
|
28
|
-
<l-input label="New password"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</
|
|
33
|
+
<FormKit type="l-form" :bordered="false" @submit="onSubmit">
|
|
34
|
+
<FormKit type="l-input" label="Old password" name="old_password" inputType="password" validation="required" />
|
|
35
|
+
<FormKit type="l-input" label="New password" name="new_password" inputType="password"
|
|
36
|
+
:validation="system.passwordPolicy" />
|
|
37
|
+
<FormKit type="l-input" label="Confirm password" name="new_password_confirm" inputType="password"
|
|
38
|
+
validation="required|confirm" />
|
|
39
|
+
</FormKit>
|
|
33
40
|
|
|
34
41
|
<div>
|
|
35
42
|
<div>Password policy</div>
|
|
36
|
-
<
|
|
37
|
-
<li v-for="rule in system.passwordPolicy" :key="rule">
|
|
38
|
-
{{ rule }}
|
|
39
|
-
</li>
|
|
40
|
-
</ul>
|
|
43
|
+
<div>{{ system.passwordPolicy }}</div>
|
|
41
44
|
</div>
|
|
42
45
|
</template>
|
|
@@ -47,8 +47,8 @@ const setDefault = async () => {
|
|
|
47
47
|
styles.cardBordered = true;
|
|
48
48
|
styles.cardSquare = false;
|
|
49
49
|
|
|
50
|
-
styles.buttonOutline =
|
|
51
|
-
styles.buttonRounded =
|
|
50
|
+
styles.buttonOutline = false;
|
|
51
|
+
styles.buttonRounded = false;
|
|
52
52
|
styles.buttonUnelevated = false;
|
|
53
53
|
styles.buttonDense = false;
|
|
54
54
|
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -8,12 +8,16 @@ import message_zh from "./locales/zh-hk.json";
|
|
|
8
8
|
import routes from "./routes.mjs";
|
|
9
9
|
import { defineModel } from "@hostlink/light";
|
|
10
10
|
localStorage.getItem("locale") || localStorage.setItem("locale", "en");
|
|
11
|
+
import { createQuasarPlugin } from "formkit-quasar";
|
|
12
|
+
import { createLightPlugin } from "./formkit/index.mjs";
|
|
13
|
+
import { plugin, defaultConfig } from "@formkit/vue";
|
|
11
14
|
import { useLight } from "./index.mjs";
|
|
12
15
|
import TypeUser from "./types/User.mjs";
|
|
13
16
|
import TypeUserLog from "./types/UserLog.mjs";
|
|
14
17
|
import TypeSystemValue from "./types/SystemValue.mjs";
|
|
15
18
|
import TypeMailLog from "./types/MailLog.mjs";
|
|
16
19
|
import TypeEventLog from "./types/EventLog.mjs";
|
|
20
|
+
import { zhTW } from "@formkit/i18n";
|
|
17
21
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
18
22
|
defineModel("User", TypeUser);
|
|
19
23
|
defineModel("UserLog", TypeUserLog);
|
|
@@ -57,6 +61,17 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
57
61
|
Loading
|
|
58
62
|
}
|
|
59
63
|
});
|
|
64
|
+
let locale = localStorage.getItem("locale") || "en";
|
|
65
|
+
if (locale == "zh-hk") {
|
|
66
|
+
locale = "zhTW";
|
|
67
|
+
}
|
|
68
|
+
nuxtApp.vueApp.use(plugin, defaultConfig({
|
|
69
|
+
plugins: [createQuasarPlugin(), createLightPlugin()],
|
|
70
|
+
locales: {
|
|
71
|
+
zhTW
|
|
72
|
+
},
|
|
73
|
+
locale
|
|
74
|
+
}));
|
|
60
75
|
const router = useRouter();
|
|
61
76
|
routes.forEach((route) => {
|
|
62
77
|
router.addRoute(route);
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { ModuleOptions } from './module'
|
|
2
|
+
import type { ModuleOptions } from './module'
|
|
3
|
+
|
|
3
4
|
|
|
4
5
|
declare module '@nuxt/schema' {
|
|
5
6
|
interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
|
|
@@ -12,4 +13,4 @@ declare module 'nuxt/schema' {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
export { ModuleOptions, default } from './module'
|
|
16
|
+
export type { ModuleOptions, default } from './module'
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { ModuleOptions } from './module'
|
|
2
|
+
import type { ModuleOptions } from './module'
|
|
3
|
+
|
|
3
4
|
|
|
4
5
|
declare module '@nuxt/schema' {
|
|
5
6
|
interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
|
|
@@ -12,4 +13,4 @@ declare module 'nuxt/schema' {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
export { ModuleOptions, default } from './module'
|
|
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": "0.0.
|
|
3
|
+
"version": "0.0.115",
|
|
4
4
|
"description": "HostLink Nuxt Light Framework",
|
|
5
5
|
"repository": "@hostlink/nuxt-light",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"@nuxt/module-builder": "^0.5.2",
|
|
40
40
|
"@quasar/extras": "^1.16.6",
|
|
41
41
|
"axios": "^1.5.0",
|
|
42
|
+
"formkit-quasar": "^0.0.12",
|
|
42
43
|
"json-to-graphql-query": "^2.2.5",
|
|
43
44
|
"quasar": "^2.12.5",
|
|
44
45
|
"unplugin-auto-import": "^0.16.6",
|