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

Unified Diff: polymer_1.0.4/bower_components/gold-zip-input/gold-zip-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-zip-input/gold-zip-input.html
diff --git a/polymer_1.0.4/bower_components/gold-zip-input/gold-zip-input.html b/polymer_1.0.4/bower_components/gold-zip-input/gold-zip-input.html
new file mode 100644
index 0000000000000000000000000000000000000000..d31b3a0d16144d813daa78a838ed6bf99ac8fe92
--- /dev/null
+++ b/polymer_1.0.4/bower_components/gold-zip-input/gold-zip-input.html
@@ -0,0 +1,113 @@
+<!--
+@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="zip-validator.html">
+
+<!--
+`gold-zip-input` is a single-line text field with Material Design styling
+for entering a US zip code.
+
+ <gold-zip-input></gold-zip-input>
+
+It may include an optional label, which by default is "Zip Code".
+
+ <gold-zip-input label="Mailing zip code"></gold-zip-input>
+
+### Validation
+
+The input supports both 5 digit zip codes (90210) or the full 9 digit ones,
+separated by a dash (90210-9999).
+
+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-zip-input
+-->
+
+<dom-module id="gold-zip-input">
+ <style>
+ :host {
+ display: block;
+ }
+ </style>
+
+ <template>
+
+ <paper-input-container id="container"
+ auto-validate="[[autoValidate]]"
+ attr-for-value="bind-value">
+
+ <label hidden$="[[!label]]">[[label]]</label>
+
+ <zip-validator></zip-validator>
+
+ <input is="iron-input" id="input"
+ aria-labelledby$="[[_ariaLabelledBy]]"
+ aria-describedby$="[[_ariaDescribedBy]]"
+ required$="[[required]]"
+ validator="zip-validator"
+ type="tel"
+ maxlength="10"
+ bind-value="{{value}}"
+ autocomplete="postal-code"
+ name$="[[name]]">
+
+ <template is="dom-if" if="[[errorMessage]]">
+ <paper-input-error id="error">[[errorMessage]]</paper-input-error>
+ </template>
+
+ </paper-input-container>
+ </template>
+
+</dom-module>
+
+<script>
+(function() {
+ Polymer({
+
+ is: 'gold-zip-input',
+
+ behaviors: [
+ Polymer.PaperInputBehavior,
+ Polymer.IronFormElementBehavior
+ ],
+
+ properties: {
+ /**
+ * The label for this input.
+ */
+ label: {
+ type: String,
+ value: "Zip Code"
+ }
+ }
+
+ })
+
+})();
+
+</script>
« no previous file with comments | « polymer_1.0.4/bower_components/gold-zip-input/demo/index.html ('k') | polymer_1.0.4/bower_components/gold-zip-input/hero.svg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698