@true-engineering/true-react-common-ui-kit 3.45.6 → 3.47.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,6 +11,19 @@
11
11
 
12
12
  # Release Notes
13
13
 
14
+ ## 3.47.0
15
+
16
+ ### Changes
17
+
18
+ - **Select**: Добавлен ref в пропсу `searchInput` Select-а
19
+ - **Select**: Добавлен shouldFocusOnMount в пропсу `searchInput` Select-а
20
+
21
+ ## 3.46.0
22
+
23
+ ### Changes
24
+
25
+ - **SearchInput**: Добавлен forwardRef
26
+
14
27
  ## 3.45.6
15
28
 
16
29
  - **phone.ts** Изменён алгоритм определения кода страны по номеру телефона
@@ -1,8 +1,8 @@
1
- import { FC } from 'react';
1
+ /// <reference types="react" />
2
2
  import { ICommonProps } from '../../types';
3
3
  import { IInputProps } from '../Input';
4
4
  import { ISearchInputStyles } from './SearchInput.styles';
5
5
  export interface ISearchInputProps extends ICommonProps<ISearchInputStyles>, Omit<IInputProps, 'type' | 'isInvalid' | 'errorMessage' | 'label' | 'isActive' | 'errorPosition' | 'hasFloatingLabel' | 'border' | 'tweakStyles'> {
6
6
  onSearchIconClick?: () => void;
7
7
  }
8
- export declare const SearchInput: FC<ISearchInputProps>;
8
+ export declare const SearchInput: import("react").ForwardRefExoticComponent<ISearchInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,6 +1,7 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: {
2
3
  title: string;
3
- component: import("react").FC<import("./SearchInput").ISearchInputProps>;
4
+ component: import("react").ForwardRefExoticComponent<import("./SearchInput").ISearchInputProps & import("react").RefAttributes<HTMLInputElement>>;
4
5
  };
5
6
  export default _default;
6
- export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./SearchInput").ISearchInputProps>;
7
+ export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./SearchInput").ISearchInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,4 +1,4 @@
1
- import { ChangeEvent, FormEvent, KeyboardEvent, MouseEvent, ReactNode, SyntheticEvent } from 'react';
1
+ import { ChangeEvent, FormEvent, KeyboardEvent, MouseEvent, ReactNode, SyntheticEvent, Ref } from 'react';
2
2
  import { IDropdownWithPopperOptions, ICommonProps } from '../../types';
3
3
  import { IIcon } from '../Icon';
4
4
  import { IInputProps } from '../Input';
@@ -27,8 +27,10 @@ export interface ISelectProps<Value> extends Omit<IInputProps, 'value' | 'onChan
27
27
  shouldScrollToList?: boolean;
28
28
  isMultiSelect?: false;
29
29
  searchInput?: {
30
- shouldRenderInList: true;
31
- } & Pick<ISearchInputProps, 'placeholder'>;
30
+ /** @default false */
31
+ shouldRenderInList?: boolean;
32
+ ref?: Ref<HTMLInputElement>;
33
+ } & Pick<ISearchInputProps, 'placeholder' | 'shouldFocusOnMount'>;
32
34
  isOptionDisabled?: (option: Value) => boolean;
33
35
  onChange: (value: Value | undefined, event: MouseEvent<HTMLElement> | KeyboardEvent | ChangeEvent<HTMLElement> | FormEvent<HTMLElement>) => void;
34
36
  onBlur?: (event: Event | SyntheticEvent) => void;
@@ -10644,7 +10644,7 @@ function _object_without_properties_loose$e(source, excluded) {
10644
10644
  }
10645
10645
  return target;
10646
10646
  }
10647
- var SearchInput = function(_param) {
10647
+ var SearchInput = /* @__PURE__ */ forwardRef(function(_param, ref) {
10648
10648
  var _param_isClearable = _param.isClearable, isClearable = _param_isClearable === void 0 ? true : _param_isClearable, tweakStyles = _param.tweakStyles, testId = _param.testId, data = _param.data, onSearchIconClick = _param.onSearchIconClick, props = _object_without_properties$e(_param, [
10649
10649
  "isClearable",
10650
10650
  "tweakStyles",
@@ -10673,6 +10673,7 @@ var SearchInput = function(_param) {
10673
10673
  })
10674
10674
  })),
10675
10675
  /* @__PURE__ */ jsx(Input, _object_spread$N({
10676
+ ref,
10676
10677
  inputMode: "search",
10677
10678
  isClearable,
10678
10679
  isActive: props.value !== "" && props.value !== void 0,
@@ -10683,7 +10684,8 @@ var SearchInput = function(_param) {
10683
10684
  }, props))
10684
10685
  ]
10685
10686
  }));
10686
- };
10687
+ });
10688
+ SearchInput.displayName = "SearchInput";
10687
10689
  var ScrollIntoViewIfNeededDefaultElementType = "div";
10688
10690
  var ScrollIntoViewIfNeededDefaultProps = {
10689
10691
  active: true,