1
0
Fork 0
mirror of synced 2024-09-17 17:57:47 +12:00

wip component infoword

This commit is contained in:
Gerard Burns 2024-04-08 08:29:55 +01:00
parent 95878f445a
commit bd002db0e7
2 changed files with 54 additions and 25 deletions

View file

@ -72,17 +72,12 @@
<div class="line topLine">
<span class="bullet"></span>
<a
target="_blank" rel="noopener noreferrer"
<InfoWord
on:mouseenter={() => handleMouseenter("column")}
on:mouseleave={() => handleMouseleave("column")}
href={tableHref}
class="chip columnName"
>
<span>
{columnName}
</span>
</a>
text={columnName}
/>
<span class="space" />
<span class="text"> is a </span>
<span class="space" />
@ -264,6 +259,10 @@
{/if}
<style>
.text {
flex-shrink: 0;
}
.sidecarContent {
max-width: 300px;
padding: 16px 12px 18px;

View file

@ -1,25 +1,52 @@
<script>
import { Icon } from "@budibase/bbui"
export let icon = ""
export let color = "initial"
export let icon = null
export let color = null
export let text = ""
export let href = null
</script>
<div
role="tooltip"
class="chip"
style:color={color}
style:border-color={color}
on:mouseenter
on:mouseleave
{#if href !== null}
<a
tabindex="0"
{href}
rel="noopener noreferrer"
target="_blank"
class="chip"
style:color={color}
style:border-color={color}
on:mouseenter
on:mouseleave
>
<Icon size="S" name={icon} />
<span class="text">
<slot>
{text}
</slot>
</span>
</div>
{#if icon}
<Icon size="S" name={icon} />
{/if}
<span class="text">
<slot>
{text}
</slot>
</span>
</a>
{:else}
<div
role="tooltip"
class="chip"
style:color={color}
style:border-color={color}
on:mouseenter
on:mouseleave
>
{#if icon}
<Icon size="S" name={icon} />
{/if}
<span class="text">
<slot>
{text}
</slot>
</span>
</div>
{/if}
<style>
.chip {
@ -31,6 +58,7 @@
filter: brightness(100%);
background-color: var(--grey-3);
border: 1px solid var(--grey-3);
overflow: hidden;
}
.chip:hover {
@ -45,6 +73,8 @@
.text {
color: var(--ink);
flex-shrink: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>