Skip to content

Commit dea4a16

Browse files
committed
added textarea
1 parent 11d856f commit dea4a16

File tree

4 files changed

+40
-7
lines changed

4 files changed

+40
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ Coming soon...
2626

2727
##To Do
2828
* [x] Input
29-
* [ ] Select
30-
* [ ] Text Area
29+
* [x] Select
30+
* [x] Text Area
3131
* [ ] Checkbox
3232
* [ ] Radio Buttons
3333
* [ ] Date Picker
3434
* [ ] Other funky form inputs
3535
* [x] Dirty/Clean checking
3636
* [ ] Hide/Show options
3737
* [x] Custom attributes
38-
* [ ] Custom Classes
38+
* [x] Custom Classes
3939
* [x] Custom events

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-formly-bootstrap",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "A bootstrap based form input bundle for Vue Formly",
55
"main": "dist/vue-formly-bootstrap.js",
66
"scripts": {

src/fields/fieldTextarea.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<div class="form-group">
3+
<label v-if="form[key].label" :for="form[key].id ? form[key].id : null">{{form[key].label}}</label>
4+
<textarea class="form-control" :class="form[key].classes" :id="form[key].id ? form[key].id : null" v-model="form[key].value" @blur="onBlur" @focus="onFocus" @click="onClick" @change="onChange" @keyup="onKeyup" @keydown="onKeydown" v-formly-atts="form[key].atts"></textarea>
5+
</div>
6+
</template>
7+
8+
<script>
9+
import baseField from './baseField';
10+
export default {
11+
mixins: [baseField]
12+
}
13+
</script>

test/unit/specs/index.spec.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ describe('Bootstrap Field Inputs', () => {
165165
};
166166
});
167167

168-
describe('=== Input ===', () => {
168+
describe('Input', () => {
169169

170170
describe('functions',() =>{
171171
describeFunctions('input');
@@ -203,7 +203,7 @@ describe('Bootstrap Field Inputs', () => {
203203

204204

205205

206-
describe('=== Select ===', () => {
206+
describe('Select', () => {
207207
describe('functions', ()=>{
208208
describeFunctions('select');
209209
});
@@ -251,6 +251,26 @@ describe('Bootstrap Field Inputs', () => {
251251

252252
});
253253

254-
254+
describe('Textarea', () => {
255+
describe('functions', ()=>{
256+
describeFunctions('textarea');
257+
});
258+
describe('classes & attributes', () => {
259+
describeAttributes('textarea');
260+
});
261+
describe('conditional elements', ()=>{
262+
describeConditional('textarea');
263+
});
264+
265+
it('layout', () => {
266+
data.form.test.type = 'textarea';
267+
createForm();
268+
269+
let inputs = vm.$el.querySelectorAll('textarea');
270+
let input = inputs[0];
271+
272+
expect(inputs).to.be.length(1);
273+
});
274+
});
255275

256276
});

0 commit comments

Comments
 (0)