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,25 @@
|
|
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
|
+
<meta charset="UTF-8">
|
14
|
+
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
15
|
+
<title>gold-phone-input tests</title>
|
16
|
+
<script src="../../web-component-tester/browser.js"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script>
|
20
|
+
WCT.loadSuites([
|
21
|
+
'basic.html'
|
22
|
+
]);
|
23
|
+
</script>
|
24
|
+
</body>
|
25
|
+
</html>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"name": "gold-zip-input",
|
3
|
+
"version": "1.0.1",
|
4
|
+
"description": "An input field for a zip code",
|
5
|
+
"authors": [
|
6
|
+
"The Polymer Authors"
|
7
|
+
],
|
8
|
+
"keywords": [
|
9
|
+
"web-components",
|
10
|
+
"polymer",
|
11
|
+
"gold",
|
12
|
+
"input"
|
13
|
+
],
|
14
|
+
"main": [
|
15
|
+
"gold-zip-input.html"
|
16
|
+
],
|
17
|
+
"private": true,
|
18
|
+
"repository": {
|
19
|
+
"type": "git",
|
20
|
+
"url": "git://github.com/PolymerElements/gold-zip-input.git"
|
21
|
+
},
|
22
|
+
"license": "http://polymer.github.io/LICENSE.txt",
|
23
|
+
"homepage": "https://github.com/PolymerElements/gold-zip-input",
|
24
|
+
"ignore": [],
|
25
|
+
"dependencies": {
|
26
|
+
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
|
27
|
+
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",
|
28
|
+
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
|
29
|
+
"paper-input": "PolymerElements/paper-input#^1.0.0",
|
30
|
+
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
31
|
+
"polymer": "Polymer/polymer#^1.0.0"
|
32
|
+
},
|
33
|
+
"devDependencies": {
|
34
|
+
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
35
|
+
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
|
36
|
+
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
37
|
+
"web-component-tester": "*",
|
38
|
+
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,54 @@
|
|
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>gold-zip-input demo</title>
|
19
|
+
|
20
|
+
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
21
|
+
<link rel="import" href="../gold-zip-input.html">
|
22
|
+
|
23
|
+
<link rel="stylesheet" href="../../paper-styles/paper-styles.html">
|
24
|
+
<link rel="import" href="../../paper-styles/demo-pages.html">
|
25
|
+
</head>
|
26
|
+
<style>
|
27
|
+
gold-zip-input {
|
28
|
+
width: 200px;
|
29
|
+
margin-left: auto;
|
30
|
+
margin-right: auto;
|
31
|
+
}
|
32
|
+
</style>
|
33
|
+
<body>
|
34
|
+
|
35
|
+
<div class="vertical-section-container centered">
|
36
|
+
<h4>Standard</h4>
|
37
|
+
<div class="vertical-section">
|
38
|
+
<gold-zip-input></gold-zip-input>
|
39
|
+
<gold-zip-input label="Auto-validating" auto-validate></gold-zip-input>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<h4>Pre-validated</h4>
|
43
|
+
<div class="vertical-section">
|
44
|
+
<gold-zip-input auto-validate value="90210"></gold-zip-input>
|
45
|
+
<gold-zip-input auto-validate value="90210-9999"></gold-zip-input>
|
46
|
+
<gold-zip-input auto-validate value="123"></gold-zip-input>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<h4>Custom error message</h4>
|
50
|
+
<div class="vertical-section">
|
51
|
+
<gold-zip-input required auto-validate error-message="Please enter a valid US zip code" label="Zippety Zip"></gold-zip-input>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
</body>
|
@@ -0,0 +1,113 @@
|
|
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="../paper-input/paper-input-behavior.html">
|
12
|
+
<link rel="import" href="../paper-input/paper-input-container.html">
|
13
|
+
<link rel="import" href="../paper-input/paper-input-error.html">
|
14
|
+
<link rel="import" href="../iron-input/iron-input.html">
|
15
|
+
<link rel="import" href="../iron-form-element-behavior/iron-form-element-behavior.html">
|
16
|
+
<link rel="import" href="zip-validator.html">
|
17
|
+
|
18
|
+
<!--
|
19
|
+
`gold-zip-input` is a single-line text field with Material Design styling
|
20
|
+
for entering a US zip code.
|
21
|
+
|
22
|
+
<gold-zip-input></gold-zip-input>
|
23
|
+
|
24
|
+
It may include an optional label, which by default is "Zip Code".
|
25
|
+
|
26
|
+
<gold-zip-input label="Mailing zip code"></gold-zip-input>
|
27
|
+
|
28
|
+
### Validation
|
29
|
+
|
30
|
+
The input supports both 5 digit zip codes (90210) or the full 9 digit ones,
|
31
|
+
separated by a dash (90210-9999).
|
32
|
+
|
33
|
+
The input can be automatically validated as the user is typing by using
|
34
|
+
the `auto-validate` and `required` attributes. For manual validation, the
|
35
|
+
element also has a `validate()` method, which returns the validity of the
|
36
|
+
input as well sets any appropriate error messages and styles.
|
37
|
+
|
38
|
+
See `Polymer.PaperInputBehavior` for more API docs.
|
39
|
+
|
40
|
+
### Styling
|
41
|
+
|
42
|
+
See `Polymer.PaperInputContainer` for a list of custom properties used to
|
43
|
+
style this element.
|
44
|
+
|
45
|
+
@group Gold Elements
|
46
|
+
@hero hero.svg
|
47
|
+
@demo demo/index.html
|
48
|
+
@class gold-zip-input
|
49
|
+
-->
|
50
|
+
|
51
|
+
<dom-module id="gold-zip-input">
|
52
|
+
<style>
|
53
|
+
:host {
|
54
|
+
display: block;
|
55
|
+
}
|
56
|
+
</style>
|
57
|
+
|
58
|
+
<template>
|
59
|
+
|
60
|
+
<paper-input-container id="container"
|
61
|
+
auto-validate="[[autoValidate]]"
|
62
|
+
attr-for-value="bind-value">
|
63
|
+
|
64
|
+
<label hidden$="[[!label]]">[[label]]</label>
|
65
|
+
|
66
|
+
<zip-validator></zip-validator>
|
67
|
+
|
68
|
+
<input is="iron-input" id="input"
|
69
|
+
aria-labelledby$="[[_ariaLabelledBy]]"
|
70
|
+
aria-describedby$="[[_ariaDescribedBy]]"
|
71
|
+
required$="[[required]]"
|
72
|
+
validator="zip-validator"
|
73
|
+
type="tel"
|
74
|
+
maxlength="10"
|
75
|
+
bind-value="{{value}}"
|
76
|
+
autocomplete="postal-code"
|
77
|
+
name$="[[name]]">
|
78
|
+
|
79
|
+
<template is="dom-if" if="[[errorMessage]]">
|
80
|
+
<paper-input-error id="error">[[errorMessage]]</paper-input-error>
|
81
|
+
</template>
|
82
|
+
|
83
|
+
</paper-input-container>
|
84
|
+
</template>
|
85
|
+
|
86
|
+
</dom-module>
|
87
|
+
|
88
|
+
<script>
|
89
|
+
(function() {
|
90
|
+
Polymer({
|
91
|
+
|
92
|
+
is: 'gold-zip-input',
|
93
|
+
|
94
|
+
behaviors: [
|
95
|
+
Polymer.PaperInputBehavior,
|
96
|
+
Polymer.IronFormElementBehavior
|
97
|
+
],
|
98
|
+
|
99
|
+
properties: {
|
100
|
+
/**
|
101
|
+
* The label for this input.
|
102
|
+
*/
|
103
|
+
label: {
|
104
|
+
type: String,
|
105
|
+
value: "Zip Code"
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
109
|
+
})
|
110
|
+
|
111
|
+
})();
|
112
|
+
|
113
|
+
</script>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
5
|
+
viewBox="0 0 225 126" enable-background="new 0 0 225 126" xml:space="preserve">
|
6
|
+
<g id="background" display="none">
|
7
|
+
<rect display="inline" fill="#B0BEC5" width="225" height="126"/>
|
8
|
+
</g>
|
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.3,0.1,0.6,0.4,0.9,0.6c0.2,0.3,0.4,0.6,0.5,1s0.2,0.8,0.2,1.3c0,0.4-0.1,0.9-0.2,1.2c-0.1,0.4-0.3,0.7-0.5,1
|
32
|
+
c-0.2,0.3-0.5,0.5-0.9,0.6s-0.8,0.2-1.3,0.2c-0.4,0-0.7-0.1-1.1-0.2c-0.3-0.1-0.6-0.3-0.9-0.5s-0.5-0.5-0.6-0.8s-0.3-0.7-0.3-1.1
|
33
|
+
h1.2c0.1,0.5,0.3,0.9,0.6,1.2c0.3,0.3,0.7,0.4,1.2,0.4c0.3,0,0.5,0,0.7-0.1c0.2-0.1,0.4-0.2,0.5-0.4s0.2-0.4,0.3-0.6
|
34
|
+
c0.1-0.3,0.1-0.5,0.1-0.8c0-0.3,0-0.5-0.1-0.8c-0.1-0.2-0.2-0.5-0.3-0.6s-0.3-0.3-0.6-0.4c-0.2-0.1-0.5-0.2-0.8-0.2
|
35
|
+
c-0.2,0-0.4,0-0.5,0c-0.1,0-0.3,0.1-0.4,0.1c-0.1,0-0.2,0.1-0.3,0.2s-0.2,0.2-0.3,0.2L123.7,58.5z"/>
|
36
|
+
</g>
|
37
|
+
<path d="M151,77H73V44h78V77z M75,75h74V46H75V75z"/>
|
38
|
+
<g id="ic_x5F_add_x0D_">
|
39
|
+
</g>
|
40
|
+
</g>
|
41
|
+
<g id="Guides">
|
42
|
+
</g>
|
43
|
+
</svg>
|
@@ -0,0 +1,28 @@
|
|
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, initial-scale=1.0">
|
16
|
+
|
17
|
+
<title>gold-zip-input</title>
|
18
|
+
|
19
|
+
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
20
|
+
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
21
|
+
|
22
|
+
</head>
|
23
|
+
<body>
|
24
|
+
|
25
|
+
<iron-component-page></iron-component-page>
|
26
|
+
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,116 @@
|
|
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>gold-zip-input 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="../../webcomponentsjs/webcomponents-lite.js"></script>
|
21
|
+
|
22
|
+
<script src="../../web-component-tester/browser.js"></script>
|
23
|
+
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
24
|
+
|
25
|
+
<script src="../../iron-test-helpers/test-helpers.js"></script>
|
26
|
+
|
27
|
+
<link rel="import" href="../../test-fixture/test-fixture.html">
|
28
|
+
<link rel="import" href="../gold-zip-input.html">
|
29
|
+
|
30
|
+
</head>
|
31
|
+
<body>
|
32
|
+
|
33
|
+
<test-fixture id="basic">
|
34
|
+
<template>
|
35
|
+
<gold-zip-input auto-validate required error-message="error"></gold-zip-input>
|
36
|
+
</template>
|
37
|
+
</test-fixture>
|
38
|
+
|
39
|
+
<script>
|
40
|
+
|
41
|
+
suite('basic', function() {
|
42
|
+
test('invalid input is not ok', function() {
|
43
|
+
var input = fixture('basic');
|
44
|
+
input.value='1234';
|
45
|
+
forceXIfStamp(input);
|
46
|
+
|
47
|
+
var container = Polymer.dom(input.root).querySelector('paper-input-container');
|
48
|
+
assert.ok(container, 'paper-input-container exists');
|
49
|
+
assert.isTrue(container.invalid);
|
50
|
+
});
|
51
|
+
|
52
|
+
test('too many dashes are not ok', function() {
|
53
|
+
var input = fixture('basic');
|
54
|
+
input.value='90210--1111';
|
55
|
+
forceXIfStamp(input);
|
56
|
+
|
57
|
+
var container = Polymer.dom(input.root).querySelector('paper-input-container');
|
58
|
+
assert.ok(container, 'paper-input-container exists');
|
59
|
+
assert.isTrue(container.invalid);
|
60
|
+
});
|
61
|
+
|
62
|
+
test('spaces instead of dashes are not ok', function() {
|
63
|
+
var input = fixture('basic');
|
64
|
+
input.value='90210 1111';
|
65
|
+
forceXIfStamp(input);
|
66
|
+
|
67
|
+
var container = Polymer.dom(input.root).querySelector('paper-input-container');
|
68
|
+
assert.ok(container, 'paper-input-container exists');
|
69
|
+
assert.isTrue(container.invalid);
|
70
|
+
});
|
71
|
+
|
72
|
+
test('short zipcodes are ok', function() {
|
73
|
+
var input = fixture('basic');
|
74
|
+
input.value='94109';
|
75
|
+
forceXIfStamp(input);
|
76
|
+
|
77
|
+
var container = Polymer.dom(input.root).querySelector('paper-input-container');
|
78
|
+
assert.ok(container, 'paper-input-container exists');
|
79
|
+
assert.isFalse(container.invalid);
|
80
|
+
});
|
81
|
+
|
82
|
+
test('full zipcodes are ok', function() {
|
83
|
+
var input = fixture('basic');
|
84
|
+
input.value='94109-1234';
|
85
|
+
forceXIfStamp(input);
|
86
|
+
|
87
|
+
var container = Polymer.dom(input.root).querySelector('paper-input-container');
|
88
|
+
assert.ok(container, 'paper-input-container exists');
|
89
|
+
assert.isFalse(container.invalid);
|
90
|
+
});
|
91
|
+
|
92
|
+
test('empty required input shows error', function() {
|
93
|
+
var input = fixture('basic');
|
94
|
+
forceXIfStamp(input);
|
95
|
+
|
96
|
+
var error = Polymer.dom(input.root).querySelector('paper-input-error');
|
97
|
+
assert.ok(error, 'paper-input-error exists');
|
98
|
+
assert.notEqual(getComputedStyle(error).display, 'none', 'error is not display:none');
|
99
|
+
});
|
100
|
+
|
101
|
+
});
|
102
|
+
|
103
|
+
suite('a11y', function() {
|
104
|
+
|
105
|
+
test('has aria-labelledby', function() {
|
106
|
+
var input = fixture('basic');
|
107
|
+
assert.isTrue(input.inputElement.hasAttribute('aria-labelledby'))
|
108
|
+
assert.equal(input.inputElement.getAttribute('aria-labelledby'), Polymer.dom(input.root).querySelector('label').id, 'aria-labelledby points to the label');
|
109
|
+
});
|
110
|
+
|
111
|
+
});
|
112
|
+
|
113
|
+
</script>
|
114
|
+
|
115
|
+
</body>
|
116
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
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
|
+
<meta charset="UTF-8">
|
14
|
+
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
15
|
+
<title>gold-zip-input tests</title>
|
16
|
+
<script src="../../web-component-tester/browser.js"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script>
|
20
|
+
WCT.loadSuites([
|
21
|
+
'basic.html'
|
22
|
+
]);
|
23
|
+
</script>
|
24
|
+
</body>
|
25
|
+
</html>
|