Tableau de Données et Liste Paginée Angular | ng-hub-ui-paginable

Tableau de données et liste paginée Angular avec pagination côté serveur, tri, filtrage, sélection, templates et variables CSS.

Référence API

Voici le contrat complet de paginable : tout ce que vous pouvez lier, écouter, projeter et personnaliser, réuni au même endroit. Branchez ce dont vous avez besoin et stylisez ce que vous voulez — c’est standalone et compatible avec les signals.

Inputs

Réglez paginable à votre goût avec 10 inputs. Liez-les comme n’importe quel @Input Angular.

NomTypePar défautDescription
dataObligatoireT[] | Observable<T[]>Tableau d'éléments de données à afficher dans la table ou Observable qui émet des tableaux de données.
headersObligatoirePaginableTableHeader[]Tableau de configuration définissant les colonnes de la table et leurs propriétés.
paginationPaginableTablePaginationConfiguration de la pagination, y compris la taille de page, la page courante et le nombre total d'éléments.
optionsPaginableTableOptionsOptions générales de la table, y compris le mode de sélection, l'état de chargement et le comportement responsive.
loadingbooleanAffiche l'état de chargement avec une superposition de spinner.
errorunknown | nullDOCS.PAGINABLE.API.INPUT.ERROR.DESCRIPTION
loadingComponentPaginableStateDefault | nullDOCS.PAGINABLE.API.INPUT.LOADING_COMPONENT.DESCRIPTION
errorComponentPaginableStateDefault | nullDOCS.PAGINABLE.API.INPUT.ERROR_COMPONENT.DESCRIPTION
noResultsComponentPaginableStateDefault | nullDOCS.PAGINABLE.API.INPUT.NO_RESULTS_COMPONENT.DESCRIPTION
selectedT[]Tableau des éléments actuellement sélectionnés (liaison bidirectionnelle prise en charge).

Outputs

Réagissez à ce que fait paginable — 5 événements sur lesquels accrocher votre logique.

NomTypeDescription
rowClickTableRowEvent<T>Émis lorsqu'une ligne de la table est cliquée, inclut les données de la ligne et les détails de l'événement.
selectionChangeT[]Émis lorsque la sélection des lignes change, renvoie le tableau des éléments sélectionnés.
sortChangePaginableTableOrdination[]Émis lorsque le tri des colonnes change, renvoie la configuration de tri courante.
filterChangeFilterChangeEventÉmis lorsque les filtres sont appliqués ou modifiés.
pageChangePaginationStateÉmis lorsque la pagination change (numéro ou taille de page).

Templates

Faites-le vôtre — 7 emplacements de template vous permettent de projeter votre propre balisage.

NomDescriptionExemple
*paginableTableHeaderModèle d'en-tête personnalisé pour définir des en-têtes de colonne personnalisés.<ng-template *paginableTableHeader="let column">{{ column.title }}</ng-template>
*paginableTableCellModèle de cellule personnalisé pour personnaliser le rendu du contenu des cellules.<ng-template *paginableTableCell="let value; let row">{{ value }}</ng-template>
*paginableTableRowModèle de ligne personnalisé pour définir la structure entière de la ligne.<ng-template *paginableTableRow="let row"><tr>...</tr></ng-template>
*paginableTableFilterModèle de filtre personnalisé pour ajouter des éléments d'interface de filtrage.<ng-template *paginableTableFilter="let column"><input type="text"></ng-template>
*paginableTableLoadingModèle d'état de chargement pour des indicateurs de chargement personnalisés.<ng-template *paginableTableLoading><div class="spinner"></div></ng-template>
*paginableNoResultsModèle d'état vide affiché lorsqu'aucune donnée n'est disponible.<ng-template *paginableNoResults><p>No data found</p></ng-template>
*paginableTableErrorModèle d'état d'erreur pour gérer les conditions d'erreur.<ng-template *paginableTableError="let error"><p>Error: {{ error }}</p></ng-template>

Variables CSS

Personnalisez chaque pixel avec 69 variables CSS. Remplacez-les au niveau de :root ou limitez-les à un conteneur.

DOCS.PAGINABLE.API.CSS_GROUP.TABLE_COLORS.TITLE

DOCS.PAGINABLE.API.CSS_GROUP.TABLE_COLORS.DESCRIPTION

VariablePar défautTypeDescription
--hub-table-container-bgvar(--hub-ref-color-white, #fff)color Background of the entire table container. #f8f9favar(--bs-body-bg)
--hub-table-container-colorvar(--hub-sys-text-primary, #212529)color Default text colour inside the container. #333inherit
--hub-table-bgvar(--hub-ref-color-white, #fff)color Table element background. transparent#fff
--hub-table-colorvar(--hub-sys-text-primary, #212529)color Table text colour. #495057
--hub-table-border-colorvar(--hub-sys-border-color-default, #dee2e6)color Border colour used for table, rows and cells. #ccctransparent
--hub-table-hover-bgcolor Row background on hover. rgba(0,0,0,.04)#f0f4f8
--hub-table-hover-colorcolor Row text colour on hover. inherit
--hub-table-striped-bgcolor Alternating stripe row background. rgba(0,0,0,.03)
--hub-table-striped-colorcolor Alternating stripe row text colour. inherit
--hub-table-active-bgvar(--hub-sys-state-active-bg, rgba(0,0,0,.1))color Selected/active row background. #e3f2fd
--hub-table-active-colorvar(--hub-sys-text-primary, #212529)color Selected/active row text colour. inherit

DOCS.PAGINABLE.API.CSS_GROUP.TABLE_LAYOUT.TITLE

DOCS.PAGINABLE.API.CSS_GROUP.TABLE_LAYOUT.DESCRIPTION

VariablePar défautTypeDescription
--hub-table-border-radiusvar(--hub-ref-radius-md, 0.375rem)length Container corner radius. 00.5rem
--hub-table-border-widthvar(--hub-ref-border-width, 1px)length Border width. 02px
--hub-table-container-gapvar(--hub-ref-space-3, 1rem)length Gap between container regions (top bar, table, bottom bar). 0.5rem1.5rem
--hub-table-cell-padding-xvar(--hub-ref-space-3, 1rem)length Horizontal cell padding. 0.75rem1.5rem
--hub-table-cell-padding-yvar(--hub-ref-space-2, 0.5rem)length Vertical cell padding. 0.25rem0.75rem
--hub-table-cell-padding-x-smvar(--hub-ref-space-2, 0.5rem)length Horizontal cell padding in small/dense mode. 0.5rem
--hub-table-cell-padding-y-smvar(--hub-ref-space-1, 0.25rem)length Vertical cell padding in small/dense mode. 0.125rem
--hub-table-cell-vertical-alignmiddlestring Vertical alignment of cell content. topbottom

DOCS.PAGINABLE.API.CSS_GROUP.TABLE_BARS.TITLE

DOCS.PAGINABLE.API.CSS_GROUP.TABLE_BARS.DESCRIPTION

VariablePar défautTypeDescription
--hub-table-top-bar-gapvar(--hub-ref-space-3, 1rem)length Gap between items in the top bar. 0.5rem
--hub-table-top-bar-justify-contentendstring Flex justify-content for the top bar. space-betweencenter
--hub-table-bottom-bar-gapvar(--hub-ref-space-3, 1rem)length Gap between items in the bottom bar. 0.5rem
--hub-table-bottom-bar-justify-contentspace-aroundstring Flex justify-content for the bottom bar. space-between
--hub-table-bottom-bar-paginator-order1number Flex order of the paginator in the bottom bar. 3
--hub-table-bottom-bar-settings-order2number Flex order of the settings control. 1
--hub-table-bottom-bar-info-order3number Flex order of the info text. 1

DOCS.PAGINABLE.API.CSS_GROUP.TABLE_SEARCH.TITLE

DOCS.PAGINABLE.API.CSS_GROUP.TABLE_SEARCH.DESCRIPTION

VariablePar défautTypeDescription
--hub-table-search-border-radiuslength Search field border radius. 0.375rem9999px
--hub-table-search-input-bgcolor Search input background. #fff
--hub-table-search-input-colorcolor Search input text colour. #212529
--hub-table-search-button-bgcolor Search button background. var(--bs-primary)
--hub-table-search-button-colorcolor Search button icon/text colour. #fff

DOCS.PAGINABLE.API.CSS_GROUP.LIST_COLORS.TITLE

DOCS.PAGINABLE.API.CSS_GROUP.LIST_COLORS.DESCRIPTION

VariablePar défautTypeDescription
--hub-list-bgcolor List host background. #ffftransparent
--hub-list-items-bgcolor Background of the items container. #f8f9fa
--hub-list-item-bgcolor Individual item background. #fff
--hub-list-item-colorcolor Individual item text colour. #212529
--hub-list-item-hover-bgcolor Item background on hover. rgba(0,0,0,.04)
--hub-list-item-selected-bgcolor Selected item background. #e3f2fd
--hub-list-item-selected-colorcolor Selected item text colour. inherit
--hub-list-item-border-colorcolor Item border colour. #dee2e6

DOCS.PAGINABLE.API.CSS_GROUP.LIST_LAYOUT.TITLE

DOCS.PAGINABLE.API.CSS_GROUP.LIST_LAYOUT.DESCRIPTION

VariablePar défautTypeDescription
--hub-list-gaplength Gap between list items. 00.5rem
--hub-list-items-gaplength Gap inside the items wrapper. 0.25rem
--hub-list-padding-xlength Horizontal padding of the list host. 01rem
--hub-list-padding-ylength Vertical padding of the list host. 00.5rem
--hub-list-item-padding-xlength Horizontal padding of each item. 1rem1.25rem
--hub-list-item-padding-ylength Vertical padding of each item. 0.5rem0.75rem
--hub-list-border-radiuslength Container border radius. 0.375rem

DOCS.PAGINABLE.API.CSS_GROUP.LIST_CARDS.TITLE

DOCS.PAGINABLE.API.CSS_GROUP.LIST_CARDS.DESCRIPTION

VariablePar défautTypeDescription
--hub-list-cards-columnsnumber Number of card columns (auto-fill when unset). 234
--hub-list-cards-min-column-widthlength Minimum column width for auto-fill grid. 200px280px
--hub-list-cards-gaplength Gap between cards. 0.75rem1.5rem
--hub-list-cards-bgcolor Card background. #fff
--hub-list-cards-border-colorcolor Card border colour. #dee2e6
--hub-list-cards-border-radiuslength Card corner radius. 0.5rem
--hub-list-cards-shadowshadow Card drop shadow. 0 2px 8px rgba(0,0,0,.1)
--hub-list-cards-hover-shadowshadow Card drop shadow on hover. 0 4px 16px rgba(0,0,0,.15)
--hub-list-cards-padding-xlength Card horizontal padding. 1rem
--hub-list-cards-padding-ylength Card vertical padding. 1rem

DOCS.PAGINABLE.API.CSS_GROUP.PAGINATOR.TITLE

DOCS.PAGINABLE.API.CSS_GROUP.PAGINATOR.DESCRIPTION

VariablePar défautTypeDescription
--hub-paginator-link-bgcolor Page link background. #ffftransparent
--hub-paginator-link-colorcolor Page link text colour. var(--bs-primary)
--hub-paginator-link-border-colorcolor Page link border colour. #dee2e6
--hub-paginator-link-border-radiuslength Page link border radius. 0.375rem9999px
--hub-paginator-link-active-bgcolor Active page link background. var(--bs-primary)
--hub-paginator-link-active-colorcolor Active page link text colour. #fff
--hub-paginator-link-hover-bgcolor Hovered page link background. #f0f4f8
--hub-paginator-link-padding-xlength Page link horizontal padding. 0.625rem
--hub-paginator-link-padding-ylength Page link vertical padding. 0.375rem
--hub-paginator-font-sizelength Paginator font size. 0.875rem1rem
--hub-paginator-gaplength Gap between paginator controls. 0.25rem0.5rem
--hub-paginator-info-colorcolor Pagination info text colour. #6c757d
--hub-paginator-label-colorcolor Per-page label colour. #6c757d

Styles et theming

Aucun exemple de style n’est encore documenté. Cette section inclura des recettes de personnalisation et des exemples de theming.