ngx-tethys 19.1.0-next.0 → 19.1.0-next.10

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 (221) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/README.md +0 -1
  3. package/action/action.component.d.ts +7 -8
  4. package/affix/affix.component.d.ts +3 -4
  5. package/arrow-switcher/arrow-switcher.component.d.ts +5 -1
  6. package/badge/badge.component.d.ts +1 -1
  7. package/button/button-group.component.d.ts +5 -12
  8. package/button/button-icon.component.d.ts +14 -28
  9. package/button/button.component.d.ts +17 -27
  10. package/color-picker/coordinates.directive.d.ts +1 -2
  11. package/date-picker/abstract-picker.component.d.ts +50 -52
  12. package/date-picker/abstract-picker.directive.d.ts +15 -40
  13. package/date-picker/base-picker.component.d.ts +12 -40
  14. package/date-picker/date-picker.config.d.ts +3 -0
  15. package/date-picker/lib/calendar/calendar-footer.component.d.ts +24 -19
  16. package/date-picker/lib/calendar/calendar-header.component.d.ts +15 -15
  17. package/date-picker/lib/calendar/calendar-table.component.d.ts +15 -16
  18. package/date-picker/lib/date/date-table-cell.component.d.ts +6 -3
  19. package/date-picker/lib/date/date-table.component.d.ts +2 -3
  20. package/date-picker/lib/date-carousel/date-carousel.component.d.ts +2 -3
  21. package/date-picker/lib/decade/decade-header.component.d.ts +2 -5
  22. package/date-picker/lib/decade/decade-table.component.d.ts +3 -5
  23. package/date-picker/lib/month/month-table.component.d.ts +1 -2
  24. package/date-picker/lib/popups/date-popup.component.d.ts +33 -34
  25. package/date-picker/lib/popups/inner-popup.component.d.ts +22 -29
  26. package/date-picker/lib/quarter/quarter-table.component.d.ts +1 -4
  27. package/date-picker/lib/year/year-header.component.d.ts +2 -4
  28. package/date-picker/lib/year/year-table.component.d.ts +2 -4
  29. package/date-picker/month-picker.component.d.ts +2 -2
  30. package/date-picker/picker.component.d.ts +31 -36
  31. package/date-picker/picker.pipes.d.ts +4 -5
  32. package/date-picker/picker.util.d.ts +5 -5
  33. package/date-picker/picker.validators.d.ts +4 -8
  34. package/date-picker/quarter-picker.component.d.ts +2 -3
  35. package/date-picker/styles/calendar.scss +1 -1
  36. package/date-picker/styles/range-picker.scss +1 -0
  37. package/date-picker/styles/week-picker.scss +1 -0
  38. package/date-picker/week-picker.component.d.ts +0 -1
  39. package/date-picker/year-picker.component.d.ts +2 -3
  40. package/dropdown/dropdown-active.directive.d.ts +4 -5
  41. package/dropdown/dropdown-menu-item.directive.d.ts +7 -15
  42. package/dropdown/dropdown-menu.component.d.ts +6 -13
  43. package/dropdown/dropdown-submenu.component.d.ts +2 -4
  44. package/dropdown/dropdown.directive.d.ts +15 -25
  45. package/empty/empty.component.d.ts +2 -1
  46. package/fesm2022/ngx-tethys-action.mjs +15 -16
  47. package/fesm2022/ngx-tethys-action.mjs.map +1 -1
  48. package/fesm2022/ngx-tethys-affix.mjs +14 -18
  49. package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
  50. package/fesm2022/ngx-tethys-arrow-switcher.mjs +15 -3
  51. package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
  52. package/fesm2022/ngx-tethys-autocomplete.mjs +4 -4
  53. package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
  54. package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
  55. package/fesm2022/ngx-tethys-button.mjs +225 -322
  56. package/fesm2022/ngx-tethys-button.mjs.map +1 -1
  57. package/fesm2022/ngx-tethys-carousel.mjs +1 -0
  58. package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
  59. package/fesm2022/ngx-tethys-cascader.mjs +1 -1
  60. package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
  61. package/fesm2022/ngx-tethys-checkbox.mjs +2 -2
  62. package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
  63. package/fesm2022/ngx-tethys-collapse.mjs +2 -2
  64. package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
  65. package/fesm2022/ngx-tethys-color-picker.mjs +4 -6
  66. package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
  67. package/fesm2022/ngx-tethys-copy.mjs +2 -2
  68. package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
  69. package/fesm2022/ngx-tethys-date-picker.mjs +861 -1078
  70. package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
  71. package/fesm2022/ngx-tethys-divider.mjs +5 -5
  72. package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
  73. package/fesm2022/ngx-tethys-dropdown.mjs +159 -209
  74. package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
  75. package/fesm2022/ngx-tethys-empty.mjs +5 -2
  76. package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
  77. package/fesm2022/ngx-tethys-flexible-text.mjs +68 -88
  78. package/fesm2022/ngx-tethys-flexible-text.mjs.map +1 -1
  79. package/fesm2022/ngx-tethys-grid.mjs +10 -15
  80. package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
  81. package/fesm2022/ngx-tethys-i18n.mjs +26 -6
  82. package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
  83. package/fesm2022/ngx-tethys-icon.mjs +44 -59
  84. package/fesm2022/ngx-tethys-icon.mjs.map +1 -1
  85. package/fesm2022/ngx-tethys-image.mjs +44 -42
  86. package/fesm2022/ngx-tethys-image.mjs.map +1 -1
  87. package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
  88. package/fesm2022/ngx-tethys-layout.mjs +291 -334
  89. package/fesm2022/ngx-tethys-layout.mjs.map +1 -1
  90. package/fesm2022/ngx-tethys-list.mjs +183 -217
  91. package/fesm2022/ngx-tethys-list.mjs.map +1 -1
  92. package/fesm2022/ngx-tethys-message.mjs +29 -36
  93. package/fesm2022/ngx-tethys-message.mjs.map +1 -1
  94. package/fesm2022/ngx-tethys-notify.mjs +33 -41
  95. package/fesm2022/ngx-tethys-notify.mjs.map +1 -1
  96. package/fesm2022/ngx-tethys-progress.mjs +7 -11
  97. package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
  98. package/fesm2022/ngx-tethys-property.mjs +8 -19
  99. package/fesm2022/ngx-tethys-property.mjs.map +1 -1
  100. package/fesm2022/ngx-tethys-radio.mjs +46 -58
  101. package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
  102. package/fesm2022/ngx-tethys-rate.mjs +115 -157
  103. package/fesm2022/ngx-tethys-rate.mjs.map +1 -1
  104. package/fesm2022/ngx-tethys-resizable.mjs +100 -143
  105. package/fesm2022/ngx-tethys-resizable.mjs.map +1 -1
  106. package/fesm2022/ngx-tethys-segment.mjs +84 -103
  107. package/fesm2022/ngx-tethys-segment.mjs.map +1 -1
  108. package/fesm2022/ngx-tethys-select.mjs +164 -228
  109. package/fesm2022/ngx-tethys-select.mjs.map +1 -1
  110. package/fesm2022/ngx-tethys-shared.mjs +423 -586
  111. package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
  112. package/fesm2022/ngx-tethys-skeleton.mjs +1 -2
  113. package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
  114. package/fesm2022/ngx-tethys-slide.mjs +37 -56
  115. package/fesm2022/ngx-tethys-slide.mjs.map +1 -1
  116. package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
  117. package/fesm2022/ngx-tethys-space.mjs +2 -8
  118. package/fesm2022/ngx-tethys-space.mjs.map +1 -1
  119. package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
  120. package/fesm2022/ngx-tethys-strength.mjs +52 -66
  121. package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
  122. package/fesm2022/ngx-tethys-table.mjs +1 -2
  123. package/fesm2022/ngx-tethys-table.mjs.map +1 -1
  124. package/fesm2022/ngx-tethys-time-picker.mjs +244 -271
  125. package/fesm2022/ngx-tethys-time-picker.mjs.map +1 -1
  126. package/fesm2022/ngx-tethys-tooltip.mjs +109 -93
  127. package/fesm2022/ngx-tethys-tooltip.mjs.map +1 -1
  128. package/fesm2022/ngx-tethys-transfer.mjs +98 -119
  129. package/fesm2022/ngx-tethys-transfer.mjs.map +1 -1
  130. package/fesm2022/ngx-tethys-tree-select.mjs +216 -284
  131. package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
  132. package/fesm2022/ngx-tethys-tree.mjs +281 -401
  133. package/fesm2022/ngx-tethys-tree.mjs.map +1 -1
  134. package/fesm2022/ngx-tethys-upload.mjs +2 -2
  135. package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
  136. package/fesm2022/ngx-tethys-vote.mjs +53 -99
  137. package/fesm2022/ngx-tethys-vote.mjs.map +1 -1
  138. package/fesm2022/ngx-tethys.mjs +1 -1
  139. package/fesm2022/ngx-tethys.mjs.map +1 -1
  140. package/flexible-text/flexible-text.component.d.ts +9 -15
  141. package/grid/flex.d.ts +1 -3
  142. package/grid/thy-row.directive.d.ts +1 -4
  143. package/i18n/i18n.d.ts +7 -2
  144. package/i18n/locales/de-de.d.ts +5 -1
  145. package/i18n/locales/en-us.d.ts +5 -1
  146. package/i18n/locales/ja-jp.d.ts +5 -1
  147. package/i18n/locales/zh-hans.d.ts +5 -1
  148. package/i18n/locales/zh-hant.d.ts +5 -1
  149. package/icon/icon.component.d.ts +10 -18
  150. package/image/image.directive.d.ts +10 -13
  151. package/image/image.token.d.ts +5 -5
  152. package/image/preview/image-preview.component.d.ts +2 -2
  153. package/input-number/input-number.component.d.ts +1 -1
  154. package/layout/header.component.d.ts +15 -19
  155. package/layout/layout.component.d.ts +3 -2
  156. package/layout/sidebar-header.component.d.ts +7 -8
  157. package/layout/sidebar.component.d.ts +32 -62
  158. package/list/list-item-meta.component.d.ts +7 -9
  159. package/list/list-item.component.d.ts +0 -2
  160. package/list/list.component.d.ts +2 -8
  161. package/list/selection/selection-list.d.ts +33 -46
  162. package/message/abstract/abstract-message.component.d.ts +2 -3
  163. package/message/message-container.component.d.ts +0 -1
  164. package/message/message.component.d.ts +1 -3
  165. package/notify/notify-container.component.d.ts +0 -1
  166. package/notify/notify.component.d.ts +7 -12
  167. package/package.json +1 -1
  168. package/progress/progress-circle.component.d.ts +3 -5
  169. package/progress/progress.component.d.ts +2 -4
  170. package/property/properties.component.d.ts +0 -2
  171. package/property/property-item.component.d.ts +3 -10
  172. package/radio/group/radio-group.component.d.ts +5 -9
  173. package/rate/rate-item.component.d.ts +8 -11
  174. package/rate/rate.component.d.ts +18 -29
  175. package/resizable/resizable.directive.d.ts +20 -32
  176. package/resizable/resize-handle.component.d.ts +6 -7
  177. package/resizable/resize-handles.component.d.ts +5 -9
  178. package/schematics/version.d.ts +1 -1
  179. package/schematics/version.js +1 -1
  180. package/segment/segment-item.component.d.ts +9 -15
  181. package/segment/segment.component.d.ts +11 -15
  182. package/segment/segment.token.d.ts +4 -3
  183. package/select/custom-select/custom-select.component.d.ts +33 -56
  184. package/select/native-select/native-select.component.d.ts +7 -13
  185. package/shared/base-form-check.component.d.ts +6 -8
  186. package/shared/directives/string-or-template-outlet.directive.d.ts +5 -6
  187. package/shared/directives/thy-autofocus.directive.d.ts +4 -6
  188. package/shared/directives/thy-contextmenu.directive.d.ts +2 -2
  189. package/shared/directives/thy-ctrl-enter.directive.d.ts +2 -2
  190. package/shared/directives/thy-enter.directive.d.ts +2 -2
  191. package/shared/directives/thy-scroll.directive.d.ts +5 -8
  192. package/shared/directives/thy-show.d.ts +5 -6
  193. package/shared/directives/thy-stop-propagation.directive.d.ts +4 -4
  194. package/shared/directives/view-outlet.directive.d.ts +6 -7
  195. package/shared/ng-transclude.directive.d.ts +2 -3
  196. package/shared/option/group/option-group.component.d.ts +5 -9
  197. package/shared/option/list-option/list-option.component.d.ts +9 -13
  198. package/shared/option/option.component.d.ts +10 -17
  199. package/shared/option/option.token.d.ts +4 -3
  200. package/shared/option/options-container.component.d.ts +1 -1
  201. package/shared/select/select-control/select-control.component.d.ts +38 -53
  202. package/slide/slide-body/slide-body-section.component.d.ts +2 -6
  203. package/slide/slide-header/slide-header.component.d.ts +6 -9
  204. package/space/space.component.d.ts +5 -11
  205. package/stepper/stepper.component.d.ts +1 -1
  206. package/strength/strength.component.d.ts +8 -13
  207. package/table/table-column.component.d.ts +15 -5
  208. package/time-picker/inner/inner-time-picker.class.d.ts +15 -13
  209. package/time-picker/inner/inner-time-picker.component.d.ts +26 -26
  210. package/time-picker/time-picker-panel.component.d.ts +18 -20
  211. package/time-picker/time-picker.component.d.ts +22 -30
  212. package/tooltip/tooltip.directive.d.ts +20 -22
  213. package/transfer/transfer-list.component.d.ts +15 -15
  214. package/transfer/transfer.component.d.ts +20 -23
  215. package/tree/tree-abstract.d.ts +5 -5
  216. package/tree/tree-node.component.d.ts +24 -37
  217. package/tree/tree.class.d.ts +4 -4
  218. package/tree/tree.component.d.ts +47 -75
  219. package/tree/tree.service.d.ts +3 -4
  220. package/tree-select/tree-select.component.d.ts +54 -71
  221. package/vote/vote.component.d.ts +13 -33
@@ -1,6 +1,6 @@
1
1
  import { NgTemplateOutlet, NgClass, CommonModule } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { EventEmitter, Output, Input, Component, inject, ChangeDetectorRef, TemplateRef, forwardRef, numberAttribute, HostBinding, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
+ import { input, output, Component, inject, ChangeDetectorRef, model, numberAttribute, computed, TemplateRef, effect, forwardRef, Input, ChangeDetectionStrategy, NgModule } from '@angular/core';
4
4
  import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
5
5
  import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
6
6
  import { ThyStopPropagationDirective, ThySharedModule } from 'ngx-tethys/shared';
@@ -13,24 +13,25 @@ import { TabIndexDisabledControlValueAccessorMixin } from 'ngx-tethys/core';
13
13
  */
14
14
  class ThyRateItem {
15
15
  constructor() {
16
- this.allowHalf = false;
17
- this.itemHover = new EventEmitter();
18
- this.itemClick = new EventEmitter();
16
+ this.allowHalf = input(false, { transform: coerceBooleanProperty });
17
+ this.iconValue = input();
18
+ this.iconTemplate = input();
19
+ this.itemHover = output();
20
+ this.itemClick = output();
19
21
  }
20
- ngOnInit() { }
21
22
  hoverRateItem(isHalf) {
22
- this.itemHover.next(isHalf && this.allowHalf);
23
+ this.itemHover.emit(isHalf && this.allowHalf());
23
24
  }
24
25
  clickRateItem(isHalf) {
25
- this.itemClick.next(isHalf && this.allowHalf);
26
+ this.itemClick.emit(isHalf && this.allowHalf());
26
27
  }
27
28
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyRateItem, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
28
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.8", type: ThyRateItem, isStandalone: true, selector: "thy-rate-item, [thy-rate-item]", inputs: { allowHalf: ["allowHalf", "allowHalf", coerceBooleanProperty], iconValue: "iconValue", iconTemplate: "iconTemplate" }, outputs: { itemHover: "itemHover", itemClick: "itemClick" }, ngImport: i0, template: `
29
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: ThyRateItem, isStandalone: true, selector: "thy-rate-item, [thy-rate-item]", inputs: { allowHalf: { classPropertyName: "allowHalf", publicName: "allowHalf", isSignal: true, isRequired: false, transformFunction: null }, iconValue: { classPropertyName: "iconValue", publicName: "iconValue", isSignal: true, isRequired: false, transformFunction: null }, iconTemplate: { classPropertyName: "iconTemplate", publicName: "iconTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemHover: "itemHover", itemClick: "itemClick" }, ngImport: i0, template: `
29
30
  <div class="thy-rate-item-left" thyStopPropagation (mouseover)="hoverRateItem(true)" (click)="clickRateItem(true)">
30
- <ng-template [ngTemplateOutlet]="iconTemplate || (iconValue && character) || defaultTemplate"></ng-template>
31
+ <ng-template [ngTemplateOutlet]="iconTemplate() || (iconValue() && character) || defaultTemplate"></ng-template>
31
32
  </div>
32
33
  <div class="thy-rate-item-all" thyStopPropagation (mouseover)="hoverRateItem(false)" (click)="clickRateItem(false)">
33
- <ng-template [ngTemplateOutlet]="iconTemplate || (iconValue && character) || defaultTemplate"></ng-template>
34
+ <ng-template [ngTemplateOutlet]="iconTemplate() || (iconValue() && character) || defaultTemplate"></ng-template>
34
35
  </div>
35
36
 
36
37
  <ng-template #defaultTemplate>
@@ -38,7 +39,7 @@ class ThyRateItem {
38
39
  </ng-template>
39
40
 
40
41
  <ng-template #character>
41
- <thy-icon [thyIconName]="iconValue"></thy-icon>
42
+ <thy-icon [thyIconName]="iconValue()"></thy-icon>
42
43
  </ng-template>
43
44
  `, isInline: true, dependencies: [{ kind: "directive", type: ThyStopPropagationDirective, selector: "[thyStopPropagation]", inputs: ["thyStopPropagation"] }, { 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"] }] }); }
44
45
  }
@@ -48,10 +49,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
48
49
  selector: 'thy-rate-item, [thy-rate-item]',
49
50
  template: `
50
51
  <div class="thy-rate-item-left" thyStopPropagation (mouseover)="hoverRateItem(true)" (click)="clickRateItem(true)">
51
- <ng-template [ngTemplateOutlet]="iconTemplate || (iconValue && character) || defaultTemplate"></ng-template>
52
+ <ng-template [ngTemplateOutlet]="iconTemplate() || (iconValue() && character) || defaultTemplate"></ng-template>
52
53
  </div>
53
54
  <div class="thy-rate-item-all" thyStopPropagation (mouseover)="hoverRateItem(false)" (click)="clickRateItem(false)">
54
- <ng-template [ngTemplateOutlet]="iconTemplate || (iconValue && character) || defaultTemplate"></ng-template>
55
+ <ng-template [ngTemplateOutlet]="iconTemplate() || (iconValue() && character) || defaultTemplate"></ng-template>
55
56
  </div>
56
57
 
57
58
  <ng-template #defaultTemplate>
@@ -59,23 +60,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
59
60
  </ng-template>
60
61
 
61
62
  <ng-template #character>
62
- <thy-icon [thyIconName]="iconValue"></thy-icon>
63
+ <thy-icon [thyIconName]="iconValue()"></thy-icon>
63
64
  </ng-template>
64
65
  `,
65
66
  imports: [ThyStopPropagationDirective, NgTemplateOutlet, ThyIcon]
66
67
  }]
67
- }], ctorParameters: () => [], propDecorators: { allowHalf: [{
68
- type: Input,
69
- args: [{ transform: coerceBooleanProperty }]
70
- }], iconValue: [{
71
- type: Input
72
- }], iconTemplate: [{
73
- type: Input
74
- }], itemHover: [{
75
- type: Output
76
- }], itemClick: [{
77
- type: Output
78
- }] } });
68
+ }], ctorParameters: () => [] });
79
69
 
80
70
  const noop = () => { };
81
71
  /**
@@ -94,170 +84,157 @@ class ThyRate extends TabIndexDisabledControlValueAccessorMixin {
94
84
  get thyDisabled() {
95
85
  return this.disabled;
96
86
  }
97
- /**
98
- * 自定义模板,目前支持传单个模板或图标名称、数组(模板 | 图标名称)
99
- * @type string | TemplateRef<any> | string[] | TemplateRef<any>[]
100
- */
101
- set thyIconTemplate(value) {
102
- this.icons = value;
103
- if (!this.icons) {
104
- this.iconValue = null;
105
- this.iconTemplate = null;
106
- }
107
- else {
108
- this.setIconTemplate();
109
- }
110
- }
111
87
  constructor() {
112
88
  super();
113
89
  this.cdr = inject(ChangeDetectorRef);
114
- this._value = 0;
115
- this.currentValue = 0;
116
- this.hasHalf = false;
117
- this.rateArray = [];
118
- this.rateStyleArray = [];
119
- this.icons = null;
120
- this.iconValue = null;
121
- this.iconTemplate = null;
90
+ this.thyValue = model(0);
91
+ this.currentValue = model(0);
92
+ this.hasHalf = model(false);
122
93
  this.onTouchedCallback = noop;
123
94
  this.onChangeCallback = noop;
124
95
  /**
125
96
  * 自定义评分的总数
126
97
  */
127
- this.thyCount = 5;
98
+ this.thyCount = input(5, { transform: numberAttribute });
128
99
  this.disabled = false;
129
100
  /**
130
101
  * 是否允许半选
131
102
  * @default false
132
103
  */
133
- this.thyAllowHalf = false;
104
+ this.thyAllowHalf = input(false, { transform: coerceBooleanProperty });
134
105
  /**
135
106
  * 是否允许再次点击后清除
136
107
  */
137
- this.thyAllowClear = true;
108
+ this.thyAllowClear = input(true, { transform: coerceBooleanProperty });
138
109
  /**
139
110
  * 自定义每项的提示信息
140
111
  * @type string[]
141
112
  */
142
- this.thyTooltips = [];
113
+ this.thyTooltips = input([]);
114
+ /**
115
+ * 自定义模板,目前支持传单个模板或图标名称、数组(模板 | 图标名称)
116
+ * @type string | TemplateRef<any> | string[] | TemplateRef<any>[]
117
+ */
118
+ this.thyIconTemplate = input(null);
143
119
  /**
144
120
  * 当前值hover时的回调
145
121
  */
146
- this.thyItemHoverChange = new EventEmitter();
147
- this.className = true;
148
- }
149
- get thyValue() {
150
- return this._value;
151
- }
152
- set thyValue(value) {
153
- if (this._value === value) {
154
- return;
155
- }
156
- this._value = value;
157
- this.hasHalf = !Number.isInteger(value);
158
- this.currentValue = Math.ceil(value);
122
+ this.thyItemHoverChange = output();
123
+ this.iconValue = computed(() => {
124
+ const icons = this.thyIconTemplate();
125
+ const currentValue = this.currentValue();
126
+ if (!icons) {
127
+ return null;
128
+ }
129
+ else {
130
+ let iconValue = null;
131
+ if (helpers.isArray(icons) && icons.length > 0) {
132
+ const currentIcon = (currentValue && currentValue - 1) || 0;
133
+ iconValue = icons[currentIcon];
134
+ }
135
+ else if (!helpers.isArray(icons)) {
136
+ iconValue = icons;
137
+ }
138
+ if (iconValue instanceof TemplateRef) {
139
+ return null;
140
+ }
141
+ else {
142
+ return iconValue;
143
+ }
144
+ }
145
+ });
146
+ this.iconTemplate = computed(() => {
147
+ const icons = this.thyIconTemplate();
148
+ const currentValue = this.currentValue();
149
+ if (!icons) {
150
+ return null;
151
+ }
152
+ else {
153
+ let iconTemplate = null;
154
+ if (helpers.isArray(icons) && icons.length > 0) {
155
+ const currentIcon = (currentValue && currentValue - 1) || 0;
156
+ iconTemplate = icons[currentIcon];
157
+ }
158
+ else if (!helpers.isArray(icons)) {
159
+ iconTemplate = icons;
160
+ }
161
+ if (iconTemplate instanceof TemplateRef) {
162
+ return iconTemplate;
163
+ }
164
+ else {
165
+ return null;
166
+ }
167
+ }
168
+ });
169
+ this.rateArray = computed(() => {
170
+ return this.updateRateArray();
171
+ });
172
+ this.rateStyleArray = computed(() => {
173
+ return this.updateItemStyle();
174
+ });
175
+ effect(() => {
176
+ this.hasHalf.set(!Number.isInteger(this.thyValue()));
177
+ this.currentValue.set(Math.ceil(this.thyValue()));
178
+ });
159
179
  }
160
180
  writeValue(value) {
161
- this.thyValue = value || 0;
162
- this.updateRateArray();
181
+ this.thyValue.set(value || 0);
163
182
  this.cdr.markForCheck();
164
183
  }
165
- ngOnInit() { }
166
- ngOnChanges(changes) {
167
- const { thyCount, thyValue } = changes;
168
- if (thyCount) {
169
- this.updateRateArray();
170
- }
171
- if (thyValue) {
172
- this.updateItemStyle();
173
- }
174
- this.cdr.detectChanges();
175
- }
176
184
  itemHover(isHalf, index) {
177
- if (this.thyDisabled || (this.currentValue === index + 1 && this.hasHalf === isHalf)) {
185
+ if (this.thyDisabled || (this.currentValue() === index + 1 && this.hasHalf() === isHalf)) {
178
186
  return;
179
187
  }
180
- this.currentValue = index + 1;
181
- this.hasHalf = isHalf;
182
- const _value = isHalf ? Number(this.currentValue - 0.5) : this.currentValue;
188
+ this.currentValue.set(index + 1);
189
+ this.hasHalf.set(isHalf);
190
+ const _value = isHalf ? Number(this.currentValue() - 0.5) : this.currentValue();
183
191
  this.thyItemHoverChange.emit(_value);
184
- this.updateItemStyle();
185
192
  }
186
193
  itemClick(isHalf, index) {
187
194
  if (this.thyDisabled) {
188
195
  return;
189
196
  }
190
- this.currentValue = index + 1;
197
+ this.currentValue.set(index + 1);
191
198
  const _value = isHalf ? index + 1 - 0.5 : index + 1;
192
- if (this.thyValue === _value) {
193
- if (this.thyAllowClear) {
194
- this.thyValue = 0;
195
- this.onChangeCallback(this.thyValue);
199
+ if (this.thyValue() === _value) {
200
+ if (this.thyAllowClear()) {
201
+ this.thyValue.set(0);
202
+ this.onChangeCallback(this.thyValue());
196
203
  this.onTouchedCallback();
197
204
  }
198
205
  }
199
206
  else {
200
- this.thyValue = _value;
201
- this.onChangeCallback(this.thyValue);
207
+ this.thyValue.set(_value);
208
+ this.onChangeCallback(this.thyValue());
202
209
  this.onTouchedCallback();
203
210
  }
204
- this.updateItemStyle();
205
211
  }
206
212
  onRateLeave(event) {
207
213
  event.stopPropagation();
208
- this.hasHalf = !Number.isInteger(this.thyValue);
209
- this.currentValue = Math.ceil(this.thyValue);
210
- this.updateItemStyle();
214
+ this.hasHalf.set(!Number.isInteger(this.thyValue()));
215
+ this.currentValue.set(Math.ceil(this.thyValue()));
211
216
  }
212
217
  updateRateArray() {
213
- this.rateArray = Array(this.thyCount)
214
- .fill(0)
215
- .map((_, i) => {
216
- return i;
217
- });
218
- this.updateItemStyle();
218
+ return this.thyCount() > 0
219
+ ? Array(this.thyCount())
220
+ .fill(0)
221
+ .map((_, i) => {
222
+ return i;
223
+ })
224
+ : [];
219
225
  }
220
226
  updateItemStyle() {
221
- this.updateIcon();
222
227
  const rateStyle = 'thy-rate-star';
223
- this.rateStyleArray = this.rateArray.map(i => {
228
+ return this.rateArray().map(i => {
224
229
  const value = i + 1;
225
230
  return {
226
- [`${rateStyle}--full`]: value < this.currentValue || (value === this.currentValue && !this.hasHalf),
227
- [`${rateStyle}--half`]: this.hasHalf && value === this.currentValue,
228
- [`${rateStyle}--active`]: this.hasHalf && value === this.currentValue,
229
- [`${rateStyle}--zero`]: value > this.currentValue
231
+ [`${rateStyle}--full`]: value < this.currentValue() || (value === this.currentValue() && !this.hasHalf()),
232
+ [`${rateStyle}--half`]: this.hasHalf() && value === this.currentValue(),
233
+ [`${rateStyle}--active`]: this.hasHalf() && value === this.currentValue(),
234
+ [`${rateStyle}--zero`]: value > this.currentValue()
230
235
  };
231
236
  });
232
237
  }
233
- updateIcon() {
234
- if (!this.icons) {
235
- this.iconValue = null;
236
- this.iconTemplate = null;
237
- }
238
- else {
239
- this.setIconTemplate();
240
- }
241
- }
242
- setIconTemplate() {
243
- if (helpers.isArray(this.icons) && this.icons.length > 0) {
244
- const currentIcon = (this.currentValue && this.currentValue - 1) || 0;
245
- if (this.icons[currentIcon] instanceof TemplateRef) {
246
- this.iconTemplate = this.icons[currentIcon];
247
- }
248
- else {
249
- this.iconValue = this.icons[currentIcon];
250
- }
251
- }
252
- else if (!helpers.isArray(this.icons)) {
253
- if (this.icons instanceof TemplateRef) {
254
- this.iconTemplate = this.icons;
255
- }
256
- else {
257
- this.iconValue = this.icons;
258
- }
259
- }
260
- }
261
238
  registerOnChange(fn) {
262
239
  this.onChangeCallback = fn;
263
240
  }
@@ -268,13 +245,13 @@ class ThyRate extends TabIndexDisabledControlValueAccessorMixin {
268
245
  return item || index;
269
246
  }
270
247
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyRate, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
271
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyRate, isStandalone: true, selector: "thy-rate", inputs: { thyCount: ["thyCount", "thyCount", numberAttribute], thyDisabled: ["thyDisabled", "thyDisabled", coerceBooleanProperty], thyAllowHalf: ["thyAllowHalf", "thyAllowHalf", coerceBooleanProperty], thyAllowClear: ["thyAllowClear", "thyAllowClear", coerceBooleanProperty], thyTooltips: "thyTooltips", thyIconTemplate: "thyIconTemplate" }, outputs: { thyItemHoverChange: "thyItemHoverChange" }, host: { properties: { "attr.tabindex": "tabIndex", "class.thy-rate": "this.className" }, classAttribute: "thy-rate" }, providers: [
248
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyRate, isStandalone: true, selector: "thy-rate", inputs: { thyValue: { classPropertyName: "thyValue", publicName: "thyValue", isSignal: true, isRequired: false, transformFunction: null }, currentValue: { classPropertyName: "currentValue", publicName: "currentValue", isSignal: true, isRequired: false, transformFunction: null }, hasHalf: { classPropertyName: "hasHalf", publicName: "hasHalf", isSignal: true, isRequired: false, transformFunction: null }, thyCount: { classPropertyName: "thyCount", publicName: "thyCount", isSignal: true, isRequired: false, transformFunction: null }, thyDisabled: { classPropertyName: "thyDisabled", publicName: "thyDisabled", isSignal: false, isRequired: false, transformFunction: coerceBooleanProperty }, thyAllowHalf: { classPropertyName: "thyAllowHalf", publicName: "thyAllowHalf", isSignal: true, isRequired: false, transformFunction: null }, thyAllowClear: { classPropertyName: "thyAllowClear", publicName: "thyAllowClear", isSignal: true, isRequired: false, transformFunction: null }, thyTooltips: { classPropertyName: "thyTooltips", publicName: "thyTooltips", isSignal: true, isRequired: false, transformFunction: null }, thyIconTemplate: { classPropertyName: "thyIconTemplate", publicName: "thyIconTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thyValue: "thyValueChange", currentValue: "currentValueChange", hasHalf: "hasHalfChange", thyItemHoverChange: "thyItemHoverChange" }, host: { properties: { "attr.tabindex": "tabIndex" }, classAttribute: "thy-rate" }, providers: [
272
249
  {
273
250
  provide: NG_VALUE_ACCESSOR,
274
251
  useExisting: forwardRef(() => ThyRate),
275
252
  multi: true
276
253
  }
277
- ], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"thy-rate-container\" [class.thy-rate-container--disabled]=\"thyDisabled\" (mouseleave)=\"onRateLeave($event)\">\n @for (star of rateArray; track trackByFn(index, star); let index = $index) {\n <div\n thyStopPropagation\n class=\"thy-rate-star\"\n [ngClass]=\"rateStyleArray[index] || ''\"\n thy-rate-item\n [allowHalf]=\"thyAllowHalf\"\n [iconValue]=\"iconValue\"\n [iconTemplate]=\"iconTemplate\"\n (itemHover)=\"itemHover($event, index)\"\n (itemClick)=\"itemClick($event, index)\"\n [thyTooltip]=\"thyTooltips[index]\"\n thyTooltipPlacement=\"top\"\n ></div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: ThyStopPropagationDirective, selector: "[thyStopPropagation]", inputs: ["thyStopPropagation"] }, { kind: "component", type: ThyRateItem, selector: "thy-rate-item, [thy-rate-item]", inputs: ["allowHalf", "iconValue", "iconTemplate"], outputs: ["itemHover", "itemClick"] }, { 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 }); }
254
+ ], usesInheritance: true, ngImport: i0, template: "<div class=\"thy-rate-container\" [class.thy-rate-container--disabled]=\"thyDisabled\" (mouseleave)=\"onRateLeave($event)\">\n @for (star of rateArray(); track trackByFn(index, star); let index = $index) {\n <div\n thyStopPropagation\n class=\"thy-rate-star\"\n [ngClass]=\"rateStyleArray()[index] || ''\"\n thy-rate-item\n [allowHalf]=\"thyAllowHalf()\"\n [iconValue]=\"iconValue()\"\n [iconTemplate]=\"iconTemplate()\"\n (itemHover)=\"itemHover($event, index)\"\n (itemClick)=\"itemClick($event, index)\"\n [thyTooltip]=\"thyTooltips()[index]\"\n thyTooltipPlacement=\"top\"\n ></div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: ThyStopPropagationDirective, selector: "[thyStopPropagation]", inputs: ["thyStopPropagation"] }, { kind: "component", type: ThyRateItem, selector: "thy-rate-item, [thy-rate-item]", inputs: ["allowHalf", "iconValue", "iconTemplate"], outputs: ["itemHover", "itemClick"] }, { 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 }); }
278
255
  }
279
256
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyRate, decorators: [{
280
257
  type: Component,
@@ -287,29 +264,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
287
264
  ], host: {
288
265
  '[attr.tabindex]': `tabIndex`,
289
266
  class: 'thy-rate'
290
- }, changeDetection: ChangeDetectionStrategy.OnPush, imports: [ThyStopPropagationDirective, ThyRateItem, NgClass, ThyTooltipDirective], template: "<div class=\"thy-rate-container\" [class.thy-rate-container--disabled]=\"thyDisabled\" (mouseleave)=\"onRateLeave($event)\">\n @for (star of rateArray; track trackByFn(index, star); let index = $index) {\n <div\n thyStopPropagation\n class=\"thy-rate-star\"\n [ngClass]=\"rateStyleArray[index] || ''\"\n thy-rate-item\n [allowHalf]=\"thyAllowHalf\"\n [iconValue]=\"iconValue\"\n [iconTemplate]=\"iconTemplate\"\n (itemHover)=\"itemHover($event, index)\"\n (itemClick)=\"itemClick($event, index)\"\n [thyTooltip]=\"thyTooltips[index]\"\n thyTooltipPlacement=\"top\"\n ></div>\n }\n</div>\n" }]
291
- }], ctorParameters: () => [], propDecorators: { thyCount: [{
292
- type: Input,
293
- args: [{ transform: numberAttribute }]
294
- }], thyDisabled: [{
295
- type: Input,
296
- args: [{ transform: coerceBooleanProperty }]
297
- }], thyAllowHalf: [{
267
+ }, changeDetection: ChangeDetectionStrategy.OnPush, imports: [ThyStopPropagationDirective, ThyRateItem, NgClass, ThyTooltipDirective], template: "<div class=\"thy-rate-container\" [class.thy-rate-container--disabled]=\"thyDisabled\" (mouseleave)=\"onRateLeave($event)\">\n @for (star of rateArray(); track trackByFn(index, star); let index = $index) {\n <div\n thyStopPropagation\n class=\"thy-rate-star\"\n [ngClass]=\"rateStyleArray()[index] || ''\"\n thy-rate-item\n [allowHalf]=\"thyAllowHalf()\"\n [iconValue]=\"iconValue()\"\n [iconTemplate]=\"iconTemplate()\"\n (itemHover)=\"itemHover($event, index)\"\n (itemClick)=\"itemClick($event, index)\"\n [thyTooltip]=\"thyTooltips()[index]\"\n thyTooltipPlacement=\"top\"\n ></div>\n }\n</div>\n" }]
268
+ }], ctorParameters: () => [], propDecorators: { thyDisabled: [{
298
269
  type: Input,
299
270
  args: [{ transform: coerceBooleanProperty }]
300
- }], thyAllowClear: [{
301
- type: Input,
302
- args: [{ transform: coerceBooleanProperty }]
303
- }], thyTooltips: [{
304
- type: Input
305
- }], thyIconTemplate: [{
306
- type: Input,
307
- args: ['thyIconTemplate']
308
- }], thyItemHoverChange: [{
309
- type: Output
310
- }], className: [{
311
- type: HostBinding,
312
- args: ['class.thy-rate']
313
271
  }] } });
314
272
 
315
273
  class ThyRateModule {
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys-rate.mjs","sources":["../../../src/rate/rate-item.component.ts","../../../src/rate/rate.component.ts","../../../src/rate/rate.component.html","../../../src/rate/module.ts","../../../src/rate/ngx-tethys-rate.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output, TemplateRef } from '@angular/core';\nimport { ThyIcon } from 'ngx-tethys/icon';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ThyStopPropagationDirective } from 'ngx-tethys/shared';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\n/**\n * @private\n */\n@Component({\n selector: 'thy-rate-item, [thy-rate-item]',\n template: `\n <div class=\"thy-rate-item-left\" thyStopPropagation (mouseover)=\"hoverRateItem(true)\" (click)=\"clickRateItem(true)\">\n <ng-template [ngTemplateOutlet]=\"iconTemplate || (iconValue && character) || defaultTemplate\"></ng-template>\n </div>\n <div class=\"thy-rate-item-all\" thyStopPropagation (mouseover)=\"hoverRateItem(false)\" (click)=\"clickRateItem(false)\">\n <ng-template [ngTemplateOutlet]=\"iconTemplate || (iconValue && character) || defaultTemplate\"></ng-template>\n </div>\n\n <ng-template #defaultTemplate>\n <thy-icon thyIconName=\"star-fill\"></thy-icon>\n </ng-template>\n\n <ng-template #character>\n <thy-icon [thyIconName]=\"iconValue\"></thy-icon>\n </ng-template>\n `,\n imports: [ThyStopPropagationDirective, NgTemplateOutlet, ThyIcon]\n})\nexport class ThyRateItem implements OnInit {\n @Input({ transform: coerceBooleanProperty }) allowHalf = false;\n\n @Input() iconValue: string;\n\n @Input() iconTemplate: TemplateRef<any>;\n\n @Output() readonly itemHover = new EventEmitter<boolean>();\n\n @Output() readonly itemClick = new EventEmitter<boolean>();\n\n constructor() {}\n\n ngOnInit() {}\n\n hoverRateItem(isHalf: boolean): void {\n this.itemHover.next(isHalf && this.allowHalf);\n }\n\n clickRateItem(isHalf: boolean): void {\n this.itemClick.next(isHalf && this.allowHalf);\n }\n}\n","import { TabIndexDisabledControlValueAccessorMixin } from 'ngx-tethys/core';\nimport { coerceBooleanProperty, helpers } from 'ngx-tethys/util';\n\nimport { NgClass } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n forwardRef,\n HostBinding,\n Input,\n numberAttribute,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges,\n TemplateRef,\n inject\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ThyStopPropagationDirective } from 'ngx-tethys/shared';\nimport { ThyTooltipDirective } from 'ngx-tethys/tooltip';\nimport { ThyRateItem } from './rate-item.component';\n\nconst noop = () => {};\n\n/**\n * 评分组件\n * @name thy-rate\n * @order 10\n */\n@Component({\n selector: 'thy-rate',\n templateUrl: './rate.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ThyRate),\n multi: true\n }\n ],\n host: {\n '[attr.tabindex]': `tabIndex`,\n class: 'thy-rate'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ThyStopPropagationDirective, ThyRateItem, NgClass, ThyTooltipDirective]\n})\nexport class ThyRate extends TabIndexDisabledControlValueAccessorMixin implements ControlValueAccessor, OnInit, OnChanges {\n private cdr = inject(ChangeDetectorRef);\n\n private _value = 0;\n\n private currentValue = 0;\n\n private hasHalf = false;\n\n public rateArray: number[] = [];\n\n public rateStyleArray: Record<string, boolean>[] = [];\n\n private icons: string | TemplateRef<any> | string[] | TemplateRef<any>[] = null;\n\n public iconValue: string = null;\n\n public iconTemplate: TemplateRef<any> = null;\n\n private onTouchedCallback: () => void = noop;\n\n private onChangeCallback: (_: any) => void = noop;\n\n /**\n * 自定义评分的总数\n */\n @Input({ transform: numberAttribute }) thyCount = 5;\n\n /**\n * 是否只读\n * @default false\n */\n @Input({ transform: coerceBooleanProperty })\n override set thyDisabled(value: boolean) {\n this.disabled = value;\n }\n override get thyDisabled(): boolean {\n return this.disabled;\n }\n\n disabled = false;\n\n /**\n * 是否允许半选\n * @default false\n */\n @Input({ transform: coerceBooleanProperty }) thyAllowHalf = false;\n\n /**\n * 是否允许再次点击后清除\n */\n @Input({ transform: coerceBooleanProperty }) thyAllowClear = true;\n\n /**\n * 自定义每项的提示信息\n * @type string[]\n */\n @Input() thyTooltips: string[] = [];\n\n /**\n * 自定义模板,目前支持传单个模板或图标名称、数组(模板 | 图标名称)\n * @type string | TemplateRef<any> | string[] | TemplateRef<any>[]\n */\n @Input('thyIconTemplate')\n set thyIconTemplate(value: string | TemplateRef<any> | string[] | TemplateRef<any>[]) {\n this.icons = value;\n if (!this.icons) {\n this.iconValue = null;\n this.iconTemplate = null;\n } else {\n this.setIconTemplate();\n }\n }\n\n /**\n * 当前值hover时的回调\n */\n @Output() readonly thyItemHoverChange = new EventEmitter<number>();\n\n @HostBinding('class.thy-rate') className = true;\n\n constructor() {\n super();\n }\n\n get thyValue(): number {\n return this._value;\n }\n\n set thyValue(value: number) {\n if (this._value === value) {\n return;\n }\n this._value = value;\n this.hasHalf = !Number.isInteger(value);\n this.currentValue = Math.ceil(value);\n }\n\n writeValue(value: number): void {\n this.thyValue = value || 0;\n this.updateRateArray();\n this.cdr.markForCheck();\n }\n\n ngOnInit() {}\n\n ngOnChanges(changes: SimpleChanges): void {\n const { thyCount, thyValue } = changes;\n if (thyCount) {\n this.updateRateArray();\n }\n\n if (thyValue) {\n this.updateItemStyle();\n }\n this.cdr.detectChanges();\n }\n\n itemHover(isHalf: boolean, index: number): void {\n if (this.thyDisabled || (this.currentValue === index + 1 && this.hasHalf === isHalf)) {\n return;\n }\n this.currentValue = index + 1;\n this.hasHalf = isHalf;\n const _value = isHalf ? Number(this.currentValue - 0.5) : this.currentValue;\n this.thyItemHoverChange.emit(_value);\n this.updateItemStyle();\n }\n\n itemClick(isHalf: boolean, index: number) {\n if (this.thyDisabled) {\n return;\n }\n this.currentValue = index + 1;\n const _value = isHalf ? index + 1 - 0.5 : index + 1;\n if (this.thyValue === _value) {\n if (this.thyAllowClear) {\n this.thyValue = 0;\n this.onChangeCallback(this.thyValue);\n this.onTouchedCallback();\n }\n } else {\n this.thyValue = _value;\n this.onChangeCallback(this.thyValue);\n this.onTouchedCallback();\n }\n this.updateItemStyle();\n }\n\n onRateLeave(event: Event): void {\n event.stopPropagation();\n this.hasHalf = !Number.isInteger(this.thyValue);\n this.currentValue = Math.ceil(this.thyValue);\n this.updateItemStyle();\n }\n\n updateRateArray(): void {\n this.rateArray = Array(this.thyCount)\n .fill(0)\n .map((_, i) => {\n return i;\n });\n this.updateItemStyle();\n }\n\n updateItemStyle(): void {\n this.updateIcon();\n const rateStyle = 'thy-rate-star';\n this.rateStyleArray = this.rateArray.map(i => {\n const value = i + 1;\n return {\n [`${rateStyle}--full`]: value < this.currentValue || (value === this.currentValue && !this.hasHalf),\n [`${rateStyle}--half`]: this.hasHalf && value === this.currentValue,\n [`${rateStyle}--active`]: this.hasHalf && value === this.currentValue,\n [`${rateStyle}--zero`]: value > this.currentValue\n };\n });\n }\n\n updateIcon(): void {\n if (!this.icons) {\n this.iconValue = null;\n this.iconTemplate = null;\n } else {\n this.setIconTemplate();\n }\n }\n\n setIconTemplate(): void {\n if (helpers.isArray(this.icons) && this.icons.length > 0) {\n const currentIcon = (this.currentValue && this.currentValue - 1) || 0;\n if (this.icons[currentIcon] instanceof TemplateRef) {\n this.iconTemplate = this.icons[currentIcon] as TemplateRef<any>;\n } else {\n this.iconValue = this.icons[currentIcon] as string;\n }\n } else if (!helpers.isArray(this.icons)) {\n if (this.icons instanceof TemplateRef) {\n this.iconTemplate = this.icons;\n } else {\n this.iconValue = this.icons;\n }\n }\n }\n\n registerOnChange(fn: any): void {\n this.onChangeCallback = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouchedCallback = fn;\n }\n\n trackByFn(index: number, item: any) {\n return item || index;\n }\n}\n","<div class=\"thy-rate-container\" [class.thy-rate-container--disabled]=\"thyDisabled\" (mouseleave)=\"onRateLeave($event)\">\n @for (star of rateArray; track trackByFn(index, star); let index = $index) {\n <div\n thyStopPropagation\n class=\"thy-rate-star\"\n [ngClass]=\"rateStyleArray[index] || ''\"\n thy-rate-item\n [allowHalf]=\"thyAllowHalf\"\n [iconValue]=\"iconValue\"\n [iconTemplate]=\"iconTemplate\"\n (itemHover)=\"itemHover($event, index)\"\n (itemClick)=\"itemClick($event, index)\"\n [thyTooltip]=\"thyTooltips[index]\"\n thyTooltipPlacement=\"top\"\n ></div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyTooltipModule } from 'ngx-tethys/tooltip';\nimport { ThyRateItem } from './rate-item.component';\nimport { ThyRate } from './rate.component';\n\n@NgModule({\n imports: [CommonModule, FormsModule, ThySharedModule, ThyIconModule, ThyTooltipModule, ThyRate, ThyRateItem],\n exports: [ThyRate],\n providers: []\n})\nexport class ThyRateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAMA;;AAEG;MAqBU,WAAW,CAAA;AAWpB,IAAA,WAAA,GAAA;QAV6C,IAAS,CAAA,SAAA,GAAG,KAAK;AAM3C,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAAW;AAEvC,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAAW;;AAI1D,IAAA,QAAQ;AAER,IAAA,aAAa,CAAC,MAAe,EAAA;QACzB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC;;AAGjD,IAAA,aAAa,CAAC,MAAe,EAAA;QACzB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC;;8GApBxC,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gCAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,CAAA,WAAA,EAAA,WAAA,EACA,qBAAqB,CAnB/B,EAAA,SAAA,EAAA,WAAA,EAAA,YAAA,EAAA,cAAA,EAAA,EAAA,OAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;AAeT,IAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACS,2BAA2B,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA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EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,CAAC;oBAC5G,OAAO,EAAE,CAAC,OAAO,CAAC;AAClB,oBAAA,SAAS,EAAE;AACd,iBAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys-rate.mjs","sources":["../../../src/rate/rate-item.component.ts","../../../src/rate/rate.component.ts","../../../src/rate/rate.component.html","../../../src/rate/module.ts","../../../src/rate/ngx-tethys-rate.ts"],"sourcesContent":["import { Component, TemplateRef, input, output } from '@angular/core';\nimport { ThyIcon } from 'ngx-tethys/icon';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ThyStopPropagationDirective } from 'ngx-tethys/shared';\nimport { coerceBooleanProperty, ThyBooleanInput } from 'ngx-tethys/util';\n\n/**\n * @private\n */\n@Component({\n selector: 'thy-rate-item, [thy-rate-item]',\n template: `\n <div class=\"thy-rate-item-left\" thyStopPropagation (mouseover)=\"hoverRateItem(true)\" (click)=\"clickRateItem(true)\">\n <ng-template [ngTemplateOutlet]=\"iconTemplate() || (iconValue() && character) || defaultTemplate\"></ng-template>\n </div>\n <div class=\"thy-rate-item-all\" thyStopPropagation (mouseover)=\"hoverRateItem(false)\" (click)=\"clickRateItem(false)\">\n <ng-template [ngTemplateOutlet]=\"iconTemplate() || (iconValue() && character) || defaultTemplate\"></ng-template>\n </div>\n\n <ng-template #defaultTemplate>\n <thy-icon thyIconName=\"star-fill\"></thy-icon>\n </ng-template>\n\n <ng-template #character>\n <thy-icon [thyIconName]=\"iconValue()\"></thy-icon>\n </ng-template>\n `,\n imports: [ThyStopPropagationDirective, NgTemplateOutlet, ThyIcon]\n})\nexport class ThyRateItem {\n readonly allowHalf = input<boolean, ThyBooleanInput>(false, { transform: coerceBooleanProperty });\n\n readonly iconValue = input<string>();\n\n readonly iconTemplate = input<TemplateRef<any>>();\n\n readonly itemHover = output<boolean>();\n\n readonly itemClick = output<boolean>();\n\n constructor() {}\n\n hoverRateItem(isHalf: boolean): void {\n this.itemHover.emit(isHalf && this.allowHalf());\n }\n\n clickRateItem(isHalf: boolean): void {\n this.itemClick.emit(isHalf && this.allowHalf());\n }\n}\n","import { TabIndexDisabledControlValueAccessorMixin } from 'ngx-tethys/core';\nimport { coerceBooleanProperty, helpers, ThyBooleanInput } from 'ngx-tethys/util';\n\nimport { NgClass } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Input,\n numberAttribute,\n TemplateRef,\n inject,\n input,\n output,\n computed,\n model,\n ModelSignal,\n effect\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ThyStopPropagationDirective } from 'ngx-tethys/shared';\nimport { ThyTooltipDirective } from 'ngx-tethys/tooltip';\nimport { ThyRateItem } from './rate-item.component';\n\nconst noop = () => {};\n\n/**\n * 评分组件\n * @name thy-rate\n * @order 10\n */\n@Component({\n selector: 'thy-rate',\n templateUrl: './rate.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ThyRate),\n multi: true\n }\n ],\n host: {\n '[attr.tabindex]': `tabIndex`,\n class: 'thy-rate'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ThyStopPropagationDirective, ThyRateItem, NgClass, ThyTooltipDirective]\n})\nexport class ThyRate extends TabIndexDisabledControlValueAccessorMixin implements ControlValueAccessor {\n private cdr = inject(ChangeDetectorRef);\n\n readonly thyValue: ModelSignal<number> = model(0);\n\n readonly currentValue: ModelSignal<number> = model(0);\n\n readonly hasHalf: ModelSignal<boolean> = model(false);\n\n private onTouchedCallback: () => void = noop;\n\n private onChangeCallback: (_: any) => void = noop;\n\n /**\n * 自定义评分的总数\n */\n readonly thyCount = input(5, { transform: numberAttribute });\n\n /**\n * 是否只读\n * @default false\n */\n @Input({ transform: coerceBooleanProperty })\n override set thyDisabled(value: boolean) {\n this.disabled = value;\n }\n override get thyDisabled(): boolean {\n return this.disabled;\n }\n\n disabled = false;\n\n /**\n * 是否允许半选\n * @default false\n */\n readonly thyAllowHalf = input<boolean, ThyBooleanInput>(false, { transform: coerceBooleanProperty });\n\n /**\n * 是否允许再次点击后清除\n */\n readonly thyAllowClear = input<boolean, ThyBooleanInput>(true, { transform: coerceBooleanProperty });\n\n /**\n * 自定义每项的提示信息\n * @type string[]\n */\n readonly thyTooltips = input<string[]>([]);\n\n /**\n * 自定义模板,目前支持传单个模板或图标名称、数组(模板 | 图标名称)\n * @type string | TemplateRef<any> | string[] | TemplateRef<any>[]\n */\n readonly thyIconTemplate = input<string | TemplateRef<any> | string[] | TemplateRef<any>[]>(null);\n\n /**\n * 当前值hover时的回调\n */\n readonly thyItemHoverChange = output<number>();\n\n readonly iconValue = computed(() => {\n const icons = this.thyIconTemplate();\n const currentValue = this.currentValue();\n if (!icons) {\n return null;\n } else {\n let iconValue = null;\n if (helpers.isArray(icons) && icons.length > 0) {\n const currentIcon = (currentValue && currentValue - 1) || 0;\n iconValue = icons[currentIcon];\n } else if (!helpers.isArray(icons)) {\n iconValue = icons;\n }\n if (iconValue instanceof TemplateRef) {\n return null;\n } else {\n return iconValue;\n }\n }\n });\n\n readonly iconTemplate = computed(() => {\n const icons = this.thyIconTemplate();\n const currentValue = this.currentValue();\n if (!icons) {\n return null;\n } else {\n let iconTemplate = null;\n if (helpers.isArray(icons) && icons.length > 0) {\n const currentIcon = (currentValue && currentValue - 1) || 0;\n iconTemplate = icons[currentIcon] as TemplateRef<any>;\n } else if (!helpers.isArray(icons)) {\n iconTemplate = icons;\n }\n if (iconTemplate instanceof TemplateRef) {\n return iconTemplate;\n } else {\n return null;\n }\n }\n });\n\n readonly rateArray = computed(() => {\n return this.updateRateArray();\n });\n\n readonly rateStyleArray = computed(() => {\n return this.updateItemStyle();\n });\n\n constructor() {\n super();\n effect(() => {\n this.hasHalf.set(!Number.isInteger(this.thyValue()));\n this.currentValue.set(Math.ceil(this.thyValue()));\n });\n }\n\n writeValue(value: number): void {\n this.thyValue.set(value || 0);\n this.cdr.markForCheck();\n }\n\n itemHover(isHalf: boolean, index: number): void {\n if (this.thyDisabled || (this.currentValue() === index + 1 && this.hasHalf() === isHalf)) {\n return;\n }\n this.currentValue.set(index + 1);\n this.hasHalf.set(isHalf);\n const _value = isHalf ? Number(this.currentValue() - 0.5) : this.currentValue();\n this.thyItemHoverChange.emit(_value);\n }\n\n itemClick(isHalf: boolean, index: number) {\n if (this.thyDisabled) {\n return;\n }\n this.currentValue.set(index + 1);\n const _value = isHalf ? index + 1 - 0.5 : index + 1;\n if (this.thyValue() === _value) {\n if (this.thyAllowClear()) {\n this.thyValue.set(0);\n this.onChangeCallback(this.thyValue());\n this.onTouchedCallback();\n }\n } else {\n this.thyValue.set(_value);\n this.onChangeCallback(this.thyValue());\n this.onTouchedCallback();\n }\n }\n\n onRateLeave(event: Event): void {\n event.stopPropagation();\n this.hasHalf.set(!Number.isInteger(this.thyValue()));\n this.currentValue.set(Math.ceil(this.thyValue()));\n }\n\n updateRateArray(): number[] {\n return this.thyCount() > 0\n ? Array(this.thyCount())\n .fill(0)\n .map((_, i) => {\n return i;\n })\n : [];\n }\n\n updateItemStyle(): Record<string, boolean>[] {\n const rateStyle = 'thy-rate-star';\n return this.rateArray().map(i => {\n const value = i + 1;\n return {\n [`${rateStyle}--full`]: value < this.currentValue() || (value === this.currentValue() && !this.hasHalf()),\n [`${rateStyle}--half`]: this.hasHalf() && value === this.currentValue(),\n [`${rateStyle}--active`]: this.hasHalf() && value === this.currentValue(),\n [`${rateStyle}--zero`]: value > this.currentValue()\n };\n });\n }\n\n registerOnChange(fn: any): void {\n this.onChangeCallback = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouchedCallback = fn;\n }\n\n trackByFn(index: number, item: any) {\n return item || index;\n }\n}\n","<div class=\"thy-rate-container\" [class.thy-rate-container--disabled]=\"thyDisabled\" (mouseleave)=\"onRateLeave($event)\">\n @for (star of rateArray(); track trackByFn(index, star); let index = $index) {\n <div\n thyStopPropagation\n class=\"thy-rate-star\"\n [ngClass]=\"rateStyleArray()[index] || ''\"\n thy-rate-item\n [allowHalf]=\"thyAllowHalf()\"\n [iconValue]=\"iconValue()\"\n [iconTemplate]=\"iconTemplate()\"\n (itemHover)=\"itemHover($event, index)\"\n (itemClick)=\"itemClick($event, index)\"\n [thyTooltip]=\"thyTooltips()[index]\"\n thyTooltipPlacement=\"top\"\n ></div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyTooltipModule } from 'ngx-tethys/tooltip';\nimport { ThyRateItem } from './rate-item.component';\nimport { ThyRate } from './rate.component';\n\n@NgModule({\n imports: [CommonModule, FormsModule, ThySharedModule, ThyIconModule, ThyTooltipModule, ThyRate, ThyRateItem],\n exports: [ThyRate],\n providers: []\n})\nexport class ThyRateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAMA;;AAEG;MAqBU,WAAW,CAAA;AAWpB,IAAA,WAAA,GAAA;QAVS,IAAS,CAAA,SAAA,GAAG,KAAK,CAA2B,KAAK,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;QAExF,IAAS,CAAA,SAAA,GAAG,KAAK,EAAU;QAE3B,IAAY,CAAA,YAAA,GAAG,KAAK,EAAoB;QAExC,IAAS,CAAA,SAAA,GAAG,MAAM,EAAW;QAE7B,IAAS,CAAA,SAAA,GAAG,MAAM,EAAW;;AAItC,IAAA,aAAa,CAAC,MAAe,EAAA;AACzB,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;;AAGnD,IAAA,aAAa,CAAC,MAAe,EAAA;AACzB,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,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