|
|
@ -45,11 +45,19 @@ class Dropdown { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
` |
|
|
|
` |
|
|
|
self._view.el = yo` |
|
|
|
self._view.el = yo` |
|
|
|
<div class="${css.dropdown}" onclick=${show}> |
|
|
|
<div name="dropdown" class="${css.dropdown} form-control form-control-sm" onclick=${show}> |
|
|
|
${self._view.selected} |
|
|
|
${self._view.selected} |
|
|
|
<div class="${css.options} bg-light" style="display: none;"> |
|
|
|
<div class="${css.options} bg-light" style="display: none;}"> |
|
|
|
${self.data._options.map(label => { |
|
|
|
${self.data._options.map(label => { |
|
|
|
var input = yo`<input data-idx=${self.data._elements.length} onchange=${emit} type="checkbox" />` |
|
|
|
let index = self.data._elements.length |
|
|
|
|
|
|
|
var input = yo` |
|
|
|
|
|
|
|
<input |
|
|
|
|
|
|
|
data-idx=${index} |
|
|
|
|
|
|
|
onchange=${emit} |
|
|
|
|
|
|
|
type="${index === 2 ? 'checkbox' : 'radio'}" |
|
|
|
|
|
|
|
id="${label}" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
` |
|
|
|
if (self.data.selected.indexOf(label) !== -1) { |
|
|
|
if (self.data.selected.indexOf(label) !== -1) { |
|
|
|
input.checked = true |
|
|
|
input.checked = true |
|
|
|
self.event.trigger('select', [label]) |
|
|
|
self.event.trigger('select', [label]) |
|
|
@ -58,7 +66,7 @@ class Dropdown { |
|
|
|
return yo` |
|
|
|
return yo` |
|
|
|
<div class=${css.option}> |
|
|
|
<div class=${css.option}> |
|
|
|
${input} |
|
|
|
${input} |
|
|
|
<label>${label}</label> |
|
|
|
<label for="${label}">${label}</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
` |
|
|
|
` |
|
|
|
})} |
|
|
|
})} |
|
|
|