ngx-tethys 19.0.16 → 19.1.0-next.1

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 (322) hide show
  1. package/CHANGELOG.md +31 -11
  2. package/README.md +0 -1
  3. package/action/action.component.d.ts +14 -23
  4. package/action/actions.component.d.ts +5 -7
  5. package/affix/affix.component.d.ts +9 -13
  6. package/alert/alert.component.d.ts +1 -1
  7. package/anchor/anchor-link.component.d.ts +8 -8
  8. package/anchor/anchor.component.d.ts +15 -21
  9. package/arrow-switcher/arrow-switcher.component.d.ts +15 -22
  10. package/autocomplete/autocomplete.component.d.ts +10 -17
  11. package/autocomplete/autocomplete.trigger.directive.d.ts +10 -18
  12. package/avatar/avatar-list/avatar-list.component.d.ts +8 -14
  13. package/avatar/avatar.component.d.ts +25 -39
  14. package/back-top/back-top.component.d.ts +9 -12
  15. package/badge/badge.component.d.ts +19 -59
  16. package/breadcrumb/breadcrumb.component.d.ts +15 -20
  17. package/button/button-group.component.d.ts +5 -12
  18. package/button/button-icon.component.d.ts +14 -27
  19. package/button/button.component.d.ts +17 -26
  20. package/calendar/calendar-header.component.d.ts +9 -8
  21. package/calendar/calendar.component.d.ts +16 -16
  22. package/card/card.component.d.ts +5 -11
  23. package/card/content.component.d.ts +3 -8
  24. package/card/header.component.d.ts +7 -8
  25. package/carousel/carousel.component.d.ts +22 -27
  26. package/cascader/cascader-li.component.d.ts +13 -21
  27. package/cascader/cascader-search-option.component.d.ts +8 -16
  28. package/cascader/cascader.component.d.ts +58 -80
  29. package/checkbox/checkbox.component.d.ts +2 -5
  30. package/collapse/collapse-item.component.d.ts +12 -19
  31. package/collapse/collapse.component.d.ts +6 -12
  32. package/collapse/collapse.token.d.ts +3 -3
  33. package/color-picker/color-picker-custom-panel.component.d.ts +5 -5
  34. package/color-picker/color-picker-panel.component.d.ts +7 -11
  35. package/color-picker/color-picker.component.d.ts +19 -35
  36. package/color-picker/parts/alpha/alpha.component.d.ts +8 -8
  37. package/color-picker/parts/hue/hue.component.d.ts +6 -6
  38. package/color-picker/parts/indicator/indicator.component.d.ts +4 -3
  39. package/color-picker/parts/inputs/inputs.component.d.ts +9 -9
  40. package/color-picker/parts/saturation/saturation.component.d.ts +9 -9
  41. package/comment/comment.component.d.ts +4 -5
  42. package/copy/copy.directive.d.ts +8 -9
  43. package/date-picker/abstract-picker.component.d.ts +8 -7
  44. package/date-picker/lib/calendar/calendar-footer.component.d.ts +2 -1
  45. package/date-picker/lib/popups/inner-popup.component.d.ts +2 -1
  46. package/date-picker/picker.component.d.ts +2 -1
  47. package/date-range/date-range.component.d.ts +2 -2
  48. package/dialog/body/dialog-body.component.d.ts +2 -6
  49. package/dialog/confirm/confirm.component.d.ts +2 -2
  50. package/dialog/footer/dialog-footer.component.d.ts +6 -9
  51. package/dialog/header/dialog-header.component.d.ts +9 -11
  52. package/divider/divider.component.d.ts +12 -16
  53. package/dot/dot.component.d.ts +5 -13
  54. package/drag-drop/drag-handle.directive.d.ts +2 -1
  55. package/drag-drop/drag.directive.d.ts +2 -1
  56. package/drag-drop/drop-container.directive.d.ts +2 -1
  57. package/dropdown/dropdown-active.directive.d.ts +4 -5
  58. package/dropdown/dropdown-menu-item.directive.d.ts +7 -14
  59. package/dropdown/dropdown-menu.component.d.ts +6 -12
  60. package/dropdown/dropdown-submenu.component.d.ts +2 -4
  61. package/dropdown/dropdown.directive.d.ts +14 -24
  62. package/empty/empty.component.d.ts +21 -27
  63. package/fesm2022/ngx-tethys-action.mjs +63 -101
  64. package/fesm2022/ngx-tethys-action.mjs.map +1 -1
  65. package/fesm2022/ngx-tethys-affix.mjs +40 -41
  66. package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
  67. package/fesm2022/ngx-tethys-anchor.mjs +91 -118
  68. package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
  69. package/fesm2022/ngx-tethys-arrow-switcher.mjs +51 -77
  70. package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
  71. package/fesm2022/ngx-tethys-autocomplete.mjs +69 -103
  72. package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
  73. package/fesm2022/ngx-tethys-avatar.mjs +117 -162
  74. package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
  75. package/fesm2022/ngx-tethys-back-top.mjs +33 -46
  76. package/fesm2022/ngx-tethys-back-top.mjs.map +1 -1
  77. package/fesm2022/ngx-tethys-badge.mjs +104 -208
  78. package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
  79. package/fesm2022/ngx-tethys-breadcrumb.mjs +66 -70
  80. package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
  81. package/fesm2022/ngx-tethys-button.mjs +225 -322
  82. package/fesm2022/ngx-tethys-button.mjs.map +1 -1
  83. package/fesm2022/ngx-tethys-calendar.mjs +85 -87
  84. package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
  85. package/fesm2022/ngx-tethys-card.mjs +72 -77
  86. package/fesm2022/ngx-tethys-card.mjs.map +1 -1
  87. package/fesm2022/ngx-tethys-carousel.mjs +83 -99
  88. package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
  89. package/fesm2022/ngx-tethys-cascader.mjs +313 -468
  90. package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
  91. package/fesm2022/ngx-tethys-checkbox.mjs +10 -17
  92. package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
  93. package/fesm2022/ngx-tethys-collapse.mjs +66 -71
  94. package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
  95. package/fesm2022/ngx-tethys-color-picker.mjs +187 -246
  96. package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
  97. package/fesm2022/ngx-tethys-comment.mjs +16 -10
  98. package/fesm2022/ngx-tethys-comment.mjs.map +1 -1
  99. package/fesm2022/ngx-tethys-copy.mjs +25 -28
  100. package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
  101. package/fesm2022/ngx-tethys-dialog.mjs +81 -82
  102. package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
  103. package/fesm2022/ngx-tethys-divider.mjs +49 -58
  104. package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
  105. package/fesm2022/ngx-tethys-dot.mjs +45 -68
  106. package/fesm2022/ngx-tethys-dot.mjs.map +1 -1
  107. package/fesm2022/ngx-tethys-dropdown.mjs +155 -203
  108. package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
  109. package/fesm2022/ngx-tethys-empty.mjs +107 -95
  110. package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
  111. package/fesm2022/ngx-tethys-flexible-text.mjs +67 -86
  112. package/fesm2022/ngx-tethys-flexible-text.mjs.map +1 -1
  113. package/fesm2022/ngx-tethys-form.mjs +161 -200
  114. package/fesm2022/ngx-tethys-form.mjs.map +1 -1
  115. package/fesm2022/ngx-tethys-fullscreen.mjs +21 -23
  116. package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
  117. package/fesm2022/ngx-tethys-grid.mjs +161 -158
  118. package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
  119. package/fesm2022/ngx-tethys-i18n.mjs +25 -25
  120. package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
  121. package/fesm2022/ngx-tethys-icon.mjs +44 -59
  122. package/fesm2022/ngx-tethys-icon.mjs.map +1 -1
  123. package/fesm2022/ngx-tethys-image.mjs +40 -36
  124. package/fesm2022/ngx-tethys-image.mjs.map +1 -1
  125. package/fesm2022/ngx-tethys-input-number.mjs +101 -114
  126. package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
  127. package/fesm2022/ngx-tethys-input.mjs +268 -271
  128. package/fesm2022/ngx-tethys-input.mjs.map +1 -1
  129. package/fesm2022/ngx-tethys-list.mjs +1 -1
  130. package/fesm2022/ngx-tethys-list.mjs.map +1 -1
  131. package/fesm2022/ngx-tethys-loading.mjs +17 -35
  132. package/fesm2022/ngx-tethys-loading.mjs.map +1 -1
  133. package/fesm2022/ngx-tethys-mention.mjs +52 -74
  134. package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
  135. package/fesm2022/ngx-tethys-menu.mjs +106 -179
  136. package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
  137. package/fesm2022/ngx-tethys-nav.mjs +169 -201
  138. package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
  139. package/fesm2022/ngx-tethys-pagination.mjs +230 -294
  140. package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
  141. package/fesm2022/ngx-tethys-popover.mjs +67 -70
  142. package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
  143. package/fesm2022/ngx-tethys-progress.mjs +194 -246
  144. package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
  145. package/fesm2022/ngx-tethys-property.mjs +99 -113
  146. package/fesm2022/ngx-tethys-property.mjs.map +1 -1
  147. package/fesm2022/ngx-tethys-radio.mjs +60 -76
  148. package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
  149. package/fesm2022/ngx-tethys-rate.mjs +115 -157
  150. package/fesm2022/ngx-tethys-rate.mjs.map +1 -1
  151. package/fesm2022/ngx-tethys-resizable.mjs +111 -157
  152. package/fesm2022/ngx-tethys-resizable.mjs.map +1 -1
  153. package/fesm2022/ngx-tethys-result.mjs +46 -28
  154. package/fesm2022/ngx-tethys-result.mjs.map +1 -1
  155. package/fesm2022/ngx-tethys-segment.mjs +84 -103
  156. package/fesm2022/ngx-tethys-segment.mjs.map +1 -1
  157. package/fesm2022/ngx-tethys-skeleton.mjs +339 -342
  158. package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
  159. package/fesm2022/ngx-tethys-slide.mjs +37 -56
  160. package/fesm2022/ngx-tethys-slide.mjs.map +1 -1
  161. package/fesm2022/ngx-tethys-slider.mjs +75 -108
  162. package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
  163. package/fesm2022/ngx-tethys-space.mjs +25 -51
  164. package/fesm2022/ngx-tethys-space.mjs.map +1 -1
  165. package/fesm2022/ngx-tethys-statistic.mjs +114 -151
  166. package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
  167. package/fesm2022/ngx-tethys-stepper.mjs +74 -107
  168. package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
  169. package/fesm2022/ngx-tethys-strength.mjs +52 -66
  170. package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
  171. package/fesm2022/ngx-tethys-switch.mjs +80 -140
  172. package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
  173. package/fesm2022/ngx-tethys-table.mjs +1 -1
  174. package/fesm2022/ngx-tethys-table.mjs.map +1 -1
  175. package/fesm2022/ngx-tethys-tabs.mjs +69 -87
  176. package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
  177. package/fesm2022/ngx-tethys-tag.mjs +42 -64
  178. package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
  179. package/fesm2022/ngx-tethys-timeline.mjs +104 -129
  180. package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
  181. package/fesm2022/ngx-tethys-transfer.mjs +98 -119
  182. package/fesm2022/ngx-tethys-transfer.mjs.map +1 -1
  183. package/fesm2022/ngx-tethys-tree-select.mjs +2 -4
  184. package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
  185. package/fesm2022/ngx-tethys-tree.mjs +281 -401
  186. package/fesm2022/ngx-tethys-tree.mjs.map +1 -1
  187. package/fesm2022/ngx-tethys-typography.mjs +36 -33
  188. package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
  189. package/fesm2022/ngx-tethys-upload.mjs +93 -132
  190. package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
  191. package/fesm2022/ngx-tethys-util.mjs.map +1 -1
  192. package/fesm2022/ngx-tethys-vote.mjs +53 -99
  193. package/fesm2022/ngx-tethys-vote.mjs.map +1 -1
  194. package/fesm2022/ngx-tethys-watermark.mjs +36 -40
  195. package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
  196. package/fesm2022/ngx-tethys.mjs +1 -1
  197. package/fesm2022/ngx-tethys.mjs.map +1 -1
  198. package/flexible-text/flexible-text.component.d.ts +9 -15
  199. package/form/form-group-error/form-group-error.component.d.ts +2 -3
  200. package/form/form-group-label.directive.d.ts +2 -1
  201. package/form/form-group.component.d.ts +17 -24
  202. package/form/form-submit.directive.d.ts +2 -2
  203. package/form/form.directive.d.ts +6 -8
  204. package/form/from-group-footer/form-group-footer.component.d.ts +2 -2
  205. package/form/validator/confirm-validator.directive.d.ts +2 -2
  206. package/form/validator/unique-validator.directive.d.ts +2 -2
  207. package/fullscreen/fullscreen.component.d.ts +7 -7
  208. package/grid/flex.d.ts +13 -20
  209. package/grid/thy-col.directive.d.ts +6 -9
  210. package/grid/thy-grid-item.component.d.ts +3 -4
  211. package/grid/thy-grid.component.d.ts +11 -12
  212. package/grid/thy-row.directive.d.ts +11 -14
  213. package/icon/icon.component.d.ts +10 -17
  214. package/image/image.directive.d.ts +10 -12
  215. package/image/image.token.d.ts +5 -5
  216. package/input/input-count.component.d.ts +4 -5
  217. package/input/input-group.component.d.ts +20 -20
  218. package/input/input-search.component.d.ts +15 -20
  219. package/input/input.component.d.ts +20 -21
  220. package/input/input.directive.d.ts +4 -6
  221. package/input-number/input-number.component.d.ts +21 -29
  222. package/layout/header.component.d.ts +4 -9
  223. package/layout/sidebar-header.component.d.ts +2 -1
  224. package/layout/sidebar.component.d.ts +8 -7
  225. package/list/list.component.d.ts +2 -1
  226. package/list/selection/selection-list.d.ts +4 -3
  227. package/loading/loading.component.d.ts +4 -10
  228. package/mention/mention.directive.d.ts +6 -7
  229. package/mention/suggestions/suggestions.component.d.ts +8 -9
  230. package/menu/group/menu-group.component.d.ts +16 -33
  231. package/menu/item/action/menu-item-action.component.d.ts +7 -8
  232. package/menu/item/icon/menu-item-icon.component.d.ts +2 -2
  233. package/menu/item/menu-item.component.d.ts +4 -4
  234. package/menu/item/name/menu-item-name.component.d.ts +2 -3
  235. package/menu/menu.component.d.ts +3 -7
  236. package/nav/icon-nav/icon-nav-link.directive.d.ts +3 -7
  237. package/nav/icon-nav/icon-nav.component.d.ts +3 -8
  238. package/nav/nav-ink-bar.directive.d.ts +4 -6
  239. package/nav/nav-item.directive.d.ts +7 -10
  240. package/nav/nav.component.d.ts +20 -48
  241. package/package.json +1 -1
  242. package/pagination/pagination.component.d.ts +48 -109
  243. package/popover/header/popover-header.component.d.ts +7 -6
  244. package/popover/popover.directive.d.ts +11 -18
  245. package/progress/progress-circle.component.d.ts +35 -26
  246. package/progress/progress-strip.component.d.ts +10 -14
  247. package/progress/progress.component.d.ts +16 -26
  248. package/property/examples/single/single.component.scss +6 -0
  249. package/property/properties.component.d.ts +6 -15
  250. package/property/property-item.component.d.ts +22 -34
  251. package/property/styles/properties.scss +124 -52
  252. package/property-operation/property-operation.component.d.ts +6 -5
  253. package/radio/button/radio-button.component.d.ts +2 -2
  254. package/radio/group/radio-group.component.d.ts +13 -16
  255. package/radio/radio.component.d.ts +2 -2
  256. package/radio/radio.token.d.ts +2 -2
  257. package/rate/rate-item.component.d.ts +8 -10
  258. package/rate/rate.component.d.ts +20 -30
  259. package/resizable/resizable.directive.d.ts +18 -36
  260. package/resizable/resize-handle.component.d.ts +6 -6
  261. package/resizable/resize-handles.component.d.ts +5 -8
  262. package/result/result.component.d.ts +9 -10
  263. package/schematics/version.d.ts +1 -1
  264. package/schematics/version.js +1 -1
  265. package/segment/segment-item.component.d.ts +9 -14
  266. package/segment/segment.component.d.ts +11 -14
  267. package/segment/segment.token.d.ts +4 -3
  268. package/select/custom-select/custom-select.component.d.ts +11 -10
  269. package/select/native-select/native-select.component.d.ts +2 -1
  270. package/shared/base-form-check.component.d.ts +3 -2
  271. package/shared/directives/thy-autofocus.directive.d.ts +3 -2
  272. package/shared/directives/thy-scroll.directive.d.ts +2 -1
  273. package/shared/directives/thy-show.d.ts +2 -1
  274. package/shared/option/group/option-group.component.d.ts +2 -1
  275. package/shared/option/list-option/list-option.component.d.ts +2 -7
  276. package/shared/option/option.component.d.ts +2 -1
  277. package/shared/select/select-control/select-control.component.d.ts +7 -6
  278. package/skeleton/skeleton-circle.component.d.ts +16 -19
  279. package/skeleton/skeleton-rectangle.component.d.ts +20 -23
  280. package/skeleton/skeleton.component.d.ts +5 -6
  281. package/skeleton/stylized/bullet-list.component.d.ts +11 -13
  282. package/skeleton/stylized/list.component.d.ts +10 -12
  283. package/skeleton/stylized/paragraph.component.d.ts +12 -14
  284. package/slide/slide-body/slide-body-section.component.d.ts +2 -5
  285. package/slide/slide-header/slide-header.component.d.ts +6 -9
  286. package/slider/slider.component.d.ts +17 -24
  287. package/space/space.component.d.ts +10 -16
  288. package/statistic/statistic.component.d.ts +35 -40
  289. package/stepper/step-header.component.d.ts +6 -10
  290. package/stepper/step.component.d.ts +6 -6
  291. package/stepper/stepper.component.d.ts +15 -20
  292. package/strength/strength.component.d.ts +8 -13
  293. package/switch/switch.component.d.ts +24 -35
  294. package/table/table-column.component.d.ts +6 -5
  295. package/table/table-skeleton.component.d.ts +3 -10
  296. package/table/table.component.d.ts +11 -10
  297. package/tabs/tab-content.component.d.ts +4 -4
  298. package/tabs/tab.component.d.ts +4 -5
  299. package/tabs/tabs.component.d.ts +13 -15
  300. package/tag/tag.component.d.ts +10 -16
  301. package/time-picker/time-picker-panel.component.d.ts +3 -2
  302. package/time-picker/time-picker.component.d.ts +6 -5
  303. package/timeline/timeline-item.component.d.ts +9 -13
  304. package/timeline/timeline.component.d.ts +13 -17
  305. package/tooltip/tooltip.directive.d.ts +3 -2
  306. package/transfer/transfer-list.component.d.ts +15 -15
  307. package/transfer/transfer.component.d.ts +20 -23
  308. package/tree/tree-abstract.d.ts +5 -5
  309. package/tree/tree-node.component.d.ts +24 -46
  310. package/tree/tree.class.d.ts +4 -4
  311. package/tree/tree.component.d.ts +47 -74
  312. package/tree/tree.service.d.ts +3 -4
  313. package/tree-select/tree-select.component.d.ts +10 -9
  314. package/typography/bg-color.directive.d.ts +3 -3
  315. package/typography/text/text.component.d.ts +2 -2
  316. package/typography/text-color.directive.d.ts +3 -3
  317. package/upload/file-drop.directive.d.ts +9 -11
  318. package/upload/file-select-base.d.ts +6 -10
  319. package/upload/file-select.component.d.ts +10 -20
  320. package/util/helpers/helpers.d.ts +2 -1
  321. package/vote/vote.component.d.ts +13 -32
  322. package/watermark/watermark.directive.d.ts +7 -9
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, SecurityContext, Injectable, Renderer2, ElementRef, numberAttribute, Input, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
2
+ import { inject, SecurityContext, Injectable, Renderer2, ElementRef, input, numberAttribute, effect, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
3
3
  import { FormsModule } from '@angular/forms';
4
4
  import { DOCUMENT, CommonModule } from '@angular/common';
5
5
  import { finalize, share, map, tap, catchError, take } from 'rxjs/operators';
@@ -363,34 +363,37 @@ class ThyIcon {
363
363
  this.render = inject(Renderer2);
364
364
  this.elementRef = inject(ElementRef);
365
365
  this.iconRegistry = inject(ThyIconRegistry);
366
- this.initialized = false;
367
366
  /**
368
367
  * 图标的类型
369
368
  * @type outline | fill | twotone
370
369
  */
371
- this.iconType = 'outline';
370
+ this.thyIconType = input('outline');
371
+ this.thyTwotoneColor = input();
372
+ /**
373
+ * 图标的名字
374
+ */
375
+ this.thyIconName = input.required();
376
+ /**
377
+ * 图标的旋转角度
378
+ * @default 0
379
+ */
380
+ this.thyIconRotate = input(undefined, { transform: numberAttribute });
381
+ this.thyIconSet = input();
382
+ /**
383
+ * 图标打底色,镂空的图标,会透过颜色来
384
+ */
385
+ this.thyIconLegging = input(false, { transform: coerceBooleanProperty });
386
+ this.thyIconLinearGradient = input(false, { transform: coerceBooleanProperty });
372
387
  this.hostRenderer = useHostRenderer();
373
- }
374
- ngOnInit() {
375
- this.updateClasses();
376
- this.initialized = true;
377
- }
378
- ngOnChanges(changes) {
379
- if (this.initialized) {
380
- if (changes['iconName'] ||
381
- changes['iconSet'] ||
382
- changes['iconTwotoneColor'] ||
383
- changes['iconType'] ||
384
- changes['iconLinearGradient']) {
385
- this.updateClasses();
386
- }
387
- else if (changes['iconRotate']) {
388
- this.setStyleRotate();
389
- }
390
- }
388
+ effect(() => {
389
+ this.updateClasses();
390
+ });
391
+ effect(() => {
392
+ this.setStyleRotate();
393
+ });
391
394
  }
392
395
  updateClasses() {
393
- const [namespace, iconName] = this.iconRegistry.splitIconName(this.iconName);
396
+ const [namespace, iconName] = this.iconRegistry.splitIconName(this.thyIconName());
394
397
  if (iconName) {
395
398
  if (this.iconRegistry.iconMode === 'svg') {
396
399
  this.iconRegistry
@@ -406,16 +409,21 @@ class ThyIcon {
406
409
  this.hostRenderer.updateClass([`thy-icon${namespace ? `-${namespace}` : ``}-${this.buildIconNameByType(iconName)}`]);
407
410
  }
408
411
  else {
409
- const fontSetClass = this.iconSet
410
- ? this.iconRegistry.getFontSetClassByAlias(this.iconSet)
412
+ const fontSetClass = this.thyIconSet()
413
+ ? this.iconRegistry.getFontSetClassByAlias(this.thyIconSet())
411
414
  : this.iconRegistry.getDefaultFontSetClass();
412
- this.hostRenderer.updateClass([fontSetClass, `${fontSetClass}-${this.iconName}`]);
415
+ this.hostRenderer.updateClass([fontSetClass, `${fontSetClass}-${this.thyIconName()}`]);
413
416
  }
414
417
  }
415
418
  }
416
419
  setStyleRotate() {
417
- if (this.iconRotate !== undefined) {
418
- this.render.setStyle(this.elementRef.nativeElement.querySelector('svg'), 'transform', `rotate(${this.iconRotate}deg)`);
420
+ if (this.thyIconRotate() !== undefined) {
421
+ // 基于 effect 无法保证在 setSvgElement 之前执行,所以这里增加判断
422
+ const svg = this.elementRef.nativeElement.querySelector('svg');
423
+ if (!svg) {
424
+ return;
425
+ }
426
+ this.render.setStyle(svg, 'transform', `rotate(${this.thyIconRotate()}deg)`);
419
427
  }
420
428
  }
421
429
  //#region svg element
@@ -428,12 +436,12 @@ class ThyIcon {
428
436
  for (let i = 0; i < styleTags.length; i++) {
429
437
  styleTags[i].textContent += ' ';
430
438
  }
431
- if (this.iconType === 'twotone') {
439
+ if (this.thyIconType() === 'twotone') {
432
440
  const allPaths = svg.querySelectorAll('path');
433
441
  if (allPaths.length > 1) {
434
442
  allPaths.forEach((child, index) => {
435
443
  if (child.getAttribute('id').includes('secondary-color')) {
436
- child.setAttribute('fill', this.iconTwotoneColor);
444
+ child.setAttribute('fill', this.thyTwotoneColor());
437
445
  }
438
446
  });
439
447
  }
@@ -446,7 +454,7 @@ class ThyIcon {
446
454
  // this._cacheChildrenWithExternalReferences(svg);
447
455
  // this._prependPathToReferences(path);
448
456
  // }
449
- if (this.iconLinearGradient) {
457
+ if (this.thyIconLinearGradient()) {
450
458
  this.setBaseUrl(svg);
451
459
  this.clearTitleElement(svg);
452
460
  }
@@ -472,8 +480,8 @@ class ThyIcon {
472
480
  }
473
481
  //#endregion
474
482
  buildIconNameByType(iconName) {
475
- if (this.iconType && ['fill', 'twotone'].indexOf(this.iconType) >= 0) {
476
- const suffix = iconSuffixMap[this.iconType];
483
+ if (this.thyIconType() && ['fill', 'twotone'].indexOf(this.thyIconType()) >= 0) {
484
+ const suffix = iconSuffixMap[this.thyIconType()];
477
485
  return iconName.includes(`-${suffix}`) ? iconName : `${iconName}-${suffix}`;
478
486
  }
479
487
  else {
@@ -500,7 +508,7 @@ class ThyIcon {
500
508
  titleElement && titleElement.remove();
501
509
  }
502
510
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyIcon, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
503
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.8", type: ThyIcon, isStandalone: true, selector: "thy-icon, [thy-icon]", inputs: { iconType: ["thyIconType", "iconType"], iconTwotoneColor: ["thyTwotoneColor", "iconTwotoneColor"], iconName: ["thyIconName", "iconName"], iconRotate: ["thyIconRotate", "iconRotate", numberAttribute], iconSet: ["thyIconSet", "iconSet"], iconLegging: ["thyIconLegging", "iconLegging", coerceBooleanProperty], iconLinearGradient: ["thyIconLinearGradient", "iconLinearGradient", coerceBooleanProperty] }, host: { properties: { "class.thy-icon-legging": "this.iconLegging" }, classAttribute: "thy-icon" }, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
511
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyIcon, isStandalone: true, selector: "thy-icon, [thy-icon]", inputs: { thyIconType: { classPropertyName: "thyIconType", publicName: "thyIconType", isSignal: true, isRequired: false, transformFunction: null }, thyTwotoneColor: { classPropertyName: "thyTwotoneColor", publicName: "thyTwotoneColor", isSignal: true, isRequired: false, transformFunction: null }, thyIconName: { classPropertyName: "thyIconName", publicName: "thyIconName", isSignal: true, isRequired: true, transformFunction: null }, thyIconRotate: { classPropertyName: "thyIconRotate", publicName: "thyIconRotate", isSignal: true, isRequired: false, transformFunction: null }, thyIconSet: { classPropertyName: "thyIconSet", publicName: "thyIconSet", isSignal: true, isRequired: false, transformFunction: null }, thyIconLegging: { classPropertyName: "thyIconLegging", publicName: "thyIconLegging", isSignal: true, isRequired: false, transformFunction: null }, thyIconLinearGradient: { classPropertyName: "thyIconLinearGradient", publicName: "thyIconLinearGradient", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-icon-legging": "thyIconLegging()" }, classAttribute: "thy-icon" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
504
512
  }
505
513
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyIcon, decorators: [{
506
514
  type: Component,
@@ -510,34 +518,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
510
518
  changeDetection: ChangeDetectionStrategy.OnPush,
511
519
  encapsulation: ViewEncapsulation.None,
512
520
  host: {
513
- class: 'thy-icon'
521
+ class: 'thy-icon',
522
+ '[class.thy-icon-legging]': 'thyIconLegging()'
514
523
  }
515
524
  }]
516
- }], propDecorators: { iconType: [{
517
- type: Input,
518
- args: ['thyIconType']
519
- }], iconTwotoneColor: [{
520
- type: Input,
521
- args: ['thyTwotoneColor']
522
- }], iconName: [{
523
- type: Input,
524
- args: ['thyIconName']
525
- }], iconRotate: [{
526
- type: Input,
527
- args: [{ alias: 'thyIconRotate', transform: numberAttribute }]
528
- }], iconSet: [{
529
- type: Input,
530
- args: ['thyIconSet']
531
- }], iconLegging: [{
532
- type: HostBinding,
533
- args: [`class.thy-icon-legging`]
534
- }, {
535
- type: Input,
536
- args: [{ alias: 'thyIconLegging', transform: coerceBooleanProperty }]
537
- }], iconLinearGradient: [{
538
- type: Input,
539
- args: [{ alias: 'thyIconLinearGradient', transform: coerceBooleanProperty }]
540
- }] } });
525
+ }], ctorParameters: () => [] });
541
526
 
542
527
  class ThyIconModule {
543
528
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyIconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys-icon.mjs","sources":["../../../src/icon/config.ts","../../../src/icon/icon-registry.ts","../../../src/icon/icon.component.ts","../../../src/icon/icon.module.ts","../../../src/icon/ngx-tethys-icon.ts"],"sourcesContent":["let printErrorWhenNotFound = true;\n\nexport function setPrintErrorWhenIconNotFound(value: boolean) {\n printErrorWhenNotFound = value;\n}\n\nexport function getWhetherPrintErrorWhenIconNotFound() {\n return printErrorWhenNotFound;\n}\n","import { forkJoin, Observable, of, throwError } from 'rxjs';\nimport { catchError, finalize, map, share, tap } from 'rxjs/operators';\n\nimport { DOCUMENT } from '@angular/common';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { Injectable, SecurityContext, inject } from '@angular/core';\nimport { DomSanitizer, SafeHtml, SafeResourceUrl } from '@angular/platform-browser';\nimport { isString } from 'ngx-tethys/util';\n\nclass SvgIconConfig {\n url: SafeResourceUrl | null;\n svgElement: SVGElement | null;\n\n constructor(data: SafeResourceUrl | SVGElement) {\n // Note that we can't use `instanceof SVGElement` here,\n // because it'll break during server-side rendering.\n if (data && !!(data as any).nodeName) {\n this.svgElement = data as SVGElement;\n } else {\n this.url = data as SafeResourceUrl;\n }\n }\n}\n\nexport type IconMode = 'font' | 'svg';\n\nexport type SvgResourceUrl = SafeResourceUrl | string;\n\nexport type SvgHtml = SafeHtml | string;\n\n/**\n * @order 20\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ThyIconRegistry {\n private sanitizer = inject(DomSanitizer);\n private httpClient = inject(HttpClient, { optional: false });\n private document = inject(DOCUMENT);\n\n private defaultFontSetClass = 'wt-icon';\n private internalIconMode: IconMode = 'svg';\n private svgIconConfigs = new Map<string, SvgIconConfig>();\n private svgIconSetConfigs = new Map<string, SvgIconConfig[]>();\n private inProgressUrlFetches = new Map<string, Observable<string>>();\n\n public get iconMode() {\n return this.internalIconMode;\n }\n\n private getIconNameNotFoundError(iconName: string): Error {\n return Error(`Unable to find icon with the name \"${iconName}\"`);\n }\n\n private getIconFailedToSanitizeLiteralError(literal: SvgHtml): Error {\n return Error(\n `The literal provided to ThyIconRegistry was not trusted as safe HTML by ` +\n `Angular's DomSanitizer. Attempted literal was \"${literal}\".`\n );\n }\n\n private internalAddSvgIconSet(namespace: string, config: SvgIconConfig): this {\n const configNamespace = this.svgIconSetConfigs.get(namespace);\n\n if (configNamespace) {\n configNamespace.push(config);\n } else {\n this.svgIconSetConfigs.set(namespace, [config]);\n }\n\n return this;\n }\n\n private cloneSvg(svg: SVGElement): SVGElement {\n return svg.cloneNode(true) as SVGElement;\n }\n\n private fetchUrl(safeUrl: SafeResourceUrl | null): Observable<string> {\n if (safeUrl == null) {\n throw Error(`Cannot fetch icon from URL \"${safeUrl}\".`);\n }\n\n const url = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, safeUrl);\n\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !url) {\n throw new Error(\n `The URL provided to ThyIconRegistry was not trusted as a resource URL ` +\n `via Angular's DomSanitizer. Attempted URL was \"${url}\".`\n );\n }\n\n // Store in-progress fetches to avoid sending a duplicate request for a URL when there is\n // already a request in progress for that URL. It's necessary to call share() on the\n // Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.\n const inProgressFetch = this.inProgressUrlFetches.get(url);\n\n if (inProgressFetch) {\n return inProgressFetch;\n } else {\n // TODO(jelbourn): for some reason, the `finalize` operator \"loses\" the generic type on the\n // Observable. Figure out why and fix it.\n const req = this.httpClient.get(url, { responseType: 'text' }).pipe(\n finalize(() => this.inProgressUrlFetches.delete(url)),\n share()\n );\n\n this.inProgressUrlFetches.set(url, req);\n return req;\n }\n }\n\n private toSvgElement(element: Element): SVGElement {\n const svg = this.svgElementFromString('<svg></svg>');\n\n for (let i = 0; i < element.childNodes.length; i++) {\n if (element.childNodes[i].nodeType === this.document.ELEMENT_NODE) {\n svg.appendChild(element.childNodes[i].cloneNode(true));\n }\n }\n\n return svg;\n }\n\n private extractSvgIconFromIconSet(iconSet: SVGElement, iconName: string): SVGElement | null {\n // Use the `id=\"iconName\"` syntax in order to escape special\n // characters in the ID (versus using the #iconName syntax).\n const iconSource = iconSet.querySelector(`[id=\"${iconName}\"]`);\n\n if (!iconSource) {\n return null;\n }\n\n // Clone the element and remove the ID to prevent multiple elements from being added\n // to the page with the same ID.\n const iconElement = iconSource.cloneNode(true) as Element;\n iconElement.removeAttribute('id');\n\n // If the icon node is itself an <svg> node, clone and return it directly. If not, set it as\n // the content of a new <svg> node.\n if (iconElement.nodeName.toLowerCase() === 'svg') {\n return this.setSvgAttributes(iconElement as SVGElement);\n }\n\n // If the node is a <symbol>, it won't be rendered so we have to convert it into <svg>. Note\n // that the same could be achieved by referring to it via <use href=\"#id\">, however the <use>\n // tag is problematic on Firefox, because it needs to include the current page path.\n if (iconElement.nodeName.toLowerCase() === 'symbol') {\n return this.setSvgAttributes(this.toSvgElement(iconElement));\n }\n\n // createElement('SVG') doesn't work as expected; the DOM ends up with\n // the correct nodes, but the SVG content doesn't render. Instead we\n // have to create an empty SVG node using innerHTML and append its content.\n // Elements created using DOMParser.parseFromString have the same problem.\n // http://stackoverflow.com/questions/23003278/svg-innerhtml-in-firefox-can-not-display\n const svg = this.svgElementFromString('<svg></svg>');\n // Clone the node so we don't remove it from the parent icon set element.\n svg.appendChild(iconElement);\n\n return this.setSvgAttributes(svg);\n }\n\n private extractIconWithNameFromIconSetConfigs(iconName: string, iconSetConfigs: SvgIconConfig[]): SVGElement | null {\n // Iterate backwards, so icon sets added later have precedence.\n for (let i = iconSetConfigs.length - 1; i >= 0; i--) {\n const config = iconSetConfigs[i];\n if (config.svgElement) {\n const foundIcon = this.extractSvgIconFromIconSet(config.svgElement, iconName);\n if (foundIcon) {\n return foundIcon;\n }\n }\n }\n return null;\n }\n\n private svgElementFromString(str: string): SVGElement {\n const div = this.document.createElement('DIV');\n div.innerHTML = str;\n const svg = div.querySelector('svg') as SVGElement;\n\n if (!svg) {\n throw Error('<svg> tag not found');\n }\n\n return svg;\n }\n\n private setSvgAttributes(svg: SVGElement): SVGElement {\n svg.setAttribute('fit', '');\n svg.setAttribute('height', '1em');\n svg.setAttribute('width', '1em');\n svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');\n svg.setAttribute('focusable', 'false'); // Disable IE11 default behavior to make SVGs focusable.\n return svg;\n }\n\n private createSvgElementForSingleIcon(responseText: string): SVGElement {\n const svg = this.svgElementFromString(responseText);\n this.setSvgAttributes(svg);\n return svg;\n }\n\n private loadSvgIconFromConfig(config: SvgIconConfig): Observable<SVGElement> {\n return this.fetchUrl(config.url).pipe(map(svgText => this.createSvgElementForSingleIcon(svgText)));\n }\n\n private loadSvgIconSetFromConfig(config: SvgIconConfig): Observable<SVGElement> {\n // If the SVG for this icon set has already been parsed, do nothing.\n if (config.svgElement) {\n return of(config.svgElement);\n }\n\n return this.fetchUrl(config.url).pipe(\n map(svgText => {\n // It is possible that the icon set was parsed and cached by an earlier request, so parsing\n // only needs to occur if the cache is yet unset.\n if (!config.svgElement) {\n config.svgElement = this.svgElementFromString(svgText);\n }\n\n return config.svgElement;\n })\n );\n }\n\n private getSvgFromConfig(config: SvgIconConfig): Observable<SVGElement> {\n if (config.svgElement) {\n // We already have the SVG element for this icon, return a copy.\n return of(this.cloneSvg(config.svgElement));\n } else {\n // Fetch the icon from the config's URL, cache it, and return a copy.\n return this.loadSvgIconFromConfig(config).pipe(\n tap(svg => (config.svgElement = svg)),\n map(svg => this.cloneSvg(svg))\n );\n }\n }\n\n private getSvgFromIconSetConfigs(name: string, iconSetConfigs: SvgIconConfig[]): Observable<SVGElement> {\n // For all the icon set SVG elements we've fetched, see if any contain an icon with the\n // requested name.\n const namedIcon = this.extractIconWithNameFromIconSetConfigs(name, iconSetConfigs);\n\n if (namedIcon) {\n // We could cache namedIcon in svgIconConfigs, but since we have to make a copy every\n // time anyway, there's probably not much advantage compared to just always extracting\n // it from the icon set.\n return of(namedIcon);\n }\n\n // Not found in any cached icon sets. If there are icon sets with URLs that we haven't\n // fetched, fetch them now and look for iconName in the results.\n const iconSetFetchRequests: Observable<SVGElement | null>[] = iconSetConfigs\n .filter(iconSetConfig => !iconSetConfig.svgElement)\n .map(iconSetConfig => {\n return this.loadSvgIconSetFromConfig(iconSetConfig).pipe(\n catchError((err: HttpErrorResponse): Observable<SVGElement | null> => {\n const url = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, iconSetConfig.url);\n\n // Swallow errors fetching individual URLs so the\n // combined Observable won't necessarily fail.\n console.error(`Loading icon set URL: ${url} failed: ${err.message}`);\n return of(null);\n })\n );\n });\n\n // Fetch all the icon set URLs. When the requests complete, every IconSet should have a\n // cached SVG element (unless the request failed), and we can check again for the icon.\n return forkJoin(iconSetFetchRequests).pipe(\n map(() => {\n const foundIcon = this.extractIconWithNameFromIconSetConfigs(name, iconSetConfigs);\n\n if (!foundIcon) {\n throw this.getIconNameNotFoundError(name);\n }\n\n return foundIcon;\n })\n );\n }\n\n private internalAddSvgIconConfig(namespace: string, iconName: string, config: SvgIconConfig): this {\n this.svgIconConfigs.set(this.buildIconKey(namespace, iconName), config);\n return this;\n }\n\n public buildIconKey(namespace: string, name: string) {\n return namespace + ':' + name;\n }\n\n public splitIconName(iconName: string): [string, string] {\n if (!iconName) {\n return ['', ''];\n }\n const parts = iconName.split(':');\n switch (parts.length) {\n case 1:\n return ['', parts[0]]; // Use default namespace.\n case 2:\n return <[string, string]>parts;\n default:\n throw Error(`Invalid icon name: \"${iconName}\"`);\n }\n }\n\n public addSvgIconSetInNamespace(namespace: string, url: SvgResourceUrl): this {\n url = isString(url) ? this.sanitizer.bypassSecurityTrustResourceUrl(url) : url;\n return this.internalAddSvgIconSet(namespace, new SvgIconConfig(url));\n }\n\n /**\n * 添加SVG图标集,添加到默认命名空间\n */\n public addSvgIconSet(url: SvgResourceUrl): this {\n return this.addSvgIconSetInNamespace('', url);\n }\n\n public addSvgIconSetLiteralInNamespace(namespace: string, literal: SafeHtml): this {\n const sanitizedLiteral = this.sanitizer.sanitize(SecurityContext.HTML, literal);\n\n if (!sanitizedLiteral) {\n throw this.getIconFailedToSanitizeLiteralError(literal);\n }\n\n const svgElement = this.svgElementFromString(sanitizedLiteral);\n return this.internalAddSvgIconSet(namespace, new SvgIconConfig(svgElement));\n }\n\n public addSvgIconSetLiteral(literal: SafeHtml): this {\n return this.addSvgIconSetLiteralInNamespace('', literal);\n }\n\n /**\n * @description.en-us Registers an icon by URL in the specified namespace.\n * @description 添加单个SVG图标到指定的命名空间\n * @param namespace Namespace in which the icon should be registered.\n * @param iconName Name under which the icon should be registered.\n * @param url\n */\n public addSvgIconInNamespace(namespace: string, iconName: string, url: SvgResourceUrl): this {\n url = isString(url) ? this.sanitizer.bypassSecurityTrustResourceUrl(url) : url;\n return this.internalAddSvgIconConfig(namespace, iconName, new SvgIconConfig(url));\n }\n\n /**\n * @description.en-us Registers an icon by URL in the default namespace.\n * @description 添加单个SVG图标\n * @param iconName Name under which the icon should be registered.\n * @param url\n */\n public addSvgIcon(iconName: string, url: SvgResourceUrl): this {\n return this.addSvgIconInNamespace('', iconName, url);\n }\n\n /**\n * @description.en-us Registers an icon using an HTML string in the default namespace.\n * @description 添加单个SVG图标字符串,直接传入 SVG HTML 字符串\n * @param iconName Name under which the icon should be registered.\n * @param literal SVG source of the icon.\n */\n public addSvgIconLiteral(iconName: string, literal: SvgHtml): this {\n return this.addSvgIconLiteralInNamespace('', iconName, literal);\n }\n\n /**\n * @description.en-us Registers an icon using an HTML string in the specified namespace.\n * @description 添加单个SVG图标字符串到指定的命名空间,直接传入 SVG HTML 字符串\n * @param namespace Namespace in which the icon should be registered.\n * @param iconName Name under which the icon should be registered.\n * @param literal SVG source of the icon.\n */\n public addSvgIconLiteralInNamespace(namespace: string, iconName: string, literal: SvgHtml): this {\n literal = isString(literal) ? this.sanitizer.bypassSecurityTrustHtml(literal) : literal;\n const sanitizedLiteral = this.sanitizer.sanitize(SecurityContext.HTML, literal);\n\n if (!sanitizedLiteral) {\n throw this.getIconFailedToSanitizeLiteralError(literal);\n }\n\n const svgElement = this.createSvgElementForSingleIcon(sanitizedLiteral);\n return this.internalAddSvgIconConfig(namespace, iconName, new SvgIconConfig(svgElement));\n }\n\n public getDefaultFontSetClass() {\n return this.defaultFontSetClass;\n }\n\n public getFontSetClassByAlias(fontSet: string) {\n return fontSet;\n }\n\n /**\n * 获取某个图标\n */\n public getSvgIcon(name: string, namespace: string = ''): Observable<SVGElement> {\n // Return (copy of) cached icon if possible.\n const key = this.buildIconKey(namespace, name);\n const config = this.svgIconConfigs.get(key);\n\n if (config) {\n return this.getSvgFromConfig(config);\n }\n\n // See if we have any icon sets registered for the namespace.\n const iconSetConfigs = this.svgIconSetConfigs.get(namespace);\n\n if (iconSetConfigs) {\n return this.getSvgFromIconSetConfigs(name, iconSetConfigs);\n }\n\n return throwError(this.getIconNameNotFoundError(key));\n }\n\n public setIconMode(mode: IconMode) {\n this.internalIconMode = mode;\n }\n}\n","import { take } from 'rxjs/operators';\nimport { useHostRenderer } from '@tethys/cdk/dom';\n\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Input,\n OnChanges,\n OnInit,\n Renderer2,\n SimpleChanges,\n ViewEncapsulation,\n numberAttribute,\n inject\n} from '@angular/core';\n\nimport { getWhetherPrintErrorWhenIconNotFound } from './config';\nimport { ThyIconRegistry } from './icon-registry';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\nconst iconSuffixMap = {\n fill: 'fill',\n twotone: 'tt'\n};\n\n/**\n * 图标组件\n * @name thy-icon,[thy-icon]\n * @order 10\n */\n@Component({\n selector: 'thy-icon, [thy-icon]',\n template: '<ng-content></ng-content>',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'thy-icon'\n }\n})\nexport class ThyIcon implements OnInit, OnChanges {\n private render = inject(Renderer2);\n private elementRef = inject(ElementRef);\n private iconRegistry = inject(ThyIconRegistry);\n\n private initialized = false;\n\n /**\n * 图标的类型\n * @type outline | fill | twotone\n */\n @Input('thyIconType') iconType: 'outline' | 'fill' | 'twotone' = 'outline';\n\n @Input('thyTwotoneColor') iconTwotoneColor: string;\n\n /**\n * 图标的名字\n */\n @Input('thyIconName') iconName: string;\n\n /**\n * 图标的旋转角度\n * @default 0\n */\n @Input({ alias: 'thyIconRotate', transform: numberAttribute }) iconRotate: number;\n\n @Input('thyIconSet') iconSet: string;\n\n /**\n * 图标打底色,镂空的图标,会透过颜色来\n * @default false\n */\n @HostBinding(`class.thy-icon-legging`)\n @Input({ alias: 'thyIconLegging', transform: coerceBooleanProperty })\n iconLegging: boolean;\n\n @Input({ alias: 'thyIconLinearGradient', transform: coerceBooleanProperty })\n iconLinearGradient: boolean;\n\n private hostRenderer = useHostRenderer();\n\n ngOnInit() {\n this.updateClasses();\n this.initialized = true;\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (this.initialized) {\n if (\n changes['iconName'] ||\n changes['iconSet'] ||\n changes['iconTwotoneColor'] ||\n changes['iconType'] ||\n changes['iconLinearGradient']\n ) {\n this.updateClasses();\n } else if (changes['iconRotate']) {\n this.setStyleRotate();\n }\n }\n }\n\n private updateClasses() {\n const [namespace, iconName] = this.iconRegistry.splitIconName(this.iconName);\n if (iconName) {\n if (this.iconRegistry.iconMode === 'svg') {\n this.iconRegistry\n .getSvgIcon(this.buildIconNameByType(iconName), namespace)\n .pipe(take(1))\n .subscribe(\n svg => {\n this.setSvgElement(svg);\n },\n (error: Error) => {\n if (getWhetherPrintErrorWhenIconNotFound()) {\n console.error(`Error retrieving icon: ${error.message}`);\n }\n }\n );\n this.hostRenderer.updateClass([`thy-icon${namespace ? `-${namespace}` : ``}-${this.buildIconNameByType(iconName)}`]);\n } else {\n const fontSetClass = this.iconSet\n ? this.iconRegistry.getFontSetClassByAlias(this.iconSet)\n : this.iconRegistry.getDefaultFontSetClass();\n this.hostRenderer.updateClass([fontSetClass, `${fontSetClass}-${this.iconName}`]);\n }\n }\n }\n\n private setStyleRotate() {\n if (this.iconRotate !== undefined) {\n this.render.setStyle(this.elementRef.nativeElement.querySelector('svg'), 'transform', `rotate(${this.iconRotate}deg)`);\n }\n }\n\n //#region svg element\n\n private setSvgElement(svg: SVGElement) {\n this.clearSvgElement();\n\n // Workaround for IE11 and Edge ignoring `style` tags inside dynamically-created SVGs.\n // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10898469/\n // Do this before inserting the element into the DOM, in order to avoid a style recalculation.\n const styleTags = svg.querySelectorAll('style') as NodeListOf<HTMLStyleElement>;\n\n for (let i = 0; i < styleTags.length; i++) {\n styleTags[i].textContent += ' ';\n }\n\n if (this.iconType === 'twotone') {\n const allPaths = svg.querySelectorAll('path');\n if (allPaths.length > 1) {\n allPaths.forEach((child, index: number) => {\n if (child.getAttribute('id').includes('secondary-color')) {\n child.setAttribute('fill', this.iconTwotoneColor);\n }\n });\n }\n }\n\n // Note: we do this fix here, rather than the icon registry, because the\n // references have to point to the URL at the time that the icon was created.\n // if (this._location) {\n // const path = this._location.getPathname();\n // this._previousPath = path;\n // this._cacheChildrenWithExternalReferences(svg);\n // this._prependPathToReferences(path);\n // }\n if (this.iconLinearGradient) {\n this.setBaseUrl(svg);\n this.clearTitleElement(svg);\n }\n\n this.elementRef.nativeElement.appendChild(svg);\n this.setStyleRotate();\n }\n\n private clearSvgElement() {\n const layoutElement: HTMLElement = this.elementRef.nativeElement;\n let childCount = layoutElement.childNodes.length;\n\n // if (this._elementsWithExternalReferences) {\n // this._elementsWithExternalReferences.clear();\n // }\n\n // Remove existing non-element child nodes and SVGs, and add the new SVG element. Note that\n // we can't use innerHTML, because IE will throw if the element has a data binding.\n while (childCount--) {\n const child = layoutElement.childNodes[childCount];\n\n // 1 corresponds to Node.ELEMENT_NODE. We remove all non-element nodes in order to get rid\n // of any loose text nodes, as well as any SVG elements in order to remove any old icons.\n if (child.nodeType !== 1 || child.nodeName.toLowerCase() === 'svg') {\n layoutElement.removeChild(child);\n }\n }\n }\n\n //#endregion\n\n private buildIconNameByType(iconName: string) {\n if (this.iconType && ['fill', 'twotone'].indexOf(this.iconType) >= 0) {\n const suffix = iconSuffixMap[this.iconType];\n return iconName.includes(`-${suffix}`) ? iconName : `${iconName}-${suffix}`;\n } else {\n return iconName;\n }\n }\n\n /**\n * Support Safari SVG LinearGradient.\n * @param svg\n */\n private setBaseUrl(svg: SVGElement) {\n const styleElements = svg.querySelectorAll('style');\n styleElements.forEach((n: HTMLElement) => {\n if (n.style.cssText.includes('url')) {\n n.style.fill = n.style.fill.replace('url(\"', 'url(\"' + location.pathname);\n }\n if (n.style.cssText.includes('clip-path')) {\n n.style.clipPath = n.style.clipPath.replace('url(\"', 'url(\"' + location.pathname);\n }\n });\n }\n\n private clearTitleElement(svg: SVGElement) {\n const titleElement = svg.querySelector('title');\n titleElement && titleElement.remove();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { ThyIcon } from './icon.component';\n\n@NgModule({\n declarations: [],\n exports: [ThyIcon],\n imports: [ThyIcon, CommonModule, FormsModule],\n providers: []\n})\nexport class ThyIconModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,IAAI,sBAAsB,GAAG,IAAI;AAE3B,SAAU,6BAA6B,CAAC,KAAc,EAAA;IACxD,sBAAsB,GAAG,KAAK;AAClC;SAEgB,oCAAoC,GAAA;AAChD,IAAA,OAAO,sBAAsB;AACjC;;ACCA,MAAM,aAAa,CAAA;AAIf,IAAA,WAAA,CAAY,IAAkC,EAAA;;;QAG1C,IAAI,IAAI,IAAI,CAAC,CAAE,IAAY,CAAC,QAAQ,EAAE;AAClC,YAAA,IAAI,CAAC,UAAU,GAAG,IAAkB;;aACjC;AACH,YAAA,IAAI,CAAC,GAAG,GAAG,IAAuB;;;AAG7C;AAQD;;AAEG;MAIU,eAAe,CAAA;AAH5B,IAAA,WAAA,GAAA;AAIY,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;QAChC,IAAU,CAAA,UAAA,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACpD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAE3B,IAAmB,CAAA,mBAAA,GAAG,SAAS;QAC/B,IAAgB,CAAA,gBAAA,GAAa,KAAK;AAClC,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,GAAG,EAAyB;AACjD,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,GAAG,EAA2B;AACtD,QAAA,IAAA,CAAA,oBAAoB,GAAG,IAAI,GAAG,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O,EAAE,CAAC,OAAO,CAAC;AAClB,oBAAA,OAAO,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,WAAW,CAAC;AAC7C,oBAAA,SAAS,EAAE;AACd,iBAAA;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys-icon.mjs","sources":["../../../src/icon/config.ts","../../../src/icon/icon-registry.ts","../../../src/icon/icon.component.ts","../../../src/icon/icon.module.ts","../../../src/icon/ngx-tethys-icon.ts"],"sourcesContent":["let printErrorWhenNotFound = true;\n\nexport function setPrintErrorWhenIconNotFound(value: boolean) {\n printErrorWhenNotFound = value;\n}\n\nexport function getWhetherPrintErrorWhenIconNotFound() {\n return printErrorWhenNotFound;\n}\n","import { forkJoin, Observable, of, throwError } from 'rxjs';\nimport { catchError, finalize, map, share, tap } from 'rxjs/operators';\n\nimport { DOCUMENT } from '@angular/common';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { Injectable, SecurityContext, inject } from '@angular/core';\nimport { DomSanitizer, SafeHtml, SafeResourceUrl } from '@angular/platform-browser';\nimport { isString } from 'ngx-tethys/util';\n\nclass SvgIconConfig {\n url: SafeResourceUrl | null;\n svgElement: SVGElement | null;\n\n constructor(data: SafeResourceUrl | SVGElement) {\n // Note that we can't use `instanceof SVGElement` here,\n // because it'll break during server-side rendering.\n if (data && !!(data as any).nodeName) {\n this.svgElement = data as SVGElement;\n } else {\n this.url = data as SafeResourceUrl;\n }\n }\n}\n\nexport type IconMode = 'font' | 'svg';\n\nexport type SvgResourceUrl = SafeResourceUrl | string;\n\nexport type SvgHtml = SafeHtml | string;\n\n/**\n * @order 20\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ThyIconRegistry {\n private sanitizer = inject(DomSanitizer);\n private httpClient = inject(HttpClient, { optional: false });\n private document = inject(DOCUMENT);\n\n private defaultFontSetClass = 'wt-icon';\n private internalIconMode: IconMode = 'svg';\n private svgIconConfigs = new Map<string, SvgIconConfig>();\n private svgIconSetConfigs = new Map<string, SvgIconConfig[]>();\n private inProgressUrlFetches = new Map<string, Observable<string>>();\n\n public get iconMode() {\n return this.internalIconMode;\n }\n\n private getIconNameNotFoundError(iconName: string): Error {\n return Error(`Unable to find icon with the name \"${iconName}\"`);\n }\n\n private getIconFailedToSanitizeLiteralError(literal: SvgHtml): Error {\n return Error(\n `The literal provided to ThyIconRegistry was not trusted as safe HTML by ` +\n `Angular's DomSanitizer. Attempted literal was \"${literal}\".`\n );\n }\n\n private internalAddSvgIconSet(namespace: string, config: SvgIconConfig): this {\n const configNamespace = this.svgIconSetConfigs.get(namespace);\n\n if (configNamespace) {\n configNamespace.push(config);\n } else {\n this.svgIconSetConfigs.set(namespace, [config]);\n }\n\n return this;\n }\n\n private cloneSvg(svg: SVGElement): SVGElement {\n return svg.cloneNode(true) as SVGElement;\n }\n\n private fetchUrl(safeUrl: SafeResourceUrl | null): Observable<string> {\n if (safeUrl == null) {\n throw Error(`Cannot fetch icon from URL \"${safeUrl}\".`);\n }\n\n const url = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, safeUrl);\n\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !url) {\n throw new Error(\n `The URL provided to ThyIconRegistry was not trusted as a resource URL ` +\n `via Angular's DomSanitizer. Attempted URL was \"${url}\".`\n );\n }\n\n // Store in-progress fetches to avoid sending a duplicate request for a URL when there is\n // already a request in progress for that URL. It's necessary to call share() on the\n // Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.\n const inProgressFetch = this.inProgressUrlFetches.get(url);\n\n if (inProgressFetch) {\n return inProgressFetch;\n } else {\n // TODO(jelbourn): for some reason, the `finalize` operator \"loses\" the generic type on the\n // Observable. Figure out why and fix it.\n const req = this.httpClient.get(url, { responseType: 'text' }).pipe(\n finalize(() => this.inProgressUrlFetches.delete(url)),\n share()\n );\n\n this.inProgressUrlFetches.set(url, req);\n return req;\n }\n }\n\n private toSvgElement(element: Element): SVGElement {\n const svg = this.svgElementFromString('<svg></svg>');\n\n for (let i = 0; i < element.childNodes.length; i++) {\n if (element.childNodes[i].nodeType === this.document.ELEMENT_NODE) {\n svg.appendChild(element.childNodes[i].cloneNode(true));\n }\n }\n\n return svg;\n }\n\n private extractSvgIconFromIconSet(iconSet: SVGElement, iconName: string): SVGElement | null {\n // Use the `id=\"iconName\"` syntax in order to escape special\n // characters in the ID (versus using the #iconName syntax).\n const iconSource = iconSet.querySelector(`[id=\"${iconName}\"]`);\n\n if (!iconSource) {\n return null;\n }\n\n // Clone the element and remove the ID to prevent multiple elements from being added\n // to the page with the same ID.\n const iconElement = iconSource.cloneNode(true) as Element;\n iconElement.removeAttribute('id');\n\n // If the icon node is itself an <svg> node, clone and return it directly. If not, set it as\n // the content of a new <svg> node.\n if (iconElement.nodeName.toLowerCase() === 'svg') {\n return this.setSvgAttributes(iconElement as SVGElement);\n }\n\n // If the node is a <symbol>, it won't be rendered so we have to convert it into <svg>. Note\n // that the same could be achieved by referring to it via <use href=\"#id\">, however the <use>\n // tag is problematic on Firefox, because it needs to include the current page path.\n if (iconElement.nodeName.toLowerCase() === 'symbol') {\n return this.setSvgAttributes(this.toSvgElement(iconElement));\n }\n\n // createElement('SVG') doesn't work as expected; the DOM ends up with\n // the correct nodes, but the SVG content doesn't render. Instead we\n // have to create an empty SVG node using innerHTML and append its content.\n // Elements created using DOMParser.parseFromString have the same problem.\n // http://stackoverflow.com/questions/23003278/svg-innerhtml-in-firefox-can-not-display\n const svg = this.svgElementFromString('<svg></svg>');\n // Clone the node so we don't remove it from the parent icon set element.\n svg.appendChild(iconElement);\n\n return this.setSvgAttributes(svg);\n }\n\n private extractIconWithNameFromIconSetConfigs(iconName: string, iconSetConfigs: SvgIconConfig[]): SVGElement | null {\n // Iterate backwards, so icon sets added later have precedence.\n for (let i = iconSetConfigs.length - 1; i >= 0; i--) {\n const config = iconSetConfigs[i];\n if (config.svgElement) {\n const foundIcon = this.extractSvgIconFromIconSet(config.svgElement, iconName);\n if (foundIcon) {\n return foundIcon;\n }\n }\n }\n return null;\n }\n\n private svgElementFromString(str: string): SVGElement {\n const div = this.document.createElement('DIV');\n div.innerHTML = str;\n const svg = div.querySelector('svg') as SVGElement;\n\n if (!svg) {\n throw Error('<svg> tag not found');\n }\n\n return svg;\n }\n\n private setSvgAttributes(svg: SVGElement): SVGElement {\n svg.setAttribute('fit', '');\n svg.setAttribute('height', '1em');\n svg.setAttribute('width', '1em');\n svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');\n svg.setAttribute('focusable', 'false'); // Disable IE11 default behavior to make SVGs focusable.\n return svg;\n }\n\n private createSvgElementForSingleIcon(responseText: string): SVGElement {\n const svg = this.svgElementFromString(responseText);\n this.setSvgAttributes(svg);\n return svg;\n }\n\n private loadSvgIconFromConfig(config: SvgIconConfig): Observable<SVGElement> {\n return this.fetchUrl(config.url).pipe(map(svgText => this.createSvgElementForSingleIcon(svgText)));\n }\n\n private loadSvgIconSetFromConfig(config: SvgIconConfig): Observable<SVGElement> {\n // If the SVG for this icon set has already been parsed, do nothing.\n if (config.svgElement) {\n return of(config.svgElement);\n }\n\n return this.fetchUrl(config.url).pipe(\n map(svgText => {\n // It is possible that the icon set was parsed and cached by an earlier request, so parsing\n // only needs to occur if the cache is yet unset.\n if (!config.svgElement) {\n config.svgElement = this.svgElementFromString(svgText);\n }\n\n return config.svgElement;\n })\n );\n }\n\n private getSvgFromConfig(config: SvgIconConfig): Observable<SVGElement> {\n if (config.svgElement) {\n // We already have the SVG element for this icon, return a copy.\n return of(this.cloneSvg(config.svgElement));\n } else {\n // Fetch the icon from the config's URL, cache it, and return a copy.\n return this.loadSvgIconFromConfig(config).pipe(\n tap(svg => (config.svgElement = svg)),\n map(svg => this.cloneSvg(svg))\n );\n }\n }\n\n private getSvgFromIconSetConfigs(name: string, iconSetConfigs: SvgIconConfig[]): Observable<SVGElement> {\n // For all the icon set SVG elements we've fetched, see if any contain an icon with the\n // requested name.\n const namedIcon = this.extractIconWithNameFromIconSetConfigs(name, iconSetConfigs);\n\n if (namedIcon) {\n // We could cache namedIcon in svgIconConfigs, but since we have to make a copy every\n // time anyway, there's probably not much advantage compared to just always extracting\n // it from the icon set.\n return of(namedIcon);\n }\n\n // Not found in any cached icon sets. If there are icon sets with URLs that we haven't\n // fetched, fetch them now and look for iconName in the results.\n const iconSetFetchRequests: Observable<SVGElement | null>[] = iconSetConfigs\n .filter(iconSetConfig => !iconSetConfig.svgElement)\n .map(iconSetConfig => {\n return this.loadSvgIconSetFromConfig(iconSetConfig).pipe(\n catchError((err: HttpErrorResponse): Observable<SVGElement | null> => {\n const url = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, iconSetConfig.url);\n\n // Swallow errors fetching individual URLs so the\n // combined Observable won't necessarily fail.\n console.error(`Loading icon set URL: ${url} failed: ${err.message}`);\n return of(null);\n })\n );\n });\n\n // Fetch all the icon set URLs. When the requests complete, every IconSet should have a\n // cached SVG element (unless the request failed), and we can check again for the icon.\n return forkJoin(iconSetFetchRequests).pipe(\n map(() => {\n const foundIcon = this.extractIconWithNameFromIconSetConfigs(name, iconSetConfigs);\n\n if (!foundIcon) {\n throw this.getIconNameNotFoundError(name);\n }\n\n return foundIcon;\n })\n );\n }\n\n private internalAddSvgIconConfig(namespace: string, iconName: string, config: SvgIconConfig): this {\n this.svgIconConfigs.set(this.buildIconKey(namespace, iconName), config);\n return this;\n }\n\n public buildIconKey(namespace: string, name: string) {\n return namespace + ':' + name;\n }\n\n public splitIconName(iconName: string): [string, string] {\n if (!iconName) {\n return ['', ''];\n }\n const parts = iconName.split(':');\n switch (parts.length) {\n case 1:\n return ['', parts[0]]; // Use default namespace.\n case 2:\n return <[string, string]>parts;\n default:\n throw Error(`Invalid icon name: \"${iconName}\"`);\n }\n }\n\n public addSvgIconSetInNamespace(namespace: string, url: SvgResourceUrl): this {\n url = isString(url) ? this.sanitizer.bypassSecurityTrustResourceUrl(url) : url;\n return this.internalAddSvgIconSet(namespace, new SvgIconConfig(url));\n }\n\n /**\n * 添加SVG图标集,添加到默认命名空间\n */\n public addSvgIconSet(url: SvgResourceUrl): this {\n return this.addSvgIconSetInNamespace('', url);\n }\n\n public addSvgIconSetLiteralInNamespace(namespace: string, literal: SafeHtml): this {\n const sanitizedLiteral = this.sanitizer.sanitize(SecurityContext.HTML, literal);\n\n if (!sanitizedLiteral) {\n throw this.getIconFailedToSanitizeLiteralError(literal);\n }\n\n const svgElement = this.svgElementFromString(sanitizedLiteral);\n return this.internalAddSvgIconSet(namespace, new SvgIconConfig(svgElement));\n }\n\n public addSvgIconSetLiteral(literal: SafeHtml): this {\n return this.addSvgIconSetLiteralInNamespace('', literal);\n }\n\n /**\n * @description.en-us Registers an icon by URL in the specified namespace.\n * @description 添加单个SVG图标到指定的命名空间\n * @param namespace Namespace in which the icon should be registered.\n * @param iconName Name under which the icon should be registered.\n * @param url\n */\n public addSvgIconInNamespace(namespace: string, iconName: string, url: SvgResourceUrl): this {\n url = isString(url) ? this.sanitizer.bypassSecurityTrustResourceUrl(url) : url;\n return this.internalAddSvgIconConfig(namespace, iconName, new SvgIconConfig(url));\n }\n\n /**\n * @description.en-us Registers an icon by URL in the default namespace.\n * @description 添加单个SVG图标\n * @param iconName Name under which the icon should be registered.\n * @param url\n */\n public addSvgIcon(iconName: string, url: SvgResourceUrl): this {\n return this.addSvgIconInNamespace('', iconName, url);\n }\n\n /**\n * @description.en-us Registers an icon using an HTML string in the default namespace.\n * @description 添加单个SVG图标字符串,直接传入 SVG HTML 字符串\n * @param iconName Name under which the icon should be registered.\n * @param literal SVG source of the icon.\n */\n public addSvgIconLiteral(iconName: string, literal: SvgHtml): this {\n return this.addSvgIconLiteralInNamespace('', iconName, literal);\n }\n\n /**\n * @description.en-us Registers an icon using an HTML string in the specified namespace.\n * @description 添加单个SVG图标字符串到指定的命名空间,直接传入 SVG HTML 字符串\n * @param namespace Namespace in which the icon should be registered.\n * @param iconName Name under which the icon should be registered.\n * @param literal SVG source of the icon.\n */\n public addSvgIconLiteralInNamespace(namespace: string, iconName: string, literal: SvgHtml): this {\n literal = isString(literal) ? this.sanitizer.bypassSecurityTrustHtml(literal) : literal;\n const sanitizedLiteral = this.sanitizer.sanitize(SecurityContext.HTML, literal);\n\n if (!sanitizedLiteral) {\n throw this.getIconFailedToSanitizeLiteralError(literal);\n }\n\n const svgElement = this.createSvgElementForSingleIcon(sanitizedLiteral);\n return this.internalAddSvgIconConfig(namespace, iconName, new SvgIconConfig(svgElement));\n }\n\n public getDefaultFontSetClass() {\n return this.defaultFontSetClass;\n }\n\n public getFontSetClassByAlias(fontSet: string) {\n return fontSet;\n }\n\n /**\n * 获取某个图标\n */\n public getSvgIcon(name: string, namespace: string = ''): Observable<SVGElement> {\n // Return (copy of) cached icon if possible.\n const key = this.buildIconKey(namespace, name);\n const config = this.svgIconConfigs.get(key);\n\n if (config) {\n return this.getSvgFromConfig(config);\n }\n\n // See if we have any icon sets registered for the namespace.\n const iconSetConfigs = this.svgIconSetConfigs.get(namespace);\n\n if (iconSetConfigs) {\n return this.getSvgFromIconSetConfigs(name, iconSetConfigs);\n }\n\n return throwError(this.getIconNameNotFoundError(key));\n }\n\n public setIconMode(mode: IconMode) {\n this.internalIconMode = mode;\n }\n}\n","import { take } from 'rxjs/operators';\nimport { useHostRenderer } from '@tethys/cdk/dom';\n\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Renderer2,\n ViewEncapsulation,\n numberAttribute,\n inject,\n input,\n effect\n} from '@angular/core';\n\nimport { getWhetherPrintErrorWhenIconNotFound } from './config';\nimport { ThyIconRegistry } from './icon-registry';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\nconst iconSuffixMap = {\n fill: 'fill',\n twotone: 'tt'\n};\n\n/**\n * 图标组件\n * @name thy-icon,[thy-icon]\n * @order 10\n */\n@Component({\n selector: 'thy-icon, [thy-icon]',\n template: '<ng-content></ng-content>',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'thy-icon',\n '[class.thy-icon-legging]': 'thyIconLegging()'\n }\n})\nexport class ThyIcon {\n private render = inject(Renderer2);\n private elementRef = inject(ElementRef);\n private iconRegistry = inject(ThyIconRegistry);\n\n /**\n * 图标的类型\n * @type outline | fill | twotone\n */\n readonly thyIconType = input<'outline' | 'fill' | 'twotone'>('outline');\n\n readonly thyTwotoneColor = input<string>();\n\n /**\n * 图标的名字\n */\n readonly thyIconName = input.required<string>();\n\n /**\n * 图标的旋转角度\n * @default 0\n */\n readonly thyIconRotate = input<number, unknown>(undefined, { transform: numberAttribute });\n\n readonly thyIconSet = input<string>();\n\n /**\n * 图标打底色,镂空的图标,会透过颜色来\n */\n readonly thyIconLegging = input(false, { transform: coerceBooleanProperty });\n\n readonly thyIconLinearGradient = input(false, { transform: coerceBooleanProperty });\n\n private hostRenderer = useHostRenderer();\n\n constructor() {\n effect(() => {\n this.updateClasses();\n });\n effect(() => {\n this.setStyleRotate();\n });\n }\n\n private updateClasses() {\n const [namespace, iconName] = this.iconRegistry.splitIconName(this.thyIconName());\n if (iconName) {\n if (this.iconRegistry.iconMode === 'svg') {\n this.iconRegistry\n .getSvgIcon(this.buildIconNameByType(iconName), namespace)\n .pipe(take(1))\n .subscribe(\n svg => {\n this.setSvgElement(svg);\n },\n (error: Error) => {\n if (getWhetherPrintErrorWhenIconNotFound()) {\n console.error(`Error retrieving icon: ${error.message}`);\n }\n }\n );\n this.hostRenderer.updateClass([`thy-icon${namespace ? `-${namespace}` : ``}-${this.buildIconNameByType(iconName)}`]);\n } else {\n const fontSetClass = this.thyIconSet()\n ? this.iconRegistry.getFontSetClassByAlias(this.thyIconSet())\n : this.iconRegistry.getDefaultFontSetClass();\n this.hostRenderer.updateClass([fontSetClass, `${fontSetClass}-${this.thyIconName()}`]);\n }\n }\n }\n\n private setStyleRotate() {\n if (this.thyIconRotate() !== undefined) {\n // 基于 effect 无法保证在 setSvgElement 之前执行,所以这里增加判断\n const svg = this.elementRef.nativeElement.querySelector('svg');\n if (!svg) {\n return;\n }\n this.render.setStyle(svg, 'transform', `rotate(${this.thyIconRotate()}deg)`);\n }\n }\n\n //#region svg element\n\n private setSvgElement(svg: SVGElement) {\n this.clearSvgElement();\n\n // Workaround for IE11 and Edge ignoring `style` tags inside dynamically-created SVGs.\n // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10898469/\n // Do this before inserting the element into the DOM, in order to avoid a style recalculation.\n const styleTags = svg.querySelectorAll('style') as NodeListOf<HTMLStyleElement>;\n\n for (let i = 0; i < styleTags.length; i++) {\n styleTags[i].textContent += ' ';\n }\n\n if (this.thyIconType() === 'twotone') {\n const allPaths = svg.querySelectorAll('path');\n if (allPaths.length > 1) {\n allPaths.forEach((child, index: number) => {\n if (child.getAttribute('id').includes('secondary-color')) {\n child.setAttribute('fill', this.thyTwotoneColor());\n }\n });\n }\n }\n\n // Note: we do this fix here, rather than the icon registry, because the\n // references have to point to the URL at the time that the icon was created.\n // if (this._location) {\n // const path = this._location.getPathname();\n // this._previousPath = path;\n // this._cacheChildrenWithExternalReferences(svg);\n // this._prependPathToReferences(path);\n // }\n if (this.thyIconLinearGradient()) {\n this.setBaseUrl(svg);\n this.clearTitleElement(svg);\n }\n\n this.elementRef.nativeElement.appendChild(svg);\n this.setStyleRotate();\n }\n\n private clearSvgElement() {\n const layoutElement: HTMLElement = this.elementRef.nativeElement;\n let childCount = layoutElement.childNodes.length;\n\n // if (this._elementsWithExternalReferences) {\n // this._elementsWithExternalReferences.clear();\n // }\n\n // Remove existing non-element child nodes and SVGs, and add the new SVG element. Note that\n // we can't use innerHTML, because IE will throw if the element has a data binding.\n while (childCount--) {\n const child = layoutElement.childNodes[childCount];\n\n // 1 corresponds to Node.ELEMENT_NODE. We remove all non-element nodes in order to get rid\n // of any loose text nodes, as well as any SVG elements in order to remove any old icons.\n if (child.nodeType !== 1 || child.nodeName.toLowerCase() === 'svg') {\n layoutElement.removeChild(child);\n }\n }\n }\n\n //#endregion\n\n private buildIconNameByType(iconName: string) {\n if (this.thyIconType() && ['fill', 'twotone'].indexOf(this.thyIconType()) >= 0) {\n const suffix = iconSuffixMap[this.thyIconType() as keyof typeof iconSuffixMap];\n return iconName.includes(`-${suffix}`) ? iconName : `${iconName}-${suffix}`;\n } else {\n return iconName;\n }\n }\n\n /**\n * Support Safari SVG LinearGradient.\n * @param svg\n */\n private setBaseUrl(svg: SVGElement) {\n const styleElements = svg.querySelectorAll('style');\n styleElements.forEach((n: HTMLElement) => {\n if (n.style.cssText.includes('url')) {\n n.style.fill = n.style.fill.replace('url(\"', 'url(\"' + location.pathname);\n }\n if (n.style.cssText.includes('clip-path')) {\n n.style.clipPath = n.style.clipPath.replace('url(\"', 'url(\"' + location.pathname);\n }\n });\n }\n\n private clearTitleElement(svg: SVGElement) {\n const titleElement = svg.querySelector('title');\n titleElement && titleElement.remove();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { ThyIcon } from './icon.component';\n\n@NgModule({\n declarations: [],\n exports: [ThyIcon],\n imports: [ThyIcon, CommonModule, FormsModule],\n providers: []\n})\nexport class ThyIconModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,IAAI,sBAAsB,GAAG,IAAI;AAE3B,SAAU,6BAA6B,CAAC,KAAc,EAAA;IACxD,sBAAsB,GAAG,KAAK;AAClC;SAEgB,oCAAoC,GAAA;AAChD,IAAA,OAAO,sBAAsB;AACjC;;ACCA,MAAM,aAAa,CAAA;AAIf,IAAA,WAAA,CAAY,IAAkC,EAAA;;;QAG1C,IAAI,IAAI,IAAI,CAAC,CAAE,IAAY,CAAC,QAAQ,EAAE;AAClC,YAAA,IAAI,CAAC,UAAU,GAAG,IAAkB;;aACjC;AACH,YAAA,IAAI,CAAC,GAAG,GAAG,IAAuB;;;AAG7C;AAQD;;AAEG;MAIU,eAAe,CAAA;AAH5B,IAAA,WAAA,GAAA;AAIY,QAAA,IAAA,CAAA,SAAS,GAAG,M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EAAE;AACd,iBAAA;;;ACVD;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Injector, ElementRef, ViewEncapsulation, ChangeDetectionStrategy, Component, ChangeDetectorRef, NgZone, EventEmitter, DestroyRef, ViewChild, Output, Injectable, InjectFlags, Input, Directive, NgModule } from '@angular/core';
2
+ import { InjectionToken, inject, Injector, ElementRef, ViewEncapsulation, ChangeDetectionStrategy, Component, ChangeDetectorRef, NgZone, EventEmitter, DestroyRef, ViewChild, Output, Injectable, input, effect, InjectFlags, Directive, NgModule } from '@angular/core';
3
3
  import { ThyAbstractOverlayConfig } from 'ngx-tethys/core';
4
4
  import { CdkDrag, DragDropModule } from '@angular/cdk/drag-drop';
5
5
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -577,17 +577,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
577
577
  * @order 10
578
578
  */
579
579
  class ThyImageDirective {
580
+ get previewable() {
581
+ return !this.thyDisablePreview();
582
+ }
580
583
  constructor() {
581
584
  this.thyImageService = inject(ThyImageService);
582
585
  this.injector = inject(Injector);
583
586
  this.elementRef = inject(ElementRef);
587
+ /**
588
+ * 图片地址
589
+ */
590
+ this.thySrc = input();
591
+ /**
592
+ * 预览图片地址
593
+ */
594
+ this.thyPreviewSrc = input();
595
+ /**
596
+ * 图片原图地址
597
+ */
598
+ this.thyOriginSrc = input();
599
+ /**
600
+ * 图片附加信息,包含 { name: string, size?: string | number; }
601
+ */
602
+ this.thyImageMeta = input();
603
+ /**
604
+ * 是否禁止预览
605
+ * @default false
606
+ */
607
+ this.thyDisablePreview = input(undefined, { transform: coerceBooleanProperty });
584
608
  /**
585
609
  * 是否自动计算图片资源大小
586
610
  */
587
- this.thyResolveSize = false;
588
- }
589
- get previewable() {
590
- return !this.thyDisablePreview;
611
+ this.thyResolveSize = input(false, { transform: coerceBooleanProperty });
612
+ effect(() => {
613
+ this.elementRef.nativeElement.src = this.thySrc();
614
+ });
591
615
  }
592
616
  ngOnInit() {
593
617
  this.getParentGroup();
@@ -621,12 +645,6 @@ class ThyImageDirective {
621
645
  }
622
646
  });
623
647
  }
624
- ngOnChanges(changes) {
625
- const { thySrc } = changes;
626
- if (thySrc) {
627
- this.elementRef.nativeElement.src = thySrc.currentValue;
628
- }
629
- }
630
648
  onPreview(event) {
631
649
  if (!this.previewable || event.button !== 0) {
632
650
  return;
@@ -634,29 +652,29 @@ class ThyImageDirective {
634
652
  if (this.parentGroup) {
635
653
  const previewAbleImages = this.parentGroup.images.filter(e => e.previewable);
636
654
  const previewImages = previewAbleImages.map(e => ({
637
- src: e.thyPreviewSrc || e.thySrc,
638
- ...e.thyImageMeta,
655
+ src: e.thyPreviewSrc() || e.thySrc(),
656
+ ...e.thyImageMeta(),
639
657
  origin: {
640
- src: e.thyOriginSrc
658
+ src: e.thyOriginSrc()
641
659
  }
642
660
  }));
643
661
  const startIndex = previewAbleImages.findIndex(el => this === el);
644
662
  this.thyImageService.preview(previewImages, {
645
663
  startIndex,
646
- resolveSize: this.thyResolveSize
664
+ resolveSize: this.thyResolveSize()
647
665
  });
648
666
  }
649
667
  else {
650
668
  const previewImages = [
651
669
  {
652
- src: this.thyPreviewSrc || this.thySrc,
653
- ...this.thyImageMeta,
670
+ src: this.thyPreviewSrc() || this.thySrc(),
671
+ ...this.thyImageMeta(),
654
672
  origin: {
655
- src: this.thyOriginSrc
673
+ src: this.thyOriginSrc()
656
674
  }
657
675
  }
658
676
  ];
659
- this.thyImageService.preview(previewImages, { resolveSize: this.thyResolveSize });
677
+ this.thyImageService.preview(previewImages, { resolveSize: this.thyResolveSize() });
660
678
  }
661
679
  }
662
680
  ngOnDestroy() {
@@ -666,7 +684,7 @@ class ThyImageDirective {
666
684
  }
667
685
  }
668
686
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyImageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
669
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.8", type: ThyImageDirective, isStandalone: true, selector: "img[thyImage]", inputs: { thySrc: "thySrc", thyPreviewSrc: "thyPreviewSrc", thyOriginSrc: "thyOriginSrc", thyImageMeta: "thyImageMeta", thyDisablePreview: ["thyDisablePreview", "thyDisablePreview", coerceBooleanProperty], thyResolveSize: ["thyResolveSize", "thyResolveSize", coerceBooleanProperty] }, host: { listeners: { "click": "onPreview($event)" }, properties: { "class.thy-image-disabled": "thyDisablePreview" }, classAttribute: "thy-image" }, exportAs: ["thyImage"], usesOnChanges: true, ngImport: i0 }); }
687
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyImageDirective, isStandalone: true, selector: "img[thyImage]", inputs: { thySrc: { classPropertyName: "thySrc", publicName: "thySrc", isSignal: true, isRequired: false, transformFunction: null }, thyPreviewSrc: { classPropertyName: "thyPreviewSrc", publicName: "thyPreviewSrc", isSignal: true, isRequired: false, transformFunction: null }, thyOriginSrc: { classPropertyName: "thyOriginSrc", publicName: "thyOriginSrc", isSignal: true, isRequired: false, transformFunction: null }, thyImageMeta: { classPropertyName: "thyImageMeta", publicName: "thyImageMeta", isSignal: true, isRequired: false, transformFunction: null }, thyDisablePreview: { classPropertyName: "thyDisablePreview", publicName: "thyDisablePreview", isSignal: true, isRequired: false, transformFunction: null }, thyResolveSize: { classPropertyName: "thyResolveSize", publicName: "thyResolveSize", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onPreview($event)" }, properties: { "class.thy-image-disabled": "thyDisablePreview()" }, classAttribute: "thy-image" }, exportAs: ["thyImage"], ngImport: i0 }); }
670
688
  }
671
689
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyImageDirective, decorators: [{
672
690
  type: Directive,
@@ -676,24 +694,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
676
694
  host: {
677
695
  '(click)': 'onPreview($event)',
678
696
  class: 'thy-image',
679
- '[class.thy-image-disabled]': 'thyDisablePreview'
697
+ '[class.thy-image-disabled]': 'thyDisablePreview()'
680
698
  }
681
699
  }]
682
- }], propDecorators: { thySrc: [{
683
- type: Input
684
- }], thyPreviewSrc: [{
685
- type: Input
686
- }], thyOriginSrc: [{
687
- type: Input
688
- }], thyImageMeta: [{
689
- type: Input
690
- }], thyDisablePreview: [{
691
- type: Input,
692
- args: [{ transform: coerceBooleanProperty }]
693
- }], thyResolveSize: [{
694
- type: Input,
695
- args: [{ transform: coerceBooleanProperty }]
696
- }] } });
700
+ }], ctorParameters: () => [] });
697
701
 
698
702
  class ThyImageModule {
699
703
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyImageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }