From 1a59b24f60f4f937a3c6280f8d831436dcf09789 Mon Sep 17 00:00:00 2001 From: vato007 Date: Sat, 6 Jul 2024 09:47:14 +0930 Subject: [PATCH] Add overflow to editor, maximise field widths, add toggle for preview --- src/app/app.component.html | 12 +++++++++++- src/app/app.component.scss | 8 ++++++++ src/app/app.component.ts | 1 + src/app/editor/editor.component.html | 2 +- src/app/editor/editor.component.scss | 12 ++++++++++++ src/app/editor/editor.component.ts | 4 +++- src/app/list-field/list-field.component.scss | 12 +++++++++++- src/app/list-field/list-field.component.ts | 8 +++++--- src/app/proto-field/proto-field.component.scss | 4 ++++ src/app/proto-field/proto-field.component.ts | 4 ++-- 10 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index d7cbcc0..cfd467d 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -8,6 +8,13 @@ > dock_to_right + } } - `, + `, styleUrl: './list-field.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, }) @@ -48,10 +50,10 @@ export class ListFieldComponent { const existingValues = this.values(); if (existingValues) { const newValues = [...existingValues]; - newValues.push(undefined); + newValues.push(''); this.values.set(newValues); } else { - this.values.set([undefined]); + this.values.set(['']); } } diff --git a/src/app/proto-field/proto-field.component.scss b/src/app/proto-field/proto-field.component.scss index 5d4e87f..801d45f 100644 --- a/src/app/proto-field/proto-field.component.scss +++ b/src/app/proto-field/proto-field.component.scss @@ -1,3 +1,7 @@ :host { display: block; + + & > * { + width: 100%; + } } diff --git a/src/app/proto-field/proto-field.component.ts b/src/app/proto-field/proto-field.component.ts index 92a5121..b294cf0 100644 --- a/src/app/proto-field/proto-field.component.ts +++ b/src/app/proto-field/proto-field.component.ts @@ -76,14 +76,14 @@ export class ProtoFieldComponent { if (this.configuration().type === MessageTypeEnum.Enum) { return this.configuration() as EnumMessage; } - return null; + return; }); protected listConfiguration = computed(() => { if (this.configuration().type === MessageTypeEnum.List) { return this.configuration() as ListMessage; } - return null; + return; }); protected readonly MessageTypeEnum = MessageTypeEnum;