@hostlink/nuxt-light 0.0.71 → 0.0.73

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,5 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "0.0.71"
4
+ "version": "0.0.73"
5
5
  }
@@ -4,6 +4,7 @@ import { useAttrs } from 'vue'
4
4
 
5
5
  defineProps({
6
6
  loading: Boolean,
7
+ title: String
7
8
  })
8
9
 
9
10
  const light = useLight();
@@ -21,6 +22,9 @@ const attrs = {
21
22
  </script>
22
23
  <template>
23
24
  <q-card v-bind="attrs">
25
+ <q-toolbar v-if="title">
26
+ <q-toolbar-title>{{ title }}</q-toolbar-title>
27
+ </q-toolbar>
24
28
  <slot></slot>
25
29
 
26
30
  <q-inner-loading :showing="loading" label="Please wait..." label-class="text-primary" />
@@ -1,13 +1,33 @@
1
1
  <script setup>
2
- defineProps(["label"]);
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
- <q-item-section side>
10
- <q-item-label><slot></slot></q-item-label>
11
- </q-item-section>
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>
@@ -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 :to="`/${modelName}/${props.row[primaryKey]}/edit`"
417
- v-if="activeEdit && props.row.canUpdate" />
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
- {{ obj }}
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "0.0.71",
3
+ "version": "0.0.73",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",