cmat 0.0.111 → 0.0.112

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 +2751 -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 +1131 -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,634 +1,1125 @@
1
- import * as i3 from '@angular/common';
2
- import { CommonModule } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { Component, inject, TemplateRef, input, Directive, ElementRef, model, numberAttribute, booleanAttribute, output, viewChild, contentChild, contentChildren, signal, computed, DOCUMENT, Renderer2, effect, untracked, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
5
- import * as i2 from '@angular/material/button';
6
- import { MatButtonModule } from '@angular/material/button';
7
- import * as i1 from '@angular/material/icon';
8
- import { MatIconModule } from '@angular/material/icon';
9
- import { CmatArrowCursorDirective } from 'cmat/directives/arrow-cursor';
10
-
11
- class CmatCarouselHeaderComponent {
12
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatCarouselHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.2.0", type: CmatCarouselHeaderComponent, isStandalone: true, selector: "cmat-carousel-header", ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
14
- }
15
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatCarouselHeaderComponent, decorators: [{
16
- type: Component,
17
- args: [{
18
- selector: 'cmat-carousel-header',
19
- template: '<ng-content></ng-content>',
20
- }]
21
- }] });
22
- class CmatCarouselFooterComponent {
23
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatCarouselFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
24
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.2.0", type: CmatCarouselFooterComponent, isStandalone: true, selector: "cmat-carousel-footer", ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
25
- }
26
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatCarouselFooterComponent, decorators: [{
27
- type: Component,
28
- args: [{
29
- selector: 'cmat-carousel-footer',
30
- template: '<ng-content></ng-content>',
31
- }]
32
- }] });
33
- class CmatCarouselTemplateDirective {
34
- constructor() {
35
- this.template = inject(TemplateRef);
36
- this.type = input(/* @ts-ignore */
37
- ...(ngDevMode ? [undefined, { debugName: "type" }] : /* istanbul ignore next */ []));
38
- this.name = input(/* @ts-ignore */
39
- ...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
40
- }
41
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatCarouselTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
42
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.0", type: CmatCarouselTemplateDirective, isStandalone: true, selector: "[cmatCarouselTemplate]", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
43
- }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatCarouselTemplateDirective, decorators: [{
45
- type: Directive,
46
- args: [{
47
- selector: '[cmatCarouselTemplate]',
48
- }]
49
- }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] } });
1
+ import * as i3 from "@angular/common";
2
+ import { CommonModule } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, DOCUMENT, Directive, ElementRef, Renderer2, TemplateRef, ViewEncapsulation, booleanAttribute, computed, contentChild, contentChildren, effect, inject, input, model, numberAttribute, output, signal, untracked, viewChild } from "@angular/core";
5
+ import * as i2 from "@angular/material/button";
6
+ import { MatButtonModule } from "@angular/material/button";
7
+ import * as i1 from "@angular/material/icon";
8
+ import { MatIconModule } from "@angular/material/icon";
9
+ import { CmatArrowCursorDirective } from "cmat/directives/arrow-cursor";
10
+ var CmatCarouselHeaderComponent = class CmatCarouselHeaderComponent {
11
+ static {
12
+ this.ɵfac = i0.ɵɵngDeclareFactory({
13
+ minVersion: "12.0.0",
14
+ version: "22.2.3",
15
+ ngImport: i0,
16
+ type: CmatCarouselHeaderComponent,
17
+ deps: [],
18
+ target: i0.ɵɵFactoryTarget.Component
19
+ });
20
+ }
21
+ static {
22
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
23
+ minVersion: "14.0.0",
24
+ version: "22.2.3",
25
+ type: CmatCarouselHeaderComponent,
26
+ isStandalone: true,
27
+ selector: "cmat-carousel-header",
28
+ ngImport: i0,
29
+ template: "<ng-content></ng-content>",
30
+ isInline: true
31
+ });
32
+ }
33
+ };
34
+ i0.ɵɵngDeclareClassMetadata({
35
+ minVersion: "12.0.0",
36
+ version: "22.2.3",
37
+ ngImport: i0,
38
+ type: CmatCarouselHeaderComponent,
39
+ decorators: [{
40
+ type: Component,
41
+ args: [{
42
+ selector: "cmat-carousel-header",
43
+ template: "<ng-content></ng-content>"
44
+ }]
45
+ }]
46
+ });
47
+ var CmatCarouselFooterComponent = class CmatCarouselFooterComponent {
48
+ static {
49
+ this.ɵfac = i0.ɵɵngDeclareFactory({
50
+ minVersion: "12.0.0",
51
+ version: "22.2.3",
52
+ ngImport: i0,
53
+ type: CmatCarouselFooterComponent,
54
+ deps: [],
55
+ target: i0.ɵɵFactoryTarget.Component
56
+ });
57
+ }
58
+ static {
59
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
60
+ minVersion: "14.0.0",
61
+ version: "22.2.3",
62
+ type: CmatCarouselFooterComponent,
63
+ isStandalone: true,
64
+ selector: "cmat-carousel-footer",
65
+ ngImport: i0,
66
+ template: "<ng-content></ng-content>",
67
+ isInline: true
68
+ });
69
+ }
70
+ };
71
+ i0.ɵɵngDeclareClassMetadata({
72
+ minVersion: "12.0.0",
73
+ version: "22.2.3",
74
+ ngImport: i0,
75
+ type: CmatCarouselFooterComponent,
76
+ decorators: [{
77
+ type: Component,
78
+ args: [{
79
+ selector: "cmat-carousel-footer",
80
+ template: "<ng-content></ng-content>"
81
+ }]
82
+ }]
83
+ });
84
+ var CmatCarouselTemplateDirective = class CmatCarouselTemplateDirective {
85
+ constructor() {
86
+ this.template = inject(TemplateRef);
87
+ this.type = input(...ngDevMode ? [void 0, { debugName: "type" }] : /* istanbul ignore next */ []);
88
+ this.name = input(...ngDevMode ? [void 0, { debugName: "name" }] : /* istanbul ignore next */ []);
89
+ }
90
+ static {
91
+ this.ɵfac = i0.ɵɵngDeclareFactory({
92
+ minVersion: "12.0.0",
93
+ version: "22.2.3",
94
+ ngImport: i0,
95
+ type: CmatCarouselTemplateDirective,
96
+ deps: [],
97
+ target: i0.ɵɵFactoryTarget.Directive
98
+ });
99
+ }
100
+ static {
101
+ this.ɵdir = i0.ɵɵngDeclareDirective({
102
+ minVersion: "17.1.0",
103
+ version: "22.2.3",
104
+ type: CmatCarouselTemplateDirective,
105
+ isStandalone: true,
106
+ selector: "[cmatCarouselTemplate]",
107
+ inputs: {
108
+ type: {
109
+ classPropertyName: "type",
110
+ publicName: "type",
111
+ isSignal: true,
112
+ isRequired: false,
113
+ transformFunction: null
114
+ },
115
+ name: {
116
+ classPropertyName: "name",
117
+ publicName: "name",
118
+ isSignal: true,
119
+ isRequired: false,
120
+ transformFunction: null
121
+ }
122
+ },
123
+ ngImport: i0
124
+ });
125
+ }
126
+ };
127
+ i0.ɵɵngDeclareClassMetadata({
128
+ minVersion: "12.0.0",
129
+ version: "22.2.3",
130
+ ngImport: i0,
131
+ type: CmatCarouselTemplateDirective,
132
+ decorators: [{
133
+ type: Directive,
134
+ args: [{ selector: "[cmatCarouselTemplate]" }]
135
+ }],
136
+ propDecorators: {
137
+ type: [{
138
+ type: i0.Input,
139
+ args: [{
140
+ isSignal: true,
141
+ alias: "type",
142
+ required: false
143
+ }]
144
+ }],
145
+ name: [{
146
+ type: i0.Input,
147
+ args: [{
148
+ isSignal: true,
149
+ alias: "name",
150
+ required: false
151
+ }]
152
+ }]
153
+ }
154
+ });
50
155
  let NEXT_ID = 0;
51
- class CmatCarouselComponent {
52
- constructor() {
53
- this.el = inject(ElementRef);
54
- this.page = model(0, /* @ts-ignore */
55
- ...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
56
- this.numVisible = model(1, /* @ts-ignore */
57
- ...(ngDevMode ? [{ debugName: "numVisible" }] : /* istanbul ignore next */ []));
58
- this.numScroll = model(1, /* @ts-ignore */
59
- ...(ngDevMode ? [{ debugName: "numScroll" }] : /* istanbul ignore next */ []));
60
- this.autoplayInterval = input(0, { ...(ngDevMode ? { debugName: "autoplayInterval" } : /* istanbul ignore next */ {}), transform: numberAttribute });
61
- this.responsiveOptions = input(/* @ts-ignore */
62
- ...(ngDevMode ? [undefined, { debugName: "responsiveOptions" }] : /* istanbul ignore next */ []));
63
- this.orientation = input('horizontal', /* @ts-ignore */
64
- ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
65
- this.navigatorsType = input('normal', /* @ts-ignore */
66
- ...(ngDevMode ? [{ debugName: "navigatorsType" }] : /* istanbul ignore next */ []));
67
- this.verticalViewPortHeight = input('300px', /* @ts-ignore */
68
- ...(ngDevMode ? [{ debugName: "verticalViewPortHeight" }] : /* istanbul ignore next */ []));
69
- this.arrowSelector = input('.carousel-arrow-cursor', /* @ts-ignore */
70
- ...(ngDevMode ? [{ debugName: "arrowSelector" }] : /* istanbul ignore next */ []));
71
- this.contentClass = input('', /* @ts-ignore */
72
- ...(ngDevMode ? [{ debugName: "contentClass" }] : /* istanbul ignore next */ []));
73
- this.indicatorsContentClass = input('', /* @ts-ignore */
74
- ...(ngDevMode ? [{ debugName: "indicatorsContentClass" }] : /* istanbul ignore next */ []));
75
- this.indicatorsContentStyle = input(null, /* @ts-ignore */
76
- ...(ngDevMode ? [{ debugName: "indicatorsContentStyle" }] : /* istanbul ignore next */ []));
77
- this.indicatorStyleClass = input('', /* @ts-ignore */
78
- ...(ngDevMode ? [{ debugName: "indicatorStyleClass" }] : /* istanbul ignore next */ []));
79
- this.indicatorStyle = input(null, /* @ts-ignore */
80
- ...(ngDevMode ? [{ debugName: "indicatorStyle" }] : /* istanbul ignore next */ []));
81
- this.data = input.required(/* @ts-ignore */
82
- ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
83
- this.circular = input(false, { ...(ngDevMode ? { debugName: "circular" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
84
- this.showIndicators = input(true, { ...(ngDevMode ? { debugName: "showIndicators" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
85
- this.showNavigators = input(true, { ...(ngDevMode ? { debugName: "showNavigators" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
86
- this.suspendAutoPlay = input(true, { ...(ngDevMode ? { debugName: "suspendAutoPlay" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
87
- this.style = input(undefined, /* @ts-ignore */
88
- ...(ngDevMode ? [{ debugName: "style" }] : /* istanbul ignore next */ []));
89
- this.styleClass = input('', /* @ts-ignore */
90
- ...(ngDevMode ? [{ debugName: "styleClass" }] : /* istanbul ignore next */ []));
91
- this.pageEvent = output();
92
- this.itemsContainer = viewChild('itemsContainer', /* @ts-ignore */
93
- ...(ngDevMode ? [{ debugName: "itemsContainer" }] : /* istanbul ignore next */ []));
94
- this.indicatorContent = viewChild('indicatorContent', /* @ts-ignore */
95
- ...(ngDevMode ? [{ debugName: "indicatorContent" }] : /* istanbul ignore next */ []));
96
- this.headerFacet = contentChild(CmatCarouselHeaderComponent, /* @ts-ignore */
97
- ...(ngDevMode ? [{ debugName: "headerFacet" }] : /* istanbul ignore next */ []));
98
- this.footerFacet = contentChild(CmatCarouselFooterComponent, /* @ts-ignore */
99
- ...(ngDevMode ? [{ debugName: "footerFacet" }] : /* istanbul ignore next */ []));
100
- this.templates = contentChildren(CmatCarouselTemplateDirective, /* @ts-ignore */
101
- ...(ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []));
102
- this.id = `cmat-carousel-${NEXT_ID++}`;
103
- this.carouselStyle = signal(null, /* @ts-ignore */
104
- ...(ngDevMode ? [{ debugName: "carouselStyle" }] : /* istanbul ignore next */ []));
105
- this.startPos = signal(null, /* @ts-ignore */
106
- ...(ngDevMode ? [{ debugName: "startPos" }] : /* istanbul ignore next */ []));
107
- this.clonedItemsForStarting = signal([], /* @ts-ignore */
108
- ...(ngDevMode ? [{ debugName: "clonedItemsForStarting" }] : /* istanbul ignore next */ []));
109
- this.clonedItemsForFinishing = signal([], /* @ts-ignore */
110
- ...(ngDevMode ? [{ debugName: "clonedItemsForFinishing" }] : /* istanbul ignore next */ []));
111
- this.isUserInteracted = signal(false, /* @ts-ignore */
112
- ...(ngDevMode ? [{ debugName: "isUserInteracted" }] : /* istanbul ignore next */ []));
113
- this.swipeThreshold = signal(20, /* @ts-ignore */
114
- ...(ngDevMode ? [{ debugName: "swipeThreshold" }] : /* istanbul ignore next */ []));
115
- this.itemTemplate = signal(null, /* @ts-ignore */
116
- ...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
117
- this.headerTemplate = signal(null, /* @ts-ignore */
118
- ...(ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []));
119
- this.footerTemplate = signal(null, /* @ts-ignore */
120
- ...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
121
- this.previousIconTemplate = signal(null, /* @ts-ignore */
122
- ...(ngDevMode ? [{ debugName: "previousIconTemplate" }] : /* istanbul ignore next */ []));
123
- this.nextIconTemplate = signal(null, /* @ts-ignore */
124
- ...(ngDevMode ? [{ debugName: "nextIconTemplate" }] : /* istanbul ignore next */ []));
125
- this.isVertical = computed(() => this.orientation() === 'vertical', /* @ts-ignore */
126
- ...(ngDevMode ? [{ debugName: "isVertical" }] : /* istanbul ignore next */ []));
127
- this.allowAutoplay = computed(() => {
128
- return this.autoplayInterval() > 0 && !this.isUserInteracted();
129
- }, /* @ts-ignore */
130
- ...(ngDevMode ? [{ debugName: "allowAutoplay" }] : /* istanbul ignore next */ []));
131
- this.verticalViewContainerHeight = computed(() => {
132
- if (!this.isVertical()) {
133
- return undefined;
134
- }
135
- const container = this.itemsContainer()?.nativeElement;
136
- if (container) {
137
- const firstItem = container.querySelector('.cmat-carousel-item');
138
- if (firstItem) {
139
- return `${firstItem.offsetHeight * this.numVisible()}px`;
140
- }
141
- }
142
- return this.verticalViewPortHeight();
143
- }, /* @ts-ignore */
144
- ...(ngDevMode ? [{ debugName: "verticalViewContainerHeight" }] : /* istanbul ignore next */ []));
145
- this.totalShiftedItems = computed(() => {
146
- const page = this.page();
147
- const ns = this.numScroll();
148
- const nv = this.numVisible();
149
- let total = page * ns * -1;
150
- if (this.isCircular()) {
151
- total -= nv;
152
- }
153
- if (page === this.totalDots() - 1 && this.remainingItems() > 0) {
154
- total += -1 * this.remainingItems() + ns;
155
- }
156
- return total;
157
- }, /* @ts-ignore */
158
- ...(ngDevMode ? [{ debugName: "totalShiftedItems" }] : /* istanbul ignore next */ []));
159
- this.remainingItems = computed(() => {
160
- const d = this.data() ?? [];
161
- const nv = this.numVisible();
162
- const ns = this.numScroll();
163
- if (!d.length || ns <= 0 || nv >= d.length)
164
- return 0;
165
- const remainder = (d.length - nv) % ns;
166
- return remainder < 0 ? remainder + ns : remainder;
167
- }, /* @ts-ignore */
168
- ...(ngDevMode ? [{ debugName: "remainingItems" }] : /* istanbul ignore next */ []));
169
- this.totalDots = computed(() => {
170
- const nv = this.numVisible();
171
- const ns = this.numScroll();
172
- if (nv > 0 && ns > 0) {
173
- if (!this.data() || this.data().length === 0)
174
- return 0;
175
- return Math.max(1, Math.ceil((this.data().length - nv) / ns) + 1);
176
- }
177
- return 0;
178
- }, /* @ts-ignore */
179
- ...(ngDevMode ? [{ debugName: "totalDots" }] : /* istanbul ignore next */ []));
180
- this.isRemainingItemsAdded = computed(() => {
181
- return this.page() === this.totalDots() - 1 && this.remainingItems() > 0;
182
- }, /* @ts-ignore */
183
- ...(ngDevMode ? [{ debugName: "isRemainingItemsAdded" }] : /* istanbul ignore next */ []));
184
- this.isCircular = computed(() => {
185
- const data = this.data();
186
- return this.circular() && !!data && data.length >= this.numVisible();
187
- }, /* @ts-ignore */
188
- ...(ngDevMode ? [{ debugName: "isCircular" }] : /* istanbul ignore next */ []));
189
- this.isEmpty = computed(() => {
190
- const data = this.data();
191
- return !data || data.length === 0;
192
- }, /* @ts-ignore */
193
- ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
194
- this.getTotalDotsArray = computed(() => {
195
- const dots = this.totalDots();
196
- return dots > 0 ? Array.from({ length: dots }, (_, i) => i) : [];
197
- }, /* @ts-ignore */
198
- ...(ngDevMode ? [{ debugName: "getTotalDotsArray" }] : /* istanbul ignore next */ []));
199
- this.firstIndex = computed(() => this.page() * this.numScroll(), /* @ts-ignore */
200
- ...(ngDevMode ? [{ debugName: "firstIndex" }] : /* istanbul ignore next */ []));
201
- this.lastIndex = computed(() => Math.min(this.page() * this.numScroll() + this.numVisible() - 1, (this.data()?.length ?? 0) - 1), /* @ts-ignore */
202
- ...(ngDevMode ? [{ debugName: "lastIndex" }] : /* istanbul ignore next */ []));
203
- this._document = inject(DOCUMENT);
204
- this.renderer = inject(Renderer2);
205
- this.documentResizeListener = null;
206
- this._initResponsiveEffect();
207
- this._initAutoplayEffect();
208
- this._initCloneItemsEffect();
209
- }
210
- ngAfterContentInit() {
211
- this._calculatePosition();
212
- this._createStyle();
213
- if (this.responsiveOptions()) {
214
- this._bindDocumentListeners();
215
- }
216
- this.templates()?.forEach((item) => {
217
- switch (item.name()) {
218
- case 'item':
219
- this.itemTemplate.set(item.template);
220
- break;
221
- case 'header':
222
- this.headerTemplate.set(item.template);
223
- break;
224
- case 'footer':
225
- this.footerTemplate.set(item.template);
226
- break;
227
- case 'previousicon':
228
- this.previousIconTemplate.set(item.template);
229
- break;
230
- case 'nexticon':
231
- this.nextIconTemplate.set(item.template);
232
- break;
233
- default:
234
- this.itemTemplate.set(item.template);
235
- break;
236
- }
237
- });
238
- }
239
- ngOnDestroy() {
240
- this._unbindDocumentListeners();
241
- this.stopAutoplay();
242
- if (this.carouselStyle()) {
243
- const el = this.carouselStyle();
244
- if (el.parentNode)
245
- el.parentNode.removeChild(el);
246
- this.carouselStyle.set(null);
247
- }
248
- }
249
- navForward(e, index) {
250
- if (this.isCircular() || this.page() < this.totalDots() - 1) {
251
- this._step(-1, index);
252
- }
253
- this._handleInteractionStopAutoplay();
254
- e?.cancelable && e.preventDefault();
255
- }
256
- navBackward(e, index) {
257
- if (this.isCircular() || this.page() !== 0) {
258
- this._step(1, index);
259
- }
260
- this._handleInteractionStopAutoplay();
261
- e?.cancelable && e.preventDefault();
262
- }
263
- onDotClick(e, index) {
264
- this._handleInteractionStopAutoplay();
265
- const currentPage = this.page();
266
- if (index > currentPage) {
267
- this.navForward(e, index);
268
- }
269
- else if (index < currentPage) {
270
- this.navBackward(e, index);
271
- }
272
- }
273
- onTouchStart(e) {
274
- const touchobj = e.changedTouches[0];
275
- this.startPos.set({ x: touchobj.pageX, y: touchobj.pageY });
276
- }
277
- onTouchMove(e) {
278
- e.cancelable && e.preventDefault();
279
- }
280
- onTouchEnd(e) {
281
- const touchobj = e.changedTouches[0];
282
- const start = this.startPos();
283
- if (!start)
284
- return;
285
- const diff = this.isVertical()
286
- ? touchobj.pageY - start.y
287
- : touchobj.pageX - start.x;
288
- this._changePageOnTouch(e, diff);
289
- }
290
- arrowCursorClick(cursorSide) {
291
- switch (cursorSide) {
292
- case 'left':
293
- case 'up':
294
- this.navBackward(null);
295
- break;
296
- case 'right':
297
- case 'down':
298
- this.navForward(null);
299
- break;
300
- }
301
- }
302
- onTransitionEnd() {
303
- if (this.itemsContainer()) {
304
- this.itemsContainer().nativeElement.style.transition = '';
305
- if ((this.page() === 0 || this.page() === this.totalDots() - 1) && this.isCircular()) {
306
- this._applyTransform(this.totalShiftedItems());
307
- }
308
- }
309
- }
310
- stopAutoplay() {
311
- this.isUserInteracted.set(true);
312
- }
313
- startAutoplay() {
314
- this.isUserInteracted.set(false);
315
- }
316
- isFirstItemActive(index) {
317
- return index === this.firstIndex();
318
- }
319
- isLastItemActive(index) {
320
- return index === this.lastIndex();
321
- }
322
- isMiddleItemActive(index) {
323
- const first = this.firstIndex();
324
- const last = this.lastIndex();
325
- return index > first && index < last;
326
- }
327
- onIndicatorKeydown(event) {
328
- switch (event.code) {
329
- case 'ArrowRight':
330
- this._onRightKey();
331
- break;
332
- case 'ArrowLeft':
333
- this._onLeftKey();
334
- break;
335
- case 'Home':
336
- this._onHomeKey();
337
- break;
338
- case 'End':
339
- this._onEndKey();
340
- break;
341
- case 'Tab':
342
- this._onTabKey();
343
- break;
344
- }
345
- }
346
- _handleInteractionStopAutoplay() {
347
- if (this.autoplayInterval() && this.suspendAutoPlay()) {
348
- this.stopAutoplay();
349
- }
350
- }
351
- _changePageOnTouch(e, diff) {
352
- if (Math.abs(diff) > this.swipeThreshold()) {
353
- if (diff < 0) {
354
- this.navForward(e);
355
- }
356
- else {
357
- this.navBackward(e);
358
- }
359
- }
360
- }
361
- _step(dir, page) {
362
- let totalShiftedItems = this.totalShiftedItems();
363
- const isCircular = this.isCircular();
364
- let nextPage;
365
- if (page != null) {
366
- totalShiftedItems = this.numScroll() * page * -1;
367
- if (isCircular) {
368
- totalShiftedItems -= this.numVisible();
369
- }
370
- nextPage = page;
371
- }
372
- else {
373
- totalShiftedItems += this.numScroll() * dir;
374
- if (this.isRemainingItemsAdded()) {
375
- totalShiftedItems += this.remainingItems() - this.numScroll() * dir;
376
- }
377
- const originalShiftedItems = isCircular ? totalShiftedItems + this.numVisible() : totalShiftedItems;
378
- nextPage = Math.abs(Math.floor(originalShiftedItems / this.numScroll()));
379
- }
380
- if (isCircular && this.page() === this.totalDots() - 1 && dir === -1) {
381
- const data = this.data();
382
- if (data) {
383
- totalShiftedItems = -1 * (data.length + this.numVisible());
384
- }
385
- nextPage = 0;
386
- }
387
- else if (isCircular && this.page() === 0 && dir === 1) {
388
- totalShiftedItems = 0;
389
- nextPage = this.totalDots() - 1;
390
- }
391
- else if (nextPage === this.totalDots() - 1 && this.remainingItems() > 0) {
392
- totalShiftedItems += this.remainingItems() * -1 - this.numScroll() * dir;
393
- }
394
- this._applyTransform(totalShiftedItems, true);
395
- this.page.set(nextPage);
396
- this.pageEvent.emit({ page: this.page() });
397
- this._updateCarouselItemsAccessibility();
398
- }
399
- _applyTransform(shiftedItems, withTransition = false) {
400
- if (!this.itemsContainer())
401
- return;
402
- const nv = this.numVisible();
403
- if (nv === 0)
404
- return;
405
- const transform = this.isVertical()
406
- ? `translate3d(0, ${shiftedItems * (100 / nv)}%, 0)`
407
- : `translate3d(${shiftedItems * (100 / nv)}%, 0, 0)`;
408
- const el = this.itemsContainer()?.nativeElement;
409
- if (el) {
410
- el.style.transform = transform;
411
- el.style.transition = withTransition ? 'transform 500ms ease 0s' : '';
412
- }
413
- }
414
- _initResponsiveEffect() {
415
- effect(() => {
416
- this._createStyle();
417
- this._calculatePosition();
418
- if (this.responsiveOptions()) {
419
- this._bindDocumentListeners();
156
+ var CmatCarouselComponent = class CmatCarouselComponent {
157
+ constructor() {
158
+ this.el = inject(ElementRef);
159
+ this.page = model(0, ...ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []);
160
+ this.numVisible = model(1, ...ngDevMode ? [{ debugName: "numVisible" }] : /* istanbul ignore next */ []);
161
+ this.numScroll = model(1, ...ngDevMode ? [{ debugName: "numScroll" }] : /* istanbul ignore next */ []);
162
+ this.autoplayInterval = input(0, {
163
+ ...ngDevMode ? { debugName: "autoplayInterval" } : /* istanbul ignore next */ {},
164
+ transform: numberAttribute
165
+ });
166
+ this.responsiveOptions = input(...ngDevMode ? [void 0, { debugName: "responsiveOptions" }] : /* istanbul ignore next */ []);
167
+ this.orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
168
+ this.navigatorsType = input("normal", ...ngDevMode ? [{ debugName: "navigatorsType" }] : /* istanbul ignore next */ []);
169
+ this.verticalViewPortHeight = input("300px", ...ngDevMode ? [{ debugName: "verticalViewPortHeight" }] : /* istanbul ignore next */ []);
170
+ this.arrowSelector = input(".carousel-arrow-cursor", ...ngDevMode ? [{ debugName: "arrowSelector" }] : /* istanbul ignore next */ []);
171
+ this.contentClass = input("", ...ngDevMode ? [{ debugName: "contentClass" }] : /* istanbul ignore next */ []);
172
+ this.indicatorsContentClass = input("", ...ngDevMode ? [{ debugName: "indicatorsContentClass" }] : /* istanbul ignore next */ []);
173
+ this.indicatorsContentStyle = input(null, ...ngDevMode ? [{ debugName: "indicatorsContentStyle" }] : /* istanbul ignore next */ []);
174
+ this.indicatorStyleClass = input("", ...ngDevMode ? [{ debugName: "indicatorStyleClass" }] : /* istanbul ignore next */ []);
175
+ this.indicatorStyle = input(null, ...ngDevMode ? [{ debugName: "indicatorStyle" }] : /* istanbul ignore next */ []);
176
+ this.data = input.required(...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
177
+ this.circular = input(false, {
178
+ ...ngDevMode ? { debugName: "circular" } : /* istanbul ignore next */ {},
179
+ transform: booleanAttribute
180
+ });
181
+ this.showIndicators = input(true, {
182
+ ...ngDevMode ? { debugName: "showIndicators" } : /* istanbul ignore next */ {},
183
+ transform: booleanAttribute
184
+ });
185
+ this.showNavigators = input(true, {
186
+ ...ngDevMode ? { debugName: "showNavigators" } : /* istanbul ignore next */ {},
187
+ transform: booleanAttribute
188
+ });
189
+ this.suspendAutoPlay = input(true, {
190
+ ...ngDevMode ? { debugName: "suspendAutoPlay" } : /* istanbul ignore next */ {},
191
+ transform: booleanAttribute
192
+ });
193
+ this.style = input(void 0, ...ngDevMode ? [{ debugName: "style" }] : /* istanbul ignore next */ []);
194
+ this.styleClass = input("", ...ngDevMode ? [{ debugName: "styleClass" }] : /* istanbul ignore next */ []);
195
+ this.pageEvent = output();
196
+ this.itemsContainer = viewChild("itemsContainer", ...ngDevMode ? [{ debugName: "itemsContainer" }] : /* istanbul ignore next */ []);
197
+ this.indicatorContent = viewChild("indicatorContent", ...ngDevMode ? [{ debugName: "indicatorContent" }] : /* istanbul ignore next */ []);
198
+ this.headerFacet = contentChild(CmatCarouselHeaderComponent, ...ngDevMode ? [{ debugName: "headerFacet" }] : /* istanbul ignore next */ []);
199
+ this.footerFacet = contentChild(CmatCarouselFooterComponent, ...ngDevMode ? [{ debugName: "footerFacet" }] : /* istanbul ignore next */ []);
200
+ this.templates = contentChildren(CmatCarouselTemplateDirective, ...ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []);
201
+ this.id = `cmat-carousel-${NEXT_ID++}`;
202
+ this.carouselStyle = signal(null, ...ngDevMode ? [{ debugName: "carouselStyle" }] : /* istanbul ignore next */ []);
203
+ this.startPos = signal(null, ...ngDevMode ? [{ debugName: "startPos" }] : /* istanbul ignore next */ []);
204
+ this.clonedItemsForStarting = signal([], ...ngDevMode ? [{ debugName: "clonedItemsForStarting" }] : /* istanbul ignore next */ []);
205
+ this.clonedItemsForFinishing = signal([], ...ngDevMode ? [{ debugName: "clonedItemsForFinishing" }] : /* istanbul ignore next */ []);
206
+ this.isUserInteracted = signal(false, ...ngDevMode ? [{ debugName: "isUserInteracted" }] : /* istanbul ignore next */ []);
207
+ this.swipeThreshold = signal(20, ...ngDevMode ? [{ debugName: "swipeThreshold" }] : /* istanbul ignore next */ []);
208
+ this.itemTemplate = signal(null, ...ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []);
209
+ this.headerTemplate = signal(null, ...ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []);
210
+ this.footerTemplate = signal(null, ...ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []);
211
+ this.previousIconTemplate = signal(null, ...ngDevMode ? [{ debugName: "previousIconTemplate" }] : /* istanbul ignore next */ []);
212
+ this.nextIconTemplate = signal(null, ...ngDevMode ? [{ debugName: "nextIconTemplate" }] : /* istanbul ignore next */ []);
213
+ this.isVertical = computed(() => this.orientation() === "vertical", ...ngDevMode ? [{ debugName: "isVertical" }] : /* istanbul ignore next */ []);
214
+ this.allowAutoplay = computed(() => {
215
+ return this.autoplayInterval() > 0 && !this.isUserInteracted();
216
+ }, ...ngDevMode ? [{ debugName: "allowAutoplay" }] : /* istanbul ignore next */ []);
217
+ this.verticalViewContainerHeight = computed(() => {
218
+ if (!this.isVertical()) return;
219
+ const container = this.itemsContainer()?.nativeElement;
220
+ if (container) {
221
+ const firstItem = container.querySelector(".cmat-carousel-item");
222
+ if (firstItem) return `${firstItem.offsetHeight * this.numVisible()}px`;
223
+ }
224
+ return this.verticalViewPortHeight();
225
+ }, ...ngDevMode ? [{ debugName: "verticalViewContainerHeight" }] : /* istanbul ignore next */ []);
226
+ this.totalShiftedItems = computed(() => {
227
+ const page = this.page();
228
+ const ns = this.numScroll();
229
+ const nv = this.numVisible();
230
+ let total = page * ns * -1;
231
+ if (this.isCircular()) total -= nv;
232
+ if (page === this.totalDots() - 1 && this.remainingItems() > 0) total += -1 * this.remainingItems() + ns;
233
+ return total;
234
+ }, ...ngDevMode ? [{ debugName: "totalShiftedItems" }] : /* istanbul ignore next */ []);
235
+ this.remainingItems = computed(() => {
236
+ const d = this.data() ?? [];
237
+ const nv = this.numVisible();
238
+ const ns = this.numScroll();
239
+ if (!d.length || ns <= 0 || nv >= d.length) return 0;
240
+ const remainder = (d.length - nv) % ns;
241
+ return remainder < 0 ? remainder + ns : remainder;
242
+ }, ...ngDevMode ? [{ debugName: "remainingItems" }] : /* istanbul ignore next */ []);
243
+ this.totalDots = computed(() => {
244
+ const nv = this.numVisible();
245
+ const ns = this.numScroll();
246
+ if (nv > 0 && ns > 0) {
247
+ if (!this.data() || this.data().length === 0) return 0;
248
+ return Math.max(1, Math.ceil((this.data().length - nv) / ns) + 1);
249
+ }
250
+ return 0;
251
+ }, ...ngDevMode ? [{ debugName: "totalDots" }] : /* istanbul ignore next */ []);
252
+ this.isRemainingItemsAdded = computed(() => {
253
+ return this.page() === this.totalDots() - 1 && this.remainingItems() > 0;
254
+ }, ...ngDevMode ? [{ debugName: "isRemainingItemsAdded" }] : /* istanbul ignore next */ []);
255
+ this.isCircular = computed(() => {
256
+ const data = this.data();
257
+ return this.circular() && !!data && data.length >= this.numVisible();
258
+ }, ...ngDevMode ? [{ debugName: "isCircular" }] : /* istanbul ignore next */ []);
259
+ this.isEmpty = computed(() => {
260
+ const data = this.data();
261
+ return !data || data.length === 0;
262
+ }, ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
263
+ this.getTotalDotsArray = computed(() => {
264
+ const dots = this.totalDots();
265
+ return dots > 0 ? Array.from({ length: dots }, (_, i) => i) : [];
266
+ }, ...ngDevMode ? [{ debugName: "getTotalDotsArray" }] : /* istanbul ignore next */ []);
267
+ this.firstIndex = computed(() => this.page() * this.numScroll(), ...ngDevMode ? [{ debugName: "firstIndex" }] : /* istanbul ignore next */ []);
268
+ this.lastIndex = computed(() => Math.min(this.page() * this.numScroll() + this.numVisible() - 1, (this.data()?.length ?? 0) - 1), ...ngDevMode ? [{ debugName: "lastIndex" }] : /* istanbul ignore next */ []);
269
+ this._document = inject(DOCUMENT);
270
+ this.renderer = inject(Renderer2);
271
+ this.documentResizeListener = null;
272
+ this._initResponsiveEffect();
273
+ this._initAutoplayEffect();
274
+ this._initCloneItemsEffect();
275
+ }
276
+ ngAfterContentInit() {
277
+ this._calculatePosition();
278
+ this._createStyle();
279
+ if (this.responsiveOptions()) this._bindDocumentListeners();
280
+ this.templates()?.forEach((item) => {
281
+ switch (item.name()) {
282
+ case "item":
283
+ this.itemTemplate.set(item.template);
284
+ break;
285
+ case "header":
286
+ this.headerTemplate.set(item.template);
287
+ break;
288
+ case "footer":
289
+ this.footerTemplate.set(item.template);
290
+ break;
291
+ case "previousicon":
292
+ this.previousIconTemplate.set(item.template);
293
+ break;
294
+ case "nexticon":
295
+ this.nextIconTemplate.set(item.template);
296
+ break;
297
+ default: this.itemTemplate.set(item.template);
298
+ }
299
+ });
300
+ }
301
+ ngOnDestroy() {
302
+ this._unbindDocumentListeners();
303
+ this.stopAutoplay();
304
+ if (this.carouselStyle()) {
305
+ const el = this.carouselStyle();
306
+ if (el.parentNode) el.parentNode.removeChild(el);
307
+ this.carouselStyle.set(null);
308
+ }
309
+ }
310
+ navForward(e, index) {
311
+ if (this.isCircular() || this.page() < this.totalDots() - 1) this._step(-1, index);
312
+ this._handleInteractionStopAutoplay();
313
+ e?.cancelable && e.preventDefault();
314
+ }
315
+ navBackward(e, index) {
316
+ if (this.isCircular() || this.page() !== 0) this._step(1, index);
317
+ this._handleInteractionStopAutoplay();
318
+ e?.cancelable && e.preventDefault();
319
+ }
320
+ onDotClick(e, index) {
321
+ this._handleInteractionStopAutoplay();
322
+ const currentPage = this.page();
323
+ if (index > currentPage) this.navForward(e, index);
324
+ else if (index < currentPage) this.navBackward(e, index);
325
+ }
326
+ onTouchStart(e) {
327
+ const touchobj = e.changedTouches[0];
328
+ this.startPos.set({
329
+ x: touchobj.pageX,
330
+ y: touchobj.pageY
331
+ });
332
+ }
333
+ onTouchMove(e) {
334
+ e.cancelable && e.preventDefault();
335
+ }
336
+ onTouchEnd(e) {
337
+ const touchobj = e.changedTouches[0];
338
+ const start = this.startPos();
339
+ if (!start) return;
340
+ const diff = this.isVertical() ? touchobj.pageY - start.y : touchobj.pageX - start.x;
341
+ this._changePageOnTouch(e, diff);
342
+ }
343
+ arrowCursorClick(cursorSide) {
344
+ switch (cursorSide) {
345
+ case "left":
346
+ case "up":
347
+ this.navBackward(null);
348
+ break;
349
+ case "right":
350
+ case "down": this.navForward(null);
351
+ }
352
+ }
353
+ onTransitionEnd() {
354
+ if (this.itemsContainer()) {
355
+ this.itemsContainer().nativeElement.style.transition = "";
356
+ if ((this.page() === 0 || this.page() === this.totalDots() - 1) && this.isCircular()) this._applyTransform(this.totalShiftedItems());
357
+ }
358
+ }
359
+ stopAutoplay() {
360
+ this.isUserInteracted.set(true);
361
+ }
362
+ startAutoplay() {
363
+ this.isUserInteracted.set(false);
364
+ }
365
+ isFirstItemActive(index) {
366
+ return index === this.firstIndex();
367
+ }
368
+ isLastItemActive(index) {
369
+ return index === this.lastIndex();
370
+ }
371
+ isMiddleItemActive(index) {
372
+ const first = this.firstIndex();
373
+ const last = this.lastIndex();
374
+ return index > first && index < last;
375
+ }
376
+ onIndicatorKeydown(event) {
377
+ switch (event.code) {
378
+ case "ArrowRight":
379
+ this._onRightKey();
380
+ break;
381
+ case "ArrowLeft":
382
+ this._onLeftKey();
383
+ break;
384
+ case "Home":
385
+ this._onHomeKey();
386
+ break;
387
+ case "End":
388
+ this._onEndKey();
389
+ break;
390
+ case "Tab": this._onTabKey();
391
+ }
392
+ }
393
+ _handleInteractionStopAutoplay() {
394
+ if (this.autoplayInterval() && this.suspendAutoPlay()) this.stopAutoplay();
395
+ }
396
+ _changePageOnTouch(e, diff) {
397
+ if (Math.abs(diff) > this.swipeThreshold()) {
398
+ if (diff < 0) this.navForward(e);
399
+ else this.navBackward(e);
400
+ }
401
+ }
402
+ _step(dir, page) {
403
+ let totalShiftedItems = this.totalShiftedItems();
404
+ const isCircular = this.isCircular();
405
+ let nextPage;
406
+ if (page != null) {
407
+ totalShiftedItems = this.numScroll() * page * -1;
408
+ if (isCircular) totalShiftedItems -= this.numVisible();
409
+ nextPage = page;
410
+ } else {
411
+ totalShiftedItems += this.numScroll() * dir;
412
+ if (this.isRemainingItemsAdded()) totalShiftedItems += this.remainingItems() - this.numScroll() * dir;
413
+ const originalShiftedItems = isCircular ? totalShiftedItems + this.numVisible() : totalShiftedItems;
414
+ nextPage = Math.abs(Math.floor(originalShiftedItems / this.numScroll()));
415
+ }
416
+ if (isCircular && this.page() === this.totalDots() - 1 && dir === -1) {
417
+ const data = this.data();
418
+ if (data) totalShiftedItems = -1 * (data.length + this.numVisible());
419
+ nextPage = 0;
420
+ } else if (isCircular && this.page() === 0 && dir === 1) {
421
+ totalShiftedItems = 0;
422
+ nextPage = this.totalDots() - 1;
423
+ } else if (nextPage === this.totalDots() - 1 && this.remainingItems() > 0) totalShiftedItems += this.remainingItems() * -1 - this.numScroll() * dir;
424
+ this._applyTransform(totalShiftedItems, true);
425
+ this.page.set(nextPage);
426
+ this.pageEvent.emit({ page: this.page() });
427
+ this._updateCarouselItemsAccessibility();
428
+ }
429
+ _applyTransform(shiftedItems, withTransition = false) {
430
+ if (!this.itemsContainer()) return;
431
+ const nv = this.numVisible();
432
+ if (nv === 0) return;
433
+ const transform = this.isVertical() ? `translate3d(0, ${shiftedItems * (100 / nv)}%, 0)` : `translate3d(${shiftedItems * (100 / nv)}%, 0, 0)`;
434
+ const el = this.itemsContainer()?.nativeElement;
435
+ if (el) {
436
+ el.style.transform = transform;
437
+ el.style.transition = withTransition ? "transform 500ms ease 0s" : "";
438
+ }
439
+ }
440
+ _initResponsiveEffect() {
441
+ effect(() => {
442
+ this._createStyle();
443
+ this._calculatePosition();
444
+ if (this.responsiveOptions()) this._bindDocumentListeners();
445
+ else this._unbindDocumentListeners();
446
+ });
447
+ }
448
+ _initCloneItemsEffect() {
449
+ effect(() => {
450
+ this._setCloneItems();
451
+ });
452
+ }
453
+ _initAutoplayEffect() {
454
+ effect((onCleanup) => {
455
+ const interval = this.autoplayInterval();
456
+ const isAllowed = this.allowAutoplay();
457
+ let intervalId = null;
458
+ if (interval > 0 && isAllowed) intervalId = window.setInterval(() => {
459
+ untracked(() => {
460
+ const currentPage = this.page();
461
+ const dots = this.totalDots();
462
+ if (dots > 0) {
463
+ if (currentPage === dots - 1) this._step(-1, 0);
464
+ else this._step(-1, currentPage + 1);
465
+ }
466
+ });
467
+ }, interval);
468
+ onCleanup(() => {
469
+ if (intervalId) clearInterval(intervalId);
470
+ });
471
+ });
472
+ }
473
+ _bindDocumentListeners() {
474
+ if (this.documentResizeListener) return;
475
+ this.documentResizeListener = this.renderer.listen("window", "resize", () => {
476
+ this._calculatePosition();
477
+ });
478
+ }
479
+ _unbindDocumentListeners() {
480
+ if (this.documentResizeListener) {
481
+ this.documentResizeListener();
482
+ this.documentResizeListener = null;
483
+ }
484
+ }
485
+ _createStyle() {
486
+ if (!this.carouselStyle()) {
487
+ const styleEl = this.renderer.createElement("style");
488
+ this.carouselStyle.set(styleEl);
489
+ this.renderer.appendChild(this._document.head, styleEl);
490
+ }
491
+ let innerHTML = `
492
+ #${this.id} .cmat-carousel-item {
493
+ flex: 1 0 ${100 / this.numVisible()}%
420
494
  }
421
- else {
422
- this._unbindDocumentListeners();
423
- }
424
- });
425
- }
426
- _initCloneItemsEffect() {
427
- effect(() => {
428
- this._setCloneItems();
429
- });
430
- }
431
- _initAutoplayEffect() {
432
- effect((onCleanup) => {
433
- const interval = this.autoplayInterval();
434
- const isAllowed = this.allowAutoplay();
435
- let intervalId = null;
436
- if (interval > 0 && isAllowed) {
437
- intervalId = window.setInterval(() => {
438
- untracked(() => {
439
- const currentPage = this.page();
440
- const dots = this.totalDots();
441
- if (dots > 0) {
442
- if (currentPage === dots - 1) {
443
- this._step(-1, 0);
444
- }
445
- else {
446
- this._step(-1, currentPage + 1);
447
- }
448
- }
449
- });
450
- }, interval);
451
- }
452
- onCleanup(() => {
453
- if (intervalId) {
454
- clearInterval(intervalId);
455
- }
456
- });
457
- });
458
- }
459
- _bindDocumentListeners() {
460
- if (this.documentResizeListener)
461
- return;
462
- this.documentResizeListener = this.renderer.listen('window', 'resize', () => {
463
- this._calculatePosition();
464
- });
465
- }
466
- _unbindDocumentListeners() {
467
- if (this.documentResizeListener) {
468
- this.documentResizeListener();
469
- this.documentResizeListener = null;
470
- }
471
- }
472
- _createStyle() {
473
- if (!this.carouselStyle()) {
474
- const styleEl = this.renderer.createElement('style');
475
- this.carouselStyle.set(styleEl);
476
- this.renderer.appendChild(this._document.head, styleEl);
477
- }
478
- let innerHTML = `
479
- #${this.id} .cmat-carousel-item {
480
- flex: 1 0 ${100 / this.numVisible()}%
481
- }
482
495
  `;
483
- if (this.responsiveOptions()) {
484
- const sortedOptions = [...this.responsiveOptions()].sort((a, b) => {
485
- const bpA = a.breakpoint === null ? Infinity : parseInt(a.breakpoint, 10);
486
- const bpB = b.breakpoint === null ? Infinity : parseInt(b.breakpoint, 10);
487
- return bpB - bpA; // Descending
488
- });
489
- for (const res of sortedOptions) {
490
- innerHTML += `
491
- @media screen and (max-width: ${res.breakpoint}) {
492
- #${this.id} .cmat-carousel-item {
493
- flex: 1 0 ${100 / res.numVisible}%
494
- }
495
- }
496
+ if (this.responsiveOptions()) {
497
+ const sortedOptions = [...this.responsiveOptions()].sort((a, b) => {
498
+ const bpA = a.breakpoint === null ? Infinity : parseInt(a.breakpoint, 10);
499
+ return (b.breakpoint === null ? Infinity : parseInt(b.breakpoint, 10)) - bpA;
500
+ });
501
+ for (const res of sortedOptions) innerHTML += `
502
+ @media screen and (max-width: ${res.breakpoint}) {
503
+ #${this.id} .cmat-carousel-item {
504
+ flex: 1 0 ${100 / res.numVisible}%
505
+ }
506
+ }
496
507
  `;
497
- }
498
- }
499
- if (this.carouselStyle()) {
500
- this.renderer.setProperty(this.carouselStyle(), 'textContent', innerHTML);
501
- }
502
- }
503
- _calculatePosition() {
504
- if (!this.responsiveOptions() || this.responsiveOptions().length === 0) {
505
- return;
506
- }
507
- const windowWidth = this._document.defaultView?.innerWidth ?? 0;
508
- let matchedResponsiveData = null;
509
- const sortedOptions = [...this.responsiveOptions()].sort((a, b) => {
510
- const bpA = a.breakpoint === null || a.breakpoint === undefined ? Infinity : parseInt(a.breakpoint, 10);
511
- const bpB = b.breakpoint === null || b.breakpoint === undefined ? Infinity : parseInt(b.breakpoint, 10);
512
- return bpB - bpA;
513
- });
514
- for (const res of sortedOptions) {
515
- const bp = parseInt(res.breakpoint, 10);
516
- if (!isNaN(bp) && bp >= windowWidth) {
517
- matchedResponsiveData = res;
518
- break;
519
- }
520
- }
521
- if (matchedResponsiveData) {
522
- if (this.numScroll() !== matchedResponsiveData.numScroll) {
523
- const oldNumScroll = this.numScroll();
524
- const newNumScroll = matchedResponsiveData.numScroll;
525
- let page = this.page();
526
- if (oldNumScroll > 0) {
527
- page = Math.floor((page * oldNumScroll) / newNumScroll);
528
- }
529
- this.numScroll.set(newNumScroll);
530
- this.page.set(page);
531
- this.pageEvent.emit({ page: this.page() });
532
- }
533
- if (this.numVisible() !== matchedResponsiveData.numVisible) {
534
- this.numVisible.set(matchedResponsiveData.numVisible);
535
- this._setCloneItems();
536
- }
537
- }
538
- if (matchedResponsiveData) {
539
- this._createStyle();
540
- }
541
- }
542
- _updateCarouselItemsAccessibility() {
543
- const slides = this.el.nativeElement.querySelectorAll('.cmat-carousel-item');
544
- const currentPage = this.page();
545
- const nv = this.numVisible();
546
- const ns = this.numScroll();
547
- const isCircular = this.isCircular();
548
- if (isCircular) {
549
- slides.forEach((slide) => {
550
- slide.removeAttribute('aria-hidden');
551
- const focusableElements = slide.querySelectorAll('a, button, input, select, textarea, [tabindex]');
552
- focusableElements.forEach((el) => {
553
- el.removeAttribute('tabindex');
554
- });
555
- });
556
- return;
557
- }
558
- const startIdx = currentPage * ns;
559
- const endIdx = startIdx + nv;
560
- slides.forEach((slide, domIndex) => {
561
- const isActive = domIndex >= startIdx && domIndex < endIdx;
562
- slide.setAttribute('aria-hidden', !isActive ? 'true' : 'false');
563
- const focusableElements = slide.querySelectorAll('a, button, input, select, textarea, [tabindex]');
564
- focusableElements.forEach((el) => {
565
- el.tabIndex = isActive ? 0 : -1;
566
- });
567
- });
568
- }
569
- _setCloneItems() {
570
- this.clonedItemsForStarting.set([]);
571
- this.clonedItemsForFinishing.set([]);
572
- if (this.isCircular()) {
573
- const data = this.data() ?? [];
574
- const nv = this.numVisible();
575
- if (data.length >= nv) {
576
- this.clonedItemsForStarting.set([...data.slice(-1 * nv)]);
577
- this.clonedItemsForFinishing.set([...data.slice(0, nv)]);
578
- }
579
- }
580
- }
581
- _findFocusedIndicatorIndex() {
582
- const indicators = Array.from(this.indicatorContent()?.nativeElement?.querySelectorAll('[data-pc-section="indicator"]') ?? []);
583
- const activeIndicator = this.indicatorContent()?.nativeElement?.querySelector('[data-pc-section="indicator"] > button[tabindex="0"]');
584
- return indicators.findIndex(ind => ind === activeIndicator?.parentElement);
585
- }
586
- _changedFocusedIndicator(prevInd, nextInd) {
587
- const indicators = Array.from(this.indicatorContent()?.nativeElement?.querySelectorAll('[data-pc-section="indicator"]') ?? []);
588
- if (indicators[prevInd]?.children[0])
589
- indicators[prevInd].children[0].tabIndex = -1;
590
- if (indicators[nextInd]?.children[0]) {
591
- indicators[nextInd].children[0].tabIndex = 0;
592
- indicators[nextInd].children[0].focus();
593
- }
594
- }
595
- _onRightKey() {
596
- const indicators = Array.from(this.indicatorContent()?.nativeElement?.querySelectorAll('[data-pc-section="indicator"]') ?? []);
597
- const activeIndex = this._findFocusedIndicatorIndex();
598
- this._changedFocusedIndicator(activeIndex, activeIndex + 1 === indicators.length ? indicators.length - 1 : activeIndex + 1);
599
- }
600
- _onLeftKey() {
601
- const activeIndex = this._findFocusedIndicatorIndex();
602
- this._changedFocusedIndicator(activeIndex, activeIndex - 1 <= 0 ? 0 : activeIndex - 1);
603
- }
604
- _onHomeKey() {
605
- this._changedFocusedIndicator(this._findFocusedIndicatorIndex(), 0);
606
- }
607
- _onEndKey() {
608
- const indicators = Array.from(this.indicatorContent()?.nativeElement?.querySelectorAll('[data-pc-section="indicator"]') ?? []);
609
- this._changedFocusedIndicator(this._findFocusedIndicatorIndex(), indicators.length - 1);
610
- }
611
- _onTabKey() {
612
- const indicators = Array.from(this.indicatorContent()?.nativeElement?.querySelectorAll('[data-pc-section="indicator"]') ?? []);
613
- const highlightedIndex = indicators.findIndex(ind => ind.getAttribute('cmat-carousel-highlight') !== undefined);
614
- const activeIndicator = this.indicatorContent()?.nativeElement?.querySelector('[data-pc-section="indicator"] > button[tabindex="0"]');
615
- const activeIndex = indicators.findIndex(ind => ind === activeIndicator?.parentElement);
616
- if (indicators[activeIndex]?.children[0])
617
- indicators[activeIndex].children[0].tabIndex = -1;
618
- if (indicators[highlightedIndex]?.children[0])
619
- indicators[highlightedIndex].children[0].tabIndex = 0;
620
- }
621
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatCarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
622
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatCarouselComponent, isStandalone: true, selector: "cmat-carousel", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, numVisible: { classPropertyName: "numVisible", publicName: "numVisible", isSignal: true, isRequired: false, transformFunction: null }, numScroll: { classPropertyName: "numScroll", publicName: "numScroll", isSignal: true, isRequired: false, transformFunction: null }, autoplayInterval: { classPropertyName: "autoplayInterval", publicName: "autoplayInterval", isSignal: true, isRequired: false, transformFunction: null }, responsiveOptions: { classPropertyName: "responsiveOptions", publicName: "responsiveOptions", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, navigatorsType: { classPropertyName: "navigatorsType", publicName: "navigatorsType", isSignal: true, isRequired: false, transformFunction: null }, verticalViewPortHeight: { classPropertyName: "verticalViewPortHeight", publicName: "verticalViewPortHeight", isSignal: true, isRequired: false, transformFunction: null }, arrowSelector: { classPropertyName: "arrowSelector", publicName: "arrowSelector", isSignal: true, isRequired: false, transformFunction: null }, contentClass: { classPropertyName: "contentClass", publicName: "contentClass", isSignal: true, isRequired: false, transformFunction: null }, indicatorsContentClass: { classPropertyName: "indicatorsContentClass", publicName: "indicatorsContentClass", isSignal: true, isRequired: false, transformFunction: null }, indicatorsContentStyle: { classPropertyName: "indicatorsContentStyle", publicName: "indicatorsContentStyle", isSignal: true, isRequired: false, transformFunction: null }, indicatorStyleClass: { classPropertyName: "indicatorStyleClass", publicName: "indicatorStyleClass", isSignal: true, isRequired: false, transformFunction: null }, indicatorStyle: { classPropertyName: "indicatorStyle", publicName: "indicatorStyle", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, circular: { classPropertyName: "circular", publicName: "circular", isSignal: true, isRequired: false, transformFunction: null }, showIndicators: { classPropertyName: "showIndicators", publicName: "showIndicators", isSignal: true, isRequired: false, transformFunction: null }, showNavigators: { classPropertyName: "showNavigators", publicName: "showNavigators", isSignal: true, isRequired: false, transformFunction: null }, suspendAutoPlay: { classPropertyName: "suspendAutoPlay", publicName: "suspendAutoPlay", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { page: "pageChange", numVisible: "numVisibleChange", numScroll: "numScrollChange", pageEvent: "pageEvent" }, queries: [{ propertyName: "headerFacet", first: true, predicate: CmatCarouselHeaderComponent, descendants: true, isSignal: true }, { propertyName: "footerFacet", first: true, predicate: CmatCarouselFooterComponent, descendants: true, isSignal: true }, { propertyName: "templates", predicate: CmatCarouselTemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "itemsContainer", first: true, predicate: ["itemsContainer"], descendants: true, isSignal: true }, { propertyName: "indicatorContent", first: true, predicate: ["indicatorContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<div role=\"region\" [attr.id]=\"id\"\r\n [ngClass]=\"{ 'cmat-carousel': true, 'cmat-carousel-vertical': isVertical(), 'cmat-carousel-horizontal': !isVertical() }\"\r\n [ngStyle]=\"style()\" [class]=\"styleClass()\">\r\n\r\n @if(headerFacet() || headerTemplate()){\r\n <div class=\"cmat-carousel-header\">\r\n <ng-content select=\"cmat-carousel-header\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\r\n </div>\r\n }\r\n\r\n <div [class]=\"contentClass()\" [ngClass]=\"'items-center cmat-carousel-content'\">\r\n <div class=\"cmat-carousel-container\" cmatArrowCursor [orientation]=\"orientation()\" [selector]=\"arrowSelector()\"\r\n [enabled]=\"navigatorsType()==='arrow'\" [attr.aria-live]=\"allowAutoplay() ? 'polite' : 'off'\"\r\n (clickEvent)=\"arrowCursorClick($event)\">\r\n @if(showNavigators()&&navigatorsType()==='normal'){\r\n <button type=\"button\" matIconButton [ngClass]=\"{ 'cmat-carousel-prev': true }\"\r\n [disabled]=\"!isCircular() && page() === 0\" (click)=\"navBackward($event)\">\r\n @if(!previousIconTemplate()){\r\n @if(!isVertical()){\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-left'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-up'\"></mat-icon>\r\n }\r\n }\r\n @else {\r\n <span class=\"cmat-carousel-prev-icon\">\r\n <ng-template *ngTemplateOutlet=\"previousIconTemplate()\"></ng-template>\r\n </span>\r\n }\r\n </button>\r\n }\r\n\r\n <div class=\"cmat-carousel-items-content\" (touchend)=\"onTouchEnd($event)\"\r\n (touchstart)=\"onTouchStart($event)\" (touchmove)=\"onTouchMove($event)\">\r\n <div #itemsContainer class=\"cmat-carousel-items-container\"\r\n [style.height]=\"isVertical() ? verticalViewContainerHeight() : 'auto'\"\r\n (transitionend)=\"onTransitionEnd()\">\r\n @for (item of clonedItemsForStarting(); track $index) {\r\n <div [ngClass]=\"{\r\n 'cmat-carousel-item cmat-carousel-item-cloned': true,\r\n 'cmat-carousel-item-active': totalShiftedItems() * -1 === data().length,\r\n 'cmat-carousel-item-start': 0 === $index,\r\n 'cmat-carousel-item-end': (clonedItemsForStarting().length) - 1 === $index\r\n }\" [attr.aria-hidden]=\"!(totalShiftedItems() * -1 === data().length)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n @for (item of data(); track $index) {\r\n <div [ngClass]=\"{ 'cmat-carousel-item': true, 'cmat-carousel-item-active': firstIndex() <= $index && lastIndex() >= $index, 'cmat-carousel-item-start': firstIndex() === $index, 'cmat-carousel-item-end': lastIndex() === $index }\"\r\n [attr.aria-hidden]=\"!(totalShiftedItems() * -1 === data().length)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n @for (item of clonedItemsForFinishing(); track $index) {\r\n <div [ngClass]=\"{\r\n 'cmat-carousel-item cmat-carousel-item-cloned': true,\r\n 'cmat-carousel-item-active': totalShiftedItems() * -1 === numVisible(),\r\n 'cmat-carousel-item-start': 0 === $index,\r\n 'cmat-carousel-item-end': clonedItemsForFinishing().length - 1 === $index\r\n }\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if(showNavigators()&&navigatorsType()==='normal'){\r\n <button type=\"button\" matIconButton [ngClass]=\"{ 'cmat-carousel-next': true}\"\r\n [disabled]=\"!isCircular() && page() >= totalDots() - 1\" (click)=\"navForward($event)\">\r\n @if(!nextIconTemplate()){\r\n @if(!isVertical()){\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-right'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-down'\"></mat-icon>\r\n }\r\n }\r\n @else{\r\n <span class=\"cmat-carousel-prev-icon\">\r\n <ng-template *ngTemplateOutlet=\"nextIconTemplate()\"></ng-template>\r\n </span>\r\n }\r\n </button>\r\n }\r\n\r\n </div>\r\n @if(showIndicators()){\r\n <ul #indicatorContent role=\"presentation\" [ngClass]=\"'cmat-carousel-indicators'\"\r\n [class]=\"indicatorsContentClass()\" [ngStyle]=\"indicatorsContentStyle()\" (keydown)=\"onIndicatorKeydown($event)\">\r\n @for (totalDot of getTotalDotsArray(); track $index) {\r\n <li [ngClass]=\"{ 'cmat-carousel-indicator': true, 'cmat-carousel-indicator-active': page() === $index }\"\r\n [attr.data-pc-section]=\"'indicator'\">\r\n <button type=\"button\" [ngClass]=\"'cmat-carousel-indicator-button'\" [class]=\"indicatorStyleClass()\"\r\n [ngStyle]=\"indicatorStyle()\" [attr.aria-current]=\"page() === $index ? 'page' : undefined\"\r\n [tabindex]=\"page() === $index ? 0 : -1\" (click)=\"onDotClick($event, $index)\">\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n\r\n </div>\r\n @if(footerFacet() || footerTemplate()){\r\n <div class=\"cmat-carousel-footer\">\r\n <ng-content select=\"cmat-carousel-footer\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\r\n </div>\r\n }\r\n</div>", styles: ["cmat-carousel{display:flex;flex-direction:column}cmat-carousel .cmat-carousel-content{display:flex;flex-direction:column;overflow:hidden}cmat-carousel .cmat-carousel-prev,cmat-carousel .cmat-carousel-next{align-self:center;flex-grow:0;flex-shrink:0;display:flex;justify-content:center;align-items:center;overflow:hidden;position:relative;margin:.25rem}cmat-carousel .cmat-carousel-container{display:flex;flex-direction:row;width:100%}cmat-carousel .cmat-carousel-items-content{overflow:hidden;width:100%}cmat-carousel .cmat-carousel-items-container{display:flex;flex-direction:row}cmat-carousel .cmat-carousel-indicators{display:flex;flex-direction:row;justify-content:center;flex-wrap:wrap;padding:1rem;gap:.5rem;margin:0;list-style:none}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator-active{background:var(--cmat-text-default)!important;opacity:1!important}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator{border:0 none;border-radius:6px;background:var(--cmat-text-disabled);transition:background .2s,color .2s,outline-color .2s,box-shadow .2s;opacity:.3}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator .cmat-carousel-indicator-button{display:flex;align-items:center;justify-content:center;width:2rem;height:.5rem;outline-color:transparent;padding:0;margin:0;-webkit-user-select:none;user-select:none;cursor:pointer}cmat-carousel .cmat-carousel-vertical .cmat-carousel-container{flex-direction:column;width:auto}cmat-carousel .cmat-carousel-vertical .cmat-carousel-items-container{flex-direction:column;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: CmatArrowCursorDirective, selector: "[cmatArrowCursor]", inputs: ["animationDuration", "orientation", "enabled", "selector"], outputs: ["clickEvent"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
623
- }
624
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatCarouselComponent, decorators: [{
625
- type: Component,
626
- args: [{ selector: 'cmat-carousel', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [MatIconModule, MatButtonModule, CmatArrowCursorDirective, CommonModule], template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<div role=\"region\" [attr.id]=\"id\"\r\n [ngClass]=\"{ 'cmat-carousel': true, 'cmat-carousel-vertical': isVertical(), 'cmat-carousel-horizontal': !isVertical() }\"\r\n [ngStyle]=\"style()\" [class]=\"styleClass()\">\r\n\r\n @if(headerFacet() || headerTemplate()){\r\n <div class=\"cmat-carousel-header\">\r\n <ng-content select=\"cmat-carousel-header\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\r\n </div>\r\n }\r\n\r\n <div [class]=\"contentClass()\" [ngClass]=\"'items-center cmat-carousel-content'\">\r\n <div class=\"cmat-carousel-container\" cmatArrowCursor [orientation]=\"orientation()\" [selector]=\"arrowSelector()\"\r\n [enabled]=\"navigatorsType()==='arrow'\" [attr.aria-live]=\"allowAutoplay() ? 'polite' : 'off'\"\r\n (clickEvent)=\"arrowCursorClick($event)\">\r\n @if(showNavigators()&&navigatorsType()==='normal'){\r\n <button type=\"button\" matIconButton [ngClass]=\"{ 'cmat-carousel-prev': true }\"\r\n [disabled]=\"!isCircular() && page() === 0\" (click)=\"navBackward($event)\">\r\n @if(!previousIconTemplate()){\r\n @if(!isVertical()){\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-left'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-up'\"></mat-icon>\r\n }\r\n }\r\n @else {\r\n <span class=\"cmat-carousel-prev-icon\">\r\n <ng-template *ngTemplateOutlet=\"previousIconTemplate()\"></ng-template>\r\n </span>\r\n }\r\n </button>\r\n }\r\n\r\n <div class=\"cmat-carousel-items-content\" (touchend)=\"onTouchEnd($event)\"\r\n (touchstart)=\"onTouchStart($event)\" (touchmove)=\"onTouchMove($event)\">\r\n <div #itemsContainer class=\"cmat-carousel-items-container\"\r\n [style.height]=\"isVertical() ? verticalViewContainerHeight() : 'auto'\"\r\n (transitionend)=\"onTransitionEnd()\">\r\n @for (item of clonedItemsForStarting(); track $index) {\r\n <div [ngClass]=\"{\r\n 'cmat-carousel-item cmat-carousel-item-cloned': true,\r\n 'cmat-carousel-item-active': totalShiftedItems() * -1 === data().length,\r\n 'cmat-carousel-item-start': 0 === $index,\r\n 'cmat-carousel-item-end': (clonedItemsForStarting().length) - 1 === $index\r\n }\" [attr.aria-hidden]=\"!(totalShiftedItems() * -1 === data().length)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n @for (item of data(); track $index) {\r\n <div [ngClass]=\"{ 'cmat-carousel-item': true, 'cmat-carousel-item-active': firstIndex() <= $index && lastIndex() >= $index, 'cmat-carousel-item-start': firstIndex() === $index, 'cmat-carousel-item-end': lastIndex() === $index }\"\r\n [attr.aria-hidden]=\"!(totalShiftedItems() * -1 === data().length)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n @for (item of clonedItemsForFinishing(); track $index) {\r\n <div [ngClass]=\"{\r\n 'cmat-carousel-item cmat-carousel-item-cloned': true,\r\n 'cmat-carousel-item-active': totalShiftedItems() * -1 === numVisible(),\r\n 'cmat-carousel-item-start': 0 === $index,\r\n 'cmat-carousel-item-end': clonedItemsForFinishing().length - 1 === $index\r\n }\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if(showNavigators()&&navigatorsType()==='normal'){\r\n <button type=\"button\" matIconButton [ngClass]=\"{ 'cmat-carousel-next': true}\"\r\n [disabled]=\"!isCircular() && page() >= totalDots() - 1\" (click)=\"navForward($event)\">\r\n @if(!nextIconTemplate()){\r\n @if(!isVertical()){\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-right'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-down'\"></mat-icon>\r\n }\r\n }\r\n @else{\r\n <span class=\"cmat-carousel-prev-icon\">\r\n <ng-template *ngTemplateOutlet=\"nextIconTemplate()\"></ng-template>\r\n </span>\r\n }\r\n </button>\r\n }\r\n\r\n </div>\r\n @if(showIndicators()){\r\n <ul #indicatorContent role=\"presentation\" [ngClass]=\"'cmat-carousel-indicators'\"\r\n [class]=\"indicatorsContentClass()\" [ngStyle]=\"indicatorsContentStyle()\" (keydown)=\"onIndicatorKeydown($event)\">\r\n @for (totalDot of getTotalDotsArray(); track $index) {\r\n <li [ngClass]=\"{ 'cmat-carousel-indicator': true, 'cmat-carousel-indicator-active': page() === $index }\"\r\n [attr.data-pc-section]=\"'indicator'\">\r\n <button type=\"button\" [ngClass]=\"'cmat-carousel-indicator-button'\" [class]=\"indicatorStyleClass()\"\r\n [ngStyle]=\"indicatorStyle()\" [attr.aria-current]=\"page() === $index ? 'page' : undefined\"\r\n [tabindex]=\"page() === $index ? 0 : -1\" (click)=\"onDotClick($event, $index)\">\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n\r\n </div>\r\n @if(footerFacet() || footerTemplate()){\r\n <div class=\"cmat-carousel-footer\">\r\n <ng-content select=\"cmat-carousel-footer\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\r\n </div>\r\n }\r\n</div>", styles: ["cmat-carousel{display:flex;flex-direction:column}cmat-carousel .cmat-carousel-content{display:flex;flex-direction:column;overflow:hidden}cmat-carousel .cmat-carousel-prev,cmat-carousel .cmat-carousel-next{align-self:center;flex-grow:0;flex-shrink:0;display:flex;justify-content:center;align-items:center;overflow:hidden;position:relative;margin:.25rem}cmat-carousel .cmat-carousel-container{display:flex;flex-direction:row;width:100%}cmat-carousel .cmat-carousel-items-content{overflow:hidden;width:100%}cmat-carousel .cmat-carousel-items-container{display:flex;flex-direction:row}cmat-carousel .cmat-carousel-indicators{display:flex;flex-direction:row;justify-content:center;flex-wrap:wrap;padding:1rem;gap:.5rem;margin:0;list-style:none}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator-active{background:var(--cmat-text-default)!important;opacity:1!important}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator{border:0 none;border-radius:6px;background:var(--cmat-text-disabled);transition:background .2s,color .2s,outline-color .2s,box-shadow .2s;opacity:.3}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator .cmat-carousel-indicator-button{display:flex;align-items:center;justify-content:center;width:2rem;height:.5rem;outline-color:transparent;padding:0;margin:0;-webkit-user-select:none;user-select:none;cursor:pointer}cmat-carousel .cmat-carousel-vertical .cmat-carousel-container{flex-direction:column;width:auto}cmat-carousel .cmat-carousel-vertical .cmat-carousel-items-container{flex-direction:column;height:100%}\n"] }]
627
- }], ctorParameters: () => [], propDecorators: { page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], numVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "numVisible", required: false }] }, { type: i0.Output, args: ["numVisibleChange"] }], numScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "numScroll", required: false }] }, { type: i0.Output, args: ["numScrollChange"] }], autoplayInterval: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoplayInterval", required: false }] }], responsiveOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsiveOptions", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], navigatorsType: [{ type: i0.Input, args: [{ isSignal: true, alias: "navigatorsType", required: false }] }], verticalViewPortHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "verticalViewPortHeight", required: false }] }], arrowSelector: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrowSelector", required: false }] }], contentClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentClass", required: false }] }], indicatorsContentClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "indicatorsContentClass", required: false }] }], indicatorsContentStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "indicatorsContentStyle", required: false }] }], indicatorStyleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "indicatorStyleClass", required: false }] }], indicatorStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "indicatorStyle", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], circular: [{ type: i0.Input, args: [{ isSignal: true, alias: "circular", required: false }] }], showIndicators: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIndicators", required: false }] }], showNavigators: [{ type: i0.Input, args: [{ isSignal: true, alias: "showNavigators", required: false }] }], suspendAutoPlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "suspendAutoPlay", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], pageEvent: [{ type: i0.Output, args: ["pageEvent"] }], itemsContainer: [{ type: i0.ViewChild, args: ['itemsContainer', { isSignal: true }] }], indicatorContent: [{ type: i0.ViewChild, args: ['indicatorContent', { isSignal: true }] }], headerFacet: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CmatCarouselHeaderComponent), { isSignal: true }] }], footerFacet: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CmatCarouselFooterComponent), { isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CmatCarouselTemplateDirective), { isSignal: true }] }] } });
628
-
629
- /**
630
- * Generated bundle index. Do not edit.
631
- */
632
-
508
+ }
509
+ if (this.carouselStyle()) this.renderer.setProperty(this.carouselStyle(), "textContent", innerHTML);
510
+ }
511
+ _calculatePosition() {
512
+ if (!this.responsiveOptions() || this.responsiveOptions().length === 0) return;
513
+ const windowWidth = this._document.defaultView?.innerWidth ?? 0;
514
+ let matchedResponsiveData = null;
515
+ const sortedOptions = [...this.responsiveOptions()].sort((a, b) => {
516
+ const bpA = a.breakpoint === null || a.breakpoint === void 0 ? Infinity : parseInt(a.breakpoint, 10);
517
+ return (b.breakpoint === null || b.breakpoint === void 0 ? Infinity : parseInt(b.breakpoint, 10)) - bpA;
518
+ });
519
+ for (const res of sortedOptions) {
520
+ const bp = parseInt(res.breakpoint, 10);
521
+ if (!isNaN(bp) && bp >= windowWidth) {
522
+ matchedResponsiveData = res;
523
+ break;
524
+ }
525
+ }
526
+ if (matchedResponsiveData) {
527
+ if (this.numScroll() !== matchedResponsiveData.numScroll) {
528
+ const oldNumScroll = this.numScroll();
529
+ const newNumScroll = matchedResponsiveData.numScroll;
530
+ let page = this.page();
531
+ if (oldNumScroll > 0) page = Math.floor(page * oldNumScroll / newNumScroll);
532
+ this.numScroll.set(newNumScroll);
533
+ this.page.set(page);
534
+ this.pageEvent.emit({ page: this.page() });
535
+ }
536
+ if (this.numVisible() !== matchedResponsiveData.numVisible) {
537
+ this.numVisible.set(matchedResponsiveData.numVisible);
538
+ this._setCloneItems();
539
+ }
540
+ }
541
+ if (matchedResponsiveData) this._createStyle();
542
+ }
543
+ _updateCarouselItemsAccessibility() {
544
+ const slides = this.el.nativeElement.querySelectorAll(".cmat-carousel-item");
545
+ const currentPage = this.page();
546
+ const nv = this.numVisible();
547
+ const ns = this.numScroll();
548
+ if (this.isCircular()) {
549
+ slides.forEach((slide) => {
550
+ slide.removeAttribute("aria-hidden");
551
+ slide.querySelectorAll("a, button, input, select, textarea, [tabindex]").forEach((el) => {
552
+ el.removeAttribute("tabindex");
553
+ });
554
+ });
555
+ return;
556
+ }
557
+ const startIdx = currentPage * ns;
558
+ const endIdx = startIdx + nv;
559
+ slides.forEach((slide, domIndex) => {
560
+ const isActive = domIndex >= startIdx && domIndex < endIdx;
561
+ slide.setAttribute("aria-hidden", !isActive ? "true" : "false");
562
+ slide.querySelectorAll("a, button, input, select, textarea, [tabindex]").forEach((el) => {
563
+ el.tabIndex = isActive ? 0 : -1;
564
+ });
565
+ });
566
+ }
567
+ _setCloneItems() {
568
+ this.clonedItemsForStarting.set([]);
569
+ this.clonedItemsForFinishing.set([]);
570
+ if (this.isCircular()) {
571
+ const data = this.data() ?? [];
572
+ const nv = this.numVisible();
573
+ if (data.length >= nv) {
574
+ this.clonedItemsForStarting.set([...data.slice(-1 * nv)]);
575
+ this.clonedItemsForFinishing.set([...data.slice(0, nv)]);
576
+ }
577
+ }
578
+ }
579
+ _findFocusedIndicatorIndex() {
580
+ const indicators = Array.from(this.indicatorContent()?.nativeElement?.querySelectorAll("[data-pc-section=\"indicator\"]") ?? []);
581
+ const activeIndicator = this.indicatorContent()?.nativeElement?.querySelector("[data-pc-section=\"indicator\"] > button[tabindex=\"0\"]");
582
+ return indicators.findIndex((ind) => ind === activeIndicator?.parentElement);
583
+ }
584
+ _changedFocusedIndicator(prevInd, nextInd) {
585
+ const indicators = Array.from(this.indicatorContent()?.nativeElement?.querySelectorAll("[data-pc-section=\"indicator\"]") ?? []);
586
+ if (indicators[prevInd]?.children[0]) indicators[prevInd].children[0].tabIndex = -1;
587
+ if (indicators[nextInd]?.children[0]) {
588
+ indicators[nextInd].children[0].tabIndex = 0;
589
+ indicators[nextInd].children[0].focus();
590
+ }
591
+ }
592
+ _onRightKey() {
593
+ const indicators = Array.from(this.indicatorContent()?.nativeElement?.querySelectorAll("[data-pc-section=\"indicator\"]") ?? []);
594
+ const activeIndex = this._findFocusedIndicatorIndex();
595
+ this._changedFocusedIndicator(activeIndex, activeIndex + 1 === indicators.length ? indicators.length - 1 : activeIndex + 1);
596
+ }
597
+ _onLeftKey() {
598
+ const activeIndex = this._findFocusedIndicatorIndex();
599
+ this._changedFocusedIndicator(activeIndex, activeIndex - 1 <= 0 ? 0 : activeIndex - 1);
600
+ }
601
+ _onHomeKey() {
602
+ this._changedFocusedIndicator(this._findFocusedIndicatorIndex(), 0);
603
+ }
604
+ _onEndKey() {
605
+ const indicators = Array.from(this.indicatorContent()?.nativeElement?.querySelectorAll("[data-pc-section=\"indicator\"]") ?? []);
606
+ this._changedFocusedIndicator(this._findFocusedIndicatorIndex(), indicators.length - 1);
607
+ }
608
+ _onTabKey() {
609
+ const indicators = Array.from(this.indicatorContent()?.nativeElement?.querySelectorAll("[data-pc-section=\"indicator\"]") ?? []);
610
+ const highlightedIndex = indicators.findIndex((ind) => ind.getAttribute("cmat-carousel-highlight") !== void 0);
611
+ const activeIndicator = this.indicatorContent()?.nativeElement?.querySelector("[data-pc-section=\"indicator\"] > button[tabindex=\"0\"]");
612
+ const activeIndex = indicators.findIndex((ind) => ind === activeIndicator?.parentElement);
613
+ if (indicators[activeIndex]?.children[0]) indicators[activeIndex].children[0].tabIndex = -1;
614
+ if (indicators[highlightedIndex]?.children[0]) indicators[highlightedIndex].children[0].tabIndex = 0;
615
+ }
616
+ static {
617
+ this.ɵfac = i0.ɵɵngDeclareFactory({
618
+ minVersion: "12.0.0",
619
+ version: "22.2.3",
620
+ ngImport: i0,
621
+ type: CmatCarouselComponent,
622
+ deps: [],
623
+ target: i0.ɵɵFactoryTarget.Component
624
+ });
625
+ }
626
+ static {
627
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
628
+ minVersion: "17.0.0",
629
+ version: "22.2.3",
630
+ type: CmatCarouselComponent,
631
+ isStandalone: true,
632
+ selector: "cmat-carousel",
633
+ inputs: {
634
+ page: {
635
+ classPropertyName: "page",
636
+ publicName: "page",
637
+ isSignal: true,
638
+ isRequired: false,
639
+ transformFunction: null
640
+ },
641
+ numVisible: {
642
+ classPropertyName: "numVisible",
643
+ publicName: "numVisible",
644
+ isSignal: true,
645
+ isRequired: false,
646
+ transformFunction: null
647
+ },
648
+ numScroll: {
649
+ classPropertyName: "numScroll",
650
+ publicName: "numScroll",
651
+ isSignal: true,
652
+ isRequired: false,
653
+ transformFunction: null
654
+ },
655
+ autoplayInterval: {
656
+ classPropertyName: "autoplayInterval",
657
+ publicName: "autoplayInterval",
658
+ isSignal: true,
659
+ isRequired: false,
660
+ transformFunction: null
661
+ },
662
+ responsiveOptions: {
663
+ classPropertyName: "responsiveOptions",
664
+ publicName: "responsiveOptions",
665
+ isSignal: true,
666
+ isRequired: false,
667
+ transformFunction: null
668
+ },
669
+ orientation: {
670
+ classPropertyName: "orientation",
671
+ publicName: "orientation",
672
+ isSignal: true,
673
+ isRequired: false,
674
+ transformFunction: null
675
+ },
676
+ navigatorsType: {
677
+ classPropertyName: "navigatorsType",
678
+ publicName: "navigatorsType",
679
+ isSignal: true,
680
+ isRequired: false,
681
+ transformFunction: null
682
+ },
683
+ verticalViewPortHeight: {
684
+ classPropertyName: "verticalViewPortHeight",
685
+ publicName: "verticalViewPortHeight",
686
+ isSignal: true,
687
+ isRequired: false,
688
+ transformFunction: null
689
+ },
690
+ arrowSelector: {
691
+ classPropertyName: "arrowSelector",
692
+ publicName: "arrowSelector",
693
+ isSignal: true,
694
+ isRequired: false,
695
+ transformFunction: null
696
+ },
697
+ contentClass: {
698
+ classPropertyName: "contentClass",
699
+ publicName: "contentClass",
700
+ isSignal: true,
701
+ isRequired: false,
702
+ transformFunction: null
703
+ },
704
+ indicatorsContentClass: {
705
+ classPropertyName: "indicatorsContentClass",
706
+ publicName: "indicatorsContentClass",
707
+ isSignal: true,
708
+ isRequired: false,
709
+ transformFunction: null
710
+ },
711
+ indicatorsContentStyle: {
712
+ classPropertyName: "indicatorsContentStyle",
713
+ publicName: "indicatorsContentStyle",
714
+ isSignal: true,
715
+ isRequired: false,
716
+ transformFunction: null
717
+ },
718
+ indicatorStyleClass: {
719
+ classPropertyName: "indicatorStyleClass",
720
+ publicName: "indicatorStyleClass",
721
+ isSignal: true,
722
+ isRequired: false,
723
+ transformFunction: null
724
+ },
725
+ indicatorStyle: {
726
+ classPropertyName: "indicatorStyle",
727
+ publicName: "indicatorStyle",
728
+ isSignal: true,
729
+ isRequired: false,
730
+ transformFunction: null
731
+ },
732
+ data: {
733
+ classPropertyName: "data",
734
+ publicName: "data",
735
+ isSignal: true,
736
+ isRequired: true,
737
+ transformFunction: null
738
+ },
739
+ circular: {
740
+ classPropertyName: "circular",
741
+ publicName: "circular",
742
+ isSignal: true,
743
+ isRequired: false,
744
+ transformFunction: null
745
+ },
746
+ showIndicators: {
747
+ classPropertyName: "showIndicators",
748
+ publicName: "showIndicators",
749
+ isSignal: true,
750
+ isRequired: false,
751
+ transformFunction: null
752
+ },
753
+ showNavigators: {
754
+ classPropertyName: "showNavigators",
755
+ publicName: "showNavigators",
756
+ isSignal: true,
757
+ isRequired: false,
758
+ transformFunction: null
759
+ },
760
+ suspendAutoPlay: {
761
+ classPropertyName: "suspendAutoPlay",
762
+ publicName: "suspendAutoPlay",
763
+ isSignal: true,
764
+ isRequired: false,
765
+ transformFunction: null
766
+ },
767
+ style: {
768
+ classPropertyName: "style",
769
+ publicName: "style",
770
+ isSignal: true,
771
+ isRequired: false,
772
+ transformFunction: null
773
+ },
774
+ styleClass: {
775
+ classPropertyName: "styleClass",
776
+ publicName: "styleClass",
777
+ isSignal: true,
778
+ isRequired: false,
779
+ transformFunction: null
780
+ }
781
+ },
782
+ outputs: {
783
+ page: "pageChange",
784
+ numVisible: "numVisibleChange",
785
+ numScroll: "numScrollChange",
786
+ pageEvent: "pageEvent"
787
+ },
788
+ queries: [
789
+ {
790
+ propertyName: "headerFacet",
791
+ first: true,
792
+ predicate: CmatCarouselHeaderComponent,
793
+ descendants: true,
794
+ isSignal: true
795
+ },
796
+ {
797
+ propertyName: "footerFacet",
798
+ first: true,
799
+ predicate: CmatCarouselFooterComponent,
800
+ descendants: true,
801
+ isSignal: true
802
+ },
803
+ {
804
+ propertyName: "templates",
805
+ predicate: CmatCarouselTemplateDirective,
806
+ isSignal: true
807
+ }
808
+ ],
809
+ viewQueries: [{
810
+ propertyName: "itemsContainer",
811
+ first: true,
812
+ predicate: ["itemsContainer"],
813
+ descendants: true,
814
+ isSignal: true
815
+ }, {
816
+ propertyName: "indicatorContent",
817
+ first: true,
818
+ predicate: ["indicatorContent"],
819
+ descendants: true,
820
+ isSignal: true
821
+ }],
822
+ ngImport: i0,
823
+ template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<div role=\"region\" [attr.id]=\"id\"\r\n [ngClass]=\"{ 'cmat-carousel': true, 'cmat-carousel-vertical': isVertical(), 'cmat-carousel-horizontal': !isVertical() }\"\r\n [ngStyle]=\"style()\" [class]=\"styleClass()\">\r\n\r\n @if(headerFacet() || headerTemplate()){\r\n <div class=\"cmat-carousel-header\">\r\n <ng-content select=\"cmat-carousel-header\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\r\n </div>\r\n }\r\n\r\n <div [class]=\"contentClass()\" [ngClass]=\"'items-center cmat-carousel-content'\">\r\n <div class=\"cmat-carousel-container\" cmatArrowCursor [orientation]=\"orientation()\" [selector]=\"arrowSelector()\"\r\n [enabled]=\"navigatorsType()==='arrow'\" [attr.aria-live]=\"allowAutoplay() ? 'polite' : 'off'\"\r\n (clickEvent)=\"arrowCursorClick($event)\">\r\n @if(showNavigators()&&navigatorsType()==='normal'){\r\n <button type=\"button\" matIconButton [ngClass]=\"{ 'cmat-carousel-prev': true }\"\r\n [disabled]=\"!isCircular() && page() === 0\" (click)=\"navBackward($event)\">\r\n @if(!previousIconTemplate()){\r\n @if(!isVertical()){\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-left'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-up'\"></mat-icon>\r\n }\r\n }\r\n @else {\r\n <span class=\"cmat-carousel-prev-icon\">\r\n <ng-template *ngTemplateOutlet=\"previousIconTemplate()\"></ng-template>\r\n </span>\r\n }\r\n </button>\r\n }\r\n\r\n <div class=\"cmat-carousel-items-content\" (touchend)=\"onTouchEnd($event)\"\r\n (touchstart)=\"onTouchStart($event)\" (touchmove)=\"onTouchMove($event)\">\r\n <div #itemsContainer class=\"cmat-carousel-items-container\"\r\n [style.height]=\"isVertical() ? verticalViewContainerHeight() : 'auto'\"\r\n (transitionend)=\"onTransitionEnd()\">\r\n @for (item of clonedItemsForStarting(); track $index) {\r\n <div [ngClass]=\"{\r\n 'cmat-carousel-item cmat-carousel-item-cloned': true,\r\n 'cmat-carousel-item-active': totalShiftedItems() * -1 === data().length,\r\n 'cmat-carousel-item-start': 0 === $index,\r\n 'cmat-carousel-item-end': (clonedItemsForStarting().length) - 1 === $index\r\n }\" [attr.aria-hidden]=\"!(totalShiftedItems() * -1 === data().length)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n @for (item of data(); track $index) {\r\n <div [ngClass]=\"{ 'cmat-carousel-item': true, 'cmat-carousel-item-active': firstIndex() <= $index && lastIndex() >= $index, 'cmat-carousel-item-start': firstIndex() === $index, 'cmat-carousel-item-end': lastIndex() === $index }\"\r\n [attr.aria-hidden]=\"!(totalShiftedItems() * -1 === data().length)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n @for (item of clonedItemsForFinishing(); track $index) {\r\n <div [ngClass]=\"{\r\n 'cmat-carousel-item cmat-carousel-item-cloned': true,\r\n 'cmat-carousel-item-active': totalShiftedItems() * -1 === numVisible(),\r\n 'cmat-carousel-item-start': 0 === $index,\r\n 'cmat-carousel-item-end': clonedItemsForFinishing().length - 1 === $index\r\n }\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if(showNavigators()&&navigatorsType()==='normal'){\r\n <button type=\"button\" matIconButton [ngClass]=\"{ 'cmat-carousel-next': true}\"\r\n [disabled]=\"!isCircular() && page() >= totalDots() - 1\" (click)=\"navForward($event)\">\r\n @if(!nextIconTemplate()){\r\n @if(!isVertical()){\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-right'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-down'\"></mat-icon>\r\n }\r\n }\r\n @else{\r\n <span class=\"cmat-carousel-prev-icon\">\r\n <ng-template *ngTemplateOutlet=\"nextIconTemplate()\"></ng-template>\r\n </span>\r\n }\r\n </button>\r\n }\r\n\r\n </div>\r\n @if(showIndicators()){\r\n <ul #indicatorContent role=\"presentation\" [ngClass]=\"'cmat-carousel-indicators'\"\r\n [class]=\"indicatorsContentClass()\" [ngStyle]=\"indicatorsContentStyle()\" (keydown)=\"onIndicatorKeydown($event)\">\r\n @for (totalDot of getTotalDotsArray(); track $index) {\r\n <li [ngClass]=\"{ 'cmat-carousel-indicator': true, 'cmat-carousel-indicator-active': page() === $index }\"\r\n [attr.data-pc-section]=\"'indicator'\">\r\n <button type=\"button\" [ngClass]=\"'cmat-carousel-indicator-button'\" [class]=\"indicatorStyleClass()\"\r\n [ngStyle]=\"indicatorStyle()\" [attr.aria-current]=\"page() === $index ? 'page' : undefined\"\r\n [tabindex]=\"page() === $index ? 0 : -1\" (click)=\"onDotClick($event, $index)\">\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n\r\n </div>\r\n @if(footerFacet() || footerTemplate()){\r\n <div class=\"cmat-carousel-footer\">\r\n <ng-content select=\"cmat-carousel-footer\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\r\n </div>\r\n }\r\n</div>",
824
+ styles: ["cmat-carousel{display:flex;flex-direction:column}cmat-carousel .cmat-carousel-content{display:flex;flex-direction:column;overflow:hidden}cmat-carousel .cmat-carousel-prev,cmat-carousel .cmat-carousel-next{align-self:center;flex-grow:0;flex-shrink:0;display:flex;justify-content:center;align-items:center;overflow:hidden;position:relative;margin:.25rem}cmat-carousel .cmat-carousel-container{display:flex;flex-direction:row;width:100%}cmat-carousel .cmat-carousel-items-content{overflow:hidden;width:100%}cmat-carousel .cmat-carousel-items-container{display:flex;flex-direction:row}cmat-carousel .cmat-carousel-indicators{display:flex;flex-direction:row;justify-content:center;flex-wrap:wrap;padding:1rem;gap:.5rem;margin:0;list-style:none}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator-active{background:var(--cmat-text-default)!important;opacity:1!important}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator{border:0 none;border-radius:6px;background:var(--cmat-text-disabled);transition:background .2s,color .2s,outline-color .2s,box-shadow .2s;opacity:.3}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator .cmat-carousel-indicator-button{display:flex;align-items:center;justify-content:center;width:2rem;height:.5rem;outline-color:transparent;padding:0;margin:0;-webkit-user-select:none;user-select:none;cursor:pointer}cmat-carousel .cmat-carousel-vertical .cmat-carousel-container{flex-direction:column;width:auto}cmat-carousel .cmat-carousel-vertical .cmat-carousel-items-container{flex-direction:column;height:100%}\n"],
825
+ dependencies: [
826
+ {
827
+ kind: "ngmodule",
828
+ type: MatIconModule
829
+ },
830
+ {
831
+ kind: "component",
832
+ type: i1.MatIcon,
833
+ selector: "mat-icon",
834
+ inputs: [
835
+ "color",
836
+ "inline",
837
+ "svgIcon",
838
+ "fontSet",
839
+ "fontIcon"
840
+ ],
841
+ exportAs: ["matIcon"]
842
+ },
843
+ {
844
+ kind: "ngmodule",
845
+ type: MatButtonModule
846
+ },
847
+ {
848
+ kind: "component",
849
+ type: i2.MatIconButton,
850
+ selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
851
+ exportAs: ["matButton", "matAnchor"]
852
+ },
853
+ {
854
+ kind: "directive",
855
+ type: CmatArrowCursorDirective,
856
+ selector: "[cmatArrowCursor]",
857
+ inputs: [
858
+ "animationDuration",
859
+ "orientation",
860
+ "enabled",
861
+ "selector"
862
+ ],
863
+ outputs: ["clickEvent"]
864
+ },
865
+ {
866
+ kind: "ngmodule",
867
+ type: CommonModule
868
+ },
869
+ {
870
+ kind: "directive",
871
+ type: i3.NgClass,
872
+ selector: "[ngClass]",
873
+ inputs: ["class", "ngClass"]
874
+ },
875
+ {
876
+ kind: "directive",
877
+ type: i3.NgTemplateOutlet,
878
+ selector: "[ngTemplateOutlet]",
879
+ inputs: [
880
+ "ngTemplateOutletContext",
881
+ "ngTemplateOutlet",
882
+ "ngTemplateOutletInjector"
883
+ ]
884
+ },
885
+ {
886
+ kind: "directive",
887
+ type: i3.NgStyle,
888
+ selector: "[ngStyle]",
889
+ inputs: ["ngStyle"]
890
+ }
891
+ ],
892
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
893
+ encapsulation: i0.ViewEncapsulation.None
894
+ });
895
+ }
896
+ };
897
+ i0.ɵɵngDeclareClassMetadata({
898
+ minVersion: "12.0.0",
899
+ version: "22.2.3",
900
+ ngImport: i0,
901
+ type: CmatCarouselComponent,
902
+ decorators: [{
903
+ type: Component,
904
+ args: [{
905
+ selector: "cmat-carousel",
906
+ changeDetection: ChangeDetectionStrategy.OnPush,
907
+ encapsulation: ViewEncapsulation.None,
908
+ imports: [
909
+ MatIconModule,
910
+ MatButtonModule,
911
+ CmatArrowCursorDirective,
912
+ CommonModule
913
+ ],
914
+ template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<div role=\"region\" [attr.id]=\"id\"\r\n [ngClass]=\"{ 'cmat-carousel': true, 'cmat-carousel-vertical': isVertical(), 'cmat-carousel-horizontal': !isVertical() }\"\r\n [ngStyle]=\"style()\" [class]=\"styleClass()\">\r\n\r\n @if(headerFacet() || headerTemplate()){\r\n <div class=\"cmat-carousel-header\">\r\n <ng-content select=\"cmat-carousel-header\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\r\n </div>\r\n }\r\n\r\n <div [class]=\"contentClass()\" [ngClass]=\"'items-center cmat-carousel-content'\">\r\n <div class=\"cmat-carousel-container\" cmatArrowCursor [orientation]=\"orientation()\" [selector]=\"arrowSelector()\"\r\n [enabled]=\"navigatorsType()==='arrow'\" [attr.aria-live]=\"allowAutoplay() ? 'polite' : 'off'\"\r\n (clickEvent)=\"arrowCursorClick($event)\">\r\n @if(showNavigators()&&navigatorsType()==='normal'){\r\n <button type=\"button\" matIconButton [ngClass]=\"{ 'cmat-carousel-prev': true }\"\r\n [disabled]=\"!isCircular() && page() === 0\" (click)=\"navBackward($event)\">\r\n @if(!previousIconTemplate()){\r\n @if(!isVertical()){\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-left'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-up'\"></mat-icon>\r\n }\r\n }\r\n @else {\r\n <span class=\"cmat-carousel-prev-icon\">\r\n <ng-template *ngTemplateOutlet=\"previousIconTemplate()\"></ng-template>\r\n </span>\r\n }\r\n </button>\r\n }\r\n\r\n <div class=\"cmat-carousel-items-content\" (touchend)=\"onTouchEnd($event)\"\r\n (touchstart)=\"onTouchStart($event)\" (touchmove)=\"onTouchMove($event)\">\r\n <div #itemsContainer class=\"cmat-carousel-items-container\"\r\n [style.height]=\"isVertical() ? verticalViewContainerHeight() : 'auto'\"\r\n (transitionend)=\"onTransitionEnd()\">\r\n @for (item of clonedItemsForStarting(); track $index) {\r\n <div [ngClass]=\"{\r\n 'cmat-carousel-item cmat-carousel-item-cloned': true,\r\n 'cmat-carousel-item-active': totalShiftedItems() * -1 === data().length,\r\n 'cmat-carousel-item-start': 0 === $index,\r\n 'cmat-carousel-item-end': (clonedItemsForStarting().length) - 1 === $index\r\n }\" [attr.aria-hidden]=\"!(totalShiftedItems() * -1 === data().length)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n @for (item of data(); track $index) {\r\n <div [ngClass]=\"{ 'cmat-carousel-item': true, 'cmat-carousel-item-active': firstIndex() <= $index && lastIndex() >= $index, 'cmat-carousel-item-start': firstIndex() === $index, 'cmat-carousel-item-end': lastIndex() === $index }\"\r\n [attr.aria-hidden]=\"!(totalShiftedItems() * -1 === data().length)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n @for (item of clonedItemsForFinishing(); track $index) {\r\n <div [ngClass]=\"{\r\n 'cmat-carousel-item cmat-carousel-item-cloned': true,\r\n 'cmat-carousel-item-active': totalShiftedItems() * -1 === numVisible(),\r\n 'cmat-carousel-item-start': 0 === $index,\r\n 'cmat-carousel-item-end': clonedItemsForFinishing().length - 1 === $index\r\n }\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate(); context: { $implicit: item }\"></ng-container>\r\n </div>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if(showNavigators()&&navigatorsType()==='normal'){\r\n <button type=\"button\" matIconButton [ngClass]=\"{ 'cmat-carousel-next': true}\"\r\n [disabled]=\"!isCircular() && page() >= totalDots() - 1\" (click)=\"navForward($event)\">\r\n @if(!nextIconTemplate()){\r\n @if(!isVertical()){\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-right'\"></mat-icon>\r\n }@else {\r\n <mat-icon [svgIcon]=\"'heroicons_solid:chevron-down'\"></mat-icon>\r\n }\r\n }\r\n @else{\r\n <span class=\"cmat-carousel-prev-icon\">\r\n <ng-template *ngTemplateOutlet=\"nextIconTemplate()\"></ng-template>\r\n </span>\r\n }\r\n </button>\r\n }\r\n\r\n </div>\r\n @if(showIndicators()){\r\n <ul #indicatorContent role=\"presentation\" [ngClass]=\"'cmat-carousel-indicators'\"\r\n [class]=\"indicatorsContentClass()\" [ngStyle]=\"indicatorsContentStyle()\" (keydown)=\"onIndicatorKeydown($event)\">\r\n @for (totalDot of getTotalDotsArray(); track $index) {\r\n <li [ngClass]=\"{ 'cmat-carousel-indicator': true, 'cmat-carousel-indicator-active': page() === $index }\"\r\n [attr.data-pc-section]=\"'indicator'\">\r\n <button type=\"button\" [ngClass]=\"'cmat-carousel-indicator-button'\" [class]=\"indicatorStyleClass()\"\r\n [ngStyle]=\"indicatorStyle()\" [attr.aria-current]=\"page() === $index ? 'page' : undefined\"\r\n [tabindex]=\"page() === $index ? 0 : -1\" (click)=\"onDotClick($event, $index)\">\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n\r\n </div>\r\n @if(footerFacet() || footerTemplate()){\r\n <div class=\"cmat-carousel-footer\">\r\n <ng-content select=\"cmat-carousel-footer\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\r\n </div>\r\n }\r\n</div>",
915
+ styles: ["cmat-carousel{display:flex;flex-direction:column}cmat-carousel .cmat-carousel-content{display:flex;flex-direction:column;overflow:hidden}cmat-carousel .cmat-carousel-prev,cmat-carousel .cmat-carousel-next{align-self:center;flex-grow:0;flex-shrink:0;display:flex;justify-content:center;align-items:center;overflow:hidden;position:relative;margin:.25rem}cmat-carousel .cmat-carousel-container{display:flex;flex-direction:row;width:100%}cmat-carousel .cmat-carousel-items-content{overflow:hidden;width:100%}cmat-carousel .cmat-carousel-items-container{display:flex;flex-direction:row}cmat-carousel .cmat-carousel-indicators{display:flex;flex-direction:row;justify-content:center;flex-wrap:wrap;padding:1rem;gap:.5rem;margin:0;list-style:none}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator-active{background:var(--cmat-text-default)!important;opacity:1!important}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator{border:0 none;border-radius:6px;background:var(--cmat-text-disabled);transition:background .2s,color .2s,outline-color .2s,box-shadow .2s;opacity:.3}cmat-carousel .cmat-carousel-indicators .cmat-carousel-indicator .cmat-carousel-indicator-button{display:flex;align-items:center;justify-content:center;width:2rem;height:.5rem;outline-color:transparent;padding:0;margin:0;-webkit-user-select:none;user-select:none;cursor:pointer}cmat-carousel .cmat-carousel-vertical .cmat-carousel-container{flex-direction:column;width:auto}cmat-carousel .cmat-carousel-vertical .cmat-carousel-items-container{flex-direction:column;height:100%}\n"]
916
+ }]
917
+ }],
918
+ ctorParameters: () => [],
919
+ propDecorators: {
920
+ page: [{
921
+ type: i0.Input,
922
+ args: [{
923
+ isSignal: true,
924
+ alias: "page",
925
+ required: false
926
+ }]
927
+ }, {
928
+ type: i0.Output,
929
+ args: ["pageChange"]
930
+ }],
931
+ numVisible: [{
932
+ type: i0.Input,
933
+ args: [{
934
+ isSignal: true,
935
+ alias: "numVisible",
936
+ required: false
937
+ }]
938
+ }, {
939
+ type: i0.Output,
940
+ args: ["numVisibleChange"]
941
+ }],
942
+ numScroll: [{
943
+ type: i0.Input,
944
+ args: [{
945
+ isSignal: true,
946
+ alias: "numScroll",
947
+ required: false
948
+ }]
949
+ }, {
950
+ type: i0.Output,
951
+ args: ["numScrollChange"]
952
+ }],
953
+ autoplayInterval: [{
954
+ type: i0.Input,
955
+ args: [{
956
+ isSignal: true,
957
+ alias: "autoplayInterval",
958
+ required: false
959
+ }]
960
+ }],
961
+ responsiveOptions: [{
962
+ type: i0.Input,
963
+ args: [{
964
+ isSignal: true,
965
+ alias: "responsiveOptions",
966
+ required: false
967
+ }]
968
+ }],
969
+ orientation: [{
970
+ type: i0.Input,
971
+ args: [{
972
+ isSignal: true,
973
+ alias: "orientation",
974
+ required: false
975
+ }]
976
+ }],
977
+ navigatorsType: [{
978
+ type: i0.Input,
979
+ args: [{
980
+ isSignal: true,
981
+ alias: "navigatorsType",
982
+ required: false
983
+ }]
984
+ }],
985
+ verticalViewPortHeight: [{
986
+ type: i0.Input,
987
+ args: [{
988
+ isSignal: true,
989
+ alias: "verticalViewPortHeight",
990
+ required: false
991
+ }]
992
+ }],
993
+ arrowSelector: [{
994
+ type: i0.Input,
995
+ args: [{
996
+ isSignal: true,
997
+ alias: "arrowSelector",
998
+ required: false
999
+ }]
1000
+ }],
1001
+ contentClass: [{
1002
+ type: i0.Input,
1003
+ args: [{
1004
+ isSignal: true,
1005
+ alias: "contentClass",
1006
+ required: false
1007
+ }]
1008
+ }],
1009
+ indicatorsContentClass: [{
1010
+ type: i0.Input,
1011
+ args: [{
1012
+ isSignal: true,
1013
+ alias: "indicatorsContentClass",
1014
+ required: false
1015
+ }]
1016
+ }],
1017
+ indicatorsContentStyle: [{
1018
+ type: i0.Input,
1019
+ args: [{
1020
+ isSignal: true,
1021
+ alias: "indicatorsContentStyle",
1022
+ required: false
1023
+ }]
1024
+ }],
1025
+ indicatorStyleClass: [{
1026
+ type: i0.Input,
1027
+ args: [{
1028
+ isSignal: true,
1029
+ alias: "indicatorStyleClass",
1030
+ required: false
1031
+ }]
1032
+ }],
1033
+ indicatorStyle: [{
1034
+ type: i0.Input,
1035
+ args: [{
1036
+ isSignal: true,
1037
+ alias: "indicatorStyle",
1038
+ required: false
1039
+ }]
1040
+ }],
1041
+ data: [{
1042
+ type: i0.Input,
1043
+ args: [{
1044
+ isSignal: true,
1045
+ alias: "data",
1046
+ required: true
1047
+ }]
1048
+ }],
1049
+ circular: [{
1050
+ type: i0.Input,
1051
+ args: [{
1052
+ isSignal: true,
1053
+ alias: "circular",
1054
+ required: false
1055
+ }]
1056
+ }],
1057
+ showIndicators: [{
1058
+ type: i0.Input,
1059
+ args: [{
1060
+ isSignal: true,
1061
+ alias: "showIndicators",
1062
+ required: false
1063
+ }]
1064
+ }],
1065
+ showNavigators: [{
1066
+ type: i0.Input,
1067
+ args: [{
1068
+ isSignal: true,
1069
+ alias: "showNavigators",
1070
+ required: false
1071
+ }]
1072
+ }],
1073
+ suspendAutoPlay: [{
1074
+ type: i0.Input,
1075
+ args: [{
1076
+ isSignal: true,
1077
+ alias: "suspendAutoPlay",
1078
+ required: false
1079
+ }]
1080
+ }],
1081
+ style: [{
1082
+ type: i0.Input,
1083
+ args: [{
1084
+ isSignal: true,
1085
+ alias: "style",
1086
+ required: false
1087
+ }]
1088
+ }],
1089
+ styleClass: [{
1090
+ type: i0.Input,
1091
+ args: [{
1092
+ isSignal: true,
1093
+ alias: "styleClass",
1094
+ required: false
1095
+ }]
1096
+ }],
1097
+ pageEvent: [{
1098
+ type: i0.Output,
1099
+ args: ["pageEvent"]
1100
+ }],
1101
+ itemsContainer: [{
1102
+ type: i0.ViewChild,
1103
+ args: ["itemsContainer", { isSignal: true }]
1104
+ }],
1105
+ indicatorContent: [{
1106
+ type: i0.ViewChild,
1107
+ args: ["indicatorContent", { isSignal: true }]
1108
+ }],
1109
+ headerFacet: [{
1110
+ type: i0.ContentChild,
1111
+ args: [i0.forwardRef(() => CmatCarouselHeaderComponent), { isSignal: true }]
1112
+ }],
1113
+ footerFacet: [{
1114
+ type: i0.ContentChild,
1115
+ args: [i0.forwardRef(() => CmatCarouselFooterComponent), { isSignal: true }]
1116
+ }],
1117
+ templates: [{
1118
+ type: i0.ContentChildren,
1119
+ args: [i0.forwardRef(() => CmatCarouselTemplateDirective), { isSignal: true }]
1120
+ }]
1121
+ }
1122
+ });
633
1123
  export { CmatCarouselComponent, CmatCarouselFooterComponent, CmatCarouselHeaderComponent, CmatCarouselTemplateDirective };
634
- //# sourceMappingURL=cmat-components-carousel.mjs.map
1124
+
1125
+ //# sourceMappingURL=cmat-components-carousel.mjs.map