angular-formly-material
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -5,5 +5,11 @@ # Change Log | ||
## [0.7.1] - 2015-12-01 | ||
### Changed | ||
- use bound for datepicker's minDate, maxDate and filterDate instead of template manipulator | ||
- remove bound from slider's min, max and step attributes | ||
## [0.7.0] - 2015-11-29 | ||
### Added | ||
- support for npm and bower (angular-formly-material). | ||
### Changed | ||
@@ -84,2 +90,3 @@ - Unit testing using karma instead of velocity (with coverage reports) | ||
[0.7.1]: https://github.com/wieldo/angular-formly-templates-material/compare/v0.7.0...v0.7.1 | ||
[0.7.0]: https://github.com/wieldo/angular-formly-templates-material/compare/v0.6.0...v0.7.0 | ||
@@ -86,0 +93,0 @@ [0.6.0]: https://github.com/wieldo/angular-formly-templates-material/compare/v0.5.2...v0.6.0 |
@@ -455,3 +455,14 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
ngModelAttrs: { | ||
placeholder: { attribute: 'md-placeholder' } | ||
placeholder: { | ||
attribute: 'md-placeholder' | ||
}, | ||
minDate: { | ||
bound: 'md-min-date' | ||
}, | ||
maxDate: { | ||
bound: 'md-max-date' | ||
}, | ||
filterDate: { | ||
bound: 'md-date-filter' | ||
} | ||
} | ||
@@ -470,32 +481,2 @@ }, | ||
}); | ||
formlyConfigProvider.templateManipulators.preWrapper.push(function (template, options) { | ||
if (angular.isDefined(options.templateOptions.minDate) || angular.isDefined(options.templateOptions.maxDate) || angular.isDefined(options.templateOptions.filterDate)) { | ||
var dateConfig = { | ||
min: options.templateOptions.minDate || undefined, | ||
max: options.templateOptions.maxDate || undefined, | ||
filter: options.templateOptions.filterDate || undefined | ||
}; | ||
var node = document.createElement('div'); | ||
node.innerHTML = template; | ||
var datepickerNode = node.querySelector('md-datepicker'); | ||
if (datepickerNode) { | ||
if (dateConfig.min) { | ||
datepickerNode.setAttribute('md-min-date', 'to.minDate'); | ||
} | ||
if (dateConfig.max) { | ||
datepickerNode.setAttribute('md-max-date', 'to.maxDate'); | ||
} | ||
if (dateConfig.filter) { | ||
datepickerNode.setAttribute('md-date-filter', 'to.filterDate'); | ||
} | ||
} | ||
return node.innerHTML; | ||
} | ||
return template; | ||
}); | ||
}; | ||
@@ -660,11 +641,8 @@ | ||
min: { | ||
bound: 'min', | ||
attribute: 'min' | ||
}, | ||
max: { | ||
bound: 'max', | ||
attribute: 'max' | ||
}, | ||
step: { | ||
bound: 'step', | ||
attribute: 'step' | ||
@@ -671,0 +649,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("angular")):"function"==typeof define&&define.amd?define(["angular"],t):"object"==typeof exports?exports.ngFormlyMaterial=t(require("angular")):e.ngFormlyMaterial=t(e.angular)}(this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var a=n[o]={exports:{},id:o,loaded:!1};return e[o].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),r=o(a),l=n(2),u=o(l),i=n(4),d=o(i),s=n(11),p=o(s),f="formlyMaterial";r["default"].module(f,["ngMessages","ngMaterial","formly"]).config(["formlyConfigProvider",function(e){var t=[u["default"],d["default"],p["default"]];t.forEach(function(t){for(var n=0;n<t.length;n++)t[n](e)})}]),t["default"]=f,e.exports=t["default"]},function(t,n){t.exports=e},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(3),r=o(a);t["default"]=[r["default"]],e.exports=t["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){function t(e,t,n){angular.forEach(e,function(e){e.getAttribute(t)||e.setAttribute(t,n)})}function n(e){var t="[ng-model], [data-ng-model]";return e.querySelectorAll(t)}e.templateManipulators.preWrapper.push(function(e,o){if(angular.isDefined(o.templateOptions.theme)){var a=document.createElement("div"),r=o.extras&&o.extras.skipNgModelAttrsManipulator;if(r===!0)return e;a.innerHTML=e;var l=n(a);return l&&l.length?(t(l,"md-theme",o.templateOptions.theme),a.innerHTML):e}return e})},e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(5),r=o(a),l=n(7),u=o(l),i=n(9),d=o(i);t["default"]=[r["default"],u["default"],d["default"]],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),r=o(a);t["default"]=function(e){e.setWrapper({name:"inputContainer",template:r["default"]})},e.exports=t["default"]},function(e,t){e.exports="<md-input-container><formly-transclude></formly-transclude></md-input-container>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(8),r=o(a);t["default"]=function(e){e.setWrapper({name:"label",template:r["default"],apiCheck:function(e){return{templateOptions:{label:e.string}}}})},e.exports=t["default"]},function(e,t){e.exports="<label for={{id}}>{{to.label}} {{to.required ? '*' : ''}}</label><formly-transclude></formly-transclude>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(10),r=o(a);t["default"]=function(e){e.setWrapper({name:"messages",template:r["default"]})},e.exports=t["default"]},function(e,t){e.exports='<formly-transclude></formly-transclude><div ng-messages=fc.$error><div ng-repeat="(name, message) in ::options.validation.messages" ng-message-exp=name>{{message(fc.$viewValue, fc.$modelValue, this)}}</div></div>'},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(12),r=o(a),l=n(14),u=o(l),i=n(16),d=o(i),s=n(18),p=o(s),f=n(20),c=o(f),m=n(22),b=o(m),g=n(24),v=o(g),_=n(26),x=o(_),y=n(28),M=o(y);t["default"]=[r["default"],u["default"],d["default"],p["default"],c["default"],b["default"],v["default"],x["default"],M["default"]],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(13),r=o(a);t["default"]=function(e){e.setType({name:"checkbox",template:r["default"]})},e.exports=t["default"]},function(e,t){e.exports="<div><md-checkbox ng-model=model[options.key]>{{to.label}}</md-checkbox></div>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(15),r=o(a);t["default"]=function(e){e.setType({name:"chips",template:r["default"],defaultOptions:{defaultValue:[],ngModelAttrs:{placeholder:{attribute:"placeholder"},secondaryPlaceholder:{attribute:"secondary-placeholder"},deleteButtonLabel:{attribute:"delete-button-label"},deleteHint:{attribute:"delete-hint"}}},apiCheck:function(e){return{templateOptions:{placeholder:e.string.optional,secondaryPlaceholder:e.string.optional,deleteButtonLabel:e.string.optional,deleteHint:e.string.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<md-chips ng-model=model[options.key]></md-chips>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(17),r=o(a);t["default"]=function(e){e.setType({name:"datepicker",template:r["default"],wrapper:["messages"],defaultOptions:{ngModelAttrs:{placeholder:{attribute:"md-placeholder"}}},apiCheck:function(e){return{templateOptions:{placeholder:e.string.optional,minDate:e.instanceOf(Date).optional,maxDate:e.instanceOf(Date).optional,filterDate:e.func.optional}}}}),e.templateManipulators.preWrapper.push(function(e,t){if(angular.isDefined(t.templateOptions.minDate)||angular.isDefined(t.templateOptions.maxDate)||angular.isDefined(t.templateOptions.filterDate)){var n={min:t.templateOptions.minDate||void 0,max:t.templateOptions.maxDate||void 0,filter:t.templateOptions.filterDate||void 0},o=document.createElement("div");o.innerHTML=e;var a=o.querySelector("md-datepicker");return a&&(n.min&&a.setAttribute("md-min-date","to.minDate"),n.max&&a.setAttribute("md-max-date","to.maxDate"),n.filter&&a.setAttribute("md-date-filter","to.filterDate")),o.innerHTML}return e})},e.exports=t["default"]},function(e,t){e.exports="<div><md-datepicker ng-model=model[options.key]></md-datepicker></div>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(19),r=o(a);t["default"]=function(e){e.setType({name:"input",template:r["default"],wrapper:["label","messages","inputContainer"],defaultOptions:{ngModelAttrs:{mdMaxlength:{bound:"md-maxlength"}}}})},e.exports=t["default"]},function(e,t){e.exports="<input ng-model=model[options.key]>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(21),r=o(a);t["default"]=function(e){e.setType({name:"radio",template:r["default"],apiCheck:function(e){return{templateOptions:{options:e.arrayOf(e.object),labelProp:e.string.optional,valueProp:e.string.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<md-radio-group ng-model=model[options.key]><md-radio-button ng-repeat=\"option in to.options\" ng-value=\"option[to.valueProp || 'value']\">{{option[to.labelProp || 'name']}}</md-radio-button></md-radio-group>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(23),r=o(a);t["default"]=function(e){e.setType({name:"select",template:r["default"],wrapper:["label","messages","inputContainer"],defaultOptions:{ngModelAttrs:{multiple:{bound:"multiple"}}},apiCheck:function(e){return{templateOptions:{options:e.arrayOf(e.object),multiple:e.bool.optional,labelProp:e.string.optional,valueProp:e.string.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<md-select ng-model=model[options.key]><md-option ng-repeat=\"option in to.options\" ng-value=\"option[to.valueProp || 'value']\">{{ option[to.labelProp || 'name'] }}</md-option></md-select>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(25),r=o(a);t["default"]=function(e){e.setType({name:"slider",template:r["default"],defaultOptions:{ngModelAttrs:{min:{bound:"min",attribute:"min"},max:{bound:"max",attribute:"max"},step:{bound:"step",attribute:"step"},discrete:{bound:"md-discrete"}}},apiCheck:function(e){return{templateOptions:{min:e.number.optional,max:e.number.optional,step:e.number.optional,discrete:e.bool.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<md-slider ng-model=model[options.key]></md-slider>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(27),r=o(a);t["default"]=function(e){e.setType({name:"switch",template:r["default"]})},e.exports=t["default"]},function(e,t){e.exports="<md-switch ng-model=model[options.key]>{{to.label}}</md-switch>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(29),r=o(a);t["default"]=function(e){e.setType({name:"textarea",template:r["default"],wrapper:["label","messages","inputContainer"],defaultOptions:{ngModelAttrs:{rows:{attribute:"rows"},cols:{attribute:"cols"}}},apiCheck:function(e){return{templateOptions:{rows:e.number.optional,cols:e.number.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<textarea ng-model=model[options.key]></textarea>"}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("angular")):"function"==typeof define&&define.amd?define(["angular"],t):"object"==typeof exports?exports.ngFormlyMaterial=t(require("angular")):e.ngFormlyMaterial=t(e.angular)}(this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var a=n[o]={exports:{},id:o,loaded:!1};return e[o].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),l=o(a),u=n(2),r=o(u),i=n(4),d=o(i),s=n(11),f=o(s),p="formlyMaterial";l["default"].module(p,["ngMessages","ngMaterial","formly"]).config(["formlyConfigProvider",function(e){var t=[r["default"],d["default"],f["default"]];t.forEach(function(t){for(var n=0;n<t.length;n++)t[n](e)})}]),t["default"]=p,e.exports=t["default"]},function(t,n){t.exports=e},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(3),l=o(a);t["default"]=[l["default"]],e.exports=t["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){function t(e,t,n){angular.forEach(e,function(e){e.getAttribute(t)||e.setAttribute(t,n)})}function n(e){var t="[ng-model], [data-ng-model]";return e.querySelectorAll(t)}e.templateManipulators.preWrapper.push(function(e,o){if(angular.isDefined(o.templateOptions.theme)){var a=document.createElement("div"),l=o.extras&&o.extras.skipNgModelAttrsManipulator;if(l===!0)return e;a.innerHTML=e;var u=n(a);return u&&u.length?(t(u,"md-theme",o.templateOptions.theme),a.innerHTML):e}return e})},e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(5),l=o(a),u=n(7),r=o(u),i=n(9),d=o(i);t["default"]=[l["default"],r["default"],d["default"]],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),l=o(a);t["default"]=function(e){e.setWrapper({name:"inputContainer",template:l["default"]})},e.exports=t["default"]},function(e,t){e.exports="<md-input-container><formly-transclude></formly-transclude></md-input-container>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(8),l=o(a);t["default"]=function(e){e.setWrapper({name:"label",template:l["default"],apiCheck:function(e){return{templateOptions:{label:e.string}}}})},e.exports=t["default"]},function(e,t){e.exports="<label for={{id}}>{{to.label}} {{to.required ? '*' : ''}}</label><formly-transclude></formly-transclude>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(10),l=o(a);t["default"]=function(e){e.setWrapper({name:"messages",template:l["default"]})},e.exports=t["default"]},function(e,t){e.exports='<formly-transclude></formly-transclude><div ng-messages=fc.$error><div ng-repeat="(name, message) in ::options.validation.messages" ng-message-exp=name>{{message(fc.$viewValue, fc.$modelValue, this)}}</div></div>'},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(12),l=o(a),u=n(14),r=o(u),i=n(16),d=o(i),s=n(18),f=o(s),p=n(20),c=o(p),m=n(22),b=o(m),_=n(24),g=o(_),v=n(26),x=o(v),y=n(28),M=o(y);t["default"]=[l["default"],r["default"],d["default"],f["default"],c["default"],b["default"],g["default"],x["default"],M["default"]],e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(13),l=o(a);t["default"]=function(e){e.setType({name:"checkbox",template:l["default"]})},e.exports=t["default"]},function(e,t){e.exports="<div><md-checkbox ng-model=model[options.key]>{{to.label}}</md-checkbox></div>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(15),l=o(a);t["default"]=function(e){e.setType({name:"chips",template:l["default"],defaultOptions:{defaultValue:[],ngModelAttrs:{placeholder:{attribute:"placeholder"},secondaryPlaceholder:{attribute:"secondary-placeholder"},deleteButtonLabel:{attribute:"delete-button-label"},deleteHint:{attribute:"delete-hint"}}},apiCheck:function(e){return{templateOptions:{placeholder:e.string.optional,secondaryPlaceholder:e.string.optional,deleteButtonLabel:e.string.optional,deleteHint:e.string.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<md-chips ng-model=model[options.key]></md-chips>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(17),l=o(a);t["default"]=function(e){e.setType({name:"datepicker",template:l["default"],wrapper:["messages"],defaultOptions:{ngModelAttrs:{placeholder:{attribute:"md-placeholder"},minDate:{bound:"md-min-date"},maxDate:{bound:"md-max-date"},filterDate:{bound:"md-date-filter"}}},apiCheck:function(e){return{templateOptions:{placeholder:e.string.optional,minDate:e.instanceOf(Date).optional,maxDate:e.instanceOf(Date).optional,filterDate:e.func.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<div><md-datepicker ng-model=model[options.key]></md-datepicker></div>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(19),l=o(a);t["default"]=function(e){e.setType({name:"input",template:l["default"],wrapper:["label","messages","inputContainer"],defaultOptions:{ngModelAttrs:{mdMaxlength:{bound:"md-maxlength"}}}})},e.exports=t["default"]},function(e,t){e.exports="<input ng-model=model[options.key]>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(21),l=o(a);t["default"]=function(e){e.setType({name:"radio",template:l["default"],apiCheck:function(e){return{templateOptions:{options:e.arrayOf(e.object),labelProp:e.string.optional,valueProp:e.string.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<md-radio-group ng-model=model[options.key]><md-radio-button ng-repeat=\"option in to.options\" ng-value=\"option[to.valueProp || 'value']\">{{option[to.labelProp || 'name']}}</md-radio-button></md-radio-group>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(23),l=o(a);t["default"]=function(e){e.setType({name:"select",template:l["default"],wrapper:["label","messages","inputContainer"],defaultOptions:{ngModelAttrs:{multiple:{bound:"multiple"}}},apiCheck:function(e){return{templateOptions:{options:e.arrayOf(e.object),multiple:e.bool.optional,labelProp:e.string.optional,valueProp:e.string.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<md-select ng-model=model[options.key]><md-option ng-repeat=\"option in to.options\" ng-value=\"option[to.valueProp || 'value']\">{{ option[to.labelProp || 'name'] }}</md-option></md-select>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(25),l=o(a);t["default"]=function(e){e.setType({name:"slider",template:l["default"],defaultOptions:{ngModelAttrs:{min:{attribute:"min"},max:{attribute:"max"},step:{attribute:"step"},discrete:{bound:"md-discrete"}}},apiCheck:function(e){return{templateOptions:{min:e.number.optional,max:e.number.optional,step:e.number.optional,discrete:e.bool.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<md-slider ng-model=model[options.key]></md-slider>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(27),l=o(a);t["default"]=function(e){e.setType({name:"switch",template:l["default"]})},e.exports=t["default"]},function(e,t){e.exports="<md-switch ng-model=model[options.key]>{{to.label}}</md-switch>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(29),l=o(a);t["default"]=function(e){e.setType({name:"textarea",template:l["default"],wrapper:["label","messages","inputContainer"],defaultOptions:{ngModelAttrs:{rows:{attribute:"rows"},cols:{attribute:"cols"}}},apiCheck:function(e){return{templateOptions:{rows:e.number.optional,cols:e.number.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<textarea ng-model=model[options.key]></textarea>"}])}); | ||
//# sourceMappingURL=formly-material.min.js.map |
@@ -6,3 +6,3 @@ var client = 'client'; | ||
summary: "Material design templates for angular-formly", | ||
version: "0.7.0", | ||
version: "0.7.1", | ||
@@ -9,0 +9,0 @@ documentation: 'README.md', |
{ | ||
"name": "angular-formly-material", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Material design templates for angular-formly", | ||
@@ -5,0 +5,0 @@ "main": "dist/formly-material.js", |
@@ -6,2 +6,3 @@ FormlyMaterial | ||
[![Build Status](https://travis-ci.org/wieldo/angular-formly-templates-material.svg)](https://travis-ci.org/wieldo/angular-formly-templates-material) | ||
[![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) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/grade/a2cd4c7c2d74467281e309a65be49e8f)](https://www.codacy.com/app/mys-sterowiec/angular-formly-templates-material) | ||
@@ -8,0 +9,0 @@ |
@@ -10,3 +10,14 @@ import template from './datepicker.html'; | ||
ngModelAttrs: { | ||
placeholder: {attribute: 'md-placeholder'} | ||
placeholder: { | ||
attribute: 'md-placeholder' | ||
}, | ||
minDate: { | ||
bound: 'md-min-date' | ||
}, | ||
maxDate: { | ||
bound: 'md-max-date' | ||
}, | ||
filterDate: { | ||
bound: 'md-date-filter' | ||
} | ||
} | ||
@@ -23,35 +34,2 @@ }, | ||
}); | ||
formlyConfigProvider.templateManipulators.preWrapper.push((template, options) => { | ||
if (angular.isDefined(options.templateOptions.minDate) | ||
|| angular.isDefined(options.templateOptions.maxDate) | ||
|| angular.isDefined(options.templateOptions.filterDate)) { | ||
const dateConfig = { | ||
min: options.templateOptions.minDate || undefined, | ||
max: options.templateOptions.maxDate || undefined, | ||
filter: options.templateOptions.filterDate || undefined | ||
}; | ||
const node = document.createElement('div'); | ||
node.innerHTML = template; | ||
const datepickerNode = node.querySelector('md-datepicker'); | ||
if (datepickerNode) { | ||
if (dateConfig.min) { | ||
datepickerNode.setAttribute('md-min-date', 'to.minDate'); | ||
} | ||
if (dateConfig.max) { | ||
datepickerNode.setAttribute('md-max-date', 'to.maxDate'); | ||
} | ||
if (dateConfig.filter) { | ||
datepickerNode.setAttribute('md-date-filter', 'to.filterDate'); | ||
} | ||
} | ||
return node.innerHTML; | ||
} | ||
return template; | ||
}); | ||
} |
@@ -10,11 +10,8 @@ import template from './slider.html'; | ||
min: { | ||
bound: 'min', | ||
attribute: 'min' | ||
}, | ||
max: { | ||
bound: 'max', | ||
attribute: 'max' | ||
}, | ||
step: { | ||
bound: 'step', | ||
attribute: 'step' | ||
@@ -21,0 +18,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
292
115816
1013