@salesforce/ui-bundle-template-feature-angular-object-search 12.5.4

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 (289) hide show
  1. package/LICENSE.txt +82 -0
  2. package/README.md +101 -0
  3. package/dist/.forceignore +15 -0
  4. package/dist/.husky/pre-commit +4 -0
  5. package/dist/.prettierignore +11 -0
  6. package/dist/.prettierrc +17 -0
  7. package/dist/CHANGELOG.md +5238 -0
  8. package/dist/README.md +77 -0
  9. package/dist/config/project-scratch-def.json +13 -0
  10. package/dist/eslint.config.js +7 -0
  11. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/.forceignore +15 -0
  12. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/.graphqlrc.yml +2 -0
  13. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/.postcssrc.json +5 -0
  14. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/.prettierignore +8 -0
  15. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/.prettierrc +12 -0
  16. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/CHANGELOG.md +4 -0
  17. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/README.md +85 -0
  18. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/angular.json +98 -0
  19. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/codegen.yml +95 -0
  20. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/components.json +6 -0
  21. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/e2e/app.spec.ts +15 -0
  22. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/esbuild/api-version.mjs +17 -0
  23. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/esbuild/graphql-codegen.mjs +13 -0
  24. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/eslint-plugin-angular-graphql.js +148 -0
  25. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/eslint.config.js +76 -0
  26. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/feature-angular-object-search.uibundle-meta.xml +7 -0
  27. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/middleware/html.mjs +3 -0
  28. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/middleware/proxy.mjs +12 -0
  29. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/package.json +69 -0
  30. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/playwright.config.ts +25 -0
  31. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/public/favicon.ico +0 -0
  32. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/scripts/get-graphql-schema.mjs +69 -0
  33. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/scripts/rewrite-e2e-assets.mjs +30 -0
  34. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/account/account-search.service.ts +108 -0
  35. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/account/distinctAccountIndustries.ts +26 -0
  36. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/account/distinctAccountTypes.ts +26 -0
  37. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/account/getAccountDetail.ts +128 -0
  38. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/account/searchAccounts.ts +58 -0
  39. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/data-client.service.spec.ts +184 -0
  40. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/data-client.service.ts +74 -0
  41. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/graphql-operations-types.ts +29389 -0
  42. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/app.config.ts +20 -0
  43. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/app.html +1 -0
  44. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/app.routes.ts +32 -0
  45. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/app.spec.ts +18 -0
  46. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/app.ts +15 -0
  47. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/layout/app-layout/app-layout.html +51 -0
  48. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/layout/app-layout/app-layout.spec.ts +63 -0
  49. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/layout/app-layout/app-layout.ts +27 -0
  50. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/alert/alert.html +27 -0
  51. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/alert/alert.ts +41 -0
  52. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/button/button.html +27 -0
  53. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/button/button.ts +66 -0
  54. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/card/card.ts +100 -0
  55. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/collapsible/collapsible.html +38 -0
  56. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/collapsible/collapsible.ts +21 -0
  57. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/date-picker/date-picker.html +20 -0
  58. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/date-picker/date-picker.ts +49 -0
  59. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/date-range-picker/date-range-picker.html +20 -0
  60. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/date-range-picker/date-range-picker.ts +69 -0
  61. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/dialog/dialog.html +20 -0
  62. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/dialog/dialog.ts +40 -0
  63. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/dropdown-menu/dropdown-menu.html +20 -0
  64. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/dropdown-menu/dropdown-menu.ts +100 -0
  65. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/field/field.html +15 -0
  66. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/field/field.ts +28 -0
  67. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/field-appearance.ts +8 -0
  68. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/field-size.ts +8 -0
  69. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/icon/icon.ts +68 -0
  70. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/input/input.html +34 -0
  71. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/input/input.ts +79 -0
  72. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/label/label.ts +21 -0
  73. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/paginator/paginator.html +74 -0
  74. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/paginator/paginator.ts +93 -0
  75. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/paginator/types.ts +13 -0
  76. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/popover/popover.html +13 -0
  77. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/popover/popover.ts +37 -0
  78. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/select/select.html +36 -0
  79. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/select/select.ts +63 -0
  80. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/separator/separator.ts +31 -0
  81. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/skeleton/skeleton.ts +20 -0
  82. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/spinner/spinner.ts +28 -0
  83. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/api/object-search.service.ts +94 -0
  84. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/breadcrumb/breadcrumb.html +34 -0
  85. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/breadcrumb/breadcrumb.ts +27 -0
  86. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/active-filters.html +23 -0
  87. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/active-filters.ts +78 -0
  88. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/date-filter.html +18 -0
  89. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/date-filter.ts +137 -0
  90. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/date-range-filter.html +12 -0
  91. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/date-range-filter.ts +60 -0
  92. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/filter-field-wrapper.html +13 -0
  93. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/filter-field-wrapper.ts +21 -0
  94. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/multi-select-filter.html +11 -0
  95. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/multi-select-filter.ts +58 -0
  96. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/numeric-range-filter.html +22 -0
  97. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/numeric-range-filter.ts +128 -0
  98. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/search-filter.html +8 -0
  99. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/search-filter.ts +78 -0
  100. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/select-filter.html +9 -0
  101. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/select-filter.ts +51 -0
  102. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/text-filter.html +9 -0
  103. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/text-filter.ts +76 -0
  104. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/object-search-state.service.ts +232 -0
  105. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/pagination/pagination.html +8 -0
  106. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/pagination/pagination.ts +45 -0
  107. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/search-bar/search-bar.html +10 -0
  108. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/search-bar/search-bar.ts +28 -0
  109. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/sort-control/sort-control.html +24 -0
  110. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/sort-control/sort-control.ts +65 -0
  111. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/utils/debounce.ts +31 -0
  112. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/utils/field-utils.ts +54 -0
  113. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/utils/filter-utils.ts +354 -0
  114. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/utils/index.ts +12 -0
  115. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/utils/sort-utils.ts +39 -0
  116. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/account-detail/account-detail-page.html +142 -0
  117. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/account-detail/account-detail-page.ts +176 -0
  118. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/account-search/account-search-page.html +93 -0
  119. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/account-search/account-search-page.ts +196 -0
  120. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/home/home.html +17 -0
  121. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/home/home.spec.ts +25 -0
  122. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/home/home.ts +65 -0
  123. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/not-found/not-found.html +12 -0
  124. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/not-found/not-found.spec.ts +33 -0
  125. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/not-found/not-found.ts +15 -0
  126. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/alert/hlm-alert-action.ts +14 -0
  127. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/alert/hlm-alert-description.ts +17 -0
  128. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/alert/hlm-alert-title.ts +17 -0
  129. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/alert/hlm-alert.ts +35 -0
  130. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/alert/index.ts +16 -0
  131. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/button/hlm-button.token.ts +22 -0
  132. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/button/hlm-button.ts +72 -0
  133. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/button/index.ts +6 -0
  134. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/calendar/hlm-calendar-multi.ts +195 -0
  135. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/calendar/hlm-calendar-range.ts +194 -0
  136. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/calendar/hlm-calendar.ts +189 -0
  137. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/calendar/hlm-month-year-calendar.ts +119 -0
  138. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/calendar/index.ts +16 -0
  139. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-action.ts +12 -0
  140. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-avatar.ts +14 -0
  141. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-content.ts +12 -0
  142. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-description.ts +12 -0
  143. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-footer.ts +12 -0
  144. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-header.ts +15 -0
  145. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-title.ts +12 -0
  146. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card.token.ts +19 -0
  147. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card.ts +22 -0
  148. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/index.ts +28 -0
  149. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/collapsible/hlm-collapsible-content.ts +14 -0
  150. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/collapsible/hlm-collapsible-trigger.ts +9 -0
  151. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/collapsible/hlm-collapsible.ts +15 -0
  152. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/collapsible/index.ts +13 -0
  153. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-multi-input.ts +104 -0
  154. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker-anchor.ts +23 -0
  155. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker-input.ts +118 -0
  156. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker-multi.token.ts +109 -0
  157. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker-multi.ts +220 -0
  158. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker-trigger.ts +104 -0
  159. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker.token.ts +69 -0
  160. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker.ts +203 -0
  161. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-range-input.ts +120 -0
  162. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-range-picker.token.ts +86 -0
  163. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-range-picker.ts +252 -0
  164. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-month-year-input.ts +105 -0
  165. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-month-year-picker.token.ts +89 -0
  166. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-month-year-picker.ts +196 -0
  167. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/index.ts +38 -0
  168. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-close.ts +9 -0
  169. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-content.ts +74 -0
  170. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-description.ts +17 -0
  171. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-footer.ts +15 -0
  172. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-header.ts +12 -0
  173. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-overlay.ts +27 -0
  174. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-portal.ts +8 -0
  175. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-title.ts +14 -0
  176. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-trigger.ts +14 -0
  177. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog.service.ts +46 -0
  178. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog.ts +24 -0
  179. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/index.ts +35 -0
  180. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox-indicator.ts +21 -0
  181. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox.ts +54 -0
  182. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-focus-on-hover.ts +35 -0
  183. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-group.ts +14 -0
  184. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-item-sub-indicator.ts +19 -0
  185. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-item.ts +42 -0
  186. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-label.ts +20 -0
  187. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio-indicator.ts +21 -0
  188. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio.ts +49 -0
  189. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-separator.ts +12 -0
  190. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-shortcut.ts +15 -0
  191. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub-trigger.ts +52 -0
  192. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub.ts +53 -0
  193. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-token.ts +26 -0
  194. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-trigger.ts +46 -0
  195. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu.ts +57 -0
  196. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/index.ts +49 -0
  197. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-content.ts +12 -0
  198. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-description.ts +53 -0
  199. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-error.ts +100 -0
  200. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-group.ts +15 -0
  201. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-label.ts +17 -0
  202. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-legend.ts +19 -0
  203. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-separator.ts +24 -0
  204. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-set.ts +15 -0
  205. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-title.ts +15 -0
  206. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field.ts +47 -0
  207. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/index.ts +34 -0
  208. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input/hlm-input.ts +21 -0
  209. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input/index.ts +5 -0
  210. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/hlm-input-group-addon.ts +40 -0
  211. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/hlm-input-group-button.ts +47 -0
  212. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/hlm-input-group-input.ts +17 -0
  213. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/hlm-input-group-text.ts +14 -0
  214. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/hlm-input-group.ts +18 -0
  215. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/index.ts +19 -0
  216. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/label/hlm-label.ts +17 -0
  217. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/label/index.ts +5 -0
  218. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/label/label.html +11 -0
  219. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-numbered-pagination-query-params.ts +191 -0
  220. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-numbered-pagination.ts +290 -0
  221. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-content.ts +12 -0
  222. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-ellipsis.ts +27 -0
  223. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-item.ts +7 -0
  224. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-link.ts +51 -0
  225. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-next.ts +65 -0
  226. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-previous.ts +65 -0
  227. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination.ts +19 -0
  228. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/index.ts +31 -0
  229. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-content.ts +25 -0
  230. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-description.ts +12 -0
  231. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-header.ts +12 -0
  232. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-portal.ts +8 -0
  233. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-title.ts +12 -0
  234. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-trigger.ts +14 -0
  235. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover.ts +23 -0
  236. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/index.ts +25 -0
  237. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-content.ts +44 -0
  238. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-group.ts +14 -0
  239. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-item.ts +36 -0
  240. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-label.ts +14 -0
  241. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-multiple.ts +37 -0
  242. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-placeholder.ts +17 -0
  243. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-portal.ts +8 -0
  244. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-scroll-down.ts +22 -0
  245. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-scroll-up.ts +22 -0
  246. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-separator.ts +14 -0
  247. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-trigger.ts +59 -0
  248. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-value-template.ts +5 -0
  249. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-value.ts +18 -0
  250. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-values-content.ts +9 -0
  251. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-values.ts +5 -0
  252. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select.ts +37 -0
  253. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/index.ts +52 -0
  254. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/separator/hlm-separator.ts +19 -0
  255. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/separator/index.ts +5 -0
  256. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/skeleton/hlm-skeleton.ts +14 -0
  257. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/skeleton/index.ts +5 -0
  258. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/spinner/hlm-spinner.ts +26 -0
  259. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/spinner/index.ts +5 -0
  260. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/utils/hlm.ts +313 -0
  261. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/utils/index.ts +2 -0
  262. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/utils/provide-spartan-hlm.ts +34 -0
  263. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/utils/async-data.ts +99 -0
  264. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/index.html +13 -0
  265. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/main.ts +5 -0
  266. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/styles.css +139 -0
  267. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/types/sf-globals.d.ts +9 -0
  268. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/tsconfig.app.json +11 -0
  269. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/tsconfig.json +36 -0
  270. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/tsconfig.spec.json +10 -0
  271. package/dist/force-app/main/default/uiBundles/feature-angular-object-search/ui-bundle.json +7 -0
  272. package/dist/jest.config.js +6 -0
  273. package/dist/package-lock.json +12554 -0
  274. package/dist/package.json +46 -0
  275. package/dist/scripts/apex/hello.apex +10 -0
  276. package/dist/scripts/gitignore-templates.json +4 -0
  277. package/dist/scripts/graphql-search.sh +191 -0
  278. package/dist/scripts/org-setup-config-schema.mjs +132 -0
  279. package/dist/scripts/org-setup-dev.mjs +114 -0
  280. package/dist/scripts/org-setup-url.mjs +108 -0
  281. package/dist/scripts/org-setup-utils.mjs +569 -0
  282. package/dist/scripts/org-setup-xml.mjs +278 -0
  283. package/dist/scripts/org-setup.config.json +5 -0
  284. package/dist/scripts/org-setup.mjs +2537 -0
  285. package/dist/scripts/sf-project-setup.mjs +103 -0
  286. package/dist/scripts/soql/account.soql +6 -0
  287. package/dist/scripts/validate-org-setup-config.mjs +38 -0
  288. package/dist/sfdx-project.json +12 -0
  289. package/package.json +51 -0
@@ -0,0 +1,191 @@
1
+ import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';
2
+ import {
3
+ booleanAttribute,
4
+ ChangeDetectionStrategy,
5
+ Component,
6
+ computed,
7
+ input,
8
+ model,
9
+ numberAttribute,
10
+ untracked,
11
+ } from '@angular/core';
12
+ import { HlmSelectImports } from '@spartan-ng/styles/select';
13
+ import { classes } from '@spartan-ng/styles/utils';
14
+ import { createPageArray, outOfBoundCorrection } from './hlm-numbered-pagination';
15
+ import { HlmPagination } from './hlm-pagination';
16
+ import { HlmPaginationContent } from './hlm-pagination-content';
17
+ import { HlmPaginationEllipsis } from './hlm-pagination-ellipsis';
18
+ import { HlmPaginationItem } from './hlm-pagination-item';
19
+ import { HlmPaginationLink } from './hlm-pagination-link';
20
+ import { HlmPaginationNext } from './hlm-pagination-next';
21
+ import { HlmPaginationPrevious } from './hlm-pagination-previous';
22
+
23
+ @Component({
24
+ selector: 'hlm-numbered-pagination-query-params',
25
+ imports: [
26
+ HlmPagination,
27
+ HlmPaginationContent,
28
+ HlmPaginationItem,
29
+ HlmPaginationPrevious,
30
+ HlmPaginationNext,
31
+ HlmPaginationLink,
32
+ HlmPaginationEllipsis,
33
+ HlmSelectImports,
34
+ ],
35
+ changeDetection: ChangeDetectionStrategy.OnPush,
36
+ template: `
37
+ <div class="flex items-center gap-1 text-sm text-nowrap text-gray-600">
38
+ <b>{{ totalItems() }}</b>
39
+ total items |
40
+ <b>{{ _lastPageNumber() }}</b>
41
+ pages
42
+ </div>
43
+
44
+ <nav hlmPagination>
45
+ <ul hlmPaginationContent>
46
+ @if (showEdges() && !_isFirstPageActive()) {
47
+ <li hlmPaginationItem>
48
+ <hlm-pagination-previous
49
+ [link]="link()"
50
+ [queryParams]="{ page: currentPage() - 1 }"
51
+ queryParamsHandling="merge"
52
+ />
53
+ </li>
54
+ }
55
+
56
+ @for (page of _pages(); track page) {
57
+ <li hlmPaginationItem>
58
+ @if (page === '...') {
59
+ <hlm-pagination-ellipsis />
60
+ } @else {
61
+ <a
62
+ hlmPaginationLink
63
+ [link]="currentPage() !== page ? link() : undefined"
64
+ [queryParams]="{ page }"
65
+ queryParamsHandling="merge"
66
+ [isActive]="currentPage() === page"
67
+ >
68
+ {{ page }}
69
+ </a>
70
+ }
71
+ </li>
72
+ }
73
+
74
+ @if (showEdges() && !_isLastPageActive()) {
75
+ <li hlmPaginationItem>
76
+ <hlm-pagination-next
77
+ [link]="link()"
78
+ [queryParams]="{ page: currentPage() + 1 }"
79
+ queryParamsHandling="merge"
80
+ />
81
+ </li>
82
+ }
83
+ </ul>
84
+ </nav>
85
+
86
+ <!-- Show Page Size selector -->
87
+ <hlm-select [(value)]="itemsPerPage" class="ml-auto">
88
+ <hlm-select-trigger class="w-fit">
89
+ <hlm-select-value />
90
+ </hlm-select-trigger>
91
+ <hlm-select-content *hlmSelectPortal>
92
+ <hlm-select-group>
93
+ @for (pageSize of _pageSizesWithCurrent(); track pageSize) {
94
+ <hlm-select-item [value]="pageSize">{{ pageSize }}</hlm-select-item>
95
+ }
96
+ </hlm-select-group>
97
+ </hlm-select-content>
98
+ </hlm-select>
99
+ `,
100
+ })
101
+ export class HlmNumberedPaginationQueryParams {
102
+ /**
103
+ * The current (active) page.
104
+ */
105
+ public readonly currentPage = model.required<number>();
106
+
107
+ /**
108
+ * The number of items per paginated page.
109
+ */
110
+ public readonly itemsPerPage = model.required<number>();
111
+
112
+ /**
113
+ * The total number of items in the collection. Only useful when
114
+ * doing server-side paging, where the collection size is limited
115
+ * to a single page returned by the server API.
116
+ */
117
+ public readonly totalItems = input.required<number, NumberInput>({
118
+ transform: numberAttribute,
119
+ });
120
+
121
+ /**
122
+ * The URL path to use for the pagination links.
123
+ * Defaults to '.' (current path).
124
+ */
125
+ public readonly link = input<string>('.');
126
+
127
+ /**
128
+ * The number of page links to show.
129
+ */
130
+ public readonly maxSize = input<number, NumberInput>(7, {
131
+ transform: numberAttribute,
132
+ });
133
+
134
+ /**
135
+ * Show the first and last page buttons.
136
+ */
137
+ public readonly showEdges = input<boolean, BooleanInput>(true, {
138
+ transform: booleanAttribute,
139
+ });
140
+
141
+ /**
142
+ * The page sizes to show.
143
+ * Defaults to [10, 20, 50, 100]
144
+ */
145
+ public readonly pageSizes = input<number[]>([10, 20, 50, 100]);
146
+
147
+ protected readonly _pageSizesWithCurrent = computed(() => {
148
+ const pageSizes = this.pageSizes();
149
+ return pageSizes.includes(this.itemsPerPage())
150
+ ? pageSizes // if current page size is included, return the same array
151
+ : [...pageSizes, this.itemsPerPage()].sort((a, b) => a - b); // otherwise, add current page size and sort the array
152
+ });
153
+
154
+ protected readonly _isFirstPageActive = computed(() => this.currentPage() === 1);
155
+ protected readonly _isLastPageActive = computed(
156
+ () => this.currentPage() === this._lastPageNumber(),
157
+ );
158
+
159
+ protected readonly _lastPageNumber = computed(() => {
160
+ if (this.totalItems() < 1) {
161
+ // when there are 0 or fewer (an error case) items, there are no "pages" as such,
162
+ // but it makes sense to consider a single, empty page as the last page.
163
+ return 1;
164
+ }
165
+ return Math.ceil(this.totalItems() / this.itemsPerPage());
166
+ });
167
+
168
+ protected readonly _pages = computed(() => {
169
+ const correctedCurrentPage = outOfBoundCorrection(
170
+ this.totalItems(),
171
+ this.itemsPerPage(),
172
+ this.currentPage(),
173
+ );
174
+
175
+ if (correctedCurrentPage !== this.currentPage()) {
176
+ // update the current page
177
+ untracked(() => this.currentPage.set(correctedCurrentPage));
178
+ }
179
+
180
+ return createPageArray(
181
+ correctedCurrentPage,
182
+ this.itemsPerPage(),
183
+ this.totalItems(),
184
+ this.maxSize(),
185
+ );
186
+ });
187
+
188
+ constructor() {
189
+ classes(() => 'flex items-center justify-between gap-2 px-4 py-2');
190
+ }
191
+ }
@@ -0,0 +1,290 @@
1
+ import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ booleanAttribute,
6
+ computed,
7
+ input,
8
+ model,
9
+ numberAttribute,
10
+ untracked,
11
+ } from '@angular/core';
12
+ import { HlmSelectImports } from '@spartan-ng/styles/select';
13
+ import { HlmPagination } from './hlm-pagination';
14
+ import { HlmPaginationContent } from './hlm-pagination-content';
15
+ import { HlmPaginationEllipsis } from './hlm-pagination-ellipsis';
16
+ import { HlmPaginationItem } from './hlm-pagination-item';
17
+ import { HlmPaginationLink } from './hlm-pagination-link';
18
+ import { HlmPaginationNext } from './hlm-pagination-next';
19
+ import { HlmPaginationPrevious } from './hlm-pagination-previous';
20
+
21
+ @Component({
22
+ selector: 'hlm-numbered-pagination',
23
+ imports: [
24
+ HlmPagination,
25
+ HlmPaginationContent,
26
+ HlmPaginationItem,
27
+ HlmPaginationPrevious,
28
+ HlmPaginationNext,
29
+ HlmPaginationLink,
30
+ HlmPaginationEllipsis,
31
+ HlmSelectImports,
32
+ ],
33
+ changeDetection: ChangeDetectionStrategy.OnPush,
34
+ template: `
35
+ <div class="flex items-center justify-between gap-2 px-4 py-2">
36
+ <div class="flex items-center gap-1 text-sm text-nowrap text-gray-600">
37
+ <b>{{ totalItems() }}</b>
38
+ total items |
39
+ <b>{{ _lastPageNumber() }}</b>
40
+ pages
41
+ </div>
42
+
43
+ <nav hlmPagination>
44
+ <ul hlmPaginationContent>
45
+ @if (showEdges() && !_isFirstPageActive()) {
46
+ <li hlmPaginationItem (click)="goToPrevious()">
47
+ <hlm-pagination-previous />
48
+ </li>
49
+ }
50
+
51
+ @for (page of _pages(); track page) {
52
+ <li hlmPaginationItem>
53
+ @if (page === '...') {
54
+ <hlm-pagination-ellipsis />
55
+ } @else {
56
+ <a
57
+ hlmPaginationLink
58
+ [isActive]="currentPage() === page"
59
+ (click)="currentPage.set(page)"
60
+ >
61
+ {{ page }}
62
+ </a>
63
+ }
64
+ </li>
65
+ }
66
+
67
+ @if (showEdges() && !_isLastPageActive()) {
68
+ <li hlmPaginationItem (click)="goToNext()">
69
+ <hlm-pagination-next />
70
+ </li>
71
+ }
72
+ </ul>
73
+ </nav>
74
+
75
+ <!-- Show Page Size selector -->
76
+ <hlm-select [(value)]="itemsPerPage" class="ml-auto">
77
+ <hlm-select-trigger class="w-fit">
78
+ <hlm-select-value />
79
+ </hlm-select-trigger>
80
+ <hlm-select-content *hlmSelectPortal>
81
+ <hlm-select-group>
82
+ @for (pageSize of _pageSizesWithCurrent(); track pageSize) {
83
+ <hlm-select-item [value]="pageSize">{{ pageSize }}</hlm-select-item>
84
+ }
85
+ </hlm-select-group>
86
+ </hlm-select-content>
87
+ </hlm-select>
88
+ </div>
89
+ `,
90
+ })
91
+ export class HlmNumberedPagination {
92
+ /**
93
+ * The current (active) page.
94
+ */
95
+ public readonly currentPage = model.required<number>();
96
+
97
+ /**
98
+ * The number of items per paginated page.
99
+ */
100
+ public readonly itemsPerPage = model.required<number>();
101
+
102
+ /**
103
+ * The total number of items in the collection. Only useful when
104
+ * doing server-side paging, where the collection size is limited
105
+ * to a single page returned by the server API.
106
+ */
107
+ public readonly totalItems = input.required<number, NumberInput>({
108
+ transform: numberAttribute,
109
+ });
110
+
111
+ /**
112
+ * The number of page links to show.
113
+ */
114
+ public readonly maxSize = input<number, NumberInput>(7, {
115
+ transform: numberAttribute,
116
+ });
117
+
118
+ /**
119
+ * Show the first and last page buttons.
120
+ */
121
+ public readonly showEdges = input<boolean, BooleanInput>(true, {
122
+ transform: booleanAttribute,
123
+ });
124
+
125
+ /**
126
+ * The page sizes to show.
127
+ * Defaults to [10, 20, 50, 100]
128
+ */
129
+ public readonly pageSizes = input<number[]>([10, 20, 50, 100]);
130
+
131
+ protected readonly _pageSizesWithCurrent = computed(() => {
132
+ const pageSizes = this.pageSizes();
133
+ return pageSizes.includes(this.itemsPerPage())
134
+ ? pageSizes // if current page size is included, return the same array
135
+ : [...pageSizes, this.itemsPerPage()].sort((a, b) => a - b); // otherwise, add current page size and sort the array
136
+ });
137
+
138
+ protected readonly _isFirstPageActive = computed(() => this.currentPage() === 1);
139
+ protected readonly _isLastPageActive = computed(
140
+ () => this.currentPage() === this._lastPageNumber(),
141
+ );
142
+
143
+ protected readonly _lastPageNumber = computed(() => {
144
+ if (this.totalItems() < 1) {
145
+ // when there are 0 or fewer (an error case) items, there are no "pages" as such,
146
+ // but it makes sense to consider a single, empty page as the last page.
147
+ return 1;
148
+ }
149
+ return Math.ceil(this.totalItems() / this.itemsPerPage());
150
+ });
151
+
152
+ protected readonly _pages = computed(() => {
153
+ const correctedCurrentPage = outOfBoundCorrection(
154
+ this.totalItems(),
155
+ this.itemsPerPage(),
156
+ this.currentPage(),
157
+ );
158
+
159
+ if (correctedCurrentPage !== this.currentPage()) {
160
+ // update the current page
161
+ untracked(() => this.currentPage.set(correctedCurrentPage));
162
+ }
163
+
164
+ return createPageArray(
165
+ correctedCurrentPage,
166
+ this.itemsPerPage(),
167
+ this.totalItems(),
168
+ this.maxSize(),
169
+ );
170
+ });
171
+
172
+ protected goToPrevious(): void {
173
+ this.currentPage.set(this.currentPage() - 1);
174
+ }
175
+
176
+ protected goToNext(): void {
177
+ this.currentPage.set(this.currentPage() + 1);
178
+ }
179
+
180
+ protected goToFirst(): void {
181
+ this.currentPage.set(1);
182
+ }
183
+
184
+ protected goToLast(): void {
185
+ this.currentPage.set(this._lastPageNumber());
186
+ }
187
+ }
188
+
189
+ type Page = number | '...';
190
+
191
+ /**
192
+ * Checks that the instance.currentPage property is within bounds for the current page range.
193
+ * If not, return a correct value for currentPage, or the current value if OK.
194
+ *
195
+ * Copied from 'ngx-pagination' package
196
+ */
197
+ export function outOfBoundCorrection(
198
+ totalItems: number,
199
+ itemsPerPage: number,
200
+ currentPage: number,
201
+ ): number {
202
+ const totalPages = Math.ceil(totalItems / itemsPerPage);
203
+ if (totalPages < currentPage && 0 < totalPages) {
204
+ return totalPages;
205
+ }
206
+
207
+ if (currentPage < 1) {
208
+ return 1;
209
+ }
210
+
211
+ return currentPage;
212
+ }
213
+
214
+ /**
215
+ * Returns an array of Page objects to use in the pagination controls.
216
+ *
217
+ * Copied from 'ngx-pagination' package
218
+ */
219
+ export function createPageArray(
220
+ currentPage: number,
221
+ itemsPerPage: number,
222
+ totalItems: number,
223
+ paginationRange: number,
224
+ ): Page[] {
225
+ // paginationRange could be a string if passed from attribute, so cast to number.
226
+ paginationRange = +paginationRange;
227
+ const pages: Page[] = [];
228
+
229
+ // Return 1 as default page number
230
+ // Make sense to show 1 instead of empty when there are no items
231
+ const totalPages = Math.max(Math.ceil(totalItems / itemsPerPage), 1);
232
+ const halfWay = Math.ceil(paginationRange / 2);
233
+
234
+ const isStart = currentPage <= halfWay;
235
+ const isEnd = totalPages - halfWay < currentPage;
236
+ const isMiddle = !isStart && !isEnd;
237
+
238
+ const ellipsesNeeded = paginationRange < totalPages;
239
+ let i = 1;
240
+
241
+ while (i <= totalPages && i <= paginationRange) {
242
+ let label: number | '...';
243
+ const pageNumber = calculatePageNumber(i, currentPage, paginationRange, totalPages);
244
+ const openingEllipsesNeeded = i === 2 && (isMiddle || isEnd);
245
+ const closingEllipsesNeeded = i === paginationRange - 1 && (isMiddle || isStart);
246
+ if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) {
247
+ label = '...';
248
+ } else {
249
+ label = pageNumber;
250
+ }
251
+ pages.push(label);
252
+ i++;
253
+ }
254
+
255
+ return pages;
256
+ }
257
+
258
+ /**
259
+ * Given the position in the sequence of pagination links [i],
260
+ * figure out what page number corresponds to that position.
261
+ *
262
+ * Copied from 'ngx-pagination' package
263
+ */
264
+ function calculatePageNumber(
265
+ i: number,
266
+ currentPage: number,
267
+ paginationRange: number,
268
+ totalPages: number,
269
+ ) {
270
+ const halfWay = Math.ceil(paginationRange / 2);
271
+ if (i === paginationRange) {
272
+ return totalPages;
273
+ }
274
+
275
+ if (i === 1) {
276
+ return i;
277
+ }
278
+
279
+ if (paginationRange < totalPages) {
280
+ if (totalPages - halfWay < currentPage) {
281
+ return totalPages - paginationRange + i;
282
+ }
283
+ if (halfWay < currentPage) {
284
+ return currentPage - halfWay + i;
285
+ }
286
+ return i;
287
+ }
288
+
289
+ return i;
290
+ }
@@ -0,0 +1,12 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '@spartan-ng/styles/utils';
3
+
4
+ @Directive({
5
+ selector: 'ul[hlmPaginationContent]',
6
+ host: { 'data-slot': 'pagination-content' },
7
+ })
8
+ export class HlmPaginationContent {
9
+ constructor() {
10
+ classes(() => 'gap-0.5 flex items-center');
11
+ }
12
+ }
@@ -0,0 +1,27 @@
1
+ import { ChangeDetectionStrategy, Component, input } from '@angular/core';
2
+ import { NgIcon, provideIcons } from '@ng-icons/core';
3
+ import { lucideEllipsis } from '@ng-icons/lucide';
4
+ import { classes } from '@spartan-ng/styles/utils';
5
+
6
+ @Component({
7
+ selector: 'hlm-pagination-ellipsis',
8
+ imports: [NgIcon],
9
+ providers: [provideIcons({ lucideEllipsis })],
10
+ changeDetection: ChangeDetectionStrategy.OnPush,
11
+ host: { 'data-slot': 'pagination-ellipsis' },
12
+ template: `
13
+ <ng-icon name="lucideEllipsis" />
14
+ <span class="sr-only">{{ srOnlyText() }}</span>
15
+ `,
16
+ })
17
+ export class HlmPaginationEllipsis {
18
+ /** Screen reader only text for the ellipsis */
19
+ public readonly srOnlyText = input<string>('More pages');
20
+
21
+ constructor() {
22
+ classes(
23
+ () =>
24
+ "size-8 [&_ng-icon:not([class*='text-'])]:text-[length:--spacing(4)] flex items-center justify-center",
25
+ );
26
+ }
27
+ }
@@ -0,0 +1,7 @@
1
+ import { Directive } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: 'li[hlmPaginationItem]',
5
+ host: { 'data-slot': 'pagination-item' },
6
+ })
7
+ export class HlmPaginationItem {}
@@ -0,0 +1,51 @@
1
+ import type { BooleanInput } from '@angular/cdk/coercion';
2
+ import { Directive, booleanAttribute, input } from '@angular/core';
3
+ import { RouterLink } from '@angular/router';
4
+ import { buttonVariants, type ButtonVariants } from '@spartan-ng/styles/button';
5
+ import { classes } from '@spartan-ng/styles/utils';
6
+
7
+ @Directive({
8
+ selector: '[hlmPaginationLink]',
9
+ hostDirectives: [
10
+ {
11
+ directive: RouterLink,
12
+ inputs: [
13
+ 'target',
14
+ 'queryParams',
15
+ 'fragment',
16
+ 'queryParamsHandling',
17
+ 'state',
18
+ 'info',
19
+ 'relativeTo',
20
+ 'preserveFragment',
21
+ 'skipLocationChange',
22
+ 'replaceUrl',
23
+ 'routerLink: link',
24
+ ],
25
+ },
26
+ ],
27
+ host: {
28
+ 'data-slot': 'pagination-link',
29
+ '[attr.data-active]': 'isActive() ? "true" : null',
30
+ '[attr.aria-current]': 'isActive() ? "page" : null',
31
+ },
32
+ })
33
+ export class HlmPaginationLink {
34
+ /** Whether the link is active (i.e., the current page). */
35
+ public readonly isActive = input<boolean, BooleanInput>(false, { transform: booleanAttribute });
36
+ /** The size of the button. */
37
+ public readonly size = input<ButtonVariants['size']>('icon');
38
+ /** The link to navigate to the page. */
39
+ public readonly link = input<RouterLink['routerLink']>();
40
+
41
+ constructor() {
42
+ classes(() => [
43
+ 'relative',
44
+ buttonVariants({
45
+ variant: this.isActive() ? 'outline' : 'ghost',
46
+ size: this.size(),
47
+ }),
48
+ this.link() === undefined && 'cursor-pointer',
49
+ ]);
50
+ }
51
+ }
@@ -0,0 +1,65 @@
1
+ import type { BooleanInput } from '@angular/cdk/coercion';
2
+ import {
3
+ booleanAttribute,
4
+ ChangeDetectionStrategy,
5
+ Component,
6
+ computed,
7
+ input,
8
+ } from '@angular/core';
9
+ import type { RouterLink } from '@angular/router';
10
+ import { NgIcon, provideIcons } from '@ng-icons/core';
11
+ import { lucideChevronRight } from '@ng-icons/lucide';
12
+ import type { ButtonVariants } from '@spartan-ng/styles/button';
13
+ import { hlm } from '@spartan-ng/styles/utils';
14
+ import type { ClassValue } from 'clsx';
15
+ import { HlmPaginationLink } from './hlm-pagination-link';
16
+
17
+ @Component({
18
+ selector: 'hlm-pagination-next',
19
+ imports: [HlmPaginationLink, NgIcon],
20
+ providers: [provideIcons({ lucideChevronRight })],
21
+ changeDetection: ChangeDetectionStrategy.OnPush,
22
+ template: `
23
+ <a
24
+ hlmPaginationLink
25
+ [class]="_computedClass()"
26
+ [link]="link()"
27
+ [queryParams]="queryParams()"
28
+ [queryParamsHandling]="queryParamsHandling()"
29
+ [size]="_size()"
30
+ [attr.aria-label]="ariaLabel()"
31
+ >
32
+ <span [class]="_labelClass()">{{ text() }}</span>
33
+ <ng-icon name="lucideChevronRight" class="rtl:rotate-180" />
34
+ </a>
35
+ `,
36
+ })
37
+ export class HlmPaginationNext {
38
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
39
+ /** The link to navigate to the next page. */
40
+ public readonly link = input<RouterLink['routerLink']>();
41
+ /** The query parameters to pass to the next page. */
42
+ public readonly queryParams = input<RouterLink['queryParams']>();
43
+ /** How to handle query parameters when navigating to the next page. */
44
+ public readonly queryParamsHandling = input<RouterLink['queryParamsHandling']>();
45
+
46
+ /** The aria-label for the next page link. */
47
+ public readonly ariaLabel = input<string>('Go to next page', { alias: 'aria-label' });
48
+ /** The text to display for the next page link. */
49
+ public readonly text = input<string>('Next');
50
+ /** Whether the button should only display the icon. */
51
+ public readonly iconOnly = input<boolean, BooleanInput>(false, {
52
+ transform: booleanAttribute,
53
+ });
54
+ protected readonly _labelClass = computed(() =>
55
+ this.iconOnly() ? 'sr-only' : 'hidden sm:block',
56
+ );
57
+
58
+ protected readonly _size = computed<ButtonVariants['size']>(() =>
59
+ this.iconOnly() ? 'icon' : 'default',
60
+ );
61
+
62
+ protected readonly _computedClass = computed(() =>
63
+ hlm(!this.iconOnly() && 'pe-1.5!', this.userClass()),
64
+ );
65
+ }