yukit-web 0.0.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.
Files changed (196) hide show
  1. package/.npm/_logs/2026-08-20T08_40_55_706Z-debug-0.log +38 -0
  2. package/.npm/_logs/2026-08-20T08_40_56_280Z-debug-0.log +14 -0
  3. package/README.md +1465 -0
  4. package/fesm2022/yukit-web-helm-accordion.mjs +141 -0
  5. package/fesm2022/yukit-web-helm-accordion.mjs.map +1 -0
  6. package/fesm2022/yukit-web-helm-alert-dialog.mjs +250 -0
  7. package/fesm2022/yukit-web-helm-alert-dialog.mjs.map +1 -0
  8. package/fesm2022/yukit-web-helm-alert.mjs +94 -0
  9. package/fesm2022/yukit-web-helm-alert.mjs.map +1 -0
  10. package/fesm2022/yukit-web-helm-aspect-ratio.mjs +47 -0
  11. package/fesm2022/yukit-web-helm-aspect-ratio.mjs.map +1 -0
  12. package/fesm2022/yukit-web-helm-attachment.mjs +211 -0
  13. package/fesm2022/yukit-web-helm-attachment.mjs.map +1 -0
  14. package/fesm2022/yukit-web-helm-autocomplete.mjs +361 -0
  15. package/fesm2022/yukit-web-helm-autocomplete.mjs.map +1 -0
  16. package/fesm2022/yukit-web-helm-avatar.mjs +152 -0
  17. package/fesm2022/yukit-web-helm-avatar.mjs.map +1 -0
  18. package/fesm2022/yukit-web-helm-badge.mjs +47 -0
  19. package/fesm2022/yukit-web-helm-badge.mjs.map +1 -0
  20. package/fesm2022/yukit-web-helm-breadcrumb.mjs +196 -0
  21. package/fesm2022/yukit-web-helm-breadcrumb.mjs.map +1 -0
  22. package/fesm2022/yukit-web-helm-bubble.mjs +121 -0
  23. package/fesm2022/yukit-web-helm-bubble.mjs.map +1 -0
  24. package/fesm2022/yukit-web-helm-button-group.mjs +86 -0
  25. package/fesm2022/yukit-web-helm-button-group.mjs.map +1 -0
  26. package/fesm2022/yukit-web-helm-button.mjs +77 -0
  27. package/fesm2022/yukit-web-helm-button.mjs.map +1 -0
  28. package/fesm2022/yukit-web-helm-calendar.mjs +937 -0
  29. package/fesm2022/yukit-web-helm-calendar.mjs.map +1 -0
  30. package/fesm2022/yukit-web-helm-card.mjs +141 -0
  31. package/fesm2022/yukit-web-helm-card.mjs.map +1 -0
  32. package/fesm2022/yukit-web-helm-carousel.mjs +270 -0
  33. package/fesm2022/yukit-web-helm-carousel.mjs.map +1 -0
  34. package/fesm2022/yukit-web-helm-checkbox.mjs +147 -0
  35. package/fesm2022/yukit-web-helm-checkbox.mjs.map +1 -0
  36. package/fesm2022/yukit-web-helm-collapsible.mjs +62 -0
  37. package/fesm2022/yukit-web-helm-collapsible.mjs.map +1 -0
  38. package/fesm2022/yukit-web-helm-combobox.mjs +624 -0
  39. package/fesm2022/yukit-web-helm-combobox.mjs.map +1 -0
  40. package/fesm2022/yukit-web-helm-command.mjs +315 -0
  41. package/fesm2022/yukit-web-helm-command.mjs.map +1 -0
  42. package/fesm2022/yukit-web-helm-context-menu.mjs +71 -0
  43. package/fesm2022/yukit-web-helm-context-menu.mjs.map +1 -0
  44. package/fesm2022/yukit-web-helm-date-picker.mjs +1517 -0
  45. package/fesm2022/yukit-web-helm-date-picker.mjs.map +1 -0
  46. package/fesm2022/yukit-web-helm-dialog.mjs +271 -0
  47. package/fesm2022/yukit-web-helm-dialog.mjs.map +1 -0
  48. package/fesm2022/yukit-web-helm-drawer.mjs +233 -0
  49. package/fesm2022/yukit-web-helm-drawer.mjs.map +1 -0
  50. package/fesm2022/yukit-web-helm-dropdown-menu.mjs +508 -0
  51. package/fesm2022/yukit-web-helm-dropdown-menu.mjs.map +1 -0
  52. package/fesm2022/yukit-web-helm-empty.mjs +125 -0
  53. package/fesm2022/yukit-web-helm-empty.mjs.map +1 -0
  54. package/fesm2022/yukit-web-helm-field.mjs +325 -0
  55. package/fesm2022/yukit-web-helm-field.mjs.map +1 -0
  56. package/fesm2022/yukit-web-helm-hover-card.mjs +102 -0
  57. package/fesm2022/yukit-web-helm-hover-card.mjs.map +1 -0
  58. package/fesm2022/yukit-web-helm-input-group.mjs +171 -0
  59. package/fesm2022/yukit-web-helm-input-group.mjs.map +1 -0
  60. package/fesm2022/yukit-web-helm-input-otp.mjs +127 -0
  61. package/fesm2022/yukit-web-helm-input-otp.mjs.map +1 -0
  62. package/fesm2022/yukit-web-helm-input.mjs +32 -0
  63. package/fesm2022/yukit-web-helm-input.mjs.map +1 -0
  64. package/fesm2022/yukit-web-helm-item.mjs +242 -0
  65. package/fesm2022/yukit-web-helm-item.mjs.map +1 -0
  66. package/fesm2022/yukit-web-helm-kbd.mjs +46 -0
  67. package/fesm2022/yukit-web-helm-kbd.mjs.map +1 -0
  68. package/fesm2022/yukit-web-helm-label.mjs +30 -0
  69. package/fesm2022/yukit-web-helm-label.mjs.map +1 -0
  70. package/fesm2022/yukit-web-helm-marker.mjs +77 -0
  71. package/fesm2022/yukit-web-helm-marker.mjs.map +1 -0
  72. package/fesm2022/yukit-web-helm-menubar.mjs +90 -0
  73. package/fesm2022/yukit-web-helm-menubar.mjs.map +1 -0
  74. package/fesm2022/yukit-web-helm-message.mjs +115 -0
  75. package/fesm2022/yukit-web-helm-message.mjs.map +1 -0
  76. package/fesm2022/yukit-web-helm-native-select.mjs +180 -0
  77. package/fesm2022/yukit-web-helm-native-select.mjs.map +1 -0
  78. package/fesm2022/yukit-web-helm-navigation-menu.mjs +173 -0
  79. package/fesm2022/yukit-web-helm-navigation-menu.mjs.map +1 -0
  80. package/fesm2022/yukit-web-helm-pagination.mjs +745 -0
  81. package/fesm2022/yukit-web-helm-pagination.mjs.map +1 -0
  82. package/fesm2022/yukit-web-helm-popover.mjs +136 -0
  83. package/fesm2022/yukit-web-helm-popover.mjs.map +1 -0
  84. package/fesm2022/yukit-web-helm-progress.mjs +60 -0
  85. package/fesm2022/yukit-web-helm-progress.mjs.map +1 -0
  86. package/fesm2022/yukit-web-helm-radio-group.mjs +185 -0
  87. package/fesm2022/yukit-web-helm-radio-group.mjs.map +1 -0
  88. package/fesm2022/yukit-web-helm-resizable.mjs +98 -0
  89. package/fesm2022/yukit-web-helm-resizable.mjs.map +1 -0
  90. package/fesm2022/yukit-web-helm-scroll-area.mjs +36 -0
  91. package/fesm2022/yukit-web-helm-scroll-area.mjs.map +1 -0
  92. package/fesm2022/yukit-web-helm-select.mjs +412 -0
  93. package/fesm2022/yukit-web-helm-select.mjs.map +1 -0
  94. package/fesm2022/yukit-web-helm-separator.mjs +33 -0
  95. package/fesm2022/yukit-web-helm-separator.mjs.map +1 -0
  96. package/fesm2022/yukit-web-helm-sheet.mjs +254 -0
  97. package/fesm2022/yukit-web-helm-sheet.mjs.map +1 -0
  98. package/fesm2022/yukit-web-helm-sidebar.mjs +857 -0
  99. package/fesm2022/yukit-web-helm-sidebar.mjs.map +1 -0
  100. package/fesm2022/yukit-web-helm-skeleton.mjs +29 -0
  101. package/fesm2022/yukit-web-helm-skeleton.mjs.map +1 -0
  102. package/fesm2022/yukit-web-helm-slider.mjs +123 -0
  103. package/fesm2022/yukit-web-helm-slider.mjs.map +1 -0
  104. package/fesm2022/yukit-web-helm-sonner.mjs +126 -0
  105. package/fesm2022/yukit-web-helm-sonner.mjs.map +1 -0
  106. package/fesm2022/yukit-web-helm-spinner.mjs +48 -0
  107. package/fesm2022/yukit-web-helm-spinner.mjs.map +1 -0
  108. package/fesm2022/yukit-web-helm-switch.mjs +126 -0
  109. package/fesm2022/yukit-web-helm-switch.mjs.map +1 -0
  110. package/fesm2022/yukit-web-helm-table.mjs +180 -0
  111. package/fesm2022/yukit-web-helm-table.mjs.map +1 -0
  112. package/fesm2022/yukit-web-helm-tabs.mjs +251 -0
  113. package/fesm2022/yukit-web-helm-tabs.mjs.map +1 -0
  114. package/fesm2022/yukit-web-helm-textarea.mjs +32 -0
  115. package/fesm2022/yukit-web-helm-textarea.mjs.map +1 -0
  116. package/fesm2022/yukit-web-helm-toggle-group.mjs +95 -0
  117. package/fesm2022/yukit-web-helm-toggle-group.mjs.map +1 -0
  118. package/fesm2022/yukit-web-helm-toggle.mjs +61 -0
  119. package/fesm2022/yukit-web-helm-toggle.mjs.map +1 -0
  120. package/fesm2022/yukit-web-helm-tooltip.mjs +57 -0
  121. package/fesm2022/yukit-web-helm-tooltip.mjs.map +1 -0
  122. package/fesm2022/yukit-web-helm-typography.mjs +205 -0
  123. package/fesm2022/yukit-web-helm-typography.mjs.map +1 -0
  124. package/fesm2022/yukit-web-helm-utils.mjs +272 -0
  125. package/fesm2022/yukit-web-helm-utils.mjs.map +1 -0
  126. package/fesm2022/yukit-web.mjs +3592 -0
  127. package/fesm2022/yukit-web.mjs.map +1 -0
  128. package/package.json +291 -0
  129. package/src/lib/theme/spartan-overwrites/accordion.css +4 -0
  130. package/src/lib/theme/theme.css +161 -0
  131. package/src/lib/theme/tokens/color.css +356 -0
  132. package/src/lib/theme/tokens/component-colors.css +167 -0
  133. package/src/lib/theme/tokens/radius.css +18 -0
  134. package/src/lib/theme/tokens/typography.css +201 -0
  135. package/types/yukit-web-helm-accordion.d.ts +32 -0
  136. package/types/yukit-web-helm-alert-dialog.d.ts +85 -0
  137. package/types/yukit-web-helm-alert.d.ts +37 -0
  138. package/types/yukit-web-helm-aspect-ratio.d.ts +16 -0
  139. package/types/yukit-web-helm-attachment.d.ts +80 -0
  140. package/types/yukit-web-helm-autocomplete.d.ts +91 -0
  141. package/types/yukit-web-helm-avatar.d.ts +45 -0
  142. package/types/yukit-web-helm-badge.d.ts +19 -0
  143. package/types/yukit-web-helm-breadcrumb.d.ts +52 -0
  144. package/types/yukit-web-helm-bubble.d.ts +46 -0
  145. package/types/yukit-web-helm-button-group.d.ts +25 -0
  146. package/types/yukit-web-helm-button.d.ts +33 -0
  147. package/types/yukit-web-helm-calendar.d.ts +89 -0
  148. package/types/yukit-web-helm-card.d.ts +49 -0
  149. package/types/yukit-web-helm-carousel.d.ts +79 -0
  150. package/types/yukit-web-helm-checkbox.d.ts +60 -0
  151. package/types/yukit-web-helm-collapsible.d.ts +22 -0
  152. package/types/yukit-web-helm-combobox.d.ts +150 -0
  153. package/types/yukit-web-helm-command.d.ts +84 -0
  154. package/types/yukit-web-helm-context-menu.d.ts +29 -0
  155. package/types/yukit-web-helm-date-picker.d.ts +574 -0
  156. package/types/yukit-web-helm-dialog.d.ts +90 -0
  157. package/types/yukit-web-helm-drawer.d.ts +71 -0
  158. package/types/yukit-web-helm-dropdown-menu.d.ts +171 -0
  159. package/types/yukit-web-helm-empty.d.ts +49 -0
  160. package/types/yukit-web-helm-field.d.ts +102 -0
  161. package/types/yukit-web-helm-hover-card.d.ts +31 -0
  162. package/types/yukit-web-helm-input-group.d.ts +47 -0
  163. package/types/yukit-web-helm-input-otp.d.ts +40 -0
  164. package/types/yukit-web-helm-input.d.ts +13 -0
  165. package/types/yukit-web-helm-item.d.ts +96 -0
  166. package/types/yukit-web-helm-kbd.d.ts +17 -0
  167. package/types/yukit-web-helm-label.d.ts +12 -0
  168. package/types/yukit-web-helm-marker.d.ts +31 -0
  169. package/types/yukit-web-helm-menubar.d.ts +35 -0
  170. package/types/yukit-web-helm-message.d.ts +44 -0
  171. package/types/yukit-web-helm-native-select.d.ts +65 -0
  172. package/types/yukit-web-helm-navigation-menu.d.ts +49 -0
  173. package/types/yukit-web-helm-pagination.d.ts +187 -0
  174. package/types/yukit-web-helm-popover.d.ts +49 -0
  175. package/types/yukit-web-helm-progress.d.ts +22 -0
  176. package/types/yukit-web-helm-radio-group.d.ts +66 -0
  177. package/types/yukit-web-helm-resizable.d.ts +27 -0
  178. package/types/yukit-web-helm-scroll-area.d.ts +11 -0
  179. package/types/yukit-web-helm-select.d.ts +114 -0
  180. package/types/yukit-web-helm-separator.d.ts +13 -0
  181. package/types/yukit-web-helm-sheet.d.ts +75 -0
  182. package/types/yukit-web-helm-sidebar.d.ts +232 -0
  183. package/types/yukit-web-helm-skeleton.d.ts +11 -0
  184. package/types/yukit-web-helm-slider.d.ts +14 -0
  185. package/types/yukit-web-helm-sonner.d.ts +52 -0
  186. package/types/yukit-web-helm-spinner.d.ts +18 -0
  187. package/types/yukit-web-helm-switch.d.ts +54 -0
  188. package/types/yukit-web-helm-table.d.ts +82 -0
  189. package/types/yukit-web-helm-tabs.d.ts +66 -0
  190. package/types/yukit-web-helm-textarea.d.ts +13 -0
  191. package/types/yukit-web-helm-toggle-group.d.ts +34 -0
  192. package/types/yukit-web-helm-toggle.d.ts +22 -0
  193. package/types/yukit-web-helm-tooltip.d.ts +17 -0
  194. package/types/yukit-web-helm-typography.d.ts +89 -0
  195. package/types/yukit-web-helm-utils.d.ts +44 -0
  196. package/types/yukit-web.d.ts +2426 -0
@@ -0,0 +1,745 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, Directive, ChangeDetectionStrategy, Component, booleanAttribute, computed, model, numberAttribute, untracked } from '@angular/core';
3
+ import * as i1$1 from 'yukit-web/helm/select';
4
+ import { HlmSelectImports } from 'yukit-web/helm/select';
5
+ import { classes, hlm } from 'yukit-web/helm/utils';
6
+ import { NgIcon, provideIcons } from '@ng-icons/core';
7
+ import { lucideEllipsis, lucideChevronRight, lucideChevronLeft } from '@ng-icons/lucide';
8
+ import * as i1 from '@angular/router';
9
+ import { RouterLink } from '@angular/router';
10
+ import { buttonVariants } from 'yukit-web/helm/button';
11
+
12
+ class HlmPagination {
13
+ constructor() {
14
+ /** The aria-label for the pagination component. */
15
+ this.ariaLabel = input('pagination', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
16
+ classes(() => 'mx-auto flex w-full justify-center');
17
+ }
18
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPagination, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
19
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: HlmPagination, isStandalone: true, selector: "[hlmPagination],hlm-pagination", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "pagination", "role": "navigation" }, properties: { "attr.aria-label": "ariaLabel()" } }, ngImport: i0 }); }
20
+ }
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPagination, decorators: [{
22
+ type: Directive,
23
+ args: [{
24
+ selector: '[hlmPagination],hlm-pagination',
25
+ host: {
26
+ 'data-slot': 'pagination',
27
+ role: 'navigation',
28
+ '[attr.aria-label]': 'ariaLabel()',
29
+ },
30
+ }]
31
+ }], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
32
+
33
+ class HlmPaginationContent {
34
+ constructor() {
35
+ classes(() => 'gap-0.5 flex items-center');
36
+ }
37
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
38
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmPaginationContent, isStandalone: true, selector: "ul[hlmPaginationContent]", host: { attributes: { "data-slot": "pagination-content" } }, ngImport: i0 }); }
39
+ }
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationContent, decorators: [{
41
+ type: Directive,
42
+ args: [{
43
+ selector: 'ul[hlmPaginationContent]',
44
+ host: { 'data-slot': 'pagination-content' },
45
+ }]
46
+ }], ctorParameters: () => [] });
47
+
48
+ class HlmPaginationEllipsis {
49
+ constructor() {
50
+ /** Screen reader only text for the ellipsis */
51
+ this.srOnlyText = input('More pages', ...(ngDevMode ? [{ debugName: "srOnlyText" }] : /* istanbul ignore next */ []));
52
+ classes(() => "size-8 [&_ng-icon:not([class*='text-'])]:text-[length:--spacing(4)] flex items-center justify-center");
53
+ }
54
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationEllipsis, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
55
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: HlmPaginationEllipsis, isStandalone: true, selector: "hlm-pagination-ellipsis", inputs: { srOnlyText: { classPropertyName: "srOnlyText", publicName: "srOnlyText", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "pagination-ellipsis" } }, providers: [provideIcons({ lucideEllipsis })], ngImport: i0, template: `
56
+ <ng-icon name="lucideEllipsis" />
57
+ <span class="sr-only">{{ srOnlyText() }}</span>
58
+ `, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
59
+ }
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationEllipsis, decorators: [{
61
+ type: Component,
62
+ args: [{
63
+ selector: 'hlm-pagination-ellipsis',
64
+ imports: [NgIcon],
65
+ providers: [provideIcons({ lucideEllipsis })],
66
+ changeDetection: ChangeDetectionStrategy.OnPush,
67
+ host: { 'data-slot': 'pagination-ellipsis' },
68
+ template: `
69
+ <ng-icon name="lucideEllipsis" />
70
+ <span class="sr-only">{{ srOnlyText() }}</span>
71
+ `,
72
+ }]
73
+ }], ctorParameters: () => [], propDecorators: { srOnlyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "srOnlyText", required: false }] }] } });
74
+
75
+ class HlmPaginationItem {
76
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
77
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: HlmPaginationItem, isStandalone: true, selector: "li[hlmPaginationItem]", host: { attributes: { "data-slot": "pagination-item" } }, ngImport: i0 }); }
78
+ }
79
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationItem, decorators: [{
80
+ type: Directive,
81
+ args: [{
82
+ selector: 'li[hlmPaginationItem]',
83
+ host: { 'data-slot': 'pagination-item' },
84
+ }]
85
+ }] });
86
+
87
+ class HlmPaginationLink {
88
+ constructor() {
89
+ /** Whether the link is active (i.e., the current page). */
90
+ this.isActive = input(false, { ...(ngDevMode ? { debugName: "isActive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
91
+ /** The size of the button. */
92
+ this.size = input('icon', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
93
+ /** The link to navigate to the page. */
94
+ this.link = input(...(ngDevMode ? [undefined, { debugName: "link" }] : /* istanbul ignore next */ []));
95
+ classes(() => [
96
+ 'relative',
97
+ buttonVariants({
98
+ variant: this.isActive() ? 'outline' : 'ghost',
99
+ size: this.size(),
100
+ }),
101
+ this.link() === undefined && 'cursor-pointer',
102
+ ]);
103
+ }
104
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationLink, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
105
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: HlmPaginationLink, isStandalone: true, selector: "[hlmPaginationLink]", inputs: { isActive: { classPropertyName: "isActive", publicName: "isActive", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "pagination-link" }, properties: { "attr.data-active": "isActive() ? \"true\" : null", "attr.aria-current": "isActive() ? \"page\" : null" } }, hostDirectives: [{ directive: i1.RouterLink, inputs: ["target", "target", "queryParams", "queryParams", "fragment", "fragment", "queryParamsHandling", "queryParamsHandling", "state", "state", "info", "info", "relativeTo", "relativeTo", "preserveFragment", "preserveFragment", "skipLocationChange", "skipLocationChange", "replaceUrl", "replaceUrl", "routerLink", "link"] }], ngImport: i0 }); }
106
+ }
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationLink, decorators: [{
108
+ type: Directive,
109
+ args: [{
110
+ selector: '[hlmPaginationLink]',
111
+ hostDirectives: [
112
+ {
113
+ directive: RouterLink,
114
+ inputs: [
115
+ 'target',
116
+ 'queryParams',
117
+ 'fragment',
118
+ 'queryParamsHandling',
119
+ 'state',
120
+ 'info',
121
+ 'relativeTo',
122
+ 'preserveFragment',
123
+ 'skipLocationChange',
124
+ 'replaceUrl',
125
+ 'routerLink: link',
126
+ ],
127
+ },
128
+ ],
129
+ host: {
130
+ 'data-slot': 'pagination-link',
131
+ '[attr.data-active]': 'isActive() ? "true" : null',
132
+ '[attr.aria-current]': 'isActive() ? "page" : null',
133
+ },
134
+ }]
135
+ }], ctorParameters: () => [], propDecorators: { isActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isActive", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], link: [{ type: i0.Input, args: [{ isSignal: true, alias: "link", required: false }] }] } });
136
+
137
+ class HlmPaginationNext {
138
+ constructor() {
139
+ this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
140
+ /** The link to navigate to the next page. */
141
+ this.link = input(...(ngDevMode ? [undefined, { debugName: "link" }] : /* istanbul ignore next */ []));
142
+ /** The query parameters to pass to the next page. */
143
+ this.queryParams = input(...(ngDevMode ? [undefined, { debugName: "queryParams" }] : /* istanbul ignore next */ []));
144
+ /** How to handle query parameters when navigating to the next page. */
145
+ this.queryParamsHandling = input(...(ngDevMode ? [undefined, { debugName: "queryParamsHandling" }] : /* istanbul ignore next */ []));
146
+ /** The aria-label for the next page link. */
147
+ this.ariaLabel = input('Go to next page', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
148
+ /** The text to display for the next page link. */
149
+ this.text = input('Next', ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
150
+ /** Whether the button should only display the icon. */
151
+ this.iconOnly = input(false, { ...(ngDevMode ? { debugName: "iconOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
152
+ this._labelClass = computed(() => (this.iconOnly() ? 'sr-only' : 'hidden sm:block'), ...(ngDevMode ? [{ debugName: "_labelClass" }] : /* istanbul ignore next */ []));
153
+ this._size = computed(() => (this.iconOnly() ? 'icon' : 'default'), ...(ngDevMode ? [{ debugName: "_size" }] : /* istanbul ignore next */ []));
154
+ this._computedClass = computed(() => hlm(!this.iconOnly() && 'pe-1.5!', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
155
+ }
156
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationNext, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
157
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: HlmPaginationNext, isStandalone: true, selector: "hlm-pagination-next", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, queryParamsHandling: { classPropertyName: "queryParamsHandling", publicName: "queryParamsHandling", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, iconOnly: { classPropertyName: "iconOnly", publicName: "iconOnly", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideIcons({ lucideChevronRight })], ngImport: i0, template: `
158
+ <a
159
+ hlmPaginationLink
160
+ [class]="_computedClass()"
161
+ [link]="link()"
162
+ [queryParams]="queryParams()"
163
+ [queryParamsHandling]="queryParamsHandling()"
164
+ [size]="_size()"
165
+ [attr.aria-label]="ariaLabel()"
166
+ >
167
+ <span [class]="_labelClass()">{{ text() }}</span>
168
+ <ng-icon name="lucideChevronRight" class="rtl:rotate-180" />
169
+ </a>
170
+ `, isInline: true, dependencies: [{ kind: "directive", type: HlmPaginationLink, selector: "[hlmPaginationLink]", inputs: ["isActive", "size", "link"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
171
+ }
172
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationNext, decorators: [{
173
+ type: Component,
174
+ args: [{
175
+ selector: 'hlm-pagination-next',
176
+ imports: [HlmPaginationLink, NgIcon],
177
+ providers: [provideIcons({ lucideChevronRight })],
178
+ changeDetection: ChangeDetectionStrategy.OnPush,
179
+ template: `
180
+ <a
181
+ hlmPaginationLink
182
+ [class]="_computedClass()"
183
+ [link]="link()"
184
+ [queryParams]="queryParams()"
185
+ [queryParamsHandling]="queryParamsHandling()"
186
+ [size]="_size()"
187
+ [attr.aria-label]="ariaLabel()"
188
+ >
189
+ <span [class]="_labelClass()">{{ text() }}</span>
190
+ <ng-icon name="lucideChevronRight" class="rtl:rotate-180" />
191
+ </a>
192
+ `,
193
+ }]
194
+ }], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], link: [{ type: i0.Input, args: [{ isSignal: true, alias: "link", required: false }] }], queryParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParams", required: false }] }], queryParamsHandling: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParamsHandling", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], iconOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOnly", required: false }] }] } });
195
+
196
+ class HlmPaginationPrevious {
197
+ constructor() {
198
+ this.userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
199
+ /** The link to navigate to the previous page. */
200
+ this.link = input(...(ngDevMode ? [undefined, { debugName: "link" }] : /* istanbul ignore next */ []));
201
+ /** The query parameters to pass to the previous page. */
202
+ this.queryParams = input(...(ngDevMode ? [undefined, { debugName: "queryParams" }] : /* istanbul ignore next */ []));
203
+ /** How to handle query parameters when navigating to the previous page. */
204
+ this.queryParamsHandling = input(...(ngDevMode ? [undefined, { debugName: "queryParamsHandling" }] : /* istanbul ignore next */ []));
205
+ /** The aria-label for the previous page link. */
206
+ this.ariaLabel = input('Go to previous page', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
207
+ /** The text to display for the previous page link. */
208
+ this.text = input('Previous', ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
209
+ /** Whether the button should only display the icon. */
210
+ this.iconOnly = input(false, { ...(ngDevMode ? { debugName: "iconOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
211
+ this._labelClass = computed(() => hlm(this.iconOnly() ? 'sr-only' : 'hidden sm:block'), ...(ngDevMode ? [{ debugName: "_labelClass" }] : /* istanbul ignore next */ []));
212
+ this._size = computed(() => (this.iconOnly() ? 'icon' : 'default'), ...(ngDevMode ? [{ debugName: "_size" }] : /* istanbul ignore next */ []));
213
+ this._computedClass = computed(() => hlm(!this.iconOnly() && 'ps-1.5!', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
214
+ }
215
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationPrevious, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
216
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: HlmPaginationPrevious, isStandalone: true, selector: "hlm-pagination-previous", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, queryParamsHandling: { classPropertyName: "queryParamsHandling", publicName: "queryParamsHandling", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, iconOnly: { classPropertyName: "iconOnly", publicName: "iconOnly", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideIcons({ lucideChevronLeft })], ngImport: i0, template: `
217
+ <a
218
+ hlmPaginationLink
219
+ [class]="_computedClass()"
220
+ [link]="link()"
221
+ [queryParams]="queryParams()"
222
+ [queryParamsHandling]="queryParamsHandling()"
223
+ [size]="_size()"
224
+ [attr.aria-label]="ariaLabel()"
225
+ >
226
+ <ng-icon name="lucideChevronLeft" class="rtl:rotate-180" />
227
+ <span [class]="_labelClass()">{{ text() }}</span>
228
+ </a>
229
+ `, isInline: true, dependencies: [{ kind: "directive", type: HlmPaginationLink, selector: "[hlmPaginationLink]", inputs: ["isActive", "size", "link"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
230
+ }
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmPaginationPrevious, decorators: [{
232
+ type: Component,
233
+ args: [{
234
+ selector: 'hlm-pagination-previous',
235
+ imports: [HlmPaginationLink, NgIcon],
236
+ providers: [provideIcons({ lucideChevronLeft })],
237
+ changeDetection: ChangeDetectionStrategy.OnPush,
238
+ template: `
239
+ <a
240
+ hlmPaginationLink
241
+ [class]="_computedClass()"
242
+ [link]="link()"
243
+ [queryParams]="queryParams()"
244
+ [queryParamsHandling]="queryParamsHandling()"
245
+ [size]="_size()"
246
+ [attr.aria-label]="ariaLabel()"
247
+ >
248
+ <ng-icon name="lucideChevronLeft" class="rtl:rotate-180" />
249
+ <span [class]="_labelClass()">{{ text() }}</span>
250
+ </a>
251
+ `,
252
+ }]
253
+ }], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], link: [{ type: i0.Input, args: [{ isSignal: true, alias: "link", required: false }] }], queryParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParams", required: false }] }], queryParamsHandling: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParamsHandling", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], iconOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOnly", required: false }] }] } });
254
+
255
+ class HlmNumberedPagination {
256
+ constructor() {
257
+ /**
258
+ * The current (active) page.
259
+ */
260
+ this.currentPage = model.required(...(ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []));
261
+ /**
262
+ * The number of items per paginated page.
263
+ */
264
+ this.itemsPerPage = model.required(...(ngDevMode ? [{ debugName: "itemsPerPage" }] : /* istanbul ignore next */ []));
265
+ /**
266
+ * The total number of items in the collection. Only useful when
267
+ * doing server-side paging, where the collection size is limited
268
+ * to a single page returned by the server API.
269
+ */
270
+ this.totalItems = input.required({ ...(ngDevMode ? { debugName: "totalItems" } : /* istanbul ignore next */ {}), transform: numberAttribute });
271
+ /**
272
+ * The number of page links to show.
273
+ */
274
+ this.maxSize = input(7, { ...(ngDevMode ? { debugName: "maxSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
275
+ /**
276
+ * Show the first and last page buttons.
277
+ */
278
+ this.showEdges = input(true, { ...(ngDevMode ? { debugName: "showEdges" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
279
+ /**
280
+ * The page sizes to show.
281
+ * Defaults to [10, 20, 50, 100]
282
+ */
283
+ this.pageSizes = input([10, 20, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizes" }] : /* istanbul ignore next */ []));
284
+ this._pageSizesWithCurrent = computed(() => {
285
+ const pageSizes = this.pageSizes();
286
+ return pageSizes.includes(this.itemsPerPage())
287
+ ? pageSizes // if current page size is included, return the same array
288
+ : [...pageSizes, this.itemsPerPage()].sort((a, b) => a - b); // otherwise, add current page size and sort the array
289
+ }, ...(ngDevMode ? [{ debugName: "_pageSizesWithCurrent" }] : /* istanbul ignore next */ []));
290
+ this._isFirstPageActive = computed(() => this.currentPage() === 1, ...(ngDevMode ? [{ debugName: "_isFirstPageActive" }] : /* istanbul ignore next */ []));
291
+ this._isLastPageActive = computed(() => this.currentPage() === this._lastPageNumber(), ...(ngDevMode ? [{ debugName: "_isLastPageActive" }] : /* istanbul ignore next */ []));
292
+ this._lastPageNumber = computed(() => {
293
+ if (this.totalItems() < 1) {
294
+ // when there are 0 or fewer (an error case) items, there are no "pages" as such,
295
+ // but it makes sense to consider a single, empty page as the last page.
296
+ return 1;
297
+ }
298
+ return Math.ceil(this.totalItems() / this.itemsPerPage());
299
+ }, ...(ngDevMode ? [{ debugName: "_lastPageNumber" }] : /* istanbul ignore next */ []));
300
+ this._pages = computed(() => {
301
+ const correctedCurrentPage = outOfBoundCorrection(this.totalItems(), this.itemsPerPage(), this.currentPage());
302
+ if (correctedCurrentPage !== this.currentPage()) {
303
+ // update the current page
304
+ untracked(() => this.currentPage.set(correctedCurrentPage));
305
+ }
306
+ return createPageArray(correctedCurrentPage, this.itemsPerPage(), this.totalItems(), this.maxSize());
307
+ }, ...(ngDevMode ? [{ debugName: "_pages" }] : /* istanbul ignore next */ []));
308
+ }
309
+ goToPrevious() {
310
+ this.currentPage.set(this.currentPage() - 1);
311
+ }
312
+ goToNext() {
313
+ this.currentPage.set(this.currentPage() + 1);
314
+ }
315
+ goToFirst() {
316
+ this.currentPage.set(1);
317
+ }
318
+ goToLast() {
319
+ this.currentPage.set(this._lastPageNumber());
320
+ }
321
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmNumberedPagination, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
322
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: HlmNumberedPagination, isStandalone: true, selector: "hlm-numbered-pagination", inputs: { currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: true, transformFunction: null }, itemsPerPage: { classPropertyName: "itemsPerPage", publicName: "itemsPerPage", isSignal: true, isRequired: true, transformFunction: null }, totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: true, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, showEdges: { classPropertyName: "showEdges", publicName: "showEdges", isSignal: true, isRequired: false, transformFunction: null }, pageSizes: { classPropertyName: "pageSizes", publicName: "pageSizes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentPage: "currentPageChange", itemsPerPage: "itemsPerPageChange" }, ngImport: i0, template: `
323
+ <div class="flex items-center justify-between gap-2 px-4 py-2">
324
+ <div class="flex items-center gap-1 text-sm text-nowrap text-gray-600">
325
+ <b>{{ totalItems() }}</b>
326
+ total items |
327
+ <b>{{ _lastPageNumber() }}</b>
328
+ pages
329
+ </div>
330
+
331
+ <nav hlmPagination>
332
+ <ul hlmPaginationContent>
333
+ @if (showEdges() && !_isFirstPageActive()) {
334
+ <li hlmPaginationItem (click)="goToPrevious()">
335
+ <hlm-pagination-previous />
336
+ </li>
337
+ }
338
+
339
+ @for (page of _pages(); track page) {
340
+ <li hlmPaginationItem>
341
+ @if (page === '...') {
342
+ <hlm-pagination-ellipsis />
343
+ } @else {
344
+ <a hlmPaginationLink [isActive]="currentPage() === page" (click)="currentPage.set(page)">
345
+ {{ page }}
346
+ </a>
347
+ }
348
+ </li>
349
+ }
350
+
351
+ @if (showEdges() && !_isLastPageActive()) {
352
+ <li hlmPaginationItem (click)="goToNext()">
353
+ <hlm-pagination-next />
354
+ </li>
355
+ }
356
+ </ul>
357
+ </nav>
358
+
359
+ <!-- Show Page Size selector -->
360
+ <hlm-select [(value)]="itemsPerPage" class="ml-auto">
361
+ <hlm-select-trigger class="w-fit">
362
+ <hlm-select-value />
363
+ </hlm-select-trigger>
364
+ <hlm-select-content *hlmSelectPortal>
365
+ <hlm-select-group>
366
+ @for (pageSize of _pageSizesWithCurrent(); track pageSize) {
367
+ <hlm-select-item [value]="pageSize">{{ pageSize }}</hlm-select-item>
368
+ }
369
+ </hlm-select-group>
370
+ </hlm-select-content>
371
+ </hlm-select>
372
+ </div>
373
+ `, isInline: true, dependencies: [{ kind: "directive", type: HlmPagination, selector: "[hlmPagination],hlm-pagination", inputs: ["aria-label"] }, { kind: "directive", type: HlmPaginationContent, selector: "ul[hlmPaginationContent]" }, { kind: "directive", type: HlmPaginationItem, selector: "li[hlmPaginationItem]" }, { kind: "component", type: HlmPaginationPrevious, selector: "hlm-pagination-previous", inputs: ["class", "link", "queryParams", "queryParamsHandling", "aria-label", "text", "iconOnly"] }, { kind: "component", type: HlmPaginationNext, selector: "hlm-pagination-next", inputs: ["class", "link", "queryParams", "queryParamsHandling", "aria-label", "text", "iconOnly"] }, { kind: "directive", type: HlmPaginationLink, selector: "[hlmPaginationLink]", inputs: ["isActive", "size", "link"] }, { kind: "component", type: HlmPaginationEllipsis, selector: "hlm-pagination-ellipsis", inputs: ["srOnlyText"] }, { kind: "directive", type: i1$1.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i1$1.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "directive", type: i1$1.HlmSelectGroup, selector: "[hlmSelectGroup],hlm-select-group" }, { kind: "component", type: i1$1.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i1$1.HlmSelectPortal, selector: "[hlmSelectPortal]" }, { kind: "component", type: i1$1.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "size", "forceInvalid"] }, { kind: "directive", type: i1$1.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
374
+ }
375
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmNumberedPagination, decorators: [{
376
+ type: Component,
377
+ args: [{
378
+ selector: 'hlm-numbered-pagination',
379
+ imports: [
380
+ HlmPagination,
381
+ HlmPaginationContent,
382
+ HlmPaginationItem,
383
+ HlmPaginationPrevious,
384
+ HlmPaginationNext,
385
+ HlmPaginationLink,
386
+ HlmPaginationEllipsis,
387
+ HlmSelectImports,
388
+ ],
389
+ changeDetection: ChangeDetectionStrategy.OnPush,
390
+ template: `
391
+ <div class="flex items-center justify-between gap-2 px-4 py-2">
392
+ <div class="flex items-center gap-1 text-sm text-nowrap text-gray-600">
393
+ <b>{{ totalItems() }}</b>
394
+ total items |
395
+ <b>{{ _lastPageNumber() }}</b>
396
+ pages
397
+ </div>
398
+
399
+ <nav hlmPagination>
400
+ <ul hlmPaginationContent>
401
+ @if (showEdges() && !_isFirstPageActive()) {
402
+ <li hlmPaginationItem (click)="goToPrevious()">
403
+ <hlm-pagination-previous />
404
+ </li>
405
+ }
406
+
407
+ @for (page of _pages(); track page) {
408
+ <li hlmPaginationItem>
409
+ @if (page === '...') {
410
+ <hlm-pagination-ellipsis />
411
+ } @else {
412
+ <a hlmPaginationLink [isActive]="currentPage() === page" (click)="currentPage.set(page)">
413
+ {{ page }}
414
+ </a>
415
+ }
416
+ </li>
417
+ }
418
+
419
+ @if (showEdges() && !_isLastPageActive()) {
420
+ <li hlmPaginationItem (click)="goToNext()">
421
+ <hlm-pagination-next />
422
+ </li>
423
+ }
424
+ </ul>
425
+ </nav>
426
+
427
+ <!-- Show Page Size selector -->
428
+ <hlm-select [(value)]="itemsPerPage" class="ml-auto">
429
+ <hlm-select-trigger class="w-fit">
430
+ <hlm-select-value />
431
+ </hlm-select-trigger>
432
+ <hlm-select-content *hlmSelectPortal>
433
+ <hlm-select-group>
434
+ @for (pageSize of _pageSizesWithCurrent(); track pageSize) {
435
+ <hlm-select-item [value]="pageSize">{{ pageSize }}</hlm-select-item>
436
+ }
437
+ </hlm-select-group>
438
+ </hlm-select-content>
439
+ </hlm-select>
440
+ </div>
441
+ `,
442
+ }]
443
+ }], propDecorators: { currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: true }] }, { type: i0.Output, args: ["currentPageChange"] }], itemsPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsPerPage", required: true }] }, { type: i0.Output, args: ["itemsPerPageChange"] }], totalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalItems", required: true }] }], maxSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }], showEdges: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEdges", required: false }] }], pageSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizes", required: false }] }] } });
444
+ /**
445
+ * Checks that the instance.currentPage property is within bounds for the current page range.
446
+ * If not, return a correct value for currentPage, or the current value if OK.
447
+ *
448
+ * Copied from 'ngx-pagination' package
449
+ */
450
+ function outOfBoundCorrection(totalItems, itemsPerPage, currentPage) {
451
+ const totalPages = Math.ceil(totalItems / itemsPerPage);
452
+ if (totalPages < currentPage && 0 < totalPages) {
453
+ return totalPages;
454
+ }
455
+ if (currentPage < 1) {
456
+ return 1;
457
+ }
458
+ return currentPage;
459
+ }
460
+ /**
461
+ * Returns an array of Page objects to use in the pagination controls.
462
+ *
463
+ * Copied from 'ngx-pagination' package
464
+ */
465
+ function createPageArray(currentPage, itemsPerPage, totalItems, paginationRange) {
466
+ // paginationRange could be a string if passed from attribute, so cast to number.
467
+ paginationRange = +paginationRange;
468
+ const pages = [];
469
+ // Return 1 as default page number
470
+ // Make sense to show 1 instead of empty when there are no items
471
+ const totalPages = Math.max(Math.ceil(totalItems / itemsPerPage), 1);
472
+ const halfWay = Math.ceil(paginationRange / 2);
473
+ const isStart = currentPage <= halfWay;
474
+ const isEnd = totalPages - halfWay < currentPage;
475
+ const isMiddle = !isStart && !isEnd;
476
+ const ellipsesNeeded = paginationRange < totalPages;
477
+ let i = 1;
478
+ while (i <= totalPages && i <= paginationRange) {
479
+ let label;
480
+ const pageNumber = calculatePageNumber(i, currentPage, paginationRange, totalPages);
481
+ const openingEllipsesNeeded = i === 2 && (isMiddle || isEnd);
482
+ const closingEllipsesNeeded = i === paginationRange - 1 && (isMiddle || isStart);
483
+ if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) {
484
+ label = '...';
485
+ }
486
+ else {
487
+ label = pageNumber;
488
+ }
489
+ pages.push(label);
490
+ i++;
491
+ }
492
+ return pages;
493
+ }
494
+ /**
495
+ * Given the position in the sequence of pagination links [i],
496
+ * figure out what page number corresponds to that position.
497
+ *
498
+ * Copied from 'ngx-pagination' package
499
+ */
500
+ function calculatePageNumber(i, currentPage, paginationRange, totalPages) {
501
+ const halfWay = Math.ceil(paginationRange / 2);
502
+ if (i === paginationRange) {
503
+ return totalPages;
504
+ }
505
+ if (i === 1) {
506
+ return i;
507
+ }
508
+ if (paginationRange < totalPages) {
509
+ if (totalPages - halfWay < currentPage) {
510
+ return totalPages - paginationRange + i;
511
+ }
512
+ if (halfWay < currentPage) {
513
+ return currentPage - halfWay + i;
514
+ }
515
+ return i;
516
+ }
517
+ return i;
518
+ }
519
+
520
+ class HlmNumberedPaginationQueryParams {
521
+ constructor() {
522
+ /**
523
+ * The current (active) page.
524
+ */
525
+ this.currentPage = model.required(...(ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []));
526
+ /**
527
+ * The number of items per paginated page.
528
+ */
529
+ this.itemsPerPage = model.required(...(ngDevMode ? [{ debugName: "itemsPerPage" }] : /* istanbul ignore next */ []));
530
+ /**
531
+ * The total number of items in the collection. Only useful when
532
+ * doing server-side paging, where the collection size is limited
533
+ * to a single page returned by the server API.
534
+ */
535
+ this.totalItems = input.required({ ...(ngDevMode ? { debugName: "totalItems" } : /* istanbul ignore next */ {}), transform: numberAttribute });
536
+ /**
537
+ * The URL path to use for the pagination links.
538
+ * Defaults to '.' (current path).
539
+ */
540
+ this.link = input('.', ...(ngDevMode ? [{ debugName: "link" }] : /* istanbul ignore next */ []));
541
+ /**
542
+ * The number of page links to show.
543
+ */
544
+ this.maxSize = input(7, { ...(ngDevMode ? { debugName: "maxSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
545
+ /**
546
+ * Show the first and last page buttons.
547
+ */
548
+ this.showEdges = input(true, { ...(ngDevMode ? { debugName: "showEdges" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
549
+ /**
550
+ * The page sizes to show.
551
+ * Defaults to [10, 20, 50, 100]
552
+ */
553
+ this.pageSizes = input([10, 20, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizes" }] : /* istanbul ignore next */ []));
554
+ this._pageSizesWithCurrent = computed(() => {
555
+ const pageSizes = this.pageSizes();
556
+ return pageSizes.includes(this.itemsPerPage())
557
+ ? pageSizes // if current page size is included, return the same array
558
+ : [...pageSizes, this.itemsPerPage()].sort((a, b) => a - b); // otherwise, add current page size and sort the array
559
+ }, ...(ngDevMode ? [{ debugName: "_pageSizesWithCurrent" }] : /* istanbul ignore next */ []));
560
+ this._isFirstPageActive = computed(() => this.currentPage() === 1, ...(ngDevMode ? [{ debugName: "_isFirstPageActive" }] : /* istanbul ignore next */ []));
561
+ this._isLastPageActive = computed(() => this.currentPage() === this._lastPageNumber(), ...(ngDevMode ? [{ debugName: "_isLastPageActive" }] : /* istanbul ignore next */ []));
562
+ this._lastPageNumber = computed(() => {
563
+ if (this.totalItems() < 1) {
564
+ // when there are 0 or fewer (an error case) items, there are no "pages" as such,
565
+ // but it makes sense to consider a single, empty page as the last page.
566
+ return 1;
567
+ }
568
+ return Math.ceil(this.totalItems() / this.itemsPerPage());
569
+ }, ...(ngDevMode ? [{ debugName: "_lastPageNumber" }] : /* istanbul ignore next */ []));
570
+ this._pages = computed(() => {
571
+ const correctedCurrentPage = outOfBoundCorrection(this.totalItems(), this.itemsPerPage(), this.currentPage());
572
+ if (correctedCurrentPage !== this.currentPage()) {
573
+ // update the current page
574
+ untracked(() => this.currentPage.set(correctedCurrentPage));
575
+ }
576
+ return createPageArray(correctedCurrentPage, this.itemsPerPage(), this.totalItems(), this.maxSize());
577
+ }, ...(ngDevMode ? [{ debugName: "_pages" }] : /* istanbul ignore next */ []));
578
+ classes(() => 'flex items-center justify-between gap-2 px-4 py-2');
579
+ }
580
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmNumberedPaginationQueryParams, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
581
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: HlmNumberedPaginationQueryParams, isStandalone: true, selector: "hlm-numbered-pagination-query-params", inputs: { currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: true, transformFunction: null }, itemsPerPage: { classPropertyName: "itemsPerPage", publicName: "itemsPerPage", isSignal: true, isRequired: true, transformFunction: null }, totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: true, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, showEdges: { classPropertyName: "showEdges", publicName: "showEdges", isSignal: true, isRequired: false, transformFunction: null }, pageSizes: { classPropertyName: "pageSizes", publicName: "pageSizes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentPage: "currentPageChange", itemsPerPage: "itemsPerPageChange" }, ngImport: i0, template: `
582
+ <div class="flex items-center gap-1 text-sm text-nowrap text-gray-600">
583
+ <b>{{ totalItems() }}</b>
584
+ total items |
585
+ <b>{{ _lastPageNumber() }}</b>
586
+ pages
587
+ </div>
588
+
589
+ <nav hlmPagination>
590
+ <ul hlmPaginationContent>
591
+ @if (showEdges() && !_isFirstPageActive()) {
592
+ <li hlmPaginationItem>
593
+ <hlm-pagination-previous
594
+ [link]="link()"
595
+ [queryParams]="{ page: currentPage() - 1 }"
596
+ queryParamsHandling="merge"
597
+ />
598
+ </li>
599
+ }
600
+
601
+ @for (page of _pages(); track page) {
602
+ <li hlmPaginationItem>
603
+ @if (page === '...') {
604
+ <hlm-pagination-ellipsis />
605
+ } @else {
606
+ <a
607
+ hlmPaginationLink
608
+ [link]="currentPage() !== page ? link() : undefined"
609
+ [queryParams]="{ page }"
610
+ queryParamsHandling="merge"
611
+ [isActive]="currentPage() === page"
612
+ >
613
+ {{ page }}
614
+ </a>
615
+ }
616
+ </li>
617
+ }
618
+
619
+ @if (showEdges() && !_isLastPageActive()) {
620
+ <li hlmPaginationItem>
621
+ <hlm-pagination-next
622
+ [link]="link()"
623
+ [queryParams]="{ page: currentPage() + 1 }"
624
+ queryParamsHandling="merge"
625
+ />
626
+ </li>
627
+ }
628
+ </ul>
629
+ </nav>
630
+
631
+ <!-- Show Page Size selector -->
632
+ <hlm-select [(value)]="itemsPerPage" class="ml-auto">
633
+ <hlm-select-trigger class="w-fit">
634
+ <hlm-select-value />
635
+ </hlm-select-trigger>
636
+ <hlm-select-content *hlmSelectPortal>
637
+ <hlm-select-group>
638
+ @for (pageSize of _pageSizesWithCurrent(); track pageSize) {
639
+ <hlm-select-item [value]="pageSize">{{ pageSize }}</hlm-select-item>
640
+ }
641
+ </hlm-select-group>
642
+ </hlm-select-content>
643
+ </hlm-select>
644
+ `, isInline: true, dependencies: [{ kind: "directive", type: HlmPagination, selector: "[hlmPagination],hlm-pagination", inputs: ["aria-label"] }, { kind: "directive", type: HlmPaginationContent, selector: "ul[hlmPaginationContent]" }, { kind: "directive", type: HlmPaginationItem, selector: "li[hlmPaginationItem]" }, { kind: "component", type: HlmPaginationPrevious, selector: "hlm-pagination-previous", inputs: ["class", "link", "queryParams", "queryParamsHandling", "aria-label", "text", "iconOnly"] }, { kind: "component", type: HlmPaginationNext, selector: "hlm-pagination-next", inputs: ["class", "link", "queryParams", "queryParamsHandling", "aria-label", "text", "iconOnly"] }, { kind: "directive", type: HlmPaginationLink, selector: "[hlmPaginationLink]", inputs: ["isActive", "size", "link"] }, { kind: "component", type: HlmPaginationEllipsis, selector: "hlm-pagination-ellipsis", inputs: ["srOnlyText"] }, { kind: "directive", type: i1$1.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i1$1.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "directive", type: i1$1.HlmSelectGroup, selector: "[hlmSelectGroup],hlm-select-group" }, { kind: "component", type: i1$1.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i1$1.HlmSelectPortal, selector: "[hlmSelectPortal]" }, { kind: "component", type: i1$1.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "size", "forceInvalid"] }, { kind: "directive", type: i1$1.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
645
+ }
646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: HlmNumberedPaginationQueryParams, decorators: [{
647
+ type: Component,
648
+ args: [{
649
+ selector: 'hlm-numbered-pagination-query-params',
650
+ imports: [
651
+ HlmPagination,
652
+ HlmPaginationContent,
653
+ HlmPaginationItem,
654
+ HlmPaginationPrevious,
655
+ HlmPaginationNext,
656
+ HlmPaginationLink,
657
+ HlmPaginationEllipsis,
658
+ HlmSelectImports,
659
+ ],
660
+ changeDetection: ChangeDetectionStrategy.OnPush,
661
+ template: `
662
+ <div class="flex items-center gap-1 text-sm text-nowrap text-gray-600">
663
+ <b>{{ totalItems() }}</b>
664
+ total items |
665
+ <b>{{ _lastPageNumber() }}</b>
666
+ pages
667
+ </div>
668
+
669
+ <nav hlmPagination>
670
+ <ul hlmPaginationContent>
671
+ @if (showEdges() && !_isFirstPageActive()) {
672
+ <li hlmPaginationItem>
673
+ <hlm-pagination-previous
674
+ [link]="link()"
675
+ [queryParams]="{ page: currentPage() - 1 }"
676
+ queryParamsHandling="merge"
677
+ />
678
+ </li>
679
+ }
680
+
681
+ @for (page of _pages(); track page) {
682
+ <li hlmPaginationItem>
683
+ @if (page === '...') {
684
+ <hlm-pagination-ellipsis />
685
+ } @else {
686
+ <a
687
+ hlmPaginationLink
688
+ [link]="currentPage() !== page ? link() : undefined"
689
+ [queryParams]="{ page }"
690
+ queryParamsHandling="merge"
691
+ [isActive]="currentPage() === page"
692
+ >
693
+ {{ page }}
694
+ </a>
695
+ }
696
+ </li>
697
+ }
698
+
699
+ @if (showEdges() && !_isLastPageActive()) {
700
+ <li hlmPaginationItem>
701
+ <hlm-pagination-next
702
+ [link]="link()"
703
+ [queryParams]="{ page: currentPage() + 1 }"
704
+ queryParamsHandling="merge"
705
+ />
706
+ </li>
707
+ }
708
+ </ul>
709
+ </nav>
710
+
711
+ <!-- Show Page Size selector -->
712
+ <hlm-select [(value)]="itemsPerPage" class="ml-auto">
713
+ <hlm-select-trigger class="w-fit">
714
+ <hlm-select-value />
715
+ </hlm-select-trigger>
716
+ <hlm-select-content *hlmSelectPortal>
717
+ <hlm-select-group>
718
+ @for (pageSize of _pageSizesWithCurrent(); track pageSize) {
719
+ <hlm-select-item [value]="pageSize">{{ pageSize }}</hlm-select-item>
720
+ }
721
+ </hlm-select-group>
722
+ </hlm-select-content>
723
+ </hlm-select>
724
+ `,
725
+ }]
726
+ }], ctorParameters: () => [], propDecorators: { currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: true }] }, { type: i0.Output, args: ["currentPageChange"] }], itemsPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsPerPage", required: true }] }, { type: i0.Output, args: ["itemsPerPageChange"] }], totalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalItems", required: true }] }], link: [{ type: i0.Input, args: [{ isSignal: true, alias: "link", required: false }] }], maxSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }], showEdges: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEdges", required: false }] }], pageSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizes", required: false }] }] } });
727
+
728
+ const HlmPaginationImports = [
729
+ HlmPagination,
730
+ HlmPaginationContent,
731
+ HlmPaginationItem,
732
+ HlmPaginationLink,
733
+ HlmPaginationPrevious,
734
+ HlmPaginationNext,
735
+ HlmPaginationEllipsis,
736
+ HlmNumberedPagination,
737
+ HlmNumberedPaginationQueryParams,
738
+ ];
739
+
740
+ /**
741
+ * Generated bundle index. Do not edit.
742
+ */
743
+
744
+ export { HlmNumberedPagination, HlmNumberedPaginationQueryParams, HlmPagination, HlmPaginationContent, HlmPaginationEllipsis, HlmPaginationImports, HlmPaginationItem, HlmPaginationLink, HlmPaginationNext, HlmPaginationPrevious, createPageArray, outOfBoundCorrection };
745
+ //# sourceMappingURL=yukit-web-helm-pagination.mjs.map