2019-08-02 15:54:10 +02:00
|
|
|
<script>
|
|
|
|
import { store } from "../builderStore";
|
|
|
|
import getIcon from "../common/icon";
|
|
|
|
|
|
|
|
const getPage = (s, name) => {
|
|
|
|
const props = s.pages[name];
|
|
|
|
return ({name, props});
|
|
|
|
}
|
|
|
|
|
2020-01-20 16:41:40 +01:00
|
|
|
const pages = [{
|
|
|
|
title: 'Main',
|
|
|
|
id: 'main'
|
|
|
|
}, {
|
|
|
|
title: 'Login',
|
|
|
|
id: 'unauthenticated'
|
|
|
|
}]
|
|
|
|
|
|
|
|
store.setCurrentPage('main')
|
|
|
|
|
2019-08-02 15:54:10 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="root">
|
2020-01-20 16:41:40 +01:00
|
|
|
<select id="page" name="select" on:change={({target}) => store.setCurrentPage(target.value)}>
|
|
|
|
|
|
|
|
{#each pages as {title, id}}
|
|
|
|
<option value="{id}">Page: {title}</option>
|
|
|
|
{/each}
|
2019-08-02 15:54:10 +02:00
|
|
|
|
2020-01-20 16:41:40 +01:00
|
|
|
</select>
|
|
|
|
<span class="arrow">{@html getIcon("chevron-down","24")}</span>
|
2019-08-02 15:54:10 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
.root {
|
2019-08-07 10:03:49 +02:00
|
|
|
padding-bottom: 10px;
|
2019-09-23 23:22:57 +02:00
|
|
|
font-size: .9rem;
|
2019-08-02 15:54:10 +02:00
|
|
|
color: var(--secondary50);
|
2019-09-25 21:53:52 +02:00
|
|
|
font-weight: bold;
|
2020-01-20 16:41:40 +01:00
|
|
|
position: relative;
|
2019-08-02 15:54:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-01-20 16:41:40 +01:00
|
|
|
select {
|
|
|
|
display: block;
|
|
|
|
font-size: 16px;
|
|
|
|
font-family: sans-serif;
|
|
|
|
font-weight: 700;
|
|
|
|
color: #444;
|
|
|
|
line-height: 1.3;
|
|
|
|
padding: 1em 2.6em 0.9em 1.4em;
|
|
|
|
width: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
margin: 0;
|
|
|
|
border: none;
|
|
|
|
border-radius: .5em;
|
|
|
|
-moz-appearance: none;
|
|
|
|
-webkit-appearance: none;
|
|
|
|
appearance: none;
|
|
|
|
background-color: #fafafa;
|
2019-08-02 15:54:10 +02:00
|
|
|
}
|
|
|
|
|
2020-01-20 16:41:40 +01:00
|
|
|
.arrow {
|
|
|
|
position: absolute;
|
|
|
|
right: 10px;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
margin: auto;
|
|
|
|
width: 30px;
|
|
|
|
height: 30px;
|
|
|
|
pointer-events: none;
|
2019-08-02 15:54:10 +02:00
|
|
|
color: var(--primary100);
|
|
|
|
}
|
|
|
|
|
2020-01-20 16:41:40 +01:00
|
|
|
</style>
|