com.github.fluorumlabs.disconnect.vaadin.Details Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of disconnect-vaadin Show documentation
Show all versions of disconnect-vaadin Show documentation
Vaadin components bindings for Disconnect Zero
The newest version!
package com.github.fluorumlabs.disconnect.vaadin;
import com.github.fluorumlabs.disconnect.core.annotations.WebComponent;
import com.github.fluorumlabs.disconnect.polymer.types.BooleanPropertyChangeEvent;
import com.github.fluorumlabs.disconnect.vaadin.elements.DetailsElement;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasControlStateMixin;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasElementMixin;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasThemableMixin;
import com.github.fluorumlabs.disconnect.vaadin.types.ThemeVariant;
import com.github.fluorumlabs.disconnect.zero.component.*;
import com.github.fluorumlabs.disconnect.zero.observable.ObservableEvent;
import js.extras.JsEnum;
/**
* <vaadin-details>
is a Web Component which the creates an
* expandable panel similar to <details>
HTML element.
*
* <vaadin-details>
* <div slot="summary">Expandable Details</div>
* Toggle using mouse, Enter and Space keys.
* </vaadin-details>
*
* Styling
* The following shadow DOM parts are exposed for styling:
*
*
*
* Part name Description
*
*
* summary
The element used to open and close collapsible content.
* toggle
The element used as indicator, can represent an icon.
* summary-content
The wrapper for the slotted summary content.
* content
The wrapper for the collapsible details content.
*
*
* The following attributes are exposed for styling:
*
*
*
* Attribute Description
*
*
* opened
Set when the collapsible content is expanded and visible.
* disabled
Set when the element is disabled.
* focus-ring
Set when the element is focused using the keyboard.
* focused
Set when the element is focused.
*
*
* See
* ThemableMixin – how to apply styles for shadow parts
*/
@WebComponent
public class Details extends AbstractComponent
implements HasControlStateMixin,
HasElementMixin,
HasThemableMixin,
HasSlots,
HasStyle, HasComponents> {
public Details() {
super(DetailsElement.TAGNAME());
}
/**
* If true, the details content is visible.
*/
public boolean opened() {
return getNode().isOpened();
}
/**
* If true, the details content is visible.
*/
public Details opened(boolean opened) {
getNode().setOpened(opened);
return this;
}
/**
* Fired when the opened
property changes.
*/
public ObservableEvent openedChangedEvent() {
return createEvent("opened-changed");
}
public HasSlots.Container summarySlot() {
return slotted("summary");
}
public abstract static class Variant extends ThemeVariant {
public static final Variant FILLED = JsEnum.of("filled");
public static final Variant SMALL = JsEnum.of("small");
public static final Variant REVERSE = JsEnum.of("reverse");
}
}