2023-08-27 20:12:31 +02:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import _ from 'lodash';
|
|
|
|
import type { CKeyValueListItems } from './c-key-value-list.types';
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<{ items?: CKeyValueListItems }>(), { items: () => [] });
|
|
|
|
const { items } = toRefs(props);
|
|
|
|
|
|
|
|
const formattedItems = computed(() => items.value.filter(item => !_.isNil(item.value) || !item.hideOnNil));
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-11-12 23:22:41 +01:00
|
|
|
<div flex flex-col gap-2>
|
|
|
|
<div v-for="item in formattedItems" :key="item.label" class="c-key-value-list__item">
|
|
|
|
<div class="c-key-value-list__key" text-13px lh-normal>
|
2023-08-27 20:12:31 +02:00
|
|
|
{{ item.label }}
|
2023-09-03 18:12:22 +02:00
|
|
|
</div>
|
2023-08-27 20:12:31 +02:00
|
|
|
|
2023-11-12 23:22:41 +01:00
|
|
|
<c-key-value-list-item :item="item" class="c-key-value-list__value" font-bold lh-normal />
|
2023-09-03 18:12:22 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-08-27 20:12:31 +02:00
|
|
|
</template>
|