ngx-tethys 19.0.13 → 19.1.0-next.0

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 (280) hide show
  1. package/CHANGELOG.md +29 -2
  2. package/action/action.component.d.ts +12 -20
  3. package/action/actions.component.d.ts +5 -7
  4. package/affix/affix.component.d.ts +7 -10
  5. package/alert/alert.component.d.ts +1 -1
  6. package/anchor/anchor-link.component.d.ts +8 -8
  7. package/anchor/anchor.component.d.ts +15 -21
  8. package/arrow-switcher/arrow-switcher.component.d.ts +15 -22
  9. package/autocomplete/autocomplete.component.d.ts +10 -17
  10. package/autocomplete/autocomplete.trigger.directive.d.ts +10 -18
  11. package/avatar/avatar-list/avatar-list.component.d.ts +8 -14
  12. package/avatar/avatar.component.d.ts +25 -39
  13. package/back-top/back-top.component.d.ts +9 -12
  14. package/badge/badge.component.d.ts +19 -59
  15. package/breadcrumb/breadcrumb.component.d.ts +15 -20
  16. package/button/button-icon.component.d.ts +3 -2
  17. package/button/button.component.d.ts +3 -2
  18. package/calendar/calendar-header.component.d.ts +9 -8
  19. package/calendar/calendar.component.d.ts +16 -16
  20. package/card/card.component.d.ts +5 -11
  21. package/card/content.component.d.ts +3 -8
  22. package/card/header.component.d.ts +7 -8
  23. package/carousel/carousel.component.d.ts +22 -27
  24. package/cascader/cascader-li.component.d.ts +13 -21
  25. package/cascader/cascader-search-option.component.d.ts +8 -16
  26. package/cascader/cascader.component.d.ts +58 -80
  27. package/checkbox/checkbox.component.d.ts +2 -5
  28. package/collapse/collapse-item.component.d.ts +12 -19
  29. package/collapse/collapse.component.d.ts +6 -12
  30. package/collapse/collapse.token.d.ts +3 -3
  31. package/color-picker/color-picker-custom-panel.component.d.ts +5 -5
  32. package/color-picker/color-picker-panel.component.d.ts +7 -11
  33. package/color-picker/color-picker.component.d.ts +19 -35
  34. package/color-picker/parts/alpha/alpha.component.d.ts +8 -8
  35. package/color-picker/parts/hue/hue.component.d.ts +6 -6
  36. package/color-picker/parts/indicator/indicator.component.d.ts +4 -3
  37. package/color-picker/parts/inputs/inputs.component.d.ts +9 -9
  38. package/color-picker/parts/saturation/saturation.component.d.ts +9 -9
  39. package/comment/comment.component.d.ts +4 -5
  40. package/copy/copy.directive.d.ts +8 -9
  41. package/date-picker/abstract-picker.component.d.ts +8 -7
  42. package/date-picker/lib/calendar/calendar-footer.component.d.ts +2 -1
  43. package/date-picker/lib/popups/inner-popup.component.d.ts +2 -1
  44. package/date-picker/picker.component.d.ts +2 -1
  45. package/date-range/date-range.component.d.ts +2 -2
  46. package/dialog/body/dialog-body.component.d.ts +2 -6
  47. package/dialog/confirm/confirm.component.d.ts +2 -2
  48. package/dialog/footer/dialog-footer.component.d.ts +6 -9
  49. package/dialog/header/dialog-header.component.d.ts +9 -11
  50. package/divider/divider.component.d.ts +12 -16
  51. package/dot/dot.component.d.ts +5 -13
  52. package/drag-drop/drag-handle.directive.d.ts +2 -1
  53. package/drag-drop/drag.directive.d.ts +2 -1
  54. package/drag-drop/drop-container.directive.d.ts +2 -1
  55. package/dropdown/dropdown-menu-item.directive.d.ts +3 -2
  56. package/dropdown/dropdown-menu.component.d.ts +2 -1
  57. package/dropdown/dropdown.directive.d.ts +2 -1
  58. package/empty/empty.component.d.ts +21 -27
  59. package/fesm2022/ngx-tethys-action.mjs +54 -91
  60. package/fesm2022/ngx-tethys-action.mjs.map +1 -1
  61. package/fesm2022/ngx-tethys-affix.mjs +29 -26
  62. package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
  63. package/fesm2022/ngx-tethys-anchor.mjs +91 -118
  64. package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
  65. package/fesm2022/ngx-tethys-arrow-switcher.mjs +51 -77
  66. package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
  67. package/fesm2022/ngx-tethys-autocomplete.mjs +69 -103
  68. package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
  69. package/fesm2022/ngx-tethys-avatar.mjs +117 -162
  70. package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
  71. package/fesm2022/ngx-tethys-back-top.mjs +33 -46
  72. package/fesm2022/ngx-tethys-back-top.mjs.map +1 -1
  73. package/fesm2022/ngx-tethys-badge.mjs +104 -208
  74. package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
  75. package/fesm2022/ngx-tethys-breadcrumb.mjs +66 -70
  76. package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
  77. package/fesm2022/ngx-tethys-calendar.mjs +85 -87
  78. package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
  79. package/fesm2022/ngx-tethys-card.mjs +72 -77
  80. package/fesm2022/ngx-tethys-card.mjs.map +1 -1
  81. package/fesm2022/ngx-tethys-carousel.mjs +82 -99
  82. package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
  83. package/fesm2022/ngx-tethys-cascader.mjs +313 -468
  84. package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
  85. package/fesm2022/ngx-tethys-checkbox.mjs +10 -17
  86. package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
  87. package/fesm2022/ngx-tethys-collapse.mjs +66 -71
  88. package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
  89. package/fesm2022/ngx-tethys-color-picker.mjs +187 -246
  90. package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
  91. package/fesm2022/ngx-tethys-comment.mjs +16 -10
  92. package/fesm2022/ngx-tethys-comment.mjs.map +1 -1
  93. package/fesm2022/ngx-tethys-copy.mjs +25 -28
  94. package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
  95. package/fesm2022/ngx-tethys-dialog.mjs +81 -82
  96. package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
  97. package/fesm2022/ngx-tethys-divider.mjs +49 -58
  98. package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
  99. package/fesm2022/ngx-tethys-dot.mjs +45 -68
  100. package/fesm2022/ngx-tethys-dot.mjs.map +1 -1
  101. package/fesm2022/ngx-tethys-empty.mjs +107 -95
  102. package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
  103. package/fesm2022/ngx-tethys-form.mjs +161 -200
  104. package/fesm2022/ngx-tethys-form.mjs.map +1 -1
  105. package/fesm2022/ngx-tethys-fullscreen.mjs +21 -23
  106. package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
  107. package/fesm2022/ngx-tethys-grid.mjs +160 -152
  108. package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
  109. package/fesm2022/ngx-tethys-i18n.mjs +25 -25
  110. package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
  111. package/fesm2022/ngx-tethys-input-number.mjs +101 -114
  112. package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
  113. package/fesm2022/ngx-tethys-input.mjs +268 -271
  114. package/fesm2022/ngx-tethys-input.mjs.map +1 -1
  115. package/fesm2022/ngx-tethys-list.mjs +1 -1
  116. package/fesm2022/ngx-tethys-list.mjs.map +1 -1
  117. package/fesm2022/ngx-tethys-loading.mjs +17 -35
  118. package/fesm2022/ngx-tethys-loading.mjs.map +1 -1
  119. package/fesm2022/ngx-tethys-mention.mjs +52 -74
  120. package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
  121. package/fesm2022/ngx-tethys-menu.mjs +106 -179
  122. package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
  123. package/fesm2022/ngx-tethys-nav.mjs +169 -201
  124. package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
  125. package/fesm2022/ngx-tethys-pagination.mjs +230 -294
  126. package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
  127. package/fesm2022/ngx-tethys-popover.mjs +67 -70
  128. package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
  129. package/fesm2022/ngx-tethys-progress.mjs +196 -244
  130. package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
  131. package/fesm2022/ngx-tethys-property.mjs +102 -105
  132. package/fesm2022/ngx-tethys-property.mjs.map +1 -1
  133. package/fesm2022/ngx-tethys-radio.mjs +34 -38
  134. package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
  135. package/fesm2022/ngx-tethys-result.mjs +46 -28
  136. package/fesm2022/ngx-tethys-result.mjs.map +1 -1
  137. package/fesm2022/ngx-tethys-skeleton.mjs +339 -342
  138. package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
  139. package/fesm2022/ngx-tethys-slider.mjs +75 -108
  140. package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
  141. package/fesm2022/ngx-tethys-space.mjs +26 -46
  142. package/fesm2022/ngx-tethys-space.mjs.map +1 -1
  143. package/fesm2022/ngx-tethys-statistic.mjs +114 -151
  144. package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
  145. package/fesm2022/ngx-tethys-stepper.mjs +74 -107
  146. package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
  147. package/fesm2022/ngx-tethys-switch.mjs +80 -140
  148. package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
  149. package/fesm2022/ngx-tethys-table.mjs +1 -1
  150. package/fesm2022/ngx-tethys-table.mjs.map +1 -1
  151. package/fesm2022/ngx-tethys-tabs.mjs +69 -87
  152. package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
  153. package/fesm2022/ngx-tethys-tag.mjs +42 -64
  154. package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
  155. package/fesm2022/ngx-tethys-timeline.mjs +104 -129
  156. package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
  157. package/fesm2022/ngx-tethys-typography.mjs +36 -33
  158. package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
  159. package/fesm2022/ngx-tethys-upload.mjs +91 -130
  160. package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
  161. package/fesm2022/ngx-tethys-util.mjs.map +1 -1
  162. package/fesm2022/ngx-tethys-watermark.mjs +36 -40
  163. package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
  164. package/fesm2022/ngx-tethys.mjs +1 -1
  165. package/fesm2022/ngx-tethys.mjs.map +1 -1
  166. package/form/form-group-error/form-group-error.component.d.ts +2 -3
  167. package/form/form-group-label.directive.d.ts +2 -1
  168. package/form/form-group.component.d.ts +17 -24
  169. package/form/form-submit.directive.d.ts +2 -2
  170. package/form/form.directive.d.ts +6 -8
  171. package/form/from-group-footer/form-group-footer.component.d.ts +2 -2
  172. package/form/validator/confirm-validator.directive.d.ts +2 -2
  173. package/form/validator/unique-validator.directive.d.ts +2 -2
  174. package/fullscreen/fullscreen.component.d.ts +7 -7
  175. package/grid/flex.d.ts +14 -19
  176. package/grid/thy-col.directive.d.ts +6 -9
  177. package/grid/thy-grid-item.component.d.ts +3 -4
  178. package/grid/thy-grid.component.d.ts +11 -12
  179. package/grid/thy-row.directive.d.ts +12 -12
  180. package/icon/icon.component.d.ts +3 -2
  181. package/image/image.directive.d.ts +3 -2
  182. package/input/input-count.component.d.ts +4 -5
  183. package/input/input-group.component.d.ts +20 -20
  184. package/input/input-search.component.d.ts +15 -20
  185. package/input/input.component.d.ts +20 -21
  186. package/input/input.directive.d.ts +4 -6
  187. package/input-number/input-number.component.d.ts +21 -29
  188. package/layout/header.component.d.ts +4 -9
  189. package/layout/sidebar-header.component.d.ts +2 -1
  190. package/layout/sidebar.component.d.ts +8 -7
  191. package/list/list.component.d.ts +2 -1
  192. package/list/selection/selection-list.d.ts +4 -3
  193. package/loading/loading.component.d.ts +4 -10
  194. package/mention/mention.directive.d.ts +6 -7
  195. package/mention/suggestions/suggestions.component.d.ts +8 -9
  196. package/menu/group/menu-group.component.d.ts +16 -33
  197. package/menu/item/action/menu-item-action.component.d.ts +7 -8
  198. package/menu/item/icon/menu-item-icon.component.d.ts +2 -2
  199. package/menu/item/menu-item.component.d.ts +4 -4
  200. package/menu/item/name/menu-item-name.component.d.ts +2 -3
  201. package/menu/menu.component.d.ts +3 -7
  202. package/nav/icon-nav/icon-nav-link.directive.d.ts +3 -7
  203. package/nav/icon-nav/icon-nav.component.d.ts +3 -8
  204. package/nav/nav-ink-bar.directive.d.ts +4 -6
  205. package/nav/nav-item.directive.d.ts +7 -10
  206. package/nav/nav.component.d.ts +20 -48
  207. package/package.json +1 -1
  208. package/pagination/pagination.component.d.ts +48 -109
  209. package/popover/header/popover-header.component.d.ts +7 -6
  210. package/popover/popover.directive.d.ts +11 -18
  211. package/progress/progress-circle.component.d.ts +32 -21
  212. package/progress/progress-strip.component.d.ts +10 -14
  213. package/progress/progress.component.d.ts +15 -23
  214. package/property/examples/single/single.component.scss +6 -0
  215. package/property/properties.component.d.ts +6 -13
  216. package/property/property-item.component.d.ts +21 -26
  217. package/property/styles/properties.scss +124 -52
  218. package/property-operation/property-operation.component.d.ts +6 -5
  219. package/radio/button/radio-button.component.d.ts +2 -2
  220. package/radio/group/radio-group.component.d.ts +8 -7
  221. package/radio/radio.component.d.ts +2 -2
  222. package/radio/radio.token.d.ts +2 -2
  223. package/rate/rate-item.component.d.ts +2 -1
  224. package/rate/rate.component.d.ts +4 -3
  225. package/resizable/resizable.directive.d.ts +4 -9
  226. package/resizable/resize-handle.component.d.ts +2 -1
  227. package/resizable/resize-handles.component.d.ts +2 -1
  228. package/result/result.component.d.ts +9 -10
  229. package/schematics/version.d.ts +1 -1
  230. package/schematics/version.js +1 -1
  231. package/segment/segment-item.component.d.ts +2 -1
  232. package/segment/segment.component.d.ts +2 -1
  233. package/select/custom-select/custom-select.component.d.ts +11 -10
  234. package/select/native-select/native-select.component.d.ts +2 -1
  235. package/shared/base-form-check.component.d.ts +3 -2
  236. package/shared/directives/thy-autofocus.directive.d.ts +3 -2
  237. package/shared/directives/thy-scroll.directive.d.ts +2 -1
  238. package/shared/directives/thy-show.d.ts +2 -1
  239. package/shared/option/group/option-group.component.d.ts +2 -1
  240. package/shared/option/list-option/list-option.component.d.ts +2 -7
  241. package/shared/option/option.component.d.ts +2 -1
  242. package/shared/select/select-control/select-control.component.d.ts +7 -6
  243. package/skeleton/skeleton-circle.component.d.ts +16 -19
  244. package/skeleton/skeleton-rectangle.component.d.ts +20 -23
  245. package/skeleton/skeleton.component.d.ts +5 -6
  246. package/skeleton/stylized/bullet-list.component.d.ts +11 -13
  247. package/skeleton/stylized/list.component.d.ts +10 -12
  248. package/skeleton/stylized/paragraph.component.d.ts +12 -14
  249. package/slide/slide-body/slide-body-section.component.d.ts +2 -1
  250. package/slider/slider.component.d.ts +17 -24
  251. package/space/space.component.d.ts +8 -8
  252. package/statistic/statistic.component.d.ts +35 -40
  253. package/stepper/step-header.component.d.ts +6 -10
  254. package/stepper/step.component.d.ts +6 -6
  255. package/stepper/stepper.component.d.ts +15 -20
  256. package/switch/switch.component.d.ts +24 -35
  257. package/table/table-column.component.d.ts +6 -5
  258. package/table/table-skeleton.component.d.ts +3 -10
  259. package/table/table.component.d.ts +11 -10
  260. package/tabs/tab-content.component.d.ts +4 -4
  261. package/tabs/tab.component.d.ts +4 -5
  262. package/tabs/tabs.component.d.ts +13 -15
  263. package/tag/tag.component.d.ts +10 -16
  264. package/time-picker/time-picker-panel.component.d.ts +3 -2
  265. package/time-picker/time-picker.component.d.ts +6 -5
  266. package/timeline/timeline-item.component.d.ts +9 -13
  267. package/timeline/timeline.component.d.ts +13 -17
  268. package/tooltip/tooltip.directive.d.ts +3 -2
  269. package/tree/tree-node.component.d.ts +6 -15
  270. package/tree/tree.component.d.ts +8 -7
  271. package/tree-select/tree-select.component.d.ts +8 -7
  272. package/typography/bg-color.directive.d.ts +3 -3
  273. package/typography/text/text.component.d.ts +2 -2
  274. package/typography/text-color.directive.d.ts +3 -3
  275. package/upload/file-drop.directive.d.ts +9 -11
  276. package/upload/file-select-base.d.ts +6 -10
  277. package/upload/file-select.component.d.ts +10 -20
  278. package/util/helpers/helpers.d.ts +2 -1
  279. package/vote/vote.component.d.ts +4 -3
  280. package/watermark/watermark.directive.d.ts +7 -9
@@ -1,6 +1,6 @@
1
1
  import { NgTemplateOutlet, CommonModule } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { Input, ChangeDetectionStrategy, Component, Directive, NgModule } from '@angular/core';
3
+ import { input, ChangeDetectionStrategy, Component, Directive, NgModule } from '@angular/core';
4
4
  import { ThyStringOrTemplateOutletDirective, ThySharedModule } from 'ngx-tethys/shared';
5
5
  import { isTemplateRef } from 'ngx-tethys/util';
6
6
  import { ThyAvatar, ThyAvatarModule } from 'ngx-tethys/avatar';
@@ -12,23 +12,29 @@ import { ThyIconModule } from 'ngx-tethys/icon';
12
12
  */
13
13
  class ThyComment {
14
14
  constructor() {
15
+ /**
16
+ * 展示评论作者
17
+ */
18
+ this.thyAuthor = input();
19
+ /**
20
+ * 展示评论时间
21
+ */
22
+ this.thyDatetime = input();
23
+ /**
24
+ * 展示评论作者头像
25
+ */
26
+ this.thyAvatar = input();
15
27
  this.isTemplateRef = isTemplateRef;
16
28
  }
17
29
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyComment, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
18
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyComment, isStandalone: true, selector: "thy-comment", inputs: { thyAuthor: "thyAuthor", thyDatetime: "thyDatetime", thyAvatar: "thyAvatar" }, host: { classAttribute: "thy-comment" }, ngImport: i0, template: "<div class=\"thy-comment-inner\">\n @if (isTemplateRef(this.thyAvatar)) {\n <ng-template [ngTemplateOutlet]=\"thyAvatar\"></ng-template>\n } @else {\n @if (thyAuthor || thyAvatar) {\n <div class=\"thy-comment-avatar\">\n <thy-avatar [thyName]=\"!isTemplateRef(thyAuthor) && thyAuthor\" thySize=\"28\" [thySrc]=\"thyAvatar || ''\"></thy-avatar>\n </div>\n }\n }\n\n <div class=\"thy-comment-body\">\n <div class=\"thy-comment-body-author\">\n <span class=\"thy-comment-body-author-name\">\n <ng-container *thyStringOrTemplateOutlet=\"thyAuthor\"></ng-container>\n </span>\n <span class=\"thy-comment-body-author-time\">\n <ng-container *thyStringOrTemplateOutlet=\"thyDatetime\"></ng-container>\n </span>\n </div>\n <ng-content select=\"[thyCommentContent]\"></ng-content>\n </div>\n <ng-content select=\"[thyCommentActions]\"></ng-content>\n</div>\n<div class=\"thy-comment-nested\">\n <ng-content></ng-content>\n</div>\n\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ThyStringOrTemplateOutletDirective, selector: "[thyStringOrTemplateOutlet]", inputs: ["thyStringOrTemplateOutletContext", "thyStringOrTemplateOutlet"], exportAs: ["thyStringOrTemplateOutlet"] }, { kind: "component", type: ThyAvatar, selector: "thy-avatar", inputs: ["thyShowName", "thySrc", "thyName", "thySize", "thyShowRemove", "thyRemovable", "thyImgClass", "thyDisabled", "thyLoading", "thyFetchPriority"], outputs: ["thyOnRemove", "thyRemove", "thyError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
30
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyComment, isStandalone: true, selector: "thy-comment", inputs: { thyAuthor: { classPropertyName: "thyAuthor", publicName: "thyAuthor", isSignal: true, isRequired: false, transformFunction: null }, thyDatetime: { classPropertyName: "thyDatetime", publicName: "thyDatetime", isSignal: true, isRequired: false, transformFunction: null }, thyAvatar: { classPropertyName: "thyAvatar", publicName: "thyAvatar", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "thy-comment" }, ngImport: i0, template: "<div class=\"thy-comment-inner\">\n @if (isTemplateRef(this.thyAvatar())) {\n <ng-template [ngTemplateOutlet]=\"thyAvatar()\"></ng-template>\n } @else {\n @if (thyAuthor() || thyAvatar()) {\n <div class=\"thy-comment-avatar\">\n <thy-avatar [thyName]=\"!isTemplateRef(thyAuthor()) && thyAuthor()\" thySize=\"28\" [thySrc]=\"thyAvatar() || ''\"></thy-avatar>\n </div>\n }\n }\n\n <div class=\"thy-comment-body\">\n <div class=\"thy-comment-body-author\">\n <span class=\"thy-comment-body-author-name\">\n <ng-container *thyStringOrTemplateOutlet=\"thyAuthor()\"></ng-container>\n </span>\n <span class=\"thy-comment-body-author-time\">\n <ng-container *thyStringOrTemplateOutlet=\"thyDatetime()\"></ng-container>\n </span>\n </div>\n <ng-content select=\"[thyCommentContent]\"></ng-content>\n </div>\n <ng-content select=\"[thyCommentActions]\"></ng-content>\n</div>\n<div class=\"thy-comment-nested\">\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ThyStringOrTemplateOutletDirective, selector: "[thyStringOrTemplateOutlet]", inputs: ["thyStringOrTemplateOutletContext", "thyStringOrTemplateOutlet"], exportAs: ["thyStringOrTemplateOutlet"] }, { kind: "component", type: ThyAvatar, selector: "thy-avatar", inputs: ["thyShowName", "thySrc", "thyName", "thySize", "thyShowRemove", "thyRemovable", "thyImgClass", "thyDisabled", "thyLoading", "thyFetchPriority"], outputs: ["thyOnRemove", "thyRemove", "thyError", "thySizeChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
19
31
  }
20
32
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyComment, decorators: [{
21
33
  type: Component,
22
34
  args: [{ selector: 'thy-comment', host: {
23
35
  class: 'thy-comment'
24
- }, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, ThyStringOrTemplateOutletDirective, ThyAvatar], template: "<div class=\"thy-comment-inner\">\n @if (isTemplateRef(this.thyAvatar)) {\n <ng-template [ngTemplateOutlet]=\"thyAvatar\"></ng-template>\n } @else {\n @if (thyAuthor || thyAvatar) {\n <div class=\"thy-comment-avatar\">\n <thy-avatar [thyName]=\"!isTemplateRef(thyAuthor) && thyAuthor\" thySize=\"28\" [thySrc]=\"thyAvatar || ''\"></thy-avatar>\n </div>\n }\n }\n\n <div class=\"thy-comment-body\">\n <div class=\"thy-comment-body-author\">\n <span class=\"thy-comment-body-author-name\">\n <ng-container *thyStringOrTemplateOutlet=\"thyAuthor\"></ng-container>\n </span>\n <span class=\"thy-comment-body-author-time\">\n <ng-container *thyStringOrTemplateOutlet=\"thyDatetime\"></ng-container>\n </span>\n </div>\n <ng-content select=\"[thyCommentContent]\"></ng-content>\n </div>\n <ng-content select=\"[thyCommentActions]\"></ng-content>\n</div>\n<div class=\"thy-comment-nested\">\n <ng-content></ng-content>\n</div>\n\n" }]
25
- }], propDecorators: { thyAuthor: [{
26
- type: Input
27
- }], thyDatetime: [{
28
- type: Input
29
- }], thyAvatar: [{
30
- type: Input
31
- }] } });
36
+ }, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, ThyStringOrTemplateOutletDirective, ThyAvatar], template: "<div class=\"thy-comment-inner\">\n @if (isTemplateRef(this.thyAvatar())) {\n <ng-template [ngTemplateOutlet]=\"thyAvatar()\"></ng-template>\n } @else {\n @if (thyAuthor() || thyAvatar()) {\n <div class=\"thy-comment-avatar\">\n <thy-avatar [thyName]=\"!isTemplateRef(thyAuthor()) && thyAuthor()\" thySize=\"28\" [thySrc]=\"thyAvatar() || ''\"></thy-avatar>\n </div>\n }\n }\n\n <div class=\"thy-comment-body\">\n <div class=\"thy-comment-body-author\">\n <span class=\"thy-comment-body-author-name\">\n <ng-container *thyStringOrTemplateOutlet=\"thyAuthor()\"></ng-container>\n </span>\n <span class=\"thy-comment-body-author-time\">\n <ng-container *thyStringOrTemplateOutlet=\"thyDatetime()\"></ng-container>\n </span>\n </div>\n <ng-content select=\"[thyCommentContent]\"></ng-content>\n </div>\n <ng-content select=\"[thyCommentActions]\"></ng-content>\n</div>\n<div class=\"thy-comment-nested\">\n <ng-content></ng-content>\n</div>\n" }]
37
+ }] });
32
38
 
33
39
  /**
34
40
  * @private
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys-comment.mjs","sources":["../../../src/comment/comment.component.ts","../../../src/comment/comment.component.html","../../../src/comment/comment-content.directive.ts","../../../src/comment/comment-actions.directive.ts","../../../src/comment/comment.module.ts","../../../src/comment/ngx-tethys-comment.ts"],"sourcesContent":["import { isTemplateRef } from 'ngx-tethys/util';\nimport { SafeAny } from 'ngx-tethys/types';\nimport { ChangeDetectionStrategy, Component, Input, TemplateRef } from '@angular/core';\nimport { ThyAvatar } from 'ngx-tethys/avatar';\nimport { ThyStringOrTemplateOutletDirective } from 'ngx-tethys/shared';\nimport { NgTemplateOutlet } from '@angular/common';\n\n/**\n * 评论组件\n * @name thy-comment\n */\n@Component({\n selector: 'thy-comment',\n templateUrl: './comment.component.html',\n host: {\n class: 'thy-comment'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, ThyStringOrTemplateOutletDirective, ThyAvatar]\n})\nexport class ThyComment {\n /**\n * 展示评论作者\n */\n @Input() thyAuthor?: string | TemplateRef<SafeAny>;\n\n /**\n * 展示评论时间\n */\n @Input() thyDatetime?: string | TemplateRef<SafeAny>;\n\n /**\n * 展示评论作者头像\n */\n @Input() thyAvatar?: string | TemplateRef<SafeAny>;\n\n isTemplateRef = isTemplateRef;\n}\n","<div class=\"thy-comment-inner\">\n @if (isTemplateRef(this.thyAvatar)) {\n <ng-template [ngTemplateOutlet]=\"thyAvatar\"></ng-template>\n } @else {\n @if (thyAuthor || thyAvatar) {\n <div class=\"thy-comment-avatar\">\n <thy-avatar [thyName]=\"!isTemplateRef(thyAuthor) && thyAuthor\" thySize=\"28\" [thySrc]=\"thyAvatar || ''\"></thy-avatar>\n </div>\n }\n }\n\n <div class=\"thy-comment-body\">\n <div class=\"thy-comment-body-author\">\n <span class=\"thy-comment-body-author-name\">\n <ng-container *thyStringOrTemplateOutlet=\"thyAuthor\"></ng-container>\n </span>\n <span class=\"thy-comment-body-author-time\">\n <ng-container *thyStringOrTemplateOutlet=\"thyDatetime\"></ng-container>\n </span>\n </div>\n <ng-content select=\"[thyCommentContent]\"></ng-content>\n </div>\n <ng-content select=\"[thyCommentActions]\"></ng-content>\n</div>\n<div class=\"thy-comment-nested\">\n <ng-content></ng-content>\n</div>\n\n","import { Directive } from '@angular/core';\n\n/**\n * @private\n */\n@Directive({\n selector: '[thyCommentContent]',\n exportAs: 'thyCommentContent',\n host: { class: 'thy-comment-content' }\n})\nexport class ThyCommentContentDirective {}\n","import { Directive } from '@angular/core';\n\n/**\n * @private\n */\n@Directive({\n selector: '[thyCommentActions]',\n exportAs: 'thyCommentActions',\n host: { class: 'thy-comment-actions' }\n})\nexport class ThyCommentActionsDirective {}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyComment } from './comment.component';\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThyAvatarModule } from 'ngx-tethys/avatar';\nimport { ThyCommentContentDirective } from './comment-content.directive';\nimport { ThyCommentActionsDirective } from './comment-actions.directive';\n@NgModule({\n imports: [\n CommonModule,\n ThySharedModule,\n ThyIconModule,\n ThyAvatarModule,\n ThyComment,\n ThyCommentContentDirective,\n ThyCommentActionsDirective\n ],\n exports: [ThyComment, ThyCommentContentDirective, ThyCommentActionsDirective],\n providers: []\n})\nexport class ThyCommentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAOA;;;AAGG;MAUU,UAAU,CAAA;AATvB,IAAA,WAAA,GAAA;QAyBI,IAAa,CAAA,aAAA,GAAG,aAAa;AAChC;8GAjBY,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAV,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA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UAAU;YACV,0BAA0B;AAC1B,YAAA,0BAA0B,CAEpB,EAAA,OAAA,EAAA,CAAA,UAAU,EAAE,0BAA0B,EAAE,0BAA0B,CAAA,EAAA,CAAA,CAAA;AAGnE,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAXrB,YAAY;YACZ,eAAe;YACf,aAAa;YACb,eAAe;YACf,UAAU,CAAA,EAAA,CAAA,CAAA;;2FAOL,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAb5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,eAAe;wBACf,aAAa;wBACb,eAAe;wBACf,UAAU;wBACV,0BAA0B;wBAC1B;AACH,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,0BAA0B,EAAE,0BAA0B,CAAC;AAC7E,oBAAA,SAAS,EAAE;AACd,iBAAA;;;ACpBD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys-comment.mjs","sources":["../../../src/comment/comment.component.ts","../../../src/comment/comment.component.html","../../../src/comment/comment-content.directive.ts","../../../src/comment/comment-actions.directive.ts","../../../src/comment/comment.module.ts","../../../src/comment/ngx-tethys-comment.ts"],"sourcesContent":["import { isTemplateRef } from 'ngx-tethys/util';\nimport { SafeAny } from 'ngx-tethys/types';\nimport { ChangeDetectionStrategy, Component, TemplateRef, input } from '@angular/core';\nimport { ThyAvatar } from 'ngx-tethys/avatar';\nimport { ThyStringOrTemplateOutletDirective } from 'ngx-tethys/shared';\nimport { NgTemplateOutlet } from '@angular/common';\n\n/**\n * 评论组件\n * @name thy-comment\n */\n@Component({\n selector: 'thy-comment',\n templateUrl: './comment.component.html',\n host: {\n class: 'thy-comment'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, ThyStringOrTemplateOutletDirective, ThyAvatar]\n})\nexport class ThyComment {\n /**\n * 展示评论作者\n */\n readonly thyAuthor = input<string | TemplateRef<SafeAny>>();\n\n /**\n * 展示评论时间\n */\n readonly thyDatetime = input<string | TemplateRef<SafeAny>>();\n\n /**\n * 展示评论作者头像\n */\n readonly thyAvatar = input<string | TemplateRef<SafeAny>>();\n\n isTemplateRef = isTemplateRef;\n}\n","<div class=\"thy-comment-inner\">\n @if (isTemplateRef(this.thyAvatar())) {\n <ng-template [ngTemplateOutlet]=\"thyAvatar()\"></ng-template>\n } @else {\n @if (thyAuthor() || thyAvatar()) {\n <div class=\"thy-comment-avatar\">\n <thy-avatar [thyName]=\"!isTemplateRef(thyAuthor()) && thyAuthor()\" thySize=\"28\" [thySrc]=\"thyAvatar() || ''\"></thy-avatar>\n </div>\n }\n }\n\n <div class=\"thy-comment-body\">\n <div class=\"thy-comment-body-author\">\n <span class=\"thy-comment-body-author-name\">\n <ng-container *thyStringOrTemplateOutlet=\"thyAuthor()\"></ng-container>\n </span>\n <span class=\"thy-comment-body-author-time\">\n <ng-container *thyStringOrTemplateOutlet=\"thyDatetime()\"></ng-container>\n </span>\n </div>\n <ng-content select=\"[thyCommentContent]\"></ng-content>\n </div>\n <ng-content select=\"[thyCommentActions]\"></ng-content>\n</div>\n<div class=\"thy-comment-nested\">\n <ng-content></ng-content>\n</div>\n","import { Directive } from '@angular/core';\n\n/**\n * @private\n */\n@Directive({\n selector: '[thyCommentContent]',\n exportAs: 'thyCommentContent',\n host: { class: 'thy-comment-content' }\n})\nexport class ThyCommentContentDirective {}\n","import { Directive } from '@angular/core';\n\n/**\n * @private\n */\n@Directive({\n selector: '[thyCommentActions]',\n exportAs: 'thyCommentActions',\n host: { class: 'thy-comment-actions' }\n})\nexport class ThyCommentActionsDirective {}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyComment } from './comment.component';\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThyAvatarModule } from 'ngx-tethys/avatar';\nimport { ThyCommentContentDirective } from './comment-content.directive';\nimport { ThyCommentActionsDirective } from './comment-actions.directive';\n@NgModule({\n imports: [\n CommonModule,\n ThySharedModule,\n ThyIconModule,\n ThyAvatarModule,\n ThyComment,\n ThyCommentContentDirective,\n ThyCommentActionsDirective\n ],\n exports: [ThyComment, ThyCommentContentDirective, ThyCommentActionsDirective],\n providers: []\n})\nexport class ThyCommentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAOA;;;AAGG;MAUU,UAAU,CAAA;AATvB,IAAA,WAAA,GAAA;AAUI;;AAEG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,EAAiC;AAE3D;;AAEG;QACM,IAAW,CAAA,WAAA,GAAG,KAAK,EAAiC;AAE7D;;AAEG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,EAAiC;QAE3D,IAAa,CAAA,aAAA,GAAG,aAAa;AAChC;8GAjBY,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAV,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,8gBCpBvB,y/BA2BA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDTc,gBAAgB,EAAE,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,kCAAkC,4LAAE,SAAS,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,a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AAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,eAAe;wBACf,aAAa;wBACb,eAAe;wBACf,UAAU;wBACV,0BAA0B;wBAC1B;AACH,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,0BAA0B,EAAE,0BAA0B,CAAC;AAC7E,oBAAA,SAAS,EAAE;AACd,iBAAA;;;ACpBD;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, EventEmitter, HostListener, Input, Output, Directive, NgModule } from '@angular/core';
2
+ import { inject, output, input, HostListener, Directive, NgModule } from '@angular/core';
3
3
  import { DOCUMENT, CommonModule } from '@angular/common';
4
4
  import { coerceElement } from '@angular/cdk/coercion';
5
5
  import { ThyNotifyService, ThyNotifyModule } from 'ngx-tethys/notify';
@@ -20,30 +20,40 @@ class ThyCopyDirective {
20
20
  /**
21
21
  * 默认为点击标签,可传复制目标标签
22
22
  */
23
- this.thyCopy = new EventEmitter();
23
+ this.thyCopy = output();
24
24
  /**
25
25
  * 复制成功时的文案
26
26
  */
27
- this.thyCopySuccessText = this.locale().success;
27
+ this.thyCopySuccessText = input(this.locale().success);
28
28
  /**
29
29
  * 提示文案
30
30
  */
31
- this.thyCopyTips = this.locale().tips;
31
+ this.thyCopyTips = input(this.locale().tips);
32
+ /**
33
+ * 偏移量
34
+ */
35
+ this.thyCopyTipsOffset = input(undefined);
36
+ /**
37
+ * 当为 string 时,复制的是传入的内容;当为 ElementRef | HTMLElement 时,复制的是 dom 节点的 value 或者 textContent
38
+ */
39
+ this.thyCopyContent = input(undefined);
32
40
  /**
33
41
  * 是否展示通知
34
42
  */
35
- this.thyShowNotify = true;
43
+ this.thyShowNotify = input(true, { transform: coerceBooleanProperty });
36
44
  }
37
45
  ngOnInit() {
38
- this.tooltipDirective.content = this.thyCopyTips ? this.thyCopyTips : this.locale().tips;
39
- this.tooltipDirective.tooltipOffset = this.thyCopyTipsOffset;
46
+ const thyCopyTips = this.thyCopyTips();
47
+ this.tooltipDirective.content = thyCopyTips ? thyCopyTips : this.locale().tips;
48
+ this.tooltipDirective.tooltipOffset = this.thyCopyTipsOffset();
40
49
  }
41
50
  getContent(event) {
42
- if (typeof this.thyCopyContent === 'string') {
43
- return this.thyCopyContent;
51
+ const thyCopyContent = this.thyCopyContent();
52
+ if (typeof thyCopyContent === 'string') {
53
+ return thyCopyContent;
44
54
  }
45
55
  else {
46
- const target = this.thyCopyContent ? coerceElement(this.thyCopyContent) : event.target;
56
+ const target = thyCopyContent ? coerceElement(thyCopyContent) : event.target;
47
57
  return target.value || target.textContent;
48
58
  }
49
59
  }
@@ -55,13 +65,13 @@ class ThyCopyDirective {
55
65
  try {
56
66
  document.execCommand('copy', false, null);
57
67
  this.thyCopy.emit({ isSuccess: true, event });
58
- if (this.thyShowNotify) {
59
- this.notifyService.success(this.thyCopySuccessText);
68
+ if (this.thyShowNotify()) {
69
+ this.notifyService.success(this.thyCopySuccessText());
60
70
  }
61
71
  }
62
72
  catch (err) {
63
73
  this.thyCopy.emit({ isSuccess: false, event });
64
- if (this.thyShowNotify) {
74
+ if (this.thyShowNotify()) {
65
75
  this.notifyService.error(this.locale().error);
66
76
  }
67
77
  }
@@ -73,7 +83,7 @@ class ThyCopyDirective {
73
83
  this.tooltipDirective.hide();
74
84
  }
75
85
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyCopyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
76
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.8", type: ThyCopyDirective, isStandalone: true, selector: "[thyCopy]", inputs: { thyCopySuccessText: "thyCopySuccessText", thyCopyTips: "thyCopyTips", thyCopyTipsOffset: "thyCopyTipsOffset", thyCopyContent: "thyCopyContent", thyShowNotify: ["thyShowNotify", "thyShowNotify", coerceBooleanProperty] }, outputs: { thyCopy: "thyCopy" }, host: { listeners: { "click": "onClick($event)" } }, hostDirectives: [{ directive: i1.ThyTooltipDirective }], ngImport: i0 }); }
86
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyCopyDirective, isStandalone: true, selector: "[thyCopy]", inputs: { thyCopySuccessText: { classPropertyName: "thyCopySuccessText", publicName: "thyCopySuccessText", isSignal: true, isRequired: false, transformFunction: null }, thyCopyTips: { classPropertyName: "thyCopyTips", publicName: "thyCopyTips", isSignal: true, isRequired: false, transformFunction: null }, thyCopyTipsOffset: { classPropertyName: "thyCopyTipsOffset", publicName: "thyCopyTipsOffset", isSignal: true, isRequired: false, transformFunction: null }, thyCopyContent: { classPropertyName: "thyCopyContent", publicName: "thyCopyContent", isSignal: true, isRequired: false, transformFunction: null }, thyShowNotify: { classPropertyName: "thyShowNotify", publicName: "thyShowNotify", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thyCopy: "thyCopy" }, host: { listeners: { "click": "onClick($event)" } }, hostDirectives: [{ directive: i1.ThyTooltipDirective }], ngImport: i0 }); }
77
87
  }
78
88
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyCopyDirective, decorators: [{
79
89
  type: Directive,
@@ -81,20 +91,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
81
91
  selector: '[thyCopy]',
82
92
  hostDirectives: [ThyTooltipDirective]
83
93
  }]
84
- }], propDecorators: { thyCopy: [{
85
- type: Output
86
- }], thyCopySuccessText: [{
87
- type: Input
88
- }], thyCopyTips: [{
89
- type: Input
90
- }], thyCopyTipsOffset: [{
91
- type: Input
92
- }], thyCopyContent: [{
93
- type: Input
94
- }], thyShowNotify: [{
95
- type: Input,
96
- args: [{ transform: coerceBooleanProperty }]
97
- }], onClick: [{
94
+ }], propDecorators: { onClick: [{
98
95
  type: HostListener,
99
96
  args: ['click', ['$event']]
100
97
  }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys-copy.mjs","sources":["../../../src/copy/copy.directive.ts","../../../src/copy/module.ts","../../../src/copy/ngx-tethys-copy.ts"],"sourcesContent":["import { Directive, ElementRef, EventEmitter, HostListener, Input, OnDestroy, OnInit, Output, Signal, inject } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { coerceElement } from '@angular/cdk/coercion';\nimport { ThyNotifyService } from 'ngx-tethys/notify';\nimport { ThyTooltipDirective } from 'ngx-tethys/tooltip';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\nimport { injectLocale, ThyCopyLocale } from 'ngx-tethys/i18n';\n\nexport interface ThyCopyEvent {\n isSuccess: boolean;\n event: Event;\n}\n\n/**\n * @name thyCopy\n */\n@Directive({\n selector: '[thyCopy]',\n hostDirectives: [ThyTooltipDirective]\n})\nexport class ThyCopyDirective implements OnInit, OnDestroy {\n private document = inject(DOCUMENT);\n tooltipDirective = inject(ThyTooltipDirective);\n private notifyService = inject(ThyNotifyService);\n private locale: Signal<ThyCopyLocale> = injectLocale('copy');\n\n /**\n * 默认为点击标签,可传复制目标标签\n */\n @Output() thyCopy = new EventEmitter<ThyCopyEvent>();\n\n /**\n * 复制成功时的文案\n */\n @Input() thyCopySuccessText = this.locale().success;\n\n /**\n * 提示文案\n */\n @Input() thyCopyTips = this.locale().tips;\n\n /**\n * 偏移量\n */\n @Input() thyCopyTipsOffset: number;\n\n /**\n * 当为 string 时,复制的是传入的内容;当为 ElementRef | HTMLElement 时,复制的是 dom 节点的 value 或者 textContent\n */\n @Input() thyCopyContent: string | ElementRef | HTMLElement;\n\n /**\n * 是否展示通知\n */\n @Input({ transform: coerceBooleanProperty }) thyShowNotify = true;\n\n ngOnInit() {\n this.tooltipDirective.content = this.thyCopyTips ? this.thyCopyTips : this.locale().tips;\n this.tooltipDirective.tooltipOffset = this.thyCopyTipsOffset;\n }\n\n private getContent(event: Event) {\n if (typeof this.thyCopyContent === 'string') {\n return this.thyCopyContent;\n } else {\n const target = this.thyCopyContent ? coerceElement(this.thyCopyContent) : event.target;\n return target.value || target.textContent;\n }\n }\n\n @HostListener('click', ['$event'])\n public onClick(event: Event) {\n const textarea = this.document.createElement('textarea');\n this.document.body.appendChild(textarea);\n textarea.value = this.getContent(event);\n textarea.select();\n try {\n document.execCommand('copy', false, null);\n this.thyCopy.emit({ isSuccess: true, event });\n if (this.thyShowNotify) {\n this.notifyService.success(this.thyCopySuccessText);\n }\n } catch (err) {\n this.thyCopy.emit({ isSuccess: false, event });\n if (this.thyShowNotify) {\n this.notifyService.error(this.locale().error);\n }\n } finally {\n textarea.remove();\n }\n }\n\n ngOnDestroy() {\n this.tooltipDirective.hide();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ThyCopyDirective } from './copy.directive';\nimport { ThyNotifyModule } from 'ngx-tethys/notify';\n\n@NgModule({\n imports: [CommonModule, ThyNotifyModule, ThyCopyDirective],\n exports: [ThyCopyDirective]\n})\nexport class ThyCopyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAaA;;AAEG;MAKU,gBAAgB,CAAA;AAJ7B,IAAA,WAAA,GAAA;AAKY,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACnC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACtC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,MAAM,GAA0B,YAAY,CAAC,MAAM,CAAC;AAE5D;;AAEG;AACO,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,YAAY,EAAgB;AAEpD;;AAEG;AACM,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO;AAEnD;;AAEG;AACM,QAAA,IAAA,CAAA,WA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zD,KAAK;uBAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE;gBAiBpC,OAAO,EAAA,CAAA;sBADb,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;MC7DxB,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAb,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAHZ,YAAY,EAAE,eAAe,EAAE,gBAAgB,aAC/C,gBAAgB,CAAA,EAAA,CAAA,CAAA;+GAEjB,aAAa,EAAA,OAAA,EAAA,CAHZ,YAAY,EAAE,eAAe,CAAA,EAAA,CAAA,CAAA;;2FAG9B,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,CAAC;oBAC1D,OAAO,EAAE,CAAC,gBAAgB;AAC7B,iBAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys-copy.mjs","sources":["../../../src/copy/copy.directive.ts","../../../src/copy/module.ts","../../../src/copy/ngx-tethys-copy.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, OnDestroy, OnInit, Signal, inject, input, output } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { coerceElement } from '@angular/cdk/coercion';\nimport { ThyNotifyService } from 'ngx-tethys/notify';\nimport { ThyTooltipDirective } from 'ngx-tethys/tooltip';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\nimport { injectLocale, ThyCopyLocale } from 'ngx-tethys/i18n';\n\nexport interface ThyCopyEvent {\n isSuccess: boolean;\n event: Event;\n}\n\n/**\n * @name thyCopy\n */\n@Directive({\n selector: '[thyCopy]',\n hostDirectives: [ThyTooltipDirective]\n})\nexport class ThyCopyDirective implements OnInit, OnDestroy {\n private document = inject(DOCUMENT);\n tooltipDirective = inject(ThyTooltipDirective);\n private notifyService = inject(ThyNotifyService);\n private locale: Signal<ThyCopyLocale> = injectLocale('copy');\n\n /**\n * 默认为点击标签,可传复制目标标签\n */\n readonly thyCopy = output<ThyCopyEvent>();\n\n /**\n * 复制成功时的文案\n */\n readonly thyCopySuccessText = input<string>(this.locale().success);\n\n /**\n * 提示文案\n */\n readonly thyCopyTips = input<string>(this.locale().tips);\n\n /**\n * 偏移量\n */\n readonly thyCopyTipsOffset = input<number>(undefined);\n\n /**\n * 当为 string 时,复制的是传入的内容;当为 ElementRef | HTMLElement 时,复制的是 dom 节点的 value 或者 textContent\n */\n readonly thyCopyContent = input<string | ElementRef | HTMLElement>(undefined);\n\n /**\n * 是否展示通知\n */\n readonly thyShowNotify = input(true, { transform: coerceBooleanProperty });\n\n ngOnInit() {\n const thyCopyTips = this.thyCopyTips();\n this.tooltipDirective.content = thyCopyTips ? thyCopyTips : this.locale().tips;\n this.tooltipDirective.tooltipOffset = this.thyCopyTipsOffset();\n }\n\n private getContent(event: Event) {\n const thyCopyContent = this.thyCopyContent();\n if (typeof thyCopyContent === 'string') {\n return thyCopyContent;\n } else {\n const target = thyCopyContent ? coerceElement(thyCopyContent) : event.target;\n return target.value || target.textContent;\n }\n }\n\n @HostListener('click', ['$event'])\n public onClick(event: Event) {\n const textarea = this.document.createElement('textarea');\n this.document.body.appendChild(textarea);\n textarea.value = this.getContent(event);\n textarea.select();\n try {\n document.execCommand('copy', false, null);\n this.thyCopy.emit({ isSuccess: true, event });\n if (this.thyShowNotify()) {\n this.notifyService.success(this.thyCopySuccessText());\n }\n } catch (err) {\n this.thyCopy.emit({ isSuccess: false, event });\n if (this.thyShowNotify()) {\n this.notifyService.error(this.locale().error);\n }\n } finally {\n textarea.remove();\n }\n }\n\n ngOnDestroy() {\n this.tooltipDirective.hide();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ThyCopyDirective } from './copy.directive';\nimport { ThyNotifyModule } from 'ngx-tethys/notify';\n\n@NgModule({\n imports: [CommonModule, ThyNotifyModule, ThyCopyDirective],\n exports: [ThyCopyDirective]\n})\nexport class ThyCopyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAaA;;AAEG;MAKU,gBAAgB,CAAA;AAJ7B,IAAA,WAAA,GAAA;AAKY,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACnC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACtC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,MAAM,GAA0B,YAAY,CAAC,MAAM,CAAC;AAE5D;;AAEG;QACM,IAAO,CAAA,OAAA,GAAG,MAAM,EAAgB;AAEzC;;AAEG;QACM,IAAkB,CAAA,kBAAA,GAAG,KAAK,CAAS,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;AAElE;;AAEG;QACM,IAAW,CAAA,WAAA,GAAG,KAAK,CAAS,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;AAExD;;AAEG;AACM,QAAA,IAAA,CAAA,iBAAiB,GAAG,KAAK,CAAS,SAAS,CAAC;AAErD;;AAEG;AACM,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAoC,SAAS,CAAC;AAE7E;;AAEG;QACM,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;AA2C7E;IAzCG,QAAQ,GAAA;AACJ,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE;AACtC,QAAA,IAAI,C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, CommonModule } from '@angular/common';
4
4
  import * as i0 from '@angular/core';
5
- import { InjectionToken, inject, ChangeDetectorRef, ElementRef, NgZone, Renderer2, EventEmitter, HostBinding, ViewChild, ChangeDetectionStrategy, Component, Injector, Injectable, Input, Output, ContentChild, NgModule } from '@angular/core';
5
+ import { InjectionToken, inject, ChangeDetectorRef, ElementRef, NgZone, Renderer2, EventEmitter, HostBinding, ViewChild, ChangeDetectionStrategy, Component, Injector, Injectable, input, contentChild, computed, Output, NgModule } from '@angular/core';
6
6
  import * as i1$1 from '@angular/forms';
7
7
  import { FormsModule } from '@angular/forms';
8
8
  import { ThyAction, ThyActionModule } from 'ngx-tethys/action';
@@ -439,19 +439,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
439
439
  class ThyDialogBody {
440
440
  constructor() {
441
441
  this.dialog = inject(ThyDialog);
442
- this._isDialogBody = true;
443
- this.thyClearPaddingClassName = false;
444
- }
445
- /**
446
- * 清除间距
447
- * @default false
448
- */
449
- set thyClearPadding(value) {
450
- this.thyClearPaddingClassName = value;
442
+ /**
443
+ * 清除间距
444
+ */
445
+ this.thyClearPadding = input(false, { transform: coerceBooleanProperty });
451
446
  }
452
447
  ngOnInit() { }
453
448
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDialogBody, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
454
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.8", type: ThyDialogBody, isStandalone: true, selector: "thy-dialog-body", inputs: { thyClearPadding: ["thyClearPadding", "thyClearPadding", coerceBooleanProperty] }, host: { properties: { "class.dialog-body": "this._isDialogBody", "class.dialog-body-clear-padding": "this.thyClearPaddingClassName" } }, exportAs: ["thyDialogBody"], hostDirectives: [{ directive: i1.CdkScrollable }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
449
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyDialogBody, isStandalone: true, selector: "thy-dialog-body", inputs: { thyClearPadding: { classPropertyName: "thyClearPadding", publicName: "thyClearPadding", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.dialog-body-clear-padding": "thyClearPadding()" }, classAttribute: "dialog-body" }, exportAs: ["thyDialogBody"], hostDirectives: [{ directive: i1.CdkScrollable }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
455
450
  }
456
451
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDialogBody, decorators: [{
457
452
  type: Component,
@@ -460,18 +455,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
460
455
  template: '<ng-content></ng-content>',
461
456
  // changeDetection: ChangeDetectionStrategy.OnPush,
462
457
  exportAs: 'thyDialogBody',
463
- hostDirectives: [CdkScrollable]
458
+ hostDirectives: [CdkScrollable],
459
+ host: {
460
+ class: 'dialog-body',
461
+ '[class.dialog-body-clear-padding]': 'thyClearPadding()'
462
+ }
464
463
  }]
465
- }], propDecorators: { _isDialogBody: [{
466
- type: HostBinding,
467
- args: [`class.dialog-body`]
468
- }], thyClearPaddingClassName: [{
469
- type: HostBinding,
470
- args: [`class.dialog-body-clear-padding`]
471
- }], thyClearPadding: [{
472
- type: Input,
473
- args: [{ transform: coerceBooleanProperty }]
474
- }] } });
464
+ }] });
475
465
 
476
466
  const THY_CONFIRM_DEFAULT_OPTIONS = new InjectionToken('thy-confirm-default-options');
477
467
  /**
@@ -511,19 +501,41 @@ class ThyDialogHeader {
511
501
  this.dialog = inject(ThyDialog);
512
502
  this.translate = inject(ThyTranslate);
513
503
  this.dialogContainer = inject(ThyDialogContainer, { optional: true });
504
+ /**
505
+ * 自定义头部模板
506
+ */
507
+ this.headerTemplate = contentChild('dialogHeader');
508
+ /**
509
+ * 标题
510
+ */
511
+ this.thyTitle = input();
512
+ /**
513
+ * 大小,只有大的详情页场景会使用 lg,左右 padding 缩小至 20px
514
+ * @type lg | md
515
+ */
516
+ this.thySize = input('md');
517
+ /**
518
+ * 是否显示分割线
519
+ */
520
+ this.thyDivided = input(false, { transform: coerceBooleanProperty });
521
+ /**
522
+ * 标题的多语言 Key
523
+ */
524
+ this.thyTitleTranslationKey = input();
525
+ this.title = computed(() => {
526
+ const title = this.thyTitle();
527
+ const titleTranslationKey = this.thyTitleTranslationKey();
528
+ return title || (titleTranslationKey && this.translate.instant(titleTranslationKey));
529
+ });
530
+ /**
531
+ * 头部图标
532
+ */
533
+ this.thyIcon = input();
514
534
  /**
515
535
  * 关闭事件
516
536
  */
517
537
  this.thyOnClose = new EventEmitter();
518
538
  }
519
- /**
520
- * 标题的多语言 Key
521
- */
522
- set thyTitleTranslationKey(key) {
523
- if (key && !this.thyTitle) {
524
- this.thyTitle = this.translate.instant(key);
525
- }
526
- }
527
539
  ngOnInit() {
528
540
  if (!this.dialogContainer) {
529
541
  // When this directive is included in a dialog via TemplateRef (rather than being
@@ -538,7 +550,7 @@ class ThyDialogHeader {
538
550
  // because sub component change parent's HostBinding property (ariaLabelledBy)
539
551
  Promise.resolve().then(() => {
540
552
  if (this.dialogContainer) {
541
- this.dialogContainer.ariaLabelledBy = this.thyTitle;
553
+ this.dialogContainer.ariaLabelledBy = this.title();
542
554
  }
543
555
  });
544
556
  }
@@ -551,30 +563,16 @@ class ThyDialogHeader {
551
563
  }
552
564
  }
553
565
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDialogHeader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
554
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyDialogHeader, isStandalone: true, selector: "thy-dialog-header", inputs: { thyTitle: "thyTitle", thySize: "thySize", thyDivided: ["thyDivided", "thyDivided", coerceBooleanProperty], thyTitleTranslationKey: "thyTitleTranslationKey", thyIcon: "thyIcon" }, outputs: { thyOnClose: "thyOnClose" }, host: { properties: { "class.thy-dialog-header-lg": "thySize === 'lg'", "class.thy-dialog-header-divided": "thyDivided" }, classAttribute: "dialog-header thy-dialog-header" }, queries: [{ propertyName: "headerTemplate", first: true, predicate: ["dialogHeader"], descendants: true }], exportAs: ["thyDialogHeader"], ngImport: i0, template: "@if (headerTemplate) {\n <template [ngTemplateOutlet]=\"headerTemplate\"></template>\n} @else {\n <h3 class=\"dialog-title\"><thy-icon [thyIconName]=\"thyIcon\"></thy-icon>{{ thyTitle }}</h3>\n <a href=\"javascript:;\" class=\"mr-n2\" thyAction thyActionIcon=\"close\" (click)=\"close($event)\"></a>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "component", type: ThyAction, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }] }); }
566
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyDialogHeader, isStandalone: true, selector: "thy-dialog-header", inputs: { thyTitle: { classPropertyName: "thyTitle", publicName: "thyTitle", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyDivided: { classPropertyName: "thyDivided", publicName: "thyDivided", isSignal: true, isRequired: false, transformFunction: null }, thyTitleTranslationKey: { classPropertyName: "thyTitleTranslationKey", publicName: "thyTitleTranslationKey", isSignal: true, isRequired: false, transformFunction: null }, thyIcon: { classPropertyName: "thyIcon", publicName: "thyIcon", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thyOnClose: "thyOnClose" }, host: { properties: { "class.thy-dialog-header-lg": "thySize() === 'lg'", "class.thy-dialog-header-divided": "thyDivided()" }, classAttribute: "dialog-header thy-dialog-header" }, queries: [{ propertyName: "headerTemplate", first: true, predicate: ["dialogHeader"], descendants: true, isSignal: true }], exportAs: ["thyDialogHeader"], ngImport: i0, template: "@if (headerTemplate()) {\n <template [ngTemplateOutlet]=\"headerTemplate()\"></template>\n} @else {\n <h3 class=\"dialog-title\"><thy-icon [thyIconName]=\"thyIcon()\"></thy-icon>{{ title() }}</h3>\n <a href=\"javascript:;\" class=\"mr-n2\" thyAction thyActionIcon=\"close\" (click)=\"close($event)\"></a>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "component", type: ThyAction, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }] }); }
555
567
  }
556
568
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDialogHeader, decorators: [{
557
569
  type: Component,
558
570
  args: [{ selector: 'thy-dialog-header', exportAs: 'thyDialogHeader', host: {
559
571
  class: 'dialog-header thy-dialog-header',
560
- '[class.thy-dialog-header-lg]': `thySize === 'lg'`,
561
- '[class.thy-dialog-header-divided]': `thyDivided`
562
- }, imports: [NgTemplateOutlet, ThyIcon, ThyAction], template: "@if (headerTemplate) {\n <template [ngTemplateOutlet]=\"headerTemplate\"></template>\n} @else {\n <h3 class=\"dialog-title\"><thy-icon [thyIconName]=\"thyIcon\"></thy-icon>{{ thyTitle }}</h3>\n <a href=\"javascript:;\" class=\"mr-n2\" thyAction thyActionIcon=\"close\" (click)=\"close($event)\"></a>\n}\n" }]
563
- }], propDecorators: { headerTemplate: [{
564
- type: ContentChild,
565
- args: ['dialogHeader']
566
- }], thyTitle: [{
567
- type: Input
568
- }], thySize: [{
569
- type: Input
570
- }], thyDivided: [{
571
- type: Input,
572
- args: [{ transform: coerceBooleanProperty }]
573
- }], thyTitleTranslationKey: [{
574
- type: Input
575
- }], thyIcon: [{
576
- type: Input
577
- }], thyOnClose: [{
572
+ '[class.thy-dialog-header-lg]': `thySize() === 'lg'`,
573
+ '[class.thy-dialog-header-divided]': `thyDivided()`
574
+ }, imports: [NgTemplateOutlet, ThyIcon, ThyAction], template: "@if (headerTemplate()) {\n <template [ngTemplateOutlet]=\"headerTemplate()\"></template>\n} @else {\n <h3 class=\"dialog-title\"><thy-icon [thyIconName]=\"thyIcon()\"></thy-icon>{{ title() }}</h3>\n <a href=\"javascript:;\" class=\"mr-n2\" thyAction thyActionIcon=\"close\" (click)=\"close($event)\"></a>\n}\n" }]
575
+ }], propDecorators: { thyOnClose: [{
578
576
  type: Output
579
577
  }] } });
580
578
 
@@ -587,6 +585,7 @@ class ThyConfirm {
587
585
  this.changeDetectorRef = inject(ChangeDetectorRef);
588
586
  this.defaultConfig = inject(THY_CONFIRM_DEFAULT_OPTIONS);
589
587
  this.locale = injectLocale('dialog');
588
+ this.options = input();
590
589
  this.defaultConfig = {
591
590
  ...{
592
591
  title: this.locale().title,
@@ -599,7 +598,7 @@ class ThyConfirm {
599
598
  };
600
599
  }
601
600
  ngOnInit() {
602
- this.defaultConfig = { ...this.defaultConfig, ...this.options };
601
+ this.defaultConfig = { ...this.defaultConfig, ...this.options() };
603
602
  this.title = this.defaultConfig.title;
604
603
  this.content = this.defaultConfig.content;
605
604
  this.okText = this.defaultConfig.okText;
@@ -610,7 +609,7 @@ class ThyConfirm {
610
609
  }
611
610
  confirm() {
612
611
  this.loading = true;
613
- const result = this.options.onOk();
612
+ const result = this.options().onOk();
614
613
  if (result && result.subscribe) {
615
614
  result
616
615
  .pipe(finalize(() => {
@@ -628,19 +627,17 @@ class ThyConfirm {
628
627
  }
629
628
  }
630
629
  close() {
631
- this.options?.onCancel?.();
630
+ this.options()?.onCancel?.();
632
631
  this.dialogRef.close();
633
632
  }
634
633
  ngOnDestroy() { }
635
634
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyConfirm, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
636
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThyConfirm, isStandalone: true, selector: "thy-confirm-default", inputs: { options: "options" }, ngImport: i0, template: "<thy-dialog-header [thyTitle]=\"title || 'Install Angular'\" (thyOnClose)=\"close()\"> </thy-dialog-header>\n<thy-dialog-body class=\"thy-form\">\n <form thyForm name=\"thyConfirm\" thyLayout=\"vertical\">\n <div class=\"form-group\">\n <p [innerHTML]=\"content\"></p>\n </div>\n <thy-form-group-footer [thyAlign]=\"footerAlign\">\n <div class=\"thy-confirm-footer\" [ngClass]=\"'thy-confirm-footer-' + footerAlign\">\n <button [thyButton]=\"okType\" (click)=\"confirm()\" [thyLoading]=\"loading\" [thyLoadingText]=\"okLoadingText\">{{ okText }}</button>\n <button thyButton=\"link-secondary\" (click)=\"close()\" class=\"thy-confirm-cancel\">{{ cancelText }}</button>\n </div>\n </thy-form-group-footer>\n </form>\n</thy-dialog-body>\n", dependencies: [{ kind: "component", type: ThyDialogHeader, selector: "thy-dialog-header", inputs: ["thyTitle", "thySize", "thyDivided", "thyTitleTranslationKey", "thyIcon"], outputs: ["thyOnClose"], exportAs: ["thyDialogHeader"] }, { kind: "component", type: ThyDialogBody, selector: "thy-dialog-body", inputs: ["thyClearPadding"], exportAs: ["thyDialogBody"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: ThyFormDirective, selector: "[thyForm],[thy-form]", inputs: ["thyLayout", "thyEnterKeyMode", "thyFormValidatorConfig"], exportAs: ["thyForm"] }, { kind: "component", type: ThyFormGroupFooter, selector: "thy-form-group-footer", inputs: ["thyAlign"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ThyButton, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thyBlock"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
635
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyConfirm, isStandalone: true, selector: "thy-confirm-default", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<thy-dialog-header [thyTitle]=\"title || 'Install Angular'\" (thyOnClose)=\"close()\"> </thy-dialog-header>\n<thy-dialog-body class=\"thy-form\">\n <form thyForm name=\"thyConfirm\" thyLayout=\"vertical\">\n <div class=\"form-group\">\n <p [innerHTML]=\"content\"></p>\n </div>\n <thy-form-group-footer [thyAlign]=\"footerAlign\">\n <div class=\"thy-confirm-footer\" [ngClass]=\"'thy-confirm-footer-' + footerAlign\">\n <button [thyButton]=\"okType\" (click)=\"confirm()\" [thyLoading]=\"loading\" [thyLoadingText]=\"okLoadingText\">{{ okText }}</button>\n <button thyButton=\"link-secondary\" (click)=\"close()\" class=\"thy-confirm-cancel\">{{ cancelText }}</button>\n </div>\n </thy-form-group-footer>\n </form>\n</thy-dialog-body>\n", dependencies: [{ kind: "component", type: ThyDialogHeader, selector: "thy-dialog-header", inputs: ["thyTitle", "thySize", "thyDivided", "thyTitleTranslationKey", "thyIcon"], outputs: ["thyOnClose"], exportAs: ["thyDialogHeader"] }, { kind: "component", type: ThyDialogBody, selector: "thy-dialog-body", inputs: ["thyClearPadding"], exportAs: ["thyDialogBody"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: ThyFormDirective, selector: "[thyForm],[thy-form]", inputs: ["thyLayout", "thyEnterKeyMode", "thyFormValidatorConfig"], exportAs: ["thyForm"] }, { kind: "component", type: ThyFormGroupFooter, selector: "thy-form-group-footer", inputs: ["thyAlign"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ThyButton, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thyBlock"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
637
636
  }
638
637
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyConfirm, decorators: [{
639
638
  type: Component,
640
639
  args: [{ selector: 'thy-confirm-default', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ThyDialogHeader, ThyDialogBody, FormsModule, ThyFormDirective, ThyFormGroupFooter, NgClass, ThyButton], template: "<thy-dialog-header [thyTitle]=\"title || 'Install Angular'\" (thyOnClose)=\"close()\"> </thy-dialog-header>\n<thy-dialog-body class=\"thy-form\">\n <form thyForm name=\"thyConfirm\" thyLayout=\"vertical\">\n <div class=\"form-group\">\n <p [innerHTML]=\"content\"></p>\n </div>\n <thy-form-group-footer [thyAlign]=\"footerAlign\">\n <div class=\"thy-confirm-footer\" [ngClass]=\"'thy-confirm-footer-' + footerAlign\">\n <button [thyButton]=\"okType\" (click)=\"confirm()\" [thyLoading]=\"loading\" [thyLoadingText]=\"okLoadingText\">{{ okText }}</button>\n <button thyButton=\"link-secondary\" (click)=\"close()\" class=\"thy-confirm-cancel\">{{ cancelText }}</button>\n </div>\n </thy-form-group-footer>\n </form>\n</thy-dialog-body>\n" }]
641
- }], ctorParameters: () => [], propDecorators: { options: [{
642
- type: Input
643
- }] } });
640
+ }], ctorParameters: () => [] });
644
641
 
645
642
  /**
646
643
  * 模态框底部组件
@@ -648,44 +645,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
648
645
  * @order 60
649
646
  */
650
647
  class ThyDialogFooter {
651
- /**
652
- * 底部是否有分割线,可全局配置默认值
653
- * @type boolean
654
- * @default false
655
- */
656
- set thyDivided(value) {
657
- this.divided = value;
658
- }
659
- get align() {
660
- return !!this.thyAlign ? this.thyAlign : this.dialogLayoutConfig.footerAlign;
661
- }
662
648
  constructor() {
663
649
  this.dialogLayoutConfig = inject(THY_DIALOG_LAYOUT_CONFIG);
650
+ /**
651
+ * 自定义弹出框底部的描述模板
652
+ * @type TemplateRef
653
+ */
654
+ this.description = contentChild('description');
655
+ /**
656
+ * 底部是否有分割线,可全局配置默认值
657
+ * @type boolean
658
+ */
659
+ this.thyDivided = input(undefined, { transform: coerceBooleanProperty });
660
+ this.divided = computed(() => {
661
+ if (this.thyDivided() === undefined) {
662
+ return this.dialogLayoutConfig.footerDivided;
663
+ }
664
+ return this.thyDivided();
665
+ });
666
+ /**
667
+ * 对齐方式,可全局配置默认值
668
+ * @type left | right | center
669
+ */
670
+ this.thyAlign = input();
671
+ this.align = computed(() => (!!this.thyAlign() ? this.thyAlign() : this.dialogLayoutConfig.footerAlign));
664
672
  this.hostRenderer = useHostRenderer();
665
- this.divided = this.dialogLayoutConfig.footerDivided;
666
673
  }
667
674
  ngOnInit() {
668
675
  this.hostRenderer.updateClassByMap({
669
676
  'dialog-footer': true,
670
- [`dialog-footer-actions-align-${this.align}`]: true,
671
- 'dialog-footer-border-top': this.divided
677
+ [`dialog-footer-actions-align-${this.align()}`]: true,
678
+ 'dialog-footer-border-top': this.divided()
672
679
  });
673
680
  }
674
681
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDialogFooter, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
675
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyDialogFooter, isStandalone: true, selector: "thy-dialog-footer", inputs: { thyDivided: ["thyDivided", "thyDivided", coerceBooleanProperty], thyAlign: "thyAlign" }, queries: [{ propertyName: "description", first: true, predicate: ["description"], descendants: true }], exportAs: ["thyDialogFooter"], ngImport: i0, template: "<div class=\"dialog-footer-actions btn-pair\">\n <ng-content></ng-content>\n</div>\n@if (description) {\n <div class=\"dialog-footer-description\">\n <ng-container [ngTemplateOutlet]=\"description\"></ng-container>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
682
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyDialogFooter, isStandalone: true, selector: "thy-dialog-footer", inputs: { thyDivided: { classPropertyName: "thyDivided", publicName: "thyDivided", isSignal: true, isRequired: false, transformFunction: null }, thyAlign: { classPropertyName: "thyAlign", publicName: "thyAlign", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "description", first: true, predicate: ["description"], descendants: true, isSignal: true }], exportAs: ["thyDialogFooter"], ngImport: i0, template: "<div class=\"dialog-footer-actions btn-pair\">\n <ng-content></ng-content>\n</div>\n@if (description()) {\n <div class=\"dialog-footer-description\">\n <ng-container [ngTemplateOutlet]=\"description()\"></ng-container>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
676
683
  }
677
684
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDialogFooter, decorators: [{
678
685
  type: Component,
679
- args: [{ selector: 'thy-dialog-footer', exportAs: 'thyDialogFooter', imports: [NgTemplateOutlet], template: "<div class=\"dialog-footer-actions btn-pair\">\n <ng-content></ng-content>\n</div>\n@if (description) {\n <div class=\"dialog-footer-description\">\n <ng-container [ngTemplateOutlet]=\"description\"></ng-container>\n </div>\n}\n" }]
680
- }], ctorParameters: () => [], propDecorators: { description: [{
681
- type: ContentChild,
682
- args: ['description']
683
- }], thyDivided: [{
684
- type: Input,
685
- args: [{ transform: coerceBooleanProperty }]
686
- }], thyAlign: [{
687
- type: Input
688
- }] } });
686
+ args: [{ selector: 'thy-dialog-footer', exportAs: 'thyDialogFooter', imports: [NgTemplateOutlet], template: "<div class=\"dialog-footer-actions btn-pair\">\n <ng-content></ng-content>\n</div>\n@if (description()) {\n <div class=\"dialog-footer-description\">\n <ng-container [ngTemplateOutlet]=\"description()\"></ng-container>\n </div>\n}\n" }]
687
+ }], ctorParameters: () => [] });
689
688
 
690
689
  class ThyDialogModule {
691
690
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }