From 4c62eaf39b5e6fd69fe5384a651a35efe92b5812 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Thu, 14 Nov 2024 12:57:46 +0300 Subject: [PATCH] Fixed editor issues --- .../components/layout/AppDesigner.vue | 208 +----------------- .../layout/designer/DesignColorPalette.vue | 15 +- .../layout/designer/DesignTokenField.vue | 8 +- .../designer/semantic/DesignGeneral.vue | 17 +- 4 files changed, 11 insertions(+), 237 deletions(-) diff --git a/apps/showcase/components/layout/AppDesigner.vue b/apps/showcase/components/layout/AppDesigner.vue index 1abc6dff7..c921f2260 100644 --- a/apps/showcase/components/layout/AppDesigner.vue +++ b/apps/showcase/components/layout/AppDesigner.vue @@ -157,8 +157,7 @@ diff --git a/apps/showcase/components/layout/designer/DesignColorPalette.vue b/apps/showcase/components/layout/designer/DesignColorPalette.vue index 5e0d11822..54bd22c7b 100644 --- a/apps/showcase/components/layout/designer/DesignColorPalette.vue +++ b/apps/showcase/components/layout/designer/DesignColorPalette.vue @@ -1,29 +1,16 @@ diff --git a/apps/showcase/components/layout/designer/DesignTokenField.vue b/apps/showcase/components/layout/designer/DesignTokenField.vue index 794ab75b6..12e502af6 100644 --- a/apps/showcase/components/layout/designer/DesignTokenField.vue +++ b/apps/showcase/components/layout/designer/DesignTokenField.vue @@ -65,12 +65,12 @@ export default { items: null }; }, - mounted() { + created() { this.id = 'dt_field_' + UniqueComponentId(); }, methods: { onOptionSelect(event) { - this.$emit('update:modelValue', event.value); + this.$emit('update:modelValue', event.value.label); event.originalEvent.stopPropagation(); }, onInput(event) { @@ -88,7 +88,9 @@ export default { }, computed: { previewColor() { - return this.modelValue && this.modelValue.startsWith('{') && this.modelValue.endsWith('}') ? $dt(this.modelValue).variable : this.modelValue; + const tokenValue = typeof this.modelValue === 'object' ? this.modelValue.label : this.modelValue; + + return tokenValue && tokenValue.trim().length && tokenValue.startsWith('{') && tokenValue.endsWith('}') ? $dt(tokenValue).variable : tokenValue; }, inputId() { return this.id + '_input'; diff --git a/apps/showcase/components/layout/designer/semantic/DesignGeneral.vue b/apps/showcase/components/layout/designer/semantic/DesignGeneral.vue index edca3ea47..4b96dfd3b 100644 --- a/apps/showcase/components/layout/designer/semantic/DesignGeneral.vue +++ b/apps/showcase/components/layout/designer/semantic/DesignGeneral.vue @@ -3,7 +3,7 @@
Primary - +
@@ -49,26 +49,13 @@