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

Commit 1c44056

Browse files
author
Kamil Kisiela
committed
Merge branch 'release/v0.7.1'
2 parents 1649e54 + 49a52e9 commit 1c44056

File tree

12 files changed

+84
-97
lines changed

12 files changed

+84
-97
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [0.7.1] - 2015-12-01
6+
### Changed
7+
- use bound for datepicker's minDate, maxDate and filterDate instead of template manipulator
8+
- remove bound from slider's min, max and step attributes
9+
510
## [0.7.0] - 2015-11-29
611
### Added
712
- support for npm and bower (angular-formly-material).
13+
814
### Changed
915
- Unit testing using karma instead of velocity (with coverage reports)
1016

@@ -80,6 +86,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
8086

8187
## 0.0.1 - 2015-11-06
8288

89+
[0.7.1]: https://github.com/wieldo/angular-formly-templates-material/compare/v0.7.0...v0.7.1
8390
[0.7.0]: https://github.com/wieldo/angular-formly-templates-material/compare/v0.6.0...v0.7.0
8491
[0.6.0]: https://github.com/wieldo/angular-formly-templates-material/compare/v0.5.2...v0.6.0
8592
[0.5.2]: https://github.com/wieldo/angular-formly-templates-material/compare/v0.5.1...v0.5.2

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FormlyMaterial
33

44
[![GitHub version](https://badge.fury.io/gh/wieldo%2Fangular-formly-templates-material.svg)](https://badge.fury.io/gh/wieldo%2Fangular-formly-templates-material)
55
[![Build Status](https://travis-ci.org/wieldo/angular-formly-templates-material.svg)](https://travis-ci.org/wieldo/angular-formly-templates-material)
6+
[![Coverage Status](https://coveralls.io/repos/wieldo/angular-formly-templates-material/badge.svg?branch=master&service=github)](https://coveralls.io/github/wieldo/angular-formly-templates-material?branch=master)
67
[![Codacy Badge](https://api.codacy.com/project/badge/grade/a2cd4c7c2d74467281e309a65be49e8f)](https://www.codacy.com/app/mys-sterowiec/angular-formly-templates-material)
78

89
Material Design Templates for [Angular-Formly](http://angular-formly.com). Modern & flexible forms configured easily in a JSON object.

dist/formly-material.js

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,18 @@ return /******/ (function(modules) { // webpackBootstrap
452452
wrapper: ['messages'],
453453
defaultOptions: {
454454
ngModelAttrs: {
455-
placeholder: { attribute: 'md-placeholder' }
455+
placeholder: {
456+
attribute: 'md-placeholder'
457+
},
458+
minDate: {
459+
bound: 'md-min-date'
460+
},
461+
maxDate: {
462+
bound: 'md-max-date'
463+
},
464+
filterDate: {
465+
bound: 'md-date-filter'
466+
}
456467
}
457468
},
458469
apiCheck: function apiCheck(check) {
@@ -466,36 +477,6 @@ return /******/ (function(modules) { // webpackBootstrap
466477
};
467478
}
468479
});
469-
470-
formlyConfigProvider.templateManipulators.preWrapper.push(function (template, options) {
471-
if (angular.isDefined(options.templateOptions.minDate) || angular.isDefined(options.templateOptions.maxDate) || angular.isDefined(options.templateOptions.filterDate)) {
472-
473-
var dateConfig = {
474-
min: options.templateOptions.minDate || undefined,
475-
max: options.templateOptions.maxDate || undefined,
476-
filter: options.templateOptions.filterDate || undefined
477-
};
478-
var node = document.createElement('div');
479-
480-
node.innerHTML = template;
481-
var datepickerNode = node.querySelector('md-datepicker');
482-
483-
if (datepickerNode) {
484-
if (dateConfig.min) {
485-
datepickerNode.setAttribute('md-min-date', 'to.minDate');
486-
}
487-
if (dateConfig.max) {
488-
datepickerNode.setAttribute('md-max-date', 'to.maxDate');
489-
}
490-
if (dateConfig.filter) {
491-
datepickerNode.setAttribute('md-date-filter', 'to.filterDate');
492-
}
493-
}
494-
return node.innerHTML;
495-
}
496-
497-
return template;
498-
});
499480
};
500481

501482
module.exports = exports['default'];
@@ -655,15 +636,12 @@ return /******/ (function(modules) { // webpackBootstrap
655636
defaultOptions: {
656637
ngModelAttrs: {
657638
min: {
658-
bound: 'min',
659639
attribute: 'min'
660640
},
661641
max: {
662-
bound: 'max',
663642
attribute: 'max'
664643
},
665644
step: {
666-
bound: 'step',
667645
attribute: 'step'
668646
},
669647
discrete: {

dist/formly-material.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formly-material.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var client = 'client';
33
Package.describe({
44
name: "wieldo:angular-formly-templates-material",
55
summary: "Material design templates for angular-formly",
6-
version: "0.7.0",
6+
version: "0.7.1",
77

88
documentation: 'README.md',
99
git: 'https://github.com/wieldo/angular-formly-templates-material.git'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-formly-material",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"description": "Material design templates for angular-formly",
55
"main": "dist/formly-material.js",
66
"scripts": {

src/types/datepicker/datepicker.js

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,18 @@ export default (formlyConfigProvider) => {
77
wrapper: ['messages'],
88
defaultOptions: {
99
ngModelAttrs: {
10-
placeholder: {attribute: 'md-placeholder'}
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+
}
1122
}
1223
},
1324
apiCheck: (check) => ({
@@ -19,37 +30,4 @@ export default (formlyConfigProvider) => {
1930
}
2031
})
2132
});
22-
23-
formlyConfigProvider.templateManipulators.preWrapper.push((template, options) => {
24-
if (angular.isDefined(options.templateOptions.minDate)
25-
|| angular.isDefined(options.templateOptions.maxDate)
26-
|| angular.isDefined(options.templateOptions.filterDate)) {
27-
28-
const dateConfig = {
29-
min: options.templateOptions.minDate || undefined,
30-
max: options.templateOptions.maxDate || undefined,
31-
filter: options.templateOptions.filterDate || undefined
32-
};
33-
const node = document.createElement('div');
34-
35-
node.innerHTML = template;
36-
const datepickerNode = node.querySelector('md-datepicker');
37-
38-
if (datepickerNode) {
39-
if (dateConfig.min) {
40-
datepickerNode.setAttribute('md-min-date', 'to.minDate');
41-
}
42-
if (dateConfig.max) {
43-
datepickerNode.setAttribute('md-max-date', 'to.maxDate');
44-
}
45-
if (dateConfig.filter) {
46-
datepickerNode.setAttribute('md-date-filter', 'to.filterDate');
47-
}
48-
}
49-
return node.innerHTML;
50-
}
51-
52-
53-
return template;
54-
});
5533
}

src/types/slider/slider.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ export default (formlyConfigProvider) => {
77
defaultOptions: {
88
ngModelAttrs: {
99
min: {
10-
bound: 'min',
1110
attribute: 'min'
1211
},
1312
max: {
14-
bound: 'max',
1513
attribute: 'max'
1614
},
1715
step: {
18-
bound: 'step',
1916
attribute: 'step'
2017
},
2118
discrete: {

tests/runs/md-theme-manipulator-spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ describe("formlyMaterial - theme manipulator", () => {
2828
}, options)];
2929

3030
let form = $compile(testUtils.getFormTemplate())($scope);
31+
3132
$scope.$digest();
3233
element = form.find('[ng-model]');
3334
field = $scope.fields[0];
@@ -50,7 +51,17 @@ describe("formlyMaterial - theme manipulator", () => {
5051
});
5152

5253
it('should be able to add md-theme attribute', () => {
54+
compile();
5355
expect(element.attr('md-theme')).toBe('custom');
5456
});
5557

58+
it("should be able to skip md-theme", () => {
59+
compile({
60+
extras: {
61+
skipNgModelAttrsManipulator: true
62+
}
63+
});
64+
expect(element.attr('md-theme')).toBeUndefined();
65+
});
66+
5667
});

0 commit comments

Comments
 (0)