@hostlink/nuxt-light 1.21.13 → 1.22.0

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.21.13",
4
+ "version": "1.22.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -1 +1 @@
1
- body{font-family:Noto Sans,Noto Sans HK,Noto Sans TC,-apple-system,Helvetica Neue,Helvetica,Arial,sans-serif}.q-card__actions .q-btn--rectangle{padding:4px 16px}.q-table--dense .q-table td,.q-table--dense .q-table td:first-child,.q-table--dense .q-table th,.q-table--dense .q-table th:first-child{padding:2px 4px}.q-tab-panel{padding:8px}
1
+ body{font-family:Noto Sans,Noto Sans HK,Noto Sans TC,-apple-system,Helvetica Neue,Helvetica,Arial,sans-serif}.q-card__actions .q-btn--rectangle{padding:4px 16px}.q-table--dense .q-table td,.q-table--dense .q-table td:first-child,.q-table--dense .q-table th,.q-table--dense .q-table th:first-child{padding:2px 4px}.q-tab-panel{padding:8px}::-webkit-scrollbar{background:transparent;height:12px;overflow:visible;width:14px;z-index:12}::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#c1c1c1;border:4px solid transparent;border-radius:10px;margin:4px;min-height:32px;min-width:32px;-webkit-transition:background-color .32s ease-in-out;transition:background-color .32s ease-in-out;width:10px;z-index:12}::-webkit-scrollbar-thumb:hover{background:#c1c1c1}
@@ -12,7 +12,8 @@ export type LSystemSettingSecurityProps = {
12
12
  auth_lockout_attempts: string
13
13
  access_token_expire: string
14
14
  password_expiration: string,
15
- password_expiration_duration: string
15
+ password_expiration_duration: string,
16
+ concurrent_login_disabled: string,
16
17
  }
17
18
 
18
19
  withDefaults(defineProps<LSystemSettingSecurityProps>(), {
@@ -26,7 +27,8 @@ withDefaults(defineProps<LSystemSettingSecurityProps>(), {
26
27
  auth_lockout_attempts: "5",
27
28
  access_token_expire: "28800",
28
29
  password_expiration: "0",
29
- password_expiration_duration: "90"
30
+ password_expiration_duration: "90",
31
+ concurrent_login_disabled: "0",
30
32
  });
31
33
 
32
34
 
@@ -69,5 +71,10 @@ withDefaults(defineProps<LSystemSettingSecurityProps>(), {
69
71
  type="l-checkbox"></form-kit>
70
72
  <form-kit label="Password expiration duration" name="password_expiration_duration" type="l-input"
71
73
  hint="The number of days before the password expires. Default is 90 days." validation="required"></form-kit>
74
+
75
+
76
+ <form-kit label="Concurrent login disabled" type="l-checkbox" name="concurrent_login_disabled" true-value="1"
77
+ false-value="0"></form-kit>
78
+
72
79
  </FormKit>
73
80
  </template>
@@ -281,12 +281,24 @@ const onLogout = async () => {
281
281
  emits('logout');
282
282
  }
283
283
 
284
+ watch(light.errors, (value) => {
285
+ if (value.length > 0) {
286
+ //if errors
287
+ for (let error of value) {
288
+ console.log(error.message);
289
+ }
290
+ }
291
+ })
292
+
284
293
  </script>
285
294
 
295
+
296
+
286
297
  <style scoped>
287
298
  .q-layout__section--marginal{background-color:v-bind(c1)}
288
299
  </style>
289
300
 
301
+
290
302
  <template>
291
303
  <q-layout :view="layoutView">
292
304
  <q-header bordered class="text-white" :class="`bg-${light.color}`">
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { useLight, q, m } from '#imports'
3
3
  import { ref, computed, useSlots, onMounted } from 'vue'
4
- import { type QCardProps } from 'quasar';
4
+ import type { QCardProps } from 'quasar';
5
5
 
6
6
  const emit = defineEmits(["close"]);
7
7
 
@@ -148,9 +148,9 @@ const date_attrs = computed(() => {
148
148
  <template v-slot:prepend>
149
149
  <q-btn icon="sym_o_event" round dense flat>
150
150
  <q-popup-proxy cover transition-show="scale" transition-hide="scale" ref="popup">
151
- <q-date v-bind="date_attrs" v-model="dateValue" :color="color ?? $light.color">
151
+ <q-date v-bind="date_attrs" v-model="dateValue" :color="color ?? $light.color" today-btn :title="label">
152
152
  <div class="row items-center justify-end">
153
- <q-btn v-close-popup label="Close" :color="color ?? $light.color" flat />
153
+ <q-btn v-close-popup :label="$t('Close')" :color="color ?? $light.color" flat />
154
154
  </div>
155
155
  </q-date>
156
156
  </q-popup-proxy>
@@ -301,7 +301,7 @@ const facebookLogin = (accessToken) => {
301
301
  </l-input>
302
302
  <l-input v-model="data.password" label="Password" type="password" clearable show-password stackLabel
303
303
  :rules="[v => !!v || $t('Password is required')]" @keydown.enter.prevent="submit" :outlined="false"
304
- autocomplete="current-password">
304
+ autocomplete="off">
305
305
  <template v-slot:prepend>
306
306
  <q-icon name="sym_o_lock" />
307
307
  </template>
@@ -49,7 +49,7 @@ const props = withDefaults(defineProps<LTableProps>(), {
49
49
  actions: () => [],
50
50
  rowsPerPageLabel: "Records per page:",
51
51
  selection: "none",
52
- rowsPerPageOptions: () => [3, 5, 7, 10, 15, 20, 25, 50, 0],
52
+ rowsPerPageOptions: () => [5, 10, 20, 50, 100, 0],
53
53
  pagination: () => {
54
54
  return {
55
55
  sortBy: null,
@@ -335,7 +335,6 @@ const onLocalRequest = async (p: any) => {
335
335
  }
336
336
  }
337
337
 
338
- console.log(p.pagination);
339
338
 
340
339
  if (p.pagination.rowsPerPage != 0) {
341
340
  c = c.forPage(p.pagination.page, p.pagination.rowsPerPage);
@@ -355,6 +354,7 @@ const onLocalRequest = async (p: any) => {
355
354
  color: "negative"
356
355
  })
357
356
  this.setData({ data: [], meta: { total: 0, key: "", name: "" } });
357
+
358
358
  }
359
359
  }
360
360
  }
@@ -16,7 +16,7 @@ const value = computed({
16
16
  set: (val) => props.context.node.input(val)
17
17
  })
18
18
 
19
- const label = computed(() => {
19
+ /* const label = computed(() => {
20
20
  let l = t(props.context.label);
21
21
  if (props.context.state.required) {
22
22
  l = "* " + l
@@ -24,11 +24,12 @@ const label = computed(() => {
24
24
  return l
25
25
  })
26
26
 
27
-
27
+ */
28
28
  </script>
29
29
  <template>
30
- <l-date-picker v-model="value" v-bind="context.attrs" :label="label" :error="error" :type="context.inputType"
31
- :error-message="errorMessage" :disable="context.disabled">
30
+ <l-date-picker v-model="value" v-bind="context.attrs" :label="context.label" :error="error"
31
+ :type="context.inputType" :error-message="errorMessage" :disable="context.disabled"
32
+ :required="context.state.required">
32
33
  <template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
33
34
  <slot :name="name" v-bind="props ?? {}"></slot>
34
35
  </template>
@@ -214,6 +214,7 @@ const light = reactive({
214
214
  watch(() => light.color, async () => {
215
215
  await light.setStyle("color", light.color);
216
216
  });
217
+ light.errors = [];
217
218
  },
218
219
  isGranted(right) {
219
220
  if (right === void 0) return true;
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { q, m } from '#imports'
3
- import { ref } from 'vue'
3
+ import { ref, computed } from 'vue'
4
4
  let { my } = await q({
5
5
  my: {
6
6
  styles: true
@@ -12,7 +12,9 @@ const defaultStyle = {
12
12
  dense: true,
13
13
  flat: true,
14
14
  bordered: true,
15
+ square: false,
15
16
  separator: 'cell'
17
+
16
18
  },
17
19
  card: {
18
20
  flat: true,
@@ -21,14 +23,20 @@ const defaultStyle = {
21
23
  },
22
24
  button: {
23
25
  outline: false,
24
- rounded: false,
26
+ flat: false,
25
27
  unelevated: false,
28
+ rounded: false,
29
+ push: false,
30
+ square: false,
31
+ glossy: false,
26
32
  dense: false
27
33
  },
28
34
  input: {
29
35
  filled: false,
30
36
  outlined: true,
31
37
  standout: false,
38
+ borderless: false,
39
+ standout: false,
32
40
  rounded: false,
33
41
  dense: false,
34
42
  square: false,
@@ -67,7 +75,28 @@ const columns = [
67
75
  { name: 'phone', label: 'Phone', align: 'left', field: 'phone', sortable: true },
68
76
  ]
69
77
 
78
+
70
79
  const preview = ref({})
80
+
81
+ const inputDesign = computed({
82
+ set: (value) => {
83
+ styles.value.input.filled = value === 'filled'
84
+ styles.value.input.outlined = value === 'outlined'
85
+ styles.value.input.standout = value === 'standout'
86
+ styles.value.input.borderless = value === 'borderless'
87
+ },
88
+ get: () => {
89
+ if (styles.value.input.filled) return 'filled'
90
+ if (styles.value.input.outlined) return 'outlined'
91
+ if (styles.value.input.standout) return 'standout'
92
+ if (styles.value.input.borderless) return 'borderless'
93
+ return 'none'
94
+ }
95
+ });
96
+
97
+
98
+
99
+
71
100
  </script>
72
101
  <template>
73
102
  <div class="q-pa-md">
@@ -79,6 +108,7 @@ const preview = ref({})
79
108
  <q-toggle v-model="styles.table.dense" label="Dense" :color="$light.color" />
80
109
  <q-toggle v-model="styles.table.flat" label="Flat" :color="$light.color" />
81
110
  <q-toggle v-model="styles.table.bordered" label="Bordered" :color="$light.color" />
111
+ <q-toggle v-model="styles.table.square" label="Square" :color="$light.color" />
82
112
 
83
113
  <q-field :label="`Separator`" stack-label :color="$light.color">
84
114
  <q-option-group v-model="styles.table.separator" inline :options="[
@@ -102,17 +132,30 @@ const preview = ref({})
102
132
  <l-card title="Button" minimizable>
103
133
  <q-card-section>
104
134
  <q-toggle v-model="styles.button.outline" label="Outline" :color="$light.color" />
105
- <q-toggle v-model="styles.button.rounded" label="Rounded" :color="$light.color" />
135
+ <q-toggle v-model="styles.button.flat" label="Flat" :color="$light.color" />
106
136
  <q-toggle v-model="styles.button.unelevated" label="Unelevated" :color="$light.color" />
137
+ <q-toggle v-model="styles.button.rounded" label="Rounded" :color="$light.color" />
138
+ <q-toggle v-model="styles.button.push" label="Push" :color="$light.color" />
139
+ <q-toggle v-model="styles.button.square" label="Square" :color="$light.color" />
140
+ <q-toggle v-model="styles.button.glossy" label="Glossy" :color="$light.color" />
107
141
  <q-toggle v-model="styles.button.dense" label="Dense" :color="$light.color" />
142
+
108
143
  </q-card-section>
109
144
  </l-card>
110
145
 
111
146
  <l-card title="Input" minimizable>
112
147
  <q-card-section>
113
- <q-toggle v-model="styles.input.filled" label="Filled" :color="$light.color" />
114
- <q-toggle v-model="styles.input.outlined" label="Outlined" :color="$light.color" />
115
- <q-toggle v-model="styles.input.standout" label="Standout" :color="$light.color" />
148
+
149
+ <q-option-group v-model="inputDesign" inline :options="[
150
+ { label: 'None', value: 'none' },
151
+ { label: 'Filled', value: 'filled' },
152
+ { label: 'Outlined', value: 'outlined' },
153
+ { label: 'Standout', value: 'standout' },
154
+ { label: 'Borderless', value: 'borderless' },
155
+ ]" :color="$light.color" />
156
+
157
+
158
+
116
159
  <q-toggle v-model="styles.input.rounded" label="Rounded" :color="$light.color" />
117
160
  <q-toggle v-model="styles.input.dense" label="Dense" :color="$light.color" />
118
161
  <q-toggle v-model="styles.input.square" label="Square" :color="$light.color" />
@@ -148,7 +191,7 @@ const preview = ref({})
148
191
  { name: 'A', phone: '123' },
149
192
  { name: 'B', phone: '456' },
150
193
  { name: 'C', phone: '789' },
151
- ]" v-bind="styles.table" selection="multiple">
194
+ ]" v-bind="styles.table" selection="multiple" title="Table">
152
195
 
153
196
  <template #body-cell-action="props">
154
197
  <q-td auto-width>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.21.13",
3
+ "version": "1.22.0",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",