Search in sources :

Example 1 with Event

use of elemental2.dom.Event in project gwt-react-examples by GWTReact.

the class StatefulExample method doChange.

private void doChange(FormEvent event) {
    HTMLInputElement e = (HTMLInputElement) event.target;
    String val = e.value;
    setState(State.make(val));
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement)

Example 2 with Event

use of elemental2.dom.Event in project gwt-react-examples by GWTReact.

the class StatefulExample method doChange.

private void doChange(FormEvent event) {
    HTMLInputElement e = (HTMLInputElement) event.target;
    String val = e.value;
    setState(State.make(val));
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement)

Example 3 with Event

use of elemental2.dom.Event in project domino-ui-demo by DominoKit.

the class CardsViewImpl method coloredCards.

private void coloredCards() {
    element.appendChild(BlockHeader.create("COLORED CARDS", "You can control the background color of card, card header and card body.").asElement());
    Column column = Column.create().onLarge(OnLarge.four).onMedium(OnMedium.four).onSmall(OnSmall.twelve).onXSmall(OnXSmall.twelve);
    element.appendChild(Row.create().addColumn(column.addElement(Card.create("Light Blue Card", "Description text here...").setBackground(Background.LIGHT_BLUE).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.ALL.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).addColumn(column.copy().addElement(Card.create("Light Green Card", "Description text here...").setBackground(Background.LIGHT_GREEN).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).asElement())).addColumn(column.copy().addElement(Card.create("Amber card", "Description text here...").setBackground(Background.AMBER).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).addHeaderAction(Icons.NAVIGATION_ICONS.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).asElement());
    element.appendChild(Row.create().addColumn(column.copy().addElement(Card.create("Pink Card", "Description text here...").setHeaderBackground(Background.PINK).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.ALL.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).addColumn(column.copy().addElement(Card.create("Blue Grey Card", "Description text here...").setHeaderBackground(Background.BLUE_GREY).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).asElement())).addColumn(column.copy().addElement(Card.create("Deep Orange card", "Description text here...").setHeaderBackground(Background.DEEP_ORANGE).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).addHeaderAction(Icons.NAVIGATION_ICONS.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).asElement());
    element.appendChild(Row.create().addColumn(column.copy().addElement(Card.create("Light Blue Card", "Description text here...").setHeaderBackground(Background.BLUE).setBodyBackground(Background.LIGHT_BLUE).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.ALL.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).addColumn(column.copy().addElement(Card.create("Light Green Card", "Description text here...").setHeaderBackground(Background.GREEN).setBodyBackground(Background.LIGHT_GREEN).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).asElement())).addColumn(column.copy().addElement(Card.create("Amber card", "Description text here...").setHeaderBackground(Background.ORANGE).setBodyBackground(Background.AMBER).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).addHeaderAction(Icons.NAVIGATION_ICONS.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).asElement());
    element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.coloredCards()).asElement());
}
Also used : Icons(org.dominokit.domino.ui.icons.Icons) UiView(org.dominokit.domino.api.client.annotations.UiView) CardsPresenter(org.dominokit.domino.cards.client.presenters.CardsPresenter) DomGlobal(elemental2.dom.DomGlobal) ComponentView(org.dominokit.domino.componentcase.shared.extension.ComponentView) CodeResource(org.dominokit.domino.cards.client.views.CodeResource) Column(org.dominokit.domino.ui.column.Column) BlockHeader(org.dominokit.domino.ui.header.BlockHeader) CardsView(org.dominokit.domino.cards.client.views.CardsView) Row(org.dominokit.domino.ui.row.Row) HTMLDivElement(elemental2.dom.HTMLDivElement) Text(elemental2.dom.Text) Card(org.dominokit.domino.ui.cards.Card) Elements(org.jboss.gwt.elemento.core.Elements) Background(org.dominokit.domino.ui.style.Background) Column(org.dominokit.domino.ui.column.Column) Text(elemental2.dom.Text)

Example 4 with Event

use of elemental2.dom.Event in project domino-ui-demo by DominoKit.

the class CardsViewImpl method collapsibleCards.

private void collapsibleCards() {
    element.appendChild(BlockHeader.create("COLLAPSIBLE CARDS", "cards can be collapsible.").asElement());
    Column column = Column.create().onLarge(OnLarge.four).onMedium(OnMedium.four).onSmall(OnSmall.twelve).onXSmall(OnXSmall.twelve);
    element.appendChild(Row.create().addColumn(column.addElement(Card.create("Card Title", "Description text here...").setCollapsible().setHeaderBackground(Background.THEME).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.ALL.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).addColumn(column.copy().addElement(Card.create("Card Title", "Description text here...").setCollapsible().setHeaderBackground(Background.BROWN).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).asElement())).addColumn(column.copy().addElement(Card.create("Card Title", "Description text here...").setCollapsible().collapse().setHeaderBackground(Background.CYAN).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).addHeaderAction(Icons.NAVIGATION_ICONS.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).asElement());
    element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.collapsibleCards()).asElement());
}
Also used : Icons(org.dominokit.domino.ui.icons.Icons) UiView(org.dominokit.domino.api.client.annotations.UiView) CardsPresenter(org.dominokit.domino.cards.client.presenters.CardsPresenter) DomGlobal(elemental2.dom.DomGlobal) ComponentView(org.dominokit.domino.componentcase.shared.extension.ComponentView) CodeResource(org.dominokit.domino.cards.client.views.CodeResource) Column(org.dominokit.domino.ui.column.Column) BlockHeader(org.dominokit.domino.ui.header.BlockHeader) CardsView(org.dominokit.domino.cards.client.views.CardsView) Row(org.dominokit.domino.ui.row.Row) HTMLDivElement(elemental2.dom.HTMLDivElement) Text(elemental2.dom.Text) Card(org.dominokit.domino.ui.cards.Card) Elements(org.jboss.gwt.elemento.core.Elements) Background(org.dominokit.domino.ui.style.Background) Column(org.dominokit.domino.ui.column.Column) Text(elemental2.dom.Text)

Example 5 with Event

use of elemental2.dom.Event in project kie-wb-common by kiegroup.

the class StructureTypesTooltipView method isOutside.

boolean isOutside(final Event event) {
    final HTMLElement element = getElement();
    final HTMLElement target = (HTMLElement) event.target;
    return !element.contains(target) && isTooltipVisible();
}
Also used : HTMLElement(elemental2.dom.HTMLElement)

Aggregations

Test (org.junit.Test)50 HTMLElement (elemental2.dom.HTMLElement)27 Event (elemental2.dom.Event)26 KeyboardEvent (elemental2.dom.KeyboardEvent)19 Element (elemental2.dom.Element)18 MouseEvent (elemental2.dom.MouseEvent)16 HTMLDivElement (elemental2.dom.HTMLDivElement)15 HTMLInputElement (elemental2.dom.HTMLInputElement)13 HTMLButtonElement (elemental2.dom.HTMLButtonElement)12 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)10 BlurEvent (com.google.gwt.event.dom.client.BlurEvent)7 CSSStyleDeclaration (elemental2.dom.CSSStyleDeclaration)7 JQuery (org.uberfire.client.views.pfly.selectpicker.JQuery)7 DOMRect (elemental2.dom.DOMRect)5 DOMTokenList (elemental2.dom.DOMTokenList)5 DomGlobal (elemental2.dom.DomGlobal)5 LazyReverseView (com.github.mvp4g.mvp4g2.core.ui.LazyReverseView)4 AbstractCell (com.google.gwt.cell.client.AbstractCell)4 Elements.button (org.jboss.gwt.elemento.core.Elements.button)4 Elements.div (org.jboss.gwt.elemento.core.Elements.div)4