2023-12-09 15:47:03 +01:00
|
|
|
<template>
|
2024-02-22 16:56:35 +01:00
|
|
|
<div class="w-full md:w-4/5 lg:w-3/5 md:mx-auto md:max-w-4xl p-4">
|
|
|
|
|
<div class="mb-20">
|
|
|
|
|
<div class="mb-6 pb-6 border-b w-full flex flex-col sm:flex-row gap-2">
|
2024-04-15 19:39:03 +02:00
|
|
|
<regenerate-form-link
|
|
|
|
|
class="sm:w-1/2 flex"
|
|
|
|
|
:form="props.form"
|
|
|
|
|
/>
|
2023-12-24 09:51:22 +01:00
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<url-form-prefill
|
|
|
|
|
class="sm:w-1/2"
|
|
|
|
|
:form="props.form"
|
|
|
|
|
:extra-query-param="shareUrlForQueryParams"
|
|
|
|
|
/>
|
2023-12-24 09:51:22 +01:00
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<embed-form-as-popup-modal
|
|
|
|
|
class="sm:w-1/2 flex"
|
|
|
|
|
:form="props.form"
|
|
|
|
|
/>
|
2024-02-22 16:56:35 +01:00
|
|
|
</div>
|
2023-12-24 09:51:22 +01:00
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<share-link
|
|
|
|
|
class="mt-4"
|
|
|
|
|
:form="props.form"
|
|
|
|
|
:extra-query-param="shareUrlForQueryParams"
|
|
|
|
|
/>
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<embed-code
|
|
|
|
|
class="mt-6"
|
|
|
|
|
:form="props.form"
|
|
|
|
|
:extra-query-param="shareUrlForQueryParams"
|
|
|
|
|
/>
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<form-qr-code
|
|
|
|
|
class="mt-6"
|
|
|
|
|
:form="props.form"
|
|
|
|
|
:extra-query-param="shareUrlForQueryParams"
|
|
|
|
|
/>
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<advanced-form-url-settings
|
|
|
|
|
v-model="shareFormConfig"
|
|
|
|
|
:form="props.form"
|
|
|
|
|
/>
|
2024-02-22 16:56:35 +01:00
|
|
|
</div>
|
2023-12-09 15:47:03 +01:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-01-11 17:16:50 +01:00
|
|
|
<script setup>
|
2024-04-15 19:39:03 +02:00
|
|
|
import ShareLink from "~/components/pages/forms/show/ShareLink.vue"
|
|
|
|
|
import EmbedCode from "~/components/pages/forms/show/EmbedCode.vue"
|
|
|
|
|
import FormQrCode from "~/components/pages/forms/show/FormQrCode.vue"
|
|
|
|
|
import UrlFormPrefill from "~/components/pages/forms/show/UrlFormPrefill.vue"
|
|
|
|
|
import RegenerateFormLink from "~/components/pages/forms/show/RegenerateFormLink.vue"
|
|
|
|
|
import AdvancedFormUrlSettings from "~/components/open/forms/components/AdvancedFormUrlSettings.vue"
|
|
|
|
|
import EmbedFormAsPopupModal from "~/components/pages/forms/show/EmbedFormAsPopupModal.vue"
|
2024-02-06 09:59:43 +01:00
|
|
|
|
|
|
|
|
const props = defineProps({
|
2024-04-15 19:39:03 +02:00
|
|
|
form: { type: Object, required: true },
|
2024-02-06 09:59:43 +01:00
|
|
|
})
|
2023-12-20 18:38:43 +01:00
|
|
|
|
2024-01-11 17:16:50 +01:00
|
|
|
definePageMeta({
|
2024-04-15 19:39:03 +02:00
|
|
|
middleware: "auth",
|
2024-01-11 17:16:50 +01:00
|
|
|
})
|
|
|
|
|
useOpnSeoMeta({
|
2024-04-15 19:39:03 +02:00
|
|
|
title: props.form ? "Share Form - " + props.form.title : "Share Form",
|
2024-01-11 17:16:50 +01:00
|
|
|
})
|
2023-12-20 18:38:43 +01:00
|
|
|
|
2024-01-11 17:16:50 +01:00
|
|
|
const shareFormConfig = ref({
|
|
|
|
|
hide_title: false,
|
2024-04-15 19:39:03 +02:00
|
|
|
auto_submit: false,
|
2024-01-11 17:16:50 +01:00
|
|
|
})
|
2023-12-09 15:47:03 +01:00
|
|
|
|
2024-01-11 17:16:50 +01:00
|
|
|
const shareUrlForQueryParams = computed(() => {
|
2024-04-15 19:39:03 +02:00
|
|
|
let queryStr = ""
|
2024-01-11 17:16:50 +01:00
|
|
|
for (const [key, value] of Object.entries(shareFormConfig.value)) {
|
2024-04-15 19:39:03 +02:00
|
|
|
if (value && value !== "false" && value !== false) {
|
|
|
|
|
queryStr +=
|
|
|
|
|
"&" + encodeURIComponent(key) + "=" + encodeURIComponent(value)
|
2023-12-09 15:47:03 +01:00
|
|
|
}
|
2024-01-11 17:16:50 +01:00
|
|
|
}
|
|
|
|
|
return queryStr.slice(1)
|
|
|
|
|
})
|
2023-12-09 15:47:03 +01:00
|
|
|
</script>
|