com.vaadin.polymer.iron.element.IronInputElement Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from iron-input project by The Polymer Authors
* that is licensed with http://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.iron.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;
/**
* <iron-input>
adds two-way binding and custom validators using Polymer.IronValidatorBehavior
to <input>
.
* Two-way binding
* By default you can only get notified of changes to an input
‘s value
due to user input:
* <input value="{{myValue::input}}">
*
*
*
iron-input
adds the bind-value
property that mirrors the value
property, and can be used
for two-way data binding. bind-value
will notify if it is changed either by user input or by script.
* <input is="iron-input" bind-value="{{myValue}}">
*
*
*
Custom validators
* You can use custom validators that implement Polymer.IronValidatorBehavior
with <iron-input>
.
* <input is="iron-input" validator="my-custom-validator">
*
*
*
Stopping invalid input
* It may be desirable to only allow users to enter certain characters. You can use the
prevent-invalid-input
and allowed-pattern
attributes together to accomplish this. This feature
is separate from validation, and allowed-pattern
does not affect how the input is validated.
* <!-- only allow characters that match [0-9] -->
* <input is="iron-input" prevent-invaild-input allowed-pattern="[0-9]">
*
*
*
*/
@JsType
public interface IronInputElement extends HTMLElement {
public static final String TAG = "iron-input";
public static final String SRC = "iron-input/iron-input.html";
/**
* Regular expression to match valid input characters.
*
* JavaScript Info:
* @property allowedPattern
* @type String
*
*/
@JsProperty String getAllowedPattern();
/**
* Regular expression to match valid input characters.
*
* JavaScript Info:
* @property allowedPattern
* @type String
*
*/
@JsProperty void setAllowedPattern(String value);
/**
* Use this property instead of value
for two-way data binding.
*
* JavaScript Info:
* @property bindValue
* @type String
*
*/
@JsProperty String getBindValue();
/**
* Use this property instead of value
for two-way data binding.
*
* JavaScript Info:
* @property bindValue
* @type String
*
*/
@JsProperty void setBindValue(String value);
/**
* Set to true to prevent the user from entering invalid input. The new input characters are
matched with allowedPattern
if it is set, otherwise it will use the pattern
attribute if
set, or the type
attribute (only supported for type=number
).
*
* JavaScript Info:
* @property preventInvalidInput
* @type Boolean
*
*/
@JsProperty boolean getPreventInvalidInput();
/**
* Set to true to prevent the user from entering invalid input. The new input characters are
matched with allowedPattern
if it is set, otherwise it will use the pattern
attribute if
set, or the type
attribute (only supported for type=number
).
*
* JavaScript Info:
* @property preventInvalidInput
* @type Boolean
*
*/
@JsProperty void setPreventInvalidInput(boolean value);
/**
* Returns true if value
is valid. The validator provided in validator
will be used first,
then any constraints.
*
* JavaScript Info:
* @method validate
*
*/
void validate();
/**
*
*
* JavaScript Info:
* @property extends
* @type string
*
*/
@JsProperty String getExtends();
/**
*
*
* JavaScript Info:
* @property extends
* @type string
*
*/
@JsProperty void setExtends(String value);
/**
*
*
* JavaScript Info:
* @property listeners
* @type Object
*
*/
@JsProperty JavaScriptObject getListeners();
/**
*
*
* JavaScript Info:
* @property listeners
* @type Object
*
*/
@JsProperty void setListeners(JavaScriptObject value);
/**
*
*
* JavaScript Info:
* @method hasValidator
* @behavior IronInput
*/
void hasValidator();
/**
* True if the last call to validate
is invalid.
*
* JavaScript Info:
* @property invalid
* @type Boolean
* @behavior IronInput
*/
@JsProperty boolean getInvalid();
/**
* True if the last call to validate
is invalid.
*
* JavaScript Info:
* @property invalid
* @type Boolean
* @behavior IronInput
*/
@JsProperty void setInvalid(boolean value);
/**
* Name of the validator to use.
*
* JavaScript Info:
* @property validator
* @type String
* @behavior IronInput
*/
@JsProperty String getValidator();
/**
* Name of the validator to use.
*
* JavaScript Info:
* @property validator
* @type String
* @behavior IronInput
*/
@JsProperty void setValidator(String value);
/**
* Namespace for this validator.
*
* JavaScript Info:
* @property validatorType
* @type String
* @behavior IronInput
*/
@JsProperty String getValidatorType();
/**
* Namespace for this validator.
*
* JavaScript Info:
* @property validatorType
* @type String
* @behavior IronInput
*/
@JsProperty void setValidatorType(String value);
/**
*
*
* JavaScript Info:
* @property observers
* @type Array
* @behavior IronInput
*/
@JsProperty JsArray getObservers();
/**
*
*
* JavaScript Info:
* @property observers
* @type Array
* @behavior IronInput
*/
@JsProperty void setObservers(JsArray value);
}