cmat 0.0.78 → 0.0.80

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 (211) hide show
  1. package/fesm2022/cmat-components-adapter.mjs +9 -46
  2. package/fesm2022/cmat-components-adapter.mjs.map +1 -1
  3. package/fesm2022/cmat-components-breadcrumb.mjs +104 -205
  4. package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
  5. package/fesm2022/cmat-components-card.mjs +4 -8
  6. package/fesm2022/cmat-components-card.mjs.map +1 -1
  7. package/fesm2022/cmat-components-carousel.mjs +21 -21
  8. package/fesm2022/cmat-components-carousel.mjs.map +1 -1
  9. package/fesm2022/cmat-components-cascade.mjs +18 -24
  10. package/fesm2022/cmat-components-cascade.mjs.map +1 -1
  11. package/fesm2022/cmat-components-chip-input.mjs +21 -21
  12. package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
  13. package/fesm2022/cmat-components-code-editor.mjs +4 -22
  14. package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
  15. package/fesm2022/cmat-components-custom-formly.mjs +181 -245
  16. package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
  17. package/fesm2022/cmat-components-date-range.mjs +12 -184
  18. package/fesm2022/cmat-components-date-range.mjs.map +1 -1
  19. package/fesm2022/cmat-components-date-time-display.mjs +3 -15
  20. package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
  21. package/fesm2022/cmat-components-drawer.mjs +10 -100
  22. package/fesm2022/cmat-components-drawer.mjs.map +1 -1
  23. package/fesm2022/cmat-components-empty-state.mjs +4 -25
  24. package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
  25. package/fesm2022/cmat-components-file-preview.mjs +3 -21
  26. package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
  27. package/fesm2022/cmat-components-filter-toolbar.mjs +7 -50
  28. package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
  29. package/fesm2022/cmat-components-form-actions.mjs +3 -9
  30. package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
  31. package/fesm2022/cmat-components-fullscreen.mjs +4 -4
  32. package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
  33. package/fesm2022/cmat-components-highlight.mjs +6 -32
  34. package/fesm2022/cmat-components-highlight.mjs.map +1 -1
  35. package/fesm2022/cmat-components-image-viewer.mjs +12 -24
  36. package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
  37. package/fesm2022/cmat-components-inline-loading.mjs +3 -12
  38. package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
  39. package/fesm2022/cmat-components-json-editor.mjs +11 -16
  40. package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
  41. package/fesm2022/cmat-components-knob-input.mjs +24 -18
  42. package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
  43. package/fesm2022/cmat-components-masonry.mjs +8 -17
  44. package/fesm2022/cmat-components-masonry.mjs.map +1 -1
  45. package/fesm2022/cmat-components-material-color-picker.mjs +13 -34
  46. package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
  47. package/fesm2022/cmat-components-material-datetimepicker.mjs +80 -436
  48. package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
  49. package/fesm2022/cmat-components-navigation.mjs +266 -816
  50. package/fesm2022/cmat-components-navigation.mjs.map +1 -1
  51. package/fesm2022/cmat-components-opt-input.mjs +7 -10
  52. package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
  53. package/fesm2022/cmat-components-org-chart.mjs +11 -11
  54. package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
  55. package/fesm2022/cmat-components-page-header.mjs +8 -19
  56. package/fesm2022/cmat-components-page-header.mjs.map +1 -1
  57. package/fesm2022/cmat-components-pagination.mjs +113 -108
  58. package/fesm2022/cmat-components-pagination.mjs.map +1 -1
  59. package/fesm2022/cmat-components-password-strength.mjs +13 -16
  60. package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
  61. package/fesm2022/cmat-components-popover.mjs +15 -151
  62. package/fesm2022/cmat-components-popover.mjs.map +1 -1
  63. package/fesm2022/cmat-components-progress-bar.mjs +16 -26
  64. package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
  65. package/fesm2022/cmat-components-qrcode.mjs +5 -11
  66. package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
  67. package/fesm2022/cmat-components-rating.mjs +14 -14
  68. package/fesm2022/cmat-components-rating.mjs.map +1 -1
  69. package/fesm2022/cmat-components-rich-text-editor.mjs +4 -25
  70. package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
  71. package/fesm2022/cmat-components-select-search.mjs +51 -79
  72. package/fesm2022/cmat-components-select-search.mjs.map +1 -1
  73. package/fesm2022/cmat-components-select-table.mjs +204 -162
  74. package/fesm2022/cmat-components-select-table.mjs.map +1 -1
  75. package/fesm2022/cmat-components-select-tree.mjs +142 -97
  76. package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
  77. package/fesm2022/cmat-components-skeleton.mjs +4 -22
  78. package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
  79. package/fesm2022/cmat-components-speed-dial.mjs +14 -19
  80. package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
  81. package/fesm2022/cmat-components-status-tag.mjs +3 -18
  82. package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
  83. package/fesm2022/cmat-components-table-toolbar.mjs +3 -15
  84. package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
  85. package/fesm2022/cmat-components-timeline.mjs +18 -21
  86. package/fesm2022/cmat-components-timeline.mjs.map +1 -1
  87. package/fesm2022/cmat-components-toast.mjs +20 -20
  88. package/fesm2022/cmat-components-toast.mjs.map +1 -1
  89. package/fesm2022/cmat-components-transfer-picker.mjs +159 -123
  90. package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
  91. package/fesm2022/cmat-components-treetable.mjs +17 -19
  92. package/fesm2022/cmat-components-treetable.mjs.map +1 -1
  93. package/fesm2022/cmat-components-upload.mjs +35 -57
  94. package/fesm2022/cmat-components-upload.mjs.map +1 -1
  95. package/fesm2022/cmat-components-x6-angular-shape.mjs +0 -4
  96. package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
  97. package/fesm2022/cmat-directives-animate-on-scroll.mjs +6 -27
  98. package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
  99. package/fesm2022/cmat-directives-arrow-cursor.mjs +7 -9
  100. package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
  101. package/fesm2022/cmat-directives-autofocus.mjs +3 -3
  102. package/fesm2022/cmat-directives-data-exporter.mjs +24 -33
  103. package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
  104. package/fesm2022/cmat-directives-debounce.mjs +14 -17
  105. package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
  106. package/fesm2022/cmat-directives-digit-only.mjs +6 -23
  107. package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
  108. package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
  109. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +4 -11
  110. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
  111. package/fesm2022/cmat-lib-mock-api.mjs +6 -43
  112. package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
  113. package/fesm2022/cmat-pipes-bytes.mjs +3 -3
  114. package/fesm2022/cmat-pipes-date-format.mjs +3 -3
  115. package/fesm2022/cmat-pipes-find-by-key.mjs +3 -5
  116. package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
  117. package/fesm2022/cmat-pipes-group-by.mjs +3 -3
  118. package/fesm2022/cmat-pipes-keys.mjs +3 -3
  119. package/fesm2022/cmat-pipes-secure.mjs +8 -12
  120. package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
  121. package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
  122. package/fesm2022/cmat-services-alert.mjs +3 -3
  123. package/fesm2022/cmat-services-config.mjs +50 -26
  124. package/fesm2022/cmat-services-config.mjs.map +1 -1
  125. package/fesm2022/cmat-services-confirmation.mjs +9 -11
  126. package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
  127. package/fesm2022/cmat-services-data.mjs +56 -101
  128. package/fesm2022/cmat-services-data.mjs.map +1 -1
  129. package/fesm2022/cmat-services-export-as.mjs +4 -32
  130. package/fesm2022/cmat-services-export-as.mjs.map +1 -1
  131. package/fesm2022/cmat-services-loading.mjs +49 -40
  132. package/fesm2022/cmat-services-loading.mjs.map +1 -1
  133. package/fesm2022/cmat-services-local-storage.mjs +3 -3
  134. package/fesm2022/cmat-services-media-watcher.mjs +19 -25
  135. package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
  136. package/fesm2022/cmat-services-platform.mjs +3 -10
  137. package/fesm2022/cmat-services-platform.mjs.map +1 -1
  138. package/fesm2022/cmat-services-splash-screen.mjs +8 -13
  139. package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
  140. package/fesm2022/cmat-services-title.mjs +8 -12
  141. package/fesm2022/cmat-services-title.mjs.map +1 -1
  142. package/fesm2022/cmat-services-translation.mjs +3 -3
  143. package/fesm2022/cmat-services-utils.mjs +5 -27
  144. package/fesm2022/cmat-services-utils.mjs.map +1 -1
  145. package/fesm2022/cmat-validators.mjs +0 -8
  146. package/fesm2022/cmat-validators.mjs.map +1 -1
  147. package/fesm2022/cmat.mjs +3477 -3795
  148. package/fesm2022/cmat.mjs.map +1 -1
  149. package/package.json +1 -1
  150. package/tailwind/plugins/helpers.js +1 -10
  151. package/tailwind/plugins/scrollbar/index.js +0 -1
  152. package/tailwind/plugins/scrollbar/typedefs.js +1 -7
  153. package/tailwind/plugins/scrollbar/utilities.js +9 -58
  154. package/tailwind/plugins/scrollbar/variants.js +2 -17
  155. package/tailwind/plugins/theming.js +1 -57
  156. package/tailwind/utils/generate-contrasts.js +1 -12
  157. package/tailwind/utils/generate-palette.js +1 -32
  158. package/types/cmat-components-adapter.d.ts +0 -25
  159. package/types/cmat-components-breadcrumb.d.ts +25 -175
  160. package/types/cmat-components-carousel.d.ts +2 -20
  161. package/types/cmat-components-cascade.d.ts +4 -4
  162. package/types/cmat-components-chip-input.d.ts +4 -3
  163. package/types/cmat-components-code-editor.d.ts +0 -18
  164. package/types/cmat-components-custom-formly.d.ts +30 -37
  165. package/types/cmat-components-date-range.d.ts +1 -72
  166. package/types/cmat-components-date-time-display.d.ts +0 -15
  167. package/types/cmat-components-drawer.d.ts +2 -44
  168. package/types/cmat-components-empty-state.d.ts +0 -21
  169. package/types/cmat-components-file-preview.d.ts +0 -18
  170. package/types/cmat-components-filter-toolbar.d.ts +3 -43
  171. package/types/cmat-components-form-actions.d.ts +0 -6
  172. package/types/cmat-components-image-viewer.d.ts +5 -18
  173. package/types/cmat-components-inline-loading.d.ts +0 -9
  174. package/types/cmat-components-json-editor.d.ts +0 -1
  175. package/types/cmat-components-knob-input.d.ts +3 -3
  176. package/types/cmat-components-masonry.d.ts +1 -2
  177. package/types/cmat-components-material-color-picker.d.ts +1 -2
  178. package/types/cmat-components-material-datetimepicker.d.ts +6 -272
  179. package/types/cmat-components-navigation.d.ts +34 -171
  180. package/types/cmat-components-opt-input.d.ts +1 -1
  181. package/types/cmat-components-page-header.d.ts +2 -16
  182. package/types/cmat-components-pagination.d.ts +26 -27
  183. package/types/cmat-components-password-strength.d.ts +1 -2
  184. package/types/cmat-components-popover.d.ts +1 -110
  185. package/types/cmat-components-progress-bar.d.ts +9 -11
  186. package/types/cmat-components-rating.d.ts +6 -7
  187. package/types/cmat-components-rich-text-editor.d.ts +0 -21
  188. package/types/cmat-components-select-search.d.ts +4 -20
  189. package/types/cmat-components-select-table.d.ts +24 -12
  190. package/types/cmat-components-select-tree.d.ts +29 -29
  191. package/types/cmat-components-skeleton.d.ts +0 -18
  192. package/types/cmat-components-speed-dial.d.ts +1 -2
  193. package/types/cmat-components-status-tag.d.ts +0 -15
  194. package/types/cmat-components-table-toolbar.d.ts +0 -12
  195. package/types/cmat-components-timeline.d.ts +3 -4
  196. package/types/cmat-components-toast.d.ts +2 -2
  197. package/types/cmat-components-transfer-picker.d.ts +42 -36
  198. package/types/cmat-components-treetable.d.ts +3 -4
  199. package/types/cmat-components-upload.d.ts +12 -17
  200. package/types/cmat-components-x6-angular-shape.d.ts +0 -1
  201. package/types/cmat-directives-arrow-cursor.d.ts +1 -1
  202. package/types/cmat-directives-debounce.d.ts +3 -4
  203. package/types/cmat-pipes-secure.d.ts +3 -4
  204. package/types/cmat-services-config.d.ts +35 -13
  205. package/types/cmat-services-data.d.ts +13 -12
  206. package/types/cmat-services-export-as.d.ts +0 -22
  207. package/types/cmat-services-loading.d.ts +15 -10
  208. package/types/cmat-services-media-watcher.d.ts +10 -13
  209. package/types/cmat-services-splash-screen.d.ts +2 -4
  210. package/types/cmat-services-title.d.ts +3 -5
  211. package/types/cmat.d.ts +733 -1391
@@ -1,7 +1,8 @@
1
1
  import { ViewportRuler } from '@angular/cdk/scrolling';
2
2
  import { NgClass, AsyncPipe } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { InjectionToken, Directive, EventEmitter, inject, ChangeDetectorRef, ElementRef, forwardRef, HostBinding, ContentChild, ViewChild, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
4
+ import { InjectionToken, Directive, EventEmitter, inject, DestroyRef, signal, ElementRef, forwardRef, HostBinding, ContentChild, ViewChild, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
5
+ import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
6
  import * as i5 from '@angular/forms';
6
7
  import { FormControl, FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
7
8
  import * as i7 from '@angular/material/button';
@@ -19,10 +20,9 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
19
20
  import { MatSelect } from '@angular/material/select';
20
21
  import * as i3 from '@angular/material/tooltip';
21
22
  import { MatTooltipModule } from '@angular/material/tooltip';
22
- import { BehaviorSubject, of, Subject, combineLatest } from 'rxjs';
23
- import { switchMap, map, startWith, delay, takeUntil, take, filter, tap } from 'rxjs/operators';
23
+ import { of, combineLatest } from 'rxjs';
24
+ import { switchMap, map, startWith, tap, delay, take, filter } from 'rxjs/operators';
24
25
 
25
- /** List of inputs of CmatSelectSearchComponent that can be configured with a global default. */
26
26
  const configurableDefaultOptions = [
27
27
  'ariaLabel',
28
28
  'clearSearchInput',
@@ -38,10 +38,10 @@ const configurableDefaultOptions = [
38
38
  const MAT_SELECTSEARCH_DEFAULT_OPTIONS = new InjectionToken('mat-selectsearch-default-options');
39
39
 
40
40
  class CmatSelectNoEntriesFoundDirective {
41
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CmatSelectNoEntriesFoundDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
42
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.7", type: CmatSelectNoEntriesFoundDirective, isStandalone: true, selector: "[cmatSelectNoEntriesFound]", ngImport: i0 }); }
41
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectNoEntriesFoundDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
42
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: CmatSelectNoEntriesFoundDirective, isStandalone: true, selector: "[cmatSelectNoEntriesFound]", ngImport: i0 }); }
43
43
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CmatSelectNoEntriesFoundDirective, decorators: [{
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectNoEntriesFoundDirective, decorators: [{
45
45
  type: Directive,
46
46
  args: [{
47
47
  selector: '[cmatSelectNoEntriesFound]'
@@ -49,10 +49,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
49
49
  }] });
50
50
 
51
51
  class CmatSelectSearchClearDirective {
52
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CmatSelectSearchClearDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
53
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.7", type: CmatSelectSearchClearDirective, isStandalone: true, selector: "[cmatSelectSearchClear]", ngImport: i0 }); }
52
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectSearchClearDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
53
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: CmatSelectSearchClearDirective, isStandalone: true, selector: "[cmatSelectSearchClear]", ngImport: i0 }); }
54
54
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CmatSelectSearchClearDirective, decorators: [{
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectSearchClearDirective, decorators: [{
56
56
  type: Directive,
57
57
  args: [{
58
58
  selector: '[cmatSelectSearchClear]'
@@ -62,7 +62,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
62
62
  const SELECT_PANEL_MAX_HEIGHT = 256;
63
63
  class CmatSelectSearchComponent {
64
64
  constructor() {
65
- this.placeholderLabel = '查询';
65
+ this.placeholderLabel = '搜索';
66
66
  this.type = 'text';
67
67
  this.noEntriesFoundLabel = '无结果';
68
68
  this.showNoFoundLabel = true;
@@ -72,38 +72,34 @@ class CmatSelectSearchComponent {
72
72
  this.enableClearOnEscapePressed = false;
73
73
  this.preventHomeEndKeyPropagation = false;
74
74
  this.disableScrollToActiveOnOptionsChanged = false;
75
- this.ariaLabel = '下拉查询';
76
- /** Whether to show Select All Checkbox (for mat-select[multi=true]) */
75
+ this.ariaLabel = '下拉搜索';
77
76
  this.showToggleAllCheckbox = false;
78
- /** select all checkbox checked state */
79
77
  this.toggleAllCheckboxChecked = false;
80
- /** select all checkbox indeterminate state */
81
78
  this.toggleAllCheckboxIndeterminate = false;
82
79
  this.toggleAllCheckboxTooltipMessage = '';
83
80
  this.toggleAllCheckboxTooltipPosition = 'below';
84
81
  this.hideClearSearchButton = false;
85
82
  this.alwaysRestoreSelectedOptionsMulti = false;
86
- /** Output emitter to send to parent component with the toggle all boolean */
87
83
  this.toggleAll = new EventEmitter();
88
84
  this.formControl = new FormControl('');
89
85
  this.matSelect = inject(MatSelect);
90
86
  this.matFormField = inject(MatFormField, { optional: true }) ?? null;
91
- this._changeDetectorRef = inject(ChangeDetectorRef);
92
87
  this._viewportRuler = inject(ViewportRuler);
93
88
  this._matOption = inject(MatOption, { optional: true }) ?? null;
94
89
  this._defaultOptions = inject(MAT_SELECTSEARCH_DEFAULT_OPTIONS, { optional: true });
95
- this._options$ = new BehaviorSubject(null);
96
- this._optionsList$ = this._options$.pipe(switchMap(_options => _options ?
97
- _options.changes.pipe(map(options => options.toArray()), startWith(_options.toArray())) : of(null)));
90
+ this._destroyRef = inject(DestroyRef);
91
+ this._options$ = signal(null, ...(ngDevMode ? [{ debugName: "_options$" }] : /* istanbul ignore next */ []));
92
+ this._optionsList$ = toObservable(this._options$).pipe(switchMap((_options) => _options ?
93
+ _options.changes.pipe(map((options) => options.toArray()), startWith(_options.toArray())) : of(null)));
98
94
  this._optionsLength$ = this._optionsList$.pipe(map(options => options ? options.length : 0));
99
- this._onDestroy = new Subject();
100
- /** whether to show the no entries found message */
95
+ // eslint-disable-next-line @typescript-eslint/member-ordering
96
+ this.showNoEntriesFound = signal(false, ...(ngDevMode ? [{ debugName: "showNoEntriesFound" }] : /* istanbul ignore next */ []));
101
97
  // eslint-disable-next-line @typescript-eslint/member-ordering
102
98
  this.showNoEntriesFound$ = combineLatest([
103
99
  this.formControl.valueChanges,
104
100
  this._optionsLength$
105
101
  ]).pipe(map(([value, optionsLength]) => this.noEntriesFoundLabel && value
106
- && optionsLength === this._getOptionsLengthOffset()));
102
+ && optionsLength === this._getOptionsLengthOffset()), tap(showNoEntriesFound => this.showNoEntriesFound.set(!!showNoEntriesFound)));
107
103
  // eslint-disable-next-line @typescript-eslint/no-empty-function
108
104
  this.onTouched = () => { };
109
105
  this._applyDefaultOptions(this._defaultOptions);
@@ -115,10 +111,10 @@ class CmatSelectSearchComponent {
115
111
  return this.formControl.value;
116
112
  }
117
113
  get _options() {
118
- return this._options$.getValue();
114
+ return this._options$();
119
115
  }
120
116
  set _options(_options) {
121
- this._options$.next(_options);
117
+ this._options$.set(_options);
122
118
  }
123
119
  ngOnInit() {
124
120
  const panelClass = 'cmat-select-search-panel';
@@ -145,7 +141,7 @@ class CmatSelectSearchComponent {
145
141
  console.error('<cmat-select-search> must be placed inside a <mat-option> element');
146
142
  }
147
143
  this.matSelect.openedChange
148
- .pipe(delay(1), takeUntil(this._onDestroy))
144
+ .pipe(delay(1), takeUntilDestroyed(this._destroyRef))
149
145
  .subscribe((opened) => {
150
146
  if (opened) {
151
147
  this.updateInputWidth();
@@ -161,10 +157,10 @@ class CmatSelectSearchComponent {
161
157
  });
162
158
  this.matSelect.openedChange
163
159
  .pipe(take(1))
164
- .pipe(takeUntil(this._onDestroy))
160
+ .pipe(takeUntilDestroyed(this._destroyRef))
165
161
  .subscribe(() => {
166
162
  if (this.matSelect._keyManager) {
167
- this.matSelect._keyManager.change.pipe(takeUntil(this._onDestroy))
163
+ this.matSelect._keyManager.change.pipe(takeUntilDestroyed(this._destroyRef))
168
164
  .subscribe(() => this._adjustScrollTopToFitActiveOptionIntoView());
169
165
  }
170
166
  else {
@@ -173,26 +169,20 @@ class CmatSelectSearchComponent {
173
169
  this._options = this.matSelect.options;
174
170
  let previousFirstOption = this._options.toArray()[this._getOptionsLengthOffset()];
175
171
  this._options.changes
176
- .pipe(takeUntil(this._onDestroy))
172
+ .pipe(takeUntilDestroyed(this._destroyRef))
177
173
  .subscribe(() => {
178
- // avoid "expression has been changed" error
179
174
  setTimeout(() => {
180
175
  if (this._options) {
181
- // Convert the QueryList to an array
182
176
  const options = this._options.toArray();
183
- // The true first item is offset by 1
184
177
  const currentFirstOption = options[this._getOptionsLengthOffset()];
185
178
  const keyManager = this.matSelect._keyManager;
186
179
  if (keyManager && this.matSelect.panelOpen) {
187
- // set first item active and input width
188
- // Check to see if the first option in these changes is different from the previous.
189
180
  const firstOptionIsChanged = !this.matSelect.compareWith(previousFirstOption, currentFirstOption);
190
181
  if (firstOptionIsChanged
191
182
  || !keyManager.activeItem
192
183
  || !options.find(option => this.matSelect.compareWith(option, keyManager.activeItem))) {
193
184
  keyManager.setFirstItemActive();
194
185
  }
195
- // wait for panel width changes
196
186
  setTimeout(() => {
197
187
  this.updateInputWidth();
198
188
  });
@@ -200,16 +190,12 @@ class CmatSelectSearchComponent {
200
190
  this._adjustScrollTopToFitActiveOptionIntoView();
201
191
  }
202
192
  }
203
- // Update our reference
204
193
  previousFirstOption = currentFirstOption;
205
194
  }
206
195
  });
207
196
  });
208
197
  });
209
- // add or remove css class depending on whether to show the no entries found message
210
- // note: this is hacky
211
- this.showNoEntriesFound$.pipe(takeUntil(this._onDestroy)).subscribe((showNoEntriesFound) => {
212
- // set no entries found class on mat option
198
+ this.showNoEntriesFound$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((showNoEntriesFound) => {
213
199
  if (this._matOption) {
214
200
  if (showNoEntriesFound) {
215
201
  this._matOption._getHostElement().classList.add('cmat-select-search-no-entries-found');
@@ -219,31 +205,26 @@ class CmatSelectSearchComponent {
219
205
  }
220
206
  }
221
207
  });
222
- // resize the input width when the viewport is resized, i.e. the trigger width could potentially be resized
223
208
  this._viewportRuler.change()
224
- .pipe(takeUntil(this._onDestroy))
209
+ .pipe(takeUntilDestroyed(this._destroyRef))
225
210
  .subscribe(() => {
226
211
  if (this.matSelect.panelOpen) {
227
212
  this.updateInputWidth();
228
213
  }
229
214
  });
230
215
  this._initMultipleHandling();
231
- this._optionsList$.pipe(takeUntil(this._onDestroy)).subscribe(() => {
232
- // update view when available options change
233
- this._changeDetectorRef.markForCheck();
234
- });
216
+ this._optionsList$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe();
235
217
  }
236
218
  emitSelectAllBooleanToParent(state) {
219
+ // 通知父组件切换全选状态
237
220
  this.toggleAll.emit(state);
238
221
  }
239
- ngOnDestroy() {
240
- this._onDestroy.next(void 0);
241
- this._onDestroy.complete();
242
- }
243
222
  isToggleAllCheckboxVisible() {
223
+ // 仅在多选模式下显示全选复选框
244
224
  return this.matSelect.multiple && this.showToggleAllCheckbox;
245
225
  }
246
226
  handleKeydown(event) {
227
+ // 拦截输入事件,避免冒泡影响下拉面板行为
247
228
  if ((event.key?.length === 1) ||
248
229
  (event.code === 'KeyA') || (event.code === 'KeyB') || (event.code === 'KeyC') || (event.code === 'KeyD') || (event.code === 'KeyE') || (event.code === 'KeyF')
249
230
  || (event.code === 'KeyG') || (event.code === 'KeyH') || (event.code === 'KeyI') || (event.code === 'KeyJ') || (event.code === 'KeyK') || (event.code === 'KeyL')
@@ -257,20 +238,15 @@ class CmatSelectSearchComponent {
257
238
  event.stopPropagation();
258
239
  }
259
240
  if (this.matSelect.multiple && event.key && event.code === 'Enter') {
260
- // Regain focus after multiselect, so we can further type
261
241
  setTimeout(() => this.focus());
262
242
  }
263
- // Special case if click Escape, if input is empty, close the dropdown, if not, empty out the search field
264
243
  if (this.enableClearOnEscapePressed === true && event.code === 'Escape' && this.value) {
265
244
  this.reset(true);
266
245
  event.stopPropagation();
267
246
  }
268
247
  }
269
- /**
270
- * Handles the key up event with MatSelect.
271
- * Allows e.g. the announcing of the currently activeDescendant by screen readers.
272
- */
273
248
  handleKeyup(event) {
249
+ // 方向键切换时同步当前高亮项
274
250
  if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
275
251
  const ariaActiveDescendantId = this.matSelect._getAriaActiveDescendant();
276
252
  const index = this._options?.toArray().findIndex(item => item.id === ariaActiveDescendantId);
@@ -283,21 +259,23 @@ class CmatSelectSearchComponent {
283
259
  }
284
260
  }
285
261
  writeValue(value) {
262
+ // 外部写入时同步输入框值
286
263
  this._lastExternalInputValue = value;
287
264
  this.formControl.setValue(value);
288
- this._changeDetectorRef.markForCheck();
289
265
  }
290
266
  onBlur() {
267
+ // 失焦时清理高亮并触发 touched
291
268
  this._unselectActiveDescendant();
292
269
  this.onTouched();
293
270
  }
294
271
  registerOnChange(fn) {
295
- this.formControl.valueChanges.pipe(filter(value => value !== this._lastExternalInputValue), tap(() => this._lastExternalInputValue = undefined), takeUntil(this._onDestroy)).subscribe(fn);
272
+ this.formControl.valueChanges.pipe(filter(value => value !== this._lastExternalInputValue), tap(() => this._lastExternalInputValue = undefined), takeUntilDestroyed(this._destroyRef)).subscribe(fn);
296
273
  }
297
274
  registerOnTouched(fn) {
298
275
  this.onTouched = fn;
299
276
  }
300
277
  focus() {
278
+ // 聚焦并保持面板滚动位置
301
279
  if (!this.searchSelectInput || !this.matSelect.panel) {
302
280
  return;
303
281
  }
@@ -307,12 +285,14 @@ class CmatSelectSearchComponent {
307
285
  panel.scrollTop = scrollTop;
308
286
  }
309
287
  reset(focus) {
288
+ // 重置搜索内容
310
289
  this.formControl.setValue('');
311
290
  if (focus) {
312
291
  this.focus();
313
292
  }
314
293
  }
315
294
  updateInputWidth() {
295
+ // 根据面板宽度同步搜索输入宽度
316
296
  if (!this.innerSelectSearch?.nativeElement) {
317
297
  return;
318
298
  }
@@ -329,12 +309,14 @@ class CmatSelectSearchComponent {
329
309
  }
330
310
  }
331
311
  _getMatOptionHeight() {
312
+ // 获取首个选项高度,用于滚动计算
332
313
  if (this.matSelect.options.length > 0) {
333
314
  return this.matSelect.options.first._getHostElement().getBoundingClientRect().height;
334
315
  }
335
316
  return 0;
336
317
  }
337
318
  _getOptionsLengthOffset() {
319
+ // 如果嵌套在 mat-option 内,则偏移一个选项
338
320
  if (this._matOption) {
339
321
  return 1;
340
322
  }
@@ -343,10 +325,12 @@ class CmatSelectSearchComponent {
343
325
  }
344
326
  }
345
327
  _unselectActiveDescendant() {
328
+ // 清理当前高亮项的 aria 状态
346
329
  this._activeDescendant?.removeAttribute('aria-selected');
347
330
  this.searchSelectInput.nativeElement.removeAttribute('aria-activedescendant');
348
331
  }
349
332
  _applyDefaultOptions(defaultOptions) {
333
+ // 应用默认配置
350
334
  if (!defaultOptions) {
351
335
  return;
352
336
  }
@@ -356,24 +340,17 @@ class CmatSelectSearchComponent {
356
340
  }
357
341
  }
358
342
  }
359
- /*
360
- * Initializes handling <mat-select [multiple]="true">
361
- * Note: to improve this code, mat-select should be extended to allow disabling resetting the selection while filtering.
362
- */
363
343
  _initMultipleHandling() {
344
+ // 初始化多选场景下的已选值保留逻辑
345
+ // 处理多选场景下的已选值保留
364
346
  if (!this.matSelect.ngControl) {
365
347
  if (this.matSelect.multiple) {
366
- // note: the access to matSelect.ngControl (instead of matSelect.value / matSelect.valueChanges)
367
- // is necessary to properly work in multi-selection mode.
368
348
  console.error('the mat-select containing cmat-select-search must have a ngModel or formControl directive when multiple=true');
369
349
  }
370
350
  return;
371
351
  }
372
- // if <mat-select [multiple]="true">
373
- // store previously selected values and restore them when they are deselected
374
- // because the option is not available while we are currently filtering
375
352
  this._previousSelectedValues = this.matSelect.ngControl.value;
376
- this.matSelect.ngControl.valueChanges?.pipe(takeUntil(this._onDestroy))
353
+ this.matSelect.ngControl.valueChanges?.pipe(takeUntilDestroyed(this._destroyRef))
377
354
  .subscribe((values) => {
378
355
  let restoreSelectedValues = false;
379
356
  if (this.matSelect.multiple) {
@@ -386,8 +363,6 @@ class CmatSelectSearchComponent {
386
363
  this._previousSelectedValues.forEach((previousValue) => {
387
364
  if (!values.some((v) => this.matSelect.compareWith(v, previousValue))
388
365
  && !optionValues.some(v => this.matSelect.compareWith(v, previousValue))) {
389
- // if a value that was selected before is deselected and not found in the options, it was deselected
390
- // due to the filtering, so we restore it.
391
366
  values.push(previousValue);
392
367
  restoreSelectedValues = true;
393
368
  }
@@ -400,15 +375,12 @@ class CmatSelectSearchComponent {
400
375
  }
401
376
  });
402
377
  }
403
- /**
404
- * Scrolls the currently active option into the view if it is not yet visible.
405
- */
406
378
  _adjustScrollTopToFitActiveOptionIntoView() {
379
+ // 滚动到当前高亮项附近
407
380
  if (this.matSelect.panel && this.matSelect.options.length > 0) {
408
381
  const matOptionHeight = this._getMatOptionHeight();
409
382
  const activeOptionIndex = this.matSelect._keyManager.activeItemIndex ?? 0;
410
383
  const labelCount = _countGroupLabelsBeforeOption(activeOptionIndex, this.matSelect.options, this.matSelect.optionGroups);
411
- // If the component is in a MatOption, the activeItemIndex will be offset by one.
412
384
  const indexOfOptionToFitIntoView = (this._matOption ? -1 : 0) + labelCount + activeOptionIndex;
413
385
  const currentScrollTop = this.matSelect.panel.nativeElement.scrollTop;
414
386
  const searchInputHeight = this.innerSelectSearch.nativeElement.offsetHeight;
@@ -423,16 +395,16 @@ class CmatSelectSearchComponent {
423
395
  }
424
396
  }
425
397
  }
426
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CmatSelectSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
427
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.7", type: CmatSelectSearchComponent, isStandalone: true, selector: "cmat-select-search", inputs: { placeholderLabel: "placeholderLabel", type: "type", noEntriesFoundLabel: "noEntriesFoundLabel", showNoFoundLabel: "showNoFoundLabel", clearSearchInput: "clearSearchInput", searching: "searching", disableInitialFocus: "disableInitialFocus", enableClearOnEscapePressed: "enableClearOnEscapePressed", preventHomeEndKeyPropagation: "preventHomeEndKeyPropagation", disableScrollToActiveOnOptionsChanged: "disableScrollToActiveOnOptionsChanged", ariaLabel: "ariaLabel", showToggleAllCheckbox: "showToggleAllCheckbox", toggleAllCheckboxChecked: "toggleAllCheckboxChecked", toggleAllCheckboxIndeterminate: "toggleAllCheckboxIndeterminate", toggleAllCheckboxTooltipMessage: "toggleAllCheckboxTooltipMessage", toggleAllCheckboxTooltipPosition: "toggleAllCheckboxTooltipPosition", hideClearSearchButton: "hideClearSearchButton", alwaysRestoreSelectedOptionsMulti: "alwaysRestoreSelectedOptionsMulti" }, outputs: { toggleAll: "toggleAll" }, host: { properties: { "class.cmat-select-search-inside-mat-option": "this.isInsideMatOption" } }, providers: [
398
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
399
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CmatSelectSearchComponent, isStandalone: true, selector: "cmat-select-search", inputs: { placeholderLabel: "placeholderLabel", type: "type", noEntriesFoundLabel: "noEntriesFoundLabel", showNoFoundLabel: "showNoFoundLabel", clearSearchInput: "clearSearchInput", searching: "searching", disableInitialFocus: "disableInitialFocus", enableClearOnEscapePressed: "enableClearOnEscapePressed", preventHomeEndKeyPropagation: "preventHomeEndKeyPropagation", disableScrollToActiveOnOptionsChanged: "disableScrollToActiveOnOptionsChanged", ariaLabel: "ariaLabel", showToggleAllCheckbox: "showToggleAllCheckbox", toggleAllCheckboxChecked: "toggleAllCheckboxChecked", toggleAllCheckboxIndeterminate: "toggleAllCheckboxIndeterminate", toggleAllCheckboxTooltipMessage: "toggleAllCheckboxTooltipMessage", toggleAllCheckboxTooltipPosition: "toggleAllCheckboxTooltipPosition", hideClearSearchButton: "hideClearSearchButton", alwaysRestoreSelectedOptionsMulti: "alwaysRestoreSelectedOptionsMulti" }, outputs: { toggleAll: "toggleAll" }, host: { properties: { "class.cmat-select-search-inside-mat-option": "this.isInsideMatOption" } }, providers: [
428
400
  {
429
401
  provide: NG_VALUE_ACCESSOR,
430
402
  useExisting: forwardRef(() => CmatSelectSearchComponent),
431
403
  multi: true
432
404
  }
433
- ], queries: [{ propertyName: "clearIcon", first: true, predicate: CmatSelectSearchClearDirective, descendants: true }, { propertyName: "noEntriesFound", first: true, predicate: CmatSelectNoEntriesFoundDirective, descendants: true }], viewQueries: [{ propertyName: "searchSelectInput", first: true, predicate: ["searchSelectInput"], descendants: true, read: ElementRef, static: true }, { propertyName: "innerSelectSearch", first: true, predicate: ["innerSelectSearch"], descendants: true, read: ElementRef, static: true }], exportAs: ["cmatSelectSearch"], ngImport: i0, template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div #innerSelectSearch class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{'cmat-select-search-inner-multiple': matSelect.multiple, 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible() }\">\r\n\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\" [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked\" [indeterminate]=\"toggleAllCheckboxIndeterminate\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\" [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\">\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon class=\"cmat-select-search-icon\" color=\"primary\" svgIcon=\"heroicons_outline:magnifying-glass\"></mat-icon>\r\n </span>\r\n <input #searchSelectInput matInput class=\"cmat-select-search-input cmat-input-element\" autocomplete=\"off\"\r\n [type]=\"type\" [formControl]=\"formControl\" [placeholder]=\"placeholderLabel\" [attr.aria-label]=\"ariaLabel\"\r\n (keydown)=\"handleKeydown($event)\" (keyup)=\"handleKeyup($event)\" (blur)=\"onBlur()\" />\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 type=\"button\" matIconButton aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\" (click)=\"reset(true)\">\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$ | async) {\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 }", 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])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[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"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
405
+ ], queries: [{ propertyName: "clearIcon", first: true, predicate: CmatSelectSearchClearDirective, descendants: true }, { propertyName: "noEntriesFound", first: true, predicate: CmatSelectNoEntriesFoundDirective, descendants: true }], viewQueries: [{ propertyName: "searchSelectInput", first: true, predicate: ["searchSelectInput"], descendants: true, read: ElementRef, static: true }, { propertyName: "innerSelectSearch", first: true, predicate: ["innerSelectSearch"], descendants: true, read: ElementRef, static: true }], exportAs: ["cmatSelectSearch"], ngImport: i0, template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div #innerSelectSearch class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{'cmat-select-search-inner-multiple': matSelect.multiple, 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible() }\">\r\n\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\" [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked\" [indeterminate]=\"toggleAllCheckboxIndeterminate\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\" [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\">\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon class=\"cmat-select-search-icon\" color=\"primary\" svgIcon=\"heroicons_outline:magnifying-glass\"></mat-icon>\r\n </span>\r\n <input #searchSelectInput matInput class=\"cmat-select-search-input cmat-input-element\" autocomplete=\"off\"\r\n [type]=\"type\" [formControl]=\"formControl\" [placeholder]=\"placeholderLabel\" [attr.aria-label]=\"ariaLabel\"\r\n (keydown)=\"handleKeydown($event)\" (keyup)=\"handleKeyup($event)\" (blur)=\"onBlur()\" />\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 type=\"button\" matIconButton aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\" (click)=\"reset(true)\">\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])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[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 }); }
434
406
  }
435
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CmatSelectSearchComponent, decorators: [{
407
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectSearchComponent, decorators: [{
436
408
  type: Component,
437
409
  args: [{ selector: 'cmat-select-search', providers: [
438
410
  {
@@ -441,7 +413,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
441
413
  multi: true
442
414
  }
443
415
  ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatSelectSearch', imports: [MatInputModule, NgClass, MatCheckboxModule, MatTooltipModule, MatFormFieldModule, MatIconModule,
444
- FormsModule, ReactiveFormsModule, MatProgressSpinnerModule, MatButtonModule, AsyncPipe], template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div #innerSelectSearch class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{'cmat-select-search-inner-multiple': matSelect.multiple, 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible() }\">\r\n\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\" [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked\" [indeterminate]=\"toggleAllCheckboxIndeterminate\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\" [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\">\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon class=\"cmat-select-search-icon\" color=\"primary\" svgIcon=\"heroicons_outline:magnifying-glass\"></mat-icon>\r\n </span>\r\n <input #searchSelectInput matInput class=\"cmat-select-search-input cmat-input-element\" autocomplete=\"off\"\r\n [type]=\"type\" [formControl]=\"formControl\" [placeholder]=\"placeholderLabel\" [attr.aria-label]=\"ariaLabel\"\r\n (keydown)=\"handleKeydown($event)\" (keyup)=\"handleKeyup($event)\" (blur)=\"onBlur()\" />\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 type=\"button\" matIconButton aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\" (click)=\"reset(true)\">\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$ | async) {\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 }", 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"] }]
416
+ FormsModule, ReactiveFormsModule, MatProgressSpinnerModule, MatButtonModule, AsyncPipe], template: "<input matInput class=\"cmat-select-search-input cmat-select-search-hidden\" />\r\n\r\n<div #innerSelectSearch class=\"cmat-select-search-inner mat-typography mat-tab-header\"\r\n [ngClass]=\"{'cmat-select-search-inner-multiple': matSelect.multiple, 'cmat-select-search-inner-toggle-all': isToggleAllCheckboxVisible() }\">\r\n\r\n @if (isToggleAllCheckboxVisible()) {\r\n <mat-checkbox class=\"cmat-select-search-toggle-all-checkbox -mr-4\"\r\n matTooltipClass=\"cmat-select-search-toggle-all-tooltip\" [color]=\"matFormField?.color\"\r\n [checked]=\"toggleAllCheckboxChecked\" [indeterminate]=\"toggleAllCheckboxIndeterminate\"\r\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\" [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\r\n (change)=\"emitSelectAllBooleanToParent($event.checked)\">\r\n </mat-checkbox>\r\n }\r\n <span matPrefix class=\"flex flex-col justify-center pl-2\">\r\n <mat-icon class=\"cmat-select-search-icon\" color=\"primary\" svgIcon=\"heroicons_outline:magnifying-glass\"></mat-icon>\r\n </span>\r\n <input #searchSelectInput matInput class=\"cmat-select-search-input cmat-input-element\" autocomplete=\"off\"\r\n [type]=\"type\" [formControl]=\"formControl\" [placeholder]=\"placeholderLabel\" [attr.aria-label]=\"ariaLabel\"\r\n (keydown)=\"handleKeydown($event)\" (keyup)=\"handleKeyup($event)\" (blur)=\"onBlur()\" />\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 type=\"button\" matIconButton aria-label=\"Clear\"\r\n class=\"cmat-select-search-clear\" (click)=\"reset(true)\">\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"] }]
445
417
  }], ctorParameters: () => [], propDecorators: { placeholderLabel: [{
446
418
  type: Input
447
419
  }], type: [{