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

com.github.fluorumlabs.disconnect.vaadin.Details Maven / Gradle / Ivy

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 nameDescription
summaryThe element used to open and close collapsible content.
toggleThe element used as indicator, can represent an icon.
summary-contentThe wrapper for the slotted summary content.
contentThe wrapper for the collapsible details content.
* The following attributes are exposed for styling: * * * * * * * * * * * *
AttributeDescription
openedSet when the collapsible content is expanded and visible.
disabledSet when the element is disabled.
focus-ringSet when the element is focused using the keyboard.
focusedSet 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"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy