@hostlink/nuxt-light 1.17.0 → 1.17.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.17.0",
4
+ "version": "1.17.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -246,6 +246,9 @@ const module = defineNuxtModule({
246
246
  }
247
247
  },
248
248
  async setup(options, nuxt) {
249
+ nuxt.options.imports = nuxt.options.imports || {};
250
+ nuxt.options.imports.presets = nuxt.options.imports.presets || [];
251
+ nuxt.options.imports.presets.push({ from: "quasar", imports: ["useQuasar"] });
249
252
  const resolver = createResolver(import.meta.url);
250
253
  const { resolve: resolveQuasar } = createResolver(dirname(await resolvePath("quasar/package.json")));
251
254
  const importMap = JSON.parse(await await readFile(resolveQuasar("dist/transforms/import-map.json"), "utf-8"));
@@ -4,11 +4,14 @@ import { useQuasar } from 'quasar'
4
4
 
5
5
  const $q = useQuasar()
6
6
 
7
- const modelValue = defineModel<{
8
- mode: string
9
- }>()
10
7
 
8
+ export interface LSystemSettingDeveloperProps {
9
+ mode: string
10
+ }
11
11
 
12
+ const modelValue = defineModel<LSystemSettingDeveloperProps>({
13
+ required: true,
14
+ })
12
15
 
13
16
  if (modelValue.value.mode != 'prod') {
14
17
  modelValue.value.mode = 'dev'
@@ -16,18 +19,18 @@ if (modelValue.value.mode != 'prod') {
16
19
  modelValue.value.mode = 'prod'
17
20
  }
18
21
 
19
- const onSubmit = async (d, form) => {
20
- let data = [];
22
+ const onSubmit = async (d: LSystemSettingDeveloperProps) => {
23
+ let data: { name: string, value: string }[] = [];
21
24
  Object.keys(d).forEach((key) => {
22
25
  data.push({
23
26
  name: key,
24
- value: d[key]
27
+ value: d[key as keyof LSystemSettingDeveloperProps]
25
28
  })
26
29
  })
27
30
  await m("updateAppConfigs", { data })
28
31
  //update the modelValue
29
32
  Object.keys(d).forEach((key) => {
30
- modelValue.value[key] = d[key]
33
+ modelValue.value[key as keyof LSystemSettingDeveloperProps] = d[key as keyof LSystemSettingDeveloperProps]
31
34
  })
32
35
 
33
36
  $q.notify({ message: "Settings saved", color: "positive" })
@@ -4,13 +4,17 @@ import { q, m } from '#imports'
4
4
  import { useQuasar } from 'quasar'
5
5
  const $q = useQuasar()
6
6
 
7
- const modelValue = defineModel<{
7
+ export type LSystemSettingForgetPasswordProps = {
8
8
  forget_password_enabled: string,
9
9
  forget_password_subject: string,
10
10
  forget_password_template: string,
11
- }>()
11
+ }
12
+
13
+ const modelValue = defineModel<LSystemSettingForgetPasswordProps>({
14
+ required: true,
15
+ })
12
16
 
13
- if (!modelValue.value.forget_password_enabled == "0") {
17
+ if (modelValue.value.forget_password_enabled != "0") {
14
18
  modelValue.value.forget_password_enabled = "1"
15
19
  }
16
20
 
@@ -23,8 +27,8 @@ if (!modelValue.value.forget_password_template) {
23
27
  }
24
28
 
25
29
 
26
- const onSubmit = async (d) => {
27
- let data = [];
30
+ const onSubmit = async (d: any) => {
31
+ let data: any = [];
28
32
  Object.keys(d).forEach((key) => {
29
33
  if (d[key] === undefined) {
30
34
  d[key] = ""
@@ -36,10 +40,11 @@ const onSubmit = async (d) => {
36
40
  })
37
41
  })
38
42
  await m("updateAppConfigs", { data })
39
- //update the props.data
40
- Object.keys(d).forEach((key) => {
41
- modelValue.value[key] = d[key]
42
- })
43
+
44
+ modelValue.value.forget_password_enabled = d.forget_password_enabled
45
+ modelValue.value.forget_password_subject = d.forget_password_subject
46
+ modelValue.value.forget_password_template = d.forget_password_template
47
+
43
48
  $q.notify({ message: "Settings saved", color: "positive" })
44
49
  }
45
50
 
@@ -4,7 +4,7 @@ import { useQuasar } from 'quasar'
4
4
 
5
5
  const $q = useQuasar()
6
6
 
7
- const modelValue = defineModel<{
7
+ export type LSystemSettingSecurityProps = {
8
8
  password_contains_uppercase: string
9
9
  password_contains_lowercase: string
10
10
  password_contains_numeric: string
@@ -14,20 +14,25 @@ const modelValue = defineModel<{
14
14
  auth_lockout_duration: string
15
15
  auth_lockout_attempts: string
16
16
  access_token_expire: string
17
- }>()
17
+ }
18
+
19
+ const modelValue = defineModel<LSystemSettingSecurityProps>({
20
+ required: true
21
+ })
22
+
23
+ const onSubmit = async (d: LSystemSettingSecurityProps) => {
24
+ let data: { name: string, value: string }[] = []
18
25
 
19
- const onSubmit = async (d, form) => {
20
- let data = [];
21
26
  Object.keys(d).forEach((key) => {
22
27
  data.push({
23
28
  name: key,
24
- value: d[key]
29
+ value: d[key as keyof LSystemSettingSecurityProps]
25
30
  })
26
31
  })
27
32
  await m("updateAppConfigs", { data })
28
33
  //update the modelValue
29
34
  Object.keys(d).forEach((key) => {
30
- modelValue.value[key] = d[key]
35
+ modelValue.value[key as keyof LSystemSettingSecurityProps] = d[key as keyof LSystemSettingSecurityProps]
31
36
  })
32
37
 
33
38
  $q.notify({ message: "Settings saved", color: "positive" })
@@ -46,7 +51,7 @@ const onSubmit = async (d, form) => {
46
51
  two_factor_authentication: modelValue.two_factor_authentication,
47
52
  auth_lockout_duration: modelValue.auth_lockout_duration,
48
53
  auth_lockout_attempts: modelValue.auth_lockout_attempts,
49
- access_token_expire: modelValue.access_token_expire
54
+ access_token_expire: modelValue.access_token_expire,
50
55
 
51
56
  }" @submit="onSubmit">
52
57
  <q-field label="Password policy" stack-label :color="$light.color">
@@ -63,9 +68,8 @@ const onSubmit = async (d, form) => {
63
68
  </FormKit>
64
69
 
65
70
 
66
- <q-field label="Two factor authentication" stack-label :color="$light.color">
67
- <FormKit type="l-checkbox" label="Enable" name="two_factor_authentication" true-value="1" false-value="0" />
68
- </q-field>
71
+ <FormKit type="l-checkbox" name="two_factor_authentication" true-value="1" false-value="0"
72
+ label="Two factor authentication" />
69
73
 
70
74
  <FormKit label="Auth lockout duration" type="l-input" name="auth_lockout_duration"
71
75
  hint="The number of minutes the user is locked out after the maximum number of failed login attempts. Default is 15 minutes."
@@ -78,5 +82,13 @@ const onSubmit = async (d, form) => {
78
82
  <FormKit label="Access token expiration" type="l-input" name="access_token_expire"
79
83
  hint="The access token expiration time in seconds. Default is 28800 seconds (8 hours)."
80
84
  validation="required" />
85
+
86
+
87
+ <!-- form-kit label="Password expiration" true-value="1" false-value="0" name="password_expiration"
88
+ type="l-checkbox"></form-kit>
89
+
90
+
91
+ <form-kit label="Password expiration duration" name="password_expiration_duration" type="l-input"
92
+ hint="The number of days before the password expires. Default is 90 days." validation="required"></form-kit -->
81
93
  </FormKit>
82
94
  </template>
@@ -226,7 +226,8 @@ onMounted(() => {
226
226
  <q-card-actions>
227
227
  <l-btn label="Login" outline rounded color="primary" icon="sym_o_login" @click="submit" />
228
228
  <l-btn v-if="hasBioLogin" outline rounded color="primary" icon="sym_o_fingerprint" @click="bioLogin" />
229
- <l-btn label="Forget password" outline rounded color="primary" icon="sym_o_lock_reset" @click="forgetPassword" />
229
+ <l-btn label="Forget password" outline rounded color="primary" icon="sym_o_lock_reset" @click="forgetPassword"
230
+ v-if="forgetPasswordEnabled" />
230
231
  </q-card-actions>
231
232
  <q-card-actions v-if="props.googleClientId">
232
233
  <div>
@@ -64,21 +64,30 @@ declare module '@formkit/inputs' {
64
64
  number?: string;
65
65
  dense?: boolean;
66
66
  };
67
- }
68
- interface FormKitInputProps<Props extends FormKitInputs<Props>> {
67
+ lCheckbox: {
68
+ type: 'l-checkbox';
69
+ name: string;
70
+ label: string;
71
+ dense?: boolean;
72
+ };
69
73
  lDatePicker: {
70
74
  type: 'l-date-picker';
71
75
  name: string;
72
76
  label: string;
73
77
  dense?: boolean;
74
78
  };
75
- }
76
- interface FormKitInputProps<Props extends FormKitInputs<Props>> {
77
79
  lForm: {
78
80
  type: 'l-form';
79
81
  gutter?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
80
82
  bordered?: boolean;
81
83
  };
84
+ lSelect: {
85
+ type: 'l-select';
86
+ name: string;
87
+ label: string;
88
+ options: Array<any>;
89
+ dense?: boolean;
90
+ };
82
91
  }
83
92
  }
84
93
  export declare const useLight: (options?: {
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { m } from '../../'
2
+ import { m } from '#imports'
3
3
  import { useQuasar } from "quasar"
4
4
  const quasar = useQuasar();
5
5
 
@@ -25,11 +25,14 @@ const onSubmit = async (data) => {
25
25
  </script>
26
26
  <template>
27
27
  <l-page>
28
- <FormKit type="l-form" @submit="onSubmit">
29
- <FormKit type="l-input" label="Email" name="email" validation="required|email"></FormKit>
30
- <FormKit type="l-input" label="Subject" name="subject" validation="required"></FormKit>
31
- <FormKit type="l-input" input-type="textarea" label="Content" name="content" validation="required">
32
- </FormKit>
33
- </FormKit>
28
+ <form-kit type="l-form" @submit="onSubmit" :value="{
29
+ subject: 'Test email',
30
+ content: 'Hello, this is a test email'
31
+ }">
32
+ <form-kit type="l-input" label="Email" name="email" validation="required|email"></form-kit>
33
+ <form-kit type="l-input" label="Subject" name="subject" validation="required"></form-kit>
34
+ <form-kit type="l-input" input-type="textarea" label="Content" name="content" validation="required">
35
+ </form-kit>
36
+ </form-kit>
34
37
  </l-page>
35
38
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.17.0",
3
+ "version": "1.17.2",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",