forked from thomasbertet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTextFieldsView.vue
executable file
·162 lines (159 loc) · 6.53 KB
/
TextFieldsView.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<template lang="pug">
component-view(v-bind:doc="doc")
</template>
<script>
export default {
data () {
return {
doc: {
title: 'Text fields',
desc: 'Text fields components are used for collecting user provided information.',
component: 'text-fields',
edit: 'TextFieldsView',
examples: [
{ header: 'With label', file: 'text-fields/1', desc: 'Text-fields come in two theme options, dark and light.' },
{ header: 'Dark theme with label', file: 'text-fields/2', desc: 'The dark theme compliments darker backgrounds.' },
{ header: 'Single line light theme', file: 'text-fields/3', desc: 'Single line text-fields do not float their label on focus or with data.' },
{ header: 'Single line dark theme', file: 'text-fields/4', desc: 'A single line label mimics the display of a placeholder.' },
{ header: 'With Icon', file: 'text-fields/5', desc: 'Icons can be specified as prepended or appended.' },
{ header: 'Dark theme with icon', file: 'text-fields/6', desc: 'The icon inherits the applications primary color on text-field focus.' },
{ header: 'Multi-Line', file: 'text-fields/7', desc: 'A multi-line text-field is useful for larger amounts of text.' },
{ header: 'Dark theme multi-line', file: 'text-fields/8', desc: 'Multi-line text-fields can be set to autogrow allowing the field to scale with the input.' },
{ header: 'Character counter', file: 'text-fields/9', desc: 'Use a counter to inform a user of the maximum or minium character limit.' },
{ header: 'Password input', file: 'text-fields/10', desc: 'A password input can be used with an appended icon and callback to control the visibility.' },
{ header: 'Validation', file: 'text-fields/11', desc: `Vuetify includes simple validation through the <code>rules</code> prop. The prop accepts an array of callbacks. While validating rules, the current v-model value will be passed to the callback. This callback should return either <code>true</code> or a <code>String</code>, the error message.` },
{ header: 'Full-width text field with character counter', file: 'text-fields/12', desc: 'Light theme' },
{ header: 'Required fields', file: 'text-fields/13', desc: 'Light theme' },
{ header: 'Hint text', file: 'text-fields/14', desc: 'Light theme' },
{ header: 'Prefixes & suffixes', file: 'text-fields/15', desc: 'Light theme' },
{ header: 'Custom validation', file: 'text-fields/16', desc: 'If you want to skip the built in validation and use your own or a plugin such as <a href="https://github.com/monterail/vuelidate" target="_blank" rel="noopener">vuelidate</a> or <a href="https://github.com/logaretm/vee-validate" target="_blank" rel="noopener">vee-validation</a>, you can use the <strong>error-messages</strong> or <strong>error</strong> props. Errors accepts a string or array and error simply places the field in an error state.' },
{ header: 'Textarea', file: 'text-fields/17', desc: 'Textarea text-fields have an alternate style.'}
],
props: {
'v-text-field': {
shared: ['input'],
params: [
[
'autofocus',
'Boolean',
'False',
'Enable autofocus'
],
[
'auto-grow',
'Boolean',
'False',
'Auto-grows the input. This option <strong>requires</strong> the use of <code>v-model</code>'
],
[
'counter',
'Boolean',
'False',
'Creates counter for input length'
],
[
'full-width',
'Boolean',
'False',
'Desginates input type as full-width'
],
[
'prefix',
'String',
'',
'Displays prefix text'
],
[
'min',
'Number',
'0',
'Sets minimum value for attribute'
],
[
'max',
'Number',
'25',
'Sets maximum value for attribute'
],
[
'maxlength',
'Number',
'25',
'Sets maximum value for a text-field'
],
[
'multi-line',
'Boolean',
'False',
'Turns into textarea'
],
[
'readonly',
'Boolean',
'False',
'Disables input'
],
[
'rows',
'Number',
'5',
'Number of rows in textarea'
],
[
'single-line',
'Boolean',
'False',
'Label does not move on focus/dirty'
],
[
'textarea',
'Boolean',
'False',
'Textarea text-field with alternate style'
],
[
'suffix',
'String',
'',
'Displays suffix text'
],
[
'type',
'String',
'text',
'Sets input type'
]
],
model: {
type: ['*'],
default: '-',
description: 'Current input value'
}
}
},
slots: {
'v-text-field': {
shared: ['label']
}
},
events: {
'v-text-field': {
params: [
['input', 'String', 'Current input value. Fires while typing.'],
['focus', '-', 'Input gained focus.'],
['blur', '-', 'Input lost focus.'],
['change', 'String', 'Input value was changed. Fired on blur.'],
]
},
}
}
}
}
}
</script>
<style lang="stylus">
#text-fields-view
main
.container
min-height: 0
</style>