diff --git a/eveai_chat_client/static/css/chat-input.css b/eveai_chat_client/static/css/chat-input.css new file mode 100644 index 0000000..282e5c3 --- /dev/null +++ b/eveai_chat_client/static/css/chat-input.css @@ -0,0 +1,11 @@ +/* Animation styles for ChatInput component */ +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +/* Add more ChatInput-specific styles here */ +.loading-spinner { + display: inline-block; + animation: spin 1s linear infinite; +} diff --git a/eveai_chat_client/static/js/chat-app.js b/eveai_chat_client/static/js/chat-app.js index 721c963..d253aa3 100644 --- a/eveai_chat_client/static/js/chat-app.js +++ b/eveai_chat_client/static/js/chat-app.js @@ -567,7 +567,6 @@ export const ChatApp = { :is-submitting-form="isSubmittingForm" :api-prefix="apiPrefix" :auto-scroll="true" - @submit-form="submitForm" @specialist-error="handleSpecialistError" @specialist-complete="handleSpecialistComplete" ref="messageHistory" diff --git a/eveai_chat_client/static/js/components/ChatInput.js b/eveai_chat_client/static/js/components/ChatInput.js index 646a032..d87f60c 100644 --- a/eveai_chat_client/static/js/components/ChatInput.js +++ b/eveai_chat_client/static/js/components/ChatInput.js @@ -4,6 +4,19 @@ // Anders moet je ervoor zorgen dat MaterialIconManager.js eerder wordt geladen // en iconManager beschikbaar is via window.iconManager + // Voeg stylesheet toe voor ChatInput-specifieke stijlen + const addStylesheet = () => { + if (!document.querySelector('link[href*="chat-input.css"]')) { + const link = document.createElement('link'); + link.rel = 'stylesheet'; + link.href = '/static/assets/css/chat-input.css'; + document.head.appendChild(link); + } + }; + + // Laad de stylesheet + addStylesheet(); + export const ChatInput = { name: 'ChatInput', components: { @@ -235,7 +248,10 @@ }, updateFormValues(newValues) { - this.formValues = { ...newValues }; + // Controleer of er daadwerkelijk iets is veranderd om recursieve updates te voorkomen + if (JSON.stringify(newValues) !== JSON.stringify(this.formValues)) { + this.formValues = JSON.parse(JSON.stringify(newValues)); + } } }, template: ` @@ -260,13 +276,6 @@ - -
diff --git a/eveai_chat_client/static/js/components/DynamicForm.js b/eveai_chat_client/static/js/components/DynamicForm.js index 85eb187..d2dcb09 100644 --- a/eveai_chat_client/static/js/components/DynamicForm.js +++ b/eveai_chat_client/static/js/components/DynamicForm.js @@ -65,13 +65,19 @@ export const DynamicForm = { watch: { formValues: { handler(newValues) { - this.localFormValues = { ...newValues }; + // Gebruik een vlag om recursieve updates te voorkomen + if (JSON.stringify(newValues) !== JSON.stringify(this.localFormValues)) { + this.localFormValues = JSON.parse(JSON.stringify(newValues)); + } }, deep: true }, localFormValues: { handler(newValues) { - this.$emit('update:formValues', newValues); + // Gebruik een vlag om recursieve updates te voorkomen + if (JSON.stringify(newValues) !== JSON.stringify(this.formValues)) { + this.$emit('update:formValues', JSON.parse(JSON.stringify(newValues))); + } }, deep: true }, diff --git a/eveai_chat_client/static/js/components/FormField.js b/eveai_chat_client/static/js/components/FormField.js index d5d3bc5..e78b07d 100644 --- a/eveai_chat_client/static/js/components/FormField.js +++ b/eveai_chat_client/static/js/components/FormField.js @@ -30,7 +30,10 @@ export const FormField = { return this.modelValue; }, set(value) { - this.$emit('update:modelValue', value); + // Voorkom emit als de waarde niet is veranderd + if (JSON.stringify(value) !== JSON.stringify(this.modelValue)) { + this.$emit('update:modelValue', value); + } } }, fieldType() {