@ids-group-ltd/ids-design-system 0.14.8 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/CHANGELOG.md +1145 -234
  2. package/components.md +122 -53
  3. package/docs/agent/INDEX.md +5 -3
  4. package/docs/agent/charts/column-series-component.md +1 -1
  5. package/docs/agent/charts/ds-bar-chart.md +7 -4
  6. package/docs/agent/charts/ds-chart.md +1 -1
  7. package/docs/agent/charts/ds-column-chart.md +2 -1
  8. package/docs/agent/charts/ds-funnel-chart.md +1 -1
  9. package/docs/agent/charts/ds-heatmap-chart.md +2 -1
  10. package/docs/agent/charts/ds-line-chart.md +3 -3
  11. package/docs/agent/charts/ds-pie-chart.md +3 -2
  12. package/docs/agent/charts/ds-scatter-chart.md +2 -1
  13. package/docs/agent/charts/ds-waterfall-chart.md +2 -2
  14. package/docs/agent/charts/line-series-component.md +1 -1
  15. package/docs/agent/feedback/ds-alert.md +1 -0
  16. package/docs/agent/feedback/ds-banner.md +1 -0
  17. package/docs/agent/feedback/ds-loading-overlay.md +2 -0
  18. package/docs/agent/feedback/ds-skeleton.md +1 -1
  19. package/docs/agent/feedback/ds-toast.md +2 -0
  20. package/docs/agent/forms/ds-autocomplete.md +1 -1
  21. package/docs/agent/forms/ds-button.md +1 -0
  22. package/docs/agent/forms/ds-checkbox.md +1 -1
  23. package/docs/agent/forms/ds-color-picker.md +1 -1
  24. package/docs/agent/forms/ds-date-picker.md +2 -1
  25. package/docs/agent/forms/ds-icon-button.md +1 -1
  26. package/docs/agent/forms/ds-input.md +1 -1
  27. package/docs/agent/forms/ds-multi-select.md +1 -1
  28. package/docs/agent/forms/ds-otp-input.md +1 -1
  29. package/docs/agent/forms/ds-radio-group.md +1 -1
  30. package/docs/agent/forms/ds-segmented.md +1 -1
  31. package/docs/agent/forms/ds-select.md +1 -1
  32. package/docs/agent/forms/ds-slider.md +1 -1
  33. package/docs/agent/forms/ds-switch.md +1 -1
  34. package/docs/agent/forms/ds-textarea.md +1 -1
  35. package/docs/agent/forms/ds-time-picker.md +1 -1
  36. package/docs/agent/forms/the-picker-family-ds-select-ds-multi-select-ds-autocomplete.md +1 -1
  37. package/docs/agent/foundations/global-helper-classes.md +4 -4
  38. package/docs/agent/foundations/tokens.md +1 -1
  39. package/docs/agent/navigation/ds-pagination.md +2 -1
  40. package/docs/agent/overlays/ds-bottom-sheet.md +1 -1
  41. package/docs/agent/overlays/ds-definition-term.md +10 -0
  42. package/docs/agent/overlays/ds-drawer.md +1 -1
  43. package/docs/agent/overlays/ds-info-hint.md +29 -0
  44. package/docs/agent/overlays/ds-menu.md +1 -1
  45. package/docs/agent/overlays/ds-modal-card.md +1 -1
  46. package/docs/agent/overlays/ds-modal.md +19 -1
  47. package/docs/agent/overlays/ds-tooltip-panel.md +1 -1
  48. package/docs/agent/overlays/ds-tooltip.md +3 -3
  49. package/docs/agent/tables/ds-table-columns.md +2 -0
  50. package/docs/agent/tables/ds-table.md +4 -3
  51. package/eslint/deprecated-api.json +889 -0
  52. package/eslint/index.mjs +394 -0
  53. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +4 -4
  54. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
  55. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +6 -3
  56. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
  57. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +6 -12
  58. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
  59. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +2 -2
  60. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -1
  61. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +27 -9
  62. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
  63. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +2 -2
  64. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -1
  65. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +2 -2
  66. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -1
  67. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +2 -2
  68. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
  69. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +6 -3
  70. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
  71. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +169 -37
  72. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
  73. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +2 -2
  74. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -1
  75. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +2 -2
  76. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
  77. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +2 -2
  78. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
  79. package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs +2 -2
  80. package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs.map +1 -1
  81. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +8 -9
  82. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
  83. package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +2 -2
  84. package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs.map +1 -1
  85. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +2 -2
  86. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -1
  87. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +2 -2
  88. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs.map +1 -1
  89. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +7 -17
  90. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
  91. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +875 -90
  92. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
  93. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +2183 -1232
  94. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
  95. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +10 -5
  96. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
  97. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +15 -5
  98. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
  99. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +50 -11
  100. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
  101. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +22 -6
  102. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
  103. package/fesm2022/ids-group-ltd-ids-design-system-components-definition-term.mjs +107 -0
  104. package/fesm2022/ids-group-ltd-ids-design-system-components-definition-term.mjs.map +1 -0
  105. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +4 -4
  106. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
  107. package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs +2 -2
  108. package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs.map +1 -1
  109. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +5 -15
  110. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
  111. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +2 -2
  112. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
  113. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
  114. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
  115. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +2 -2
  116. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
  117. package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs +44 -5
  118. package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs.map +1 -1
  119. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +2 -2
  120. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
  121. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +11 -22
  122. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
  123. package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +51 -21
  124. package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -1
  125. package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +5 -4
  126. package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -1
  127. package/fesm2022/ids-group-ltd-ids-design-system-components-info-hint.mjs +110 -0
  128. package/fesm2022/ids-group-ltd-ids-design-system-components-info-hint.mjs.map +1 -0
  129. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +11 -7
  130. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
  131. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +6 -6
  132. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -1
  133. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +41 -46
  134. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
  135. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +4 -4
  136. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
  137. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +2 -2
  138. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -1
  139. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +183 -31
  140. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
  141. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +21 -26
  142. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
  143. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +27 -9
  144. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
  145. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +2 -2
  146. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
  147. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +10 -5
  148. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
  149. package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs +2 -2
  150. package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs.map +1 -1
  151. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
  152. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
  153. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +14 -6
  154. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
  155. package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +2 -2
  156. package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -1
  157. package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +106 -29
  158. package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -1
  159. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +7 -4
  160. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -1
  161. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +12 -7
  162. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
  163. package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +140 -26
  164. package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -1
  165. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +2 -2
  166. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
  167. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +10 -5
  168. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
  169. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +29 -9
  170. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
  171. package/fesm2022/ids-group-ltd-ids-design-system-components-show-dirty.mjs +55 -0
  172. package/fesm2022/ids-group-ltd-ids-design-system-components-show-dirty.mjs.map +1 -0
  173. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +2 -2
  174. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
  175. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +6 -6
  176. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
  177. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +2 -2
  178. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -1
  179. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +10 -5
  180. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
  181. package/fesm2022/ids-group-ltd-ids-design-system-components-sparkline.mjs +5 -4
  182. package/fesm2022/ids-group-ltd-ids-design-system-components-sparkline.mjs.map +1 -1
  183. package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +2 -2
  184. package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs.map +1 -1
  185. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +2 -2
  186. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
  187. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +2 -2
  188. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
  189. package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs +2 -2
  190. package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs.map +1 -1
  191. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +2 -2
  192. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -1
  193. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +10 -5
  194. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
  195. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +36 -18
  196. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -1
  197. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +2 -2
  198. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
  199. package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs +17 -0
  200. package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs.map +1 -1
  201. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +193 -19
  202. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
  203. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +2 -2
  204. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
  205. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
  206. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
  207. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +15 -5
  208. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
  209. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +26 -9
  210. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
  211. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +4 -4
  212. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -1
  213. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +20 -5
  214. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
  215. package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +2 -2
  216. package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -1
  217. package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +434 -157
  218. package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -1
  219. package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs +2 -2
  220. package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs.map +1 -1
  221. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
  222. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
  223. package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +2 -2
  224. package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -1
  225. package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +18 -11
  226. package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -1
  227. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +323 -68
  228. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
  229. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +27 -83
  230. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
  231. package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +2 -2
  232. package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -1
  233. package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs +1 -0
  234. package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs.map +1 -1
  235. package/fesm2022/ids-group-ltd-ids-design-system.mjs +3 -0
  236. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  237. package/migrations/0.10.0.json +79 -21
  238. package/migrations/0.10.1.json +38 -21
  239. package/migrations/0.10.2.json +44 -7
  240. package/migrations/0.10.3.json +7 -5
  241. package/migrations/0.11.0.json +10 -7
  242. package/migrations/0.11.1.json +25 -14
  243. package/migrations/0.11.2.json +3 -3
  244. package/migrations/0.11.3.json +9 -6
  245. package/migrations/0.11.4.json +13 -12
  246. package/migrations/0.12.1.json +41 -14
  247. package/migrations/0.12.2.json +7 -6
  248. package/migrations/0.12.3.json +3 -3
  249. package/migrations/0.13.0.json +11 -11
  250. package/migrations/0.13.1.json +60 -8
  251. package/migrations/0.13.2.json +98 -44
  252. package/migrations/0.13.3.json +46 -16
  253. package/migrations/0.13.4.json +23 -22
  254. package/migrations/0.14.0.json +5 -5
  255. package/migrations/0.14.1.json +5 -5
  256. package/migrations/0.14.2.json +1 -1
  257. package/migrations/0.14.4.json +6 -5
  258. package/migrations/0.14.5.json +13 -7
  259. package/migrations/0.14.6.json +2 -2
  260. package/migrations/0.14.8.json +26 -2
  261. package/migrations/0.15.0.json +999 -0
  262. package/migrations/0.15.1.json +738 -0
  263. package/migrations/0.2.0.json +2 -2
  264. package/migrations/0.3.0.json +43 -6
  265. package/migrations/0.4.0.json +95 -13
  266. package/migrations/0.5.0.json +116 -10
  267. package/migrations/0.5.1.json +97 -11
  268. package/migrations/0.6.0.json +30 -1
  269. package/migrations/0.6.1.json +22 -1
  270. package/migrations/0.6.2.json +8 -4
  271. package/migrations/0.6.3.json +17 -5
  272. package/migrations/0.7.0.json +58 -9
  273. package/migrations/0.7.1.json +62 -8
  274. package/migrations/0.8.0.json +60 -12
  275. package/migrations/0.9.0.json +68 -25
  276. package/migrations/0.9.1.json +1 -1
  277. package/migrations/README.md +57 -3
  278. package/package.json +27 -1
  279. package/schematics/check-overrides/index.cjs +4 -11
  280. package/schematics/check-overrides/scan.cjs +12 -1
  281. package/schematics/check-overrides/surface.json +94 -11
  282. package/schematics/ng-add/index.cjs +7 -1
  283. package/stylelint/deprecated-tokens.json +2711 -0
  284. package/stylelint/index.mjs +94 -0
  285. package/stylelint/since-version.mjs +26 -0
  286. package/styles/_chart-frame.scss +14 -0
  287. package/styles/_chart-interactive.scss +26 -1
  288. package/styles/_chart-motion.scss +50 -17
  289. package/styles/_chip-row.scss +5 -2
  290. package/styles/_clear-button.scss +2 -0
  291. package/styles/_component-base.scss +56 -0
  292. package/styles/_dismiss-button.scss +16 -0
  293. package/styles/_dropdown-overlay.scss +19 -0
  294. package/styles/_focus.scss +4 -1
  295. package/styles/_link.scss +35 -12
  296. package/styles/_overlay-motion.scss +4 -6
  297. package/styles/_pinned.scss +43 -0
  298. package/styles/_skeleton-shimmer.scss +2 -8
  299. package/styles/_table-controls.scss +4 -0
  300. package/styles/_target.scss +40 -0
  301. package/styles/_text-clip.scss +23 -4
  302. package/styles/_tokens.scss +3 -1
  303. package/styles/_typography.scss +2 -0
  304. package/styles/_visually-hidden.scss +2 -0
  305. package/styles/ds.scss +0 -1
  306. package/themes/README.md +60 -7
  307. package/themes/_semantic.scss +5 -8
  308. package/themes/dark/_theme.scss +5 -8
  309. package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +1 -1
  310. package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +6 -1
  311. package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +1 -1
  312. package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +74 -4
  313. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +3 -2
  314. package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +4 -4
  315. package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +87 -7
  316. package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +207 -29
  317. package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +2 -0
  318. package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +2 -0
  319. package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +30 -4
  320. package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +3 -1
  321. package/types/ids-group-ltd-ids-design-system-components-definition-term.d.ts +22 -0
  322. package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +0 -1
  323. package/types/ids-group-ltd-ids-design-system-components-field-message.d.ts +19 -2
  324. package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +7 -6
  325. package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +22 -8
  326. package/types/ids-group-ltd-ids-design-system-components-icon-button.d.ts +3 -2
  327. package/types/ids-group-ltd-ids-design-system-components-info-hint.d.ts +23 -0
  328. package/types/ids-group-ltd-ids-design-system-components-input.d.ts +2 -0
  329. package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +18 -7
  330. package/types/ids-group-ltd-ids-design-system-components-menu.d.ts +14 -3
  331. package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +0 -2
  332. package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +6 -1
  333. package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +2 -0
  334. package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +5 -3
  335. package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +26 -7
  336. package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +2 -1
  337. package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +2 -0
  338. package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +52 -10
  339. package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +2 -0
  340. package/types/ids-group-ltd-ids-design-system-components-select.d.ts +6 -1
  341. package/types/ids-group-ltd-ids-design-system-components-show-dirty.d.ts +29 -0
  342. package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +2 -0
  343. package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +2 -0
  344. package/types/ids-group-ltd-ids-design-system-components-table-resize.d.ts +2 -0
  345. package/types/ids-group-ltd-ids-design-system-components-table.d.ts +39 -9
  346. package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +2 -0
  347. package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +3 -1
  348. package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +2 -0
  349. package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +54 -24
  350. package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +9 -2
  351. package/types/ids-group-ltd-ids-design-system-components.d.ts +135 -35
  352. package/types/ids-group-ltd-ids-design-system-core.d.ts +46 -23
  353. package/types/ids-group-ltd-ids-design-system.d.ts +6 -3
@@ -1,31 +1,274 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, ViewEncapsulation, Component, inject, ElementRef, booleanAttribute, afterNextRender, HostListener, Directive } from '@angular/core';
2
+ import { input, computed, TemplateRef, ViewEncapsulation, Component, InjectionToken, inject, ElementRef, DOCUMENT, booleanAttribute, afterNextRender, HostListener, Directive } from '@angular/core';
3
3
  import { Overlay } from '@angular/cdk/overlay';
4
4
  import { ComponentPortal } from '@angular/cdk/portal';
5
- import { prepareOverlayEnter, overlayPlacementOf } from '@ids-group-ltd/ids-design-system/components';
5
+ import { NgTemplateOutlet } from '@angular/common';
6
6
  import { isTextClipped } from '@ids-group-ltd/ids-design-system/core';
7
+ import { listenForEscape, prepareOverlayEnter, closeOnScroll, overlayPlacementOf } from '@ids-group-ltd/ids-design-system/components';
8
+
9
+ const TOKEN = /(\\\*\\\*|\*\*)/;
10
+ const ESCAPED = '\\*\\*';
11
+ const BOLD = '**';
12
+ /** Splits tip text on `**` into plain and bold runs. `\*\*` is a literal `**`; an unpaired `**` is literal too. */
13
+ function parseTooltipMarkup(text) {
14
+ const tokens = text.split(TOKEN);
15
+ const markerCount = tokens.filter((token) => token === BOLD).length;
16
+ const pairedMarkers = markerCount - (markerCount % 2);
17
+ const segments = [];
18
+ let bold = false;
19
+ let seen = 0;
20
+ for (const token of tokens) {
21
+ let piece = token;
22
+ if (token === ESCAPED) {
23
+ piece = BOLD;
24
+ }
25
+ else if (token === BOLD && seen++ < pairedMarkers) {
26
+ bold = !bold;
27
+ continue;
28
+ }
29
+ if (!piece) {
30
+ continue;
31
+ }
32
+ const last = segments[segments.length - 1];
33
+ if (last?.bold === bold) {
34
+ last.text += piece;
35
+ }
36
+ else {
37
+ segments.push({ text: piece, bold });
38
+ }
39
+ }
40
+ return segments;
41
+ }
42
+ function escapeTooltipMarkup(text) {
43
+ return text.replaceAll(BOLD, ESCAPED);
44
+ }
45
+ function plainTooltipText(text) {
46
+ return parseTooltipMarkup(text)
47
+ .map((segment) => segment.text)
48
+ .join('');
49
+ }
7
50
 
8
51
  class TooltipPanelComponent {
9
- /** Tooltip text content. */
52
+ /** Tooltip text, where `**bold**` runs render bold; or a template, rendered as given. */
10
53
  text = input.required(...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
54
+ template = computed(() => {
55
+ const text = this.text();
56
+ return text instanceof TemplateRef ? text : null;
57
+ }, ...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
58
+ segments = computed(() => {
59
+ const text = this.text();
60
+ return typeof text === 'string' ? parseTooltipMarkup(text) : [];
61
+ }, ...(ngDevMode ? [{ debugName: "segments" }] : /* istanbul ignore next */ []));
11
62
  /** Side of the trigger the panel is positioned on; also drives the arrow class. */
12
63
  placement = input.required(...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
64
+ /** Whether the arrow pointing at the trigger is drawn. */
65
+ arrow = input(true, ...(ngDevMode ? [{ debugName: "arrow" }] : /* istanbul ignore next */ []));
13
66
  /** Element `id`, referenced by the trigger's `aria-describedby`. */
14
67
  panelId = input('', ...(ngDevMode ? [{ debugName: "panelId" }] : /* istanbul ignore next */ []));
15
68
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TooltipPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
16
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: TooltipPanelComponent, isStandalone: true, selector: "ds-tooltip-panel", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: true, transformFunction: null }, panelId: { classPropertyName: "panelId", publicName: "panelId", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tooltip" }, properties: { "attr.id": "panelId()", "class.top": "placement() === 'top'", "class.bottom": "placement() === 'bottom'", "class.left": "placement() === 'left'", "class.right": "placement() === 'right'" } }, ngImport: i0, template: `{{ text() }}`, isInline: true, styles: [":host{--_tooltip-bg-color: var(--ds-tooltip-bg-color, var(--tooltip-bg-color));--_tooltip-text-color: var(--ds-tooltip-text-color, var(--tooltip-text-color));--_tooltip-border-color: var(--ds-tooltip-border-color, var(--tooltip-border-color));--_tooltip-radius: var(--ds-tooltip-radius, var(--ds-radius-control));--_tooltip-shadow: var(--ds-tooltip-shadow, var(--ds-elevation-overlay));--_tooltip-max-width: var(--ds-tooltip-max-width, var(--tooltip-maxw));--_tooltip-padding: var(--ds-tooltip-padding, var(--space-1-5) var(--space-2-5));display:block;position:relative;background:var(--_tooltip-bg-color);color:var(--_tooltip-text-color);border:var(--border-width-default) solid var(--_tooltip-border-color);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--_tooltip-padding);border-radius:var(--_tooltip-radius);max-width:var(--_tooltip-max-width);overflow-wrap:anywhere;white-space:pre-line;z-index:var(--layer-tooltip);box-shadow:var(--_tooltip-shadow)}:host:after{content:\"\";position:absolute;width:var(--space-2);height:var(--space-2);background:var(--_tooltip-bg-color);border:0 solid var(--_tooltip-border-color);transform:rotate(45deg)}:host(.bottom):after{top:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:50%;margin-left:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-left-width:var(--border-width-default)}:host(.top):after{bottom:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:50%;margin-left:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.left):after{right:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:50%;margin-top:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.right):after{left:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:50%;margin-top:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-left-width:var(--border-width-default)}\n"] });
69
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: TooltipPanelComponent, isStandalone: true, selector: "ds-tooltip-panel", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: true, transformFunction: null }, arrow: { classPropertyName: "arrow", publicName: "arrow", isSignal: true, isRequired: false, transformFunction: null }, panelId: { classPropertyName: "panelId", publicName: "panelId", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tooltip" }, properties: { "attr.id": "panelId()", "class.top": "placement() === 'top'", "class.bottom": "placement() === 'bottom'", "class.left": "placement() === 'left'", "class.right": "placement() === 'right'", "class.no-arrow": "!arrow()" } }, ngImport: i0, template: `
70
+ @if (template(); as template) {
71
+ <ng-container [ngTemplateOutlet]="template" />
72
+ }
73
+
74
+ @for (segment of segments(); track $index) {
75
+ @if (segment.bold) {
76
+ <strong [textContent]="segment.text"></strong>
77
+ } @else {
78
+ <span [textContent]="segment.text"></span>
79
+ }
80
+ }
81
+ `, isInline: true, styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{--_tooltip-bg-color: var(--ds-tooltip-bg-color, var(--tooltip-bg-color));--_tooltip-text-color: var(--ds-tooltip-text-color, var(--tooltip-text-color));--_tooltip-border-color: var(--ds-tooltip-border-color, var(--tooltip-border-color));--_tooltip-radius: var(--ds-tooltip-radius, var(--ds-radius-control));--_tooltip-shadow: var(--ds-tooltip-shadow, var(--ds-elevation-overlay));--_tooltip-max-width: var(--ds-tooltip-max-width, var(--tooltip-maxw));--_tooltip-padding: var(--ds-tooltip-padding, var(--space-1-5) var(--space-2-5));--_tooltip-arrow-inset: calc(var(--_tooltip-radius) + var(--tooltip-arrow));--_tooltip-arrow-left: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-x, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));--_tooltip-arrow-top: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-y, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));display:block;position:relative;background:var(--_tooltip-bg-color);color:var(--_tooltip-text-color);border:var(--border-width-default) solid var(--_tooltip-border-color);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--_tooltip-padding);border-radius:var(--_tooltip-radius);max-width:var(--_tooltip-max-width);overflow-wrap:anywhere;white-space:pre-line;z-index:var(--layer-tooltip);box-shadow:var(--_tooltip-shadow)}:host strong{font-weight:var(--font-weight-bold)}:host:after{content:\"\";position:absolute;width:var(--space-2);height:var(--space-2);background:var(--_tooltip-bg-color);border:0 solid var(--_tooltip-border-color);transform:rotate(45deg)}:host(.no-arrow):after{display:none}:host(.bottom):after{top:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-left-width:var(--border-width-default)}:host(.top):after{bottom:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.left):after{right:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.right):after{left:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-left-width:var(--border-width-default)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
17
82
  }
18
83
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TooltipPanelComponent, decorators: [{
19
84
  type: Component,
20
- args: [{ selector: 'ds-tooltip-panel', standalone: true, template: `{{ text() }}`, host: {
85
+ args: [{ selector: 'ds-tooltip-panel', standalone: true, imports: [NgTemplateOutlet], template: `
86
+ @if (template(); as template) {
87
+ <ng-container [ngTemplateOutlet]="template" />
88
+ }
89
+
90
+ @for (segment of segments(); track $index) {
91
+ @if (segment.bold) {
92
+ <strong [textContent]="segment.text"></strong>
93
+ } @else {
94
+ <span [textContent]="segment.text"></span>
95
+ }
96
+ }
97
+ `, host: {
21
98
  role: 'tooltip',
22
99
  '[attr.id]': 'panelId()',
23
100
  '[class.top]': "placement() === 'top'",
24
101
  '[class.bottom]': "placement() === 'bottom'",
25
102
  '[class.left]': "placement() === 'left'",
26
103
  '[class.right]': "placement() === 'right'",
27
- }, encapsulation: ViewEncapsulation.Emulated, styles: [":host{--_tooltip-bg-color: var(--ds-tooltip-bg-color, var(--tooltip-bg-color));--_tooltip-text-color: var(--ds-tooltip-text-color, var(--tooltip-text-color));--_tooltip-border-color: var(--ds-tooltip-border-color, var(--tooltip-border-color));--_tooltip-radius: var(--ds-tooltip-radius, var(--ds-radius-control));--_tooltip-shadow: var(--ds-tooltip-shadow, var(--ds-elevation-overlay));--_tooltip-max-width: var(--ds-tooltip-max-width, var(--tooltip-maxw));--_tooltip-padding: var(--ds-tooltip-padding, var(--space-1-5) var(--space-2-5));display:block;position:relative;background:var(--_tooltip-bg-color);color:var(--_tooltip-text-color);border:var(--border-width-default) solid var(--_tooltip-border-color);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--_tooltip-padding);border-radius:var(--_tooltip-radius);max-width:var(--_tooltip-max-width);overflow-wrap:anywhere;white-space:pre-line;z-index:var(--layer-tooltip);box-shadow:var(--_tooltip-shadow)}:host:after{content:\"\";position:absolute;width:var(--space-2);height:var(--space-2);background:var(--_tooltip-bg-color);border:0 solid var(--_tooltip-border-color);transform:rotate(45deg)}:host(.bottom):after{top:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:50%;margin-left:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-left-width:var(--border-width-default)}:host(.top):after{bottom:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:50%;margin-left:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.left):after{right:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:50%;margin-top:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.right):after{left:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:50%;margin-top:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-left-width:var(--border-width-default)}\n"] }]
28
- }], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: true }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: true }] }], panelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelId", required: false }] }] } });
104
+ '[class.no-arrow]': '!arrow()',
105
+ }, encapsulation: ViewEncapsulation.Emulated, styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{--_tooltip-bg-color: var(--ds-tooltip-bg-color, var(--tooltip-bg-color));--_tooltip-text-color: var(--ds-tooltip-text-color, var(--tooltip-text-color));--_tooltip-border-color: var(--ds-tooltip-border-color, var(--tooltip-border-color));--_tooltip-radius: var(--ds-tooltip-radius, var(--ds-radius-control));--_tooltip-shadow: var(--ds-tooltip-shadow, var(--ds-elevation-overlay));--_tooltip-max-width: var(--ds-tooltip-max-width, var(--tooltip-maxw));--_tooltip-padding: var(--ds-tooltip-padding, var(--space-1-5) var(--space-2-5));--_tooltip-arrow-inset: calc(var(--_tooltip-radius) + var(--tooltip-arrow));--_tooltip-arrow-left: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-x, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));--_tooltip-arrow-top: clamp(min(var(--_tooltip-arrow-inset), 50%), var(--_tooltip-arrow-y, 50%), max(100% - var(--_tooltip-arrow-inset), 50%));display:block;position:relative;background:var(--_tooltip-bg-color);color:var(--_tooltip-text-color);border:var(--border-width-default) solid var(--_tooltip-border-color);font:var(--font-weight-medium) var(--font-size-xs)/var(--line-height-base) var(--font-sans);padding:var(--_tooltip-padding);border-radius:var(--_tooltip-radius);max-width:var(--_tooltip-max-width);overflow-wrap:anywhere;white-space:pre-line;z-index:var(--layer-tooltip);box-shadow:var(--_tooltip-shadow)}:host strong{font-weight:var(--font-weight-bold)}:host:after{content:\"\";position:absolute;width:var(--space-2);height:var(--space-2);background:var(--_tooltip-bg-color);border:0 solid var(--_tooltip-border-color);transform:rotate(45deg)}:host(.no-arrow):after{display:none}:host(.bottom):after{top:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-left-width:var(--border-width-default)}:host(.top):after{bottom:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));left:var(--_tooltip-arrow-left);margin-left:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.left):after{right:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-top-width:var(--border-width-default);border-right-width:var(--border-width-default)}:host(.right):after{left:calc(var(--tooltip-arrow) / -2 - var(--border-width-default));top:var(--_tooltip-arrow-top);margin-top:calc(var(--tooltip-arrow) / -2);border-bottom-width:var(--border-width-default);border-left-width:var(--border-width-default)}\n"] }]
106
+ }], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: true }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: true }] }], arrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrow", required: false }] }], panelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelId", required: false }] }] } });
107
+
108
+ const NATIVELY_FOCUSABLE = 'a[href], button, input, select, textarea, summary';
109
+ const FOCUSABLE = `${NATIVELY_FOCUSABLE}, [tabindex]`;
110
+ const KEYBOARD_FOCUSABLE = `${NATIVELY_FOCUSABLE}, [tabindex]:not([tabindex^="-"])`;
111
+ const WIDGET_ROLES = [
112
+ 'button',
113
+ 'link',
114
+ 'tab',
115
+ 'option',
116
+ 'menuitem',
117
+ 'menuitemcheckbox',
118
+ 'menuitemradio',
119
+ 'row',
120
+ 'gridcell',
121
+ 'combobox',
122
+ 'checkbox',
123
+ 'radio',
124
+ 'switch',
125
+ 'treeitem',
126
+ ]
127
+ .map((role) => `[role="${role}"]`)
128
+ .join(', ');
129
+ const INTERACTIVE = `${NATIVELY_FOCUSABLE}, tr:not([role]), ${WIDGET_ROLES}`;
130
+ // A widget role owns its focus (a listbox moves it by `aria-activedescendant`), and a hidden subtree must hold no tab stop.
131
+ const REACHED_OR_HIDDEN = `${NATIVELY_FOCUSABLE}, tr[tabindex]:not([role]), ${WIDGET_ROLES}, [aria-hidden="true"], [inert]`;
132
+ const clippedHostsByAncestor = new WeakMap();
133
+ function firstClippedHost(triggers) {
134
+ return [...triggers]
135
+ .sort((a, b) => a.host.compareDocumentPosition(b.host) & Node.DOCUMENT_POSITION_FOLLOWING
136
+ ? -1
137
+ : 1)
138
+ .find((trigger) => trigger.isClipped());
139
+ }
140
+ /**
141
+ * A clipped host that is not focusable itself opens its tip when its focusable ancestor takes
142
+ * keyboard focus. `:focus-visible` keeps a click from opening it. Only the first clipped host of
143
+ * one ancestor opens. Returns the teardown, or null when the host needs no listening.
144
+ */
145
+ function watchFocusableAncestor(trigger) {
146
+ const host = trigger.host;
147
+ if (host.matches(FOCUSABLE)) {
148
+ return null;
149
+ }
150
+ const ancestor = host.parentElement?.closest(FOCUSABLE);
151
+ if (!ancestor?.matches(INTERACTIVE)) {
152
+ return null;
153
+ }
154
+ let triggers = clippedHostsByAncestor.get(ancestor);
155
+ if (!triggers) {
156
+ triggers = new Set();
157
+ clippedHostsByAncestor.set(ancestor, triggers);
158
+ }
159
+ triggers.add(trigger);
160
+ const open = (event) => {
161
+ if (event.target !== ancestor ||
162
+ // Tested here, not at registration: a disabled trigger carries tabindex="-1" until enabled.
163
+ !ancestor.matches(KEYBOARD_FOCUSABLE) ||
164
+ !ancestor.matches(':focus-visible') ||
165
+ firstClippedHost(triggers) !== trigger) {
166
+ return;
167
+ }
168
+ trigger.openFor(ancestor);
169
+ };
170
+ const close = () => trigger.close();
171
+ ancestor.addEventListener('focusin', open);
172
+ ancestor.addEventListener('focusout', close);
173
+ ancestor.addEventListener('click', close);
174
+ ancestor.addEventListener('keydown', close);
175
+ return () => {
176
+ triggers.delete(trigger);
177
+ ancestor.removeEventListener('focusin', open);
178
+ ancestor.removeEventListener('focusout', close);
179
+ ancestor.removeEventListener('click', close);
180
+ ancestor.removeEventListener('keydown', close);
181
+ };
182
+ }
183
+ const tabStopSyncs = new Map();
184
+ let resizes = null;
185
+ let mutations = null;
186
+ function syncOf(node) {
187
+ for (let current = node; current; current = current.parentElement) {
188
+ const sync = tabStopSyncs.get(current);
189
+ if (sync) {
190
+ return sync;
191
+ }
192
+ }
193
+ return undefined;
194
+ }
195
+ // Every isClipped() read forces layout once a tabindex write has dirtied it, so all reads go first.
196
+ function syncAll(targets) {
197
+ const syncs = [...new Set(targets.map(syncOf))].filter((sync) => sync !== undefined);
198
+ const decided = syncs.map((sync) => [sync, sync.isNeeded()]);
199
+ decided.forEach(([sync, needed]) => sync.apply(needed));
200
+ }
201
+ /**
202
+ * A clipped host that no keyboard path reaches - not focusable, inside no control or widget role,
203
+ * holding no focusable descendant - takes `tabindex="0"` while it is clipped, and loses it once its
204
+ * text fits and it does not hold focus. A tabindex it did not write is never touched. One observer
205
+ * pair serves every host. Returns the teardown, or null when the host is reached another way.
206
+ */
207
+ function tabStopWhileClipped(trigger) {
208
+ const host = trigger.host;
209
+ if (host.matches(FOCUSABLE) || host.closest(REACHED_OR_HIDDEN)) {
210
+ return null;
211
+ }
212
+ let written = false;
213
+ const isNeeded = () => trigger.isClipped() && !host.querySelector(KEYBOARD_FOCUSABLE);
214
+ const apply = (needed) => {
215
+ if (needed && !host.hasAttribute('tabindex')) {
216
+ host.setAttribute('tabindex', '0');
217
+ written = true;
218
+ }
219
+ else if (!needed &&
220
+ written &&
221
+ host.ownerDocument.activeElement !== host) {
222
+ written = false;
223
+ if (host.getAttribute('tabindex') === '0') {
224
+ host.removeAttribute('tabindex');
225
+ }
226
+ }
227
+ };
228
+ const sync = () => apply(isNeeded());
229
+ resizes ??= new ResizeObserver((entries) => syncAll(entries.map((entry) => entry.target)));
230
+ mutations ??= new MutationObserver((records) => syncAll(records.map((record) => record.target)));
231
+ tabStopSyncs.set(host, { isNeeded, apply });
232
+ resizes.observe(host);
233
+ mutations.observe(host, {
234
+ characterData: true,
235
+ childList: true,
236
+ subtree: true,
237
+ });
238
+ host.addEventListener('focusout', sync);
239
+ return () => {
240
+ tabStopSyncs.delete(host);
241
+ resizes?.unobserve(host);
242
+ host.removeEventListener('focusout', sync);
243
+ };
244
+ }
245
+
246
+ /**
247
+ * `''`, `true` and `'true'` test the host itself; any other string is a selector for the element
248
+ * inside the host to test; `false`, `'false'`, `null` and `undefined` turn the test off.
249
+ */
250
+ function toClipTarget(value) {
251
+ if (value === true || value === '' || value === 'true') {
252
+ return { selector: null };
253
+ }
254
+ return !value || value === 'false' ? null : { selector: value };
255
+ }
256
+ function clipElement(host, target) {
257
+ return target?.selector
258
+ ? host.querySelector(target.selector)
259
+ : host;
260
+ }
261
+ function isHostClipped(host, target) {
262
+ const element = clipElement(host, target);
263
+ return element !== null && isTextClipped(element);
264
+ }
265
+ function ownTextOf(element) {
266
+ return (element?.textContent ?? '').trim();
267
+ }
268
+ function textContains(haystack, needle) {
269
+ const collapse = (value) => value.replace(/\s+/g, ' ').trim();
270
+ return collapse(haystack).includes(collapse(needle));
271
+ }
29
272
 
30
273
  const TRIGGER_GAP_PX = 8;
31
274
  const VIEWPORT_MARGIN_PX = 8;
@@ -35,95 +278,142 @@ const OPPOSITE_PLACEMENT = {
35
278
  left: 'right',
36
279
  right: 'left',
37
280
  };
38
- const NATIVELY_FOCUSABLE = 'a[href], button, input, select, textarea, summary';
39
- const FOCUSABLE = `${NATIVELY_FOCUSABLE}, [tabindex]`;
40
- const KEYBOARD_FOCUSABLE = `${NATIVELY_FOCUSABLE}, [tabindex]:not([tabindex^="-"])`;
41
- const INTERACTIVE = [
42
- NATIVELY_FOCUSABLE,
43
- 'tr:not([role])',
44
- ...[
45
- 'button',
46
- 'link',
47
- 'tab',
48
- 'option',
49
- 'menuitem',
50
- 'menuitemcheckbox',
51
- 'menuitemradio',
52
- 'row',
53
- 'gridcell',
54
- 'combobox',
55
- 'checkbox',
56
- 'radio',
57
- 'switch',
58
- 'treeitem',
59
- ].map((role) => `[role="${role}"]`),
60
- ].join(', ');
61
- const clippedHostsByAncestor = new WeakMap();
62
- function firstClippedHost(tooltips) {
63
- return [...tooltips]
64
- .sort((a, b) => a.hostElement.compareDocumentPosition(b.hostElement) &
65
- Node.DOCUMENT_POSITION_FOLLOWING
66
- ? -1
67
- : 1)
68
- .find((tooltip) => tooltip.isClipped());
281
+ function positionFor(placement) {
282
+ switch (placement) {
283
+ case 'top':
284
+ return {
285
+ originX: 'center',
286
+ originY: 'top',
287
+ overlayX: 'center',
288
+ overlayY: 'bottom',
289
+ offsetY: -TRIGGER_GAP_PX,
290
+ };
291
+ case 'bottom':
292
+ return {
293
+ originX: 'center',
294
+ originY: 'bottom',
295
+ overlayX: 'center',
296
+ overlayY: 'top',
297
+ offsetY: TRIGGER_GAP_PX,
298
+ };
299
+ case 'left':
300
+ return {
301
+ originX: 'start',
302
+ originY: 'center',
303
+ overlayX: 'end',
304
+ overlayY: 'center',
305
+ offsetX: -TRIGGER_GAP_PX,
306
+ };
307
+ case 'right':
308
+ return {
309
+ originX: 'end',
310
+ originY: 'center',
311
+ overlayX: 'start',
312
+ overlayY: 'center',
313
+ offsetX: TRIGGER_GAP_PX,
314
+ };
315
+ }
316
+ }
317
+ function positionsFor(placement) {
318
+ return [positionFor(placement), positionFor(OPPOSITE_PLACEMENT[placement])];
319
+ }
320
+ // positionChanges skips a re-apply that only pushes the pane; the styles CDK writes do not.
321
+ // The pane is measured, not the panel: the panel's enter animation scales it.
322
+ function pointArrowAtHost(ref, panel, host) {
323
+ const pane = ref.overlayElement;
324
+ const point = () => {
325
+ const trigger = host.getBoundingClientRect();
326
+ const box = pane.getBoundingClientRect();
327
+ panel.style.setProperty('--_tooltip-arrow-x', `${trigger.left + trigger.width / 2 - box.left - panel.clientLeft}px`);
328
+ panel.style.setProperty('--_tooltip-arrow-y', `${trigger.top + trigger.height / 2 - box.top - panel.clientTop}px`);
329
+ };
330
+ const observer = new MutationObserver(point);
331
+ observer.observe(ref.hostElement, { attributeFilter: ['style'] });
332
+ observer.observe(pane, { attributeFilter: ['style'] });
333
+ ref.detachments().subscribe({ complete: () => observer.disconnect() });
69
334
  }
335
+
336
+ const PINNED_ATTRIBUTE = 'data-ds-tooltip-pinned';
70
337
  let nextId = 0;
338
+ /** @internal Lets a component that hosts the tooltip make a clipped host lead the tip with its own text. */
339
+ const TOOLTIP_LEADS_WITH_OWN_TEXT = new InjectionToken('TOOLTIP_LEADS_WITH_OWN_TEXT');
340
+ /** @internal Lets a component that hosts the tooltip decide `dsTooltipPinOnClick` for it. */
341
+ const TOOLTIP_PIN_ON_CLICK = new InjectionToken('TOOLTIP_PIN_ON_CLICK');
71
342
  class TooltipDirective {
72
343
  overlay = inject(Overlay);
73
344
  host = inject((ElementRef));
74
- /** Tip text. An empty string turns the tooltip off. */
345
+ document = inject(DOCUMENT);
346
+ hostPinOnClick = inject(TOOLTIP_PIN_ON_CLICK, {
347
+ self: true,
348
+ optional: true,
349
+ });
350
+ leadsWithOwnText = inject(TOOLTIP_LEADS_WITH_OWN_TEXT, { self: true, optional: true }) ??
351
+ false;
352
+ /** Tip text, or a template the panel renders as given. An empty string turns the tooltip off.
353
+ * Keep a template's content non-interactive: the panel is `role="tooltip"` and never takes focus. */
75
354
  dsTooltip = input('', ...(ngDevMode ? [{ debugName: "dsTooltip" }] : /* istanbul ignore next */ []));
76
355
  /** Which side the tip opens on. With no room there it opens on the opposite side. */
77
356
  dsTooltipPlacement = input('top', ...(ngDevMode ? [{ debugName: "dsTooltipPlacement" }] : /* istanbul ignore next */ []));
78
357
  /** Milliseconds before the tip appears. Hiding is immediate. */
79
358
  dsTooltipDelay = input(120, ...(ngDevMode ? [{ debugName: "dsTooltipDelay" }] : /* istanbul ignore next */ []));
359
+ /** Draws the arrow that points at the host. Turn it off where the tip sits flush against it. */
360
+ dsTooltipArrow = input(true, { ...(ngDevMode ? { debugName: "dsTooltipArrow" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
80
361
  /** Show the tip only while the host shows less text than it holds. Re-tested on every open.
362
+ * A boolean or the bare attribute tests the host. A selector tests the element it matches inside
363
+ * the host and discloses that element's text; while nothing matches, no clipped tip opens.
81
364
  *
82
- * Applies the tooltip on its own: without a `dsTooltip` the host's own text is disclosed. A tip
365
+ * Applies the tooltip on its own: without a `dsTooltip` the tested text is disclosed. A tip
83
366
  * whose text the host already contains sets no `aria-describedby`; one given a `dsTooltip`
84
- * that says more than the host does describes it as usual. */
85
- dsTooltipWhenClipped = input(false, { ...(ngDevMode ? { debugName: "dsTooltipWhenClipped" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
86
- /** Selector for the element inside the host whose clipping `dsTooltipWhenClipped` tests and
87
- * whose text it discloses. Resolved on every open; while nothing matches, no clipped tip opens. */
88
- dsTooltipTextSelector = input(null, ...(ngDevMode ? [{ debugName: "dsTooltipTextSelector" }] : /* istanbul ignore next */ []));
89
- /** Opens the tip with this line above `dsTooltip` while the host shows less text than it holds.
90
- * The tip keeps its own line break, so the two read as separate lines. */
91
- dsTooltipClippedLead = input('', ...(ngDevMode ? [{ debugName: "dsTooltipClippedLead" }] : /* istanbul ignore next */ []));
367
+ * that says more than the host does describes it as usual.
368
+ *
369
+ * Keyboard focus opens it too: on the host, on a control or widget around it, or on a control
370
+ * inside it. A clipped host that none of these reaches takes `tabindex="0"` while it is clipped. */
371
+ dsTooltipWhenClipped = input(null, { ...(ngDevMode ? { debugName: "dsTooltipWhenClipped" } : /* istanbul ignore next */ {}), transform: toClipTarget });
372
+ /** Opens the tip with no delay, and a click on the host keeps it open after the pointer leaves
373
+ * until a click outside, `Escape` or blur; a second click closes it. Without it a click closes the tip.
374
+ * While pinned the host carries `data-ds-tooltip-pinned`, a hook for styling the pinned trigger. */
375
+ dsTooltipPinOnClick = input(false, { ...(ngDevMode ? { debugName: "dsTooltipPinOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
376
+ isClipped() {
377
+ return isHostClipped(this.hostElement, this.dsTooltipWhenClipped());
378
+ }
92
379
  get hostElement() {
93
380
  return this.host.nativeElement;
94
381
  }
95
- textElement() {
96
- const selector = this.dsTooltipTextSelector();
97
- return selector
98
- ? this.hostElement.querySelector(selector)
99
- : this.hostElement;
382
+ pinsOnClick() {
383
+ return this.hostPinOnClick?.() ?? this.dsTooltipPinOnClick();
100
384
  }
101
- isClipped() {
102
- const textElement = this.textElement();
103
- return textElement !== null && isTextClipped(textElement);
385
+ ownText() {
386
+ return ownTextOf(clipElement(this.hostElement, this.dsTooltipWhenClipped()));
104
387
  }
105
- tipText() {
388
+ /** A host that leads with its own text puts it, in bold, above the tip while it is clipped, unless the tip already says it. */
389
+ tipContent() {
106
390
  const given = this.dsTooltip();
107
- const lead = this.dsTooltipClippedLead();
108
- if (given && lead && this.isClipped()) {
109
- return `${lead}
110
- ${given}`;
111
- }
112
- if (given || !this.dsTooltipWhenClipped()) {
391
+ if (given instanceof TemplateRef) {
113
392
  return given;
114
393
  }
115
- return (this.textElement()?.textContent ?? '').trim();
394
+ const own = this.ownText();
395
+ if (!given) {
396
+ return this.dsTooltipWhenClipped() ? escapeTooltipMarkup(own) : '';
397
+ }
398
+ if (this.leadsWithOwnText &&
399
+ own &&
400
+ this.isClipped() &&
401
+ !textContains(plainTooltipText(given), own)) {
402
+ return `**${escapeTooltipMarkup(own)}**
403
+ ${given}`;
404
+ }
405
+ return given;
116
406
  }
117
407
  /** A clipped host's full text is already in the DOM; describing it again would announce it twice. */
118
408
  disclosesOwnText(text) {
119
409
  if (!this.dsTooltipWhenClipped()) {
120
410
  return false;
121
411
  }
122
- const collapse = (value) => value.replace(/\s+/g, ' ').trim();
123
- return collapse(this.textElement()?.textContent ?? '').includes(collapse(text));
412
+ return textContains(this.ownText(), plainTooltipText(text));
124
413
  }
125
414
  ref = null;
126
415
  timer = null;
416
+ unpin = null;
127
417
  tipId = `ds-tooltip-${++nextId}`;
128
418
  /**
129
419
  * Where `aria-describedby` belongs when focus is involved: a non-focusable host
@@ -137,51 +427,26 @@ ${given}`;
137
427
  */
138
428
  describedElement = null;
139
429
  detachAncestor = null;
140
- constructor() {
141
- afterNextRender(() => this.listenToFocusableAncestor());
142
- }
143
- /** `:focus-visible` keeps a click from opening it. Only the first clipped host of one ancestor opens. */
144
- listenToFocusableAncestor() {
145
- const host = this.host.nativeElement;
146
- if (!this.dsTooltipWhenClipped() || host.matches(FOCUSABLE)) {
147
- return;
148
- }
149
- const ancestor = host.parentElement?.closest(FOCUSABLE);
150
- if (!ancestor?.matches(INTERACTIVE)) {
151
- return;
152
- }
153
- let tooltips = clippedHostsByAncestor.get(ancestor);
154
- if (!tooltips) {
155
- tooltips = new Set();
156
- clippedHostsByAncestor.set(ancestor, tooltips);
157
- }
158
- tooltips.add(this);
159
- const open = (event) => {
160
- if (event.target !== ancestor ||
161
- // Tested here, not at registration: a disabled trigger carries tabindex="-1" until enabled.
162
- !ancestor.matches(KEYBOARD_FOCUSABLE) ||
163
- !ancestor.matches(':focus-visible') ||
164
- firstClippedHost(tooltips) !== this) {
165
- return;
166
- }
430
+ ancestorFocusTrigger = {
431
+ host: this.hostElement,
432
+ isClipped: () => this.isClipped(),
433
+ openFor: (ancestor) => {
167
434
  this.focusedTarget = ancestor;
168
435
  this.scheduleShow();
169
- };
170
- const close = () => {
436
+ },
437
+ close: () => {
171
438
  this.focusedTarget = null;
172
439
  this.onClose();
173
- };
174
- ancestor.addEventListener('focusin', open);
175
- ancestor.addEventListener('focusout', close);
176
- ancestor.addEventListener('click', close);
177
- ancestor.addEventListener('keydown', close);
178
- this.detachAncestor = () => {
179
- tooltips.delete(this);
180
- ancestor.removeEventListener('focusin', open);
181
- ancestor.removeEventListener('focusout', close);
182
- ancestor.removeEventListener('click', close);
183
- ancestor.removeEventListener('keydown', close);
184
- };
440
+ },
441
+ };
442
+ constructor() {
443
+ afterNextRender(() => {
444
+ if (this.dsTooltipWhenClipped()) {
445
+ this.detachAncestor =
446
+ watchFocusableAncestor(this.ancestorFocusTrigger) ??
447
+ tabStopWhileClipped(this.ancestorFocusTrigger);
448
+ }
449
+ });
185
450
  }
186
451
  onPointerEnter() {
187
452
  this.scheduleShow();
@@ -204,7 +469,10 @@ ${given}`;
204
469
  this.onClose();
205
470
  }
206
471
  scheduleShow() {
207
- if (!this.tipText()) {
472
+ if (this.unpin || !this.tipContent()) {
473
+ return;
474
+ }
475
+ if (this.pinsOnClick() && this.ref?.hasAttached()) {
208
476
  return;
209
477
  }
210
478
  if (this.dsTooltipWhenClipped() && !this.isClipped()) {
@@ -213,16 +481,58 @@ ${given}`;
213
481
  if (this.timer !== null) {
214
482
  clearTimeout(this.timer);
215
483
  }
216
- this.timer = window.setTimeout(() => this.show(), this.dsTooltipDelay());
484
+ this.timer = window.setTimeout(() => this.show(), this.pinsOnClick() ? 0 : this.dsTooltipDelay());
485
+ }
486
+ onPointerLeave() {
487
+ if (!this.unpin) {
488
+ this.onClose();
489
+ }
217
490
  }
218
491
  // Close on click too: a re-rendered anchor under a stationary cursor fires no mouseleave.
492
+ onClick() {
493
+ if (this.pinsOnClick() && !this.unpin) {
494
+ this.pin();
495
+ }
496
+ else {
497
+ this.onClose();
498
+ }
499
+ }
219
500
  onClose() {
220
501
  if (this.timer !== null) {
221
502
  clearTimeout(this.timer);
222
503
  this.timer = null;
223
504
  }
505
+ this.unpin?.();
224
506
  this.disposeRef();
225
507
  }
508
+ pin() {
509
+ if (this.timer !== null) {
510
+ clearTimeout(this.timer);
511
+ this.timer = null;
512
+ }
513
+ if (!this.ref?.hasAttached()) {
514
+ if (!this.tipContent()) {
515
+ return;
516
+ }
517
+ this.show();
518
+ }
519
+ const closeOutside = (event) => {
520
+ const target = event.target;
521
+ if (!this.hostElement.contains(target) &&
522
+ !this.ref?.overlayElement.contains(target)) {
523
+ this.onClose();
524
+ }
525
+ };
526
+ this.document.addEventListener('pointerdown', closeOutside, true);
527
+ const stopEscape = listenForEscape(this.document, () => this.onClose());
528
+ this.hostElement.setAttribute(PINNED_ATTRIBUTE, '');
529
+ this.unpin = () => {
530
+ this.unpin = null;
531
+ this.hostElement.removeAttribute(PINNED_ATTRIBUTE);
532
+ this.document.removeEventListener('pointerdown', closeOutside, true);
533
+ stopEscape();
534
+ };
535
+ }
226
536
  disposeRef() {
227
537
  this.ref?.dispose();
228
538
  this.ref = null;
@@ -259,10 +569,7 @@ ${given}`;
259
569
  const positionStrategy = this.overlay
260
570
  .position()
261
571
  .flexibleConnectedTo(this.host)
262
- .withPositions([
263
- this.positionFor(placement),
264
- this.positionFor(OPPOSITE_PLACEMENT[placement]),
265
- ])
572
+ .withPositions(positionsFor(placement))
266
573
  .withViewportMargin(VIEWPORT_MARGIN_PX);
267
574
  this.ref = this.overlay.create({
268
575
  positionStrategy,
@@ -270,13 +577,19 @@ ${given}`;
270
577
  scrollStrategy: this.overlay.scrollStrategies.close(),
271
578
  });
272
579
  prepareOverlayEnter(this.ref, this.host.nativeElement, positionStrategy);
580
+ // The CDK strategy sees only the window and cdkScrollable ancestors, not a plain overflow container.
581
+ const stopScrollClose = closeOnScroll(this.ref, () => this.onClose());
582
+ this.ref.detachments().subscribe(stopScrollClose);
273
583
  const cmpRef = this.ref.attach(new ComponentPortal(TooltipPanelComponent));
274
- const text = this.tipText();
275
- cmpRef.setInput('text', text);
584
+ const tip = this.tipContent();
585
+ cmpRef.setInput('text', tip);
276
586
  cmpRef.setInput('placement', placement);
587
+ cmpRef.setInput('arrow', this.dsTooltipArrow());
277
588
  positionStrategy.positionChanges.subscribe(({ connectionPair }) => cmpRef.setInput('placement', overlayPlacementOf(connectionPair.overlayY, connectionPair.overlayX)));
278
589
  cmpRef.setInput('panelId', this.tipId);
279
- if (this.disclosesOwnText(text)) {
590
+ pointArrowAtHost(this.ref, cmpRef.location.nativeElement, this.hostElement);
591
+ this.ref.detachments().subscribe(() => this.unpin?.());
592
+ if (typeof tip === 'string' && this.disclosesOwnText(tip)) {
280
593
  return;
281
594
  }
282
595
  const described = this.focusedTarget ?? this.host.nativeElement;
@@ -284,48 +597,12 @@ ${given}`;
284
597
  const existing = described.getAttribute('aria-describedby');
285
598
  described.setAttribute('aria-describedby', existing ? `${existing} ${this.tipId}` : this.tipId);
286
599
  }
287
- positionFor(placement) {
288
- switch (placement) {
289
- case 'top':
290
- return {
291
- originX: 'center',
292
- originY: 'top',
293
- overlayX: 'center',
294
- overlayY: 'bottom',
295
- offsetY: -TRIGGER_GAP_PX,
296
- };
297
- case 'bottom':
298
- return {
299
- originX: 'center',
300
- originY: 'bottom',
301
- overlayX: 'center',
302
- overlayY: 'top',
303
- offsetY: TRIGGER_GAP_PX,
304
- };
305
- case 'left':
306
- return {
307
- originX: 'start',
308
- originY: 'center',
309
- overlayX: 'end',
310
- overlayY: 'center',
311
- offsetX: -TRIGGER_GAP_PX,
312
- };
313
- case 'right':
314
- return {
315
- originX: 'end',
316
- originY: 'center',
317
- overlayX: 'start',
318
- overlayY: 'center',
319
- offsetX: TRIGGER_GAP_PX,
320
- };
321
- }
322
- }
323
600
  ngOnDestroy() {
324
601
  this.detachAncestor?.();
325
602
  this.onClose();
326
603
  }
327
604
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
328
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.22", type: TooltipDirective, isStandalone: true, selector: "[dsTooltip], [dsTooltipWhenClipped]", inputs: { dsTooltip: { classPropertyName: "dsTooltip", publicName: "dsTooltip", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipPlacement: { classPropertyName: "dsTooltipPlacement", publicName: "dsTooltipPlacement", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipDelay: { classPropertyName: "dsTooltipDelay", publicName: "dsTooltipDelay", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipWhenClipped: { classPropertyName: "dsTooltipWhenClipped", publicName: "dsTooltipWhenClipped", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipTextSelector: { classPropertyName: "dsTooltipTextSelector", publicName: "dsTooltipTextSelector", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipClippedLead: { classPropertyName: "dsTooltipClippedLead", publicName: "dsTooltipClippedLead", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onPointerEnter()", "focusin": "onFocusIn($event)", "focusout": "onFocusOut()", "mouseleave": "onClose()", "click": "onClose()", "keydown": "onKeydown()", "keydown.escape": "onEscape()" } }, ngImport: i0 });
605
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.22", type: TooltipDirective, isStandalone: true, selector: "[dsTooltip], [dsTooltipWhenClipped]", inputs: { dsTooltip: { classPropertyName: "dsTooltip", publicName: "dsTooltip", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipPlacement: { classPropertyName: "dsTooltipPlacement", publicName: "dsTooltipPlacement", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipDelay: { classPropertyName: "dsTooltipDelay", publicName: "dsTooltipDelay", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipArrow: { classPropertyName: "dsTooltipArrow", publicName: "dsTooltipArrow", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipWhenClipped: { classPropertyName: "dsTooltipWhenClipped", publicName: "dsTooltipWhenClipped", isSignal: true, isRequired: false, transformFunction: null }, dsTooltipPinOnClick: { classPropertyName: "dsTooltipPinOnClick", publicName: "dsTooltipPinOnClick", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onPointerEnter()", "focusin": "onFocusIn($event)", "focusout": "onFocusOut()", "mouseleave": "onPointerLeave()", "click": "onClick()", "keydown": "onKeydown()", "keydown.escape": "onEscape()" } }, ngImport: i0 });
329
606
  }
330
607
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TooltipDirective, decorators: [{
331
608
  type: Directive,
@@ -333,7 +610,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
333
610
  selector: '[dsTooltip], [dsTooltipWhenClipped]',
334
611
  standalone: true,
335
612
  }]
336
- }], ctorParameters: () => [], propDecorators: { dsTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltip", required: false }] }], dsTooltipPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipPlacement", required: false }] }], dsTooltipDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipDelay", required: false }] }], dsTooltipWhenClipped: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipWhenClipped", required: false }] }], dsTooltipTextSelector: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipTextSelector", required: false }] }], dsTooltipClippedLead: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipClippedLead", required: false }] }], onPointerEnter: [{
613
+ }], ctorParameters: () => [], propDecorators: { dsTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltip", required: false }] }], dsTooltipPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipPlacement", required: false }] }], dsTooltipDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipDelay", required: false }] }], dsTooltipArrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipArrow", required: false }] }], dsTooltipWhenClipped: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipWhenClipped", required: false }] }], dsTooltipPinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsTooltipPinOnClick", required: false }] }], onPointerEnter: [{
337
614
  type: HostListener,
338
615
  args: ['mouseenter']
339
616
  }], onFocusIn: [{
@@ -342,10 +619,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
342
619
  }], onFocusOut: [{
343
620
  type: HostListener,
344
621
  args: ['focusout']
345
- }], onClose: [{
622
+ }], onPointerLeave: [{
346
623
  type: HostListener,
347
624
  args: ['mouseleave']
348
- }, {
625
+ }], onClick: [{
349
626
  type: HostListener,
350
627
  args: ['click']
351
628
  }], onKeydown: [{
@@ -360,5 +637,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
360
637
  * Generated bundle index. Do not edit.
361
638
  */
362
639
 
363
- export { TooltipDirective, TooltipPanelComponent };
640
+ export { TOOLTIP_LEADS_WITH_OWN_TEXT, TOOLTIP_PIN_ON_CLICK, TooltipDirective, TooltipPanelComponent };
364
641
  //# sourceMappingURL=ids-group-ltd-ids-design-system-components-tooltip.mjs.map