Compare commits

..

No commits in common. "163d3cc18a9a746196a972f1ff993d82795d8dbb" and "57ab82b2a6860acce337c06de66d989cbea415c4" have entirely different histories.

4 changed files with 3 additions and 44 deletions

View File

@ -34,7 +34,7 @@ steps:
- name: node_submodules - name: node_submodules
image: node:20.15.0-slim image: node:20.15.0-slim
commands: commands:
- cd packages/adrema-form && npm ci && npm run build-import && rm -R node_modules && cd ../../ - cd packages/adrema-form && npm ci && npm run build && rm -R node_modules && cd ../../
- name: node - name: node
image: node:20.15.0-slim image: node:20.15.0-slim

View File

@ -1,9 +1,5 @@
# Letzte Änderungen # Letzte Änderungen
### 1.12.26
- Felder im Form-Builder können nun verschoben und kopiert werden
### 1.12.25 ### 1.12.25
- Ein Bug wurde behoben, sodass nun wieder Bedingungen für Formular-Mails vergeben werden können - Ein Bug wurde behoben, sodass nun wieder Bedingungen für Formular-Mails vergeben werden können

@ -1 +1 @@
Subproject commit 010825124f7791dfc0dc607e23ec99f49be8aef5 Subproject commit a4a2a2b3fd7a099cf1e5a9360d5d5450030bf673

View File

@ -11,17 +11,6 @@
<f-text id="sectionform-name" v-model="singleSection.model.name" label="Name"></f-text> <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> <f-textarea id="sectionform-intro" v-model="singleSection.model.intro" label="Einleitung"></f-textarea>
</asideform> </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"> <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'}"> <draggable v-model="singleSection.model.fields" item-key="key" :component-data="{class: 'mt-3 grid gap-3'}">
<template #item="{element}"> <template #item="{element}">
@ -70,8 +59,6 @@
@editFields="startReordering($event.detail[0])" @editFields="startReordering($event.detail[0])"
@deleteSection="deleteSection($event.detail[0])" @deleteSection="deleteSection($event.detail[0])"
@active="updateActive($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> ></event-form>
</ui-box> </ui-box>
</form> </form>
@ -80,7 +67,7 @@
<script lang="js" setup> <script lang="js" setup>
import { watch, computed, ref } from 'vue'; import { watch, computed, ref } from 'vue';
import { snakeCase } from 'change-case'; import { snakeCase } from 'change-case';
import '!/adrema-form/dist/assets/main.js'; import '!/adrema-form/dist/main.js';
import Asideform from './Asideform.vue'; import Asideform from './Asideform.vue';
import TextareaField from './TextareaField.vue'; import TextareaField from './TextareaField.vue';
import TextField from './TextField.vue'; import TextField from './TextField.vue';
@ -96,7 +83,6 @@ import Draggable from 'vuedraggable';
const singleSection = ref(null); const singleSection = ref(null);
const singleField = ref(null); const singleField = ref(null);
const moving = ref(null);
const active = ref(null); const active = ref(null);
async function onReorder() { async function onReorder() {
@ -138,29 +124,6 @@ function editSection(sectionIndex) {
mode: 'edit', 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) { function startReordering(index) {
singleSection.value = { singleSection.value = {