forked from LRNWebComponents/hax-body
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhax-stax-picker.html
142 lines (136 loc) · 3.92 KB
/
hax-stax-picker.html
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-dialog/paper-dialog.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../paper-toast/paper-toast.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../neon-animation/web-animations.html">
<link rel="import" href="../neon-animation/neon-animation.html">
<link rel="import" href="../neon-animation/animations/scale-up-animation.html">
<link rel="import" href="../neon-animation/animations/scale-down-animation.html">
<link rel="import" href="../materializecss-styles/materializecss-styles.html">
<link rel="import" href="hax-stax-browser.html">
<!--
`hax-stax-picker`
A picker for selecting an item from a list of apps / hax stax which require
a decision to be made. This is used when multiple things match either on upload
in the add operation of the app or in the stax selection to render through,
such as having multiple ways of presenting an image.
@demo demo/index.html
@microcopy - the mental model for this element
- data - this is the app data model for an element which expresses itself to hax
-->
<dom-module id="hax-stax-picker">
<template>
<style include="materializecss-styles">
:host {
display: block;
--hax-stax-picker-tab-color: #e5e5e5;
--hax-stax-picker-ink-color: #2e2e2e;
--hax-accent: #34e79a;
}
#dialog {
z-index: 10000;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: 68px;
overflow: auto;
border-bottom-left-radius: 16px;
border-bottom-right-radius: 16px;
@apply --hax-stax-picker-dialog;
}
#dialogcontent {
margin-top: 0;
padding: 0;
overflow: scroll;
}
#dialogheader {
margin: 0;
padding: 20px;
position: sticky;
top: 0;
left: 0;
right: 0;
z-index: 2;
border-bottom: 1px solid #222222;
-webkit-box-shadow: 0 0 10px -1px #222222;
box-shadow: 0 0 10px -1px #222222;
}
#dialogheader h2 {
margin: 0;
font-size: 28px;
text-align: left;
}
@media screen and (max-width: 550px) {
#dialog {
margin: 0;
overflow: auto;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
}
</style>
<paper-dialog id="dialog" entry-animation="slide-from-top-animation" exit-animation="slide-up-animation" with-backdrop opened="{{opened}}">
<div id="dialogheader" class="grey darken-3 grey-text text-lighten-3">
<h2 class="grey-text text-lighten-3">[[header]]</h2>
</div>
<div class="dialog-contents" id="dialogcontent">
<hax-stax-browser id="staxbrowser"></hax-stax-browser>
</div>
</paper-dialog>
</template>
<script>
Polymer({
is: 'hax-stax-picker',
properties: {
/**
* Header so it's variable
*/
header: {
type: String,
value: 'Stax Browser',
},
/**
* Opened status to map to dialog
*/
opened: {
type: Boolean,
value: false,
},
},
/**
* Ready life cycle.
*/
ready: function() {
document.body.appendChild(this);
},
/**
* Attached life cycle
*/
attached: function() {
this.fire('hax-register-stax-picker', this);
},
/**
* Open the dialog
*/
open: function() {
this.opened = true;
this.$.staxbrowser.resetBrowser();
},
/**
* Close the dialog
*/
close: function() {
this.opened = false;
},
/**
* Toggle state.
*/
toggleDialog: function() {
this.opened = !this.opened;
},
});
</script>
</dom-module>