* Enhance MentionParser and Related Components for Improved Mention Handling - Updated `MentionParser.php` to support the `mention="true"` syntax, allowing for more flexible mention parsing. - Added tests in `MentionParserTest.php` to verify the handling of mentions with the `mention="true"` attribute, including support for URL-encoded field IDs. - Refactored `MentionInput.vue`, `MentionDropdown.vue`, and `RichTextAreaInput.client.vue` to ensure consistent use of `mention-state` and improve mention dropdown functionality. - Enhanced `quillMentionExtension.js` to better manage mention data and improve integration with Quill editor. These changes aim to improve the functionality and reliability of the mention feature across the application, ensuring a better user experience. * Refactor FormInformation Component for Improved Logic and Structure - Updated `FormInformation.vue` to utilize the composition API with script setup syntax, enhancing readability and maintainability. - Replaced `v-if` condition for form visibility with a computed property `isFormClosingOrClosed` for better clarity. - Streamlined data handling by converting data and computed properties to reactive state and computed properties, respectively. - Improved the copy settings logic to utilize refs, ensuring proper state management. These changes aim to enhance the overall structure and functionality of the `FormInformation` component, providing a better user experience and code clarity.
40 lines
776 B
Vue
40 lines
776 B
Vue
<template>
|
|
<div
|
|
v-if="isActive"
|
|
class="settings-section"
|
|
>
|
|
<h3 class="text-xl font-medium mb-1">
|
|
{{ name }}
|
|
</h3>
|
|
<slot />
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { inject, computed, onMounted, onBeforeUnmount } from 'vue'
|
|
|
|
const props = defineProps({
|
|
name: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
icon: {
|
|
type: String,
|
|
required: true
|
|
}
|
|
})
|
|
|
|
const activeSection = inject('activeSection', ref(''))
|
|
const registerSection = inject('registerSection', () => {})
|
|
const unregisterSection = inject('unregisterSection', () => {})
|
|
|
|
const isActive = computed(() => activeSection.value === props.name)
|
|
|
|
onMounted(() => {
|
|
registerSection(props.name, props.icon)
|
|
})
|
|
|
|
onBeforeUnmount(() => {
|
|
unregisterSection(props.name)
|
|
})
|
|
</script> |