adjust with prefillable

This commit is contained in:
Pete Matsyburka
2026-02-26 11:03:08 +02:00
parent f622ed168f
commit 0afba8d11e
2 changed files with 9 additions and 8 deletions
+4 -1
View File
@@ -155,12 +155,15 @@ safeRegisterElement('template-builder', class extends HTMLElement {
this.appElem.classList.add('md:h-screen')
const template = reactive(JSON.parse(this.dataset.template))
this.app = createApp(TemplateBuilder, {
template: reactive(JSON.parse(this.dataset.template)),
template,
customFields: reactive(JSON.parse(this.dataset.customFields || '[]')),
backgroundColor: '#faf7f5',
locale: this.dataset.locale,
withPhone: this.dataset.withPhone === 'true',
withPrefillable: template.fields?.some((f) => f.prefillable),
withVerification: ['true', 'false'].includes(this.dataset.withVerification) ? this.dataset.withVerification === 'true' : null,
withKba: ['true', 'false'].includes(this.dataset.withKba) ? this.dataset.withKba === 'true' : null,
withLogo: this.dataset.withLogo !== 'false',
+5 -7
View File
@@ -720,6 +720,11 @@ export default {
required: false,
default: false
},
withPrefillable: {
type: Boolean,
required: false,
default: false
},
customFields: {
type: Array,
required: false,
@@ -948,13 +953,6 @@ export default {
!submitter.email
})
},
withPrefillable () {
if (this.template.fields) {
return this.template.fields.some((f) => f.prefillable)
} else {
return false
}
},
isInlineSize () {
return CSS.supports('container-type: size')
},