@nanahoshi/mona-ui 0.25.1 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/chart/README.md +2 -2
- package/command/package.json +4 -0
- package/docs/auto-complete.md +733 -0
- package/docs/avatar.md +220 -0
- package/docs/breadcrumb.md +320 -0
- package/docs/button-group.md +392 -0
- package/docs/button.md +256 -0
- package/docs/calendar.md +515 -0
- package/docs/card.md +292 -0
- package/docs/chart-bar.md +714 -0
- package/docs/chart-financial.md +567 -0
- package/docs/chart-funnel.md +546 -0
- package/docs/chart-heatmap.md +535 -0
- package/docs/chart-line-area.md +462 -0
- package/docs/chart-pie.md +645 -0
- package/docs/chart-radar.md +518 -0
- package/docs/chart-radial.md +658 -0
- package/docs/chart-scatter.md +479 -0
- package/docs/chart-treemap.md +651 -0
- package/docs/chart.md +2465 -0
- package/docs/checkbox.md +374 -0
- package/docs/chip.md +339 -0
- package/docs/circular-progress-bar.md +287 -0
- package/docs/collapsible.md +308 -0
- package/docs/color-gradient.md +336 -0
- package/docs/color-palette.md +317 -0
- package/docs/color-picker.md +387 -0
- package/docs/combo-box.md +764 -0
- package/docs/command.md +582 -0
- package/docs/contextmenu.md +530 -0
- package/docs/date-picker.md +251 -0
- package/docs/datetime-picker.md +284 -0
- package/docs/decimal-textbox.md +260 -0
- package/docs/dialog.md +822 -0
- package/docs/dropdown-button.md +507 -0
- package/docs/dropdown-list.md +779 -0
- package/docs/editor.md +374 -0
- package/docs/expansion-panel.md +348 -0
- package/docs/fieldset.md +217 -0
- package/docs/forms.md +162 -0
- package/docs/grid.md +2053 -0
- package/docs/input.md +197 -0
- package/docs/installation.md +54 -0
- package/docs/introduction.md +46 -0
- package/docs/label.md +340 -0
- package/docs/list-box.md +637 -0
- package/docs/list-view.md +584 -0
- package/docs/menubar.md +559 -0
- package/docs/multi-select.md +765 -0
- package/docs/notification.md +460 -0
- package/docs/numeric-textbox.md +301 -0
- package/docs/otp-input.md +539 -0
- package/docs/pager.md +513 -0
- package/docs/placeholder.md +176 -0
- package/docs/popover.md +423 -0
- package/docs/popup-menu.md +658 -0
- package/docs/popup.md +617 -0
- package/docs/progress-bar.md +368 -0
- package/docs/radio-button.md +451 -0
- package/docs/range-slider.md +367 -0
- package/docs/rating.md +518 -0
- package/docs/scroll-view.md +375 -0
- package/docs/segmented.md +434 -0
- package/docs/sheet.md +348 -0
- package/docs/sidebar.md +1126 -0
- package/docs/skeleton.md +181 -0
- package/docs/slider.md +423 -0
- package/docs/spinner.md +370 -0
- package/docs/split-button.md +522 -0
- package/docs/splitter.md +342 -0
- package/docs/stepper.md +539 -0
- package/docs/switch.md +340 -0
- package/docs/tabs.md +542 -0
- package/docs/textarea.md +196 -0
- package/docs/textbox.md +332 -0
- package/docs/theming.md +403 -0
- package/docs/time-picker.md +254 -0
- package/docs/tooltip-directive.md +340 -0
- package/docs/tooltip.md +321 -0
- package/docs/tree-view.md +1018 -0
- package/docs/window.md +663 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +8 -0
- package/fesm2022/nanahoshi-mona-ui-button.mjs +12 -0
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +5 -2
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +212 -66
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +16 -2
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-command.mjs +924 -0
- package/fesm2022/nanahoshi-mona-ui-common.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +10 -6
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +9 -5
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +9 -5
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +55 -1
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3 -2
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +13 -0
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +5 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-2tVhD2hK.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-BAN70Wcn.mjs → nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-C_kCaA5b.mjs → nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs} +18 -35
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BsNfrAHz.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CEfVa7eo.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs} +4653 -4529
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1 -0
- package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +168 -0
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +19 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +14 -0
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +32 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +10 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +15 -8
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +8 -5
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +9 -0
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +5 -0
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +14 -6
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +48 -183
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +16 -0
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -0
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +5 -5
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +7 -2
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +9 -6
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +18 -21
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +11 -8
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +9 -1
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +16 -5
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +13 -11
- package/fesm2022/nanahoshi-mona-ui-window.mjs +12 -5
- package/i18n/catalogs/en-US.messages.json +10 -0
- package/internal/popup-menu/package.json +4 -0
- package/llms.txt +133 -0
- package/locales/ar-sa/ar-sa.messages.json +10 -0
- package/locales/de-de/de-de.messages.json +10 -0
- package/locales/es-es/es-es.messages.json +10 -0
- package/locales/fr-fr/fr-fr.messages.json +10 -0
- package/locales/id-id/id-id.messages.json +10 -0
- package/locales/it-it/it-it.messages.json +10 -0
- package/locales/ja-jp/ja-jp.messages.json +10 -0
- package/locales/ko-kr/ko-kr.messages.json +10 -0
- package/locales/pt-br/pt-br.messages.json +10 -0
- package/locales/ru-ru/ru-ru.messages.json +10 -0
- package/locales/tr-tr/tr-tr.messages.json +10 -0
- package/locales/zh-cn/zh-cn.messages.json +10 -0
- package/locales/zh-tw/zh-tw.messages.json +10 -0
- package/package.json +9 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +1 -1
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +8 -0
- package/types/nanahoshi-mona-ui-button.d.ts +12 -0
- package/types/nanahoshi-mona-ui-calendar.d.ts +3 -0
- package/types/nanahoshi-mona-ui-chart.d.ts +250 -20
- package/types/nanahoshi-mona-ui-check-box.d.ts +4 -0
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +4 -0
- package/types/nanahoshi-mona-ui-collapsible.d.ts +10 -0
- package/types/nanahoshi-mona-ui-combo-box.d.ts +1 -1
- package/types/nanahoshi-mona-ui-command.d.ts +253 -0
- package/types/nanahoshi-mona-ui-common.d.ts +17 -1
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +5 -2
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -1
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +2 -1
- package/types/nanahoshi-mona-ui-dialog.d.ts +58 -1
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +7 -3
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +55 -1
- package/types/nanahoshi-mona-ui-editor.d.ts +31 -0
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +13 -0
- package/types/nanahoshi-mona-ui-fieldset.d.ts +5 -0
- package/types/nanahoshi-mona-ui-grid.d.ts +162 -35
- package/types/nanahoshi-mona-ui-i18n.d.ts +144 -1
- package/types/nanahoshi-mona-ui-internal-list.d.ts +16 -1
- package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +165 -0
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +21 -2
- package/types/nanahoshi-mona-ui-internal.d.ts +4 -5
- package/types/nanahoshi-mona-ui-label.d.ts +1 -0
- package/types/nanahoshi-mona-ui-list-box.d.ts +27 -4
- package/types/nanahoshi-mona-ui-list-view.d.ts +34 -1
- package/types/nanahoshi-mona-ui-list.d.ts +1 -1
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +10 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +10 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +10 -3
- package/types/nanahoshi-mona-ui-multi-select.d.ts +3 -3
- package/types/nanahoshi-mona-ui-notification.d.ts +9 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +1 -1
- package/types/nanahoshi-mona-ui-otp-input.d.ts +1 -0
- package/types/nanahoshi-mona-ui-pager.d.ts +5 -1
- package/types/nanahoshi-mona-ui-popover.d.ts +9 -1
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +48 -161
- package/types/nanahoshi-mona-ui-popup.d.ts +16 -0
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +4 -0
- package/types/nanahoshi-mona-ui-rating.d.ts +2 -0
- package/types/nanahoshi-mona-ui-segmented.d.ts +1 -0
- package/types/nanahoshi-mona-ui-sheet.d.ts +1 -1
- package/types/nanahoshi-mona-ui-slider.d.ts +2 -0
- package/types/nanahoshi-mona-ui-spinner.d.ts +7 -0
- package/types/nanahoshi-mona-ui-split-button.d.ts +7 -4
- package/types/nanahoshi-mona-ui-stepper.d.ts +11 -2
- package/types/nanahoshi-mona-ui-tabs.d.ts +4 -1
- package/types/nanahoshi-mona-ui-text-box.d.ts +9 -1
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -1
- package/types/nanahoshi-mona-ui-tooltip.d.ts +10 -2
- package/types/nanahoshi-mona-ui-tree-view.d.ts +6 -5
- package/types/nanahoshi-mona-ui-window.d.ts +66 -1
package/docs/pager.md
ADDED
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
# Pager
|
|
2
|
+
|
|
3
|
+
> Pagination controls with page buttons, a page-size selector and a page-jump input.
|
|
4
|
+
|
|
5
|
+
Entry point: `@nanahoshi/mona-ui/pager`
|
|
6
|
+
|
|
7
|
+
**Selector:** `mona-pager`
|
|
8
|
+
|
|
9
|
+
Pager renders pagination controls — numeric page buttons, previous/next/first/last navigation, an optional page-size selector, and an optional page-jump input — for navigating a paged collection of items.
|
|
10
|
+
|
|
11
|
+
With zero items, the summary shows `0 - 0 of 0 items` in the active locale. All page navigation buttons are disabled, custom navigation templates receive `disabled: true`, and the page-jump input is hidden. The numeric pager's page-size selector remains available.
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
Use Pager when a consumer needs to page through a collection that is too large to display in full — grids, lists, or search results. Pager does not fetch, slice, or hold the paged data itself. It tracks `skip`, `total`, and `pageSize`, and emits `pageChange` when the user moves to another page or changes the page size; the consumer loads or slices data in response.
|
|
16
|
+
|
|
17
|
+
Pager supports two visual modes, selected with the `type` input:
|
|
18
|
+
|
|
19
|
+
- `"numeric"` (default) — numeric page buttons with optional first/last and previous/next controls.
|
|
20
|
+
- `"input"` — a single "Page [input] of N" control instead of numeric buttons. The words around the input come from the locale, so their order follows the language (ja-JP: "10ページ中 [3] ページ").
|
|
21
|
+
|
|
22
|
+
On narrow hosts the sections wrap onto further lines rather than being hidden. When `responsive` is enabled (the default) and the pager is narrower than 480px, the numeric page buttons are replaced by a page dropdown.
|
|
23
|
+
|
|
24
|
+
## Import & Quick Start
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { PagerComponent } from "@nanahoshi/mona-ui/pager";
|
|
28
|
+
import type { PageChangeEvent } from "@nanahoshi/mona-ui/pager";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<mona-pager [total]="100" [(pageSize)]="pageSize" [(skip)]="skip" (pageChange)="onPageChange($event)"></mona-pager>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
protected readonly pageSize = signal(10);
|
|
37
|
+
protected readonly skip = signal(0);
|
|
38
|
+
|
|
39
|
+
protected onPageChange(event: PageChangeEvent): void {
|
|
40
|
+
// load or slice data using event.skip and event.take
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Anatomy
|
|
45
|
+
|
|
46
|
+
Pager's default first/previous/next/last buttons, numeric page buttons, page-size control, and info summary can each be replaced with a matching `ng-template` directive projected into `<mona-pager>`. Every context includes the pager's state and actions (`PagerContext`): `currentPage`, `start`, `end`, `pageSize`, `pageSizes`, `skip`, `total`, `totalPages`, `goToPage(page)` and `setPageSize(size)`. The directives have context guards, so `let-` variables are typed.
|
|
47
|
+
|
|
48
|
+
| Directive | Selector | Template context |
|
|
49
|
+
|-------------------------------------------|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
50
|
+
| `PagerNavigationButtonsTemplateDirective` | `ng-template[monaPagerNavigationButtonsTemplate]` | `NavigationButtonsTemplateContext`: `PagerContext` plus `disabled`, `targetPage` and `navigate()`. Requires a `type` attribute input: `"first" \| "previous" \| "next" \| "last"`, identifying which button it replaces. |
|
|
51
|
+
| `PagerNumericButtonsTemplateDirective` | `ng-template[monaPagerNumericButtonsTemplate]` | `NumericButtonsTemplateContext`: `PagerContext` plus `pages`, the page numbers the default buttons would show. Only used when `type` is `"numeric"`. The template renders inside the pager's `<ol>`, so wrap each control in `<li>`. |
|
|
52
|
+
| `PagerPageSizeTemplateDirective` | `ng-template[monaPagerPageSizeTemplate]` | `PageSizeTemplateContext`: `PagerContext`, with the page-size options as `$implicit`. |
|
|
53
|
+
| `PagerInfoTemplateDirective` | `ng-template[monaPagerInfoTemplate]` | `InfoTemplateContext`: `PagerContext`. |
|
|
54
|
+
|
|
55
|
+
## Examples
|
|
56
|
+
|
|
57
|
+
### Numeric pagination with external state
|
|
58
|
+
|
|
59
|
+
Pager only tracks the position. Slice or load the items yourself from `skip` and `pageSize`.
|
|
60
|
+
|
|
61
|
+
`paging-example.component.ts`
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import { Component, computed, signal } from "@angular/core";
|
|
65
|
+
import { PagerComponent } from "@nanahoshi/mona-ui/pager";
|
|
66
|
+
|
|
67
|
+
@Component({
|
|
68
|
+
selector: "app-pager-paging-example",
|
|
69
|
+
imports: [PagerComponent],
|
|
70
|
+
templateUrl: "./paging-example.component.html"
|
|
71
|
+
})
|
|
72
|
+
export class PagerPagingExampleComponent {
|
|
73
|
+
protected readonly books = Array.from({ length: 23 }, (_, index) => `Book ${index + 1}`);
|
|
74
|
+
protected readonly pageItems = computed(() => this.books.slice(this.skip(), this.skip() + this.pageSize()));
|
|
75
|
+
protected readonly pageSize = signal(5);
|
|
76
|
+
protected readonly skip = signal(0);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`paging-example.component.html`
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<div class="flex flex-col gap-3">
|
|
84
|
+
<ul aria-label="Books" class="flex flex-col gap-1">
|
|
85
|
+
@for (book of pageItems(); track book) {
|
|
86
|
+
<li class="rounded-md border border-border px-3 py-1.5 text-sm">{{ book }}</li>
|
|
87
|
+
}
|
|
88
|
+
</ul>
|
|
89
|
+
<mona-pager aria-label="Books pagination" [total]="books.length" [(pageSize)]="pageSize" [(skip)]="skip" />
|
|
90
|
+
</div>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### "Page N of M" input mode
|
|
94
|
+
|
|
95
|
+
`pageChange` carries `skip` and `take` for the page to load.
|
|
96
|
+
|
|
97
|
+
`input-example.component.ts`
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
import { Component, signal } from "@angular/core";
|
|
101
|
+
import { type PageChangeEvent, PagerComponent } from "@nanahoshi/mona-ui/pager";
|
|
102
|
+
|
|
103
|
+
@Component({
|
|
104
|
+
selector: "app-pager-input-example",
|
|
105
|
+
imports: [PagerComponent],
|
|
106
|
+
templateUrl: "./input-example.component.html"
|
|
107
|
+
})
|
|
108
|
+
export class PagerInputExampleComponent {
|
|
109
|
+
protected readonly range = signal("1–10");
|
|
110
|
+
|
|
111
|
+
/** A real page would load `take` items starting at `skip` here. */
|
|
112
|
+
protected onPageChange(event: PageChangeEvent): void {
|
|
113
|
+
this.range.set(`${event.skip + 1}–${event.skip + event.take}`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
`input-example.component.html`
|
|
119
|
+
|
|
120
|
+
```html
|
|
121
|
+
<div class="flex flex-col gap-2">
|
|
122
|
+
<mona-pager type="input" [pageSize]="10" [total]="240" (pageChange)="onPageChange($event)" />
|
|
123
|
+
<span aria-live="polite" class="text-sm">Requested items {{ range() }}</span>
|
|
124
|
+
</div>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Custom page-size options and page-jump input
|
|
128
|
+
|
|
129
|
+
`page-sizes-example.component.ts`
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
import { Component, signal } from "@angular/core";
|
|
133
|
+
import { PagerComponent } from "@nanahoshi/mona-ui/pager";
|
|
134
|
+
|
|
135
|
+
@Component({
|
|
136
|
+
selector: "app-pager-page-sizes-example",
|
|
137
|
+
imports: [PagerComponent],
|
|
138
|
+
templateUrl: "./page-sizes-example.component.html"
|
|
139
|
+
})
|
|
140
|
+
export class PagerPageSizesExampleComponent {
|
|
141
|
+
protected readonly pageSize = signal(25);
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`page-sizes-example.component.html`
|
|
146
|
+
|
|
147
|
+
```html
|
|
148
|
+
<mona-pager pageInput [pageSizeValues]="[10, 25, 50, 100]" [total]="480" [(pageSize)]="pageSize" />
|
|
149
|
+
<p aria-live="polite" class="mt-2 text-sm">{{ pageSize() }} items per page</p>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Set `pageSizeValues` to `false` or `[]` to hide the page-size dropdown entirely, or to `true` for the default options.
|
|
153
|
+
|
|
154
|
+
### Cancelling a page-size change
|
|
155
|
+
|
|
156
|
+
`pageSizeSelect` fires when the user picks a size, before it is applied. Its `PageSizeChangeEvent` extends `PreventableEvent`; call `preventDefault()` to keep the current page size. `pageSizeChange` (from `[(pageSize)]`) and `pageChange` fire only for a change that went through.
|
|
157
|
+
|
|
158
|
+
```html
|
|
159
|
+
<mona-pager [total]="100" [(pageSize)]="pageSize" (pageSizeSelect)="onPageSizeSelect($event)"></mona-pager>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
protected onPageSizeSelect(event: PageSizeChangeEvent): void {
|
|
164
|
+
if (this.hasUnsavedChanges()) {
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Custom navigation button
|
|
171
|
+
|
|
172
|
+
Each template replaces one button, named by its `type`. Your button needs its own accessible name, since the default label isn't applied to it.
|
|
173
|
+
|
|
174
|
+
`custom-buttons-example.component.ts`
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
import { Component } from "@angular/core";
|
|
178
|
+
import { LucideChevronsLeft, LucideChevronsRight } from "@lucide/angular";
|
|
179
|
+
import { ButtonDirective } from "@nanahoshi/mona-ui/button";
|
|
180
|
+
import { PagerComponent, PagerNavigationButtonsTemplateDirective } from "@nanahoshi/mona-ui/pager";
|
|
181
|
+
|
|
182
|
+
@Component({
|
|
183
|
+
selector: "app-pager-custom-buttons-example",
|
|
184
|
+
imports: [
|
|
185
|
+
ButtonDirective,
|
|
186
|
+
LucideChevronsLeft,
|
|
187
|
+
LucideChevronsRight,
|
|
188
|
+
PagerComponent,
|
|
189
|
+
PagerNavigationButtonsTemplateDirective
|
|
190
|
+
],
|
|
191
|
+
templateUrl: "./custom-buttons-example.component.html"
|
|
192
|
+
})
|
|
193
|
+
export class PagerCustomButtonsExampleComponent {}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
`custom-buttons-example.component.html`
|
|
197
|
+
|
|
198
|
+
```html
|
|
199
|
+
<mona-pager [pageSize]="10" [total]="95">
|
|
200
|
+
<ng-template let-disabled="disabled" let-navigate="navigate" monaPagerNavigationButtonsTemplate type="first">
|
|
201
|
+
<button aria-label="First page" monaButton type="button" [disabled]="disabled" (click)="navigate()">
|
|
202
|
+
<svg lucideChevronsLeft aria-hidden="true" [size]="16"></svg>
|
|
203
|
+
First
|
|
204
|
+
</button>
|
|
205
|
+
</ng-template>
|
|
206
|
+
<ng-template let-disabled="disabled" let-navigate="navigate" monaPagerNavigationButtonsTemplate type="last">
|
|
207
|
+
<button aria-label="Last page" monaButton type="button" [disabled]="disabled" (click)="navigate()">
|
|
208
|
+
Last
|
|
209
|
+
<svg lucideChevronsRight aria-hidden="true" [size]="16"></svg>
|
|
210
|
+
</button>
|
|
211
|
+
</ng-template>
|
|
212
|
+
</mona-pager>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Behavior
|
|
216
|
+
|
|
217
|
+
- `pageChange` is emitted synchronously for user actions (a button, the page input, the page dropdown, a page-size change, keyboard shortcuts) and when Pager corrects an invalid `skip`. It is not emitted on creation or when `skip` is set from code to a valid page.
|
|
218
|
+
- An invalid `skip` is corrected to the start of the page that holds it: a skip past the last page (the total shrank, a stale server skip) moves to the last page, and a skip between page boundaries (the host changed `pageSize`) moves to the start of its page. The correction updates `[(skip)]` and is reported through `pageChange`.
|
|
219
|
+
- A page-size change keeps the first item of the current page in view: at `skip` 40 with 10 per page, choosing 20 gives `skip` 40 (page 3). It always emits `pageChange` with the new `take`.
|
|
220
|
+
- Values below the minimum are ignored: `pageSize` and `visiblePages` count as at least 1, `skip` and `total` as at least 0.
|
|
221
|
+
- Setting `pageSizeValues` to `false` or an empty array removes the page-size dropdown from the layout entirely. In `"input"` mode the page-size dropdown is not shown, except in the responsive compact layout below 480px, which shows it and leaves out the page input box.
|
|
222
|
+
|
|
223
|
+
- Boolean inputs accept bare attributes (`<mona-pager pageInput>`).
|
|
224
|
+
|
|
225
|
+
## Forms Integration
|
|
226
|
+
|
|
227
|
+
Pager is not a form control. It does not implement `FormValueControl`/`FormCheckboxControl` or `ControlValueAccessor`, and cannot be bound with `[(ngModel)]`, `[formControl]`, or `formControlName`.
|
|
228
|
+
|
|
229
|
+
## Accessibility
|
|
230
|
+
|
|
231
|
+
### Keyboard Map
|
|
232
|
+
|
|
233
|
+
Pager's buttons, dropdowns and input are ordinary Tab stops; the pager itself is not a Tab stop and never traps `Tab`. With `navigable` (the default), these shortcuts work while a pager button has focus. Set `[navigable]="false"` to keep only native button behavior.
|
|
234
|
+
|
|
235
|
+
| Shortcut | Behavior |
|
|
236
|
+
|--------------|-------------------------------------------------------------|
|
|
237
|
+
| `Home` | Goes to the first page. |
|
|
238
|
+
| `End` | Goes to the last page. |
|
|
239
|
+
| `PageUp` | Goes to the previous page. |
|
|
240
|
+
| `PageDown` | Goes to the next page. |
|
|
241
|
+
| `ArrowLeft` | Goes to the previous page (the next page in right-to-left). |
|
|
242
|
+
| `ArrowRight` | Goes to the next page (the previous page in right-to-left). |
|
|
243
|
+
|
|
244
|
+
In the page input, `Enter` commits the typed page (not while an IME is composing), and `Home` and `End` move the caret.
|
|
245
|
+
|
|
246
|
+
### ARIA Roles
|
|
247
|
+
|
|
248
|
+
| Attribute | When present | Value |
|
|
249
|
+
|--------------------------|------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
|
|
250
|
+
| `role` | On the host | `"navigation"` |
|
|
251
|
+
| `aria-label` | On the host, unless `aria-labelledby` is set | The `aria-label` input, or `"Pagination"` |
|
|
252
|
+
| `aria-label` | On the first/previous/next/last buttons | `"First page"`, `"Previous page"`, `"Next page"`, `"Last page"` |
|
|
253
|
+
| `aria-label` | On the jump (ellipsis) buttons | `"Jump back {visiblePages} pages"` / `"Jump forward {visiblePages} pages"` |
|
|
254
|
+
| `aria-label` | On every numeric page button | `"Page {n}"` |
|
|
255
|
+
| `aria-current` | On the numeric page button matching the current page | `"page"` |
|
|
256
|
+
| `aria-label` | On the page-size dropdown | `"Items per page"` |
|
|
257
|
+
| `aria-label` | On the page dropdown and the `pageInput` box | `"Page"` |
|
|
258
|
+
| `aria-labelledby` | On the `"input"` mode page box | The text around it ("Page" … "of 10") |
|
|
259
|
+
| `role="status"` (polite) | Visually hidden, inside the host | Announces the new range ("11 - 20 of 100 items") after a user change. |
|
|
260
|
+
|
|
261
|
+
These labels are rendered by Pager's default markup only. If a consumer replaces a button using `PagerNavigationButtonsTemplateDirective` or `PagerNumericButtonsTemplateDirective`, they are responsible for providing an equivalent accessible name on their own markup.
|
|
262
|
+
|
|
263
|
+
### Focus Behavior
|
|
264
|
+
|
|
265
|
+
When the focused button becomes disabled or is removed (Next on the last page, a jump button that is no longer needed), focus moves to the current page button instead of being lost. Page buttons are tracked by page number, so a focused page button keeps focus when the window of visible pages moves.
|
|
266
|
+
|
|
267
|
+
## API
|
|
268
|
+
|
|
269
|
+
Everything below is imported from `@nanahoshi/mona-ui/pager`.
|
|
270
|
+
|
|
271
|
+
### `PagerComponent`
|
|
272
|
+
|
|
273
|
+
**Selector:** `mona-pager`
|
|
274
|
+
|
|
275
|
+
#### Inputs
|
|
276
|
+
|
|
277
|
+
| Name | Type | Default | Description |
|
|
278
|
+
| --- | --- | --- | --- |
|
|
279
|
+
| `aria-label` | `string \| null` | `null` | Accessible name of the pager's navigation landmark. Defaults to the localized "Pagination"; name each pager when a page has several. |
|
|
280
|
+
| `aria-labelledby` | `string` | `""` | Id of the element that names the pager. Takes precedence over `aria-label`. |
|
|
281
|
+
| `class` | `string` | `""` | Additional CSS classes merged onto the host element via `tailwind-merge`. |
|
|
282
|
+
| `firstLast` | `boolean` | `true` | Shows the first and last page navigation buttons. |
|
|
283
|
+
| `navigable` | `boolean` | `true` | Enables page shortcuts while a pager button has focus: Page Up and Page Down go to the previous and next page, Home and End to the first and last, and the left and right arrows to the previous and next page (mirrored right to left). The buttons themselves are always ordinary tab stops. |
|
|
284
|
+
| `pageInput` | `boolean` | `false` | Shows a numeric input for jumping directly to a page. |
|
|
285
|
+
| `pageSize` (two-way) | `number` | `5` | Number of items displayed per page; values below 1 count as 1. Supports two-way binding (`[(pageSize)]`): `pageSizeChange` emits the new size after the user changes it, and `pageChange` reports it as `take`. |
|
|
286
|
+
| `pageSizeValues` | `readonly number[] \| boolean` | `[5, 10, 20, 50, 100]` | Page-size options shown in the page-size dropdown. `true` shows the default options; `false` or an empty array hides the dropdown. |
|
|
287
|
+
| `previousNext` | `boolean` | `true` | Shows the previous and next page navigation buttons. |
|
|
288
|
+
| `responsive` | `boolean` | `true` | Replaces the page buttons with a page dropdown when the pager is narrower than 480px. Other sections wrap onto a new line instead of being hidden. |
|
|
289
|
+
| `rounded` | `"full" \| "large" \| "medium" \| "none" \| "small"` | `"medium"` | Border-radius preset applied to the component. |
|
|
290
|
+
| `showInfo` | `boolean` | `true` | Displays the summary of the current page range and total item count. |
|
|
291
|
+
| `size` | `"large" \| "medium" \| "small"` | `"medium"` | Size preset controlling the component's dimensions. |
|
|
292
|
+
| `skip` (two-way) | `number` | `0` | Number of items before the current page. Supports two-way binding. A value past the last page, or between page boundaries, is corrected to the start of the page that holds it, and `pageChange` reports it. |
|
|
293
|
+
| `total` | `number` | `0` | Total number of items in the paged collection. |
|
|
294
|
+
| `type` | `PagerType` | `"numeric"` | Visual mode of the pager: numeric page buttons, or a page-jump input. |
|
|
295
|
+
| `visiblePages` | `number` | `5` | Number of page buttons shown between the first and last page before the rest collapse into jump buttons. At least 1. |
|
|
296
|
+
|
|
297
|
+
#### Outputs
|
|
298
|
+
|
|
299
|
+
| Name | Type | Description |
|
|
300
|
+
| --- | --- | --- |
|
|
301
|
+
| `pageChange` | `PageChangeEvent` | Emitted when the user changes the page or the page size, or when the pager corrects a `skip` that is past the last page or not on a page boundary. Setting `skip` or `pageSize` from code to a valid value doesn't emit it. |
|
|
302
|
+
| `pageSizeChange` | `number` | Emitted when `pageSize` changes. |
|
|
303
|
+
| `pageSizeSelect` | `PageSizeChangeEvent` | Emitted when the user picks a page size, before it is applied. Call `preventDefault()` on the event to keep the current size. |
|
|
304
|
+
| `skipChange` | `number` | Emitted when `skip` changes. |
|
|
305
|
+
|
|
306
|
+
### `PagerNavigationButtonsTemplateDirective`
|
|
307
|
+
|
|
308
|
+
**Selector:** `ng-template[monaPagerNavigationButtonsTemplate]`
|
|
309
|
+
|
|
310
|
+
#### Inputs
|
|
311
|
+
|
|
312
|
+
| Name | Type | Default | Description |
|
|
313
|
+
| --- | --- | --- | --- |
|
|
314
|
+
| `type` (required) | `"first" \| "last" \| "next" \| "previous"` | — | Which navigation button the template replaces. |
|
|
315
|
+
|
|
316
|
+
#### Template context
|
|
317
|
+
|
|
318
|
+
| Name | Type | Description |
|
|
319
|
+
| --- | --- | --- |
|
|
320
|
+
| `$implicit` | `PagerContext` | The pager state, the same values the context spreads at its top level. |
|
|
321
|
+
| `currentPage` | `number` | The current page, starting at 1. |
|
|
322
|
+
| `disabled` | `boolean` | True when the button has nowhere to go (the first or last page is current, or there are no pages). |
|
|
323
|
+
| `end` | `number` | The position of the last item on the current page, or 0 when there are no items. |
|
|
324
|
+
| `goToPage` | `(page: number) => void` | Goes to a page (clamped to the page range) and emits `pageChange`, as a click on a page button does. |
|
|
325
|
+
| `navigate` | `() => void` | Goes to `targetPage`. |
|
|
326
|
+
| `pageSize` | `number` | The number of items per page. |
|
|
327
|
+
| `pageSizes` | `readonly number[]` | The page sizes offered by the page-size dropdown. |
|
|
328
|
+
| `setPageSize` | `(pageSize: number \| null) => void` | Changes the page size through the cancelable `pageSizeSelect` event, as the page-size dropdown does. `null` and values below 1 are ignored. |
|
|
329
|
+
| `skip` | `number` | The number of items before the current page. |
|
|
330
|
+
| `start` | `number` | The position of the first item on the current page, or 0 when there are no items. |
|
|
331
|
+
| `targetPage` | `number` | The page the button goes to. |
|
|
332
|
+
| `total` | `number` | The total number of items. |
|
|
333
|
+
| `totalPages` | `number` | The total number of pages. |
|
|
334
|
+
|
|
335
|
+
### `PagerInfoTemplateDirective`
|
|
336
|
+
|
|
337
|
+
**Selector:** `ng-template[monaPagerInfoTemplate]`
|
|
338
|
+
|
|
339
|
+
#### Template context
|
|
340
|
+
|
|
341
|
+
| Name | Type | Description |
|
|
342
|
+
| --- | --- | --- |
|
|
343
|
+
| `$implicit` | `PagerContext` | The pager state, the same values the context spreads at its top level. |
|
|
344
|
+
| `currentPage` | `number` | The current page, starting at 1. |
|
|
345
|
+
| `end` | `number` | The position of the last item on the current page, or 0 when there are no items. |
|
|
346
|
+
| `goToPage` | `(page: number) => void` | Goes to a page (clamped to the page range) and emits `pageChange`, as a click on a page button does. |
|
|
347
|
+
| `pageSize` | `number` | The number of items per page. |
|
|
348
|
+
| `pageSizes` | `readonly number[]` | The page sizes offered by the page-size dropdown. |
|
|
349
|
+
| `setPageSize` | `(pageSize: number \| null) => void` | Changes the page size through the cancelable `pageSizeSelect` event, as the page-size dropdown does. `null` and values below 1 are ignored. |
|
|
350
|
+
| `skip` | `number` | The number of items before the current page. |
|
|
351
|
+
| `start` | `number` | The position of the first item on the current page, or 0 when there are no items. |
|
|
352
|
+
| `total` | `number` | The total number of items. |
|
|
353
|
+
| `totalPages` | `number` | The total number of pages. |
|
|
354
|
+
|
|
355
|
+
### `PagerNumericButtonsTemplateDirective`
|
|
356
|
+
|
|
357
|
+
**Selector:** `ng-template[monaPagerNumericButtonsTemplate]`
|
|
358
|
+
|
|
359
|
+
#### Template context
|
|
360
|
+
|
|
361
|
+
| Name | Type | Description |
|
|
362
|
+
| --- | --- | --- |
|
|
363
|
+
| `$implicit` | `PagerContext` | The pager state, the same values the context spreads at its top level. |
|
|
364
|
+
| `currentPage` | `number` | The current page, starting at 1. |
|
|
365
|
+
| `end` | `number` | The position of the last item on the current page, or 0 when there are no items. |
|
|
366
|
+
| `goToPage` | `(page: number) => void` | Goes to a page (clamped to the page range) and emits `pageChange`, as a click on a page button does. |
|
|
367
|
+
| `pages` | `readonly number[]` | The page numbers the default buttons would show, in order (the first and last page included). |
|
|
368
|
+
| `pageSize` | `number` | The number of items per page. |
|
|
369
|
+
| `pageSizes` | `readonly number[]` | The page sizes offered by the page-size dropdown. |
|
|
370
|
+
| `setPageSize` | `(pageSize: number \| null) => void` | Changes the page size through the cancelable `pageSizeSelect` event, as the page-size dropdown does. `null` and values below 1 are ignored. |
|
|
371
|
+
| `skip` | `number` | The number of items before the current page. |
|
|
372
|
+
| `start` | `number` | The position of the first item on the current page, or 0 when there are no items. |
|
|
373
|
+
| `total` | `number` | The total number of items. |
|
|
374
|
+
| `totalPages` | `number` | The total number of pages. |
|
|
375
|
+
|
|
376
|
+
### `PagerPageSizeTemplateDirective`
|
|
377
|
+
|
|
378
|
+
**Selector:** `ng-template[monaPagerPageSizeTemplate]`
|
|
379
|
+
|
|
380
|
+
#### Template context
|
|
381
|
+
|
|
382
|
+
| Name | Type | Description |
|
|
383
|
+
| --- | --- | --- |
|
|
384
|
+
| `$implicit` | `readonly number[]` | The page sizes offered, as for the default dropdown. |
|
|
385
|
+
| `currentPage` | `number` | The current page, starting at 1. |
|
|
386
|
+
| `end` | `number` | The position of the last item on the current page, or 0 when there are no items. |
|
|
387
|
+
| `goToPage` | `(page: number) => void` | Goes to a page (clamped to the page range) and emits `pageChange`, as a click on a page button does. |
|
|
388
|
+
| `pageSize` | `number` | The number of items per page. |
|
|
389
|
+
| `pageSizes` | `readonly number[]` | The page sizes offered by the page-size dropdown. |
|
|
390
|
+
| `setPageSize` | `(pageSize: number \| null) => void` | Changes the page size through the cancelable `pageSizeSelect` event, as the page-size dropdown does. `null` and values below 1 are ignored. |
|
|
391
|
+
| `skip` | `number` | The number of items before the current page. |
|
|
392
|
+
| `start` | `number` | The position of the first item on the current page, or 0 when there are no items. |
|
|
393
|
+
| `total` | `number` | The total number of items. |
|
|
394
|
+
| `totalPages` | `number` | The total number of pages. |
|
|
395
|
+
|
|
396
|
+
### `PageSizeChangeEvent`
|
|
397
|
+
|
|
398
|
+
The cancelable payload of the pager's `pageSizeSelect` event.
|
|
399
|
+
|
|
400
|
+
**Extends:** `PreventableEvent`
|
|
401
|
+
|
|
402
|
+
#### Properties
|
|
403
|
+
|
|
404
|
+
| Name | Type |
|
|
405
|
+
| --- | --- |
|
|
406
|
+
| `newPageSize` (read-only) | `number` |
|
|
407
|
+
| `oldPageSize` (read-only) | `number` |
|
|
408
|
+
|
|
409
|
+
### Types
|
|
410
|
+
|
|
411
|
+
#### `PAGER_DEFAULT_MESSAGES`
|
|
412
|
+
|
|
413
|
+
```typescript
|
|
414
|
+
const PAGER_DEFAULT_MESSAGES: { firstPageLabel: string; itemsPerPageLabel: string; jumpBackwardLabel: (pages: number) => string; jumpForwardLabel: (pages: number) => string; lastPageLabel: string; nextPageLabel: string; ofText: string; pageInputPrefix: (_totalPages: number) => string; pageInputSuffix: (totalPages: number) => string; pageLabel: (page: number) => string; pageSelectLabel: string; pageSizeLabel: (pageSize: number) => string; pageStatus: (page: number, totalPages: number) => string; pageText: string; pagerLabel: string; previousPageLabel: string; rangeStatus: (start: number, end: number, total: number) => string; };
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
#### `PagerContext`
|
|
418
|
+
|
|
419
|
+
The pager's state and actions, passed to every custom template.
|
|
420
|
+
|
|
421
|
+
| Name | Type | Description |
|
|
422
|
+
| --- | --- | --- |
|
|
423
|
+
| `currentPage` (read-only) | `number` | The current page, starting at 1. |
|
|
424
|
+
| `end` (read-only) | `number` | The position of the last item on the current page, or 0 when there are no items. |
|
|
425
|
+
| `pageSize` (read-only) | `number` | The number of items per page. |
|
|
426
|
+
| `pageSizes` (read-only) | `readonly number[]` | The page sizes offered by the page-size dropdown. |
|
|
427
|
+
| `skip` (read-only) | `number` | The number of items before the current page. |
|
|
428
|
+
| `start` (read-only) | `number` | The position of the first item on the current page, or 0 when there are no items. |
|
|
429
|
+
| `total` (read-only) | `number` | The total number of items. |
|
|
430
|
+
| `totalPages` (read-only) | `number` | The total number of pages. |
|
|
431
|
+
|
|
432
|
+
**Methods**
|
|
433
|
+
|
|
434
|
+
| Signature | Description |
|
|
435
|
+
| --- | --- |
|
|
436
|
+
| `goToPage(page: number): void` | Goes to a page (clamped to the page range) and emits `pageChange`, as a click on a page button does. |
|
|
437
|
+
| `setPageSize(pageSize: number \| null): void` | Changes the page size through the cancelable `pageSizeSelect` event, as the page-size dropdown does. `null` and values below 1 are ignored. |
|
|
438
|
+
|
|
439
|
+
#### `NavigationButtonsTemplateContext`
|
|
440
|
+
|
|
441
|
+
**Extends:** `PagerContext`
|
|
442
|
+
|
|
443
|
+
| Name | Type | Description |
|
|
444
|
+
| --- | --- | --- |
|
|
445
|
+
| `$implicit` (read-only) | `PagerContext` | The pager state, the same values the context spreads at its top level. |
|
|
446
|
+
| `disabled` (read-only) | `boolean` | True when the button has nowhere to go (the first or last page is current, or there are no pages). |
|
|
447
|
+
| `targetPage` (read-only) | `number` | The page the button goes to. |
|
|
448
|
+
|
|
449
|
+
**Methods**
|
|
450
|
+
|
|
451
|
+
| Signature | Description |
|
|
452
|
+
| --- | --- |
|
|
453
|
+
| `navigate(): void` | Goes to `targetPage`. |
|
|
454
|
+
|
|
455
|
+
#### `InfoTemplateContext`
|
|
456
|
+
|
|
457
|
+
**Extends:** `PagerContext`
|
|
458
|
+
|
|
459
|
+
| Name | Type | Description |
|
|
460
|
+
| --- | --- | --- |
|
|
461
|
+
| `$implicit` (read-only) | `PagerContext` | The pager state, the same values the context spreads at its top level. |
|
|
462
|
+
|
|
463
|
+
#### `NumericButtonsTemplateContext`
|
|
464
|
+
|
|
465
|
+
Context of `monaPagerNumericButtonsTemplate`. The template renders inside the pager's `<ol>`, so put each
|
|
466
|
+
control in an `<li>`.
|
|
467
|
+
|
|
468
|
+
**Extends:** `PagerContext`
|
|
469
|
+
|
|
470
|
+
| Name | Type | Description |
|
|
471
|
+
| --- | --- | --- |
|
|
472
|
+
| `$implicit` (read-only) | `PagerContext` | The pager state, the same values the context spreads at its top level. |
|
|
473
|
+
| `pages` (read-only) | `readonly number[]` | The page numbers the default buttons would show, in order (the first and last page included). |
|
|
474
|
+
|
|
475
|
+
#### `PageChangeEvent`
|
|
476
|
+
|
|
477
|
+
| Name | Type |
|
|
478
|
+
| --- | --- |
|
|
479
|
+
| `page` | `number` |
|
|
480
|
+
| `skip` | `number` |
|
|
481
|
+
| `take` | `number` |
|
|
482
|
+
|
|
483
|
+
#### `PageSizeTemplateContext`
|
|
484
|
+
|
|
485
|
+
**Extends:** `PagerContext`
|
|
486
|
+
|
|
487
|
+
| Name | Type | Description |
|
|
488
|
+
| --- | --- | --- |
|
|
489
|
+
| `$implicit` (read-only) | `readonly number[]` | The page sizes offered, as for the default dropdown. |
|
|
490
|
+
|
|
491
|
+
#### `PagerType`
|
|
492
|
+
|
|
493
|
+
```typescript
|
|
494
|
+
type PagerType = "input" | "numeric";
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
#### `PreventableEvent`
|
|
498
|
+
|
|
499
|
+
From `@nanahoshi/mona-ui/common`.
|
|
500
|
+
|
|
501
|
+
**Type parameters:** `E extends Event = Event`
|
|
502
|
+
|
|
503
|
+
| Name | Type | Description |
|
|
504
|
+
| --- | --- | --- |
|
|
505
|
+
| `originalEvent` (read-only) | `E \| undefined` | The DOM event that caused this one, when there is one. |
|
|
506
|
+
| `type` (read-only) | `string \| undefined` | A name for the kind of event, when the component that emits it sets one. |
|
|
507
|
+
|
|
508
|
+
**Methods**
|
|
509
|
+
|
|
510
|
+
| Signature | Description |
|
|
511
|
+
| --- | --- |
|
|
512
|
+
| `isDefaultPrevented(): boolean` | Whether `preventDefault()` was called. |
|
|
513
|
+
| `preventDefault(): void` | Cancels what the event announces, such as opening or closing a popup, or closing a dialog. |
|