adjust with prefillable

pull/603/head
Pete Matsyburka 3 weeks ago
parent f622ed168f
commit 0afba8d11e

@ -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',

@ -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')
},

Loading…
Cancel
Save