oda-framework
Version:
26 lines (25 loc) • 1.03 kB
HTML
<meta charset="utf-8">
<!-- <oda-tester> -->
<oda-combo-box fadein id="box" placeholder="search..."></oda-combo-box>
<!-- </oda-tester> -->
<script type="module">
import '../../../oda.js';
import '../../../tools/styles/styles.js';
import './combo-box.js';
const el = ODA.createElement('oda-combo-list', {
items: [
{ label: 'label 1' }, { label: 'label 2' }, { label: 'label 3' }, { label: 'label 4' }, { label: 'label 5' },
{ label: 'label 2' }, { label: 'label 3' }, { label: 'label 4' }, { label: 'label 5' },
{ label: 'label 3' }, { label: 'label 4' }, { label: 'label 5' },
{ label: 'label 4' }, { label: 'label 5' },
{ label: 'label 5' }
]
});
setTimeout(() => {
box.dropDownControl = el;
box.value = el.items[Math.floor(getRandomArbitrary(0, el.items.length))];
}, 10)
function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;
}
</script>