@snack-uikit/search 0.11.0 → 0.11.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 0.11.1 (2025-05-07)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **FF-6490:** pass tabIndex prop to Search ([a07cc91](https://github.com/cloud-ru-tech/snack-uikit/commit/a07cc915032dcb2b68e9151c49f083a7823af598))
12
+
13
+
14
+
15
+
16
+
6
17
  # 0.11.0 (2025-04-23)
7
18
 
8
19
 
package/README.md CHANGED
@@ -38,6 +38,7 @@ import { Search, SearchPrivate } from "@snack-uikit/search";
38
38
  | onFocus | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки получения фокуса |
39
39
  | onBlur | `FocusEventHandler<HTMLInputElement>` | - | Колбек обработки потери фокуса |
40
40
  | className | `string` | - | CSS-класс |
41
+ | tabIndex | `number` | - | |
41
42
  | size | enum Size: `"s"`, `"m"`, `"l"` | s | Размер |
42
43
  | loading | `boolean` | - | Состояние загрузки |
43
44
  | onSubmit | `(value: string) => void` | - | Колбек на подтверждение поиска по строке |
@@ -1,6 +1,6 @@
1
1
  import { SearchPrivateProps } from '@snack-uikit/search-private';
2
2
  import { SearchAutocompleteProps } from '../SearchAutocomplete';
3
- export type SearchProps = Omit<SearchPrivateProps, 'onKeyDown' | 'tabIndex'> & {
3
+ export type SearchProps = Omit<SearchPrivateProps, 'onKeyDown'> & {
4
4
  /** Внешний бордер */
5
5
  outline?: boolean;
6
6
  } & ((Pick<SearchAutocompleteProps, 'options'> & {
@@ -32,9 +32,10 @@ exports.Search = (0, react_1.forwardRef)(function Search(_a, ref) {
32
32
  loading,
33
33
  placeholder,
34
34
  onSubmit,
35
- className
35
+ className,
36
+ tabIndex
36
37
  } = props,
37
- rest = __rest(props, ["value", "onChange", "onBlur", "onFocus", "outline", "loading", "placeholder", "onSubmit", "className"]);
38
+ rest = __rest(props, ["value", "onChange", "onBlur", "onFocus", "outline", "loading", "placeholder", "onSubmit", "className", "tabIndex"]);
38
39
  const supportProps = (0, utils_1.extractSupportProps)(rest);
39
40
  if (props.autocomplete) {
40
41
  return (0, jsx_runtime_1.jsx)(SearchAutocomplete_1.SearchAutocomplete, Object.assign({
@@ -49,7 +50,8 @@ exports.Search = (0, react_1.forwardRef)(function Search(_a, ref) {
49
50
  loading: loading,
50
51
  placeholder: placeholder,
51
52
  className: className,
52
- ref: ref
53
+ ref: ref,
54
+ tabIndex: tabIndex
53
55
  }, supportProps));
54
56
  }
55
57
  return (0, jsx_runtime_1.jsx)(SearchFieldText_1.SearchFieldText, Object.assign({
@@ -63,6 +65,7 @@ exports.Search = (0, react_1.forwardRef)(function Search(_a, ref) {
63
65
  loading: loading,
64
66
  placeholder: placeholder,
65
67
  className: className,
66
- ref: ref
68
+ ref: ref,
69
+ tabIndex: tabIndex
67
70
  }, supportProps));
68
71
  });
@@ -1,6 +1,6 @@
1
1
  import { SearchPrivateProps } from '@snack-uikit/search-private';
2
2
  import { SearchAutocompleteProps } from '../SearchAutocomplete';
3
- export type SearchProps = Omit<SearchPrivateProps, 'onKeyDown' | 'tabIndex'> & {
3
+ export type SearchProps = Omit<SearchPrivateProps, 'onKeyDown'> & {
4
4
  /** Внешний бордер */
5
5
  outline?: boolean;
6
6
  } & ((Pick<SearchAutocompleteProps, 'options'> & {
@@ -17,10 +17,10 @@ import { SearchAutocomplete } from '../SearchAutocomplete';
17
17
  import { SearchFieldText } from '../SearchFieldText';
18
18
  export const Search = forwardRef(function Search(_a, ref) {
19
19
  var { size = SIZE.S } = _a, props = __rest(_a, ["size"]);
20
- const { value, onChange, onBlur, onFocus, outline, loading, placeholder, onSubmit, className } = props, rest = __rest(props, ["value", "onChange", "onBlur", "onFocus", "outline", "loading", "placeholder", "onSubmit", "className"]);
20
+ const { value, onChange, onBlur, onFocus, outline, loading, placeholder, onSubmit, className, tabIndex } = props, rest = __rest(props, ["value", "onChange", "onBlur", "onFocus", "outline", "loading", "placeholder", "onSubmit", "className", "tabIndex"]);
21
21
  const supportProps = extractSupportProps(rest);
22
22
  if (props.autocomplete) {
23
- return (_jsx(SearchAutocomplete, Object.assign({ value: value, onChange: onChange, options: props.options, onBlur: onBlur, onFocus: onFocus, onSubmit: onSubmit, size: size, outline: outline, loading: loading, placeholder: placeholder, className: className, ref: ref }, supportProps)));
23
+ return (_jsx(SearchAutocomplete, Object.assign({ value: value, onChange: onChange, options: props.options, onBlur: onBlur, onFocus: onFocus, onSubmit: onSubmit, size: size, outline: outline, loading: loading, placeholder: placeholder, className: className, ref: ref, tabIndex: tabIndex }, supportProps)));
24
24
  }
25
- return (_jsx(SearchFieldText, Object.assign({ value: value, onChange: onChange, onBlur: onBlur, onFocus: onFocus, onSubmit: onSubmit, size: size, outline: outline, loading: loading, placeholder: placeholder, className: className, ref: ref }, supportProps)));
25
+ return (_jsx(SearchFieldText, Object.assign({ value: value, onChange: onChange, onBlur: onBlur, onFocus: onFocus, onSubmit: onSubmit, size: size, outline: outline, loading: loading, placeholder: placeholder, className: className, ref: ref, tabIndex: tabIndex }, supportProps)));
26
26
  });
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Search",
7
- "version": "0.11.0",
7
+ "version": "0.11.1",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -45,5 +45,5 @@
45
45
  "devDependencies": {
46
46
  "@types/merge-refs": "1.0.0"
47
47
  },
48
- "gitHead": "9786e3a2d1ef58fd4b1002d4bc69a61a70113acf"
48
+ "gitHead": "a996db0c8c75165cfe7c9dc478dc13e9a2275810"
49
49
  }
@@ -7,7 +7,7 @@ import { SIZE } from '../../constants';
7
7
  import { SearchAutocomplete, SearchAutocompleteProps } from '../SearchAutocomplete';
8
8
  import { SearchFieldText } from '../SearchFieldText';
9
9
 
10
- export type SearchProps = Omit<SearchPrivateProps, 'onKeyDown' | 'tabIndex'> & {
10
+ export type SearchProps = Omit<SearchPrivateProps, 'onKeyDown'> & {
11
11
  /** Внешний бордер */
12
12
  outline?: boolean;
13
13
  } & (
@@ -27,7 +27,8 @@ export type SearchProps = Omit<SearchPrivateProps, 'onKeyDown' | 'tabIndex'> & {
27
27
  );
28
28
 
29
29
  export const Search = forwardRef<HTMLInputElement, SearchProps>(function Search({ size = SIZE.S, ...props }, ref) {
30
- const { value, onChange, onBlur, onFocus, outline, loading, placeholder, onSubmit, className, ...rest } = props;
30
+ const { value, onChange, onBlur, onFocus, outline, loading, placeholder, onSubmit, className, tabIndex, ...rest } =
31
+ props;
31
32
  const supportProps = extractSupportProps(rest);
32
33
 
33
34
  if (props.autocomplete) {
@@ -45,6 +46,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(function Search(
45
46
  placeholder={placeholder}
46
47
  className={className}
47
48
  ref={ref}
49
+ tabIndex={tabIndex}
48
50
  {...supportProps}
49
51
  />
50
52
  );
@@ -63,6 +65,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(function Search(
63
65
  placeholder={placeholder}
64
66
  className={className}
65
67
  ref={ref}
68
+ tabIndex={tabIndex}
66
69
  {...supportProps}
67
70
  />
68
71
  );