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

Unified Diff: third_party/polymer/v0_8/components/paper-input/paper-input.html

Issue 1082403004: Import Polymer 0.8 and several key elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also remove polymer/explainer Created 5 years, 8 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: third_party/polymer/v0_8/components/paper-input/paper-input.html
diff --git a/third_party/polymer/v0_8/components/paper-input/paper-input.html b/third_party/polymer/v0_8/components/paper-input/paper-input.html
new file mode 100644
index 0000000000000000000000000000000000000000..3f80d2118de7516e3d680a19555ac59fa3eada09
--- /dev/null
+++ b/third_party/polymer/v0_8/components/paper-input/paper-input.html
@@ -0,0 +1,151 @@
+<!--
+@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="../iron-input/iron-input.html">
+<link rel="import" href="paper-input-container.html">
+<link rel="import" href="paper-input-error.html">
+<link rel="import" href="paper-input-char-counter.html">
+
+<!--
+`<paper-input>` is a text field.
+-->
+
+<dom-module id="paper-input">
+
+ <template>
+
+ <paper-input-container no-label-float$="[[noLabelFloat]]" auto-validate$="[[autoValidate]]">
+
+ <template is="x-if" if="[[label]]">
+ <label>[[parent.label]]</label>
+ </template>
+
+ <input is="iron-input" id="input" bind-value="{{value}}" prevent-invalid-input="[[preventInvalidInput]]" type$="[[type]]" pattern$="[[pattern]]" maxlength$="[[maxlength]]" required$="[[required]]">
+
+ <template is="x-if" if="[[errorMessage]]">
+ <paper-input-error>[[parent.errorMessage]]</paper-input-error>
+ </template>
+
+ <template is="x-if" if="[[charCounter]]">
+ <paper-input-char-counter></paper-input-char-counter>
+ </template>
+
+ </paper-input-container>
+
+ </template>
+
+</dom-module>
+
+<script>
+
+(function() {
+
+ Polymer({
+
+ is: 'paper-input',
+
+ properties: {
+
+ /**
+ * The label for this input.
+ */
+ label: {
+ type: String
+ },
+
+ /**
+ * The value for this input.
+ */
+ value: {
+ notify: true,
+ type: String
+ },
+
+ /**
+ * Set to true to prevent the user from entering invalid input.
+ */
+ preventInvalidInput: {
+ type: Boolean
+ },
+
+ /**
+ * The type of the input. The supported types are `text`, `number` and `password`.
+ */
+ type: {
+ type: String
+ },
+
+ /**
+ * A pattern to validate the `input` with.
+ */
+ pattern: {
+ type: String
+ },
+
+ /**
+ * Set to true to mark the input as required.
+ */
+ required: {
+ type: Boolean,
+ value: false
+ },
+
+ /**
+ * The maximum length of the input value.
+ */
+ maxlength: {
+ type: Number
+ },
+
+ /**
+ * The error message to display when the input is invalid.
+ */
+ errorMessage: {
+ type: String
+ },
+
+ /**
+ * Set to true to show a character counter.
+ */
+ charCounter: {
+ type: Boolean,
+ value: false
+ },
+
+ /**
+ * Set to true to disable the floating label.
+ */
+ noLabelFloat: {
+ type: Boolean,
+ value: false
+ },
+
+ /**
+ * Set to true to auto-validate the input value.
+ */
+ autoValidate: {
+ type: Boolean,
+ value: false
+ }
+
+ },
+
+ /**
+ * Returns a reference to the input element.
+ */
+ get inputElement() {
+ return this.$.input;
+ }
+
+ })
+
+})();
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698