2019-04-03 18:43:24 -07:00
|
|
|
<template>
|
2019-04-03 20:54:14 -07:00
|
|
|
<List class="selectable-list" :items="items" :getKey="getKey">
|
|
|
|
<template slot="item" scope="p">
|
|
|
|
<div class="selectable-list-item-inner" :class="{ 'selectable-list-item-selected-inner': isSelected(p.item) }">
|
|
|
|
<div class="selectable-list-checkbox-wrapper">
|
|
|
|
<Checkbox :checked="isSelected(p.item)" @change="checked => toggle(checked, p.item)" />
|
|
|
|
</div>
|
|
|
|
<slot name="item" :item="p.item" />
|
2019-04-03 20:35:43 -07:00
|
|
|
</div>
|
2019-04-03 20:54:14 -07:00
|
|
|
</template>
|
|
|
|
</List>
|
2019-04-03 18:43:24 -07:00
|
|
|
</template>
|
|
|
|
|
2019-04-03 19:48:00 -07:00
|
|
|
<script src="./selectable_list.js"></script>
|
2019-04-03 18:43:24 -07:00
|
|
|
|
|
|
|
<style lang="scss">
|
2019-04-03 20:35:43 -07:00
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
2019-04-03 19:48:00 -07:00
|
|
|
.selectable-list {
|
2019-04-03 20:54:14 -07:00
|
|
|
&-item-inner {
|
2019-04-03 20:35:43 -07:00
|
|
|
display: flex;
|
2019-04-03 20:54:14 -07:00
|
|
|
}
|
2019-04-03 20:35:43 -07:00
|
|
|
|
2019-04-03 20:54:14 -07:00
|
|
|
&-item-selected-inner {
|
|
|
|
background-color: $fallback--lightBg;
|
|
|
|
background-color: var(--lightBg, $fallback--lightBg);
|
2019-04-03 20:35:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
&-checkbox-wrapper {
|
|
|
|
padding: 10px;
|
|
|
|
flex: none;
|
|
|
|
}
|
2019-04-03 19:48:00 -07:00
|
|
|
}
|
2019-04-03 18:43:24 -07:00
|
|
|
</style>
|