refs #6256 lv breakword
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-10-24 12:49:36 +02:00
parent 824c266241
commit 7c9322d52c
3 changed files with 29 additions and 5 deletions

View File

@ -93,7 +93,7 @@ watch(props, async () => {
flex: 2; flex: 2;
} }
> .q-card.vn-three { > .q-card.vn-three {
flex: 3; flex: 4;
} }
> .q-card.vn-max { > .q-card.vn-max {
width: 100%; width: 100%;
@ -112,11 +112,13 @@ watch(props, async () => {
margin-top: 5px; margin-top: 5px;
.label { .label {
color: var(--vn-label); color: var(--vn-label);
width: 10em; width: 8em;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
margin-right: 10px; margin-right: 10px;
flex-grow: 0;
flex-shrink: 0;
} }
.value { .value {
color: var(--vn-text); color: var(--vn-text);

View File

@ -9,14 +9,36 @@ const $props = defineProps({
titleValue: { type: [Number, String, Boolean], default: null }, titleValue: { type: [Number, String, Boolean], default: null },
info: { type: String, default: null }, info: { type: String, default: null },
dash: { type: Boolean, default: true }, dash: { type: Boolean, default: true },
textOverflow: { type: String, default: 'ellipsis' },
}); });
const isBooleanValue = computed(() => typeof $props.value === 'boolean'); const isBooleanValue = computed(() => typeof $props.value === 'boolean');
const textOverflowClass = computed(() => {
if ($props.textOverflow === 'ellipsis') return 'line-break-text';
return 'ellipsis-text';
});
</script> </script>
<style scoped>
.ellipsis-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.line-break-text {
white-space: pre-line;
hyphens: auto;
word-wrap: break-word;
}
</style>
<template> <template>
<div class="vn-label-value"> <div class="vn-label-value">
<div v-if="$props.label || $slots.label" class="label"> <div v-if="$props.label || $slots.label" class="label">
<slot name="label"> <slot name="label">
<span :title="$props.titleLabel ?? $props.label">{{ $props.label }}</span> <span
:title="$props.titleLabel ?? $props.label"
:class="textOverflowClass"
>{{ $props.label }}</span
>
</slot> </slot>
</div> </div>
<div class="value"> <div class="value">
@ -28,7 +50,7 @@ const isBooleanValue = computed(() => typeof $props.value === 'boolean');
/> />
</span> </span>
<slot v-else name="value"> <slot v-else name="value">
<span :title="$props.value"> <span :title="$props.value" :class="textOverflowClass">
{{ $props.dash ? dashIfEmpty($props.value) : $props.value }} {{ $props.dash ? dashIfEmpty($props.value) : $props.value }}
</span> </span>
</slot> </slot>

View File

@ -60,7 +60,7 @@ const creditWarning = computed(() => {
<template> <template>
<CardSummary ref="summary" :url="`Clients/${entityId}/summary`"> <CardSummary ref="summary" :url="`Clients/${entityId}/summary`">
<template #body="{ entity }"> <template #body="{ entity }">
<QCard class="vn-one"> <QCard class="vn-two">
<a class="header" :href="clientUrl + `basic-data`"> <a class="header" :href="clientUrl + `basic-data`">
{{ t('customer.summary.basicData') }} {{ t('customer.summary.basicData') }}
<QIcon name="open_in_new" color="primary" /> <QIcon name="open_in_new" color="primary" />