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-cc-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,12 @@
|
|
1
|
+
# gold-elements
|
2
|
+
Elements built for e-commerce-specific use-cases, like checkout flows.
|
3
|
+
|
4
|
+
Current elements include:
|
5
|
+
* `gold-cc-cvc-input`: A credit card verification input field
|
6
|
+
* `gold-cc-expiration-input`: A field for a credit card expiration date
|
7
|
+
* `gold-cc-input`: An input field for a credit card number
|
8
|
+
* `gold-email-input`: An input field for an email address
|
9
|
+
* `gold-phone-input`: An input field for a phone number
|
10
|
+
* `gold-zip-input`: An input field for a zip
|
11
|
+
|
12
|
+
![gold screen shot](/screenshot.png?raw=true)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"name": "gold-elements",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"homepage": "https://github.com/PolymerElements/gold-elements",
|
5
|
+
"authors": [
|
6
|
+
"The Polymer Authors"
|
7
|
+
],
|
8
|
+
"description": "The gold elements are built for e-commerce use-cases like checkout flows.",
|
9
|
+
"main": "gold-elements.html",
|
10
|
+
"keywords": [
|
11
|
+
"web-components",
|
12
|
+
"polymer",
|
13
|
+
"google",
|
14
|
+
"ecommerce",
|
15
|
+
"checkout"
|
16
|
+
],
|
17
|
+
"license": "http://polymer.github.io/LICENSE.txt",
|
18
|
+
"ignore": [
|
19
|
+
"**/.*",
|
20
|
+
"node_modules",
|
21
|
+
"bower_components",
|
22
|
+
"test",
|
23
|
+
"tests"
|
24
|
+
],
|
25
|
+
"dependencies": {
|
26
|
+
"gold-cc-cvc-input": "PolymerElements/gold-cc-cvc-input#^1.0.0",
|
27
|
+
"gold-cc-expiration-input": "PolymerElements/gold-cc-expiration-input#^1.0.0",
|
28
|
+
"gold-cc-input": "PolymerElements/gold-cc-input#^1.0.0",
|
29
|
+
"gold-email-input": "PolymerElements/gold-email-input#^1.0.0",
|
30
|
+
"gold-phone-input": "PolymerElements/gold-phone-input#^1.0.0",
|
31
|
+
"gold-zip-input": "PolymerElements/gold-zip-input#^1.0.0"
|
32
|
+
},
|
33
|
+
"devDependencies": {
|
34
|
+
"polymer": "Polymer/polymer#^1.0.0",
|
35
|
+
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
36
|
+
"paper-button": "PolymerElements/paper-button#^1.0.0",
|
37
|
+
"paper-dialog": "PolymerElements/paper-dialog#^1.0.0",
|
38
|
+
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
|
39
|
+
"paper-input": "PolymerElements/paper-input#^1.0.0",
|
40
|
+
"iron-form": "PolymerElements/iron-form#^1.0.0"
|
41
|
+
}
|
42
|
+
}
|
@@ -0,0 +1,127 @@
|
|
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="../../paper-styles/color.html">
|
13
|
+
|
14
|
+
<link rel="import"href="../../iron-flex-layout/classes/iron-flex-layout.html">
|
15
|
+
<link rel="import" href="../../paper-styles/color.html">
|
16
|
+
<link rel="import" href="../../iron-form/iron-form.html">
|
17
|
+
<link rel="import" href="../../paper-input/paper-input.html">
|
18
|
+
<link rel="import" href="../../paper-button/paper-button.html">
|
19
|
+
<link rel="import" href="../../gold-cc-input/gold-cc-input.html">
|
20
|
+
<link rel="import" href="../../gold-cc-cvc-input/gold-cc-cvc-input.html">
|
21
|
+
<link rel="import" href="../../gold-cc-expiration-input/gold-cc-expiration-input.html">
|
22
|
+
<link rel="import" href="../../gold-zip-input/gold-zip-input.html">
|
23
|
+
<link rel="import" href="../../gold-email-input/gold-email-input.html">
|
24
|
+
<link rel="import" href="../../gold-phone-input/gold-phone-input.html">
|
25
|
+
|
26
|
+
<dom-module id="complex-form">
|
27
|
+
|
28
|
+
<link rel="import" type="css" href="simple-form.css">
|
29
|
+
|
30
|
+
<style>
|
31
|
+
gold-cc-expiration-input, gold-cc-cvc-input {
|
32
|
+
width: 120px;
|
33
|
+
margin-right: 20px;
|
34
|
+
}
|
35
|
+
|
36
|
+
gold-zip-input {
|
37
|
+
width: 120px;
|
38
|
+
}
|
39
|
+
|
40
|
+
gold-email-input {
|
41
|
+
width: 300px;
|
42
|
+
margin-right: 20px;
|
43
|
+
}
|
44
|
+
|
45
|
+
gold-phone-input {
|
46
|
+
width: 200px;
|
47
|
+
}
|
48
|
+
|
49
|
+
.country {
|
50
|
+
width: 260px;
|
51
|
+
margin-right: 20px;
|
52
|
+
}
|
53
|
+
|
54
|
+
.quantity {
|
55
|
+
width: 120px;
|
56
|
+
}
|
57
|
+
|
58
|
+
h4 {
|
59
|
+
margin-bottom: 0px;
|
60
|
+
}
|
61
|
+
|
62
|
+
paper-button {
|
63
|
+
width: 100%;
|
64
|
+
}
|
65
|
+
</style>
|
66
|
+
<template>
|
67
|
+
|
68
|
+
<form is="iron-form" id="form">
|
69
|
+
|
70
|
+
<h4>Quantity</h4>
|
71
|
+
<paper-input name="quantity" class="quantity" value="1" type="number"></paper-input>
|
72
|
+
|
73
|
+
<h4>Contact Information</h4>
|
74
|
+
|
75
|
+
|
76
|
+
<paper-input name="name" label="Name" required auto-validate></paper-input>
|
77
|
+
<paper-input name="address" label="Address" required auto-validate></paper-input>
|
78
|
+
|
79
|
+
<div class="horizontal layout">
|
80
|
+
<gold-email-input name="email" required auto-validate></gold-email-input>
|
81
|
+
<gold-phone-input name="phone" required auto-validate></gold-phone-input>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<h4>Payment</h4>
|
85
|
+
|
86
|
+
<gold-cc-input name="cc" required auto-validate
|
87
|
+
value="4000 0000 0000 0002"
|
88
|
+
label="Sample Valid VISA number">
|
89
|
+
</gold-cc-input>
|
90
|
+
|
91
|
+
<div class="horizontal layout">
|
92
|
+
<gold-cc-expiration-input name="cc-expiration" required auto-validate></gold-cc-expiration-input>
|
93
|
+
<gold-cc-cvc-input name="cc-cvc" required auto-validate></gold-cc-cvc-input>
|
94
|
+
<gold-zip-input name="zip" required auto-validate></gold-zip-input>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<h4>Shipping</h4>
|
98
|
+
<div class="horizontal layout">
|
99
|
+
<paper-input name="country" class="country" label="Country" placeholder="United States" required auto-validate></paper-input>
|
100
|
+
<gold-zip-input name"mail-zip" required auto-validate></gold-zip-input>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<paper-button on-click="_submit">Pay</paper-button>
|
104
|
+
|
105
|
+
</form>
|
106
|
+
</template>
|
107
|
+
</dom-module>
|
108
|
+
|
109
|
+
<script>
|
110
|
+
Polymer({
|
111
|
+
|
112
|
+
is: 'complex-form',
|
113
|
+
|
114
|
+
listeners: {
|
115
|
+
'iron-form-submit': '_formSubmitted'
|
116
|
+
},
|
117
|
+
|
118
|
+
_submit: function() {
|
119
|
+
this.$.form.submit();
|
120
|
+
},
|
121
|
+
|
122
|
+
_formSubmitted: function(event) {
|
123
|
+
console.log("Submitted: ", event.detail);
|
124
|
+
}
|
125
|
+
|
126
|
+
});
|
127
|
+
</script>
|
@@ -0,0 +1,94 @@
|
|
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-elements demo</title>
|
19
|
+
|
20
|
+
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
21
|
+
<link rel="stylesheet" href="../../paper-styles/demo.css">
|
22
|
+
|
23
|
+
<link rel="import" href="../../paper-dialog/paper-dialog.html">
|
24
|
+
<link rel="import" href="simple-form.html">
|
25
|
+
<link rel="import" href="complex-form.html">
|
26
|
+
<link rel="import" href="item-card.html">
|
27
|
+
|
28
|
+
</head>
|
29
|
+
|
30
|
+
<style>
|
31
|
+
paper-dialog {
|
32
|
+
max-height: 600px;
|
33
|
+
}
|
34
|
+
|
35
|
+
simple-form {
|
36
|
+
width: 400px;
|
37
|
+
}
|
38
|
+
|
39
|
+
complex-form {
|
40
|
+
padding-left: 40px;
|
41
|
+
width: 400px;
|
42
|
+
}
|
43
|
+
|
44
|
+
.divider {
|
45
|
+
padding-right: 40px;
|
46
|
+
border-right: 1px solid #ccc;
|
47
|
+
}
|
48
|
+
|
49
|
+
item-card {
|
50
|
+
padding-right: 20px;
|
51
|
+
}
|
52
|
+
</style>
|
53
|
+
|
54
|
+
<body>
|
55
|
+
<section>
|
56
|
+
<h1>Form in an overlay</h1>
|
57
|
+
<div class="layout horizontal" onclick="clickHandler(event);">
|
58
|
+
<item-card price="10"></item-card>
|
59
|
+
<item-card price="50"></item-card>
|
60
|
+
<item-card price="60"></item-card>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<paper-dialog id="backdrop" with-backdrop>
|
64
|
+
<simple-form></simple-form>
|
65
|
+
</paper-dialog>
|
66
|
+
|
67
|
+
</section>
|
68
|
+
|
69
|
+
<section>
|
70
|
+
<h1>Different forms</h1>
|
71
|
+
<div class="layout horizontal">
|
72
|
+
<simple-form></simple-form>
|
73
|
+
<div class="divider"></div>
|
74
|
+
<complex-form></complex-form>
|
75
|
+
</div>
|
76
|
+
</section>
|
77
|
+
|
78
|
+
<script>
|
79
|
+
function clickHandler(e) {
|
80
|
+
if (!e.target.hasAttribute('elevation')) {
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
|
84
|
+
var dialog = document.getElementById('backdrop');
|
85
|
+
if (dialog) {
|
86
|
+
dialog.open();
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
</script>
|
91
|
+
|
92
|
+
</body>
|
93
|
+
|
94
|
+
</html>
|
@@ -0,0 +1,59 @@
|
|
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="../../paper-styles/color.html">
|
13
|
+
<link rel="import"href="../../iron-flex-layout/classes/iron-flex-layout.html">
|
14
|
+
<link rel="import" href="../../paper-button/paper-button.html">
|
15
|
+
|
16
|
+
<dom-module id="item-card">
|
17
|
+
<style is="custom-style">
|
18
|
+
.header {
|
19
|
+
width: 200px;
|
20
|
+
height: 150px;
|
21
|
+
background-color: var(--google-blue-300);
|
22
|
+
}
|
23
|
+
.footer {
|
24
|
+
width: 200px;
|
25
|
+
height: 50px;
|
26
|
+
background-color: var(--google-blue-100);
|
27
|
+
}
|
28
|
+
.price {
|
29
|
+
font-size: 20px;
|
30
|
+
color: var(--google-blue-700);
|
31
|
+
padding-left: 10px;
|
32
|
+
}
|
33
|
+
paper-button {
|
34
|
+
background-color: var(--google-blue-500);
|
35
|
+
color: #fff;
|
36
|
+
margin-right: 10px;
|
37
|
+
}
|
38
|
+
</style>
|
39
|
+
|
40
|
+
<template>
|
41
|
+
<div class="header"></div>
|
42
|
+
<div class="footer horizontal layout center">
|
43
|
+
<div class="price flex">$<span>[[price]]</span></div>
|
44
|
+
<paper-button raised>buy now</paper-button>
|
45
|
+
</div>
|
46
|
+
</template>
|
47
|
+
</dom-module>
|
48
|
+
|
49
|
+
<script>
|
50
|
+
Polymer({
|
51
|
+
is: 'item-card',
|
52
|
+
|
53
|
+
properties: {
|
54
|
+
price: {
|
55
|
+
type: Number
|
56
|
+
}
|
57
|
+
}
|
58
|
+
});
|
59
|
+
</script>
|
@@ -0,0 +1,55 @@
|
|
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
|
+
:host {
|
12
|
+
display: block;
|
13
|
+
}
|
14
|
+
|
15
|
+
.form-title, .footer {
|
16
|
+
margin-bottom: 20px;
|
17
|
+
}
|
18
|
+
|
19
|
+
.avatar {
|
20
|
+
display: inline-block;
|
21
|
+
width: 40px;
|
22
|
+
height: 40px;
|
23
|
+
border-radius: 50%;
|
24
|
+
overflow: hidden;
|
25
|
+
background: var(--google-blue-700);
|
26
|
+
margin-right: 20px;
|
27
|
+
}
|
28
|
+
|
29
|
+
.company {
|
30
|
+
color: var(--google-blue-700);
|
31
|
+
font-size: 20px;
|
32
|
+
font-weight: 200;
|
33
|
+
}
|
34
|
+
|
35
|
+
gold-cc-expiration-input, .filler {
|
36
|
+
width: 50%;
|
37
|
+
margin-right: 20px;
|
38
|
+
}
|
39
|
+
|
40
|
+
.footer {
|
41
|
+
width: 50%;
|
42
|
+
@apply(--paper-input-container-font);
|
43
|
+
color: var(--secondary-text-color);
|
44
|
+
}
|
45
|
+
|
46
|
+
.price {
|
47
|
+
color: var(--primary-text-color);
|
48
|
+
}
|
49
|
+
|
50
|
+
paper-button {
|
51
|
+
background-color: var(--google-blue-500);
|
52
|
+
color: #fff;
|
53
|
+
margin-right: 0px;
|
54
|
+
margin-top: 50px;
|
55
|
+
}
|
@@ -0,0 +1,93 @@
|
|
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="../../paper-styles/color.html">
|
13
|
+
|
14
|
+
<link rel="import"href="../../iron-flex-layout/classes/iron-flex-layout.html">
|
15
|
+
<link rel="import" href="../../iron-form/iron-form.html">
|
16
|
+
<link rel="import" href="../../paper-styles/color.html">
|
17
|
+
<link rel="import" href="../../paper-input/paper-input.html">
|
18
|
+
<link rel="import" href="../../paper-button/paper-button.html">
|
19
|
+
<link rel="import" href="../../gold-cc-input/gold-cc-input.html">
|
20
|
+
<link rel="import" href="../../gold-cc-cvc-input/gold-cc-cvc-input.html">
|
21
|
+
<link rel="import" href="../../gold-cc-expiration-input/gold-cc-expiration-input.html">
|
22
|
+
|
23
|
+
<dom-module id="simple-form">
|
24
|
+
|
25
|
+
<link rel="import" type="css" href="simple-form.css">
|
26
|
+
|
27
|
+
<template>
|
28
|
+
|
29
|
+
<form is="iron-form" id="form">
|
30
|
+
|
31
|
+
<div class="horizontal layout center form-title">
|
32
|
+
<div class="avatar" item-icon></div>
|
33
|
+
<div class="flex company">ACME Goods Co.</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<paper-input name="name" label="Name on card" required></paper-input>
|
37
|
+
|
38
|
+
<gold-cc-input name="cc-number" required value="4000 0000 0000 0002"></gold-cc-input>
|
39
|
+
|
40
|
+
<div class="horizontal layout">
|
41
|
+
<gold-cc-expiration-input name="cc-expiration" required></gold-cc-expiration-input>
|
42
|
+
<gold-cc-cvc-input name="cc-cvc" required></gold-cc-cvc-input>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<br><br>
|
46
|
+
|
47
|
+
<div class="horizontal layout">
|
48
|
+
<div class="filler"></div>
|
49
|
+
<div class="footer">
|
50
|
+
<div class="total-item horizontal layout">
|
51
|
+
<div class="flex">Sub total </div>
|
52
|
+
<div class="price">$30</div>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<div class="total-item horizontal layout">
|
56
|
+
<div class="flex">Tax </div>
|
57
|
+
<div class="price">$2.99</div>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div class="total-item horizontal layout">
|
61
|
+
<div class="flex">Your total </div>
|
62
|
+
<div class="price">$32.99</div>
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div class="horizontal layout end-justified">
|
66
|
+
<paper-button on-click="_submit">Pay $32.99</paper-button>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
|
71
|
+
</form>
|
72
|
+
</template>
|
73
|
+
</dom-module>
|
74
|
+
|
75
|
+
<script>
|
76
|
+
Polymer({
|
77
|
+
|
78
|
+
is: 'simple-form',
|
79
|
+
|
80
|
+
listeners: {
|
81
|
+
'iron-form-submit': '_formSubmitted'
|
82
|
+
},
|
83
|
+
|
84
|
+
_submit: function() {
|
85
|
+
this.$.form.submit();
|
86
|
+
},
|
87
|
+
|
88
|
+
_formSubmitted: function(event) {
|
89
|
+
console.log("Submitted: ", event.detail);
|
90
|
+
}
|
91
|
+
|
92
|
+
});
|
93
|
+
</script>
|