ngx-tethys 19.0.13 → 19.1.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/CHANGELOG.md +29 -2
  2. package/action/action.component.d.ts +12 -20
  3. package/action/actions.component.d.ts +5 -7
  4. package/affix/affix.component.d.ts +7 -10
  5. package/alert/alert.component.d.ts +1 -1
  6. package/anchor/anchor-link.component.d.ts +8 -8
  7. package/anchor/anchor.component.d.ts +15 -21
  8. package/arrow-switcher/arrow-switcher.component.d.ts +15 -22
  9. package/autocomplete/autocomplete.component.d.ts +10 -17
  10. package/autocomplete/autocomplete.trigger.directive.d.ts +10 -18
  11. package/avatar/avatar-list/avatar-list.component.d.ts +8 -14
  12. package/avatar/avatar.component.d.ts +25 -39
  13. package/back-top/back-top.component.d.ts +9 -12
  14. package/badge/badge.component.d.ts +19 -59
  15. package/breadcrumb/breadcrumb.component.d.ts +15 -20
  16. package/button/button-icon.component.d.ts +3 -2
  17. package/button/button.component.d.ts +3 -2
  18. package/calendar/calendar-header.component.d.ts +9 -8
  19. package/calendar/calendar.component.d.ts +16 -16
  20. package/card/card.component.d.ts +5 -11
  21. package/card/content.component.d.ts +3 -8
  22. package/card/header.component.d.ts +7 -8
  23. package/carousel/carousel.component.d.ts +22 -27
  24. package/cascader/cascader-li.component.d.ts +13 -21
  25. package/cascader/cascader-search-option.component.d.ts +8 -16
  26. package/cascader/cascader.component.d.ts +58 -80
  27. package/checkbox/checkbox.component.d.ts +2 -5
  28. package/collapse/collapse-item.component.d.ts +12 -19
  29. package/collapse/collapse.component.d.ts +6 -12
  30. package/collapse/collapse.token.d.ts +3 -3
  31. package/color-picker/color-picker-custom-panel.component.d.ts +5 -5
  32. package/color-picker/color-picker-panel.component.d.ts +7 -11
  33. package/color-picker/color-picker.component.d.ts +19 -35
  34. package/color-picker/parts/alpha/alpha.component.d.ts +8 -8
  35. package/color-picker/parts/hue/hue.component.d.ts +6 -6
  36. package/color-picker/parts/indicator/indicator.component.d.ts +4 -3
  37. package/color-picker/parts/inputs/inputs.component.d.ts +9 -9
  38. package/color-picker/parts/saturation/saturation.component.d.ts +9 -9
  39. package/comment/comment.component.d.ts +4 -5
  40. package/copy/copy.directive.d.ts +8 -9
  41. package/date-picker/abstract-picker.component.d.ts +8 -7
  42. package/date-picker/lib/calendar/calendar-footer.component.d.ts +2 -1
  43. package/date-picker/lib/popups/inner-popup.component.d.ts +2 -1
  44. package/date-picker/picker.component.d.ts +2 -1
  45. package/date-range/date-range.component.d.ts +2 -2
  46. package/dialog/body/dialog-body.component.d.ts +2 -6
  47. package/dialog/confirm/confirm.component.d.ts +2 -2
  48. package/dialog/footer/dialog-footer.component.d.ts +6 -9
  49. package/dialog/header/dialog-header.component.d.ts +9 -11
  50. package/divider/divider.component.d.ts +12 -16
  51. package/dot/dot.component.d.ts +5 -13
  52. package/drag-drop/drag-handle.directive.d.ts +2 -1
  53. package/drag-drop/drag.directive.d.ts +2 -1
  54. package/drag-drop/drop-container.directive.d.ts +2 -1
  55. package/dropdown/dropdown-menu-item.directive.d.ts +3 -2
  56. package/dropdown/dropdown-menu.component.d.ts +2 -1
  57. package/dropdown/dropdown.directive.d.ts +2 -1
  58. package/empty/empty.component.d.ts +21 -27
  59. package/fesm2022/ngx-tethys-action.mjs +54 -91
  60. package/fesm2022/ngx-tethys-action.mjs.map +1 -1
  61. package/fesm2022/ngx-tethys-affix.mjs +29 -26
  62. package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
  63. package/fesm2022/ngx-tethys-anchor.mjs +91 -118
  64. package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
  65. package/fesm2022/ngx-tethys-arrow-switcher.mjs +51 -77
  66. package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
  67. package/fesm2022/ngx-tethys-autocomplete.mjs +69 -103
  68. package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
  69. package/fesm2022/ngx-tethys-avatar.mjs +117 -162
  70. package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
  71. package/fesm2022/ngx-tethys-back-top.mjs +33 -46
  72. package/fesm2022/ngx-tethys-back-top.mjs.map +1 -1
  73. package/fesm2022/ngx-tethys-badge.mjs +104 -208
  74. package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
  75. package/fesm2022/ngx-tethys-breadcrumb.mjs +66 -70
  76. package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
  77. package/fesm2022/ngx-tethys-calendar.mjs +85 -87
  78. package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
  79. package/fesm2022/ngx-tethys-card.mjs +72 -77
  80. package/fesm2022/ngx-tethys-card.mjs.map +1 -1
  81. package/fesm2022/ngx-tethys-carousel.mjs +82 -99
  82. package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
  83. package/fesm2022/ngx-tethys-cascader.mjs +313 -468
  84. package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
  85. package/fesm2022/ngx-tethys-checkbox.mjs +10 -17
  86. package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
  87. package/fesm2022/ngx-tethys-collapse.mjs +66 -71
  88. package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
  89. package/fesm2022/ngx-tethys-color-picker.mjs +187 -246
  90. package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
  91. package/fesm2022/ngx-tethys-comment.mjs +16 -10
  92. package/fesm2022/ngx-tethys-comment.mjs.map +1 -1
  93. package/fesm2022/ngx-tethys-copy.mjs +25 -28
  94. package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
  95. package/fesm2022/ngx-tethys-dialog.mjs +81 -82
  96. package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
  97. package/fesm2022/ngx-tethys-divider.mjs +49 -58
  98. package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
  99. package/fesm2022/ngx-tethys-dot.mjs +45 -68
  100. package/fesm2022/ngx-tethys-dot.mjs.map +1 -1
  101. package/fesm2022/ngx-tethys-empty.mjs +107 -95
  102. package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
  103. package/fesm2022/ngx-tethys-form.mjs +161 -200
  104. package/fesm2022/ngx-tethys-form.mjs.map +1 -1
  105. package/fesm2022/ngx-tethys-fullscreen.mjs +21 -23
  106. package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
  107. package/fesm2022/ngx-tethys-grid.mjs +160 -152
  108. package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
  109. package/fesm2022/ngx-tethys-i18n.mjs +25 -25
  110. package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
  111. package/fesm2022/ngx-tethys-input-number.mjs +101 -114
  112. package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
  113. package/fesm2022/ngx-tethys-input.mjs +268 -271
  114. package/fesm2022/ngx-tethys-input.mjs.map +1 -1
  115. package/fesm2022/ngx-tethys-list.mjs +1 -1
  116. package/fesm2022/ngx-tethys-list.mjs.map +1 -1
  117. package/fesm2022/ngx-tethys-loading.mjs +17 -35
  118. package/fesm2022/ngx-tethys-loading.mjs.map +1 -1
  119. package/fesm2022/ngx-tethys-mention.mjs +52 -74
  120. package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
  121. package/fesm2022/ngx-tethys-menu.mjs +106 -179
  122. package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
  123. package/fesm2022/ngx-tethys-nav.mjs +169 -201
  124. package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
  125. package/fesm2022/ngx-tethys-pagination.mjs +230 -294
  126. package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
  127. package/fesm2022/ngx-tethys-popover.mjs +67 -70
  128. package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
  129. package/fesm2022/ngx-tethys-progress.mjs +196 -244
  130. package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
  131. package/fesm2022/ngx-tethys-property.mjs +102 -105
  132. package/fesm2022/ngx-tethys-property.mjs.map +1 -1
  133. package/fesm2022/ngx-tethys-radio.mjs +34 -38
  134. package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
  135. package/fesm2022/ngx-tethys-result.mjs +46 -28
  136. package/fesm2022/ngx-tethys-result.mjs.map +1 -1
  137. package/fesm2022/ngx-tethys-skeleton.mjs +339 -342
  138. package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
  139. package/fesm2022/ngx-tethys-slider.mjs +75 -108
  140. package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
  141. package/fesm2022/ngx-tethys-space.mjs +26 -46
  142. package/fesm2022/ngx-tethys-space.mjs.map +1 -1
  143. package/fesm2022/ngx-tethys-statistic.mjs +114 -151
  144. package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
  145. package/fesm2022/ngx-tethys-stepper.mjs +74 -107
  146. package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
  147. package/fesm2022/ngx-tethys-switch.mjs +80 -140
  148. package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
  149. package/fesm2022/ngx-tethys-table.mjs +1 -1
  150. package/fesm2022/ngx-tethys-table.mjs.map +1 -1
  151. package/fesm2022/ngx-tethys-tabs.mjs +69 -87
  152. package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
  153. package/fesm2022/ngx-tethys-tag.mjs +42 -64
  154. package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
  155. package/fesm2022/ngx-tethys-timeline.mjs +104 -129
  156. package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
  157. package/fesm2022/ngx-tethys-typography.mjs +36 -33
  158. package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
  159. package/fesm2022/ngx-tethys-upload.mjs +91 -130
  160. package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
  161. package/fesm2022/ngx-tethys-util.mjs.map +1 -1
  162. package/fesm2022/ngx-tethys-watermark.mjs +36 -40
  163. package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
  164. package/fesm2022/ngx-tethys.mjs +1 -1
  165. package/fesm2022/ngx-tethys.mjs.map +1 -1
  166. package/form/form-group-error/form-group-error.component.d.ts +2 -3
  167. package/form/form-group-label.directive.d.ts +2 -1
  168. package/form/form-group.component.d.ts +17 -24
  169. package/form/form-submit.directive.d.ts +2 -2
  170. package/form/form.directive.d.ts +6 -8
  171. package/form/from-group-footer/form-group-footer.component.d.ts +2 -2
  172. package/form/validator/confirm-validator.directive.d.ts +2 -2
  173. package/form/validator/unique-validator.directive.d.ts +2 -2
  174. package/fullscreen/fullscreen.component.d.ts +7 -7
  175. package/grid/flex.d.ts +14 -19
  176. package/grid/thy-col.directive.d.ts +6 -9
  177. package/grid/thy-grid-item.component.d.ts +3 -4
  178. package/grid/thy-grid.component.d.ts +11 -12
  179. package/grid/thy-row.directive.d.ts +12 -12
  180. package/icon/icon.component.d.ts +3 -2
  181. package/image/image.directive.d.ts +3 -2
  182. package/input/input-count.component.d.ts +4 -5
  183. package/input/input-group.component.d.ts +20 -20
  184. package/input/input-search.component.d.ts +15 -20
  185. package/input/input.component.d.ts +20 -21
  186. package/input/input.directive.d.ts +4 -6
  187. package/input-number/input-number.component.d.ts +21 -29
  188. package/layout/header.component.d.ts +4 -9
  189. package/layout/sidebar-header.component.d.ts +2 -1
  190. package/layout/sidebar.component.d.ts +8 -7
  191. package/list/list.component.d.ts +2 -1
  192. package/list/selection/selection-list.d.ts +4 -3
  193. package/loading/loading.component.d.ts +4 -10
  194. package/mention/mention.directive.d.ts +6 -7
  195. package/mention/suggestions/suggestions.component.d.ts +8 -9
  196. package/menu/group/menu-group.component.d.ts +16 -33
  197. package/menu/item/action/menu-item-action.component.d.ts +7 -8
  198. package/menu/item/icon/menu-item-icon.component.d.ts +2 -2
  199. package/menu/item/menu-item.component.d.ts +4 -4
  200. package/menu/item/name/menu-item-name.component.d.ts +2 -3
  201. package/menu/menu.component.d.ts +3 -7
  202. package/nav/icon-nav/icon-nav-link.directive.d.ts +3 -7
  203. package/nav/icon-nav/icon-nav.component.d.ts +3 -8
  204. package/nav/nav-ink-bar.directive.d.ts +4 -6
  205. package/nav/nav-item.directive.d.ts +7 -10
  206. package/nav/nav.component.d.ts +20 -48
  207. package/package.json +1 -1
  208. package/pagination/pagination.component.d.ts +48 -109
  209. package/popover/header/popover-header.component.d.ts +7 -6
  210. package/popover/popover.directive.d.ts +11 -18
  211. package/progress/progress-circle.component.d.ts +32 -21
  212. package/progress/progress-strip.component.d.ts +10 -14
  213. package/progress/progress.component.d.ts +15 -23
  214. package/property/examples/single/single.component.scss +6 -0
  215. package/property/properties.component.d.ts +6 -13
  216. package/property/property-item.component.d.ts +21 -26
  217. package/property/styles/properties.scss +124 -52
  218. package/property-operation/property-operation.component.d.ts +6 -5
  219. package/radio/button/radio-button.component.d.ts +2 -2
  220. package/radio/group/radio-group.component.d.ts +8 -7
  221. package/radio/radio.component.d.ts +2 -2
  222. package/radio/radio.token.d.ts +2 -2
  223. package/rate/rate-item.component.d.ts +2 -1
  224. package/rate/rate.component.d.ts +4 -3
  225. package/resizable/resizable.directive.d.ts +4 -9
  226. package/resizable/resize-handle.component.d.ts +2 -1
  227. package/resizable/resize-handles.component.d.ts +2 -1
  228. package/result/result.component.d.ts +9 -10
  229. package/schematics/version.d.ts +1 -1
  230. package/schematics/version.js +1 -1
  231. package/segment/segment-item.component.d.ts +2 -1
  232. package/segment/segment.component.d.ts +2 -1
  233. package/select/custom-select/custom-select.component.d.ts +11 -10
  234. package/select/native-select/native-select.component.d.ts +2 -1
  235. package/shared/base-form-check.component.d.ts +3 -2
  236. package/shared/directives/thy-autofocus.directive.d.ts +3 -2
  237. package/shared/directives/thy-scroll.directive.d.ts +2 -1
  238. package/shared/directives/thy-show.d.ts +2 -1
  239. package/shared/option/group/option-group.component.d.ts +2 -1
  240. package/shared/option/list-option/list-option.component.d.ts +2 -7
  241. package/shared/option/option.component.d.ts +2 -1
  242. package/shared/select/select-control/select-control.component.d.ts +7 -6
  243. package/skeleton/skeleton-circle.component.d.ts +16 -19
  244. package/skeleton/skeleton-rectangle.component.d.ts +20 -23
  245. package/skeleton/skeleton.component.d.ts +5 -6
  246. package/skeleton/stylized/bullet-list.component.d.ts +11 -13
  247. package/skeleton/stylized/list.component.d.ts +10 -12
  248. package/skeleton/stylized/paragraph.component.d.ts +12 -14
  249. package/slide/slide-body/slide-body-section.component.d.ts +2 -1
  250. package/slider/slider.component.d.ts +17 -24
  251. package/space/space.component.d.ts +8 -8
  252. package/statistic/statistic.component.d.ts +35 -40
  253. package/stepper/step-header.component.d.ts +6 -10
  254. package/stepper/step.component.d.ts +6 -6
  255. package/stepper/stepper.component.d.ts +15 -20
  256. package/switch/switch.component.d.ts +24 -35
  257. package/table/table-column.component.d.ts +6 -5
  258. package/table/table-skeleton.component.d.ts +3 -10
  259. package/table/table.component.d.ts +11 -10
  260. package/tabs/tab-content.component.d.ts +4 -4
  261. package/tabs/tab.component.d.ts +4 -5
  262. package/tabs/tabs.component.d.ts +13 -15
  263. package/tag/tag.component.d.ts +10 -16
  264. package/time-picker/time-picker-panel.component.d.ts +3 -2
  265. package/time-picker/time-picker.component.d.ts +6 -5
  266. package/timeline/timeline-item.component.d.ts +9 -13
  267. package/timeline/timeline.component.d.ts +13 -17
  268. package/tooltip/tooltip.directive.d.ts +3 -2
  269. package/tree/tree-node.component.d.ts +6 -15
  270. package/tree/tree.component.d.ts +8 -7
  271. package/tree-select/tree-select.component.d.ts +8 -7
  272. package/typography/bg-color.directive.d.ts +3 -3
  273. package/typography/text/text.component.d.ts +2 -2
  274. package/typography/text-color.directive.d.ts +3 -3
  275. package/upload/file-drop.directive.d.ts +9 -11
  276. package/upload/file-select-base.d.ts +6 -10
  277. package/upload/file-select.component.d.ts +10 -20
  278. package/util/helpers/helpers.d.ts +2 -1
  279. package/vote/vote.component.d.ts +4 -3
  280. package/watermark/watermark.directive.d.ts +7 -9
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ChangeDetectorRef, EventEmitter, forwardRef, numberAttribute, Output, Input, ViewChild, Component, NgModule } from '@angular/core';
2
+ import { viewChild, signal, input, numberAttribute, output, effect, forwardRef, Input, Component, NgModule } from '@angular/core';
3
3
  import { CommonModule } from '@angular/common';
4
4
  import * as i1 from '@angular/forms';
5
5
  import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
@@ -7,7 +7,7 @@ import { ThyAutofocusDirective, ThySharedModule } from 'ngx-tethys/shared';
7
7
  import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
8
8
  import { TabIndexDisabledControlValueAccessorMixin, useHostFocusControl } from 'ngx-tethys/core';
9
9
  import { ThyInputDirective, ThyInputModule } from 'ngx-tethys/input';
10
- import { isNumber, UP_ARROW, DOWN_ARROW, ENTER, isUndefinedOrNull, isFloat, coerceBooleanProperty } from 'ngx-tethys/util';
10
+ import { coerceBooleanProperty, isNumber, UP_ARROW, DOWN_ARROW, ENTER, isUndefinedOrNull, isFloat } from 'ngx-tethys/util';
11
11
  import { ThyFormModule } from 'ngx-tethys/form';
12
12
 
13
13
  var Type;
@@ -21,68 +21,89 @@ var Type;
21
21
  * @order 10
22
22
  */
23
23
  class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
24
- /**
25
- * 最大值
26
- * @default Infinity
27
- */
28
- set thyMax(value) {
29
- this.innerMax = isNumber(value) ? value : this.innerMax;
30
- if (this.displayValue || this.displayValue === 0) {
31
- const val = Number(this.displayValue);
32
- this.disabledUp = val >= this.innerMax;
33
- }
34
- }
35
- get thyMax() {
36
- return this.innerMax;
37
- }
38
- /**
39
- * 最小值
40
- * @default -Infinity
41
- */
42
- set thyMin(value) {
43
- this.innerMin = isNumber(value) ? value : this.innerMin;
44
- if (this.displayValue || this.displayValue === 0) {
45
- const val = Number(this.displayValue);
46
- this.disabledDown = val <= this.innerMin;
47
- }
48
- }
49
- get thyMin() {
50
- return this.innerMin;
51
- }
52
24
  constructor() {
53
25
  super();
54
- this.cdr = inject(ChangeDetectorRef);
26
+ this.inputElement = viewChild('input');
55
27
  this.hostFocusControl = useHostFocusControl();
56
- this.disabledUp = false;
57
- this.disabledDown = false;
28
+ this.displayValue = signal(undefined);
29
+ this.disabledUp = signal(false);
30
+ this.disabledDown = signal(false);
58
31
  this.activeValue = '';
32
+ /**
33
+ * 是否自动聚焦
34
+ * @default false
35
+ */
36
+ this.thyAutoFocus = input(false, { transform: coerceBooleanProperty });
59
37
  /**
60
38
  * 输入框的placeholder
61
39
  */
62
- this.thyPlaceholder = '';
40
+ this.thyPlaceholder = input('');
41
+ /**
42
+ * 最大值
43
+ * @default Infinity
44
+ */
45
+ this.thyMax = input(Infinity, { transform: (value) => (isNumber(value) ? value : Infinity) });
46
+ /**
47
+ * 最小值
48
+ * @default -Infinity
49
+ */
50
+ this.thyMin = input(-Infinity, { transform: (value) => (isNumber(value) ? value : -Infinity) });
63
51
  /**
64
52
  * 每次改变步数,可以为小数
65
53
  */
66
- this.thyStep = 1;
54
+ this.thyStep = input(1, { transform: numberAttribute });
67
55
  /**
68
56
  * 改变步数时的延迟毫秒数,值越小变化的速度越快
69
57
  * @default 300
70
58
  */
71
- this.thyStepDelay = 300;
59
+ this.thyStepDelay = input(300, { transform: numberAttribute });
60
+ /**
61
+ * 输入框大小
62
+ * @type xs | sm | md | lg
63
+ */
64
+ this.thySize = input();
65
+ /**
66
+ * 数值精度
67
+ */
68
+ this.thyPrecision = input();
69
+ /**
70
+ * 数值后缀
71
+ */
72
+ this.thySuffix = input();
72
73
  /**
73
74
  * 焦点失去事件
74
75
  */
75
- this.thyBlur = new EventEmitter();
76
+ this.thyBlur = output();
76
77
  /**
77
78
  * 焦点激活事件
78
79
  */
79
- this.thyFocus = new EventEmitter();
80
+ this.thyFocus = output();
80
81
  /**
81
82
  * 上下箭头点击事件
82
83
  */
83
- this.thyStepChange = new EventEmitter();
84
- this.innerMax = Infinity;
85
- this.innerMin = -Infinity;
84
+ this.thyStepChange = output();
85
+ effect(() => {
86
+ const displayValue = this.displayValue();
87
+ const max = this.thyMax();
88
+ if (displayValue || displayValue === 0) {
89
+ const val = Number(displayValue);
90
+ this.disabledUp.set(val >= max);
91
+ }
92
+ });
93
+ effect(() => {
94
+ const min = this.thyMin();
95
+ const displayValue = this.displayValue();
96
+ if (displayValue || displayValue === 0) {
97
+ const val = Number(displayValue);
98
+ this.disabledDown.set(val <= min);
99
+ }
100
+ });
101
+ effect(() => {
102
+ const suffix = this.thySuffix();
103
+ const validValue = this.getCurrentValidValue(this.validValue);
104
+ this.updateValidValue(validValue);
105
+ this.displayValue.set(this.formatterValue(validValue));
106
+ });
86
107
  }
87
108
  setDisabledState(isDisabled) {
88
109
  this.thyDisabled = isDisabled;
@@ -94,12 +115,12 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
94
115
  }
95
116
  if (origin) {
96
117
  if (!this.isFocused) {
97
- this.inputElement.nativeElement.focus();
118
+ this.inputElement().nativeElement.focus();
98
119
  }
99
120
  }
100
121
  else {
101
122
  if (this.isFocused) {
102
- this.displayValue = this.formatterValue(this.validValue);
123
+ this.displayValue.set(this.formatterValue(this.validValue));
103
124
  this.onTouchedFn();
104
125
  this.thyBlur.emit();
105
126
  this.isFocused = false;
@@ -107,18 +128,10 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
107
128
  }
108
129
  };
109
130
  }
110
- ngOnChanges(changes) {
111
- if (changes.thySuffix && !changes.thySuffix.isFirstChange()) {
112
- const validValue = this.getCurrentValidValue(this.validValue);
113
- this.updateValidValue(validValue);
114
- this.displayValue = this.formatterValue(validValue);
115
- }
116
- }
117
131
  writeValue(value) {
118
132
  const _value = this.getCurrentValidValue(value);
119
133
  this.updateValidValue(_value);
120
- this.displayValue = this.formatterValue(_value);
121
- this.cdr.markForCheck();
134
+ this.displayValue.set(this.formatterValue(_value));
122
135
  }
123
136
  updateValidValue(value) {
124
137
  if (this.isNotValid(value)) {
@@ -127,14 +140,15 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
127
140
  else if (this.validValue !== value) {
128
141
  this.validValue = value;
129
142
  }
130
- this.disabledUp = this.disabledDown = false;
143
+ this.disabledUp.set(false);
144
+ this.disabledDown.set(false);
131
145
  if (value || value === 0) {
132
146
  const val = Number(value);
133
- if (val >= this.thyMax) {
134
- this.disabledUp = true;
147
+ if (val >= this.thyMax()) {
148
+ this.disabledUp.set(true);
135
149
  }
136
- if (val <= this.thyMin) {
137
- this.disabledDown = true;
150
+ if (val <= this.thyMin()) {
151
+ this.disabledDown.set(true);
138
152
  }
139
153
  }
140
154
  }
@@ -144,8 +158,8 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
144
158
  this.activeValue = value;
145
159
  }
146
160
  else {
147
- this.displayValue = parseValue;
148
- this.inputElement.nativeElement.value = parseValue;
161
+ this.displayValue.set(parseValue);
162
+ this.inputElement().nativeElement.value = parseValue;
149
163
  }
150
164
  const validValue = this.getCurrentValidValue(parseValue);
151
165
  if (`${this.validValue}` !== `${validValue}`) {
@@ -154,7 +168,7 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
154
168
  }
155
169
  }
156
170
  onInputFocus(event) {
157
- this.activeValue = this.parser(this.displayValue.toString());
171
+ this.activeValue = this.parser(this.displayValue().toString());
158
172
  if (!this.isFocused) {
159
173
  this.isFocused = true;
160
174
  this.thyFocus.emit(event);
@@ -170,14 +184,14 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
170
184
  this.stop();
171
185
  }
172
186
  else if (e.keyCode === ENTER) {
173
- this.displayValue = this.formatterValue(this.validValue);
187
+ this.displayValue.set(this.formatterValue(this.validValue));
174
188
  }
175
189
  }
176
190
  stop() {
177
191
  if (this.autoStepTimer) {
178
192
  clearTimeout(this.autoStepTimer);
179
193
  }
180
- this.displayValue = this.toNumber(this.displayValue);
194
+ this.displayValue.set(this.toNumber(this.displayValue()));
181
195
  }
182
196
  step(type, e) {
183
197
  this.stop();
@@ -193,36 +207,37 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
193
207
  else if (type === Type.down) {
194
208
  val = this.downStep(value);
195
209
  }
196
- const outOfRange = val > this.thyMax || val < this.thyMin;
210
+ const outOfRange = val > this.thyMax() || val < this.thyMin();
197
211
  val = this.getCurrentValidValue(val);
198
212
  this.updateValidValue(val);
199
213
  this.onChangeFn(this.validValue);
200
214
  this.thyStepChange.emit({ value: this.validValue, type });
201
- this.displayValue = this.formatterValue(val);
215
+ this.displayValue.set(this.formatterValue(val));
202
216
  if (outOfRange) {
203
217
  return;
204
218
  }
205
219
  this.autoStepTimer = setTimeout(() => {
206
220
  this[Type[type]](e);
207
- }, this.thyStepDelay);
221
+ }, this.thyStepDelay());
208
222
  }
209
223
  upStep(value) {
210
224
  const precisionFactor = this.getPrecisionFactor(value);
211
225
  const precision = this.getMaxPrecision(value);
212
- const result = ((precisionFactor * value + precisionFactor * this.thyStep) / precisionFactor).toFixed(precision);
226
+ const result = ((precisionFactor * value + precisionFactor * this.thyStep()) / precisionFactor).toFixed(precision);
213
227
  return this.toNumber(result);
214
228
  }
215
229
  downStep(value) {
216
230
  const precisionFactor = this.getPrecisionFactor(value);
217
231
  const precision = Math.abs(this.getMaxPrecision(value));
218
- const result = ((precisionFactor * value - precisionFactor * this.thyStep) / precisionFactor).toFixed(precision);
232
+ const result = ((precisionFactor * value - precisionFactor * this.thyStep()) / precisionFactor).toFixed(precision);
219
233
  return this.toNumber(result);
220
234
  }
221
235
  getMaxPrecision(value) {
222
- if (!isUndefinedOrNull(this.thyPrecision)) {
223
- return this.thyPrecision;
236
+ const precision = this.thyPrecision();
237
+ if (!isUndefinedOrNull(precision)) {
238
+ return precision;
224
239
  }
225
- const stepPrecision = this.getPrecision(this.thyStep);
240
+ const stepPrecision = this.getPrecision(this.thyStep());
226
241
  const currentValuePrecision = this.getPrecision(value);
227
242
  if (!value) {
228
243
  return stepPrecision;
@@ -247,17 +262,18 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
247
262
  return precision;
248
263
  }
249
264
  up(e) {
250
- this.inputElement.nativeElement.focus();
265
+ this.inputElement().nativeElement.focus();
251
266
  this.step(Type.up, e);
252
267
  }
253
268
  down(e) {
254
- this.inputElement.nativeElement.focus();
269
+ this.inputElement().nativeElement.focus();
255
270
  this.step(Type.down, e);
256
271
  }
257
272
  formatterValue(value) {
258
273
  const parseValue = this.parser(`${value}`);
259
274
  if (parseValue) {
260
- return this.thySuffix ? `${parseValue} ${this.thySuffix}` : parseValue;
275
+ const suffix = this.thySuffix();
276
+ return suffix ? `${parseValue} ${suffix}` : parseValue;
261
277
  }
262
278
  else {
263
279
  return '';
@@ -268,7 +284,7 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
268
284
  .trim()
269
285
  .replace(/。/g, '.')
270
286
  .replace(/[^\w\.-]+/g, '')
271
- .replace(this.thySuffix, '');
287
+ .replace(this.thySuffix(), '');
272
288
  }
273
289
  getCurrentValidValue(value) {
274
290
  let val = value;
@@ -279,11 +295,11 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
279
295
  if (this.isNotValid(val)) {
280
296
  val = this.validValue;
281
297
  }
282
- if (val < this.thyMin) {
283
- val = this.thyMin;
298
+ if (val < this.thyMin()) {
299
+ val = this.thyMin();
284
300
  }
285
- if (val > this.thyMax) {
286
- val = this.thyMax;
301
+ if (val > this.thyMax()) {
302
+ val = this.thyMax();
287
303
  }
288
304
  return this.toNumber(val);
289
305
  }
@@ -295,8 +311,9 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
295
311
  return num;
296
312
  }
297
313
  const numStr = String(num);
298
- if (numStr.indexOf('.') >= 0 && !isUndefinedOrNull(this.thyPrecision)) {
299
- return Number(Number(num).toFixed(this.thyPrecision));
314
+ const precision = this.thyPrecision();
315
+ if (numStr.indexOf('.') >= 0 && !isUndefinedOrNull(precision)) {
316
+ return Number(Number(num).toFixed(precision));
300
317
  }
301
318
  return Number(num);
302
319
  }
@@ -307,13 +324,13 @@ class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin {
307
324
  this.hostFocusControl.destroy();
308
325
  }
309
326
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyInputNumber, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
310
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.8", type: ThyInputNumber, isStandalone: true, selector: "thy-input-number", inputs: { thyAutoFocus: ["thyAutoFocus", "thyAutoFocus", coerceBooleanProperty], thyPlaceholder: "thyPlaceholder", thyDisabled: ["thyDisabled", "thyDisabled", coerceBooleanProperty], thyMax: "thyMax", thyMin: "thyMin", thyStep: ["thyStep", "thyStep", numberAttribute], thyStepDelay: ["thyStepDelay", "thyStepDelay", numberAttribute], thySize: "thySize", thyPrecision: "thyPrecision", thySuffix: "thySuffix" }, outputs: { thyBlur: "thyBlur", thyFocus: "thyFocus", thyStepChange: "thyStepChange" }, host: { properties: { "attr.tabindex": "tabIndex" }, classAttribute: "thy-input-number" }, providers: [
327
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: ThyInputNumber, isStandalone: true, selector: "thy-input-number", inputs: { thyAutoFocus: { classPropertyName: "thyAutoFocus", publicName: "thyAutoFocus", isSignal: true, isRequired: false, transformFunction: null }, thyPlaceholder: { classPropertyName: "thyPlaceholder", publicName: "thyPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, thyDisabled: { classPropertyName: "thyDisabled", publicName: "thyDisabled", isSignal: false, isRequired: false, transformFunction: coerceBooleanProperty }, thyMax: { classPropertyName: "thyMax", publicName: "thyMax", isSignal: true, isRequired: false, transformFunction: null }, thyMin: { classPropertyName: "thyMin", publicName: "thyMin", isSignal: true, isRequired: false, transformFunction: null }, thyStep: { classPropertyName: "thyStep", publicName: "thyStep", isSignal: true, isRequired: false, transformFunction: null }, thyStepDelay: { classPropertyName: "thyStepDelay", publicName: "thyStepDelay", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyPrecision: { classPropertyName: "thyPrecision", publicName: "thyPrecision", isSignal: true, isRequired: false, transformFunction: null }, thySuffix: { classPropertyName: "thySuffix", publicName: "thySuffix", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thyBlur: "thyBlur", thyFocus: "thyFocus", thyStepChange: "thyStepChange" }, host: { properties: { "attr.tabindex": "tabIndex" }, classAttribute: "thy-input-number" }, providers: [
311
328
  {
312
329
  provide: NG_VALUE_ACCESSOR,
313
330
  useExisting: forwardRef(() => ThyInputNumber),
314
331
  multi: true
315
332
  }
316
- ], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["input"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"input-number-handler-wrap\" [class.input-number-disabled]=\"thyDisabled\">\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-up\"\n (mousedown)=\"up($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledUp\">\n <thy-icon thyIconName=\"angle-up\"></thy-icon>\n </span>\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-down\"\n (mousedown)=\"down($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledDown\">\n <thy-icon thyIconName=\"angle-down\"></thy-icon>\n </span>\n</div>\n<input\n thyInput\n #input\n autocomplete=\"off\"\n class=\"input-number-input form-control\"\n [thySize]=\"thySize\"\n [thyAutofocus]=\"thyAutoFocus\"\n [disabled]=\"thyDisabled\"\n [attr.min]=\"thyMin\"\n [attr.max]=\"thyMax\"\n [placeholder]=\"thyPlaceholder\"\n [attr.step]=\"thyStep\"\n (keydown)=\"onKeyDown($event)\"\n (keyup)=\"stop()\"\n [(ngModel)]=\"displayValue\"\n (ngModelChange)=\"onModelChange($event)\"\n (focus)=\"onInputFocus($event)\"\n tabindex=\"-1\" />\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: ThyInputDirective, selector: "input[thyInput], select[thyInput], textarea[thyInput]", inputs: ["thySize"], exportAs: ["thyInput"] }, { kind: "directive", type: ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutofocus", "thyAutoSelect"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
333
+ ], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"input-number-handler-wrap\" [class.input-number-disabled]=\"thyDisabled\">\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-up\"\n (mousedown)=\"up($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledUp()\">\n <thy-icon thyIconName=\"angle-up\"></thy-icon>\n </span>\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-down\"\n (mousedown)=\"down($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledDown()\">\n <thy-icon thyIconName=\"angle-down\"></thy-icon>\n </span>\n</div>\n<input\n thyInput\n #input\n autocomplete=\"off\"\n class=\"input-number-input form-control\"\n [thySize]=\"thySize()\"\n [thyAutofocus]=\"thyAutoFocus()\"\n [disabled]=\"thyDisabled\"\n [attr.min]=\"thyMin()\"\n [attr.max]=\"thyMax()\"\n [placeholder]=\"thyPlaceholder()\"\n [attr.step]=\"thyStep()\"\n (keydown)=\"onKeyDown($event)\"\n (keyup)=\"stop()\"\n [(ngModel)]=\"displayValue\"\n (ngModelChange)=\"onModelChange($event)\"\n (focus)=\"onInputFocus($event)\"\n tabindex=\"-1\" />\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: ThyInputDirective, selector: "input[thyInput], select[thyInput], textarea[thyInput]", inputs: ["thySize"], exportAs: ["thyInput"] }, { kind: "directive", type: ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutofocus", "thyAutoSelect"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
317
334
  }
318
335
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyInputNumber, decorators: [{
319
336
  type: Component,
@@ -326,40 +343,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
326
343
  ], imports: [ThyIcon, ThyInputDirective, ThyAutofocusDirective, FormsModule], host: {
327
344
  class: 'thy-input-number',
328
345
  '[attr.tabindex]': 'tabIndex'
329
- }, template: "<div class=\"input-number-handler-wrap\" [class.input-number-disabled]=\"thyDisabled\">\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-up\"\n (mousedown)=\"up($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledUp\">\n <thy-icon thyIconName=\"angle-up\"></thy-icon>\n </span>\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-down\"\n (mousedown)=\"down($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledDown\">\n <thy-icon thyIconName=\"angle-down\"></thy-icon>\n </span>\n</div>\n<input\n thyInput\n #input\n autocomplete=\"off\"\n class=\"input-number-input form-control\"\n [thySize]=\"thySize\"\n [thyAutofocus]=\"thyAutoFocus\"\n [disabled]=\"thyDisabled\"\n [attr.min]=\"thyMin\"\n [attr.max]=\"thyMax\"\n [placeholder]=\"thyPlaceholder\"\n [attr.step]=\"thyStep\"\n (keydown)=\"onKeyDown($event)\"\n (keyup)=\"stop()\"\n [(ngModel)]=\"displayValue\"\n (ngModelChange)=\"onModelChange($event)\"\n (focus)=\"onInputFocus($event)\"\n tabindex=\"-1\" />\n" }]
330
- }], ctorParameters: () => [], propDecorators: { inputElement: [{
331
- type: ViewChild,
332
- args: ['input', { static: true }]
333
- }], thyAutoFocus: [{
346
+ }, template: "<div class=\"input-number-handler-wrap\" [class.input-number-disabled]=\"thyDisabled\">\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-up\"\n (mousedown)=\"up($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledUp()\">\n <thy-icon thyIconName=\"angle-up\"></thy-icon>\n </span>\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-down\"\n (mousedown)=\"down($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledDown()\">\n <thy-icon thyIconName=\"angle-down\"></thy-icon>\n </span>\n</div>\n<input\n thyInput\n #input\n autocomplete=\"off\"\n class=\"input-number-input form-control\"\n [thySize]=\"thySize()\"\n [thyAutofocus]=\"thyAutoFocus()\"\n [disabled]=\"thyDisabled\"\n [attr.min]=\"thyMin()\"\n [attr.max]=\"thyMax()\"\n [placeholder]=\"thyPlaceholder()\"\n [attr.step]=\"thyStep()\"\n (keydown)=\"onKeyDown($event)\"\n (keyup)=\"stop()\"\n [(ngModel)]=\"displayValue\"\n (ngModelChange)=\"onModelChange($event)\"\n (focus)=\"onInputFocus($event)\"\n tabindex=\"-1\" />\n" }]
347
+ }], ctorParameters: () => [], propDecorators: { thyDisabled: [{
334
348
  type: Input,
335
349
  args: [{ transform: coerceBooleanProperty }]
336
- }], thyPlaceholder: [{
337
- type: Input
338
- }], thyDisabled: [{
339
- type: Input,
340
- args: [{ transform: coerceBooleanProperty }]
341
- }], thyMax: [{
342
- type: Input
343
- }], thyMin: [{
344
- type: Input
345
- }], thyStep: [{
346
- type: Input,
347
- args: [{ transform: numberAttribute }]
348
- }], thyStepDelay: [{
349
- type: Input,
350
- args: [{ transform: numberAttribute }]
351
- }], thySize: [{
352
- type: Input
353
- }], thyPrecision: [{
354
- type: Input
355
- }], thySuffix: [{
356
- type: Input
357
- }], thyBlur: [{
358
- type: Output
359
- }], thyFocus: [{
360
- type: Output
361
- }], thyStepChange: [{
362
- type: Output
363
350
  }] } });
364
351
 
365
352
  class ThyInputNumberModule {
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys-input-number.mjs","sources":["../../../src/input-number/input-number.component.ts","../../../src/input-number/input-number.component.html","../../../src/input-number/module.ts","../../../src/input-number/ngx-tethys-input-number.ts"],"sourcesContent":["import { TabIndexDisabledControlValueAccessorMixin, useHostFocusControl } from 'ngx-tethys/core';\nimport { ThyMaxDirective, ThyMinDirective } from 'ngx-tethys/form';\nimport { ThyIcon } from 'ngx-tethys/icon';\nimport { ThyInputDirective } from 'ngx-tethys/input';\nimport { ThyAutofocusDirective } from 'ngx-tethys/shared';\nimport { coerceBooleanProperty, DOWN_ARROW, ENTER, isFloat, isNumber, isUndefinedOrNull, UP_ARROW } from 'ngx-tethys/util';\n\nimport { FocusOrigin } from '@angular/cdk/a11y';\nimport {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n numberAttribute,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n inject\n} from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\ntype InputSize = 'xs' | 'sm' | 'md' | 'lg' | '';\n\nenum Type {\n up,\n down\n}\n\n/**\n * 数字输入框\n * @name thy-input-number\n * @order 10\n */\n@Component({\n selector: 'thy-input-number',\n templateUrl: './input-number.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ThyInputNumber),\n multi: true\n }\n ],\n imports: [ThyIcon, ThyInputDirective, ThyAutofocusDirective, FormsModule],\n host: {\n class: 'thy-input-number',\n '[attr.tabindex]': 'tabIndex'\n }\n})\nexport class ThyInputNumber\n extends TabIndexDisabledControlValueAccessorMixin\n implements ControlValueAccessor, OnChanges, OnInit, OnDestroy\n{\n private cdr = inject(ChangeDetectorRef);\n\n @ViewChild('input', { static: true }) inputElement: ElementRef<any>;\n\n private autoStepTimer: any;\n\n private hostFocusControl = useHostFocusControl();\n\n validValue: number | string;\n\n displayValue: number | string;\n\n disabledUp = false;\n\n disabledDown = false;\n\n activeValue: string = '';\n\n /**\n * 是否自动聚焦\n * @default false\n */\n @Input({ transform: coerceBooleanProperty }) thyAutoFocus: boolean;\n\n /**\n * 输入框的placeholder\n */\n @Input() thyPlaceholder: string = '';\n\n /**\n * 是否禁用\n * @default false\n */\n @Input({ transform: coerceBooleanProperty }) thyDisabled: boolean;\n\n /**\n * 最大值\n * @default Infinity\n */\n @Input() set thyMax(value: number) {\n this.innerMax = isNumber(value) ? value : this.innerMax;\n if (this.displayValue || this.displayValue === 0) {\n const val = Number(this.displayValue);\n this.disabledUp = val >= this.innerMax;\n }\n }\n\n get thyMax() {\n return this.innerMax;\n }\n\n /**\n * 最小值\n * @default -Infinity\n */\n @Input() set thyMin(value: number) {\n this.innerMin = isNumber(value) ? value : this.innerMin;\n if (this.displayValue || this.displayValue === 0) {\n const val = Number(this.displayValue);\n this.disabledDown = val <= this.innerMin;\n }\n }\n\n get thyMin() {\n return this.innerMin;\n }\n\n /**\n * 每次改变步数,可以为小数\n */\n @Input({ transform: numberAttribute }) thyStep = 1;\n\n /**\n * 改变步数时的延迟毫秒数,值越小变化的速度越快\n * @default 300\n */\n @Input({ transform: numberAttribute }) thyStepDelay = 300;\n\n /**\n * 输入框大小\n * @type xs | sm | md | lg\n */\n @Input() thySize: InputSize;\n\n /**\n * 数值精度\n */\n @Input() thyPrecision: number;\n\n /**\n * 数值后缀\n */\n @Input() thySuffix: string;\n\n /**\n * 焦点失去事件\n */\n @Output() thyBlur = new EventEmitter<Event>();\n\n /**\n * 焦点激活事件\n */\n @Output() thyFocus = new EventEmitter<Event>();\n\n /**\n * 上下箭头点击事件\n */\n @Output() thyStepChange = new EventEmitter<{ value: number; type: Type }>();\n\n private innerMax: number = Infinity;\n\n private innerMin: number = -Infinity;\n\n private isFocused: boolean;\n\n constructor() {\n super();\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.thyDisabled = isDisabled;\n }\n\n ngOnInit() {\n this.hostFocusControl.focusChanged = (origin: FocusOrigin) => {\n if (this.thyDisabled) {\n return;\n }\n\n if (origin) {\n if (!this.isFocused) {\n this.inputElement.nativeElement.focus();\n }\n } else {\n if (this.isFocused) {\n this.displayValue = this.formatterValue(this.validValue);\n this.onTouchedFn();\n this.thyBlur.emit();\n this.isFocused = false;\n }\n }\n };\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.thySuffix && !changes.thySuffix.isFirstChange()) {\n const validValue = this.getCurrentValidValue(this.validValue);\n this.updateValidValue(validValue);\n this.displayValue = this.formatterValue(validValue);\n }\n }\n\n writeValue(value: number | string): void {\n const _value = this.getCurrentValidValue(value);\n this.updateValidValue(_value);\n this.displayValue = this.formatterValue(_value);\n this.cdr.markForCheck();\n }\n\n updateValidValue(value: number | string): void {\n if (this.isNotValid(value)) {\n this.validValue = '';\n } else if (this.validValue !== value) {\n this.validValue = value;\n }\n this.disabledUp = this.disabledDown = false;\n if (value || value === 0) {\n const val = Number(value);\n if (val >= this.thyMax) {\n this.disabledUp = true;\n }\n if (val <= this.thyMin) {\n this.disabledDown = true;\n }\n }\n }\n\n onModelChange(value: string): void {\n const parseValue = this.parser(value);\n if (this.isInputNumber(value)) {\n this.activeValue = value;\n } else {\n this.displayValue = parseValue;\n this.inputElement.nativeElement.value = parseValue;\n }\n const validValue = this.getCurrentValidValue(parseValue);\n if (`${this.validValue}` !== `${validValue}`) {\n this.updateValidValue(validValue);\n this.onChangeFn(validValue);\n }\n }\n\n onInputFocus(event?: Event) {\n this.activeValue = this.parser(this.displayValue.toString());\n if (!this.isFocused) {\n this.isFocused = true;\n this.thyFocus.emit(event);\n }\n }\n\n onKeyDown(e: KeyboardEvent): void {\n if (e.keyCode === UP_ARROW) {\n this.up(e);\n this.stop();\n } else if (e.keyCode === DOWN_ARROW) {\n this.down(e);\n this.stop();\n } else if (e.keyCode === ENTER) {\n this.displayValue = this.formatterValue(this.validValue);\n }\n }\n\n stop() {\n if (this.autoStepTimer) {\n clearTimeout(this.autoStepTimer);\n }\n this.displayValue = this.toNumber(this.displayValue);\n }\n\n step(type: Type, e: MouseEvent | KeyboardEvent): void {\n this.stop();\n e.preventDefault();\n if (this.thyDisabled) {\n return;\n }\n const value = this.validValue as number;\n let val;\n if (type === Type.up) {\n val = this.upStep(value);\n } else if (type === Type.down) {\n val = this.downStep(value);\n }\n const outOfRange = val > this.thyMax || val < this.thyMin;\n val = this.getCurrentValidValue(val);\n this.updateValidValue(val);\n this.onChangeFn(this.validValue);\n this.thyStepChange.emit({ value: this.validValue as number, type });\n this.displayValue = this.formatterValue(val);\n if (outOfRange) {\n return;\n }\n this.autoStepTimer = setTimeout(() => {\n (this[Type[type]] as (e: MouseEvent | KeyboardEvent) => void)(e);\n }, this.thyStepDelay);\n }\n\n upStep(value: number): number {\n const precisionFactor = this.getPrecisionFactor(value);\n const precision = this.getMaxPrecision(value);\n const result = ((precisionFactor * value + precisionFactor * this.thyStep) / precisionFactor).toFixed(precision);\n return this.toNumber(result);\n }\n\n downStep(value: number): number {\n const precisionFactor = this.getPrecisionFactor(value);\n const precision = Math.abs(this.getMaxPrecision(value));\n const result = ((precisionFactor * value - precisionFactor * this.thyStep) / precisionFactor).toFixed(precision);\n return this.toNumber(result);\n }\n\n getMaxPrecision(value: string | number): number {\n if (!isUndefinedOrNull(this.thyPrecision)) {\n return this.thyPrecision;\n }\n const stepPrecision = this.getPrecision(this.thyStep);\n const currentValuePrecision = this.getPrecision(value as number);\n if (!value) {\n return stepPrecision;\n }\n return Math.max(currentValuePrecision, stepPrecision);\n }\n\n getPrecisionFactor(activeValue: string | number): number {\n const precision = this.getMaxPrecision(activeValue);\n return Math.pow(10, precision);\n }\n\n getPrecision(value: number): number {\n const valueString = value.toString();\n // 0.0000000004.toString() = 4e10 => 10\n if (valueString.indexOf('e-') >= 0) {\n return parseInt(valueString.slice(valueString.indexOf('e-') + 2), 10);\n }\n let precision = 0;\n // 1.2222 => 4\n if (valueString.indexOf('.') >= 0) {\n precision = valueString.length - valueString.indexOf('.') - 1;\n }\n return precision;\n }\n\n up(e: MouseEvent | KeyboardEvent) {\n this.inputElement.nativeElement.focus();\n this.step(Type.up, e);\n }\n\n down(e: MouseEvent | KeyboardEvent) {\n this.inputElement.nativeElement.focus();\n this.step(Type.down, e);\n }\n\n formatterValue(value: number | string) {\n const parseValue = this.parser(`${value}`);\n if (parseValue) {\n return this.thySuffix ? `${parseValue} ${this.thySuffix}` : parseValue;\n } else {\n return '';\n }\n }\n\n parser(value: string) {\n return value\n .trim()\n .replace(/。/g, '.')\n .replace(/[^\\w\\.-]+/g, '')\n .replace(this.thySuffix, '');\n }\n\n getCurrentValidValue(value: string | number): number | string {\n let val = value;\n if (value === '' || isUndefinedOrNull(value)) {\n return '';\n }\n val = parseFloat(value as string);\n if (this.isNotValid(val)) {\n val = this.validValue;\n }\n if ((val as number) < this.thyMin) {\n val = this.thyMin;\n }\n if ((val as number) > this.thyMax) {\n val = this.thyMax;\n }\n\n return this.toNumber(val);\n }\n\n isNotValid(num: string | number): boolean {\n return isNaN(num as number) || num === '' || num === null || !!(num && num.toString().indexOf('.') === num.toString().length - 1);\n }\n\n toNumber(num: string | number): number {\n if (this.isNotValid(num)) {\n return num as number;\n }\n const numStr = String(num);\n if (numStr.indexOf('.') >= 0 && !isUndefinedOrNull(this.thyPrecision)) {\n return Number(Number(num).toFixed(this.thyPrecision));\n }\n return Number(num);\n }\n\n isInputNumber(value: string) {\n return isFloat(value) || /^[-+Ee]$|^([-+.]?[0-9])*(([.]|[.eE])?[eE]?[+-]?)?$|^$/.test(value);\n }\n\n ngOnDestroy() {\n this.hostFocusControl.destroy();\n }\n}\n","<div class=\"input-number-handler-wrap\" [class.input-number-disabled]=\"thyDisabled\">\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-up\"\n (mousedown)=\"up($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledUp\">\n <thy-icon thyIconName=\"angle-up\"></thy-icon>\n </span>\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-down\"\n (mousedown)=\"down($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledDown\">\n <thy-icon thyIconName=\"angle-down\"></thy-icon>\n </span>\n</div>\n<input\n thyInput\n #input\n autocomplete=\"off\"\n class=\"input-number-input form-control\"\n [thySize]=\"thySize\"\n [thyAutofocus]=\"thyAutoFocus\"\n [disabled]=\"thyDisabled\"\n [attr.min]=\"thyMin\"\n [attr.max]=\"thyMax\"\n [placeholder]=\"thyPlaceholder\"\n [attr.step]=\"thyStep\"\n (keydown)=\"onKeyDown($event)\"\n (keyup)=\"stop()\"\n [(ngModel)]=\"displayValue\"\n (ngModelChange)=\"onModelChange($event)\"\n (focus)=\"onInputFocus($event)\"\n tabindex=\"-1\" />\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThyInputNumber } from './input-number.component';\nimport { ThyInputModule } from 'ngx-tethys/input';\nimport { ThyFormModule } from 'ngx-tethys/form';\n\n@NgModule({\n imports: [CommonModule, FormsModule, ThySharedModule, ThyIconModule, ThyInputModule, ThyFormModule, ThyInputNumber],\n exports: [ThyInputNumber]\n})\nexport class ThyInputNumberModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AA4BA,IAAK,IAGJ;AAHD,CAAA,UAAK,IAAI,EAAA;AACL,IAAA,IAAA,CAAA,IAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAE;AACF,IAAA,IAAA,CAAA,IAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI;AACR,CAAC,EAHI,IAAI,KAAJ,IAAI,GAGR,EAAA,CAAA,CAAA;AAED;;;;AAIG;AAiBG,MAAO,cACT,SAAQ,yCAAyC,CAAA;AAsCjD;;;AAGG;IACH,IAAa,MAAM,CAAC,KAAa,EAAA;AAC7B,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,QAAQ;QACvD,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,EAAE;YAC9C,MAAM,GAAG,GAAG,MAA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,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,EAHnB,OAAA,EAAA,CAAA,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,CAAA,EAAA,CAAA,CAAA;;2FAGzG,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,CAAC;oBACnH,OAAO,EAAE,CAAC,cAAc;AAC3B,iBAAA;;;ACZD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys-input-number.mjs","sources":["../../../src/input-number/input-number.component.ts","../../../src/input-number/input-number.component.html","../../../src/input-number/module.ts","../../../src/input-number/ngx-tethys-input-number.ts"],"sourcesContent":["import { TabIndexDisabledControlValueAccessorMixin, useHostFocusControl } from 'ngx-tethys/core';\nimport { ThyMaxDirective, ThyMinDirective } from 'ngx-tethys/form';\nimport { ThyIcon } from 'ngx-tethys/icon';\nimport { ThyInputDirective } from 'ngx-tethys/input';\nimport { ThyAutofocusDirective } from 'ngx-tethys/shared';\nimport { coerceBooleanProperty, DOWN_ARROW, ENTER, isFloat, isNumber, isUndefinedOrNull, UP_ARROW } from 'ngx-tethys/util';\n\nimport { FocusOrigin } from '@angular/cdk/a11y';\nimport {\n Component,\n ElementRef,\n forwardRef,\n Input,\n numberAttribute,\n OnDestroy,\n OnInit,\n input,\n effect,\n signal,\n output,\n viewChild\n} from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\ntype InputSize = 'xs' | 'sm' | 'md' | 'lg' | '';\n\nenum Type {\n up,\n down\n}\n\n/**\n * 数字输入框\n * @name thy-input-number\n * @order 10\n */\n@Component({\n selector: 'thy-input-number',\n templateUrl: './input-number.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ThyInputNumber),\n multi: true\n }\n ],\n imports: [ThyIcon, ThyInputDirective, ThyAutofocusDirective, FormsModule],\n host: {\n class: 'thy-input-number',\n '[attr.tabindex]': 'tabIndex'\n }\n})\nexport class ThyInputNumber extends TabIndexDisabledControlValueAccessorMixin implements ControlValueAccessor, OnInit, OnDestroy {\n readonly inputElement = viewChild<ElementRef<any>>('input');\n\n private autoStepTimer: any;\n\n private hostFocusControl = useHostFocusControl();\n\n validValue: number | string;\n\n displayValue = signal<number | string>(undefined);\n\n disabledUp = signal(false);\n\n disabledDown = signal(false);\n\n activeValue: string = '';\n\n /**\n * 是否自动聚焦\n * @default false\n */\n readonly thyAutoFocus = input<boolean, boolean | string | number>(false, { transform: coerceBooleanProperty });\n\n /**\n * 输入框的placeholder\n */\n readonly thyPlaceholder = input<string>('');\n\n /**\n * 是否禁用\n * @default false\n */\n @Input({ transform: coerceBooleanProperty }) thyDisabled: boolean;\n\n /**\n * 最大值\n * @default Infinity\n */\n readonly thyMax = input(Infinity, { transform: (value: number) => (isNumber(value) ? value : Infinity) });\n\n /**\n * 最小值\n * @default -Infinity\n */\n readonly thyMin = input(-Infinity, { transform: (value: number) => (isNumber(value) ? value : -Infinity) });\n\n /**\n * 每次改变步数,可以为小数\n */\n readonly thyStep = input(1, { transform: numberAttribute });\n\n /**\n * 改变步数时的延迟毫秒数,值越小变化的速度越快\n * @default 300\n */\n readonly thyStepDelay = input(300, { transform: numberAttribute });\n\n /**\n * 输入框大小\n * @type xs | sm | md | lg\n */\n readonly thySize = input<InputSize>();\n\n /**\n * 数值精度\n */\n readonly thyPrecision = input<number>();\n\n /**\n * 数值后缀\n */\n readonly thySuffix = input<string>();\n\n /**\n * 焦点失去事件\n */\n readonly thyBlur = output();\n\n /**\n * 焦点激活事件\n */\n readonly thyFocus = output<Event>();\n\n /**\n * 上下箭头点击事件\n */\n readonly thyStepChange = output<{ value: number; type: Type }>();\n\n private isFocused: boolean;\n\n constructor() {\n super();\n\n effect(() => {\n const displayValue = this.displayValue();\n const max = this.thyMax();\n if (displayValue || displayValue === 0) {\n const val = Number(displayValue);\n this.disabledUp.set(val >= max);\n }\n });\n\n effect(() => {\n const min = this.thyMin();\n const displayValue = this.displayValue();\n if (displayValue || displayValue === 0) {\n const val = Number(displayValue);\n this.disabledDown.set(val <= min);\n }\n });\n\n effect(() => {\n const suffix = this.thySuffix();\n const validValue = this.getCurrentValidValue(this.validValue);\n this.updateValidValue(validValue);\n this.displayValue.set(this.formatterValue(validValue));\n });\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.thyDisabled = isDisabled;\n }\n\n ngOnInit() {\n this.hostFocusControl.focusChanged = (origin: FocusOrigin) => {\n if (this.thyDisabled) {\n return;\n }\n\n if (origin) {\n if (!this.isFocused) {\n this.inputElement().nativeElement.focus();\n }\n } else {\n if (this.isFocused) {\n this.displayValue.set(this.formatterValue(this.validValue));\n this.onTouchedFn();\n this.thyBlur.emit();\n this.isFocused = false;\n }\n }\n };\n }\n\n writeValue(value: number | string): void {\n const _value = this.getCurrentValidValue(value);\n this.updateValidValue(_value);\n this.displayValue.set(this.formatterValue(_value));\n }\n\n updateValidValue(value: number | string): void {\n if (this.isNotValid(value)) {\n this.validValue = '';\n } else if (this.validValue !== value) {\n this.validValue = value;\n }\n this.disabledUp.set(false);\n this.disabledDown.set(false);\n if (value || value === 0) {\n const val = Number(value);\n if (val >= this.thyMax()) {\n this.disabledUp.set(true);\n }\n if (val <= this.thyMin()) {\n this.disabledDown.set(true);\n }\n }\n }\n\n onModelChange(value: string): void {\n const parseValue = this.parser(value);\n if (this.isInputNumber(value)) {\n this.activeValue = value;\n } else {\n this.displayValue.set(parseValue);\n this.inputElement().nativeElement.value = parseValue;\n }\n const validValue = this.getCurrentValidValue(parseValue);\n if (`${this.validValue}` !== `${validValue}`) {\n this.updateValidValue(validValue);\n this.onChangeFn(validValue);\n }\n }\n\n onInputFocus(event?: Event) {\n this.activeValue = this.parser(this.displayValue().toString());\n if (!this.isFocused) {\n this.isFocused = true;\n this.thyFocus.emit(event);\n }\n }\n\n onKeyDown(e: KeyboardEvent): void {\n if (e.keyCode === UP_ARROW) {\n this.up(e);\n this.stop();\n } else if (e.keyCode === DOWN_ARROW) {\n this.down(e);\n this.stop();\n } else if (e.keyCode === ENTER) {\n this.displayValue.set(this.formatterValue(this.validValue));\n }\n }\n\n stop() {\n if (this.autoStepTimer) {\n clearTimeout(this.autoStepTimer);\n }\n this.displayValue.set(this.toNumber(this.displayValue()));\n }\n\n step(type: Type, e: MouseEvent | KeyboardEvent): void {\n this.stop();\n e.preventDefault();\n if (this.thyDisabled) {\n return;\n }\n const value = this.validValue as number;\n let val;\n if (type === Type.up) {\n val = this.upStep(value);\n } else if (type === Type.down) {\n val = this.downStep(value);\n }\n const outOfRange = val > this.thyMax() || val < this.thyMin();\n val = this.getCurrentValidValue(val);\n this.updateValidValue(val);\n this.onChangeFn(this.validValue);\n this.thyStepChange.emit({ value: this.validValue as number, type });\n this.displayValue.set(this.formatterValue(val));\n if (outOfRange) {\n return;\n }\n this.autoStepTimer = setTimeout(() => {\n (this[Type[type] as keyof typeof Type] as (e: MouseEvent | KeyboardEvent) => void)(e);\n }, this.thyStepDelay());\n }\n\n upStep(value: number): number {\n const precisionFactor = this.getPrecisionFactor(value);\n const precision = this.getMaxPrecision(value);\n const result = ((precisionFactor * value + precisionFactor * this.thyStep()) / precisionFactor).toFixed(precision);\n return this.toNumber(result);\n }\n\n downStep(value: number): number {\n const precisionFactor = this.getPrecisionFactor(value);\n const precision = Math.abs(this.getMaxPrecision(value));\n const result = ((precisionFactor * value - precisionFactor * this.thyStep()) / precisionFactor).toFixed(precision);\n return this.toNumber(result);\n }\n\n getMaxPrecision(value: string | number): number {\n const precision = this.thyPrecision();\n if (!isUndefinedOrNull(precision)) {\n return precision;\n }\n const stepPrecision = this.getPrecision(this.thyStep());\n const currentValuePrecision = this.getPrecision(value as number);\n if (!value) {\n return stepPrecision;\n }\n return Math.max(currentValuePrecision, stepPrecision);\n }\n\n getPrecisionFactor(activeValue: string | number): number {\n const precision = this.getMaxPrecision(activeValue);\n return Math.pow(10, precision);\n }\n\n getPrecision(value: number): number {\n const valueString = value.toString();\n // 0.0000000004.toString() = 4e10 => 10\n if (valueString.indexOf('e-') >= 0) {\n return parseInt(valueString.slice(valueString.indexOf('e-') + 2), 10);\n }\n let precision = 0;\n // 1.2222 => 4\n if (valueString.indexOf('.') >= 0) {\n precision = valueString.length - valueString.indexOf('.') - 1;\n }\n return precision;\n }\n\n up(e: MouseEvent | KeyboardEvent) {\n this.inputElement().nativeElement.focus();\n this.step(Type.up, e);\n }\n\n down(e: MouseEvent | KeyboardEvent) {\n this.inputElement().nativeElement.focus();\n this.step(Type.down, e);\n }\n\n formatterValue(value: number | string) {\n const parseValue = this.parser(`${value}`);\n if (parseValue) {\n const suffix = this.thySuffix();\n return suffix ? `${parseValue} ${suffix}` : parseValue;\n } else {\n return '';\n }\n }\n\n parser(value: string) {\n return value\n .trim()\n .replace(/。/g, '.')\n .replace(/[^\\w\\.-]+/g, '')\n .replace(this.thySuffix(), '');\n }\n\n getCurrentValidValue(value: string | number): number | string {\n let val = value;\n if (value === '' || isUndefinedOrNull(value)) {\n return '';\n }\n val = parseFloat(value as string);\n if (this.isNotValid(val)) {\n val = this.validValue;\n }\n if ((val as number) < this.thyMin()) {\n val = this.thyMin();\n }\n if ((val as number) > this.thyMax()) {\n val = this.thyMax();\n }\n\n return this.toNumber(val);\n }\n\n isNotValid(num: string | number): boolean {\n return isNaN(num as number) || num === '' || num === null || !!(num && num.toString().indexOf('.') === num.toString().length - 1);\n }\n\n toNumber(num: string | number): number {\n if (this.isNotValid(num)) {\n return num as number;\n }\n const numStr = String(num);\n const precision = this.thyPrecision();\n if (numStr.indexOf('.') >= 0 && !isUndefinedOrNull(precision)) {\n return Number(Number(num).toFixed(precision));\n }\n return Number(num);\n }\n\n isInputNumber(value: string) {\n return isFloat(value) || /^[-+Ee]$|^([-+.]?[0-9])*(([.]|[.eE])?[eE]?[+-]?)?$|^$/.test(value);\n }\n\n ngOnDestroy() {\n this.hostFocusControl.destroy();\n }\n}\n","<div class=\"input-number-handler-wrap\" [class.input-number-disabled]=\"thyDisabled\">\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-up\"\n (mousedown)=\"up($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledUp()\">\n <thy-icon thyIconName=\"angle-up\"></thy-icon>\n </span>\n <span\n unselectable=\"unselectable\"\n class=\"input-number-handler input-number-handler-down\"\n (mousedown)=\"down($event)\"\n (mouseup)=\"stop()\"\n (mouseleave)=\"stop()\"\n [class.disabled]=\"disabledDown()\">\n <thy-icon thyIconName=\"angle-down\"></thy-icon>\n </span>\n</div>\n<input\n thyInput\n #input\n autocomplete=\"off\"\n class=\"input-number-input form-control\"\n [thySize]=\"thySize()\"\n [thyAutofocus]=\"thyAutoFocus()\"\n [disabled]=\"thyDisabled\"\n [attr.min]=\"thyMin()\"\n [attr.max]=\"thyMax()\"\n [placeholder]=\"thyPlaceholder()\"\n [attr.step]=\"thyStep()\"\n (keydown)=\"onKeyDown($event)\"\n (keyup)=\"stop()\"\n [(ngModel)]=\"displayValue\"\n (ngModelChange)=\"onModelChange($event)\"\n (focus)=\"onInputFocus($event)\"\n tabindex=\"-1\" />\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThyInputNumber } from './input-number.component';\nimport { ThyInputModule } from 'ngx-tethys/input';\nimport { ThyFormModule } from 'ngx-tethys/form';\n\n@NgModule({\n imports: [CommonModule, FormsModule, ThySharedModule, ThyIconModule, ThyInputModule, ThyFormModule, ThyInputNumber],\n exports: [Th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