-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtef_input.html
71 lines (70 loc) · 2.72 KB
/
tef_input.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
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../core-style/core-style.html">
<link rel="import" href="tef_input_styles.html">
<polymer-element name="tef-input" attributes="placeholder multiline image value label small large block validation">
<template>
<core-style ref="tef-input"></core-style>
<template if="{{label}}">
<label>{{label}}</label>
</template>
<template if="{{!multiline && !image && !validation}}">
<input id="input" class="tef-input {{tefrow ? 'tef-row' : ''}} {{small ? 'small' : ''}} {{large ? 'large' : ''}} {{block ? 'block' : ''}}" placeholder={{placeholder}} value={{value}}>
</template>
<template if="{{multiline}}">
<textarea id="input" class="tef-input {{tefrow ? 'tef-row' : ''}} {{small ? 'small' : ''}} {{large ? 'large' : ''}} {{block ? 'block' : ''}}" placeholder={{placeholder}} value={{value}}>
</textarea>
</template>
<template if="{{image}}">
<div class="{{tefrow ? 'tef-row' : ''}}">
<input class="tef-input icon {{small ? 'small' : ''}} {{large ? 'large' : ''}} {{block ? 'block' : ''}}" placeholder={{placeholder}} value={{value}}>
<i icon="search"></i>
</div>
</template>
<template if="{{validation}}">
<div class="{{tefrow ? 'tef-row' : ''}} tef-{{validation}}">
<input class="tef-input {{small ? 'small' : ''}} {{large ? 'large' : ''}} {{block ? 'block' : ''}}" placeholder={{placeholder}} value={{value}} >
<div class="tef-message">
<content></content>
</div>
</div>
</template>
</template>
<script>
Polymer({
publish: {
label: {
value: "",
reflect: true
},
multiline: {
value: false,
reflect: true
},
image: {
value:"",
reflect: true
},
tefrow: {
value: false,
reflect: true
},
small: {
value: false,
reflect: true
},
large: {
value: false,
reflect: true
},
block: {
value: false,
reflect: true
},
validation: {
value: "",
reflect: true
}
}
});
</script>
</polymer-element>