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

Commit 9e0a0ef

Browse files
author
Kamil Kisiela
committed
Merge branch 'release/v0.3.0'
2 parents 6d98df8 + c5e1333 commit 9e0a0ef

File tree

10 files changed

+377
-17
lines changed

10 files changed

+377
-17
lines changed

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.meteor
2+
tests
3+
**/tests
4+
5+
**/*.md
6+
**/*.html
7+
**/*.css
8+
**/*.json
9+
**/*.yaml
10+
**/*.yml

.eslintrc

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "eslint:recommended",
4+
"env": {
5+
"browser": true,
6+
"node": true,
7+
"meteor": true,
8+
"mongo": true,
9+
"jasmine": true,
10+
"es6": true
11+
},
12+
"globals": {
13+
// thrid-party packages globals
14+
"angular2now": false,
15+
"angular": false
16+
},
17+
"rules": {
18+
"no-unused-vars": [
19+
1,
20+
{
21+
"vars": "all",
22+
"args": "after-used"
23+
}
24+
],
25+
"curly": 2,
26+
// Require Following Curly Brace Conventions
27+
"eqeqeq": 2,
28+
// Require === and !==
29+
"no-alert": 2,
30+
// Disallow Use of Alert
31+
"no-caller": 2,
32+
// Disallow Use of caller/callee
33+
"no-else-return": 2,
34+
// Disallow return in else
35+
"no-eval": 2,
36+
// Disallow eval()
37+
"no-implied-eval": 2,
38+
// Disallow Implied eval()
39+
"no-labels": 2,
40+
// Disallow use of labeled statements
41+
"no-lone-blocks": 2,
42+
// Disallow Unnecessary Nested Blocks
43+
"no-loop-func": 2,
44+
// Disallow Functions in Loops
45+
"no-magic-numbers": 1,
46+
// Disallow Magic Numbers
47+
"no-multi-spaces": 2,
48+
// Disallow multiple spaces
49+
"no-native-reassign": 2,
50+
// Disallow Reassignment of Native Objects
51+
"no-new-func": 2,
52+
// Disallow Function Constructor
53+
"no-new-wrappers": 2,
54+
// Disallow Primitive Wrapper Instances
55+
"no-new": 2,
56+
// Disallow new For Side Effects
57+
"no-param-reassign": 2,
58+
// Disallow Reassignment of Function Parameters
59+
"no-proto": 2,
60+
// Disallow Use of __proto__
61+
"no-return-assign": 2,
62+
// Disallow Assignment in return Statement
63+
"no-script-url": 2,
64+
// Disallow use of javascript: urls
65+
"no-self-compare": 2,
66+
// Disallow comparisons where both sides are exactly the same
67+
"no-throw-literal": 2,
68+
// Restrict what can be thrown as an exception
69+
"no-unused-expressions": 2,
70+
// Disallow usage of expressions in statement position
71+
"no-useless-call": 2,
72+
// Disallow unnecessary .call() and .apply()
73+
"no-useless-concat": 2,
74+
// Disallow unnecessary concatenation of literals or template literals
75+
"no-void": 2,
76+
// Disallow use of the void operator
77+
"no-with": 2,
78+
// No with statements
79+
"vars-on-top": 2,
80+
// Require Variable Declarations to be at the top of their scope
81+
"wrap-iife": 2,
82+
// Require immediate function invocation to be wrapped in parentheses
83+
"array-bracket-spacing": [
84+
2,
85+
"never"
86+
],
87+
// Disallow or enforce spaces inside of brackets
88+
"block-spacing": [
89+
2,
90+
"always"
91+
],
92+
// Disallow or enforce spaces inside of single line blocks
93+
"camelcase": [
94+
2,
95+
{
96+
"properties": "always"
97+
}
98+
],
99+
// Require Camelcase
100+
"comma-spacing": [
101+
2,
102+
{
103+
"before": false,
104+
"after": true
105+
}
106+
],
107+
// Enforces spacing around commas
108+
"computed-property-spacing": [
109+
2,
110+
"never"
111+
],
112+
// Disallow or enforce spaces inside of computed properties
113+
"consistent-this": [
114+
2,
115+
"self"
116+
],
117+
// Require Consistent This
118+
"max-nested-callbacks": [
119+
2,
120+
3
121+
],
122+
// Set Maximum Depth of Nested Callbacks
123+
"new-parens": 2,
124+
// Require Parens for Constructors
125+
"newline-after-var": 2,
126+
// Require or disallow an empty newline after variable declarations
127+
"no-array-constructor": 2,
128+
// Disallow creation of dense arrays using the Array constructor
129+
"no-inline-comments": 2,
130+
// Disallows comments after code. Comments must come on their own lines
131+
"no-multiple-empty-lines": [
132+
2,
133+
{
134+
"max": 2
135+
}
136+
],
137+
// Disallows multiple blank lines
138+
"no-nested-ternary": 2,
139+
// Disallow Nested Ternaries
140+
"no-new-object": 2,
141+
// Disallow the use of the Object constructor
142+
"no-unneeded-ternary": 2,
143+
// Disallow conditional expressions that can be expressed with simpler constructs
144+
"object-curly-spacing": [
145+
2,
146+
"never"
147+
],
148+
// Disallow or enforce spaces inside of curly braces in objects.
149+
"one-var": [
150+
2,
151+
"never"
152+
],
153+
// Require or Disallow One Variable Declaration per Scope
154+
"wrap-regex": 2,
155+
// Require Regex Literals to be Wrapped
156+
"arrow-parens": [
157+
2,
158+
"always"
159+
],
160+
// Require parens in arrow function arguments
161+
"constructor-super": 2,
162+
// Verify calls of super() in constructors
163+
"no-class-assign": 2,
164+
// Disallow modifying variables of class declarations
165+
"no-const-assign": 2,
166+
// Disallow modifying variables that are declared using const
167+
"no-dupe-class-members": 2,
168+
// Disallow duplicate name in class members
169+
"no-this-before-super": 2,
170+
// Disallow use of this/super before calling super() in constructors
171+
}
172+
}

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
node_js:
3+
- "0.12"
4+
before_install:
5+
- "curl -L https://raw.githubusercontent.com/arunoda/travis-ci-meteor-packages/master/configure.sh | /bin/sh"
6+
- "npm install -g velocity-cli"
7+
before_script:
8+
- "export PATH=$HOME/.meteor:$PATH"
9+
script:
10+
- "velocity test-package ./ --ci"

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
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.3.0] - 2015-11-17
6+
### Added
7+
- datepicker with date range and filtering _(currently in angular-material 1.0_RC4)_
8+
- Tests of formlyMaterial provider
9+
510
## [0.2.0] - 2015-11-17
611
### Added
712
- Support for textarea with cols and rows
@@ -37,6 +42,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3742

3843
## 0.0.1 - 2015-11-06
3944

45+
[0.3.0]: https://github.com/kamilkisiela/meteor-angular-formly-templates-material/compare/v0.2.0...v0.3.0
4046
[0.2.0]: https://github.com/kamilkisiela/meteor-angular-formly-templates-material/compare/v0.1.0...v0.2.0
4147
[0.1.0]: https://github.com/kamilkisiela/meteor-angular-formly-templates-material/compare/v0.0.4...v0.1.0
4248
[0.0.4]: https://github.com/kamilkisiela/meteor-angular-formly-templates-material/compare/v0.0.3...v0.0.4

README.md

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FormlyMaterial
22
==========
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)
5+
[![Build Status](https://travis-ci.org/wieldo/angular-formly-templates-material.svg)](https://travis-ci.org/wieldo/angular-formly-templates-material)
56
[![Codacy Badge](https://api.codacy.com/project/badge/grade/a2cd4c7c2d74467281e309a65be49e8f)](https://www.codacy.com/app/mys-sterowiec/angular-formly-templates-material)
67

78
Material Design Templates for [Angular-Formly](http://angular-formly.com). Modern & flexible forms configured easily in a JSON object.
@@ -34,15 +35,13 @@ Any requests? Add issue!
3435

3536
### theme (string)
3637

37-
```
3838
md-theme attribute
39-
```
4039

4140
## Fields
4241

4342
### input
4443

45-
```json
44+
```javascript
4645
{
4746
"type": "input",
4847
"key": "firstName",
@@ -58,7 +57,7 @@ md-theme attribute
5857

5958
**rows (number, optional)**
6059

61-
```json
60+
```javascript
6261
{
6362
"type": "textarea",
6463
"key": "bio",
@@ -78,7 +77,7 @@ md-theme attribute
7877

7978
**valueProp (string, optional)**
8079

81-
```json
80+
```javascript
8281
{
8382
"type": "radio",
8483
"key": "name",
@@ -104,7 +103,7 @@ md-theme attribute
104103

105104
**valueProp (string, optional)**
106105

107-
```json
106+
```javascript
108107
{
109108
"type": "select",
110109
"key": "name",
@@ -124,7 +123,7 @@ md-theme attribute
124123

125124
### checkbox
126125

127-
```json
126+
```javascript
128127
{
129128
"type": "checkbox",
130129
"key": "terms",
@@ -137,7 +136,7 @@ md-theme attribute
137136

138137
### switch
139138

140-
```json
139+
```javascript
141140
{
142141
"type": "switch",
143142
"key": "terms",
@@ -148,6 +147,42 @@ md-theme attribute
148147
}
149148
```
150149

150+
### datepicker
151+
152+
**placeholder (string, optional)**
153+
154+
md-placeholder
155+
156+
**minDate (Date, optional)**
157+
158+
md-min-date
159+
160+
**maxDate (Date, optional)**
161+
162+
md-max-date
163+
164+
**filterDate (function, optional)**
165+
166+
md-filter-date
167+
168+
```javascript
169+
{
170+
"type": "datepicker",
171+
"key": "start",
172+
"templateOptions": {
173+
"theme": "custom",
174+
"placeholder": "Start date",
175+
"minDate": minDate, // instance of Date
176+
"maxDate": maxDate, // instance of Date
177+
"filterDate": function(date) {
178+
// only weekends
179+
var day = date.getDay();
180+
return day === 0 || day === 6;
181+
}
182+
}
183+
}
184+
```
185+
151186
## Wrappers
152187

153188
- mdInputContainer
@@ -157,7 +192,7 @@ md-theme attribute
157192
## Roadmap
158193

159194
- [ ] add md-chips
160-
- [ ] add md-datepicker
195+
- [x] add md-datepicker
161196
- [ ] add md-icon wrapper
162197
- [x] add md-select
163198
- [ ] add groups to md-select

lib/client/run/md-theme-manipulator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SetModule('formlyMaterial')
44
.config((formlyConfigProvider) => {
55

66
const addIfNotPresent = (nodes, attr, val) => {
7-
angular.forEach(nodes, node => {
7+
angular.forEach((nodes, node) => {
88
if (!node.getAttribute(attr)) {
99
node.setAttribute(attr, val)
1010
}
@@ -52,10 +52,11 @@ SetModule('formlyMaterial')
5252
return matchingNgModelNodes
5353
};
5454

55-
formlyConfigProvider.templateManipulators.preWrapper.push((template, options, scope) => {
55+
formlyConfigProvider.templateManipulators.preWrapper.push((template, options) => {
5656
if (angular.isDefined(options.templateOptions.theme)) {
5757
const node = document.createElement('div');
5858
const skip = options.extras && options.extras.skipNgModelAttrsManipulator;
59+
5960
if (skip === true) {
6061
return template
6162
}
@@ -70,9 +71,8 @@ SetModule('formlyMaterial')
7071

7172
return node.innerHTML;
7273

73-
} else {
74-
return template;
7574
}
75+
return template;
7676
});
7777

7878
});

0 commit comments

Comments
 (0)