@educarehq/solaris-ui 0.1.0 → 0.2.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 (393) hide show
  1. package/educarehq-solaris-ui.d.ts +5 -0
  2. package/esm2022/educarehq-solaris-ui.js +5 -0
  3. package/esm2022/educarehq-solaris-ui.js.map +1 -0
  4. package/esm2022/index.js +70 -0
  5. package/esm2022/index.js.map +1 -0
  6. package/esm2022/lib/components/actions/button/directives/button-icon.directive.js +17 -0
  7. package/esm2022/lib/components/actions/button/directives/button-icon.directive.js.map +1 -0
  8. package/esm2022/lib/components/actions/button/directives/button.directive.js +60 -0
  9. package/esm2022/lib/components/actions/button/directives/button.directive.js.map +1 -0
  10. package/esm2022/lib/components/actions/button/model/button.types.js +1 -0
  11. package/esm2022/lib/components/actions/button/model/button.types.js.map +1 -0
  12. package/esm2022/lib/components/actions/button-group/component/button-group.component.js +21 -0
  13. package/esm2022/lib/components/actions/button-group/component/button-group.component.js.map +1 -0
  14. package/esm2022/lib/components/actions/button-group/model/button-group.types.js +1 -0
  15. package/esm2022/lib/components/actions/button-group/model/button-group.types.js.map +1 -0
  16. package/esm2022/lib/components/actions/icon-button/directives/icon-button-badge.directive.js +17 -0
  17. package/esm2022/lib/components/actions/icon-button/directives/icon-button-badge.directive.js.map +1 -0
  18. package/esm2022/lib/components/actions/icon-button/directives/icon-button.directive.js +58 -0
  19. package/esm2022/lib/components/actions/icon-button/directives/icon-button.directive.js.map +1 -0
  20. package/esm2022/lib/components/actions/icon-button/model/icon-button.types.js +1 -0
  21. package/esm2022/lib/components/actions/icon-button/model/icon-button.types.js.map +1 -0
  22. package/esm2022/lib/components/data-display/badge/component/badge.component.js +24 -0
  23. package/esm2022/lib/components/data-display/badge/component/badge.component.js.map +1 -0
  24. package/esm2022/lib/components/data-display/badge/directives/badge-icon.directive.js +17 -0
  25. package/esm2022/lib/components/data-display/badge/directives/badge-icon.directive.js.map +1 -0
  26. package/esm2022/lib/components/data-display/badge/model/badge.types.js +1 -0
  27. package/esm2022/lib/components/data-display/badge/model/badge.types.js.map +1 -0
  28. package/esm2022/lib/components/data-display/card/component/card.component.js +20 -0
  29. package/esm2022/lib/components/data-display/card/component/card.component.js.map +1 -0
  30. package/esm2022/lib/components/data-display/card/directives/card-actions.directive.js +17 -0
  31. package/esm2022/lib/components/data-display/card/directives/card-actions.directive.js.map +1 -0
  32. package/esm2022/lib/components/data-display/card/directives/card-content.directive.js +17 -0
  33. package/esm2022/lib/components/data-display/card/directives/card-content.directive.js.map +1 -0
  34. package/esm2022/lib/components/data-display/card/directives/card-description.directive.js +17 -0
  35. package/esm2022/lib/components/data-display/card/directives/card-description.directive.js.map +1 -0
  36. package/esm2022/lib/components/data-display/card/directives/card-footer.directive.js +19 -0
  37. package/esm2022/lib/components/data-display/card/directives/card-footer.directive.js.map +1 -0
  38. package/esm2022/lib/components/data-display/card/directives/card-header.directive.js +17 -0
  39. package/esm2022/lib/components/data-display/card/directives/card-header.directive.js.map +1 -0
  40. package/esm2022/lib/components/data-display/card/directives/card-media.directive.js +17 -0
  41. package/esm2022/lib/components/data-display/card/directives/card-media.directive.js.map +1 -0
  42. package/esm2022/lib/components/data-display/card/directives/card-title.directive.js +17 -0
  43. package/esm2022/lib/components/data-display/card/directives/card-title.directive.js.map +1 -0
  44. package/esm2022/lib/components/data-display/card/model/card.types.js +1 -0
  45. package/esm2022/lib/components/data-display/card/model/card.types.js.map +1 -0
  46. package/esm2022/lib/components/feedback/alert/component/alert-actions.component.js +18 -0
  47. package/esm2022/lib/components/feedback/alert/component/alert-actions.component.js.map +1 -0
  48. package/esm2022/lib/components/feedback/alert/component/alert.component.js +90 -0
  49. package/esm2022/lib/components/feedback/alert/component/alert.component.js.map +1 -0
  50. package/esm2022/lib/components/feedback/alert/directives/alert-description.directive.js +17 -0
  51. package/esm2022/lib/components/feedback/alert/directives/alert-description.directive.js.map +1 -0
  52. package/esm2022/lib/components/feedback/alert/directives/alert-title.directive.js +17 -0
  53. package/esm2022/lib/components/feedback/alert/directives/alert-title.directive.js.map +1 -0
  54. package/esm2022/lib/components/feedback/alert/model/alert.types.js +1 -0
  55. package/esm2022/lib/components/feedback/alert/model/alert.types.js.map +1 -0
  56. package/esm2022/lib/components/feedback/skeleton/component/skeleton.component.js +69 -0
  57. package/esm2022/lib/components/feedback/skeleton/component/skeleton.component.js.map +1 -0
  58. package/esm2022/lib/components/feedback/skeleton/model/skeleton.types.js +1 -0
  59. package/esm2022/lib/components/feedback/skeleton/model/skeleton.types.js.map +1 -0
  60. package/esm2022/lib/components/forms/checkbox/component/checkbox.component.js +227 -0
  61. package/esm2022/lib/components/forms/checkbox/component/checkbox.component.js.map +1 -0
  62. package/esm2022/lib/components/forms/checkbox/model/checkbox.types.js +1 -0
  63. package/esm2022/lib/components/forms/checkbox/model/checkbox.types.js.map +1 -0
  64. package/esm2022/lib/components/forms/checkbox-group/component/checkbox-group.component.js +441 -0
  65. package/esm2022/lib/components/forms/checkbox-group/component/checkbox-group.component.js.map +1 -0
  66. package/esm2022/lib/components/forms/checkbox-group/model/checkbox-group.types.js +1 -0
  67. package/esm2022/lib/components/forms/checkbox-group/model/checkbox-group.types.js.map +1 -0
  68. package/esm2022/lib/components/forms/email-field/component/email-field.component.js +214 -0
  69. package/esm2022/lib/components/forms/email-field/component/email-field.component.js.map +1 -0
  70. package/esm2022/lib/components/forms/email-field/model/email-field.types.js +1 -0
  71. package/esm2022/lib/components/forms/email-field/model/email-field.types.js.map +1 -0
  72. package/esm2022/lib/components/forms/email-field/validators/email-field.validators.js +69 -0
  73. package/esm2022/lib/components/forms/email-field/validators/email-field.validators.js.map +1 -0
  74. package/esm2022/lib/components/forms/form-field/component/form-error.component.js +19 -0
  75. package/esm2022/lib/components/forms/form-field/component/form-error.component.js.map +1 -0
  76. package/esm2022/lib/components/forms/form-field/component/form-field.component.js +394 -0
  77. package/esm2022/lib/components/forms/form-field/component/form-field.component.js.map +1 -0
  78. package/esm2022/lib/components/forms/form-field/component/form-hint.component.js +18 -0
  79. package/esm2022/lib/components/forms/form-field/component/form-hint.component.js.map +1 -0
  80. package/esm2022/lib/components/forms/form-field/component/form-label.component.js +18 -0
  81. package/esm2022/lib/components/forms/form-field/component/form-label.component.js.map +1 -0
  82. package/esm2022/lib/components/forms/form-field/directives/form-field-trigger.directive.js +14 -0
  83. package/esm2022/lib/components/forms/form-field/directives/form-field-trigger.directive.js.map +1 -0
  84. package/esm2022/lib/components/forms/form-field/directives/form-prefix.directive.js +17 -0
  85. package/esm2022/lib/components/forms/form-field/directives/form-prefix.directive.js.map +1 -0
  86. package/esm2022/lib/components/forms/form-field/directives/form-suffix.directive.js +17 -0
  87. package/esm2022/lib/components/forms/form-field/directives/form-suffix.directive.js.map +1 -0
  88. package/esm2022/lib/components/forms/form-field/index.js +8 -0
  89. package/esm2022/lib/components/forms/form-field/index.js.map +1 -0
  90. package/esm2022/lib/components/forms/form-field/model/form-control.contract.js +3 -0
  91. package/esm2022/lib/components/forms/form-field/model/form-control.contract.js.map +1 -0
  92. package/esm2022/lib/components/forms/form-field/model/form-field.types.js +1 -0
  93. package/esm2022/lib/components/forms/form-field/model/form-field.types.js.map +1 -0
  94. package/esm2022/lib/components/forms/input/directives/input.directive.js +148 -0
  95. package/esm2022/lib/components/forms/input/directives/input.directive.js.map +1 -0
  96. package/esm2022/lib/components/forms/input/index.js +2 -0
  97. package/esm2022/lib/components/forms/input/index.js.map +1 -0
  98. package/esm2022/lib/components/forms/input/model/input.defaults.js +27 -0
  99. package/esm2022/lib/components/forms/input/model/input.defaults.js.map +1 -0
  100. package/esm2022/lib/components/forms/input/model/input.types.js +1 -0
  101. package/esm2022/lib/components/forms/input/model/input.types.js.map +1 -0
  102. package/esm2022/lib/components/forms/multi-select/component/multi-select.component.js +1119 -0
  103. package/esm2022/lib/components/forms/multi-select/component/multi-select.component.js.map +1 -0
  104. package/esm2022/lib/components/forms/multi-select/model/multi-select.types.js +1 -0
  105. package/esm2022/lib/components/forms/multi-select/model/multi-select.types.js.map +1 -0
  106. package/esm2022/lib/components/forms/option/component/option.component.js +149 -0
  107. package/esm2022/lib/components/forms/option/component/option.component.js.map +1 -0
  108. package/esm2022/lib/components/forms/option/directives/option-slots.directive.js +58 -0
  109. package/esm2022/lib/components/forms/option/directives/option-slots.directive.js.map +1 -0
  110. package/esm2022/lib/components/forms/option/index.js +3 -0
  111. package/esm2022/lib/components/forms/option/index.js.map +1 -0
  112. package/esm2022/lib/components/forms/option/model/option.types.js +1 -0
  113. package/esm2022/lib/components/forms/option/model/option.types.js.map +1 -0
  114. package/esm2022/lib/components/forms/option-group/component/option-group.component.js +103 -0
  115. package/esm2022/lib/components/forms/option-group/component/option-group.component.js.map +1 -0
  116. package/esm2022/lib/components/forms/option-group/index.js +2 -0
  117. package/esm2022/lib/components/forms/option-group/index.js.map +1 -0
  118. package/esm2022/lib/components/forms/option-group/model/option-group.types.js +1 -0
  119. package/esm2022/lib/components/forms/option-group/model/option-group.types.js.map +1 -0
  120. package/esm2022/lib/components/forms/password-field/component/password-field.component.js +299 -0
  121. package/esm2022/lib/components/forms/password-field/component/password-field.component.js.map +1 -0
  122. package/esm2022/lib/components/forms/password-field/model/password-field-constants.js +5 -0
  123. package/esm2022/lib/components/forms/password-field/model/password-field-constants.js.map +1 -0
  124. package/esm2022/lib/components/forms/password-field/model/password-field.types.js +1 -0
  125. package/esm2022/lib/components/forms/password-field/model/password-field.types.js.map +1 -0
  126. package/esm2022/lib/components/forms/password-field/model/password-policy.types.js +1 -0
  127. package/esm2022/lib/components/forms/password-field/model/password-policy.types.js.map +1 -0
  128. package/esm2022/lib/components/forms/password-field/model/password-strength.js +67 -0
  129. package/esm2022/lib/components/forms/password-field/model/password-strength.js.map +1 -0
  130. package/esm2022/lib/components/forms/password-field/validators/password.validator.js +45 -0
  131. package/esm2022/lib/components/forms/password-field/validators/password.validator.js.map +1 -0
  132. package/esm2022/lib/components/forms/radio/component/radio.component.js +219 -0
  133. package/esm2022/lib/components/forms/radio/component/radio.component.js.map +1 -0
  134. package/esm2022/lib/components/forms/radio/model/radio.types.js +1 -0
  135. package/esm2022/lib/components/forms/radio/model/radio.types.js.map +1 -0
  136. package/esm2022/lib/components/forms/radio-group/component/radio-group.component.js +348 -0
  137. package/esm2022/lib/components/forms/radio-group/component/radio-group.component.js.map +1 -0
  138. package/esm2022/lib/components/forms/radio-group/model/radio-group.token.js +3 -0
  139. package/esm2022/lib/components/forms/radio-group/model/radio-group.token.js.map +1 -0
  140. package/esm2022/lib/components/forms/radio-group/model/radio-group.types.js +1 -0
  141. package/esm2022/lib/components/forms/radio-group/model/radio-group.types.js.map +1 -0
  142. package/esm2022/lib/components/forms/select/component/select.component.js +819 -0
  143. package/esm2022/lib/components/forms/select/component/select.component.js.map +1 -0
  144. package/esm2022/lib/components/forms/select/model/select.types.js +1 -0
  145. package/esm2022/lib/components/forms/select/model/select.types.js.map +1 -0
  146. package/esm2022/lib/components/forms/switch/component/switch.component.js +211 -0
  147. package/esm2022/lib/components/forms/switch/component/switch.component.js.map +1 -0
  148. package/esm2022/lib/components/forms/switch/index.js +2 -0
  149. package/esm2022/lib/components/forms/switch/index.js.map +1 -0
  150. package/esm2022/lib/components/forms/switch/model/switch.types.js +1 -0
  151. package/esm2022/lib/components/forms/switch/model/switch.types.js.map +1 -0
  152. package/esm2022/lib/components/forms/switch-group/component/switch-group.component.js +369 -0
  153. package/esm2022/lib/components/forms/switch-group/component/switch-group.component.js.map +1 -0
  154. package/esm2022/lib/components/forms/switch-group/model/switch-group.types.js +1 -0
  155. package/esm2022/lib/components/forms/switch-group/model/switch-group.types.js.map +1 -0
  156. package/esm2022/lib/components/forms/textarea/directives/textarea.directive.js +137 -0
  157. package/esm2022/lib/components/forms/textarea/directives/textarea.directive.js.map +1 -0
  158. package/esm2022/lib/components/forms/textarea/model/textarea.types.js +1 -0
  159. package/esm2022/lib/components/forms/textarea/model/textarea.types.js.map +1 -0
  160. package/esm2022/lib/components/icon/component/solaris-icon.component.js +20 -0
  161. package/esm2022/lib/components/icon/component/solaris-icon.component.js.map +1 -0
  162. package/esm2022/lib/components/icon/index.js +2 -0
  163. package/esm2022/lib/components/icon/index.js.map +1 -0
  164. package/esm2022/lib/components/interaction/popover/component/popover-panel.component.js +29 -0
  165. package/esm2022/lib/components/interaction/popover/component/popover-panel.component.js.map +1 -0
  166. package/esm2022/lib/components/interaction/popover/directives/popover-trigger.directive.js +317 -0
  167. package/esm2022/lib/components/interaction/popover/directives/popover-trigger.directive.js.map +1 -0
  168. package/esm2022/lib/components/interaction/popover/directives/popover.directive.js +16 -0
  169. package/esm2022/lib/components/interaction/popover/directives/popover.directive.js.map +1 -0
  170. package/esm2022/lib/components/interaction/popover/index.js +4 -0
  171. package/esm2022/lib/components/interaction/popover/index.js.map +1 -0
  172. package/esm2022/lib/components/interaction/popover/model/popover-position.js +145 -0
  173. package/esm2022/lib/components/interaction/popover/model/popover-position.js.map +1 -0
  174. package/esm2022/lib/components/interaction/popover/model/popover.types.js +1 -0
  175. package/esm2022/lib/components/interaction/popover/model/popover.types.js.map +1 -0
  176. package/esm2022/lib/components/interaction/popover/token/popover.tokens.js +3 -0
  177. package/esm2022/lib/components/interaction/popover/token/popover.tokens.js.map +1 -0
  178. package/esm2022/lib/components/interaction/tooltip/component/tooltip-panel.component.js +23 -0
  179. package/esm2022/lib/components/interaction/tooltip/component/tooltip-panel.component.js.map +1 -0
  180. package/esm2022/lib/components/interaction/tooltip/directive/tooltip.directive.js +405 -0
  181. package/esm2022/lib/components/interaction/tooltip/directive/tooltip.directive.js.map +1 -0
  182. package/esm2022/lib/components/interaction/tooltip/index.js +3 -0
  183. package/esm2022/lib/components/interaction/tooltip/index.js.map +1 -0
  184. package/esm2022/lib/components/interaction/tooltip/model/tooltip-position.js +209 -0
  185. package/esm2022/lib/components/interaction/tooltip/model/tooltip-position.js.map +1 -0
  186. package/esm2022/lib/components/interaction/tooltip/model/tooltip.types.js +1 -0
  187. package/esm2022/lib/components/interaction/tooltip/model/tooltip.types.js.map +1 -0
  188. package/esm2022/lib/components/interaction/tooltip/token/tooltip.tokens.js +3 -0
  189. package/esm2022/lib/components/interaction/tooltip/token/tooltip.tokens.js.map +1 -0
  190. package/esm2022/lib/services/accessibility/directives/visually-hidden.directive.js +25 -0
  191. package/esm2022/lib/services/accessibility/directives/visually-hidden.directive.js.map +1 -0
  192. package/esm2022/lib/services/accessibility/model/solaris-accessibility-config.interface.js +1 -0
  193. package/esm2022/lib/services/accessibility/model/solaris-accessibility-config.interface.js.map +1 -0
  194. package/esm2022/lib/services/accessibility/model/solaris-accessibility.types.js +1 -0
  195. package/esm2022/lib/services/accessibility/model/solaris-accessibility.types.js.map +1 -0
  196. package/esm2022/lib/services/accessibility/provider/provide-solaris-accessibility.js +10 -0
  197. package/esm2022/lib/services/accessibility/provider/provide-solaris-accessibility.js.map +1 -0
  198. package/esm2022/lib/services/accessibility/service/solaris-accessibility.service.js +60 -0
  199. package/esm2022/lib/services/accessibility/service/solaris-accessibility.service.js.map +1 -0
  200. package/esm2022/lib/services/accessibility/testing/solaris-accessibility-testing.provider.js +10 -0
  201. package/esm2022/lib/services/accessibility/testing/solaris-accessibility-testing.provider.js.map +1 -0
  202. package/esm2022/lib/services/accessibility/token/solaris-accessibility.tokens.js +3 -0
  203. package/esm2022/lib/services/accessibility/token/solaris-accessibility.tokens.js.map +1 -0
  204. package/esm2022/lib/services/icon/icons/index.js +2 -0
  205. package/esm2022/lib/services/icon/icons/index.js.map +1 -0
  206. package/esm2022/lib/services/icon/icons/solaris-built-in-icons.js +207 -0
  207. package/esm2022/lib/services/icon/icons/solaris-built-in-icons.js.map +1 -0
  208. package/esm2022/lib/services/icon/index.js +5 -0
  209. package/esm2022/lib/services/icon/index.js.map +1 -0
  210. package/esm2022/lib/services/icon/model/solaris-icon-definition.interface.js +1 -0
  211. package/esm2022/lib/services/icon/model/solaris-icon-definition.interface.js.map +1 -0
  212. package/esm2022/lib/services/icon/model/solaris-icon.types.js +1 -0
  213. package/esm2022/lib/services/icon/model/solaris-icon.types.js.map +1 -0
  214. package/esm2022/lib/services/icon/provider/provide-solaris-icons.js +10 -0
  215. package/esm2022/lib/services/icon/provider/provide-solaris-icons.js.map +1 -0
  216. package/esm2022/lib/services/icon/service/solaris-icon-registry.service.js +43 -0
  217. package/esm2022/lib/services/icon/service/solaris-icon-registry.service.js.map +1 -0
  218. package/esm2022/lib/services/icon/token/solaris-icon.tokens.js +3 -0
  219. package/esm2022/lib/services/icon/token/solaris-icon.tokens.js.map +1 -0
  220. package/esm2022/lib/services/theme/model/solaris-theme-config.interface.js +1 -0
  221. package/esm2022/lib/services/theme/model/solaris-theme-config.interface.js.map +1 -0
  222. package/esm2022/lib/services/theme/model/solaris-theme.types.js +1 -0
  223. package/esm2022/lib/services/theme/model/solaris-theme.types.js.map +1 -0
  224. package/esm2022/lib/services/theme/provider/provide-solaris-theme.js +10 -0
  225. package/esm2022/lib/services/theme/provider/provide-solaris-theme.js.map +1 -0
  226. package/esm2022/lib/services/theme/service/solaris-theme.service.js +22 -0
  227. package/esm2022/lib/services/theme/service/solaris-theme.service.js.map +1 -0
  228. package/esm2022/lib/services/theme/testing/solaris-theme-testing.provider.js +10 -0
  229. package/esm2022/lib/services/theme/testing/solaris-theme-testing.provider.js.map +1 -0
  230. package/esm2022/lib/services/theme/token/solaris-theme.tokens.js +3 -0
  231. package/esm2022/lib/services/theme/token/solaris-theme.tokens.js.map +1 -0
  232. package/esm2022/lib/services/translation/index.js +6 -0
  233. package/esm2022/lib/services/translation/index.js.map +1 -0
  234. package/esm2022/lib/services/translation/model/solaris-locale.types.js +1 -0
  235. package/esm2022/lib/services/translation/model/solaris-locale.types.js.map +1 -0
  236. package/esm2022/lib/services/translation/model/solaris-translate-config.interface.js +1 -0
  237. package/esm2022/lib/services/translation/model/solaris-translate-config.interface.js.map +1 -0
  238. package/esm2022/lib/services/translation/model/solaris-translate-defaults.js +40 -0
  239. package/esm2022/lib/services/translation/model/solaris-translate-defaults.js.map +1 -0
  240. package/esm2022/lib/services/translation/model/solaris-translation.types.js +1 -0
  241. package/esm2022/lib/services/translation/model/solaris-translation.types.js.map +1 -0
  242. package/esm2022/lib/services/translation/pipe/solaris-translate.pipe.js +20 -0
  243. package/esm2022/lib/services/translation/pipe/solaris-translate.pipe.js.map +1 -0
  244. package/esm2022/lib/services/translation/provider/provide-solaris-translate.js +10 -0
  245. package/esm2022/lib/services/translation/provider/provide-solaris-translate.js.map +1 -0
  246. package/esm2022/lib/services/translation/service/solaris-translate.service.js +87 -0
  247. package/esm2022/lib/services/translation/service/solaris-translate.service.js.map +1 -0
  248. package/esm2022/lib/services/translation/testing/solaris-translate-testing.provider.js +32 -0
  249. package/esm2022/lib/services/translation/testing/solaris-translate-testing.provider.js.map +1 -0
  250. package/esm2022/lib/services/translation/token/solaris-translate.tokens.js +3 -0
  251. package/esm2022/lib/services/translation/token/solaris-translate.tokens.js.map +1 -0
  252. package/esm2022/lib/testing/provide-solaris-testing.js +11 -0
  253. package/esm2022/lib/testing/provide-solaris-testing.js.map +1 -0
  254. package/esm2022/lib/testing/solaris-test-utilities.js +12 -0
  255. package/esm2022/lib/testing/solaris-test-utilities.js.map +1 -0
  256. package/index.d.ts +106 -0
  257. package/lib/components/actions/button/directives/button-icon.directive.d.ts +5 -0
  258. package/lib/components/actions/button/directives/button.directive.d.ts +22 -0
  259. package/lib/components/actions/button/model/button.types.d.ts +5 -0
  260. package/lib/components/actions/button-group/component/button-group.component.d.ts +10 -0
  261. package/lib/components/actions/button-group/model/button-group.types.d.ts +2 -0
  262. package/lib/components/actions/icon-button/directives/icon-button-badge.directive.d.ts +5 -0
  263. package/lib/components/actions/icon-button/directives/icon-button.directive.d.ts +21 -0
  264. package/lib/components/actions/icon-button/model/icon-button.types.d.ts +5 -0
  265. package/lib/components/data-display/badge/component/badge.component.d.ts +12 -0
  266. package/lib/components/data-display/badge/directives/badge-icon.directive.d.ts +5 -0
  267. package/lib/components/data-display/badge/model/badge.types.d.ts +6 -0
  268. package/lib/components/data-display/card/component/card.component.d.ts +10 -0
  269. package/lib/components/data-display/card/directives/card-actions.directive.d.ts +5 -0
  270. package/lib/components/data-display/card/directives/card-content.directive.d.ts +5 -0
  271. package/lib/components/data-display/card/directives/card-description.directive.d.ts +5 -0
  272. package/lib/components/data-display/card/directives/card-footer.directive.d.ts +6 -0
  273. package/lib/components/data-display/card/directives/card-header.directive.d.ts +5 -0
  274. package/lib/components/data-display/card/directives/card-media.directive.d.ts +5 -0
  275. package/lib/components/data-display/card/directives/card-title.directive.d.ts +5 -0
  276. package/lib/components/data-display/card/model/card.types.d.ts +4 -0
  277. package/lib/components/feedback/alert/component/alert-actions.component.d.ts +5 -0
  278. package/lib/components/feedback/alert/component/alert.component.d.ts +26 -0
  279. package/lib/components/feedback/alert/directives/alert-description.directive.d.ts +5 -0
  280. package/lib/components/feedback/alert/directives/alert-title.directive.d.ts +5 -0
  281. package/lib/components/feedback/alert/model/alert.types.d.ts +5 -0
  282. package/lib/components/feedback/skeleton/component/skeleton.component.d.ts +17 -0
  283. package/lib/components/feedback/skeleton/model/skeleton.types.d.ts +5 -0
  284. package/lib/components/forms/checkbox/component/checkbox.component.d.ts +70 -0
  285. package/lib/components/forms/checkbox/model/checkbox.types.d.ts +5 -0
  286. package/lib/components/forms/checkbox-group/component/checkbox-group.component.d.ts +123 -0
  287. package/lib/components/forms/checkbox-group/model/checkbox-group.types.d.ts +5 -0
  288. package/lib/components/forms/email-field/component/email-field.component.d.ts +66 -0
  289. package/lib/components/forms/email-field/model/email-field.types.d.ts +6 -0
  290. package/lib/components/forms/email-field/validators/email-field.validators.d.ts +8 -0
  291. package/lib/components/forms/form-field/component/form-error.component.d.ts +5 -0
  292. package/lib/components/forms/form-field/component/form-field.component.d.ts +90 -0
  293. package/lib/components/forms/form-field/component/form-hint.component.d.ts +5 -0
  294. package/lib/components/forms/form-field/component/form-label.component.d.ts +5 -0
  295. package/lib/components/forms/form-field/directives/form-field-trigger.directive.d.ts +5 -0
  296. package/lib/components/forms/form-field/directives/form-prefix.directive.d.ts +5 -0
  297. package/lib/components/forms/form-field/directives/form-suffix.directive.d.ts +5 -0
  298. package/lib/components/forms/form-field/index.d.ts +8 -0
  299. package/lib/components/forms/form-field/model/form-control.contract.d.ts +11 -0
  300. package/lib/components/forms/form-field/model/form-field.types.d.ts +5 -0
  301. package/lib/components/forms/input/directives/input.directive.d.ts +37 -0
  302. package/lib/components/forms/input/index.d.ts +2 -0
  303. package/lib/components/forms/input/model/input.defaults.d.ts +2 -0
  304. package/lib/components/forms/input/model/input.types.d.ts +4 -0
  305. package/lib/components/forms/multi-select/component/multi-select.component.d.ts +202 -0
  306. package/lib/components/forms/multi-select/model/multi-select.types.d.ts +5 -0
  307. package/lib/components/forms/option/component/option.component.d.ts +58 -0
  308. package/lib/components/forms/option/directives/option-slots.directive.d.ts +21 -0
  309. package/lib/components/forms/option/index.d.ts +3 -0
  310. package/lib/components/forms/option/model/option.types.d.ts +3 -0
  311. package/lib/components/forms/option-group/component/option-group.component.d.ts +32 -0
  312. package/lib/components/forms/option-group/index.d.ts +2 -0
  313. package/lib/components/forms/option-group/model/option-group.types.d.ts +2 -0
  314. package/lib/components/forms/password-field/component/password-field.component.d.ts +81 -0
  315. package/lib/components/forms/password-field/model/password-field-constants.d.ts +4 -0
  316. package/lib/components/forms/password-field/model/password-field.types.d.ts +6 -0
  317. package/lib/components/forms/password-field/model/password-policy.types.d.ts +10 -0
  318. package/lib/components/forms/password-field/model/password-strength.d.ts +2 -0
  319. package/lib/components/forms/password-field/validators/password.validator.d.ts +3 -0
  320. package/lib/components/forms/radio/component/radio.component.d.ts +68 -0
  321. package/lib/components/forms/radio/model/radio.types.d.ts +4 -0
  322. package/lib/components/forms/radio-group/component/radio-group.component.d.ts +86 -0
  323. package/lib/components/forms/radio-group/model/radio-group.token.d.ts +2 -0
  324. package/lib/components/forms/radio-group/model/radio-group.types.d.ts +5 -0
  325. package/lib/components/forms/select/component/select.component.d.ts +158 -0
  326. package/lib/components/forms/select/model/select.types.d.ts +4 -0
  327. package/lib/components/forms/switch/component/switch.component.d.ts +66 -0
  328. package/lib/components/forms/switch/index.d.ts +2 -0
  329. package/lib/components/forms/switch/model/switch.types.d.ts +4 -0
  330. package/lib/components/forms/switch-group/component/switch-group.component.d.ts +91 -0
  331. package/lib/components/forms/switch-group/model/switch-group.types.d.ts +5 -0
  332. package/lib/components/forms/textarea/directives/textarea.directive.d.ts +37 -0
  333. package/lib/components/forms/textarea/model/textarea.types.d.ts +5 -0
  334. package/lib/components/icon/component/solaris-icon.component.d.ts +13 -0
  335. package/lib/components/icon/index.d.ts +1 -0
  336. package/lib/components/interaction/popover/component/popover-panel.component.d.ts +10 -0
  337. package/lib/components/interaction/popover/directives/popover-trigger.directive.d.ts +65 -0
  338. package/lib/components/interaction/popover/directives/popover.directive.d.ts +7 -0
  339. package/lib/components/interaction/popover/index.d.ts +4 -0
  340. package/lib/components/interaction/popover/model/popover-position.d.ts +4 -0
  341. package/lib/components/interaction/popover/model/popover.types.d.ts +7 -0
  342. package/lib/components/interaction/popover/token/popover.tokens.d.ts +12 -0
  343. package/lib/components/interaction/tooltip/component/tooltip-panel.component.d.ts +9 -0
  344. package/lib/components/interaction/tooltip/directive/tooltip.directive.d.ts +80 -0
  345. package/lib/components/interaction/tooltip/index.d.ts +3 -0
  346. package/lib/components/interaction/tooltip/model/tooltip-position.d.ts +5 -0
  347. package/lib/components/interaction/tooltip/model/tooltip.types.d.ts +22 -0
  348. package/lib/components/interaction/tooltip/token/tooltip.tokens.d.ts +21 -0
  349. package/lib/services/accessibility/directives/visually-hidden.directive.d.ts +5 -0
  350. package/lib/services/accessibility/model/solaris-accessibility-config.interface.d.ts +4 -0
  351. package/lib/services/accessibility/model/solaris-accessibility.types.d.ts +5 -0
  352. package/lib/services/accessibility/provider/provide-solaris-accessibility.d.ts +3 -0
  353. package/lib/services/accessibility/service/solaris-accessibility.service.d.ts +15 -0
  354. package/lib/services/accessibility/testing/solaris-accessibility-testing.provider.d.ts +3 -0
  355. package/lib/services/accessibility/token/solaris-accessibility.tokens.d.ts +3 -0
  356. package/lib/services/icon/icons/index.d.ts +1 -0
  357. package/lib/services/icon/icons/solaris-built-in-icons.d.ts +2 -0
  358. package/lib/services/icon/index.d.ts +8 -0
  359. package/lib/services/icon/model/solaris-icon-definition.interface.d.ts +36 -0
  360. package/lib/services/icon/model/solaris-icon.types.d.ts +4 -0
  361. package/lib/services/icon/provider/provide-solaris-icons.d.ts +3 -0
  362. package/lib/services/icon/service/solaris-icon-registry.service.d.ts +12 -0
  363. package/lib/services/icon/token/solaris-icon.tokens.d.ts +6 -0
  364. package/lib/services/theme/model/solaris-theme-config.interface.d.ts +5 -0
  365. package/lib/services/theme/model/solaris-theme.types.d.ts +3 -0
  366. package/lib/services/theme/provider/provide-solaris-theme.d.ts +3 -0
  367. package/lib/services/theme/service/solaris-theme.service.d.ts +9 -0
  368. package/lib/services/theme/testing/solaris-theme-testing.provider.d.ts +3 -0
  369. package/lib/services/theme/token/solaris-theme.tokens.d.ts +3 -0
  370. package/lib/services/translation/index.d.ts +8 -0
  371. package/lib/services/translation/model/solaris-locale.types.d.ts +4 -0
  372. package/lib/services/translation/model/solaris-translate-config.interface.d.ts +8 -0
  373. package/lib/services/translation/model/solaris-translate-defaults.d.ts +2 -0
  374. package/lib/services/translation/model/solaris-translation.types.d.ts +3 -0
  375. package/lib/services/translation/pipe/solaris-translate.pipe.d.ts +8 -0
  376. package/lib/services/translation/provider/provide-solaris-translate.d.ts +3 -0
  377. package/lib/services/translation/service/solaris-translate.service.d.ts +15 -0
  378. package/lib/services/translation/testing/solaris-translate-testing.provider.d.ts +3 -0
  379. package/lib/services/translation/token/solaris-translate.tokens.d.ts +3 -0
  380. package/lib/testing/provide-solaris-testing.d.ts +10 -0
  381. package/lib/testing/solaris-test-utilities.d.ts +3 -0
  382. package/package.json +9 -5
  383. package/styles/_button.scss +50 -220
  384. package/styles/_core.scss +37 -37
  385. package/styles/_icon-button.scss +43 -219
  386. package/styles/_index.scss +19 -19
  387. package/styles/_input.scss +255 -0
  388. package/styles/_popover.scss +68 -0
  389. package/styles/_theme.scss +36 -36
  390. package/styles/_tooltip.scss +3 -0
  391. package/fesm2022/educarehq-solaris-ui.mjs +0 -1047
  392. package/fesm2022/educarehq-solaris-ui.mjs.map +0 -1
  393. package/types/educarehq-solaris-ui.d.ts +0 -408
@@ -0,0 +1,405 @@
1
+ import { Directive, ElementRef, Injector, ViewContainerRef, computed, effect, inject, input, output, signal, DestroyRef, HostListener, booleanAttribute, numberAttribute, NgZone, } from '@angular/core';
2
+ import { DOCUMENT } from '@angular/common';
3
+ import { Overlay, OverlayConfig, } from '@angular/cdk/overlay';
4
+ import { ComponentPortal } from '@angular/cdk/portal';
5
+ import { SolarisTranslateService } from '../../../../services/translation';
6
+ import { SolarisTooltipPanelComponent } from '../component/tooltip-panel.component';
7
+ import { SOLARIS_TOOLTIP_PANEL_DATA, } from '../token/tooltip.tokens';
8
+ import { getTooltipPositions, getTooltipArrowClass, derivePlacementFromConnectionPair, } from '../model/tooltip-position';
9
+ import * as i0 from "@angular/core";
10
+ let nextPanelId = 0;
11
+ const TOOLTIP_TRIGGER_GAP = 3;
12
+ const ARROW_SIZE_PX = {
13
+ sm: 12,
14
+ md: 20,
15
+ lg: 24,
16
+ };
17
+ export class SolarisTooltipDirective {
18
+ overlay = inject(Overlay);
19
+ elementRef = inject(ElementRef);
20
+ viewContainerRef = inject(ViewContainerRef);
21
+ injector = inject(Injector);
22
+ document = inject(DOCUMENT);
23
+ destroyRef = inject(DestroyRef);
24
+ translate = inject(SolarisTranslateService);
25
+ ngZone = inject(NgZone);
26
+ panelId = `solaris-tooltip-panel-${++nextPanelId}`;
27
+ isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
28
+ isClickTrigger = computed(() => this.solarisTooltipTrigger() === 'click', ...(ngDevMode ? [{ debugName: "isClickTrigger" }] : /* istanbul ignore next */ []));
29
+ overlayRef = null;
30
+ outsideClickCleanup = null;
31
+ previousActiveElement = null;
32
+ hoverTimeout = null;
33
+ isHovered = false;
34
+ isFocused = false;
35
+ tooltipComponentRef = null;
36
+ positionChangesSub = null;
37
+ currentPlacement = 'top';
38
+ solarisTooltip = input(undefined, { ...(ngDevMode ? { debugName: "solarisTooltip" } : /* istanbul ignore next */ {}), alias: 'solarisTooltip' });
39
+ solarisTooltipKey = input(undefined, { ...(ngDevMode ? { debugName: "solarisTooltipKey" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipKey' });
40
+ solarisTooltipFor = input(undefined, { ...(ngDevMode ? { debugName: "solarisTooltipFor" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipFor' });
41
+ solarisTooltipTitle = input(undefined, { ...(ngDevMode ? { debugName: "solarisTooltipTitle" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipTitle' });
42
+ solarisTooltipTitleKey = input(undefined, { ...(ngDevMode ? { debugName: "solarisTooltipTitleKey" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipTitleKey' });
43
+ solarisTooltipIcon = input(undefined, { ...(ngDevMode ? { debugName: "solarisTooltipIcon" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipIcon' });
44
+ solarisTooltipIconDecorative = input(true, { ...(ngDevMode ? { debugName: "solarisTooltipIconDecorative" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipIconDecorative',
45
+ transform: booleanAttribute });
46
+ solarisTooltipTrigger = input('hover', { ...(ngDevMode ? { debugName: "solarisTooltipTrigger" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipTrigger' });
47
+ solarisTooltipPlacement = input('top', { ...(ngDevMode ? { debugName: "solarisTooltipPlacement" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipPlacement' });
48
+ solarisTooltipOffset = input(0, { ...(ngDevMode ? { debugName: "solarisTooltipOffset" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipOffset',
49
+ transform: numberAttribute });
50
+ solarisTooltipDisabled = input(false, { ...(ngDevMode ? { debugName: "solarisTooltipDisabled" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipDisabled',
51
+ transform: booleanAttribute });
52
+ solarisTooltipCloseable = input(false, { ...(ngDevMode ? { debugName: "solarisTooltipCloseable" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipCloseable',
53
+ transform: booleanAttribute });
54
+ solarisTooltipCloseLabel = input(undefined, { ...(ngDevMode ? { debugName: "solarisTooltipCloseLabel" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipCloseLabel' });
55
+ solarisTooltipCloseLabelKey = input(undefined, { ...(ngDevMode ? { debugName: "solarisTooltipCloseLabelKey" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipCloseLabelKey' });
56
+ solarisTooltipShowDelay = input(300, { ...(ngDevMode ? { debugName: "solarisTooltipShowDelay" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipShowDelay',
57
+ transform: numberAttribute });
58
+ solarisTooltipHideDelay = input(100, { ...(ngDevMode ? { debugName: "solarisTooltipHideDelay" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipHideDelay',
59
+ transform: numberAttribute });
60
+ solarisTooltipAppearance = input('outline', { ...(ngDevMode ? { debugName: "solarisTooltipAppearance" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipAppearance' });
61
+ solarisTooltipSize = input('sm', { ...(ngDevMode ? { debugName: "solarisTooltipSize" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipSize' });
62
+ solarisTooltipRadius = input('md', { ...(ngDevMode ? { debugName: "solarisTooltipRadius" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipRadius' });
63
+ solarisTooltipMaxWidth = input('20rem', { ...(ngDevMode ? { debugName: "solarisTooltipMaxWidth" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipMaxWidth' });
64
+ solarisTooltipArrow = input(true, { ...(ngDevMode ? { debugName: "solarisTooltipArrow" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipArrow',
65
+ transform: booleanAttribute });
66
+ solarisTooltipOpen = input(undefined, { ...(ngDevMode ? { debugName: "solarisTooltipOpen" } : /* istanbul ignore next */ {}), alias: 'solarisTooltipOpen' });
67
+ solarisTooltipOpened = output();
68
+ solarisTooltipClosed = output();
69
+ solarisTooltipOpenChange = output();
70
+ constructor() {
71
+ effect(() => {
72
+ const shouldBeOpen = this.solarisTooltipOpen();
73
+ if (shouldBeOpen === true && !this.isOpen()) {
74
+ this.open();
75
+ }
76
+ else if (shouldBeOpen === false && this.isOpen()) {
77
+ this.close();
78
+ }
79
+ });
80
+ this.destroyRef.onDestroy(() => {
81
+ this.disposeOverlay();
82
+ this.clearHoverTimeout();
83
+ });
84
+ }
85
+ ngAfterViewInit() {
86
+ if (!this.solarisTooltip() &&
87
+ !this.solarisTooltipKey() &&
88
+ !this.solarisTooltipFor()) {
89
+ console.warn('[SolarisTooltip] Tooltip requires solaris-tooltip, solarisTooltip, solarisTooltipKey, or solarisTooltipFor.');
90
+ }
91
+ }
92
+ onMouseEnter() {
93
+ this.isHovered = true;
94
+ if (this.solarisTooltipTrigger() === 'hover' &&
95
+ !this.solarisTooltipDisabled()) {
96
+ this.scheduleOpen(Number(this.solarisTooltipShowDelay()));
97
+ }
98
+ }
99
+ onMouseLeave() {
100
+ this.isHovered = false;
101
+ if (this.solarisTooltipTrigger() === 'hover') {
102
+ this.scheduleClose(Number(this.solarisTooltipHideDelay()));
103
+ }
104
+ }
105
+ onFocusIn() {
106
+ this.isFocused = true;
107
+ if (this.solarisTooltipTrigger() === 'hover' &&
108
+ !this.solarisTooltipDisabled()) {
109
+ this.scheduleOpen(Number(this.solarisTooltipShowDelay()));
110
+ }
111
+ }
112
+ onFocusOut() {
113
+ this.isFocused = false;
114
+ if (this.solarisTooltipTrigger() === 'hover') {
115
+ this.scheduleClose(Number(this.solarisTooltipHideDelay()));
116
+ }
117
+ }
118
+ onClick() {
119
+ if (this.solarisTooltipDisabled()) {
120
+ return;
121
+ }
122
+ if (this.solarisTooltipTrigger() === 'click') {
123
+ this.toggle();
124
+ }
125
+ }
126
+ onEscape() {
127
+ if (this.isOpen() && this.solarisTooltipTrigger() !== 'manual') {
128
+ this.close();
129
+ }
130
+ }
131
+ open() {
132
+ if (this.isOpen() || this.solarisTooltipDisabled()) {
133
+ return;
134
+ }
135
+ this.clearHoverTimeout();
136
+ if (this.solarisTooltipTrigger() === 'click') {
137
+ // SECURITY_EXCEPTION: this.document.activeElement required for restoreFocus. SSR-safe via injected DOCUMENT.
138
+ this.previousActiveElement = this.document.activeElement;
139
+ }
140
+ this.createOverlay();
141
+ this.attachPanel();
142
+ this.addOutsideClickHandler();
143
+ this.isOpen.set(true);
144
+ this.solarisTooltipOpened.emit();
145
+ this.solarisTooltipOpenChange.emit(true);
146
+ }
147
+ close() {
148
+ if (!this.isOpen()) {
149
+ return;
150
+ }
151
+ this.clearHoverTimeout();
152
+ this.detachPanel();
153
+ this.restoreFocus();
154
+ this.isOpen.set(false);
155
+ this.solarisTooltipClosed.emit();
156
+ this.solarisTooltipOpenChange.emit(false);
157
+ }
158
+ toggle() {
159
+ if (this.isOpen()) {
160
+ this.close();
161
+ }
162
+ else {
163
+ this.open();
164
+ }
165
+ }
166
+ reposition() {
167
+ if (this.overlayRef) {
168
+ this.overlayRef.updatePosition();
169
+ }
170
+ }
171
+ getResolvedBody() {
172
+ const text = this.solarisTooltip();
173
+ if (text) {
174
+ return text;
175
+ }
176
+ const key = this.solarisTooltipKey();
177
+ if (key) {
178
+ return this.translate.translate(key);
179
+ }
180
+ return undefined;
181
+ }
182
+ getResolvedTitle() {
183
+ const title = this.solarisTooltipTitle();
184
+ if (title) {
185
+ return title;
186
+ }
187
+ const titleKey = this.solarisTooltipTitleKey();
188
+ if (titleKey) {
189
+ return this.translate.translate(titleKey);
190
+ }
191
+ return undefined;
192
+ }
193
+ getResolvedCloseLabel() {
194
+ const closeLabel = this.solarisTooltipCloseLabel();
195
+ if (closeLabel) {
196
+ return closeLabel;
197
+ }
198
+ const closeLabelKey = this.solarisTooltipCloseLabelKey();
199
+ if (closeLabelKey) {
200
+ return this.translate.translate(closeLabelKey);
201
+ }
202
+ return this.translate.translate('solaris.tooltip.close');
203
+ }
204
+ scheduleOpen(delay) {
205
+ this.clearHoverTimeout();
206
+ if (delay > 0) {
207
+ this.hoverTimeout = setTimeout(() => {
208
+ this.ngZone.run(() => {
209
+ if ((this.isHovered || this.isFocused) && !this.isOpen()) {
210
+ this.open();
211
+ }
212
+ });
213
+ }, delay);
214
+ }
215
+ else {
216
+ this.open();
217
+ }
218
+ }
219
+ scheduleClose(delay) {
220
+ this.clearHoverTimeout();
221
+ if (this.solarisTooltipTrigger() !== 'hover') {
222
+ return;
223
+ }
224
+ if (delay > 0) {
225
+ this.hoverTimeout = setTimeout(() => {
226
+ this.ngZone.run(() => {
227
+ if (!this.isHovered && !this.isFocused && this.isOpen()) {
228
+ this.close();
229
+ }
230
+ });
231
+ }, delay);
232
+ }
233
+ else if (!this.isHovered && !this.isFocused) {
234
+ this.close();
235
+ }
236
+ }
237
+ clearHoverTimeout() {
238
+ if (this.hoverTimeout !== null) {
239
+ clearTimeout(this.hoverTimeout);
240
+ this.hoverTimeout = null;
241
+ }
242
+ }
243
+ createOverlay() {
244
+ this.disposeOverlay();
245
+ const positionStrategy = this.createPositionStrategy();
246
+ const scrollStrategy = this.overlay.scrollStrategies.reposition();
247
+ const config = new OverlayConfig({
248
+ positionStrategy,
249
+ scrollStrategy,
250
+ disposeOnNavigation: true,
251
+ panelClass: 'solaris-tooltip-panel-overlay',
252
+ });
253
+ this.overlayRef = this.overlay.create(config);
254
+ }
255
+ createPositionStrategy() {
256
+ const placement = this.solarisTooltipPlacement();
257
+ const userOffset = Number(this.solarisTooltipOffset());
258
+ const hasArrow = this.solarisTooltipArrow();
259
+ const size = this.solarisTooltipSize();
260
+ const arrowPx = hasArrow ? (ARROW_SIZE_PX[size] ?? 20) : 0;
261
+ const effectiveOffset = arrowPx + TOOLTIP_TRIGGER_GAP + userOffset;
262
+ const positions = getTooltipPositions(placement, effectiveOffset);
263
+ return this.overlay
264
+ .position()
265
+ .flexibleConnectedTo(this.elementRef)
266
+ .withPositions(positions)
267
+ .withFlexibleDimensions(true)
268
+ .withPush(true)
269
+ .withGrowAfterOpen(true);
270
+ }
271
+ attachPanel() {
272
+ if (!this.overlayRef) {
273
+ return;
274
+ }
275
+ this.currentPlacement = this.solarisTooltipPlacement();
276
+ const trigger = this.solarisTooltipTrigger();
277
+ const effectiveCloseable = trigger === 'click' ? this.solarisTooltipCloseable() : false;
278
+ const closeFn = () => this.close();
279
+ const data = {
280
+ title: this.getResolvedTitle(),
281
+ body: this.getResolvedBody(),
282
+ icon: this.solarisTooltipIcon(),
283
+ iconDecorative: this.solarisTooltipIconDecorative(),
284
+ contentTemplate: this.solarisTooltipFor(),
285
+ appearance: this.solarisTooltipAppearance(),
286
+ size: this.solarisTooltipSize(),
287
+ radius: this.solarisTooltipRadius(),
288
+ maxWidth: this.solarisTooltipMaxWidth(),
289
+ arrow: this.solarisTooltipArrow(),
290
+ arrowClass: getTooltipArrowClass(this.currentPlacement),
291
+ closeable: effectiveCloseable,
292
+ closeLabel: this.getResolvedCloseLabel(),
293
+ panelId: this.panelId,
294
+ placement: this.currentPlacement,
295
+ trigger,
296
+ close: closeFn,
297
+ };
298
+ const panelInjector = Injector.create({
299
+ parent: this.injector,
300
+ providers: [{ provide: SOLARIS_TOOLTIP_PANEL_DATA, useValue: data }],
301
+ });
302
+ const portal = new ComponentPortal(SolarisTooltipPanelComponent, this.viewContainerRef, panelInjector);
303
+ this.tooltipComponentRef = this.overlayRef.attach(portal);
304
+ const strategy = this.overlayRef.getConfig()
305
+ .positionStrategy;
306
+ this.positionChangesSub = strategy.positionChanges.subscribe((change) => {
307
+ const actualPlacement = derivePlacementFromConnectionPair(change.connectionPair);
308
+ if (actualPlacement !== this.currentPlacement) {
309
+ this.currentPlacement = actualPlacement;
310
+ this.tooltipComponentRef?.instance.updatePlacement(actualPlacement, getTooltipArrowClass(actualPlacement));
311
+ }
312
+ });
313
+ }
314
+ detachPanel() {
315
+ if (this.overlayRef) {
316
+ this.overlayRef.detach();
317
+ this.disposeOverlay();
318
+ }
319
+ this.removeOutsideClickHandler();
320
+ }
321
+ disposeOverlay() {
322
+ this.positionChangesSub?.unsubscribe();
323
+ this.positionChangesSub = null;
324
+ this.tooltipComponentRef = null;
325
+ if (this.overlayRef) {
326
+ this.overlayRef.dispose();
327
+ this.overlayRef = null;
328
+ }
329
+ this.removeOutsideClickHandler();
330
+ }
331
+ addOutsideClickHandler() {
332
+ if (this.solarisTooltipTrigger() !== 'click') {
333
+ return;
334
+ }
335
+ this.removeOutsideClickHandler();
336
+ this.outsideClickCleanup = this.rendererListen(this.document, 'click', this.handleOutsideClick);
337
+ }
338
+ removeOutsideClickHandler() {
339
+ if (this.outsideClickCleanup) {
340
+ this.outsideClickCleanup();
341
+ this.outsideClickCleanup = null;
342
+ }
343
+ }
344
+ handleOutsideClick = (event) => {
345
+ if (!this.overlayRef) {
346
+ return;
347
+ }
348
+ const overlayElement = this.overlayRef.overlayElement;
349
+ // SECURITY_EXCEPTION: nativeElement needed for outside-click containment check. ElementRef SSR-safe.
350
+ const triggerElement = this.elementRef.nativeElement;
351
+ const target = event.target;
352
+ if (target &&
353
+ !overlayElement.contains(target) &&
354
+ !triggerElement.contains(target)) {
355
+ this.close();
356
+ }
357
+ };
358
+ rendererListen(target, event, callback) {
359
+ target.addEventListener(event, callback);
360
+ return () => {
361
+ target.removeEventListener(event, callback);
362
+ };
363
+ }
364
+ restoreFocus() {
365
+ if (this.solarisTooltipTrigger() === 'click' &&
366
+ this.previousActiveElement &&
367
+ // SECURITY_EXCEPTION: this.document.contains() to safely verify trigger still exists before focus.
368
+ this.document.contains(this.previousActiveElement)) {
369
+ this.previousActiveElement.focus();
370
+ }
371
+ this.previousActiveElement = null;
372
+ }
373
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
374
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.17", type: SolarisTooltipDirective, isStandalone: true, selector: "[solaris-tooltip], [solarisTooltip], [solarisTooltipFor]", inputs: { solarisTooltip: { classPropertyName: "solarisTooltip", publicName: "solarisTooltip", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipKey: { classPropertyName: "solarisTooltipKey", publicName: "solarisTooltipKey", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipFor: { classPropertyName: "solarisTooltipFor", publicName: "solarisTooltipFor", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipTitle: { classPropertyName: "solarisTooltipTitle", publicName: "solarisTooltipTitle", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipTitleKey: { classPropertyName: "solarisTooltipTitleKey", publicName: "solarisTooltipTitleKey", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipIcon: { classPropertyName: "solarisTooltipIcon", publicName: "solarisTooltipIcon", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipIconDecorative: { classPropertyName: "solarisTooltipIconDecorative", publicName: "solarisTooltipIconDecorative", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipTrigger: { classPropertyName: "solarisTooltipTrigger", publicName: "solarisTooltipTrigger", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipPlacement: { classPropertyName: "solarisTooltipPlacement", publicName: "solarisTooltipPlacement", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipOffset: { classPropertyName: "solarisTooltipOffset", publicName: "solarisTooltipOffset", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipDisabled: { classPropertyName: "solarisTooltipDisabled", publicName: "solarisTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipCloseable: { classPropertyName: "solarisTooltipCloseable", publicName: "solarisTooltipCloseable", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipCloseLabel: { classPropertyName: "solarisTooltipCloseLabel", publicName: "solarisTooltipCloseLabel", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipCloseLabelKey: { classPropertyName: "solarisTooltipCloseLabelKey", publicName: "solarisTooltipCloseLabelKey", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipShowDelay: { classPropertyName: "solarisTooltipShowDelay", publicName: "solarisTooltipShowDelay", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipHideDelay: { classPropertyName: "solarisTooltipHideDelay", publicName: "solarisTooltipHideDelay", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipAppearance: { classPropertyName: "solarisTooltipAppearance", publicName: "solarisTooltipAppearance", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipSize: { classPropertyName: "solarisTooltipSize", publicName: "solarisTooltipSize", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipRadius: { classPropertyName: "solarisTooltipRadius", publicName: "solarisTooltipRadius", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipMaxWidth: { classPropertyName: "solarisTooltipMaxWidth", publicName: "solarisTooltipMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipArrow: { classPropertyName: "solarisTooltipArrow", publicName: "solarisTooltipArrow", isSignal: true, isRequired: false, transformFunction: null }, solarisTooltipOpen: { classPropertyName: "solarisTooltipOpen", publicName: "solarisTooltipOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { solarisTooltipOpened: "solarisTooltipOpened", solarisTooltipClosed: "solarisTooltipClosed", solarisTooltipOpenChange: "solarisTooltipOpenChange" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focusin": "onFocusIn()", "focusout": "onFocusOut()", "click": "onClick()", "keydown.escape": "onEscape()" }, properties: { "attr.aria-describedby": "isOpen() && !isClickTrigger() ? panelId : null" } }, exportAs: ["solarisTooltip"], ngImport: i0 });
375
+ }
376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisTooltipDirective, decorators: [{
377
+ type: Directive,
378
+ args: [{
379
+ selector: '[solaris-tooltip], [solarisTooltip], [solarisTooltipFor]',
380
+ standalone: true,
381
+ exportAs: 'solarisTooltip',
382
+ host: {
383
+ '[attr.aria-describedby]': 'isOpen() && !isClickTrigger() ? panelId : null',
384
+ },
385
+ }]
386
+ }], ctorParameters: () => [], propDecorators: { solarisTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltip", required: false }] }], solarisTooltipKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipKey", required: false }] }], solarisTooltipFor: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipFor", required: false }] }], solarisTooltipTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipTitle", required: false }] }], solarisTooltipTitleKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipTitleKey", required: false }] }], solarisTooltipIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipIcon", required: false }] }], solarisTooltipIconDecorative: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipIconDecorative", required: false }] }], solarisTooltipTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipTrigger", required: false }] }], solarisTooltipPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipPlacement", required: false }] }], solarisTooltipOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipOffset", required: false }] }], solarisTooltipDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipDisabled", required: false }] }], solarisTooltipCloseable: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipCloseable", required: false }] }], solarisTooltipCloseLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipCloseLabel", required: false }] }], solarisTooltipCloseLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipCloseLabelKey", required: false }] }], solarisTooltipShowDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipShowDelay", required: false }] }], solarisTooltipHideDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipHideDelay", required: false }] }], solarisTooltipAppearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipAppearance", required: false }] }], solarisTooltipSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipSize", required: false }] }], solarisTooltipRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipRadius", required: false }] }], solarisTooltipMaxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipMaxWidth", required: false }] }], solarisTooltipArrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipArrow", required: false }] }], solarisTooltipOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisTooltipOpen", required: false }] }], solarisTooltipOpened: [{ type: i0.Output, args: ["solarisTooltipOpened"] }], solarisTooltipClosed: [{ type: i0.Output, args: ["solarisTooltipClosed"] }], solarisTooltipOpenChange: [{ type: i0.Output, args: ["solarisTooltipOpenChange"] }], onMouseEnter: [{
387
+ type: HostListener,
388
+ args: ['mouseenter']
389
+ }], onMouseLeave: [{
390
+ type: HostListener,
391
+ args: ['mouseleave']
392
+ }], onFocusIn: [{
393
+ type: HostListener,
394
+ args: ['focusin']
395
+ }], onFocusOut: [{
396
+ type: HostListener,
397
+ args: ['focusout']
398
+ }], onClick: [{
399
+ type: HostListener,
400
+ args: ['click']
401
+ }], onEscape: [{
402
+ type: HostListener,
403
+ args: ['keydown.escape']
404
+ }] } });
405
+ //# sourceMappingURL=tooltip.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.directive.js","sourceRoot":"","sources":["../../../../../../../../../packages/angular/src/lib/components/interaction/tooltip/directive/tooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,gBAAgB,EAEhB,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,EACL,MAAM,EACN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AAQ,EAAE,0DAA0D;oBACpE,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,gBAAgB;oBAC1B,IAAI,EAAE;wBACJ,yBAAyB,EAAE,gDAAgD;qBAC5E;iBACF;;sBAiKE,YAAY;uBAAC,YAAY;;sBAWzB,YAAY;uBAAC,YAAY;;sBAQzB,YAAY;uBAAC,SAAS;;sBAWtB,YAAY;uBAAC,UAAU;;sBAQvB,YAAY;uBAAC,OAAO;;sBAWpB,YAAY;uBAAC,gBAAgB","sourcesContent":["import {\r\n Directive,\r\n ElementRef,\r\n Injector,\r\n ViewContainerRef,\r\n ComponentRef,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n DestroyRef,\r\n HostListener,\r\n TemplateRef,\r\n AfterViewInit,\r\n booleanAttribute,\r\n numberAttribute,\r\n NgZone,\r\n} from '@angular/core';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport {\r\n Overlay,\r\n OverlayRef,\r\n OverlayConfig,\r\n FlexibleConnectedPositionStrategy,\r\n type ConnectedOverlayPositionChange,\r\n} from '@angular/cdk/overlay';\r\nimport { ComponentPortal } from '@angular/cdk/portal';\r\nimport { Subscription } from 'rxjs';\r\n\r\nimport { SolarisTranslateService } from '../../../../services/translation';\r\n\r\nimport { SolarisTooltipPanelComponent } from '../component/tooltip-panel.component';\r\nimport {\r\n SOLARIS_TOOLTIP_PANEL_DATA,\r\n type SolarisTooltipPanelData,\r\n} from '../token/tooltip.tokens';\r\nimport {\r\n getTooltipPositions,\r\n getTooltipArrowClass,\r\n derivePlacementFromConnectionPair,\r\n} from '../model/tooltip-position';\r\n\r\nimport type {\r\n SolarisTooltipPlacement,\r\n SolarisTooltipTrigger,\r\n SolarisTooltipAppearance,\r\n SolarisTooltipSize,\r\n SolarisTooltipRadius,\r\n} from '../model/tooltip.types';\r\n\r\nlet nextPanelId = 0;\r\n\r\nconst TOOLTIP_TRIGGER_GAP = 3;\r\n\r\nconst ARROW_SIZE_PX: Record<string, number> = {\r\n sm: 12,\r\n md: 20,\r\n lg: 24,\r\n};\r\n\r\n@Directive({\r\n selector: '[solaris-tooltip], [solarisTooltip], [solarisTooltipFor]',\r\n standalone: true,\r\n exportAs: 'solarisTooltip',\r\n host: {\r\n '[attr.aria-describedby]': 'isOpen() && !isClickTrigger() ? panelId : null',\r\n },\r\n})\r\nexport class SolarisTooltipDirective implements AfterViewInit {\r\n private readonly overlay = inject(Overlay);\r\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private readonly viewContainerRef = inject(ViewContainerRef);\r\n private readonly injector = inject(Injector);\r\n private readonly document = inject(DOCUMENT);\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly translate = inject(SolarisTranslateService);\r\n private readonly ngZone = inject(NgZone);\r\n\r\n protected readonly panelId = `solaris-tooltip-panel-${++nextPanelId}`;\r\n protected readonly isOpen = signal(false);\r\n protected readonly isClickTrigger = computed(\r\n () => this.solarisTooltipTrigger() === 'click',\r\n );\r\n\r\n private overlayRef: OverlayRef | null = null;\r\n private outsideClickCleanup: (() => void) | null = null;\r\n private previousActiveElement: HTMLElement | null = null;\r\n private hoverTimeout: ReturnType<typeof setTimeout> | null = null;\r\n private isHovered = false;\r\n private isFocused = false;\r\n private tooltipComponentRef: ComponentRef<SolarisTooltipPanelComponent> | null =\r\n null;\r\n private positionChangesSub: Subscription | null = null;\r\n private currentPlacement: SolarisTooltipPlacement = 'top';\r\n\r\n readonly solarisTooltip = input<string | undefined>(undefined, {\r\n alias: 'solarisTooltip',\r\n });\r\n\r\n readonly solarisTooltipKey = input<string | undefined>(undefined, {\r\n alias: 'solarisTooltipKey',\r\n });\r\n\r\n readonly solarisTooltipFor = input<TemplateRef<unknown> | undefined>(\r\n undefined,\r\n {\r\n alias: 'solarisTooltipFor',\r\n },\r\n );\r\n\r\n readonly solarisTooltipTitle = input<string | undefined>(undefined, {\r\n alias: 'solarisTooltipTitle',\r\n });\r\n\r\n readonly solarisTooltipTitleKey = input<string | undefined>(undefined, {\r\n alias: 'solarisTooltipTitleKey',\r\n });\r\n\r\n readonly solarisTooltipIcon = input<string | undefined>(undefined, {\r\n alias: 'solarisTooltipIcon',\r\n });\r\n\r\n readonly solarisTooltipIconDecorative = input<boolean, boolean>(true, {\r\n alias: 'solarisTooltipIconDecorative',\r\n transform: booleanAttribute,\r\n });\r\n\r\n readonly solarisTooltipTrigger = input<SolarisTooltipTrigger>('hover', {\r\n alias: 'solarisTooltipTrigger',\r\n });\r\n\r\n readonly solarisTooltipPlacement = input<SolarisTooltipPlacement>('top', {\r\n alias: 'solarisTooltipPlacement',\r\n });\r\n\r\n readonly solarisTooltipOffset = input<number, string | number>(0, {\r\n alias: 'solarisTooltipOffset',\r\n transform: numberAttribute,\r\n });\r\n\r\n readonly solarisTooltipDisabled = input<boolean, boolean>(false, {\r\n alias: 'solarisTooltipDisabled',\r\n transform: booleanAttribute,\r\n });\r\n\r\n readonly solarisTooltipCloseable = input<boolean, boolean>(false, {\r\n alias: 'solarisTooltipCloseable',\r\n transform: booleanAttribute,\r\n });\r\n\r\n readonly solarisTooltipCloseLabel = input<string | undefined>(undefined, {\r\n alias: 'solarisTooltipCloseLabel',\r\n });\r\n\r\n readonly solarisTooltipCloseLabelKey = input<string | undefined>(undefined, {\r\n alias: 'solarisTooltipCloseLabelKey',\r\n });\r\n\r\n readonly solarisTooltipShowDelay = input<number, string | number>(300, {\r\n alias: 'solarisTooltipShowDelay',\r\n transform: numberAttribute,\r\n });\r\n\r\n readonly solarisTooltipHideDelay = input<number, string | number>(100, {\r\n alias: 'solarisTooltipHideDelay',\r\n transform: numberAttribute,\r\n });\r\n\r\n readonly solarisTooltipAppearance = input<SolarisTooltipAppearance>(\r\n 'outline',\r\n {\r\n alias: 'solarisTooltipAppearance',\r\n },\r\n );\r\n\r\n readonly solarisTooltipSize = input<SolarisTooltipSize>('sm', {\r\n alias: 'solarisTooltipSize',\r\n });\r\n\r\n readonly solarisTooltipRadius = input<SolarisTooltipRadius>('md', {\r\n alias: 'solarisTooltipRadius',\r\n });\r\n\r\n readonly solarisTooltipMaxWidth = input<string | number>('20rem', {\r\n alias: 'solarisTooltipMaxWidth',\r\n });\r\n\r\n readonly solarisTooltipArrow = input<boolean, boolean>(true, {\r\n alias: 'solarisTooltipArrow',\r\n transform: booleanAttribute,\r\n });\r\n\r\n readonly solarisTooltipOpen = input<boolean | undefined>(undefined, {\r\n alias: 'solarisTooltipOpen',\r\n });\r\n\r\n readonly solarisTooltipOpened = output<void>();\r\n readonly solarisTooltipClosed = output<void>();\r\n readonly solarisTooltipOpenChange = output<boolean>();\r\n\r\n constructor() {\r\n effect(() => {\r\n const shouldBeOpen = this.solarisTooltipOpen();\r\n if (shouldBeOpen === true && !this.isOpen()) {\r\n this.open();\r\n } else if (shouldBeOpen === false && this.isOpen()) {\r\n this.close();\r\n }\r\n });\r\n\r\n this.destroyRef.onDestroy(() => {\r\n this.disposeOverlay();\r\n this.clearHoverTimeout();\r\n });\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if (\r\n !this.solarisTooltip() &&\r\n !this.solarisTooltipKey() &&\r\n !this.solarisTooltipFor()\r\n ) {\r\n console.warn(\r\n '[SolarisTooltip] Tooltip requires solaris-tooltip, solarisTooltip, solarisTooltipKey, or solarisTooltipFor.',\r\n );\r\n }\r\n }\r\n\r\n @HostListener('mouseenter')\r\n onMouseEnter(): void {\r\n this.isHovered = true;\r\n if (\r\n this.solarisTooltipTrigger() === 'hover' &&\r\n !this.solarisTooltipDisabled()\r\n ) {\r\n this.scheduleOpen(Number(this.solarisTooltipShowDelay()));\r\n }\r\n }\r\n\r\n @HostListener('mouseleave')\r\n onMouseLeave(): void {\r\n this.isHovered = false;\r\n if (this.solarisTooltipTrigger() === 'hover') {\r\n this.scheduleClose(Number(this.solarisTooltipHideDelay()));\r\n }\r\n }\r\n\r\n @HostListener('focusin')\r\n onFocusIn(): void {\r\n this.isFocused = true;\r\n if (\r\n this.solarisTooltipTrigger() === 'hover' &&\r\n !this.solarisTooltipDisabled()\r\n ) {\r\n this.scheduleOpen(Number(this.solarisTooltipShowDelay()));\r\n }\r\n }\r\n\r\n @HostListener('focusout')\r\n onFocusOut(): void {\r\n this.isFocused = false;\r\n if (this.solarisTooltipTrigger() === 'hover') {\r\n this.scheduleClose(Number(this.solarisTooltipHideDelay()));\r\n }\r\n }\r\n\r\n @HostListener('click')\r\n onClick(): void {\r\n if (this.solarisTooltipDisabled()) {\r\n return;\r\n }\r\n\r\n if (this.solarisTooltipTrigger() === 'click') {\r\n this.toggle();\r\n }\r\n }\r\n\r\n @HostListener('keydown.escape')\r\n onEscape(): void {\r\n if (this.isOpen() && this.solarisTooltipTrigger() !== 'manual') {\r\n this.close();\r\n }\r\n }\r\n\r\n open(): void {\r\n if (this.isOpen() || this.solarisTooltipDisabled()) {\r\n return;\r\n }\r\n\r\n this.clearHoverTimeout();\r\n\r\n if (this.solarisTooltipTrigger() === 'click') {\r\n // SECURITY_EXCEPTION: this.document.activeElement required for restoreFocus. SSR-safe via injected DOCUMENT.\r\n this.previousActiveElement = this.document.activeElement as HTMLElement;\r\n }\r\n\r\n this.createOverlay();\r\n this.attachPanel();\r\n this.addOutsideClickHandler();\r\n this.isOpen.set(true);\r\n this.solarisTooltipOpened.emit();\r\n this.solarisTooltipOpenChange.emit(true);\r\n }\r\n\r\n close(): void {\r\n if (!this.isOpen()) {\r\n return;\r\n }\r\n\r\n this.clearHoverTimeout();\r\n this.detachPanel();\r\n this.restoreFocus();\r\n this.isOpen.set(false);\r\n this.solarisTooltipClosed.emit();\r\n this.solarisTooltipOpenChange.emit(false);\r\n }\r\n\r\n toggle(): void {\r\n if (this.isOpen()) {\r\n this.close();\r\n } else {\r\n this.open();\r\n }\r\n }\r\n\r\n reposition(): void {\r\n if (this.overlayRef) {\r\n this.overlayRef.updatePosition();\r\n }\r\n }\r\n\r\n private getResolvedBody(): string | undefined {\r\n const text = this.solarisTooltip();\r\n if (text) {\r\n return text;\r\n }\r\n\r\n const key = this.solarisTooltipKey();\r\n if (key) {\r\n return this.translate.translate(key);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n private getResolvedTitle(): string | undefined {\r\n const title = this.solarisTooltipTitle();\r\n if (title) {\r\n return title;\r\n }\r\n\r\n const titleKey = this.solarisTooltipTitleKey();\r\n if (titleKey) {\r\n return this.translate.translate(titleKey);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n private getResolvedCloseLabel(): string {\r\n const closeLabel = this.solarisTooltipCloseLabel();\r\n if (closeLabel) {\r\n return closeLabel;\r\n }\r\n\r\n const closeLabelKey = this.solarisTooltipCloseLabelKey();\r\n if (closeLabelKey) {\r\n return this.translate.translate(closeLabelKey);\r\n }\r\n\r\n return this.translate.translate('solaris.tooltip.close');\r\n }\r\n\r\n private scheduleOpen(delay: number): void {\r\n this.clearHoverTimeout();\r\n if (delay > 0) {\r\n this.hoverTimeout = setTimeout(() => {\r\n this.ngZone.run(() => {\r\n if ((this.isHovered || this.isFocused) && !this.isOpen()) {\r\n this.open();\r\n }\r\n });\r\n }, delay);\r\n } else {\r\n this.open();\r\n }\r\n }\r\n\r\n private scheduleClose(delay: number): void {\r\n this.clearHoverTimeout();\r\n\r\n if (this.solarisTooltipTrigger() !== 'hover') {\r\n return;\r\n }\r\n\r\n if (delay > 0) {\r\n this.hoverTimeout = setTimeout(() => {\r\n this.ngZone.run(() => {\r\n if (!this.isHovered && !this.isFocused && this.isOpen()) {\r\n this.close();\r\n }\r\n });\r\n }, delay);\r\n } else if (!this.isHovered && !this.isFocused) {\r\n this.close();\r\n }\r\n }\r\n\r\n private clearHoverTimeout(): void {\r\n if (this.hoverTimeout !== null) {\r\n clearTimeout(this.hoverTimeout);\r\n this.hoverTimeout = null;\r\n }\r\n }\r\n\r\n private createOverlay(): void {\r\n this.disposeOverlay();\r\n\r\n const positionStrategy = this.createPositionStrategy();\r\n const scrollStrategy = this.overlay.scrollStrategies.reposition();\r\n\r\n const config = new OverlayConfig({\r\n positionStrategy,\r\n scrollStrategy,\r\n disposeOnNavigation: true,\r\n panelClass: 'solaris-tooltip-panel-overlay',\r\n });\r\n\r\n this.overlayRef = this.overlay.create(config);\r\n }\r\n\r\n private createPositionStrategy(): FlexibleConnectedPositionStrategy {\r\n const placement = this.solarisTooltipPlacement();\r\n const userOffset = Number(this.solarisTooltipOffset());\r\n const hasArrow = this.solarisTooltipArrow();\r\n const size = this.solarisTooltipSize();\r\n const arrowPx = hasArrow ? (ARROW_SIZE_PX[size] ?? 20) : 0;\r\n const effectiveOffset = arrowPx + TOOLTIP_TRIGGER_GAP + userOffset;\r\n const positions = getTooltipPositions(placement, effectiveOffset);\r\n\r\n return this.overlay\r\n .position()\r\n .flexibleConnectedTo(this.elementRef)\r\n .withPositions(positions)\r\n .withFlexibleDimensions(true)\r\n .withPush(true)\r\n .withGrowAfterOpen(true);\r\n }\r\n\r\n private attachPanel(): void {\r\n if (!this.overlayRef) {\r\n return;\r\n }\r\n\r\n this.currentPlacement = this.solarisTooltipPlacement();\r\n const trigger = this.solarisTooltipTrigger();\r\n const effectiveCloseable =\r\n trigger === 'click' ? this.solarisTooltipCloseable() : false;\r\n const closeFn = () => this.close();\r\n\r\n const data: SolarisTooltipPanelData = {\r\n title: this.getResolvedTitle(),\r\n body: this.getResolvedBody(),\r\n icon: this.solarisTooltipIcon(),\r\n iconDecorative: this.solarisTooltipIconDecorative(),\r\n contentTemplate: this.solarisTooltipFor(),\r\n appearance: this.solarisTooltipAppearance(),\r\n size: this.solarisTooltipSize(),\r\n radius: this.solarisTooltipRadius(),\r\n maxWidth: this.solarisTooltipMaxWidth(),\r\n arrow: this.solarisTooltipArrow(),\r\n arrowClass: getTooltipArrowClass(this.currentPlacement),\r\n closeable: effectiveCloseable,\r\n closeLabel: this.getResolvedCloseLabel(),\r\n panelId: this.panelId,\r\n placement: this.currentPlacement,\r\n trigger,\r\n close: closeFn,\r\n };\r\n\r\n const panelInjector = Injector.create({\r\n parent: this.injector,\r\n providers: [{ provide: SOLARIS_TOOLTIP_PANEL_DATA, useValue: data }],\r\n });\r\n\r\n const portal = new ComponentPortal(\r\n SolarisTooltipPanelComponent,\r\n this.viewContainerRef,\r\n panelInjector,\r\n );\r\n\r\n this.tooltipComponentRef = this.overlayRef.attach(portal);\r\n\r\n const strategy = this.overlayRef.getConfig()\r\n .positionStrategy as FlexibleConnectedPositionStrategy;\r\n this.positionChangesSub = strategy.positionChanges.subscribe(\r\n (change: ConnectedOverlayPositionChange) => {\r\n const actualPlacement = derivePlacementFromConnectionPair(\r\n change.connectionPair,\r\n );\r\n if (actualPlacement !== this.currentPlacement) {\r\n this.currentPlacement = actualPlacement;\r\n this.tooltipComponentRef?.instance.updatePlacement(\r\n actualPlacement,\r\n getTooltipArrowClass(actualPlacement),\r\n );\r\n }\r\n },\r\n );\r\n }\r\n\r\n private detachPanel(): void {\r\n if (this.overlayRef) {\r\n this.overlayRef.detach();\r\n this.disposeOverlay();\r\n }\r\n this.removeOutsideClickHandler();\r\n }\r\n\r\n private disposeOverlay(): void {\r\n this.positionChangesSub?.unsubscribe();\r\n this.positionChangesSub = null;\r\n this.tooltipComponentRef = null;\r\n if (this.overlayRef) {\r\n this.overlayRef.dispose();\r\n this.overlayRef = null;\r\n }\r\n this.removeOutsideClickHandler();\r\n }\r\n\r\n private addOutsideClickHandler(): void {\r\n if (this.solarisTooltipTrigger() !== 'click') {\r\n return;\r\n }\r\n\r\n this.removeOutsideClickHandler();\r\n\r\n this.outsideClickCleanup = this.rendererListen(\r\n this.document,\r\n 'click',\r\n this.handleOutsideClick,\r\n );\r\n }\r\n\r\n private removeOutsideClickHandler(): void {\r\n if (this.outsideClickCleanup) {\r\n this.outsideClickCleanup();\r\n this.outsideClickCleanup = null;\r\n }\r\n }\r\n\r\n private readonly handleOutsideClick = (event: Event): void => {\r\n if (!this.overlayRef) {\r\n return;\r\n }\r\n\r\n const overlayElement = this.overlayRef.overlayElement;\r\n // SECURITY_EXCEPTION: nativeElement needed for outside-click containment check. ElementRef SSR-safe.\r\n const triggerElement = this.elementRef.nativeElement;\r\n const target = event.target as Node;\r\n\r\n if (\r\n target &&\r\n !overlayElement.contains(target) &&\r\n !triggerElement.contains(target)\r\n ) {\r\n this.close();\r\n }\r\n };\r\n\r\n private rendererListen(\r\n target: EventTarget,\r\n event: string,\r\n callback: (event: Event) => void,\r\n ): () => void {\r\n target.addEventListener(event, callback);\r\n return () => {\r\n target.removeEventListener(event, callback);\r\n };\r\n }\r\n\r\n private restoreFocus(): void {\r\n if (\r\n this.solarisTooltipTrigger() === 'click' &&\r\n this.previousActiveElement &&\r\n // SECURITY_EXCEPTION: this.document.contains() to safely verify trigger still exists before focus.\r\n this.document.contains(this.previousActiveElement)\r\n ) {\r\n this.previousActiveElement.focus();\r\n }\r\n this.previousActiveElement = null;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,3 @@
1
+ export { SolarisTooltipDirective } from './directive/tooltip.directive';
2
+ export { SolarisTooltipPanelComponent } from './component/tooltip-panel.component';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/angular/src/lib/components/interaction/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC","sourcesContent":["export { SolarisTooltipDirective } from './directive/tooltip.directive';\nexport { SolarisTooltipPanelComponent } from './component/tooltip-panel.component';\n\nexport type {\n SolarisTooltipPlacement,\n SolarisTooltipTrigger,\n SolarisTooltipAppearance,\n SolarisTooltipSize,\n SolarisTooltipRadius,\n SolarisTooltipConfig,\n} from './model/tooltip.types';\n"]}