A list page.

Provides functionality to dynamically load initial data and keep loading additional data.

Extends a hylo-page-default component. Meant to be used in combination with hylo-template and a site which loads its pages dynamically.

Has to contain a hylo-data-connector component which defines the connection in order to load sets of list items.

Slots:

  • default: top of the page
  • list: when empty, the "empty" slot is shown
  • empty: hidden as long the "list" slot has content
  • bottom: bottom of the page

Properties

addPageWidth: boolean

Wraps the content with a hylo-page-width component if the content itself does not contain one.

announcementAllItemsLoaded: string

Announced when loading of all list elements finished. Triggered when "done" is set to true.

Its hylo-page-root translations object key is "pageListAnnouncementAllItemsLoaded".

announcementElement: string | HTMLHyloAccessibilityAnnouncementElement

An HTMLHyloAccessibilityAnnouncementElement component either as element or css query selection. If not set and hylo-page-root is present, it takes the announcement element from the hylo-page-root component.

Used to announce the loading status of the list.

announcementItemsLoaded: string

Announced when loading of list elements finished. Triggered when loading ends.

Its hylo-page-root translations object key is "pageListAnnouncementItemsLoaded".

announcementItemsLoading: string

Announced when loading of list elements starts. Triggered when loading starts

Its hylo-page-root translations object key is "pageListAnnouncementItemsLoading".

bottomClass: string = ''

Classes added to the wrapped of the bottom content.

checkForListText: boolean

By default the list is considered empty if the list slot does not contain any markup or text. By switching this property on, only missing text content is considered empty.

componentDidActivate: Function

A function called when the component gets activated again through an ancestor hylo-nav component either because it is the loaded page component or it is a child of a hylo-template component.

componentWillDeactivate: Function

A function called when the component will get deactivated through an ancestor hylo-nav component either because it is the loaded page component or it is a child of a hylo-template component.

done: boolean = true

Hides the loader and puts the loader on hold. When un"done" again, the loader stays on hold. The loader is initially on done and needs to be un"done" by switching "done" to false. When "hold" is set to false, "done" is also set to "false" automatically. The loader puts itself on done when the list slot is empty.

emptyClass: string = ''

Classes added to the wrapped of the empty content.

hide: boolean = false

The loader animation is part of the loader but it is not the loader itself. It is possible to have the loader without the animation by setting "hide" to true.

hideEmpty: boolean = false

If set, the empty slot is hidden. Can be used to hide the empty field until the first set is loaded.

hold: boolean = true

Puts the loader on hold when in use, busy loading data. The loader does not fire "hyloListEnd" when on hold. You're still able to call the loader function. All it's doing is to prevent the firing of "hyloListEnd". The loader is initially on hold and needs to be activated by switching "hold" to false. The loader puts itself on hold when firing "hyloListEnd" and when the list slot is empty.

The loader is still showing, only the event gets disabled. Use "done" to hide the loader. When set to false, "done" is also set to "false".

listClass: string = ''

Classes added to the wrapped of the list content.

loaderDelay: number = 1000

The delay with which the loader gets activated again after it was on hold. Deactivation is immediately.

loaderThreshold: number = null

A positive offset in pixel for the loader to signal the end of the list by firing "hyloListEnd". Measured from the bottom of the page.

Has to be set to use the loader.

set: string

The parameter name which defines the set to be loaded. It will contain the index or the starting index if the set is defined by a starting and end index when loading a set.

Is added as parameter to the load request.

setEnd: string

If the set is defined by a starting and end index, this property defines the name of the end parameter.

Is added as parameter to the load request.

setIndex: number = 0

The (starting) index of the to be loaded set.

Has to be reset when starting a new loading sequence.

setMargin: number

Gets added to the "setIndex" to define the "setEnd" value.

setNext: number = 1

Gets added to the "setIndex" when "loadNext()".

topClass: string = ''

Classes added to the wrapped of the top content.

trackListFocus: boolean

Tracks the focused elements inside the list slot and when "hold" is set to false, gives the last tracked focused element the focus back. Ignores elements which itself or one of its ancestors have the class "dont-track-focus".

Methods

  • Removes all elements in the "list" slot.

    Returns Promise<void>

  • Returns the wrapper of the empty slot.

    Returns Promise<HTMLElement>

  • Returns the wrapper of the list slot.

    Returns Promise<HTMLElement>

  • Is the component ready to load data or is data being loaded right now.

    Returns Promise<boolean>

  • Loads the current set. Puts the loader on hold when in use.

    The returned promise resolves with "null" if the component is not ready, busy because its loading data right now. The returned promise resolves with "false" if an error occurs.

    Parameters

    • parameters: any = {}

      additional parameters added to the request (optional)

    Returns Promise<any>

  • Sets the "setIndex" to the next set by adding "setNext" and loads the set. Puts the loader on hold when in use.

    The returned promise resolves with "null" if the component is not ready, busy because its loading data right now. The returned promise resolves with "false" if an error occurs.

    Parameters

    • parameters: any = {}

      additional parameters added to the request (optional)

    Returns Promise<any>

Events

hyloListEnd: EventEmitter<any>

If the loader is in use, fires when the loader threshold is reached.

Generated using TypeDoc