37 lines
659 B
Svelte
37 lines
659 B
Svelte
|
<script lang="ts">
|
||
|
export let value: string;
|
||
|
|
||
|
$: valueStart = value.substring(0, value.length - 7);
|
||
|
$: valueEnd = value.substring(value.length - 7, value.length);
|
||
|
</script>
|
||
|
|
||
|
<div class="ellipsis">
|
||
|
<div class="start">{valueStart}</div>
|
||
|
<div class="end">{valueEnd}</div>
|
||
|
</div>
|
||
|
|
||
|
<style lang="scss">
|
||
|
.ellipsis {
|
||
|
display: inline-flex;
|
||
|
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>
|