Add overlay to autocolumns when creating rows

This commit is contained in:
Andrew Kingston 2023-04-26 18:52:16 +01:00
parent 09ec898a4d
commit 78c50df4bd
2 changed files with 23 additions and 1 deletions

View File

@ -87,4 +87,5 @@
{invertX}
{contentLines}
/>
<slot />
</GridCell>

View File

@ -181,7 +181,11 @@
rowIdx={0}
invertX={columnIdx >= $columnHorizontalInversionIndex}
{invertY}
/>
>
{#if column?.schema?.autocolumn}
<div class="readonly">Can't edit auto column</div>
{/if}
</DataCell>
{/key}
{/each}
</div>
@ -262,4 +266,21 @@
width: 0;
display: flex;
}
/* Readonly cell overlay */
.readonly {
position: absolute;
top: 0;
left: 0;
height: var(--row-height);
width: 100%;
padding: var(--cell-padding);
font-style: italic;
color: var(--spectrum-global-color-gray-600);
z-index: 1;
user-select: none;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>