This repository has been archived by the owner on May 5, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Constructor.vue
123 lines (101 loc) · 2.37 KB
/
Constructor.vue
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
<template>
<form class="example">
<MaterialInput v-bind="childProperies">
{{ text }}
</MaterialInput>
<p>Modify it!</p>
<div class="example-field">
<label>Text</label>
<input type="text" v-model="text" />
</div>
<div class="example-field">
<label>Placeholder</label>
<input type="text" v-model="childProperies.placeholder" />
</div>
<div class="example-field">
<label>Value</label>
<input type="text" v-model="childProperies.value" />
</div>
<div class="example-field">
<label>Error value</label>
<input type="text" v-model="childProperies.errorMessages" />
</div>
<div class="example-field">
<label>Disabled</label>
<input type="checkbox" v-model="childProperies.disabled" />
</div>
<div class="example-field">
<label>Read-only</label>
<input type="checkbox" v-model="childProperies.readonly" />
</div>
</form>
</template>
<script>
import MaterialInput from '../../src/components/MaterialInput.vue'
export default {
name: 'material-model',
data () {
return {
text: 'Default',
childProperies: {
type: 'text',
placeholder: null,
value: null,
disabled: false,
readonly: false,
errorMessages: 'Error value'
}
}
},
components: {
MaterialInput
}
}
</script>
<style lang="sass">
// Theme:
$color-white: white;
$color-grey: #9E9E9E;
$color-grey-light: #E0F7FA;
$color-cyan: #00BCD4;
$color-cyan-dark: #006064;
$color-black: black;
.material-input--cyan {
background: $color-white;
.material-input {
background: none;
color: $color-black;
border-bottom: 1px solid $color-grey-light;
}
.material-label {
color: $color-grey;
}
.material-input-bar {
&:before,
&:after {
background: $color-cyan;
}
}
// Active state:
&.material--active {
.material-label {
color: $color-cyan;
}
}
// Errors:
&.material--has-errors {
&.material--active .material-label {
color: $color-cyan-dark;
}
.material-input-bar {
&:before,
&:after {
background: $color-cyan-dark;
}
}
.material-errors {
color: $color-cyan-dark;
}
}
}
</style>