Source code for dazzler.components.extra._pager

"""Autogenerated file: DO NOT EDIT!"""
import typing  # noqa: F401
from dazzler.system import Component, Aspect, UNDEFINED  # noqa: F401


[docs]class Pager(Component): """ Paging for dazzler apps. :CSS: - ``dazzler-extra-pager`` - ``page`` """ total_items = Aspect(required=True, docstring="The total items in the set.") # noqa: E501 items_per_page = Aspect(default=10, docstring="The number of items a page contains. (default=10)") # noqa: E501 style = Aspect(docstring="Style object for the top level wrapper of the component.") # noqa: E501 class_name = Aspect(docstring="Class name automatically added by dazzler api with a prefix for the component library.ie: core component Container become ``dazzler-core-container``.When added on the component, the class names will be concatenated.") # noqa: E501 page_style = Aspect(docstring="Style for the page numbers.") page_class_name = Aspect(docstring="CSS class for the page numbers.") pages_displayed = Aspect(default=10, docstring="The number of pages displayed by the pager. (default=10)") # noqa: E501 pages = Aspect(docstring="Read only, the currently displayed pages numbers.") # noqa: E501 current_page = Aspect(default=1, docstring="The current selected page. (default=1)") # noqa: E501 total_pages = Aspect(docstring="Set by total_items / items_per_page") start_offset = Aspect(docstring="The starting index of the current pageCan be used to slice data eg: data[start_offset: end_offset]") # noqa: E501 end_offset = Aspect(docstring="The end index of the current page.") next_label = Aspect(default=UNDEFINED, docstring="Label for the next button. (default='next')") # noqa: E501 previous_label = Aspect(default=UNDEFINED, docstring="Text or component to use for the previous button. (default='previous')") # noqa: E501
[docs] def __init__( self, total_items: typing.Union[float, int], items_per_page: typing.Optional[typing.Union[float, int]] = 10, style: typing.Optional[typing.Dict] = UNDEFINED, class_name: typing.Optional[str] = UNDEFINED, page_style: typing.Optional[typing.Dict] = UNDEFINED, page_class_name: typing.Optional[str] = UNDEFINED, pages_displayed: typing.Optional[typing.Union[float, int]] = 10, pages: typing.Optional[typing.List[typing.Union[float, int]]] = UNDEFINED, # noqa: E501 current_page: typing.Optional[typing.Union[float, int]] = 1, total_pages: typing.Optional[typing.Union[float, int]] = UNDEFINED, # noqa: E501 start_offset: typing.Optional[typing.Union[float, int]] = UNDEFINED, # noqa: E501 end_offset: typing.Optional[typing.Union[float, int]] = UNDEFINED, next_label: typing.Optional[typing.Any] = UNDEFINED, previous_label: typing.Optional[typing.Any] = UNDEFINED, identity: str = None ): """ :param total_items: The total items in the set. :param items_per_page: The number of items a page contains. (default=10) :param style: Style object for the top level wrapper of the component. :param class_name: Class name automatically added by dazzler api with a prefix for the component library. ie: core component Container become ``dazzler-core-container``. When added on the component, the class names will be concatenated. :param page_style: Style for the page numbers. :param page_class_name: CSS class for the page numbers. :param pages_displayed: The number of pages displayed by the pager. (default=10) :param pages: Read only, the currently displayed pages numbers. :param current_page: The current selected page. (default=1) :param total_pages: Set by total_items / items_per_page :param start_offset: The starting index of the current page Can be used to slice data eg: data[start_offset: end_offset] :param end_offset: The end index of the current page. :param next_label: Label for the next button. (default='next') :param previous_label: Text or component to use for the previous button. (default='previous') """ Component.__init__(self, locals(), identity)