@synergy-design-system/angular
Version:
Angular wrappers for the Synergy Design System
188 lines (184 loc) • 8.21 kB
JavaScript
import * as i0 from '@angular/core';
import { EventEmitter, Output, Input, Component } from '@angular/core';
import '@synergy-design-system/components/components/pagination/pagination.js';
// ---------------------------------------------------------------------
// 🔒 AUTOGENERATED @synergy-design-system/angular wrappers for @synergy-design-system/components
// Please do not edit this file directly!
// It will get recreated when running pnpm build.
// ---------------------------------------------------------------------
/**
* @summary <syn-pagination /> provides page navigation, direct page input, and page-size selection for large data sets.
*
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-pagination--docs
* @status stable
* @since 3.12.0
*
* @event syn-pagination-page-changed - Emitted when the current page changes
* @event syn-pagination-page-size-changed - Emitted when the page size changes
*
* @csspart base - The component's base wrapper.
* @csspart divider - The divider element displayed at the top of the pagination component.
* @csspart page-size-select-wrapper - The wrapper element containing the page size select and page item summary.
* @csspart page-size-select - The page size select element.
* @csspart page-item-summary - The text element displaying the current page item range and total items.
* @csspart page-input-section - The section containing the page number input and total pages display.
* @csspart page-input - The page number input element.
* @csspart navigation - The pagination navigation element.
* @csspart navigation-action - The individual navigation action buttons (first, previous, next, last).
*
* @accessibility
* The entire component is wrapped in a semantic `<nav>` landmark with an `aria-label` for screen reader accessibility.
* Use the `aria-label` attribute to provide a unique, descriptive label when multiple pagination controls exist on the page.
* Example: `<syn-pagination aria-label="Search results pagination"></syn-pagination>`
*/
class SynPaginationComponent {
nativeElement;
_ngZone;
constructor(e, ngZone) {
this.nativeElement = e.nativeElement;
this._ngZone = ngZone;
this.nativeElement.addEventListener('syn-pagination-page-changed', (e) => {
this.synPaginationPageChangedEvent.emit(e);
});
this.nativeElement.addEventListener('syn-pagination-page-size-changed', (e) => {
this.synPaginationPageSizeChangedEvent.emit(e);
});
}
/**
* When true, a divider is displayed at the top of the pagination component.
*/
set divider(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.divider = v === '' || v));
}
get divider() {
return this.nativeElement.divider;
}
/**
* When true, the pagination controls are disabled and non-interactive.
*/
set disabled(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.disabled = v === '' || v));
}
get disabled() {
return this.nativeElement.disabled;
}
/**
* The size of the pagination controls.
*/
set size(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.size = v));
}
get size() {
return this.nativeElement.size;
}
/**
* The current page number.
* The default value is 1.
The component will emit a `syn-pagination-page-changed` event whenever the page changes, allowing you to respond to page changes in your application.
*/
set currentPage(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.currentPage = v));
}
get currentPage() {
return this.nativeElement.currentPage;
}
/**
* The number of items to display per page.
* The default value is 25.
The component will emit a `syn-pagination-page-size-changed` event whenever the page size changes, allowing you to respond to page size changes in your application.
*/
set pageSize(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.pageSize = v));
}
get pageSize() {
return this.nativeElement.pageSize;
}
/**
* An array of numbers representing the available options for the number of items to display per page.
* The default value is [10, 25, 50, 100].
The component will use this array to populate the rows-per-page selector, allowing users to choose from the specified options.
*/
set pageSizeOptions(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.pageSizeOptions = v));
}
get pageSizeOptions() {
return this.nativeElement.pageSizeOptions;
}
/**
* Total amount of items.
* The component will use this value to calculate the total number of pages based on the selected rows per page.
*/
set totalItems(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.totalItems = v));
}
get totalItems() {
return this.nativeElement.totalItems;
}
/**
* The pagination variant to use.
* The "full" variant includes comprehensive controls for navigating between pages and adjusting the number of displayed rows,
while the "compact" variant offers a streamlined interface with essential navigation controls.
The default value is "full".
*/
set variant(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.variant = v));
}
get variant() {
return this.nativeElement.variant;
}
/**
* An accessible label for the navigation landmark.
* Customize for multiple paginations on a page.
*/
set ariaLabel(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.ariaLabel = v));
}
get ariaLabel() {
return this.nativeElement.ariaLabel;
}
/**
* Emitted when the current page changes
*/
synPaginationPageChangedEvent = new EventEmitter();
/**
* Emitted when the page size changes
*/
synPaginationPageSizeChangedEvent = new EventEmitter();
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SynPaginationComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: SynPaginationComponent, isStandalone: true, selector: "syn-pagination", inputs: { divider: "divider", disabled: "disabled", size: "size", currentPage: "currentPage", pageSize: "pageSize", pageSizeOptions: "pageSizeOptions", totalItems: "totalItems", variant: "variant", ariaLabel: "ariaLabel" }, outputs: { synPaginationPageChangedEvent: "synPaginationPageChangedEvent", synPaginationPageSizeChangedEvent: "synPaginationPageSizeChangedEvent" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SynPaginationComponent, decorators: [{
type: Component,
args: [{
selector: 'syn-pagination',
standalone: true,
template: '<ng-content></ng-content>',
}]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { divider: [{
type: Input
}], disabled: [{
type: Input
}], size: [{
type: Input
}], currentPage: [{
type: Input
}], pageSize: [{
type: Input
}], pageSizeOptions: [{
type: Input
}], totalItems: [{
type: Input
}], variant: [{
type: Input
}], ariaLabel: [{
type: Input
}], synPaginationPageChangedEvent: [{
type: Output
}], synPaginationPageSizeChangedEvent: [{
type: Output
}] } });
/**
* Generated bundle index. Do not edit.
*/
export { SynPaginationComponent };
//# sourceMappingURL=synergy-design-system-angular-components-pagination.mjs.map