2021-12-11 21:26:55 +01:00
|
|
|
<script lang="ts">
|
|
|
|
export let value: string;
|
2022-02-07 16:32:21 +01:00
|
|
|
export let title: string | undefined = undefined;
|
2021-12-11 21:26:55 +01:00
|
|
|
|
2021-12-21 23:01:50 +01:00
|
|
|
$: valueStart = value.substring(0, value.length - 7).replace(" ", "\xa0");
|
|
|
|
$: valueEnd = value
|
|
|
|
.substring(value.length - 7, value.length)
|
|
|
|
.replace(" ", "\xa0");
|
2021-12-11 21:26:55 +01:00
|
|
|
</script>
|
|
|
|
|
2022-02-07 16:32:21 +01:00
|
|
|
<div class="ellipsis" title={title || value}>
|
2021-12-11 21:26:55 +01:00
|
|
|
<div class="start">{valueStart}</div>
|
|
|
|
<div class="end">{valueEnd}</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.ellipsis {
|
2021-12-11 21:34:00 +01:00
|
|
|
display: flex;
|
2021-12-11 21:26:55 +01:00
|
|
|
flex-wrap: nowrap;
|
|
|
|
max-width: 100%;
|
|
|
|
|
|
|
|
* {
|
|
|
|
display: inline-block;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
min-width: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.start {
|
|
|
|
flex: 0 1 auto;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
.end {
|
|
|
|
flex: 1 0 auto;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|