add bulk placeholder

This commit is contained in:
Pete Matsyburka
2024-03-30 19:37:48 +02:00
parent 9bdc5d4863
commit d4940234b7
12 changed files with 433 additions and 12 deletions
+21
View File
@@ -3,6 +3,7 @@ import { encodeMethodIntoRequestBody } from '@hotwired/turbo-rails/app/javascrip
import { createApp, reactive } from 'vue'
import TemplateBuilder from './template_builder/builder'
import ImportList from './template_builder/import_list'
import ToggleVisible from './elements/toggle_visible'
import DisableHidden from './elements/disable_hidden'
@@ -111,3 +112,23 @@ window.customElements.define('template-builder', class extends HTMLElement {
this.appElem?.remove()
}
})
window.customElements.define('import-list', class extends HTMLElement {
connectedCallback () {
this.appElem = document.createElement('div')
this.app = createApp(ImportList, {
template: JSON.parse(this.dataset.template),
authenticityToken: document.querySelector('meta[name="csrf-token"]')?.content
})
this.app.mount(this.appElem)
this.appendChild(this.appElem)
}
disconnectedCallback () {
this.app?.unmount()
this.appElem?.remove()
}
})