Compare commits
3 Commits
57ab82b2a6
...
163d3cc18a
| Author | SHA1 | Date |
|---|---|---|
|
|
163d3cc18a | |
|
|
2c7e1a882f | |
|
|
9a5518857e |
|
|
@ -34,7 +34,7 @@ steps:
|
|||
- name: node_submodules
|
||||
image: node:20.15.0-slim
|
||||
commands:
|
||||
- cd packages/adrema-form && npm ci && npm run build && rm -R node_modules && cd ../../
|
||||
- cd packages/adrema-form && npm ci && npm run build-import && rm -R node_modules && cd ../../
|
||||
|
||||
- name: node
|
||||
image: node:20.15.0-slim
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
# Letzte Änderungen
|
||||
|
||||
### 1.12.26
|
||||
|
||||
- Felder im Form-Builder können nun verschoben und kopiert werden
|
||||
|
||||
### 1.12.25
|
||||
|
||||
- Ein Bug wurde behoben, sodass nun wieder Bedingungen für Formular-Mails vergeben werden können
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit a4a2a2b3fd7a099cf1e5a9360d5d5450030bf673
|
||||
Subproject commit 010825124f7791dfc0dc607e23ec99f49be8aef5
|
||||
|
|
@ -11,6 +11,17 @@
|
|||
<f-text id="sectionform-name" v-model="singleSection.model.name" label="Name"></f-text>
|
||||
<f-textarea id="sectionform-intro" v-model="singleSection.model.intro" label="Einleitung"></f-textarea>
|
||||
</asideform>
|
||||
<asideform
|
||||
v-if="moving !== null"
|
||||
heading="Feld verschieben nach Sektion …"
|
||||
@close="moving = null"
|
||||
>
|
||||
<div class="mt-3 grid gap-3">
|
||||
<a v-for="(section, index) in modelValue.sections" :key="index" class="py-2 px-3 border rounded bg-zinc-800 hover:bg-zinc-700 transition" href="#" @click.prevent="moveFieldToSection(index)">
|
||||
<span v-text="section.name"></span>
|
||||
</a>
|
||||
</div>
|
||||
</asideform>
|
||||
<asideform v-if="singleSection !== null && singleSection.mode === 'reorder'" heading="Felder ordnen" @close="singleSection = null" @submit="storeSection">
|
||||
<draggable v-model="singleSection.model.fields" item-key="key" :component-data="{class: 'mt-3 grid gap-3'}">
|
||||
<template #item="{element}">
|
||||
|
|
@ -59,6 +70,8 @@
|
|||
@editFields="startReordering($event.detail[0])"
|
||||
@deleteSection="deleteSection($event.detail[0])"
|
||||
@active="updateActive($event.detail[0])"
|
||||
@copy-field="copyField($event.detail[0], $event.detail[1])"
|
||||
@move-field="moving = {section: $event.detail[0], field: $event.detail[1]}"
|
||||
></event-form>
|
||||
</ui-box>
|
||||
</form>
|
||||
|
|
@ -67,7 +80,7 @@
|
|||
<script lang="js" setup>
|
||||
import { watch, computed, ref } from 'vue';
|
||||
import { snakeCase } from 'change-case';
|
||||
import '!/adrema-form/dist/main.js';
|
||||
import '!/adrema-form/dist/assets/main.js';
|
||||
import Asideform from './Asideform.vue';
|
||||
import TextareaField from './TextareaField.vue';
|
||||
import TextField from './TextField.vue';
|
||||
|
|
@ -83,6 +96,7 @@ import Draggable from 'vuedraggable';
|
|||
|
||||
const singleSection = ref(null);
|
||||
const singleField = ref(null);
|
||||
const moving = ref(null);
|
||||
const active = ref(null);
|
||||
|
||||
async function onReorder() {
|
||||
|
|
@ -124,6 +138,29 @@ function editSection(sectionIndex) {
|
|||
mode: 'edit',
|
||||
};
|
||||
}
|
||||
function moveFieldToSection(newSectionIndex) {
|
||||
if (!moving.value) {
|
||||
return;
|
||||
}
|
||||
singleField.value = {
|
||||
model: JSON.parse(JSON.stringify(inner.value.sections[moving.value.section].fields[moving.value.field])),
|
||||
sectionIndex: newSectionIndex,
|
||||
index: null,
|
||||
};
|
||||
storeField();
|
||||
deleteField(moving.value.section, moving.value.field);
|
||||
moving.value = null;
|
||||
}
|
||||
|
||||
function copyField(sectionIndex, fieldIndex) {
|
||||
var field = JSON.parse(JSON.stringify(inner.value.sections[sectionIndex].fields[fieldIndex]));
|
||||
field.name = field.name + ' - Kopie';
|
||||
singleField.value = {
|
||||
model: field,
|
||||
sectionIndex: sectionIndex,
|
||||
index: null,
|
||||
};
|
||||
}
|
||||
|
||||
function startReordering(index) {
|
||||
singleSection.value = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue