@lluc_llull/ui-lib 0.33.10 → 0.34.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 (262) hide show
  1. package/README.md +1 -1
  2. package/fesm2022/lluc_llull-ui-lib-content-asymmetric-media.mjs +85 -28
  3. package/fesm2022/lluc_llull-ui-lib-content-asymmetric-media.mjs.map +1 -1
  4. package/fesm2022/lluc_llull-ui-lib-content-category-progress.mjs +81 -30
  5. package/fesm2022/lluc_llull-ui-lib-content-category-progress.mjs.map +1 -1
  6. package/fesm2022/lluc_llull-ui-lib-content-columns-media-stacked.mjs +90 -34
  7. package/fesm2022/lluc_llull-ui-lib-content-columns-media-stacked.mjs.map +1 -1
  8. package/fesm2022/lluc_llull-ui-lib-content-contact-minimal.mjs +109 -37
  9. package/fesm2022/lluc_llull-ui-lib-content-contact-minimal.mjs.map +1 -1
  10. package/fesm2022/lluc_llull-ui-lib-content-content-document.mjs +58 -26
  11. package/fesm2022/lluc_llull-ui-lib-content-content-document.mjs.map +1 -1
  12. package/fesm2022/lluc_llull-ui-lib-content-hero-section.mjs +139 -110
  13. package/fesm2022/lluc_llull-ui-lib-content-hero-section.mjs.map +1 -1
  14. package/fesm2022/lluc_llull-ui-lib-content-media-intro.mjs +91 -34
  15. package/fesm2022/lluc_llull-ui-lib-content-media-intro.mjs.map +1 -1
  16. package/fesm2022/lluc_llull-ui-lib-content-media-split.mjs +118 -76
  17. package/fesm2022/lluc_llull-ui-lib-content-media-split.mjs.map +1 -1
  18. package/fesm2022/lluc_llull-ui-lib-content-mosaic-grid.mjs +99 -44
  19. package/fesm2022/lluc_llull-ui-lib-content-mosaic-grid.mjs.map +1 -1
  20. package/fesm2022/lluc_llull-ui-lib-content-mosaic-parallax.mjs +109 -57
  21. package/fesm2022/lluc_llull-ui-lib-content-mosaic-parallax.mjs.map +1 -1
  22. package/fesm2022/lluc_llull-ui-lib-content-section-intro.mjs +100 -37
  23. package/fesm2022/lluc_llull-ui-lib-content-section-intro.mjs.map +1 -1
  24. package/fesm2022/lluc_llull-ui-lib-content-split-previewer.mjs +133 -61
  25. package/fesm2022/lluc_llull-ui-lib-content-split-previewer.mjs.map +1 -1
  26. package/fesm2022/lluc_llull-ui-lib-content-split-showcase.mjs +99 -37
  27. package/fesm2022/lluc_llull-ui-lib-content-split-showcase.mjs.map +1 -1
  28. package/fesm2022/lluc_llull-ui-lib-content-stacked-rows.mjs +61 -29
  29. package/fesm2022/lluc_llull-ui-lib-content-stacked-rows.mjs.map +1 -1
  30. package/fesm2022/lluc_llull-ui-lib-content.mjs +1286 -502
  31. package/fesm2022/lluc_llull-ui-lib-content.mjs.map +1 -1
  32. package/fesm2022/lluc_llull-ui-lib-directives.mjs +383 -262
  33. package/fesm2022/lluc_llull-ui-lib-directives.mjs.map +1 -1
  34. package/fesm2022/lluc_llull-ui-lib-effects.mjs +187 -150
  35. package/fesm2022/lluc_llull-ui-lib-effects.mjs.map +1 -1
  36. package/fesm2022/lluc_llull-ui-lib-enums.mjs +8 -12
  37. package/fesm2022/lluc_llull-ui-lib-enums.mjs.map +1 -1
  38. package/fesm2022/lluc_llull-ui-lib-feedback-404.mjs +97 -34
  39. package/fesm2022/lluc_llull-ui-lib-feedback-404.mjs.map +1 -1
  40. package/fesm2022/lluc_llull-ui-lib-feedback.mjs +97 -34
  41. package/fesm2022/lluc_llull-ui-lib-feedback.mjs.map +1 -1
  42. package/fesm2022/lluc_llull-ui-lib-footers-columns-footer.mjs +65 -27
  43. package/fesm2022/lluc_llull-ui-lib-footers-columns-footer.mjs.map +1 -1
  44. package/fesm2022/lluc_llull-ui-lib-footers-legal-footer.mjs +74 -37
  45. package/fesm2022/lluc_llull-ui-lib-footers-legal-footer.mjs.map +1 -1
  46. package/fesm2022/lluc_llull-ui-lib-footers-links-footer.mjs +59 -24
  47. package/fesm2022/lluc_llull-ui-lib-footers-links-footer.mjs.map +1 -1
  48. package/fesm2022/lluc_llull-ui-lib-footers-social-footer.mjs +95 -32
  49. package/fesm2022/lluc_llull-ui-lib-footers-social-footer.mjs.map +1 -1
  50. package/fesm2022/lluc_llull-ui-lib-footers-visual-footer.mjs +84 -45
  51. package/fesm2022/lluc_llull-ui-lib-footers-visual-footer.mjs.map +1 -1
  52. package/fesm2022/lluc_llull-ui-lib-footers.mjs +354 -125
  53. package/fesm2022/lluc_llull-ui-lib-footers.mjs.map +1 -1
  54. package/fesm2022/lluc_llull-ui-lib-headers-header-clear.mjs +153 -78
  55. package/fesm2022/lluc_llull-ui-lib-headers-header-clear.mjs.map +1 -1
  56. package/fesm2022/lluc_llull-ui-lib-headers-header-mobile.mjs +153 -78
  57. package/fesm2022/lluc_llull-ui-lib-headers-header-mobile.mjs.map +1 -1
  58. package/fesm2022/lluc_llull-ui-lib-headers.mjs +296 -142
  59. package/fesm2022/lluc_llull-ui-lib-headers.mjs.map +1 -1
  60. package/fesm2022/lluc_llull-ui-lib-interfaces.mjs +0 -4
  61. package/fesm2022/lluc_llull-ui-lib-mapper.mjs +242 -264
  62. package/fesm2022/lluc_llull-ui-lib-mapper.mjs.map +1 -1
  63. package/fesm2022/lluc_llull-ui-lib-modals.mjs +163 -65
  64. package/fesm2022/lluc_llull-ui-lib-modals.mjs.map +1 -1
  65. package/fesm2022/lluc_llull-ui-lib-screen-sizer.mjs +106 -97
  66. package/fesm2022/lluc_llull-ui-lib-screen-sizer.mjs.map +1 -1
  67. package/fesm2022/lluc_llull-ui-lib-shared.mjs +279 -148
  68. package/fesm2022/lluc_llull-ui-lib-shared.mjs.map +1 -1
  69. package/fesm2022/lluc_llull-ui-lib-sliders.mjs +72 -52
  70. package/fesm2022/lluc_llull-ui-lib-sliders.mjs.map +1 -1
  71. package/fesm2022/lluc_llull-ui-lib-theme.mjs +78 -80
  72. package/fesm2022/lluc_llull-ui-lib-theme.mjs.map +1 -1
  73. package/fesm2022/lluc_llull-ui-lib-utils.mjs +42 -64
  74. package/fesm2022/lluc_llull-ui-lib-utils.mjs.map +1 -1
  75. package/fesm2022/lluc_llull-ui-lib.mjs +42 -27
  76. package/fesm2022/lluc_llull-ui-lib.mjs.map +1 -1
  77. package/package.json +86 -85
  78. package/types/lluc_llull-ui-lib-content-asymmetric-media.d.ts +21 -0
  79. package/types/lluc_llull-ui-lib-content-category-progress.d.ts +34 -0
  80. package/types/lluc_llull-ui-lib-content-columns-media-stacked.d.ts +33 -0
  81. package/types/lluc_llull-ui-lib-content-contact-minimal.d.ts +39 -0
  82. package/types/lluc_llull-ui-lib-content-content-document.d.ts +24 -0
  83. package/types/lluc_llull-ui-lib-content-hero-section.d.ts +62 -0
  84. package/types/lluc_llull-ui-lib-content-media-intro.d.ts +33 -0
  85. package/types/lluc_llull-ui-lib-content-media-split.d.ts +36 -0
  86. package/types/lluc_llull-ui-lib-content-mosaic-grid.d.ts +27 -0
  87. package/types/lluc_llull-ui-lib-content-mosaic-parallax.d.ts +35 -0
  88. package/types/lluc_llull-ui-lib-content-section-intro.d.ts +33 -0
  89. package/types/lluc_llull-ui-lib-content-split-previewer.d.ts +47 -0
  90. package/types/lluc_llull-ui-lib-content-split-showcase.d.ts +43 -0
  91. package/types/lluc_llull-ui-lib-content-stacked-rows.d.ts +30 -0
  92. package/types/lluc_llull-ui-lib-content.d.ts +471 -0
  93. package/types/lluc_llull-ui-lib-directives.d.ts +93 -0
  94. package/types/lluc_llull-ui-lib-effects.d.ts +50 -0
  95. package/types/lluc_llull-ui-lib-enums.d.ts +7 -0
  96. package/types/lluc_llull-ui-lib-feedback-404.d.ts +33 -0
  97. package/types/lluc_llull-ui-lib-feedback.d.ts +33 -0
  98. package/types/lluc_llull-ui-lib-footers-columns-footer.d.ts +30 -0
  99. package/types/lluc_llull-ui-lib-footers-legal-footer.d.ts +40 -0
  100. package/types/lluc_llull-ui-lib-footers-links-footer.d.ts +15 -0
  101. package/types/lluc_llull-ui-lib-footers-social-footer.d.ts +27 -0
  102. package/types/lluc_llull-ui-lib-footers-visual-footer.d.ts +57 -0
  103. package/types/lluc_llull-ui-lib-footers.d.ts +161 -0
  104. package/types/lluc_llull-ui-lib-headers-header-clear.d.ts +68 -0
  105. package/types/lluc_llull-ui-lib-headers-header-mobile.d.ts +68 -0
  106. package/types/lluc_llull-ui-lib-headers.d.ts +132 -0
  107. package/types/lluc_llull-ui-lib-interfaces.d.ts +92 -0
  108. package/types/lluc_llull-ui-lib-mapper.d.ts +40 -0
  109. package/types/lluc_llull-ui-lib-modals.d.ts +47 -0
  110. package/types/lluc_llull-ui-lib-screen-sizer.d.ts +34 -0
  111. package/types/lluc_llull-ui-lib-shared.d.ts +99 -0
  112. package/types/lluc_llull-ui-lib-sliders.d.ts +17 -0
  113. package/types/lluc_llull-ui-lib-theme.d.ts +16 -0
  114. package/{utils/utils.d.ts → types/lluc_llull-ui-lib-utils.d.ts} +2 -2
  115. package/types/lluc_llull-ui-lib.d.ts +5 -0
  116. package/content/asymmetric-media/asymmetric-media.component.d.ts +0 -8
  117. package/content/asymmetric-media/asymmetric-media.interface.d.ts +0 -5
  118. package/content/asymmetric-media/index.d.ts +0 -2
  119. package/content/category-progress/category-progress.component.d.ts +0 -16
  120. package/content/category-progress/category-progress.interface.d.ts +0 -6
  121. package/content/category-progress/index.d.ts +0 -2
  122. package/content/columns-media-stacked/columns-media-stacked.component.d.ts +0 -10
  123. package/content/columns-media-stacked/columns-media-stacked.interface.d.ts +0 -7
  124. package/content/columns-media-stacked/index.d.ts +0 -2
  125. package/content/contact-minimal/contact-minimal.component.d.ts +0 -11
  126. package/content/contact-minimal/contact-minimal.interface.d.ts +0 -8
  127. package/content/contact-minimal/index.d.ts +0 -2
  128. package/content/content-document/content-document.component.d.ts +0 -11
  129. package/content/content-document/content-document.interface.d.ts +0 -5
  130. package/content/content-document/index.d.ts +0 -2
  131. package/content/hero-section/hero-section.component.d.ts +0 -19
  132. package/content/hero-section/hero-section.interface.d.ts +0 -11
  133. package/content/hero-section/hero-section.stories.d.ts +0 -7
  134. package/content/hero-section/index.d.ts +0 -3
  135. package/content/index.d.ts +0 -14
  136. package/content/media-intro/index.d.ts +0 -2
  137. package/content/media-intro/media-intro.component.d.ts +0 -10
  138. package/content/media-intro/media-intro.interface.d.ts +0 -7
  139. package/content/media-split/index.d.ts +0 -2
  140. package/content/media-split/media-split.component.d.ts +0 -18
  141. package/content/media-split/media-split.interface.d.ts +0 -6
  142. package/content/mosaic-grid/index.d.ts +0 -2
  143. package/content/mosaic-grid/mosaic-grid.component.d.ts +0 -14
  144. package/content/mosaic-grid/mosaic-grid.interface.d.ts +0 -5
  145. package/content/mosaic-parallax/index.d.ts +0 -2
  146. package/content/mosaic-parallax/mosaic-parallax.component.d.ts +0 -17
  147. package/content/mosaic-parallax/mosaic-parallax.interface.d.ts +0 -6
  148. package/content/section-intro/index.d.ts +0 -2
  149. package/content/section-intro/section-intro.component.d.ts +0 -11
  150. package/content/section-intro/section-intro.interface.d.ts +0 -2
  151. package/content/split-previewer/index.d.ts +0 -2
  152. package/content/split-previewer/split-previewer.component.d.ts +0 -24
  153. package/content/split-previewer/split-previewer.interface.d.ts +0 -8
  154. package/content/split-showcase/index.d.ts +0 -2
  155. package/content/split-showcase/split-showcase.component.d.ts +0 -15
  156. package/content/split-showcase/split-showcase.interface.d.ts +0 -9
  157. package/content/stacked-rows/index.d.ts +0 -2
  158. package/content/stacked-rows/stacked-rows.component.d.ts +0 -12
  159. package/content/stacked-rows/stacked-rows.interface.d.ts +0 -6
  160. package/directives/header-scroll.directive.d.ts +0 -8
  161. package/directives/highlight.directive.d.ts +0 -14
  162. package/directives/index.d.ts +0 -4
  163. package/directives/link-type.directive.d.ts +0 -26
  164. package/directives/scroll-reveal.directive.d.ts +0 -15
  165. package/effects/dynamic-background/dynamic-background.component.d.ts +0 -27
  166. package/effects/dynamic-background/effects/dynamic-effect.interface.d.ts +0 -6
  167. package/effects/dynamic-background/effects/effect-registry.d.ts +0 -3
  168. package/effects/dynamic-background/effects/sphere-deform/sphere-deform.effect.d.ts +0 -13
  169. package/effects/dynamic-background/index.d.ts +0 -1
  170. package/effects/index.d.ts +0 -1
  171. package/enums/index.d.ts +0 -1
  172. package/enums/link-type.enum.d.ts +0 -7
  173. package/feedback/404/404.component.d.ts +0 -10
  174. package/feedback/404/404.inteface.d.ts +0 -7
  175. package/feedback/404/index.d.ts +0 -2
  176. package/feedback/index.d.ts +0 -1
  177. package/fesm2022/lluc_llull-ui-lib-interfaces.mjs.map +0 -1
  178. package/footers/columns-footer/columns-footer.component.d.ts +0 -17
  179. package/footers/columns-footer/columns-footer.interface.d.ts +0 -5
  180. package/footers/columns-footer/index.d.ts +0 -2
  181. package/footers/index.d.ts +0 -5
  182. package/footers/legal-footer/index.d.ts +0 -2
  183. package/footers/legal-footer/legal-footer.component.d.ts +0 -12
  184. package/footers/legal-footer/legal-footer.interface.d.ts +0 -9
  185. package/footers/links-footer/index.d.ts +0 -2
  186. package/footers/links-footer/links-footer.component.d.ts +0 -7
  187. package/footers/links-footer/links-footer.interface.d.ts +0 -4
  188. package/footers/social-footer/index.d.ts +0 -2
  189. package/footers/social-footer/social-footer.component.d.ts +0 -9
  190. package/footers/social-footer/social-footer.interface.d.ts +0 -6
  191. package/footers/visual-footer/index.d.ts +0 -2
  192. package/footers/visual-footer/visual-footer.component.d.ts +0 -14
  193. package/footers/visual-footer/visual-footer.interface.d.ts +0 -11
  194. package/headers/header-clear/header-clear.component.d.ts +0 -28
  195. package/headers/header-clear/header-clear.interface.d.ts +0 -9
  196. package/headers/header-clear/index.d.ts +0 -2
  197. package/headers/header-mobile/header-mobile.component.d.ts +0 -28
  198. package/headers/header-mobile/header-mobile.interface.d.ts +0 -9
  199. package/headers/header-mobile/index.d.ts +0 -2
  200. package/headers/index.d.ts +0 -2
  201. package/index.d.ts +0 -5
  202. package/interfaces/index.d.ts +0 -8
  203. package/interfaces/page-config.interface.d.ts +0 -22
  204. package/interfaces/site-config.interface.d.ts +0 -21
  205. package/interfaces/ui-lib-address.interface.d.ts +0 -7
  206. package/interfaces/ui-lib-button.interface.d.ts +0 -7
  207. package/interfaces/ui-lib-image.interface.d.ts +0 -10
  208. package/interfaces/ui-lib-lang-item.interface.d.ts +0 -5
  209. package/interfaces/ui-lib-nav-items.interface.d.ts +0 -17
  210. package/interfaces/ui-lib-texts.interface.d.ts +0 -6
  211. package/lib/ui-lib.component.d.ts +0 -5
  212. package/mapper/cdn.token.d.ts +0 -2
  213. package/mapper/cloudinary.token.d.ts +0 -2
  214. package/mapper/component-mappers/404.mapper.d.ts +0 -2
  215. package/mapper/component-mappers/asymmetric-media.mapper.d.ts +0 -2
  216. package/mapper/component-mappers/category-progress.mapper.d.ts +0 -2
  217. package/mapper/component-mappers/columns-footer.mapper.d.ts +0 -2
  218. package/mapper/component-mappers/columns-media-stacked.mapper.d.ts +0 -2
  219. package/mapper/component-mappers/contact-minimal.mapper.d.ts +0 -2
  220. package/mapper/component-mappers/content-document.mapper.d.ts +0 -2
  221. package/mapper/component-mappers/header-clear.mapper.d.ts +0 -2
  222. package/mapper/component-mappers/hero-section.mapper.d.ts +0 -2
  223. package/mapper/component-mappers/index.d.ts +0 -24
  224. package/mapper/component-mappers/lang-modal.mapper.d.ts +0 -2
  225. package/mapper/component-mappers/legal-footer.mapper.d.ts +0 -2
  226. package/mapper/component-mappers/links-footer.mapper.d.ts +0 -2
  227. package/mapper/component-mappers/media-intro.mapper.d.ts +0 -2
  228. package/mapper/component-mappers/media-split.mapper.d.ts +0 -2
  229. package/mapper/component-mappers/mosaic-grid.mapper.d.ts +0 -2
  230. package/mapper/component-mappers/mosaic-parallax.mapper.d.ts +0 -2
  231. package/mapper/component-mappers/nav-modal.mapper.d.ts +0 -3
  232. package/mapper/component-mappers/section-intro.mapper.d.ts +0 -2
  233. package/mapper/component-mappers/social-footer.mapper.d.ts +0 -2
  234. package/mapper/component-mappers/split-previewer.mapper.d.ts +0 -2
  235. package/mapper/component-mappers/split-showcase.mapper.d.ts +0 -2
  236. package/mapper/component-mappers/stacked-rows.mapper.d.ts +0 -2
  237. package/mapper/component-mappers/types.d.ts +0 -1
  238. package/mapper/component-mappers/visual-footer.mapper.d.ts +0 -2
  239. package/mapper/index.d.ts +0 -4
  240. package/mapper/mapper.service.d.ts +0 -10
  241. package/modals/index.d.ts +0 -2
  242. package/modals/lang-modal/index.d.ts +0 -2
  243. package/modals/lang-modal/lang-modal.component.d.ts +0 -18
  244. package/modals/lang-modal/lang-modal.interface.d.ts +0 -2
  245. package/modals/nav-modal/index.d.ts +0 -2
  246. package/modals/nav-modal/nav-modal.component.d.ts +0 -11
  247. package/modals/nav-modal/nav-modal.interface.d.ts +0 -5
  248. package/public-api.d.ts +0 -1
  249. package/screen-sizer/index.d.ts +0 -1
  250. package/screen-sizer/screen-sizer.service.d.ts +0 -34
  251. package/shared/index.d.ts +0 -2
  252. package/shared/ui-icon/index.d.ts +0 -3
  253. package/shared/ui-icon/ui-icon.component.d.ts +0 -15
  254. package/shared/ui-icon/ui-icon.interface.d.ts +0 -5
  255. package/shared/ui-icon/ui-icon.mock.d.ts +0 -8
  256. package/shared/ui-image/index.d.ts +0 -1
  257. package/shared/ui-image/ui-image.component.d.ts +0 -21
  258. package/sliders/index.d.ts +0 -1
  259. package/sliders/swiper.directive.d.ts +0 -12
  260. package/theme/index.d.ts +0 -1
  261. package/theme/theme.service.d.ts +0 -16
  262. package/utils/index.d.ts +0 -1
@@ -1,267 +1,388 @@
1
- import { isPlatformBrowser } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { EventEmitter, PLATFORM_ID, HostListener, Output, Input, Inject, Directive, HostBinding } from '@angular/core';
4
- export { LinkType } from '@lluc_llull/ui-lib/enums';
5
- import * as i1 from '@angular/router';
6
-
7
- class LinkTypeDirective {
8
- router;
9
- elRef;
10
- platformId;
11
- _linkType;
12
- _href;
13
- set linkType(value) {
14
- this._linkType = value;
15
- this.updateElementAttributes();
16
- }
17
- get linkType() { return this._linkType; }
18
- set href(value) {
19
- this._href = value;
20
- this.updateElementAttributes();
21
- }
22
- get href() { return this._href ?? ''; }
23
- anchorClicked = new EventEmitter();
24
- constructor(router, elRef, platformId) {
25
- this.router = router;
26
- this.elRef = elRef;
27
- this.platformId = platformId;
28
- }
29
- get isBrowser() {
30
- return isPlatformBrowser(this.platformId);
31
- }
32
- onClick(event) {
33
- if (!this.linkType || !this.href)
34
- return;
35
- switch (this.linkType) {
36
- case 'internal':
37
- event.preventDefault();
38
- const targetUrl = this.elRef.nativeElement.getAttribute('href') ?? this.href;
39
- this.router.navigateByUrl(targetUrl);
40
- this.anchorClicked.emit();
41
- break;
42
- case 'anchor':
43
- event.preventDefault();
44
- this.scrollToAnchor(this.href);
45
- break;
46
- case 'nolink':
47
- event.preventDefault();
48
- break;
49
- case 'external':
50
- case 'pdf':
51
- default:
52
- break;
53
- }
54
- }
55
- updateElementAttributes() {
56
- const element = this.elRef.nativeElement;
57
- if (!this.href) {
58
- element.removeAttribute('href');
59
- return;
60
- }
61
- const resolvedHref = this.resolveHref();
62
- element.setAttribute('href', resolvedHref);
63
- if (this.linkType === 'external' || this.linkType === 'pdf') {
64
- element.setAttribute('target', '_blank');
65
- element.setAttribute('rel', 'noopener noreferrer nofollow');
66
- }
67
- else {
68
- element.removeAttribute('target');
69
- element.removeAttribute('rel');
70
- }
71
- }
72
- resolveHref() {
73
- if (this.href.startsWith('/') || this.href.startsWith('http') || this.href.startsWith('#')) {
74
- return this.href;
75
- }
76
- if (this.linkType === 'internal') {
77
- const lang = this.getCurrentLang();
78
- return `/${lang}/${this.href}`;
79
- }
80
- return this.href;
81
- }
82
- getCurrentLang() {
83
- const url = this.router.url || '';
84
- const firstSegment = url.split('?')[0].split('#')[0].split('/')[1];
85
- return firstSegment || 'es';
86
- }
87
- scrollToAnchor(id) {
88
- if (!this.isBrowser)
89
- return;
90
- const cleanId = id.replace(/^#/, '');
91
- const el = document.getElementById(cleanId);
92
- if (!el)
93
- return;
94
- const yOffset = -160;
95
- const y = el.getBoundingClientRect().top + window.scrollY + yOffset;
96
- window.scrollTo({
97
- top: y,
98
- behavior: 'smooth',
99
- });
100
- this.anchorClicked.emit();
101
- }
102
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LinkTypeDirective, deps: [{ token: i1.Router }, { token: i0.ElementRef }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Directive });
103
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: LinkTypeDirective, isStandalone: true, selector: "[linkType]", inputs: { linkType: "linkType", href: "href" }, outputs: { anchorClicked: "anchorClicked" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
104
- }
105
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LinkTypeDirective, decorators: [{
106
- type: Directive,
107
- args: [{
108
- selector: '[linkType]',
109
- standalone: true,
110
- }]
111
- }], ctorParameters: () => [{ type: i1.Router }, { type: i0.ElementRef }, { type: Object, decorators: [{
112
- type: Inject,
113
- args: [PLATFORM_ID]
114
- }] }], propDecorators: { linkType: [{
115
- type: Input
116
- }], href: [{
117
- type: Input
118
- }], anchorClicked: [{
119
- type: Output
120
- }], onClick: [{
121
- type: HostListener,
122
- args: ['click', ['$event']]
123
- }] } });
124
-
125
- class HighlightDirective {
126
- highlightColor = '#FFFFFF';
127
- highlightThickness = 20;
128
- get background() {
129
- const start = 65;
130
- const end = start + this.highlightThickness;
131
- return `linear-gradient(to bottom,
1
+ import { isPlatformBrowser } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Directive, EventEmitter, HostBinding, HostListener, Inject, Input, Output, PLATFORM_ID } from "@angular/core";
4
+ import { LinkType } from "@lluc_llull/ui-lib/enums";
5
+ import * as i1 from "@angular/router";
6
+ var LinkTypeDirective = class LinkTypeDirective {
7
+ router;
8
+ elRef;
9
+ platformId;
10
+ _linkType;
11
+ _href;
12
+ set linkType(value) {
13
+ this._linkType = value;
14
+ this.updateElementAttributes();
15
+ }
16
+ get linkType() {
17
+ return this._linkType;
18
+ }
19
+ set href(value) {
20
+ this._href = value;
21
+ this.updateElementAttributes();
22
+ }
23
+ get href() {
24
+ return this._href ?? "";
25
+ }
26
+ anchorClicked = new EventEmitter();
27
+ constructor(router, elRef, platformId) {
28
+ this.router = router;
29
+ this.elRef = elRef;
30
+ this.platformId = platformId;
31
+ }
32
+ get isBrowser() {
33
+ return isPlatformBrowser(this.platformId);
34
+ }
35
+ onClick(event) {
36
+ if (!this.linkType || !this.href) return;
37
+ switch (this.linkType) {
38
+ case "internal":
39
+ event.preventDefault();
40
+ const targetUrl = this.elRef.nativeElement.getAttribute("href") ?? this.href;
41
+ this.router.navigateByUrl(targetUrl);
42
+ this.anchorClicked.emit();
43
+ break;
44
+ case "anchor":
45
+ event.preventDefault();
46
+ this.scrollToAnchor(this.href);
47
+ break;
48
+ case "nolink": event.preventDefault();
49
+ }
50
+ }
51
+ updateElementAttributes() {
52
+ const element = this.elRef.nativeElement;
53
+ if (!this.href) {
54
+ element.removeAttribute("href");
55
+ return;
56
+ }
57
+ const resolvedHref = this.resolveHref();
58
+ element.setAttribute("href", resolvedHref);
59
+ if (this.linkType === "external" || this.linkType === "pdf") {
60
+ element.setAttribute("target", "_blank");
61
+ element.setAttribute("rel", "noopener noreferrer nofollow");
62
+ } else {
63
+ element.removeAttribute("target");
64
+ element.removeAttribute("rel");
65
+ }
66
+ }
67
+ resolveHref() {
68
+ if (this.href.startsWith("/") || this.href.startsWith("http") || this.href.startsWith("#")) return this.href;
69
+ if (this.linkType === "internal") return `/${this.getCurrentLang()}/${this.href}`;
70
+ return this.href;
71
+ }
72
+ getCurrentLang() {
73
+ return (this.router.url || "").split("?")[0].split("#")[0].split("/")[1] || "es";
74
+ }
75
+ scrollToAnchor(id) {
76
+ if (!this.isBrowser) return;
77
+ const cleanId = id.replace(/^#/, "");
78
+ const el = document.getElementById(cleanId);
79
+ if (!el) return;
80
+ const y = el.getBoundingClientRect().top + window.scrollY + -160;
81
+ window.scrollTo({
82
+ top: y,
83
+ behavior: "smooth"
84
+ });
85
+ this.anchorClicked.emit();
86
+ }
87
+ static ɵfac = i0.ɵɵngDeclareFactory({
88
+ minVersion: "12.0.0",
89
+ version: "22.2.4",
90
+ ngImport: i0,
91
+ type: LinkTypeDirective,
92
+ deps: [
93
+ { token: i1.Router },
94
+ { token: i0.ElementRef },
95
+ { token: PLATFORM_ID }
96
+ ],
97
+ target: i0.ɵɵFactoryTarget.Directive
98
+ });
99
+ static ɵdir = i0.ɵɵngDeclareDirective({
100
+ minVersion: "14.0.0",
101
+ version: "22.2.4",
102
+ type: LinkTypeDirective,
103
+ isStandalone: true,
104
+ selector: "[linkType]",
105
+ inputs: {
106
+ linkType: "linkType",
107
+ href: "href"
108
+ },
109
+ outputs: { anchorClicked: "anchorClicked" },
110
+ host: { listeners: { "click": "onClick($event)" } },
111
+ ngImport: i0
112
+ });
113
+ };
114
+ i0.ɵɵngDeclareClassMetadata({
115
+ minVersion: "12.0.0",
116
+ version: "22.2.4",
117
+ ngImport: i0,
118
+ type: LinkTypeDirective,
119
+ decorators: [{
120
+ type: Directive,
121
+ args: [{
122
+ selector: "[linkType]",
123
+ standalone: true
124
+ }]
125
+ }],
126
+ ctorParameters: () => [
127
+ { type: i1.Router },
128
+ { type: i0.ElementRef },
129
+ {
130
+ type: Object,
131
+ decorators: [{
132
+ type: Inject,
133
+ args: [PLATFORM_ID]
134
+ }]
135
+ }
136
+ ],
137
+ propDecorators: {
138
+ linkType: [{ type: Input }],
139
+ href: [{ type: Input }],
140
+ anchorClicked: [{ type: Output }],
141
+ onClick: [{
142
+ type: HostListener,
143
+ args: ["click", ["$event"]]
144
+ }]
145
+ }
146
+ });
147
+ var HighlightDirective = class HighlightDirective {
148
+ highlightColor = "#FFFFFF";
149
+ highlightThickness = 20;
150
+ get background() {
151
+ const start = 65;
152
+ const end = start + this.highlightThickness;
153
+ return `linear-gradient(to bottom,
132
154
  transparent ${start}%,
133
155
  ${this.highlightColor} ${start}%,
134
156
  ${this.highlightColor} ${end}%,
135
157
  transparent ${end}%)`;
136
- }
137
- size = '100% 100%';
138
- display = 'inline';
139
- // desplazamiento
140
- padding = '0 10px';
141
- margin = '0 -10px'; // Compensa el padding para no mover el texto
142
- break = 'clone';
143
- wBreak = 'clone';
144
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HighlightDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
145
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: HighlightDirective, isStandalone: true, selector: "[highlight]", inputs: { highlightColor: ["highlight", "highlightColor"], highlightThickness: "highlightThickness" }, host: { properties: { "style.background-image": "this.background", "style.background-size": "this.size", "style.display": "this.display", "style.padding": "this.padding", "style.margin": "this.margin", "style.box-decoration-break": "this.break", "style.-webkit-box-decoration-break": "this.wBreak" } }, ngImport: i0 });
146
- }
147
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HighlightDirective, decorators: [{
148
- type: Directive,
149
- args: [{
150
- selector: '[highlight]',
151
- standalone: true,
152
- }]
153
- }], propDecorators: { highlightColor: [{
154
- type: Input,
155
- args: ['highlight']
156
- }], highlightThickness: [{
157
- type: Input
158
- }], background: [{
159
- type: HostBinding,
160
- args: ['style.background-image']
161
- }], size: [{
162
- type: HostBinding,
163
- args: ['style.background-size']
164
- }], display: [{
165
- type: HostBinding,
166
- args: ['style.display']
167
- }], padding: [{
168
- type: HostBinding,
169
- args: ['style.padding']
170
- }], margin: [{
171
- type: HostBinding,
172
- args: ['style.margin']
173
- }], break: [{
174
- type: HostBinding,
175
- args: ['style.box-decoration-break']
176
- }], wBreak: [{
177
- type: HostBinding,
178
- args: ['style.-webkit-box-decoration-break']
179
- }] } });
180
-
181
- class ScrollRevealDirective {
182
- el;
183
- renderer;
184
- platformId;
185
- distance = '30px';
186
- duration = '0.8s';
187
- constructor(el, renderer, platformId) {
188
- this.el = el;
189
- this.renderer = renderer;
190
- this.platformId = platformId;
191
- }
192
- ngOnInit() {
193
- this.setupInitialStyles();
194
- const isBrowser = isPlatformBrowser(this.platformId);
195
- const hasIntersectionObserver = typeof globalThis !== 'undefined' && 'IntersectionObserver' in globalThis;
196
- if (!isBrowser || !hasIntersectionObserver) {
197
- this.reveal();
198
- return;
199
- }
200
- const observer = new IntersectionObserver((entries) => {
201
- entries.forEach((entry) => {
202
- if (entry.isIntersecting) {
203
- this.reveal();
204
- observer.unobserve(this.el.nativeElement);
205
- }
206
- });
207
- }, { threshold: 0.1 }); // Se dispara cuando el 10% del componente es visible
208
- observer.observe(this.el.nativeElement);
209
- }
210
- setupInitialStyles() {
211
- this.renderer.setStyle(this.el.nativeElement, 'opacity', '0');
212
- this.renderer.setStyle(this.el.nativeElement, 'transform', `translateY(-${this.distance})`);
213
- this.renderer.setStyle(this.el.nativeElement, 'transition', `all ${this.duration} ease-out`);
214
- }
215
- reveal() {
216
- this.renderer.setStyle(this.el.nativeElement, 'opacity', '1');
217
- this.renderer.setStyle(this.el.nativeElement, 'transform', 'translateY(0)');
218
- }
219
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ScrollRevealDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Directive });
220
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: ScrollRevealDirective, isStandalone: true, selector: "[scrollReveal]", inputs: { distance: "distance", duration: "duration" }, ngImport: i0 });
221
- }
222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ScrollRevealDirective, decorators: [{
223
- type: Directive,
224
- args: [{
225
- selector: '[scrollReveal]',
226
- standalone: true,
227
- }]
228
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: Object, decorators: [{
229
- type: Inject,
230
- args: [PLATFORM_ID]
231
- }] }], propDecorators: { distance: [{
232
- type: Input
233
- }], duration: [{
234
- type: Input
235
- }] } });
236
-
237
- class HeaderScrollDirective {
238
- scrollThreshold = 60;
239
- isScrolled = false;
240
- onScroll() {
241
- this.isScrolled = window.scrollY > this.scrollThreshold;
242
- }
243
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HeaderScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
244
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: HeaderScrollDirective, isStandalone: true, selector: "[headerScroll]", inputs: { scrollThreshold: "scrollThreshold" }, host: { listeners: { "window:scroll": "onScroll()" }, properties: { "class.is-scrolled": "this.isScrolled" } }, ngImport: i0 });
245
- }
246
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HeaderScrollDirective, decorators: [{
247
- type: Directive,
248
- args: [{
249
- selector: '[headerScroll]',
250
- standalone: true,
251
- }]
252
- }], propDecorators: { scrollThreshold: [{
253
- type: Input
254
- }], isScrolled: [{
255
- type: HostBinding,
256
- args: ['class.is-scrolled']
257
- }], onScroll: [{
258
- type: HostListener,
259
- args: ['window:scroll', []]
260
- }] } });
261
-
262
- /**
263
- * Generated bundle index. Do not edit.
264
- */
158
+ }
159
+ size = "100% 100%";
160
+ display = "inline";
161
+ padding = "0 10px";
162
+ margin = "0 -10px";
163
+ break = "clone";
164
+ wBreak = "clone";
165
+ static ɵfac = i0.ɵɵngDeclareFactory({
166
+ minVersion: "12.0.0",
167
+ version: "22.2.4",
168
+ ngImport: i0,
169
+ type: HighlightDirective,
170
+ deps: [],
171
+ target: i0.ɵɵFactoryTarget.Directive
172
+ });
173
+ static ɵdir = i0.ɵɵngDeclareDirective({
174
+ minVersion: "14.0.0",
175
+ version: "22.2.4",
176
+ type: HighlightDirective,
177
+ isStandalone: true,
178
+ selector: "[highlight]",
179
+ inputs: {
180
+ highlightColor: ["highlight", "highlightColor"],
181
+ highlightThickness: "highlightThickness"
182
+ },
183
+ host: { properties: {
184
+ "style.background-image": "this.background",
185
+ "style.background-size": "this.size",
186
+ "style.display": "this.display",
187
+ "style.padding": "this.padding",
188
+ "style.margin": "this.margin",
189
+ "style.box-decoration-break": "this.break",
190
+ "style.-webkit-box-decoration-break": "this.wBreak"
191
+ } },
192
+ ngImport: i0
193
+ });
194
+ };
195
+ i0.ɵɵngDeclareClassMetadata({
196
+ minVersion: "12.0.0",
197
+ version: "22.2.4",
198
+ ngImport: i0,
199
+ type: HighlightDirective,
200
+ decorators: [{
201
+ type: Directive,
202
+ args: [{
203
+ selector: "[highlight]",
204
+ standalone: true
205
+ }]
206
+ }],
207
+ propDecorators: {
208
+ highlightColor: [{
209
+ type: Input,
210
+ args: ["highlight"]
211
+ }],
212
+ highlightThickness: [{ type: Input }],
213
+ background: [{
214
+ type: HostBinding,
215
+ args: ["style.background-image"]
216
+ }],
217
+ size: [{
218
+ type: HostBinding,
219
+ args: ["style.background-size"]
220
+ }],
221
+ display: [{
222
+ type: HostBinding,
223
+ args: ["style.display"]
224
+ }],
225
+ padding: [{
226
+ type: HostBinding,
227
+ args: ["style.padding"]
228
+ }],
229
+ margin: [{
230
+ type: HostBinding,
231
+ args: ["style.margin"]
232
+ }],
233
+ break: [{
234
+ type: HostBinding,
235
+ args: ["style.box-decoration-break"]
236
+ }],
237
+ wBreak: [{
238
+ type: HostBinding,
239
+ args: ["style.-webkit-box-decoration-break"]
240
+ }]
241
+ }
242
+ });
243
+ var ScrollRevealDirective = class ScrollRevealDirective {
244
+ el;
245
+ renderer;
246
+ platformId;
247
+ distance = "30px";
248
+ duration = "0.8s";
249
+ constructor(el, renderer, platformId) {
250
+ this.el = el;
251
+ this.renderer = renderer;
252
+ this.platformId = platformId;
253
+ }
254
+ ngOnInit() {
255
+ this.setupInitialStyles();
256
+ const isBrowser = isPlatformBrowser(this.platformId);
257
+ const hasIntersectionObserver = typeof globalThis !== "undefined" && "IntersectionObserver" in globalThis;
258
+ if (!isBrowser || !hasIntersectionObserver) {
259
+ this.reveal();
260
+ return;
261
+ }
262
+ const observer = new IntersectionObserver((entries) => {
263
+ entries.forEach((entry) => {
264
+ if (entry.isIntersecting) {
265
+ this.reveal();
266
+ observer.unobserve(this.el.nativeElement);
267
+ }
268
+ });
269
+ }, { threshold: .1 });
270
+ observer.observe(this.el.nativeElement);
271
+ }
272
+ setupInitialStyles() {
273
+ this.renderer.setStyle(this.el.nativeElement, "opacity", "0");
274
+ this.renderer.setStyle(this.el.nativeElement, "transform", `translateY(-${this.distance})`);
275
+ this.renderer.setStyle(this.el.nativeElement, "transition", `all ${this.duration} ease-out`);
276
+ }
277
+ reveal() {
278
+ this.renderer.setStyle(this.el.nativeElement, "opacity", "1");
279
+ this.renderer.setStyle(this.el.nativeElement, "transform", "translateY(0)");
280
+ }
281
+ static ɵfac = i0.ɵɵngDeclareFactory({
282
+ minVersion: "12.0.0",
283
+ version: "22.2.4",
284
+ ngImport: i0,
285
+ type: ScrollRevealDirective,
286
+ deps: [
287
+ { token: i0.ElementRef },
288
+ { token: i0.Renderer2 },
289
+ { token: PLATFORM_ID }
290
+ ],
291
+ target: i0.ɵɵFactoryTarget.Directive
292
+ });
293
+ static ɵdir = i0.ɵɵngDeclareDirective({
294
+ minVersion: "14.0.0",
295
+ version: "22.2.4",
296
+ type: ScrollRevealDirective,
297
+ isStandalone: true,
298
+ selector: "[scrollReveal]",
299
+ inputs: {
300
+ distance: "distance",
301
+ duration: "duration"
302
+ },
303
+ ngImport: i0
304
+ });
305
+ };
306
+ i0.ɵɵngDeclareClassMetadata({
307
+ minVersion: "12.0.0",
308
+ version: "22.2.4",
309
+ ngImport: i0,
310
+ type: ScrollRevealDirective,
311
+ decorators: [{
312
+ type: Directive,
313
+ args: [{
314
+ selector: "[scrollReveal]",
315
+ standalone: true
316
+ }]
317
+ }],
318
+ ctorParameters: () => [
319
+ { type: i0.ElementRef },
320
+ { type: i0.Renderer2 },
321
+ {
322
+ type: Object,
323
+ decorators: [{
324
+ type: Inject,
325
+ args: [PLATFORM_ID]
326
+ }]
327
+ }
328
+ ],
329
+ propDecorators: {
330
+ distance: [{ type: Input }],
331
+ duration: [{ type: Input }]
332
+ }
333
+ });
334
+ var HeaderScrollDirective = class HeaderScrollDirective {
335
+ scrollThreshold = 60;
336
+ isScrolled = false;
337
+ onScroll() {
338
+ this.isScrolled = window.scrollY > this.scrollThreshold;
339
+ }
340
+ static ɵfac = i0.ɵɵngDeclareFactory({
341
+ minVersion: "12.0.0",
342
+ version: "22.2.4",
343
+ ngImport: i0,
344
+ type: HeaderScrollDirective,
345
+ deps: [],
346
+ target: i0.ɵɵFactoryTarget.Directive
347
+ });
348
+ static ɵdir = i0.ɵɵngDeclareDirective({
349
+ minVersion: "14.0.0",
350
+ version: "22.2.4",
351
+ type: HeaderScrollDirective,
352
+ isStandalone: true,
353
+ selector: "[headerScroll]",
354
+ inputs: { scrollThreshold: "scrollThreshold" },
355
+ host: {
356
+ listeners: { "window:scroll": "onScroll()" },
357
+ properties: { "class.is-scrolled": "this.isScrolled" }
358
+ },
359
+ ngImport: i0
360
+ });
361
+ };
362
+ i0.ɵɵngDeclareClassMetadata({
363
+ minVersion: "12.0.0",
364
+ version: "22.2.4",
365
+ ngImport: i0,
366
+ type: HeaderScrollDirective,
367
+ decorators: [{
368
+ type: Directive,
369
+ args: [{
370
+ selector: "[headerScroll]",
371
+ standalone: true
372
+ }]
373
+ }],
374
+ propDecorators: {
375
+ scrollThreshold: [{ type: Input }],
376
+ isScrolled: [{
377
+ type: HostBinding,
378
+ args: ["class.is-scrolled"]
379
+ }],
380
+ onScroll: [{
381
+ type: HostListener,
382
+ args: ["window:scroll", []]
383
+ }]
384
+ }
385
+ });
386
+ export { HeaderScrollDirective, HighlightDirective, LinkType, LinkTypeDirective, ScrollRevealDirective };
265
387
 
266
- export { HeaderScrollDirective, HighlightDirective, LinkTypeDirective, ScrollRevealDirective };
267
- //# sourceMappingURL=lluc_llull-ui-lib-directives.mjs.map
388
+ //# sourceMappingURL=lluc_llull-ui-lib-directives.mjs.map