Display relationship fields on relationship focus only
This commit is contained in:
parent
9dc9224b65
commit
42a2eec439
|
@ -56,6 +56,12 @@
|
||||||
return acc
|
return acc
|
||||||
}, {})
|
}, {})
|
||||||
|
|
||||||
|
$: showRelationshipFields =
|
||||||
|
relationshipFields &&
|
||||||
|
Object.keys(relationshipFields).length &&
|
||||||
|
focused &&
|
||||||
|
!isOpen
|
||||||
|
|
||||||
const parseValue = value => {
|
const parseValue = value => {
|
||||||
if (Array.isArray(value) && value.every(x => x?._id)) {
|
if (Array.isArray(value) && value.every(x => x?._id)) {
|
||||||
return value
|
return value
|
||||||
|
@ -351,8 +357,8 @@
|
||||||
</GridPopover>
|
</GridPopover>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if relationshipFields && !focused}
|
{#if relationshipFields}
|
||||||
<GridPopover {open} {anchor}>
|
<GridPopover open={showRelationshipFields} {anchor}>
|
||||||
<div class="relationship-fields">
|
<div class="relationship-fields">
|
||||||
{#each Object.entries(relationshipFields) as [fieldName, fieldValue]}
|
{#each Object.entries(relationshipFields) as [fieldName, fieldValue]}
|
||||||
<div class="relationship-field-name">
|
<div class="relationship-field-name">
|
||||||
|
@ -460,6 +466,9 @@
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
border-radius: var(--cell-padding);
|
border-radius: var(--cell-padding);
|
||||||
}
|
}
|
||||||
|
.values.wrap .badge:hover::before {
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
.badge span {
|
.badge span {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
@ -540,10 +549,7 @@
|
||||||
grid-column-gap: var(--cell-spacing);
|
grid-column-gap: var(--cell-spacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
.values:not(.wrap) .badge.extra-info {
|
.values.wrap .badge.extra-info {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.values:not(.wrap) .badge.extra-info:hover::before {
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue