vueless 0.0.440 → 0.0.442
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 +1 -1
- package/ui.data-table/UTableRow.vue +18 -2
- package/web-types.json +1 -1
package/package.json
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
:class="cx([bodyCellContentAttrs.class, getCellContentClasses(row, key)])"
|
|
50
50
|
:data-test="`${dataTest}-${key}-cell`"
|
|
51
51
|
>
|
|
52
|
-
{{ value
|
|
52
|
+
{{ formatCellValue(value) }}
|
|
53
53
|
</div>
|
|
54
54
|
</slot>
|
|
55
55
|
</div>
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
:class="cx([bodyCellContentAttrs.class, getCellContentClasses(row, key)])"
|
|
63
63
|
:data-test="`${dataTest}-${key}-cell`"
|
|
64
64
|
>
|
|
65
|
-
{{ value
|
|
65
|
+
{{ formatCellValue(value) }}
|
|
66
66
|
</div>
|
|
67
67
|
</slot>
|
|
68
68
|
</template>
|
|
@@ -277,6 +277,22 @@ function getCellContentClasses(row, key) {
|
|
|
277
277
|
return typeof cellClasses === "function" ? cellClasses(row[key].value, row) : cellClasses;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
+
function isEmptyValue(value) {
|
|
281
|
+
return (
|
|
282
|
+
value === null ||
|
|
283
|
+
value === undefined ||
|
|
284
|
+
value === "" ||
|
|
285
|
+
(Array.isArray(value) && value.length === 0) ||
|
|
286
|
+
(typeof value === "object" && !Object.keys(value).length)
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function formatCellValue(value) {
|
|
291
|
+
const nestedValue = value && typeof value === "object" && "value" in value ? value.value : value;
|
|
292
|
+
|
|
293
|
+
return isEmptyValue(nestedValue) ? HYPHEN_SYMBOL : nestedValue;
|
|
294
|
+
}
|
|
295
|
+
|
|
280
296
|
function getNestedShift() {
|
|
281
297
|
return { marginLeft: `${props.nestedLevel * shift.value}rem` };
|
|
282
298
|
}
|