Class JmixSidePanelLayout

java.lang.Object
com.vaadin.flow.component.Component
io.jmix.flowui.kit.component.sidepanellayout.JmixSidePanelLayout
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, Serializable
Direct Known Subclasses:
SidePanelLayout

@Tag("jmix-side-panel-layout") @JsModule("./src/side-panel-layout/jmix-side-panel-layout.js") public class JmixSidePanelLayout extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle
See Also:
  • Field Details

    • content

      protected com.vaadin.flow.component.Component content
    • sidePanelContent

      protected com.vaadin.flow.component.Component sidePanelContent
    • componentInertManager

      protected JmixSidePanelLayout.ComponentInertManager componentInertManager
  • Constructor Details

    • JmixSidePanelLayout

      public JmixSidePanelLayout()
  • Method Details

    • getContent

      @Nullable public com.vaadin.flow.component.Component getContent()
      Returns:
      the layout content
    • setContent

      public void setContent(@Nullable com.vaadin.flow.component.Component content)
      Sets the content that should be overlapped or pushed aside by the side panel.
      Parameters:
      content - the content to set
    • getSidePanelContent

      @Nullable public com.vaadin.flow.component.Component getSidePanelContent()
      Returns:
      side panel content components or null if no side panel content is set
    • setSidePanelContent

      public void setSidePanelContent(@Nullable com.vaadin.flow.component.Component sidePanelContent)
      Sets the side panel content components.
      Parameters:
      sidePanelContent - content to set
    • isModal

      public boolean isModal()
      Returns:
      whether the side panel is modal
    • setModal

      public void setModal(boolean modal)
      Sets whether the side panel should be modal. If true, the content will not receive requests from client-side even if the modality curtain is removed.

      The default value is true.

      Parameters:
      modal - whether the side panel should be modal
    • isSidePanelOverlay

      public boolean isSidePanelOverlay()
      Returns:
      true if the side panel should overlay layout content when it is opened
    • setSidePanelOverlay

      public void setSidePanelOverlay(boolean overlay)
      Sets whether the side panel should overlay layout content when it is opened.

      The default value is true.

      Parameters:
      overlay - overlay option
    • getSidePanelPosition

      public SidePanelPosition getSidePanelPosition()
      Returns:
      the side panel position
    • setSidePanelPosition

      public void setSidePanelPosition(SidePanelPosition position)
      Sets the side panel position.
      Parameters:
      position - side panel position to set
    • isCloseOnOutsideClick

      public boolean isCloseOnOutsideClick()
      Returns:
      whether the side panel should be closed when the user clicks on outside of panel but within the JmixSidePanelLayout
    • setCloseOnOutsideClick

      public void setCloseOnOutsideClick(boolean closeOnOutsideClick)
      Sets whether the side panel should be closed when the user clicks on outside of panel but within the JmixSidePanelLayout.

      The default value is true.

      Parameters:
      closeOnOutsideClick - closeOnClick option
    • isDisplayAsOverlayOnSmallDevices

      public boolean isDisplayAsOverlayOnSmallDevices()
      Returns:
      whether the side panel should be displayed as an overlay on small screens.
    • setDisplayAsOverlayOnSmallDevices

      public void setDisplayAsOverlayOnSmallDevices(boolean displayAsOverlay)
      Sets whether the side panel should be displayed as an overlay on small screens. When enabled, the overlay appears in fullscreen mode.

      The default value is true.

      Parameters:
      displayAsOverlay - displayAsOverlay option
    • getOverlayAriaLabel

      @Nullable public String getOverlayAriaLabel()
      Returns:
      the aria-label for the overlay or null if no aria-label is set.
    • setOverlayAriaLabel

      public void setOverlayAriaLabel(@Nullable String ariaLabel)
      Sets the aria-label for the overlay.
      Parameters:
      ariaLabel - aria-label to set
      See Also:
    • getSidePanelHorizontalSize

      @Nullable public String getSidePanelHorizontalSize()
      Returns the width of the side panel when horizontal position is configured (SidePanelPosition.LEFT, SidePanelPosition.RIGHT, SidePanelPosition.INLINE_START or SidePanelPosition.INLINE_END).

      Note that this does not return the actual size of the side panel but the width which has been set using setSidePanelHorizontalSize(String).

      Returns:
      the width defined for the side panel or null if width is not set
    • setSidePanelHorizontalSize

      public void setSidePanelHorizontalSize(@Nullable String size)
      Sets the width of the side panel when position is horizontal (SidePanelPosition.LEFT, SidePanelPosition.RIGHT, SidePanelPosition.INLINE_START, SidePanelPosition.INLINE_END).

      The width should be in a format understood by the browser, e.g. "100px" or "2.5em".

      The default value is taken from the CSS property --jmix-side-panel-layout-horizontal-size. If it is not set, the default value is auto.

      Parameters:
      size - width to set or null to remove the inline width from the style
    • getSidePanelHorizontalMaxSize

      @Nullable public String getSidePanelHorizontalMaxSize()
      Returns the max-width of the side panel when horizontal position is configured (SidePanelPosition.LEFT, SidePanelPosition.RIGHT, SidePanelPosition.INLINE_START or SidePanelPosition.INLINE_END).

      Note that this does not return the actual size of the side panel but the max-width which has been set using setSidePanelHorizontalMaxSize(String).

      Returns:
      the max-width defined for the side panel or null if max-width is not set
    • setSidePanelHorizontalMaxSize

      public void setSidePanelHorizontalMaxSize(@Nullable String maxSize)
      Sets the max-width of the side panel when position is horizontal (SidePanelPosition.LEFT, SidePanelPosition.RIGHT, SidePanelPosition.INLINE_START, SidePanelPosition.INLINE_END).

      The max-width should be in a format understood by the browser, e.g. "100px" or "2.5em".

      The default max-width is taken from the theme variable --jmix-side-panel-layout-horizontal-max-size. If it is not set, the default value is 50%.

      Parameters:
      maxSize - max-width to set or null to remove the inline max-width property from the style
    • getSidePanelHorizontalMinSize

      @Nullable public String getSidePanelHorizontalMinSize()
      Returns the min-width of the side panel when horizontal position is configured (SidePanelPosition.LEFT, SidePanelPosition.RIGHT, SidePanelPosition.INLINE_START or SidePanelPosition.INLINE_END).

      Note that this does not return the actual size of the side panel but the min-width which has been set using setSidePanelHorizontalMinSize(String).

      Returns:
      the min-width defined for the side panel or null if the min-width is not set
    • setSidePanelHorizontalMinSize

      public void setSidePanelHorizontalMinSize(@Nullable String minSize)
      Sets the min-width of the side panel when position is horizontal (SidePanelPosition.LEFT, SidePanelPosition.RIGHT, SidePanelPosition.INLINE_START, SidePanelPosition.INLINE_END).

      The min-width should be in a format understood by the browser, e.g. "100px" or "2.5em".

      The default min-width is taken from the theme variable --jmix-side-panel-layout-horizontal-min-size. If it is not set, the default value is 14em.

      Parameters:
      minSize - min-width to set or null to remove the inline min-width property from the style
    • getSidePanelVerticalSize

      @Nullable public String getSidePanelVerticalSize()
      Returns the height of the side panel when vertical position is configured (SidePanelPosition.TOP, SidePanelPosition.BOTTOM).

      Note that this does not return the actual size of the side panel but the height which has been set using setSidePanelVerticalSize(String).

      Returns:
      the height defined for the side panel or null if the height is not set
    • setSidePanelVerticalSize

      public void setSidePanelVerticalSize(@Nullable String size)
      Sets the height of the side panel when side position is horizontal (SidePanelPosition.TOP, SidePanelPosition.BOTTOM).

      The height should be in a format understood by the browser, e.g. "100px" or "2.5em".

      The default height is taken from the theme variable --jmix-side-panel-layout-vertical-size. If it is not set, the default value is auto.

      Parameters:
      size - height to set or null to remove the inline height property from the style
    • getSidePanelVerticalMaxSize

      @Nullable public String getSidePanelVerticalMaxSize()
      Returns the max-height of the dialog when vertical position is configured (SidePanelPosition.TOP, SidePanelPosition.BOTTOM).

      Note that this does not return the actual size of the side panel but the max-height which has been set using setSidePanelVerticalMaxSize(String).

      Returns:
      the max-height defined for the side panel or null if the max-height is not set
    • setSidePanelVerticalMaxSize

      public void setSidePanelVerticalMaxSize(@Nullable String maxSize)
      Sets the max-height of the side panel when side panel position is horizontal (SidePanelPosition.TOP, SidePanelPosition.BOTTOM).

      The max-height should be in a format understood by the browser, e.g. "100px" or "2.5em".

      The default max-height is taken from the theme variable --jmix-side-panel-layout-vertical-max-size. If it is not set, the default value is 50%.

      Parameters:
      maxSize - max-height to set or null to remove the inline max-height property from style
    • getSidePanelVerticalMinSize

      @Nullable public String getSidePanelVerticalMinSize()
      Returns the min-height of the dialog when vertical position is configured (SidePanelPosition.TOP, SidePanelPosition.BOTTOM).

      Note that this does not return the actual size of the side panel but the min-height which has been set using setSidePanelVerticalMinSize(String).

      Returns:
      the min-height defined for the side panel or null if the min-height is not set
    • setSidePanelVerticalMinSize

      public void setSidePanelVerticalMinSize(@Nullable String minSize)
      Sets the min-height of the side panel when position is horizontal (SidePanelPosition.TOP, SidePanelPosition.BOTTOM).

      The min-height should be in a format understood by the browser, e.g. "100px" or "2.5em".

      The default min-height is taken from the theme variable --jmix-side-panel-layout-vertical-min-size. If it is not set, the default value is 10em.

      Parameters:
      minSize - min-height to set or null to remove the inline min-height property from style
    • isSidePanelOpened

      @Synchronize(property="sidePanelOpened", value="side-panel-opened-changed", allowInert=true) public boolean isSidePanelOpened()
      Returns:
      whether the side panel is opened
    • openSidePanel

      public void openSidePanel()
      Opens the side panel.
    • closeSidePanel

      public void closeSidePanel()
      Closes the side panel.
    • toggleSidePanel

      public void toggleSidePanel()
      Opens or closes the side panel depending on the panel's state.
    • addModalityCurtainClickListener

      public com.vaadin.flow.shared.Registration addModalityCurtainClickListener(com.vaadin.flow.component.ComponentEventListener<ModalityCurtainClickEvent> listener)
      Adds a listener to handle modality curtain clicks.
      Parameters:
      listener - listener to add
      Returns:
      a registration for removing the listener
    • addSidePanelBeforeOpenListener

      public com.vaadin.flow.shared.Registration addSidePanelBeforeOpenListener(com.vaadin.flow.component.ComponentEventListener<SidePanelBeforeOpenEvent> listener)
      Adds a listener to handle side panel open events.
      Parameters:
      listener - listener to add
      Returns:
      a registration for removing the listener
    • addSidePanelAfterOpenListener

      public com.vaadin.flow.shared.Registration addSidePanelAfterOpenListener(com.vaadin.flow.component.ComponentEventListener<SidePanelAfterOpenEvent> listener)
      Adds a listener to handle the side panel after open events.
      Parameters:
      listener - listener to add
      Returns:
      a registration for removing the listener
    • addSidePanelCloseListener

      public com.vaadin.flow.shared.Registration addSidePanelCloseListener(com.vaadin.flow.component.ComponentEventListener<SidePanelCloseEvent> listener)
      Adds a listener to handle side panel close events.
      Parameters:
      listener - listener to add
      Returns:
      a registration for removing the listener
    • doSetOpened

      protected void doSetOpened(boolean opened, boolean fromClient)
    • fireSidePanelBeforeOpenEvent

      protected void fireSidePanelBeforeOpenEvent(boolean fromClient)
    • fireSidePanelCloseEvent

      protected void fireSidePanelCloseEvent(boolean fromClient)
    • addComponent

      protected void addComponent(com.vaadin.flow.component.Component... components)
    • removeComponent

      protected void removeComponent(com.vaadin.flow.component.Component... components)
    • updateContentInert

      protected void updateContentInert(boolean modal)
    • updateSlot

      protected void updateSlot(String slot, com.vaadin.flow.component.Component... components)
    • attachSidePanelOpenedChangedListener

      protected void attachSidePanelOpenedChangedListener()
    • onSidePanelOpenedChanged

      protected void onSidePanelOpenedChanged(com.vaadin.flow.dom.PropertyChangeEvent event)
    • createComponentInertManager

      protected JmixSidePanelLayout.ComponentInertManager createComponentInertManager(com.vaadin.flow.component.Component content)
    • onAttach

      protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
      Overrides:
      onAttach in class com.vaadin.flow.component.Component
    • onDetach

      protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
      Overrides:
      onDetach in class com.vaadin.flow.component.Component