63 lines
1.4 KiB
Vue
63 lines
1.4 KiB
Vue
<template>
|
|
|
|
<!-- TODO: Validar de ação está cehgando aqui-->
|
|
<button
|
|
v-if="dados?.acao"
|
|
type="button"
|
|
class="eli-tabela__texto-truncado eli-tabela__celula-link"
|
|
:title="dados?.texto"
|
|
@click.stop.prevent="dados.acao()"
|
|
>
|
|
{{ dados?.texto }}
|
|
</button>
|
|
<span v-else class="eli-tabela__texto-truncado" :title="dados?.texto">{{ dados?.texto }}</span>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent, PropType } from "vue";
|
|
import type { TiposTabelaCelulas } from "./tiposTabelaCelulas";
|
|
|
|
export default defineComponent({
|
|
name: "EliTabelaCelulaTextoTruncado",
|
|
props: {
|
|
dados: {
|
|
type: Object as PropType<TiposTabelaCelulas["textoTruncado"]>,
|
|
},
|
|
},
|
|
setup({ dados }) {
|
|
return { dados };
|
|
},
|
|
});
|
|
</script>
|
|
|
|
<style scoped>
|
|
.eli-tabela__texto-truncado {
|
|
display: inline-block;
|
|
max-width: 260px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
vertical-align: top;
|
|
}
|
|
|
|
.eli-tabela__celula-link {
|
|
all: unset;
|
|
display: inline;
|
|
color: #2563eb;
|
|
cursor: pointer;
|
|
text-decoration: underline;
|
|
text-decoration-color: rgba(37, 99, 235, 0.55);
|
|
text-underline-offset: 2px;
|
|
}
|
|
|
|
.eli-tabela__celula-link:hover {
|
|
color: #1d4ed8;
|
|
text-decoration-color: rgba(29, 78, 216, 0.75);
|
|
}
|
|
|
|
.eli-tabela__celula-link:focus-visible {
|
|
outline: 2px solid rgba(37, 99, 235, 0.45);
|
|
outline-offset: 2px;
|
|
border-radius: 4px;
|
|
}
|
|
</style>
|