All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.polymer.paper.PaperToastElement Maven / Gradle / Ivy

The newest version!
/*
 * This code was generated with Vaadin Web Component GWT API Generator, 
 * from paper-toast project by The Polymer Authors
 * that is licensed with http://polymer.github.io/LICENSE.txt license.
 */
package com.vaadin.polymer.paper;

import com.vaadin.polymer.elemental.*;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;

/**
 * 

Material design: Snackbars & toasts

*

paper-toast provides a subtle notification toast. Only one paper-toast will
be visible on screen.

*

Use opened to show the toast:

*

Example:

*
<paper-toast text="Hello world!" opened></paper-toast>
 * 
 * 
 * 

Also open() or show() can be used to show the toast:

*

Example:

*
<paper-button on-click="openToast">Open Toast</paper-button>
 * <paper-toast id="toast" text="Hello world!"></paper-toast>
 * 
 * ...
 * 
 * openToast: function() {
 *   this.$.toast.open();
 * }
 * 
 * 
 * 

Set duration to 0, a negative number or Infinity to persist the toast on screen:

*

Example:

*
<paper-toast text="Terms and conditions" opened duration="0">
 *   <a href="#">Show more</a>
 * </paper-toast>
 * 
 * 
 * 
 * 

Styling

*

The following custom properties and mixins are available for styling:

* * * * * * * * * * * * * * * * * * * * *
Custom propertyDescriptionDefault
--paper-toast-background-colorThe paper-toast background-color#323232
--paper-toast-colorThe paper-toast color#f1f1f1
*

This element applies the mixin --paper-font-common-base but does not import paper-styles/typography.html.
In order to apply the Roboto font to this element, make sure you’ve imported paper-styles/typography.html.

*/ @JsType(isNative=true) public interface PaperToastElement extends HTMLElement { @JsOverlay public static final String TAG = "paper-toast"; @JsOverlay public static final String SRC = "paper-toast/paper-toast.html"; /** *

A pixel value that will be added to the position calculated for the
given horizontalAlign, in the direction of alignment. You can think
of it as increasing or decreasing the distance to the side of the
screen given by horizontalAlign.

*

If horizontalAlign is “left”, this offset will increase or decrease
the distance to the left side of the screen: a negative offset will
move the dropdown to the left; a positive one, to the right.

*

Conversely if horizontalAlign is “right”, this offset will increase
or decrease the distance to the right side of the screen: a negative
offset will move the dropdown to the right; a positive one, to the left.

* * JavaScript Info: * @property horizontalOffset * @type Number * @behavior VaadinContextMenuOverlay */ @JsProperty double getHorizontalOffset(); /** *

A pixel value that will be added to the position calculated for the
given horizontalAlign, in the direction of alignment. You can think
of it as increasing or decreasing the distance to the side of the
screen given by horizontalAlign.

*

If horizontalAlign is “left”, this offset will increase or decrease
the distance to the left side of the screen: a negative offset will
move the dropdown to the left; a positive one, to the right.

*

Conversely if horizontalAlign is “right”, this offset will increase
or decrease the distance to the right side of the screen: a negative
offset will move the dropdown to the right; a positive one, to the left.

* * JavaScript Info: * @property horizontalOffset * @type Number * @behavior VaadinContextMenuOverlay */ @JsProperty void setHorizontalOffset(double value); /** *

The backdrop element.

* * JavaScript Info: * @property backdropElement * @type Element * @behavior VaadinContextMenuOverlay */ @JsProperty Element getBackdropElement(); /** *

The backdrop element.

* * JavaScript Info: * @property backdropElement * @type Element * @behavior VaadinContextMenuOverlay */ @JsProperty void setBackdropElement(Element value); /** *

A pixel value that will be added to the position calculated for the
given verticalAlign, in the direction of alignment. You can think
of it as increasing or decreasing the distance to the side of the
screen given by verticalAlign.

*

If verticalAlign is “top”, this offset will increase or decrease
the distance to the top side of the screen: a negative offset will
move the dropdown upwards; a positive one, downwards.

*

Conversely if verticalAlign is “bottom”, this offset will increase
or decrease the distance to the bottom side of the screen: a negative
offset will move the dropdown downwards; a positive one, upwards.

* * JavaScript Info: * @property verticalOffset * @type Number * @behavior VaadinContextMenuOverlay */ @JsProperty double getVerticalOffset(); /** *

A pixel value that will be added to the position calculated for the
given verticalAlign, in the direction of alignment. You can think
of it as increasing or decreasing the distance to the side of the
screen given by verticalAlign.

*

If verticalAlign is “top”, this offset will increase or decrease
the distance to the top side of the screen: a negative offset will
move the dropdown upwards; a positive one, downwards.

*

Conversely if verticalAlign is “bottom”, this offset will increase
or decrease the distance to the bottom side of the screen: a negative
offset will move the dropdown downwards; a positive one, upwards.

* * JavaScript Info: * @property verticalOffset * @type Number * @behavior VaadinContextMenuOverlay */ @JsProperty void setVerticalOffset(double value); /** *

The duration in milliseconds to show the toast.
Set to 0, a negative number, or Infinity, to disable the
toast auto-closing.

* * JavaScript Info: * @property duration * @type Number * */ @JsProperty double getDuration(); /** *

The duration in milliseconds to show the toast.
Set to 0, a negative number, or Infinity, to disable the
toast auto-closing.

* * JavaScript Info: * @property duration * @type Number * */ @JsProperty void setDuration(double value); /** *

Set to true to keep overlay always on top.

* * JavaScript Info: * @property alwaysOnTop * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty boolean getAlwaysOnTop(); /** *

Set to true to keep overlay always on top.

* * JavaScript Info: * @property alwaysOnTop * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty void setAlwaysOnTop(boolean value); /** *

True if the overlay is currently displayed.

* * JavaScript Info: * @property opened * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty boolean getOpened(); /** *

True if the overlay is currently displayed.

* * JavaScript Info: * @property opened * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty void setOpened(boolean value); /** *

Set to true to enable restoring of focus when overlay is closed.

* * JavaScript Info: * @property restoreFocusOnClose * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty boolean getRestoreFocusOnClose(); /** *

Set to true to enable restoring of focus when overlay is closed.

* * JavaScript Info: * @property restoreFocusOnClose * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty void setRestoreFocusOnClose(boolean value); /** *

Set to true to display a backdrop behind the overlay. It traps the focus
within the light DOM of the overlay.

* * JavaScript Info: * @property withBackdrop * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty boolean getWithBackdrop(); /** *

Set to true to display a backdrop behind the overlay. It traps the focus
within the light DOM of the overlay.

* * JavaScript Info: * @property withBackdrop * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty void setWithBackdrop(boolean value); /** *

Overridden from IronOverlayBehavior.
Set to true to disable auto-focusing the toast or child nodes with
the autofocus attribute` when the overlay is opened.

* * JavaScript Info: * @property noAutoFocus * @type Boolean * */ @JsProperty boolean getNoAutoFocus(); /** *

Overridden from IronOverlayBehavior.
Set to true to disable auto-focusing the toast or child nodes with
the autofocus attribute` when the overlay is opened.

* * JavaScript Info: * @property noAutoFocus * @type Boolean * */ @JsProperty void setNoAutoFocus(boolean value); /** *

True if the overlay was canceled when it was last closed.

* * JavaScript Info: * @property canceled * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty boolean getCanceled(); /** *

True if the overlay was canceled when it was last closed.

* * JavaScript Info: * @property canceled * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty void setCanceled(boolean value); /** *

Set to true to auto-fit on attach.

* * JavaScript Info: * @property autoFitOnAttach * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty boolean getAutoFitOnAttach(); /** *

Set to true to auto-fit on attach.

* * JavaScript Info: * @property autoFitOnAttach * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty void setAutoFitOnAttach(boolean value); /** *

Overridden from IronOverlayBehavior.
Set to false to enable closing of the toast by clicking outside it.

* * JavaScript Info: * @property noCancelOnOutsideClick * @type Boolean * */ @JsProperty boolean getNoCancelOnOutsideClick(); /** *

Overridden from IronOverlayBehavior.
Set to false to enable closing of the toast by clicking outside it.

* * JavaScript Info: * @property noCancelOnOutsideClick * @type Boolean * */ @JsProperty void setNoCancelOnOutsideClick(boolean value); /** *

If true, it will use horizontalAlign and verticalAlign values as preferred alignment
and if there’s not enough space, it will pick the values which minimize the cropping.

* * JavaScript Info: * @property dynamicAlign * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty boolean getDynamicAlign(); /** *

If true, it will use horizontalAlign and verticalAlign values as preferred alignment
and if there’s not enough space, it will pick the values which minimize the cropping.

* * JavaScript Info: * @property dynamicAlign * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty void setDynamicAlign(boolean value); /** *

Set to true to disable canceling the overlay with the ESC key.

* * JavaScript Info: * @property noCancelOnEscKey * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty boolean getNoCancelOnEscKey(); /** *

Set to true to disable canceling the overlay with the ESC key.

* * JavaScript Info: * @property noCancelOnEscKey * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty void setNoCancelOnEscKey(boolean value); /** *

Will position the element around the positionTarget without overlapping it.

* * JavaScript Info: * @property noOverlap * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty boolean getNoOverlap(); /** *

Will position the element around the positionTarget without overlapping it.

* * JavaScript Info: * @property noOverlap * @type Boolean * @behavior VaadinContextMenuOverlay */ @JsProperty void setNoOverlap(boolean value); /** *

The element that should be used to position the element. If not set, it will
default to the parent node.

* * JavaScript Info: * @property positionTarget * @type !Element * @behavior VaadinContextMenuOverlay */ @JsProperty JavaScriptObject getPositionTarget(); /** *

The element that should be used to position the element. If not set, it will
default to the parent node.

* * JavaScript Info: * @property positionTarget * @type !Element * @behavior VaadinContextMenuOverlay */ @JsProperty void setPositionTarget(JavaScriptObject value); /** *

Contains the reason(s) this overlay was last closed (see iron-overlay-closed).
IronOverlayBehavior provides the canceled reason; implementers of the
behavior can provide other reasons in addition to canceled.

* * JavaScript Info: * @property closingReason * @type Object * @behavior VaadinContextMenuOverlay */ @JsProperty JavaScriptObject getClosingReason(); /** *

Contains the reason(s) this overlay was last closed (see iron-overlay-closed).
IronOverlayBehavior provides the canceled reason; implementers of the
behavior can provide other reasons in addition to canceled.

* * JavaScript Info: * @property closingReason * @type Object * @behavior VaadinContextMenuOverlay */ @JsProperty void setClosingReason(JavaScriptObject value); /** *

The element to fit this into.

* * JavaScript Info: * @property fitInto * @type Object * @behavior VaadinContextMenuOverlay */ @JsProperty JavaScriptObject getFitInto(); /** *

The element to fit this into.

* * JavaScript Info: * @property fitInto * @type Object * @behavior VaadinContextMenuOverlay */ @JsProperty void setFitInto(JavaScriptObject value); /** *

The element that will receive a max-height/width. By default it is the same as this,
but it can be set to a child element. This is useful, for example, for implementing a
scrolling region inside the element.

* * JavaScript Info: * @property sizingTarget * @type !Element * @behavior VaadinContextMenuOverlay */ @JsProperty JavaScriptObject getSizingTarget(); /** *

The element that will receive a max-height/width. By default it is the same as this,
but it can be set to a child element. This is useful, for example, for implementing a
scrolling region inside the element.

* * JavaScript Info: * @property sizingTarget * @type !Element * @behavior VaadinContextMenuOverlay */ @JsProperty void setSizingTarget(JavaScriptObject value); /** *

The orientation against which to align the element vertically
relative to the positionTarget. Possible values are “top”, “bottom”, “auto”.

* * JavaScript Info: * @property verticalAlign * @type String * @behavior VaadinContextMenuOverlay */ @JsProperty String getVerticalAlign(); /** *

The orientation against which to align the element vertically
relative to the positionTarget. Possible values are “top”, “bottom”, “auto”.

* * JavaScript Info: * @property verticalAlign * @type String * @behavior VaadinContextMenuOverlay */ @JsProperty void setVerticalAlign(String value); /** *

The text to display in the toast.

* * JavaScript Info: * @property text * @type String * */ @JsProperty String getText(); /** *

The text to display in the toast.

* * JavaScript Info: * @property text * @type String * */ @JsProperty void setText(String value); /** *

The orientation against which to align the dropdown content
horizontally relative to positionTarget.
Overridden from Polymer.IronFitBehavior.

* * JavaScript Info: * @property horizontalAlign * @type String * */ @JsProperty String getHorizontalAlign(); /** *

The orientation against which to align the dropdown content
horizontally relative to positionTarget.
Overridden from Polymer.IronFitBehavior.

* * JavaScript Info: * @property horizontalAlign * @type String * */ @JsProperty void setHorizontalAlign(String value); /** *

Show the toast. Without arguments, this is the same as open() from IronOverlayBehavior.

* * JavaScript Info: * @method show * @param {(Object|string)=} properties * * */ void show(Object properties); /** *

Used to assign the closest resizable ancestor to this resizable
if the ancestor detects a request for notifications.

* * JavaScript Info: * @method assignParentResizable * @param {} parentResizable * @behavior VaadinSplitLayout * */ void assignParentResizable(Object parentResizable); /** *

Used to remove a resizable descendant from the list of descendants
that should be notified of a resize change.

* * JavaScript Info: * @method stopResizeNotificationsFor * @param {} target * @behavior VaadinSplitLayout * */ void stopResizeNotificationsFor(Object target); /** *

Invalidates the cached tabbable nodes. To be called when any of the focusable
content changes (e.g. a button is disabled).

* * JavaScript Info: * @method invalidateTabbables * @behavior VaadinContextMenuOverlay * */ void invalidateTabbables(); /** *

Close the overlay.

* * JavaScript Info: * @method close * @behavior VaadinContextMenuOverlay * */ void close(); /** *

Open the overlay.

* * JavaScript Info: * @method open * @behavior VaadinContextMenuOverlay * */ void open(); /** *

Toggle the opened state of the overlay.

* * JavaScript Info: * @method toggle * @behavior VaadinContextMenuOverlay * */ void toggle(); /** *

Centers horizontally and vertically if not already positioned. This also sets
position:fixed.

* * JavaScript Info: * @method center * @behavior VaadinContextMenuOverlay * */ void center(); /** *

Hide the toast. Same as close() from IronOverlayBehavior.

* * JavaScript Info: * @method hide * * */ void hide(); /** *

Positions and fits the element into the fitInto element.

* * JavaScript Info: * @method fit * @behavior VaadinContextMenuOverlay * */ void fit(); /** *

Positions the element according to horizontalAlign, verticalAlign.

* * JavaScript Info: * @method position * @behavior VaadinContextMenuOverlay * */ void position(); /** *

Equivalent to calling resetFit() and fit(). Useful to call this after
the element or the fitInto element has been resized, or if any of the
positioning properties (e.g. horizontalAlign, verticalAlign) is updated.
It preserves the scroll position of the sizingTarget.

* * JavaScript Info: * @method refit * @behavior VaadinContextMenuOverlay * */ void refit(); /** *

Resets the target element’s position and size constraints, and clear
the memoized data.

* * JavaScript Info: * @method resetFit * @behavior VaadinContextMenuOverlay * */ void resetFit(); /** *

Can be called to manually notify a resizable and its descendant
resizables of a resize change.

* * JavaScript Info: * @method notifyResize * @behavior VaadinSplitLayout * */ void notifyResize(); /** *

Constrains the size of the element to fitInto by setting max-height
and/or max-width.

* * JavaScript Info: * @method constrain * @behavior VaadinContextMenuOverlay * */ void constrain(); /** *

This method can be overridden to filter nested elements that should or
should not be notified by the current element. Return true if an element
should be notified, or false if it should not be notified.

* * JavaScript Info: * @method resizerShouldNotify * @param {HTMLElement} element * @behavior VaadinSplitLayout * @return {boolean} */ boolean resizerShouldNotify(JavaScriptObject element); /** *

Cancels the overlay.

* * JavaScript Info: * @method cancel * @param {Event=} event * @behavior VaadinContextMenuOverlay * */ void cancel(JavaScriptObject event); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy