@tiny-design/react 1.3.0 → 1.5.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 (190) hide show
  1. package/es/alert/style/_index.scss +2 -2
  2. package/es/alert/style/index.css +2 -2
  3. package/es/auto-complete/style/_index.scss +4 -5
  4. package/es/auto-complete/style/index.css +4 -5
  5. package/es/breadcrumb/style/index.css +1 -1
  6. package/es/breadcrumb/types.d.ts +1 -1
  7. package/es/button/style/_index.scss +16 -11
  8. package/es/button/style/index.css +40 -19
  9. package/es/calendar/style/_index.scss +9 -9
  10. package/es/calendar/style/index.css +9 -9
  11. package/es/card/style/index.css +3 -3
  12. package/es/cascader/style/_index.scss +9 -9
  13. package/es/cascader/style/index.css +9 -9
  14. package/es/checkbox/style/_index.scss +9 -12
  15. package/es/checkbox/style/index.css +9 -12
  16. package/es/collapse/style/index.css +3 -3
  17. package/es/color-picker/style/_index.scss +7 -7
  18. package/es/color-picker/style/index.css +4 -4
  19. package/es/date-picker/style/_index.scss +1 -1
  20. package/es/date-picker/style/index.css +1 -1
  21. package/es/descriptions/style/_index.scss +5 -6
  22. package/es/descriptions/style/index.css +6 -6
  23. package/es/empty/style/_index.scss +1 -1
  24. package/es/empty/style/index.css +1 -1
  25. package/es/form/style/_index.scss +5 -6
  26. package/es/form/style/index.css +4 -4
  27. package/es/index.d.ts +2 -1
  28. package/es/index.js +2 -1
  29. package/es/input/style/_index.scss +5 -4
  30. package/es/input/style/_mixin.scss +1 -1
  31. package/es/input/style/index.css +21 -20
  32. package/es/input-number/input-number.js +11 -5
  33. package/es/input-number/input-number.js.map +1 -1
  34. package/es/input-number/style/_index.scss +5 -3
  35. package/es/input-number/style/index.css +13 -11
  36. package/es/input-otp/style/_index.scss +1 -1
  37. package/es/input-otp/style/index.css +8 -8
  38. package/es/list/style/_index.scss +3 -3
  39. package/es/list/style/index.css +3 -3
  40. package/es/marquee/index.d.ts +1 -0
  41. package/es/marquee/index.js +9 -0
  42. package/es/marquee/index.js.map +1 -0
  43. package/es/marquee/marquee.d.ts +8 -0
  44. package/es/marquee/marquee.js +42 -0
  45. package/es/marquee/marquee.js.map +1 -0
  46. package/es/marquee/style/_index.scss +77 -0
  47. package/es/marquee/style/index.css +64 -0
  48. package/es/marquee/style/index.d.ts +1 -0
  49. package/es/marquee/style/index.js +1 -0
  50. package/es/marquee/types.d.ts +21 -0
  51. package/es/native-select/style/index.css +4 -4
  52. package/es/notification/style/_index.scss +1 -1
  53. package/es/notification/style/index.css +1 -1
  54. package/es/pop-confirm/style/_index.scss +5 -1
  55. package/es/pop-confirm/style/index.css +5 -1
  56. package/es/popup/style/_index.scss +9 -9
  57. package/es/popup/style/index.css +10 -10
  58. package/es/radio/style/_index.scss +5 -8
  59. package/es/radio/style/index.css +5 -8
  60. package/es/segmented/style/_index.scss +10 -10
  61. package/es/segmented/style/index.css +9 -9
  62. package/es/select/style/_index.scss +16 -17
  63. package/es/select/style/index.css +15 -16
  64. package/es/slider/style/_index.scss +1 -9
  65. package/es/slider/style/index.css +1 -6
  66. package/es/speed-dial/style/_index.scss +8 -9
  67. package/es/speed-dial/style/index.css +7 -7
  68. package/es/statistic/style/_index.scss +2 -2
  69. package/es/statistic/style/index.css +2 -2
  70. package/es/style/_component.scss +1 -0
  71. package/es/style/base.css +81 -3
  72. package/es/table/style/_index.scss +6 -6
  73. package/es/table/style/index.css +5 -5
  74. package/es/tag/style/_index.scss +24 -0
  75. package/es/tag/style/index.css +21 -1
  76. package/es/tag/types.d.ts +2 -1
  77. package/es/tag/types.js +7 -2
  78. package/es/tag/types.js.map +1 -1
  79. package/es/textarea/style/index.css +2 -2
  80. package/es/time-picker/style/_index.scss +14 -1
  81. package/es/time-picker/style/index.css +11 -1
  82. package/es/time-picker/time-panel.js +28 -28
  83. package/es/time-picker/time-panel.js.map +1 -1
  84. package/es/time-picker/time-picker.js +50 -29
  85. package/es/time-picker/time-picker.js.map +1 -1
  86. package/es/timeline/style/_index.scss +3 -3
  87. package/es/timeline/style/index.css +3 -3
  88. package/es/tooltip/style/index.css +1 -1
  89. package/es/transfer/style/_index.scss +4 -4
  90. package/es/transfer/style/index.css +4 -4
  91. package/es/tree/style/index.css +1 -1
  92. package/es/typography/style/_index.scss +2 -2
  93. package/es/typography/style/index.css +2 -2
  94. package/es/upload/style/_index.scss +4 -4
  95. package/es/upload/style/index.css +4 -4
  96. package/lib/alert/style/_index.scss +2 -2
  97. package/lib/alert/style/index.css +2 -2
  98. package/lib/auto-complete/style/_index.scss +4 -5
  99. package/lib/auto-complete/style/index.css +4 -5
  100. package/lib/breadcrumb/style/index.css +1 -1
  101. package/lib/breadcrumb/types.d.ts +1 -1
  102. package/lib/button/style/_index.scss +16 -11
  103. package/lib/button/style/index.css +40 -19
  104. package/lib/calendar/style/_index.scss +9 -9
  105. package/lib/calendar/style/index.css +9 -9
  106. package/lib/card/style/index.css +3 -3
  107. package/lib/cascader/style/_index.scss +9 -9
  108. package/lib/cascader/style/index.css +9 -9
  109. package/lib/checkbox/style/_index.scss +9 -12
  110. package/lib/checkbox/style/index.css +9 -12
  111. package/lib/collapse/style/index.css +3 -3
  112. package/lib/color-picker/style/_index.scss +7 -7
  113. package/lib/color-picker/style/index.css +4 -4
  114. package/lib/date-picker/style/_index.scss +1 -1
  115. package/lib/date-picker/style/index.css +1 -1
  116. package/lib/descriptions/style/_index.scss +5 -6
  117. package/lib/descriptions/style/index.css +6 -6
  118. package/lib/empty/style/_index.scss +1 -1
  119. package/lib/empty/style/index.css +1 -1
  120. package/lib/form/style/_index.scss +5 -6
  121. package/lib/form/style/index.css +4 -4
  122. package/lib/index.d.ts +2 -1
  123. package/lib/index.js +76 -74
  124. package/lib/input/style/_index.scss +5 -4
  125. package/lib/input/style/_mixin.scss +1 -1
  126. package/lib/input/style/index.css +21 -20
  127. package/lib/input-number/input-number.js +11 -5
  128. package/lib/input-number/input-number.js.map +1 -1
  129. package/lib/input-number/style/_index.scss +5 -3
  130. package/lib/input-number/style/index.css +13 -11
  131. package/lib/input-otp/style/_index.scss +1 -1
  132. package/lib/input-otp/style/index.css +8 -8
  133. package/lib/list/style/_index.scss +3 -3
  134. package/lib/list/style/index.css +3 -3
  135. package/lib/marquee/index.js +8 -0
  136. package/lib/marquee/index.js.map +1 -0
  137. package/lib/marquee/marquee.d.ts +8 -0
  138. package/lib/marquee/marquee.js +45 -0
  139. package/lib/marquee/marquee.js.map +1 -0
  140. package/lib/marquee/style/_index.scss +77 -0
  141. package/lib/marquee/style/index.css +64 -0
  142. package/lib/marquee/style/index.d.ts +1 -0
  143. package/lib/marquee/style/index.js +1 -0
  144. package/lib/marquee/types.d.ts +21 -0
  145. package/lib/native-select/style/index.css +4 -4
  146. package/lib/notification/style/_index.scss +1 -1
  147. package/lib/notification/style/index.css +1 -1
  148. package/lib/pop-confirm/style/_index.scss +5 -1
  149. package/lib/pop-confirm/style/index.css +5 -1
  150. package/lib/popup/style/_index.scss +9 -9
  151. package/lib/popup/style/index.css +10 -10
  152. package/lib/radio/style/_index.scss +5 -8
  153. package/lib/radio/style/index.css +5 -8
  154. package/lib/segmented/style/_index.scss +10 -10
  155. package/lib/segmented/style/index.css +9 -9
  156. package/lib/select/style/_index.scss +16 -17
  157. package/lib/select/style/index.css +15 -16
  158. package/lib/slider/style/_index.scss +1 -9
  159. package/lib/slider/style/index.css +1 -6
  160. package/lib/speed-dial/style/_index.scss +8 -9
  161. package/lib/speed-dial/style/index.css +7 -7
  162. package/lib/statistic/style/_index.scss +2 -2
  163. package/lib/statistic/style/index.css +2 -2
  164. package/lib/style/_component.scss +1 -0
  165. package/lib/style/base.css +81 -3
  166. package/lib/table/style/_index.scss +6 -6
  167. package/lib/table/style/index.css +5 -5
  168. package/lib/tag/style/_index.scss +24 -0
  169. package/lib/tag/style/index.css +21 -1
  170. package/lib/tag/types.d.ts +2 -1
  171. package/lib/tag/types.js +7 -2
  172. package/lib/tag/types.js.map +1 -1
  173. package/lib/textarea/style/index.css +2 -2
  174. package/lib/time-picker/style/_index.scss +14 -1
  175. package/lib/time-picker/style/index.css +11 -1
  176. package/lib/time-picker/time-panel.js +28 -28
  177. package/lib/time-picker/time-panel.js.map +1 -1
  178. package/lib/time-picker/time-picker.js +50 -29
  179. package/lib/time-picker/time-picker.js.map +1 -1
  180. package/lib/timeline/style/_index.scss +3 -3
  181. package/lib/timeline/style/index.css +3 -3
  182. package/lib/tooltip/style/index.css +1 -1
  183. package/lib/transfer/style/_index.scss +4 -4
  184. package/lib/transfer/style/index.css +4 -4
  185. package/lib/tree/style/index.css +1 -1
  186. package/lib/typography/style/_index.scss +2 -2
  187. package/lib/typography/style/index.css +2 -2
  188. package/lib/upload/style/_index.scss +4 -4
  189. package/lib/upload/style/index.css +4 -4
  190. package/package.json +3 -3
@@ -18,7 +18,7 @@
18
18
  .ty-color-picker__swatch {
19
19
  width: 32px;
20
20
  height: 32px;
21
- border-radius: 2px;
21
+ border-radius: var(--ty-border-radius);
22
22
  border: 1px solid var(--ty-color-picker-border, #dee2e6);
23
23
  padding: 3px;
24
24
  cursor: pointer;
@@ -124,7 +124,7 @@
124
124
  .ty-color-picker__format-btn {
125
125
  border: 1px solid var(--ty-color-picker-border, #dee2e6);
126
126
  background: transparent;
127
- border-radius: 2px;
127
+ border-radius: var(--ty-border-radius);
128
128
  padding: 2px 6px;
129
129
  cursor: pointer;
130
130
  font-size: 12px;
@@ -137,7 +137,7 @@
137
137
  .ty-color-picker__hex-input {
138
138
  flex: 1;
139
139
  border: 1px solid var(--ty-color-picker-border, #dee2e6);
140
- border-radius: 2px;
140
+ border-radius: var(--ty-border-radius);
141
141
  padding: 2px 6px;
142
142
  font-size: 12px;
143
143
  font-family: lucida console, consolas, monaco, andale mono, ubuntu mono, monospace;
@@ -159,7 +159,7 @@
159
159
  .ty-color-picker__preset {
160
160
  width: 20px;
161
161
  height: 20px;
162
- border-radius: 2px;
162
+ border-radius: var(--ty-border-radius);
163
163
  cursor: pointer;
164
164
  border: 1px solid var(--ty-color-picker-border, #dee2e6);
165
165
  transition: transform 0.15s;
@@ -5,7 +5,7 @@ $dp: #{$prefix}-date-picker;
5
5
  .#{$dp} {
6
6
  display: inline-flex;
7
7
  position: relative;
8
- font-size: $font-size-base;
8
+ font-size: var(--ty-font-size-base);
9
9
 
10
10
  // ---- Input ----
11
11
  &__input {
@@ -1,7 +1,7 @@
1
1
  .ty-date-picker {
2
2
  display: inline-flex;
3
3
  position: relative;
4
- font-size: 1rem;
4
+ font-size: var(--ty-font-size-base);
5
5
  }
6
6
  .ty-date-picker__input {
7
7
  display: inline-flex;
@@ -1,7 +1,6 @@
1
1
  @use '../../style/variables' as *;
2
2
 
3
3
  .#{$prefix}-descriptions {
4
-
5
4
  &__body {
6
5
  width: 100%;
7
6
  overflow: hidden;
@@ -24,7 +23,7 @@
24
23
  font-size: 16px;
25
24
  }
26
25
 
27
- &__item_colon:after {
26
+ &__item_colon::after {
28
27
  content: ':';
29
28
  margin-left: 2px;
30
29
  margin-right: 5px;
@@ -32,15 +31,15 @@
32
31
 
33
32
  &__item-label {
34
33
  color: var(--ty-color-text-label);
35
- font-size: $font-size-base;
34
+ font-size: var(--ty-font-size-base);
36
35
  font-weight: 400;
37
- line-height: $line-height-base;
36
+ line-height: var(--ty-line-height-base);
38
37
  }
39
38
 
40
39
  &__item-content {
41
40
  color: var(--ty-color-text-secondary);
42
- font-size: $font-size-base;
43
- line-height: $line-height-base;
41
+ font-size: var(--ty-font-size-base);
42
+ line-height: var(--ty-line-height-base);
44
43
  }
45
44
 
46
45
  &_bordered {
@@ -17,25 +17,25 @@
17
17
  font-weight: 600;
18
18
  font-size: 16px;
19
19
  }
20
- .ty-descriptions__item_colon:after {
20
+ .ty-descriptions__item_colon::after {
21
21
  content: ":";
22
22
  margin-left: 2px;
23
23
  margin-right: 5px;
24
24
  }
25
25
  .ty-descriptions__item-label {
26
26
  color: var(--ty-color-text-label);
27
- font-size: 1rem;
27
+ font-size: var(--ty-font-size-base);
28
28
  font-weight: 400;
29
- line-height: 1.5;
29
+ line-height: var(--ty-line-height-base);
30
30
  }
31
31
  .ty-descriptions__item-content {
32
32
  color: var(--ty-color-text-secondary);
33
- font-size: 1rem;
34
- line-height: 1.5;
33
+ font-size: var(--ty-font-size-base);
34
+ line-height: var(--ty-line-height-base);
35
35
  }
36
36
  .ty-descriptions_bordered .ty-descriptions__body {
37
37
  border: 1px solid var(--ty-descriptions-border);
38
- border-radius: 2px;
38
+ border-radius: var(--ty-border-radius);
39
39
  }
40
40
  .ty-descriptions_bordered .ty-descriptions__row {
41
41
  border-bottom: 1px solid var(--ty-descriptions-border);
@@ -16,7 +16,7 @@
16
16
 
17
17
  &__desc {
18
18
  color: var(--ty-empty-desc-color);
19
- font-size: $font-size-base;
19
+ font-size: var(--ty-font-size-base);
20
20
  margin: 0;
21
21
  }
22
22
 
@@ -12,7 +12,7 @@
12
12
  }
13
13
  .ty-empty__desc {
14
14
  color: var(--ty-empty-desc-color);
15
- font-size: 1rem;
15
+ font-size: var(--ty-font-size-base);
16
16
  margin: 0;
17
17
  }
18
18
  .ty-empty__footer {
@@ -1,7 +1,6 @@
1
1
  @use '../../style/variables' as *;
2
2
 
3
3
  .#{$prefix}-form {
4
-
5
4
  &_vertical {
6
5
  .#{$prefix}-form-item__label {
7
6
  text-align: left;
@@ -23,15 +22,15 @@
23
22
  text-align: right;
24
23
  vertical-align: top;
25
24
  color: var(--ty-color-text);
26
- font-size: $font-size-base;
25
+ font-size: var(--ty-font-size-base);
27
26
 
28
- &_required:before {
27
+ &_required::before {
29
28
  content: '*';
30
29
  margin-right: 3px;
31
30
  color: var(--ty-form-error-color);
32
31
  }
33
32
 
34
- &_colon:after {
33
+ &_colon::after {
35
34
  content: ':';
36
35
  margin: 0 8px 0 2px;
37
36
  }
@@ -65,7 +64,7 @@
65
64
 
66
65
  &__notice {
67
66
  font-size: 13px;
68
- border-radius: $border-radius;
67
+ border-radius: var(--ty-border-radius);
69
68
  background: var(--ty-form-notice-bg);
70
69
  color: var(--ty-form-notice-color);
71
70
  padding: 5px;
@@ -86,7 +85,7 @@
86
85
 
87
86
  &:focus{
88
87
  border-color: var(--ty-form-error-hover);
89
- box-shadow: 0 0 0 2px rgba(255,77,79,.2);
88
+ box-shadow: 0 0 0 2px rgb(255 77 79 / 20%);
90
89
  }
91
90
  }
92
91
  }
@@ -15,14 +15,14 @@
15
15
  text-align: right;
16
16
  vertical-align: top;
17
17
  color: var(--ty-color-text);
18
- font-size: 1rem;
18
+ font-size: var(--ty-font-size-base);
19
19
  }
20
- .ty-form-item__label_required:before {
20
+ .ty-form-item__label_required::before {
21
21
  content: "*";
22
22
  margin-right: 3px;
23
23
  color: var(--ty-form-error-color);
24
24
  }
25
- .ty-form-item__label_colon:after {
25
+ .ty-form-item__label_colon::after {
26
26
  content: ":";
27
27
  margin: 0 8px 0 2px;
28
28
  }
@@ -50,7 +50,7 @@
50
50
  }
51
51
  .ty-form-item__notice {
52
52
  font-size: 13px;
53
- border-radius: 2px;
53
+ border-radius: var(--ty-border-radius);
54
54
  background: var(--ty-form-notice-bg);
55
55
  color: var(--ty-form-notice-color);
56
56
  padding: 5px;
package/lib/index.d.ts CHANGED
@@ -40,6 +40,7 @@ import { Link } from "./link/link.js";
40
40
  import { DefaultList } from "./list/index.js";
41
41
  import { Loader } from "./loader/loader.js";
42
42
  import { _default } from "./loading-bar/index.js";
43
+ import { Marquee } from "./marquee/marquee.js";
43
44
  import { DefaultMenu } from "./menu/index.js";
44
45
  import { messageContainer } from "./message/message-container.js";
45
46
  import { DefaultSelect } from "./native-select/index.js";
@@ -87,4 +88,4 @@ import { en_US } from "./locale/en_US.js";
87
88
  import { zh_CN } from "./locale/zh_CN.js";
88
89
  import { useLocale } from "./_utils/use-locale.js";
89
90
  import { ThemeMode, useTheme } from "./_utils/use-theme.js";
90
- export { Alert, DefaultAnchor as Anchor, AspectRatio, AutoComplete, DefaultAvatar as Avatar, BackTop, Badge, DefaultBreadcrumb as Breadcrumb, DefaultButton as Button, Calendar, DefaultCard as Card, DefaultCarousel as Carousel, Cascader, DefaultCheckbox as Checkbox, Col, DefaultCollapse as Collapse, ColorPicker, ConfigProvider, CopyToClipboard, Countdown, DatePicker, DefaultDesc as Descriptions, Divider, Drawer, Dropdown, Empty, Flex, DefaultFlip as Flip, DefaultForm as Form, Image, DefaultInput as Input, InputNumber, InputOTP, InputPassword, IntlProvider, Keyboard, DefaultLayout as Layout, Link, DefaultList as List, Loader, _default as LoadingBar, type Locale, DefaultMenu as Menu, messageContainer as Message, ModalWithContext as Modal, DefaultSelect as NativeSelect, notificationContainer as Notification, Overlay, Pagination, PopConfirm, Popover, Progress, DefaultRadio as Radio, Rate, Result, Row, ScrollIndicator, Segmented, DefaultSelect$1 as Select, Skeleton, Slider, Space, DefaultSpeedDial as SpeedDial, Split, SplitButton, Statistic, DefaultSteps as Steps, Sticky, StrengthIndicator, Switch, Table, DefaultTabs as Tabs, DefaultTag as Tag, Textarea, type ThemeMode, TimePicker, DefaultTimeline as Timeline, Tooltip, Transfer, Transition, Tree, DefaultTypo as Typography, Upload, Waterfall, en_US, useLocale, useTheme, withLocale, withSpin, zh_CN };
91
+ export { Alert, DefaultAnchor as Anchor, AspectRatio, AutoComplete, DefaultAvatar as Avatar, BackTop, Badge, DefaultBreadcrumb as Breadcrumb, DefaultButton as Button, Calendar, DefaultCard as Card, DefaultCarousel as Carousel, Cascader, DefaultCheckbox as Checkbox, Col, DefaultCollapse as Collapse, ColorPicker, ConfigProvider, CopyToClipboard, Countdown, DatePicker, DefaultDesc as Descriptions, Divider, Drawer, Dropdown, Empty, Flex, DefaultFlip as Flip, DefaultForm as Form, Image, DefaultInput as Input, InputNumber, InputOTP, InputPassword, IntlProvider, Keyboard, DefaultLayout as Layout, Link, DefaultList as List, Loader, _default as LoadingBar, type Locale, Marquee, DefaultMenu as Menu, messageContainer as Message, ModalWithContext as Modal, DefaultSelect as NativeSelect, notificationContainer as Notification, Overlay, Pagination, PopConfirm, Popover, Progress, DefaultRadio as Radio, Rate, Result, Row, ScrollIndicator, Segmented, DefaultSelect$1 as Select, Skeleton, Slider, Space, DefaultSpeedDial as SpeedDial, Split, SplitButton, Statistic, DefaultSteps as Steps, Sticky, StrengthIndicator, Switch, Table, DefaultTabs as Tabs, DefaultTag as Tag, Textarea, type ThemeMode, TimePicker, DefaultTimeline as Timeline, Tooltip, Transfer, Transition, Tree, DefaultTypo as Typography, Upload, Waterfall, en_US, useLocale, useTheme, withLocale, withSpin, zh_CN };
package/lib/index.js CHANGED
@@ -47,43 +47,44 @@ const require_index$41 = require("./pagination/index.js");
47
47
  const require_index$42 = require("./list/index.js");
48
48
  const require_index$43 = require("./loader/index.js");
49
49
  const require_index$44 = require("./loading-bar/index.js");
50
- const require_index$45 = require("./menu/index.js");
51
- const require_index$46 = require("./message/index.js");
52
- const require_index$47 = require("./native-select/index.js");
53
- const require_index$48 = require("./row/index.js");
54
- const require_index$49 = require("./modal/index.js");
55
- const require_index$50 = require("./notification/index.js");
56
- const require_index$51 = require("./popover/index.js");
57
- const require_index$52 = require("./pop-confirm/index.js");
58
- const require_index$53 = require("./progress/index.js");
59
- const require_index$54 = require("./radio/index.js");
60
- const require_index$55 = require("./rate/index.js");
61
- const require_index$56 = require("./result/index.js");
62
- const require_index$57 = require("./scroll-indicator/index.js");
63
- const require_index$58 = require("./segmented/index.js");
64
- const require_index$59 = require("./select/index.js");
65
- const require_index$60 = require("./skeleton/index.js");
66
- const require_index$61 = require("./tooltip/index.js");
67
- const require_index$62 = require("./slider/index.js");
68
- const require_index$63 = require("./split/index.js");
69
- const require_index$64 = require("./split-button/index.js");
70
- const require_index$65 = require("./space/index.js");
71
- const require_index$66 = require("./speed-dial/index.js");
72
- const require_index$67 = require("./steps/index.js");
73
- const require_index$68 = require("./statistic/index.js");
74
- const require_index$69 = require("./strength-indicator/index.js");
75
- const require_index$70 = require("./switch/index.js");
76
- const require_index$71 = require("./table/index.js");
77
- const require_index$72 = require("./tabs/index.js");
78
- const require_index$73 = require("./tag/index.js");
79
- const require_index$74 = require("./textarea/index.js");
80
- const require_index$75 = require("./timeline/index.js");
81
- const require_index$76 = require("./time-picker/index.js");
82
- const require_index$77 = require("./transfer/index.js");
83
- const require_index$78 = require("./tree/index.js");
84
- const require_index$79 = require("./typography/index.js");
85
- const require_index$80 = require("./upload/index.js");
86
- const require_index$81 = require("./waterfall/index.js");
50
+ const require_index$45 = require("./marquee/index.js");
51
+ const require_index$46 = require("./menu/index.js");
52
+ const require_index$47 = require("./message/index.js");
53
+ const require_index$48 = require("./native-select/index.js");
54
+ const require_index$49 = require("./row/index.js");
55
+ const require_index$50 = require("./modal/index.js");
56
+ const require_index$51 = require("./notification/index.js");
57
+ const require_index$52 = require("./popover/index.js");
58
+ const require_index$53 = require("./pop-confirm/index.js");
59
+ const require_index$54 = require("./progress/index.js");
60
+ const require_index$55 = require("./radio/index.js");
61
+ const require_index$56 = require("./rate/index.js");
62
+ const require_index$57 = require("./result/index.js");
63
+ const require_index$58 = require("./scroll-indicator/index.js");
64
+ const require_index$59 = require("./segmented/index.js");
65
+ const require_index$60 = require("./select/index.js");
66
+ const require_index$61 = require("./skeleton/index.js");
67
+ const require_index$62 = require("./tooltip/index.js");
68
+ const require_index$63 = require("./slider/index.js");
69
+ const require_index$64 = require("./split/index.js");
70
+ const require_index$65 = require("./split-button/index.js");
71
+ const require_index$66 = require("./space/index.js");
72
+ const require_index$67 = require("./speed-dial/index.js");
73
+ const require_index$68 = require("./steps/index.js");
74
+ const require_index$69 = require("./statistic/index.js");
75
+ const require_index$70 = require("./strength-indicator/index.js");
76
+ const require_index$71 = require("./switch/index.js");
77
+ const require_index$72 = require("./table/index.js");
78
+ const require_index$73 = require("./tabs/index.js");
79
+ const require_index$74 = require("./tag/index.js");
80
+ const require_index$75 = require("./textarea/index.js");
81
+ const require_index$76 = require("./timeline/index.js");
82
+ const require_index$77 = require("./time-picker/index.js");
83
+ const require_index$78 = require("./transfer/index.js");
84
+ const require_index$79 = require("./tree/index.js");
85
+ const require_index$80 = require("./typography/index.js");
86
+ const require_index$81 = require("./upload/index.js");
87
+ const require_index$82 = require("./waterfall/index.js");
87
88
  const require_with_locale = require("./intl-provider/with-locale.js");
88
89
  const require_with_spin = require("./with-spin/with-spin.js");
89
90
  const require_zh_CN = require("./locale/zh_CN.js");
@@ -129,47 +130,48 @@ exports.Link = require_index$40;
129
130
  exports.List = require_index$42;
130
131
  exports.Loader = require_index$43;
131
132
  exports.LoadingBar = require_index$44;
132
- exports.Menu = require_index$45;
133
- exports.Message = require_index$46;
134
- exports.Modal = require_index$49;
135
- exports.NativeSelect = require_index$47;
136
- exports.Notification = require_index$50;
133
+ exports.Marquee = require_index$45;
134
+ exports.Menu = require_index$46;
135
+ exports.Message = require_index$47;
136
+ exports.Modal = require_index$50;
137
+ exports.NativeSelect = require_index$48;
138
+ exports.Notification = require_index$51;
137
139
  exports.Overlay = require_index$27;
138
140
  exports.Pagination = require_index$41;
139
- exports.PopConfirm = require_index$52;
140
- exports.Popover = require_index$51;
141
- exports.Progress = require_index$53;
142
- exports.Radio = require_index$54;
143
- exports.Rate = require_index$55;
144
- exports.Result = require_index$56;
145
- exports.Row = require_index$48;
146
- exports.ScrollIndicator = require_index$57;
147
- exports.Segmented = require_index$58;
148
- exports.Select = require_index$59;
149
- exports.Skeleton = require_index$60;
150
- exports.Slider = require_index$62;
151
- exports.Space = require_index$65;
152
- exports.SpeedDial = require_index$66;
153
- exports.Split = require_index$63;
154
- exports.SplitButton = require_index$64;
155
- exports.Statistic = require_index$68;
156
- exports.Steps = require_index$67;
141
+ exports.PopConfirm = require_index$53;
142
+ exports.Popover = require_index$52;
143
+ exports.Progress = require_index$54;
144
+ exports.Radio = require_index$55;
145
+ exports.Rate = require_index$56;
146
+ exports.Result = require_index$57;
147
+ exports.Row = require_index$49;
148
+ exports.ScrollIndicator = require_index$58;
149
+ exports.Segmented = require_index$59;
150
+ exports.Select = require_index$60;
151
+ exports.Skeleton = require_index$61;
152
+ exports.Slider = require_index$63;
153
+ exports.Space = require_index$66;
154
+ exports.SpeedDial = require_index$67;
155
+ exports.Split = require_index$64;
156
+ exports.SplitButton = require_index$65;
157
+ exports.Statistic = require_index$69;
158
+ exports.Steps = require_index$68;
157
159
  exports.Sticky = require_index$2;
158
- exports.StrengthIndicator = require_index$69;
159
- exports.Switch = require_index$70;
160
- exports.Table = require_index$71;
161
- exports.Tabs = require_index$72;
162
- exports.Tag = require_index$73;
163
- exports.Textarea = require_index$74;
164
- exports.TimePicker = require_index$76;
165
- exports.Timeline = require_index$75;
166
- exports.Tooltip = require_index$61;
167
- exports.Transfer = require_index$77;
160
+ exports.StrengthIndicator = require_index$70;
161
+ exports.Switch = require_index$71;
162
+ exports.Table = require_index$72;
163
+ exports.Tabs = require_index$73;
164
+ exports.Tag = require_index$74;
165
+ exports.Textarea = require_index$75;
166
+ exports.TimePicker = require_index$77;
167
+ exports.Timeline = require_index$76;
168
+ exports.Tooltip = require_index$62;
169
+ exports.Transfer = require_index$78;
168
170
  exports.Transition = require_index;
169
- exports.Tree = require_index$78;
170
- exports.Typography = require_index$79;
171
- exports.Upload = require_index$80;
172
- exports.Waterfall = require_index$81;
171
+ exports.Tree = require_index$79;
172
+ exports.Typography = require_index$80;
173
+ exports.Upload = require_index$81;
174
+ exports.Waterfall = require_index$82;
173
175
  exports.en_US = require_en_US;
174
176
  exports.useLocale = require_use_locale.useLocale;
175
177
  exports.useTheme = require_use_theme.useTheme;
@@ -4,10 +4,11 @@
4
4
  .#{$prefix}-input {
5
5
  position: relative;
6
6
  box-sizing: border-box;
7
+ width: 100%;
7
8
  color: var(--ty-color-text);
8
9
 
9
10
  &__input {
10
- @include input-default();
11
+ @include input-default;
11
12
  }
12
13
 
13
14
  &__prefix,
@@ -77,7 +78,7 @@
77
78
 
78
79
  &_disabled {
79
80
  .#{$prefix}-input__input {
80
- @include input-default-disabled();
81
+ @include input-default-disabled;
81
82
  }
82
83
  }
83
84
  }
@@ -124,7 +125,7 @@
124
125
  }
125
126
  }
126
127
 
127
- &:not(:first-child):not(:last-child) {
128
+ &:not(:first-child, :last-child) {
128
129
  .#{$prefix}-input__input {
129
130
  border-radius: 0;
130
131
  }
@@ -166,7 +167,7 @@
166
167
  border-top-left-radius: 0;
167
168
  }
168
169
 
169
- &:not(:first-child):not(:last-child) {
170
+ &:not(:first-child, :last-child) {
170
171
  border-radius: 0;
171
172
  border-left: 0;
172
173
  border-right: 0;
@@ -10,7 +10,7 @@
10
10
  transition: all 0.3s;
11
11
  outline: 0;
12
12
  border-radius: $input-border-radius;
13
- font-size: $font-size-base;
13
+ font-size: var(--ty-font-size-base);
14
14
  background-color: var(--ty-input-bg);
15
15
 
16
16
  &:hover {
@@ -1,6 +1,7 @@
1
1
  .ty-input {
2
2
  position: relative;
3
3
  box-sizing: border-box;
4
+ width: 100%;
4
5
  color: var(--ty-color-text);
5
6
  }
6
7
  .ty-input__input {
@@ -11,8 +12,8 @@
11
12
  border: 1px solid var(--ty-input-border);
12
13
  transition: all 0.3s;
13
14
  outline: 0;
14
- border-radius: 2px;
15
- font-size: 1rem;
15
+ border-radius: var(--ty-border-radius);
16
+ font-size: var(--ty-font-size-base);
16
17
  background-color: var(--ty-input-bg);
17
18
  }
18
19
  .ty-input__input:hover {
@@ -51,25 +52,25 @@
51
52
  cursor: pointer;
52
53
  }
53
54
  .ty-input_sm .ty-input__input {
54
- font-size: 0.875rem;
55
- height: 24px;
56
- line-height: 24px;
55
+ font-size: var(--ty-font-size-sm);
56
+ height: var(--ty-height-sm);
57
+ line-height: var(--ty-height-sm);
57
58
  }
58
59
  .ty-input_sm .ty-input__clear-btn {
59
60
  transform: scale(0.7);
60
61
  }
61
62
  .ty-input_md .ty-input__input {
62
- font-size: 1rem;
63
- height: 32px;
64
- line-height: 32px;
63
+ font-size: var(--ty-font-size-base);
64
+ height: var(--ty-height-md);
65
+ line-height: var(--ty-height-md);
65
66
  }
66
67
  .ty-input_md .ty-input__clear-btn {
67
68
  transform: scale(0.8);
68
69
  }
69
70
  .ty-input_lg .ty-input__input {
70
- font-size: 1.25rem;
71
- height: 42px;
72
- line-height: 42px;
71
+ font-size: var(--ty-font-size-lg);
72
+ height: var(--ty-height-lg);
73
+ line-height: var(--ty-height-lg);
73
74
  }
74
75
  .ty-input_disabled .ty-input__input {
75
76
  cursor: not-allowed;
@@ -92,13 +93,13 @@
92
93
  justify-content: center;
93
94
  }
94
95
  .ty-input-group_sm {
95
- height: 24px;
96
+ height: var(--ty-height-sm);
96
97
  }
97
98
  .ty-input-group_md {
98
- height: 32px;
99
+ height: var(--ty-height-md);
99
100
  }
100
101
  .ty-input-group_lg {
101
- height: 42px;
102
+ height: var(--ty-height-lg);
102
103
  }
103
104
  .ty-input-group .ty-input {
104
105
  z-index: 1;
@@ -112,7 +113,7 @@
112
113
  border-top-left-radius: 0;
113
114
  border-bottom-left-radius: 0;
114
115
  }
115
- .ty-input-group .ty-input:not(:first-child):not(:last-child) .ty-input__input {
116
+ .ty-input-group .ty-input:not(:first-child, :last-child) .ty-input__input {
116
117
  border-radius: 0;
117
118
  }
118
119
 
@@ -122,18 +123,18 @@
122
123
  box-sizing: border-box;
123
124
  text-align: center;
124
125
  line-height: 1;
125
- border-radius: 2px;
126
+ border-radius: var(--ty-border-radius);
126
127
  color: var(--ty-color-text);
127
128
  padding: 0 7px;
128
129
  }
129
130
  .ty-input-group-addon_sm {
130
- font-size: 0.875rem;
131
+ font-size: var(--ty-font-size-sm);
131
132
  }
132
133
  .ty-input-group-addon_md {
133
- font-size: 1rem;
134
+ font-size: var(--ty-font-size-base);
134
135
  }
135
136
  .ty-input-group-addon_lg {
136
- font-size: 1.25rem;
137
+ font-size: var(--ty-font-size-lg);
137
138
  }
138
139
  .ty-input-group-addon:first-child {
139
140
  border-right: 0;
@@ -145,7 +146,7 @@
145
146
  border-bottom-left-radius: 0;
146
147
  border-top-left-radius: 0;
147
148
  }
148
- .ty-input-group-addon:not(:first-child):not(:last-child) {
149
+ .ty-input-group-addon:not(:first-child, :last-child) {
149
150
  border-radius: 0;
150
151
  border-left: 0;
151
152
  border-right: 0;
@@ -15,8 +15,12 @@ let react_jsx_runtime = require("react/jsx-runtime");
15
15
  const isValid = (val) => {
16
16
  return !isNaN(+val);
17
17
  };
18
+ const getDecimalPrecision = (num) => {
19
+ const str = String(num);
20
+ const dotIndex = str.indexOf(".");
21
+ return dotIndex === -1 ? 0 : str.length - dotIndex - 1;
22
+ };
18
23
  const toPrecision = (val, precision) => {
19
- if (precision === void 0) return val;
20
24
  return parseFloat(val.toFixed(precision));
21
25
  };
22
26
  const InputNumber = react.default.forwardRef((props, ref) => {
@@ -27,16 +31,18 @@ const InputNumber = react.default.forwardRef((props, ref) => {
27
31
  [`${prefixCls}_disabled`]: disabled,
28
32
  [`${prefixCls}_always-controls`]: controls
29
33
  });
34
+ const resolvedPrecision = precision ?? Math.max(getDecimalPrecision(step), getDecimalPrecision(defaultValue));
30
35
  const [value, setValue] = (0, react.useState)("value" in props ? props.value : defaultValue);
31
36
  const inputOnChange = (e) => {
32
- const val = toPrecision(Number(e.target.value.trim()), precision);
37
+ const raw = Number(e.target.value.trim());
38
+ const val = resolvedPrecision > 0 ? toPrecision(raw, resolvedPrecision) : raw;
33
39
  !("value" in props) && setValue(val);
34
40
  onChange && isValid(val) && onChange(val, e);
35
41
  };
36
42
  const plusOnClick = (e) => {
37
43
  e.stopPropagation();
38
44
  if (!disabled && isValid(step)) {
39
- const val = toPrecision(+value + +step, precision);
45
+ const val = toPrecision(+value + +step, resolvedPrecision);
40
46
  if (val <= max) {
41
47
  !("value" in props) && setValue(val);
42
48
  onChange && onChange(val, e);
@@ -46,7 +52,7 @@ const InputNumber = react.default.forwardRef((props, ref) => {
46
52
  const minusOnClick = (e) => {
47
53
  e.stopPropagation();
48
54
  if (!disabled && isValid(step)) {
49
- const val = toPrecision(+value - +step, precision);
55
+ const val = toPrecision(+value - +step, resolvedPrecision);
50
56
  if (val >= min) {
51
57
  !("value" in props) && setValue(val);
52
58
  onChange && onChange(val, e);
@@ -63,7 +69,7 @@ const InputNumber = react.default.forwardRef((props, ref) => {
63
69
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
64
70
  autoComplete: "off",
65
71
  disabled,
66
- value: precision !== void 0 ? value.toFixed(precision) : value,
72
+ value: resolvedPrecision > 0 ? value.toFixed(resolvedPrecision) : value,
67
73
  type: "number",
68
74
  className: `${prefixCls}__input`,
69
75
  max,
@@ -1 +1 @@
1
- {"version":3,"file":"input-number.js","names":["React","ConfigContext","getPrefixCls","ArrowDown"],"sources":["../../src/input-number/input-number.tsx"],"sourcesContent":["import React, { useEffect, useState, MouseEvent, useContext } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { InputNumberProps } from './types';\nimport { ArrowDown } from '../_utils/components';\n\n/**\n * Valid the string is a number\n * @param val\n */\nconst isValid = (val: string | number): boolean => {\n return !isNaN(+val);\n};\n\nconst toPrecision = (val: number, precision?: number): number => {\n if (precision === undefined) return val;\n return parseFloat(val.toFixed(precision));\n};\n\nconst InputNumber = React.forwardRef<HTMLDivElement, InputNumberProps>((props, ref) => {\n const {\n size = 'md',\n disabled = false,\n defaultValue = 0,\n step = 1,\n precision,\n controls = false,\n min = Number.NEGATIVE_INFINITY,\n max = Number.POSITIVE_INFINITY,\n onChange,\n className,\n prefixCls: customisedCls,\n style,\n } = props;\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('input-number', configContext.prefixCls, customisedCls);\n const inputSize = props.size || configContext.componentSize || size;\n const cls = classNames(prefixCls, className, `${prefixCls}_${inputSize}`, {\n [`${prefixCls}_disabled`]: disabled,\n [`${prefixCls}_always-controls`]: controls,\n });\n const [value, setValue] = useState<number>(\n 'value' in props ? (props.value as number) : defaultValue\n );\n\n const inputOnChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n const raw = Number(e.target.value.trim());\n const val = toPrecision(raw, precision);\n !('value' in props) && setValue(val);\n onChange && isValid(val) && onChange(val, e);\n };\n\n const plusOnClick = (e: MouseEvent<HTMLSpanElement>): void => {\n e.stopPropagation();\n if (!disabled && isValid(step)) {\n const val = toPrecision(+value + +step, precision);\n if (val <= max) {\n !('value' in props) && setValue(val);\n onChange && onChange(val, e);\n }\n }\n };\n\n const minusOnClick = (e: MouseEvent<HTMLSpanElement>): void => {\n e.stopPropagation();\n if (!disabled && isValid(step)) {\n const val = toPrecision(+value - +step, precision);\n if (val >= min) {\n !('value' in props) && setValue(val);\n onChange && onChange(val, e);\n }\n }\n };\n\n useEffect(() => {\n 'value' in props && setValue(props.value as number);\n }, [props]);\n\n return (\n <div ref={ref} className={cls} style={style}>\n <input\n autoComplete=\"off\"\n disabled={disabled}\n value={precision !== undefined ? value.toFixed(precision) : value}\n type=\"number\"\n className={`${prefixCls}__input`}\n max={max}\n min={min}\n step={step}\n onChange={inputOnChange}\n aria-valuenow={value}\n aria-valuemax={max}\n aria-valuemin={min}\n aria-disabled={disabled}\n />\n <div className={`${prefixCls}__controls`}>\n <span className={`${prefixCls}__up`} onClick={plusOnClick}>\n <ArrowDown size={8} className={`${prefixCls}__icon ${prefixCls}__icon_reverse`} />\n </span>\n <span className={`${prefixCls}__down`} onClick={minusOnClick}>\n <ArrowDown size={8} className={`${prefixCls}__icon`} />\n </span>\n </div>\n </div>\n );\n});\n\nInputNumber.displayName = 'InputNumber';\n\nexport default InputNumber;\n"],"mappings":";;;;;;;;;;;;;;AAWA,MAAM,WAAW,QAAkC;AACjD,QAAO,CAAC,MAAM,CAAC,IAAI;;AAGrB,MAAM,eAAe,KAAa,cAA+B;AAC/D,KAAI,cAAc,KAAA,EAAW,QAAO;AACpC,QAAO,WAAW,IAAI,QAAQ,UAAU,CAAC;;AAG3C,MAAM,cAAcA,MAAAA,QAAM,YAA8C,OAAO,QAAQ;CACrF,MAAM,EACJ,OAAO,MACP,WAAW,OACX,eAAe,GACf,OAAO,GACP,WACA,WAAW,OACX,MAAM,OAAO,mBACb,MAAM,OAAO,mBACb,UACA,WACA,WAAW,eACX,UACE;CACJ,MAAM,iBAAA,GAAA,MAAA,YAA2BC,uBAAAA,cAAc;CAC/C,MAAM,YAAYC,gBAAAA,aAAa,gBAAgB,cAAc,WAAW,cAAc;CAEtF,MAAM,OAAA,GAAA,WAAA,SAAiB,WAAW,WAAW,GAAG,UAAU,GADxC,MAAM,QAAQ,cAAc,iBAAiB,QACW;GACvE,GAAG,UAAU,aAAa;GAC1B,GAAG,UAAU,oBAAoB;EACnC,CAAC;CACF,MAAM,CAAC,OAAO,aAAA,GAAA,MAAA,UACZ,WAAW,QAAS,MAAM,QAAmB,aAC9C;CAED,MAAM,iBAAiB,MAAiD;EAEtE,MAAM,MAAM,YADA,OAAO,EAAE,OAAO,MAAM,MAAM,CAAC,EACZ,UAAU;AACvC,IAAE,WAAW,UAAU,SAAS,IAAI;AACpC,cAAY,QAAQ,IAAI,IAAI,SAAS,KAAK,EAAE;;CAG9C,MAAM,eAAe,MAAyC;AAC5D,IAAE,iBAAiB;AACnB,MAAI,CAAC,YAAY,QAAQ,KAAK,EAAE;GAC9B,MAAM,MAAM,YAAY,CAAC,QAAQ,CAAC,MAAM,UAAU;AAClD,OAAI,OAAO,KAAK;AACd,MAAE,WAAW,UAAU,SAAS,IAAI;AACpC,gBAAY,SAAS,KAAK,EAAE;;;;CAKlC,MAAM,gBAAgB,MAAyC;AAC7D,IAAE,iBAAiB;AACnB,MAAI,CAAC,YAAY,QAAQ,KAAK,EAAE;GAC9B,MAAM,MAAM,YAAY,CAAC,QAAQ,CAAC,MAAM,UAAU;AAClD,OAAI,OAAO,KAAK;AACd,MAAE,WAAW,UAAU,SAAS,IAAI;AACpC,gBAAY,SAAS,KAAK,EAAE;;;;AAKlC,EAAA,GAAA,MAAA,iBAAgB;AACd,aAAW,SAAS,SAAS,MAAM,MAAgB;IAClD,CAAC,MAAM,CAAC;AAEX,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAU;EAAK,WAAW;EAAY;YAAtC,CACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;GACE,cAAa;GACH;GACV,OAAO,cAAc,KAAA,IAAY,MAAM,QAAQ,UAAU,GAAG;GAC5D,MAAK;GACL,WAAW,GAAG,UAAU;GACnB;GACA;GACC;GACN,UAAU;GACV,iBAAe;GACf,iBAAe;GACf,iBAAe;GACf,iBAAe;GACf,CAAA,EACF,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAW,GAAG,UAAU;aAA7B,CACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAW,GAAG,UAAU;IAAO,SAAS;cAC5C,iBAAA,GAAA,kBAAA,KAACC,mBAAAA,WAAD;KAAW,MAAM;KAAG,WAAW,GAAG,UAAU,SAAS,UAAU;KAAmB,CAAA;IAC7E,CAAA,EACP,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAW,GAAG,UAAU;IAAS,SAAS;cAC9C,iBAAA,GAAA,kBAAA,KAACA,mBAAAA,WAAD;KAAW,MAAM;KAAG,WAAW,GAAG,UAAU;KAAW,CAAA;IAClD,CAAA,CACH;KACF;;EAER;AAEF,YAAY,cAAc"}
1
+ {"version":3,"file":"input-number.js","names":["React","ConfigContext","getPrefixCls","ArrowDown"],"sources":["../../src/input-number/input-number.tsx"],"sourcesContent":["import React, { useEffect, useState, MouseEvent, useContext } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { InputNumberProps } from './types';\nimport { ArrowDown } from '../_utils/components';\n\n/**\n * Valid the string is a number\n * @param val\n */\nconst isValid = (val: string | number): boolean => {\n return !isNaN(+val);\n};\n\nconst getDecimalPrecision = (num: number): number => {\n const str = String(num);\n const dotIndex = str.indexOf('.');\n return dotIndex === -1 ? 0 : str.length - dotIndex - 1;\n};\n\nconst toPrecision = (val: number, precision: number): number => {\n return parseFloat(val.toFixed(precision));\n};\n\nconst InputNumber = React.forwardRef<HTMLDivElement, InputNumberProps>((props, ref) => {\n const {\n size = 'md',\n disabled = false,\n defaultValue = 0,\n step = 1,\n precision,\n controls = false,\n min = Number.NEGATIVE_INFINITY,\n max = Number.POSITIVE_INFINITY,\n onChange,\n className,\n prefixCls: customisedCls,\n style,\n } = props;\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('input-number', configContext.prefixCls, customisedCls);\n const inputSize = props.size || configContext.componentSize || size;\n const cls = classNames(prefixCls, className, `${prefixCls}_${inputSize}`, {\n [`${prefixCls}_disabled`]: disabled,\n [`${prefixCls}_always-controls`]: controls,\n });\n const resolvedPrecision = precision ?? Math.max(getDecimalPrecision(step), getDecimalPrecision(defaultValue));\n const [value, setValue] = useState<number>(\n 'value' in props ? (props.value as number) : defaultValue\n );\n\n const inputOnChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n const raw = Number(e.target.value.trim());\n const val = resolvedPrecision > 0 ? toPrecision(raw, resolvedPrecision) : raw;\n !('value' in props) && setValue(val);\n onChange && isValid(val) && onChange(val, e);\n };\n\n const plusOnClick = (e: MouseEvent<HTMLSpanElement>): void => {\n e.stopPropagation();\n if (!disabled && isValid(step)) {\n const val = toPrecision(+value + +step, resolvedPrecision);\n if (val <= max) {\n !('value' in props) && setValue(val);\n onChange && onChange(val, e);\n }\n }\n };\n\n const minusOnClick = (e: MouseEvent<HTMLSpanElement>): void => {\n e.stopPropagation();\n if (!disabled && isValid(step)) {\n const val = toPrecision(+value - +step, resolvedPrecision);\n if (val >= min) {\n !('value' in props) && setValue(val);\n onChange && onChange(val, e);\n }\n }\n };\n\n useEffect(() => {\n 'value' in props && setValue(props.value as number);\n }, [props]);\n\n return (\n <div ref={ref} className={cls} style={style}>\n <input\n autoComplete=\"off\"\n disabled={disabled}\n value={resolvedPrecision > 0 ? value.toFixed(resolvedPrecision) : value}\n type=\"number\"\n className={`${prefixCls}__input`}\n max={max}\n min={min}\n step={step}\n onChange={inputOnChange}\n aria-valuenow={value}\n aria-valuemax={max}\n aria-valuemin={min}\n aria-disabled={disabled}\n />\n <div className={`${prefixCls}__controls`}>\n <span className={`${prefixCls}__up`} onClick={plusOnClick}>\n <ArrowDown size={8} className={`${prefixCls}__icon ${prefixCls}__icon_reverse`} />\n </span>\n <span className={`${prefixCls}__down`} onClick={minusOnClick}>\n <ArrowDown size={8} className={`${prefixCls}__icon`} />\n </span>\n </div>\n </div>\n );\n});\n\nInputNumber.displayName = 'InputNumber';\n\nexport default InputNumber;\n"],"mappings":"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"}