@cdevhub/ngx-tw 0.2.0 → 0.3.0
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 +264 -49
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs +11 -7
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-alert.mjs +43 -29
- package/fesm2022/cdevhub-ngx-tw-alert.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-aspect-ratio.mjs +103 -0
- package/fesm2022/cdevhub-ngx-tw-aspect-ratio.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs +56 -31
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-badge.mjs +61 -35
- package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs +154 -93
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-button.mjs +35 -22
- package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs +3 -3
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs +416 -216
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-card.mjs +33 -24
- package/fesm2022/cdevhub-ngx-tw-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs +152 -81
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +99 -47
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs +42 -29
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs +46 -29
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs +205 -110
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs +141 -74
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-core.mjs +16 -11
- package/fesm2022/cdevhub-ngx-tw-core.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs +395 -149
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs +305 -150
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs +56 -43
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs +51 -33
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs +905 -0
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs +49 -26
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs +133 -74
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs +2 -2
- package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-icon.mjs +28 -17
- package/fesm2022/cdevhub-ngx-tw-icon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-input.mjs +37 -21
- package/fesm2022/cdevhub-ngx-tw-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-item.mjs +33 -24
- package/fesm2022/cdevhub-ngx-tw-item.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-menu.mjs +63 -48
- package/fesm2022/cdevhub-ngx-tw-menu.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs +622 -0
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs +142 -72
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-popover.mjs +101 -46
- package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs +57 -30
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-radio.mjs +108 -57
- package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs +46 -26
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-select.mjs +227 -122
- package/fesm2022/cdevhub-ngx-tw-select.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-separator.mjs +21 -12
- package/fesm2022/cdevhub-ngx-tw-separator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs +58 -44
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-skeleton.mjs +25 -14
- package/fesm2022/cdevhub-ngx-tw-skeleton.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-slider.mjs +155 -79
- package/fesm2022/cdevhub-ngx-tw-slider.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-sort.mjs +47 -25
- package/fesm2022/cdevhub-ngx-tw-sort.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-spinner.mjs +29 -16
- package/fesm2022/cdevhub-ngx-tw-spinner.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-split.mjs +72 -42
- package/fesm2022/cdevhub-ngx-tw-split.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stat.mjs +107 -64
- package/fesm2022/cdevhub-ngx-tw-stat.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs +113 -47
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-switch.mjs +61 -32
- package/fesm2022/cdevhub-ngx-tw-switch.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs +88 -42
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-table.mjs +266 -118
- package/fesm2022/cdevhub-ngx-tw-table.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs +102 -52
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs +798 -0
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs +16 -8
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-theme.mjs +22 -14
- package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs +243 -95
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs +149 -82
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-toast.mjs +100 -55
- package/fesm2022/cdevhub-ngx-tw-toast.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs +50 -28
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs +1129 -0
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-tree.mjs +554 -0
- package/fesm2022/cdevhub-ngx-tw-tree.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw.mjs +7 -0
- package/fesm2022/cdevhub-ngx-tw.mjs.map +1 -1
- package/package.json +45 -17
- package/theme/_dark.css +16 -12
- package/theme/_semantic.css +3 -2
- package/theme/index.css +10 -2
- package/types/cdevhub-ngx-tw-aspect-ratio.d.ts +40 -0
- package/types/cdevhub-ngx-tw-calendar.d.ts +39 -8
- package/types/cdevhub-ngx-tw-code-block.d.ts +8 -7
- package/types/cdevhub-ngx-tw-command-palette.d.ts +7 -0
- package/types/cdevhub-ngx-tw-date-picker.d.ts +36 -10
- package/types/cdevhub-ngx-tw-file-upload.d.ts +250 -0
- package/types/cdevhub-ngx-tw-form-field.d.ts +22 -3
- package/types/cdevhub-ngx-tw-icon-lucide.d.ts +21 -3
- package/types/cdevhub-ngx-tw-number-input.d.ts +130 -0
- package/types/cdevhub-ngx-tw-popover.d.ts +8 -0
- package/types/cdevhub-ngx-tw-select.d.ts +1 -1
- package/types/cdevhub-ngx-tw-stepper.d.ts +30 -2
- package/types/cdevhub-ngx-tw-tab-nav.d.ts +8 -0
- package/types/cdevhub-ngx-tw-table.d.ts +30 -1
- package/types/cdevhub-ngx-tw-tabs.d.ts +8 -0
- package/types/cdevhub-ngx-tw-tags-input.d.ts +217 -0
- package/types/cdevhub-ngx-tw-time-picker.d.ts +31 -6
- package/types/cdevhub-ngx-tw-toast.d.ts +1 -1
- package/types/cdevhub-ngx-tw-transfer.d.ts +330 -0
- package/types/cdevhub-ngx-tw-tree.d.ts +189 -0
- package/types/cdevhub-ngx-tw.d.ts +7 -0
|
@@ -203,17 +203,18 @@ const paginatorVariants = tv({
|
|
|
203
203
|
*/
|
|
204
204
|
class PaginatorLabelDirective {
|
|
205
205
|
/** The label slot this template overrides. */
|
|
206
|
-
slot = input.required(
|
|
206
|
+
slot = input.required(/* @ts-ignore */
|
|
207
|
+
...(ngDevMode ? [{ debugName: "slot" }] : /* istanbul ignore next */ []));
|
|
207
208
|
/** @internal */
|
|
208
209
|
templateRef = inject((TemplateRef));
|
|
209
210
|
/** @internal */
|
|
210
211
|
static ngTemplateContextGuard(_dir, _ctx) {
|
|
211
212
|
return true;
|
|
212
213
|
}
|
|
213
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
214
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
214
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PaginatorLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
215
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.7", type: PaginatorLabelDirective, isStandalone: true, selector: "ng-template[twPaginatorLabel]", inputs: { slot: { classPropertyName: "slot", publicName: "slot", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
215
216
|
}
|
|
216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
217
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PaginatorLabelDirective, decorators: [{
|
|
217
218
|
type: Directive,
|
|
218
219
|
args: [{ selector: 'ng-template[twPaginatorLabel]' }]
|
|
219
220
|
}], propDecorators: { slot: [{ type: i0.Input, args: [{ isSignal: true, alias: "slot", required: true }] }] } });
|
|
@@ -228,10 +229,10 @@ class PaginatorEmptyDirective {
|
|
|
228
229
|
static ngTemplateContextGuard(_dir, _ctx) {
|
|
229
230
|
return true;
|
|
230
231
|
}
|
|
231
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
232
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
232
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PaginatorEmptyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
233
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: PaginatorEmptyDirective, isStandalone: true, selector: "ng-template[twPaginatorEmpty]", ngImport: i0 });
|
|
233
234
|
}
|
|
234
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PaginatorEmptyDirective, decorators: [{
|
|
235
236
|
type: Directive,
|
|
236
237
|
args: [{ selector: 'ng-template[twPaginatorEmpty]' }]
|
|
237
238
|
}] });
|
|
@@ -246,10 +247,10 @@ class PaginatorPageSizeSelectorDirective {
|
|
|
246
247
|
static ngTemplateContextGuard(_dir, _ctx) {
|
|
247
248
|
return true;
|
|
248
249
|
}
|
|
249
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
250
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
250
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PaginatorPageSizeSelectorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
251
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: PaginatorPageSizeSelectorDirective, isStandalone: true, selector: "ng-template[twPaginatorPageSizeSelector]", ngImport: i0 });
|
|
251
252
|
}
|
|
252
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
253
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PaginatorPageSizeSelectorDirective, decorators: [{
|
|
253
254
|
type: Directive,
|
|
254
255
|
args: [{ selector: 'ng-template[twPaginatorPageSizeSelector]' }]
|
|
255
256
|
}] });
|
|
@@ -260,10 +261,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
260
261
|
* Applied via attribute selector on the existing `data-tw-paginator-focusable`
|
|
261
262
|
* marker so the spec's button queries continue to match.
|
|
262
263
|
*/
|
|
264
|
+
// Selector deliberately matches the existing `data-tw-paginator-focusable`
|
|
265
|
+
// data-attribute marker emitted in the template; camelCasing would break the
|
|
266
|
+
// spec's button queries. See the JSDoc above this declaration.
|
|
263
267
|
class PaginatorFocusableDirective {
|
|
264
268
|
elementRef = inject((ElementRef));
|
|
265
269
|
/** When true, the element is skipped by `FocusKeyManager` roving focus. */
|
|
266
|
-
isDisabled = input(false,
|
|
270
|
+
isDisabled = input(false, /* @ts-ignore */
|
|
271
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
267
272
|
focus() {
|
|
268
273
|
this.elementRef.nativeElement.focus();
|
|
269
274
|
}
|
|
@@ -275,12 +280,13 @@ class PaginatorFocusableDirective {
|
|
|
275
280
|
get disabled() {
|
|
276
281
|
return this.isDisabled();
|
|
277
282
|
}
|
|
278
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
279
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
283
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PaginatorFocusableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
284
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.7", type: PaginatorFocusableDirective, isStandalone: true, selector: "[data-tw-paginator-focusable]", inputs: { isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
280
285
|
}
|
|
281
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
286
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PaginatorFocusableDirective, decorators: [{
|
|
282
287
|
type: Directive,
|
|
283
288
|
args: [{
|
|
289
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
284
290
|
selector: '[data-tw-paginator-focusable]',
|
|
285
291
|
}]
|
|
286
292
|
}], propDecorators: { isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }] } });
|
|
@@ -289,49 +295,68 @@ let nextPaginatorId = 0;
|
|
|
289
295
|
class PaginatorComponent {
|
|
290
296
|
// ── Inputs ──
|
|
291
297
|
/** Total number of items across all pages. Defaults to `0`. */
|
|
292
|
-
totalItems = input(0,
|
|
298
|
+
totalItems = input(0, /* @ts-ignore */
|
|
299
|
+
...(ngDevMode ? [{ debugName: "totalItems" }] : /* istanbul ignore next */ []));
|
|
293
300
|
/** Items per page. Two-way bindable via `[(pageSize)]`. Defaults to `10`. */
|
|
294
|
-
pageSize = model(10,
|
|
301
|
+
pageSize = model(10, /* @ts-ignore */
|
|
302
|
+
...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
295
303
|
/** 1-based current page. Two-way bindable via `[(page)]`. Clamped internally. Defaults to `1`. */
|
|
296
|
-
page = model(1,
|
|
304
|
+
page = model(1, /* @ts-ignore */
|
|
305
|
+
...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
|
|
297
306
|
/** Rendering type. Defaults to `'numbered'`. */
|
|
298
|
-
type = input('numbered',
|
|
307
|
+
type = input('numbered', /* @ts-ignore */
|
|
308
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
299
309
|
/** Layout density. Defaults to `'compact'`. */
|
|
300
|
-
layout = input('compact',
|
|
310
|
+
layout = input('compact', /* @ts-ignore */
|
|
311
|
+
...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
301
312
|
/** Controls padding, font size, and icon size. Defaults to `'md'`. */
|
|
302
|
-
size = input('md',
|
|
313
|
+
size = input('md', /* @ts-ignore */
|
|
314
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
303
315
|
/** Semantic color used for the active page indicator. Defaults to `'primary'`. */
|
|
304
|
-
color = input('primary',
|
|
316
|
+
color = input('primary', /* @ts-ignore */
|
|
317
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
305
318
|
/** How many sibling pages to show on each side of the current page. Defaults to `1`. */
|
|
306
|
-
siblingCount = input(1,
|
|
319
|
+
siblingCount = input(1, /* @ts-ignore */
|
|
320
|
+
...(ngDevMode ? [{ debugName: "siblingCount" }] : /* istanbul ignore next */ []));
|
|
307
321
|
/** How many pages to always show at the start and end boundaries. Defaults to `1`. */
|
|
308
|
-
boundaryCount = input(1,
|
|
322
|
+
boundaryCount = input(1, /* @ts-ignore */
|
|
323
|
+
...(ngDevMode ? [{ debugName: "boundaryCount" }] : /* istanbul ignore next */ []));
|
|
309
324
|
/** When true, renders jump-to-first and jump-to-last buttons. Defaults to `true`. */
|
|
310
325
|
// TRUE-default: first/last jumps are the standard pagination affordance for
|
|
311
326
|
// any list large enough to need a paginator; opt-out is for compact paginators.
|
|
312
|
-
showFirstLastButtons = input(true,
|
|
327
|
+
showFirstLastButtons = input(true, /* @ts-ignore */
|
|
328
|
+
...(ngDevMode ? [{ debugName: "showFirstLastButtons" }] : /* istanbul ignore next */ []));
|
|
313
329
|
/** When true, renders the page-size selector region. Defaults to `false`. */
|
|
314
|
-
showPageSizeSelector = input(false,
|
|
330
|
+
showPageSizeSelector = input(false, /* @ts-ignore */
|
|
331
|
+
...(ngDevMode ? [{ debugName: "showPageSizeSelector" }] : /* istanbul ignore next */ []));
|
|
315
332
|
/** Options for the default page-size selector. Ignored when `*twPaginatorPageSizeSelector` is projected. Defaults to `[10, 25, 50, 100]`. */
|
|
316
|
-
pageSizeOptions = input([10, 25, 50, 100],
|
|
333
|
+
pageSizeOptions = input([10, 25, 50, 100], /* @ts-ignore */
|
|
334
|
+
...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : /* istanbul ignore next */ []));
|
|
317
335
|
/** When true, renders the page-info text region. Defaults to `true`. */
|
|
318
336
|
// TRUE-default: showing "X–Y of Z" is the expected pagination context; opt-out
|
|
319
337
|
// is for ultra-compact paginators that fit in tight UI.
|
|
320
|
-
showPageInfo = input(true,
|
|
338
|
+
showPageInfo = input(true, /* @ts-ignore */
|
|
339
|
+
...(ngDevMode ? [{ debugName: "showPageInfo" }] : /* istanbul ignore next */ []));
|
|
321
340
|
/** When true, renders nothing when `totalItems === 0`. Defaults to `true`. */
|
|
322
341
|
// TRUE-default: hiding the paginator on empty data is expected UX; opt-out is
|
|
323
342
|
// for layouts that need to reserve the paginator's vertical space.
|
|
324
|
-
hideOnEmpty = input(true,
|
|
343
|
+
hideOnEmpty = input(true, /* @ts-ignore */
|
|
344
|
+
...(ngDevMode ? [{ debugName: "hideOnEmpty" }] : /* istanbul ignore next */ []));
|
|
325
345
|
/** When true, renders nothing when `totalPages <= 1`. Defaults to `false`. */
|
|
326
|
-
hideOnSinglePage = input(false,
|
|
346
|
+
hideOnSinglePage = input(false, /* @ts-ignore */
|
|
347
|
+
...(ngDevMode ? [{ debugName: "hideOnSinglePage" }] : /* istanbul ignore next */ []));
|
|
327
348
|
/** Responsive collapse mode. Defaults to `'auto'`. */
|
|
328
|
-
responsive = input('auto',
|
|
349
|
+
responsive = input('auto', /* @ts-ignore */
|
|
350
|
+
...(ngDevMode ? [{ debugName: "responsive" }] : /* istanbul ignore next */ []));
|
|
329
351
|
/** When true, every button is disabled. Defaults to `false`. */
|
|
330
|
-
disabled = input(false,
|
|
352
|
+
disabled = input(false, /* @ts-ignore */
|
|
353
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
331
354
|
/** Partial string labels object for i18n. Unset keys fall back to English defaults. Defaults to `{}`. */
|
|
332
|
-
labels = input({},
|
|
355
|
+
labels = input({}, /* @ts-ignore */
|
|
356
|
+
...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
333
357
|
/** When provided, buttons render as anchor links using the returned `href`. Defaults to `undefined` (renders as buttons). */
|
|
334
|
-
linkFactory = input(undefined,
|
|
358
|
+
linkFactory = input(undefined, /* @ts-ignore */
|
|
359
|
+
...(ngDevMode ? [{ debugName: "linkFactory" }] : /* istanbul ignore next */ []));
|
|
335
360
|
/** Overrides `labels.ariaLabel` for the root `<nav>` element. */
|
|
336
361
|
customAriaLabel = input(undefined, { ...(ngDevMode ? { debugName: "customAriaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
337
362
|
// ── Outputs ──
|
|
@@ -339,63 +364,81 @@ class PaginatorComponent {
|
|
|
339
364
|
paginated = output();
|
|
340
365
|
// ── Projected templates ──
|
|
341
366
|
/** @internal */
|
|
342
|
-
labelDirectives = contentChildren(PaginatorLabelDirective,
|
|
367
|
+
labelDirectives = contentChildren(PaginatorLabelDirective, /* @ts-ignore */
|
|
368
|
+
...(ngDevMode ? [{ debugName: "labelDirectives" }] : /* istanbul ignore next */ []));
|
|
343
369
|
/** @internal */
|
|
344
|
-
emptyDirective = contentChild(PaginatorEmptyDirective,
|
|
370
|
+
emptyDirective = contentChild(PaginatorEmptyDirective, /* @ts-ignore */
|
|
371
|
+
...(ngDevMode ? [{ debugName: "emptyDirective" }] : /* istanbul ignore next */ []));
|
|
345
372
|
/** @internal */
|
|
346
|
-
pageSizeSelectorDirective = contentChild(PaginatorPageSizeSelectorDirective,
|
|
373
|
+
pageSizeSelectorDirective = contentChild(PaginatorPageSizeSelectorDirective, /* @ts-ignore */
|
|
374
|
+
...(ngDevMode ? [{ debugName: "pageSizeSelectorDirective" }] : /* istanbul ignore next */ []));
|
|
347
375
|
// ── Injected services ──
|
|
348
376
|
_liveAnnouncer = inject(LiveAnnouncer);
|
|
349
377
|
_elementRef = inject((ElementRef));
|
|
350
378
|
// ── View children ──
|
|
351
379
|
/** @internal All nav-group focusables (first/prev/page/next/last) for `FocusKeyManager`. */
|
|
352
|
-
focusableItems = viewChildren(PaginatorFocusableDirective,
|
|
380
|
+
focusableItems = viewChildren(PaginatorFocusableDirective, /* @ts-ignore */
|
|
381
|
+
...(ngDevMode ? [{ debugName: "focusableItems" }] : /* istanbul ignore next */ []));
|
|
353
382
|
// ── IDs ──
|
|
354
383
|
_componentId = `tw-paginator-${nextPaginatorId++}`;
|
|
355
384
|
/** @internal */
|
|
356
385
|
pageSizeSelectId = `${this._componentId}-size`;
|
|
357
386
|
// ── Derived state ──
|
|
358
387
|
/** @internal Effective page size, coerced to at least 1. */
|
|
359
|
-
effectivePageSize = computed(() => Math.max(1, this.pageSize()),
|
|
388
|
+
effectivePageSize = computed(() => Math.max(1, this.pageSize()), /* @ts-ignore */
|
|
389
|
+
...(ngDevMode ? [{ debugName: "effectivePageSize" }] : /* istanbul ignore next */ []));
|
|
360
390
|
/** @internal Total number of pages; always ≥ 1 to keep clamping math well-defined. */
|
|
361
391
|
totalPages = computed(() => {
|
|
362
392
|
const total = this.totalItems();
|
|
363
393
|
if (total <= 0)
|
|
364
394
|
return 1;
|
|
365
395
|
return Math.max(1, Math.ceil(total / this.effectivePageSize()));
|
|
366
|
-
},
|
|
396
|
+
}, /* @ts-ignore */
|
|
397
|
+
...(ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []));
|
|
367
398
|
/** @internal Current page clamped into `[1, totalPages]`. */
|
|
368
|
-
clampedPage = computed(() => Math.min(Math.max(1, this.page()), this.totalPages()),
|
|
399
|
+
clampedPage = computed(() => Math.min(Math.max(1, this.page()), this.totalPages()), /* @ts-ignore */
|
|
400
|
+
...(ngDevMode ? [{ debugName: "clampedPage" }] : /* istanbul ignore next */ []));
|
|
369
401
|
/** @internal 1-based start item index on the current page. `0` when empty. */
|
|
370
402
|
startItem = computed(() => {
|
|
371
403
|
if (this.totalItems() <= 0)
|
|
372
404
|
return 0;
|
|
373
405
|
return (this.clampedPage() - 1) * this.effectivePageSize() + 1;
|
|
374
|
-
},
|
|
406
|
+
}, /* @ts-ignore */
|
|
407
|
+
...(ngDevMode ? [{ debugName: "startItem" }] : /* istanbul ignore next */ []));
|
|
375
408
|
/** @internal 1-based end item index on the current page. `0` when empty. */
|
|
376
409
|
endItem = computed(() => {
|
|
377
410
|
if (this.totalItems() <= 0)
|
|
378
411
|
return 0;
|
|
379
412
|
return Math.min(this.clampedPage() * this.effectivePageSize(), this.totalItems());
|
|
380
|
-
},
|
|
413
|
+
}, /* @ts-ignore */
|
|
414
|
+
...(ngDevMode ? [{ debugName: "endItem" }] : /* istanbul ignore next */ []));
|
|
381
415
|
/** @internal Visible page range for the numbered type. */
|
|
382
|
-
range = computed(() => buildPaginationRange(this.clampedPage(), this.totalPages(), this.siblingCount(), this.boundaryCount()),
|
|
416
|
+
range = computed(() => buildPaginationRange(this.clampedPage(), this.totalPages(), this.siblingCount(), this.boundaryCount()), /* @ts-ignore */
|
|
417
|
+
...(ngDevMode ? [{ debugName: "range" }] : /* istanbul ignore next */ []));
|
|
383
418
|
/** @internal Merged labels. */
|
|
384
419
|
resolvedLabels = computed(() => ({
|
|
385
420
|
...DEFAULT_LABELS,
|
|
386
421
|
...this.labels(),
|
|
387
|
-
}),
|
|
422
|
+
}), /* @ts-ignore */
|
|
423
|
+
...(ngDevMode ? [{ debugName: "resolvedLabels" }] : /* istanbul ignore next */ []));
|
|
388
424
|
/** @internal Resolved aria-label for the root. */
|
|
389
|
-
resolvedAriaLabel = computed(() => this.customAriaLabel() ?? this.resolvedLabels().ariaLabel,
|
|
425
|
+
resolvedAriaLabel = computed(() => this.customAriaLabel() ?? this.resolvedLabels().ariaLabel, /* @ts-ignore */
|
|
426
|
+
...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
390
427
|
/** @internal `container-name` for the CSS container query (set only when responsive="auto"). */
|
|
391
|
-
containerName = computed(() => this.responsive() === 'auto' ? 'paginator' : null,
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
428
|
+
containerName = computed(() => this.responsive() === 'auto' ? 'paginator' : null, /* @ts-ignore */
|
|
429
|
+
...(ngDevMode ? [{ debugName: "containerName" }] : /* istanbul ignore next */ []));
|
|
430
|
+
isEmpty = computed(() => this.totalItems() <= 0, /* @ts-ignore */
|
|
431
|
+
...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
432
|
+
isAtFirstPage = computed(() => this.clampedPage() <= 1, /* @ts-ignore */
|
|
433
|
+
...(ngDevMode ? [{ debugName: "isAtFirstPage" }] : /* istanbul ignore next */ []));
|
|
434
|
+
isAtLastPage = computed(() => this.clampedPage() >= this.totalPages(), /* @ts-ignore */
|
|
435
|
+
...(ngDevMode ? [{ debugName: "isAtLastPage" }] : /* istanbul ignore next */ []));
|
|
395
436
|
/** @internal Target page for the Previous button (clamped to `[1, totalPages]`). */
|
|
396
|
-
previousTarget = computed(() => Math.max(1, this.clampedPage() - 1),
|
|
437
|
+
previousTarget = computed(() => Math.max(1, this.clampedPage() - 1), /* @ts-ignore */
|
|
438
|
+
...(ngDevMode ? [{ debugName: "previousTarget" }] : /* istanbul ignore next */ []));
|
|
397
439
|
/** @internal Target page for the Next button (clamped to `[1, totalPages]`). */
|
|
398
|
-
nextTarget = computed(() => Math.min(this.totalPages(), this.clampedPage() + 1),
|
|
440
|
+
nextTarget = computed(() => Math.min(this.totalPages(), this.clampedPage() + 1), /* @ts-ignore */
|
|
441
|
+
...(ngDevMode ? [{ debugName: "nextTarget" }] : /* istanbul ignore next */ []));
|
|
399
442
|
/** @internal Whether the component should render at all. */
|
|
400
443
|
shouldRender = computed(() => {
|
|
401
444
|
if (this.isEmpty() && this.hideOnEmpty())
|
|
@@ -403,7 +446,8 @@ class PaginatorComponent {
|
|
|
403
446
|
if (this.hideOnSinglePage() && this.totalPages() <= 1 && !this.isEmpty())
|
|
404
447
|
return false;
|
|
405
448
|
return true;
|
|
406
|
-
},
|
|
449
|
+
}, /* @ts-ignore */
|
|
450
|
+
...(ngDevMode ? [{ debugName: "shouldRender" }] : /* istanbul ignore next */ []));
|
|
407
451
|
// ── Variant class computation ──
|
|
408
452
|
_variantResult = computed(() => paginatorVariants({
|
|
409
453
|
size: this.size(),
|
|
@@ -411,19 +455,32 @@ class PaginatorComponent {
|
|
|
411
455
|
type: this.type(),
|
|
412
456
|
responsive: this.responsive(),
|
|
413
457
|
disabled: this.disabled(),
|
|
414
|
-
}),
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
458
|
+
}), /* @ts-ignore */
|
|
459
|
+
...(ngDevMode ? [{ debugName: "_variantResult" }] : /* istanbul ignore next */ []));
|
|
460
|
+
rootClasses = computed(() => this._variantResult().root(), /* @ts-ignore */
|
|
461
|
+
...(ngDevMode ? [{ debugName: "rootClasses" }] : /* istanbul ignore next */ []));
|
|
462
|
+
innerClasses = computed(() => this._variantResult().inner(), /* @ts-ignore */
|
|
463
|
+
...(ngDevMode ? [{ debugName: "innerClasses" }] : /* istanbul ignore next */ []));
|
|
464
|
+
pageSizeGroupClasses = computed(() => this._variantResult().pageSizeGroup(), /* @ts-ignore */
|
|
465
|
+
...(ngDevMode ? [{ debugName: "pageSizeGroupClasses" }] : /* istanbul ignore next */ []));
|
|
466
|
+
pageSizeLabelClasses = computed(() => this._variantResult().pageSizeLabel(), /* @ts-ignore */
|
|
467
|
+
...(ngDevMode ? [{ debugName: "pageSizeLabelClasses" }] : /* istanbul ignore next */ []));
|
|
468
|
+
pageSizeSelectClasses = computed(() => this._variantResult().pageSizeSelect(), /* @ts-ignore */
|
|
469
|
+
...(ngDevMode ? [{ debugName: "pageSizeSelectClasses" }] : /* istanbul ignore next */ []));
|
|
470
|
+
pageInfoClasses = computed(() => this._variantResult().pageInfo(), /* @ts-ignore */
|
|
471
|
+
...(ngDevMode ? [{ debugName: "pageInfoClasses" }] : /* istanbul ignore next */ []));
|
|
472
|
+
navGroupClasses = computed(() => this._variantResult().navGroup(), /* @ts-ignore */
|
|
473
|
+
...(ngDevMode ? [{ debugName: "navGroupClasses" }] : /* istanbul ignore next */ []));
|
|
474
|
+
pageListClasses = computed(() => this._variantResult().pageList(), /* @ts-ignore */
|
|
475
|
+
...(ngDevMode ? [{ debugName: "pageListClasses" }] : /* istanbul ignore next */ []));
|
|
476
|
+
navButtonClasses = computed(() => this._variantResult().navButton(), /* @ts-ignore */
|
|
477
|
+
...(ngDevMode ? [{ debugName: "navButtonClasses" }] : /* istanbul ignore next */ []));
|
|
478
|
+
ellipsisClasses = computed(() => this._variantResult().ellipsis(), /* @ts-ignore */
|
|
479
|
+
...(ngDevMode ? [{ debugName: "ellipsisClasses" }] : /* istanbul ignore next */ []));
|
|
480
|
+
emptyStateClasses = computed(() => this._variantResult().emptyState(), /* @ts-ignore */
|
|
481
|
+
...(ngDevMode ? [{ debugName: "emptyStateClasses" }] : /* istanbul ignore next */ []));
|
|
482
|
+
iconClasses = computed(() => this._variantResult().icon(), /* @ts-ignore */
|
|
483
|
+
...(ngDevMode ? [{ debugName: "iconClasses" }] : /* istanbul ignore next */ []));
|
|
427
484
|
/** @internal Applies active-color classes to the current page button. */
|
|
428
485
|
pageButtonClasses(active) {
|
|
429
486
|
const base = this._variantResult().pageButton();
|
|
@@ -449,7 +506,8 @@ class PaginatorComponent {
|
|
|
449
506
|
pageSize: this.effectivePageSize(),
|
|
450
507
|
disabled: this.disabled(),
|
|
451
508
|
},
|
|
452
|
-
}),
|
|
509
|
+
}), /* @ts-ignore */
|
|
510
|
+
...(ngDevMode ? [{ debugName: "labelContext" }] : /* istanbul ignore next */ []));
|
|
453
511
|
/** @internal */
|
|
454
512
|
pageSizeContext = computed(() => ({
|
|
455
513
|
$implicit: {
|
|
@@ -457,7 +515,8 @@ class PaginatorComponent {
|
|
|
457
515
|
options: this.pageSizeOptions(),
|
|
458
516
|
setPageSize: (n) => this._setPageSize(n),
|
|
459
517
|
},
|
|
460
|
-
}),
|
|
518
|
+
}), /* @ts-ignore */
|
|
519
|
+
...(ngDevMode ? [{ debugName: "pageSizeContext" }] : /* istanbul ignore next */ []));
|
|
461
520
|
// ── Rendered strings ──
|
|
462
521
|
/** @internal Default page-info string (type-aware). */
|
|
463
522
|
formattedPageInfo = computed(() => {
|
|
@@ -472,7 +531,8 @@ class PaginatorComponent {
|
|
|
472
531
|
});
|
|
473
532
|
}
|
|
474
533
|
return `${labels.pageInfo} ${this.clampedPage()}${labels.pageInfoSeparator}${this.totalPages()}`;
|
|
475
|
-
},
|
|
534
|
+
}, /* @ts-ignore */
|
|
535
|
+
...(ngDevMode ? [{ debugName: "formattedPageInfo" }] : /* istanbul ignore next */ []));
|
|
476
536
|
/** @internal ARIA label for a numbered page button. */
|
|
477
537
|
formatPageButtonLabel(page) {
|
|
478
538
|
return formatLabel(this.resolvedLabels().pageButtonAriaLabel, { page });
|
|
@@ -507,6 +567,16 @@ class PaginatorComponent {
|
|
|
507
567
|
});
|
|
508
568
|
// Emit pageChange whenever page or pageSize changes (after initial render).
|
|
509
569
|
// When an out-of-range page is detected, clamp and emit with source 'programmatic'.
|
|
570
|
+
//
|
|
571
|
+
// DOCUMENTED no-write-in-effect exception (see CLAUDE.md). This effect reads
|
|
572
|
+
// `page()` *and* writes `page.set(clamped)` — an intrinsic cycle, because the
|
|
573
|
+
// clamp must fire both when `totalPages` shrinks AND when the consumer assigns
|
|
574
|
+
// an out-of-range page (so `page` must stay a tracked dependency). The cycle is
|
|
575
|
+
// bounded by the `clamped !== newPage` guard: the write re-triggers the effect
|
|
576
|
+
// exactly once, the re-run sees an in-range value, and it settles. It never
|
|
577
|
+
// loops/freezes. The `untracked()` wrapper does NOT break this cycle (page is
|
|
578
|
+
// tracked above); its job is to keep the signal reads inside `_emitChange` /
|
|
579
|
+
// `_announce` from registering as effect dependencies.
|
|
510
580
|
effect(() => {
|
|
511
581
|
const newPage = this.page();
|
|
512
582
|
const newSize = this.pageSize();
|
|
@@ -670,17 +740,17 @@ class PaginatorComponent {
|
|
|
670
740
|
console.warn('[tw-paginator] showPageSizeSelector is true but pageSizeOptions is empty — selector will not render.');
|
|
671
741
|
}
|
|
672
742
|
}
|
|
673
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
674
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", 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 -->\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 });
|
|
743
|
+
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 });
|
|
675
745
|
}
|
|
676
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
677
747
|
type: Component,
|
|
678
748
|
args: [{ selector: 'tw-paginator', exportAs: 'twPaginator', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, PaginatorFocusableDirective], host: {
|
|
679
749
|
'[attr.role]': 'shouldRender() ? "navigation" : null',
|
|
680
750
|
'[class]': 'rootClasses()',
|
|
681
751
|
'[attr.aria-label]': 'shouldRender() ? resolvedAriaLabel() : null',
|
|
682
752
|
'[style.container-name]': 'containerName()',
|
|
683
|
-
}, 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 -->\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" }]
|
|
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" }]
|
|
684
754
|
}], 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 }] }] } });
|
|
685
755
|
|
|
686
756
|
/**
|