@daffodil/design 0.93.1 → 0.94.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.
Files changed (127) hide show
  1. package/README.md +0 -1
  2. package/accordion/src/accordion-theme.scss +2 -2
  3. package/article/src/article/_stops-article-cascade.scss +5 -1
  4. package/article/src/article-theme.scss +2 -2
  5. package/badge/README.md +85 -0
  6. package/badge/src/badge-theme.scss +197 -0
  7. package/breadcrumb/src/breadcrumb-theme.scss +2 -2
  8. package/button/src/button/basic/button-theme.scss +2 -2
  9. package/button/src/button/flat/flat-theme.scss +2 -2
  10. package/button/src/button/icon/icon-theme.scss +2 -2
  11. package/button/src/button/raised/raised-theme.scss +13 -13
  12. package/button/src/button/stroked/stroked-theme.scss +2 -2
  13. package/button/src/button/underline/underline-theme.scss +2 -2
  14. package/callout/src/callout-theme.scss +12 -2
  15. package/card/src/card/stroked/stroked-theme.scss +14 -22
  16. package/card/src/card-base-theme.scss +4 -4
  17. package/card/src/card-base.scss +13 -16
  18. package/fesm2022/daffodil-design-accordion.mjs +9 -15
  19. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  20. package/fesm2022/daffodil-design-article.mjs +2 -2
  21. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-badge.mjs +87 -0
  23. package/fesm2022/daffodil-design-badge.mjs.map +1 -0
  24. package/fesm2022/daffodil-design-breadcrumb.mjs +1 -1
  25. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-button.mjs +1 -1
  27. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-callout.mjs +2 -2
  29. package/fesm2022/daffodil-design-card.mjs +9 -11
  30. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  31. package/fesm2022/daffodil-design-form-field.mjs +95 -115
  32. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  33. package/fesm2022/daffodil-design-form.mjs +5 -7
  34. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  35. package/fesm2022/daffodil-design-image.mjs +41 -98
  36. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  37. package/fesm2022/daffodil-design-input.mjs +3 -3
  38. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  39. package/fesm2022/daffodil-design-list.mjs +16 -21
  40. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  41. package/fesm2022/daffodil-design-media-gallery.mjs +56 -61
  42. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  43. package/fesm2022/daffodil-design-menu.mjs +61 -38
  44. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  45. package/fesm2022/daffodil-design-native-select.mjs +3 -3
  46. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  47. package/fesm2022/daffodil-design-notification.mjs +17 -20
  48. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  49. package/fesm2022/daffodil-design-paginator.mjs +71 -76
  50. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  51. package/fesm2022/daffodil-design-progress-bar.mjs +33 -53
  52. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  53. package/fesm2022/daffodil-design-select.mjs +1 -1
  54. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  55. package/fesm2022/daffodil-design-spinner.mjs +17 -16
  56. package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
  57. package/fesm2022/daffodil-design-switch.mjs +20 -29
  58. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  59. package/fesm2022/daffodil-design-tabs.mjs +86 -88
  60. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  61. package/fesm2022/daffodil-design-tag.mjs +14 -17
  62. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  63. package/fesm2022/daffodil-design-text-snippet.mjs +18 -23
  64. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  65. package/fesm2022/daffodil-design-textarea.mjs +3 -3
  66. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  67. package/fesm2022/daffodil-design-toast.mjs +19 -20
  68. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  69. package/fesm2022/daffodil-design.mjs +95 -69
  70. package/fesm2022/daffodil-design.mjs.map +1 -1
  71. package/form/src/hint/hint-theme.scss +2 -2
  72. package/form-field/src/form-field-theme.scss +2 -2
  73. package/hero/src/hero-theme.scss +12 -2
  74. package/list/README.md +10 -0
  75. package/list/src/list-theme.scss +2 -2
  76. package/media-gallery/README.md +0 -5
  77. package/media-gallery/src/media-gallery-theme.scss +2 -2
  78. package/menu/README.md +5 -0
  79. package/menu/src/menu-theme.scss +4 -4
  80. package/notification/src/notification-theme.scss +2 -2
  81. package/package.json +1 -1
  82. package/paginator/src/paginator-theme.scss +2 -2
  83. package/progress-bar/README.md +1 -1
  84. package/progress-bar/src/progress-bar-theme.scss +2 -2
  85. package/scss/state/skeleton/_mixins.scss +2 -2
  86. package/scss/theme/default.scss +15 -0
  87. package/scss/theme.scss +2 -8
  88. package/scss/theming/_configure-palette.scss +5 -1
  89. package/scss/theming/_get-theme-mode.scss +1 -1
  90. package/scss/theming/_index.scss +2 -3
  91. package/scss/theming/_light-dark.scss +37 -12
  92. package/scss/theming/color-shift/_color-shift.scss +56 -0
  93. package/scss/theming/color-shift/_color-shift.spec.scss +107 -0
  94. package/scss/theming/color-shift/_index.scss +1 -0
  95. package/scss/theming/{_daff-theme.scss → default/_daff-theme.scss} +4 -4
  96. package/scss/theming/default/_index.scss +1 -0
  97. package/select/src/select-theme.scss +5 -3
  98. package/switch/src/switch-theme.scss +2 -2
  99. package/tabs/src/tabs-theme.scss +2 -2
  100. package/tag/src/tag-theme.scss +2 -2
  101. package/toast/src/toast-theme.scss +2 -2
  102. package/tree/src/tree-theme.scss +2 -2
  103. package/types/daffodil-design-accordion.d.ts +4 -4
  104. package/types/daffodil-design-badge.d.ts +63 -0
  105. package/types/daffodil-design-card.d.ts +2 -2
  106. package/types/daffodil-design-form-field.d.ts +34 -31
  107. package/types/daffodil-design-form.d.ts +2 -2
  108. package/types/daffodil-design-image.d.ts +15 -28
  109. package/types/daffodil-design-list.d.ts +3 -3
  110. package/types/daffodil-design-media-gallery.d.ts +31 -20
  111. package/types/daffodil-design-menu.d.ts +51 -20
  112. package/types/daffodil-design-notification.d.ts +5 -6
  113. package/types/daffodil-design-paginator.d.ts +20 -25
  114. package/types/daffodil-design-progress-bar.d.ts +16 -21
  115. package/types/daffodil-design-spinner.d.ts +2 -2
  116. package/types/daffodil-design-switch.d.ts +7 -8
  117. package/types/daffodil-design-tabs.d.ts +29 -29
  118. package/types/daffodil-design-tag.d.ts +5 -7
  119. package/types/daffodil-design-text-snippet.d.ts +9 -9
  120. package/types/daffodil-design.d.ts +53 -38
  121. package/fesm2022/daffodil-design-loading-icon.mjs +0 -67
  122. package/fesm2022/daffodil-design-loading-icon.mjs.map +0 -1
  123. package/loading-icon/README.md +0 -59
  124. package/loading-icon/src/loading-icon-theme.scss +0 -103
  125. package/scss/theming/illuminate/illuminate.scss +0 -149
  126. package/scss/theming/illuminate/illuminate.spec.scss +0 -15
  127. package/types/daffodil-design-loading-icon.d.ts +0 -31
@@ -1,15 +1,13 @@
1
1
  import { CommonModule } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { EventEmitter, Output, Input, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
4
- import * as i1 from '@angular/router';
5
- import { RouterModule } from '@angular/router';
3
+ import { input, output, computed, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
4
+ import { RouterLink, RouterModule } from '@angular/router';
6
5
  import { FaIconComponent, FontAwesomeModule } from '@fortawesome/angular-fontawesome';
7
6
  import { faChevronRight, faChevronLeft } from '@fortawesome/free-solid-svg-icons';
8
7
 
9
8
  const DaffPaginatorNumberOfPagesErrorMessage = 'The numberOfPages in the daff-paginator must not be less than 1';
10
9
  const DaffPaginatorPageOutOfRangeErrorMessage = 'The numberOfPages in the daff-paginator should not be less than the currentPage';
11
10
 
12
- /* eslint-disable quote-props */
13
11
  const visiblePageRange = 2;
14
12
  class DaffPaginatorComponent {
15
13
  constructor() {
@@ -21,62 +19,71 @@ class DaffPaginatorComponent {
21
19
  * @docs-private
22
20
  */
23
21
  this.faChevronLeft = faChevronLeft;
22
+ /**
23
+ * The total number of pages the paginator tracks. This number can change dynamically, but the end user is responsible for keeping `numberOfPages`
24
+ * and `currentPage` in sync.
25
+ *
26
+ * For example, if the `numberOfPages` is dynamically changed to a value less than the `currentPage`, the paginator will break.
27
+ */
28
+ this.numberOfPages = input.required(...(ngDevMode ? [{ debugName: "numberOfPages" }] : /* istanbul ignore next */ []));
29
+ /**
30
+ * The currently selected page.
31
+ */
32
+ this.currentPage = input.required(...(ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []));
24
33
  /**
25
34
  * Replace the paginator buttons with links. `url` is required if using this mode.
26
35
  */
27
- this.linkMode = false;
36
+ this.linkMode = input(false, ...(ngDevMode ? [{ debugName: "linkMode" }] : /* istanbul ignore next */ []));
37
+ /**
38
+ * The url to which to navigate if the paginator is in link mode.
39
+ * This paginator component will set the page query param.
40
+ */
41
+ this.url = input(...(ngDevMode ? [undefined, { debugName: "url" }] : /* istanbul ignore next */ []));
28
42
  /**
29
43
  * The query param to which the paginator component will set the current page value in link mode.
30
44
  */
31
- this.queryParam = 'page';
45
+ this.queryParam = input('page', ...(ngDevMode ? [{ debugName: "queryParam" }] : /* istanbul ignore next */ []));
32
46
  /**
33
47
  * Emits when the current page changes with the new current page.
34
48
  */
35
- this.notifyPageChange = new EventEmitter();
36
- }
37
- /**
38
- * Determines when ellipsis after the first page number should show.
39
- *
40
- * @docs-private
41
- */
42
- get _showFirstEllipsis() {
43
- return this.currentPage >= visiblePageRange + 2;
44
- }
45
- /**
46
- * Determines when ellipsis before the final page number should show.
47
- *
48
- * @docs-private
49
- */
50
- get _showLastEllipsis() {
51
- return this.currentPage < (this.numberOfPages - visiblePageRange);
52
- }
53
- /**
54
- * Determines when the Previous button should be disabled.
55
- *
56
- * @docs-private
57
- */
58
- get _disablePrev() {
59
- return this.currentPage === 1;
60
- }
61
- /**
62
- * Determines when the Next button should be disabled.
63
- *
64
- * @docs-private
65
- */
66
- get _disableNext() {
67
- return this.currentPage === this.numberOfPages;
68
- }
69
- /**
70
- * @docs-private
71
- */
72
- ngOnChanges() {
73
- if (this.numberOfPages < 1) {
74
- throw new Error(DaffPaginatorNumberOfPagesErrorMessage);
75
- }
76
- else if (this.numberOfPages < this.currentPage) {
77
- throw new Error(DaffPaginatorPageOutOfRangeErrorMessage);
78
- }
79
- this._numberOfPagesArray = this.numberOfPages < 2 ? [] : Array(this.numberOfPages - 2).fill(this.numberOfPages - 2).map((x, i) => i + 2);
49
+ this.notifyPageChange = output();
50
+ /**
51
+ * @docs-private
52
+ */
53
+ this._numberOfPagesArray = computed(() => {
54
+ const numberOfPages = this.numberOfPages();
55
+ if (numberOfPages < 1) {
56
+ throw new Error(DaffPaginatorNumberOfPagesErrorMessage);
57
+ }
58
+ else if (numberOfPages < this.currentPage()) {
59
+ throw new Error(DaffPaginatorPageOutOfRangeErrorMessage);
60
+ }
61
+ return numberOfPages < 2 ? [] : Array(numberOfPages - 2).fill(numberOfPages - 2).map((x, i) => i + 2);
62
+ }, ...(ngDevMode ? [{ debugName: "_numberOfPagesArray" }] : /* istanbul ignore next */ []));
63
+ /**
64
+ * Determines when ellipsis after the first page number should show.
65
+ *
66
+ * @docs-private
67
+ */
68
+ this._showFirstEllipsis = computed(() => this.currentPage() >= visiblePageRange + 2, ...(ngDevMode ? [{ debugName: "_showFirstEllipsis" }] : /* istanbul ignore next */ []));
69
+ /**
70
+ * Determines when ellipsis before the final page number should show.
71
+ *
72
+ * @docs-private
73
+ */
74
+ this._showLastEllipsis = computed(() => this.currentPage() < (this.numberOfPages() - visiblePageRange), ...(ngDevMode ? [{ debugName: "_showLastEllipsis" }] : /* istanbul ignore next */ []));
75
+ /**
76
+ * Determines when the Previous button should be disabled.
77
+ *
78
+ * @docs-private
79
+ */
80
+ this._disablePrev = computed(() => this.currentPage() === 1, ...(ngDevMode ? [{ debugName: "_disablePrev" }] : /* istanbul ignore next */ []));
81
+ /**
82
+ * Determines when the Next button should be disabled.
83
+ *
84
+ * @docs-private
85
+ */
86
+ this._disableNext = computed(() => this.currentPage() === this.numberOfPages(), ...(ngDevMode ? [{ debugName: "_disableNext" }] : /* istanbul ignore next */ []));
80
87
  }
81
88
  /**
82
89
  * Emits the previous page number through notifyPageChange Output.
@@ -84,7 +91,7 @@ class DaffPaginatorComponent {
84
91
  * @docs-private
85
92
  */
86
93
  _onNotifyPrevPageChange() {
87
- this.notifyPageChange.emit(this.currentPage - 1);
94
+ this.notifyPageChange.emit(this.currentPage() - 1);
88
95
  }
89
96
  /**
90
97
  * Emits the next page number through notifyPageChange Output.
@@ -92,7 +99,7 @@ class DaffPaginatorComponent {
92
99
  * @docs-private
93
100
  */
94
101
  _onNotifyNextPageChange() {
95
- this.notifyPageChange.emit(this.currentPage + 1);
102
+ this.notifyPageChange.emit(this.currentPage() + 1);
96
103
  }
97
104
  /**
98
105
  * Emits a pageNumber to notifyPageChange Output.
@@ -108,7 +115,7 @@ class DaffPaginatorComponent {
108
115
  * @docs-private
109
116
  */
110
117
  _isSelected(page) {
111
- return page === this.currentPage;
118
+ return page === this.currentPage();
112
119
  }
113
120
  /**
114
121
  * Determines if the given page number should be shown. The two additional 'or' conditionals are needed
@@ -117,43 +124,31 @@ class DaffPaginatorComponent {
117
124
  * @docs-private
118
125
  */
119
126
  _showNumber(pageNumber) {
120
- return Math.abs(this.currentPage - pageNumber) < visiblePageRange
121
- || (this.currentPage <= visiblePageRange && pageNumber <= 2 * visiblePageRange)
122
- || (this.currentPage > this.numberOfPages - visiblePageRange && pageNumber > this.numberOfPages - 2 * visiblePageRange);
127
+ return Math.abs(this.currentPage() - pageNumber) < visiblePageRange
128
+ || (this.currentPage() <= visiblePageRange && pageNumber <= 2 * visiblePageRange)
129
+ || (this.currentPage() > this.numberOfPages() - visiblePageRange && pageNumber > this.numberOfPages() - 2 * visiblePageRange);
123
130
  }
124
131
  /**
125
132
  * @docs-private
126
133
  */
127
134
  _buildPageQueryParams(page) {
128
135
  return {
129
- [this.queryParam]: page,
136
+ [this.queryParam()]: page,
130
137
  };
131
138
  }
132
139
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
133
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffPaginatorComponent, isStandalone: true, selector: "daff-paginator", inputs: { numberOfPages: "numberOfPages", currentPage: "currentPage", linkMode: "linkMode", url: "url", queryParam: "queryParam" }, outputs: { notifyPageChange: "notifyPageChange" }, host: { attributes: { "role": "navigation" }, classAttribute: "daff-paginator" }, usesOnChanges: true, ngImport: i0, template: "@if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__previous\"\n [disabled]=\"_disablePrev\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Previous Page\"\n (click)=\"_onNotifyPrevPageChange()\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon> Previous\n </button>\n}\n@if (linkMode) {\n @if (!_disablePrev) {\n <a class=\"daff-paginator__previous\"\n attr.aria-label=\"Go to Previous Page\"\n [routerLink]=\"url\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage - 1)\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </a>\n }\n @if (_disablePrev) {\n <span class=\"daff-paginator__previous disabled\"\n attr.aria-label=\"Go to Previous Page\"\n [attr.disabled]=\"true\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </span>\n }\n}\n\n@if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(1)\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page 1\"\n (click)=\"_onNotifyPageChange(1)\">\n <span>1</span>\n </button>\n}\n\n@if (linkMode) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url\"\n [queryParams]=\"_buildPageQueryParams(1)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(1)\"\n attr.aria-label=\"Go to Page 1\">\n <span>1</span>\n </a>\n}\n\n@if (_showFirstEllipsis) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@for (pageNumber of _numberOfPagesArray; track pageNumber) {\n @if (_showNumber(pageNumber)) {\n @if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(pageNumber)\"\n [attr.data-page-number]=\"pageNumber\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page {{pageNumber}}\"\n aria-current=\"_isSelected(pageNumber)\"\n (click)=\"_onNotifyPageChange(pageNumber)\">\n <span>{{ pageNumber }}</span>\n </button>\n }\n @if (linkMode) {\n <a class=\"daff-paginator__page-link\"\n [attr.data-page-number]=\"pageNumber\"\n [routerLink]=\"url\"\n [queryParams]=\"_buildPageQueryParams(pageNumber)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(pageNumber)\"\n attr.aria-label=\"Go to Page {{pageNumber}}\">\n <span>{{ pageNumber }}</span>\n </a>\n }\n }\n}\n\n@if (_showLastEllipsis) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@if (!(numberOfPages < 2)) {\n @if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(numberOfPages)\"\n tabindex=\"0\"\n attr.aria-label=\"Go To Page {{numberOfPages}}\"\n (click)=\"_onNotifyPageChange(numberOfPages)\">\n <span>{{ numberOfPages }}</span>\n </button>\n }\n @if (linkMode) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url\"\n [queryParams]=\"_buildPageQueryParams(numberOfPages)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(numberOfPages)\"\n attr.aria-label=\"Go to Page {{numberOfPages}}\">\n <span>{{ numberOfPages }}</span>\n </a>\n }\n}\n\n@if (!linkMode) {\n <button class=\"daff-paginator__next\"\n [disabled]=\"_disableNext\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Next Page\"\n (click)=\"_onNotifyNextPageChange()\">\n Next <fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </button>\n}\n@if (linkMode) {\n @if (!_disableNext) {\n <a class=\"daff-paginator__next\"\n [routerLink]=\"url\"\n attr.aria-label=\"Go to Next Page\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage + 1)\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </a>\n }\n\n @if (_disableNext) {\n <span class=\"daff-paginator__next disabled\"\n attr.aria-label=\"Go to Next Page\"\n [attr.disabled]=\"true\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </span>\n }\n}\n", styles: [":host{display:flex;gap:.25rem}.daff-paginator__page-link,.daff-paginator__previous,.daff-paginator__next{text-decoration:none}.daff-paginator__previous,.daff-paginator__next{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;appearance:none;background:none;border:0;border-radius:.25rem;gap:.5rem;height:2rem;padding:0 .5rem}.daff-paginator__previous[disabled],.daff-paginator__next[disabled]{cursor:not-allowed;opacity:.5}.daff-paginator__ellipsis{height:2rem;width:2rem;display:flex;align-items:center;justify-content:center}.daff-paginator__page-link{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;appearance:none;background:none;border:0;border-radius:.25rem;min-width:2rem;height:2rem;padding:0 .25rem;position:relative}.daff-paginator__page-link span{z-index:2}.daff-paginator__page-link:after{content:\"\";border-radius:.25rem;position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;transition:opacity .3s}@media(hover:hover){.daff-paginator__page-link:hover:after{opacity:1}}.daff-paginator__page-link:active:after,.daff-paginator__page-link.selected:after{opacity:1}\n"], dependencies: [{ kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
140
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffPaginatorComponent, isStandalone: true, selector: "daff-paginator", inputs: { numberOfPages: { classPropertyName: "numberOfPages", publicName: "numberOfPages", isSignal: true, isRequired: true, transformFunction: null }, currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: true, transformFunction: null }, linkMode: { classPropertyName: "linkMode", publicName: "linkMode", isSignal: true, isRequired: false, transformFunction: null }, url: { classPropertyName: "url", publicName: "url", isSignal: true, isRequired: false, transformFunction: null }, queryParam: { classPropertyName: "queryParam", publicName: "queryParam", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { notifyPageChange: "notifyPageChange" }, host: { attributes: { "role": "navigation" }, classAttribute: "daff-paginator" }, ngImport: i0, template: "@if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__previous\"\n [disabled]=\"_disablePrev()\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Previous Page\"\n (click)=\"_onNotifyPrevPageChange()\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon> Previous\n </button>\n}\n@if (linkMode()) {\n @if (!_disablePrev()) {\n <a class=\"daff-paginator__previous\"\n attr.aria-label=\"Go to Previous Page\"\n [routerLink]=\"url()\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage() - 1)\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </a>\n }\n @if (_disablePrev()) {\n <span class=\"daff-paginator__previous disabled\"\n attr.aria-label=\"Go to Previous Page\"\n [attr.disabled]=\"true\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </span>\n }\n}\n\n@if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(1)\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page 1\"\n (click)=\"_onNotifyPageChange(1)\">\n <span>1</span>\n </button>\n}\n\n@if (linkMode()) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url()\"\n [queryParams]=\"_buildPageQueryParams(1)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(1)\"\n attr.aria-label=\"Go to Page 1\">\n <span>1</span>\n </a>\n}\n\n@if (_showFirstEllipsis()) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@for (pageNumber of _numberOfPagesArray(); track pageNumber) {\n @if (_showNumber(pageNumber)) {\n @if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(pageNumber)\"\n [attr.data-page-number]=\"pageNumber\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page {{pageNumber}}\"\n aria-current=\"_isSelected(pageNumber)\"\n (click)=\"_onNotifyPageChange(pageNumber)\">\n <span>{{ pageNumber }}</span>\n </button>\n }\n @if (linkMode()) {\n <a class=\"daff-paginator__page-link\"\n [attr.data-page-number]=\"pageNumber\"\n [routerLink]=\"url()\"\n [queryParams]=\"_buildPageQueryParams(pageNumber)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(pageNumber)\"\n attr.aria-label=\"Go to Page {{pageNumber}}\">\n <span>{{ pageNumber }}</span>\n </a>\n }\n }\n}\n\n@if (_showLastEllipsis()) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@if (!(numberOfPages() < 2)) {\n @if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(numberOfPages())\"\n tabindex=\"0\"\n attr.aria-label=\"Go To Page {{numberOfPages()}}\"\n (click)=\"_onNotifyPageChange(numberOfPages())\">\n <span>{{ numberOfPages() }}</span>\n </button>\n }\n @if (linkMode()) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url()\"\n [queryParams]=\"_buildPageQueryParams(numberOfPages())\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(numberOfPages())\"\n attr.aria-label=\"Go to Page {{numberOfPages()}}\">\n <span>{{ numberOfPages() }}</span>\n </a>\n }\n}\n\n@if (!linkMode()) {\n <button class=\"daff-paginator__next\"\n [disabled]=\"_disableNext()\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Next Page\"\n (click)=\"_onNotifyNextPageChange()\">\n Next <fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </button>\n}\n@if (linkMode()) {\n @if (!_disableNext()) {\n <a class=\"daff-paginator__next\"\n [routerLink]=\"url()\"\n attr.aria-label=\"Go to Next Page\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage() + 1)\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </a>\n }\n\n @if (_disableNext()) {\n <span class=\"daff-paginator__next disabled\"\n attr.aria-label=\"Go to Next Page\"\n [attr.disabled]=\"true\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </span>\n }\n}\n", styles: [":host{display:flex;gap:.25rem}.daff-paginator__page-link,.daff-paginator__previous,.daff-paginator__next{text-decoration:none}.daff-paginator__previous,.daff-paginator__next{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;appearance:none;background:none;border:0;border-radius:.25rem;gap:.5rem;height:2rem;padding:0 .5rem}.daff-paginator__previous[disabled],.daff-paginator__next[disabled]{cursor:not-allowed;opacity:.5}.daff-paginator__ellipsis{height:2rem;width:2rem;display:flex;align-items:center;justify-content:center}.daff-paginator__page-link{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;appearance:none;background:none;border:0;border-radius:.25rem;min-width:2rem;height:2rem;padding:0 .25rem;position:relative}.daff-paginator__page-link span{z-index:2}.daff-paginator__page-link:after{content:\"\";border-radius:.25rem;position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;transition:opacity .3s}@media(hover:hover){.daff-paginator__page-link:hover:after{opacity:1}}.daff-paginator__page-link:active:after,.daff-paginator__page-link.selected:after{opacity:1}\n"], dependencies: [{ kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
134
141
  }
135
142
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPaginatorComponent, decorators: [{
136
143
  type: Component,
137
144
  args: [{ selector: 'daff-paginator', changeDetection: ChangeDetectionStrategy.OnPush, host: {
138
- 'class': 'daff-paginator',
139
- 'role': 'navigation',
145
+ class: 'daff-paginator',
146
+ role: 'navigation',
140
147
  }, imports: [
141
148
  FaIconComponent,
142
- RouterModule,
143
- ], template: "@if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__previous\"\n [disabled]=\"_disablePrev\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Previous Page\"\n (click)=\"_onNotifyPrevPageChange()\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon> Previous\n </button>\n}\n@if (linkMode) {\n @if (!_disablePrev) {\n <a class=\"daff-paginator__previous\"\n attr.aria-label=\"Go to Previous Page\"\n [routerLink]=\"url\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage - 1)\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </a>\n }\n @if (_disablePrev) {\n <span class=\"daff-paginator__previous disabled\"\n attr.aria-label=\"Go to Previous Page\"\n [attr.disabled]=\"true\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </span>\n }\n}\n\n@if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(1)\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page 1\"\n (click)=\"_onNotifyPageChange(1)\">\n <span>1</span>\n </button>\n}\n\n@if (linkMode) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url\"\n [queryParams]=\"_buildPageQueryParams(1)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(1)\"\n attr.aria-label=\"Go to Page 1\">\n <span>1</span>\n </a>\n}\n\n@if (_showFirstEllipsis) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@for (pageNumber of _numberOfPagesArray; track pageNumber) {\n @if (_showNumber(pageNumber)) {\n @if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(pageNumber)\"\n [attr.data-page-number]=\"pageNumber\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page {{pageNumber}}\"\n aria-current=\"_isSelected(pageNumber)\"\n (click)=\"_onNotifyPageChange(pageNumber)\">\n <span>{{ pageNumber }}</span>\n </button>\n }\n @if (linkMode) {\n <a class=\"daff-paginator__page-link\"\n [attr.data-page-number]=\"pageNumber\"\n [routerLink]=\"url\"\n [queryParams]=\"_buildPageQueryParams(pageNumber)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(pageNumber)\"\n attr.aria-label=\"Go to Page {{pageNumber}}\">\n <span>{{ pageNumber }}</span>\n </a>\n }\n }\n}\n\n@if (_showLastEllipsis) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@if (!(numberOfPages < 2)) {\n @if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(numberOfPages)\"\n tabindex=\"0\"\n attr.aria-label=\"Go To Page {{numberOfPages}}\"\n (click)=\"_onNotifyPageChange(numberOfPages)\">\n <span>{{ numberOfPages }}</span>\n </button>\n }\n @if (linkMode) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url\"\n [queryParams]=\"_buildPageQueryParams(numberOfPages)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(numberOfPages)\"\n attr.aria-label=\"Go to Page {{numberOfPages}}\">\n <span>{{ numberOfPages }}</span>\n </a>\n }\n}\n\n@if (!linkMode) {\n <button class=\"daff-paginator__next\"\n [disabled]=\"_disableNext\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Next Page\"\n (click)=\"_onNotifyNextPageChange()\">\n Next <fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </button>\n}\n@if (linkMode) {\n @if (!_disableNext) {\n <a class=\"daff-paginator__next\"\n [routerLink]=\"url\"\n attr.aria-label=\"Go to Next Page\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage + 1)\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </a>\n }\n\n @if (_disableNext) {\n <span class=\"daff-paginator__next disabled\"\n attr.aria-label=\"Go to Next Page\"\n [attr.disabled]=\"true\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </span>\n }\n}\n", styles: [":host{display:flex;gap:.25rem}.daff-paginator__page-link,.daff-paginator__previous,.daff-paginator__next{text-decoration:none}.daff-paginator__previous,.daff-paginator__next{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;appearance:none;background:none;border:0;border-radius:.25rem;gap:.5rem;height:2rem;padding:0 .5rem}.daff-paginator__previous[disabled],.daff-paginator__next[disabled]{cursor:not-allowed;opacity:.5}.daff-paginator__ellipsis{height:2rem;width:2rem;display:flex;align-items:center;justify-content:center}.daff-paginator__page-link{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;appearance:none;background:none;border:0;border-radius:.25rem;min-width:2rem;height:2rem;padding:0 .25rem;position:relative}.daff-paginator__page-link span{z-index:2}.daff-paginator__page-link:after{content:\"\";border-radius:.25rem;position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;transition:opacity .3s}@media(hover:hover){.daff-paginator__page-link:hover:after{opacity:1}}.daff-paginator__page-link:active:after,.daff-paginator__page-link.selected:after{opacity:1}\n"] }]
144
- }], propDecorators: { numberOfPages: [{
145
- type: Input
146
- }], currentPage: [{
147
- type: Input
148
- }], linkMode: [{
149
- type: Input
150
- }], url: [{
151
- type: Input
152
- }], queryParam: [{
153
- type: Input
154
- }], notifyPageChange: [{
155
- type: Output
156
- }] } });
149
+ RouterLink,
150
+ ], template: "@if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__previous\"\n [disabled]=\"_disablePrev()\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Previous Page\"\n (click)=\"_onNotifyPrevPageChange()\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon> Previous\n </button>\n}\n@if (linkMode()) {\n @if (!_disablePrev()) {\n <a class=\"daff-paginator__previous\"\n attr.aria-label=\"Go to Previous Page\"\n [routerLink]=\"url()\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage() - 1)\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </a>\n }\n @if (_disablePrev()) {\n <span class=\"daff-paginator__previous disabled\"\n attr.aria-label=\"Go to Previous Page\"\n [attr.disabled]=\"true\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </span>\n }\n}\n\n@if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(1)\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page 1\"\n (click)=\"_onNotifyPageChange(1)\">\n <span>1</span>\n </button>\n}\n\n@if (linkMode()) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url()\"\n [queryParams]=\"_buildPageQueryParams(1)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(1)\"\n attr.aria-label=\"Go to Page 1\">\n <span>1</span>\n </a>\n}\n\n@if (_showFirstEllipsis()) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@for (pageNumber of _numberOfPagesArray(); track pageNumber) {\n @if (_showNumber(pageNumber)) {\n @if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(pageNumber)\"\n [attr.data-page-number]=\"pageNumber\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page {{pageNumber}}\"\n aria-current=\"_isSelected(pageNumber)\"\n (click)=\"_onNotifyPageChange(pageNumber)\">\n <span>{{ pageNumber }}</span>\n </button>\n }\n @if (linkMode()) {\n <a class=\"daff-paginator__page-link\"\n [attr.data-page-number]=\"pageNumber\"\n [routerLink]=\"url()\"\n [queryParams]=\"_buildPageQueryParams(pageNumber)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(pageNumber)\"\n attr.aria-label=\"Go to Page {{pageNumber}}\">\n <span>{{ pageNumber }}</span>\n </a>\n }\n }\n}\n\n@if (_showLastEllipsis()) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@if (!(numberOfPages() < 2)) {\n @if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(numberOfPages())\"\n tabindex=\"0\"\n attr.aria-label=\"Go To Page {{numberOfPages()}}\"\n (click)=\"_onNotifyPageChange(numberOfPages())\">\n <span>{{ numberOfPages() }}</span>\n </button>\n }\n @if (linkMode()) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url()\"\n [queryParams]=\"_buildPageQueryParams(numberOfPages())\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(numberOfPages())\"\n attr.aria-label=\"Go to Page {{numberOfPages()}}\">\n <span>{{ numberOfPages() }}</span>\n </a>\n }\n}\n\n@if (!linkMode()) {\n <button class=\"daff-paginator__next\"\n [disabled]=\"_disableNext()\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Next Page\"\n (click)=\"_onNotifyNextPageChange()\">\n Next <fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </button>\n}\n@if (linkMode()) {\n @if (!_disableNext()) {\n <a class=\"daff-paginator__next\"\n [routerLink]=\"url()\"\n attr.aria-label=\"Go to Next Page\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage() + 1)\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </a>\n }\n\n @if (_disableNext()) {\n <span class=\"daff-paginator__next disabled\"\n attr.aria-label=\"Go to Next Page\"\n [attr.disabled]=\"true\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </span>\n }\n}\n", styles: [":host{display:flex;gap:.25rem}.daff-paginator__page-link,.daff-paginator__previous,.daff-paginator__next{text-decoration:none}.daff-paginator__previous,.daff-paginator__next{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;appearance:none;background:none;border:0;border-radius:.25rem;gap:.5rem;height:2rem;padding:0 .5rem}.daff-paginator__previous[disabled],.daff-paginator__next[disabled]{cursor:not-allowed;opacity:.5}.daff-paginator__ellipsis{height:2rem;width:2rem;display:flex;align-items:center;justify-content:center}.daff-paginator__page-link{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;appearance:none;background:none;border:0;border-radius:.25rem;min-width:2rem;height:2rem;padding:0 .25rem;position:relative}.daff-paginator__page-link span{z-index:2}.daff-paginator__page-link:after{content:\"\";border-radius:.25rem;position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;transition:opacity .3s}@media(hover:hover){.daff-paginator__page-link:hover:after{opacity:1}}.daff-paginator__page-link:active:after,.daff-paginator__page-link.selected:after{opacity:1}\n"] }]
151
+ }], propDecorators: { numberOfPages: [{ type: i0.Input, args: [{ isSignal: true, alias: "numberOfPages", required: true }] }], currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: true }] }], linkMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "linkMode", required: false }] }], url: [{ type: i0.Input, args: [{ isSignal: true, alias: "url", required: false }] }], queryParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParam", required: false }] }], notifyPageChange: [{ type: i0.Output, args: ["notifyPageChange"] }] } });
157
152
 
158
153
  /**
159
154
  * @deprecated in favor of {@link DAFF_PAGINATOR_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-design-paginator.mjs","sources":["../../../libs/design/paginator/src/utils/paginator-errors.ts","../../../libs/design/paginator/src/paginator/paginator.component.ts","../../../libs/design/paginator/src/paginator/paginator.component.html","../../../libs/design/paginator/src/paginator.module.ts","../../../libs/design/paginator/src/paginator.ts","../../../libs/design/paginator/src/daffodil-design-paginator.ts"],"sourcesContent":["export const DaffPaginatorNumberOfPagesErrorMessage = 'The numberOfPages in the daff-paginator must not be less than 1';\nexport const DaffPaginatorPageOutOfRangeErrorMessage = 'The numberOfPages in the daff-paginator should not be less than the currentPage';\n","/* eslint-disable quote-props */\nimport {\n Component,\n Input,\n Output,\n EventEmitter,\n OnChanges,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport {\n Params,\n RouterModule,\n} from '@angular/router';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faChevronRight,\n faChevronLeft,\n} from '@fortawesome/free-solid-svg-icons';\n\nimport {\n DaffPaginatorNumberOfPagesErrorMessage,\n DaffPaginatorPageOutOfRangeErrorMessage,\n} from '../utils/paginator-errors';\n\nconst visiblePageRange = 2;\n\n@Component({\n selector: 'daff-paginator',\n styleUrls: ['./paginator.component.scss'],\n templateUrl: './paginator.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'class': 'daff-paginator',\n 'role': 'navigation',\n },\n imports: [\n FaIconComponent,\n RouterModule,\n ],\n})\nexport class DaffPaginatorComponent implements OnChanges {\n /**\n * @docs-private\n */\n faChevronRight = faChevronRight;\n /**\n * @docs-private\n */\n faChevronLeft = faChevronLeft;\n\n /**\n * The total number of pages the paginator tracks. This number can change dynamically, but the end user is responsible for keeping `numberOfPages`\n * and `currentPage` in sync.\n *\n * For example, if the `numberOfPages` is dynamically changed to a value less than the `currentPage`, the paginator will break.\n */\n @Input() numberOfPages: number;\n\n /**\n * The currently selected page.\n */\n @Input() currentPage: number;\n\n /**\n * Replace the paginator buttons with links. `url` is required if using this mode.\n */\n @Input() linkMode = false;\n\n /**\n * The url to which to navigate if the paginator is in link mode.\n * This paginator component will set the page query param.\n */\n @Input() url?: string;\n\n /**\n * The query param to which the paginator component will set the current page value in link mode.\n */\n @Input() queryParam = 'page';\n\n /**\n * @docs-private\n */\n _numberOfPagesArray: number[];\n\n /**\n * Emits when the current page changes with the new current page.\n */\n @Output() notifyPageChange: EventEmitter<any> = new EventEmitter();\n\n /**\n * Determines when ellipsis after the first page number should show.\n *\n * @docs-private\n */\n get _showFirstEllipsis(): boolean {\n return this.currentPage >= visiblePageRange+2;\n }\n\n /**\n * Determines when ellipsis before the final page number should show.\n *\n * @docs-private\n */\n get _showLastEllipsis(): boolean {\n return this.currentPage < (this.numberOfPages - visiblePageRange);\n }\n\n /**\n * Determines when the Previous button should be disabled.\n *\n * @docs-private\n */\n get _disablePrev(): boolean {\n return this.currentPage === 1;\n }\n\n /**\n * Determines when the Next button should be disabled.\n *\n * @docs-private\n */\n get _disableNext(): boolean {\n return this.currentPage === this.numberOfPages;\n }\n\n /**\n * @docs-private\n */\n ngOnChanges() {\n if(this.numberOfPages < 1) {\n throw new Error(DaffPaginatorNumberOfPagesErrorMessage);\n } else if(this.numberOfPages < this.currentPage) {\n throw new Error(DaffPaginatorPageOutOfRangeErrorMessage);\n }\n\n this._numberOfPagesArray = this.numberOfPages < 2 ? [] : Array(this.numberOfPages-2).fill(this.numberOfPages-2).map((x,i)=>i+2);\n }\n\n /**\n * Emits the previous page number through notifyPageChange Output.\n *\n * @docs-private\n */\n _onNotifyPrevPageChange() {\n this.notifyPageChange.emit(this.currentPage - 1);\n }\n\n /**\n * Emits the next page number through notifyPageChange Output.\n *\n * @docs-private\n */\n _onNotifyNextPageChange() {\n this.notifyPageChange.emit(this.currentPage + 1);\n }\n\n /**\n * Emits a pageNumber to notifyPageChange Output.\n *\n * @docs-private\n */\n _onNotifyPageChange(pageNumber: number) {\n this.notifyPageChange.emit(pageNumber);\n }\n\n /**\n * A simple function that determines if the given page number is the current page number.\n *\n * @docs-private\n */\n _isSelected(page: number): boolean {\n return page === this.currentPage;\n }\n\n /**\n * Determines if the given page number should be shown. The two additional 'or' conditionals are needed\n * so the paginator retains the same total width at the extreme page numbers (1 and numberOfPages).\n *\n * @docs-private\n */\n _showNumber(pageNumber: number): boolean {\n return Math.abs(this.currentPage - pageNumber) < visiblePageRange\n || (this.currentPage <= visiblePageRange && pageNumber <= 2*visiblePageRange)\n || (this.currentPage > this.numberOfPages - visiblePageRange && pageNumber > this.numberOfPages - 2*visiblePageRange);\n }\n\n /**\n * @docs-private\n */\n _buildPageQueryParams(page: number): Params {\n return {\n [this.queryParam]: page,\n };\n }\n}\n","@if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__previous\"\n [disabled]=\"_disablePrev\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Previous Page\"\n (click)=\"_onNotifyPrevPageChange()\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon> Previous\n </button>\n}\n@if (linkMode) {\n @if (!_disablePrev) {\n <a class=\"daff-paginator__previous\"\n attr.aria-label=\"Go to Previous Page\"\n [routerLink]=\"url\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage - 1)\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </a>\n }\n @if (_disablePrev) {\n <span class=\"daff-paginator__previous disabled\"\n attr.aria-label=\"Go to Previous Page\"\n [attr.disabled]=\"true\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </span>\n }\n}\n\n@if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(1)\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page 1\"\n (click)=\"_onNotifyPageChange(1)\">\n <span>1</span>\n </button>\n}\n\n@if (linkMode) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url\"\n [queryParams]=\"_buildPageQueryParams(1)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(1)\"\n attr.aria-label=\"Go to Page 1\">\n <span>1</span>\n </a>\n}\n\n@if (_showFirstEllipsis) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@for (pageNumber of _numberOfPagesArray; track pageNumber) {\n @if (_showNumber(pageNumber)) {\n @if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(pageNumber)\"\n [attr.data-page-number]=\"pageNumber\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page {{pageNumber}}\"\n aria-current=\"_isSelected(pageNumber)\"\n (click)=\"_onNotifyPageChange(pageNumber)\">\n <span>{{ pageNumber }}</span>\n </button>\n }\n @if (linkMode) {\n <a class=\"daff-paginator__page-link\"\n [attr.data-page-number]=\"pageNumber\"\n [routerLink]=\"url\"\n [queryParams]=\"_buildPageQueryParams(pageNumber)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(pageNumber)\"\n attr.aria-label=\"Go to Page {{pageNumber}}\">\n <span>{{ pageNumber }}</span>\n </a>\n }\n }\n}\n\n@if (_showLastEllipsis) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@if (!(numberOfPages < 2)) {\n @if (!linkMode) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(numberOfPages)\"\n tabindex=\"0\"\n attr.aria-label=\"Go To Page {{numberOfPages}}\"\n (click)=\"_onNotifyPageChange(numberOfPages)\">\n <span>{{ numberOfPages }}</span>\n </button>\n }\n @if (linkMode) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url\"\n [queryParams]=\"_buildPageQueryParams(numberOfPages)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(numberOfPages)\"\n attr.aria-label=\"Go to Page {{numberOfPages}}\">\n <span>{{ numberOfPages }}</span>\n </a>\n }\n}\n\n@if (!linkMode) {\n <button class=\"daff-paginator__next\"\n [disabled]=\"_disableNext\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Next Page\"\n (click)=\"_onNotifyNextPageChange()\">\n Next <fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </button>\n}\n@if (linkMode) {\n @if (!_disableNext) {\n <a class=\"daff-paginator__next\"\n [routerLink]=\"url\"\n attr.aria-label=\"Go to Next Page\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage + 1)\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </a>\n }\n\n @if (_disableNext) {\n <span class=\"daff-paginator__next disabled\"\n attr.aria-label=\"Go to Next Page\"\n [attr.disabled]=\"true\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </span>\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\n\nimport { DaffPaginatorComponent } from './paginator/paginator.component';\n\n/**\n * @deprecated in favor of {@link DAFF_PAGINATOR_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n RouterModule,\n FontAwesomeModule,\n DaffPaginatorComponent,\n ],\n exports: [\n DaffPaginatorComponent,\n ],\n})\nexport class DaffPaginatorModule {}\n","import { DaffPaginatorComponent } from './paginator/paginator.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_PAGINATOR_COMPONENTS = <const> [\n DaffPaginatorComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAO,MAAM,sCAAsC,GAAG,iEAAiE;AAChH,MAAM,uCAAuC,GAAG,iFAAiF;;ACDxI;AAwBA,MAAM,gBAAgB,GAAG,CAAC;MAgBb,sBAAsB,CAAA;AAdnC,IAAA,WAAA,GAAA;AAeE;;AAEG;QACH,IAAA,CAAA,cAA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KA;;sBAUA;;;AEhFH;;AAEG;MAYU,mBAAmB,CAAA;iIAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAnB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAT5B,YAAY;YACZ,YAAY;YACZ,iBAAiB;AACjB,YAAA,sBAAsB,aAGtB,sBAAsB,CAAA,EAAA,CAAA,CAAA;AAGb,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAT5B,YAAY;YACZ,YAAY;YACZ,iBAAiB;YACjB,sBAAsB,CAAA,EAAA,CAAA,CAAA;;2FAMb,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAX/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,YAAY;wBACZ,iBAAiB;wBACjB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,sBAAsB;AACvB,qBAAA;AACF,iBAAA;;;AClBD;;AAEG;AACI,MAAM,yBAAyB,GAAW;IAC/C,sBAAsB;;;ACNxB;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-design-paginator.mjs","sources":["../../../libs/design/paginator/src/utils/paginator-errors.ts","../../../libs/design/paginator/src/paginator/paginator.component.ts","../../../libs/design/paginator/src/paginator/paginator.component.html","../../../libs/design/paginator/src/paginator.module.ts","../../../libs/design/paginator/src/paginator.ts","../../../libs/design/paginator/src/daffodil-design-paginator.ts"],"sourcesContent":["export const DaffPaginatorNumberOfPagesErrorMessage = 'The numberOfPages in the daff-paginator must not be less than 1';\nexport const DaffPaginatorPageOutOfRangeErrorMessage = 'The numberOfPages in the daff-paginator should not be less than the currentPage';\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n output,\n computed,\n} from '@angular/core';\nimport {\n Params,\n RouterLink,\n} from '@angular/router';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faChevronRight,\n faChevronLeft,\n} from '@fortawesome/free-solid-svg-icons';\n\nimport {\n DaffPaginatorNumberOfPagesErrorMessage,\n DaffPaginatorPageOutOfRangeErrorMessage,\n} from '../utils/paginator-errors';\n\nconst visiblePageRange = 2;\n\n@Component({\n selector: 'daff-paginator',\n templateUrl: './paginator.component.html',\n styleUrl: './paginator.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'daff-paginator',\n role: 'navigation',\n },\n imports: [\n FaIconComponent,\n RouterLink,\n ],\n})\nexport class DaffPaginatorComponent {\n /**\n * @docs-private\n */\n faChevronRight = faChevronRight;\n /**\n * @docs-private\n */\n faChevronLeft = faChevronLeft;\n\n /**\n * The total number of pages the paginator tracks. This number can change dynamically, but the end user is responsible for keeping `numberOfPages`\n * and `currentPage` in sync.\n *\n * For example, if the `numberOfPages` is dynamically changed to a value less than the `currentPage`, the paginator will break.\n */\n numberOfPages = input.required<number>();\n\n /**\n * The currently selected page.\n */\n currentPage = input.required<number>();\n\n /**\n * Replace the paginator buttons with links. `url` is required if using this mode.\n */\n linkMode = input(false);\n\n /**\n * The url to which to navigate if the paginator is in link mode.\n * This paginator component will set the page query param.\n */\n url = input<string>();\n\n /**\n * The query param to which the paginator component will set the current page value in link mode.\n */\n queryParam = input('page');\n\n /**\n * Emits when the current page changes with the new current page.\n */\n notifyPageChange = output<any>();\n\n /**\n * @docs-private\n */\n _numberOfPagesArray = computed<number[]>(() => {\n const numberOfPages = this.numberOfPages();\n\n if(numberOfPages < 1) {\n throw new Error(DaffPaginatorNumberOfPagesErrorMessage);\n } else if(numberOfPages < this.currentPage()) {\n throw new Error(DaffPaginatorPageOutOfRangeErrorMessage);\n }\n\n return numberOfPages < 2 ? [] : Array(numberOfPages-2).fill(numberOfPages-2).map((x,i)=>i+2);\n });\n\n /**\n * Determines when ellipsis after the first page number should show.\n *\n * @docs-private\n */\n _showFirstEllipsis = computed<boolean>(() => this.currentPage() >= visiblePageRange+2);\n\n /**\n * Determines when ellipsis before the final page number should show.\n *\n * @docs-private\n */\n _showLastEllipsis = computed<boolean>(() => this.currentPage() < (this.numberOfPages() - visiblePageRange));\n\n /**\n * Determines when the Previous button should be disabled.\n *\n * @docs-private\n */\n _disablePrev = computed<boolean>(() => this.currentPage() === 1);\n\n /**\n * Determines when the Next button should be disabled.\n *\n * @docs-private\n */\n _disableNext = computed<boolean>(() => this.currentPage() === this.numberOfPages());\n\n /**\n * Emits the previous page number through notifyPageChange Output.\n *\n * @docs-private\n */\n _onNotifyPrevPageChange() {\n this.notifyPageChange.emit(this.currentPage() - 1);\n }\n\n /**\n * Emits the next page number through notifyPageChange Output.\n *\n * @docs-private\n */\n _onNotifyNextPageChange() {\n this.notifyPageChange.emit(this.currentPage() + 1);\n }\n\n /**\n * Emits a pageNumber to notifyPageChange Output.\n *\n * @docs-private\n */\n _onNotifyPageChange(pageNumber: number) {\n this.notifyPageChange.emit(pageNumber);\n }\n\n /**\n * A simple function that determines if the given page number is the current page number.\n *\n * @docs-private\n */\n _isSelected(page: number): boolean {\n return page === this.currentPage();\n }\n\n /**\n * Determines if the given page number should be shown. The two additional 'or' conditionals are needed\n * so the paginator retains the same total width at the extreme page numbers (1 and numberOfPages).\n *\n * @docs-private\n */\n _showNumber(pageNumber: number): boolean {\n return Math.abs(this.currentPage() - pageNumber) < visiblePageRange\n || (this.currentPage() <= visiblePageRange && pageNumber <= 2*visiblePageRange)\n || (this.currentPage() > this.numberOfPages() - visiblePageRange && pageNumber > this.numberOfPages() - 2*visiblePageRange);\n }\n\n /**\n * @docs-private\n */\n _buildPageQueryParams(page: number): Params {\n return {\n [this.queryParam()]: page,\n };\n }\n}\n","@if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__previous\"\n [disabled]=\"_disablePrev()\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Previous Page\"\n (click)=\"_onNotifyPrevPageChange()\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon> Previous\n </button>\n}\n@if (linkMode()) {\n @if (!_disablePrev()) {\n <a class=\"daff-paginator__previous\"\n attr.aria-label=\"Go to Previous Page\"\n [routerLink]=\"url()\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage() - 1)\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </a>\n }\n @if (_disablePrev()) {\n <span class=\"daff-paginator__previous disabled\"\n attr.aria-label=\"Go to Previous Page\"\n [attr.disabled]=\"true\">\n <fa-icon [icon]=\"faChevronLeft\" size=\"sm\"></fa-icon><span>Previous</span>\n </span>\n }\n}\n\n@if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(1)\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page 1\"\n (click)=\"_onNotifyPageChange(1)\">\n <span>1</span>\n </button>\n}\n\n@if (linkMode()) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url()\"\n [queryParams]=\"_buildPageQueryParams(1)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(1)\"\n attr.aria-label=\"Go to Page 1\">\n <span>1</span>\n </a>\n}\n\n@if (_showFirstEllipsis()) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@for (pageNumber of _numberOfPagesArray(); track pageNumber) {\n @if (_showNumber(pageNumber)) {\n @if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(pageNumber)\"\n [attr.data-page-number]=\"pageNumber\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Page {{pageNumber}}\"\n aria-current=\"_isSelected(pageNumber)\"\n (click)=\"_onNotifyPageChange(pageNumber)\">\n <span>{{ pageNumber }}</span>\n </button>\n }\n @if (linkMode()) {\n <a class=\"daff-paginator__page-link\"\n [attr.data-page-number]=\"pageNumber\"\n [routerLink]=\"url()\"\n [queryParams]=\"_buildPageQueryParams(pageNumber)\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(pageNumber)\"\n attr.aria-label=\"Go to Page {{pageNumber}}\">\n <span>{{ pageNumber }}</span>\n </a>\n }\n }\n}\n\n@if (_showLastEllipsis()) {\n <span class=\"daff-paginator__ellipsis\">...</span>\n}\n\n@if (!(numberOfPages() < 2)) {\n @if (!linkMode()) {\n <button type=\"button\" class=\"daff-paginator__page-link\"\n [class.selected]=\"_isSelected(numberOfPages())\"\n tabindex=\"0\"\n attr.aria-label=\"Go To Page {{numberOfPages()}}\"\n (click)=\"_onNotifyPageChange(numberOfPages())\">\n <span>{{ numberOfPages() }}</span>\n </button>\n }\n @if (linkMode()) {\n <a class=\"daff-paginator__page-link\"\n [routerLink]=\"url()\"\n [queryParams]=\"_buildPageQueryParams(numberOfPages())\"\n queryParamsHandling=\"merge\"\n [class.selected]=\"_isSelected(numberOfPages())\"\n attr.aria-label=\"Go to Page {{numberOfPages()}}\">\n <span>{{ numberOfPages() }}</span>\n </a>\n }\n}\n\n@if (!linkMode()) {\n <button class=\"daff-paginator__next\"\n [disabled]=\"_disableNext()\"\n tabindex=\"0\"\n attr.aria-label=\"Go to Next Page\"\n (click)=\"_onNotifyNextPageChange()\">\n Next <fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </button>\n}\n@if (linkMode()) {\n @if (!_disableNext()) {\n <a class=\"daff-paginator__next\"\n [routerLink]=\"url()\"\n attr.aria-label=\"Go to Next Page\"\n queryParamsHandling=\"merge\"\n [queryParams]=\"_buildPageQueryParams(currentPage() + 1)\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </a>\n }\n\n @if (_disableNext()) {\n <span class=\"daff-paginator__next disabled\"\n attr.aria-label=\"Go to Next Page\"\n [attr.disabled]=\"true\">\n <span>Next</span><fa-icon [icon]=\"faChevronRight\" size=\"sm\"></fa-icon>\n </span>\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\n\nimport { DaffPaginatorComponent } from './paginator/paginator.component';\n\n/**\n * @deprecated in favor of {@link DAFF_PAGINATOR_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n RouterModule,\n FontAwesomeModule,\n DaffPaginatorComponent,\n ],\n exports: [\n DaffPaginatorComponent,\n ],\n})\nexport class DaffPaginatorModule {}\n","import { DaffPaginatorComponent } from './paginator/paginator.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_PAGINATOR_COMPONENTS = <const> [\n DaffPaginatorComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAO,MAAM,sCAAsC,GAAG,iEAAiE;AAChH,MAAM,uCAAuC,GAAG,iFAAiF;;ACqBxI,MAAM,gBAAgB,GAAG,CAAC;MAgBb,sBAAsB,CAAA;AAdnC,IAAA,WAAA,GAAA;AAeE;;AAEG;QACH,IAAA,CAAA,cAAc,GAAG,cAAc;AAC/B;;AAEG;QACH,IAAA,CAAA,aAAa,GAAG,aAAa;AAE7B;;;;;AAKG;AACH,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,mFAAU;AAExC;;AAEG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,iFAAU;AAEtC;;AAEG;AACH,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,+EAAC;AAEvB;;;AAGG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AAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAT5B,YAAY;YACZ,YAAY;YACZ,iBAAiB;YACjB,sBAAsB,CAAA,EAAA,CAAA,CAAA;;2FAMb,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAX/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,YAAY;wBACZ,iBAAiB;wBACjB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,sBAAsB;AACvB,qBAAA;AACF,iBAAA;;;AClBD;;AAEG;AACI,MAAM,yBAAyB,GAAW;IAC/C,sBAAsB;;;ACNxB;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { CommonModule } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { Directive, EventEmitter, booleanAttribute, Output, Input, ContentChild, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
3
+ import { Directive, contentChild, input, computed, booleanAttribute, output, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
4
4
  import * as i1 from '@daffodil/design';
5
5
  import { DaffColorableDirective } from '@daffodil/design';
6
6
 
@@ -37,10 +37,29 @@ let daffProgressBarId = 0;
37
37
  * ```
38
38
  */
39
39
  class DaffProgressBarComponent {
40
- constructor(_changeDetectorRef, colorable) {
41
- this._changeDetectorRef = _changeDetectorRef;
40
+ constructor(colorable) {
42
41
  this.colorable = colorable;
43
- this._percentage = 0;
42
+ /**
43
+ * @docs-private
44
+ */
45
+ this._label = contentChild(DaffProgressBarLabelDirective, ...(ngDevMode ? [{ debugName: "_label" }] : /* istanbul ignore next */ []));
46
+ /**
47
+ * Sets the percentage completion of the progression,
48
+ * expressed as a whole number between 0 and 100.
49
+ */
50
+ this.percentage = input(0, { ...(ngDevMode ? { debugName: "percentage" } : /* istanbul ignore next */ {}), transform: (val) => clamp(val, 0, 100) });
51
+ /**
52
+ * @docs-private
53
+ */
54
+ this.ariaValueNow = computed(() => this.indeterminate() ? null : this.percentage(), ...(ngDevMode ? [{ debugName: "ariaValueNow" }] : /* istanbul ignore next */ []));
55
+ /**
56
+ * @docs-private
57
+ */
58
+ this.ariaLabelledBy = computed(() => {
59
+ if (!this.ariaLabel() && this.id) {
60
+ return this.id;
61
+ }
62
+ }, ...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
44
63
  /**
45
64
  * @docs-private
46
65
  *
@@ -50,54 +69,28 @@ class DaffProgressBarComponent {
50
69
  /**
51
70
  * An `aria-label` for the progress bar.
52
71
  */
53
- this.ariaLabel = '';
72
+ this.ariaLabel = input('', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
54
73
  /**
55
74
  * Property to set the animation of a progress bar to
56
75
  * run for an indefinite amount of time.
57
76
  *
58
77
  * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress
59
78
  **/
60
- this.indeterminate = false;
79
+ this.indeterminate = input(false, { ...(ngDevMode ? { debugName: "indeterminate" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
61
80
  /**
62
81
  * An event that emits each time the progression reaches 100%
63
82
  * and the animation is finished.
64
83
  */
65
- this.finished = new EventEmitter();
84
+ this.finished = output();
66
85
  this.colorable.defaultColor = 'primary';
67
86
  }
68
- /**
69
- * Sets the percentage completion of the progression,
70
- * expressed as a whole number between 0 and 100.
71
- */
72
- get percentage() {
73
- return this._percentage;
74
- }
75
- ;
76
- set percentage(val) {
77
- this._percentage = clamp(val, 0, 100);
78
- this._changeDetectorRef.markForCheck();
79
- }
80
- /**
81
- * @docs-private
82
- */
83
- get ariaValueNow() {
84
- return this.indeterminate ? null : this.percentage;
85
- }
86
- /**
87
- * @docs-private
88
- */
89
- get ariaLabelledBy() {
90
- if (!this.ariaLabel && this.id) {
91
- return this.id;
92
- }
93
- }
94
87
  /**
95
88
  * @docs-private
96
89
  *
97
90
  * Returns the transform style for the determinate progress bar.
98
91
  */
99
92
  _determinateBarTransform() {
100
- return `scaleX(${this.percentage / 100})`;
93
+ return `scaleX(${this.percentage() / 100})`;
101
94
  }
102
95
  /**
103
96
  * @docs-private
@@ -105,12 +98,12 @@ class DaffProgressBarComponent {
105
98
  * Handles the CSS transition end event.
106
99
  */
107
100
  onTransitionEnd(event) {
108
- if (event.propertyName === 'transform' && this.percentage === 100) {
101
+ if (event.propertyName === 'transform' && this.percentage() === 100) {
109
102
  this.finished.emit();
110
103
  }
111
104
  }
112
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffProgressBarComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.DaffColorableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
113
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffProgressBarComponent, isStandalone: true, selector: "daff-progress-bar", inputs: { percentage: "percentage", ariaLabel: ["aria-label", "ariaLabel"], indeterminate: ["indeterminate", "indeterminate", booleanAttribute] }, outputs: { finished: "finished" }, host: { properties: { "class.indeterminate": "indeterminate" }, classAttribute: "daff-progress-bar" }, queries: [{ propertyName: "_label", first: true, predicate: DaffProgressBarLabelDirective, descendants: true }], hostDirectives: [{ directive: i1.DaffColorableDirective, inputs: ["color", "color"] }], ngImport: i0, template: "@if (_label) {\n\t<div class=\"daff-progress-bar__label\"\n\t\t[attr.id]=\"id\">\n\t\t<ng-content select=\"daff-progress-bar-label\"></ng-content>\n\t</div>\n}\n<div class=\"daff-progress-bar__track\"\n\trole=\"progressbar\"\n\taria-valuemin=\"0\"\n\taria-valuemax=\"100\"\n\t[attr.aria-valuenow]=\"ariaValueNow\"\n\t[attr.aria-labelledby]=\"ariaLabelledBy\">\n\t@if (indeterminate) {\n\t\t<div class=\"daff-progress-bar__fill indeterminate-bar\" aria-hidden=\"true\"></div>\n\t} @else {\n\t\t<div class=\"daff-progress-bar__fill determinate-bar\"\n\t\t\taria-hidden=\"true\"\n\t\t\t[style.transform]=\"_determinateBarTransform()\"\n\t\t\t(transitionend)=\"onTransitionEnd($event)\">\n\t\t</div>\n\t}\n</div>", styles: [":host(.daff-progress-bar){display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;width:100%}:host(.daff-progress-bar) .daff-progress-bar__label{font-size:.875rem;line-height:1rem}:host(.daff-progress-bar) .daff-progress-bar__track{height:4px;position:relative;width:100%}:host(.daff-progress-bar) .daff-progress-bar__fill{height:4px;width:100%;transform:scaleX(0);transform-origin:0 center}:host(.daff-progress-bar) .daff-progress-bar__fill.determinate-bar{transition:transform .1s ease-in-out}@media screen and (prefers-reduced-motion:reduce){:host(.daff-progress-bar) .daff-progress-bar__fill.determinate-bar{transition-duration:.2s}}:host(.daff-progress-bar).indeterminate{overflow:hidden}:host(.daff-progress-bar).indeterminate .indeterminate-bar{height:100%;width:100%;animation:indeterminate-animation 1.5s infinite linear;transform-origin:0% 50%}@media screen and (prefers-reduced-motion:reduce){:host(.daff-progress-bar).indeterminate .indeterminate-bar{animation-duration:3.5s}}@keyframes indeterminate-animation{0%{transform:translate(0) scaleX(0)}20%{transform:translate(0) scaleX(25%)}to{transform:translate(100%) scaleX(25%)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
105
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffProgressBarComponent, deps: [{ token: i1.DaffColorableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
106
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffProgressBarComponent, isStandalone: true, selector: "daff-progress-bar", inputs: { percentage: { classPropertyName: "percentage", publicName: "percentage", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { finished: "finished" }, host: { properties: { "class.indeterminate": "indeterminate()" }, classAttribute: "daff-progress-bar" }, queries: [{ propertyName: "_label", first: true, predicate: DaffProgressBarLabelDirective, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DaffColorableDirective, inputs: ["color", "color"] }], ngImport: i0, template: "@if (_label()) {\n\t<div class=\"daff-progress-bar__label\"\n\t\t[attr.id]=\"id\">\n\t\t<ng-content select=\"daff-progress-bar-label\"></ng-content>\n\t</div>\n}\n<div class=\"daff-progress-bar__track\"\n\trole=\"progressbar\"\n\taria-valuemin=\"0\"\n\taria-valuemax=\"100\"\n\t[attr.aria-valuenow]=\"ariaValueNow()\"\n\t[attr.aria-labelledby]=\"ariaLabelledBy()\">\n\t@if (indeterminate()) {\n\t\t<div class=\"daff-progress-bar__fill indeterminate-bar\" aria-hidden=\"true\"></div>\n\t} @else {\n\t\t<div class=\"daff-progress-bar__fill determinate-bar\"\n\t\t\taria-hidden=\"true\"\n\t\t\t[style.transform]=\"_determinateBarTransform()\"\n\t\t\t(transitionend)=\"onTransitionEnd($event)\">\n\t\t</div>\n\t}\n</div>", styles: [":host(.daff-progress-bar){display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;width:100%}:host(.daff-progress-bar) .daff-progress-bar__label{font-size:.875rem;line-height:1rem}:host(.daff-progress-bar) .daff-progress-bar__track{height:4px;position:relative;width:100%}:host(.daff-progress-bar) .daff-progress-bar__fill{height:4px;width:100%;transform:scaleX(0);transform-origin:0 center}:host(.daff-progress-bar) .daff-progress-bar__fill.determinate-bar{transition:transform .1s ease-in-out}@media screen and (prefers-reduced-motion:reduce){:host(.daff-progress-bar) .daff-progress-bar__fill.determinate-bar{transition-duration:.2s}}:host(.daff-progress-bar).indeterminate{overflow:hidden}:host(.daff-progress-bar).indeterminate .indeterminate-bar{height:100%;width:100%;animation:indeterminate-animation 1.5s infinite linear;transform-origin:0% 50%}@media screen and (prefers-reduced-motion:reduce){:host(.daff-progress-bar).indeterminate .indeterminate-bar{animation-duration:3.5s}}@keyframes indeterminate-animation{0%{transform:translate(0) scaleX(0)}20%{transform:translate(0) scaleX(25%)}to{transform:translate(100%) scaleX(25%)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
114
107
  }
115
108
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffProgressBarComponent, decorators: [{
116
109
  type: Component,
@@ -121,22 +114,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
121
114
  },
122
115
  ], host: {
123
116
  class: 'daff-progress-bar',
124
- '[class.indeterminate]': 'indeterminate',
125
- }, template: "@if (_label) {\n\t<div class=\"daff-progress-bar__label\"\n\t\t[attr.id]=\"id\">\n\t\t<ng-content select=\"daff-progress-bar-label\"></ng-content>\n\t</div>\n}\n<div class=\"daff-progress-bar__track\"\n\trole=\"progressbar\"\n\taria-valuemin=\"0\"\n\taria-valuemax=\"100\"\n\t[attr.aria-valuenow]=\"ariaValueNow\"\n\t[attr.aria-labelledby]=\"ariaLabelledBy\">\n\t@if (indeterminate) {\n\t\t<div class=\"daff-progress-bar__fill indeterminate-bar\" aria-hidden=\"true\"></div>\n\t} @else {\n\t\t<div class=\"daff-progress-bar__fill determinate-bar\"\n\t\t\taria-hidden=\"true\"\n\t\t\t[style.transform]=\"_determinateBarTransform()\"\n\t\t\t(transitionend)=\"onTransitionEnd($event)\">\n\t\t</div>\n\t}\n</div>", styles: [":host(.daff-progress-bar){display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;width:100%}:host(.daff-progress-bar) .daff-progress-bar__label{font-size:.875rem;line-height:1rem}:host(.daff-progress-bar) .daff-progress-bar__track{height:4px;position:relative;width:100%}:host(.daff-progress-bar) .daff-progress-bar__fill{height:4px;width:100%;transform:scaleX(0);transform-origin:0 center}:host(.daff-progress-bar) .daff-progress-bar__fill.determinate-bar{transition:transform .1s ease-in-out}@media screen and (prefers-reduced-motion:reduce){:host(.daff-progress-bar) .daff-progress-bar__fill.determinate-bar{transition-duration:.2s}}:host(.daff-progress-bar).indeterminate{overflow:hidden}:host(.daff-progress-bar).indeterminate .indeterminate-bar{height:100%;width:100%;animation:indeterminate-animation 1.5s infinite linear;transform-origin:0% 50%}@media screen and (prefers-reduced-motion:reduce){:host(.daff-progress-bar).indeterminate .indeterminate-bar{animation-duration:3.5s}}@keyframes indeterminate-animation{0%{transform:translate(0) scaleX(0)}20%{transform:translate(0) scaleX(25%)}to{transform:translate(100%) scaleX(25%)}}\n"] }]
126
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.DaffColorableDirective }], propDecorators: { _label: [{
127
- type: ContentChild,
128
- args: [DaffProgressBarLabelDirective]
129
- }], percentage: [{
130
- type: Input
131
- }], ariaLabel: [{
132
- type: Input,
133
- args: ['aria-label']
134
- }], indeterminate: [{
135
- type: Input,
136
- args: [{ transform: booleanAttribute }]
137
- }], finished: [{
138
- type: Output
139
- }] } });
117
+ '[class.indeterminate]': 'indeterminate()',
118
+ }, template: "@if (_label()) {\n\t<div class=\"daff-progress-bar__label\"\n\t\t[attr.id]=\"id\">\n\t\t<ng-content select=\"daff-progress-bar-label\"></ng-content>\n\t</div>\n}\n<div class=\"daff-progress-bar__track\"\n\trole=\"progressbar\"\n\taria-valuemin=\"0\"\n\taria-valuemax=\"100\"\n\t[attr.aria-valuenow]=\"ariaValueNow()\"\n\t[attr.aria-labelledby]=\"ariaLabelledBy()\">\n\t@if (indeterminate()) {\n\t\t<div class=\"daff-progress-bar__fill indeterminate-bar\" aria-hidden=\"true\"></div>\n\t} @else {\n\t\t<div class=\"daff-progress-bar__fill determinate-bar\"\n\t\t\taria-hidden=\"true\"\n\t\t\t[style.transform]=\"_determinateBarTransform()\"\n\t\t\t(transitionend)=\"onTransitionEnd($event)\">\n\t\t</div>\n\t}\n</div>", styles: [":host(.daff-progress-bar){display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;width:100%}:host(.daff-progress-bar) .daff-progress-bar__label{font-size:.875rem;line-height:1rem}:host(.daff-progress-bar) .daff-progress-bar__track{height:4px;position:relative;width:100%}:host(.daff-progress-bar) .daff-progress-bar__fill{height:4px;width:100%;transform:scaleX(0);transform-origin:0 center}:host(.daff-progress-bar) .daff-progress-bar__fill.determinate-bar{transition:transform .1s ease-in-out}@media screen and (prefers-reduced-motion:reduce){:host(.daff-progress-bar) .daff-progress-bar__fill.determinate-bar{transition-duration:.2s}}:host(.daff-progress-bar).indeterminate{overflow:hidden}:host(.daff-progress-bar).indeterminate .indeterminate-bar{height:100%;width:100%;animation:indeterminate-animation 1.5s infinite linear;transform-origin:0% 50%}@media screen and (prefers-reduced-motion:reduce){:host(.daff-progress-bar).indeterminate .indeterminate-bar{animation-duration:3.5s}}@keyframes indeterminate-animation{0%{transform:translate(0) scaleX(0)}20%{transform:translate(0) scaleX(25%)}to{transform:translate(100%) scaleX(25%)}}\n"] }]
119
+ }], ctorParameters: () => [{ type: i1.DaffColorableDirective }], propDecorators: { _label: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DaffProgressBarLabelDirective), { isSignal: true }] }], percentage: [{ type: i0.Input, args: [{ isSignal: true, alias: "percentage", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], finished: [{ type: i0.Output, args: ["finished"] }] } });
140
120
 
141
121
  /**
142
122
  * @deprecated in favor of {@link DAFF_PROGRESS_BAR_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-design-progress-bar.mjs","sources":["../../../libs/design/progress-bar/src/progress-bar-label/progress-bar-label.directive.ts","../../../libs/design/progress-bar/src/progress-bar.component.ts","../../../libs/design/progress-bar/src/progress-bar.component.html","../../../libs/design/progress-bar/src/progress-bar.module.ts","../../../libs/design/progress-bar/src/progress-bar.ts","../../../libs/design/progress-bar/src/daffodil-design-progress-bar.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\n/**\n * Use label to help users understand what the progress represents.\n *\n * @usage\n * ```html\n * <daff-progress-bar-label>File upload</daff-progress-bar-label>\n * ```\n */\n@Directive({\n /* eslint-disable-next-line @angular-eslint/directive-selector */\n selector: 'daff-progress-bar-label',\n})\nexport class DaffProgressBarLabelDirective {}\n","import {\n Component,\n Input,\n ChangeDetectionStrategy,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n booleanAttribute,\n ContentChild,\n} from '@angular/core';\n\nimport { DaffColorableDirective } from '@daffodil/design';\n\nimport { DaffProgressBarLabelDirective } from './progress-bar-label/progress-bar-label.directive';\n\nexport const clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\nlet daffProgressBarId = 0;\n\n/**\n * A progress bar provides visual feedback about the duration or progress of a task or operation.\n *\n * @usage\n * ```html\n * <daff-progress-bar>\n * <daff-progress-bar-label>File upload</daff-progress-bar-label>\n * </daff-progress-bar>\n * ```\n */\n@Component({\n selector: 'daff-progress-bar',\n templateUrl: './progress-bar.component.html',\n styleUrls: ['./progress-bar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: DaffColorableDirective,\n inputs: ['color'],\n },\n ],\n host: {\n class: 'daff-progress-bar',\n '[class.indeterminate]': 'indeterminate',\n },\n})\nexport class DaffProgressBarComponent {\n constructor(\n private _changeDetectorRef: ChangeDetectorRef,\n private colorable: DaffColorableDirective,\n ) {\n this.colorable.defaultColor = 'primary';\n }\n\n private _percentage = 0;\n\n /**\n * @docs-private\n */\n @ContentChild(DaffProgressBarLabelDirective) _label: DaffProgressBarLabelDirective;\n\n /**\n * Sets the percentage completion of the progression,\n * expressed as a whole number between 0 and 100.\n */\n @Input() get percentage(): number {\n return this._percentage;\n };\n set percentage(val: number) {\n this._percentage = clamp(val, 0, 100);\n this._changeDetectorRef.markForCheck();\n }\n\n /**\n * @docs-private\n */\n get ariaValueNow() {\n return this.indeterminate ? null : this.percentage;\n }\n\n /**\n * @docs-private\n */\n get ariaLabelledBy() {\n if(!this.ariaLabel && this.id) {\n return this.id;\n }\n }\n\n /**\n * @docs-private\n *\n * The unique id of the progress bar.\n */\n id = 'daff-progress-bar-' + ++daffProgressBarId;\n\n /**\n * An `aria-label` for the progress bar.\n */\n @Input('aria-label') ariaLabel = '';\n\n /**\n * Property to set the animation of a progress bar to\n * run for an indefinite amount of time.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress\n **/\n @Input({ transform: booleanAttribute }) indeterminate = false;\n\n /**\n * @docs-private\n *\n * Returns the transform style for the determinate progress bar.\n */\n _determinateBarTransform(): string {\n return `scaleX(${this.percentage / 100})`;\n }\n\n /**\n * An event that emits each time the progression reaches 100%\n * and the animation is finished.\n */\n @Output() finished: EventEmitter<void> = new EventEmitter();\n\n /**\n * @docs-private\n *\n * Handles the CSS transition end event.\n */\n onTransitionEnd(event: TransitionEvent): void {\n if (event.propertyName === 'transform' && this.percentage === 100) {\n this.finished.emit();\n }\n }\n}\n","@if (_label) {\n\t<div class=\"daff-progress-bar__label\"\n\t\t[attr.id]=\"id\">\n\t\t<ng-content select=\"daff-progress-bar-label\"></ng-content>\n\t</div>\n}\n<div class=\"daff-progress-bar__track\"\n\trole=\"progressbar\"\n\taria-valuemin=\"0\"\n\taria-valuemax=\"100\"\n\t[attr.aria-valuenow]=\"ariaValueNow\"\n\t[attr.aria-labelledby]=\"ariaLabelledBy\">\n\t@if (indeterminate) {\n\t\t<div class=\"daff-progress-bar__fill indeterminate-bar\" aria-hidden=\"true\"></div>\n\t} @else {\n\t\t<div class=\"daff-progress-bar__fill determinate-bar\"\n\t\t\taria-hidden=\"true\"\n\t\t\t[style.transform]=\"_determinateBarTransform()\"\n\t\t\t(transitionend)=\"onTransitionEnd($event)\">\n\t\t</div>\n\t}\n</div>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffProgressBarLabelDirective } from './progress-bar-label/progress-bar-label.directive';\nimport { DaffProgressBarComponent } from './progress-bar.component';\n\n/**\n * @deprecated in favor of {@link DAFF_PROGRESS_BAR_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffProgressBarComponent,\n DaffProgressBarLabelDirective,\n ],\n exports: [\n DaffProgressBarComponent,\n DaffProgressBarLabelDirective,\n ],\n})\nexport class DaffProgressBarModule { }\n","import { DaffProgressBarLabelDirective } from './progress-bar-label/progress-bar-label.directive';\nimport { DaffProgressBarComponent } from './progress-bar.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_PROGRESS_BAR_COMPONENTS = <const> [\n DaffProgressBarComponent,\n DaffProgressBarLabelDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEA;;;;;;;AAOG;MAKU,6BAA6B,CAAA;iIAA7B,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qHAA7B,6BAA6B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAJzC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,yBAAyB;AACpC,iBAAA;;;ACEM,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC;AAErG,IAAI,iBAAiB,GAAG,CAAC;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C9B,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;AACI,MAAM,4BAA4B,GAAW;IAClD,wBAAwB;IACxB,6BAA6B;;;ACR/B;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-design-progress-bar.mjs","sources":["../../../libs/design/progress-bar/src/progress-bar-label/progress-bar-label.directive.ts","../../../libs/design/progress-bar/src/progress-bar.component.ts","../../../libs/design/progress-bar/src/progress-bar.component.html","../../../libs/design/progress-bar/src/progress-bar.module.ts","../../../libs/design/progress-bar/src/progress-bar.ts","../../../libs/design/progress-bar/src/daffodil-design-progress-bar.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\n/**\n * Use label to help users understand what the progress represents.\n *\n * @usage\n * ```html\n * <daff-progress-bar-label>File upload</daff-progress-bar-label>\n * ```\n */\n@Directive({\n /* eslint-disable-next-line @angular-eslint/directive-selector */\n selector: 'daff-progress-bar-label',\n})\nexport class DaffProgressBarLabelDirective {}\n","import {\n Component,\n ChangeDetectionStrategy,\n booleanAttribute,\n input,\n output,\n computed,\n contentChild,\n} from '@angular/core';\n\nimport { DaffColorableDirective } from '@daffodil/design';\n\nimport { DaffProgressBarLabelDirective } from './progress-bar-label/progress-bar-label.directive';\n\nexport const clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\nlet daffProgressBarId = 0;\n\n/**\n * A progress bar provides visual feedback about the duration or progress of a task or operation.\n *\n * @usage\n * ```html\n * <daff-progress-bar>\n * <daff-progress-bar-label>File upload</daff-progress-bar-label>\n * </daff-progress-bar>\n * ```\n */\n@Component({\n selector: 'daff-progress-bar',\n templateUrl: './progress-bar.component.html',\n styleUrl: './progress-bar.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: DaffColorableDirective,\n inputs: ['color'],\n },\n ],\n host: {\n class: 'daff-progress-bar',\n '[class.indeterminate]': 'indeterminate()',\n },\n})\nexport class DaffProgressBarComponent {\n constructor(\n private colorable: DaffColorableDirective,\n ) {\n this.colorable.defaultColor = 'primary';\n }\n\n /**\n * @docs-private\n */\n _label = contentChild(DaffProgressBarLabelDirective);\n\n /**\n * Sets the percentage completion of the progression,\n * expressed as a whole number between 0 and 100.\n */\n percentage = input(0, { transform: (val: number) => clamp(val, 0, 100) });\n\n /**\n * @docs-private\n */\n ariaValueNow = computed(() => this.indeterminate() ? null : this.percentage());\n\n /**\n * @docs-private\n */\n ariaLabelledBy = computed(() => {\n if(!this.ariaLabel() && this.id) {\n return this.id;\n }\n });\n\n /**\n * @docs-private\n *\n * The unique id of the progress bar.\n */\n id = 'daff-progress-bar-' + ++daffProgressBarId;\n\n /**\n * An `aria-label` for the progress bar.\n */\n ariaLabel = input('', { alias: 'aria-label' });\n\n /**\n * Property to set the animation of a progress bar to\n * run for an indefinite amount of time.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress\n **/\n indeterminate = input(false, { transform: booleanAttribute });\n\n /**\n * @docs-private\n *\n * Returns the transform style for the determinate progress bar.\n */\n _determinateBarTransform(): string {\n return `scaleX(${this.percentage() / 100})`;\n }\n\n /**\n * An event that emits each time the progression reaches 100%\n * and the animation is finished.\n */\n finished = output<void>();\n\n /**\n * @docs-private\n *\n * Handles the CSS transition end event.\n */\n onTransitionEnd(event: TransitionEvent): void {\n if (event.propertyName === 'transform' && this.percentage() === 100) {\n this.finished.emit();\n }\n }\n}\n","@if (_label()) {\n\t<div class=\"daff-progress-bar__label\"\n\t\t[attr.id]=\"id\">\n\t\t<ng-content select=\"daff-progress-bar-label\"></ng-content>\n\t</div>\n}\n<div class=\"daff-progress-bar__track\"\n\trole=\"progressbar\"\n\taria-valuemin=\"0\"\n\taria-valuemax=\"100\"\n\t[attr.aria-valuenow]=\"ariaValueNow()\"\n\t[attr.aria-labelledby]=\"ariaLabelledBy()\">\n\t@if (indeterminate()) {\n\t\t<div class=\"daff-progress-bar__fill indeterminate-bar\" aria-hidden=\"true\"></div>\n\t} @else {\n\t\t<div class=\"daff-progress-bar__fill determinate-bar\"\n\t\t\taria-hidden=\"true\"\n\t\t\t[style.transform]=\"_determinateBarTransform()\"\n\t\t\t(transitionend)=\"onTransitionEnd($event)\">\n\t\t</div>\n\t}\n</div>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffProgressBarLabelDirective } from './progress-bar-label/progress-bar-label.directive';\nimport { DaffProgressBarComponent } from './progress-bar.component';\n\n/**\n * @deprecated in favor of {@link DAFF_PROGRESS_BAR_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffProgressBarComponent,\n DaffProgressBarLabelDirective,\n ],\n exports: [\n DaffProgressBarComponent,\n DaffProgressBarLabelDirective,\n ],\n})\nexport class DaffProgressBarModule { }\n","import { DaffProgressBarLabelDirective } from './progress-bar-label/progress-bar-label.directive';\nimport { DaffProgressBarComponent } from './progress-bar.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_PROGRESS_BAR_COMPONENTS = <const> [\n DaffProgressBarComponent,\n DaffProgressBarLabelDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEA;;;;;;;AAOG;MAKU,6BAA6B,CAAA;iIAA7B,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qHAA7B,6BAA6B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAJzC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,yBAAyB;AACpC,iBAAA;;;ACCM,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GA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ChBD;;AAEG;AACI,MAAM,4BAA4B,GAAW;IAClD,wBAAwB;IACxB,6BAA6B;;;ACR/B;;AAEG;;;;"}
@@ -116,7 +116,7 @@ class DaffSelectComponent extends DaffFormFieldControl {
116
116
  if (!this.formField) {
117
117
  throw new Error('DaffSelectComponent needs to be used with the DaffFormFieldComponent.');
118
118
  }
119
- this.ariaLabelledBy = this.formField.id;
119
+ this.ariaLabelledBy = this.formField.id();
120
120
  this.openDirective.stateless = false;
121
121
  this.document.addEventListener('keydown', (event) => {
122
122
  if (event.key === 'Tab' && this.isOpen) {