@unipin/angular-applet 18.9.7 → 21.0.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 (275) hide show
  1. package/README.md +49 -10
  2. package/common/assets/sprites/flagGlobal.png +0 -0
  3. package/common/assets/sprites/flagSprite42.webp +0 -0
  4. package/common/assets/styles/freakflags.scss +263 -0
  5. package/common/assets/styles/theme.css +69 -0
  6. package/fesm2022/unipin-angular-applet-accordion.mjs +242 -0
  7. package/fesm2022/unipin-angular-applet-accordion.mjs.map +1 -0
  8. package/fesm2022/unipin-angular-applet-alert-dialog.mjs +267 -0
  9. package/fesm2022/unipin-angular-applet-alert-dialog.mjs.map +1 -0
  10. package/fesm2022/unipin-angular-applet-alert.mjs +94 -0
  11. package/fesm2022/unipin-angular-applet-alert.mjs.map +1 -0
  12. package/fesm2022/unipin-angular-applet-auth.mjs +707 -0
  13. package/fesm2022/unipin-angular-applet-auth.mjs.map +1 -0
  14. package/fesm2022/unipin-angular-applet-avatar.mjs +41 -0
  15. package/fesm2022/unipin-angular-applet-avatar.mjs.map +1 -0
  16. package/fesm2022/unipin-angular-applet-badge.mjs +50 -0
  17. package/fesm2022/unipin-angular-applet-badge.mjs.map +1 -0
  18. package/fesm2022/unipin-angular-applet-buttons.mjs +263 -0
  19. package/fesm2022/unipin-angular-applet-buttons.mjs.map +1 -0
  20. package/fesm2022/unipin-angular-applet-calendar.mjs +492 -0
  21. package/fesm2022/unipin-angular-applet-calendar.mjs.map +1 -0
  22. package/fesm2022/unipin-angular-applet-collapsible.mjs +97 -0
  23. package/fesm2022/unipin-angular-applet-collapsible.mjs.map +1 -0
  24. package/fesm2022/unipin-angular-applet-common.mjs +342 -0
  25. package/fesm2022/unipin-angular-applet-common.mjs.map +1 -0
  26. package/fesm2022/unipin-angular-applet-containers.mjs +472 -0
  27. package/fesm2022/unipin-angular-applet-containers.mjs.map +1 -0
  28. package/fesm2022/unipin-angular-applet-dialog.mjs +535 -0
  29. package/fesm2022/unipin-angular-applet-dialog.mjs.map +1 -0
  30. package/fesm2022/unipin-angular-applet-forms.mjs +1699 -0
  31. package/fesm2022/unipin-angular-applet-forms.mjs.map +1 -0
  32. package/fesm2022/unipin-angular-applet-froala.mjs +298 -0
  33. package/fesm2022/unipin-angular-applet-froala.mjs.map +1 -0
  34. package/fesm2022/unipin-angular-applet-grids.mjs +105 -0
  35. package/fesm2022/unipin-angular-applet-grids.mjs.map +1 -0
  36. package/fesm2022/unipin-angular-applet-infinite-scroll.mjs +86 -0
  37. package/fesm2022/unipin-angular-applet-infinite-scroll.mjs.map +1 -0
  38. package/fesm2022/unipin-angular-applet-json-viewer.mjs +71 -0
  39. package/fesm2022/unipin-angular-applet-json-viewer.mjs.map +1 -0
  40. package/fesm2022/unipin-angular-applet-loading-dialog.mjs +252 -0
  41. package/fesm2022/unipin-angular-applet-loading-dialog.mjs.map +1 -0
  42. package/fesm2022/unipin-angular-applet-markdown.mjs +703 -0
  43. package/fesm2022/unipin-angular-applet-markdown.mjs.map +1 -0
  44. package/fesm2022/unipin-angular-applet-micro-frontend.mjs +75 -0
  45. package/fesm2022/unipin-angular-applet-micro-frontend.mjs.map +1 -0
  46. package/fesm2022/unipin-angular-applet-popover.mjs +333 -0
  47. package/fesm2022/unipin-angular-applet-popover.mjs.map +1 -0
  48. package/fesm2022/unipin-angular-applet-progress-bar.mjs +38 -0
  49. package/fesm2022/unipin-angular-applet-progress-bar.mjs.map +1 -0
  50. package/fesm2022/unipin-angular-applet-skeleton.mjs +32 -0
  51. package/fesm2022/unipin-angular-applet-skeleton.mjs.map +1 -0
  52. package/fesm2022/unipin-angular-applet-spinner.mjs +144 -0
  53. package/fesm2022/unipin-angular-applet-spinner.mjs.map +1 -0
  54. package/fesm2022/unipin-angular-applet-swipeable.mjs +270 -0
  55. package/fesm2022/unipin-angular-applet-swipeable.mjs.map +1 -0
  56. package/fesm2022/unipin-angular-applet-tabs.mjs +142 -0
  57. package/fesm2022/unipin-angular-applet-tabs.mjs.map +1 -0
  58. package/fesm2022/unipin-angular-applet-tooltip.mjs +118 -0
  59. package/fesm2022/unipin-angular-applet-tooltip.mjs.map +1 -0
  60. package/fesm2022/unipin-angular-applet.mjs +5 -4617
  61. package/fesm2022/unipin-angular-applet.mjs.map +1 -1
  62. package/package.json +132 -29
  63. package/types/unipin-angular-applet-accordion.d.ts +60 -0
  64. package/types/unipin-angular-applet-alert-dialog.d.ts +35 -0
  65. package/types/unipin-angular-applet-alert.d.ts +34 -0
  66. package/types/unipin-angular-applet-auth.d.ts +225 -0
  67. package/types/unipin-angular-applet-avatar.d.ts +16 -0
  68. package/types/unipin-angular-applet-badge.d.ts +20 -0
  69. package/types/unipin-angular-applet-buttons.d.ts +37 -0
  70. package/types/unipin-angular-applet-calendar.d.ts +44 -0
  71. package/types/unipin-angular-applet-collapsible.d.ts +35 -0
  72. package/types/unipin-angular-applet-common.d.ts +94 -0
  73. package/types/unipin-angular-applet-containers.d.ts +179 -0
  74. package/types/unipin-angular-applet-dialog.d.ts +180 -0
  75. package/types/unipin-angular-applet-forms.d.ts +412 -0
  76. package/types/unipin-angular-applet-froala.d.ts +85 -0
  77. package/types/unipin-angular-applet-grids.d.ts +22 -0
  78. package/types/unipin-angular-applet-infinite-scroll.d.ts +51 -0
  79. package/types/unipin-angular-applet-json-viewer.d.ts +30 -0
  80. package/types/unipin-angular-applet-loading-dialog.d.ts +19 -0
  81. package/types/unipin-angular-applet-markdown.d.ts +119 -0
  82. package/types/unipin-angular-applet-micro-frontend.d.ts +11 -0
  83. package/types/unipin-angular-applet-popover.d.ts +58 -0
  84. package/types/unipin-angular-applet-progress-bar.d.ts +14 -0
  85. package/types/unipin-angular-applet-skeleton.d.ts +11 -0
  86. package/types/unipin-angular-applet-spinner.d.ts +12 -0
  87. package/types/unipin-angular-applet-swipeable.d.ts +66 -0
  88. package/types/unipin-angular-applet-tabs.d.ts +40 -0
  89. package/types/unipin-angular-applet-tooltip.d.ts +32 -0
  90. package/types/unipin-angular-applet.d.ts +3 -0
  91. package/esm2022/graphql/generated.mjs +0 -938
  92. package/esm2022/lib/components/approval/detail/approval-detail.component.mjs +0 -78
  93. package/esm2022/lib/components/approval/form/approval-form.component.mjs +0 -128
  94. package/esm2022/lib/components/approval/index.mjs +0 -5
  95. package/esm2022/lib/components/approval/list/approval-list.component.mjs +0 -114
  96. package/esm2022/lib/components/approval/list/provide-approval-entities.util.mjs +0 -9
  97. package/esm2022/lib/components/approval/services/approval.service.mjs +0 -46
  98. package/esm2022/lib/components/audit/detail/audit-detail.component.mjs +0 -123
  99. package/esm2022/lib/components/audit/index.mjs +0 -3
  100. package/esm2022/lib/components/audit/list/audit-list.component.mjs +0 -81
  101. package/esm2022/lib/components/audit/service/audit.service.mjs +0 -49
  102. package/esm2022/lib/components/audit/types/audit-detail-form.type.mjs +0 -2
  103. package/esm2022/lib/components/buttons/group/btn-group.component.mjs +0 -43
  104. package/esm2022/lib/components/buttons/group/interfaces/btn-group-config.interface.mjs +0 -2
  105. package/esm2022/lib/components/buttons/index.mjs +0 -3
  106. package/esm2022/lib/components/buttons/loading/btn-loading.component.mjs +0 -48
  107. package/esm2022/lib/components/containers/applet-container/applet-container.component.mjs +0 -55
  108. package/esm2022/lib/components/containers/applet-container/provide-applet-config.util.mjs +0 -9
  109. package/esm2022/lib/components/containers/colum-header-container/column-header-container.component.mjs +0 -23
  110. package/esm2022/lib/components/containers/column-container/column-container.component.mjs +0 -79
  111. package/esm2022/lib/components/containers/column-container/directives/lazy-route.directive.mjs +0 -57
  112. package/esm2022/lib/components/containers/index.mjs +0 -7
  113. package/esm2022/lib/components/containers/list-container/index.mjs +0 -3
  114. package/esm2022/lib/components/containers/list-container/interfaces/list-container-config.interface.mjs +0 -2
  115. package/esm2022/lib/components/containers/list-container/list-pagination-container/list-pagination-container.component.mjs +0 -58
  116. package/esm2022/lib/components/containers/list-container/list-snapshot-container/list-snapshot-container.component.mjs +0 -57
  117. package/esm2022/lib/components/containers/modal-container/modal-container.component.mjs +0 -40
  118. package/esm2022/lib/components/filter/filter.component.mjs +0 -222
  119. package/esm2022/lib/components/filter/index.mjs +0 -2
  120. package/esm2022/lib/components/filter/interfaces/filter-config.interface.mjs +0 -2
  121. package/esm2022/lib/components/filter/interfaces/filter-field.interface.mjs +0 -2
  122. package/esm2022/lib/components/filter/interfaces/filter-search-event.interface.mjs +0 -2
  123. package/esm2022/lib/components/forms/country-input/form-country-input.component.mjs +0 -122
  124. package/esm2022/lib/components/forms/currency-input/form-currency-input.component.mjs +0 -157
  125. package/esm2022/lib/components/forms/date/form-date.component.mjs +0 -117
  126. package/esm2022/lib/components/forms/image-picker/directives/drag-n-drop.directive.mjs +0 -49
  127. package/esm2022/lib/components/forms/image-picker/form-image-picker.component.mjs +0 -68
  128. package/esm2022/lib/components/forms/index.mjs +0 -12
  129. package/esm2022/lib/components/forms/input/form-input.component.mjs +0 -98
  130. package/esm2022/lib/components/forms/number/form-number.component.mjs +0 -97
  131. package/esm2022/lib/components/forms/number/pipes/locale-number.pipe.mjs +0 -33
  132. package/esm2022/lib/components/forms/password/form-password.component.mjs +0 -100
  133. package/esm2022/lib/components/forms/rate-group-code-input/form-rate-group-code-input.component.mjs +0 -135
  134. package/esm2022/lib/components/forms/searchable-select/form-searchable-select.component.mjs +0 -138
  135. package/esm2022/lib/components/forms/select/form-select.component.mjs +0 -119
  136. package/esm2022/lib/components/forms/textarea/form-textarea.component.mjs +0 -88
  137. package/esm2022/lib/components/grids/grid-pagination/grid-pagination.component.mjs +0 -111
  138. package/esm2022/lib/components/grids/grid-snapshot/grid-snapshot.component.mjs +0 -109
  139. package/esm2022/lib/components/grids/index.mjs +0 -4
  140. package/esm2022/lib/components/grids/interfaces/grid-config.interface.mjs +0 -2
  141. package/esm2022/lib/components/grids/services/grid.service.mjs +0 -25
  142. package/esm2022/lib/components/index.mjs +0 -9
  143. package/esm2022/lib/components/infinite-scroll/directive/infinite-scroll.directive.mjs +0 -43
  144. package/esm2022/lib/components/infinite-scroll/index.mjs +0 -3
  145. package/esm2022/lib/components/infinite-scroll/infinite-scroll.component.mjs +0 -36
  146. package/esm2022/lib/components/tabs/index.mjs +0 -3
  147. package/esm2022/lib/components/tabs/tab-content/tab-content.component.mjs +0 -37
  148. package/esm2022/lib/components/tabs/tab-group/tab-group.component.mjs +0 -47
  149. package/esm2022/lib/guards/auth/auth.guard.mjs +0 -10
  150. package/esm2022/lib/guards/index.mjs +0 -2
  151. package/esm2022/lib/interceptors/header/header.interceptor.mjs +0 -29
  152. package/esm2022/lib/interceptors/index.mjs +0 -3
  153. package/esm2022/lib/interceptors/refresh-token/refresh-token.interceptor.mjs +0 -83
  154. package/esm2022/lib/interfaces/index.mjs +0 -2
  155. package/esm2022/lib/interfaces/user/user.interface.mjs +0 -2
  156. package/esm2022/lib/modules/index.mjs +0 -3
  157. package/esm2022/lib/modules/micro-frontend/index.mjs +0 -2
  158. package/esm2022/lib/modules/micro-frontend/utils/mf-bootstrap.util.mjs +0 -55
  159. package/esm2022/lib/modules/micro-frontend/utils/mf-global-state.util.mjs +0 -14
  160. package/esm2022/lib/modules/permission/directive/permission.directive.mjs +0 -41
  161. package/esm2022/lib/modules/permission/guards/permission.guard.mjs +0 -26
  162. package/esm2022/lib/modules/permission/index.mjs +0 -7
  163. package/esm2022/lib/modules/permission/pages/401/unauthorized.page.mjs +0 -15
  164. package/esm2022/lib/modules/permission/pages/loading/loading.page.mjs +0 -65
  165. package/esm2022/lib/modules/permission/pages/loading/provide-loading-config.util.mjs +0 -9
  166. package/esm2022/lib/modules/permission/services/permission.service.mjs +0 -50
  167. package/esm2022/lib/resolvers/auth/auth.resolver.mjs +0 -87
  168. package/esm2022/lib/resolvers/index.mjs +0 -2
  169. package/esm2022/lib/services/auth/auth.service.mjs +0 -171
  170. package/esm2022/lib/services/country/country.service.mjs +0 -43
  171. package/esm2022/lib/services/currency/currency.service.mjs +0 -40
  172. package/esm2022/lib/services/index.mjs +0 -6
  173. package/esm2022/lib/services/profile/profile.service.mjs +0 -82
  174. package/esm2022/lib/services/rate-group-code/rate-group-code.service.mjs +0 -31
  175. package/esm2022/lib/utils/contrast-color-generator/contrast-color-generator.util.mjs +0 -16
  176. package/esm2022/lib/utils/form-error-message/form-error-message.util.mjs +0 -21
  177. package/esm2022/lib/utils/format-capitalize/format-capitalize.util.mjs +0 -18
  178. package/esm2022/lib/utils/index.mjs +0 -5
  179. package/esm2022/lib/utils/redirect-to-first-menu/redirect-to-first-menu.util.mjs +0 -9
  180. package/esm2022/public-api.mjs +0 -10
  181. package/esm2022/unipin-angular-applet.mjs +0 -2
  182. package/graphql/generated.d.ts +0 -16225
  183. package/index.d.ts +0 -2
  184. package/lib/components/approval/detail/approval-detail.component.d.ts +0 -26
  185. package/lib/components/approval/form/approval-form.component.d.ts +0 -33
  186. package/lib/components/approval/index.d.ts +0 -4
  187. package/lib/components/approval/list/approval-list.component.d.ts +0 -33
  188. package/lib/components/approval/list/provide-approval-entities.util.d.ts +0 -3
  189. package/lib/components/approval/services/approval.service.d.ts +0 -18
  190. package/lib/components/audit/detail/audit-detail.component.d.ts +0 -33
  191. package/lib/components/audit/index.d.ts +0 -2
  192. package/lib/components/audit/list/audit-list.component.d.ts +0 -31
  193. package/lib/components/audit/service/audit.service.d.ts +0 -15
  194. package/lib/components/audit/types/audit-detail-form.type.d.ts +0 -12
  195. package/lib/components/buttons/group/btn-group.component.d.ts +0 -18
  196. package/lib/components/buttons/group/interfaces/btn-group-config.interface.d.ts +0 -11
  197. package/lib/components/buttons/index.d.ts +0 -3
  198. package/lib/components/buttons/loading/btn-loading.component.d.ts +0 -19
  199. package/lib/components/containers/applet-container/applet-container.component.d.ts +0 -22
  200. package/lib/components/containers/applet-container/provide-applet-config.util.d.ts +0 -15
  201. package/lib/components/containers/colum-header-container/column-header-container.component.d.ts +0 -7
  202. package/lib/components/containers/column-container/column-container.component.d.ts +0 -26
  203. package/lib/components/containers/column-container/directives/lazy-route.directive.d.ts +0 -17
  204. package/lib/components/containers/index.d.ts +0 -6
  205. package/lib/components/containers/list-container/index.d.ts +0 -3
  206. package/lib/components/containers/list-container/interfaces/list-container-config.interface.d.ts +0 -9
  207. package/lib/components/containers/list-container/list-pagination-container/list-pagination-container.component.d.ts +0 -23
  208. package/lib/components/containers/list-container/list-snapshot-container/list-snapshot-container.component.d.ts +0 -23
  209. package/lib/components/containers/modal-container/modal-container.component.d.ts +0 -16
  210. package/lib/components/filter/filter.component.d.ts +0 -44
  211. package/lib/components/filter/index.d.ts +0 -4
  212. package/lib/components/filter/interfaces/filter-config.interface.d.ts +0 -5
  213. package/lib/components/filter/interfaces/filter-field.interface.d.ts +0 -24
  214. package/lib/components/filter/interfaces/filter-search-event.interface.d.ts +0 -4
  215. package/lib/components/forms/country-input/form-country-input.component.d.ts +0 -41
  216. package/lib/components/forms/currency-input/form-currency-input.component.d.ts +0 -52
  217. package/lib/components/forms/date/form-date.component.d.ts +0 -33
  218. package/lib/components/forms/image-picker/directives/drag-n-drop.directive.d.ts +0 -10
  219. package/lib/components/forms/image-picker/form-image-picker.component.d.ts +0 -21
  220. package/lib/components/forms/index.d.ts +0 -11
  221. package/lib/components/forms/input/form-input.component.d.ts +0 -31
  222. package/lib/components/forms/number/form-number.component.d.ts +0 -27
  223. package/lib/components/forms/number/pipes/locale-number.pipe.d.ts +0 -8
  224. package/lib/components/forms/password/form-password.component.d.ts +0 -27
  225. package/lib/components/forms/rate-group-code-input/form-rate-group-code-input.component.d.ts +0 -41
  226. package/lib/components/forms/searchable-select/form-searchable-select.component.d.ts +0 -42
  227. package/lib/components/forms/select/form-select.component.d.ts +0 -34
  228. package/lib/components/forms/textarea/form-textarea.component.d.ts +0 -26
  229. package/lib/components/grids/grid-pagination/grid-pagination.component.d.ts +0 -33
  230. package/lib/components/grids/grid-snapshot/grid-snapshot.component.d.ts +0 -36
  231. package/lib/components/grids/index.d.ts +0 -4
  232. package/lib/components/grids/interfaces/grid-config.interface.d.ts +0 -16
  233. package/lib/components/grids/services/grid.service.d.ts +0 -12
  234. package/lib/components/index.d.ts +0 -8
  235. package/lib/components/infinite-scroll/directive/infinite-scroll.directive.d.ts +0 -15
  236. package/lib/components/infinite-scroll/index.d.ts +0 -2
  237. package/lib/components/infinite-scroll/infinite-scroll.component.d.ts +0 -12
  238. package/lib/components/tabs/index.d.ts +0 -6
  239. package/lib/components/tabs/tab-content/tab-content.component.d.ts +0 -14
  240. package/lib/components/tabs/tab-group/tab-group.component.d.ts +0 -18
  241. package/lib/guards/auth/auth.guard.d.ts +0 -1
  242. package/lib/guards/index.d.ts +0 -1
  243. package/lib/interceptors/header/header.interceptor.d.ts +0 -9
  244. package/lib/interceptors/index.d.ts +0 -2
  245. package/lib/interceptors/refresh-token/refresh-token.interceptor.d.ts +0 -14
  246. package/lib/interfaces/index.d.ts +0 -1
  247. package/lib/interfaces/user/user.interface.d.ts +0 -27
  248. package/lib/modules/index.d.ts +0 -2
  249. package/lib/modules/micro-frontend/index.d.ts +0 -1
  250. package/lib/modules/micro-frontend/utils/mf-bootstrap.util.d.ts +0 -9
  251. package/lib/modules/micro-frontend/utils/mf-global-state.util.d.ts +0 -4
  252. package/lib/modules/permission/directive/permission.directive.d.ts +0 -16
  253. package/lib/modules/permission/guards/permission.guard.d.ts +0 -2
  254. package/lib/modules/permission/index.d.ts +0 -6
  255. package/lib/modules/permission/pages/401/unauthorized.page.d.ts +0 -5
  256. package/lib/modules/permission/pages/loading/loading.page.d.ts +0 -18
  257. package/lib/modules/permission/pages/loading/provide-loading-config.util.d.ts +0 -10
  258. package/lib/modules/permission/services/permission.service.d.ts +0 -21
  259. package/lib/resolvers/auth/auth.resolver.d.ts +0 -14
  260. package/lib/resolvers/index.d.ts +0 -1
  261. package/lib/services/auth/auth.service.d.ts +0 -39
  262. package/lib/services/country/country.service.d.ts +0 -16
  263. package/lib/services/currency/currency.service.d.ts +0 -16
  264. package/lib/services/index.d.ts +0 -5
  265. package/lib/services/profile/profile.service.d.ts +0 -12
  266. package/lib/services/rate-group-code/rate-group-code.service.d.ts +0 -14
  267. package/lib/utils/contrast-color-generator/contrast-color-generator.util.d.ts +0 -4
  268. package/lib/utils/form-error-message/form-error-message.util.d.ts +0 -2
  269. package/lib/utils/format-capitalize/format-capitalize.util.d.ts +0 -1
  270. package/lib/utils/index.d.ts +0 -4
  271. package/lib/utils/redirect-to-first-menu/redirect-to-first-menu.util.d.ts +0 -2
  272. package/public-api.d.ts +0 -11
  273. package/src/assets/scss/forms.scss +0 -65
  274. package/src/assets/scss/grid.scss +0 -7505
  275. package/src/assets/scss/select.scss +0 -328
@@ -0,0 +1,142 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, signal, computed, effect, Component, Directive } from '@angular/core';
3
+ import { up } from '@unipin/angular-applet/common';
4
+ import { cva } from 'class-variance-authority';
5
+
6
+ const tabsVariants = cva(`
7
+ flex mb-2 w-max p-1 rounded-lg
8
+ [&>.tabs-trigger]:px-2.5 [&>.tabs-trigger]:py-1.5 [&>.tabs-trigger]:text-sm [&>.tabs-trigger]:transition-colors [&>.tabs-trigger]:cursor-pointer
9
+ `, {
10
+ variants: {
11
+ variant: {
12
+ default: `
13
+ bg-gray-100
14
+ [&>.tabs-trigger]:data-[state=active]:bg-white [&>.tabs-trigger]:data-[state=active]:shadow-lg [&>.tabs-trigger]:data-[state=active]:rounded-lg [&>.tabs-trigger]:hover:opacity-[60%]
15
+ `,
16
+ underline: `
17
+ bg-none
18
+ [&>.tabs-trigger]:border-b-2 [&>.tabs-trigger]:border-transparent [&>.tabs-trigger]:hover:text-primary [&>.tabs-trigger]:text-gray-500 [&>.tabs-trigger]:data-[state=active]:border-primary [&>.tabs-trigger]:data-[state=active]:text-primary
19
+ `,
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ variant: 'default',
24
+ },
25
+ });
26
+
27
+ class UpTabsComponent {
28
+ constructor() {
29
+ this.size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
30
+ this.variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : []));
31
+ this.inlineStyle = input('', ...(ngDevMode ? [{ debugName: "inlineStyle", alias: 'class' }] : [{ alias: 'class' }]));
32
+ this.defaultActiveTab = input(null, ...(ngDevMode ? [{ debugName: "defaultActiveTab", alias: 'default' }] : [{ alias: 'default' }]));
33
+ this.activeTab = signal(null, ...(ngDevMode ? [{ debugName: "activeTab" }] : []));
34
+ this.tabsClass = computed(() => {
35
+ return up(tabsVariants({
36
+ variant: this.variant()
37
+ }), this.inlineStyle());
38
+ }, ...(ngDevMode ? [{ debugName: "tabsClass" }] : []));
39
+ effect(() => {
40
+ if (this.activeTab() === null &&
41
+ this.defaultActiveTab()) {
42
+ this.activeTab.set(this.defaultActiveTab());
43
+ }
44
+ });
45
+ }
46
+ setActive(tab) {
47
+ this.activeTab.set(tab);
48
+ }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UpTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
50
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.0", type: UpTabsComponent, isStandalone: true, selector: "up-tabs", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, inlineStyle: { classPropertyName: "inlineStyle", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, defaultActiveTab: { classPropertyName: "defaultActiveTab", publicName: "default", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
51
+ <div [class]="tabsClass()">
52
+ <ng-content select="[upTabsTrigger]" />
53
+ </div>
54
+
55
+ <ng-content select="[upTabsContent]" />
56
+ `, isInline: true }); }
57
+ }
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UpTabsComponent, decorators: [{
59
+ type: Component,
60
+ args: [{
61
+ standalone: true,
62
+ selector: 'up-tabs',
63
+ template: `
64
+ <div [class]="tabsClass()">
65
+ <ng-content select="[upTabsTrigger]" />
66
+ </div>
67
+
68
+ <ng-content select="[upTabsContent]" />
69
+ `,
70
+ }]
71
+ }], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], inlineStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], defaultActiveTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "default", required: false }] }] } });
72
+
73
+ class UpTabsContentDirective {
74
+ constructor(parent) {
75
+ this.parent = parent;
76
+ this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
77
+ this.inlineStyle = input('', ...(ngDevMode ? [{ debugName: "inlineStyle", alias: 'class' }] : [{ alias: 'class' }]));
78
+ this.isActive = signal(false, ...(ngDevMode ? [{ debugName: "isActive" }] : []));
79
+ this.tabsContentClass = computed(() => {
80
+ return up('block', this.inlineStyle());
81
+ }, ...(ngDevMode ? [{ debugName: "tabsContentClass" }] : []));
82
+ effect(() => {
83
+ if (!this.parent) {
84
+ return;
85
+ }
86
+ this.isActive.set(this.parent.activeTab() === this.value());
87
+ });
88
+ }
89
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UpTabsContentDirective, deps: [{ token: UpTabsComponent }], target: i0.ɵɵFactoryTarget.Directive }); }
90
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.0", type: UpTabsContentDirective, isStandalone: true, selector: "[upTabsContent]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, inlineStyle: { classPropertyName: "inlineStyle", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "hidden": "!isActive()", "class": "tabsContentClass()" } }, exportAs: ["upTabsContent"], ngImport: i0 }); }
91
+ }
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UpTabsContentDirective, decorators: [{
93
+ type: Directive,
94
+ args: [{
95
+ standalone: true,
96
+ exportAs: 'upTabsContent',
97
+ selector: '[upTabsContent]',
98
+ host: {
99
+ '[hidden]': '!isActive()',
100
+ '[class]': 'tabsContentClass()',
101
+ }
102
+ }]
103
+ }], ctorParameters: () => [{ type: UpTabsComponent }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], inlineStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
104
+
105
+ class UpTabsTriggerDirective {
106
+ constructor(parent) {
107
+ this.parent = parent;
108
+ this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
109
+ this.isActive = signal(false, ...(ngDevMode ? [{ debugName: "isActive" }] : []));
110
+ this.tabsTriggerClass = computed(() => up('tabs-trigger'), ...(ngDevMode ? [{ debugName: "tabsTriggerClass" }] : []));
111
+ effect(() => {
112
+ if (!this.parent)
113
+ return;
114
+ this.isActive.set(this.parent.activeTab() === this.value());
115
+ });
116
+ }
117
+ activate() {
118
+ this.parent?.setActive(this.value());
119
+ }
120
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UpTabsTriggerDirective, deps: [{ token: UpTabsComponent }], target: i0.ɵɵFactoryTarget.Directive }); }
121
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.0", type: UpTabsTriggerDirective, isStandalone: true, selector: "[upTabsTrigger]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "activate()" }, properties: { "class": "tabsTriggerClass()", "attr.data-state": "isActive()? 'active' : 'inactive'" } }, exportAs: ["upTabsTrigger"], ngImport: i0 }); }
122
+ }
123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UpTabsTriggerDirective, decorators: [{
124
+ type: Directive,
125
+ args: [{
126
+ standalone: true,
127
+ exportAs: 'upTabsTrigger',
128
+ selector: '[upTabsTrigger]',
129
+ host: {
130
+ '(click)': 'activate()',
131
+ '[class]': 'tabsTriggerClass()',
132
+ '[attr.data-state]': `isActive()? 'active' : 'inactive'`,
133
+ }
134
+ }]
135
+ }], ctorParameters: () => [{ type: UpTabsComponent }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
136
+
137
+ /**
138
+ * Generated bundle index. Do not edit.
139
+ */
140
+
141
+ export { UpTabsComponent, UpTabsContentDirective, UpTabsTriggerDirective };
142
+ //# sourceMappingURL=unipin-angular-applet-tabs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unipin-angular-applet-tabs.mjs","sources":["../../../projects/unipin-angular/tabs/variants/tabs.variant.ts","../../../projects/unipin-angular/tabs/components/tabs.component.ts","../../../projects/unipin-angular/tabs/directives/tabs-content.directive.ts","../../../projects/unipin-angular/tabs/directives/tabs-trigger.directive.ts","../../../projects/unipin-angular/tabs/unipin-angular-applet-tabs.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const tabsVariants = cva(\n `\n flex mb-2 w-max p-1 rounded-lg\n [&>.tabs-trigger]:px-2.5 [&>.tabs-trigger]:py-1.5 [&>.tabs-trigger]:text-sm [&>.tabs-trigger]:transition-colors [&>.tabs-trigger]:cursor-pointer\n `,\n {\n variants: {\n variant: {\n default: `\n bg-gray-100 \n [&>.tabs-trigger]:data-[state=active]:bg-white [&>.tabs-trigger]:data-[state=active]:shadow-lg [&>.tabs-trigger]:data-[state=active]:rounded-lg [&>.tabs-trigger]:hover:opacity-[60%]\n `,\n underline: `\n bg-none \n [&>.tabs-trigger]:border-b-2 [&>.tabs-trigger]:border-transparent [&>.tabs-trigger]:hover:text-primary [&>.tabs-trigger]:text-gray-500 [&>.tabs-trigger]:data-[state=active]:border-primary [&>.tabs-trigger]:data-[state=active]:text-primary\n `,\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\nexport type TabsVariants = VariantProps<typeof tabsVariants>;\n","import { Component, computed, effect, input, InputSignal, signal, WritableSignal } from '@angular/core';\nimport type { ClassValue } from 'clsx';\nimport { up } from '@unipin/angular-applet/common';\nimport { tabsVariants } from '../variants/tabs.variant';\n\n@Component({\n standalone: true,\n selector: 'up-tabs',\n template: `\n <div [class]=\"tabsClass()\">\n <ng-content select=\"[upTabsTrigger]\" />\n </div>\n\n <ng-content select=\"[upTabsContent]\" />\n `,\n})\nexport class UpTabsComponent {\n\n public readonly size: InputSignal<'sm' | 'md' | 'lg'> = input<'sm' | 'md' | 'lg'>('md');\n public readonly variant: InputSignal<'underline' | 'default'> = input<'underline' | 'default'>('default');\n\n public readonly inlineStyle: InputSignal<ClassValue> = input<ClassValue>('', { alias: 'class' });\n public readonly defaultActiveTab: InputSignal<string | null> = input<string | null>(null, { alias: 'default' });\n\n public readonly activeTab: WritableSignal<string | null> = signal<string | null>(null);\n public readonly tabsClass = computed(\n () => {\n return up(\n tabsVariants(\n {\n variant: this.variant()\n }\n ),\n this.inlineStyle()\n );\n }\n );\n\n constructor() {\n effect(\n () => {\n if (\n this.activeTab() === null && \n this.defaultActiveTab()\n ) {\n this.activeTab.set(this.defaultActiveTab());\n }\n }\n );\n }\n\n public setActive(tab: string): void{\n this.activeTab.set(tab);\n }\n}\n","import { computed, Directive, effect, input, InputSignal, signal, WritableSignal } from '@angular/core';\nimport { ClassValue } from 'clsx';\nimport { up } from '@unipin/angular-applet/common';\nimport { UpTabsComponent } from '../components/tabs.component';\n\n@Directive({\n standalone: true,\n exportAs: 'upTabsContent',\n selector: '[upTabsContent]',\n host: {\n '[hidden]': '!isActive()',\n '[class]': 'tabsContentClass()',\n }\n})\nexport class UpTabsContentDirective {\n\n public readonly value: InputSignal<string> = input.required<string>();\n public readonly inlineStyle: InputSignal<ClassValue> = input<ClassValue>('', { alias: 'class' });\n\n public readonly isActive: WritableSignal<boolean> = signal(false);\n public readonly tabsContentClass = computed(\n () => {\n return up('block', this.inlineStyle());\n }\n );\n\n constructor(\n protected readonly parent: UpTabsComponent\n ) {\n effect(\n () => {\n if (!this.parent) {\n return;\n }\n \n this.isActive.set(\n this.parent.activeTab() === this.value()\n );\n }\n );\n }\n}\n","import { computed, Directive, effect, input, signal } from '@angular/core';\nimport { up } from '@unipin/angular-applet/common';\nimport { UpTabsComponent } from '../components/tabs.component';\n\n@Directive({\n standalone: true,\n exportAs: 'upTabsTrigger',\n selector: '[upTabsTrigger]',\n host: {\n '(click)': 'activate()',\n '[class]': 'tabsTriggerClass()',\n '[attr.data-state]': `isActive()? 'active' : 'inactive'`,\n }\n})\nexport class UpTabsTriggerDirective {\n \n public readonly value = input.required<string>();\n \n public readonly isActive = signal(false);\n public readonly tabsTriggerClass = computed(() => up('tabs-trigger'));\n\n constructor(\n protected readonly parent: UpTabsComponent\n ) {\n effect(\n () => {\n if (!this.parent) return;\n this.isActive.set(this.parent.activeTab() === this.value());\n }\n );\n }\n\n public activate(): void{\n this.parent?.setActive(this.value());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.UpTabsComponent"],"mappings":";;;;;AAEO,MAAM,YAAY,GAAG,GAAG,CAC7B;;;GAGC,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE;;;AAGR,QAAA,CAAA;AACD,YAAA,SAAS,EAAE;;;AAGV,QAAA,CAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,SAAS;AACnB,KAAA;AACF,CAAA,CACF;;MCRY,eAAe,CAAA;AAsB1B,IAAA,WAAA,GAAA;AApBgB,QAAA,IAAA,CAAA,IAAI,GAAoC,KAAK,CAAqB,IAAI,gDAAC;AACvE,QAAA,IAAA,CAAA,OAAO,GAAyC,KAAK,CAA0B,SAAS,mDA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AA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,YAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,oBAAA,EAAA,iBAAA,EAAA,mCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAVlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,YAAY;AACvB,wBAAA,SAAS,EAAE,oBAAoB;AAC/B,wBAAA,mBAAmB,EAAE,CAAA,iCAAA,CAAmC;AACzD;AACF,iBAAA;;;ACbD;;AAEG;;;;"}
@@ -0,0 +1,118 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, Inject, Directive } from '@angular/core';
3
+ import { DOCUMENT } from '@angular/common';
4
+
5
+ class UpTooltipDirective {
6
+ constructor(doc, renderer, el) {
7
+ this.doc = doc;
8
+ this.renderer = renderer;
9
+ this.el = el;
10
+ /**
11
+ * Input variable specifying the text displayed in the tooltip helper, which provides a hint to the user about the purpose of the element.
12
+ * @type {InputSignal<string>}
13
+ * @default ''
14
+ */
15
+ this.toolTipText = input.required(...(ngDevMode ? [{ debugName: "toolTipText" }] : []));
16
+ /**
17
+ * Input variable specifying the position of the tooltip relative to the host element.
18
+ * @type {InputSignal<string>}
19
+ * @default 'top'
20
+ */
21
+ this.position = input('top', ...(ngDevMode ? [{ debugName: "position" }] : []));
22
+ this._winListener = [];
23
+ this._hostListener = [];
24
+ this._tooltipElement = null;
25
+ }
26
+ ngOnInit() {
27
+ this._hostListener.push(this.renderer.listen(this.el.nativeElement, 'mouseenter', () => {
28
+ if (this._tooltipElement) {
29
+ this.renderer.removeClass(this._tooltipElement, 'invisible');
30
+ return;
31
+ }
32
+ this._tooltipElement = this.renderer.createElement('span');
33
+ this.renderer.setAttribute(this._tooltipElement, 'class', 'fixed z-[10000] text-white max-w-xs text-xs w-max whitespace-normal bg-[#2D3336] rounded-lg px-2 py-1 break-words pointer-events-none');
34
+ this.renderer.appendChild(this._tooltipElement, this.renderer.createText(this.toolTipText()));
35
+ this.renderer.appendChild(this.doc.body, this._tooltipElement);
36
+ this.positionTooltip();
37
+ this._winListener.push(this.renderer.listen('window', 'scroll', () => this.positionTooltip()), this.renderer.listen('window', 'resize', () => this.positionTooltip()));
38
+ }), this.renderer.listen(this.el.nativeElement, 'mouseleave', () => {
39
+ this.hideTooltip();
40
+ }));
41
+ }
42
+ ngOnDestroy() {
43
+ this.hideTooltip();
44
+ for (const off of this._hostListener) {
45
+ try {
46
+ off();
47
+ }
48
+ catch { }
49
+ }
50
+ this._hostListener.length = 0;
51
+ for (const off of this._winListener) {
52
+ try {
53
+ off();
54
+ }
55
+ catch { }
56
+ }
57
+ this._winListener.length = 0;
58
+ }
59
+ hideTooltip() {
60
+ if (this._tooltipElement) {
61
+ this.renderer.addClass(this._tooltipElement, 'invisible');
62
+ }
63
+ }
64
+ positionTooltip() {
65
+ if (!this._tooltipElement) {
66
+ return;
67
+ }
68
+ const hostRect = this.el.nativeElement.getBoundingClientRect();
69
+ const tooltipEl = this._tooltipElement;
70
+ const tooltipRect = tooltipEl.getBoundingClientRect();
71
+ const gap = 8;
72
+ let top = 0;
73
+ let left = 0;
74
+ switch (this.position()) {
75
+ case 'top':
76
+ top = hostRect.top - tooltipRect.height - gap;
77
+ left = hostRect.left + (hostRect.width - tooltipRect.width) / 2;
78
+ break;
79
+ case 'left':
80
+ top = hostRect.top + (hostRect.height - tooltipRect.height) / 2;
81
+ left = hostRect.left - tooltipRect.width - gap;
82
+ break;
83
+ case 'right':
84
+ top = hostRect.top + (hostRect.height - tooltipRect.height) / 2;
85
+ left = hostRect.right + gap;
86
+ break;
87
+ default:
88
+ top = hostRect.bottom + gap;
89
+ left = hostRect.left + (hostRect.width - tooltipRect.width) / 2;
90
+ break;
91
+ }
92
+ const margin = 4;
93
+ left = Math.max(margin, Math.min(left, this.doc.defaultView?.innerWidth ?? 0 - tooltipRect.width - margin));
94
+ top = Math.max(margin, Math.min(top, this.doc.defaultView?.innerHeight ?? 0 - tooltipRect.height - margin));
95
+ this.renderer.setStyle(tooltipEl, 'top', `${Math.round(top)}px`);
96
+ this.renderer.setStyle(tooltipEl, 'left', `${Math.round(left)}px`);
97
+ }
98
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UpTooltipDirective, deps: [{ token: DOCUMENT }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
99
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.0", type: UpTooltipDirective, isStandalone: true, selector: "[upTooltip]", inputs: { toolTipText: { classPropertyName: "toolTipText", publicName: "toolTipText", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["upTooltip"], ngImport: i0 }); }
100
+ }
101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UpTooltipDirective, decorators: [{
102
+ type: Directive,
103
+ args: [{
104
+ standalone: true,
105
+ exportAs: 'upTooltip',
106
+ selector: '[upTooltip]',
107
+ }]
108
+ }], ctorParameters: () => [{ type: Document, decorators: [{
109
+ type: Inject,
110
+ args: [DOCUMENT]
111
+ }] }, { type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { toolTipText: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolTipText", required: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }] } });
112
+
113
+ /**
114
+ * Generated bundle index. Do not edit.
115
+ */
116
+
117
+ export { UpTooltipDirective };
118
+ //# sourceMappingURL=unipin-angular-applet-tooltip.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unipin-angular-applet-tooltip.mjs","sources":["../../../projects/unipin-angular/tooltip/tooltip.directive.ts","../../../projects/unipin-angular/tooltip/unipin-angular-applet-tooltip.ts"],"sourcesContent":["import { Directive, ElementRef, Renderer2, OnInit, OnDestroy, input, Inject } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\n\n@Directive({\n standalone: true,\n exportAs: 'upTooltip',\n selector: '[upTooltip]',\n})\nexport class UpTooltipDirective implements OnInit, OnDestroy {\n\n /**\n * Input variable specifying the text displayed in the tooltip helper, which provides a hint to the user about the purpose of the element.\n * @type {InputSignal<string>}\n * @default ''\n */\n public readonly toolTipText = input.required<string>();\n \n /**\n * Input variable specifying the position of the tooltip relative to the host element.\n * @type {InputSignal<string>}\n * @default 'top'\n */\n public readonly position = input<'top' | 'right' | 'bottom' | 'left'>('top');\n \n protected _winListener: Array<() => void> = [];\n protected _hostListener: Array<() => void> = [];\n protected _tooltipElement: HTMLElement | null = null;\n\n constructor(\n @Inject(DOCUMENT) protected readonly doc: Document,\n protected readonly renderer: Renderer2,\n protected readonly el: ElementRef<HTMLElement>,\n ) {}\n\n public ngOnInit(): void{\n this._hostListener.push(\n this.renderer.listen(\n this.el.nativeElement, \n 'mouseenter', \n () => {\n if (this._tooltipElement) {\n this.renderer.removeClass(this._tooltipElement, 'invisible');\n return;\n }\n this._tooltipElement = this.renderer.createElement('span');\n \n this.renderer.setAttribute(\n this._tooltipElement, \n 'class', \n 'fixed z-[10000] text-white max-w-xs text-xs w-max whitespace-normal bg-[#2D3336] rounded-lg px-2 py-1 break-words pointer-events-none'\n );\n\n this.renderer.appendChild(\n this._tooltipElement, \n this.renderer.createText(\n this.toolTipText()\n )\n );\n this.renderer.appendChild(this.doc.body, this._tooltipElement);\n \n this.positionTooltip(); \n this._winListener.push(\n this.renderer.listen('window', 'scroll', () => this.positionTooltip()),\n this.renderer.listen('window', 'resize', () => this.positionTooltip())\n );\n }\n ),\n \n this.renderer.listen(\n this.el.nativeElement, \n 'mouseleave', \n () => {\n this.hideTooltip();\n }\n )\n );\n }\n\n public ngOnDestroy(): void{\n this.hideTooltip();\n\n for (const off of this._hostListener) {\n try { \n off(); \n } catch {}\n }\n this._hostListener.length = 0;\n\n for (const off of this._winListener) {\n try { \n off(); \n } catch {}\n }\n this._winListener.length = 0;\n }\n\n protected hideTooltip(): void{\n if (this._tooltipElement) {\n this.renderer.addClass(this._tooltipElement, 'invisible');\n }\n }\n\n protected positionTooltip(): void{\n if (!this._tooltipElement) {\n return;\n }\n\n const hostRect = this.el.nativeElement.getBoundingClientRect();\n const tooltipEl = this._tooltipElement as HTMLElement;\n const tooltipRect = tooltipEl.getBoundingClientRect();\n\n const gap = 8;\n let top = 0;\n let left = 0;\n\n switch (this.position()) {\n case 'top':\n top = hostRect.top - tooltipRect.height - gap;\n left = hostRect.left + (hostRect.width - tooltipRect.width) / 2;\n break;\n\n case 'left':\n top = hostRect.top + (hostRect.height - tooltipRect.height) / 2;\n left = hostRect.left - tooltipRect.width - gap;\n break;\n\n case 'right':\n top = hostRect.top + (hostRect.height - tooltipRect.height) / 2;\n left = hostRect.right + gap;\n break;\n\n default:\n top = hostRect.bottom + gap;\n left = hostRect.left + (hostRect.width - tooltipRect.width) / 2;\n break;\n }\n\n const margin = 4;\n left = Math.max(\n margin, \n Math.min(\n left, \n this.doc.defaultView?.innerWidth?? 0 - tooltipRect.width - margin\n )\n );\n \n top = Math.max(\n margin, \n Math.min(\n top, \n this.doc.defaultView?.innerHeight?? 0 - tooltipRect.height - margin\n )\n );\n this.renderer.setStyle(tooltipEl, 'top', `${ Math.round(top) }px`);\n this.renderer.setStyle(tooltipEl, 'left', `${ Math.round(left) }px`);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAQa,kBAA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