@alfalab/core-components-number-input 2.6.4 → 2.6.5-snapshot-1393ffa

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 (299) hide show
  1. package/Component.responsive.js +3 -2
  2. package/Component.responsive.js.map +1 -0
  3. package/components/number-input/Component.js +8 -13
  4. package/components/number-input/Component.js.map +1 -0
  5. package/components/number-input/default.css +5 -27
  6. package/components/number-input/default.module.css.js +8 -0
  7. package/components/number-input/default.module.css.js.map +1 -0
  8. package/components/number-input/index.css +6 -28
  9. package/components/number-input/index.js +3 -2
  10. package/components/number-input/index.js.map +1 -0
  11. package/components/number-input/index.module.css.js +8 -0
  12. package/components/number-input/index.module.css.js.map +1 -0
  13. package/components/number-input/inverted.css +5 -27
  14. package/components/number-input/inverted.module.css.js +8 -0
  15. package/components/number-input/inverted.module.css.js.map +1 -0
  16. package/components/steppers/Component.js +10 -15
  17. package/components/steppers/Component.js.map +1 -0
  18. package/components/steppers/default.css +3 -25
  19. package/components/steppers/default.module.css.js +8 -0
  20. package/components/steppers/default.module.css.js.map +1 -0
  21. package/components/steppers/index.css +3 -26
  22. package/components/steppers/index.js +3 -2
  23. package/components/steppers/index.js.map +1 -0
  24. package/components/steppers/index.module.css.js +8 -0
  25. package/components/steppers/index.module.css.js.map +1 -0
  26. package/components/steppers/inverted.css +3 -25
  27. package/components/steppers/inverted.module.css.js +8 -0
  28. package/components/steppers/inverted.module.css.js.map +1 -0
  29. package/cssm/Component.responsive.js +6 -5
  30. package/cssm/Component.responsive.js.map +1 -0
  31. package/cssm/components/number-input/Component.js +7 -6
  32. package/cssm/components/number-input/Component.js.map +1 -0
  33. package/cssm/components/number-input/default.module.css +3 -24
  34. package/cssm/components/number-input/index.js +3 -2
  35. package/cssm/components/number-input/index.js.map +1 -0
  36. package/cssm/components/number-input/index.module.css +4 -25
  37. package/cssm/components/number-input/inverted.module.css +3 -24
  38. package/cssm/components/steppers/Component.js +5 -4
  39. package/cssm/components/steppers/Component.js.map +1 -0
  40. package/cssm/components/steppers/default.module.css +3 -24
  41. package/cssm/components/steppers/index.js +3 -2
  42. package/cssm/components/steppers/index.js.map +1 -0
  43. package/cssm/components/steppers/index.module.css +1 -23
  44. package/cssm/components/steppers/inverted.module.css +3 -24
  45. package/cssm/desktop/Component.desktop.js +3 -2
  46. package/cssm/desktop/Component.desktop.js.map +1 -0
  47. package/cssm/desktop/index.js +3 -2
  48. package/cssm/desktop/index.js.map +1 -0
  49. package/cssm/index.js +1 -0
  50. package/cssm/index.js.map +1 -0
  51. package/cssm/mobile/Component.mobile.js +3 -2
  52. package/cssm/mobile/Component.mobile.js.map +1 -0
  53. package/cssm/mobile/index.js +3 -2
  54. package/cssm/mobile/index.js.map +1 -0
  55. package/cssm/shared/index.js +1 -0
  56. package/cssm/shared/index.js.map +1 -0
  57. package/cssm/src/Component.responsive.d.ts +4 -0
  58. package/cssm/{components → src/components}/number-input/Component.d.ts +4 -7
  59. package/cssm/src/components/number-input/index.d.ts +1 -0
  60. package/{esm → cssm/src}/components/steppers/Component.d.ts +3 -5
  61. package/cssm/src/components/steppers/index.d.ts +1 -0
  62. package/cssm/src/desktop/Component.desktop.d.ts +4 -0
  63. package/cssm/src/desktop/index.d.ts +1 -0
  64. package/cssm/src/index.d.ts +1 -0
  65. package/cssm/src/mobile/Component.mobile.d.ts +4 -0
  66. package/cssm/src/mobile/index.d.ts +1 -0
  67. package/cssm/src/shared/index.d.ts +1 -0
  68. package/cssm/src/utils.d.ts +33 -0
  69. package/cssm/utils.js +11 -10
  70. package/cssm/utils.js.map +1 -0
  71. package/desktop/Component.desktop.js +3 -2
  72. package/desktop/Component.desktop.js.map +1 -0
  73. package/desktop/index.js +3 -2
  74. package/desktop/index.js.map +1 -0
  75. package/esm/Component.responsive.js +1 -0
  76. package/esm/Component.responsive.js.map +1 -0
  77. package/esm/components/number-input/Component.js +5 -10
  78. package/esm/components/number-input/Component.js.map +1 -0
  79. package/esm/components/number-input/default.css +5 -27
  80. package/esm/components/number-input/default.module.css.js +6 -0
  81. package/esm/components/number-input/default.module.css.js.map +1 -0
  82. package/esm/components/number-input/index.css +6 -28
  83. package/esm/components/number-input/index.js +1 -0
  84. package/esm/components/number-input/index.js.map +1 -0
  85. package/esm/components/number-input/index.module.css.js +6 -0
  86. package/esm/components/number-input/index.module.css.js.map +1 -0
  87. package/esm/components/number-input/inverted.css +5 -27
  88. package/esm/components/number-input/inverted.module.css.js +6 -0
  89. package/esm/components/number-input/inverted.module.css.js.map +1 -0
  90. package/esm/components/steppers/Component.js +4 -9
  91. package/esm/components/steppers/Component.js.map +1 -0
  92. package/esm/components/steppers/default.css +3 -25
  93. package/esm/components/steppers/default.module.css.js +6 -0
  94. package/esm/components/steppers/default.module.css.js.map +1 -0
  95. package/esm/components/steppers/index.css +3 -26
  96. package/esm/components/steppers/index.js +1 -0
  97. package/esm/components/steppers/index.js.map +1 -0
  98. package/esm/components/steppers/index.module.css.js +6 -0
  99. package/esm/components/steppers/index.module.css.js.map +1 -0
  100. package/esm/components/steppers/inverted.css +3 -25
  101. package/esm/components/steppers/inverted.module.css.js +6 -0
  102. package/esm/components/steppers/inverted.module.css.js.map +1 -0
  103. package/esm/desktop/Component.desktop.js +1 -0
  104. package/esm/desktop/Component.desktop.js.map +1 -0
  105. package/esm/desktop/index.js +1 -0
  106. package/esm/desktop/index.js.map +1 -0
  107. package/esm/index.js +1 -0
  108. package/esm/index.js.map +1 -0
  109. package/esm/mobile/Component.mobile.js +1 -0
  110. package/esm/mobile/Component.mobile.js.map +1 -0
  111. package/esm/mobile/index.js +1 -0
  112. package/esm/mobile/index.js.map +1 -0
  113. package/esm/shared/index.js +1 -0
  114. package/esm/shared/index.js.map +1 -0
  115. package/esm/src/Component.responsive.d.ts +4 -0
  116. package/{components → esm/src/components}/number-input/Component.d.ts +4 -7
  117. package/esm/src/components/number-input/index.d.ts +1 -0
  118. package/{cssm → esm/src}/components/steppers/Component.d.ts +3 -5
  119. package/esm/src/components/steppers/index.d.ts +1 -0
  120. package/esm/src/desktop/Component.desktop.d.ts +4 -0
  121. package/esm/src/desktop/index.d.ts +1 -0
  122. package/esm/src/index.d.ts +1 -0
  123. package/esm/src/mobile/Component.mobile.d.ts +4 -0
  124. package/esm/src/mobile/index.d.ts +1 -0
  125. package/esm/src/shared/index.d.ts +1 -0
  126. package/esm/src/utils.d.ts +33 -0
  127. package/esm/utils.js +2 -1
  128. package/esm/utils.js.map +1 -0
  129. package/index.js +1 -0
  130. package/index.js.map +1 -0
  131. package/mobile/Component.mobile.js +3 -2
  132. package/mobile/Component.mobile.js.map +1 -0
  133. package/mobile/index.js +3 -2
  134. package/mobile/index.js.map +1 -0
  135. package/modern/Component.responsive.js +1 -0
  136. package/modern/Component.responsive.js.map +1 -0
  137. package/modern/components/number-input/Component.js +5 -10
  138. package/modern/components/number-input/Component.js.map +1 -0
  139. package/modern/components/number-input/default.css +5 -27
  140. package/modern/components/number-input/default.module.css.js +6 -0
  141. package/modern/components/number-input/default.module.css.js.map +1 -0
  142. package/modern/components/number-input/index.css +6 -28
  143. package/modern/components/number-input/index.js +1 -0
  144. package/modern/components/number-input/index.js.map +1 -0
  145. package/modern/components/number-input/index.module.css.js +6 -0
  146. package/modern/components/number-input/index.module.css.js.map +1 -0
  147. package/modern/components/number-input/inverted.css +5 -27
  148. package/modern/components/number-input/inverted.module.css.js +6 -0
  149. package/modern/components/number-input/inverted.module.css.js.map +1 -0
  150. package/modern/components/steppers/Component.js +4 -9
  151. package/modern/components/steppers/Component.js.map +1 -0
  152. package/modern/components/steppers/default.css +3 -25
  153. package/modern/components/steppers/default.module.css.js +6 -0
  154. package/modern/components/steppers/default.module.css.js.map +1 -0
  155. package/modern/components/steppers/index.css +3 -26
  156. package/modern/components/steppers/index.js +1 -0
  157. package/modern/components/steppers/index.js.map +1 -0
  158. package/modern/components/steppers/index.module.css.js +6 -0
  159. package/modern/components/steppers/index.module.css.js.map +1 -0
  160. package/modern/components/steppers/inverted.css +3 -25
  161. package/modern/components/steppers/inverted.module.css.js +6 -0
  162. package/modern/components/steppers/inverted.module.css.js.map +1 -0
  163. package/modern/desktop/Component.desktop.js +1 -0
  164. package/modern/desktop/Component.desktop.js.map +1 -0
  165. package/modern/desktop/index.js +1 -0
  166. package/modern/desktop/index.js.map +1 -0
  167. package/modern/index.js +1 -0
  168. package/modern/index.js.map +1 -0
  169. package/modern/mobile/Component.mobile.js +1 -0
  170. package/modern/mobile/Component.mobile.js.map +1 -0
  171. package/modern/mobile/index.js +1 -0
  172. package/modern/mobile/index.js.map +1 -0
  173. package/modern/shared/index.js +1 -0
  174. package/modern/shared/index.js.map +1 -0
  175. package/modern/src/Component.responsive.d.ts +4 -0
  176. package/{esm → modern/src}/components/number-input/Component.d.ts +4 -7
  177. package/modern/src/components/number-input/index.d.ts +1 -0
  178. package/modern/{components → src/components}/steppers/Component.d.ts +3 -5
  179. package/modern/src/components/steppers/index.d.ts +1 -0
  180. package/modern/src/desktop/Component.desktop.d.ts +4 -0
  181. package/modern/src/desktop/index.d.ts +1 -0
  182. package/modern/src/index.d.ts +1 -0
  183. package/modern/src/mobile/Component.mobile.d.ts +4 -0
  184. package/modern/src/mobile/index.d.ts +1 -0
  185. package/modern/src/shared/index.d.ts +1 -0
  186. package/modern/src/utils.d.ts +33 -0
  187. package/modern/utils.js +3 -2
  188. package/modern/utils.js.map +1 -0
  189. package/moderncssm/Component.responsive.js +1 -0
  190. package/moderncssm/Component.responsive.js.map +1 -0
  191. package/moderncssm/components/number-input/Component.js +2 -1
  192. package/moderncssm/components/number-input/Component.js.map +1 -0
  193. package/moderncssm/components/number-input/default.module.css +0 -2
  194. package/moderncssm/components/number-input/index.js +1 -0
  195. package/moderncssm/components/number-input/index.js.map +1 -0
  196. package/moderncssm/components/number-input/index.module.css +0 -2
  197. package/moderncssm/components/number-input/inverted.module.css +0 -2
  198. package/moderncssm/components/steppers/Component.js +1 -0
  199. package/moderncssm/components/steppers/Component.js.map +1 -0
  200. package/moderncssm/components/steppers/default.module.css +0 -2
  201. package/moderncssm/components/steppers/index.js +1 -0
  202. package/moderncssm/components/steppers/index.js.map +1 -0
  203. package/moderncssm/components/steppers/index.module.css +0 -2
  204. package/moderncssm/components/steppers/inverted.module.css +0 -2
  205. package/moderncssm/desktop/Component.desktop.js +1 -0
  206. package/moderncssm/desktop/Component.desktop.js.map +1 -0
  207. package/moderncssm/desktop/index.js +1 -0
  208. package/moderncssm/desktop/index.js.map +1 -0
  209. package/moderncssm/index.js +1 -0
  210. package/moderncssm/index.js.map +1 -0
  211. package/moderncssm/mobile/Component.mobile.js +1 -0
  212. package/moderncssm/mobile/Component.mobile.js.map +1 -0
  213. package/moderncssm/mobile/index.js +1 -0
  214. package/moderncssm/mobile/index.js.map +1 -0
  215. package/moderncssm/shared/index.js +1 -0
  216. package/moderncssm/shared/index.js.map +1 -0
  217. package/moderncssm/src/Component.responsive.d.ts +4 -0
  218. package/{modern → moderncssm/src}/components/number-input/Component.d.ts +4 -7
  219. package/moderncssm/src/components/number-input/index.d.ts +1 -0
  220. package/{components → moderncssm/src/components}/steppers/Component.d.ts +3 -5
  221. package/moderncssm/src/components/steppers/index.d.ts +1 -0
  222. package/moderncssm/src/desktop/Component.desktop.d.ts +4 -0
  223. package/moderncssm/src/desktop/index.d.ts +1 -0
  224. package/moderncssm/src/index.d.ts +1 -0
  225. package/moderncssm/src/mobile/Component.mobile.d.ts +4 -0
  226. package/moderncssm/src/mobile/index.d.ts +1 -0
  227. package/moderncssm/src/shared/index.d.ts +1 -0
  228. package/moderncssm/src/utils.d.ts +33 -0
  229. package/moderncssm/utils.js +3 -2
  230. package/moderncssm/utils.js.map +1 -0
  231. package/package.json +7 -7
  232. package/shared/index.js +1 -0
  233. package/shared/index.js.map +1 -0
  234. package/src/Component.responsive.d.ts +4 -0
  235. package/src/components/number-input/Component.d.ts +57 -0
  236. package/src/components/number-input/index.d.ts +1 -0
  237. package/src/components/steppers/Component.d.ts +15 -0
  238. package/src/components/steppers/index.d.ts +1 -0
  239. package/src/desktop/Component.desktop.d.ts +4 -0
  240. package/src/desktop/index.d.ts +1 -0
  241. package/src/index.d.ts +1 -0
  242. package/src/mobile/Component.mobile.d.ts +4 -0
  243. package/src/mobile/index.d.ts +1 -0
  244. package/src/shared/index.d.ts +1 -0
  245. package/src/utils.d.ts +33 -0
  246. package/utils.js +1 -0
  247. package/utils.js.map +1 -0
  248. package/Component.responsive.d.ts +0 -6
  249. package/components/number-input/index.d.ts +0 -1
  250. package/components/steppers/index.d.ts +0 -1
  251. package/cssm/Component.responsive.d.ts +0 -6
  252. package/cssm/components/number-input/index.d.ts +0 -1
  253. package/cssm/components/steppers/index.d.ts +0 -1
  254. package/cssm/desktop/Component.desktop.d.ts +0 -6
  255. package/cssm/desktop/index.d.ts +0 -2
  256. package/cssm/index.d.ts +0 -2
  257. package/cssm/mobile/Component.mobile.d.ts +0 -6
  258. package/cssm/mobile/index.d.ts +0 -2
  259. package/cssm/shared/index.d.ts +0 -1
  260. package/cssm/utils.d.ts +0 -34
  261. package/desktop/Component.desktop.d.ts +0 -6
  262. package/desktop/index.d.ts +0 -2
  263. package/esm/Component.responsive.d.ts +0 -6
  264. package/esm/components/number-input/index.d.ts +0 -1
  265. package/esm/components/steppers/index.d.ts +0 -1
  266. package/esm/desktop/Component.desktop.d.ts +0 -6
  267. package/esm/desktop/index.d.ts +0 -2
  268. package/esm/index.d.ts +0 -2
  269. package/esm/mobile/Component.mobile.d.ts +0 -6
  270. package/esm/mobile/index.d.ts +0 -2
  271. package/esm/shared/index.d.ts +0 -1
  272. package/esm/utils.d.ts +0 -34
  273. package/index.d.ts +0 -2
  274. package/mobile/Component.mobile.d.ts +0 -6
  275. package/mobile/index.d.ts +0 -2
  276. package/modern/Component.responsive.d.ts +0 -6
  277. package/modern/components/number-input/index.d.ts +0 -1
  278. package/modern/components/steppers/index.d.ts +0 -1
  279. package/modern/desktop/Component.desktop.d.ts +0 -6
  280. package/modern/desktop/index.d.ts +0 -2
  281. package/modern/index.d.ts +0 -2
  282. package/modern/mobile/Component.mobile.d.ts +0 -6
  283. package/modern/mobile/index.d.ts +0 -2
  284. package/modern/shared/index.d.ts +0 -1
  285. package/modern/utils.d.ts +0 -34
  286. package/moderncssm/Component.responsive.d.ts +0 -6
  287. package/moderncssm/components/number-input/Component.d.ts +0 -60
  288. package/moderncssm/components/number-input/index.d.ts +0 -1
  289. package/moderncssm/components/steppers/Component.d.ts +0 -17
  290. package/moderncssm/components/steppers/index.d.ts +0 -1
  291. package/moderncssm/desktop/Component.desktop.d.ts +0 -6
  292. package/moderncssm/desktop/index.d.ts +0 -2
  293. package/moderncssm/index.d.ts +0 -2
  294. package/moderncssm/mobile/Component.mobile.d.ts +0 -6
  295. package/moderncssm/mobile/index.d.ts +0 -2
  296. package/moderncssm/shared/index.d.ts +0 -1
  297. package/moderncssm/utils.d.ts +0 -34
  298. package/shared/index.d.ts +0 -1
  299. package/utils.d.ts +0 -34
@@ -0,0 +1,57 @@
1
+ import React, { ChangeEvent, FC, Ref } from 'react';
2
+ import type { InputProps } from '@alfalab/core-components-input';
3
+ export interface NumberInputProps extends Omit<InputProps, 'value' | 'onChange' | 'type' | 'defaultValue' | 'dataTestId'> {
4
+ /**
5
+ * Значение поля ввода
6
+ */
7
+ value?: string | number | null;
8
+ /**
9
+ * Значение по-умолчанию
10
+ */
11
+ defaultValue?: string | number | null;
12
+ /**
13
+ * Разделитель ',' или '.'
14
+ */
15
+ separator?: '.' | ',';
16
+ /**
17
+ * Количество символов после разделителя
18
+ * Если указан проп step, то всегда 0
19
+ */
20
+ fractionLength?: number;
21
+ /**
22
+ * Шаг инкремента/декремента. Используйте только целочисленные значения
23
+ */
24
+ step?: number;
25
+ /**
26
+ * Минимальное значение
27
+ * @default Number.MIN_SAFE_INTEGER
28
+ */
29
+ min?: number;
30
+ /**
31
+ * Максимальное значение
32
+ * @default Number.MAX_SAFE_INTEGER
33
+ */
34
+ max?: number;
35
+ /**
36
+ * Отображение компонента в мобильном или десктопном виде
37
+ */
38
+ view?: 'desktop' | 'mobile';
39
+ /**
40
+ * Компонент инпута
41
+ */
42
+ Input: FC<InputProps & {
43
+ ref?: Ref<HTMLInputElement>;
44
+ }>;
45
+ /**
46
+ * Обработчик события изменения значения
47
+ */
48
+ onChange?: (e: ChangeEvent<HTMLInputElement> | null, payload: {
49
+ value: number | null;
50
+ }) => void;
51
+ /**
52
+ * Идентификатор для систем автоматизированного тестирования.
53
+ * Для кнопки инкремента используется модификатор -increment-button, декремента -decrement-button
54
+ */
55
+ dataTestId?: string;
56
+ }
57
+ export declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export { NumberInput, NumberInputProps } from './Component';
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { InputProps } from '@alfalab/core-components-input';
3
+ export declare type SteppersProps = {
4
+ value: number;
5
+ min: number;
6
+ max: number;
7
+ className?: string;
8
+ disabled?: boolean;
9
+ onIncrement: () => void;
10
+ onDecrement: () => void;
11
+ dataTestId?: string;
12
+ colors: 'default' | 'inverted';
13
+ size: InputProps['size'];
14
+ };
15
+ export declare const Steppers: React.FC<SteppersProps>;
@@ -0,0 +1 @@
1
+ export * from './Component';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { NumberInputProps } from '../components/number-input';
3
+ export declare type NumberInputDesktopProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
4
+ export declare const NumberInputDesktop: React.ForwardRefExoticComponent<NumberInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export { NumberInputDesktop, NumberInputDesktopProps } from './Component.desktop';
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { NumberInputResponsive as NumberInput, NumberInputResponsiveProps as NumberInputProps, } from './Component.responsive';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { NumberInputProps } from '../components/number-input';
3
+ export declare type NumberInputMobileProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
4
+ export declare const NumberInputMobile: React.ForwardRefExoticComponent<NumberInputMobileProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export { NumberInputMobile, NumberInputMobileProps } from './Component.mobile';
@@ -0,0 +1 @@
1
+ export { getNumberInputTestIds } from '../utils';
package/src/utils.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { MaskitoOptions, MaskitoPlugin } from '@maskito/core';
2
+ export declare const MINUS_SIGN = "-";
3
+ export declare const SEPARATORS: string[];
4
+ export declare const MAX_SAFE_INTEGER: number;
5
+ export declare const MIN_SAFE_INTEGER: number;
6
+ export declare const MAX_DIGITS = 15;
7
+ export declare function parseNumber(value?: string | number | null): number;
8
+ /**
9
+ * Преобразовать число в строку с заменой экспоненты на десятичную дробь
10
+ */
11
+ export declare function stringifyNumberWithoutExp(value: number): string;
12
+ export declare function createMaskOptions({ separator, fractionLength, min, max, }: {
13
+ separator: string;
14
+ fractionLength: number;
15
+ min: number;
16
+ max: number;
17
+ }): MaskitoOptions;
18
+ export declare function createMinMaxPlugin({ min, max }: {
19
+ min: number;
20
+ max: number;
21
+ }): MaskitoPlugin;
22
+ export declare function createNotEmptyPartsPlugin(separator: string): MaskitoPlugin;
23
+ export declare function getNumberInputTestIds(dataTestId: string): {
24
+ input: string;
25
+ inputWrapper: string;
26
+ inputWrapperInner: string;
27
+ leftAddons: string;
28
+ rightAddons: string;
29
+ error: string;
30
+ hint: string;
31
+ decrementButton: string;
32
+ incrementButton: string;
33
+ };
package/utils.js CHANGED
@@ -271,3 +271,4 @@ exports.createNotEmptyPartsPlugin = createNotEmptyPartsPlugin;
271
271
  exports.getNumberInputTestIds = getNumberInputTestIds;
272
272
  exports.parseNumber = parseNumber;
273
273
  exports.stringifyNumberWithoutExp = stringifyNumberWithoutExp;
274
+ //# sourceMappingURL=utils.js.map
package/utils.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport {\n MaskitoOptions,\n MaskitoPlugin,\n MaskitoPostprocessor,\n MaskitoPreprocessor,\n maskitoTransform,\n} from '@maskito/core';\n\nimport { fnUtils, getDataTestId } from '@alfalab/core-components-shared';\n\nexport const MINUS_SIGN = '-';\nexport const SEPARATORS = [',', '.'];\nexport const MAX_SAFE_INTEGER = 2 ** 53 - 1;\nexport const MIN_SAFE_INTEGER = -MAX_SAFE_INTEGER;\nexport const MAX_DIGITS = 15; // с 16 уже упираемся в MAX_SAFE_INTEGER\n\nexport function parseNumber(value: string | number | null = '') {\n if (typeof value === 'number') return value;\n\n const pseudoSeparatorsRegExp = new RegExp(`[${SEPARATORS.join('')}]`, 'gi');\n\n return value\n ? parseFloat(\n value\n .replace(new RegExp(`[^${MINUS_SIGN}${SEPARATORS.join('')}0-9]`, 'gi'), '')\n .replace(pseudoSeparatorsRegExp, '.'),\n )\n : NaN;\n}\n\n/**\n * Преобразовать число в строку с заменой экспоненты на десятичную дробь\n */\nexport function stringifyNumberWithoutExp(value: number): string {\n const valueString = String(value);\n const [numberPart, expPart] = valueString.split('e-');\n\n let valueWithoutExp = valueString;\n\n if (expPart) {\n const [, fractionalPart] = numberPart.split('.');\n const decimalDigits = Number(expPart) + (fractionalPart?.length || 0);\n\n valueWithoutExp = value.toFixed(decimalDigits);\n }\n\n return valueWithoutExp;\n}\n\nconst getNumberRegExp = (min: number, fractionLength: number): RegExp => {\n let reStr = '[0-9]*';\n\n if (min < 0) {\n reStr = `(\\\\${MINUS_SIGN})?${reStr}`;\n }\n\n if (fractionLength !== 0) {\n reStr = `${reStr}[${SEPARATORS.map((s) => `\\\\${s}`).join('')}]?[0-9]{0,${\n fractionLength || MAX_DIGITS\n }}`;\n }\n\n return new RegExp(`^${reStr}$`);\n};\n\nexport function createMaskOptions({\n separator,\n fractionLength,\n min,\n max,\n}: {\n separator: string;\n fractionLength: number;\n min: number;\n max: number;\n}): MaskitoOptions {\n return {\n mask: getNumberRegExp(min, fractionLength),\n preprocessors: [\n createPseudoSeparatorPreprocessor(separator),\n createNotEmptyIntegerPartPreprocessor({ separator, fractionLength }),\n createZeroFractionLengthPreprocessor(fractionLength, separator),\n createRepeatedSeparatorPreprocessor(separator),\n ],\n postprocessors: [\n createLeadingZeroesValidationPostprocessor(separator),\n createMinMaxPostprocessor({ min, max, separator }),\n ],\n plugins: [createNotEmptyPartsPlugin(separator), createMinMaxPlugin({ min, max })],\n };\n}\n\n/**\n * Заполняет целочисленную часть при вводе separator.\n * @example Type , => 0,\n */\nfunction createNotEmptyIntegerPartPreprocessor({\n separator,\n fractionLength,\n}: {\n separator: string;\n fractionLength: number;\n}): MaskitoPreprocessor {\n const startWithDecimalSepRegExp = new RegExp(`^\\\\D*\\\\${separator}`);\n\n return ({ elementState, data }) => {\n const { value, selection } = elementState;\n const [from] = selection;\n\n if (\n fractionLength <= 0 ||\n value.includes(separator) ||\n !data.match(startWithDecimalSepRegExp)\n ) {\n return { elementState, data };\n }\n\n const digitsBeforeCursor = value.slice(0, from).match(/\\d+/);\n\n return {\n elementState,\n data: digitsBeforeCursor ? data : `0${data}`,\n };\n };\n}\n\n/**\n * Не позволяет вводить невалидный разделитель.\n */\nfunction createPseudoSeparatorPreprocessor(separator: string): MaskitoPreprocessor {\n const pseudoSeparatorsRegExp = new RegExp(`[${SEPARATORS.join('')}]`, 'gi');\n\n return ({ elementState, data }) => {\n const { value, selection } = elementState;\n\n return {\n elementState: {\n selection,\n value: value.replace(pseudoSeparatorsRegExp, separator),\n },\n data: data.replace(pseudoSeparatorsRegExp, separator),\n };\n };\n}\n\n/**\n * Помогает верно обрезать значения при вставке, если fractionLength===0\n * @example paste 123,123 -> 123\n */\nfunction createZeroFractionLengthPreprocessor(\n fractionLength: number,\n separator: string,\n): MaskitoPreprocessor {\n if (fractionLength > 0) {\n return (state) => state;\n }\n\n const decimalPartRegExp = new RegExp(`\\\\${separator}.*$`, 'g');\n\n return ({ elementState, data }) => {\n const { value, selection } = elementState;\n const [from, to] = selection;\n const newValue = value.replace(decimalPartRegExp, '');\n\n return {\n elementState: {\n selection: [Math.min(from, newValue.length), Math.min(to, newValue.length)],\n value: newValue,\n },\n data: data.replace(decimalPartRegExp, ''),\n };\n };\n}\n\n/**\n * Запрещает вводить второй сепаратор\n */\nfunction createRepeatedSeparatorPreprocessor(separator: string): MaskitoPreprocessor {\n return ({ elementState, data }) => {\n const { value, selection } = elementState;\n const [from, to] = selection;\n\n return {\n elementState,\n data:\n !value.includes(separator) || value.slice(from, to + 1).includes(separator)\n ? data\n : data.replace(new RegExp(`\\\\${separator}`), ''),\n };\n };\n}\n\n/**\n * Удаляет лишние нули в начале целой части.\n * @example 0,|00005 => Backspace => |5\n * @example -0,|00005 => Backspace => -|5\n * @example \"000000\" => 0|\n * @example 0| => Type \"5\" => 5|\n */\nfunction createLeadingZeroesValidationPostprocessor(separator: string): MaskitoPostprocessor {\n const trimLeadingZeroes = (value: string): string =>\n value\n .replace(new RegExp('^(\\\\D+)?0+(?=0)'), '$1')\n .replace(new RegExp('^(\\\\D+)?0+(?=[1-9])'), '$1');\n\n const countTrimmedZeroesBefore = (value: string, index: number): number => {\n const valueBefore = value.slice(0, index);\n const followedByZero = value.slice(index).startsWith('0');\n\n return (\n valueBefore.length - trimLeadingZeroes(valueBefore).length + (followedByZero ? 1 : 0)\n );\n };\n\n return ({ value, selection }) => {\n const [from, to] = selection;\n const hasSeparator = value.includes(separator);\n const [integerPart, decimalPart = ''] = value.split(separator);\n const zeroTrimmedIntegerPart = trimLeadingZeroes(integerPart);\n\n if (integerPart === zeroTrimmedIntegerPart) {\n return { value, selection };\n }\n\n const newFrom = from - countTrimmedZeroesBefore(value, from);\n const newTo = to - countTrimmedZeroesBefore(value, to);\n\n return {\n value: zeroTrimmedIntegerPart + (hasSeparator ? separator : '') + decimalPart,\n selection: [Math.max(newFrom, 0), Math.max(newTo, 0)],\n };\n };\n}\n\n/**\n * Валидирует значение с учетом min max значений.\n * Работает совместно с createMinMaxPlugin\n */\nfunction createMinMaxPostprocessor({\n min,\n max,\n separator,\n}: {\n min: number;\n max: number;\n separator: string;\n}): MaskitoPostprocessor {\n return ({ value, selection }) => {\n const parsedNumber = parseNumber(value);\n\n const limitedValue =\n /**\n * Здесь невозможно ограничить нижнюю границу, если пользователь вводит положительное число.\n * То же самое для верхней границы и отрицательного числа.\n * Если min=5, то без этого условия не получится ввести 40, похожая ситуация и с отрицательным max\n */\n parsedNumber > 0 ? Math.min(parsedNumber, max) : Math.max(parsedNumber, min);\n\n if (!Number.isNaN(parsedNumber) && limitedValue !== parsedNumber) {\n const newValue = `${limitedValue}`.replace('.', separator);\n\n return {\n value: newValue,\n selection: [newValue.length, newValue.length],\n };\n }\n\n return {\n value,\n selection,\n };\n };\n}\n\nexport function createMinMaxPlugin({ min, max }: { min: number; max: number }): MaskitoPlugin {\n return (element, options) => {\n const listener = () => {\n const parsedNumber = parseNumber(element.value);\n\n const clampedNumber = fnUtils.clamp(parsedNumber, min, max);\n\n if (!Number.isNaN(parsedNumber) && parsedNumber !== clampedNumber) {\n element.value = maskitoTransform(stringifyNumberWithoutExp(clampedNumber), options);\n element.dispatchEvent(new Event('input', { bubbles: true }));\n }\n };\n\n const evListenerOptions = { capture: true };\n\n element.addEventListener('blur', listener, evListenerOptions);\n\n return () => element.removeEventListener('blur', listener, evListenerOptions);\n };\n}\n\nexport function createNotEmptyPartsPlugin(separator: string): MaskitoPlugin {\n return (element) => {\n const listener = () => {\n const newValue = element.value\n // 0,9000000 -> 0,9\n .replace(new RegExp(`(\\\\${separator}\\\\d*?)(0+$)`), '$1')\n // ,2 => 0,2\n .replace(new RegExp(`^(\\\\D+)?\\\\${separator}`), `$10${separator}`)\n // 0, -> 0\n .replace(new RegExp(`\\\\${separator}$`), '')\n // -0 -> 0\n .replace(new RegExp(`^${MINUS_SIGN}0$`), '0')\n // - -> ''\n .replace(new RegExp(`^${MINUS_SIGN}$`), '');\n\n if (newValue !== element.value) {\n element.value = newValue;\n element.dispatchEvent(new Event('input', { bubbles: true }));\n }\n };\n\n const evListenerOptions = { capture: true };\n\n element.addEventListener('blur', listener, evListenerOptions);\n\n return () => element.removeEventListener('blur', listener, evListenerOptions);\n };\n}\n\nexport function getNumberInputTestIds(dataTestId: string) {\n return {\n input: dataTestId,\n inputWrapper: getDataTestId(dataTestId, 'form-control'),\n inputWrapperInner: getDataTestId(dataTestId, 'form-control-inner'),\n leftAddons: getDataTestId(dataTestId, 'form-control-left-addons'),\n rightAddons: getDataTestId(dataTestId, 'form-control-right-addons'),\n error: getDataTestId(dataTestId, 'form-control-error-message'),\n hint: getDataTestId(dataTestId, 'form-control-hint'),\n decrementButton: getDataTestId(dataTestId, 'decrement-button'),\n incrementButton: getDataTestId(dataTestId, 'increment-button'),\n };\n}\n"],"names":["fnUtils","maskitoTransform","getDataTestId"],"mappings":";;;;;;;AAAA;AAWO,IAAM,UAAU,GAAG;IACb,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG;AACtB,IAAA,gBAAgB,GAAG,IAAA,CAAA,GAAA,CAAA,CAAC,EAAI,EAAE,CAAA,GAAG;AAC7B,IAAA,gBAAgB,GAAG,CAAC;AACpB,IAAA,UAAU,GAAG,GAAG;AAEvB,SAAU,WAAW,CAAC,KAAkC,EAAA;AAAlC,IAAA,IAAA,KAAA,KAAA,MAAA,EAAA,EAAA,KAAkC,GAAA,EAAA,CAAA;IAC1D,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK;AAE3C,IAAA,IAAM,sBAAsB,GAAG,IAAI,MAAM,CAAC,WAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,EAAA,GAAA,CAAG,EAAE,IAAI,CAAC;AAE3E,IAAA,OAAO;UACD,UAAU,CACN;AACK,aAAA,OAAO,CAAC,IAAI,MAAM,CAAC,IAAK,CAAA,MAAA,CAAA,UAAU,SAAG,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,EAAM,MAAA,CAAA,EAAE,IAA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,iBAAiB,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE;QAE3C,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,iBAAiB,CAAC;AAE7D,QAAA,OAAO,YAAM,EAAA,OAAA,OAAO,CAAC,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAA,EAAA;AACjF,KAAC;AACL;AAEM,SAAU,qBAAqB,CAAC,UAAkB,EAAA;IACpD,OAAO;AACH,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,YAAY,EAAEC,kCAAa,CAAC,UAAU,EAAE,cAAc,CAAC;AACvD,QAAA,iBAAiB,EAAEA,kCAAa,CAAC,UAAU,EAAE,oBAAoB,CAAC;AAClE,QAAA,UAAU,EAAEA,kCAAa,CAAC,UAAU,EAAE,0BAA0B,CAAC;AACjE,QAAA,WAAW,EAAEA,kCAAa,CAAC,UAAU,EAAE,2BAA2B,CAAC;AACnE,QAAA,KAAK,EAAEA,kCAAa,CAAC,UAAU,EAAE,4BAA4B,CAAC;AAC9D,QAAA,IAAI,EAAEA,kCAAa,CAAC,UAAU,EAAE,mBAAmB,CAAC;AACpD,QAAA,eAAe,EAAEA,kCAAa,CAAC,UAAU,EAAE,kBAAkB,CAAC;AAC9D,QAAA,eAAe,EAAEA,kCAAa,CAAC,UAAU,EAAE,kBAAkB,CAAC;KACjE;AACL;;;;;;;;;;;;;;"}
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "./components/number-input/index";
4
- type NumberInputResponsiveProps = Omit<NumberInputProps, 'Input' | 'view'>;
5
- declare const NumberInputResponsive: React.ForwardRefExoticComponent<NumberInputResponsiveProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputResponsiveProps, NumberInputResponsive };
@@ -1 +0,0 @@
1
- export { NumberInput, NumberInputProps } from "./Component";
@@ -1 +0,0 @@
1
- export * from "./Component";
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "./components/number-input/index";
4
- type NumberInputResponsiveProps = Omit<NumberInputProps, 'Input' | 'view'>;
5
- declare const NumberInputResponsive: React.ForwardRefExoticComponent<NumberInputResponsiveProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputResponsiveProps, NumberInputResponsive };
@@ -1 +0,0 @@
1
- export { NumberInput, NumberInputProps } from "./Component";
@@ -1 +0,0 @@
1
- export * from "./Component";
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "../components/number-input/index";
4
- type NumberInputDesktopProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
5
- declare const NumberInputDesktop: React.ForwardRefExoticComponent<NumberInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputDesktopProps, NumberInputDesktop };
@@ -1,2 +0,0 @@
1
- export { NumberInputDesktop, NumberInputDesktopProps } from "./Component.desktop";
2
- export {};
package/cssm/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { NumberInputResponsive as NumberInput, NumberInputResponsiveProps as NumberInputProps } from "./Component.responsive";
2
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "../components/number-input/index";
4
- type NumberInputMobileProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
5
- declare const NumberInputMobile: React.ForwardRefExoticComponent<NumberInputMobileProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputMobileProps, NumberInputMobile };
@@ -1,2 +0,0 @@
1
- export { NumberInputMobile, NumberInputMobileProps } from "./Component.mobile";
2
- export {};
@@ -1 +0,0 @@
1
- export { getNumberInputTestIds } from "../utils";
package/cssm/utils.d.ts DELETED
@@ -1,34 +0,0 @@
1
- import { MaskitoOptions, MaskitoPlugin } from '@maskito/core';
2
- declare const MINUS_SIGN = "-";
3
- declare const SEPARATORS: string[];
4
- declare const MAX_SAFE_INTEGER: number;
5
- declare const MIN_SAFE_INTEGER: number;
6
- declare const MAX_DIGITS = 15;
7
- declare function parseNumber(value?: string | number | null): number;
8
- /**
9
- * Преобразовать число в строку с заменой экспоненты на десятичную дробь
10
- */
11
- declare function stringifyNumberWithoutExp(value: number): string;
12
- declare function createMaskOptions({ separator, fractionLength, min, max, }: {
13
- separator: string;
14
- fractionLength: number;
15
- min: number;
16
- max: number;
17
- }): MaskitoOptions;
18
- declare function createMinMaxPlugin({ min, max }: {
19
- min: number;
20
- max: number;
21
- }): MaskitoPlugin;
22
- declare function createNotEmptyPartsPlugin(separator: string): MaskitoPlugin;
23
- declare function getNumberInputTestIds(dataTestId: string): {
24
- input: string;
25
- inputWrapper: string;
26
- inputWrapperInner: string;
27
- leftAddons: string;
28
- rightAddons: string;
29
- error: string;
30
- hint: string;
31
- decrementButton: string;
32
- incrementButton: string;
33
- };
34
- export { MINUS_SIGN, SEPARATORS, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, MAX_DIGITS, parseNumber, stringifyNumberWithoutExp, createMaskOptions, createMinMaxPlugin, createNotEmptyPartsPlugin, getNumberInputTestIds };
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "../components/number-input/index";
4
- type NumberInputDesktopProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
5
- declare const NumberInputDesktop: React.ForwardRefExoticComponent<NumberInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputDesktopProps, NumberInputDesktop };
@@ -1,2 +0,0 @@
1
- export { NumberInputDesktop, NumberInputDesktopProps } from "./Component.desktop";
2
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "./components/number-input/index";
4
- type NumberInputResponsiveProps = Omit<NumberInputProps, 'Input' | 'view'>;
5
- declare const NumberInputResponsive: React.ForwardRefExoticComponent<NumberInputResponsiveProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputResponsiveProps, NumberInputResponsive };
@@ -1 +0,0 @@
1
- export { NumberInput, NumberInputProps } from "./Component";
@@ -1 +0,0 @@
1
- export * from "./Component";
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "../components/number-input/index";
4
- type NumberInputDesktopProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
5
- declare const NumberInputDesktop: React.ForwardRefExoticComponent<NumberInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputDesktopProps, NumberInputDesktop };
@@ -1,2 +0,0 @@
1
- export { NumberInputDesktop, NumberInputDesktopProps } from "./Component.desktop";
2
- export {};
package/esm/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { NumberInputResponsive as NumberInput, NumberInputResponsiveProps as NumberInputProps } from "./Component.responsive";
2
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "../components/number-input/index";
4
- type NumberInputMobileProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
5
- declare const NumberInputMobile: React.ForwardRefExoticComponent<NumberInputMobileProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputMobileProps, NumberInputMobile };
@@ -1,2 +0,0 @@
1
- export { NumberInputMobile, NumberInputMobileProps } from "./Component.mobile";
2
- export {};
@@ -1 +0,0 @@
1
- export { getNumberInputTestIds } from "../utils";
package/esm/utils.d.ts DELETED
@@ -1,34 +0,0 @@
1
- import { MaskitoOptions, MaskitoPlugin } from '@maskito/core';
2
- declare const MINUS_SIGN = "-";
3
- declare const SEPARATORS: string[];
4
- declare const MAX_SAFE_INTEGER: number;
5
- declare const MIN_SAFE_INTEGER: number;
6
- declare const MAX_DIGITS = 15;
7
- declare function parseNumber(value?: string | number | null): number;
8
- /**
9
- * Преобразовать число в строку с заменой экспоненты на десятичную дробь
10
- */
11
- declare function stringifyNumberWithoutExp(value: number): string;
12
- declare function createMaskOptions({ separator, fractionLength, min, max, }: {
13
- separator: string;
14
- fractionLength: number;
15
- min: number;
16
- max: number;
17
- }): MaskitoOptions;
18
- declare function createMinMaxPlugin({ min, max }: {
19
- min: number;
20
- max: number;
21
- }): MaskitoPlugin;
22
- declare function createNotEmptyPartsPlugin(separator: string): MaskitoPlugin;
23
- declare function getNumberInputTestIds(dataTestId: string): {
24
- input: string;
25
- inputWrapper: string;
26
- inputWrapperInner: string;
27
- leftAddons: string;
28
- rightAddons: string;
29
- error: string;
30
- hint: string;
31
- decrementButton: string;
32
- incrementButton: string;
33
- };
34
- export { MINUS_SIGN, SEPARATORS, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, MAX_DIGITS, parseNumber, stringifyNumberWithoutExp, createMaskOptions, createMinMaxPlugin, createNotEmptyPartsPlugin, getNumberInputTestIds };
package/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { NumberInputResponsive as NumberInput, NumberInputResponsiveProps as NumberInputProps } from "./Component.responsive";
2
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "../components/number-input/index";
4
- type NumberInputMobileProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
5
- declare const NumberInputMobile: React.ForwardRefExoticComponent<NumberInputMobileProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputMobileProps, NumberInputMobile };
package/mobile/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { NumberInputMobile, NumberInputMobileProps } from "./Component.mobile";
2
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "./components/number-input/index";
4
- type NumberInputResponsiveProps = Omit<NumberInputProps, 'Input' | 'view'>;
5
- declare const NumberInputResponsive: React.ForwardRefExoticComponent<NumberInputResponsiveProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputResponsiveProps, NumberInputResponsive };
@@ -1 +0,0 @@
1
- export { NumberInput, NumberInputProps } from "./Component";
@@ -1 +0,0 @@
1
- export * from "./Component";
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "../components/number-input/index";
4
- type NumberInputDesktopProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
5
- declare const NumberInputDesktop: React.ForwardRefExoticComponent<NumberInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputDesktopProps, NumberInputDesktop };
@@ -1,2 +0,0 @@
1
- export { NumberInputDesktop, NumberInputDesktopProps } from "./Component.desktop";
2
- export {};
package/modern/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { NumberInputResponsive as NumberInput, NumberInputResponsiveProps as NumberInputProps } from "./Component.responsive";
2
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "../components/number-input/index";
4
- type NumberInputMobileProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
5
- declare const NumberInputMobile: React.ForwardRefExoticComponent<NumberInputMobileProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputMobileProps, NumberInputMobile };
@@ -1,2 +0,0 @@
1
- export { NumberInputMobile, NumberInputMobileProps } from "./Component.mobile";
2
- export {};
@@ -1 +0,0 @@
1
- export { getNumberInputTestIds } from "../utils";
package/modern/utils.d.ts DELETED
@@ -1,34 +0,0 @@
1
- import { MaskitoOptions, MaskitoPlugin } from '@maskito/core';
2
- declare const MINUS_SIGN = "-";
3
- declare const SEPARATORS: string[];
4
- declare const MAX_SAFE_INTEGER: number;
5
- declare const MIN_SAFE_INTEGER: number;
6
- declare const MAX_DIGITS = 15;
7
- declare function parseNumber(value?: string | number | null): number;
8
- /**
9
- * Преобразовать число в строку с заменой экспоненты на десятичную дробь
10
- */
11
- declare function stringifyNumberWithoutExp(value: number): string;
12
- declare function createMaskOptions({ separator, fractionLength, min, max, }: {
13
- separator: string;
14
- fractionLength: number;
15
- min: number;
16
- max: number;
17
- }): MaskitoOptions;
18
- declare function createMinMaxPlugin({ min, max }: {
19
- min: number;
20
- max: number;
21
- }): MaskitoPlugin;
22
- declare function createNotEmptyPartsPlugin(separator: string): MaskitoPlugin;
23
- declare function getNumberInputTestIds(dataTestId: string): {
24
- input: string;
25
- inputWrapper: string;
26
- inputWrapperInner: string;
27
- leftAddons: string;
28
- rightAddons: string;
29
- error: string;
30
- hint: string;
31
- decrementButton: string;
32
- incrementButton: string;
33
- };
34
- export { MINUS_SIGN, SEPARATORS, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, MAX_DIGITS, parseNumber, stringifyNumberWithoutExp, createMaskOptions, createMinMaxPlugin, createNotEmptyPartsPlugin, getNumberInputTestIds };
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "./components/number-input/index";
4
- type NumberInputResponsiveProps = Omit<NumberInputProps, 'Input' | 'view'>;
5
- declare const NumberInputResponsive: React.ForwardRefExoticComponent<NumberInputResponsiveProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputResponsiveProps, NumberInputResponsive };
@@ -1,60 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { ChangeEvent, FC, Ref } from "react";
4
- import { InputProps } from "@alfalab/core-components-input";
5
- interface NumberInputProps extends Omit<InputProps, 'value' | 'onChange' | 'type' | 'defaultValue' | 'dataTestId'> {
6
- /**
7
- * Значение поля ввода
8
- */
9
- value?: string | number | null;
10
- /**
11
- * Значение по-умолчанию
12
- */
13
- defaultValue?: string | number | null;
14
- /**
15
- * Разделитель ',' или '.'
16
- */
17
- separator?: '.' | ',';
18
- /**
19
- * Количество символов после разделителя
20
- * Если указан проп step, то всегда 0
21
- */
22
- fractionLength?: number;
23
- /**
24
- * Шаг инкремента/декремента. Используйте только целочисленные значения
25
- */
26
- step?: number;
27
- /**
28
- * Минимальное значение
29
- * @default Number.MIN_SAFE_INTEGER
30
- */
31
- min?: number;
32
- /**
33
- * Максимальное значение
34
- * @default Number.MAX_SAFE_INTEGER
35
- */
36
- max?: number;
37
- /**
38
- * Отображение компонента в мобильном или десктопном виде
39
- */
40
- view?: 'desktop' | 'mobile';
41
- /**
42
- * Компонент инпута
43
- */
44
- Input: FC<InputProps & {
45
- ref?: Ref<HTMLInputElement>;
46
- }>;
47
- /**
48
- * Обработчик события изменения значения
49
- */
50
- onChange?: (e: ChangeEvent<HTMLInputElement> | null, payload: {
51
- value: number | null;
52
- }) => void;
53
- /**
54
- * Идентификатор для систем автоматизированного тестирования.
55
- * Для кнопки инкремента используется модификатор -increment-button, декремента -decrement-button
56
- */
57
- dataTestId?: string;
58
- }
59
- declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<HTMLInputElement>>;
60
- export { NumberInputProps, NumberInput };
@@ -1 +0,0 @@
1
- export { NumberInput, NumberInputProps } from "./Component";
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { InputProps } from "@alfalab/core-components-input";
4
- type SteppersProps = {
5
- value: number;
6
- min: number;
7
- max: number;
8
- className?: string;
9
- disabled?: boolean;
10
- onIncrement: () => void;
11
- onDecrement: () => void;
12
- dataTestId?: string;
13
- colors: 'default' | 'inverted';
14
- size: InputProps['size'];
15
- };
16
- declare const Steppers: React.FC<SteppersProps>;
17
- export { SteppersProps, Steppers };
@@ -1 +0,0 @@
1
- export * from "./Component";
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "../components/number-input/index";
4
- type NumberInputDesktopProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
5
- declare const NumberInputDesktop: React.ForwardRefExoticComponent<NumberInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputDesktopProps, NumberInputDesktop };
@@ -1,2 +0,0 @@
1
- export { NumberInputDesktop, NumberInputDesktopProps } from "./Component.desktop";
2
- export {};
@@ -1,2 +0,0 @@
1
- export { NumberInputResponsive as NumberInput, NumberInputResponsiveProps as NumberInputProps } from "./Component.responsive";
2
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { NumberInputProps } from "../components/number-input/index";
4
- type NumberInputMobileProps = Omit<NumberInputProps, 'Input' | 'breakpoint' | 'view'>;
5
- declare const NumberInputMobile: React.ForwardRefExoticComponent<NumberInputMobileProps & React.RefAttributes<HTMLInputElement>>;
6
- export { NumberInputMobileProps, NumberInputMobile };
@@ -1,2 +0,0 @@
1
- export { NumberInputMobile, NumberInputMobileProps } from "./Component.mobile";
2
- export {};
@@ -1 +0,0 @@
1
- export { getNumberInputTestIds } from "../utils";