Skip to content
This repository was archived by the owner on Jan 22, 2018. It is now read-only.

Commit e61a24a

Browse files
author
Kamil Kisiela
committed
style: SWAG
1 parent f589ce6 commit e61a24a

File tree

18 files changed

+237
-213
lines changed

18 files changed

+237
-213
lines changed

src/index.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ import types from './types';
77
const ngModuleName = 'formlyMaterial';
88

99
angular.module(ngModuleName, [
10-
'ngMessages',
11-
'ngMaterial',
12-
'formly'
13-
])
14-
.config(['formlyConfigProvider', (formlyConfigProvider) => {
15-
const configs = [runs, wrappers, types];
10+
'ngMessages',
11+
'ngMaterial',
12+
'formly'
13+
])
14+
.config(['formlyConfigProvider', (formlyConfigProvider) => {
15+
const configs = [runs, wrappers, types];
1616

17-
configs.forEach((config) => {
18-
let i = 0;
19-
for (; i < config.length; i++) {
20-
config[i](formlyConfigProvider);
21-
}
22-
});
23-
}]);
17+
configs.forEach((config) => {
18+
let i = 0;
19+
for (; i < config.length; i++) {
20+
config[i](formlyConfigProvider);
21+
}
22+
});
23+
}]);
2424

25-
export default ngModuleName;
25+
export default ngModuleName;

src/runs/md-no-autogrow.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import {ngModelAttrsManipulator} from './../helpers/index.js';
1+
import {
2+
ngModelAttrsManipulator
3+
}
4+
from './../helpers/index.js';
25

36
export default (formlyConfigProvider) => {
47
formlyConfigProvider.templateManipulators.preWrapper.push((template, options) => {
58
if (!angular.isDefined(options.templateOptions.grow)) {
69
return template;
710
}
8-
if(options.templateOptions.grow !== false) {
11+
if (options.templateOptions.grow !== false) {
912
return template;
1013
}
1114
if (!angular.isDefined(options.type) || options.type !== 'textarea') {

src/runs/md-theme-manipulator.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import {ngModelAttrsManipulator} from './../helpers/index.js';
1+
import {
2+
ngModelAttrsManipulator
3+
}
4+
from './../helpers/index.js';
25

36
export default (formlyConfigProvider) => {
47
formlyConfigProvider.templateManipulators.preWrapper.push((template, options) => {

src/types/checkbox/checkbox.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import template from './checkbox.html';
22

33
export default (formlyConfigProvider) => {
4-
formlyConfigProvider.setType({
5-
name: 'checkbox',
6-
template: template
7-
});
8-
}
4+
formlyConfigProvider.setType({
5+
name: 'checkbox',
6+
template: template
7+
});
8+
}

src/types/chips/chips.js

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
import template from './chips.html';
22

33
export default (formlyConfigProvider) => {
4-
formlyConfigProvider.setType({
5-
name: 'chips',
6-
template: template,
7-
defaultOptions: {
8-
defaultValue: [],
9-
ngModelAttrs: {
10-
placeholder: {attribute: 'placeholder'},
11-
secondaryPlaceholder: {attribute: 'secondary-placeholder'},
12-
deleteButtonLabel: {attribute: 'delete-button-label'},
13-
deleteHint: {attribute: 'delete-hint'}
14-
}
4+
formlyConfigProvider.setType({
5+
name: 'chips',
6+
template: template,
7+
defaultOptions: {
8+
defaultValue: [],
9+
ngModelAttrs: {
10+
placeholder: {
11+
attribute: 'placeholder'
1512
},
16-
apiCheck: (check) => ({
17-
templateOptions: {
18-
placeholder: check.string.optional,
19-
secondaryPlaceholder: check.string.optional,
20-
deleteButtonLabel: check.string.optional,
21-
deleteHint: check.string.optional
22-
}
23-
})
24-
});
25-
}
13+
secondaryPlaceholder: {
14+
attribute: 'secondary-placeholder'
15+
},
16+
deleteButtonLabel: {
17+
attribute: 'delete-button-label'
18+
},
19+
deleteHint: {
20+
attribute: 'delete-hint'
21+
}
22+
}
23+
},
24+
apiCheck: (check) => ({
25+
templateOptions: {
26+
placeholder: check.string.optional,
27+
secondaryPlaceholder: check.string.optional,
28+
deleteButtonLabel: check.string.optional,
29+
deleteHint: check.string.optional
30+
}
31+
})
32+
});
33+
}

src/types/datepicker/datepicker.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
import template from './datepicker.html';
22

33
export default (formlyConfigProvider) => {
4-
formlyConfigProvider.setType({
5-
name: 'datepicker',
6-
template: template,
7-
wrapper: ['messages'],
8-
defaultOptions: {
9-
ngModelAttrs: {
10-
placeholder: {
11-
attribute: 'md-placeholder'
12-
},
13-
minDate: {
14-
bound: 'md-min-date'
15-
},
16-
maxDate: {
17-
bound: 'md-max-date'
18-
},
19-
filterDate: {
20-
bound: 'md-date-filter'
21-
}
22-
}
4+
formlyConfigProvider.setType({
5+
name: 'datepicker',
6+
template: template,
7+
wrapper: ['messages'],
8+
defaultOptions: {
9+
ngModelAttrs: {
10+
placeholder: {
11+
attribute: 'md-placeholder'
2312
},
24-
apiCheck: (check) => ({
25-
templateOptions: {
26-
placeholder: check.string.optional,
27-
minDate: check.instanceOf(Date).optional,
28-
maxDate: check.instanceOf(Date).optional,
29-
filterDate: check.func.optional
30-
}
31-
})
32-
});
33-
}
13+
minDate: {
14+
bound: 'md-min-date'
15+
},
16+
maxDate: {
17+
bound: 'md-max-date'
18+
},
19+
filterDate: {
20+
bound: 'md-date-filter'
21+
}
22+
}
23+
},
24+
apiCheck: (check) => ({
25+
templateOptions: {
26+
placeholder: check.string.optional,
27+
minDate: check.instanceOf(Date).optional,
28+
maxDate: check.instanceOf(Date).optional,
29+
filterDate: check.func.optional
30+
}
31+
})
32+
});
33+
}

src/types/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import switchType from './switch/switch';
99
import textareaType from './textarea/textarea';
1010

1111
export default [
12-
checkboxType,
13-
chipsType,
14-
datepickerType,
15-
inputType,
16-
radioType,
17-
selectType,
18-
sliderType,
19-
switchType,
20-
textareaType
21-
];
12+
checkboxType,
13+
chipsType,
14+
datepickerType,
15+
inputType,
16+
radioType,
17+
selectType,
18+
sliderType,
19+
switchType,
20+
textareaType
21+
];

src/types/input/input.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import template from './input.html';
22

33
export default (formlyConfigProvider) => {
4-
formlyConfigProvider.setType({
5-
name: 'input',
6-
template: template,
7-
wrapper: ['label', 'messages', 'inputContainer'],
8-
defaultOptions: {
9-
ngModelAttrs: {
10-
mdMaxlength: {
11-
bound: 'md-maxlength'
12-
}
13-
}
4+
formlyConfigProvider.setType({
5+
name: 'input',
6+
template: template,
7+
wrapper: ['label', 'messages', 'inputContainer'],
8+
defaultOptions: {
9+
ngModelAttrs: {
10+
mdMaxlength: {
11+
bound: 'md-maxlength'
1412
}
15-
});
16-
}
13+
}
14+
}
15+
});
16+
}

src/types/radio/radio.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import template from './radio.html';
22

33
export default (formlyConfigProvider) => {
4-
formlyConfigProvider.setType({
5-
name: 'radio',
6-
template: template,
7-
apiCheck: (check) => ({
8-
templateOptions: {
9-
options: check.arrayOf(check.object),
10-
labelProp: check.string.optional,
11-
valueProp: check.string.optional
12-
}
13-
})
14-
});
15-
}
4+
formlyConfigProvider.setType({
5+
name: 'radio',
6+
template: template,
7+
apiCheck: (check) => ({
8+
templateOptions: {
9+
options: check.arrayOf(check.object),
10+
labelProp: check.string.optional,
11+
valueProp: check.string.optional
12+
}
13+
})
14+
});
15+
}

src/types/select/select.js

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
import template from './select.html';
22

33
export default (formlyConfigProvider) => {
4-
formlyConfigProvider.setType({
5-
name: 'select',
6-
template: template,
7-
wrapper: ['label', 'messages', 'inputContainer'],
8-
defaultOptions: {
9-
ngModelAttrs: {
10-
multiple: {bound: 'multiple'},
11-
onClose: {bound: 'md-on-close'},
12-
onOpen: {bound: 'md-on-open'}
13-
}
4+
formlyConfigProvider.setType({
5+
name: 'select',
6+
template: template,
7+
wrapper: ['label', 'messages', 'inputContainer'],
8+
defaultOptions: {
9+
ngModelAttrs: {
10+
multiple: {
11+
bound: 'multiple'
1412
},
15-
apiCheck: (check) => ({
16-
templateOptions: {
17-
options: check.arrayOf(check.object),
18-
multiple: check.bool.optional,
19-
labelProp: check.string.optional,
20-
valueProp: check.string.optional,
21-
onClose: check.func.optional,
22-
onOpen: check.func.optional
23-
}
24-
})
25-
});
13+
onClose: {
14+
bound: 'md-on-close'
15+
},
16+
onOpen: {
17+
bound: 'md-on-open'
18+
}
19+
}
20+
},
21+
apiCheck: (check) => ({
22+
templateOptions: {
23+
options: check.arrayOf(check.object),
24+
multiple: check.bool.optional,
25+
labelProp: check.string.optional,
26+
valueProp: check.string.optional,
27+
onClose: check.func.optional,
28+
onOpen: check.func.optional
29+
}
30+
})
31+
});
2632
}

0 commit comments

Comments
 (0)