cmat 0.0.86 → 0.0.88

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 (228) hide show
  1. package/fesm2022/cmat-components-adapter.mjs +9 -9
  2. package/fesm2022/cmat-components-adapter.mjs.map +1 -1
  3. package/fesm2022/cmat-components-breadcrumb.mjs +98 -80
  4. package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
  5. package/fesm2022/cmat-components-card.mjs +26 -34
  6. package/fesm2022/cmat-components-card.mjs.map +1 -1
  7. package/fesm2022/cmat-components-carousel.mjs +467 -556
  8. package/fesm2022/cmat-components-carousel.mjs.map +1 -1
  9. package/fesm2022/cmat-components-cascade.mjs +270 -259
  10. package/fesm2022/cmat-components-cascade.mjs.map +1 -1
  11. package/fesm2022/cmat-components-chip-input.mjs +200 -116
  12. package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
  13. package/fesm2022/cmat-components-code-editor.mjs +85 -38
  14. package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
  15. package/fesm2022/cmat-components-color-picker.mjs +841 -0
  16. package/fesm2022/cmat-components-color-picker.mjs.map +1 -0
  17. package/fesm2022/cmat-components-custom-formly.mjs +1395 -838
  18. package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
  19. package/fesm2022/cmat-components-data-picker.mjs +996 -0
  20. package/fesm2022/cmat-components-data-picker.mjs.map +1 -0
  21. package/fesm2022/cmat-components-date-range.mjs +310 -264
  22. package/fesm2022/cmat-components-date-range.mjs.map +1 -1
  23. package/fesm2022/cmat-components-date-time-display.mjs +16 -20
  24. package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
  25. package/fesm2022/cmat-components-drawer.mjs +120 -137
  26. package/fesm2022/cmat-components-drawer.mjs.map +1 -1
  27. package/fesm2022/cmat-components-empty-state.mjs +17 -24
  28. package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
  29. package/fesm2022/cmat-components-file-preview.mjs +18 -24
  30. package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
  31. package/fesm2022/cmat-components-filter-toolbar.mjs +30 -39
  32. package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
  33. package/fesm2022/cmat-components-form-actions.mjs +12 -12
  34. package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
  35. package/fesm2022/cmat-components-fullscreen.mjs +10 -10
  36. package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
  37. package/fesm2022/cmat-components-highlight.mjs +48 -41
  38. package/fesm2022/cmat-components-highlight.mjs.map +1 -1
  39. package/fesm2022/cmat-components-image-viewer.mjs +104 -107
  40. package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
  41. package/fesm2022/cmat-components-inline-loading.mjs +12 -15
  42. package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
  43. package/fesm2022/cmat-components-json-editor.mjs +118 -75
  44. package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
  45. package/fesm2022/cmat-components-knob-input.mjs +196 -178
  46. package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
  47. package/fesm2022/cmat-components-masonry.mjs +26 -41
  48. package/fesm2022/cmat-components-masonry.mjs.map +1 -1
  49. package/fesm2022/cmat-components-material-color-picker.mjs +81 -80
  50. package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
  51. package/fesm2022/cmat-components-material-datetimepicker.mjs +1212 -1287
  52. package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
  53. package/fesm2022/cmat-components-navigation.mjs +467 -450
  54. package/fesm2022/cmat-components-navigation.mjs.map +1 -1
  55. package/fesm2022/cmat-components-opt-input.mjs +143 -132
  56. package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
  57. package/fesm2022/cmat-components-org-chart.mjs +68 -83
  58. package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
  59. package/fesm2022/cmat-components-page-header.mjs +18 -24
  60. package/fesm2022/cmat-components-page-header.mjs.map +1 -1
  61. package/fesm2022/cmat-components-pagination.mjs +220 -136
  62. package/fesm2022/cmat-components-pagination.mjs.map +1 -1
  63. package/fesm2022/cmat-components-password-strength.mjs +262 -215
  64. package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
  65. package/fesm2022/cmat-components-popover.mjs +227 -195
  66. package/fesm2022/cmat-components-popover.mjs.map +1 -1
  67. package/fesm2022/cmat-components-progress-bar.mjs +15 -34
  68. package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
  69. package/fesm2022/cmat-components-qrcode.mjs +95 -88
  70. package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
  71. package/fesm2022/cmat-components-rating.mjs +70 -67
  72. package/fesm2022/cmat-components-rating.mjs.map +1 -1
  73. package/fesm2022/cmat-components-rich-text-editor.mjs +23 -26
  74. package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
  75. package/fesm2022/cmat-components-select-search.mjs +190 -159
  76. package/fesm2022/cmat-components-select-search.mjs.map +1 -1
  77. package/fesm2022/cmat-components-select-table.mjs +276 -213
  78. package/fesm2022/cmat-components-select-table.mjs.map +1 -1
  79. package/fesm2022/cmat-components-select-tree.mjs +178 -128
  80. package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
  81. package/fesm2022/cmat-components-skeleton.mjs +44 -28
  82. package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
  83. package/fesm2022/cmat-components-speed-dial.mjs +107 -163
  84. package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
  85. package/fesm2022/cmat-components-status-tag.mjs +29 -36
  86. package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
  87. package/fesm2022/cmat-components-table-toolbar.mjs +14 -18
  88. package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
  89. package/fesm2022/cmat-components-timeline.mjs +111 -118
  90. package/fesm2022/cmat-components-timeline.mjs.map +1 -1
  91. package/fesm2022/cmat-components-toast.mjs +65 -66
  92. package/fesm2022/cmat-components-toast.mjs.map +1 -1
  93. package/fesm2022/cmat-components-transfer-picker.mjs +130 -160
  94. package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
  95. package/fesm2022/cmat-components-treetable.mjs +32 -39
  96. package/fesm2022/cmat-components-treetable.mjs.map +1 -1
  97. package/fesm2022/cmat-components-upload.mjs +186 -176
  98. package/fesm2022/cmat-components-upload.mjs.map +1 -1
  99. package/fesm2022/cmat-directives-animate-on-scroll.mjs +25 -28
  100. package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
  101. package/fesm2022/cmat-directives-arrow-cursor.mjs +85 -92
  102. package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
  103. package/fesm2022/cmat-directives-autofocus.mjs +3 -3
  104. package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
  105. package/fesm2022/cmat-directives-data-exporter.mjs +49 -50
  106. package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
  107. package/fesm2022/cmat-directives-debounce.mjs +16 -19
  108. package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
  109. package/fesm2022/cmat-directives-digit-only.mjs +60 -69
  110. package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
  111. package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
  112. package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
  113. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +31 -30
  114. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
  115. package/fesm2022/cmat-lib-mock-api.mjs +6 -6
  116. package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
  117. package/fesm2022/cmat-pipes-bytes.mjs +3 -3
  118. package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
  119. package/fesm2022/cmat-pipes-date-format.mjs +3 -3
  120. package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
  121. package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
  122. package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
  123. package/fesm2022/cmat-pipes-group-by.mjs +3 -3
  124. package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
  125. package/fesm2022/cmat-pipes-keys.mjs +3 -3
  126. package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
  127. package/fesm2022/cmat-pipes-secure.mjs +7 -13
  128. package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
  129. package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
  130. package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
  131. package/fesm2022/cmat-services-alert.mjs +26 -27
  132. package/fesm2022/cmat-services-alert.mjs.map +1 -1
  133. package/fesm2022/cmat-services-config.mjs +14 -23
  134. package/fesm2022/cmat-services-config.mjs.map +1 -1
  135. package/fesm2022/cmat-services-confirmation.mjs +8 -8
  136. package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
  137. package/fesm2022/cmat-services-data.mjs +6 -10
  138. package/fesm2022/cmat-services-data.mjs.map +1 -1
  139. package/fesm2022/cmat-services-export-as.mjs +3 -3
  140. package/fesm2022/cmat-services-export-as.mjs.map +1 -1
  141. package/fesm2022/cmat-services-loading.mjs +30 -47
  142. package/fesm2022/cmat-services-loading.mjs.map +1 -1
  143. package/fesm2022/cmat-services-local-storage.mjs +3 -3
  144. package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
  145. package/fesm2022/cmat-services-media-watcher.mjs +43 -34
  146. package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
  147. package/fesm2022/cmat-services-platform.mjs +3 -3
  148. package/fesm2022/cmat-services-platform.mjs.map +1 -1
  149. package/fesm2022/cmat-services-splash-screen.mjs +3 -3
  150. package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
  151. package/fesm2022/cmat-services-title.mjs +3 -3
  152. package/fesm2022/cmat-services-title.mjs.map +1 -1
  153. package/fesm2022/cmat-services-translation.mjs +11 -11
  154. package/fesm2022/cmat-services-translation.mjs.map +1 -1
  155. package/fesm2022/cmat-services-utils.mjs +4 -4
  156. package/fesm2022/cmat-services-utils.mjs.map +1 -1
  157. package/fesm2022/cmat.mjs +9229 -7508
  158. package/fesm2022/cmat.mjs.map +1 -1
  159. package/icons/material-icons/heroicons-outline.svg +3 -0
  160. package/icons/material-icons/heroicons-solid.svg +3 -0
  161. package/package.json +10 -1
  162. package/styles/components/bundle.scss +21 -0
  163. package/styles/overrides/angular-material.scss +22 -1
  164. package/tailwind/plugins/theming.js +183 -183
  165. package/types/cmat-components-breadcrumb.d.ts +40 -37
  166. package/types/cmat-components-card.d.ts +11 -13
  167. package/types/cmat-components-carousel.d.ts +87 -113
  168. package/types/cmat-components-cascade.d.ts +84 -65
  169. package/types/cmat-components-chip-input.d.ts +29 -24
  170. package/types/cmat-components-code-editor.d.ts +28 -12
  171. package/types/cmat-components-color-picker.d.ts +236 -0
  172. package/types/cmat-components-custom-formly.d.ts +316 -184
  173. package/types/cmat-components-data-picker.d.ts +372 -0
  174. package/types/cmat-components-date-range.d.ts +31 -36
  175. package/types/cmat-components-date-time-display.d.ts +8 -8
  176. package/types/cmat-components-drawer.d.ts +30 -32
  177. package/types/cmat-components-empty-state.d.ts +9 -10
  178. package/types/cmat-components-file-preview.d.ts +9 -9
  179. package/types/cmat-components-filter-toolbar.d.ts +15 -15
  180. package/types/cmat-components-form-actions.d.ts +5 -5
  181. package/types/cmat-components-fullscreen.d.ts +5 -5
  182. package/types/cmat-components-highlight.d.ts +13 -14
  183. package/types/cmat-components-image-viewer.d.ts +29 -33
  184. package/types/cmat-components-inline-loading.d.ts +6 -6
  185. package/types/cmat-components-json-editor.d.ts +15 -17
  186. package/types/cmat-components-knob-input.d.ts +58 -55
  187. package/types/cmat-components-masonry.d.ts +9 -12
  188. package/types/cmat-components-material-color-picker.d.ts +16 -21
  189. package/types/cmat-components-material-datetimepicker.d.ts +174 -216
  190. package/types/cmat-components-navigation.d.ts +34 -39
  191. package/types/cmat-components-opt-input.d.ts +35 -33
  192. package/types/cmat-components-org-chart.d.ts +8 -9
  193. package/types/cmat-components-page-header.d.ts +9 -9
  194. package/types/cmat-components-pagination.d.ts +36 -40
  195. package/types/cmat-components-password-strength.d.ts +58 -64
  196. package/types/cmat-components-popover.d.ts +22 -32
  197. package/types/cmat-components-progress-bar.d.ts +7 -10
  198. package/types/cmat-components-qrcode.d.ts +22 -22
  199. package/types/cmat-components-rating.d.ts +17 -19
  200. package/types/cmat-components-rich-text-editor.d.ts +11 -12
  201. package/types/cmat-components-select-search.d.ts +48 -36
  202. package/types/cmat-components-select-table.d.ts +38 -34
  203. package/types/cmat-components-select-tree.d.ts +17 -15
  204. package/types/cmat-components-skeleton.d.ts +27 -10
  205. package/types/cmat-components-speed-dial.d.ts +24 -33
  206. package/types/cmat-components-status-tag.d.ts +19 -9
  207. package/types/cmat-components-table-toolbar.d.ts +7 -7
  208. package/types/cmat-components-timeline.d.ts +33 -34
  209. package/types/cmat-components-toast.d.ts +26 -30
  210. package/types/cmat-components-transfer-picker.d.ts +51 -56
  211. package/types/cmat-components-treetable.d.ts +12 -13
  212. package/types/cmat-components-upload.d.ts +33 -38
  213. package/types/cmat-components-x6-angular-shape.d.ts +1 -1
  214. package/types/cmat-directives-animate-on-scroll.d.ts +7 -7
  215. package/types/cmat-directives-arrow-cursor.d.ts +18 -20
  216. package/types/cmat-directives-data-exporter.d.ts +10 -10
  217. package/types/cmat-directives-debounce.d.ts +5 -5
  218. package/types/cmat-directives-digit-only.d.ts +13 -13
  219. package/types/cmat-directives-seamless-auto-scroll.d.ts +7 -7
  220. package/types/cmat-pipes-secure.d.ts +1 -3
  221. package/types/cmat-services-alert.d.ts +11 -12
  222. package/types/cmat-services-config.d.ts +2 -7
  223. package/types/cmat-services-confirmation.d.ts +2 -2
  224. package/types/cmat-services-data.d.ts +0 -1
  225. package/types/cmat-services-loading.d.ts +14 -22
  226. package/types/cmat-services-media-watcher.d.ts +5 -5
  227. package/types/cmat-services-translation.d.ts +4 -5
  228. package/types/cmat.d.ts +2167 -1746
@@ -1,409 +1,291 @@
1
1
  import * as i3 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { Component, inject, TemplateRef, Input, Directive, ElementRef, NgZone, signal, Renderer2, DOCUMENT, EventEmitter, numberAttribute, booleanAttribute, ContentChildren, ContentChild, ViewChild, Output, ViewEncapsulation, ChangeDetectionStrategy } 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
5
  import * as i2 from '@angular/material/button';
6
6
  import { MatButtonModule } from '@angular/material/button';
7
7
  import * as i1 from '@angular/material/icon';
8
8
  import { MatIconModule } from '@angular/material/icon';
9
9
  import { CmatArrowCursorDirective } from 'cmat/directives/arrow-cursor';
10
10
 
11
- /* eslint-disable @typescript-eslint/member-ordering */
12
11
  class CmatCarouselHeaderComponent {
13
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CmatCarouselHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
14
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.10", type: CmatCarouselHeaderComponent, isStandalone: true, selector: "cmat-carousel-header", ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCarouselHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.2", type: CmatCarouselHeaderComponent, isStandalone: true, selector: "cmat-carousel-header", ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
15
14
  }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CmatCarouselHeaderComponent, decorators: [{
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCarouselHeaderComponent, decorators: [{
17
16
  type: Component,
18
17
  args: [{
19
18
  selector: 'cmat-carousel-header',
20
- template: '<ng-content></ng-content>'
19
+ template: '<ng-content></ng-content>',
21
20
  }]
22
21
  }] });
23
22
  class CmatCarouselFooterComponent {
24
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CmatCarouselFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
25
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.10", type: CmatCarouselFooterComponent, isStandalone: true, selector: "cmat-carousel-footer", ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
23
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCarouselFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
24
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.2", type: CmatCarouselFooterComponent, isStandalone: true, selector: "cmat-carousel-footer", ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
26
25
  }
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CmatCarouselFooterComponent, decorators: [{
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCarouselFooterComponent, decorators: [{
28
27
  type: Component,
29
28
  args: [{
30
29
  selector: 'cmat-carousel-footer',
31
- template: '<ng-content></ng-content>'
30
+ template: '<ng-content></ng-content>',
32
31
  }]
33
32
  }] });
34
33
  class CmatCarouselTemplateDirective {
35
34
  constructor() {
36
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 */ []));
37
40
  }
38
- getType() {
39
- return this.name;
40
- }
41
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CmatCarouselTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
42
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.10", type: CmatCarouselTemplateDirective, isStandalone: true, selector: "[cmatCarouselTemplate]", inputs: { type: "type", name: ["cmatCarouselTemplate", "name"] }, ngImport: i0 }); }
41
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCarouselTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
42
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", 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
43
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CmatCarouselTemplateDirective, decorators: [{
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCarouselTemplateDirective, decorators: [{
45
45
  type: Directive,
46
46
  args: [{
47
- selector: '[cmatCarouselTemplate]'
47
+ selector: '[cmatCarouselTemplate]',
48
48
  }]
49
- }], propDecorators: { type: [{
50
- type: Input
51
- }], name: [{
52
- type: Input,
53
- args: ['cmatCarouselTemplate']
54
- }] } });
49
+ }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] } });
55
50
  let NEXT_ID = 0;
56
51
  class CmatCarouselComponent {
57
- get page() {
58
- return this._page;
59
- }
60
- set page(val) {
61
- if (this.isCreated && val !== this._page) {
62
- if (this.autoplayInterval && this.suspendAutoPlay) {
63
- this._stopAutoplay();
64
- }
65
- if (val > this._page && val <= this.totalDots() - 1) {
66
- this._step(-1, val);
67
- }
68
- else if (val < this._page) {
69
- this._step(1, val);
70
- }
71
- }
72
- this._page = val ?? 0;
73
- }
74
- get numVisible() {
75
- return this._numVisible;
76
- }
77
- set numVisible(val) {
78
- this._numVisible = val;
79
- }
80
- get numScroll() {
81
- return this._numScroll;
82
- }
83
- set numScroll(val) {
84
- this._numScroll = val;
85
- }
86
- get data() {
87
- return this._data;
88
- }
89
- set data(val) {
90
- this._data = val;
91
- }
92
52
  constructor() {
93
53
  this.el = inject(ElementRef);
94
- this.zone = inject(NgZone);
95
- this.refreshVersion = signal(0, ...(ngDevMode ? [{ debugName: "refreshVersion" }] : /* istanbul ignore next */ []));
96
- this.renderer = inject(Renderer2);
97
- this._document = inject(DOCUMENT);
98
- this.orientation = 'horizontal';
99
- this.navigatorsType = 'normal';
100
- this.verticalViewPortHeight = '300px';
101
- this.arrowSelector = '.carousel-arrow-cursor';
102
- this.contentClass = '';
103
- this.indicatorsContentClass = '';
104
- this.indicatorStyleClass = '';
105
- this.circular = false;
106
- this.showIndicators = true;
107
- this.showNavigators = true;
108
- this.suspendAutoPlay = true;
109
- this.autoplayInterval = 0;
110
- this.styleClass = '';
111
- this.pageEvent = new EventEmitter();
112
- this.prevState = {
113
- numScroll: 0,
114
- numVisible: 0,
115
- value: []
116
- };
117
- this.defaultNumScroll = 1;
118
- this.defaultNumVisible = 1;
119
- this.carouselStyle = null;
120
- this.isRemainingItemsAdded = false;
121
- this.animationTimeout = null;
122
- this.translateTimeout = null;
123
- this.remainingItems = 0;
124
- this.startPos = null;
125
- this.documentResizeListener = null;
126
- this.clonedItemsForStarting = [];
127
- this.clonedItemsForFinishing = [];
128
- this.interval = null;
129
- this.swipeThreshold = 20;
130
- this._numVisible = 1;
131
- this._numScroll = 1;
132
- this._oldNumScroll = 0;
133
- this._page = 0;
134
- this.totalShiftedItems = this.page * this.numScroll * -1;
135
- this.window = this._document.defaultView;
136
- }
137
- ngOnChanges(simpleChange) {
138
- if (simpleChange.data) {
139
- if (this.circular && this._data) {
140
- this._setCloneItems();
141
- }
142
- }
143
- if (this.isCreated) {
144
- if (simpleChange.circular) {
145
- if (this.isCircular()) {
146
- this._setCloneItems();
147
- }
148
- }
149
- if (simpleChange.numVisible) {
150
- if (this.responsiveOptions) {
151
- this.defaultNumVisible = this.numVisible;
152
- }
153
- this._createStyle();
154
- this._calculatePosition();
155
- }
156
- if (simpleChange.numScroll) {
157
- if (this.responsiveOptions) {
158
- this.defaultNumScroll = this.numScroll;
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`;
159
140
  }
160
141
  }
161
- if (simpleChange.autoplayInterval) {
162
- this.allowAutoplay = !!this.autoplayInterval;
163
- }
164
- }
165
- this.refreshVersion.update(value => value + 1);
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();
166
209
  }
167
210
  ngAfterContentInit() {
168
- this.id = `cmat-carousel-${NEXT_ID++}`;
169
- this.allowAutoplay = !!this.autoplayInterval;
170
- if (this.circular) {
171
- this._setCloneItems();
172
- }
173
- if (this.responsiveOptions) {
174
- this.defaultNumScroll = this._numScroll;
175
- this.defaultNumVisible = this._numVisible;
176
- }
177
- this._createStyle();
178
211
  this._calculatePosition();
179
- if (this.responsiveOptions) {
212
+ this._createStyle();
213
+ if (this.responsiveOptions()) {
180
214
  this._bindDocumentListeners();
181
215
  }
182
- this.templates?.forEach((item) => {
183
- switch (item.getType()) {
216
+ this.templates()?.forEach((item) => {
217
+ switch (item.name()) {
184
218
  case 'item':
185
- this.itemTemplate = item.template;
219
+ this.itemTemplate.set(item.template);
186
220
  break;
187
221
  case 'header':
188
- this.headerTemplate = item.template;
222
+ this.headerTemplate.set(item.template);
189
223
  break;
190
224
  case 'footer':
191
- this.footerTemplate = item.template;
225
+ this.footerTemplate.set(item.template);
192
226
  break;
193
227
  case 'previousicon':
194
- this.previousIconTemplate = item.template;
228
+ this.previousIconTemplate.set(item.template);
195
229
  break;
196
230
  case 'nexticon':
197
- this.nextIconTemplate = item.template;
231
+ this.nextIconTemplate.set(item.template);
198
232
  break;
199
233
  default:
200
- this.itemTemplate = item.template;
234
+ this.itemTemplate.set(item.template);
201
235
  break;
202
236
  }
203
237
  });
204
- this.refreshVersion.update(value => value + 1);
205
- }
206
- ngAfterContentChecked() {
207
- const isCircular = this.isCircular();
208
- let totalShiftedItems = this.totalShiftedItems;
209
- if (this.data && this.itemsContainer && (this.prevState.numScroll !== this._numScroll || this.prevState.numVisible !== this._numVisible || this.prevState.value.length !== this.data.length)) {
210
- if (this.autoplayInterval) {
211
- this._stopAutoplay(false);
212
- }
213
- this.remainingItems = (this.data.length - this._numVisible) % this._numScroll;
214
- let page = this._page;
215
- if (this.totalDots() !== 0 && page >= this.totalDots()) {
216
- page = this.totalDots() - 1;
217
- this._page = page ?? 0;
218
- this.pageEvent.emit({
219
- page: this.page
220
- });
221
- }
222
- totalShiftedItems = page * this._numScroll * -1;
223
- if (isCircular) {
224
- totalShiftedItems -= this._numVisible;
225
- }
226
- if (page === this.totalDots() - 1 && this.remainingItems > 0) {
227
- totalShiftedItems += -1 * this.remainingItems + this._numScroll;
228
- this.isRemainingItemsAdded = true;
229
- }
230
- else {
231
- this.isRemainingItemsAdded = false;
232
- }
233
- if (totalShiftedItems !== this.totalShiftedItems) {
234
- this.totalShiftedItems = totalShiftedItems;
235
- }
236
- this._oldNumScroll = this._numScroll;
237
- this.prevState.numScroll = this._numScroll;
238
- this.prevState.numVisible = this._numVisible;
239
- this.prevState.value = [...(this._data)];
240
- if (this.totalDots() > 0 && this.itemsContainer.nativeElement) {
241
- this.itemsContainer.nativeElement.style.transform = this.isVertical() ? `translate3d(0, ${totalShiftedItems * (100 / this._numVisible)}%, 0)` : `translate3d(${totalShiftedItems * (100 / this._numVisible)}%, 0, 0)`;
242
- }
243
- this.isCreated = true;
244
- if (this.autoplayInterval && this.isAutoplay()) {
245
- this._startAutoplay();
246
- }
247
- }
248
- if (isCircular) {
249
- if (this.page === 0) {
250
- totalShiftedItems = -1 * this._numVisible;
251
- }
252
- else if (totalShiftedItems === 0) {
253
- totalShiftedItems = -1 * this.data.length;
254
- if (this.remainingItems > 0) {
255
- this.isRemainingItemsAdded = true;
256
- }
257
- }
258
- if (totalShiftedItems !== this.totalShiftedItems) {
259
- this.totalShiftedItems = totalShiftedItems;
260
- }
261
- }
262
238
  }
263
239
  ngOnDestroy() {
264
- if (this.responsiveOptions) {
265
- this._unbindDocumentListeners();
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);
266
247
  }
267
- this._stopAutoplay();
268
- if (this.animationTimeout !== null) {
269
- clearTimeout(this.animationTimeout);
270
- this.animationTimeout = null;
271
- }
272
- if (this.translateTimeout !== null) {
273
- clearTimeout(this.translateTimeout);
274
- this.translateTimeout = null;
275
- }
276
- if (this.carouselStyle?.parentNode) {
277
- this.carouselStyle.parentNode.removeChild(this.carouselStyle);
278
- this.carouselStyle = null;
279
- }
280
- }
281
- firstIndex() {
282
- return this.isCircular() ? -1 * (this.totalShiftedItems + this.numVisible) : this.totalShiftedItems * -1;
283
- }
284
- lastIndex() {
285
- return this.firstIndex() + this.numVisible - 1;
286
- }
287
- totalDots() {
288
- if (this._numVisible > 0 && this._numScroll > 0)
289
- return this.data?.length ? Math.ceil((this.data.length - this._numVisible) / this._numScroll) + 1 : 0;
290
- return 0;
291
- }
292
- totalDotsArray() {
293
- const totalDots = this.totalDots();
294
- return totalDots <= 0 ? [] : Array(totalDots).fill(0);
295
- }
296
- isVertical() {
297
- return this.orientation === 'vertical';
298
- }
299
- isCircular() {
300
- return this.circular && this.data && this.data.length >= this.numVisible;
301
- }
302
- isAutoplay() {
303
- if (this.autoplayInterval) {
304
- return this.allowAutoplay;
305
- }
306
- return false;
307
- }
308
- isForwardNavDisabled() {
309
- return this.isEmpty() || (this._page >= this.totalDots() - 1 && !this.isCircular());
310
- }
311
- isBackwardNavDisabled() {
312
- return this.isEmpty() || (this._page <= 0 && !this.isCircular());
313
- }
314
- isEmpty() {
315
- return !this.data || this.data.length === 0;
316
248
  }
317
249
  navForward(e, index) {
318
- if (this.isCircular() || this._page < this.totalDots() - 1) {
250
+ if (this.isCircular() || this.page() < this.totalDots() - 1) {
319
251
  this._step(-1, index);
320
252
  }
321
- if (this.autoplayInterval && this.suspendAutoPlay) {
322
- this._stopAutoplay();
323
- }
324
- if (e?.cancelable) {
325
- e.preventDefault();
326
- }
253
+ this._handleInteractionStopAutoplay();
254
+ e?.cancelable && e.preventDefault();
327
255
  }
328
256
  navBackward(e, index) {
329
- if (this.isCircular() || this._page !== 0) {
257
+ if (this.isCircular() || this.page() !== 0) {
330
258
  this._step(1, index);
331
259
  }
332
- if (this.autoplayInterval && this.suspendAutoPlay) {
333
- this._stopAutoplay();
334
- }
335
- if (e?.cancelable) {
336
- e.preventDefault();
337
- }
260
+ this._handleInteractionStopAutoplay();
261
+ e?.cancelable && e.preventDefault();
338
262
  }
339
263
  onDotClick(e, index) {
340
- let page = this._page;
341
- if (this.autoplayInterval && this.suspendAutoPlay) {
342
- this._stopAutoplay();
343
- }
344
- if (index > page) {
264
+ this._handleInteractionStopAutoplay();
265
+ const currentPage = this.page();
266
+ if (index > currentPage) {
345
267
  this.navForward(e, index);
346
268
  }
347
- else if (index < page) {
269
+ else if (index < currentPage) {
348
270
  this.navBackward(e, index);
349
271
  }
350
272
  }
351
- onIndicatorKeydown(event) {
352
- switch (event.code) {
353
- case 'ArrowRight':
354
- this._onRightKey();
355
- break;
356
- case 'ArrowLeft':
357
- this._onLeftKey();
358
- break;
359
- case 'Home': {
360
- this._onHomeKey();
361
- break;
362
- }
363
- case 'End': {
364
- this._onEndKey();
365
- break;
366
- }
367
- case 'Tab': {
368
- this._onTabKey();
369
- break;
370
- }
371
- }
372
- }
373
- isPlaying() {
374
- return !!this.interval;
375
- }
376
- onTransitionEnd() {
377
- if (this.itemsContainer) {
378
- this.itemsContainer.nativeElement.style.transition = '';
379
- if ((this.page === 0 || this.page === this.totalDots() - 1) && this.isCircular()) {
380
- this.itemsContainer.nativeElement.style.transform = this.isVertical() ? `translate3d(0, ${this.totalShiftedItems * (100 / this._numVisible)}%, 0)` : `translate3d(${this.totalShiftedItems * (100 / this._numVisible)}%, 0, 0)`;
381
- }
382
- }
383
- }
384
273
  onTouchStart(e) {
385
- let touchobj = e.changedTouches[0];
386
- this.startPos = {
387
- x: touchobj.pageX,
388
- y: touchobj.pageY
389
- };
274
+ const touchobj = e.changedTouches[0];
275
+ this.startPos.set({ x: touchobj.pageX, y: touchobj.pageY });
390
276
  }
391
277
  onTouchMove(e) {
392
- if (e.cancelable) {
393
- e.preventDefault();
394
- }
278
+ e.cancelable && e.preventDefault();
395
279
  }
396
280
  onTouchEnd(e) {
397
- let touchobj = e.changedTouches[0];
398
- if (!this.startPos) {
281
+ const touchobj = e.changedTouches[0];
282
+ const start = this.startPos();
283
+ if (!start)
399
284
  return;
400
- }
401
- if (this.isVertical()) {
402
- this._changePageOnTouch(e, touchobj.pageY - this.startPos.y);
403
- }
404
- else {
405
- this._changePageOnTouch(e, touchobj.pageX - this.startPos.x);
406
- }
285
+ const diff = this.isVertical()
286
+ ? touchobj.pageY - start.y
287
+ : touchobj.pageX - start.x;
288
+ this._changePageOnTouch(e, diff);
407
289
  }
408
290
  arrowCursorClick(cursorSide) {
409
291
  switch (cursorSide) {
@@ -417,162 +299,194 @@ class CmatCarouselComponent {
417
299
  break;
418
300
  }
419
301
  }
420
- _changePageOnTouch(e, diff) {
421
- if (Math.abs(diff) > this.swipeThreshold) {
422
- if (diff < 0) {
423
- this.navForward(e);
424
- }
425
- else {
426
- this.navBackward(e);
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());
427
307
  }
428
308
  }
429
309
  }
430
- _bindDocumentListeners() {
431
- this.documentResizeListener ??= this.renderer.listen(this.window, 'resize', () => {
432
- this._calculatePosition();
433
- });
310
+ stopAutoplay() {
311
+ this.isUserInteracted.set(true);
434
312
  }
435
- _unbindDocumentListeners() {
436
- if (this.documentResizeListener) {
437
- this.documentResizeListener();
438
- this.documentResizeListener = null;
439
- }
313
+ startAutoplay() {
314
+ this.isUserInteracted.set(false);
440
315
  }
441
- _onRightKey() {
442
- const indicators = [...Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]') ?? [])];
443
- const activeIndex = this._findFocusedIndicatorIndex();
444
- this._changedFocusedIndicator(activeIndex, activeIndex + 1 === indicators.length ? indicators.length - 1 : activeIndex + 1);
316
+ isFirstItemActive(index) {
317
+ return index === this.firstIndex();
445
318
  }
446
- _onLeftKey() {
447
- const activeIndex = this._findFocusedIndicatorIndex();
448
- this._changedFocusedIndicator(activeIndex, activeIndex - 1 <= 0 ? 0 : activeIndex - 1);
319
+ isLastItemActive(index) {
320
+ return index === this.lastIndex();
449
321
  }
450
- _onHomeKey() {
451
- const activeIndex = this._findFocusedIndicatorIndex();
452
- this._changedFocusedIndicator(activeIndex, 0);
322
+ isMiddleItemActive(index) {
323
+ const first = this.firstIndex();
324
+ const last = this.lastIndex();
325
+ return index > first && index < last;
453
326
  }
454
- _onEndKey() {
455
- const indicators = [...Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]') ?? [])];
456
- const activeIndex = this._findFocusedIndicatorIndex();
457
- this._changedFocusedIndicator(activeIndex, indicators.length - 1);
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
+ }
458
345
  }
459
- _onTabKey() {
460
- const indicators = Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]') ?? []);
461
- const highlightedIndex = indicators.findIndex((ind) => ind.getAttribute('cmat-carousel-highlight') !== undefined);
462
- const activeIndicator = this.indicatorContent?.nativeElement ? this.indicatorContent?.nativeElement.querySelector('[data-pc-section="indicator"] > button[tabindex="0"]') : null;
463
- const activeIndex = indicators.findIndex((ind) => ind === activeIndicator?.parentElement);
464
- indicators[activeIndex]?.children[0] && (indicators[activeIndex].children[0].tabIndex = -1);
465
- indicators[highlightedIndex]?.children[0] && (indicators[highlightedIndex].children[0].tabIndex = 0);
346
+ _handleInteractionStopAutoplay() {
347
+ if (this.autoplayInterval() && this.suspendAutoPlay()) {
348
+ this.stopAutoplay();
349
+ }
466
350
  }
467
- _changedFocusedIndicator(prevInd, nextInd) {
468
- const indicators = Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]') ?? []);
469
- indicators[prevInd]?.children[0] && (indicators[prevInd].children[0].tabIndex = -1);
470
- indicators[nextInd]?.children[0] && (indicators[nextInd].children[0].tabIndex = 0);
471
- indicators[nextInd]?.children[0]?.focus();
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
+ }
472
360
  }
473
361
  _step(dir, page) {
474
- let totalShiftedItems = this.totalShiftedItems;
362
+ let totalShiftedItems = this.totalShiftedItems();
475
363
  const isCircular = this.isCircular();
364
+ let nextPage;
476
365
  if (page != null) {
477
- totalShiftedItems = this._numScroll * page * -1;
366
+ totalShiftedItems = this.numScroll() * page * -1;
478
367
  if (isCircular) {
479
- totalShiftedItems -= this._numVisible;
368
+ totalShiftedItems -= this.numVisible();
480
369
  }
481
- this.isRemainingItemsAdded = false;
370
+ nextPage = page;
482
371
  }
483
372
  else {
484
- totalShiftedItems += this._numScroll * dir;
485
- if (this.isRemainingItemsAdded) {
486
- totalShiftedItems += this.remainingItems - this._numScroll * dir;
487
- this.isRemainingItemsAdded = false;
373
+ totalShiftedItems += this.numScroll() * dir;
374
+ if (this.isRemainingItemsAdded()) {
375
+ totalShiftedItems += this.remainingItems() - this.numScroll() * dir;
488
376
  }
489
- let originalShiftedItems = isCircular ? totalShiftedItems + this._numVisible : totalShiftedItems;
490
- page = Math.abs(Math.floor(originalShiftedItems / this._numScroll));
377
+ const originalShiftedItems = isCircular ? totalShiftedItems + this.numVisible() : totalShiftedItems;
378
+ nextPage = Math.abs(Math.floor(originalShiftedItems / this.numScroll()));
491
379
  }
492
- if (isCircular && this.page === this.totalDots() - 1 && dir === -1) {
493
- totalShiftedItems = -1 * (this.data.length + this._numVisible);
494
- page = 0;
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;
495
386
  }
496
- else if (isCircular && this.page === 0 && dir === 1) {
387
+ else if (isCircular && this.page() === 0 && dir === 1) {
497
388
  totalShiftedItems = 0;
498
- page = this.totalDots() - 1;
499
- }
500
- else if (page === this.totalDots() - 1 && this.remainingItems > 0) {
501
- totalShiftedItems += this.remainingItems * -1 - this._numScroll * dir;
502
- this.isRemainingItemsAdded = true;
389
+ nextPage = this.totalDots() - 1;
503
390
  }
504
- if (this.itemsContainer) {
505
- this.itemsContainer.nativeElement.style.transform = this.isVertical() ? `translate3d(0, ${totalShiftedItems * (100 / this._numVisible)}%, 0)` : `translate3d(${totalShiftedItems * (100 / this._numVisible)}%, 0, 0)`;
506
- this.itemsContainer.nativeElement.style.transition = 'transform 500ms ease 0s';
391
+ else if (nextPage === this.totalDots() - 1 && this.remainingItems() > 0) {
392
+ totalShiftedItems += this.remainingItems() * -1 - this.numScroll() * dir;
507
393
  }
508
- this.totalShiftedItems = totalShiftedItems;
509
- this._page = page ?? 0;
510
- this.pageEvent.emit({
511
- page: this.page
512
- });
513
- this.refreshVersion.update(value => value + 1);
394
+ this._applyTransform(totalShiftedItems, true);
395
+ this.page.set(nextPage);
396
+ this.pageEvent.emit({ page: this.page() });
514
397
  this._updateCarouselItemsAccessibility();
515
398
  }
516
- _startAutoplay() {
517
- if (this.interval !== null) {
399
+ _applyTransform(shiftedItems, withTransition = false) {
400
+ if (!this.itemsContainer())
518
401
  return;
519
- }
520
- this.interval = window.setInterval(() => {
521
- if (this.totalDots() > 0) {
522
- if (this.page === this.totalDots() - 1) {
523
- this._step(-1, 0);
524
- }
525
- else {
526
- this._step(-1, this.page + 1);
527
- }
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();
528
420
  }
529
- }, this.autoplayInterval);
530
- this.allowAutoplay = true;
531
- this.refreshVersion.update(value => value + 1);
532
- }
533
- _stopAutoplay(changeAllow = true) {
534
- if (this.interval !== null) {
535
- clearInterval(this.interval);
536
- this.interval = null;
537
- if (changeAllow) {
538
- this.allowAutoplay = false;
421
+ else {
422
+ this._unbindDocumentListeners();
539
423
  }
540
- }
541
- this.refreshVersion.update(value => value + 1);
424
+ });
542
425
  }
543
- _findFocusedIndicatorIndex() {
544
- const indicators = Array.from(this.indicatorContent?.nativeElement.querySelectorAll('[data-pc-section="indicator"]') ?? []);
545
- const activeIndicator = this.indicatorContent?.nativeElement ? this.indicatorContent?.nativeElement.querySelector('[data-pc-section="indicator"] > button[tabindex="0"]') : null;
546
- return indicators.findIndex((ind) => ind === activeIndicator?.parentElement);
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
+ }
547
471
  }
548
472
  _createStyle() {
549
- if (!this.carouselStyle) {
550
- this.carouselStyle = this.renderer.createElement('style');
551
- this.renderer.appendChild(this._document.head, this.carouselStyle);
473
+ if (!this.carouselStyle()) {
474
+ const styleEl = this.renderer.createElement('style');
475
+ this.carouselStyle.set(styleEl);
476
+ this.renderer.appendChild(this._document.head, styleEl);
552
477
  }
553
478
  let innerHTML = `
554
479
  #${this.id} .cmat-carousel-item {
555
- flex: 1 0 ${100 / this.numVisible}%
556
- }
480
+ flex: 1 0 ${100 / this.numVisible()}%
481
+ }
557
482
  `;
558
- if (this.responsiveOptions) {
559
- this.responsiveOptions.sort((data1, data2) => {
560
- const value1 = data1.breakpoint;
561
- const value2 = data2.breakpoint;
562
- let result;
563
- if (value1 === null && value2 !== null)
564
- result = -1;
565
- else if (value1 !== null && value2 === null)
566
- result = 1;
567
- else if (value1 === null && value2 === null)
568
- result = 0;
569
- else if (typeof value1 === 'string' && typeof value2 === 'string')
570
- result = value1.localeCompare(value2, undefined, { numeric: true });
571
- else
572
- result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
573
- return -1 * result;
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
574
488
  });
575
- for (const res of this.responsiveOptions) {
489
+ for (const res of sortedOptions) {
576
490
  innerHTML += `
577
491
  @media screen and (max-width: ${res.breakpoint}) {
578
492
  #${this.id} .cmat-carousel-item {
@@ -582,138 +496,135 @@ class CmatCarouselComponent {
582
496
  `;
583
497
  }
584
498
  }
585
- if (this.carouselStyle) {
586
- this.renderer.setProperty(this.carouselStyle, 'textContent', innerHTML);
499
+ if (this.carouselStyle()) {
500
+ this.renderer.setProperty(this.carouselStyle(), 'textContent', innerHTML);
587
501
  }
588
502
  }
589
503
  _calculatePosition() {
590
- if (this.responsiveOptions) {
591
- let matchedResponsiveData = {
592
- numVisible: this.defaultNumVisible,
593
- numScroll: this.defaultNumScroll
594
- };
595
- if (this.window) {
596
- let windowWidth = this.window.innerWidth;
597
- for (const res of this.responsiveOptions) {
598
- if (parseInt(res.breakpoint, 10) >= windowWidth) {
599
- matchedResponsiveData = res;
600
- }
601
- }
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;
602
519
  }
603
- if (this._numScroll !== matchedResponsiveData.numScroll) {
604
- let page = this._page;
605
- page = Math.floor((page * this._numScroll) / matchedResponsiveData.numScroll);
606
- let totalShiftedItems = matchedResponsiveData.numScroll * this.page * -1;
607
- if (this.isCircular()) {
608
- totalShiftedItems -= matchedResponsiveData.numVisible;
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);
609
528
  }
610
- this.totalShiftedItems = totalShiftedItems;
611
- this._numScroll = matchedResponsiveData.numScroll;
612
- this._page = page;
613
- this.pageEvent.emit({
614
- page: this.page
615
- });
529
+ this.numScroll.set(newNumScroll);
530
+ this.page.set(page);
531
+ this.pageEvent.emit({ page: this.page() });
616
532
  }
617
- if (this._numVisible !== matchedResponsiveData.numVisible) {
618
- this._numVisible = matchedResponsiveData.numVisible;
533
+ if (this.numVisible() !== matchedResponsiveData.numVisible) {
534
+ this.numVisible.set(matchedResponsiveData.numVisible);
619
535
  this._setCloneItems();
620
536
  }
621
- this.refreshVersion.update(value => value + 1);
622
537
  }
623
- }
624
- _updateSlideAccessibility(slide, isActive) {
625
- const focusableElements = slide.querySelectorAll('a, button, input, select, textarea, [tabindex]');
626
- focusableElements.forEach((element) => {
627
- element.tabIndex = isActive ? 0 : -1;
628
- });
538
+ if (matchedResponsiveData) {
539
+ this._createStyle();
540
+ }
629
541
  }
630
542
  _updateCarouselItemsAccessibility() {
631
543
  const slides = this.el.nativeElement.querySelectorAll('.cmat-carousel-item');
632
- slides.forEach((slide, index) => {
633
- const isActive = index === this._page;
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;
634
562
  slide.setAttribute('aria-hidden', !isActive ? 'true' : 'false');
635
- this._updateSlideAccessibility(slide, isActive);
563
+ const focusableElements = slide.querySelectorAll('a, button, input, select, textarea, [tabindex]');
564
+ focusableElements.forEach((el) => {
565
+ el.tabIndex = isActive ? 0 : -1;
566
+ });
636
567
  });
637
568
  }
638
569
  _setCloneItems() {
639
- this.clonedItemsForStarting = [];
640
- this.clonedItemsForFinishing = [];
570
+ this.clonedItemsForStarting.set([]);
571
+ this.clonedItemsForFinishing.set([]);
641
572
  if (this.isCircular()) {
642
- this.clonedItemsForStarting = [...this.data.slice(-1 * this._numVisible)];
643
- this.clonedItemsForFinishing = [...this.data.slice(0, this._numVisible)];
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();
644
593
  }
645
594
  }
646
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CmatCarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
647
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: CmatCarouselComponent, isStandalone: true, selector: "cmat-carousel", inputs: { page: "page", numVisible: "numVisible", numScroll: "numScroll", responsiveOptions: "responsiveOptions", orientation: "orientation", navigatorsType: "navigatorsType", verticalViewPortHeight: "verticalViewPortHeight", arrowSelector: "arrowSelector", contentClass: "contentClass", indicatorsContentClass: "indicatorsContentClass", indicatorsContentStyle: "indicatorsContentStyle", indicatorStyleClass: "indicatorStyleClass", indicatorStyle: "indicatorStyle", data: "data", circular: ["circular", "circular", booleanAttribute], showIndicators: ["showIndicators", "showIndicators", booleanAttribute], showNavigators: ["showNavigators", "showNavigators", booleanAttribute], suspendAutoPlay: ["suspendAutoPlay", "suspendAutoPlay", booleanAttribute], autoplayInterval: ["autoplayInterval", "autoplayInterval", numberAttribute], style: "style", styleClass: "styleClass" }, outputs: { pageEvent: "pageEvent" }, queries: [{ propertyName: "headerFacet", first: true, predicate: CmatCarouselHeaderComponent, descendants: true }, { propertyName: "footerFacet", first: true, predicate: CmatCarouselFooterComponent, descendants: true }, { propertyName: "templates", predicate: CmatCarouselTemplateDirective }], viewQueries: [{ propertyName: "itemsContainer", first: true, predicate: ["itemsContainer"], descendants: true }, { propertyName: "indicatorContent", first: true, predicate: ["indicatorContent"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div role=\"region\" [attr.id]=\"id\" [attr.data-refresh]=\"refreshVersion()\"\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]=\"isBackwardNavDisabled()\" (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\"\r\n [ngStyle]=\"{ height: isVertical() ? verticalViewPortHeight : 'auto' }\" (touchend)=\"onTouchEnd($event)\"\r\n (touchstart)=\"onTouchStart($event)\" (touchmove)=\"onTouchMove($event)\">\r\n <div #itemsContainer class=\"cmat-carousel-items-container\" (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??0 - 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??0 - 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]=\"isForwardNavDisabled()\" (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 totalDotsArray(); 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>\r\n", 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 }); }
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.0.2", ngImport: i0, type: CmatCarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
622
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", 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 }); }
648
623
  }
649
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CmatCarouselComponent, decorators: [{
624
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: CmatCarouselComponent, decorators: [{
650
625
  type: Component,
651
- args: [{ selector: 'cmat-carousel', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [MatIconModule, MatButtonModule, CmatArrowCursorDirective, CommonModule], template: "<div role=\"region\" [attr.id]=\"id\" [attr.data-refresh]=\"refreshVersion()\"\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]=\"isBackwardNavDisabled()\" (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\"\r\n [ngStyle]=\"{ height: isVertical() ? verticalViewPortHeight : 'auto' }\" (touchend)=\"onTouchEnd($event)\"\r\n (touchstart)=\"onTouchStart($event)\" (touchmove)=\"onTouchMove($event)\">\r\n <div #itemsContainer class=\"cmat-carousel-items-container\" (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??0 - 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??0 - 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]=\"isForwardNavDisabled()\" (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 totalDotsArray(); 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>\r\n", 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"] }]
652
- }], ctorParameters: () => [], propDecorators: { page: [{
653
- type: Input
654
- }], numVisible: [{
655
- type: Input
656
- }], numScroll: [{
657
- type: Input
658
- }], responsiveOptions: [{
659
- type: Input
660
- }], orientation: [{
661
- type: Input
662
- }], navigatorsType: [{
663
- type: Input
664
- }], verticalViewPortHeight: [{
665
- type: Input
666
- }], arrowSelector: [{
667
- type: Input
668
- }], contentClass: [{
669
- type: Input
670
- }], indicatorsContentClass: [{
671
- type: Input
672
- }], indicatorsContentStyle: [{
673
- type: Input
674
- }], indicatorStyleClass: [{
675
- type: Input
676
- }], indicatorStyle: [{
677
- type: Input
678
- }], data: [{
679
- type: Input
680
- }], circular: [{
681
- type: Input,
682
- args: [{ transform: booleanAttribute }]
683
- }], showIndicators: [{
684
- type: Input,
685
- args: [{ transform: booleanAttribute }]
686
- }], showNavigators: [{
687
- type: Input,
688
- args: [{ transform: booleanAttribute }]
689
- }], suspendAutoPlay: [{
690
- type: Input,
691
- args: [{ transform: booleanAttribute }]
692
- }], autoplayInterval: [{
693
- type: Input,
694
- args: [{ transform: numberAttribute }]
695
- }], style: [{
696
- type: Input
697
- }], styleClass: [{
698
- type: Input
699
- }], pageEvent: [{
700
- type: Output
701
- }], itemsContainer: [{
702
- type: ViewChild,
703
- args: ['itemsContainer']
704
- }], indicatorContent: [{
705
- type: ViewChild,
706
- args: ['indicatorContent']
707
- }], headerFacet: [{
708
- type: ContentChild,
709
- args: [CmatCarouselHeaderComponent]
710
- }], footerFacet: [{
711
- type: ContentChild,
712
- args: [CmatCarouselFooterComponent]
713
- }], templates: [{
714
- type: ContentChildren,
715
- args: [CmatCarouselTemplateDirective]
716
- }] } });
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 }] }] } });
717
628
 
718
629
  /**
719
630
  * Generated bundle index. Do not edit.