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
@@ -4,7 +4,7 @@ import { ThyInputModule } from 'ngx-tethys/input';
4
4
  import { ThyTooltipDirective, ThyTooltipModule } from 'ngx-tethys/tooltip';
5
5
  import { NgClass, NgTemplateOutlet, CommonModule } from '@angular/common';
6
6
  import * as i0 from '@angular/core';
7
- import { InjectionToken, Optional, Inject, Injectable, inject, ElementRef, Renderer2, NgZone, ContentChildren, HostBinding, Input, Directive, ViewEncapsulation, Component, ContentChild, ChangeDetectionStrategy, EventEmitter, HostListener, Output, forwardRef, NgModule } from '@angular/core';
7
+ import { InjectionToken, Optional, Inject, Injectable, inject, ElementRef, Renderer2, NgZone, input, effect, ContentChildren, HostBinding, Directive, Input, ViewEncapsulation, Component, signal, computed, ContentChild, ChangeDetectionStrategy, output, HostListener, forwardRef, NgModule } from '@angular/core';
8
8
  import { NgForm, FormGroupDirective, ControlContainer, NgControl, NG_ASYNC_VALIDATORS, Validators, NG_VALIDATORS, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
9
  import { helpers, isUndefinedOrNull, keycodes, coerceBooleanProperty as coerceBooleanProperty$1 } from 'ngx-tethys/util';
10
10
  import { useHostRenderer } from '@tethys/cdk/dom';
@@ -411,30 +411,11 @@ var ThyEnterKeyMode;
411
411
  * @order 10
412
412
  */
413
413
  class ThyFormDirective {
414
- /**
415
- * 布局,默认水平居中 horizontal,其他2种布局待开发
416
- * @type horizontal | vertical | inline
417
- * @default horizontal
418
- */
419
- set thyLayout(value) {
420
- if (value) {
421
- this.layout = value;
422
- if (this.initialized) {
423
- this.updateClasses();
424
- }
425
- }
426
- }
427
- get thyLayout() {
428
- return this.layout;
429
- }
430
414
  get isHorizontal() {
431
415
  return this.layout === 'horizontal';
432
416
  }
433
- /**
434
- * 表单验证规则配置项 (更多内容查看:thyFormValidatorConfig)
435
- */
436
- set thyFormValidatorConfig(config) {
437
- this.validator.setValidatorConfig(config);
417
+ get layout() {
418
+ return this.thyLayout() || this.config.layout;
438
419
  }
439
420
  constructor() {
440
421
  this.ngForm = inject(ControlContainer);
@@ -443,17 +424,46 @@ class ThyFormDirective {
443
424
  this.ngZone = inject(NgZone);
444
425
  this.validator = inject(ThyFormValidatorService);
445
426
  this.config = inject(THY_FORM_CONFIG);
446
- this.initialized = false;
447
427
  this.hostRenderer = useHostRenderer();
428
+ /**
429
+ * 布局,默认水平居中 horizontal,其他2种布局待开发
430
+ * @type horizontal | vertical | inline
431
+ * @default horizontal
432
+ */
433
+ this.thyLayout = input(undefined);
434
+ /**
435
+ * Enter 键提交模式。`submit`: Textarea 需要 Ctrl | Command + Enter 提交,其他元素直接 Enter 提交; `alwaysSubmit`: 不管是什么元素 Enter 都提交; `forbidSubmit`: Enter 不提交
436
+ * @type submit | alwaysSubmit | forbidSubmit
437
+ * @default submit
438
+ */
439
+ this.thyEnterKeyMode = input(undefined);
440
+ /**
441
+ * 表单验证规则配置项 (更多内容查看:thyFormValidatorConfig)
442
+ */
443
+ this.thyFormValidatorConfig = input();
448
444
  this.wasValidated = false;
449
- this.layout = this.config.layout;
445
+ effect(() => {
446
+ this.updateClasses();
447
+ });
448
+ effect(() => {
449
+ const config = this.thyFormValidatorConfig();
450
+ if (config) {
451
+ this.validator.setValidatorConfig(config);
452
+ }
453
+ });
454
+ // TODO:: replace ngAfterViewInit with afterNextRender
455
+ // afterNextRender(() => {
456
+ // this.validator.initialize(this.ngForm as NgForm, this.elementRef.nativeElement);
457
+ // this.validator.initializeFormControlsValidation(this.controls.toArray());
458
+ // this.controls.changes.subscribe(controls => {
459
+ // this.validator.initializeFormControlsValidation(this.controls.toArray());
460
+ // });
461
+ // });
450
462
  }
451
463
  ngOnInit() {
452
464
  this.ngZone.runOutsideAngular(() => {
453
465
  this._unsubscribe = this.renderer.listen(this.elementRef.nativeElement, 'keydown', this.onKeydown.bind(this));
454
466
  });
455
- this.updateClasses();
456
- this.initialized = true;
457
467
  }
458
468
  ngAfterViewInit() {
459
469
  this.validator.initialize(this.ngForm, this.elementRef.nativeElement);
@@ -473,9 +483,7 @@ class ThyFormDirective {
473
483
  }
474
484
  }
475
485
  updateClasses() {
476
- this.hostRenderer.updateClassByMap({
477
- [`thy-form-${this.thyLayout}`]: true
478
- });
486
+ this.hostRenderer.updateClassByMap({ [`thy-form-${this.layout}`]: true });
479
487
  }
480
488
  submitRunInZone($event) {
481
489
  this.ngZone.run(() => {
@@ -486,7 +494,8 @@ class ThyFormDirective {
486
494
  const currentInput = document.activeElement;
487
495
  const key = $event.which || $event.keyCode;
488
496
  if (key === keycodes.ENTER && currentInput.tagName) {
489
- if (!this.thyEnterKeyMode || this.thyEnterKeyMode === ThyEnterKeyMode.submit) {
497
+ const thyEnterKeyMode = this.thyEnterKeyMode();
498
+ if (!thyEnterKeyMode || thyEnterKeyMode === ThyEnterKeyMode.submit) {
490
499
  // TEXTAREA或包含[contenteditable]属性的元素 Ctrl + Enter 或者 Command + Enter 阻止默认行为并提交
491
500
  if (currentInput.tagName === 'TEXTAREA' || coerceBooleanProperty(currentInput.getAttribute('contenteditable'))) {
492
501
  if ($event.ctrlKey || $event.metaKey) {
@@ -500,7 +509,7 @@ class ThyFormDirective {
500
509
  this.submitRunInZone($event);
501
510
  }
502
511
  }
503
- else if (this.thyEnterKeyMode === ThyEnterKeyMode.alwaysSubmit) {
512
+ else if (thyEnterKeyMode === ThyEnterKeyMode.alwaysSubmit) {
504
513
  $event.preventDefault();
505
514
  this.submitRunInZone($event);
506
515
  }
@@ -516,32 +525,17 @@ class ThyFormDirective {
516
525
  }
517
526
  }
518
527
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFormDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
519
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: ThyFormDirective, isStandalone: true, selector: "[thyForm],[thy-form]", inputs: { thyLayout: "thyLayout", thyEnterKeyMode: "thyEnterKeyMode", thyFormValidatorConfig: "thyFormValidatorConfig" }, host: { properties: { "class.was-validated": "this.wasValidated" }, classAttribute: "thy-form" }, providers: [ThyFormValidatorService], queries: [{ propertyName: "controls", predicate: NgControl, descendants: true }], exportAs: ["thyForm"], ngImport: i0 }); }
528
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyFormDirective, isStandalone: true, selector: "[thyForm],[thy-form]", inputs: { thyLayout: { classPropertyName: "thyLayout", publicName: "thyLayout", isSignal: true, isRequired: false, transformFunction: null }, thyEnterKeyMode: { classPropertyName: "thyEnterKeyMode", publicName: "thyEnterKeyMode", isSignal: true, isRequired: false, transformFunction: null }, thyFormValidatorConfig: { classPropertyName: "thyFormValidatorConfig", publicName: "thyFormValidatorConfig", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.was-validated": "this.wasValidated" }, classAttribute: "thy-form" }, providers: [ThyFormValidatorService], queries: [{ propertyName: "controls", predicate: NgControl, descendants: true }], exportAs: ["thyForm"], ngImport: i0 }); }
520
529
  }
521
530
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFormDirective, decorators: [{
522
531
  type: Directive,
523
- args: [{
524
- selector: '[thyForm],[thy-form]',
525
- providers: [ThyFormValidatorService],
526
- exportAs: 'thyForm',
527
- host: {
528
- class: 'thy-form'
529
- }
530
- }]
531
- }], ctorParameters: () => [], propDecorators: { thyLayout: [{
532
- type: Input
533
- }], thyEnterKeyMode: [{
534
- type: Input
535
- }], thyFormValidatorConfig: [{
536
- type: Input
537
- }], wasValidated: [{
532
+ args: [{ selector: '[thyForm],[thy-form]', providers: [ThyFormValidatorService], exportAs: 'thyForm', host: { class: 'thy-form' } }]
533
+ }], ctorParameters: () => [], propDecorators: { wasValidated: [{
538
534
  type: HostBinding,
539
535
  args: ['class.was-validated']
540
536
  }], controls: [{
541
537
  type: ContentChildren,
542
- args: [NgControl, {
543
- descendants: true
544
- }]
538
+ args: [NgControl, { descendants: true }]
545
539
  }] } });
546
540
 
547
541
  /**
@@ -551,7 +545,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
551
545
  class ThyFormGroupError {
552
546
  constructor() {
553
547
  this.thyParentForm = inject(ThyFormDirective, { optional: true });
554
- this.thyShowFirst = true;
548
+ this.thyShowFirst = input(true, { transform: coerceBooleanProperty$1 });
555
549
  this.isHorizontal = true;
556
550
  }
557
551
  /**
@@ -562,7 +556,7 @@ class ThyFormGroupError {
562
556
  }
563
557
  get thyErrors() {
564
558
  const errors = this.errors || this.thyParentForm.validator.errors;
565
- return errors && errors.length > 0 && this.thyShowFirst ? [errors[0]] : errors;
559
+ return errors && errors.length > 0 && this.thyShowFirst() ? [errors[0]] : errors;
566
560
  }
567
561
  get _isFormGroup() {
568
562
  return this.thyErrors && this.thyErrors.length > 0;
@@ -573,15 +567,12 @@ class ThyFormGroupError {
573
567
  }
574
568
  }
575
569
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFormGroupError, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
576
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyFormGroupError, isStandalone: true, selector: "thy-form-group-error", inputs: { thyShowFirst: ["thyShowFirst", "thyShowFirst", coerceBooleanProperty$1], thyErrors: "thyErrors" }, host: { properties: { "class.form-group": "this._isFormGroup", "class.row": "this.isHorizontal" } }, ngImport: i0, template: "<div [ngClass]=\"{ 'col-sm-10 offset-sm-2 col-form-control': isHorizontal }\">\n @for (error of thyErrors; track $index) {\n <thy-alert thyType=\"danger\" [thyMessage]=\"error\"></thy-alert>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ThyAlert, selector: "thy-alert", inputs: ["thyType", "thyTheme", "thyMessage", "thyIcon", "thyCloseable"] }], encapsulation: i0.ViewEncapsulation.None }); }
570
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyFormGroupError, isStandalone: true, selector: "thy-form-group-error", inputs: { thyShowFirst: { classPropertyName: "thyShowFirst", publicName: "thyShowFirst", isSignal: true, isRequired: false, transformFunction: null }, thyErrors: { classPropertyName: "thyErrors", publicName: "thyErrors", isSignal: false, isRequired: false, transformFunction: null } }, host: { properties: { "class.form-group": "this._isFormGroup", "class.row": "this.isHorizontal" } }, ngImport: i0, template: "<div [ngClass]=\"{ 'col-sm-10 offset-sm-2 col-form-control': isHorizontal }\">\n @for (error of thyErrors; track $index) {\n <thy-alert thyType=\"danger\" [thyMessage]=\"error\"></thy-alert>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ThyAlert, selector: "thy-alert", inputs: ["thyType", "thyTheme", "thyMessage", "thyIcon", "thyCloseable"] }], encapsulation: i0.ViewEncapsulation.None }); }
577
571
  }
578
572
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFormGroupError, decorators: [{
579
573
  type: Component,
580
574
  args: [{ selector: 'thy-form-group-error', encapsulation: ViewEncapsulation.None, imports: [NgClass, ThyAlert], template: "<div [ngClass]=\"{ 'col-sm-10 offset-sm-2 col-form-control': isHorizontal }\">\n @for (error of thyErrors; track $index) {\n <thy-alert thyType=\"danger\" [thyMessage]=\"error\"></thy-alert>\n }\n</div>\n" }]
581
- }], propDecorators: { thyShowFirst: [{
582
- type: Input,
583
- args: [{ transform: coerceBooleanProperty$1 }]
584
- }], thyErrors: [{
575
+ }], propDecorators: { thyErrors: [{
585
576
  type: Input
586
577
  }], _isFormGroup: [{
587
578
  type: HostBinding,
@@ -636,7 +627,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
636
627
  }] } });
637
628
 
638
629
  const internalIconMap = {
639
- date: 'wtf wtf-schedule-o'
630
+ date: 'calendar'
640
631
  };
641
632
  /**
642
633
  * 表单分组组件
@@ -647,124 +638,100 @@ class ThyFormGroup {
647
638
  constructor() {
648
639
  this.thyParentForm = inject(ThyFormDirective, { optional: true });
649
640
  this.thyTranslate = inject(ThyTranslate);
650
- this.labelRequired = false;
651
- this.labelPaddingTopClear = false;
652
- this.tipMode = 'default';
653
- this._rowFill = false;
654
- this._isFormGroup = true;
655
- this.isHorizontal = true;
656
- this.hasFeedback = false;
657
- }
658
- /**
659
- * Label 文本
660
- */
661
- set thyLabelText(value) {
662
- this.labelText = value;
663
- }
664
- /**
665
- * Label 文本多语言 Key
666
- */
667
- set thyLabelTextTranslateKey(value) {
668
- if (value) {
669
- this.labelText = this.thyTranslate.instant(value);
670
- }
671
- else {
672
- this.labelText = '';
673
- }
674
- }
675
- /**
676
- * Label 是否显示必填项样式
677
- */
678
- set thyLabelRequired(value) {
679
- this.labelRequired = value;
680
- }
681
- set thyLabelPaddingTopClear(value) {
682
- this.labelPaddingTopClear = value;
683
- }
684
- /**
685
- * 反馈图标,比如日期输入框显示日期的图标,常用输入 date 表示时间 wtf wtf-schedule-o
686
- */
687
- set thyFeedbackIcon(value) {
688
- this.hasFeedback = true;
689
- if (internalIconMap[value]) {
690
- this.feedbackIcon = internalIconMap[value];
691
- this.feedbackSvgIconName = null;
692
- }
693
- else {
694
- this.feedbackSvgIconName = value;
695
- this.feedbackIcon = null;
696
- }
697
- }
698
- /**
699
- * 提示文字的显示模式,`label`模式表示在 label 后通过图标+Tooltip 提示, `default`模式在 Form Control 下方直接显示
700
- * @type default | label
701
- * @default default
702
- */
703
- set thyTipsMode(mode) {
704
- this.tipMode = mode;
705
- }
706
- /**
707
- * 提示文案
708
- */
709
- set thyTips(value) {
710
- this.tips = value;
711
- }
712
- /**
713
- * 提示文案的多语言 Key
714
- */
715
- set thyTipsTranslateKey(value) {
716
- this.tips = this.thyTranslate.instant(value);
717
- }
718
- /**
719
- * 是否填充整行, 没有 Label 文本,只有输入框
720
- * @default false
721
- */
722
- set thyRowFill(value) {
723
- this._rowFill = value;
641
+ this.isHorizontalSignal = signal(true);
642
+ /**
643
+ * Label 文本
644
+ */
645
+ this.thyLabelText = input();
646
+ /**
647
+ * Label 文本多语言 Key
648
+ */
649
+ this.thyLabelTextTranslateKey = input();
650
+ this.labelTextSignal = computed(() => {
651
+ const labelTextTranslateKey = this.thyLabelTextTranslateKey();
652
+ const labelText = this.thyLabelText();
653
+ if (labelText) {
654
+ return labelText;
655
+ }
656
+ else if (labelTextTranslateKey) {
657
+ return this.thyTranslate.instant(labelTextTranslateKey);
658
+ }
659
+ return '';
660
+ });
661
+ /**
662
+ * Label 是否显示必填项样式
663
+ */
664
+ this.thyLabelRequired = input(false, {
665
+ transform: coerceBooleanProperty$1
666
+ });
667
+ /**
668
+ * 清楚 Label padding 间距
669
+ */
670
+ this.thyLabelPaddingTopClear = input(false, {
671
+ transform: coerceBooleanProperty$1
672
+ });
673
+ /**
674
+ * 反馈图标,比如日期输入框显示日期的图标,常用输入 date 表示时间 wtf wtf-schedule-o
675
+ */
676
+ this.thyFeedbackIcon = input('', {
677
+ transform: (value) => {
678
+ if (internalIconMap[value]) {
679
+ return internalIconMap[value];
680
+ }
681
+ return value;
682
+ }
683
+ });
684
+ /**
685
+ * 提示文字的显示模式,`label`模式表示在 label 后通过图标+Tooltip 提示, `default`模式在 Form Control 下方直接显示
686
+ * @type default | label
687
+ * @default default
688
+ */
689
+ this.thyTipsMode = input('default');
690
+ /**
691
+ * 提示文案
692
+ */
693
+ this.thyTips = input('');
694
+ /**
695
+ * 提示文案的多语言 Key
696
+ */
697
+ this.thyTipsTranslateKey = input('');
698
+ this.tipsSignal = computed(() => {
699
+ const key = this.thyTipsTranslateKey();
700
+ const tips = this.thyTips();
701
+ if (key) {
702
+ return this.thyTranslate.instant(key);
703
+ }
704
+ if (tips) {
705
+ return tips;
706
+ }
707
+ return '';
708
+ });
709
+ /**
710
+ * 是否填充整行, 没有 Label 文本,只有输入框
711
+ * @default false
712
+ */
713
+ this.thyRowFill = input(false, { transform: coerceBooleanProperty$1 });
714
+ // effect(() => {
715
+ // const isHorizontal = this.thyParentForm ? this.thyParentForm.isHorizontal : true;
716
+ // this.isHorizontal.set(isHorizontal);
717
+ // });
724
718
  }
725
719
  ngOnInit() {
726
- this.isHorizontal = this.thyParentForm ? this.thyParentForm.isHorizontal : true;
720
+ const isHorizontal = this.thyParentForm ? this.thyParentForm.isHorizontal : true;
721
+ this.isHorizontalSignal.set(isHorizontal);
727
722
  }
728
723
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFormGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
729
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyFormGroup, isStandalone: true, selector: "thy-form-group", inputs: { thyLabelText: "thyLabelText", thyLabelTextTranslateKey: "thyLabelTextTranslateKey", thyLabelRequired: ["thyLabelRequired", "thyLabelRequired", coerceBooleanProperty$1], thyLabelPaddingTopClear: ["thyLabelPaddingTopClear", "thyLabelPaddingTopClear", coerceBooleanProperty$1], thyFeedbackIcon: "thyFeedbackIcon", thyTipsMode: "thyTipsMode", thyTips: "thyTips", thyTipsTranslateKey: "thyTipsTranslateKey", thyRowFill: ["thyRowFill", "thyRowFill", coerceBooleanProperty$1] }, host: { properties: { "class.row-fill": "this._rowFill", "class.form-group": "this._isFormGroup", "class.row": "this.isHorizontal", "class.has-feedback": "this.hasFeedback" } }, queries: [{ propertyName: "contentTemplateRef", first: true, predicate: ["formGroup"], descendants: true }, { propertyName: "contentTemplate", first: true, predicate: ["content"], descendants: true }], ngImport: i0, template: "@if (contentTemplate || contentTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"contentTemplate || contentTemplateRef\"></ng-container>\n @if (feedbackSvgIconName) {\n <thy-icon class=\"form-control-feedback\" [thyIconName]=\"feedbackSvgIconName\"></thy-icon>\n } @else {\n @if (feedbackIcon) {\n <span class=\"form-control-feedback {{ feedbackIcon }}\"></span>\n }\n }\n} @else {\n @if (!(!isHorizontal && !labelText)) {\n <label\n class=\"form-label \"\n [ngClass]=\"{\n 'col-sm-2 col-form-label': isHorizontal,\n 'pt-0': labelPaddingTopClear\n }\"\n >\n <span\n [ngClass]=\"{\n 'label-required': labelRequired\n }\"\n >{{ labelText }}</span\n >\n @if (tipMode === 'label' && tips) {\n <thy-icon class=\"label-tips-icon\" thyIconName=\"question-circle\" [thyTooltip]=\"tips\"></thy-icon>\n }\n </label>\n }\n <div [ngClass]=\"{ 'col-sm-10 col-form-control': isHorizontal, 'position-relative': !isHorizontal }\">\n <ng-content></ng-content>\n @if (feedbackSvgIconName) {\n <thy-icon class=\"form-control-feedback\" [thyIconName]=\"feedbackSvgIconName\"></thy-icon>\n } @else {\n @if (feedbackIcon) {\n <span class=\"form-control-feedback {{ feedbackIcon }}\"></span>\n }\n }\n @if (tipMode === 'default' && tips) {\n <span class=\"form-text text-desc\">{{ tips }}</span>\n }\n </div>\n }\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: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
724
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyFormGroup, isStandalone: true, selector: "thy-form-group", inputs: { thyLabelText: { classPropertyName: "thyLabelText", publicName: "thyLabelText", isSignal: true, isRequired: false, transformFunction: null }, thyLabelTextTranslateKey: { classPropertyName: "thyLabelTextTranslateKey", publicName: "thyLabelTextTranslateKey", isSignal: true, isRequired: false, transformFunction: null }, thyLabelRequired: { classPropertyName: "thyLabelRequired", publicName: "thyLabelRequired", isSignal: true, isRequired: false, transformFunction: null }, thyLabelPaddingTopClear: { classPropertyName: "thyLabelPaddingTopClear", publicName: "thyLabelPaddingTopClear", isSignal: true, isRequired: false, transformFunction: null }, thyFeedbackIcon: { classPropertyName: "thyFeedbackIcon", publicName: "thyFeedbackIcon", isSignal: true, isRequired: false, transformFunction: null }, thyTipsMode: { classPropertyName: "thyTipsMode", publicName: "thyTipsMode", isSignal: true, isRequired: false, transformFunction: null }, thyTips: { classPropertyName: "thyTips", publicName: "thyTips", isSignal: true, isRequired: false, transformFunction: null }, thyTipsTranslateKey: { classPropertyName: "thyTipsTranslateKey", publicName: "thyTipsTranslateKey", isSignal: true, isRequired: false, transformFunction: null }, thyRowFill: { classPropertyName: "thyRowFill", publicName: "thyRowFill", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.row-fill": "thyRowFill()", "class.row": "isHorizontalSignal()", "class.has-feedback": "thyFeedbackIcon()" }, classAttribute: "form-group" }, queries: [{ propertyName: "contentTemplateRef", first: true, predicate: ["formGroup"], descendants: true }, { propertyName: "contentTemplate", first: true, predicate: ["content"], descendants: true }], ngImport: i0, template: "@let tips = tipsSignal();\n@let labelText = labelTextSignal();\n@let isHorizontal = isHorizontalSignal();\n@let feedbackIcon = thyFeedbackIcon();\n@if (contentTemplate || contentTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"contentTemplate || contentTemplateRef\"></ng-container>\n @if (feedbackIcon) {\n <thy-icon class=\"form-control-feedback\" [thyIconName]=\"feedbackIcon\"></thy-icon>\n }\n} @else {\n @if (!(!isHorizontal && !labelText)) {\n <label\n class=\"form-label \"\n [ngClass]=\"{\n 'col-sm-2 col-form-label': isHorizontal,\n 'pt-0': thyLabelPaddingTopClear()\n }\"\n >\n <span\n [ngClass]=\"{\n 'label-required': thyLabelRequired()\n }\"\n >{{ labelText }}</span\n >\n @if (thyTipsMode() === 'label' && tips) {\n <thy-icon class=\"label-tips-icon\" thyIconName=\"question-circle\" [thyTooltip]=\"tips\"></thy-icon>\n }\n </label>\n }\n <div [ngClass]=\"{ 'col-sm-10 col-form-control': isHorizontal, 'position-relative': !isHorizontal }\">\n <ng-content></ng-content>\n @if (feedbackIcon) {\n <thy-icon class=\"form-control-feedback\" [thyIconName]=\"feedbackIcon\"></thy-icon>\n }\n @if (thyTipsMode() === 'default' && tips) {\n <span class=\"form-text text-desc\">{{ tips }}</span>\n }\n </div>\n }\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: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
730
725
  }
731
726
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFormGroup, decorators: [{
732
727
  type: Component,
733
- args: [{ selector: 'thy-form-group', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, ThyIcon, NgClass, ThyTooltipDirective], template: "@if (contentTemplate || contentTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"contentTemplate || contentTemplateRef\"></ng-container>\n @if (feedbackSvgIconName) {\n <thy-icon class=\"form-control-feedback\" [thyIconName]=\"feedbackSvgIconName\"></thy-icon>\n } @else {\n @if (feedbackIcon) {\n <span class=\"form-control-feedback {{ feedbackIcon }}\"></span>\n }\n }\n} @else {\n @if (!(!isHorizontal && !labelText)) {\n <label\n class=\"form-label \"\n [ngClass]=\"{\n 'col-sm-2 col-form-label': isHorizontal,\n 'pt-0': labelPaddingTopClear\n }\"\n >\n <span\n [ngClass]=\"{\n 'label-required': labelRequired\n }\"\n >{{ labelText }}</span\n >\n @if (tipMode === 'label' && tips) {\n <thy-icon class=\"label-tips-icon\" thyIconName=\"question-circle\" [thyTooltip]=\"tips\"></thy-icon>\n }\n </label>\n }\n <div [ngClass]=\"{ 'col-sm-10 col-form-control': isHorizontal, 'position-relative': !isHorizontal }\">\n <ng-content></ng-content>\n @if (feedbackSvgIconName) {\n <thy-icon class=\"form-control-feedback\" [thyIconName]=\"feedbackSvgIconName\"></thy-icon>\n } @else {\n @if (feedbackIcon) {\n <span class=\"form-control-feedback {{ feedbackIcon }}\"></span>\n }\n }\n @if (tipMode === 'default' && tips) {\n <span class=\"form-text text-desc\">{{ tips }}</span>\n }\n </div>\n }\n\n" }]
734
- }], propDecorators: { _rowFill: [{
735
- type: HostBinding,
736
- args: ['class.row-fill']
737
- }], _isFormGroup: [{
738
- type: HostBinding,
739
- args: ['class.form-group']
740
- }], isHorizontal: [{
741
- type: HostBinding,
742
- args: ['class.row']
743
- }], hasFeedback: [{
744
- type: HostBinding,
745
- args: ['class.has-feedback']
746
- }], thyLabelText: [{
747
- type: Input
748
- }], thyLabelTextTranslateKey: [{
749
- type: Input
750
- }], thyLabelRequired: [{
751
- type: Input,
752
- args: [{ transform: coerceBooleanProperty$1 }]
753
- }], thyLabelPaddingTopClear: [{
754
- type: Input,
755
- args: [{ transform: coerceBooleanProperty$1 }]
756
- }], thyFeedbackIcon: [{
757
- type: Input
758
- }], thyTipsMode: [{
759
- type: Input
760
- }], thyTips: [{
761
- type: Input
762
- }], thyTipsTranslateKey: [{
763
- type: Input
764
- }], thyRowFill: [{
765
- type: Input,
766
- args: [{ transform: coerceBooleanProperty$1 }]
767
- }], contentTemplateRef: [{
728
+ args: [{ selector: 'thy-form-group', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, ThyIcon, NgClass, ThyTooltipDirective], host: {
729
+ class: 'form-group',
730
+ '[class.row-fill]': 'thyRowFill()',
731
+ '[class.row]': 'isHorizontalSignal()',
732
+ '[class.has-feedback]': 'thyFeedbackIcon()'
733
+ }, template: "@let tips = tipsSignal();\n@let labelText = labelTextSignal();\n@let isHorizontal = isHorizontalSignal();\n@let feedbackIcon = thyFeedbackIcon();\n@if (contentTemplate || contentTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"contentTemplate || contentTemplateRef\"></ng-container>\n @if (feedbackIcon) {\n <thy-icon class=\"form-control-feedback\" [thyIconName]=\"feedbackIcon\"></thy-icon>\n }\n} @else {\n @if (!(!isHorizontal && !labelText)) {\n <label\n class=\"form-label \"\n [ngClass]=\"{\n 'col-sm-2 col-form-label': isHorizontal,\n 'pt-0': thyLabelPaddingTopClear()\n }\"\n >\n <span\n [ngClass]=\"{\n 'label-required': thyLabelRequired()\n }\"\n >{{ labelText }}</span\n >\n @if (thyTipsMode() === 'label' && tips) {\n <thy-icon class=\"label-tips-icon\" thyIconName=\"question-circle\" [thyTooltip]=\"tips\"></thy-icon>\n }\n </label>\n }\n <div [ngClass]=\"{ 'col-sm-10 col-form-control': isHorizontal, 'position-relative': !isHorizontal }\">\n <ng-content></ng-content>\n @if (feedbackIcon) {\n <thy-icon class=\"form-control-feedback\" [thyIconName]=\"feedbackIcon\"></thy-icon>\n }\n @if (thyTipsMode() === 'default' && tips) {\n <span class=\"form-text text-desc\">{{ tips }}</span>\n }\n </div>\n }\n\n" }]
734
+ }], ctorParameters: () => [], propDecorators: { contentTemplateRef: [{
768
735
  type: ContentChild,
769
736
  args: ['formGroup']
770
737
  }], contentTemplate: [{
@@ -783,7 +750,7 @@ class ThyFormSubmitDirective {
783
750
  /**
784
751
  * Form 验证通过的提交函数
785
752
  */
786
- this.thyFormSubmit = new EventEmitter();
753
+ this.thyFormSubmit = output();
787
754
  }
788
755
  ngOnInit() {
789
756
  this.thyFormDirective.onSubmitSuccess = ($event) => {
@@ -801,9 +768,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
801
768
  args: [{
802
769
  selector: '[thyFormSubmit],[thy-form-submit]'
803
770
  }]
804
- }], propDecorators: { thyFormSubmit: [{
805
- type: Output
806
- }], onSubmit: [{
771
+ }], propDecorators: { onSubmit: [{
807
772
  type: HostListener,
808
773
  args: ['click', ['$event']]
809
774
  }] } });
@@ -819,10 +784,17 @@ class ThyFormGroupFooter {
819
784
  this.defaultConfig = inject(THY_FORM_CONFIG);
820
785
  this._isFormGroup = true;
821
786
  this.isHorizontal = true;
787
+ /**
788
+ * 对齐方式
789
+ * @type left | right | center
790
+ * @default left
791
+ */
792
+ this.thyAlign = input(undefined);
822
793
  this.footerClassMap = {};
823
794
  }
824
795
  get align() {
825
- return !!this.thyAlign ? this.thyAlign : this.defaultConfig.footerAlign;
796
+ const thyAlign = this.thyAlign();
797
+ return !!thyAlign ? thyAlign : this.defaultConfig.footerAlign;
826
798
  }
827
799
  ngOnInit() {
828
800
  if (this.thyParentForm) {
@@ -838,7 +810,7 @@ class ThyFormGroupFooter {
838
810
  };
839
811
  }
840
812
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFormGroupFooter, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
841
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyFormGroupFooter, isStandalone: true, selector: "thy-form-group-footer", inputs: { thyAlign: "thyAlign" }, host: { properties: { "class.form-group": "this._isFormGroup", "class.row": "this.isHorizontal" } }, queries: [{ propertyName: "description", first: true, predicate: ["description"], descendants: true }], ngImport: i0, template: "<div [ngClass]=\"footerClassMap\">\n <div class=\"btn-pair form-footer-actions\">\n <ng-content></ng-content>\n </div>\n\n @if (description) {\n <div class=\"form-footer-description\">\n <ng-container [ngTemplateOutlet]=\"description\"></ng-container>\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
813
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyFormGroupFooter, isStandalone: true, selector: "thy-form-group-footer", inputs: { thyAlign: { classPropertyName: "thyAlign", publicName: "thyAlign", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.form-group": "this._isFormGroup", "class.row": "this.isHorizontal" } }, queries: [{ propertyName: "description", first: true, predicate: ["description"], descendants: true }], ngImport: i0, template: "<div [ngClass]=\"footerClassMap\">\n <div class=\"btn-pair form-footer-actions\">\n <ng-content></ng-content>\n </div>\n\n @if (description) {\n <div class=\"form-footer-description\">\n <ng-container [ngTemplateOutlet]=\"description\"></ng-container>\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None }); }
842
814
  }
843
815
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyFormGroupFooter, decorators: [{
844
816
  type: Component,
@@ -852,8 +824,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
852
824
  }], description: [{
853
825
  type: ContentChild,
854
826
  args: ['description']
855
- }], thyAlign: [{
856
- type: Input
857
827
  }] } });
858
828
 
859
829
  /**
@@ -865,9 +835,10 @@ class ThyUniqueCheckValidator {
865
835
  constructor() {
866
836
  this.elementRef = inject(ElementRef);
867
837
  this.thyForm = inject(ThyFormDirective, { optional: true });
838
+ this.thyUniqueCheck = input(undefined);
868
839
  }
869
840
  validate(ctrl) {
870
- return this.thyUniqueCheck(ctrl.value).pipe(map((failed) => {
841
+ return this.thyUniqueCheck()(ctrl.value).pipe(map((failed) => {
871
842
  setTimeout(() => {
872
843
  if (failed && this.thyForm && this.elementRef.nativeElement.name) {
873
844
  this.thyForm.validator.validateControl(this.elementRef.nativeElement.name);
@@ -877,29 +848,15 @@ class ThyUniqueCheckValidator {
877
848
  }), catchError(() => of(null)));
878
849
  }
879
850
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyUniqueCheckValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
880
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: ThyUniqueCheckValidator, isStandalone: true, selector: "[thyUniqueCheck]", inputs: { thyUniqueCheck: "thyUniqueCheck" }, providers: [
881
- {
882
- provide: NG_ASYNC_VALIDATORS,
883
- useExisting: ThyUniqueCheckValidator,
884
- multi: true
885
- }
886
- ], ngImport: i0 }); }
851
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyUniqueCheckValidator, isStandalone: true, selector: "[thyUniqueCheck]", inputs: { thyUniqueCheck: { classPropertyName: "thyUniqueCheck", publicName: "thyUniqueCheck", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: NG_ASYNC_VALIDATORS, useExisting: ThyUniqueCheckValidator, multi: true }], ngImport: i0 }); }
887
852
  }
888
853
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyUniqueCheckValidator, decorators: [{
889
854
  type: Directive,
890
855
  args: [{
891
856
  selector: '[thyUniqueCheck]',
892
- providers: [
893
- {
894
- provide: NG_ASYNC_VALIDATORS,
895
- useExisting: ThyUniqueCheckValidator,
896
- multi: true
897
- }
898
- ]
857
+ providers: [{ provide: NG_ASYNC_VALIDATORS, useExisting: ThyUniqueCheckValidator, multi: true }]
899
858
  }]
900
- }], propDecorators: { thyUniqueCheck: [{
901
- type: Input
902
- }] } });
859
+ }] });
903
860
 
904
861
  /**
905
862
  * @name min
@@ -987,11 +944,17 @@ function confirmValidator(value) {
987
944
  * @order 25
988
945
  */
989
946
  class ThyConfirmValidatorDirective {
947
+ constructor() {
948
+ /**
949
+ * 表单控件的校验值
950
+ */
951
+ this.confirm = input(undefined);
952
+ }
990
953
  validate(control) {
991
- return confirmValidator(this.confirm)(control);
954
+ return confirmValidator(this.confirm())(control);
992
955
  }
993
956
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyConfirmValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
994
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: ThyConfirmValidatorDirective, isStandalone: true, selector: "[confirm]", inputs: { confirm: "confirm" }, providers: [{ provide: NG_VALIDATORS, useExisting: ThyConfirmValidatorDirective, multi: true }], ngImport: i0 }); }
957
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ThyConfirmValidatorDirective, isStandalone: true, selector: "[confirm]", inputs: { confirm: { classPropertyName: "confirm", publicName: "confirm", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: NG_VALIDATORS, useExisting: ThyConfirmValidatorDirective, multi: true }], ngImport: i0 }); }
995
958
  }
996
959
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyConfirmValidatorDirective, decorators: [{
997
960
  type: Directive,
@@ -1000,9 +963,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
1000
963
  selector: '[confirm]',
1001
964
  providers: [{ provide: NG_VALIDATORS, useExisting: ThyConfirmValidatorDirective, multi: true }]
1002
965
  }]
1003
- }], propDecorators: { confirm: [{
1004
- type: Input
1005
- }] } });
966
+ }] });
1006
967
 
1007
968
  class ThyFormModule {
1008
969
  static forRoot(config) {