From 0db08498d9c1a38b02485ec987561dfdd53ea3dc Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 23 May 2024 17:44:23 +0100 Subject: [PATCH] Fix for grid arrow event handling when creating a column --- .../DataTable/modals/CreateEditColumn.svelte | 479 +++++++++--------- .../grid/overlays/KeyboardManager.svelte | 1 + 2 files changed, 242 insertions(+), 238 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 8583dbcab7..477ca1caa9 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -517,258 +517,261 @@ }) - - {#if mounted} - { - if ( - !uneditable && - !(linkEditDisabled && editableColumn.type === LINK_TYPE) - ) { - editableColumn.name = e.target.value - } - }} - disabled={uneditable || - (linkEditDisabled && editableColumn.type === LINK_TYPE)} - error={errors?.name} - /> - {/if} - - {:else if editableColumn.type === FieldType.OPTIONS} - - {:else if editableColumn.type === FieldType.LONGFORM} -
-
- - - - -
- - + + {#if mounted} + { + if ( + !uneditable && + !(linkEditDisabled && editableColumn.type === LINK_TYPE) + ) { + editableColumn.name = e.target.value + } + }} + disabled={uneditable || + (linkEditDisabled && editableColumn.type === LINK_TYPE)} + error={errors?.name} /> -
- {:else if editableColumn.type === FieldType.ARRAY} - - {:else if editableColumn.type === DATE_TYPE && !editableColumn.autocolumn} -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- {#if !editableColumn.timeOnly} - {#if datasource?.source !== SourceName.ORACLE && datasource?.source !== SourceName.SQL_SERVER && !editableColumn.dateOnly} -
-
- - - - -
- -
- {/if} - {/if} - {:else if editableColumn.type === FieldType.NUMBER && !editableColumn.autocolumn} -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- {:else if editableColumn.type === FieldType.LINK && !editableColumn.autocolumn} - field.name} + getOptionValue={field => field.fieldId} + getOptionIcon={field => field.icon} + isOptionEnabled={option => { + if (option.type === AUTO_TYPE) { + return availableAutoColumnKeys?.length > 0 + } + return true + }} /> - {:else if editableColumn.type === FORMULA_TYPE} - {#if !table.sql} + + {#if editableColumn.type === FieldType.STRING} + + {:else if editableColumn.type === FieldType.OPTIONS} + + {:else if editableColumn.type === FieldType.LONGFORM} +
+
+ + + + +
+ + +
+ {:else if editableColumn.type === FieldType.ARRAY} + + {:else if editableColumn.type === DATE_TYPE && !editableColumn.autocolumn}
- +
- (editableColumn.subtype = e.detail)} - options={Object.entries(autoColumnOptions)} - getOptionLabel={option => option[1].name} - getOptionValue={option => option[0]} - disabled={!availableAutoColumnKeys?.length || editableColumn.autocolumn} - error={errors?.subtype} - /> - {/if} - {#if canBeRequired || canBeDisplay} -
- {#if canBeRequired} - +
+
+ +
+
+ +
+
+ {#if !editableColumn.timeOnly} + {#if datasource?.source !== SourceName.ORACLE && datasource?.source !== SourceName.SQL_SERVER && !editableColumn.dateOnly} +
+
+ + + + +
+ +
+ {/if} + {/if} -
- {/if} - - -
- {#if !uneditable && originalName != null} - - {/if} - - + {/if} + + +
+