cmat 0.0.111 → 0.0.113

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 (256) hide show
  1. package/fesm2022/cmat-components-adapter.mjs +531 -536
  2. package/fesm2022/cmat-components-adapter.mjs.map +1 -1
  3. package/fesm2022/cmat-components-breadcrumb.mjs +521 -356
  4. package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
  5. package/fesm2022/cmat-components-card.mjs +150 -42
  6. package/fesm2022/cmat-components-card.mjs.map +1 -1
  7. package/fesm2022/cmat-components-carousel.mjs +1120 -629
  8. package/fesm2022/cmat-components-carousel.mjs.map +1 -1
  9. package/fesm2022/cmat-components-cascade.mjs +861 -441
  10. package/fesm2022/cmat-components-cascade.mjs.map +1 -1
  11. package/fesm2022/cmat-components-chip-input.mjs +580 -335
  12. package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
  13. package/fesm2022/cmat-components-code-editor.mjs +197 -105
  14. package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
  15. package/fesm2022/cmat-components-color-picker.mjs +1762 -825
  16. package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
  17. package/fesm2022/cmat-components-custom-formly.mjs +5196 -2531
  18. package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
  19. package/fesm2022/cmat-components-data-picker.mjs +1901 -1073
  20. package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
  21. package/fesm2022/cmat-components-date-range.mjs +701 -456
  22. package/fesm2022/cmat-components-date-range.mjs.map +1 -1
  23. package/fesm2022/cmat-components-date-time-display.mjs +137 -30
  24. package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
  25. package/fesm2022/cmat-components-drawer.mjs +410 -258
  26. package/fesm2022/cmat-components-drawer.mjs.map +1 -1
  27. package/fesm2022/cmat-components-empty-state.mjs +201 -41
  28. package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
  29. package/fesm2022/cmat-components-file-preview.mjs +198 -35
  30. package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
  31. package/fesm2022/cmat-components-filter-toolbar.mjs +320 -72
  32. package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
  33. package/fesm2022/cmat-components-form-actions.mjs +102 -26
  34. package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
  35. package/fesm2022/cmat-components-fullscreen.mjs +167 -47
  36. package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
  37. package/fesm2022/cmat-components-highlight.mjs +203 -112
  38. package/fesm2022/cmat-components-highlight.mjs.map +1 -1
  39. package/fesm2022/cmat-components-image-viewer.mjs +489 -215
  40. package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
  41. package/fesm2022/cmat-components-inline-loading.mjs +117 -27
  42. package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
  43. package/fesm2022/cmat-components-json-editor.mjs +276 -230
  44. package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
  45. package/fesm2022/cmat-components-knob-input.mjs +615 -420
  46. package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
  47. package/fesm2022/cmat-components-loading-overlay.mjs +53 -25
  48. package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
  49. package/fesm2022/cmat-components-masonry.mjs +120 -40
  50. package/fesm2022/cmat-components-masonry.mjs.map +1 -1
  51. package/fesm2022/cmat-components-material-color-picker.mjs +332 -155
  52. package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
  53. package/fesm2022/cmat-components-material-datetimepicker.mjs +4283 -2504
  54. package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
  55. package/fesm2022/cmat-components-navigation.mjs +3080 -1404
  56. package/fesm2022/cmat-components-navigation.mjs.map +1 -1
  57. package/fesm2022/cmat-components-opt-input.mjs +540 -466
  58. package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
  59. package/fesm2022/cmat-components-org-chart.mjs +528 -125
  60. package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
  61. package/fesm2022/cmat-components-page-header.mjs +141 -32
  62. package/fesm2022/cmat-components-page-header.mjs.map +1 -1
  63. package/fesm2022/cmat-components-pagination.mjs +866 -534
  64. package/fesm2022/cmat-components-pagination.mjs.map +1 -1
  65. package/fesm2022/cmat-components-password-strength.mjs +873 -434
  66. package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
  67. package/fesm2022/cmat-components-popover.mjs +1012 -731
  68. package/fesm2022/cmat-components-popover.mjs.map +1 -1
  69. package/fesm2022/cmat-components-progress-bar.mjs +98 -35
  70. package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
  71. package/fesm2022/cmat-components-qrcode.mjs +463 -287
  72. package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
  73. package/fesm2022/cmat-components-rating.mjs +377 -203
  74. package/fesm2022/cmat-components-rating.mjs.map +1 -1
  75. package/fesm2022/cmat-components-rich-text-editor.mjs +153 -39
  76. package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
  77. package/fesm2022/cmat-components-select-search.mjs +926 -496
  78. package/fesm2022/cmat-components-select-search.mjs.map +1 -1
  79. package/fesm2022/cmat-components-select-table.mjs +1280 -842
  80. package/fesm2022/cmat-components-select-table.mjs.map +1 -1
  81. package/fesm2022/cmat-components-select-tree.mjs +998 -690
  82. package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
  83. package/fesm2022/cmat-components-skeleton.mjs +143 -57
  84. package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
  85. package/fesm2022/cmat-components-speed-dial.mjs +457 -303
  86. package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
  87. package/fesm2022/cmat-components-status-tag.mjs +136 -44
  88. package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
  89. package/fesm2022/cmat-components-table-toolbar.mjs +120 -28
  90. package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
  91. package/fesm2022/cmat-components-timeline.mjs +464 -168
  92. package/fesm2022/cmat-components-timeline.mjs.map +1 -1
  93. package/fesm2022/cmat-components-toast.mjs +346 -262
  94. package/fesm2022/cmat-components-toast.mjs.map +1 -1
  95. package/fesm2022/cmat-components-transfer-picker.mjs +1427 -593
  96. package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
  97. package/fesm2022/cmat-components-treetable.mjs +372 -112
  98. package/fesm2022/cmat-components-treetable.mjs.map +1 -1
  99. package/fesm2022/cmat-components-upload.mjs +904 -410
  100. package/fesm2022/cmat-components-upload.mjs.map +1 -1
  101. package/fesm2022/cmat-components-x6-angular-shape.mjs +153 -170
  102. package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
  103. package/fesm2022/cmat-directives-animate-on-scroll.mjs +220 -138
  104. package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
  105. package/fesm2022/cmat-directives-arrow-cursor.mjs +246 -193
  106. package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
  107. package/fesm2022/cmat-directives-autofocus.mjs +43 -25
  108. package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
  109. package/fesm2022/cmat-directives-data-exporter.mjs +537 -338
  110. package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
  111. package/fesm2022/cmat-directives-debounce.mjs +162 -76
  112. package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
  113. package/fesm2022/cmat-directives-digit-only.mjs +457 -356
  114. package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
  115. package/fesm2022/cmat-directives-equal-validator.mjs +70 -53
  116. package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
  117. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +180 -132
  118. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
  119. package/fesm2022/cmat-lib-mock-api.mjs +207 -195
  120. package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
  121. package/fesm2022/cmat-pipes-bytes.mjs +50 -30
  122. package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
  123. package/fesm2022/cmat-pipes-date-format.mjs +41 -25
  124. package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
  125. package/fesm2022/cmat-pipes-find-by-key.mjs +44 -26
  126. package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
  127. package/fesm2022/cmat-pipes-group-by.mjs +50 -38
  128. package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
  129. package/fesm2022/cmat-pipes-keys.mjs +44 -31
  130. package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
  131. package/fesm2022/cmat-pipes-secure.mjs +60 -49
  132. package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
  133. package/fesm2022/cmat-pipes-uppercase.mjs +39 -22
  134. package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
  135. package/fesm2022/cmat-reports.mjs +2761 -0
  136. package/fesm2022/cmat-reports.mjs.map +1 -0
  137. package/fesm2022/cmat-services-alert.mjs +249 -277
  138. package/fesm2022/cmat-services-alert.mjs.map +1 -1
  139. package/fesm2022/cmat-services-config.mjs +110 -81
  140. package/fesm2022/cmat-services-config.mjs.map +1 -1
  141. package/fesm2022/cmat-services-confirmation.mjs +184 -73
  142. package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
  143. package/fesm2022/cmat-services-data.mjs +136 -125
  144. package/fesm2022/cmat-services-data.mjs.map +1 -1
  145. package/fesm2022/cmat-services-export-as.mjs +165 -183
  146. package/fesm2022/cmat-services-export-as.mjs.map +1 -1
  147. package/fesm2022/cmat-services-loading.mjs +116 -95
  148. package/fesm2022/cmat-services-loading.mjs.map +1 -1
  149. package/fesm2022/cmat-services-local-storage.mjs +75 -66
  150. package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
  151. package/fesm2022/cmat-services-media-watcher.mjs +69 -64
  152. package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
  153. package/fesm2022/cmat-services-platform.mjs +48 -45
  154. package/fesm2022/cmat-services-platform.mjs.map +1 -1
  155. package/fesm2022/cmat-services-print.mjs +984 -1109
  156. package/fesm2022/cmat-services-print.mjs.map +1 -1
  157. package/fesm2022/cmat-services-splash-screen.mjs +53 -38
  158. package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
  159. package/fesm2022/cmat-services-title.mjs +57 -47
  160. package/fesm2022/cmat-services-title.mjs.map +1 -1
  161. package/fesm2022/cmat-services-translation.mjs +79 -68
  162. package/fesm2022/cmat-services-translation.mjs.map +1 -1
  163. package/fesm2022/cmat-services-utils.mjs +424 -517
  164. package/fesm2022/cmat-services-utils.mjs.map +1 -1
  165. package/fesm2022/cmat-validators.mjs +23 -33
  166. package/fesm2022/cmat-validators.mjs.map +1 -1
  167. package/fesm2022/cmat-version.mjs +12 -16
  168. package/fesm2022/cmat-version.mjs.map +1 -1
  169. package/fesm2022/cmat.mjs +39805 -22511
  170. package/fesm2022/cmat.mjs.map +1 -1
  171. package/package.json +5 -1
  172. package/types/cmat-components-adapter.d.ts +145 -156
  173. package/types/cmat-components-breadcrumb.d.ts +108 -86
  174. package/types/cmat-components-card.d.ts +34 -18
  175. package/types/cmat-components-carousel.d.ts +251 -134
  176. package/types/cmat-components-cascade.d.ts +158 -117
  177. package/types/cmat-components-chip-input.d.ts +105 -71
  178. package/types/cmat-components-code-editor.d.ts +59 -34
  179. package/types/cmat-components-color-picker.d.ts +378 -236
  180. package/types/cmat-components-custom-formly.d.ts +776 -814
  181. package/types/cmat-components-data-picker.d.ts +502 -360
  182. package/types/cmat-components-date-range.d.ts +106 -77
  183. package/types/cmat-components-date-time-display.d.ts +36 -13
  184. package/types/cmat-components-drawer.d.ts +91 -61
  185. package/types/cmat-components-empty-state.d.ts +47 -17
  186. package/types/cmat-components-file-preview.d.ts +42 -14
  187. package/types/cmat-components-filter-toolbar.d.ts +57 -25
  188. package/types/cmat-components-form-actions.d.ts +18 -10
  189. package/types/cmat-components-fullscreen.d.ts +21 -13
  190. package/types/cmat-components-highlight.d.ts +33 -26
  191. package/types/cmat-components-image-viewer.d.ts +119 -58
  192. package/types/cmat-components-inline-loading.d.ts +24 -11
  193. package/types/cmat-components-json-editor.d.ts +39 -28
  194. package/types/cmat-components-knob-input.d.ts +172 -101
  195. package/types/cmat-components-loading-overlay.d.ts +8 -11
  196. package/types/cmat-components-masonry.d.ts +27 -14
  197. package/types/cmat-components-material-color-picker.d.ts +56 -42
  198. package/types/cmat-components-material-datetimepicker.d.ts +817 -454
  199. package/types/cmat-components-navigation.d.ts +295 -221
  200. package/types/cmat-components-opt-input.d.ts +111 -90
  201. package/types/cmat-components-org-chart.d.ts +53 -35
  202. package/types/cmat-components-page-header.d.ts +37 -14
  203. package/types/cmat-components-pagination.d.ts +144 -107
  204. package/types/cmat-components-password-strength.d.ts +197 -86
  205. package/types/cmat-components-popover.d.ts +264 -166
  206. package/types/cmat-components-progress-bar.d.ts +17 -14
  207. package/types/cmat-components-qrcode.d.ts +111 -42
  208. package/types/cmat-components-rating.d.ts +105 -59
  209. package/types/cmat-components-rich-text-editor.d.ts +39 -16
  210. package/types/cmat-components-select-search.d.ts +195 -99
  211. package/types/cmat-components-select-table.d.ts +241 -142
  212. package/types/cmat-components-select-tree.d.ts +185 -118
  213. package/types/cmat-components-skeleton.d.ts +55 -32
  214. package/types/cmat-components-speed-dial.d.ts +86 -61
  215. package/types/cmat-components-status-tag.d.ts +42 -24
  216. package/types/cmat-components-table-toolbar.d.ts +30 -12
  217. package/types/cmat-components-timeline.d.ts +83 -51
  218. package/types/cmat-components-toast.d.ts +84 -85
  219. package/types/cmat-components-transfer-picker.d.ts +228 -181
  220. package/types/cmat-components-treetable.d.ts +63 -39
  221. package/types/cmat-components-upload.d.ts +205 -106
  222. package/types/cmat-components-x6-angular-shape.d.ts +29 -37
  223. package/types/cmat-directives-animate-on-scroll.d.ts +48 -30
  224. package/types/cmat-directives-arrow-cursor.d.ts +55 -35
  225. package/types/cmat-directives-autofocus.d.ts +8 -11
  226. package/types/cmat-directives-data-exporter.d.ts +71 -40
  227. package/types/cmat-directives-debounce.d.ts +31 -28
  228. package/types/cmat-directives-digit-only.d.ts +90 -53
  229. package/types/cmat-directives-equal-validator.d.ts +11 -14
  230. package/types/cmat-directives-seamless-auto-scroll.d.ts +42 -29
  231. package/types/cmat-lib-mock-api.d.ts +46 -55
  232. package/types/cmat-pipes-bytes.d.ts +7 -10
  233. package/types/cmat-pipes-date-format.d.ts +7 -10
  234. package/types/cmat-pipes-find-by-key.d.ts +8 -12
  235. package/types/cmat-pipes-group-by.d.ts +11 -15
  236. package/types/cmat-pipes-keys.d.ts +10 -13
  237. package/types/cmat-pipes-secure.d.ts +14 -17
  238. package/types/cmat-pipes-uppercase.d.ts +7 -10
  239. package/types/cmat-reports.d.ts +1138 -0
  240. package/types/cmat-services-alert.d.ts +80 -87
  241. package/types/cmat-services-config.d.ts +37 -43
  242. package/types/cmat-services-confirmation.d.ts +31 -37
  243. package/types/cmat-services-data.d.ts +18 -21
  244. package/types/cmat-services-export-as.d.ts +28 -33
  245. package/types/cmat-services-loading.d.ts +27 -31
  246. package/types/cmat-services-local-storage.d.ts +17 -21
  247. package/types/cmat-services-media-watcher.d.ts +14 -18
  248. package/types/cmat-services-platform.d.ts +8 -11
  249. package/types/cmat-services-print.d.ts +97 -102
  250. package/types/cmat-services-splash-screen.d.ts +11 -14
  251. package/types/cmat-services-title.d.ts +9 -12
  252. package/types/cmat-services-translation.d.ts +19 -22
  253. package/types/cmat-services-utils.d.ts +76 -80
  254. package/types/cmat-validators.d.ts +5 -8
  255. package/types/cmat-version.d.ts +8 -10
  256. package/types/cmat.d.ts +7551 -5204
@@ -1,194 +1,247 @@
1
- import * as i0 from '@angular/core';
2
- import { input, output, signal, inject, DOCUMENT, computed, HostListener, Directive } from '@angular/core';
3
- import { CmatMediaWatcherService } from 'cmat/services/media-watcher';
4
-
5
- class CmatArrowCursorDirective {
6
- constructor() {
7
- this.animationDuration = input(0.3, /* @ts-ignore */
8
- ...(ngDevMode ? [{ debugName: "animationDuration" }] : /* istanbul ignore next */ []));
9
- this.orientation = input('horizontal', /* @ts-ignore */
10
- ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
11
- this.enabled = input(false, /* @ts-ignore */
12
- ...(ngDevMode ? [{ debugName: "enabled" }] : /* istanbul ignore next */ []));
13
- this.selector = input('.carousel-arrow-cursor', /* @ts-ignore */
14
- ...(ngDevMode ? [{ debugName: "selector" }] : /* istanbul ignore next */ []));
15
- this.clickEvent = output();
16
- this._arrowCursor = null;
17
- this._cursorAnimationFrame = signal(null, /* @ts-ignore */
18
- ...(ngDevMode ? [{ debugName: "_cursorAnimationFrame" }] : /* istanbul ignore next */ []));
19
- this._cursorClientX = signal(0, /* @ts-ignore */
20
- ...(ngDevMode ? [{ debugName: "_cursorClientX" }] : /* istanbul ignore next */ []));
21
- this._cursorClientY = signal(0, /* @ts-ignore */
22
- ...(ngDevMode ? [{ debugName: "_cursorClientY" }] : /* istanbul ignore next */ []));
23
- this._cursorSide = signal(null, /* @ts-ignore */
24
- ...(ngDevMode ? [{ debugName: "_cursorSide" }] : /* istanbul ignore next */ []));
25
- this._oldCursorSide = signal(null, /* @ts-ignore */
26
- ...(ngDevMode ? [{ debugName: "_oldCursorSide" }] : /* istanbul ignore next */ []));
27
- this._document = inject(DOCUMENT);
28
- this._cmatMediaWatcherService = inject(CmatMediaWatcherService);
29
- this._isCursorActive = false;
30
- this._boundMoveCursor = this.moveCursor.bind(this);
31
- // eslint-disable-next-line @typescript-eslint/member-ordering
32
- this.isPhone = computed(() => {
33
- return !this._cmatMediaWatcherService.mediaChange().matchingAliases.includes('lg');
34
- }, /* @ts-ignore */
35
- ...(ngDevMode ? [{ debugName: "isPhone" }] : /* istanbul ignore next */ []));
36
- }
37
- onMouseEnter(event) {
38
- if (!this.isPhone() && this.enabled()) {
39
- this._arrowCursor = this._document.querySelector(this.selector());
40
- if (this._cursorIcon == null) {
41
- this._cursorIcon = this._arrowCursor?.querySelector('.arrow-cursor-icon') ?? null;
42
- this._cursorSide.set(null);
43
- if (this._cursorIcon) {
44
- this._cursorIcon.style.transform = 'rotate3d(0,0,1,-135deg) scale3d(0.5,0.5,1)';
45
- this._cursorIcon.style.opacity = '0';
46
- }
47
- }
48
- this._cursorClientX.set(event.clientX);
49
- this._cursorClientY.set(event.clientY);
50
- let t;
51
- if (this.orientation() === 'horizontal') {
52
- this._cursorSide.set(this._cursorClientX() > window.innerWidth / 2 ? 'right' : 'left');
53
- const target = event.target;
54
- if (target) {
55
- t = (this._cursorClientY() < (target.getBoundingClientRect().top + target.getBoundingClientRect().height / 2))
56
- ? -135
57
- : (this._cursorSide() === 'right' ? 135 : -315);
58
- }
59
- else {
60
- t = -135;
61
- }
62
- }
63
- else {
64
- this._cursorSide.set(this._cursorClientY() > window.innerHeight / 2 ? 'down' : 'up');
65
- const target = event.target;
66
- if (target) {
67
- t = (this._cursorClientX() < (target.getBoundingClientRect().left + target.getBoundingClientRect().width / 2))
68
- ? 135
69
- : (this._cursorSide() === 'down' ? -135 : 45);
70
- }
71
- else {
72
- t = 135;
73
- }
74
- }
75
- if (this._cursorIcon) {
76
- this._cursorIcon.style.transform = 'rotate3d(0,0,1,' + t + 'deg)';
77
- this._cursorIcon.style.transition = this.animationDuration() + 's';
78
- this._applyCursorRotation(this._cursorSide());
79
- this._cursorIcon.style.opacity = '1';
80
- }
81
- this._startCursorLoop();
82
- }
83
- }
84
- onMouseLeave(event) {
85
- if (!this.isPhone() && this.enabled()) {
86
- let t;
87
- const target = event.target;
88
- if (!target) {
89
- return;
90
- }
91
- if (this.orientation() === 'horizontal') {
92
- t = (this._cursorClientY() < (target.getBoundingClientRect().top + target.getBoundingClientRect().height / 2))
93
- ? (('right' === this._cursorSide()) ? -135 : -45)
94
- : (('right' === this._cursorSide()) ? 135 : -315);
95
- }
96
- else {
97
- t = (this._cursorClientX() < (target.getBoundingClientRect().left + target.getBoundingClientRect().width / 2))
98
- ? (('down' === this._cursorSide()) ? 225 : -225)
99
- : (('down' === this._cursorSide()) ? -45 : 45);
100
- }
101
- if (this._cursorIcon) {
102
- this._cursorIcon.style.transition = this.animationDuration() + 's';
103
- this._cursorIcon.style.transform = 'rotate3d(0,0,1,' + t + 'deg) scale3d(0.3,0.3,1)';
104
- this._cursorIcon.style.opacity = '0';
105
- }
106
- this._stopCursorLoop();
107
- }
108
- }
109
- onMouseOver(event) {
110
- if (!this.isPhone() && this._cursorIcon && this.enabled()) {
111
- this._cursorClientX.set(event.clientX);
112
- this._cursorClientY.set(event.clientY);
113
- if (this.orientation() === 'horizontal') {
114
- this._cursorSide.set(this._cursorClientX() > window.innerWidth / 2 ? 'right' : 'left');
115
- }
116
- else {
117
- this._cursorSide.set(this._cursorClientY() > window.innerHeight / 2 ? 'down' : 'up');
118
- }
119
- if (this._oldCursorSide() !== this._cursorSide()) {
120
- this._cursorIcon.style.transition = this.animationDuration() + 's';
121
- this._applyCursorRotation(this._cursorSide());
122
- this._oldCursorSide.set(this._cursorSide());
123
- }
124
- }
125
- }
126
- onClick(event) {
127
- if (!this.isPhone() && this._cursorIcon && this.enabled()) {
128
- this.clickEvent.emit(this._cursorSide());
129
- event.stopPropagation();
130
- }
131
- }
132
- ngOnDestroy() {
133
- this._stopCursorLoop();
134
- }
135
- moveCursor() {
136
- if (this._isCursorActive && this._arrowCursor) {
137
- this._arrowCursor.style.transform = 'translate3d(' + this._cursorClientX() + 'px,' + this._cursorClientY() + 'px,0px)';
138
- this._cursorAnimationFrame.set(requestAnimationFrame(this._boundMoveCursor));
139
- }
140
- }
141
- _startCursorLoop() {
142
- this._isCursorActive = true;
143
- this._cursorAnimationFrame.set(requestAnimationFrame(this._boundMoveCursor));
144
- }
145
- _stopCursorLoop() {
146
- this._isCursorActive = false;
147
- if (this._cursorAnimationFrame() !== null) {
148
- window.cancelAnimationFrame(this._cursorAnimationFrame() ?? 0);
149
- this._cursorAnimationFrame.set(null);
150
- }
151
- }
152
- _applyCursorRotation(side) {
153
- if (!this._cursorIcon) {
154
- return;
155
- }
156
- const rotationMap = {
157
- 'left': 'rotate3d(0,0,1,-180deg)',
158
- 'up': 'rotate3d(0,0,1,-90deg)',
159
- 'right': 'rotate3d(0,0,1,0deg)',
160
- 'down': 'rotate3d(0,0,1,90deg)'
161
- };
162
- const transform = side ? rotationMap[side] : null;
163
- if (transform) {
164
- this._cursorIcon.style.transform = transform;
165
- }
166
- }
167
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatArrowCursorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
168
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.0", type: CmatArrowCursorDirective, isStandalone: true, selector: "[cmatArrowCursor]", inputs: { animationDuration: { classPropertyName: "animationDuration", publicName: "animationDuration", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, selector: { classPropertyName: "selector", publicName: "selector", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickEvent: "clickEvent" }, host: { listeners: { "mouseenter": "onMouseEnter($event)", "mouseleave": "onMouseLeave($event)", "mousemove": "onMouseOver($event)", "click": "onClick($event)" } }, ngImport: i0 }); }
169
- }
170
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatArrowCursorDirective, decorators: [{
171
- type: Directive,
172
- args: [{
173
- selector: '[cmatArrowCursor]'
174
- }]
175
- }], propDecorators: { animationDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationDuration", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: false }] }], selector: [{ type: i0.Input, args: [{ isSignal: true, alias: "selector", required: false }] }], clickEvent: [{ type: i0.Output, args: ["clickEvent"] }], onMouseEnter: [{
176
- type: HostListener,
177
- args: ['mouseenter', ['$event']]
178
- }], onMouseLeave: [{
179
- type: HostListener,
180
- args: ['mouseleave', ['$event']]
181
- }], onMouseOver: [{
182
- type: HostListener,
183
- args: ['mousemove', ['$event']]
184
- }], onClick: [{
185
- type: HostListener,
186
- args: ['click', ['$event']]
187
- }] } });
188
-
189
- /**
190
- * Generated bundle index. Do not edit.
191
- */
192
-
1
+ import * as i0 from "@angular/core";
2
+ import { DOCUMENT, Directive, HostListener, computed, inject, input, output, signal } from "@angular/core";
3
+ import { CmatMediaWatcherService } from "cmat/services/media-watcher";
4
+ var CmatArrowCursorDirective = class CmatArrowCursorDirective {
5
+ constructor() {
6
+ this.animationDuration = input(.3, ...ngDevMode ? [{ debugName: "animationDuration" }] : /* istanbul ignore next */ []);
7
+ this.orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
8
+ this.enabled = input(false, ...ngDevMode ? [{ debugName: "enabled" }] : /* istanbul ignore next */ []);
9
+ this.selector = input(".carousel-arrow-cursor", ...ngDevMode ? [{ debugName: "selector" }] : /* istanbul ignore next */ []);
10
+ this.clickEvent = output();
11
+ this._arrowCursor = null;
12
+ this._cursorAnimationFrame = signal(null, ...ngDevMode ? [{ debugName: "_cursorAnimationFrame" }] : /* istanbul ignore next */ []);
13
+ this._cursorClientX = signal(0, ...ngDevMode ? [{ debugName: "_cursorClientX" }] : /* istanbul ignore next */ []);
14
+ this._cursorClientY = signal(0, ...ngDevMode ? [{ debugName: "_cursorClientY" }] : /* istanbul ignore next */ []);
15
+ this._cursorSide = signal(null, ...ngDevMode ? [{ debugName: "_cursorSide" }] : /* istanbul ignore next */ []);
16
+ this._oldCursorSide = signal(null, ...ngDevMode ? [{ debugName: "_oldCursorSide" }] : /* istanbul ignore next */ []);
17
+ this._document = inject(DOCUMENT);
18
+ this._cmatMediaWatcherService = inject(CmatMediaWatcherService);
19
+ this._isCursorActive = false;
20
+ this._boundMoveCursor = this.moveCursor.bind(this);
21
+ this.isPhone = computed(() => {
22
+ return !this._cmatMediaWatcherService.mediaChange().matchingAliases.includes("lg");
23
+ }, ...ngDevMode ? [{ debugName: "isPhone" }] : /* istanbul ignore next */ []);
24
+ }
25
+ onMouseEnter(event) {
26
+ if (!this.isPhone() && this.enabled()) {
27
+ this._arrowCursor = this._document.querySelector(this.selector());
28
+ if (this._cursorIcon == null) {
29
+ this._cursorIcon = this._arrowCursor?.querySelector(".arrow-cursor-icon") ?? null;
30
+ this._cursorSide.set(null);
31
+ if (this._cursorIcon) {
32
+ this._cursorIcon.style.transform = "rotate3d(0,0,1,-135deg) scale3d(0.5,0.5,1)";
33
+ this._cursorIcon.style.opacity = "0";
34
+ }
35
+ }
36
+ this._cursorClientX.set(event.clientX);
37
+ this._cursorClientY.set(event.clientY);
38
+ let t;
39
+ if (this.orientation() === "horizontal") {
40
+ this._cursorSide.set(this._cursorClientX() > window.innerWidth / 2 ? "right" : "left");
41
+ const target = event.target;
42
+ if (target) t = this._cursorClientY() < target.getBoundingClientRect().top + target.getBoundingClientRect().height / 2 ? -135 : this._cursorSide() === "right" ? 135 : -315;
43
+ else t = -135;
44
+ } else {
45
+ this._cursorSide.set(this._cursorClientY() > window.innerHeight / 2 ? "down" : "up");
46
+ const target = event.target;
47
+ if (target) t = this._cursorClientX() < target.getBoundingClientRect().left + target.getBoundingClientRect().width / 2 ? 135 : this._cursorSide() === "down" ? -135 : 45;
48
+ else t = 135;
49
+ }
50
+ if (this._cursorIcon) {
51
+ this._cursorIcon.style.transform = "rotate3d(0,0,1," + t + "deg)";
52
+ this._cursorIcon.style.transition = this.animationDuration() + "s";
53
+ this._applyCursorRotation(this._cursorSide());
54
+ this._cursorIcon.style.opacity = "1";
55
+ }
56
+ this._startCursorLoop();
57
+ }
58
+ }
59
+ onMouseLeave(event) {
60
+ if (!this.isPhone() && this.enabled()) {
61
+ let t;
62
+ const target = event.target;
63
+ if (!target) return;
64
+ if (this.orientation() === "horizontal") t = this._cursorClientY() < target.getBoundingClientRect().top + target.getBoundingClientRect().height / 2 ? "right" === this._cursorSide() ? -135 : -45 : "right" === this._cursorSide() ? 135 : -315;
65
+ else t = this._cursorClientX() < target.getBoundingClientRect().left + target.getBoundingClientRect().width / 2 ? "down" === this._cursorSide() ? 225 : -225 : "down" === this._cursorSide() ? -45 : 45;
66
+ if (this._cursorIcon) {
67
+ this._cursorIcon.style.transition = this.animationDuration() + "s";
68
+ this._cursorIcon.style.transform = "rotate3d(0,0,1," + t + "deg) scale3d(0.3,0.3,1)";
69
+ this._cursorIcon.style.opacity = "0";
70
+ }
71
+ this._stopCursorLoop();
72
+ }
73
+ }
74
+ onMouseOver(event) {
75
+ if (!this.isPhone() && this._cursorIcon && this.enabled()) {
76
+ this._cursorClientX.set(event.clientX);
77
+ this._cursorClientY.set(event.clientY);
78
+ if (this.orientation() === "horizontal") this._cursorSide.set(this._cursorClientX() > window.innerWidth / 2 ? "right" : "left");
79
+ else this._cursorSide.set(this._cursorClientY() > window.innerHeight / 2 ? "down" : "up");
80
+ if (this._oldCursorSide() !== this._cursorSide()) {
81
+ this._cursorIcon.style.transition = this.animationDuration() + "s";
82
+ this._applyCursorRotation(this._cursorSide());
83
+ this._oldCursorSide.set(this._cursorSide());
84
+ }
85
+ }
86
+ }
87
+ onClick(event) {
88
+ if (!this.isPhone() && this._cursorIcon && this.enabled()) {
89
+ this.clickEvent.emit(this._cursorSide());
90
+ event.stopPropagation();
91
+ }
92
+ }
93
+ ngOnDestroy() {
94
+ this._stopCursorLoop();
95
+ }
96
+ moveCursor() {
97
+ if (this._isCursorActive && this._arrowCursor) {
98
+ this._arrowCursor.style.transform = "translate3d(" + this._cursorClientX() + "px," + this._cursorClientY() + "px,0px)";
99
+ this._cursorAnimationFrame.set(requestAnimationFrame(this._boundMoveCursor));
100
+ }
101
+ }
102
+ _startCursorLoop() {
103
+ this._isCursorActive = true;
104
+ this._cursorAnimationFrame.set(requestAnimationFrame(this._boundMoveCursor));
105
+ }
106
+ _stopCursorLoop() {
107
+ this._isCursorActive = false;
108
+ if (this._cursorAnimationFrame() !== null) {
109
+ window.cancelAnimationFrame(this._cursorAnimationFrame() ?? 0);
110
+ this._cursorAnimationFrame.set(null);
111
+ }
112
+ }
113
+ _applyCursorRotation(side) {
114
+ if (!this._cursorIcon) return;
115
+ const transform = side ? {
116
+ "left": "rotate3d(0,0,1,-180deg)",
117
+ "up": "rotate3d(0,0,1,-90deg)",
118
+ "right": "rotate3d(0,0,1,0deg)",
119
+ "down": "rotate3d(0,0,1,90deg)"
120
+ }[side] : null;
121
+ if (transform) this._cursorIcon.style.transform = transform;
122
+ }
123
+ static {
124
+ this.ɵfac = i0.ɵɵngDeclareFactory({
125
+ minVersion: "12.0.0",
126
+ version: "22.2.3",
127
+ ngImport: i0,
128
+ type: CmatArrowCursorDirective,
129
+ deps: [],
130
+ target: i0.ɵɵFactoryTarget.Directive
131
+ });
132
+ }
133
+ static {
134
+ this.ɵdir = i0.ɵɵngDeclareDirective({
135
+ minVersion: "17.1.0",
136
+ version: "22.2.3",
137
+ type: CmatArrowCursorDirective,
138
+ isStandalone: true,
139
+ selector: "[cmatArrowCursor]",
140
+ inputs: {
141
+ animationDuration: {
142
+ classPropertyName: "animationDuration",
143
+ publicName: "animationDuration",
144
+ isSignal: true,
145
+ isRequired: false,
146
+ transformFunction: null
147
+ },
148
+ orientation: {
149
+ classPropertyName: "orientation",
150
+ publicName: "orientation",
151
+ isSignal: true,
152
+ isRequired: false,
153
+ transformFunction: null
154
+ },
155
+ enabled: {
156
+ classPropertyName: "enabled",
157
+ publicName: "enabled",
158
+ isSignal: true,
159
+ isRequired: false,
160
+ transformFunction: null
161
+ },
162
+ selector: {
163
+ classPropertyName: "selector",
164
+ publicName: "selector",
165
+ isSignal: true,
166
+ isRequired: false,
167
+ transformFunction: null
168
+ }
169
+ },
170
+ outputs: { clickEvent: "clickEvent" },
171
+ host: { listeners: {
172
+ "mouseenter": "onMouseEnter($event)",
173
+ "mouseleave": "onMouseLeave($event)",
174
+ "mousemove": "onMouseOver($event)",
175
+ "click": "onClick($event)"
176
+ } },
177
+ ngImport: i0
178
+ });
179
+ }
180
+ };
181
+ i0.ɵɵngDeclareClassMetadata({
182
+ minVersion: "12.0.0",
183
+ version: "22.2.3",
184
+ ngImport: i0,
185
+ type: CmatArrowCursorDirective,
186
+ decorators: [{
187
+ type: Directive,
188
+ args: [{ selector: "[cmatArrowCursor]" }]
189
+ }],
190
+ propDecorators: {
191
+ animationDuration: [{
192
+ type: i0.Input,
193
+ args: [{
194
+ isSignal: true,
195
+ alias: "animationDuration",
196
+ required: false
197
+ }]
198
+ }],
199
+ orientation: [{
200
+ type: i0.Input,
201
+ args: [{
202
+ isSignal: true,
203
+ alias: "orientation",
204
+ required: false
205
+ }]
206
+ }],
207
+ enabled: [{
208
+ type: i0.Input,
209
+ args: [{
210
+ isSignal: true,
211
+ alias: "enabled",
212
+ required: false
213
+ }]
214
+ }],
215
+ selector: [{
216
+ type: i0.Input,
217
+ args: [{
218
+ isSignal: true,
219
+ alias: "selector",
220
+ required: false
221
+ }]
222
+ }],
223
+ clickEvent: [{
224
+ type: i0.Output,
225
+ args: ["clickEvent"]
226
+ }],
227
+ onMouseEnter: [{
228
+ type: HostListener,
229
+ args: ["mouseenter", ["$event"]]
230
+ }],
231
+ onMouseLeave: [{
232
+ type: HostListener,
233
+ args: ["mouseleave", ["$event"]]
234
+ }],
235
+ onMouseOver: [{
236
+ type: HostListener,
237
+ args: ["mousemove", ["$event"]]
238
+ }],
239
+ onClick: [{
240
+ type: HostListener,
241
+ args: ["click", ["$event"]]
242
+ }]
243
+ }
244
+ });
193
245
  export { CmatArrowCursorDirective };
194
- //# sourceMappingURL=cmat-directives-arrow-cursor.mjs.map
246
+
247
+ //# sourceMappingURL=cmat-directives-arrow-cursor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cmat-directives-arrow-cursor.mjs","sources":["../../../projects/cmat/directives/arrow-cursor/arrow-cursor.directive.ts","../../../projects/cmat/directives/arrow-cursor/cmat-directives-arrow-cursor.ts"],"sourcesContent":["import {\r\n Directive,\r\n HostListener,\r\n DOCUMENT,\r\n inject,\r\n input,\r\n output,\r\n OnDestroy,\r\n computed,\r\n signal,\r\n} from '@angular/core';\r\nimport { CmatMediaWatcherService } from 'cmat/services/media-watcher';\r\n\r\n@Directive({\r\n selector: '[cmatArrowCursor]'\r\n})\r\nexport class CmatArrowCursorDirective implements OnDestroy {\r\n readonly animationDuration = input<number>(0.3);\r\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\r\n readonly enabled = input<boolean>(false);\r\n readonly selector = input<string>('.carousel-arrow-cursor');\r\n\r\n readonly clickEvent = output<string | null>();\r\n\r\n private _arrowCursor: HTMLDivElement | null = null;\r\n private _cursorIcon: SVGElement | null;\r\n\r\n private readonly _cursorAnimationFrame = signal<number | null>(null);\r\n private readonly _cursorClientX = signal(0);\r\n private readonly _cursorClientY = signal(0);\r\n private readonly _cursorSide = signal<string | null>(null);\r\n private readonly _oldCursorSide = signal<string | null>(null);\r\n\r\n private _document = inject<Document>(DOCUMENT);\r\n private _cmatMediaWatcherService = inject(CmatMediaWatcherService);\r\n private _isCursorActive = false;\r\n private readonly _boundMoveCursor = this.moveCursor.bind(this);\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n readonly isPhone = computed(() => {\r\n return !this._cmatMediaWatcherService.mediaChange().matchingAliases.includes('lg')\r\n });\r\n\r\n @HostListener('mouseenter', ['$event'])\r\n public onMouseEnter(event: MouseEvent): void {\r\n if (!this.isPhone() && this.enabled()) {\r\n this._arrowCursor = this._document.querySelector(this.selector());\r\n if (this._cursorIcon == null) {\r\n this._cursorIcon = this._arrowCursor?.querySelector('.arrow-cursor-icon') ?? null;\r\n this._cursorSide.set(null);\r\n\r\n if (this._cursorIcon) {\r\n this._cursorIcon.style.transform = 'rotate3d(0,0,1,-135deg) scale3d(0.5,0.5,1)';\r\n this._cursorIcon.style.opacity = '0';\r\n }\r\n }\r\n\r\n this._cursorClientX.set(event.clientX);\r\n this._cursorClientY.set(event.clientY);\r\n\r\n let t;\r\n\r\n if (this.orientation() === 'horizontal') {\r\n this._cursorSide.set(this._cursorClientX() > window.innerWidth / 2 ? 'right' : 'left');\r\n\r\n const target = event.target as HTMLElement | null;\r\n if (target) {\r\n t = (this._cursorClientY() < (target.getBoundingClientRect().top + target.getBoundingClientRect().height / 2))\r\n ? -135\r\n : (this._cursorSide() === 'right' ? 135 : -315);\r\n } else {\r\n t = -135;\r\n }\r\n } else {\r\n this._cursorSide.set(this._cursorClientY() > window.innerHeight / 2 ? 'down' : 'up');\r\n\r\n const target = event.target as HTMLElement | null;\r\n if (target) {\r\n t = (this._cursorClientX() < (target.getBoundingClientRect().left + target.getBoundingClientRect().width / 2))\r\n ? 135\r\n : (this._cursorSide() === 'down' ? -135 : 45);\r\n } else {\r\n t = 135;\r\n }\r\n }\r\n\r\n if (this._cursorIcon) {\r\n this._cursorIcon.style.transform = 'rotate3d(0,0,1,' + t + 'deg)';\r\n this._cursorIcon.style.transition = this.animationDuration() + 's';\r\n this._applyCursorRotation(this._cursorSide());\r\n this._cursorIcon.style.opacity = '1';\r\n }\r\n\r\n this._startCursorLoop();\r\n }\r\n }\r\n\r\n @HostListener('mouseleave', ['$event'])\r\n public onMouseLeave(event: MouseEvent): void {\r\n if (!this.isPhone() && this.enabled()) {\r\n let t;\r\n\r\n const target = event.target as HTMLElement | null;\r\n if (!target) {\r\n return;\r\n }\r\n\r\n if (this.orientation() === 'horizontal') {\r\n t = (this._cursorClientY() < (target.getBoundingClientRect().top + target.getBoundingClientRect().height / 2))\r\n ? (('right' === this._cursorSide()) ? -135 : -45)\r\n : (('right' === this._cursorSide()) ? 135 : -315);\r\n } else {\r\n t = (this._cursorClientX() < (target.getBoundingClientRect().left + target.getBoundingClientRect().width / 2))\r\n ? (('down' === this._cursorSide()) ? 225 : -225)\r\n : (('down' === this._cursorSide()) ? -45 : 45);\r\n }\r\n\r\n if (this._cursorIcon) {\r\n this._cursorIcon.style.transition = this.animationDuration() + 's';\r\n this._cursorIcon.style.transform = 'rotate3d(0,0,1,' + t + 'deg) scale3d(0.3,0.3,1)';\r\n this._cursorIcon.style.opacity = '0';\r\n }\r\n\r\n this._stopCursorLoop();\r\n }\r\n }\r\n\r\n @HostListener('mousemove', ['$event'])\r\n public onMouseOver(event: MouseEvent): void {\r\n if (!this.isPhone() && this._cursorIcon && this.enabled()) {\r\n this._cursorClientX.set(event.clientX);\r\n this._cursorClientY.set(event.clientY);\r\n\r\n if (this.orientation() === 'horizontal') {\r\n this._cursorSide.set(this._cursorClientX() > window.innerWidth / 2 ? 'right' : 'left');\r\n } else {\r\n this._cursorSide.set(this._cursorClientY() > window.innerHeight / 2 ? 'down' : 'up');\r\n }\r\n\r\n if (this._oldCursorSide() !== this._cursorSide()) {\r\n this._cursorIcon.style.transition = this.animationDuration() + 's';\r\n this._applyCursorRotation(this._cursorSide());\r\n this._oldCursorSide.set(this._cursorSide());\r\n }\r\n }\r\n }\r\n\r\n @HostListener('click', ['$event'])\r\n onClick(event: Event): void {\r\n if (!this.isPhone() && this._cursorIcon && this.enabled()) {\r\n this.clickEvent.emit(this._cursorSide());\r\n\r\n event.stopPropagation();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._stopCursorLoop();\r\n }\r\n\r\n moveCursor(): void {\r\n if (this._isCursorActive && this._arrowCursor) {\r\n this._arrowCursor.style.transform = 'translate3d(' + this._cursorClientX() + 'px,' + this._cursorClientY() + 'px,0px)';\r\n this._cursorAnimationFrame.set(requestAnimationFrame(this._boundMoveCursor));\r\n }\r\n }\r\n\r\n private _startCursorLoop(): void {\r\n this._isCursorActive = true;\r\n this._cursorAnimationFrame.set(requestAnimationFrame(this._boundMoveCursor));\r\n }\r\n\r\n private _stopCursorLoop(): void {\r\n this._isCursorActive = false;\r\n if (this._cursorAnimationFrame() !== null) {\r\n window.cancelAnimationFrame(this._cursorAnimationFrame() ?? 0);\r\n this._cursorAnimationFrame.set(null);\r\n }\r\n }\r\n\r\n private _applyCursorRotation(side: string | null): void {\r\n if (!this._cursorIcon) {\r\n return;\r\n }\r\n const rotationMap: Record<string, string> = {\r\n 'left': 'rotate3d(0,0,1,-180deg)',\r\n 'up': 'rotate3d(0,0,1,-90deg)',\r\n 'right': 'rotate3d(0,0,1,0deg)',\r\n 'down': 'rotate3d(0,0,1,90deg)'\r\n };\r\n const transform = side ? rotationMap[side] : null;\r\n if (transform) {\r\n this._cursorIcon.style.transform = transform;\r\n }\r\n }\r\n\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAgBa,wBAAwB,CAAA;AAHrC,IAAA,WAAA,GAAA;QAIa,IAAA,CAAA,iBAAiB,GAAG,KAAK,CAAS,GAAG;8FAAC;QACtC,IAAA,CAAA,WAAW,GAAG,KAAK,CAA4B,YAAY;wFAAC;QAC5D,IAAA,CAAA,OAAO,GAAG,KAAK,CAAU,KAAK;oFAAC;QAC/B,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAS,wBAAwB;qFAAC;QAElD,IAAA,CAAA,UAAU,GAAG,MAAM,EAAiB;QAErC,IAAA,CAAA,YAAY,GAA0B,IAAI;QAGjC,IAAA,CAAA,qBAAqB,GAAG,MAAM,CAAgB,IAAI;kGAAC;QACnD,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,CAAC;2FAAC;QAC1B,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,CAAC;2FAAC;QAC1B,IAAA,CAAA,WAAW,GAAG,MAAM,CAAgB,IAAI;wFAAC;QACzC,IAAA,CAAA,cAAc,GAAG,MAAM,CAAgB,IAAI;2FAAC;AAErD,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAW,QAAQ,CAAC;AACtC,QAAA,IAAA,CAAA,wBAAwB,GAAG,MAAM,CAAC,uBAAuB,CAAC;QAC1D,IAAA,CAAA,eAAe,GAAG,KAAK;QACd,IAAA,CAAA,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAA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IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE;AACb,iBAAA;;sBA4BI,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;;sBAsDrC,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;;sBA8BrC,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;;sBAoBpC,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;ACnJrC;;AAEG;;"}
1
+ {"version":3,"file":"cmat-directives-arrow-cursor.mjs","names":[],"sources":["../../../projects/cmat/directives/arrow-cursor/arrow-cursor.directive.ts"],"sourcesContent":["import {\r\n Directive,\r\n HostListener,\r\n DOCUMENT,\r\n inject,\r\n input,\r\n output,\r\n OnDestroy,\r\n computed,\r\n signal,\r\n} from '@angular/core';\r\nimport { CmatMediaWatcherService } from 'cmat/services/media-watcher';\r\n\r\n@Directive({\r\n selector: '[cmatArrowCursor]'\r\n})\r\nexport class CmatArrowCursorDirective implements OnDestroy {\r\n readonly animationDuration = input<number>(0.3);\r\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\r\n readonly enabled = input<boolean>(false);\r\n readonly selector = input<string>('.carousel-arrow-cursor');\r\n\r\n readonly clickEvent = output<string | null>();\r\n\r\n private _arrowCursor: HTMLDivElement | null = null;\r\n private _cursorIcon: SVGElement | null;\r\n\r\n private readonly _cursorAnimationFrame = signal<number | null>(null);\r\n private readonly _cursorClientX = signal(0);\r\n private readonly _cursorClientY = signal(0);\r\n private readonly _cursorSide = signal<string | null>(null);\r\n private readonly _oldCursorSide = signal<string | null>(null);\r\n\r\n private _document = inject<Document>(DOCUMENT);\r\n private _cmatMediaWatcherService = inject(CmatMediaWatcherService);\r\n private _isCursorActive = false;\r\n private readonly _boundMoveCursor = this.moveCursor.bind(this);\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n readonly isPhone = computed(() => {\r\n return !this._cmatMediaWatcherService.mediaChange().matchingAliases.includes('lg')\r\n });\r\n\r\n @HostListener('mouseenter', ['$event'])\r\n public onMouseEnter(event: MouseEvent): void {\r\n if (!this.isPhone() && this.enabled()) {\r\n this._arrowCursor = this._document.querySelector(this.selector());\r\n if (this._cursorIcon == null) {\r\n this._cursorIcon = this._arrowCursor?.querySelector('.arrow-cursor-icon') ?? null;\r\n this._cursorSide.set(null);\r\n\r\n if (this._cursorIcon) {\r\n this._cursorIcon.style.transform = 'rotate3d(0,0,1,-135deg) scale3d(0.5,0.5,1)';\r\n this._cursorIcon.style.opacity = '0';\r\n }\r\n }\r\n\r\n this._cursorClientX.set(event.clientX);\r\n this._cursorClientY.set(event.clientY);\r\n\r\n let t;\r\n\r\n if (this.orientation() === 'horizontal') {\r\n this._cursorSide.set(this._cursorClientX() > window.innerWidth / 2 ? 'right' : 'left');\r\n\r\n const target = event.target as HTMLElement | null;\r\n if (target) {\r\n t = (this._cursorClientY() < (target.getBoundingClientRect().top + target.getBoundingClientRect().height / 2))\r\n ? -135\r\n : (this._cursorSide() === 'right' ? 135 : -315);\r\n } else {\r\n t = -135;\r\n }\r\n } else {\r\n this._cursorSide.set(this._cursorClientY() > window.innerHeight / 2 ? 'down' : 'up');\r\n\r\n const target = event.target as HTMLElement | null;\r\n if (target) {\r\n t = (this._cursorClientX() < (target.getBoundingClientRect().left + target.getBoundingClientRect().width / 2))\r\n ? 135\r\n : (this._cursorSide() === 'down' ? -135 : 45);\r\n } else {\r\n t = 135;\r\n }\r\n }\r\n\r\n if (this._cursorIcon) {\r\n this._cursorIcon.style.transform = 'rotate3d(0,0,1,' + t + 'deg)';\r\n this._cursorIcon.style.transition = this.animationDuration() + 's';\r\n this._applyCursorRotation(this._cursorSide());\r\n this._cursorIcon.style.opacity = '1';\r\n }\r\n\r\n this._startCursorLoop();\r\n }\r\n }\r\n\r\n @HostListener('mouseleave', ['$event'])\r\n public onMouseLeave(event: MouseEvent): void {\r\n if (!this.isPhone() && this.enabled()) {\r\n let t;\r\n\r\n const target = event.target as HTMLElement | null;\r\n if (!target) {\r\n return;\r\n }\r\n\r\n if (this.orientation() === 'horizontal') {\r\n t = (this._cursorClientY() < (target.getBoundingClientRect().top + target.getBoundingClientRect().height / 2))\r\n ? (('right' === this._cursorSide()) ? -135 : -45)\r\n : (('right' === this._cursorSide()) ? 135 : -315);\r\n } else {\r\n t = (this._cursorClientX() < (target.getBoundingClientRect().left + target.getBoundingClientRect().width / 2))\r\n ? (('down' === this._cursorSide()) ? 225 : -225)\r\n : (('down' === this._cursorSide()) ? -45 : 45);\r\n }\r\n\r\n if (this._cursorIcon) {\r\n this._cursorIcon.style.transition = this.animationDuration() + 's';\r\n this._cursorIcon.style.transform = 'rotate3d(0,0,1,' + t + 'deg) scale3d(0.3,0.3,1)';\r\n this._cursorIcon.style.opacity = '0';\r\n }\r\n\r\n this._stopCursorLoop();\r\n }\r\n }\r\n\r\n @HostListener('mousemove', ['$event'])\r\n public onMouseOver(event: MouseEvent): void {\r\n if (!this.isPhone() && this._cursorIcon && this.enabled()) {\r\n this._cursorClientX.set(event.clientX);\r\n this._cursorClientY.set(event.clientY);\r\n\r\n if (this.orientation() === 'horizontal') {\r\n this._cursorSide.set(this._cursorClientX() > window.innerWidth / 2 ? 'right' : 'left');\r\n } else {\r\n this._cursorSide.set(this._cursorClientY() > window.innerHeight / 2 ? 'down' : 'up');\r\n }\r\n\r\n if (this._oldCursorSide() !== this._cursorSide()) {\r\n this._cursorIcon.style.transition = this.animationDuration() + 's';\r\n this._applyCursorRotation(this._cursorSide());\r\n this._oldCursorSide.set(this._cursorSide());\r\n }\r\n }\r\n }\r\n\r\n @HostListener('click', ['$event'])\r\n onClick(event: Event): void {\r\n if (!this.isPhone() && this._cursorIcon && this.enabled()) {\r\n this.clickEvent.emit(this._cursorSide());\r\n\r\n event.stopPropagation();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._stopCursorLoop();\r\n }\r\n\r\n moveCursor(): void {\r\n if (this._isCursorActive && this._arrowCursor) {\r\n this._arrowCursor.style.transform = 'translate3d(' + this._cursorClientX() + 'px,' + this._cursorClientY() + 'px,0px)';\r\n this._cursorAnimationFrame.set(requestAnimationFrame(this._boundMoveCursor));\r\n }\r\n }\r\n\r\n private _startCursorLoop(): void {\r\n this._isCursorActive = true;\r\n this._cursorAnimationFrame.set(requestAnimationFrame(this._boundMoveCursor));\r\n }\r\n\r\n private _stopCursorLoop(): void {\r\n this._isCursorActive = false;\r\n if (this._cursorAnimationFrame() !== null) {\r\n window.cancelAnimationFrame(this._cursorAnimationFrame() ?? 0);\r\n this._cursorAnimationFrame.set(null);\r\n }\r\n }\r\n\r\n private _applyCursorRotation(side: string | null): void {\r\n if (!this._cursorIcon) {\r\n return;\r\n }\r\n const rotationMap: Record<string, string> = {\r\n 'left': 'rotate3d(0,0,1,-180deg)',\r\n 'up': 'rotate3d(0,0,1,-90deg)',\r\n 'right': 'rotate3d(0,0,1,0deg)',\r\n 'down': 'rotate3d(0,0,1,90deg)'\r\n };\r\n const transform = side ? rotationMap[side] : null;\r\n if (transform) {\r\n this._cursorIcon.style.transform = transform;\r\n }\r\n }\r\n\r\n}"],"mappings":";;;AAgBA,IAAa,2BAAb,MAAa,yBAAwB;CAHrC,cAAA;EAIa,KAAA,oBAAoB,MAAc,IAAI,GAAA,YAAA,CAAA,EAAA,WAAA,oBAAA,CAAA,+BAAA,CAAA,CAAA;EACtC,KAAA,cAAc,MAAiC,cAAa,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EAC5D,KAAA,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;EAC/B,KAAA,WAAW,MAAc,0BAAyB,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;EAElD,KAAA,aAAa,OAAM;EAEpB,KAAA,eAAsC;EAG7B,KAAA,wBAAwB,OAAsB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;GA4BI,MAAA;GAAa,MAAA,CAAA,cAAc,CAAC,QAAQ,CAAC;;;GAsDrC,MAAA;GAAa,MAAA,CAAA,cAAc,CAAC,QAAQ,CAAC;;;GA8BrC,MAAA;GAAa,MAAA,CAAA,aAAa,CAAC,QAAQ,CAAC;;;GAoBpC,MAAA;GAAa,MAAA,CAAA,SAAS,CAAC,QAAQ,CAAC"}
@@ -1,26 +1,44 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, ElementRef, Directive } from '@angular/core';
3
-
4
- class CmatAutofocusDirective {
5
- constructor() {
6
- this.element = inject(ElementRef);
7
- setTimeout(() => {
8
- this.element.nativeElement.focus();
9
- }, 0);
10
- }
11
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatAutofocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
12
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.0", type: CmatAutofocusDirective, isStandalone: true, selector: "[cmatAutofocus]", ngImport: i0 }); }
13
- }
14
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatAutofocusDirective, decorators: [{
15
- type: Directive,
16
- args: [{
17
- selector: '[cmatAutofocus]'
18
- }]
19
- }], ctorParameters: () => [] });
20
-
21
- /**
22
- * Generated bundle index. Do not edit.
23
- */
24
-
1
+ import * as i0 from "@angular/core";
2
+ import { Directive, ElementRef, inject } from "@angular/core";
3
+ var CmatAutofocusDirective = class CmatAutofocusDirective {
4
+ constructor() {
5
+ this.element = inject(ElementRef);
6
+ setTimeout(() => {
7
+ this.element.nativeElement.focus();
8
+ }, 0);
9
+ }
10
+ static {
11
+ this.ɵfac = i0.ɵɵngDeclareFactory({
12
+ minVersion: "12.0.0",
13
+ version: "22.2.3",
14
+ ngImport: i0,
15
+ type: CmatAutofocusDirective,
16
+ deps: [],
17
+ target: i0.ɵɵFactoryTarget.Directive
18
+ });
19
+ }
20
+ static {
21
+ this.ɵdir = i0.ɵɵngDeclareDirective({
22
+ minVersion: "14.0.0",
23
+ version: "22.2.3",
24
+ type: CmatAutofocusDirective,
25
+ isStandalone: true,
26
+ selector: "[cmatAutofocus]",
27
+ ngImport: i0
28
+ });
29
+ }
30
+ };
31
+ i0.ɵɵngDeclareClassMetadata({
32
+ minVersion: "12.0.0",
33
+ version: "22.2.3",
34
+ ngImport: i0,
35
+ type: CmatAutofocusDirective,
36
+ decorators: [{
37
+ type: Directive,
38
+ args: [{ selector: "[cmatAutofocus]" }]
39
+ }],
40
+ ctorParameters: () => []
41
+ });
25
42
  export { CmatAutofocusDirective };
26
- //# sourceMappingURL=cmat-directives-autofocus.mjs.map
43
+
44
+ //# sourceMappingURL=cmat-directives-autofocus.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cmat-directives-autofocus.mjs","sources":["../../../projects/cmat/directives/autofocus/autofocus.directive.ts","../../../projects/cmat/directives/autofocus/cmat-directives-autofocus.ts"],"sourcesContent":["import { Directive, ElementRef, inject } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[cmatAutofocus]'\r\n})\r\nexport class CmatAutofocusDirective {\r\n element = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n constructor() {\r\n setTimeout(() => {\r\n this.element.nativeElement.focus();\r\n }, 0);\r\n\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAKa,sBAAsB,CAAA;AAGjC,IAAA,WAAA,GAAA;AAFA,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAA0B,UAAU,CAAC;QAGnD,UAAU,CAAC,MAAK;AACd,YAAA,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE;QACpC,CAAC,EAAE,CAAC,CAAC;IAEP;8GARW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE;AACX,iBAAA;;;ACJD;;AAEG;;"}
1
+ {"version":3,"file":"cmat-directives-autofocus.mjs","names":[],"sources":["../../../projects/cmat/directives/autofocus/autofocus.directive.ts"],"sourcesContent":["import { Directive, ElementRef, inject } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[cmatAutofocus]'\r\n})\r\nexport class CmatAutofocusDirective {\r\n element = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n constructor() {\r\n setTimeout(() => {\r\n this.element.nativeElement.focus();\r\n }, 0);\r\n\r\n }\r\n}\r\n"],"mappings":";;AAKA,IAAa,yBAAb,MAAa,uBAAsB;CAGjC,cAAA;EAFA,KAAA,UAAU,OAAgC,UAAU;EAGlD,iBAAgB;GACd,KAAK,QAAQ,cAAc,MAAK;EAClC,GAAG,CAAC;CAEN;CARW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAsB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAtB;EAAA,KAAA,OAAA,GAAA,qBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,MAAA;GAAsB,cAAA;GAAA,UAAA;GAAA,UAAA;EAAA,CAAA;CAAA;;AAAtB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EAHlC,MAAA;EAAU,MAAA,CAAA,EACT,UAAU,kBACX,CAAA"}