formview fixes

This commit is contained in:
Jan Prochazka 2021-11-20 08:36:58 +01:00
parent c1a9641ce5
commit 0084cbcb63
3 changed files with 21 additions and 4 deletions

View File

@ -96,7 +96,9 @@
class:isFocusedColumn
{style}
>
{#if value === null}
{#if rowData == null}
<span class="null">(No row)</span>
{:else if value === null}
<span class="null">(NULL)</span>
{:else if value === undefined}
<span class="null">(No field)</span>

View File

@ -28,6 +28,7 @@
export let onSetValue;
export let width;
export let cellValue;
export let fillParent=false;
let domEditor;
@ -89,6 +90,7 @@
on:blur={handleBlur}
bind:this={domEditor}
style={widthCopy ? `width:${widthCopy}px;min-width:${widthCopy}px;max-width:${widthCopy}px` : undefined}
class:fillParent
/>
<style>
@ -98,4 +100,12 @@
margin: 0px;
padding: 0px;
}
input.fillParent {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
</style>

View File

@ -398,7 +398,9 @@
} else {
// @ts-ignore
event.preventDefault();
dispatchInsplaceEditor({ type: 'show', text: event.key, cell: currentCell });
if (rowData) {
dispatchInsplaceEditor({ type: 'show', text: event.key, cell: currentCell });
}
}
}
@ -425,7 +427,9 @@
if (event.keyCode == keycodes.f2) {
// @ts-ignore
dispatchInsplaceEditor({ type: 'show', cell: currentCell, selectAll: true });
if (rowData) {
dispatchInsplaceEditor({ type: 'show', cell: currentCell, selectAll: true });
}
}
handleCursorMove(event);
@ -544,8 +548,9 @@
isCurrentCell={currentCell[0] == rowIndex && currentCell[1] == chunkIndex * 2 + 1}
onDictionaryLookup={() => handleLookup(col)}
>
{#if $inplaceEditorState.cell && rowIndex == $inplaceEditorState.cell[0] && chunkIndex * 2 + 1 == $inplaceEditorState.cell[1]}
{#if rowData && $inplaceEditorState.cell && rowIndex == $inplaceEditorState.cell[0] && chunkIndex * 2 + 1 == $inplaceEditorState.cell[1]}
<InplaceEditor
fillParent
width={getCellWidth(rowIndex, chunkIndex * 2 + 1)}
inplaceEditorState={$inplaceEditorState}
{dispatchInsplaceEditor}