@true-engineering/true-react-common-ui-kit 3.40.0 → 3.41.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.
package/README.md CHANGED
@@ -11,7 +11,15 @@
11
11
 
12
12
  # Release Notes
13
13
 
14
- ## v3.40.0
14
+ ## 3.41.0
15
+
16
+ ### Changes
17
+
18
+ - **SmartInput**: Переписан + исправлен баг с неправильной позицией каретки при повторном вводе
19
+ - **SmartInput**: Добавлена пропса `isTransliterationEnabled`
20
+ - **SmartInput**: У `onChange` добавлено два новых аргумента `rawValue` и `event`
21
+
22
+ ## 3.40.0
15
23
 
16
24
  ### Changes
17
25
 
@@ -1,12 +1,14 @@
1
- /// <reference types="react" />
1
+ import { ClipboardEvent, FormEvent } from 'react';
2
2
  import { IInputProps } from '../Input';
3
- import { ISmartType } from './types';
4
- export interface ISmartInputProps extends IInputProps {
5
- /** @default false */
6
- isUpperCase?: boolean;
3
+ import { IInputRawValue, ISmartType } from './types';
4
+ export interface ISmartInputProps extends Omit<IInputProps, 'onChange'> {
7
5
  /** @default 'default' */
8
6
  smartType?: ISmartType;
9
7
  regExp?: RegExp;
10
- onChange: (value: string) => void;
8
+ /** @default false */
9
+ isUpperCase?: boolean;
10
+ /** @default true */
11
+ isTransliterationEnabled?: boolean;
12
+ onChange: (value: string, rawValue: IInputRawValue, event?: FormEvent<HTMLInputElement> | ClipboardEvent<HTMLInputElement>) => void;
11
13
  }
12
14
  export declare const SmartInput: import("react").ForwardRefExoticComponent<ISmartInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,3 +1,4 @@
1
+ import { ICharactersMap } from './types';
1
2
  export declare const SMART_INPUT_REGEX_MAP: {
2
3
  default: RegExp;
3
4
  agencyName: RegExp;
@@ -10,9 +11,6 @@ export declare const SMART_INPUT_REGEX_MAP: {
10
11
  docNumber: RegExp;
11
12
  benefitCert: RegExp;
12
13
  };
13
- export declare const CharactersMap: {
14
- [key: string]: string;
15
- };
16
- export declare const TransliterationMap: {
17
- [key: string]: string;
18
- };
14
+ export declare const CharactersMap: ICharactersMap;
15
+ export declare const EmailCharactersMap: ICharactersMap;
16
+ export declare const TransliterationMap: ICharactersMap;
@@ -1,4 +1,2 @@
1
- import { ISmartType } from './types';
2
- export declare const transformCaseSensitive: (smartType: ISmartType, map: {
3
- [key: string]: string;
4
- }, symbol: string) => string;
1
+ import { ICharactersMap } from './types';
2
+ export declare const mapSymbols: (str: string, regex: RegExp, charactersMap: ICharactersMap, isTransliterationEnabled: boolean) => string;
@@ -1 +1,6 @@
1
+ export type ICharactersMap = Record<string, string>;
2
+ export interface IInputRawValue {
3
+ rawValue: string;
4
+ isValid: boolean;
5
+ }
1
6
  export type ISmartType = 'name' | 'nameRuEn' | 'surname' | 'surnameRuEn' | 'email' | 'agencyName' | 'default' | 'digits' | 'docNumber' | 'benefitCert';