@snack-uikit/search 0.11.2-preview-ff55e021.0 → 0.11.2
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 +10 -0
- package/dist/cjs/components/SearchAutocomplete/SearchAutocomplete.js +3 -5
- package/dist/cjs/components/SearchFieldText/SearchFieldText.js +3 -5
- package/dist/esm/components/SearchAutocomplete/SearchAutocomplete.js +2 -2
- package/dist/esm/components/SearchFieldText/SearchFieldText.js +2 -2
- package/package.json +4 -4
- package/src/components/SearchAutocomplete/SearchAutocomplete.tsx +0 -2
- package/src/components/SearchFieldText/SearchFieldText.tsx +1 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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.2 (2025-05-12)
|
|
7
|
+
|
|
8
|
+
### Only dependencies have been changed
|
|
9
|
+
* [@snack-uikit/list@0.28.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/list/CHANGELOG.md)
|
|
10
|
+
* [@snack-uikit/search-private@0.4.17](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/search-private/CHANGELOG.md)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## 0.11.1 (2025-05-07)
|
|
7
17
|
|
|
8
18
|
|
|
@@ -37,10 +37,9 @@ exports.SearchAutocomplete = (0, react_1.forwardRef)(function SearchAutocomplete
|
|
|
37
37
|
outline,
|
|
38
38
|
onSubmit,
|
|
39
39
|
onFocus,
|
|
40
|
-
className
|
|
41
|
-
tabIndex
|
|
40
|
+
className
|
|
42
41
|
} = _a,
|
|
43
|
-
rest = __rest(_a, ["size", "value", "onChange", "placeholder", "options", "loading", "outline", "onSubmit", "onFocus", "className"
|
|
42
|
+
rest = __rest(_a, ["size", "value", "onChange", "placeholder", "options", "loading", "outline", "onSubmit", "onFocus", "className"]);
|
|
44
43
|
const scrollRef = (0, react_1.useRef)(null);
|
|
45
44
|
const localRef = (0, react_1.useRef)(null);
|
|
46
45
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
@@ -131,8 +130,7 @@ exports.SearchAutocomplete = (0, react_1.forwardRef)(function SearchAutocomplete
|
|
|
131
130
|
onKeyDown: handleKeyDown(onKeyDown),
|
|
132
131
|
onFocus: onFocus,
|
|
133
132
|
size: size,
|
|
134
|
-
"data-test-id": constants_1.PRIVATE_SEARCH_TEST_IDS.field
|
|
135
|
-
tabIndex: tabIndex
|
|
133
|
+
"data-test-id": constants_1.PRIVATE_SEARCH_TEST_IDS.field
|
|
136
134
|
})
|
|
137
135
|
});
|
|
138
136
|
}
|
|
@@ -28,10 +28,9 @@ exports.SearchFieldText = (0, react_1.forwardRef)(function SearchFieldText(_a, r
|
|
|
28
28
|
loading,
|
|
29
29
|
placeholder,
|
|
30
30
|
onSubmit,
|
|
31
|
-
className
|
|
32
|
-
tabIndex
|
|
31
|
+
className
|
|
33
32
|
} = _a,
|
|
34
|
-
rest = __rest(_a, ["value", "onChange", "onBlur", "onFocus", "size", "outline", "loading", "placeholder", "onSubmit", "className"
|
|
33
|
+
rest = __rest(_a, ["value", "onChange", "onBlur", "onFocus", "size", "outline", "loading", "placeholder", "onSubmit", "className"]);
|
|
35
34
|
return (0, jsx_runtime_1.jsx)(SearchDecorator_1.SearchDecorator, Object.assign({
|
|
36
35
|
outline: outline,
|
|
37
36
|
size: size,
|
|
@@ -47,8 +46,7 @@ exports.SearchFieldText = (0, react_1.forwardRef)(function SearchFieldText(_a, r
|
|
|
47
46
|
onSubmit: onSubmit,
|
|
48
47
|
placeholder: placeholder,
|
|
49
48
|
loading: loading,
|
|
50
|
-
"data-test-id": constants_1.PRIVATE_SEARCH_TEST_IDS.field
|
|
51
|
-
tabIndex: tabIndex
|
|
49
|
+
"data-test-id": constants_1.PRIVATE_SEARCH_TEST_IDS.field
|
|
52
50
|
})
|
|
53
51
|
}));
|
|
54
52
|
});
|
|
@@ -19,7 +19,7 @@ import { PRIVATE_SEARCH_TEST_IDS, SIZE, TEST_IDS } from '../../constants';
|
|
|
19
19
|
import { SearchDecorator } from '../SearchDecorator';
|
|
20
20
|
import styles from './styles.module.css';
|
|
21
21
|
export const SearchAutocomplete = forwardRef(function SearchAutocomplete(_a, ref) {
|
|
22
|
-
var { size = SIZE.S, value, onChange, placeholder, options = [], loading, outline, onSubmit, onFocus, className
|
|
22
|
+
var { size = SIZE.S, value, onChange, placeholder, options = [], loading, outline, onSubmit, onFocus, className } = _a, rest = __rest(_a, ["size", "value", "onChange", "placeholder", "options", "loading", "outline", "onSubmit", "onFocus", "className"]);
|
|
23
23
|
const scrollRef = useRef(null);
|
|
24
24
|
const localRef = useRef(null);
|
|
25
25
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -73,6 +73,6 @@ export const SearchAutocomplete = forwardRef(function SearchAutocomplete(_a, ref
|
|
|
73
73
|
}), [handleOptionKeyDown, onChange, onSubmit, options]);
|
|
74
74
|
return (_jsx("div", Object.assign({ className: cn(styles.wrap, className) }, rest, { children: _jsx(Droplist, { open: isOpen && options.length > 0, scroll: true, size: size, onOpenChange: setIsOpen, "data-test-id": TEST_IDS.droplist, triggerClassName: styles.triggerClassName, scrollRef: scrollRef, triggerElemRef: localRef, items: items, loading: loading, children: ({ onKeyDown }) => {
|
|
75
75
|
var _a;
|
|
76
|
-
return (_jsx(SearchDecorator, { size: size, outline: outline || undefined, focused: (isOpen && Boolean((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.value)) || undefined, "data-test-id": TEST_IDS.decorator, children: _jsx(SearchPrivate, { loading: loading, value: value, onChange: onChange, onSubmit: onSubmit, placeholder: placeholder, ref: mergeRefs(ref, localRef), onKeyDown: handleKeyDown(onKeyDown), onFocus: onFocus, size: size, "data-test-id": PRIVATE_SEARCH_TEST_IDS.field
|
|
76
|
+
return (_jsx(SearchDecorator, { size: size, outline: outline || undefined, focused: (isOpen && Boolean((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.value)) || undefined, "data-test-id": TEST_IDS.decorator, children: _jsx(SearchPrivate, { loading: loading, value: value, onChange: onChange, onSubmit: onSubmit, placeholder: placeholder, ref: mergeRefs(ref, localRef), onKeyDown: handleKeyDown(onKeyDown), onFocus: onFocus, size: size, "data-test-id": PRIVATE_SEARCH_TEST_IDS.field }) }));
|
|
77
77
|
} }) })));
|
|
78
78
|
});
|
|
@@ -15,6 +15,6 @@ import { SearchPrivate } from '@snack-uikit/search-private';
|
|
|
15
15
|
import { PRIVATE_SEARCH_TEST_IDS, SIZE } from '../../constants';
|
|
16
16
|
import { SearchDecorator } from '../SearchDecorator';
|
|
17
17
|
export const SearchFieldText = forwardRef(function SearchFieldText(_a, ref) {
|
|
18
|
-
var { value, onChange, onBlur, onFocus, size = SIZE.S, outline, loading, placeholder, onSubmit, className
|
|
19
|
-
return (_jsx(SearchDecorator, Object.assign({ outline: outline, size: size, className: className }, rest, { children: _jsx(SearchPrivate, { ref: ref, size: size, value: value, onChange: onChange, onBlur: onBlur, onFocus: onFocus, onSubmit: onSubmit, placeholder: placeholder, loading: loading, "data-test-id": PRIVATE_SEARCH_TEST_IDS.field
|
|
18
|
+
var { value, onChange, onBlur, onFocus, size = SIZE.S, outline, loading, placeholder, onSubmit, className } = _a, rest = __rest(_a, ["value", "onChange", "onBlur", "onFocus", "size", "outline", "loading", "placeholder", "onSubmit", "className"]);
|
|
19
|
+
return (_jsx(SearchDecorator, Object.assign({ outline: outline, size: size, className: className }, rest, { children: _jsx(SearchPrivate, { ref: ref, size: size, value: value, onChange: onChange, onBlur: onBlur, onFocus: onFocus, onSubmit: onSubmit, placeholder: placeholder, loading: loading, "data-test-id": PRIVATE_SEARCH_TEST_IDS.field }) })));
|
|
20
20
|
});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Search",
|
|
7
|
-
"version": "0.11.2
|
|
7
|
+
"version": "0.11.2",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"scripts": {},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@snack-uikit/list": "0.28.
|
|
40
|
-
"@snack-uikit/search-private": "0.4.
|
|
39
|
+
"@snack-uikit/list": "0.28.1",
|
|
40
|
+
"@snack-uikit/search-private": "0.4.17",
|
|
41
41
|
"@snack-uikit/utils": "3.8.1",
|
|
42
42
|
"classnames": "2.5.1",
|
|
43
43
|
"merge-refs": "1.3.0"
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/merge-refs": "1.0.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "82c6f5f9fd1845d6752a3cb38e8b2e0fc3cc5c98"
|
|
49
49
|
}
|
|
@@ -41,7 +41,6 @@ export const SearchAutocomplete = forwardRef<HTMLInputElement, SearchAutocomplet
|
|
|
41
41
|
onSubmit,
|
|
42
42
|
onFocus,
|
|
43
43
|
className,
|
|
44
|
-
tabIndex,
|
|
45
44
|
...rest
|
|
46
45
|
},
|
|
47
46
|
ref,
|
|
@@ -144,7 +143,6 @@ export const SearchAutocomplete = forwardRef<HTMLInputElement, SearchAutocomplet
|
|
|
144
143
|
onFocus={onFocus}
|
|
145
144
|
size={size}
|
|
146
145
|
data-test-id={PRIVATE_SEARCH_TEST_IDS.field}
|
|
147
|
-
tabIndex={tabIndex}
|
|
148
146
|
/>
|
|
149
147
|
</SearchDecorator>
|
|
150
148
|
)}
|
|
@@ -11,20 +11,7 @@ export type SearchTextFieldProps = Omit<SearchPrivateProps, 'onKeyDown'> & {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const SearchFieldText = forwardRef<HTMLInputElement, SearchTextFieldProps>(function SearchFieldText(
|
|
14
|
-
{
|
|
15
|
-
value,
|
|
16
|
-
onChange,
|
|
17
|
-
onBlur,
|
|
18
|
-
onFocus,
|
|
19
|
-
size = SIZE.S,
|
|
20
|
-
outline,
|
|
21
|
-
loading,
|
|
22
|
-
placeholder,
|
|
23
|
-
onSubmit,
|
|
24
|
-
className,
|
|
25
|
-
tabIndex,
|
|
26
|
-
...rest
|
|
27
|
-
},
|
|
14
|
+
{ value, onChange, onBlur, onFocus, size = SIZE.S, outline, loading, placeholder, onSubmit, className, ...rest },
|
|
28
15
|
ref,
|
|
29
16
|
) {
|
|
30
17
|
return (
|
|
@@ -40,7 +27,6 @@ export const SearchFieldText = forwardRef<HTMLInputElement, SearchTextFieldProps
|
|
|
40
27
|
placeholder={placeholder}
|
|
41
28
|
loading={loading}
|
|
42
29
|
data-test-id={PRIVATE_SEARCH_TEST_IDS.field}
|
|
43
|
-
tabIndex={tabIndex}
|
|
44
30
|
/>
|
|
45
31
|
</SearchDecorator>
|
|
46
32
|
);
|