profinansy-ui-lib 3.8.9 → 3.8.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { IInput } from './Input.typed';
3
- declare const Input: React.ForwardRefExoticComponent<IInput & React.RefAttributes<HTMLInputElement>>;
2
+ import { IInput, TInputConditional } from './Input.typed';
3
+ declare const Input: React.ForwardRefExoticComponent<(IInput & TInputConditional) & React.RefAttributes<HTMLInputElement>>;
4
4
  export { Input };
@@ -1,30 +1,50 @@
1
1
  import React, { ReactNode } from 'react';
2
- export interface IInput {
2
+ export type IInput = {
3
3
  /**Значение инпута*/
4
4
  value: string;
5
+ /**Плейсхолдер*/
5
6
  placeholder?: string;
7
+ /**Название поля*/
6
8
  name: string;
7
- type?: 'text' | 'password' | 'number';
9
+ /**Тип поля*/
10
+ type?: 'text' | 'password' | 'tel';
11
+ /**Толкьо для чтения*/
8
12
  readonly?: boolean;
13
+ /**Заблокированное поле*/
9
14
  disabled?: boolean;
15
+ /**Автофокус на поле*/
10
16
  autoFocus?: boolean;
17
+ /**Максимальная длина вводимого текста*/
11
18
  maxLength?: number;
12
- numAfterDot?: number;
13
- numBeforeDot?: number;
19
+ /**Иконка для инпута*/
14
20
  icon?: ReactNode;
21
+ /**Расположение иконки*/
15
22
  positionIcon?: 'right' | 'left';
23
+ /**Фиксированный текст в поле*/
16
24
  rightText?: string;
25
+ /**Цвет фиксированного текста*/
17
26
  rightTextColor?: string;
27
+ /**Автокомплит поля*/
18
28
  autoComplete?: 'on' | 'off' | 'new-password';
29
+ /**Класс поля*/
19
30
  inputClassName?: string;
31
+ /**Цвет бордера иконки*/
20
32
  iconBorder?: boolean;
21
33
  /** Запретить ввод текста, но оставить стилизацию. */
22
34
  prohibitTextInput?: boolean;
23
- pattern?: RegExp;
24
35
  error?: boolean | string | React.ReactNode;
25
36
  onChange?: (val: string, evt: React.ChangeEvent<HTMLInputElement>) => void;
26
37
  onFocus?: () => void;
27
38
  onBlur?: () => void;
28
39
  onKeyDown?: (evt: React.KeyboardEvent<HTMLInputElement>) => void;
29
40
  onClick?: () => void;
30
- }
41
+ };
42
+ export type TInputConditional = {
43
+ /** Нужно для числового поля, меняет только порядок отдачи аргументов в onChange. */
44
+ isNumberInput?: false;
45
+ onChange?: (val: string, evt: React.ChangeEvent<HTMLInputElement>) => void;
46
+ } | {
47
+ /** Нужно для числового поля, меняет только порядок отдачи аргументов в onChange. */
48
+ isNumberInput?: true;
49
+ onChange?: (evt: React.ChangeEvent<HTMLInputElement>) => void;
50
+ };
@@ -1,2 +1 @@
1
1
  export { Input } from './Input';
2
- export { RegexPattern } from './Input.const';
@@ -0,0 +1,3 @@
1
+ import { IInputNumber } from './InputNumber.typed';
2
+ declare const InputNumber: ({ name, value, onChange, isFloat, numAfterDot, numBeforeDot, ...rest }: IInputNumber) => import("react/jsx-runtime").JSX.Element;
3
+ export { InputNumber };
@@ -0,0 +1,6 @@
1
+ import { IInput } from '../Input/Input.typed';
2
+ export interface IInputNumber extends IInput {
3
+ isFloat?: boolean;
4
+ numAfterDot?: number;
5
+ numBeforeDot?: number;
6
+ }
@@ -0,0 +1 @@
1
+ export { InputNumber } from './InputNumber';
package/dist/index.d.ts CHANGED
@@ -46,7 +46,8 @@ export { Button } from './components/uikit/Button';
46
46
  export { Tabs } from './components/uikit/Tabs';
47
47
  export { TextButton } from './components/uikit/TextButton';
48
48
  export { TextButtonLink } from './components/uikit/TextButtonLink';
49
- export { RegexPattern, Input } from './components/uikit/Input';
49
+ export { Input } from './components/uikit/Input';
50
+ export { InputNumber } from './components/uikit/InputNumber';
50
51
  export { ErrorText } from './components/uikit/ErrorText';
51
52
  export { Avatar } from './components/uikit/Avatar';
52
53
  export { Tooltip } from './components/uikit/Tooltip';