Pagination

The Pagination component is used to show the current page and the total number of pages.

Import
the javascript logo
import { Pagination } from "@schukai/monster/source/components/datatable/pagination.mjs";
Source
the git logo
Package
the npm logo
Since
1.0.0

Pagination

Javascript

/** this example does not use an extra script **/

HTML

/** this example does not use an extra html file **/

Stylesheet

/** no additional stylesheet is defined **/

HTML Structure

<monster-pagination></monster-pagination>

JavaScript Initialization

const element = document.createElement('monster-pagination');
document.body.appendChild(element);

Exported

Pagination

Derived from

CustomElement

Options

The Options listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the CustomElement.

Option
Type
Default
Description
templates
object
Template definitions
templates.main
string
undefined
Main template
datasource
object
Datasource configuration
datasource.selector
string
Datasource selector
labels
object
undefined
Label definitions
labels.page
string
undefined
Page label
labels.description
string
undefined
Description label
labels.previous
string
undefined
Previous label
labels.next
string
undefined
Next label
labels.of
string
undefined
Of label
href
string
page-${page}
Href
currentPage
number
Current page
pages
number
Pages
objectsPerPage
number
20
Objects per page
mapping
object
Mapping
mapping.pages
string
sys.pagination.pages
Pages mapping
mapping.objectsPerPage
string
sys.pagination.objectsPerPage
Objects per page mapping
mapping.currentPage
string
sys.pagination.currentPage
Current page mapping

  • since
  • deprecated

Properties and Attributes

The Properties and Attributes listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class and ultimately from HTMLElement. Therefore, it inherits Properties and Attributes from these parent classes. If you cannot find a specific Properties and Attributes in this list, we recommend consulting the documentation of the CustomElement.

  • data-monster-options: Sets the configuration options for the collapse component when used as an HTML attribute.
  • data-monster-option-[name]: Sets the value of the configuration option [name] for the collapse component when used as an HTML attribute.

Methods

The methods listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class and ultimately from HTMLElement. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the CustomElement.

Constructor

constructor()

Structural methods

setPaginationState(state)
Parameters
  • state {object}: - The state object for the pagination.
Returns
  • {void}
Sets the pagination state directly, without requiring a datasource. This is useful for controlling the component programmatically.

Static methods

[instanceSymbol]()
Returns
  • {symbol}
This method is called by the instanceof operator.
getControlCSSStyleSheet()
Returns
  • {CSSStyleSheet}
getCSSStyleSheet()
Returns
  • {CSSStyleSheet[]}
getTag()
Returns
  • {string}

Lifecycle methods

Lifecycle methods are called by the environment and are usually not intended to be called directly.

[assembleMethodSymbol]()
Returns
  • {void}
connectedCallback()
Returns
  • {void}
disconnectedCallback()
Returns
  • {void}

Events

This component does not fire any public events. It may fire events that are inherited from its parent classes.

The current width of the area is too small to display the content correctly.