com.vaadin.polymer.paper.element.PaperInputContainerElement Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from paper-input project by The Polymer Authors
* that is licensed with http://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.paper.element;
import com.vaadin.polymer.elemental.*;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.core.client.js.JsProperty;
import com.google.gwt.core.client.js.JsType;
/**
* <paper-input-container>
is a container for a <label>
, an <input is="iron-input">
or
<iron-autogrow-textarea>
and optional add-on elements such as an error message or character
counter, used to implement Material Design text fields.
* For example:
* <paper-input-container>
* <label>Your name</label>
* <input is="iron-input">
* </paper-input-container>
*
*
*
Listening for input changes
* By default, it listens for changes on the bind-value
attribute on its children nodes and perform
tasks such as auto-validating and label styling when the bind-value
changes. You can configure
the attribute it listens to with the attr-for-value
attribute.
* Using a custom input element
* You can use a custom input element in a <paper-input-container>
, for example to implement a
compound input field like a social security number input. The custom input element should have the
paper-input-input
class, have a notify:true
value property and optionally implements
Polymer.IronValidatableBehavior
if it is validatble.
* <paper-input-container attr-for-value="ssn-value">
* <label>Social security number</label>
* <ssn-input class="paper-input-input"></ssn-input>
* </paper-input-container>
*
*
*
Validation
* If the auto-validate
attribute is set, the input container will validate the input and update
the container styling when the input value changes.
* Add-ons
* Add-ons are child elements of a <paper-input-container>
with the add-on
attribute and
implements the Polymer.PaperInputAddonBehavior
behavior. They are notified when the input value
or validity changes, and may implement functionality such as error messages or character counters.
They appear at the bottom of the input.
* Styling
* The following custom properties and mixins are available for styling:
*
*
*
* Custom property
* Description
* Default
*
*
*
*
* --paper-input-container-color
* Label and underline color when the input is not focused
* --secondary-text-color
*
*
* --paper-input-container-focus-color
* Label and underline color when the input is focused
* --default-primary-color
*
*
* --paper-input-container-invalid-color
* Label and underline color when the input is focused
* --google-red-500
*
*
* --paper-input-container-input-color
* Input foreground color
* --primary-text-color
*
*
* --paper-input-container
* Mixin applied to the container
* {}
*
*
* --paper-input-container-label
* Mixin applied to the label
* {}
*
*
* --paper-input-container-input
* Mixin applied to the input
* {}
*
*
*
* This element is display:block
by default, but you can set the inline
attribute to make it
display:inline-block
.
*/
@JsType
public interface PaperInputContainerElement extends HTMLElement {
public static final String TAG = "paper-input-container";
public static final String SRC = "paper-input/all-imports.html";
/**
* Set to true to always float the floating label.
*
* JavaScript Info:
* @property alwaysFloatLabel
* @type Boolean
*
*/
@JsProperty boolean getAlwaysFloatLabel();
/**
* Set to true to always float the floating label.
*
* JavaScript Info:
* @property alwaysFloatLabel
* @type Boolean
*
*/
@JsProperty void setAlwaysFloatLabel(boolean value);
/**
* The attribute to listen for value changes on.
*
* JavaScript Info:
* @property attrForValue
* @type String
*
*/
@JsProperty String getAttrForValue();
/**
* The attribute to listen for value changes on.
*
* JavaScript Info:
* @property attrForValue
* @type String
*
*/
@JsProperty void setAttrForValue(String value);
/**
* Set to true to auto-validate the input value when it changes.
*
* JavaScript Info:
* @property autoValidate
* @type Boolean
*
*/
@JsProperty boolean getAutoValidate();
/**
* Set to true to auto-validate the input value when it changes.
*
* JavaScript Info:
* @property autoValidate
* @type Boolean
*
*/
@JsProperty void setAutoValidate(boolean value);
/**
* True if the input has focus.
*
* JavaScript Info:
* @property focused
* @type Boolean
*
*/
@JsProperty boolean getFocused();
/**
* True if the input has focus.
*
* JavaScript Info:
* @property focused
* @type Boolean
*
*/
@JsProperty void setFocused(boolean value);
/**
* True if the input is invalid. This property is set automatically when the input value
changes if auto-validating, or when the iron-input-valid
event is heard from a child.
*
* JavaScript Info:
* @property invalid
* @type Boolean
*
*/
@JsProperty boolean getInvalid();
/**
* True if the input is invalid. This property is set automatically when the input value
changes if auto-validating, or when the iron-input-valid
event is heard from a child.
*
* JavaScript Info:
* @property invalid
* @type Boolean
*
*/
@JsProperty void setInvalid(boolean value);
/**
* Set to true to disable the floating label. The label disappears when the input value is
not null.
*
* JavaScript Info:
* @property noLabelFloat
* @type Boolean
*
*/
@JsProperty boolean getNoLabelFloat();
/**
* Set to true to disable the floating label. The label disappears when the input value is
not null.
*
* JavaScript Info:
* @property noLabelFloat
* @type Boolean
*
*/
@JsProperty void setNoLabelFloat(boolean value);
/**
* Call this to update the state of add-ons.
*
* JavaScript Info:
* @method updateAddons
* @param {Object} state
*
*/
void updateAddons(JavaScriptObject state);
/**
*
*
* JavaScript Info:
* @method attached
*
*/
void attached();
/**
*
*
* JavaScript Info:
* @property listeners
* @type Object
*
*/
@JsProperty JavaScriptObject getListeners();
/**
*
*
* JavaScript Info:
* @property listeners
* @type Object
*
*/
@JsProperty void setListeners(JavaScriptObject value);
}