cmat 0.0.111 → 0.0.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/fesm2022/cmat-components-adapter.mjs +531 -536
  2. package/fesm2022/cmat-components-adapter.mjs.map +1 -1
  3. package/fesm2022/cmat-components-breadcrumb.mjs +521 -356
  4. package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
  5. package/fesm2022/cmat-components-card.mjs +150 -42
  6. package/fesm2022/cmat-components-card.mjs.map +1 -1
  7. package/fesm2022/cmat-components-carousel.mjs +1120 -629
  8. package/fesm2022/cmat-components-carousel.mjs.map +1 -1
  9. package/fesm2022/cmat-components-cascade.mjs +861 -441
  10. package/fesm2022/cmat-components-cascade.mjs.map +1 -1
  11. package/fesm2022/cmat-components-chip-input.mjs +580 -335
  12. package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
  13. package/fesm2022/cmat-components-code-editor.mjs +197 -105
  14. package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
  15. package/fesm2022/cmat-components-color-picker.mjs +1762 -825
  16. package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
  17. package/fesm2022/cmat-components-custom-formly.mjs +5196 -2531
  18. package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
  19. package/fesm2022/cmat-components-data-picker.mjs +1901 -1073
  20. package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
  21. package/fesm2022/cmat-components-date-range.mjs +701 -456
  22. package/fesm2022/cmat-components-date-range.mjs.map +1 -1
  23. package/fesm2022/cmat-components-date-time-display.mjs +137 -30
  24. package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
  25. package/fesm2022/cmat-components-drawer.mjs +410 -258
  26. package/fesm2022/cmat-components-drawer.mjs.map +1 -1
  27. package/fesm2022/cmat-components-empty-state.mjs +201 -41
  28. package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
  29. package/fesm2022/cmat-components-file-preview.mjs +198 -35
  30. package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
  31. package/fesm2022/cmat-components-filter-toolbar.mjs +320 -72
  32. package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
  33. package/fesm2022/cmat-components-form-actions.mjs +102 -26
  34. package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
  35. package/fesm2022/cmat-components-fullscreen.mjs +167 -47
  36. package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
  37. package/fesm2022/cmat-components-highlight.mjs +203 -112
  38. package/fesm2022/cmat-components-highlight.mjs.map +1 -1
  39. package/fesm2022/cmat-components-image-viewer.mjs +489 -215
  40. package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
  41. package/fesm2022/cmat-components-inline-loading.mjs +117 -27
  42. package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
  43. package/fesm2022/cmat-components-json-editor.mjs +276 -230
  44. package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
  45. package/fesm2022/cmat-components-knob-input.mjs +615 -420
  46. package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
  47. package/fesm2022/cmat-components-loading-overlay.mjs +53 -25
  48. package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
  49. package/fesm2022/cmat-components-masonry.mjs +120 -40
  50. package/fesm2022/cmat-components-masonry.mjs.map +1 -1
  51. package/fesm2022/cmat-components-material-color-picker.mjs +332 -155
  52. package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
  53. package/fesm2022/cmat-components-material-datetimepicker.mjs +4283 -2504
  54. package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
  55. package/fesm2022/cmat-components-navigation.mjs +3080 -1404
  56. package/fesm2022/cmat-components-navigation.mjs.map +1 -1
  57. package/fesm2022/cmat-components-opt-input.mjs +540 -466
  58. package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
  59. package/fesm2022/cmat-components-org-chart.mjs +528 -125
  60. package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
  61. package/fesm2022/cmat-components-page-header.mjs +141 -32
  62. package/fesm2022/cmat-components-page-header.mjs.map +1 -1
  63. package/fesm2022/cmat-components-pagination.mjs +866 -534
  64. package/fesm2022/cmat-components-pagination.mjs.map +1 -1
  65. package/fesm2022/cmat-components-password-strength.mjs +873 -434
  66. package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
  67. package/fesm2022/cmat-components-popover.mjs +1012 -731
  68. package/fesm2022/cmat-components-popover.mjs.map +1 -1
  69. package/fesm2022/cmat-components-progress-bar.mjs +98 -35
  70. package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
  71. package/fesm2022/cmat-components-qrcode.mjs +463 -287
  72. package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
  73. package/fesm2022/cmat-components-rating.mjs +377 -203
  74. package/fesm2022/cmat-components-rating.mjs.map +1 -1
  75. package/fesm2022/cmat-components-rich-text-editor.mjs +153 -39
  76. package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
  77. package/fesm2022/cmat-components-select-search.mjs +926 -496
  78. package/fesm2022/cmat-components-select-search.mjs.map +1 -1
  79. package/fesm2022/cmat-components-select-table.mjs +1280 -842
  80. package/fesm2022/cmat-components-select-table.mjs.map +1 -1
  81. package/fesm2022/cmat-components-select-tree.mjs +998 -690
  82. package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
  83. package/fesm2022/cmat-components-skeleton.mjs +143 -57
  84. package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
  85. package/fesm2022/cmat-components-speed-dial.mjs +457 -303
  86. package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
  87. package/fesm2022/cmat-components-status-tag.mjs +136 -44
  88. package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
  89. package/fesm2022/cmat-components-table-toolbar.mjs +120 -28
  90. package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
  91. package/fesm2022/cmat-components-timeline.mjs +464 -168
  92. package/fesm2022/cmat-components-timeline.mjs.map +1 -1
  93. package/fesm2022/cmat-components-toast.mjs +346 -262
  94. package/fesm2022/cmat-components-toast.mjs.map +1 -1
  95. package/fesm2022/cmat-components-transfer-picker.mjs +1427 -593
  96. package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
  97. package/fesm2022/cmat-components-treetable.mjs +372 -112
  98. package/fesm2022/cmat-components-treetable.mjs.map +1 -1
  99. package/fesm2022/cmat-components-upload.mjs +904 -410
  100. package/fesm2022/cmat-components-upload.mjs.map +1 -1
  101. package/fesm2022/cmat-components-x6-angular-shape.mjs +153 -170
  102. package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
  103. package/fesm2022/cmat-directives-animate-on-scroll.mjs +220 -138
  104. package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
  105. package/fesm2022/cmat-directives-arrow-cursor.mjs +246 -193
  106. package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
  107. package/fesm2022/cmat-directives-autofocus.mjs +43 -25
  108. package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
  109. package/fesm2022/cmat-directives-data-exporter.mjs +537 -338
  110. package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
  111. package/fesm2022/cmat-directives-debounce.mjs +162 -76
  112. package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
  113. package/fesm2022/cmat-directives-digit-only.mjs +457 -356
  114. package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
  115. package/fesm2022/cmat-directives-equal-validator.mjs +70 -53
  116. package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
  117. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +180 -132
  118. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
  119. package/fesm2022/cmat-lib-mock-api.mjs +207 -195
  120. package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
  121. package/fesm2022/cmat-pipes-bytes.mjs +50 -30
  122. package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
  123. package/fesm2022/cmat-pipes-date-format.mjs +41 -25
  124. package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
  125. package/fesm2022/cmat-pipes-find-by-key.mjs +44 -26
  126. package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
  127. package/fesm2022/cmat-pipes-group-by.mjs +50 -38
  128. package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
  129. package/fesm2022/cmat-pipes-keys.mjs +44 -31
  130. package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
  131. package/fesm2022/cmat-pipes-secure.mjs +60 -49
  132. package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
  133. package/fesm2022/cmat-pipes-uppercase.mjs +39 -22
  134. package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
  135. package/fesm2022/cmat-reports.mjs +2751 -0
  136. package/fesm2022/cmat-reports.mjs.map +1 -0
  137. package/fesm2022/cmat-services-alert.mjs +249 -277
  138. package/fesm2022/cmat-services-alert.mjs.map +1 -1
  139. package/fesm2022/cmat-services-config.mjs +110 -81
  140. package/fesm2022/cmat-services-config.mjs.map +1 -1
  141. package/fesm2022/cmat-services-confirmation.mjs +184 -73
  142. package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
  143. package/fesm2022/cmat-services-data.mjs +136 -125
  144. package/fesm2022/cmat-services-data.mjs.map +1 -1
  145. package/fesm2022/cmat-services-export-as.mjs +165 -183
  146. package/fesm2022/cmat-services-export-as.mjs.map +1 -1
  147. package/fesm2022/cmat-services-loading.mjs +116 -95
  148. package/fesm2022/cmat-services-loading.mjs.map +1 -1
  149. package/fesm2022/cmat-services-local-storage.mjs +75 -66
  150. package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
  151. package/fesm2022/cmat-services-media-watcher.mjs +69 -64
  152. package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
  153. package/fesm2022/cmat-services-platform.mjs +48 -45
  154. package/fesm2022/cmat-services-platform.mjs.map +1 -1
  155. package/fesm2022/cmat-services-print.mjs +984 -1109
  156. package/fesm2022/cmat-services-print.mjs.map +1 -1
  157. package/fesm2022/cmat-services-splash-screen.mjs +53 -38
  158. package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
  159. package/fesm2022/cmat-services-title.mjs +57 -47
  160. package/fesm2022/cmat-services-title.mjs.map +1 -1
  161. package/fesm2022/cmat-services-translation.mjs +79 -68
  162. package/fesm2022/cmat-services-translation.mjs.map +1 -1
  163. package/fesm2022/cmat-services-utils.mjs +424 -517
  164. package/fesm2022/cmat-services-utils.mjs.map +1 -1
  165. package/fesm2022/cmat-validators.mjs +23 -33
  166. package/fesm2022/cmat-validators.mjs.map +1 -1
  167. package/fesm2022/cmat-version.mjs +12 -16
  168. package/fesm2022/cmat-version.mjs.map +1 -1
  169. package/fesm2022/cmat.mjs +39805 -22511
  170. package/fesm2022/cmat.mjs.map +1 -1
  171. package/package.json +5 -1
  172. package/types/cmat-components-adapter.d.ts +145 -156
  173. package/types/cmat-components-breadcrumb.d.ts +108 -86
  174. package/types/cmat-components-card.d.ts +34 -18
  175. package/types/cmat-components-carousel.d.ts +251 -134
  176. package/types/cmat-components-cascade.d.ts +158 -117
  177. package/types/cmat-components-chip-input.d.ts +105 -71
  178. package/types/cmat-components-code-editor.d.ts +59 -34
  179. package/types/cmat-components-color-picker.d.ts +378 -236
  180. package/types/cmat-components-custom-formly.d.ts +776 -814
  181. package/types/cmat-components-data-picker.d.ts +502 -360
  182. package/types/cmat-components-date-range.d.ts +106 -77
  183. package/types/cmat-components-date-time-display.d.ts +36 -13
  184. package/types/cmat-components-drawer.d.ts +91 -61
  185. package/types/cmat-components-empty-state.d.ts +47 -17
  186. package/types/cmat-components-file-preview.d.ts +42 -14
  187. package/types/cmat-components-filter-toolbar.d.ts +57 -25
  188. package/types/cmat-components-form-actions.d.ts +18 -10
  189. package/types/cmat-components-fullscreen.d.ts +21 -13
  190. package/types/cmat-components-highlight.d.ts +33 -26
  191. package/types/cmat-components-image-viewer.d.ts +119 -58
  192. package/types/cmat-components-inline-loading.d.ts +24 -11
  193. package/types/cmat-components-json-editor.d.ts +39 -28
  194. package/types/cmat-components-knob-input.d.ts +172 -101
  195. package/types/cmat-components-loading-overlay.d.ts +8 -11
  196. package/types/cmat-components-masonry.d.ts +27 -14
  197. package/types/cmat-components-material-color-picker.d.ts +56 -42
  198. package/types/cmat-components-material-datetimepicker.d.ts +817 -454
  199. package/types/cmat-components-navigation.d.ts +295 -221
  200. package/types/cmat-components-opt-input.d.ts +111 -90
  201. package/types/cmat-components-org-chart.d.ts +53 -35
  202. package/types/cmat-components-page-header.d.ts +37 -14
  203. package/types/cmat-components-pagination.d.ts +144 -107
  204. package/types/cmat-components-password-strength.d.ts +197 -86
  205. package/types/cmat-components-popover.d.ts +264 -166
  206. package/types/cmat-components-progress-bar.d.ts +17 -14
  207. package/types/cmat-components-qrcode.d.ts +111 -42
  208. package/types/cmat-components-rating.d.ts +105 -59
  209. package/types/cmat-components-rich-text-editor.d.ts +39 -16
  210. package/types/cmat-components-select-search.d.ts +195 -99
  211. package/types/cmat-components-select-table.d.ts +241 -142
  212. package/types/cmat-components-select-tree.d.ts +185 -118
  213. package/types/cmat-components-skeleton.d.ts +55 -32
  214. package/types/cmat-components-speed-dial.d.ts +86 -61
  215. package/types/cmat-components-status-tag.d.ts +42 -24
  216. package/types/cmat-components-table-toolbar.d.ts +30 -12
  217. package/types/cmat-components-timeline.d.ts +83 -51
  218. package/types/cmat-components-toast.d.ts +84 -85
  219. package/types/cmat-components-transfer-picker.d.ts +228 -181
  220. package/types/cmat-components-treetable.d.ts +63 -39
  221. package/types/cmat-components-upload.d.ts +205 -106
  222. package/types/cmat-components-x6-angular-shape.d.ts +29 -37
  223. package/types/cmat-directives-animate-on-scroll.d.ts +48 -30
  224. package/types/cmat-directives-arrow-cursor.d.ts +55 -35
  225. package/types/cmat-directives-autofocus.d.ts +8 -11
  226. package/types/cmat-directives-data-exporter.d.ts +71 -40
  227. package/types/cmat-directives-debounce.d.ts +31 -28
  228. package/types/cmat-directives-digit-only.d.ts +90 -53
  229. package/types/cmat-directives-equal-validator.d.ts +11 -14
  230. package/types/cmat-directives-seamless-auto-scroll.d.ts +42 -29
  231. package/types/cmat-lib-mock-api.d.ts +46 -55
  232. package/types/cmat-pipes-bytes.d.ts +7 -10
  233. package/types/cmat-pipes-date-format.d.ts +7 -10
  234. package/types/cmat-pipes-find-by-key.d.ts +8 -12
  235. package/types/cmat-pipes-group-by.d.ts +11 -15
  236. package/types/cmat-pipes-keys.d.ts +10 -13
  237. package/types/cmat-pipes-secure.d.ts +14 -17
  238. package/types/cmat-pipes-uppercase.d.ts +7 -10
  239. package/types/cmat-reports.d.ts +1131 -0
  240. package/types/cmat-services-alert.d.ts +80 -87
  241. package/types/cmat-services-config.d.ts +37 -43
  242. package/types/cmat-services-confirmation.d.ts +31 -37
  243. package/types/cmat-services-data.d.ts +18 -21
  244. package/types/cmat-services-export-as.d.ts +28 -33
  245. package/types/cmat-services-loading.d.ts +27 -31
  246. package/types/cmat-services-local-storage.d.ts +17 -21
  247. package/types/cmat-services-media-watcher.d.ts +14 -18
  248. package/types/cmat-services-platform.d.ts +8 -11
  249. package/types/cmat-services-print.d.ts +97 -102
  250. package/types/cmat-services-splash-screen.d.ts +11 -14
  251. package/types/cmat-services-title.d.ts +9 -12
  252. package/types/cmat-services-translation.d.ts +19 -22
  253. package/types/cmat-services-utils.d.ts +76 -80
  254. package/types/cmat-validators.d.ts +5 -8
  255. package/types/cmat-version.d.ts +8 -10
  256. package/types/cmat.d.ts +7551 -5204
@@ -1,500 +1,930 @@
1
- import { ViewportRuler } from '@angular/cdk/scrolling';
2
- import { NgClass } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { InjectionToken, Directive, output, viewChild, contentChild, input, inject, DestroyRef, signal, computed, effect, forwardRef, HostBinding, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
5
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
- import * as i5 from '@angular/forms';
7
- import { FormControl, FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
8
- import * as i7 from '@angular/material/button';
9
- import { MatButtonModule } from '@angular/material/button';
10
- import * as i2 from '@angular/material/checkbox';
11
- import { MatCheckboxModule } from '@angular/material/checkbox';
12
- import { MatOption, _countGroupLabelsBeforeOption } from '@angular/material/core';
13
- import { MatFormField, MatFormFieldModule } from '@angular/material/form-field';
14
- import * as i4 from '@angular/material/icon';
15
- import { MatIconModule } from '@angular/material/icon';
16
- import * as i1 from '@angular/material/input';
17
- import { MatInputModule } from '@angular/material/input';
18
- import * as i6 from '@angular/material/progress-spinner';
19
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
20
- import { MatSelect } from '@angular/material/select';
21
- import * as i3 from '@angular/material/tooltip';
22
- import { MatTooltipModule } from '@angular/material/tooltip';
23
- import { startWith, debounceTime, delay, take, filter, tap } from 'rxjs/operators';
24
-
1
+ import { ViewportRuler } from "@angular/cdk/scrolling";
2
+ import { NgClass } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, HostBinding, InjectionToken, ViewEncapsulation, computed, contentChild, effect, forwardRef, inject, input, output, signal, viewChild } from "@angular/core";
5
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
6
+ import * as i5 from "@angular/forms";
7
+ import { FormControl, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from "@angular/forms";
8
+ import * as i7 from "@angular/material/button";
9
+ import { MatButtonModule } from "@angular/material/button";
10
+ import * as i2 from "@angular/material/checkbox";
11
+ import { MatCheckboxModule } from "@angular/material/checkbox";
12
+ import { MatOption, _countGroupLabelsBeforeOption } from "@angular/material/core";
13
+ import { MatFormField, MatFormFieldModule } from "@angular/material/form-field";
14
+ import * as i4 from "@angular/material/icon";
15
+ import { MatIconModule } from "@angular/material/icon";
16
+ import * as i1 from "@angular/material/input";
17
+ import { MatInputModule } from "@angular/material/input";
18
+ import * as i6 from "@angular/material/progress-spinner";
19
+ import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
20
+ import { MatSelect } from "@angular/material/select";
21
+ import * as i3 from "@angular/material/tooltip";
22
+ import { MatTooltipModule } from "@angular/material/tooltip";
23
+ import { debounceTime, delay, filter, startWith, take, tap } from "rxjs/operators";
25
24
  const configurableDefaultOptions = [
26
- 'ariaLabel',
27
- 'clearSearchInput',
28
- 'disableInitialFocus',
29
- 'disableScrollToActiveOnOptionsChanged',
30
- 'enableClearOnEscapePressed',
31
- 'hideClearSearchButton',
32
- 'noEntriesFoundLabel',
33
- 'placeholderLabel',
34
- 'preventHomeEndKeyPropagation',
35
- 'searching',
25
+ "ariaLabel",
26
+ "clearSearchInput",
27
+ "disableInitialFocus",
28
+ "disableScrollToActiveOnOptionsChanged",
29
+ "enableClearOnEscapePressed",
30
+ "hideClearSearchButton",
31
+ "noEntriesFoundLabel",
32
+ "placeholderLabel",
33
+ "preventHomeEndKeyPropagation",
34
+ "searching"
36
35
  ];
37
- const MAT_SELECTSEARCH_DEFAULT_OPTIONS = new InjectionToken('mat-selectsearch-default-options');
38
-
39
- class CmatSelectNoEntriesFoundDirective {
40
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatSelectNoEntriesFoundDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
41
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.0", type: CmatSelectNoEntriesFoundDirective, isStandalone: true, selector: "[cmatSelectNoEntriesFound]", ngImport: i0 }); }
42
- }
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatSelectNoEntriesFoundDirective, decorators: [{
44
- type: Directive,
45
- args: [{
46
- selector: '[cmatSelectNoEntriesFound]'
47
- }]
48
- }] });
49
-
50
- class CmatSelectSearchClearDirective {
51
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatSelectSearchClearDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
52
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.0", type: CmatSelectSearchClearDirective, isStandalone: true, selector: "[cmatSelectSearchClear]", ngImport: i0 }); }
53
- }
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatSelectSearchClearDirective, decorators: [{
55
- type: Directive,
56
- args: [{
57
- selector: '[cmatSelectSearchClear]'
58
- }]
59
- }] });
60
-
36
+ const MAT_SELECTSEARCH_DEFAULT_OPTIONS = new InjectionToken("mat-selectsearch-default-options");
37
+ var CmatSelectNoEntriesFoundDirective = class CmatSelectNoEntriesFoundDirective {
38
+ static {
39
+ this.ɵfac = i0.ɵɵngDeclareFactory({
40
+ minVersion: "12.0.0",
41
+ version: "22.2.3",
42
+ ngImport: i0,
43
+ type: CmatSelectNoEntriesFoundDirective,
44
+ deps: [],
45
+ target: i0.ɵɵFactoryTarget.Directive
46
+ });
47
+ }
48
+ static {
49
+ this.ɵdir = i0.ɵɵngDeclareDirective({
50
+ minVersion: "14.0.0",
51
+ version: "22.2.3",
52
+ type: CmatSelectNoEntriesFoundDirective,
53
+ isStandalone: true,
54
+ selector: "[cmatSelectNoEntriesFound]",
55
+ ngImport: i0
56
+ });
57
+ }
58
+ };
59
+ i0.ɵɵngDeclareClassMetadata({
60
+ minVersion: "12.0.0",
61
+ version: "22.2.3",
62
+ ngImport: i0,
63
+ type: CmatSelectNoEntriesFoundDirective,
64
+ decorators: [{
65
+ type: Directive,
66
+ args: [{ selector: "[cmatSelectNoEntriesFound]" }]
67
+ }]
68
+ });
69
+ var CmatSelectSearchClearDirective = class CmatSelectSearchClearDirective {
70
+ static {
71
+ this.ɵfac = i0.ɵɵngDeclareFactory({
72
+ minVersion: "12.0.0",
73
+ version: "22.2.3",
74
+ ngImport: i0,
75
+ type: CmatSelectSearchClearDirective,
76
+ deps: [],
77
+ target: i0.ɵɵFactoryTarget.Directive
78
+ });
79
+ }
80
+ static {
81
+ this.ɵdir = i0.ɵɵngDeclareDirective({
82
+ minVersion: "14.0.0",
83
+ version: "22.2.3",
84
+ type: CmatSelectSearchClearDirective,
85
+ isStandalone: true,
86
+ selector: "[cmatSelectSearchClear]",
87
+ ngImport: i0
88
+ });
89
+ }
90
+ };
91
+ i0.ɵɵngDeclareClassMetadata({
92
+ minVersion: "12.0.0",
93
+ version: "22.2.3",
94
+ ngImport: i0,
95
+ type: CmatSelectSearchClearDirective,
96
+ decorators: [{
97
+ type: Directive,
98
+ args: [{ selector: "[cmatSelectSearchClear]" }]
99
+ }]
100
+ });
61
101
  const SELECT_PANEL_MAX_HEIGHT = 256;
62
- class CmatSelectSearchComponent {
63
- constructor() {
64
- this.toggleAll = output();
65
- this.searchSelectInput = viewChild.required('searchSelectInput', /* @ts-ignore */
66
- ...(ngDevMode ? [{ debugName: "searchSelectInput" }] : /* istanbul ignore next */ []));
67
- this.innerSelectSearch = viewChild.required('innerSelectSearch', /* @ts-ignore */
68
- ...(ngDevMode ? [{ debugName: "innerSelectSearch" }] : /* istanbul ignore next */ []));
69
- this.clearIcon = contentChild(CmatSelectSearchClearDirective, /* @ts-ignore */
70
- ...(ngDevMode ? [{ debugName: "clearIcon" }] : /* istanbul ignore next */ []));
71
- this.noEntriesFound = contentChild(CmatSelectNoEntriesFoundDirective, /* @ts-ignore */
72
- ...(ngDevMode ? [{ debugName: "noEntriesFound" }] : /* istanbul ignore next */ []));
73
- this.formControl = new FormControl('');
74
- this.placeholderLabel = input('搜索', /* @ts-ignore */
75
- ...(ngDevMode ? [{ debugName: "placeholderLabel" }] : /* istanbul ignore next */ []));
76
- this.type = input('text', /* @ts-ignore */
77
- ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
78
- this.noEntriesFoundLabel = input('无结果', /* @ts-ignore */
79
- ...(ngDevMode ? [{ debugName: "noEntriesFoundLabel" }] : /* istanbul ignore next */ []));
80
- this.showNoFoundLabel = input(true, /* @ts-ignore */
81
- ...(ngDevMode ? [{ debugName: "showNoFoundLabel" }] : /* istanbul ignore next */ []));
82
- this.clearSearchInput = input(true, /* @ts-ignore */
83
- ...(ngDevMode ? [{ debugName: "clearSearchInput" }] : /* istanbul ignore next */ []));
84
- this.searching = input(false, /* @ts-ignore */
85
- ...(ngDevMode ? [{ debugName: "searching" }] : /* istanbul ignore next */ []));
86
- this.disableInitialFocus = input(false, /* @ts-ignore */
87
- ...(ngDevMode ? [{ debugName: "disableInitialFocus" }] : /* istanbul ignore next */ []));
88
- this.enableClearOnEscapePressed = input(false, /* @ts-ignore */
89
- ...(ngDevMode ? [{ debugName: "enableClearOnEscapePressed" }] : /* istanbul ignore next */ []));
90
- this.preventHomeEndKeyPropagation = input(false, /* @ts-ignore */
91
- ...(ngDevMode ? [{ debugName: "preventHomeEndKeyPropagation" }] : /* istanbul ignore next */ []));
92
- this.disableScrollToActiveOnOptionsChanged = input(false, /* @ts-ignore */
93
- ...(ngDevMode ? [{ debugName: "disableScrollToActiveOnOptionsChanged" }] : /* istanbul ignore next */ []));
94
- this.ariaLabel = input('下拉搜索', /* @ts-ignore */
95
- ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
96
- this.showToggleAllCheckbox = input(false, /* @ts-ignore */
97
- ...(ngDevMode ? [{ debugName: "showToggleAllCheckbox" }] : /* istanbul ignore next */ []));
98
- this.toggleAllCheckboxChecked = input(false, /* @ts-ignore */
99
- ...(ngDevMode ? [{ debugName: "toggleAllCheckboxChecked" }] : /* istanbul ignore next */ []));
100
- this.toggleAllCheckboxIndeterminate = input(false, /* @ts-ignore */
101
- ...(ngDevMode ? [{ debugName: "toggleAllCheckboxIndeterminate" }] : /* istanbul ignore next */ []));
102
- this.toggleAllCheckboxTooltipMessage = input('', /* @ts-ignore */
103
- ...(ngDevMode ? [{ debugName: "toggleAllCheckboxTooltipMessage" }] : /* istanbul ignore next */ []));
104
- this.toggleAllCheckboxTooltipPosition = input('below', /* @ts-ignore */
105
- ...(ngDevMode ? [{ debugName: "toggleAllCheckboxTooltipPosition" }] : /* istanbul ignore next */ []));
106
- this.hideClearSearchButton = input(false, /* @ts-ignore */
107
- ...(ngDevMode ? [{ debugName: "hideClearSearchButton" }] : /* istanbul ignore next */ []));
108
- this.alwaysRestoreSelectedOptionsMulti = input(false, /* @ts-ignore */
109
- ...(ngDevMode ? [{ debugName: "alwaysRestoreSelectedOptionsMulti" }] : /* istanbul ignore next */ []));
110
- /**
111
- * 输入框防抖时间(毫秒),默认 300ms
112
- * 设置为 0 可禁用防抖
113
- */
114
- this.debounceTime = input(300, /* @ts-ignore */
115
- ...(ngDevMode ? [{ debugName: "debounceTime" }] : /* istanbul ignore next */ []));
116
- /**
117
- * 可选条目数量(由父组件提供)
118
- * 用于判断是否显示"无结果"提示
119
- * 如果未提供,则尝试从 matSelect.options.length 自动获取
120
- */
121
- this.optionsCount = input(null, /* @ts-ignore */
122
- ...(ngDevMode ? [{ debugName: "optionsCount" }] : /* istanbul ignore next */ []));
123
- this.matSelect = inject(MatSelect);
124
- this.matFormField = inject(MatFormField, { optional: true }) ?? null;
125
- this._viewportRuler = inject(ViewportRuler);
126
- this._matOption = inject(MatOption, { optional: true }) ?? null;
127
- this._defaultOptions = inject(MAT_SELECTSEARCH_DEFAULT_OPTIONS, { optional: true });
128
- this._destroyRef = inject(DestroyRef);
129
- this._options$ = signal(null, /* @ts-ignore */
130
- ...(ngDevMode ? [{ debugName: "_options$" }] : /* istanbul ignore next */ []));
131
- this._previousSelectedValues = [];
132
- this._valueSignal = signal('', /* @ts-ignore */
133
- ...(ngDevMode ? [{ debugName: "_valueSignal" }] : /* istanbul ignore next */ []));
134
- this.onTouched = () => {
135
- /* empty */
136
- };
137
- this._applyDefaultOptions(this._defaultOptions);
138
- this.showNoEntriesFound = computed(() => {
139
- // 优先使用父组件传递的 optionsCount(适用于 mat-table 等特殊情况)
140
- const providedCount = this.optionsCount();
141
- const optionsCount = providedCount ?? (this.matSelect?.options?.length ?? 0);
142
- const offset = this._getOptionsLengthOffset();
143
- const hasSearchValue = !!this._valueSignal();
144
- return !!this.noEntriesFoundLabel() && hasSearchValue && optionsCount <= offset;
145
- }, /* @ts-ignore */
146
- ...(ngDevMode ? [{ debugName: "showNoEntriesFound" }] : /* istanbul ignore next */ []));
147
- // 根据 debounceTime 动态构建 observable
148
- let valueChanges$ = this.formControl.valueChanges.pipe(startWith(this.formControl.value));
149
- // 如果 debounceTime > 0,添加防抖
150
- if (this.debounceTime() > 0) {
151
- valueChanges$ = valueChanges$.pipe(debounceTime(this.debounceTime()));
152
- }
153
- valueChanges$
154
- .pipe(takeUntilDestroyed(this._destroyRef))
155
- .subscribe((value) => {
156
- this._valueSignal.set(value ?? '');
157
- });
158
- effect(() => {
159
- const show = this.showNoEntriesFound();
160
- if (this._matOption) {
161
- const el = this._matOption._getHostElement();
162
- if (show) {
163
- el.classList.add('cmat-select-search-no-entries-found');
164
- }
165
- else {
166
- el.classList.remove('cmat-select-search-no-entries-found');
167
- }
168
- }
169
- });
170
- }
171
- get isInsideMatOption() {
172
- return !!this._matOption;
173
- }
174
- get value() {
175
- return this._valueSignal();
176
- }
177
- get _options() {
178
- return this._options$();
179
- }
180
- set _options(_options) {
181
- this._options$.set(_options);
182
- }
183
- ngOnInit() {
184
- const panelClass = 'cmat-select-search-panel';
185
- if (this.matSelect.panelClass) {
186
- if (Array.isArray(this.matSelect.panelClass)) {
187
- this.matSelect.panelClass.push(panelClass);
188
- }
189
- else if (typeof this.matSelect.panelClass === 'string') {
190
- this.matSelect.panelClass = [this.matSelect.panelClass, panelClass];
191
- }
192
- else if (typeof this.matSelect.panelClass === 'object') {
193
- this.matSelect.panelClass[panelClass] =
194
- true;
195
- }
196
- }
197
- else {
198
- this.matSelect.panelClass = panelClass;
199
- }
200
- if (this._matOption) {
201
- this._matOption.disabled = true;
202
- this._matOption
203
- ._getHostElement()
204
- .classList.add('contains-cmat-select-search');
205
- this._matOption._getHostElement().setAttribute('aria-hidden', 'true');
206
- }
207
- else {
208
- console.error('<cmat-select-search> must be placed inside a <mat-option> element');
209
- }
210
- this.matSelect.openedChange
211
- .pipe(delay(1), takeUntilDestroyed(this._destroyRef))
212
- .subscribe((opened) => {
213
- if (opened) {
214
- this.updateInputWidth();
215
- if (!this.disableInitialFocus()) {
216
- this.focus();
217
- }
218
- }
219
- else {
220
- if (this.clearSearchInput()) {
221
- this.reset();
222
- }
223
- }
224
- });
225
- this.matSelect.openedChange
226
- .pipe(take(1))
227
- .pipe(takeUntilDestroyed(this._destroyRef))
228
- .subscribe(() => {
229
- if (this.matSelect._keyManager) {
230
- this.matSelect._keyManager.change
231
- .pipe(takeUntilDestroyed(this._destroyRef))
232
- .subscribe(() => this._adjustScrollTopToFitActiveOptionIntoView());
233
- }
234
- else {
235
- console.warn('_keyManager was not initialized.');
236
- }
237
- this._options = this.matSelect.options;
238
- let previousFirstOption = this._options.toArray()[this._getOptionsLengthOffset()];
239
- this._options.changes
240
- .pipe(takeUntilDestroyed(this._destroyRef))
241
- .subscribe(() => {
242
- setTimeout(() => {
243
- if (this._options) {
244
- const options = this._options.toArray();
245
- const currentFirstOption = options[this._getOptionsLengthOffset()];
246
- const keyManager = this.matSelect._keyManager;
247
- if (keyManager && this.matSelect.panelOpen) {
248
- const firstOptionIsChanged = !this.matSelect.compareWith(previousFirstOption, currentFirstOption);
249
- if (firstOptionIsChanged ||
250
- !keyManager.activeItem ||
251
- !options.find((option) => this.matSelect.compareWith(option, keyManager.activeItem))) {
252
- keyManager.setFirstItemActive();
253
- }
254
- setTimeout(() => {
255
- this.updateInputWidth();
256
- });
257
- if (!this.disableScrollToActiveOnOptionsChanged()) {
258
- this._adjustScrollTopToFitActiveOptionIntoView();
259
- }
260
- }
261
- previousFirstOption = currentFirstOption;
262
- }
263
- });
264
- });
265
- });
266
- this._viewportRuler
267
- .change()
268
- .pipe(takeUntilDestroyed(this._destroyRef))
269
- .subscribe(() => {
270
- if (this.matSelect.panelOpen) {
271
- this.updateInputWidth();
272
- }
273
- });
274
- this._initMultipleHandling();
275
- }
276
- emitSelectAllBooleanToParent(state) {
277
- this.toggleAll.emit(state);
278
- }
279
- isToggleAllCheckboxVisible() {
280
- return this.matSelect.multiple && this.showToggleAllCheckbox();
281
- }
282
- handleKeydown(event) {
283
- if (event.key?.length === 1 ||
284
- (this.preventHomeEndKeyPropagation() &&
285
- (event.code === 'Home' || event.code === 'End'))) {
286
- event.stopPropagation();
287
- }
288
- if (this.matSelect.multiple && event.key && event.code === 'Enter') {
289
- setTimeout(() => this.focus());
290
- }
291
- if (this.enableClearOnEscapePressed() === true &&
292
- event.code === 'Escape' &&
293
- this.value) {
294
- this.reset(true);
295
- event.stopPropagation();
296
- }
297
- }
298
- handleKeyup(event) {
299
- // 方向键切换时同步当前高亮项
300
- if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
301
- const ariaActiveDescendantId = this.matSelect._getAriaActiveDescendant();
302
- const index = this._options
303
- ?.toArray()
304
- .findIndex((item) => item.id === ariaActiveDescendantId) ??
305
- -1;
306
- if (index >= 0) {
307
- this._unselectActiveDescendant();
308
- this._activeDescendant = this._options
309
- ?.toArray()[index]._getHostElement();
310
- this._activeDescendant?.setAttribute('aria-selected', 'true');
311
- if (ariaActiveDescendantId) {
312
- this.searchSelectInput().nativeElement.setAttribute('aria-activedescendant', ariaActiveDescendantId);
313
- }
314
- else {
315
- this.searchSelectInput().nativeElement.removeAttribute('aria-activedescendant');
316
- }
317
- }
318
- }
319
- }
320
- writeValue(value) {
321
- this._lastExternalInputValue = value;
322
- this.formControl.setValue(value);
323
- }
324
- onBlur() {
325
- // 失焦时清理高亮并触发 touched
326
- this._unselectActiveDescendant();
327
- this.onTouched();
328
- }
329
- registerOnChange(fn) {
330
- this.formControl.valueChanges
331
- .pipe(filter((value) => value !== this._lastExternalInputValue), tap(() => (this._lastExternalInputValue = undefined)), takeUntilDestroyed(this._destroyRef))
332
- .subscribe(fn);
333
- }
334
- registerOnTouched(fn) {
335
- this.onTouched = fn;
336
- }
337
- focus() {
338
- // 聚焦并保持面板滚动位置
339
- if (!this.searchSelectInput() || !this.matSelect.panel) {
340
- return;
341
- }
342
- const panel = this.matSelect.panel.nativeElement;
343
- const scrollTop = panel.scrollTop;
344
- this.searchSelectInput().nativeElement.focus();
345
- panel.scrollTop = scrollTop;
346
- }
347
- reset(focus) {
348
- this.formControl.setValue('');
349
- if (focus) {
350
- this.focus();
351
- }
352
- }
353
- updateInputWidth() {
354
- const innerEl = this.innerSelectSearch();
355
- if (!innerEl?.nativeElement) {
356
- return;
357
- }
358
- let currentElement = innerEl.nativeElement;
359
- let panelElement = null;
360
- while (currentElement?.parentElement) {
361
- currentElement = currentElement.parentElement;
362
- if (currentElement.classList.contains('mat-select-panel')) {
363
- panelElement = currentElement;
364
- break;
365
- }
366
- }
367
- if (panelElement) {
368
- innerEl.nativeElement.style.width =
369
- panelElement.clientWidth + 'px';
370
- }
371
- }
372
- _getMatOptionHeight() {
373
- if (this.matSelect.options.length > 0) {
374
- return this.matSelect.options.first
375
- ._getHostElement()
376
- .getBoundingClientRect().height;
377
- }
378
- return 0;
379
- }
380
- _getOptionsLengthOffset() {
381
- // 如果嵌套在 mat-option 内,则偏移一个选项
382
- if (this._matOption) {
383
- return 1;
384
- }
385
- else {
386
- return 0;
387
- }
388
- }
389
- _unselectActiveDescendant() {
390
- // 清理当前高亮项的 aria 状态
391
- this._activeDescendant?.removeAttribute('aria-selected');
392
- this.searchSelectInput().nativeElement.removeAttribute('aria-activedescendant');
393
- }
394
- _applyDefaultOptions(defaultOptions) {
395
- // 应用默认配置
396
- if (!defaultOptions) {
397
- return;
398
- }
399
- const options = defaultOptions;
400
- Object.assign(this, options);
401
- }
402
- _initMultipleHandling() {
403
- if (!this.matSelect.ngControl) {
404
- if (this.matSelect.multiple) {
405
- console.error('the mat-select containing cmat-select-search must have a ngModel or formControl directive when multiple=true');
406
- }
407
- return;
408
- }
409
- this._previousSelectedValues = this.matSelect.ngControl.value;
410
- this.matSelect.ngControl.valueChanges
411
- ?.pipe(takeUntilDestroyed(this._destroyRef))
412
- .subscribe((values) => {
413
- let restoreSelectedValues = false;
414
- let currentValues = Array.isArray(values) ? values : [];
415
- if (this.matSelect.multiple) {
416
- if ((this.alwaysRestoreSelectedOptionsMulti() ||
417
- this._valueSignal().length) &&
418
- this._previousSelectedValues &&
419
- Array.isArray(this._previousSelectedValues)) {
420
- const optionValues = this.matSelect.options.map((option) => option.value);
421
- this._previousSelectedValues.forEach((previousValue) => {
422
- if (!currentValues.some((v) => this.matSelect.compareWith(v, previousValue)) &&
423
- !optionValues.some((v) => this.matSelect.compareWith(v, previousValue))) {
424
- currentValues.push(previousValue);
425
- restoreSelectedValues = true;
426
- }
427
- });
428
- }
429
- }
430
- this._previousSelectedValues = currentValues;
431
- if (restoreSelectedValues) {
432
- this.matSelect._onChange(currentValues);
433
- }
434
- });
435
- }
436
- _adjustScrollTopToFitActiveOptionIntoView() {
437
- // 滚动到当前高亮项附近
438
- if (this.matSelect.panel && this.matSelect.options.length > 0) {
439
- const matOptionHeight = this._getMatOptionHeight();
440
- const activeOptionIndex = this.matSelect._keyManager.activeItemIndex ?? 0;
441
- const labelCount = _countGroupLabelsBeforeOption(activeOptionIndex, this.matSelect.options, this.matSelect.optionGroups);
442
- const indexOfOptionToFitIntoView = (this._matOption ? -1 : 0) + labelCount + activeOptionIndex;
443
- const currentScrollTop = this.matSelect.panel.nativeElement.scrollTop;
444
- const innerEl = this.innerSelectSearch();
445
- const searchInputHeight = innerEl.nativeElement.offsetHeight;
446
- const amountOfVisibleOptions = Math.floor((SELECT_PANEL_MAX_HEIGHT - searchInputHeight) / matOptionHeight);
447
- const indexOfFirstVisibleOption = Math.round((currentScrollTop + searchInputHeight) / matOptionHeight) -
448
- 1;
449
- if (indexOfFirstVisibleOption >= indexOfOptionToFitIntoView) {
450
- this.matSelect.panel.nativeElement.scrollTop =
451
- indexOfOptionToFitIntoView * matOptionHeight;
452
- }
453
- else if (indexOfFirstVisibleOption + amountOfVisibleOptions <=
454
- indexOfOptionToFitIntoView) {
455
- this.matSelect.panel.nativeElement.scrollTop =
456
- (indexOfOptionToFitIntoView + 1) * matOptionHeight -
457
- (SELECT_PANEL_MAX_HEIGHT - searchInputHeight);
458
- }
459
- }
460
- }
461
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatSelectSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
462
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatSelectSearchComponent, isStandalone: true, selector: "cmat-select-search", inputs: { placeholderLabel: { classPropertyName: "placeholderLabel", publicName: "placeholderLabel", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, noEntriesFoundLabel: { classPropertyName: "noEntriesFoundLabel", publicName: "noEntriesFoundLabel", isSignal: true, isRequired: false, transformFunction: null }, showNoFoundLabel: { classPropertyName: "showNoFoundLabel", publicName: "showNoFoundLabel", isSignal: true, isRequired: false, transformFunction: null }, clearSearchInput: { classPropertyName: "clearSearchInput", publicName: "clearSearchInput", isSignal: true, isRequired: false, transformFunction: null }, searching: { classPropertyName: "searching", publicName: "searching", isSignal: true, isRequired: false, transformFunction: null }, disableInitialFocus: { classPropertyName: "disableInitialFocus", publicName: "disableInitialFocus", isSignal: true, isRequired: false, transformFunction: null }, enableClearOnEscapePressed: { classPropertyName: "enableClearOnEscapePressed", publicName: "enableClearOnEscapePressed", isSignal: true, isRequired: false, transformFunction: null }, preventHomeEndKeyPropagation: { classPropertyName: "preventHomeEndKeyPropagation", publicName: "preventHomeEndKeyPropagation", isSignal: true, isRequired: false, transformFunction: null }, disableScrollToActiveOnOptionsChanged: { classPropertyName: "disableScrollToActiveOnOptionsChanged", publicName: "disableScrollToActiveOnOptionsChanged", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, showToggleAllCheckbox: { classPropertyName: "showToggleAllCheckbox", publicName: "showToggleAllCheckbox", isSignal: true, isRequired: false, transformFunction: null }, toggleAllCheckboxChecked: { classPropertyName: "toggleAllCheckboxChecked", publicName: "toggleAllCheckboxChecked", isSignal: true, isRequired: false, transformFunction: null }, toggleAllCheckboxIndeterminate: { classPropertyName: "toggleAllCheckboxIndeterminate", publicName: "toggleAllCheckboxIndeterminate", isSignal: true, isRequired: false, transformFunction: null }, toggleAllCheckboxTooltipMessage: { classPropertyName: "toggleAllCheckboxTooltipMessage", publicName: "toggleAllCheckboxTooltipMessage", isSignal: true, isRequired: false, transformFunction: null }, toggleAllCheckboxTooltipPosition: { classPropertyName: "toggleAllCheckboxTooltipPosition", publicName: "toggleAllCheckboxTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, hideClearSearchButton: { classPropertyName: "hideClearSearchButton", publicName: "hideClearSearchButton", isSignal: true, isRequired: false, transformFunction: null }, alwaysRestoreSelectedOptionsMulti: { classPropertyName: "alwaysRestoreSelectedOptionsMulti", publicName: "alwaysRestoreSelectedOptionsMulti", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null }, optionsCount: { classPropertyName: "optionsCount", publicName: "optionsCount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggleAll: "toggleAll" }, host: { properties: { "class.cmat-select-search-inside-mat-option": "this.isInsideMatOption" } }, providers: [
463
- {
464
- provide: NG_VALUE_ACCESSOR,
465
- useExisting: forwardRef(() => CmatSelectSearchComponent),
466
- multi: true,
467
- },
468
- ], queries: [{ propertyName: "clearIcon", first: true, predicate: CmatSelectSearchClearDirective, descendants: true, isSignal: true }, { propertyName: "noEntriesFound", first: true, predicate: CmatSelectNoEntriesFoundDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "searchSelectInput", first: true, predicate: ["searchSelectInput"], descendants: true, isSignal: true }, { propertyName: "innerSelectSearch", first: true, predicate: ["innerSelectSearch"], descendants: true, isSignal: true }], exportAs: ["cmatSelectSearch"], ngImport: i0, template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div\r\n #innerSelectSearch\r\n class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{\r\n 'cmat-select-search-inner-multiple': matSelect.multiple,\r\n 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible(),\r\n }\"\r\n>\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox\r\n class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\"\r\n [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked()\"\r\n [indeterminate]=\"toggleAllCheckboxIndeterminate()\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage()\"\r\n [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition()\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\"\r\n >\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon\r\n class=\"cmat-select-search-icon\"\r\n color=\"primary\"\r\n svgIcon=\"heroicons_outline:magnifying-glass\"\r\n ></mat-icon>\r\n </span>\r\n <input\r\n #searchSelectInput\r\n matInput\r\n class=\"cmat-select-search-input cmat-input-element\"\r\n autocomplete=\"off\"\r\n [type]=\"type()\"\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholderLabel()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n (keydown)=\"handleKeydown($event)\"\r\n (keyup)=\"handleKeyup($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n @if (searching()) {\r\n <mat-spinner class=\"cmat-select-search-spinner\" diameter=\"16\"></mat-spinner>\r\n }\r\n\r\n @if (!hideClearSearchButton() && value && !searching()) {\r\n <button\r\n type=\"button\"\r\n matIconButton\r\n aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\"\r\n (click)=\"reset(true)\"\r\n >\r\n @if (clearIcon()) {\r\n <ng-content select=\"[cmatSelectSearchClear]\"></ng-content>\r\n } @else {\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n }\r\n </button>\r\n }\r\n\r\n <ng-content select=\".cmat-select-search-custom-header-content\"></ng-content>\r\n</div>\r\n\r\n@if (showNoEntriesFound()) {\r\n <div class=\"cmat-select-search-no-entries-found\">\r\n @if (noEntriesFound()) {\r\n <ng-content select=\"[cmatSelectNoEntriesFound]\"></ng-content>\r\n } @else {\r\n {{ noEntriesFoundLabel() }}\r\n }\r\n </div>\r\n}\r\n", styles: ["cmat-select-search .cmat-select-search-hidden{visibility:hidden}cmat-select-search .cmat-select-search-inner{position:absolute;top:0;left:0;width:100%;z-index:100;font-size:inherit;box-shadow:none;display:flex;border-bottom-width:1px;border-bottom-style:solid}cmat-select-search .cmat-select-search-inner.cmat-select-search-inner-multiple.cmat-select-search-inner-toggle-all{display:flex;align-items:center}cmat-select-search .cmat-select-search-inner .cmat-input-element{flex-basis:auto;vertical-align:middle!important}cmat-select-search .cmat-select-search-input{box-sizing:border-box;width:100%;border:none;font-family:inherit;font-size:inherit;color:currentColor;outline:none;background:none;padding:0 44px 0 16px;height:47px!important;line-height:47px!important}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-input{padding-right:16px;padding-left:44px}cmat-select-search .cmat-select-search-no-entries-found{padding-top:8px}cmat-select-search .cmat-select-search-clear{position:absolute;right:4px;top:5px}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-clear{right:auto;left:4px}cmat-select-search .cmat-select-search-spinner{position:absolute;right:16px;top:calc(50% - 8px)}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-spinner{right:auto;left:16px}cmat-select-search .cmat-select-search-toggle-all-checkbox{padding-left:5px;padding-bottom:2px}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-toggle-all-checkbox{padding-left:0;padding-right:5px}cmat-select-search .cmat-select-search-toggle-all-checkbox .mdc-checkbox{opacity:1!important}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search{position:sticky;top:0;z-index:1;opacity:1;pointer-events:all;background:var(--mat-select-panel-background-color)}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search .mat-icon{margin-right:0;margin-left:0}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search mat-pseudo-checkbox{display:none}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search .mdc-list-item__primary-text{opacity:1}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search.cmat-select-search-no-entries-found{height:96px}.cmat-select-search-panel{transform:none!important;overflow-x:hidden;position:relative;padding:0!important}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
469
- }
470
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatSelectSearchComponent, decorators: [{
471
- type: Component,
472
- args: [{ selector: 'cmat-select-search', providers: [
473
- {
474
- provide: NG_VALUE_ACCESSOR,
475
- useExisting: forwardRef(() => CmatSelectSearchComponent),
476
- multi: true,
477
- },
478
- ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatSelectSearch', imports: [
479
- MatInputModule,
480
- NgClass,
481
- MatCheckboxModule,
482
- MatTooltipModule,
483
- MatFormFieldModule,
484
- MatIconModule,
485
- FormsModule,
486
- ReactiveFormsModule,
487
- MatProgressSpinnerModule,
488
- MatButtonModule
489
- ], template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div\r\n #innerSelectSearch\r\n class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{\r\n 'cmat-select-search-inner-multiple': matSelect.multiple,\r\n 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible(),\r\n }\"\r\n>\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox\r\n class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\"\r\n [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked()\"\r\n [indeterminate]=\"toggleAllCheckboxIndeterminate()\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage()\"\r\n [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition()\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\"\r\n >\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon\r\n class=\"cmat-select-search-icon\"\r\n color=\"primary\"\r\n svgIcon=\"heroicons_outline:magnifying-glass\"\r\n ></mat-icon>\r\n </span>\r\n <input\r\n #searchSelectInput\r\n matInput\r\n class=\"cmat-select-search-input cmat-input-element\"\r\n autocomplete=\"off\"\r\n [type]=\"type()\"\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholderLabel()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n (keydown)=\"handleKeydown($event)\"\r\n (keyup)=\"handleKeyup($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n @if (searching()) {\r\n <mat-spinner class=\"cmat-select-search-spinner\" diameter=\"16\"></mat-spinner>\r\n }\r\n\r\n @if (!hideClearSearchButton() && value && !searching()) {\r\n <button\r\n type=\"button\"\r\n matIconButton\r\n aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\"\r\n (click)=\"reset(true)\"\r\n >\r\n @if (clearIcon()) {\r\n <ng-content select=\"[cmatSelectSearchClear]\"></ng-content>\r\n } @else {\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n }\r\n </button>\r\n }\r\n\r\n <ng-content select=\".cmat-select-search-custom-header-content\"></ng-content>\r\n</div>\r\n\r\n@if (showNoEntriesFound()) {\r\n <div class=\"cmat-select-search-no-entries-found\">\r\n @if (noEntriesFound()) {\r\n <ng-content select=\"[cmatSelectNoEntriesFound]\"></ng-content>\r\n } @else {\r\n {{ noEntriesFoundLabel() }}\r\n }\r\n </div>\r\n}\r\n", styles: ["cmat-select-search .cmat-select-search-hidden{visibility:hidden}cmat-select-search .cmat-select-search-inner{position:absolute;top:0;left:0;width:100%;z-index:100;font-size:inherit;box-shadow:none;display:flex;border-bottom-width:1px;border-bottom-style:solid}cmat-select-search .cmat-select-search-inner.cmat-select-search-inner-multiple.cmat-select-search-inner-toggle-all{display:flex;align-items:center}cmat-select-search .cmat-select-search-inner .cmat-input-element{flex-basis:auto;vertical-align:middle!important}cmat-select-search .cmat-select-search-input{box-sizing:border-box;width:100%;border:none;font-family:inherit;font-size:inherit;color:currentColor;outline:none;background:none;padding:0 44px 0 16px;height:47px!important;line-height:47px!important}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-input{padding-right:16px;padding-left:44px}cmat-select-search .cmat-select-search-no-entries-found{padding-top:8px}cmat-select-search .cmat-select-search-clear{position:absolute;right:4px;top:5px}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-clear{right:auto;left:4px}cmat-select-search .cmat-select-search-spinner{position:absolute;right:16px;top:calc(50% - 8px)}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-spinner{right:auto;left:16px}cmat-select-search .cmat-select-search-toggle-all-checkbox{padding-left:5px;padding-bottom:2px}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-toggle-all-checkbox{padding-left:0;padding-right:5px}cmat-select-search .cmat-select-search-toggle-all-checkbox .mdc-checkbox{opacity:1!important}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search{position:sticky;top:0;z-index:1;opacity:1;pointer-events:all;background:var(--mat-select-panel-background-color)}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search .mat-icon{margin-right:0;margin-left:0}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search mat-pseudo-checkbox{display:none}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search .mdc-list-item__primary-text{opacity:1}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search.cmat-select-search-no-entries-found{height:96px}.cmat-select-search-panel{transform:none!important;overflow-x:hidden;position:relative;padding:0!important}\n"] }]
490
- }], ctorParameters: () => [], propDecorators: { toggleAll: [{ type: i0.Output, args: ["toggleAll"] }], searchSelectInput: [{ type: i0.ViewChild, args: ['searchSelectInput', { isSignal: true }] }], innerSelectSearch: [{ type: i0.ViewChild, args: ['innerSelectSearch', { isSignal: true }] }], clearIcon: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CmatSelectSearchClearDirective), { isSignal: true }] }], noEntriesFound: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CmatSelectNoEntriesFoundDirective), { isSignal: true }] }], placeholderLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholderLabel", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], noEntriesFoundLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noEntriesFoundLabel", required: false }] }], showNoFoundLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showNoFoundLabel", required: false }] }], clearSearchInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearSearchInput", required: false }] }], searching: [{ type: i0.Input, args: [{ isSignal: true, alias: "searching", required: false }] }], disableInitialFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableInitialFocus", required: false }] }], enableClearOnEscapePressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableClearOnEscapePressed", required: false }] }], preventHomeEndKeyPropagation: [{ type: i0.Input, args: [{ isSignal: true, alias: "preventHomeEndKeyPropagation", required: false }] }], disableScrollToActiveOnOptionsChanged: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableScrollToActiveOnOptionsChanged", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], showToggleAllCheckbox: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToggleAllCheckbox", required: false }] }], toggleAllCheckboxChecked: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleAllCheckboxChecked", required: false }] }], toggleAllCheckboxIndeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleAllCheckboxIndeterminate", required: false }] }], toggleAllCheckboxTooltipMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleAllCheckboxTooltipMessage", required: false }] }], toggleAllCheckboxTooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleAllCheckboxTooltipPosition", required: false }] }], hideClearSearchButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideClearSearchButton", required: false }] }], alwaysRestoreSelectedOptionsMulti: [{ type: i0.Input, args: [{ isSignal: true, alias: "alwaysRestoreSelectedOptionsMulti", required: false }] }], debounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceTime", required: false }] }], optionsCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsCount", required: false }] }], isInsideMatOption: [{
491
- type: HostBinding,
492
- args: ['class.cmat-select-search-inside-mat-option']
493
- }] } });
494
-
495
- /**
496
- * Generated bundle index. Do not edit.
497
- */
498
-
102
+ var CmatSelectSearchComponent = class CmatSelectSearchComponent {
103
+ constructor() {
104
+ this.toggleAll = output();
105
+ this.searchSelectInput = viewChild.required("searchSelectInput", ...ngDevMode ? [{ debugName: "searchSelectInput" }] : /* istanbul ignore next */ []);
106
+ this.innerSelectSearch = viewChild.required("innerSelectSearch", ...ngDevMode ? [{ debugName: "innerSelectSearch" }] : /* istanbul ignore next */ []);
107
+ this.clearIcon = contentChild(CmatSelectSearchClearDirective, ...ngDevMode ? [{ debugName: "clearIcon" }] : /* istanbul ignore next */ []);
108
+ this.noEntriesFound = contentChild(CmatSelectNoEntriesFoundDirective, ...ngDevMode ? [{ debugName: "noEntriesFound" }] : /* istanbul ignore next */ []);
109
+ this.formControl = new FormControl("");
110
+ this.placeholderLabel = input("搜索", ...ngDevMode ? [{ debugName: "placeholderLabel" }] : /* istanbul ignore next */ []);
111
+ this.type = input("text", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
112
+ this.noEntriesFoundLabel = input("无结果", ...ngDevMode ? [{ debugName: "noEntriesFoundLabel" }] : /* istanbul ignore next */ []);
113
+ this.showNoFoundLabel = input(true, ...ngDevMode ? [{ debugName: "showNoFoundLabel" }] : /* istanbul ignore next */ []);
114
+ this.clearSearchInput = input(true, ...ngDevMode ? [{ debugName: "clearSearchInput" }] : /* istanbul ignore next */ []);
115
+ this.searching = input(false, ...ngDevMode ? [{ debugName: "searching" }] : /* istanbul ignore next */ []);
116
+ this.disableInitialFocus = input(false, ...ngDevMode ? [{ debugName: "disableInitialFocus" }] : /* istanbul ignore next */ []);
117
+ this.enableClearOnEscapePressed = input(false, ...ngDevMode ? [{ debugName: "enableClearOnEscapePressed" }] : /* istanbul ignore next */ []);
118
+ this.preventHomeEndKeyPropagation = input(false, ...ngDevMode ? [{ debugName: "preventHomeEndKeyPropagation" }] : /* istanbul ignore next */ []);
119
+ this.disableScrollToActiveOnOptionsChanged = input(false, ...ngDevMode ? [{ debugName: "disableScrollToActiveOnOptionsChanged" }] : /* istanbul ignore next */ []);
120
+ this.ariaLabel = input("下拉搜索", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
121
+ this.showToggleAllCheckbox = input(false, ...ngDevMode ? [{ debugName: "showToggleAllCheckbox" }] : /* istanbul ignore next */ []);
122
+ this.toggleAllCheckboxChecked = input(false, ...ngDevMode ? [{ debugName: "toggleAllCheckboxChecked" }] : /* istanbul ignore next */ []);
123
+ this.toggleAllCheckboxIndeterminate = input(false, ...ngDevMode ? [{ debugName: "toggleAllCheckboxIndeterminate" }] : /* istanbul ignore next */ []);
124
+ this.toggleAllCheckboxTooltipMessage = input("", ...ngDevMode ? [{ debugName: "toggleAllCheckboxTooltipMessage" }] : /* istanbul ignore next */ []);
125
+ this.toggleAllCheckboxTooltipPosition = input("below", ...ngDevMode ? [{ debugName: "toggleAllCheckboxTooltipPosition" }] : /* istanbul ignore next */ []);
126
+ this.hideClearSearchButton = input(false, ...ngDevMode ? [{ debugName: "hideClearSearchButton" }] : /* istanbul ignore next */ []);
127
+ this.alwaysRestoreSelectedOptionsMulti = input(false, ...ngDevMode ? [{ debugName: "alwaysRestoreSelectedOptionsMulti" }] : /* istanbul ignore next */ []);
128
+ this.debounceTime = input(300, ...ngDevMode ? [{ debugName: "debounceTime" }] : /* istanbul ignore next */ []);
129
+ this.optionsCount = input(null, ...ngDevMode ? [{ debugName: "optionsCount" }] : /* istanbul ignore next */ []);
130
+ this.matSelect = inject(MatSelect);
131
+ this.matFormField = inject(MatFormField, { optional: true }) ?? null;
132
+ this._viewportRuler = inject(ViewportRuler);
133
+ this._matOption = inject(MatOption, { optional: true }) ?? null;
134
+ this._defaultOptions = inject(MAT_SELECTSEARCH_DEFAULT_OPTIONS, { optional: true });
135
+ this._destroyRef = inject(DestroyRef);
136
+ this._options$ = signal(null, ...ngDevMode ? [{ debugName: "_options$" }] : /* istanbul ignore next */ []);
137
+ this._previousSelectedValues = [];
138
+ this._valueSignal = signal("", ...ngDevMode ? [{ debugName: "_valueSignal" }] : /* istanbul ignore next */ []);
139
+ this.onTouched = () => {};
140
+ this._applyDefaultOptions(this._defaultOptions);
141
+ this.showNoEntriesFound = computed(() => {
142
+ const optionsCount = this.optionsCount() ?? this.matSelect?.options?.length ?? 0;
143
+ const offset = this._getOptionsLengthOffset();
144
+ const hasSearchValue = !!this._valueSignal();
145
+ return !!this.noEntriesFoundLabel() && hasSearchValue && optionsCount <= offset;
146
+ }, ...ngDevMode ? [{ debugName: "showNoEntriesFound" }] : /* istanbul ignore next */ []);
147
+ let valueChanges$ = this.formControl.valueChanges.pipe(startWith(this.formControl.value));
148
+ if (this.debounceTime() > 0) valueChanges$ = valueChanges$.pipe(debounceTime(this.debounceTime()));
149
+ valueChanges$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((value) => {
150
+ this._valueSignal.set(value ?? "");
151
+ });
152
+ effect(() => {
153
+ const show = this.showNoEntriesFound();
154
+ if (this._matOption) {
155
+ const el = this._matOption._getHostElement();
156
+ if (show) el.classList.add("cmat-select-search-no-entries-found");
157
+ else el.classList.remove("cmat-select-search-no-entries-found");
158
+ }
159
+ });
160
+ }
161
+ get isInsideMatOption() {
162
+ return !!this._matOption;
163
+ }
164
+ get value() {
165
+ return this._valueSignal();
166
+ }
167
+ get _options() {
168
+ return this._options$();
169
+ }
170
+ set _options(_options) {
171
+ this._options$.set(_options);
172
+ }
173
+ ngOnInit() {
174
+ const panelClass = "cmat-select-search-panel";
175
+ if (this.matSelect.panelClass) {
176
+ if (Array.isArray(this.matSelect.panelClass)) this.matSelect.panelClass.push(panelClass);
177
+ else if (typeof this.matSelect.panelClass === "string") this.matSelect.panelClass = [this.matSelect.panelClass, panelClass];
178
+ else if (typeof this.matSelect.panelClass === "object") this.matSelect.panelClass[panelClass] = true;
179
+ } else this.matSelect.panelClass = panelClass;
180
+ if (this._matOption) {
181
+ this._matOption.disabled = true;
182
+ this._matOption._getHostElement().classList.add("contains-cmat-select-search");
183
+ this._matOption._getHostElement().setAttribute("aria-hidden", "true");
184
+ } else console.error("<cmat-select-search> must be placed inside a <mat-option> element");
185
+ this.matSelect.openedChange.pipe(delay(1), takeUntilDestroyed(this._destroyRef)).subscribe((opened) => {
186
+ if (opened) {
187
+ this.updateInputWidth();
188
+ if (!this.disableInitialFocus()) this.focus();
189
+ } else if (this.clearSearchInput()) this.reset();
190
+ });
191
+ this.matSelect.openedChange.pipe(take(1)).pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
192
+ if (this.matSelect._keyManager) this.matSelect._keyManager.change.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => this._adjustScrollTopToFitActiveOptionIntoView());
193
+ else console.warn("_keyManager was not initialized.");
194
+ this._options = this.matSelect.options;
195
+ let previousFirstOption = this._options.toArray()[this._getOptionsLengthOffset()];
196
+ this._options.changes.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
197
+ setTimeout(() => {
198
+ if (this._options) {
199
+ const options = this._options.toArray();
200
+ const currentFirstOption = options[this._getOptionsLengthOffset()];
201
+ const keyManager = this.matSelect._keyManager;
202
+ if (keyManager && this.matSelect.panelOpen) {
203
+ if (!this.matSelect.compareWith(previousFirstOption, currentFirstOption) || !keyManager.activeItem || !options.find((option) => this.matSelect.compareWith(option, keyManager.activeItem))) keyManager.setFirstItemActive();
204
+ setTimeout(() => {
205
+ this.updateInputWidth();
206
+ });
207
+ if (!this.disableScrollToActiveOnOptionsChanged()) this._adjustScrollTopToFitActiveOptionIntoView();
208
+ }
209
+ previousFirstOption = currentFirstOption;
210
+ }
211
+ });
212
+ });
213
+ });
214
+ this._viewportRuler.change().pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
215
+ if (this.matSelect.panelOpen) this.updateInputWidth();
216
+ });
217
+ this._initMultipleHandling();
218
+ }
219
+ emitSelectAllBooleanToParent(state) {
220
+ this.toggleAll.emit(state);
221
+ }
222
+ isToggleAllCheckboxVisible() {
223
+ return this.matSelect.multiple && this.showToggleAllCheckbox();
224
+ }
225
+ handleKeydown(event) {
226
+ if (event.key?.length === 1 || this.preventHomeEndKeyPropagation() && (event.code === "Home" || event.code === "End")) event.stopPropagation();
227
+ if (this.matSelect.multiple && event.key && event.code === "Enter") setTimeout(() => this.focus());
228
+ if (this.enableClearOnEscapePressed() === true && event.code === "Escape" && this.value) {
229
+ this.reset(true);
230
+ event.stopPropagation();
231
+ }
232
+ }
233
+ handleKeyup(event) {
234
+ if (event.code === "ArrowUp" || event.code === "ArrowDown") {
235
+ const ariaActiveDescendantId = this.matSelect._getAriaActiveDescendant();
236
+ const index = this._options?.toArray().findIndex((item) => item.id === ariaActiveDescendantId) ?? -1;
237
+ if (index >= 0) {
238
+ this._unselectActiveDescendant();
239
+ this._activeDescendant = this._options?.toArray()[index]._getHostElement();
240
+ this._activeDescendant?.setAttribute("aria-selected", "true");
241
+ if (ariaActiveDescendantId) this.searchSelectInput().nativeElement.setAttribute("aria-activedescendant", ariaActiveDescendantId);
242
+ else this.searchSelectInput().nativeElement.removeAttribute("aria-activedescendant");
243
+ }
244
+ }
245
+ }
246
+ writeValue(value) {
247
+ this._lastExternalInputValue = value;
248
+ this.formControl.setValue(value);
249
+ }
250
+ onBlur() {
251
+ this._unselectActiveDescendant();
252
+ this.onTouched();
253
+ }
254
+ registerOnChange(fn) {
255
+ this.formControl.valueChanges.pipe(filter((value) => value !== this._lastExternalInputValue), tap(() => this._lastExternalInputValue = void 0), takeUntilDestroyed(this._destroyRef)).subscribe(fn);
256
+ }
257
+ registerOnTouched(fn) {
258
+ this.onTouched = fn;
259
+ }
260
+ focus() {
261
+ if (!this.searchSelectInput() || !this.matSelect.panel) return;
262
+ const panel = this.matSelect.panel.nativeElement;
263
+ const scrollTop = panel.scrollTop;
264
+ this.searchSelectInput().nativeElement.focus();
265
+ panel.scrollTop = scrollTop;
266
+ }
267
+ reset(focus) {
268
+ this.formControl.setValue("");
269
+ if (focus) this.focus();
270
+ }
271
+ updateInputWidth() {
272
+ const innerEl = this.innerSelectSearch();
273
+ if (!innerEl?.nativeElement) return;
274
+ let currentElement = innerEl.nativeElement;
275
+ let panelElement = null;
276
+ while (currentElement?.parentElement) {
277
+ currentElement = currentElement.parentElement;
278
+ if (currentElement.classList.contains("mat-select-panel")) {
279
+ panelElement = currentElement;
280
+ break;
281
+ }
282
+ }
283
+ if (panelElement) innerEl.nativeElement.style.width = panelElement.clientWidth + "px";
284
+ }
285
+ _getMatOptionHeight() {
286
+ if (this.matSelect.options.length > 0) return this.matSelect.options.first._getHostElement().getBoundingClientRect().height;
287
+ return 0;
288
+ }
289
+ _getOptionsLengthOffset() {
290
+ if (this._matOption) return 1;
291
+ else return 0;
292
+ }
293
+ _unselectActiveDescendant() {
294
+ this._activeDescendant?.removeAttribute("aria-selected");
295
+ this.searchSelectInput().nativeElement.removeAttribute("aria-activedescendant");
296
+ }
297
+ _applyDefaultOptions(defaultOptions) {
298
+ if (!defaultOptions) return;
299
+ const options = defaultOptions;
300
+ Object.assign(this, options);
301
+ }
302
+ _initMultipleHandling() {
303
+ if (!this.matSelect.ngControl) {
304
+ if (this.matSelect.multiple) console.error("the mat-select containing cmat-select-search must have a ngModel or formControl directive when multiple=true");
305
+ return;
306
+ }
307
+ this._previousSelectedValues = this.matSelect.ngControl.value;
308
+ this.matSelect.ngControl.valueChanges?.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((values) => {
309
+ let restoreSelectedValues = false;
310
+ let currentValues = Array.isArray(values) ? values : [];
311
+ if (this.matSelect.multiple) {
312
+ if ((this.alwaysRestoreSelectedOptionsMulti() || this._valueSignal().length) && this._previousSelectedValues && Array.isArray(this._previousSelectedValues)) {
313
+ const optionValues = this.matSelect.options.map((option) => option.value);
314
+ this._previousSelectedValues.forEach((previousValue) => {
315
+ if (!currentValues.some((v) => this.matSelect.compareWith(v, previousValue)) && !optionValues.some((v) => this.matSelect.compareWith(v, previousValue))) {
316
+ currentValues.push(previousValue);
317
+ restoreSelectedValues = true;
318
+ }
319
+ });
320
+ }
321
+ }
322
+ this._previousSelectedValues = currentValues;
323
+ if (restoreSelectedValues) this.matSelect._onChange(currentValues);
324
+ });
325
+ }
326
+ _adjustScrollTopToFitActiveOptionIntoView() {
327
+ if (this.matSelect.panel && this.matSelect.options.length > 0) {
328
+ const matOptionHeight = this._getMatOptionHeight();
329
+ const activeOptionIndex = this.matSelect._keyManager.activeItemIndex ?? 0;
330
+ const labelCount = _countGroupLabelsBeforeOption(activeOptionIndex, this.matSelect.options, this.matSelect.optionGroups);
331
+ const indexOfOptionToFitIntoView = (this._matOption ? -1 : 0) + labelCount + activeOptionIndex;
332
+ const currentScrollTop = this.matSelect.panel.nativeElement.scrollTop;
333
+ const searchInputHeight = this.innerSelectSearch().nativeElement.offsetHeight;
334
+ const amountOfVisibleOptions = Math.floor((SELECT_PANEL_MAX_HEIGHT - searchInputHeight) / matOptionHeight);
335
+ const indexOfFirstVisibleOption = Math.round((currentScrollTop + searchInputHeight) / matOptionHeight) - 1;
336
+ if (indexOfFirstVisibleOption >= indexOfOptionToFitIntoView) this.matSelect.panel.nativeElement.scrollTop = indexOfOptionToFitIntoView * matOptionHeight;
337
+ else if (indexOfFirstVisibleOption + amountOfVisibleOptions <= indexOfOptionToFitIntoView) this.matSelect.panel.nativeElement.scrollTop = (indexOfOptionToFitIntoView + 1) * matOptionHeight - (SELECT_PANEL_MAX_HEIGHT - searchInputHeight);
338
+ }
339
+ }
340
+ static {
341
+ this.ɵfac = i0.ɵɵngDeclareFactory({
342
+ minVersion: "12.0.0",
343
+ version: "22.2.3",
344
+ ngImport: i0,
345
+ type: CmatSelectSearchComponent,
346
+ deps: [],
347
+ target: i0.ɵɵFactoryTarget.Component
348
+ });
349
+ }
350
+ static {
351
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
352
+ minVersion: "17.0.0",
353
+ version: "22.2.3",
354
+ type: CmatSelectSearchComponent,
355
+ isStandalone: true,
356
+ selector: "cmat-select-search",
357
+ inputs: {
358
+ placeholderLabel: {
359
+ classPropertyName: "placeholderLabel",
360
+ publicName: "placeholderLabel",
361
+ isSignal: true,
362
+ isRequired: false,
363
+ transformFunction: null
364
+ },
365
+ type: {
366
+ classPropertyName: "type",
367
+ publicName: "type",
368
+ isSignal: true,
369
+ isRequired: false,
370
+ transformFunction: null
371
+ },
372
+ noEntriesFoundLabel: {
373
+ classPropertyName: "noEntriesFoundLabel",
374
+ publicName: "noEntriesFoundLabel",
375
+ isSignal: true,
376
+ isRequired: false,
377
+ transformFunction: null
378
+ },
379
+ showNoFoundLabel: {
380
+ classPropertyName: "showNoFoundLabel",
381
+ publicName: "showNoFoundLabel",
382
+ isSignal: true,
383
+ isRequired: false,
384
+ transformFunction: null
385
+ },
386
+ clearSearchInput: {
387
+ classPropertyName: "clearSearchInput",
388
+ publicName: "clearSearchInput",
389
+ isSignal: true,
390
+ isRequired: false,
391
+ transformFunction: null
392
+ },
393
+ searching: {
394
+ classPropertyName: "searching",
395
+ publicName: "searching",
396
+ isSignal: true,
397
+ isRequired: false,
398
+ transformFunction: null
399
+ },
400
+ disableInitialFocus: {
401
+ classPropertyName: "disableInitialFocus",
402
+ publicName: "disableInitialFocus",
403
+ isSignal: true,
404
+ isRequired: false,
405
+ transformFunction: null
406
+ },
407
+ enableClearOnEscapePressed: {
408
+ classPropertyName: "enableClearOnEscapePressed",
409
+ publicName: "enableClearOnEscapePressed",
410
+ isSignal: true,
411
+ isRequired: false,
412
+ transformFunction: null
413
+ },
414
+ preventHomeEndKeyPropagation: {
415
+ classPropertyName: "preventHomeEndKeyPropagation",
416
+ publicName: "preventHomeEndKeyPropagation",
417
+ isSignal: true,
418
+ isRequired: false,
419
+ transformFunction: null
420
+ },
421
+ disableScrollToActiveOnOptionsChanged: {
422
+ classPropertyName: "disableScrollToActiveOnOptionsChanged",
423
+ publicName: "disableScrollToActiveOnOptionsChanged",
424
+ isSignal: true,
425
+ isRequired: false,
426
+ transformFunction: null
427
+ },
428
+ ariaLabel: {
429
+ classPropertyName: "ariaLabel",
430
+ publicName: "ariaLabel",
431
+ isSignal: true,
432
+ isRequired: false,
433
+ transformFunction: null
434
+ },
435
+ showToggleAllCheckbox: {
436
+ classPropertyName: "showToggleAllCheckbox",
437
+ publicName: "showToggleAllCheckbox",
438
+ isSignal: true,
439
+ isRequired: false,
440
+ transformFunction: null
441
+ },
442
+ toggleAllCheckboxChecked: {
443
+ classPropertyName: "toggleAllCheckboxChecked",
444
+ publicName: "toggleAllCheckboxChecked",
445
+ isSignal: true,
446
+ isRequired: false,
447
+ transformFunction: null
448
+ },
449
+ toggleAllCheckboxIndeterminate: {
450
+ classPropertyName: "toggleAllCheckboxIndeterminate",
451
+ publicName: "toggleAllCheckboxIndeterminate",
452
+ isSignal: true,
453
+ isRequired: false,
454
+ transformFunction: null
455
+ },
456
+ toggleAllCheckboxTooltipMessage: {
457
+ classPropertyName: "toggleAllCheckboxTooltipMessage",
458
+ publicName: "toggleAllCheckboxTooltipMessage",
459
+ isSignal: true,
460
+ isRequired: false,
461
+ transformFunction: null
462
+ },
463
+ toggleAllCheckboxTooltipPosition: {
464
+ classPropertyName: "toggleAllCheckboxTooltipPosition",
465
+ publicName: "toggleAllCheckboxTooltipPosition",
466
+ isSignal: true,
467
+ isRequired: false,
468
+ transformFunction: null
469
+ },
470
+ hideClearSearchButton: {
471
+ classPropertyName: "hideClearSearchButton",
472
+ publicName: "hideClearSearchButton",
473
+ isSignal: true,
474
+ isRequired: false,
475
+ transformFunction: null
476
+ },
477
+ alwaysRestoreSelectedOptionsMulti: {
478
+ classPropertyName: "alwaysRestoreSelectedOptionsMulti",
479
+ publicName: "alwaysRestoreSelectedOptionsMulti",
480
+ isSignal: true,
481
+ isRequired: false,
482
+ transformFunction: null
483
+ },
484
+ debounceTime: {
485
+ classPropertyName: "debounceTime",
486
+ publicName: "debounceTime",
487
+ isSignal: true,
488
+ isRequired: false,
489
+ transformFunction: null
490
+ },
491
+ optionsCount: {
492
+ classPropertyName: "optionsCount",
493
+ publicName: "optionsCount",
494
+ isSignal: true,
495
+ isRequired: false,
496
+ transformFunction: null
497
+ }
498
+ },
499
+ outputs: { toggleAll: "toggleAll" },
500
+ host: { properties: { "class.cmat-select-search-inside-mat-option": "this.isInsideMatOption" } },
501
+ providers: [{
502
+ provide: NG_VALUE_ACCESSOR,
503
+ useExisting: forwardRef(() => CmatSelectSearchComponent),
504
+ multi: true
505
+ }],
506
+ queries: [{
507
+ propertyName: "clearIcon",
508
+ first: true,
509
+ predicate: CmatSelectSearchClearDirective,
510
+ descendants: true,
511
+ isSignal: true
512
+ }, {
513
+ propertyName: "noEntriesFound",
514
+ first: true,
515
+ predicate: CmatSelectNoEntriesFoundDirective,
516
+ descendants: true,
517
+ isSignal: true
518
+ }],
519
+ viewQueries: [{
520
+ propertyName: "searchSelectInput",
521
+ first: true,
522
+ predicate: ["searchSelectInput"],
523
+ descendants: true,
524
+ isSignal: true
525
+ }, {
526
+ propertyName: "innerSelectSearch",
527
+ first: true,
528
+ predicate: ["innerSelectSearch"],
529
+ descendants: true,
530
+ isSignal: true
531
+ }],
532
+ exportAs: ["cmatSelectSearch"],
533
+ ngImport: i0,
534
+ template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div\r\n #innerSelectSearch\r\n class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{\r\n 'cmat-select-search-inner-multiple': matSelect.multiple,\r\n 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible(),\r\n }\"\r\n>\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox\r\n class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\"\r\n [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked()\"\r\n [indeterminate]=\"toggleAllCheckboxIndeterminate()\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage()\"\r\n [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition()\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\"\r\n >\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon\r\n class=\"cmat-select-search-icon\"\r\n color=\"primary\"\r\n svgIcon=\"heroicons_outline:magnifying-glass\"\r\n ></mat-icon>\r\n </span>\r\n <input\r\n #searchSelectInput\r\n matInput\r\n class=\"cmat-select-search-input cmat-input-element\"\r\n autocomplete=\"off\"\r\n [type]=\"type()\"\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholderLabel()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n (keydown)=\"handleKeydown($event)\"\r\n (keyup)=\"handleKeyup($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n @if (searching()) {\r\n <mat-spinner class=\"cmat-select-search-spinner\" diameter=\"16\"></mat-spinner>\r\n }\r\n\r\n @if (!hideClearSearchButton() && value && !searching()) {\r\n <button\r\n type=\"button\"\r\n matIconButton\r\n aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\"\r\n (click)=\"reset(true)\"\r\n >\r\n @if (clearIcon()) {\r\n <ng-content select=\"[cmatSelectSearchClear]\"></ng-content>\r\n } @else {\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n }\r\n </button>\r\n }\r\n\r\n <ng-content select=\".cmat-select-search-custom-header-content\"></ng-content>\r\n</div>\r\n\r\n@if (showNoEntriesFound()) {\r\n <div class=\"cmat-select-search-no-entries-found\">\r\n @if (noEntriesFound()) {\r\n <ng-content select=\"[cmatSelectNoEntriesFound]\"></ng-content>\r\n } @else {\r\n {{ noEntriesFoundLabel() }}\r\n }\r\n </div>\r\n}\r\n",
535
+ styles: ["cmat-select-search .cmat-select-search-hidden{visibility:hidden}cmat-select-search .cmat-select-search-inner{position:absolute;top:0;left:0;width:100%;z-index:100;font-size:inherit;box-shadow:none;display:flex;border-bottom-width:1px;border-bottom-style:solid}cmat-select-search .cmat-select-search-inner.cmat-select-search-inner-multiple.cmat-select-search-inner-toggle-all{display:flex;align-items:center}cmat-select-search .cmat-select-search-inner .cmat-input-element{flex-basis:auto;vertical-align:middle!important}cmat-select-search .cmat-select-search-input{box-sizing:border-box;width:100%;border:none;font-family:inherit;font-size:inherit;color:currentColor;outline:none;background:none;padding:0 44px 0 16px;height:47px!important;line-height:47px!important}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-input{padding-right:16px;padding-left:44px}cmat-select-search .cmat-select-search-no-entries-found{padding-top:8px}cmat-select-search .cmat-select-search-clear{position:absolute;right:4px;top:5px}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-clear{right:auto;left:4px}cmat-select-search .cmat-select-search-spinner{position:absolute;right:16px;top:calc(50% - 8px)}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-spinner{right:auto;left:16px}cmat-select-search .cmat-select-search-toggle-all-checkbox{padding-left:5px;padding-bottom:2px}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-toggle-all-checkbox{padding-left:0;padding-right:5px}cmat-select-search .cmat-select-search-toggle-all-checkbox .mdc-checkbox{opacity:1!important}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search{position:sticky;top:0;z-index:1;opacity:1;pointer-events:all;background:var(--mat-select-panel-background-color)}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search .mat-icon{margin-right:0;margin-left:0}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search mat-pseudo-checkbox{display:none}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search .mdc-list-item__primary-text{opacity:1}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search.cmat-select-search-no-entries-found{height:96px}.cmat-select-search-panel{transform:none!important;overflow-x:hidden;position:relative;padding:0!important}\n"],
536
+ dependencies: [
537
+ {
538
+ kind: "ngmodule",
539
+ type: MatInputModule
540
+ },
541
+ {
542
+ kind: "directive",
543
+ type: i1.MatInput,
544
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
545
+ inputs: [
546
+ "disabled",
547
+ "id",
548
+ "placeholder",
549
+ "name",
550
+ "required",
551
+ "type",
552
+ "errorStateMatcher",
553
+ "aria-describedby",
554
+ "value",
555
+ "readonly",
556
+ "disabledInteractive"
557
+ ],
558
+ exportAs: ["matInput"]
559
+ },
560
+ {
561
+ kind: "directive",
562
+ type: i1.MatPrefix,
563
+ selector: "[matPrefix], [matIconPrefix], [matTextPrefix]",
564
+ inputs: ["matTextPrefix"]
565
+ },
566
+ {
567
+ kind: "directive",
568
+ type: NgClass,
569
+ selector: "[ngClass]",
570
+ inputs: ["class", "ngClass"]
571
+ },
572
+ {
573
+ kind: "ngmodule",
574
+ type: MatCheckboxModule
575
+ },
576
+ {
577
+ kind: "component",
578
+ type: i2.MatCheckbox,
579
+ selector: "mat-checkbox",
580
+ inputs: [
581
+ "aria-label",
582
+ "aria-labelledby",
583
+ "aria-describedby",
584
+ "aria-expanded",
585
+ "aria-controls",
586
+ "aria-owns",
587
+ "id",
588
+ "required",
589
+ "labelPosition",
590
+ "name",
591
+ "value",
592
+ "disableRipple",
593
+ "tabIndex",
594
+ "color",
595
+ "disabledInteractive",
596
+ "checked",
597
+ "disabled",
598
+ "indeterminate"
599
+ ],
600
+ outputs: ["change", "indeterminateChange"],
601
+ exportAs: ["matCheckbox"]
602
+ },
603
+ {
604
+ kind: "ngmodule",
605
+ type: MatTooltipModule
606
+ },
607
+ {
608
+ kind: "directive",
609
+ type: i3.MatTooltip,
610
+ selector: "[matTooltip]",
611
+ inputs: [
612
+ "matTooltipPosition",
613
+ "matTooltipPositionAtOrigin",
614
+ "matTooltipDisabled",
615
+ "matTooltipShowDelay",
616
+ "matTooltipHideDelay",
617
+ "matTooltipTouchGestures",
618
+ "matTooltip",
619
+ "matTooltipClass"
620
+ ],
621
+ exportAs: ["matTooltip"]
622
+ },
623
+ {
624
+ kind: "ngmodule",
625
+ type: MatFormFieldModule
626
+ },
627
+ {
628
+ kind: "ngmodule",
629
+ type: MatIconModule
630
+ },
631
+ {
632
+ kind: "component",
633
+ type: i4.MatIcon,
634
+ selector: "mat-icon",
635
+ inputs: [
636
+ "color",
637
+ "inline",
638
+ "svgIcon",
639
+ "fontSet",
640
+ "fontIcon"
641
+ ],
642
+ exportAs: ["matIcon"]
643
+ },
644
+ {
645
+ kind: "ngmodule",
646
+ type: FormsModule
647
+ },
648
+ {
649
+ kind: "directive",
650
+ type: i5.DefaultValueAccessor,
651
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
652
+ },
653
+ {
654
+ kind: "directive",
655
+ type: i5.NgControlStatus,
656
+ selector: "[formControlName],[ngModel],[formControl]"
657
+ },
658
+ {
659
+ kind: "ngmodule",
660
+ type: ReactiveFormsModule
661
+ },
662
+ {
663
+ kind: "directive",
664
+ type: i5.FormControlDirective,
665
+ selector: "[formControl]",
666
+ inputs: [
667
+ "formControl",
668
+ "disabled",
669
+ "ngModel"
670
+ ],
671
+ outputs: ["ngModelChange"],
672
+ exportAs: ["ngForm"]
673
+ },
674
+ {
675
+ kind: "ngmodule",
676
+ type: MatProgressSpinnerModule
677
+ },
678
+ {
679
+ kind: "component",
680
+ type: i6.MatProgressSpinner,
681
+ selector: "mat-progress-spinner, mat-spinner",
682
+ inputs: [
683
+ "color",
684
+ "mode",
685
+ "value",
686
+ "diameter",
687
+ "strokeWidth"
688
+ ],
689
+ exportAs: ["matProgressSpinner"]
690
+ },
691
+ {
692
+ kind: "ngmodule",
693
+ type: MatButtonModule
694
+ },
695
+ {
696
+ kind: "component",
697
+ type: i7.MatIconButton,
698
+ selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
699
+ exportAs: ["matButton", "matAnchor"]
700
+ }
701
+ ],
702
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
703
+ encapsulation: i0.ViewEncapsulation.None
704
+ });
705
+ }
706
+ };
707
+ i0.ɵɵngDeclareClassMetadata({
708
+ minVersion: "12.0.0",
709
+ version: "22.2.3",
710
+ ngImport: i0,
711
+ type: CmatSelectSearchComponent,
712
+ decorators: [{
713
+ type: Component,
714
+ args: [{
715
+ selector: "cmat-select-search",
716
+ providers: [{
717
+ provide: NG_VALUE_ACCESSOR,
718
+ useExisting: forwardRef(() => CmatSelectSearchComponent),
719
+ multi: true
720
+ }],
721
+ encapsulation: ViewEncapsulation.None,
722
+ changeDetection: ChangeDetectionStrategy.OnPush,
723
+ exportAs: "cmatSelectSearch",
724
+ imports: [
725
+ MatInputModule,
726
+ NgClass,
727
+ MatCheckboxModule,
728
+ MatTooltipModule,
729
+ MatFormFieldModule,
730
+ MatIconModule,
731
+ FormsModule,
732
+ ReactiveFormsModule,
733
+ MatProgressSpinnerModule,
734
+ MatButtonModule
735
+ ],
736
+ template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div\r\n #innerSelectSearch\r\n class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{\r\n 'cmat-select-search-inner-multiple': matSelect.multiple,\r\n 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible(),\r\n }\"\r\n>\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox\r\n class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\"\r\n [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked()\"\r\n [indeterminate]=\"toggleAllCheckboxIndeterminate()\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage()\"\r\n [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition()\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\"\r\n >\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon\r\n class=\"cmat-select-search-icon\"\r\n color=\"primary\"\r\n svgIcon=\"heroicons_outline:magnifying-glass\"\r\n ></mat-icon>\r\n </span>\r\n <input\r\n #searchSelectInput\r\n matInput\r\n class=\"cmat-select-search-input cmat-input-element\"\r\n autocomplete=\"off\"\r\n [type]=\"type()\"\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholderLabel()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n (keydown)=\"handleKeydown($event)\"\r\n (keyup)=\"handleKeyup($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n @if (searching()) {\r\n <mat-spinner class=\"cmat-select-search-spinner\" diameter=\"16\"></mat-spinner>\r\n }\r\n\r\n @if (!hideClearSearchButton() && value && !searching()) {\r\n <button\r\n type=\"button\"\r\n matIconButton\r\n aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\"\r\n (click)=\"reset(true)\"\r\n >\r\n @if (clearIcon()) {\r\n <ng-content select=\"[cmatSelectSearchClear]\"></ng-content>\r\n } @else {\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n }\r\n </button>\r\n }\r\n\r\n <ng-content select=\".cmat-select-search-custom-header-content\"></ng-content>\r\n</div>\r\n\r\n@if (showNoEntriesFound()) {\r\n <div class=\"cmat-select-search-no-entries-found\">\r\n @if (noEntriesFound()) {\r\n <ng-content select=\"[cmatSelectNoEntriesFound]\"></ng-content>\r\n } @else {\r\n {{ noEntriesFoundLabel() }}\r\n }\r\n </div>\r\n}\r\n",
737
+ styles: ["cmat-select-search .cmat-select-search-hidden{visibility:hidden}cmat-select-search .cmat-select-search-inner{position:absolute;top:0;left:0;width:100%;z-index:100;font-size:inherit;box-shadow:none;display:flex;border-bottom-width:1px;border-bottom-style:solid}cmat-select-search .cmat-select-search-inner.cmat-select-search-inner-multiple.cmat-select-search-inner-toggle-all{display:flex;align-items:center}cmat-select-search .cmat-select-search-inner .cmat-input-element{flex-basis:auto;vertical-align:middle!important}cmat-select-search .cmat-select-search-input{box-sizing:border-box;width:100%;border:none;font-family:inherit;font-size:inherit;color:currentColor;outline:none;background:none;padding:0 44px 0 16px;height:47px!important;line-height:47px!important}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-input{padding-right:16px;padding-left:44px}cmat-select-search .cmat-select-search-no-entries-found{padding-top:8px}cmat-select-search .cmat-select-search-clear{position:absolute;right:4px;top:5px}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-clear{right:auto;left:4px}cmat-select-search .cmat-select-search-spinner{position:absolute;right:16px;top:calc(50% - 8px)}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-spinner{right:auto;left:16px}cmat-select-search .cmat-select-search-toggle-all-checkbox{padding-left:5px;padding-bottom:2px}:host-context([dir=rtl]) cmat-select-search .cmat-select-search-toggle-all-checkbox{padding-left:0;padding-right:5px}cmat-select-search .cmat-select-search-toggle-all-checkbox .mdc-checkbox{opacity:1!important}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search{position:sticky;top:0;z-index:1;opacity:1;pointer-events:all;background:var(--mat-select-panel-background-color)}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search .mat-icon{margin-right:0;margin-left:0}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search mat-pseudo-checkbox{display:none}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search .mdc-list-item__primary-text{opacity:1}.mat-mdc-option[aria-disabled=true].contains-cmat-select-search.cmat-select-search-no-entries-found{height:96px}.cmat-select-search-panel{transform:none!important;overflow-x:hidden;position:relative;padding:0!important}\n"]
738
+ }]
739
+ }],
740
+ ctorParameters: () => [],
741
+ propDecorators: {
742
+ toggleAll: [{
743
+ type: i0.Output,
744
+ args: ["toggleAll"]
745
+ }],
746
+ searchSelectInput: [{
747
+ type: i0.ViewChild,
748
+ args: ["searchSelectInput", { isSignal: true }]
749
+ }],
750
+ innerSelectSearch: [{
751
+ type: i0.ViewChild,
752
+ args: ["innerSelectSearch", { isSignal: true }]
753
+ }],
754
+ clearIcon: [{
755
+ type: i0.ContentChild,
756
+ args: [i0.forwardRef(() => CmatSelectSearchClearDirective), { isSignal: true }]
757
+ }],
758
+ noEntriesFound: [{
759
+ type: i0.ContentChild,
760
+ args: [i0.forwardRef(() => CmatSelectNoEntriesFoundDirective), { isSignal: true }]
761
+ }],
762
+ placeholderLabel: [{
763
+ type: i0.Input,
764
+ args: [{
765
+ isSignal: true,
766
+ alias: "placeholderLabel",
767
+ required: false
768
+ }]
769
+ }],
770
+ type: [{
771
+ type: i0.Input,
772
+ args: [{
773
+ isSignal: true,
774
+ alias: "type",
775
+ required: false
776
+ }]
777
+ }],
778
+ noEntriesFoundLabel: [{
779
+ type: i0.Input,
780
+ args: [{
781
+ isSignal: true,
782
+ alias: "noEntriesFoundLabel",
783
+ required: false
784
+ }]
785
+ }],
786
+ showNoFoundLabel: [{
787
+ type: i0.Input,
788
+ args: [{
789
+ isSignal: true,
790
+ alias: "showNoFoundLabel",
791
+ required: false
792
+ }]
793
+ }],
794
+ clearSearchInput: [{
795
+ type: i0.Input,
796
+ args: [{
797
+ isSignal: true,
798
+ alias: "clearSearchInput",
799
+ required: false
800
+ }]
801
+ }],
802
+ searching: [{
803
+ type: i0.Input,
804
+ args: [{
805
+ isSignal: true,
806
+ alias: "searching",
807
+ required: false
808
+ }]
809
+ }],
810
+ disableInitialFocus: [{
811
+ type: i0.Input,
812
+ args: [{
813
+ isSignal: true,
814
+ alias: "disableInitialFocus",
815
+ required: false
816
+ }]
817
+ }],
818
+ enableClearOnEscapePressed: [{
819
+ type: i0.Input,
820
+ args: [{
821
+ isSignal: true,
822
+ alias: "enableClearOnEscapePressed",
823
+ required: false
824
+ }]
825
+ }],
826
+ preventHomeEndKeyPropagation: [{
827
+ type: i0.Input,
828
+ args: [{
829
+ isSignal: true,
830
+ alias: "preventHomeEndKeyPropagation",
831
+ required: false
832
+ }]
833
+ }],
834
+ disableScrollToActiveOnOptionsChanged: [{
835
+ type: i0.Input,
836
+ args: [{
837
+ isSignal: true,
838
+ alias: "disableScrollToActiveOnOptionsChanged",
839
+ required: false
840
+ }]
841
+ }],
842
+ ariaLabel: [{
843
+ type: i0.Input,
844
+ args: [{
845
+ isSignal: true,
846
+ alias: "ariaLabel",
847
+ required: false
848
+ }]
849
+ }],
850
+ showToggleAllCheckbox: [{
851
+ type: i0.Input,
852
+ args: [{
853
+ isSignal: true,
854
+ alias: "showToggleAllCheckbox",
855
+ required: false
856
+ }]
857
+ }],
858
+ toggleAllCheckboxChecked: [{
859
+ type: i0.Input,
860
+ args: [{
861
+ isSignal: true,
862
+ alias: "toggleAllCheckboxChecked",
863
+ required: false
864
+ }]
865
+ }],
866
+ toggleAllCheckboxIndeterminate: [{
867
+ type: i0.Input,
868
+ args: [{
869
+ isSignal: true,
870
+ alias: "toggleAllCheckboxIndeterminate",
871
+ required: false
872
+ }]
873
+ }],
874
+ toggleAllCheckboxTooltipMessage: [{
875
+ type: i0.Input,
876
+ args: [{
877
+ isSignal: true,
878
+ alias: "toggleAllCheckboxTooltipMessage",
879
+ required: false
880
+ }]
881
+ }],
882
+ toggleAllCheckboxTooltipPosition: [{
883
+ type: i0.Input,
884
+ args: [{
885
+ isSignal: true,
886
+ alias: "toggleAllCheckboxTooltipPosition",
887
+ required: false
888
+ }]
889
+ }],
890
+ hideClearSearchButton: [{
891
+ type: i0.Input,
892
+ args: [{
893
+ isSignal: true,
894
+ alias: "hideClearSearchButton",
895
+ required: false
896
+ }]
897
+ }],
898
+ alwaysRestoreSelectedOptionsMulti: [{
899
+ type: i0.Input,
900
+ args: [{
901
+ isSignal: true,
902
+ alias: "alwaysRestoreSelectedOptionsMulti",
903
+ required: false
904
+ }]
905
+ }],
906
+ debounceTime: [{
907
+ type: i0.Input,
908
+ args: [{
909
+ isSignal: true,
910
+ alias: "debounceTime",
911
+ required: false
912
+ }]
913
+ }],
914
+ optionsCount: [{
915
+ type: i0.Input,
916
+ args: [{
917
+ isSignal: true,
918
+ alias: "optionsCount",
919
+ required: false
920
+ }]
921
+ }],
922
+ isInsideMatOption: [{
923
+ type: HostBinding,
924
+ args: ["class.cmat-select-search-inside-mat-option"]
925
+ }]
926
+ }
927
+ });
499
928
  export { CmatSelectSearchComponent, MAT_SELECTSEARCH_DEFAULT_OPTIONS, configurableDefaultOptions };
500
- //# sourceMappingURL=cmat-components-select-search.mjs.map
929
+
930
+ //# sourceMappingURL=cmat-components-select-search.mjs.map