-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathExpressionBrowser.svelte
88 lines (72 loc) · 1.92 KB
/
ExpressionBrowser.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import Textfield, {Input} from '@smui/textfield';
import FloatingLabel from '@smui/floating-label';
import LineRipple from '@smui/line-ripple';
import Button, {Label, Icon} from '@smui/button';
import ExpressionIcon from './ExpressionIcon.svelte'
const dispatch = createEventDispatcher();
let urlTemp
let url
let expression
function load() {
url = urlTemp
}
function close() {
dispatch('close')
}
function link() {
dispatch('link-expresson', url)
dispatch('close')
}
</script>
<div>
<span class="right">
<Button class="right" on:click={close}>
<Label>Close</Label>
<Icon class="material-icons">close</Icon>
</Button>
</span>
<Textfield fullwidth lineRipple={false} label="URL">
<Input bind:value={urlTemp} id="input-url"/>
<FloatingLabel for="input-name">Expression URL</FloatingLabel>
<LineRipple />
</Textfield>
<div class="get-button">
<Button variant="raised" on:click={load}>
<Label>Get</Label>
</Button>
</div>
</div>
{#if url && url.length > 0}
<div class="expression-container">
<ExpressionIcon expressionURL={url}></ExpressionIcon>
</div>
<div class="link-button">
<Button variant="raised" on:click={link}>
<Icon class="material-icons">add_to_drive</Icon>
<Label>Link into Perspective</Label>
</Button>
</div>
{/if}
<style>
.right {
float: right;
}
.get-button {
position: relative;
right: 0;
top: 10px;
}
.link-button {
bottom: 20px;
right: 30px;
position: absolute;
}
.expression-container {
margin-top: 20px;
margin-left: auto;
margin-right: auto;
width: 1px
}
</style>