-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcork-search-box.html.js
86 lines (75 loc) · 1.54 KB
/
cork-search-box.html.js
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
import {html} from "@polymer/polymer"
export default html`
<style>
:host {
display: block;
border-radius: 6px;
}
#root {
display: flex;
align-items: center;
}
input {
flex: 1;
height: 43px;
font-size: 18px;
border: none;
border-radius: 6px 0 0 6px;
background: white;
outline: none;
padding: 0 0 0 13px;
margin:0;
}
input::-webkit-input-placeholder { /* Chrome/Opera/Safari */
font-style: italic;
}
input::-moz-placeholder { /* Firefox 19+ */
font-style: italic;
}
input:-ms-input-placeholder { /* IE 10+ */
font-style: italic;
}
input:-moz-placeholder { /* Firefox 18- */
font-style: italic;
}
input::placeholder {
font-style: italic;
}
#clear {
background: white;
width: 35px;
height: 43px;
text-align: center;
cursor: pointer;
}
iron-icon[icon="clear"] {
margin-top: 9px;
}
paper-button {
padding: 9.5px 0px;
min-width: 43px;
background-color: var(--cork-search-box-btn-color, #ccc);
border-radius: 0 6px 6px 0;
margin: 0px;
@apply --cork-search-box-btn;
}
[hidden] {
display: none;
}
</style>
<div id="root">
<input
id="input"
type="text"
on-keyup="_onKeyUp"
on-change="_onChange"
autocomplete="off"
placeholder$="[[placeholder]]"/>
<span id="clear">
<iron-icon icon="clear" hidden="[[!showClear]]" on-click="clear"></iron-icon>
</span>
<paper-button>
<iron-icon icon="search" on-click="_fireSearch"></iron-icon>
</paper-button>
</div>
`;