@cdevhub/ngx-tw 0.5.0 → 0.6.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 +78 -15
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs +16 -5
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs +26 -15
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-badge.mjs +17 -5
- package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs +27 -6
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-button.mjs +23 -11
- package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs +5 -5
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar-testing.mjs +3 -3
- package/fesm2022/cdevhub-ngx-tw-calendar-testing.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs +427 -122
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-card.mjs +21 -11
- package/fesm2022/cdevhub-ngx-tw-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs +215 -96
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +108 -64
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs +18 -6
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs +55 -30
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-combobox-testing.mjs +218 -0
- package/fesm2022/cdevhub-ngx-tw-combobox-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs +236 -211
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-command-palette-testing.mjs +200 -0
- package/fesm2022/cdevhub-ngx-tw-command-palette-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs +34 -7
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-core.mjs +135 -15
- package/fesm2022/cdevhub-ngx-tw-core.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-picker-testing.mjs +203 -0
- package/fesm2022/cdevhub-ngx-tw-date-picker-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs +160 -102
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-range-picker-testing.mjs +209 -0
- package/fesm2022/cdevhub-ngx-tw-date-range-picker-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs +182 -107
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-dialog-testing.mjs +122 -0
- package/fesm2022/cdevhub-ngx-tw-dialog-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs +11 -2
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs +1 -1
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-file-upload-testing.mjs +149 -0
- package/fesm2022/cdevhub-ngx-tw-file-upload-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs +57 -67
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs +42 -24
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs +114 -21
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-icon.mjs +16 -6
- package/fesm2022/cdevhub-ngx-tw-icon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-input.mjs +52 -61
- package/fesm2022/cdevhub-ngx-tw-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-item.mjs +28 -4
- package/fesm2022/cdevhub-ngx-tw-item.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-menu-testing.mjs +168 -0
- package/fesm2022/cdevhub-ngx-tw-menu-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-menu.mjs +58 -21
- package/fesm2022/cdevhub-ngx-tw-menu.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs +34 -1
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs +95 -45
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-popover.mjs +81 -32
- package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs +1 -1
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-radio.mjs +131 -98
- package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs +207 -42
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-select-testing.mjs +165 -0
- package/fesm2022/cdevhub-ngx-tw-select-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-select.mjs +386 -210
- package/fesm2022/cdevhub-ngx-tw-select.mjs.map +1 -1
- package/fesm2022/{cdevhub-ngx-tw-sheet-sheet-renderer-ByyNluUd.mjs → cdevhub-ngx-tw-sheet-sheet-renderer-CqVJwgmp.mjs} +3 -3
- package/fesm2022/cdevhub-ngx-tw-sheet-sheet-renderer-CqVJwgmp.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-sheet-testing.mjs +129 -0
- package/fesm2022/cdevhub-ngx-tw-sheet-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs +23 -7
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-slider.mjs +89 -54
- package/fesm2022/cdevhub-ngx-tw-slider.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-sort.mjs +122 -17
- package/fesm2022/cdevhub-ngx-tw-sort.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-split.mjs +72 -19
- package/fesm2022/cdevhub-ngx-tw-split.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stat.mjs +63 -25
- package/fesm2022/cdevhub-ngx-tw-stat.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs +35 -8
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-switch.mjs +54 -48
- package/fesm2022/cdevhub-ngx-tw-switch.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs +12 -15
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-table.mjs +74 -13
- package/fesm2022/cdevhub-ngx-tw-table.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs +84 -30
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tags-input-testing.mjs +172 -0
- package/fesm2022/cdevhub-ngx-tw-tags-input-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs +107 -71
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs +41 -9
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-theme.mjs +257 -45
- package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-time-picker-testing.mjs +201 -0
- package/fesm2022/cdevhub-ngx-tw-time-picker-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs +184 -77
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs +110 -27
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs.map +1 -1
- package/fesm2022/{cdevhub-ngx-tw-toast-toast-renderer-DSu4YoTy.mjs → cdevhub-ngx-tw-toast-toast-renderer-BlDxemsU.mjs} +107 -19
- package/fesm2022/cdevhub-ngx-tw-toast-toast-renderer-BlDxemsU.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-toast.mjs +21 -13
- package/fesm2022/cdevhub-ngx-tw-toast.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs +102 -15
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-transfer-testing.mjs +219 -0
- package/fesm2022/cdevhub-ngx-tw-transfer-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs +88 -69
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tree.mjs +68 -19
- package/fesm2022/cdevhub-ngx-tw-tree.mjs.map +1 -1
- package/index.json +1 -1
- package/package.json +63 -2
- package/theme/_base.css +13 -0
- package/theme/_dark.css +111 -36
- package/theme/_high-contrast-dark.css +367 -0
- package/theme/_high-contrast.css +13 -2
- package/theme/_light.css +332 -0
- package/theme/_semantic.css +60 -26
- package/theme/_typography.css +17 -0
- package/theme/index.css +86 -7
- package/types/cdevhub-ngx-tw-accordion.d.ts +12 -4
- package/types/cdevhub-ngx-tw-avatar.d.ts +10 -3
- package/types/cdevhub-ngx-tw-button.d.ts +1 -0
- package/types/cdevhub-ngx-tw-calendar-luxon.d.ts +2 -2
- package/types/cdevhub-ngx-tw-calendar-testing.d.ts +1 -1
- package/types/cdevhub-ngx-tw-calendar.d.ts +179 -73
- package/types/cdevhub-ngx-tw-card.d.ts +11 -3
- package/types/cdevhub-ngx-tw-carousel.d.ts +89 -20
- package/types/cdevhub-ngx-tw-checkbox.d.ts +40 -12
- package/types/cdevhub-ngx-tw-code-block.d.ts +11 -2
- package/types/cdevhub-ngx-tw-collapsible.d.ts +32 -5
- package/types/cdevhub-ngx-tw-combobox-testing.d.ts +157 -0
- package/types/cdevhub-ngx-tw-combobox.d.ts +94 -53
- package/types/cdevhub-ngx-tw-command-palette-testing.d.ts +136 -0
- package/types/cdevhub-ngx-tw-command-palette.d.ts +33 -5
- package/types/cdevhub-ngx-tw-core.d.ts +152 -21
- package/types/cdevhub-ngx-tw-date-picker-testing.d.ts +141 -0
- package/types/cdevhub-ngx-tw-date-picker.d.ts +37 -29
- package/types/cdevhub-ngx-tw-date-range-picker-testing.d.ts +148 -0
- package/types/cdevhub-ngx-tw-date-range-picker.d.ts +36 -29
- package/types/cdevhub-ngx-tw-dialog-testing.d.ts +98 -0
- package/types/cdevhub-ngx-tw-dialog.d.ts +12 -3
- package/types/cdevhub-ngx-tw-file-upload-testing.d.ts +120 -0
- package/types/cdevhub-ngx-tw-file-upload.d.ts +8 -10
- package/types/cdevhub-ngx-tw-flip-card.d.ts +18 -11
- package/types/cdevhub-ngx-tw-form-field.d.ts +19 -2
- package/types/cdevhub-ngx-tw-icon.d.ts +3 -3
- package/types/cdevhub-ngx-tw-input.d.ts +5 -8
- package/types/cdevhub-ngx-tw-item.d.ts +2 -0
- package/types/cdevhub-ngx-tw-menu-testing.d.ts +131 -0
- package/types/cdevhub-ngx-tw-menu.d.ts +2 -2
- package/types/cdevhub-ngx-tw-number-input.d.ts +20 -0
- package/types/cdevhub-ngx-tw-paginator.d.ts +58 -24
- package/types/cdevhub-ngx-tw-popover.d.ts +41 -10
- package/types/cdevhub-ngx-tw-progress-bar.d.ts +1 -1
- package/types/cdevhub-ngx-tw-radio.d.ts +68 -25
- package/types/cdevhub-ngx-tw-segmented-control.d.ts +79 -16
- package/types/cdevhub-ngx-tw-select-testing.d.ts +114 -0
- package/types/cdevhub-ngx-tw-select.d.ts +104 -33
- package/types/cdevhub-ngx-tw-sheet-testing.d.ts +104 -0
- package/types/cdevhub-ngx-tw-sheet.d.ts +19 -3
- package/types/cdevhub-ngx-tw-slider.d.ts +79 -25
- package/types/cdevhub-ngx-tw-sort.d.ts +45 -4
- package/types/cdevhub-ngx-tw-split.d.ts +32 -2
- package/types/cdevhub-ngx-tw-stat.d.ts +14 -4
- package/types/cdevhub-ngx-tw-stepper.d.ts +16 -2
- package/types/cdevhub-ngx-tw-switch.d.ts +35 -13
- package/types/cdevhub-ngx-tw-tab-nav.d.ts +7 -6
- package/types/cdevhub-ngx-tw-table.d.ts +53 -10
- package/types/cdevhub-ngx-tw-tabs.d.ts +41 -10
- package/types/cdevhub-ngx-tw-tags-input-testing.d.ts +135 -0
- package/types/cdevhub-ngx-tw-tags-input.d.ts +26 -11
- package/types/cdevhub-ngx-tw-textarea.d.ts +3 -2
- package/types/cdevhub-ngx-tw-theme.d.ts +245 -39
- package/types/cdevhub-ngx-tw-time-picker-testing.d.ts +129 -0
- package/types/cdevhub-ngx-tw-time-picker.d.ts +76 -19
- package/types/cdevhub-ngx-tw-timeline.d.ts +36 -12
- package/types/cdevhub-ngx-tw-toast.d.ts +20 -6
- package/types/cdevhub-ngx-tw-tooltip.d.ts +28 -6
- package/types/cdevhub-ngx-tw-transfer-testing.d.ts +152 -0
- package/types/cdevhub-ngx-tw-transfer.d.ts +21 -8
- package/types/cdevhub-ngx-tw-tree.d.ts +6 -1
- package/fesm2022/cdevhub-ngx-tw-sheet-sheet-renderer-ByyNluUd.mjs.map +0 -1
- package/fesm2022/cdevhub-ngx-tw-toast-toast-renderer-DSu4YoTy.mjs.map +0 -1
|
@@ -2,9 +2,11 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, inject, TemplateRef, Directive, ElementRef, model, output, contentChildren, contentChild, viewChildren, computed, afterNextRender, isDevMode, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import { LiveAnnouncer, FocusKeyManager } from '@angular/cdk/a11y';
|
|
5
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
5
6
|
import { tv } from 'tailwind-variants';
|
|
6
7
|
|
|
7
8
|
// ── Default labels ────────────────────────────────────────────────
|
|
9
|
+
/** English defaults. `Required<>` so every key reads back as a plain `string`. */
|
|
8
10
|
const DEFAULT_LABELS = {
|
|
9
11
|
ariaLabel: 'Pagination',
|
|
10
12
|
previous: 'Previous',
|
|
@@ -104,6 +106,13 @@ function range(start, end) {
|
|
|
104
106
|
}
|
|
105
107
|
/** Replaces `{key}` placeholders in `template` with values from `vars`. */
|
|
106
108
|
function formatLabel(template, vars) {
|
|
109
|
+
// Defence in depth. `resolvedLabels()` already filters explicitly-undefined
|
|
110
|
+
// consumer keys, so a non-string cannot reach here through the public
|
|
111
|
+
// `labels` input today. The guard exists so a future regression in that
|
|
112
|
+
// merge degrades to a missing label instead of throwing inside a `computed`
|
|
113
|
+
// and taking the render down.
|
|
114
|
+
if (typeof template !== 'string')
|
|
115
|
+
return '';
|
|
107
116
|
return template.replace(/\{(\w+)\}/g, (match, key) => Object.prototype.hasOwnProperty.call(vars, key) ? String(vars[key]) : match);
|
|
108
117
|
}
|
|
109
118
|
// ── tv() config ───────────────────────────────────────────────────
|
|
@@ -124,42 +133,50 @@ const paginatorVariants = tv({
|
|
|
124
133
|
icon: 'size-4 shrink-0',
|
|
125
134
|
},
|
|
126
135
|
variants: {
|
|
136
|
+
// Heights are pinned to the control scale (docs/vertical-rhythm.md):
|
|
137
|
+
// 24 / 32 / 36 / 44 / 48. Vertical padding is deleted deliberately — the
|
|
138
|
+
// buttons centre via `inline-flex items-center justify-center` and the
|
|
139
|
+
// native `<select>` centres its own text, so any surviving `py-*` would
|
|
140
|
+
// only fight the pinned height under `box-sizing: border-box`. `min-w-*`
|
|
141
|
+
// tracks the height so number buttons stay square until the digits
|
|
142
|
+
// widen them. `ellipsis` moves in lockstep or the numbered row
|
|
143
|
+
// reintroduces a height divergence inside the component.
|
|
127
144
|
size: {
|
|
128
145
|
xs: {
|
|
129
|
-
navButton: 'px-2
|
|
130
|
-
pageButton: 'px-2
|
|
131
|
-
pageSizeSelect: 'px-2
|
|
132
|
-
ellipsis: 'min-w-
|
|
146
|
+
navButton: 'px-2 text-xs min-w-6 h-6',
|
|
147
|
+
pageButton: 'px-2 text-xs min-w-6 h-6',
|
|
148
|
+
pageSizeSelect: 'px-2 text-xs h-6',
|
|
149
|
+
ellipsis: 'min-w-6 h-6 text-xs',
|
|
133
150
|
// `size-3.5` (14px) half-step: neither size-3 nor size-4 aligns with
|
|
134
|
-
// text-xs glyph metrics inside a
|
|
151
|
+
// text-xs glyph metrics inside a 24px nav button.
|
|
135
152
|
icon: 'size-3.5',
|
|
136
153
|
},
|
|
137
154
|
sm: {
|
|
138
|
-
navButton: 'px-2.5
|
|
139
|
-
pageButton: 'px-2.5
|
|
140
|
-
pageSizeSelect: 'px-2.5
|
|
155
|
+
navButton: 'px-2.5 text-sm min-w-8 h-8',
|
|
156
|
+
pageButton: 'px-2.5 text-sm min-w-8 h-8',
|
|
157
|
+
pageSizeSelect: 'px-2.5 text-sm h-8',
|
|
141
158
|
ellipsis: 'min-w-8 h-8 text-sm',
|
|
142
159
|
icon: 'size-4',
|
|
143
160
|
},
|
|
144
161
|
md: {
|
|
145
|
-
navButton: 'px-3
|
|
146
|
-
pageButton: 'px-3
|
|
147
|
-
pageSizeSelect: 'px-3
|
|
162
|
+
navButton: 'px-3 text-sm min-w-9 h-9',
|
|
163
|
+
pageButton: 'px-3 text-sm min-w-9 h-9',
|
|
164
|
+
pageSizeSelect: 'px-3 text-sm h-9',
|
|
148
165
|
ellipsis: 'min-w-9 h-9 text-sm',
|
|
149
166
|
icon: 'size-4',
|
|
150
167
|
},
|
|
151
168
|
lg: {
|
|
152
|
-
navButton: 'px-4
|
|
153
|
-
pageButton: 'px-4
|
|
154
|
-
pageSizeSelect: 'px-4
|
|
155
|
-
ellipsis: 'min-w-
|
|
169
|
+
navButton: 'px-4 text-base min-w-11 h-11',
|
|
170
|
+
pageButton: 'px-4 text-base min-w-11 h-11',
|
|
171
|
+
pageSizeSelect: 'px-4 text-base h-11',
|
|
172
|
+
ellipsis: 'min-w-11 h-11 text-base',
|
|
156
173
|
icon: 'size-5',
|
|
157
174
|
},
|
|
158
175
|
xl: {
|
|
159
|
-
navButton: 'px-5
|
|
160
|
-
pageButton: 'px-5
|
|
161
|
-
pageSizeSelect: 'px-5
|
|
162
|
-
ellipsis: 'min-w-
|
|
176
|
+
navButton: 'px-5 text-base min-w-12 h-12',
|
|
177
|
+
pageButton: 'px-5 text-base min-w-12 h-12',
|
|
178
|
+
pageSizeSelect: 'px-5 text-base h-12',
|
|
179
|
+
ellipsis: 'min-w-12 h-12 text-base',
|
|
163
180
|
icon: 'size-5',
|
|
164
181
|
},
|
|
165
182
|
},
|
|
@@ -266,7 +283,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
266
283
|
// spec's button queries. See the JSDoc above this declaration.
|
|
267
284
|
class PaginatorFocusableDirective {
|
|
268
285
|
elementRef = inject((ElementRef));
|
|
269
|
-
/** When true, the element is skipped by `FocusKeyManager` roving focus. */
|
|
286
|
+
/** When true, the element is skipped by `FocusKeyManager` roving focus. Defaults to `false`. */
|
|
270
287
|
isDisabled = input(false, /* @ts-ignore */
|
|
271
288
|
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
272
289
|
focus() {
|
|
@@ -297,10 +314,10 @@ class PaginatorComponent {
|
|
|
297
314
|
/** Total number of items across all pages. Defaults to `0`. */
|
|
298
315
|
totalItems = input(0, /* @ts-ignore */
|
|
299
316
|
...(ngDevMode ? [{ debugName: "totalItems" }] : /* istanbul ignore next */ []));
|
|
300
|
-
/** Items per page. Two-way bindable via `[(pageSize)]
|
|
317
|
+
/** Items per page. Two-way bindable via `[(pageSize)]`; writes back when the user picks a different size in the page-size selector. Defaults to `10`. */
|
|
301
318
|
pageSize = model(10, /* @ts-ignore */
|
|
302
319
|
...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
303
|
-
/** 1-based current page. Two-way bindable via `[(page)]
|
|
320
|
+
/** 1-based current page. Two-way bindable via `[(page)]`; writes back when the user navigates, and whenever the value is clamped into the valid `1…totalPages` range. Defaults to `1`. */
|
|
304
321
|
page = model(1, /* @ts-ignore */
|
|
305
322
|
...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
|
|
306
323
|
/** Rendering type. Defaults to `'numbered'`. */
|
|
@@ -321,9 +338,7 @@ class PaginatorComponent {
|
|
|
321
338
|
/** How many pages to always show at the start and end boundaries. Defaults to `1`. */
|
|
322
339
|
boundaryCount = input(1, /* @ts-ignore */
|
|
323
340
|
...(ngDevMode ? [{ debugName: "boundaryCount" }] : /* istanbul ignore next */ []));
|
|
324
|
-
/** When true, renders jump-to-first and jump-to-last buttons. Defaults to `true
|
|
325
|
-
// TRUE-default: first/last jumps are the standard pagination affordance for
|
|
326
|
-
// any list large enough to need a paginator; opt-out is for compact paginators.
|
|
341
|
+
/** When true, renders jump-to-first and jump-to-last buttons. Defaults to `true` — first/last jumps are the standard pagination affordance for any list large enough to need a paginator; the special case is a compact paginator that opts out. */
|
|
327
342
|
showFirstLastButtons = input(true, /* @ts-ignore */
|
|
328
343
|
...(ngDevMode ? [{ debugName: "showFirstLastButtons" }] : /* istanbul ignore next */ []));
|
|
329
344
|
/** When true, renders the page-size selector region. Defaults to `false`. */
|
|
@@ -332,14 +347,10 @@ class PaginatorComponent {
|
|
|
332
347
|
/** Options for the default page-size selector. Ignored when `*twPaginatorPageSizeSelector` is projected. Defaults to `[10, 25, 50, 100]`. */
|
|
333
348
|
pageSizeOptions = input([10, 25, 50, 100], /* @ts-ignore */
|
|
334
349
|
...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : /* istanbul ignore next */ []));
|
|
335
|
-
/** When true, renders the page-info text region. Defaults to `true
|
|
336
|
-
// TRUE-default: showing "X–Y of Z" is the expected pagination context; opt-out
|
|
337
|
-
// is for ultra-compact paginators that fit in tight UI.
|
|
350
|
+
/** When true, renders the page-info text region. Defaults to `true` — showing "X–Y of Z" is the expected pagination context; the special case is an ultra-compact paginator in tight UI that opts out. */
|
|
338
351
|
showPageInfo = input(true, /* @ts-ignore */
|
|
339
352
|
...(ngDevMode ? [{ debugName: "showPageInfo" }] : /* istanbul ignore next */ []));
|
|
340
|
-
/** When true, renders nothing when `totalItems === 0`. Defaults to `true
|
|
341
|
-
// TRUE-default: hiding the paginator on empty data is expected UX; opt-out is
|
|
342
|
-
// for layouts that need to reserve the paginator's vertical space.
|
|
353
|
+
/** When true, renders nothing when `totalItems === 0`. Defaults to `true` — hiding the paginator on empty data is the expected UX; the special case is a layout that opts out to reserve the paginator's vertical space. */
|
|
343
354
|
hideOnEmpty = input(true, /* @ts-ignore */
|
|
344
355
|
...(ngDevMode ? [{ debugName: "hideOnEmpty" }] : /* istanbul ignore next */ []));
|
|
345
356
|
/** When true, renders nothing when `totalPages <= 1`. Defaults to `false`. */
|
|
@@ -357,7 +368,16 @@ class PaginatorComponent {
|
|
|
357
368
|
/** When provided, buttons render as anchor links using the returned `href`. Defaults to `undefined` (renders as buttons). */
|
|
358
369
|
linkFactory = input(undefined, /* @ts-ignore */
|
|
359
370
|
...(ngDevMode ? [{ debugName: "linkFactory" }] : /* istanbul ignore next */ []));
|
|
360
|
-
/**
|
|
371
|
+
/**
|
|
372
|
+
* Overrides `labels.ariaLabel` for the root `<nav>` element. Bound as `aria-label`.
|
|
373
|
+
* Defaults to `undefined` (the resolved `labels.ariaLabel` is used).
|
|
374
|
+
*
|
|
375
|
+
* The host renders as a `navigation` landmark, so a page showing more than one
|
|
376
|
+
* paginator (the common "controls above and below a table" shape) MUST give each
|
|
377
|
+
* one a distinct name here — two landmarks of the same role sharing an accessible
|
|
378
|
+
* name are indistinguishable to a screen-reader landmark list (axe:
|
|
379
|
+
* `landmark-unique`).
|
|
380
|
+
*/
|
|
361
381
|
customAriaLabel = input(undefined, { ...(ngDevMode ? { debugName: "customAriaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
362
382
|
// ── Outputs ──
|
|
363
383
|
/** Fires when `page` or `pageSize` changes. Payload includes derived helpers (`start`, `end`, `totalPages`, `source`). Use `[(page)]` / `[(pageSize)]` for two-way binding; subscribe to this for the rich event payload. */
|
|
@@ -375,6 +395,11 @@ class PaginatorComponent {
|
|
|
375
395
|
// ── Injected services ──
|
|
376
396
|
_liveAnnouncer = inject(LiveAnnouncer);
|
|
377
397
|
_elementRef = inject((ElementRef));
|
|
398
|
+
/**
|
|
399
|
+
* Optional so a consumer that never imports `BidiModule` still gets a working
|
|
400
|
+
* paginator — the key manager falls back to `'ltr'` when the token is absent.
|
|
401
|
+
*/
|
|
402
|
+
_directionality = inject(Directionality, { optional: true });
|
|
378
403
|
// ── View children ──
|
|
379
404
|
/** @internal All nav-group focusables (first/prev/page/next/last) for `FocusKeyManager`. */
|
|
380
405
|
focusableItems = viewChildren(PaginatorFocusableDirective, /* @ts-ignore */
|
|
@@ -415,11 +440,23 @@ class PaginatorComponent {
|
|
|
415
440
|
/** @internal Visible page range for the numbered type. */
|
|
416
441
|
range = computed(() => buildPaginationRange(this.clampedPage(), this.totalPages(), this.siblingCount(), this.boundaryCount()), /* @ts-ignore */
|
|
417
442
|
...(ngDevMode ? [{ debugName: "range" }] : /* istanbul ignore next */ []));
|
|
418
|
-
/**
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
443
|
+
/**
|
|
444
|
+
* @internal Merged labels.
|
|
445
|
+
*
|
|
446
|
+
* Explicitly-undefined keys are dropped before merging. Root `tsconfig.json`
|
|
447
|
+
* does not set `exactOptionalPropertyTypes`, so
|
|
448
|
+
* `[labels]="{ pageButtonAriaLabel: i18n.pageBtn }"` type-checks even when
|
|
449
|
+
* the i18n bundle has no such key — and a plain spread would then overwrite
|
|
450
|
+
* the default with `undefined`, which reaches `formatLabel()` and throws
|
|
451
|
+
* `Cannot read properties of undefined (reading 'replace')` inside a
|
|
452
|
+
* `computed`, taking the whole page down on first render. Same filter
|
|
453
|
+
* `table.ts` and `timeline.ts` already use; `Required<>` then guarantees the
|
|
454
|
+
* template a string for every label.
|
|
455
|
+
*/
|
|
456
|
+
resolvedLabels = computed(() => {
|
|
457
|
+
const overrides = Object.fromEntries(Object.entries(this.labels() ?? {}).filter(([, value]) => value !== undefined));
|
|
458
|
+
return { ...DEFAULT_LABELS, ...overrides };
|
|
459
|
+
}, /* @ts-ignore */
|
|
423
460
|
...(ngDevMode ? [{ debugName: "resolvedLabels" }] : /* istanbul ignore next */ []));
|
|
424
461
|
/** @internal Resolved aria-label for the root. */
|
|
425
462
|
resolvedAriaLabel = computed(() => this.customAriaLabel() ?? this.resolvedLabels().ariaLabel, /* @ts-ignore */
|
|
@@ -608,21 +645,34 @@ class PaginatorComponent {
|
|
|
608
645
|
});
|
|
609
646
|
});
|
|
610
647
|
// Rebuild the FocusKeyManager whenever the focusable set changes (e.g. the
|
|
611
|
-
// numbered page list re-renders when total or current page shifts)
|
|
612
|
-
// `.withWrap()` — paginators should NOT loop
|
|
613
|
-
// last page; that would be disorienting
|
|
614
|
-
// tabs
|
|
615
|
-
//
|
|
648
|
+
// numbered page list re-renders when total or current page shifts) or the
|
|
649
|
+
// app flips `dir` at runtime. No `.withWrap()` — paginators should NOT loop
|
|
650
|
+
// from page 1 ArrowLeft to the last page; that would be disorienting, and
|
|
651
|
+
// this is a deliberate divergence from `tabs`/`tab-nav`, which do wrap.
|
|
652
|
+
//
|
|
653
|
+
// The orientation is fed from the live layout direction rather than a
|
|
654
|
+
// hardcoded `'ltr'`: CDK's ListKeyManager maps ArrowLeft to
|
|
655
|
+
// `setPreviousItemActive()` under `'ltr'` and `setNextItemActive()` under
|
|
656
|
+
// `'rtl'`, so pinning `'ltr'` inverts ArrowLeft/ArrowRight in RTL locales —
|
|
657
|
+
// the arrow steps backwards in DOM order but forwards visually.
|
|
658
|
+
// `Directionality.valueSignal` is read directly (CDK 22+) so this effect
|
|
659
|
+
// re-runs on a direction change without a manual subscription mirror; that
|
|
660
|
+
// is the same behaviour `tab-nav` gets from its `Directionality.change`
|
|
661
|
+
// subscription, with less boilerplate.
|
|
662
|
+
//
|
|
663
|
+
// The `disabled` getter on `PaginatorFocusableDirective` resolves the
|
|
664
|
+
// `isDisabled()` signal so the manager skips disabled controls.
|
|
616
665
|
// `onCleanup` fires both on rebuild AND on component destroy, so no separate
|
|
617
666
|
// `_destroyRef.onDestroy` is needed.
|
|
618
667
|
effect((onCleanup) => {
|
|
619
668
|
const items = this.focusableItems();
|
|
669
|
+
const direction = this._directionality?.valueSignal() ?? 'ltr';
|
|
620
670
|
if (items.length === 0) {
|
|
621
671
|
this._keyManager = null;
|
|
622
672
|
return;
|
|
623
673
|
}
|
|
624
674
|
const manager = new FocusKeyManager(items)
|
|
625
|
-
.withHorizontalOrientation(
|
|
675
|
+
.withHorizontalOrientation(direction)
|
|
626
676
|
.withHomeAndEnd();
|
|
627
677
|
this._keyManager = manager;
|
|
628
678
|
onCleanup(() => {
|
|
@@ -741,7 +791,7 @@ class PaginatorComponent {
|
|
|
741
791
|
}
|
|
742
792
|
}
|
|
743
793
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
744
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: PaginatorComponent, isStandalone: true, selector: "tw-paginator", inputs: { totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, siblingCount: { classPropertyName: "siblingCount", publicName: "siblingCount", isSignal: true, isRequired: false, transformFunction: null }, boundaryCount: { classPropertyName: "boundaryCount", publicName: "boundaryCount", isSignal: true, isRequired: false, transformFunction: null }, showFirstLastButtons: { classPropertyName: "showFirstLastButtons", publicName: "showFirstLastButtons", isSignal: true, isRequired: false, transformFunction: null }, showPageSizeSelector: { classPropertyName: "showPageSizeSelector", publicName: "showPageSizeSelector", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPageInfo: { classPropertyName: "showPageInfo", publicName: "showPageInfo", isSignal: true, isRequired: false, transformFunction: null }, hideOnEmpty: { classPropertyName: "hideOnEmpty", publicName: "hideOnEmpty", isSignal: true, isRequired: false, transformFunction: null }, hideOnSinglePage: { classPropertyName: "hideOnSinglePage", publicName: "hideOnSinglePage", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, linkFactory: { classPropertyName: "linkFactory", publicName: "linkFactory", isSignal: true, isRequired: false, transformFunction: null }, customAriaLabel: { classPropertyName: "customAriaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageSize: "pageSizeChange", page: "pageChange", paginated: "paginated" }, host: { properties: { "attr.role": "shouldRender() ? \"navigation\" : null", "class": "rootClasses()", "attr.aria-label": "shouldRender() ? resolvedAriaLabel() : null", "style.container-name": "containerName()" } }, queries: [{ propertyName: "labelDirectives", predicate: PaginatorLabelDirective, isSignal: true }, { propertyName: "emptyDirective", first: true, predicate: PaginatorEmptyDirective, descendants: true, isSignal: true }, { propertyName: "pageSizeSelectorDirective", first: true, predicate: PaginatorPageSizeSelectorDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "focusableItems", predicate: PaginatorFocusableDirective, descendants: true, isSignal: true }], exportAs: ["twPaginator"], ngImport: i0, template: "@if (shouldRender()) {\n <div [class]=\"innerClasses()\">\n @if (isEmpty()) {\n <!-- Empty state -->\n @if (emptyDirective(); as emptyDir) {\n <ng-container\n [ngTemplateOutlet]=\"emptyDir.templateRef\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <span [class]=\"emptyStateClasses()\">{{ resolvedLabels().empty }}</span>\n }\n } @else {\n <!-- Page-size selector region -->\n @if (showPageSizeSelector() && pageSizeOptions().length > 0) {\n <div [class]=\"pageSizeGroupClasses()\">\n <label\n [attr.for]=\"pageSizeSelectId\"\n [class]=\"pageSizeLabelClasses()\"\n >\n @if (labelTemplateFor('pageSizeLabel'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n {{ resolvedLabels().pageSizeLabel }}\n }\n </label>\n\n @if (pageSizeSelectorDirective(); as dir) {\n <ng-container\n [ngTemplateOutlet]=\"dir.templateRef\"\n [ngTemplateOutletContext]=\"pageSizeContext()\"\n />\n } @else {\n <select\n [id]=\"pageSizeSelectId\"\n [class]=\"pageSizeSelectClasses()\"\n [disabled]=\"disabled()\"\n [value]=\"effectivePageSize()\"\n (change)=\"onPageSizeSelectChange($event)\"\n >\n @for (opt of pageSizeOptions(); track opt) {\n <option [value]=\"opt\">{{ opt }}</option>\n }\n </select>\n }\n </div>\n }\n\n <!-- Page info region -->\n @if (showPageInfo()) {\n <div [class]=\"pageInfoClasses()\">\n @if (labelTemplateFor('pageInfo'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n {{ formattedPageInfo() }}\n }\n </div>\n }\n\n <!-- Nav buttons region. Roving focus is owned by FocusKeyManager on the\n child buttons; this wrapper only relays keydown to the manager, so\n it does not need its own tabindex. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n [class]=\"navGroupClasses()\"\n (keydown)=\"onKeydown($event)\"\n >\n <!-- First -->\n @if (showFirstLastButtons()) {\n @let firstDisabled = disabled() || isAtFirstPage();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"firstDisabled\"\n data-tw-paginator-nav=\"first\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"firstDisabled ? null : hrefFor(1)\"\n [attr.aria-disabled]=\"firstDisabled ? 'true' : null\"\n [attr.tabindex]=\"firstDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().first\"\n (click)=\"onLinkClick($event, 1, firstDisabled, 'click')\"\n >\n @if (labelTemplateFor('first'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M10.78 4.22a.75.75 0 0 1 0 1.06L6.06 10l4.72 4.72a.75.75 0 0 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Zm6 0a.75.75 0 0 1 0 1.06L12.06 10l4.72 4.72a.75.75 0 1 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"firstDisabled\"\n data-tw-paginator-nav=\"first\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"firstDisabled\"\n [attr.aria-label]=\"resolvedLabels().first\"\n (click)=\"goTo(1, 'click')\"\n >\n @if (labelTemplateFor('first'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M10.78 4.22a.75.75 0 0 1 0 1.06L6.06 10l4.72 4.72a.75.75 0 0 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Zm6 0a.75.75 0 0 1 0 1.06L12.06 10l4.72 4.72a.75.75 0 1 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n }\n\n <!-- Previous -->\n @let prevDisabled = disabled() || isAtFirstPage();\n @let prevTarget = previousTarget();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"prevDisabled\"\n data-tw-paginator-nav=\"prev\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"prevDisabled ? null : hrefFor(prevTarget)\"\n [attr.aria-disabled]=\"prevDisabled ? 'true' : null\"\n [attr.tabindex]=\"prevDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().previous\"\n (click)=\"onLinkClick($event, prevTarget, prevDisabled, 'click')\"\n >\n @if (labelTemplateFor('previous'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M12.78 5.22a.75.75 0 0 1 0 1.06L9.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"prevDisabled\"\n data-tw-paginator-nav=\"prev\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"prevDisabled\"\n [attr.aria-label]=\"resolvedLabels().previous\"\n (click)=\"goTo(prevTarget, 'click')\"\n >\n @if (labelTemplateFor('previous'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M12.78 5.22a.75.75 0 0 1 0 1.06L9.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n\n <!-- Numbered page list -->\n @if (type() === 'numbered') {\n <div [class]=\"pageListClasses()\">\n @for (item of range(); track $index) {\n @if (item === 'ellipsis-left' || item === 'ellipsis-right') {\n <span\n [class]=\"ellipsisClasses()\"\n [attr.aria-label]=\"resolvedLabels().ellipsis\"\n >\n <span aria-hidden=\"true\">…</span>\n </span>\n } @else {\n @let pageNumber = item;\n @let isActive = pageNumber === clampedPage();\n @let pageDisabled = disabled();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"pageDisabled\"\n data-tw-paginator-nav=\"page\"\n [class]=\"pageButtonClasses(isActive)\"\n [attr.href]=\"pageDisabled ? null : hrefFor(pageNumber)\"\n [attr.aria-disabled]=\"pageDisabled ? 'true' : null\"\n [attr.tabindex]=\"pageDisabled ? -1 : 0\"\n [attr.aria-current]=\"isActive ? 'page' : null\"\n [attr.aria-label]=\"\n isActive\n ? formatCurrentPageLabel(pageNumber)\n : formatPageButtonLabel(pageNumber)\n \"\n (click)=\"onLinkClick($event, pageNumber, pageDisabled, 'click')\"\n >{{ pageNumber }}</a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"pageDisabled\"\n data-tw-paginator-nav=\"page\"\n [class]=\"pageButtonClasses(isActive)\"\n [disabled]=\"pageDisabled\"\n [attr.aria-current]=\"isActive ? 'page' : null\"\n [attr.aria-label]=\"\n isActive\n ? formatCurrentPageLabel(pageNumber)\n : formatPageButtonLabel(pageNumber)\n \"\n (click)=\"goTo(pageNumber, 'click')\"\n >{{ pageNumber }}</button>\n }\n }\n }\n </div>\n }\n\n <!-- Next -->\n @let nextDisabled = disabled() || isAtLastPage();\n @let nextTargetPage = nextTarget();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"nextDisabled\"\n data-tw-paginator-nav=\"next\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"nextDisabled ? null : hrefFor(nextTargetPage)\"\n [attr.aria-disabled]=\"nextDisabled ? 'true' : null\"\n [attr.tabindex]=\"nextDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().next\"\n (click)=\"onLinkClick($event, nextTargetPage, nextDisabled, 'click')\"\n >\n @if (labelTemplateFor('next'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M7.22 14.78a.75.75 0 0 1 0-1.06L10.94 10 7.22 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"nextDisabled\"\n data-tw-paginator-nav=\"next\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"nextDisabled\"\n [attr.aria-label]=\"resolvedLabels().next\"\n (click)=\"goTo(nextTargetPage, 'click')\"\n >\n @if (labelTemplateFor('next'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M7.22 14.78a.75.75 0 0 1 0-1.06L10.94 10 7.22 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n\n <!-- Last -->\n @if (showFirstLastButtons()) {\n @let lastDisabled = disabled() || isAtLastPage();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"lastDisabled\"\n data-tw-paginator-nav=\"last\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"lastDisabled ? null : hrefFor(totalPages())\"\n [attr.aria-disabled]=\"lastDisabled ? 'true' : null\"\n [attr.tabindex]=\"lastDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().last\"\n (click)=\"onLinkClick($event, totalPages(), lastDisabled, 'click')\"\n >\n @if (labelTemplateFor('last'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M3.22 4.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 0 1-1.06-1.06L7.94 10 3.22 5.28a.75.75 0 0 1 0-1.06Zm6 0a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L13.94 10 9.22 5.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"lastDisabled\"\n data-tw-paginator-nav=\"last\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"lastDisabled\"\n [attr.aria-label]=\"resolvedLabels().last\"\n (click)=\"goTo(totalPages(), 'click')\"\n >\n @if (labelTemplateFor('last'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M3.22 4.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 0 1-1.06-1.06L7.94 10 3.22 5.28a.75.75 0 0 1 0-1.06Zm6 0a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L13.94 10 9.22 5.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n }\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: PaginatorFocusableDirective, selector: "[data-tw-paginator-focusable]", inputs: ["isDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
794
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: PaginatorComponent, isStandalone: true, selector: "tw-paginator", inputs: { totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, siblingCount: { classPropertyName: "siblingCount", publicName: "siblingCount", isSignal: true, isRequired: false, transformFunction: null }, boundaryCount: { classPropertyName: "boundaryCount", publicName: "boundaryCount", isSignal: true, isRequired: false, transformFunction: null }, showFirstLastButtons: { classPropertyName: "showFirstLastButtons", publicName: "showFirstLastButtons", isSignal: true, isRequired: false, transformFunction: null }, showPageSizeSelector: { classPropertyName: "showPageSizeSelector", publicName: "showPageSizeSelector", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPageInfo: { classPropertyName: "showPageInfo", publicName: "showPageInfo", isSignal: true, isRequired: false, transformFunction: null }, hideOnEmpty: { classPropertyName: "hideOnEmpty", publicName: "hideOnEmpty", isSignal: true, isRequired: false, transformFunction: null }, hideOnSinglePage: { classPropertyName: "hideOnSinglePage", publicName: "hideOnSinglePage", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, linkFactory: { classPropertyName: "linkFactory", publicName: "linkFactory", isSignal: true, isRequired: false, transformFunction: null }, customAriaLabel: { classPropertyName: "customAriaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageSize: "pageSizeChange", page: "pageChange", paginated: "paginated" }, host: { properties: { "attr.role": "shouldRender() ? \"navigation\" : null", "class": "rootClasses()", "attr.aria-label": "shouldRender() ? resolvedAriaLabel() : null", "style.container-name": "containerName()" } }, queries: [{ propertyName: "labelDirectives", predicate: PaginatorLabelDirective, isSignal: true }, { propertyName: "emptyDirective", first: true, predicate: PaginatorEmptyDirective, descendants: true, isSignal: true }, { propertyName: "pageSizeSelectorDirective", first: true, predicate: PaginatorPageSizeSelectorDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "focusableItems", predicate: PaginatorFocusableDirective, descendants: true, isSignal: true }], exportAs: ["twPaginator"], ngImport: i0, template: "@if (shouldRender()) {\n <div [class]=\"innerClasses()\">\n @if (isEmpty()) {\n <!-- Empty state -->\n @if (emptyDirective(); as emptyDir) {\n <ng-container\n [ngTemplateOutlet]=\"emptyDir.templateRef\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <span [class]=\"emptyStateClasses()\">{{ resolvedLabels().empty }}</span>\n }\n } @else {\n <!-- Page-size selector region -->\n @if (showPageSizeSelector() && pageSizeOptions().length > 0) {\n <div [class]=\"pageSizeGroupClasses()\">\n <label\n [attr.for]=\"pageSizeSelectId\"\n [class]=\"pageSizeLabelClasses()\"\n >\n @if (labelTemplateFor('pageSizeLabel'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n {{ resolvedLabels().pageSizeLabel }}\n }\n </label>\n\n @if (pageSizeSelectorDirective(); as dir) {\n <ng-container\n [ngTemplateOutlet]=\"dir.templateRef\"\n [ngTemplateOutletContext]=\"pageSizeContext()\"\n />\n } @else {\n <select\n [id]=\"pageSizeSelectId\"\n [class]=\"pageSizeSelectClasses()\"\n [disabled]=\"disabled()\"\n [value]=\"effectivePageSize()\"\n (change)=\"onPageSizeSelectChange($event)\"\n >\n @for (opt of pageSizeOptions(); track opt) {\n <option [value]=\"opt\">{{ opt }}</option>\n }\n </select>\n }\n </div>\n }\n\n <!-- Page info region -->\n @if (showPageInfo()) {\n <div [class]=\"pageInfoClasses()\">\n @if (labelTemplateFor('pageInfo'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n {{ formattedPageInfo() }}\n }\n </div>\n }\n\n <!-- Nav buttons region. Roving focus is owned by FocusKeyManager on the\n child buttons; this wrapper only relays keydown to the manager, so\n it does not need its own tabindex. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n [class]=\"navGroupClasses()\"\n (keydown)=\"onKeydown($event)\"\n >\n <!-- First -->\n @if (showFirstLastButtons()) {\n @let firstDisabled = disabled() || isAtFirstPage();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"firstDisabled\"\n data-tw-paginator-nav=\"first\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"firstDisabled ? null : hrefFor(1)\"\n [attr.role]=\"firstDisabled ? 'link' : null\"\n [attr.aria-disabled]=\"firstDisabled ? 'true' : null\"\n [attr.tabindex]=\"firstDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().first\"\n (click)=\"onLinkClick($event, 1, firstDisabled, 'click')\"\n >\n @if (labelTemplateFor('first'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M10.78 4.22a.75.75 0 0 1 0 1.06L6.06 10l4.72 4.72a.75.75 0 0 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Zm6 0a.75.75 0 0 1 0 1.06L12.06 10l4.72 4.72a.75.75 0 1 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"firstDisabled\"\n data-tw-paginator-nav=\"first\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"firstDisabled\"\n [attr.aria-label]=\"resolvedLabels().first\"\n (click)=\"goTo(1, 'click')\"\n >\n @if (labelTemplateFor('first'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M10.78 4.22a.75.75 0 0 1 0 1.06L6.06 10l4.72 4.72a.75.75 0 0 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Zm6 0a.75.75 0 0 1 0 1.06L12.06 10l4.72 4.72a.75.75 0 1 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n }\n\n <!-- Previous -->\n @let prevDisabled = disabled() || isAtFirstPage();\n @let prevTarget = previousTarget();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"prevDisabled\"\n data-tw-paginator-nav=\"prev\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"prevDisabled ? null : hrefFor(prevTarget)\"\n [attr.role]=\"prevDisabled ? 'link' : null\"\n [attr.aria-disabled]=\"prevDisabled ? 'true' : null\"\n [attr.tabindex]=\"prevDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().previous\"\n (click)=\"onLinkClick($event, prevTarget, prevDisabled, 'click')\"\n >\n @if (labelTemplateFor('previous'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M12.78 5.22a.75.75 0 0 1 0 1.06L9.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"prevDisabled\"\n data-tw-paginator-nav=\"prev\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"prevDisabled\"\n [attr.aria-label]=\"resolvedLabels().previous\"\n (click)=\"goTo(prevTarget, 'click')\"\n >\n @if (labelTemplateFor('previous'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M12.78 5.22a.75.75 0 0 1 0 1.06L9.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n\n <!-- Numbered page list -->\n @if (type() === 'numbered') {\n <div [class]=\"pageListClasses()\">\n @for (item of range(); track $index) {\n @if (item === 'ellipsis-left' || item === 'ellipsis-right') {\n <!--\n The gap marker carries its name as visually-hidden text rather\n than an aria-label. A span has no role, and ARIA prohibits a\n name on a roleless generic element (axe: aria-prohibited-attr),\n so the label was being dropped by assistive tech anyway. The\n sr-only child is real text content, which every AT exposes.\n -->\n <span [class]=\"ellipsisClasses()\">\n <span aria-hidden=\"true\">…</span>\n <span class=\"sr-only\">{{ resolvedLabels().ellipsis }}</span>\n </span>\n } @else {\n @let pageNumber = item;\n @let isActive = pageNumber === clampedPage();\n @let pageDisabled = disabled();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"pageDisabled\"\n data-tw-paginator-nav=\"page\"\n [class]=\"pageButtonClasses(isActive)\"\n [attr.href]=\"pageDisabled ? null : hrefFor(pageNumber)\"\n [attr.role]=\"pageDisabled ? 'link' : null\"\n [attr.aria-disabled]=\"pageDisabled ? 'true' : null\"\n [attr.tabindex]=\"pageDisabled ? -1 : 0\"\n [attr.aria-current]=\"isActive ? 'page' : null\"\n [attr.aria-label]=\"\n isActive\n ? formatCurrentPageLabel(pageNumber)\n : formatPageButtonLabel(pageNumber)\n \"\n (click)=\"onLinkClick($event, pageNumber, pageDisabled, 'click')\"\n >{{ pageNumber }}</a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"pageDisabled\"\n data-tw-paginator-nav=\"page\"\n [class]=\"pageButtonClasses(isActive)\"\n [disabled]=\"pageDisabled\"\n [attr.aria-current]=\"isActive ? 'page' : null\"\n [attr.aria-label]=\"\n isActive\n ? formatCurrentPageLabel(pageNumber)\n : formatPageButtonLabel(pageNumber)\n \"\n (click)=\"goTo(pageNumber, 'click')\"\n >{{ pageNumber }}</button>\n }\n }\n }\n </div>\n }\n\n <!-- Next -->\n @let nextDisabled = disabled() || isAtLastPage();\n @let nextTargetPage = nextTarget();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"nextDisabled\"\n data-tw-paginator-nav=\"next\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"nextDisabled ? null : hrefFor(nextTargetPage)\"\n [attr.role]=\"nextDisabled ? 'link' : null\"\n [attr.aria-disabled]=\"nextDisabled ? 'true' : null\"\n [attr.tabindex]=\"nextDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().next\"\n (click)=\"onLinkClick($event, nextTargetPage, nextDisabled, 'click')\"\n >\n @if (labelTemplateFor('next'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M7.22 14.78a.75.75 0 0 1 0-1.06L10.94 10 7.22 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"nextDisabled\"\n data-tw-paginator-nav=\"next\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"nextDisabled\"\n [attr.aria-label]=\"resolvedLabels().next\"\n (click)=\"goTo(nextTargetPage, 'click')\"\n >\n @if (labelTemplateFor('next'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M7.22 14.78a.75.75 0 0 1 0-1.06L10.94 10 7.22 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n\n <!-- Last -->\n @if (showFirstLastButtons()) {\n @let lastDisabled = disabled() || isAtLastPage();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"lastDisabled\"\n data-tw-paginator-nav=\"last\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"lastDisabled ? null : hrefFor(totalPages())\"\n [attr.role]=\"lastDisabled ? 'link' : null\"\n [attr.aria-disabled]=\"lastDisabled ? 'true' : null\"\n [attr.tabindex]=\"lastDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().last\"\n (click)=\"onLinkClick($event, totalPages(), lastDisabled, 'click')\"\n >\n @if (labelTemplateFor('last'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M3.22 4.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 0 1-1.06-1.06L7.94 10 3.22 5.28a.75.75 0 0 1 0-1.06Zm6 0a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L13.94 10 9.22 5.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"lastDisabled\"\n data-tw-paginator-nav=\"last\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"lastDisabled\"\n [attr.aria-label]=\"resolvedLabels().last\"\n (click)=\"goTo(totalPages(), 'click')\"\n >\n @if (labelTemplateFor('last'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M3.22 4.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 0 1-1.06-1.06L7.94 10 3.22 5.28a.75.75 0 0 1 0-1.06Zm6 0a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L13.94 10 9.22 5.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n }\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: PaginatorFocusableDirective, selector: "[data-tw-paginator-focusable]", inputs: ["isDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
745
795
|
}
|
|
746
796
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
747
797
|
type: Component,
|
|
@@ -750,7 +800,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
750
800
|
'[class]': 'rootClasses()',
|
|
751
801
|
'[attr.aria-label]': 'shouldRender() ? resolvedAriaLabel() : null',
|
|
752
802
|
'[style.container-name]': 'containerName()',
|
|
753
|
-
}, template: "@if (shouldRender()) {\n <div [class]=\"innerClasses()\">\n @if (isEmpty()) {\n <!-- Empty state -->\n @if (emptyDirective(); as emptyDir) {\n <ng-container\n [ngTemplateOutlet]=\"emptyDir.templateRef\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <span [class]=\"emptyStateClasses()\">{{ resolvedLabels().empty }}</span>\n }\n } @else {\n <!-- Page-size selector region -->\n @if (showPageSizeSelector() && pageSizeOptions().length > 0) {\n <div [class]=\"pageSizeGroupClasses()\">\n <label\n [attr.for]=\"pageSizeSelectId\"\n [class]=\"pageSizeLabelClasses()\"\n >\n @if (labelTemplateFor('pageSizeLabel'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n {{ resolvedLabels().pageSizeLabel }}\n }\n </label>\n\n @if (pageSizeSelectorDirective(); as dir) {\n <ng-container\n [ngTemplateOutlet]=\"dir.templateRef\"\n [ngTemplateOutletContext]=\"pageSizeContext()\"\n />\n } @else {\n <select\n [id]=\"pageSizeSelectId\"\n [class]=\"pageSizeSelectClasses()\"\n [disabled]=\"disabled()\"\n [value]=\"effectivePageSize()\"\n (change)=\"onPageSizeSelectChange($event)\"\n >\n @for (opt of pageSizeOptions(); track opt) {\n <option [value]=\"opt\">{{ opt }}</option>\n }\n </select>\n }\n </div>\n }\n\n <!-- Page info region -->\n @if (showPageInfo()) {\n <div [class]=\"pageInfoClasses()\">\n @if (labelTemplateFor('pageInfo'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n {{ formattedPageInfo() }}\n }\n </div>\n }\n\n <!-- Nav buttons region. Roving focus is owned by FocusKeyManager on the\n child buttons; this wrapper only relays keydown to the manager, so\n it does not need its own tabindex. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n [class]=\"navGroupClasses()\"\n (keydown)=\"onKeydown($event)\"\n >\n <!-- First -->\n @if (showFirstLastButtons()) {\n @let firstDisabled = disabled() || isAtFirstPage();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"firstDisabled\"\n data-tw-paginator-nav=\"first\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"firstDisabled ? null : hrefFor(1)\"\n [attr.aria-disabled]=\"firstDisabled ? 'true' : null\"\n [attr.tabindex]=\"firstDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().first\"\n (click)=\"onLinkClick($event, 1, firstDisabled, 'click')\"\n >\n @if (labelTemplateFor('first'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M10.78 4.22a.75.75 0 0 1 0 1.06L6.06 10l4.72 4.72a.75.75 0 0 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Zm6 0a.75.75 0 0 1 0 1.06L12.06 10l4.72 4.72a.75.75 0 1 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"firstDisabled\"\n data-tw-paginator-nav=\"first\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"firstDisabled\"\n [attr.aria-label]=\"resolvedLabels().first\"\n (click)=\"goTo(1, 'click')\"\n >\n @if (labelTemplateFor('first'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M10.78 4.22a.75.75 0 0 1 0 1.06L6.06 10l4.72 4.72a.75.75 0 0 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Zm6 0a.75.75 0 0 1 0 1.06L12.06 10l4.72 4.72a.75.75 0 1 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n }\n\n <!-- Previous -->\n @let prevDisabled = disabled() || isAtFirstPage();\n @let prevTarget = previousTarget();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"prevDisabled\"\n data-tw-paginator-nav=\"prev\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"prevDisabled ? null : hrefFor(prevTarget)\"\n [attr.aria-disabled]=\"prevDisabled ? 'true' : null\"\n [attr.tabindex]=\"prevDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().previous\"\n (click)=\"onLinkClick($event, prevTarget, prevDisabled, 'click')\"\n >\n @if (labelTemplateFor('previous'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M12.78 5.22a.75.75 0 0 1 0 1.06L9.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"prevDisabled\"\n data-tw-paginator-nav=\"prev\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"prevDisabled\"\n [attr.aria-label]=\"resolvedLabels().previous\"\n (click)=\"goTo(prevTarget, 'click')\"\n >\n @if (labelTemplateFor('previous'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M12.78 5.22a.75.75 0 0 1 0 1.06L9.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n\n <!-- Numbered page list -->\n @if (type() === 'numbered') {\n <div [class]=\"pageListClasses()\">\n @for (item of range(); track $index) {\n @if (item === 'ellipsis-left' || item === 'ellipsis-right') {\n <span\n [class]=\"ellipsisClasses()\"\n [attr.aria-label]=\"resolvedLabels().ellipsis\"\n >\n <span aria-hidden=\"true\">…</span>\n </span>\n } @else {\n @let pageNumber = item;\n @let isActive = pageNumber === clampedPage();\n @let pageDisabled = disabled();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"pageDisabled\"\n data-tw-paginator-nav=\"page\"\n [class]=\"pageButtonClasses(isActive)\"\n [attr.href]=\"pageDisabled ? null : hrefFor(pageNumber)\"\n [attr.aria-disabled]=\"pageDisabled ? 'true' : null\"\n [attr.tabindex]=\"pageDisabled ? -1 : 0\"\n [attr.aria-current]=\"isActive ? 'page' : null\"\n [attr.aria-label]=\"\n isActive\n ? formatCurrentPageLabel(pageNumber)\n : formatPageButtonLabel(pageNumber)\n \"\n (click)=\"onLinkClick($event, pageNumber, pageDisabled, 'click')\"\n >{{ pageNumber }}</a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"pageDisabled\"\n data-tw-paginator-nav=\"page\"\n [class]=\"pageButtonClasses(isActive)\"\n [disabled]=\"pageDisabled\"\n [attr.aria-current]=\"isActive ? 'page' : null\"\n [attr.aria-label]=\"\n isActive\n ? formatCurrentPageLabel(pageNumber)\n : formatPageButtonLabel(pageNumber)\n \"\n (click)=\"goTo(pageNumber, 'click')\"\n >{{ pageNumber }}</button>\n }\n }\n }\n </div>\n }\n\n <!-- Next -->\n @let nextDisabled = disabled() || isAtLastPage();\n @let nextTargetPage = nextTarget();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"nextDisabled\"\n data-tw-paginator-nav=\"next\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"nextDisabled ? null : hrefFor(nextTargetPage)\"\n [attr.aria-disabled]=\"nextDisabled ? 'true' : null\"\n [attr.tabindex]=\"nextDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().next\"\n (click)=\"onLinkClick($event, nextTargetPage, nextDisabled, 'click')\"\n >\n @if (labelTemplateFor('next'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M7.22 14.78a.75.75 0 0 1 0-1.06L10.94 10 7.22 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"nextDisabled\"\n data-tw-paginator-nav=\"next\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"nextDisabled\"\n [attr.aria-label]=\"resolvedLabels().next\"\n (click)=\"goTo(nextTargetPage, 'click')\"\n >\n @if (labelTemplateFor('next'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M7.22 14.78a.75.75 0 0 1 0-1.06L10.94 10 7.22 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n\n <!-- Last -->\n @if (showFirstLastButtons()) {\n @let lastDisabled = disabled() || isAtLastPage();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"lastDisabled\"\n data-tw-paginator-nav=\"last\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"lastDisabled ? null : hrefFor(totalPages())\"\n [attr.aria-disabled]=\"lastDisabled ? 'true' : null\"\n [attr.tabindex]=\"lastDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().last\"\n (click)=\"onLinkClick($event, totalPages(), lastDisabled, 'click')\"\n >\n @if (labelTemplateFor('last'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M3.22 4.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 0 1-1.06-1.06L7.94 10 3.22 5.28a.75.75 0 0 1 0-1.06Zm6 0a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L13.94 10 9.22 5.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"lastDisabled\"\n data-tw-paginator-nav=\"last\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"lastDisabled\"\n [attr.aria-label]=\"resolvedLabels().last\"\n (click)=\"goTo(totalPages(), 'click')\"\n >\n @if (labelTemplateFor('last'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M3.22 4.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 0 1-1.06-1.06L7.94 10 3.22 5.28a.75.75 0 0 1 0-1.06Zm6 0a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L13.94 10 9.22 5.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n }\n </div>\n }\n </div>\n}\n" }]
|
|
803
|
+
}, template: "@if (shouldRender()) {\n <div [class]=\"innerClasses()\">\n @if (isEmpty()) {\n <!-- Empty state -->\n @if (emptyDirective(); as emptyDir) {\n <ng-container\n [ngTemplateOutlet]=\"emptyDir.templateRef\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <span [class]=\"emptyStateClasses()\">{{ resolvedLabels().empty }}</span>\n }\n } @else {\n <!-- Page-size selector region -->\n @if (showPageSizeSelector() && pageSizeOptions().length > 0) {\n <div [class]=\"pageSizeGroupClasses()\">\n <label\n [attr.for]=\"pageSizeSelectId\"\n [class]=\"pageSizeLabelClasses()\"\n >\n @if (labelTemplateFor('pageSizeLabel'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n {{ resolvedLabels().pageSizeLabel }}\n }\n </label>\n\n @if (pageSizeSelectorDirective(); as dir) {\n <ng-container\n [ngTemplateOutlet]=\"dir.templateRef\"\n [ngTemplateOutletContext]=\"pageSizeContext()\"\n />\n } @else {\n <select\n [id]=\"pageSizeSelectId\"\n [class]=\"pageSizeSelectClasses()\"\n [disabled]=\"disabled()\"\n [value]=\"effectivePageSize()\"\n (change)=\"onPageSizeSelectChange($event)\"\n >\n @for (opt of pageSizeOptions(); track opt) {\n <option [value]=\"opt\">{{ opt }}</option>\n }\n </select>\n }\n </div>\n }\n\n <!-- Page info region -->\n @if (showPageInfo()) {\n <div [class]=\"pageInfoClasses()\">\n @if (labelTemplateFor('pageInfo'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n {{ formattedPageInfo() }}\n }\n </div>\n }\n\n <!-- Nav buttons region. Roving focus is owned by FocusKeyManager on the\n child buttons; this wrapper only relays keydown to the manager, so\n it does not need its own tabindex. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n [class]=\"navGroupClasses()\"\n (keydown)=\"onKeydown($event)\"\n >\n <!-- First -->\n @if (showFirstLastButtons()) {\n @let firstDisabled = disabled() || isAtFirstPage();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"firstDisabled\"\n data-tw-paginator-nav=\"first\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"firstDisabled ? null : hrefFor(1)\"\n [attr.role]=\"firstDisabled ? 'link' : null\"\n [attr.aria-disabled]=\"firstDisabled ? 'true' : null\"\n [attr.tabindex]=\"firstDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().first\"\n (click)=\"onLinkClick($event, 1, firstDisabled, 'click')\"\n >\n @if (labelTemplateFor('first'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M10.78 4.22a.75.75 0 0 1 0 1.06L6.06 10l4.72 4.72a.75.75 0 0 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Zm6 0a.75.75 0 0 1 0 1.06L12.06 10l4.72 4.72a.75.75 0 1 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"firstDisabled\"\n data-tw-paginator-nav=\"first\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"firstDisabled\"\n [attr.aria-label]=\"resolvedLabels().first\"\n (click)=\"goTo(1, 'click')\"\n >\n @if (labelTemplateFor('first'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M10.78 4.22a.75.75 0 0 1 0 1.06L6.06 10l4.72 4.72a.75.75 0 0 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Zm6 0a.75.75 0 0 1 0 1.06L12.06 10l4.72 4.72a.75.75 0 1 1-1.06 1.06l-5.25-5.25a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n }\n\n <!-- Previous -->\n @let prevDisabled = disabled() || isAtFirstPage();\n @let prevTarget = previousTarget();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"prevDisabled\"\n data-tw-paginator-nav=\"prev\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"prevDisabled ? null : hrefFor(prevTarget)\"\n [attr.role]=\"prevDisabled ? 'link' : null\"\n [attr.aria-disabled]=\"prevDisabled ? 'true' : null\"\n [attr.tabindex]=\"prevDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().previous\"\n (click)=\"onLinkClick($event, prevTarget, prevDisabled, 'click')\"\n >\n @if (labelTemplateFor('previous'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M12.78 5.22a.75.75 0 0 1 0 1.06L9.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"prevDisabled\"\n data-tw-paginator-nav=\"prev\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"prevDisabled\"\n [attr.aria-label]=\"resolvedLabels().previous\"\n (click)=\"goTo(prevTarget, 'click')\"\n >\n @if (labelTemplateFor('previous'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M12.78 5.22a.75.75 0 0 1 0 1.06L9.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n\n <!-- Numbered page list -->\n @if (type() === 'numbered') {\n <div [class]=\"pageListClasses()\">\n @for (item of range(); track $index) {\n @if (item === 'ellipsis-left' || item === 'ellipsis-right') {\n <!--\n The gap marker carries its name as visually-hidden text rather\n than an aria-label. A span has no role, and ARIA prohibits a\n name on a roleless generic element (axe: aria-prohibited-attr),\n so the label was being dropped by assistive tech anyway. The\n sr-only child is real text content, which every AT exposes.\n -->\n <span [class]=\"ellipsisClasses()\">\n <span aria-hidden=\"true\">…</span>\n <span class=\"sr-only\">{{ resolvedLabels().ellipsis }}</span>\n </span>\n } @else {\n @let pageNumber = item;\n @let isActive = pageNumber === clampedPage();\n @let pageDisabled = disabled();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"pageDisabled\"\n data-tw-paginator-nav=\"page\"\n [class]=\"pageButtonClasses(isActive)\"\n [attr.href]=\"pageDisabled ? null : hrefFor(pageNumber)\"\n [attr.role]=\"pageDisabled ? 'link' : null\"\n [attr.aria-disabled]=\"pageDisabled ? 'true' : null\"\n [attr.tabindex]=\"pageDisabled ? -1 : 0\"\n [attr.aria-current]=\"isActive ? 'page' : null\"\n [attr.aria-label]=\"\n isActive\n ? formatCurrentPageLabel(pageNumber)\n : formatPageButtonLabel(pageNumber)\n \"\n (click)=\"onLinkClick($event, pageNumber, pageDisabled, 'click')\"\n >{{ pageNumber }}</a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"pageDisabled\"\n data-tw-paginator-nav=\"page\"\n [class]=\"pageButtonClasses(isActive)\"\n [disabled]=\"pageDisabled\"\n [attr.aria-current]=\"isActive ? 'page' : null\"\n [attr.aria-label]=\"\n isActive\n ? formatCurrentPageLabel(pageNumber)\n : formatPageButtonLabel(pageNumber)\n \"\n (click)=\"goTo(pageNumber, 'click')\"\n >{{ pageNumber }}</button>\n }\n }\n }\n </div>\n }\n\n <!-- Next -->\n @let nextDisabled = disabled() || isAtLastPage();\n @let nextTargetPage = nextTarget();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"nextDisabled\"\n data-tw-paginator-nav=\"next\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"nextDisabled ? null : hrefFor(nextTargetPage)\"\n [attr.role]=\"nextDisabled ? 'link' : null\"\n [attr.aria-disabled]=\"nextDisabled ? 'true' : null\"\n [attr.tabindex]=\"nextDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().next\"\n (click)=\"onLinkClick($event, nextTargetPage, nextDisabled, 'click')\"\n >\n @if (labelTemplateFor('next'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M7.22 14.78a.75.75 0 0 1 0-1.06L10.94 10 7.22 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"nextDisabled\"\n data-tw-paginator-nav=\"next\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"nextDisabled\"\n [attr.aria-label]=\"resolvedLabels().next\"\n (click)=\"goTo(nextTargetPage, 'click')\"\n >\n @if (labelTemplateFor('next'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M7.22 14.78a.75.75 0 0 1 0-1.06L10.94 10 7.22 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n\n <!-- Last -->\n @if (showFirstLastButtons()) {\n @let lastDisabled = disabled() || isAtLastPage();\n @if (linkFactory()) {\n <a\n data-tw-paginator-focusable\n [isDisabled]=\"lastDisabled\"\n data-tw-paginator-nav=\"last\"\n [class]=\"navButtonClasses()\"\n [attr.href]=\"lastDisabled ? null : hrefFor(totalPages())\"\n [attr.role]=\"lastDisabled ? 'link' : null\"\n [attr.aria-disabled]=\"lastDisabled ? 'true' : null\"\n [attr.tabindex]=\"lastDisabled ? -1 : 0\"\n [attr.aria-label]=\"resolvedLabels().last\"\n (click)=\"onLinkClick($event, totalPages(), lastDisabled, 'click')\"\n >\n @if (labelTemplateFor('last'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M3.22 4.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 0 1-1.06-1.06L7.94 10 3.22 5.28a.75.75 0 0 1 0-1.06Zm6 0a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L13.94 10 9.22 5.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n data-tw-paginator-focusable\n [isDisabled]=\"lastDisabled\"\n data-tw-paginator-nav=\"last\"\n [class]=\"navButtonClasses()\"\n [disabled]=\"lastDisabled\"\n [attr.aria-label]=\"resolvedLabels().last\"\n (click)=\"goTo(totalPages(), 'click')\"\n >\n @if (labelTemplateFor('last'); as tmpl) {\n <ng-container\n [ngTemplateOutlet]=\"tmpl\"\n [ngTemplateOutletContext]=\"labelContext()\"\n />\n } @else {\n <svg\n [class]=\"iconClasses()\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M3.22 4.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 0 1-1.06-1.06L7.94 10 3.22 5.28a.75.75 0 0 1 0-1.06Zm6 0a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L13.94 10 9.22 5.28a.75.75 0 0 1 0-1.06Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n }\n </button>\n }\n }\n </div>\n }\n </div>\n}\n" }]
|
|
754
804
|
}], ctorParameters: () => [], propDecorators: { totalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalItems", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], siblingCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "siblingCount", required: false }] }], boundaryCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "boundaryCount", required: false }] }], showFirstLastButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstLastButtons", required: false }] }], showPageSizeSelector: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSizeSelector", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showPageInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageInfo", required: false }] }], hideOnEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideOnEmpty", required: false }] }], hideOnSinglePage: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideOnSinglePage", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], linkFactory: [{ type: i0.Input, args: [{ isSignal: true, alias: "linkFactory", required: false }] }], customAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], paginated: [{ type: i0.Output, args: ["paginated"] }], labelDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PaginatorLabelDirective), { isSignal: true }] }], emptyDirective: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PaginatorEmptyDirective), { isSignal: true }] }], pageSizeSelectorDirective: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PaginatorPageSizeSelectorDirective), { isSignal: true }] }], focusableItems: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => PaginatorFocusableDirective), { isSignal: true }] }] } });
|
|
755
805
|
|
|
756
806
|
/**
|