cmat 0.0.111 → 0.0.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/fesm2022/cmat-components-adapter.mjs +531 -536
  2. package/fesm2022/cmat-components-adapter.mjs.map +1 -1
  3. package/fesm2022/cmat-components-breadcrumb.mjs +521 -356
  4. package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
  5. package/fesm2022/cmat-components-card.mjs +150 -42
  6. package/fesm2022/cmat-components-card.mjs.map +1 -1
  7. package/fesm2022/cmat-components-carousel.mjs +1120 -629
  8. package/fesm2022/cmat-components-carousel.mjs.map +1 -1
  9. package/fesm2022/cmat-components-cascade.mjs +861 -441
  10. package/fesm2022/cmat-components-cascade.mjs.map +1 -1
  11. package/fesm2022/cmat-components-chip-input.mjs +580 -335
  12. package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
  13. package/fesm2022/cmat-components-code-editor.mjs +197 -105
  14. package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
  15. package/fesm2022/cmat-components-color-picker.mjs +1762 -825
  16. package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
  17. package/fesm2022/cmat-components-custom-formly.mjs +5196 -2531
  18. package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
  19. package/fesm2022/cmat-components-data-picker.mjs +1901 -1073
  20. package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
  21. package/fesm2022/cmat-components-date-range.mjs +701 -456
  22. package/fesm2022/cmat-components-date-range.mjs.map +1 -1
  23. package/fesm2022/cmat-components-date-time-display.mjs +137 -30
  24. package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
  25. package/fesm2022/cmat-components-drawer.mjs +410 -258
  26. package/fesm2022/cmat-components-drawer.mjs.map +1 -1
  27. package/fesm2022/cmat-components-empty-state.mjs +201 -41
  28. package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
  29. package/fesm2022/cmat-components-file-preview.mjs +198 -35
  30. package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
  31. package/fesm2022/cmat-components-filter-toolbar.mjs +320 -72
  32. package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
  33. package/fesm2022/cmat-components-form-actions.mjs +102 -26
  34. package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
  35. package/fesm2022/cmat-components-fullscreen.mjs +167 -47
  36. package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
  37. package/fesm2022/cmat-components-highlight.mjs +203 -112
  38. package/fesm2022/cmat-components-highlight.mjs.map +1 -1
  39. package/fesm2022/cmat-components-image-viewer.mjs +489 -215
  40. package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
  41. package/fesm2022/cmat-components-inline-loading.mjs +117 -27
  42. package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
  43. package/fesm2022/cmat-components-json-editor.mjs +276 -230
  44. package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
  45. package/fesm2022/cmat-components-knob-input.mjs +615 -420
  46. package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
  47. package/fesm2022/cmat-components-loading-overlay.mjs +53 -25
  48. package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
  49. package/fesm2022/cmat-components-masonry.mjs +120 -40
  50. package/fesm2022/cmat-components-masonry.mjs.map +1 -1
  51. package/fesm2022/cmat-components-material-color-picker.mjs +332 -155
  52. package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
  53. package/fesm2022/cmat-components-material-datetimepicker.mjs +4283 -2504
  54. package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
  55. package/fesm2022/cmat-components-navigation.mjs +3080 -1404
  56. package/fesm2022/cmat-components-navigation.mjs.map +1 -1
  57. package/fesm2022/cmat-components-opt-input.mjs +540 -466
  58. package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
  59. package/fesm2022/cmat-components-org-chart.mjs +528 -125
  60. package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
  61. package/fesm2022/cmat-components-page-header.mjs +141 -32
  62. package/fesm2022/cmat-components-page-header.mjs.map +1 -1
  63. package/fesm2022/cmat-components-pagination.mjs +866 -534
  64. package/fesm2022/cmat-components-pagination.mjs.map +1 -1
  65. package/fesm2022/cmat-components-password-strength.mjs +873 -434
  66. package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
  67. package/fesm2022/cmat-components-popover.mjs +1012 -731
  68. package/fesm2022/cmat-components-popover.mjs.map +1 -1
  69. package/fesm2022/cmat-components-progress-bar.mjs +98 -35
  70. package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
  71. package/fesm2022/cmat-components-qrcode.mjs +463 -287
  72. package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
  73. package/fesm2022/cmat-components-rating.mjs +377 -203
  74. package/fesm2022/cmat-components-rating.mjs.map +1 -1
  75. package/fesm2022/cmat-components-rich-text-editor.mjs +153 -39
  76. package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
  77. package/fesm2022/cmat-components-select-search.mjs +926 -496
  78. package/fesm2022/cmat-components-select-search.mjs.map +1 -1
  79. package/fesm2022/cmat-components-select-table.mjs +1280 -842
  80. package/fesm2022/cmat-components-select-table.mjs.map +1 -1
  81. package/fesm2022/cmat-components-select-tree.mjs +998 -690
  82. package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
  83. package/fesm2022/cmat-components-skeleton.mjs +143 -57
  84. package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
  85. package/fesm2022/cmat-components-speed-dial.mjs +457 -303
  86. package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
  87. package/fesm2022/cmat-components-status-tag.mjs +136 -44
  88. package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
  89. package/fesm2022/cmat-components-table-toolbar.mjs +120 -28
  90. package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
  91. package/fesm2022/cmat-components-timeline.mjs +464 -168
  92. package/fesm2022/cmat-components-timeline.mjs.map +1 -1
  93. package/fesm2022/cmat-components-toast.mjs +346 -262
  94. package/fesm2022/cmat-components-toast.mjs.map +1 -1
  95. package/fesm2022/cmat-components-transfer-picker.mjs +1427 -593
  96. package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
  97. package/fesm2022/cmat-components-treetable.mjs +372 -112
  98. package/fesm2022/cmat-components-treetable.mjs.map +1 -1
  99. package/fesm2022/cmat-components-upload.mjs +904 -410
  100. package/fesm2022/cmat-components-upload.mjs.map +1 -1
  101. package/fesm2022/cmat-components-x6-angular-shape.mjs +153 -170
  102. package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
  103. package/fesm2022/cmat-directives-animate-on-scroll.mjs +220 -138
  104. package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
  105. package/fesm2022/cmat-directives-arrow-cursor.mjs +246 -193
  106. package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
  107. package/fesm2022/cmat-directives-autofocus.mjs +43 -25
  108. package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
  109. package/fesm2022/cmat-directives-data-exporter.mjs +537 -338
  110. package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
  111. package/fesm2022/cmat-directives-debounce.mjs +162 -76
  112. package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
  113. package/fesm2022/cmat-directives-digit-only.mjs +457 -356
  114. package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
  115. package/fesm2022/cmat-directives-equal-validator.mjs +70 -53
  116. package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
  117. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +180 -132
  118. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
  119. package/fesm2022/cmat-lib-mock-api.mjs +207 -195
  120. package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
  121. package/fesm2022/cmat-pipes-bytes.mjs +50 -30
  122. package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
  123. package/fesm2022/cmat-pipes-date-format.mjs +41 -25
  124. package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
  125. package/fesm2022/cmat-pipes-find-by-key.mjs +44 -26
  126. package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
  127. package/fesm2022/cmat-pipes-group-by.mjs +50 -38
  128. package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
  129. package/fesm2022/cmat-pipes-keys.mjs +44 -31
  130. package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
  131. package/fesm2022/cmat-pipes-secure.mjs +60 -49
  132. package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
  133. package/fesm2022/cmat-pipes-uppercase.mjs +39 -22
  134. package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
  135. package/fesm2022/cmat-reports.mjs +2751 -0
  136. package/fesm2022/cmat-reports.mjs.map +1 -0
  137. package/fesm2022/cmat-services-alert.mjs +249 -277
  138. package/fesm2022/cmat-services-alert.mjs.map +1 -1
  139. package/fesm2022/cmat-services-config.mjs +110 -81
  140. package/fesm2022/cmat-services-config.mjs.map +1 -1
  141. package/fesm2022/cmat-services-confirmation.mjs +184 -73
  142. package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
  143. package/fesm2022/cmat-services-data.mjs +136 -125
  144. package/fesm2022/cmat-services-data.mjs.map +1 -1
  145. package/fesm2022/cmat-services-export-as.mjs +165 -183
  146. package/fesm2022/cmat-services-export-as.mjs.map +1 -1
  147. package/fesm2022/cmat-services-loading.mjs +116 -95
  148. package/fesm2022/cmat-services-loading.mjs.map +1 -1
  149. package/fesm2022/cmat-services-local-storage.mjs +75 -66
  150. package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
  151. package/fesm2022/cmat-services-media-watcher.mjs +69 -64
  152. package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
  153. package/fesm2022/cmat-services-platform.mjs +48 -45
  154. package/fesm2022/cmat-services-platform.mjs.map +1 -1
  155. package/fesm2022/cmat-services-print.mjs +984 -1109
  156. package/fesm2022/cmat-services-print.mjs.map +1 -1
  157. package/fesm2022/cmat-services-splash-screen.mjs +53 -38
  158. package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
  159. package/fesm2022/cmat-services-title.mjs +57 -47
  160. package/fesm2022/cmat-services-title.mjs.map +1 -1
  161. package/fesm2022/cmat-services-translation.mjs +79 -68
  162. package/fesm2022/cmat-services-translation.mjs.map +1 -1
  163. package/fesm2022/cmat-services-utils.mjs +424 -517
  164. package/fesm2022/cmat-services-utils.mjs.map +1 -1
  165. package/fesm2022/cmat-validators.mjs +23 -33
  166. package/fesm2022/cmat-validators.mjs.map +1 -1
  167. package/fesm2022/cmat-version.mjs +12 -16
  168. package/fesm2022/cmat-version.mjs.map +1 -1
  169. package/fesm2022/cmat.mjs +39805 -22511
  170. package/fesm2022/cmat.mjs.map +1 -1
  171. package/package.json +5 -1
  172. package/types/cmat-components-adapter.d.ts +145 -156
  173. package/types/cmat-components-breadcrumb.d.ts +108 -86
  174. package/types/cmat-components-card.d.ts +34 -18
  175. package/types/cmat-components-carousel.d.ts +251 -134
  176. package/types/cmat-components-cascade.d.ts +158 -117
  177. package/types/cmat-components-chip-input.d.ts +105 -71
  178. package/types/cmat-components-code-editor.d.ts +59 -34
  179. package/types/cmat-components-color-picker.d.ts +378 -236
  180. package/types/cmat-components-custom-formly.d.ts +776 -814
  181. package/types/cmat-components-data-picker.d.ts +502 -360
  182. package/types/cmat-components-date-range.d.ts +106 -77
  183. package/types/cmat-components-date-time-display.d.ts +36 -13
  184. package/types/cmat-components-drawer.d.ts +91 -61
  185. package/types/cmat-components-empty-state.d.ts +47 -17
  186. package/types/cmat-components-file-preview.d.ts +42 -14
  187. package/types/cmat-components-filter-toolbar.d.ts +57 -25
  188. package/types/cmat-components-form-actions.d.ts +18 -10
  189. package/types/cmat-components-fullscreen.d.ts +21 -13
  190. package/types/cmat-components-highlight.d.ts +33 -26
  191. package/types/cmat-components-image-viewer.d.ts +119 -58
  192. package/types/cmat-components-inline-loading.d.ts +24 -11
  193. package/types/cmat-components-json-editor.d.ts +39 -28
  194. package/types/cmat-components-knob-input.d.ts +172 -101
  195. package/types/cmat-components-loading-overlay.d.ts +8 -11
  196. package/types/cmat-components-masonry.d.ts +27 -14
  197. package/types/cmat-components-material-color-picker.d.ts +56 -42
  198. package/types/cmat-components-material-datetimepicker.d.ts +817 -454
  199. package/types/cmat-components-navigation.d.ts +295 -221
  200. package/types/cmat-components-opt-input.d.ts +111 -90
  201. package/types/cmat-components-org-chart.d.ts +53 -35
  202. package/types/cmat-components-page-header.d.ts +37 -14
  203. package/types/cmat-components-pagination.d.ts +144 -107
  204. package/types/cmat-components-password-strength.d.ts +197 -86
  205. package/types/cmat-components-popover.d.ts +264 -166
  206. package/types/cmat-components-progress-bar.d.ts +17 -14
  207. package/types/cmat-components-qrcode.d.ts +111 -42
  208. package/types/cmat-components-rating.d.ts +105 -59
  209. package/types/cmat-components-rich-text-editor.d.ts +39 -16
  210. package/types/cmat-components-select-search.d.ts +195 -99
  211. package/types/cmat-components-select-table.d.ts +241 -142
  212. package/types/cmat-components-select-tree.d.ts +185 -118
  213. package/types/cmat-components-skeleton.d.ts +55 -32
  214. package/types/cmat-components-speed-dial.d.ts +86 -61
  215. package/types/cmat-components-status-tag.d.ts +42 -24
  216. package/types/cmat-components-table-toolbar.d.ts +30 -12
  217. package/types/cmat-components-timeline.d.ts +83 -51
  218. package/types/cmat-components-toast.d.ts +84 -85
  219. package/types/cmat-components-transfer-picker.d.ts +228 -181
  220. package/types/cmat-components-treetable.d.ts +63 -39
  221. package/types/cmat-components-upload.d.ts +205 -106
  222. package/types/cmat-components-x6-angular-shape.d.ts +29 -37
  223. package/types/cmat-directives-animate-on-scroll.d.ts +48 -30
  224. package/types/cmat-directives-arrow-cursor.d.ts +55 -35
  225. package/types/cmat-directives-autofocus.d.ts +8 -11
  226. package/types/cmat-directives-data-exporter.d.ts +71 -40
  227. package/types/cmat-directives-debounce.d.ts +31 -28
  228. package/types/cmat-directives-digit-only.d.ts +90 -53
  229. package/types/cmat-directives-equal-validator.d.ts +11 -14
  230. package/types/cmat-directives-seamless-auto-scroll.d.ts +42 -29
  231. package/types/cmat-lib-mock-api.d.ts +46 -55
  232. package/types/cmat-pipes-bytes.d.ts +7 -10
  233. package/types/cmat-pipes-date-format.d.ts +7 -10
  234. package/types/cmat-pipes-find-by-key.d.ts +8 -12
  235. package/types/cmat-pipes-group-by.d.ts +11 -15
  236. package/types/cmat-pipes-keys.d.ts +10 -13
  237. package/types/cmat-pipes-secure.d.ts +14 -17
  238. package/types/cmat-pipes-uppercase.d.ts +7 -10
  239. package/types/cmat-reports.d.ts +1131 -0
  240. package/types/cmat-services-alert.d.ts +80 -87
  241. package/types/cmat-services-config.d.ts +37 -43
  242. package/types/cmat-services-confirmation.d.ts +31 -37
  243. package/types/cmat-services-data.d.ts +18 -21
  244. package/types/cmat-services-export-as.d.ts +28 -33
  245. package/types/cmat-services-loading.d.ts +27 -31
  246. package/types/cmat-services-local-storage.d.ts +17 -21
  247. package/types/cmat-services-media-watcher.d.ts +14 -18
  248. package/types/cmat-services-platform.d.ts +8 -11
  249. package/types/cmat-services-print.d.ts +97 -102
  250. package/types/cmat-services-splash-screen.d.ts +11 -14
  251. package/types/cmat-services-title.d.ts +9 -12
  252. package/types/cmat-services-translation.d.ts +19 -22
  253. package/types/cmat-services-utils.d.ts +76 -80
  254. package/types/cmat-validators.d.ts +5 -8
  255. package/types/cmat-version.d.ts +8 -10
  256. package/types/cmat.d.ts +7551 -5204
@@ -1,596 +1,1430 @@
1
- import * as i6 from '@angular/cdk/overlay';
2
- import { CdkOverlayOrigin, Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
3
- import * as i4 from '@angular/cdk/portal';
4
- import { PortalModule } from '@angular/cdk/portal';
5
- import * as i3 from '@angular/common';
6
- import { CommonModule } from '@angular/common';
7
- import * as i0 from '@angular/core';
8
- import { signal, Injectable, input, viewChild, inject, ChangeDetectionStrategy, ViewEncapsulation, Component, computed, effect, untracked, output, Injector, afterNextRender } from '@angular/core';
9
- import * as i5 from '@angular/material/button';
10
- import { MatButtonModule } from '@angular/material/button';
11
- import * as i1 from '@angular/material/button-toggle';
12
- import { MatButtonToggleModule } from '@angular/material/button-toggle';
13
- import * as i2 from '@angular/material/icon';
14
- import { MatIconModule } from '@angular/material/icon';
15
- import * as i3$1 from '@angular/forms';
16
- import { FormControl, ReactiveFormsModule } from '@angular/forms';
17
- import * as i1$1 from '@angular/material/form-field';
18
- import { MatFormFieldModule } from '@angular/material/form-field';
19
- import * as i5$1 from '@angular/material/input';
20
- import { MatInputModule } from '@angular/material/input';
21
- import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
22
- import { SelectionModel } from '@angular/cdk/collections';
23
- import { ScrollingModule } from '@angular/cdk/scrolling';
24
- import * as i1$2 from '@angular/material/card';
25
- import { MatCardModule } from '@angular/material/card';
26
- import * as i3$2 from '@angular/material/checkbox';
27
- import { MatCheckboxModule } from '@angular/material/checkbox';
28
- import * as i2$1 from '@angular/material/tree';
29
- import { MatTreeModule } from '@angular/material/tree';
30
- import { of } from 'rxjs';
31
- import * as i2$2 from '@angular/material/list';
32
- import { MatListModule } from '@angular/material/list';
33
-
34
- /* eslint-disable @typescript-eslint/member-ordering */
35
- class CmatTransferPickerService {
36
- constructor() {
37
- this._dataSourceChange = signal([], /* @ts-ignore */
38
- ...(ngDevMode ? [{ debugName: "_dataSourceChange" }] : /* istanbul ignore next */ []));
39
- this._refreshDataSourceChange = signal({ clear: true, nonce: 0 }, /* @ts-ignore */
40
- ...(ngDevMode ? [{ debugName: "_refreshDataSourceChange" }] : /* istanbul ignore next */ []));
41
- this._filtersChange = signal([], /* @ts-ignore */
42
- ...(ngDevMode ? [{ debugName: "_filtersChange" }] : /* istanbul ignore next */ []));
43
- this._sourceOptionsChange = signal(void 0, /* @ts-ignore */
44
- ...(ngDevMode ? [{ debugName: "_sourceOptionsChange" }] : /* istanbul ignore next */ []));
45
- this._selectedValuesChange = signal([], /* @ts-ignore */
46
- ...(ngDevMode ? [{ debugName: "_selectedValuesChange" }] : /* istanbul ignore next */ []));
47
- this._refreshNonce = 0;
48
- this.dataSourceChange = this._dataSourceChange.asReadonly();
49
- this.refreshDataSourceChange = this._refreshDataSourceChange.asReadonly();
50
- this.filtersChange = this._filtersChange.asReadonly();
51
- this.sourceOptionsChange = this._sourceOptionsChange.asReadonly();
52
- this.selectedValuesChange = this._selectedValuesChange.asReadonly();
53
- this._compareMap = new Map([
54
- ['0', (a, b) => a === b],
55
- ['1', (a, b) => a !== b],
56
- ['2', (a, b) => a > b],
57
- ['3', (a, b) => a < b],
58
- ['0,2', (a, b) => a >= b],
59
- ['0,3', (a, b) => a <= b]
60
- ]);
61
- this._conditionMap = new Map([
62
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
63
- ['or', arr => arr.reduce((o, item) => (o.result = o.result || item || o.prev, o.prev = item, o), {
64
- result: false,
65
- prev: arr[0]
66
- }).result],
67
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
68
- ['and', arr => arr.reduce((o, item) => (o.result = o.result && item && o.prev, o.prev = item, o), {
69
- result: true,
70
- prev: arr[0]
71
- }).result],
72
- ]);
73
- }
74
- get dataSource() {
75
- return this._dataSource;
76
- }
77
- set dataSource(data) {
78
- this._dataSource = data;
79
- if (!this._originalDataSource) {
80
- this._originalDataSource = JSON.parse(JSON.stringify(data));
81
- }
82
- this._dataSourceChange.set(data);
83
- }
84
- set sourceOptions(value) {
85
- this._sourceOptionsChange.set(value);
86
- }
87
- set selectedValues(value) {
88
- this._selectedValuesChange.set(value);
89
- }
90
- filterDataSource({ filterData, keyword }) {
91
- this._filterData = filterData ?? this._filterData;
92
- this._keyword = keyword === void (0) ? this._keyword : keyword;
93
- if (filterData?.filters.length) {
94
- this._filterDataSourceByType(this._keyword ? this._filteredDataSource : this._originalDataSource, 'Filters');
95
- return;
96
- }
97
- else if (filterData && !filterData.filters.length) {
98
- if (this._keyword) {
99
- this._filterDataSourceByType(this._originalDataSource, 'Keyword');
100
- }
101
- else {
102
- this.resetDataSource(false);
103
- }
104
- return;
105
- }
106
- if (keyword) {
107
- this._filterDataSourceByType(this._filterData?.filters.length ? this._filteredDataSource : this._originalDataSource, 'Keyword');
108
- return;
109
- }
110
- else if (!keyword) {
111
- if (this._filterData?.filters.length) {
112
- this._filterDataSourceByType(this._originalDataSource, 'Filters');
113
- }
114
- else {
115
- this.resetDataSource(false);
116
- }
117
- return;
118
- }
119
- }
120
- resetDataSource(clear) {
121
- this.dataSource = this._originalDataSource;
122
- this._filteredDataSource = [];
123
- this._refreshDataSourceChange.set({ clear, nonce: ++this._refreshNonce });
124
- }
125
- _filterDataSourceByType(dataSource, type) {
126
- this._filteredDataSource = [];
127
- switch (type) {
128
- case 'Filters':
129
- this._setFilteredDataSourceByFilters(dataSource);
130
- break;
131
- case 'Keyword':
132
- this._setFilteredDataSourceByKeyword(dataSource);
133
- break;
134
- }
135
- this.dataSource = this._filteredDataSource;
136
- this._refreshDataSourceChange.set({ clear: false, nonce: ++this._refreshNonce });
137
- }
138
- _setFilteredDataSourceByFilters(dataSource) {
139
- dataSource.map((data) => {
140
- const compareResultArr = [];
141
- this._filterData.filters.map((filter) => {
142
- if (Object.prototype.hasOwnProperty.call(data, filter.field)) {
143
- const compare = this._compareMap.get(filter.condition.sort().toString())?.(filter.value, data[filter.field]);
144
- if (this._filterData.filters.length < 2 && compare) {
145
- this._filteredDataSource.push(data);
146
- }
147
- else {
148
- compareResultArr.push(compare ?? false);
149
- }
150
- }
151
- });
152
- if (compareResultArr.length && this._conditionMap.get(this._filterData.condition)?.(compareResultArr)) {
153
- this._filteredDataSource.push(data);
154
- }
155
- if (data.children && data.children.length > 0) {
156
- this._setFilteredDataSourceByFilters(data.children);
157
- }
158
- });
159
- }
160
- _setFilteredDataSourceByKeyword(dataSource) {
161
- dataSource.map((data) => {
162
- if (data.label.includes(this._keyword)) {
163
- this._filteredDataSource.push(data);
164
- }
165
- else if (data.children && data.children.length > 0) {
166
- this._setFilteredDataSourceByKeyword(data.children);
167
- }
168
- });
169
- }
170
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
171
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerService, providedIn: 'root' }); }
172
- }
173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerService, decorators: [{
174
- type: Injectable,
175
- args: [{
176
- providedIn: 'root'
177
- }]
178
- }], ctorParameters: () => [] });
179
-
180
- class CmatTransferPickerFilterComponent {
181
- constructor() {
182
- this.filters = input(/* @ts-ignore */
183
- ...(ngDevMode ? [undefined, { debugName: "filters" }] : /* istanbul ignore next */ []));
184
- this._overlayOrigin = viewChild(CdkOverlayOrigin, /* @ts-ignore */
185
- ...(ngDevMode ? [{ debugName: "_overlayOrigin" }] : /* istanbul ignore next */ []));
186
- this._filterTemplate = viewChild('filterTemplate', /* @ts-ignore */
187
- ...(ngDevMode ? [{ debugName: "_filterTemplate" }] : /* istanbul ignore next */ []));
188
- this._overlay = inject(Overlay);
189
- this._service = inject(CmatTransferPickerService);
190
- this.filterData = {
191
- condition: 'or',
192
- filters: []
193
- };
194
- }
195
- ngOnInit() {
196
- const config = new OverlayConfig({
197
- hasBackdrop: true,
198
- backdropClass: 'cdk-overlay-transparent-backdrop',
199
- scrollStrategy: this._overlay.scrollStrategies.block()
200
- });
201
- config.positionStrategy = this._overlay
202
- .position()
203
- .flexibleConnectedTo(this._overlayOrigin().elementRef).withPositions([
204
- {
205
- originX: 'end', originY: 'bottom', overlayX: 'end',
206
- overlayY: 'top', offsetX: 5
207
- }, {
208
- originX: 'end',
209
- originY: 'bottom',
210
- overlayX: 'end',
211
- overlayY: 'top',
212
- offsetX: -5
213
- }
214
- ]);
215
- this.overlayRef = this._overlay.create(config);
216
- this.overlayRef.backdropClick().subscribe(() => {
217
- this.overlayRef.detach();
218
- });
219
- }
220
- toggleFilter() {
221
- if (this.overlayRef?.hasAttached()) {
222
- this.overlayRef.detach();
223
- }
224
- else {
225
- this.overlayRef.attach(this._filterTemplate());
226
- }
227
- }
228
- onFilterClick(filter) {
229
- filter.selected = !filter.selected;
230
- const existFilter = this.filterData.filters.find((item) => item.value === filter.value);
231
- if (!existFilter) {
232
- this.filterData.filters.push(filter);
233
- }
234
- else if (!filter.selected) {
235
- this.filterData.filters.splice(this.filterData.filters.findIndex((j) => j === filter), 1);
236
- }
237
- this.changeFilterData();
238
- }
239
- onConditionChange(event) {
240
- this.filterData.condition = event;
241
- this.changeFilterData();
242
- }
243
- changeFilterData() {
244
- this._service.filterDataSource({ filterData: this.filterData });
245
- }
246
- ngOnDestroy() {
247
- if (this.overlayRef) {
248
- this.overlayRef.dispose();
249
- }
250
- }
251
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
252
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatTransferPickerFilterComponent, isStandalone: true, selector: "cmat-transfer-picker-filter", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "_overlayOrigin", first: true, predicate: CdkOverlayOrigin, descendants: true, isSignal: true }, { propertyName: "_filterTemplate", first: true, predicate: ["filterTemplate"], descendants: true, isSignal: true }], exportAs: ["cmatTransferPickerFilter"], ngImport: i0, template: "<button type=\"button\" class=\"mr-2 mt-1\" matIconButton cdk-overlay-origin (click)=\"toggleFilter()\">\r\n <mat-icon svgIcon=\"mat_outline:filter_list\"></mat-icon>\r\n</button>\r\n<ng-template #filterTemplate=\"cdkPortal\" cdkPortal>\r\n <div\r\n class=\"transfer-picker-filter-panel bg-card flex flex-col flex-nowrap place-content-start box-border items-start w-full shadow\">\r\n <mat-button-toggle-group name=\"condition\" [hideSingleSelectionIndicator]=\"true\" (change)=\"onConditionChange($event.value)\">\r\n <mat-button-toggle value=\"or\" [checked]=\"filterData.condition === 'or'\">\u6216</mat-button-toggle>\r\n <mat-button-toggle value=\"and\" [checked]=\"filterData.condition === 'and'\">\u4E14</mat-button-toggle>\r\n </mat-button-toggle-group>\r\n\r\n <div class=\"chip-list\">\r\n @for (item of filters(); track $index) {\r\n <div class=\"chip-wrapper\" role=\"presentation\"\r\n (click)=\"onFilterClick(item)\">\r\n <span class=\"chip\" [ngClass]=\"{selected: item?.selected}\">{{item.label}}</span>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>", styles: [".transfer-picker-filter-panel{min-width:276px;padding:10px 0;border-width:1px}.transfer-picker-filter-panel .mat-button-toggle-group{font-size:12px;margin-right:15px;margin-bottom:20px;align-self:flex-end}.transfer-picker-filter-panel .mat-button-toggle-group .mat-button-toggle-label-content{line-height:1.8}.transfer-picker-filter-panel .chip-list{width:276px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;box-sizing:border-box}.transfer-picker-filter-panel .chip-list:after{content:\"\";flex:1 1 0%;max-width:33.333333%}.transfer-picker-filter-panel .chip-list .chip-wrapper{flex:1 1 0%;box-sizing:border-box;max-width:33.333333%;text-align:center;margin-bottom:20px}.transfer-picker-filter-panel .chip-list .chip-wrapper .chip{display:inline-block;min-width:50%;cursor:pointer;padding:5px 10px;font-size:12px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i1.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i1.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i4.CdkPortal, selector: "[cdkPortal]", exportAs: ["cdkPortal"] }, { 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: OverlayModule }, { kind: "directive", type: i6.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
253
- }
254
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerFilterComponent, decorators: [{
255
- type: Component,
256
- args: [{ selector: 'cmat-transfer-picker-filter', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPickerFilter', imports: [MatButtonToggleModule, MatIconModule, CommonModule, PortalModule, MatButtonModule, OverlayModule], template: "<button type=\"button\" class=\"mr-2 mt-1\" matIconButton cdk-overlay-origin (click)=\"toggleFilter()\">\r\n <mat-icon svgIcon=\"mat_outline:filter_list\"></mat-icon>\r\n</button>\r\n<ng-template #filterTemplate=\"cdkPortal\" cdkPortal>\r\n <div\r\n class=\"transfer-picker-filter-panel bg-card flex flex-col flex-nowrap place-content-start box-border items-start w-full shadow\">\r\n <mat-button-toggle-group name=\"condition\" [hideSingleSelectionIndicator]=\"true\" (change)=\"onConditionChange($event.value)\">\r\n <mat-button-toggle value=\"or\" [checked]=\"filterData.condition === 'or'\">\u6216</mat-button-toggle>\r\n <mat-button-toggle value=\"and\" [checked]=\"filterData.condition === 'and'\">\u4E14</mat-button-toggle>\r\n </mat-button-toggle-group>\r\n\r\n <div class=\"chip-list\">\r\n @for (item of filters(); track $index) {\r\n <div class=\"chip-wrapper\" role=\"presentation\"\r\n (click)=\"onFilterClick(item)\">\r\n <span class=\"chip\" [ngClass]=\"{selected: item?.selected}\">{{item.label}}</span>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>", styles: [".transfer-picker-filter-panel{min-width:276px;padding:10px 0;border-width:1px}.transfer-picker-filter-panel .mat-button-toggle-group{font-size:12px;margin-right:15px;margin-bottom:20px;align-self:flex-end}.transfer-picker-filter-panel .mat-button-toggle-group .mat-button-toggle-label-content{line-height:1.8}.transfer-picker-filter-panel .chip-list{width:276px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;box-sizing:border-box}.transfer-picker-filter-panel .chip-list:after{content:\"\";flex:1 1 0%;max-width:33.333333%}.transfer-picker-filter-panel .chip-list .chip-wrapper{flex:1 1 0%;box-sizing:border-box;max-width:33.333333%;text-align:center;margin-bottom:20px}.transfer-picker-filter-panel .chip-list .chip-wrapper .chip{display:inline-block;min-width:50%;cursor:pointer;padding:5px 10px;font-size:12px}\n"] }]
257
- }], ctorParameters: () => [], propDecorators: { filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }], _overlayOrigin: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkOverlayOrigin), { isSignal: true }] }], _filterTemplate: [{ type: i0.ViewChild, args: ['filterTemplate', { isSignal: true }] }] } });
258
-
259
- class CmatTransferPickerSearchComponent {
260
- constructor() {
261
- this.searchPlaceholder = input(/* @ts-ignore */
262
- ...(ngDevMode ? [undefined, { debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
263
- this._service = inject(CmatTransferPickerService);
264
- this.keyword = new FormControl();
265
- }
266
- ngOnInit() {
267
- this.keyword
268
- .valueChanges
269
- .pipe(debounceTime(300), distinctUntilChanged())
270
- .subscribe((keyword) => this._service.filterDataSource({ keyword: keyword ?? '' }));
271
- }
272
- reset() {
273
- this.keyword.setValue('');
274
- }
275
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
276
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatTransferPickerSearchComponent, isStandalone: true, selector: "cmat-transfer-picker-search", inputs: { searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["cmatTransferPickerSearch"], ngImport: i0, template: "<mat-form-field appearance=\"outline\">\r\n <input placeholder=\"{{searchPlaceholder()}}\" matInput type=\"text\" [formControl]=\"keyword\">\r\n @if (keyword.value) {\r\n <button type=\"button\" matSuffix matIconButton (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n </button>\r\n }\r\n</mat-form-field>", styles: ["cmat-transfer-picker-search{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center}cmat-transfer-picker-search .mat-mdc-form-field{width:88%}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { 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: MatInputModule }, { kind: "directive", type: i5$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
277
- }
278
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerSearchComponent, decorators: [{
279
- type: Component,
280
- args: [{ selector: 'cmat-transfer-picker-search', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPickerSearch', imports: [MatFormFieldModule, MatIconModule, ReactiveFormsModule, MatButtonModule, MatInputModule], template: "<mat-form-field appearance=\"outline\">\r\n <input placeholder=\"{{searchPlaceholder()}}\" matInput type=\"text\" [formControl]=\"keyword\">\r\n @if (keyword.value) {\r\n <button type=\"button\" matSuffix matIconButton (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n </button>\r\n }\r\n</mat-form-field>", styles: ["cmat-transfer-picker-search{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center}cmat-transfer-picker-search .mat-mdc-form-field{width:88%}\n"] }]
281
- }], ctorParameters: () => [], propDecorators: { searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }] } });
282
-
283
- /* eslint-disable @typescript-eslint/naming-convention */
284
- class CmatTransferItemNode {
285
- }
286
- class CmatTransferItemFlatNode {
287
- }
1
+ import * as i6 from "@angular/cdk/overlay";
2
+ import { CdkOverlayOrigin, Overlay, OverlayConfig, OverlayModule } from "@angular/cdk/overlay";
3
+ import * as i4 from "@angular/cdk/portal";
4
+ import { PortalModule } from "@angular/cdk/portal";
5
+ import * as i3$2 from "@angular/common";
6
+ import { CommonModule } from "@angular/common";
7
+ import * as i0 from "@angular/core";
8
+ import { ChangeDetectionStrategy, Component, Injectable, Injector, ViewEncapsulation, afterNextRender, computed, effect, inject, input, output, signal, untracked, viewChild } from "@angular/core";
9
+ import * as i5$1 from "@angular/material/button";
10
+ import { MatButtonModule } from "@angular/material/button";
11
+ import * as i1$2 from "@angular/material/button-toggle";
12
+ import { MatButtonToggleModule } from "@angular/material/button-toggle";
13
+ import * as i2$2 from "@angular/material/icon";
14
+ import { MatIconModule } from "@angular/material/icon";
15
+ import * as i3$1 from "@angular/forms";
16
+ import { FormControl, ReactiveFormsModule } from "@angular/forms";
17
+ import * as i1$1 from "@angular/material/form-field";
18
+ import { MatFormFieldModule } from "@angular/material/form-field";
19
+ import * as i5 from "@angular/material/input";
20
+ import { MatInputModule } from "@angular/material/input";
21
+ import { debounceTime, distinctUntilChanged } from "rxjs/operators";
22
+ import { SelectionModel } from "@angular/cdk/collections";
23
+ import { ScrollingModule } from "@angular/cdk/scrolling";
24
+ import * as i1 from "@angular/material/card";
25
+ import { MatCardModule } from "@angular/material/card";
26
+ import * as i3 from "@angular/material/checkbox";
27
+ import { MatCheckboxModule } from "@angular/material/checkbox";
28
+ import * as i2$1 from "@angular/material/tree";
29
+ import { MatTreeModule } from "@angular/material/tree";
30
+ import { of } from "rxjs";
31
+ import * as i2 from "@angular/material/list";
32
+ import { MatListModule } from "@angular/material/list";
33
+ var CmatTransferPickerService = class CmatTransferPickerService {
34
+ constructor() {
35
+ this._dataSourceChange = signal([], ...ngDevMode ? [{ debugName: "_dataSourceChange" }] : /* istanbul ignore next */ []);
36
+ this._refreshDataSourceChange = signal({
37
+ clear: true,
38
+ nonce: 0
39
+ }, ...ngDevMode ? [{ debugName: "_refreshDataSourceChange" }] : /* istanbul ignore next */ []);
40
+ this._filtersChange = signal([], ...ngDevMode ? [{ debugName: "_filtersChange" }] : /* istanbul ignore next */ []);
41
+ this._sourceOptionsChange = signal(void 0, ...ngDevMode ? [{ debugName: "_sourceOptionsChange" }] : /* istanbul ignore next */ []);
42
+ this._selectedValuesChange = signal([], ...ngDevMode ? [{ debugName: "_selectedValuesChange" }] : /* istanbul ignore next */ []);
43
+ this._refreshNonce = 0;
44
+ this.dataSourceChange = this._dataSourceChange.asReadonly();
45
+ this.refreshDataSourceChange = this._refreshDataSourceChange.asReadonly();
46
+ this.filtersChange = this._filtersChange.asReadonly();
47
+ this.sourceOptionsChange = this._sourceOptionsChange.asReadonly();
48
+ this.selectedValuesChange = this._selectedValuesChange.asReadonly();
49
+ this._compareMap = /* @__PURE__ */ new Map([
50
+ ["0", (a, b) => a === b],
51
+ ["1", (a, b) => a !== b],
52
+ ["2", (a, b) => a > b],
53
+ ["3", (a, b) => a < b],
54
+ ["0,2", (a, b) => a >= b],
55
+ ["0,3", (a, b) => a <= b]
56
+ ]);
57
+ this._conditionMap = /* @__PURE__ */ new Map([["or", (arr) => arr.reduce((o, item) => (o.result = o.result || item || o.prev, o.prev = item, o), {
58
+ result: false,
59
+ prev: arr[0]
60
+ }).result], ["and", (arr) => arr.reduce((o, item) => (o.result = o.result && item && o.prev, o.prev = item, o), {
61
+ result: true,
62
+ prev: arr[0]
63
+ }).result]]);
64
+ }
65
+ get dataSource() {
66
+ return this._dataSource;
67
+ }
68
+ set dataSource(data) {
69
+ this._dataSource = data;
70
+ if (!this._originalDataSource) this._originalDataSource = JSON.parse(JSON.stringify(data));
71
+ this._dataSourceChange.set(data);
72
+ }
73
+ set sourceOptions(value) {
74
+ this._sourceOptionsChange.set(value);
75
+ }
76
+ set selectedValues(value) {
77
+ this._selectedValuesChange.set(value);
78
+ }
79
+ filterDataSource({ filterData, keyword }) {
80
+ this._filterData = filterData ?? this._filterData;
81
+ this._keyword = keyword === void 0 ? this._keyword : keyword;
82
+ if (filterData?.filters.length) {
83
+ this._filterDataSourceByType(this._keyword ? this._filteredDataSource : this._originalDataSource, "Filters");
84
+ return;
85
+ } else if (filterData && !filterData.filters.length) {
86
+ if (this._keyword) this._filterDataSourceByType(this._originalDataSource, "Keyword");
87
+ else this.resetDataSource(false);
88
+ return;
89
+ }
90
+ if (keyword) {
91
+ this._filterDataSourceByType(this._filterData?.filters.length ? this._filteredDataSource : this._originalDataSource, "Keyword");
92
+ return;
93
+ } else if (!keyword) {
94
+ if (this._filterData?.filters.length) this._filterDataSourceByType(this._originalDataSource, "Filters");
95
+ else this.resetDataSource(false);
96
+ return;
97
+ }
98
+ }
99
+ resetDataSource(clear) {
100
+ this.dataSource = this._originalDataSource;
101
+ this._filteredDataSource = [];
102
+ this._refreshDataSourceChange.set({
103
+ clear,
104
+ nonce: ++this._refreshNonce
105
+ });
106
+ }
107
+ _filterDataSourceByType(dataSource, type) {
108
+ this._filteredDataSource = [];
109
+ switch (type) {
110
+ case "Filters":
111
+ this._setFilteredDataSourceByFilters(dataSource);
112
+ break;
113
+ case "Keyword": this._setFilteredDataSourceByKeyword(dataSource);
114
+ }
115
+ this.dataSource = this._filteredDataSource;
116
+ this._refreshDataSourceChange.set({
117
+ clear: false,
118
+ nonce: ++this._refreshNonce
119
+ });
120
+ }
121
+ _setFilteredDataSourceByFilters(dataSource) {
122
+ dataSource.map((data) => {
123
+ const compareResultArr = [];
124
+ this._filterData.filters.map((filter) => {
125
+ if (Object.prototype.hasOwnProperty.call(data, filter.field)) {
126
+ const compare = this._compareMap.get(filter.condition.sort().toString())?.(filter.value, data[filter.field]);
127
+ if (this._filterData.filters.length < 2 && compare) this._filteredDataSource.push(data);
128
+ else compareResultArr.push(compare ?? false);
129
+ }
130
+ });
131
+ if (compareResultArr.length && this._conditionMap.get(this._filterData.condition)?.(compareResultArr)) this._filteredDataSource.push(data);
132
+ if (data.children && data.children.length > 0) this._setFilteredDataSourceByFilters(data.children);
133
+ });
134
+ }
135
+ _setFilteredDataSourceByKeyword(dataSource) {
136
+ dataSource.map((data) => {
137
+ if (data.label.includes(this._keyword)) this._filteredDataSource.push(data);
138
+ else if (data.children && data.children.length > 0) this._setFilteredDataSourceByKeyword(data.children);
139
+ });
140
+ }
141
+ static {
142
+ this.ɵfac = i0.ɵɵngDeclareFactory({
143
+ minVersion: "12.0.0",
144
+ version: "22.2.3",
145
+ ngImport: i0,
146
+ type: CmatTransferPickerService,
147
+ deps: [],
148
+ target: i0.ɵɵFactoryTarget.Injectable
149
+ });
150
+ }
151
+ static {
152
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
153
+ minVersion: "12.0.0",
154
+ version: "22.2.3",
155
+ ngImport: i0,
156
+ type: CmatTransferPickerService,
157
+ providedIn: "root"
158
+ });
159
+ }
160
+ };
161
+ i0.ɵɵngDeclareClassMetadata({
162
+ minVersion: "12.0.0",
163
+ version: "22.2.3",
164
+ ngImport: i0,
165
+ type: CmatTransferPickerService,
166
+ decorators: [{
167
+ type: Injectable,
168
+ args: [{ providedIn: "root" }]
169
+ }],
170
+ ctorParameters: () => []
171
+ });
172
+ var CmatTransferPickerFilterComponent = class CmatTransferPickerFilterComponent {
173
+ constructor() {
174
+ this.filters = input(...ngDevMode ? [void 0, { debugName: "filters" }] : /* istanbul ignore next */ []);
175
+ this._overlayOrigin = viewChild(CdkOverlayOrigin, ...ngDevMode ? [{ debugName: "_overlayOrigin" }] : /* istanbul ignore next */ []);
176
+ this._filterTemplate = viewChild("filterTemplate", ...ngDevMode ? [{ debugName: "_filterTemplate" }] : /* istanbul ignore next */ []);
177
+ this._overlay = inject(Overlay);
178
+ this._service = inject(CmatTransferPickerService);
179
+ this.filterData = {
180
+ condition: "or",
181
+ filters: []
182
+ };
183
+ }
184
+ ngOnInit() {
185
+ const config = new OverlayConfig({
186
+ hasBackdrop: true,
187
+ backdropClass: "cdk-overlay-transparent-backdrop",
188
+ scrollStrategy: this._overlay.scrollStrategies.block()
189
+ });
190
+ config.positionStrategy = this._overlay.position().flexibleConnectedTo(this._overlayOrigin().elementRef).withPositions([{
191
+ originX: "end",
192
+ originY: "bottom",
193
+ overlayX: "end",
194
+ overlayY: "top",
195
+ offsetX: 5
196
+ }, {
197
+ originX: "end",
198
+ originY: "bottom",
199
+ overlayX: "end",
200
+ overlayY: "top",
201
+ offsetX: -5
202
+ }]);
203
+ this.overlayRef = this._overlay.create(config);
204
+ this.overlayRef.backdropClick().subscribe(() => {
205
+ this.overlayRef.detach();
206
+ });
207
+ }
208
+ toggleFilter() {
209
+ if (this.overlayRef?.hasAttached()) this.overlayRef.detach();
210
+ else this.overlayRef.attach(this._filterTemplate());
211
+ }
212
+ onFilterClick(filter) {
213
+ filter.selected = !filter.selected;
214
+ if (!this.filterData.filters.find((item) => item.value === filter.value)) this.filterData.filters.push(filter);
215
+ else if (!filter.selected) this.filterData.filters.splice(this.filterData.filters.findIndex((j) => j === filter), 1);
216
+ this.changeFilterData();
217
+ }
218
+ onConditionChange(event) {
219
+ this.filterData.condition = event;
220
+ this.changeFilterData();
221
+ }
222
+ changeFilterData() {
223
+ this._service.filterDataSource({ filterData: this.filterData });
224
+ }
225
+ ngOnDestroy() {
226
+ if (this.overlayRef) this.overlayRef.dispose();
227
+ }
228
+ static {
229
+ this.ɵfac = i0.ɵɵngDeclareFactory({
230
+ minVersion: "12.0.0",
231
+ version: "22.2.3",
232
+ ngImport: i0,
233
+ type: CmatTransferPickerFilterComponent,
234
+ deps: [],
235
+ target: i0.ɵɵFactoryTarget.Component
236
+ });
237
+ }
238
+ static {
239
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
240
+ minVersion: "17.0.0",
241
+ version: "22.2.3",
242
+ type: CmatTransferPickerFilterComponent,
243
+ isStandalone: true,
244
+ selector: "cmat-transfer-picker-filter",
245
+ inputs: { filters: {
246
+ classPropertyName: "filters",
247
+ publicName: "filters",
248
+ isSignal: true,
249
+ isRequired: false,
250
+ transformFunction: null
251
+ } },
252
+ viewQueries: [{
253
+ propertyName: "_overlayOrigin",
254
+ first: true,
255
+ predicate: CdkOverlayOrigin,
256
+ descendants: true,
257
+ isSignal: true
258
+ }, {
259
+ propertyName: "_filterTemplate",
260
+ first: true,
261
+ predicate: ["filterTemplate"],
262
+ descendants: true,
263
+ isSignal: true
264
+ }],
265
+ exportAs: ["cmatTransferPickerFilter"],
266
+ ngImport: i0,
267
+ template: "<button type=\"button\" class=\"mr-2 mt-1\" matIconButton cdk-overlay-origin (click)=\"toggleFilter()\">\r\n <mat-icon svgIcon=\"mat_outline:filter_list\"></mat-icon>\r\n</button>\r\n<ng-template #filterTemplate=\"cdkPortal\" cdkPortal>\r\n <div\r\n class=\"transfer-picker-filter-panel bg-card flex flex-col flex-nowrap place-content-start box-border items-start w-full shadow\">\r\n <mat-button-toggle-group name=\"condition\" [hideSingleSelectionIndicator]=\"true\" (change)=\"onConditionChange($event.value)\">\r\n <mat-button-toggle value=\"or\" [checked]=\"filterData.condition === 'or'\">或</mat-button-toggle>\r\n <mat-button-toggle value=\"and\" [checked]=\"filterData.condition === 'and'\">且</mat-button-toggle>\r\n </mat-button-toggle-group>\r\n\r\n <div class=\"chip-list\">\r\n @for (item of filters(); track $index) {\r\n <div class=\"chip-wrapper\" role=\"presentation\"\r\n (click)=\"onFilterClick(item)\">\r\n <span class=\"chip\" [ngClass]=\"{selected: item?.selected}\">{{item.label}}</span>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>",
268
+ styles: [".transfer-picker-filter-panel{min-width:276px;padding:10px 0;border-width:1px}.transfer-picker-filter-panel .mat-button-toggle-group{font-size:12px;margin-right:15px;margin-bottom:20px;align-self:flex-end}.transfer-picker-filter-panel .mat-button-toggle-group .mat-button-toggle-label-content{line-height:1.8}.transfer-picker-filter-panel .chip-list{width:276px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;box-sizing:border-box}.transfer-picker-filter-panel .chip-list:after{content:\"\";flex:1 1 0%;max-width:33.333333%}.transfer-picker-filter-panel .chip-list .chip-wrapper{flex:1 1 0%;box-sizing:border-box;max-width:33.333333%;text-align:center;margin-bottom:20px}.transfer-picker-filter-panel .chip-list .chip-wrapper .chip{display:inline-block;min-width:50%;cursor:pointer;padding:5px 10px;font-size:12px}\n"],
269
+ dependencies: [
270
+ {
271
+ kind: "ngmodule",
272
+ type: MatButtonToggleModule
273
+ },
274
+ {
275
+ kind: "directive",
276
+ type: i1$2.MatButtonToggleGroup,
277
+ selector: "mat-button-toggle-group",
278
+ inputs: [
279
+ "appearance",
280
+ "name",
281
+ "vertical",
282
+ "value",
283
+ "multiple",
284
+ "disabled",
285
+ "disabledInteractive",
286
+ "hideSingleSelectionIndicator",
287
+ "hideMultipleSelectionIndicator"
288
+ ],
289
+ outputs: ["valueChange", "change"],
290
+ exportAs: ["matButtonToggleGroup"]
291
+ },
292
+ {
293
+ kind: "component",
294
+ type: i1$2.MatButtonToggle,
295
+ selector: "mat-button-toggle",
296
+ inputs: [
297
+ "aria-label",
298
+ "aria-labelledby",
299
+ "id",
300
+ "name",
301
+ "value",
302
+ "tabIndex",
303
+ "disableRipple",
304
+ "appearance",
305
+ "checked",
306
+ "disabled",
307
+ "disabledInteractive"
308
+ ],
309
+ outputs: ["change"],
310
+ exportAs: ["matButtonToggle"]
311
+ },
312
+ {
313
+ kind: "ngmodule",
314
+ type: MatIconModule
315
+ },
316
+ {
317
+ kind: "component",
318
+ type: i2$2.MatIcon,
319
+ selector: "mat-icon",
320
+ inputs: [
321
+ "color",
322
+ "inline",
323
+ "svgIcon",
324
+ "fontSet",
325
+ "fontIcon"
326
+ ],
327
+ exportAs: ["matIcon"]
328
+ },
329
+ {
330
+ kind: "ngmodule",
331
+ type: CommonModule
332
+ },
333
+ {
334
+ kind: "directive",
335
+ type: i3$2.NgClass,
336
+ selector: "[ngClass]",
337
+ inputs: ["class", "ngClass"]
338
+ },
339
+ {
340
+ kind: "ngmodule",
341
+ type: PortalModule
342
+ },
343
+ {
344
+ kind: "directive",
345
+ type: i4.CdkPortal,
346
+ selector: "[cdkPortal]",
347
+ exportAs: ["cdkPortal"]
348
+ },
349
+ {
350
+ kind: "ngmodule",
351
+ type: MatButtonModule
352
+ },
353
+ {
354
+ kind: "component",
355
+ type: i5$1.MatIconButton,
356
+ selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
357
+ exportAs: ["matButton", "matAnchor"]
358
+ },
359
+ {
360
+ kind: "ngmodule",
361
+ type: OverlayModule
362
+ },
363
+ {
364
+ kind: "directive",
365
+ type: i6.CdkOverlayOrigin,
366
+ selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]",
367
+ exportAs: ["cdkOverlayOrigin"]
368
+ }
369
+ ],
370
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
371
+ encapsulation: i0.ViewEncapsulation.None
372
+ });
373
+ }
374
+ };
375
+ i0.ɵɵngDeclareClassMetadata({
376
+ minVersion: "12.0.0",
377
+ version: "22.2.3",
378
+ ngImport: i0,
379
+ type: CmatTransferPickerFilterComponent,
380
+ decorators: [{
381
+ type: Component,
382
+ args: [{
383
+ selector: "cmat-transfer-picker-filter",
384
+ encapsulation: ViewEncapsulation.None,
385
+ changeDetection: ChangeDetectionStrategy.OnPush,
386
+ exportAs: "cmatTransferPickerFilter",
387
+ imports: [
388
+ MatButtonToggleModule,
389
+ MatIconModule,
390
+ CommonModule,
391
+ PortalModule,
392
+ MatButtonModule,
393
+ OverlayModule
394
+ ],
395
+ template: "<button type=\"button\" class=\"mr-2 mt-1\" matIconButton cdk-overlay-origin (click)=\"toggleFilter()\">\r\n <mat-icon svgIcon=\"mat_outline:filter_list\"></mat-icon>\r\n</button>\r\n<ng-template #filterTemplate=\"cdkPortal\" cdkPortal>\r\n <div\r\n class=\"transfer-picker-filter-panel bg-card flex flex-col flex-nowrap place-content-start box-border items-start w-full shadow\">\r\n <mat-button-toggle-group name=\"condition\" [hideSingleSelectionIndicator]=\"true\" (change)=\"onConditionChange($event.value)\">\r\n <mat-button-toggle value=\"or\" [checked]=\"filterData.condition === 'or'\">或</mat-button-toggle>\r\n <mat-button-toggle value=\"and\" [checked]=\"filterData.condition === 'and'\">且</mat-button-toggle>\r\n </mat-button-toggle-group>\r\n\r\n <div class=\"chip-list\">\r\n @for (item of filters(); track $index) {\r\n <div class=\"chip-wrapper\" role=\"presentation\"\r\n (click)=\"onFilterClick(item)\">\r\n <span class=\"chip\" [ngClass]=\"{selected: item?.selected}\">{{item.label}}</span>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>",
396
+ styles: [".transfer-picker-filter-panel{min-width:276px;padding:10px 0;border-width:1px}.transfer-picker-filter-panel .mat-button-toggle-group{font-size:12px;margin-right:15px;margin-bottom:20px;align-self:flex-end}.transfer-picker-filter-panel .mat-button-toggle-group .mat-button-toggle-label-content{line-height:1.8}.transfer-picker-filter-panel .chip-list{width:276px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;box-sizing:border-box}.transfer-picker-filter-panel .chip-list:after{content:\"\";flex:1 1 0%;max-width:33.333333%}.transfer-picker-filter-panel .chip-list .chip-wrapper{flex:1 1 0%;box-sizing:border-box;max-width:33.333333%;text-align:center;margin-bottom:20px}.transfer-picker-filter-panel .chip-list .chip-wrapper .chip{display:inline-block;min-width:50%;cursor:pointer;padding:5px 10px;font-size:12px}\n"]
397
+ }]
398
+ }],
399
+ ctorParameters: () => [],
400
+ propDecorators: {
401
+ filters: [{
402
+ type: i0.Input,
403
+ args: [{
404
+ isSignal: true,
405
+ alias: "filters",
406
+ required: false
407
+ }]
408
+ }],
409
+ _overlayOrigin: [{
410
+ type: i0.ViewChild,
411
+ args: [i0.forwardRef(() => CdkOverlayOrigin), { isSignal: true }]
412
+ }],
413
+ _filterTemplate: [{
414
+ type: i0.ViewChild,
415
+ args: ["filterTemplate", { isSignal: true }]
416
+ }]
417
+ }
418
+ });
419
+ var CmatTransferPickerSearchComponent = class CmatTransferPickerSearchComponent {
420
+ constructor() {
421
+ this.searchPlaceholder = input(...ngDevMode ? [void 0, { debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []);
422
+ this._service = inject(CmatTransferPickerService);
423
+ this.keyword = new FormControl();
424
+ }
425
+ ngOnInit() {
426
+ this.keyword.valueChanges.pipe(debounceTime(300), distinctUntilChanged()).subscribe((keyword) => this._service.filterDataSource({ keyword: keyword ?? "" }));
427
+ }
428
+ reset() {
429
+ this.keyword.setValue("");
430
+ }
431
+ static {
432
+ this.ɵfac = i0.ɵɵngDeclareFactory({
433
+ minVersion: "12.0.0",
434
+ version: "22.2.3",
435
+ ngImport: i0,
436
+ type: CmatTransferPickerSearchComponent,
437
+ deps: [],
438
+ target: i0.ɵɵFactoryTarget.Component
439
+ });
440
+ }
441
+ static {
442
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
443
+ minVersion: "17.0.0",
444
+ version: "22.2.3",
445
+ type: CmatTransferPickerSearchComponent,
446
+ isStandalone: true,
447
+ selector: "cmat-transfer-picker-search",
448
+ inputs: { searchPlaceholder: {
449
+ classPropertyName: "searchPlaceholder",
450
+ publicName: "searchPlaceholder",
451
+ isSignal: true,
452
+ isRequired: false,
453
+ transformFunction: null
454
+ } },
455
+ exportAs: ["cmatTransferPickerSearch"],
456
+ ngImport: i0,
457
+ template: "<mat-form-field appearance=\"outline\">\r\n <input placeholder=\"{{searchPlaceholder()}}\" matInput type=\"text\" [formControl]=\"keyword\">\r\n @if (keyword.value) {\r\n <button type=\"button\" matSuffix matIconButton (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n </button>\r\n }\r\n</mat-form-field>",
458
+ styles: ["cmat-transfer-picker-search{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center}cmat-transfer-picker-search .mat-mdc-form-field{width:88%}\n"],
459
+ dependencies: [
460
+ {
461
+ kind: "ngmodule",
462
+ type: MatFormFieldModule
463
+ },
464
+ {
465
+ kind: "component",
466
+ type: i1$1.MatFormField,
467
+ selector: "mat-form-field",
468
+ inputs: [
469
+ "hideRequiredMarker",
470
+ "color",
471
+ "floatLabel",
472
+ "appearance",
473
+ "subscriptSizing",
474
+ "hintLabel"
475
+ ],
476
+ exportAs: ["matFormField"]
477
+ },
478
+ {
479
+ kind: "directive",
480
+ type: i1$1.MatSuffix,
481
+ selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
482
+ inputs: ["matTextSuffix"]
483
+ },
484
+ {
485
+ kind: "ngmodule",
486
+ type: MatIconModule
487
+ },
488
+ {
489
+ kind: "component",
490
+ type: i2$2.MatIcon,
491
+ selector: "mat-icon",
492
+ inputs: [
493
+ "color",
494
+ "inline",
495
+ "svgIcon",
496
+ "fontSet",
497
+ "fontIcon"
498
+ ],
499
+ exportAs: ["matIcon"]
500
+ },
501
+ {
502
+ kind: "ngmodule",
503
+ type: ReactiveFormsModule
504
+ },
505
+ {
506
+ kind: "directive",
507
+ type: i3$1.DefaultValueAccessor,
508
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
509
+ },
510
+ {
511
+ kind: "directive",
512
+ type: i3$1.NgControlStatus,
513
+ selector: "[formControlName],[ngModel],[formControl]"
514
+ },
515
+ {
516
+ kind: "directive",
517
+ type: i3$1.FormControlDirective,
518
+ selector: "[formControl]",
519
+ inputs: [
520
+ "formControl",
521
+ "disabled",
522
+ "ngModel"
523
+ ],
524
+ outputs: ["ngModelChange"],
525
+ exportAs: ["ngForm"]
526
+ },
527
+ {
528
+ kind: "ngmodule",
529
+ type: MatButtonModule
530
+ },
531
+ {
532
+ kind: "component",
533
+ type: i5$1.MatIconButton,
534
+ selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
535
+ exportAs: ["matButton", "matAnchor"]
536
+ },
537
+ {
538
+ kind: "ngmodule",
539
+ type: MatInputModule
540
+ },
541
+ {
542
+ kind: "directive",
543
+ type: i5.MatInput,
544
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
545
+ inputs: [
546
+ "disabled",
547
+ "id",
548
+ "placeholder",
549
+ "name",
550
+ "required",
551
+ "type",
552
+ "errorStateMatcher",
553
+ "aria-describedby",
554
+ "value",
555
+ "readonly",
556
+ "disabledInteractive"
557
+ ],
558
+ exportAs: ["matInput"]
559
+ }
560
+ ],
561
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
562
+ encapsulation: i0.ViewEncapsulation.None
563
+ });
564
+ }
565
+ };
566
+ i0.ɵɵngDeclareClassMetadata({
567
+ minVersion: "12.0.0",
568
+ version: "22.2.3",
569
+ ngImport: i0,
570
+ type: CmatTransferPickerSearchComponent,
571
+ decorators: [{
572
+ type: Component,
573
+ args: [{
574
+ selector: "cmat-transfer-picker-search",
575
+ encapsulation: ViewEncapsulation.None,
576
+ changeDetection: ChangeDetectionStrategy.OnPush,
577
+ exportAs: "cmatTransferPickerSearch",
578
+ imports: [
579
+ MatFormFieldModule,
580
+ MatIconModule,
581
+ ReactiveFormsModule,
582
+ MatButtonModule,
583
+ MatInputModule
584
+ ],
585
+ template: "<mat-form-field appearance=\"outline\">\r\n <input placeholder=\"{{searchPlaceholder()}}\" matInput type=\"text\" [formControl]=\"keyword\">\r\n @if (keyword.value) {\r\n <button type=\"button\" matSuffix matIconButton (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:close\"></mat-icon>\r\n </button>\r\n }\r\n</mat-form-field>",
586
+ styles: ["cmat-transfer-picker-search{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center}cmat-transfer-picker-search .mat-mdc-form-field{width:88%}\n"]
587
+ }]
588
+ }],
589
+ ctorParameters: () => [],
590
+ propDecorators: { searchPlaceholder: [{
591
+ type: i0.Input,
592
+ args: [{
593
+ isSignal: true,
594
+ alias: "searchPlaceholder",
595
+ required: false
596
+ }]
597
+ }] }
598
+ });
599
+ var CmatTransferItemNode = class {};
600
+ var CmatTransferItemFlatNode = class {};
288
601
  var CmatTransferFilterCondition;
289
- (function (CmatTransferFilterCondition) {
290
- CmatTransferFilterCondition[CmatTransferFilterCondition["EQUALS"] = 0] = "EQUALS";
291
- CmatTransferFilterCondition[CmatTransferFilterCondition["NOT_EQUALS"] = 1] = "NOT_EQUALS";
292
- CmatTransferFilterCondition[CmatTransferFilterCondition["MORE_THAN"] = 2] = "MORE_THAN";
293
- CmatTransferFilterCondition[CmatTransferFilterCondition["LESS_THAN"] = 3] = "LESS_THAN";
602
+ (function(CmatTransferFilterCondition) {
603
+ CmatTransferFilterCondition[CmatTransferFilterCondition["EQUALS"] = 0] = "EQUALS";
604
+ CmatTransferFilterCondition[CmatTransferFilterCondition["NOT_EQUALS"] = 1] = "NOT_EQUALS";
605
+ CmatTransferFilterCondition[CmatTransferFilterCondition["MORE_THAN"] = 2] = "MORE_THAN";
606
+ CmatTransferFilterCondition[CmatTransferFilterCondition["LESS_THAN"] = 3] = "LESS_THAN";
294
607
  })(CmatTransferFilterCondition || (CmatTransferFilterCondition = {}));
295
-
296
- class CmatTransferPickerSourceComponent {
297
- constructor() {
298
- this.nestedNodeMap = new Map();
299
- this.dataFlatNodes = signal([], /* @ts-ignore */
300
- ...(ngDevMode ? [{ debugName: "dataFlatNodes" }] : /* istanbul ignore next */ []));
301
- this.checklistSelection = new SelectionModel(true /* multiple */);
302
- this.committedSelection = signal([], /* @ts-ignore */
303
- ...(ngDevMode ? [{ debugName: "committedSelection" }] : /* istanbul ignore next */ []));
304
- this.committedValueSet = computed(() => new Set(this.committedSelection().map(node => node.value)), /* @ts-ignore */
305
- ...(ngDevMode ? [{ debugName: "committedValueSet" }] : /* istanbul ignore next */ []));
306
- this._tree = viewChild('componentTree', /* @ts-ignore */
307
- ...(ngDevMode ? [{ debugName: "_tree" }] : /* istanbul ignore next */ []));
308
- this._flatNodeByValue = new Map();
309
- this._service = inject(CmatTransferPickerService);
310
- // eslint-disable-next-line @typescript-eslint/member-ordering
311
- this.dataSource = this._service.dataSourceChange;
312
- // eslint-disable-next-line @typescript-eslint/member-ordering
313
- this.refreshDataSourceChange = this._service.refreshDataSourceChange;
314
- // eslint-disable-next-line @typescript-eslint/member-ordering
315
- this.options = this._service.sourceOptionsChange;
316
- // eslint-disable-next-line @typescript-eslint/member-ordering
317
- this.selectedValuesChange = this._service.selectedValuesChange;
318
- this.childrenAccessor = (node) => node.children ?? [];
319
- this.hasChild = (_, node) => !!node.children && node.children.length > 0;
320
- this._getLevel = (node) => node.level;
321
- this._isExpandable = (node) => node.expandable;
322
- this._getChildren = (node) => of(node.children ?? []);
323
- this._transformer = (node, level) => {
324
- const flatNode = this.nestedNodeMap.has(node) && this.nestedNodeMap.get(node)?.value === node.value
325
- ? this.nestedNodeMap.get(node)
326
- : new CmatTransferItemFlatNode();
327
- flatNode.label = node.label;
328
- flatNode.value = node.value;
329
- flatNode.disabled = !!node.disabled;
330
- flatNode.level = level;
331
- flatNode.expandable = !!node.children;
332
- this.nestedNodeMap.set(node, flatNode);
333
- this._flatNodeByValue.set(node.value, flatNode);
334
- return flatNode;
335
- };
336
- effect(() => {
337
- const data = this.dataSource();
338
- untracked(() => {
339
- this._flatNodeByValue.clear();
340
- this.dataFlatNodes.set(this._getFlattenNodes(data));
341
- });
342
- });
343
- effect(() => {
344
- const clear = this.refreshDataSourceChange();
345
- untracked(() => {
346
- if (clear) {
347
- this.checklistSelection.clear();
348
- this.committedSelection.set([]);
349
- }
350
- else {
351
- this._selectNodesByValues(this.checklistSelection.selected.map(node => node.value));
352
- this.commitSelection();
353
- }
354
- });
355
- });
356
- effect(() => {
357
- const values = this.selectedValuesChange();
358
- untracked(() => {
359
- this._selectNodesByValues(values);
360
- this.commitSelection();
361
- });
362
- });
363
- }
364
- ngAfterViewInit() {
365
- // 初始化时展开整棵树
366
- this._tree()?.expandAll();
367
- }
368
- getCommittedSelection() {
369
- return this.committedSelection();
370
- }
371
- commitSelection() {
372
- this.committedSelection.set(this._cloneFlatNodes(this.checklistSelection.selected));
373
- return this.committedSelection();
374
- }
375
- resetSelectedItem(item) {
376
- const target = this._flatNodeByValue.get(item.value) ?? this.checklistSelection.selected.find(i => i.value === item.value);
377
- if (!target) {
378
- return;
379
- }
380
- const descendants = this._getDescendants(target);
381
- this.checklistSelection.deselect(target, ...descendants.filter(node => this.checklistSelection.isSelected(node)));
382
- this._checkAllParentsSelection(target);
383
- this.commitSelection();
384
- }
385
- descendantsAllSelected(node) {
386
- // 判断后代是否全部选中
387
- const descendants = this._getDescendants(node);
388
- return descendants.every(child => this.checklistSelection.isSelected(child));
389
- }
390
- descendantsPartiallySelected(node) {
391
- // 判断后代是否部分选中
392
- const descendants = this._getDescendants(node);
393
- const result = descendants.some(child => this.checklistSelection.isSelected(child));
394
- return result && !this.descendantsAllSelected(node);
395
- }
396
- transferItemSelectionToggle(node) {
397
- // 切换分支节点选择状态
398
- this.checklistSelection.toggle(node);
399
- let descendants = this._getDescendants(node);
400
- descendants = descendants.filter(n => !this.isNodeDisabled(n));
401
- this.checklistSelection.isSelected(node)
402
- ? this.checklistSelection.select(...descendants)
403
- : this.checklistSelection.deselect(...descendants);
404
- descendants.every(child => this.checklistSelection.isSelected(child));
405
- this._checkAllParentsSelection(node);
406
- }
407
- transferLeafItemSelectionToggle(node) {
408
- // 切换叶子节点选择状态
409
- this.checklistSelection.toggle(node);
410
- this._checkAllParentsSelection(node);
411
- }
412
- isNodeDisabled(node) {
413
- return !!node.disabled || this.committedValueSet().has(node.value);
414
- }
415
- _getDescendants(dataNode) {
416
- // 收集当前节点的所有后代节点
417
- const flatNodes = this.dataFlatNodes();
418
- const startIndex = flatNodes.findIndex(j => j === dataNode);
419
- const results = [];
420
- for (let i = startIndex + 1; i < flatNodes.length && this._getLevel(dataNode) < this._getLevel(flatNodes[i]); i++) {
421
- results.push(flatNodes[i]);
422
- }
423
- return results;
424
- }
425
- _getFlattenNodes(nodes, i = 0) {
426
- // 将树结构转换为平铺节点
427
- const flattenedNodes = [];
428
- for (const node of nodes) {
429
- flattenedNodes.push(this._transformer(node, i));
430
- if (node.children) {
431
- flattenedNodes.push(...this._getFlattenNodes(node.children, i + 1));
432
- }
433
- }
434
- return flattenedNodes;
435
- }
436
- _checkAllParentsSelection(node) {
437
- // 逐级回溯父节点并更新选择状态
438
- let parent = this._getParentNode(node);
439
- while (parent) {
440
- this._checkRootNodeSelection(parent);
441
- parent = this._getParentNode(parent);
442
- }
443
- }
444
- _checkRootNodeSelection(node) {
445
- // 根据子节点状态更新当前节点
446
- const nodeSelected = this.checklistSelection.isSelected(node);
447
- const descendants = this._getDescendants(node);
448
- const descAllSelected = descendants.every(child => this.checklistSelection.isSelected(child));
449
- if (nodeSelected && !descAllSelected) {
450
- this.checklistSelection.deselect(node);
451
- }
452
- else if (!nodeSelected && descAllSelected) {
453
- this.checklistSelection.select(node);
454
- }
455
- }
456
- _cloneFlatNode(node) {
457
- return {
458
- label: node.label,
459
- value: node.value,
460
- level: node.level,
461
- disabled: node.disabled,
462
- expandable: node.expandable
463
- };
464
- }
465
- _cloneFlatNodes(nodes) {
466
- return nodes.map(node => this._cloneFlatNode(node));
467
- }
468
- _getParentNode(node) {
469
- // 获取当前节点的父节点
470
- const currentLevel = this._getLevel(node);
471
- const flatNodes = this.dataFlatNodes();
472
- if (currentLevel < 1) {
473
- return null;
474
- }
475
- const startIndex = flatNodes.findIndex(j => j === node) - 1;
476
- for (let i = startIndex; i >= 0; i--) {
477
- const currentNode = flatNodes[i];
478
- if (this._getLevel(currentNode) < currentLevel) {
479
- return currentNode;
480
- }
481
- }
482
- return null;
483
- }
484
- _selectNodesByValues(values) {
485
- this.checklistSelection.clear();
486
- for (const value of values) {
487
- const node = this._flatNodeByValue.get(value);
488
- if (node) {
489
- this.checklistSelection.select(node);
490
- }
491
- }
492
- }
493
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerSourceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
494
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatTransferPickerSourceComponent, isStandalone: true, selector: "cmat-transfer-picker-source", viewQueries: [{ propertyName: "_tree", first: true, predicate: ["componentTree"], descendants: true, isSignal: true }], exportAs: ["cmatTransferPickerSource"], ngImport: i0, template: "<mat-card class=\"transfer-picker-source shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-source-title\">{{options()?.title}}</mat-card-title>\r\n @if (options()?.filterable) {\r\n <cmat-transfer-picker-filter\r\n [filters]=\"options()?.filters\"></cmat-transfer-picker-filter>\r\n }\r\n </mat-card-header>\r\n <mat-card-content class=\"transfer-picker-source-content\">\r\n @if (options()?.searchable) {\r\n <cmat-transfer-picker-search\r\n [searchPlaceholder]=\"options()?.searchPlaceholder\"></cmat-transfer-picker-search>\r\n }\r\n\r\n <cdk-virtual-scroll-viewport itemSize=\"48\"\r\n class=\"transfer-picker-source-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-tree #componentTree [dataSource]=\"dataSource()\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton disabled> </button>\r\n <mat-checkbox class=\"checklist-leaf-node\" [checked]=\"checklistSelection.isSelected(nestedNodeMap.get(node)!)\"\r\n [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\" (change)=\"transferLeafItemSelectionToggle(nestedNodeMap.get(node)!);\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle>\r\n <mat-icon svgIcon=\"{{componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'}}\"\r\n class=\"mat-icon-rtl-mirror\">\r\n </mat-icon>\r\n </button>\r\n <mat-checkbox [checked]=\"descendantsAllSelected(nestedNodeMap.get(node)!)||committedValueSet().has(nestedNodeMap.get(node)!.value)\"\r\n [indeterminate]=\"descendantsPartiallySelected(nestedNodeMap.get(node)!)\" [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\"\r\n (change)=\"transferItemSelectionToggle(nestedNodeMap.get(node)!)\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n </mat-tree>\r\n @if (!dataSource().length) {\r\n <div class=\"transfer-picker-source-empty\">\u6682\u65E0\u6570\u636E</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".transfer-picker-source{width:276px;height:100%;padding:0}.transfer-picker-source .mat-mdc-card-header{display:flex;flex-direction:row;flex-wrap:nowrap;box-sizing:border-box;place-content:space-between;align-items:flex-start;margin-bottom:-8px}.transfer-picker-source-title{font-size:1rem;margin-bottom:0}.transfer-picker-source-scroll-wrapper{height:300px}.transfer-picker-source-empty{text-align:center;font-size:1rem;margin-top:20px;color:#00000040}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$2.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i1$2.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i1$2.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i2$1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i2$1.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i2$1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i2$1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i2$1.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3$2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { 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: "component", type: CmatTransferPickerFilterComponent, selector: "cmat-transfer-picker-filter", inputs: ["filters"], exportAs: ["cmatTransferPickerFilter"] }, { kind: "component", type: CmatTransferPickerSearchComponent, selector: "cmat-transfer-picker-search", inputs: ["searchPlaceholder"], exportAs: ["cmatTransferPickerSearch"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i6.ɵɵCdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "component", type: i6.ɵɵCdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
495
- }
496
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerSourceComponent, decorators: [{
497
- type: Component,
498
- args: [{ selector: 'cmat-transfer-picker-source', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPickerSource', imports: [MatCardModule, MatTreeModule, MatCheckboxModule, MatIconModule, MatButtonModule,
499
- CmatTransferPickerFilterComponent, CmatTransferPickerSearchComponent, ScrollingModule], template: "<mat-card class=\"transfer-picker-source shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-source-title\">{{options()?.title}}</mat-card-title>\r\n @if (options()?.filterable) {\r\n <cmat-transfer-picker-filter\r\n [filters]=\"options()?.filters\"></cmat-transfer-picker-filter>\r\n }\r\n </mat-card-header>\r\n <mat-card-content class=\"transfer-picker-source-content\">\r\n @if (options()?.searchable) {\r\n <cmat-transfer-picker-search\r\n [searchPlaceholder]=\"options()?.searchPlaceholder\"></cmat-transfer-picker-search>\r\n }\r\n\r\n <cdk-virtual-scroll-viewport itemSize=\"48\"\r\n class=\"transfer-picker-source-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-tree #componentTree [dataSource]=\"dataSource()\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton disabled> </button>\r\n <mat-checkbox class=\"checklist-leaf-node\" [checked]=\"checklistSelection.isSelected(nestedNodeMap.get(node)!)\"\r\n [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\" (change)=\"transferLeafItemSelectionToggle(nestedNodeMap.get(node)!);\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle>\r\n <mat-icon svgIcon=\"{{componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'}}\"\r\n class=\"mat-icon-rtl-mirror\">\r\n </mat-icon>\r\n </button>\r\n <mat-checkbox [checked]=\"descendantsAllSelected(nestedNodeMap.get(node)!)||committedValueSet().has(nestedNodeMap.get(node)!.value)\"\r\n [indeterminate]=\"descendantsPartiallySelected(nestedNodeMap.get(node)!)\" [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\"\r\n (change)=\"transferItemSelectionToggle(nestedNodeMap.get(node)!)\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n </mat-tree>\r\n @if (!dataSource().length) {\r\n <div class=\"transfer-picker-source-empty\">\u6682\u65E0\u6570\u636E</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".transfer-picker-source{width:276px;height:100%;padding:0}.transfer-picker-source .mat-mdc-card-header{display:flex;flex-direction:row;flex-wrap:nowrap;box-sizing:border-box;place-content:space-between;align-items:flex-start;margin-bottom:-8px}.transfer-picker-source-title{font-size:1rem;margin-bottom:0}.transfer-picker-source-scroll-wrapper{height:300px}.transfer-picker-source-empty{text-align:center;font-size:1rem;margin-top:20px;color:#00000040}\n"] }]
500
- }], ctorParameters: () => [], propDecorators: { _tree: [{ type: i0.ViewChild, args: ['componentTree', { isSignal: true }] }] } });
501
-
502
- class CmatTransferPickerTargetComponent {
503
- constructor() {
504
- this.committedSelection = input([], /* @ts-ignore */
505
- ...(ngDevMode ? [{ debugName: "committedSelection" }] : /* istanbul ignore next */ []));
506
- this.clearItemChange = output();
507
- }
508
- clearItem(item) {
509
- this.clearItemChange.emit(item);
510
- }
511
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerTargetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
512
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatTransferPickerTargetComponent, isStandalone: true, selector: "cmat-transfer-picker-target", inputs: { committedSelection: { classPropertyName: "committedSelection", publicName: "committedSelection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clearItemChange: "clearItemChange" }, exportAs: ["cmatTransferPickerTarget"], ngImport: i0, template: "<mat-card class=\"transfer-picker-target shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-target-title\">\u5DF2\u9009\u62E9 {{committedSelection().length}} \u9879</mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <cdk-virtual-scroll-viewport itemSize=\"40\"\r\n class=\"transfer-picker-target-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-list dense>\r\n @for (item of committedSelection(); track $index) {\r\n <mat-list-item class=\"transfer-picker-target-item\">\r\n <div mat-line class=\"flex flex-row items-center\">\r\n <div class=\"flex-1\">{{item.label}}</div>\r\n <button type=\"button\" matIconButton (click)=\"clearItem(item)\">\r\n <mat-icon svgIcon=\"heroicons_solid:x-circle\"></mat-icon>\r\n </button>\r\n </div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n @if (!committedSelection().length) {\r\n <div class=\"transfer-picker-target-empty\">\u6682\u65E0\u6570\u636E</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".transfer-picker-target{height:100%;padding:0;width:276px}.transfer-picker-target .mat-mdc-card-header{margin-bottom:-8px}.transfer-picker-target-title{font-size:1rem;margin-bottom:0;padding:12px 0}.transfer-picker-target-item{width:100%}.transfer-picker-target-scroll-wrapper{height:356px}.transfer-picker-target-empty{text-align:center;margin-top:20px;color:#00000040}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$2.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i1$2.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i1$2.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2$2.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i2$2.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i6.ɵɵCdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "component", type: i6.ɵɵCdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
513
- }
514
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerTargetComponent, decorators: [{
515
- type: Component,
516
- args: [{ selector: 'cmat-transfer-picker-target', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPickerTarget', imports: [MatCardModule, MatListModule, MatIconModule, ScrollingModule, MatButtonModule], template: "<mat-card class=\"transfer-picker-target shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-target-title\">\u5DF2\u9009\u62E9 {{committedSelection().length}} \u9879</mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <cdk-virtual-scroll-viewport itemSize=\"40\"\r\n class=\"transfer-picker-target-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-list dense>\r\n @for (item of committedSelection(); track $index) {\r\n <mat-list-item class=\"transfer-picker-target-item\">\r\n <div mat-line class=\"flex flex-row items-center\">\r\n <div class=\"flex-1\">{{item.label}}</div>\r\n <button type=\"button\" matIconButton (click)=\"clearItem(item)\">\r\n <mat-icon svgIcon=\"heroicons_solid:x-circle\"></mat-icon>\r\n </button>\r\n </div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n @if (!committedSelection().length) {\r\n <div class=\"transfer-picker-target-empty\">\u6682\u65E0\u6570\u636E</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: [".transfer-picker-target{height:100%;padding:0;width:276px}.transfer-picker-target .mat-mdc-card-header{margin-bottom:-8px}.transfer-picker-target-title{font-size:1rem;margin-bottom:0;padding:12px 0}.transfer-picker-target-item{width:100%}.transfer-picker-target-scroll-wrapper{height:356px}.transfer-picker-target-empty{text-align:center;margin-top:20px;color:#00000040}\n"] }]
517
- }], propDecorators: { committedSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "committedSelection", required: false }] }], clearItemChange: [{ type: i0.Output, args: ["clearItemChange"] }] } });
518
-
519
- class CmatTransferPickerComponent {
520
- constructor() {
521
- this.title = input(/* @ts-ignore */
522
- ...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
523
- this.filterable = input(true, /* @ts-ignore */
524
- ...(ngDevMode ? [{ debugName: "filterable" }] : /* istanbul ignore next */ []));
525
- this.searchable = input(false, /* @ts-ignore */
526
- ...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
527
- this.searchPlaceholder = input('请输入关键字', /* @ts-ignore */
528
- ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
529
- this.dataSource = input([], /* @ts-ignore */
530
- ...(ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []));
531
- this.filters = input([], /* @ts-ignore */
532
- ...(ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []));
533
- this.selectedValues = input([], /* @ts-ignore */
534
- ...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
535
- this.selectChange = output();
536
- this.committedSelection = signal([], /* @ts-ignore */
537
- ...(ngDevMode ? [{ debugName: "committedSelection" }] : /* istanbul ignore next */ []));
538
- this.source = viewChild.required(CmatTransferPickerSourceComponent, /* @ts-ignore */
539
- ...(ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []));
540
- this._service = inject(CmatTransferPickerService);
541
- this._injector = inject(Injector);
542
- }
543
- ngOnInit() {
544
- this._service.dataSource = this.dataSource();
545
- this._service.selectedValues = this.selectedValues();
546
- this._service.sourceOptions = {
547
- title: this.title() ?? '数据源',
548
- filterable: this.filterable() || true,
549
- searchable: this.searchable() || true,
550
- searchPlaceholder: this.searchPlaceholder() || '搜索关键字',
551
- filters: this.filters() || []
552
- };
553
- }
554
- ngAfterViewInit() {
555
- if (this.selectedValues().length) {
556
- afterNextRender(() => {
557
- this.pick();
558
- }, { injector: this._injector });
559
- }
560
- }
561
- pick() {
562
- this._commitSelection(this.source().commitSelection());
563
- }
564
- reset() {
565
- if (this.committedSelection().length) {
566
- this._commitSelection([]);
567
- this._service.resetDataSource(true);
568
- }
569
- }
570
- onClearItemChange(item) {
571
- if (item) {
572
- this.source().resetSelectedItem(item);
573
- this._commitSelection(this.source().getCommittedSelection());
574
- }
575
- }
576
- _commitSelection(selectedList) {
577
- this.committedSelection.set([...selectedList]);
578
- this._emitterChange();
579
- }
580
- _emitterChange() {
581
- this.selectChange.emit(this.committedSelection());
582
- }
583
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
584
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: CmatTransferPickerComponent, isStandalone: true, selector: "cmat-transfer-picker", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, selectedValues: { classPropertyName: "selectedValues", publicName: "selectedValues", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectChange: "selectChange" }, viewQueries: [{ propertyName: "source", first: true, predicate: CmatTransferPickerSourceComponent, descendants: true, isSignal: true }], exportAs: ["cmatTransferPicker"], ngImport: i0, template: "<cmat-transfer-picker-source></cmat-transfer-picker-source>\r\n<div class=\"cmat-transfer-picker-operation flex flex-col flex-nowrap gap-2 mx-2\">\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"pick()\">\r\n \u9009\u62E9<mat-icon svgIcon=\"mat_outline:chevron_right\"></mat-icon>\r\n </button>\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:chevron_left\"></mat-icon>\u91CD\u7F6E\r\n </button>\r\n</div>\r\n<cmat-transfer-picker-target [committedSelection]=\"committedSelection()\" (clearItemChange)=\"onClearItemChange($event)\">\r\n</cmat-transfer-picker-target>\r\n", styles: ["cmat-transfer-picker{height:100%;overflow:hidden;padding:1rem;display:flex;flex-wrap:nowrap;justify-items:center;align-items:center;gap:.5rem}cmat-transfer-picker cmat-transfer-picker-source,cmat-transfer-picker cmat-transfer-picker-target{height:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: CmatTransferPickerSourceComponent, selector: "cmat-transfer-picker-source", exportAs: ["cmatTransferPickerSource"] }, { kind: "component", type: CmatTransferPickerTargetComponent, selector: "cmat-transfer-picker-target", inputs: ["committedSelection"], outputs: ["clearItemChange"], exportAs: ["cmatTransferPickerTarget"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
585
- }
586
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTransferPickerComponent, decorators: [{
587
- type: Component,
588
- args: [{ selector: 'cmat-transfer-picker', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatTransferPicker', imports: [MatIconModule, MatButtonModule, CmatTransferPickerSourceComponent, CmatTransferPickerTargetComponent], template: "<cmat-transfer-picker-source></cmat-transfer-picker-source>\r\n<div class=\"cmat-transfer-picker-operation flex flex-col flex-nowrap gap-2 mx-2\">\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"pick()\">\r\n \u9009\u62E9<mat-icon svgIcon=\"mat_outline:chevron_right\"></mat-icon>\r\n </button>\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:chevron_left\"></mat-icon>\u91CD\u7F6E\r\n </button>\r\n</div>\r\n<cmat-transfer-picker-target [committedSelection]=\"committedSelection()\" (clearItemChange)=\"onClearItemChange($event)\">\r\n</cmat-transfer-picker-target>\r\n", styles: ["cmat-transfer-picker{height:100%;overflow:hidden;padding:1rem;display:flex;flex-wrap:nowrap;justify-items:center;align-items:center;gap:.5rem}cmat-transfer-picker cmat-transfer-picker-source,cmat-transfer-picker cmat-transfer-picker-target{height:100%}\n"] }]
589
- }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: false }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }], selectedValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedValues", required: false }] }], selectChange: [{ type: i0.Output, args: ["selectChange"] }], source: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CmatTransferPickerSourceComponent), { isSignal: true }] }] } });
590
-
591
- /**
592
- * Generated bundle index. Do not edit.
593
- */
594
-
608
+ var CmatTransferPickerSourceComponent = class CmatTransferPickerSourceComponent {
609
+ constructor() {
610
+ this.nestedNodeMap = /* @__PURE__ */ new Map();
611
+ this.dataFlatNodes = signal([], ...ngDevMode ? [{ debugName: "dataFlatNodes" }] : /* istanbul ignore next */ []);
612
+ this.checklistSelection = new SelectionModel(true);
613
+ this.committedSelection = signal([], ...ngDevMode ? [{ debugName: "committedSelection" }] : /* istanbul ignore next */ []);
614
+ this.committedValueSet = computed(() => new Set(this.committedSelection().map((node) => node.value)), ...ngDevMode ? [{ debugName: "committedValueSet" }] : /* istanbul ignore next */ []);
615
+ this._tree = viewChild("componentTree", ...ngDevMode ? [{ debugName: "_tree" }] : /* istanbul ignore next */ []);
616
+ this._flatNodeByValue = /* @__PURE__ */ new Map();
617
+ this._service = inject(CmatTransferPickerService);
618
+ this.dataSource = this._service.dataSourceChange;
619
+ this.refreshDataSourceChange = this._service.refreshDataSourceChange;
620
+ this.options = this._service.sourceOptionsChange;
621
+ this.selectedValuesChange = this._service.selectedValuesChange;
622
+ this.childrenAccessor = (node) => node.children ?? [];
623
+ this.hasChild = (_, node) => !!node.children && node.children.length > 0;
624
+ this._getLevel = (node) => node.level;
625
+ this._isExpandable = (node) => node.expandable;
626
+ this._getChildren = (node) => of(node.children ?? []);
627
+ this._transformer = (node, level) => {
628
+ const flatNode = this.nestedNodeMap.has(node) && this.nestedNodeMap.get(node)?.value === node.value ? this.nestedNodeMap.get(node) : new CmatTransferItemFlatNode();
629
+ flatNode.label = node.label;
630
+ flatNode.value = node.value;
631
+ flatNode.disabled = !!node.disabled;
632
+ flatNode.level = level;
633
+ flatNode.expandable = !!node.children;
634
+ this.nestedNodeMap.set(node, flatNode);
635
+ this._flatNodeByValue.set(node.value, flatNode);
636
+ return flatNode;
637
+ };
638
+ effect(() => {
639
+ const data = this.dataSource();
640
+ untracked(() => {
641
+ this._flatNodeByValue.clear();
642
+ this.dataFlatNodes.set(this._getFlattenNodes(data));
643
+ });
644
+ });
645
+ effect(() => {
646
+ const clear = this.refreshDataSourceChange();
647
+ untracked(() => {
648
+ if (clear) {
649
+ this.checklistSelection.clear();
650
+ this.committedSelection.set([]);
651
+ } else {
652
+ this._selectNodesByValues(this.checklistSelection.selected.map((node) => node.value));
653
+ this.commitSelection();
654
+ }
655
+ });
656
+ });
657
+ effect(() => {
658
+ const values = this.selectedValuesChange();
659
+ untracked(() => {
660
+ this._selectNodesByValues(values);
661
+ this.commitSelection();
662
+ });
663
+ });
664
+ }
665
+ ngAfterViewInit() {
666
+ this._tree()?.expandAll();
667
+ }
668
+ getCommittedSelection() {
669
+ return this.committedSelection();
670
+ }
671
+ commitSelection() {
672
+ this.committedSelection.set(this._cloneFlatNodes(this.checklistSelection.selected));
673
+ return this.committedSelection();
674
+ }
675
+ resetSelectedItem(item) {
676
+ const target = this._flatNodeByValue.get(item.value) ?? this.checklistSelection.selected.find((i) => i.value === item.value);
677
+ if (!target) return;
678
+ const descendants = this._getDescendants(target);
679
+ this.checklistSelection.deselect(target, ...descendants.filter((node) => this.checklistSelection.isSelected(node)));
680
+ this._checkAllParentsSelection(target);
681
+ this.commitSelection();
682
+ }
683
+ descendantsAllSelected(node) {
684
+ return this._getDescendants(node).every((child) => this.checklistSelection.isSelected(child));
685
+ }
686
+ descendantsPartiallySelected(node) {
687
+ return this._getDescendants(node).some((child) => this.checklistSelection.isSelected(child)) && !this.descendantsAllSelected(node);
688
+ }
689
+ transferItemSelectionToggle(node) {
690
+ this.checklistSelection.toggle(node);
691
+ let descendants = this._getDescendants(node);
692
+ descendants = descendants.filter((n) => !this.isNodeDisabled(n));
693
+ this.checklistSelection.isSelected(node) ? this.checklistSelection.select(...descendants) : this.checklistSelection.deselect(...descendants);
694
+ descendants.every((child) => this.checklistSelection.isSelected(child));
695
+ this._checkAllParentsSelection(node);
696
+ }
697
+ transferLeafItemSelectionToggle(node) {
698
+ this.checklistSelection.toggle(node);
699
+ this._checkAllParentsSelection(node);
700
+ }
701
+ isNodeDisabled(node) {
702
+ return !!node.disabled || this.committedValueSet().has(node.value);
703
+ }
704
+ _getDescendants(dataNode) {
705
+ const flatNodes = this.dataFlatNodes();
706
+ const startIndex = flatNodes.findIndex((j) => j === dataNode);
707
+ const results = [];
708
+ for (let i = startIndex + 1; i < flatNodes.length && this._getLevel(dataNode) < this._getLevel(flatNodes[i]); i++) results.push(flatNodes[i]);
709
+ return results;
710
+ }
711
+ _getFlattenNodes(nodes, i = 0) {
712
+ const flattenedNodes = [];
713
+ for (const node of nodes) {
714
+ flattenedNodes.push(this._transformer(node, i));
715
+ if (node.children) flattenedNodes.push(...this._getFlattenNodes(node.children, i + 1));
716
+ }
717
+ return flattenedNodes;
718
+ }
719
+ _checkAllParentsSelection(node) {
720
+ let parent = this._getParentNode(node);
721
+ while (parent) {
722
+ this._checkRootNodeSelection(parent);
723
+ parent = this._getParentNode(parent);
724
+ }
725
+ }
726
+ _checkRootNodeSelection(node) {
727
+ const nodeSelected = this.checklistSelection.isSelected(node);
728
+ const descAllSelected = this._getDescendants(node).every((child) => this.checklistSelection.isSelected(child));
729
+ if (nodeSelected && !descAllSelected) this.checklistSelection.deselect(node);
730
+ else if (!nodeSelected && descAllSelected) this.checklistSelection.select(node);
731
+ }
732
+ _cloneFlatNode(node) {
733
+ return {
734
+ label: node.label,
735
+ value: node.value,
736
+ level: node.level,
737
+ disabled: node.disabled,
738
+ expandable: node.expandable
739
+ };
740
+ }
741
+ _cloneFlatNodes(nodes) {
742
+ return nodes.map((node) => this._cloneFlatNode(node));
743
+ }
744
+ _getParentNode(node) {
745
+ const currentLevel = this._getLevel(node);
746
+ const flatNodes = this.dataFlatNodes();
747
+ if (currentLevel < 1) return null;
748
+ const startIndex = flatNodes.findIndex((j) => j === node) - 1;
749
+ for (let i = startIndex; i >= 0; i--) {
750
+ const currentNode = flatNodes[i];
751
+ if (this._getLevel(currentNode) < currentLevel) return currentNode;
752
+ }
753
+ return null;
754
+ }
755
+ _selectNodesByValues(values) {
756
+ this.checklistSelection.clear();
757
+ for (const value of values) {
758
+ const node = this._flatNodeByValue.get(value);
759
+ if (node) this.checklistSelection.select(node);
760
+ }
761
+ }
762
+ static {
763
+ this.ɵfac = i0.ɵɵngDeclareFactory({
764
+ minVersion: "12.0.0",
765
+ version: "22.2.3",
766
+ ngImport: i0,
767
+ type: CmatTransferPickerSourceComponent,
768
+ deps: [],
769
+ target: i0.ɵɵFactoryTarget.Component
770
+ });
771
+ }
772
+ static {
773
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
774
+ minVersion: "17.0.0",
775
+ version: "22.2.3",
776
+ type: CmatTransferPickerSourceComponent,
777
+ isStandalone: true,
778
+ selector: "cmat-transfer-picker-source",
779
+ viewQueries: [{
780
+ propertyName: "_tree",
781
+ first: true,
782
+ predicate: ["componentTree"],
783
+ descendants: true,
784
+ isSignal: true
785
+ }],
786
+ exportAs: ["cmatTransferPickerSource"],
787
+ ngImport: i0,
788
+ template: "<mat-card class=\"transfer-picker-source shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-source-title\">{{options()?.title}}</mat-card-title>\r\n @if (options()?.filterable) {\r\n <cmat-transfer-picker-filter\r\n [filters]=\"options()?.filters\"></cmat-transfer-picker-filter>\r\n }\r\n </mat-card-header>\r\n <mat-card-content class=\"transfer-picker-source-content\">\r\n @if (options()?.searchable) {\r\n <cmat-transfer-picker-search\r\n [searchPlaceholder]=\"options()?.searchPlaceholder\"></cmat-transfer-picker-search>\r\n }\r\n\r\n <cdk-virtual-scroll-viewport itemSize=\"48\"\r\n class=\"transfer-picker-source-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-tree #componentTree [dataSource]=\"dataSource()\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton disabled> </button>\r\n <mat-checkbox class=\"checklist-leaf-node\" [checked]=\"checklistSelection.isSelected(nestedNodeMap.get(node)!)\"\r\n [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\" (change)=\"transferLeafItemSelectionToggle(nestedNodeMap.get(node)!);\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle>\r\n <mat-icon svgIcon=\"{{componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'}}\"\r\n class=\"mat-icon-rtl-mirror\">\r\n </mat-icon>\r\n </button>\r\n <mat-checkbox [checked]=\"descendantsAllSelected(nestedNodeMap.get(node)!)||committedValueSet().has(nestedNodeMap.get(node)!.value)\"\r\n [indeterminate]=\"descendantsPartiallySelected(nestedNodeMap.get(node)!)\" [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\"\r\n (change)=\"transferItemSelectionToggle(nestedNodeMap.get(node)!)\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n </mat-tree>\r\n @if (!dataSource().length) {\r\n <div class=\"transfer-picker-source-empty\">暂无数据</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n",
789
+ styles: [".transfer-picker-source{width:276px;height:100%;padding:0}.transfer-picker-source .mat-mdc-card-header{display:flex;flex-direction:row;flex-wrap:nowrap;box-sizing:border-box;place-content:space-between;align-items:flex-start;margin-bottom:-8px}.transfer-picker-source-title{font-size:1rem;margin-bottom:0}.transfer-picker-source-scroll-wrapper{height:300px}.transfer-picker-source-empty{text-align:center;font-size:1rem;margin-top:20px;color:#00000040}\n"],
790
+ dependencies: [
791
+ {
792
+ kind: "ngmodule",
793
+ type: MatCardModule
794
+ },
795
+ {
796
+ kind: "component",
797
+ type: i1.MatCard,
798
+ selector: "mat-card",
799
+ inputs: ["appearance"],
800
+ exportAs: ["matCard"]
801
+ },
802
+ {
803
+ kind: "directive",
804
+ type: i1.MatCardContent,
805
+ selector: "mat-card-content"
806
+ },
807
+ {
808
+ kind: "component",
809
+ type: i1.MatCardHeader,
810
+ selector: "mat-card-header"
811
+ },
812
+ {
813
+ kind: "directive",
814
+ type: i1.MatCardTitle,
815
+ selector: "mat-card-title, [mat-card-title], [matCardTitle]"
816
+ },
817
+ {
818
+ kind: "ngmodule",
819
+ type: MatTreeModule
820
+ },
821
+ {
822
+ kind: "directive",
823
+ type: i2$1.MatTreeNodeDef,
824
+ selector: "[matTreeNodeDef]",
825
+ inputs: ["matTreeNodeDefWhen", "matTreeNode"]
826
+ },
827
+ {
828
+ kind: "directive",
829
+ type: i2$1.MatTreeNodePadding,
830
+ selector: "[matTreeNodePadding]",
831
+ inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"]
832
+ },
833
+ {
834
+ kind: "directive",
835
+ type: i2$1.MatTreeNodeToggle,
836
+ selector: "[matTreeNodeToggle]",
837
+ inputs: ["matTreeNodeToggleRecursive"]
838
+ },
839
+ {
840
+ kind: "component",
841
+ type: i2$1.MatTree,
842
+ selector: "mat-tree",
843
+ exportAs: ["matTree"]
844
+ },
845
+ {
846
+ kind: "directive",
847
+ type: i2$1.MatTreeNode,
848
+ selector: "mat-tree-node",
849
+ inputs: ["tabIndex", "disabled"],
850
+ outputs: ["activation", "expandedChange"],
851
+ exportAs: ["matTreeNode"]
852
+ },
853
+ {
854
+ kind: "ngmodule",
855
+ type: MatCheckboxModule
856
+ },
857
+ {
858
+ kind: "component",
859
+ type: i3.MatCheckbox,
860
+ selector: "mat-checkbox",
861
+ inputs: [
862
+ "aria-label",
863
+ "aria-labelledby",
864
+ "aria-describedby",
865
+ "aria-expanded",
866
+ "aria-controls",
867
+ "aria-owns",
868
+ "id",
869
+ "required",
870
+ "labelPosition",
871
+ "name",
872
+ "value",
873
+ "disableRipple",
874
+ "tabIndex",
875
+ "color",
876
+ "disabledInteractive",
877
+ "checked",
878
+ "disabled",
879
+ "indeterminate"
880
+ ],
881
+ outputs: ["change", "indeterminateChange"],
882
+ exportAs: ["matCheckbox"]
883
+ },
884
+ {
885
+ kind: "ngmodule",
886
+ type: MatIconModule
887
+ },
888
+ {
889
+ kind: "component",
890
+ type: i2$2.MatIcon,
891
+ selector: "mat-icon",
892
+ inputs: [
893
+ "color",
894
+ "inline",
895
+ "svgIcon",
896
+ "fontSet",
897
+ "fontIcon"
898
+ ],
899
+ exportAs: ["matIcon"]
900
+ },
901
+ {
902
+ kind: "ngmodule",
903
+ type: MatButtonModule
904
+ },
905
+ {
906
+ kind: "component",
907
+ type: i5$1.MatIconButton,
908
+ selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
909
+ exportAs: ["matButton", "matAnchor"]
910
+ },
911
+ {
912
+ kind: "component",
913
+ type: CmatTransferPickerFilterComponent,
914
+ selector: "cmat-transfer-picker-filter",
915
+ inputs: ["filters"],
916
+ exportAs: ["cmatTransferPickerFilter"]
917
+ },
918
+ {
919
+ kind: "component",
920
+ type: CmatTransferPickerSearchComponent,
921
+ selector: "cmat-transfer-picker-search",
922
+ inputs: ["searchPlaceholder"],
923
+ exportAs: ["cmatTransferPickerSearch"]
924
+ },
925
+ {
926
+ kind: "ngmodule",
927
+ type: ScrollingModule
928
+ },
929
+ {
930
+ kind: "directive",
931
+ type: i6.ɵɵCdkFixedSizeVirtualScroll,
932
+ selector: "cdk-virtual-scroll-viewport[itemSize]",
933
+ inputs: [
934
+ "itemSize",
935
+ "minBufferPx",
936
+ "maxBufferPx"
937
+ ]
938
+ },
939
+ {
940
+ kind: "component",
941
+ type: i6.ɵɵCdkVirtualScrollViewport,
942
+ selector: "cdk-virtual-scroll-viewport",
943
+ inputs: ["orientation", "appendOnly"],
944
+ outputs: ["scrolledIndexChange"]
945
+ }
946
+ ],
947
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
948
+ encapsulation: i0.ViewEncapsulation.None
949
+ });
950
+ }
951
+ };
952
+ i0.ɵɵngDeclareClassMetadata({
953
+ minVersion: "12.0.0",
954
+ version: "22.2.3",
955
+ ngImport: i0,
956
+ type: CmatTransferPickerSourceComponent,
957
+ decorators: [{
958
+ type: Component,
959
+ args: [{
960
+ selector: "cmat-transfer-picker-source",
961
+ encapsulation: ViewEncapsulation.None,
962
+ changeDetection: ChangeDetectionStrategy.OnPush,
963
+ exportAs: "cmatTransferPickerSource",
964
+ imports: [
965
+ MatCardModule,
966
+ MatTreeModule,
967
+ MatCheckboxModule,
968
+ MatIconModule,
969
+ MatButtonModule,
970
+ CmatTransferPickerFilterComponent,
971
+ CmatTransferPickerSearchComponent,
972
+ ScrollingModule
973
+ ],
974
+ template: "<mat-card class=\"transfer-picker-source shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-source-title\">{{options()?.title}}</mat-card-title>\r\n @if (options()?.filterable) {\r\n <cmat-transfer-picker-filter\r\n [filters]=\"options()?.filters\"></cmat-transfer-picker-filter>\r\n }\r\n </mat-card-header>\r\n <mat-card-content class=\"transfer-picker-source-content\">\r\n @if (options()?.searchable) {\r\n <cmat-transfer-picker-search\r\n [searchPlaceholder]=\"options()?.searchPlaceholder\"></cmat-transfer-picker-search>\r\n }\r\n\r\n <cdk-virtual-scroll-viewport itemSize=\"48\"\r\n class=\"transfer-picker-source-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-tree #componentTree [dataSource]=\"dataSource()\" [childrenAccessor]=\"childrenAccessor\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton disabled> </button>\r\n <mat-checkbox class=\"checklist-leaf-node\" [checked]=\"checklistSelection.isSelected(nestedNodeMap.get(node)!)\"\r\n [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\" (change)=\"transferLeafItemSelectionToggle(nestedNodeMap.get(node)!);\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" [matTreeNodePadding]=\"nestedNodeMap.get(node)?.level\">\r\n <button type=\"button\" matIconButton matTreeNodeToggle>\r\n <mat-icon svgIcon=\"{{componentTree.isExpanded(node) ? 'mat_outline:expand_more' : 'mat_outline:chevron_right'}}\"\r\n class=\"mat-icon-rtl-mirror\">\r\n </mat-icon>\r\n </button>\r\n <mat-checkbox [checked]=\"descendantsAllSelected(nestedNodeMap.get(node)!)||committedValueSet().has(nestedNodeMap.get(node)!.value)\"\r\n [indeterminate]=\"descendantsPartiallySelected(nestedNodeMap.get(node)!)\" [disabled]=\"isNodeDisabled(nestedNodeMap.get(node)!)\"\r\n (change)=\"transferItemSelectionToggle(nestedNodeMap.get(node)!)\">\r\n {{node.label}}\r\n </mat-checkbox>\r\n </mat-tree-node>\r\n </mat-tree>\r\n @if (!dataSource().length) {\r\n <div class=\"transfer-picker-source-empty\">暂无数据</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n",
975
+ styles: [".transfer-picker-source{width:276px;height:100%;padding:0}.transfer-picker-source .mat-mdc-card-header{display:flex;flex-direction:row;flex-wrap:nowrap;box-sizing:border-box;place-content:space-between;align-items:flex-start;margin-bottom:-8px}.transfer-picker-source-title{font-size:1rem;margin-bottom:0}.transfer-picker-source-scroll-wrapper{height:300px}.transfer-picker-source-empty{text-align:center;font-size:1rem;margin-top:20px;color:#00000040}\n"]
976
+ }]
977
+ }],
978
+ ctorParameters: () => [],
979
+ propDecorators: { _tree: [{
980
+ type: i0.ViewChild,
981
+ args: ["componentTree", { isSignal: true }]
982
+ }] }
983
+ });
984
+ var CmatTransferPickerTargetComponent = class CmatTransferPickerTargetComponent {
985
+ constructor() {
986
+ this.committedSelection = input([], ...ngDevMode ? [{ debugName: "committedSelection" }] : /* istanbul ignore next */ []);
987
+ this.clearItemChange = output();
988
+ }
989
+ clearItem(item) {
990
+ this.clearItemChange.emit(item);
991
+ }
992
+ static {
993
+ this.ɵfac = i0.ɵɵngDeclareFactory({
994
+ minVersion: "12.0.0",
995
+ version: "22.2.3",
996
+ ngImport: i0,
997
+ type: CmatTransferPickerTargetComponent,
998
+ deps: [],
999
+ target: i0.ɵɵFactoryTarget.Component
1000
+ });
1001
+ }
1002
+ static {
1003
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1004
+ minVersion: "17.0.0",
1005
+ version: "22.2.3",
1006
+ type: CmatTransferPickerTargetComponent,
1007
+ isStandalone: true,
1008
+ selector: "cmat-transfer-picker-target",
1009
+ inputs: { committedSelection: {
1010
+ classPropertyName: "committedSelection",
1011
+ publicName: "committedSelection",
1012
+ isSignal: true,
1013
+ isRequired: false,
1014
+ transformFunction: null
1015
+ } },
1016
+ outputs: { clearItemChange: "clearItemChange" },
1017
+ exportAs: ["cmatTransferPickerTarget"],
1018
+ ngImport: i0,
1019
+ template: "<mat-card class=\"transfer-picker-target shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-target-title\">已选择 {{committedSelection().length}} 项</mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <cdk-virtual-scroll-viewport itemSize=\"40\"\r\n class=\"transfer-picker-target-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-list dense>\r\n @for (item of committedSelection(); track $index) {\r\n <mat-list-item class=\"transfer-picker-target-item\">\r\n <div mat-line class=\"flex flex-row items-center\">\r\n <div class=\"flex-1\">{{item.label}}</div>\r\n <button type=\"button\" matIconButton (click)=\"clearItem(item)\">\r\n <mat-icon svgIcon=\"heroicons_solid:x-circle\"></mat-icon>\r\n </button>\r\n </div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n @if (!committedSelection().length) {\r\n <div class=\"transfer-picker-target-empty\">暂无数据</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n",
1020
+ styles: [".transfer-picker-target{height:100%;padding:0;width:276px}.transfer-picker-target .mat-mdc-card-header{margin-bottom:-8px}.transfer-picker-target-title{font-size:1rem;margin-bottom:0;padding:12px 0}.transfer-picker-target-item{width:100%}.transfer-picker-target-scroll-wrapper{height:356px}.transfer-picker-target-empty{text-align:center;margin-top:20px;color:#00000040}\n"],
1021
+ dependencies: [
1022
+ {
1023
+ kind: "ngmodule",
1024
+ type: MatCardModule
1025
+ },
1026
+ {
1027
+ kind: "component",
1028
+ type: i1.MatCard,
1029
+ selector: "mat-card",
1030
+ inputs: ["appearance"],
1031
+ exportAs: ["matCard"]
1032
+ },
1033
+ {
1034
+ kind: "directive",
1035
+ type: i1.MatCardContent,
1036
+ selector: "mat-card-content"
1037
+ },
1038
+ {
1039
+ kind: "component",
1040
+ type: i1.MatCardHeader,
1041
+ selector: "mat-card-header"
1042
+ },
1043
+ {
1044
+ kind: "directive",
1045
+ type: i1.MatCardTitle,
1046
+ selector: "mat-card-title, [mat-card-title], [matCardTitle]"
1047
+ },
1048
+ {
1049
+ kind: "ngmodule",
1050
+ type: MatListModule
1051
+ },
1052
+ {
1053
+ kind: "component",
1054
+ type: i2.MatList,
1055
+ selector: "mat-list",
1056
+ exportAs: ["matList"]
1057
+ },
1058
+ {
1059
+ kind: "component",
1060
+ type: i2.MatListItem,
1061
+ selector: "mat-list-item, a[mat-list-item], button[mat-list-item]",
1062
+ inputs: ["activated"],
1063
+ exportAs: ["matListItem"]
1064
+ },
1065
+ {
1066
+ kind: "ngmodule",
1067
+ type: MatIconModule
1068
+ },
1069
+ {
1070
+ kind: "component",
1071
+ type: i2$2.MatIcon,
1072
+ selector: "mat-icon",
1073
+ inputs: [
1074
+ "color",
1075
+ "inline",
1076
+ "svgIcon",
1077
+ "fontSet",
1078
+ "fontIcon"
1079
+ ],
1080
+ exportAs: ["matIcon"]
1081
+ },
1082
+ {
1083
+ kind: "ngmodule",
1084
+ type: ScrollingModule
1085
+ },
1086
+ {
1087
+ kind: "directive",
1088
+ type: i6.ɵɵCdkFixedSizeVirtualScroll,
1089
+ selector: "cdk-virtual-scroll-viewport[itemSize]",
1090
+ inputs: [
1091
+ "itemSize",
1092
+ "minBufferPx",
1093
+ "maxBufferPx"
1094
+ ]
1095
+ },
1096
+ {
1097
+ kind: "component",
1098
+ type: i6.ɵɵCdkVirtualScrollViewport,
1099
+ selector: "cdk-virtual-scroll-viewport",
1100
+ inputs: ["orientation", "appendOnly"],
1101
+ outputs: ["scrolledIndexChange"]
1102
+ },
1103
+ {
1104
+ kind: "ngmodule",
1105
+ type: MatButtonModule
1106
+ },
1107
+ {
1108
+ kind: "component",
1109
+ type: i5$1.MatIconButton,
1110
+ selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
1111
+ exportAs: ["matButton", "matAnchor"]
1112
+ }
1113
+ ],
1114
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1115
+ encapsulation: i0.ViewEncapsulation.None
1116
+ });
1117
+ }
1118
+ };
1119
+ i0.ɵɵngDeclareClassMetadata({
1120
+ minVersion: "12.0.0",
1121
+ version: "22.2.3",
1122
+ ngImport: i0,
1123
+ type: CmatTransferPickerTargetComponent,
1124
+ decorators: [{
1125
+ type: Component,
1126
+ args: [{
1127
+ selector: "cmat-transfer-picker-target",
1128
+ encapsulation: ViewEncapsulation.None,
1129
+ changeDetection: ChangeDetectionStrategy.OnPush,
1130
+ exportAs: "cmatTransferPickerTarget",
1131
+ imports: [
1132
+ MatCardModule,
1133
+ MatListModule,
1134
+ MatIconModule,
1135
+ ScrollingModule,
1136
+ MatButtonModule
1137
+ ],
1138
+ template: "<mat-card class=\"transfer-picker-target shadow\">\r\n <mat-card-header class=\"pb-3 items-center\">\r\n <mat-card-title class=\"transfer-picker-target-title\">已选择 {{committedSelection().length}} 项</mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <cdk-virtual-scroll-viewport itemSize=\"40\"\r\n class=\"transfer-picker-target-scroll-wrapper overflow-y-auto scrollbar-custom\">\r\n <mat-list dense>\r\n @for (item of committedSelection(); track $index) {\r\n <mat-list-item class=\"transfer-picker-target-item\">\r\n <div mat-line class=\"flex flex-row items-center\">\r\n <div class=\"flex-1\">{{item.label}}</div>\r\n <button type=\"button\" matIconButton (click)=\"clearItem(item)\">\r\n <mat-icon svgIcon=\"heroicons_solid:x-circle\"></mat-icon>\r\n </button>\r\n </div>\r\n </mat-list-item>\r\n }\r\n </mat-list>\r\n @if (!committedSelection().length) {\r\n <div class=\"transfer-picker-target-empty\">暂无数据</div>\r\n }\r\n </cdk-virtual-scroll-viewport>\r\n </mat-card-content>\r\n</mat-card>\r\n",
1139
+ styles: [".transfer-picker-target{height:100%;padding:0;width:276px}.transfer-picker-target .mat-mdc-card-header{margin-bottom:-8px}.transfer-picker-target-title{font-size:1rem;margin-bottom:0;padding:12px 0}.transfer-picker-target-item{width:100%}.transfer-picker-target-scroll-wrapper{height:356px}.transfer-picker-target-empty{text-align:center;margin-top:20px;color:#00000040}\n"]
1140
+ }]
1141
+ }],
1142
+ propDecorators: {
1143
+ committedSelection: [{
1144
+ type: i0.Input,
1145
+ args: [{
1146
+ isSignal: true,
1147
+ alias: "committedSelection",
1148
+ required: false
1149
+ }]
1150
+ }],
1151
+ clearItemChange: [{
1152
+ type: i0.Output,
1153
+ args: ["clearItemChange"]
1154
+ }]
1155
+ }
1156
+ });
1157
+ var CmatTransferPickerComponent = class CmatTransferPickerComponent {
1158
+ constructor() {
1159
+ this.title = input(...ngDevMode ? [void 0, { debugName: "title" }] : /* istanbul ignore next */ []);
1160
+ this.filterable = input(true, ...ngDevMode ? [{ debugName: "filterable" }] : /* istanbul ignore next */ []);
1161
+ this.searchable = input(false, ...ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []);
1162
+ this.searchPlaceholder = input("请输入关键字", ...ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []);
1163
+ this.dataSource = input([], ...ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []);
1164
+ this.filters = input([], ...ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []);
1165
+ this.selectedValues = input([], ...ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []);
1166
+ this.selectChange = output();
1167
+ this.committedSelection = signal([], ...ngDevMode ? [{ debugName: "committedSelection" }] : /* istanbul ignore next */ []);
1168
+ this.source = viewChild.required(CmatTransferPickerSourceComponent, ...ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []);
1169
+ this._service = inject(CmatTransferPickerService);
1170
+ this._injector = inject(Injector);
1171
+ }
1172
+ ngOnInit() {
1173
+ this._service.dataSource = this.dataSource();
1174
+ this._service.selectedValues = this.selectedValues();
1175
+ this._service.sourceOptions = {
1176
+ title: this.title() ?? "数据源",
1177
+ filterable: this.filterable() || true,
1178
+ searchable: this.searchable() || true,
1179
+ searchPlaceholder: this.searchPlaceholder() || "搜索关键字",
1180
+ filters: this.filters() || []
1181
+ };
1182
+ }
1183
+ ngAfterViewInit() {
1184
+ if (this.selectedValues().length) afterNextRender(() => {
1185
+ this.pick();
1186
+ }, { injector: this._injector });
1187
+ }
1188
+ pick() {
1189
+ this._commitSelection(this.source().commitSelection());
1190
+ }
1191
+ reset() {
1192
+ if (this.committedSelection().length) {
1193
+ this._commitSelection([]);
1194
+ this._service.resetDataSource(true);
1195
+ }
1196
+ }
1197
+ onClearItemChange(item) {
1198
+ if (item) {
1199
+ this.source().resetSelectedItem(item);
1200
+ this._commitSelection(this.source().getCommittedSelection());
1201
+ }
1202
+ }
1203
+ _commitSelection(selectedList) {
1204
+ this.committedSelection.set([...selectedList]);
1205
+ this._emitterChange();
1206
+ }
1207
+ _emitterChange() {
1208
+ this.selectChange.emit(this.committedSelection());
1209
+ }
1210
+ static {
1211
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1212
+ minVersion: "12.0.0",
1213
+ version: "22.2.3",
1214
+ ngImport: i0,
1215
+ type: CmatTransferPickerComponent,
1216
+ deps: [],
1217
+ target: i0.ɵɵFactoryTarget.Component
1218
+ });
1219
+ }
1220
+ static {
1221
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1222
+ minVersion: "17.2.0",
1223
+ version: "22.2.3",
1224
+ type: CmatTransferPickerComponent,
1225
+ isStandalone: true,
1226
+ selector: "cmat-transfer-picker",
1227
+ inputs: {
1228
+ title: {
1229
+ classPropertyName: "title",
1230
+ publicName: "title",
1231
+ isSignal: true,
1232
+ isRequired: false,
1233
+ transformFunction: null
1234
+ },
1235
+ filterable: {
1236
+ classPropertyName: "filterable",
1237
+ publicName: "filterable",
1238
+ isSignal: true,
1239
+ isRequired: false,
1240
+ transformFunction: null
1241
+ },
1242
+ searchable: {
1243
+ classPropertyName: "searchable",
1244
+ publicName: "searchable",
1245
+ isSignal: true,
1246
+ isRequired: false,
1247
+ transformFunction: null
1248
+ },
1249
+ searchPlaceholder: {
1250
+ classPropertyName: "searchPlaceholder",
1251
+ publicName: "searchPlaceholder",
1252
+ isSignal: true,
1253
+ isRequired: false,
1254
+ transformFunction: null
1255
+ },
1256
+ dataSource: {
1257
+ classPropertyName: "dataSource",
1258
+ publicName: "dataSource",
1259
+ isSignal: true,
1260
+ isRequired: false,
1261
+ transformFunction: null
1262
+ },
1263
+ filters: {
1264
+ classPropertyName: "filters",
1265
+ publicName: "filters",
1266
+ isSignal: true,
1267
+ isRequired: false,
1268
+ transformFunction: null
1269
+ },
1270
+ selectedValues: {
1271
+ classPropertyName: "selectedValues",
1272
+ publicName: "selectedValues",
1273
+ isSignal: true,
1274
+ isRequired: false,
1275
+ transformFunction: null
1276
+ }
1277
+ },
1278
+ outputs: { selectChange: "selectChange" },
1279
+ viewQueries: [{
1280
+ propertyName: "source",
1281
+ first: true,
1282
+ predicate: CmatTransferPickerSourceComponent,
1283
+ descendants: true,
1284
+ isSignal: true
1285
+ }],
1286
+ exportAs: ["cmatTransferPicker"],
1287
+ ngImport: i0,
1288
+ template: "<cmat-transfer-picker-source></cmat-transfer-picker-source>\r\n<div class=\"cmat-transfer-picker-operation flex flex-col flex-nowrap gap-2 mx-2\">\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"pick()\">\r\n 选择<mat-icon svgIcon=\"mat_outline:chevron_right\"></mat-icon>\r\n </button>\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:chevron_left\"></mat-icon>重置\r\n </button>\r\n</div>\r\n<cmat-transfer-picker-target [committedSelection]=\"committedSelection()\" (clearItemChange)=\"onClearItemChange($event)\">\r\n</cmat-transfer-picker-target>\r\n",
1289
+ styles: ["cmat-transfer-picker{height:100%;overflow:hidden;padding:1rem;display:flex;flex-wrap:nowrap;justify-items:center;align-items:center;gap:.5rem}cmat-transfer-picker cmat-transfer-picker-source,cmat-transfer-picker cmat-transfer-picker-target{height:100%}\n"],
1290
+ dependencies: [
1291
+ {
1292
+ kind: "ngmodule",
1293
+ type: MatIconModule
1294
+ },
1295
+ {
1296
+ kind: "component",
1297
+ type: i2$2.MatIcon,
1298
+ selector: "mat-icon",
1299
+ inputs: [
1300
+ "color",
1301
+ "inline",
1302
+ "svgIcon",
1303
+ "fontSet",
1304
+ "fontIcon"
1305
+ ],
1306
+ exportAs: ["matIcon"]
1307
+ },
1308
+ {
1309
+ kind: "ngmodule",
1310
+ type: MatButtonModule
1311
+ },
1312
+ {
1313
+ kind: "component",
1314
+ type: i5$1.MatButton,
1315
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
1316
+ inputs: ["matButton"],
1317
+ exportAs: ["matButton", "matAnchor"]
1318
+ },
1319
+ {
1320
+ kind: "component",
1321
+ type: CmatTransferPickerSourceComponent,
1322
+ selector: "cmat-transfer-picker-source",
1323
+ exportAs: ["cmatTransferPickerSource"]
1324
+ },
1325
+ {
1326
+ kind: "component",
1327
+ type: CmatTransferPickerTargetComponent,
1328
+ selector: "cmat-transfer-picker-target",
1329
+ inputs: ["committedSelection"],
1330
+ outputs: ["clearItemChange"],
1331
+ exportAs: ["cmatTransferPickerTarget"]
1332
+ }
1333
+ ],
1334
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1335
+ encapsulation: i0.ViewEncapsulation.None
1336
+ });
1337
+ }
1338
+ };
1339
+ i0.ɵɵngDeclareClassMetadata({
1340
+ minVersion: "12.0.0",
1341
+ version: "22.2.3",
1342
+ ngImport: i0,
1343
+ type: CmatTransferPickerComponent,
1344
+ decorators: [{
1345
+ type: Component,
1346
+ args: [{
1347
+ selector: "cmat-transfer-picker",
1348
+ encapsulation: ViewEncapsulation.None,
1349
+ changeDetection: ChangeDetectionStrategy.OnPush,
1350
+ exportAs: "cmatTransferPicker",
1351
+ imports: [
1352
+ MatIconModule,
1353
+ MatButtonModule,
1354
+ CmatTransferPickerSourceComponent,
1355
+ CmatTransferPickerTargetComponent
1356
+ ],
1357
+ template: "<cmat-transfer-picker-source></cmat-transfer-picker-source>\r\n<div class=\"cmat-transfer-picker-operation flex flex-col flex-nowrap gap-2 mx-2\">\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"pick()\">\r\n 选择<mat-icon svgIcon=\"mat_outline:chevron_right\"></mat-icon>\r\n </button>\r\n <button type=\"button\" class=\"pl-2\" matButton=\"filled\" color=\"primary\" (click)=\"reset()\">\r\n <mat-icon svgIcon=\"mat_outline:chevron_left\"></mat-icon>重置\r\n </button>\r\n</div>\r\n<cmat-transfer-picker-target [committedSelection]=\"committedSelection()\" (clearItemChange)=\"onClearItemChange($event)\">\r\n</cmat-transfer-picker-target>\r\n",
1358
+ styles: ["cmat-transfer-picker{height:100%;overflow:hidden;padding:1rem;display:flex;flex-wrap:nowrap;justify-items:center;align-items:center;gap:.5rem}cmat-transfer-picker cmat-transfer-picker-source,cmat-transfer-picker cmat-transfer-picker-target{height:100%}\n"]
1359
+ }]
1360
+ }],
1361
+ propDecorators: {
1362
+ title: [{
1363
+ type: i0.Input,
1364
+ args: [{
1365
+ isSignal: true,
1366
+ alias: "title",
1367
+ required: false
1368
+ }]
1369
+ }],
1370
+ filterable: [{
1371
+ type: i0.Input,
1372
+ args: [{
1373
+ isSignal: true,
1374
+ alias: "filterable",
1375
+ required: false
1376
+ }]
1377
+ }],
1378
+ searchable: [{
1379
+ type: i0.Input,
1380
+ args: [{
1381
+ isSignal: true,
1382
+ alias: "searchable",
1383
+ required: false
1384
+ }]
1385
+ }],
1386
+ searchPlaceholder: [{
1387
+ type: i0.Input,
1388
+ args: [{
1389
+ isSignal: true,
1390
+ alias: "searchPlaceholder",
1391
+ required: false
1392
+ }]
1393
+ }],
1394
+ dataSource: [{
1395
+ type: i0.Input,
1396
+ args: [{
1397
+ isSignal: true,
1398
+ alias: "dataSource",
1399
+ required: false
1400
+ }]
1401
+ }],
1402
+ filters: [{
1403
+ type: i0.Input,
1404
+ args: [{
1405
+ isSignal: true,
1406
+ alias: "filters",
1407
+ required: false
1408
+ }]
1409
+ }],
1410
+ selectedValues: [{
1411
+ type: i0.Input,
1412
+ args: [{
1413
+ isSignal: true,
1414
+ alias: "selectedValues",
1415
+ required: false
1416
+ }]
1417
+ }],
1418
+ selectChange: [{
1419
+ type: i0.Output,
1420
+ args: ["selectChange"]
1421
+ }],
1422
+ source: [{
1423
+ type: i0.ViewChild,
1424
+ args: [i0.forwardRef(() => CmatTransferPickerSourceComponent), { isSignal: true }]
1425
+ }]
1426
+ }
1427
+ });
595
1428
  export { CmatTransferFilterCondition, CmatTransferItemFlatNode, CmatTransferItemNode, CmatTransferPickerComponent, CmatTransferPickerFilterComponent, CmatTransferPickerSearchComponent, CmatTransferPickerService, CmatTransferPickerSourceComponent, CmatTransferPickerTargetComponent };
596
- //# sourceMappingURL=cmat-components-transfer-picker.mjs.map
1429
+
1430
+ //# sourceMappingURL=cmat-components-transfer-picker.mjs.map