2020-01-30 11:59:10 +13:00
|
|
|
<script>
|
2020-02-03 22:50:30 +13:00
|
|
|
import getIcon from "./icon"
|
2020-03-13 03:23:29 +13:00
|
|
|
|
|
|
|
export let icon
|
2020-02-03 22:50:30 +13:00
|
|
|
export let value
|
2020-01-30 11:59:10 +13:00
|
|
|
</script>
|
|
|
|
|
2020-02-03 22:50:30 +13:00
|
|
|
<div class="select-container">
|
2020-03-13 03:23:29 +13:00
|
|
|
{#if icon}
|
|
|
|
<i class={icon} />
|
|
|
|
{/if}
|
|
|
|
<select
|
|
|
|
class:adjusted={icon}
|
|
|
|
on:change bind:value
|
|
|
|
>
|
2020-02-03 22:50:30 +13:00
|
|
|
<slot />
|
|
|
|
</select>
|
|
|
|
<span class="arrow">
|
|
|
|
{@html getIcon('chevron-down', '24')}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
2020-01-30 11:59:10 +13:00
|
|
|
<style>
|
|
|
|
.select-container {
|
|
|
|
font-size: 0.9rem;
|
|
|
|
color: var(--secondary50);
|
|
|
|
font-weight: bold;
|
|
|
|
position: relative;
|
2020-02-25 05:41:02 +13:00
|
|
|
max-width: 300px;
|
2020-03-11 05:06:30 +13:00
|
|
|
min-width: 200px;
|
2020-01-30 11:59:10 +13:00
|
|
|
}
|
|
|
|
|
2020-03-13 03:23:29 +13:00
|
|
|
.adjusted {
|
|
|
|
padding-left: 2.5em;
|
|
|
|
}
|
|
|
|
|
|
|
|
i {
|
|
|
|
position: absolute;
|
|
|
|
left: 8px;
|
|
|
|
top: 8px;
|
|
|
|
}
|
|
|
|
|
2020-01-30 11:59:10 +13:00
|
|
|
select {
|
2020-02-28 04:17:27 +13:00
|
|
|
height: 35px;
|
2020-01-30 11:59:10 +13:00
|
|
|
display: block;
|
|
|
|
font-family: sans-serif;
|
2020-01-31 05:22:19 +13:00
|
|
|
font-weight: 500;
|
|
|
|
color: #163057;
|
2020-02-25 09:49:50 +13:00
|
|
|
padding: 0 2.6em 0em 1.4em;
|
2020-01-30 11:59:10 +13:00
|
|
|
width: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
margin: 0;
|
|
|
|
-moz-appearance: none;
|
|
|
|
-webkit-appearance: none;
|
|
|
|
appearance: none;
|
2020-01-31 05:22:19 +13:00
|
|
|
background: #fff;
|
|
|
|
border: 1px solid #ccc;
|
2020-01-30 11:59:10 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
.arrow {
|
|
|
|
position: absolute;
|
|
|
|
right: 10px;
|
|
|
|
bottom: 0;
|
|
|
|
margin: auto;
|
|
|
|
width: 30px;
|
|
|
|
height: 30px;
|
|
|
|
pointer-events: none;
|
|
|
|
color: var(--primary100);
|
|
|
|
}
|
|
|
|
</style>
|