2023-05-21 17:59:36 +03:00
|
|
|
export default class extends HTMLElement {
|
|
|
|
|
setValue (value) {
|
2023-05-24 01:22:17 +03:00
|
|
|
const { fieldType } = this.dataset
|
|
|
|
|
|
|
|
|
|
if (fieldType === 'signature') {
|
|
|
|
|
[...this.children].forEach(e => e.remove())
|
|
|
|
|
|
|
|
|
|
const img = document.createElement('img')
|
|
|
|
|
|
|
|
|
|
img.classList.add('w-full', 'h-full', 'object-contain')
|
|
|
|
|
img.src = value.url
|
|
|
|
|
|
|
|
|
|
this.append(img)
|
|
|
|
|
} else {
|
|
|
|
|
this.innerHTML = value
|
|
|
|
|
}
|
2023-05-21 17:59:36 +03:00
|
|
|
}
|
|
|
|
|
}
|