@hostlink/nuxt-light 1.10.18 → 1.10.20

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": "1.10.18"
4
+ "version": "1.10.20"
5
5
  }
@@ -540,6 +540,10 @@ const computedColumns = computed(() => {
540
540
  <q-table v-bind="attrs" :loading="loading" :rows="rows" ref="table" @request="onRequest" :columns="columns"
541
541
  v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected">
542
542
 
543
+
544
+
545
+
546
+
543
547
  <template #header="props">
544
548
  <q-tr :props="props">
545
549
  <q-td v-if="selection != 'none'" auto-width>
@@ -667,6 +671,9 @@ const computedColumns = computed(() => {
667
671
  </q-tr>
668
672
  </template>
669
673
 
674
+ <template v-for="slot of ss" v-slot:[slot]="props">
675
+ <slot :name="slot" v-bind="props"></slot>
676
+ </template>
670
677
  </q-table>
671
678
  </l-card>
672
679
  </template>
@@ -4,13 +4,26 @@ export default (name) => {
4
4
  return Object.assign(m, {
5
5
  columns(fields) {
6
6
  let columns = [];
7
- for (let f of fields) {
8
- const field = getModelField(name, f);
9
- if (!field)
10
- continue;
11
- const option = field.getRaw();
12
- option.name = field.getName();
13
- columns.push(option);
7
+ if (Array.isArray(fields)) {
8
+ for (let f of fields) {
9
+ const field = getModelField(name, f);
10
+ if (!field)
11
+ continue;
12
+ const option = field.getRaw();
13
+ option.name = field.getName();
14
+ columns.push(option);
15
+ }
16
+ } else {
17
+ for (let f in fields) {
18
+ if (!fields[f])
19
+ continue;
20
+ const field = getModelField(name, f);
21
+ if (!field)
22
+ continue;
23
+ const option = field.getRaw();
24
+ option.name = field.getName();
25
+ columns.push(option);
26
+ }
14
27
  }
15
28
  return columns;
16
29
  }
@@ -5,7 +5,17 @@ const onRequest = async (request) => {
5
5
 
6
6
  request.loadObjects("User", { status: status.value });
7
7
  };
8
- const columns = model("User").columns(["username", "first_name", "label_name", "email", "phone", "join_date", "status", "has2FA"]);
8
+ const columns = model("User").columns({
9
+ username: true,
10
+ first_name: true,
11
+ label_name: true,
12
+ email: true,
13
+ phone: true,
14
+ join_date: true,
15
+ status: true,
16
+ has2FA: true,
17
+ })
18
+
9
19
  const status = ref("0");
10
20
  </script>
11
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.10.18",
3
+ "version": "1.10.20",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",