cmat 0.0.111 → 0.0.113

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 +2761 -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 +1138 -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 +1 @@
1
- {"version":3,"file":"cmat-services-print.mjs","sources":["../../../projects/cmat/services/print/print.service.ts","../../../projects/cmat/services/print/cmat-services-print.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { CmatPrintOptions } from './print.types';\r\n\r\n/** 打印覆盖样式:最小干预,保留页面原始视觉效果 */\r\nconst PRINT_OVERRIDE_CSS = `\r\n @page { size: A4 var(--orientation); margin: var(--margins); }\r\n\r\n /* 强制亮色背景 */\r\n html, body {\r\n background: #fff !important;\r\n color-scheme: light !important;\r\n }\r\n body {\r\n margin: 0 !important;\r\n padding: 16px !important;\r\n overflow: visible !important;\r\n height: auto !important;\r\n min-height: auto !important;\r\n box-sizing: border-box !important;\r\n -webkit-print-color-adjust: exact;\r\n print-color-adjust: exact;\r\n }\r\n /* 打印内容主体:约束到页面宽度,防止子元素溢出 */\r\n .cmat-print-body {\r\n max-width: 100% !important;\r\n box-sizing: border-box !important;\r\n }\r\n /* 打印内容 flex 容器 + 网格行:高度由内容决定,不拉伸超过内容 */\r\n .cmat-print-body .flex.flex-col {\r\n height: auto !important;\r\n min-height: 0 !important;\r\n flex: none !important;\r\n }\r\n .cmat-print-body .grid {\r\n height: auto !important;\r\n min-height: 0 !important;\r\n }\r\n /* 报表渲染器宿主 + 网格子元素:允许跨页分割,防止内容被整体推到下一页 */\r\n .cmat-print-body app-chart-renderer,\r\n .cmat-print-body app-table-renderer,\r\n .cmat-print-body app-text-renderer {\r\n break-inside: auto !important;\r\n margin: 0 !important;\r\n }\r\n .cmat-print-body .grid > [class*=\"col-span\"] {\r\n break-inside: auto !important;\r\n }\r\n /* 隐藏 ECharts 交互层:tooltip、axis-pointer 等悬浮 DOM */\r\n .cmat-print-body .el-tooltip__popper,\r\n .cmat-print-body [style*=\"pointer-events\"] {\r\n display: none !important;\r\n }\r\n\r\n /* 页眉页脚 */\r\n .cmat-print-header {\r\n text-align: center;\r\n margin-bottom: 16px;\r\n padding-bottom: 10px;\r\n border-bottom: 2px solid #333;\r\n }\r\n .cmat-print-header h1 {\r\n font-size: 18pt;\r\n margin: 0 0 4px 0;\r\n font-weight: 700;\r\n }\r\n .cmat-print-header .cmat-print-time {\r\n font-size: 9pt;\r\n color: #666;\r\n }\r\n .cmat-print-footer {\r\n margin-top: 24px;\r\n padding-top: 8px;\r\n border-top: 1px solid #ccc;\r\n font-size: 9pt;\r\n color: #999;\r\n text-align: center;\r\n }\r\n .cmat-print-body {\r\n width: 100%;\r\n padding-top: 8px;\r\n }\r\n\r\n /* 移除滚动容器的滚动约束,仅针对实际可滚动元素 */\r\n .cmat-print-body {\r\n overflow: visible !important;\r\n max-height: none !important;\r\n }\r\n .cmat-print-body .scrollbar-custom,\r\n .cmat-print-body .overflow-y-auto,\r\n .cmat-print-body .overflow-auto,\r\n .cmat-print-body .mat-drawer-content,\r\n .cmat-print-body .cdk-virtual-scroll-content-wrapper {\r\n overflow: visible !important;\r\n max-height: none !important;\r\n height: auto !important;\r\n flex: none !important;\r\n }\r\n\r\n .no-print, [data-print-exclude], .print\\\\:hidden {\r\n display: none !important;\r\n }\r\n /* 隐藏 datetimepicker toggle 按钮并重置标签偏移 */\r\n cmat-datetimepicker-toggle, .cmat-datetimepicker-toggle {\r\n display: none !important;\r\n }\r\n .cmat-print-body .mat-mdc-form-field:has(.cmat-datetimepicker-toggle) {\r\n --cmat-prefix-label-offset: 0px !important;\r\n }\r\n\r\n /* 分页控制 */\r\n .page-break-before { page-break-before: always; }\r\n .page-break-after { page-break-after: always; }\r\n .page-break-inside { page-break-inside: avoid; }\r\n\r\n /* 防止表单字段和小组件被分页截断(不包含 formly-field,因为它可能包含多个字段,导致第一页空白) */\r\n .cmat-print-body .mat-mdc-form-field,\r\n .cmat-print-body .mat-mdc-chip-grid,\r\n .cmat-print-body .mat-mdc-chip-row,\r\n .cmat-print-body mat-slider,\r\n .cmat-print-body mat-slide-toggle,\r\n .cmat-print-body .mat-mdc-checkbox,\r\n .cmat-print-body .mat-mdc-radio-button,\r\n .cmat-print-body cmat-date-range,\r\n .cmat-print-body .range {\r\n break-inside: avoid !important;\r\n }\r\n\r\n /* 打印时强制表格使用桌面布局(A4纸宽 < 960px 断点,会触发移动端卡片布局) */\r\n .mat-mdc-table:not(.normal-mobile-table) {\r\n display: table !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-header-row {\r\n display: table-row !important;\r\n position: static !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) tbody {\r\n display: table-row-group !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-row {\r\n display: table-row !important;\r\n height: auto !important;\r\n position: static !important;\r\n border-radius: 0 !important;\r\n box-shadow: none !important;\r\n padding: 0 !important;\r\n max-height: none !important;\r\n overflow: visible !important;\r\n flex-direction: unset !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-cell {\r\n display: table-cell !important;\r\n padding: 8px 12px !important;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-header-cell {\r\n display: table-cell !important;\r\n padding: 8px 12px !important;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;\r\n font-weight: 600 !important;\r\n position: static !important;\r\n }\r\n /* 奇偶行背景 */\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-row:nth-child(even) {\r\n background-color: rgb(248 250 252) !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-row:nth-child(odd) {\r\n background-color: #fff !important;\r\n }\r\n /* has-label-on-mobile 在打印时不显示前缀标签 */\r\n .has-label-on-mobile::before {\r\n display: none !important;\r\n }\r\n /* 禁止表头跨页重复 */\r\n .mat-mdc-table .mat-mdc-header-row {\r\n position: static !important;\r\n }\r\n thead {\r\n display: table-header-group !important;\r\n }\r\n thead tr {\r\n position: static !important;\r\n }\r\n\r\n /* 保留所有边框和背景色 */\r\n *, *::before, *::after {\r\n -webkit-print-color-adjust: exact !important;\r\n print-color-adjust: exact !important;\r\n }\r\n\r\n /* 移除 focus ring(打印无意义),但不影响 border/box-shadow */\r\n .mat-mdc-form-field-focus-overlay {\r\n display: none !important;\r\n }\r\n .mat-mdc-focus-indicator::after {\r\n display: none !important;\r\n }\r\n\r\n /* 确保表单字段间有合理间距,顶部留空防止 float-label 跨页被裁切 */\r\n .cmat-print-body .mat-mdc-form-field {\r\n margin-bottom: 0.25em !important;\r\n margin-top: 0.5em !important;\r\n }\r\n\r\n /* Repeat 容器内的字段减少顶部间距 */\r\n .cmat-print-body .repeat-field .mat-mdc-form-field {\r\n margin-top: 0 !important;\r\n }\r\n\r\n .cmat-print-body formly-field {\r\n display: block;\r\n margin-bottom: 0.25em !important;\r\n }\r\n /* 修复 flex-auto 在打印上下文中的布局问题 */\r\n .cmat-print-body formly-form.flex-auto,\r\n .cmat-print-body formly-form[class*=\"flex-auto\"] {\r\n flex: none !important;\r\n }\r\n\r\n /* 确保 mat-hint(Description)可见,但不过宽 */\r\n .cmat-print-body .mat-mdc-form-field-subscript-wrapper {\r\n overflow: visible !important;\r\n height: auto !important;\r\n max-height: none !important;\r\n position: relative !important;\r\n padding-top: 2px !important;\r\n }\r\n .cmat-print-body .mat-mdc-form-field-hint {\r\n color: #555 !important;\r\n opacity: 1 !important;\r\n display: block !important;\r\n line-height: 1.2 !important;\r\n }\r\n\r\n /* Chips:确保打印时正确布局 */\r\n .cmat-print-body .mat-mdc-chip-grid {\r\n display: flex !important;\r\n flex-wrap: wrap !important;\r\n gap: 4px !important;\r\n align-items: center !important;\r\n }\r\n .cmat-print-body .mat-mdc-chip-row {\r\n display: inline-flex !important;\r\n align-items: center !important;\r\n\r\n .mat-mdc-chip-action{\r\n padding-right:12px !important;\r\n }\r\n }\r\n /* 隐藏 chip 内的输入框和自动补全 */\r\n .cmat-print-body .mat-mdc-chip-grid input {\r\n display: none !important;\r\n }\r\n .cmat-print-body .mat-mdc-autocomplete {\r\n display: none !important;\r\n }\r\n\r\n /* Color Picker:确保色块按钮的 ::after 伪元素背景色被打印 */\r\n .cmat-print-body .mat-mdc-form-field-icon-prefix button {\r\n overflow: visible !important;\r\n padding: 4px !important;\r\n width: 32px !important;\r\n height: 32px !important;\r\n min-width: 32px !important;\r\n min-height: 32px !important;\r\n }\r\n\r\n /* 通用:防止 overflow-hidden 裁切 border */\r\n .cmat-print-body .overflow-hidden {\r\n overflow: visible !important;\r\n }\r\n\r\n /* ─── 容器类型打印适配 ─── */\r\n\r\n /* Tabs:展开所有标签页内容,隐藏标签导航 */\r\n .cmat-print-body .mat-mdc-tab-header {\r\n display: none !important;\r\n }\r\n .cmat-print-body .mat-mdc-tab-body-wrapper {\r\n overflow: visible !important;\r\n height: auto !important;\r\n }\r\n .cmat-print-body .mat-mdc-tab-body {\r\n display: block !important;\r\n visibility: visible !important;\r\n opacity: 1 !important;\r\n height: auto !important;\r\n border-bottom: 1px dashed #ccc;\r\n padding-bottom: 12px;\r\n margin-bottom: 12px;\r\n }\r\n /* 在 tab body 前显示标签名 */\r\n .cmat-print-body .mat-mdc-tab-body::before {\r\n content: attr(aria-label);\r\n display: block;\r\n font-weight: 600;\r\n font-size: 1.1em;\r\n margin-bottom: 8px;\r\n color: #333;\r\n }\r\n\r\n /* Stepper:展开所有步骤,隐藏导航按钮 */\r\n .cmat-print-body .mat-horizontal-stepper-header-container {\r\n display: none !important;\r\n }\r\n .cmat-print-body .mat-stepper-horizontal-line {\r\n display: none !important;\r\n }\r\n .cmat-print-body .mat-step {\r\n display: block !important;\r\n visibility: visible !important;\r\n opacity: 1 !important;\r\n height: auto !important;\r\n overflow: visible !important;\r\n margin-bottom: 16px;\r\n padding-bottom: 12px;\r\n border-bottom: 1px dashed #ccc;\r\n }\r\n /* 显示步骤标签 */\r\n .cmat-print-body .mat-step-label {\r\n display: block !important;\r\n font-weight: 600;\r\n font-size: 1.1em;\r\n margin-bottom: 8px;\r\n color: #333;\r\n }\r\n\r\n /* Expansion:强制展开面板 */\r\n .cmat-print-body .mat-expansion-panel {\r\n break-inside: avoid;\r\n margin-bottom: 8px;\r\n }\r\n .cmat-print-body .mat-expansion-panel-content {\r\n height: auto !important;\r\n visibility: visible !important;\r\n opacity: 1 !important;\r\n overflow: visible !important;\r\n display: block !important;\r\n }\r\n\r\n /* ─── 报表组件打印适配 ─── */\r\n\r\n /* 报表渲染器组件宿主:Angular 自定义元素默认 display:inline,需强制 block + 100% 宽度以填满网格单元格 */\r\n .cmat-print-body app-chart-renderer,\r\n .cmat-print-body app-table-renderer,\r\n .cmat-print-body app-text-renderer {\r\n display: block !important;\r\n width: 100% !important;\r\n min-width: 0 !important;\r\n box-sizing: border-box !important;\r\n }\r\n\r\n /* 报表主容器:解除滚动容器的固定高度约束 + 阻止 flex 拉伸 */\r\n .cmat-print-body > main,\r\n .cmat-print-body .overflow-y-auto,\r\n .cmat-print-body .overflow-auto {\r\n overflow: visible !important;\r\n height: auto !important;\r\n min-height: 0 !important;\r\n max-height: none !important;\r\n flex: none !important;\r\n }\r\n\r\n /* 报表行容器:恢复 flex gap-6 间距(gap 不在 computed style 内联列表中,需手动补回) */\r\n .cmat-print-body .flex.flex-col.gap-6 {\r\n gap: 1.5rem !important;\r\n }\r\n\r\n /* 报表网格:强制 12 列布局(不依赖媒体查询) */\r\n .cmat-print-body .grid {\r\n display: grid !important;\r\n grid-template-columns: repeat(12, minmax(0, 1fr)) !important;\r\n gap: 0.75rem !important;\r\n }\r\n /* col-span 工具类覆盖(含响应式前缀) */\r\n .cmat-print-body .grid > .col-span-1 { grid-column: span 1 / span 1 !important; }\r\n .cmat-print-body .grid > .col-span-2 { grid-column: span 2 / span 2 !important; }\r\n .cmat-print-body .grid > .col-span-3 { grid-column: span 3 / span 3 !important; }\r\n .cmat-print-body .grid > .col-span-4 { grid-column: span 4 / span 4 !important; }\r\n .cmat-print-body .grid > .col-span-6 { grid-column: span 6 / span 6 !important; }\r\n .cmat-print-body .grid > .col-span-12 { grid-column: span 12 / span 12 !important; }\r\n /* Tailwind 响应式前缀 md:/lg: 的 col-span 类 */\r\n .cmat-print-body .grid > [class*=\"\\\\:col-span-4\"] { grid-column: span 4 / span 4 !important; }\r\n .cmat-print-body .grid > [class*=\"\\\\:col-span-6\"] { grid-column: span 6 / span 6 !important; }\r\n .cmat-print-body .grid > [class*=\"\\\\:col-span-12\"] { grid-column: span 12 / span 12 !important; }\r\n\r\n /* 报表图表:限制打印高度,为表格留出空间 */\r\n .cmat-print-body .chart-container {\r\n overflow: hidden !important;\r\n break-inside: avoid;\r\n max-height: 100mm !important;\r\n }\r\n .cmat-print-body .chart-canvas {\r\n overflow: hidden !important;\r\n height: auto !important;\r\n max-height: 95mm !important;\r\n }\r\n /* ECharts 渲染容器 div:约束到父级宽度,防止固定像素内联样式溢出 */\r\n .cmat-print-body .chart-canvas > div {\r\n max-width: 100% !important;\r\n box-sizing: border-box !important;\r\n }\r\n .cmat-print-body .chart-canvas img {\r\n max-width: 100% !important;\r\n height: auto !important;\r\n display: block !important;\r\n }\r\n\r\n /* 报表表格容器:移除 overflow 和 max-height 约束 + 约束到页面宽度 */\r\n .cmat-print-body .table-container {\r\n overflow: visible !important;\r\n height: auto !important;\r\n max-height: none !important;\r\n min-height: 0 !important;\r\n max-width: 100% !important;\r\n box-sizing: border-box !important;\r\n break-inside: auto !important;\r\n }\r\n .cmat-print-body .table-wrapper {\r\n overflow: visible !important;\r\n max-height: none !important;\r\n height: auto !important;\r\n max-width: 100% !important;\r\n box-sizing: border-box !important;\r\n break-inside: auto !important;\r\n }\r\n /* 报表表格:强制适应页面宽度,列均分 + 允许跨页分割 */\r\n .cmat-print-body table[mat-table] {\r\n width: 100% !important;\r\n max-width: 100% !important;\r\n table-layout: fixed !important;\r\n font-size: 11px !important;\r\n break-inside: auto !important;\r\n }\r\n /* 报表表格单元格:清除内联固定宽度,允许文字换行 */\r\n .cmat-print-body table[mat-table] td,\r\n .cmat-print-body table[mat-table] th {\r\n width: auto !important;\r\n word-break: break-word !important;\r\n overflow-wrap: break-word !important;\r\n white-space: normal !important;\r\n padding: 4px 8px !important;\r\n }\r\n /* 报表表格 tbody:允许跨页分割 */\r\n .cmat-print-body table[mat-table] tbody {\r\n break-inside: auto !important;\r\n display: table-row-group !important;\r\n }\r\n /* 报表表格行:防止单行被跨页截断 */\r\n .cmat-print-body table[mat-table] tr[mat-row],\r\n .cmat-print-body table[mat-table] tr[mat-row] td {\r\n break-inside: avoid !important;\r\n page-break-inside: avoid !important;\r\n }\r\n /* 隐藏报表分页组件 */\r\n .cmat-print-body .pagination-wrapper,\r\n .cmat-print-body cmat-pagination {\r\n display: none !important;\r\n }\r\n\r\n\r\n`;\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class CmatPrintService {\r\n\r\n /**\r\n * 打印指定 DOM 元素\r\n * 保留原始 DOM 结构和样式,同步表单控件的当前值\r\n */\r\n printElement(element: HTMLElement, options?: CmatPrintOptions): void {\r\n const clone = element.cloneNode(true) as HTMLElement;\r\n // 同步表单控件的 live value 到克隆节点的 attribute\r\n this._syncFormValues(element, clone);\r\n // 移除不需要打印的元素\r\n this._prepareForPrint(element, clone, options);\r\n const contentHtml = clone.outerHTML;\r\n this._print(contentHtml, options);\r\n }\r\n\r\n /**\r\n * 通过 CSS 选择器打印第一个匹配的元素\r\n */\r\n printSelector(selector: string, options?: CmatPrintOptions): void {\r\n const element = document.querySelector<HTMLElement>(selector);\r\n if (!element) {\r\n console.warn(`[CmatPrintService] 未找到匹配选择器的元素: ${selector}`);\r\n return;\r\n }\r\n this.printElement(element, options);\r\n }\r\n\r\n /**\r\n * 打印原始 HTML 字符串(不进行 DOM 转换,直接注入)\r\n */\r\n printHtml(html: string, options?: CmatPrintOptions): void {\r\n this._print(html, options);\r\n }\r\n\r\n /**\r\n * 调试模式:将生成的 HTML 在新标签页中打开,方便用 DevTools 检查布局\r\n * 调用方式:this._printService.debugPrint(el, { title: '报表' })\r\n */\r\n debugPrint(element: HTMLElement, options?: CmatPrintOptions): void {\r\n const clone = element.cloneNode(true) as HTMLElement;\r\n this._syncFormValues(element, clone);\r\n this._prepareForPrint(element, clone, options);\r\n const contentHtml = clone.outerHTML;\r\n\r\n const title = options?.title ?? '打印调试';\r\n const orientation = options?.orientation ?? 'portrait';\r\n const margins = options?.margins ?? { top: 15, right: 15, bottom: 15, left: 15 };\r\n const marginStr = `${margins.top}mm ${margins.right}mm ${margins.bottom}mm ${margins.left}mm`;\r\n const overrideCss = PRINT_OVERRIDE_CSS\r\n .replace('var(--orientation)', orientation)\r\n .replace('var(--margins)', marginStr);\r\n // 关键:转换所有媒体查询,使 debug 标签页(screen 上下文)与实际打印(print 上下文)一致\r\n // 1. @media screen → @media all(与实际打印一致)\r\n // 2. @media print → @media all(让打印规则在 screen 中也生效)\r\n const pageStyles = this._collectAllStyles()\r\n .replace(/@media\\s+print\\s+and\\s*\\(/g, '@media (')\r\n .replace(/@media\\s+print\\s*\\{/g, '@media all {')\r\n .replace(/@media\\s+screen\\s+and\\s*\\(/g, '@media (')\r\n .replace(/@media\\s+screen\\s*\\{/g, '@media all {')\r\n .replace(/@media\\s+only\\s+screen\\s+and\\s*\\(/g, '@media (')\r\n .replace(/@media\\s+only\\s+screen\\s*\\{/g, '@media all {');\r\n const cssVars = this._collectCssVariables();\r\n const htmlClass = document.documentElement.className || 'light';\r\n const bodyClass = this._getPrintBodyClass();\r\n\r\n const fullHtml = `<!DOCTYPE html>\r\n<html lang=\"zh-CN\" class=\"${htmlClass}\" style=\"${cssVars}\">\r\n<head>\r\n <meta charset=\"utf-8\">\r\n <base href=\"${document.baseURI}\">\r\n <title>[DEBUG] ${this._escapeHtml(title)}</title>\r\n ${pageStyles}\r\n <style>${overrideCss}${options?.customCss ?? ''}</style>\r\n <style>\r\n /* 调试模式专属:模拟 A4 页面宽度 */\r\n body { background: #e0e0e0 !important; }\r\n .cmat-debug-page {\r\n max-width: 180mm;\r\n margin-left: auto !important;\r\n margin-right: auto !important;\r\n background: #fff;\r\n box-shadow: 0 2px 8px rgba(0,0,0,0.15);\r\n padding: ${margins.top}mm ${margins.right}mm ${margins.bottom}mm ${margins.left}mm;\r\n min-height: 297mm;\r\n }\r\n </style>\r\n</head>\r\n<body class=\"${bodyClass}\">\r\n <div style=\"background:#fff3cd;padding:8px 16px;text-align:center;font-size:14px;border-bottom:2px solid #ffc107;\">\r\n 🔧 <strong>调试模式</strong> — 此页面为打印预览 HTML,可用 DevTools 检查元素。\r\n 按 Ctrl+P 可触发实际打印。\r\n </div>\r\n <div class=\"cmat-debug-page\">\r\n <div class=\"cmat-print-body\">${contentHtml}</div>\r\n </div>\r\n</body>\r\n</html>`;\r\n\r\n const blob = new Blob([fullHtml], { type: 'text/html' });\r\n const url = URL.createObjectURL(blob);\r\n window.open(url, '_blank');\r\n // 延迟释放,确保页面加载完成\r\n setTimeout(() => URL.revokeObjectURL(url), 60000);\r\n }\r\n\r\n // ─── 私有方法 ───────────────────────────────────────────────\r\n\r\n /**\r\n * 同步原始 DOM 中表单控件的当前值到克隆节点\r\n * cloneNode() 不会复制 input.value 等 live property,\r\n * 必须手动同步为 HTML attribute 才能在 iframe 中正确渲染\r\n */\r\n private _syncFormValues(original: HTMLElement, clone: HTMLElement): void {\r\n const origFields = original.querySelectorAll<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>(\r\n 'input, textarea, select'\r\n );\r\n const cloneFields = clone.querySelectorAll<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>(\r\n 'input, textarea, select'\r\n );\r\n\r\n origFields.forEach((origField, i) => {\r\n const cloneField = cloneFields[i];\r\n if (!cloneField) return;\r\n\r\n if (origField instanceof HTMLInputElement) {\r\n const cloneInput = cloneField as HTMLInputElement;\r\n // 同步 value attribute\r\n cloneInput.setAttribute('value', origField.value);\r\n // 同步 checked 状态\r\n if (origField.type === 'checkbox' || origField.type === 'radio') {\r\n if (origField.checked) {\r\n cloneInput.setAttribute('checked', '');\r\n } else {\r\n cloneInput.removeAttribute('checked');\r\n }\r\n }\r\n } else if (origField instanceof HTMLTextAreaElement) {\r\n // textarea 的值通过 textContent 同步\r\n cloneField.textContent = origField.value;\r\n } else if (origField instanceof HTMLSelectElement) {\r\n const cloneSelect = cloneField as HTMLSelectElement;\r\n Array.from(origField.options).forEach((opt, idx) => {\r\n const cloneOpt = cloneSelect.options[idx];\r\n if (!cloneOpt) return;\r\n if (opt.selected) {\r\n cloneOpt.setAttribute('selected', '');\r\n } else {\r\n cloneOpt.removeAttribute('selected');\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * 最小化打印准备:DOM 转换 + 清理\r\n * 对无法正确打印的组件进行 DOM 替换,对关键元素复制 computed style\r\n */\r\n private _prepareForPrint(original: HTMLElement, root: HTMLElement, options?: CmatPrintOptions): void {\r\n // 移除标记为不打印的元素\r\n root.querySelectorAll('.print\\\\:hidden, [data-print-exclude]').forEach(el => el.remove());\r\n\r\n // ── 移除 ECharts 交互层:tooltip、axis-pointer 等悬浮 DOM,打印时不应显示 ──\r\n root.querySelectorAll('.el-tooltip__popper, [style*=\"pointer-events\"]').forEach((el) => {\r\n if (el.closest('.chart-container, .chart-canvas, [class*=\"echarts\"]')) {\r\n el.remove();\r\n }\r\n });\r\n\r\n // 移除所有按钮(保留 form-field 前缀/后缀按钮、chip 内按钮和 slide-toggle 开关)\r\n root.querySelectorAll('button').forEach((el) => {\r\n const isPrefixSuffix = el.closest(\r\n '.mat-mdc-form-field-icon-prefix, .mat-mdc-form-field-icon-suffix, ' +\r\n '.mat-mdc-form-field-text-prefix, .mat-mdc-form-field-text-suffix'\r\n );\r\n const isChipButton = el.closest('.mat-mdc-chip-row');\r\n const isSwitch = el.classList.contains('mdc-switch');\r\n if (!isPrefixSuffix && !isChipButton && !isSwitch) {\r\n el.remove();\r\n }\r\n });\r\n\r\n \r\n // ── Canvas → Image:克隆不复制 canvas 位图,需转为 img 保留 ECharts 等图表内容 ──\r\n const origCanvases = original.querySelectorAll<HTMLCanvasElement>('canvas');\r\n const cloneCanvases = root.querySelectorAll<HTMLCanvasElement>('canvas');\r\n origCanvases.forEach((origCanvas, i) => {\r\n const cloneCanvas = cloneCanvases[i];\r\n if (!cloneCanvas) return;\r\n try {\r\n const dataUrl = origCanvas.toDataURL('image/png');\r\n const img = document.createElement('img');\r\n img.src = dataUrl;\r\n img.style.width = '100%';\r\n img.style.height = 'auto';\r\n img.style.display = 'block';\r\n cloneCanvas.parentNode?.replaceChild(img, cloneCanvas);\r\n } catch (e) {\r\n console.warn('[CmatPrintService] Canvas 转图片失败:', e);\r\n }\r\n });\r\n\r\n // ── Chips:移除删除按钮的内容(图标),保持 chip 布局 ──\r\n root.querySelectorAll<HTMLElement>('.mat-mdc-chip-row button[matChipRemove]').forEach((btn) => {\r\n btn.innerHTML = '';\r\n btn.style.cssText = 'display:none !important;';\r\n });\r\n\r\n // ── Description (mat-hint):强制紧凑布局 ──\r\n root.querySelectorAll<HTMLElement>('.mat-mdc-form-field-subscript-wrapper').forEach((wrapper) => {\r\n wrapper.style.cssText += ';overflow:visible!important;height:auto!important;min-height:0!important;max-height:none!important;' +\r\n 'position:relative!important;padding:0!important;margin:0!important;line-height:1!important;font-size:0.85em!important;';\r\n });\r\n\r\n // ── 复制关键元素的 computed style 为 inline style ──\r\n this._inlineComputedStyles(original, root);\r\n\r\n // ── 报表组件:在 computed style 复制后,用 DOM inline !important 强制修复 ──\r\n\r\n // 根元素(通常是 <main>):解除滚动容器的固定高度约束 + 约束到页面宽度\r\n root.style.setProperty('overflow', 'visible', 'important');\r\n root.style.setProperty('height', 'auto', 'important');\r\n root.style.setProperty('min-height', '0', 'important');\r\n root.style.setProperty('max-height', 'none', 'important');\r\n root.style.setProperty('max-width', '100%', 'important');\r\n root.style.setProperty('box-sizing', 'border-box', 'important');\r\n // 所有滚动容器:解除 overflow/height 约束,防止内容被裁切 + 阻止 flex 拉伸\r\n root.querySelectorAll<HTMLElement>('[class*=\"overflow-y-auto\"], [class*=\"overflow-auto\"]').forEach((el) => {\r\n el.style.setProperty('overflow', 'visible', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('max-height', 'none', 'important');\r\n el.style.setProperty('flex', 'none', 'important');\r\n });\r\n // 外层 flex 容器:恢复 gap-6 间距 + 约束到页面宽度 + 清除 margin + 高度由内容决定\r\n root.querySelectorAll<HTMLElement>('[class*=\"gap-6\"]').forEach((el) => {\r\n el.style.setProperty('gap', '1.5rem', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('margin', '0', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('flex', 'none', 'important');\r\n });\r\n\r\n // 网格容器:强制 12 列布局(inline !important 覆盖任何 computed style 内联值)\r\n root.querySelectorAll<HTMLElement>('.grid').forEach((el) => {\r\n // 只处理包含 col-span 子元素的网格(报表布局网格),避免影响其他网格\r\n if (!el.querySelector('[class*=\"col-span\"]')) return;\r\n el.style.setProperty('display', 'grid', 'important');\r\n el.style.setProperty('grid-template-columns', 'repeat(12, minmax(0, 1fr))', 'important');\r\n // 恢复 gap-3(gap 不在 _inlineComputedStyles 属性列表中,需手动补回)\r\n el.style.setProperty('gap', '0.75rem', 'important');\r\n // 重置网格行容器的固定高度 + 清除 margin + 高度由内容决定\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('max-height', 'none', 'important');\r\n el.style.setProperty('overflow', 'visible', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('margin', '0', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n // 遍历子元素,根据 col-span 类名设置 grid-column\r\n Array.from(el.children).forEach((child) => {\r\n const childEl = child as HTMLElement;\r\n const classes = child.className || '';\r\n // 提取最大的 col-span 值(优先 lg: > md: > 无后缀)\r\n const lgMatch = /lg:col-span-(\\d+)/.exec(classes);\r\n const mdMatch = /md:col-span-(\\d+)/.exec(classes);\r\n const baseMatch = /(?:^|\\s)col-span-(\\d+)/.exec(classes);\r\n let span = lgMatch?.[1] ?? mdMatch?.[1] ?? baseMatch?.[1];\r\n\r\n // 图表容器:强制占满整行(A4 宽度不足以并排显示两个图表)\r\n if (childEl.querySelector('.chart-container')) {\r\n span = '12';\r\n }\r\n\r\n if (span) {\r\n childEl.style.cssText = '';\r\n childEl.style.setProperty('grid-column', `span ${span} / span ${span}`, 'important');\r\n // 重置固定像素宽高,让网格轨道控制尺寸\r\n childEl.style.setProperty('width', 'auto', 'important');\r\n childEl.style.setProperty('max-width', '100%', 'important');\r\n childEl.style.setProperty('min-width', '0', 'important');\r\n childEl.style.setProperty('height', 'auto', 'important');\r\n childEl.style.setProperty('min-height', '0', 'important');\r\n childEl.style.setProperty('max-height', 'none', 'important');\r\n childEl.style.setProperty('margin', '0', 'important');\r\n // 允许网格子元素跨页分割,防止内容被整体推到下一页\r\n childEl.style.setProperty('break-inside', 'auto', 'important');\r\n }\r\n });\r\n });\r\n\r\n // table-wrapper:彻底清除内联样式(含 _inlineComputedStyles 设置的固定像素值)+ 重新设置\r\n root.querySelectorAll<HTMLElement>('.table-wrapper').forEach((el) => {\r\n el.style.cssText = '';\r\n el.style.setProperty('overflow', 'visible', 'important');\r\n el.style.setProperty('max-height', 'none', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n });\r\n root.querySelectorAll<HTMLElement>('.table-container').forEach((el) => {\r\n el.style.cssText = '';\r\n el.style.setProperty('overflow', 'visible', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('max-height', 'none', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('margin', '0', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n });\r\n // 表格:强制 100% 宽度 + fixed 布局 + 允许跨页分割\r\n root.querySelectorAll<HTMLElement>('table[mat-table]').forEach((el) => {\r\n el.style.setProperty('width', '100%', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('table-layout', 'fixed', 'important');\r\n el.style.setProperty('break-inside', 'auto', 'important');\r\n });\r\n // 表格单元格:清除内联固定宽度 + 允许文字换行\r\n root.querySelectorAll<HTMLElement>('table[mat-table] td, table[mat-table] th').forEach((el) => {\r\n // 清除列的内联 width(来自 column.width 配置),让 table-layout:auto 自动分配\r\n el.style.removeProperty('width');\r\n el.style.setProperty('word-break', 'break-word', 'important');\r\n el.style.setProperty('overflow-wrap', 'break-word', 'important');\r\n el.style.setProperty('white-space', 'normal', 'important');\r\n el.style.setProperty('padding', '4px 8px', 'important');\r\n });\r\n // 报表渲染器组件宿主:彻底清除内联样式 + 强制 block + 100% 宽度 + 允许跨页\r\n root.querySelectorAll<HTMLElement>('app-chart-renderer, app-table-renderer, app-text-renderer').forEach((el) => {\r\n el.style.cssText = '';\r\n el.style.setProperty('display', 'block', 'important');\r\n el.style.setProperty('width', '100%', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('min-width', '0', 'important');\r\n el.style.setProperty('margin', '0', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n el.style.setProperty('break-inside', 'auto', 'important');\r\n });\r\n // chart-container / chart-canvas / img:彻底清除残留内联样式,重新设置打印友好样式\r\n // 使用 cssText='' 清除所有内联样式(包括 _inlineComputedStyles 可能设置的固定像素值)\r\n root.querySelectorAll<HTMLElement>('.chart-container').forEach((el) => {\r\n el.style.cssText = '';\r\n el.style.setProperty('width', '100%', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('min-width', '0', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('max-height', '100mm', 'important');\r\n el.style.setProperty('overflow', 'hidden', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n });\r\n root.querySelectorAll<HTMLElement>('.chart-canvas').forEach((el) => {\r\n el.style.cssText = '';\r\n el.style.setProperty('width', '100%', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('min-width', '0', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('max-height', '95mm', 'important');\r\n el.style.setProperty('overflow', 'hidden', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n // 关键:ECharts 在 .chart-canvas 内创建的渲染容器 div 有固定像素内联宽度\r\n // 必须清除并约束,否则其内部的 img(width:100%) 基于桌面宽度解析\r\n Array.from(el.children).forEach((child) => {\r\n if (child.tagName === 'DIV') {\r\n const childEl = child as HTMLElement;\r\n childEl.style.cssText = '';\r\n childEl.style.setProperty('width', '100%', 'important');\r\n childEl.style.setProperty('max-width', '100%', 'important');\r\n childEl.style.setProperty('min-width', '0', 'important');\r\n childEl.style.setProperty('height', 'auto', 'important');\r\n childEl.style.setProperty('box-sizing', 'border-box', 'important');\r\n }\r\n });\r\n });\r\n // 图表图片:img 在 ECharts 子 div 内部,用后代选择器\r\n root.querySelectorAll<HTMLImageElement>('.chart-canvas img').forEach((img) => {\r\n img.style.cssText = '';\r\n img.style.setProperty('width', '100%', 'important');\r\n img.style.setProperty('max-width', '100%', 'important');\r\n img.style.setProperty('height', 'auto', 'important');\r\n img.style.setProperty('display', 'block', 'important');\r\n });\r\n\r\n // metric-card:重置固定尺寸,允许内容自适应 A4 网格\r\n root.querySelectorAll<HTMLElement>('.metric-card').forEach((el) => {\r\n el.style.setProperty('width', '100%', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('min-width', '0', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n });\r\n // metric 子元素:重置固定尺寸,允许文字换行\r\n root.querySelectorAll<HTMLElement>('.metric-card .value, .metric-card .label, .metric-card .prefix, .metric-card .suffix').forEach((el) => {\r\n el.style.setProperty('width', 'auto', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('white-space', 'normal', 'important');\r\n el.style.setProperty('overflow-wrap', 'break-word', 'important');\r\n });\r\n\r\n // ── Expansion:强制展开所有面板 ──\r\n root.querySelectorAll<HTMLElement>('.mat-expansion-panel').forEach((panel) => {\r\n panel.classList.add('mat-expanded');\r\n });\r\n\r\n // 移除用户自定义排除选择器\r\n options?.excludeSelectors?.forEach((selector) => {\r\n root.querySelectorAll(selector).forEach(el => el.remove());\r\n });\r\n }\r\n\r\n /**\r\n * 将原始页面中关键元素的 computed style 复制为 inline style\r\n * 确保 iframe 中即使 CSS 规则不生效,样式也能通过 inline style 保留\r\n */\r\n private _inlineComputedStyles(original: HTMLElement, root: HTMLElement): void {\r\n\r\n // 需要复制 computed style 的选择器列表\r\n // 注意:不包含 .mdc-switch* 和 .mdc-slider*,这些组件的 computed style 可能包含 opacity:0 等不适合打印的值\r\n const selectors = [\r\n '.mat-mdc-form-field-subscript-wrapper',\r\n '.mat-mdc-chip-row',\r\n '.mat-mdc-chip',\r\n // 报表组件:Angular 属性选择器在克隆节点失效,需内联 computed style\r\n // 注意:.chart-container 不在此列表 — 其桌面端固定像素宽高+overflow:hidden 会污染打印输出\r\n '.metric-card',\r\n '.metric-card .value',\r\n '.metric-card .prefix',\r\n '.metric-card .suffix',\r\n '.metric-card .label',\r\n '.table-container',\r\n '.table-wrapper',\r\n ];\r\n\r\n // 从原始元素(而非 document)查找匹配元素,确保索引与克隆节点匹配\r\n for (const selector of selectors) {\r\n const originals = original.querySelectorAll<HTMLElement>(selector);\r\n const clones = root.querySelectorAll<HTMLElement>(selector);\r\n originals.forEach((orig, i) => {\r\n const clone = clones[i];\r\n if (!clone) return;\r\n const computed = getComputedStyle(orig);\r\n // 复制关键属性\r\n const props = ['display', 'visibility', 'opacity', 'overflow', 'width', 'height',\r\n 'min-width', 'min-height', 'max-width', 'max-height', 'padding', 'margin',\r\n 'border', 'border-radius', 'background-color', 'color', 'font-size', 'font-weight',\r\n 'line-height', 'position', 'top', 'left', 'right', 'bottom', 'flex', 'flex-direction',\r\n 'align-items', 'justify-content', 'gap', 'box-shadow', 'transform'];\r\n for (const prop of props) {\r\n const val = computed.getPropertyValue(prop);\r\n if (val) {\r\n clone.style.setProperty(prop, val, 'important');\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n /** 构建完整 HTML 并注入 iframe 执行打印 */\r\n private _print(contentHtml: string, options?: CmatPrintOptions): void {\r\n const title = options?.title ?? '打印';\r\n const orientation = options?.orientation ?? 'portrait';\r\n const margins = options?.margins ?? { top: 15, right: 15, bottom: 15, left: 15 };\r\n const now = new Date();\r\n const timeStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;\r\n\r\n // 页眉\r\n let headerHtml = '';\r\n if (options?.header !== null) {\r\n headerHtml = options?.header ?? `\r\n <div class=\"cmat-print-header\">\r\n <h1>${this._escapeHtml(title)}</h1>\r\n <div class=\"cmat-print-time\">打印时间:${timeStr}</div>\r\n </div>\r\n `;\r\n }\r\n\r\n // 页脚\r\n let footerHtml = '';\r\n if (options?.footer !== null) {\r\n footerHtml = options?.footer ?? `\r\n <div class=\"cmat-print-footer\">\r\n 此文档由系统生成 · ${timeStr}\r\n </div>\r\n `;\r\n }\r\n\r\n // 收集页面已有样式(通过 styleSheets API 完整收集)\r\n const pageStyles = this._collectAllStyles();\r\n\r\n // 收集 CSS 自定义属性(变量),确保 iframe 中边框颜色等不丢失\r\n const cssVars = this._collectCssVariables();\r\n\r\n // 复制原始页面的 html/body class(保留主题类名)\r\n const htmlClass = document.documentElement.className || 'light';\r\n const bodyClass = this._getPrintBodyClass();\r\n\r\n // 打印覆盖样式\r\n const marginStr = `${margins.top}mm ${margins.right}mm ${margins.bottom}mm ${margins.left}mm`;\r\n const overrideCss = PRINT_OVERRIDE_CSS\r\n .replace('var(--orientation)', orientation)\r\n .replace('var(--margins)', marginStr);\r\n\r\n const fullHtml = `<!DOCTYPE html>\r\n<html lang=\"zh-CN\" class=\"${htmlClass}\" style=\"${cssVars}\">\r\n<head>\r\n <meta charset=\"utf-8\">\r\n <base href=\"${document.baseURI}\">\r\n <title>${this._escapeHtml(title)}</title>\r\n ${pageStyles}\r\n <style>${overrideCss}${options?.customCss ?? ''}</style>\r\n</head>\r\n<body class=\"${bodyClass}\">\r\n ${headerHtml}\r\n <div class=\"cmat-print-body\">${contentHtml}</div>\r\n ${footerHtml}\r\n</body>\r\n</html>`;\r\n\r\n this._renderAndPrint(fullHtml, options);\r\n }\r\n\r\n /**\r\n * 通过 document.styleSheets API 收集所有样式规则\r\n * 关键处理:将 @media screen 转换为同时适用于 print\r\n * (因为 iframe 调用 print() 时媒体类型切换为 print,screen-only 规则会失效)\r\n */\r\n private _collectAllStyles(): string {\r\n const cssTexts: string[] = [];\r\n\r\n try {\r\n for (const sheet of Array.from(document.styleSheets)) {\r\n try {\r\n const rules = sheet.cssRules;\r\n if (!rules || rules.length === 0) continue;\r\n\r\n let cssText = '';\r\n for (const rule of Array.from(rules)) {\r\n cssText += rule.cssText + '\\n';\r\n }\r\n if (cssText.trim()) {\r\n cssTexts.push(`<style>${this._transformMediaForPrint(cssText)}</style>`);\r\n }\r\n } catch {\r\n // 跨域样式表无法读取 cssRules,使用 <link> 回退\r\n if (sheet.href) {\r\n cssTexts.push(`<link rel=\"stylesheet\" href=\"${sheet.href}\" media=\"all\">`);\r\n }\r\n }\r\n }\r\n } catch (e) {\r\n console.warn('[CmatPrintService] 样式收集异常:', e);\r\n }\r\n\r\n return cssTexts.join('\\n ');\r\n }\r\n\r\n /**\r\n * 将 @media screen 相关查询转换为同时适用 print\r\n * 确保打印时不丢失屏幕样式(如表格奇偶行、border 等)\r\n */\r\n private _transformMediaForPrint(css: string): string {\r\n // @media screen and (...) → @media (...)\r\n // @media screen → 移除 media 类型限制\r\n return css\r\n .replace(/@media\\s+screen\\s+and\\s*\\(/g, '@media (')\r\n .replace(/@media\\s+screen\\s*\\{/g, '@media all {')\r\n .replace(/@media\\s+only\\s+screen\\s+and\\s*\\(/g, '@media (')\r\n .replace(/@media\\s+only\\s+screen\\s*\\{/g, '@media all {');\r\n }\r\n\r\n /**\r\n * 收集页面 :root 上的所有 CSS 自定义属性(变量)\r\n * 这些变量定义了 Material/Tailwind 的边框颜色、主题色等\r\n * 克隆到 iframe 时祖先链断裂,需要手动复制\r\n */\r\n private _collectCssVariables(): string {\r\n const vars: string[] = [];\r\n const rootStyles = getComputedStyle(document.documentElement);\r\n\r\n // 从 document.styleSheets 中提取 :root 规则里的自定义属性\r\n try {\r\n for (const sheet of Array.from(document.styleSheets)) {\r\n try {\r\n const rules = sheet.cssRules;\r\n if (!rules) continue;\r\n for (const rule of Array.from(rules)) {\r\n if (rule instanceof CSSStyleRule) {\r\n const selector = rule.selectorText;\r\n if (selector === ':root' || selector === 'html' || selector === ':root, html') {\r\n const props = Array.from({ length: rule.style.length }, (_, i) => rule.style[i]);\r\n for (const prop of props) {\r\n if (prop.startsWith('--')) {\r\n vars.push(`${prop}: ${rule.style.getPropertyValue(prop)}`);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } catch {\r\n // 跨域样式表跳过\r\n }\r\n }\r\n } catch (e) {\r\n console.warn('[CmatPrintService] CSS变量收集异常:', e);\r\n }\r\n\r\n // 补充:从 computed style 获取运行时可能动态设置的变量\r\n // 遍历常见的 Material/Tailwind 变量前缀\r\n const prefixes = ['--mdc-', '--mat-', '--md-', '--tw-', '--ck-', '--color-', '--border-'];\r\n const rootProps = Array.from({ length: rootStyles.length }, (_, i) => rootStyles[i]);\r\n for (const prop of rootProps) {\r\n if (prop.startsWith('--') && prefixes.some(p => prop.startsWith(p))) {\r\n const value = rootStyles.getPropertyValue(prop);\r\n if (value && !vars.some(v => v.startsWith(prop + ':'))) {\r\n vars.push(`${prop}: ${value.trim()}`);\r\n }\r\n }\r\n }\r\n\r\n return vars.join('; ');\r\n }\r\n\r\n /** 获取打印用的 body class(复制原始页面的主题类名,移除布局类名) */\r\n private _getPrintBodyClass(): string {\r\n const bodyClasses = document.body.className.split(/\\s+/);\r\n // 保留主题相关 class,移除布局/滚动类\r\n const excludeClasses = new Set(['overflow-hidden', 'h-full', 'w-full', 'h-screen', 'w-screen']);\r\n return bodyClasses\r\n .filter(c => c && !excludeClasses.has(c))\r\n .join(' ');\r\n }\r\n\r\n /** 创建隐藏 iframe,写入内容,触发打印 */\r\n private _renderAndPrint(html: string, options?: CmatPrintOptions): void {\r\n const iframe = document.createElement('iframe');\r\n // 放在屏幕后方但保持全视口尺寸渲染,确保 Tailwind 响应式断点正常触发\r\n iframe.style.position = 'fixed';\r\n iframe.style.left = '0';\r\n iframe.style.top = '0';\r\n iframe.style.width = '100vw';\r\n iframe.style.height = '100vh';\r\n iframe.style.border = '0';\r\n iframe.style.visibility = 'hidden';\r\n iframe.style.zIndex = '-1';\r\n iframe.style.pointerEvents = 'none';\r\n document.body.appendChild(iframe);\r\n\r\n const cleanup = (): void => {\r\n iframe.remove();\r\n options?.afterPrint?.();\r\n };\r\n\r\n iframe.onload = (): void => {\r\n // 给渲染一点时间(图片、字体等)\r\n setTimeout(() => {\r\n try {\r\n iframe.contentWindow?.focus();\r\n iframe.contentWindow?.print();\r\n } catch (e) {\r\n console.error('[CmatPrintService] 打印失败:', e);\r\n }\r\n\r\n // 监听打印完成(兼容处理)\r\n if (iframe.contentWindow) {\r\n iframe.contentWindow.onafterprint = cleanup;\r\n // 兜底:部分浏览器不触发 onafterprint\r\n setTimeout(cleanup, 60000);\r\n } else {\r\n cleanup();\r\n }\r\n }, 300);\r\n };\r\n\r\n // 使用 srcdoc 替代已废弃的 document.write\r\n iframe.srcdoc = html;\r\n }\r\n\r\n /** HTML 转义 */\r\n private _escapeHtml(text: string): string {\r\n const div = document.createElement('div');\r\n div.textContent = text;\r\n return div.innerHTML;\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAGA;AACA,MAAM,kBAAkB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,gBAAgB,cADH,MAAM,EAAA,CAAA,CAAA;;2FACnB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;AC9clC;;AAEG;;"}
1
+ {"version":3,"file":"cmat-services-print.mjs","names":[],"sources":["../../../projects/cmat/services/print/print.service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { CmatPrintOptions } from './print.types';\r\n\r\n/** 打印覆盖样式:最小干预,保留页面原始视觉效果 */\r\nconst PRINT_OVERRIDE_CSS = `\r\n @page { size: A4 var(--orientation); margin: var(--margins); }\r\n\r\n /* 强制亮色背景 */\r\n html, body {\r\n background: #fff !important;\r\n color-scheme: light !important;\r\n }\r\n body {\r\n margin: 0 !important;\r\n padding: 16px !important;\r\n overflow: visible !important;\r\n height: auto !important;\r\n min-height: auto !important;\r\n box-sizing: border-box !important;\r\n -webkit-print-color-adjust: exact;\r\n print-color-adjust: exact;\r\n }\r\n /* 打印内容主体:约束到页面宽度,防止子元素溢出 */\r\n .cmat-print-body {\r\n max-width: 100% !important;\r\n box-sizing: border-box !important;\r\n }\r\n /* 打印内容 flex 容器 + 网格行:高度由内容决定,不拉伸超过内容 */\r\n .cmat-print-body .flex.flex-col {\r\n height: auto !important;\r\n min-height: 0 !important;\r\n flex: none !important;\r\n }\r\n .cmat-print-body .grid {\r\n height: auto !important;\r\n min-height: 0 !important;\r\n }\r\n /* 报表渲染器宿主 + 网格子元素:允许跨页分割,防止内容被整体推到下一页 */\r\n .cmat-print-body app-chart-renderer,\r\n .cmat-print-body app-table-renderer,\r\n .cmat-print-body app-text-renderer {\r\n break-inside: auto !important;\r\n margin: 0 !important;\r\n }\r\n .cmat-print-body .grid > [class*=\"col-span\"] {\r\n break-inside: auto !important;\r\n }\r\n /* 隐藏 ECharts 交互层:tooltip、axis-pointer 等悬浮 DOM */\r\n .cmat-print-body .el-tooltip__popper,\r\n .cmat-print-body [style*=\"pointer-events\"] {\r\n display: none !important;\r\n }\r\n\r\n /* 页眉页脚 */\r\n .cmat-print-header {\r\n text-align: center;\r\n margin-bottom: 16px;\r\n padding-bottom: 10px;\r\n border-bottom: 2px solid #333;\r\n }\r\n .cmat-print-header h1 {\r\n font-size: 18pt;\r\n margin: 0 0 4px 0;\r\n font-weight: 700;\r\n }\r\n .cmat-print-header .cmat-print-time {\r\n font-size: 9pt;\r\n color: #666;\r\n }\r\n .cmat-print-footer {\r\n margin-top: 24px;\r\n padding-top: 8px;\r\n border-top: 1px solid #ccc;\r\n font-size: 9pt;\r\n color: #999;\r\n text-align: center;\r\n }\r\n .cmat-print-body {\r\n width: 100%;\r\n padding-top: 8px;\r\n }\r\n\r\n /* 移除滚动容器的滚动约束,仅针对实际可滚动元素 */\r\n .cmat-print-body {\r\n overflow: visible !important;\r\n max-height: none !important;\r\n }\r\n .cmat-print-body .scrollbar-custom,\r\n .cmat-print-body .overflow-y-auto,\r\n .cmat-print-body .overflow-auto,\r\n .cmat-print-body .mat-drawer-content,\r\n .cmat-print-body .cdk-virtual-scroll-content-wrapper {\r\n overflow: visible !important;\r\n max-height: none !important;\r\n height: auto !important;\r\n flex: none !important;\r\n }\r\n\r\n .no-print, [data-print-exclude], .print\\\\:hidden {\r\n display: none !important;\r\n }\r\n /* 隐藏 datetimepicker toggle 按钮并重置标签偏移 */\r\n cmat-datetimepicker-toggle, .cmat-datetimepicker-toggle {\r\n display: none !important;\r\n }\r\n .cmat-print-body .mat-mdc-form-field:has(.cmat-datetimepicker-toggle) {\r\n --cmat-prefix-label-offset: 0px !important;\r\n }\r\n\r\n /* 分页控制 */\r\n .page-break-before { page-break-before: always; }\r\n .page-break-after { page-break-after: always; }\r\n .page-break-inside { page-break-inside: avoid; }\r\n\r\n /* 防止表单字段和小组件被分页截断(不包含 formly-field,因为它可能包含多个字段,导致第一页空白) */\r\n .cmat-print-body .mat-mdc-form-field,\r\n .cmat-print-body .mat-mdc-chip-grid,\r\n .cmat-print-body .mat-mdc-chip-row,\r\n .cmat-print-body mat-slider,\r\n .cmat-print-body mat-slide-toggle,\r\n .cmat-print-body .mat-mdc-checkbox,\r\n .cmat-print-body .mat-mdc-radio-button,\r\n .cmat-print-body cmat-date-range,\r\n .cmat-print-body .range {\r\n break-inside: avoid !important;\r\n }\r\n\r\n /* 打印时强制表格使用桌面布局(A4纸宽 < 960px 断点,会触发移动端卡片布局) */\r\n .mat-mdc-table:not(.normal-mobile-table) {\r\n display: table !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-header-row {\r\n display: table-row !important;\r\n position: static !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) tbody {\r\n display: table-row-group !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-row {\r\n display: table-row !important;\r\n height: auto !important;\r\n position: static !important;\r\n border-radius: 0 !important;\r\n box-shadow: none !important;\r\n padding: 0 !important;\r\n max-height: none !important;\r\n overflow: visible !important;\r\n flex-direction: unset !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-cell {\r\n display: table-cell !important;\r\n padding: 8px 12px !important;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-header-cell {\r\n display: table-cell !important;\r\n padding: 8px 12px !important;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;\r\n font-weight: 600 !important;\r\n position: static !important;\r\n }\r\n /* 奇偶行背景 */\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-row:nth-child(even) {\r\n background-color: rgb(248 250 252) !important;\r\n }\r\n .mat-mdc-table:not(.normal-mobile-table) .mat-mdc-row:nth-child(odd) {\r\n background-color: #fff !important;\r\n }\r\n /* has-label-on-mobile 在打印时不显示前缀标签 */\r\n .has-label-on-mobile::before {\r\n display: none !important;\r\n }\r\n /* 禁止表头跨页重复 */\r\n .mat-mdc-table .mat-mdc-header-row {\r\n position: static !important;\r\n }\r\n thead {\r\n display: table-header-group !important;\r\n }\r\n thead tr {\r\n position: static !important;\r\n }\r\n\r\n /* 保留所有边框和背景色 */\r\n *, *::before, *::after {\r\n -webkit-print-color-adjust: exact !important;\r\n print-color-adjust: exact !important;\r\n }\r\n\r\n /* 移除 focus ring(打印无意义),但不影响 border/box-shadow */\r\n .mat-mdc-form-field-focus-overlay {\r\n display: none !important;\r\n }\r\n .mat-mdc-focus-indicator::after {\r\n display: none !important;\r\n }\r\n\r\n /* 确保表单字段间有合理间距,顶部留空防止 float-label 跨页被裁切 */\r\n .cmat-print-body .mat-mdc-form-field {\r\n margin-bottom: 0.25em !important;\r\n margin-top: 0.5em !important;\r\n }\r\n\r\n /* Repeat 容器内的字段减少顶部间距 */\r\n .cmat-print-body .repeat-field .mat-mdc-form-field {\r\n margin-top: 0 !important;\r\n }\r\n\r\n .cmat-print-body formly-field {\r\n display: block;\r\n margin-bottom: 0.25em !important;\r\n }\r\n /* 修复 flex-auto 在打印上下文中的布局问题 */\r\n .cmat-print-body formly-form.flex-auto,\r\n .cmat-print-body formly-form[class*=\"flex-auto\"] {\r\n flex: none !important;\r\n }\r\n\r\n /* 确保 mat-hint(Description)可见,但不过宽 */\r\n .cmat-print-body .mat-mdc-form-field-subscript-wrapper {\r\n overflow: visible !important;\r\n height: auto !important;\r\n max-height: none !important;\r\n position: relative !important;\r\n padding-top: 2px !important;\r\n }\r\n .cmat-print-body .mat-mdc-form-field-hint {\r\n color: #555 !important;\r\n opacity: 1 !important;\r\n display: block !important;\r\n line-height: 1.2 !important;\r\n }\r\n\r\n /* Chips:确保打印时正确布局 */\r\n .cmat-print-body .mat-mdc-chip-grid {\r\n display: flex !important;\r\n flex-wrap: wrap !important;\r\n gap: 4px !important;\r\n align-items: center !important;\r\n }\r\n .cmat-print-body .mat-mdc-chip-row {\r\n display: inline-flex !important;\r\n align-items: center !important;\r\n\r\n .mat-mdc-chip-action{\r\n padding-right:12px !important;\r\n }\r\n }\r\n /* 隐藏 chip 内的输入框和自动补全 */\r\n .cmat-print-body .mat-mdc-chip-grid input {\r\n display: none !important;\r\n }\r\n .cmat-print-body .mat-mdc-autocomplete {\r\n display: none !important;\r\n }\r\n\r\n /* Color Picker:确保色块按钮的 ::after 伪元素背景色被打印 */\r\n .cmat-print-body .mat-mdc-form-field-icon-prefix button {\r\n overflow: visible !important;\r\n padding: 4px !important;\r\n width: 32px !important;\r\n height: 32px !important;\r\n min-width: 32px !important;\r\n min-height: 32px !important;\r\n }\r\n\r\n /* 通用:防止 overflow-hidden 裁切 border */\r\n .cmat-print-body .overflow-hidden {\r\n overflow: visible !important;\r\n }\r\n\r\n /* ─── 容器类型打印适配 ─── */\r\n\r\n /* Tabs:展开所有标签页内容,隐藏标签导航 */\r\n .cmat-print-body .mat-mdc-tab-header {\r\n display: none !important;\r\n }\r\n .cmat-print-body .mat-mdc-tab-body-wrapper {\r\n overflow: visible !important;\r\n height: auto !important;\r\n }\r\n .cmat-print-body .mat-mdc-tab-body {\r\n display: block !important;\r\n visibility: visible !important;\r\n opacity: 1 !important;\r\n height: auto !important;\r\n border-bottom: 1px dashed #ccc;\r\n padding-bottom: 12px;\r\n margin-bottom: 12px;\r\n }\r\n /* 在 tab body 前显示标签名 */\r\n .cmat-print-body .mat-mdc-tab-body::before {\r\n content: attr(aria-label);\r\n display: block;\r\n font-weight: 600;\r\n font-size: 1.1em;\r\n margin-bottom: 8px;\r\n color: #333;\r\n }\r\n\r\n /* Stepper:展开所有步骤,隐藏导航按钮 */\r\n .cmat-print-body .mat-horizontal-stepper-header-container {\r\n display: none !important;\r\n }\r\n .cmat-print-body .mat-stepper-horizontal-line {\r\n display: none !important;\r\n }\r\n .cmat-print-body .mat-step {\r\n display: block !important;\r\n visibility: visible !important;\r\n opacity: 1 !important;\r\n height: auto !important;\r\n overflow: visible !important;\r\n margin-bottom: 16px;\r\n padding-bottom: 12px;\r\n border-bottom: 1px dashed #ccc;\r\n }\r\n /* 显示步骤标签 */\r\n .cmat-print-body .mat-step-label {\r\n display: block !important;\r\n font-weight: 600;\r\n font-size: 1.1em;\r\n margin-bottom: 8px;\r\n color: #333;\r\n }\r\n\r\n /* Expansion:强制展开面板 */\r\n .cmat-print-body .mat-expansion-panel {\r\n break-inside: avoid;\r\n margin-bottom: 8px;\r\n }\r\n .cmat-print-body .mat-expansion-panel-content {\r\n height: auto !important;\r\n visibility: visible !important;\r\n opacity: 1 !important;\r\n overflow: visible !important;\r\n display: block !important;\r\n }\r\n\r\n /* ─── 报表组件打印适配 ─── */\r\n\r\n /* 报表渲染器组件宿主:Angular 自定义元素默认 display:inline,需强制 block + 100% 宽度以填满网格单元格 */\r\n .cmat-print-body app-chart-renderer,\r\n .cmat-print-body app-table-renderer,\r\n .cmat-print-body app-text-renderer {\r\n display: block !important;\r\n width: 100% !important;\r\n min-width: 0 !important;\r\n box-sizing: border-box !important;\r\n }\r\n\r\n /* 报表主容器:解除滚动容器的固定高度约束 + 阻止 flex 拉伸 */\r\n .cmat-print-body > main,\r\n .cmat-print-body .overflow-y-auto,\r\n .cmat-print-body .overflow-auto {\r\n overflow: visible !important;\r\n height: auto !important;\r\n min-height: 0 !important;\r\n max-height: none !important;\r\n flex: none !important;\r\n }\r\n\r\n /* 报表行容器:恢复 flex gap-6 间距(gap 不在 computed style 内联列表中,需手动补回) */\r\n .cmat-print-body .flex.flex-col.gap-6 {\r\n gap: 1.5rem !important;\r\n }\r\n\r\n /* 报表网格:强制 12 列布局(不依赖媒体查询) */\r\n .cmat-print-body .grid {\r\n display: grid !important;\r\n grid-template-columns: repeat(12, minmax(0, 1fr)) !important;\r\n gap: 0.75rem !important;\r\n }\r\n /* col-span 工具类覆盖(含响应式前缀) */\r\n .cmat-print-body .grid > .col-span-1 { grid-column: span 1 / span 1 !important; }\r\n .cmat-print-body .grid > .col-span-2 { grid-column: span 2 / span 2 !important; }\r\n .cmat-print-body .grid > .col-span-3 { grid-column: span 3 / span 3 !important; }\r\n .cmat-print-body .grid > .col-span-4 { grid-column: span 4 / span 4 !important; }\r\n .cmat-print-body .grid > .col-span-6 { grid-column: span 6 / span 6 !important; }\r\n .cmat-print-body .grid > .col-span-12 { grid-column: span 12 / span 12 !important; }\r\n /* Tailwind 响应式前缀 md:/lg: 的 col-span 类 */\r\n .cmat-print-body .grid > [class*=\"\\\\:col-span-4\"] { grid-column: span 4 / span 4 !important; }\r\n .cmat-print-body .grid > [class*=\"\\\\:col-span-6\"] { grid-column: span 6 / span 6 !important; }\r\n .cmat-print-body .grid > [class*=\"\\\\:col-span-12\"] { grid-column: span 12 / span 12 !important; }\r\n\r\n /* 报表图表:限制打印高度,为表格留出空间 */\r\n .cmat-print-body .chart-container {\r\n overflow: hidden !important;\r\n break-inside: avoid;\r\n max-height: 100mm !important;\r\n }\r\n .cmat-print-body .chart-canvas {\r\n overflow: hidden !important;\r\n height: auto !important;\r\n max-height: 95mm !important;\r\n }\r\n /* ECharts 渲染容器 div:约束到父级宽度,防止固定像素内联样式溢出 */\r\n .cmat-print-body .chart-canvas > div {\r\n max-width: 100% !important;\r\n box-sizing: border-box !important;\r\n }\r\n .cmat-print-body .chart-canvas img {\r\n max-width: 100% !important;\r\n height: auto !important;\r\n display: block !important;\r\n }\r\n\r\n /* 报表表格容器:移除 overflow 和 max-height 约束 + 约束到页面宽度 */\r\n .cmat-print-body .table-container {\r\n overflow: visible !important;\r\n height: auto !important;\r\n max-height: none !important;\r\n min-height: 0 !important;\r\n max-width: 100% !important;\r\n box-sizing: border-box !important;\r\n break-inside: auto !important;\r\n }\r\n .cmat-print-body .table-wrapper {\r\n overflow: visible !important;\r\n max-height: none !important;\r\n height: auto !important;\r\n max-width: 100% !important;\r\n box-sizing: border-box !important;\r\n break-inside: auto !important;\r\n }\r\n /* 报表表格:强制适应页面宽度,列均分 + 允许跨页分割 */\r\n .cmat-print-body table[mat-table] {\r\n width: 100% !important;\r\n max-width: 100% !important;\r\n table-layout: fixed !important;\r\n font-size: 11px !important;\r\n break-inside: auto !important;\r\n }\r\n /* 报表表格单元格:清除内联固定宽度,允许文字换行 */\r\n .cmat-print-body table[mat-table] td,\r\n .cmat-print-body table[mat-table] th {\r\n width: auto !important;\r\n word-break: break-word !important;\r\n overflow-wrap: break-word !important;\r\n white-space: normal !important;\r\n padding: 4px 8px !important;\r\n }\r\n /* 报表表格 tbody:允许跨页分割 */\r\n .cmat-print-body table[mat-table] tbody {\r\n break-inside: auto !important;\r\n display: table-row-group !important;\r\n }\r\n /* 报表表格行:防止单行被跨页截断 */\r\n .cmat-print-body table[mat-table] tr[mat-row],\r\n .cmat-print-body table[mat-table] tr[mat-row] td {\r\n break-inside: avoid !important;\r\n page-break-inside: avoid !important;\r\n }\r\n /* 隐藏报表分页组件 */\r\n .cmat-print-body .pagination-wrapper,\r\n .cmat-print-body cmat-pagination {\r\n display: none !important;\r\n }\r\n\r\n\r\n`;\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class CmatPrintService {\r\n\r\n /**\r\n * 打印指定 DOM 元素\r\n * 保留原始 DOM 结构和样式,同步表单控件的当前值\r\n */\r\n printElement(element: HTMLElement, options?: CmatPrintOptions): void {\r\n const clone = element.cloneNode(true) as HTMLElement;\r\n // 同步表单控件的 live value 到克隆节点的 attribute\r\n this._syncFormValues(element, clone);\r\n // 移除不需要打印的元素\r\n this._prepareForPrint(element, clone, options);\r\n const contentHtml = clone.outerHTML;\r\n this._print(contentHtml, options);\r\n }\r\n\r\n /**\r\n * 通过 CSS 选择器打印第一个匹配的元素\r\n */\r\n printSelector(selector: string, options?: CmatPrintOptions): void {\r\n const element = document.querySelector<HTMLElement>(selector);\r\n if (!element) {\r\n console.warn(`[CmatPrintService] 未找到匹配选择器的元素: ${selector}`);\r\n return;\r\n }\r\n this.printElement(element, options);\r\n }\r\n\r\n /**\r\n * 打印原始 HTML 字符串(不进行 DOM 转换,直接注入)\r\n */\r\n printHtml(html: string, options?: CmatPrintOptions): void {\r\n this._print(html, options);\r\n }\r\n\r\n /**\r\n * 调试模式:将生成的 HTML 在新标签页中打开,方便用 DevTools 检查布局\r\n * 调用方式:this._printService.debugPrint(el, { title: '报表' })\r\n */\r\n debugPrint(element: HTMLElement, options?: CmatPrintOptions): void {\r\n const clone = element.cloneNode(true) as HTMLElement;\r\n this._syncFormValues(element, clone);\r\n this._prepareForPrint(element, clone, options);\r\n const contentHtml = clone.outerHTML;\r\n\r\n const title = options?.title ?? '打印调试';\r\n const orientation = options?.orientation ?? 'portrait';\r\n const margins = options?.margins ?? { top: 15, right: 15, bottom: 15, left: 15 };\r\n const marginStr = `${margins.top}mm ${margins.right}mm ${margins.bottom}mm ${margins.left}mm`;\r\n const overrideCss = PRINT_OVERRIDE_CSS\r\n .replace('var(--orientation)', orientation)\r\n .replace('var(--margins)', marginStr);\r\n // 关键:转换所有媒体查询,使 debug 标签页(screen 上下文)与实际打印(print 上下文)一致\r\n // 1. @media screen → @media all(与实际打印一致)\r\n // 2. @media print → @media all(让打印规则在 screen 中也生效)\r\n const pageStyles = this._collectAllStyles()\r\n .replace(/@media\\s+print\\s+and\\s*\\(/g, '@media (')\r\n .replace(/@media\\s+print\\s*\\{/g, '@media all {')\r\n .replace(/@media\\s+screen\\s+and\\s*\\(/g, '@media (')\r\n .replace(/@media\\s+screen\\s*\\{/g, '@media all {')\r\n .replace(/@media\\s+only\\s+screen\\s+and\\s*\\(/g, '@media (')\r\n .replace(/@media\\s+only\\s+screen\\s*\\{/g, '@media all {');\r\n const cssVars = this._collectCssVariables();\r\n const htmlClass = document.documentElement.className || 'light';\r\n const bodyClass = this._getPrintBodyClass();\r\n\r\n const fullHtml = `<!DOCTYPE html>\r\n<html lang=\"zh-CN\" class=\"${htmlClass}\" style=\"${cssVars}\">\r\n<head>\r\n <meta charset=\"utf-8\">\r\n <base href=\"${document.baseURI}\">\r\n <title>[DEBUG] ${this._escapeHtml(title)}</title>\r\n ${pageStyles}\r\n <style>${overrideCss}${options?.customCss ?? ''}</style>\r\n <style>\r\n /* 调试模式专属:模拟 A4 页面宽度 */\r\n body { background: #e0e0e0 !important; }\r\n .cmat-debug-page {\r\n max-width: 180mm;\r\n margin-left: auto !important;\r\n margin-right: auto !important;\r\n background: #fff;\r\n box-shadow: 0 2px 8px rgba(0,0,0,0.15);\r\n padding: ${margins.top}mm ${margins.right}mm ${margins.bottom}mm ${margins.left}mm;\r\n min-height: 297mm;\r\n }\r\n </style>\r\n</head>\r\n<body class=\"${bodyClass}\">\r\n <div style=\"background:#fff3cd;padding:8px 16px;text-align:center;font-size:14px;border-bottom:2px solid #ffc107;\">\r\n 🔧 <strong>调试模式</strong> — 此页面为打印预览 HTML,可用 DevTools 检查元素。\r\n 按 Ctrl+P 可触发实际打印。\r\n </div>\r\n <div class=\"cmat-debug-page\">\r\n <div class=\"cmat-print-body\">${contentHtml}</div>\r\n </div>\r\n</body>\r\n</html>`;\r\n\r\n const blob = new Blob([fullHtml], { type: 'text/html' });\r\n const url = URL.createObjectURL(blob);\r\n window.open(url, '_blank');\r\n // 延迟释放,确保页面加载完成\r\n setTimeout(() => URL.revokeObjectURL(url), 60000);\r\n }\r\n\r\n // ─── 私有方法 ───────────────────────────────────────────────\r\n\r\n /**\r\n * 同步原始 DOM 中表单控件的当前值到克隆节点\r\n * cloneNode() 不会复制 input.value 等 live property,\r\n * 必须手动同步为 HTML attribute 才能在 iframe 中正确渲染\r\n */\r\n private _syncFormValues(original: HTMLElement, clone: HTMLElement): void {\r\n const origFields = original.querySelectorAll<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>(\r\n 'input, textarea, select'\r\n );\r\n const cloneFields = clone.querySelectorAll<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>(\r\n 'input, textarea, select'\r\n );\r\n\r\n origFields.forEach((origField, i) => {\r\n const cloneField = cloneFields[i];\r\n if (!cloneField) return;\r\n\r\n if (origField instanceof HTMLInputElement) {\r\n const cloneInput = cloneField as HTMLInputElement;\r\n // 同步 value attribute\r\n cloneInput.setAttribute('value', origField.value);\r\n // 同步 checked 状态\r\n if (origField.type === 'checkbox' || origField.type === 'radio') {\r\n if (origField.checked) {\r\n cloneInput.setAttribute('checked', '');\r\n } else {\r\n cloneInput.removeAttribute('checked');\r\n }\r\n }\r\n } else if (origField instanceof HTMLTextAreaElement) {\r\n // textarea 的值通过 textContent 同步\r\n cloneField.textContent = origField.value;\r\n } else if (origField instanceof HTMLSelectElement) {\r\n const cloneSelect = cloneField as HTMLSelectElement;\r\n Array.from(origField.options).forEach((opt, idx) => {\r\n const cloneOpt = cloneSelect.options[idx];\r\n if (!cloneOpt) return;\r\n if (opt.selected) {\r\n cloneOpt.setAttribute('selected', '');\r\n } else {\r\n cloneOpt.removeAttribute('selected');\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * 最小化打印准备:DOM 转换 + 清理\r\n * 对无法正确打印的组件进行 DOM 替换,对关键元素复制 computed style\r\n */\r\n private _prepareForPrint(original: HTMLElement, root: HTMLElement, options?: CmatPrintOptions): void {\r\n // 移除标记为不打印的元素\r\n root.querySelectorAll('.print\\\\:hidden, [data-print-exclude]').forEach(el => el.remove());\r\n\r\n // ── 移除 ECharts 交互层:tooltip、axis-pointer 等悬浮 DOM,打印时不应显示 ──\r\n root.querySelectorAll('.el-tooltip__popper, [style*=\"pointer-events\"]').forEach((el) => {\r\n if (el.closest('.chart-container, .chart-canvas, [class*=\"echarts\"]')) {\r\n el.remove();\r\n }\r\n });\r\n\r\n // 移除所有按钮(保留 form-field 前缀/后缀按钮、chip 内按钮和 slide-toggle 开关)\r\n root.querySelectorAll('button').forEach((el) => {\r\n const isPrefixSuffix = el.closest(\r\n '.mat-mdc-form-field-icon-prefix, .mat-mdc-form-field-icon-suffix, ' +\r\n '.mat-mdc-form-field-text-prefix, .mat-mdc-form-field-text-suffix'\r\n );\r\n const isChipButton = el.closest('.mat-mdc-chip-row');\r\n const isSwitch = el.classList.contains('mdc-switch');\r\n if (!isPrefixSuffix && !isChipButton && !isSwitch) {\r\n el.remove();\r\n }\r\n });\r\n\r\n \r\n // ── Canvas → Image:克隆不复制 canvas 位图,需转为 img 保留 ECharts 等图表内容 ──\r\n const origCanvases = original.querySelectorAll<HTMLCanvasElement>('canvas');\r\n const cloneCanvases = root.querySelectorAll<HTMLCanvasElement>('canvas');\r\n origCanvases.forEach((origCanvas, i) => {\r\n const cloneCanvas = cloneCanvases[i];\r\n if (!cloneCanvas) return;\r\n try {\r\n const dataUrl = origCanvas.toDataURL('image/png');\r\n const img = document.createElement('img');\r\n img.src = dataUrl;\r\n img.style.width = '100%';\r\n img.style.height = 'auto';\r\n img.style.display = 'block';\r\n cloneCanvas.parentNode?.replaceChild(img, cloneCanvas);\r\n } catch (e) {\r\n console.warn('[CmatPrintService] Canvas 转图片失败:', e);\r\n }\r\n });\r\n\r\n // ── Chips:移除删除按钮的内容(图标),保持 chip 布局 ──\r\n root.querySelectorAll<HTMLElement>('.mat-mdc-chip-row button[matChipRemove]').forEach((btn) => {\r\n btn.innerHTML = '';\r\n btn.style.cssText = 'display:none !important;';\r\n });\r\n\r\n // ── Description (mat-hint):强制紧凑布局 ──\r\n root.querySelectorAll<HTMLElement>('.mat-mdc-form-field-subscript-wrapper').forEach((wrapper) => {\r\n wrapper.style.cssText += ';overflow:visible!important;height:auto!important;min-height:0!important;max-height:none!important;' +\r\n 'position:relative!important;padding:0!important;margin:0!important;line-height:1!important;font-size:0.85em!important;';\r\n });\r\n\r\n // ── 复制关键元素的 computed style 为 inline style ──\r\n this._inlineComputedStyles(original, root);\r\n\r\n // ── 报表组件:在 computed style 复制后,用 DOM inline !important 强制修复 ──\r\n\r\n // 根元素(通常是 <main>):解除滚动容器的固定高度约束 + 约束到页面宽度\r\n root.style.setProperty('overflow', 'visible', 'important');\r\n root.style.setProperty('height', 'auto', 'important');\r\n root.style.setProperty('min-height', '0', 'important');\r\n root.style.setProperty('max-height', 'none', 'important');\r\n root.style.setProperty('max-width', '100%', 'important');\r\n root.style.setProperty('box-sizing', 'border-box', 'important');\r\n // 所有滚动容器:解除 overflow/height 约束,防止内容被裁切 + 阻止 flex 拉伸\r\n root.querySelectorAll<HTMLElement>('[class*=\"overflow-y-auto\"], [class*=\"overflow-auto\"]').forEach((el) => {\r\n el.style.setProperty('overflow', 'visible', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('max-height', 'none', 'important');\r\n el.style.setProperty('flex', 'none', 'important');\r\n });\r\n // 外层 flex 容器:恢复 gap-6 间距 + 约束到页面宽度 + 清除 margin + 高度由内容决定\r\n root.querySelectorAll<HTMLElement>('[class*=\"gap-6\"]').forEach((el) => {\r\n el.style.setProperty('gap', '1.5rem', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('margin', '0', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('flex', 'none', 'important');\r\n });\r\n\r\n // 网格容器:强制 12 列布局(inline !important 覆盖任何 computed style 内联值)\r\n root.querySelectorAll<HTMLElement>('.grid').forEach((el) => {\r\n // 只处理包含 col-span 子元素的网格(报表布局网格),避免影响其他网格\r\n if (!el.querySelector('[class*=\"col-span\"]')) return;\r\n el.style.setProperty('display', 'grid', 'important');\r\n el.style.setProperty('grid-template-columns', 'repeat(12, minmax(0, 1fr))', 'important');\r\n // 恢复 gap-3(gap 不在 _inlineComputedStyles 属性列表中,需手动补回)\r\n el.style.setProperty('gap', '0.75rem', 'important');\r\n // 重置网格行容器的固定高度 + 清除 margin + 高度由内容决定\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('max-height', 'none', 'important');\r\n el.style.setProperty('overflow', 'visible', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('margin', '0', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n // 遍历子元素,根据 col-span 类名设置 grid-column\r\n Array.from(el.children).forEach((child) => {\r\n const childEl = child as HTMLElement;\r\n const classes = child.className || '';\r\n // 提取最大的 col-span 值(优先 lg: > md: > 无后缀)\r\n const lgMatch = /lg:col-span-(\\d+)/.exec(classes);\r\n const mdMatch = /md:col-span-(\\d+)/.exec(classes);\r\n const baseMatch = /(?:^|\\s)col-span-(\\d+)/.exec(classes);\r\n let span = lgMatch?.[1] ?? mdMatch?.[1] ?? baseMatch?.[1];\r\n\r\n // 图表容器:强制占满整行(A4 宽度不足以并排显示两个图表)\r\n if (childEl.querySelector('.chart-container')) {\r\n span = '12';\r\n }\r\n\r\n if (span) {\r\n childEl.style.cssText = '';\r\n childEl.style.setProperty('grid-column', `span ${span} / span ${span}`, 'important');\r\n // 重置固定像素宽高,让网格轨道控制尺寸\r\n childEl.style.setProperty('width', 'auto', 'important');\r\n childEl.style.setProperty('max-width', '100%', 'important');\r\n childEl.style.setProperty('min-width', '0', 'important');\r\n childEl.style.setProperty('height', 'auto', 'important');\r\n childEl.style.setProperty('min-height', '0', 'important');\r\n childEl.style.setProperty('max-height', 'none', 'important');\r\n childEl.style.setProperty('margin', '0', 'important');\r\n // 允许网格子元素跨页分割,防止内容被整体推到下一页\r\n childEl.style.setProperty('break-inside', 'auto', 'important');\r\n }\r\n });\r\n });\r\n\r\n // table-wrapper:彻底清除内联样式(含 _inlineComputedStyles 设置的固定像素值)+ 重新设置\r\n root.querySelectorAll<HTMLElement>('.table-wrapper').forEach((el) => {\r\n el.style.cssText = '';\r\n el.style.setProperty('overflow', 'visible', 'important');\r\n el.style.setProperty('max-height', 'none', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n });\r\n root.querySelectorAll<HTMLElement>('.table-container').forEach((el) => {\r\n el.style.cssText = '';\r\n el.style.setProperty('overflow', 'visible', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('max-height', 'none', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('margin', '0', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n });\r\n // 表格:强制 100% 宽度 + fixed 布局 + 允许跨页分割\r\n root.querySelectorAll<HTMLElement>('table[mat-table]').forEach((el) => {\r\n el.style.setProperty('width', '100%', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('table-layout', 'fixed', 'important');\r\n el.style.setProperty('break-inside', 'auto', 'important');\r\n });\r\n // 表格单元格:清除内联固定宽度 + 允许文字换行\r\n root.querySelectorAll<HTMLElement>('table[mat-table] td, table[mat-table] th').forEach((el) => {\r\n // 清除列的内联 width(来自 column.width 配置),让 table-layout:auto 自动分配\r\n el.style.removeProperty('width');\r\n el.style.setProperty('word-break', 'break-word', 'important');\r\n el.style.setProperty('overflow-wrap', 'break-word', 'important');\r\n el.style.setProperty('white-space', 'normal', 'important');\r\n el.style.setProperty('padding', '4px 8px', 'important');\r\n });\r\n // 报表渲染器组件宿主:彻底清除内联样式 + 强制 block + 100% 宽度 + 允许跨页\r\n root.querySelectorAll<HTMLElement>('app-chart-renderer, app-table-renderer, app-text-renderer').forEach((el) => {\r\n el.style.cssText = '';\r\n el.style.setProperty('display', 'block', 'important');\r\n el.style.setProperty('width', '100%', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('min-width', '0', 'important');\r\n el.style.setProperty('margin', '0', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n el.style.setProperty('break-inside', 'auto', 'important');\r\n });\r\n // chart-container / chart-canvas / img:彻底清除残留内联样式,重新设置打印友好样式\r\n // 使用 cssText='' 清除所有内联样式(包括 _inlineComputedStyles 可能设置的固定像素值)\r\n root.querySelectorAll<HTMLElement>('.chart-container').forEach((el) => {\r\n el.style.cssText = '';\r\n el.style.setProperty('width', '100%', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('min-width', '0', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('max-height', '100mm', 'important');\r\n el.style.setProperty('overflow', 'hidden', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n });\r\n root.querySelectorAll<HTMLElement>('.chart-canvas').forEach((el) => {\r\n el.style.cssText = '';\r\n el.style.setProperty('width', '100%', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('min-width', '0', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n el.style.setProperty('max-height', '95mm', 'important');\r\n el.style.setProperty('overflow', 'hidden', 'important');\r\n el.style.setProperty('box-sizing', 'border-box', 'important');\r\n // 关键:ECharts 在 .chart-canvas 内创建的渲染容器 div 有固定像素内联宽度\r\n // 必须清除并约束,否则其内部的 img(width:100%) 基于桌面宽度解析\r\n Array.from(el.children).forEach((child) => {\r\n if (child.tagName === 'DIV') {\r\n const childEl = child as HTMLElement;\r\n childEl.style.cssText = '';\r\n childEl.style.setProperty('width', '100%', 'important');\r\n childEl.style.setProperty('max-width', '100%', 'important');\r\n childEl.style.setProperty('min-width', '0', 'important');\r\n childEl.style.setProperty('height', 'auto', 'important');\r\n childEl.style.setProperty('box-sizing', 'border-box', 'important');\r\n }\r\n });\r\n });\r\n // 图表图片:img 在 ECharts 子 div 内部,用后代选择器\r\n root.querySelectorAll<HTMLImageElement>('.chart-canvas img').forEach((img) => {\r\n img.style.cssText = '';\r\n img.style.setProperty('width', '100%', 'important');\r\n img.style.setProperty('max-width', '100%', 'important');\r\n img.style.setProperty('height', 'auto', 'important');\r\n img.style.setProperty('display', 'block', 'important');\r\n });\r\n\r\n // metric-card:重置固定尺寸,允许内容自适应 A4 网格\r\n root.querySelectorAll<HTMLElement>('.metric-card').forEach((el) => {\r\n el.style.setProperty('width', '100%', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('min-width', '0', 'important');\r\n el.style.setProperty('height', 'auto', 'important');\r\n el.style.setProperty('min-height', '0', 'important');\r\n });\r\n // metric 子元素:重置固定尺寸,允许文字换行\r\n root.querySelectorAll<HTMLElement>('.metric-card .value, .metric-card .label, .metric-card .prefix, .metric-card .suffix').forEach((el) => {\r\n el.style.setProperty('width', 'auto', 'important');\r\n el.style.setProperty('max-width', '100%', 'important');\r\n el.style.setProperty('white-space', 'normal', 'important');\r\n el.style.setProperty('overflow-wrap', 'break-word', 'important');\r\n });\r\n\r\n // ── Expansion:强制展开所有面板 ──\r\n root.querySelectorAll<HTMLElement>('.mat-expansion-panel').forEach((panel) => {\r\n panel.classList.add('mat-expanded');\r\n });\r\n\r\n // 移除用户自定义排除选择器\r\n options?.excludeSelectors?.forEach((selector) => {\r\n root.querySelectorAll(selector).forEach(el => el.remove());\r\n });\r\n }\r\n\r\n /**\r\n * 将原始页面中关键元素的 computed style 复制为 inline style\r\n * 确保 iframe 中即使 CSS 规则不生效,样式也能通过 inline style 保留\r\n */\r\n private _inlineComputedStyles(original: HTMLElement, root: HTMLElement): void {\r\n\r\n // 需要复制 computed style 的选择器列表\r\n // 注意:不包含 .mdc-switch* 和 .mdc-slider*,这些组件的 computed style 可能包含 opacity:0 等不适合打印的值\r\n const selectors = [\r\n '.mat-mdc-form-field-subscript-wrapper',\r\n '.mat-mdc-chip-row',\r\n '.mat-mdc-chip',\r\n // 报表组件:Angular 属性选择器在克隆节点失效,需内联 computed style\r\n // 注意:.chart-container 不在此列表 — 其桌面端固定像素宽高+overflow:hidden 会污染打印输出\r\n '.metric-card',\r\n '.metric-card .value',\r\n '.metric-card .prefix',\r\n '.metric-card .suffix',\r\n '.metric-card .label',\r\n '.table-container',\r\n '.table-wrapper',\r\n ];\r\n\r\n // 从原始元素(而非 document)查找匹配元素,确保索引与克隆节点匹配\r\n for (const selector of selectors) {\r\n const originals = original.querySelectorAll<HTMLElement>(selector);\r\n const clones = root.querySelectorAll<HTMLElement>(selector);\r\n originals.forEach((orig, i) => {\r\n const clone = clones[i];\r\n if (!clone) return;\r\n const computed = getComputedStyle(orig);\r\n // 复制关键属性\r\n const props = ['display', 'visibility', 'opacity', 'overflow', 'width', 'height',\r\n 'min-width', 'min-height', 'max-width', 'max-height', 'padding', 'margin',\r\n 'border', 'border-radius', 'background-color', 'color', 'font-size', 'font-weight',\r\n 'line-height', 'position', 'top', 'left', 'right', 'bottom', 'flex', 'flex-direction',\r\n 'align-items', 'justify-content', 'gap', 'box-shadow', 'transform'];\r\n for (const prop of props) {\r\n const val = computed.getPropertyValue(prop);\r\n if (val) {\r\n clone.style.setProperty(prop, val, 'important');\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n /** 构建完整 HTML 并注入 iframe 执行打印 */\r\n private _print(contentHtml: string, options?: CmatPrintOptions): void {\r\n const title = options?.title ?? '打印';\r\n const orientation = options?.orientation ?? 'portrait';\r\n const margins = options?.margins ?? { top: 15, right: 15, bottom: 15, left: 15 };\r\n const now = new Date();\r\n const timeStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;\r\n\r\n // 页眉\r\n let headerHtml = '';\r\n if (options?.header !== null) {\r\n headerHtml = options?.header ?? `\r\n <div class=\"cmat-print-header\">\r\n <h1>${this._escapeHtml(title)}</h1>\r\n <div class=\"cmat-print-time\">打印时间:${timeStr}</div>\r\n </div>\r\n `;\r\n }\r\n\r\n // 页脚\r\n let footerHtml = '';\r\n if (options?.footer !== null) {\r\n footerHtml = options?.footer ?? `\r\n <div class=\"cmat-print-footer\">\r\n 此文档由系统生成 · ${timeStr}\r\n </div>\r\n `;\r\n }\r\n\r\n // 收集页面已有样式(通过 styleSheets API 完整收集)\r\n const pageStyles = this._collectAllStyles();\r\n\r\n // 收集 CSS 自定义属性(变量),确保 iframe 中边框颜色等不丢失\r\n const cssVars = this._collectCssVariables();\r\n\r\n // 复制原始页面的 html/body class(保留主题类名)\r\n const htmlClass = document.documentElement.className || 'light';\r\n const bodyClass = this._getPrintBodyClass();\r\n\r\n // 打印覆盖样式\r\n const marginStr = `${margins.top}mm ${margins.right}mm ${margins.bottom}mm ${margins.left}mm`;\r\n const overrideCss = PRINT_OVERRIDE_CSS\r\n .replace('var(--orientation)', orientation)\r\n .replace('var(--margins)', marginStr);\r\n\r\n const fullHtml = `<!DOCTYPE html>\r\n<html lang=\"zh-CN\" class=\"${htmlClass}\" style=\"${cssVars}\">\r\n<head>\r\n <meta charset=\"utf-8\">\r\n <base href=\"${document.baseURI}\">\r\n <title>${this._escapeHtml(title)}</title>\r\n ${pageStyles}\r\n <style>${overrideCss}${options?.customCss ?? ''}</style>\r\n</head>\r\n<body class=\"${bodyClass}\">\r\n ${headerHtml}\r\n <div class=\"cmat-print-body\">${contentHtml}</div>\r\n ${footerHtml}\r\n</body>\r\n</html>`;\r\n\r\n this._renderAndPrint(fullHtml, options);\r\n }\r\n\r\n /**\r\n * 通过 document.styleSheets API 收集所有样式规则\r\n * 关键处理:将 @media screen 转换为同时适用于 print\r\n * (因为 iframe 调用 print() 时媒体类型切换为 print,screen-only 规则会失效)\r\n */\r\n private _collectAllStyles(): string {\r\n const cssTexts: string[] = [];\r\n\r\n try {\r\n for (const sheet of Array.from(document.styleSheets)) {\r\n try {\r\n const rules = sheet.cssRules;\r\n if (!rules || rules.length === 0) continue;\r\n\r\n let cssText = '';\r\n for (const rule of Array.from(rules)) {\r\n cssText += rule.cssText + '\\n';\r\n }\r\n if (cssText.trim()) {\r\n cssTexts.push(`<style>${this._transformMediaForPrint(cssText)}</style>`);\r\n }\r\n } catch {\r\n // 跨域样式表无法读取 cssRules,使用 <link> 回退\r\n if (sheet.href) {\r\n cssTexts.push(`<link rel=\"stylesheet\" href=\"${sheet.href}\" media=\"all\">`);\r\n }\r\n }\r\n }\r\n } catch (e) {\r\n console.warn('[CmatPrintService] 样式收集异常:', e);\r\n }\r\n\r\n return cssTexts.join('\\n ');\r\n }\r\n\r\n /**\r\n * 将 @media screen 相关查询转换为同时适用 print\r\n * 确保打印时不丢失屏幕样式(如表格奇偶行、border 等)\r\n */\r\n private _transformMediaForPrint(css: string): string {\r\n // @media screen and (...) → @media (...)\r\n // @media screen → 移除 media 类型限制\r\n return css\r\n .replace(/@media\\s+screen\\s+and\\s*\\(/g, '@media (')\r\n .replace(/@media\\s+screen\\s*\\{/g, '@media all {')\r\n .replace(/@media\\s+only\\s+screen\\s+and\\s*\\(/g, '@media (')\r\n .replace(/@media\\s+only\\s+screen\\s*\\{/g, '@media all {');\r\n }\r\n\r\n /**\r\n * 收集页面 :root 上的所有 CSS 自定义属性(变量)\r\n * 这些变量定义了 Material/Tailwind 的边框颜色、主题色等\r\n * 克隆到 iframe 时祖先链断裂,需要手动复制\r\n */\r\n private _collectCssVariables(): string {\r\n const vars: string[] = [];\r\n const rootStyles = getComputedStyle(document.documentElement);\r\n\r\n // 从 document.styleSheets 中提取 :root 规则里的自定义属性\r\n try {\r\n for (const sheet of Array.from(document.styleSheets)) {\r\n try {\r\n const rules = sheet.cssRules;\r\n if (!rules) continue;\r\n for (const rule of Array.from(rules)) {\r\n if (rule instanceof CSSStyleRule) {\r\n const selector = rule.selectorText;\r\n if (selector === ':root' || selector === 'html' || selector === ':root, html') {\r\n const props = Array.from({ length: rule.style.length }, (_, i) => rule.style[i]);\r\n for (const prop of props) {\r\n if (prop.startsWith('--')) {\r\n vars.push(`${prop}: ${rule.style.getPropertyValue(prop)}`);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } catch {\r\n // 跨域样式表跳过\r\n }\r\n }\r\n } catch (e) {\r\n console.warn('[CmatPrintService] CSS变量收集异常:', e);\r\n }\r\n\r\n // 补充:从 computed style 获取运行时可能动态设置的变量\r\n // 遍历常见的 Material/Tailwind 变量前缀\r\n const prefixes = ['--mdc-', '--mat-', '--md-', '--tw-', '--ck-', '--color-', '--border-'];\r\n const rootProps = Array.from({ length: rootStyles.length }, (_, i) => rootStyles[i]);\r\n for (const prop of rootProps) {\r\n if (prop.startsWith('--') && prefixes.some(p => prop.startsWith(p))) {\r\n const value = rootStyles.getPropertyValue(prop);\r\n if (value && !vars.some(v => v.startsWith(prop + ':'))) {\r\n vars.push(`${prop}: ${value.trim()}`);\r\n }\r\n }\r\n }\r\n\r\n return vars.join('; ');\r\n }\r\n\r\n /** 获取打印用的 body class(复制原始页面的主题类名,移除布局类名) */\r\n private _getPrintBodyClass(): string {\r\n const bodyClasses = document.body.className.split(/\\s+/);\r\n // 保留主题相关 class,移除布局/滚动类\r\n const excludeClasses = new Set(['overflow-hidden', 'h-full', 'w-full', 'h-screen', 'w-screen']);\r\n return bodyClasses\r\n .filter(c => c && !excludeClasses.has(c))\r\n .join(' ');\r\n }\r\n\r\n /** 创建隐藏 iframe,写入内容,触发打印 */\r\n private _renderAndPrint(html: string, options?: CmatPrintOptions): void {\r\n const iframe = document.createElement('iframe');\r\n // 放在屏幕后方但保持全视口尺寸渲染,确保 Tailwind 响应式断点正常触发\r\n iframe.style.position = 'fixed';\r\n iframe.style.left = '0';\r\n iframe.style.top = '0';\r\n iframe.style.width = '100vw';\r\n iframe.style.height = '100vh';\r\n iframe.style.border = '0';\r\n iframe.style.visibility = 'hidden';\r\n iframe.style.zIndex = '-1';\r\n iframe.style.pointerEvents = 'none';\r\n document.body.appendChild(iframe);\r\n\r\n const cleanup = (): void => {\r\n iframe.remove();\r\n options?.afterPrint?.();\r\n };\r\n\r\n iframe.onload = (): void => {\r\n // 给渲染一点时间(图片、字体等)\r\n setTimeout(() => {\r\n try {\r\n iframe.contentWindow?.focus();\r\n iframe.contentWindow?.print();\r\n } catch (e) {\r\n console.error('[CmatPrintService] 打印失败:', e);\r\n }\r\n\r\n // 监听打印完成(兼容处理)\r\n if (iframe.contentWindow) {\r\n iframe.contentWindow.onafterprint = cleanup;\r\n // 兜底:部分浏览器不触发 onafterprint\r\n setTimeout(cleanup, 60000);\r\n } else {\r\n cleanup();\r\n }\r\n }, 300);\r\n };\r\n\r\n // 使用 srcdoc 替代已废弃的 document.write\r\n iframe.srcdoc = html;\r\n }\r\n\r\n /** HTML 转义 */\r\n private _escapeHtml(text: string): string {\r\n const div = document.createElement('div');\r\n div.textContent = text;\r\n return div.innerHTML;\r\n }\r\n}\r\n"],"mappings":";;AAIA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2c3B,IAAa,mBAAb,MAAa,iBAAgB;CAMzB,aAAa,SAAsB,SAA0B;EACzD,MAAM,QAAQ,QAAQ,UAAU,IAAI;EAEpC,KAAK,gBAAgB,SAAS,KAAK;EAEnC,KAAK,iBAAiB,SAAS,OAAO,OAAO;EAC7C,MAAM,cAAc,MAAM;EAC1B,KAAK,OAAO,aAAa,OAAO;CACpC;CAKA,cAAc,UAAkB,SAA0B;EACtD,MAAM,UAAU,SAAS,cAA2B,QAAQ;EAC5D,IAAI,CAAC,SAAS;GACV,QAAQ,KAAK,mCAAmC,UAAU;GAC1D;EACJ;EACA,KAAK,aAAa,SAAS,OAAO;CACtC;CAKA,UAAU,MAAc,SAA0B;EAC9C,KAAK,OAAO,MAAM,OAAO;CA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K,YAAY,MAAM;EAEhC,MAAM,gBAAqB;GACvB,OAAO,OAAM;GACb,SAAS,aAAY;EACzB;EAEA,OAAO,eAAoB;GAEvB,iBAAgB;IACZ,IAAI;KACA,OAAO,eAAe,MAAK;KAC3B,OAAO,eAAe,MAAK;IAC/B,SAAS,GAAG;KACR,QAAQ,MAAM,4BAA4B,CAAC;IAC/C;IAGA,IAAI,OAAO,eAAe;KACtB,OAAO,cAAc,eAAe;KAEpC,WAAW,SAAS,GAAK;IAC7B,OACI,QAAO;GAEf,GAAG,GAAG;EACV;EAGA,OAAO,SAAS;CACpB;CAGQ,YAAY,MAAY;EAC5B,MAAM,MAAM,SAAS,cAAc,KAAK;EACxC,IAAI,cAAc;EAClB,OAAO,IAAI;CACf;CA7qBS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAgB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAhB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAgB,YADH;EAAM,CAAA;CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAgB,YAAA,CAAA;EAD5B,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE"}
@@ -1,39 +1,54 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, DOCUMENT, DestroyRef, Injectable } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
- import { Router, NavigationEnd } from '@angular/router';
5
- import { filter, take } from 'rxjs/operators';
6
-
7
- class CmatSplashScreenService {
8
- constructor() {
9
- this._document = inject(DOCUMENT);
10
- this._router = inject(Router);
11
- this._destroyRef = inject(DestroyRef);
12
- this._router.events
13
- .pipe(takeUntilDestroyed(this._destroyRef), filter(event => event instanceof NavigationEnd), take(1))
14
- .subscribe(() => {
15
- this.hide();
16
- });
17
- }
18
- show() {
19
- this._document.body.classList.remove('cmat-splash-screen-hidden');
20
- }
21
- hide() {
22
- this._document.body.classList.add('cmat-splash-screen-hidden');
23
- }
24
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatSplashScreenService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
25
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatSplashScreenService, providedIn: 'root' }); }
26
- }
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatSplashScreenService, decorators: [{
28
- type: Injectable,
29
- args: [{
30
- providedIn: 'root'
31
- }]
32
- }], ctorParameters: () => [] });
33
-
34
- /**
35
- * Generated bundle index. Do not edit.
36
- */
37
-
1
+ import * as i0 from "@angular/core";
2
+ import { DOCUMENT, DestroyRef, Injectable, inject } from "@angular/core";
3
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
4
+ import { NavigationEnd, Router } from "@angular/router";
5
+ import { filter, take } from "rxjs/operators";
6
+ var CmatSplashScreenService = class CmatSplashScreenService {
7
+ constructor() {
8
+ this._document = inject(DOCUMENT);
9
+ this._router = inject(Router);
10
+ this._destroyRef = inject(DestroyRef);
11
+ this._router.events.pipe(takeUntilDestroyed(this._destroyRef), filter((event) => event instanceof NavigationEnd), take(1)).subscribe(() => {
12
+ this.hide();
13
+ });
14
+ }
15
+ show() {
16
+ this._document.body.classList.remove("cmat-splash-screen-hidden");
17
+ }
18
+ hide() {
19
+ this._document.body.classList.add("cmat-splash-screen-hidden");
20
+ }
21
+ static {
22
+ this.ɵfac = i0.ɵɵngDeclareFactory({
23
+ minVersion: "12.0.0",
24
+ version: "22.2.3",
25
+ ngImport: i0,
26
+ type: CmatSplashScreenService,
27
+ deps: [],
28
+ target: i0.ɵɵFactoryTarget.Injectable
29
+ });
30
+ }
31
+ static {
32
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
33
+ minVersion: "12.0.0",
34
+ version: "22.2.3",
35
+ ngImport: i0,
36
+ type: CmatSplashScreenService,
37
+ providedIn: "root"
38
+ });
39
+ }
40
+ };
41
+ i0.ɵɵngDeclareClassMetadata({
42
+ minVersion: "12.0.0",
43
+ version: "22.2.3",
44
+ ngImport: i0,
45
+ type: CmatSplashScreenService,
46
+ decorators: [{
47
+ type: Injectable,
48
+ args: [{ providedIn: "root" }]
49
+ }],
50
+ ctorParameters: () => []
51
+ });
38
52
  export { CmatSplashScreenService };
39
- //# sourceMappingURL=cmat-services-splash-screen.mjs.map
53
+
54
+ //# sourceMappingURL=cmat-services-splash-screen.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cmat-services-splash-screen.mjs","sources":["../../../projects/cmat/services/splash-screen/splash-screen.service.ts","../../../projects/cmat/services/splash-screen/cmat-services-splash-screen.ts"],"sourcesContent":["import { DestroyRef, Injectable, DOCUMENT, inject } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\nimport { filter, take } from 'rxjs/operators';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatSplashScreenService {\r\n private _document = inject(DOCUMENT);\r\n private _router = inject(Router);\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n constructor() {\r\n this._router.events\r\n .pipe(\r\n takeUntilDestroyed(this._destroyRef),\r\n filter(event => event instanceof NavigationEnd),\r\n take(1)\r\n )\r\n .subscribe(() => {\r\n this.hide();\r\n });\r\n }\r\n\r\n show(): void {\r\n this._document.body.classList.remove('cmat-splash-screen-hidden');\r\n }\r\n\r\n hide(): void {\r\n this._document.body.classList.add('cmat-splash-screen-hidden');\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAQa,uBAAuB,CAAA;AAKhC,IAAA,WAAA,GAAA;AAJQ,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;AACf,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;QAG7C,IAAI,CAAC,OAAO,CAAC;aACR,IAAI,CACD,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,EACpC,MAAM,CAAC,KAAK,IAAI,KAAK,YAAY,aAAa,CAAC,EAC/C,IAAI,CAAC,CAAC,CAAC;aAEV,SAAS,CAAC,MAAK;YACZ,IAAI,CAAC,IAAI,EAAE;AACf,QAAA,CAAC,CAAC;IACV;IAEA,IAAI,GAAA;QACA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,2BAA2B,CAAC;IACrE;IAEA,IAAI,GAAA;QACA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,2BAA2B,CAAC;IAClE;8GAvBS,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cAFpB,MAAM,EAAA,CAAA,CAAA;;2FAET,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAHnC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;ACPD;;AAEG;;"}
1
+ {"version":3,"file":"cmat-services-splash-screen.mjs","names":[],"sources":["../../../projects/cmat/services/splash-screen/splash-screen.service.ts"],"sourcesContent":["import { DestroyRef, Injectable, DOCUMENT, inject } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\nimport { filter, take } from 'rxjs/operators';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatSplashScreenService {\r\n private _document = inject(DOCUMENT);\r\n private _router = inject(Router);\r\n private readonly _destroyRef = inject(DestroyRef);\r\n\r\n constructor() {\r\n this._router.events\r\n .pipe(\r\n takeUntilDestroyed(this._destroyRef),\r\n filter(event => event instanceof NavigationEnd),\r\n take(1)\r\n )\r\n .subscribe(() => {\r\n this.hide();\r\n });\r\n }\r\n\r\n show(): void {\r\n this._document.body.classList.remove('cmat-splash-screen-hidden');\r\n }\r\n\r\n hide(): void {\r\n this._document.body.classList.add('cmat-splash-screen-hidden');\r\n }\r\n}\r\n"],"mappings":";;;;;AAQA,IAAa,0BAAb,MAAa,wBAAuB;CAKhC,cAAA;EAJQ,KAAA,YAAY,OAAO,QAAQ;EAC3B,KAAA,UAAU,OAAO,MAAM;EACd,KAAA,cAAc,OAAO,UAAU;EAG5C,KAAK,QAAQ,OACR,KACG,mBAAmB,KAAK,WAAW,GACnC,QAAO,UAAS,iBAAiB,aAAa,GAC9C,KAAK,CAAC,CAAC,CACV,CACA,gBAAe;GACZ,KAAK,KAAI;EACb,CAAC;CACT;CAEA,OAAI;EACA,KAAK,UAAU,KAAK,UAAU,OAAO,2BAA2B;CACpE;CAEA,OAAI;EACA,KAAK,UAAU,KAAK,UAAU,IAAI,2BAA2B;CACjE;CAvBS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAuB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAvB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAuB,YAFpB;EAAM,CAAA;CAAA;;AAET,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAuB,YAAA,CAAA;EAHnC,MAAA;EAAW,MAAA,CAAA,EACR,YAAY,OACf,CAAA"}
@@ -1,48 +1,58 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, DestroyRef, Injectable } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
- import { Title } from '@angular/platform-browser';
5
- import { Router, NavigationEnd } from '@angular/router';
6
- import { CmatUtilsService } from 'cmat/services/utils';
7
- import { filter, map, mergeMap } from 'rxjs/operators';
8
-
9
- class CmatTitleService {
10
- constructor() {
11
- this._destroyRef = inject(DestroyRef);
12
- this._router = inject(Router);
13
- this._titleService = inject(Title);
14
- this._router.events.pipe(filter((event) => event instanceof NavigationEnd), takeUntilDestroyed(this._destroyRef), map(() => this._router.routerState.root), map((route) => {
15
- while (route.firstChild) {
16
- route = route.firstChild;
17
- }
18
- return route;
19
- }), mergeMap(route => route.data))
20
- .subscribe((data) => {
21
- let title = typeof data['title'] === 'string' ? data['title'] : '';
22
- if (title) {
23
- const fragment = this._router.url.split('#')[1];
24
- if (fragment) {
25
- title += ` | ${CmatUtilsService.toTitleCase(fragment)}`;
26
- }
27
- }
28
- if (title) {
29
- this._titleService.setTitle(title);
30
- }
31
- });
32
- }
33
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTitleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
34
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTitleService, providedIn: 'root' }); }
35
- }
36
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatTitleService, decorators: [{
37
- type: Injectable,
38
- args: [{
39
- providedIn: 'root'
40
- }]
41
- }], ctorParameters: () => [] });
42
-
43
- /**
44
- * Generated bundle index. Do not edit.
45
- */
46
-
1
+ import * as i0 from "@angular/core";
2
+ import { DestroyRef, Injectable, inject } from "@angular/core";
3
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
4
+ import { Title } from "@angular/platform-browser";
5
+ import { NavigationEnd, Router } from "@angular/router";
6
+ import { CmatUtilsService } from "cmat/services/utils";
7
+ import { filter, map, mergeMap } from "rxjs/operators";
8
+ var CmatTitleService = class CmatTitleService {
9
+ constructor() {
10
+ this._destroyRef = inject(DestroyRef);
11
+ this._router = inject(Router);
12
+ this._titleService = inject(Title);
13
+ this._router.events.pipe(filter((event) => event instanceof NavigationEnd), takeUntilDestroyed(this._destroyRef), map(() => this._router.routerState.root), map((route) => {
14
+ while (route.firstChild) route = route.firstChild;
15
+ return route;
16
+ }), mergeMap((route) => route.data)).subscribe((data) => {
17
+ let title = typeof data["title"] === "string" ? data["title"] : "";
18
+ if (title) {
19
+ const fragment = this._router.url.split("#")[1];
20
+ if (fragment) title += ` | ${CmatUtilsService.toTitleCase(fragment)}`;
21
+ }
22
+ if (title) this._titleService.setTitle(title);
23
+ });
24
+ }
25
+ static {
26
+ this.ɵfac = i0.ɵɵngDeclareFactory({
27
+ minVersion: "12.0.0",
28
+ version: "22.2.3",
29
+ ngImport: i0,
30
+ type: CmatTitleService,
31
+ deps: [],
32
+ target: i0.ɵɵFactoryTarget.Injectable
33
+ });
34
+ }
35
+ static {
36
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
37
+ minVersion: "12.0.0",
38
+ version: "22.2.3",
39
+ ngImport: i0,
40
+ type: CmatTitleService,
41
+ providedIn: "root"
42
+ });
43
+ }
44
+ };
45
+ i0.ɵɵngDeclareClassMetadata({
46
+ minVersion: "12.0.0",
47
+ version: "22.2.3",
48
+ ngImport: i0,
49
+ type: CmatTitleService,
50
+ decorators: [{
51
+ type: Injectable,
52
+ args: [{ providedIn: "root" }]
53
+ }],
54
+ ctorParameters: () => []
55
+ });
47
56
  export { CmatTitleService };
48
- //# sourceMappingURL=cmat-services-title.mjs.map
57
+
58
+ //# sourceMappingURL=cmat-services-title.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cmat-services-title.mjs","sources":["../../../projects/cmat/services/title/title.service.ts","../../../projects/cmat/services/title/cmat-services-title.ts"],"sourcesContent":["import { DestroyRef, Injectable, inject } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { Title } from '@angular/platform-browser';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\nimport { filter, map, mergeMap } from 'rxjs/operators';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatTitleService {\r\n private readonly _destroyRef = inject(DestroyRef);\r\n private readonly _router = inject(Router);\r\n private readonly _titleService = inject(Title);\r\n\r\n constructor() {\r\n this._router.events.pipe(\r\n filter((event): event is NavigationEnd => event instanceof NavigationEnd),\r\n takeUntilDestroyed(this._destroyRef),\r\n map(() => this._router.routerState.root),\r\n map((route) => {\r\n while (route.firstChild) {\r\n route = route.firstChild;\r\n }\r\n\r\n return route;\r\n }),\r\n mergeMap(route => route.data))\r\n .subscribe((data: Record<string, unknown>) => {\r\n let title = typeof data['title'] === 'string' ? data['title'] : '';\r\n\r\n if (title) {\r\n const fragment = this._router.url.split('#')[1];\r\n\r\n if (fragment) {\r\n title += ` | ${CmatUtilsService.toTitleCase(fragment)}`;\r\n }\r\n }\r\n\r\n if (title) {\r\n this._titleService.setTitle(title);\r\n }\r\n });\r\n }\r\n\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAUa,gBAAgB,CAAA;AAKzB,IAAA,WAAA,GAAA;AAJiB,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;AACxB,QAAA,IAAA,CAAA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EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFb,MAAM,EAAA,CAAA,CAAA;;2FAET,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;ACTD;;AAEG;;"}
1
+ {"version":3,"file":"cmat-services-title.mjs","names":[],"sources":["../../../projects/cmat/services/title/title.service.ts"],"sourcesContent":["import { DestroyRef, Injectable, inject } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { Title } from '@angular/platform-browser';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\nimport { CmatUtilsService } from 'cmat/services/utils';\r\nimport { filter, map, mergeMap } from 'rxjs/operators';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatTitleService {\r\n private readonly _destroyRef = inject(DestroyRef);\r\n private readonly _router = inject(Router);\r\n private readonly _titleService = inject(Title);\r\n\r\n constructor() {\r\n this._router.events.pipe(\r\n filter((event): event is NavigationEnd => event instanceof NavigationEnd),\r\n takeUntilDestroyed(this._destroyRef),\r\n map(() => this._router.routerState.root),\r\n map((route) => {\r\n while (route.firstChild) {\r\n route = route.firstChild;\r\n }\r\n\r\n return route;\r\n }),\r\n mergeMap(route => route.data))\r\n .subscribe((data: Record<string, unknown>) => {\r\n let title = typeof data['title'] === 'string' ? data['title'] : '';\r\n\r\n if (title) {\r\n const fragment = this._router.url.split('#')[1];\r\n\r\n if (fragment) {\r\n title += ` | ${CmatUtilsService.toTitleCase(fragment)}`;\r\n }\r\n }\r\n\r\n if (title) {\r\n this._titleService.setTitle(title);\r\n }\r\n });\r\n }\r\n\r\n}\r\n"],"mappings":";;;;;;;AAUA,IAAa,mBAAb,MAAa,iBAAgB;CAKzB,cAAA;EAJiB,KAAA,cAAc,OAAO,UAAU;EAC/B,KAAA,UAAU,OAAO,MAAM;EACvB,K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