cmat 0.0.78 → 0.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/fesm2022/cmat-components-adapter.mjs +9 -46
  2. package/fesm2022/cmat-components-adapter.mjs.map +1 -1
  3. package/fesm2022/cmat-components-breadcrumb.mjs +104 -205
  4. package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
  5. package/fesm2022/cmat-components-card.mjs +4 -8
  6. package/fesm2022/cmat-components-card.mjs.map +1 -1
  7. package/fesm2022/cmat-components-carousel.mjs +21 -21
  8. package/fesm2022/cmat-components-carousel.mjs.map +1 -1
  9. package/fesm2022/cmat-components-cascade.mjs +18 -24
  10. package/fesm2022/cmat-components-cascade.mjs.map +1 -1
  11. package/fesm2022/cmat-components-chip-input.mjs +21 -21
  12. package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
  13. package/fesm2022/cmat-components-code-editor.mjs +4 -22
  14. package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
  15. package/fesm2022/cmat-components-custom-formly.mjs +181 -245
  16. package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
  17. package/fesm2022/cmat-components-date-range.mjs +12 -184
  18. package/fesm2022/cmat-components-date-range.mjs.map +1 -1
  19. package/fesm2022/cmat-components-date-time-display.mjs +3 -15
  20. package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
  21. package/fesm2022/cmat-components-drawer.mjs +10 -100
  22. package/fesm2022/cmat-components-drawer.mjs.map +1 -1
  23. package/fesm2022/cmat-components-empty-state.mjs +4 -25
  24. package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
  25. package/fesm2022/cmat-components-file-preview.mjs +3 -21
  26. package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
  27. package/fesm2022/cmat-components-filter-toolbar.mjs +7 -50
  28. package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
  29. package/fesm2022/cmat-components-form-actions.mjs +3 -9
  30. package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
  31. package/fesm2022/cmat-components-fullscreen.mjs +4 -4
  32. package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
  33. package/fesm2022/cmat-components-highlight.mjs +6 -32
  34. package/fesm2022/cmat-components-highlight.mjs.map +1 -1
  35. package/fesm2022/cmat-components-image-viewer.mjs +12 -24
  36. package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
  37. package/fesm2022/cmat-components-inline-loading.mjs +3 -12
  38. package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
  39. package/fesm2022/cmat-components-json-editor.mjs +11 -16
  40. package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
  41. package/fesm2022/cmat-components-knob-input.mjs +24 -18
  42. package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
  43. package/fesm2022/cmat-components-masonry.mjs +8 -17
  44. package/fesm2022/cmat-components-masonry.mjs.map +1 -1
  45. package/fesm2022/cmat-components-material-color-picker.mjs +13 -34
  46. package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
  47. package/fesm2022/cmat-components-material-datetimepicker.mjs +80 -436
  48. package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
  49. package/fesm2022/cmat-components-navigation.mjs +266 -816
  50. package/fesm2022/cmat-components-navigation.mjs.map +1 -1
  51. package/fesm2022/cmat-components-opt-input.mjs +7 -10
  52. package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
  53. package/fesm2022/cmat-components-org-chart.mjs +11 -11
  54. package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
  55. package/fesm2022/cmat-components-page-header.mjs +8 -19
  56. package/fesm2022/cmat-components-page-header.mjs.map +1 -1
  57. package/fesm2022/cmat-components-pagination.mjs +113 -108
  58. package/fesm2022/cmat-components-pagination.mjs.map +1 -1
  59. package/fesm2022/cmat-components-password-strength.mjs +13 -16
  60. package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
  61. package/fesm2022/cmat-components-popover.mjs +15 -151
  62. package/fesm2022/cmat-components-popover.mjs.map +1 -1
  63. package/fesm2022/cmat-components-progress-bar.mjs +16 -26
  64. package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
  65. package/fesm2022/cmat-components-qrcode.mjs +5 -11
  66. package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
  67. package/fesm2022/cmat-components-rating.mjs +14 -14
  68. package/fesm2022/cmat-components-rating.mjs.map +1 -1
  69. package/fesm2022/cmat-components-rich-text-editor.mjs +4 -25
  70. package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
  71. package/fesm2022/cmat-components-select-search.mjs +51 -79
  72. package/fesm2022/cmat-components-select-search.mjs.map +1 -1
  73. package/fesm2022/cmat-components-select-table.mjs +204 -162
  74. package/fesm2022/cmat-components-select-table.mjs.map +1 -1
  75. package/fesm2022/cmat-components-select-tree.mjs +142 -97
  76. package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
  77. package/fesm2022/cmat-components-skeleton.mjs +4 -22
  78. package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
  79. package/fesm2022/cmat-components-speed-dial.mjs +14 -19
  80. package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
  81. package/fesm2022/cmat-components-status-tag.mjs +3 -18
  82. package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
  83. package/fesm2022/cmat-components-table-toolbar.mjs +3 -15
  84. package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
  85. package/fesm2022/cmat-components-timeline.mjs +18 -21
  86. package/fesm2022/cmat-components-timeline.mjs.map +1 -1
  87. package/fesm2022/cmat-components-toast.mjs +20 -20
  88. package/fesm2022/cmat-components-toast.mjs.map +1 -1
  89. package/fesm2022/cmat-components-transfer-picker.mjs +159 -123
  90. package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
  91. package/fesm2022/cmat-components-treetable.mjs +17 -19
  92. package/fesm2022/cmat-components-treetable.mjs.map +1 -1
  93. package/fesm2022/cmat-components-upload.mjs +35 -57
  94. package/fesm2022/cmat-components-upload.mjs.map +1 -1
  95. package/fesm2022/cmat-components-x6-angular-shape.mjs +0 -4
  96. package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
  97. package/fesm2022/cmat-directives-animate-on-scroll.mjs +6 -27
  98. package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
  99. package/fesm2022/cmat-directives-arrow-cursor.mjs +7 -9
  100. package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
  101. package/fesm2022/cmat-directives-autofocus.mjs +3 -3
  102. package/fesm2022/cmat-directives-data-exporter.mjs +24 -33
  103. package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
  104. package/fesm2022/cmat-directives-debounce.mjs +14 -17
  105. package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
  106. package/fesm2022/cmat-directives-digit-only.mjs +6 -23
  107. package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
  108. package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
  109. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +4 -11
  110. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
  111. package/fesm2022/cmat-lib-mock-api.mjs +6 -43
  112. package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
  113. package/fesm2022/cmat-pipes-bytes.mjs +3 -3
  114. package/fesm2022/cmat-pipes-date-format.mjs +3 -3
  115. package/fesm2022/cmat-pipes-find-by-key.mjs +3 -5
  116. package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
  117. package/fesm2022/cmat-pipes-group-by.mjs +3 -3
  118. package/fesm2022/cmat-pipes-keys.mjs +3 -3
  119. package/fesm2022/cmat-pipes-secure.mjs +8 -12
  120. package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
  121. package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
  122. package/fesm2022/cmat-services-alert.mjs +3 -3
  123. package/fesm2022/cmat-services-config.mjs +50 -26
  124. package/fesm2022/cmat-services-config.mjs.map +1 -1
  125. package/fesm2022/cmat-services-confirmation.mjs +9 -11
  126. package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
  127. package/fesm2022/cmat-services-data.mjs +56 -101
  128. package/fesm2022/cmat-services-data.mjs.map +1 -1
  129. package/fesm2022/cmat-services-export-as.mjs +4 -32
  130. package/fesm2022/cmat-services-export-as.mjs.map +1 -1
  131. package/fesm2022/cmat-services-loading.mjs +49 -40
  132. package/fesm2022/cmat-services-loading.mjs.map +1 -1
  133. package/fesm2022/cmat-services-local-storage.mjs +3 -3
  134. package/fesm2022/cmat-services-media-watcher.mjs +19 -25
  135. package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
  136. package/fesm2022/cmat-services-platform.mjs +3 -10
  137. package/fesm2022/cmat-services-platform.mjs.map +1 -1
  138. package/fesm2022/cmat-services-splash-screen.mjs +8 -13
  139. package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
  140. package/fesm2022/cmat-services-title.mjs +8 -12
  141. package/fesm2022/cmat-services-title.mjs.map +1 -1
  142. package/fesm2022/cmat-services-translation.mjs +3 -3
  143. package/fesm2022/cmat-services-utils.mjs +5 -27
  144. package/fesm2022/cmat-services-utils.mjs.map +1 -1
  145. package/fesm2022/cmat-validators.mjs +0 -8
  146. package/fesm2022/cmat-validators.mjs.map +1 -1
  147. package/fesm2022/cmat.mjs +3477 -3795
  148. package/fesm2022/cmat.mjs.map +1 -1
  149. package/package.json +1 -1
  150. package/tailwind/plugins/helpers.js +1 -10
  151. package/tailwind/plugins/scrollbar/index.js +0 -1
  152. package/tailwind/plugins/scrollbar/typedefs.js +1 -7
  153. package/tailwind/plugins/scrollbar/utilities.js +9 -58
  154. package/tailwind/plugins/scrollbar/variants.js +2 -17
  155. package/tailwind/plugins/theming.js +1 -57
  156. package/tailwind/utils/generate-contrasts.js +1 -12
  157. package/tailwind/utils/generate-palette.js +1 -32
  158. package/types/cmat-components-adapter.d.ts +0 -25
  159. package/types/cmat-components-breadcrumb.d.ts +25 -175
  160. package/types/cmat-components-carousel.d.ts +2 -20
  161. package/types/cmat-components-cascade.d.ts +4 -4
  162. package/types/cmat-components-chip-input.d.ts +4 -3
  163. package/types/cmat-components-code-editor.d.ts +0 -18
  164. package/types/cmat-components-custom-formly.d.ts +30 -37
  165. package/types/cmat-components-date-range.d.ts +1 -72
  166. package/types/cmat-components-date-time-display.d.ts +0 -15
  167. package/types/cmat-components-drawer.d.ts +2 -44
  168. package/types/cmat-components-empty-state.d.ts +0 -21
  169. package/types/cmat-components-file-preview.d.ts +0 -18
  170. package/types/cmat-components-filter-toolbar.d.ts +3 -43
  171. package/types/cmat-components-form-actions.d.ts +0 -6
  172. package/types/cmat-components-image-viewer.d.ts +5 -18
  173. package/types/cmat-components-inline-loading.d.ts +0 -9
  174. package/types/cmat-components-json-editor.d.ts +0 -1
  175. package/types/cmat-components-knob-input.d.ts +3 -3
  176. package/types/cmat-components-masonry.d.ts +1 -2
  177. package/types/cmat-components-material-color-picker.d.ts +1 -2
  178. package/types/cmat-components-material-datetimepicker.d.ts +6 -272
  179. package/types/cmat-components-navigation.d.ts +34 -171
  180. package/types/cmat-components-opt-input.d.ts +1 -1
  181. package/types/cmat-components-page-header.d.ts +2 -16
  182. package/types/cmat-components-pagination.d.ts +26 -27
  183. package/types/cmat-components-password-strength.d.ts +1 -2
  184. package/types/cmat-components-popover.d.ts +1 -110
  185. package/types/cmat-components-progress-bar.d.ts +9 -11
  186. package/types/cmat-components-rating.d.ts +6 -7
  187. package/types/cmat-components-rich-text-editor.d.ts +0 -21
  188. package/types/cmat-components-select-search.d.ts +4 -20
  189. package/types/cmat-components-select-table.d.ts +24 -12
  190. package/types/cmat-components-select-tree.d.ts +29 -29
  191. package/types/cmat-components-skeleton.d.ts +0 -18
  192. package/types/cmat-components-speed-dial.d.ts +1 -2
  193. package/types/cmat-components-status-tag.d.ts +0 -15
  194. package/types/cmat-components-table-toolbar.d.ts +0 -12
  195. package/types/cmat-components-timeline.d.ts +3 -4
  196. package/types/cmat-components-toast.d.ts +2 -2
  197. package/types/cmat-components-transfer-picker.d.ts +42 -36
  198. package/types/cmat-components-treetable.d.ts +3 -4
  199. package/types/cmat-components-upload.d.ts +12 -17
  200. package/types/cmat-components-x6-angular-shape.d.ts +0 -1
  201. package/types/cmat-directives-arrow-cursor.d.ts +1 -1
  202. package/types/cmat-directives-debounce.d.ts +3 -4
  203. package/types/cmat-pipes-secure.d.ts +3 -4
  204. package/types/cmat-services-config.d.ts +35 -13
  205. package/types/cmat-services-data.d.ts +13 -12
  206. package/types/cmat-services-export-as.d.ts +0 -22
  207. package/types/cmat-services-loading.d.ts +15 -10
  208. package/types/cmat-services-media-watcher.d.ts +10 -13
  209. package/types/cmat-services-splash-screen.d.ts +2 -4
  210. package/types/cmat-services-title.d.ts +3 -5
  211. package/types/cmat.d.ts +733 -1391
@@ -1,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 { signal, inject, 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,23 @@ 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);
47
+ this.treeDataSource = signal([], ...(ngDevMode ? [{ debugName: "treeDataSource" }] : /* istanbul ignore next */ []));
48
+ this.dataFlatNodes = signal([], ...(ngDevMode ? [{ debugName: "dataFlatNodes" }] : /* istanbul ignore next */ []));
45
49
  this.overallFilterControl = new FormControl();
46
- this.isIndeterminate = false;
47
- this.isChecked = false;
48
- this.checkCount = 0;
50
+ this.isIndeterminate = signal(false, ...(ngDevMode ? [{ debugName: "isIndeterminate" }] : /* istanbul ignore next */ []));
51
+ this.isChecked = signal(false, ...(ngDevMode ? [{ debugName: "isChecked" }] : /* istanbul ignore next */ []));
52
+ this.checkCount = signal(0, ...(ngDevMode ? [{ debugName: "checkCount" }] : /* istanbul ignore next */ []));
49
53
  this.selectControl = new FormControl();
50
- this.matSelectData = new ReplaySubject(1);
54
+ this.matSelectData = signal([], ...(ngDevMode ? [{ debugName: "matSelectData" }] : /* istanbul ignore next */ []));
51
55
  this.stateChanges = new Subject();
52
56
  this.focused = false;
53
57
  this.touched = false;
54
58
  this.ngControl = inject(NgControl, { optional: true, self: true });
55
- this._changeDetectorRef = inject(ChangeDetectorRef);
56
- this._unsubscribeAll = new Subject();
59
+ this._destroyRef = inject(DestroyRef);
57
60
  this.getLevel = (dataNode) => dataNode.level;
58
61
  this.childrenAccessor = (node) => node.children ?? [];
59
62
  this.hasChild = (_, node) => !!node.children && node.children.length > 0;
@@ -64,7 +67,8 @@ class CmatSelectTreeComponent {
64
67
  this._onModelChange = () => { };
65
68
  // eslint-disable-next-line @typescript-eslint/no-empty-function
66
69
  this._onTouchedChange = () => { };
67
- this._transformer = (node, level) => {
70
+ this._transformer = (node, level, parent = null) => {
71
+ // 构建平铺节点并缓存映射关系
68
72
  const existingNode = this.nestedNodeMap.get(node);
69
73
  const flatNode = existingNode?.name === node.name
70
74
  ? existingNode
@@ -75,6 +79,8 @@ class CmatSelectTreeComponent {
75
79
  flatNode.expandable = !!node.children && node.children.length > 0;
76
80
  this.flatNodeMap.set(flatNode, node);
77
81
  this.nestedNodeMap.set(node, flatNode);
82
+ this._flatNodeById.set(flatNode.id, flatNode);
83
+ this._parentFlatNodeById.set(flatNode.id, parent);
78
84
  return flatNode;
79
85
  };
80
86
  if (this.ngControl != null) {
@@ -96,16 +102,22 @@ class CmatSelectTreeComponent {
96
102
  }
97
103
  }
98
104
  ngOnChanges(changes) {
105
+ // 数据源变化时,重建节点索引和缓存
99
106
  if (changes['dataSource']) {
100
- this.treeDataSource = this.dataSource;
101
- this.dataFlatNodes = this._getFlattenNodes(this.dataSource);
102
- this.matSelectData.next(this.dataFlatNodes);
107
+ this.flatNodeMap.clear();
108
+ this.nestedNodeMap.clear();
109
+ this._flatNodeById.clear();
110
+ this._parentFlatNodeById.clear();
111
+ this.treeDataSource.set(this.dataSource);
112
+ this.dataFlatNodes.set(this._getFlattenNodes(this.dataSource));
113
+ this.matSelectData.set([...this.dataFlatNodes()]);
103
114
  if (this.dataSource.length > 0) {
104
115
  this._init(this.value);
105
116
  }
106
117
  }
107
118
  }
108
119
  ngAfterViewInit() {
120
+ // 初始化下拉面板样式,并监听筛选输入变化
109
121
  let panelClass = ['overflow-y-auto', 'scrollbar-custom'];
110
122
  if (this._matSelect.panelClass) {
111
123
  if (Array.isArray(this._matSelect.panelClass)) {
@@ -115,39 +127,38 @@ class CmatSelectTreeComponent {
115
127
  this._matSelect.panelClass = [this._matSelect.panelClass, ...panelClass];
116
128
  }
117
129
  else if (typeof this._matSelect.panelClass === 'object') {
130
+ const panelClassEntries = this._matSelect.panelClass;
118
131
  panelClass.forEach((i) => {
119
- this._matSelect.panelClass.entries[i] = true;
132
+ panelClassEntries[i] = true;
120
133
  });
121
134
  }
122
135
  }
123
136
  else {
124
137
  this._matSelect.panelClass = panelClass;
125
138
  }
126
- merge(this.overallFilterControl.valueChanges)
127
- .pipe(takeUntil(this._unsubscribeAll), debounceTime(200))
139
+ this.overallFilterControl.valueChanges
140
+ .pipe(takeUntilDestroyed(this._destroyRef), debounceTime(200))
128
141
  .subscribe(() => {
129
- const dataClone = JSON.parse(JSON.stringify([...this.dataSource]));
142
+ const filterValue = `${this.overallFilterControl.value ?? ''}`.toLowerCase();
143
+ const dataClone = this._cloneTreeNodes(this.dataSource);
130
144
  const arr = [];
131
145
  for (let i = dataClone.length - 1; i >= 0; i--) {
132
- if (!this._applyColumnLevelFilters(dataClone[i], this.overallFilterControl.value.toLowerCase())) {
146
+ if (!this._applyColumnLevelFilters(dataClone[i], filterValue)) {
133
147
  arr.push(i);
134
148
  }
135
149
  }
136
150
  arr.forEach((v) => { dataClone.splice(v, 1); });
137
- this.treeDataSource = dataClone;
138
- this.dataFlatNodes = this._getFlattenNodes(dataClone);
139
- this.matSelectData.next(this.dataFlatNodes);
151
+ this.treeDataSource.set(dataClone);
152
+ this.dataFlatNodes.set(this._getFlattenNodes(dataClone));
153
+ this.matSelectData.set([...this.dataFlatNodes()]);
140
154
  if (this.expandable) {
141
155
  this.tree.expandAll();
142
156
  }
143
157
  this._updateSelect(this.checklistSelection.selected);
144
- this._changeDetectorRef.detectChanges();
145
158
  });
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,86 +309,91 @@ 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
- this.isChecked = false;
345
- this.isIndeterminate = false;
346
- this.checkCount = 0;
365
+ this.isChecked.set(false);
366
+ this.isIndeterminate.set(false);
367
+ this.checkCount.set(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
- });
356
- this.isIndeterminate = false;
357
- this.isChecked = true;
358
- this.checkCount = this.checklistSelection.selected.length;
376
+ this.checklistSelection.select(...this.dataFlatNodes());
377
+ this.isIndeterminate.set(false);
378
+ this.isChecked.set(true);
379
+ this._syncSelectedFlatNodeIds();
359
380
  }
360
381
  else {
361
382
  this.checklistSelection.clear();
362
- this.isChecked = false;
363
- this.isIndeterminate = false;
364
- this.checkCount = 0;
383
+ this.isChecked.set(false);
384
+ this.isIndeterminate.set(false);
385
+ this.checkCount.set(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) {
371
- if (this.dataSource.length > 0 && this.treeDataSource && this._matSelect) {
395
+ // 初始化内部值和选中状态
396
+ if (this.dataSource.length > 0 && this.treeDataSource().length > 0 && this._matSelect) {
372
397
  if (this.expandable) {
373
398
  this.tree.expandAll();
374
399
  }
@@ -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,29 +415,25 @@ 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);
407
429
  this._updateCheckState();
408
- this._changeDetectorRef.markForCheck();
409
430
  }
410
431
  else {
411
432
  this.value = v;
412
433
  }
413
434
  }
414
- /* Checks all the parents when a leaf node is selected/unselected */
415
435
  _checkAllParentsSelection(node) {
436
+ // 级联更新父节点的选中状态
416
437
  let parent = this._getParentNode(node);
417
438
  while (parent) {
418
439
  parent.expandable = true;
@@ -421,60 +442,49 @@ class CmatSelectTreeComponent {
421
442
  parent = this._getParentNode(parent);
422
443
  }
423
444
  }
424
- /** Check root node checked state and change it accordingly */
425
445
  _checkRootNodeSelection(node) {
446
+ // 根据子节点状态同步父节点选中状态
426
447
  const nodeSelected = this.checklistSelection.isSelected(node);
427
448
  const descendants = this._getDescendants(node);
428
449
  const descAllSelected = descendants.every(child => this.checklistSelection.isSelected(child));
429
450
  if (nodeSelected && !descAllSelected) {
430
451
  this.checklistSelection.deselect(node);
431
- this.checkCount -= 1;
432
452
  }
433
453
  else if (!nodeSelected && (descAllSelected || descendants.length === 0)) {
434
454
  this.checklistSelection.select(node);
435
- this.checkCount += 1;
436
455
  }
456
+ this._updateCheckState();
437
457
  }
438
- /* Get the parent node of a node */
439
458
  _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;
459
+ // 通过缓存获取父节点
460
+ return this._parentFlatNodeById.get(node.id) ?? null;
452
461
  }
453
462
  _updateChecklistSelection(value) {
463
+ // 根据外部值同步内部选择状态
454
464
  this.checklistSelection.clear();
455
465
  if (!isNil(value)) {
456
466
  const valueArray = !Array.isArray(value) ? [value] : value;
457
467
  valueArray.forEach((item) => {
458
- const nodeFound = this.dataFlatNodes.find(node => node.id === item.id);
468
+ const nodeFound = this._flatNodeById.get(item.id);
459
469
  if (isNil(nodeFound)) {
460
470
  return;
461
471
  }
462
472
  this.checklistSelection.select(nodeFound);
463
473
  });
474
+ this._syncSelectedFlatNodeIds();
464
475
  }
465
476
  }
466
477
  _updateSelect(value) {
478
+ // 根据当前值同步显示选择
467
479
  if (!isNil(value)) {
468
480
  const valueArray = !Array.isArray(value) ? [value] : value;
469
- this.checkCount = 0;
470
- if (this.overallSearchEnabled) //有搜索功能,转化选中节点为当前数据源节点
481
+ if (this.overallSearchEnabled) // 有搜索功能时,将选中节点转换为当前数据源节点
471
482
  {
472
483
  valueArray.forEach((item) => {
473
- const nodeFound = this.dataFlatNodes.find(node => node.id === item.id);
484
+ const nodeFound = this._flatNodeById.get(item.id);
474
485
  if (isNil(nodeFound)) {
475
486
  return;
476
487
  }
477
- this.checkCount += 1;
478
488
  this.checklistSelection.deselect(item);
479
489
  this.checklistSelection.select(nodeFound);
480
490
  });
@@ -484,10 +494,12 @@ class CmatSelectTreeComponent {
484
494
  this._checkAllParentsSelection(item);
485
495
  });
486
496
  }
497
+ this._syncSelectedFlatNodeIds();
487
498
  this._updateCheckState();
488
499
  }
489
500
  }
490
501
  _applyColumnLevelFilters(node, filter) {
502
+ // 递归过滤节点及其子节点
491
503
  let result = false;
492
504
  if (node?.children && node.children.length > 0) {
493
505
  for (let i = node.children.length - 1; i >= 0; i--) {
@@ -501,43 +513,76 @@ class CmatSelectTreeComponent {
501
513
  if (node?.children?.length === 0) {
502
514
  node.children = null;
503
515
  }
504
- const cellValue = node['name'].toLowerCase();
516
+ const cellValue = node.name.toLowerCase();
505
517
  if (cellValue.includes(filter)) {
506
518
  result = true;
507
519
  }
508
520
  return result;
509
521
  }
510
522
  _updateCheckState() {
523
+ // 更新全选与半选状态
511
524
  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;
525
+ const selectedCount = this._selectedFlatNodeIds.size;
526
+ this.checkCount.set(selectedCount);
527
+ this.isIndeterminate.set(selectedCount < this.dataFlatNodes().length && selectedCount > 0);
528
+ this.isChecked.set(selectedCount === this.dataFlatNodes().length && selectedCount > 0);
514
529
  }
515
530
  }
516
- _getFlattenNodes(nodes, i = 0) {
531
+ _getFlattenNodes(nodes, i = 0, parent = null) {
532
+ // 将树结构平铺为节点列表
517
533
  const flattenedNodes = [];
518
534
  for (const node of nodes) {
519
- flattenedNodes.push(this._transformer(node, i));
535
+ const flatNode = this._transformer(node, i, parent);
536
+ flattenedNodes.push(flatNode);
520
537
  if (node.children) {
521
- flattenedNodes.push(...this._getFlattenNodes(node.children, i + 1));
538
+ flattenedNodes.push(...this._getFlattenNodes(node.children, i + 1, flatNode));
522
539
  }
523
540
  }
524
541
  return flattenedNodes;
525
542
  }
543
+ _cloneTreeNodes(nodes) {
544
+ return nodes.map(node => ({
545
+ id: node.id,
546
+ name: node.name,
547
+ children: node.children ? this._cloneTreeNodes(node.children) : null
548
+ }));
549
+ }
550
+ _syncSelectedFlatNodeIds() {
551
+ // 同步选中节点 ID 缓存
552
+ this._selectedFlatNodeIds.clear();
553
+ this.checklistSelection.selected.forEach((node) => {
554
+ this._selectedFlatNodeIds.add(node.id);
555
+ });
556
+ this.checkCount.set(this._selectedFlatNodeIds.size);
557
+ }
526
558
  _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;
559
+ // 收集当前节点的所有后代
560
+ const node = this.flatNodeMap.get(dataNode);
561
+ if (!node?.children?.length) {
562
+ return [];
563
+ }
564
+ const descendants = [];
565
+ const collect = (children) => {
566
+ for (const child of children) {
567
+ const flatNode = this.nestedNodeMap.get(child);
568
+ if (flatNode) {
569
+ descendants.push(flatNode);
570
+ }
571
+ if (child.children?.length) {
572
+ collect(child.children);
573
+ }
574
+ }
575
+ };
576
+ collect(node.children);
577
+ return descendants;
533
578
  }
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 }); }
579
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
580
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", 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
581
  }
537
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CmatSelectTreeComponent, decorators: [{
582
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CmatSelectTreeComponent, decorators: [{
538
583
  type: Component,
539
584
  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"] }]
585
+ 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
586
  }], ctorParameters: () => [], propDecorators: { id: [{
542
587
  type: HostBinding,
543
588
  args: ['attr.id']