@alfalab/core-components-input-autocomplete 11.2.0 → 11.3.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.
Files changed (35) hide show
  1. package/Component.responsive.d.ts +1 -1
  2. package/autocomplete-field/Component.js +1 -1
  3. package/autocomplete-field/index.css +2 -2
  4. package/autocomplete-mobile-field/Component.js +1 -1
  5. package/autocomplete-mobile-field/index.css +8 -8
  6. package/cssm/mobile/Component.mobile.d.ts +1 -0
  7. package/cssm/mobile/Component.mobile.js +6 -3
  8. package/cssm/mobile/Component.modal.mobile.d.ts +1 -0
  9. package/cssm/types.d.ts +7 -2
  10. package/esm/autocomplete-field/Component.js +1 -1
  11. package/esm/autocomplete-field/index.css +2 -2
  12. package/esm/autocomplete-mobile-field/Component.js +1 -1
  13. package/esm/autocomplete-mobile-field/index.css +8 -8
  14. package/esm/mobile/Component.mobile.d.ts +1 -0
  15. package/esm/mobile/Component.mobile.js +7 -4
  16. package/esm/mobile/Component.modal.mobile.d.ts +1 -0
  17. package/esm/mobile/mobile.css +2 -2
  18. package/esm/types.d.ts +7 -2
  19. package/mobile/Component.mobile.d.ts +1 -0
  20. package/mobile/Component.mobile.js +7 -4
  21. package/mobile/Component.modal.mobile.d.ts +1 -0
  22. package/mobile/mobile.css +2 -2
  23. package/modern/autocomplete-field/Component.js +1 -1
  24. package/modern/autocomplete-field/index.css +2 -2
  25. package/modern/autocomplete-mobile-field/Component.js +1 -1
  26. package/modern/autocomplete-mobile-field/index.css +8 -8
  27. package/modern/mobile/Component.mobile.d.ts +1 -0
  28. package/modern/mobile/Component.mobile.js +7 -4
  29. package/modern/mobile/Component.modal.mobile.d.ts +1 -0
  30. package/modern/mobile/mobile.css +2 -2
  31. package/modern/types.d.ts +7 -2
  32. package/package.json +4 -4
  33. package/src/mobile/Component.mobile.tsx +6 -2
  34. package/src/types.ts +8 -2
  35. package/types.d.ts +7 -2
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { InputAutocompleteProps } from "./types";
4
- declare const InputAutocomplete: React.ForwardRefExoticComponent<InputAutocompleteProps & React.RefAttributes<HTMLDivElement | HTMLInputElement>>;
4
+ declare const InputAutocomplete: React.ForwardRefExoticComponent<InputAutocompleteProps & React.RefAttributes<HTMLInputElement | HTMLDivElement>>;
5
5
  export { InputAutocomplete };
@@ -14,7 +14,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
14
  var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
15
15
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
16
16
 
17
- var styles = {"arrow":"input-autocomplete__arrow_1ohhy","error":"input-autocomplete__error_1ohhy"};
17
+ var styles = {"arrow":"input-autocomplete__arrow_266jq","error":"input-autocomplete__error_266jq"};
18
18
  require('./index.css')
19
19
 
20
20
  var AutocompleteField = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1g9go */
2
- .input-autocomplete__arrow_1ohhy.input-autocomplete__error_1ohhy ~ * {
1
+ /* hash: ujgst */
2
+ .input-autocomplete__arrow_266jq.input-autocomplete__error_266jq ~ * {
3
3
  display: none;
4
4
  }
@@ -15,7 +15,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
15
15
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
16
16
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
17
17
 
18
- var styles = {"component":"input-autocomplete__component_zrg4l","field":"input-autocomplete__field_zrg4l","disabled":"input-autocomplete__disabled_zrg4l","placeholder":"input-autocomplete__placeholder_zrg4l","contentWrapper":"input-autocomplete__contentWrapper_zrg4l","value":"input-autocomplete__value_zrg4l","focusVisible":"input-autocomplete__focusVisible_zrg4l"};
18
+ var styles = {"component":"input-autocomplete__component_1ch8r","field":"input-autocomplete__field_1ch8r","disabled":"input-autocomplete__disabled_1ch8r","placeholder":"input-autocomplete__placeholder_1ch8r","contentWrapper":"input-autocomplete__contentWrapper_1ch8r","value":"input-autocomplete__value_1ch8r","focusVisible":"input-autocomplete__focusVisible_1ch8r"};
19
19
  require('./index.css')
20
20
 
21
21
  var AutocompleteMobileField = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1vqlc */
1
+ /* hash: 1a0lh */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-link: #2288fa;
@@ -18,16 +18,16 @@
18
18
  } :root {
19
19
  --focus-color: var(--color-light-border-link);
20
20
  --disabled-cursor: not-allowed;
21
- } .input-autocomplete__component_zrg4l {
21
+ } .input-autocomplete__component_1ch8r {
22
22
  width: 100%;
23
23
  outline: none;
24
- } .input-autocomplete__field_zrg4l:not(.input-autocomplete__disabled_zrg4l) {
24
+ } .input-autocomplete__field_1ch8r:not(.input-autocomplete__disabled_1ch8r) {
25
25
  cursor: pointer;
26
- } .input-autocomplete__disabled_zrg4l {
26
+ } .input-autocomplete__disabled_1ch8r {
27
27
  cursor: var(--disabled-cursor);
28
- } .input-autocomplete__placeholder_zrg4l {
28
+ } .input-autocomplete__placeholder_1ch8r {
29
29
  color: var(--color-light-text-secondary);
30
- } .input-autocomplete__contentWrapper_zrg4l {
30
+ } .input-autocomplete__contentWrapper_1ch8r {
31
31
  font-size: 16px;
32
32
  line-height: 20px;
33
33
  font-weight: 400;
@@ -36,11 +36,11 @@
36
36
  text-overflow: ellipsis;
37
37
  overflow: hidden;
38
38
  width: 100%;
39
- } .input-autocomplete__value_zrg4l {
39
+ } .input-autocomplete__value_1ch8r {
40
40
  overflow: hidden;
41
41
  text-overflow: ellipsis;
42
42
  text-align: left;
43
- } .input-autocomplete__focusVisible_zrg4l {
43
+ } .input-autocomplete__focusVisible_1ch8r {
44
44
  outline: 2px solid var(--focus-color);
45
45
  outline-offset: 2px;
46
46
  }
@@ -6,5 +6,6 @@ declare const InputAutocompleteMobile: React.ForwardRefExoticComponent<import(".
6
6
  transitionProps?: Partial<import("react-transition-group/Transition").TransitionProps<undefined>> | undefined;
7
7
  onApply?: (() => void) | undefined;
8
8
  onCancel?: (() => void) | undefined;
9
+ title?: string | undefined;
9
10
  } & React.RefAttributes<unknown>>;
10
11
  export { InputAutocompleteMobile };
@@ -29,7 +29,7 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
29
29
  var InputAutocompleteMobile = React__default.default.forwardRef(function (_a, ref) {
30
30
  var _b;
31
31
  var _c;
32
- var Input = _a.Input, value = _a.value, name = _a.name, _d = _a.Arrow, Arrow = _d === void 0 ? null : _d, label = _a.label, _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.size, size = _f === void 0 ? 's' : _f, openProp = _a.open, onInput = _a.onInput, onOpen = _a.onOpen, multiple = _a.multiple, inputProps = _a.inputProps, _g = _a.isBottomSheet, isBottomSheet = _g === void 0 ? true : _g, dataTestId = _a.dataTestId, transitionProps = _a.transitionProps, onCancel = _a.onCancel, onApply = _a.onApply, restProps = tslib.__rest(_a, ["Input", "value", "name", "Arrow", "label", "placeholder", "size", "open", "onInput", "onOpen", "multiple", "inputProps", "isBottomSheet", "dataTestId", "transitionProps", "onCancel", "onApply"]);
32
+ var Input = _a.Input, value = _a.value, name = _a.name, _d = _a.Arrow, Arrow = _d === void 0 ? null : _d, label = _a.label, _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.size, size = _f === void 0 ? 's' : _f, openProp = _a.open, onInput = _a.onInput, onOpen = _a.onOpen, multiple = _a.multiple, inputProps = _a.inputProps, _g = _a.isBottomSheet, isBottomSheet = _g === void 0 ? true : _g, dataTestId = _a.dataTestId, transitionProps = _a.transitionProps, onCancel = _a.onCancel, onApply = _a.onApply, title = _a.title, restProps = tslib.__rest(_a, ["Input", "value", "name", "Arrow", "label", "placeholder", "size", "open", "onInput", "onOpen", "multiple", "inputProps", "isBottomSheet", "dataTestId", "transitionProps", "onCancel", "onApply", "title"]);
33
33
  var _h = React.useState(false), open = _h[0], setOpen = _h[1];
34
34
  var frozenValue = React.useRef('');
35
35
  var searchInputRef = React.useRef(null);
@@ -72,7 +72,7 @@ var InputAutocompleteMobile = React__default.default.forwardRef(function (_a, re
72
72
  var isOpen = Boolean(open || openProp);
73
73
  var Component = isBottomSheet ? mobile.SelectMobile : mobile.SelectModalMobile;
74
74
  var componentProps = (_b = {
75
- title: label || placeholder,
75
+ title: title || label || placeholder,
76
76
  onClose: restorePrevValue,
77
77
  transitionProps: tslib.__assign(tslib.__assign({}, transitionProps), { onExiting: handleExiting })
78
78
  },
@@ -83,7 +83,10 @@ var InputAutocompleteMobile = React__default.default.forwardRef(function (_a, re
83
83
  var clear = (_c = inputProps === null || inputProps === void 0 ? void 0 : inputProps.clear) !== null && _c !== void 0 ? _c : false;
84
84
  return (React__default.default.createElement(Component, tslib.__assign({ Field: autocompleteMobileField_Component.AutocompleteMobileField }, restProps, (isBottomSheet
85
85
  ? { bottomSheetProps: componentProps }
86
- : { modalProps: componentProps }), { dataTestId: dataTestId, useWithApplyHook: false, showSearch: true, searchProps: {
86
+ : {
87
+ modalProps: componentProps,
88
+ modalHeaderProps: { title: title },
89
+ }), { dataTestId: dataTestId, useWithApplyHook: false, showSearch: true, searchProps: {
87
90
  value: value,
88
91
  filterFn: utils.searchFilterStub,
89
92
  componentProps: tslib.__assign(tslib.__assign({ leftAddons: null, placeholder: placeholder }, inputProps), { className: cn__default.default(styles__default.default.input, inputProps === null || inputProps === void 0 ? void 0 : inputProps.className), clear: clear, ref: mergeRefs__default.default([searchInputRef, inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref]), onChange: onInput }),
@@ -6,5 +6,6 @@ declare const InputAutocompleteModalMobile: React.ForwardRefExoticComponent<impo
6
6
  transitionProps?: Partial<import("react-transition-group/Transition").TransitionProps<undefined>> | undefined;
7
7
  onApply?: (() => void) | undefined;
8
8
  onCancel?: (() => void) | undefined;
9
+ title?: string | undefined;
9
10
  } & React.RefAttributes<HTMLDivElement>>;
10
11
  export { InputAutocompleteModalMobile };
package/cssm/types.d.ts CHANGED
@@ -39,13 +39,18 @@ type MobileProps = {
39
39
  */
40
40
  transitionProps?: NonNullable<BottomSheetSelectMobileProps['bottomSheetProps']>['transitionProps'];
41
41
  /**
42
- * Клик на кнопку "Применить"
42
+ * Обработчик нажатия на кнопку «Продолжить» в BottomSheet или модальном окне
43
43
  */
44
44
  onApply?: () => void;
45
45
  /**
46
- * Клик на кнопку "Отмена"
46
+ * Обработчик нажатия на кнопку «Отмена» в BottomSheet или модальном окне
47
47
  */
48
48
  onCancel?: () => void;
49
+ /**
50
+ * Заголовок в модальном окне или шторке.
51
+ * Если не передан, то заголовок будет совпадать с label. Если не передан и label, то заголовок будет равен placeholder
52
+ */
53
+ title?: string;
49
54
  };
50
55
  type InputAutocompleteMobileProps = InputAutocompleteCommonProps & MobileProps;
51
56
  interface InputAutocompleteProps extends InputAutocompleteCommonProps {
@@ -4,7 +4,7 @@ import mergeRefs from 'react-merge-refs';
4
4
  import cn from 'classnames';
5
5
  import { InputDesktop } from '@alfalab/core-components-input/esm/desktop';
6
6
 
7
- var styles = {"arrow":"input-autocomplete__arrow_1ohhy","error":"input-autocomplete__error_1ohhy"};
7
+ var styles = {"arrow":"input-autocomplete__arrow_266jq","error":"input-autocomplete__error_266jq"};
8
8
  require('./index.css')
9
9
 
10
10
  var AutocompleteField = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1g9go */
2
- .input-autocomplete__arrow_1ohhy.input-autocomplete__error_1ohhy ~ * {
1
+ /* hash: ujgst */
2
+ .input-autocomplete__arrow_266jq.input-autocomplete__error_266jq ~ * {
3
3
  display: none;
4
4
  }
@@ -6,7 +6,7 @@ import { ClearButton } from '@alfalab/core-components-input/esm/shared';
6
6
  import { getDataTestId } from '@alfalab/core-components-shared/esm';
7
7
  import { useFocus } from '@alfalab/hooks';
8
8
 
9
- var styles = {"component":"input-autocomplete__component_zrg4l","field":"input-autocomplete__field_zrg4l","disabled":"input-autocomplete__disabled_zrg4l","placeholder":"input-autocomplete__placeholder_zrg4l","contentWrapper":"input-autocomplete__contentWrapper_zrg4l","value":"input-autocomplete__value_zrg4l","focusVisible":"input-autocomplete__focusVisible_zrg4l"};
9
+ var styles = {"component":"input-autocomplete__component_1ch8r","field":"input-autocomplete__field_1ch8r","disabled":"input-autocomplete__disabled_1ch8r","placeholder":"input-autocomplete__placeholder_1ch8r","contentWrapper":"input-autocomplete__contentWrapper_1ch8r","value":"input-autocomplete__value_1ch8r","focusVisible":"input-autocomplete__focusVisible_1ch8r"};
10
10
  require('./index.css')
11
11
 
12
12
  var AutocompleteMobileField = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1vqlc */
1
+ /* hash: 1a0lh */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-link: #2288fa;
@@ -18,16 +18,16 @@
18
18
  } :root {
19
19
  --focus-color: var(--color-light-border-link);
20
20
  --disabled-cursor: not-allowed;
21
- } .input-autocomplete__component_zrg4l {
21
+ } .input-autocomplete__component_1ch8r {
22
22
  width: 100%;
23
23
  outline: none;
24
- } .input-autocomplete__field_zrg4l:not(.input-autocomplete__disabled_zrg4l) {
24
+ } .input-autocomplete__field_1ch8r:not(.input-autocomplete__disabled_1ch8r) {
25
25
  cursor: pointer;
26
- } .input-autocomplete__disabled_zrg4l {
26
+ } .input-autocomplete__disabled_1ch8r {
27
27
  cursor: var(--disabled-cursor);
28
- } .input-autocomplete__placeholder_zrg4l {
28
+ } .input-autocomplete__placeholder_1ch8r {
29
29
  color: var(--color-light-text-secondary);
30
- } .input-autocomplete__contentWrapper_zrg4l {
30
+ } .input-autocomplete__contentWrapper_1ch8r {
31
31
  font-size: 16px;
32
32
  line-height: 20px;
33
33
  font-weight: 400;
@@ -36,11 +36,11 @@
36
36
  text-overflow: ellipsis;
37
37
  overflow: hidden;
38
38
  width: 100%;
39
- } .input-autocomplete__value_zrg4l {
39
+ } .input-autocomplete__value_1ch8r {
40
40
  overflow: hidden;
41
41
  text-overflow: ellipsis;
42
42
  text-align: left;
43
- } .input-autocomplete__focusVisible_zrg4l {
43
+ } .input-autocomplete__focusVisible_1ch8r {
44
44
  outline: 2px solid var(--focus-color);
45
45
  outline-offset: 2px;
46
46
  }
@@ -6,5 +6,6 @@ declare const InputAutocompleteMobile: React.ForwardRefExoticComponent<import(".
6
6
  transitionProps?: Partial<import("react-transition-group/Transition").TransitionProps<undefined>> | undefined;
7
7
  onApply?: (() => void) | undefined;
8
8
  onCancel?: (() => void) | undefined;
9
+ title?: string | undefined;
9
10
  } & React.RefAttributes<unknown>>;
10
11
  export { InputAutocompleteMobile };
@@ -12,13 +12,13 @@ import '@alfalab/core-components-input/esm/shared';
12
12
  import '@alfalab/core-components-shared/esm';
13
13
  import '@alfalab/hooks';
14
14
 
15
- var styles = {"input":"input-autocomplete__input_obkwb"};
15
+ var styles = {"input":"input-autocomplete__input_1tjk3"};
16
16
  require('./mobile.css')
17
17
 
18
18
  var InputAutocompleteMobile = React.forwardRef(function (_a, ref) {
19
19
  var _b;
20
20
  var _c;
21
- var Input = _a.Input, value = _a.value, name = _a.name, _d = _a.Arrow, Arrow = _d === void 0 ? null : _d, label = _a.label, _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.size, size = _f === void 0 ? 's' : _f, openProp = _a.open, onInput = _a.onInput, onOpen = _a.onOpen, multiple = _a.multiple, inputProps = _a.inputProps, _g = _a.isBottomSheet, isBottomSheet = _g === void 0 ? true : _g, dataTestId = _a.dataTestId, transitionProps = _a.transitionProps, onCancel = _a.onCancel, onApply = _a.onApply, restProps = __rest(_a, ["Input", "value", "name", "Arrow", "label", "placeholder", "size", "open", "onInput", "onOpen", "multiple", "inputProps", "isBottomSheet", "dataTestId", "transitionProps", "onCancel", "onApply"]);
21
+ var Input = _a.Input, value = _a.value, name = _a.name, _d = _a.Arrow, Arrow = _d === void 0 ? null : _d, label = _a.label, _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.size, size = _f === void 0 ? 's' : _f, openProp = _a.open, onInput = _a.onInput, onOpen = _a.onOpen, multiple = _a.multiple, inputProps = _a.inputProps, _g = _a.isBottomSheet, isBottomSheet = _g === void 0 ? true : _g, dataTestId = _a.dataTestId, transitionProps = _a.transitionProps, onCancel = _a.onCancel, onApply = _a.onApply, title = _a.title, restProps = __rest(_a, ["Input", "value", "name", "Arrow", "label", "placeholder", "size", "open", "onInput", "onOpen", "multiple", "inputProps", "isBottomSheet", "dataTestId", "transitionProps", "onCancel", "onApply", "title"]);
22
22
  var _h = useState(false), open = _h[0], setOpen = _h[1];
23
23
  var frozenValue = useRef('');
24
24
  var searchInputRef = useRef(null);
@@ -61,7 +61,7 @@ var InputAutocompleteMobile = React.forwardRef(function (_a, ref) {
61
61
  var isOpen = Boolean(open || openProp);
62
62
  var Component = isBottomSheet ? SelectMobile : SelectModalMobile;
63
63
  var componentProps = (_b = {
64
- title: label || placeholder,
64
+ title: title || label || placeholder,
65
65
  onClose: restorePrevValue,
66
66
  transitionProps: __assign(__assign({}, transitionProps), { onExiting: handleExiting })
67
67
  },
@@ -72,7 +72,10 @@ var InputAutocompleteMobile = React.forwardRef(function (_a, ref) {
72
72
  var clear = (_c = inputProps === null || inputProps === void 0 ? void 0 : inputProps.clear) !== null && _c !== void 0 ? _c : false;
73
73
  return (React.createElement(Component, __assign({ Field: AutocompleteMobileField }, restProps, (isBottomSheet
74
74
  ? { bottomSheetProps: componentProps }
75
- : { modalProps: componentProps }), { dataTestId: dataTestId, useWithApplyHook: false, showSearch: true, searchProps: {
75
+ : {
76
+ modalProps: componentProps,
77
+ modalHeaderProps: { title: title },
78
+ }), { dataTestId: dataTestId, useWithApplyHook: false, showSearch: true, searchProps: {
76
79
  value: value,
77
80
  filterFn: searchFilterStub,
78
81
  componentProps: __assign(__assign({ leftAddons: null, placeholder: placeholder }, inputProps), { className: cn(styles.input, inputProps === null || inputProps === void 0 ? void 0 : inputProps.className), clear: clear, ref: mergeRefs([searchInputRef, inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref]), onChange: onInput }),
@@ -6,5 +6,6 @@ declare const InputAutocompleteModalMobile: React.ForwardRefExoticComponent<impo
6
6
  transitionProps?: Partial<import("react-transition-group/Transition").TransitionProps<undefined>> | undefined;
7
7
  onApply?: (() => void) | undefined;
8
8
  onCancel?: (() => void) | undefined;
9
+ title?: string | undefined;
9
10
  } & React.RefAttributes<HTMLDivElement>>;
10
11
  export { InputAutocompleteModalMobile };
@@ -1,4 +1,4 @@
1
- /* hash: 1kaq4 */
1
+ /* hash: 1r2ws */
2
2
  :root {
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -14,6 +14,6 @@
14
14
  } :root {
15
15
  } :root {
16
16
  } :root {
17
- } .input-autocomplete__input_obkwb {
17
+ } .input-autocomplete__input_1tjk3 {
18
18
  width: auto;
19
19
  }
package/esm/types.d.ts CHANGED
@@ -39,13 +39,18 @@ type MobileProps = {
39
39
  */
40
40
  transitionProps?: NonNullable<BottomSheetSelectMobileProps['bottomSheetProps']>['transitionProps'];
41
41
  /**
42
- * Клик на кнопку "Применить"
42
+ * Обработчик нажатия на кнопку «Продолжить» в BottomSheet или модальном окне
43
43
  */
44
44
  onApply?: () => void;
45
45
  /**
46
- * Клик на кнопку "Отмена"
46
+ * Обработчик нажатия на кнопку «Отмена» в BottomSheet или модальном окне
47
47
  */
48
48
  onCancel?: () => void;
49
+ /**
50
+ * Заголовок в модальном окне или шторке.
51
+ * Если не передан, то заголовок будет совпадать с label. Если не передан и label, то заголовок будет равен placeholder
52
+ */
53
+ title?: string;
49
54
  };
50
55
  type InputAutocompleteMobileProps = InputAutocompleteCommonProps & MobileProps;
51
56
  interface InputAutocompleteProps extends InputAutocompleteCommonProps {
@@ -6,5 +6,6 @@ declare const InputAutocompleteMobile: React.ForwardRefExoticComponent<import(".
6
6
  transitionProps?: Partial<import("react-transition-group/Transition").TransitionProps<undefined>> | undefined;
7
7
  onApply?: (() => void) | undefined;
8
8
  onCancel?: (() => void) | undefined;
9
+ title?: string | undefined;
9
10
  } & React.RefAttributes<unknown>>;
10
11
  export { InputAutocompleteMobile };
@@ -23,13 +23,13 @@ var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
23
23
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
24
24
  var throttle__default = /*#__PURE__*/_interopDefaultCompat(throttle);
25
25
 
26
- var styles = {"input":"input-autocomplete__input_obkwb"};
26
+ var styles = {"input":"input-autocomplete__input_1tjk3"};
27
27
  require('./mobile.css')
28
28
 
29
29
  var InputAutocompleteMobile = React__default.default.forwardRef(function (_a, ref) {
30
30
  var _b;
31
31
  var _c;
32
- var Input = _a.Input, value = _a.value, name = _a.name, _d = _a.Arrow, Arrow = _d === void 0 ? null : _d, label = _a.label, _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.size, size = _f === void 0 ? 's' : _f, openProp = _a.open, onInput = _a.onInput, onOpen = _a.onOpen, multiple = _a.multiple, inputProps = _a.inputProps, _g = _a.isBottomSheet, isBottomSheet = _g === void 0 ? true : _g, dataTestId = _a.dataTestId, transitionProps = _a.transitionProps, onCancel = _a.onCancel, onApply = _a.onApply, restProps = tslib.__rest(_a, ["Input", "value", "name", "Arrow", "label", "placeholder", "size", "open", "onInput", "onOpen", "multiple", "inputProps", "isBottomSheet", "dataTestId", "transitionProps", "onCancel", "onApply"]);
32
+ var Input = _a.Input, value = _a.value, name = _a.name, _d = _a.Arrow, Arrow = _d === void 0 ? null : _d, label = _a.label, _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.size, size = _f === void 0 ? 's' : _f, openProp = _a.open, onInput = _a.onInput, onOpen = _a.onOpen, multiple = _a.multiple, inputProps = _a.inputProps, _g = _a.isBottomSheet, isBottomSheet = _g === void 0 ? true : _g, dataTestId = _a.dataTestId, transitionProps = _a.transitionProps, onCancel = _a.onCancel, onApply = _a.onApply, title = _a.title, restProps = tslib.__rest(_a, ["Input", "value", "name", "Arrow", "label", "placeholder", "size", "open", "onInput", "onOpen", "multiple", "inputProps", "isBottomSheet", "dataTestId", "transitionProps", "onCancel", "onApply", "title"]);
33
33
  var _h = React.useState(false), open = _h[0], setOpen = _h[1];
34
34
  var frozenValue = React.useRef('');
35
35
  var searchInputRef = React.useRef(null);
@@ -72,7 +72,7 @@ var InputAutocompleteMobile = React__default.default.forwardRef(function (_a, re
72
72
  var isOpen = Boolean(open || openProp);
73
73
  var Component = isBottomSheet ? mobile.SelectMobile : mobile.SelectModalMobile;
74
74
  var componentProps = (_b = {
75
- title: label || placeholder,
75
+ title: title || label || placeholder,
76
76
  onClose: restorePrevValue,
77
77
  transitionProps: tslib.__assign(tslib.__assign({}, transitionProps), { onExiting: handleExiting })
78
78
  },
@@ -83,7 +83,10 @@ var InputAutocompleteMobile = React__default.default.forwardRef(function (_a, re
83
83
  var clear = (_c = inputProps === null || inputProps === void 0 ? void 0 : inputProps.clear) !== null && _c !== void 0 ? _c : false;
84
84
  return (React__default.default.createElement(Component, tslib.__assign({ Field: autocompleteMobileField_Component.AutocompleteMobileField }, restProps, (isBottomSheet
85
85
  ? { bottomSheetProps: componentProps }
86
- : { modalProps: componentProps }), { dataTestId: dataTestId, useWithApplyHook: false, showSearch: true, searchProps: {
86
+ : {
87
+ modalProps: componentProps,
88
+ modalHeaderProps: { title: title },
89
+ }), { dataTestId: dataTestId, useWithApplyHook: false, showSearch: true, searchProps: {
87
90
  value: value,
88
91
  filterFn: utils.searchFilterStub,
89
92
  componentProps: tslib.__assign(tslib.__assign({ leftAddons: null, placeholder: placeholder }, inputProps), { className: cn__default.default(styles.input, inputProps === null || inputProps === void 0 ? void 0 : inputProps.className), clear: clear, ref: mergeRefs__default.default([searchInputRef, inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref]), onChange: onInput }),
@@ -6,5 +6,6 @@ declare const InputAutocompleteModalMobile: React.ForwardRefExoticComponent<impo
6
6
  transitionProps?: Partial<import("react-transition-group/Transition").TransitionProps<undefined>> | undefined;
7
7
  onApply?: (() => void) | undefined;
8
8
  onCancel?: (() => void) | undefined;
9
+ title?: string | undefined;
9
10
  } & React.RefAttributes<HTMLDivElement>>;
10
11
  export { InputAutocompleteModalMobile };
package/mobile/mobile.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1kaq4 */
1
+ /* hash: 1r2ws */
2
2
  :root {
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -14,6 +14,6 @@
14
14
  } :root {
15
15
  } :root {
16
16
  } :root {
17
- } .input-autocomplete__input_obkwb {
17
+ } .input-autocomplete__input_1tjk3 {
18
18
  width: auto;
19
19
  }
@@ -3,7 +3,7 @@ import mergeRefs from 'react-merge-refs';
3
3
  import cn from 'classnames';
4
4
  import { InputDesktop } from '@alfalab/core-components-input/modern/desktop';
5
5
 
6
- const styles = {"arrow":"input-autocomplete__arrow_1ohhy","error":"input-autocomplete__error_1ohhy"};
6
+ const styles = {"arrow":"input-autocomplete__arrow_266jq","error":"input-autocomplete__error_266jq"};
7
7
  require('./index.css')
8
8
 
9
9
  const AutocompleteField = ({ label, labelView = 'inner', placeholder, size, Arrow, Input = InputDesktop, value, error, success, hint, disabled, readOnly, onInput, inputProps = {}, innerProps, }) => {
@@ -1,4 +1,4 @@
1
- /* hash: 1g9go */
2
- .input-autocomplete__arrow_1ohhy.input-autocomplete__error_1ohhy ~ * {
1
+ /* hash: ujgst */
2
+ .input-autocomplete__arrow_266jq.input-autocomplete__error_266jq ~ * {
3
3
  display: none;
4
4
  }
@@ -5,7 +5,7 @@ import { ClearButton } from '@alfalab/core-components-input/modern/shared';
5
5
  import { getDataTestId } from '@alfalab/core-components-shared/modern';
6
6
  import { useFocus } from '@alfalab/hooks';
7
7
 
8
- const styles = {"component":"input-autocomplete__component_zrg4l","field":"input-autocomplete__field_zrg4l","disabled":"input-autocomplete__disabled_zrg4l","placeholder":"input-autocomplete__placeholder_zrg4l","contentWrapper":"input-autocomplete__contentWrapper_zrg4l","value":"input-autocomplete__value_zrg4l","focusVisible":"input-autocomplete__focusVisible_zrg4l"};
8
+ const styles = {"component":"input-autocomplete__component_1ch8r","field":"input-autocomplete__field_1ch8r","disabled":"input-autocomplete__disabled_1ch8r","placeholder":"input-autocomplete__placeholder_1ch8r","contentWrapper":"input-autocomplete__contentWrapper_1ch8r","value":"input-autocomplete__value_1ch8r","focusVisible":"input-autocomplete__focusVisible_1ch8r"};
9
9
  require('./index.css')
10
10
 
11
11
  const AutocompleteMobileField = ({ size = 'm', open, disabled, value, innerProps, dataTestId, fieldClassName, labelView = 'inner', placeholder, Arrow, valueRenderer, toggleMenu, setSelectedItems, selectedMultiple, FormControlComponent, rightAddons, error, readOnly, clear, onClear, onInput, colors = 'default', ...restProps }) => {
@@ -1,4 +1,4 @@
1
- /* hash: 1vqlc */
1
+ /* hash: 1a0lh */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-link: #2288fa;
@@ -18,16 +18,16 @@
18
18
  } :root {
19
19
  --focus-color: var(--color-light-border-link);
20
20
  --disabled-cursor: not-allowed;
21
- } .input-autocomplete__component_zrg4l {
21
+ } .input-autocomplete__component_1ch8r {
22
22
  width: 100%;
23
23
  outline: none;
24
- } .input-autocomplete__field_zrg4l:not(.input-autocomplete__disabled_zrg4l) {
24
+ } .input-autocomplete__field_1ch8r:not(.input-autocomplete__disabled_1ch8r) {
25
25
  cursor: pointer;
26
- } .input-autocomplete__disabled_zrg4l {
26
+ } .input-autocomplete__disabled_1ch8r {
27
27
  cursor: var(--disabled-cursor);
28
- } .input-autocomplete__placeholder_zrg4l {
28
+ } .input-autocomplete__placeholder_1ch8r {
29
29
  color: var(--color-light-text-secondary);
30
- } .input-autocomplete__contentWrapper_zrg4l {
30
+ } .input-autocomplete__contentWrapper_1ch8r {
31
31
  font-size: 16px;
32
32
  line-height: 20px;
33
33
  font-weight: 400;
@@ -36,11 +36,11 @@
36
36
  text-overflow: ellipsis;
37
37
  overflow: hidden;
38
38
  width: 100%;
39
- } .input-autocomplete__value_zrg4l {
39
+ } .input-autocomplete__value_1ch8r {
40
40
  overflow: hidden;
41
41
  text-overflow: ellipsis;
42
42
  text-align: left;
43
- } .input-autocomplete__focusVisible_zrg4l {
43
+ } .input-autocomplete__focusVisible_1ch8r {
44
44
  outline: 2px solid var(--focus-color);
45
45
  outline-offset: 2px;
46
46
  }
@@ -6,5 +6,6 @@ declare const InputAutocompleteMobile: React.ForwardRefExoticComponent<import(".
6
6
  transitionProps?: Partial<import("react-transition-group/Transition").TransitionProps<undefined>> | undefined;
7
7
  onApply?: (() => void) | undefined;
8
8
  onCancel?: (() => void) | undefined;
9
+ title?: string | undefined;
9
10
  } & React.RefAttributes<unknown>>;
10
11
  export { InputAutocompleteMobile };
@@ -11,10 +11,10 @@ import '@alfalab/core-components-input/modern/shared';
11
11
  import '@alfalab/core-components-shared/modern';
12
12
  import '@alfalab/hooks';
13
13
 
14
- const styles = {"input":"input-autocomplete__input_obkwb"};
14
+ const styles = {"input":"input-autocomplete__input_1tjk3"};
15
15
  require('./mobile.css')
16
16
 
17
- const InputAutocompleteMobile = React.forwardRef(({ Input, value, name, Arrow = null, label, placeholder = '', size = 's', open: openProp, onInput, onOpen, multiple, inputProps, isBottomSheet = true, dataTestId, transitionProps, onCancel, onApply, ...restProps }, ref) => {
17
+ const InputAutocompleteMobile = React.forwardRef(({ Input, value, name, Arrow = null, label, placeholder = '', size = 's', open: openProp, onInput, onOpen, multiple, inputProps, isBottomSheet = true, dataTestId, transitionProps, onCancel, onApply, title, ...restProps }, ref) => {
18
18
  const [open, setOpen] = useState(false);
19
19
  const frozenValue = useRef('');
20
20
  const searchInputRef = useRef(null);
@@ -54,7 +54,7 @@ const InputAutocompleteMobile = React.forwardRef(({ Input, value, name, Arrow =
54
54
  const isOpen = Boolean(open || openProp);
55
55
  const Component = isBottomSheet ? SelectMobile : SelectModalMobile;
56
56
  const componentProps = {
57
- title: label || placeholder,
57
+ title: title || label || placeholder,
58
58
  onClose: restorePrevValue,
59
59
  transitionProps: {
60
60
  ...transitionProps,
@@ -67,7 +67,10 @@ const InputAutocompleteMobile = React.forwardRef(({ Input, value, name, Arrow =
67
67
  const clear = inputProps?.clear ?? false;
68
68
  return (React.createElement(Component, { Field: AutocompleteMobileField, ...restProps, ...(isBottomSheet
69
69
  ? { bottomSheetProps: componentProps }
70
- : { modalProps: componentProps }), dataTestId: dataTestId, useWithApplyHook: false, showSearch: true, searchProps: {
70
+ : {
71
+ modalProps: componentProps,
72
+ modalHeaderProps: { title },
73
+ }), dataTestId: dataTestId, useWithApplyHook: false, showSearch: true, searchProps: {
71
74
  value,
72
75
  filterFn: searchFilterStub,
73
76
  componentProps: {
@@ -6,5 +6,6 @@ declare const InputAutocompleteModalMobile: React.ForwardRefExoticComponent<impo
6
6
  transitionProps?: Partial<import("react-transition-group/Transition").TransitionProps<undefined>> | undefined;
7
7
  onApply?: (() => void) | undefined;
8
8
  onCancel?: (() => void) | undefined;
9
+ title?: string | undefined;
9
10
  } & React.RefAttributes<HTMLDivElement>>;
10
11
  export { InputAutocompleteModalMobile };
@@ -1,4 +1,4 @@
1
- /* hash: 1kaq4 */
1
+ /* hash: 1r2ws */
2
2
  :root {
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -14,6 +14,6 @@
14
14
  } :root {
15
15
  } :root {
16
16
  } :root {
17
- } .input-autocomplete__input_obkwb {
17
+ } .input-autocomplete__input_1tjk3 {
18
18
  width: auto;
19
19
  }
package/modern/types.d.ts CHANGED
@@ -39,13 +39,18 @@ type MobileProps = {
39
39
  */
40
40
  transitionProps?: NonNullable<BottomSheetSelectMobileProps['bottomSheetProps']>['transitionProps'];
41
41
  /**
42
- * Клик на кнопку "Применить"
42
+ * Обработчик нажатия на кнопку «Продолжить» в BottomSheet или модальном окне
43
43
  */
44
44
  onApply?: () => void;
45
45
  /**
46
- * Клик на кнопку "Отмена"
46
+ * Обработчик нажатия на кнопку «Отмена» в BottomSheet или модальном окне
47
47
  */
48
48
  onCancel?: () => void;
49
+ /**
50
+ * Заголовок в модальном окне или шторке.
51
+ * Если не передан, то заголовок будет совпадать с label. Если не передан и label, то заголовок будет равен placeholder
52
+ */
53
+ title?: string;
49
54
  };
50
55
  type InputAutocompleteMobileProps = InputAutocompleteCommonProps & MobileProps;
51
56
  interface InputAutocompleteProps extends InputAutocompleteCommonProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-input-autocomplete",
3
- "version": "11.2.0",
3
+ "version": "11.3.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -14,10 +14,10 @@
14
14
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@alfalab/core-components-form-control": "^12.0.0",
18
- "@alfalab/core-components-input": "^14.0.0",
17
+ "@alfalab/core-components-form-control": "^12.0.1",
18
+ "@alfalab/core-components-input": "^14.0.1",
19
19
  "@alfalab/core-components-popover": "^6.2.0",
20
- "@alfalab/core-components-select": "^17.0.0",
20
+ "@alfalab/core-components-select": "^17.0.1",
21
21
  "@alfalab/core-components-shared": "^0.8.0",
22
22
  "@alfalab/core-components-mq": "^4.2.0",
23
23
  "@alfalab/hooks": "^1.13.0",
@@ -41,6 +41,7 @@ export const InputAutocompleteMobile = React.forwardRef(
41
41
  transitionProps,
42
42
  onCancel,
43
43
  onApply,
44
+ title,
44
45
  ...restProps
45
46
  }: InputAutocompleteMobileProps,
46
47
  ref,
@@ -103,7 +104,7 @@ export const InputAutocompleteMobile = React.forwardRef(
103
104
  const componentProps:
104
105
  | ModalSelectMobileProps['modalProps']
105
106
  | BottomSheetSelectMobileProps['bottomSheetProps'] = {
106
- title: label || placeholder,
107
+ title: title || label || placeholder,
107
108
  onClose: restorePrevValue,
108
109
  transitionProps: {
109
110
  ...transitionProps,
@@ -122,7 +123,10 @@ export const InputAutocompleteMobile = React.forwardRef(
122
123
  {...restProps}
123
124
  {...(isBottomSheet
124
125
  ? { bottomSheetProps: componentProps }
125
- : { modalProps: componentProps })}
126
+ : {
127
+ modalProps: componentProps,
128
+ modalHeaderProps: { title },
129
+ })}
126
130
  dataTestId={dataTestId}
127
131
  useWithApplyHook={false}
128
132
  showSearch={true}
package/src/types.ts CHANGED
@@ -56,14 +56,20 @@ type MobileProps = {
56
56
  >['transitionProps'];
57
57
 
58
58
  /**
59
- * Клик на кнопку "Применить"
59
+ * Обработчик нажатия на кнопку «Продолжить» в BottomSheet или модальном окне
60
60
  */
61
61
  onApply?: () => void;
62
62
 
63
63
  /**
64
- * Клик на кнопку "Отмена"
64
+ * Обработчик нажатия на кнопку «Отмена» в BottomSheet или модальном окне
65
65
  */
66
66
  onCancel?: () => void;
67
+
68
+ /**
69
+ * Заголовок в модальном окне или шторке.
70
+ * Если не передан, то заголовок будет совпадать с label. Если не передан и label, то заголовок будет равен placeholder
71
+ */
72
+ title?: string;
67
73
  };
68
74
 
69
75
  export type InputAutocompleteMobileProps = InputAutocompleteCommonProps & MobileProps;
package/types.d.ts CHANGED
@@ -39,13 +39,18 @@ type MobileProps = {
39
39
  */
40
40
  transitionProps?: NonNullable<BottomSheetSelectMobileProps['bottomSheetProps']>['transitionProps'];
41
41
  /**
42
- * Клик на кнопку "Применить"
42
+ * Обработчик нажатия на кнопку «Продолжить» в BottomSheet или модальном окне
43
43
  */
44
44
  onApply?: () => void;
45
45
  /**
46
- * Клик на кнопку "Отмена"
46
+ * Обработчик нажатия на кнопку «Отмена» в BottomSheet или модальном окне
47
47
  */
48
48
  onCancel?: () => void;
49
+ /**
50
+ * Заголовок в модальном окне или шторке.
51
+ * Если не передан, то заголовок будет совпадать с label. Если не передан и label, то заголовок будет равен placeholder
52
+ */
53
+ title?: string;
49
54
  };
50
55
  type InputAutocompleteMobileProps = InputAutocompleteCommonProps & MobileProps;
51
56
  interface InputAutocompleteProps extends InputAutocompleteCommonProps {