Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: polymer_1.0.4/bower_components/gold-cc-expiration-input/gold-cc-expiration-input.html

Issue 1205703007: Add polymer 1.0 to npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Renamed folder to 1.0.4 Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: polymer_1.0.4/bower_components/gold-cc-expiration-input/gold-cc-expiration-input.html
diff --git a/polymer_1.0.4/bower_components/gold-cc-expiration-input/gold-cc-expiration-input.html b/polymer_1.0.4/bower_components/gold-cc-expiration-input/gold-cc-expiration-input.html
new file mode 100644
index 0000000000000000000000000000000000000000..40f47c3b2a390f632febde9d2ab929b2f15a7ae2
--- /dev/null
+++ b/polymer_1.0.4/bower_components/gold-cc-expiration-input/gold-cc-expiration-input.html
@@ -0,0 +1,131 @@
+<!--
+@license
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+-->
+<link rel="import" href="../polymer/polymer.html">
+<link rel="import" href="../paper-input/paper-input-behavior.html">
+<link rel="import" href="../paper-input/paper-input-container.html">
+<link rel="import" href="../paper-input/paper-input-error.html">
+<link rel="import" href="../iron-input/iron-input.html">
+<link rel="import" href="../iron-form-element-behavior/iron-form-element-behavior.html">
+
+<link rel="import" href="date-input.html">
+
+<!--
+`gold-cc-expiration-input` is a single-line text field with Material Design styling
+for entering a credit card's expiration date
+
+ <gold-cc-expiration-input></gold-cc-expiration-input>
+ <gold-cc-expiration-input value="11/15"></gold-cc-expiration-input>
+
+It may include an optional label, which by default is "Expiration Date".
+
+ <gold-cc-expiration-input label="Date"></gold-cc-expiration-input>
+
+
+### Validation
+
+The input can check whether the entered date is a valid, future date.
+
+The input can be automatically validated as the user is typing by using
+the `auto-validate` and `required` attributes. For manual validation, the
+element also has a `validate()` method, which returns the validity of the
+input as well sets any appropriate error messages and styles.
+
+See `Polymer.PaperInputBehavior` for more API docs.
+
+### Styling
+
+See `Polymer.PaperInputContainer` for a list of custom properties used to
+style this element.
+
+@group Gold Elements
+@hero hero.svg
+@demo demo/index.html
+@class gold-cc-expiration-input
+-->
+
+<dom-module id="gold-cc-expiration-input">
+ <style>
+ :host {
+ display: block;
+ }
+ </style>
+
+ <template>
+
+ <paper-input-container id="container"
+ always-float-label
+ auto-validate="[[autoValidate]]"
+ attr-for-value="date">
+
+ <label hidden$="[[!label]]">[[label]]</label>
+
+ <date-input class="paper-input-input" id="input"
+ aria-label-prefix="[[_ariaLabelledBy]]"
+ required$="[[required]]"
+ month="[[_computeMonth(value)]]"
+ year="[[_computeYear(value)]]"
+ autocomplete$="[[autocomplete]]">
+ </date-input>
+
+ <template is="dom-if" if="[[errorMessage]]">
+ <paper-input-error>[[errorMessage]]</paper-input-error>
+ </template>
+
+ </paper-input-container>
+ </template>
+
+</dom-module>
+
+<script>
+(function() {
+
+ Polymer({
+
+ is: 'gold-cc-expiration-input',
+
+ behaviors: [
+ Polymer.PaperInputBehavior,
+ Polymer.IronFormElementBehavior
+ ],
+
+ properties: {
+ /**
+ * The label for this input.
+ */
+ label: {
+ type: String,
+ value: "Expiration Date"
+ }
+ },
+
+ listeners: {
+ 'dateChanged': '_dateChanged'
+ },
+
+ _dateChanged: function(event) {
+ if (event.detail.month && event.detail.year)
+ this.value = event.detail.month + '/' + event.detail.year;
+ },
+
+ _computeMonth: function(value) {
+ // Date is in MM/YY format.
+ return value.split('/')[0];
+ },
+
+ _computeYear: function(value) {
+ // Date is in MM/YY format.
+ return value.split('/')[1];
+ }
+   
+ })
+
+})();
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698