@ids-group-ltd/ids-design-system 0.11.4 → 0.12.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 (239) hide show
  1. package/CHANGELOG.md +53 -3
  2. package/components/README.md +86 -0
  3. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +85 -0
  4. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -0
  5. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +70 -0
  6. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -0
  7. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +573 -0
  8. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -0
  9. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +86 -0
  10. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -0
  11. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +615 -0
  12. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -0
  13. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +30 -0
  14. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -0
  15. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +188 -0
  16. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -0
  17. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +59 -0
  18. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -0
  19. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +92 -0
  20. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -0
  21. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +204 -0
  22. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -0
  23. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +100 -0
  24. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -0
  25. package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs +23 -0
  26. package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs.map +1 -0
  27. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +180 -0
  28. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -0
  29. package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +78 -0
  30. package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs.map +1 -0
  31. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +49 -0
  32. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -0
  33. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +73 -0
  34. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -0
  35. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +397 -0
  36. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -0
  37. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +1231 -0
  38. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -0
  39. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +51 -0
  40. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -0
  41. package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs +35 -0
  42. package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs.map +1 -0
  43. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +109 -0
  44. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -0
  45. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +111 -0
  46. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -0
  47. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +52 -0
  48. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -0
  49. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +92 -0
  50. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -0
  51. package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs +62 -0
  52. package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs.map +1 -0
  53. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +164 -0
  54. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -0
  55. package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +85 -0
  56. package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -0
  57. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +223 -0
  58. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -0
  59. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +63 -0
  60. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -0
  61. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +53 -0
  62. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -0
  63. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +43 -0
  64. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -0
  65. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +286 -0
  66. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -0
  67. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +329 -0
  68. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -0
  69. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +612 -0
  70. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -0
  71. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +69 -0
  72. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -0
  73. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +191 -0
  74. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -0
  75. package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs +23 -0
  76. package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs.map +1 -0
  77. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +43 -0
  78. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -0
  79. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +85 -0
  80. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -0
  81. package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +95 -0
  82. package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -0
  83. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +240 -0
  84. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -0
  85. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +41 -0
  86. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +1 -0
  87. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +235 -0
  88. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -0
  89. package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs +62 -0
  90. package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs.map +1 -0
  91. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +173 -0
  92. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -0
  93. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +123 -0
  94. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -0
  95. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +461 -0
  96. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -0
  97. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +107 -0
  98. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -0
  99. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +185 -0
  100. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -0
  101. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +32 -0
  102. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -0
  103. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +204 -0
  104. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -0
  105. package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +25 -0
  106. package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs.map +1 -0
  107. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +53 -0
  108. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -0
  109. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +99 -0
  110. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -0
  111. package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs +26 -0
  112. package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs.map +1 -0
  113. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +74 -0
  114. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -0
  115. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +76 -0
  116. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -0
  117. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +1802 -0
  118. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -0
  119. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +381 -0
  120. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -0
  121. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +44 -0
  122. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -0
  123. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +158 -0
  124. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -0
  125. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +671 -0
  126. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -0
  127. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +41 -0
  128. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -0
  129. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +547 -0
  130. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -0
  131. package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +34 -0
  132. package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -0
  133. package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +218 -0
  134. package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -0
  135. package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs +18 -0
  136. package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs.map +1 -0
  137. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +153 -0
  138. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -0
  139. package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +48 -0
  140. package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -0
  141. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +1338 -0
  142. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -0
  143. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +325 -0
  144. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -0
  145. package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +101 -0
  146. package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -0
  147. package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs +56 -0
  148. package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs.map +1 -0
  149. package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs +37 -0
  150. package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs.map +1 -0
  151. package/fesm2022/ids-group-ltd-ids-design-system.mjs +72 -14267
  152. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  153. package/migrations/0.11.0.json +0 -2
  154. package/migrations/0.11.1.json +2 -1
  155. package/migrations/0.11.2.json +2 -1
  156. package/migrations/0.11.3.json +3 -2
  157. package/migrations/0.11.4.json +7 -1
  158. package/migrations/0.12.0.json +22 -0
  159. package/migrations/0.4.0.json +2 -1
  160. package/migrations/0.7.1.json +2 -1
  161. package/package.json +573 -1
  162. package/themes/README.md +4 -4
  163. package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +48 -0
  164. package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +32 -0
  165. package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +260 -0
  166. package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +75 -0
  167. package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +226 -0
  168. package/types/ids-group-ltd-ids-design-system-components-avatar-group.d.ts +13 -0
  169. package/types/ids-group-ltd-ids-design-system-components-avatar.d.ts +99 -0
  170. package/types/ids-group-ltd-ids-design-system-components-badge.d.ts +25 -0
  171. package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +41 -0
  172. package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +61 -0
  173. package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +66 -0
  174. package/types/ids-group-ltd-ids-design-system-components-button-group.d.ts +10 -0
  175. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +90 -0
  176. package/types/ids-group-ltd-ids-design-system-components-calendar-day.d.ts +41 -0
  177. package/types/ids-group-ltd-ids-design-system-components-card.d.ts +24 -0
  178. package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +41 -0
  179. package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +79 -0
  180. package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +251 -0
  181. package/types/ids-group-ltd-ids-design-system-components-description-list.d.ts +25 -0
  182. package/types/ids-group-ltd-ids-design-system-components-divider.d.ts +22 -0
  183. package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +38 -0
  184. package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +45 -0
  185. package/types/ids-group-ltd-ids-design-system-components-empty-state.d.ts +22 -0
  186. package/types/ids-group-ltd-ids-design-system-components-field-group.d.ts +73 -0
  187. package/types/ids-group-ltd-ids-design-system-components-field-message.d.ts +36 -0
  188. package/types/ids-group-ltd-ids-design-system-components-filter-bar.d.ts +83 -0
  189. package/types/ids-group-ltd-ids-design-system-components-icon-button.d.ts +56 -0
  190. package/types/ids-group-ltd-ids-design-system-components-input.d.ts +121 -0
  191. package/types/ids-group-ltd-ids-design-system-components-layout.d.ts +39 -0
  192. package/types/ids-group-ltd-ids-design-system-components-list.d.ts +29 -0
  193. package/types/ids-group-ltd-ids-design-system-components-loading-overlay.d.ts +31 -0
  194. package/types/ids-group-ltd-ids-design-system-components-menu.d.ts +82 -0
  195. package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +124 -0
  196. package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +213 -0
  197. package/types/ids-group-ltd-ids-design-system-components-number-stepper.d.ts +31 -0
  198. package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +52 -0
  199. package/types/ids-group-ltd-ids-design-system-components-page-footer.d.ts +13 -0
  200. package/types/ids-group-ltd-ids-design-system-components-page-header.d.ts +21 -0
  201. package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +32 -0
  202. package/types/ids-group-ltd-ids-design-system-components-password-rules.d.ts +80 -0
  203. package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +48 -0
  204. package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +22 -0
  205. package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +106 -0
  206. package/types/ids-group-ltd-ids-design-system-components-reserve-messages.d.ts +33 -0
  207. package/types/ids-group-ltd-ids-design-system-components-search.d.ts +82 -0
  208. package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +40 -0
  209. package/types/ids-group-ltd-ids-design-system-components-select.d.ts +152 -0
  210. package/types/ids-group-ltd-ids-design-system-components-sidenav-footer.d.ts +92 -0
  211. package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +131 -0
  212. package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +16 -0
  213. package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +51 -0
  214. package/types/ids-group-ltd-ids-design-system-components-spinner.d.ts +11 -0
  215. package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +38 -0
  216. package/types/ids-group-ltd-ids-design-system-components-stat.d.ts +44 -0
  217. package/types/ids-group-ltd-ids-design-system-components-status-dot.d.ts +12 -0
  218. package/types/ids-group-ltd-ids-design-system-components-stepper.d.ts +32 -0
  219. package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +40 -0
  220. package/types/ids-group-ltd-ids-design-system-components-table.d.ts +791 -0
  221. package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +118 -0
  222. package/types/ids-group-ltd-ids-design-system-components-tag.d.ts +26 -0
  223. package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +85 -0
  224. package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +188 -0
  225. package/types/ids-group-ltd-ids-design-system-components-timeline.d.ts +24 -0
  226. package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +167 -0
  227. package/types/ids-group-ltd-ids-design-system-components-toggle-button.d.ts +18 -0
  228. package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +66 -0
  229. package/types/ids-group-ltd-ids-design-system-components-topbar.d.ts +8 -0
  230. package/types/ids-group-ltd-ids-design-system-components-tree.d.ts +46 -0
  231. package/types/ids-group-ltd-ids-design-system-components-w3w.d.ts +18 -0
  232. package/types/ids-group-ltd-ids-design-system-components.d.ts +604 -0
  233. package/types/ids-group-ltd-ids-design-system-core.d.ts +428 -0
  234. package/types/ids-group-ltd-ids-design-system-icons.d.ts +52 -0
  235. package/types/ids-group-ltd-ids-design-system-overlay.d.ts +32 -0
  236. package/types/ids-group-ltd-ids-design-system-theme.d.ts +29 -0
  237. package/types/ids-group-ltd-ids-design-system.d.ts +72 -5594
  238. package/LICENSE +0 -21
  239. package/README.md +0 -73
@@ -0,0 +1,43 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, booleanAttribute, computed, ViewEncapsulation, Component } from '@angular/core';
3
+
4
+ class PageHeaderComponent {
5
+ /** Small label shown above the title. */
6
+ eyebrow = input('', ...(ngDevMode ? [{ debugName: "eyebrow" }] : /* istanbul ignore next */ []));
7
+ /** Page title, rendered as the `h1`. */
8
+ title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
9
+ /** Supporting line shown under the title. */
10
+ subtitle = input('', ...(ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []));
11
+ /** Tightens spacing for dense layouts. */
12
+ compact = input(false, { ...(ngDevMode ? { debugName: "compact" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
13
+ /** Shows a rule under the whole header. */
14
+ divider = input(false, { ...(ngDevMode ? { debugName: "divider" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
15
+ /** Shows a rule under the meta row only. */
16
+ metaDivider = input(false, { ...(ngDevMode ? { debugName: "metaDivider" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
17
+ classes = computed(() => {
18
+ const parts = ['page-header'];
19
+ if (this.compact()) {
20
+ parts.push('compact');
21
+ }
22
+ if (this.divider()) {
23
+ parts.push('with-divider');
24
+ }
25
+ if (this.metaDivider()) {
26
+ parts.push('with-meta-divider');
27
+ }
28
+ return parts.join(' ');
29
+ }, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
30
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: PageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
31
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: PageHeaderComponent, isStandalone: true, selector: "ds-page-header", inputs: { eyebrow: { classPropertyName: "eyebrow", publicName: "eyebrow", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, divider: { classPropertyName: "divider", publicName: "divider", isSignal: true, isRequired: false, transformFunction: null }, metaDivider: { classPropertyName: "metaDivider", publicName: "metaDivider", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<header [class]=\"classes()\">\n <ng-content select=\"[breadcrumbs]\"></ng-content>\n\n <div class=\"row title-row\">\n <div class=\"title-block\">\n @if (eyebrow()) {\n <div class=\"eyebrow\">\n {{ eyebrow() }}\n </div>\n }\n\n <div class=\"title-line\">\n @if (title()) {\n <h1 class=\"title\">\n {{ title() }}\n </h1>\n }\n\n <ng-content select=\"[title-badge]\"></ng-content>\n </div>\n\n @if (subtitle()) {\n <p class=\"subtitle\">\n {{ subtitle() }}\n </p>\n }\n\n <div class=\"meta\">\n <ng-content select=\"[meta]\"></ng-content>\n </div>\n </div>\n\n <div class=\"actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </div>\n </div>\n\n <ng-content select=\"[tabs]\"></ng-content>\n</header>\n", styles: ["@charset \"UTF-8\";:host{--_page-header-eyebrow-text-color: var(--ds-page-header-eyebrow-text-color, var(--text-tertiary));--_page-header-title-text-color: var(--ds-page-header-title-text-color, var(--text-primary));--_page-header-subtitle-text-color: var(--ds-page-header-subtitle-text-color, var(--text-secondary));--_page-header-meta-text-color: var(--ds-page-header-meta-text-color, var(--text-secondary));--_page-header-meta-icon-color: var(--ds-page-header-meta-icon-color, var(--icon-default));--_page-header-crumb-text-color: var(--ds-page-header-crumb-text-color, var(--text-tertiary));--_page-header-crumb-text-color-hover: var(--ds-page-header-crumb-text-color-hover, var(--accent));--_page-header-divider: var(--ds-page-header-divider, var(--border-divider));--_page-header-title-fs: var(--ds-page-header-title-fs, var(--font-size-h3));--_page-header-title-gap: var(--ds-page-header-title-gap, var(--space-1-5));display:block}:host(.eyebrow-secondary){--_page-header-eyebrow-text-color: var(--ds-page-header-eyebrow-text-color, var(--secondary-strong))}.page-header{display:flex;flex-direction:column;gap:var(--space-3)}.page-header.with-divider{padding-bottom:var(--space-4);border-bottom:var(--border-width-default) solid var(--_page-header-divider)}.page-header:has(>[tabs]){padding-bottom:0;border-bottom:0}.page-header .row{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-4);flex-wrap:wrap}.page-header .title-block{display:flex;flex-direction:column;gap:var(--_page-header-title-gap);min-width:0;flex:1 1 0;align-self:flex-start}.page-header .eyebrow{font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-wide);text-transform:uppercase;color:var(--_page-header-eyebrow-text-color)}.page-header .title{font:var(--font-weight-extrabold) var(--_page-header-title-fs)/var(--line-height-tight) var(--font-display);color:var(--_page-header-title-text-color);margin:0;letter-spacing:var(--letter-spacing-tight)}.page-header .title-line{display:flex;align-items:center;gap:var(--space-3);flex-wrap:wrap}.page-header .crumbs-trail{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-tertiary);min-width:0;flex-wrap:nowrap;overflow:hidden;padding-bottom:var(--space-1)}.page-header .crumb{color:var(--_page-header-crumb-text-color);text-decoration:none;display:inline-flex;align-items:center;gap:var(--space-1);overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap;max-width:24ch;transition:color var(--duration-fast) var(--ease-standard)}.page-header .crumb:hover{color:var(--_page-header-crumb-text-color-hover)}.page-header .crumb.crumb--current{color:var(--text-primary);font-weight:var(--font-weight-bold);max-width:32ch}.page-header .crumb-sep{color:var(--icon-muted);display:inline-flex;align-items:center}.page-header .subtitle{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_page-header-subtitle-text-color);margin:0}.page-header .actions{display:flex;align-items:flex-end;gap:var(--space-2);flex-shrink:0;align-self:flex-start}@media(width<768px){.page-header .actions{width:100%}}.page-header .meta{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3);margin-top:var(--space-1-5)}.page-header .meta:not(:has(>*)){display:none}.page-header.with-meta-divider .meta{padding-top:var(--space-2);border-top:var(--border-width-default) solid var(--_page-header-divider)}.page-header .meta-item{display:inline-flex;align-items:center;gap:var(--space-1-5);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);color:var(--_page-header-meta-text-color)}.page-header .meta-item .icon{width:var(--icon-sm);height:var(--icon-sm);color:var(--_page-header-meta-icon-color)}.page-header.compact{--_page-header-title-fs: var(--ds-page-header-title-fs, var(--font-size-h4));gap:var(--space-2);padding-bottom:var(--space-3)}\n"] });
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: PageHeaderComponent, decorators: [{
34
+ type: Component,
35
+ args: [{ selector: 'ds-page-header', standalone: true, encapsulation: ViewEncapsulation.Emulated, template: "<header [class]=\"classes()\">\n <ng-content select=\"[breadcrumbs]\"></ng-content>\n\n <div class=\"row title-row\">\n <div class=\"title-block\">\n @if (eyebrow()) {\n <div class=\"eyebrow\">\n {{ eyebrow() }}\n </div>\n }\n\n <div class=\"title-line\">\n @if (title()) {\n <h1 class=\"title\">\n {{ title() }}\n </h1>\n }\n\n <ng-content select=\"[title-badge]\"></ng-content>\n </div>\n\n @if (subtitle()) {\n <p class=\"subtitle\">\n {{ subtitle() }}\n </p>\n }\n\n <div class=\"meta\">\n <ng-content select=\"[meta]\"></ng-content>\n </div>\n </div>\n\n <div class=\"actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </div>\n </div>\n\n <ng-content select=\"[tabs]\"></ng-content>\n</header>\n", styles: ["@charset \"UTF-8\";:host{--_page-header-eyebrow-text-color: var(--ds-page-header-eyebrow-text-color, var(--text-tertiary));--_page-header-title-text-color: var(--ds-page-header-title-text-color, var(--text-primary));--_page-header-subtitle-text-color: var(--ds-page-header-subtitle-text-color, var(--text-secondary));--_page-header-meta-text-color: var(--ds-page-header-meta-text-color, var(--text-secondary));--_page-header-meta-icon-color: var(--ds-page-header-meta-icon-color, var(--icon-default));--_page-header-crumb-text-color: var(--ds-page-header-crumb-text-color, var(--text-tertiary));--_page-header-crumb-text-color-hover: var(--ds-page-header-crumb-text-color-hover, var(--accent));--_page-header-divider: var(--ds-page-header-divider, var(--border-divider));--_page-header-title-fs: var(--ds-page-header-title-fs, var(--font-size-h3));--_page-header-title-gap: var(--ds-page-header-title-gap, var(--space-1-5));display:block}:host(.eyebrow-secondary){--_page-header-eyebrow-text-color: var(--ds-page-header-eyebrow-text-color, var(--secondary-strong))}.page-header{display:flex;flex-direction:column;gap:var(--space-3)}.page-header.with-divider{padding-bottom:var(--space-4);border-bottom:var(--border-width-default) solid var(--_page-header-divider)}.page-header:has(>[tabs]){padding-bottom:0;border-bottom:0}.page-header .row{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-4);flex-wrap:wrap}.page-header .title-block{display:flex;flex-direction:column;gap:var(--_page-header-title-gap);min-width:0;flex:1 1 0;align-self:flex-start}.page-header .eyebrow{font:var(--font-weight-bold) var(--font-size-2xs)/var(--line-height-flat) var(--font-sans);letter-spacing:var(--letter-spacing-wide);text-transform:uppercase;color:var(--_page-header-eyebrow-text-color)}.page-header .title{font:var(--font-weight-extrabold) var(--_page-header-title-fs)/var(--line-height-tight) var(--font-display);color:var(--_page-header-title-text-color);margin:0;letter-spacing:var(--letter-spacing-tight)}.page-header .title-line{display:flex;align-items:center;gap:var(--space-3);flex-wrap:wrap}.page-header .crumbs-trail{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--text-tertiary);min-width:0;flex-wrap:nowrap;overflow:hidden;padding-bottom:var(--space-1)}.page-header .crumb{color:var(--_page-header-crumb-text-color);text-decoration:none;display:inline-flex;align-items:center;gap:var(--space-1);overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap;max-width:24ch;transition:color var(--duration-fast) var(--ease-standard)}.page-header .crumb:hover{color:var(--_page-header-crumb-text-color-hover)}.page-header .crumb.crumb--current{color:var(--text-primary);font-weight:var(--font-weight-bold);max-width:32ch}.page-header .crumb-sep{color:var(--icon-muted);display:inline-flex;align-items:center}.page-header .subtitle{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_page-header-subtitle-text-color);margin:0}.page-header .actions{display:flex;align-items:flex-end;gap:var(--space-2);flex-shrink:0;align-self:flex-start}@media(width<768px){.page-header .actions{width:100%}}.page-header .meta{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3);margin-top:var(--space-1-5)}.page-header .meta:not(:has(>*)){display:none}.page-header.with-meta-divider .meta{padding-top:var(--space-2);border-top:var(--border-width-default) solid var(--_page-header-divider)}.page-header .meta-item{display:inline-flex;align-items:center;gap:var(--space-1-5);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);color:var(--_page-header-meta-text-color)}.page-header .meta-item .icon{width:var(--icon-sm);height:var(--icon-sm);color:var(--_page-header-meta-icon-color)}.page-header.compact{--_page-header-title-fs: var(--ds-page-header-title-fs, var(--font-size-h4));gap:var(--space-2);padding-bottom:var(--space-3)}\n"] }]
36
+ }], propDecorators: { eyebrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "eyebrow", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], divider: [{ type: i0.Input, args: [{ isSignal: true, alias: "divider", required: false }] }], metaDivider: [{ type: i0.Input, args: [{ isSignal: true, alias: "metaDivider", required: false }] }] } });
37
+
38
+ /**
39
+ * Generated bundle index. Do not edit.
40
+ */
41
+
42
+ export { PageHeaderComponent };
43
+ //# sourceMappingURL=ids-group-ltd-ids-design-system-components-page-header.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-page-header.mjs","sources":["../../../src/lib/components/page-header/page-header.component.ts","../../../src/lib/components/page-header/page-header.component.html","../../../src/lib/components/page-header/ids-group-ltd-ids-design-system-components-page-header.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n} from '@angular/core';\n\n@Component({\n selector: 'ds-page-header',\n standalone: true,\n templateUrl: './page-header.component.html',\n styleUrl: './page-header.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class PageHeaderComponent {\n /** Small label shown above the title. */\n readonly eyebrow = input<string>('');\n /** Page title, rendered as the `h1`. */\n readonly title = input<string>('');\n /** Supporting line shown under the title. */\n readonly subtitle = input<string>('');\n /** Tightens spacing for dense layouts. */\n readonly compact = input(false, { transform: booleanAttribute });\n /** Shows a rule under the whole header. */\n readonly divider = input(false, { transform: booleanAttribute });\n /** Shows a rule under the meta row only. */\n readonly metaDivider = input(false, { transform: booleanAttribute });\n\n protected readonly classes = computed(() => {\n const parts = ['page-header'];\n if (this.compact()) {\n parts.push('compact');\n }\n if (this.divider()) {\n parts.push('with-divider');\n }\n if (this.metaDivider()) {\n parts.push('with-meta-divider');\n }\n\n return parts.join(' ');\n });\n}\n","<header [class]=\"classes()\">\n <ng-content select=\"[breadcrumbs]\"></ng-content>\n\n <div class=\"row title-row\">\n <div class=\"title-block\">\n @if (eyebrow()) {\n <div class=\"eyebrow\">\n {{ eyebrow() }}\n </div>\n }\n\n <div class=\"title-line\">\n @if (title()) {\n <h1 class=\"title\">\n {{ title() }}\n </h1>\n }\n\n <ng-content select=\"[title-badge]\"></ng-content>\n </div>\n\n @if (subtitle()) {\n <p class=\"subtitle\">\n {{ subtitle() }}\n </p>\n }\n\n <div class=\"meta\">\n <ng-content select=\"[meta]\"></ng-content>\n </div>\n </div>\n\n <div class=\"actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </div>\n </div>\n\n <ng-content select=\"[tabs]\"></ng-content>\n</header>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAea,mBAAmB,CAAA;;AAErB,IAAA,OAAO,GAAG,KAAK,CAAS,EAAE,8EAAC;;AAE3B,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;;AAEzB,IAAA,QAAQ,GAAG,KAAK,CAAS,EAAE,+EAAC;;IAE5B,OAAO,GAAG,KAAK,CAAC,KAAK,+EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAEvD,OAAO,GAAG,KAAK,CAAC,KAAK,+EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAEvD,WAAW,GAAG,KAAK,CAAC,KAAK,mFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEjD,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,QAAA,MAAM,KAAK,GAAG,CAAC,aAAa,CAAC;AAC7B,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;AAClB,YAAA,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;QACvB;AACA,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;AAClB,YAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC;QAC5B;AACA,QAAA,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;AACtB,YAAA,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC;QACjC;AAEA,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AACxB,IAAA,CAAC,8EAAC;wGA3BS,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,mBAAmB,m1BCfhC,62BAuCA,EAAA,MAAA,EAAA,CAAA,y/HAAA,CAAA,EAAA,CAAA;;4FDxBa,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAP/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,aAAA,EAGD,iBAAiB,CAAC,QAAQ,EAAA,QAAA,EAAA,62BAAA,EAAA,MAAA,EAAA,CAAA,y/HAAA,CAAA,EAAA;;;AEb3C;;AAEG;;;;"}
@@ -0,0 +1,85 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, model, booleanAttribute, computed, ViewEncapsulation, Component } from '@angular/core';
3
+ import { FormsModule } from '@angular/forms';
4
+ import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
5
+ import { SelectComponent } from '@ids-group-ltd/ids-design-system/components/select';
6
+
7
+ class PaginationComponent {
8
+ /** Total item count, used to compute the page count. */
9
+ total = input.required(...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
10
+ /** Items per page, two-way bound. */
11
+ pageSize = model(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
12
+ /** 1-based active page, two-way bound; a page change (incl. the reset to 1
13
+ * after a size change) emits via the implicit `currentPageChange`. */
14
+ currentPage = model(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []));
15
+ /** Preset choices offered in the page-size dropdown. */
16
+ pageSizeOptions = input([10, 25, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : /* istanbul ignore next */ []));
17
+ /** Shows the "Showing X–Y of Z" range label. */
18
+ showLabel = input(true, { ...(ngDevMode ? { debugName: "showLabel" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
19
+ /** Shows the rows-per-page dropdown. Turn it off for a screen with a fixed
20
+ * page size — otherwise the control offers a choice the host won't honour. */
21
+ showPageSize = input(true, { ...(ngDevMode ? { debugName: "showPageSize" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
22
+ totalPages = computed(() => Math.max(1, Math.ceil(this.total() / this.pageSize())), ...(ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []));
23
+ pageItems = computed(() => {
24
+ const total = this.totalPages();
25
+ const current = this.currentPage();
26
+ if (total <= 7) {
27
+ return Array.from({ length: total }, (_, i) => i + 1);
28
+ }
29
+ const items = [1];
30
+ if (current > 3) {
31
+ items.push('ellipsis');
32
+ }
33
+ const start = Math.max(2, current - 1);
34
+ const end = Math.min(total - 1, current + 1);
35
+ for (let i = start; i <= end; i++) {
36
+ items.push(i);
37
+ }
38
+ if (current < total - 2) {
39
+ items.push('ellipsis');
40
+ }
41
+ items.push(total);
42
+ return items;
43
+ }, ...(ngDevMode ? [{ debugName: "pageItems" }] : /* istanbul ignore next */ []));
44
+ rangeLabel = computed(() => {
45
+ const start = (this.currentPage() - 1) * this.pageSize() + 1;
46
+ const end = Math.min(this.currentPage() * this.pageSize(), this.total());
47
+ return `Showing ${start}–${end} of ${this.total()}`;
48
+ }, ...(ngDevMode ? [{ debugName: "rangeLabel" }] : /* istanbul ignore next */ []));
49
+ sizeOptions = computed(() => {
50
+ const presets = this.pageSizeOptions();
51
+ const current = this.pageSize();
52
+ const merged = presets.includes(current)
53
+ ? presets
54
+ : [current, ...presets].sort((a, b) => a - b);
55
+ return merged.map((size) => ({
56
+ label: `${size} per page`,
57
+ value: String(size),
58
+ }));
59
+ }, ...(ngDevMode ? [{ debugName: "sizeOptions" }] : /* istanbul ignore next */ []));
60
+ pageSizeStr = computed(() => String(this.pageSize()), ...(ngDevMode ? [{ debugName: "pageSizeStr" }] : /* istanbul ignore next */ []));
61
+ goTo(page) {
62
+ if (page < 1 || page > this.totalPages() || page === this.currentPage()) {
63
+ return;
64
+ }
65
+ this.currentPage.set(page);
66
+ }
67
+ onSizeChange(value) {
68
+ const next = Number(value);
69
+ this.pageSize.set(next);
70
+ this.currentPage.set(1);
71
+ }
72
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
73
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: PaginationComponent, isStandalone: true, selector: "ds-pagination", inputs: { total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: true, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, showPageSize: { classPropertyName: "showPageSize", publicName: "showPageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageSize: "pageSizeChange", currentPage: "currentPageChange" }, ngImport: i0, template: "<nav\n class=\"pagination\"\n aria-label=\"Pagination\"\n>\n @if (showLabel()) {\n <span class=\"label\">\n {{ rangeLabel() }}\n </span>\n }\n\n <button\n class=\"pagination-button\"\n type=\"button\"\n aria-label=\"Previous page\"\n [disabled]=\"currentPage() === 1\"\n (click)=\"goTo(currentPage() - 1)\"\n >\n <ds-icon\n name=\"chevronLeft\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n\n @for (item of pageItems(); track $index) {\n @if (item === 'ellipsis') {\n <span\n class=\"ellipsis\"\n aria-hidden=\"true\"\n >\n \u2026\n </span>\n } @else {\n <button\n class=\"pagination-button\"\n type=\"button\"\n [class.active]=\"item === currentPage()\"\n [attr.aria-label]=\"'Page ' + item\"\n [attr.aria-current]=\"item === currentPage() ? 'page' : null\"\n (click)=\"goTo(item)\"\n >\n {{ item }}\n </button>\n }\n }\n\n <button\n class=\"pagination-button\"\n type=\"button\"\n aria-label=\"Next page\"\n [disabled]=\"currentPage() === totalPages()\"\n (click)=\"goTo(currentPage() + 1)\"\n >\n <ds-icon\n name=\"chevronRight\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n\n @if (showPageSize()) {\n <!-- reserveMessage pinned off: a page-size dropdown shows neither hint nor\n error, so there is nothing to reserve, and inheriting the app-level\n default would push the control off the page buttons' baseline. -->\n <ds-select\n class=\"size\"\n ariaLabel=\"Rows per page\"\n size=\"sm\"\n [reserveMessage]=\"false\"\n [options]=\"sizeOptions()\"\n [value]=\"pageSizeStr()\"\n (valueChange)=\"onSizeChange($event)\"\n >\n </ds-select>\n }\n</nav>\n", styles: [":host{--_pagination-btn-bg-color: var(--ds-pagination-btn-bg-color, var(--surface-default));--_pagination-btn-bg-color-hover: var(--ds-pagination-btn-bg-color-hover, var(--surface-secondary));--_pagination-btn-label-color: var(--ds-pagination-btn-label-color, var(--text-secondary));--_pagination-btn-label-color-hover: var(--ds-pagination-btn-label-color-hover, var(--text-primary));--_pagination-btn-border: var(--ds-pagination-btn-border, var(--border-default));--_pagination-active-bg-color: var(--ds-pagination-active-bg-color, var(--accent));--_pagination-active-bg-color-hover: var(--ds-pagination-active-bg-color-hover, var(--accent-hover));--_pagination-active-label-color: var(--ds-pagination-active-label-color, var(--accent-on));--_pagination-radius: var(--ds-pagination-radius, var(--ds-radius-control));--_pagination-focus-shadow: var(--ds-pagination-focus-shadow, var(--ds-control-focus-shadow));--_pagination-label-font-size: var(--ds-pagination-label-font-size, var(--font-size-s));--_pagination-label-weight: var(--ds-pagination-label-weight, var(--font-weight-regular));--_pagination-label-color: var(--ds-pagination-label-color, var(--text-secondary));display:inline-flex}.pagination{display:inline-flex;gap:var(--space-1);align-items:center;flex-wrap:wrap}.pagination .label{font:var(--_pagination-label-weight) var(--_pagination-label-font-size)/var(--line-height-flat) var(--font-sans);color:var(--_pagination-label-color);margin-right:var(--space-2)}.pagination .pagination-button{min-width:var(--hit-min);height:var(--hit-min);padding:0 var(--space-2);border:var(--border-width-default) solid var(--_pagination-btn-border);background-color:var(--_pagination-btn-bg-color);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_pagination-btn-label-color);border-radius:var(--_pagination-radius);cursor:pointer;display:inline-grid;place-items:center;transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.pagination .pagination-button:hover:not([disabled],.active){background-color:var(--_pagination-btn-bg-color-hover);color:var(--_pagination-btn-label-color-hover)}.pagination .pagination-button.active{background-color:var(--_pagination-active-bg-color);color:var(--_pagination-active-label-color);border-color:var(--_pagination-active-bg-color)}.pagination .pagination-button.active:hover:not([disabled]){background-color:var(--_pagination-active-bg-color-hover);border-color:var(--_pagination-active-bg-color-hover)}.pagination .pagination-button[disabled]{color:var(--text-disabled);cursor:not-allowed}.pagination .pagination-button:focus-visible{outline:none;box-shadow:var(--_pagination-focus-shadow)}.pagination .pagination-button:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.pagination .ellipsis{padding:0 var(--space-2);color:var(--text-tertiary)}.pagination .size{margin-left:var(--space-2);width:auto;flex:0 0 auto}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: SelectComponent, selector: "ds-select", inputs: ["value", "options", "width", "placeholder", "size", "label", "disabled", "loading", "scrollActiveIntoView", "readOnly", "readonly", "success", "required", "optional", "name", "ariaLabel", "clearable"], outputs: ["valueChange", "opened", "closed"] }] });
74
+ }
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: PaginationComponent, decorators: [{
76
+ type: Component,
77
+ args: [{ selector: 'ds-pagination', standalone: true, imports: [FormsModule, IconComponent, SelectComponent], encapsulation: ViewEncapsulation.Emulated, template: "<nav\n class=\"pagination\"\n aria-label=\"Pagination\"\n>\n @if (showLabel()) {\n <span class=\"label\">\n {{ rangeLabel() }}\n </span>\n }\n\n <button\n class=\"pagination-button\"\n type=\"button\"\n aria-label=\"Previous page\"\n [disabled]=\"currentPage() === 1\"\n (click)=\"goTo(currentPage() - 1)\"\n >\n <ds-icon\n name=\"chevronLeft\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n\n @for (item of pageItems(); track $index) {\n @if (item === 'ellipsis') {\n <span\n class=\"ellipsis\"\n aria-hidden=\"true\"\n >\n \u2026\n </span>\n } @else {\n <button\n class=\"pagination-button\"\n type=\"button\"\n [class.active]=\"item === currentPage()\"\n [attr.aria-label]=\"'Page ' + item\"\n [attr.aria-current]=\"item === currentPage() ? 'page' : null\"\n (click)=\"goTo(item)\"\n >\n {{ item }}\n </button>\n }\n }\n\n <button\n class=\"pagination-button\"\n type=\"button\"\n aria-label=\"Next page\"\n [disabled]=\"currentPage() === totalPages()\"\n (click)=\"goTo(currentPage() + 1)\"\n >\n <ds-icon\n name=\"chevronRight\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n\n @if (showPageSize()) {\n <!-- reserveMessage pinned off: a page-size dropdown shows neither hint nor\n error, so there is nothing to reserve, and inheriting the app-level\n default would push the control off the page buttons' baseline. -->\n <ds-select\n class=\"size\"\n ariaLabel=\"Rows per page\"\n size=\"sm\"\n [reserveMessage]=\"false\"\n [options]=\"sizeOptions()\"\n [value]=\"pageSizeStr()\"\n (valueChange)=\"onSizeChange($event)\"\n >\n </ds-select>\n }\n</nav>\n", styles: [":host{--_pagination-btn-bg-color: var(--ds-pagination-btn-bg-color, var(--surface-default));--_pagination-btn-bg-color-hover: var(--ds-pagination-btn-bg-color-hover, var(--surface-secondary));--_pagination-btn-label-color: var(--ds-pagination-btn-label-color, var(--text-secondary));--_pagination-btn-label-color-hover: var(--ds-pagination-btn-label-color-hover, var(--text-primary));--_pagination-btn-border: var(--ds-pagination-btn-border, var(--border-default));--_pagination-active-bg-color: var(--ds-pagination-active-bg-color, var(--accent));--_pagination-active-bg-color-hover: var(--ds-pagination-active-bg-color-hover, var(--accent-hover));--_pagination-active-label-color: var(--ds-pagination-active-label-color, var(--accent-on));--_pagination-radius: var(--ds-pagination-radius, var(--ds-radius-control));--_pagination-focus-shadow: var(--ds-pagination-focus-shadow, var(--ds-control-focus-shadow));--_pagination-label-font-size: var(--ds-pagination-label-font-size, var(--font-size-s));--_pagination-label-weight: var(--ds-pagination-label-weight, var(--font-weight-regular));--_pagination-label-color: var(--ds-pagination-label-color, var(--text-secondary));display:inline-flex}.pagination{display:inline-flex;gap:var(--space-1);align-items:center;flex-wrap:wrap}.pagination .label{font:var(--_pagination-label-weight) var(--_pagination-label-font-size)/var(--line-height-flat) var(--font-sans);color:var(--_pagination-label-color);margin-right:var(--space-2)}.pagination .pagination-button{min-width:var(--hit-min);height:var(--hit-min);padding:0 var(--space-2);border:var(--border-width-default) solid var(--_pagination-btn-border);background-color:var(--_pagination-btn-bg-color);font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_pagination-btn-label-color);border-radius:var(--_pagination-radius);cursor:pointer;display:inline-grid;place-items:center;transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard)}.pagination .pagination-button:hover:not([disabled],.active){background-color:var(--_pagination-btn-bg-color-hover);color:var(--_pagination-btn-label-color-hover)}.pagination .pagination-button.active{background-color:var(--_pagination-active-bg-color);color:var(--_pagination-active-label-color);border-color:var(--_pagination-active-bg-color)}.pagination .pagination-button.active:hover:not([disabled]){background-color:var(--_pagination-active-bg-color-hover);border-color:var(--_pagination-active-bg-color-hover)}.pagination .pagination-button[disabled]{color:var(--text-disabled);cursor:not-allowed}.pagination .pagination-button:focus-visible{outline:none;box-shadow:var(--_pagination-focus-shadow)}.pagination .pagination-button:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.pagination .ellipsis{padding:0 var(--space-2);color:var(--text-tertiary)}.pagination .size{margin-left:var(--space-2);width:auto;flex:0 0 auto}\n"] }]
78
+ }], propDecorators: { total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: true }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: false }] }, { type: i0.Output, args: ["currentPageChange"] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], showPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSize", required: false }] }] } });
79
+
80
+ /**
81
+ * Generated bundle index. Do not edit.
82
+ */
83
+
84
+ export { PaginationComponent };
85
+ //# sourceMappingURL=ids-group-ltd-ids-design-system-components-pagination.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-pagination.mjs","sources":["../../../src/lib/components/pagination/pagination.component.ts","../../../src/lib/components/pagination/pagination.component.html","../../../src/lib/components/pagination/ids-group-ltd-ids-design-system-components-pagination.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n model,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { SelectComponent } from '@ids-group-ltd/ids-design-system/components/select';\n\n@Component({\n selector: 'ds-pagination',\n standalone: true,\n imports: [FormsModule, IconComponent, SelectComponent],\n templateUrl: './pagination.component.html',\n styleUrl: './pagination.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class PaginationComponent {\n /** Total item count, used to compute the page count. */\n readonly total = input.required<number>();\n /** Items per page, two-way bound. */\n readonly pageSize = model<number>(10);\n /** 1-based active page, two-way bound; a page change (incl. the reset to 1\n * after a size change) emits via the implicit `currentPageChange`. */\n readonly currentPage = model<number>(1);\n /** Preset choices offered in the page-size dropdown. */\n readonly pageSizeOptions = input<number[]>([10, 25, 50, 100]);\n /** Shows the \"Showing X–Y of Z\" range label. */\n readonly showLabel = input(true, { transform: booleanAttribute });\n /** Shows the rows-per-page dropdown. Turn it off for a screen with a fixed\n * page size — otherwise the control offers a choice the host won't honour. */\n readonly showPageSize = input(true, { transform: booleanAttribute });\n\n protected readonly totalPages = computed(() =>\n Math.max(1, Math.ceil(this.total() / this.pageSize())),\n );\n\n protected readonly pageItems = computed<(number | 'ellipsis')[]>(() => {\n const total = this.totalPages();\n const current = this.currentPage();\n if (total <= 7) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n const items: (number | 'ellipsis')[] = [1];\n if (current > 3) {\n items.push('ellipsis');\n }\n const start = Math.max(2, current - 1);\n const end = Math.min(total - 1, current + 1);\n for (let i = start; i <= end; i++) {\n items.push(i);\n }\n if (current < total - 2) {\n items.push('ellipsis');\n }\n items.push(total);\n\n return items;\n });\n\n protected readonly rangeLabel = computed(() => {\n const start = (this.currentPage() - 1) * this.pageSize() + 1;\n const end = Math.min(this.currentPage() * this.pageSize(), this.total());\n\n return `Showing ${start}–${end} of ${this.total()}`;\n });\n\n protected readonly sizeOptions = computed(() => {\n const presets = this.pageSizeOptions();\n const current = this.pageSize();\n const merged = presets.includes(current)\n ? presets\n : [current, ...presets].sort((a, b) => a - b);\n\n return merged.map((size) => ({\n label: `${size} per page`,\n value: String(size),\n }));\n });\n\n protected readonly pageSizeStr = computed(() => String(this.pageSize()));\n\n protected goTo(page: number): void {\n if (page < 1 || page > this.totalPages() || page === this.currentPage()) {\n return;\n }\n this.currentPage.set(page);\n }\n\n protected onSizeChange(value: string): void {\n const next = Number(value);\n this.pageSize.set(next);\n this.currentPage.set(1);\n }\n}\n","<nav\n class=\"pagination\"\n aria-label=\"Pagination\"\n>\n @if (showLabel()) {\n <span class=\"label\">\n {{ rangeLabel() }}\n </span>\n }\n\n <button\n class=\"pagination-button\"\n type=\"button\"\n aria-label=\"Previous page\"\n [disabled]=\"currentPage() === 1\"\n (click)=\"goTo(currentPage() - 1)\"\n >\n <ds-icon\n name=\"chevronLeft\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n\n @for (item of pageItems(); track $index) {\n @if (item === 'ellipsis') {\n <span\n class=\"ellipsis\"\n aria-hidden=\"true\"\n >\n …\n </span>\n } @else {\n <button\n class=\"pagination-button\"\n type=\"button\"\n [class.active]=\"item === currentPage()\"\n [attr.aria-label]=\"'Page ' + item\"\n [attr.aria-current]=\"item === currentPage() ? 'page' : null\"\n (click)=\"goTo(item)\"\n >\n {{ item }}\n </button>\n }\n }\n\n <button\n class=\"pagination-button\"\n type=\"button\"\n aria-label=\"Next page\"\n [disabled]=\"currentPage() === totalPages()\"\n (click)=\"goTo(currentPage() + 1)\"\n >\n <ds-icon\n name=\"chevronRight\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n\n @if (showPageSize()) {\n <!-- reserveMessage pinned off: a page-size dropdown shows neither hint nor\n error, so there is nothing to reserve, and inheriting the app-level\n default would push the control off the page buttons' baseline. -->\n <ds-select\n class=\"size\"\n ariaLabel=\"Rows per page\"\n size=\"sm\"\n [reserveMessage]=\"false\"\n [options]=\"sizeOptions()\"\n [value]=\"pageSizeStr()\"\n (valueChange)=\"onSizeChange($event)\"\n >\n </ds-select>\n }\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAoBa,mBAAmB,CAAA;;AAErB,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;;AAEhC,IAAA,QAAQ,GAAG,KAAK,CAAS,EAAE,+EAAC;AACrC;AACuE;AAC9D,IAAA,WAAW,GAAG,KAAK,CAAS,CAAC,kFAAC;;AAE9B,IAAA,eAAe,GAAG,KAAK,CAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,sFAAC;;IAEpD,SAAS,GAAG,KAAK,CAAC,IAAI,iFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AACjE;AAC+E;IACtE,YAAY,GAAG,KAAK,CAAC,IAAI,oFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEjD,IAAA,UAAU,GAAG,QAAQ,CAAC,MACvC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CACvD;AAEkB,IAAA,SAAS,GAAG,QAAQ,CAA0B,MAAK;AACpE,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE;AAC/B,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE;AAClC,QAAA,IAAI,KAAK,IAAI,CAAC,EAAE;YACd,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvD;AACA,QAAA,MAAM,KAAK,GAA4B,CAAC,CAAC,CAAC;AAC1C,QAAA,IAAI,OAAO,GAAG,CAAC,EAAE;AACf,YAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;QACxB;AACA,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC;AACtC,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC;AAC5C,QAAA,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE;AACjC,YAAA,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACf;AACA,QAAA,IAAI,OAAO,GAAG,KAAK,GAAG,CAAC,EAAE;AACvB,YAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;QACxB;AACA,QAAA,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AAEjB,QAAA,OAAO,KAAK;AACd,IAAA,CAAC,gFAAC;AAEiB,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;AAC5C,QAAA,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;QAC5D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;QAExE,OAAO,CAAA,QAAA,EAAW,KAAK,CAAA,CAAA,EAAI,GAAG,CAAA,IAAA,EAAO,IAAI,CAAC,KAAK,EAAE,CAAA,CAAE;AACrD,IAAA,CAAC,iFAAC;AAEiB,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;AAC7C,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE;AACtC,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE;AAC/B,QAAA,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO;AACrC,cAAE;cACA,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE/C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM;YAC3B,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,SAAA,CAAW;AACzB,YAAA,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC;AACpB,SAAA,CAAC,CAAC;AACL,IAAA,CAAC,kFAAC;AAEiB,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,kFAAC;AAE9D,IAAA,IAAI,CAAC,IAAY,EAAA;AACzB,QAAA,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE;YACvE;QACF;AACA,QAAA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC;IAC5B;AAEU,IAAA,YAAY,CAAC,KAAa,EAAA;AAClC,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AAC1B,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;AACvB,QAAA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB;wGA5EW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,mBAAmB,y8BCpBhC,gyDA4EA,EAAA,MAAA,EAAA,CAAA,kjGAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,ED7DY,WAAW,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,aAAa,qGAAE,eAAe,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,aAAA,EAAA,MAAA,EAAA,OAAA,EAAA,UAAA,EAAA,SAAA,EAAA,sBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,SAAA,EAAA,UAAA,EAAA,UAAA,EAAA,MAAA,EAAA,WAAA,EAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAK1C,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAR/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,UAAA,EACb,IAAI,EAAA,OAAA,EACP,CAAC,WAAW,EAAE,aAAa,EAAE,eAAe,CAAC,EAAA,aAAA,EAGvC,iBAAiB,CAAC,QAAQ,EAAA,QAAA,EAAA,gyDAAA,EAAA,MAAA,EAAA,CAAA,kjGAAA,CAAA,EAAA;;;AElB3C;;AAEG;;;;"}
@@ -0,0 +1,95 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, booleanAttribute, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
+ import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
4
+ import { nextControlId } from '@ids-group-ltd/ids-design-system/components';
5
+
6
+ // Screen-reader wording per state. The glyph is a decorative SVG with no
7
+ // accessible name, so without these a screen reader hears the rule text and
8
+ // nothing about whether it passed — the state would be conveyed by colour and
9
+ // shape only.
10
+ const ANNOUNCED = {
11
+ pending: 'not yet met',
12
+ met: 'met',
13
+ failed: 'not met',
14
+ };
15
+ /**
16
+ * Passes when every rule does. Exported separately so a form can gate its submit
17
+ * from a validator without reaching for the component instance.
18
+ */
19
+ function passwordRulesMet(value, rules) {
20
+ return rules.length > 0 && rules.every((rule) => rule.test(value));
21
+ }
22
+ /**
23
+ * Live checklist under a "new password" field.
24
+ *
25
+ * The consumer keeps the POLICY — each rule carries its own `test`, which has to
26
+ * mirror the server, or the checklist is a lie — and this owns the rendering: the
27
+ * tri-state glyph, the met and failed colours, the type scale. One consumer had
28
+ * written it twice and the copies had already drifted (different labels for the
29
+ * same rule, a different order, different state classes), which is why it is here.
30
+ *
31
+ * ```html
32
+ * <ds-input
33
+ * type="password"
34
+ * [attr.aria-describedby]="rules.listId"
35
+ * [(value)]="password"
36
+ * />
37
+ * <ds-password-rules
38
+ * #rules
39
+ * [value]="password()"
40
+ * [rules]="passwordRules"
41
+ * [showUnmet]="submitted()"
42
+ * />
43
+ * ```
44
+ */
45
+ class PasswordRulesComponent {
46
+ /** The password being typed. */
47
+ value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
48
+ /** The rule set, in the order it should read. */
49
+ rules = input([], ...(ngDevMode ? [{ debugName: "rules" }] : /* istanbul ignore next */ []));
50
+ /**
51
+ * Whether an unmet rule may read as FAILED. Bind it to "the user has tried to
52
+ * submit": before that an unmet rule is merely pending, because marking a
53
+ * half-typed password with errors scolds someone who is still typing.
54
+ */
55
+ showUnmet = input(false, { ...(ngDevMode ? { debugName: "showUnmet" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
56
+ /** Lay the rows out in two columns — for a checklist beside a wide form. */
57
+ columns = input(1, ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
58
+ /**
59
+ * Id put on the rule list, for the field's `aria-describedby`. Defaults to a
60
+ * generated one; set it explicitly and both sides can name the same string,
61
+ * which avoids threading a template ref between two siblings.
62
+ */
63
+ listId = input(nextControlId('ds-password-rules'), ...(ngDevMode ? [{ debugName: "listId" }] : /* istanbul ignore next */ []));
64
+ rows = computed(() => {
65
+ const value = this.value();
66
+ const showUnmet = this.showUnmet();
67
+ return this.rules().map((rule) => {
68
+ const met = rule.test(value);
69
+ const state = met
70
+ ? 'met'
71
+ : showUnmet
72
+ ? 'failed'
73
+ : 'pending';
74
+ const icon = state === 'met' ? 'check' : state === 'failed' ? 'x' : 'circle';
75
+ return { label: rule.label, state, icon, announced: ANNOUNCED[state] };
76
+ });
77
+ }, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
78
+ /** How many rules pass — for a host that wants to gate its own submit. */
79
+ metCount = computed(() => this.rows().filter((row) => row.state === 'met').length, ...(ngDevMode ? [{ debugName: "metCount" }] : /* istanbul ignore next */ []));
80
+ /** True when every rule passes. */
81
+ allMet = computed(() => passwordRulesMet(this.value(), this.rules()), ...(ngDevMode ? [{ debugName: "allMet" }] : /* istanbul ignore next */ []));
82
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: PasswordRulesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
83
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: PasswordRulesComponent, isStandalone: true, selector: "ds-password-rules", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, rules: { classPropertyName: "rules", publicName: "rules", isSignal: true, isRequired: false, transformFunction: null }, showUnmet: { classPropertyName: "showUnmet", publicName: "showUnmet", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, listId: { classPropertyName: "listId", publicName: "listId", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<!-- role=\"list\" on the <ul> itself: `list-style: none` plus a flex/grid display\n strips list semantics in WebKit, so the native role cannot be relied on.\n aria-live=\"polite\" so a rule turning met is announced as the reader types,\n without interrupting them mid-word. -->\n<ul\n role=\"list\"\n aria-live=\"polite\"\n [id]=\"listId()\"\n [class]=\"'rules cols-' + columns()\"\n>\n @for (row of rows(); track row.label) {\n <li class=\"rule {{ row.state }}\">\n <ds-icon\n [name]=\"row.icon\"\n [size]=\"14\"\n />\n\n <span class=\"label\">\n {{ row.label }}\n </span>\n\n <span class=\"visually-hidden\">\n \u2014 {{ row.announced }}\n </span>\n </li>\n }\n</ul>\n", styles: [":host{--_password-rules-gap: var(--ds-password-rules-gap, var(--space-1));--_password-rules-font-size: var(--ds-password-rules-font-size, var(--font-size-xs));--_password-rules-pending-color: var(--ds-password-rules-pending-color, var(--text-tertiary));--_password-rules-met-color: var(--ds-password-rules-met-color, var(--success-text));--_password-rules-failed-color: var(--ds-password-rules-failed-color, var(--error-text));display:block;position:relative}.rules{display:grid;gap:var(--_password-rules-gap);margin:0;padding:0;list-style:none}.cols-2{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:var(--space-4)}.rule{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--_password-rules-font-size)/var(--line-height-base) var(--font-sans);color:var(--_password-rules-pending-color);transition:color var(--duration-base) var(--ease-standard)}.met{color:var(--_password-rules-met-color)}.failed{color:var(--_password-rules-failed-color)}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
84
+ }
85
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: PasswordRulesComponent, decorators: [{
86
+ type: Component,
87
+ args: [{ selector: 'ds-password-rules', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- role=\"list\" on the <ul> itself: `list-style: none` plus a flex/grid display\n strips list semantics in WebKit, so the native role cannot be relied on.\n aria-live=\"polite\" so a rule turning met is announced as the reader types,\n without interrupting them mid-word. -->\n<ul\n role=\"list\"\n aria-live=\"polite\"\n [id]=\"listId()\"\n [class]=\"'rules cols-' + columns()\"\n>\n @for (row of rows(); track row.label) {\n <li class=\"rule {{ row.state }}\">\n <ds-icon\n [name]=\"row.icon\"\n [size]=\"14\"\n />\n\n <span class=\"label\">\n {{ row.label }}\n </span>\n\n <span class=\"visually-hidden\">\n \u2014 {{ row.announced }}\n </span>\n </li>\n }\n</ul>\n", styles: [":host{--_password-rules-gap: var(--ds-password-rules-gap, var(--space-1));--_password-rules-font-size: var(--ds-password-rules-font-size, var(--font-size-xs));--_password-rules-pending-color: var(--ds-password-rules-pending-color, var(--text-tertiary));--_password-rules-met-color: var(--ds-password-rules-met-color, var(--success-text));--_password-rules-failed-color: var(--ds-password-rules-failed-color, var(--error-text));display:block;position:relative}.rules{display:grid;gap:var(--_password-rules-gap);margin:0;padding:0;list-style:none}.cols-2{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:var(--space-4)}.rule{display:flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--_password-rules-font-size)/var(--line-height-base) var(--font-sans);color:var(--_password-rules-pending-color);transition:color var(--duration-base) var(--ease-standard)}.met{color:var(--_password-rules-met-color)}.failed{color:var(--_password-rules-failed-color)}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"] }]
88
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], rules: [{ type: i0.Input, args: [{ isSignal: true, alias: "rules", required: false }] }], showUnmet: [{ type: i0.Input, args: [{ isSignal: true, alias: "showUnmet", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], listId: [{ type: i0.Input, args: [{ isSignal: true, alias: "listId", required: false }] }] } });
89
+
90
+ /**
91
+ * Generated bundle index. Do not edit.
92
+ */
93
+
94
+ export { PasswordRulesComponent, passwordRulesMet };
95
+ //# sourceMappingURL=ids-group-ltd-ids-design-system-components-password-rules.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-password-rules.mjs","sources":["../../../src/lib/components/password-rules/password-rules.component.ts","../../../src/lib/components/password-rules/password-rules.component.html","../../../src/lib/components/password-rules/ids-group-ltd-ids-design-system-components-password-rules.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport { nextControlId } from '@ids-group-ltd/ids-design-system/components';\nimport type {\n DsPasswordRule,\n DsPasswordRuleState,\n} from './password-rules.types';\n\ninterface RuleRow {\n readonly label: string;\n readonly state: DsPasswordRuleState;\n readonly icon: IconName;\n readonly announced: string;\n}\n\n// Screen-reader wording per state. The glyph is a decorative SVG with no\n// accessible name, so without these a screen reader hears the rule text and\n// nothing about whether it passed — the state would be conveyed by colour and\n// shape only.\nconst ANNOUNCED: Record<DsPasswordRuleState, string> = {\n pending: 'not yet met',\n met: 'met',\n failed: 'not met',\n};\n\n/**\n * Passes when every rule does. Exported separately so a form can gate its submit\n * from a validator without reaching for the component instance.\n */\nexport function passwordRulesMet(\n value: string,\n rules: readonly DsPasswordRule[],\n): boolean {\n return rules.length > 0 && rules.every((rule) => rule.test(value));\n}\n\n/**\n * Live checklist under a \"new password\" field.\n *\n * The consumer keeps the POLICY — each rule carries its own `test`, which has to\n * mirror the server, or the checklist is a lie — and this owns the rendering: the\n * tri-state glyph, the met and failed colours, the type scale. One consumer had\n * written it twice and the copies had already drifted (different labels for the\n * same rule, a different order, different state classes), which is why it is here.\n *\n * ```html\n * <ds-input\n * type=\"password\"\n * [attr.aria-describedby]=\"rules.listId\"\n * [(value)]=\"password\"\n * />\n * <ds-password-rules\n * #rules\n * [value]=\"password()\"\n * [rules]=\"passwordRules\"\n * [showUnmet]=\"submitted()\"\n * />\n * ```\n */\n@Component({\n selector: 'ds-password-rules',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './password-rules.component.html',\n styleUrl: './password-rules.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PasswordRulesComponent {\n /** The password being typed. */\n readonly value = input<string>('');\n /** The rule set, in the order it should read. */\n readonly rules = input<readonly DsPasswordRule[]>([]);\n /**\n * Whether an unmet rule may read as FAILED. Bind it to \"the user has tried to\n * submit\": before that an unmet rule is merely pending, because marking a\n * half-typed password with errors scolds someone who is still typing.\n */\n readonly showUnmet = input(false, { transform: booleanAttribute });\n /** Lay the rows out in two columns — for a checklist beside a wide form. */\n readonly columns = input<1 | 2>(1);\n\n /**\n * Id put on the rule list, for the field's `aria-describedby`. Defaults to a\n * generated one; set it explicitly and both sides can name the same string,\n * which avoids threading a template ref between two siblings.\n */\n readonly listId = input<string>(nextControlId('ds-password-rules'));\n\n protected readonly rows = computed<readonly RuleRow[]>(() => {\n const value = this.value();\n const showUnmet = this.showUnmet();\n\n return this.rules().map((rule) => {\n const met = rule.test(value);\n const state: DsPasswordRuleState = met\n ? 'met'\n : showUnmet\n ? 'failed'\n : 'pending';\n const icon: IconName =\n state === 'met' ? 'check' : state === 'failed' ? 'x' : 'circle';\n\n return { label: rule.label, state, icon, announced: ANNOUNCED[state] };\n });\n });\n\n /** How many rules pass — for a host that wants to gate its own submit. */\n readonly metCount = computed(\n () => this.rows().filter((row) => row.state === 'met').length,\n );\n\n /** True when every rule passes. */\n readonly allMet = computed(() =>\n passwordRulesMet(this.value(), this.rules()),\n );\n}\n","<!-- role=\"list\" on the <ul> itself: `list-style: none` plus a flex/grid display\n strips list semantics in WebKit, so the native role cannot be relied on.\n aria-live=\"polite\" so a rule turning met is announced as the reader types,\n without interrupting them mid-word. -->\n<ul\n role=\"list\"\n aria-live=\"polite\"\n [id]=\"listId()\"\n [class]=\"'rules cols-' + columns()\"\n>\n @for (row of rows(); track row.label) {\n <li class=\"rule {{ row.state }}\">\n <ds-icon\n [name]=\"row.icon\"\n [size]=\"14\"\n />\n\n <span class=\"label\">\n {{ row.label }}\n </span>\n\n <span class=\"visually-hidden\">\n — {{ row.announced }}\n </span>\n </li>\n }\n</ul>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,240 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, ViewContainerRef, ElementRef, viewChild, input, booleanAttribute, signal, forwardRef, ViewEncapsulation, Component } from '@angular/core';
3
+ import { Overlay } from '@angular/cdk/overlay';
4
+ import { TemplatePortal } from '@angular/cdk/portal';
5
+ import * as i1 from '@ids-group-ltd/ids-design-system/components';
6
+ import { DsStaticPreview, overlayPlacementOf, prepareOverlayEnter, forwardOverlayTokens, closeOnOutsidePointer, closeOnScroll, focusIsInside, disposeWithLeave } from '@ids-group-ltd/ids-design-system/components';
7
+ import { CdkTrapFocus } from '@angular/cdk/a11y';
8
+ import { NgTemplateOutlet } from '@angular/common';
9
+ import { DsOverlayCloseRef } from '@ids-group-ltd/ids-design-system/overlay';
10
+
11
+ class PopoverComponent {
12
+ overlay = inject(Overlay);
13
+ vcr = inject(ViewContainerRef);
14
+ host = inject((ElementRef));
15
+ preview = inject(DsStaticPreview);
16
+ panelTpl = viewChild('panel', ...(ngDevMode ? [{ debugName: "panelTpl" }] : /* istanbul ignore next */ []));
17
+ panelTrap = viewChild(CdkTrapFocus, ...(ngDevMode ? [{ debugName: "panelTrap" }] : /* istanbul ignore next */ []));
18
+ ref = null;
19
+ triggerElement = null;
20
+ focusTimer = null;
21
+ /** Public panel tokens forwarded onto the portaled overlay pane on open so
22
+ * a consumer's `ds-popover { --ds-popover-panel-*: … }` reaches it. */
23
+ panelTokens = [
24
+ '--ds-popover-bg-color',
25
+ '--ds-popover-border-color',
26
+ '--ds-popover-radius',
27
+ '--ds-popover-shadow',
28
+ '--ds-popover-padding',
29
+ '--ds-popover-max-width',
30
+ '--ds-popover-min-width',
31
+ '--ds-popover-arrow-size',
32
+ // Forwarded too: a projected ds-menu is portaled into the pane, so a
33
+ // consumer scoping the menu's width in their own DOM can't reach it.
34
+ '--ds-menu-min-width',
35
+ '--ds-menu-max-width',
36
+ ];
37
+ /** Cross-axis alignment of the panel against the trigger. */
38
+ align = input('start', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
39
+ /** Which side of the trigger the panel prefers to appear on. */
40
+ placement = input('bottom', ...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
41
+ /** Render a small caret pointing at the trigger. */
42
+ arrow = input(false, { ...(ngDevMode ? { debugName: "arrow" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
43
+ /** ARIA role for the panel (e.g. 'dialog' for interactive popovers). When set,
44
+ * the panel traps focus and captures it on open; a keyboard (Escape) or
45
+ * in-panel close returns focus to the trigger, while an outside click or
46
+ * scroll leaves focus where it lands (non-modal). Leave null for plain,
47
+ * non-interactive text popovers. */
48
+ panelRole = input(null, ...(ngDevMode ? [{ debugName: "panelRole" }] : /* istanbul ignore next */ []));
49
+ /** Accessible name for the panel; pair with `panelRole`. */
50
+ panelLabel = input(null, ...(ngDevMode ? [{ debugName: "panelLabel" }] : /* istanbul ignore next */ []));
51
+ /** Open/closed state — for callers binding `aria-expanded` on the trigger. */
52
+ opened = signal(false, ...(ngDevMode ? [{ debugName: "opened" }] : /* istanbul ignore next */ []));
53
+ /** Resolved placement after the overlay positions — drives the arrow direction. */
54
+ resolvedPlacement = signal('bottom', ...(ngDevMode ? [{ debugName: "resolvedPlacement" }] : /* istanbul ignore next */ []));
55
+ toggle(trigger) {
56
+ if (this.preview.staticPreview()) {
57
+ return;
58
+ }
59
+ if (this.ref) {
60
+ this.close();
61
+ return;
62
+ }
63
+ this.triggerElement = trigger;
64
+ const placement = this.placement();
65
+ const arrowOffset = this.arrow() ? 8 : 4;
66
+ const positionStrategy = this.overlay
67
+ .position()
68
+ .flexibleConnectedTo(trigger)
69
+ .withPositions(buildPositions(placement, this.align(), arrowOffset))
70
+ .withViewportMargin(8);
71
+ positionStrategy.positionChanges.subscribe((change) => {
72
+ this.resolvedPlacement.set(overlayPlacementOf(change.connectionPair.overlayY, change.connectionPair.overlayX));
73
+ });
74
+ const cfg = {
75
+ positionStrategy,
76
+ hasBackdrop: false,
77
+ panelClass: 'ds-overlay-pane',
78
+ scrollStrategy: this.overlay.scrollStrategies.reposition(),
79
+ };
80
+ this.ref = this.overlay.create(cfg);
81
+ prepareOverlayEnter(this.ref, this.host.nativeElement, positionStrategy);
82
+ forwardOverlayTokens(this.ref, this.host.nativeElement, this.panelTokens);
83
+ closeOnOutsidePointer(this.ref, (target) => trigger.contains(target), () => this.close('dismiss'));
84
+ // No backdrop catches a page scroll and CDK's scroll strategies miss a plain
85
+ // overflow container, so close on any outside scroll ourselves.
86
+ const removeScrollClose = closeOnScroll(this.ref, () => this.close('dismiss'));
87
+ this.ref.detachments().subscribe(() => {
88
+ removeScrollClose();
89
+ this.ref = null;
90
+ this.opened.set(false);
91
+ });
92
+ this.ref.keydownEvents().subscribe((event) => {
93
+ if (event.key === 'Escape') {
94
+ event.preventDefault();
95
+ this.close('dismiss');
96
+ }
97
+ });
98
+ this.ref.attach(new TemplatePortal(this.panelTpl(), this.vcr));
99
+ this.resolvedPlacement.set(placement);
100
+ this.opened.set(true);
101
+ if (this.panelRole()) {
102
+ // Same initial focus as cdkTrapFocusAutoCapture, minus its destroy-time
103
+ // restore — that restore steals focus on an outside/scroll close.
104
+ this.focusTimer = setTimeout(() => {
105
+ this.focusTimer = null;
106
+ void this.panelTrap()?.focusTrap?.focusInitialElementWhenReady();
107
+ });
108
+ }
109
+ }
110
+ close(cause = 'select') {
111
+ if (!this.ref) {
112
+ return;
113
+ }
114
+ clearTimeout(this.focusTimer ?? undefined);
115
+ this.focusTimer = null;
116
+ const focusWasInPanel = focusIsInside(this.ref);
117
+ disposeWithLeave(this.ref, cause);
118
+ this.ref = null;
119
+ this.opened.set(false);
120
+ if (focusWasInPanel) {
121
+ this.triggerElement?.focus({ preventScroll: true });
122
+ }
123
+ }
124
+ ngOnDestroy() {
125
+ clearTimeout(this.focusTimer ?? undefined);
126
+ this.ref?.dispose();
127
+ this.ref = null;
128
+ }
129
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: PopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
130
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: PopoverComponent, isStandalone: true, selector: "ds-popover", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, arrow: { classPropertyName: "arrow", publicName: "arrow", isSignal: true, isRequired: false, transformFunction: null }, panelRole: { classPropertyName: "panelRole", publicName: "panelRole", isSignal: true, isRequired: false, transformFunction: null }, panelLabel: { classPropertyName: "panelLabel", publicName: "panelLabel", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
131
+ {
132
+ provide: DsOverlayCloseRef,
133
+ useExisting: forwardRef(() => PopoverComponent),
134
+ },
135
+ ], viewQueries: [{ propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "panelTrap", first: true, predicate: CdkTrapFocus, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DsStaticPreview, inputs: ["staticPreview", "staticPreview"] }], ngImport: i0, template: "<!-- Projected content is captured ONCE here and stamped into whichever render\n site is active \u2014 duplicating ng-content across branches breaks projection. -->\n<ng-template #content>\n <ng-content />\n</ng-template>\n\n@if (preview.staticPreview()) {\n <div\n class=\"popover\"\n [attr.role]=\"panelRole()\"\n [attr.aria-label]=\"panelLabel()\"\n [class.has-arrow]=\"arrow()\"\n [attr.data-placement]=\"arrow() ? placement() : null\"\n >\n @if (arrow()) {\n <span class=\"arrow\"></span>\n }\n\n <ng-container [ngTemplateOutlet]=\"content\" />\n </div>\n}\n\n<ng-template #panel>\n <div\n class=\"popover\"\n [attr.role]=\"panelRole()\"\n [attr.aria-label]=\"panelLabel()\"\n [class.has-arrow]=\"arrow()\"\n [attr.data-placement]=\"arrow() ? resolvedPlacement() : null\"\n [cdkTrapFocus]=\"!!panelRole()\"\n >\n @if (arrow()) {\n <span class=\"arrow\"></span>\n }\n\n <ng-container [ngTemplateOutlet]=\"content\" />\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:contents}.popover{--_popover-bg-color: var(--ds-popover-bg-color, var(--surface-overlay));--_popover-border-color: var(--ds-popover-border-color, var(--border-default));--_popover-radius: var(--ds-popover-radius, var(--ds-radius-panel));--_popover-shadow: var(--ds-popover-shadow, var(--ds-elevation-overlay));--_popover-padding: var(--ds-popover-padding, var(--space-3));--_popover-max-width: var(--ds-popover-max-width, var(--popover-maxw));--_popover-min-width: var(--ds-popover-min-width, auto);position:relative;background:var(--_popover-bg-color);border:var(--border-width-default) solid var(--_popover-border-color);border-radius:var(--_popover-radius);box-shadow:var(--_popover-shadow);padding:var(--_popover-padding);z-index:var(--layer-popover);max-width:var(--_popover-max-width);min-width:var(--_popover-min-width)}.popover:has(ds-menu){padding:0;--ds-menu-clip-radius: calc( var(--_popover-radius) - var(--border-width-default) )}.arrow{--_arrow-size: var(--ds-popover-arrow-size, 7px);position:absolute;width:calc(var(--_arrow-size) * 2);height:calc(var(--_arrow-size) * 2);overflow:hidden;pointer-events:none}.arrow:before{content:\"\";position:absolute;width:var(--_arrow-size);height:var(--_arrow-size);background:var(--_popover-bg-color);border:var(--border-width-default) solid var(--_popover-border-color);transform:rotate(45deg);transform-origin:center}[data-placement=bottom] .arrow,[data-placement=bottom]>.arrow{top:calc(var(--_arrow-size) * -1);left:var(--space-4)}[data-placement=bottom] .arrow:before,[data-placement=bottom]>.arrow:before{bottom:0;left:50%;translate:-50% 0;border-right:none;border-bottom:none}[data-placement=top] .arrow,[data-placement=top]>.arrow{bottom:calc(var(--_arrow-size) * -1);left:var(--space-4)}[data-placement=top] .arrow:before,[data-placement=top]>.arrow:before{top:0;left:50%;translate:-50% 0;border-left:none;border-top:none}[data-placement=right] .arrow,[data-placement=right]>.arrow{left:calc(var(--_arrow-size) * -1);top:var(--space-4)}[data-placement=right] .arrow:before,[data-placement=right]>.arrow:before{right:0;top:50%;translate:0 -50%;border-right:none;border-top:none}[data-placement=left] .arrow,[data-placement=left]>.arrow{right:calc(var(--_arrow-size) * -1);top:var(--space-4)}[data-placement=left] .arrow:before,[data-placement=left]>.arrow:before{left:0;top:50%;translate:0 -50%;border-left:none;border-bottom:none}\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
136
+ }
137
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: PopoverComponent, decorators: [{
138
+ type: Component,
139
+ args: [{ selector: 'ds-popover', standalone: true, imports: [CdkTrapFocus, NgTemplateOutlet], encapsulation: ViewEncapsulation.Emulated, hostDirectives: [{ directive: DsStaticPreview, inputs: ['staticPreview'] }], providers: [
140
+ {
141
+ provide: DsOverlayCloseRef,
142
+ useExisting: forwardRef(() => PopoverComponent),
143
+ },
144
+ ], template: "<!-- Projected content is captured ONCE here and stamped into whichever render\n site is active \u2014 duplicating ng-content across branches breaks projection. -->\n<ng-template #content>\n <ng-content />\n</ng-template>\n\n@if (preview.staticPreview()) {\n <div\n class=\"popover\"\n [attr.role]=\"panelRole()\"\n [attr.aria-label]=\"panelLabel()\"\n [class.has-arrow]=\"arrow()\"\n [attr.data-placement]=\"arrow() ? placement() : null\"\n >\n @if (arrow()) {\n <span class=\"arrow\"></span>\n }\n\n <ng-container [ngTemplateOutlet]=\"content\" />\n </div>\n}\n\n<ng-template #panel>\n <div\n class=\"popover\"\n [attr.role]=\"panelRole()\"\n [attr.aria-label]=\"panelLabel()\"\n [class.has-arrow]=\"arrow()\"\n [attr.data-placement]=\"arrow() ? resolvedPlacement() : null\"\n [cdkTrapFocus]=\"!!panelRole()\"\n >\n @if (arrow()) {\n <span class=\"arrow\"></span>\n }\n\n <ng-container [ngTemplateOutlet]=\"content\" />\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:host{display:contents}.popover{--_popover-bg-color: var(--ds-popover-bg-color, var(--surface-overlay));--_popover-border-color: var(--ds-popover-border-color, var(--border-default));--_popover-radius: var(--ds-popover-radius, var(--ds-radius-panel));--_popover-shadow: var(--ds-popover-shadow, var(--ds-elevation-overlay));--_popover-padding: var(--ds-popover-padding, var(--space-3));--_popover-max-width: var(--ds-popover-max-width, var(--popover-maxw));--_popover-min-width: var(--ds-popover-min-width, auto);position:relative;background:var(--_popover-bg-color);border:var(--border-width-default) solid var(--_popover-border-color);border-radius:var(--_popover-radius);box-shadow:var(--_popover-shadow);padding:var(--_popover-padding);z-index:var(--layer-popover);max-width:var(--_popover-max-width);min-width:var(--_popover-min-width)}.popover:has(ds-menu){padding:0;--ds-menu-clip-radius: calc( var(--_popover-radius) - var(--border-width-default) )}.arrow{--_arrow-size: var(--ds-popover-arrow-size, 7px);position:absolute;width:calc(var(--_arrow-size) * 2);height:calc(var(--_arrow-size) * 2);overflow:hidden;pointer-events:none}.arrow:before{content:\"\";position:absolute;width:var(--_arrow-size);height:var(--_arrow-size);background:var(--_popover-bg-color);border:var(--border-width-default) solid var(--_popover-border-color);transform:rotate(45deg);transform-origin:center}[data-placement=bottom] .arrow,[data-placement=bottom]>.arrow{top:calc(var(--_arrow-size) * -1);left:var(--space-4)}[data-placement=bottom] .arrow:before,[data-placement=bottom]>.arrow:before{bottom:0;left:50%;translate:-50% 0;border-right:none;border-bottom:none}[data-placement=top] .arrow,[data-placement=top]>.arrow{bottom:calc(var(--_arrow-size) * -1);left:var(--space-4)}[data-placement=top] .arrow:before,[data-placement=top]>.arrow:before{top:0;left:50%;translate:-50% 0;border-left:none;border-top:none}[data-placement=right] .arrow,[data-placement=right]>.arrow{left:calc(var(--_arrow-size) * -1);top:var(--space-4)}[data-placement=right] .arrow:before,[data-placement=right]>.arrow:before{right:0;top:50%;translate:0 -50%;border-right:none;border-top:none}[data-placement=left] .arrow,[data-placement=left]>.arrow{right:calc(var(--_arrow-size) * -1);top:var(--space-4)}[data-placement=left] .arrow:before,[data-placement=left]>.arrow:before{left:0;top:50%;translate:0 -50%;border-left:none;border-bottom:none}\n"] }]
145
+ }], propDecorators: { panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], panelTrap: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkTrapFocus), { isSignal: true }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], arrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrow", required: false }] }], panelRole: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelRole", required: false }] }], panelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelLabel", required: false }] }] } });
146
+ function buildPositions(placement, align, offsetPx) {
147
+ const crossStart = align === 'start' ? 'start' : 'end';
148
+ const crossEnd = align === 'start' ? 'end' : 'start';
149
+ switch (placement) {
150
+ case 'top':
151
+ return [
152
+ {
153
+ originX: crossStart,
154
+ originY: 'top',
155
+ overlayX: crossStart,
156
+ overlayY: 'bottom',
157
+ offsetY: -offsetPx,
158
+ },
159
+ {
160
+ originX: crossStart,
161
+ originY: 'bottom',
162
+ overlayX: crossStart,
163
+ overlayY: 'top',
164
+ offsetY: offsetPx,
165
+ },
166
+ {
167
+ originX: crossEnd,
168
+ originY: 'top',
169
+ overlayX: crossEnd,
170
+ overlayY: 'bottom',
171
+ offsetY: -offsetPx,
172
+ },
173
+ ];
174
+ case 'left':
175
+ return [
176
+ {
177
+ originX: 'start',
178
+ originY: 'top',
179
+ overlayX: 'end',
180
+ overlayY: 'top',
181
+ offsetX: -offsetPx,
182
+ },
183
+ {
184
+ originX: 'end',
185
+ originY: 'top',
186
+ overlayX: 'start',
187
+ overlayY: 'top',
188
+ offsetX: offsetPx,
189
+ },
190
+ ];
191
+ case 'right':
192
+ return [
193
+ {
194
+ originX: 'end',
195
+ originY: 'top',
196
+ overlayX: 'start',
197
+ overlayY: 'top',
198
+ offsetX: offsetPx,
199
+ },
200
+ {
201
+ originX: 'start',
202
+ originY: 'top',
203
+ overlayX: 'end',
204
+ overlayY: 'top',
205
+ offsetX: -offsetPx,
206
+ },
207
+ ];
208
+ default: // bottom
209
+ return [
210
+ {
211
+ originX: crossStart,
212
+ originY: 'bottom',
213
+ overlayX: crossStart,
214
+ overlayY: 'top',
215
+ offsetY: offsetPx,
216
+ },
217
+ {
218
+ originX: crossStart,
219
+ originY: 'top',
220
+ overlayX: crossStart,
221
+ overlayY: 'bottom',
222
+ offsetY: -offsetPx,
223
+ },
224
+ {
225
+ originX: crossEnd,
226
+ originY: 'bottom',
227
+ overlayX: crossEnd,
228
+ overlayY: 'top',
229
+ offsetY: offsetPx,
230
+ },
231
+ ];
232
+ }
233
+ }
234
+
235
+ /**
236
+ * Generated bundle index. Do not edit.
237
+ */
238
+
239
+ export { PopoverComponent };
240
+ //# sourceMappingURL=ids-group-ltd-ids-design-system-components-popover.mjs.map