UNPKG

waibu-maps

Version:
28 lines (23 loc) 892 B
import control from './control.js' async function controlLoader () { const WmapsControl = await control.call(this) return class WmapsControlLoader extends WmapsControl { constructor (options) { super(options) this.params.noTag = true } build = async () => { const { groupAttrs, attribsStringify } = this.plugin.app.waibuMpa const group = groupAttrs(this.params.attr, ['progress']) const attr = group.progress ?? {} attr.value = '100' attr.strip = 'animated' if (!attr.height) attr.height = 3 if (!attr.background) attr.background = 'color:danger' this.params.html = await this.component.buildSentence(`<c:div class="childmap maplibregl-ctrl-loader"> <c:progress ${attribsStringify(attr)} x-show="$store.wmpa.loading"/> </c:div>`) } } } export default controlLoader