@alfalab/core-components-input-autocomplete 9.3.8 → 9.3.9

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 (61) hide show
  1. package/Component.desktop.js +3 -3
  2. package/Component.mobile.js +8 -8
  3. package/Component.responsive.d.ts +94 -2
  4. package/Component.responsive.js +5 -5
  5. package/autocomplete-field/Component.js +3 -3
  6. package/autocomplete-field/index.css +2 -2
  7. package/autocomplete-field/index.js +1 -1
  8. package/autocomplete-mobile-field/Component.js +4 -4
  9. package/autocomplete-mobile-field/index.css +8 -8
  10. package/autocomplete-mobile-field/index.js +1 -1
  11. package/cssm/Component.desktop.js +3 -3
  12. package/cssm/Component.mobile.js +7 -7
  13. package/cssm/Component.responsive.d.ts +94 -2
  14. package/cssm/Component.responsive.js +5 -5
  15. package/cssm/autocomplete-field/Component.js +2 -2
  16. package/cssm/autocomplete-field/index.js +1 -1
  17. package/cssm/autocomplete-mobile-field/Component.js +3 -3
  18. package/cssm/autocomplete-mobile-field/index.js +1 -1
  19. package/cssm/desktop.js +1 -1
  20. package/cssm/index-7ca84eff.d.ts +5 -1
  21. package/cssm/index.js +1 -1
  22. package/cssm/mobile.js +1 -1
  23. package/cssm/responsive.js +1 -1
  24. package/desktop.js +1 -1
  25. package/esm/Component.desktop.js +1 -1
  26. package/esm/Component.mobile.js +2 -2
  27. package/esm/Component.responsive.d.ts +94 -2
  28. package/esm/Component.responsive.js +5 -5
  29. package/esm/autocomplete-field/Component.js +2 -2
  30. package/esm/autocomplete-field/index.css +2 -2
  31. package/esm/autocomplete-field/index.js +1 -1
  32. package/esm/autocomplete-mobile-field/Component.js +2 -2
  33. package/esm/autocomplete-mobile-field/index.css +8 -8
  34. package/esm/autocomplete-mobile-field/index.js +1 -1
  35. package/esm/desktop.js +1 -1
  36. package/esm/index-7ca84eff.d.ts +5 -1
  37. package/esm/index.js +1 -1
  38. package/esm/mobile.css +4 -4
  39. package/esm/mobile.js +1 -1
  40. package/esm/responsive.js +1 -1
  41. package/index-7ca84eff.d.ts +5 -1
  42. package/index.js +1 -1
  43. package/mobile.css +4 -4
  44. package/mobile.js +1 -1
  45. package/modern/Component.mobile.js +1 -1
  46. package/modern/Component.responsive.d.ts +94 -2
  47. package/modern/Component.responsive.js +4 -4
  48. package/modern/autocomplete-field/Component.js +1 -1
  49. package/modern/autocomplete-field/index.css +2 -2
  50. package/modern/autocomplete-mobile-field/Component.js +1 -1
  51. package/modern/autocomplete-mobile-field/index.css +8 -8
  52. package/modern/index-7ca84eff.d.ts +5 -1
  53. package/modern/mobile.css +4 -4
  54. package/package.json +7 -6
  55. package/responsive.js +1 -1
  56. package/cssm/tslib.es6-bbd6cd2a.d.ts +0 -36
  57. package/cssm/tslib.es6-bbd6cd2a.js +0 -42
  58. package/esm/tslib.es6-da6da1a4.d.ts +0 -36
  59. package/esm/tslib.es6-da6da1a4.js +0 -40
  60. package/tslib.es6-e3f0e7e9.d.ts +0 -36
  61. package/tslib.es6-e3f0e7e9.js +0 -42
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react-transition-group" />
2
2
  /// <reference types="react" />
3
3
  import React from "react";
4
- import { HTMLAttributes, ReactNode, FC } from "react";
4
+ import { HTMLAttributes, ReactNode, RefObject, FC } from "react";
5
5
  import { TransitionProps } from "react-transition-group/Transition";
6
6
  import { BaseModalProps } from "./index-bdb4c6b9";
7
7
  import { SwipeableHandlers } from "react-swipeable/types";
@@ -156,6 +156,10 @@ type BottomSheetProps = {
156
156
  * Свойства для Бэкдропа
157
157
  */
158
158
  backdropProps?: BaseModalProps["backdropProps"];
159
+ /**
160
+ * Реф на контейнер, в котором происходит скролл
161
+ */
162
+ scrollableContainerRef?: RefObject<HTMLElement>;
159
163
  /**
160
164
  * Обработчик закрытия
161
165
  */
package/cssm/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var Component_desktop = require('./Component.desktop.js');
4
4
  var Component_responsive = require('./Component.responsive.js');
5
- require('./tslib.es6-bbd6cd2a.js');
5
+ require('tslib');
6
6
  require('react');
7
7
  require('@alfalab/core-components-select/cssm');
8
8
  require('./autocomplete-field/Component.js');
package/cssm/mobile.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var Component_mobile = require('./Component.mobile.js');
4
- require('./tslib.es6-bbd6cd2a.js');
4
+ require('tslib');
5
5
  require('react');
6
6
  require('react-merge-refs');
7
7
  require('classnames');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var Component_responsive = require('./Component.responsive.js');
4
- require('./tslib.es6-bbd6cd2a.js');
4
+ require('tslib');
5
5
  require('react');
6
6
  require('@alfalab/hooks');
7
7
  require('./Component.desktop.js');
package/desktop.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var Component_desktop = require('./Component.desktop.js');
4
- require('./tslib.es6-e3f0e7e9.js');
4
+ require('tslib');
5
5
  require('react');
6
6
  require('@alfalab/core-components-select');
7
7
  require('./autocomplete-field/Component.js');
@@ -1,4 +1,4 @@
1
- import { _ as __rest, a as __assign } from './tslib.es6-da6da1a4.js';
1
+ import { __rest, __assign } from 'tslib';
2
2
  import React, { forwardRef } from 'react';
3
3
  import { BaseSelect, OptionsList, Optgroup, Option } from '@alfalab/core-components-select/esm';
4
4
  import { AutocompleteField } from './autocomplete-field/Component.js';
@@ -1,4 +1,4 @@
1
- import { _ as __rest, a as __assign } from './tslib.es6-da6da1a4.js';
1
+ import { __rest, __assign } from 'tslib';
2
2
  import React, { useState, useRef, useMemo } from 'react';
3
3
  import mergeRefs from 'react-merge-refs';
4
4
  import cn from 'classnames';
@@ -10,7 +10,7 @@ import { AutocompleteMobileField } from './autocomplete-mobile-field/Component.j
10
10
  import '@alfalab/core-components-form-control/esm';
11
11
  import '@alfalab/hooks';
12
12
 
13
- var styles = {"bottomSheetInput":"input-autocomplete__bottomSheetInput_2c0ge","footer":"input-autocomplete__footer_2c0ge"};
13
+ var styles = {"bottomSheetInput":"input-autocomplete__bottomSheetInput_hzjpp","footer":"input-autocomplete__footer_hzjpp"};
14
14
  require('./mobile.css')
15
15
 
16
16
  var SELECTED = [];
@@ -1,4 +1,6 @@
1
- import { FC } from 'react';
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { BaseSelectProps } from "@alfalab/core-components-select";
2
4
  import { InputAutocompleteDesktopProps } from "./Component.desktop";
3
5
  import { InputAutocompleteMobileProps } from "./Component.mobile";
4
6
  type InputAutocompleteResponsiveProps = InputAutocompleteDesktopProps & InputAutocompleteMobileProps & {
@@ -9,5 +11,95 @@ type InputAutocompleteResponsiveProps = InputAutocompleteDesktopProps & InputAut
9
11
  breakpoint?: number;
10
12
  };
11
13
  type InputAutocompleteMedia = 'desktop' | 'mobile';
12
- declare const InputAutocompleteResponsive: FC<InputAutocompleteResponsiveProps>;
14
+ declare const InputAutocompleteResponsive: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "nativeSelect" | "Field"> & {
15
+ Input?: React.FC<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
16
+ value?: string | undefined;
17
+ defaultValue?: string | undefined;
18
+ block?: boolean | undefined;
19
+ clear?: boolean | undefined;
20
+ size?: "s" | "m" | "l" | "xl" | undefined;
21
+ colors?: "default" | "inverted" | undefined;
22
+ error?: React.ReactNode;
23
+ success?: boolean | undefined;
24
+ hint?: React.ReactNode;
25
+ label?: React.ReactNode;
26
+ labelView?: "inner" | "outer" | undefined;
27
+ type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
28
+ wrapperRef?: React.Ref<HTMLDivElement> | undefined;
29
+ leftAddons?: React.ReactNode;
30
+ rightAddons?: React.ReactNode;
31
+ bottomAddons?: React.ReactNode;
32
+ className?: string | undefined;
33
+ fieldClassName?: string | undefined;
34
+ inputClassName?: string | undefined;
35
+ labelClassName?: string | undefined;
36
+ addonsClassName?: string | undefined;
37
+ focusedClassName?: string | undefined;
38
+ filledClassName?: string | undefined;
39
+ onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
40
+ value: string;
41
+ }) => void) | undefined;
42
+ onClear?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined;
43
+ onClick?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
44
+ onMouseDown?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
45
+ onMouseUp?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
46
+ dataTestId?: string | undefined;
47
+ } & React.RefAttributes<HTMLInputElement>> | undefined;
48
+ inputProps?: (Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
49
+ value?: string | undefined;
50
+ defaultValue?: string | undefined;
51
+ block?: boolean | undefined;
52
+ clear?: boolean | undefined;
53
+ size?: "s" | "m" | "l" | "xl" | undefined;
54
+ colors?: "default" | "inverted" | undefined;
55
+ error?: React.ReactNode;
56
+ success?: boolean | undefined;
57
+ hint?: React.ReactNode;
58
+ label?: React.ReactNode;
59
+ labelView?: "inner" | "outer" | undefined;
60
+ type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
61
+ wrapperRef?: React.Ref<HTMLDivElement> | undefined;
62
+ leftAddons?: React.ReactNode;
63
+ rightAddons?: React.ReactNode;
64
+ bottomAddons?: React.ReactNode;
65
+ className?: string | undefined;
66
+ fieldClassName?: string | undefined;
67
+ inputClassName?: string | undefined;
68
+ labelClassName?: string | undefined;
69
+ addonsClassName?: string | undefined;
70
+ focusedClassName?: string | undefined;
71
+ filledClassName?: string | undefined;
72
+ onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
73
+ value: string;
74
+ }) => void) | undefined;
75
+ onClear?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined;
76
+ onClick?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
77
+ onMouseDown?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
78
+ onMouseUp?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
79
+ dataTestId?: string | undefined;
80
+ } & Record<string, unknown>) | undefined;
81
+ value?: string | undefined;
82
+ readOnly?: boolean | undefined;
83
+ success?: boolean | undefined;
84
+ onInput?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
85
+ updatePopover?: React.MutableRefObject<() => void> | undefined;
86
+ } & Omit<BaseSelectProps, "onScroll" | "valueRenderer" | "autocomplete" | "nativeSelect" | "OptionsList" | "Checkmark"> & {
87
+ onChange: (payload: string | import("@alfalab/core-components-select").BaseSelectChangePayload) => void;
88
+ onFilter: (event: React.ChangeEvent<HTMLInputElement>) => void;
89
+ value?: string | undefined;
90
+ filter?: string | undefined;
91
+ onCancel?: (() => void) | undefined;
92
+ onClearFilter?: (() => void) | undefined;
93
+ bottomSheetProps?: Partial<import("./index-7ca84eff").BottomSheetProps> | undefined;
94
+ bottomSheetHeaderAddonsProps?: Record<string, unknown> | undefined;
95
+ continueButtonProps?: import("packages/button/src").ButtonProps | undefined;
96
+ cancelButtonProps?: import("packages/button/src").ButtonProps | undefined;
97
+ Input?: React.ElementType<any> | undefined;
98
+ } & {
99
+ /**
100
+ * Контрольная точка, с нее начинается desktop версия
101
+ * @default 1024
102
+ */
103
+ breakpoint?: number | undefined;
104
+ } & React.RefAttributes<HTMLDivElement | HTMLInputElement>>;
13
105
  export { InputAutocompleteResponsiveProps, InputAutocompleteMedia, InputAutocompleteResponsive };
@@ -1,5 +1,5 @@
1
- import { _ as __rest, a as __assign } from './tslib.es6-da6da1a4.js';
2
- import React from 'react';
1
+ import { __rest, __assign } from 'tslib';
2
+ import React, { forwardRef } from 'react';
3
3
  import { useMedia } from '@alfalab/hooks';
4
4
  import { InputAutocompleteDesktop } from './Component.desktop.js';
5
5
  import { InputAutocompleteMobile } from './Component.mobile.js';
@@ -13,13 +13,13 @@ import '@alfalab/core-components-button/esm';
13
13
  import './autocomplete-mobile-field/Component.js';
14
14
  import '@alfalab/core-components-form-control/esm';
15
15
 
16
- var InputAutocompleteResponsive = function (_a) {
16
+ var InputAutocompleteResponsive = forwardRef(function (_a, ref) {
17
17
  var _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, restProps = __rest(_a, ["breakpoint"]);
18
18
  var view = useMedia([
19
19
  ['mobile', "(max-width: ".concat(breakpoint - 1, "px)")],
20
20
  ['desktop', "(min-width: ".concat(breakpoint, "px)")],
21
21
  ], 'desktop')[0];
22
- return view === 'desktop' ? (React.createElement(InputAutocompleteDesktop, __assign({}, restProps))) : (React.createElement(InputAutocompleteMobile, __assign({}, restProps)));
23
- };
22
+ return view === 'desktop' ? (React.createElement(InputAutocompleteDesktop, __assign({}, restProps, { ref: ref }))) : (React.createElement(InputAutocompleteMobile, __assign({}, restProps, { ref: ref })));
23
+ });
24
24
 
25
25
  export { InputAutocompleteResponsive };
@@ -1,10 +1,10 @@
1
- import { a as __assign } from '../tslib.es6-da6da1a4.js';
1
+ import { __assign } from 'tslib';
2
2
  import React, { useRef, useCallback } from 'react';
3
3
  import mergeRefs from 'react-merge-refs';
4
4
  import cn from 'classnames';
5
5
  import { Input } from '@alfalab/core-components-input/esm';
6
6
 
7
- var styles = {"arrow":"input-autocomplete__arrow_81gl5","error":"input-autocomplete__error_81gl5"};
7
+ var styles = {"arrow":"input-autocomplete__arrow_nozug","error":"input-autocomplete__error_nozug"};
8
8
  require('./index.css')
9
9
 
10
10
  var AutocompleteField = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1w8gi */
2
- .input-autocomplete__arrow_81gl5.input-autocomplete__error_81gl5 ~ * {
1
+ /* hash: hf92a */
2
+ .input-autocomplete__arrow_nozug.input-autocomplete__error_nozug ~ * {
3
3
  display: none;
4
4
  }
@@ -1,5 +1,5 @@
1
1
  export { AutocompleteField } from './Component.js';
2
- import '../tslib.es6-da6da1a4.js';
2
+ import 'tslib';
3
3
  import 'react';
4
4
  import 'react-merge-refs';
5
5
  import 'classnames';
@@ -1,10 +1,10 @@
1
- import { _ as __rest, a as __assign } from '../tslib.es6-da6da1a4.js';
1
+ import { __rest, __assign } from 'tslib';
2
2
  import React, { useState, useRef } from 'react';
3
3
  import cn from 'classnames';
4
4
  import { FormControl } from '@alfalab/core-components-form-control/esm';
5
5
  import { useFocus } from '@alfalab/hooks';
6
6
 
7
- var styles = {"component":"input-autocomplete__component_1stiz","field":"input-autocomplete__field_1stiz","disabled":"input-autocomplete__disabled_1stiz","placeholder":"input-autocomplete__placeholder_1stiz","contentWrapper":"input-autocomplete__contentWrapper_1stiz","value":"input-autocomplete__value_1stiz","focusVisible":"input-autocomplete__focusVisible_1stiz"};
7
+ var styles = {"component":"input-autocomplete__component_uunff","field":"input-autocomplete__field_uunff","disabled":"input-autocomplete__disabled_uunff","placeholder":"input-autocomplete__placeholder_uunff","contentWrapper":"input-autocomplete__contentWrapper_uunff","value":"input-autocomplete__value_uunff","focusVisible":"input-autocomplete__focusVisible_uunff"};
8
8
  require('./index.css')
9
9
 
10
10
  var AutocompleteMobileField = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 16q2u */
1
+ /* hash: 1vnyq */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-link: #007aff;
@@ -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_1stiz {
21
+ } .input-autocomplete__component_uunff {
22
22
  width: 100%;
23
23
  outline: none;
24
- } .input-autocomplete__field_1stiz:not(.input-autocomplete__disabled_1stiz) {
24
+ } .input-autocomplete__field_uunff:not(.input-autocomplete__disabled_uunff) {
25
25
  cursor: pointer;
26
- } .input-autocomplete__disabled_1stiz {
26
+ } .input-autocomplete__disabled_uunff {
27
27
  cursor: var(--disabled-cursor);
28
- } .input-autocomplete__placeholder_1stiz {
28
+ } .input-autocomplete__placeholder_uunff {
29
29
  color: var(--color-light-text-secondary);
30
- } .input-autocomplete__contentWrapper_1stiz {
30
+ } .input-autocomplete__contentWrapper_uunff {
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_1stiz {
39
+ } .input-autocomplete__value_uunff {
40
40
  overflow: hidden;
41
41
  text-overflow: ellipsis;
42
42
  text-align: left;
43
- } .input-autocomplete__focusVisible_1stiz {
43
+ } .input-autocomplete__focusVisible_uunff {
44
44
  outline: 2px solid var(--focus-color);
45
45
  outline-offset: 2px;
46
46
  }
@@ -1,5 +1,5 @@
1
1
  export { AutocompleteMobileField } from './Component.js';
2
- import '../tslib.es6-da6da1a4.js';
2
+ import 'tslib';
3
3
  import 'react';
4
4
  import 'classnames';
5
5
  import '@alfalab/core-components-form-control/esm';
package/esm/desktop.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { InputAutocompleteDesktop } from './Component.desktop.js';
2
- import './tslib.es6-da6da1a4.js';
2
+ import 'tslib';
3
3
  import 'react';
4
4
  import '@alfalab/core-components-select/esm';
5
5
  import './autocomplete-field/Component.js';
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react-transition-group" />
2
2
  /// <reference types="react" />
3
3
  import React from "react";
4
- import { HTMLAttributes, ReactNode, FC } from "react";
4
+ import { HTMLAttributes, ReactNode, RefObject, FC } from "react";
5
5
  import { TransitionProps } from "react-transition-group/Transition";
6
6
  import { BaseModalProps } from "./index-bdb4c6b9";
7
7
  import { SwipeableHandlers } from "react-swipeable/types";
@@ -156,6 +156,10 @@ type BottomSheetProps = {
156
156
  * Свойства для Бэкдропа
157
157
  */
158
158
  backdropProps?: BaseModalProps["backdropProps"];
159
+ /**
160
+ * Реф на контейнер, в котором происходит скролл
161
+ */
162
+ scrollableContainerRef?: RefObject<HTMLElement>;
159
163
  /**
160
164
  * Обработчик закрытия
161
165
  */
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { InputAutocompleteDesktop as InputAutocomplete } from './Component.desktop.js';
2
2
  export { InputAutocompleteResponsive } from './Component.responsive.js';
3
- import './tslib.es6-da6da1a4.js';
3
+ import 'tslib';
4
4
  import 'react';
5
5
  import '@alfalab/core-components-select/esm';
6
6
  import './autocomplete-field/Component.js';
package/esm/mobile.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 7hvec */
1
+ /* hash: 152d7 */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -16,11 +16,11 @@
16
16
  --gap-m: 16px;
17
17
  } :root {
18
18
  } :root {
19
- } .input-autocomplete__bottomSheetInput_2c0ge {
19
+ } .input-autocomplete__bottomSheetInput_hzjpp {
20
20
  padding: 0 var(--gap-xs) var(--gap-xs);
21
21
  box-sizing: border-box;
22
- } .input-autocomplete__footer_2c0ge {
22
+ } .input-autocomplete__footer_hzjpp {
23
23
  display: flex
24
- } .input-autocomplete__footer_2c0ge > button + button {
24
+ } .input-autocomplete__footer_hzjpp > button + button {
25
25
  margin-left: var(--gap-m);
26
26
  }
package/esm/mobile.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { InputAutocompleteMobile } from './Component.mobile.js';
2
- import './tslib.es6-da6da1a4.js';
2
+ import 'tslib';
3
3
  import 'react';
4
4
  import 'react-merge-refs';
5
5
  import 'classnames';
package/esm/responsive.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { InputAutocompleteResponsive } from './Component.responsive.js';
2
- import './tslib.es6-da6da1a4.js';
2
+ import 'tslib';
3
3
  import 'react';
4
4
  import '@alfalab/hooks';
5
5
  import './Component.desktop.js';
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react-transition-group" />
2
2
  /// <reference types="react" />
3
3
  import React from "react";
4
- import { HTMLAttributes, ReactNode, FC } from "react";
4
+ import { HTMLAttributes, ReactNode, RefObject, FC } from "react";
5
5
  import { TransitionProps } from "react-transition-group/Transition";
6
6
  import { BaseModalProps } from "./index-bdb4c6b9";
7
7
  import { SwipeableHandlers } from "react-swipeable/types";
@@ -156,6 +156,10 @@ type BottomSheetProps = {
156
156
  * Свойства для Бэкдропа
157
157
  */
158
158
  backdropProps?: BaseModalProps["backdropProps"];
159
+ /**
160
+ * Реф на контейнер, в котором происходит скролл
161
+ */
162
+ scrollableContainerRef?: RefObject<HTMLElement>;
159
163
  /**
160
164
  * Обработчик закрытия
161
165
  */
package/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var Component_desktop = require('./Component.desktop.js');
4
4
  var Component_responsive = require('./Component.responsive.js');
5
- require('./tslib.es6-e3f0e7e9.js');
5
+ require('tslib');
6
6
  require('react');
7
7
  require('@alfalab/core-components-select');
8
8
  require('./autocomplete-field/Component.js');
package/mobile.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 7hvec */
1
+ /* hash: 152d7 */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -16,11 +16,11 @@
16
16
  --gap-m: 16px;
17
17
  } :root {
18
18
  } :root {
19
- } .input-autocomplete__bottomSheetInput_2c0ge {
19
+ } .input-autocomplete__bottomSheetInput_hzjpp {
20
20
  padding: 0 var(--gap-xs) var(--gap-xs);
21
21
  box-sizing: border-box;
22
- } .input-autocomplete__footer_2c0ge {
22
+ } .input-autocomplete__footer_hzjpp {
23
23
  display: flex
24
- } .input-autocomplete__footer_2c0ge > button + button {
24
+ } .input-autocomplete__footer_hzjpp > button + button {
25
25
  margin-left: var(--gap-m);
26
26
  }
package/mobile.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var Component_mobile = require('./Component.mobile.js');
4
- require('./tslib.es6-e3f0e7e9.js');
4
+ require('tslib');
5
5
  require('react');
6
6
  require('react-merge-refs');
7
7
  require('classnames');
@@ -9,7 +9,7 @@ import { AutocompleteMobileField } from './autocomplete-mobile-field/Component.j
9
9
  import '@alfalab/core-components-form-control/modern';
10
10
  import '@alfalab/hooks';
11
11
 
12
- const styles = {"bottomSheetInput":"input-autocomplete__bottomSheetInput_2c0ge","footer":"input-autocomplete__footer_2c0ge"};
12
+ const styles = {"bottomSheetInput":"input-autocomplete__bottomSheetInput_hzjpp","footer":"input-autocomplete__footer_hzjpp"};
13
13
  require('./mobile.css')
14
14
 
15
15
  const SELECTED = [];
@@ -1,4 +1,6 @@
1
- import { FC } from 'react';
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { BaseSelectProps } from "@alfalab/core-components-select";
2
4
  import { InputAutocompleteDesktopProps } from "./Component.desktop";
3
5
  import { InputAutocompleteMobileProps } from "./Component.mobile";
4
6
  type InputAutocompleteResponsiveProps = InputAutocompleteDesktopProps & InputAutocompleteMobileProps & {
@@ -9,5 +11,95 @@ type InputAutocompleteResponsiveProps = InputAutocompleteDesktopProps & InputAut
9
11
  breakpoint?: number;
10
12
  };
11
13
  type InputAutocompleteMedia = 'desktop' | 'mobile';
12
- declare const InputAutocompleteResponsive: FC<InputAutocompleteResponsiveProps>;
14
+ declare const InputAutocompleteResponsive: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "nativeSelect" | "Field"> & {
15
+ Input?: React.FC<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
16
+ value?: string | undefined;
17
+ defaultValue?: string | undefined;
18
+ block?: boolean | undefined;
19
+ clear?: boolean | undefined;
20
+ size?: "s" | "m" | "l" | "xl" | undefined;
21
+ colors?: "default" | "inverted" | undefined;
22
+ error?: React.ReactNode;
23
+ success?: boolean | undefined;
24
+ hint?: React.ReactNode;
25
+ label?: React.ReactNode;
26
+ labelView?: "inner" | "outer" | undefined;
27
+ type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
28
+ wrapperRef?: React.Ref<HTMLDivElement> | undefined;
29
+ leftAddons?: React.ReactNode;
30
+ rightAddons?: React.ReactNode;
31
+ bottomAddons?: React.ReactNode;
32
+ className?: string | undefined;
33
+ fieldClassName?: string | undefined;
34
+ inputClassName?: string | undefined;
35
+ labelClassName?: string | undefined;
36
+ addonsClassName?: string | undefined;
37
+ focusedClassName?: string | undefined;
38
+ filledClassName?: string | undefined;
39
+ onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
40
+ value: string;
41
+ }) => void) | undefined;
42
+ onClear?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined;
43
+ onClick?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
44
+ onMouseDown?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
45
+ onMouseUp?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
46
+ dataTestId?: string | undefined;
47
+ } & React.RefAttributes<HTMLInputElement>> | undefined;
48
+ inputProps?: (Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
49
+ value?: string | undefined;
50
+ defaultValue?: string | undefined;
51
+ block?: boolean | undefined;
52
+ clear?: boolean | undefined;
53
+ size?: "s" | "m" | "l" | "xl" | undefined;
54
+ colors?: "default" | "inverted" | undefined;
55
+ error?: React.ReactNode;
56
+ success?: boolean | undefined;
57
+ hint?: React.ReactNode;
58
+ label?: React.ReactNode;
59
+ labelView?: "inner" | "outer" | undefined;
60
+ type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
61
+ wrapperRef?: React.Ref<HTMLDivElement> | undefined;
62
+ leftAddons?: React.ReactNode;
63
+ rightAddons?: React.ReactNode;
64
+ bottomAddons?: React.ReactNode;
65
+ className?: string | undefined;
66
+ fieldClassName?: string | undefined;
67
+ inputClassName?: string | undefined;
68
+ labelClassName?: string | undefined;
69
+ addonsClassName?: string | undefined;
70
+ focusedClassName?: string | undefined;
71
+ filledClassName?: string | undefined;
72
+ onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
73
+ value: string;
74
+ }) => void) | undefined;
75
+ onClear?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined;
76
+ onClick?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
77
+ onMouseDown?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
78
+ onMouseUp?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
79
+ dataTestId?: string | undefined;
80
+ } & Record<string, unknown>) | undefined;
81
+ value?: string | undefined;
82
+ readOnly?: boolean | undefined;
83
+ success?: boolean | undefined;
84
+ onInput?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
85
+ updatePopover?: React.MutableRefObject<() => void> | undefined;
86
+ } & Omit<BaseSelectProps, "onScroll" | "valueRenderer" | "autocomplete" | "nativeSelect" | "OptionsList" | "Checkmark"> & {
87
+ onChange: (payload: string | import("@alfalab/core-components-select").BaseSelectChangePayload) => void;
88
+ onFilter: (event: React.ChangeEvent<HTMLInputElement>) => void;
89
+ value?: string | undefined;
90
+ filter?: string | undefined;
91
+ onCancel?: (() => void) | undefined;
92
+ onClearFilter?: (() => void) | undefined;
93
+ bottomSheetProps?: Partial<import("./index-7ca84eff").BottomSheetProps> | undefined;
94
+ bottomSheetHeaderAddonsProps?: Record<string, unknown> | undefined;
95
+ continueButtonProps?: import("packages/button/src").ButtonProps | undefined;
96
+ cancelButtonProps?: import("packages/button/src").ButtonProps | undefined;
97
+ Input?: React.ElementType<any> | undefined;
98
+ } & {
99
+ /**
100
+ * Контрольная точка, с нее начинается desktop версия
101
+ * @default 1024
102
+ */
103
+ breakpoint?: number | undefined;
104
+ } & React.RefAttributes<HTMLDivElement | HTMLInputElement>>;
13
105
  export { InputAutocompleteResponsiveProps, InputAutocompleteMedia, InputAutocompleteResponsive };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { forwardRef } from 'react';
2
2
  import { useMedia } from '@alfalab/hooks';
3
3
  import { InputAutocompleteDesktop } from './Component.desktop.js';
4
4
  import { InputAutocompleteMobile } from './Component.mobile.js';
@@ -12,12 +12,12 @@ import '@alfalab/core-components-button/modern';
12
12
  import './autocomplete-mobile-field/Component.js';
13
13
  import '@alfalab/core-components-form-control/modern';
14
14
 
15
- const InputAutocompleteResponsive = ({ breakpoint = 1024, ...restProps }) => {
15
+ const InputAutocompleteResponsive = forwardRef(({ breakpoint = 1024, ...restProps }, ref) => {
16
16
  const [view] = useMedia([
17
17
  ['mobile', `(max-width: ${breakpoint - 1}px)`],
18
18
  ['desktop', `(min-width: ${breakpoint}px)`],
19
19
  ], 'desktop');
20
- return view === 'desktop' ? (React.createElement(InputAutocompleteDesktop, { ...restProps })) : (React.createElement(InputAutocompleteMobile, { ...restProps }));
21
- };
20
+ return view === 'desktop' ? (React.createElement(InputAutocompleteDesktop, { ...restProps, ref: ref })) : (React.createElement(InputAutocompleteMobile, { ...restProps, ref: ref }));
21
+ });
22
22
 
23
23
  export { InputAutocompleteResponsive };
@@ -3,7 +3,7 @@ import mergeRefs from 'react-merge-refs';
3
3
  import cn from 'classnames';
4
4
  import { Input } from '@alfalab/core-components-input/modern';
5
5
 
6
- const styles = {"arrow":"input-autocomplete__arrow_81gl5","error":"input-autocomplete__error_81gl5"};
6
+ const styles = {"arrow":"input-autocomplete__arrow_nozug","error":"input-autocomplete__error_nozug"};
7
7
  require('./index.css')
8
8
 
9
9
  const AutocompleteField = ({ label, labelView = 'inner', placeholder, size, Arrow, Input: Input$1 = Input, value, error, success, hint, disabled, readOnly, onInput, inputProps = {}, innerProps, }) => {
@@ -1,4 +1,4 @@
1
- /* hash: 1w8gi */
2
- .input-autocomplete__arrow_81gl5.input-autocomplete__error_81gl5 ~ * {
1
+ /* hash: hf92a */
2
+ .input-autocomplete__arrow_nozug.input-autocomplete__error_nozug ~ * {
3
3
  display: none;
4
4
  }
@@ -3,7 +3,7 @@ import cn from 'classnames';
3
3
  import { FormControl } from '@alfalab/core-components-form-control/modern';
4
4
  import { useFocus } from '@alfalab/hooks';
5
5
 
6
- const styles = {"component":"input-autocomplete__component_1stiz","field":"input-autocomplete__field_1stiz","disabled":"input-autocomplete__disabled_1stiz","placeholder":"input-autocomplete__placeholder_1stiz","contentWrapper":"input-autocomplete__contentWrapper_1stiz","value":"input-autocomplete__value_1stiz","focusVisible":"input-autocomplete__focusVisible_1stiz"};
6
+ const styles = {"component":"input-autocomplete__component_uunff","field":"input-autocomplete__field_uunff","disabled":"input-autocomplete__disabled_uunff","placeholder":"input-autocomplete__placeholder_uunff","contentWrapper":"input-autocomplete__contentWrapper_uunff","value":"input-autocomplete__value_uunff","focusVisible":"input-autocomplete__focusVisible_uunff"};
7
7
  require('./index.css')
8
8
 
9
9
  const AutocompleteMobileField = ({ size = 'm', open, error, hint, disabled, label, labelView = 'inner', placeholder, value, innerProps, dataTestId, fieldClassName, Arrow, valueRenderer, toggleMenu, setSelectedItems, selectedMultiple, ...restProps }) => {