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
@@ -1,8 +1,9 @@
1
1
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
2
2
  import { SelectionModel } from '@angular/cdk/collections';
3
- import { NgClass, AsyncPipe } from '@angular/common';
3
+ import { NgClass } from '@angular/common';
4
4
  import * as i0 from '@angular/core';
5
- import { inject, ChangeDetectorRef, Input, HostListener, ViewChild, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
5
+ import { inject, ChangeDetectorRef, DestroyRef, Input, HostListener, ViewChild, 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, ReactiveFormsModule } from '@angular/forms';
8
9
  import * as i5 from '@angular/material/button';
@@ -18,8 +19,7 @@ import * as i4 from '@angular/material/tree';
18
19
  import { MatTreeModule } from '@angular/material/tree';
19
20
  import { CmatSelectSearchComponent } from 'cmat/components/select-search';
20
21
  import { isUndefined, isNil } from 'lodash-es';
21
- import { ReplaySubject, Subject, merge } from 'rxjs';
22
- import { takeUntil, debounceTime } from 'rxjs/operators';
22
+ import { Subject, debounceTime } from 'rxjs';
23
23
 
24
24
  class CmatSelectTreeFlatNode {
25
25
  }
@@ -40,20 +40,22 @@ class CmatSelectTreeComponent {
40
40
  };
41
41
  this.flatNodeMap = new Map();
42
42
  this.nestedNodeMap = new Map();
43
- this.selectedParent = null;
43
+ this._flatNodeById = new Map();
44
+ this._parentFlatNodeById = new Map();
45
+ this._selectedFlatNodeIds = new Set();
44
46
  this.checklistSelection = new SelectionModel(true);
45
47
  this.overallFilterControl = new FormControl();
46
48
  this.isIndeterminate = false;
47
49
  this.isChecked = false;
48
50
  this.checkCount = 0;
49
51
  this.selectControl = new FormControl();
50
- this.matSelectData = new ReplaySubject(1);
52
+ this.matSelectData = [];
51
53
  this.stateChanges = new Subject();
52
54
  this.focused = false;
53
55
  this.touched = false;
54
56
  this.ngControl = inject(NgControl, { optional: true, self: true });
55
57
  this._changeDetectorRef = inject(ChangeDetectorRef);
56
- this._unsubscribeAll = new Subject();
58
+ this._destroyRef = inject(DestroyRef);
57
59
  this.getLevel = (dataNode) => dataNode.level;
58
60
  this.childrenAccessor = (node) => node.children ?? [];
59
61
  this.hasChild = (_, node) => !!node.children && node.children.length > 0;
@@ -64,7 +66,8 @@ class CmatSelectTreeComponent {
64
66
  this._onModelChange = () => { };
65
67
  // eslint-disable-next-line @typescript-eslint/no-empty-function
66
68
  this._onTouchedChange = () => { };
67
- this._transformer = (node, level) => {
69
+ this._transformer = (node, level, parent = null) => {
70
+ // 构建平铺节点并缓存映射关系
68
71
  const existingNode = this.nestedNodeMap.get(node);
69
72
  const flatNode = existingNode?.name === node.name
70
73
  ? existingNode
@@ -75,6 +78,8 @@ class CmatSelectTreeComponent {
75
78
  flatNode.expandable = !!node.children && node.children.length > 0;
76
79
  this.flatNodeMap.set(flatNode, node);
77
80
  this.nestedNodeMap.set(node, flatNode);
81
+ this._flatNodeById.set(flatNode.id, flatNode);
82
+ this._parentFlatNodeById.set(flatNode.id, parent);
78
83
  return flatNode;
79
84
  };
80
85
  if (this.ngControl != null) {
@@ -96,16 +101,22 @@ class CmatSelectTreeComponent {
96
101
  }
97
102
  }
98
103
  ngOnChanges(changes) {
104
+ // 数据源变化时,重建节点索引和缓存
99
105
  if (changes['dataSource']) {
106
+ this.flatNodeMap.clear();
107
+ this.nestedNodeMap.clear();
108
+ this._flatNodeById.clear();
109
+ this._parentFlatNodeById.clear();
100
110
  this.treeDataSource = this.dataSource;
101
111
  this.dataFlatNodes = this._getFlattenNodes(this.dataSource);
102
- this.matSelectData.next(this.dataFlatNodes);
112
+ this.matSelectData.splice(0, this.matSelectData.length, ...this.dataFlatNodes);
103
113
  if (this.dataSource.length > 0) {
104
114
  this._init(this.value);
105
115
  }
106
116
  }
107
117
  }
108
118
  ngAfterViewInit() {
119
+ // 初始化下拉面板样式,并监听筛选输入变化
109
120
  let panelClass = ['overflow-y-auto', 'scrollbar-custom'];
110
121
  if (this._matSelect.panelClass) {
111
122
  if (Array.isArray(this._matSelect.panelClass)) {
@@ -115,28 +126,30 @@ class CmatSelectTreeComponent {
115
126
  this._matSelect.panelClass = [this._matSelect.panelClass, ...panelClass];
116
127
  }
117
128
  else if (typeof this._matSelect.panelClass === 'object') {
129
+ const panelClassEntries = this._matSelect.panelClass;
118
130
  panelClass.forEach((i) => {
119
- this._matSelect.panelClass.entries[i] = true;
131
+ panelClassEntries[i] = true;
120
132
  });
121
133
  }
122
134
  }
123
135
  else {
124
136
  this._matSelect.panelClass = panelClass;
125
137
  }
126
- merge(this.overallFilterControl.valueChanges)
127
- .pipe(takeUntil(this._unsubscribeAll), debounceTime(200))
138
+ this.overallFilterControl.valueChanges
139
+ .pipe(takeUntilDestroyed(this._destroyRef), debounceTime(200))
128
140
  .subscribe(() => {
129
- const dataClone = JSON.parse(JSON.stringify([...this.dataSource]));
141
+ const filterValue = `${this.overallFilterControl.value ?? ''}`.toLowerCase();
142
+ const dataClone = this._cloneTreeNodes(this.dataSource);
130
143
  const arr = [];
131
144
  for (let i = dataClone.length - 1; i >= 0; i--) {
132
- if (!this._applyColumnLevelFilters(dataClone[i], this.overallFilterControl.value.toLowerCase())) {
145
+ if (!this._applyColumnLevelFilters(dataClone[i], filterValue)) {
133
146
  arr.push(i);
134
147
  }
135
148
  }
136
149
  arr.forEach((v) => { dataClone.splice(v, 1); });
137
150
  this.treeDataSource = dataClone;
138
151
  this.dataFlatNodes = this._getFlattenNodes(dataClone);
139
- this.matSelectData.next(this.dataFlatNodes);
152
+ this.matSelectData.splice(0, this.matSelectData.length, ...this.dataFlatNodes);
140
153
  if (this.expandable) {
141
154
  this.tree.expandAll();
142
155
  }
@@ -146,8 +159,6 @@ class CmatSelectTreeComponent {
146
159
  }
147
160
  ngOnDestroy() {
148
161
  this.stateChanges.complete();
149
- this._unsubscribeAll.next(void 0);
150
- this._unsubscribeAll.complete();
151
162
  }
152
163
  get placeholder() {
153
164
  return this._placeholder;
@@ -240,7 +251,15 @@ class CmatSelectTreeComponent {
240
251
  return `${node.id}`;
241
252
  }
242
253
  let atLeastPartialSubstitution = false;
243
- const substitution = this.customTriggerLabelTemplate.replace(/[$][{]([^}]+)[}]/g, (_, key) => !isNil(node[key]) && (atLeastPartialSubstitution = true) ? node[key] : '');
254
+ const nodeRecord = node;
255
+ const substitution = this.customTriggerLabelTemplate.replace(/[$][{]([^}]+)[}]/g, (_, key) => {
256
+ const nodeValue = nodeRecord[key];
257
+ if (isNil(nodeValue) || (typeof nodeValue !== 'string' && typeof nodeValue !== 'number' && typeof nodeValue !== 'boolean' && typeof nodeValue !== 'bigint')) {
258
+ return '';
259
+ }
260
+ atLeastPartialSubstitution = true;
261
+ return String(nodeValue);
262
+ });
244
263
  if (atLeastPartialSubstitution === false) {
245
264
  return `${node.id}`;
246
265
  }
@@ -248,6 +267,7 @@ class CmatSelectTreeComponent {
248
267
  }).join(', ');
249
268
  }
250
269
  openedChange(opened) {
270
+ // 面板打开/关闭时,同步树节点和选中值
251
271
  if (opened) {
252
272
  if (this.multiple) {
253
273
  this.checklistSelection.selected.forEach((node) => {
@@ -289,85 +309,90 @@ class CmatSelectTreeComponent {
289
309
  }, 100);
290
310
  }
291
311
  }
292
- /** Whether all the descendants of the node are selected. */
293
312
  descendantsAllSelected(node) {
313
+ // 判断当前节点的所有后代是否都已选中
294
314
  const descendants = this._getDescendants(node);
295
- return descendants.every(child => this.checklistSelection.isSelected(child));
315
+ return descendants.every(child => this._selectedFlatNodeIds.has(child.id));
296
316
  }
297
- /** Whether part of the descendants are selected */
298
317
  descendantsPartiallySelected(node) {
318
+ // 判断当前节点是否处于半选状态
299
319
  const descendants = this._getDescendants(node);
300
- const result = descendants.some(child => this.checklistSelection.isSelected(child));
301
- return result && !descendants.every(child => this.checklistSelection.isSelected(child));
320
+ const result = descendants.some(child => this._selectedFlatNodeIds.has(child.id));
321
+ return result && !descendants.every(child => this._selectedFlatNodeIds.has(child.id));
302
322
  }
303
- /** Toggle the to-do item selection. Select/deselect all the descendants node */
304
323
  todoItemSelectionToggle(event, node) {
324
+ // 切换分支节点的选中状态
305
325
  event.stopPropagation();
306
326
  if (this.multiple) {
307
327
  this.checklistSelection.toggle(node);
308
328
  const descendants = this._getDescendants(node);
309
- const diffCount = descendants.filter(child => this.checklistSelection.isSelected(child)).length;
310
329
  if (this.checklistSelection.isSelected(node)) {
311
330
  this.checklistSelection.select(...descendants);
312
- this.checkCount = this.checkCount + 1 + descendants.length - diffCount;
313
331
  }
314
332
  else {
315
333
  this.checklistSelection.deselect(...descendants);
316
- this.checkCount = this.checkCount - 1 - descendants.length;
317
334
  }
318
335
  this._checkAllParentsSelection(node);
336
+ this._syncSelectedFlatNodeIds();
319
337
  this._updateCheckState();
320
338
  }
321
339
  else {
322
340
  this.checklistSelection.clear();
323
341
  this.checklistSelection.select(node);
342
+ this._syncSelectedFlatNodeIds();
324
343
  this._matSelect.close();
325
344
  }
326
345
  }
327
- /** Toggle a leaf to-do item selection. Check all the parents to see if they changed */
328
346
  todoLeafItemSelectionToggle(event, node) {
347
+ // 切换叶子节点的选中状态
329
348
  event.stopPropagation();
330
349
  if (this.multiple) {
331
350
  this.checklistSelection.toggle(node);
332
- this.checklistSelection.isSelected(node) ? this.checkCount += 1 : this.checkCount -= 1;
333
351
  this._checkAllParentsSelection(node);
352
+ this._syncSelectedFlatNodeIds();
334
353
  this._updateCheckState();
335
354
  }
336
355
  else {
337
356
  this.checklistSelection.clear();
338
357
  this.checklistSelection.select(node);
358
+ this._syncSelectedFlatNodeIds();
339
359
  this._matSelect.close();
340
360
  }
341
361
  }
342
362
  clearSelection() {
363
+ // 清空所有选择
343
364
  this.checklistSelection.clear();
344
365
  this.isChecked = false;
345
366
  this.isIndeterminate = false;
346
367
  this.checkCount = 0;
368
+ this._selectedFlatNodeIds.clear();
347
369
  this.value = null;
348
370
  this._matSelect.writeValue(null);
349
371
  this._matSelect._onChange(null);
350
372
  }
351
373
  toggleSelectAll(selectAllValue) {
374
+ // 全选或取消全选
352
375
  if (selectAllValue) {
353
- this.dataFlatNodes.forEach((node) => {
354
- this.checklistSelection.select(node);
355
- });
376
+ this.checklistSelection.select(...this.dataFlatNodes);
356
377
  this.isIndeterminate = false;
357
378
  this.isChecked = true;
358
- this.checkCount = this.checklistSelection.selected.length;
379
+ this._syncSelectedFlatNodeIds();
359
380
  }
360
381
  else {
361
382
  this.checklistSelection.clear();
362
383
  this.isChecked = false;
363
384
  this.isIndeterminate = false;
364
385
  this.checkCount = 0;
386
+ this._selectedFlatNodeIds.clear();
365
387
  }
366
388
  }
367
389
  getChecklistSelectionIsSelected(i) {
368
- return this.checklistSelection.isSelected(this.nestedNodeMap.get(i));
390
+ // 根据原始节点判断是否已选中
391
+ const flatNode = this.nestedNodeMap.get(i);
392
+ return !!flatNode && this._selectedFlatNodeIds.has(flatNode.id);
369
393
  }
370
394
  _init(v) {
395
+ // 初始化内部值和选中状态
371
396
  if (this.dataSource.length > 0 && this.treeDataSource && this._matSelect) {
372
397
  if (this.expandable) {
373
398
  this.tree.expandAll();
@@ -378,7 +403,7 @@ class CmatSelectTreeComponent {
378
403
  else {
379
404
  this.checklistSelection.clear();
380
405
  }
381
- if (v && v.length > 0) {
406
+ if (Array.isArray(v) && v.length > 0) {
382
407
  if (this.multiple) {
383
408
  const findOutNode = [];
384
409
  this.checklistSelection.selected.forEach((node) => {
@@ -390,17 +415,14 @@ class CmatSelectTreeComponent {
390
415
  findOutNode.forEach((node) => {
391
416
  this.checklistSelection.deselect(node);
392
417
  });
393
- this.value = this.checklistSelection.selected;
394
- this.checkCount = this.checklistSelection.selected.length;
418
+ this.value = [...this.checklistSelection.selected];
395
419
  }
396
420
  else {
397
- this.value = this.checklistSelection.selected;
398
- this.checkCount = 1;
421
+ this.value = this.checklistSelection.selected.length > 0 ? { ...this.checklistSelection.selected[0] } : null;
399
422
  }
400
423
  }
401
424
  else {
402
425
  this.value = v;
403
- this.checkCount = 0;
404
426
  }
405
427
  this._matSelect.writeValue(this.value);
406
428
  this._matSelect._onChange(this.value);
@@ -411,8 +433,8 @@ class CmatSelectTreeComponent {
411
433
  this.value = v;
412
434
  }
413
435
  }
414
- /* Checks all the parents when a leaf node is selected/unselected */
415
436
  _checkAllParentsSelection(node) {
437
+ // 级联更新父节点的选中状态
416
438
  let parent = this._getParentNode(node);
417
439
  while (parent) {
418
440
  parent.expandable = true;
@@ -421,60 +443,49 @@ class CmatSelectTreeComponent {
421
443
  parent = this._getParentNode(parent);
422
444
  }
423
445
  }
424
- /** Check root node checked state and change it accordingly */
425
446
  _checkRootNodeSelection(node) {
447
+ // 根据子节点状态同步父节点选中状态
426
448
  const nodeSelected = this.checklistSelection.isSelected(node);
427
449
  const descendants = this._getDescendants(node);
428
450
  const descAllSelected = descendants.every(child => this.checklistSelection.isSelected(child));
429
451
  if (nodeSelected && !descAllSelected) {
430
452
  this.checklistSelection.deselect(node);
431
- this.checkCount -= 1;
432
453
  }
433
454
  else if (!nodeSelected && (descAllSelected || descendants.length === 0)) {
434
455
  this.checklistSelection.select(node);
435
- this.checkCount += 1;
436
456
  }
457
+ this._updateCheckState();
437
458
  }
438
- /* Get the parent node of a node */
439
459
  _getParentNode(node) {
440
- const currentLevel = this.getLevel(node);
441
- if (currentLevel < 1) {
442
- return null;
443
- }
444
- const startIndex = this.dataFlatNodes.findIndex(j => j === node) - 1;
445
- for (let i = startIndex; i >= 0; i--) {
446
- const currentNode = this.dataFlatNodes[i];
447
- if (this.getLevel(currentNode) < currentLevel) {
448
- return currentNode;
449
- }
450
- }
451
- return null;
460
+ // 通过缓存获取父节点
461
+ return this._parentFlatNodeById.get(node.id) ?? null;
452
462
  }
453
463
  _updateChecklistSelection(value) {
464
+ // 根据外部值同步内部选择状态
454
465
  this.checklistSelection.clear();
455
466
  if (!isNil(value)) {
456
467
  const valueArray = !Array.isArray(value) ? [value] : value;
457
468
  valueArray.forEach((item) => {
458
- const nodeFound = this.dataFlatNodes.find(node => node.id === item.id);
469
+ const nodeFound = this._flatNodeById.get(item.id);
459
470
  if (isNil(nodeFound)) {
460
471
  return;
461
472
  }
462
473
  this.checklistSelection.select(nodeFound);
463
474
  });
475
+ this._syncSelectedFlatNodeIds();
464
476
  }
465
477
  }
466
478
  _updateSelect(value) {
479
+ // 根据当前值同步显示选择
467
480
  if (!isNil(value)) {
468
481
  const valueArray = !Array.isArray(value) ? [value] : value;
469
- this.checkCount = 0;
470
- if (this.overallSearchEnabled) //有搜索功能,转化选中节点为当前数据源节点
482
+ if (this.overallSearchEnabled) // 有搜索功能时,将选中节点转换为当前数据源节点
471
483
  {
472
484
  valueArray.forEach((item) => {
473
- const nodeFound = this.dataFlatNodes.find(node => node.id === item.id);
485
+ const nodeFound = this._flatNodeById.get(item.id);
474
486
  if (isNil(nodeFound)) {
475
487
  return;
476
488
  }
477
- this.checkCount += 1;
478
489
  this.checklistSelection.deselect(item);
479
490
  this.checklistSelection.select(nodeFound);
480
491
  });
@@ -484,10 +495,12 @@ class CmatSelectTreeComponent {
484
495
  this._checkAllParentsSelection(item);
485
496
  });
486
497
  }
498
+ this._syncSelectedFlatNodeIds();
487
499
  this._updateCheckState();
488
500
  }
489
501
  }
490
502
  _applyColumnLevelFilters(node, filter) {
503
+ // 递归过滤节点及其子节点
491
504
  let result = false;
492
505
  if (node?.children && node.children.length > 0) {
493
506
  for (let i = node.children.length - 1; i >= 0; i--) {
@@ -501,43 +514,76 @@ class CmatSelectTreeComponent {
501
514
  if (node?.children?.length === 0) {
502
515
  node.children = null;
503
516
  }
504
- const cellValue = node['name'].toLowerCase();
517
+ const cellValue = node.name.toLowerCase();
505
518
  if (cellValue.includes(filter)) {
506
519
  result = true;
507
520
  }
508
521
  return result;
509
522
  }
510
523
  _updateCheckState() {
524
+ // 更新全选与半选状态
511
525
  if (this.showToggleAllCheckbox && this.dataSource.length > 0) {
512
- this.isIndeterminate = this.checkCount < this.dataFlatNodes.length && this.checkCount > 0;
513
- this.isChecked = this.checkCount === this.dataFlatNodes.length && this.checkCount > 0;
526
+ const selectedCount = this._selectedFlatNodeIds.size;
527
+ this.checkCount = selectedCount;
528
+ this.isIndeterminate = selectedCount < this.dataFlatNodes.length && selectedCount > 0;
529
+ this.isChecked = selectedCount === this.dataFlatNodes.length && selectedCount > 0;
514
530
  }
515
531
  }
516
- _getFlattenNodes(nodes, i = 0) {
532
+ _getFlattenNodes(nodes, i = 0, parent = null) {
533
+ // 将树结构平铺为节点列表
517
534
  const flattenedNodes = [];
518
535
  for (const node of nodes) {
519
- flattenedNodes.push(this._transformer(node, i));
536
+ const flatNode = this._transformer(node, i, parent);
537
+ flattenedNodes.push(flatNode);
520
538
  if (node.children) {
521
- flattenedNodes.push(...this._getFlattenNodes(node.children, i + 1));
539
+ flattenedNodes.push(...this._getFlattenNodes(node.children, i + 1, flatNode));
522
540
  }
523
541
  }
524
542
  return flattenedNodes;
525
543
  }
544
+ _cloneTreeNodes(nodes) {
545
+ return nodes.map(node => ({
546
+ id: node.id,
547
+ name: node.name,
548
+ children: node.children ? this._cloneTreeNodes(node.children) : null
549
+ }));
550
+ }
551
+ _syncSelectedFlatNodeIds() {
552
+ // 同步选中节点 ID 缓存
553
+ this._selectedFlatNodeIds.clear();
554
+ this.checklistSelection.selected.forEach((node) => {
555
+ this._selectedFlatNodeIds.add(node.id);
556
+ });
557
+ this.checkCount = this._selectedFlatNodeIds.size;
558
+ }
526
559
  _getDescendants(dataNode) {
527
- const startIndex = this.dataFlatNodes.findIndex(j => j === dataNode);
528
- const results = [];
529
- for (let i = startIndex + 1; i < this.dataFlatNodes.length && this.getLevel(dataNode) < this.getLevel(this.dataFlatNodes[i]); i++) {
530
- results.push(this.dataFlatNodes[i]);
531
- }
532
- return results;
560
+ // 收集当前节点的所有后代
561
+ const node = this.flatNodeMap.get(dataNode);
562
+ if (!node?.children?.length) {
563
+ return [];
564
+ }
565
+ const descendants = [];
566
+ const collect = (children) => {
567
+ for (const child of children) {
568
+ const flatNode = this.nestedNodeMap.get(child);
569
+ if (flatNode) {
570
+ descendants.push(flatNode);
571
+ }
572
+ if (child.children?.length) {
573
+ collect(child.children);
574
+ }
575
+ }
576
+ };
577
+ collect(node.children);
578
+ return descendants;
533
579
  }
534
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CmatSelectTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
535
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.7", type: CmatSelectTreeComponent, isStandalone: true, selector: "cmat-select-tree", inputs: { id: "id", dataSource: "dataSource", noEntriesFoundLabel: "noEntriesFoundLabel", showNoFoundLabel: "showNoFoundLabel", multiple: "multiple", overallSearchEnabled: "overallSearchEnabled", canNull: "canNull", customTriggerLabelFn: "customTriggerLabelFn", customTriggerLabelTemplate: "customTriggerLabelTemplate", expandable: "expandable", showToggleAllCheckbox: "showToggleAllCheckbox", compareWith: "compareWith", placeholder: "placeholder", value: "value", required: "required", disabled: "disabled" }, host: { listeners: { "document:click": "clickedOut()" }, properties: { "attr.id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: CmatSelectTreeComponent }], viewQueries: [{ propertyName: "tree", first: true, predicate: ["componentTree"], descendants: true }, { propertyName: "matSelect", first: true, predicate: ["componentSelect"], descendants: true }], exportAs: ["cmatSelectTree"], usesOnChanges: true, ngImport: i0, template: "@if(multiple){\r\n<mat-select #componentSelect multiple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith\" (openedChange)=\"openedChange($event)\" (focusin)=\"onFocusIn()\">\r\n <mat-select-trigger>\r\n @if (!customTriggerLabelFn) {\r\n {{simpleTriggerLabelFn(checklistSelection.selected)}}\r\n }\r\n @else{\r\n {{customTriggerLabelFn}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled) {\r\n <mat-option>\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"true\"\r\n [toggleAllCheckboxIndeterminate]=\"isIndeterminate\" [toggleAllCheckboxChecked]=\"isChecked\"\r\n [showToggleAllCheckbox]=\"showToggleAllCheckbox&&multiple\" (toggleAll)=\"toggleSelectAll($event)\">\r\n </cmat-select-search>\r\n </mat-option>\r\n }\r\n @for (selectData of matSelectData | async ; track $index) {\r\n <mat-option class=\"hidden\" [value]=\"selectData\">{{selectData.name}}</mat-option>\r\n }\r\n <mat-tree #componentTree [dataSource]=\"treeDataSource\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoLeafItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton disabled>\r\n\r\n </button>\r\n <mat-checkbox class=\"checklist-leaf-node text-current\" [color]=\"'primary'\"\r\n [checked]=\"getChecklistSelectionIsSelected(node)\">{{node.name}}</mat-checkbox>\r\n\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle [attr.aria-label]=\"'toggle ' + node.name\">\r\n <mat-icon class=\"mat-icon-rtl-mirror\"\r\n [svgIcon]=\"componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'\">\r\n </mat-icon>\r\n </button>\r\n\r\n <mat-checkbox class=\"text-current\" [checked]=\"descendantsAllSelected(nestedNodeMap.get(node)!)\"\r\n [color]=\"'primary'\"\r\n [indeterminate]=\"descendantsPartiallySelected(nestedNodeMap.get(node)!)\">{{node.name}}</mat-checkbox>\r\n\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n</mat-select>\r\n}\r\n@else {\r\n<mat-select #componentSelect [placeholder]=\"placeholder\"\r\n [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\" (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if (!customTriggerLabelFn) {\r\n {{simpleTriggerLabelFn(checklistSelection.selected)}}\r\n }\r\n @else{\r\n {{customTriggerLabelFn}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled) {\r\n <mat-option>\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"true\"\r\n [toggleAllCheckboxIndeterminate]=\"isIndeterminate\" [toggleAllCheckboxChecked]=\"isChecked\"\r\n [showToggleAllCheckbox]=\"false\" (toggleAll)=\"toggleSelectAll($event)\">\r\n </cmat-select-search>\r\n </mat-option>\r\n }\r\n @if (canNull&&treeDataSource.length!==0) {\r\n <mat-option class=\"pl-10\" (click)=\"clearSelection()\">\u7A7A</mat-option>\r\n }\r\n @for (selectData of matSelectData | async ; track $index) {\r\n <mat-option class=\"hidden\" [value]=\"selectData\">{{selectData.name}}</mat-option>\r\n }\r\n\r\n <mat-tree #componentTree [dataSource]=\"treeDataSource\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoLeafItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton disabled>\r\n\r\n </button>\r\n <span class=\"text-current\">{{node.name}}</span>\r\n\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle [attr.aria-label]=\"'toggle ' + node.name\">\r\n <mat-icon class=\"mat-icon-rtl-mirror\"\r\n [svgIcon]=\"componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'\">\r\n </mat-icon>\r\n </button>\r\n <span class=\"text-current\">{{node.name}}</span>\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n</mat-select>\r\n}", styles: ["cmat-select-tree{display:block;width:100%;z-index:101}cmat-select-tree.hidden{display:none}cmat-select-tree .cmat-select-search-inner{overflow:hidden;position:fixed;line-height:45px;display:flex;flex-direction:row}cmat-select-tree .cmat-select-search-inner span{display:flex;place-items:center}cmat-select-tree .cmat-select-search-no-entries-found{width:100%;text-align:center;border-radius:.25rem;box-shadow:0 2px 8px #00000059}cmat-select-tree .cmat-select-search-input{padding-top:0;padding-bottom:0;height:47px!important;line-height:47px!important}cmat-select-tree .cmat-select-search-clear{top:3px;margin:0 10px}cmat-select-tree .cmat-select-search-icon{margin-right:0;margin-left:10px}cmat-select-tree .mat-mdc-option-pseudo-checkbox{display:none}cmat-select-tree .mat-tree-node{cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: 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: "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: ReactiveFormsModule }, { 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: MatTreeModule }, { kind: "directive", type: i4.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i4.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i4.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i4.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i4.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i6.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: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
580
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatSelectTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
581
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CmatSelectTreeComponent, isStandalone: true, selector: "cmat-select-tree", inputs: { id: "id", dataSource: "dataSource", noEntriesFoundLabel: "noEntriesFoundLabel", showNoFoundLabel: "showNoFoundLabel", multiple: "multiple", overallSearchEnabled: "overallSearchEnabled", canNull: "canNull", customTriggerLabelFn: "customTriggerLabelFn", customTriggerLabelTemplate: "customTriggerLabelTemplate", expandable: "expandable", showToggleAllCheckbox: "showToggleAllCheckbox", compareWith: "compareWith", placeholder: "placeholder", value: "value", required: "required", disabled: "disabled" }, host: { listeners: { "document:click": "clickedOut()" }, properties: { "attr.id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: CmatSelectTreeComponent }], viewQueries: [{ propertyName: "tree", first: true, predicate: ["componentTree"], descendants: true }, { propertyName: "matSelect", first: true, predicate: ["componentSelect"], descendants: true }], exportAs: ["cmatSelectTree"], usesOnChanges: true, ngImport: i0, template: "@if(multiple){\r\n<mat-select #componentSelect multiple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith\" (openedChange)=\"openedChange($event)\" (focusin)=\"onFocusIn()\">\r\n <mat-select-trigger>\r\n @if (!customTriggerLabelFn) {\r\n {{ simpleTriggerLabelFn(checklistSelection.selected) }}\r\n } @else {\r\n {{ customTriggerLabelFn(checklistSelection.selected) }}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled) {\r\n <mat-option>\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"true\"\r\n [toggleAllCheckboxIndeterminate]=\"isIndeterminate\" [toggleAllCheckboxChecked]=\"isChecked\"\r\n [showToggleAllCheckbox]=\"showToggleAllCheckbox&&multiple\" (toggleAll)=\"toggleSelectAll($event)\">\r\n </cmat-select-search>\r\n </mat-option>\r\n }\r\n @for (selectData of matSelectData; track selectData.id) {\r\n <mat-option class=\"hidden\" [value]=\"selectData\">{{selectData.name}}</mat-option>\r\n }\r\n <mat-tree #componentTree [dataSource]=\"treeDataSource\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoLeafItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton disabled>\r\n\r\n </button>\r\n <mat-checkbox class=\"checklist-leaf-node text-current\" [color]=\"'primary'\"\r\n [checked]=\"getChecklistSelectionIsSelected(node)\">{{node.name}}</mat-checkbox>\r\n\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle [attr.aria-label]=\"'toggle ' + node.name\">\r\n <mat-icon class=\"mat-icon-rtl-mirror\"\r\n [svgIcon]=\"componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'\">\r\n </mat-icon>\r\n </button>\r\n\r\n <mat-checkbox class=\"text-current\" [checked]=\"descendantsAllSelected(nestedNodeMap.get(node)!)\"\r\n [color]=\"'primary'\"\r\n [indeterminate]=\"descendantsPartiallySelected(nestedNodeMap.get(node)!)\">{{node.name}}</mat-checkbox>\r\n\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n</mat-select>\r\n}\r\n@else {\r\n<mat-select #componentSelect [placeholder]=\"placeholder\"\r\n [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\" (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if (!customTriggerLabelFn) {\r\n {{ simpleTriggerLabelFn(checklistSelection.selected) }}\r\n } @else {\r\n {{ customTriggerLabelFn(checklistSelection.selected) }}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled) {\r\n <mat-option>\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"true\"\r\n [toggleAllCheckboxIndeterminate]=\"isIndeterminate\" [toggleAllCheckboxChecked]=\"isChecked\"\r\n [showToggleAllCheckbox]=\"false\" (toggleAll)=\"toggleSelectAll($event)\">\r\n </cmat-select-search>\r\n </mat-option>\r\n }\r\n @if (canNull&&treeDataSource.length!==0) {\r\n <mat-option class=\"pl-10\" (click)=\"clearSelection()\">\u7A7A</mat-option>\r\n }\r\n @for (selectData of matSelectData; track selectData.id) {\r\n <mat-option class=\"hidden\" [value]=\"selectData\">{{selectData.name}}</mat-option>\r\n }\r\n\r\n <mat-tree #componentTree [dataSource]=\"treeDataSource\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoLeafItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton disabled>\r\n\r\n </button>\r\n <span class=\"text-current\">{{node.name}}</span>\r\n\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle [attr.aria-label]=\"'toggle ' + node.name\">\r\n <mat-icon class=\"mat-icon-rtl-mirror\"\r\n [svgIcon]=\"componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'\">\r\n </mat-icon>\r\n </button>\r\n <span class=\"text-current\">{{node.name}}</span>\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n</mat-select>\r\n}\r\n", styles: ["cmat-select-tree{display:block;width:100%;z-index:101}cmat-select-tree.hidden{display:none}cmat-select-tree .cmat-select-search-inner{overflow:hidden;position:fixed;line-height:45px;display:flex;flex-direction:row}cmat-select-tree .cmat-select-search-inner span{display:flex;place-items:center}cmat-select-tree .cmat-select-search-no-entries-found{width:100%;text-align:center;border-radius:.25rem;box-shadow:0 2px 8px #00000059}cmat-select-tree .cmat-select-search-input{padding-top:0;padding-bottom:0;height:47px!important;line-height:47px!important}cmat-select-tree .cmat-select-search-clear{top:3px;margin:0 10px}cmat-select-tree .cmat-select-search-icon{margin-right:0;margin-left:10px}cmat-select-tree .mat-mdc-option-pseudo-checkbox{display:none}cmat-select-tree .mat-tree-node{cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: 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: "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: ReactiveFormsModule }, { 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: MatTreeModule }, { kind: "directive", type: i4.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i4.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i4.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i4.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i4.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i6.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
536
582
  }
537
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CmatSelectTreeComponent, decorators: [{
583
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CmatSelectTreeComponent, decorators: [{
538
584
  type: Component,
539
585
  args: [{ selector: 'cmat-select-tree', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [{ provide: MatFormFieldControl, useExisting: CmatSelectTreeComponent }], exportAs: 'cmatSelectTree', imports: [MatIconModule, MatSelectModule, CmatSelectSearchComponent,
540
- ReactiveFormsModule, MatTreeModule, NgClass, MatButtonModule, MatCheckboxModule, AsyncPipe], template: "@if(multiple){\r\n<mat-select #componentSelect multiple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith\" (openedChange)=\"openedChange($event)\" (focusin)=\"onFocusIn()\">\r\n <mat-select-trigger>\r\n @if (!customTriggerLabelFn) {\r\n {{simpleTriggerLabelFn(checklistSelection.selected)}}\r\n }\r\n @else{\r\n {{customTriggerLabelFn}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled) {\r\n <mat-option>\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"true\"\r\n [toggleAllCheckboxIndeterminate]=\"isIndeterminate\" [toggleAllCheckboxChecked]=\"isChecked\"\r\n [showToggleAllCheckbox]=\"showToggleAllCheckbox&&multiple\" (toggleAll)=\"toggleSelectAll($event)\">\r\n </cmat-select-search>\r\n </mat-option>\r\n }\r\n @for (selectData of matSelectData | async ; track $index) {\r\n <mat-option class=\"hidden\" [value]=\"selectData\">{{selectData.name}}</mat-option>\r\n }\r\n <mat-tree #componentTree [dataSource]=\"treeDataSource\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoLeafItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton disabled>\r\n\r\n </button>\r\n <mat-checkbox class=\"checklist-leaf-node text-current\" [color]=\"'primary'\"\r\n [checked]=\"getChecklistSelectionIsSelected(node)\">{{node.name}}</mat-checkbox>\r\n\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle [attr.aria-label]=\"'toggle ' + node.name\">\r\n <mat-icon class=\"mat-icon-rtl-mirror\"\r\n [svgIcon]=\"componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'\">\r\n </mat-icon>\r\n </button>\r\n\r\n <mat-checkbox class=\"text-current\" [checked]=\"descendantsAllSelected(nestedNodeMap.get(node)!)\"\r\n [color]=\"'primary'\"\r\n [indeterminate]=\"descendantsPartiallySelected(nestedNodeMap.get(node)!)\">{{node.name}}</mat-checkbox>\r\n\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n</mat-select>\r\n}\r\n@else {\r\n<mat-select #componentSelect [placeholder]=\"placeholder\"\r\n [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\" (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if (!customTriggerLabelFn) {\r\n {{simpleTriggerLabelFn(checklistSelection.selected)}}\r\n }\r\n @else{\r\n {{customTriggerLabelFn}}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled) {\r\n <mat-option>\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"true\"\r\n [toggleAllCheckboxIndeterminate]=\"isIndeterminate\" [toggleAllCheckboxChecked]=\"isChecked\"\r\n [showToggleAllCheckbox]=\"false\" (toggleAll)=\"toggleSelectAll($event)\">\r\n </cmat-select-search>\r\n </mat-option>\r\n }\r\n @if (canNull&&treeDataSource.length!==0) {\r\n <mat-option class=\"pl-10\" (click)=\"clearSelection()\">\u7A7A</mat-option>\r\n }\r\n @for (selectData of matSelectData | async ; track $index) {\r\n <mat-option class=\"hidden\" [value]=\"selectData\">{{selectData.name}}</mat-option>\r\n }\r\n\r\n <mat-tree #componentTree [dataSource]=\"treeDataSource\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoLeafItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton disabled>\r\n\r\n </button>\r\n <span class=\"text-current\">{{node.name}}</span>\r\n\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle [attr.aria-label]=\"'toggle ' + node.name\">\r\n <mat-icon class=\"mat-icon-rtl-mirror\"\r\n [svgIcon]=\"componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'\">\r\n </mat-icon>\r\n </button>\r\n <span class=\"text-current\">{{node.name}}</span>\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n</mat-select>\r\n}", styles: ["cmat-select-tree{display:block;width:100%;z-index:101}cmat-select-tree.hidden{display:none}cmat-select-tree .cmat-select-search-inner{overflow:hidden;position:fixed;line-height:45px;display:flex;flex-direction:row}cmat-select-tree .cmat-select-search-inner span{display:flex;place-items:center}cmat-select-tree .cmat-select-search-no-entries-found{width:100%;text-align:center;border-radius:.25rem;box-shadow:0 2px 8px #00000059}cmat-select-tree .cmat-select-search-input{padding-top:0;padding-bottom:0;height:47px!important;line-height:47px!important}cmat-select-tree .cmat-select-search-clear{top:3px;margin:0 10px}cmat-select-tree .cmat-select-search-icon{margin-right:0;margin-left:10px}cmat-select-tree .mat-mdc-option-pseudo-checkbox{display:none}cmat-select-tree .mat-tree-node{cursor:pointer}\n"] }]
586
+ ReactiveFormsModule, MatTreeModule, NgClass, MatButtonModule, MatCheckboxModule], template: "@if(multiple){\r\n<mat-select #componentSelect multiple [placeholder]=\"placeholder\" [required]=\"required\"\r\n [formControl]=\"selectControl\" [compareWith]=\"compareWith\" (openedChange)=\"openedChange($event)\" (focusin)=\"onFocusIn()\">\r\n <mat-select-trigger>\r\n @if (!customTriggerLabelFn) {\r\n {{ simpleTriggerLabelFn(checklistSelection.selected) }}\r\n } @else {\r\n {{ customTriggerLabelFn(checklistSelection.selected) }}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled) {\r\n <mat-option>\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"true\"\r\n [toggleAllCheckboxIndeterminate]=\"isIndeterminate\" [toggleAllCheckboxChecked]=\"isChecked\"\r\n [showToggleAllCheckbox]=\"showToggleAllCheckbox&&multiple\" (toggleAll)=\"toggleSelectAll($event)\">\r\n </cmat-select-search>\r\n </mat-option>\r\n }\r\n @for (selectData of matSelectData; track selectData.id) {\r\n <mat-option class=\"hidden\" [value]=\"selectData\">{{selectData.name}}</mat-option>\r\n }\r\n <mat-tree #componentTree [dataSource]=\"treeDataSource\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoLeafItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton disabled>\r\n\r\n </button>\r\n <mat-checkbox class=\"checklist-leaf-node text-current\" [color]=\"'primary'\"\r\n [checked]=\"getChecklistSelectionIsSelected(node)\">{{node.name}}</mat-checkbox>\r\n\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle [attr.aria-label]=\"'toggle ' + node.name\">\r\n <mat-icon class=\"mat-icon-rtl-mirror\"\r\n [svgIcon]=\"componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'\">\r\n </mat-icon>\r\n </button>\r\n\r\n <mat-checkbox class=\"text-current\" [checked]=\"descendantsAllSelected(nestedNodeMap.get(node)!)\"\r\n [color]=\"'primary'\"\r\n [indeterminate]=\"descendantsPartiallySelected(nestedNodeMap.get(node)!)\">{{node.name}}</mat-checkbox>\r\n\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n</mat-select>\r\n}\r\n@else {\r\n<mat-select #componentSelect [placeholder]=\"placeholder\"\r\n [required]=\"required\" [formControl]=\"selectControl\" [compareWith]=\"compareWith\" (focusin)=\"onFocusIn()\" (openedChange)=\"openedChange($event)\">\r\n <mat-select-trigger>\r\n @if (!customTriggerLabelFn) {\r\n {{ simpleTriggerLabelFn(checklistSelection.selected) }}\r\n } @else {\r\n {{ customTriggerLabelFn(checklistSelection.selected) }}\r\n }\r\n </mat-select-trigger>\r\n\r\n <div (focusout)=\"onFocusOut($event)\">\r\n @if (overallSearchEnabled) {\r\n <mat-option>\r\n <cmat-select-search [showNoFoundLabel]=\"showNoFoundLabel\" [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\r\n [formControl]=\"overallFilterControl\" [clearSearchInput]=\"true\"\r\n [toggleAllCheckboxIndeterminate]=\"isIndeterminate\" [toggleAllCheckboxChecked]=\"isChecked\"\r\n [showToggleAllCheckbox]=\"false\" (toggleAll)=\"toggleSelectAll($event)\">\r\n </cmat-select-search>\r\n </mat-option>\r\n }\r\n @if (canNull&&treeDataSource.length!==0) {\r\n <mat-option class=\"pl-10\" (click)=\"clearSelection()\">\u7A7A</mat-option>\r\n }\r\n @for (selectData of matSelectData; track selectData.id) {\r\n <mat-option class=\"hidden\" [value]=\"selectData\">{{selectData.name}}</mat-option>\r\n }\r\n\r\n <mat-tree #componentTree [dataSource]=\"treeDataSource\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoLeafItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton disabled>\r\n\r\n </button>\r\n <span class=\"text-current\">{{node.name}}</span>\r\n\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding\r\n [ngClass]=\"getChecklistSelectionIsSelected(node)?'selected':''\"\r\n (click)=\"todoItemSelectionToggle($event,nestedNodeMap.get(node)!)\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle [attr.aria-label]=\"'toggle ' + node.name\">\r\n <mat-icon class=\"mat-icon-rtl-mirror\"\r\n [svgIcon]=\"componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'\">\r\n </mat-icon>\r\n </button>\r\n <span class=\"text-current\">{{node.name}}</span>\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n</mat-select>\r\n}\r\n", styles: ["cmat-select-tree{display:block;width:100%;z-index:101}cmat-select-tree.hidden{display:none}cmat-select-tree .cmat-select-search-inner{overflow:hidden;position:fixed;line-height:45px;display:flex;flex-direction:row}cmat-select-tree .cmat-select-search-inner span{display:flex;place-items:center}cmat-select-tree .cmat-select-search-no-entries-found{width:100%;text-align:center;border-radius:.25rem;box-shadow:0 2px 8px #00000059}cmat-select-tree .cmat-select-search-input{padding-top:0;padding-bottom:0;height:47px!important;line-height:47px!important}cmat-select-tree .cmat-select-search-clear{top:3px;margin:0 10px}cmat-select-tree .cmat-select-search-icon{margin-right:0;margin-left:10px}cmat-select-tree .mat-mdc-option-pseudo-checkbox{display:none}cmat-select-tree .mat-tree-node{cursor:pointer}\n"] }]
541
587
  }], ctorParameters: () => [], propDecorators: { id: [{
542
588
  type: HostBinding,
543
589
  args: ['attr.id']