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,6 +1,6 @@
1
1
  import { NgClass, CommonModule } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { HostBinding, Input, ViewEncapsulation, Component, ChangeDetectionStrategy, inject, ElementRef, Renderer2, NgModule } from '@angular/core';
3
+ import { input, effect, ViewEncapsulation, Component, computed, ChangeDetectionStrategy, inject, ElementRef, Renderer2, afterNextRender, NgModule } from '@angular/core';
4
4
  import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
5
5
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
6
6
  import { useHostRenderer } from '@tethys/cdk/dom';
@@ -18,78 +18,56 @@ const buttonGroupSizeMap = {
18
18
  * @order 30
19
19
  */
20
20
  class ThyButtonGroup {
21
- /**
22
- * 大小
23
- * @type xs | sm | md | lg
24
- * @default md
25
- */
26
- set thySize(size) {
27
- this.size = size;
28
- if (this.initialized) {
29
- this.setClasses();
30
- }
31
- }
32
- /**
33
- * 类型
34
- * @type outline-default | outline-primary
35
- * @default outline-default
36
- */
37
- set thyType(type) {
38
- this.type = type;
39
- if (this.initialized) {
40
- this.setClasses();
41
- }
42
- }
43
- /**
44
- * 是否需要最小宽度,默认按钮最小宽度为80px
45
- * @default false
46
- */
47
- set thyClearMinWidth(value) {
48
- this.thyClearMinWidthClassName = coerceBooleanProperty(value);
49
- }
50
21
  constructor() {
51
- this.initialized = false;
52
22
  this.hostRenderer = useHostRenderer();
53
- this._isButtonGroup = true;
54
- this.thyClearMinWidthClassName = false;
55
- }
56
- ngOnInit() {
57
- this.setClasses();
58
- this.initialized = true;
23
+ /**
24
+ * 大小
25
+ * @type xs | sm | md | lg
26
+ * @default md
27
+ */
28
+ this.thySize = input();
29
+ /**
30
+ * 类型
31
+ * @type outline-default | outline-primary
32
+ * @default outline-default
33
+ */
34
+ this.thyType = input();
35
+ /**
36
+ * 是否需要最小宽度,默认按钮最小宽度为80px
37
+ * @default false
38
+ */
39
+ this.thyClearMinWidth = input(false, { transform: coerceBooleanProperty });
40
+ effect(() => {
41
+ this.setClasses();
42
+ });
59
43
  }
60
44
  setClasses() {
45
+ const type = this.thyType();
46
+ const size = this.thySize();
61
47
  let classNames = [];
62
- if (this.type) {
63
- classNames.push(`btn-group-${this.type}`);
48
+ if (type) {
49
+ classNames.push(`btn-group-${type}`);
64
50
  }
65
- if (buttonGroupSizeMap[this.size]) {
66
- classNames.push(buttonGroupSizeMap[this.size]);
51
+ if (buttonGroupSizeMap[size]) {
52
+ classNames = classNames.concat(...buttonGroupSizeMap[size]);
67
53
  }
68
54
  this.hostRenderer.updateClass(classNames);
69
55
  }
70
56
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyButtonGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
71
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThyButtonGroup, isStandalone: true, selector: "thy-button-group", inputs: { thySize: "thySize", thyType: "thyType", thyClearMinWidth: "thyClearMinWidth" }, host: { properties: { "class.btn-group": "this._isButtonGroup", "class.btn-group-clear-min-width": "this.thyClearMinWidthClassName" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
57
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyButtonGroup, isStandalone: true, selector: "thy-button-group", inputs: { thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyType: { classPropertyName: "thyType", publicName: "thyType", isSignal: true, isRequired: false, transformFunction: null }, thyClearMinWidth: { classPropertyName: "thyClearMinWidth", publicName: "thyClearMinWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.btn-group-clear-min-width": "thyClearMinWidth()" }, classAttribute: "btn-group" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
72
58
  }
73
59
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyButtonGroup, decorators: [{
74
60
  type: Component,
75
61
  args: [{
76
62
  selector: 'thy-button-group',
77
63
  template: '<ng-content></ng-content>',
64
+ host: {
65
+ class: 'btn-group',
66
+ '[class.btn-group-clear-min-width]': 'thyClearMinWidth()'
67
+ },
78
68
  encapsulation: ViewEncapsulation.None
79
69
  }]
80
- }], ctorParameters: () => [], propDecorators: { thySize: [{
81
- type: Input
82
- }], thyType: [{
83
- type: Input
84
- }], thyClearMinWidth: [{
85
- type: Input
86
- }], _isButtonGroup: [{
87
- type: HostBinding,
88
- args: ['class.btn-group']
89
- }], thyClearMinWidthClassName: [{
90
- type: HostBinding,
91
- args: [`class.btn-group-clear-min-width`]
92
- }] } });
70
+ }], ctorParameters: () => [] });
93
71
 
94
72
  const sizeClassesMap = {
95
73
  lg: ['btn-icon-lg'],
@@ -113,143 +91,97 @@ const themeClassesMap = {
113
91
  * @order 20
114
92
  */
115
93
  class ThyButtonIcon {
116
- /**
117
- * 大小
118
- * @type xs | sm | md | lg
119
- * @default 36px
120
- */
121
- set thySize(size) {
122
- this.size = size;
123
- this.setClasses();
124
- }
125
- /**
126
- * 图标, 和`thyButtonIcon`相同,当使用`thy-button-icon`时,只能使用 thyIcon 设置图标
127
- */
128
- set thyIcon(icon) {
129
- this.setIconClass(icon);
130
- }
131
- /**
132
- * 图标按钮的图标
133
- */
134
- set thyButtonIcon(icon) {
135
- this.setIconClass(icon);
136
- }
137
- /**
138
- * 展示的形状,默认只显示字体图标图标,circle-dashed, circle-solid 展示成虚线,实线边框圆形图标, circle-thick-dashed, circle-thick-solid 边框加粗
139
- */
140
- set thyShape(value) {
141
- this.shape = value;
142
- this.setClasses();
143
- }
144
- /**
145
- * 亮色,颜色更浅,适合左侧导航顶部的按钮
146
- * @default false
147
- */
148
- set thyLight(value) {
149
- this._isLighted = value;
150
- }
151
- /**
152
- * 设置为选中状态
153
- * @default false
154
- */
155
- set thyActive(value) {
156
- this._isActive = value;
157
- }
158
- /**
159
- * 按钮展示类型,默认图标移上去显示主色, danger-weak 鼠标移上去显示 danger 红色
160
- */
161
- set thyTheme(value) {
162
- this.theme = value;
163
- this.setClasses();
164
- }
165
94
  constructor() {
166
- this.initialized = false;
95
+ /**
96
+ * 大小
97
+ * @type xs | sm | md | lg
98
+ * @default 36px
99
+ */
100
+ this.thySize = input();
101
+ /**
102
+ * 图标, 和`thyButtonIcon`相同,当使用`thy-button-icon`时,只能使用 thyIcon 设置图标
103
+ */
104
+ this.thyIcon = input();
105
+ /**
106
+ * 图标按钮的图标
107
+ */
108
+ this.thyButtonIcon = input();
109
+ /**
110
+ * 展示的形状,默认只显示字体图标图标,circle-dashed, circle-solid 展示成虚线,实线边框圆形图标, circle-thick-dashed, circle-thick-solid 边框加粗
111
+ */
112
+ this.thyShape = input();
113
+ /**
114
+ * 亮色,颜色更浅,适合左侧导航顶部的按钮
115
+ * @default false
116
+ */
117
+ this.thyLight = input(false, { transform: coerceBooleanProperty$1 });
118
+ /**
119
+ * 设置为选中状态
120
+ * @default false
121
+ */
122
+ this.thyActive = input(false, { transform: coerceBooleanProperty$1 });
123
+ /**
124
+ * 按钮展示类型,默认图标移上去显示主色, danger-weak 鼠标移上去显示 danger 红色
125
+ */
126
+ this.thyTheme = input();
127
+ this.thyColor = input();
167
128
  this.hostRenderer = useHostRenderer();
168
- this.iconPrefix = 'wtf';
169
- this._isBtn = true;
170
- this._isBtnIcon = true;
171
- this._isLighted = false;
172
- this._isActive = false;
173
- }
174
- setIconClass(icon) {
175
- if (icon) {
176
- if (icon.includes('wtf')) {
129
+ this.icon = computed(() => {
130
+ return this.thyButtonIcon() || this.thyIcon();
131
+ });
132
+ this.isWtfIcon = computed(() => {
133
+ const icon = this.icon();
134
+ return icon && icon.includes('wtf');
135
+ });
136
+ this.svgIconName = computed(() => {
137
+ if (!this.isWtfIcon()) {
138
+ return this.icon();
139
+ }
140
+ return null;
141
+ });
142
+ this.iconClasses = computed(() => {
143
+ const icon = this.icon();
144
+ if (this.isWtfIcon()) {
177
145
  const classes = icon.split(' ');
178
146
  if (classes.length === 1) {
179
147
  classes.unshift('wtf');
180
148
  }
181
- this.iconClasses = classes;
182
- this.svgIconName = null;
183
- }
184
- else {
185
- this.svgIconName = icon;
149
+ return classes;
186
150
  }
187
- }
188
- else {
189
- this.iconClasses = null;
190
- this.svgIconName = null;
191
- }
151
+ return null;
152
+ });
153
+ effect(() => {
154
+ this.setClasses();
155
+ });
192
156
  }
193
- setClasses(first = false) {
194
- // 设置样式判断是否已经初始化,未初始化直接返回,除非是初次调用
195
- // 只有 ngOnInit 调用会传入 first = true
196
- if (!first && !this.initialized) {
197
- return;
198
- }
199
- const classes = sizeClassesMap[this.size] ? [...sizeClassesMap[this.size]] : [];
200
- if (this.shape && shapeClassesMap[this.shape]) {
201
- shapeClassesMap[this.shape].forEach((className) => {
157
+ setClasses() {
158
+ const size = this.thySize();
159
+ const shape = this.thyShape();
160
+ const theme = this.thyTheme();
161
+ const classes = sizeClassesMap[size] ? [...sizeClassesMap[size]] : [];
162
+ if (shape && shapeClassesMap[shape]) {
163
+ shapeClassesMap[shape].forEach((className) => {
202
164
  classes.push(className);
203
165
  });
204
166
  }
205
- if (this.theme && themeClassesMap[this.theme]) {
206
- themeClassesMap[this.theme].forEach((className) => {
167
+ if (theme && themeClassesMap[theme]) {
168
+ themeClassesMap[theme].forEach((className) => {
207
169
  classes.push(className);
208
170
  });
209
171
  }
210
172
  this.hostRenderer.updateClass(classes);
211
173
  }
212
- ngOnInit() {
213
- this.setClasses(true);
214
- this.initialized = true;
215
- }
216
174
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyButtonIcon, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
217
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyButtonIcon, isStandalone: true, selector: "thy-button-icon,[thy-button-icon],[thyButtonIcon]", inputs: { thySize: "thySize", thyIcon: "thyIcon", thyButtonIcon: "thyButtonIcon", thyShape: "thyShape", thyLight: ["thyLight", "thyLight", coerceBooleanProperty$1], thyActive: ["thyActive", "thyActive", coerceBooleanProperty$1], thyTheme: "thyTheme", thyColor: "thyColor" }, host: { properties: { "class.btn": "this._isBtn", "class.btn-icon": "this._isBtnIcon", "class.btn-icon-light": "this._isLighted", "class.btn-icon-active": "this._isActive" } }, ngImport: i0, template: "@if (svgIconName) {\n <thy-icon [thyIconName]=\"svgIconName\" [style.color]=\"thyColor\" [style.borderColor]=\"thyColor\"></thy-icon>\n} @else {\n @if (iconClasses) {\n <i [ngClass]=\"iconClasses\" [style.color]=\"thyColor\" [style.borderColor]=\"thyColor\"></i>\n }\n}\n<ng-content></ng-content>\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
175
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyButtonIcon, isStandalone: true, selector: "thy-button-icon,[thy-button-icon],[thyButtonIcon]", inputs: { thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyIcon: { classPropertyName: "thyIcon", publicName: "thyIcon", isSignal: true, isRequired: false, transformFunction: null }, thyButtonIcon: { classPropertyName: "thyButtonIcon", publicName: "thyButtonIcon", isSignal: true, isRequired: false, transformFunction: null }, thyShape: { classPropertyName: "thyShape", publicName: "thyShape", isSignal: true, isRequired: false, transformFunction: null }, thyLight: { classPropertyName: "thyLight", publicName: "thyLight", isSignal: true, isRequired: false, transformFunction: null }, thyActive: { classPropertyName: "thyActive", publicName: "thyActive", isSignal: true, isRequired: false, transformFunction: null }, thyTheme: { classPropertyName: "thyTheme", publicName: "thyTheme", isSignal: true, isRequired: false, transformFunction: null }, thyColor: { classPropertyName: "thyColor", publicName: "thyColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.btn-icon-light": "thyLight()", "class.btn-icon-active": "thyActive()" }, classAttribute: "btn btn-icon" }, ngImport: i0, template: "@if (svgIconName()) {\n <thy-icon [thyIconName]=\"svgIconName()\" [style.color]=\"thyColor()\" [style.borderColor]=\"thyColor()\"></thy-icon>\n} @else {\n @if (iconClasses()) {\n <i [ngClass]=\"iconClasses()\" [style.color]=\"thyColor()\" [style.borderColor]=\"thyColor()\"></i>\n }\n}\n<ng-content></ng-content>\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
218
176
  }
219
177
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyButtonIcon, decorators: [{
220
178
  type: Component,
221
- args: [{ selector: 'thy-button-icon,[thy-button-icon],[thyButtonIcon]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [ThyIcon, NgClass], template: "@if (svgIconName) {\n <thy-icon [thyIconName]=\"svgIconName\" [style.color]=\"thyColor\" [style.borderColor]=\"thyColor\"></thy-icon>\n} @else {\n @if (iconClasses) {\n <i [ngClass]=\"iconClasses\" [style.color]=\"thyColor\" [style.borderColor]=\"thyColor\"></i>\n }\n}\n<ng-content></ng-content>\n" }]
222
- }], ctorParameters: () => [], propDecorators: { thySize: [{
223
- type: Input
224
- }], thyIcon: [{
225
- type: Input
226
- }], thyButtonIcon: [{
227
- type: Input
228
- }], thyShape: [{
229
- type: Input
230
- }], thyLight: [{
231
- type: Input,
232
- args: [{ transform: coerceBooleanProperty$1 }]
233
- }], thyActive: [{
234
- type: Input,
235
- args: [{ transform: coerceBooleanProperty$1 }]
236
- }], thyTheme: [{
237
- type: Input
238
- }], _isBtn: [{
239
- type: HostBinding,
240
- args: ['class.btn']
241
- }], _isBtnIcon: [{
242
- type: HostBinding,
243
- args: ['class.btn-icon']
244
- }], _isLighted: [{
245
- type: HostBinding,
246
- args: ['class.btn-icon-light']
247
- }], _isActive: [{
248
- type: HostBinding,
249
- args: ['class.btn-icon-active']
250
- }], thyColor: [{
251
- type: Input
252
- }] } });
179
+ args: [{ selector: 'thy-button-icon,[thy-button-icon],[thyButtonIcon]', encapsulation: ViewEncapsulation.None, host: {
180
+ class: 'btn btn-icon',
181
+ '[class.btn-icon-light]': 'thyLight()',
182
+ '[class.btn-icon-active]': 'thyActive()'
183
+ }, changeDetection: ChangeDetectionStrategy.OnPush, imports: [ThyIcon, NgClass], template: "@if (svgIconName()) {\n <thy-icon [thyIconName]=\"svgIconName()\" [style.color]=\"thyColor()\" [style.borderColor]=\"thyColor()\"></thy-icon>\n} @else {\n @if (iconClasses()) {\n <i [ngClass]=\"iconClasses()\" [style.color]=\"thyColor()\" [style.borderColor]=\"thyColor()\"></i>\n }\n}\n<ng-content></ng-content>\n" }]
184
+ }], ctorParameters: () => [] });
253
185
 
254
186
  const btnTypeClassesMap = {
255
187
  primary: ['btn-primary'],
@@ -273,153 +205,142 @@ const iconOnlyClass = 'thy-btn-icon-only';
273
205
  * @order 10
274
206
  */
275
207
  class ThyButton {
276
- constructor() {
277
- this.elementRef = inject(ElementRef);
278
- this.renderer = inject(Renderer2);
279
- this._initialized = false;
280
- // 圆角方形
281
- this._isRadiusSquare = false;
282
- this.hostRenderer = useHostRenderer();
283
- }
284
208
  get nativeElement() {
285
209
  return this.elementRef.nativeElement;
286
210
  }
287
- /**
288
- * 按钮类型,支持添加前缀`outline-`实现线框按钮,支持添加前缀`link-`实现按钮链接
289
- * @type primary | info | warning | danger | success
290
- * @default primary
291
- */
292
- set thyButton(value) {
293
- this.setBtnType(value);
294
- }
295
- /**
296
- * 和`thyButton`参数一样,一般使用`thyButton`,为了减少参数输入, 当通过`thy-button`使用时,只能使用该参数控制类型
297
- * @default primary
298
- */
299
- set thyType(value) {
300
- this.setBtnType(value);
301
- }
302
- /**
303
- * 加载状态
304
- * @default false
305
- */
306
- set thyLoading(value) {
307
- if (!this._loading && value) {
308
- this._loading = value;
309
- const textElement = this.nativeElement.querySelector('span');
310
- this._originalText = textElement ? textElement.innerText : '';
311
- this.setLoadingStatus();
312
- }
313
- else {
314
- this._loading = value;
315
- this.setLoadingStatus();
316
- }
317
- }
318
- /**
319
- * 加载状态时显示的文案
320
- */
321
- set thyLoadingText(value) {
322
- if (this._loadingText !== value) {
323
- this._loadingText = value;
324
- if (this._loading) {
325
- this.setLoadingText(this._loadingText);
326
- }
327
- }
328
- }
329
- /**
330
- * 按钮大小
331
- * @type xs | sm | md | default | lg
332
- * @default default
333
- */
334
- set thySize(size) {
335
- this._size = size;
336
- if (this._initialized) {
337
- this.updateClasses();
338
- }
339
- }
340
- /**
341
- * 按钮中显示的图标,支持SVG图标名称,比如`angle-left`,也支持传之前的 wtf 字体,比如: wtf-plus
342
- */
343
- set thyIcon(icon) {
344
- this._icon = icon;
345
- if (this._icon) {
346
- if (icon.includes('wtf')) {
347
- const classes = this._icon.split(' ');
348
- if (classes.length === 1) {
349
- classes.unshift('wtf');
350
- }
351
- this.iconClass = classes;
352
- this.svgIconName = null;
353
- }
354
- else {
355
- this.svgIconName = icon;
356
- }
357
- }
358
- else {
359
- this.iconClass = null;
360
- this.svgIconName = null;
361
- }
362
- }
363
- setBtnType(value) {
364
- if (value) {
365
- if (value.includes('-square')) {
366
- this._type = value.replace('-square', '');
367
- this._isRadiusSquare = true;
368
- }
369
- else {
370
- this._type = value;
371
- }
372
- if (this._initialized) {
373
- this.updateClasses();
374
- }
375
- }
376
- }
377
- setLoadingText(text) {
211
+ setButtonText() {
212
+ const text = this.thyLoading() ? this.thyLoadingText() : this._originalText;
378
213
  const spanElement = this.nativeElement.querySelector('span');
379
- if (spanElement) {
214
+ if (spanElement && text) {
380
215
  this.renderer.setProperty(spanElement, 'innerText', text);
381
216
  }
382
217
  }
383
- setLoadingStatus() {
384
- const innerText = this._loading ? this._loadingText : this._originalText;
385
- this.updateClasses();
386
- if (innerText) {
387
- this.setLoadingText(innerText);
388
- }
389
- }
390
218
  updateClasses() {
219
+ const type = this.type();
220
+ if (!type) {
221
+ return;
222
+ }
391
223
  let classNames = [];
392
- if (btnTypeClassesMap[this._type]) {
393
- classNames = [...btnTypeClassesMap[this._type]];
224
+ if (btnTypeClassesMap[type]) {
225
+ classNames = [...btnTypeClassesMap[type]];
394
226
  }
395
227
  else {
396
- if (this._type) {
397
- classNames.push(`btn-${this._type}`);
228
+ if (type) {
229
+ classNames.push(`btn-${type}`);
398
230
  }
399
231
  }
400
- if (this._size) {
401
- classNames.push(`btn-${this._size}`);
232
+ const size = this.thySize();
233
+ if (size) {
234
+ classNames.push(`btn-${size}`);
402
235
  }
403
- if (this._isRadiusSquare) {
236
+ if (this.isRadiusSquare()) {
404
237
  classNames.push('btn-square');
405
238
  }
406
- if (this._loading) {
239
+ const loading = this.thyLoading();
240
+ if (loading) {
407
241
  classNames.push('loading');
408
242
  }
409
243
  this.hostRenderer.updateClass(classNames);
410
244
  }
411
- ngOnInit() {
412
- this.updateClasses();
413
- this._initialized = true;
414
- }
415
- ngAfterViewInit() {
416
- if (assertIconOnly(this.nativeElement)) {
417
- this.hostRenderer.addClass(iconOnlyClass);
418
- }
419
- else {
420
- this.hostRenderer.removeClass(iconOnlyClass);
421
- }
422
- this.wrapSpanForText(this.nativeElement.childNodes);
245
+ constructor() {
246
+ this.elementRef = inject(ElementRef);
247
+ this.renderer = inject(Renderer2);
248
+ this.hostRenderer = useHostRenderer();
249
+ /**
250
+ * 按钮类型,支持添加前缀`outline-`实现线框按钮,支持添加前缀`link-`实现按钮链接
251
+ * @type primary | info | warning | danger | success
252
+ * @default primary
253
+ */
254
+ this.thyButton = input();
255
+ /**
256
+ * 和`thyButton`参数一样,一般使用`thyButton`,为了减少参数输入, 当通过`thy-button`使用时,只能使用该参数控制类型
257
+ * @default primary
258
+ */
259
+ this.thyType = input();
260
+ /**
261
+ * 加载状态
262
+ * @default false
263
+ */
264
+ this.thyLoading = input(false, {
265
+ transform: value => {
266
+ if (!this.thyLoading() && value) {
267
+ const textElement = this.nativeElement?.querySelector('span');
268
+ this._originalText = textElement ? textElement.innerText : '';
269
+ }
270
+ return coerceBooleanProperty$1(value);
271
+ }
272
+ });
273
+ /**
274
+ * 加载状态时显示的文案
275
+ */
276
+ this.thyLoadingText = input();
277
+ /**
278
+ * 按钮大小
279
+ * @type xs | sm | md | default | lg
280
+ * @default default
281
+ */
282
+ this.thySize = input();
283
+ /**
284
+ * 按钮中显示的图标,支持SVG图标名称,比如`angle-left`,也支持传之前的 wtf 字体,比如: wtf-plus
285
+ */
286
+ this.thyIcon = input();
287
+ /**
288
+ * 按钮整块展示
289
+ * @default false
290
+ */
291
+ this.thyBlock = input(false, { transform: coerceBooleanProperty$1 });
292
+ this.isWtfIcon = computed(() => {
293
+ const icon = this.thyIcon();
294
+ return icon && icon.includes('wtf');
295
+ });
296
+ this.svgIconName = computed(() => {
297
+ if (!this.isWtfIcon()) {
298
+ return this.thyIcon();
299
+ }
300
+ return null;
301
+ });
302
+ this.iconClass = computed(() => {
303
+ const icon = this.thyIcon();
304
+ if (this.isWtfIcon()) {
305
+ const classes = icon.split(' ');
306
+ if (classes.length === 1) {
307
+ classes.unshift('wtf');
308
+ }
309
+ return classes;
310
+ }
311
+ return null;
312
+ });
313
+ this.buttonType = computed(() => {
314
+ return this.thyButton() || this.thyType();
315
+ });
316
+ this.isRadiusSquare = computed(() => {
317
+ const type = this.buttonType();
318
+ return !!type?.includes('-square');
319
+ });
320
+ this.type = computed(() => {
321
+ const type = this.buttonType();
322
+ if (this.isRadiusSquare()) {
323
+ return type.replace('-square', '');
324
+ }
325
+ else {
326
+ return type;
327
+ }
328
+ });
329
+ effect(() => {
330
+ this.updateClasses();
331
+ });
332
+ effect(() => {
333
+ this.setButtonText();
334
+ });
335
+ afterNextRender(() => {
336
+ if (assertIconOnly(this.nativeElement)) {
337
+ this.hostRenderer.addClass(iconOnlyClass);
338
+ }
339
+ else {
340
+ this.hostRenderer.removeClass(iconOnlyClass);
341
+ }
342
+ this.wrapSpanForText(this.nativeElement.childNodes);
343
+ });
423
344
  }
424
345
  wrapSpanForText(nodes) {
425
346
  nodes.forEach(node => {
@@ -433,33 +354,15 @@ class ThyButton {
433
354
  });
434
355
  }
435
356
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
436
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyButton, isStandalone: true, selector: "thy-button,[thy-button],[thyButton]", inputs: { thyButton: "thyButton", thyType: "thyType", thyLoading: ["thyLoading", "thyLoading", coerceBooleanProperty$1], thyLoadingText: "thyLoadingText", thySize: "thySize", thyIcon: "thyIcon", thyBlock: ["thyBlock", "thyBlock", coerceBooleanProperty$1] }, host: { properties: { "class.btn-block": "this.thyBlock" }, classAttribute: "thy-btn btn" }, ngImport: i0, template: "@if (svgIconName) {\n <thy-icon [thyIconName]=\"svgIconName\"></thy-icon>\n} @else {\n @if (iconClass) {\n <i [ngClass]=\"iconClass\"></i>\n }\n}\n<ng-content></ng-content>\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
357
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyButton, isStandalone: true, selector: "thy-button,[thy-button],[thyButton]", inputs: { thyButton: { classPropertyName: "thyButton", publicName: "thyButton", isSignal: true, isRequired: false, transformFunction: null }, thyType: { classPropertyName: "thyType", publicName: "thyType", isSignal: true, isRequired: false, transformFunction: null }, thyLoading: { classPropertyName: "thyLoading", publicName: "thyLoading", isSignal: true, isRequired: false, transformFunction: null }, thyLoadingText: { classPropertyName: "thyLoadingText", publicName: "thyLoadingText", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyIcon: { classPropertyName: "thyIcon", publicName: "thyIcon", isSignal: true, isRequired: false, transformFunction: null }, thyBlock: { classPropertyName: "thyBlock", publicName: "thyBlock", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.btn-block": "thyBlock()" }, classAttribute: "thy-btn btn" }, ngImport: i0, template: "@if (svgIconName()) {\n <thy-icon [thyIconName]=\"svgIconName()\"></thy-icon>\n} @else {\n @if (iconClass()) {\n <i [ngClass]=\"iconClass()\"></i>\n }\n}\n<ng-content></ng-content>\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
437
358
  }
438
359
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyButton, decorators: [{
439
360
  type: Component,
440
361
  args: [{ selector: 'thy-button,[thy-button],[thyButton]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
441
- class: 'thy-btn btn'
442
- }, imports: [ThyIcon, NgClass], template: "@if (svgIconName) {\n <thy-icon [thyIconName]=\"svgIconName\"></thy-icon>\n} @else {\n @if (iconClass) {\n <i [ngClass]=\"iconClass\"></i>\n }\n}\n<ng-content></ng-content>\n" }]
443
- }], propDecorators: { thyButton: [{
444
- type: Input
445
- }], thyType: [{
446
- type: Input
447
- }], thyLoading: [{
448
- type: Input,
449
- args: [{ transform: coerceBooleanProperty$1 }]
450
- }], thyLoadingText: [{
451
- type: Input
452
- }], thySize: [{
453
- type: Input
454
- }], thyIcon: [{
455
- type: Input
456
- }], thyBlock: [{
457
- type: HostBinding,
458
- args: [`class.btn-block`]
459
- }, {
460
- type: Input,
461
- args: [{ transform: coerceBooleanProperty$1 }]
462
- }] } });
362
+ class: 'thy-btn btn',
363
+ '[class.btn-block]': 'thyBlock()'
364
+ }, imports: [ThyIcon, NgClass], template: "@if (svgIconName()) {\n <thy-icon [thyIconName]=\"svgIconName()\"></thy-icon>\n} @else {\n @if (iconClass()) {\n <i [ngClass]=\"iconClass()\"></i>\n }\n}\n<ng-content></ng-content>\n" }]
365
+ }], ctorParameters: () => [] });
463
366
 
464
367
  class ThyButtonModule {
465
368
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }