diff --git a/Frontend/src/components/xml/XmlInputFieldComponent.vue b/Frontend/src/components/xml/XmlInputFieldComponent.vue index 3ac39e4..8780c3d 100644 --- a/Frontend/src/components/xml/XmlInputFieldComponent.vue +++ b/Frontend/src/components/xml/XmlInputFieldComponent.vue @@ -4,9 +4,6 @@ import XMLButtonFormatterComponent from '@components/formatter/XMLButtonFormatte import { ref } from 'vue' import CodeEditor from '../CodeEditorComponent.vue' -const data = ref('') -const inputFile = ref() - const props = defineProps( { stylizedName: {type: String, required: true}, @@ -15,6 +12,9 @@ const props = defineProps( ) const emit = defineEmits(['update']) +const data = ref('') +const inputFile = ref() + function sendValue() { emit('update', data.value) } diff --git a/Frontend/src/components/xml/XmlTabbedInputComponent.vue b/Frontend/src/components/xml/XmlTabbedInputComponent.vue index 5a4975a..3584025 100644 --- a/Frontend/src/components/xml/XmlTabbedInputComponent.vue +++ b/Frontend/src/components/xml/XmlTabbedInputComponent.vue @@ -6,6 +6,15 @@ import { type TabData } from '../common/TabData' import { ref } from 'vue' import CodeEditor from '../CodeEditorComponent.vue' +const props = defineProps( + { + stylizedName: {type: String, required: true}, + data: {type: Array}, + tabCountLimit: {type: Number, required: false} + } +) +const emit = defineEmits(['update']) + const newTabId = ref(0); const activeTabId = ref(0); @@ -19,15 +28,6 @@ tabs.value.push({ const data = ref('') const inputFile = ref() -const props = defineProps( - { - stylizedName: {type: String, required: true}, - data: {type: Array}, - } -) -const emit = defineEmits(['update']) - - function sendValue() { emit('update', tabs.value); @@ -81,6 +81,9 @@ function changeActiveTab(id : number) { } function addTab() { + if (isTabCountLimitAchieved()) + return + tabs.value.push({ id: newTabId.value++, name: "XML" + newTabId.value, @@ -88,6 +91,10 @@ function addTab() { }); } +function isTabCountLimitAchieved() { + return props.tabCountLimit && tabs.value.length == props.tabCountLimit +} + function removeTab(id : number) { if (tabs.value.length == 1) return @@ -129,7 +136,7 @@ function findIndexWithID(id : number) : number {
- + diff --git a/Frontend/src/views/XSLTView.vue b/Frontend/src/views/XSLTView.vue index 5495944..b00dc61 100644 --- a/Frontend/src/views/XSLTView.vue +++ b/Frontend/src/views/XSLTView.vue @@ -22,7 +22,7 @@ function updateVersion(newVersion: string) {
- +