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,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Input, Directive, inject, InjectionToken, ElementRef, DestroyRef, ChangeDetectionStrategy, Component, NgZone, ContentChildren, NgModule } from '@angular/core';
2
+ import { input, effect, Directive, inject, computed, afterNextRender, InjectionToken, ElementRef, DestroyRef, ChangeDetectionStrategy, Component, NgZone, contentChildren, NgModule } from '@angular/core';
3
3
  import { ReplaySubject, Subject, Observable } from 'rxjs';
4
- import { isString, hasLaterChange } from 'ngx-tethys/util';
4
+ import { isString } from 'ngx-tethys/util';
5
5
  import { useHostRenderer } from '@tethys/cdk/dom';
6
6
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
7
  import { ViewportRuler } from '@angular/cdk/scrolling';
@@ -15,16 +15,16 @@ import { isUndefinedOrNull } from '@tethys/cdk/is';
15
15
  */
16
16
  class ThyRowDirective {
17
17
  constructor() {
18
+ /**
19
+ * 栅格的间距
20
+ */
21
+ this.thyGutter = input();
18
22
  this.actualGutter$ = new ReplaySubject(1);
19
23
  this.hostRenderer = useHostRenderer();
24
+ effect(() => {
25
+ this.setGutterStyle();
26
+ });
20
27
  }
21
- ngOnInit() {
22
- this.setGutterStyle();
23
- }
24
- ngOnChanges() {
25
- this.setGutterStyle();
26
- }
27
- ngAfterViewInit() { }
28
28
  setGutterStyle() {
29
29
  const [horizontalGutter, verticalGutter] = this.getGutter();
30
30
  this.actualGutter$.next([horizontalGutter, verticalGutter]);
@@ -41,13 +41,14 @@ class ThyRowDirective {
41
41
  }
42
42
  }
43
43
  getGutter() {
44
- if (isString(this.thyGutter)) {
44
+ const thyGutter = this.thyGutter();
45
+ if (isString(thyGutter)) {
45
46
  throw Error(`thyGutter value can not be string type`);
46
47
  }
47
- return [this.thyGutter, 0];
48
+ return [thyGutter, 0];
48
49
  }
49
50
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyRowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
50
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: ThyRowDirective, isStandalone: true, selector: "[thyRow]", inputs: { thyGutter: "thyGutter" }, host: { classAttribute: "thy-row" }, usesOnChanges: true, ngImport: i0 }); }
51
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyRowDirective, isStandalone: true, selector: "[thyRow]", inputs: { thyGutter: { classPropertyName: "thyGutter", publicName: "thyGutter", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "thy-row" }, ngImport: i0 }); }
51
52
  }
52
53
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyRowDirective, decorators: [{
53
54
  type: Directive,
@@ -57,9 +58,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
57
58
  class: 'thy-row'
58
59
  }
59
60
  }]
60
- }], ctorParameters: () => [], propDecorators: { thyGutter: [{
61
- type: Input
62
- }] } });
61
+ }], ctorParameters: () => [] });
63
62
 
64
63
  /**
65
64
  * 栅格列指令
@@ -69,43 +68,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
69
68
  class ThyColDirective {
70
69
  constructor() {
71
70
  this.thyRowDirective = inject(ThyRowDirective, { optional: true, host: true });
71
+ /**
72
+ * 栅格项的占位列数,thySpan 如果传递了值,以 thySpan 为准
73
+ */
74
+ this.thyCol = input();
75
+ /**
76
+ * 栅格项的占位列数
77
+ */
78
+ this.thySpan = input();
79
+ this.span = computed(() => {
80
+ const span = this.thySpan() ?? this.thyCol();
81
+ return span || 24;
82
+ });
72
83
  this.hostRenderer = useHostRenderer();
73
84
  this.takeUntilDestroyed = takeUntilDestroyed();
74
- }
75
- get span() {
76
- const span = this.thySpan ?? this.thyCol;
77
- return span || 24;
78
- }
79
- ngOnInit() {
80
- this.updateHostClass();
81
- }
82
- ngOnChanges(changes) {
83
- this.updateHostClass();
84
- }
85
- ngAfterViewInit() {
86
- if (this.thyRowDirective) {
87
- this.thyRowDirective.actualGutter$.pipe(this.takeUntilDestroyed).subscribe(([horizontalGutter, verticalGutter]) => {
88
- const renderGutter = (name, gutter) => {
89
- this.hostRenderer.setStyle(name, `${gutter / 2}px`);
90
- };
91
- if (horizontalGutter > 0) {
92
- renderGutter('padding-left', horizontalGutter);
93
- renderGutter('padding-right', horizontalGutter);
94
- }
95
- if (verticalGutter > 0) {
96
- renderGutter('padding-top', verticalGutter);
97
- renderGutter('padding-bottom', verticalGutter);
98
- }
99
- });
100
- }
85
+ effect(() => {
86
+ this.updateHostClass();
87
+ });
88
+ afterNextRender(() => {
89
+ if (this.thyRowDirective) {
90
+ this.thyRowDirective.actualGutter$.pipe(this.takeUntilDestroyed).subscribe(([horizontalGutter, verticalGutter]) => {
91
+ const renderGutter = (name, gutter) => {
92
+ this.hostRenderer.setStyle(name, `${gutter / 2}px`);
93
+ };
94
+ if (horizontalGutter > 0) {
95
+ renderGutter('padding-left', horizontalGutter);
96
+ renderGutter('padding-right', horizontalGutter);
97
+ }
98
+ if (verticalGutter > 0) {
99
+ renderGutter('padding-top', verticalGutter);
100
+ renderGutter('padding-bottom', verticalGutter);
101
+ }
102
+ });
103
+ }
104
+ });
101
105
  }
102
106
  updateHostClass() {
107
+ const span = this.span();
103
108
  this.hostRenderer.updateClassByMap({
104
- [`thy-col-${this.span}`]: true
109
+ [`thy-col-${span}`]: true
105
110
  });
106
111
  }
107
112
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyColDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
108
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: ThyColDirective, isStandalone: true, selector: "[thyCol]", inputs: { thyCol: "thyCol", thySpan: "thySpan" }, host: { classAttribute: "thy-col" }, usesOnChanges: true, ngImport: i0 }); }
113
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyColDirective, isStandalone: true, selector: "[thyCol]", inputs: { thyCol: { classPropertyName: "thyCol", publicName: "thyCol", isSignal: true, isRequired: false, transformFunction: null }, thySpan: { classPropertyName: "thySpan", publicName: "thySpan", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "thy-col" }, ngImport: i0 }); }
109
114
  }
110
115
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyColDirective, decorators: [{
111
116
  type: Directive,
@@ -115,11 +120,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
115
120
  class: 'thy-col'
116
121
  }
117
122
  }]
118
- }], propDecorators: { thyCol: [{
119
- type: Input
120
- }], thySpan: [{
121
- type: Input
122
- }] } });
123
+ }], ctorParameters: () => [] });
123
124
 
124
125
  class ThyGridToken {
125
126
  }
@@ -148,11 +149,11 @@ class ThyGridItem {
148
149
  * 栅格项的占位列数,为 0 时会隐藏该栅格项
149
150
  * @default 1
150
151
  */
151
- this.thySpan = THY_GRID_ITEM_DEFAULT_SPAN;
152
+ this.thySpan = input(THY_GRID_ITEM_DEFAULT_SPAN);
152
153
  /**
153
154
  * 栅格项左侧的偏移列数
154
155
  */
155
- this.thyOffset = 0;
156
+ this.thyOffset = input(0);
156
157
  this.destroyRef = inject(DestroyRef);
157
158
  this.hostRenderer = useHostRenderer();
158
159
  this.span = THY_GRID_ITEM_DEFAULT_SPAN;
@@ -170,7 +171,7 @@ class ThyGridItem {
170
171
  this.hostRenderer.setStyle('margin-left', this.offset ? `calc(((100% - ${(this.span - 1) * xGap}px) / ${this.span} + ${xGap}px) * ${this.offset})` : '');
171
172
  }
172
173
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyGridItem, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
173
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: ThyGridItem, isStandalone: true, selector: "thy-grid-item,[thyGridItem]", inputs: { thySpan: "thySpan", thyOffset: "thyOffset" }, host: { classAttribute: "thy-grid-item" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
174
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyGridItem, isStandalone: true, selector: "thy-grid-item,[thyGridItem]", inputs: { thySpan: { classPropertyName: "thySpan", publicName: "thySpan", isSignal: true, isRequired: false, transformFunction: null }, thyOffset: { classPropertyName: "thyOffset", publicName: "thyOffset", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "thy-grid-item" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
174
175
  }
175
176
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyGridItem, decorators: [{
176
177
  type: Component,
@@ -182,11 +183,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
182
183
  class: 'thy-grid-item'
183
184
  }
184
185
  }]
185
- }], propDecorators: { thySpan: [{
186
- type: Input
187
- }], thyOffset: [{
188
- type: Input
189
- }] } });
186
+ }] });
190
187
 
191
188
  /**
192
189
  * 栅格组件
@@ -199,66 +196,67 @@ class ThyGrid {
199
196
  this.elementRef = inject(ElementRef);
200
197
  this.viewportRuler = inject(ViewportRuler);
201
198
  this.ngZone = inject(NgZone);
199
+ /**
200
+ * @internal
201
+ */
202
+ this.gridItems = contentChildren(ThyGridItem);
202
203
  /**
203
204
  * 栅格的列数
204
205
  * @default 24
205
206
  */
206
- this.thyCols = THY_GRID_DEFAULT_COLUMNS;
207
+ this.thyCols = input(THY_GRID_DEFAULT_COLUMNS);
207
208
  /**
208
209
  * 栅格的水平间隔
209
210
  */
210
- this.thyXGap = 0;
211
+ this.thyXGap = input(0);
211
212
  /**
212
213
  * 栅格的垂直间隔
213
214
  */
214
- this.thyYGap = 0;
215
+ this.thyYGap = input(0);
215
216
  /**
216
217
  * 栅格的水平和垂直间隔
217
218
  */
218
- this.thyGap = 0;
219
+ this.thyGap = input(0);
219
220
  /**
220
221
  * 响应式栅格列数<br/>
221
222
  * none: 不进行响应式布局。<br/>
222
223
  * self:根据grid的自身宽度进行响应式布局。<br/>
223
224
  * screen:根据屏幕断点进行响应式布局,目前预设了5种响应式尺寸:`xs: 0, sm: 576, md: 768, lg: 992, xl: 1200`。
224
225
  */
225
- this.thyResponsive = 'none';
226
+ this.thyResponsive = input('none');
226
227
  this.hostRenderer = useHostRenderer();
227
228
  this.numRegex = /^\d+$/;
228
229
  this.gridItemPropValueChange$ = new Subject();
229
230
  this.takeUntilDestroyed = takeUntilDestroyed();
231
+ effect(() => {
232
+ this.handleGridItems();
233
+ });
230
234
  }
231
235
  ngOnInit() {
232
236
  this.setGridStyle();
233
- if (this.thyResponsive !== 'none') {
237
+ if (this.thyResponsive() !== 'none') {
234
238
  this.listenResizeEvent();
235
239
  }
236
240
  }
237
- ngOnChanges(changes) { }
238
- ngAfterContentInit() {
239
- this.handleGridItems();
240
- this.gridItems.changes.pipe(this.takeUntilDestroyed).subscribe(() => {
241
- Promise.resolve().then(() => {
242
- this.handleGridItems();
243
- });
244
- });
245
- }
246
241
  setGridStyle() {
247
- this.cols = this.calculateActualValue(this.thyCols || THY_GRID_DEFAULT_COLUMNS, THY_GRID_DEFAULT_COLUMNS);
248
- if (!this.thyXGap && !this.thyYGap) {
249
- this.xGap = this.calculateActualValue(this.thyGap || 0);
242
+ this.cols = this.calculateActualValue(this.thyCols() || THY_GRID_DEFAULT_COLUMNS, THY_GRID_DEFAULT_COLUMNS);
243
+ const xGap = this.thyXGap();
244
+ const yGap = this.thyYGap();
245
+ const gap = this.thyGap();
246
+ if (!xGap && !yGap) {
247
+ this.xGap = this.calculateActualValue(gap || 0);
250
248
  this.yGap = this.xGap;
251
249
  }
252
250
  else {
253
- this.xGap = this.calculateActualValue(this.thyXGap || this.thyGap);
254
- this.yGap = this.calculateActualValue(this.thyYGap || this.thyGap);
251
+ this.xGap = this.calculateActualValue(xGap || gap);
252
+ this.yGap = this.calculateActualValue(yGap || gap);
255
253
  }
256
254
  this.hostRenderer.setStyle('display', 'grid');
257
255
  this.hostRenderer.setStyle('grid-template-columns', `repeat(${this.cols}, minmax(0, 1fr))`);
258
256
  this.hostRenderer.setStyle('gap', `${this.yGap}px ${this.xGap}px`);
259
257
  }
260
258
  listenResizeEvent() {
261
- if (this.thyResponsive === 'screen') {
259
+ if (this.thyResponsive() === 'screen') {
262
260
  this.viewportRuler
263
261
  .change(100)
264
262
  .pipe(this.takeUntilDestroyed)
@@ -281,10 +279,10 @@ class ThyGrid {
281
279
  }
282
280
  }
283
281
  handleGridItems() {
284
- this.gridItems.forEach((gridItem) => {
285
- const rawSpan = getRawSpan(gridItem.thySpan);
282
+ this.gridItems().forEach((gridItem) => {
283
+ const rawSpan = getRawSpan(gridItem.thySpan());
286
284
  const span = this.calculateActualValue(rawSpan, THY_GRID_ITEM_DEFAULT_SPAN);
287
- const offset = this.calculateActualValue(gridItem.thyOffset || 0);
285
+ const offset = this.calculateActualValue(gridItem.thyOffset() || 0);
288
286
  gridItem.span = Math.min(span + offset, this.cols);
289
287
  gridItem.offset = offset;
290
288
  });
@@ -298,7 +296,7 @@ class ThyGrid {
298
296
  const responsiveValueMap = this.getResponsiveValueMap(rawValue);
299
297
  const breakpointKeys = Object.keys(responsiveValueMap);
300
298
  const breakpoint = this.calculateBreakPoint(breakpointKeys);
301
- if (this.thyResponsive !== 'none' && breakpoint) {
299
+ if (this.thyResponsive() !== 'none' && breakpoint) {
302
300
  return responsiveValueMap[breakpoint];
303
301
  }
304
302
  else if (breakpointKeys.includes('0')) {
@@ -320,7 +318,7 @@ class ThyGrid {
320
318
  }, {});
321
319
  }
322
320
  calculateBreakPoint(breakpointKeys) {
323
- if (this.thyResponsive === 'screen') {
321
+ if (this.thyResponsive() === 'screen') {
324
322
  const width = this.responsiveContainerWidth || this.viewportRuler.getViewportSize().width;
325
323
  return breakpointKeys.find((key, index) => {
326
324
  return index < breakpointKeys.length - 1
@@ -349,12 +347,12 @@ class ThyGrid {
349
347
  });
350
348
  }
351
349
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyGrid, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
352
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: ThyGrid, isStandalone: true, selector: "[thyGrid]", inputs: { thyCols: "thyCols", thyXGap: "thyXGap", thyYGap: "thyYGap", thyGap: "thyGap", thyResponsive: "thyResponsive" }, host: { classAttribute: "thy-grid" }, providers: [
350
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.8", type: ThyGrid, isStandalone: true, selector: "[thyGrid]", inputs: { thyCols: { classPropertyName: "thyCols", publicName: "thyCols", isSignal: true, isRequired: false, transformFunction: null }, thyXGap: { classPropertyName: "thyXGap", publicName: "thyXGap", isSignal: true, isRequired: false, transformFunction: null }, thyYGap: { classPropertyName: "thyYGap", publicName: "thyYGap", isSignal: true, isRequired: false, transformFunction: null }, thyGap: { classPropertyName: "thyGap", publicName: "thyGap", isSignal: true, isRequired: false, transformFunction: null }, thyResponsive: { classPropertyName: "thyResponsive", publicName: "thyResponsive", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "thy-grid" }, providers: [
353
351
  {
354
352
  provide: THY_GRID_COMPONENT,
355
353
  useExisting: ThyGrid
356
354
  }
357
- ], queries: [{ propertyName: "gridItems", predicate: ThyGridItem }], usesOnChanges: true, ngImport: i0 }); }
355
+ ], queries: [{ propertyName: "gridItems", predicate: ThyGridItem, isSignal: true }], ngImport: i0 }); }
358
356
  }
359
357
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyGrid, decorators: [{
360
358
  type: Directive,
@@ -370,20 +368,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
370
368
  class: 'thy-grid'
371
369
  }
372
370
  }]
373
- }], propDecorators: { gridItems: [{
374
- type: ContentChildren,
375
- args: [ThyGridItem]
376
- }], thyCols: [{
377
- type: Input
378
- }], thyXGap: [{
379
- type: Input
380
- }], thyYGap: [{
381
- type: Input
382
- }], thyGap: [{
383
- type: Input
384
- }], thyResponsive: [{
385
- type: Input
386
- }] } });
371
+ }], ctorParameters: () => [] });
387
372
  /**
388
373
  * @internal
389
374
  */
@@ -431,40 +416,59 @@ function getRawSpan(span) {
431
416
  */
432
417
  // eslint-disable-next-line @angular-eslint/directive-class-suffix
433
418
  class ThyFlex {
434
- get direction() {
435
- const direction = this.thyDirection ?? this.thyDirection;
436
- return direction || 'row';
437
- }
438
419
  constructor() {
439
420
  this.hostRenderer = useHostRenderer();
440
- }
441
- ngOnInit() {
442
- this.updateClasses();
443
- }
444
- ngOnChanges(changes) {
445
- if (hasLaterChange(changes)) {
421
+ /**
422
+ * Flex 方向,为 row 或者 column
423
+ */
424
+ this.thyDirection = input('row', {
425
+ transform: (value) => value || 'row'
426
+ });
427
+ /**
428
+ * Flex Wrap
429
+ * @default nowrap
430
+ */
431
+ this.thyWrap = input();
432
+ /**
433
+ * Justify Content
434
+ */
435
+ this.thyJustifyContent = input();
436
+ /**
437
+ * Align Items
438
+ */
439
+ this.thyAlignItems = input();
440
+ /**
441
+ * Flex Item 之间的间隙 Gap
442
+ * @default 0
443
+ */
444
+ this.thyGap = input();
445
+ effect(() => {
446
446
  this.updateClasses();
447
- }
447
+ });
448
448
  }
449
449
  updateClasses() {
450
450
  const classes = [];
451
- if (!isUndefinedOrNull(this.thyJustifyContent)) {
452
- classes.push(`justify-content-${normalizeStartEnd(this.thyJustifyContent)}`);
451
+ const justifyContent = this.thyJustifyContent();
452
+ if (!isUndefinedOrNull(justifyContent)) {
453
+ classes.push(`justify-content-${normalizeStartEnd(justifyContent)}`);
453
454
  }
454
- if (!isUndefinedOrNull(this.thyAlignItems)) {
455
- classes.push(`align-items-${normalizeStartEnd(this.thyAlignItems)}`);
455
+ const alignItems = this.thyAlignItems();
456
+ if (!isUndefinedOrNull(alignItems)) {
457
+ classes.push(`align-items-${normalizeStartEnd(alignItems)}`);
456
458
  }
457
- if (!isUndefinedOrNull(this.thyWrap)) {
458
- classes.push(`flex-${this.thyWrap}`);
459
+ const wrap = this.thyWrap();
460
+ if (!isUndefinedOrNull(wrap)) {
461
+ classes.push(`flex-${wrap}`);
459
462
  }
460
- if (!isUndefinedOrNull(this.direction)) {
461
- classes.push(`flex-${this.direction}`);
463
+ const direction = this.thyDirection();
464
+ if (!isUndefinedOrNull(direction)) {
465
+ classes.push(`flex-${direction}`);
462
466
  }
463
467
  this.hostRenderer.updateClass(classes);
464
- this.hostRenderer.setStyle('gap', `${this.thyGap ?? '0'}px`);
468
+ this.hostRenderer.setStyle('gap', `${this.thyGap() ?? '0'}px`);
465
469
  }
466
470
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFlex, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
467
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: ThyFlex, isStandalone: true, selector: "[thyFlex]", inputs: { thyDirection: "thyDirection", thyWrap: "thyWrap", thyJustifyContent: "thyJustifyContent", thyAlignItems: "thyAlignItems", thyGap: "thyGap" }, host: { classAttribute: "thy-flex d-flex" }, usesOnChanges: true, ngImport: i0 }); }
471
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyFlex, isStandalone: true, selector: "[thyFlex]", inputs: { thyDirection: { classPropertyName: "thyDirection", publicName: "thyDirection", isSignal: true, isRequired: false, transformFunction: null }, thyWrap: { classPropertyName: "thyWrap", publicName: "thyWrap", isSignal: true, isRequired: false, transformFunction: null }, thyJustifyContent: { classPropertyName: "thyJustifyContent", publicName: "thyJustifyContent", isSignal: true, isRequired: false, transformFunction: null }, thyAlignItems: { classPropertyName: "thyAlignItems", publicName: "thyAlignItems", isSignal: true, isRequired: false, transformFunction: null }, thyGap: { classPropertyName: "thyGap", publicName: "thyGap", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "thy-flex d-flex" }, ngImport: i0 }); }
468
472
  }
469
473
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFlex, decorators: [{
470
474
  type: Directive,
@@ -474,17 +478,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
474
478
  class: 'thy-flex d-flex'
475
479
  }
476
480
  }]
477
- }], ctorParameters: () => [], propDecorators: { thyDirection: [{
478
- type: Input
479
- }], thyWrap: [{
480
- type: Input
481
- }], thyJustifyContent: [{
482
- type: Input
483
- }], thyAlignItems: [{
484
- type: Input
485
- }], thyGap: [{
486
- type: Input
487
- }] } });
481
+ }], ctorParameters: () => [] });
488
482
  /**
489
483
  * @internal
490
484
  */
@@ -516,40 +510,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
516
510
  class ThyFlexItem {
517
511
  constructor() {
518
512
  this.hostRenderer = useHostRenderer();
519
- }
520
- ngOnInit() {
521
- this.updateClasses();
522
- }
523
- ngOnChanges(changes) {
524
- if (hasLaterChange(changes)) {
513
+ /**
514
+ * Flex Item 属性,表示 grow 、shrink 、basis
515
+ */
516
+ this.thyFlexItem = input();
517
+ /**
518
+ * Flew Grow,设置或检索弹性盒子的扩展比率,设置 1 为填充剩余区域
519
+ */
520
+ this.thyGrow = input();
521
+ /**
522
+ * Flex Shrink,设置或检索弹性盒收缩比例
523
+ * @default 1
524
+ */
525
+ this.thyShrink = input();
526
+ /**
527
+ * Flex Basis,设置或检索弹性盒伸缩基准值
528
+ * @default 1
529
+ */
530
+ this.thyBasis = input();
531
+ effect(() => {
525
532
  this.updateClasses();
526
- }
533
+ });
527
534
  }
528
535
  updateClasses() {
536
+ const flexItem = this.thyFlexItem();
529
537
  const classes = [];
530
538
  this.hostRenderer.setStyle('flex', '');
531
539
  this.hostRenderer.setStyle('basis', '');
532
- if (this.thyFlexItem) {
533
- if (this.thyFlexItem === 'fill') {
534
- classes.push(`flex-${this.thyFlexItem}`);
540
+ if (flexItem) {
541
+ if (flexItem === 'fill') {
542
+ classes.push(`flex-${flexItem}`);
535
543
  }
536
544
  else {
537
- this.hostRenderer.setStyle('flex', this.thyFlexItem);
545
+ this.hostRenderer.setStyle('flex', flexItem);
538
546
  }
539
547
  }
540
- if (!isUndefinedOrNull(this.thyGrow)) {
541
- classes.push(`flex-grow-${this.thyGrow}`);
548
+ const grow = this.thyGrow();
549
+ if (!isUndefinedOrNull(grow)) {
550
+ classes.push(`flex-grow-${grow}`);
542
551
  }
543
- if (!isUndefinedOrNull(this.thyShrink)) {
544
- classes.push(`flex-shrink-${this.thyShrink}`);
552
+ const shrink = this.thyShrink();
553
+ if (!isUndefinedOrNull(shrink)) {
554
+ classes.push(`flex-shrink-${shrink}`);
545
555
  }
546
- if (!isUndefinedOrNull(this.thyBasis)) {
547
- this.hostRenderer.setStyle('flex-basis', this.thyBasis);
556
+ const basis = this.thyBasis();
557
+ if (!isUndefinedOrNull(basis)) {
558
+ this.hostRenderer.setStyle('flex-basis', basis);
548
559
  }
549
560
  this.hostRenderer.updateClass(classes);
550
561
  }
551
562
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFlexItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
552
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: ThyFlexItem, isStandalone: true, selector: "[thyFlexItem]", inputs: { thyFlexItem: "thyFlexItem", thyGrow: "thyGrow", thyShrink: "thyShrink", thyBasis: "thyBasis" }, host: { classAttribute: "thy-flex-item" }, usesOnChanges: true, ngImport: i0 }); }
563
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyFlexItem, isStandalone: true, selector: "[thyFlexItem]", inputs: { thyFlexItem: { classPropertyName: "thyFlexItem", publicName: "thyFlexItem", isSignal: true, isRequired: false, transformFunction: null }, thyGrow: { classPropertyName: "thyGrow", publicName: "thyGrow", isSignal: true, isRequired: false, transformFunction: null }, thyShrink: { classPropertyName: "thyShrink", publicName: "thyShrink", isSignal: true, isRequired: false, transformFunction: null }, thyBasis: { classPropertyName: "thyBasis", publicName: "thyBasis", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "thy-flex-item" }, ngImport: i0 }); }
553
564
  }
554
565
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFlexItem, decorators: [{
555
566
  type: Directive,
@@ -559,15 +570,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
559
570
  class: 'thy-flex-item'
560
571
  }
561
572
  }]
562
- }], ctorParameters: () => [], propDecorators: { thyFlexItem: [{
563
- type: Input
564
- }], thyGrow: [{
565
- type: Input
566
- }], thyShrink: [{
567
- type: Input
568
- }], thyBasis: [{
569
- type: Input
570
- }] } });
573
+ }], ctorParameters: () => [] });
571
574
  /**
572
575
  * @internal
573
576
  */