@hashicorp/design-system-components 4.13.1 → 4.15.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 (640) hide show
  1. package/declarations/components/hds/accordion/item/index.d.ts +3 -3
  2. package/declarations/components/hds/accordion/item/index.d.ts.map +1 -1
  3. package/declarations/components/hds/alert/description.d.ts +0 -1
  4. package/declarations/components/hds/alert/description.d.ts.map +1 -1
  5. package/declarations/components/hds/alert/index.d.ts +2 -2
  6. package/declarations/components/hds/alert/index.d.ts.map +1 -1
  7. package/declarations/components/hds/app-footer/item.d.ts +0 -1
  8. package/declarations/components/hds/app-footer/item.d.ts.map +1 -1
  9. package/declarations/components/hds/app-footer/link.d.ts +0 -1
  10. package/declarations/components/hds/app-footer/link.d.ts.map +1 -1
  11. package/declarations/components/hds/app-footer/status-link.d.ts +1 -1
  12. package/declarations/components/hds/app-footer/status-link.d.ts.map +1 -1
  13. package/declarations/components/hds/app-frame/parts/footer.d.ts +0 -1
  14. package/declarations/components/hds/app-frame/parts/footer.d.ts.map +1 -1
  15. package/declarations/components/hds/app-frame/parts/header.d.ts +0 -1
  16. package/declarations/components/hds/app-frame/parts/header.d.ts.map +1 -1
  17. package/declarations/components/hds/app-frame/parts/main.d.ts +0 -1
  18. package/declarations/components/hds/app-frame/parts/main.d.ts.map +1 -1
  19. package/declarations/components/hds/app-frame/parts/modals.d.ts +0 -1
  20. package/declarations/components/hds/app-frame/parts/modals.d.ts.map +1 -1
  21. package/declarations/components/hds/app-frame/parts/sidebar.d.ts +0 -1
  22. package/declarations/components/hds/app-frame/parts/sidebar.d.ts.map +1 -1
  23. package/declarations/components/hds/app-header/index.d.ts +7 -7
  24. package/declarations/components/hds/app-header/index.d.ts.map +1 -1
  25. package/declarations/components/hds/app-side-nav/index.d.ts +45 -0
  26. package/declarations/components/hds/app-side-nav/index.d.ts.map +1 -0
  27. package/declarations/components/hds/app-side-nav/list/back-link.d.ts +14 -0
  28. package/declarations/components/hds/app-side-nav/list/back-link.d.ts.map +1 -0
  29. package/declarations/components/hds/app-side-nav/list/index.d.ts +32 -0
  30. package/declarations/components/hds/app-side-nav/list/index.d.ts.map +1 -0
  31. package/declarations/components/hds/app-side-nav/list/item.d.ts +13 -0
  32. package/declarations/components/hds/app-side-nav/list/item.d.ts.map +1 -0
  33. package/declarations/components/hds/app-side-nav/list/link.d.ts +23 -0
  34. package/declarations/components/hds/app-side-nav/list/link.d.ts.map +1 -0
  35. package/declarations/components/hds/app-side-nav/list/title.d.ts +19 -0
  36. package/declarations/components/hds/app-side-nav/list/title.d.ts.map +1 -0
  37. package/declarations/components/hds/app-side-nav/portal/index.d.ts +26 -0
  38. package/declarations/components/hds/app-side-nav/portal/index.d.ts.map +1 -0
  39. package/declarations/components/hds/app-side-nav/portal/target.d.ts +37 -0
  40. package/declarations/components/hds/app-side-nav/portal/target.d.ts.map +1 -0
  41. package/declarations/components/hds/app-side-nav/toggle-button.d.ts +14 -0
  42. package/declarations/components/hds/app-side-nav/toggle-button.d.ts.map +1 -0
  43. package/declarations/components/hds/application-state/body.d.ts +0 -1
  44. package/declarations/components/hds/application-state/body.d.ts.map +1 -1
  45. package/declarations/components/hds/application-state/footer.d.ts +0 -1
  46. package/declarations/components/hds/application-state/footer.d.ts.map +1 -1
  47. package/declarations/components/hds/application-state/media.d.ts +0 -1
  48. package/declarations/components/hds/application-state/media.d.ts.map +1 -1
  49. package/declarations/components/hds/button-set/index.d.ts +0 -1
  50. package/declarations/components/hds/button-set/index.d.ts.map +1 -1
  51. package/declarations/components/hds/code-block/copy-button.d.ts +0 -1
  52. package/declarations/components/hds/code-block/copy-button.d.ts.map +1 -1
  53. package/declarations/components/hds/code-block/description.d.ts +0 -1
  54. package/declarations/components/hds/code-block/description.d.ts.map +1 -1
  55. package/declarations/components/hds/code-block/index.d.ts +3 -4
  56. package/declarations/components/hds/code-block/index.d.ts.map +1 -1
  57. package/declarations/components/hds/copy/button/index.d.ts +2 -2
  58. package/declarations/components/hds/copy/button/index.d.ts.map +1 -1
  59. package/declarations/components/hds/copy/snippet/index.d.ts +2 -2
  60. package/declarations/components/hds/copy/snippet/index.d.ts.map +1 -1
  61. package/declarations/components/hds/dialog-primitive/body.d.ts +0 -1
  62. package/declarations/components/hds/dialog-primitive/body.d.ts.map +1 -1
  63. package/declarations/components/hds/dialog-primitive/description.d.ts +0 -1
  64. package/declarations/components/hds/dialog-primitive/description.d.ts.map +1 -1
  65. package/declarations/components/hds/dialog-primitive/overlay.d.ts +0 -1
  66. package/declarations/components/hds/dialog-primitive/overlay.d.ts.map +1 -1
  67. package/declarations/components/hds/dialog-primitive/wrapper.d.ts +0 -1
  68. package/declarations/components/hds/dialog-primitive/wrapper.d.ts.map +1 -1
  69. package/declarations/components/hds/disclosure-primitive/index.d.ts +2 -2
  70. package/declarations/components/hds/disclosure-primitive/index.d.ts.map +1 -1
  71. package/declarations/components/hds/dropdown/footer.d.ts +0 -1
  72. package/declarations/components/hds/dropdown/footer.d.ts.map +1 -1
  73. package/declarations/components/hds/dropdown/header.d.ts +0 -1
  74. package/declarations/components/hds/dropdown/header.d.ts.map +1 -1
  75. package/declarations/components/hds/dropdown/index.d.ts +3 -0
  76. package/declarations/components/hds/dropdown/index.d.ts.map +1 -1
  77. package/declarations/components/hds/dropdown/list-item/generic.d.ts +0 -1
  78. package/declarations/components/hds/dropdown/list-item/generic.d.ts.map +1 -1
  79. package/declarations/components/hds/dropdown/list-item/separator.d.ts +0 -1
  80. package/declarations/components/hds/dropdown/list-item/separator.d.ts.map +1 -1
  81. package/declarations/components/hds/dropdown/toggle/button.d.ts +2 -2
  82. package/declarations/components/hds/dropdown/toggle/button.d.ts.map +1 -1
  83. package/declarations/components/hds/dropdown/toggle/chevron.d.ts +0 -1
  84. package/declarations/components/hds/dropdown/toggle/chevron.d.ts.map +1 -1
  85. package/declarations/components/hds/dropdown/toggle/icon.d.ts +1 -1
  86. package/declarations/components/hds/dropdown/toggle/icon.d.ts.map +1 -1
  87. package/declarations/components/hds/flyout/index.d.ts +3 -3
  88. package/declarations/components/hds/flyout/index.d.ts.map +1 -1
  89. package/declarations/components/hds/form/checkbox/base.d.ts +0 -1
  90. package/declarations/components/hds/form/checkbox/base.d.ts.map +1 -1
  91. package/declarations/components/hds/form/checkbox/field.d.ts +0 -1
  92. package/declarations/components/hds/form/checkbox/field.d.ts.map +1 -1
  93. package/declarations/components/hds/form/checkbox/group.d.ts +0 -1
  94. package/declarations/components/hds/form/checkbox/group.d.ts.map +1 -1
  95. package/declarations/components/hds/form/error/message.d.ts +0 -1
  96. package/declarations/components/hds/form/error/message.d.ts.map +1 -1
  97. package/declarations/components/hds/form/file-input/base.d.ts +0 -1
  98. package/declarations/components/hds/form/file-input/base.d.ts.map +1 -1
  99. package/declarations/components/hds/form/file-input/field.d.ts +0 -1
  100. package/declarations/components/hds/form/file-input/field.d.ts.map +1 -1
  101. package/declarations/components/hds/form/masked-input/base.d.ts +1 -23
  102. package/declarations/components/hds/form/masked-input/base.d.ts.map +1 -1
  103. package/declarations/components/hds/form/masked-input/field.d.ts +0 -1
  104. package/declarations/components/hds/form/masked-input/field.d.ts.map +1 -1
  105. package/declarations/components/hds/form/radio/base.d.ts +0 -1
  106. package/declarations/components/hds/form/radio/base.d.ts.map +1 -1
  107. package/declarations/components/hds/form/radio/field.d.ts +0 -1
  108. package/declarations/components/hds/form/radio/field.d.ts.map +1 -1
  109. package/declarations/components/hds/form/radio/group.d.ts +0 -1
  110. package/declarations/components/hds/form/radio/group.d.ts.map +1 -1
  111. package/declarations/components/hds/form/radio-card/description.d.ts +0 -1
  112. package/declarations/components/hds/form/radio-card/description.d.ts.map +1 -1
  113. package/declarations/components/hds/form/radio-card/group.d.ts +0 -1
  114. package/declarations/components/hds/form/radio-card/group.d.ts.map +1 -1
  115. package/declarations/components/hds/form/radio-card/label.d.ts +0 -1
  116. package/declarations/components/hds/form/radio-card/label.d.ts.map +1 -1
  117. package/declarations/components/hds/form/select/field.d.ts +0 -1
  118. package/declarations/components/hds/form/select/field.d.ts.map +1 -1
  119. package/declarations/components/hds/form/super-select/after-options.d.ts +0 -1
  120. package/declarations/components/hds/form/super-select/after-options.d.ts.map +1 -1
  121. package/declarations/components/hds/form/super-select/multiple/base.d.ts +3 -3
  122. package/declarations/components/hds/form/super-select/multiple/base.d.ts.map +1 -1
  123. package/declarations/components/hds/form/super-select/option-group.d.ts +2 -1
  124. package/declarations/components/hds/form/super-select/option-group.d.ts.map +1 -1
  125. package/declarations/components/hds/form/super-select/placeholder.d.ts +0 -1
  126. package/declarations/components/hds/form/super-select/placeholder.d.ts.map +1 -1
  127. package/declarations/components/hds/form/text-input/field.d.ts +3 -17
  128. package/declarations/components/hds/form/text-input/field.d.ts.map +1 -1
  129. package/declarations/components/hds/form/textarea/field.d.ts +0 -1
  130. package/declarations/components/hds/form/textarea/field.d.ts.map +1 -1
  131. package/declarations/components/hds/form/toggle/base.d.ts +0 -1
  132. package/declarations/components/hds/form/toggle/base.d.ts.map +1 -1
  133. package/declarations/components/hds/form/toggle/field.d.ts +0 -1
  134. package/declarations/components/hds/form/toggle/field.d.ts.map +1 -1
  135. package/declarations/components/hds/form/toggle/group.d.ts +0 -1
  136. package/declarations/components/hds/form/toggle/group.d.ts.map +1 -1
  137. package/declarations/components/hds/form/visibility-toggle/index.d.ts +0 -1
  138. package/declarations/components/hds/form/visibility-toggle/index.d.ts.map +1 -1
  139. package/declarations/components/hds/icon/index.d.ts +2 -2
  140. package/declarations/components/hds/icon/index.d.ts.map +1 -1
  141. package/declarations/components/hds/modal/index.d.ts +4 -4
  142. package/declarations/components/hds/modal/index.d.ts.map +1 -1
  143. package/declarations/components/hds/page-header/actions.d.ts +0 -1
  144. package/declarations/components/hds/page-header/actions.d.ts.map +1 -1
  145. package/declarations/components/hds/page-header/badges.d.ts +0 -1
  146. package/declarations/components/hds/page-header/badges.d.ts.map +1 -1
  147. package/declarations/components/hds/page-header/description.d.ts +0 -1
  148. package/declarations/components/hds/page-header/description.d.ts.map +1 -1
  149. package/declarations/components/hds/page-header/index.d.ts +0 -1
  150. package/declarations/components/hds/page-header/index.d.ts.map +1 -1
  151. package/declarations/components/hds/page-header/subtitle.d.ts +0 -1
  152. package/declarations/components/hds/page-header/subtitle.d.ts.map +1 -1
  153. package/declarations/components/hds/page-header/title.d.ts +0 -1
  154. package/declarations/components/hds/page-header/title.d.ts.map +1 -1
  155. package/declarations/components/hds/pagination/compact/index.d.ts +2 -2
  156. package/declarations/components/hds/pagination/compact/index.d.ts.map +1 -1
  157. package/declarations/components/hds/pagination/nav/ellipsis.d.ts +0 -1
  158. package/declarations/components/hds/pagination/nav/ellipsis.d.ts.map +1 -1
  159. package/declarations/components/hds/pagination/numbered/index.d.ts +3 -3
  160. package/declarations/components/hds/pagination/numbered/index.d.ts.map +1 -1
  161. package/declarations/components/hds/pagination/size-selector/index.d.ts +1 -1
  162. package/declarations/components/hds/pagination/size-selector/index.d.ts.map +1 -1
  163. package/declarations/components/hds/popover-primitive/index.d.ts +9 -8
  164. package/declarations/components/hds/popover-primitive/index.d.ts.map +1 -1
  165. package/declarations/components/hds/reveal/index.d.ts +2 -2
  166. package/declarations/components/hds/reveal/index.d.ts.map +1 -1
  167. package/declarations/components/hds/rich-tooltip/index.d.ts +3 -3
  168. package/declarations/components/hds/rich-tooltip/index.d.ts.map +1 -1
  169. package/declarations/components/hds/segmented-group/index.d.ts +0 -1
  170. package/declarations/components/hds/segmented-group/index.d.ts.map +1 -1
  171. package/declarations/components/hds/side-nav/base.d.ts +0 -1
  172. package/declarations/components/hds/side-nav/base.d.ts.map +1 -1
  173. package/declarations/components/hds/side-nav/header/index.d.ts +0 -1
  174. package/declarations/components/hds/side-nav/header/index.d.ts.map +1 -1
  175. package/declarations/components/hds/side-nav/index.d.ts +9 -8
  176. package/declarations/components/hds/side-nav/index.d.ts.map +1 -1
  177. package/declarations/components/hds/side-nav/list/back-link.d.ts +0 -1
  178. package/declarations/components/hds/side-nav/list/back-link.d.ts.map +1 -1
  179. package/declarations/components/hds/side-nav/list/index.d.ts +6 -3
  180. package/declarations/components/hds/side-nav/list/index.d.ts.map +1 -1
  181. package/declarations/components/hds/side-nav/list/item.d.ts +0 -1
  182. package/declarations/components/hds/side-nav/list/item.d.ts.map +1 -1
  183. package/declarations/components/hds/side-nav/list/link.d.ts +0 -1
  184. package/declarations/components/hds/side-nav/list/link.d.ts.map +1 -1
  185. package/declarations/components/hds/side-nav/list/title.d.ts +8 -3
  186. package/declarations/components/hds/side-nav/list/title.d.ts.map +1 -1
  187. package/declarations/components/hds/side-nav/portal/index.d.ts +0 -1
  188. package/declarations/components/hds/side-nav/portal/index.d.ts.map +1 -1
  189. package/declarations/components/hds/side-nav/toggle-button.d.ts +0 -1
  190. package/declarations/components/hds/side-nav/toggle-button.d.ts.map +1 -1
  191. package/declarations/components/hds/stepper/task/indicator.d.ts +1 -1
  192. package/declarations/components/hds/stepper/task/indicator.d.ts.map +1 -1
  193. package/declarations/components/hds/table/index.d.ts +6 -4
  194. package/declarations/components/hds/table/index.d.ts.map +1 -1
  195. package/declarations/components/hds/table/th-button-sort.d.ts +2 -2
  196. package/declarations/components/hds/table/th-button-sort.d.ts.map +1 -1
  197. package/declarations/components/hds/table/th-button-tooltip.d.ts +1 -1
  198. package/declarations/components/hds/table/th-button-tooltip.d.ts.map +1 -1
  199. package/declarations/components/hds/table/th-selectable.d.ts +4 -3
  200. package/declarations/components/hds/table/th-selectable.d.ts.map +1 -1
  201. package/declarations/components/hds/table/th-sort.d.ts +2 -2
  202. package/declarations/components/hds/table/th-sort.d.ts.map +1 -1
  203. package/declarations/components/hds/table/th.d.ts +2 -2
  204. package/declarations/components/hds/table/th.d.ts.map +1 -1
  205. package/declarations/components/hds/tabs/index.d.ts +8 -8
  206. package/declarations/components/hds/tabs/index.d.ts.map +1 -1
  207. package/declarations/components/hds/tabs/panel.d.ts +3 -2
  208. package/declarations/components/hds/tabs/panel.d.ts.map +1 -1
  209. package/declarations/components/hds/tabs/tab.d.ts +2 -1
  210. package/declarations/components/hds/tabs/tab.d.ts.map +1 -1
  211. package/declarations/components/hds/time/index.d.ts +35 -0
  212. package/declarations/components/hds/time/index.d.ts.map +1 -0
  213. package/declarations/components/hds/time/range.d.ts +35 -0
  214. package/declarations/components/hds/time/range.d.ts.map +1 -0
  215. package/declarations/components/hds/time/single.d.ts +18 -0
  216. package/declarations/components/hds/time/single.d.ts.map +1 -0
  217. package/declarations/components/hds/toast/index.d.ts +0 -1
  218. package/declarations/components/hds/toast/index.d.ts.map +1 -1
  219. package/declarations/components/hds/yield/index.d.ts +0 -1
  220. package/declarations/components/hds/yield/index.d.ts.map +1 -1
  221. package/declarations/components.d.ts +4 -0
  222. package/declarations/components.d.ts.map +1 -1
  223. package/declarations/helpers/hds-format-date.d.ts +18 -0
  224. package/declarations/helpers/hds-format-date.d.ts.map +1 -0
  225. package/declarations/helpers/hds-format-relative.d.ts +11 -0
  226. package/declarations/helpers/hds-format-relative.d.ts.map +1 -0
  227. package/declarations/modifiers/hds-anchored-position.d.ts +2 -1
  228. package/declarations/modifiers/hds-anchored-position.d.ts.map +1 -1
  229. package/declarations/modifiers/hds-clipboard.d.ts +4 -4
  230. package/declarations/modifiers/hds-clipboard.d.ts.map +1 -1
  231. package/declarations/modifiers/hds-register-event.d.ts +1 -1
  232. package/declarations/modifiers/hds-register-event.d.ts.map +1 -1
  233. package/declarations/modifiers/hds-tooltip.d.ts +4 -4
  234. package/declarations/modifiers/hds-tooltip.d.ts.map +1 -1
  235. package/declarations/services/hds-time-types.d.ts +31 -0
  236. package/declarations/services/hds-time-types.d.ts.map +1 -0
  237. package/declarations/services/hds-time.d.ts +76 -0
  238. package/declarations/services/hds-time.d.ts.map +1 -0
  239. package/declarations/services.d.ts +5 -0
  240. package/declarations/services.d.ts.map +1 -0
  241. package/declarations/template-registry.d.ts +49 -0
  242. package/declarations/template-registry.d.ts.map +1 -1
  243. package/dist/_app_/components/hds/{app-header → time}/index.js +1 -1
  244. package/dist/_app_/components/hds/{app-header/home-link.js → time/range.js} +1 -1
  245. package/dist/_app_/components/hds/{app-header/menu-button.js → time/single.js} +1 -1
  246. package/dist/_app_/helpers/hds-format-date.js +1 -0
  247. package/dist/_app_/helpers/hds-format-relative.js +1 -0
  248. package/dist/_app_/services/hds-time.js +1 -0
  249. package/dist/{_rollupPluginBabelHelpers-KIi_qCIU.js → _rollupPluginBabelHelpers-81503waH.js} +9 -3
  250. package/dist/_rollupPluginBabelHelpers-81503waH.js.map +1 -0
  251. package/dist/components/hds/accordion/index.js.map +1 -1
  252. package/dist/components/hds/accordion/item/button.js +2 -2
  253. package/dist/components/hds/accordion/item/button.js.map +1 -1
  254. package/dist/components/hds/accordion/item/index.js +6 -6
  255. package/dist/components/hds/accordion/item/index.js.map +1 -1
  256. package/dist/components/hds/accordion/types.js.map +1 -1
  257. package/dist/components/hds/alert/description.js +2 -2
  258. package/dist/components/hds/alert/description.js.map +1 -1
  259. package/dist/components/hds/alert/index.js +10 -10
  260. package/dist/components/hds/alert/index.js.map +1 -1
  261. package/dist/components/hds/alert/title.js.map +1 -1
  262. package/dist/components/hds/alert/types.js.map +1 -1
  263. package/dist/components/hds/app-footer/copyright.js.map +1 -1
  264. package/dist/components/hds/app-footer/index.js.map +1 -1
  265. package/dist/components/hds/app-footer/item.js +2 -2
  266. package/dist/components/hds/app-footer/item.js.map +1 -1
  267. package/dist/components/hds/app-footer/legal-links.js.map +1 -1
  268. package/dist/components/hds/app-footer/link.js +2 -2
  269. package/dist/components/hds/app-footer/link.js.map +1 -1
  270. package/dist/components/hds/app-footer/status-link.js.map +1 -1
  271. package/dist/components/hds/app-footer/types.js.map +1 -1
  272. package/dist/components/hds/app-frame/index.js.map +1 -1
  273. package/dist/components/hds/app-frame/parts/footer.js +2 -2
  274. package/dist/components/hds/app-frame/parts/footer.js.map +1 -1
  275. package/dist/components/hds/app-frame/parts/header.js +2 -2
  276. package/dist/components/hds/app-frame/parts/header.js.map +1 -1
  277. package/dist/components/hds/app-frame/parts/main.js +2 -2
  278. package/dist/components/hds/app-frame/parts/main.js.map +1 -1
  279. package/dist/components/hds/app-frame/parts/modals.js +2 -2
  280. package/dist/components/hds/app-frame/parts/modals.js.map +1 -1
  281. package/dist/components/hds/app-frame/parts/sidebar.js +2 -2
  282. package/dist/components/hds/app-frame/parts/sidebar.js.map +1 -1
  283. package/dist/components/hds/app-header/home-link.js.map +1 -1
  284. package/dist/components/hds/app-header/index.js +27 -27
  285. package/dist/components/hds/app-header/index.js.map +1 -1
  286. package/dist/components/hds/app-header/menu-button.js +2 -2
  287. package/dist/components/hds/app-header/menu-button.js.map +1 -1
  288. package/dist/components/hds/app-side-nav/index.js +187 -0
  289. package/dist/components/hds/app-side-nav/index.js.map +1 -0
  290. package/dist/components/hds/app-side-nav/list/back-link.js +16 -0
  291. package/dist/components/hds/app-side-nav/list/back-link.js.map +1 -0
  292. package/dist/components/hds/app-side-nav/list/index.js +33 -0
  293. package/dist/components/hds/app-side-nav/list/index.js.map +1 -0
  294. package/dist/components/hds/app-side-nav/list/item.js +16 -0
  295. package/dist/components/hds/app-side-nav/list/item.js.map +1 -0
  296. package/dist/components/hds/app-side-nav/list/link.js +16 -0
  297. package/dist/components/hds/app-side-nav/list/link.js.map +1 -0
  298. package/dist/components/hds/app-side-nav/list/title.js +29 -0
  299. package/dist/components/hds/app-side-nav/list/title.js.map +1 -0
  300. package/dist/components/hds/app-side-nav/portal/index.js +16 -0
  301. package/dist/components/hds/app-side-nav/portal/index.js.map +1 -0
  302. package/dist/components/hds/app-side-nav/portal/target.js +173 -0
  303. package/dist/components/hds/app-side-nav/portal/target.js.map +1 -0
  304. package/dist/components/hds/app-side-nav/toggle-button.js +16 -0
  305. package/dist/components/hds/app-side-nav/toggle-button.js.map +1 -0
  306. package/dist/components/hds/application-state/body.js +2 -2
  307. package/dist/components/hds/application-state/body.js.map +1 -1
  308. package/dist/components/hds/application-state/footer.js +2 -2
  309. package/dist/components/hds/application-state/footer.js.map +1 -1
  310. package/dist/components/hds/application-state/header.js.map +1 -1
  311. package/dist/components/hds/application-state/index.js.map +1 -1
  312. package/dist/components/hds/application-state/media.js +2 -2
  313. package/dist/components/hds/application-state/media.js.map +1 -1
  314. package/dist/components/hds/application-state/types.js.map +1 -1
  315. package/dist/components/hds/badge/index.js.map +1 -1
  316. package/dist/components/hds/badge/types.js.map +1 -1
  317. package/dist/components/hds/badge-count/index.js.map +1 -1
  318. package/dist/components/hds/badge-count/types.js.map +1 -1
  319. package/dist/components/hds/breadcrumb/index.js.map +1 -1
  320. package/dist/components/hds/breadcrumb/item.js.map +1 -1
  321. package/dist/components/hds/breadcrumb/truncation.js.map +1 -1
  322. package/dist/components/hds/button/index.js.map +1 -1
  323. package/dist/components/hds/button/types.js.map +1 -1
  324. package/dist/components/hds/button-set/index.js +2 -2
  325. package/dist/components/hds/button-set/index.js.map +1 -1
  326. package/dist/components/hds/card/container.js.map +1 -1
  327. package/dist/components/hds/card/types.js.map +1 -1
  328. package/dist/components/hds/code-block/copy-button.js +2 -2
  329. package/dist/components/hds/code-block/copy-button.js.map +1 -1
  330. package/dist/components/hds/code-block/description.js +2 -2
  331. package/dist/components/hds/code-block/description.js.map +1 -1
  332. package/dist/components/hds/code-block/index.js +9 -9
  333. package/dist/components/hds/code-block/index.js.map +1 -1
  334. package/dist/components/hds/code-block/title.js.map +1 -1
  335. package/dist/components/hds/code-block/types.js.map +1 -1
  336. package/dist/components/hds/copy/button/index.js +14 -14
  337. package/dist/components/hds/copy/button/index.js.map +1 -1
  338. package/dist/components/hds/copy/button/types.js.map +1 -1
  339. package/dist/components/hds/copy/snippet/index.js +14 -14
  340. package/dist/components/hds/copy/snippet/index.js.map +1 -1
  341. package/dist/components/hds/copy/snippet/types.js.map +1 -1
  342. package/dist/components/hds/dialog-primitive/body.js +2 -2
  343. package/dist/components/hds/dialog-primitive/body.js.map +1 -1
  344. package/dist/components/hds/dialog-primitive/description.js +2 -2
  345. package/dist/components/hds/dialog-primitive/description.js.map +1 -1
  346. package/dist/components/hds/dialog-primitive/footer.js.map +1 -1
  347. package/dist/components/hds/dialog-primitive/header.js.map +1 -1
  348. package/dist/components/hds/dialog-primitive/overlay.js +2 -2
  349. package/dist/components/hds/dialog-primitive/overlay.js.map +1 -1
  350. package/dist/components/hds/dialog-primitive/types.js.map +1 -1
  351. package/dist/components/hds/dialog-primitive/wrapper.js +2 -2
  352. package/dist/components/hds/dialog-primitive/wrapper.js.map +1 -1
  353. package/dist/components/hds/disclosure-primitive/index.js +3 -3
  354. package/dist/components/hds/disclosure-primitive/index.js.map +1 -1
  355. package/dist/components/hds/dismiss-button/index.js.map +1 -1
  356. package/dist/components/hds/dropdown/footer.js +2 -2
  357. package/dist/components/hds/dropdown/footer.js.map +1 -1
  358. package/dist/components/hds/dropdown/header.js +2 -2
  359. package/dist/components/hds/dropdown/header.js.map +1 -1
  360. package/dist/components/hds/dropdown/index.js +9 -5
  361. package/dist/components/hds/dropdown/index.js.map +1 -1
  362. package/dist/components/hds/dropdown/list-item/checkbox.js.map +1 -1
  363. package/dist/components/hds/dropdown/list-item/checkmark.js.map +1 -1
  364. package/dist/components/hds/dropdown/list-item/copy-item.js.map +1 -1
  365. package/dist/components/hds/dropdown/list-item/description.js.map +1 -1
  366. package/dist/components/hds/dropdown/list-item/generic.js +2 -2
  367. package/dist/components/hds/dropdown/list-item/generic.js.map +1 -1
  368. package/dist/components/hds/dropdown/list-item/interactive.js.map +1 -1
  369. package/dist/components/hds/dropdown/list-item/radio.js.map +1 -1
  370. package/dist/components/hds/dropdown/list-item/separator.js +2 -2
  371. package/dist/components/hds/dropdown/list-item/separator.js.map +1 -1
  372. package/dist/components/hds/dropdown/list-item/title.js.map +1 -1
  373. package/dist/components/hds/dropdown/list-item/types.js.map +1 -1
  374. package/dist/components/hds/dropdown/toggle/button.js +4 -4
  375. package/dist/components/hds/dropdown/toggle/button.js.map +1 -1
  376. package/dist/components/hds/dropdown/toggle/chevron.js +2 -2
  377. package/dist/components/hds/dropdown/toggle/chevron.js.map +1 -1
  378. package/dist/components/hds/dropdown/toggle/icon.js +7 -7
  379. package/dist/components/hds/dropdown/toggle/icon.js.map +1 -1
  380. package/dist/components/hds/dropdown/toggle/types.js.map +1 -1
  381. package/dist/components/hds/dropdown/types.js.map +1 -1
  382. package/dist/components/hds/flyout/body.js.map +1 -1
  383. package/dist/components/hds/flyout/description.js.map +1 -1
  384. package/dist/components/hds/flyout/footer.js.map +1 -1
  385. package/dist/components/hds/flyout/header.js.map +1 -1
  386. package/dist/components/hds/flyout/index.js +21 -19
  387. package/dist/components/hds/flyout/index.js.map +1 -1
  388. package/dist/components/hds/flyout/types.js.map +1 -1
  389. package/dist/components/hds/form/character-count/index.js.map +1 -1
  390. package/dist/components/hds/form/checkbox/base.js +2 -2
  391. package/dist/components/hds/form/checkbox/base.js.map +1 -1
  392. package/dist/components/hds/form/checkbox/field.js +2 -2
  393. package/dist/components/hds/form/checkbox/field.js.map +1 -1
  394. package/dist/components/hds/form/checkbox/group.js +2 -2
  395. package/dist/components/hds/form/checkbox/group.js.map +1 -1
  396. package/dist/components/hds/form/error/index.js.map +1 -1
  397. package/dist/components/hds/form/error/message.js +2 -2
  398. package/dist/components/hds/form/error/message.js.map +1 -1
  399. package/dist/components/hds/form/field/index.js +2 -2
  400. package/dist/components/hds/form/field/index.js.map +1 -1
  401. package/dist/components/hds/form/field/types.js.map +1 -1
  402. package/dist/components/hds/form/fieldset/index.js +2 -2
  403. package/dist/components/hds/form/fieldset/index.js.map +1 -1
  404. package/dist/components/hds/form/fieldset/types.js.map +1 -1
  405. package/dist/components/hds/form/file-input/base.js +2 -2
  406. package/dist/components/hds/form/file-input/base.js.map +1 -1
  407. package/dist/components/hds/form/file-input/field.js +2 -2
  408. package/dist/components/hds/form/file-input/field.js.map +1 -1
  409. package/dist/components/hds/form/helper-text/index.js.map +1 -1
  410. package/dist/components/hds/form/indicator/index.js.map +1 -1
  411. package/dist/components/hds/form/label/index.js.map +1 -1
  412. package/dist/components/hds/form/legend/index.js.map +1 -1
  413. package/dist/components/hds/form/masked-input/base.js +8 -37
  414. package/dist/components/hds/form/masked-input/base.js.map +1 -1
  415. package/dist/components/hds/form/masked-input/field.js +2 -2
  416. package/dist/components/hds/form/masked-input/field.js.map +1 -1
  417. package/dist/components/hds/form/radio/base.js +2 -2
  418. package/dist/components/hds/form/radio/base.js.map +1 -1
  419. package/dist/components/hds/form/radio/field.js +2 -2
  420. package/dist/components/hds/form/radio/field.js.map +1 -1
  421. package/dist/components/hds/form/radio/group.js +2 -2
  422. package/dist/components/hds/form/radio/group.js.map +1 -1
  423. package/dist/components/hds/form/radio-card/description.js +2 -2
  424. package/dist/components/hds/form/radio-card/description.js.map +1 -1
  425. package/dist/components/hds/form/radio-card/group.js +2 -2
  426. package/dist/components/hds/form/radio-card/group.js.map +1 -1
  427. package/dist/components/hds/form/radio-card/index.js.map +1 -1
  428. package/dist/components/hds/form/radio-card/label.js +2 -2
  429. package/dist/components/hds/form/radio-card/label.js.map +1 -1
  430. package/dist/components/hds/form/radio-card/types.js.map +1 -1
  431. package/dist/components/hds/form/select/base.js.map +1 -1
  432. package/dist/components/hds/form/select/field.js +2 -2
  433. package/dist/components/hds/form/select/field.js.map +1 -1
  434. package/dist/components/hds/form/super-select/after-options.js +2 -2
  435. package/dist/components/hds/form/super-select/after-options.js.map +1 -1
  436. package/dist/components/hds/form/super-select/multiple/base.js +20 -20
  437. package/dist/components/hds/form/super-select/multiple/base.js.map +1 -1
  438. package/dist/components/hds/form/super-select/multiple/field.js.map +1 -1
  439. package/dist/components/hds/form/super-select/option-group.js +4 -3
  440. package/dist/components/hds/form/super-select/option-group.js.map +1 -1
  441. package/dist/components/hds/form/super-select/placeholder.js +2 -2
  442. package/dist/components/hds/form/super-select/placeholder.js.map +1 -1
  443. package/dist/components/hds/form/super-select/single/base.js +3 -3
  444. package/dist/components/hds/form/super-select/single/base.js.map +1 -1
  445. package/dist/components/hds/form/super-select/single/field.js.map +1 -1
  446. package/dist/components/hds/form/super-select/types.js.map +1 -1
  447. package/dist/components/hds/form/text-input/base.js.map +1 -1
  448. package/dist/components/hds/form/text-input/field.js +19 -42
  449. package/dist/components/hds/form/text-input/field.js.map +1 -1
  450. package/dist/components/hds/form/text-input/types.js.map +1 -1
  451. package/dist/components/hds/form/textarea/base.js.map +1 -1
  452. package/dist/components/hds/form/textarea/field.js +2 -2
  453. package/dist/components/hds/form/textarea/field.js.map +1 -1
  454. package/dist/components/hds/form/toggle/base.js +2 -2
  455. package/dist/components/hds/form/toggle/base.js.map +1 -1
  456. package/dist/components/hds/form/toggle/field.js +2 -2
  457. package/dist/components/hds/form/toggle/field.js.map +1 -1
  458. package/dist/components/hds/form/toggle/group.js +2 -2
  459. package/dist/components/hds/form/toggle/group.js.map +1 -1
  460. package/dist/components/hds/form/visibility-toggle/index.js +2 -2
  461. package/dist/components/hds/form/visibility-toggle/index.js.map +1 -1
  462. package/dist/components/hds/icon/index.js +5 -5
  463. package/dist/components/hds/icon/index.js.map +1 -1
  464. package/dist/components/hds/icon/types.js.map +1 -1
  465. package/dist/components/hds/icon-tile/index.js.map +1 -1
  466. package/dist/components/hds/icon-tile/types.js.map +1 -1
  467. package/dist/components/hds/interactive/index.js +2 -2
  468. package/dist/components/hds/interactive/index.js.map +1 -1
  469. package/dist/components/hds/link/inline.js.map +1 -1
  470. package/dist/components/hds/link/standalone.js.map +1 -1
  471. package/dist/components/hds/link/types.js.map +1 -1
  472. package/dist/components/hds/menu-primitive/index.js +3 -3
  473. package/dist/components/hds/menu-primitive/index.js.map +1 -1
  474. package/dist/components/hds/modal/body.js.map +1 -1
  475. package/dist/components/hds/modal/footer.js.map +1 -1
  476. package/dist/components/hds/modal/header.js.map +1 -1
  477. package/dist/components/hds/modal/index.js +32 -32
  478. package/dist/components/hds/modal/index.js.map +1 -1
  479. package/dist/components/hds/modal/types.js.map +1 -1
  480. package/dist/components/hds/page-header/actions.js +2 -2
  481. package/dist/components/hds/page-header/actions.js.map +1 -1
  482. package/dist/components/hds/page-header/badges.js +2 -2
  483. package/dist/components/hds/page-header/badges.js.map +1 -1
  484. package/dist/components/hds/page-header/description.js +2 -2
  485. package/dist/components/hds/page-header/description.js.map +1 -1
  486. package/dist/components/hds/page-header/index.js +2 -2
  487. package/dist/components/hds/page-header/index.js.map +1 -1
  488. package/dist/components/hds/page-header/subtitle.js +2 -2
  489. package/dist/components/hds/page-header/subtitle.js.map +1 -1
  490. package/dist/components/hds/page-header/title.js +2 -2
  491. package/dist/components/hds/page-header/title.js.map +1 -1
  492. package/dist/components/hds/pagination/compact/index.js +15 -14
  493. package/dist/components/hds/pagination/compact/index.js.map +1 -1
  494. package/dist/components/hds/pagination/info/index.js.map +1 -1
  495. package/dist/components/hds/pagination/nav/arrow.js +2 -2
  496. package/dist/components/hds/pagination/nav/arrow.js.map +1 -1
  497. package/dist/components/hds/pagination/nav/ellipsis.js +2 -2
  498. package/dist/components/hds/pagination/nav/ellipsis.js.map +1 -1
  499. package/dist/components/hds/pagination/nav/number.js +2 -2
  500. package/dist/components/hds/pagination/nav/number.js.map +1 -1
  501. package/dist/components/hds/pagination/numbered/index.js +20 -22
  502. package/dist/components/hds/pagination/numbered/index.js.map +1 -1
  503. package/dist/components/hds/pagination/size-selector/index.js +4 -4
  504. package/dist/components/hds/pagination/size-selector/index.js.map +1 -1
  505. package/dist/components/hds/pagination/types.js.map +1 -1
  506. package/dist/components/hds/popover-primitive/index.js +55 -56
  507. package/dist/components/hds/popover-primitive/index.js.map +1 -1
  508. package/dist/components/hds/reveal/index.js +4 -4
  509. package/dist/components/hds/reveal/index.js.map +1 -1
  510. package/dist/components/hds/reveal/toggle/button.js.map +1 -1
  511. package/dist/components/hds/rich-tooltip/bubble.js.map +1 -1
  512. package/dist/components/hds/rich-tooltip/index.js +5 -5
  513. package/dist/components/hds/rich-tooltip/index.js.map +1 -1
  514. package/dist/components/hds/rich-tooltip/toggle.js.map +1 -1
  515. package/dist/components/hds/rich-tooltip/types.js.map +1 -1
  516. package/dist/components/hds/segmented-group/index.js +2 -2
  517. package/dist/components/hds/segmented-group/index.js.map +1 -1
  518. package/dist/components/hds/separator/index.js.map +1 -1
  519. package/dist/components/hds/separator/types.js.map +1 -1
  520. package/dist/components/hds/side-nav/base.js +3 -3
  521. package/dist/components/hds/side-nav/base.js.map +1 -1
  522. package/dist/components/hds/side-nav/header/home-link.js.map +1 -1
  523. package/dist/components/hds/side-nav/header/icon-button.js.map +1 -1
  524. package/dist/components/hds/side-nav/header/index.js +2 -2
  525. package/dist/components/hds/side-nav/header/index.js.map +1 -1
  526. package/dist/components/hds/side-nav/index.js +39 -38
  527. package/dist/components/hds/side-nav/index.js.map +1 -1
  528. package/dist/components/hds/side-nav/list/back-link.js +2 -2
  529. package/dist/components/hds/side-nav/list/back-link.js.map +1 -1
  530. package/dist/components/hds/side-nav/list/index.js +27 -10
  531. package/dist/components/hds/side-nav/list/index.js.map +1 -1
  532. package/dist/components/hds/side-nav/list/item.js +2 -2
  533. package/dist/components/hds/side-nav/list/item.js.map +1 -1
  534. package/dist/components/hds/side-nav/list/link.js +2 -2
  535. package/dist/components/hds/side-nav/list/link.js.map +1 -1
  536. package/dist/components/hds/side-nav/list/title.js +23 -10
  537. package/dist/components/hds/side-nav/list/title.js.map +1 -1
  538. package/dist/components/hds/side-nav/portal/index.js +2 -2
  539. package/dist/components/hds/side-nav/portal/index.js.map +1 -1
  540. package/dist/components/hds/side-nav/portal/target.js +3 -3
  541. package/dist/components/hds/side-nav/portal/target.js.map +1 -1
  542. package/dist/components/hds/side-nav/toggle-button.js +2 -2
  543. package/dist/components/hds/side-nav/toggle-button.js.map +1 -1
  544. package/dist/components/hds/stepper/step/indicator.js.map +1 -1
  545. package/dist/components/hds/stepper/task/indicator.js.map +1 -1
  546. package/dist/components/hds/stepper/types.js.map +1 -1
  547. package/dist/components/hds/table/index.js +32 -34
  548. package/dist/components/hds/table/index.js.map +1 -1
  549. package/dist/components/hds/table/td.js.map +1 -1
  550. package/dist/components/hds/table/th-button-sort.js +4 -4
  551. package/dist/components/hds/table/th-button-sort.js.map +1 -1
  552. package/dist/components/hds/table/th-button-tooltip.js +3 -3
  553. package/dist/components/hds/table/th-button-tooltip.js.map +1 -1
  554. package/dist/components/hds/table/th-selectable.js +11 -12
  555. package/dist/components/hds/table/th-selectable.js.map +1 -1
  556. package/dist/components/hds/table/th-sort.js +4 -4
  557. package/dist/components/hds/table/th-sort.js.map +1 -1
  558. package/dist/components/hds/table/th.js +4 -4
  559. package/dist/components/hds/table/th.js.map +1 -1
  560. package/dist/components/hds/table/tr.js.map +1 -1
  561. package/dist/components/hds/table/types.js.map +1 -1
  562. package/dist/components/hds/tabs/index.js +42 -43
  563. package/dist/components/hds/tabs/index.js.map +1 -1
  564. package/dist/components/hds/tabs/panel.js +9 -8
  565. package/dist/components/hds/tabs/panel.js.map +1 -1
  566. package/dist/components/hds/tabs/tab.js +6 -5
  567. package/dist/components/hds/tabs/tab.js.map +1 -1
  568. package/dist/components/hds/tabs/types.js.map +1 -1
  569. package/dist/components/hds/tag/index.js.map +1 -1
  570. package/dist/components/hds/tag/types.js.map +1 -1
  571. package/dist/components/hds/text/body.js.map +1 -1
  572. package/dist/components/hds/text/code.js.map +1 -1
  573. package/dist/components/hds/text/display.js.map +1 -1
  574. package/dist/components/hds/text/index.js.map +1 -1
  575. package/dist/components/hds/text/types.js.map +1 -1
  576. package/dist/components/hds/time/index.js +128 -0
  577. package/dist/components/hds/time/index.js.map +1 -0
  578. package/dist/components/hds/time/range.js +66 -0
  579. package/dist/components/hds/time/range.js.map +1 -0
  580. package/dist/components/hds/time/single.js +16 -0
  581. package/dist/components/hds/time/single.js.map +1 -0
  582. package/dist/components/hds/toast/index.js +2 -2
  583. package/dist/components/hds/toast/index.js.map +1 -1
  584. package/dist/components/hds/tooltip-button/index.js.map +1 -1
  585. package/dist/components/hds/tooltip-button/types.js.map +1 -1
  586. package/dist/components/hds/yield/index.js +2 -2
  587. package/dist/components/hds/yield/index.js.map +1 -1
  588. package/dist/components.js +3 -0
  589. package/dist/components.js.map +1 -1
  590. package/dist/helpers/hds-format-date.js +29 -0
  591. package/dist/helpers/hds-format-date.js.map +1 -0
  592. package/dist/helpers/hds-format-relative.js +29 -0
  593. package/dist/helpers/hds-format-relative.js.map +1 -0
  594. package/dist/helpers/hds-link-to-models.js.map +1 -1
  595. package/dist/helpers/hds-link-to-query.js.map +1 -1
  596. package/dist/instance-initializers/load-sprite.js.map +1 -1
  597. package/dist/modifiers/hds-anchored-position.js +25 -22
  598. package/dist/modifiers/hds-anchored-position.js.map +1 -1
  599. package/dist/modifiers/hds-clipboard.js +15 -6
  600. package/dist/modifiers/hds-clipboard.js.map +1 -1
  601. package/dist/modifiers/hds-register-event.js +4 -4
  602. package/dist/modifiers/hds-register-event.js.map +1 -1
  603. package/dist/modifiers/hds-tooltip.js +19 -19
  604. package/dist/modifiers/hds-tooltip.js.map +1 -1
  605. package/dist/services/hds-time-types.js +2 -0
  606. package/dist/services/hds-time-types.js.map +1 -0
  607. package/dist/services/hds-time.js +215 -0
  608. package/dist/services/hds-time.js.map +1 -0
  609. package/dist/services.js +2 -0
  610. package/dist/services.js.map +1 -0
  611. package/dist/styles/@hashicorp/design-system-components.css +113 -378
  612. package/dist/styles/@hashicorp/design-system-components.scss +3 -1
  613. package/dist/styles/components/alert.scss +0 -1
  614. package/dist/styles/components/app-side-nav/content.scss +182 -0
  615. package/dist/styles/components/app-side-nav/index.scss +9 -0
  616. package/dist/styles/components/app-side-nav/main.scss +147 -0
  617. package/dist/styles/components/app-side-nav/toggle-button.scss +101 -0
  618. package/dist/styles/components/app-side-nav/vars.scss +36 -0
  619. package/dist/styles/components/badge-count.scss +6 -5
  620. package/dist/styles/components/badge.scss +11 -9
  621. package/dist/styles/components/code-block/index.scss +1 -1
  622. package/dist/styles/components/copy/index.scss +2 -2
  623. package/dist/styles/components/dropdown.scss +20 -7
  624. package/dist/styles/components/icon-tile.scss +19 -23
  625. package/dist/styles/components/link/index.scss +2 -2
  626. package/dist/styles/components/link/standalone.scss +5 -4
  627. package/dist/styles/components/page-header.scss +4 -1
  628. package/dist/styles/components/side-nav/content.scss +5 -0
  629. package/dist/styles/components/side-nav/index.scss +6 -6
  630. package/dist/styles/components/stepper/index.scss +2 -2
  631. package/dist/styles/components/stepper/step-indicator.scss +14 -12
  632. package/dist/styles/components/stepper/task-indicator.scss +5 -3
  633. package/dist/styles/components/tabs.scss +4 -3
  634. package/dist/styles/components/time.scss +13 -0
  635. package/dist/styles/mixins/_button.scss +11 -9
  636. package/dist/utils/hds-aria-described-by.js +3 -3
  637. package/dist/utils/hds-aria-described-by.js.map +1 -1
  638. package/dist/utils/hds-get-element-id.js.map +1 -1
  639. package/package.json +15 -9
  640. package/dist/_rollupPluginBabelHelpers-KIi_qCIU.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/pagination/numbered/index.hbs","../../../../../src/components/hds/pagination/numbered/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class=\\\"hds-pagination\\\" ...attributes>\\n {{#if this.showInfo}}\\n <Hds::Pagination::Info\\n @itemsRangeStart={{this.itemsRangeStart}}\\n @itemsRangeEnd={{this.itemsRangeEnd}}\\n @totalItems={{@totalItems}}\\n @showTotalItems={{@showTotalItems}}\\n />\\n {{/if}}\\n\\n <nav class=\\\"hds-pagination-nav\\\" aria-label={{this.ariaLabel}}>\\n <Hds::Pagination::Nav::Arrow\\n @direction=\\\"prev\\\"\\n @showLabel={{this.showLabels}}\\n @route={{this.routing.route}}\\n @query={{this.routing.queryPrev}}\\n @model={{this.routing.model}}\\n @models={{this.routing.models}}\\n @replace={{this.routing.replace}}\\n @onClick={{this.onPageChange}}\\n @disabled={{this.isDisabledPrev}}\\n />\\n {{#if this.showPageNumbers}}\\n <ul class=\\\"hds-pagination-nav__page-list\\\">\\n {{#each this.pages as |page|}}\\n <li class=\\\"hds-pagination-nav__page-item\\\">\\n {{#if (eq page \\\"…\\\")}}\\n <Hds::Pagination::Nav::Ellipsis />\\n {{else}}\\n <Hds::Pagination::Nav::Number\\n @page={{this.elliptizedPageArrayItemAsNumber page}}\\n @route={{this.routing.route}}\\n @query={{get this.routing.queryPages page}}\\n @model={{this.routing.model}}\\n @models={{this.routing.models}}\\n @replace={{this.routing.replace}}\\n @onClick={{this.onPageChange}}\\n @isSelected={{if (eq page this.currentPage) true false}}\\n />\\n {{/if}}\\n </li>\\n {{/each}}\\n </ul>\\n {{/if}}\\n <Hds::Pagination::Nav::Arrow\\n @direction=\\\"next\\\"\\n @showLabel={{this.showLabels}}\\n @route={{this.routing.route}}\\n @query={{this.routing.queryNext}}\\n @model={{this.routing.model}}\\n @models={{this.routing.models}}\\n @replace={{this.routing.replace}}\\n @onClick={{this.onPageChange}}\\n @disabled={{this.isDisabledNext}}\\n />\\n </nav>\\n\\n {{#if this.showSizeSelector}}\\n <Hds::Pagination::SizeSelector\\n @pageSizes={{this.pageSizes}}\\n @label={{@sizeSelectorLabel}}\\n @selectedSize={{this.currentPageSize}}\\n @onChange={{this.onPageSizeChange}}\\n />\\n {{/if}}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport { HdsPaginationDirectionValues } from '../types.ts';\n\nimport type {\n HdsPaginationPage,\n HdsPaginationRoutingProps,\n HdsPaginationElliptizedPageArray,\n HdsPaginationElliptizedPageArrayItem,\n} from '../types';\nimport type { HdsInteractiveSignature } from '../../interactive/index.ts';\ninterface ElliptizeProps {\n pages: number[];\n current: number;\n limit?: number;\n}\n\ntype HdsInteractiveQuery = HdsInteractiveSignature['Args']['query'];\n\ntype HdsPaginationNumberedRoutingQueryProps = HdsPaginationRoutingProps & {\n queryNext?: HdsInteractiveQuery;\n queryPrev?: HdsInteractiveQuery;\n queryPages?: Record<\n HdsPaginationElliptizedPageArrayItem,\n HdsInteractiveQuery\n >;\n};\n\ntype HdsPaginationQueryFunction = (\n page: number,\n pageSize: number\n) => HdsInteractiveQuery;\n\ninterface HdsPaginationNumberedArgs extends HdsPaginationRoutingProps {\n ariaLabel?: string;\n totalItems: number;\n showLabels?: boolean;\n isTruncated?: boolean;\n currentPage?: number;\n showInfo?: boolean;\n showPageNumbers?: boolean;\n showTotalItems?: boolean;\n showSizeSelector?: boolean;\n sizeSelectorLabel?: string;\n pageSizes?: number[];\n currentPageSize?: number;\n queryFunction?: HdsPaginationQueryFunction;\n onPageChange?: (page: number, pageSize: number) => unknown;\n onPageSizeChange?: (pageSize: number) => unknown;\n}\n\ninterface HdsPaginationNumberedArgsControlledBase\n extends HdsPaginationNumberedArgs {\n currentPage: number;\n currentPageSize: number;\n queryFunction: HdsPaginationQueryFunction;\n}\n\ninterface HdsPaginationNumberedArgsControlledWithModel\n extends HdsPaginationNumberedArgsControlledBase {\n model: string | number;\n}\n\ninterface HdsPaginationNumberedArgsControlledWithModels\n extends HdsPaginationNumberedArgsControlledBase {\n models: Array<string | number>;\n}\ninterface HdsPaginationNumberedArgsControlledWithRoute\n extends HdsPaginationNumberedArgsControlledBase {\n route: string;\n}\n\ntype HdsPaginationNumberedArgsControlled =\n | HdsPaginationNumberedArgsControlledWithModel\n | HdsPaginationNumberedArgsControlledWithModels\n | HdsPaginationNumberedArgsControlledWithRoute;\n\ninterface HdsPaginationNumberedArgsUncontrolled\n extends HdsPaginationNumberedArgs {\n queryFunction?: undefined;\n}\n\nexport interface HdsPaginationNumberedSignature {\n Args:\n | HdsPaginationNumberedArgsControlled\n | HdsPaginationNumberedArgsUncontrolled;\n Element: HTMLDivElement;\n}\n\nconst ELLIPSIS = '…';\n\n// for context about the decision to use these values, see:\n// https://hashicorp.slack.com/archives/C03A0N1QK8S/p1673546329082759\nexport const DEFAULT_PAGE_SIZES = [10, 30, 50];\n\nexport const elliptize = ({\n pages,\n current,\n limit = 7,\n}: ElliptizeProps): HdsPaginationElliptizedPageArray => {\n const length = pages.length;\n\n let result = [];\n let start;\n let end;\n\n if (length <= limit) {\n return pages;\n }\n\n if (current <= length / 2) {\n start = Math.ceil(limit / 2);\n end = limit - start;\n } else {\n end = Math.ceil(limit / 2);\n start = limit - end;\n }\n\n const sliceStart: HdsPaginationElliptizedPageArray = pages.slice(0, start);\n const sliceEnd: HdsPaginationElliptizedPageArray = pages.slice(-end);\n\n if (sliceStart.includes(current) && sliceStart.includes(current + 1)) {\n // \"current\" (and its next sibling) is contained within the \"sliceStart\" block\n sliceEnd.splice(0, 1, ELLIPSIS);\n result = ([] as HdsPaginationElliptizedPageArray).concat(\n sliceStart,\n sliceEnd\n );\n } else if (sliceEnd.includes(current - 1) && sliceEnd.includes(current)) {\n // \"current\" (and its prev sibling) is contained within the \"sliceEnd\" block\n sliceStart.splice(-1, 1, ELLIPSIS);\n result = ([] as HdsPaginationElliptizedPageArray).concat(\n sliceStart,\n sliceEnd\n );\n } else {\n // this is a bit more tricky :)\n // we need to calculate how many items there are before/after the current item\n // since both the initial and ending blocks are always 2 items long (number + ellipsis)\n // and there is always the \"current\" item, we can just subtract 5 from the limit\n const delta = (limit - 5) / 2; // this is why the limit needs to be an odd number\n // we slice the array starting at the \"current\" index, minus the delta, minus one because it's an array (zero-based)\n const sliceCurr = pages.slice(current - delta - 1, current + delta);\n result = ([] as HdsPaginationElliptizedPageArray).concat(\n sliceStart.shift() as number,\n ELLIPSIS,\n sliceCurr,\n ELLIPSIS,\n sliceEnd.pop() as number\n );\n }\n\n return result;\n};\nexport default class HdsPaginationNumbered extends Component<HdsPaginationNumberedSignature> {\n // These two private variables are used to differentiate between\n // \"uncontrolled\" component (where the state is handled internally) and\n // \"controlled\" component (where the state is handled externally, by the consumer's code).\n // In the first case, these variables store the internal state of the component at any moment,\n // and their value is updated internally according to the user's interaction with the component.\n // In the second case, these variables store *only* the initial state of the component (coming from the arguments)\n // at rendering time, but from that moment on they're not updated anymore, no matter what interaction the user\n // has with the component (the state is controlled externally, eg. via query parameters)\n @tracked _currentPage = this.args.currentPage ?? 1;\n // we assert that `this.pageSizes` will always be an array with at least one item\n @tracked _currentPageSize = this.args.currentPageSize ?? this.pageSizes[0]!;\n @tracked isControlled;\n\n showInfo = this.args.showInfo ?? true; // if the \"info\" block is visible\n showLabels = this.args.showLabels ?? false; // if the labels for the \"prev/next\" controls are visible\n showSizeSelector = this.args.showSizeSelector ?? true; // if the \"size selector\" block is visible\n showPageNumbers = this.args.showPageNumbers ?? true; // if the \"page numbers\" block is visible\n isTruncated = this.args.isTruncated ?? true; // if the list of \"page numbers\" is truncated\n\n constructor(owner: unknown, args: HdsPaginationNumberedSignature['Args']) {\n super(owner, args);\n\n const { queryFunction } = this.args;\n\n // This component works in two different ways, depending if we need to support\n // routing through links (`LinkTo`) for the \"navigation controls\", or not.\n // If there's no routing then the component behaves as \"uncontrolled\"\n // (the state updates - eg to the \"currentPage\" and \"currentPageSize\"\n // are handled by its internal logic).\n // If instead the component needs to update the routing (and we infer this via the \"query\" arguments)\n // then the component behaves as \"controlled\", where the state is\n // initialized and updated using the arguments passed to it.\n\n if (queryFunction === undefined) {\n this.isControlled = false;\n } else {\n assert(\n '@model, @models, or @route for \"Hds::Pagination::Numbered\" must be provided when using the @queryFunction argument',\n this.args.model !== undefined ||\n this.args.models !== undefined ||\n this.args.route !== undefined\n );\n assert(\n '@queryFunction for \"Hds::Pagination::Numbered\" must be a function',\n typeof queryFunction === 'function'\n );\n assert(\n '@currentPage and @currentPageSize for \"Hds::Pagination::Numbered\" must be provided as numeric arguments when the pagination controls the routing',\n typeof this.args.currentPageSize === 'number' &&\n typeof this.args.currentPage === 'number'\n );\n this.isControlled = true;\n }\n\n assert(\n '@totalItems for \"Hds::Pagination::Numbered\" must be defined as an integer number',\n typeof this.args.totalItems === 'number'\n );\n }\n\n get ariaLabel(): string {\n return this.args.ariaLabel ?? 'Pagination';\n }\n\n // This very specific `get/set` pattern is used to handle the two different use cases of the component\n // being \"controlled\" (when it has routing, meaning it needs to support pagination controls as links/`LinkTo`)\n // vs being \"uncontrolled\" (see comments above for details).\n //\n // If it has routing (and so it's \"controlled\"), than the value (\"state\") of the `currentPage/currentPageSize` variables\n // is *always* determined by the controller via arguments (most of the times, connected to query parameters in the URL).\n // For this reason the \"get\" method always returns the value from the `args`,\n // while the \"set\" method never updates the private internal state (_variable).\n //\n // If instead it doesn't have routing (and so it's \"uncontrolled\") than the value (\"state\") of the `currentPage/currentPageSize` variables\n // is *always* determined by the component's internal logic (and updated according to the user interaction with it).\n // For this reason the \"get\" and \"set\" methods always read from or write to the private internal state (_variable).\n\n get currentPage(): number {\n if (this.isControlled) {\n // if the component is controlled, `@currentPage` is asserted to be a number\n return this.args.currentPage as number;\n } else {\n return this._currentPage;\n }\n }\n set currentPage(value) {\n if (this.isControlled) {\n // noop\n } else {\n // if `this.isControlled` is `false`\n this._currentPage = value as number;\n }\n }\n\n get currentPageSize(): number {\n if (this.isControlled) {\n // if the component is controlled, `@currentPageSize` is asserted to be a number\n return this.args.currentPageSize as number;\n } else {\n return this._currentPageSize;\n }\n }\n set currentPageSize(value) {\n if (this.isControlled) {\n // noop\n } else {\n this._currentPageSize = value;\n }\n }\n\n get pageSizes(): number[] {\n const { pageSizes = DEFAULT_PAGE_SIZES } = this.args;\n\n assert(\n // TODO: Add test for this\n `pageSizes argument must be an array with at least one item. Received: ${pageSizes}`,\n Array.isArray(pageSizes) === true && pageSizes.length > 0\n );\n\n return pageSizes;\n }\n\n get itemsRangeStart(): number {\n // Calculate the starting range of items displayed on current page\n // if currentPage = 1st page and # of items per page is 10:\n // ( (1 - 1 = 0) * 10 = 0 ) + 1 = 1\n // if current page = 2nd page:\n // ( (2 - 1 = 1) * 10 = 10 ) + 1 = 11\n return (this.currentPage - 1) * this.currentPageSize + 1;\n }\n\n get itemsRangeEnd(): number {\n // Calculate ending range of items displayed on current page\n // 2 cases: 1) full page of items or 2) last page of items\n if (this.currentPage * this.currentPageSize < this.args.totalItems) {\n // 1) full page of items (pages 1 to page before last):\n return this.itemsRangeStart + this.currentPageSize - 1;\n } else {\n // 2) last page of items:\n return this.args.totalItems;\n }\n }\n\n get pages(): HdsPaginationElliptizedPageArray {\n const pages = [];\n\n for (let i = 1; i <= this.totalPages; i++) {\n pages.push(i);\n }\n\n if (this.isTruncated) {\n return elliptize({ pages, current: this.currentPage });\n } else {\n return pages;\n }\n }\n\n get totalPages() {\n return Math.max(Math.ceil(this.args.totalItems / this.currentPageSize), 1);\n }\n\n buildQueryParamsObject(\n page: HdsPaginationElliptizedPageArrayItem,\n pageSize: number\n ): HdsInteractiveQuery {\n // `page` may also be ellipsis\n if (this.isControlled && typeof page === 'number') {\n // if the component is controlled, `@queryFunction` is asserted to be a function\n return this.args.queryFunction!(page, pageSize);\n } else {\n return {};\n }\n }\n\n get routing(): HdsPaginationNumberedRoutingQueryProps {\n const routing: HdsPaginationNumberedRoutingQueryProps = {\n route: this.args.route ?? undefined,\n model: this.args.model ?? undefined,\n models: this.args.models ?? undefined,\n replace: this.args.replace ?? undefined,\n };\n\n // the \"query\" is dynamic and needs to be calculated\n if (this.isControlled) {\n routing.queryPrev = this.buildQueryParamsObject(\n this.currentPage - 1,\n this.currentPageSize\n );\n routing.queryNext = this.buildQueryParamsObject(\n this.currentPage + 1,\n this.currentPageSize\n );\n // IMPORTANT: here we need to use an object and not an array\n // otherwise the {{get object page}} will be shifted by one\n // (the pages are 1-based while the array would be zero-based)\n routing.queryPages = {};\n this.pages.forEach(\n (page) =>\n (routing.queryPages![page] = this.buildQueryParamsObject(\n page,\n this.currentPageSize\n ))\n );\n } else {\n routing.queryPrev = undefined;\n routing.queryNext = undefined;\n }\n\n return routing;\n }\n\n get isDisabledPrev() {\n return this.currentPage === 1;\n }\n\n get isDisabledNext() {\n return this.currentPage === this.totalPages;\n }\n\n @action\n onPageChange(page: HdsPaginationPage) {\n let gotoPageNumber;\n if (page === HdsPaginationDirectionValues.Prev && this.currentPage > 1) {\n gotoPageNumber = this.currentPage - 1;\n } else if (\n page === HdsPaginationDirectionValues.Next &&\n this.currentPage < this.totalPages\n ) {\n gotoPageNumber = this.currentPage + 1;\n } else {\n gotoPageNumber = page;\n }\n\n // we want to invoke the `onPageChange` callback only on actual page change\n if (gotoPageNumber !== this.currentPage) {\n // we have already determined that `gotoPageNumber` is not `prev` or `next`\n this.currentPage = gotoPageNumber as number;\n\n const { onPageChange } = this.args;\n\n if (typeof onPageChange === 'function') {\n onPageChange(this.currentPage, this.currentPageSize);\n }\n }\n }\n\n @action\n onPageSizeChange(newPageSize: number) {\n const { onPageSizeChange } = this.args;\n\n if (!this.isControlled) {\n // notice: we agreed to reset the pagination to the first element (any alternative would result in an unpredictable UX)\n this.currentPage = 1;\n this.currentPageSize = newPageSize;\n }\n\n // invoke the callback function\n if (typeof onPageSizeChange === 'function') {\n onPageSizeChange(newPageSize);\n }\n }\n\n elliptizedPageArrayItemAsNumber = (\n item: HdsPaginationElliptizedPageArrayItem\n ): number => {\n if (typeof item === 'number') {\n return item;\n } else {\n throw new Error('Expected a number, but got an ellipsis');\n }\n };\n\n getPageNumberQuery(page: HdsPaginationElliptizedPageArrayItem) {\n return this.routing.queryPages![this.elliptizedPageArrayItemAsNumber(page)];\n }\n}\n"],"names":["ELLIPSIS","DEFAULT_PAGE_SIZES","elliptize","pages","current","limit","length","result","start","end","Math","ceil","sliceStart","slice","sliceEnd","includes","splice","concat","delta","sliceCurr","shift","pop","HdsPaginationNumbered","_class","Component","constructor","owner","args","_initializerDefineProperty","_descriptor","_descriptor2","_descriptor3","_defineProperty","showInfo","showLabels","showSizeSelector","showPageNumbers","isTruncated","item","Error","queryFunction","undefined","isControlled","assert","model","models","route","currentPageSize","currentPage","totalItems","ariaLabel","_currentPage","value","_currentPageSize","pageSizes","Array","isArray","itemsRangeStart","itemsRangeEnd","i","totalPages","push","max","buildQueryParamsObject","page","pageSize","routing","replace","queryPrev","queryNext","queryPages","forEach","isDisabledPrev","isDisabledNext","onPageChange","gotoPageNumber","HdsPaginationDirectionValues","Prev","Next","onPageSizeChange","newPageSize","getPageNumberQuery","elliptizedPageArrayItemAsNumber","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;AACA,eAAe,kBAAkB,CAAC,kzEAAkzE;;;AC8Fp1E,MAAMA,QAAQ,GAAG,GAAG,CAAA;;AAEpB;AACA;AACO,MAAMC,kBAAkB,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC;AAEvC,MAAMC,SAAS,GAAGA,CAAC;EACxBC,KAAK;EACLC,OAAO;AACPC,EAAAA,KAAK,GAAG,CAAA;AACM,CAAC,KAAuC;AACtD,EAAA,MAAMC,MAAM,GAAGH,KAAK,CAACG,MAAM,CAAA;EAE3B,IAAIC,MAAM,GAAG,EAAE,CAAA;AACf,EAAA,IAAIC,KAAK,CAAA;AACT,EAAA,IAAIC,GAAG,CAAA;EAEP,IAAIH,MAAM,IAAID,KAAK,EAAE;AACnB,IAAA,OAAOF,KAAK,CAAA;AACd,GAAA;AAEA,EAAA,IAAIC,OAAO,IAAIE,MAAM,GAAG,CAAC,EAAE;IACzBE,KAAK,GAAGE,IAAI,CAACC,IAAI,CAACN,KAAK,GAAG,CAAC,CAAC,CAAA;IAC5BI,GAAG,GAAGJ,KAAK,GAAGG,KAAK,CAAA;AACrB,GAAC,MAAM;IACLC,GAAG,GAAGC,IAAI,CAACC,IAAI,CAACN,KAAK,GAAG,CAAC,CAAC,CAAA;IAC1BG,KAAK,GAAGH,KAAK,GAAGI,GAAG,CAAA;AACrB,GAAA;EAEA,MAAMG,UAA4C,GAAGT,KAAK,CAACU,KAAK,CAAC,CAAC,EAAEL,KAAK,CAAC,CAAA;EAC1E,MAAMM,QAA0C,GAAGX,KAAK,CAACU,KAAK,CAAC,CAACJ,GAAG,CAAC,CAAA;AAEpE,EAAA,IAAIG,UAAU,CAACG,QA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,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;AAAAC,EAAAA,WAAA,cAAA;IAAA,OAAoB,IAAI,CAAC9D,IAAI,CAACoB,eAAe,IAAI,IAAI,CAACO,SAAS,CAAC,CAAC,CAAE,CAAA;AAAA,GAAA;AAAA,CAAAvB,CAAAA,EAAAA,YAAA,GAAAoD,yBAAA,CAAA5D,MAAA,CAAA6D,SAAA,mBAC1EC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA,IAAA;AAAA,CAAA,CAAA,EAAAN,yBAAA,CAAA5D,MAAA,CAAA6D,SAAA,EAAA,cAAA,EAAA,CAgNPM,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAArE,MAAA,CAAA6D,SAAA,EAAA7D,cAAAA,CAAAA,EAAAA,MAAA,CAAA6D,SAAA,CAAA,EAAAD,yBAAA,CAAA5D,MAAA,CAAA6D,SAAA,uBA2BNM,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAArE,MAAA,CAAA6D,SAAA,EAAA,kBAAA,CAAA,EAAA7D,MAAA,CAAA6D,SAAA,IAAA7D,MAAA,EAAA;AAvPiCsE,oBAAA,CAAAC,QAAA,EAArBxE,qBAAqB,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/pagination/numbered/index.hbs","../../../../../src/components/hds/pagination/numbered/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class=\\\"hds-pagination\\\" ...attributes>\\n {{#if this.showInfo}}\\n <Hds::Pagination::Info\\n @itemsRangeStart={{this.itemsRangeStart}}\\n @itemsRangeEnd={{this.itemsRangeEnd}}\\n @totalItems={{@totalItems}}\\n @showTotalItems={{@showTotalItems}}\\n />\\n {{/if}}\\n\\n <nav class=\\\"hds-pagination-nav\\\" aria-label={{this.ariaLabel}}>\\n <Hds::Pagination::Nav::Arrow\\n @direction=\\\"prev\\\"\\n @showLabel={{this.showLabels}}\\n @route={{this.routing.route}}\\n @query={{this.routing.queryPrev}}\\n @model={{this.routing.model}}\\n @models={{this.routing.models}}\\n @replace={{this.routing.replace}}\\n @onClick={{this.onPageChange}}\\n @disabled={{this.isDisabledPrev}}\\n />\\n {{#if this.showPageNumbers}}\\n <ul class=\\\"hds-pagination-nav__page-list\\\">\\n {{#each this.pages as |page|}}\\n <li class=\\\"hds-pagination-nav__page-item\\\">\\n {{#if (eq page \\\"…\\\")}}\\n <Hds::Pagination::Nav::Ellipsis />\\n {{else}}\\n <Hds::Pagination::Nav::Number\\n @page={{this.elliptizedPageArrayItemAsNumber page}}\\n @route={{this.routing.route}}\\n @query={{get this.routing.queryPages page}}\\n @model={{this.routing.model}}\\n @models={{this.routing.models}}\\n @replace={{this.routing.replace}}\\n @onClick={{this.onPageChange}}\\n @isSelected={{if (eq page this.currentPage) true false}}\\n />\\n {{/if}}\\n </li>\\n {{/each}}\\n </ul>\\n {{/if}}\\n <Hds::Pagination::Nav::Arrow\\n @direction=\\\"next\\\"\\n @showLabel={{this.showLabels}}\\n @route={{this.routing.route}}\\n @query={{this.routing.queryNext}}\\n @model={{this.routing.model}}\\n @models={{this.routing.models}}\\n @replace={{this.routing.replace}}\\n @onClick={{this.onPageChange}}\\n @disabled={{this.isDisabledNext}}\\n />\\n </nav>\\n\\n {{#if this.showSizeSelector}}\\n <Hds::Pagination::SizeSelector\\n @pageSizes={{this.pageSizes}}\\n @label={{@sizeSelectorLabel}}\\n @selectedSize={{this.currentPageSize}}\\n @onChange={{this.onPageSizeChange}}\\n />\\n {{/if}}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport { HdsPaginationDirectionValues } from '../types.ts';\n\nimport type {\n HdsPaginationPage,\n HdsPaginationRoutingProps,\n HdsPaginationElliptizedPageArray,\n HdsPaginationElliptizedPageArrayItem,\n} from '../types';\nimport type { HdsInteractiveSignature } from '../../interactive/index.ts';\ninterface ElliptizeProps {\n pages: number[];\n current: number;\n limit?: number;\n}\n\ntype HdsInteractiveQuery = HdsInteractiveSignature['Args']['query'];\n\ntype HdsPaginationNumberedRoutingQueryProps = HdsPaginationRoutingProps & {\n queryNext?: HdsInteractiveQuery;\n queryPrev?: HdsInteractiveQuery;\n queryPages?: Record<\n HdsPaginationElliptizedPageArrayItem,\n HdsInteractiveQuery\n >;\n};\n\ntype HdsPaginationQueryFunction = (\n page: number,\n pageSize: number\n) => HdsInteractiveQuery;\n\ninterface HdsPaginationNumberedArgs extends HdsPaginationRoutingProps {\n ariaLabel?: string;\n totalItems: number;\n showLabels?: boolean;\n isTruncated?: boolean;\n currentPage?: number;\n showInfo?: boolean;\n showPageNumbers?: boolean;\n showTotalItems?: boolean;\n showSizeSelector?: boolean;\n sizeSelectorLabel?: string;\n pageSizes?: number[];\n currentPageSize?: number;\n queryFunction?: HdsPaginationQueryFunction;\n onPageChange?: (page: number, pageSize: number) => unknown;\n onPageSizeChange?: (pageSize: number) => unknown;\n}\n\ninterface HdsPaginationNumberedArgsControlledBase\n extends HdsPaginationNumberedArgs {\n currentPage: number;\n currentPageSize: number;\n queryFunction: HdsPaginationQueryFunction;\n}\n\ninterface HdsPaginationNumberedArgsControlledWithModel\n extends HdsPaginationNumberedArgsControlledBase {\n model: string | number;\n}\n\ninterface HdsPaginationNumberedArgsControlledWithModels\n extends HdsPaginationNumberedArgsControlledBase {\n models: Array<string | number>;\n}\ninterface HdsPaginationNumberedArgsControlledWithRoute\n extends HdsPaginationNumberedArgsControlledBase {\n route: string;\n}\n\ntype HdsPaginationNumberedArgsControlled =\n | HdsPaginationNumberedArgsControlledWithModel\n | HdsPaginationNumberedArgsControlledWithModels\n | HdsPaginationNumberedArgsControlledWithRoute;\n\ninterface HdsPaginationNumberedArgsUncontrolled\n extends HdsPaginationNumberedArgs {\n queryFunction?: undefined;\n}\n\nexport interface HdsPaginationNumberedSignature {\n Args:\n | HdsPaginationNumberedArgsControlled\n | HdsPaginationNumberedArgsUncontrolled;\n Element: HTMLDivElement;\n}\n\nconst ELLIPSIS = '…';\n\n// for context about the decision to use these values, see:\n// https://hashicorp.slack.com/archives/C03A0N1QK8S/p1673546329082759\nexport const DEFAULT_PAGE_SIZES = [10, 30, 50];\n\nexport const elliptize = ({\n pages,\n current,\n limit = 7,\n}: ElliptizeProps): HdsPaginationElliptizedPageArray => {\n const length = pages.length;\n\n let result = [];\n let start;\n let end;\n\n if (length <= limit) {\n return pages;\n }\n\n if (current <= length / 2) {\n start = Math.ceil(limit / 2);\n end = limit - start;\n } else {\n end = Math.ceil(limit / 2);\n start = limit - end;\n }\n\n const sliceStart: HdsPaginationElliptizedPageArray = pages.slice(0, start);\n const sliceEnd: HdsPaginationElliptizedPageArray = pages.slice(-end);\n\n if (sliceStart.includes(current) && sliceStart.includes(current + 1)) {\n // \"current\" (and its next sibling) is contained within the \"sliceStart\" block\n sliceEnd.splice(0, 1, ELLIPSIS);\n result = ([] as HdsPaginationElliptizedPageArray).concat(\n sliceStart,\n sliceEnd\n );\n } else if (sliceEnd.includes(current - 1) && sliceEnd.includes(current)) {\n // \"current\" (and its prev sibling) is contained within the \"sliceEnd\" block\n sliceStart.splice(-1, 1, ELLIPSIS);\n result = ([] as HdsPaginationElliptizedPageArray).concat(\n sliceStart,\n sliceEnd\n );\n } else {\n // this is a bit more tricky :)\n // we need to calculate how many items there are before/after the current item\n // since both the initial and ending blocks are always 2 items long (number + ellipsis)\n // and there is always the \"current\" item, we can just subtract 5 from the limit\n const delta = (limit - 5) / 2; // this is why the limit needs to be an odd number\n // we slice the array starting at the \"current\" index, minus the delta, minus one because it's an array (zero-based)\n const sliceCurr = pages.slice(current - delta - 1, current + delta);\n result = ([] as HdsPaginationElliptizedPageArray).concat(\n sliceStart.shift() as number,\n ELLIPSIS,\n sliceCurr,\n ELLIPSIS,\n sliceEnd.pop() as number\n );\n }\n\n return result;\n};\nexport default class HdsPaginationNumbered extends Component<HdsPaginationNumberedSignature> {\n // These two private variables are used to differentiate between\n // \"uncontrolled\" component (where the state is handled internally) and\n // \"controlled\" component (where the state is handled externally, by the consumer's code).\n // In the first case, these variables store the internal state of the component at any moment,\n // and their value is updated internally according to the user's interaction with the component.\n // In the second case, these variables store *only* the initial state of the component (coming from the arguments)\n // at rendering time, but from that moment on they're not updated anymore, no matter what interaction the user\n // has with the component (the state is controlled externally, eg. via query parameters)\n @tracked private _currentPage;\n @tracked private _currentPageSize;\n @tracked private _isControlled;\n\n showInfo = this.args.showInfo ?? true; // if the \"info\" block is visible\n showLabels = this.args.showLabels ?? false; // if the labels for the \"prev/next\" controls are visible\n showSizeSelector = this.args.showSizeSelector ?? true; // if the \"size selector\" block is visible\n showPageNumbers = this.args.showPageNumbers ?? true; // if the \"page numbers\" block is visible\n isTruncated = this.args.isTruncated ?? true; // if the list of \"page numbers\" is truncated\n\n constructor(owner: unknown, args: HdsPaginationNumberedSignature['Args']) {\n super(owner, args);\n\n const { queryFunction } = this.args;\n\n // This component works in two different ways, depending if we need to support\n // routing through links (`LinkTo`) for the \"navigation controls\", or not.\n // If there's no routing then the component behaves as \"uncontrolled\"\n // (the state updates - eg to the \"currentPage\" and \"currentPageSize\"\n // are handled by its internal logic).\n // If instead the component needs to update the routing (and we infer this via the \"query\" arguments)\n // then the component behaves as \"controlled\", where the state is\n // initialized and updated using the arguments passed to it.\n\n if (queryFunction === undefined) {\n this._isControlled = false;\n } else {\n assert(\n '@model, @models, or @route for \"Hds::Pagination::Numbered\" must be provided when using the @queryFunction argument',\n this.args.model !== undefined ||\n this.args.models !== undefined ||\n this.args.route !== undefined\n );\n assert(\n '@queryFunction for \"Hds::Pagination::Numbered\" must be a function',\n typeof queryFunction === 'function'\n );\n assert(\n '@currentPage and @currentPageSize for \"Hds::Pagination::Numbered\" must be provided as numeric arguments when the pagination controls the routing',\n typeof this.args.currentPageSize === 'number' &&\n typeof this.args.currentPage === 'number'\n );\n this._isControlled = true;\n }\n\n assert(\n '@totalItems for \"Hds::Pagination::Numbered\" must be defined as an integer number',\n typeof this.args.totalItems === 'number'\n );\n\n this._currentPage = this.args.currentPage ?? 1;\n // we assert that `this.pageSizes` will always be an array with at least one item\n this._currentPageSize = this.args.currentPageSize ?? this.pageSizes[0];\n }\n\n get ariaLabel(): string {\n return this.args.ariaLabel ?? 'Pagination';\n }\n\n // This very specific `get/set` pattern is used to handle the two different use cases of the component\n // being \"controlled\" (when it has routing, meaning it needs to support pagination controls as links/`LinkTo`)\n // vs being \"uncontrolled\" (see comments above for details).\n //\n // If it has routing (and so it's \"controlled\"), than the value (\"state\") of the `currentPage/currentPageSize` variables\n // is *always* determined by the controller via arguments (most of the times, connected to query parameters in the URL).\n // For this reason the \"get\" method always returns the value from the `args`,\n // while the \"set\" method never updates the private internal state (_variable).\n //\n // If instead it doesn't have routing (and so it's \"uncontrolled\") than the value (\"state\") of the `currentPage/currentPageSize` variables\n // is *always* determined by the component's internal logic (and updated according to the user interaction with it).\n // For this reason the \"get\" and \"set\" methods always read from or write to the private internal state (_variable).\n\n get currentPage(): number {\n if (this._isControlled) {\n // if the component is controlled, `@currentPage` is asserted to be a number\n return this.args.currentPage as number;\n } else {\n return this._currentPage;\n }\n }\n set currentPage(value) {\n if (this._isControlled) {\n // noop\n } else {\n // if `this._isControlled` is `false`\n this._currentPage = value as number;\n }\n }\n\n get currentPageSize(): number {\n if (this._isControlled) {\n // if the component is controlled, `@currentPageSize` is asserted to be a number\n return this.args.currentPageSize as number;\n } else {\n return this._currentPageSize as number;\n }\n }\n set currentPageSize(value) {\n if (this._isControlled) {\n // noop\n } else {\n this._currentPageSize = value;\n }\n }\n\n get pageSizes(): number[] {\n const { pageSizes = DEFAULT_PAGE_SIZES } = this.args;\n\n assert(\n // TODO: Add test for this\n `pageSizes argument must be an array with at least one item. Received: ${pageSizes}`,\n Array.isArray(pageSizes) === true && pageSizes.length > 0\n );\n\n return pageSizes;\n }\n\n get itemsRangeStart(): number {\n // Calculate the starting range of items displayed on current page\n // if currentPage = 1st page and # of items per page is 10:\n // ( (1 - 1 = 0) * 10 = 0 ) + 1 = 1\n // if current page = 2nd page:\n // ( (2 - 1 = 1) * 10 = 10 ) + 1 = 11\n return (this.currentPage - 1) * this.currentPageSize + 1;\n }\n\n get itemsRangeEnd(): number {\n // Calculate ending range of items displayed on current page\n // 2 cases: 1) full page of items or 2) last page of items\n if (this.currentPage * this.currentPageSize < this.args.totalItems) {\n // 1) full page of items (pages 1 to page before last):\n return this.itemsRangeStart + this.currentPageSize - 1;\n } else {\n // 2) last page of items:\n return this.args.totalItems;\n }\n }\n\n get pages(): HdsPaginationElliptizedPageArray {\n const pages = [];\n\n for (let i = 1; i <= this.totalPages; i++) {\n pages.push(i);\n }\n\n if (this.isTruncated) {\n return elliptize({ pages, current: this.currentPage });\n } else {\n return pages;\n }\n }\n\n get totalPages() {\n return Math.max(Math.ceil(this.args.totalItems / this.currentPageSize), 1);\n }\n\n buildQueryParamsObject(\n page: HdsPaginationElliptizedPageArrayItem,\n pageSize: number\n ): HdsInteractiveQuery {\n // `page` may also be ellipsis\n if (this._isControlled && typeof page === 'number') {\n // if the component is controlled, `@queryFunction` is asserted to be a function\n return this.args.queryFunction!(page, pageSize);\n } else {\n return {};\n }\n }\n\n get routing(): HdsPaginationNumberedRoutingQueryProps {\n const routing: HdsPaginationNumberedRoutingQueryProps = {\n route: this.args.route ?? undefined,\n model: this.args.model ?? undefined,\n models: this.args.models ?? undefined,\n replace: this.args.replace ?? undefined,\n };\n\n // the \"query\" is dynamic and needs to be calculated\n if (this._isControlled) {\n routing.queryPrev = this.buildQueryParamsObject(\n this.currentPage - 1,\n this.currentPageSize\n );\n routing.queryNext = this.buildQueryParamsObject(\n this.currentPage + 1,\n this.currentPageSize\n );\n // IMPORTANT: here we need to use an object and not an array\n // otherwise the {{get object page}} will be shifted by one\n // (the pages are 1-based while the array would be zero-based)\n routing.queryPages = {};\n this.pages.forEach(\n (page) =>\n (routing.queryPages![page] = this.buildQueryParamsObject(\n page,\n this.currentPageSize\n ))\n );\n } else {\n routing.queryPrev = undefined;\n routing.queryNext = undefined;\n }\n\n return routing;\n }\n\n get isDisabledPrev() {\n return this.currentPage === 1;\n }\n\n get isDisabledNext() {\n return this.currentPage === this.totalPages;\n }\n\n @action\n onPageChange(page: HdsPaginationPage) {\n let gotoPageNumber;\n if (page === HdsPaginationDirectionValues.Prev && this.currentPage > 1) {\n gotoPageNumber = this.currentPage - 1;\n } else if (\n page === HdsPaginationDirectionValues.Next &&\n this.currentPage < this.totalPages\n ) {\n gotoPageNumber = this.currentPage + 1;\n } else {\n gotoPageNumber = page;\n }\n\n // we want to invoke the `onPageChange` callback only on actual page change\n if (gotoPageNumber !== this.currentPage) {\n // we have already determined that `gotoPageNumber` is not `prev` or `next`\n this.currentPage = gotoPageNumber as number;\n\n const { onPageChange } = this.args;\n\n if (typeof onPageChange === 'function') {\n onPageChange(this.currentPage, this.currentPageSize);\n }\n }\n }\n\n @action\n onPageSizeChange(newPageSize: number) {\n const { onPageSizeChange } = this.args;\n\n if (!this._isControlled) {\n // notice: we agreed to reset the pagination to the first element (any alternative would result in an unpredictable UX)\n this.currentPage = 1;\n this.currentPageSize = newPageSize;\n }\n\n // invoke the callback function\n if (typeof onPageSizeChange === 'function') {\n onPageSizeChange(newPageSize);\n }\n }\n\n elliptizedPageArrayItemAsNumber = (\n item: HdsPaginationElliptizedPageArrayItem\n ): number => {\n if (typeof item === 'number') {\n return item;\n } else {\n throw new Error('Expected a number, but got an ellipsis');\n }\n };\n\n getPageNumberQuery(page: HdsPaginationElliptizedPageArrayItem) {\n return this.routing.queryPages![this.elliptizedPageArrayItemAsNumber(page)];\n }\n}\n"],"names":["ELLIPSIS","DEFAULT_PAGE_SIZES","elliptize","pages","current","limit","length","result","start","end","Math","ceil","sliceStart","slice","sliceEnd","includes","splice","concat","delta","sliceCurr","shift","pop","HdsPaginationNumbered","_class","Component","constructor","owner","args","_initializerDefineProperty","_descriptor","_descriptor2","_descriptor3","_defineProperty","showInfo","showLabels","showSizeSelector","showPageNumbers","isTruncated","item","Error","queryFunction","undefined","_isControlled","assert","model","models","route","currentPageSize","currentPage","totalItems","_currentPage","_currentPageSize","pageSizes","ariaLabel","value","Array","isArray","itemsRangeStart","itemsRangeEnd","i","totalPages","push","max","buildQueryParamsObject","page","pageSize","routing","replace","queryPrev","queryNext","queryPages","forEach","isDisabledPrev","isDisabledNext","onPageChange","gotoPageNumber","HdsPaginationDirectionValues","Prev","Next","onPageSizeChange","newPageSize","getPageNumberQuery","elliptizedPageArrayItemAsNumber","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;AACA,eAAe,kBAAkB,CAAC,kzEAAkzE;;;AC8Fp1E,MAAMA,QAAQ,GAAG,GAAG;;AAEpB;AACA;AACO,MAAMC,kBAAkB,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;AAEtC,MAAMC,SAAS,GAAGA,CAAC;EACxBC,KAAK;EACLC,OAAO;AACPC,EAAAA,KAAK,GAAG;AACM,CAAC,KAAuC;AACtD,EAAA,MAAMC,MAAM,GAAGH,KAAK,CAACG,MAAM;EAE3B,IAAIC,MAAM,GAAG,EAAE;AACf,EAAA,IAAIC,KAAK;AACT,EAAA,IAAIC,GAAG;EAEP,IAAIH,MAAM,IAAID,KAAK,EAAE;AACnB,IAAA,OAAOF,KAAK;AACd;AAEA,EAAA,IAAIC,OAAO,IAAIE,MAAM,GAAG,CAAC,EAAE;IACzBE,KAAK,GAAGE,IAAI,CAACC,IAAI,CAACN,KAAK,GAAG,CAAC,CAAC;IAC5BI,GA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,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,EAAAN,yBAAA,CAAA5D,MAAA,CAAA6D,SAAA,EAAA,cAAA,EAAA,CAoNPM,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAArE,MAAA,CAAA6D,SAAA,EAAA7D,cAAAA,CAAAA,EAAAA,MAAA,CAAA6D,SAAA,CAAA,EAAAD,yBAAA,CAAA5D,MAAA,CAAA6D,SAAA,uBA2BNM,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAArE,MAAA,CAAA6D,SAAA,EAAA,kBAAA,CAAA,EAAA7D,MAAA,CAAA6D,SAAA,GAAA7D,MAAA;AA1PiCsE,oBAAA,CAAAC,QAAA,EAArBxE,qBAAqB,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import { _ as _applyDecoratedDescriptor, a as _defineProperty } from '../../../../_rollupPluginBabelHelpers-KIi_qCIU.js';
1
+ import { _ as _applyDecoratedDescriptor, a as _defineProperty } from '../../../../_rollupPluginBabelHelpers-81503waH.js';
2
2
  import Component from '@glimmer/component';
3
3
  import { assert } from '@ember/debug';
4
4
  import { guidFor } from '@ember/object/internals';
@@ -6,13 +6,13 @@ import { action } from '@ember/object';
6
6
  import { precompileTemplate } from '@ember/template-compilation';
7
7
  import { setComponentTemplate } from '@ember/component';
8
8
 
9
- var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<div class=\"hds-pagination-size-selector\" ...attributes>\n <label class=\"hds-typography-body-100 hds-font-weight-medium\" for={{this.SizeSelectorId}}>\n {{this.label}}\n </label>\n <Hds::Form::Select::Base id={{this.SizeSelectorId}} {{on \"change\" this.onChange}} as |S|>\n <S.Options>\n {{#each this.pageSizes as |size|}}\n <option value={{size}} selected={{if (eq size this.selectedSize) true null}}>{{size}}</option>\n {{/each}}\n </S.Options>\n </Hds::Form::Select::Base>\n</div>");
9
+ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<div class=\"hds-pagination-size-selector\" ...attributes>\n <label class=\"hds-typography-body-100 hds-font-weight-medium\" for={{this._sizeSelectorId}}>\n {{this.label}}\n </label>\n <Hds::Form::Select::Base id={{this._sizeSelectorId}} {{on \"change\" this.onChange}} as |S|>\n <S.Options>\n {{#each this.pageSizes as |size|}}\n <option value={{size}} selected={{if (eq size this.selectedSize) true null}}>{{size}}</option>\n {{/each}}\n </S.Options>\n </Hds::Form::Select::Base>\n</div>");
10
10
 
11
11
  var _class;
12
12
  let HdsPaginationSizeSelector = (_class = class HdsPaginationSizeSelector extends Component {
13
13
  constructor(...args) {
14
14
  super(...args);
15
- _defineProperty(this, "SizeSelectorId", 'pagination-size-selector-' + guidFor(this));
15
+ _defineProperty(this, "_sizeSelectorId", 'pagination-size-selector-' + guidFor(this));
16
16
  }
17
17
  get pageSizes() {
18
18
  const {
@@ -43,7 +43,7 @@ let HdsPaginationSizeSelector = (_class = class HdsPaginationSizeSelector extend
43
43
  onChange(parseInt(target.value));
44
44
  }
45
45
  }
46
- }, (_applyDecoratedDescriptor(_class.prototype, "onChange", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onChange"), _class.prototype)), _class);
46
+ }, _applyDecoratedDescriptor(_class.prototype, "onChange", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onChange"), _class.prototype), _class);
47
47
  setComponentTemplate(TEMPLATE, HdsPaginationSizeSelector);
48
48
 
49
49
  export { HdsPaginationSizeSelector as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/pagination/size-selector/index.hbs","../../../../../src/components/hds/pagination/size-selector/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class=\\\"hds-pagination-size-selector\\\" ...attributes>\\n <label class=\\\"hds-typography-body-100 hds-font-weight-medium\\\" for={{this.SizeSelectorId}}>\\n {{this.label}}\\n </label>\\n <Hds::Form::Select::Base id={{this.SizeSelectorId}} {{on \\\"change\\\" this.onChange}} as |S|>\\n <S.Options>\\n {{#each this.pageSizes as |size|}}\\n <option value={{size}} selected={{if (eq size this.selectedSize) true null}}>{{size}}</option>\\n {{/each}}\\n </S.Options>\\n </Hds::Form::Select::Base>\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { guidFor } from '@ember/object/internals';\nimport { action } from '@ember/object';\n\nimport type { HdsFormSelectBaseSignature } from '../../form/select/base';\n\nexport interface HdsPaginationSizeSelectorSignature {\n Args: {\n pageSizes: number[];\n label?: string;\n selectedSize?: number;\n onChange?: (size: number) => void;\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsPaginationSizeSelector extends Component<HdsPaginationSizeSelectorSignature> {\n SizeSelectorId = 'pagination-size-selector-' + guidFor(this);\n\n get pageSizes(): number[] {\n const { pageSizes } = this.args;\n\n assert(\n '@pageSizes for \"Pagination::SizeSelector\" must be defined',\n pageSizes !== undefined\n );\n\n return pageSizes;\n }\n\n get selectedSize(): number | undefined {\n const { selectedSize } = this.args;\n\n assert(\n `@selectedSize for \"Pagination::SizeSelector\" must one of the @pageSizes provided (${this.pageSizes.join(\n ','\n )}), received ${selectedSize}`,\n selectedSize === undefined || this.pageSizes.includes(selectedSize)\n );\n\n return selectedSize;\n }\n\n get label(): string {\n const { label = 'Items per page' } = this.args;\n\n return label;\n }\n\n @action\n onChange(e: Event): void {\n const { onChange } = this.args;\n\n const target = e.target as HdsFormSelectBaseSignature['Element'];\n\n if (typeof onChange === 'function') {\n onChange(parseInt(target.value));\n }\n }\n}\n"],"names":["HdsPaginationSizeSelector","_class","Component","constructor","args","_defineProperty","guidFor","pageSizes","assert","undefined","selectedSize","join","includes","label","onChange","e","target","parseInt","value","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AACA,eAAe,kBAAkB,CAAC,qlBAAqlB;;;ACqBlmBA,IAAAA,yBAAyB,IAAAC,MAAA,GAA/B,MAAMD,yBAAyB,SAASE,SAAS,CAAqC;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,yBAClF,2BAA2B,GAAGC,OAAO,CAAC,IAAI,CAAC,CAAA,CAAA;AAAA,GAAA;EAE5D,IAAIC,SAASA,GAAa;IACxB,MAAM;AAAEA,MAAAA,SAAAA;KAAW,GAAG,IAAI,CAACH,IAAI,CAAA;AAE/BI,IAAAA,MAAM,CACJ,2DAA2D,EAC3DD,SAAS,KAAKE,SAChB,CAAC,CAAA;AAED,IAAA,OAAOF,SAAS,CAAA;AAClB,GAAA;EAEA,IAAIG,YAAYA,GAAuB;IACrC,MAAM;AAAEA,MAAAA,YAAAA;KAAc,GAAG,IAAI,CAACN,IAAI,CAAA;IAElCI,MAAM,CACJ,CAAqF,kFAAA,EAAA,IAAI,CAACD,SAAS,CAACI,IAAI,CACtG,GACF,CAAC,CAAA,YAAA,EAAeD,YAAY,CAAA,CAAE,EAC9BA,YAAY,KAAKD,SAAS,IAAI,IAAI,CAACF,SAAS,CAACK,QAAQ,CAACF,YAAY,CACpE,CAAC,CAAA;AAED,IAAA,OAAOA,YAAY,CAAA;AACrB,GAAA;EAEA,IAAIG,KAAKA,GAAW;IAClB,MAAM;AAAEA,MAAAA,KAAK,GAAG,gBAAA;KAAkB,GAAG,IAAI,CAACT,IAAI,CAAA;AAE9C,IAAA,OAAOS,KAAK,CAAA;AACd,GAAA;EAGAC,QAAQA,CAACC,CAAQ,EAAQ;IACvB,MAAM;AAAED,MAAAA,QAAAA;KAAU,GAAG,IAAI,CAACV,IAAI,CAAA;AAE9B,IAAA,MAAMY,MAAM,GAAGD,CAAC,CAACC,MAA+C,CAAA;AAEhE,IAAA,IAAI,OAAOF,QAAQ,KAAK,UAAU,EAAE;AAClCA,MAAAA,QAAQ,CAACG,QAAQ,CAACD,MAAM,CAACE,KAAK,CAAC,CAAC,CAAA;AAClC,KAAA;AACF,GAAA;AACF,CAAC,GAAAC,yBAAA,CAAAlB,MAAA,CAAAmB,SAAA,EAAA,UAAA,EAAA,CAVEC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAtB,MAAA,CAAAmB,SAAA,eAAAnB,MAAA,CAAAmB,SAAA,CAAA,GAAAnB,MAAA,EAAA;AAjCqCuB,oBAAA,CAAAC,QAAA,EAAzBzB,yBAAyB,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/pagination/size-selector/index.hbs","../../../../../src/components/hds/pagination/size-selector/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class=\\\"hds-pagination-size-selector\\\" ...attributes>\\n <label class=\\\"hds-typography-body-100 hds-font-weight-medium\\\" for={{this._sizeSelectorId}}>\\n {{this.label}}\\n </label>\\n <Hds::Form::Select::Base id={{this._sizeSelectorId}} {{on \\\"change\\\" this.onChange}} as |S|>\\n <S.Options>\\n {{#each this.pageSizes as |size|}}\\n <option value={{size}} selected={{if (eq size this.selectedSize) true null}}>{{size}}</option>\\n {{/each}}\\n </S.Options>\\n </Hds::Form::Select::Base>\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { guidFor } from '@ember/object/internals';\nimport { action } from '@ember/object';\n\nimport type { HdsFormSelectBaseSignature } from '../../form/select/base';\n\nexport interface HdsPaginationSizeSelectorSignature {\n Args: {\n pageSizes: number[];\n label?: string;\n selectedSize?: number;\n onChange?: (size: number) => void;\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsPaginationSizeSelector extends Component<HdsPaginationSizeSelectorSignature> {\n private _sizeSelectorId = 'pagination-size-selector-' + guidFor(this);\n\n get pageSizes(): number[] {\n const { pageSizes } = this.args;\n\n assert(\n '@pageSizes for \"Pagination::SizeSelector\" must be defined',\n pageSizes !== undefined\n );\n\n return pageSizes;\n }\n\n get selectedSize(): number | undefined {\n const { selectedSize } = this.args;\n\n assert(\n `@selectedSize for \"Pagination::SizeSelector\" must one of the @pageSizes provided (${this.pageSizes.join(\n ','\n )}), received ${selectedSize}`,\n selectedSize === undefined || this.pageSizes.includes(selectedSize)\n );\n\n return selectedSize;\n }\n\n get label(): string {\n const { label = 'Items per page' } = this.args;\n\n return label;\n }\n\n @action\n onChange(e: Event): void {\n const { onChange } = this.args;\n\n const target = e.target as HdsFormSelectBaseSignature['Element'];\n\n if (typeof onChange === 'function') {\n onChange(parseInt(target.value));\n }\n }\n}\n"],"names":["HdsPaginationSizeSelector","_class","Component","constructor","args","_defineProperty","guidFor","pageSizes","assert","undefined","selectedSize","join","includes","label","onChange","e","target","parseInt","value","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AACA,eAAe,kBAAkB,CAAC,ulBAAulB;;;ACqBpmBA,IAAAA,yBAAyB,IAAAC,MAAA,GAA/B,MAAMD,yBAAyB,SAASE,SAAS,CAAqC;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA;AAAAC,IAAAA,eAAA,0BACzE,2BAA2B,GAAGC,OAAO,CAAC,IAAI,CAAC,CAAA;AAAA;EAErE,IAAIC,SAASA,GAAa;IACxB,MAAM;AAAEA,MAAAA;KAAW,GAAG,IAAI,CAACH,IAAI;AAE/BI,IAAAA,MAAM,CACJ,2DAA2D,EAC3DD,SAAS,KAAKE,SAChB,CAAC;AAED,IAAA,OAAOF,SAAS;AAClB;EAEA,IAAIG,YAAYA,GAAuB;IACrC,MAAM;AAAEA,MAAAA;KAAc,GAAG,IAAI,CAACN,IAAI;IAElCI,MAAM,CACJ,CAAqF,kFAAA,EAAA,IAAI,CAACD,SAAS,CAACI,IAAI,CACtG,GACF,CAAC,CAAA,YAAA,EAAeD,YAAY,CAAA,CAAE,EAC9BA,YAAY,KAAKD,SAAS,IAAI,IAAI,CAACF,SAAS,CAACK,QAAQ,CAACF,YAAY,CACpE,CAAC;AAED,IAAA,OAAOA,YAAY;AACrB;EAEA,IAAIG,KAAKA,GAAW;IAClB,MAAM;AAAEA,MAAAA,KAAK,GAAG;KAAkB,GAAG,IAAI,CAACT,IAAI;AAE9C,IAAA,OAAOS,KAAK;AACd;EAGAC,QAAQA,CAACC,CAAQ,EAAQ;IACvB,MAAM;AAAED,MAAAA;KAAU,GAAG,IAAI,CAACV,IAAI;AAE9B,IAAA,MAAMY,MAAM,GAAGD,CAAC,CAACC,MAA+C;AAEhE,IAAA,IAAI,OAAOF,QAAQ,KAAK,UAAU,EAAE;AAClCA,MAAAA,QAAQ,CAACG,QAAQ,CAACD,MAAM,CAACE,KAAK,CAAC,CAAC;AAClC;AACF;AACF,CAAC,EAAAC,yBAAA,CAAAlB,MAAA,CAAAmB,SAAA,EAAA,UAAA,EAAA,CAVEC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAtB,MAAA,CAAAmB,SAAA,eAAAnB,MAAA,CAAAmB,SAAA,CAAA,EAAAnB,MAAA;AAjCqCuB,oBAAA,CAAAC,QAAA,EAAzBzB,yBAAyB,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../src/components/hds/pagination/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport type { HdsInteractiveSignature } from '../interactive';\n\nexport enum HdsPaginationDirectionValues {\n Next = 'next',\n Prev = 'prev',\n}\n\nexport type HdsPaginationDirections = `${HdsPaginationDirectionValues}`;\n\nexport type HdsPaginationPage = HdsPaginationDirections | number;\n\nexport enum HdsPaginationDirectionAriaLabelValues {\n Prev = 'Previous page',\n Next = 'Next page',\n}\n\nexport type HdsPaginationDirectionAriaLabels =\n `${HdsPaginationDirectionAriaLabelValues}`;\n\nexport enum HdsPaginationDirectionLabelValues {\n Prev = 'Previous',\n Next = 'Next',\n}\n\nexport type HdsPaginationDirectionLabels =\n `${HdsPaginationDirectionLabelValues}`;\n\nexport type HdsPaginationElliptizedPageArrayItem = string | number;\n\nexport type HdsPaginationElliptizedPageArray =\n HdsPaginationElliptizedPageArrayItem[];\n\nexport type HdsPaginationRoutingProps = Pick<\n HdsInteractiveSignature['Args'],\n 'route' | 'model' | 'models' | 'replace'\n>;\n"],"names":["HdsPaginationDirectionValues","HdsPaginationDirectionAriaLabelValues","HdsPaginationDirectionLabelValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAIYA,IAAAA,4BAA4B,0BAA5BA,4BAA4B,EAAA;EAA5BA,4BAA4B,CAAA,MAAA,CAAA,GAAA,MAAA,CAAA;EAA5BA,4BAA4B,CAAA,MAAA,CAAA,GAAA,MAAA,CAAA;AAAA,EAAA,OAA5BA,4BAA4B,CAAA;AAAA,CAAA,CAAA,EAAA,EAAA;AAS5BC,IAAAA,qCAAqC,0BAArCA,qCAAqC,EAAA;EAArCA,qCAAqC,CAAA,MAAA,CAAA,GAAA,eAAA,CAAA;EAArCA,qCAAqC,CAAA,MAAA,CAAA,GAAA,WAAA,CAAA;AAAA,EAAA,OAArCA,qCAAqC,CAAA;AAAA,CAAA,CAAA,EAAA,EAAA;AAQrCC,IAAAA,iCAAiC,0BAAjCA,iCAAiC,EAAA;EAAjCA,iCAAiC,CAAA,MAAA,CAAA,GAAA,UAAA,CAAA;EAAjCA,iCAAiC,CAAA,MAAA,CAAA,GAAA,MAAA,CAAA;AAAA,EAAA,OAAjCA,iCAAiC,CAAA;AAAA,CAAA,CAAA,EAAA;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../../src/components/hds/pagination/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport type { HdsInteractiveSignature } from '../interactive';\n\nexport enum HdsPaginationDirectionValues {\n Next = 'next',\n Prev = 'prev',\n}\n\nexport type HdsPaginationDirections = `${HdsPaginationDirectionValues}`;\n\nexport type HdsPaginationPage = HdsPaginationDirections | number;\n\nexport enum HdsPaginationDirectionAriaLabelValues {\n Prev = 'Previous page',\n Next = 'Next page',\n}\n\nexport type HdsPaginationDirectionAriaLabels =\n `${HdsPaginationDirectionAriaLabelValues}`;\n\nexport enum HdsPaginationDirectionLabelValues {\n Prev = 'Previous',\n Next = 'Next',\n}\n\nexport type HdsPaginationDirectionLabels =\n `${HdsPaginationDirectionLabelValues}`;\n\nexport type HdsPaginationElliptizedPageArrayItem = string | number;\n\nexport type HdsPaginationElliptizedPageArray =\n HdsPaginationElliptizedPageArrayItem[];\n\nexport type HdsPaginationRoutingProps = Pick<\n HdsInteractiveSignature['Args'],\n 'route' | 'model' | 'models' | 'replace'\n>;\n"],"names":["HdsPaginationDirectionValues","HdsPaginationDirectionAriaLabelValues","HdsPaginationDirectionLabelValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAIYA,IAAAA,4BAA4B,0BAA5BA,4BAA4B,EAAA;EAA5BA,4BAA4B,CAAA,MAAA,CAAA,GAAA,MAAA;EAA5BA,4BAA4B,CAAA,MAAA,CAAA,GAAA,MAAA;AAAA,EAAA,OAA5BA,4BAA4B;AAAA,CAAA,CAAA,EAAA;AAS5BC,IAAAA,qCAAqC,0BAArCA,qCAAqC,EAAA;EAArCA,qCAAqC,CAAA,MAAA,CAAA,GAAA,eAAA;EAArCA,qCAAqC,CAAA,MAAA,CAAA,GAAA,WAAA;AAAA,EAAA,OAArCA,qCAAqC;AAAA,CAAA,CAAA,EAAA;AAQrCC,IAAAA,iCAAiC,0BAAjCA,iCAAiC,EAAA;EAAjCA,iCAAiC,CAAA,MAAA,CAAA,GAAA,UAAA;EAAjCA,iCAAiC,CAAA,MAAA,CAAA,GAAA,MAAA;AAAA,EAAA,OAAjCA,iCAAiC;AAAA,CAAA,CAAA,EAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import { _ as _applyDecoratedDescriptor, b as _initializerDefineProperty, a as _defineProperty } from '../../../_rollupPluginBabelHelpers-KIi_qCIU.js';
1
+ import { _ as _applyDecoratedDescriptor, b as _initializerDefineProperty, a as _defineProperty } from '../../../_rollupPluginBabelHelpers-81503waH.js';
2
2
  import Component from '@glimmer/component';
3
3
  import { tracked } from '@glimmer/tracking';
4
4
  import { action } from '@ember/object';
@@ -11,59 +11,59 @@ import anchoredPositionModifier from '../../../modifiers/hds-anchored-position.j
11
11
  import { precompileTemplate } from '@ember/template-compilation';
12
12
  import { setComponentTemplate } from '@ember/component';
13
13
 
14
- var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n{{yield\n (hash\n setupPrimitiveContainer=this.setupPrimitiveContainer\n setupPrimitiveToggle=this.setupPrimitiveToggle\n setupPrimitivePopover=this.setupPrimitivePopover\n toggleElement=this.toggleElement\n popoverElement=this.popoverElement\n isOpen=this.isOpen\n showPopover=this.showPopover\n hidePopover=this.hidePopover\n togglePopover=this.togglePopover\n )\n}}");
14
+ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n{{yield\n (hash\n setupPrimitiveContainer=this.setupPrimitiveContainer\n setupPrimitiveToggle=this.setupPrimitiveToggle\n setupPrimitivePopover=this.setupPrimitivePopover\n toggleElement=this._toggleElement\n popoverElement=this._popoverElement\n isOpen=this._isOpen\n showPopover=this.showPopover\n hidePopover=this.hidePopover\n togglePopover=this.togglePopover\n )\n}}");
15
15
 
16
16
  var _class, _descriptor, _descriptor2;
17
17
  let HdsPopoverPrimitive = (_class = class HdsPopoverPrimitive extends Component {
18
- constructor(...args) {
19
- super(...args);
20
- _initializerDefineProperty(this, "isOpen", _descriptor, this);
21
- _initializerDefineProperty(this, "isClosing", _descriptor2, this);
22
- _defineProperty(this, "containerElement", void 0);
23
- _defineProperty(this, "toggleElement", void 0);
24
- _defineProperty(this, "popoverElement", void 0);
18
+ constructor(owner, args) {
19
+ super(owner, args);
20
+ _initializerDefineProperty(this, "_isOpen", _descriptor, this);
21
+ _initializerDefineProperty(this, "_isClosing", _descriptor2, this);
22
+ _defineProperty(this, "_containerElement", void 0);
23
+ _defineProperty(this, "_toggleElement", void 0);
24
+ _defineProperty(this, "_popoverElement", void 0);
25
25
  // this will enable "soft" events for the toggle ("hover" and "focus")
26
26
  _defineProperty(this, "enableSoftEvents", this.args.enableSoftEvents ?? false);
27
27
  // this will enable "click" events for the toggle
28
28
  _defineProperty(this, "enableClickEvents", this.args.enableClickEvents ?? false);
29
- _defineProperty(this, "timer", void 0);
29
+ _defineProperty(this, "_timer", void 0);
30
30
  _defineProperty(this, "setupPrimitiveContainer", modifier(element => {
31
- this.containerElement = element;
31
+ this._containerElement = element;
32
32
 
33
33
  // we register the "soft" events
34
34
  if (this.enableSoftEvents) {
35
35
  // @ts-expect-error: known issue with type of invocation
36
- registerEvent(this.containerElement, ['mouseenter', this.onMouseEnter]);
36
+ registerEvent(this._containerElement, ['mouseenter', this.onMouseEnter]);
37
37
  // @ts-expect-error: known issue with type of invocation
38
- registerEvent(this.containerElement, ['mouseleave', this.onMouseLeave]);
38
+ registerEvent(this._containerElement, ['mouseleave', this.onMouseLeave]);
39
39
  // @ts-expect-error: known issue with type of invocation
40
- registerEvent(this.containerElement, ['focusin', this.onFocusIn]);
40
+ registerEvent(this._containerElement, ['focusin', this.onFocusIn]);
41
41
  }
42
42
  // we always want the focusOut event
43
43
  // @ts-expect-error: known issue with type of invocation
44
- registerEvent(this.containerElement, ['focusout', this.onFocusOut]);
44
+ registerEvent(this._containerElement, ['focusout', this.onFocusOut]);
45
45
  }));
46
46
  _defineProperty(this, "setupPrimitiveToggle", modifier(element => {
47
- this.toggleElement = element;
47
+ this._toggleElement = element;
48
48
  assert(`The toggle element of "Hds::PopoverPrimitive" must be a <button>; element received: <${element.tagName.toLowerCase()}>`, element instanceof HTMLButtonElement);
49
49
  }));
50
50
  _defineProperty(this, "setupPrimitivePopover", modifier((element, _positional, named) => {
51
- this.popoverElement = element;
51
+ this._popoverElement = element;
52
52
 
53
53
  // for the click events we don't use `onclick` event listeners, but we rely on the `popovertarget` attribute
54
54
  // provided by the Popover API which does all the magic for us without needing JS code
55
55
  // (important: to work it needs to be applied to a button)
56
56
  if (this.enableClickEvents) {
57
57
  let popoverId;
58
- if (this.popoverElement.id) {
59
- popoverId = this.popoverElement.id;
58
+ if (this._popoverElement.id) {
59
+ popoverId = this._popoverElement.id;
60
60
  } else {
61
61
  // we need a DOM id for the `popovertarget` attribute
62
62
  popoverId = guidFor(this);
63
- this.popoverElement.id = popoverId;
63
+ this._popoverElement.id = popoverId;
64
64
  }
65
- if (this.toggleElement) {
66
- this.toggleElement.setAttribute('popovertarget', popoverId);
65
+ if (this._toggleElement) {
66
+ this._toggleElement.setAttribute('popovertarget', popoverId);
67
67
  }
68
68
  }
69
69
 
@@ -71,17 +71,17 @@ let HdsPopoverPrimitive = (_class = class HdsPopoverPrimitive extends Component
71
71
  // we need to use the "manual" state to support the case of multiple "menus" opened at the same time
72
72
  // IMPORTANT! if a "popover" is set to "open" with a "manual" state, then it can't be closed via `esc` and `click outside`
73
73
  if (this.args.isOpen) {
74
- this.popoverElement.popover = 'manual';
75
- this.popoverElement.showPopover();
74
+ this._popoverElement.popover = 'manual';
75
+ this._popoverElement.showPopover();
76
76
  } else {
77
- this.popoverElement.popover = 'auto';
77
+ this._popoverElement.popover = 'auto';
78
78
  }
79
79
 
80
80
  // Register "onBeforeToggle" + "onToggle" callback functions to be called when a native 'toggle' event is dispatched
81
81
  // @ts-expect-error: known issue with type of invocation
82
- registerEvent(this.popoverElement, ['beforetoggle', this.onBeforeTogglePopover]);
82
+ registerEvent(this._popoverElement, ['beforetoggle', this.onBeforeTogglePopover]);
83
83
  // @ts-expect-error: known issue with type of invocation
84
- registerEvent(this.popoverElement, ['toggle', this.onTogglePopover]);
84
+ registerEvent(this._popoverElement, ['toggle', this.onTogglePopover]);
85
85
 
86
86
  // we need to spread the argument because if it's set via `{{ hash … }}` Ember complains when we overwrite one of its values
87
87
  const anchoredPositionOptions = {
@@ -97,19 +97,20 @@ let HdsPopoverPrimitive = (_class = class HdsPopoverPrimitive extends Component
97
97
  // eslint-disable-next-line ember/no-runloop
98
98
  next(() => {
99
99
  // @ts-expect-error: known issue with type of invocation
100
- anchoredPositionModifier(this.popoverElement,
100
+ anchoredPositionModifier(this._popoverElement,
101
101
  // element the modifier is attached to
102
- [this.toggleElement],
102
+ [this._toggleElement],
103
103
  // positional arguments
104
104
  anchoredPositionOptions // named arguments
105
105
  );
106
106
  });
107
107
  }));
108
+ this._isOpen = this.args.isOpen ?? false;
108
109
  }
109
110
  showPopover() {
110
111
  try {
111
- if (this.popoverElement) {
112
- this.popoverElement.showPopover();
112
+ if (this._popoverElement) {
113
+ this._popoverElement.showPopover();
113
114
  }
114
115
  } catch (error) {
115
116
  warn(`The invocation of \`showPopover\` for the popover element caused an unexpected error: ${JSON.stringify(error)}`, {
@@ -119,8 +120,8 @@ let HdsPopoverPrimitive = (_class = class HdsPopoverPrimitive extends Component
119
120
  }
120
121
  hidePopover() {
121
122
  try {
122
- if (this.popoverElement) {
123
- this.popoverElement.hidePopover();
123
+ if (this._popoverElement) {
124
+ this._popoverElement.hidePopover();
124
125
  }
125
126
  } catch (error) {
126
127
  warn(`The invocation of \`hidePopover\` for the popover element caused an unexpected error: ${JSON.stringify(error)}`, {
@@ -130,8 +131,8 @@ let HdsPopoverPrimitive = (_class = class HdsPopoverPrimitive extends Component
130
131
  }
131
132
  togglePopover() {
132
133
  try {
133
- if (this.popoverElement) {
134
- this.popoverElement.togglePopover();
134
+ if (this._popoverElement) {
135
+ this._popoverElement.togglePopover();
135
136
  }
136
137
  } catch (error) {
137
138
  warn(`The invocation of \`togglePopover\` for the popover element caused an unexpected error: ${JSON.stringify(error)}`, {
@@ -146,14 +147,14 @@ let HdsPopoverPrimitive = (_class = class HdsPopoverPrimitive extends Component
146
147
  // we need this flag to check if it's in the "closing" process,
147
148
  // because the browser automatically returns the focus to the "trigger" button
148
149
  // and this would re-open immediately the popover because of the `focusin` event
149
- this.isClosing = true;
150
+ this._isClosing = true;
150
151
  }
151
152
  }
152
153
 
153
154
  // fired just _after_ the "popover" is shown or hidden
154
155
  onTogglePopover(event) {
155
156
  if (event.newState === 'open') {
156
- this.isOpen = true;
157
+ this._isOpen = true;
157
158
 
158
159
  // we call the "onOpen" callback if it exists (and is a function)
159
160
  const {
@@ -163,15 +164,15 @@ let HdsPopoverPrimitive = (_class = class HdsPopoverPrimitive extends Component
163
164
  onOpen();
164
165
  }
165
166
  } else {
166
- this.isOpen = false;
167
+ this._isOpen = false;
167
168
 
168
169
  // reset the "isClosing" flag (the `toggle` event is fired _after_ the popover is closed)
169
- this.isClosing = false;
170
+ this._isClosing = false;
170
171
 
171
172
  // if the popover was initially forced to be open (using the "manual" state) then revert its status to `auto` once the user interacts with it
172
173
  if (this.args.isOpen) {
173
- if (this.popoverElement) {
174
- this.popoverElement.popover = 'auto';
174
+ if (this._popoverElement) {
175
+ this._popoverElement.popover = 'auto';
175
176
  }
176
177
  }
177
178
 
@@ -185,33 +186,33 @@ let HdsPopoverPrimitive = (_class = class HdsPopoverPrimitive extends Component
185
186
  }
186
187
  }
187
188
  onMouseEnter() {
188
- if (this.timer) {
189
- clearTimeout(this.timer);
189
+ if (this._timer) {
190
+ clearTimeout(this._timer);
190
191
  }
191
192
  this.showPopover();
192
193
  }
193
194
  onFocusIn() {
194
195
  // don't re-open the popover if the focus is returned because the closing
195
- if (!this.isClosing) {
196
- if (this.timer) {
197
- clearTimeout(this.timer);
196
+ if (!this._isClosing) {
197
+ if (this._timer) {
198
+ clearTimeout(this._timer);
198
199
  }
199
200
  this.showPopover();
200
201
  }
201
202
  }
202
203
  onMouseLeave() {
203
- this.timer = setTimeout(() => this.hidePopover(), 500);
204
+ this._timer = setTimeout(() => this.hidePopover(), 500);
204
205
  }
205
206
  onFocusOut(event) {
206
- if (this.containerElement) {
207
+ if (this._containerElement) {
207
208
  let isFocusStillInside = false;
208
209
  if (event.relatedTarget &&
209
210
  // if the related target is not part of the disclosed content we close the disclosed container
210
- this.containerElement.contains(event.relatedTarget)) {
211
+ this._containerElement.contains(event.relatedTarget)) {
211
212
  isFocusStillInside = true;
212
213
  } else if (document.activeElement &&
213
214
  // due to inconsistent implementation of relatedTarget across browsers we use the activeElement as a fallback
214
- this.containerElement.contains(document.activeElement)) {
215
+ this._containerElement.contains(document.activeElement)) {
215
216
  isFocusStillInside = true;
216
217
  }
217
218
  // if the target receiving the focus is _not_ part of the disclosed content we close the disclosed container
@@ -220,21 +221,19 @@ let HdsPopoverPrimitive = (_class = class HdsPopoverPrimitive extends Component
220
221
  }
221
222
  }
222
223
  }
223
- }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "isOpen", [tracked], {
224
+ }, _descriptor = _applyDecoratedDescriptor(_class.prototype, "_isOpen", [tracked], {
224
225
  configurable: true,
225
226
  enumerable: true,
226
227
  writable: true,
227
- initializer: function () {
228
- return this.args.isOpen ?? false;
229
- }
230
- }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "isClosing", [tracked], {
228
+ initializer: null
229
+ }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "_isClosing", [tracked], {
231
230
  configurable: true,
232
231
  enumerable: true,
233
232
  writable: true,
234
233
  initializer: function () {
235
234
  return false;
236
235
  }
237
- }), _applyDecoratedDescriptor(_class.prototype, "showPopover", [action], Object.getOwnPropertyDescriptor(_class.prototype, "showPopover"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "hidePopover", [action], Object.getOwnPropertyDescriptor(_class.prototype, "hidePopover"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "togglePopover", [action], Object.getOwnPropertyDescriptor(_class.prototype, "togglePopover"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onBeforeTogglePopover", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onBeforeTogglePopover"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onTogglePopover", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onTogglePopover"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onMouseEnter", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onMouseEnter"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onFocusIn", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onFocusIn"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onMouseLeave", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onMouseLeave"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onFocusOut", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onFocusOut"), _class.prototype)), _class);
236
+ }), _applyDecoratedDescriptor(_class.prototype, "showPopover", [action], Object.getOwnPropertyDescriptor(_class.prototype, "showPopover"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "hidePopover", [action], Object.getOwnPropertyDescriptor(_class.prototype, "hidePopover"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "togglePopover", [action], Object.getOwnPropertyDescriptor(_class.prototype, "togglePopover"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onBeforeTogglePopover", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onBeforeTogglePopover"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onTogglePopover", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onTogglePopover"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onMouseEnter", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onMouseEnter"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onFocusIn", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onFocusIn"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onMouseLeave", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onMouseLeave"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onFocusOut", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onFocusOut"), _class.prototype), _class);
238
237
  setComponentTemplate(TEMPLATE, HdsPopoverPrimitive);
239
238
 
240
239
  export { HdsPopoverPrimitive as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/hds/popover-primitive/index.hbs","../../../../src/components/hds/popover-primitive/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{yield\\n (hash\\n setupPrimitiveContainer=this.setupPrimitiveContainer\\n setupPrimitiveToggle=this.setupPrimitiveToggle\\n setupPrimitivePopover=this.setupPrimitivePopover\\n toggleElement=this.toggleElement\\n popoverElement=this.popoverElement\\n isOpen=this.isOpen\\n showPopover=this.showPopover\\n hidePopover=this.hidePopover\\n togglePopover=this.togglePopover\\n )\\n}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert, warn } from '@ember/debug';\nimport { next } from '@ember/runloop';\nimport { guidFor } from '@ember/object/internals';\nimport { modifier } from 'ember-modifier';\n\nimport registerEvent from '../../../modifiers/hds-register-event.ts';\nimport anchoredPositionModifier from '../../../modifiers/hds-anchored-position.ts';\n\nimport type { FloatingUIOptions } from '../../../modifiers/hds-anchored-position.ts';\nimport type { ModifierLike } from '@glint/template';\n\nexport interface HdsPopoverPrimitiveSignature {\n Args: {\n isOpen?: boolean;\n enableSoftEvents?: boolean;\n enableClickEvents?: boolean;\n onOpen?: () => void;\n onClose?: () => void;\n };\n Blocks: {\n default: [\n {\n setupPrimitiveContainer: ModifierLike<SetupPrimitiveContainerModifier>;\n setupPrimitiveToggle: ModifierLike<SetupPrimitiveToggleModifier>;\n setupPrimitivePopover: ModifierLike<SetupPrimitivePopoverModifier>;\n toggleElement?: HTMLButtonElement;\n popoverElement?: HTMLElement;\n isOpen: boolean;\n showPopover: () => void;\n hidePopover: () => void;\n togglePopover: () => void;\n },\n ];\n };\n}\n\ninterface SetupPrimitiveContainerModifier {\n Element: HTMLElement;\n}\n\nexport interface SetupPrimitiveToggleModifier {\n Element: HTMLButtonElement;\n}\n\nexport interface SetupPrimitivePopoverModifier {\n Element: HTMLElement;\n Args: {\n Positional: [];\n Named: { anchoredPositionOptions: FloatingUIOptions };\n };\n}\n\nexport default class HdsPopoverPrimitive extends Component<HdsPopoverPrimitiveSignature> {\n @tracked isOpen = this.args.isOpen ?? false;\n @tracked isClosing = false;\n containerElement?: HTMLElement;\n toggleElement?: HTMLButtonElement;\n popoverElement?: HTMLElement;\n // this will enable \"soft\" events for the toggle (\"hover\" and \"focus\")\n enableSoftEvents = this.args.enableSoftEvents ?? false;\n // this will enable \"click\" events for the toggle\n enableClickEvents = this.args.enableClickEvents ?? false;\n timer?: ReturnType<typeof setTimeout> | null;\n\n setupPrimitiveContainer = modifier<SetupPrimitiveContainerModifier>(\n (element: HTMLElement): void => {\n this.containerElement = element;\n\n // we register the \"soft\" events\n if (this.enableSoftEvents) {\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this.containerElement, ['mouseenter', this.onMouseEnter]);\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this.containerElement, ['mouseleave', this.onMouseLeave]);\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this.containerElement, ['focusin', this.onFocusIn]);\n }\n // we always want the focusOut event\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this.containerElement, ['focusout', this.onFocusOut]);\n }\n );\n\n setupPrimitiveToggle = modifier<SetupPrimitiveToggleModifier>(\n (element: HTMLButtonElement): void => {\n this.toggleElement = element;\n\n assert(\n `The toggle element of \"Hds::PopoverPrimitive\" must be a <button>; element received: <${element.tagName.toLowerCase()}>`,\n element instanceof HTMLButtonElement\n );\n }\n );\n\n setupPrimitivePopover = modifier(\n (\n element: HTMLElement,\n _positional,\n named: { anchoredPositionOptions: FloatingUIOptions }\n ): void => {\n this.popoverElement = element;\n\n // for the click events we don't use `onclick` event listeners, but we rely on the `popovertarget` attribute\n // provided by the Popover API which does all the magic for us without needing JS code\n // (important: to work it needs to be applied to a button)\n if (this.enableClickEvents) {\n let popoverId;\n if (this.popoverElement.id) {\n popoverId = this.popoverElement.id;\n } else {\n // we need a DOM id for the `popovertarget` attribute\n popoverId = guidFor(this);\n this.popoverElement.id = popoverId;\n }\n if (this.toggleElement) {\n this.toggleElement.setAttribute('popovertarget', popoverId);\n }\n }\n\n // this should be an extremely edge case, but in the case the popover needs to be initially forced to be open\n // we need to use the \"manual\" state to support the case of multiple \"menus\" opened at the same time\n // IMPORTANT! if a \"popover\" is set to \"open\" with a \"manual\" state, then it can't be closed via `esc` and `click outside`\n if (this.args.isOpen) {\n this.popoverElement.popover = 'manual';\n this.popoverElement.showPopover();\n } else {\n this.popoverElement.popover = 'auto';\n }\n\n // Register \"onBeforeToggle\" + \"onToggle\" callback functions to be called when a native 'toggle' event is dispatched\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this.popoverElement, [\n 'beforetoggle',\n this.onBeforeTogglePopover,\n ]);\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this.popoverElement, ['toggle', this.onTogglePopover]);\n\n // we need to spread the argument because if it's set via `{{ hash … }}` Ember complains when we overwrite one of its values\n const anchoredPositionOptions: FloatingUIOptions = {\n ...named.anchoredPositionOptions,\n };\n\n // Apply the `hds-anchored-position` modifier to the \"popover\" element\n // (notice: this function runs the first time when the element the modifier was applied to is inserted into the DOM, and it autotracks while running.\n // Any tracked values that it accesses will be tracked, including the arguments it receives, and if any of them changes, the function will run again)\n // This modifiers uses the Floating UI library to provide:\n // - positioning of the \"popover\" in relation to the \"toggle\"\n // - collision detection (optional)\n // eslint-disable-next-line ember/no-runloop\n next((): void => {\n // @ts-expect-error: known issue with type of invocation\n anchoredPositionModifier(\n this.popoverElement, // element the modifier is attached to\n [this.toggleElement], // positional arguments\n anchoredPositionOptions // named arguments\n );\n });\n }\n );\n\n @action\n showPopover(): void {\n try {\n if (this.popoverElement) {\n this.popoverElement.showPopover();\n }\n } catch (error) {\n warn(\n `The invocation of \\`showPopover\\` for the popover element caused an unexpected error: ${JSON.stringify(\n error\n )}`,\n {\n id: 'hds-popover.show-popover-action.invocation-failed',\n }\n );\n }\n }\n\n @action\n hidePopover(): void {\n try {\n if (this.popoverElement) {\n this.popoverElement.hidePopover();\n }\n } catch (error) {\n warn(\n `The invocation of \\`hidePopover\\` for the popover element caused an unexpected error: ${JSON.stringify(\n error\n )}`,\n {\n id: 'hds-popover.hide-popover-action.invocation-failed',\n }\n );\n }\n }\n\n @action\n togglePopover(): void {\n try {\n if (this.popoverElement) {\n this.popoverElement.togglePopover();\n }\n } catch (error) {\n warn(\n `The invocation of \\`togglePopover\\` for the popover element caused an unexpected error: ${JSON.stringify(\n error\n )}`,\n {\n id: 'hds-popover.toggle-popover-action.invocation-failed',\n }\n );\n }\n }\n\n // fired just _before_ the \"popover\" is shown or hidden\n @action\n onBeforeTogglePopover(event: ToggleEvent): void {\n if (event.newState === 'closed') {\n // we need this flag to check if it's in the \"closing\" process,\n // because the browser automatically returns the focus to the \"trigger\" button\n // and this would re-open immediately the popover because of the `focusin` event\n this.isClosing = true;\n }\n }\n\n // fired just _after_ the \"popover\" is shown or hidden\n @action\n onTogglePopover(event: ToggleEvent): void {\n if (event.newState === 'open') {\n this.isOpen = true;\n\n // we call the \"onOpen\" callback if it exists (and is a function)\n const { onOpen } = this.args;\n if (typeof onOpen === 'function') {\n onOpen();\n }\n } else {\n this.isOpen = false;\n\n // reset the \"isClosing\" flag (the `toggle` event is fired _after_ the popover is closed)\n this.isClosing = false;\n\n // if the popover was initially forced to be open (using the \"manual\" state) then revert its status to `auto` once the user interacts with it\n if (this.args.isOpen) {\n if (this.popoverElement) {\n this.popoverElement.popover = 'auto';\n }\n }\n\n // we call the \"onClose\" callback if it exists (and is a function)\n const { onClose } = this.args;\n if (typeof onClose === 'function') {\n onClose();\n }\n }\n }\n\n @action\n onMouseEnter(): void {\n if (this.timer) {\n clearTimeout(this.timer);\n }\n this.showPopover();\n }\n\n @action\n onFocusIn(): void {\n // don't re-open the popover if the focus is returned because the closing\n if (!this.isClosing) {\n if (this.timer) {\n clearTimeout(this.timer);\n }\n this.showPopover();\n }\n }\n\n @action\n onMouseLeave(): void {\n this.timer = setTimeout((): void => this.hidePopover(), 500);\n }\n\n @action\n onFocusOut(event: FocusEvent): void {\n if (this.containerElement) {\n let isFocusStillInside = false;\n if (\n event.relatedTarget &&\n // if the related target is not part of the disclosed content we close the disclosed container\n this.containerElement.contains(event.relatedTarget as Node)\n ) {\n isFocusStillInside = true;\n } else if (\n document.activeElement &&\n // due to inconsistent implementation of relatedTarget across browsers we use the activeElement as a fallback\n this.containerElement.contains(document.activeElement)\n ) {\n isFocusStillInside = true;\n }\n // if the target receiving the focus is _not_ part of the disclosed content we close the disclosed container\n if (!isFocusStillInside) {\n this.hidePopover();\n }\n }\n }\n}\n"],"names":["HdsPopoverPrimitive","_class","Component","constructor","args","_initializerDefineProperty","_descriptor","_descriptor2","_defineProperty","enableSoftEvents","enableClickEvents","modifier","element","containerElement","registerEvent","onMouseEnter","onMouseLeave","onFocusIn","onFocusOut","toggleElement","assert","tagName","toLowerCase","HTMLButtonElement","_positional","named","popoverElement","popoverId","id","guidFor","setAttribute","isOpen","popover","showPopover","onBeforeTogglePopover","onTogglePopover","anchoredPositionOptions","next","anchoredPositionModifier","error","warn","JSON","stringify","hidePopover","togglePopover","event","newState","isClosing","onOpen","onClose","timer","clearTimeout","setTimeout","isFocusStillInside","relatedTarget","contains","document","activeElement","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;;;;AACA,eAAe,kBAAkB,CAAC,6dAA6d;;;AC2D1eA,IAAAA,mBAAmB,IAAAC,MAAA,GAAzB,MAAMD,mBAAmB,SAASE,SAAS,CAA+B;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,iBAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAAD,IAAAA,0BAAA,oBAAAE,YAAA,EAAA,IAAA,CAAA,CAAA;IAAAC,eAAA,CAAA,IAAA,EAAA,kBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,eAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMvF;AAAAA,IAAAA,eAAA,2BACmB,IAAI,CAACJ,IAAI,CAACK,gBAAgB,IAAI,KAAK,CAAA,CAAA;AACtD;AAAAD,IAAAA,eAAA,4BACoB,IAAI,CAACJ,IAAI,CAACM,iBAAiB,IAAI,KAAK,CAAA,CAAA;IAAAF,eAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAAAA,IAAAA,eAAA,CAG9BG,IAAAA,EAAAA,yBAAAA,EAAAA,QAAQ,CAC/BC,OAAoB,IAAW;MAC9B,IAAI,CAACC,gBAAgB,GAAGD,OAAO,CAAA;;AAE/B;MACA,IAAI,IAAI,CAACH,gBAAgB,EAAE;AACzB;AACAK,QAAAA,aAAa,CAAC,IAAI,CAACD,gBAAgB,EAAE,CAA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AA0D,SAAA,EAKNM,YAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAAlE,MAAA,CAAA0D,SAAA,EAAA,YAAA,CAAA,EAAA1D,MAAA,CAAA0D,SAAA,IAAA1D,MAAA,EAAA;AAtO+BmE,oBAAA,CAAAC,QAAA,EAAnBrE,mBAAmB,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/hds/popover-primitive/index.hbs","../../../../src/components/hds/popover-primitive/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{yield\\n (hash\\n setupPrimitiveContainer=this.setupPrimitiveContainer\\n setupPrimitiveToggle=this.setupPrimitiveToggle\\n setupPrimitivePopover=this.setupPrimitivePopover\\n toggleElement=this._toggleElement\\n popoverElement=this._popoverElement\\n isOpen=this._isOpen\\n showPopover=this.showPopover\\n hidePopover=this.hidePopover\\n togglePopover=this.togglePopover\\n )\\n}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert, warn } from '@ember/debug';\nimport { next } from '@ember/runloop';\nimport { guidFor } from '@ember/object/internals';\nimport { modifier } from 'ember-modifier';\n\nimport registerEvent from '../../../modifiers/hds-register-event.ts';\nimport anchoredPositionModifier from '../../../modifiers/hds-anchored-position.ts';\n\nimport type { FloatingUIOptions } from '../../../modifiers/hds-anchored-position.ts';\nimport type { ModifierLike } from '@glint/template';\n\nexport interface HdsPopoverPrimitiveSignature {\n Args: {\n isOpen?: boolean;\n enableSoftEvents?: boolean;\n enableClickEvents?: boolean;\n onOpen?: () => void;\n onClose?: () => void;\n };\n Blocks: {\n default: [\n {\n setupPrimitiveContainer: ModifierLike<SetupPrimitiveContainerModifier>;\n setupPrimitiveToggle: ModifierLike<SetupPrimitiveToggleModifier>;\n setupPrimitivePopover: ModifierLike<SetupPrimitivePopoverModifier>;\n toggleElement?: HTMLButtonElement;\n popoverElement?: HTMLElement;\n isOpen: boolean;\n showPopover: () => void;\n hidePopover: () => void;\n togglePopover: () => void;\n },\n ];\n };\n}\n\ninterface SetupPrimitiveContainerModifier {\n Element: HTMLElement;\n}\n\nexport interface SetupPrimitiveToggleModifier {\n Element: HTMLButtonElement;\n}\n\nexport interface SetupPrimitivePopoverModifier {\n Element: HTMLElement;\n Args: {\n Positional: [];\n Named: { anchoredPositionOptions: FloatingUIOptions };\n };\n}\n\nexport default class HdsPopoverPrimitive extends Component<HdsPopoverPrimitiveSignature> {\n @tracked private _isOpen;\n @tracked private _isClosing = false;\n private _containerElement?: HTMLElement;\n private _toggleElement?: HTMLButtonElement;\n private _popoverElement?: HTMLElement;\n // this will enable \"soft\" events for the toggle (\"hover\" and \"focus\")\n enableSoftEvents = this.args.enableSoftEvents ?? false;\n // this will enable \"click\" events for the toggle\n enableClickEvents = this.args.enableClickEvents ?? false;\n private _timer?: ReturnType<typeof setTimeout> | null;\n\n constructor(owner: unknown, args: HdsPopoverPrimitiveSignature['Args']) {\n super(owner, args);\n this._isOpen = this.args.isOpen ?? false;\n }\n\n setupPrimitiveContainer = modifier<SetupPrimitiveContainerModifier>(\n (element: HTMLElement): void => {\n this._containerElement = element;\n\n // we register the \"soft\" events\n if (this.enableSoftEvents) {\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this._containerElement, [\n 'mouseenter',\n this.onMouseEnter,\n ]);\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this._containerElement, [\n 'mouseleave',\n this.onMouseLeave,\n ]);\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this._containerElement, ['focusin', this.onFocusIn]);\n }\n // we always want the focusOut event\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this._containerElement, ['focusout', this.onFocusOut]);\n }\n );\n\n setupPrimitiveToggle = modifier<SetupPrimitiveToggleModifier>(\n (element: HTMLButtonElement): void => {\n this._toggleElement = element;\n\n assert(\n `The toggle element of \"Hds::PopoverPrimitive\" must be a <button>; element received: <${element.tagName.toLowerCase()}>`,\n element instanceof HTMLButtonElement\n );\n }\n );\n\n setupPrimitivePopover = modifier(\n (\n element: HTMLElement,\n _positional,\n named: { anchoredPositionOptions: FloatingUIOptions }\n ): void => {\n this._popoverElement = element;\n\n // for the click events we don't use `onclick` event listeners, but we rely on the `popovertarget` attribute\n // provided by the Popover API which does all the magic for us without needing JS code\n // (important: to work it needs to be applied to a button)\n if (this.enableClickEvents) {\n let popoverId;\n if (this._popoverElement.id) {\n popoverId = this._popoverElement.id;\n } else {\n // we need a DOM id for the `popovertarget` attribute\n popoverId = guidFor(this);\n this._popoverElement.id = popoverId;\n }\n if (this._toggleElement) {\n this._toggleElement.setAttribute('popovertarget', popoverId);\n }\n }\n\n // this should be an extremely edge case, but in the case the popover needs to be initially forced to be open\n // we need to use the \"manual\" state to support the case of multiple \"menus\" opened at the same time\n // IMPORTANT! if a \"popover\" is set to \"open\" with a \"manual\" state, then it can't be closed via `esc` and `click outside`\n if (this.args.isOpen) {\n this._popoverElement.popover = 'manual';\n this._popoverElement.showPopover();\n } else {\n this._popoverElement.popover = 'auto';\n }\n\n // Register \"onBeforeToggle\" + \"onToggle\" callback functions to be called when a native 'toggle' event is dispatched\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this._popoverElement, [\n 'beforetoggle',\n this.onBeforeTogglePopover,\n ]);\n // @ts-expect-error: known issue with type of invocation\n registerEvent(this._popoverElement, ['toggle', this.onTogglePopover]);\n\n // we need to spread the argument because if it's set via `{{ hash … }}` Ember complains when we overwrite one of its values\n const anchoredPositionOptions: FloatingUIOptions = {\n ...named.anchoredPositionOptions,\n };\n\n // Apply the `hds-anchored-position` modifier to the \"popover\" element\n // (notice: this function runs the first time when the element the modifier was applied to is inserted into the DOM, and it autotracks while running.\n // Any tracked values that it accesses will be tracked, including the arguments it receives, and if any of them changes, the function will run again)\n // This modifiers uses the Floating UI library to provide:\n // - positioning of the \"popover\" in relation to the \"toggle\"\n // - collision detection (optional)\n // eslint-disable-next-line ember/no-runloop\n next((): void => {\n // @ts-expect-error: known issue with type of invocation\n anchoredPositionModifier(\n this._popoverElement, // element the modifier is attached to\n [this._toggleElement], // positional arguments\n anchoredPositionOptions // named arguments\n );\n });\n }\n );\n\n @action\n showPopover(): void {\n try {\n if (this._popoverElement) {\n this._popoverElement.showPopover();\n }\n } catch (error) {\n warn(\n `The invocation of \\`showPopover\\` for the popover element caused an unexpected error: ${JSON.stringify(\n error\n )}`,\n {\n id: 'hds-popover.show-popover-action.invocation-failed',\n }\n );\n }\n }\n\n @action\n hidePopover(): void {\n try {\n if (this._popoverElement) {\n this._popoverElement.hidePopover();\n }\n } catch (error) {\n warn(\n `The invocation of \\`hidePopover\\` for the popover element caused an unexpected error: ${JSON.stringify(\n error\n )}`,\n {\n id: 'hds-popover.hide-popover-action.invocation-failed',\n }\n );\n }\n }\n\n @action\n togglePopover(): void {\n try {\n if (this._popoverElement) {\n this._popoverElement.togglePopover();\n }\n } catch (error) {\n warn(\n `The invocation of \\`togglePopover\\` for the popover element caused an unexpected error: ${JSON.stringify(\n error\n )}`,\n {\n id: 'hds-popover.toggle-popover-action.invocation-failed',\n }\n );\n }\n }\n\n // fired just _before_ the \"popover\" is shown or hidden\n @action\n onBeforeTogglePopover(event: ToggleEvent): void {\n if (event.newState === 'closed') {\n // we need this flag to check if it's in the \"closing\" process,\n // because the browser automatically returns the focus to the \"trigger\" button\n // and this would re-open immediately the popover because of the `focusin` event\n this._isClosing = true;\n }\n }\n\n // fired just _after_ the \"popover\" is shown or hidden\n @action\n onTogglePopover(event: ToggleEvent): void {\n if (event.newState === 'open') {\n this._isOpen = true;\n\n // we call the \"onOpen\" callback if it exists (and is a function)\n const { onOpen } = this.args;\n if (typeof onOpen === 'function') {\n onOpen();\n }\n } else {\n this._isOpen = false;\n\n // reset the \"isClosing\" flag (the `toggle` event is fired _after_ the popover is closed)\n this._isClosing = false;\n\n // if the popover was initially forced to be open (using the \"manual\" state) then revert its status to `auto` once the user interacts with it\n if (this.args.isOpen) {\n if (this._popoverElement) {\n this._popoverElement.popover = 'auto';\n }\n }\n\n // we call the \"onClose\" callback if it exists (and is a function)\n const { onClose } = this.args;\n if (typeof onClose === 'function') {\n onClose();\n }\n }\n }\n\n @action\n onMouseEnter(): void {\n if (this._timer) {\n clearTimeout(this._timer);\n }\n this.showPopover();\n }\n\n @action\n onFocusIn(): void {\n // don't re-open the popover if the focus is returned because the closing\n if (!this._isClosing) {\n if (this._timer) {\n clearTimeout(this._timer);\n }\n this.showPopover();\n }\n }\n\n @action\n onMouseLeave(): void {\n this._timer = setTimeout((): void => this.hidePopover(), 500);\n }\n\n @action\n onFocusOut(event: FocusEvent): void {\n if (this._containerElement) {\n let isFocusStillInside = false;\n if (\n event.relatedTarget &&\n // if the related target is not part of the disclosed content we close the disclosed container\n this._containerElement.contains(event.relatedTarget as Node)\n ) {\n isFocusStillInside = true;\n } else if (\n document.activeElement &&\n // due to inconsistent implementation of relatedTarget across browsers we use the activeElement as a fallback\n this._containerElement.contains(document.activeElement)\n ) {\n isFocusStillInside = true;\n }\n // if the target receiving the focus is _not_ part of the disclosed content we close the disclosed container\n if (!isFocusStillInside) {\n this.hidePopover();\n }\n }\n }\n}\n"],"names":["HdsPopoverPrimitive","_class","Component","constructor","owner","args","_initializerDefineProperty","_descriptor","_descriptor2","_defineProperty","enableSoftEvents","enableClickEvents","modifier","element","_containerElement","registerEvent","onMouseEnter","onMouseLeave","onFocusIn","onFocusOut","_toggleElement","assert","tagName","toLowerCase","HTMLButtonElement","_positional","named","_popoverElement","popoverId","id","guidFor","setAttribute","isOpen","popover","showPopover","onBeforeTogglePopover","onTogglePopover","anchoredPositionOptions","next","anchoredPositionModifier","_isOpen","error","warn","JSON","stringify","hidePopover","togglePopover","event","newState","_isClosing","onOpen","onClose","_timer","clearTimeout","setTimeout","isFocusStillInside","relatedTarget","contains","document","activeElement","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;;;;AACA,eAAe,kBAAkB,CAAC,geAAge;;;AC2D7eA,IAAAA,mBAAmB,IAAAC,MAAA,GAAzB,MAAMD,mBAAmB,SAASE,SAAS,CAA+B;AAYvFC,EAAAA,WAAWA,CAACC,KAAc,EAAEC,IAA0C,EAAE;AACtE,IAAA,KAAK,CAACD,KAAK,EAAEC,IAAI,CAAC;AAACC,IAAAA,0BAAA,kBAAAC,WAAA,EAAA,IAAA,CAAA;AAAAD,IAAAA,0BAAA,qBAAAE,YAAA,EAAA,IAAA,CAAA;IAAAC,eAAA,CAAA,IAAA,EAAA,mBAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA;AAPrB;AAAAA,IAAAA,eAAA,2BACmB,IAAI,CAACJ,IAAI,CAACK,gBAAgB,IAAI,KAAK,CAAA;AACtD;AAAAD,IAAAA,eAAA,4BACoB,IAAI,CAACJ,IAAI,CAACM,iBAAiB,IAAI,KAAK,CAAA;IAAAF,eAAA,CAAA,IAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA;AAAAA,IAAAA,eAAA,CAQ9BG,IAAAA,EAAAA,yBAAAA,EAAAA,QAAQ,CAC/BC,OAAoB,IAAW;MAC9B,IAAI,CAACC,iBAAiB,GAAGD,OAAO;;AAEhC;MACA,IAAI,IAAI,CAACH,gBAAgB,EAAE;AACzB;AACAK,QAAAA,aAAa,CAAC,IAAI,CAACD,iBAAiB,EAAE,CACpC,YAAY,EACZ,IAAI,CAACE,YAAY,CAClB,CAAC;AACF;AACAD,QAAAA,aAAa,CAAC,IAAI,CAACD,iBAAiB,EAAE,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