Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-formly-material

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-formly-material - npm Package Compare versions

Comparing version 0.11.0 to 0.12.0

.editorconfig

25

CHANGELOG.md

@@ -6,6 +6,17 @@ Change Log

[0.11.0](https://github.com/formly-js/angular-formly-templates-material/compare/v0.10.0...v0.11.0)
[0.12.0](https://github.com/formly-js/angular-formly-templates-material/compare/v0.11.0...v0.12.0) - 2015-12-30
---------------------------------------------------------------------------------------------------------------
### Added
- (messages) support for `errorExistsAndShouldBeVisible` (#7)
- (input) support for **min** attribute of 'number' type (#6)
- (input) support for **max** attribute of 'number' type (#6)
- (input) support for **step** attribute of 'number' type (#6)
[0.11.0](https://github.com/formly-js/angular-formly-templates-material/compare/v0.10.0...v0.11.0) - 2015-12-18
---------------------------------------------------------------------------------------------------------------
### Added
- (chips) onAdd callback (equivalent to md-on-add)

@@ -15,3 +26,4 @@ - (chips) onRemove callback (equivalent to md-on-remove)

[0.10.0](https://github.com/formly-js/angular-formly-templates-material/compare/v0.9.0...v0.10.0)
[0.10.0](https://github.com/formly-js/angular-formly-templates-material/compare/v0.9.0...v0.10.0) - 2015-12-17
--------------------------------------------------------------------------------------------------------------

@@ -23,3 +35,4 @@ ### Added

[0.9.0](https://github.com/formly-js/angular-formly-templates-material/compare/v0.8.0...v0.9.0)
[0.9.0](https://github.com/formly-js/angular-formly-templates-material/compare/v0.8.0...v0.9.0) - 2015-12-17
------------------------------------------------------------------------------------------------------------

@@ -30,3 +43,4 @@ ### Added

[0.8.0](https://github.com/formly-js/angular-formly-templates-material/compare/v0.7.3...v0.8.0)
[0.8.0](https://github.com/formly-js/angular-formly-templates-material/compare/v0.7.3...v0.8.0) - 2015-12-16
------------------------------------------------------------------------------------------------------------

@@ -38,3 +52,4 @@ ### Changed

[0.7.3](https://github.com/formly-js/angular-formly-templates-material/compare/v0.7.2...v0.7.3)
[0.7.3](https://github.com/formly-js/angular-formly-templates-material/compare/v0.7.2...v0.7.3) - 2015-12-14
------------------------------------------------------------------------------------------------------------

@@ -41,0 +56,0 @@ ### Changed

264

dist/formly-material.js
/*!
* angular-formly-material JavaScript Library v0.11.0
* angular-formly-material JavaScript Library v0.12.0
*

@@ -80,7 +80,7 @@ * @license MIT (http://license.angular-formly.com)

var _wrappers = __webpack_require__(6);
var _wrappers = __webpack_require__(5);
var _wrappers2 = _interopRequireDefault(_wrappers);
var _types = __webpack_require__(15);
var _types = __webpack_require__(14);

@@ -123,11 +123,7 @@ var _types2 = _interopRequireDefault(_types);

var _mdThemeManipulator = __webpack_require__(3);
var _theme = __webpack_require__(3);
var _mdThemeManipulator2 = _interopRequireDefault(_mdThemeManipulator);
var _theme2 = _interopRequireDefault(_theme);
var _mdNoAutogrow = __webpack_require__(5);
var _mdNoAutogrow2 = _interopRequireDefault(_mdNoAutogrow);
exports['default'] = [_mdThemeManipulator2['default'], _mdNoAutogrow2['default']];
exports['default'] = [_theme2['default']];
module.exports = exports['default'];

@@ -149,3 +145,5 @@

formlyConfigProvider.templateManipulators.preWrapper.push(function (template, options) {
if (angular.isDefined(options.templateOptions.theme)) {
// adds md-theme only when:
// templateOptions.theme is defined
if (typeof options.templateOptions.theme !== 'undefined') {
return (0, _helpersIndexJs.ngModelAttrsManipulator)(template, options, 'md-theme', options.templateOptions.theme);

@@ -169,2 +167,3 @@ }

exports.ngModelAttrsManipulator = ngModelAttrsManipulator;
exports.ngModelAttrsTransformer = ngModelAttrsTransformer;

@@ -177,2 +176,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

/**
* Sets attribute with optional value.
* Does not owerwrite.
* @param {Array} nodes nodes
* @param {String} attr attribute name
* @param {String} val atrtibute value
*/
function addIfNotPresent(nodes, attr, val) {

@@ -186,4 +192,7 @@ _angular2['default'].forEach(nodes, function (node) {

/**
* Gets all ngModels from node
*/
function getNgModelNodes(node) {
var query = "[ng-model], [data-ng-model]";
var query = '[ng-model], [data-ng-model]';

@@ -193,2 +202,14 @@ return node.querySelectorAll(query);

/**
* Adds attribute with optional value to all elements using ngModel directive.
* Handles extras.skipNgModelAttrsManipulator
* And does not overwrite attriutes
*
* @param {String} template Template provided by formly template manipulator
* @param {Object} options Options provided by formly template manipulator
* @param {String} attrName Attribute's name
* @param {String|undefined} Attribute's value (optional)
* @return {String} result
*/
function ngModelAttrsManipulator(template, options, attrName, attrValue) {

@@ -213,34 +234,29 @@ var node = document.createElement('div');

/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
/**
* Adds ngModelAttr to the field when specified condition is true.
* @param {Array} fields fields provided by formly's fieldTranform
* @param {Funcion} condition with field as only parameter
* @param {String} name ngModelAttr's name
* @param {Object} settings ngModelAttr's settings
* @return {Array} returns fields
*/
'use strict';
function ngModelAttrsTransformer(fields, condition, name, settings) {
(fields || []).forEach(function (field) {
if (condition(field) === true) {
if (!field.ngModelAttrs) {
field.ngModelAttrs = {};
}
Object.defineProperty(exports, '__esModule', {
value: true
});
var _helpersIndexJs = __webpack_require__(4);
exports['default'] = function (formlyConfigProvider) {
formlyConfigProvider.templateManipulators.preWrapper.push(function (template, options) {
if (!angular.isDefined(options.templateOptions.grow)) {
return template;
if (typeof field.templateOptions[name] !== 'undefined') {
field.ngModelAttrs[name] = settings;
}
}
if (options.templateOptions.grow !== false) {
return template;
}
if (!angular.isDefined(options.type) || options.type !== 'textarea') {
return template;
}
return (0, _helpersIndexJs.ngModelAttrsManipulator)(template, options, 'md-no-autogrow');
});
};
module.exports = exports['default'];
return fields;
}
/***/ },
/* 6 */
/* 5 */
/***/ function(module, exports, __webpack_require__) {

@@ -256,15 +272,15 @@

var _inputContainerInputContainer = __webpack_require__(7);
var _inputContainerInputContainer = __webpack_require__(6);
var _inputContainerInputContainer2 = _interopRequireDefault(_inputContainerInputContainer);
var _labelLabel = __webpack_require__(9);
var _labelLabel = __webpack_require__(8);
var _labelLabel2 = _interopRequireDefault(_labelLabel);
var _messagesMessages = __webpack_require__(11);
var _messagesMessages = __webpack_require__(10);
var _messagesMessages2 = _interopRequireDefault(_messagesMessages);
var _dividerDivider = __webpack_require__(13);
var _dividerDivider = __webpack_require__(12);

@@ -277,3 +293,3 @@ var _dividerDivider2 = _interopRequireDefault(_dividerDivider);

/***/ },
/* 7 */
/* 6 */
/***/ function(module, exports, __webpack_require__) {

@@ -289,3 +305,3 @@

var _inputContainerHtml = __webpack_require__(8);
var _inputContainerHtml = __webpack_require__(7);

@@ -296,4 +312,4 @@ var _inputContainerHtml2 = _interopRequireDefault(_inputContainerHtml);

formlyConfigProvider.setWrapper({
name: 'inputContainer',
template: _inputContainerHtml2['default']
template: _inputContainerHtml2['default'],
name: 'inputContainer'
});

@@ -305,3 +321,3 @@ };

/***/ },
/* 8 */
/* 7 */
/***/ function(module, exports) {

@@ -312,3 +328,3 @@

/***/ },
/* 9 */
/* 8 */
/***/ function(module, exports, __webpack_require__) {

@@ -324,3 +340,3 @@

var _labelHtml = __webpack_require__(10);
var _labelHtml = __webpack_require__(9);

@@ -331,4 +347,4 @@ var _labelHtml2 = _interopRequireDefault(_labelHtml);

formlyConfigProvider.setWrapper({
template: _labelHtml2['default'],
name: 'label',
template: _labelHtml2['default'],
apiCheck: function apiCheck(check) {

@@ -347,3 +363,3 @@ return {

/***/ },
/* 10 */
/* 9 */
/***/ function(module, exports) {

@@ -354,3 +370,3 @@

/***/ },
/* 11 */
/* 10 */
/***/ function(module, exports, __webpack_require__) {

@@ -366,3 +382,3 @@

var _messagesHtml = __webpack_require__(12);
var _messagesHtml = __webpack_require__(11);

@@ -373,4 +389,4 @@ var _messagesHtml2 = _interopRequireDefault(_messagesHtml);

formlyConfigProvider.setWrapper({
name: 'messages',
template: _messagesHtml2['default']
template: _messagesHtml2['default'],
name: 'messages'
});

@@ -382,9 +398,9 @@ };

/***/ },
/* 12 */
/* 11 */
/***/ function(module, exports) {
module.exports = "<formly-transclude></formly-transclude>\r\n<div ng-messages=\"fc.$error\">\r\n <div ng-repeat=\"(name, message) in ::options.validation.messages\"\r\n ng-message-exp=\"name\">\r\n {{message(fc.$viewValue, fc.$modelValue, this)}}\r\n </div>\r\n</div>";
module.exports = "<formly-transclude></formly-transclude>\n<div ng-messages=\"fc.$error\" ng-show=\"showError\">\n <div ng-repeat=\"(name, message) in ::options.validation.messages\"\n ng-message-exp=\"name\">\n {{message(fc.$viewValue, fc.$modelValue, this)}}\n </div>\n</div>\n";
/***/ },
/* 13 */
/* 12 */
/***/ function(module, exports, __webpack_require__) {

@@ -400,3 +416,3 @@

var _dividerHtml = __webpack_require__(14);
var _dividerHtml = __webpack_require__(13);

@@ -407,4 +423,4 @@ var _dividerHtml2 = _interopRequireDefault(_dividerHtml);

formlyConfigProvider.setWrapper({
template: _dividerHtml2['default'],
name: 'divider',
template: _dividerHtml2['default'],
apiCheck: function apiCheck(check) {

@@ -423,3 +439,3 @@ return {

/***/ },
/* 14 */
/* 13 */
/***/ function(module, exports) {

@@ -430,3 +446,3 @@

/***/ },
/* 15 */
/* 14 */
/***/ function(module, exports, __webpack_require__) {

@@ -442,35 +458,35 @@

var _checkboxCheckbox = __webpack_require__(16);
var _checkboxCheckbox = __webpack_require__(15);
var _checkboxCheckbox2 = _interopRequireDefault(_checkboxCheckbox);
var _chipsChips = __webpack_require__(18);
var _chipsChips = __webpack_require__(17);
var _chipsChips2 = _interopRequireDefault(_chipsChips);
var _datepickerDatepicker = __webpack_require__(20);
var _datepickerDatepicker = __webpack_require__(19);
var _datepickerDatepicker2 = _interopRequireDefault(_datepickerDatepicker);
var _inputInput = __webpack_require__(22);
var _inputInput = __webpack_require__(21);
var _inputInput2 = _interopRequireDefault(_inputInput);
var _radioRadio = __webpack_require__(24);
var _radioRadio = __webpack_require__(23);
var _radioRadio2 = _interopRequireDefault(_radioRadio);
var _selectSelect = __webpack_require__(26);
var _selectSelect = __webpack_require__(25);
var _selectSelect2 = _interopRequireDefault(_selectSelect);
var _sliderSlider = __webpack_require__(28);
var _sliderSlider = __webpack_require__(27);
var _sliderSlider2 = _interopRequireDefault(_sliderSlider);
var _switchSwitch = __webpack_require__(30);
var _switchSwitch = __webpack_require__(29);
var _switchSwitch2 = _interopRequireDefault(_switchSwitch);
var _textareaTextarea = __webpack_require__(32);
var _textareaTextarea = __webpack_require__(31);

@@ -483,3 +499,3 @@ var _textareaTextarea2 = _interopRequireDefault(_textareaTextarea);

/***/ },
/* 16 */
/* 15 */
/***/ function(module, exports, __webpack_require__) {

@@ -495,3 +511,3 @@

var _checkboxHtml = __webpack_require__(17);
var _checkboxHtml = __webpack_require__(16);

@@ -502,4 +518,4 @@ var _checkboxHtml2 = _interopRequireDefault(_checkboxHtml);

formlyConfigProvider.setType({
name: 'checkbox',
template: _checkboxHtml2['default']
template: _checkboxHtml2['default'],
name: 'checkbox'
});

@@ -511,3 +527,3 @@ };

/***/ },
/* 17 */
/* 16 */
/***/ function(module, exports) {

@@ -518,3 +534,3 @@

/***/ },
/* 18 */
/* 17 */
/***/ function(module, exports, __webpack_require__) {

@@ -530,3 +546,3 @@

var _chipsHtml = __webpack_require__(19);
var _chipsHtml = __webpack_require__(18);

@@ -537,4 +553,4 @@ var _chipsHtml2 = _interopRequireDefault(_chipsHtml);

formlyConfigProvider.setType({
template: _chipsHtml2['default'],
name: 'chips',
template: _chipsHtml2['default'],
defaultOptions: {

@@ -585,3 +601,3 @@ defaultValue: [],

/***/ },
/* 19 */
/* 18 */
/***/ function(module, exports) {

@@ -592,3 +608,3 @@

/***/ },
/* 20 */
/* 19 */
/***/ function(module, exports, __webpack_require__) {

@@ -604,3 +620,3 @@

var _datepickerHtml = __webpack_require__(21);
var _datepickerHtml = __webpack_require__(20);

@@ -611,4 +627,4 @@ var _datepickerHtml2 = _interopRequireDefault(_datepickerHtml);

formlyConfigProvider.setType({
template: _datepickerHtml2['default'],
name: 'datepicker',
template: _datepickerHtml2['default'],
wrapper: ['messages'],

@@ -647,3 +663,3 @@ defaultOptions: {

/***/ },
/* 21 */
/* 20 */
/***/ function(module, exports) {

@@ -654,3 +670,3 @@

/***/ },
/* 22 */
/* 21 */
/***/ function(module, exports, __webpack_require__) {

@@ -666,12 +682,17 @@

var _inputHtml = __webpack_require__(23);
var _inputHtml = __webpack_require__(22);
var _inputHtml2 = _interopRequireDefault(_inputHtml);
var _helpers = __webpack_require__(4);
exports['default'] = function (formlyConfigProvider) {
formlyConfigProvider.setType({
template: _inputHtml2['default'],
name: 'input',
template: _inputHtml2['default'],
wrapper: ['label', 'messages', 'inputContainer'],
defaultOptions: {
templateOptions: {
type: 'text'
},
ngModelAttrs: {

@@ -682,4 +703,21 @@ mdMaxlength: {

}
},
apiCheck: function apiCheck(check) {
return {
templateOptions: {
type: check.string,
step: check.number.optional
}
};
}
});
// add only step attribute because min and max are both built-in
formlyConfigProvider.extras.fieldTransform.push(function (fields) {
return (0, _helpers.ngModelAttrsTransformer)(fields, function (field) {
return field.type === 'input' && field.templateOptions.type === 'number';
}, 'step', {
attribute: 'step'
});
});
};

@@ -690,3 +728,3 @@

/***/ },
/* 23 */
/* 22 */
/***/ function(module, exports) {

@@ -697,3 +735,3 @@

/***/ },
/* 24 */
/* 23 */
/***/ function(module, exports, __webpack_require__) {

@@ -709,3 +747,3 @@

var _radioHtml = __webpack_require__(25);
var _radioHtml = __webpack_require__(24);

@@ -716,4 +754,4 @@ var _radioHtml2 = _interopRequireDefault(_radioHtml);

formlyConfigProvider.setType({
template: _radioHtml2['default'],
name: 'radio',
template: _radioHtml2['default'],
apiCheck: function apiCheck(check) {

@@ -734,3 +772,3 @@ return {

/***/ },
/* 25 */
/* 24 */
/***/ function(module, exports) {

@@ -741,3 +779,3 @@

/***/ },
/* 26 */
/* 25 */
/***/ function(module, exports, __webpack_require__) {

@@ -753,3 +791,3 @@

var _selectHtml = __webpack_require__(27);
var _selectHtml = __webpack_require__(26);

@@ -760,4 +798,4 @@ var _selectHtml2 = _interopRequireDefault(_selectHtml);

formlyConfigProvider.setType({
template: _selectHtml2['default'],
name: 'select',
template: _selectHtml2['default'],
wrapper: ['label', 'messages', 'inputContainer'],

@@ -795,3 +833,3 @@ defaultOptions: {

/***/ },
/* 27 */
/* 26 */
/***/ function(module, exports) {

@@ -802,3 +840,3 @@

/***/ },
/* 28 */
/* 27 */
/***/ function(module, exports, __webpack_require__) {

@@ -814,3 +852,3 @@

var _sliderHtml = __webpack_require__(29);
var _sliderHtml = __webpack_require__(28);

@@ -821,4 +859,4 @@ var _sliderHtml2 = _interopRequireDefault(_sliderHtml);

formlyConfigProvider.setType({
template: _sliderHtml2['default'],
name: 'slider',
template: _sliderHtml2['default'],
defaultOptions: {

@@ -856,3 +894,3 @@ ngModelAttrs: {

/***/ },
/* 29 */
/* 28 */
/***/ function(module, exports) {

@@ -863,3 +901,3 @@

/***/ },
/* 30 */
/* 29 */
/***/ function(module, exports, __webpack_require__) {

@@ -875,3 +913,3 @@

var _switchHtml = __webpack_require__(31);
var _switchHtml = __webpack_require__(30);

@@ -882,4 +920,4 @@ var _switchHtml2 = _interopRequireDefault(_switchHtml);

formlyConfigProvider.setType({
name: 'switch',
template: _switchHtml2['default']
template: _switchHtml2['default'],
name: 'switch'
});

@@ -891,3 +929,3 @@ };

/***/ },
/* 31 */
/* 30 */
/***/ function(module, exports) {

@@ -898,3 +936,3 @@

/***/ },
/* 32 */
/* 31 */
/***/ function(module, exports, __webpack_require__) {

@@ -910,10 +948,12 @@

var _textareaHtml = __webpack_require__(33);
var _textareaHtml = __webpack_require__(32);
var _textareaHtml2 = _interopRequireDefault(_textareaHtml);
var _helpers = __webpack_require__(4);
exports['default'] = function (formlyConfigProvider) {
formlyConfigProvider.setType({
template: _textareaHtml2['default'],
name: 'textarea',
template: _textareaHtml2['default'],
wrapper: ['label', 'messages', 'inputContainer'],

@@ -943,2 +983,10 @@ defaultOptions: {

});
formlyConfigProvider.extras.fieldTransform.push(function (fields) {
return (0, _helpers.ngModelAttrsTransformer)(fields, function (field) {
return field.type === 'textarea' && field.templateOptions.grow === false;
}, 'grow', {
attribute: 'md-no-autogrow'
});
});
};

@@ -949,3 +997,3 @@

/***/ },
/* 33 */
/* 32 */
/***/ function(module, exports) {

@@ -952,0 +1000,0 @@

@@ -1,3 +0,3 @@

/*! angular-formly-material JavaScript Library v0.11.0 | MIT | built with ♥ by Kamil Kisiela <mys.sterowiec@gmail.com> */
!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(n){if(o[n])return o[n].exports;var a=o[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(1),r=n(a),u=o(2),l=n(u),i=o(6),d=n(i),s=o(15),f=n(s),p="formlyMaterial";r["default"].module(p,["ngMessages","ngMaterial","formly"]).config(["formlyConfigProvider",function(e){var t=[l["default"],d["default"],f["default"]];t.forEach(function(t){for(var o=0;o<t.length;o++)t[o](e)})}]),t["default"]=p,e.exports=t["default"]},function(t,o){t.exports=e},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(3),r=n(a),u=o(5),l=n(u);t["default"]=[r["default"],l["default"]],e.exports=t["default"]},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(4);t["default"]=function(e){e.templateManipulators.preWrapper.push(function(e,t){return angular.isDefined(t.templateOptions.theme)?(0,n.ngModelAttrsManipulator)(e,t,"md-theme",t.templateOptions.theme):e})},e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,o){i["default"].forEach(e,function(e){e.getAttribute(t)||e.setAttribute(t,o)})}function r(e){var t="[ng-model], [data-ng-model]";return e.querySelectorAll(t)}function u(e,t,o,n){var u=document.createElement("div"),l=t.extras&&t.extras.skipNgModelAttrsManipulator;if(l===!0)return e;u.innerHTML=e;var i=r(u);return i&&i.length?(a(i,o,n),u.innerHTML):e}Object.defineProperty(t,"__esModule",{value:!0}),t.ngModelAttrsManipulator=u;var l=o(1),i=n(l)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(4);t["default"]=function(e){e.templateManipulators.preWrapper.push(function(e,t){return angular.isDefined(t.templateOptions.grow)?t.templateOptions.grow!==!1?e:angular.isDefined(t.type)&&"textarea"===t.type?(0,n.ngModelAttrsManipulator)(e,t,"md-no-autogrow"):e:e})},e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(7),r=n(a),u=o(9),l=n(u),i=o(11),d=n(i),s=o(13),f=n(s);t["default"]=[r["default"],l["default"],d["default"],f["default"]],e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(8),r=n(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,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(10),r=n(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}}</label><formly-transclude></formly-transclude>"},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(12),r=n(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,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(14),r=n(a);t["default"]=function(e){e.setWrapper({name:"divider",template:r["default"],apiCheck:function(e){return{templateOptions:{divider:e.oneOf(["before","after"]).optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<md-divider ng-if=\"to.divider === 'before'\"></md-divider><formly-transclude></formly-transclude><md-divider ng-if=\"to.divider !== 'before'\"></md-divider>"},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(16),r=n(a),u=o(18),l=n(u),i=o(20),d=n(i),s=o(22),f=n(s),p=o(24),c=n(p),m=o(26),b=n(m),v=o(28),g=n(v),_=o(30),y=n(_),M=o(32),x=n(M);t["default"]=[r["default"],l["default"],d["default"],f["default"],c["default"],b["default"],g["default"],y["default"],x["default"]],e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(17),r=n(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,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(19),r=n(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"},onAdd:{bound:"md-on-add"},onRemove:{bound:"md-on-remove"},onSelect:{bound:"md-on-select"}}},apiCheck:function(e){return{templateOptions:{placeholder:e.string.optional,secondaryPlaceholder:e.string.optional,deleteButtonLabel:e.string.optional,deleteHint:e.string.optional,onAdd:e.func.optional,onRemove:e.func.optional,onSelect:e.func.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<md-chips ng-model=model[options.key]></md-chips>"},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(21),r=n(a);t["default"]=function(e){e.setType({name:"datepicker",template:r["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,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(23),r=n(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,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(25),r=n(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,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(27),r=n(a);t["default"]=function(e){e.setType({name:"select",template:r["default"],wrapper:["label","messages","inputContainer"],defaultOptions:{ngModelAttrs:{multiple:{bound:"multiple"},onClose:{bound:"md-on-close"},onOpen:{bound:"md-on-open"}}},apiCheck:function(e){return{templateOptions:{options:e.arrayOf(e.object),multiple:e.bool.optional,labelProp:e.string.optional,valueProp:e.string.optional,onClose:e.func.optional,onOpen:e.func.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,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(29),r=n(a);t["default"]=function(e){e.setType({name:"slider",template:r["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,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(31),r=n(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,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(33),r=n(a);t["default"]=function(e){e.setType({name:"textarea",template:r["default"],wrapper:["label","messages","inputContainer"],defaultOptions:{ngModelAttrs:{rows:{attribute:"rows"},cols:{attribute:"cols"}},templateOptions:{grow:!0}},apiCheck:function(e){return{templateOptions:{rows:e.number.optional,cols:e.number.optional,grow:e.bool.optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<textarea ng-model=model[options.key]></textarea>"}])});
/*! angular-formly-material JavaScript Library v0.12.0 | MIT | built with ♥ by Kamil Kisiela <mys.sterowiec@gmail.com> */
!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 r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.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 r=n(1),a=o(r),u=n(2),l=o(u),i=n(5),d=o(i),s=n(14),p=o(s),f="formlyMaterial";a["default"].module(f,["ngMessages","ngMaterial","formly"]).config(["formlyConfigProvider",function(e){var t=[l["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 r=n(3),a=o(r);t["default"]=[a["default"]],e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(4);t["default"]=function(e){e.templateManipulators.preWrapper.push(function(e,t){return"undefined"!=typeof t.templateOptions.theme?(0,o.ngModelAttrsManipulator)(e,t,"md-theme",t.templateOptions.theme):e})},e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function r(e,t,n){d["default"].forEach(e,function(e){e.getAttribute(t)||e.setAttribute(t,n)})}function a(e){var t="[ng-model], [data-ng-model]";return e.querySelectorAll(t)}function u(e,t,n,o){var u=document.createElement("div"),l=t.extras&&t.extras.skipNgModelAttrsManipulator;if(l===!0)return e;u.innerHTML=e;var i=a(u);return i&&i.length?(r(i,n,o),u.innerHTML):e}function l(e,t,n,o){return(e||[]).forEach(function(e){t(e)===!0&&(e.ngModelAttrs||(e.ngModelAttrs={}),"undefined"!=typeof e.templateOptions[n]&&(e.ngModelAttrs[n]=o))}),e}Object.defineProperty(t,"__esModule",{value:!0}),t.ngModelAttrsManipulator=u,t.ngModelAttrsTransformer=l;var i=n(1),d=o(i)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),a=o(r),u=n(8),l=o(u),i=n(10),d=o(i),s=n(12),p=o(s);t["default"]=[a["default"],l["default"],d["default"],p["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 r=n(7),a=o(r);t["default"]=function(e){e.setWrapper({template:a["default"],name:"inputContainer"})},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 r=n(9),a=o(r);t["default"]=function(e){e.setWrapper({template:a["default"],name:"label",apiCheck:function(e){return{templateOptions:{label:e.string}}}})},e.exports=t["default"]},function(e,t){e.exports="<label for={{id}}>{{to.label}}</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 r=n(11),a=o(r);t["default"]=function(e){e.setWrapper({template:a["default"],name:"messages"})},e.exports=t["default"]},function(e,t){e.exports='<formly-transclude></formly-transclude><div ng-messages=fc.$error ng-show=showError><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 r=n(13),a=o(r);t["default"]=function(e){e.setWrapper({template:a["default"],name:"divider",apiCheck:function(e){return{templateOptions:{divider:e.oneOf(["before","after"]).optional}}}})},e.exports=t["default"]},function(e,t){e.exports="<md-divider ng-if=\"to.divider === 'before'\"></md-divider><formly-transclude></formly-transclude><md-divider ng-if=\"to.divider !== 'before'\"></md-divider>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(15),a=o(r),u=n(17),l=o(u),i=n(19),d=o(i),s=n(21),p=o(s),f=n(23),c=o(f),m=n(25),b=o(m),g=n(27),v=o(g),_=n(29),y=o(_),M=n(31),x=o(M);t["default"]=[a["default"],l["default"],d["default"],p["default"],c["default"],b["default"],v["default"],y["default"],x["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 r=n(16),a=o(r);t["default"]=function(e){e.setType({template:a["default"],name:"checkbox"})},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 r=n(18),a=o(r);t["default"]=function(e){e.setType({template:a["default"],name:"chips",defaultOptions:{defaultValue:[],ngModelAttrs:{placeholder:{attribute:"placeholder"},secondaryPlaceholder:{attribute:"secondary-placeholder"},deleteButtonLabel:{attribute:"delete-button-label"},deleteHint:{attribute:"delete-hint"},onAdd:{bound:"md-on-add"},onRemove:{bound:"md-on-remove"},onSelect:{bound:"md-on-select"}}},apiCheck:function(e){return{templateOptions:{placeholder:e.string.optional,secondaryPlaceholder:e.string.optional,deleteButtonLabel:e.string.optional,deleteHint:e.string.optional,onAdd:e.func.optional,onRemove:e.func.optional,onSelect:e.func.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 r=n(20),a=o(r);t["default"]=function(e){e.setType({template:a["default"],name:"datepicker",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 r=n(22),a=o(r),u=n(4);t["default"]=function(e){e.setType({template:a["default"],name:"input",wrapper:["label","messages","inputContainer"],defaultOptions:{templateOptions:{type:"text"},ngModelAttrs:{mdMaxlength:{bound:"md-maxlength"}}},apiCheck:function(e){return{templateOptions:{type:e.string,step:e.number.optional}}}}),e.extras.fieldTransform.push(function(e){return(0,u.ngModelAttrsTransformer)(e,function(e){return"input"===e.type&&"number"===e.templateOptions.type},"step",{attribute:"step"})})},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 r=n(24),a=o(r);t["default"]=function(e){e.setType({template:a["default"],name:"radio",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 r=n(26),a=o(r);t["default"]=function(e){e.setType({template:a["default"],name:"select",wrapper:["label","messages","inputContainer"],defaultOptions:{ngModelAttrs:{multiple:{bound:"multiple"},onClose:{bound:"md-on-close"},onOpen:{bound:"md-on-open"}}},apiCheck:function(e){return{templateOptions:{options:e.arrayOf(e.object),multiple:e.bool.optional,labelProp:e.string.optional,valueProp:e.string.optional,onClose:e.func.optional,onOpen:e.func.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 r=n(28),a=o(r);t["default"]=function(e){e.setType({template:a["default"],name:"slider",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 r=n(30),a=o(r);t["default"]=function(e){e.setType({template:a["default"],name:"switch"})},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 r=n(32),a=o(r),u=n(4);t["default"]=function(e){e.setType({template:a["default"],name:"textarea",wrapper:["label","messages","inputContainer"],defaultOptions:{ngModelAttrs:{rows:{attribute:"rows"},cols:{attribute:"cols"}},templateOptions:{grow:!0}},apiCheck:function(e){return{templateOptions:{rows:e.number.optional,cols:e.number.optional,grow:e.bool.optional}}}}),e.extras.fieldTransform.push(function(e){return(0,u.ngModelAttrsTransformer)(e,function(e){return"textarea"===e.type&&e.templateOptions.grow===!1},"grow",{attribute:"md-no-autogrow"})})},e.exports=t["default"]},function(e,t){e.exports="<textarea ng-model=model[options.key]></textarea>"}])});
//# sourceMappingURL=formly-material.min.js.map

@@ -1,6 +0,10 @@

# input
## md-input
input
=====
## Example
md-input
--------
Example
-------
```javascript

@@ -20,8 +24,16 @@ {

#### templateOptions.type _: string_
#### templateOptions.type *: string*
#### templateOptions.label _: string_
#### templateOptions.label *: string*
#### templateOptions.theme _: string_
#### templateOptions.theme *: string*
Value of md-theme directive
Value of md-theme directive
#### templateOptions.step *: number*
only if templateOptions.type is 'number'
#### templateOptions.min *: number*
#### templateOptions.max *: number*
// package metadata file for AtmosphereJS
'use strict';

@@ -7,3 +6,3 @@ Package.describe({

summary: '(official): Material design templates for angular-formly',
version: '0.11.0',
version: '0.12.0',
documentation: 'README.md',

@@ -13,16 +12,16 @@ git: 'https://github.com/formly-js/angular-formly-templates-material.git'

Package.onUse(function (api) {
Package.onUse(function formlyMaterialOnUse(api) {
var packages = {
use: [
'angular@1.0.0',
'angular:angular-messages@1.4.7',
'angular:angular-material@1.0.0',
'formly:angular-formly@7.3.9_3'
],
imply: [
'angular:angular@1.4.7',
'angular:angular-messages',
'angular:angular-material',
'formly:angular-formly'
]
use: [
'angular@1.0.0',
'angular:angular-messages@1.4.7',
'angular:angular-material@1.0.0',
'formly:angular-formly@7.3.9_3'
],
imply: [
'angular:angular@1.4.7',
'angular:angular-messages',
'angular:angular-material',
'formly:angular-formly'
]
};

@@ -29,0 +28,0 @@

{
"name": "angular-formly-material",
"version": "0.11.0",
"version": "0.12.0",
"description": "Material design templates for angular-formly",

@@ -10,2 +10,5 @@ "main": "dist/formly-material.js",

"build": "npm run build:dist & npm run build:prod",
"lint:src": "eslint src/**/*.js",
"lint:tests": "eslint tests/**/*.js --no-ignore",
"lint": "npm run lint:src & npm run lint:tests",
"coverage:codecov": "cat ./coverage/lcov.info | node_modules/.bin/codecov",

@@ -48,2 +51,3 @@ "coverage:coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",

"babel-core": "^5.0.0",
"babel-eslint": "^4.1.6",
"babel-loader": "^5.3.2",

@@ -53,2 +57,3 @@ "codacy-coverage": "^1.1.3",

"coveralls": "^2.11.4",
"eslint": "^1.10.3",
"html-loader": "^0.4.0",

@@ -65,7 +70,9 @@ "isparta": "^4.0.0",

"karma-jasmine": "^0.3.6",
"karma-jasmine-html-reporter": "^0.1.8",
"karma-sourcemap-loader": "^0.3.6",
"karma-webpack": "^1.7.0",
"lodash": "^3.10.1",
"mys-common-tools": "latest",
"webpack": "^1.12.9"
}
}
FormlyMaterial
==============
Material Design Templates for [Angular-Formly](http://angular-formly.com). Modern & flexible forms configured easily in a JSON object.
---
**Chat**
[![Join the chat at https://gitter.im/formly-js/angular-formly-templates-material](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/formly-js/angular-formly-templates-material?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
**Versions**
[![GitHub version](https://badge.fury.io/gh/formly-js%2Fangular-formly-templates-material.svg)](https://badge.fury.io/gh/formly-js%2Fangular-formly-templates-material)
[![npm version](https://badge.fury.io/js/angular-formly-material.svg)](https://badge.fury.io/js/angular-formly-material)
[![Bower version](https://badge.fury.io/bo/angular-formly-material.svg)](https://badge.fury.io/bo/angular-formly-material)
**Code**
[![Build Status](https://travis-ci.org/formly-js/angular-formly-templates-material.svg)](https://travis-ci.org/formly-js/angular-formly-templates-material)
[![Coverage Status](https://coveralls.io/repos/formly-js/angular-formly-templates-material/badge.svg?branch=master&service=github)](https://coveralls.io/github/formly-js/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)
Material Design Templates for [Angular-Formly](http://angular-formly.com). Modern & flexible forms configured easily in a JSON object.
---
Table of contents
-----------------
- [Install](#install)
- [Getting Started](#getting-started)
- [Requests?](#requests)
- [Requirements](#requirements)
- [Components](#components)
- [Fields](#fields)
- [Wrappers](#wrappers)
- [Common settings](#common-settings)
- [Theme](#theme-string)
---
Install

@@ -43,2 +68,9 @@ -------

Requests?
---------
Maybe you need some new feature? Go here:
https://github.com/formly-js/angular-formly-templates-material/issues/4
Requirements

@@ -73,6 +105,6 @@ ------------

- [input-container](docs/wrappers/input-container.md)
- [divider](docs/wrappers/divider.md)
- [inputContainer](docs/wrappers/input-container.md)
- [label](docs/wrappers/label.md)
- [messages](docs/wrappers/messages.md)
- [divider](docs/wrappers/divider.md)

@@ -82,6 +114,2 @@ Common settings

### label (string)
Text used as a field's label
### theme (string)

@@ -91,21 +119,4 @@

Roadmap
-------
---
- [x] add md-chips
- [x] add md-datepicker
- [ ] add md-icon wrapper
- [x] add md-slider with min, max, step and discrete options
- [x] add md-select
- [x] multiple in md-select
- [ ] add groups to md-select
- [x] add valueProp, labelProp to md-select
- [x] add md-radio with valueProp and labelProp
- [x] add textarea with cols and rows
- [x] md-theme
- [x] add md-on-close and md-on-open to md-select
- [x] add divider wrapper (md-divider)
- [x] add md-no-autogrow to textare
- [ ] e2e tests
Requests (?). Post an issue.
import angular from 'angular';
/**
* Sets attribute with optional value.
* Does not owerwrite.
* @param {Array} nodes nodes
* @param {String} attr attribute name
* @param {String} val atrtibute value
*/
function addIfNotPresent(nodes, attr, val) {

@@ -11,8 +18,22 @@ angular.forEach(nodes, (node) => {

/**
* Gets all ngModels from node
*/
function getNgModelNodes(node) {
const query = "[ng-model], [data-ng-model]";
const query = '[ng-model], [data-ng-model]';
return node.querySelectorAll(query)
return node.querySelectorAll(query);
}
/**
* Adds attribute with optional value to all elements using ngModel directive.
* Handles extras.skipNgModelAttrsManipulator
* And does not overwrite attriutes
*
* @param {String} template Template provided by formly template manipulator
* @param {Object} options Options provided by formly template manipulator
* @param {String} attrName Attribute's name
* @param {String|undefined} Attribute's value (optional)
* @return {String} result
*/
export function ngModelAttrsManipulator(template, options, attrName, attrValue) {

@@ -23,3 +44,3 @@ const node = document.createElement('div');

if (skip === true) {
return template
return template;
}

@@ -37,1 +58,25 @@ node.innerHTML = template;

}
/**
* Adds ngModelAttr to the field when specified condition is true.
* @param {Array} fields fields provided by formly's fieldTranform
* @param {Funcion} condition with field as only parameter
* @param {String} name ngModelAttr's name
* @param {Object} settings ngModelAttr's settings
* @return {Array} returns fields
*/
export function ngModelAttrsTransformer(fields, condition, name, settings) {
(fields || []).forEach((field) => {
if (condition(field) === true) {
if (!field.ngModelAttrs) {
field.ngModelAttrs = {};
}
if (typeof field.templateOptions[name] !== 'undefined') {
field.ngModelAttrs[name] = settings;
}
}
});
return fields;
}

@@ -9,7 +9,3 @@ import angular from 'angular';

angular.module(ngModuleName, [
'ngMessages',
'ngMaterial',
'formly'
])
angular.module(ngModuleName, ['ngMessages', 'ngMaterial', 'formly'])
.config(['formlyConfigProvider', (formlyConfigProvider) => {

@@ -16,0 +12,0 @@ const configs = [runs, wrappers, types];

@@ -1,4 +0,3 @@

import mdThemeManipulator from './md-theme-manipulator';
import mdNoAutogrow from './md-no-autogrow';
import theme from './theme';
export default [mdThemeManipulator, mdNoAutogrow];
export default [theme];

@@ -5,5 +5,5 @@ import template from './checkbox.html';

formlyConfigProvider.setType({
name: 'checkbox',
template: template
template,
name: 'checkbox'
});
}
};

@@ -5,4 +5,4 @@ import template from './chips.html';

formlyConfigProvider.setType({
template,
name: 'chips',
template: template,
defaultOptions: {

@@ -46,2 +46,2 @@ defaultValue: [],

});
}
};

@@ -5,4 +5,4 @@ import template from './datepicker.html';

formlyConfigProvider.setType({
template,
name: 'datepicker',
template: template,
wrapper: ['messages'],

@@ -34,2 +34,2 @@ defaultOptions: {

});
}
};
import template from './input.html';
import { ngModelAttrsTransformer } from './../../helpers';
export default (formlyConfigProvider) => {
formlyConfigProvider.setType({
template,
name: 'input',
template: template,
wrapper: ['label', 'messages', 'inputContainer'],
defaultOptions: {
templateOptions: {
type: 'text'
},
ngModelAttrs: {

@@ -14,4 +18,22 @@ mdMaxlength: {

}
},
apiCheck: (check) => {
return {
templateOptions: {
type: check.string,
step: check.number.optional
}
};
}
});
}
// add only step attribute because min and max are both built-in
formlyConfigProvider.extras.fieldTransform.push((fields) => {
return ngModelAttrsTransformer(fields, (field) => (
field.type === 'input' &&
field.templateOptions.type === 'number'
), 'step', {
attribute: 'step'
});
});
};

@@ -5,4 +5,4 @@ import template from './radio.html';

formlyConfigProvider.setType({
template,
name: 'radio',
template: template,
apiCheck: (check) => ({

@@ -16,2 +16,2 @@ templateOptions: {

});
}
};

@@ -5,4 +5,4 @@ import template from './select.html';

formlyConfigProvider.setType({
template,
name: 'select',
template: template,
wrapper: ['label', 'messages', 'inputContainer'],

@@ -33,2 +33,2 @@ defaultOptions: {

});
}
};

@@ -5,4 +5,4 @@ import template from './slider.html';

formlyConfigProvider.setType({
template,
name: 'slider',
template: template,
defaultOptions: {

@@ -33,2 +33,2 @@ ngModelAttrs: {

});
}
};

@@ -5,5 +5,5 @@ import template from './switch.html';

formlyConfigProvider.setType({
name: 'switch',
template: template
template,
name: 'switch'
});
}
};
import template from './textarea.html';
import { ngModelAttrsTransformer } from './../../helpers';
export default (formlyConfigProvider) => {
formlyConfigProvider.setType({
template,
name: 'textarea',
template: template,
wrapper: ['label', 'messages', 'inputContainer'],

@@ -29,2 +30,11 @@ defaultOptions: {

});
}
formlyConfigProvider.extras.fieldTransform.push((fields) => {
return ngModelAttrsTransformer(fields, (field) => (
field.type === 'textarea' &&
field.templateOptions.grow === false
), 'grow', {
attribute: 'md-no-autogrow'
});
});
};

@@ -5,4 +5,4 @@ import template from './divider.html';

formlyConfigProvider.setWrapper({
template,
name: 'divider',
template: template,
apiCheck: (check) => ({

@@ -14,2 +14,2 @@ templateOptions: {

});
}
};

@@ -5,5 +5,5 @@ import template from './input-container.html';

formlyConfigProvider.setWrapper({
name: 'inputContainer',
template: template
template,
name: 'inputContainer'
});
}
};

@@ -5,4 +5,4 @@ import template from './label.html';

formlyConfigProvider.setWrapper({
template,
name: 'label',
template: template,
apiCheck: (check) => ({

@@ -14,2 +14,2 @@ templateOptions: {

});
}
};

@@ -5,5 +5,5 @@ import template from './messages.html';

formlyConfigProvider.setWrapper({
name: 'messages',
template: template
template,
name: 'messages'
});
}
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc