cmat 0.0.110 → 0.0.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/fesm2022/cmat-components-adapter.mjs +531 -536
  2. package/fesm2022/cmat-components-adapter.mjs.map +1 -1
  3. package/fesm2022/cmat-components-breadcrumb.mjs +521 -356
  4. package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
  5. package/fesm2022/cmat-components-card.mjs +150 -42
  6. package/fesm2022/cmat-components-card.mjs.map +1 -1
  7. package/fesm2022/cmat-components-carousel.mjs +1120 -629
  8. package/fesm2022/cmat-components-carousel.mjs.map +1 -1
  9. package/fesm2022/cmat-components-cascade.mjs +861 -441
  10. package/fesm2022/cmat-components-cascade.mjs.map +1 -1
  11. package/fesm2022/cmat-components-chip-input.mjs +580 -335
  12. package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
  13. package/fesm2022/cmat-components-code-editor.mjs +197 -105
  14. package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
  15. package/fesm2022/cmat-components-color-picker.mjs +1762 -825
  16. package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
  17. package/fesm2022/cmat-components-custom-formly.mjs +5196 -2531
  18. package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
  19. package/fesm2022/cmat-components-data-picker.mjs +1901 -1073
  20. package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
  21. package/fesm2022/cmat-components-date-range.mjs +701 -456
  22. package/fesm2022/cmat-components-date-range.mjs.map +1 -1
  23. package/fesm2022/cmat-components-date-time-display.mjs +137 -30
  24. package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
  25. package/fesm2022/cmat-components-drawer.mjs +410 -258
  26. package/fesm2022/cmat-components-drawer.mjs.map +1 -1
  27. package/fesm2022/cmat-components-empty-state.mjs +201 -41
  28. package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
  29. package/fesm2022/cmat-components-file-preview.mjs +198 -35
  30. package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
  31. package/fesm2022/cmat-components-filter-toolbar.mjs +320 -72
  32. package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
  33. package/fesm2022/cmat-components-form-actions.mjs +102 -26
  34. package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
  35. package/fesm2022/cmat-components-fullscreen.mjs +167 -47
  36. package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
  37. package/fesm2022/cmat-components-highlight.mjs +203 -112
  38. package/fesm2022/cmat-components-highlight.mjs.map +1 -1
  39. package/fesm2022/cmat-components-image-viewer.mjs +489 -215
  40. package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
  41. package/fesm2022/cmat-components-inline-loading.mjs +117 -27
  42. package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
  43. package/fesm2022/cmat-components-json-editor.mjs +276 -230
  44. package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
  45. package/fesm2022/cmat-components-knob-input.mjs +615 -420
  46. package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
  47. package/fesm2022/cmat-components-loading-overlay.mjs +53 -25
  48. package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
  49. package/fesm2022/cmat-components-masonry.mjs +120 -40
  50. package/fesm2022/cmat-components-masonry.mjs.map +1 -1
  51. package/fesm2022/cmat-components-material-color-picker.mjs +332 -155
  52. package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
  53. package/fesm2022/cmat-components-material-datetimepicker.mjs +4283 -2504
  54. package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
  55. package/fesm2022/cmat-components-navigation.mjs +3080 -1404
  56. package/fesm2022/cmat-components-navigation.mjs.map +1 -1
  57. package/fesm2022/cmat-components-opt-input.mjs +540 -466
  58. package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
  59. package/fesm2022/cmat-components-org-chart.mjs +528 -125
  60. package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
  61. package/fesm2022/cmat-components-page-header.mjs +141 -32
  62. package/fesm2022/cmat-components-page-header.mjs.map +1 -1
  63. package/fesm2022/cmat-components-pagination.mjs +866 -534
  64. package/fesm2022/cmat-components-pagination.mjs.map +1 -1
  65. package/fesm2022/cmat-components-password-strength.mjs +873 -434
  66. package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
  67. package/fesm2022/cmat-components-popover.mjs +1012 -731
  68. package/fesm2022/cmat-components-popover.mjs.map +1 -1
  69. package/fesm2022/cmat-components-progress-bar.mjs +98 -35
  70. package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
  71. package/fesm2022/cmat-components-qrcode.mjs +463 -287
  72. package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
  73. package/fesm2022/cmat-components-rating.mjs +377 -203
  74. package/fesm2022/cmat-components-rating.mjs.map +1 -1
  75. package/fesm2022/cmat-components-rich-text-editor.mjs +153 -39
  76. package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
  77. package/fesm2022/cmat-components-select-search.mjs +926 -496
  78. package/fesm2022/cmat-components-select-search.mjs.map +1 -1
  79. package/fesm2022/cmat-components-select-table.mjs +1280 -842
  80. package/fesm2022/cmat-components-select-table.mjs.map +1 -1
  81. package/fesm2022/cmat-components-select-tree.mjs +998 -690
  82. package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
  83. package/fesm2022/cmat-components-skeleton.mjs +143 -57
  84. package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
  85. package/fesm2022/cmat-components-speed-dial.mjs +457 -303
  86. package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
  87. package/fesm2022/cmat-components-status-tag.mjs +136 -44
  88. package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
  89. package/fesm2022/cmat-components-table-toolbar.mjs +120 -28
  90. package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
  91. package/fesm2022/cmat-components-timeline.mjs +464 -168
  92. package/fesm2022/cmat-components-timeline.mjs.map +1 -1
  93. package/fesm2022/cmat-components-toast.mjs +346 -262
  94. package/fesm2022/cmat-components-toast.mjs.map +1 -1
  95. package/fesm2022/cmat-components-transfer-picker.mjs +1427 -593
  96. package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
  97. package/fesm2022/cmat-components-treetable.mjs +372 -112
  98. package/fesm2022/cmat-components-treetable.mjs.map +1 -1
  99. package/fesm2022/cmat-components-upload.mjs +904 -410
  100. package/fesm2022/cmat-components-upload.mjs.map +1 -1
  101. package/fesm2022/cmat-components-x6-angular-shape.mjs +153 -170
  102. package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
  103. package/fesm2022/cmat-directives-animate-on-scroll.mjs +220 -138
  104. package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
  105. package/fesm2022/cmat-directives-arrow-cursor.mjs +246 -193
  106. package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
  107. package/fesm2022/cmat-directives-autofocus.mjs +43 -25
  108. package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
  109. package/fesm2022/cmat-directives-data-exporter.mjs +537 -338
  110. package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
  111. package/fesm2022/cmat-directives-debounce.mjs +162 -76
  112. package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
  113. package/fesm2022/cmat-directives-digit-only.mjs +457 -356
  114. package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
  115. package/fesm2022/cmat-directives-equal-validator.mjs +70 -53
  116. package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
  117. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +180 -132
  118. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
  119. package/fesm2022/cmat-lib-mock-api.mjs +207 -195
  120. package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
  121. package/fesm2022/cmat-pipes-bytes.mjs +50 -30
  122. package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
  123. package/fesm2022/cmat-pipes-date-format.mjs +41 -25
  124. package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
  125. package/fesm2022/cmat-pipes-find-by-key.mjs +44 -26
  126. package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
  127. package/fesm2022/cmat-pipes-group-by.mjs +50 -38
  128. package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
  129. package/fesm2022/cmat-pipes-keys.mjs +44 -31
  130. package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
  131. package/fesm2022/cmat-pipes-secure.mjs +60 -49
  132. package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
  133. package/fesm2022/cmat-pipes-uppercase.mjs +39 -22
  134. package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
  135. package/fesm2022/cmat-reports.mjs +2751 -0
  136. package/fesm2022/cmat-reports.mjs.map +1 -0
  137. package/fesm2022/cmat-services-alert.mjs +249 -277
  138. package/fesm2022/cmat-services-alert.mjs.map +1 -1
  139. package/fesm2022/cmat-services-config.mjs +110 -81
  140. package/fesm2022/cmat-services-config.mjs.map +1 -1
  141. package/fesm2022/cmat-services-confirmation.mjs +184 -73
  142. package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
  143. package/fesm2022/cmat-services-data.mjs +136 -125
  144. package/fesm2022/cmat-services-data.mjs.map +1 -1
  145. package/fesm2022/cmat-services-export-as.mjs +165 -183
  146. package/fesm2022/cmat-services-export-as.mjs.map +1 -1
  147. package/fesm2022/cmat-services-loading.mjs +116 -95
  148. package/fesm2022/cmat-services-loading.mjs.map +1 -1
  149. package/fesm2022/cmat-services-local-storage.mjs +75 -66
  150. package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
  151. package/fesm2022/cmat-services-media-watcher.mjs +69 -64
  152. package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
  153. package/fesm2022/cmat-services-platform.mjs +48 -45
  154. package/fesm2022/cmat-services-platform.mjs.map +1 -1
  155. package/fesm2022/cmat-services-print.mjs +985 -669
  156. package/fesm2022/cmat-services-print.mjs.map +1 -1
  157. package/fesm2022/cmat-services-splash-screen.mjs +53 -38
  158. package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
  159. package/fesm2022/cmat-services-title.mjs +57 -47
  160. package/fesm2022/cmat-services-title.mjs.map +1 -1
  161. package/fesm2022/cmat-services-translation.mjs +79 -68
  162. package/fesm2022/cmat-services-translation.mjs.map +1 -1
  163. package/fesm2022/cmat-services-utils.mjs +424 -517
  164. package/fesm2022/cmat-services-utils.mjs.map +1 -1
  165. package/fesm2022/cmat-validators.mjs +23 -33
  166. package/fesm2022/cmat-validators.mjs.map +1 -1
  167. package/fesm2022/cmat-version.mjs +12 -16
  168. package/fesm2022/cmat-version.mjs.map +1 -1
  169. package/fesm2022/cmat.mjs +39806 -22071
  170. package/fesm2022/cmat.mjs.map +1 -1
  171. package/package.json +5 -1
  172. package/types/cmat-components-adapter.d.ts +145 -156
  173. package/types/cmat-components-breadcrumb.d.ts +108 -86
  174. package/types/cmat-components-card.d.ts +34 -18
  175. package/types/cmat-components-carousel.d.ts +251 -134
  176. package/types/cmat-components-cascade.d.ts +158 -117
  177. package/types/cmat-components-chip-input.d.ts +105 -71
  178. package/types/cmat-components-code-editor.d.ts +59 -34
  179. package/types/cmat-components-color-picker.d.ts +378 -236
  180. package/types/cmat-components-custom-formly.d.ts +776 -814
  181. package/types/cmat-components-data-picker.d.ts +502 -360
  182. package/types/cmat-components-date-range.d.ts +106 -77
  183. package/types/cmat-components-date-time-display.d.ts +36 -13
  184. package/types/cmat-components-drawer.d.ts +91 -61
  185. package/types/cmat-components-empty-state.d.ts +47 -17
  186. package/types/cmat-components-file-preview.d.ts +42 -14
  187. package/types/cmat-components-filter-toolbar.d.ts +57 -25
  188. package/types/cmat-components-form-actions.d.ts +18 -10
  189. package/types/cmat-components-fullscreen.d.ts +21 -13
  190. package/types/cmat-components-highlight.d.ts +33 -26
  191. package/types/cmat-components-image-viewer.d.ts +119 -58
  192. package/types/cmat-components-inline-loading.d.ts +24 -11
  193. package/types/cmat-components-json-editor.d.ts +39 -28
  194. package/types/cmat-components-knob-input.d.ts +172 -101
  195. package/types/cmat-components-loading-overlay.d.ts +8 -11
  196. package/types/cmat-components-masonry.d.ts +27 -14
  197. package/types/cmat-components-material-color-picker.d.ts +56 -42
  198. package/types/cmat-components-material-datetimepicker.d.ts +817 -454
  199. package/types/cmat-components-navigation.d.ts +295 -221
  200. package/types/cmat-components-opt-input.d.ts +111 -90
  201. package/types/cmat-components-org-chart.d.ts +53 -35
  202. package/types/cmat-components-page-header.d.ts +37 -14
  203. package/types/cmat-components-pagination.d.ts +144 -107
  204. package/types/cmat-components-password-strength.d.ts +197 -86
  205. package/types/cmat-components-popover.d.ts +264 -166
  206. package/types/cmat-components-progress-bar.d.ts +17 -14
  207. package/types/cmat-components-qrcode.d.ts +111 -42
  208. package/types/cmat-components-rating.d.ts +105 -59
  209. package/types/cmat-components-rich-text-editor.d.ts +39 -16
  210. package/types/cmat-components-select-search.d.ts +195 -99
  211. package/types/cmat-components-select-table.d.ts +241 -142
  212. package/types/cmat-components-select-tree.d.ts +185 -118
  213. package/types/cmat-components-skeleton.d.ts +55 -32
  214. package/types/cmat-components-speed-dial.d.ts +86 -61
  215. package/types/cmat-components-status-tag.d.ts +42 -24
  216. package/types/cmat-components-table-toolbar.d.ts +30 -12
  217. package/types/cmat-components-timeline.d.ts +83 -51
  218. package/types/cmat-components-toast.d.ts +84 -85
  219. package/types/cmat-components-transfer-picker.d.ts +228 -181
  220. package/types/cmat-components-treetable.d.ts +63 -39
  221. package/types/cmat-components-upload.d.ts +205 -106
  222. package/types/cmat-components-x6-angular-shape.d.ts +29 -37
  223. package/types/cmat-directives-animate-on-scroll.d.ts +48 -30
  224. package/types/cmat-directives-arrow-cursor.d.ts +55 -35
  225. package/types/cmat-directives-autofocus.d.ts +8 -11
  226. package/types/cmat-directives-data-exporter.d.ts +71 -40
  227. package/types/cmat-directives-debounce.d.ts +31 -28
  228. package/types/cmat-directives-digit-only.d.ts +90 -53
  229. package/types/cmat-directives-equal-validator.d.ts +11 -14
  230. package/types/cmat-directives-seamless-auto-scroll.d.ts +42 -29
  231. package/types/cmat-lib-mock-api.d.ts +46 -55
  232. package/types/cmat-pipes-bytes.d.ts +7 -10
  233. package/types/cmat-pipes-date-format.d.ts +7 -10
  234. package/types/cmat-pipes-find-by-key.d.ts +8 -12
  235. package/types/cmat-pipes-group-by.d.ts +11 -15
  236. package/types/cmat-pipes-keys.d.ts +10 -13
  237. package/types/cmat-pipes-secure.d.ts +14 -17
  238. package/types/cmat-pipes-uppercase.d.ts +7 -10
  239. package/types/cmat-reports.d.ts +1131 -0
  240. package/types/cmat-services-alert.d.ts +80 -87
  241. package/types/cmat-services-config.d.ts +37 -43
  242. package/types/cmat-services-confirmation.d.ts +31 -37
  243. package/types/cmat-services-data.d.ts +18 -21
  244. package/types/cmat-services-export-as.d.ts +28 -33
  245. package/types/cmat-services-loading.d.ts +27 -31
  246. package/types/cmat-services-local-storage.d.ts +17 -21
  247. package/types/cmat-services-media-watcher.d.ts +14 -18
  248. package/types/cmat-services-platform.d.ts +8 -11
  249. package/types/cmat-services-print.d.ts +97 -92
  250. package/types/cmat-services-splash-screen.d.ts +11 -14
  251. package/types/cmat-services-title.d.ts +9 -12
  252. package/types/cmat-services-translation.d.ts +19 -22
  253. package/types/cmat-services-utils.d.ts +76 -80
  254. package/types/cmat-validators.d.ts +5 -8
  255. package/types/cmat-version.d.ts +8 -10
  256. package/types/cmat.d.ts +7551 -5194
@@ -1,205 +1,379 @@
1
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
2
- import { NgStyle, NgClass } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { viewChild, input, output, signal, inject, effect, Input, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
5
- import { NgControl } from '@angular/forms';
6
- import { MatFormFieldControl } from '@angular/material/form-field';
7
- import * as i1 from '@angular/material/icon';
8
- import { MatIconModule } from '@angular/material/icon';
9
- import { isNil } from 'lodash-es';
10
- import { Subject } from 'rxjs';
11
-
12
- /* eslint-disable @typescript-eslint/member-ordering */
1
+ import { coerceBooleanProperty } from "@angular/cdk/coercion";
2
+ import { NgClass, NgStyle } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation, effect, inject, input, output, signal, viewChild } from "@angular/core";
5
+ import { NgControl } from "@angular/forms";
6
+ import { MatFormFieldControl } from "@angular/material/form-field";
7
+ import * as i1 from "@angular/material/icon";
8
+ import { MatIconModule } from "@angular/material/icon";
9
+ import { isNil } from "lodash-es";
10
+ import { Subject } from "rxjs";
13
11
  let NEXT_ID = 0;
14
- class CmatRatingComponent {
15
- constructor() {
16
- this.id = `cmat-chip-input-${NEXT_ID++}`;
17
- this._ratingElementRef = viewChild('rating', /* @ts-ignore */
18
- ...(ngDevMode ? [{ debugName: "_ratingElementRef" }] : /* istanbul ignore next */ []));
19
- this.stars = input(5, /* @ts-ignore */
20
- ...(ngDevMode ? [{ debugName: "stars" }] : /* istanbul ignore next */ []));
21
- this.readonly = input(false, /* @ts-ignore */
22
- ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
23
- this.hover = input(/* @ts-ignore */
24
- ...(ngDevMode ? [undefined, { debugName: "hover" }] : /* istanbul ignore next */ []));
25
- this.half = input(/* @ts-ignore */
26
- ...(ngDevMode ? [undefined, { debugName: "half" }] : /* istanbul ignore next */ []));
27
- this.color = input(/* @ts-ignore */
28
- ...(ngDevMode ? [undefined, { debugName: "color" }] : /* istanbul ignore next */ []));
29
- this.showMode = input('horizontal', /* @ts-ignore */
30
- ...(ngDevMode ? [{ debugName: "showMode" }] : /* istanbul ignore next */ []));
31
- this.valueChange = output();
32
- this.starArray = signal([], /* @ts-ignore */
33
- ...(ngDevMode ? [{ debugName: "starArray" }] : /* istanbul ignore next */ []));
34
- this.currentValue = signal(0, /* @ts-ignore */
35
- ...(ngDevMode ? [{ debugName: "currentValue" }] : /* istanbul ignore next */ []));
36
- this.stateChanges = new Subject();
37
- this.focused = false;
38
- this.touched = false;
39
- this.controlType = 'cmat-rating';
40
- this.ngControl = inject(NgControl, { optional: true, self: true });
41
- this._value = signal(0, /* @ts-ignore */
42
- ...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
43
- this._placeholder = signal('', /* @ts-ignore */
44
- ...(ngDevMode ? [{ debugName: "_placeholder" }] : /* istanbul ignore next */ []));
45
- this._required = signal(false, /* @ts-ignore */
46
- ...(ngDevMode ? [{ debugName: "_required" }] : /* istanbul ignore next */ []));
47
- this._disabled = signal(false, /* @ts-ignore */
48
- ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
49
- // eslint-disable-next-line @typescript-eslint/no-empty-function
50
- this.onModelChange = () => { };
51
- // eslint-disable-next-line @typescript-eslint/no-empty-function
52
- this.onTouchedChange = () => { };
53
- if (this.ngControl != null) {
54
- this.ngControl.valueAccessor = this;
55
- }
56
- // 监听 stars 变化并初始化星数组
57
- effect(() => {
58
- this._initializeStarArray();
59
- });
60
- }
61
- get placeholder() {
62
- return this._placeholder();
63
- }
64
- set placeholder(value) {
65
- this._placeholder.set(value);
66
- this.stateChanges.next();
67
- }
68
- get value() {
69
- return this._value();
70
- }
71
- set value(value) {
72
- if (value !== this._value()) {
73
- this._value.set(value);
74
- this.stateChanges.next();
75
- this.onModelChange(value);
76
- }
77
- }
78
- get empty() {
79
- return !this._value();
80
- }
81
- get errorState() {
82
- if (this.ngControl == null)
83
- return false;
84
- return (this.touched && this.ngControl?.invalid) ?? false;
85
- }
86
- get shouldLabelFloat() {
87
- return this.focused || !this.empty;
88
- }
89
- get required() {
90
- return this._required();
91
- }
92
- set required(value) {
93
- this._required.set(coerceBooleanProperty(value));
94
- this.stateChanges.next();
95
- }
96
- get disabled() {
97
- if (!isNil(this.ngControl?.disabled)) {
98
- return this.ngControl.disabled;
99
- }
100
- return this._disabled() || this.readonly();
101
- }
102
- set disabled(value) {
103
- this._disabled.set(coerceBooleanProperty(value));
104
- if (this.focused) {
105
- this.focused = false;
106
- this.stateChanges.next();
107
- }
108
- }
109
- writeValue(value) {
110
- if (value !== null && value !== undefined) {
111
- this.value = value;
112
- this.currentValue.set(value);
113
- }
114
- }
115
- setDisabledState(isDisabled) {
116
- this.disabled = isDisabled;
117
- }
118
- registerOnChange(fn) {
119
- this.onModelChange = fn;
120
- }
121
- registerOnTouched(fn) {
122
- this.onTouchedChange = fn;
123
- }
124
- setDescribedByIds(ids) {
125
- const ratingEl = this._ratingElementRef();
126
- if (ids.length) {
127
- ratingEl?.nativeElement.setAttribute('aria-describedby', ids.join(' '));
128
- }
129
- else {
130
- ratingEl?.nativeElement.removeAttribute('aria-describedby');
131
- }
132
- }
133
- onContainerClick() {
134
- if (!this.focused) {
135
- this._ratingElementRef()?.nativeElement.focus();
136
- }
137
- }
138
- onFocus() {
139
- if (!this.focused) {
140
- this.focused = true;
141
- this.stateChanges.next();
142
- }
143
- }
144
- isIn(value) {
145
- const ex = this.value - value;
146
- return ex > 0 && ex < 1;
147
- }
148
- onClick(event, value, half) {
149
- event.stopPropagation();
150
- if (!this.readonly()) {
151
- this.value = value + 1;
152
- if (half && this.half()) {
153
- this.value -= 0.5;
154
- }
155
- this.currentValue.set(this.value);
156
- this.valueChange.emit(this.currentValue());
157
- this.onModelChange(this.currentValue());
158
- }
159
- }
160
- onMouseover(event, value, half) {
161
- event.stopPropagation();
162
- if (this.hover() && !this.readonly()) {
163
- this.value = value + 1;
164
- if (half && this.half()) {
165
- this.value -= 0.5;
166
- }
167
- }
168
- }
169
- onMouseleave() {
170
- if (this.value !== this.currentValue()) {
171
- this.value = this.currentValue();
172
- }
173
- }
174
- _initializeStarArray() {
175
- this.starArray.set(Array.from({ length: this.stars() }, (_, i) => i));
176
- }
177
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatRatingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
178
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatRatingComponent, isStandalone: true, selector: "cmat-rating", inputs: { stars: { classPropertyName: "stars", publicName: "stars", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, hover: { classPropertyName: "hover", publicName: "hover", isSignal: true, isRequired: false, transformFunction: null }, half: { classPropertyName: "half", publicName: "half", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, showMode: { classPropertyName: "showMode", publicName: "showMode", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { properties: { "attr.id": "id" } }, providers: [
179
- { provide: MatFormFieldControl, useExisting: CmatRatingComponent },
180
- ], viewQueries: [{ propertyName: "_ratingElementRef", first: true, predicate: ["rating"], descendants: true, isSignal: true }], exportAs: ["cmatRating"], ngImport: i0, template: "<div\r\n #rating\r\n class=\"flex\"\r\n [class.cmat-rating-readonly]=\"readonly() || disabled\"\r\n [ngClass]=\"{\r\n 'flex-col': showMode() === 'vertical',\r\n 'flex-row': showMode() === 'horizontal',\r\n }\"\r\n (focus)=\"onFocus()\"\r\n (mouseleave)=\"onMouseleave()\"\r\n>\r\n @for (star of starArray(); track $index; let i = $index) {\r\n <div class=\"cmat-rating-item\">\r\n @if (half()) {\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-rating-half\"\r\n [ngStyle]=\"{ opacity: isIn(i) ? 1 : 0 }\"\r\n (focus)=\"onFocus()\"\r\n (mouseover)=\"onMouseover($event, i, true)\"\r\n (click)=\"onClick($event, i, true)\"\r\n >\r\n <mat-icon\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [color]=\"color()\"\r\n [svgIcon]=\"\r\n 'mat_outline:' + (!value || i >= value ? 'star_border' : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n }\r\n <div\r\n role=\"presentation\"\r\n (mouseover)=\"onMouseover($event, i)\"\r\n (click)=\"onClick($event, i)\"\r\n (focus)=\"onFocus()\"\r\n >\r\n <mat-icon\r\n [color]=\"color()\"\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [svgIcon]=\"\r\n 'mat_outline:' +\r\n ((half() && isIn(i)) || !value || i >= value\r\n ? 'star_border'\r\n : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n </div>\r\n }\r\n</div>", styles: ["cmat-rating{display:flex;align-items:center}cmat-rating .cmat-rating-item{position:relative;cursor:pointer;line-height:0}cmat-rating .cmat-rating-item div{display:inline-block;font-size:1rem;padding:0 .1rem}cmat-rating .cmat-rating-item .cmat-rating-half{position:absolute;top:0;left:0;width:45%;z-index:10;opacity:0;overflow:hidden;padding-right:0}cmat-rating .cmat-rating-readonly .cmat-rating-item{cursor:not-allowed}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
181
- }
182
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatRatingComponent, decorators: [{
183
- type: Component,
184
- args: [{ selector: 'cmat-rating', providers: [
185
- { provide: MatFormFieldControl, useExisting: CmatRatingComponent },
186
- ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatRating', imports: [MatIconModule, NgStyle, NgClass], host: {
187
- // eslint-disable-next-line @typescript-eslint/naming-convention
188
- '[attr.id]': 'id',
189
- }, template: "<div\r\n #rating\r\n class=\"flex\"\r\n [class.cmat-rating-readonly]=\"readonly() || disabled\"\r\n [ngClass]=\"{\r\n 'flex-col': showMode() === 'vertical',\r\n 'flex-row': showMode() === 'horizontal',\r\n }\"\r\n (focus)=\"onFocus()\"\r\n (mouseleave)=\"onMouseleave()\"\r\n>\r\n @for (star of starArray(); track $index; let i = $index) {\r\n <div class=\"cmat-rating-item\">\r\n @if (half()) {\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-rating-half\"\r\n [ngStyle]=\"{ opacity: isIn(i) ? 1 : 0 }\"\r\n (focus)=\"onFocus()\"\r\n (mouseover)=\"onMouseover($event, i, true)\"\r\n (click)=\"onClick($event, i, true)\"\r\n >\r\n <mat-icon\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [color]=\"color()\"\r\n [svgIcon]=\"\r\n 'mat_outline:' + (!value || i >= value ? 'star_border' : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n }\r\n <div\r\n role=\"presentation\"\r\n (mouseover)=\"onMouseover($event, i)\"\r\n (click)=\"onClick($event, i)\"\r\n (focus)=\"onFocus()\"\r\n >\r\n <mat-icon\r\n [color]=\"color()\"\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [svgIcon]=\"\r\n 'mat_outline:' +\r\n ((half() && isIn(i)) || !value || i >= value\r\n ? 'star_border'\r\n : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n </div>\r\n }\r\n</div>", styles: ["cmat-rating{display:flex;align-items:center}cmat-rating .cmat-rating-item{position:relative;cursor:pointer;line-height:0}cmat-rating .cmat-rating-item div{display:inline-block;font-size:1rem;padding:0 .1rem}cmat-rating .cmat-rating-item .cmat-rating-half{position:absolute;top:0;left:0;width:45%;z-index:10;opacity:0;overflow:hidden;padding-right:0}cmat-rating .cmat-rating-readonly .cmat-rating-item{cursor:not-allowed}\n"] }]
190
- }], ctorParameters: () => [], propDecorators: { _ratingElementRef: [{ type: i0.ViewChild, args: ['rating', { isSignal: true }] }], stars: [{ type: i0.Input, args: [{ isSignal: true, alias: "stars", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], hover: [{ type: i0.Input, args: [{ isSignal: true, alias: "hover", required: false }] }], half: [{ type: i0.Input, args: [{ isSignal: true, alias: "half", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], showMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMode", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], placeholder: [{
191
- type: Input
192
- }], value: [{
193
- type: Input
194
- }], required: [{
195
- type: Input
196
- }], disabled: [{
197
- type: Input
198
- }] } });
199
-
200
- /**
201
- * Generated bundle index. Do not edit.
202
- */
203
-
12
+ var CmatRatingComponent = class CmatRatingComponent {
13
+ constructor() {
14
+ this.id = `cmat-chip-input-${NEXT_ID++}`;
15
+ this._ratingElementRef = viewChild("rating", ...ngDevMode ? [{ debugName: "_ratingElementRef" }] : /* istanbul ignore next */ []);
16
+ this.stars = input(5, ...ngDevMode ? [{ debugName: "stars" }] : /* istanbul ignore next */ []);
17
+ this.readonly = input(false, ...ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []);
18
+ this.hover = input(...ngDevMode ? [void 0, { debugName: "hover" }] : /* istanbul ignore next */ []);
19
+ this.half = input(...ngDevMode ? [void 0, { debugName: "half" }] : /* istanbul ignore next */ []);
20
+ this.color = input(...ngDevMode ? [void 0, { debugName: "color" }] : /* istanbul ignore next */ []);
21
+ this.showMode = input("horizontal", ...ngDevMode ? [{ debugName: "showMode" }] : /* istanbul ignore next */ []);
22
+ this.valueChange = output();
23
+ this.starArray = signal([], ...ngDevMode ? [{ debugName: "starArray" }] : /* istanbul ignore next */ []);
24
+ this.currentValue = signal(0, ...ngDevMode ? [{ debugName: "currentValue" }] : /* istanbul ignore next */ []);
25
+ this.stateChanges = new Subject();
26
+ this.focused = false;
27
+ this.touched = false;
28
+ this.controlType = "cmat-rating";
29
+ this.ngControl = inject(NgControl, {
30
+ optional: true,
31
+ self: true
32
+ });
33
+ this._value = signal(0, ...ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []);
34
+ this._placeholder = signal("", ...ngDevMode ? [{ debugName: "_placeholder" }] : /* istanbul ignore next */ []);
35
+ this._required = signal(false, ...ngDevMode ? [{ debugName: "_required" }] : /* istanbul ignore next */ []);
36
+ this._disabled = signal(false, ...ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []);
37
+ this.onModelChange = () => {};
38
+ this.onTouchedChange = () => {};
39
+ if (this.ngControl != null) this.ngControl.valueAccessor = this;
40
+ effect(() => {
41
+ this._initializeStarArray();
42
+ });
43
+ }
44
+ get placeholder() {
45
+ return this._placeholder();
46
+ }
47
+ set placeholder(value) {
48
+ this._placeholder.set(value);
49
+ this.stateChanges.next();
50
+ }
51
+ get value() {
52
+ return this._value();
53
+ }
54
+ set value(value) {
55
+ if (value !== this._value()) {
56
+ this._value.set(value);
57
+ this.stateChanges.next();
58
+ this.onModelChange(value);
59
+ }
60
+ }
61
+ get empty() {
62
+ return !this._value();
63
+ }
64
+ get errorState() {
65
+ if (this.ngControl == null) return false;
66
+ return (this.touched && this.ngControl?.invalid) ?? false;
67
+ }
68
+ get shouldLabelFloat() {
69
+ return this.focused || !this.empty;
70
+ }
71
+ get required() {
72
+ return this._required();
73
+ }
74
+ set required(value) {
75
+ this._required.set(coerceBooleanProperty(value));
76
+ this.stateChanges.next();
77
+ }
78
+ get disabled() {
79
+ if (!isNil(this.ngControl?.disabled)) return this.ngControl.disabled;
80
+ return this._disabled() || this.readonly();
81
+ }
82
+ set disabled(value) {
83
+ this._disabled.set(coerceBooleanProperty(value));
84
+ if (this.focused) {
85
+ this.focused = false;
86
+ this.stateChanges.next();
87
+ }
88
+ }
89
+ writeValue(value) {
90
+ if (value !== null && value !== void 0) {
91
+ this.value = value;
92
+ this.currentValue.set(value);
93
+ }
94
+ }
95
+ setDisabledState(isDisabled) {
96
+ this.disabled = isDisabled;
97
+ }
98
+ registerOnChange(fn) {
99
+ this.onModelChange = fn;
100
+ }
101
+ registerOnTouched(fn) {
102
+ this.onTouchedChange = fn;
103
+ }
104
+ setDescribedByIds(ids) {
105
+ const ratingEl = this._ratingElementRef();
106
+ if (ids.length) ratingEl?.nativeElement.setAttribute("aria-describedby", ids.join(" "));
107
+ else ratingEl?.nativeElement.removeAttribute("aria-describedby");
108
+ }
109
+ onContainerClick() {
110
+ if (!this.focused) this._ratingElementRef()?.nativeElement.focus();
111
+ }
112
+ onFocus() {
113
+ if (!this.focused) {
114
+ this.focused = true;
115
+ this.stateChanges.next();
116
+ }
117
+ }
118
+ isIn(value) {
119
+ const ex = this.value - value;
120
+ return ex > 0 && ex < 1;
121
+ }
122
+ onClick(event, value, half) {
123
+ event.stopPropagation();
124
+ if (!this.readonly()) {
125
+ this.value = value + 1;
126
+ if (half && this.half()) this.value -= .5;
127
+ this.currentValue.set(this.value);
128
+ this.valueChange.emit(this.currentValue());
129
+ this.onModelChange(this.currentValue());
130
+ }
131
+ }
132
+ onMouseover(event, value, half) {
133
+ event.stopPropagation();
134
+ if (this.hover() && !this.readonly()) {
135
+ this.value = value + 1;
136
+ if (half && this.half()) this.value -= .5;
137
+ }
138
+ }
139
+ onMouseleave() {
140
+ if (this.value !== this.currentValue()) this.value = this.currentValue();
141
+ }
142
+ _initializeStarArray() {
143
+ this.starArray.set(Array.from({ length: this.stars() }, (_, i) => i));
144
+ }
145
+ static {
146
+ this.ɵfac = i0.ɵɵngDeclareFactory({
147
+ minVersion: "12.0.0",
148
+ version: "22.2.3",
149
+ ngImport: i0,
150
+ type: CmatRatingComponent,
151
+ deps: [],
152
+ target: i0.ɵɵFactoryTarget.Component
153
+ });
154
+ }
155
+ static {
156
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
157
+ minVersion: "17.0.0",
158
+ version: "22.2.3",
159
+ type: CmatRatingComponent,
160
+ isStandalone: true,
161
+ selector: "cmat-rating",
162
+ inputs: {
163
+ stars: {
164
+ classPropertyName: "stars",
165
+ publicName: "stars",
166
+ isSignal: true,
167
+ isRequired: false,
168
+ transformFunction: null
169
+ },
170
+ readonly: {
171
+ classPropertyName: "readonly",
172
+ publicName: "readonly",
173
+ isSignal: true,
174
+ isRequired: false,
175
+ transformFunction: null
176
+ },
177
+ hover: {
178
+ classPropertyName: "hover",
179
+ publicName: "hover",
180
+ isSignal: true,
181
+ isRequired: false,
182
+ transformFunction: null
183
+ },
184
+ half: {
185
+ classPropertyName: "half",
186
+ publicName: "half",
187
+ isSignal: true,
188
+ isRequired: false,
189
+ transformFunction: null
190
+ },
191
+ color: {
192
+ classPropertyName: "color",
193
+ publicName: "color",
194
+ isSignal: true,
195
+ isRequired: false,
196
+ transformFunction: null
197
+ },
198
+ showMode: {
199
+ classPropertyName: "showMode",
200
+ publicName: "showMode",
201
+ isSignal: true,
202
+ isRequired: false,
203
+ transformFunction: null
204
+ },
205
+ placeholder: {
206
+ classPropertyName: "placeholder",
207
+ publicName: "placeholder",
208
+ isSignal: false,
209
+ isRequired: false,
210
+ transformFunction: null
211
+ },
212
+ value: {
213
+ classPropertyName: "value",
214
+ publicName: "value",
215
+ isSignal: false,
216
+ isRequired: false,
217
+ transformFunction: null
218
+ },
219
+ required: {
220
+ classPropertyName: "required",
221
+ publicName: "required",
222
+ isSignal: false,
223
+ isRequired: false,
224
+ transformFunction: null
225
+ },
226
+ disabled: {
227
+ classPropertyName: "disabled",
228
+ publicName: "disabled",
229
+ isSignal: false,
230
+ isRequired: false,
231
+ transformFunction: null
232
+ }
233
+ },
234
+ outputs: { valueChange: "valueChange" },
235
+ host: { properties: { "attr.id": "id" } },
236
+ providers: [{
237
+ provide: MatFormFieldControl,
238
+ useExisting: CmatRatingComponent
239
+ }],
240
+ viewQueries: [{
241
+ propertyName: "_ratingElementRef",
242
+ first: true,
243
+ predicate: ["rating"],
244
+ descendants: true,
245
+ isSignal: true
246
+ }],
247
+ exportAs: ["cmatRating"],
248
+ ngImport: i0,
249
+ template: "<div\r\n #rating\r\n class=\"flex\"\r\n [class.cmat-rating-readonly]=\"readonly() || disabled\"\r\n [ngClass]=\"{\r\n 'flex-col': showMode() === 'vertical',\r\n 'flex-row': showMode() === 'horizontal',\r\n }\"\r\n (focus)=\"onFocus()\"\r\n (mouseleave)=\"onMouseleave()\"\r\n>\r\n @for (star of starArray(); track $index; let i = $index) {\r\n <div class=\"cmat-rating-item\">\r\n @if (half()) {\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-rating-half\"\r\n [ngStyle]=\"{ opacity: isIn(i) ? 1 : 0 }\"\r\n (focus)=\"onFocus()\"\r\n (mouseover)=\"onMouseover($event, i, true)\"\r\n (click)=\"onClick($event, i, true)\"\r\n >\r\n <mat-icon\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [color]=\"color()\"\r\n [svgIcon]=\"\r\n 'mat_outline:' + (!value || i >= value ? 'star_border' : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n }\r\n <div\r\n role=\"presentation\"\r\n (mouseover)=\"onMouseover($event, i)\"\r\n (click)=\"onClick($event, i)\"\r\n (focus)=\"onFocus()\"\r\n >\r\n <mat-icon\r\n [color]=\"color()\"\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [svgIcon]=\"\r\n 'mat_outline:' +\r\n ((half() && isIn(i)) || !value || i >= value\r\n ? 'star_border'\r\n : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n </div>\r\n }\r\n</div>",
250
+ styles: ["cmat-rating{display:flex;align-items:center}cmat-rating .cmat-rating-item{position:relative;cursor:pointer;line-height:0}cmat-rating .cmat-rating-item div{display:inline-block;font-size:1rem;padding:0 .1rem}cmat-rating .cmat-rating-item .cmat-rating-half{position:absolute;top:0;left:0;width:45%;z-index:10;opacity:0;overflow:hidden;padding-right:0}cmat-rating .cmat-rating-readonly .cmat-rating-item{cursor:not-allowed}\n"],
251
+ dependencies: [
252
+ {
253
+ kind: "ngmodule",
254
+ type: MatIconModule
255
+ },
256
+ {
257
+ kind: "component",
258
+ type: i1.MatIcon,
259
+ selector: "mat-icon",
260
+ inputs: [
261
+ "color",
262
+ "inline",
263
+ "svgIcon",
264
+ "fontSet",
265
+ "fontIcon"
266
+ ],
267
+ exportAs: ["matIcon"]
268
+ },
269
+ {
270
+ kind: "directive",
271
+ type: NgStyle,
272
+ selector: "[ngStyle]",
273
+ inputs: ["ngStyle"]
274
+ },
275
+ {
276
+ kind: "directive",
277
+ type: NgClass,
278
+ selector: "[ngClass]",
279
+ inputs: ["class", "ngClass"]
280
+ }
281
+ ],
282
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
283
+ encapsulation: i0.ViewEncapsulation.None
284
+ });
285
+ }
286
+ };
287
+ i0.ɵɵngDeclareClassMetadata({
288
+ minVersion: "12.0.0",
289
+ version: "22.2.3",
290
+ ngImport: i0,
291
+ type: CmatRatingComponent,
292
+ decorators: [{
293
+ type: Component,
294
+ args: [{
295
+ selector: "cmat-rating",
296
+ providers: [{
297
+ provide: MatFormFieldControl,
298
+ useExisting: CmatRatingComponent
299
+ }],
300
+ encapsulation: ViewEncapsulation.None,
301
+ changeDetection: ChangeDetectionStrategy.OnPush,
302
+ exportAs: "cmatRating",
303
+ imports: [
304
+ MatIconModule,
305
+ NgStyle,
306
+ NgClass
307
+ ],
308
+ host: { "[attr.id]": "id" },
309
+ template: "<div\r\n #rating\r\n class=\"flex\"\r\n [class.cmat-rating-readonly]=\"readonly() || disabled\"\r\n [ngClass]=\"{\r\n 'flex-col': showMode() === 'vertical',\r\n 'flex-row': showMode() === 'horizontal',\r\n }\"\r\n (focus)=\"onFocus()\"\r\n (mouseleave)=\"onMouseleave()\"\r\n>\r\n @for (star of starArray(); track $index; let i = $index) {\r\n <div class=\"cmat-rating-item\">\r\n @if (half()) {\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-rating-half\"\r\n [ngStyle]=\"{ opacity: isIn(i) ? 1 : 0 }\"\r\n (focus)=\"onFocus()\"\r\n (mouseover)=\"onMouseover($event, i, true)\"\r\n (click)=\"onClick($event, i, true)\"\r\n >\r\n <mat-icon\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [color]=\"color()\"\r\n [svgIcon]=\"\r\n 'mat_outline:' + (!value || i >= value ? 'star_border' : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n }\r\n <div\r\n role=\"presentation\"\r\n (mouseover)=\"onMouseover($event, i)\"\r\n (click)=\"onClick($event, i)\"\r\n (focus)=\"onFocus()\"\r\n >\r\n <mat-icon\r\n [color]=\"color()\"\r\n [ngClass]=\"{ 'text-current': !color() }\"\r\n [svgIcon]=\"\r\n 'mat_outline:' +\r\n ((half() && isIn(i)) || !value || i >= value\r\n ? 'star_border'\r\n : 'star')\r\n \"\r\n >\r\n </mat-icon>\r\n </div>\r\n </div>\r\n }\r\n</div>",
310
+ styles: ["cmat-rating{display:flex;align-items:center}cmat-rating .cmat-rating-item{position:relative;cursor:pointer;line-height:0}cmat-rating .cmat-rating-item div{display:inline-block;font-size:1rem;padding:0 .1rem}cmat-rating .cmat-rating-item .cmat-rating-half{position:absolute;top:0;left:0;width:45%;z-index:10;opacity:0;overflow:hidden;padding-right:0}cmat-rating .cmat-rating-readonly .cmat-rating-item{cursor:not-allowed}\n"]
311
+ }]
312
+ }],
313
+ ctorParameters: () => [],
314
+ propDecorators: {
315
+ _ratingElementRef: [{
316
+ type: i0.ViewChild,
317
+ args: ["rating", { isSignal: true }]
318
+ }],
319
+ stars: [{
320
+ type: i0.Input,
321
+ args: [{
322
+ isSignal: true,
323
+ alias: "stars",
324
+ required: false
325
+ }]
326
+ }],
327
+ readonly: [{
328
+ type: i0.Input,
329
+ args: [{
330
+ isSignal: true,
331
+ alias: "readonly",
332
+ required: false
333
+ }]
334
+ }],
335
+ hover: [{
336
+ type: i0.Input,
337
+ args: [{
338
+ isSignal: true,
339
+ alias: "hover",
340
+ required: false
341
+ }]
342
+ }],
343
+ half: [{
344
+ type: i0.Input,
345
+ args: [{
346
+ isSignal: true,
347
+ alias: "half",
348
+ required: false
349
+ }]
350
+ }],
351
+ color: [{
352
+ type: i0.Input,
353
+ args: [{
354
+ isSignal: true,
355
+ alias: "color",
356
+ required: false
357
+ }]
358
+ }],
359
+ showMode: [{
360
+ type: i0.Input,
361
+ args: [{
362
+ isSignal: true,
363
+ alias: "showMode",
364
+ required: false
365
+ }]
366
+ }],
367
+ valueChange: [{
368
+ type: i0.Output,
369
+ args: ["valueChange"]
370
+ }],
371
+ placeholder: [{ type: Input }],
372
+ value: [{ type: Input }],
373
+ required: [{ type: Input }],
374
+ disabled: [{ type: Input }]
375
+ }
376
+ });
204
377
  export { CmatRatingComponent };
205
- //# sourceMappingURL=cmat-components-rating.mjs.map
378
+
379
+ //# sourceMappingURL=cmat-components-rating.mjs.map