Options
All
  • Public
  • Public/Protected
  • All
Menu

<acc-side-panel label="App Name"> The side panel element is a collapsable menu that houses UI elements. It simplifies tab management, heading structure and provides a "skip to content" link when navigated with keyboard.

example

<acc-side-panel label="App Name">
 <acc-group label="Group 1">
     <acc-range label="Slider" value="5" max="10"></acc-range>
     <acc-button label="Button"></acc-button>
 </acc-group>
</acc-side-panel>

Hierarchy

Index

Properties

Protected _shortcutObserver

_shortcutObserver: KeyboardShortcutObserver

closed

closed: boolean = false

is the side panel in its collapsed state

disableSkipToContent

disableSkipToContent: boolean = false

skip to content shows up in the tab order of the side panel and emits the 'skiptocontent' event. Setting this to true, hides it

disabled

disabled: boolean = false

disable the element, make it inaccessible

hideLabel

hideLabel: boolean = false

hide the label of the group, only provide for aria

label

label: string = ""

the label for the element, useful for display as well as screen readers

renderComplete

renderComplete: Promise<boolean>

Returns a promise which resolves after the element next renders. The promise resolves to true if the element rendered and false if the element did not render. This is useful when users (e.g. tests) need to react to the rendered state of the element after a change is made. This can also be useful in event handlers if it is desireable to wait to send an event until after rendering. If possible implement the _didRender method to directly respond to rendering within the rendering lifecycle.

shortcut

shortcut: string = ""

a keyboard shortcut to access the element

Methods

Protected _applyRender

  • _applyRender(result: TemplateResult, node: Element | DocumentFragment): void
  • Renders the given lit-html template result into the given node. Implement to customize the way rendering is applied. This is should not typically be needed and is provided for advanced use cases.

    Parameters

    • result: TemplateResult

      lit-html template result to render

    • node: Element | DocumentFragment

      node into which to render

    Returns void

Protected _createRoot

  • _createRoot(): Element | DocumentFragment
  • Implement to customize where the element's template is rendered by returning an element into which to render. By default this creates a shadowRoot for the element. To render into the element's childNodes, return this.

    Returns Element | DocumentFragment

    Returns a node into which to render.

_didRender

  • _didRender(props: any, changed: any, prev: any): void
  • Parameters

    • props: any
    • changed: any
    • prev: any

    Returns void

_firstRendered

  • _firstRendered(): void
  • Called after the element DOM is rendered for the first time. Implement to perform tasks after first rendering like capturing a reference to a static node which must be directly manipulated. This should not be commonly needed. For tasks which should be performed before first render, use the element constructor.

    Returns void

_flushProperties

  • _flushProperties(): void
  • Returns void

_handleShortcut

  • _handleShortcut(): void

_invalidateProperties

  • _invalidateProperties(): void
  • Override which provides tracking of invalidated state.

    Returns void

_propertiesChanged

  • _propertiesChanged(props: PanelProperties, changed: any, prev: any): void

_render

  • _render(__namedParameters: object): TemplateResult
  • Parameters

    • __namedParameters: object
      • disableSkipToContent: boolean
      • label: string

    Returns TemplateResult

_shouldPropertiesChange

  • _shouldPropertiesChange(_props: object, _changedProps: object, _prevProps: object): boolean
  • Override which returns the value of _shouldRender which users should implement to control rendering. If this method returns false, _propertiesChanged will not be called and no rendering will occur even if property values change or requestRender is called.

    Parameters

    • _props: object

      Current element properties

    • _changedProps: object

      Changing element properties

    • _prevProps: object

      Previous element properties

    Returns boolean

    Default implementation always returns true.

_shouldPropertyChange

  • _shouldPropertyChange(property: string, value: any, old: any): boolean
  • Override which warns when a user attempts to change a property during the rendering lifecycle. This is an anti-pattern and should be avoided.

    Parameters

    • property: string
    • value: any
    • old: any

    Returns boolean

Protected _shouldRender

  • _shouldRender(_props: object, _changedProps: object, _prevProps: object): boolean
  • Implement to control if rendering should occur when property values change or requestRender is called. By default, this method always returns true, but this can be customized as an optimization to avoid rendering work when changes occur which should not be rendered.

    Parameters

    • _props: object

      Current element properties

    • _changedProps: object

      Changing element properties

    • _prevProps: object

      Previous element properties

    Returns boolean

    Default implementation always returns true.

connectedCallback

  • connectedCallback(): void

disconnectedCallback

  • disconnectedCallback(): void

focus

  • focus(): void

getValue

  • getValue(name: string): any
  • Parameters

    • name: string

    Returns any

query

  • query(name: string, eventType?: string, eventHandler?: EventHandlerNonNull): HTMLElement | null
  • Parameters

    • name: string
    • Optional eventType: string
    • Optional eventHandler: EventHandlerNonNull

    Returns HTMLElement | null

ready

  • ready(): void
  • Override which sets up element rendering by calling* _createRoot and _firstRendered.

    Returns void

requestRender

  • requestRender(): void
  • Call to request the element to asynchronously re-render regardless of whether or not any property changes are pending.

    Returns void

skipToContent

  • skipToContent(): void
  • Returns void