@hostlink/nuxt-light 1.46.4 → 1.46.6

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.46.4",
4
+ "version": "1.46.6",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -21,14 +21,15 @@ function getTo(field) {
21
21
  }
22
22
  return null;
23
23
  }
24
- const getFormattedValue = (field, val, model) => {
25
- if (field.format) {
26
- if (field.format instanceof Function) {
27
- return field.format(val, model);
24
+ const getFieldValue = (field) => {
25
+ const model = props.modelValue;
26
+ if (field.field) {
27
+ if (field.field instanceof Function) {
28
+ return field.field(model);
28
29
  }
29
30
  }
30
31
  ;
31
- return val;
32
+ return model ? model[field.name] : null;
32
33
  };
33
34
  </script>
34
35
 
@@ -36,7 +37,7 @@ const getFormattedValue = (field, val, model) => {
36
37
  <q-list v-bind="$props">
37
38
  <template v-if="fields">
38
39
  <l-item v-for="field in fields" :label="field.label" :to="getTo(field)">
39
- {{ getFormattedValue(field, props.modelValue, props.modelValue) }}
40
+ {{ getFieldValue(field) }}
40
41
  </l-item>
41
42
 
42
43
  </template>
@@ -1,4 +1,8 @@
1
1
  import { default as api } from "./api.js";
2
2
  export default (name, field) => {
3
- return api.model(name).field(field);
3
+ let f = api.model(name).field(field);
4
+ if (f && !f.name) {
5
+ f.name = field;
6
+ }
7
+ return f;
4
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.46.4",
3
+ "version": "1.46.6",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",