@bildvitta/quasar-ui-asteroid 2.15.0 → 2.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
- "version": "2.15.0",
3
+ "version": "2.16.0",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -35,6 +35,10 @@ export default {
35
35
  description: 'CSS classes for each result value.'
36
36
  },
37
37
 
38
+ emptyResultText: {
39
+ description: 'Message for fields with empty values.'
40
+ },
41
+
38
42
  fields: {
39
43
  description: 'Define header value for each `field`.'
40
44
  },
@@ -38,6 +38,11 @@ export default {
38
38
  type: Boolean
39
39
  },
40
40
 
41
+ emptyResultText: {
42
+ default: '-',
43
+ type: String
44
+ },
45
+
41
46
  result: {
42
47
  default: () => ({}),
43
48
  type: Object
@@ -76,16 +81,14 @@ export default {
76
81
  resultsByFields () {
77
82
  const formattedResult = {}
78
83
  const result = extend(true, {}, this.result)
79
-
80
84
  for (const key in result) {
81
85
  if (this.formattedFields[key]?.type) {
82
- formattedResult[key] = humanize(this.formattedFields[key], result[key])
86
+ formattedResult[key] = humanize(this.formattedFields[key], result[key]) || this.emptyResultText
83
87
  // TODO: Rever.
84
88
  // eslint-disable-next-line vue/no-side-effects-in-computed-properties
85
89
  this.slotValue[key] = { ...this.formattedFields[key], formattedResult: formattedResult[key] }
86
90
  }
87
91
  }
88
-
89
92
  return formattedResult
90
93
  }
91
94
  }
@@ -22,6 +22,10 @@ export default {
22
22
  description: 'Table columns and order.'
23
23
  },
24
24
 
25
+ emptyResultText: {
26
+ description: 'Message for fields with empty values.'
27
+ },
28
+
25
29
  fields: {
26
30
  description: 'Contain fields data, as `name`, `label` and `type`.',
27
31
  table: {
@@ -43,6 +43,11 @@ export default {
43
43
  rowKey: {
44
44
  default: 'name',
45
45
  type: String
46
+ },
47
+
48
+ emptyResultText: {
49
+ default: '-',
50
+ type: String
46
51
  }
47
52
  },
48
53
 
@@ -114,7 +119,7 @@ export default {
114
119
  return results.map((result, index) => {
115
120
  for (const key in result) {
116
121
  result.default = this.results[index]
117
- result[key] = humanize(this.fields[key], result[key])
122
+ result[key] = humanize(this.fields[key], result[key]) || this.emptyResultText
118
123
  }
119
124
 
120
125
  return result
@@ -96,7 +96,7 @@ function handleMasks (value) {
96
96
 
97
97
  // Labels
98
98
  function humanize (field = {}, value) {
99
- if (!value) return value
99
+ if (field.mask && !value) return value
100
100
 
101
101
  const mappedMasks = handleMasks(value)
102
102