polymer-gold-rails 1.0.0.pre.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +36 -0
- data/Rakefile +1 -0
- data/app/assets/components/gold-cc-cvc-input/README.md +24 -0
- data/app/assets/components/gold-cc-cvc-input/bower.json +39 -0
- data/app/assets/components/gold-cc-cvc-input/cvc_hint.png +0 -0
- data/app/assets/components/gold-cc-cvc-input/cvc_hint_amex.png +0 -0
- data/app/assets/components/gold-cc-cvc-input/demo/index.html +54 -0
- data/app/assets/components/gold-cc-cvc-input/gold-cc-cvc-input.html +195 -0
- data/app/assets/components/gold-cc-cvc-input/hero.svg +36 -0
- data/app/assets/components/gold-cc-cvc-input/index.html +26 -0
- data/app/assets/components/gold-cc-cvc-input/test/basic.html +125 -0
- data/app/assets/components/gold-cc-cvc-input/test/index.html +25 -0
- data/app/assets/components/gold-cc-expiration-input/README.md +10 -0
- data/app/assets/components/gold-cc-expiration-input/bower.json +40 -0
- data/app/assets/components/gold-cc-expiration-input/date-input.html +157 -0
- data/app/assets/components/gold-cc-expiration-input/date-validator.html +38 -0
- data/app/assets/components/gold-cc-expiration-input/demo/index.html +53 -0
- data/app/assets/components/gold-cc-expiration-input/gold-cc-expiration-input.html +131 -0
- data/app/assets/components/gold-cc-expiration-input/hero.svg +58 -0
- data/app/assets/components/gold-cc-expiration-input/index.html +28 -0
- data/app/assets/components/gold-cc-expiration-input/test/basic.html +126 -0
- data/app/assets/components/gold-cc-expiration-input/test/index.html +25 -0
- data/app/assets/components/gold-cc-input/README.md +9 -0
- data/app/assets/components/gold-cc-input/bower.json +39 -0
- data/app/assets/components/gold-cc-input/cc-validator.js +192 -0
- data/app/assets/components/gold-cc-input/demo/index.html +48 -0
- data/app/assets/components/gold-cc-input/gold-cc-input.html +215 -0
- data/app/assets/components/gold-cc-input/hero.svg +52 -0
- data/app/assets/components/gold-cc-input/images/amex.png +0 -0
- data/app/assets/components/gold-cc-input/images/diners_club.png +0 -0
- data/app/assets/components/gold-cc-input/images/discover.png +0 -0
- data/app/assets/components/gold-cc-input/images/jcb.png +0 -0
- data/app/assets/components/gold-cc-input/images/mastercard.png +0 -0
- data/app/assets/components/gold-cc-input/images/visa.png +0 -0
- data/app/assets/components/gold-cc-input/index.html +28 -0
- data/app/assets/components/gold-cc-input/test/basic.html +136 -0
- data/app/assets/components/gold-cc-input/test/index.html +25 -0
- data/app/assets/components/gold-elements/README.md +12 -0
- data/app/assets/components/gold-elements/bower.json +42 -0
- data/app/assets/components/gold-elements/demo/complex-form.html +127 -0
- data/app/assets/components/gold-elements/demo/index.html +94 -0
- data/app/assets/components/gold-elements/demo/item-card.html +59 -0
- data/app/assets/components/gold-elements/demo/simple-form.css +55 -0
- data/app/assets/components/gold-elements/demo/simple-form.html +93 -0
- data/app/assets/components/gold-elements/screenshot.png +0 -0
- data/app/assets/components/gold-email-input/README.md +8 -0
- data/app/assets/components/gold-email-input/bower.json +40 -0
- data/app/assets/components/gold-email-input/demo/index.html +46 -0
- data/app/assets/components/gold-email-input/email-validator.html +31 -0
- data/app/assets/components/gold-email-input/gold-email-input.html +108 -0
- data/app/assets/components/gold-email-input/hero.svg +59 -0
- data/app/assets/components/gold-email-input/index.html +28 -0
- data/app/assets/components/gold-email-input/test/basic.html +97 -0
- data/app/assets/components/gold-email-input/test/index.html +25 -0
- data/app/assets/components/gold-phone-input/README.md +13 -0
- data/app/assets/components/gold-phone-input/bower.json +39 -0
- data/app/assets/components/gold-phone-input/demo/index.html +53 -0
- data/app/assets/components/gold-phone-input/gold-phone-input.html +197 -0
- data/app/assets/components/gold-phone-input/hero.svg +63 -0
- data/app/assets/components/gold-phone-input/index.html +28 -0
- data/app/assets/components/gold-phone-input/test/basic.html +117 -0
- data/app/assets/components/gold-phone-input/test/index.html +25 -0
- data/app/assets/components/gold-zip-input/README.md +8 -0
- data/app/assets/components/gold-zip-input/bower.json +40 -0
- data/app/assets/components/gold-zip-input/demo/index.html +54 -0
- data/app/assets/components/gold-zip-input/gold-zip-input.html +113 -0
- data/app/assets/components/gold-zip-input/hero.svg +43 -0
- data/app/assets/components/gold-zip-input/index.html +28 -0
- data/app/assets/components/gold-zip-input/test/basic.html +116 -0
- data/app/assets/components/gold-zip-input/test/index.html +25 -0
- data/app/assets/components/gold-zip-input/zip-validator.html +32 -0
- data/app/assets/components/iron-autogrow-textarea/README.md +24 -0
- data/app/assets/components/iron-autogrow-textarea/bower.json +37 -0
- data/app/assets/components/iron-autogrow-textarea/demo/index.html +81 -0
- data/app/assets/components/iron-autogrow-textarea/hero.svg +33 -0
- data/app/assets/components/iron-autogrow-textarea/index.html +30 -0
- data/app/assets/components/iron-autogrow-textarea/iron-autogrow-textarea.html +263 -0
- data/app/assets/components/iron-autogrow-textarea/test/basic.html +94 -0
- data/app/assets/components/iron-autogrow-textarea/test/index.html +25 -0
- data/app/assets/components/iron-flex-layout/README.md +4 -0
- data/app/assets/components/iron-flex-layout/bower.json +21 -0
- data/app/assets/components/iron-flex-layout/classes/iron-flex-layout.html +307 -0
- data/app/assets/components/iron-flex-layout/classes/iron-shadow-flex-layout.html +302 -0
- data/app/assets/components/iron-flex-layout/demo/index.html +40 -0
- data/app/assets/components/iron-flex-layout/demo/x-app.html +106 -0
- data/app/assets/components/iron-flex-layout/iron-flex-layout.html +313 -0
- data/app/assets/components/iron-form-element-behavior/README.md +2 -0
- data/app/assets/components/iron-form-element-behavior/bower.json +27 -0
- data/app/assets/components/iron-form-element-behavior/demo/index.html +53 -0
- data/app/assets/components/iron-form-element-behavior/demo/simple-element.html +27 -0
- data/app/assets/components/iron-form-element-behavior/demo/simple-form.html +42 -0
- data/app/assets/components/iron-form-element-behavior/index.html +30 -0
- data/app/assets/components/iron-form-element-behavior/iron-form-element-behavior.html +50 -0
- data/app/assets/components/iron-icon/README.md +56 -0
- data/app/assets/components/iron-icon/bower.json +29 -0
- data/app/assets/components/iron-icon/demo/index.html +28 -0
- data/app/assets/components/iron-icon/demo/location.png +0 -0
- data/app/assets/components/iron-icon/hero.svg +19 -0
- data/app/assets/components/iron-icon/index.html +26 -0
- data/app/assets/components/iron-icon/iron-icon.html +187 -0
- data/app/assets/components/iron-icon/test/index.html +31 -0
- data/app/assets/components/iron-icon/test/iron-icon.html +120 -0
- data/app/assets/components/iron-input/README.md +16 -0
- data/app/assets/components/iron-input/bower.json +36 -0
- data/app/assets/components/iron-input/demo/index.html +87 -0
- data/app/assets/components/iron-input/hero.svg +19 -0
- data/app/assets/components/iron-input/index.html +30 -0
- data/app/assets/components/iron-input/iron-input.html +235 -0
- data/app/assets/components/iron-input/test/index.html +24 -0
- data/app/assets/components/iron-input/test/iron-input.html +139 -0
- data/app/assets/components/iron-input/test/letters-only.html +30 -0
- data/app/assets/components/iron-meta/README.md +46 -0
- data/app/assets/components/iron-meta/bower.json +28 -0
- data/app/assets/components/iron-meta/demo/index.html +45 -0
- data/app/assets/components/iron-meta/hero.svg +33 -0
- data/app/assets/components/iron-meta/index.html +27 -0
- data/app/assets/components/iron-meta/iron-meta.html +352 -0
- data/app/assets/components/iron-meta/test/basic.html +48 -0
- data/app/assets/components/iron-meta/test/index.html +30 -0
- data/app/assets/components/iron-meta/test/iron-meta.html +186 -0
- data/app/assets/components/iron-validatable-behavior/README.md +3 -0
- data/app/assets/components/iron-validatable-behavior/bower.json +35 -0
- data/app/assets/components/iron-validatable-behavior/demo/cats-only.html +46 -0
- data/app/assets/components/iron-validatable-behavior/demo/index.html +71 -0
- data/app/assets/components/iron-validatable-behavior/demo/validatable-input.html +46 -0
- data/app/assets/components/iron-validatable-behavior/index.html +30 -0
- data/app/assets/components/iron-validatable-behavior/iron-validatable-behavior.html +101 -0
- data/app/assets/components/iron-validatable-behavior/test/index.html +35 -0
- data/app/assets/components/iron-validatable-behavior/test/iron-validatable-behavior.html +52 -0
- data/app/assets/components/iron-validatable-behavior/test/test-validatable.html +28 -0
- data/app/assets/components/iron-validator-behavior/README.md +4 -0
- data/app/assets/components/iron-validator-behavior/bower.json +34 -0
- data/app/assets/components/iron-validator-behavior/demo/cats-only.html +46 -0
- data/app/assets/components/iron-validator-behavior/demo/index.html +144 -0
- data/app/assets/components/iron-validator-behavior/index.html +30 -0
- data/app/assets/components/iron-validator-behavior/iron-validator-behavior.html +61 -0
- data/app/assets/components/iron-validator-behavior/test/index.html +34 -0
- data/app/assets/components/iron-validator-behavior/test/iron-validator-behavior.html +47 -0
- data/app/assets/components/iron-validator-behavior/test/simple-validator.html +26 -0
- data/app/assets/components/paper-input/README.md +5 -0
- data/app/assets/components/paper-input/all-imports.html +12 -0
- data/app/assets/components/paper-input/bower.json +44 -0
- data/app/assets/components/paper-input/demo/index.html +96 -0
- data/app/assets/components/paper-input/demo/ssn-input.html +94 -0
- data/app/assets/components/paper-input/demo/ssn-validator.html +31 -0
- data/app/assets/components/paper-input/hero.svg +19 -0
- data/app/assets/components/paper-input/index.html +28 -0
- data/app/assets/components/paper-input/paper-input-addon-behavior.html +47 -0
- data/app/assets/components/paper-input/paper-input-behavior.html +317 -0
- data/app/assets/components/paper-input/paper-input-char-counter.html +95 -0
- data/app/assets/components/paper-input/paper-input-container.html +495 -0
- data/app/assets/components/paper-input/paper-input-error.html +99 -0
- data/app/assets/components/paper-input/paper-input.html +126 -0
- data/app/assets/components/paper-input/paper-textarea.html +106 -0
- data/app/assets/components/paper-input/test/index.html +28 -0
- data/app/assets/components/paper-input/test/letters-only.html +30 -0
- data/app/assets/components/paper-input/test/paper-input-char-counter.html +112 -0
- data/app/assets/components/paper-input/test/paper-input-container.html +237 -0
- data/app/assets/components/paper-input/test/paper-input-error.html +60 -0
- data/app/assets/components/paper-input/test/paper-input.html +213 -0
- data/app/assets/components/paper-input/test/paper-textarea.html +169 -0
- data/app/assets/components/paper-styles/README.md +3 -0
- data/app/assets/components/paper-styles/bower.json +27 -0
- data/app/assets/components/paper-styles/classes/global.html +96 -0
- data/app/assets/components/paper-styles/classes/shadow-layout.html +302 -0
- data/app/assets/components/paper-styles/classes/shadow.html +39 -0
- data/app/assets/components/paper-styles/classes/typography.html +171 -0
- data/app/assets/components/paper-styles/color.html +333 -0
- data/app/assets/components/paper-styles/default-theme.html +39 -0
- data/app/assets/components/paper-styles/demo-pages.html +72 -0
- data/app/assets/components/paper-styles/demo.css +25 -0
- data/app/assets/components/paper-styles/paper-styles-classes.html +14 -0
- data/app/assets/components/paper-styles/paper-styles.html +17 -0
- data/app/assets/components/paper-styles/shadow.html +61 -0
- data/app/assets/components/paper-styles/typography.html +240 -0
- data/app/assets/components/polymer/LICENSE.txt +27 -0
- data/app/assets/components/polymer/bower.json +26 -0
- data/app/assets/components/polymer/build.log +27 -0
- data/app/assets/components/polymer/polymer-micro.html +523 -0
- data/app/assets/components/polymer/polymer-mini.html +1368 -0
- data/app/assets/components/polymer/polymer.html +3768 -0
- data/app/assets/components/webcomponentsjs/CustomElements.js +956 -0
- data/app/assets/components/webcomponentsjs/CustomElements.min.js +11 -0
- data/app/assets/components/webcomponentsjs/HTMLImports.js +1078 -0
- data/app/assets/components/webcomponentsjs/HTMLImports.min.js +11 -0
- data/app/assets/components/webcomponentsjs/MutationObserver.js +344 -0
- data/app/assets/components/webcomponentsjs/MutationObserver.min.js +11 -0
- data/app/assets/components/webcomponentsjs/README.md +125 -0
- data/app/assets/components/webcomponentsjs/ShadowDOM.js +4414 -0
- data/app/assets/components/webcomponentsjs/ShadowDOM.min.js +15 -0
- data/app/assets/components/webcomponentsjs/bower.json +14 -0
- data/app/assets/components/webcomponentsjs/build.log +33 -0
- data/app/assets/components/webcomponentsjs/package.json +31 -0
- data/app/assets/components/webcomponentsjs/webcomponents-lite.js +2300 -0
- data/app/assets/components/webcomponentsjs/webcomponents-lite.min.js +13 -0
- data/app/assets/components/webcomponentsjs/webcomponents.js +7112 -0
- data/app/assets/components/webcomponentsjs/webcomponents.min.js +15 -0
- data/lib/polymer-gold-rails.rb +2 -0
- data/lib/polymer-gold-rails/enigne.rb +4 -0
- data/lib/polymer-gold-rails/version.rb +3 -0
- metadata +312 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<!--
|
3
|
+
@license
|
4
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
5
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
6
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
7
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
8
|
+
Code distributed by Google as part of the polymer project is also
|
9
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
10
|
+
-->
|
11
|
+
<html>
|
12
|
+
<head>
|
13
|
+
|
14
|
+
<meta charset="utf-8">
|
15
|
+
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
16
|
+
|
17
|
+
<title>iron-validator-behavior</title>
|
18
|
+
|
19
|
+
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
20
|
+
|
21
|
+
<link rel="import" href="../polymer/polymer.html">
|
22
|
+
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
23
|
+
|
24
|
+
</head>
|
25
|
+
<body>
|
26
|
+
|
27
|
+
<iron-component-page></iron-component-page>
|
28
|
+
|
29
|
+
</body>
|
30
|
+
</html>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<!--
|
2
|
+
@license
|
3
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
4
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
5
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
6
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
7
|
+
Code distributed by Google as part of the polymer project is also
|
8
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
9
|
+
-->
|
10
|
+
|
11
|
+
<link rel="import" href="../polymer/polymer.html">
|
12
|
+
<link rel="import" href="../iron-meta/iron-meta.html">
|
13
|
+
|
14
|
+
<script>
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Use `Polymer.IronValidatorBehavior` to implement a custom input/form validator. Element
|
18
|
+
* instances implementing this behavior will be registered for use in elements that implement
|
19
|
+
* `Polymer.IronValidatableBehavior`.
|
20
|
+
*
|
21
|
+
* @demo demo/index.html
|
22
|
+
* @polymerBehavior
|
23
|
+
*/
|
24
|
+
Polymer.IronValidatorBehavior = {
|
25
|
+
|
26
|
+
properties: {
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Namespace for this validator.
|
30
|
+
*/
|
31
|
+
validatorType: {
|
32
|
+
type: String,
|
33
|
+
value: 'validator'
|
34
|
+
},
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Name for this validator, used by `Polymer.IronValidatableBehavior` to lookup this element.
|
38
|
+
*/
|
39
|
+
validatorName: {
|
40
|
+
type: String,
|
41
|
+
value: function() {
|
42
|
+
return this.is;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
},
|
47
|
+
|
48
|
+
ready: function() {
|
49
|
+
new Polymer.IronMeta({type: this.validatorType, key: this.validatorName, value: this});
|
50
|
+
},
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Implement custom validation logic in this function.
|
54
|
+
* @param {Object} values The value to validate. May be any type depending on the validation logic.
|
55
|
+
* @return {Boolean} true if `values` is valid.
|
56
|
+
*/
|
57
|
+
validate: function(values) {
|
58
|
+
}
|
59
|
+
};
|
60
|
+
|
61
|
+
</script>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<!--
|
3
|
+
@license
|
4
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
5
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
6
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
7
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
8
|
+
Code distributed by Google as part of the polymer project is also
|
9
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
10
|
+
-->
|
11
|
+
<html>
|
12
|
+
<head>
|
13
|
+
|
14
|
+
<title>paper-validator-behavior tests</title>
|
15
|
+
|
16
|
+
<meta charset="utf-8">
|
17
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
18
|
+
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
19
|
+
|
20
|
+
<script src="../../web-component-tester/browser.js"></script>
|
21
|
+
|
22
|
+
</head>
|
23
|
+
<body>
|
24
|
+
|
25
|
+
<script>
|
26
|
+
|
27
|
+
WCT.loadSuites([
|
28
|
+
'iron-validator-behavior.html'
|
29
|
+
]);
|
30
|
+
|
31
|
+
</script>
|
32
|
+
|
33
|
+
</body>
|
34
|
+
</html>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<!--
|
3
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
4
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
5
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
6
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
7
|
+
Code distributed by Google as part of the polymer project is also
|
8
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
9
|
+
-->
|
10
|
+
<html>
|
11
|
+
<head>
|
12
|
+
<meta charset="UTF-8">
|
13
|
+
<title>iron-validator-behavior basic tests</title>
|
14
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
15
|
+
|
16
|
+
<script src="../../webcomponentsjs/webcomponents.js"></script>
|
17
|
+
<script src="../../web-component-tester/browser.js"></script>
|
18
|
+
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
19
|
+
|
20
|
+
<link href="../../test-fixture/test-fixture.html" rel="import">
|
21
|
+
<link href="../../iron-meta/iron-meta.html" rel="import">
|
22
|
+
<link href="simple-validator.html" rel="import">
|
23
|
+
|
24
|
+
</head>
|
25
|
+
<body>
|
26
|
+
|
27
|
+
<test-fixture id="basic">
|
28
|
+
<template>
|
29
|
+
<simple-validator></simple-validator>
|
30
|
+
</template>
|
31
|
+
</test-fixture>
|
32
|
+
|
33
|
+
<script>
|
34
|
+
|
35
|
+
suite('basic', function() {
|
36
|
+
|
37
|
+
test('registered in <iron-meta>', function() {
|
38
|
+
fixture('basic');
|
39
|
+
assert.ok(new Polymer.IronMeta({type: 'validator'}).byKey('simple-validator'), 'simple-validator found in <iron-meta>');
|
40
|
+
});
|
41
|
+
|
42
|
+
});
|
43
|
+
|
44
|
+
</script>
|
45
|
+
|
46
|
+
</body>
|
47
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!--
|
2
|
+
@license
|
3
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
4
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
5
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
6
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
7
|
+
Code distributed by Google as part of the polymer project is also
|
8
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
9
|
+
-->
|
10
|
+
|
11
|
+
<link rel="import" href="../../polymer/polymer.html">
|
12
|
+
<link rel="import" href="../iron-validator-behavior.html">
|
13
|
+
|
14
|
+
<script>
|
15
|
+
|
16
|
+
Polymer({
|
17
|
+
|
18
|
+
is: 'simple-validator',
|
19
|
+
|
20
|
+
behaviors: [
|
21
|
+
Polymer.IronValidatorBehavior
|
22
|
+
]
|
23
|
+
|
24
|
+
});
|
25
|
+
|
26
|
+
</script>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!--
|
2
|
+
@license
|
3
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
4
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
5
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
6
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
7
|
+
Code distributed by Google as part of the polymer project is also
|
8
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
9
|
+
-->
|
10
|
+
|
11
|
+
<link rel="import" href="paper-input.html">
|
12
|
+
<link rel="import" href="paper-textarea.html">
|
@@ -0,0 +1,44 @@
|
|
1
|
+
{
|
2
|
+
"name": "paper-input",
|
3
|
+
"version": "1.0.2",
|
4
|
+
"description": "Material design text fields",
|
5
|
+
"authors": [
|
6
|
+
"The Polymer Authors"
|
7
|
+
],
|
8
|
+
"keywords": [
|
9
|
+
"web-components",
|
10
|
+
"polymer",
|
11
|
+
"input"
|
12
|
+
],
|
13
|
+
"main": [
|
14
|
+
"paper-input.html",
|
15
|
+
"paper-textarea.html",
|
16
|
+
"paper-input-behavior.html",
|
17
|
+
"paper-input-container.html",
|
18
|
+
"paper-input-error.html",
|
19
|
+
"paper-input-char-counter.html"
|
20
|
+
],
|
21
|
+
"private": true,
|
22
|
+
"repository": {
|
23
|
+
"type": "git",
|
24
|
+
"url": "git://github.com/PolymerElements/paper-input.git"
|
25
|
+
},
|
26
|
+
"license": "http://polymer.github.io/LICENSE.txt",
|
27
|
+
"homepage": "https://github.com/PolymerElements/paper-input",
|
28
|
+
"ignore": [],
|
29
|
+
"dependencies": {
|
30
|
+
"iron-input": "PolymerElements/iron-input#^1.0.0",
|
31
|
+
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",
|
32
|
+
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
33
|
+
"iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.0",
|
34
|
+
"polymer": "Polymer/polymer#^1.0.0"
|
35
|
+
},
|
36
|
+
"devDependencies": {
|
37
|
+
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
38
|
+
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
|
39
|
+
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
|
40
|
+
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
41
|
+
"web-component-tester": "*",
|
42
|
+
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
43
|
+
}
|
44
|
+
}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<!--
|
3
|
+
@license
|
4
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
5
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
6
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
7
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
8
|
+
Code distributed by Google as part of the polymer project is also
|
9
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
10
|
+
-->
|
11
|
+
<html>
|
12
|
+
<head>
|
13
|
+
|
14
|
+
<meta charset="utf-8">
|
15
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
16
|
+
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
17
|
+
|
18
|
+
<title>paper-input demo</title>
|
19
|
+
|
20
|
+
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
21
|
+
|
22
|
+
<link rel="import" href="../paper-input.html">
|
23
|
+
<link rel="import" href="../paper-input-container.html">
|
24
|
+
<link rel="import" href="../paper-input-error.html">
|
25
|
+
<link rel="import" href="../paper-input-char-counter.html">
|
26
|
+
<link rel="import" href="../paper-textarea.html">
|
27
|
+
<link rel="import" href="../../iron-input/iron-input.html">
|
28
|
+
<link rel="import" href="ssn-input.html">
|
29
|
+
|
30
|
+
<link rel="stylesheet" href="../../paper-styles/paper-styles.html">
|
31
|
+
<link rel="import" href="../../paper-styles/demo-pages.html">
|
32
|
+
|
33
|
+
<style>
|
34
|
+
body {
|
35
|
+
padding: 40px;
|
36
|
+
}
|
37
|
+
</style>
|
38
|
+
|
39
|
+
</head>
|
40
|
+
<body unresolved>
|
41
|
+
|
42
|
+
<div class="vertical center-justified layout">
|
43
|
+
<h4>Text input</h4>
|
44
|
+
<div class="vertical-section">
|
45
|
+
<paper-input label="label"></paper-input>
|
46
|
+
|
47
|
+
<paper-input label="password" type="password"></paper-input>
|
48
|
+
|
49
|
+
<paper-input no-label-float label="label (no-label-float)"></paper-input>
|
50
|
+
|
51
|
+
<paper-input label="disabled" disabled></paper-input>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<h4>Text area</h4>
|
55
|
+
<div class="vertical-section">
|
56
|
+
<paper-textarea label="textarea label"></paper-textarea>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<h4>Validation</h4>
|
60
|
+
<div class="vertical-section">
|
61
|
+
<paper-input label="only type letters (auto-validate)" auto-validate pattern="[a-zA-Z]*" error-message="letters only!"></paper-input>
|
62
|
+
|
63
|
+
<paper-input id="inputForValidation" required label="only type letters (no auto validate)" pattern="[a-zA-Z]*" error-message="letters only, required input!"></paper-input>
|
64
|
+
<br>
|
65
|
+
<button onclick="validate()">Validate!</button>
|
66
|
+
</div>
|
67
|
+
|
68
|
+
<h4>Character counter</h4>
|
69
|
+
<div class="vertical-section">
|
70
|
+
<paper-input label="label" char-counter></paper-input>
|
71
|
+
|
72
|
+
<paper-input label="at most 10 letters" char-counter auto-validate pattern="[a-zA-Z]*" maxlength="10" error-message="letters only!"></paper-input>
|
73
|
+
|
74
|
+
<paper-textarea label="textarea" char-counter></paper-textarea>
|
75
|
+
|
76
|
+
<paper-textarea label="textarea with maxlength" char-counter maxlength="10"></paper-textarea>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<h4>Complex inputs</h4>
|
80
|
+
<div class="vertical-section">
|
81
|
+
<template is="dom-bind">
|
82
|
+
<paper-input-container always-float-label auto-validate attr-for-value="value">
|
83
|
+
<label>Social Security Number</label>
|
84
|
+
<ssn-input class="paper-input-input"></ssn-input>
|
85
|
+
<paper-input-error>SSN invalid!</paper-input-error>
|
86
|
+
</paper-input-container>
|
87
|
+
</template>
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
<script>
|
91
|
+
function validate() {
|
92
|
+
document.getElementById('inputForValidation').validate();
|
93
|
+
}
|
94
|
+
</script>
|
95
|
+
</body>
|
96
|
+
</html>
|
@@ -0,0 +1,94 @@
|
|
1
|
+
<!--
|
2
|
+
@license
|
3
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
4
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
5
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
6
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
7
|
+
Code distributed by Google as part of the polymer project is also
|
8
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
9
|
+
-->
|
10
|
+
<link rel="import" href="../../polymer/polymer.html">
|
11
|
+
<link rel="import" href="../../iron-input/iron-input.html">
|
12
|
+
<link rel="import" href="ssn-validator.html">
|
13
|
+
|
14
|
+
<dom-module id="ssn-input">
|
15
|
+
|
16
|
+
<style>
|
17
|
+
|
18
|
+
:host {
|
19
|
+
display: inline-block;
|
20
|
+
}
|
21
|
+
|
22
|
+
input[is="iron-input"] {
|
23
|
+
font: inherit;
|
24
|
+
outline: none;
|
25
|
+
box-shadow: none;
|
26
|
+
border: none;
|
27
|
+
width: auto;
|
28
|
+
text-align: center;
|
29
|
+
}
|
30
|
+
|
31
|
+
</style>
|
32
|
+
|
33
|
+
<template>
|
34
|
+
|
35
|
+
<ssn-validator></ssn-validator>
|
36
|
+
|
37
|
+
<input is="iron-input" maxlength="3" bind-value="{{_ssn1}}" size="3" aria-label="First 3 digits of social security number">
|
38
|
+
-
|
39
|
+
<input is="iron-input" maxlength="2" bind-value="{{_ssn2}}" size="2" aria-label="Middle 2 digits of social security number">
|
40
|
+
-
|
41
|
+
<input is="iron-input" maxlength="4" bind-value="{{_ssn3}}" size="4" aria-label="Last 4 digits of social security number">
|
42
|
+
|
43
|
+
</template>
|
44
|
+
|
45
|
+
</dom-module>
|
46
|
+
|
47
|
+
<script>
|
48
|
+
(function() {
|
49
|
+
|
50
|
+
Polymer({
|
51
|
+
|
52
|
+
is: 'ssn-input',
|
53
|
+
|
54
|
+
behaviors: [
|
55
|
+
Polymer.IronValidatableBehavior
|
56
|
+
],
|
57
|
+
|
58
|
+
properties: {
|
59
|
+
|
60
|
+
value: {
|
61
|
+
notify: true,
|
62
|
+
type: String
|
63
|
+
},
|
64
|
+
|
65
|
+
_ssn1: {
|
66
|
+
type: String
|
67
|
+
},
|
68
|
+
|
69
|
+
_ssn2: {
|
70
|
+
type: String
|
71
|
+
},
|
72
|
+
|
73
|
+
_ssn3: {
|
74
|
+
type: String
|
75
|
+
},
|
76
|
+
|
77
|
+
validator: {
|
78
|
+
type: String,
|
79
|
+
value: 'ssn-validator'
|
80
|
+
}
|
81
|
+
|
82
|
+
},
|
83
|
+
|
84
|
+
observers: [
|
85
|
+
'_computeValue(_ssn1,_ssn2,_ssn3)'
|
86
|
+
],
|
87
|
+
|
88
|
+
_computeValue: function(ssn1, ssn2, ssn3) {
|
89
|
+
this.value = ssn1.trim() + '-' + ssn2.trim() + '-' + ssn3.trim();
|
90
|
+
}
|
91
|
+
|
92
|
+
})
|
93
|
+
})();
|
94
|
+
</script>
|