Form editor v2 (#579)

* Form editor v2

* fix template test

* setFormDefaults when save

* fix form cleaning dark mode

* improvements on open sidebar

* UI polish

* Fix change type button

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Chirag Chhatrala
2024-09-23 23:32:38 +05:30
committed by GitHub
parent 47ae11bc58
commit d6181cd249
61 changed files with 2576 additions and 2661 deletions

View File

@@ -0,0 +1,40 @@
<template>
<div
v-show="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>