cmat 0.0.78 → 0.0.79

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 (201) 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 +12 -12
  8. package/fesm2022/cmat-components-cascade.mjs +14 -20
  9. package/fesm2022/cmat-components-cascade.mjs.map +1 -1
  10. package/fesm2022/cmat-components-chip-input.mjs +21 -21
  11. package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
  12. package/fesm2022/cmat-components-code-editor.mjs +4 -22
  13. package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
  14. package/fesm2022/cmat-components-custom-formly.mjs +153 -220
  15. package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
  16. package/fesm2022/cmat-components-date-range.mjs +5 -177
  17. package/fesm2022/cmat-components-date-range.mjs.map +1 -1
  18. package/fesm2022/cmat-components-date-time-display.mjs +3 -15
  19. package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
  20. package/fesm2022/cmat-components-drawer.mjs +6 -96
  21. package/fesm2022/cmat-components-drawer.mjs.map +1 -1
  22. package/fesm2022/cmat-components-empty-state.mjs +4 -25
  23. package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
  24. package/fesm2022/cmat-components-file-preview.mjs +3 -21
  25. package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
  26. package/fesm2022/cmat-components-filter-toolbar.mjs +7 -50
  27. package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
  28. package/fesm2022/cmat-components-form-actions.mjs +3 -9
  29. package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
  30. package/fesm2022/cmat-components-fullscreen.mjs +4 -4
  31. package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
  32. package/fesm2022/cmat-components-highlight.mjs +6 -31
  33. package/fesm2022/cmat-components-highlight.mjs.map +1 -1
  34. package/fesm2022/cmat-components-image-viewer.mjs +3 -12
  35. package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
  36. package/fesm2022/cmat-components-inline-loading.mjs +3 -12
  37. package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
  38. package/fesm2022/cmat-components-json-editor.mjs +10 -13
  39. package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
  40. package/fesm2022/cmat-components-knob-input.mjs +18 -12
  41. package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
  42. package/fesm2022/cmat-components-masonry.mjs +3 -9
  43. package/fesm2022/cmat-components-masonry.mjs.map +1 -1
  44. package/fesm2022/cmat-components-material-color-picker.mjs +3 -23
  45. package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
  46. package/fesm2022/cmat-components-material-datetimepicker.mjs +49 -397
  47. package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
  48. package/fesm2022/cmat-components-navigation.mjs +183 -725
  49. package/fesm2022/cmat-components-navigation.mjs.map +1 -1
  50. package/fesm2022/cmat-components-opt-input.mjs +7 -10
  51. package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
  52. package/fesm2022/cmat-components-org-chart.mjs +11 -11
  53. package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
  54. package/fesm2022/cmat-components-page-header.mjs +8 -19
  55. package/fesm2022/cmat-components-page-header.mjs.map +1 -1
  56. package/fesm2022/cmat-components-pagination.mjs +96 -93
  57. package/fesm2022/cmat-components-pagination.mjs.map +1 -1
  58. package/fesm2022/cmat-components-password-strength.mjs +10 -11
  59. package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
  60. package/fesm2022/cmat-components-popover.mjs +15 -149
  61. package/fesm2022/cmat-components-popover.mjs.map +1 -1
  62. package/fesm2022/cmat-components-progress-bar.mjs +9 -16
  63. package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
  64. package/fesm2022/cmat-components-qrcode.mjs +5 -11
  65. package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
  66. package/fesm2022/cmat-components-rating.mjs +3 -3
  67. package/fesm2022/cmat-components-rich-text-editor.mjs +4 -25
  68. package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
  69. package/fesm2022/cmat-components-select-search.mjs +46 -72
  70. package/fesm2022/cmat-components-select-search.mjs.map +1 -1
  71. package/fesm2022/cmat-components-select-table.mjs +193 -150
  72. package/fesm2022/cmat-components-select-table.mjs.map +1 -1
  73. package/fesm2022/cmat-components-select-tree.mjs +124 -78
  74. package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
  75. package/fesm2022/cmat-components-skeleton.mjs +4 -22
  76. package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
  77. package/fesm2022/cmat-components-speed-dial.mjs +9 -11
  78. package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
  79. package/fesm2022/cmat-components-status-tag.mjs +3 -18
  80. package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
  81. package/fesm2022/cmat-components-table-toolbar.mjs +3 -15
  82. package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
  83. package/fesm2022/cmat-components-timeline.mjs +18 -21
  84. package/fesm2022/cmat-components-timeline.mjs.map +1 -1
  85. package/fesm2022/cmat-components-toast.mjs +16 -14
  86. package/fesm2022/cmat-components-toast.mjs.map +1 -1
  87. package/fesm2022/cmat-components-transfer-picker.mjs +103 -80
  88. package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
  89. package/fesm2022/cmat-components-treetable.mjs +6 -6
  90. package/fesm2022/cmat-components-upload.mjs +21 -36
  91. package/fesm2022/cmat-components-upload.mjs.map +1 -1
  92. package/fesm2022/cmat-components-x6-angular-shape.mjs +0 -1
  93. package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
  94. package/fesm2022/cmat-directives-animate-on-scroll.mjs +6 -27
  95. package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
  96. package/fesm2022/cmat-directives-arrow-cursor.mjs +7 -9
  97. package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
  98. package/fesm2022/cmat-directives-autofocus.mjs +3 -3
  99. package/fesm2022/cmat-directives-data-exporter.mjs +24 -33
  100. package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
  101. package/fesm2022/cmat-directives-debounce.mjs +14 -17
  102. package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
  103. package/fesm2022/cmat-directives-digit-only.mjs +6 -23
  104. package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
  105. package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
  106. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +4 -11
  107. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
  108. package/fesm2022/cmat-lib-mock-api.mjs +6 -43
  109. package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
  110. package/fesm2022/cmat-pipes-bytes.mjs +3 -3
  111. package/fesm2022/cmat-pipes-date-format.mjs +3 -3
  112. package/fesm2022/cmat-pipes-find-by-key.mjs +3 -5
  113. package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
  114. package/fesm2022/cmat-pipes-group-by.mjs +3 -3
  115. package/fesm2022/cmat-pipes-keys.mjs +3 -3
  116. package/fesm2022/cmat-pipes-secure.mjs +8 -12
  117. package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
  118. package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
  119. package/fesm2022/cmat-services-alert.mjs +3 -3
  120. package/fesm2022/cmat-services-config.mjs +50 -26
  121. package/fesm2022/cmat-services-config.mjs.map +1 -1
  122. package/fesm2022/cmat-services-confirmation.mjs +9 -11
  123. package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
  124. package/fesm2022/cmat-services-data.mjs +56 -101
  125. package/fesm2022/cmat-services-data.mjs.map +1 -1
  126. package/fesm2022/cmat-services-export-as.mjs +4 -32
  127. package/fesm2022/cmat-services-export-as.mjs.map +1 -1
  128. package/fesm2022/cmat-services-loading.mjs +49 -40
  129. package/fesm2022/cmat-services-loading.mjs.map +1 -1
  130. package/fesm2022/cmat-services-local-storage.mjs +3 -3
  131. package/fesm2022/cmat-services-media-watcher.mjs +19 -25
  132. package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
  133. package/fesm2022/cmat-services-platform.mjs +3 -10
  134. package/fesm2022/cmat-services-platform.mjs.map +1 -1
  135. package/fesm2022/cmat-services-splash-screen.mjs +8 -13
  136. package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
  137. package/fesm2022/cmat-services-title.mjs +8 -12
  138. package/fesm2022/cmat-services-title.mjs.map +1 -1
  139. package/fesm2022/cmat-services-translation.mjs +3 -3
  140. package/fesm2022/cmat-services-utils.mjs +5 -27
  141. package/fesm2022/cmat-services-utils.mjs.map +1 -1
  142. package/fesm2022/cmat-validators.mjs +0 -8
  143. package/fesm2022/cmat-validators.mjs.map +1 -1
  144. package/fesm2022/cmat.mjs +3159 -3441
  145. package/fesm2022/cmat.mjs.map +1 -1
  146. package/package.json +1 -1
  147. package/tailwind/plugins/helpers.js +1 -10
  148. package/tailwind/plugins/scrollbar/index.js +0 -1
  149. package/tailwind/plugins/scrollbar/typedefs.js +1 -7
  150. package/tailwind/plugins/scrollbar/utilities.js +9 -58
  151. package/tailwind/plugins/scrollbar/variants.js +2 -17
  152. package/tailwind/plugins/theming.js +1 -57
  153. package/tailwind/utils/generate-contrasts.js +1 -12
  154. package/tailwind/utils/generate-palette.js +1 -32
  155. package/types/cmat-components-adapter.d.ts +0 -25
  156. package/types/cmat-components-breadcrumb.d.ts +25 -175
  157. package/types/cmat-components-carousel.d.ts +0 -18
  158. package/types/cmat-components-cascade.d.ts +1 -1
  159. package/types/cmat-components-chip-input.d.ts +4 -3
  160. package/types/cmat-components-code-editor.d.ts +0 -18
  161. package/types/cmat-components-custom-formly.d.ts +22 -28
  162. package/types/cmat-components-date-range.d.ts +0 -71
  163. package/types/cmat-components-date-time-display.d.ts +0 -15
  164. package/types/cmat-components-drawer.d.ts +0 -42
  165. package/types/cmat-components-empty-state.d.ts +0 -21
  166. package/types/cmat-components-file-preview.d.ts +0 -18
  167. package/types/cmat-components-filter-toolbar.d.ts +3 -43
  168. package/types/cmat-components-form-actions.d.ts +0 -6
  169. package/types/cmat-components-image-viewer.d.ts +0 -12
  170. package/types/cmat-components-inline-loading.d.ts +0 -9
  171. package/types/cmat-components-knob-input.d.ts +1 -1
  172. package/types/cmat-components-material-datetimepicker.d.ts +0 -263
  173. package/types/cmat-components-navigation.d.ts +24 -164
  174. package/types/cmat-components-opt-input.d.ts +1 -1
  175. package/types/cmat-components-page-header.d.ts +2 -16
  176. package/types/cmat-components-pagination.d.ts +22 -24
  177. package/types/cmat-components-popover.d.ts +1 -109
  178. package/types/cmat-components-progress-bar.d.ts +3 -4
  179. package/types/cmat-components-rich-text-editor.d.ts +0 -21
  180. package/types/cmat-components-select-search.d.ts +3 -19
  181. package/types/cmat-components-select-table.d.ts +17 -4
  182. package/types/cmat-components-select-tree.d.ts +20 -19
  183. package/types/cmat-components-skeleton.d.ts +0 -18
  184. package/types/cmat-components-status-tag.d.ts +0 -15
  185. package/types/cmat-components-table-toolbar.d.ts +0 -12
  186. package/types/cmat-components-timeline.d.ts +3 -4
  187. package/types/cmat-components-toast.d.ts +1 -0
  188. package/types/cmat-components-transfer-picker.d.ts +23 -27
  189. package/types/cmat-components-upload.d.ts +7 -10
  190. package/types/cmat-components-x6-angular-shape.d.ts +0 -1
  191. package/types/cmat-directives-arrow-cursor.d.ts +1 -1
  192. package/types/cmat-directives-debounce.d.ts +3 -4
  193. package/types/cmat-pipes-secure.d.ts +3 -4
  194. package/types/cmat-services-config.d.ts +35 -13
  195. package/types/cmat-services-data.d.ts +13 -12
  196. package/types/cmat-services-export-as.d.ts +0 -22
  197. package/types/cmat-services-loading.d.ts +15 -10
  198. package/types/cmat-services-media-watcher.d.ts +10 -13
  199. package/types/cmat-services-splash-screen.d.ts +2 -4
  200. package/types/cmat-services-title.d.ts +3 -5
  201. package/types/cmat.d.ts +655 -1308
@@ -2,7 +2,8 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion';
2
2
  import * as i4 from '@angular/common';
3
3
  import { CommonModule } from '@angular/common';
4
4
  import * as i0 from '@angular/core';
5
- import { EventEmitter, inject, ChangeDetectorRef, Input, HostListener, ViewChild, ViewChildren, Output, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
5
+ import { EventEmitter, inject, ChangeDetectorRef, DestroyRef, Input, HostListener, ViewChild, ViewChildren, Output, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
6
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
7
  import * as i3 from '@angular/forms';
7
8
  import { FormControl, NgControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
8
9
  import * as i1 from '@angular/material/form-field';
@@ -20,7 +21,7 @@ import { MatTableModule, MatTable } from '@angular/material/table';
20
21
  import { CmatSelectSearchComponent } from 'cmat/components/select-search';
21
22
  import { CmatDigitOnlyDirective } from 'cmat/directives/digit-only';
22
23
  import { isUndefined, isNil, isArray, isNumber, isString } from 'lodash-es';
23
- import { Subject, merge, takeUntil, debounceTime } from 'rxjs';
24
+ import { Subject, merge, debounceTime } from 'rxjs';
24
25
 
25
26
  /* eslint-disable @typescript-eslint/member-ordering */
26
27
  const MAX_SAFE_INTEGER = 9007199254740991;
@@ -38,6 +39,8 @@ class CmatSelectTableComponent {
38
39
  return o1 && o2 ? o1?.name === o2?.name && o1?.id === o2?.id : o1 === o2;
39
40
  };
40
41
  this.closed = new EventEmitter();
42
+ this._rowById = new Map();
43
+ this._columnKeys = [];
41
44
  this.completeRowList = [];
42
45
  this.overallFilterControl = new FormControl('');
43
46
  this.selectControl = new FormControl();
@@ -46,8 +49,8 @@ class CmatSelectTableComponent {
46
49
  this.touched = false;
47
50
  this.ngControl = inject(NgControl, { optional: true, self: true });
48
51
  this._cd = inject(ChangeDetectorRef);
52
+ this._destroyRef = inject(DestroyRef);
49
53
  this._nullRow = { id: null };
50
- this._unsubscribeAll = new Subject();
51
54
  this._completeValueList = [];
52
55
  this._placeholder = '';
53
56
  this._required = false;
@@ -99,7 +102,7 @@ class CmatSelectTableComponent {
99
102
  this._filterControls.valueChanges,
100
103
  this.overallFilterControl.valueChanges
101
104
  ])
102
- .pipe(takeUntil(this._unsubscribeAll), debounceTime(100))
105
+ .pipe(takeUntilDestroyed(this._destroyRef), debounceTime(100))
103
106
  .subscribe(() => {
104
107
  const dataClone = [...((this.dataSource || { data: [] }).data || [])];
105
108
  if (this.addNullRow()) {
@@ -119,37 +122,29 @@ class CmatSelectTableComponent {
119
122
  dataClone : this._sortData(dataClone, this._sort.active, this._sort.direction);
120
123
  this._cd.detectChanges();
121
124
  });
122
- this._matOptions.changes.pipe(takeUntil(this._unsubscribeAll)).subscribe(() => {
125
+ this._matOptions.changes.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
123
126
  const options = {};
124
127
  this._matOptions
125
128
  .toArray()
126
129
  .filter(option => !isNil(option) && !isNil(option.value) && !option._getHostElement().classList.contains('contains-cmat-select-search'))
127
130
  .forEach(option => options[`${option.value.id}`] = option);
128
- if (this._matSelectSearch) {
129
- this._matSelect?.options.reset([this._matOptions.first,
130
- ...this.tableDataSource
131
- .filter(row => !isNil(options[`${row.id}`]))
132
- .map(row => options[`${row.id}`])]);
133
- }
134
- else {
135
- this._matSelect?.options.reset(this.tableDataSource
136
- .filter(row => !isNil(options[`${row.id}`]))
137
- .map(row => options[`${row.id}`]));
138
- }
131
+ const tableOptions = this._buildTableOptions(options);
132
+ this._matSelect?.options.reset(this._matSelectSearch ? [this._matOptions.first, ...tableOptions] : tableOptions);
139
133
  try {
140
134
  this._matSelect?.options.notifyOnChanges();
141
- const value = this.multiple ? (this.completeRowList.length > 0 ? [...this.completeRowList] : null) : (this.completeRowList.length > 0 ? { ...this.completeRowList[0] } : null);
135
+ const value = this.multiple
136
+ ? (this.completeRowList.length > 0 ? [...this.completeRowList] : null)
137
+ : (this.completeRowList.length > 0 ? { ...this.completeRowList[0] } : null);
142
138
  this._matSelect.writeValue(value);
143
139
  this._matSelect._onChange(value);
144
140
  }
145
141
  catch {
146
- //do something
142
+ return;
147
143
  }
148
144
  });
149
145
  }
150
146
  ngOnDestroy() {
151
- this._unsubscribeAll.next(void 0);
152
- this._unsubscribeAll.complete();
147
+ this.stateChanges.complete();
153
148
  }
154
149
  get placeholder() {
155
150
  return this._placeholder;
@@ -239,13 +234,22 @@ class CmatSelectTableComponent {
239
234
  if (!isNil(changes.dataSource)
240
235
  && !isNil(changes.dataSource.currentValue)
241
236
  && isArray(changes.dataSource.currentValue.data)) {
242
- this.tableDataSource = [...changes.dataSource.currentValue.data];
237
+ const columns = changes.dataSource.currentValue.columns;
238
+ const data = changes.dataSource.currentValue.data;
239
+ this._rowById.clear();
240
+ this._columnKeys = columns.map((column) => column.key);
241
+ this.tableDataSource = [...data];
243
242
  if (this.addNullRow()) {
244
243
  this.tableDataSource.unshift(this._nullRow);
245
244
  }
246
- this.tableColumns = ['_selection', ...changes.dataSource.currentValue.columns.map((column) => column.key)];
245
+ this.tableColumns = ['_selection', ...this._columnKeys];
247
246
  this.tableColumnsMap.clear();
248
- changes.dataSource.currentValue.columns.forEach((column) => this.tableColumnsMap.set(column.key, column));
247
+ columns.forEach((column) => this.tableColumnsMap.set(column.key, column));
248
+ data.forEach((row) => {
249
+ if (!isNil(row?.id)) {
250
+ this._rowById.set(row.id, row);
251
+ }
252
+ });
249
253
  if (this.tableDataSource.length > 0) {
250
254
  this._init(this.value);
251
255
  }
@@ -269,9 +273,12 @@ class CmatSelectTableComponent {
269
273
  if (event.target.tagName.toLowerCase() != 'mat-pseudo-checkbox') {
270
274
  childOption.click();
271
275
  }
272
- const option = this._matOptions.find(i => i.id == childOption.id);
276
+ const option = this._getMatOptionById(childOption.id);
277
+ if (!option) {
278
+ return;
279
+ }
273
280
  if (this.multiple && this._matSelect.panelOpen) {
274
- this._updateCompleteRowList(option.value, option._selected);
281
+ this._updateCompleteRowList(option.value, option.selected);
275
282
  }
276
283
  if (!this.multiple) {
277
284
  this.completeRowList.splice(0);
@@ -291,34 +298,18 @@ class CmatSelectTableComponent {
291
298
  this._sort.sort({ id: '', start: 'asc', disableClear: false });
292
299
  }
293
300
  if (!opened) {
294
- if (this.multiple) {
295
- this.value = this.completeRowList.length > 0 ? [...this.completeRowList] : null;
296
- }
297
- else {
298
- this.value = this.completeRowList.length > 0 ? { ...this.completeRowList[0] } : null;
299
- }
301
+ this.value = this._getCommittedValue();
300
302
  if (this.value === null) {
301
303
  this.completeRowList.splice(0);
302
304
  this._completeValueList.splice(0);
303
305
  this._checkAndResetSelection();
304
306
  }
305
- this._matSelect.writeValue(this.value);
306
- this._matSelect._onChange(this.value);
307
+ this._syncMatSelectValue(this.value);
307
308
  this.closed.emit(!opened);
308
309
  return;
309
310
  }
310
311
  this._table._headerRowDefChanged = true;
311
- setTimeout(() => {
312
- let tableAdditionalHeight = 0;
313
- this._table._getRenderedRows(this._table._headerRowOutlet)
314
- .concat(this._table._getRenderedRows(this._table._footerRowOutlet))
315
- .forEach(row => tableAdditionalHeight += row.getBoundingClientRect().height);
316
- const panelElement = this._matSelect.panel.nativeElement;
317
- const panelHeight = panelElement.getBoundingClientRect().height;
318
- if (!isNaN(panelHeight)) {
319
- panelElement.style.maxHeight = `${panelHeight + tableAdditionalHeight}px`;
320
- }
321
- }, 1);
312
+ setTimeout(() => this._expandPanelForTableRows(), 1);
322
313
  }
323
314
  filterFormControl(key) {
324
315
  if (!this._filterControls.contains(key)) {
@@ -327,25 +318,11 @@ class CmatSelectTableComponent {
327
318
  return this._filterControls.get(key);
328
319
  }
329
320
  simpleTriggerLabelFn(value) {
330
- if (!isNil(this.triggerLabelSort)) {
331
- this._sortData(value, this.triggerLabelSort.active, this.triggerLabelSort.direction);
332
- }
333
- return value.map((row) => {
334
- if (isNil(row)) {
335
- return '';
336
- }
337
- if (isNil(this.customTriggerLabelTemplate)
338
- || typeof this.customTriggerLabelTemplate !== 'string'
339
- || this.customTriggerLabelTemplate.trim().length === 0) {
340
- return `${row.id}`;
341
- }
342
- let atLeastPartialSubstitution = false;
343
- const substitution = this.customTriggerLabelTemplate.replace(/[$]{1}[{]{1}([^}]+)[}]{1}?/g, (_, key) => !isNil(row[key]) && (atLeastPartialSubstitution = true) ? row[key] : '');
344
- if (atLeastPartialSubstitution === false) {
345
- return `${row.id}`;
346
- }
347
- return substitution.trim();
348
- }).join(', ');
321
+ const rows = this._getTriggerRows(value);
322
+ return rows.map(row => this._resolveTriggerLabel(row)).join(', ');
323
+ }
324
+ getTriggerLabel() {
325
+ return this.customTriggerLabelFn?.(this.completeRowList) ?? this.simpleTriggerLabelFn(this.completeRowList);
349
326
  }
350
327
  toggleOverallSearch() {
351
328
  this.overallSearchVisibleState = !this.overallSearchVisibleState;
@@ -358,13 +335,17 @@ class CmatSelectTableComponent {
358
335
  addNullRow() {
359
336
  return !this.multiple && this.canNull;
360
337
  }
338
+ get hasNullRow() {
339
+ return this.addNullRow();
340
+ }
361
341
  _init(value) {
362
342
  this.completeRowList.splice(0);
363
343
  this._completeValueList.splice(0);
364
344
  if (value) {
365
- if (this.multiple)
345
+ if (this.multiple && Array.isArray(value)) {
366
346
  value.forEach((v) => this._updateCompleteRowList(v, true));
367
- else {
347
+ }
348
+ else if (!this.multiple) {
368
349
  this._updateCompleteRowList(value, true);
369
350
  }
370
351
  }
@@ -380,15 +361,19 @@ class CmatSelectTableComponent {
380
361
  return;
381
362
  }
382
363
  if (selected) {
383
- ((this.dataSource || { data: [] }).data || [])
384
- .filter(row => !isNil(row) && !isNil(row[this.keyParam]) && row[this.keyParam] === value[this.keyParam])
385
- .forEach((row) => {
386
- const i = this.completeRowList.find(i => i[this.keyParam] === value[this.keyParam]);
387
- if (!i) {
388
- this.completeRowList.push(row);
389
- this._completeValueList.push(row.id);
390
- }
391
- });
364
+ const rowId = value.id;
365
+ if (isNil(rowId)) {
366
+ return;
367
+ }
368
+ const row = this._rowById.get(rowId);
369
+ if (!row) {
370
+ return;
371
+ }
372
+ const exists = this.completeRowList.some(item => item[this.keyParam] === row[this.keyParam]);
373
+ if (!exists) {
374
+ this.completeRowList.push(row);
375
+ this._completeValueList.push(row.id);
376
+ }
392
377
  }
393
378
  else {
394
379
  const rowIndex = this.completeRowList.findIndex(i => i.id === value.id);
@@ -403,19 +388,25 @@ class CmatSelectTableComponent {
403
388
  this.filteredOutRows = {};
404
389
  const filters = {};
405
390
  Object.keys(this._filterControls.controls)
406
- .filter(key => this.tableColumnsMap.has(key)
407
- && !isNil(this.tableColumnsMap.get(key)?.filter)
408
- && this.tableColumnsMap.get(key)?.filter.enabled !== false)
409
391
  .filter((key) => {
410
- const value = this._filterControls.get(key)?.value;
392
+ const column = this.tableColumnsMap.get(key);
393
+ return !isNil(column?.filter) && column.filter.enabled !== false;
394
+ })
395
+ .filter((key) => {
396
+ const filterControl = this._filterControls.get(key);
397
+ const value = filterControl?.value;
411
398
  return !isNil(value)
412
399
  && ((isArray(value) && value.length > 0)
413
400
  || (typeof value === 'string' && value.trim().length > 0)
414
401
  || (typeof value === 'number' && `${value}`.trim().length > 0));
415
402
  })
416
- .forEach(key => filters[key] = {
417
- filter: this.tableColumnsMap.get(key)?.filter,
418
- value: this._filterControls.get(key)?.value
403
+ .forEach((key) => {
404
+ const column = this.tableColumnsMap.get(key);
405
+ const filterControl = this._filterControls.get(key);
406
+ filters[key] = {
407
+ filter: column?.filter,
408
+ value: filterControl?.value
409
+ };
419
410
  });
420
411
  const filterKeys = Object.keys(filters);
421
412
  for (let i = data.length - 1; i >= 0; i--) {
@@ -423,64 +414,14 @@ class CmatSelectTableComponent {
423
414
  for (let k = 0; k < filterKeys.length; k++) {
424
415
  const filterKey = filterKeys[k];
425
416
  const row = data[i];
426
- if (isNil(row)) {
427
- continue;
428
- }
429
- const cellValue = row[filterKey];
430
- if (isNil(cellValue)) {
431
- data.splice(i, 1).forEach(item => this.filteredOutRows[`${item.id}`] = item);
432
- continue;
433
- }
434
417
  const filter = filters[filterKey];
435
- const comparator = filter.filter?.comparator;
436
- if (filter.filter?.type === 'number') {
437
- filter.value = Number(filter.value);
438
- }
439
- if (typeof filter.filter?.comparatorFn === 'function') {
440
- if (!filter.filter.comparatorFn.call(null, cellValue, filter.value, row)) {
441
- data.splice(i, 1).forEach(item => this.filteredOutRows[`${item.id}`] = item);
442
- break;
443
- }
444
- }
445
- else if (isNil(comparator) || comparator === 'equals') {
446
- if (filter.value !== cellValue) {
447
- data.splice(i, 1).forEach(item => this.filteredOutRows[`${item.id}`] = item);
448
- break;
449
- }
418
+ if (isNil(row)) {
419
+ this._removeFilteredRow(data, i);
420
+ break;
450
421
  }
451
- else if (typeof cellValue === 'string' && typeof filter.value === 'string') {
452
- const cellValueLC = `${cellValue}`.toLowerCase();
453
- const filterValueLC = filter.value.toLowerCase();
454
- if (isNil(comparator) || comparator === 'equalsIgnoreCase') {
455
- if (filterValueLC !== cellValueLC) {
456
- data.splice(i, 1).forEach(item => this.filteredOutRows[`${item.id}`] = item);
457
- break;
458
- }
459
- }
460
- else if (comparator === 'contains') {
461
- if (!cellValue.includes(filter.value)) {
462
- data.splice(i, 1).forEach(item => this.filteredOutRows[`${item.id}`] = item);
463
- break;
464
- }
465
- }
466
- else if (comparator === 'containsIgnoreCase') {
467
- if (!cellValueLC.includes(filterValueLC)) {
468
- data.splice(i, 1).forEach(item => this.filteredOutRows[`${item.id}`] = item);
469
- break;
470
- }
471
- }
472
- else if (comparator === 'startsWith') {
473
- if (!cellValue.startsWith(filter.value)) {
474
- data.splice(i, 1).forEach(item => this.filteredOutRows[`${item.id}`] = item);
475
- break;
476
- }
477
- }
478
- else if (comparator === 'startsWithIgnoreCase') {
479
- if (!cellValueLC.startsWith(filterValueLC)) {
480
- data.splice(i, 1).forEach(item => this.filteredOutRows[`${item.id}`] = item);
481
- break;
482
- }
483
- }
422
+ if (!this._matchesColumnFilter(row, filterKey, filter)) {
423
+ this._removeFilteredRow(data, i);
424
+ break;
484
425
  }
485
426
  }
486
427
  }
@@ -497,20 +438,25 @@ class CmatSelectTableComponent {
497
438
  for (let i = data.length - 1; i >= 0; i--) {
498
439
  const row = data[i];
499
440
  let rowShouldBeFiltered = true;
500
- for (let j = this.dataSource.columns.length - 1; j >= 0; j--) {
501
- const key = this.dataSource.columns[j].key;
441
+ const rowKeys = this._columnKeys;
442
+ for (let j = rowKeys.length - 1; j >= 0; j--) {
443
+ const key = rowKeys[j];
502
444
  const cellValue = row[key];
503
445
  if (isNil(cellValue)) {
504
446
  continue;
505
447
  }
506
- const cellValueLC = `${cellValue}`.toLowerCase();
448
+ const cellValueLC = typeof cellValue === 'string'
449
+ ? cellValue.toLowerCase()
450
+ : typeof cellValue === 'number' || typeof cellValue === 'boolean' || typeof cellValue === 'bigint'
451
+ ? String(cellValue).toLowerCase()
452
+ : '';
507
453
  if (cellValueLC.includes(filterValueLC)) {
508
454
  rowShouldBeFiltered = false;
509
455
  break;
510
456
  }
511
457
  }
512
458
  if (rowShouldBeFiltered) {
513
- data.splice(i, 1).forEach(item => this.filteredOutRows[`${item.id}`] = item);
459
+ this._removeFilteredRow(data, i);
514
460
  }
515
461
  }
516
462
  }
@@ -540,11 +486,9 @@ class CmatSelectTableComponent {
540
486
  else if (b.id === null) {
541
487
  return 1;
542
488
  }
543
- // Both null/undefined/equal value check
544
489
  if (aValue === bValue) {
545
490
  return 0;
546
491
  }
547
- // One null value check
548
492
  if (isNil(aValue) && !isNil(bValue)) {
549
493
  return -1;
550
494
  }
@@ -557,14 +501,11 @@ class CmatSelectTableComponent {
557
501
  if (bValue instanceof Date) {
558
502
  bValue = bValue.getTime();
559
503
  }
560
- // User localeCompare for strings
561
504
  if (isString(aValue) && isString(bValue)) {
562
505
  return (aValue).localeCompare(bValue) * (direction === 'asc' ? 1 : -1);
563
506
  }
564
- // Try to convert to a Number type
565
507
  aValue = isNaN(aValue) ? `${aValue}` : +aValue;
566
508
  bValue = isNaN(bValue) ? `${bValue}` : +bValue;
567
- // if one is number and other is String
568
509
  if (isString(aValue) && isNumber(bValue)) {
569
510
  return (1) * (direction === 'asc' ? 1 : -1);
570
511
  }
@@ -580,14 +521,116 @@ class CmatSelectTableComponent {
580
521
  this.resetOptionAction();
581
522
  }
582
523
  }
583
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CmatSelectTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
584
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.7", type: CmatSelectTableComponent, isStandalone: true, selector: "cmat-select-table", inputs: { id: "id", dataSource: "dataSource", noEntriesFoundLabel: "noEntriesFoundLabel", showNoFoundLabel: "showNoFoundLabel", isPhone: "isPhone", multiple: "multiple", overallSearchEnabled: "overallSearchEnabled", overallSearchVisible: "overallSearchVisible", resetSortOnOpen: "resetSortOnOpen", resetFiltersOnOpen: "resetFiltersOnOpen", customTriggerLabelFn: "customTriggerLabelFn", triggerLabelSort: "triggerLabelSort", customTriggerLabelTemplate: "customTriggerLabelTemplate", canNull: "canNull", defaultSort: "defaultSort", resetOptionAction: "resetOptionAction", keyParam: "keyParam", compareWith: "compareWith", placeholder: "placeholder", value: "value", required: "required", disabled: "disabled" }, outputs: { closed: "closed" }, host: { listeners: { "document:click": "clickedOut()" }, properties: { "attr.id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: CmatSelectTableComponent }], viewQueries: [{ propertyName: "_matSelectSearch", first: true, predicate: CmatSelectSearchComponent, descendants: true }, { propertyName: "_sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "_table", first: true, predicate: MatTable, descendants: true }, { propertyName: "matSelect", first: true, predicate: ["componentSelect"], descendants: true }, { propertyName: "_matOptions", predicate: MatOption, descendants: true }], exportAs: ["cmatSelectTable"], usesOnChanges: true, ngImport: i0, template: "@if(multiple){\r\n<mat-select #componentSelect multiple disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if(!customTriggerLabelFn){\r\n {{simpleTriggerLabelFn(completeRowList)}}\r\n }@else {\r\n {{customTriggerLabelFn(completeRowList)}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource\">\r\n @for (columnKey of tableColumns; track $index) {\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{selection: true, hidden: !multiple}\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{selection: true, hidden: !multiple}\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!tableColumnsMap.get(columnKey)?.sortable\">\r\n @if(!tableColumnsMap.get(columnKey)?.sortable){\r\n <div>{{tableColumnsMap.get(columnKey)?.name}}</div>\r\n }@else {\r\n @switch (tableColumnsMap.get(columnKey)?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: tableColumnsMap.get(columnKey)}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: tableColumnsMap.get(columnKey)}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{tableColumnsMap.get(columnKey)?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"tableColumnsMap.get(columnKey)?.name+':'\">\r\n {{row[columnKey]}}\r\n </div>\r\n\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns; sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns;\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}@else {\r\n<mat-select #componentSelect disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if(!customTriggerLabelFn){\r\n {{simpleTriggerLabelFn(completeRowList)}}\r\n }@else {\r\n {{customTriggerLabelFn(completeRowList)}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource\">\r\n @for (columnKey of tableColumns; track $index) {\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if(row.id===null){\r\n <mat-option></mat-option>\r\n }@else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!tableColumnsMap.get(columnKey)?.sortable\">\r\n @if(!tableColumnsMap.get(columnKey)?.sortable){\r\n <div>{{tableColumnsMap.get(columnKey)?.name}}</div>\r\n }@else {\r\n @switch (tableColumnsMap.get(columnKey)?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: tableColumnsMap.get(columnKey)}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: tableColumnsMap.get(columnKey)}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{tableColumnsMap.get(columnKey)?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell\r\n [colSpan]=\"addNullRow() && row.id === null && $index === 1 ? tableColumns.length : 1\"\r\n [ngStyle]=\"{display: addNullRow() && row.id === null && $index !== 1 ? 'none' : ''}\">\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"tableColumnsMap.get(columnKey)?.name+':'\">\r\n {{addNullRow() && row.id === null && $index === 1 ? '\u7A7A' : row[columnKey]}}\r\n </div> \r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns; sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns;\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\"\r\n [placeholder]=\"column.name\" (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>", styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"], dependencies: [{ kind: "component", type: CmatSelectSearchComponent, selector: "cmat-select-search", inputs: ["placeholderLabel", "type", "noEntriesFoundLabel", "showNoFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"], exportAs: ["cmatSelectSearch"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i2.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i7.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: "ngmodule", type: MatSortModule }, { kind: "directive", type: i8.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i8.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: CmatDigitOnlyDirective, selector: "[cmatDigitOnly]", inputs: ["decimal", "decimalSeparator", "allowNegatives", "allowPaste", "negativeSign", "min", "max", "pattern"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
524
+ _matchesColumnFilter(row, filterKey, filter) {
525
+ const cellValue = row[filterKey];
526
+ if (isNil(cellValue)) {
527
+ return false;
528
+ }
529
+ const columnFilter = filter.filter;
530
+ const comparator = columnFilter?.comparator;
531
+ const filterValue = filter.value;
532
+ const normalizedFilterValue = columnFilter?.type === 'number' ? Number(filterValue) : filterValue;
533
+ if (typeof columnFilter?.comparatorFn === 'function') {
534
+ return columnFilter.comparatorFn.call(null, cellValue, normalizedFilterValue, row);
535
+ }
536
+ if (isNil(comparator) || comparator === 'equals') {
537
+ return normalizedFilterValue === cellValue;
538
+ }
539
+ if (typeof cellValue !== 'string' || typeof normalizedFilterValue !== 'string') {
540
+ return false;
541
+ }
542
+ const cellValueLC = cellValue.toLowerCase();
543
+ const filterValueLC = normalizedFilterValue.toLowerCase();
544
+ if (isNil(comparator) || comparator === 'equalsIgnoreCase') {
545
+ return filterValueLC === cellValueLC;
546
+ }
547
+ if (comparator === 'contains') {
548
+ return cellValue.includes(normalizedFilterValue);
549
+ }
550
+ if (comparator === 'containsIgnoreCase') {
551
+ return cellValueLC.includes(filterValueLC);
552
+ }
553
+ if (comparator === 'startsWith') {
554
+ return cellValue.startsWith(normalizedFilterValue);
555
+ }
556
+ if (comparator === 'startsWithIgnoreCase') {
557
+ return cellValueLC.startsWith(filterValueLC);
558
+ }
559
+ return true;
560
+ }
561
+ _buildTableOptions(options) {
562
+ const tableOptions = [];
563
+ for (const row of this.tableDataSource) {
564
+ const rowOption = options[String(row.id)];
565
+ if (!isNil(rowOption)) {
566
+ tableOptions.push(rowOption);
567
+ }
568
+ }
569
+ return tableOptions;
570
+ }
571
+ _getMatOptionById(id) {
572
+ return this._matOptions.find(option => option.id === id);
573
+ }
574
+ _expandPanelForTableRows() {
575
+ let tableAdditionalHeight = 0;
576
+ this._table._getRenderedRows(this._table._headerRowOutlet).forEach(row => tableAdditionalHeight += row.getBoundingClientRect().height);
577
+ this._table._getRenderedRows(this._table._footerRowOutlet).forEach(row => tableAdditionalHeight += row.getBoundingClientRect().height);
578
+ const panelElement = this._matSelect.panel.nativeElement;
579
+ const panelHeight = panelElement.getBoundingClientRect().height;
580
+ if (!isNaN(panelHeight)) {
581
+ panelElement.style.maxHeight = `${panelHeight + tableAdditionalHeight}px`;
582
+ }
583
+ }
584
+ _getCommittedValue() {
585
+ if (this.completeRowList.length === 0) {
586
+ return null;
587
+ }
588
+ return this.multiple ? [...this.completeRowList] : { ...this.completeRowList[0] };
589
+ }
590
+ _syncMatSelectValue(value) {
591
+ this._matSelect.writeValue(value);
592
+ this._matSelect._onChange(value);
593
+ }
594
+ _removeFilteredRow(data, index) {
595
+ data.splice(index, 1).forEach(item => this.filteredOutRows[`${item.id}`] = item);
596
+ }
597
+ _resolveTriggerLabel(row) {
598
+ if (isNil(row)) {
599
+ return '';
600
+ }
601
+ const template = typeof this.customTriggerLabelTemplate === 'string' ? this.customTriggerLabelTemplate.trim() : '';
602
+ if (template.length === 0) {
603
+ return `${row.id}`;
604
+ }
605
+ const rowRecord = row;
606
+ let hasMatch = false;
607
+ const substitution = template.replace(/[$]{1}[{]{1}([^}]+)[}]{1}?/g, (_, key) => {
608
+ const value = rowRecord[key];
609
+ if (isNil(value)) {
610
+ return '';
611
+ }
612
+ if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean' && typeof value !== 'bigint') {
613
+ return '';
614
+ }
615
+ hasMatch = true;
616
+ return String(value);
617
+ });
618
+ return hasMatch ? substitution.trim() : `${row.id}`;
619
+ }
620
+ _getTriggerRows(value) {
621
+ if (isNil(this.triggerLabelSort)) {
622
+ return value;
623
+ }
624
+ return this._sortData([...value], this.triggerLabelSort.active, this.triggerLabelSort.direction);
625
+ }
626
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatSelectTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
627
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CmatSelectTableComponent, isStandalone: true, selector: "cmat-select-table", inputs: { id: "id", dataSource: "dataSource", noEntriesFoundLabel: "noEntriesFoundLabel", showNoFoundLabel: "showNoFoundLabel", isPhone: "isPhone", multiple: "multiple", overallSearchEnabled: "overallSearchEnabled", overallSearchVisible: "overallSearchVisible", resetSortOnOpen: "resetSortOnOpen", resetFiltersOnOpen: "resetFiltersOnOpen", customTriggerLabelFn: "customTriggerLabelFn", triggerLabelSort: "triggerLabelSort", customTriggerLabelTemplate: "customTriggerLabelTemplate", canNull: "canNull", defaultSort: "defaultSort", resetOptionAction: "resetOptionAction", keyParam: "keyParam", compareWith: "compareWith", placeholder: "placeholder", value: "value", required: "required", disabled: "disabled" }, outputs: { closed: "closed" }, host: { listeners: { "document:click": "clickedOut()" }, properties: { "attr.id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: CmatSelectTableComponent }], viewQueries: [{ propertyName: "_matSelectSearch", first: true, predicate: CmatSelectSearchComponent, descendants: true }, { propertyName: "_sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "_table", first: true, predicate: MatTable, descendants: true }, { propertyName: "matSelect", first: true, predicate: ["componentSelect"], descendants: true }, { propertyName: "_matOptions", predicate: MatOption, descendants: true }], exportAs: ["cmatSelectTable"], usesOnChanges: true, ngImport: i0, template: "@if(multiple){\r\n<mat-select #componentSelect multiple disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @let triggerLabel = getTriggerLabel();\r\n {{ triggerLabel }}\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource\">\r\n @for (columnKey of tableColumns; track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{selection: true, hidden: !multiple}\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{selection: true, hidden: !multiple}\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{row[columnKey]}}\r\n </div>\r\n\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns; sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns;\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}@else {\r\n<mat-select #componentSelect disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if(!customTriggerLabelFn){\r\n {{simpleTriggerLabelFn(completeRowList)}}\r\n }@else {\r\n {{customTriggerLabelFn(completeRowList)}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource\">\r\n @for (columnKey of tableColumns; track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if(row.id===null){\r\n <mat-option></mat-option>\r\n }@else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell\r\n [colSpan]=\"hasNullRow && row.id === null && $index === 1 ? tableColumns.length : 1\"\r\n [ngStyle]=\"{display: hasNullRow && row.id === null && $index !== 1 ? 'none' : ''}\">\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{hasNullRow && row.id === null && $index === 1 ? '\u7A7A' : row[columnKey]}}\r\n </div> \r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns; sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns;\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\"\r\n [placeholder]=\"column.name\" (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n", styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"], dependencies: [{ kind: "component", type: CmatSelectSearchComponent, selector: "cmat-select-search", inputs: ["placeholderLabel", "type", "noEntriesFoundLabel", "showNoFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"], exportAs: ["cmatSelectSearch"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i2.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i7.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: "ngmodule", type: MatSortModule }, { kind: "directive", type: i8.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i8.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: CmatDigitOnlyDirective, selector: "[cmatDigitOnly]", inputs: ["decimal", "decimalSeparator", "allowNegatives", "allowPaste", "negativeSign", "min", "max", "pattern"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
585
628
  }
586
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CmatSelectTableComponent, decorators: [{
629
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatSelectTableComponent, decorators: [{
587
630
  type: Component,
588
631
  args: [{ selector: 'cmat-select-table', exportAs: 'cmatSelectTable', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [{ provide: MatFormFieldControl, useExisting: CmatSelectTableComponent }], imports: [CmatSelectSearchComponent, MatFormFieldModule, MatSelectModule, ReactiveFormsModule, CommonModule,
589
632
  MatIconModule, MatTableModule, MatInputModule, MatSortModule, CmatDigitOnlyDirective
590
- ], template: "@if(multiple){\r\n<mat-select #componentSelect multiple disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if(!customTriggerLabelFn){\r\n {{simpleTriggerLabelFn(completeRowList)}}\r\n }@else {\r\n {{customTriggerLabelFn(completeRowList)}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource\">\r\n @for (columnKey of tableColumns; track $index) {\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{selection: true, hidden: !multiple}\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{selection: true, hidden: !multiple}\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!tableColumnsMap.get(columnKey)?.sortable\">\r\n @if(!tableColumnsMap.get(columnKey)?.sortable){\r\n <div>{{tableColumnsMap.get(columnKey)?.name}}</div>\r\n }@else {\r\n @switch (tableColumnsMap.get(columnKey)?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: tableColumnsMap.get(columnKey)}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: tableColumnsMap.get(columnKey)}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{tableColumnsMap.get(columnKey)?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"tableColumnsMap.get(columnKey)?.name+':'\">\r\n {{row[columnKey]}}\r\n </div>\r\n\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns; sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns;\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}@else {\r\n<mat-select #componentSelect disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if(!customTriggerLabelFn){\r\n {{simpleTriggerLabelFn(completeRowList)}}\r\n }@else {\r\n {{customTriggerLabelFn(completeRowList)}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource\">\r\n @for (columnKey of tableColumns; track $index) {\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if(row.id===null){\r\n <mat-option></mat-option>\r\n }@else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!tableColumnsMap.get(columnKey)?.sortable\">\r\n @if(!tableColumnsMap.get(columnKey)?.sortable){\r\n <div>{{tableColumnsMap.get(columnKey)?.name}}</div>\r\n }@else {\r\n @switch (tableColumnsMap.get(columnKey)?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: tableColumnsMap.get(columnKey)}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: tableColumnsMap.get(columnKey)}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{tableColumnsMap.get(columnKey)?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell\r\n [colSpan]=\"addNullRow() && row.id === null && $index === 1 ? tableColumns.length : 1\"\r\n [ngStyle]=\"{display: addNullRow() && row.id === null && $index !== 1 ? 'none' : ''}\">\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"tableColumnsMap.get(columnKey)?.name+':'\">\r\n {{addNullRow() && row.id === null && $index === 1 ? '\u7A7A' : row[columnKey]}}\r\n </div> \r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns; sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns;\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\"\r\n [placeholder]=\"column.name\" (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>", styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"] }]
633
+ ], template: "@if(multiple){\r\n<mat-select #componentSelect multiple disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @let triggerLabel = getTriggerLabel();\r\n {{ triggerLabel }}\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource\">\r\n @for (columnKey of tableColumns; track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell [ngClass]=\"{selection: true, hidden: !multiple}\"></th>\r\n <td *matCellDef=\"let row\" mat-cell [ngClass]=\"{selection: true, hidden: !multiple}\">\r\n <mat-option [value]=\"row\"></mat-option>\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell>\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{row[columnKey]}}\r\n </div>\r\n\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns; sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns;\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}@else {\r\n<mat-select #componentSelect disableRipple \r\n [placeholder]=\"placeholder\" [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\"\r\n (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if(!customTriggerLabelFn){\r\n {{simpleTriggerLabelFn(completeRowList)}}\r\n }@else {\r\n {{customTriggerLabelFn(completeRowList)}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div class=\"h-full overflow-y-auto scrollbar-custom\" [ngClass]=\"{'hidden-header': overallSearchVisibleState}\"\r\n (focusout)=\"onFocusOut($event)\">\r\n @if(overallSearchEnabled){\r\n <mat-option [ngClass]=\"{'hidden':!overallSearchVisibleState === true}\">\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"resetFiltersOnOpen\">\r\n </cmat-select-search>\r\n </mat-option>\r\n\r\n @if(!isPhone){\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\"\r\n [svgIcon]=\"overallSearchVisibleState ? 'mat_outline:arrow_back' : 'mat_outline:search'\"\r\n (click)=\"toggleOverallSearch()\">\r\n </mat-icon>\r\n </div>\r\n }@else{\r\n <div class=\"overall-search-toggle\" [ngStyle]=\"{ height: overallSearchVisibleState ? '48px' : '55.4px' }\">\r\n <mat-icon color=\"primary\" [svgIcon]=\"'mat_outline:search'\">\r\n </mat-icon>\r\n </div>\r\n }\r\n }\r\n <table #table mat-table matSort [dataSource]=\"tableDataSource\">\r\n @for (columnKey of tableColumns; track $index) {\r\n @let column = tableColumnsMap.get(columnKey);\r\n @switch (columnKey) {\r\n @case ('_selection') {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell class=\"selection\"></th>\r\n <td *matCellDef=\"let row\" mat-cell class=\"selection\">\r\n @if(row.id===null){\r\n <mat-option></mat-option>\r\n }@else {\r\n <mat-option [value]=\"row\"></mat-option>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n @default {\r\n <ng-container [matColumnDef]=\"columnKey\">\r\n <th *matHeaderCellDef mat-header-cell mat-sort-header\r\n [disabled]=\"!column?.sortable\">\r\n @if(!column?.sortable){\r\n <div>{{column?.name}}</div>\r\n }@else {\r\n @switch (column?.filter?.type) {\r\n @case ('string') {\r\n <ng-container [ngTemplateOutlet]=\"filterTypeString\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @case('number'){\r\n <ng-container [ngTemplateOutlet]=\"filterTypeNumber\"\r\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\r\n }\r\n @default {\r\n <div>{{column?.name}}</div>\r\n }\r\n }\r\n }\r\n </th>\r\n <td *matCellDef=\"let row\" mat-cell\r\n [colSpan]=\"hasNullRow && row.id === null && $index === 1 ? tableColumns.length : 1\"\r\n [ngStyle]=\"{display: hasNullRow && row.id === null && $index !== 1 ? 'none' : ''}\">\r\n <div class=\" has-label-on-mobile\" [attr.data-label]=\"column?.name+':'\">\r\n {{hasNullRow && row.id === null && $index === 1 ? '\u7A7A' : row[columnKey]}}\r\n </div> \r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n }\r\n\r\n <tr *matHeaderRowDef=\"tableColumns; sticky: true\" mat-header-row></tr>\r\n <tr *matRowDef=\"let row; columns: tableColumns;\" mat-row (click)=\"emulateMatOptionClick($event)\"></tr>\r\n </table>\r\n </div>\r\n</mat-select>\r\n}\r\n<ng-template #filterTypeString let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput [formControl]=\"filterFormControl(column.key)\" [placeholder]=\"column.name\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n\r\n<ng-template #filterTypeNumber let-column='column'>\r\n <mat-form-field class=\"filter\" (click)=\"$event.stopPropagation()\">\r\n <input matInput cmatDigitOnly [min]=\"0\" [formControl]=\"filterFormControl(column.key)\"\r\n [placeholder]=\"column.name\" (keydown)=\"$event.stopPropagation()\" (keyup)=\"$event.stopPropagation()\"\r\n (keypress)=\"$event.stopPropagation()\" />\r\n </mat-form-field>\r\n</ng-template>\r\n", styles: ["cmat-select-table{display:block;width:100%}.cmat-select-search-table-panel{min-width:max-content;max-width:100%;min-height:240px;padding-top:0!important}.cmat-select-search-table-panel .overall-search-toggle{z-index:102;display:flex;cursor:pointer;position:absolute;width:48px;height:48px;align-items:center;left:12px;top:0}.cmat-select-search-table-panel .hidden-header table thead{display:none}.cmat-select-search-table-panel table{width:100%}.cmat-select-search-table-panel table tr{cursor:pointer;height:48px;max-height:48px}.cmat-select-search-table-panel table tr mat-option{height:48px;max-height:48px}.cmat-select-search-table-panel table tr td{-webkit-user-select:none;user-select:none;border-bottom:0!important;box-shadow:inset 0 -1px var(--cmat-border)}.cmat-select-search-table-panel table tr th .mat-sort-header-container{height:55px}.cmat-select-search-table-panel table tr th .mat-sort-header-container mat-form-field .mat-form-field-infix{width:initial}.cmat-select-search-table-panel table tr th[aria-sort] .mat-sort-header-arrow{opacity:1!important}.cmat-select-search-table-panel table tr td mat-option,.cmat-select-search-table-panel table tr th mat-option{background:transparent!important}.cmat-select-search-table-panel table tr td.selection,.cmat-select-search-table-panel table tr th.selection{width:48px;padding:0;margin:0}.cmat-select-search-table-panel table tr:has(td:first-child mat-option[aria-selected=true]){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))!important;color:rgba(var(--cmat-primary-rgb),1)!important}.cmat-select-search-table-panel .cmat-select-search-inner>span{visibility:hidden}\n"] }]
591
634
  }], ctorParameters: () => [], propDecorators: { id: [{
592
635
  type: HostBinding,
593
636
  args: ['attr.id']