diff --git a/app/javascript/template_builder/area.vue b/app/javascript/template_builder/area.vue
index 2aef3c392..e6b76c455 100644
--- a/app/javascript/template_builder/area.vue
+++ b/app/javascript/template_builder/area.vue
@@ -70,7 +70,7 @@
@blur="onNameBlur"
>{{ optionIndexText }} {{ (defaultField ? (field.title || field.name) : field.name) || defaultName }}
+
+
+
+
+
+
+
+
+
@@ -152,7 +225,11 @@
import FieldSubmitter from './field_submitter'
import FieldType from './field_type'
import Field from './field'
-import { IconX, IconCheck } from '@tabler/icons-vue'
+import FieldSettings from './field_settings'
+import FormulaModal from './formula_modal'
+import ConditionsModal from './conditions_modal'
+import DescriptionModal from './description_modal'
+import { IconX, IconCheck, IconDotsVertical } from '@tabler/icons-vue'
import { v4 } from 'uuid'
export default {
@@ -160,6 +237,11 @@ export default {
components: {
FieldType,
IconCheck,
+ FieldSettings,
+ FormulaModal,
+ IconDotsVertical,
+ DescriptionModal,
+ ConditionsModal,
FieldSubmitter,
IconX
},
@@ -195,11 +277,16 @@ export default {
default: null
}
},
- emits: ['start-resize', 'stop-resize', 'start-drag', 'stop-drag', 'remove'],
+ emits: ['start-resize', 'stop-resize', 'start-drag', 'stop-drag', 'remove', 'scroll-to'],
data () {
return {
+ isShowFormulaModal: false,
+ isShowConditionsModal: false,
+ isSettingsFocus: false,
+ isShowDescriptionModal: false,
isResize: false,
isDragged: false,
+ renderDropdown: false,
isNameFocus: false,
textOverflowChars: 0,
dragFrom: { x: 0, y: 0 }
@@ -208,6 +295,9 @@ export default {
computed: {
fieldNames: FieldType.computed.fieldNames,
fieldIcons: FieldType.computed.fieldIcons,
+ modalContainerEl () {
+ return this.$el.getRootNode().querySelector('#docuseal_modal_container')
+ },
defaultName () {
return this.buildDefaultName(this.field, this.template.fields)
},
@@ -324,6 +414,14 @@ export default {
},
methods: {
buildDefaultName: Field.methods.buildDefaultName,
+ closeDropdown () {
+ document.activeElement.blur()
+ },
+ maybeBlurSettings (e) {
+ if (!e.relatedTarget || !this.$refs.settingsDropdown.contains(e.relatedTarget)) {
+ this.isSettingsFocus = false
+ }
+ },
onNameFocus (e) {
this.selectedAreaRef.value = this.area
@@ -379,6 +477,10 @@ export default {
})
},
onNameBlur (e) {
+ if (e.relatedTarget === this.$refs.settingsButton) {
+ this.isSettingsFocus = true
+ }
+
const text = this.$refs.name.innerText.trim()
this.isNameFocus = false
diff --git a/app/javascript/template_builder/document.vue b/app/javascript/template_builder/document.vue
index b4aa39507..4345ea007 100644
--- a/app/javascript/template_builder/document.vue
+++ b/app/javascript/template_builder/document.vue
@@ -17,6 +17,7 @@
:image="image"
@drop-field="$emit('drop-field', {...$event, attachment_uuid: document.uuid })"
@remove-area="$emit('remove-area', $event)"
+ @scroll-to="scrollToArea"
@draw="$emit('draw', {...$event, attachment_uuid: document.uuid })"
/>
@@ -125,7 +126,9 @@ export default {
},
methods: {
scrollToArea (area) {
- this.pageRefs[area.page].areaRefs.find((e) => e.area === area).$el.scrollIntoView({ behavior: 'smooth', block: 'center' })
+ this.$nextTick(() => {
+ this.pageRefs[area.page].areaRefs.find((e) => e.area === area).$el.scrollIntoView({ behavior: 'smooth', block: 'center' })
+ })
},
setPageRefs (el) {
if (el) {
diff --git a/app/javascript/template_builder/field.vue b/app/javascript/template_builder/field.vue
index 5355a0411..7e4714c5a 100644
--- a/app/javascript/template_builder/field.vue
+++ b/app/javascript/template_builder/field.vue
@@ -118,280 +118,17 @@
@dragstart.prevent.stop
@click="closeDropdown"
>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ t('page') }}
- {{ template.schema.findIndex((item) => item.attachment_uuid === area.attachment_uuid) + 1 }}-{{ area.page + 1 }}
-
-
-
-
-
- {{ t('draw_new_area') }}
-
-
-
-
-
- {{ t('copy_to_all_pages') }}
-
-
+